@origonai/web-sdk 0.1.0 → 0.1.2

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 Zn {
1
+ class Jn {
2
2
  constructor() {
3
3
  this.callbacks = {};
4
4
  }
@@ -11,7 +11,7 @@ class Zn {
11
11
  }
12
12
  }
13
13
  }
14
- class f extends Error {
14
+ class h extends Error {
15
15
  constructor(t) {
16
16
  super(t.message), this.name = "ClientError", this.kind = t.kind, t.status !== void 0 && (this.status = t.status), t.code !== void 0 && (this.code = t.code);
17
17
  }
@@ -20,112 +20,112 @@ class f extends Error {
20
20
  return this.status !== void 0 && (t.status = this.status), this.code !== void 0 && (t.code = this.code), t;
21
21
  }
22
22
  static notInitialized() {
23
- return new f({ kind: "notInitialized", message: "SDK is not initialized" });
23
+ return new h({ kind: "notInitialized", message: "SDK is not initialized" });
24
24
  }
25
25
  static noSession(t) {
26
- return new f({ kind: "noSession", message: `No active session: ${t}` });
26
+ return new h({ kind: "noSession", message: `No active session: ${t}` });
27
27
  }
28
28
  static missingField(t) {
29
- return new f({ kind: "missingField", message: `Missing required field: ${t}` });
29
+ return new h({ kind: "missingField", message: `Missing required field: ${t}` });
30
30
  }
31
31
  static serverUnavailable(t) {
32
- return new f({
32
+ return new h({
33
33
  kind: "serverUnavailable",
34
34
  status: t,
35
35
  message: `Server unavailable (status ${t})`
36
36
  });
37
37
  }
38
38
  static http(t, n, s) {
39
- return new f({ kind: "http", status: t, code: n, message: s || `HTTP ${t}` });
39
+ return new h({ kind: "http", status: t, code: n, message: s || `HTTP ${t}` });
40
40
  }
41
41
  static attachment(t, n) {
42
- return new f({ kind: "attachment", code: t, message: n });
42
+ return new h({ kind: "attachment", code: t, message: n });
43
43
  }
44
44
  static cancelled() {
45
- return new f({ kind: "cancelled", message: "Operation cancelled" });
45
+ return new h({ kind: "cancelled", message: "Operation cancelled" });
46
46
  }
47
47
  static other(t) {
48
- return new f({ kind: "other", message: t });
48
+ return new h({ kind: "other", message: t });
49
49
  }
50
50
  static session(t) {
51
- return new f({ kind: "session", message: t });
51
+ return new h({ kind: "session", message: t });
52
52
  }
53
53
  }
54
- function tn(e) {
54
+ function sn(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 S = 8, nn = 1048576, C = {
57
+ const k = 8, rn = 1048576, L = {
58
58
  REQUEST: 1,
59
59
  DATA: 2,
60
60
  ERROR: 3,
61
61
  CANCEL: 4
62
- }, sn = 0;
62
+ }, an = 0;
63
63
  class b extends Error {
64
64
  constructor(t) {
65
65
  super(t), this.name = "OrpcCodecError";
66
66
  }
67
67
  }
68
- class rn extends b {
68
+ class on extends b {
69
69
  constructor(t) {
70
- super(`frame payload too large: ${t} > ${nn}`), this.name = "OrpcFrameTooLargeError", this.declaredLength = t;
70
+ super(`frame payload too large: ${t} > ${rn}`), this.name = "OrpcFrameTooLargeError", this.declaredLength = t;
71
71
  }
72
72
  }
73
- const Ee = new TextEncoder(), an = new TextDecoder("utf-8", { fatal: !0 });
74
- function Jn(e, t, n, s) {
75
- const r = Ee.encode(e), i = Object.entries(n).map(
76
- ([d, h]) => [Ee.encode(d), Ee.encode(h)]
73
+ const we = new TextEncoder(), cn = new TextDecoder("utf-8", { fatal: !0 });
74
+ function es(e, t, n, s) {
75
+ const r = we.encode(e), i = Object.entries(n).map(
76
+ ([d, f]) => [we.encode(d), we.encode(f)]
77
77
  );
78
78
  let a = 2 + r.length + 8 + 1 + 2 + s.length;
79
- for (const [d, h] of i) a += 2 + d.length + 2 + h.length;
80
- const o = Ve(C.REQUEST, a), l = new DataView(o.buffer);
81
- let u = S;
82
- l.setUint16(u, r.length), u += 2, o.set(r, u), u += r.length, l.setBigUint64(u, BigInt(t)), u += 8, o[u++] = sn, l.setUint16(u, i.length), u += 2;
83
- for (const [d, h] of i)
84
- l.setUint16(u, d.length), u += 2, o.set(d, u), u += d.length, l.setUint16(u, h.length), u += 2, o.set(h, u), u += h.length;
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);
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;
83
+ for (const [d, f] of i)
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 zn(e) {
88
- const t = Ve(C.DATA, e.length);
89
- return t.set(e, S), t;
87
+ function ts(e) {
88
+ const t = Ve(L.DATA, e.length);
89
+ return t.set(e, k), t;
90
90
  }
91
- function on() {
92
- return Ve(C.CANCEL, 0);
91
+ function un() {
92
+ return Ve(L.CANCEL, 0);
93
93
  }
94
- function Qn(e) {
95
- if (e.length < S)
96
- throw new b(`frame shorter than header: ${e.length} < ${S}`);
94
+ function ns(e) {
95
+ if (e.length < k)
96
+ throw new b(`frame shorter than header: ${e.length} < ${k}`);
97
97
  const t = e[0];
98
- if (!Object.values(C).includes(t))
98
+ if (!Object.values(L).includes(t))
99
99
  throw new b(`unexpected frame type 0x${t.toString(16)}`);
100
- const n = new DataView(e.buffer, e.byteOffset, S), s = n.getUint16(2);
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 > nn) throw new rn(r);
104
- if (t === C.CANCEL && r !== 0)
103
+ if (r > rn) throw new on(r);
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 es(e, t) {
108
+ function ss(e, t) {
109
109
  switch (e) {
110
- case C.REQUEST: {
111
- const { path: n, body: s } = ts(t);
110
+ case L.REQUEST: {
111
+ const { path: n, body: s } = rs(t);
112
112
  return { type: "response", path: n, body: s };
113
113
  }
114
- case C.DATA:
114
+ case L.DATA:
115
115
  return { type: "data", body: t };
116
- case C.ERROR: {
116
+ case L.ERROR: {
117
117
  if (t.length < 4)
118
118
  throw new b(`ERROR frame too short for code: ${t.length}`);
119
119
  const n = new DataView(t.buffer, t.byteOffset, t.byteLength);
120
120
  let s;
121
121
  try {
122
- s = an.decode(t.subarray(4));
122
+ s = cn.decode(t.subarray(4));
123
123
  } catch {
124
124
  throw new b("ERROR reason is not valid UTF-8");
125
125
  }
126
126
  return { type: "error", code: n.getUint32(0), reason: s };
127
127
  }
128
- case C.CANCEL:
128
+ case L.CANCEL:
129
129
  return { type: "cancel" };
130
130
  default:
131
131
  throw new b(`unexpected frame type 0x${e.toString(16)}`);
@@ -134,10 +134,10 @@ function es(e, t) {
134
134
  function Ve(e, t) {
135
135
  if (!Number.isSafeInteger(t) || t < 0 || t > 4294967295)
136
136
  throw new b(`payload length is outside u32: ${t}`);
137
- const n = new Uint8Array(S + t), s = new DataView(n.buffer);
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 ts(e) {
140
+ function rs(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 ts(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 = an.decode(r);
151
+ const i = cn.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 !== sn)
155
+ if (a !== an)
156
156
  throw new b(`unsupported response encoding: ${a}`);
157
157
  const o = t.getUint16(n);
158
158
  n += 2;
@@ -171,61 +171,61 @@ function ts(e) {
171
171
  }
172
172
  return { path: i, body: e.subarray(n) };
173
173
  }
174
- const ie = /* @__PURE__ */ new Map();
175
- function rt(e) {
176
- const t = ie.get(e);
174
+ const ce = /* @__PURE__ */ new Map();
175
+ function at(e) {
176
+ const t = ce.get(e);
177
177
  if (t && !t.dead) return t;
178
178
  const n = new WebTransport(e), s = { transport: n, dead: !1 };
179
179
  return n.closed.then(
180
- () => ae(e, s),
181
- () => ae(e, s)
182
- ), ie.set(e, s), s;
180
+ () => ue(e, s),
181
+ () => ue(e, s)
182
+ ), ce.set(e, s), s;
183
183
  }
184
- function ae(e, t) {
185
- t.dead = !0, ie.get(e) === t && ie.delete(e);
184
+ function ue(e, t) {
185
+ t.dead = !0, ce.get(e) === t && ce.delete(e);
186
186
  }
187
- async function it(e) {
187
+ async function ot(e) {
188
188
  return await e.transport.ready, e.transport.createBidirectionalStream();
189
189
  }
190
- async function ns(e, t) {
191
- let n = rt(e), s, r = !1;
190
+ async function is(e, t) {
191
+ let n = at(e), s, r = !1;
192
192
  try {
193
- s = await it(n);
193
+ s = await ot(n);
194
194
  } catch {
195
- ae(e, n), r = !0, n = rt(e), s = await it(n);
195
+ ue(e, n), r = !0, n = at(e), s = await ot(n);
196
196
  }
197
197
  const i = s.writable.getWriter(), a = s.readable.getReader();
198
198
  try {
199
199
  await i.write(t);
200
200
  } catch (o) {
201
- throw at(e, n, o), o;
201
+ throw ct(e, n, o), o;
202
202
  }
203
203
  return {
204
204
  reader: a,
205
205
  writer: i,
206
206
  reconnected: r,
207
- sessionFailed: (o) => at(e, n, o)
207
+ sessionFailed: (o) => ct(e, n, o)
208
208
  };
209
209
  }
210
- function at(e, t, n) {
211
- typeof n != "object" && typeof n != "function" || n === null || n.source === "session" && ae(e, t);
210
+ function ct(e, t, n) {
211
+ typeof n != "object" && typeof n != "function" || n === null || n.source === "session" && ue(e, t);
212
212
  }
213
- class ot {
213
+ class ut {
214
214
  constructor(t) {
215
215
  this.reader = t, this.chunks = [], this.available = 0, this.ended = !1;
216
216
  }
217
217
  async readFrame() {
218
- if (await this.ensure(S), this.available === 0 && this.ended) return null;
219
- if (this.available < S)
218
+ if (await this.ensure(k), this.available === 0 && this.ended) return null;
219
+ if (this.available < k)
220
220
  throw new b(
221
- `response FIN truncated frame header: have ${this.available}, need ${S}`
221
+ `response FIN truncated frame header: have ${this.available}, need ${k}`
222
222
  );
223
- const t = Qn(this.peek(S)), n = S + t.payloadLen;
223
+ const t = ns(this.peek(k)), n = k + t.payloadLen;
224
224
  if (await this.ensure(n), this.available < n)
225
225
  throw new b(
226
- `response FIN truncated frame payload: have ${this.available - S}, need ${t.payloadLen}`
226
+ `response FIN truncated frame payload: have ${this.available - k}, need ${t.payloadLen}`
227
227
  );
228
- return this.take(S), es(t.frameType, this.take(t.payloadLen));
228
+ return this.take(k), ss(t.frameType, this.take(t.payloadLen));
229
229
  }
230
230
  async cancel(t) {
231
231
  await this.reader.cancel(t);
@@ -268,7 +268,7 @@ class ot {
268
268
  return s;
269
269
  }
270
270
  }
271
- const Z = {
271
+ const Q = {
272
272
  /** bad signature / malformed token → refresh + retry once, then logout */
273
273
  INVALID: 4096,
274
274
  /** token past `exp` → refresh + retry once, then logout */
@@ -277,151 +277,151 @@ const Z = {
277
277
  STALE: 4098,
278
278
  /** session logged out / user deleted / banned → logout */
279
279
  REVOKED: 4099
280
- }, P = {
280
+ }, B = {
281
281
  INVALID_ARGUMENT: 2,
282
282
  CANCELLED: 4,
283
283
  /** Streaming DATA exceeds the ingress cap. */
284
284
  MESSAGE_TOO_LARGE: 12
285
- }, ss = "DATA frame too large";
286
- class k extends Error {
285
+ }, as = "DATA frame too large";
286
+ class T 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 rs(e) {
291
+ function os(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 is(e) {
297
- if (!rs(e))
296
+ function cs(e) {
297
+ if (!os(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 === P.MESSAGE_TOO_LARGE ? ss : `WebTransport stream aborted with code 0x${e.streamErrorCode.toString(16)}`;
300
- return new k(e.streamErrorCode, t);
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);
301
301
  }
302
- function cn(e, t = "orpc stream cancelled") {
302
+ function ln(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 as = {
308
+ const us = {
309
309
  event() {
310
310
  }
311
- }, os = [];
312
- function cs() {
313
- return os.slice();
311
+ }, ls = [];
312
+ function ds() {
313
+ return ls.slice();
314
314
  }
315
- typeof window < "u" && (window.__orpcDebug = cs);
316
- function us(e, t, n = {}) {
317
- const s = n.logger ?? as, r = n.transport ?? ns, i = { ...n.metadata };
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 };
318
318
  delete i.authorization;
319
- async function a(d, h) {
320
- const m = t.getToken(), g = m ? { ...i, authorization: `Bearer ${m}` } : { ...i }, E = Jn(d, 0, g, h);
321
- s.event({ kind: "request", path: d, reqBytes: E.length });
322
- const p = await r(e, E);
323
- return p.reconnected && s.event({ kind: "transport", path: d, event: "reconnect" }), p;
324
- }
325
- async function o(d, h, m) {
326
- const g = ye(), E = await a(d, h), p = new ot(E.reader), H = E.writer.close().then(
319
+ async function a(d, f) {
320
+ const p = t.getToken(), m = p ? { ...i, authorization: `Bearer ${p}` } : { ...i }, g = es(d, 0, m, f);
321
+ s.event({ kind: "request", path: d, reqBytes: g.length });
322
+ const E = await r(e, g);
323
+ return E.reconnected && s.event({ kind: "transport", path: d, event: "reconnect" }), E;
324
+ }
325
+ async function o(d, f, p) {
326
+ const m = Ie(), g = await a(d, f), E = new ut(g.reader), x = g.writer.close().then(
327
327
  () => null,
328
- (_) => M(E, _)
328
+ (v) => V(g, v)
329
329
  );
330
- let I;
330
+ let N;
331
331
  try {
332
- I = await p.readFrame();
333
- } catch (_) {
334
- throw await O(E, p, _), M(E, _);
332
+ N = await E.readFrame();
333
+ } catch (v) {
334
+ throw await O(g, E, v), V(g, v);
335
335
  }
336
- if (I === null) throw new b("response FIN before unary reply");
337
- if (I.type === "data" || I.type === "cancel")
336
+ if (N === null) throw new b("response FIN before unary reply");
337
+ if (N.type === "data" || N.type === "cancel")
338
338
  throw await O(
339
+ g,
339
340
  E,
340
- p,
341
- new b(`unexpected ${I.type} frame`)
342
- ), new b(`unexpected ${I.type} frame before unary reply`);
343
- let nt;
341
+ new b(`unexpected ${N.type} frame`)
342
+ ), new b(`unexpected ${N.type} frame before unary reply`);
343
+ let rt;
344
344
  try {
345
- nt = await p.readFrame();
346
- } catch (_) {
347
- throw await O(E, p, _), M(E, _);
345
+ rt = await E.readFrame();
346
+ } catch (v) {
347
+ throw await O(g, E, v), V(g, v);
348
348
  }
349
- if (nt !== null) {
350
- const _ = new b("trailing frame after unary terminal");
351
- throw await O(E, p, _), _;
349
+ if (rt !== null) {
350
+ const v = new b("trailing frame after unary terminal");
351
+ throw await O(g, E, v), v;
352
352
  }
353
- if (I.type === "error")
353
+ if (N.type === "error")
354
354
  return s.event({
355
355
  kind: "error",
356
356
  path: d,
357
- code: I.code,
358
- reason: I.reason,
359
- ms: ye() - g
360
- }), u(I.code, I.reason, d, h, m);
361
- if (I.path !== d)
362
- throw new b(`response path mismatch: expected ${d}, got ${I.path}`);
363
- const st = await H;
364
- if (st) throw st;
365
- return s.event({ kind: "response", path: d, respBytes: I.body.length, ms: ye() - g }), I.body;
366
- }
367
- async function l(d, h) {
368
- const m = await a(d, h), g = new ot(m.reader);
369
- let E;
357
+ code: N.code,
358
+ reason: N.reason,
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}`);
363
+ const it = await x;
364
+ if (it) throw it;
365
+ return s.event({ kind: "response", path: d, respBytes: N.body.length, ms: Ie() - m }), N.body;
366
+ }
367
+ async function l(d, f) {
368
+ const p = await a(d, f), m = new ut(p.reader);
369
+ let g;
370
370
  try {
371
- E = await g.readFrame();
372
- } catch (p) {
373
- throw await O(m, g, p), M(m, p);
371
+ g = await m.readFrame();
372
+ } catch (E) {
373
+ throw await O(p, m, E), V(p, E);
374
374
  }
375
- if (E === null) {
376
- const p = new b("response FIN before streaming REQUEST echo");
377
- throw await O(m, g, p), p;
375
+ if (g === null) {
376
+ const E = new b("response FIN before streaming REQUEST echo");
377
+ throw await O(p, m, E), E;
378
378
  }
379
- if (E.type === "error")
380
- throw await un(m), new k(E.code, E.reason);
381
- if (E.type !== "response") {
382
- const p = new b(
383
- `unexpected ${E.type} frame before streaming REQUEST echo`
379
+ if (g.type === "error")
380
+ throw await dn(p), new T(g.code, g.reason);
381
+ if (g.type !== "response") {
382
+ const E = new b(
383
+ `unexpected ${g.type} frame before streaming REQUEST echo`
384
384
  );
385
- throw await O(m, g, p), p;
385
+ throw await O(p, m, E), E;
386
386
  }
387
- if (E.path !== d) {
388
- const p = new b(
389
- `response path mismatch: expected ${d}, got ${E.path}`
387
+ if (g.path !== d) {
388
+ const E = new b(
389
+ `response path mismatch: expected ${d}, got ${g.path}`
390
390
  );
391
- throw await O(m, g, p), p;
391
+ throw await O(p, m, E), E;
392
392
  }
393
- return new ls(E.body, m, g);
393
+ return new fs(g.body, p, m);
394
394
  }
395
- async function u(d, h, m, g, E) {
395
+ async function u(d, f, p, m, g) {
396
396
  switch (d) {
397
- case Z.INVALID:
398
- case Z.EXPIRED:
399
- if (E)
400
- throw t.logout(), new k(d, h);
401
- return await t.refresh(), o(m, g, !0);
402
- case Z.STALE:
403
- throw await t.refresh(), typeof window < "u" && window.location.reload(), new k(d, h);
404
- case Z.REVOKED:
405
- throw t.logout(), new k(d, h);
397
+ case Q.INVALID:
398
+ case Q.EXPIRED:
399
+ if (g)
400
+ throw t.logout(), new T(d, f);
401
+ return await t.refresh(), o(p, m, !0);
402
+ case Q.STALE:
403
+ throw await t.refresh(), typeof window < "u" && window.location.reload(), new T(d, f);
404
+ case Q.REVOKED:
405
+ throw t.logout(), new T(d, f);
406
406
  default:
407
- throw new k(d, h);
407
+ throw new T(d, f);
408
408
  }
409
409
  }
410
410
  return {
411
- call: (d, h) => o(d, h, !1),
411
+ call: (d, f) => o(d, f, !1),
412
412
  stream: l
413
413
  };
414
414
  }
415
- class ls {
415
+ class fs {
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(zn(t));
422
+ await this.channel.writer.write(ts(t));
423
423
  } catch (n) {
424
- throw this.upload = "stopped", this.uploadError = M(this.channel, n), this.uploadError;
424
+ throw this.upload = "stopped", this.uploadError = V(this.channel, n), this.uploadError;
425
425
  }
426
426
  }
427
427
  async finish() {
@@ -429,23 +429,23 @@ class ls {
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 k(P.CANCELLED, "upload stopped");
432
+ throw this.uploadError ?? new T(B.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 = M(this.channel, t), this.uploadError;
438
+ throw this.upload = "stopped", this.uploadError = V(this.channel, t), this.uploadError;
439
439
  }
440
440
  ), this.finishPromise;
441
441
  }
442
442
  }
443
443
  }
444
- async cancel(t = P.CANCELLED) {
445
- if (ds(t), this.cancelPromise) return this.cancelPromise;
444
+ async cancel(t = B.CANCELLED) {
445
+ if (ms(t), this.cancelPromise) return this.cancelPromise;
446
446
  if (this.terminal !== "open") return;
447
- this.terminal = "cancelled", this.terminalError = new k(t, "stream cancelled");
448
- const n = cn(t);
447
+ this.terminal = "cancelled", this.terminalError = new T(t, "stream cancelled");
448
+ const n = ln(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 ls {
475
475
  t = await this.frames.readFrame();
476
476
  } catch (s) {
477
477
  if (this.terminalError) throw this.terminalError;
478
- const r = M(this.channel, s);
478
+ const r = V(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 ls {
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 k(t.code, t.reason), un(this.channel), this.terminalError;
486
+ throw this.terminal = "error", this.terminalError = new T(t.code, t.reason), dn(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 k(P.CANCELLED, "stream is terminal");
492
+ if (this.terminal !== "open") throw new T(B.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 ls {
501
501
  if (this.upload === "open") {
502
502
  this.upload = "closing";
503
503
  try {
504
- await this.channel.writer.write(on()), await this.channel.writer.close(), this.upload = "closed";
504
+ await this.channel.writer.write(un()), 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 ls {
510
510
  }
511
511
  async function O(e, t, n) {
512
512
  if (!(n instanceof b)) return;
513
- const s = n instanceof rn ? P.MESSAGE_TOO_LARGE : P.INVALID_ARGUMENT, r = cn(s, n.message);
513
+ const s = n instanceof on ? B.MESSAGE_TOO_LARGE : B.INVALID_ARGUMENT, r = ln(s, n.message);
514
514
  await Promise.allSettled([
515
515
  (async () => {
516
516
  try {
517
- await e.writer.write(on()), await e.writer.close();
517
+ await e.writer.write(un()), await e.writer.close();
518
518
  } catch (i) {
519
519
  e.sessionFailed?.(i);
520
520
  }
@@ -522,27 +522,27 @@ async function O(e, t, n) {
522
522
  t.cancel(r).catch((i) => e.sessionFailed?.(i))
523
523
  ]);
524
524
  }
525
- async function un(e) {
525
+ async function dn(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 M(e, t) {
533
- return e.sessionFailed?.(t), is(t);
532
+ function V(e, t) {
533
+ return e.sessionFailed?.(t), cs(t);
534
534
  }
535
- function ds(e) {
535
+ function ms(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
  }
539
- function ye() {
539
+ function Ie() {
540
540
  return typeof performance < "u" ? performance.now() : Date.now();
541
541
  }
542
- function oe(e) {
542
+ function W(e) {
543
543
  return new Promise((t) => setTimeout(t, e));
544
544
  }
545
- function ln() {
545
+ function hn() {
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 ln() {
551
551
  20
552
552
  )}-${n.slice(20)}`;
553
553
  }
554
- function Be(e, t) {
554
+ function Fe(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 hs() {
561
+ function ps() {
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++];
@@ -575,7 +575,7 @@ function hs() {
575
575
  }
576
576
  throw new Error("invalid varint");
577
577
  }
578
- function we(e, t, n) {
578
+ function Ne(e, t, n) {
579
579
  for (let i = 0; i < 28; i = i + 7) {
580
580
  const a = e >>> i, o = !(!(a >>> 7) && t == 0), l = (o ? a | 128 : a) & 255;
581
581
  if (n.push(l), !o)
@@ -591,43 +591,43 @@ function we(e, t, n) {
591
591
  n.push(t >>> 31 & 1);
592
592
  }
593
593
  }
594
- const se = 4294967296;
595
- function ct(e) {
594
+ const ae = 4294967296;
595
+ function lt(e) {
596
596
  const t = e[0] === "-";
597
597
  t && (e = e.slice(1));
598
598
  const n = 1e6;
599
599
  let s = 0, r = 0;
600
600
  function i(a, o) {
601
601
  const l = Number(e.slice(a, o));
602
- r *= n, s = s * n + l, s >= se && (r = r + (s / se | 0), s = s % se);
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 ? hn(s, r) : Pe(s, r);
604
+ return i(-24, -18), i(-18, -12), i(-12, -6), i(-6), t ? mn(s, r) : Ge(s, r);
605
605
  }
606
- function fs(e, t) {
607
- let n = Pe(e, t);
606
+ function bs(e, t) {
607
+ let n = Ge(e, t);
608
608
  const s = n.hi & 2147483648;
609
- s && (n = hn(n.lo, n.hi));
610
- const r = dn(n.lo, n.hi);
609
+ s && (n = mn(n.lo, n.hi));
610
+ const r = fn(n.lo, n.hi);
611
611
  return s ? "-" + r : r;
612
612
  }
613
- function dn(e, t) {
614
- if ({ lo: e, hi: t } = ms(e, t), t <= 2097151)
615
- return String(se * t + e);
613
+ function fn(e, t) {
614
+ if ({ lo: e, hi: t } = gs(e, t), t <= 2097151)
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
- return i >= l && (a += Math.floor(i / l), i %= l), a >= l && (o += Math.floor(a / l), a %= l), o.toString() + ut(a) + ut(i);
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 ms(e, t) {
621
+ function gs(e, t) {
622
622
  return { lo: e >>> 0, hi: t >>> 0 };
623
623
  }
624
- function Pe(e, t) {
624
+ function Ge(e, t) {
625
625
  return { lo: e | 0, hi: t | 0 };
626
626
  }
627
- function hn(e, t) {
628
- return t = ~t, e ? e = ~e + 1 : t += 1, Pe(e, t);
627
+ function mn(e, t) {
628
+ return t = ~t, e ? e = ~e + 1 : t += 1, Ge(e, t);
629
629
  }
630
- const ut = (e) => {
630
+ const dt = (e) => {
631
631
  const t = String(e);
632
632
  return "0000000".slice(t.length) + t;
633
633
  };
@@ -642,7 +642,7 @@ function Ce(e, t) {
642
642
  t.push(1);
643
643
  }
644
644
  }
645
- function ps() {
645
+ function Es() {
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 ps() {
659
659
  throw new Error("invalid varint");
660
660
  return this.assertBounds(), t >>> 0;
661
661
  }
662
- const w = /* @__PURE__ */ bs();
663
- function bs() {
662
+ const w = /* @__PURE__ */ ys();
663
+ function ys() {
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");
@@ -703,34 +703,34 @@ function bs() {
703
703
  zero: "0",
704
704
  supported: !1,
705
705
  parse(n) {
706
- return typeof n != "string" && (n = n.toString()), lt(n), n;
706
+ return typeof n != "string" && (n = n.toString()), ht(n), n;
707
707
  },
708
708
  uParse(n) {
709
- return typeof n != "string" && (n = n.toString()), dt(n), n;
709
+ return typeof n != "string" && (n = n.toString()), ft(n), n;
710
710
  },
711
711
  enc(n) {
712
- return typeof n != "string" && (n = n.toString()), lt(n), ct(n);
712
+ return typeof n != "string" && (n = n.toString()), ht(n), lt(n);
713
713
  },
714
714
  uEnc(n) {
715
- return typeof n != "string" && (n = n.toString()), dt(n), ct(n);
715
+ return typeof n != "string" && (n = n.toString()), ft(n), lt(n);
716
716
  },
717
717
  dec(n, s) {
718
- return fs(n, s);
718
+ return bs(n, s);
719
719
  },
720
720
  uDec(n, s) {
721
- return dn(n, s);
721
+ return fn(n, s);
722
722
  }
723
723
  };
724
724
  }
725
- function lt(e) {
725
+ function ht(e) {
726
726
  if (!/^-?[0-9]+$/.test(e))
727
727
  throw new Error("invalid int64: " + e);
728
728
  }
729
- function dt(e) {
729
+ function ft(e) {
730
730
  if (!/^[0-9]+$/.test(e))
731
731
  throw new Error("invalid uint64: " + e);
732
732
  }
733
- function X(e, t) {
733
+ function q(e, t) {
734
734
  switch (e) {
735
735
  case c.STRING:
736
736
  return "";
@@ -751,7 +751,7 @@ function X(e, t) {
751
751
  return 0;
752
752
  }
753
753
  }
754
- function gs(e, t) {
754
+ function ws(e, t) {
755
755
  switch (e) {
756
756
  case c.BOOL:
757
757
  return t === !1;
@@ -766,16 +766,16 @@ function gs(e, t) {
766
766
  return t == 0;
767
767
  }
768
768
  }
769
- const fn = 2, v = Symbol.for("reflect unsafe local");
770
- function mn(e, t) {
769
+ const pn = 2, M = Symbol.for("reflect unsafe local");
770
+ function bn(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 Es(e, t) {
774
+ function Is(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 != fn)
778
+ if (t.presence != pn)
779
779
  return e[n] !== void 0 && Object.prototype.hasOwnProperty.call(e, n);
780
780
  switch (t.fieldKind) {
781
781
  case "list":
@@ -783,34 +783,34 @@ function Es(e, t) {
783
783
  case "map":
784
784
  return Object.keys(e[n]).length > 0;
785
785
  case "scalar":
786
- return !gs(t.scalar, e[n]);
786
+ return !ws(t.scalar, e[n]);
787
787
  case "enum":
788
788
  return e[n] !== t.enum.values[0].number;
789
789
  }
790
790
  throw new Error("message field with implicit presence");
791
791
  }
792
- function W(e, t) {
792
+ function H(e, t) {
793
793
  return Object.prototype.hasOwnProperty.call(e, t) && e[t] !== void 0;
794
794
  }
795
- function pn(e, t) {
795
+ function gn(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 bn(e, t, n) {
802
+ function En(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 ys(e, t) {
808
+ function Ns(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 != fn)
813
+ } else if (t.presence != pn)
814
814
  delete e[n];
815
815
  else
816
816
  switch (t.fieldKind) {
@@ -824,16 +824,16 @@ function ys(e, t) {
824
824
  e[n] = t.enum.values[0].number;
825
825
  break;
826
826
  case "scalar":
827
- e[n] = X(t.scalar, t.longAsString);
827
+ e[n] = q(t.scalar, t.longAsString);
828
828
  break;
829
829
  }
830
830
  }
831
- function U(e) {
831
+ function P(e) {
832
832
  return e !== null && typeof e == "object" && !Array.isArray(e);
833
833
  }
834
- function Fe(e, t) {
834
+ function Be(e, t) {
835
835
  var n, s, r, i;
836
- if (U(e) && v in e && "add" in e && "field" in e && typeof e.field == "function") {
836
+ if (P(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);
@@ -842,9 +842,9 @@ function Fe(e, t) {
842
842
  }
843
843
  return !1;
844
844
  }
845
- function Ge(e, t) {
845
+ function Ye(e, t) {
846
846
  var n, s, r, i;
847
- if (U(e) && v in e && "has" in e && "field" in e && typeof e.field == "function") {
847
+ if (P(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);
@@ -853,17 +853,17 @@ function Ge(e, t) {
853
853
  }
854
854
  return !1;
855
855
  }
856
- function Ye(e, t) {
857
- return U(e) && v in e && "desc" in e && U(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
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);
858
858
  }
859
- function ws(e) {
860
- return En(e.$typeName);
859
+ function Ts(e) {
860
+ return wn(e.$typeName);
861
861
  }
862
- function gn(e) {
862
+ function yn(e) {
863
863
  const t = e.fields[0];
864
- return En(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
864
+ return wn(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
865
865
  }
866
- function En(e) {
866
+ function wn(e) {
867
867
  return e.startsWith("google.protobuf.") && [
868
868
  "DoubleValue",
869
869
  "FloatValue",
@@ -876,122 +876,122 @@ function En(e) {
876
876
  "BytesValue"
877
877
  ].includes(e.substring(16));
878
878
  }
879
- const Ns = 999, Is = 998, re = 2;
880
- function x(e, t) {
881
- if (Be(t, e))
879
+ const Ss = 999, ks = 998, oe = 2;
880
+ function C(e, t) {
881
+ if (Fe(t, e))
882
882
  return t;
883
- const n = _s(e);
884
- return t !== void 0 && Ts(e, n, t), n;
883
+ const n = Os(e);
884
+ return t !== void 0 && As(e, n, t), n;
885
885
  }
886
- function Ts(e, t, n) {
886
+ function As(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 = mn(n, s);
893
+ const a = bn(n, s);
894
894
  if (!a)
895
895
  continue;
896
- i = a, r = pn(n, a);
896
+ i = a, r = gn(n, a);
897
897
  } else
898
898
  i = s;
899
899
  switch (i.fieldKind) {
900
900
  case "message":
901
- r = $e(i, r);
901
+ r = Xe(i, r);
902
902
  break;
903
903
  case "scalar":
904
- r = yn(i, r);
904
+ r = In(i, r);
905
905
  break;
906
906
  case "list":
907
- r = ks(i, r);
907
+ r = _s(i, r);
908
908
  break;
909
909
  case "map":
910
- r = Ss(i, r);
910
+ r = Rs(i, r);
911
911
  break;
912
912
  }
913
- bn(t, i, r);
913
+ En(t, i, r);
914
914
  }
915
915
  return t;
916
916
  }
917
- function yn(e, t) {
917
+ function In(e, t) {
918
918
  return e.scalar == c.BYTES ? Ke(t) : t;
919
919
  }
920
- function Ss(e, t) {
921
- if (U(t)) {
920
+ function Rs(e, t) {
921
+ if (P(t)) {
922
922
  if (e.scalar == c.BYTES)
923
- return ht(t, Ke);
923
+ return mt(t, Ke);
924
924
  if (e.mapKind == "message")
925
- return ht(t, (n) => $e(e, n));
925
+ return mt(t, (n) => Xe(e, n));
926
926
  }
927
927
  return t;
928
928
  }
929
- function ks(e, t) {
929
+ function _s(e, t) {
930
930
  if (Array.isArray(t)) {
931
931
  if (e.scalar == c.BYTES)
932
932
  return t.map(Ke);
933
933
  if (e.listKind == "message")
934
- return t.map((n) => $e(e, n));
934
+ return t.map((n) => Xe(e, n));
935
935
  }
936
936
  return t;
937
937
  }
938
- function $e(e, t) {
939
- if (e.fieldKind == "message" && !e.oneof && gn(e.message))
940
- return yn(e.message.fields[0], t);
941
- if (U(t)) {
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)) {
942
942
  if (e.message.typeName == "google.protobuf.Struct" && e.parent.typeName !== "google.protobuf.Value")
943
943
  return t;
944
- if (!Be(t, e.message))
945
- return x(e.message, t);
944
+ if (!Fe(t, e.message))
945
+ return C(e.message, t);
946
946
  }
947
947
  return t;
948
948
  }
949
949
  function Ke(e) {
950
950
  return Array.isArray(e) ? new Uint8Array(e) : e;
951
951
  }
952
- function ht(e, t) {
952
+ function mt(e, t) {
953
953
  const n = {};
954
954
  for (const s of Object.entries(e))
955
955
  n[s[0]] = t(s[1]);
956
956
  return n;
957
957
  }
958
- const As = Symbol(), ft = /* @__PURE__ */ new WeakMap();
959
- function _s(e) {
958
+ const vs = Symbol(), pt = /* @__PURE__ */ new WeakMap();
959
+ function Os(e) {
960
960
  let t;
961
- if (Os(e)) {
962
- const n = ft.get(e);
961
+ if (Cs(e)) {
962
+ const n = pt.get(e);
963
963
  let s, r;
964
964
  if (n)
965
965
  ({ prototype: s, members: r } = n);
966
966
  else {
967
967
  s = {}, r = /* @__PURE__ */ new Set();
968
968
  for (const i of e.members)
969
- i.kind != "oneof" && (i.fieldKind != "scalar" && i.fieldKind != "enum" || i.presence != re && (r.add(i), s[i.localName] = Ne(i)));
970
- ft.set(e, { prototype: s, members: r });
969
+ i.kind != "oneof" && (i.fieldKind != "scalar" && i.fieldKind != "enum" || i.presence != oe && (r.add(i), s[i.localName] = Te(i)));
970
+ pt.set(e, { prototype: s, members: r });
971
971
  }
972
972
  t = Object.create(s), t.$typeName = e.typeName;
973
973
  for (const i of e.members)
974
- r.has(i) || i.kind == "field" && (i.fieldKind == "message" || (i.fieldKind == "scalar" || i.fieldKind == "enum") && i.presence != re) || (t[i.localName] = Ne(i));
974
+ r.has(i) || i.kind == "field" && (i.fieldKind == "message" || (i.fieldKind == "scalar" || i.fieldKind == "enum") && i.presence != oe) || (t[i.localName] = Te(i));
975
975
  } else {
976
976
  t = {
977
977
  $typeName: e.typeName
978
978
  };
979
979
  for (const n of e.members)
980
- (n.kind == "oneof" || n.presence == re) && (t[n.localName] = Ne(n));
980
+ (n.kind == "oneof" || n.presence == oe) && (t[n.localName] = Te(n));
981
981
  }
982
982
  return t;
983
983
  }
984
- function Os(e) {
984
+ function Cs(e) {
985
985
  switch (e.file.edition) {
986
- case Ns:
986
+ case Ss:
987
987
  return !1;
988
- case Is:
988
+ case ks:
989
989
  return !0;
990
990
  default:
991
- return e.fields.some((t) => t.presence != re && t.fieldKind != "message" && !t.oneof);
991
+ return e.fields.some((t) => t.presence != oe && t.fieldKind != "message" && !t.oneof);
992
992
  }
993
993
  }
994
- function Ne(e) {
994
+ function Te(e) {
995
995
  if (e.kind == "oneof")
996
996
  return { case: void 0 };
997
997
  if (e.fieldKind == "list")
@@ -999,21 +999,21 @@ function Ne(e) {
999
999
  if (e.fieldKind == "map")
1000
1000
  return {};
1001
1001
  if (e.fieldKind == "message")
1002
- return As;
1002
+ return vs;
1003
1003
  const t = e.getDefaultValue();
1004
- return t !== void 0 ? e.fieldKind == "scalar" && e.longAsString ? t.toString() : t : e.fieldKind == "scalar" ? X(e.scalar, e.longAsString) : e.enum.values[0].number;
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 F extends Error {
1006
+ class Y extends Error {
1007
1007
  constructor(t, n, s = "FieldValueInvalidError") {
1008
1008
  super(n), this.name = s, this.field = () => t;
1009
1009
  }
1010
1010
  }
1011
- const Ie = Symbol.for("@bufbuild/protobuf/text-encoding");
1012
- function Xe() {
1013
- if (globalThis[Ie] == null) {
1011
+ const Se = Symbol.for("@bufbuild/protobuf/text-encoding");
1012
+ function We() {
1013
+ if (globalThis[Se] == null) {
1014
1014
  const e = new globalThis.TextEncoder(), t = new globalThis.TextDecoder();
1015
1015
  let n;
1016
- globalThis[Ie] = {
1016
+ globalThis[Se] = {
1017
1017
  encodeUtf8(s) {
1018
1018
  return e.encode(s);
1019
1019
  },
@@ -1029,15 +1029,15 @@ function Xe() {
1029
1029
  }
1030
1030
  };
1031
1031
  }
1032
- return globalThis[Ie];
1032
+ return globalThis[Se];
1033
1033
  }
1034
- var N;
1034
+ 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
- })(N || (N = {}));
1038
- const wn = 34028234663852886e22, Nn = -34028234663852886e22, In = 4294967295, Tn = 2147483647, Sn = -2147483648;
1039
- class Rs {
1040
- constructor(t = Xe().encodeUtf8) {
1037
+ })(I || (I = {}));
1038
+ const Nn = 34028234663852886e22, Tn = -34028234663852886e22, Sn = 4294967295, kn = 2147483647, An = -2147483648;
1039
+ class Ds {
1040
+ constructor(t = We().encodeUtf8) {
1041
1041
  this.encodeUtf8 = t, this.stack = [], this.chunks = [], this.buf = [];
1042
1042
  }
1043
1043
  /**
@@ -1092,7 +1092,7 @@ class Rs {
1092
1092
  * Write a `uint32` value, an unsigned 32 bit varint.
1093
1093
  */
1094
1094
  uint32(t) {
1095
- for (mt(t); t > 127; )
1095
+ for (bt(t); t > 127; )
1096
1096
  this.buf.push(t & 127 | 128), t = t >>> 7;
1097
1097
  return this.buf.push(t), this;
1098
1098
  }
@@ -1100,7 +1100,7 @@ class Rs {
1100
1100
  * Write a `int32` value, a signed 32 bit varint.
1101
1101
  */
1102
1102
  int32(t) {
1103
- return Te(t), Ce(t, this.buf), this;
1103
+ return ke(t), Ce(t, this.buf), this;
1104
1104
  }
1105
1105
  /**
1106
1106
  * Write a `bool` value, a varint.
@@ -1125,7 +1125,7 @@ class Rs {
1125
1125
  * Write a `float` value, 32-bit floating point number.
1126
1126
  */
1127
1127
  float(t) {
1128
- vs(t);
1128
+ Ls(t);
1129
1129
  let n = new Uint8Array(4);
1130
1130
  return new DataView(n.buffer).setFloat32(0, t, !0), this.raw(n);
1131
1131
  }
@@ -1140,7 +1140,7 @@ class Rs {
1140
1140
  * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
1141
1141
  */
1142
1142
  fixed32(t) {
1143
- mt(t);
1143
+ bt(t);
1144
1144
  let n = new Uint8Array(4);
1145
1145
  return new DataView(n.buffer).setUint32(0, t, !0), this.raw(n);
1146
1146
  }
@@ -1148,7 +1148,7 @@ class Rs {
1148
1148
  * Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
1149
1149
  */
1150
1150
  sfixed32(t) {
1151
- Te(t);
1151
+ ke(t);
1152
1152
  let n = new Uint8Array(4);
1153
1153
  return new DataView(n.buffer).setInt32(0, t, !0), this.raw(n);
1154
1154
  }
@@ -1156,7 +1156,7 @@ class Rs {
1156
1156
  * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
1157
1157
  */
1158
1158
  sint32(t) {
1159
- return Te(t), t = (t << 1 ^ t >> 31) >>> 0, Ce(t, this.buf), this;
1159
+ return ke(t), t = (t << 1 ^ t >> 31) >>> 0, Ce(t, this.buf), this;
1160
1160
  }
1161
1161
  /**
1162
1162
  * Write a `sfixed64` value, a signed, fixed-length 64-bit integer.
@@ -1177,26 +1177,26 @@ class Rs {
1177
1177
  */
1178
1178
  int64(t) {
1179
1179
  let n = w.enc(t);
1180
- return we(n.lo, n.hi, this.buf), this;
1180
+ return Ne(n.lo, n.hi, this.buf), this;
1181
1181
  }
1182
1182
  /**
1183
1183
  * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
1184
1184
  */
1185
1185
  sint64(t) {
1186
1186
  const n = w.enc(t), s = n.hi >> 31, r = n.lo << 1 ^ s, i = (n.hi << 1 | n.lo >>> 31) ^ s;
1187
- return we(r, i, this.buf), this;
1187
+ return Ne(r, i, this.buf), this;
1188
1188
  }
1189
1189
  /**
1190
1190
  * Write a `uint64` value, an unsigned 64-bit varint.
1191
1191
  */
1192
1192
  uint64(t) {
1193
1193
  const n = w.uEnc(t);
1194
- return we(n.lo, n.hi, this.buf), this;
1194
+ return Ne(n.lo, n.hi, this.buf), this;
1195
1195
  }
1196
1196
  }
1197
- class Cs {
1198
- constructor(t, n = Xe().decodeUtf8) {
1199
- this.decodeUtf8 = n, this.varint64 = hs, this.uint32 = ps, this.buf = t, this.len = t.length, this.pos = 0, this.view = new DataView(t.buffer, t.byteOffset, t.byteLength);
1197
+ class Us {
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);
1200
1200
  }
1201
1201
  /**
1202
1202
  * Reads a tag - field number and wire type. Tags are uint32 varints; values
@@ -1222,26 +1222,26 @@ class Cs {
1222
1222
  skip(t, n, s = 100) {
1223
1223
  let r = this.pos;
1224
1224
  switch (t) {
1225
- case N.Varint:
1225
+ case I.Varint:
1226
1226
  for (; this.buf[this.pos++] & 128; )
1227
1227
  ;
1228
1228
  break;
1229
1229
  // @ts-ignore TS7029: Fallthrough case in switch -- ignore instead of expect-error for compiler settings without noFallthroughCasesInSwitch: true
1230
- case N.Bit64:
1230
+ case I.Bit64:
1231
1231
  this.pos += 4;
1232
- case N.Bit32:
1232
+ case I.Bit32:
1233
1233
  this.pos += 4;
1234
1234
  break;
1235
- case N.LengthDelimited:
1235
+ case I.LengthDelimited:
1236
1236
  let i = this.uint32();
1237
1237
  this.pos += i;
1238
1238
  break;
1239
- case N.StartGroup:
1239
+ case I.StartGroup:
1240
1240
  if (s <= 0)
1241
1241
  throw new Error("maximum recursion depth reached");
1242
1242
  for (; ; ) {
1243
1243
  const [a, o] = this.tag();
1244
- if (o === N.EndGroup) {
1244
+ if (o === I.EndGroup) {
1245
1245
  if (n !== void 0 && a !== n)
1246
1246
  throw new Error("invalid end group tag");
1247
1247
  break;
@@ -1351,82 +1351,82 @@ class Cs {
1351
1351
  return this.decodeUtf8(this.bytes(), t);
1352
1352
  }
1353
1353
  }
1354
- function Te(e) {
1354
+ function ke(e) {
1355
1355
  if (typeof e == "string")
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 > Tn || e < Sn)
1359
+ if (!Number.isInteger(e) || e > kn || e < An)
1360
1360
  throw new Error("invalid int32: " + e);
1361
1361
  }
1362
- function mt(e) {
1362
+ function bt(e) {
1363
1363
  if (typeof e == "string")
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 > In || e < 0)
1367
+ if (!Number.isInteger(e) || e > Sn || e < 0)
1368
1368
  throw new Error("invalid uint32: " + e);
1369
1369
  }
1370
- function vs(e) {
1370
+ function Ls(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 > wn || e < Nn))
1377
+ if (Number.isFinite(e) && (e > Nn || e < Tn))
1378
1378
  throw new Error("invalid float32: " + e);
1379
1379
  }
1380
- function Ds(e, t) {
1381
- const n = e.fieldKind == "list" ? Fe(t, e) : e.fieldKind == "map" ? Ge(t, e) : We(e, t);
1380
+ function Ms(e, t) {
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 ${An(e)}, got ${ue(t)}`;
1387
+ s = `expected ${_n(e)}, got ${de(t)}`;
1388
1388
  break;
1389
1389
  case "map":
1390
- s = `expected ${_n(e)}, got ${ue(t)}`;
1390
+ s = `expected ${vn(e)}, got ${de(t)}`;
1391
1391
  break;
1392
1392
  default:
1393
- s = ce(e, t, n);
1393
+ s = le(e, t, n);
1394
1394
  }
1395
- return new F(e, s);
1395
+ return new Y(e, s);
1396
1396
  }
1397
- function pt(e, t, n) {
1398
- const s = We(e, n);
1397
+ function gt(e, t, n) {
1398
+ const s = je(e, n);
1399
1399
  if (s !== !0)
1400
- return new F(e, `list item #${t + 1}: ${ce(e, n, s)}`);
1400
+ return new Y(e, `list item #${t + 1}: ${le(e, n, s)}`);
1401
1401
  }
1402
- function Ls(e, t, n) {
1403
- const s = ve(t, e.mapKey);
1402
+ function xs(e, t, n) {
1403
+ const s = De(t, e.mapKey);
1404
1404
  if (s !== !0)
1405
- return new F(e, `invalid map key: ${ce({ scalar: e.mapKey }, t, s)}`);
1406
- const r = We(e, n);
1405
+ return new Y(e, `invalid map key: ${le({ scalar: e.mapKey }, t, s)}`);
1406
+ const r = je(e, n);
1407
1407
  if (r !== !0)
1408
- return new F(e, `map entry ${ue(t)}: ${ce(e, n, r)}`);
1408
+ return new Y(e, `map entry ${de(t)}: ${le(e, n, r)}`);
1409
1409
  }
1410
- function We(e, t) {
1411
- return e.scalar !== void 0 ? ve(t, e.scalar) : e.enum !== void 0 ? e.enum.open ? ve(t, c.INT32) : e.enum.values.some((n) => n.number === t) : Ye(t, e.message);
1410
+ function je(e, t) {
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);
1412
1412
  }
1413
- function ve(e, t) {
1413
+ function De(e, t) {
1414
1414
  switch (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 > wn || e < Nn ? `${e.toFixed()} out of range` : !0;
1418
+ return typeof e != "number" ? !1 : Number.isNaN(e) || !Number.isFinite(e) ? !0 : e > Nn || e < Tn ? `${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 > Tn || e < Sn ? `${e.toFixed()} out of range` : !0;
1422
+ return typeof e != "number" || !Number.isInteger(e) ? !1 : e > kn || e < An ? `${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 > In || e < 0 ? `${e.toFixed()} out of range` : !0;
1425
+ return typeof e != "number" || !Number.isInteger(e) ? !1 : e > Sn || e < 0 ? `${e.toFixed()} out of range` : !0;
1426
1426
  case c.BOOL:
1427
1427
  return typeof e == "boolean";
1428
1428
  case c.STRING:
1429
- return typeof e != "string" ? !1 : Xe().checkUtf8(e) || "invalid UTF8";
1429
+ return typeof e != "string" ? !1 : We().checkUtf8(e) || "invalid UTF8";
1430
1430
  case c.BYTES:
1431
1431
  return e instanceof Uint8Array;
1432
1432
  case c.INT64:
@@ -1450,13 +1450,13 @@ function ve(e, t) {
1450
1450
  return !1;
1451
1451
  }
1452
1452
  }
1453
- function ce(e, t, n) {
1454
- return n = typeof n == "string" ? `: ${n}` : `, got ${ue(t)}`, e.scalar !== void 0 ? `expected ${Us(e.scalar)}` + n : e.enum !== void 0 ? `expected ${e.enum.toString()}` + n : `expected ${kn(e.message)}` + n;
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;
1455
1455
  }
1456
- function ue(e) {
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})` : Fe(e) ? An(e.field()) : Ge(e) ? _n(e.field()) : Ye(e) ? kn(e.desc) : Be(e) ? `message ${e.$typeName}` : "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";
1460
1460
  case "string":
1461
1461
  return e.length > 30 ? "string" : `"${e.split('"').join('\\"')}"`;
1462
1462
  case "boolean":
@@ -1469,10 +1469,10 @@ function ue(e) {
1469
1469
  return typeof e;
1470
1470
  }
1471
1471
  }
1472
- function kn(e) {
1472
+ function Rn(e) {
1473
1473
  return `ReflectMessage (${e.typeName})`;
1474
1474
  }
1475
- function An(e) {
1475
+ function _n(e) {
1476
1476
  switch (e.listKind) {
1477
1477
  case "message":
1478
1478
  return `ReflectList (${e.message.toString()})`;
@@ -1482,7 +1482,7 @@ function An(e) {
1482
1482
  return `ReflectList (${c[e.scalar]})`;
1483
1483
  }
1484
1484
  }
1485
- function _n(e) {
1485
+ function vn(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 _n(e) {
1492
1492
  return `ReflectMap (${c[e.mapKey]}, ${c[e.scalar]})`;
1493
1493
  }
1494
1494
  }
1495
- function Us(e) {
1495
+ function Ps(e) {
1496
1496
  switch (e) {
1497
1497
  case c.STRING:
1498
1498
  return "string";
@@ -1520,68 +1520,68 @@ function Us(e) {
1520
1520
  return "number (int32)";
1521
1521
  }
1522
1522
  }
1523
- const xs = 0;
1524
- function pe(e, t, n = !0) {
1523
+ const Vs = 0;
1524
+ function ge(e, t, n = !0) {
1525
1525
  return new On(e, t, n);
1526
1526
  }
1527
- const bt = /* @__PURE__ */ new WeakMap();
1527
+ const Et = /* @__PURE__ */ new WeakMap();
1528
1528
  class On {
1529
1529
  get sortedFields() {
1530
- const t = bt.get(this.desc);
1530
+ const t = Et.get(this.desc);
1531
1531
  if (t)
1532
1532
  return t;
1533
1533
  const n = this.desc.fields.concat().sort((s, r) => s.number - r.number);
1534
- return bt.set(this.desc, n), n;
1534
+ return Et.set(this.desc, n), n;
1535
1535
  }
1536
1536
  constructor(t, n, s = !0) {
1537
- this.lists = /* @__PURE__ */ new Map(), this.maps = /* @__PURE__ */ new Map(), this.check = s, this.desc = t, this.message = this[v] = n ?? x(t), this.fields = t.fields, this.oneofs = t.oneofs, this.members = t.members;
1537
+ this.lists = /* @__PURE__ */ new Map(), this.maps = /* @__PURE__ */ new Map(), this.check = s, this.desc = t, this.message = this[M] = n ?? C(t), this.fields = t.fields, this.oneofs = t.oneofs, this.members = t.members;
1538
1538
  }
1539
1539
  findNumber(t) {
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 $(this.message, t), mn(this.message, t);
1543
+ return K(this.message, t), bn(this.message, t);
1544
1544
  }
1545
1545
  isSet(t) {
1546
- return $(this.message, t), Es(this.message, t);
1546
+ return K(this.message, t), Is(this.message, t);
1547
1547
  }
1548
1548
  clear(t) {
1549
- $(this.message, t), ys(this.message, t);
1549
+ K(this.message, t), Ns(this.message, t);
1550
1550
  }
1551
1551
  get(t) {
1552
- $(this.message, t);
1553
- const n = pn(this.message, t);
1552
+ K(this.message, t);
1553
+ const n = gn(this.message, t);
1554
1554
  switch (t.fieldKind) {
1555
1555
  case "list":
1556
1556
  let s = this.lists.get(t);
1557
- return (!s || s[v] !== n) && this.lists.set(
1557
+ return (!s || s[M] !== n) && this.lists.set(
1558
1558
  t,
1559
1559
  // biome-ignore lint/suspicious/noAssignInExpressions: no
1560
- s = new Ms(t, n, this.check)
1560
+ s = new Fs(t, n, this.check)
1561
1561
  ), s;
1562
1562
  case "map":
1563
1563
  let r = this.maps.get(t);
1564
- return (!r || r[v] !== n) && this.maps.set(
1564
+ return (!r || r[M] !== n) && this.maps.set(
1565
1565
  t,
1566
1566
  // biome-ignore lint/suspicious/noAssignInExpressions: no
1567
- r = new Vs(t, n, this.check)
1567
+ r = new Gs(t, n, this.check)
1568
1568
  ), r;
1569
1569
  case "message":
1570
- return qe(t, n, this.check);
1570
+ return He(t, n, this.check);
1571
1571
  case "scalar":
1572
- return n === void 0 ? X(t.scalar, !1) : He(t, n);
1572
+ return n === void 0 ? q(t.scalar, !1) : Ze(t, n);
1573
1573
  case "enum":
1574
1574
  return n ?? t.enum.values[0].number;
1575
1575
  }
1576
1576
  }
1577
1577
  set(t, n) {
1578
- if ($(this.message, t), this.check) {
1579
- const r = Ds(t, n);
1578
+ if (K(this.message, t), this.check) {
1579
+ const r = Ms(t, n);
1580
1580
  if (r)
1581
1581
  throw r;
1582
1582
  }
1583
1583
  let s;
1584
- t.fieldKind == "message" ? s = je(t, n) : Ge(n) || Fe(n) ? s = n[v] : s = Ze(t, n), bn(this.message, t, 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);
1585
1585
  }
1586
1586
  getUnknown() {
1587
1587
  return this.message.$unknown;
@@ -1590,11 +1590,11 @@ class On {
1590
1590
  this.message.$unknown = t;
1591
1591
  }
1592
1592
  }
1593
- function $(e, t) {
1593
+ function K(e, t) {
1594
1594
  if (t.parent.typeName !== e.$typeName)
1595
- throw new F(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
1595
+ throw new Y(t, `cannot use ${t.toString()} with message ${e.$typeName}`, "ForeignFieldError");
1596
1596
  }
1597
- class Ms {
1597
+ class Fs {
1598
1598
  field() {
1599
1599
  return this._field;
1600
1600
  }
@@ -1602,29 +1602,29 @@ class Ms {
1602
1602
  return this._arr.length;
1603
1603
  }
1604
1604
  constructor(t, n, s) {
1605
- this._field = t, this._arr = this[v] = n, this.check = s;
1605
+ this._field = t, this._arr = this[M] = n, this.check = s;
1606
1606
  }
1607
1607
  get(t) {
1608
1608
  const n = this._arr[t];
1609
- return n === void 0 ? void 0 : Se(this._field, n, this.check);
1609
+ return n === void 0 ? void 0 : Ae(this._field, n, this.check);
1610
1610
  }
1611
1611
  set(t, n) {
1612
1612
  if (t < 0 || t >= this._arr.length)
1613
- throw new F(this._field, `list item #${t + 1}: out of range`);
1613
+ throw new Y(this._field, `list item #${t + 1}: out of range`);
1614
1614
  if (this.check) {
1615
- const s = pt(this._field, t, n);
1615
+ const s = gt(this._field, t, n);
1616
1616
  if (s)
1617
1617
  throw s;
1618
1618
  }
1619
- this._arr[t] = gt(this._field, n);
1619
+ this._arr[t] = yt(this._field, n);
1620
1620
  }
1621
1621
  add(t) {
1622
1622
  if (this.check) {
1623
- const n = pt(this._field, this._arr.length, t);
1623
+ const n = gt(this._field, this._arr.length, t);
1624
1624
  if (n)
1625
1625
  throw n;
1626
1626
  }
1627
- this._arr.push(gt(this._field, t));
1627
+ this._arr.push(yt(this._field, t));
1628
1628
  }
1629
1629
  clear() {
1630
1630
  this._arr.splice(0, this._arr.length);
@@ -1637,23 +1637,23 @@ class Ms {
1637
1637
  }
1638
1638
  *values() {
1639
1639
  for (const t of this._arr)
1640
- yield Se(this._field, t, this.check);
1640
+ yield Ae(this._field, t, this.check);
1641
1641
  }
1642
1642
  *entries() {
1643
1643
  for (let t = 0; t < this._arr.length; t++)
1644
- yield [t, Se(this._field, this._arr[t], this.check)];
1644
+ yield [t, Ae(this._field, this._arr[t], this.check)];
1645
1645
  }
1646
1646
  }
1647
- class Vs {
1647
+ class Gs {
1648
1648
  constructor(t, n, s = !0) {
1649
- this.obj = this[v] = n ?? {}, this.check = s, this._field = t;
1649
+ this.obj = this[M] = n ?? {}, this.check = s, this._field = t;
1650
1650
  }
1651
1651
  field() {
1652
1652
  return this._field;
1653
1653
  }
1654
1654
  set(t, n) {
1655
1655
  if (this.check) {
1656
- const s = Ls(this._field, t, n);
1656
+ const s = xs(this._field, t, n);
1657
1657
  if (s)
1658
1658
  throw s;
1659
1659
  }
@@ -1669,20 +1669,20 @@ class Vs {
1669
1669
  }
1670
1670
  get(t) {
1671
1671
  let n = this.obj[J(t)];
1672
- return n !== void 0 && (n = ke(this._field, n, this.check)), n;
1672
+ return n !== void 0 && (n = Re(this._field, n, this.check)), n;
1673
1673
  }
1674
1674
  has(t) {
1675
1675
  return Object.prototype.hasOwnProperty.call(this.obj, J(t));
1676
1676
  }
1677
1677
  *keys() {
1678
1678
  for (const t of Object.keys(this.obj))
1679
- yield Et(t, this._field.mapKey);
1679
+ yield wt(t, this._field.mapKey);
1680
1680
  }
1681
1681
  *entries() {
1682
1682
  for (const t of Object.entries(this.obj))
1683
1683
  yield [
1684
- Et(t[0], this._field.mapKey),
1685
- ke(this._field, t[1], this.check)
1684
+ wt(t[0], this._field.mapKey),
1685
+ Re(this._field, t[1], this.check)
1686
1686
  ];
1687
1687
  }
1688
1688
  [Symbol.iterator]() {
@@ -1693,38 +1693,38 @@ class Vs {
1693
1693
  }
1694
1694
  *values() {
1695
1695
  for (const t of Object.values(this.obj))
1696
- yield ke(this._field, t, this.check);
1696
+ yield Re(this._field, t, this.check);
1697
1697
  }
1698
1698
  forEach(t, n) {
1699
1699
  for (const s of this.entries())
1700
1700
  t.call(n, s[1], s[0], this);
1701
1701
  }
1702
1702
  }
1703
- function je(e, t) {
1704
- return Ye(t) ? ws(t.message) && !e.oneof && e.fieldKind == "message" ? t.message.value : t.desc.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" ? Cn(t.message) : t.message : t;
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;
1705
1705
  }
1706
- function qe(e, t, n) {
1707
- return t !== void 0 && (gn(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
1706
+ function He(e, t, n) {
1707
+ return t !== void 0 && (yn(e.message) && !e.oneof && e.fieldKind == "message" ? t = {
1708
1708
  $typeName: e.message.typeName,
1709
- value: He(e.message.fields[0], t)
1710
- } : e.message.typeName == "google.protobuf.Struct" && e.parent.typeName != "google.protobuf.Value" && U(t) && (t = Rn(t))), new On(e.message, t, n);
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);
1711
1711
  }
1712
- function gt(e, t) {
1713
- return e.listKind == "message" ? je(e, t) : Ze(e, t);
1712
+ function yt(e, t) {
1713
+ return e.listKind == "message" ? qe(e, t) : ze(e, t);
1714
1714
  }
1715
- function Se(e, t, n) {
1716
- return e.listKind == "message" ? qe(e, t, n) : He(e, t);
1715
+ function Ae(e, t, n) {
1716
+ return e.listKind == "message" ? He(e, t, n) : Ze(e, t);
1717
1717
  }
1718
1718
  function Bs(e, t) {
1719
- return e.mapKind == "message" ? je(e, t) : Ze(e, t);
1719
+ return e.mapKind == "message" ? qe(e, t) : ze(e, t);
1720
1720
  }
1721
- function ke(e, t, n) {
1722
- return e.mapKind == "message" ? qe(e, t, n) : t;
1721
+ function Re(e, t, n) {
1722
+ return e.mapKind == "message" ? He(e, t, n) : t;
1723
1723
  }
1724
1724
  function J(e) {
1725
1725
  return typeof e == "string" || typeof e == "number" ? e : String(e);
1726
1726
  }
1727
- function Et(e, t) {
1727
+ function wt(e, t) {
1728
1728
  switch (t) {
1729
1729
  case c.STRING:
1730
1730
  return e;
@@ -1762,7 +1762,7 @@ function Et(e, t) {
1762
1762
  }
1763
1763
  return e;
1764
1764
  }
1765
- function He(e, t) {
1765
+ function Ze(e, t) {
1766
1766
  switch (e.scalar) {
1767
1767
  case c.INT64:
1768
1768
  case c.SFIXED64:
@@ -1776,7 +1776,7 @@ function He(e, t) {
1776
1776
  }
1777
1777
  return t;
1778
1778
  }
1779
- function Ze(e, t) {
1779
+ function ze(e, t) {
1780
1780
  switch (e.scalar) {
1781
1781
  case c.INT64:
1782
1782
  case c.SFIXED64:
@@ -1790,28 +1790,28 @@ function Ze(e, t) {
1790
1790
  }
1791
1791
  return t;
1792
1792
  }
1793
- function Rn(e) {
1793
+ function Cn(e) {
1794
1794
  const t = {
1795
1795
  $typeName: "google.protobuf.Struct",
1796
1796
  fields: {}
1797
1797
  };
1798
- if (U(e))
1798
+ if (P(e))
1799
1799
  for (const [n, s] of Object.entries(e))
1800
- t.fields[n] = Dn(s);
1800
+ t.fields[n] = Ln(s);
1801
1801
  return t;
1802
1802
  }
1803
- function Cn(e) {
1803
+ function Dn(e) {
1804
1804
  const t = {};
1805
1805
  for (const [n, s] of Object.entries(e.fields))
1806
- t[n] = vn(s);
1806
+ t[n] = Un(s);
1807
1807
  return t;
1808
1808
  }
1809
- function vn(e) {
1809
+ function Un(e) {
1810
1810
  switch (e.kind.case) {
1811
1811
  case "structValue":
1812
- return Cn(e.kind.value);
1812
+ return Dn(e.kind.value);
1813
1813
  case "listValue":
1814
- return e.kind.value.values.map(vn);
1814
+ return e.kind.value.values.map(Un);
1815
1815
  case "nullValue":
1816
1816
  case void 0:
1817
1817
  return null;
@@ -1819,7 +1819,7 @@ function vn(e) {
1819
1819
  return e.kind.value;
1820
1820
  }
1821
1821
  }
1822
- function Dn(e) {
1822
+ function Ln(e) {
1823
1823
  const t = {
1824
1824
  $typeName: "google.protobuf.Value",
1825
1825
  kind: { case: void 0 }
@@ -1836,7 +1836,7 @@ function Dn(e) {
1836
1836
  break;
1837
1837
  case "object":
1838
1838
  if (e === null)
1839
- t.kind = { case: "nullValue", value: xs };
1839
+ t.kind = { case: "nullValue", value: Vs };
1840
1840
  else if (Array.isArray(e)) {
1841
1841
  const n = {
1842
1842
  $typeName: "google.protobuf.ListValue",
@@ -1844,7 +1844,7 @@ function Dn(e) {
1844
1844
  };
1845
1845
  if (Array.isArray(e))
1846
1846
  for (const s of e)
1847
- n.values.push(Dn(s));
1847
+ n.values.push(Ln(s));
1848
1848
  t.kind = {
1849
1849
  case: "listValue",
1850
1850
  value: n
@@ -1852,14 +1852,14 @@ function Dn(e) {
1852
1852
  } else
1853
1853
  t.kind = {
1854
1854
  case: "structValue",
1855
- value: Rn(e)
1855
+ value: Cn(e)
1856
1856
  };
1857
1857
  break;
1858
1858
  }
1859
1859
  return t;
1860
1860
  }
1861
- function Ps(e) {
1862
- const t = Gs();
1861
+ function Ys(e) {
1862
+ const t = Xs();
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,21 +1899,21 @@ function Ps(e) {
1899
1899
  throw Error("invalid base64 string");
1900
1900
  return s.subarray(0, r);
1901
1901
  }
1902
- let z, B;
1903
- function Fs(e) {
1904
- return z || (z = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), z.slice(0, -2).concat("-", "_")), z;
1902
+ let ee, G;
1903
+ function $s(e) {
1904
+ return ee || (ee = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), ee.slice(0, -2).concat("-", "_")), ee;
1905
1905
  }
1906
- function Gs() {
1907
- if (!B) {
1908
- B = [];
1909
- const e = Fs();
1906
+ function Xs() {
1907
+ if (!G) {
1908
+ G = [];
1909
+ const e = $s();
1910
1910
  for (let t = 0; t < e.length; t++)
1911
- B[e[t].charCodeAt(0)] = t;
1912
- B[45] = e.indexOf("+"), B[95] = e.indexOf("/");
1911
+ G[e[t].charCodeAt(0)] = t;
1912
+ G[45] = e.indexOf("+"), G[95] = e.indexOf("/");
1913
1913
  }
1914
- return B;
1914
+ return G;
1915
1915
  }
1916
- function le(e) {
1916
+ function he(e) {
1917
1917
  let t = !1;
1918
1918
  const n = [];
1919
1919
  for (let s = 0; s < e.length; s++) {
@@ -1941,33 +1941,33 @@ function le(e) {
1941
1941
  }
1942
1942
  return n.join("");
1943
1943
  }
1944
- const Ys = /* @__PURE__ */ new Set([
1944
+ const Ks = /* @__PURE__ */ new Set([
1945
1945
  // names reserved by JavaScript
1946
1946
  "constructor",
1947
1947
  "toString",
1948
1948
  "toJSON",
1949
1949
  "valueOf"
1950
1950
  ]);
1951
- function j(e) {
1952
- return Ys.has(e) ? e + "$" : e;
1951
+ function Z(e) {
1952
+ return Ks.has(e) ? e + "$" : e;
1953
1953
  }
1954
- function Je(e) {
1954
+ function Qe(e) {
1955
1955
  for (const t of e.field)
1956
- W(t, "jsonName") || (t.jsonName = le(t.name));
1957
- e.nestedType.forEach(Je);
1956
+ H(t, "jsonName") || (t.jsonName = he(t.name));
1957
+ e.nestedType.forEach(Qe);
1958
1958
  }
1959
- function $s(e, t) {
1959
+ function Ws(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 Ks(e, t) {
1965
+ function js(e, t) {
1966
1966
  switch (e) {
1967
1967
  case c.STRING:
1968
1968
  return t;
1969
1969
  case c.BYTES: {
1970
- const n = Xs(t);
1970
+ const n = qs(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 Ks(e, t) {
2001
2001
  return parseInt(t, 10);
2002
2002
  }
2003
2003
  }
2004
- function Xs(e) {
2004
+ function qs(e) {
2005
2005
  const t = [], n = {
2006
2006
  tail: e,
2007
2007
  c: "",
@@ -2095,27 +2095,27 @@ function Xs(e) {
2095
2095
  }
2096
2096
  return new Uint8Array(t);
2097
2097
  }
2098
- function* De(e) {
2098
+ function* Ue(e) {
2099
2099
  switch (e.kind) {
2100
2100
  case "file":
2101
2101
  for (const t of e.messages)
2102
- yield t, yield* De(t);
2102
+ yield t, yield* Ue(t);
2103
2103
  yield* e.enums, yield* e.services, yield* e.extensions;
2104
2104
  break;
2105
2105
  case "message":
2106
2106
  for (const t of e.nestedMessages)
2107
- yield t, yield* De(t);
2107
+ yield t, yield* Ue(t);
2108
2108
  yield* e.nestedEnums, yield* e.nestedExtensions;
2109
2109
  break;
2110
2110
  }
2111
2111
  }
2112
- function Ln(...e) {
2113
- const t = Ws();
2112
+ function Mn(...e) {
2113
+ const t = Hs();
2114
2114
  if (!e.length)
2115
2115
  return t;
2116
2116
  if ("$typeName" in e[0] && e[0].$typeName == "google.protobuf.FileDescriptorSet") {
2117
2117
  for (const n of e[0].file)
2118
- It(n, t);
2118
+ St(n, t);
2119
2119
  return t;
2120
2120
  }
2121
2121
  if ("$typeName" in e[0]) {
@@ -2133,14 +2133,14 @@ function Ln(...e) {
2133
2133
  };
2134
2134
  const n = e[0], s = e[1], r = /* @__PURE__ */ new Set();
2135
2135
  for (const a of [n, ...i(n)].reverse())
2136
- It(a, t);
2136
+ St(a, t);
2137
2137
  } else
2138
2138
  for (const n of e)
2139
2139
  for (const s of n.files)
2140
2140
  t.addFile(s);
2141
2141
  return t;
2142
2142
  }
2143
- function Ws() {
2143
+ function Hs() {
2144
2144
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
2145
2145
  return {
2146
2146
  kind: "registry",
@@ -2154,7 +2154,7 @@ function Ws() {
2154
2154
  },
2155
2155
  addFile(s, r, i) {
2156
2156
  if (n.set(s.proto.name, s), !r)
2157
- for (const a of De(s))
2157
+ for (const a of Ue(s))
2158
2158
  this.add(a);
2159
2159
  if (i)
2160
2160
  for (const a of s.dependencies)
@@ -2199,7 +2199,7 @@ function Ws() {
2199
2199
  }
2200
2200
  };
2201
2201
  }
2202
- const js = 998, qs = 999, Hs = 9999, Zs = 9, q = 10, K = 11, Js = 12, yt = 14, ze = 3, zs = 2, wt = 1, Qs = 0, Ae = 1, Nt = 2, er = 3, tr = 1, nr = 2, sr = 1, rr = 2, ir = 1001, Un = {
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 = {
2203
2203
  // EDITION_PROTO2
2204
2204
  998: {
2205
2205
  fieldPresence: 1,
@@ -2277,15 +2277,15 @@ const js = 998, qs = 999, Hs = 9999, Zs = 9, q = 10, K = 11, Js = 12, yt = 14, z
2277
2277
  // EXPORT_TOP_LEVEL,
2278
2278
  }
2279
2279
  };
2280
- function It(e, t) {
2280
+ function St(e, t) {
2281
2281
  var n, s;
2282
2282
  const r = {
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: ur(e),
2286
+ edition: hr(e),
2287
2287
  name: e.name.replace(/\.proto$/, ""),
2288
- dependencies: lr(e, t),
2288
+ dependencies: fr(e, t),
2289
2289
  enums: [],
2290
2290
  messages: [],
2291
2291
  extensions: [],
@@ -2303,16 +2303,16 @@ function It(e, t) {
2303
2303
  }
2304
2304
  };
2305
2305
  for (const o of e.enumType)
2306
- xn(o, r, void 0, t);
2306
+ Pn(o, r, void 0, t);
2307
2307
  for (const o of e.messageType)
2308
- Mn(o, r, void 0, t, a);
2308
+ Vn(o, r, void 0, t, a);
2309
2309
  for (const o of e.service)
2310
- ar(o, r, t);
2310
+ ur(o, r, t);
2311
2311
  Le(r, t);
2312
2312
  for (const o of i.values())
2313
- Ue(o, t, a);
2313
+ Me(o, t, a);
2314
2314
  for (const o of r.messages)
2315
- Ue(o, t, a), Le(o, t);
2315
+ Me(o, t, a), Le(o, t);
2316
2316
  t.addFile(r, !0);
2317
2317
  }
2318
2318
  function Le(e, t) {
@@ -2333,20 +2333,20 @@ function Le(e, t) {
2333
2333
  break;
2334
2334
  }
2335
2335
  }
2336
- function Ue(e, t, n) {
2337
- const s = e.proto.oneofDecl.map((i) => cr(i, e)), r = /* @__PURE__ */ new Set();
2336
+ function Me(e, t, n) {
2337
+ const s = e.proto.oneofDecl.map((i) => dr(i, e)), r = /* @__PURE__ */ new Set();
2338
2338
  for (const i of e.proto.field) {
2339
- const a = fr(i, s), o = xe(i, e, t, a, n);
2339
+ const a = br(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)))
2343
2343
  e.oneofs.push(i);
2344
2344
  for (const i of e.nestedMessages)
2345
- Ue(i, t, n);
2345
+ Me(i, t, n);
2346
2346
  }
2347
- function xn(e, t, n, s) {
2347
+ function Pn(e, t, n, s) {
2348
2348
  var r, i, a, o, l;
2349
- const u = dr(e.name, e.value), d = {
2349
+ const u = mr(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,
@@ -2354,7 +2354,7 @@ function xn(e, t, n, s) {
2354
2354
  parent: n,
2355
2355
  open: !0,
2356
2356
  name: e.name,
2357
- typeName: be(e, n, t),
2357
+ typeName: Ee(e, n, t),
2358
2358
  value: {},
2359
2359
  values: [],
2360
2360
  sharedPrefix: u,
@@ -2362,28 +2362,28 @@ function xn(e, t, n, s) {
2362
2362
  return `enum ${this.typeName}`;
2363
2363
  }
2364
2364
  };
2365
- d.open = gr(d), s.add(d);
2366
- for (const h of e.value) {
2367
- const m = h.name;
2365
+ d.open = wr(d), s.add(d);
2366
+ for (const f of e.value) {
2367
+ const p = f.name;
2368
2368
  d.values.push(
2369
2369
  // biome-ignore lint/suspicious/noAssignInExpressions: no
2370
- d.value[h.number] = {
2370
+ d.value[f.number] = {
2371
2371
  kind: "enum_value",
2372
- proto: h,
2373
- deprecated: (o = (a = h.options) === null || a === void 0 ? void 0 : a.deprecated) !== null && o !== void 0 ? o : !1,
2372
+ proto: f,
2373
+ deprecated: (o = (a = f.options) === null || a === void 0 ? void 0 : a.deprecated) !== null && o !== void 0 ? o : !1,
2374
2374
  parent: d,
2375
- name: m,
2376
- localName: j(u == null ? m : m.substring(u.length)),
2377
- number: h.number,
2375
+ name: p,
2376
+ localName: Z(u == null ? p : p.substring(u.length)),
2377
+ number: f.number,
2378
2378
  toString() {
2379
- return `enum value ${d.typeName}.${m}`;
2379
+ return `enum value ${d.typeName}.${p}`;
2380
2380
  }
2381
2381
  }
2382
2382
  );
2383
2383
  }
2384
2384
  ((l = n?.nestedEnums) !== null && l !== void 0 ? l : t.enums).push(d);
2385
2385
  }
2386
- function Mn(e, t, n, s, r) {
2386
+ function Vn(e, t, n, s, r) {
2387
2387
  var i, a, o, l;
2388
2388
  const u = {
2389
2389
  kind: "message",
@@ -2392,7 +2392,7 @@ function Mn(e, t, n, s, r) {
2392
2392
  file: t,
2393
2393
  parent: n,
2394
2394
  name: e.name,
2395
- typeName: be(e, n, t),
2395
+ typeName: Ee(e, n, t),
2396
2396
  fields: [],
2397
2397
  field: {},
2398
2398
  oneofs: [],
@@ -2406,11 +2406,11 @@ function Mn(e, t, n, s, r) {
2406
2406
  };
2407
2407
  ((o = e.options) === null || o === void 0 ? void 0 : o.mapEntry) === !0 ? r.add(u) : (((l = n?.nestedMessages) !== null && l !== void 0 ? l : t.messages).push(u), s.add(u));
2408
2408
  for (const d of e.enumType)
2409
- xn(d, t, u, s);
2409
+ Pn(d, t, u, s);
2410
2410
  for (const d of e.nestedType)
2411
- Mn(d, t, u, s, r);
2411
+ Vn(d, t, u, s, r);
2412
2412
  }
2413
- function ar(e, t, n) {
2413
+ function ur(e, t, n) {
2414
2414
  var s, r;
2415
2415
  const i = {
2416
2416
  kind: "service",
@@ -2418,7 +2418,7 @@ function ar(e, t, n) {
2418
2418
  deprecated: (r = (s = e.options) === null || s === void 0 ? void 0 : s.deprecated) !== null && r !== void 0 ? r : !1,
2419
2419
  file: t,
2420
2420
  name: e.name,
2421
- typeName: be(e, void 0, t),
2421
+ typeName: Ee(e, void 0, t),
2422
2422
  methods: [],
2423
2423
  method: {},
2424
2424
  toString() {
@@ -2427,15 +2427,15 @@ function ar(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 = or(a, i, n);
2430
+ const o = lr(a, i, n);
2431
2431
  i.methods.push(o), i.method[o.localName] = o;
2432
2432
  }
2433
2433
  }
2434
- function or(e, t, n) {
2434
+ function lr(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";
2438
- const l = n.getMessage(R(e.inputType)), u = n.getMessage(R(e.outputType));
2438
+ const l = n.getMessage(D(e.inputType)), u = n.getMessage(D(e.outputType));
2439
2439
  A(l, `invalid MethodDescriptorProto: input_type ${e.inputType} not found`), A(u, `invalid MethodDescriptorProto: output_type ${e.inputType} not found`);
2440
2440
  const d = e.name;
2441
2441
  return {
@@ -2444,17 +2444,17 @@ function or(e, t, n) {
2444
2444
  deprecated: (r = (s = e.options) === null || s === void 0 ? void 0 : s.deprecated) !== null && r !== void 0 ? r : !1,
2445
2445
  parent: t,
2446
2446
  name: d,
2447
- localName: j(d.length ? j(d[0].toLowerCase() + d.substring(1)) : d),
2447
+ localName: Z(d.length ? Z(d[0].toLowerCase() + d.substring(1)) : d),
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 : Qs,
2451
+ idempotency: (a = (i = e.options) === null || i === void 0 ? void 0 : i.idempotencyLevel) !== null && a !== void 0 ? a : nr,
2452
2452
  toString() {
2453
2453
  return `rpc ${t.typeName}.${d}`;
2454
2454
  }
2455
2455
  };
2456
2456
  }
2457
- function cr(e, t) {
2457
+ function dr(e, t) {
2458
2458
  return {
2459
2459
  kind: "oneof",
2460
2460
  proto: e,
@@ -2462,7 +2462,7 @@ function cr(e, t) {
2462
2462
  parent: t,
2463
2463
  fields: [],
2464
2464
  name: e.name,
2465
- localName: j(le(e.name)),
2465
+ localName: Z(he(e.name)),
2466
2466
  toString() {
2467
2467
  return `oneof ${t.typeName}.${this.name}`;
2468
2468
  }
@@ -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: mr(e, s, l, t),
2483
- utf8Validation: Er(e, t),
2482
+ presence: gr(e, s, l, t),
2483
+ utf8Validation: Ir(e, t),
2484
2484
  listKind: void 0,
2485
2485
  mapKind: void 0,
2486
2486
  mapKey: void 0,
@@ -2490,72 +2490,72 @@ function xe(e, t, n, s, r) {
2490
2490
  getDefaultValue: void 0
2491
2491
  };
2492
2492
  if (l) {
2493
- const g = t.kind == "file" ? t : t.file, E = t.kind == "file" ? void 0 : t, p = be(e, E, g);
2494
- u.kind = "extension", u.file = g, u.parent = E, u.oneof = void 0, u.typeName = p, u.jsonName = `[${p}]`, u.toString = () => `extension ${p}`;
2495
- const H = n.getMessage(R(e.extendee));
2496
- A(H, `invalid FieldDescriptorProto: extendee ${e.extendee} not found`), u.extendee = H;
2493
+ const m = t.kind == "file" ? t : t.file, g = t.kind == "file" ? void 0 : t, E = Ee(e, g, m);
2494
+ u.kind = "extension", u.file = m, u.parent = g, u.oneof = void 0, u.typeName = E, u.jsonName = `[${E}]`, u.toString = () => `extension ${E}`;
2495
+ const x = n.getMessage(D(e.extendee));
2496
+ A(x, `invalid FieldDescriptorProto: extendee ${e.extendee} not found`), u.extendee = x;
2497
2497
  } else {
2498
- const g = t;
2499
- A(g.kind == "message"), u.parent = g, u.oneof = s, u.localName = s ? le(e.name) : j(le(e.name)), u.jsonName = e.jsonName, u.toString = () => `field ${g.typeName}.${e.name}`;
2498
+ const m = t;
2499
+ A(m.kind == "message"), u.parent = m, u.oneof = s, u.localName = s ? he(e.name) : Z(he(e.name)), u.jsonName = e.jsonName, u.toString = () => `field ${m.typeName}.${e.name}`;
2500
2500
  }
2501
- const d = e.label, h = e.type, m = (o = e.options) === null || o === void 0 ? void 0 : o.jstype;
2502
- if (d === ze) {
2503
- const g = h == K ? r?.get(R(e.typeName)) : void 0;
2504
- if (g) {
2501
+ const d = e.label, f = e.type, p = (o = e.options) === null || o === void 0 ? void 0 : o.jstype;
2502
+ if (d === Je) {
2503
+ const m = f == j ? r?.get(D(e.typeName)) : void 0;
2504
+ if (m) {
2505
2505
  u.fieldKind = "map";
2506
- const { key: E, value: p } = br(g);
2507
- return u.mapKey = E.scalar, u.mapKind = p.fieldKind, u.message = p.message, u.delimitedEncoding = !1, u.enum = p.enum, u.scalar = p.scalar, u;
2506
+ const { key: g, value: E } = yr(m);
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
- switch (u.fieldKind = "list", h) {
2510
- case K:
2511
- case q:
2512
- u.listKind = "message", u.message = n.getMessage(R(e.typeName)), A(u.message), u.delimitedEncoding = Tt(e, t);
2509
+ switch (u.fieldKind = "list", f) {
2510
+ case j:
2511
+ case z:
2512
+ u.listKind = "message", u.message = n.getMessage(D(e.typeName)), A(u.message), u.delimitedEncoding = kt(e, t);
2513
2513
  break;
2514
- case yt:
2515
- u.listKind = "enum", u.enum = n.getEnum(R(e.typeName)), A(u.enum);
2514
+ case It:
2515
+ u.listKind = "enum", u.enum = n.getEnum(D(e.typeName)), A(u.enum);
2516
2516
  break;
2517
2517
  default:
2518
- u.listKind = "scalar", u.scalar = h, u.longAsString = m == wt;
2518
+ u.listKind = "scalar", u.scalar = f, u.longAsString = p == Nt;
2519
2519
  break;
2520
2520
  }
2521
- return u.packed = pr(e, t), u;
2521
+ return u.packed = Er(e, t), u;
2522
2522
  }
2523
- switch (h) {
2524
- case K:
2525
- case q:
2526
- u.fieldKind = "message", u.message = n.getMessage(R(e.typeName)), A(u.message, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.delimitedEncoding = Tt(e, t), u.getDefaultValue = () => {
2523
+ switch (f) {
2524
+ case j:
2525
+ case z:
2526
+ u.fieldKind = "message", u.message = n.getMessage(D(e.typeName)), A(u.message, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.delimitedEncoding = kt(e, t), u.getDefaultValue = () => {
2527
2527
  };
2528
2528
  break;
2529
- case yt: {
2530
- const g = n.getEnum(R(e.typeName));
2531
- A(g !== void 0, `invalid FieldDescriptorProto: type_name ${e.typeName} not found`), u.fieldKind = "enum", u.enum = n.getEnum(R(e.typeName)), u.getDefaultValue = () => W(e, "defaultValue") ? $s(g, e.defaultValue) : void 0;
2529
+ case It: {
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;
2532
2532
  break;
2533
2533
  }
2534
2534
  default: {
2535
- u.fieldKind = "scalar", u.scalar = h, u.longAsString = m == wt, u.getDefaultValue = () => W(e, "defaultValue") ? Ks(h, e.defaultValue) : void 0;
2535
+ u.fieldKind = "scalar", u.scalar = f, u.longAsString = p == Nt, u.getDefaultValue = () => H(e, "defaultValue") ? js(f, e.defaultValue) : void 0;
2536
2536
  break;
2537
2537
  }
2538
2538
  }
2539
2539
  return u;
2540
2540
  }
2541
- function ur(e) {
2541
+ function hr(e) {
2542
2542
  switch (e.syntax) {
2543
2543
  case "":
2544
2544
  case "proto2":
2545
- return js;
2545
+ return Zs;
2546
2546
  case "proto3":
2547
- return qs;
2547
+ return zs;
2548
2548
  case "editions":
2549
- if (e.edition === Hs)
2550
- return ir;
2551
- if (e.edition in Un)
2549
+ if (e.edition === Qs)
2550
+ return cr;
2551
+ if (e.edition in xn)
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 lr(e, t) {
2558
+ function fr(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 lr(e, t) {
2563
2563
  return s;
2564
2564
  });
2565
2565
  }
2566
- function dr(e, t) {
2567
- const n = hr(e) + "_";
2566
+ function mr(e, t) {
2567
+ const n = pr(e) + "_";
2568
2568
  for (const s of t) {
2569
2569
  if (!s.name.toLowerCase().startsWith(n))
2570
2570
  return;
@@ -2574,72 +2574,72 @@ function dr(e, t) {
2574
2574
  }
2575
2575
  return n;
2576
2576
  }
2577
- function hr(e) {
2577
+ function pr(e) {
2578
2578
  return (e.substring(0, 1) + e.substring(1).replace(/[A-Z]/g, (t) => "_" + t)).toLowerCase();
2579
2579
  }
2580
- function be(e, t, n) {
2580
+ function Ee(e, t, n) {
2581
2581
  let s;
2582
2582
  return t ? s = `${t.typeName}.${e.name}` : n.proto.package.length > 0 ? s = `${n.proto.package}.${e.name}` : s = `${e.name}`, s;
2583
2583
  }
2584
- function R(e) {
2584
+ function D(e) {
2585
2585
  return e.startsWith(".") ? e.substring(1) : e;
2586
2586
  }
2587
- function fr(e, t) {
2588
- if (!W(e, "oneofIndex") || e.proto3Optional)
2587
+ function br(e, t) {
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 mr(e, t, n, s) {
2594
- if (e.label == zs)
2595
- return er;
2596
- if (e.label == ze)
2597
- return Nt;
2593
+ function gr(e, t, n, s) {
2594
+ if (e.label == tr)
2595
+ return sr;
2596
+ if (e.label == Je)
2597
+ return Tt;
2598
2598
  if (t || e.proto3Optional || n)
2599
- return Ae;
2600
- const r = V("fieldPresence", { proto: e, parent: s });
2601
- return r == Nt && (e.type == K || e.type == q) ? Ae : r;
2599
+ return _e;
2600
+ const r = F("fieldPresence", { proto: e, parent: s });
2601
+ return r == Tt && (e.type == j || e.type == z) ? _e : r;
2602
2602
  }
2603
- function pr(e, t) {
2604
- if (e.label != ze)
2603
+ function Er(e, t) {
2604
+ if (e.label != Je)
2605
2605
  return !1;
2606
2606
  switch (e.type) {
2607
- case Zs:
2608
2607
  case Js:
2609
- case q:
2610
- case K:
2608
+ case er:
2609
+ case z:
2610
+ case j:
2611
2611
  return !1;
2612
2612
  }
2613
2613
  const n = e.options;
2614
- return n && W(n, "packed") ? n.packed : tr == V("repeatedFieldEncoding", {
2614
+ return n && H(n, "packed") ? n.packed : rr == F("repeatedFieldEncoding", {
2615
2615
  proto: e,
2616
2616
  parent: t
2617
2617
  });
2618
2618
  }
2619
- function br(e) {
2619
+ function yr(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 gr(e) {
2623
+ function wr(e) {
2624
2624
  var t;
2625
- return sr == V("enumType", {
2625
+ return ar == F("enumType", {
2626
2626
  proto: e.proto,
2627
2627
  parent: (t = e.parent) !== null && t !== void 0 ? t : e.file
2628
2628
  });
2629
2629
  }
2630
- function Tt(e, t) {
2631
- return e.type == q ? !0 : nr == V("messageEncoding", {
2630
+ function kt(e, t) {
2631
+ return e.type == z ? !0 : ir == F("messageEncoding", {
2632
2632
  proto: e,
2633
2633
  parent: t
2634
2634
  });
2635
2635
  }
2636
- function Er(e, t) {
2637
- return rr == V("utf8Validation", {
2636
+ function Ir(e, t) {
2637
+ return or == F("utf8Validation", {
2638
2638
  proto: e,
2639
2639
  parent: t
2640
2640
  });
2641
2641
  }
2642
- function V(e, t) {
2642
+ function F(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 V(e, t) {
2649
2649
  }
2650
2650
  if ("kind" in t) {
2651
2651
  if (t.kind == "message")
2652
- return V(e, (s = t.parent) !== null && s !== void 0 ? s : t.file);
2653
- const i = Un[t.edition];
2652
+ return F(e, (s = t.parent) !== null && s !== void 0 ? s : t.file);
2653
+ const i = xn[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 V(e, t.parent);
2658
+ return F(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 yr(e) {
2665
- const t = wr(e);
2666
- return t.messageType.forEach(Je), Ln(t, () => {
2664
+ function Nr(e) {
2665
+ const t = Tr(e);
2666
+ return t.messageType.forEach(Qe), Mn(t, () => {
2667
2667
  }).getFile(t.name);
2668
2668
  }
2669
- function wr(e) {
2669
+ function Tr(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(Vn), enumType: e.enumType.map(Bn) }));
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) }));
2674
2674
  }
2675
- function Vn(e) {
2675
+ function Fn(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(Nr)) !== null && n !== void 0 ? n : [],
2682
+ field: (n = (t = e.field) === null || t === void 0 ? void 0 : t.map(Sr)) !== null && n !== void 0 ? n : [],
2683
2683
  extension: [],
2684
- nestedType: (r = (s = e.nestedType) === null || s === void 0 ? void 0 : s.map(Vn)) !== 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 : [],
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 : [],
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 Nr(e) {
2692
+ function Sr(e) {
2693
2693
  return Object.assign(/* @__PURE__ */ Object.create({
2694
2694
  label: 1,
2695
2695
  typeName: "",
@@ -2698,9 +2698,9 @@ function Nr(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 ? Ir(e.options) : void 0 }));
2701
+ }), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, e), { options: e.options ? kr(e.options) : void 0 }));
2702
2702
  }
2703
- function Ir(e) {
2703
+ function kr(e) {
2704
2704
  var t, n, s;
2705
2705
  return Object.assign(/* @__PURE__ */ Object.create({
2706
2706
  ctype: 0,
@@ -2714,7 +2714,7 @@ function Ir(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 Bn(e) {
2717
+ function Gn(e) {
2718
2718
  return Object.assign(/* @__PURE__ */ Object.create({
2719
2719
  visibility: 0
2720
2720
  }), {
@@ -2725,125 +2725,125 @@ function Bn(e) {
2725
2725
  value: e.value.map((n) => Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, n))
2726
2726
  });
2727
2727
  }
2728
- function D(e, t, ...n) {
2728
+ function R(e, t, ...n) {
2729
2729
  return n.reduce((s, r) => s.nestedMessages[r], e.messages[t]);
2730
2730
  }
2731
- const Tr = /* @__PURE__ */ yr({ 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 }] }] }), Sr = /* @__PURE__ */ D(Tr, 1);
2732
- var St;
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);
2732
+ var At;
2733
2733
  (function(e) {
2734
2734
  e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
2735
- })(St || (St = {}));
2736
- var kt;
2735
+ })(At || (At = {}));
2736
+ var Rt;
2737
2737
  (function(e) {
2738
2738
  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.GROUP = 10] = "GROUP", e[e.MESSAGE = 11] = "MESSAGE", e[e.BYTES = 12] = "BYTES", e[e.UINT32 = 13] = "UINT32", e[e.ENUM = 14] = "ENUM", e[e.SFIXED32 = 15] = "SFIXED32", e[e.SFIXED64 = 16] = "SFIXED64", e[e.SINT32 = 17] = "SINT32", e[e.SINT64 = 18] = "SINT64";
2739
- })(kt || (kt = {}));
2740
- var At;
2739
+ })(Rt || (Rt = {}));
2740
+ var _t;
2741
2741
  (function(e) {
2742
2742
  e[e.OPTIONAL = 1] = "OPTIONAL", e[e.REPEATED = 3] = "REPEATED", e[e.REQUIRED = 2] = "REQUIRED";
2743
- })(At || (At = {}));
2744
- var _t;
2743
+ })(_t || (_t = {}));
2744
+ var vt;
2745
2745
  (function(e) {
2746
2746
  e[e.SPEED = 1] = "SPEED", e[e.CODE_SIZE = 2] = "CODE_SIZE", e[e.LITE_RUNTIME = 3] = "LITE_RUNTIME";
2747
- })(_t || (_t = {}));
2747
+ })(vt || (vt = {}));
2748
2748
  var Ot;
2749
2749
  (function(e) {
2750
2750
  e[e.STRING = 0] = "STRING", e[e.CORD = 1] = "CORD", e[e.STRING_PIECE = 2] = "STRING_PIECE";
2751
2751
  })(Ot || (Ot = {}));
2752
- var Rt;
2752
+ var Ct;
2753
2753
  (function(e) {
2754
2754
  e[e.JS_NORMAL = 0] = "JS_NORMAL", e[e.JS_STRING = 1] = "JS_STRING", e[e.JS_NUMBER = 2] = "JS_NUMBER";
2755
- })(Rt || (Rt = {}));
2756
- var Ct;
2755
+ })(Ct || (Ct = {}));
2756
+ var Dt;
2757
2757
  (function(e) {
2758
2758
  e[e.RETENTION_UNKNOWN = 0] = "RETENTION_UNKNOWN", e[e.RETENTION_RUNTIME = 1] = "RETENTION_RUNTIME", e[e.RETENTION_SOURCE = 2] = "RETENTION_SOURCE";
2759
- })(Ct || (Ct = {}));
2760
- var vt;
2759
+ })(Dt || (Dt = {}));
2760
+ var Ut;
2761
2761
  (function(e) {
2762
2762
  e[e.TARGET_TYPE_UNKNOWN = 0] = "TARGET_TYPE_UNKNOWN", e[e.TARGET_TYPE_FILE = 1] = "TARGET_TYPE_FILE", e[e.TARGET_TYPE_EXTENSION_RANGE = 2] = "TARGET_TYPE_EXTENSION_RANGE", e[e.TARGET_TYPE_MESSAGE = 3] = "TARGET_TYPE_MESSAGE", e[e.TARGET_TYPE_FIELD = 4] = "TARGET_TYPE_FIELD", e[e.TARGET_TYPE_ONEOF = 5] = "TARGET_TYPE_ONEOF", e[e.TARGET_TYPE_ENUM = 6] = "TARGET_TYPE_ENUM", e[e.TARGET_TYPE_ENUM_ENTRY = 7] = "TARGET_TYPE_ENUM_ENTRY", e[e.TARGET_TYPE_SERVICE = 8] = "TARGET_TYPE_SERVICE", e[e.TARGET_TYPE_METHOD = 9] = "TARGET_TYPE_METHOD";
2763
- })(vt || (vt = {}));
2764
- var Dt;
2763
+ })(Ut || (Ut = {}));
2764
+ var Lt;
2765
2765
  (function(e) {
2766
2766
  e[e.IDEMPOTENCY_UNKNOWN = 0] = "IDEMPOTENCY_UNKNOWN", e[e.NO_SIDE_EFFECTS = 1] = "NO_SIDE_EFFECTS", e[e.IDEMPOTENT = 2] = "IDEMPOTENT";
2767
- })(Dt || (Dt = {}));
2768
- var Lt;
2767
+ })(Lt || (Lt = {}));
2768
+ var Mt;
2769
2769
  (function(e) {
2770
2770
  e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", e[e.EXPORT_ALL = 1] = "EXPORT_ALL", e[e.EXPORT_TOP_LEVEL = 2] = "EXPORT_TOP_LEVEL", e[e.LOCAL_ALL = 3] = "LOCAL_ALL", e[e.STRICT = 4] = "STRICT";
2771
- })(Lt || (Lt = {}));
2772
- var Ut;
2771
+ })(Mt || (Mt = {}));
2772
+ 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
- })(Ut || (Ut = {}));
2776
- var xt;
2775
+ })(xt || (xt = {}));
2776
+ var Pt;
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
- })(xt || (xt = {}));
2780
- var Mt;
2779
+ })(Pt || (Pt = {}));
2780
+ var Vt;
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
- })(Mt || (Mt = {}));
2784
- var Vt;
2783
+ })(Vt || (Vt = {}));
2784
+ var Ft;
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
- })(Vt || (Vt = {}));
2788
- var Bt;
2787
+ })(Ft || (Ft = {}));
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";
2791
- })(Bt || (Bt = {}));
2792
- var Pt;
2791
+ })(Gt || (Gt = {}));
2792
+ var Bt;
2793
2793
  (function(e) {
2794
2794
  e[e.JSON_FORMAT_UNKNOWN = 0] = "JSON_FORMAT_UNKNOWN", e[e.ALLOW = 1] = "ALLOW", e[e.LEGACY_BEST_EFFORT = 2] = "LEGACY_BEST_EFFORT";
2795
- })(Pt || (Pt = {}));
2796
- var Ft;
2795
+ })(Bt || (Bt = {}));
2796
+ var Yt;
2797
2797
  (function(e) {
2798
2798
  e[e.ENFORCE_NAMING_STYLE_UNKNOWN = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN", e[e.STYLE2024 = 1] = "STYLE2024", e[e.STYLE_LEGACY = 2] = "STYLE_LEGACY";
2799
- })(Ft || (Ft = {}));
2800
- var Gt;
2799
+ })(Yt || (Yt = {}));
2800
+ var $t;
2801
2801
  (function(e) {
2802
2802
  e[e.NONE = 0] = "NONE", e[e.SET = 1] = "SET", e[e.ALIAS = 2] = "ALIAS";
2803
- })(Gt || (Gt = {}));
2804
- var Yt;
2803
+ })($t || ($t = {}));
2804
+ var Xt;
2805
2805
  (function(e) {
2806
2806
  e[e.EDITION_UNKNOWN = 0] = "EDITION_UNKNOWN", e[e.EDITION_LEGACY = 900] = "EDITION_LEGACY", e[e.EDITION_PROTO2 = 998] = "EDITION_PROTO2", e[e.EDITION_PROTO3 = 999] = "EDITION_PROTO3", e[e.EDITION_2023 = 1e3] = "EDITION_2023", e[e.EDITION_2024 = 1001] = "EDITION_2024", e[e.EDITION_UNSTABLE = 9999] = "EDITION_UNSTABLE", e[e.EDITION_1_TEST_ONLY = 1] = "EDITION_1_TEST_ONLY", e[e.EDITION_2_TEST_ONLY = 2] = "EDITION_2_TEST_ONLY", e[e.EDITION_99997_TEST_ONLY = 99997] = "EDITION_99997_TEST_ONLY", e[e.EDITION_99998_TEST_ONLY = 99998] = "EDITION_99998_TEST_ONLY", e[e.EDITION_99999_TEST_ONLY = 99999] = "EDITION_99999_TEST_ONLY", e[e.EDITION_MAX = 2147483647] = "EDITION_MAX";
2807
- })(Yt || (Yt = {}));
2808
- var $t;
2807
+ })(Xt || (Xt = {}));
2808
+ 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
- })($t || ($t = {}));
2812
- function kr(e) {
2811
+ })(Kt || (Kt = {}));
2812
+ function _r(e) {
2813
2813
  return Object.assign(Object.assign({ readUnknownFields: !0, recursionLimit: 100 }, e), { depth: 0 });
2814
2814
  }
2815
- function de(e, t, n) {
2816
- const s = pe(e, void 0, !1);
2817
- return Pn(s, new Cs(t), kr(n), !1, t.byteLength), s.message;
2815
+ function fe(e, t, n) {
2816
+ const s = ge(e, void 0, !1);
2817
+ return Bn(s, new Us(t), _r(n), !1, t.byteLength), s.message;
2818
2818
  }
2819
- function Pn(e, t, n, s, r) {
2819
+ function Bn(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`);
2823
2823
  const a = s ? t.len : t.pos + r;
2824
2824
  let o, l;
2825
2825
  const u = (i = e.getUnknown()) !== null && i !== void 0 ? i : [];
2826
- for (; t.pos < a && ([o, l] = t.tag(), !(s && l == N.EndGroup)); ) {
2826
+ for (; t.pos < a && ([o, l] = t.tag(), !(s && l == I.EndGroup)); ) {
2827
2827
  const d = e.findNumber(o);
2828
2828
  if (!d) {
2829
- const h = n.recursionLimit - n.depth, m = t.skip(l, o, h);
2830
- n.readUnknownFields && u.push({ no: o, wireType: l, data: m });
2829
+ const f = n.recursionLimit - n.depth, p = t.skip(l, o, f);
2830
+ n.readUnknownFields && u.push({ no: o, wireType: l, data: p });
2831
2831
  continue;
2832
2832
  }
2833
- Ar(e, t, d, l, n);
2833
+ vr(e, t, d, l, n);
2834
2834
  }
2835
- if (s && (l != N.EndGroup || o !== r))
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 Ar(e, t, n, s, r) {
2839
+ function vr(e, t, n, s, r) {
2840
2840
  var i;
2841
2841
  switch (n.fieldKind) {
2842
2842
  case "scalar":
2843
- e.set(n, G(t, n.scalar, n.utf8Validation));
2843
+ e.set(n, $(t, n.scalar, n.utf8Validation));
2844
2844
  break;
2845
2845
  case "enum":
2846
- const a = G(t, c.INT32);
2846
+ const a = $(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))
@@ -2860,17 +2860,17 @@ function Ar(e, t, n, s, r) {
2860
2860
  }
2861
2861
  break;
2862
2862
  case "message":
2863
- e.set(n, Qe(t, r, n, e.get(n)));
2863
+ e.set(n, et(t, r, n, e.get(n)));
2864
2864
  break;
2865
2865
  case "list":
2866
- Or(t, s, e.get(n), r);
2866
+ Cr(t, s, e.get(n), r);
2867
2867
  break;
2868
2868
  case "map":
2869
- _r(t, e.get(n), r);
2869
+ Or(t, e.get(n), r);
2870
2870
  break;
2871
2871
  }
2872
2872
  }
2873
- function _r(e, t, n) {
2873
+ function Or(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,58 +2878,58 @@ function _r(e, t, n) {
2878
2878
  const [l] = e.tag();
2879
2879
  switch (l) {
2880
2880
  case 1:
2881
- r = G(e, s.mapKey, s.utf8Validation);
2881
+ r = $(e, s.mapKey, s.utf8Validation);
2882
2882
  break;
2883
2883
  case 2:
2884
2884
  switch (s.mapKind) {
2885
2885
  case "scalar":
2886
- i = G(e, s.scalar, s.utf8Validation);
2886
+ i = $(e, s.scalar, s.utf8Validation);
2887
2887
  break;
2888
2888
  case "enum":
2889
2889
  i = e.int32();
2890
2890
  break;
2891
2891
  case "message":
2892
- i = Qe(e, n, s);
2892
+ i = et(e, n, s);
2893
2893
  break;
2894
2894
  }
2895
2895
  break;
2896
2896
  }
2897
2897
  }
2898
- if (r === void 0 && (r = X(s.mapKey, !1)), i === void 0)
2898
+ if (r === void 0 && (r = q(s.mapKey, !1)), i === void 0)
2899
2899
  switch (s.mapKind) {
2900
2900
  case "scalar":
2901
- i = X(s.scalar, !1);
2901
+ i = q(s.scalar, !1);
2902
2902
  break;
2903
2903
  case "enum":
2904
2904
  i = s.enum.values[0].number;
2905
2905
  break;
2906
2906
  case "message":
2907
- i = pe(s.message, void 0, !1);
2907
+ i = ge(s.message, void 0, !1);
2908
2908
  break;
2909
2909
  }
2910
2910
  t.set(r, i);
2911
2911
  }
2912
- function Or(e, t, n, s) {
2912
+ function Cr(e, t, n, s) {
2913
2913
  var r;
2914
2914
  const i = n.field();
2915
2915
  if (i.listKind === "message") {
2916
- n.add(Qe(e, s, i));
2916
+ n.add(et(e, s, i));
2917
2917
  return;
2918
2918
  }
2919
2919
  const a = (r = i.scalar) !== null && r !== void 0 ? r : c.INT32;
2920
- if (!(t == N.LengthDelimited && a != c.STRING && a != c.BYTES)) {
2921
- n.add(G(e, a, i.utf8Validation));
2920
+ if (!(t == I.LengthDelimited && a != c.STRING && a != c.BYTES)) {
2921
+ n.add($(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(G(e, a, i.utf8Validation));
2926
+ n.add($(e, a, i.utf8Validation));
2927
2927
  }
2928
- function Qe(e, t, n, s) {
2929
- const r = n.delimitedEncoding, i = s ?? pe(n.message, void 0, !1);
2930
- return Pn(i, e, t, r, r ? n.number : e.uint32()), i;
2928
+ function et(e, t, n, s) {
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;
2931
2931
  }
2932
- function G(e, t, n = !1) {
2932
+ function $(e, t, n = !1) {
2933
2933
  switch (t) {
2934
2934
  case c.STRING:
2935
2935
  return e.string(n);
@@ -2963,95 +2963,95 @@ function G(e, t, n = !1) {
2963
2963
  return e.sint32();
2964
2964
  }
2965
2965
  }
2966
- function Rr(e, t) {
2966
+ function Dr(e, t) {
2967
2967
  var n;
2968
- const s = de(Sr, Ps(e));
2969
- return s.messageType.forEach(Je), s.dependency = (n = void 0) !== null && n !== void 0 ? n : [], Ln(s, (i) => {
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) => {
2970
2970
  }).getFile(s.name);
2971
2971
  }
2972
- const Cr = 3, Kt = {
2972
+ const Ur = 3, Wt = {
2973
2973
  writeUnknownFields: !0
2974
2974
  };
2975
- function vr(e) {
2976
- return e ? Object.assign(Object.assign({}, Kt), e) : Kt;
2975
+ function Lr(e) {
2976
+ return e ? Object.assign(Object.assign({}, Wt), e) : Wt;
2977
2977
  }
2978
- function Q(e, t, n) {
2979
- return he(new Rs(), vr(n), pe(e, t)).finish();
2978
+ function te(e, t, n) {
2979
+ return me(new Ds(), Lr(n), ge(e, t)).finish();
2980
2980
  }
2981
- function he(e, t, n) {
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 == Cr)
2985
+ if (r.presence == Ur)
2986
2986
  throw new Error(`cannot encode ${r} to binary: required field not set`);
2987
2987
  continue;
2988
2988
  }
2989
- Dr(e, t, n, r);
2989
+ Mr(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 Dr(e, t, n, s) {
2996
+ function Mr(e, t, n, s) {
2997
2997
  var r;
2998
2998
  switch (s.fieldKind) {
2999
2999
  case "scalar":
3000
3000
  case "enum":
3001
- fe(e, n.desc.typeName, s.name, (r = s.scalar) !== null && r !== void 0 ? r : c.INT32, s.number, n.get(s));
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
- Lr(e, t, s, n.get(s));
3004
+ xr(e, t, s, n.get(s));
3005
3005
  break;
3006
3006
  case "message":
3007
- Fn(e, t, s, n.get(s));
3007
+ Yn(e, t, s, n.get(s));
3008
3008
  break;
3009
3009
  case "map":
3010
3010
  for (const [i, a] of n.get(s))
3011
- Ur(e, t, s, i, a);
3011
+ Pr(e, t, s, i, a);
3012
3012
  break;
3013
3013
  }
3014
3014
  }
3015
- function fe(e, t, n, s, r, i) {
3016
- Gn(e.tag(r, xr(s)), t, n, s, i);
3015
+ function pe(e, t, n, s, r, i) {
3016
+ $n(e.tag(r, Vr(s)), t, n, s, i);
3017
3017
  }
3018
- function Fn(e, t, n, s) {
3019
- n.delimitedEncoding ? he(e.tag(n.number, N.StartGroup), t, s).tag(n.number, N.EndGroup) : he(e.tag(n.number, N.LengthDelimited).fork(), t, s).join();
3018
+ function Yn(e, t, n, s) {
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 Lr(e, t, n, s) {
3021
+ function xr(e, t, n, s) {
3022
3022
  var r;
3023
3023
  if (n.listKind == "message") {
3024
3024
  for (const a of s)
3025
- Fn(e, t, n, a);
3025
+ Yn(e, t, n, a);
3026
3026
  return;
3027
3027
  }
3028
3028
  const i = (r = n.scalar) !== null && r !== void 0 ? r : c.INT32;
3029
3029
  if (n.packed) {
3030
3030
  if (!s.size)
3031
3031
  return;
3032
- e.tag(n.number, N.LengthDelimited).fork();
3032
+ e.tag(n.number, I.LengthDelimited).fork();
3033
3033
  for (const a of s)
3034
- Gn(e, n.parent.typeName, n.name, i, a);
3034
+ $n(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
- fe(e, n.parent.typeName, n.name, i, n.number, a);
3039
+ pe(e, n.parent.typeName, n.name, i, n.number, a);
3040
3040
  }
3041
- function Ur(e, t, n, s, r) {
3041
+ function Pr(e, t, n, s, r) {
3042
3042
  var i;
3043
- switch (e.tag(n.number, N.LengthDelimited).fork(), fe(e, n.parent.typeName, n.name, n.mapKey, 1, s), n.mapKind) {
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":
3045
3045
  case "enum":
3046
- fe(e, n.parent.typeName, n.name, (i = n.scalar) !== null && i !== void 0 ? i : c.INT32, 2, r);
3046
+ pe(e, n.parent.typeName, n.name, (i = n.scalar) !== null && i !== void 0 ? i : c.INT32, 2, r);
3047
3047
  break;
3048
3048
  case "message":
3049
- he(e.tag(2, N.LengthDelimited).fork(), t, r).join();
3049
+ me(e.tag(2, I.LengthDelimited).fork(), t, r).join();
3050
3050
  break;
3051
3051
  }
3052
3052
  e.join();
3053
3053
  }
3054
- function Gn(e, t, n, s, r) {
3054
+ function $n(e, t, n, s, r) {
3055
3055
  try {
3056
3056
  switch (s) {
3057
3057
  case c.STRING:
@@ -3104,122 +3104,156 @@ function Gn(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 xr(e) {
3107
+ function Vr(e) {
3108
3108
  switch (e) {
3109
3109
  case c.BYTES:
3110
3110
  case c.STRING:
3111
- return N.LengthDelimited;
3111
+ return I.LengthDelimited;
3112
3112
  case c.DOUBLE:
3113
3113
  case c.FIXED64:
3114
3114
  case c.SFIXED64:
3115
- return N.Bit64;
3115
+ return I.Bit64;
3116
3116
  case c.FIXED32:
3117
3117
  case c.SFIXED32:
3118
3118
  case c.FLOAT:
3119
- return N.Bit32;
3119
+ return I.Bit32;
3120
3120
  default:
3121
- return N.Varint;
3121
+ return I.Varint;
3122
3122
  }
3123
3123
  }
3124
- function Mr(e, t, ...n) {
3124
+ function Fr(e, t, ...n) {
3125
3125
  if (n.length > 0)
3126
3126
  throw new Error();
3127
3127
  return e.services[t];
3128
3128
  }
3129
- const L = /* @__PURE__ */ Rr("CgpjaGF0LnByb3RvEgdjaGF0LnYxIkkKCkF0dGFjaG1lbnQSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIUCgxjb250ZW50X3R5cGUYAyABKAkSCwoDdXJsGAQgASgJIkEKBkJ1dHRvbhINCgVsYWJlbBgBIAEoCRINCgV2YWx1ZRgCIAEoCRIZCgtidXR0b25fdHlwZRgDIAEoCVIEdHlwZSJ/CgRDYXJkEg0KBXRpdGxlGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEicKBWltYWdlGAMgASgLMhMuY2hhdC52MS5BdHRhY2htZW50SACIAQESIAoHYnV0dG9ucxgEIAMoCzIPLmNoYXQudjEuQnV0dG9uQggKBl9pbWFnZSLBAgoHTWVzc2FnZRIKCgJpZBgBIAEoCRIMCgRyb2xlGAIgASgJEhEKBHRleHQYAyABKAlIAIgBARIRCgRodG1sGAQgASgJSAGIAQESKAoLYXR0YWNobWVudHMYBSADKAsyEy5jaGF0LnYxLkF0dGFjaG1lbnQSIAoHYnV0dG9ucxgGIAMoCzIPLmNoYXQudjEuQnV0dG9uEh4KB2dhbGxlcnkYByADKAsyDS5jaGF0LnYxLkNhcmQSEQoJdGltZXN0YW1wGAggASgJEhgKB3VzZXJfaWQYCSABKAlSB3VzZXJfaWQSHAoJdXNlcl9uYW1lGAogASgJUgl1c2VyX25hbWUSDQoFc3RhdGUYCyABKAkSEwoGYWN0aW9uGAwgASgJSAKIAQFCBwoFX3RleHRCBwoFX2h0bWxCCQoHX2FjdGlvbiI0CgtUeXBpbmdFdmVudBIWCg5wYXJ0aWNpcGFudF9pZBgBIAEoCRINCgVzdGF0ZRgCIAEoCSJdChFQYXJ0aWNpcGFudEpvaW5lZBIWCg5wYXJ0aWNpcGFudF9pZBgBIAEoCRIMCgRyb2xlGAIgASgJEg8KB3VzZXJfaWQYAyABKAkSEQoJdXNlcl9uYW1lGAQgASgJIkkKD1BhcnRpY2lwYW50TGVmdBIWCg5wYXJ0aWNpcGFudF9pZBgBIAEoCRITCgZyZWFzb24YAiABKAlIAIgBAUIJCgdfcmVhc29uImMKA0FjdxIPCgdlbmFibGVkGAEgASgIEhAKCGR1cmF0aW9uGAIgASgDEg8KB2VuZm9yY2UYAyABKAgSEgoKc3RhcnRlZF9hdBgEIAEoCRIUCgxkaXNwb3NpdGlvbnMYBSADKAkiRgoMU2Vzc2lvbkVuZGVkEg4KBnJlYXNvbhgBIAEoCRIeCgNhY3cYAiABKAsyDC5jaGF0LnYxLkFjd0gAiAEBQgYKBF9hY3ciHAoJSGVhcnRiZWF0Eg8KB3VuaXhfbXMYASABKAMiqQIKCUNoYXRFdmVudBIjCgdtZXNzYWdlGAEgASgLMhAuY2hhdC52MS5NZXNzYWdlSAASJgoGdHlwaW5nGAIgASgLMhQuY2hhdC52MS5UeXBpbmdFdmVudEgAEjgKEnBhcnRpY2lwYW50X2pvaW5lZBgDIAEoCzIaLmNoYXQudjEuUGFydGljaXBhbnRKb2luZWRIABI0ChBwYXJ0aWNpcGFudF9sZWZ0GAQgASgLMhguY2hhdC52MS5QYXJ0aWNpcGFudExlZnRIABIuCg1zZXNzaW9uX2VuZGVkGAUgASgLMhUuY2hhdC52MS5TZXNzaW9uRW5kZWRIABInCgloZWFydGJlYXQYBiABKAsyEi5jaGF0LnYxLkhlYXJ0YmVhdEgAQgYKBGtpbmQiDwoNQXR0YWNoUmVxdWVzdCI2Cg5BdHRhY2hSZXNwb25zZRIWCg5wYXJ0aWNpcGFudF9pZBgBIAEoCRIMCgRyb2xlGAIgASgJItkBCg5NZXNzYWdlUmVxdWVzdBIZChFjbGllbnRfbWVzc2FnZV9pZBgBIAEoCRIRCgR0ZXh0GAIgASgJSACIAQESKAoLYXR0YWNobWVudHMYAyADKAsyEy5jaGF0LnYxLkF0dGFjaG1lbnQSEgoFdmFsdWUYBCABKAlIAYgBARIaCg1nYWxsZXJ5X2xhYmVsGAUgASgJSAKIAQESEQoEaHRtbBgGIAEoCUgDiAEBQgcKBV90ZXh0QggKBl92YWx1ZUIQCg5fZ2FsbGVyeV9sYWJlbEIHCgVfaHRtbCI0Cg9NZXNzYWdlUmVzcG9uc2USIQoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZSIeCg1UeXBpbmdSZXF1ZXN0Eg0KBXN0YXRlGAEgASgJIhAKDlR5cGluZ1Jlc3BvbnNlIg4KDExlYXZlUmVxdWVzdCIPCg1MZWF2ZVJlc3BvbnNlMvIBCgdTZXNzaW9uEjYKBkF0dGFjaBIWLmNoYXQudjEuQXR0YWNoUmVxdWVzdBoSLmNoYXQudjEuQ2hhdEV2ZW50MAESPAoHTWVzc2FnZRIXLmNoYXQudjEuTWVzc2FnZVJlcXVlc3QaGC5jaGF0LnYxLk1lc3NhZ2VSZXNwb25zZRI5CgZUeXBpbmcSFi5jaGF0LnYxLlR5cGluZ1JlcXVlc3QaFy5jaGF0LnYxLlR5cGluZ1Jlc3BvbnNlEjYKBUxlYXZlEhUuY2hhdC52MS5MZWF2ZVJlcXVlc3QaFi5jaGF0LnYxLkxlYXZlUmVzcG9uc2ViBnByb3RvMw"), Vr = /* @__PURE__ */ D(L, 0), Br = /* @__PURE__ */ D(L, 10), Xt = /* @__PURE__ */ D(L, 11), Pr = /* @__PURE__ */ D(L, 12), Wt = /* @__PURE__ */ D(L, 13), Fr = /* @__PURE__ */ D(L, 14), jt = /* @__PURE__ */ D(L, 15), qt = /* @__PURE__ */ D(L, 17), ee = /* @__PURE__ */ Mr(L, 0), Gr = "x-origon-client-id", Yr = "stream_overflow", _e = {
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);
3130
+ function tt(e, t) {
3131
+ if (e == null) return;
3132
+ if (typeof e != "object" || Array.isArray(e))
3133
+ throw h.session(`${t} carried invalid metadata`);
3134
+ const n = e.audience;
3135
+ if (n == null || n === "") return {};
3136
+ if (n === "internal" || n === "all") return { audience: n };
3137
+ throw h.session(`${t} carried invalid metadata.audience`);
3138
+ }
3139
+ const Wr = "x-origon-client-id", jr = "stream_overflow", U = {
3140
+ /** session_not_found — terminal */
3141
+ NOT_FOUND: 1,
3142
+ /** bad request (e.g. missing client id at gw) — terminal */
3143
+ INVALID_ARGUMENT: 2,
3130
3144
  /** server_shutting_down (cx draining) — reattach ladder (D4) */
3131
3145
  UNAVAILABLE: 5,
3146
+ /** monitor capacity exhausted — terminal */
3147
+ CAPACITY: 7,
3132
3148
  /** token invalid/expired — SH-5 re-mint, retry once (D5) */
3133
3149
  UNAUTHENTICATED: 9,
3150
+ /** forbidden — terminal */
3151
+ PERMISSION_DENIED: 10,
3134
3152
  /** already_connected (slot held) — retryable */
3135
3153
  CONFLICT: 11
3136
3154
  };
3137
- function $r(e) {
3155
+ function se(e) {
3138
3156
  switch (e) {
3139
- case _e.CONFLICT:
3157
+ case U.CONFLICT:
3140
3158
  return "retry";
3141
- case _e.UNAUTHENTICATED:
3159
+ case U.UNAUTHENTICATED:
3142
3160
  return "remint";
3143
- case _e.UNAVAILABLE:
3161
+ case U.UNAVAILABLE:
3144
3162
  return "ladder";
3145
3163
  default:
3146
3164
  return "terminal";
3147
3165
  }
3148
3166
  }
3149
- function Ht(e) {
3167
+ function zt(e) {
3150
3168
  let t;
3151
3169
  try {
3152
3170
  t = new URL(e);
3153
3171
  } catch (s) {
3154
- throw f.session(
3172
+ throw h.session(
3155
3173
  `chat session url: ${s instanceof Error ? s.message : String(s)}`
3156
3174
  );
3157
3175
  }
3158
3176
  const n = t.pathname.split("/").slice(1);
3159
3177
  if (n.length === 4 && n[0] === "chat" && n[1] === "api" && n[3] === "live" && n[2].trim() !== "")
3160
3178
  return n[2];
3161
- throw f.session(
3179
+ throw h.session(
3162
3180
  `chat session url carries no client id (want /chat/api/<id>/live, got "${t.pathname}")`
3163
3181
  );
3164
3182
  }
3165
- function Kr(e) {
3166
- const t = de(Br, e);
3183
+ function qr(e) {
3184
+ const t = fe($r, e);
3167
3185
  switch (t.kind.case) {
3168
3186
  case "message":
3169
- return { kind: "message", message: Yn(t.kind.value) };
3170
- case "typing":
3171
- return { kind: "typing", on: t.kind.value.state === "on" };
3187
+ return { kind: "message", message: Xn(t.kind.value) };
3188
+ case "typing": {
3189
+ const n = t.kind.value;
3190
+ if (n.state !== "on" && n.state !== "off")
3191
+ throw h.session(`chat typing event carried invalid state "${n.state}"`);
3192
+ return {
3193
+ kind: "typing",
3194
+ update: {
3195
+ participantId: n.participantId,
3196
+ role: n.role,
3197
+ userId: n.userId,
3198
+ userName: n.userName,
3199
+ state: n.state,
3200
+ metadata: Qr(n.metadata?.audience)
3201
+ }
3202
+ };
3203
+ }
3172
3204
  case "sessionEnded": {
3173
3205
  const n = t.kind.value.reason;
3174
- return { kind: "ended", reason: n, replay: n === Yr };
3206
+ return { kind: "ended", reason: n, replay: n === jr };
3175
3207
  }
3176
3208
  default:
3177
3209
  return { kind: "ignore" };
3178
3210
  }
3179
3211
  }
3180
- function Yn(e) {
3212
+ function Xn(e) {
3213
+ const t = e.role === "ai" || e.role === "user" || e.role === "system" ? e.role : "external", n = tt(e.metadata, "chat message");
3181
3214
  return {
3182
- role: e.role === "ai" || e.role === "user" || e.role === "system" ? e.role : "external",
3215
+ role: t,
3183
3216
  id: e.id,
3184
- attachments: e.attachments.map((n) => ({
3185
- id: n.id,
3186
- name: n.name,
3187
- contentType: n.contentType,
3188
- url: n.url
3217
+ attachments: e.attachments.map((s) => ({
3218
+ id: s.id,
3219
+ name: s.name,
3220
+ contentType: s.contentType,
3221
+ ...s.url !== "" ? { url: s.url } : {}
3189
3222
  })),
3190
3223
  status: "delivered",
3191
3224
  state: e.state === "streaming" ? "streaming" : "completed",
3225
+ ...n !== void 0 ? { metadata: n } : {},
3192
3226
  ...e.text !== void 0 ? { text: e.text } : {},
3193
3227
  ...e.html !== void 0 ? { html: e.html } : {},
3194
3228
  ...e.timestamp !== "" ? { timestamp: e.timestamp } : {},
3195
3229
  ...e.userId !== "" ? { userId: e.userId } : {},
3196
3230
  ...e.userName !== "" ? { userName: e.userName } : {},
3197
3231
  ...e.action !== void 0 ? { action: e.action } : {},
3198
- ...e.buttons.length > 0 ? { buttons: e.buttons.map($n) } : {},
3199
- ...e.gallery.length > 0 ? { gallery: e.gallery.map(Xr) } : {}
3232
+ ...e.buttons.length > 0 ? { buttons: e.buttons.map(Kn) } : {},
3233
+ ...e.gallery.length > 0 ? { gallery: e.gallery.map(Hr) } : {}
3200
3234
  };
3201
3235
  }
3202
- function $n(e) {
3236
+ function Kn(e) {
3203
3237
  return { label: e.label, value: e.value, type: e.buttonType };
3204
3238
  }
3205
- function Xr(e) {
3239
+ function Hr(e) {
3206
3240
  return {
3207
3241
  title: e.title,
3208
3242
  description: e.description,
3209
- buttons: e.buttons.map($n),
3243
+ buttons: e.buttons.map(Kn),
3210
3244
  ...e.image !== void 0 ? {
3211
3245
  image: {
3212
3246
  id: e.image.id,
3213
3247
  name: e.image.name,
3214
3248
  contentType: e.image.contentType,
3215
- url: e.image.url
3249
+ ...e.image.url !== "" ? { url: e.image.url } : {}
3216
3250
  }
3217
3251
  } : {}
3218
3252
  };
3219
3253
  }
3220
- class Wr {
3254
+ class Zr {
3221
3255
  constructor(t, n) {
3222
- this.url = t.url, this.token = t.token, this.clientId = Ht(t.url), this.opts = n, this.client = this.createClient();
3256
+ this.url = t.url, this.token = t.token, this.clientId = zt(t.url), this.opts = n, this.client = this.createClient();
3223
3257
  }
3224
3258
  get credentials() {
3225
3259
  return { url: this.url, token: this.token };
@@ -3232,7 +3266,7 @@ class Wr {
3232
3266
  */
3233
3267
  setCredentials(t) {
3234
3268
  const n = t.url !== this.url;
3235
- this.url = t.url, this.token = t.token, n && (this.clientId = Ht(t.url), this.client = this.createClient());
3269
+ this.url = t.url, this.token = t.token, n && (this.clientId = zt(t.url), this.client = this.createClient());
3236
3270
  }
3237
3271
  createClient() {
3238
3272
  const t = {
@@ -3241,18 +3275,18 @@ class Wr {
3241
3275
  logout: () => {
3242
3276
  }
3243
3277
  };
3244
- return us(this.url, t, {
3245
- metadata: { [Gr]: this.clientId },
3278
+ return hs(this.url, t, {
3279
+ metadata: { [Wr]: this.clientId },
3246
3280
  ...this.opts.transport !== void 0 ? { transport: this.opts.transport } : {},
3247
3281
  ...this.opts.logger !== void 0 ? { logger: this.opts.logger } : {}
3248
3282
  });
3249
3283
  }
3250
3284
  /** Attach — join the room. The `initial` frame is the `AttachResponse`. */
3251
3285
  async attach() {
3252
- const t = Q(Xt, x(Xt)), n = await this.client.stream(te(ee.method.attach), t);
3286
+ const t = te(jt, C(jt)), n = await this.client.stream(re(ne.method.attach), t);
3253
3287
  let s;
3254
3288
  try {
3255
- s = de(Pr, n.initial);
3289
+ s = fe(Xr, n.initial);
3256
3290
  } catch (r) {
3257
3291
  throw n.cancel(), r;
3258
3292
  }
@@ -3263,10 +3297,10 @@ class Wr {
3263
3297
  * timestamp, rewritten attachment URLs) — the former POST echo.
3264
3298
  */
3265
3299
  async message(t) {
3266
- const n = x(Wt, {
3300
+ const n = C(qt, {
3267
3301
  clientMessageId: t.clientMessageId,
3268
3302
  attachments: (t.attachments ?? []).map(
3269
- (i) => x(Vr, {
3303
+ (i) => C(Gr, {
3270
3304
  id: i.id,
3271
3305
  name: i.name,
3272
3306
  contentType: i.contentType,
@@ -3277,41 +3311,52 @@ class Wr {
3277
3311
  ...t.text !== void 0 ? { text: t.text } : {},
3278
3312
  ...t.html !== void 0 ? { html: t.html } : {},
3279
3313
  ...t.value !== void 0 ? { value: t.value } : {},
3280
- ...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {}
3314
+ ...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {},
3315
+ ...t.metadata?.audience !== void 0 ? { metadata: C(Br, t.metadata) } : {}
3281
3316
  }), s = await this.client.call(
3282
- te(ee.method.message),
3283
- Q(Wt, n)
3284
- ), r = de(Fr, s);
3317
+ re(ne.method.message),
3318
+ te(qt, n)
3319
+ ), r = fe(Kr, s);
3285
3320
  if (r.message === void 0)
3286
- throw f.session("chat message response carried no message");
3287
- return Yn(r.message);
3321
+ throw h.session("chat message response carried no message");
3322
+ return Xn(r.message);
3288
3323
  }
3289
3324
  /** Typing — on/off indicator. Unary; the response is empty. */
3290
- async typing(t) {
3291
- const n = x(jt, { state: t });
3325
+ async typing(t, n) {
3326
+ const s = C(Ht, {
3327
+ state: t,
3328
+ ...n?.audience !== void 0 ? { metadata: C(Yr, n) } : {}
3329
+ });
3292
3330
  await this.client.call(
3293
- te(ee.method.typing),
3294
- Q(jt, n)
3331
+ re(ne.method.typing),
3332
+ te(Ht, s)
3295
3333
  );
3296
3334
  }
3297
3335
  /** Leave — explicit participant leave (immediate finalize, idempotent). */
3298
3336
  async leave() {
3299
3337
  await this.client.call(
3300
- te(ee.method.leave),
3301
- Q(qt, x(qt))
3338
+ re(ne.method.leave),
3339
+ te(Zt, C(Zt))
3302
3340
  );
3303
3341
  }
3304
3342
  }
3305
- function te(e) {
3343
+ function zr(e, t) {
3344
+ if (e === "internal" || e === "all") return e;
3345
+ throw h.session(`${t} carried invalid or missing metadata.audience`);
3346
+ }
3347
+ function Qr(e) {
3348
+ return { audience: zr(e, "chat typing event") };
3349
+ }
3350
+ function re(e) {
3306
3351
  return `${e.parent.typeName}/${e.name}`;
3307
3352
  }
3308
- const jr = 3e3, qr = 6e3, Hr = 3, Zr = 500, Jr = 2e3;
3309
- class zr {
3353
+ const Jr = 3e3, ei = 6e3, ti = 3, ni = 500, si = 2e3;
3354
+ class ri {
3310
3355
  constructor(t, n) {
3311
- this.stream = null, this.terminalFired = !1, this.reattaching = !1, this.knownMessageIds = /* @__PURE__ */ new Set(), this.outboundOffTimer = null, this.inboundOffTimer = null, this.sessionId = t.sessionId, this.lane = new Wr(
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(
3312
3357
  { url: t.url.replace(/\/$/, ""), token: t.token },
3313
3358
  { remint: () => this.remint() }
3314
- ), this.sessionHttp = n.sessionHttp, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
3359
+ ), this.sessionHttp = n.sessionHttp, this.provisionedRecovery = n.provisionedRecovery, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
3315
3360
  }
3316
3361
  /**
3317
3362
  * Attach to the room. Resolves once the initial `AttachResponse` frame is
@@ -3324,18 +3369,27 @@ class zr {
3324
3369
  try {
3325
3370
  ({ stream: t } = await this.lane.attach());
3326
3371
  } catch (n) {
3372
+ if (this.provisionedRecovery) {
3373
+ const s = this.provisionedTerminalFromRefusal(n);
3374
+ if (s)
3375
+ throw this.fireTerminal(s), n;
3376
+ if (await this.beginProvisionedRecovery(
3377
+ n instanceof T && se(n.code) === "remint" ? "unauthenticated" : "transportError"
3378
+ )) return;
3379
+ throw n;
3380
+ }
3327
3381
  throw this.fireTerminal(
3328
- n instanceof k ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
3382
+ n instanceof T ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
3329
3383
  ), n;
3330
3384
  }
3331
3385
  if (this.terminalFired)
3332
- throw t.cancel(), f.session("chat session closed during attach");
3386
+ throw t.cancel(), h.session("chat session closed during attach");
3333
3387
  this.stream = t, this.pump(t);
3334
3388
  }
3335
3389
  // ── Outbound API ─────────────────────────────────────────────────────
3336
3390
  async sendMessage(t) {
3337
3391
  this.cancelOutboundDebounce({ flushOff: !0 });
3338
- const n = ln(), s = {
3392
+ const n = hn(), s = tt(t.metadata, "chat message request"), r = {
3339
3393
  role: t.role ?? "external",
3340
3394
  id: "",
3341
3395
  localId: n,
@@ -3344,12 +3398,14 @@ class zr {
3344
3398
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3345
3399
  attachments: t.attachments ?? [],
3346
3400
  status: "sending",
3347
- state: "completed"
3401
+ state: "completed",
3402
+ ...s !== void 0 ? { metadata: s } : {}
3348
3403
  };
3349
- this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", s);
3404
+ this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", r);
3350
3405
  try {
3351
- const r = {
3406
+ const i = {
3352
3407
  clientMessageId: n,
3408
+ ...s !== void 0 ? { metadata: s } : {},
3353
3409
  ...t.text !== void 0 ? { text: t.text } : {},
3354
3410
  ...t.html !== void 0 ? { html: t.html } : {},
3355
3411
  ...t.attachments && t.attachments.length > 0 ? { attachments: t.attachments } : {},
@@ -3357,45 +3413,47 @@ class zr {
3357
3413
  value: t.buttonReply.value,
3358
3414
  ...t.buttonReply.label !== void 0 ? { galleryLabel: t.buttonReply.label } : {}
3359
3415
  } : {}
3360
- }, i = await this.lane.message(r), a = {
3361
- ...s,
3362
- ...i,
3416
+ }, a = await this.lane.message(i), o = {
3417
+ ...r,
3418
+ ...a,
3363
3419
  localId: n,
3364
3420
  // The canonical echo carries the rewritten attachment URLs; keep the
3365
3421
  // provisional rows (with their local previews) only when it has none.
3366
- attachments: i.attachments.length > 0 ? i.attachments : s.attachments
3422
+ attachments: a.attachments.length > 0 ? a.attachments : r.attachments
3367
3423
  };
3368
- return a.id && this.knownMessageIds.add(a.id), this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3369
- id: a.id || n,
3370
- message: a
3371
- }), a;
3372
- } catch (r) {
3373
- const i = {
3374
- ...s,
3424
+ return o.id && this.knownMessageIds.add(o.id), this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3425
+ id: o.id || n,
3426
+ message: o
3427
+ }), o;
3428
+ } catch (i) {
3429
+ const a = {
3430
+ ...r,
3375
3431
  status: "failed",
3376
- errorText: r instanceof Error ? r.message : String(r)
3432
+ errorText: i instanceof Error ? i.message : String(i)
3377
3433
  };
3378
3434
  throw this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3379
3435
  id: n,
3380
- message: i
3381
- }), r;
3436
+ message: a
3437
+ }), i;
3382
3438
  }
3383
3439
  }
3384
- notifyTyping() {
3385
- this.outboundOffTimer ? clearTimeout(this.outboundOffTimer) : this.sendTyping("on"), this.outboundOffTimer = setTimeout(() => {
3386
- this.outboundOffTimer = null, this.sendTyping("off");
3387
- }, jr);
3440
+ notifyTyping(t) {
3441
+ this.outboundOffTimer ? (clearTimeout(this.outboundOffTimer), this.outboundTypingMetadata?.audience !== t?.audience && (this.sendTyping("off", this.outboundTypingMetadata ?? void 0), this.sendTyping("on", t))) : this.sendTyping("on", t), this.outboundTypingMetadata = t, this.outboundOffTimer = setTimeout(() => {
3442
+ this.outboundOffTimer = null;
3443
+ const n = this.outboundTypingMetadata;
3444
+ this.outboundTypingMetadata = null, this.sendTyping("off", n ?? void 0);
3445
+ }, Jr);
3388
3446
  }
3389
3447
  stopTyping() {
3390
3448
  this.cancelOutboundDebounce({ flushOff: !0 });
3391
3449
  }
3392
3450
  async disconnect() {
3393
3451
  this.cancelOutboundDebounce({ flushOff: !1 });
3394
- const t = this.terminalFired;
3395
- this.fireTerminal({ kind: "localClose" }), t || await Promise.race([
3396
- this.lane.leave().catch((n) => {
3452
+ const n = !this.terminalFired && (this.provisionedRecovery === void 0 || this.stream !== null && this.provisionedRecoveryPromise === null);
3453
+ this.fireTerminal({ kind: "localClose" }), n && await Promise.race([
3454
+ this.lane.leave().catch((s) => {
3397
3455
  }),
3398
- oe(Jr)
3456
+ W(si)
3399
3457
  ]);
3400
3458
  }
3401
3459
  /**
@@ -3423,7 +3481,7 @@ class zr {
3423
3481
  if (this.terminalFired || this.stream !== t) continue;
3424
3482
  let r;
3425
3483
  try {
3426
- r = Kr(s);
3484
+ r = qr(s);
3427
3485
  } catch {
3428
3486
  this.fireTerminal({ kind: "protocolViolation" });
3429
3487
  return;
@@ -3433,20 +3491,24 @@ class zr {
3433
3491
  this.deliverMessage(r.message);
3434
3492
  break;
3435
3493
  case "typing":
3436
- this.handleTyping(r.on);
3494
+ this.handleTyping(r.update);
3437
3495
  break;
3438
3496
  case "ended":
3439
- n = !0, r.replay ? this.reattach() : this.fireTerminal({ kind: "sessionEnded" });
3497
+ n = !0, r.replay ? this.provisionedRecovery ? this.beginProvisionedRecovery("streamOverflow", t) : this.reattach() : this.fireTerminal({ kind: "sessionEnded" });
3440
3498
  break;
3441
3499
  case "ignore":
3442
3500
  break;
3443
3501
  }
3444
3502
  }
3445
3503
  } catch {
3504
+ if (this.provisionedRecovery && !n && !this.terminalFired && this.stream === t) {
3505
+ this.beginProvisionedRecovery("transportError", t);
3506
+ return;
3507
+ }
3446
3508
  !n && !this.terminalFired && this.stream === t && this.fireTerminal({ kind: "networkLoss" });
3447
3509
  return;
3448
3510
  }
3449
- !n && !this.terminalFired && this.stream === t && this.fireTerminal({ kind: "networkLoss" });
3511
+ !n && !this.terminalFired && this.stream === t && (this.provisionedRecovery ? this.beginProvisionedRecovery("cleanFin", t) : this.fireTerminal({ kind: "networkLoss" }));
3450
3512
  })();
3451
3513
  }
3452
3514
  /**
@@ -3457,7 +3519,7 @@ class zr {
3457
3519
  */
3458
3520
  deliverMessage(t) {
3459
3521
  if (this.terminalFired) return;
3460
- this.clearInboundWatchdog();
3522
+ this.clearInboundWatchdogsForUser(t.userId);
3461
3523
  const n = t.id || t.localId;
3462
3524
  n && this.knownMessageIds.has(n) ? this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3463
3525
  id: t.id || n,
@@ -3465,7 +3527,100 @@ class zr {
3465
3527
  }) : (n && this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", t));
3466
3528
  }
3467
3529
  handleTyping(t) {
3468
- t ? this.armInboundWatchdog() : this.clearInboundWatchdog(), this.dispatcher.fire("onTyping", this.sessionId, "chat", t);
3530
+ t.state === "on" ? this.armInboundWatchdog(t) : this.clearInboundWatchdog(t.participantId), this.dispatcher.fire("onTyping", this.sessionId, "chat", t);
3531
+ }
3532
+ // ── Provisioned recovery ─────────────────────────────────────────────
3533
+ /**
3534
+ * Serialize every provisioned refresh/Attach cycle. The returned promise is
3535
+ * shared by concurrent error/FIN signals. It is cleared before the recovered
3536
+ * stream pump starts, so a transport that fails immediately starts a new,
3537
+ * strictly later generation instead of being mistaken for the old cycle.
3538
+ */
3539
+ beginProvisionedRecovery(t, n) {
3540
+ if (!this.provisionedRecovery || this.terminalFired) return Promise.resolve(!1);
3541
+ if (n && this.stream === n && (this.stream = null), this.provisionedRecoveryPromise) return this.provisionedRecoveryPromise;
3542
+ this.clearAllInboundWatchdogs({ notify: !0 });
3543
+ const s = this.runProvisionedRecovery(t);
3544
+ let r;
3545
+ return r = s.then((i) => (this.provisionedRecoveryPromise === r && (this.provisionedRecoveryPromise = null), !i || this.terminalFired ? (i && i.cancel(), !1) : (this.stream = i, this.pump(i), !0))), this.provisionedRecoveryPromise = r, r;
3546
+ }
3547
+ /** Fresh control-plane authorization before every bounded Attach attempt. */
3548
+ async runProvisionedRecovery(t) {
3549
+ const n = this.provisionedRecovery;
3550
+ if (!n) return null;
3551
+ let s = t;
3552
+ for (let r = 0; r < n.delaysMs.length; r++) {
3553
+ if (await W(n.delaysMs[r]), this.terminalFired) return null;
3554
+ const i = ++this.recoveryGeneration;
3555
+ let a;
3556
+ try {
3557
+ a = await n.reauthorize({
3558
+ sessionId: this.sessionId,
3559
+ attempt: r + 1,
3560
+ generation: i,
3561
+ cause: s
3562
+ });
3563
+ } catch {
3564
+ continue;
3565
+ }
3566
+ if (this.terminalFired || i !== this.recoveryGeneration) return null;
3567
+ if ("terminal" in a)
3568
+ return this.fireProvisionedTerminal(a.terminal), null;
3569
+ if (a.sessionId !== this.sessionId || a.url.trim() === "" || a.token.trim() === "")
3570
+ return this.fireTerminal({ kind: "protocolViolation" }), null;
3571
+ try {
3572
+ this.lane.setCredentials({
3573
+ url: a.url.replace(/\/$/, ""),
3574
+ token: a.token
3575
+ });
3576
+ const { stream: o } = await this.lane.attach();
3577
+ return this.terminalFired || i !== this.recoveryGeneration ? (o.cancel(), null) : o;
3578
+ } catch (o) {
3579
+ const l = this.provisionedTerminalFromRefusal(o);
3580
+ if (l)
3581
+ return this.fireTerminal(l), null;
3582
+ o instanceof T && se(o.code) === "remint" && (s = "unauthenticated");
3583
+ }
3584
+ }
3585
+ return this.fireTerminal({ kind: "replayLost" }), null;
3586
+ }
3587
+ provisionedTerminalFromRefusal(t) {
3588
+ if (!(t instanceof T)) return null;
3589
+ switch (t.code) {
3590
+ case U.NOT_FOUND:
3591
+ return { kind: "sessionEnded" };
3592
+ case U.CAPACITY:
3593
+ return { kind: "resourceExhausted" };
3594
+ case U.PERMISSION_DENIED:
3595
+ case U.INVALID_ARGUMENT:
3596
+ return { kind: "serverClosed", code: t.code, reason: t.reason };
3597
+ default:
3598
+ return se(t.code) === "terminal" ? { kind: "serverClosed", code: t.code, reason: t.reason } : null;
3599
+ }
3600
+ }
3601
+ fireProvisionedTerminal(t) {
3602
+ switch (t) {
3603
+ case "ended":
3604
+ this.fireTerminal({ kind: "sessionEnded" });
3605
+ break;
3606
+ case "capacity":
3607
+ this.fireTerminal({ kind: "resourceExhausted" });
3608
+ break;
3609
+ case "revoked":
3610
+ this.fireTerminal({
3611
+ kind: "serverClosed",
3612
+ code: U.PERMISSION_DENIED,
3613
+ reason: "provisioned_authorization_revoked"
3614
+ });
3615
+ break;
3616
+ case "removed":
3617
+ this.fireTerminal({
3618
+ kind: "serverClosed",
3619
+ code: U.PERMISSION_DENIED,
3620
+ reason: "provisioned_participant_removed"
3621
+ });
3622
+ break;
3623
+ }
3469
3624
  }
3470
3625
  // ── Overflow reattach (D4) + SH-5 re-mint (D5) ───────────────────────
3471
3626
  /**
@@ -3479,8 +3634,8 @@ class zr {
3479
3634
  this.reattaching = !0;
3480
3635
  try {
3481
3636
  let t = !1;
3482
- for (let n = 0; n < Hr; n++) {
3483
- if (await oe(Zr * 2 ** n), this.terminalFired) return;
3637
+ for (let n = 0; n < ti; n++) {
3638
+ if (await W(ni * 2 ** n), this.terminalFired) return;
3484
3639
  try {
3485
3640
  const { stream: s } = await this.lane.attach();
3486
3641
  if (this.terminalFired) {
@@ -3490,8 +3645,8 @@ class zr {
3490
3645
  this.stream = s, this.pump(s), await this.replayHistory();
3491
3646
  return;
3492
3647
  } catch (s) {
3493
- if (s instanceof k) {
3494
- const r = $r(s.code);
3648
+ if (s instanceof T) {
3649
+ const r = se(s.code);
3495
3650
  if (r === "remint" && !t) {
3496
3651
  t = !0;
3497
3652
  try {
@@ -3499,7 +3654,7 @@ class zr {
3499
3654
  continue;
3500
3655
  } catch (i) {
3501
3656
  this.fireTerminal(
3502
- i instanceof f && i.kind === "session" ? { kind: "sessionEnded" } : { kind: "networkLoss" }
3657
+ i instanceof h && i.kind === "session" ? { kind: "sessionEnded" } : { kind: "networkLoss" }
3503
3658
  );
3504
3659
  return;
3505
3660
  }
@@ -3549,42 +3704,70 @@ class zr {
3549
3704
  * strand the visible transcript.
3550
3705
  */
3551
3706
  async remint() {
3707
+ if (this.provisionedRecovery)
3708
+ throw h.session(
3709
+ "provisioned chat credentials are refreshed only by the caller reauthorization policy"
3710
+ );
3552
3711
  const t = await this.sessionHttp.startSession({
3553
3712
  channel: "chat",
3554
3713
  sessionId: this.sessionId
3555
3714
  });
3556
3715
  if (t.sessionId !== this.sessionId)
3557
- throw f.session(
3716
+ throw h.session(
3558
3717
  `chat re-mint returned a different session (${t.sessionId}) — the room is gone`
3559
3718
  );
3560
3719
  return { url: t.url.replace(/\/$/, ""), token: t.token };
3561
3720
  }
3562
3721
  // ── Timers ───────────────────────────────────────────────────────────
3563
- armInboundWatchdog() {
3564
- this.clearInboundWatchdog(), this.inboundOffTimer = setTimeout(() => {
3565
- this.inboundOffTimer = null, this.dispatcher.fire("onTyping", this.sessionId, "chat", !1);
3566
- }, qr);
3722
+ armInboundWatchdog(t) {
3723
+ this.clearInboundWatchdog(t.participantId);
3724
+ const n = setTimeout(() => {
3725
+ this.inboundTyping.delete(t.participantId), this.dispatcher.fire("onTyping", this.sessionId, "chat", {
3726
+ ...t,
3727
+ state: "off"
3728
+ });
3729
+ }, ei);
3730
+ this.inboundTyping.set(t.participantId, { timer: n, update: t });
3567
3731
  }
3568
- clearInboundWatchdog() {
3569
- this.inboundOffTimer && (clearTimeout(this.inboundOffTimer), this.inboundOffTimer = null);
3732
+ clearInboundWatchdog(t) {
3733
+ const n = this.inboundTyping.get(t);
3734
+ n && (clearTimeout(n.timer), this.inboundTyping.delete(t));
3735
+ }
3736
+ clearInboundWatchdogsForUser(t) {
3737
+ if (t)
3738
+ for (const [n, s] of this.inboundTyping)
3739
+ s.update.userId === t && this.clearInboundWatchdog(n);
3740
+ }
3741
+ clearAllInboundWatchdogs({ notify: t }) {
3742
+ const n = [...this.inboundTyping.values()];
3743
+ this.inboundTyping.clear();
3744
+ for (const s of n)
3745
+ clearTimeout(s.timer), t && this.dispatcher.fire("onTyping", this.sessionId, "chat", {
3746
+ ...s.update,
3747
+ state: "off"
3748
+ });
3570
3749
  }
3571
3750
  cancelOutboundDebounce({ flushOff: t }) {
3572
- this.outboundOffTimer && (clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null, t && this.sendTyping("off"));
3751
+ if (this.outboundOffTimer) {
3752
+ clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null;
3753
+ const n = this.outboundTypingMetadata;
3754
+ this.outboundTypingMetadata = null, t && this.sendTyping("off", n ?? void 0);
3755
+ }
3573
3756
  }
3574
- async sendTyping(t) {
3757
+ async sendTyping(t, n) {
3575
3758
  try {
3576
- await this.lane.typing(t);
3759
+ await this.lane.typing(t, n);
3577
3760
  } catch {
3578
3761
  }
3579
3762
  }
3580
3763
  fireTerminal(t) {
3581
3764
  if (this.terminalFired) return;
3582
- this.terminalFired = !0;
3765
+ this.terminalFired = !0, this.recoveryGeneration++;
3583
3766
  const n = this.stream;
3584
- this.stream = null, n && n.cancel(), this.clearInboundWatchdog(), this.outboundOffTimer && (clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null), this.onTerminal(t, this.sessionId);
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);
3585
3768
  }
3586
3769
  }
3587
- class Qr {
3770
+ class ii {
3588
3771
  constructor(t) {
3589
3772
  this.endpoint = t.endpoint.replace(/\/$/, ""), this.defaultHeaders = {}, t.token && (this.defaultHeaders.Authorization = `Bearer ${t.token}`);
3590
3773
  }
@@ -3612,9 +3795,9 @@ class Qr {
3612
3795
  try {
3613
3796
  i = await fetch(t, r);
3614
3797
  } catch (a) {
3615
- throw f.other(`fetch failed: ${a.message}`);
3798
+ throw h.other(`fetch failed: ${a.message}`);
3616
3799
  }
3617
- return Zt(i);
3800
+ return Qt(i);
3618
3801
  }
3619
3802
  async getJsonAbsolute(t, n) {
3620
3803
  const s = {
@@ -3626,9 +3809,9 @@ class Qr {
3626
3809
  try {
3627
3810
  r = await fetch(t, s);
3628
3811
  } catch (i) {
3629
- throw f.other(`fetch failed: ${i.message}`);
3812
+ throw h.other(`fetch failed: ${i.message}`);
3630
3813
  }
3631
- return Zt(r);
3814
+ return Qt(r);
3632
3815
  }
3633
3816
  async deleteAbsolute(t, n) {
3634
3817
  const s = {
@@ -3640,50 +3823,53 @@ class Qr {
3640
3823
  try {
3641
3824
  r = await fetch(t, s);
3642
3825
  } catch (i) {
3643
- throw f.other(`fetch failed: ${i.message}`);
3826
+ throw h.other(`fetch failed: ${i.message}`);
3644
3827
  }
3645
3828
  if (!r.ok) {
3646
- const i = await r.text().catch(() => "");
3647
- throw et(r.status, i);
3829
+ const i = await r.text().catch(() => ""), a = n?.bearer;
3830
+ throw nt(
3831
+ r.status,
3832
+ a ? i.split(a).join("[REDACTED]") : i
3833
+ );
3648
3834
  }
3649
3835
  }
3650
3836
  buildAbsoluteUrl(t) {
3651
3837
  return this.url(t);
3652
3838
  }
3653
3839
  }
3654
- async function Zt(e) {
3840
+ async function Qt(e) {
3655
3841
  const t = await e.text();
3656
3842
  if (!e.ok)
3657
- throw et(e.status, t);
3843
+ throw nt(e.status, t);
3658
3844
  let n;
3659
3845
  if (t.length !== 0) {
3660
3846
  try {
3661
3847
  n = JSON.parse(t);
3662
3848
  } catch (s) {
3663
- throw f.other(`decode response: ${s.message}`);
3849
+ throw h.other(`decode response: ${s.message}`);
3664
3850
  }
3665
- if (tn(n))
3666
- throw f.http(e.status, n.error.code, n.error.message);
3851
+ if (sn(n))
3852
+ throw h.http(e.status, n.error.code, n.error.message);
3667
3853
  return n;
3668
3854
  }
3669
3855
  }
3670
- function et(e, t) {
3856
+ function nt(e, t) {
3671
3857
  if (e >= 500)
3672
- return f.serverUnavailable(e);
3858
+ return h.serverUnavailable(e);
3673
3859
  if (t.length === 0)
3674
- return f.http(e, "", `HTTP ${e}`);
3860
+ return h.http(e, "", `HTTP ${e}`);
3675
3861
  try {
3676
3862
  const n = JSON.parse(t);
3677
- if (tn(n))
3678
- return f.http(e, n.error.code, n.error.message);
3863
+ if (sn(n))
3864
+ return h.http(e, n.error.code, n.error.message);
3679
3865
  } catch {
3680
3866
  }
3681
- return f.http(e, "", t.slice(0, 200));
3867
+ return h.http(e, "", t.slice(0, 200));
3682
3868
  }
3683
- function Oe(e, t) {
3869
+ function ve(e, t) {
3684
3870
  return t ? `${e}?userId=${encodeURIComponent(t)}` : e;
3685
3871
  }
3686
- class ei {
3872
+ class ai {
3687
3873
  constructor(t, n) {
3688
3874
  this.http = t, this.userId = n;
3689
3875
  }
@@ -3695,54 +3881,87 @@ class ei {
3695
3881
  startSession(t) {
3696
3882
  const n = { channel: t.channel };
3697
3883
  return t.sessionId && (n.sessionId = t.sessionId), t.data && (n.data = t.data), this.http.postJson(
3698
- Oe("/session/start", this.userId),
3884
+ ve("/session/start", this.userId),
3699
3885
  n
3700
3886
  );
3701
3887
  }
3702
3888
  /** `GET /sessions` — list prior sessions (matches `client-sdk/session`). */
3703
3889
  async listSessions() {
3704
- const t = await this.http.getJson(Oe("/sessions", this.userId));
3705
- return ti(t);
3890
+ const t = await this.http.getJson(ve("/sessions", this.userId));
3891
+ return oi(t);
3706
3892
  }
3707
3893
  /** `GET /session/{id}` — fetch transcript + control (matches `client-sdk/session`). */
3708
- getSession(t) {
3709
- return this.http.getJson(
3710
- Oe(`/session/${encodeURIComponent(t)}`, this.userId)
3894
+ async getSession(t) {
3895
+ const n = await this.http.getJson(
3896
+ ve(`/session/${encodeURIComponent(t)}`, this.userId)
3711
3897
  );
3898
+ return ci(n);
3712
3899
  }
3713
3900
  }
3714
- function ti(e) {
3901
+ function oi(e) {
3715
3902
  if (!Array.isArray(e))
3716
- throw f.other("decode sessions: expected an array");
3903
+ throw h.other("decode sessions: expected an array");
3717
3904
  return e.forEach((t, n) => {
3718
3905
  if (typeof t != "object" || t === null || Array.isArray(t))
3719
- throw f.other(`decode sessions[${n}]: expected an object`);
3906
+ throw h.other(`decode sessions[${n}]: expected an object`);
3720
3907
  if (typeof t.active != "boolean")
3721
- throw f.other(`decode sessions[${n}].active: expected boolean`);
3722
- }), e;
3723
- }
3724
- function ni(e, t, n) {
3725
- return new Promise((s, r) => {
3726
- const i = new XMLHttpRequest();
3727
- i.open("POST", e, !0);
3728
- const a = new FormData();
3729
- a.append("file", t, t.name);
3730
- let o = -1, l = 0;
3731
- if (n.onProgress && (i.upload.onprogress = (u) => {
3732
- const d = u.lengthComputable ? u.total : void 0, h = u.loaded, m = d !== void 0 ? Math.min(100, Math.floor(h / d * 100)) : void 0, g = Date.now();
3733
- if (m !== void 0 ? m !== o : g - l >= 100) {
3734
- m !== void 0 && (o = m), l = g;
3735
- const p = { bytesUploaded: h };
3736
- d !== void 0 && (p.totalBytes = d), m !== void 0 && (p.percent = m), n.onProgress?.(p);
3908
+ throw h.other(`decode sessions[${n}].active: expected boolean`);
3909
+ }), e.map((t, n) => {
3910
+ const s = t;
3911
+ return s.lastMessage === void 0 || s.lastMessage === null ? s : {
3912
+ ...s,
3913
+ lastMessage: Wn(s.lastMessage, `decode sessions[${n}].lastMessage`)
3914
+ };
3915
+ });
3916
+ }
3917
+ function ci(e) {
3918
+ if (typeof e != "object" || e === null || Array.isArray(e))
3919
+ throw h.other("decode session: expected an object");
3920
+ const t = e.history;
3921
+ if (!Array.isArray(t))
3922
+ throw h.other("decode session.history: expected an array");
3923
+ return {
3924
+ ...e,
3925
+ history: t.map(
3926
+ (n, s) => Wn(n, `decode session.history[${s}]`)
3927
+ )
3928
+ };
3929
+ }
3930
+ function Wn(e, t) {
3931
+ if (typeof e != "object" || e === null || Array.isArray(e))
3932
+ throw h.other(`${t}: expected an object`);
3933
+ const n = e, s = tt(
3934
+ e.metadata,
3935
+ t
3936
+ );
3937
+ if (s === void 0) {
3938
+ const { metadata: r, ...i } = n;
3939
+ return i;
3940
+ }
3941
+ return { ...n, metadata: s };
3942
+ }
3943
+ function ui(e, t, n, s) {
3944
+ return new Promise((r, i) => {
3945
+ const a = new XMLHttpRequest();
3946
+ a.open("POST", e, !0), s && a.setRequestHeader("Authorization", `Bearer ${s}`);
3947
+ const o = new FormData();
3948
+ o.append("file", t, t.name);
3949
+ let l = -1, u = 0;
3950
+ if (n.onProgress && (a.upload.onprogress = (d) => {
3951
+ const f = d.lengthComputable ? d.total : void 0, p = d.loaded, m = f !== void 0 ? Math.min(100, Math.floor(p / f * 100)) : void 0, g = Date.now();
3952
+ if (m !== void 0 ? m !== l : g - u >= 100) {
3953
+ m !== void 0 && (l = m), u = g;
3954
+ const x = { bytesUploaded: p };
3955
+ f !== void 0 && (x.totalBytes = f), m !== void 0 && (x.percent = m), n.onProgress?.(x);
3737
3956
  }
3738
- }), i.onload = () => {
3739
- const u = i.status, d = i.responseText ?? "";
3740
- if (u < 200 || u >= 300) {
3741
- r(et(u, d));
3957
+ }), a.onload = () => {
3958
+ const d = a.status, f = a.responseText ?? "";
3959
+ if (d < 200 || d >= 300) {
3960
+ i(nt(d, hi(f, s)));
3742
3961
  return;
3743
3962
  }
3744
3963
  try {
3745
- const h = JSON.parse(d);
3964
+ const p = li(JSON.parse(f));
3746
3965
  if (n.onProgress && t.size > 0) {
3747
3966
  const m = {
3748
3967
  bytesUploaded: t.size,
@@ -3751,33 +3970,48 @@ function ni(e, t, n) {
3751
3970
  };
3752
3971
  n.onProgress(m);
3753
3972
  }
3754
- s(h);
3755
- } catch (h) {
3756
- r(f.other(`decode response: ${h.message}`));
3973
+ r(p);
3974
+ } catch (p) {
3975
+ i(h.other(`decode response: ${p.message}`));
3757
3976
  }
3758
- }, i.onerror = () => {
3759
- r(f.other("upload failed: network error"));
3760
- }, i.onabort = () => {
3761
- r(f.cancelled());
3977
+ }, a.onerror = () => {
3978
+ i(h.other("upload failed: network error"));
3979
+ }, a.onabort = () => {
3980
+ i(h.cancelled());
3762
3981
  }, n.signal) {
3763
3982
  if (n.signal.aborted) {
3764
- i.abort();
3983
+ a.abort();
3765
3984
  return;
3766
3985
  }
3767
- n.signal.addEventListener("abort", () => i.abort(), { once: !0 });
3986
+ n.signal.addEventListener("abort", () => a.abort(), { once: !0 });
3768
3987
  }
3769
- i.send(a);
3988
+ a.send(o);
3770
3989
  });
3771
3990
  }
3772
- function si(e, t) {
3991
+ function li(e) {
3992
+ if (!di(e)) throw h.other("decode response: attachment must be an object");
3993
+ const { id: t, name: n, contentType: s, url: r } = e;
3994
+ if (typeof t != "string" || typeof n != "string" || typeof s != "string")
3995
+ throw h.other("decode response: attachment id, name, and contentType must be strings");
3996
+ if (r !== void 0 && typeof r != "string")
3997
+ throw h.other("decode response: attachment url must be a string when present");
3998
+ return { id: t, name: n, contentType: s, ...r !== void 0 ? { url: r } : {} };
3999
+ }
4000
+ function di(e) {
4001
+ return typeof e == "object" && e !== null && !Array.isArray(e);
4002
+ }
4003
+ function hi(e, t) {
4004
+ return t ? e.split(t).join("[REDACTED]") : e;
4005
+ }
4006
+ function fi(e, t) {
3773
4007
  if (e.size === 0)
3774
- return { ok: !1, error: f.attachment("EMPTY_FILE", `Empty file: ${e.name}`) };
4008
+ return { ok: !1, error: h.attachment("EMPTY_FILE", `Empty file: ${e.name}`) };
3775
4009
  if (!t) return { ok: !0 };
3776
- const n = ri(e.type);
4010
+ const n = mi(e.type);
3777
4011
  if (!n)
3778
4012
  return {
3779
4013
  ok: !1,
3780
- error: f.attachment(
4014
+ error: h.attachment(
3781
4015
  "POLICY_UNSUPPORTED_TYPE",
3782
4016
  `Unsupported content type: ${e.type || "unknown"}`
3783
4017
  )
@@ -3785,43 +4019,43 @@ function si(e, t) {
3785
4019
  const s = t[n];
3786
4020
  return !s || !s.enabled ? {
3787
4021
  ok: !1,
3788
- error: f.attachment(
4022
+ error: h.attachment(
3789
4023
  "POLICY_TYPE_DISABLED",
3790
4024
  `Attachment type disabled: ${n}`
3791
4025
  )
3792
4026
  } : s.maxSize && e.size > s.maxSize * 1024 * 1024 ? {
3793
4027
  ok: !1,
3794
- error: f.attachment(
4028
+ error: h.attachment(
3795
4029
  "POLICY_TOO_LARGE",
3796
4030
  `File ${e.name} exceeds ${s.maxSize}MB limit for ${n}`
3797
4031
  )
3798
4032
  } : { ok: !0 };
3799
4033
  }
3800
- function ri(e) {
4034
+ function mi(e) {
3801
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;
3802
4036
  }
3803
4037
  const Jt = "origonWebSdkUserId";
3804
- function ii() {
4038
+ function pi() {
3805
4039
  const e = localStorage.getItem(Jt);
3806
4040
  if (e) return e;
3807
- const t = ln();
4041
+ const t = hn();
3808
4042
  return localStorage.setItem(Jt, t), t;
3809
4043
  }
3810
- const ai = (1n << 62n) - 1n;
4044
+ const bi = (1n << 62n) - 1n;
3811
4045
  class y extends Error {
3812
4046
  constructor(t) {
3813
4047
  super(t), this.name = "CodecError";
3814
4048
  }
3815
4049
  }
3816
- function oi(e) {
4050
+ function gi(e) {
3817
4051
  if (e < 0n) throw new y(`negative varint: ${e}`);
3818
4052
  if (e <= 63n) return 1;
3819
4053
  if (e <= 16383n) return 2;
3820
4054
  if (e <= 1073741823n) return 4;
3821
- if (e <= ai) return 8;
4055
+ if (e <= bi) return 8;
3822
4056
  throw new y(`varint overflow: ${e}`);
3823
4057
  }
3824
- class Y {
4058
+ class X {
3825
4059
  constructor() {
3826
4060
  this.chunks = [], this.len = 0;
3827
4061
  }
@@ -3843,7 +4077,7 @@ class Y {
3843
4077
  this.chunks.push(t), this.len += t.length;
3844
4078
  }
3845
4079
  putVarint(t) {
3846
- const n = typeof t == "number" ? BigInt(t) : t, s = oi(n);
4080
+ const n = typeof t == "number" ? BigInt(t) : t, s = gi(n);
3847
4081
  switch (s) {
3848
4082
  case 1:
3849
4083
  this.putU8(Number(n));
@@ -3882,7 +4116,7 @@ class Y {
3882
4116
  return t;
3883
4117
  }
3884
4118
  }
3885
- class ge {
4119
+ class ye {
3886
4120
  constructor(t) {
3887
4121
  this.buf = t, this.offset = 0;
3888
4122
  }
@@ -3963,9 +4197,9 @@ class ge {
3963
4197
  return new TextDecoder("utf-8", { fatal: !0 }).decode(this.getLengthPrefixedBytes());
3964
4198
  }
3965
4199
  }
3966
- function ci(e) {
4200
+ function Ei(e) {
3967
4201
  try {
3968
- const t = new ge(e);
4202
+ const t = new ye(e);
3969
4203
  t.getVarint();
3970
4204
  const n = t.getVarint();
3971
4205
  return t.position() + Number(n);
@@ -3973,56 +4207,56 @@ function ci(e) {
3973
4207
  return null;
3974
4208
  }
3975
4209
  }
3976
- const ui = 1, Kn = 2, li = 4, di = 8, hi = 32;
3977
- function fi(e) {
3978
- const t = new Y(), n = e.endOfGroup ? Kn : 0;
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;
3979
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();
3980
4214
  }
3981
- function mi(e) {
3982
- const t = new ge(e), n = Number(t.getVarint());
4215
+ function Si(e) {
4216
+ const t = new ye(e), n = Number(t.getVarint());
3983
4217
  if (!(n >= 0 && n <= 15 || n >= 32 && n <= 47))
3984
4218
  throw new y(`invalid ObjectDatagram type byte 0x${n.toString(16)}`);
3985
- const s = (n & ui) !== 0, r = (n & Kn) !== 0, i = (n & li) !== 0, a = (n & di) !== 0, o = (n & hi) !== 0;
4219
+ const s = (n & yi) !== 0, r = (n & jn) !== 0, i = (n & wi) !== 0, a = (n & Ii) !== 0, o = (n & Ni) !== 0;
3986
4220
  if (o && r)
3987
4221
  throw new y("status datagram cannot also be end-of-group");
3988
- const l = t.getVarint(), u = t.getVarint(), d = i ? 1n : t.getVarint(), h = a ? 0 : t.getU8();
4222
+ const l = t.getVarint(), u = t.getVarint(), d = i ? 1n : t.getVarint(), f = a ? 0 : t.getU8();
3989
4223
  if (s) {
3990
- const g = Number(t.getVarint());
3991
- if (g === 0) throw new y("extension block declared but empty");
3992
- t.getBytes(g);
4224
+ const m = Number(t.getVarint());
4225
+ if (m === 0) throw new y("extension block declared but empty");
4226
+ t.getBytes(m);
3993
4227
  }
3994
4228
  if (o)
3995
4229
  return t.getVarint(), {
3996
4230
  trackAlias: l,
3997
4231
  groupId: u,
3998
4232
  objectId: d,
3999
- publisherPriority: h,
4233
+ publisherPriority: f,
4000
4234
  endOfGroup: r,
4001
4235
  payload: new Uint8Array(0)
4002
4236
  };
4003
- const m = t.drainRemaining();
4237
+ const p = t.drainRemaining();
4004
4238
  return {
4005
4239
  trackAlias: l,
4006
4240
  groupId: u,
4007
4241
  objectId: d,
4008
- publisherPriority: h,
4242
+ publisherPriority: f,
4009
4243
  endOfGroup: r,
4010
- payload: m.slice()
4244
+ payload: p.slice()
4011
4245
  };
4012
4246
  }
4013
- const ne = {
4247
+ const ie = {
4014
4248
  AudioObject: 0,
4015
4249
  AudioFeedback: 1
4016
4250
  };
4017
- function zt(e, t) {
4251
+ function en(e, t) {
4018
4252
  const n = new Uint8Array(t.length + 1);
4019
4253
  return n[0] = e, n.set(t, 1), n;
4020
4254
  }
4021
- function pi(e) {
4255
+ function ki(e) {
4022
4256
  if (e.length === 0) throw new y("empty datagram envelope");
4023
4257
  return { cls: e[0], body: e.subarray(1) };
4024
4258
  }
4025
- const Me = 64 * 1024, T = {
4259
+ const Pe = 64 * 1024, S = {
4026
4260
  CONNECT: 0x40n,
4027
4261
  CONNECT_OK: 0x41n,
4028
4262
  NEGOTIATE_MEDIA: 0x42n,
@@ -4043,31 +4277,31 @@ const Me = 64 * 1024, T = {
4043
4277
  // 0x54 = DtmfReceived — not implemented; uni-stream payload anyway
4044
4278
  MOQ_ERROR: 0x55n
4045
4279
  };
4046
- function bi(e) {
4047
- const t = new Y(), { msgType: n, payload: s } = Ei(e);
4048
- if (s.length > Me)
4049
- throw new y(`control frame payload ${s.length} > ${Me}`);
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}`);
4050
4284
  return t.putVarint(n), t.putVarint(s.length), t.putBytes(s), t.toUint8Array();
4051
4285
  }
4052
- function gi(e) {
4053
- const t = ci(e);
4286
+ function Ri(e) {
4287
+ const t = Ei(e);
4054
4288
  if (t === null || t > e.length) return null;
4055
- const n = new ge(e), s = n.getVarint(), r = Number(n.getVarint());
4056
- if (r > Me)
4289
+ const n = new ye(e), s = n.getVarint(), r = Number(n.getVarint());
4290
+ if (r > Pe)
4057
4291
  throw new y(`oversized payload ${r}`);
4058
4292
  const i = n.getBytes(r);
4059
- return { msg: yi(s, i), consumed: t };
4293
+ return { msg: vi(s, i), consumed: t };
4060
4294
  }
4061
- function Ei(e) {
4295
+ function _i(e) {
4062
4296
  switch (e.type) {
4063
4297
  case "connect":
4064
- return { msgType: T.CONNECT, payload: Ui(e.data) };
4298
+ return { msgType: S.CONNECT, payload: Xi(e.data) };
4065
4299
  case "negotiateMedia":
4066
- return { msgType: T.NEGOTIATE_MEDIA, payload: xi(e.data) };
4300
+ return { msgType: S.NEGOTIATE_MEDIA, payload: Ki(e.data) };
4067
4301
  case "mute":
4068
- return { msgType: T.MUTE, payload: Mi(e.data) };
4302
+ return { msgType: S.MUTE, payload: Wi(e.data) };
4069
4303
  case "resume":
4070
- return { msgType: T.RESUME, payload: Vi(e.data) };
4304
+ return { msgType: S.RESUME, payload: ji(e.data) };
4071
4305
  // The remaining variants are server-emitted; we never encode them
4072
4306
  // outbound. Including the cases keeps the union exhaustive.
4073
4307
  case "connectOk":
@@ -4083,39 +4317,39 @@ function Ei(e) {
4083
4317
  throw new y(`refusing to encode server-emitted variant '${e.type}'`);
4084
4318
  }
4085
4319
  }
4086
- function yi(e, t) {
4087
- const n = new ge(t);
4320
+ function vi(e, t) {
4321
+ const n = new ye(t);
4088
4322
  let s;
4089
4323
  switch (e) {
4090
- case T.CONNECT_OK:
4091
- s = { type: "connectOk", data: Bi(n) };
4324
+ case S.CONNECT_OK:
4325
+ s = { type: "connectOk", data: qi(n) };
4092
4326
  break;
4093
- case T.NEGOTIATE_MEDIA_OK:
4094
- s = { type: "negotiateMediaOk", data: Pi(n) };
4327
+ case S.NEGOTIATE_MEDIA_OK:
4328
+ s = { type: "negotiateMediaOk", data: Hi(n) };
4095
4329
  break;
4096
- case T.MUTE_OK:
4097
- s = { type: "muteOk", data: Fi(n) };
4330
+ case S.MUTE_OK:
4331
+ s = { type: "muteOk", data: Zi(n) };
4098
4332
  break;
4099
- case T.RESUME_OK:
4100
- s = { type: "resumeOk", data: Gi(n) };
4333
+ case S.RESUME_OK:
4334
+ s = { type: "resumeOk", data: zi(n) };
4101
4335
  break;
4102
- case T.PEER_ATTACHED:
4103
- s = { type: "peerAttached", data: Yi(n) };
4336
+ case S.PEER_ATTACHED:
4337
+ s = { type: "peerAttached", data: Qi(n) };
4104
4338
  break;
4105
- case T.PEER_DETACHED:
4106
- s = { type: "peerDetached", data: $i(n) };
4339
+ case S.PEER_DETACHED:
4340
+ s = { type: "peerDetached", data: Ji(n) };
4107
4341
  break;
4108
- case T.ENDPOINT_MUTED:
4109
- s = { type: "endpointMuted", data: Ki(n) };
4342
+ case S.ENDPOINT_MUTED:
4343
+ s = { type: "endpointMuted", data: ea(n) };
4110
4344
  break;
4111
- case T.ENDPOINT_HANGUP:
4112
- s = { type: "endpointHangup", data: Xi(n) };
4345
+ case S.ENDPOINT_HANGUP:
4346
+ s = { type: "endpointHangup", data: ta(n) };
4113
4347
  break;
4114
- case T.PEER_STATE_CHANGED:
4115
- s = { type: "peerStateChanged", data: Wi(n) };
4348
+ case S.PEER_STATE_CHANGED:
4349
+ s = { type: "peerStateChanged", data: na(n) };
4116
4350
  break;
4117
- case T.MOQ_ERROR:
4118
- s = { type: "moqError", data: ji(n) };
4351
+ case S.MOQ_ERROR:
4352
+ s = { type: "moqError", data: sa(n) };
4119
4353
  break;
4120
4354
  default:
4121
4355
  throw new y(`unknown control message type 0x${e.toString(16)}`);
@@ -4126,17 +4360,17 @@ function yi(e, t) {
4126
4360
  );
4127
4361
  return s;
4128
4362
  }
4129
- function wi(e) {
4363
+ function Oi(e) {
4130
4364
  switch (e) {
4131
4365
  case "audio":
4132
4366
  return 1n;
4133
4367
  }
4134
4368
  }
4135
- function Ni(e) {
4369
+ function Ci(e) {
4136
4370
  if (e === 1n) return "audio";
4137
4371
  throw new y(`unknown EncodingClass id ${e}`);
4138
4372
  }
4139
- function Ii(e) {
4373
+ function Di(e) {
4140
4374
  switch (e) {
4141
4375
  case "primary":
4142
4376
  return 1n;
@@ -4144,12 +4378,12 @@ function Ii(e) {
4144
4378
  return 2n;
4145
4379
  }
4146
4380
  }
4147
- function Ti(e) {
4381
+ function Ui(e) {
4148
4382
  if (e === 1n) return "primary";
4149
4383
  if (e === 2n) return "captions";
4150
4384
  throw new y(`unknown TrackPurpose id ${e}`);
4151
4385
  }
4152
- function Si(e) {
4386
+ function Li(e) {
4153
4387
  switch (e) {
4154
4388
  case "opus":
4155
4389
  return 1n;
@@ -4159,13 +4393,13 @@ function Si(e) {
4159
4393
  return 3n;
4160
4394
  }
4161
4395
  }
4162
- function tt(e) {
4396
+ function st(e) {
4163
4397
  if (e === 1n) return "opus";
4164
4398
  if (e === 2n) return "pcmu";
4165
4399
  if (e === 3n) return "pcma";
4166
4400
  throw new y(`unknown AudioCodec id ${e}`);
4167
4401
  }
4168
- function ki(e) {
4402
+ function Mi(e) {
4169
4403
  switch (e) {
4170
4404
  case "none":
4171
4405
  return 0n;
@@ -4177,165 +4411,165 @@ function ki(e) {
4177
4411
  return 3n;
4178
4412
  }
4179
4413
  }
4180
- function Xn(e) {
4414
+ function qn(e) {
4181
4415
  if (e === 0n) return "none";
4182
4416
  if (e === 1n) return "uplink";
4183
4417
  if (e === 2n) return "downlink";
4184
4418
  if (e === 3n) return "both";
4185
4419
  throw new y(`unknown MuteScope id ${e}`);
4186
4420
  }
4187
- function Ai(e) {
4421
+ function xi(e) {
4188
4422
  if (e === 1n) return "normal";
4189
4423
  if (e === 2n) return "userCancel";
4190
4424
  if (e === 3n) return "error";
4191
4425
  throw new y(`unknown HangupReason id ${e}`);
4192
4426
  }
4193
- function Wn(e) {
4427
+ function Hn(e) {
4194
4428
  if (e === 1n) return "client";
4195
4429
  if (e === 2n) return "controller";
4196
4430
  if (e === 3n) return "engine";
4197
4431
  if (e === 4n) return "networkLost";
4198
4432
  throw new y(`unknown Origin id ${e}`);
4199
4433
  }
4200
- function _i(e) {
4434
+ function Pi(e) {
4201
4435
  if (e === 1n) return "active";
4202
4436
  if (e === 2n) return "held";
4203
4437
  if (e === 3n) return "muted";
4204
4438
  if (e === 4n) return "hangup";
4205
4439
  throw new y(`unknown PeerState id ${e}`);
4206
4440
  }
4207
- function Oi(e) {
4441
+ function Vi(e) {
4208
4442
  if (e === 1n) return "codecMismatch";
4209
4443
  if (e === 2n) return "unsupportedClass";
4210
4444
  if (e === 3n) return "capacityExceeded";
4211
4445
  throw new y(`unknown TrackRejectionReason id ${e}`);
4212
4446
  }
4213
- function Ri(e, t) {
4214
- t.putVarint(wi(e.class)), t.putVarint(Ii(e.purpose)), t.putVarint(e.codecs.length);
4215
- for (const n of e.codecs) t.putVarint(Si(n));
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));
4216
4450
  }
4217
- function jn(e, t) {
4451
+ function Zn(e, t) {
4218
4452
  t.putVarint(e.length);
4219
- for (const n of e) Ri(n, t);
4453
+ for (const n of e) Fi(n, t);
4220
4454
  }
4221
- function Ci(e) {
4455
+ function Gi(e) {
4222
4456
  return {
4223
4457
  offerIndex: Number(e.getVarint()),
4224
4458
  alias: e.getVarint(),
4225
- codec: tt(e.getVarint()),
4459
+ codec: st(e.getVarint()),
4226
4460
  frameSizeMs: Number(e.getVarint())
4227
4461
  };
4228
4462
  }
4229
- function qn(e) {
4463
+ function zn(e) {
4230
4464
  const t = Number(e.getVarint()), n = [];
4231
- for (let s = 0; s < t; s++) n.push(Ci(e));
4465
+ for (let s = 0; s < t; s++) n.push(Gi(e));
4232
4466
  return n;
4233
4467
  }
4234
- function vi(e) {
4468
+ function Bi(e) {
4235
4469
  return {
4236
4470
  offerIndex: Number(e.getVarint()),
4237
- reason: Oi(e.getVarint())
4471
+ reason: Vi(e.getVarint())
4238
4472
  };
4239
4473
  }
4240
- function Hn(e) {
4474
+ function Qn(e) {
4241
4475
  const t = Number(e.getVarint()), n = [];
4242
- for (let s = 0; s < t; s++) n.push(vi(e));
4476
+ for (let s = 0; s < t; s++) n.push(Bi(e));
4243
4477
  return n;
4244
4478
  }
4245
- function Di(e) {
4479
+ function Yi(e) {
4246
4480
  return {
4247
4481
  peerEndpointId: e.getString(),
4248
4482
  alias: e.getVarint(),
4249
- codec: tt(e.getVarint())
4483
+ codec: st(e.getVarint())
4250
4484
  };
4251
4485
  }
4252
- function Li(e) {
4253
- const t = e.getVarint(), n = Xn(e.getVarint()), s = e.getVarint() !== 0n, r = Number(e.getVarint()), i = [];
4254
- for (let a = 0; a < r; a++) i.push(Di(e));
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));
4255
4489
  return { sessionSeq: t, mute: n, held: s, peers: i };
4256
4490
  }
4257
- function Ui(e) {
4258
- const t = new Y();
4259
- return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putString(e.sdkName), t.putString(e.sdkVersion), jn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
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();
4260
4494
  }
4261
- function xi(e) {
4262
- const t = new Y();
4263
- return t.putVarint(e.requestId), jn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
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();
4264
4498
  }
4265
- function Mi(e) {
4266
- const t = new Y();
4267
- return t.putVarint(e.requestId), t.putVarint(ki(e.scope)), t.toUint8Array();
4499
+ function Wi(e) {
4500
+ const t = new X();
4501
+ return t.putVarint(e.requestId), t.putVarint(Mi(e.scope)), t.toUint8Array();
4268
4502
  }
4269
- function Vi(e) {
4270
- const t = new Y();
4503
+ function ji(e) {
4504
+ const t = new X();
4271
4505
  return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putVarint(e.lastEventSeq), t.toUint8Array();
4272
4506
  }
4273
- function Bi(e) {
4507
+ function qi(e) {
4274
4508
  return {
4275
4509
  requestId: e.getVarint(),
4276
4510
  serverEpochUnix: e.getVarint(),
4277
4511
  canonicalPcmRate: Number(e.getVarint()),
4278
- bindings: qn(e),
4279
- rejected: Hn(e)
4512
+ bindings: zn(e),
4513
+ rejected: Qn(e)
4280
4514
  };
4281
4515
  }
4282
- function Pi(e) {
4516
+ function Hi(e) {
4283
4517
  return {
4284
4518
  requestId: e.getVarint(),
4285
- bindings: qn(e),
4286
- rejected: Hn(e)
4519
+ bindings: zn(e),
4520
+ rejected: Qn(e)
4287
4521
  };
4288
4522
  }
4289
- function Fi(e) {
4523
+ function Zi(e) {
4290
4524
  return { requestId: e.getVarint() };
4291
4525
  }
4292
- function Gi(e) {
4526
+ function zi(e) {
4293
4527
  return {
4294
4528
  requestId: e.getVarint(),
4295
- state: Li(e)
4529
+ state: $i(e)
4296
4530
  };
4297
4531
  }
4298
- function Yi(e) {
4532
+ function Qi(e) {
4299
4533
  return {
4300
4534
  requestId: e.getVarint(),
4301
4535
  peerEndpointId: e.getString(),
4302
4536
  alias: e.getVarint(),
4303
- class: Ni(e.getVarint()),
4304
- purpose: Ti(e.getVarint()),
4305
- codec: tt(e.getVarint()),
4537
+ class: Ci(e.getVarint()),
4538
+ purpose: Ui(e.getVarint()),
4539
+ codec: st(e.getVarint()),
4306
4540
  frameSizeMs: Number(e.getVarint())
4307
4541
  };
4308
4542
  }
4309
- function $i(e) {
4543
+ function Ji(e) {
4310
4544
  return {
4311
4545
  requestId: e.getVarint(),
4312
4546
  peerEndpointId: e.getString()
4313
4547
  };
4314
4548
  }
4315
- function Ki(e) {
4549
+ function ea(e) {
4316
4550
  return {
4317
4551
  requestId: e.getVarint(),
4318
4552
  endpointId: e.getString(),
4319
- scope: Xn(e.getVarint()),
4320
- origin: Wn(e.getVarint())
4553
+ scope: qn(e.getVarint()),
4554
+ origin: Hn(e.getVarint())
4321
4555
  };
4322
4556
  }
4323
- function Xi(e) {
4557
+ function ta(e) {
4324
4558
  return {
4325
4559
  requestId: e.getVarint(),
4326
4560
  endpointId: e.getString(),
4327
- reason: Ai(e.getVarint()),
4328
- origin: Wn(e.getVarint())
4561
+ reason: xi(e.getVarint()),
4562
+ origin: Hn(e.getVarint())
4329
4563
  };
4330
4564
  }
4331
- function Wi(e) {
4565
+ function na(e) {
4332
4566
  return {
4333
4567
  requestId: e.getVarint(),
4334
4568
  peerEndpointId: e.getString(),
4335
- state: _i(e.getVarint())
4569
+ state: Pi(e.getVarint())
4336
4570
  };
4337
4571
  }
4338
- function ji(e) {
4572
+ function sa(e) {
4339
4573
  const t = e.getVarint();
4340
4574
  let n;
4341
4575
  if (t === 0n)
@@ -4345,9 +4579,9 @@ function ji(e) {
4345
4579
  else
4346
4580
  throw new y(`MoqError.request_id present tag ${t} not in {0,1}`);
4347
4581
  const s = e.getVarint(), r = e.getString();
4348
- return { requestId: n, code: qi(s), rawCode: s, detail: r };
4582
+ return { requestId: n, code: ra(s), rawCode: s, detail: r };
4349
4583
  }
4350
- function qi(e) {
4584
+ function ra(e) {
4351
4585
  switch (e) {
4352
4586
  case 0x1001n:
4353
4587
  return "endpointNotProvisioned";
@@ -4375,7 +4609,7 @@ function qi(e) {
4375
4609
  return null;
4376
4610
  }
4377
4611
  }
4378
- const Hi = /* @__PURE__ */ new Set([
4612
+ const ia = /* @__PURE__ */ new Set([
4379
4613
  "sessionEnded",
4380
4614
  "tokenInvalid",
4381
4615
  "tokenExpired",
@@ -4384,7 +4618,7 @@ const Hi = /* @__PURE__ */ new Set([
4384
4618
  "endpointAlreadyConnected",
4385
4619
  "replayLost"
4386
4620
  ]);
4387
- class me {
4621
+ class be {
4388
4622
  constructor(t, n, s, r, i) {
4389
4623
  this.wt = t, this.controlWriter = n, this.controlReader = s, this.datagramWriter = r, this.datagramReader = i;
4390
4624
  }
@@ -4403,7 +4637,7 @@ class me {
4403
4637
  } catch {
4404
4638
  }
4405
4639
  const s = await n.createBidirectionalStream(), r = s.writable.getWriter(), i = s.readable.getReader(), a = n.datagrams.writable.getWriter(), o = n.datagrams.readable.getReader();
4406
- return new me(
4640
+ return new be(
4407
4641
  n,
4408
4642
  r,
4409
4643
  i,
@@ -4413,7 +4647,7 @@ class me {
4413
4647
  }
4414
4648
  /** Encode + write one control frame. Honours WT backpressure. */
4415
4649
  async sendControl(t) {
4416
- const n = bi(t);
4650
+ const n = Ai(t);
4417
4651
  await this.controlWriter.ready, await this.controlWriter.write(n);
4418
4652
  }
4419
4653
  /**
@@ -4425,7 +4659,7 @@ class me {
4425
4659
  let t = new Uint8Array(0);
4426
4660
  for (; ; ) {
4427
4661
  for (; ; ) {
4428
- const i = gi(t);
4662
+ const i = Ri(t);
4429
4663
  if (!i) break;
4430
4664
  yield i.msg, t = t.subarray(i.consumed);
4431
4665
  }
@@ -4500,8 +4734,8 @@ class me {
4500
4734
  }
4501
4735
  }
4502
4736
  }
4503
- const Zi = 2e3;
4504
- class Ji {
4737
+ const aa = 2e3;
4738
+ class oa {
4505
4739
  constructor(t) {
4506
4740
  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 = {
4507
4741
  wasmUrl: t.wasmUrl,
@@ -4711,7 +4945,7 @@ class Ji {
4711
4945
  const n = ++this.captureCommandId, s = new Promise((r, i) => {
4712
4946
  const a = setTimeout(() => {
4713
4947
  this.captureAcks.get(n)?.expected === t && (this.captureAcks.delete(n), i(new Error(`${t} acknowledgement timed out`)));
4714
- }, Zi);
4948
+ }, aa);
4715
4949
  this.captureAcks.set(n, { expected: t, resolve: r, reject: i, timeout: a });
4716
4950
  });
4717
4951
  return { commandId: n, ack: s };
@@ -4738,16 +4972,16 @@ class Ji {
4738
4972
  }
4739
4973
  }
4740
4974
  }
4741
- const Qt = [100, 250, 500, 1e3], zi = 1e4, Qi = 50;
4742
- function en(e, t) {
4975
+ const tn = [100, 250, 500, 1e3], ca = 1e4, ua = 50;
4976
+ function nn(e, t) {
4743
4977
  return new URL(t, e.endsWith("/") ? e : `${e}/`).href;
4744
4978
  }
4745
- const ea = new URL("./audio/wasm-gen/origon_web_audio_bg.wasm?no-inline", import.meta.url).href, ta = new URL("./audio/audio-processor.js?no-inline", import.meta.url).href;
4746
- class na {
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 {
4747
4981
  constructor(t, n) {
4748
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;
4749
- const s = n.assetBaseUrl ? en(n.assetBaseUrl, "audio/wasm-gen/origon_web_audio_bg.wasm") : ea, r = n.assetBaseUrl ? en(n.assetBaseUrl, "audio/audio-processor.js") : ta;
4750
- this.host = new Ji({
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({
4751
4985
  wasmUrl: s,
4752
4986
  processorUrl: r,
4753
4987
  onStats: (i) => this.handleHostStats(i),
@@ -4762,7 +4996,7 @@ class na {
4762
4996
  const n = this.startGeneration;
4763
4997
  this.assertStartActive(n), await this.host.start(), this.assertStartActive(n), this.host.onOutboundDatagram((s) => {
4764
4998
  this.diagTx += 1, this.diagTx === 1 || this.diagTx % 100;
4765
- const r = zt(ne.AudioObject, s);
4999
+ const r = en(ie.AudioObject, s);
4766
5000
  this.transport?.sendDatagram(r).catch(() => {
4767
5001
  });
4768
5002
  }), this.host.onDownlinkFeedback((s) => {
@@ -4772,7 +5006,7 @@ class na {
4772
5006
  if (r += 2, r + i > s.length) break;
4773
5007
  const a = s.subarray(r, r + i);
4774
5008
  r += i;
4775
- const o = zt(ne.AudioFeedback, a);
5009
+ const o = en(ie.AudioFeedback, a);
4776
5010
  this.transport?.sendDatagram(o).catch(() => {
4777
5011
  });
4778
5012
  }
@@ -4856,7 +5090,7 @@ class na {
4856
5090
  }
4857
5091
  // ── Connect handshake + read pumps ───────────────────────────────────
4858
5092
  async dial(t, n) {
4859
- const s = await me.open(this.url);
5093
+ const s = await be.open(this.url);
4860
5094
  if (!this.isStartActive(n))
4861
5095
  throw s.close({ closeCode: 0, reason: "session start cancelled" }), new Error("voice session start cancelled");
4862
5096
  this.transport = s, this.transport.startUniStreamDrain(), this.startReadLoops();
@@ -4903,19 +5137,19 @@ class na {
4903
5137
  for await (const n of t.readDatagrams()) {
4904
5138
  let s;
4905
5139
  try {
4906
- const r = pi(n);
4907
- if (r.cls === ne.AudioFeedback) {
5140
+ const r = ki(n);
5141
+ if (r.cls === ie.AudioFeedback) {
4908
5142
  this.host.pushUplinkFeedback(r.body);
4909
5143
  continue;
4910
5144
  }
4911
- if (r.cls !== ne.AudioObject)
5145
+ if (r.cls !== ie.AudioObject)
4912
5146
  continue;
4913
5147
  s = r.body;
4914
5148
  } catch {
4915
5149
  continue;
4916
5150
  }
4917
5151
  try {
4918
- const r = mi(s);
5152
+ const r = Si(s);
4919
5153
  this.diagRx += 1, this.diagRx === 1 || this.diagRx % 100;
4920
5154
  } catch {
4921
5155
  }
@@ -4936,7 +5170,7 @@ class na {
4936
5170
  }
4937
5171
  if ("requestId" in t.data) {
4938
5172
  const s = t.data.requestId;
4939
- s !== null && s !== 0n && (this.lastEventSeq = sa(this.lastEventSeq, s));
5173
+ s !== null && s !== 0n && (this.lastEventSeq = fa(this.lastEventSeq, s));
4940
5174
  }
4941
5175
  switch (t.type) {
4942
5176
  case "peerAttached": {
@@ -4969,10 +5203,10 @@ class na {
4969
5203
  }
4970
5204
  case "moqError": {
4971
5205
  const s = t.data.code;
4972
- if (s === null || Hi.has(s)) {
5206
+ if (s === null || ia.has(s)) {
4973
5207
  const i = s ?? "unknown";
4974
5208
  this.enterTerminalState(
4975
- s === null ? { kind: "protocolViolation" } : ra(s),
5209
+ s === null ? { kind: "protocolViolation" } : ma(s),
4976
5210
  new Error(`terminal MoqError ${i}`),
4977
5211
  `terminal MoqError ${i}`
4978
5212
  );
@@ -5005,20 +5239,20 @@ class na {
5005
5239
  if (this.rejectPendingRequestsForTransport(
5006
5240
  t,
5007
5241
  new Error("voice transport closed before control acknowledgement")
5008
- ), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await oe(Qi), this.terminalReason) {
5242
+ ), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await W(ua), this.terminalReason) {
5009
5243
  this.host.dispose().catch(() => {
5010
5244
  }), this.onTerminal(this.terminalReason, this.sessionId);
5011
5245
  return;
5012
5246
  }
5013
5247
  this.transport === t && (this.transport = null);
5014
- for (let r = 1; r <= Qt.length && this.isStartActive(n); r++) {
5015
- const i = Qt[r - 1];
5248
+ for (let r = 1; r <= tn.length && this.isStartActive(n); r++) {
5249
+ const i = tn[r - 1];
5016
5250
  this.dispatcher.fire("onReconnecting", this.sessionId, "voice", {
5017
5251
  attempt: r,
5018
5252
  reason: { kind: "networkLoss" }
5019
5253
  });
5020
5254
  try {
5021
- await oe(i), this.assertStartActive(n), await this.attemptResume(n), this.assertStartActive(n), this.dispatcher.fire("onReconnected", this.sessionId, "voice"), this.watchTransportClosed();
5255
+ await W(i), this.assertStartActive(n), await this.attemptResume(n), this.assertStartActive(n), this.dispatcher.fire("onReconnected", this.sessionId, "voice"), this.watchTransportClosed();
5022
5256
  return;
5023
5257
  } catch {
5024
5258
  if (this.terminalReason)
@@ -5030,7 +5264,7 @@ class na {
5030
5264
  }), this.onTerminal(s, this.sessionId);
5031
5265
  }
5032
5266
  async attemptResume(t) {
5033
- const n = await me.open(this.url);
5267
+ const n = await be.open(this.url);
5034
5268
  if (!this.isStartActive(t))
5035
5269
  throw n.close({ closeCode: 0, reason: "session reconnect cancelled" }), new Error("voice session start cancelled");
5036
5270
  this.transport = n, this.transport.startUniStreamDrain(), this.startReadLoops();
@@ -5116,7 +5350,7 @@ class na {
5116
5350
  }
5117
5351
  const a = setTimeout(() => {
5118
5352
  this.pendingRequests.delete(t) && r(new Error(`request ${t} timed out`));
5119
- }, zi);
5353
+ }, ca);
5120
5354
  this.pendingRequests.set(t, {
5121
5355
  transport: i,
5122
5356
  resolve: (o) => {
@@ -5141,7 +5375,7 @@ class na {
5141
5375
  /** Outbound datagram payload — for tests / external pumps. */
5142
5376
  encodeAudioObject(t) {
5143
5377
  if (this.uplinkAlias === null) throw new Error("uplink alias not negotiated");
5144
- return fi({
5378
+ return Ti({
5145
5379
  trackAlias: this.uplinkAlias,
5146
5380
  groupId: t.groupId,
5147
5381
  objectId: t.objectId,
@@ -5154,10 +5388,10 @@ class na {
5154
5388
  return this.currentMuteScope;
5155
5389
  }
5156
5390
  }
5157
- function sa(e, t) {
5391
+ function fa(e, t) {
5158
5392
  return e > t ? e : t;
5159
5393
  }
5160
- function ra(e) {
5394
+ function ma(e) {
5161
5395
  switch (e) {
5162
5396
  case "sessionEnded":
5163
5397
  return { kind: "sessionEnded" };
@@ -5183,17 +5417,20 @@ function ra(e) {
5183
5417
  return { kind: "replayLost" };
5184
5418
  }
5185
5419
  }
5186
- class ia {
5420
+ class pa {
5187
5421
  constructor() {
5188
- this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new Zn(), this.sessions = /* @__PURE__ */ new Map(), this.pendingUploads = /* @__PURE__ */ new Map();
5422
+ this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new Jn(), this.sessions = /* @__PURE__ */ new Map(), this.pendingUploads = /* @__PURE__ */ new Map();
5189
5423
  }
5190
5424
  // ── Lifecycle ────────────────────────────────────────────────────────
5191
5425
  initialize(t) {
5192
- if (!t.endpoint) throw f.missingField("endpoint");
5193
- this.attributes = t.attributes ? { ...t.attributes } : void 0, this.assetBaseUrl = t.assetBaseUrl, this.userId = t.userId ?? ii(), this.http = new Qr({
5426
+ if (!t.endpoint) throw h.missingField("endpoint");
5427
+ const n = t.attachmentBaseUrl === void 0 ? void 0 : Ea(t.endpoint, t.attachmentBaseUrl);
5428
+ if (n !== void 0 && !t.token)
5429
+ 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({
5194
5431
  endpoint: t.endpoint,
5195
5432
  ...t.token ? { token: t.token } : {}
5196
- }), this.sessionHttp = new ei(this.http, this.userId);
5433
+ }), this.sessionHttp = new ai(this.http, this.userId);
5197
5434
  }
5198
5435
  async authenticate() {
5199
5436
  const n = await this.requireSessionHttp().postConfig();
@@ -5228,8 +5465,8 @@ class ia {
5228
5465
  async startSession(t) {
5229
5466
  const n = this.requireSessionHttp();
5230
5467
  if (t.sessionId && this.sessions.has(t.sessionId))
5231
- throw f.other(`session already active: ${t.sessionId}`);
5232
- const s = aa(this.attributes, t.data), r = { channel: t.channel };
5468
+ throw h.other(`session already active: ${t.sessionId}`);
5469
+ const s = ba(this.attributes, t.data), r = { channel: t.channel };
5233
5470
  t.sessionId && (r.sessionId = t.sessionId), s && (r.data = s);
5234
5471
  const i = await n.startSession(r);
5235
5472
  return t.channel, await this.attachSession(i, t.channel), { sessionId: i.sessionId };
@@ -5244,13 +5481,22 @@ class ia {
5244
5481
  */
5245
5482
  async joinSession(t) {
5246
5483
  if (this.requireSessionHttp(), this.sessions.has(t.sessionId))
5247
- throw f.other(`session already active: ${t.sessionId}`);
5248
- const n = {
5484
+ throw h.other(`session already active: ${t.sessionId}`);
5485
+ if (t.channel === "voice" && t.chat !== void 0)
5486
+ throw h.other('chat join options require channel "chat"');
5487
+ if (t.channel === "chat" && t.voice !== void 0)
5488
+ throw h.other('voice join options require channel "voice"');
5489
+ const n = t.channel === "chat" ? ga(t.chat?.recovery) : void 0, s = {
5249
5490
  sessionId: t.sessionId,
5250
5491
  url: t.url,
5251
5492
  token: t.token
5252
5493
  };
5253
- return await this.attachSession(n, t.channel, t.voice?.receiveOnly ?? !1), { sessionId: t.sessionId };
5494
+ return await this.attachSession(
5495
+ s,
5496
+ t.channel,
5497
+ t.voice?.receiveOnly ?? !1,
5498
+ n
5499
+ ), { sessionId: t.sessionId };
5254
5500
  }
5255
5501
  /**
5256
5502
  * Shared core: construct the per-channel session from a
@@ -5262,50 +5508,51 @@ class ia {
5262
5508
  * after `start()`; voice fires it from inside `VoiceSession.dial()` once
5263
5509
  * the MoQ `ConnectOk` lands — so this method must NOT fire it for voice.
5264
5510
  */
5265
- async attachSession(t, n, s = !1) {
5511
+ async attachSession(t, n, s = !1, r) {
5266
5512
  if (n === "voice") {
5267
- const i = new na(t, {
5513
+ const a = new ha(t, {
5268
5514
  dispatcher: this.dispatcher,
5269
5515
  // `sessionId` is the session's *current* id (post-`rename()`), not the
5270
5516
  // one captured at construction — so a migrated session tears down its
5271
5517
  // real map entry instead of orphaning it.
5272
- onTerminal: (a, o) => {
5273
- this.sessions.delete(o), this.dispatcher.fire("onDisconnected", o, "voice", { reason: a });
5518
+ onTerminal: (o, l) => {
5519
+ this.sessions.delete(l), this.dispatcher.fire("onDisconnected", l, "voice", { reason: o });
5274
5520
  },
5275
5521
  assetBaseUrl: this.assetBaseUrl
5276
5522
  });
5277
- this.sessions.set(t.sessionId, { kind: "voice", session: i }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "voice");
5523
+ this.sessions.set(t.sessionId, { kind: "voice", session: a }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "voice");
5278
5524
  try {
5279
- await i.start({ receiveOnly: s });
5280
- } catch (a) {
5281
- for (const [o, l] of this.sessions)
5282
- if (l.session === i) {
5283
- this.sessions.delete(o);
5525
+ await a.start({ receiveOnly: s });
5526
+ } catch (o) {
5527
+ for (const [l, u] of this.sessions)
5528
+ if (u.session === a) {
5529
+ this.sessions.delete(l);
5284
5530
  break;
5285
5531
  }
5286
5532
  try {
5287
- await i.disconnect();
5288
- } catch (o) {
5289
- const l = a instanceof Error ? a : Object.assign(new Error("voice session start failed"), { startError: a });
5290
- throw Object.assign(l, { cleanupError: o });
5533
+ await a.disconnect();
5534
+ } catch (l) {
5535
+ const u = o instanceof Error ? o : Object.assign(new Error("voice session start failed"), { startError: o });
5536
+ throw Object.assign(u, { cleanupError: l });
5291
5537
  }
5292
- throw a;
5538
+ throw o;
5293
5539
  }
5294
5540
  return;
5295
5541
  }
5296
- const r = new zr(t, {
5542
+ const i = new ri(t, {
5297
5543
  sessionHttp: this.requireSessionHttp(),
5544
+ provisionedRecovery: r,
5298
5545
  dispatcher: this.dispatcher,
5299
5546
  // See the voice branch: teardown uses the session's current id.
5300
- onTerminal: (i, a) => {
5301
- this.sessions.delete(a), this.dispatcher.fire("onDisconnected", a, "chat", { reason: i });
5547
+ onTerminal: (a, o) => {
5548
+ this.sessions.delete(o), this.dispatcher.fire("onDisconnected", o, "chat", { reason: a });
5302
5549
  }
5303
5550
  });
5304
- this.sessions.set(t.sessionId, { kind: "chat", session: r }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "chat"), await r.start(), this.dispatcher.fire("onConnected", t.sessionId, "chat");
5551
+ this.sessions.set(t.sessionId, { kind: "chat", session: i }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "chat"), await i.start(), this.dispatcher.fire("onConnected", t.sessionId, "chat");
5305
5552
  }
5306
5553
  async endSession(t) {
5307
5554
  const n = this.sessions.get(t);
5308
- if (!n) throw f.noSession(t);
5555
+ if (!n) throw h.noSession(t);
5309
5556
  await n.session.disconnect();
5310
5557
  }
5311
5558
  async endAllSessions() {
@@ -5336,8 +5583,8 @@ class ia {
5336
5583
  sendMessage(t, n) {
5337
5584
  return this.requireChatSession(t).sendMessage(n);
5338
5585
  }
5339
- notifyTyping(t) {
5340
- this.requireChatSession(t).notifyTyping();
5586
+ notifyTyping(t, n) {
5587
+ this.requireChatSession(t).notifyTyping(n);
5341
5588
  }
5342
5589
  stopTyping(t) {
5343
5590
  this.requireChatSession(t).stopTyping();
@@ -5371,32 +5618,33 @@ class ia {
5371
5618
  }
5372
5619
  // ── Attachments ──────────────────────────────────────────────────────
5373
5620
  /**
5374
- * Upload an attachment. WIDGET-scoped and session-less: the URL is built
5375
- * from the `endpoint` given to `initialize()`, so an attachment can be the
5376
- * first thing a visitor sends — no session is opened, and none is required.
5621
+ * Upload an attachment. It remains session-less: widget callers use the
5622
+ * tokenless endpoint lane, while an explicit same-origin attachmentBaseUrl
5623
+ * selects the authenticated agent lane and uses the top-level token.
5377
5624
  * Needs `authenticate()` only for the local policy precheck (absent config
5378
5625
  * defers the whole decision to the server).
5379
5626
  */
5380
5627
  async uploadAttachment(t, n) {
5381
- const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = si(t, r);
5628
+ const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = fi(t, r);
5382
5629
  if (!i.ok) throw i.error;
5383
5630
  const a = new AbortController();
5384
5631
  this.pendingUploads.set(n.uploadId, a);
5385
5632
  try {
5386
- const o = oa(a.signal, n.signal);
5387
- return await ni(s.buildAbsoluteUrl("/attachment/upload"), t, {
5388
- ...n,
5389
- signal: o
5390
- });
5633
+ const o = wa(a.signal, n.signal), l = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
5634
+ return await ui(
5635
+ `${l}/upload`,
5636
+ t,
5637
+ { ...n, signal: o },
5638
+ this.attachmentBearer
5639
+ );
5391
5640
  } finally {
5392
5641
  this.pendingUploads.delete(n.uploadId);
5393
5642
  }
5394
5643
  }
5395
5644
  /**
5396
5645
  * Dual purpose: cancel an in-flight upload (when `idOrUploadId` matches a
5397
- * pending `uploadId`) OR DELETE a stored attachment by id. Widget-scoped and
5398
- * session-less on both arms, so a visitor can remove a file they attached
5399
- * before sending anything.
5646
+ * pending `uploadId`) OR DELETE a stored attachment by id. The route/auth
5647
+ * lane matches upload: explicit base is authenticated; widget is tokenless.
5400
5648
  */
5401
5649
  async deleteAttachment(t) {
5402
5650
  const n = this.pendingUploads.get(t);
@@ -5404,62 +5652,119 @@ class ia {
5404
5652
  n.abort(), this.pendingUploads.delete(t);
5405
5653
  return;
5406
5654
  }
5407
- const s = this.requireHttp();
5655
+ const s = this.requireHttp(), r = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
5408
5656
  await s.deleteAbsolute(
5409
- s.buildAbsoluteUrl(`/attachment/${encodeURIComponent(t)}`),
5410
- // Tokenless route — suppress the default bearer rather than send a
5411
- // credential the server does not read (CONTRACT.md § Outbound couplings).
5412
- { bearer: "" }
5657
+ `${r}/${encodeURIComponent(t)}`,
5658
+ // Explicit base opts into the existing top-level bearer. The widget
5659
+ // lane always suppresses it, even when initialize received a token.
5660
+ { bearer: this.attachmentBaseUrl === void 0 ? "" : this.attachmentBearer ?? "" }
5413
5661
  );
5414
5662
  }
5415
5663
  // ── Internal ─────────────────────────────────────────────────────────
5416
5664
  requireChatSession(t) {
5417
5665
  const n = this.sessions.get(t);
5418
- if (!n) throw f.noSession(t);
5666
+ if (!n) throw h.noSession(t);
5419
5667
  if (n.kind !== "chat")
5420
- throw f.other(`session ${t} is a voice session, not chat`);
5668
+ throw h.other(`session ${t} is a voice session, not chat`);
5421
5669
  return n.session;
5422
5670
  }
5423
5671
  requireVoiceSession(t) {
5424
5672
  const n = this.sessions.get(t);
5425
- if (!n) throw f.noSession(t);
5673
+ if (!n) throw h.noSession(t);
5426
5674
  if (n.kind !== "voice")
5427
- throw f.other(`session ${t} is a chat session, not voice`);
5675
+ throw h.other(`session ${t} is a chat session, not voice`);
5428
5676
  return n.session;
5429
5677
  }
5430
5678
  requireSessionHttp() {
5431
- if (!this.sessionHttp) throw f.notInitialized();
5679
+ if (!this.sessionHttp) throw h.notInitialized();
5432
5680
  return this.sessionHttp;
5433
5681
  }
5434
5682
  requireHttp() {
5435
- if (!this.http) throw f.notInitialized();
5683
+ if (!this.http) throw h.notInitialized();
5436
5684
  return this.http;
5437
5685
  }
5438
5686
  }
5439
- let Re = null;
5440
- function ca() {
5441
- return Re || (Re = new ia()), Re;
5687
+ let Oe = null;
5688
+ function Ia() {
5689
+ return Oe || (Oe = new pa()), Oe;
5442
5690
  }
5443
- function aa(e, t) {
5691
+ function ba(e, t) {
5444
5692
  if (!(!e && !t))
5445
5693
  return e ? t ? { ...t, attributes: { ...e, ...t.attributes } } : { attributes: e } : t;
5446
5694
  }
5447
- function oa(e, t) {
5695
+ function ga(e) {
5696
+ if (e !== void 0) {
5697
+ if (e.replay !== "server")
5698
+ throw h.other('provisioned chat recovery requires replay "server"');
5699
+ if (e.delaysMs.length < 1 || e.delaysMs.length > 8 || e.delaysMs.some((t) => !Number.isFinite(t) || t < 0))
5700
+ throw h.other(
5701
+ "provisioned chat recovery delaysMs must contain 1–8 finite, non-negative values"
5702
+ );
5703
+ return { ...e, delaysMs: [...e.delaysMs] };
5704
+ }
5705
+ }
5706
+ function Ea(e, t) {
5707
+ let n, s;
5708
+ try {
5709
+ n = new URL(e), s = new URL(t, n);
5710
+ } catch {
5711
+ throw h.other("invalid attachmentBaseUrl");
5712
+ }
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 === "/")
5714
+ throw h.other("attachmentBaseUrl must be an HTTP(S) path on the endpoint origin");
5715
+ return s.toString().replace(/\/$/, "");
5716
+ }
5717
+ function ya(e) {
5718
+ let t = e;
5719
+ for (let r = e.length + 1; r > 0; r -= 1) {
5720
+ if (t.includes("\\")) return !0;
5721
+ let i;
5722
+ try {
5723
+ i = decodeURIComponent(t);
5724
+ } catch {
5725
+ return !0;
5726
+ }
5727
+ if (i === t) break;
5728
+ t = i;
5729
+ }
5730
+ let n;
5731
+ if (e.startsWith("/"))
5732
+ n = e.split(/[?#]/, 1)[0];
5733
+ else {
5734
+ const r = e.indexOf("://") + 3, i = e.indexOf("/", r);
5735
+ n = i === -1 ? "/" : e.slice(i).split(/[?#]/, 1)[0];
5736
+ }
5737
+ let s = n;
5738
+ for (let r = e.length + 1; r > 0; r -= 1) {
5739
+ if (s.includes("\\") || s.split("/").some((a) => a === "." || a === ".."))
5740
+ return !0;
5741
+ let i;
5742
+ try {
5743
+ i = decodeURIComponent(s);
5744
+ } catch {
5745
+ return !0;
5746
+ }
5747
+ if (i === s) return !1;
5748
+ s = i;
5749
+ }
5750
+ return !0;
5751
+ }
5752
+ function wa(e, t) {
5448
5753
  if (!t) return e;
5449
5754
  const n = new AbortController(), s = () => n.abort();
5450
5755
  return e.aborted || t.aborted ? (n.abort(), n.signal) : (e.addEventListener("abort", s, { once: !0 }), t.addEventListener("abort", s, { once: !0 }), n.signal);
5451
5756
  }
5452
- const ua = {
5757
+ const Na = {
5453
5758
  AI: "ai",
5454
5759
  EXTERNAL: "external",
5455
5760
  USER: "user",
5456
5761
  SYSTEM: "system"
5457
5762
  };
5458
5763
  export {
5459
- f as ClientError,
5460
- ua as MESSAGE_ROLES,
5461
- k as OrpcError,
5462
- ia as SessionManager,
5463
- ca as getSessionManager
5764
+ h as ClientError,
5765
+ Na as MESSAGE_ROLES,
5766
+ T as OrpcError,
5767
+ pa as SessionManager,
5768
+ Ia as getSessionManager
5464
5769
  };
5465
5770
  //# sourceMappingURL=origon-web-sdk.js.map