@origonai/web-sdk 0.1.0 → 0.1.1

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 Qn {
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 nn(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, sn = 1048576, L = {
58
58
  REQUEST: 1,
59
59
  DATA: 2,
60
60
  ERROR: 3,
61
61
  CANCEL: 4
62
- }, sn = 0;
62
+ }, rn = 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 an 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} > ${sn}`), this.name = "OrpcFrameTooLargeError", this.declaredLength = t;
71
71
  }
72
72
  }
73
- const Ee = new TextEncoder(), an = new TextDecoder("utf-8", { fatal: !0 });
73
+ const we = new TextEncoder(), on = new TextDecoder("utf-8", { fatal: !0 });
74
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)]
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++] = rn, 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 es(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 cn() {
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 ts(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 > sn) throw new an(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 ns(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 } = ss(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 = on.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 ss(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 = on.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 !== rn)
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 it(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 at(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 rs(e, t) {
191
+ let n = it(e), s, r = !1;
192
192
  try {
193
- s = await it(n);
193
+ s = await at(n);
194
194
  } catch {
195
- ae(e, n), r = !0, n = rt(e), s = await it(n);
195
+ ue(e, n), r = !0, n = it(e), s = await at(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 ot(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) => ot(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 ot(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 ct {
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 = ts(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), ns(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
+ }, is = "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 as(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 os(e) {
297
+ if (!as(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 ? is : `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 un(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 cs = {
309
309
  event() {
310
310
  }
311
- }, os = [];
312
- function cs() {
313
- return os.slice();
311
+ }, us = [];
312
+ function ls() {
313
+ return us.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 = ls);
316
+ function ds(e, t, n = {}) {
317
+ const s = n.logger ?? cs, r = n.transport ?? rs, 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 = Jn(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 ct(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 st;
344
344
  try {
345
- nt = await p.readFrame();
346
- } catch (_) {
347
- throw await O(E, p, _), M(E, _);
345
+ st = 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 (st !== 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 rt = await x;
364
+ if (rt) throw rt;
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 ct(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 ln(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 hs(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 hs {
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(es(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 (fs(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 = un(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), ln(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(cn()), 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 an ? B.MESSAGE_TOO_LARGE : B.INVALID_ARGUMENT, r = un(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(cn()), 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 ln(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), os(t);
534
534
  }
535
- function ds(e) {
535
+ function fs(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 dn() {
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 ms() {
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 ut(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 ? fn(s, r) : Ge(s, r);
605
605
  }
606
- function fs(e, t) {
607
- let n = Pe(e, t);
606
+ function ps(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 = fn(n.lo, n.hi));
610
+ const r = hn(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 hn(e, t) {
614
+ if ({ lo: e, hi: t } = bs(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() + lt(a) + lt(i);
620
620
  }
621
- function ms(e, t) {
621
+ function bs(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 fn(e, t) {
628
+ return t = ~t, e ? e = ~e + 1 : t += 1, Ge(e, t);
629
629
  }
630
- const ut = (e) => {
630
+ const lt = (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 gs() {
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__ */ Es();
663
+ function Es() {
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()), dt(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()), ht(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()), dt(n), ut(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()), ht(n), ut(n);
716
716
  },
717
717
  dec(n, s) {
718
- return fs(n, s);
718
+ return ps(n, s);
719
719
  },
720
720
  uDec(n, s) {
721
- return dn(n, s);
721
+ return hn(n, s);
722
722
  }
723
723
  };
724
724
  }
725
- function lt(e) {
725
+ function dt(e) {
726
726
  if (!/^-?[0-9]+$/.test(e))
727
727
  throw new Error("invalid int64: " + e);
728
728
  }
729
- function dt(e) {
729
+ function ht(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 ys(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 mn = 2, M = Symbol.for("reflect unsafe local");
770
+ function pn(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 ws(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 != mn)
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 !ys(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 bn(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 gn(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 Is(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 != mn)
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 Ns(e) {
860
+ return yn(e.$typeName);
861
861
  }
862
- function gn(e) {
862
+ function En(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 yn(e.typeName) && t !== void 0 && t.fieldKind == "scalar" && t.name == "value" && t.number == 1;
865
865
  }
866
- function En(e) {
866
+ function yn(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 Ts = 999, Ss = 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 = vs(e);
884
+ return t !== void 0 && ks(e, n, t), n;
885
885
  }
886
- function Ts(e, t, n) {
886
+ function ks(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 = pn(n, s);
894
894
  if (!a)
895
895
  continue;
896
- i = a, r = pn(n, a);
896
+ i = a, r = bn(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 = wn(i, r);
905
905
  break;
906
906
  case "list":
907
- r = ks(i, r);
907
+ r = Rs(i, r);
908
908
  break;
909
909
  case "map":
910
- r = Ss(i, r);
910
+ r = As(i, r);
911
911
  break;
912
912
  }
913
- bn(t, i, r);
913
+ gn(t, i, r);
914
914
  }
915
915
  return t;
916
916
  }
917
- function yn(e, t) {
917
+ function wn(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 As(e, t) {
921
+ if (P(t)) {
922
922
  if (e.scalar == c.BYTES)
923
- return ht(t, Ke);
923
+ return ft(t, Ke);
924
924
  if (e.mapKind == "message")
925
- return ht(t, (n) => $e(e, n));
925
+ return ft(t, (n) => Xe(e, n));
926
926
  }
927
927
  return t;
928
928
  }
929
- function ks(e, t) {
929
+ function Rs(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 && En(e.message))
940
+ return wn(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 ft(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 _s = Symbol(), mt = /* @__PURE__ */ new WeakMap();
959
+ function vs(e) {
960
960
  let t;
961
961
  if (Os(e)) {
962
- const n = ft.get(e);
962
+ const n = mt.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
+ mt.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
984
  function Os(e) {
985
985
  switch (e.file.edition) {
986
- case Ns:
986
+ case Ts:
987
987
  return !1;
988
- case Is:
988
+ case Ss:
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 _s;
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 In = 34028234663852886e22, Nn = -34028234663852886e22, Tn = 4294967295, Sn = 2147483647, kn = -2147483648;
1039
+ class Cs {
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 (pt(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
+ Us(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
+ pt(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 Ds {
1198
+ constructor(t, n = We().decodeUtf8) {
1199
+ this.decodeUtf8 = n, this.varint64 = ms, this.uint32 = gs, 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 > Sn || e < kn)
1360
1360
  throw new Error("invalid int32: " + e);
1361
1361
  }
1362
- function mt(e) {
1362
+ function pt(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 > Tn || e < 0)
1368
1368
  throw new Error("invalid uint32: " + e);
1369
1369
  }
1370
- function vs(e) {
1370
+ function Us(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 > In || e < Nn))
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 Ls(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 ${Rn(e)}, got ${de(t)}`;
1388
1388
  break;
1389
1389
  case "map":
1390
- s = `expected ${_n(e)}, got ${ue(t)}`;
1390
+ s = `expected ${_n(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 bt(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 Ms(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 > In || e < Nn ? `${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 > Sn || e < kn ? `${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 > Tn || 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 ${xs(e.scalar)}` + n : e.enum !== void 0 ? `expected ${e.enum.toString()}` + n : `expected ${An(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) ? Rn(e.field()) : Ye(e) ? _n(e.field()) : $e(e) ? An(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 An(e) {
1473
1473
  return `ReflectMessage (${e.typeName})`;
1474
1474
  }
1475
- function An(e) {
1475
+ function Rn(e) {
1476
1476
  switch (e.listKind) {
1477
1477
  case "message":
1478
1478
  return `ReflectList (${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 xs(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) {
1525
- return new On(e, t, n);
1523
+ const Ps = 0;
1524
+ function ge(e, t, n = !0) {
1525
+ return new vn(e, t, n);
1526
1526
  }
1527
- const bt = /* @__PURE__ */ new WeakMap();
1528
- class On {
1527
+ const gt = /* @__PURE__ */ new WeakMap();
1528
+ class vn {
1529
1529
  get sortedFields() {
1530
- const t = bt.get(this.desc);
1530
+ const t = gt.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 gt.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), pn(this.message, t);
1544
1544
  }
1545
1545
  isSet(t) {
1546
- return $(this.message, t), Es(this.message, t);
1546
+ return K(this.message, t), ws(this.message, t);
1547
1547
  }
1548
1548
  clear(t) {
1549
- $(this.message, t), ys(this.message, t);
1549
+ K(this.message, t), Is(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 = bn(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 Vs(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 Fs(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 = Ls(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), gn(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 Vs {
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 = bt(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] = Et(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 = bt(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(Et(this._field, t));
1628
1628
  }
1629
1629
  clear() {
1630
1630
  this._arr.splice(0, this._arr.length);
@@ -1637,27 +1637,27 @@ 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 Fs {
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 = Ms(this._field, t, n);
1657
1657
  if (s)
1658
1658
  throw s;
1659
1659
  }
1660
- return this.obj[J(t)] = Bs(this._field, n), this;
1660
+ return this.obj[J(t)] = Gs(this._field, n), this;
1661
1661
  }
1662
1662
  delete(t) {
1663
1663
  const n = J(t), s = Object.prototype.hasOwnProperty.call(this.obj, n);
@@ -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 yt(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
+ yt(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) ? Ns(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;
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 && (En(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 = On(t))), new vn(e.message, t, n);
1711
1711
  }
1712
- function gt(e, t) {
1713
- return e.listKind == "message" ? je(e, t) : Ze(e, t);
1712
+ function Et(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
- function Bs(e, t) {
1719
- return e.mapKind == "message" ? je(e, t) : Ze(e, t);
1718
+ function Gs(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 yt(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 On(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] = Un(s);
1801
1801
  return t;
1802
1802
  }
1803
1803
  function Cn(e) {
1804
1804
  const t = {};
1805
1805
  for (const [n, s] of Object.entries(e.fields))
1806
- t[n] = vn(s);
1806
+ t[n] = Dn(s);
1807
1807
  return t;
1808
1808
  }
1809
- function vn(e) {
1809
+ function Dn(e) {
1810
1810
  switch (e.kind.case) {
1811
1811
  case "structValue":
1812
1812
  return Cn(e.kind.value);
1813
1813
  case "listValue":
1814
- return e.kind.value.values.map(vn);
1814
+ return e.kind.value.values.map(Dn);
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 Un(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: Ps };
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(Un(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: On(e)
1856
1856
  };
1857
1857
  break;
1858
1858
  }
1859
1859
  return t;
1860
1860
  }
1861
- function Ps(e) {
1862
- const t = Gs();
1861
+ function Bs(e) {
1862
+ const t = $s();
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 Ys(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 $s() {
1907
+ if (!G) {
1908
+ G = [];
1909
+ const e = Ys();
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 Xs = /* @__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 Xs.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 Ks(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 Ws(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 = js(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 js(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
2112
  function Ln(...e) {
2113
- const t = Ws();
2113
+ const t = qs();
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
+ Tt(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
+ Tt(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 qs() {
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 Hs = 998, Zs = 999, zs = 9999, Qs = 9, z = 10, j = 11, Js = 12, wt = 14, Je = 3, er = 2, It = 1, tr = 0, _e = 1, Nt = 2, nr = 3, sr = 1, rr = 2, ir = 1, ar = 2, or = 1001, Mn = {
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 Tt(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: dr(e),
2287
2287
  name: e.name.replace(/\.proto$/, ""),
2288
- dependencies: lr(e, t),
2288
+ dependencies: hr(e, t),
2289
2289
  enums: [],
2290
2290
  messages: [],
2291
2291
  extensions: [],
@@ -2305,14 +2305,14 @@ function It(e, t) {
2305
2305
  for (const o of e.enumType)
2306
2306
  xn(o, r, void 0, t);
2307
2307
  for (const o of e.messageType)
2308
- Mn(o, r, void 0, t, a);
2308
+ Pn(o, r, void 0, t, a);
2309
2309
  for (const o of e.service)
2310
- ar(o, r, t);
2310
+ cr(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) => lr(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 = pr(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
2347
  function xn(e, t, n, s) {
2348
2348
  var r, i, a, o, l;
2349
- const u = dr(e.name, e.value), d = {
2349
+ const u = fr(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 = yr(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 Pn(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: [],
@@ -2408,9 +2408,9 @@ function Mn(e, t, n, s, r) {
2408
2408
  for (const d of e.enumType)
2409
2409
  xn(d, t, u, s);
2410
2410
  for (const d of e.nestedType)
2411
- Mn(d, t, u, s, r);
2411
+ Pn(d, t, u, s, r);
2412
2412
  }
2413
- function ar(e, t, n) {
2413
+ function cr(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 = ur(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 ur(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 : tr,
2452
2452
  toString() {
2453
2453
  return `rpc ${t.typeName}.${d}`;
2454
2454
  }
2455
2455
  };
2456
2456
  }
2457
- function cr(e, t) {
2457
+ function lr(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: br(e, s, l, t),
2483
+ utf8Validation: wr(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 } = Er(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 = St(e, t);
2513
2513
  break;
2514
- case yt:
2515
- u.listKind = "enum", u.enum = n.getEnum(R(e.typeName)), A(u.enum);
2514
+ case wt:
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 == It;
2519
2519
  break;
2520
2520
  }
2521
- return u.packed = pr(e, t), u;
2521
+ return u.packed = gr(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 = St(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 wt: {
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") ? Ks(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 == It, u.getDefaultValue = () => H(e, "defaultValue") ? Ws(f, e.defaultValue) : void 0;
2536
2536
  break;
2537
2537
  }
2538
2538
  }
2539
2539
  return u;
2540
2540
  }
2541
- function ur(e) {
2541
+ function dr(e) {
2542
2542
  switch (e.syntax) {
2543
2543
  case "":
2544
2544
  case "proto2":
2545
- return js;
2545
+ return Hs;
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 === zs)
2550
+ return or;
2551
+ if (e.edition in Mn)
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 hr(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 fr(e, t) {
2567
+ const n = mr(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 mr(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 pr(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)
2593
+ function br(e, t, n, s) {
2594
+ if (e.label == er)
2595
+ return nr;
2596
+ if (e.label == Je)
2597
2597
  return Nt;
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 == Nt && (e.type == j || e.type == z) ? _e : r;
2602
2602
  }
2603
- function pr(e, t) {
2604
- if (e.label != ze)
2603
+ function gr(e, t) {
2604
+ if (e.label != Je)
2605
2605
  return !1;
2606
2606
  switch (e.type) {
2607
- case Zs:
2607
+ case Qs:
2608
2608
  case Js:
2609
- case q:
2610
- case K:
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 : sr == F("repeatedFieldEncoding", {
2615
2615
  proto: e,
2616
2616
  parent: t
2617
2617
  });
2618
2618
  }
2619
- function br(e) {
2619
+ function Er(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 yr(e) {
2624
2624
  var t;
2625
- return sr == V("enumType", {
2625
+ return ir == 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 St(e, t) {
2631
+ return e.type == z ? !0 : rr == 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 wr(e, t) {
2637
+ return ar == 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,28 +2649,28 @@ 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 = Mn[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 Ir(e) {
2665
+ const t = Nr(e);
2666
+ return t.messageType.forEach(Qe), Ln(t, () => {
2667
2667
  }).getFile(t.name);
2668
2668
  }
2669
- function wr(e) {
2669
+ function Nr(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(Vn), enumType: e.enumType.map(Fn) }));
2674
2674
  }
2675
2675
  function Vn(e) {
2676
2676
  var t, n, s, r, i, a, o, l;
@@ -2679,17 +2679,17 @@ function Vn(e) {
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(Tr)) !== null && n !== void 0 ? n : [],
2683
2683
  extension: [],
2684
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 : [],
2685
+ enumType: (a = (i = e.enumType) === null || i === void 0 ? void 0 : i.map(Fn)) !== 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 Tr(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 ? Sr(e.options) : void 0 }));
2702
2702
  }
2703
- function Ir(e) {
2703
+ function Sr(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 Fn(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;
2733
- (function(e) {
2734
- e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
2735
- })(St || (St = {}));
2731
+ const kr = /* @__PURE__ */ Ir({ 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 }] }] }), Ar = /* @__PURE__ */ R(kr, 1);
2736
2732
  var kt;
2737
2733
  (function(e) {
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";
2734
+ e[e.DECLARATION = 0] = "DECLARATION", e[e.UNVERIFIED = 1] = "UNVERIFIED";
2739
2735
  })(kt || (kt = {}));
2740
2736
  var At;
2741
2737
  (function(e) {
2742
- e[e.OPTIONAL = 1] = "OPTIONAL", e[e.REPEATED = 3] = "REPEATED", e[e.REQUIRED = 2] = "REQUIRED";
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";
2743
2739
  })(At || (At = {}));
2740
+ var Rt;
2741
+ (function(e) {
2742
+ e[e.OPTIONAL = 1] = "OPTIONAL", e[e.REPEATED = 3] = "REPEATED", e[e.REQUIRED = 2] = "REQUIRED";
2743
+ })(Rt || (Rt = {}));
2744
2744
  var _t;
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
2747
  })(_t || (_t = {}));
2748
- var Ot;
2748
+ var vt;
2749
2749
  (function(e) {
2750
2750
  e[e.STRING = 0] = "STRING", e[e.CORD = 1] = "CORD", e[e.STRING_PIECE = 2] = "STRING_PIECE";
2751
- })(Ot || (Ot = {}));
2752
- var Rt;
2751
+ })(vt || (vt = {}));
2752
+ var Ot;
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 = {}));
2755
+ })(Ot || (Ot = {}));
2756
2756
  var Ct;
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
2759
  })(Ct || (Ct = {}));
2760
- var vt;
2760
+ var Dt;
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
+ })(Dt || (Dt = {}));
2764
+ var Ut;
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 = {}));
2767
+ })(Ut || (Ut = {}));
2768
2768
  var Lt;
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
2771
  })(Lt || (Lt = {}));
2772
- var Ut;
2772
+ var Mt;
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 = {}));
2775
+ })(Mt || (Mt = {}));
2776
2776
  var xt;
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
2779
  })(xt || (xt = {}));
2780
- var Mt;
2780
+ var Pt;
2781
2781
  (function(e) {
2782
2782
  e[e.REPEATED_FIELD_ENCODING_UNKNOWN = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN", e[e.PACKED = 1] = "PACKED", e[e.EXPANDED = 2] = "EXPANDED";
2783
- })(Mt || (Mt = {}));
2783
+ })(Pt || (Pt = {}));
2784
2784
  var Vt;
2785
2785
  (function(e) {
2786
2786
  e[e.UTF8_VALIDATION_UNKNOWN = 0] = "UTF8_VALIDATION_UNKNOWN", e[e.VERIFY = 2] = "VERIFY", e[e.NONE = 3] = "NONE";
2787
2787
  })(Vt || (Vt = {}));
2788
- var Bt;
2789
- (function(e) {
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;
2793
- (function(e) {
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
2788
  var Ft;
2797
2789
  (function(e) {
2798
- e[e.ENFORCE_NAMING_STYLE_UNKNOWN = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN", e[e.STYLE2024 = 1] = "STYLE2024", e[e.STYLE_LEGACY = 2] = "STYLE_LEGACY";
2790
+ e[e.MESSAGE_ENCODING_UNKNOWN = 0] = "MESSAGE_ENCODING_UNKNOWN", e[e.LENGTH_PREFIXED = 1] = "LENGTH_PREFIXED", e[e.DELIMITED = 2] = "DELIMITED";
2799
2791
  })(Ft || (Ft = {}));
2800
2792
  var Gt;
2801
2793
  (function(e) {
2802
- e[e.NONE = 0] = "NONE", e[e.SET = 1] = "SET", e[e.ALIAS = 2] = "ALIAS";
2794
+ e[e.JSON_FORMAT_UNKNOWN = 0] = "JSON_FORMAT_UNKNOWN", e[e.ALLOW = 1] = "ALLOW", e[e.LEGACY_BEST_EFFORT = 2] = "LEGACY_BEST_EFFORT";
2803
2795
  })(Gt || (Gt = {}));
2796
+ var Bt;
2797
+ (function(e) {
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
+ })(Bt || (Bt = {}));
2804
2800
  var Yt;
2805
2801
  (function(e) {
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";
2802
+ e[e.NONE = 0] = "NONE", e[e.SET = 1] = "SET", e[e.ALIAS = 2] = "ALIAS";
2807
2803
  })(Yt || (Yt = {}));
2808
2804
  var $t;
2809
2805
  (function(e) {
2810
- e[e.VISIBILITY_UNSET = 0] = "VISIBILITY_UNSET", e[e.VISIBILITY_LOCAL = 1] = "VISIBILITY_LOCAL", e[e.VISIBILITY_EXPORT = 2] = "VISIBILITY_EXPORT";
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";
2811
2807
  })($t || ($t = {}));
2812
- function kr(e) {
2808
+ var Xt;
2809
+ (function(e) {
2810
+ e[e.VISIBILITY_UNSET = 0] = "VISIBILITY_UNSET", e[e.VISIBILITY_LOCAL = 1] = "VISIBILITY_LOCAL", e[e.VISIBILITY_EXPORT = 2] = "VISIBILITY_EXPORT";
2811
+ })(Xt || (Xt = {}));
2812
+ function Rr(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 Gn(s, new Ds(t), Rr(n), !1, t.byteLength), s.message;
2818
2818
  }
2819
- function Pn(e, t, n, s, r) {
2819
+ function Gn(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
+ _r(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 _r(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
2866
  Or(t, s, e.get(n), r);
2867
2867
  break;
2868
2868
  case "map":
2869
- _r(t, e.get(n), r);
2869
+ vr(t, e.get(n), r);
2870
2870
  break;
2871
2871
  }
2872
2872
  }
2873
- function _r(e, t, n) {
2873
+ function vr(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,33 +2878,33 @@ 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);
@@ -2913,23 +2913,23 @@ function Or(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 Gn(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 Cr(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(Ar, Bs(e));
2969
+ return s.messageType.forEach(Qe), s.dependency = (n = void 0) !== null && n !== void 0 ? n : [], Ln(s, (i) => {
2970
2970
  }).getFile(s.name);
2971
2971
  }
2972
- const Cr = 3, Kt = {
2972
+ const Dr = 3, Kt = {
2973
2973
  writeUnknownFields: !0
2974
2974
  };
2975
- function vr(e) {
2975
+ function Ur(e) {
2976
2976
  return e ? Object.assign(Object.assign({}, Kt), e) : Kt;
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 Cs(), Ur(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 == Dr)
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
+ Lr(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 Lr(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
+ Mr(e, t, s, n.get(s));
3005
3005
  break;
3006
3006
  case "message":
3007
- Fn(e, t, s, n.get(s));
3007
+ Bn(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
+ xr(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
+ Yn(e.tag(r, Pr(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 Bn(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 Mr(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
+ Bn(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
+ Yn(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 xr(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 Yn(e, t, n, s, r) {
3055
3055
  try {
3056
3056
  switch (s) {
3057
3057
  case c.STRING:
@@ -3104,80 +3104,102 @@ 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 Pr(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 Vr(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__ */ Cr("CgpjaGF0LnByb3RvEgdjaGF0LnYxIkkKCkF0dGFjaG1lbnQSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRIUCgxjb250ZW50X3R5cGUYAyABKAkSCwoDdXJsGAQgASgJIkEKBkJ1dHRvbhINCgVsYWJlbBgBIAEoCRINCgV2YWx1ZRgCIAEoCRIZCgtidXR0b25fdHlwZRgDIAEoCVIEdHlwZSJ/CgRDYXJkEg0KBXRpdGxlGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEicKBWltYWdlGAMgASgLMhMuY2hhdC52MS5BdHRhY2htZW50SACIAQESIAoHYnV0dG9ucxgEIAMoCzIPLmNoYXQudjEuQnV0dG9uQggKBl9pbWFnZSIjCg9NZXNzYWdlTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAkiIgoOVHlwaW5nTWV0YWRhdGESEAoIYXVkaWVuY2UYASABKAki7QIKB01lc3NhZ2USCgoCaWQYASABKAkSDAoEcm9sZRgCIAEoCRIRCgR0ZXh0GAMgASgJSACIAQESEQoEaHRtbBgEIAEoCUgBiAEBEigKC2F0dGFjaG1lbnRzGAUgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EiAKB2J1dHRvbnMYBiADKAsyDy5jaGF0LnYxLkJ1dHRvbhIeCgdnYWxsZXJ5GAcgAygLMg0uY2hhdC52MS5DYXJkEhEKCXRpbWVzdGFtcBgIIAEoCRIYCgd1c2VyX2lkGAkgASgJUgd1c2VyX2lkEhwKCXVzZXJfbmFtZRgKIAEoCVIJdXNlcl9uYW1lEg0KBXN0YXRlGAsgASgJEhMKBmFjdGlvbhgMIAEoCUgCiAEBEioKCG1ldGFkYXRhGA0gASgLMhguY2hhdC52MS5NZXNzYWdlTWV0YWRhdGFCBwoFX3RleHRCBwoFX2h0bWxCCQoHX2FjdGlvbiKRAQoLVHlwaW5nRXZlbnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDQoFc3RhdGUYAiABKAkSDAoEcm9sZRgDIAEoCRIPCgd1c2VyX2lkGAQgASgJEhEKCXVzZXJfbmFtZRgFIAEoCRIpCghtZXRhZGF0YRgGIAEoCzIXLmNoYXQudjEuVHlwaW5nTWV0YWRhdGEiXQoRUGFydGljaXBhbnRKb2luZWQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCRIPCgd1c2VyX2lkGAMgASgJEhEKCXVzZXJfbmFtZRgEIAEoCSJJCg9QYXJ0aWNpcGFudExlZnQSFgoOcGFydGljaXBhbnRfaWQYASABKAkSEwoGcmVhc29uGAIgASgJSACIAQFCCQoHX3JlYXNvbiJjCgNBY3cSDwoHZW5hYmxlZBgBIAEoCBIQCghkdXJhdGlvbhgCIAEoAxIPCgdlbmZvcmNlGAMgASgIEhIKCnN0YXJ0ZWRfYXQYBCABKAkSFAoMZGlzcG9zaXRpb25zGAUgAygJIkYKDFNlc3Npb25FbmRlZBIOCgZyZWFzb24YASABKAkSHgoDYWN3GAIgASgLMgwuY2hhdC52MS5BY3dIAIgBAUIGCgRfYWN3IhwKCUhlYXJ0YmVhdBIPCgd1bml4X21zGAEgASgDIqkCCglDaGF0RXZlbnQSIwoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZUgAEiYKBnR5cGluZxgCIAEoCzIULmNoYXQudjEuVHlwaW5nRXZlbnRIABI4ChJwYXJ0aWNpcGFudF9qb2luZWQYAyABKAsyGi5jaGF0LnYxLlBhcnRpY2lwYW50Sm9pbmVkSAASNAoQcGFydGljaXBhbnRfbGVmdBgEIAEoCzIYLmNoYXQudjEuUGFydGljaXBhbnRMZWZ0SAASLgoNc2Vzc2lvbl9lbmRlZBgFIAEoCzIVLmNoYXQudjEuU2Vzc2lvbkVuZGVkSAASJwoJaGVhcnRiZWF0GAYgASgLMhIuY2hhdC52MS5IZWFydGJlYXRIAEIGCgRraW5kIg8KDUF0dGFjaFJlcXVlc3QiNgoOQXR0YWNoUmVzcG9uc2USFgoOcGFydGljaXBhbnRfaWQYASABKAkSDAoEcm9sZRgCIAEoCSKFAgoOTWVzc2FnZVJlcXVlc3QSGQoRY2xpZW50X21lc3NhZ2VfaWQYASABKAkSEQoEdGV4dBgCIAEoCUgAiAEBEigKC2F0dGFjaG1lbnRzGAMgAygLMhMuY2hhdC52MS5BdHRhY2htZW50EhIKBXZhbHVlGAQgASgJSAGIAQESGgoNZ2FsbGVyeV9sYWJlbBgFIAEoCUgCiAEBEhEKBGh0bWwYBiABKAlIA4gBARIqCghtZXRhZGF0YRgHIAEoCzIYLmNoYXQudjEuTWVzc2FnZU1ldGFkYXRhQgcKBV90ZXh0QggKBl92YWx1ZUIQCg5fZ2FsbGVyeV9sYWJlbEIHCgVfaHRtbCI0Cg9NZXNzYWdlUmVzcG9uc2USIQoHbWVzc2FnZRgBIAEoCzIQLmNoYXQudjEuTWVzc2FnZSJJCg1UeXBpbmdSZXF1ZXN0Eg0KBXN0YXRlGAEgASgJEikKCG1ldGFkYXRhGAIgASgLMhcuY2hhdC52MS5UeXBpbmdNZXRhZGF0YSIQCg5UeXBpbmdSZXNwb25zZSIOCgxMZWF2ZVJlcXVlc3QiDwoNTGVhdmVSZXNwb25zZTLyAQoHU2Vzc2lvbhI2CgZBdHRhY2gSFi5jaGF0LnYxLkF0dGFjaFJlcXVlc3QaEi5jaGF0LnYxLkNoYXRFdmVudDABEjwKB01lc3NhZ2USFy5jaGF0LnYxLk1lc3NhZ2VSZXF1ZXN0GhguY2hhdC52MS5NZXNzYWdlUmVzcG9uc2USOQoGVHlwaW5nEhYuY2hhdC52MS5UeXBpbmdSZXF1ZXN0GhcuY2hhdC52MS5UeXBpbmdSZXNwb25zZRI2CgVMZWF2ZRIVLmNoYXQudjEuTGVhdmVSZXF1ZXN0GhYuY2hhdC52MS5MZWF2ZVJlc3BvbnNlYgZwcm90bzM"), Fr = /* @__PURE__ */ R(_, 0), Gr = /* @__PURE__ */ R(_, 3), Br = /* @__PURE__ */ R(_, 4), Yr = /* @__PURE__ */ R(_, 12), Wt = /* @__PURE__ */ R(_, 13), $r = /* @__PURE__ */ R(_, 14), jt = /* @__PURE__ */ R(_, 15), Xr = /* @__PURE__ */ R(_, 16), qt = /* @__PURE__ */ R(_, 17), Ht = /* @__PURE__ */ R(_, 19), ne = /* @__PURE__ */ Vr(_, 0), Kr = "x-origon-client-id", Wr = "stream_overflow", U = {
3130
+ /** session_not_found — terminal */
3131
+ NOT_FOUND: 1,
3132
+ /** bad request (e.g. missing client id at gw) — terminal */
3133
+ INVALID_ARGUMENT: 2,
3130
3134
  /** server_shutting_down (cx draining) — reattach ladder (D4) */
3131
3135
  UNAVAILABLE: 5,
3136
+ /** monitor capacity exhausted — terminal */
3137
+ CAPACITY: 7,
3132
3138
  /** token invalid/expired — SH-5 re-mint, retry once (D5) */
3133
3139
  UNAUTHENTICATED: 9,
3140
+ /** forbidden — terminal */
3141
+ PERMISSION_DENIED: 10,
3134
3142
  /** already_connected (slot held) — retryable */
3135
3143
  CONFLICT: 11
3136
3144
  };
3137
- function $r(e) {
3145
+ function se(e) {
3138
3146
  switch (e) {
3139
- case _e.CONFLICT:
3147
+ case U.CONFLICT:
3140
3148
  return "retry";
3141
- case _e.UNAUTHENTICATED:
3149
+ case U.UNAUTHENTICATED:
3142
3150
  return "remint";
3143
- case _e.UNAVAILABLE:
3151
+ case U.UNAVAILABLE:
3144
3152
  return "ladder";
3145
3153
  default:
3146
3154
  return "terminal";
3147
3155
  }
3148
3156
  }
3149
- function Ht(e) {
3157
+ function Zt(e) {
3150
3158
  let t;
3151
3159
  try {
3152
3160
  t = new URL(e);
3153
3161
  } catch (s) {
3154
- throw f.session(
3162
+ throw h.session(
3155
3163
  `chat session url: ${s instanceof Error ? s.message : String(s)}`
3156
3164
  );
3157
3165
  }
3158
3166
  const n = t.pathname.split("/").slice(1);
3159
3167
  if (n.length === 4 && n[0] === "chat" && n[1] === "api" && n[3] === "live" && n[2].trim() !== "")
3160
3168
  return n[2];
3161
- throw f.session(
3169
+ throw h.session(
3162
3170
  `chat session url carries no client id (want /chat/api/<id>/live, got "${t.pathname}")`
3163
3171
  );
3164
3172
  }
3165
- function Kr(e) {
3166
- const t = de(Br, e);
3173
+ function jr(e) {
3174
+ const t = fe(Yr, e);
3167
3175
  switch (t.kind.case) {
3168
3176
  case "message":
3169
- return { kind: "message", message: Yn(t.kind.value) };
3170
- case "typing":
3171
- return { kind: "typing", on: t.kind.value.state === "on" };
3177
+ return { kind: "message", message: $n(t.kind.value) };
3178
+ case "typing": {
3179
+ const n = t.kind.value;
3180
+ if (n.state !== "on" && n.state !== "off")
3181
+ throw h.session(`chat typing event carried invalid state "${n.state}"`);
3182
+ return {
3183
+ kind: "typing",
3184
+ update: {
3185
+ participantId: n.participantId,
3186
+ role: n.role,
3187
+ userId: n.userId,
3188
+ userName: n.userName,
3189
+ state: n.state,
3190
+ metadata: zr(n.metadata?.audience)
3191
+ }
3192
+ };
3193
+ }
3172
3194
  case "sessionEnded": {
3173
3195
  const n = t.kind.value.reason;
3174
- return { kind: "ended", reason: n, replay: n === Yr };
3196
+ return { kind: "ended", reason: n, replay: n === Wr };
3175
3197
  }
3176
3198
  default:
3177
3199
  return { kind: "ignore" };
3178
3200
  }
3179
3201
  }
3180
- function Yn(e) {
3202
+ function $n(e) {
3181
3203
  return {
3182
3204
  role: e.role === "ai" || e.role === "user" || e.role === "system" ? e.role : "external",
3183
3205
  id: e.id,
@@ -3185,41 +3207,42 @@ function Yn(e) {
3185
3207
  id: n.id,
3186
3208
  name: n.name,
3187
3209
  contentType: n.contentType,
3188
- url: n.url
3210
+ ...n.url !== "" ? { url: n.url } : {}
3189
3211
  })),
3190
3212
  status: "delivered",
3191
3213
  state: e.state === "streaming" ? "streaming" : "completed",
3214
+ metadata: Zr(e.metadata?.audience),
3192
3215
  ...e.text !== void 0 ? { text: e.text } : {},
3193
3216
  ...e.html !== void 0 ? { html: e.html } : {},
3194
3217
  ...e.timestamp !== "" ? { timestamp: e.timestamp } : {},
3195
3218
  ...e.userId !== "" ? { userId: e.userId } : {},
3196
3219
  ...e.userName !== "" ? { userName: e.userName } : {},
3197
3220
  ...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) } : {}
3221
+ ...e.buttons.length > 0 ? { buttons: e.buttons.map(Xn) } : {},
3222
+ ...e.gallery.length > 0 ? { gallery: e.gallery.map(qr) } : {}
3200
3223
  };
3201
3224
  }
3202
- function $n(e) {
3225
+ function Xn(e) {
3203
3226
  return { label: e.label, value: e.value, type: e.buttonType };
3204
3227
  }
3205
- function Xr(e) {
3228
+ function qr(e) {
3206
3229
  return {
3207
3230
  title: e.title,
3208
3231
  description: e.description,
3209
- buttons: e.buttons.map($n),
3232
+ buttons: e.buttons.map(Xn),
3210
3233
  ...e.image !== void 0 ? {
3211
3234
  image: {
3212
3235
  id: e.image.id,
3213
3236
  name: e.image.name,
3214
3237
  contentType: e.image.contentType,
3215
- url: e.image.url
3238
+ ...e.image.url !== "" ? { url: e.image.url } : {}
3216
3239
  }
3217
3240
  } : {}
3218
3241
  };
3219
3242
  }
3220
- class Wr {
3243
+ class Hr {
3221
3244
  constructor(t, n) {
3222
- this.url = t.url, this.token = t.token, this.clientId = Ht(t.url), this.opts = n, this.client = this.createClient();
3245
+ this.url = t.url, this.token = t.token, this.clientId = Zt(t.url), this.opts = n, this.client = this.createClient();
3223
3246
  }
3224
3247
  get credentials() {
3225
3248
  return { url: this.url, token: this.token };
@@ -3232,7 +3255,7 @@ class Wr {
3232
3255
  */
3233
3256
  setCredentials(t) {
3234
3257
  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());
3258
+ this.url = t.url, this.token = t.token, n && (this.clientId = Zt(t.url), this.client = this.createClient());
3236
3259
  }
3237
3260
  createClient() {
3238
3261
  const t = {
@@ -3241,18 +3264,18 @@ class Wr {
3241
3264
  logout: () => {
3242
3265
  }
3243
3266
  };
3244
- return us(this.url, t, {
3245
- metadata: { [Gr]: this.clientId },
3267
+ return ds(this.url, t, {
3268
+ metadata: { [Kr]: this.clientId },
3246
3269
  ...this.opts.transport !== void 0 ? { transport: this.opts.transport } : {},
3247
3270
  ...this.opts.logger !== void 0 ? { logger: this.opts.logger } : {}
3248
3271
  });
3249
3272
  }
3250
3273
  /** Attach — join the room. The `initial` frame is the `AttachResponse`. */
3251
3274
  async attach() {
3252
- const t = Q(Xt, x(Xt)), n = await this.client.stream(te(ee.method.attach), t);
3275
+ const t = te(Wt, C(Wt)), n = await this.client.stream(re(ne.method.attach), t);
3253
3276
  let s;
3254
3277
  try {
3255
- s = de(Pr, n.initial);
3278
+ s = fe($r, n.initial);
3256
3279
  } catch (r) {
3257
3280
  throw n.cancel(), r;
3258
3281
  }
@@ -3263,10 +3286,10 @@ class Wr {
3263
3286
  * timestamp, rewritten attachment URLs) — the former POST echo.
3264
3287
  */
3265
3288
  async message(t) {
3266
- const n = x(Wt, {
3289
+ const n = C(jt, {
3267
3290
  clientMessageId: t.clientMessageId,
3268
3291
  attachments: (t.attachments ?? []).map(
3269
- (i) => x(Vr, {
3292
+ (i) => C(Fr, {
3270
3293
  id: i.id,
3271
3294
  name: i.name,
3272
3295
  contentType: i.contentType,
@@ -3277,41 +3300,55 @@ class Wr {
3277
3300
  ...t.text !== void 0 ? { text: t.text } : {},
3278
3301
  ...t.html !== void 0 ? { html: t.html } : {},
3279
3302
  ...t.value !== void 0 ? { value: t.value } : {},
3280
- ...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {}
3303
+ ...t.galleryLabel !== void 0 ? { galleryLabel: t.galleryLabel } : {},
3304
+ metadata: C(Gr, t.metadata)
3281
3305
  }), s = await this.client.call(
3282
- te(ee.method.message),
3283
- Q(Wt, n)
3284
- ), r = de(Fr, s);
3306
+ re(ne.method.message),
3307
+ te(jt, n)
3308
+ ), r = fe(Xr, s);
3285
3309
  if (r.message === void 0)
3286
- throw f.session("chat message response carried no message");
3287
- return Yn(r.message);
3310
+ throw h.session("chat message response carried no message");
3311
+ return $n(r.message);
3288
3312
  }
3289
3313
  /** Typing — on/off indicator. Unary; the response is empty. */
3290
- async typing(t) {
3291
- const n = x(jt, { state: t });
3314
+ async typing(t, n) {
3315
+ const s = C(qt, {
3316
+ state: t,
3317
+ metadata: C(Br, n)
3318
+ });
3292
3319
  await this.client.call(
3293
- te(ee.method.typing),
3294
- Q(jt, n)
3320
+ re(ne.method.typing),
3321
+ te(qt, s)
3295
3322
  );
3296
3323
  }
3297
3324
  /** Leave — explicit participant leave (immediate finalize, idempotent). */
3298
3325
  async leave() {
3299
3326
  await this.client.call(
3300
- te(ee.method.leave),
3301
- Q(qt, x(qt))
3327
+ re(ne.method.leave),
3328
+ te(Ht, C(Ht))
3302
3329
  );
3303
3330
  }
3304
3331
  }
3305
- function te(e) {
3332
+ function Kn(e, t) {
3333
+ if (e === "internal" || e === "all") return e;
3334
+ throw h.session(`${t} carried invalid or missing metadata.audience`);
3335
+ }
3336
+ function Zr(e) {
3337
+ return { audience: Kn(e, "chat message") };
3338
+ }
3339
+ function zr(e) {
3340
+ return { audience: Kn(e, "chat typing event") };
3341
+ }
3342
+ function re(e) {
3306
3343
  return `${e.parent.typeName}/${e.name}`;
3307
3344
  }
3308
- const jr = 3e3, qr = 6e3, Hr = 3, Zr = 500, Jr = 2e3;
3309
- class zr {
3345
+ const Qr = 3e3, Jr = 6e3, ei = 3, ti = 500, ni = 2e3;
3346
+ class si {
3310
3347
  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(
3348
+ 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 Hr(
3312
3349
  { url: t.url.replace(/\/$/, ""), token: t.token },
3313
3350
  { remint: () => this.remint() }
3314
- ), this.sessionHttp = n.sessionHttp, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
3351
+ ), this.sessionHttp = n.sessionHttp, this.provisionedRecovery = n.provisionedRecovery, this.dispatcher = n.dispatcher, this.onTerminal = n.onTerminal;
3315
3352
  }
3316
3353
  /**
3317
3354
  * Attach to the room. Resolves once the initial `AttachResponse` frame is
@@ -3324,18 +3361,27 @@ class zr {
3324
3361
  try {
3325
3362
  ({ stream: t } = await this.lane.attach());
3326
3363
  } catch (n) {
3364
+ if (this.provisionedRecovery) {
3365
+ const s = this.provisionedTerminalFromRefusal(n);
3366
+ if (s)
3367
+ throw this.fireTerminal(s), n;
3368
+ if (await this.beginProvisionedRecovery(
3369
+ n instanceof T && se(n.code) === "remint" ? "unauthenticated" : "transportError"
3370
+ )) return;
3371
+ throw n;
3372
+ }
3327
3373
  throw this.fireTerminal(
3328
- n instanceof k ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
3374
+ n instanceof T ? { kind: "serverClosed", code: n.code, reason: n.reason } : { kind: "networkLoss" }
3329
3375
  ), n;
3330
3376
  }
3331
3377
  if (this.terminalFired)
3332
- throw t.cancel(), f.session("chat session closed during attach");
3378
+ throw t.cancel(), h.session("chat session closed during attach");
3333
3379
  this.stream = t, this.pump(t);
3334
3380
  }
3335
3381
  // ── Outbound API ─────────────────────────────────────────────────────
3336
3382
  async sendMessage(t) {
3337
3383
  this.cancelOutboundDebounce({ flushOff: !0 });
3338
- const n = ln(), s = {
3384
+ const n = dn(), s = t.metadata ?? { audience: "all" }, r = {
3339
3385
  role: t.role ?? "external",
3340
3386
  id: "",
3341
3387
  localId: n,
@@ -3344,12 +3390,14 @@ class zr {
3344
3390
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3345
3391
  attachments: t.attachments ?? [],
3346
3392
  status: "sending",
3347
- state: "completed"
3393
+ state: "completed",
3394
+ metadata: s
3348
3395
  };
3349
- this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", s);
3396
+ this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", r);
3350
3397
  try {
3351
- const r = {
3398
+ const i = {
3352
3399
  clientMessageId: n,
3400
+ metadata: s,
3353
3401
  ...t.text !== void 0 ? { text: t.text } : {},
3354
3402
  ...t.html !== void 0 ? { html: t.html } : {},
3355
3403
  ...t.attachments && t.attachments.length > 0 ? { attachments: t.attachments } : {},
@@ -3357,45 +3405,47 @@ class zr {
3357
3405
  value: t.buttonReply.value,
3358
3406
  ...t.buttonReply.label !== void 0 ? { galleryLabel: t.buttonReply.label } : {}
3359
3407
  } : {}
3360
- }, i = await this.lane.message(r), a = {
3361
- ...s,
3362
- ...i,
3408
+ }, a = await this.lane.message(i), o = {
3409
+ ...r,
3410
+ ...a,
3363
3411
  localId: n,
3364
3412
  // The canonical echo carries the rewritten attachment URLs; keep the
3365
3413
  // provisional rows (with their local previews) only when it has none.
3366
- attachments: i.attachments.length > 0 ? i.attachments : s.attachments
3414
+ attachments: a.attachments.length > 0 ? a.attachments : r.attachments
3367
3415
  };
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,
3416
+ return o.id && this.knownMessageIds.add(o.id), this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3417
+ id: o.id || n,
3418
+ message: o
3419
+ }), o;
3420
+ } catch (i) {
3421
+ const a = {
3422
+ ...r,
3375
3423
  status: "failed",
3376
- errorText: r instanceof Error ? r.message : String(r)
3424
+ errorText: i instanceof Error ? i.message : String(i)
3377
3425
  };
3378
3426
  throw this.terminalFired || this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3379
3427
  id: n,
3380
- message: i
3381
- }), r;
3428
+ message: a
3429
+ }), i;
3382
3430
  }
3383
3431
  }
3384
- notifyTyping() {
3385
- this.outboundOffTimer ? clearTimeout(this.outboundOffTimer) : this.sendTyping("on"), this.outboundOffTimer = setTimeout(() => {
3386
- this.outboundOffTimer = null, this.sendTyping("off");
3387
- }, jr);
3432
+ notifyTyping(t = { audience: "all" }) {
3433
+ this.outboundOffTimer ? (clearTimeout(this.outboundOffTimer), this.outboundTypingMetadata?.audience !== t.audience && (this.outboundTypingMetadata && this.sendTyping("off", this.outboundTypingMetadata), this.sendTyping("on", t))) : this.sendTyping("on", t), this.outboundTypingMetadata = t, this.outboundOffTimer = setTimeout(() => {
3434
+ this.outboundOffTimer = null;
3435
+ const n = this.outboundTypingMetadata;
3436
+ this.outboundTypingMetadata = null, n && this.sendTyping("off", n);
3437
+ }, Qr);
3388
3438
  }
3389
3439
  stopTyping() {
3390
3440
  this.cancelOutboundDebounce({ flushOff: !0 });
3391
3441
  }
3392
3442
  async disconnect() {
3393
3443
  this.cancelOutboundDebounce({ flushOff: !1 });
3394
- const t = this.terminalFired;
3395
- this.fireTerminal({ kind: "localClose" }), t || await Promise.race([
3396
- this.lane.leave().catch((n) => {
3444
+ const n = !this.terminalFired && (this.provisionedRecovery === void 0 || this.stream !== null && this.provisionedRecoveryPromise === null);
3445
+ this.fireTerminal({ kind: "localClose" }), n && await Promise.race([
3446
+ this.lane.leave().catch((s) => {
3397
3447
  }),
3398
- oe(Jr)
3448
+ W(ni)
3399
3449
  ]);
3400
3450
  }
3401
3451
  /**
@@ -3423,7 +3473,7 @@ class zr {
3423
3473
  if (this.terminalFired || this.stream !== t) continue;
3424
3474
  let r;
3425
3475
  try {
3426
- r = Kr(s);
3476
+ r = jr(s);
3427
3477
  } catch {
3428
3478
  this.fireTerminal({ kind: "protocolViolation" });
3429
3479
  return;
@@ -3433,20 +3483,24 @@ class zr {
3433
3483
  this.deliverMessage(r.message);
3434
3484
  break;
3435
3485
  case "typing":
3436
- this.handleTyping(r.on);
3486
+ this.handleTyping(r.update);
3437
3487
  break;
3438
3488
  case "ended":
3439
- n = !0, r.replay ? this.reattach() : this.fireTerminal({ kind: "sessionEnded" });
3489
+ n = !0, r.replay ? this.provisionedRecovery ? this.beginProvisionedRecovery("streamOverflow", t) : this.reattach() : this.fireTerminal({ kind: "sessionEnded" });
3440
3490
  break;
3441
3491
  case "ignore":
3442
3492
  break;
3443
3493
  }
3444
3494
  }
3445
3495
  } catch {
3496
+ if (this.provisionedRecovery && !n && !this.terminalFired && this.stream === t) {
3497
+ this.beginProvisionedRecovery("transportError", t);
3498
+ return;
3499
+ }
3446
3500
  !n && !this.terminalFired && this.stream === t && this.fireTerminal({ kind: "networkLoss" });
3447
3501
  return;
3448
3502
  }
3449
- !n && !this.terminalFired && this.stream === t && this.fireTerminal({ kind: "networkLoss" });
3503
+ !n && !this.terminalFired && this.stream === t && (this.provisionedRecovery ? this.beginProvisionedRecovery("cleanFin", t) : this.fireTerminal({ kind: "networkLoss" }));
3450
3504
  })();
3451
3505
  }
3452
3506
  /**
@@ -3457,7 +3511,7 @@ class zr {
3457
3511
  */
3458
3512
  deliverMessage(t) {
3459
3513
  if (this.terminalFired) return;
3460
- this.clearInboundWatchdog();
3514
+ this.clearInboundWatchdogsForUser(t.userId);
3461
3515
  const n = t.id || t.localId;
3462
3516
  n && this.knownMessageIds.has(n) ? this.dispatcher.fire("onMessageUpdated", this.sessionId, "chat", {
3463
3517
  id: t.id || n,
@@ -3465,7 +3519,100 @@ class zr {
3465
3519
  }) : (n && this.knownMessageIds.add(n), this.dispatcher.fire("onMessageAdded", this.sessionId, "chat", t));
3466
3520
  }
3467
3521
  handleTyping(t) {
3468
- t ? this.armInboundWatchdog() : this.clearInboundWatchdog(), this.dispatcher.fire("onTyping", this.sessionId, "chat", t);
3522
+ t.state === "on" ? this.armInboundWatchdog(t) : this.clearInboundWatchdog(t.participantId), this.dispatcher.fire("onTyping", this.sessionId, "chat", t);
3523
+ }
3524
+ // ── Provisioned recovery ─────────────────────────────────────────────
3525
+ /**
3526
+ * Serialize every provisioned refresh/Attach cycle. The returned promise is
3527
+ * shared by concurrent error/FIN signals. It is cleared before the recovered
3528
+ * stream pump starts, so a transport that fails immediately starts a new,
3529
+ * strictly later generation instead of being mistaken for the old cycle.
3530
+ */
3531
+ beginProvisionedRecovery(t, n) {
3532
+ if (!this.provisionedRecovery || this.terminalFired) return Promise.resolve(!1);
3533
+ if (n && this.stream === n && (this.stream = null), this.provisionedRecoveryPromise) return this.provisionedRecoveryPromise;
3534
+ this.clearAllInboundWatchdogs({ notify: !0 });
3535
+ const s = this.runProvisionedRecovery(t);
3536
+ let r;
3537
+ 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;
3538
+ }
3539
+ /** Fresh control-plane authorization before every bounded Attach attempt. */
3540
+ async runProvisionedRecovery(t) {
3541
+ const n = this.provisionedRecovery;
3542
+ if (!n) return null;
3543
+ let s = t;
3544
+ for (let r = 0; r < n.delaysMs.length; r++) {
3545
+ if (await W(n.delaysMs[r]), this.terminalFired) return null;
3546
+ const i = ++this.recoveryGeneration;
3547
+ let a;
3548
+ try {
3549
+ a = await n.reauthorize({
3550
+ sessionId: this.sessionId,
3551
+ attempt: r + 1,
3552
+ generation: i,
3553
+ cause: s
3554
+ });
3555
+ } catch {
3556
+ continue;
3557
+ }
3558
+ if (this.terminalFired || i !== this.recoveryGeneration) return null;
3559
+ if ("terminal" in a)
3560
+ return this.fireProvisionedTerminal(a.terminal), null;
3561
+ if (a.sessionId !== this.sessionId || a.url.trim() === "" || a.token.trim() === "")
3562
+ return this.fireTerminal({ kind: "protocolViolation" }), null;
3563
+ try {
3564
+ this.lane.setCredentials({
3565
+ url: a.url.replace(/\/$/, ""),
3566
+ token: a.token
3567
+ });
3568
+ const { stream: o } = await this.lane.attach();
3569
+ return this.terminalFired || i !== this.recoveryGeneration ? (o.cancel(), null) : o;
3570
+ } catch (o) {
3571
+ const l = this.provisionedTerminalFromRefusal(o);
3572
+ if (l)
3573
+ return this.fireTerminal(l), null;
3574
+ o instanceof T && se(o.code) === "remint" && (s = "unauthenticated");
3575
+ }
3576
+ }
3577
+ return this.fireTerminal({ kind: "replayLost" }), null;
3578
+ }
3579
+ provisionedTerminalFromRefusal(t) {
3580
+ if (!(t instanceof T)) return null;
3581
+ switch (t.code) {
3582
+ case U.NOT_FOUND:
3583
+ return { kind: "sessionEnded" };
3584
+ case U.CAPACITY:
3585
+ return { kind: "resourceExhausted" };
3586
+ case U.PERMISSION_DENIED:
3587
+ case U.INVALID_ARGUMENT:
3588
+ return { kind: "serverClosed", code: t.code, reason: t.reason };
3589
+ default:
3590
+ return se(t.code) === "terminal" ? { kind: "serverClosed", code: t.code, reason: t.reason } : null;
3591
+ }
3592
+ }
3593
+ fireProvisionedTerminal(t) {
3594
+ switch (t) {
3595
+ case "ended":
3596
+ this.fireTerminal({ kind: "sessionEnded" });
3597
+ break;
3598
+ case "capacity":
3599
+ this.fireTerminal({ kind: "resourceExhausted" });
3600
+ break;
3601
+ case "revoked":
3602
+ this.fireTerminal({
3603
+ kind: "serverClosed",
3604
+ code: U.PERMISSION_DENIED,
3605
+ reason: "provisioned_authorization_revoked"
3606
+ });
3607
+ break;
3608
+ case "removed":
3609
+ this.fireTerminal({
3610
+ kind: "serverClosed",
3611
+ code: U.PERMISSION_DENIED,
3612
+ reason: "provisioned_participant_removed"
3613
+ });
3614
+ break;
3615
+ }
3469
3616
  }
3470
3617
  // ── Overflow reattach (D4) + SH-5 re-mint (D5) ───────────────────────
3471
3618
  /**
@@ -3479,8 +3626,8 @@ class zr {
3479
3626
  this.reattaching = !0;
3480
3627
  try {
3481
3628
  let t = !1;
3482
- for (let n = 0; n < Hr; n++) {
3483
- if (await oe(Zr * 2 ** n), this.terminalFired) return;
3629
+ for (let n = 0; n < ei; n++) {
3630
+ if (await W(ti * 2 ** n), this.terminalFired) return;
3484
3631
  try {
3485
3632
  const { stream: s } = await this.lane.attach();
3486
3633
  if (this.terminalFired) {
@@ -3490,8 +3637,8 @@ class zr {
3490
3637
  this.stream = s, this.pump(s), await this.replayHistory();
3491
3638
  return;
3492
3639
  } catch (s) {
3493
- if (s instanceof k) {
3494
- const r = $r(s.code);
3640
+ if (s instanceof T) {
3641
+ const r = se(s.code);
3495
3642
  if (r === "remint" && !t) {
3496
3643
  t = !0;
3497
3644
  try {
@@ -3499,7 +3646,7 @@ class zr {
3499
3646
  continue;
3500
3647
  } catch (i) {
3501
3648
  this.fireTerminal(
3502
- i instanceof f && i.kind === "session" ? { kind: "sessionEnded" } : { kind: "networkLoss" }
3649
+ i instanceof h && i.kind === "session" ? { kind: "sessionEnded" } : { kind: "networkLoss" }
3503
3650
  );
3504
3651
  return;
3505
3652
  }
@@ -3549,42 +3696,70 @@ class zr {
3549
3696
  * strand the visible transcript.
3550
3697
  */
3551
3698
  async remint() {
3699
+ if (this.provisionedRecovery)
3700
+ throw h.session(
3701
+ "provisioned chat credentials are refreshed only by the caller reauthorization policy"
3702
+ );
3552
3703
  const t = await this.sessionHttp.startSession({
3553
3704
  channel: "chat",
3554
3705
  sessionId: this.sessionId
3555
3706
  });
3556
3707
  if (t.sessionId !== this.sessionId)
3557
- throw f.session(
3708
+ throw h.session(
3558
3709
  `chat re-mint returned a different session (${t.sessionId}) — the room is gone`
3559
3710
  );
3560
3711
  return { url: t.url.replace(/\/$/, ""), token: t.token };
3561
3712
  }
3562
3713
  // ── Timers ───────────────────────────────────────────────────────────
3563
- armInboundWatchdog() {
3564
- this.clearInboundWatchdog(), this.inboundOffTimer = setTimeout(() => {
3565
- this.inboundOffTimer = null, this.dispatcher.fire("onTyping", this.sessionId, "chat", !1);
3566
- }, qr);
3714
+ armInboundWatchdog(t) {
3715
+ this.clearInboundWatchdog(t.participantId);
3716
+ const n = setTimeout(() => {
3717
+ this.inboundTyping.delete(t.participantId), this.dispatcher.fire("onTyping", this.sessionId, "chat", {
3718
+ ...t,
3719
+ state: "off"
3720
+ });
3721
+ }, Jr);
3722
+ this.inboundTyping.set(t.participantId, { timer: n, update: t });
3723
+ }
3724
+ clearInboundWatchdog(t) {
3725
+ const n = this.inboundTyping.get(t);
3726
+ n && (clearTimeout(n.timer), this.inboundTyping.delete(t));
3567
3727
  }
3568
- clearInboundWatchdog() {
3569
- this.inboundOffTimer && (clearTimeout(this.inboundOffTimer), this.inboundOffTimer = null);
3728
+ clearInboundWatchdogsForUser(t) {
3729
+ if (t)
3730
+ for (const [n, s] of this.inboundTyping)
3731
+ s.update.userId === t && this.clearInboundWatchdog(n);
3732
+ }
3733
+ clearAllInboundWatchdogs({ notify: t }) {
3734
+ const n = [...this.inboundTyping.values()];
3735
+ this.inboundTyping.clear();
3736
+ for (const s of n)
3737
+ clearTimeout(s.timer), t && this.dispatcher.fire("onTyping", this.sessionId, "chat", {
3738
+ ...s.update,
3739
+ state: "off"
3740
+ });
3570
3741
  }
3571
3742
  cancelOutboundDebounce({ flushOff: t }) {
3572
- this.outboundOffTimer && (clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null, t && this.sendTyping("off"));
3743
+ if (this.outboundOffTimer) {
3744
+ clearTimeout(this.outboundOffTimer), this.outboundOffTimer = null;
3745
+ const n = this.outboundTypingMetadata;
3746
+ this.outboundTypingMetadata = null, t && n && this.sendTyping("off", n);
3747
+ }
3573
3748
  }
3574
- async sendTyping(t) {
3749
+ async sendTyping(t, n) {
3575
3750
  try {
3576
- await this.lane.typing(t);
3751
+ await this.lane.typing(t, n);
3577
3752
  } catch {
3578
3753
  }
3579
3754
  }
3580
3755
  fireTerminal(t) {
3581
3756
  if (this.terminalFired) return;
3582
- this.terminalFired = !0;
3757
+ this.terminalFired = !0, this.recoveryGeneration++;
3583
3758
  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);
3759
+ 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
3760
  }
3586
3761
  }
3587
- class Qr {
3762
+ class ri {
3588
3763
  constructor(t) {
3589
3764
  this.endpoint = t.endpoint.replace(/\/$/, ""), this.defaultHeaders = {}, t.token && (this.defaultHeaders.Authorization = `Bearer ${t.token}`);
3590
3765
  }
@@ -3612,9 +3787,9 @@ class Qr {
3612
3787
  try {
3613
3788
  i = await fetch(t, r);
3614
3789
  } catch (a) {
3615
- throw f.other(`fetch failed: ${a.message}`);
3790
+ throw h.other(`fetch failed: ${a.message}`);
3616
3791
  }
3617
- return Zt(i);
3792
+ return zt(i);
3618
3793
  }
3619
3794
  async getJsonAbsolute(t, n) {
3620
3795
  const s = {
@@ -3626,9 +3801,9 @@ class Qr {
3626
3801
  try {
3627
3802
  r = await fetch(t, s);
3628
3803
  } catch (i) {
3629
- throw f.other(`fetch failed: ${i.message}`);
3804
+ throw h.other(`fetch failed: ${i.message}`);
3630
3805
  }
3631
- return Zt(r);
3806
+ return zt(r);
3632
3807
  }
3633
3808
  async deleteAbsolute(t, n) {
3634
3809
  const s = {
@@ -3640,50 +3815,53 @@ class Qr {
3640
3815
  try {
3641
3816
  r = await fetch(t, s);
3642
3817
  } catch (i) {
3643
- throw f.other(`fetch failed: ${i.message}`);
3818
+ throw h.other(`fetch failed: ${i.message}`);
3644
3819
  }
3645
3820
  if (!r.ok) {
3646
- const i = await r.text().catch(() => "");
3647
- throw et(r.status, i);
3821
+ const i = await r.text().catch(() => ""), a = n?.bearer;
3822
+ throw tt(
3823
+ r.status,
3824
+ a ? i.split(a).join("[REDACTED]") : i
3825
+ );
3648
3826
  }
3649
3827
  }
3650
3828
  buildAbsoluteUrl(t) {
3651
3829
  return this.url(t);
3652
3830
  }
3653
3831
  }
3654
- async function Zt(e) {
3832
+ async function zt(e) {
3655
3833
  const t = await e.text();
3656
3834
  if (!e.ok)
3657
- throw et(e.status, t);
3835
+ throw tt(e.status, t);
3658
3836
  let n;
3659
3837
  if (t.length !== 0) {
3660
3838
  try {
3661
3839
  n = JSON.parse(t);
3662
3840
  } catch (s) {
3663
- throw f.other(`decode response: ${s.message}`);
3841
+ throw h.other(`decode response: ${s.message}`);
3664
3842
  }
3665
- if (tn(n))
3666
- throw f.http(e.status, n.error.code, n.error.message);
3843
+ if (nn(n))
3844
+ throw h.http(e.status, n.error.code, n.error.message);
3667
3845
  return n;
3668
3846
  }
3669
3847
  }
3670
- function et(e, t) {
3848
+ function tt(e, t) {
3671
3849
  if (e >= 500)
3672
- return f.serverUnavailable(e);
3850
+ return h.serverUnavailable(e);
3673
3851
  if (t.length === 0)
3674
- return f.http(e, "", `HTTP ${e}`);
3852
+ return h.http(e, "", `HTTP ${e}`);
3675
3853
  try {
3676
3854
  const n = JSON.parse(t);
3677
- if (tn(n))
3678
- return f.http(e, n.error.code, n.error.message);
3855
+ if (nn(n))
3856
+ return h.http(e, n.error.code, n.error.message);
3679
3857
  } catch {
3680
3858
  }
3681
- return f.http(e, "", t.slice(0, 200));
3859
+ return h.http(e, "", t.slice(0, 200));
3682
3860
  }
3683
- function Oe(e, t) {
3861
+ function ve(e, t) {
3684
3862
  return t ? `${e}?userId=${encodeURIComponent(t)}` : e;
3685
3863
  }
3686
- class ei {
3864
+ class ii {
3687
3865
  constructor(t, n) {
3688
3866
  this.http = t, this.userId = n;
3689
3867
  }
@@ -3695,54 +3873,54 @@ class ei {
3695
3873
  startSession(t) {
3696
3874
  const n = { channel: t.channel };
3697
3875
  return t.sessionId && (n.sessionId = t.sessionId), t.data && (n.data = t.data), this.http.postJson(
3698
- Oe("/session/start", this.userId),
3876
+ ve("/session/start", this.userId),
3699
3877
  n
3700
3878
  );
3701
3879
  }
3702
3880
  /** `GET /sessions` — list prior sessions (matches `client-sdk/session`). */
3703
3881
  async listSessions() {
3704
- const t = await this.http.getJson(Oe("/sessions", this.userId));
3705
- return ti(t);
3882
+ const t = await this.http.getJson(ve("/sessions", this.userId));
3883
+ return ai(t);
3706
3884
  }
3707
3885
  /** `GET /session/{id}` — fetch transcript + control (matches `client-sdk/session`). */
3708
3886
  getSession(t) {
3709
3887
  return this.http.getJson(
3710
- Oe(`/session/${encodeURIComponent(t)}`, this.userId)
3888
+ ve(`/session/${encodeURIComponent(t)}`, this.userId)
3711
3889
  );
3712
3890
  }
3713
3891
  }
3714
- function ti(e) {
3892
+ function ai(e) {
3715
3893
  if (!Array.isArray(e))
3716
- throw f.other("decode sessions: expected an array");
3894
+ throw h.other("decode sessions: expected an array");
3717
3895
  return e.forEach((t, n) => {
3718
3896
  if (typeof t != "object" || t === null || Array.isArray(t))
3719
- throw f.other(`decode sessions[${n}]: expected an object`);
3897
+ throw h.other(`decode sessions[${n}]: expected an object`);
3720
3898
  if (typeof t.active != "boolean")
3721
- throw f.other(`decode sessions[${n}].active: expected boolean`);
3899
+ throw h.other(`decode sessions[${n}].active: expected boolean`);
3722
3900
  }), e;
3723
3901
  }
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);
3902
+ function oi(e, t, n, s) {
3903
+ return new Promise((r, i) => {
3904
+ const a = new XMLHttpRequest();
3905
+ a.open("POST", e, !0), s && a.setRequestHeader("Authorization", `Bearer ${s}`);
3906
+ const o = new FormData();
3907
+ o.append("file", t, t.name);
3908
+ let l = -1, u = 0;
3909
+ if (n.onProgress && (a.upload.onprogress = (d) => {
3910
+ 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();
3911
+ if (m !== void 0 ? m !== l : g - u >= 100) {
3912
+ m !== void 0 && (l = m), u = g;
3913
+ const x = { bytesUploaded: p };
3914
+ f !== void 0 && (x.totalBytes = f), m !== void 0 && (x.percent = m), n.onProgress?.(x);
3737
3915
  }
3738
- }), i.onload = () => {
3739
- const u = i.status, d = i.responseText ?? "";
3740
- if (u < 200 || u >= 300) {
3741
- r(et(u, d));
3916
+ }), a.onload = () => {
3917
+ const d = a.status, f = a.responseText ?? "";
3918
+ if (d < 200 || d >= 300) {
3919
+ i(tt(d, li(f, s)));
3742
3920
  return;
3743
3921
  }
3744
3922
  try {
3745
- const h = JSON.parse(d);
3923
+ const p = ci(JSON.parse(f));
3746
3924
  if (n.onProgress && t.size > 0) {
3747
3925
  const m = {
3748
3926
  bytesUploaded: t.size,
@@ -3751,33 +3929,48 @@ function ni(e, t, n) {
3751
3929
  };
3752
3930
  n.onProgress(m);
3753
3931
  }
3754
- s(h);
3755
- } catch (h) {
3756
- r(f.other(`decode response: ${h.message}`));
3932
+ r(p);
3933
+ } catch (p) {
3934
+ i(h.other(`decode response: ${p.message}`));
3757
3935
  }
3758
- }, i.onerror = () => {
3759
- r(f.other("upload failed: network error"));
3760
- }, i.onabort = () => {
3761
- r(f.cancelled());
3936
+ }, a.onerror = () => {
3937
+ i(h.other("upload failed: network error"));
3938
+ }, a.onabort = () => {
3939
+ i(h.cancelled());
3762
3940
  }, n.signal) {
3763
3941
  if (n.signal.aborted) {
3764
- i.abort();
3942
+ a.abort();
3765
3943
  return;
3766
3944
  }
3767
- n.signal.addEventListener("abort", () => i.abort(), { once: !0 });
3945
+ n.signal.addEventListener("abort", () => a.abort(), { once: !0 });
3768
3946
  }
3769
- i.send(a);
3947
+ a.send(o);
3770
3948
  });
3771
3949
  }
3772
- function si(e, t) {
3950
+ function ci(e) {
3951
+ if (!ui(e)) throw h.other("decode response: attachment must be an object");
3952
+ const { id: t, name: n, contentType: s, url: r } = e;
3953
+ if (typeof t != "string" || typeof n != "string" || typeof s != "string")
3954
+ throw h.other("decode response: attachment id, name, and contentType must be strings");
3955
+ if (r !== void 0 && typeof r != "string")
3956
+ throw h.other("decode response: attachment url must be a string when present");
3957
+ return { id: t, name: n, contentType: s, ...r !== void 0 ? { url: r } : {} };
3958
+ }
3959
+ function ui(e) {
3960
+ return typeof e == "object" && e !== null && !Array.isArray(e);
3961
+ }
3962
+ function li(e, t) {
3963
+ return t ? e.split(t).join("[REDACTED]") : e;
3964
+ }
3965
+ function di(e, t) {
3773
3966
  if (e.size === 0)
3774
- return { ok: !1, error: f.attachment("EMPTY_FILE", `Empty file: ${e.name}`) };
3967
+ return { ok: !1, error: h.attachment("EMPTY_FILE", `Empty file: ${e.name}`) };
3775
3968
  if (!t) return { ok: !0 };
3776
- const n = ri(e.type);
3969
+ const n = hi(e.type);
3777
3970
  if (!n)
3778
3971
  return {
3779
3972
  ok: !1,
3780
- error: f.attachment(
3973
+ error: h.attachment(
3781
3974
  "POLICY_UNSUPPORTED_TYPE",
3782
3975
  `Unsupported content type: ${e.type || "unknown"}`
3783
3976
  )
@@ -3785,43 +3978,43 @@ function si(e, t) {
3785
3978
  const s = t[n];
3786
3979
  return !s || !s.enabled ? {
3787
3980
  ok: !1,
3788
- error: f.attachment(
3981
+ error: h.attachment(
3789
3982
  "POLICY_TYPE_DISABLED",
3790
3983
  `Attachment type disabled: ${n}`
3791
3984
  )
3792
3985
  } : s.maxSize && e.size > s.maxSize * 1024 * 1024 ? {
3793
3986
  ok: !1,
3794
- error: f.attachment(
3987
+ error: h.attachment(
3795
3988
  "POLICY_TOO_LARGE",
3796
3989
  `File ${e.name} exceeds ${s.maxSize}MB limit for ${n}`
3797
3990
  )
3798
3991
  } : { ok: !0 };
3799
3992
  }
3800
- function ri(e) {
3993
+ function hi(e) {
3801
3994
  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
3995
  }
3803
- const Jt = "origonWebSdkUserId";
3804
- function ii() {
3805
- const e = localStorage.getItem(Jt);
3996
+ const Qt = "origonWebSdkUserId";
3997
+ function fi() {
3998
+ const e = localStorage.getItem(Qt);
3806
3999
  if (e) return e;
3807
- const t = ln();
3808
- return localStorage.setItem(Jt, t), t;
4000
+ const t = dn();
4001
+ return localStorage.setItem(Qt, t), t;
3809
4002
  }
3810
- const ai = (1n << 62n) - 1n;
4003
+ const mi = (1n << 62n) - 1n;
3811
4004
  class y extends Error {
3812
4005
  constructor(t) {
3813
4006
  super(t), this.name = "CodecError";
3814
4007
  }
3815
4008
  }
3816
- function oi(e) {
4009
+ function pi(e) {
3817
4010
  if (e < 0n) throw new y(`negative varint: ${e}`);
3818
4011
  if (e <= 63n) return 1;
3819
4012
  if (e <= 16383n) return 2;
3820
4013
  if (e <= 1073741823n) return 4;
3821
- if (e <= ai) return 8;
4014
+ if (e <= mi) return 8;
3822
4015
  throw new y(`varint overflow: ${e}`);
3823
4016
  }
3824
- class Y {
4017
+ class X {
3825
4018
  constructor() {
3826
4019
  this.chunks = [], this.len = 0;
3827
4020
  }
@@ -3843,7 +4036,7 @@ class Y {
3843
4036
  this.chunks.push(t), this.len += t.length;
3844
4037
  }
3845
4038
  putVarint(t) {
3846
- const n = typeof t == "number" ? BigInt(t) : t, s = oi(n);
4039
+ const n = typeof t == "number" ? BigInt(t) : t, s = pi(n);
3847
4040
  switch (s) {
3848
4041
  case 1:
3849
4042
  this.putU8(Number(n));
@@ -3882,7 +4075,7 @@ class Y {
3882
4075
  return t;
3883
4076
  }
3884
4077
  }
3885
- class ge {
4078
+ class ye {
3886
4079
  constructor(t) {
3887
4080
  this.buf = t, this.offset = 0;
3888
4081
  }
@@ -3963,9 +4156,9 @@ class ge {
3963
4156
  return new TextDecoder("utf-8", { fatal: !0 }).decode(this.getLengthPrefixedBytes());
3964
4157
  }
3965
4158
  }
3966
- function ci(e) {
4159
+ function bi(e) {
3967
4160
  try {
3968
- const t = new ge(e);
4161
+ const t = new ye(e);
3969
4162
  t.getVarint();
3970
4163
  const n = t.getVarint();
3971
4164
  return t.position() + Number(n);
@@ -3973,56 +4166,56 @@ function ci(e) {
3973
4166
  return null;
3974
4167
  }
3975
4168
  }
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;
4169
+ const gi = 1, Wn = 2, Ei = 4, yi = 8, wi = 32;
4170
+ function Ii(e) {
4171
+ const t = new X(), n = e.endOfGroup ? Wn : 0;
3979
4172
  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
4173
  }
3981
- function mi(e) {
3982
- const t = new ge(e), n = Number(t.getVarint());
4174
+ function Ni(e) {
4175
+ const t = new ye(e), n = Number(t.getVarint());
3983
4176
  if (!(n >= 0 && n <= 15 || n >= 32 && n <= 47))
3984
4177
  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;
4178
+ const s = (n & gi) !== 0, r = (n & Wn) !== 0, i = (n & Ei) !== 0, a = (n & yi) !== 0, o = (n & wi) !== 0;
3986
4179
  if (o && r)
3987
4180
  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();
4181
+ const l = t.getVarint(), u = t.getVarint(), d = i ? 1n : t.getVarint(), f = a ? 0 : t.getU8();
3989
4182
  if (s) {
3990
- const g = Number(t.getVarint());
3991
- if (g === 0) throw new y("extension block declared but empty");
3992
- t.getBytes(g);
4183
+ const m = Number(t.getVarint());
4184
+ if (m === 0) throw new y("extension block declared but empty");
4185
+ t.getBytes(m);
3993
4186
  }
3994
4187
  if (o)
3995
4188
  return t.getVarint(), {
3996
4189
  trackAlias: l,
3997
4190
  groupId: u,
3998
4191
  objectId: d,
3999
- publisherPriority: h,
4192
+ publisherPriority: f,
4000
4193
  endOfGroup: r,
4001
4194
  payload: new Uint8Array(0)
4002
4195
  };
4003
- const m = t.drainRemaining();
4196
+ const p = t.drainRemaining();
4004
4197
  return {
4005
4198
  trackAlias: l,
4006
4199
  groupId: u,
4007
4200
  objectId: d,
4008
- publisherPriority: h,
4201
+ publisherPriority: f,
4009
4202
  endOfGroup: r,
4010
- payload: m.slice()
4203
+ payload: p.slice()
4011
4204
  };
4012
4205
  }
4013
- const ne = {
4206
+ const ie = {
4014
4207
  AudioObject: 0,
4015
4208
  AudioFeedback: 1
4016
4209
  };
4017
- function zt(e, t) {
4210
+ function Jt(e, t) {
4018
4211
  const n = new Uint8Array(t.length + 1);
4019
4212
  return n[0] = e, n.set(t, 1), n;
4020
4213
  }
4021
- function pi(e) {
4214
+ function Ti(e) {
4022
4215
  if (e.length === 0) throw new y("empty datagram envelope");
4023
4216
  return { cls: e[0], body: e.subarray(1) };
4024
4217
  }
4025
- const Me = 64 * 1024, T = {
4218
+ const Pe = 64 * 1024, S = {
4026
4219
  CONNECT: 0x40n,
4027
4220
  CONNECT_OK: 0x41n,
4028
4221
  NEGOTIATE_MEDIA: 0x42n,
@@ -4043,31 +4236,31 @@ const Me = 64 * 1024, T = {
4043
4236
  // 0x54 = DtmfReceived — not implemented; uni-stream payload anyway
4044
4237
  MOQ_ERROR: 0x55n
4045
4238
  };
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}`);
4239
+ function Si(e) {
4240
+ const t = new X(), { msgType: n, payload: s } = Ai(e);
4241
+ if (s.length > Pe)
4242
+ throw new y(`control frame payload ${s.length} > ${Pe}`);
4050
4243
  return t.putVarint(n), t.putVarint(s.length), t.putBytes(s), t.toUint8Array();
4051
4244
  }
4052
- function gi(e) {
4053
- const t = ci(e);
4245
+ function ki(e) {
4246
+ const t = bi(e);
4054
4247
  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)
4248
+ const n = new ye(e), s = n.getVarint(), r = Number(n.getVarint());
4249
+ if (r > Pe)
4057
4250
  throw new y(`oversized payload ${r}`);
4058
4251
  const i = n.getBytes(r);
4059
- return { msg: yi(s, i), consumed: t };
4252
+ return { msg: Ri(s, i), consumed: t };
4060
4253
  }
4061
- function Ei(e) {
4254
+ function Ai(e) {
4062
4255
  switch (e.type) {
4063
4256
  case "connect":
4064
- return { msgType: T.CONNECT, payload: Ui(e.data) };
4257
+ return { msgType: S.CONNECT, payload: Yi(e.data) };
4065
4258
  case "negotiateMedia":
4066
- return { msgType: T.NEGOTIATE_MEDIA, payload: xi(e.data) };
4259
+ return { msgType: S.NEGOTIATE_MEDIA, payload: $i(e.data) };
4067
4260
  case "mute":
4068
- return { msgType: T.MUTE, payload: Mi(e.data) };
4261
+ return { msgType: S.MUTE, payload: Xi(e.data) };
4069
4262
  case "resume":
4070
- return { msgType: T.RESUME, payload: Vi(e.data) };
4263
+ return { msgType: S.RESUME, payload: Ki(e.data) };
4071
4264
  // The remaining variants are server-emitted; we never encode them
4072
4265
  // outbound. Including the cases keeps the union exhaustive.
4073
4266
  case "connectOk":
@@ -4083,39 +4276,39 @@ function Ei(e) {
4083
4276
  throw new y(`refusing to encode server-emitted variant '${e.type}'`);
4084
4277
  }
4085
4278
  }
4086
- function yi(e, t) {
4087
- const n = new ge(t);
4279
+ function Ri(e, t) {
4280
+ const n = new ye(t);
4088
4281
  let s;
4089
4282
  switch (e) {
4090
- case T.CONNECT_OK:
4091
- s = { type: "connectOk", data: Bi(n) };
4283
+ case S.CONNECT_OK:
4284
+ s = { type: "connectOk", data: Wi(n) };
4092
4285
  break;
4093
- case T.NEGOTIATE_MEDIA_OK:
4094
- s = { type: "negotiateMediaOk", data: Pi(n) };
4286
+ case S.NEGOTIATE_MEDIA_OK:
4287
+ s = { type: "negotiateMediaOk", data: ji(n) };
4095
4288
  break;
4096
- case T.MUTE_OK:
4097
- s = { type: "muteOk", data: Fi(n) };
4289
+ case S.MUTE_OK:
4290
+ s = { type: "muteOk", data: qi(n) };
4098
4291
  break;
4099
- case T.RESUME_OK:
4100
- s = { type: "resumeOk", data: Gi(n) };
4292
+ case S.RESUME_OK:
4293
+ s = { type: "resumeOk", data: Hi(n) };
4101
4294
  break;
4102
- case T.PEER_ATTACHED:
4103
- s = { type: "peerAttached", data: Yi(n) };
4295
+ case S.PEER_ATTACHED:
4296
+ s = { type: "peerAttached", data: Zi(n) };
4104
4297
  break;
4105
- case T.PEER_DETACHED:
4106
- s = { type: "peerDetached", data: $i(n) };
4298
+ case S.PEER_DETACHED:
4299
+ s = { type: "peerDetached", data: zi(n) };
4107
4300
  break;
4108
- case T.ENDPOINT_MUTED:
4109
- s = { type: "endpointMuted", data: Ki(n) };
4301
+ case S.ENDPOINT_MUTED:
4302
+ s = { type: "endpointMuted", data: Qi(n) };
4110
4303
  break;
4111
- case T.ENDPOINT_HANGUP:
4112
- s = { type: "endpointHangup", data: Xi(n) };
4304
+ case S.ENDPOINT_HANGUP:
4305
+ s = { type: "endpointHangup", data: Ji(n) };
4113
4306
  break;
4114
- case T.PEER_STATE_CHANGED:
4115
- s = { type: "peerStateChanged", data: Wi(n) };
4307
+ case S.PEER_STATE_CHANGED:
4308
+ s = { type: "peerStateChanged", data: ea(n) };
4116
4309
  break;
4117
- case T.MOQ_ERROR:
4118
- s = { type: "moqError", data: ji(n) };
4310
+ case S.MOQ_ERROR:
4311
+ s = { type: "moqError", data: ta(n) };
4119
4312
  break;
4120
4313
  default:
4121
4314
  throw new y(`unknown control message type 0x${e.toString(16)}`);
@@ -4126,17 +4319,17 @@ function yi(e, t) {
4126
4319
  );
4127
4320
  return s;
4128
4321
  }
4129
- function wi(e) {
4322
+ function _i(e) {
4130
4323
  switch (e) {
4131
4324
  case "audio":
4132
4325
  return 1n;
4133
4326
  }
4134
4327
  }
4135
- function Ni(e) {
4328
+ function vi(e) {
4136
4329
  if (e === 1n) return "audio";
4137
4330
  throw new y(`unknown EncodingClass id ${e}`);
4138
4331
  }
4139
- function Ii(e) {
4332
+ function Oi(e) {
4140
4333
  switch (e) {
4141
4334
  case "primary":
4142
4335
  return 1n;
@@ -4144,12 +4337,12 @@ function Ii(e) {
4144
4337
  return 2n;
4145
4338
  }
4146
4339
  }
4147
- function Ti(e) {
4340
+ function Ci(e) {
4148
4341
  if (e === 1n) return "primary";
4149
4342
  if (e === 2n) return "captions";
4150
4343
  throw new y(`unknown TrackPurpose id ${e}`);
4151
4344
  }
4152
- function Si(e) {
4345
+ function Di(e) {
4153
4346
  switch (e) {
4154
4347
  case "opus":
4155
4348
  return 1n;
@@ -4159,13 +4352,13 @@ function Si(e) {
4159
4352
  return 3n;
4160
4353
  }
4161
4354
  }
4162
- function tt(e) {
4355
+ function nt(e) {
4163
4356
  if (e === 1n) return "opus";
4164
4357
  if (e === 2n) return "pcmu";
4165
4358
  if (e === 3n) return "pcma";
4166
4359
  throw new y(`unknown AudioCodec id ${e}`);
4167
4360
  }
4168
- function ki(e) {
4361
+ function Ui(e) {
4169
4362
  switch (e) {
4170
4363
  case "none":
4171
4364
  return 0n;
@@ -4177,165 +4370,165 @@ function ki(e) {
4177
4370
  return 3n;
4178
4371
  }
4179
4372
  }
4180
- function Xn(e) {
4373
+ function jn(e) {
4181
4374
  if (e === 0n) return "none";
4182
4375
  if (e === 1n) return "uplink";
4183
4376
  if (e === 2n) return "downlink";
4184
4377
  if (e === 3n) return "both";
4185
4378
  throw new y(`unknown MuteScope id ${e}`);
4186
4379
  }
4187
- function Ai(e) {
4380
+ function Li(e) {
4188
4381
  if (e === 1n) return "normal";
4189
4382
  if (e === 2n) return "userCancel";
4190
4383
  if (e === 3n) return "error";
4191
4384
  throw new y(`unknown HangupReason id ${e}`);
4192
4385
  }
4193
- function Wn(e) {
4386
+ function qn(e) {
4194
4387
  if (e === 1n) return "client";
4195
4388
  if (e === 2n) return "controller";
4196
4389
  if (e === 3n) return "engine";
4197
4390
  if (e === 4n) return "networkLost";
4198
4391
  throw new y(`unknown Origin id ${e}`);
4199
4392
  }
4200
- function _i(e) {
4393
+ function Mi(e) {
4201
4394
  if (e === 1n) return "active";
4202
4395
  if (e === 2n) return "held";
4203
4396
  if (e === 3n) return "muted";
4204
4397
  if (e === 4n) return "hangup";
4205
4398
  throw new y(`unknown PeerState id ${e}`);
4206
4399
  }
4207
- function Oi(e) {
4400
+ function xi(e) {
4208
4401
  if (e === 1n) return "codecMismatch";
4209
4402
  if (e === 2n) return "unsupportedClass";
4210
4403
  if (e === 3n) return "capacityExceeded";
4211
4404
  throw new y(`unknown TrackRejectionReason id ${e}`);
4212
4405
  }
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));
4406
+ function Pi(e, t) {
4407
+ t.putVarint(_i(e.class)), t.putVarint(Oi(e.purpose)), t.putVarint(e.codecs.length);
4408
+ for (const n of e.codecs) t.putVarint(Di(n));
4216
4409
  }
4217
- function jn(e, t) {
4410
+ function Hn(e, t) {
4218
4411
  t.putVarint(e.length);
4219
- for (const n of e) Ri(n, t);
4412
+ for (const n of e) Pi(n, t);
4220
4413
  }
4221
- function Ci(e) {
4414
+ function Vi(e) {
4222
4415
  return {
4223
4416
  offerIndex: Number(e.getVarint()),
4224
4417
  alias: e.getVarint(),
4225
- codec: tt(e.getVarint()),
4418
+ codec: nt(e.getVarint()),
4226
4419
  frameSizeMs: Number(e.getVarint())
4227
4420
  };
4228
4421
  }
4229
- function qn(e) {
4422
+ function Zn(e) {
4230
4423
  const t = Number(e.getVarint()), n = [];
4231
- for (let s = 0; s < t; s++) n.push(Ci(e));
4424
+ for (let s = 0; s < t; s++) n.push(Vi(e));
4232
4425
  return n;
4233
4426
  }
4234
- function vi(e) {
4427
+ function Fi(e) {
4235
4428
  return {
4236
4429
  offerIndex: Number(e.getVarint()),
4237
- reason: Oi(e.getVarint())
4430
+ reason: xi(e.getVarint())
4238
4431
  };
4239
4432
  }
4240
- function Hn(e) {
4433
+ function zn(e) {
4241
4434
  const t = Number(e.getVarint()), n = [];
4242
- for (let s = 0; s < t; s++) n.push(vi(e));
4435
+ for (let s = 0; s < t; s++) n.push(Fi(e));
4243
4436
  return n;
4244
4437
  }
4245
- function Di(e) {
4438
+ function Gi(e) {
4246
4439
  return {
4247
4440
  peerEndpointId: e.getString(),
4248
4441
  alias: e.getVarint(),
4249
- codec: tt(e.getVarint())
4442
+ codec: nt(e.getVarint())
4250
4443
  };
4251
4444
  }
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));
4445
+ function Bi(e) {
4446
+ const t = e.getVarint(), n = jn(e.getVarint()), s = e.getVarint() !== 0n, r = Number(e.getVarint()), i = [];
4447
+ for (let a = 0; a < r; a++) i.push(Gi(e));
4255
4448
  return { sessionSeq: t, mute: n, held: s, peers: i };
4256
4449
  }
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();
4450
+ function Yi(e) {
4451
+ const t = new X();
4452
+ return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putString(e.sdkName), t.putString(e.sdkVersion), Hn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
4260
4453
  }
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();
4454
+ function $i(e) {
4455
+ const t = new X();
4456
+ return t.putVarint(e.requestId), Hn(e.offers, t), t.putVarint(e.frameSizeMs), t.toUint8Array();
4264
4457
  }
4265
- function Mi(e) {
4266
- const t = new Y();
4267
- return t.putVarint(e.requestId), t.putVarint(ki(e.scope)), t.toUint8Array();
4458
+ function Xi(e) {
4459
+ const t = new X();
4460
+ return t.putVarint(e.requestId), t.putVarint(Ui(e.scope)), t.toUint8Array();
4268
4461
  }
4269
- function Vi(e) {
4270
- const t = new Y();
4462
+ function Ki(e) {
4463
+ const t = new X();
4271
4464
  return t.putVarint(e.requestId), t.putLengthPrefixedBytes(e.callToken), t.putVarint(e.lastEventSeq), t.toUint8Array();
4272
4465
  }
4273
- function Bi(e) {
4466
+ function Wi(e) {
4274
4467
  return {
4275
4468
  requestId: e.getVarint(),
4276
4469
  serverEpochUnix: e.getVarint(),
4277
4470
  canonicalPcmRate: Number(e.getVarint()),
4278
- bindings: qn(e),
4279
- rejected: Hn(e)
4471
+ bindings: Zn(e),
4472
+ rejected: zn(e)
4280
4473
  };
4281
4474
  }
4282
- function Pi(e) {
4475
+ function ji(e) {
4283
4476
  return {
4284
4477
  requestId: e.getVarint(),
4285
- bindings: qn(e),
4286
- rejected: Hn(e)
4478
+ bindings: Zn(e),
4479
+ rejected: zn(e)
4287
4480
  };
4288
4481
  }
4289
- function Fi(e) {
4482
+ function qi(e) {
4290
4483
  return { requestId: e.getVarint() };
4291
4484
  }
4292
- function Gi(e) {
4485
+ function Hi(e) {
4293
4486
  return {
4294
4487
  requestId: e.getVarint(),
4295
- state: Li(e)
4488
+ state: Bi(e)
4296
4489
  };
4297
4490
  }
4298
- function Yi(e) {
4491
+ function Zi(e) {
4299
4492
  return {
4300
4493
  requestId: e.getVarint(),
4301
4494
  peerEndpointId: e.getString(),
4302
4495
  alias: e.getVarint(),
4303
- class: Ni(e.getVarint()),
4304
- purpose: Ti(e.getVarint()),
4305
- codec: tt(e.getVarint()),
4496
+ class: vi(e.getVarint()),
4497
+ purpose: Ci(e.getVarint()),
4498
+ codec: nt(e.getVarint()),
4306
4499
  frameSizeMs: Number(e.getVarint())
4307
4500
  };
4308
4501
  }
4309
- function $i(e) {
4502
+ function zi(e) {
4310
4503
  return {
4311
4504
  requestId: e.getVarint(),
4312
4505
  peerEndpointId: e.getString()
4313
4506
  };
4314
4507
  }
4315
- function Ki(e) {
4508
+ function Qi(e) {
4316
4509
  return {
4317
4510
  requestId: e.getVarint(),
4318
4511
  endpointId: e.getString(),
4319
- scope: Xn(e.getVarint()),
4320
- origin: Wn(e.getVarint())
4512
+ scope: jn(e.getVarint()),
4513
+ origin: qn(e.getVarint())
4321
4514
  };
4322
4515
  }
4323
- function Xi(e) {
4516
+ function Ji(e) {
4324
4517
  return {
4325
4518
  requestId: e.getVarint(),
4326
4519
  endpointId: e.getString(),
4327
- reason: Ai(e.getVarint()),
4328
- origin: Wn(e.getVarint())
4520
+ reason: Li(e.getVarint()),
4521
+ origin: qn(e.getVarint())
4329
4522
  };
4330
4523
  }
4331
- function Wi(e) {
4524
+ function ea(e) {
4332
4525
  return {
4333
4526
  requestId: e.getVarint(),
4334
4527
  peerEndpointId: e.getString(),
4335
- state: _i(e.getVarint())
4528
+ state: Mi(e.getVarint())
4336
4529
  };
4337
4530
  }
4338
- function ji(e) {
4531
+ function ta(e) {
4339
4532
  const t = e.getVarint();
4340
4533
  let n;
4341
4534
  if (t === 0n)
@@ -4345,9 +4538,9 @@ function ji(e) {
4345
4538
  else
4346
4539
  throw new y(`MoqError.request_id present tag ${t} not in {0,1}`);
4347
4540
  const s = e.getVarint(), r = e.getString();
4348
- return { requestId: n, code: qi(s), rawCode: s, detail: r };
4541
+ return { requestId: n, code: na(s), rawCode: s, detail: r };
4349
4542
  }
4350
- function qi(e) {
4543
+ function na(e) {
4351
4544
  switch (e) {
4352
4545
  case 0x1001n:
4353
4546
  return "endpointNotProvisioned";
@@ -4375,7 +4568,7 @@ function qi(e) {
4375
4568
  return null;
4376
4569
  }
4377
4570
  }
4378
- const Hi = /* @__PURE__ */ new Set([
4571
+ const sa = /* @__PURE__ */ new Set([
4379
4572
  "sessionEnded",
4380
4573
  "tokenInvalid",
4381
4574
  "tokenExpired",
@@ -4384,7 +4577,7 @@ const Hi = /* @__PURE__ */ new Set([
4384
4577
  "endpointAlreadyConnected",
4385
4578
  "replayLost"
4386
4579
  ]);
4387
- class me {
4580
+ class be {
4388
4581
  constructor(t, n, s, r, i) {
4389
4582
  this.wt = t, this.controlWriter = n, this.controlReader = s, this.datagramWriter = r, this.datagramReader = i;
4390
4583
  }
@@ -4403,7 +4596,7 @@ class me {
4403
4596
  } catch {
4404
4597
  }
4405
4598
  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(
4599
+ return new be(
4407
4600
  n,
4408
4601
  r,
4409
4602
  i,
@@ -4413,7 +4606,7 @@ class me {
4413
4606
  }
4414
4607
  /** Encode + write one control frame. Honours WT backpressure. */
4415
4608
  async sendControl(t) {
4416
- const n = bi(t);
4609
+ const n = Si(t);
4417
4610
  await this.controlWriter.ready, await this.controlWriter.write(n);
4418
4611
  }
4419
4612
  /**
@@ -4425,7 +4618,7 @@ class me {
4425
4618
  let t = new Uint8Array(0);
4426
4619
  for (; ; ) {
4427
4620
  for (; ; ) {
4428
- const i = gi(t);
4621
+ const i = ki(t);
4429
4622
  if (!i) break;
4430
4623
  yield i.msg, t = t.subarray(i.consumed);
4431
4624
  }
@@ -4500,8 +4693,8 @@ class me {
4500
4693
  }
4501
4694
  }
4502
4695
  }
4503
- const Zi = 2e3;
4504
- class Ji {
4696
+ const ra = 2e3;
4697
+ class ia {
4505
4698
  constructor(t) {
4506
4699
  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
4700
  wasmUrl: t.wasmUrl,
@@ -4711,7 +4904,7 @@ class Ji {
4711
4904
  const n = ++this.captureCommandId, s = new Promise((r, i) => {
4712
4905
  const a = setTimeout(() => {
4713
4906
  this.captureAcks.get(n)?.expected === t && (this.captureAcks.delete(n), i(new Error(`${t} acknowledgement timed out`)));
4714
- }, Zi);
4907
+ }, ra);
4715
4908
  this.captureAcks.set(n, { expected: t, resolve: r, reject: i, timeout: a });
4716
4909
  });
4717
4910
  return { commandId: n, ack: s };
@@ -4738,16 +4931,16 @@ class Ji {
4738
4931
  }
4739
4932
  }
4740
4933
  }
4741
- const Qt = [100, 250, 500, 1e3], zi = 1e4, Qi = 50;
4742
- function en(e, t) {
4934
+ const en = [100, 250, 500, 1e3], aa = 1e4, oa = 50;
4935
+ function tn(e, t) {
4743
4936
  return new URL(t, e.endsWith("/") ? e : `${e}/`).href;
4744
4937
  }
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 {
4938
+ const ca = new URL("./audio/wasm-gen/origon_web_audio_bg.wasm?no-inline", import.meta.url).href, ua = new URL("./audio/audio-processor.js?no-inline", import.meta.url).href;
4939
+ class la {
4747
4940
  constructor(t, n) {
4748
4941
  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({
4942
+ const s = n.assetBaseUrl ? tn(n.assetBaseUrl, "audio/wasm-gen/origon_web_audio_bg.wasm") : ca, r = n.assetBaseUrl ? tn(n.assetBaseUrl, "audio/audio-processor.js") : ua;
4943
+ this.host = new ia({
4751
4944
  wasmUrl: s,
4752
4945
  processorUrl: r,
4753
4946
  onStats: (i) => this.handleHostStats(i),
@@ -4762,7 +4955,7 @@ class na {
4762
4955
  const n = this.startGeneration;
4763
4956
  this.assertStartActive(n), await this.host.start(), this.assertStartActive(n), this.host.onOutboundDatagram((s) => {
4764
4957
  this.diagTx += 1, this.diagTx === 1 || this.diagTx % 100;
4765
- const r = zt(ne.AudioObject, s);
4958
+ const r = Jt(ie.AudioObject, s);
4766
4959
  this.transport?.sendDatagram(r).catch(() => {
4767
4960
  });
4768
4961
  }), this.host.onDownlinkFeedback((s) => {
@@ -4772,7 +4965,7 @@ class na {
4772
4965
  if (r += 2, r + i > s.length) break;
4773
4966
  const a = s.subarray(r, r + i);
4774
4967
  r += i;
4775
- const o = zt(ne.AudioFeedback, a);
4968
+ const o = Jt(ie.AudioFeedback, a);
4776
4969
  this.transport?.sendDatagram(o).catch(() => {
4777
4970
  });
4778
4971
  }
@@ -4856,7 +5049,7 @@ class na {
4856
5049
  }
4857
5050
  // ── Connect handshake + read pumps ───────────────────────────────────
4858
5051
  async dial(t, n) {
4859
- const s = await me.open(this.url);
5052
+ const s = await be.open(this.url);
4860
5053
  if (!this.isStartActive(n))
4861
5054
  throw s.close({ closeCode: 0, reason: "session start cancelled" }), new Error("voice session start cancelled");
4862
5055
  this.transport = s, this.transport.startUniStreamDrain(), this.startReadLoops();
@@ -4903,19 +5096,19 @@ class na {
4903
5096
  for await (const n of t.readDatagrams()) {
4904
5097
  let s;
4905
5098
  try {
4906
- const r = pi(n);
4907
- if (r.cls === ne.AudioFeedback) {
5099
+ const r = Ti(n);
5100
+ if (r.cls === ie.AudioFeedback) {
4908
5101
  this.host.pushUplinkFeedback(r.body);
4909
5102
  continue;
4910
5103
  }
4911
- if (r.cls !== ne.AudioObject)
5104
+ if (r.cls !== ie.AudioObject)
4912
5105
  continue;
4913
5106
  s = r.body;
4914
5107
  } catch {
4915
5108
  continue;
4916
5109
  }
4917
5110
  try {
4918
- const r = mi(s);
5111
+ const r = Ni(s);
4919
5112
  this.diagRx += 1, this.diagRx === 1 || this.diagRx % 100;
4920
5113
  } catch {
4921
5114
  }
@@ -4936,7 +5129,7 @@ class na {
4936
5129
  }
4937
5130
  if ("requestId" in t.data) {
4938
5131
  const s = t.data.requestId;
4939
- s !== null && s !== 0n && (this.lastEventSeq = sa(this.lastEventSeq, s));
5132
+ s !== null && s !== 0n && (this.lastEventSeq = da(this.lastEventSeq, s));
4940
5133
  }
4941
5134
  switch (t.type) {
4942
5135
  case "peerAttached": {
@@ -4969,10 +5162,10 @@ class na {
4969
5162
  }
4970
5163
  case "moqError": {
4971
5164
  const s = t.data.code;
4972
- if (s === null || Hi.has(s)) {
5165
+ if (s === null || sa.has(s)) {
4973
5166
  const i = s ?? "unknown";
4974
5167
  this.enterTerminalState(
4975
- s === null ? { kind: "protocolViolation" } : ra(s),
5168
+ s === null ? { kind: "protocolViolation" } : ha(s),
4976
5169
  new Error(`terminal MoqError ${i}`),
4977
5170
  `terminal MoqError ${i}`
4978
5171
  );
@@ -5005,20 +5198,20 @@ class na {
5005
5198
  if (this.rejectPendingRequestsForTransport(
5006
5199
  t,
5007
5200
  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) {
5201
+ ), this.closedTransports.add(t), this.host.cancelCaptureTransition(!1), this.localCaptureEnabled || (this.captureGeneration += 1, this.host.cancelCaptureTransition(!0)), await W(oa), this.terminalReason) {
5009
5202
  this.host.dispose().catch(() => {
5010
5203
  }), this.onTerminal(this.terminalReason, this.sessionId);
5011
5204
  return;
5012
5205
  }
5013
5206
  this.transport === t && (this.transport = null);
5014
- for (let r = 1; r <= Qt.length && this.isStartActive(n); r++) {
5015
- const i = Qt[r - 1];
5207
+ for (let r = 1; r <= en.length && this.isStartActive(n); r++) {
5208
+ const i = en[r - 1];
5016
5209
  this.dispatcher.fire("onReconnecting", this.sessionId, "voice", {
5017
5210
  attempt: r,
5018
5211
  reason: { kind: "networkLoss" }
5019
5212
  });
5020
5213
  try {
5021
- await oe(i), this.assertStartActive(n), await this.attemptResume(n), this.assertStartActive(n), this.dispatcher.fire("onReconnected", this.sessionId, "voice"), this.watchTransportClosed();
5214
+ await W(i), this.assertStartActive(n), await this.attemptResume(n), this.assertStartActive(n), this.dispatcher.fire("onReconnected", this.sessionId, "voice"), this.watchTransportClosed();
5022
5215
  return;
5023
5216
  } catch {
5024
5217
  if (this.terminalReason)
@@ -5030,7 +5223,7 @@ class na {
5030
5223
  }), this.onTerminal(s, this.sessionId);
5031
5224
  }
5032
5225
  async attemptResume(t) {
5033
- const n = await me.open(this.url);
5226
+ const n = await be.open(this.url);
5034
5227
  if (!this.isStartActive(t))
5035
5228
  throw n.close({ closeCode: 0, reason: "session reconnect cancelled" }), new Error("voice session start cancelled");
5036
5229
  this.transport = n, this.transport.startUniStreamDrain(), this.startReadLoops();
@@ -5116,7 +5309,7 @@ class na {
5116
5309
  }
5117
5310
  const a = setTimeout(() => {
5118
5311
  this.pendingRequests.delete(t) && r(new Error(`request ${t} timed out`));
5119
- }, zi);
5312
+ }, aa);
5120
5313
  this.pendingRequests.set(t, {
5121
5314
  transport: i,
5122
5315
  resolve: (o) => {
@@ -5141,7 +5334,7 @@ class na {
5141
5334
  /** Outbound datagram payload — for tests / external pumps. */
5142
5335
  encodeAudioObject(t) {
5143
5336
  if (this.uplinkAlias === null) throw new Error("uplink alias not negotiated");
5144
- return fi({
5337
+ return Ii({
5145
5338
  trackAlias: this.uplinkAlias,
5146
5339
  groupId: t.groupId,
5147
5340
  objectId: t.objectId,
@@ -5154,10 +5347,10 @@ class na {
5154
5347
  return this.currentMuteScope;
5155
5348
  }
5156
5349
  }
5157
- function sa(e, t) {
5350
+ function da(e, t) {
5158
5351
  return e > t ? e : t;
5159
5352
  }
5160
- function ra(e) {
5353
+ function ha(e) {
5161
5354
  switch (e) {
5162
5355
  case "sessionEnded":
5163
5356
  return { kind: "sessionEnded" };
@@ -5183,17 +5376,20 @@ function ra(e) {
5183
5376
  return { kind: "replayLost" };
5184
5377
  }
5185
5378
  }
5186
- class ia {
5379
+ class fa {
5187
5380
  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();
5381
+ this.config = null, this.http = null, this.sessionHttp = null, this.dispatcher = new Qn(), this.sessions = /* @__PURE__ */ new Map(), this.pendingUploads = /* @__PURE__ */ new Map();
5189
5382
  }
5190
5383
  // ── Lifecycle ────────────────────────────────────────────────────────
5191
5384
  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({
5385
+ if (!t.endpoint) throw h.missingField("endpoint");
5386
+ const n = t.attachmentBaseUrl === void 0 ? void 0 : ba(t.endpoint, t.attachmentBaseUrl);
5387
+ if (n !== void 0 && !t.token)
5388
+ throw h.missingField("token");
5389
+ 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 ?? fi(), this.http = new ri({
5194
5390
  endpoint: t.endpoint,
5195
5391
  ...t.token ? { token: t.token } : {}
5196
- }), this.sessionHttp = new ei(this.http, this.userId);
5392
+ }), this.sessionHttp = new ii(this.http, this.userId);
5197
5393
  }
5198
5394
  async authenticate() {
5199
5395
  const n = await this.requireSessionHttp().postConfig();
@@ -5228,8 +5424,8 @@ class ia {
5228
5424
  async startSession(t) {
5229
5425
  const n = this.requireSessionHttp();
5230
5426
  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 };
5427
+ throw h.other(`session already active: ${t.sessionId}`);
5428
+ const s = ma(this.attributes, t.data), r = { channel: t.channel };
5233
5429
  t.sessionId && (r.sessionId = t.sessionId), s && (r.data = s);
5234
5430
  const i = await n.startSession(r);
5235
5431
  return t.channel, await this.attachSession(i, t.channel), { sessionId: i.sessionId };
@@ -5244,13 +5440,22 @@ class ia {
5244
5440
  */
5245
5441
  async joinSession(t) {
5246
5442
  if (this.requireSessionHttp(), this.sessions.has(t.sessionId))
5247
- throw f.other(`session already active: ${t.sessionId}`);
5248
- const n = {
5443
+ throw h.other(`session already active: ${t.sessionId}`);
5444
+ if (t.channel === "voice" && t.chat !== void 0)
5445
+ throw h.other('chat join options require channel "chat"');
5446
+ if (t.channel === "chat" && t.voice !== void 0)
5447
+ throw h.other('voice join options require channel "voice"');
5448
+ const n = t.channel === "chat" ? pa(t.chat?.recovery) : void 0, s = {
5249
5449
  sessionId: t.sessionId,
5250
5450
  url: t.url,
5251
5451
  token: t.token
5252
5452
  };
5253
- return await this.attachSession(n, t.channel, t.voice?.receiveOnly ?? !1), { sessionId: t.sessionId };
5453
+ return await this.attachSession(
5454
+ s,
5455
+ t.channel,
5456
+ t.voice?.receiveOnly ?? !1,
5457
+ n
5458
+ ), { sessionId: t.sessionId };
5254
5459
  }
5255
5460
  /**
5256
5461
  * Shared core: construct the per-channel session from a
@@ -5262,50 +5467,51 @@ class ia {
5262
5467
  * after `start()`; voice fires it from inside `VoiceSession.dial()` once
5263
5468
  * the MoQ `ConnectOk` lands — so this method must NOT fire it for voice.
5264
5469
  */
5265
- async attachSession(t, n, s = !1) {
5470
+ async attachSession(t, n, s = !1, r) {
5266
5471
  if (n === "voice") {
5267
- const i = new na(t, {
5472
+ const a = new la(t, {
5268
5473
  dispatcher: this.dispatcher,
5269
5474
  // `sessionId` is the session's *current* id (post-`rename()`), not the
5270
5475
  // one captured at construction — so a migrated session tears down its
5271
5476
  // real map entry instead of orphaning it.
5272
- onTerminal: (a, o) => {
5273
- this.sessions.delete(o), this.dispatcher.fire("onDisconnected", o, "voice", { reason: a });
5477
+ onTerminal: (o, l) => {
5478
+ this.sessions.delete(l), this.dispatcher.fire("onDisconnected", l, "voice", { reason: o });
5274
5479
  },
5275
5480
  assetBaseUrl: this.assetBaseUrl
5276
5481
  });
5277
- this.sessions.set(t.sessionId, { kind: "voice", session: i }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "voice");
5482
+ this.sessions.set(t.sessionId, { kind: "voice", session: a }), this.dispatcher.fire("onSessionUpdated", t.sessionId, "voice");
5278
5483
  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);
5484
+ await a.start({ receiveOnly: s });
5485
+ } catch (o) {
5486
+ for (const [l, u] of this.sessions)
5487
+ if (u.session === a) {
5488
+ this.sessions.delete(l);
5284
5489
  break;
5285
5490
  }
5286
5491
  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 });
5492
+ await a.disconnect();
5493
+ } catch (l) {
5494
+ const u = o instanceof Error ? o : Object.assign(new Error("voice session start failed"), { startError: o });
5495
+ throw Object.assign(u, { cleanupError: l });
5291
5496
  }
5292
- throw a;
5497
+ throw o;
5293
5498
  }
5294
5499
  return;
5295
5500
  }
5296
- const r = new zr(t, {
5501
+ const i = new si(t, {
5297
5502
  sessionHttp: this.requireSessionHttp(),
5503
+ provisionedRecovery: r,
5298
5504
  dispatcher: this.dispatcher,
5299
5505
  // 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 });
5506
+ onTerminal: (a, o) => {
5507
+ this.sessions.delete(o), this.dispatcher.fire("onDisconnected", o, "chat", { reason: a });
5302
5508
  }
5303
5509
  });
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");
5510
+ 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
5511
  }
5306
5512
  async endSession(t) {
5307
5513
  const n = this.sessions.get(t);
5308
- if (!n) throw f.noSession(t);
5514
+ if (!n) throw h.noSession(t);
5309
5515
  await n.session.disconnect();
5310
5516
  }
5311
5517
  async endAllSessions() {
@@ -5336,8 +5542,8 @@ class ia {
5336
5542
  sendMessage(t, n) {
5337
5543
  return this.requireChatSession(t).sendMessage(n);
5338
5544
  }
5339
- notifyTyping(t) {
5340
- this.requireChatSession(t).notifyTyping();
5545
+ notifyTyping(t, n) {
5546
+ this.requireChatSession(t).notifyTyping(n);
5341
5547
  }
5342
5548
  stopTyping(t) {
5343
5549
  this.requireChatSession(t).stopTyping();
@@ -5371,32 +5577,33 @@ class ia {
5371
5577
  }
5372
5578
  // ── Attachments ──────────────────────────────────────────────────────
5373
5579
  /**
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.
5580
+ * Upload an attachment. It remains session-less: widget callers use the
5581
+ * tokenless endpoint lane, while an explicit same-origin attachmentBaseUrl
5582
+ * selects the authenticated agent lane and uses the top-level token.
5377
5583
  * Needs `authenticate()` only for the local policy precheck (absent config
5378
5584
  * defers the whole decision to the server).
5379
5585
  */
5380
5586
  async uploadAttachment(t, n) {
5381
- const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = si(t, r);
5587
+ const s = this.requireHttp(), r = this.config?.attachmentPolicy, i = di(t, r);
5382
5588
  if (!i.ok) throw i.error;
5383
5589
  const a = new AbortController();
5384
5590
  this.pendingUploads.set(n.uploadId, a);
5385
5591
  try {
5386
- const o = oa(a.signal, n.signal);
5387
- return await ni(s.buildAbsoluteUrl("/attachment/upload"), t, {
5388
- ...n,
5389
- signal: o
5390
- });
5592
+ const o = Ea(a.signal, n.signal), l = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
5593
+ return await oi(
5594
+ `${l}/upload`,
5595
+ t,
5596
+ { ...n, signal: o },
5597
+ this.attachmentBearer
5598
+ );
5391
5599
  } finally {
5392
5600
  this.pendingUploads.delete(n.uploadId);
5393
5601
  }
5394
5602
  }
5395
5603
  /**
5396
5604
  * 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.
5605
+ * pending `uploadId`) OR DELETE a stored attachment by id. The route/auth
5606
+ * lane matches upload: explicit base is authenticated; widget is tokenless.
5400
5607
  */
5401
5608
  async deleteAttachment(t) {
5402
5609
  const n = this.pendingUploads.get(t);
@@ -5404,62 +5611,119 @@ class ia {
5404
5611
  n.abort(), this.pendingUploads.delete(t);
5405
5612
  return;
5406
5613
  }
5407
- const s = this.requireHttp();
5614
+ const s = this.requireHttp(), r = this.attachmentBaseUrl ?? s.buildAbsoluteUrl("/attachment");
5408
5615
  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: "" }
5616
+ `${r}/${encodeURIComponent(t)}`,
5617
+ // Explicit base opts into the existing top-level bearer. The widget
5618
+ // lane always suppresses it, even when initialize received a token.
5619
+ { bearer: this.attachmentBaseUrl === void 0 ? "" : this.attachmentBearer ?? "" }
5413
5620
  );
5414
5621
  }
5415
5622
  // ── Internal ─────────────────────────────────────────────────────────
5416
5623
  requireChatSession(t) {
5417
5624
  const n = this.sessions.get(t);
5418
- if (!n) throw f.noSession(t);
5625
+ if (!n) throw h.noSession(t);
5419
5626
  if (n.kind !== "chat")
5420
- throw f.other(`session ${t} is a voice session, not chat`);
5627
+ throw h.other(`session ${t} is a voice session, not chat`);
5421
5628
  return n.session;
5422
5629
  }
5423
5630
  requireVoiceSession(t) {
5424
5631
  const n = this.sessions.get(t);
5425
- if (!n) throw f.noSession(t);
5632
+ if (!n) throw h.noSession(t);
5426
5633
  if (n.kind !== "voice")
5427
- throw f.other(`session ${t} is a chat session, not voice`);
5634
+ throw h.other(`session ${t} is a chat session, not voice`);
5428
5635
  return n.session;
5429
5636
  }
5430
5637
  requireSessionHttp() {
5431
- if (!this.sessionHttp) throw f.notInitialized();
5638
+ if (!this.sessionHttp) throw h.notInitialized();
5432
5639
  return this.sessionHttp;
5433
5640
  }
5434
5641
  requireHttp() {
5435
- if (!this.http) throw f.notInitialized();
5642
+ if (!this.http) throw h.notInitialized();
5436
5643
  return this.http;
5437
5644
  }
5438
5645
  }
5439
- let Re = null;
5440
- function ca() {
5441
- return Re || (Re = new ia()), Re;
5646
+ let Oe = null;
5647
+ function ya() {
5648
+ return Oe || (Oe = new fa()), Oe;
5442
5649
  }
5443
- function aa(e, t) {
5650
+ function ma(e, t) {
5444
5651
  if (!(!e && !t))
5445
5652
  return e ? t ? { ...t, attributes: { ...e, ...t.attributes } } : { attributes: e } : t;
5446
5653
  }
5447
- function oa(e, t) {
5654
+ function pa(e) {
5655
+ if (e !== void 0) {
5656
+ if (e.replay !== "server")
5657
+ throw h.other('provisioned chat recovery requires replay "server"');
5658
+ if (e.delaysMs.length < 1 || e.delaysMs.length > 8 || e.delaysMs.some((t) => !Number.isFinite(t) || t < 0))
5659
+ throw h.other(
5660
+ "provisioned chat recovery delaysMs must contain 1–8 finite, non-negative values"
5661
+ );
5662
+ return { ...e, delaysMs: [...e.delaysMs] };
5663
+ }
5664
+ }
5665
+ function ba(e, t) {
5666
+ let n, s;
5667
+ try {
5668
+ n = new URL(e), s = new URL(t, n);
5669
+ } catch {
5670
+ throw h.other("invalid attachmentBaseUrl");
5671
+ }
5672
+ if (t.trim() === "" || t.trim() !== t || !t.startsWith("/") && !/^https?:\/\//.test(t) || ga(t) || s.protocol !== "https:" && s.protocol !== "http:" || s.origin !== n.origin || s.username !== "" || s.password !== "" || s.search !== "" || s.hash !== "" || s.pathname === "/")
5673
+ throw h.other("attachmentBaseUrl must be an HTTP(S) path on the endpoint origin");
5674
+ return s.toString().replace(/\/$/, "");
5675
+ }
5676
+ function ga(e) {
5677
+ let t = e;
5678
+ for (let r = e.length + 1; r > 0; r -= 1) {
5679
+ if (t.includes("\\")) return !0;
5680
+ let i;
5681
+ try {
5682
+ i = decodeURIComponent(t);
5683
+ } catch {
5684
+ return !0;
5685
+ }
5686
+ if (i === t) break;
5687
+ t = i;
5688
+ }
5689
+ let n;
5690
+ if (e.startsWith("/"))
5691
+ n = e.split(/[?#]/, 1)[0];
5692
+ else {
5693
+ const r = e.indexOf("://") + 3, i = e.indexOf("/", r);
5694
+ n = i === -1 ? "/" : e.slice(i).split(/[?#]/, 1)[0];
5695
+ }
5696
+ let s = n;
5697
+ for (let r = e.length + 1; r > 0; r -= 1) {
5698
+ if (s.includes("\\") || s.split("/").some((a) => a === "." || a === ".."))
5699
+ return !0;
5700
+ let i;
5701
+ try {
5702
+ i = decodeURIComponent(s);
5703
+ } catch {
5704
+ return !0;
5705
+ }
5706
+ if (i === s) return !1;
5707
+ s = i;
5708
+ }
5709
+ return !0;
5710
+ }
5711
+ function Ea(e, t) {
5448
5712
  if (!t) return e;
5449
5713
  const n = new AbortController(), s = () => n.abort();
5450
5714
  return e.aborted || t.aborted ? (n.abort(), n.signal) : (e.addEventListener("abort", s, { once: !0 }), t.addEventListener("abort", s, { once: !0 }), n.signal);
5451
5715
  }
5452
- const ua = {
5716
+ const wa = {
5453
5717
  AI: "ai",
5454
5718
  EXTERNAL: "external",
5455
5719
  USER: "user",
5456
5720
  SYSTEM: "system"
5457
5721
  };
5458
5722
  export {
5459
- f as ClientError,
5460
- ua as MESSAGE_ROLES,
5461
- k as OrpcError,
5462
- ia as SessionManager,
5463
- ca as getSessionManager
5723
+ h as ClientError,
5724
+ wa as MESSAGE_ROLES,
5725
+ T as OrpcError,
5726
+ fa as SessionManager,
5727
+ ya as getSessionManager
5464
5728
  };
5465
5729
  //# sourceMappingURL=origon-web-sdk.js.map