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