@vanira/sdk 0.0.87 → 0.0.90

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.
@@ -81,7 +81,7 @@ class pd {
81
81
  };
82
82
  }
83
83
  }
84
- const js = "https://api.vanira.io", N = {
84
+ const js = "https://api.vanira.io", x = {
85
85
  Form: "vanira_form",
86
86
  Calendar: "vanira_calendar",
87
87
  Navigate: "vanira_navigate",
@@ -108,7 +108,16 @@ const js = "https://api.vanira.io", N = {
108
108
  KycDocumentCapture: "vanira_kyc_document_capture",
109
109
  KycSelfieCapture: "vanira_kyc_selfie_capture",
110
110
  KycSignatureCapture: "vanira_kyc_signature_capture"
111
- }, fd = Object.values(N), md = new Set(fd);
111
+ }, fd = Object.values(x), md = new Set(fd), gd = /* @__PURE__ */ new Set([
112
+ x.KycDocumentCapture,
113
+ x.KycSelfieCapture,
114
+ x.KycSignatureCapture
115
+ ]);
116
+ [
117
+ ...gd,
118
+ x.Form,
119
+ x.Upload
120
+ ];
112
121
  function Sr(i) {
113
122
  return !!i && md.has(i);
114
123
  }
@@ -122,67 +131,67 @@ function Ya(i) {
122
131
  return i && typeof i == "object" ? i : {};
123
132
  }
124
133
  const Cr = {
125
- type_on_whiteboard: N.TypeText,
126
- write_on_whiteboard: N.TypeText,
127
- write_on_white_board: N.TypeText,
128
- dom_typing_simulation: N.TypeText,
129
- write_latex_text: N.WriteLatexText,
130
- write_latex_on_board: N.WriteLatexText,
131
- latex_on_whiteboard: N.WriteLatexText,
132
- show_geogebra: N.GeoGebra,
133
- geogebra_diagram: N.GeoGebra,
134
- geogebra: N.GeoGebra,
135
- erase_text: N.EraseText,
136
- dom_erase: N.EraseText,
137
- open_live_camera: N.LiveVision,
138
- live_vision: N.LiveVision,
139
- close_live_camera: N.CloseLiveCamera,
140
- stop_live_camera: N.CloseLiveCamera,
141
- open_live_screen: N.LiveScreen,
142
- close_live_screen: N.CloseLiveScreen,
143
- screen_vision: N.ScreenVision,
144
- capture_screen_vision: N.ScreenVision,
145
- capture_screen: N.ScreenVision,
146
- tab_screenshot: N.ScreenVision,
147
- capture_tab: N.ScreenVision,
148
- capture_tab_screenshot: N.ScreenVision,
149
- screenshot_tab: N.ScreenVision,
150
- point_at: N.PointAt,
151
- point_at_screen: N.PointAt,
152
- draw_on_screen: N.DrawOnScreen,
153
- screen_draw: N.DrawOnScreen,
154
- clear_screen_draw: N.ClearScreenDraw,
155
- clear_screen_annotations: N.ClearScreenDraw,
156
- highlight_on_screen: N.HighlightOnScreen,
157
- highlight_element_on_screen: N.HighlightOnScreen,
158
- highlight_screen_element: N.HighlightOnScreen,
159
- kyc_document_capture: N.KycDocumentCapture,
160
- capture_id_document: N.KycDocumentCapture,
161
- document_capture: N.KycDocumentCapture,
162
- capture_kyc_document: N.KycDocumentCapture,
163
- kyc_selfie_capture: N.KycSelfieCapture,
164
- capture_selfie: N.KycSelfieCapture,
165
- selfie_capture: N.KycSelfieCapture,
166
- capture_kyc_selfie: N.KycSelfieCapture,
167
- kyc_signature_capture: N.KycSignatureCapture,
168
- capture_kyc_signature: N.KycSignatureCapture,
169
- signature_capture: N.KycSignatureCapture
134
+ type_on_whiteboard: x.TypeText,
135
+ write_on_whiteboard: x.TypeText,
136
+ write_on_white_board: x.TypeText,
137
+ dom_typing_simulation: x.TypeText,
138
+ write_latex_text: x.WriteLatexText,
139
+ write_latex_on_board: x.WriteLatexText,
140
+ latex_on_whiteboard: x.WriteLatexText,
141
+ show_geogebra: x.GeoGebra,
142
+ geogebra_diagram: x.GeoGebra,
143
+ geogebra: x.GeoGebra,
144
+ erase_text: x.EraseText,
145
+ dom_erase: x.EraseText,
146
+ open_live_camera: x.LiveVision,
147
+ live_vision: x.LiveVision,
148
+ close_live_camera: x.CloseLiveCamera,
149
+ stop_live_camera: x.CloseLiveCamera,
150
+ open_live_screen: x.LiveScreen,
151
+ close_live_screen: x.CloseLiveScreen,
152
+ screen_vision: x.ScreenVision,
153
+ capture_screen_vision: x.ScreenVision,
154
+ capture_screen: x.ScreenVision,
155
+ tab_screenshot: x.ScreenVision,
156
+ capture_tab: x.ScreenVision,
157
+ capture_tab_screenshot: x.ScreenVision,
158
+ screenshot_tab: x.ScreenVision,
159
+ point_at: x.PointAt,
160
+ point_at_screen: x.PointAt,
161
+ draw_on_screen: x.DrawOnScreen,
162
+ screen_draw: x.DrawOnScreen,
163
+ clear_screen_draw: x.ClearScreenDraw,
164
+ clear_screen_annotations: x.ClearScreenDraw,
165
+ highlight_on_screen: x.HighlightOnScreen,
166
+ highlight_element_on_screen: x.HighlightOnScreen,
167
+ highlight_screen_element: x.HighlightOnScreen,
168
+ kyc_document_capture: x.KycDocumentCapture,
169
+ capture_id_document: x.KycDocumentCapture,
170
+ document_capture: x.KycDocumentCapture,
171
+ capture_kyc_document: x.KycDocumentCapture,
172
+ kyc_selfie_capture: x.KycSelfieCapture,
173
+ capture_selfie: x.KycSelfieCapture,
174
+ selfie_capture: x.KycSelfieCapture,
175
+ capture_kyc_selfie: x.KycSelfieCapture,
176
+ kyc_signature_capture: x.KycSignatureCapture,
177
+ capture_kyc_signature: x.KycSignatureCapture,
178
+ signature_capture: x.KycSignatureCapture
170
179
  }, _r = {
171
- vanira_tab_screenshot: N.ScreenVision,
172
- vanira_document_capture: N.KycDocumentCapture,
173
- vanira_selfie_capture: N.KycSelfieCapture,
174
- vanira_signature_capture: N.KycSignatureCapture,
175
- vanira_kyc_signature: N.KycSignatureCapture
180
+ vanira_tab_screenshot: x.ScreenVision,
181
+ vanira_document_capture: x.KycDocumentCapture,
182
+ vanira_selfie_capture: x.KycSelfieCapture,
183
+ vanira_signature_capture: x.KycSignatureCapture,
184
+ vanira_kyc_signature: x.KycSignatureCapture
176
185
  };
177
- function gd(i, e) {
186
+ function vd(i, e) {
178
187
  const t = i.commands ?? (e == null ? void 0 : e.commands) ?? i.construction ?? (e == null ? void 0 : e.construction) ?? i.geogebra_commands ?? (e == null ? void 0 : e.geogebra_commands) ?? i.script ?? (e == null ? void 0 : e.script);
179
188
  return Array.isArray(t) ? t.some((n) => String(n).trim().length > 0) : typeof t == "string" && t.trim().length > 0;
180
189
  }
181
- function vd(i, e) {
190
+ function bd(i, e) {
182
191
  const t = i.material_id ?? (e == null ? void 0 : e.material_id) ?? i.materialId ?? (e == null ? void 0 : e.materialId);
183
192
  return typeof t == "string" && t.trim().length > 0;
184
193
  }
185
- function bd(i, e) {
194
+ function yd(i, e) {
186
195
  const t = i.latex_text ?? (e == null ? void 0 : e.latex_text);
187
196
  return typeof t == "string" && t.trim().length > 0;
188
197
  }
@@ -190,11 +199,11 @@ function wr(i, e) {
190
199
  const t = i.text_to_type ?? (e == null ? void 0 : e.text_to_type) ?? i.text ?? (e == null ? void 0 : e.text) ?? i.value ?? (e == null ? void 0 : e.value);
191
200
  return typeof t == "string" && t.trim().length > 0;
192
201
  }
193
- function yd(i, e) {
202
+ function kd(i, e) {
194
203
  const t = i.fields ?? (e == null ? void 0 : e.fields);
195
204
  return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.split(",").map((n) => n.trim()).filter(Boolean).length > 0 : !1;
196
205
  }
197
- function kd(i, e) {
206
+ function Td(i, e) {
198
207
  const t = i == null ? void 0 : i.preset_id;
199
208
  if (typeof t == "string") {
200
209
  if (Sr(t)) return t;
@@ -208,21 +217,21 @@ function kd(i, e) {
208
217
  if (r) return r;
209
218
  }
210
219
  }
211
- function Td(i, e, t) {
220
+ function Sd(i, e, t) {
212
221
  const n = Ya(e);
213
- let s = kd(i, n);
214
- if (s === N.Form && wr(n, i) && !yd(n, i))
215
- return N.TypeText;
222
+ let s = Td(i, n);
223
+ if (s === x.Form && wr(n, i) && !kd(n, i))
224
+ return x.TypeText;
216
225
  if (s) return s;
217
226
  const r = String(t ?? "").trim().toLowerCase();
218
227
  if (r && Cr[r])
219
228
  return Cr[r];
220
- if (gd(n, i) || vd(n, i))
221
- return N.GeoGebra;
222
- if (bd(n, i))
223
- return N.WriteLatexText;
229
+ if (vd(n, i) || bd(n, i))
230
+ return x.GeoGebra;
231
+ if (yd(n, i))
232
+ return x.WriteLatexText;
224
233
  if (wr(n, i))
225
- return N.TypeText;
234
+ return x.TypeText;
226
235
  }
227
236
  const Zn = "vanira_latest_call_id", us = "vanira_prospect_id";
228
237
  function ei(i) {
@@ -272,7 +281,7 @@ function Er(i) {
272
281
  1
273
282
  ), n(ht(window.localStorage, Zn), a, 0), n(ht(window.sessionStorage, Zn), a, 0), e.length ? (e.sort((o, d) => d.updatedAt - o.updatedAt), e[0]) : null;
274
283
  }
275
- function Sd(i, e, t) {
284
+ function Cd(i, e, t) {
276
285
  var s, r, a, o, d, c, l, u, h;
277
286
  if (typeof window > "u" || !i || !e) return;
278
287
  const n = {
@@ -285,17 +294,17 @@ function Sd(i, e, t) {
285
294
  } catch {
286
295
  }
287
296
  }
288
- const ji = 16 * 1024, Cd = 256 * 1024;
297
+ const ji = 16 * 1024, _d = 256 * 1024;
289
298
  function Wi(i, e) {
290
299
  return (i == null ? void 0 : i.readyState) === "open" && (e == null ? void 0 : e.readyState) === "open";
291
300
  }
292
- function _d(i, e) {
301
+ function wd(i, e) {
293
302
  return {
294
303
  control: (i == null ? void 0 : i.readyState) ?? "missing",
295
304
  mediaBytes: (e == null ? void 0 : e.readyState) ?? "missing"
296
305
  };
297
306
  }
298
- async function wd(i, e, t = 8e3) {
307
+ async function Ed(i, e, t = 8e3) {
299
308
  if (Wi(i, e))
300
309
  return !0;
301
310
  const n = Date.now() + t;
@@ -307,10 +316,10 @@ async function wd(i, e, t = 8e3) {
307
316
  return Wi(i, e);
308
317
  }
309
318
  async function Pr(i) {
310
- for (; i.bufferedAmount > Cd; )
319
+ for (; i.bufferedAmount > _d; )
311
320
  await new Promise((e) => setTimeout(e, 10));
312
321
  }
313
- async function Ed(i) {
322
+ async function Pd(i) {
314
323
  const {
315
324
  bytes: e,
316
325
  filename: t,
@@ -353,14 +362,14 @@ async function Ed(i) {
353
362
  }
354
363
  }), { media_id: c, url: "", content_type: n };
355
364
  }
356
- async function Pd(i) {
365
+ async function Rd(i) {
357
366
  return typeof i.arrayBuffer == "function" ? i.arrayBuffer() : new Response(i).arrayBuffer();
358
367
  }
359
- const Rd = 15e3, hs = "vanira-connect-stall-prompt";
368
+ const Id = 15e3, hs = "vanira-connect-stall-prompt";
360
369
  let gn = null;
361
- function Id(i = Rd) {
370
+ function Md(i = Id) {
362
371
  typeof window > "u" || (pn(!1), gn = setTimeout(() => {
363
- gn = null, Md(), window.dispatchEvent(new CustomEvent("vanira:connect-stall"));
372
+ gn = null, Dd(), window.dispatchEvent(new CustomEvent("vanira:connect-stall"));
364
373
  }, i));
365
374
  }
366
375
  function pn(i = !0) {
@@ -370,7 +379,7 @@ function ps() {
370
379
  var i;
371
380
  typeof document > "u" || (i = document.getElementById(hs)) == null || i.remove();
372
381
  }
373
- function Md() {
382
+ function Dd() {
374
383
  var t, n;
375
384
  if (typeof document > "u" || document.getElementById(hs)) return;
376
385
  const i = document.createElement("div");
@@ -414,13 +423,13 @@ function Md() {
414
423
  ps(), window.location.reload();
415
424
  }), (n = e.querySelector("#vanira-stall-dismiss")) == null || n.addEventListener("click", () => ps());
416
425
  }
417
- function Dd(i) {
426
+ function Ad(i) {
418
427
  return null;
419
428
  }
420
429
  function Ln() {
421
430
  return typeof window > "u" ? "/" : `${window.location.pathname}${window.location.search}${window.location.hash}` || "/";
422
431
  }
423
- class Ad {
432
+ class Od {
424
433
  constructor(e) {
425
434
  D(this, "active", !1);
426
435
  D(this, "initialSent", !1);
@@ -501,7 +510,7 @@ class Ad {
501
510
  this.scheduleInitialContextSend();
502
511
  return;
503
512
  }
504
- !this.isReady() || Dd() || this.sendRouteContext("route_changed", n, t, "user");
513
+ !this.isReady() || Ad() || this.sendRouteContext("route_changed", n, t, "user");
505
514
  }
506
515
  sendRouteContext(e, t, n, s = "user") {
507
516
  const r = Ln();
@@ -530,6 +539,7 @@ const st = class st {
530
539
  D(this, "backendUrl");
531
540
  D(this, "token");
532
541
  D(this, "prospectName");
542
+ D(this, "welcomeMessage");
533
543
  D(this, "extraDetails");
534
544
  D(this, "onConnected");
535
545
  D(this, "onDisconnected");
@@ -564,6 +574,7 @@ const st = class st {
564
574
  D(this, "liveVision");
565
575
  D(this, "liveVisionAutoStarted", !1);
566
576
  D(this, "connectStallTimeoutMs");
577
+ var d;
567
578
  if (!e.agentId) throw new Error("agentId is required");
568
579
  const t = !!(e.apiKey || e.token), n = !!(e.serverUrl && e.callId), s = st.normalizeIceServers(
569
580
  e.iceServers
@@ -572,58 +583,58 @@ const st = class st {
572
583
  throw new Error(
573
584
  "apiKey or token is required — or pass serverUrl and callId from a prior POST /calls/create"
574
585
  );
575
- this.agentId = e.agentId, this.sessionBehavior = e.sessionBehavior, this.serverUrl = (e.serverUrl || "").replace(/\/$/, ""), this.apiKey = e.apiKey, this.token = e.token, this.prospectName = e.prospectName, this.extraDetails = e.extraDetails, this.backendUrl = (e.backendUrl || js).replace(/\/$/, ""), s.length && (this.iceServers = s), n && (this.callSessionLoaded = !0);
586
+ this.agentId = e.agentId, this.sessionBehavior = e.sessionBehavior, this.serverUrl = (e.serverUrl || "").replace(/\/$/, ""), this.apiKey = e.apiKey, this.token = e.token, this.prospectName = e.prospectName, this.welcomeMessage = ((d = e.welcomeMessage) == null ? void 0 : d.trim()) || void 0, this.extraDetails = e.extraDetails, this.backendUrl = (e.backendUrl || js).replace(/\/$/, ""), s.length && (this.iceServers = s), n && (this.callSessionLoaded = !0);
576
587
  const r = typeof window < "u";
577
588
  this.prospectId = e.prospectId;
578
589
  const a = e.sessionBehavior === "continue";
579
590
  if (a && r && !e.callId) {
580
- const d = Er(this.agentId);
581
- d && (e.callId || (this.callId = d.callId), !this.prospectId && d.prospectId && (this.prospectId = d.prospectId));
591
+ const c = Er(this.agentId);
592
+ c && (e.callId || (this.callId = c.callId), !this.prospectId && c.prospectId && (this.prospectId = c.prospectId));
582
593
  }
583
594
  if (!this.prospectId && r)
584
595
  try {
585
- const d = Er(this.agentId);
586
- this.prospectId = (d == null ? void 0 : d.prospectId) || window.sessionStorage && window.sessionStorage.getItem("vanira_prospect_id") || window.localStorage && window.localStorage.getItem("vanira_prospect_id") || void 0;
596
+ const c = Er(this.agentId);
597
+ this.prospectId = (c == null ? void 0 : c.prospectId) || window.sessionStorage && window.sessionStorage.getItem("vanira_prospect_id") || window.localStorage && window.localStorage.getItem("vanira_prospect_id") || void 0;
587
598
  } catch {
588
599
  }
589
600
  e.callId ? this.callId = e.callId : a || (this.callId = void 0);
590
601
  const o = e.onSessionStarted;
591
- this.onSessionStarted = (d) => {
592
- o == null || o(d), this.emit("session_started", d);
602
+ this.onSessionStarted = (c) => {
603
+ o == null || o(c), this.emit("session_started", c);
593
604
  }, this.liveVision = e.liveVision, this.connectStallTimeoutMs = e.connectStallTimeoutMs ?? 15e3, this.onConnected = () => {
594
- var d;
595
- pn(), this._status = "connected", (d = e.onConnected) == null || d.call(e), this.emit("connected"), this.maybeAutoStartLiveCamera();
605
+ var c;
606
+ pn(), this._status = "connected", (c = e.onConnected) == null || c.call(e), this.emit("connected"), this.maybeAutoStartLiveCamera();
596
607
  }, this.onDisconnected = () => {
597
- var d;
598
- pn(), this._status = "disconnected", (d = e.onDisconnected) == null || d.call(e), this.emit("disconnected");
599
- }, this.onError = (d) => {
600
- var l;
601
- pn(), this._status = "error";
602
- const c = typeof d == "string" ? d : (d == null ? void 0 : d.message) || "Connection error";
603
- (l = e.onError) == null || l.call(e, d), this.emit("error", c);
604
- }, this.onTranscription = (d, c, l) => {
608
+ var c;
609
+ pn(), this._status = "disconnected", (c = e.onDisconnected) == null || c.call(e), this.emit("disconnected");
610
+ }, this.onError = (c) => {
605
611
  var u;
606
- (u = e.onTranscription) == null || u.call(e, d, c), this.emit("transcription", { text: d, isFinal: c, role: l });
612
+ pn(), this._status = "error";
613
+ const l = typeof c == "string" ? c : (c == null ? void 0 : c.message) || "Connection error";
614
+ (u = e.onError) == null || u.call(e, c), this.emit("error", l);
615
+ }, this.onTranscription = (c, l, u) => {
616
+ var h;
617
+ (h = e.onTranscription) == null || h.call(e, c, l), this.emit("transcription", { text: c, isFinal: l, role: u });
607
618
  }, this.onLocalStream = e.onLocalStream || (() => {
608
- }), this.onRemoteTrack = (d, c) => {
609
- var l;
610
- (l = e.onRemoteTrack) == null || l.call(e, d, c), this.emit("track", { track: d, stream: c });
611
- }, this.onClientToolCall = (d) => {
619
+ }), this.onRemoteTrack = (c, l) => {
612
620
  var u;
613
- (u = e.onClientToolCall) == null || u.call(e, d);
614
- const c = (d == null ? void 0 : d.data) || d, l = {
615
- name: String(c.name || c.tool_name || ""),
616
- arguments: c.arguments || c.args || {},
617
- tool_call_id: String(c.tool_call_id || c.call_id || ""),
618
- execution_mode: c.execution_mode === "blocking" ? "blocking" : "fire_and_forget",
619
- client_fields: c.client_fields || {}
621
+ (u = e.onRemoteTrack) == null || u.call(e, c, l), this.emit("track", { track: c, stream: l });
622
+ }, this.onClientToolCall = (c) => {
623
+ var h;
624
+ (h = e.onClientToolCall) == null || h.call(e, c);
625
+ const l = (c == null ? void 0 : c.data) || c, u = {
626
+ name: String(l.name || l.tool_name || ""),
627
+ arguments: l.arguments || l.args || {},
628
+ tool_call_id: String(l.tool_call_id || l.call_id || ""),
629
+ execution_mode: l.execution_mode === "blocking" ? "blocking" : "fire_and_forget",
630
+ client_fields: l.client_fields || {}
620
631
  };
621
- l.name && l.tool_call_id && this.emit("tool_call", l);
622
- }, this.runtime = e.runtime, typeof window < "u" && e.trackRouteContext !== !1 && (this.routeTracker = new Ad({
623
- sendContext: (d) => this.sendContextUpdate(d),
632
+ u.name && u.tool_call_id && this.emit("tool_call", u);
633
+ }, this.runtime = e.runtime, typeof window < "u" && e.trackRouteContext !== !1 && (this.routeTracker = new Od({
634
+ sendContext: (c) => this.sendContextUpdate(c),
624
635
  isReady: () => {
625
- var d;
626
- return ((d = this.dataChannel) == null ? void 0 : d.readyState) === "open";
636
+ var c;
637
+ return ((c = this.dataChannel) == null ? void 0 : c.readyState) === "open";
627
638
  }
628
639
  }));
629
640
  }
@@ -645,7 +656,7 @@ const st = class st {
645
656
  */
646
657
  async connect() {
647
658
  var t;
648
- this._status = "connecting", this.connectStallTimeoutMs > 0 && Id(this.connectStallTimeoutMs);
659
+ this._status = "connecting", this.connectStallTimeoutMs > 0 && Md(this.connectStallTimeoutMs);
649
660
  const e = ++this.connectGeneration;
650
661
  if (await this.loadCallSession(), !this.isConnectCancelled(e)) {
651
662
  if (!this.serverUrl)
@@ -734,8 +745,8 @@ const st = class st {
734
745
  }, this.onRemoteTrack(h, p)) : h.kind === "video" && this.onRemoteTrack(h, p);
735
746
  };
736
747
  const r = () => {
737
- var p, g, m, T, k, S, L, v, y, C, I;
738
- const u = ((p = this.pc) == null ? void 0 : p.connectionState) === "connected" || ((g = this.pc) == null ? void 0 : g.iceConnectionState) === "connected" || ((m = this.pc) == null ? void 0 : m.iceConnectionState) === "completed", h = ((T = this.pc) == null ? void 0 : T.connectionState) === "failed" || ((k = this.pc) == null ? void 0 : k.iceConnectionState) === "failed" || ((S = this.pc) == null ? void 0 : S.connectionState) === "closed" || ((L = this.pc) == null ? void 0 : L.iceConnectionState) === "closed" || ((v = this.pc) == null ? void 0 : v.connectionState) === "disconnected" || ((y = this.pc) == null ? void 0 : y.iceConnectionState) === "disconnected";
748
+ var p, g, m, T, k, S, N, v, y, C, I;
749
+ const u = ((p = this.pc) == null ? void 0 : p.connectionState) === "connected" || ((g = this.pc) == null ? void 0 : g.iceConnectionState) === "connected" || ((m = this.pc) == null ? void 0 : m.iceConnectionState) === "completed", h = ((T = this.pc) == null ? void 0 : T.connectionState) === "failed" || ((k = this.pc) == null ? void 0 : k.iceConnectionState) === "failed" || ((S = this.pc) == null ? void 0 : S.connectionState) === "closed" || ((N = this.pc) == null ? void 0 : N.iceConnectionState) === "closed" || ((v = this.pc) == null ? void 0 : v.connectionState) === "disconnected" || ((y = this.pc) == null ? void 0 : y.iceConnectionState) === "disconnected";
739
750
  ((C = this.pc) == null ? void 0 : C.connectionState) === "connected" && this.stopRemoteIcePolling(), u && !this.connected ? (this.connected = !0, (I = this.routeTracker) == null || I.start(), this.onConnected()) : h && this.connected && (this.connected = !1, this.liveVisionAutoStarted = !1, this.onDisconnected());
740
751
  };
741
752
  this.pc.onconnectionstatechange = r, this.pc.oniceconnectionstatechange = r;
@@ -791,6 +802,7 @@ const st = class st {
791
802
  ...(d = this.runtime) != null && d.runtimeName ? { runtime: this.runtime.runtimeName } : {},
792
803
  prospect_id: this.prospectId,
793
804
  ...this.prospectName ? { prospect_name: this.prospectName } : {},
805
+ ...this.welcomeMessage ? { welcome_message: this.welcomeMessage } : {},
794
806
  ...this.extraDetails && Object.keys(this.extraDetails).length ? { extra_details: this.extraDetails } : {},
795
807
  ...n ? { call_id: n } : {}
796
808
  })
@@ -813,7 +825,7 @@ const st = class st {
813
825
  };
814
826
  }
815
827
  applyCreateCallSession(e) {
816
- if (this.callId = e.callId, this.prospectId = e.prospectId || this.prospectId, this.serverUrl = e.serverUrl, this.iceServers = e.iceServers, this.callSessionLoaded = !0, Sd(this.agentId, this.callId || "", this.prospectId), this.onSessionStarted && this.prospectId && this.callId && !this.sessionStartedEmitted)
828
+ if (this.callId = e.callId, this.prospectId = e.prospectId || this.prospectId, this.serverUrl = e.serverUrl, this.iceServers = e.iceServers, this.callSessionLoaded = !0, Cd(this.agentId, this.callId || "", this.prospectId), this.onSessionStarted && this.prospectId && this.callId && !this.sessionStartedEmitted)
817
829
  try {
818
830
  this.onSessionStarted({ prospectId: this.prospectId, callId: this.callId, serverUrl: this.serverUrl }), this.sessionStartedEmitted = !0;
819
831
  } catch {
@@ -977,7 +989,7 @@ const st = class st {
977
989
  name: "open_live_camera",
978
990
  tool_call_id: `lv_${crypto.randomUUID()}`,
979
991
  execution_mode: "fire_and_forget",
980
- client_fields: { preset_id: N.LiveVision },
992
+ client_fields: { preset_id: x.LiveVision },
981
993
  arguments: {
982
994
  mode: "live",
983
995
  scope: t,
@@ -1005,7 +1017,7 @@ const st = class st {
1005
1017
  this.dispatchBoardAbort(
1006
1018
  "User interrupted while LaTeX was writing",
1007
1019
  void 0,
1008
- N.WriteLatexText
1020
+ x.WriteLatexText
1009
1021
  );
1010
1022
  break;
1011
1023
  case "transcription":
@@ -1029,7 +1041,7 @@ const st = class st {
1029
1041
  event: "client_tool_ack",
1030
1042
  data: { tool_call_id: s }
1031
1043
  }));
1032
- const r = (n == null ? void 0 : n.arguments) || (n == null ? void 0 : n.args) || {}, a = (n == null ? void 0 : n.client_fields) || {}, o = (n == null ? void 0 : n.name) || (n == null ? void 0 : n.tool_name) || "", d = Td(a, r, o);
1044
+ const r = (n == null ? void 0 : n.arguments) || (n == null ? void 0 : n.args) || {}, a = (n == null ? void 0 : n.client_fields) || {}, o = (n == null ? void 0 : n.name) || (n == null ? void 0 : n.tool_name) || "", d = Sd(a, r, o);
1033
1045
  if (o === "end_call") {
1034
1046
  s && this.sendToolResult(s, {
1035
1047
  status: "client_ack_end_call",
@@ -1177,7 +1189,7 @@ const st = class st {
1177
1189
  * @param message Optional user text message about the file
1178
1190
  */
1179
1191
  async uploadMedia(e, t = "general", n = "") {
1180
- return await wd(this.dataChannel, this.mediaBytesChannel) ? this._uploadMediaViaDataChannel(e, t, n) : (_d(this.dataChannel, this.mediaBytesChannel), this._uploadMediaViaHTTP(e, t, n));
1192
+ return await Ed(this.dataChannel, this.mediaBytesChannel) ? this._uploadMediaViaDataChannel(e, t, n) : (wd(this.dataChannel, this.mediaBytesChannel), this._uploadMediaViaHTTP(e, t, n));
1181
1193
  }
1182
1194
  /**
1183
1195
  * Upload a live vision / screen frame — HTTP only for now, never sends client_media_update.
@@ -1196,8 +1208,8 @@ const st = class st {
1196
1208
  async _uploadBytesViaDataChannel(e, t, n, s, r) {
1197
1209
  if (!this.callId || !this.mediaBytesChannel)
1198
1210
  throw new Error("Upload failed: call not ready for WebRTC media upload.");
1199
- const a = r || (e instanceof File ? e.name : s === "frame" ? "frame.jpg" : "upload.bin"), o = e.type || (s === "frame" ? "image/jpeg" : "application/octet-stream"), d = await Pd(e);
1200
- return Ed({
1211
+ const a = r || (e instanceof File ? e.name : s === "frame" ? "frame.jpg" : "upload.bin"), o = e.type || (s === "frame" ? "image/jpeg" : "application/octet-stream"), d = await Rd(e);
1212
+ return Pd({
1201
1213
  bytes: d,
1202
1214
  filename: a,
1203
1215
  contentType: o,
@@ -1302,7 +1314,7 @@ const st = class st {
1302
1314
  D(st, "inflightCreates", /* @__PURE__ */ new Map());
1303
1315
  let fs = st;
1304
1316
  var Ja;
1305
- const Od = {
1317
+ const xd = {
1306
1318
  supportsAudioEndedEvent: !0,
1307
1319
  supportsScreenShare: typeof navigator < "u" && typeof ((Ja = navigator.mediaDevices) == null ? void 0 : Ja.getDisplayMedia) == "function",
1308
1320
  supportsDom: typeof document < "u",
@@ -1310,25 +1322,25 @@ const Od = {
1310
1322
  supportsCustomElements: typeof customElements < "u",
1311
1323
  supportsLocalStorage: typeof localStorage < "u",
1312
1324
  supportsBroadcastChannel: typeof BroadcastChannel < "u"
1313
- }, xd = {
1325
+ }, Ld = {
1314
1326
  name: "browser",
1315
1327
  callType: "web",
1316
1328
  runtimeName: "browser",
1317
1329
  callIdPrefix: "web_",
1318
- capabilities: Od,
1330
+ capabilities: xd,
1319
1331
  audio: new dd(),
1320
1332
  media: new ld(),
1321
1333
  peer: new ud(),
1322
1334
  dataChannel: new pd()
1323
1335
  };
1324
- function Ld(i) {
1336
+ function Nd(i) {
1325
1337
  return new fs({
1326
1338
  ...i,
1327
- runtime: xd
1339
+ runtime: Ld
1328
1340
  });
1329
1341
  }
1330
- const jf = Ld;
1331
- function Nd(i, e) {
1342
+ const Wf = Nd;
1343
+ function Ud(i, e) {
1332
1344
  return e.forEach(function(t) {
1333
1345
  t && typeof t != "string" && !Array.isArray(t) && Object.keys(t).forEach(function(n) {
1334
1346
  if (n !== "default" && !(n in i)) {
@@ -1340,12 +1352,12 @@ function Nd(i, e) {
1340
1352
  });
1341
1353
  }), Object.freeze(i);
1342
1354
  }
1343
- var Ud = Object.defineProperty, Fd = (i, e, t) => e in i ? Ud(i, e, {
1355
+ var Fd = Object.defineProperty, Bd = (i, e, t) => e in i ? Fd(i, e, {
1344
1356
  enumerable: !0,
1345
1357
  configurable: !0,
1346
1358
  writable: !0,
1347
1359
  value: t
1348
- }) : i[e] = t, Rr = (i, e, t) => Fd(i, typeof e != "symbol" ? e + "" : e, t);
1360
+ }) : i[e] = t, Rr = (i, e, t) => Bd(i, typeof e != "symbol" ? e + "" : e, t);
1349
1361
  class ge {
1350
1362
  constructor() {
1351
1363
  Rr(this, "_locking"), Rr(this, "_locks"), this._locking = Promise.resolve(), this._locks = 0;
@@ -1366,22 +1378,22 @@ function se(i, e) {
1366
1378
  if (!i)
1367
1379
  throw new Error(e);
1368
1380
  }
1369
- const Bd = 34028234663852886e22, Vd = -34028234663852886e22, qd = 4294967295, jd = 2147483647, Wd = -2147483648;
1381
+ const Vd = 34028234663852886e22, qd = -34028234663852886e22, jd = 4294967295, Wd = 2147483647, Hd = -2147483648;
1370
1382
  function Vn(i) {
1371
1383
  if (typeof i != "number") throw new Error("invalid int 32: " + typeof i);
1372
- if (!Number.isInteger(i) || i > jd || i < Wd) throw new Error("invalid int 32: " + i);
1384
+ if (!Number.isInteger(i) || i > Wd || i < Hd) throw new Error("invalid int 32: " + i);
1373
1385
  }
1374
1386
  function ms(i) {
1375
1387
  if (typeof i != "number") throw new Error("invalid uint 32: " + typeof i);
1376
- if (!Number.isInteger(i) || i > qd || i < 0) throw new Error("invalid uint 32: " + i);
1388
+ if (!Number.isInteger(i) || i > jd || i < 0) throw new Error("invalid uint 32: " + i);
1377
1389
  }
1378
1390
  function Xa(i) {
1379
1391
  if (typeof i != "number") throw new Error("invalid float 32: " + typeof i);
1380
- if (Number.isFinite(i) && (i > Bd || i < Vd))
1392
+ if (Number.isFinite(i) && (i > Vd || i < qd))
1381
1393
  throw new Error("invalid float 32: " + i);
1382
1394
  }
1383
1395
  const Za = Symbol("@bufbuild/protobuf/enum-type");
1384
- function Hd(i) {
1396
+ function Kd(i) {
1385
1397
  const e = i[Za];
1386
1398
  return se(e, "missing enum type on enum object"), e;
1387
1399
  }
@@ -1411,7 +1423,7 @@ function to(i, e, t) {
1411
1423
  }
1412
1424
  };
1413
1425
  }
1414
- function Kd(i, e, t) {
1426
+ function Gd(i, e, t) {
1415
1427
  const n = {};
1416
1428
  for (const s of e) {
1417
1429
  const r = no(s);
@@ -1522,7 +1534,7 @@ class Ws {
1522
1534
  return Object.getPrototypeOf(this).constructor;
1523
1535
  }
1524
1536
  }
1525
- function Gd(i, e, t, n) {
1537
+ function zd(i, e, t, n) {
1526
1538
  var s;
1527
1539
  const r = (s = n == null ? void 0 : n.localName) !== null && s !== void 0 ? s : e.substring(e.lastIndexOf(".") + 1), a = {
1528
1540
  [r]: function(o) {
@@ -1547,7 +1559,7 @@ function Gd(i, e, t, n) {
1547
1559
  }
1548
1560
  }), a;
1549
1561
  }
1550
- function zd() {
1562
+ function Jd() {
1551
1563
  let i = 0, e = 0;
1552
1564
  for (let n = 0; n < 28; n += 7) {
1553
1565
  let s = this.buf[this.pos++];
@@ -1592,7 +1604,7 @@ function Ir(i) {
1592
1604
  }
1593
1605
  return r(-24, -18), r(-18, -12), r(-12, -6), r(-6), e ? so(n, s) : Hs(n, s);
1594
1606
  }
1595
- function Jd(i, e) {
1607
+ function $d(i, e) {
1596
1608
  let t = Hs(i, e);
1597
1609
  const n = t.hi & 2147483648;
1598
1610
  n && (t = so(t.lo, t.hi));
@@ -1600,7 +1612,7 @@ function Jd(i, e) {
1600
1612
  return n ? "-" + s : s;
1601
1613
  }
1602
1614
  function io(i, e) {
1603
- var t = $d(i, e);
1615
+ var t = Yd(i, e);
1604
1616
  if (i = t.lo, e = t.hi, e <= 2097151)
1605
1617
  return String(qn * e + i);
1606
1618
  const n = i & 16777215, s = (i >>> 24 | e << 8) & 16777215, r = e >> 16 & 65535;
@@ -1608,7 +1620,7 @@ function io(i, e) {
1608
1620
  const c = 1e7;
1609
1621
  return a >= c && (o += Math.floor(a / c), a %= c), o >= c && (d += Math.floor(o / c), o %= c), d.toString() + Mr(o) + Mr(a);
1610
1622
  }
1611
- function $d(i, e) {
1623
+ function Yd(i, e) {
1612
1624
  return {
1613
1625
  lo: i >>> 0,
1614
1626
  hi: e >>> 0
@@ -1638,7 +1650,7 @@ function Dr(i, e) {
1638
1650
  e.push(1);
1639
1651
  }
1640
1652
  }
1641
- function Yd() {
1653
+ function Qd() {
1642
1654
  let i = this.buf[this.pos++], e = i & 127;
1643
1655
  if (!(i & 128))
1644
1656
  return this.assertBounds(), e;
@@ -1653,7 +1665,7 @@ function Yd() {
1653
1665
  if (i & 128) throw new Error("invalid varint");
1654
1666
  return this.assertBounds(), e >>> 0;
1655
1667
  }
1656
- function Qd() {
1668
+ function Xd() {
1657
1669
  const i = new DataView(new ArrayBuffer(8));
1658
1670
  if (typeof BigInt == "function" && typeof i.getBigInt64 == "function" && typeof i.getBigUint64 == "function" && typeof i.setBigInt64 == "function" && typeof i.setBigUint64 == "function" && (typeof process != "object" || typeof process.env != "object" || process.env.BUF_BIGINT_DISABLE !== "1")) {
1659
1671
  const s = BigInt("-9223372036854775808"), r = BigInt("9223372036854775807"), a = BigInt("0"), o = BigInt("18446744073709551615");
@@ -1709,14 +1721,14 @@ function Qd() {
1709
1721
  return typeof s != "string" && (s = s.toString()), n(s), Ir(s);
1710
1722
  },
1711
1723
  dec(s, r) {
1712
- return Jd(s, r);
1724
+ return $d(s, r);
1713
1725
  },
1714
1726
  uDec(s, r) {
1715
1727
  return io(s, r);
1716
1728
  }
1717
1729
  };
1718
1730
  }
1719
- const te = Qd();
1731
+ const te = Xd();
1720
1732
  var w;
1721
1733
  (function(i) {
1722
1734
  i[i.DOUBLE = 1] = "DOUBLE", i[i.FLOAT = 2] = "FLOAT", i[i.INT64 = 3] = "INT64", i[i.UINT64 = 4] = "UINT64", i[i.INT32 = 5] = "INT32", i[i.FIXED64 = 6] = "FIXED64", i[i.FIXED32 = 7] = "FIXED32", i[i.BOOL = 8] = "BOOL", i[i.STRING = 9] = "STRING", i[i.BYTES = 12] = "BYTES", i[i.UINT32 = 13] = "UINT32", i[i.SFIXED32 = 15] = "SFIXED32", i[i.SFIXED64 = 16] = "SFIXED64", i[i.SINT32 = 17] = "SINT32", i[i.SINT64 = 18] = "SINT64";
@@ -1784,18 +1796,18 @@ function Ar(i, e) {
1784
1796
  for (var t = 0, n = Array(e); t < e; t++) n[t] = i[t];
1785
1797
  return n;
1786
1798
  }
1787
- function Xd(i) {
1799
+ function Zd(i) {
1788
1800
  if (Array.isArray(i)) return i;
1789
1801
  }
1790
1802
  function K(i, e, t) {
1791
- return (e = nl(e)) in i ? Object.defineProperty(i, e, {
1803
+ return (e = il(e)) in i ? Object.defineProperty(i, e, {
1792
1804
  value: t,
1793
1805
  enumerable: !0,
1794
1806
  configurable: !0,
1795
1807
  writable: !0
1796
1808
  }) : i[e] = t, i;
1797
1809
  }
1798
- function Zd(i, e) {
1810
+ function el(i, e) {
1799
1811
  var t = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
1800
1812
  if (t != null) {
1801
1813
  var n, s, r, a, o = [], d = !0, c = !1;
@@ -1816,14 +1828,14 @@ function Zd(i, e) {
1816
1828
  return o;
1817
1829
  }
1818
1830
  }
1819
- function el() {
1831
+ function tl() {
1820
1832
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1821
1833
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1822
1834
  }
1823
1835
  function U(i, e) {
1824
- return Xd(i) || Zd(i, e) || il(i, e) || el();
1836
+ return Zd(i) || el(i, e) || sl(i, e) || tl();
1825
1837
  }
1826
- function tl(i, e) {
1838
+ function nl(i, e) {
1827
1839
  if (typeof i != "object" || !i) return i;
1828
1840
  var t = i[Symbol.toPrimitive];
1829
1841
  if (t !== void 0) {
@@ -1833,11 +1845,11 @@ function tl(i, e) {
1833
1845
  }
1834
1846
  return (e === "string" ? String : Number)(i);
1835
1847
  }
1836
- function nl(i) {
1837
- var e = tl(i, "string");
1848
+ function il(i) {
1849
+ var e = nl(i, "string");
1838
1850
  return typeof e == "symbol" ? e : e + "";
1839
1851
  }
1840
- function il(i, e) {
1852
+ function sl(i, e) {
1841
1853
  if (i) {
1842
1854
  if (typeof i == "string") return Ar(i, e);
1843
1855
  var t = {}.toString.call(i).slice(8, -1);
@@ -1848,7 +1860,7 @@ var ae;
1848
1860
  (function(i) {
1849
1861
  i[i.Varint = 0] = "Varint", i[i.Bit64 = 1] = "Bit64", i[i.LengthDelimited = 2] = "LengthDelimited", i[i.StartGroup = 3] = "StartGroup", i[i.EndGroup = 4] = "EndGroup", i[i.Bit32 = 5] = "Bit32";
1850
1862
  })(ae || (ae = {}));
1851
- class sl {
1863
+ class rl {
1852
1864
  constructor(e) {
1853
1865
  this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = [];
1854
1866
  }
@@ -2007,9 +2019,9 @@ class sl {
2007
2019
  return Hi(t.lo, t.hi, this.buf), this;
2008
2020
  }
2009
2021
  }
2010
- class rl {
2022
+ class al {
2011
2023
  constructor(e, t) {
2012
- this.varint64 = zd, this.uint32 = Yd, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder();
2024
+ this.varint64 = Jd, this.uint32 = Qd, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = t ?? new TextDecoder();
2013
2025
  }
2014
2026
  /**
2015
2027
  * Reads a tag - field number and wire type.
@@ -2152,7 +2164,7 @@ class rl {
2152
2164
  return this.textDecoder.decode(this.bytes());
2153
2165
  }
2154
2166
  }
2155
- function al(i, e, t, n) {
2167
+ function ol(i, e, t, n) {
2156
2168
  let s;
2157
2169
  return {
2158
2170
  typeName: e,
@@ -2169,9 +2181,9 @@ function al(i, e, t, n) {
2169
2181
  }
2170
2182
  function ao(i) {
2171
2183
  const e = i.field.localName, t = /* @__PURE__ */ Object.create(null);
2172
- return t[e] = ol(i), [t, () => t[e]];
2184
+ return t[e] = cl(i), [t, () => t[e]];
2173
2185
  }
2174
- function ol(i) {
2186
+ function cl(i) {
2175
2187
  const e = i.field;
2176
2188
  if (e.repeated)
2177
2189
  return [];
@@ -2189,7 +2201,7 @@ function ol(i) {
2189
2201
  throw "map fields are not allowed to be extensions";
2190
2202
  }
2191
2203
  }
2192
- function cl(i, e) {
2204
+ function dl(i, e) {
2193
2205
  if (!e.repeated && (e.kind == "enum" || e.kind == "scalar")) {
2194
2206
  for (let t = i.length - 1; t >= 0; --t)
2195
2207
  if (i[t].no == e.no)
@@ -2270,14 +2282,14 @@ const oo = {
2270
2282
  return t && (e += at[s], e += "=", t == 1 && (e += "=")), e;
2271
2283
  }
2272
2284
  };
2273
- function dl(i, e, t) {
2285
+ function ll(i, e, t) {
2274
2286
  lo(e, i);
2275
- const n = e.runtime.bin.makeReadOptions(t), s = cl(i.getType().runtime.bin.listUnknownFields(i), e.field), r = ao(e), a = U(r, 2), o = a[0], d = a[1];
2287
+ const n = e.runtime.bin.makeReadOptions(t), s = dl(i.getType().runtime.bin.listUnknownFields(i), e.field), r = ao(e), a = U(r, 2), o = a[0], d = a[1];
2276
2288
  for (const c of s)
2277
2289
  e.runtime.bin.readField(o, n.readerFactory(c.data), e.field, c.wireType, n);
2278
2290
  return d();
2279
2291
  }
2280
- function ll(i, e, t, n) {
2292
+ function ul(i, e, t, n) {
2281
2293
  lo(e, i);
2282
2294
  const s = e.runtime.bin.makeReadOptions(n), r = e.runtime.bin.makeWriteOptions(n);
2283
2295
  if (co(i, e)) {
@@ -2362,17 +2374,17 @@ const xr = {
2362
2374
  useProtoFieldName: !1,
2363
2375
  prettySpaces: 0
2364
2376
  };
2365
- function ul(i) {
2377
+ function hl(i) {
2366
2378
  return i ? Object.assign(Object.assign({}, xr), i) : xr;
2367
2379
  }
2368
- function hl(i) {
2380
+ function pl(i) {
2369
2381
  return i ? Object.assign(Object.assign({}, Lr), i) : Lr;
2370
2382
  }
2371
2383
  const ni = Symbol(), jn = Symbol();
2372
- function pl() {
2384
+ function fl() {
2373
2385
  return {
2374
- makeReadOptions: ul,
2375
- makeWriteOptions: hl,
2386
+ makeReadOptions: hl,
2387
+ makeWriteOptions: pl,
2376
2388
  readMessage(i, e, t, n) {
2377
2389
  if (e == null || Array.isArray(e) || typeof e != "object")
2378
2390
  throw new Error("cannot decode message ".concat(i.typeName, " from JSON: ").concat(Qe(e)));
@@ -2398,7 +2410,7 @@ function pl() {
2398
2410
  if (h && h.extendee.typeName == i.typeName) {
2399
2411
  u = !0;
2400
2412
  const p = ao(h), g = U(p, 2), m = g[0], T = g[1];
2401
- Nr(m, c, h.field, t, h), ll(n, h, T(), t);
2413
+ Nr(m, c, h.field, t, h), ul(n, h, T(), t);
2402
2414
  }
2403
2415
  }
2404
2416
  if (!u && !t.ignoreUnknownFields)
@@ -2415,7 +2427,7 @@ function pl() {
2415
2427
  if (!uo(s, i)) {
2416
2428
  if (s.req)
2417
2429
  throw "required field not set";
2418
- if (!e.emitDefaultValues || !ml(s))
2430
+ if (!e.emitDefaultValues || !gl(s))
2419
2431
  continue;
2420
2432
  }
2421
2433
  const a = s.oneof ? i[s.oneof.localName].value : i[s.localName], o = Ur(s, a, e);
@@ -2426,7 +2438,7 @@ function pl() {
2426
2438
  for (const a of t.runtime.bin.listUnknownFields(i)) {
2427
2439
  const o = r.findExtensionFor(t.typeName, a.no);
2428
2440
  if (o && co(i, o)) {
2429
- const d = dl(i, o, e), c = Ur(o.field, d, e);
2441
+ const d = ll(i, o, e), c = Ur(o.field, d, e);
2430
2442
  c !== void 0 && (n[o.field.jsonName] = c);
2431
2443
  }
2432
2444
  }
@@ -2500,7 +2512,7 @@ function Nr(i, e, t, n, s) {
2500
2512
  throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: map value null"));
2501
2513
  let u;
2502
2514
  try {
2503
- u = fl(t.K, c);
2515
+ u = ml(t.K, c);
2504
2516
  } catch (h) {
2505
2517
  let p = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Qe(e));
2506
2518
  throw h instanceof Error && h.message.length > 0 && (p += ": ".concat(h.message)), new Error(p);
@@ -2565,7 +2577,7 @@ function Nr(i, e, t, n, s) {
2565
2577
  break;
2566
2578
  }
2567
2579
  }
2568
- function fl(i, e) {
2580
+ function ml(i, e) {
2569
2581
  if (i === w.BOOL)
2570
2582
  switch (e) {
2571
2583
  case "true":
@@ -2648,7 +2660,7 @@ function Ki(i, e, t, n) {
2648
2660
  }
2649
2661
  throw new Error("cannot decode enum ".concat(i.typeName, " from JSON: ").concat(Qe(e)));
2650
2662
  }
2651
- function ml(i) {
2663
+ function gl(i) {
2652
2664
  return i.repeated || i.kind == "map" ? !0 : !(i.oneof || i.kind == "message" || i.opt || i.req);
2653
2665
  }
2654
2666
  function Ur(i, e, t) {
@@ -2745,21 +2757,21 @@ function Wn(i, e) {
2745
2757
  }
2746
2758
  const Ft = Symbol("@bufbuild/protobuf/unknown-fields"), Fr = {
2747
2759
  readUnknownFields: !0,
2748
- readerFactory: (i) => new rl(i)
2760
+ readerFactory: (i) => new al(i)
2749
2761
  }, Br = {
2750
2762
  writeUnknownFields: !0,
2751
- writerFactory: () => new sl()
2763
+ writerFactory: () => new rl()
2752
2764
  };
2753
- function gl(i) {
2765
+ function vl(i) {
2754
2766
  return i ? Object.assign(Object.assign({}, Fr), i) : Fr;
2755
2767
  }
2756
- function vl(i) {
2768
+ function bl(i) {
2757
2769
  return i ? Object.assign(Object.assign({}, Br), i) : Br;
2758
2770
  }
2759
- function bl() {
2771
+ function yl() {
2760
2772
  return {
2761
- makeReadOptions: gl,
2762
- makeWriteOptions: vl,
2773
+ makeReadOptions: vl,
2774
+ makeWriteOptions: bl,
2763
2775
  listUnknownFields(i) {
2764
2776
  var e;
2765
2777
  return (e = i[Ft]) !== null && e !== void 0 ? e : [];
@@ -2826,7 +2838,7 @@ function Vr(i, e, t, n, s) {
2826
2838
  case "enum":
2827
2839
  const o = t.kind == "enum" ? w.INT32 : t.T;
2828
2840
  let d = ii;
2829
- if (t.kind == "scalar" && t.L > 0 && (d = kl), r) {
2841
+ if (t.kind == "scalar" && t.L > 0 && (d = Tl), r) {
2830
2842
  let g = i[a];
2831
2843
  if (n == ae.LengthDelimited && o != w.STRING && o != w.BYTES) {
2832
2844
  let T = e.uint32() + e.pos;
@@ -2842,7 +2854,7 @@ function Vr(i, e, t, n, s) {
2842
2854
  r ? i[a].push(Hn(e, new c(), s, t)) : ot(i[a]) ? Hn(e, i[a], s, t) : (i[a] = Hn(e, new c(), s, t), c.fieldWrapper && !t.oneof && !t.repeated && (i[a] = c.fieldWrapper.unwrapField(i[a])));
2843
2855
  break;
2844
2856
  case "map":
2845
- let l = yl(t, e, s), u = U(l, 2), h = u[0], p = u[1];
2857
+ let l = kl(t, e, s), u = U(l, 2), h = u[0], p = u[1];
2846
2858
  i[a][h] = p;
2847
2859
  break;
2848
2860
  }
@@ -2858,7 +2870,7 @@ function Hn(i, e, t, n) {
2858
2870
  r
2859
2871
  ), e;
2860
2872
  }
2861
- function yl(i, e, t) {
2873
+ function kl(i, e, t) {
2862
2874
  const n = e.uint32(), s = e.pos + n;
2863
2875
  let r, a;
2864
2876
  for (; e.pos < s; ) {
@@ -2896,7 +2908,7 @@ function yl(i, e, t) {
2896
2908
  }
2897
2909
  return [r, a];
2898
2910
  }
2899
- function kl(i, e) {
2911
+ function Tl(i, e) {
2900
2912
  const t = ii(i, e);
2901
2913
  return typeof t == "bigint" ? t.toString() : t;
2902
2914
  }
@@ -2943,7 +2955,7 @@ function qr(i, e, t, n) {
2943
2955
  let a = i.kind == "enum" ? w.INT32 : i.T;
2944
2956
  if (s)
2945
2957
  if (se(Array.isArray(e)), i.packed)
2946
- Sl(t, a, i.no, e);
2958
+ Cl(t, a, i.no, e);
2947
2959
  else
2948
2960
  for (const o of e)
2949
2961
  bn(t, a, i.no, o);
@@ -2963,12 +2975,12 @@ function qr(i, e, t, n) {
2963
2975
  for (const o of Object.entries(e)) {
2964
2976
  var r = U(o, 2);
2965
2977
  const d = r[0], c = r[1];
2966
- Tl(t, n, i, d, c);
2978
+ Sl(t, n, i, d, c);
2967
2979
  }
2968
2980
  break;
2969
2981
  }
2970
2982
  }
2971
- function Tl(i, e, t, n, s) {
2983
+ function Sl(i, e, t, n, s) {
2972
2984
  i.tag(t.no, ae.LengthDelimited), i.fork();
2973
2985
  let r = n;
2974
2986
  switch (t.K) {
@@ -3005,7 +3017,7 @@ function bn(i, e, t, n) {
3005
3017
  let s = po(e), r = U(s, 2), a = r[0], o = r[1];
3006
3018
  i.tag(t, a)[o](n);
3007
3019
  }
3008
- function Sl(i, e, t, n) {
3020
+ function Cl(i, e, t, n) {
3009
3021
  if (!n.length)
3010
3022
  return;
3011
3023
  i.tag(t, ae.LengthDelimited).fork();
@@ -3035,7 +3047,7 @@ function po(i) {
3035
3047
  const t = w[i].toLowerCase();
3036
3048
  return [e, t];
3037
3049
  }
3038
- function Cl() {
3050
+ function _l() {
3039
3051
  return {
3040
3052
  setEnumType: eo,
3041
3053
  initPartial(i, e) {
@@ -3195,27 +3207,27 @@ function Nn(i) {
3195
3207
  function an(i) {
3196
3208
  return i instanceof Uint8Array ? i : new Uint8Array(i);
3197
3209
  }
3198
- function _l(i, e, t) {
3210
+ function wl(i, e, t) {
3199
3211
  return {
3200
3212
  syntax: i,
3201
- json: pl(),
3202
- bin: bl(),
3203
- util: Object.assign(Object.assign({}, Cl()), {
3213
+ json: fl(),
3214
+ bin: yl(),
3215
+ util: Object.assign(Object.assign({}, _l()), {
3204
3216
  newFieldList: e,
3205
3217
  initFields: t
3206
3218
  }),
3207
3219
  makeMessageType(n, s, r) {
3208
- return Gd(this, n, s, r);
3220
+ return zd(this, n, s, r);
3209
3221
  },
3210
- makeEnum: Kd,
3222
+ makeEnum: Gd,
3211
3223
  makeEnumType: to,
3212
- getEnumType: Hd,
3224
+ getEnumType: Kd,
3213
3225
  makeExtension(n, s, r) {
3214
- return al(this, n, s, r);
3226
+ return ol(this, n, s, r);
3215
3227
  }
3216
3228
  };
3217
3229
  }
3218
- class wl {
3230
+ class El {
3219
3231
  constructor(e, t) {
3220
3232
  this._fields = e, this._normalizer = t;
3221
3233
  }
@@ -3256,12 +3268,12 @@ class wl {
3256
3268
  }
3257
3269
  function fo(i, e) {
3258
3270
  const t = mo(i);
3259
- return e ? t : Dl(Ml(t));
3271
+ return e ? t : Al(Dl(t));
3260
3272
  }
3261
- function El(i) {
3273
+ function Pl(i) {
3262
3274
  return fo(i, !1);
3263
3275
  }
3264
- const Pl = mo;
3276
+ const Rl = mo;
3265
3277
  function mo(i) {
3266
3278
  let e = !1;
3267
3279
  const t = [];
@@ -3290,13 +3302,13 @@ function mo(i) {
3290
3302
  }
3291
3303
  return t.join("");
3292
3304
  }
3293
- const Rl = /* @__PURE__ */ new Set([
3305
+ const Il = /* @__PURE__ */ new Set([
3294
3306
  // names reserved by JavaScript
3295
3307
  "constructor",
3296
3308
  "toString",
3297
3309
  "toJSON",
3298
3310
  "valueOf"
3299
- ]), Il = /* @__PURE__ */ new Set([
3311
+ ]), Ml = /* @__PURE__ */ new Set([
3300
3312
  // names reserved by the runtime
3301
3313
  "getType",
3302
3314
  "clone",
@@ -3309,10 +3321,10 @@ const Rl = /* @__PURE__ */ new Set([
3309
3321
  "toJsonString",
3310
3322
  // names reserved by the runtime for the future
3311
3323
  "toObject"
3312
- ]), go = (i) => "".concat(i, "$"), Ml = (i) => Il.has(i) ? go(i) : i, Dl = (i) => Rl.has(i) ? go(i) : i;
3313
- class Al {
3324
+ ]), go = (i) => "".concat(i, "$"), Dl = (i) => Ml.has(i) ? go(i) : i, Al = (i) => Il.has(i) ? go(i) : i;
3325
+ class Ol {
3314
3326
  constructor(e) {
3315
- this.kind = "oneof", this.repeated = !1, this.packed = !1, this.opt = !1, this.req = !1, this.default = void 0, this.fields = [], this.name = e, this.localName = El(e);
3327
+ this.kind = "oneof", this.repeated = !1, this.packed = !1, this.opt = !1, this.req = !1, this.default = void 0, this.fields = [], this.name = e, this.localName = Pl(e);
3316
3328
  }
3317
3329
  addField(e) {
3318
3330
  se(e.oneof === this, "field ".concat(e.name, " not one of ").concat(this.name)), this.fields.push(e);
@@ -3326,23 +3338,23 @@ class Al {
3326
3338
  return this._lookup[e];
3327
3339
  }
3328
3340
  }
3329
- function Ol(i, e) {
3341
+ function xl(i, e) {
3330
3342
  var t, n, s, r, a, o;
3331
3343
  const d = [];
3332
3344
  let c;
3333
3345
  for (const l of typeof i == "function" ? i() : i) {
3334
3346
  const u = l;
3335
- if (u.localName = fo(l.name, l.oneof !== void 0), u.jsonName = (t = l.jsonName) !== null && t !== void 0 ? t : Pl(l.name), u.repeated = (n = l.repeated) !== null && n !== void 0 ? n : !1, l.kind == "scalar" && (u.L = (s = l.L) !== null && s !== void 0 ? s : Tt.BIGINT), u.delimited = (r = l.delimited) !== null && r !== void 0 ? r : !1, u.req = (a = l.req) !== null && a !== void 0 ? a : !1, u.opt = (o = l.opt) !== null && o !== void 0 ? o : !1, l.packed === void 0 && (u.packed = l.kind == "enum" || l.kind == "scalar" && l.T != w.BYTES && l.T != w.STRING), l.oneof !== void 0) {
3347
+ if (u.localName = fo(l.name, l.oneof !== void 0), u.jsonName = (t = l.jsonName) !== null && t !== void 0 ? t : Rl(l.name), u.repeated = (n = l.repeated) !== null && n !== void 0 ? n : !1, l.kind == "scalar" && (u.L = (s = l.L) !== null && s !== void 0 ? s : Tt.BIGINT), u.delimited = (r = l.delimited) !== null && r !== void 0 ? r : !1, u.req = (a = l.req) !== null && a !== void 0 ? a : !1, u.opt = (o = l.opt) !== null && o !== void 0 ? o : !1, l.packed === void 0 && (u.packed = l.kind == "enum" || l.kind == "scalar" && l.T != w.BYTES && l.T != w.STRING), l.oneof !== void 0) {
3336
3348
  const h = typeof l.oneof == "string" ? l.oneof : l.oneof.name;
3337
- (!c || c.name != h) && (c = new Al(h)), u.oneof = c, c.addField(u);
3349
+ (!c || c.name != h) && (c = new Ol(h)), u.oneof = c, c.addField(u);
3338
3350
  }
3339
3351
  d.push(u);
3340
3352
  }
3341
3353
  return d;
3342
3354
  }
3343
- const b = _l(
3355
+ const b = wl(
3344
3356
  "proto3",
3345
- (i) => new wl(i, (e) => Ol(e)),
3357
+ (i) => new El(i, (e) => xl(e)),
3346
3358
  // TODO merge with proto2 and initExtensionField, also see initPartial, equals, clone
3347
3359
  (i) => {
3348
3360
  for (const e of i.getType().fields.byMember()) {
@@ -3443,7 +3455,7 @@ Ee.fields = b.util.newFieldList(() => [{
3443
3455
  T: 5
3444
3456
  /* ScalarType.INT32 */
3445
3457
  }]);
3446
- const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3458
+ const Ll = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3447
3459
  no: 1,
3448
3460
  name: "timestamp_ms",
3449
3461
  kind: "scalar",
@@ -3464,15 +3476,15 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3464
3476
  no: 4,
3465
3477
  name: "time_series",
3466
3478
  kind: "message",
3467
- T: Ll,
3479
+ T: Nl,
3468
3480
  repeated: !0
3469
3481
  }, {
3470
3482
  no: 5,
3471
3483
  name: "events",
3472
3484
  kind: "message",
3473
- T: Ul,
3485
+ T: Fl,
3474
3486
  repeated: !0
3475
- }]), Ll = /* @__PURE__ */ b.makeMessageType("livekit.TimeSeriesMetric", () => [{
3487
+ }]), Nl = /* @__PURE__ */ b.makeMessageType("livekit.TimeSeriesMetric", () => [{
3476
3488
  no: 1,
3477
3489
  name: "label",
3478
3490
  kind: "scalar",
@@ -3494,7 +3506,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3494
3506
  no: 4,
3495
3507
  name: "samples",
3496
3508
  kind: "message",
3497
- T: Nl,
3509
+ T: Ul,
3498
3510
  repeated: !0
3499
3511
  }, {
3500
3512
  no: 5,
@@ -3502,7 +3514,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3502
3514
  kind: "scalar",
3503
3515
  T: 13
3504
3516
  /* ScalarType.UINT32 */
3505
- }]), Nl = /* @__PURE__ */ b.makeMessageType("livekit.MetricSample", () => [{
3517
+ }]), Ul = /* @__PURE__ */ b.makeMessageType("livekit.MetricSample", () => [{
3506
3518
  no: 1,
3507
3519
  name: "timestamp_ms",
3508
3520
  kind: "scalar",
@@ -3519,7 +3531,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3519
3531
  kind: "scalar",
3520
3532
  T: 2
3521
3533
  /* ScalarType.FLOAT */
3522
- }]), Ul = /* @__PURE__ */ b.makeMessageType("livekit.EventMetric", () => [{
3534
+ }]), Fl = /* @__PURE__ */ b.makeMessageType("livekit.EventMetric", () => [{
3523
3535
  no: 1,
3524
3536
  name: "label",
3525
3537
  kind: "scalar",
@@ -3704,7 +3716,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3704
3716
  }, {
3705
3717
  no: 4,
3706
3718
  name: "RR_SWITCH_CANDIDATE"
3707
- }]), Fl = /* @__PURE__ */ b.makeEnum("livekit.SubscriptionError", [{
3719
+ }]), Bl = /* @__PURE__ */ b.makeEnum("livekit.SubscriptionError", [{
3708
3720
  no: 0,
3709
3721
  name: "SE_UNKNOWN"
3710
3722
  }, {
@@ -3835,7 +3847,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3835
3847
  kind: "scalar",
3836
3848
  T: 9
3837
3849
  /* ScalarType.STRING */
3838
- }]), Bl = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantPermission", () => [{
3850
+ }]), Vl = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantPermission", () => [{
3839
3851
  no: 1,
3840
3852
  name: "can_subscribe",
3841
3853
  kind: "scalar",
@@ -3952,7 +3964,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3952
3964
  no: 11,
3953
3965
  name: "permission",
3954
3966
  kind: "message",
3955
- T: Bl
3967
+ T: Vl
3956
3968
  }, {
3957
3969
  no: 12,
3958
3970
  name: "region",
@@ -3989,7 +4001,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
3989
4001
  no: 18,
3990
4002
  name: "kind_details",
3991
4003
  kind: "enum",
3992
- T: b.getEnumType(Vl),
4004
+ T: b.getEnumType(ql),
3993
4005
  repeated: !0
3994
4006
  }, {
3995
4007
  no: 19,
@@ -4036,7 +4048,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4036
4048
  }, {
4037
4049
  no: 8,
4038
4050
  name: "BRIDGE"
4039
- }]), Vl = /* @__PURE__ */ b.makeEnum("livekit.ParticipantInfo.KindDetail", [{
4051
+ }]), ql = /* @__PURE__ */ b.makeEnum("livekit.ParticipantInfo.KindDetail", [{
4040
4052
  no: 0,
4041
4053
  name: "CLOUD_AGENT"
4042
4054
  }, {
@@ -4060,7 +4072,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4060
4072
  }, {
4061
4073
  no: 2,
4062
4074
  name: "CUSTOM"
4063
- }]), ql = /* @__PURE__ */ b.makeMessageType("livekit.SimulcastCodecInfo", () => [{
4075
+ }]), jl = /* @__PURE__ */ b.makeMessageType("livekit.SimulcastCodecInfo", () => [{
4064
4076
  no: 1,
4065
4077
  name: "mime_type",
4066
4078
  kind: "scalar",
@@ -4169,7 +4181,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4169
4181
  no: 13,
4170
4182
  name: "codecs",
4171
4183
  kind: "message",
4172
- T: ql,
4184
+ T: jl,
4173
4185
  repeated: !0
4174
4186
  }, {
4175
4187
  no: 14,
@@ -4239,7 +4251,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4239
4251
  name: "encryption",
4240
4252
  kind: "enum",
4241
4253
  T: b.getEnumType(X)
4242
- }]), jl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriptionOptions", () => [{
4254
+ }]), Wl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriptionOptions", () => [{
4243
4255
  no: 1,
4244
4256
  name: "target_fps",
4245
4257
  kind: "scalar",
@@ -4331,7 +4343,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4331
4343
  no: 3,
4332
4344
  name: "speaker",
4333
4345
  kind: "message",
4334
- T: Wl,
4346
+ T: Hl,
4335
4347
  oneof: "value"
4336
4348
  }, {
4337
4349
  no: 6,
@@ -4343,13 +4355,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4343
4355
  no: 7,
4344
4356
  name: "transcription",
4345
4357
  kind: "message",
4346
- T: Hl,
4358
+ T: Kl,
4347
4359
  oneof: "value"
4348
4360
  }, {
4349
4361
  no: 8,
4350
4362
  name: "metrics",
4351
4363
  kind: "message",
4352
- T: xl,
4364
+ T: Ll,
4353
4365
  oneof: "value"
4354
4366
  }, {
4355
4367
  no: 9,
@@ -4488,7 +4500,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4488
4500
  kind: "message",
4489
4501
  T: ci,
4490
4502
  oneof: "value"
4491
- }]), Wl = /* @__PURE__ */ b.makeMessageType("livekit.ActiveSpeakerUpdate", () => [{
4503
+ }]), Hl = /* @__PURE__ */ b.makeMessageType("livekit.ActiveSpeakerUpdate", () => [{
4492
4504
  no: 1,
4493
4505
  name: "speakers",
4494
4506
  kind: "message",
@@ -4584,7 +4596,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4584
4596
  kind: "scalar",
4585
4597
  T: 9
4586
4598
  /* ScalarType.STRING */
4587
- }]), Hl = /* @__PURE__ */ b.makeMessageType("livekit.Transcription", () => [{
4599
+ }]), Kl = /* @__PURE__ */ b.makeMessageType("livekit.Transcription", () => [{
4588
4600
  no: 2,
4589
4601
  name: "transcribed_participant_identity",
4590
4602
  kind: "scalar",
@@ -4600,9 +4612,9 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4600
4612
  no: 4,
4601
4613
  name: "segments",
4602
4614
  kind: "message",
4603
- T: Kl,
4615
+ T: Gl,
4604
4616
  repeated: !0
4605
- }]), Kl = /* @__PURE__ */ b.makeMessageType("livekit.TranscriptionSegment", () => [{
4617
+ }]), Gl = /* @__PURE__ */ b.makeMessageType("livekit.TranscriptionSegment", () => [{
4606
4618
  no: 1,
4607
4619
  name: "id",
4608
4620
  kind: "scalar",
@@ -4964,7 +4976,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4964
4976
  no: 4,
4965
4977
  name: "disabled_codecs",
4966
4978
  kind: "message",
4967
- T: Gl
4979
+ T: zl
4968
4980
  }, {
4969
4981
  no: 5,
4970
4982
  name: "force_relay",
@@ -4975,7 +4987,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
4975
4987
  name: "hardware_encoder",
4976
4988
  kind: "enum",
4977
4989
  T: b.getEnumType(_n)
4978
- }]), Gl = /* @__PURE__ */ b.makeMessageType("livekit.DisabledCodecs", () => [{
4990
+ }]), zl = /* @__PURE__ */ b.makeMessageType("livekit.DisabledCodecs", () => [{
4979
4991
  no: 1,
4980
4992
  name: "codecs",
4981
4993
  kind: "message",
@@ -5165,7 +5177,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5165
5177
  }
5166
5178
  }], {
5167
5179
  localName: "DataStream_Trailer"
5168
- }), zl = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodec", () => [{
5180
+ }), Jl = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodec", () => [{
5169
5181
  no: 1,
5170
5182
  name: "codec",
5171
5183
  kind: "scalar",
@@ -5189,7 +5201,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5189
5201
  }, {
5190
5202
  no: 1,
5191
5203
  name: "PAUSED"
5192
- }]), Jl = /* @__PURE__ */ b.makeEnum("livekit.CandidateProtocol", [{
5204
+ }]), $l = /* @__PURE__ */ b.makeEnum("livekit.CandidateProtocol", [{
5193
5205
  no: 0,
5194
5206
  name: "UDP"
5195
5207
  }, {
@@ -5198,7 +5210,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5198
5210
  }, {
5199
5211
  no: 2,
5200
5212
  name: "TLS"
5201
- }]), $l = /* @__PURE__ */ b.makeMessageType("livekit.SignalRequest", () => [{
5213
+ }]), Yl = /* @__PURE__ */ b.makeMessageType("livekit.SignalRequest", () => [{
5202
5214
  no: 1,
5203
5215
  name: "offer",
5204
5216
  kind: "message",
@@ -5322,7 +5334,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5322
5334
  no: 1,
5323
5335
  name: "join",
5324
5336
  kind: "message",
5325
- T: Zl,
5337
+ T: eu,
5326
5338
  oneof: "message"
5327
5339
  }, {
5328
5340
  no: 2,
@@ -5346,7 +5358,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5346
5358
  no: 5,
5347
5359
  name: "update",
5348
5360
  kind: "message",
5349
- T: nu,
5361
+ T: iu,
5350
5362
  oneof: "message"
5351
5363
  }, {
5352
5364
  no: 6,
@@ -5370,37 +5382,37 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5370
5382
  no: 10,
5371
5383
  name: "speakers_changed",
5372
5384
  kind: "message",
5373
- T: iu,
5385
+ T: su,
5374
5386
  oneof: "message"
5375
5387
  }, {
5376
5388
  no: 11,
5377
5389
  name: "room_update",
5378
5390
  kind: "message",
5379
- T: su,
5391
+ T: ru,
5380
5392
  oneof: "message"
5381
5393
  }, {
5382
5394
  no: 12,
5383
5395
  name: "connection_quality",
5384
5396
  kind: "message",
5385
- T: au,
5397
+ T: ou,
5386
5398
  oneof: "message"
5387
5399
  }, {
5388
5400
  no: 13,
5389
5401
  name: "stream_state_update",
5390
5402
  kind: "message",
5391
- T: cu,
5403
+ T: du,
5392
5404
  oneof: "message"
5393
5405
  }, {
5394
5406
  no: 14,
5395
5407
  name: "subscribed_quality_update",
5396
5408
  kind: "message",
5397
- T: lu,
5409
+ T: uu,
5398
5410
  oneof: "message"
5399
5411
  }, {
5400
5412
  no: 15,
5401
5413
  name: "subscription_permission_update",
5402
5414
  kind: "message",
5403
- T: hu,
5415
+ T: pu,
5404
5416
  oneof: "message"
5405
5417
  }, {
5406
5418
  no: 16,
@@ -5412,7 +5424,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5412
5424
  no: 17,
5413
5425
  name: "track_unpublished",
5414
5426
  kind: "message",
5415
- T: tu,
5427
+ T: nu,
5416
5428
  oneof: "message"
5417
5429
  }, {
5418
5430
  no: 18,
@@ -5424,49 +5436,49 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5424
5436
  no: 19,
5425
5437
  name: "reconnect",
5426
5438
  kind: "message",
5427
- T: eu,
5439
+ T: tu,
5428
5440
  oneof: "message"
5429
5441
  }, {
5430
5442
  no: 20,
5431
5443
  name: "pong_resp",
5432
5444
  kind: "message",
5433
- T: fu,
5445
+ T: mu,
5434
5446
  oneof: "message"
5435
5447
  }, {
5436
5448
  no: 21,
5437
5449
  name: "subscription_response",
5438
5450
  kind: "message",
5439
- T: vu,
5451
+ T: bu,
5440
5452
  oneof: "message"
5441
5453
  }, {
5442
5454
  no: 22,
5443
5455
  name: "request_response",
5444
5456
  kind: "message",
5445
- T: bu,
5457
+ T: yu,
5446
5458
  oneof: "message"
5447
5459
  }, {
5448
5460
  no: 23,
5449
5461
  name: "track_subscribed",
5450
5462
  kind: "message",
5451
- T: yu,
5463
+ T: ku,
5452
5464
  oneof: "message"
5453
5465
  }, {
5454
5466
  no: 24,
5455
5467
  name: "room_moved",
5456
5468
  kind: "message",
5457
- T: pu,
5469
+ T: fu,
5458
5470
  oneof: "message"
5459
5471
  }, {
5460
5472
  no: 25,
5461
5473
  name: "media_sections_requirement",
5462
5474
  kind: "message",
5463
- T: Su,
5475
+ T: Cu,
5464
5476
  oneof: "message"
5465
5477
  }, {
5466
5478
  no: 26,
5467
5479
  name: "subscribed_audio_codec_update",
5468
5480
  kind: "message",
5469
- T: uu,
5481
+ T: hu,
5470
5482
  oneof: "message"
5471
5483
  }, {
5472
5484
  no: 27,
@@ -5478,13 +5490,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5478
5490
  no: 28,
5479
5491
  name: "unpublish_data_track_response",
5480
5492
  kind: "message",
5481
- T: Yl,
5493
+ T: Ql,
5482
5494
  oneof: "message"
5483
5495
  }, {
5484
5496
  no: 29,
5485
5497
  name: "data_track_subscriber_handles",
5486
5498
  kind: "message",
5487
- T: Ql,
5499
+ T: Xl,
5488
5500
  oneof: "message"
5489
5501
  }]), bs = /* @__PURE__ */ b.makeMessageType("livekit.SimulcastCodec", () => [{
5490
5502
  no: 1,
@@ -5641,21 +5653,21 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5641
5653
  kind: "scalar",
5642
5654
  T: 13
5643
5655
  /* ScalarType.UINT32 */
5644
- }]), Yl = /* @__PURE__ */ b.makeMessageType("livekit.UnpublishDataTrackResponse", () => [{
5656
+ }]), Ql = /* @__PURE__ */ b.makeMessageType("livekit.UnpublishDataTrackResponse", () => [{
5645
5657
  no: 1,
5646
5658
  name: "info",
5647
5659
  kind: "message",
5648
5660
  T: ki
5649
- }]), Ql = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles", () => [{
5661
+ }]), Xl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles", () => [{
5650
5662
  no: 1,
5651
5663
  name: "sub_handles",
5652
5664
  kind: "map",
5653
5665
  K: 13,
5654
5666
  V: {
5655
5667
  kind: "message",
5656
- T: Xl
5668
+ T: Zl
5657
5669
  }
5658
- }]), Xl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack", () => [{
5670
+ }]), Zl = /* @__PURE__ */ b.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack", () => [{
5659
5671
  no: 1,
5660
5672
  name: "publisher_identity",
5661
5673
  kind: "scalar",
@@ -5704,7 +5716,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5704
5716
  kind: "scalar",
5705
5717
  T: 8
5706
5718
  /* ScalarType.BOOL */
5707
- }]), Zl = /* @__PURE__ */ b.makeMessageType("livekit.JoinResponse", () => [{
5719
+ }]), eu = /* @__PURE__ */ b.makeMessageType("livekit.JoinResponse", () => [{
5708
5720
  no: 1,
5709
5721
  name: "room",
5710
5722
  kind: "message",
@@ -5790,7 +5802,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5790
5802
  kind: "scalar",
5791
5803
  T: 8
5792
5804
  /* ScalarType.BOOL */
5793
- }]), eu = /* @__PURE__ */ b.makeMessageType("livekit.ReconnectResponse", () => [{
5805
+ }]), tu = /* @__PURE__ */ b.makeMessageType("livekit.ReconnectResponse", () => [{
5794
5806
  no: 1,
5795
5807
  name: "ice_servers",
5796
5808
  kind: "message",
@@ -5823,7 +5835,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5823
5835
  name: "track",
5824
5836
  kind: "message",
5825
5837
  T: Vt
5826
- }]), tu = /* @__PURE__ */ b.makeMessageType("livekit.TrackUnpublishedResponse", () => [{
5838
+ }]), nu = /* @__PURE__ */ b.makeMessageType("livekit.TrackUnpublishedResponse", () => [{
5827
5839
  no: 1,
5828
5840
  name: "track_sid",
5829
5841
  kind: "scalar",
@@ -5857,7 +5869,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5857
5869
  T: 9
5858
5870
  /* ScalarType.STRING */
5859
5871
  }
5860
- }]), nu = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantUpdate", () => [{
5872
+ }]), iu = /* @__PURE__ */ b.makeMessageType("livekit.ParticipantUpdate", () => [{
5861
5873
  no: 1,
5862
5874
  name: "participants",
5863
5875
  kind: "message",
@@ -5903,7 +5915,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5903
5915
  no: 3,
5904
5916
  name: "options",
5905
5917
  kind: "message",
5906
- T: jl
5918
+ T: Wl
5907
5919
  }], {
5908
5920
  localName: "UpdateDataSubscription_Update"
5909
5921
  }), No = /* @__PURE__ */ b.makeMessageType("livekit.UpdateTrackSettings", () => [{
@@ -5997,7 +6009,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
5997
6009
  no: 4,
5998
6010
  name: "regions",
5999
6011
  kind: "message",
6000
- T: mu
6012
+ T: gu
6001
6013
  }]), Ht = /* @__PURE__ */ b.makeEnum("livekit.LeaveRequest.Action", [{
6002
6014
  no: 0,
6003
6015
  name: "DISCONNECT"
@@ -6065,18 +6077,18 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6065
6077
  kind: "scalar",
6066
6078
  T: 9
6067
6079
  /* ScalarType.STRING */
6068
- }]), iu = /* @__PURE__ */ b.makeMessageType("livekit.SpeakersChanged", () => [{
6080
+ }]), su = /* @__PURE__ */ b.makeMessageType("livekit.SpeakersChanged", () => [{
6069
6081
  no: 1,
6070
6082
  name: "speakers",
6071
6083
  kind: "message",
6072
6084
  T: To,
6073
6085
  repeated: !0
6074
- }]), su = /* @__PURE__ */ b.makeMessageType("livekit.RoomUpdate", () => [{
6086
+ }]), ru = /* @__PURE__ */ b.makeMessageType("livekit.RoomUpdate", () => [{
6075
6087
  no: 1,
6076
6088
  name: "room",
6077
6089
  kind: "message",
6078
6090
  T: yi
6079
- }]), ru = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityInfo", () => [{
6091
+ }]), au = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityInfo", () => [{
6080
6092
  no: 1,
6081
6093
  name: "participant_sid",
6082
6094
  kind: "scalar",
@@ -6093,13 +6105,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6093
6105
  kind: "scalar",
6094
6106
  T: 2
6095
6107
  /* ScalarType.FLOAT */
6096
- }]), au = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityUpdate", () => [{
6108
+ }]), ou = /* @__PURE__ */ b.makeMessageType("livekit.ConnectionQualityUpdate", () => [{
6097
6109
  no: 1,
6098
6110
  name: "updates",
6099
6111
  kind: "message",
6100
- T: ru,
6112
+ T: au,
6101
6113
  repeated: !0
6102
- }]), ou = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateInfo", () => [{
6114
+ }]), cu = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateInfo", () => [{
6103
6115
  no: 1,
6104
6116
  name: "participant_sid",
6105
6117
  kind: "scalar",
@@ -6116,11 +6128,11 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6116
6128
  name: "state",
6117
6129
  kind: "enum",
6118
6130
  T: b.getEnumType(vs)
6119
- }]), cu = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateUpdate", () => [{
6131
+ }]), du = /* @__PURE__ */ b.makeMessageType("livekit.StreamStateUpdate", () => [{
6120
6132
  no: 1,
6121
6133
  name: "stream_states",
6122
6134
  kind: "message",
6123
- T: ou,
6135
+ T: cu,
6124
6136
  repeated: !0
6125
6137
  }]), tr = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedQuality", () => [{
6126
6138
  no: 1,
@@ -6133,7 +6145,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6133
6145
  kind: "scalar",
6134
6146
  T: 8
6135
6147
  /* ScalarType.BOOL */
6136
- }]), du = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedCodec", () => [{
6148
+ }]), lu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedCodec", () => [{
6137
6149
  no: 1,
6138
6150
  name: "codec",
6139
6151
  kind: "scalar",
@@ -6145,7 +6157,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6145
6157
  kind: "message",
6146
6158
  T: tr,
6147
6159
  repeated: !0
6148
- }]), lu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedQualityUpdate", () => [{
6160
+ }]), uu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedQualityUpdate", () => [{
6149
6161
  no: 1,
6150
6162
  name: "track_sid",
6151
6163
  kind: "scalar",
@@ -6161,9 +6173,9 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6161
6173
  no: 3,
6162
6174
  name: "subscribed_codecs",
6163
6175
  kind: "message",
6164
- T: du,
6176
+ T: lu,
6165
6177
  repeated: !0
6166
- }]), uu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodecUpdate", () => [{
6178
+ }]), hu = /* @__PURE__ */ b.makeMessageType("livekit.SubscribedAudioCodecUpdate", () => [{
6167
6179
  no: 1,
6168
6180
  name: "track_sid",
6169
6181
  kind: "scalar",
@@ -6173,7 +6185,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6173
6185
  no: 2,
6174
6186
  name: "subscribed_audio_codecs",
6175
6187
  kind: "message",
6176
- T: zl,
6188
+ T: Jl,
6177
6189
  repeated: !0
6178
6190
  }]), Vo = /* @__PURE__ */ b.makeMessageType("livekit.TrackPermission", () => [{
6179
6191
  no: 1,
@@ -6211,7 +6223,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6211
6223
  kind: "message",
6212
6224
  T: Vo,
6213
6225
  repeated: !0
6214
- }]), hu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionPermissionUpdate", () => [{
6226
+ }]), pu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionPermissionUpdate", () => [{
6215
6227
  no: 1,
6216
6228
  name: "participant_sid",
6217
6229
  kind: "scalar",
@@ -6229,7 +6241,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6229
6241
  kind: "scalar",
6230
6242
  T: 8
6231
6243
  /* ScalarType.BOOL */
6232
- }]), pu = /* @__PURE__ */ b.makeMessageType("livekit.RoomMovedResponse", () => [{
6244
+ }]), fu = /* @__PURE__ */ b.makeMessageType("livekit.RoomMovedResponse", () => [{
6233
6245
  no: 1,
6234
6246
  name: "room",
6235
6247
  kind: "message",
@@ -6353,7 +6365,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6353
6365
  no: 5,
6354
6366
  name: "switch_candidate_protocol",
6355
6367
  kind: "enum",
6356
- T: b.getEnumType(Jl),
6368
+ T: b.getEnumType($l),
6357
6369
  oneof: "scenario"
6358
6370
  }, {
6359
6371
  no: 6,
@@ -6391,7 +6403,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6391
6403
  kind: "scalar",
6392
6404
  T: 3
6393
6405
  /* ScalarType.INT64 */
6394
- }]), fu = /* @__PURE__ */ b.makeMessageType("livekit.Pong", () => [{
6406
+ }]), mu = /* @__PURE__ */ b.makeMessageType("livekit.Pong", () => [{
6395
6407
  no: 1,
6396
6408
  name: "last_ping_timestamp",
6397
6409
  kind: "scalar",
@@ -6403,13 +6415,13 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6403
6415
  kind: "scalar",
6404
6416
  T: 3
6405
6417
  /* ScalarType.INT64 */
6406
- }]), mu = /* @__PURE__ */ b.makeMessageType("livekit.RegionSettings", () => [{
6418
+ }]), gu = /* @__PURE__ */ b.makeMessageType("livekit.RegionSettings", () => [{
6407
6419
  no: 1,
6408
6420
  name: "regions",
6409
6421
  kind: "message",
6410
- T: gu,
6422
+ T: vu,
6411
6423
  repeated: !0
6412
- }]), gu = /* @__PURE__ */ b.makeMessageType("livekit.RegionInfo", () => [{
6424
+ }]), vu = /* @__PURE__ */ b.makeMessageType("livekit.RegionInfo", () => [{
6413
6425
  no: 1,
6414
6426
  name: "region",
6415
6427
  kind: "scalar",
@@ -6427,7 +6439,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6427
6439
  kind: "scalar",
6428
6440
  T: 3
6429
6441
  /* ScalarType.INT64 */
6430
- }]), vu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionResponse", () => [{
6442
+ }]), bu = /* @__PURE__ */ b.makeMessageType("livekit.SubscriptionResponse", () => [{
6431
6443
  no: 1,
6432
6444
  name: "track_sid",
6433
6445
  kind: "scalar",
@@ -6437,8 +6449,8 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6437
6449
  no: 2,
6438
6450
  name: "err",
6439
6451
  kind: "enum",
6440
- T: b.getEnumType(Fl)
6441
- }]), bu = /* @__PURE__ */ b.makeMessageType("livekit.RequestResponse", () => [{
6452
+ T: b.getEnumType(Bl)
6453
+ }]), yu = /* @__PURE__ */ b.makeMessageType("livekit.RequestResponse", () => [{
6442
6454
  no: 1,
6443
6455
  name: "request_id",
6444
6456
  kind: "scalar",
@@ -6536,7 +6548,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6536
6548
  }, {
6537
6549
  no: 10,
6538
6550
  name: "DUPLICATE_NAME"
6539
- }]), yu = /* @__PURE__ */ b.makeMessageType("livekit.TrackSubscribed", () => [{
6551
+ }]), ku = /* @__PURE__ */ b.makeMessageType("livekit.TrackSubscribed", () => [{
6540
6552
  no: 1,
6541
6553
  name: "track_sid",
6542
6554
  kind: "scalar",
@@ -6572,7 +6584,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6572
6584
  kind: "scalar",
6573
6585
  T: 8,
6574
6586
  opt: !0
6575
- }]), ku = /* @__PURE__ */ b.makeMessageType("livekit.JoinRequest", () => [{
6587
+ }]), Tu = /* @__PURE__ */ b.makeMessageType("livekit.JoinRequest", () => [{
6576
6588
  no: 1,
6577
6589
  name: "client_info",
6578
6590
  kind: "message",
@@ -6631,7 +6643,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6631
6643
  name: "sync_state",
6632
6644
  kind: "message",
6633
6645
  T: nr
6634
- }]), Tu = /* @__PURE__ */ b.makeMessageType("livekit.WrappedJoinRequest", () => [{
6646
+ }]), Su = /* @__PURE__ */ b.makeMessageType("livekit.WrappedJoinRequest", () => [{
6635
6647
  no: 1,
6636
6648
  name: "compression",
6637
6649
  kind: "enum",
@@ -6648,7 +6660,7 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6648
6660
  }, {
6649
6661
  no: 1,
6650
6662
  name: "GZIP"
6651
- }]), Su = /* @__PURE__ */ b.makeMessageType("livekit.MediaSectionsRequirement", () => [{
6663
+ }]), Cu = /* @__PURE__ */ b.makeMessageType("livekit.MediaSectionsRequirement", () => [{
6652
6664
  no: 1,
6653
6665
  name: "num_audios",
6654
6666
  kind: "scalar",
@@ -6661,15 +6673,15 @@ const xl = /* @__PURE__ */ b.makeMessageType("livekit.MetricsBatch", () => [{
6661
6673
  T: 13
6662
6674
  /* ScalarType.UINT32 */
6663
6675
  }]);
6664
- function Cu(i) {
6676
+ function _u(i) {
6665
6677
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
6666
6678
  }
6667
- var Kn = { exports: {} }, _u = Kn.exports, Kr;
6668
- function wu() {
6679
+ var Kn = { exports: {} }, wu = Kn.exports, Kr;
6680
+ function Eu() {
6669
6681
  return Kr || (Kr = 1, function(i) {
6670
6682
  (function(e, t) {
6671
6683
  i.exports ? i.exports = t() : e.log = t();
6672
- })(_u, function() {
6684
+ })(wu, function() {
6673
6685
  var e = function() {
6674
6686
  }, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), s = ["trace", "debug", "info", "warn", "error"], r = {}, a = null;
6675
6687
  function o(m, T) {
@@ -6707,7 +6719,7 @@ function wu() {
6707
6719
  return c(m) || u.apply(this, arguments);
6708
6720
  }
6709
6721
  function p(m, T) {
6710
- var k = this, S, L, v, y = "loglevel";
6722
+ var k = this, S, N, v, y = "loglevel";
6711
6723
  typeof m == "string" ? y += ":" + m : typeof m == "symbol" && (y = void 0);
6712
6724
  function C(O) {
6713
6725
  var B = (s[O] || "silent").toUpperCase();
@@ -6739,7 +6751,7 @@ function wu() {
6739
6751
  return k.levels[O] === void 0 && (O = void 0), O;
6740
6752
  }
6741
6753
  }
6742
- function x() {
6754
+ function L() {
6743
6755
  if (!(typeof window === t || !y)) {
6744
6756
  try {
6745
6757
  window.localStorage.removeItem(y);
@@ -6765,13 +6777,13 @@ function wu() {
6765
6777
  ERROR: 4,
6766
6778
  SILENT: 5
6767
6779
  }, k.methodFactory = T || h, k.getLevel = function() {
6768
- return v ?? L ?? S;
6780
+ return v ?? N ?? S;
6769
6781
  }, k.setLevel = function(O, B) {
6770
6782
  return v = V(O), B !== !1 && C(v), l.call(k);
6771
6783
  }, k.setDefaultLevel = function(O) {
6772
- L = V(O), I() || k.setLevel(O, !1);
6784
+ N = V(O), I() || k.setLevel(O, !1);
6773
6785
  }, k.resetLevel = function() {
6774
- v = null, x(), l.call(k);
6786
+ v = null, L(), l.call(k);
6775
6787
  }, k.enableAll = function(O) {
6776
6788
  k.setLevel(k.levels.TRACE, O);
6777
6789
  }, k.disableAll = function(O) {
@@ -6799,7 +6811,7 @@ function wu() {
6799
6811
  });
6800
6812
  }(Kn)), Kn.exports;
6801
6813
  }
6802
- var Ei = wu(), ks;
6814
+ var Ei = Eu(), ks;
6803
6815
  (function(i) {
6804
6816
  i[i.trace = 0] = "trace", i[i.debug = 1] = "debug", i[i.info = 2] = "info", i[i.warn = 3] = "warn", i[i.error = 4] = "error", i[i.silent = 5] = "silent";
6805
6817
  })(ks || (ks = {}));
@@ -6812,19 +6824,19 @@ Object.values(pe).map((i) => Ei.getLogger(i));
6812
6824
  q.setDefaultLevel(ks.info);
6813
6825
  function Re(i, e) {
6814
6826
  const t = Ei.getLogger(i);
6815
- return t.setDefaultLevel(q.getLevel()), e ? Eu(t, e) : t;
6827
+ return t.setDefaultLevel(q.getLevel()), e ? Pu(t, e) : t;
6816
6828
  }
6817
- function Eu(i, e) {
6829
+ function Pu(i, e) {
6818
6830
  const t = (s) => (r, a) => {
6819
6831
  const o = e(), d = o || a ? Object.assign(Object.assign({}, o), a) : void 0;
6820
6832
  i[s](r, d);
6821
6833
  }, n = Object.create(i);
6822
6834
  return n.trace = t("trace"), n.debug = t("debug"), n.info = t("info"), n.warn = t("warn"), n.error = t("error"), n;
6823
6835
  }
6824
- const Pu = Ei.getLogger(pe.E2EE), on = 7e3, Ru = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, on, on, on, on, on];
6825
- class Iu {
6836
+ const Ru = Ei.getLogger(pe.E2EE), on = 7e3, Iu = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, on, on, on, on, on];
6837
+ class Mu {
6826
6838
  constructor(e) {
6827
- this._retryDelays = e !== void 0 ? [...e] : Ru;
6839
+ this._retryDelays = e !== void 0 ? [...e] : Iu;
6828
6840
  }
6829
6841
  nextRetryDelayInMs(e) {
6830
6842
  if (e.retryCount >= this._retryDelays.length) return null;
@@ -6832,7 +6844,7 @@ class Iu {
6832
6844
  return e.retryCount <= 1 ? t : t + Math.random() * 1e3;
6833
6845
  }
6834
6846
  }
6835
- function Mu(i, e) {
6847
+ function Du(i, e) {
6836
6848
  var t = {};
6837
6849
  for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
6838
6850
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
@@ -6880,7 +6892,7 @@ function Gr(i) {
6880
6892
  function Zt(i) {
6881
6893
  return this instanceof Zt ? (this.v = i, this) : new Zt(i);
6882
6894
  }
6883
- function Du(i, e, t) {
6895
+ function Au(i, e, t) {
6884
6896
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
6885
6897
  var n = t.apply(i, e || []), s, r = [];
6886
6898
  return s = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), o("next"), o("throw"), o("return", a), s[Symbol.asyncIterator] = function() {
@@ -6918,7 +6930,7 @@ function Du(i, e, t) {
6918
6930
  p(g), r.shift(), r.length && d(r[0][0], r[0][1]);
6919
6931
  }
6920
6932
  }
6921
- function Au(i) {
6933
+ function Ou(i) {
6922
6934
  var e, t;
6923
6935
  return e = {}, n("next"), n("throw", function(s) {
6924
6936
  throw s;
@@ -6951,7 +6963,7 @@ function Ve(i) {
6951
6963
  }
6952
6964
  }
6953
6965
  var Un = { exports: {} }, zr;
6954
- function Ou() {
6966
+ function xu() {
6955
6967
  if (zr) return Un.exports;
6956
6968
  zr = 1;
6957
6969
  var i = typeof Reflect == "object" ? Reflect : null, e = i && typeof i.apply == "function" ? i.apply : function(y, C, I) {
@@ -7000,10 +7012,10 @@ function Ou() {
7000
7012
  return d(this);
7001
7013
  }, r.prototype.emit = function(y) {
7002
7014
  for (var C = [], I = 1; I < arguments.length; I++) C.push(arguments[I]);
7003
- var x = y === "error", V = this._events;
7004
- if (V !== void 0) x = x && V.error === void 0;
7005
- else if (!x) return !1;
7006
- if (x) {
7015
+ var L = y === "error", V = this._events;
7016
+ if (V !== void 0) L = L && V.error === void 0;
7017
+ else if (!L) return !1;
7018
+ if (L) {
7007
7019
  var A;
7008
7020
  if (C.length > 0 && (A = C[0]), A instanceof Error)
7009
7021
  throw A;
@@ -7019,10 +7031,10 @@ function Ou() {
7019
7031
  return !0;
7020
7032
  };
7021
7033
  function c(v, y, C, I) {
7022
- var x, V, A;
7034
+ var L, V, A;
7023
7035
  if (o(C), V = v._events, V === void 0 ? (V = v._events = /* @__PURE__ */ Object.create(null), v._eventsCount = 0) : (V.newListener !== void 0 && (v.emit("newListener", y, C.listener ? C.listener : C), V = v._events), A = V[y]), A === void 0)
7024
7036
  A = V[y] = C, ++v._eventsCount;
7025
- else if (typeof A == "function" ? A = V[y] = I ? [C, A] : [A, C] : I ? A.unshift(C) : A.push(C), x = d(v), x > 0 && A.length > x && !A.warned) {
7037
+ else if (typeof A == "function" ? A = V[y] = I ? [C, A] : [A, C] : I ? A.unshift(C) : A.push(C), L = d(v), L > 0 && A.length > L && !A.warned) {
7026
7038
  A.warned = !0;
7027
7039
  var O = new Error("Possible EventEmitter memory leak detected. " + A.length + " " + String(y) + " listeners added. Use emitter.setMaxListeners() to increase limit");
7028
7040
  O.name = "MaxListenersExceededWarning", O.emitter = v, O.type = y, O.count = A.length;
@@ -7045,19 +7057,19 @@ function Ou() {
7045
7057
  target: v,
7046
7058
  type: y,
7047
7059
  listener: C
7048
- }, x = l.bind(I);
7049
- return x.listener = C, I.wrapFn = x, x;
7060
+ }, L = l.bind(I);
7061
+ return L.listener = C, I.wrapFn = L, L;
7050
7062
  }
7051
7063
  r.prototype.once = function(y, C) {
7052
7064
  return o(C), this.on(y, u(this, y, C)), this;
7053
7065
  }, r.prototype.prependOnceListener = function(y, C) {
7054
7066
  return o(C), this.prependListener(y, u(this, y, C)), this;
7055
7067
  }, r.prototype.removeListener = function(y, C) {
7056
- var I, x, V, A, O;
7057
- if (o(C), x = this._events, x === void 0) return this;
7058
- if (I = x[y], I === void 0) return this;
7068
+ var I, L, V, A, O;
7069
+ if (o(C), L = this._events, L === void 0) return this;
7070
+ if (I = L[y], I === void 0) return this;
7059
7071
  if (I === C || I.listener === C)
7060
- --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete x[y], x.removeListener && this.emit("removeListener", y, I.listener || C));
7072
+ --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete L[y], L.removeListener && this.emit("removeListener", y, I.listener || C));
7061
7073
  else if (typeof I != "function") {
7062
7074
  for (V = -1, A = I.length - 1; A >= 0; A--)
7063
7075
  if (I[A] === C || I[A].listener === C) {
@@ -7065,32 +7077,32 @@ function Ou() {
7065
7077
  break;
7066
7078
  }
7067
7079
  if (V < 0) return this;
7068
- V === 0 ? I.shift() : m(I, V), I.length === 1 && (x[y] = I[0]), x.removeListener !== void 0 && this.emit("removeListener", y, O || C);
7080
+ V === 0 ? I.shift() : m(I, V), I.length === 1 && (L[y] = I[0]), L.removeListener !== void 0 && this.emit("removeListener", y, O || C);
7069
7081
  }
7070
7082
  return this;
7071
7083
  }, r.prototype.off = r.prototype.removeListener, r.prototype.removeAllListeners = function(y) {
7072
- var C, I, x;
7084
+ var C, I, L;
7073
7085
  if (I = this._events, I === void 0) return this;
7074
7086
  if (I.removeListener === void 0)
7075
7087
  return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : I[y] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete I[y]), this;
7076
7088
  if (arguments.length === 0) {
7077
7089
  var V = Object.keys(I), A;
7078
- for (x = 0; x < V.length; ++x)
7079
- A = V[x], A !== "removeListener" && this.removeAllListeners(A);
7090
+ for (L = 0; L < V.length; ++L)
7091
+ A = V[L], A !== "removeListener" && this.removeAllListeners(A);
7080
7092
  return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
7081
7093
  }
7082
7094
  if (C = I[y], typeof C == "function")
7083
7095
  this.removeListener(y, C);
7084
7096
  else if (C !== void 0)
7085
- for (x = C.length - 1; x >= 0; x--)
7086
- this.removeListener(y, C[x]);
7097
+ for (L = C.length - 1; L >= 0; L--)
7098
+ this.removeListener(y, C[L]);
7087
7099
  return this;
7088
7100
  };
7089
7101
  function h(v, y, C) {
7090
7102
  var I = v._events;
7091
7103
  if (I === void 0) return [];
7092
- var x = I[y];
7093
- return x === void 0 ? [] : typeof x == "function" ? C ? [x.listener || x] : [x] : C ? T(x) : g(x, x.length);
7104
+ var L = I[y];
7105
+ return L === void 0 ? [] : typeof L == "function" ? C ? [L.listener || L] : [L] : C ? T(L) : g(L, L.length);
7094
7106
  }
7095
7107
  r.prototype.listeners = function(y) {
7096
7108
  return h(this, y, !0);
@@ -7128,36 +7140,36 @@ function Ou() {
7128
7140
  }
7129
7141
  function k(v, y) {
7130
7142
  return new Promise(function(C, I) {
7131
- function x(A) {
7143
+ function L(A) {
7132
7144
  v.removeListener(y, V), I(A);
7133
7145
  }
7134
7146
  function V() {
7135
- typeof v.removeListener == "function" && v.removeListener("error", x), C([].slice.call(arguments));
7147
+ typeof v.removeListener == "function" && v.removeListener("error", L), C([].slice.call(arguments));
7136
7148
  }
7137
- L(v, y, V, {
7149
+ N(v, y, V, {
7138
7150
  once: !0
7139
- }), y !== "error" && S(v, x, {
7151
+ }), y !== "error" && S(v, L, {
7140
7152
  once: !0
7141
7153
  });
7142
7154
  });
7143
7155
  }
7144
7156
  function S(v, y, C) {
7145
- typeof v.on == "function" && L(v, "error", y, C);
7157
+ typeof v.on == "function" && N(v, "error", y, C);
7146
7158
  }
7147
- function L(v, y, C, I) {
7159
+ function N(v, y, C, I) {
7148
7160
  if (typeof v.on == "function")
7149
7161
  I.once ? v.once(y, C) : v.on(y, C);
7150
7162
  else if (typeof v.addEventListener == "function")
7151
- v.addEventListener(y, function x(V) {
7152
- I.once && v.removeEventListener(y, x), C(V);
7163
+ v.addEventListener(y, function L(V) {
7164
+ I.once && v.removeEventListener(y, L), C(V);
7153
7165
  });
7154
7166
  else
7155
7167
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof v);
7156
7168
  }
7157
7169
  return Un.exports;
7158
7170
  }
7159
- var Ie = Ou();
7160
- let Go = !0, xu = !0;
7171
+ var Ie = xu();
7172
+ let Go = !0, Lu = !0;
7161
7173
  function mn(i, e, t) {
7162
7174
  const n = i.match(e);
7163
7175
  return n && n.length >= t && parseFloat(n[t], 10);
@@ -7197,15 +7209,15 @@ function Ut(i, e, t) {
7197
7209
  configurable: !0
7198
7210
  });
7199
7211
  }
7200
- function Lu(i) {
7212
+ function Nu(i) {
7201
7213
  return typeof i != "boolean" ? new Error("Argument type: " + typeof i + ". Please use a boolean.") : (Go = i, i ? "adapter.js logging disabled" : "adapter.js logging enabled");
7202
7214
  }
7203
- function Nu(i) {
7204
- return typeof i != "boolean" ? new Error("Argument type: " + typeof i + ". Please use a boolean.") : (xu = !i, "adapter.js deprecation warnings " + (i ? "disabled" : "enabled"));
7215
+ function Uu(i) {
7216
+ return typeof i != "boolean" ? new Error("Argument type: " + typeof i + ". Please use a boolean.") : (Lu = !i, "adapter.js deprecation warnings " + (i ? "disabled" : "enabled"));
7205
7217
  }
7206
7218
  function zo() {
7207
7219
  }
7208
- function Uu(i) {
7220
+ function Fu(i) {
7209
7221
  const e = {
7210
7222
  browser: null,
7211
7223
  version: null
@@ -7690,7 +7702,7 @@ function ic(i, e) {
7690
7702
  }
7691
7703
  }
7692
7704
  }
7693
- function Fu(i, e) {
7705
+ function Bu(i, e) {
7694
7706
  i.navigator.mediaDevices && "getDisplayMedia" in i.navigator.mediaDevices || i.navigator.mediaDevices && (i.navigator.mediaDevices.getDisplayMedia = function(n) {
7695
7707
  if (!(n && n.video)) {
7696
7708
  const s = new DOMException("getDisplayMedia without video constraints is undefined");
@@ -7847,7 +7859,7 @@ function pc(i) {
7847
7859
  }) : e.apply(this, arguments);
7848
7860
  };
7849
7861
  }
7850
- var Xr = /* @__PURE__ */ Object.freeze({ __proto__: null, shimAddTransceiver: lc, shimCreateAnswer: pc, shimCreateOffer: hc, shimGetDisplayMedia: Fu, shimGetParameters: uc, shimGetStats: rc, shimGetUserMedia: ic, shimOnTrack: sc, shimPeerConnection: Cs, shimRTCDataChannel: dc, shimReceiverGetStats: oc, shimRemoveStream: cc, shimSenderGetStats: ac });
7862
+ var Xr = /* @__PURE__ */ Object.freeze({ __proto__: null, shimAddTransceiver: lc, shimCreateAnswer: pc, shimCreateOffer: hc, shimGetDisplayMedia: Bu, shimGetParameters: uc, shimGetStats: rc, shimGetUserMedia: ic, shimOnTrack: sc, shimPeerConnection: Cs, shimRTCDataChannel: dc, shimReceiverGetStats: oc, shimRemoveStream: cc, shimSenderGetStats: ac });
7851
7863
  function fc(i) {
7852
7864
  if (!(typeof i != "object" || !i.RTCPeerConnection)) {
7853
7865
  if ("getLocalStreams" in i.RTCPeerConnection.prototype || (i.RTCPeerConnection.prototype.getLocalStreams = function() {
@@ -8000,7 +8012,7 @@ function Sc(i) {
8000
8012
  typeof i != "object" || i.AudioContext || (i.AudioContext = i.webkitAudioContext);
8001
8013
  }
8002
8014
  var Zr = /* @__PURE__ */ Object.freeze({ __proto__: null, shimAudioContext: Sc, shimCallbacksAPI: gc, shimConstraints: bc, shimCreateOfferLegacy: Tc, shimGetUserMedia: vc, shimLocalStreamsAPI: fc, shimRTCIceServerUrls: yc, shimRemoteStreamsAPI: mc, shimTrackEventTransceiver: kc }), zi = { exports: {} }, ea;
8003
- function Bu() {
8015
+ function Vu() {
8004
8016
  return ea || (ea = 1, function(i) {
8005
8017
  const e = {};
8006
8018
  e.generateIdentifier = function() {
@@ -8371,7 +8383,7 @@ t=0 0\r
8371
8383
  }, i.exports = e;
8372
8384
  }(zi)), zi.exports;
8373
8385
  }
8374
- var Cc = Bu(), Kt = /* @__PURE__ */ Cu(Cc), Vu = /* @__PURE__ */ Nd({ __proto__: null, default: Kt }, [Cc]);
8386
+ var Cc = Vu(), Kt = /* @__PURE__ */ _u(Cc), qu = /* @__PURE__ */ Ud({ __proto__: null, default: Kt }, [Cc]);
8375
8387
  function Gn(i) {
8376
8388
  if (!i.RTCIceCandidate || i.RTCIceCandidate && "foundation" in i.RTCIceCandidate.prototype)
8377
8389
  return;
@@ -8569,21 +8581,21 @@ function Yn(i, e) {
8569
8581
  return s.sdp || s.type !== "offer" && s.type !== "answer" ? t.apply(this, [s]) : (s.type === "offer" ? this.createOffer : this.createAnswer).apply(this).then((a) => t.apply(this, [a]));
8570
8582
  });
8571
8583
  }
8572
- var qu = /* @__PURE__ */ Object.freeze({ __proto__: null, removeExtmapAllowMixed: Es, shimAddIceCandidateNullOrEmpty: $n, shimConnectionState: ws, shimMaxMessageSize: zn, shimParameterlessSetLocalDescription: Yn, shimRTCIceCandidate: Gn, shimRTCIceCandidateRelayProtocol: _s, shimSendThrowTypeError: Jn });
8573
- function ju() {
8584
+ var ju = /* @__PURE__ */ Object.freeze({ __proto__: null, removeExtmapAllowMixed: Es, shimAddIceCandidateNullOrEmpty: $n, shimConnectionState: ws, shimMaxMessageSize: zn, shimParameterlessSetLocalDescription: Yn, shimRTCIceCandidate: Gn, shimRTCIceCandidateRelayProtocol: _s, shimSendThrowTypeError: Jn });
8585
+ function Wu() {
8574
8586
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = i.window, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
8575
8587
  shimChrome: !0,
8576
8588
  shimFirefox: !0,
8577
8589
  shimSafari: !0
8578
8590
  };
8579
- const n = zo, s = Uu(e), r = {
8591
+ const n = zo, s = Fu(e), r = {
8580
8592
  browserDetails: s,
8581
- commonShim: qu,
8593
+ commonShim: ju,
8582
8594
  extractVersion: mn,
8583
- disableLog: Lu,
8584
- disableWarnings: Nu,
8595
+ disableLog: Nu,
8596
+ disableWarnings: Uu,
8585
8597
  // Expose sdp as a convenience. For production apps include directly.
8586
- sdp: Vu
8598
+ sdp: qu
8587
8599
  };
8588
8600
  switch (s.browser) {
8589
8601
  case "chrome":
@@ -8609,7 +8621,7 @@ function ju() {
8609
8621
  }
8610
8622
  return r;
8611
8623
  }
8612
- ju({
8624
+ Wu({
8613
8625
  window: typeof window > "u" ? void 0 : window
8614
8626
  });
8615
8627
  var Ps, _c;
@@ -8633,7 +8645,7 @@ class Se extends (_c = Promise) {
8633
8645
  }
8634
8646
  Ps = Se;
8635
8647
  Se.resolve = (i) => Reflect.get(_c, "resolve", Ps).call(Ps, i);
8636
- const Wu = /version\/(\d+(\.?_?\d+)+)/i;
8648
+ const Hu = /version\/(\d+(\.?_?\d+)+)/i;
8637
8649
  let Ji;
8638
8650
  function Ce(i) {
8639
8651
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
@@ -8641,12 +8653,12 @@ function Ce(i) {
8641
8653
  return;
8642
8654
  const t = navigator.userAgent.toLowerCase();
8643
8655
  if (Ji === void 0 || e) {
8644
- const n = Hu.find((s) => s.test.test(t));
8656
+ const n = Ku.find((s) => s.test.test(t));
8645
8657
  Ji = n == null ? void 0 : n.describe(t);
8646
8658
  }
8647
8659
  return Ji;
8648
8660
  }
8649
- const Hu = [
8661
+ const Ku = [
8650
8662
  {
8651
8663
  test: /firefox|iceweasel|fxios/i,
8652
8664
  describe(i) {
@@ -8675,7 +8687,7 @@ const Hu = [
8675
8687
  describe(i) {
8676
8688
  return {
8677
8689
  name: "Safari",
8678
- version: Qn(Wu, i),
8690
+ version: Qn(Hu, i),
8679
8691
  os: i.includes("mobile/") ? "iOS" : "macOS",
8680
8692
  osVersion: $i(i)
8681
8693
  };
@@ -8690,8 +8702,8 @@ function Qn(i, e) {
8690
8702
  function $i(i) {
8691
8703
  return i.includes("mac os") ? Qn(/\(.+?(\d+_\d+(:?_\d+)?)/, i, 1).replace(/_/g, ".") : void 0;
8692
8704
  }
8693
- var Ku = "2.20.0";
8694
- const Gu = Ku, zu = 17, wc = 0, di = 1, Ju = di;
8705
+ var Gu = "2.20.0";
8706
+ const zu = Gu, Ju = 17, wc = 0, di = 1, $u = di;
8695
8707
  class lt extends Error {
8696
8708
  constructor(e, t, n) {
8697
8709
  super(t || "an error has occurred"), this.name = "LiveKitError", this.code = e, typeof (n == null ? void 0 : n.cause) < "u" && (this.cause = n == null ? void 0 : n.cause);
@@ -8742,7 +8754,7 @@ class ct extends lt {
8742
8754
  super(20, e ?? "track is invalid"), this.name = "TrackInvalidError";
8743
8755
  }
8744
8756
  }
8745
- class $u extends lt {
8757
+ class Yu extends lt {
8746
8758
  constructor(e) {
8747
8759
  super(10, e ?? "unsupported server"), this.name = "UnsupportedServer";
8748
8760
  }
@@ -8757,7 +8769,7 @@ class Dt extends lt {
8757
8769
  super(13, e ?? "unable to negotiate"), this.name = "NegotiationError";
8758
8770
  }
8759
8771
  }
8760
- class Yu extends lt {
8772
+ class Qu extends lt {
8761
8773
  constructor(e) {
8762
8774
  super(14, e ?? "unable to publish data"), this.name = "PublishDataError";
8763
8775
  }
@@ -8828,7 +8840,7 @@ var R;
8828
8840
  (function(i) {
8829
8841
  i.Message = "message", i.Muted = "muted", i.Unmuted = "unmuted", i.Restarted = "restarted", i.Ended = "ended", i.Subscribed = "subscribed", i.Unsubscribed = "unsubscribed", i.CpuConstrained = "cpuConstrained", i.UpdateSettings = "updateSettings", i.UpdateSubscription = "updateSubscription", i.AudioPlaybackStarted = "audioPlaybackStarted", i.AudioPlaybackFailed = "audioPlaybackFailed", i.AudioSilenceDetected = "audioSilenceDetected", i.VisibilityChanged = "visibilityChanged", i.VideoDimensionsChanged = "videoDimensionsChanged", i.VideoPlaybackStarted = "videoPlaybackStarted", i.VideoPlaybackFailed = "videoPlaybackFailed", i.ElementAttached = "elementAttached", i.ElementDetached = "elementDetached", i.UpstreamPaused = "upstreamPaused", i.UpstreamResumed = "upstreamResumed", i.SubscriptionPermissionChanged = "subscriptionPermissionChanged", i.SubscriptionStatusChanged = "subscriptionStatusChanged", i.SubscriptionFailed = "subscriptionFailed", i.TrackProcessorUpdate = "trackProcessorUpdate", i.AudioTrackFeatureUpdate = "audioTrackFeatureUpdate", i.TranscriptionReceived = "transcriptionReceived", i.TimeSyncUpdate = "timeSyncUpdate", i.PreConnectBufferFlushed = "preConnectBufferFlushed";
8830
8842
  })(R || (R = {}));
8831
- function Qu(i) {
8843
+ function Xu(i) {
8832
8844
  return typeof i > "u" ? i : typeof structuredClone == "function" ? typeof i == "object" && i !== null ? structuredClone(Object.assign({}, i)) : structuredClone(i) : JSON.parse(JSON.stringify(i));
8833
8845
  }
8834
8846
  class $ {
@@ -8857,11 +8869,11 @@ class $ {
8857
8869
  };
8858
8870
  }
8859
8871
  }
8860
- const Xu = ["vp8", "h264"], Zu = ["vp8", "h264", "vp9", "av1", "h265"];
8872
+ const Zu = ["vp8", "h264"], eh = ["vp8", "h264", "vp9", "av1", "h265"];
8861
8873
  function Ec(i) {
8862
- return !!Xu.find((e) => e === i);
8874
+ return !!Zu.find((e) => e === i);
8863
8875
  }
8864
- const eh = Ec;
8876
+ const th = Ec;
8865
8877
  var ia;
8866
8878
  (function(i) {
8867
8879
  i[i.PREFER_REGRESSION = 0] = "PREFER_REGRESSION", i[i.SIMULCAST = 1] = "SIMULCAST", i[i.REGRESSION = 2] = "REGRESSION";
@@ -9005,13 +9017,13 @@ function Ic() {
9005
9017
  return t;
9006
9018
  }
9007
9019
  }
9008
- function th(i) {
9020
+ function nh(i) {
9009
9021
  return i === "audioinput" ? _.Source.Microphone : i === "videoinput" ? _.Source.Camera : _.Source.Unknown;
9010
9022
  }
9011
9023
  function Ds(i) {
9012
9024
  return i === _.Source.Microphone ? "audioinput" : i === _.Source.Camera ? "videoinput" : void 0;
9013
9025
  }
9014
- function nh(i) {
9026
+ function ih(i) {
9015
9027
  var e, t;
9016
9028
  let n = (e = i.video) !== null && e !== void 0 ? e : !0;
9017
9029
  return i.resolution && i.resolution.width > 0 && i.resolution.height > 0 && (n = typeof n == "boolean" ? {} : n, Nt() ? n = Object.assign(Object.assign({}, n), {
@@ -9044,7 +9056,7 @@ function nh(i) {
9044
9056
  function yn(i) {
9045
9057
  return i.split("/")[1].toLowerCase();
9046
9058
  }
9047
- function ih(i) {
9059
+ function sh(i) {
9048
9060
  const e = [];
9049
9061
  return i.forEach((t) => {
9050
9062
  t.track !== void 0 && e.push(new Xs({
@@ -9075,10 +9087,10 @@ function H(i) {
9075
9087
  }, i.track ? H(i.track) : {})
9076
9088
  };
9077
9089
  }
9078
- function sh() {
9090
+ function rh() {
9079
9091
  return typeof RTCRtpReceiver < "u" && typeof RTCRtpReceiver.prototype.getSynchronizationSources == "function";
9080
9092
  }
9081
- function rh(i, e) {
9093
+ function ah(i, e) {
9082
9094
  var t;
9083
9095
  i === void 0 && (i = {}), e === void 0 && (e = {});
9084
9096
  const n = [...Object.keys(e), ...Object.keys(i)], s = {};
@@ -9096,10 +9108,10 @@ function Mc(i) {
9096
9108
  })), {
9097
9109
  audioProcessor: t,
9098
9110
  videoProcessor: n,
9099
- optionsWithoutProcessor: Qu(e)
9111
+ optionsWithoutProcessor: Xu(e)
9100
9112
  };
9101
9113
  }
9102
- function ah(i) {
9114
+ function oh(i) {
9103
9115
  switch (i) {
9104
9116
  case oe.CAMERA:
9105
9117
  return _.Source.Camera;
@@ -9116,11 +9128,11 @@ function ah(i) {
9116
9128
  function sa(i, e) {
9117
9129
  return i.width * i.height < e.width * e.height;
9118
9130
  }
9119
- function oh(i, e) {
9131
+ function ch(i, e) {
9120
9132
  var t;
9121
9133
  return (t = i.layers) === null || t === void 0 ? void 0 : t.find((n) => n.quality === e);
9122
9134
  }
9123
- const ch = 5e3, cn = [];
9135
+ const dh = 5e3, cn = [];
9124
9136
  var Me;
9125
9137
  (function(i) {
9126
9138
  i[i.LOW = 0] = "LOW", i[i.MEDIUM = 1] = "MEDIUM", i[i.HIGH = 2] = "HIGH";
@@ -9141,7 +9153,7 @@ class _ extends Ie.EventEmitter {
9141
9153
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
9142
9154
  var s;
9143
9155
  super(), this.attachedElements = [], this.isMuted = !1, this._streamState = _.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = q, this.appVisibilityChangedListener = () => {
9144
- this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), ch) : this.handleAppVisibilityChanged();
9156
+ this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), dh) : this.handleAppVisibilityChanged();
9145
9157
  }, this.log = Re((s = n.loggerName) !== null && s !== void 0 ? s : pe.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = _.Source.Unknown;
9146
9158
  }
9147
9159
  get logContext() {
@@ -9323,9 +9335,9 @@ function Gt(i, e) {
9323
9335
  }
9324
9336
  i.streamStateFromProto = d;
9325
9337
  })(_ || (_ = {}));
9326
- const dh = "|", ra = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
9327
- function lh(i) {
9328
- const e = i.split(dh);
9338
+ const lh = "|", ra = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
9339
+ function uh(i) {
9340
+ const e = i.split(lh);
9329
9341
  return e.length > 1 ? [e[0], i.substr(e[0].length + 1)] : [i, ""];
9330
9342
  }
9331
9343
  function be(i) {
@@ -9337,7 +9349,7 @@ function As() {
9337
9349
  function Os() {
9338
9350
  return "addTrack" in RTCPeerConnection.prototype;
9339
9351
  }
9340
- function uh() {
9352
+ function hh() {
9341
9353
  if (!("getCapabilities" in RTCRtpSender) || Nt() || Lt())
9342
9354
  return !1;
9343
9355
  const i = RTCRtpSender.getCapabilities("video");
@@ -9351,7 +9363,7 @@ function uh() {
9351
9363
  }
9352
9364
  return e;
9353
9365
  }
9354
- function hh() {
9366
+ function ph() {
9355
9367
  if (!("getCapabilities" in RTCRtpSender) || Lt())
9356
9368
  return !1;
9357
9369
  if (Nt()) {
@@ -9376,20 +9388,20 @@ function qe(i) {
9376
9388
  function xs(i) {
9377
9389
  return !document || Rn() ? !1 : (i || (i = document.createElement("audio")), "setSinkId" in i);
9378
9390
  }
9379
- function ph() {
9391
+ function fh() {
9380
9392
  return typeof RTCPeerConnection > "u" ? !1 : As() || Os();
9381
9393
  }
9382
9394
  function Lt() {
9383
9395
  var i;
9384
9396
  return ((i = Ce()) === null || i === void 0 ? void 0 : i.name) === "Firefox";
9385
9397
  }
9386
- function fh() {
9398
+ function mh() {
9387
9399
  const i = Ce();
9388
9400
  return !!i && i.name === "Chrome" && i.os !== "iOS";
9389
9401
  }
9390
9402
  function Ls() {
9391
9403
  return typeof window < "u" && // @ts-ignore
9392
- typeof window.RTCRtpScriptTransform < "u" && !fh();
9404
+ typeof window.RTCRtpScriptTransform < "u" && !mh();
9393
9405
  }
9394
9406
  function Nt() {
9395
9407
  var i;
@@ -9399,11 +9411,11 @@ function Rn() {
9399
9411
  const i = Ce();
9400
9412
  return (i == null ? void 0 : i.name) === "Safari" || (i == null ? void 0 : i.os) === "iOS";
9401
9413
  }
9402
- function mh() {
9414
+ function gh() {
9403
9415
  const i = Ce();
9404
9416
  return (i == null ? void 0 : i.name) === "Safari" && i.version.startsWith("17.") || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && et(i.osVersion, "17") >= 0;
9405
9417
  }
9406
- function gh(i) {
9418
+ function vh(i) {
9407
9419
  return i || (i = Ce()), (i == null ? void 0 : i.name) === "Safari" && et(i.version, "18.3") > 0 || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && et(i.osVersion, "18.3") > 0;
9408
9420
  }
9409
9421
  function Dc() {
@@ -9413,7 +9425,7 @@ function Dc() {
9413
9425
  (e = (i = navigator.userAgentData) === null || i === void 0 ? void 0 : i.mobile) !== null && e !== void 0 ? e : /Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent)
9414
9426
  ) : !1;
9415
9427
  }
9416
- function vh() {
9428
+ function bh() {
9417
9429
  const i = Ce(), e = "17.2";
9418
9430
  if (i)
9419
9431
  return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && et(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && et(i.version, e) >= 0;
@@ -9461,29 +9473,29 @@ function et(i, e) {
9461
9473
  }
9462
9474
  return i === "" && e !== "" ? -1 : e === "" ? 1 : t.length == n.length ? 0 : t.length < n.length ? -1 : 1;
9463
9475
  }
9464
- function bh(i) {
9476
+ function yh(i) {
9465
9477
  for (const e of i)
9466
9478
  e.target.handleResize(e);
9467
9479
  }
9468
- function yh(i) {
9480
+ function kh(i) {
9469
9481
  for (const e of i)
9470
9482
  e.target.handleVisibilityChanged(e);
9471
9483
  }
9472
9484
  let Qi = null;
9473
- const oa = () => (Qi || (Qi = new ResizeObserver(bh)), Qi);
9485
+ const oa = () => (Qi || (Qi = new ResizeObserver(yh)), Qi);
9474
9486
  let Xi = null;
9475
- const ca = () => (Xi || (Xi = new IntersectionObserver(yh, {
9487
+ const ca = () => (Xi || (Xi = new IntersectionObserver(kh, {
9476
9488
  root: null,
9477
9489
  rootMargin: "0px"
9478
9490
  })), Xi);
9479
- function kh(i) {
9491
+ function Th(i) {
9480
9492
  var e;
9481
9493
  const t = new Po({
9482
9494
  capabilities: i,
9483
9495
  sdk: Ro.JS,
9484
- protocol: zu,
9485
- clientProtocol: Ju,
9486
- version: Gu
9496
+ protocol: Ju,
9497
+ clientProtocol: $u,
9498
+ version: zu
9487
9499
  });
9488
9500
  return Ge() && (t.os = (e = Oc()) !== null && e !== void 0 ? e : ""), t;
9489
9501
  }
@@ -9525,8 +9537,8 @@ class he {
9525
9537
  });
9526
9538
  }
9527
9539
  }
9528
- function Th(i) {
9529
- return Zu.includes(i);
9540
+ function Sh(i) {
9541
+ return eh.includes(i);
9530
9542
  }
9531
9543
  function At(i) {
9532
9544
  if (typeof i == "string" || typeof i == "number")
@@ -9539,13 +9551,13 @@ function At(i) {
9539
9551
  return Array.isArray(i.ideal) ? i.ideal[0] : i.ideal;
9540
9552
  throw Error("could not unwrap constraint");
9541
9553
  }
9542
- function Sh(i) {
9554
+ function Ch(i) {
9543
9555
  return i.startsWith("http") ? i.replace(/^(http)/, "ws") : i;
9544
9556
  }
9545
9557
  function In(i) {
9546
9558
  return i.startsWith("ws") ? i.replace(/^(ws)/, "http") : i;
9547
9559
  }
9548
- function Ch(i, e) {
9560
+ function _h(i, e) {
9549
9561
  return i.segments.map((t) => {
9550
9562
  let n = t.id, s = t.text, r = t.language, a = t.startTime, o = t.endTime, d = t.final;
9551
9563
  var c;
@@ -9562,7 +9574,7 @@ function Ch(i, e) {
9562
9574
  };
9563
9575
  });
9564
9576
  }
9565
- function _h(i) {
9577
+ function wh(i) {
9566
9578
  const e = i.id, t = i.timestamp, n = i.message, s = i.editTimestamp;
9567
9579
  return {
9568
9580
  id: e,
@@ -9609,16 +9621,16 @@ function nt(i) {
9609
9621
  function Ns(i) {
9610
9622
  return !!i && !i.isLocal;
9611
9623
  }
9612
- function wh(i) {
9624
+ function Eh(i) {
9613
9625
  return !!i && !i.isLocal;
9614
9626
  }
9615
9627
  function es(i) {
9616
9628
  return Ns(i) && dt(i);
9617
9629
  }
9618
- function Eh(i) {
9630
+ function Ph(i) {
9619
9631
  return i.isLocal;
9620
9632
  }
9621
- function Ph(i, e) {
9633
+ function Rh(i, e) {
9622
9634
  const t = [];
9623
9635
  let n = new TextEncoder().encode(i);
9624
9636
  for (; n.length > e; ) {
@@ -9633,7 +9645,7 @@ function Ph(i, e) {
9633
9645
  }
9634
9646
  return n.length > 0 && t.push(n), t;
9635
9647
  }
9636
- function Rh(i) {
9648
+ function Ih(i) {
9637
9649
  var e;
9638
9650
  const t = i.get("Cache-Control");
9639
9651
  if (t) {
@@ -9645,21 +9657,21 @@ function Rh(i) {
9645
9657
  function xc() {
9646
9658
  return typeof CompressionStream < "u";
9647
9659
  }
9648
- function Ih() {
9660
+ function Mh() {
9649
9661
  return xc() && !Lt();
9650
9662
  }
9651
- function Mh(i, e) {
9663
+ function Dh(i, e) {
9652
9664
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
9653
- const n = Dh(i, e);
9665
+ const n = Ah(i, e);
9654
9666
  return t ? n : ar(n, "v1");
9655
9667
  }
9656
- function Dh(i, e) {
9657
- const t = new URL(Sh(i));
9668
+ function Ah(i, e) {
9669
+ const t = new URL(Ch(i));
9658
9670
  return e.forEach((n, s) => {
9659
9671
  t.searchParams.set(s, n);
9660
9672
  }), ar(t, "rtc");
9661
9673
  }
9662
- function Ah(i) {
9674
+ function Oh(i) {
9663
9675
  const e = new URL(In(i));
9664
9676
  return ar(e, "validate");
9665
9677
  }
@@ -9678,7 +9690,7 @@ function ua(i) {
9678
9690
  return Hr.fromBinary(new Uint8Array(i));
9679
9691
  throw new Error("could not decode websocket message: ".concat(typeof i));
9680
9692
  }
9681
- function Oh(i) {
9693
+ function xh(i) {
9682
9694
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Unknown reason";
9683
9695
  if (!(i instanceof AbortSignal))
9684
9696
  return e;
@@ -9692,11 +9704,11 @@ function Oh(i) {
9692
9704
  return "toString" in t ? t.toString() : e;
9693
9705
  }
9694
9706
  }
9695
- const xh = 10, ln = "lk_e2ee", Lh = "LKFrameEncryptionKey", Nh = {
9707
+ const Lh = 10, ln = "lk_e2ee", Nh = "LKFrameEncryptionKey", Uh = {
9696
9708
  sharedKey: !1,
9697
- ratchetSalt: Lh,
9709
+ ratchetSalt: Nh,
9698
9710
  ratchetWindowSize: 8,
9699
- failureTolerance: xh,
9711
+ failureTolerance: Lh,
9700
9712
  keyringSize: 16,
9701
9713
  keySize: 128
9702
9714
  };
@@ -9716,24 +9728,24 @@ var pa;
9716
9728
  (function(i) {
9717
9729
  i.Error = "cryptorError";
9718
9730
  })(pa || (pa = {}));
9719
- function Uh() {
9720
- return or() || Fh();
9721
- }
9722
9731
  function Fh() {
9732
+ return or() || Bh();
9733
+ }
9734
+ function Bh() {
9723
9735
  return typeof window < "u" && typeof window.RTCRtpScriptTransform < "u";
9724
9736
  }
9725
9737
  function or() {
9726
9738
  return typeof window < "u" && typeof window.RTCRtpSender < "u" && // @ts-ignore
9727
9739
  typeof window.RTCRtpSender.prototype.createEncodedStreams < "u";
9728
9740
  }
9729
- function Bh(i) {
9741
+ function Vh(i) {
9730
9742
  var e, t, n, s, r;
9731
9743
  if (((e = i.value) === null || e === void 0 ? void 0 : e.case) !== "sipDtmf" && ((t = i.value) === null || t === void 0 ? void 0 : t.case) !== "metrics" && ((n = i.value) === null || n === void 0 ? void 0 : n.case) !== "speaker" && ((s = i.value) === null || s === void 0 ? void 0 : s.case) !== "transcription" && ((r = i.value) === null || r === void 0 ? void 0 : r.case) !== "encryptedPacket")
9732
9744
  return new ko({
9733
9745
  value: i.value
9734
9746
  });
9735
9747
  }
9736
- class Wf extends Ie.EventEmitter {
9748
+ class Hf extends Ie.EventEmitter {
9737
9749
  constructor() {
9738
9750
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9739
9751
  super(), this.latestManuallySetKeyIndex = 0, this.onKeyRatcheted = (t, n, s) => {
@@ -9742,7 +9754,7 @@ class Wf extends Ie.EventEmitter {
9742
9754
  participantId: n,
9743
9755
  keyIndex: s
9744
9756
  });
9745
- }, this.keyInfoMap = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, Nh), e), this.on(kt.KeyRatcheted, this.onKeyRatcheted);
9757
+ }, this.keyInfoMap = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, Uh), e), this.on(kt.KeyRatcheted, this.onKeyRatcheted);
9746
9758
  }
9747
9759
  /**
9748
9760
  * callback to invoke once a key has been set for a participant
@@ -9786,11 +9798,11 @@ function Dn(i) {
9786
9798
  function ui(i) {
9787
9799
  return !!(i != null && i.timestamp || i != null && i.frameId);
9788
9800
  }
9789
- function Vh(i) {
9801
+ function qh(i) {
9790
9802
  const e = [];
9791
9803
  return i != null && i.timestamp && e.push(Xt.PTF_USER_TIMESTAMP), i != null && i.frameId && e.push(Xt.PTF_FRAME_ID), e;
9792
9804
  }
9793
- function qh(i) {
9805
+ function jh(i) {
9794
9806
  if (!i || i.length === 0)
9795
9807
  return;
9796
9808
  const e = {};
@@ -9815,7 +9827,7 @@ function cr(i) {
9815
9827
  g[m] = arguments[m];
9816
9828
  const T = this;
9817
9829
  return new Promise((k, S) => {
9818
- const L = function() {
9830
+ const N = function() {
9819
9831
  if (r = void 0, c = Date.now(), !a) {
9820
9832
  const y = i.apply(T, g);
9821
9833
  o && o(y), l.forEach((C) => {
@@ -9824,7 +9836,7 @@ function cr(i) {
9824
9836
  }), l = [];
9825
9837
  }
9826
9838
  }, v = a && r === void 0;
9827
- if (r !== void 0 && ce.clearTimeout(r), r = ce.setTimeout(L, u()), v) {
9839
+ if (r !== void 0 && ce.clearTimeout(r), r = ce.setTimeout(N, u()), v) {
9828
9840
  const y = i.apply(T, g);
9829
9841
  return o && o(y), k(y);
9830
9842
  }
@@ -9907,7 +9919,7 @@ class Nc extends _ {
9907
9919
  }
9908
9920
  /* @internal */
9909
9921
  startMonitor() {
9910
- this.monitorInterval || (this.monitorInterval = setInterval(() => this.monitorReceiver(), dr)), sh() && this.registerTimeSyncUpdate();
9922
+ this.monitorInterval || (this.monitorInterval = setInterval(() => this.monitorReceiver(), dr)), rh() && this.registerTimeSyncUpdate();
9911
9923
  }
9912
9924
  registerTimeSyncUpdate() {
9913
9925
  const e = () => {
@@ -9973,7 +9985,7 @@ class lr extends Nc {
9973
9985
  }
9974
9986
  attach(e) {
9975
9987
  if (e ? super.attach(e) : e = super.attach(), this.adaptiveStreamSettings && this.elementInfos.find((t) => t.element === e) === void 0) {
9976
- const t = new jh(e);
9988
+ const t = new Wh(e);
9977
9989
  this.observeElementInfo(t);
9978
9990
  }
9979
9991
  return e;
@@ -10093,7 +10105,7 @@ class lr extends Nc {
10093
10105
  return t === "screen" ? aa() : t || (aa() > 2 ? 2 : 1);
10094
10106
  }
10095
10107
  }
10096
- class jh {
10108
+ class Wh {
10097
10109
  get visible() {
10098
10110
  return this.isPiP || this.isIntersecting;
10099
10111
  }
@@ -10148,7 +10160,7 @@ function Us(i, e) {
10148
10160
  i = i.offsetParent, n += i.offsetTop, s += i.offsetLeft;
10149
10161
  return n < t.pageYOffset + t.innerHeight && s < t.pageXOffset + t.innerWidth && n + a > t.pageYOffset && s + r > t.pageXOffset && !d && l !== "none";
10150
10162
  }
10151
- class Wh extends Ie.EventEmitter {
10163
+ class Hh extends Ie.EventEmitter {
10152
10164
  constructor(e, t) {
10153
10165
  super(), this.decryptDataRequests = /* @__PURE__ */ new Map(), this.encryptDataRequests = /* @__PURE__ */ new Map(), this.onWorkerMessage = (n) => {
10154
10166
  var s, r;
@@ -10217,7 +10229,7 @@ class Wh extends Ie.EventEmitter {
10217
10229
  * @internal
10218
10230
  */
10219
10231
  setup(e) {
10220
- if (!Uh())
10232
+ if (!Fh())
10221
10233
  throw new ir("tried to setup end-to-end encryption on an unsupported browser");
10222
10234
  if (q.info("setting up e2ee"), e !== this.room) {
10223
10235
  this.room = e, this.setupEventListeners(e, this.keyProvider);
@@ -10225,7 +10237,7 @@ class Wh extends Ie.EventEmitter {
10225
10237
  kind: "init",
10226
10238
  data: {
10227
10239
  keyProviderOptions: this.keyProvider.getOptions(),
10228
- loglevel: Pu.getLevel()
10240
+ loglevel: Ru.getLevel()
10229
10241
  }
10230
10242
  };
10231
10243
  this.worker && (q.info("initializing worker", {
@@ -10518,13 +10530,13 @@ class Wh extends Ie.EventEmitter {
10518
10530
  }
10519
10531
  }
10520
10532
  }
10521
- const Hh = 300;
10522
- class Kh {
10533
+ const Kh = 300;
10534
+ class Gh {
10523
10535
  constructor() {
10524
10536
  this.metadataMap = /* @__PURE__ */ new Map(), this.activeSsrc = 0;
10525
10537
  }
10526
10538
  storeMetadata(e, t, n) {
10527
- for (this.activeSsrc !== 0 && this.activeSsrc !== t && this.metadataMap.clear(), this.activeSsrc = t; this.metadataMap.size >= Hh; ) {
10539
+ for (this.activeSsrc !== 0 && this.activeSsrc !== t && this.metadataMap.clear(), this.activeSsrc = t; this.metadataMap.size >= Kh; ) {
10528
10540
  const s = this.metadataMap.keys().next().value;
10529
10541
  this.metadataMap.delete(s);
10530
10542
  }
@@ -10537,7 +10549,7 @@ class Kh {
10537
10549
  this.metadataMap.clear(), this.activeSsrc = 0;
10538
10550
  }
10539
10551
  }
10540
- class Gh {
10552
+ class zh {
10541
10553
  constructor(e) {
10542
10554
  this.extractors = /* @__PURE__ */ new Map(), this.workerPipelines = /* @__PURE__ */ new Map(), this.onWorkerMessage = (t) => {
10543
10555
  const n = t.data;
@@ -10578,7 +10590,7 @@ class Gh {
10578
10590
  q.warn("frame metadata transform not supported; skipping extraction");
10579
10591
  return;
10580
10592
  }
10581
- const d = new Kh(), c = e.mediaStreamID;
10593
+ const d = new Gh(), c = e.mediaStreamID;
10582
10594
  this.extractors.set(c, d), e.frameMetadataExtractor = d, !(!((r = this.room) === null || r === void 0) && r.hasE2EESetup) && this.setupWorkerReceiver(a, c, !0);
10583
10595
  }
10584
10596
  setupPassthroughReceiver(e, t) {
@@ -10654,7 +10666,7 @@ class Gh {
10654
10666
  this.extractors.clear(), this.workerPipelines.clear(), (e = this.worker) === null || e === void 0 || e.terminate();
10655
10667
  }
10656
10668
  }
10657
- const zh = 500, Jh = 15e3;
10669
+ const Jh = 500, $h = 15e3;
10658
10670
  class Jt {
10659
10671
  // eslint-disable-next-line @typescript-eslint/no-empty-function
10660
10672
  constructor() {
@@ -10669,7 +10681,7 @@ class Jt {
10669
10681
  if (!s)
10670
10682
  return;
10671
10683
  let r = (t = this.failedConnectionAttempts.get(s)) !== null && t !== void 0 ? t : 0;
10672
- this.failedConnectionAttempts.set(s, r + 1), this.backOffPromises.set(s, be(Math.min(zh * Math.pow(2, r), Jh)));
10684
+ this.failedConnectionAttempts.set(s, r + 1), this.backOffPromises.set(s, be(Math.min(Jh * Math.pow(2, r), $h)));
10673
10685
  }
10674
10686
  getBackOffPromise(e) {
10675
10687
  const t = new URL(e), n = t && Yi(t);
@@ -10888,7 +10900,7 @@ class tn extends xe {
10888
10900
  return new tn("0x".concat(e.toString(16), " is a reserved value."), Ot.Reserved);
10889
10901
  }
10890
10902
  }
10891
- const $h = {
10903
+ const Yh = {
10892
10904
  fromNumber(i) {
10893
10905
  if (i === 0)
10894
10906
  throw tn.reserved(i);
@@ -10897,7 +10909,7 @@ const $h = {
10897
10909
  return i;
10898
10910
  }
10899
10911
  };
10900
- class Yh {
10912
+ class Qh {
10901
10913
  constructor() {
10902
10914
  this.value = 0;
10903
10915
  }
@@ -10931,7 +10943,7 @@ var kn;
10931
10943
  (function(i) {
10932
10944
  i[i.WAITING = 0] = "WAITING", i[i.RUNNING = 1] = "RUNNING", i[i.COMPLETED = 2] = "COMPLETED";
10933
10945
  })(kn || (kn = {}));
10934
- class Qh {
10946
+ class Xh {
10935
10947
  constructor() {
10936
10948
  this.pendingTasks = /* @__PURE__ */ new Map(), this.taskMutex = new ge(), this.nextTaskIndex = 0;
10937
10949
  }
@@ -10961,7 +10973,7 @@ class Qh {
10961
10973
  return Array.from(this.pendingTasks.values());
10962
10974
  }
10963
10975
  }
10964
- class Xh {
10976
+ class Zh {
10965
10977
  get readyState() {
10966
10978
  return this.ws.readyState;
10967
10979
  }
@@ -11026,9 +11038,9 @@ class Xh {
11026
11038
  }), t.signal && (t.signal.onabort = () => r.close()), this.close = a;
11027
11039
  }
11028
11040
  }
11029
- const Zh = ["syncState", "trickle", "offer", "answer", "simulate", "leave"];
11030
- function ep(i) {
11031
- const e = Zh.indexOf(i.case) >= 0;
11041
+ const ep = ["syncState", "trickle", "offer", "answer", "simulate", "leave"];
11042
+ function tp(i) {
11043
+ const e = ep.indexOf(i.case) >= 0;
11032
11044
  return q.trace("request allowed to bypass queue:", {
11033
11045
  canPass: e,
11034
11046
  req: i
@@ -11038,7 +11050,7 @@ var Y;
11038
11050
  (function(i) {
11039
11051
  i[i.CONNECTING = 0] = "CONNECTING", i[i.CONNECTED = 1] = "CONNECTED", i[i.RECONNECTING = 2] = "RECONNECTING", i[i.DISCONNECTING = 3] = "DISCONNECTING", i[i.DISCONNECTED = 4] = "DISCONNECTED";
11040
11052
  })(Y || (Y = {}));
11041
- const tp = 250;
11053
+ const np = 250;
11042
11054
  class pr {
11043
11055
  get currentState() {
11044
11056
  return this.state;
@@ -11057,7 +11069,7 @@ class pr {
11057
11069
  var n;
11058
11070
  this.rtt = 0, this.state = Y.DISCONNECTED, this.log = q, this._requestId = 0, this.useV0SignalPath = !1, this.resetCallbacks = () => {
11059
11071
  this.onAnswer = void 0, this.onLeave = void 0, this.onLocalTrackPublished = void 0, this.onLocalTrackUnpublished = void 0, this.onNegotiateRequested = void 0, this.onOffer = void 0, this.onRemoteMuteChanged = void 0, this.onSubscribedQualityUpdate = void 0, this.onTokenRefresh = void 0, this.onTrickle = void 0, this.onClose = void 0, this.onMediaSectionsRequirement = void 0;
11060
- }, this.loggerContextCb = t.loggerContextCb, this.log = Re((n = t.loggerName) !== null && n !== void 0 ? n : pe.Signal, () => this.logContext), this.useJSON = e, this.requestQueue = new Qh(), this.queuedRequests = [], this.closingLock = new ge(), this.connectionLock = new ge(), this.state = Y.DISCONNECTED;
11072
+ }, this.loggerContextCb = t.loggerContextCb, this.log = Re((n = t.loggerName) !== null && n !== void 0 ? n : pe.Signal, () => this.logContext), this.useJSON = e, this.requestQueue = new Xh(), this.queuedRequests = [], this.closingLock = new ge(), this.connectionLock = new ge(), this.state = Y.DISCONNECTED;
11061
11073
  }
11062
11074
  get logContext() {
11063
11075
  var e, t;
@@ -11092,27 +11104,27 @@ class pr {
11092
11104
  return function* () {
11093
11105
  const h = yield c.connectionLock.lock();
11094
11106
  c.connectOptions = o, c.useV0SignalPath = l;
11095
- const p = kh(o.clientInfoCapabilities), g = l ? np(a, p, o) : yield ip(a, p, o, u), m = Mh(r, g, l).toString(), T = Ah(m).toString();
11107
+ const p = Th(o.clientInfoCapabilities), g = l ? ip(a, p, o) : yield sp(a, p, o, u), m = Dh(r, g, l).toString(), T = Oh(m).toString();
11096
11108
  return new Promise((k, S) => f(c, void 0, void 0, function* () {
11097
- var L, v;
11109
+ var N, v;
11098
11110
  try {
11099
11111
  let y = !1;
11100
11112
  const C = (O) => f(this, void 0, void 0, function* () {
11101
11113
  if (y)
11102
11114
  return;
11103
11115
  y = !0;
11104
- const B = O instanceof Event ? O.currentTarget : O, W = Oh(B, "Abort handler called");
11116
+ const B = O instanceof Event ? O.currentTarget : O, W = xh(B, "Abort handler called");
11105
11117
  this.streamWriter && !this.isDisconnected ? this.sendLeave().then(() => this.close(W)).catch((Z) => {
11106
11118
  this.log.error(Z), this.close();
11107
11119
  }) : this.close(), I(), S(F.cancelled(W));
11108
11120
  });
11109
11121
  d == null || d.addEventListener("abort", C);
11110
11122
  const I = () => {
11111
- clearTimeout(x), d == null || d.removeEventListener("abort", C);
11112
- }, x = setTimeout(() => {
11123
+ clearTimeout(L), d == null || d.removeEventListener("abort", C);
11124
+ }, L = setTimeout(() => {
11113
11125
  C(F.timeout("room connection has timed out (signal)"));
11114
11126
  }, o.websocketTimeout), V = (O, B) => {
11115
- this.handleSignalConnected(O, x, B);
11127
+ this.handleSignalConnected(O, L, B);
11116
11128
  }, A = new URL(m);
11117
11129
  if (A.searchParams.has("access_token") && A.searchParams.set("access_token", "<redacted>"), this.ws) {
11118
11130
  const O = performance.now();
@@ -11121,7 +11133,7 @@ class pr {
11121
11133
  this.log.info("signal connecting to ".concat(A), {
11122
11134
  reconnect: o.reconnect,
11123
11135
  reconnectReason: o.reconnectReason
11124
- }), this.ws = new Xh(m);
11136
+ }), this.ws = new Zh(m);
11125
11137
  try {
11126
11138
  this.ws.closed.then((ye) => {
11127
11139
  var ut;
@@ -11136,21 +11148,21 @@ class pr {
11136
11148
  });
11137
11149
  const O = yield this.ws.opened.catch((ye) => f(this, void 0, void 0, function* () {
11138
11150
  if (this.state !== Y.CONNECTED) {
11139
- this.state = Y.DISCONNECTED, clearTimeout(x);
11151
+ this.state = Y.DISCONNECTED, clearTimeout(L);
11140
11152
  const ut = yield this.handleConnectionError(ye, T);
11141
11153
  S(ut);
11142
11154
  return;
11143
11155
  }
11144
11156
  this.handleWSError(ye), S(ye);
11145
11157
  }));
11146
- if (clearTimeout(x), !O)
11158
+ if (clearTimeout(L), !O)
11147
11159
  return;
11148
11160
  const B = O.readable.getReader();
11149
11161
  this.streamWriter = O.writable.getWriter();
11150
11162
  const W = yield B.read();
11151
11163
  if (B.releaseLock(), !W.value)
11152
11164
  throw F.internal("no message received as first message");
11153
- const Z = ua(W.value), ze = this.validateFirstMessage(Z, (L = o.reconnect) !== null && L !== void 0 ? L : !1);
11165
+ const Z = ua(W.value), ze = this.validateFirstMessage(Z, (N = o.reconnect) !== null && N !== void 0 ? N : !1);
11154
11166
  if (!ze.isValid) {
11155
11167
  S(ze.error);
11156
11168
  return;
@@ -11202,7 +11214,7 @@ class pr {
11202
11214
  reason: n
11203
11215
  });
11204
11216
  const r = e.ws.closed;
11205
- e.ws = void 0, e.streamWriter = void 0, yield Promise.race([r, be(tp)]);
11217
+ e.ws = void 0, e.streamWriter = void 0, yield Promise.race([r, be(np)]);
11206
11218
  }
11207
11219
  } catch (r) {
11208
11220
  e.log.debug("websocket error while closing", {
@@ -11384,7 +11396,7 @@ class pr {
11384
11396
  var n = this;
11385
11397
  let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
11386
11398
  return function* () {
11387
- if (!s && !ep(t) && n.state === Y.RECONNECTING) {
11399
+ if (!s && !tp(t) && n.state === Y.RECONNECTING) {
11388
11400
  n.queuedRequests.push(() => f(n, void 0, void 0, function* () {
11389
11401
  yield this.sendRequest(t, !0);
11390
11402
  }));
@@ -11398,7 +11410,7 @@ class pr {
11398
11410
  n.log.error("cannot send signal request before connected, type: ".concat(t == null ? void 0 : t.case));
11399
11411
  return;
11400
11412
  }
11401
- const a = new $l({
11413
+ const a = new Yl({
11402
11414
  message: t
11403
11415
  });
11404
11416
  try {
@@ -11578,16 +11590,16 @@ function Rt(i, e) {
11578
11590
  id: e
11579
11591
  });
11580
11592
  }
11581
- function np(i, e, t) {
11593
+ function ip(i, e, t) {
11582
11594
  var n;
11583
11595
  const s = new URLSearchParams();
11584
11596
  return s.set("access_token", i), t.reconnect && (s.set("reconnect", "1"), t.sid && s.set("sid", t.sid)), s.set("auto_subscribe", t.autoSubscribe ? "1" : "0"), s.set("sdk", Ge() ? "reactnative" : "js"), s.set("version", e.version), s.set("protocol", e.protocol.toString()), s.set("client_protocol", e.clientProtocol.toString()), e.deviceModel && s.set("device_model", e.deviceModel), e.os && s.set("os", e.os), e.osVersion && s.set("os_version", e.osVersion), e.browser && s.set("browser", e.browser), e.browserVersion && s.set("browser_version", e.browserVersion), t.adaptiveStream && s.set("adaptive_stream", "1"), t.reconnectReason && s.set("reconnect_reason", t.reconnectReason.toString()), !((n = navigator.connection) === null || n === void 0) && n.type && s.set("network", navigator.connection.type), s;
11585
11597
  }
11586
- function ip(i, e, t, n) {
11598
+ function sp(i, e, t, n) {
11587
11599
  return f(this, void 0, void 0, function* () {
11588
11600
  const s = new URLSearchParams();
11589
11601
  s.set("access_token", i);
11590
- const r = new ku({
11602
+ const r = new Tu({
11591
11603
  clientInfo: e,
11592
11604
  connectionSettings: new Ko({
11593
11605
  autoSubscribe: !!t.autoSubscribe,
@@ -11605,18 +11617,18 @@ function ip(i, e, t, n) {
11605
11617
  p.write(new Uint8Array(a)), p.close();
11606
11618
  const g = [], m = h.readable.getReader();
11607
11619
  for (; ; ) {
11608
- const L = yield m.read(), v = L.done, y = L.value;
11620
+ const N = yield m.read(), v = N.done, y = N.value;
11609
11621
  if (v) break;
11610
11622
  g.push(y);
11611
11623
  }
11612
- const T = g.reduce((L, v) => L + v.length, 0), k = new Uint8Array(T);
11624
+ const T = g.reduce((N, v) => N + v.length, 0), k = new Uint8Array(T);
11613
11625
  let S = 0;
11614
- for (const L of g)
11615
- k.set(L, S), S += L.length;
11626
+ for (const N of g)
11627
+ k.set(N, S), S += N.length;
11616
11628
  o = k, d = ys.GZIP;
11617
11629
  } else
11618
11630
  o = a, d = ys.NONE;
11619
- const l = new Tu({
11631
+ const l = new Su({
11620
11632
  joinRequest: o,
11621
11633
  compression: d
11622
11634
  }).toBinary(), u = (h) => {
@@ -11656,7 +11668,7 @@ class ga {
11656
11668
  return this.buffer.length;
11657
11669
  }
11658
11670
  }
11659
- class sp {
11671
+ class rp {
11660
11672
  /**
11661
11673
  * @param ttl ttl of the key (ms)
11662
11674
  */
@@ -12192,7 +12204,7 @@ function fr() {
12192
12204
  }), ss.exports;
12193
12205
  }
12194
12206
  var ba;
12195
- function rp() {
12207
+ function ap() {
12196
12208
  return ba || (ba = 1, function(i) {
12197
12209
  var e = function(o) {
12198
12210
  return String(Number(o)) === o ? Number(o) : o;
@@ -12260,7 +12272,7 @@ function rp() {
12260
12272
  }(is)), is;
12261
12273
  }
12262
12274
  var rs, ya;
12263
- function ap() {
12275
+ function op() {
12264
12276
  if (ya) return rs;
12265
12277
  ya = 1;
12266
12278
  var i = fr(), e = /%[sdv%]/g, t = function(a) {
@@ -12316,14 +12328,14 @@ function ap() {
12316
12328
  }, rs;
12317
12329
  }
12318
12330
  var ka;
12319
- function op() {
12331
+ function cp() {
12320
12332
  if (ka) return Le;
12321
12333
  ka = 1;
12322
- var i = rp(), e = ap(), t = fr();
12334
+ var i = ap(), e = op(), t = fr();
12323
12335
  return Le.grammar = t, Le.write = e, Le.parse = i.parse, Le.parseParams = i.parseParams, Le.parseFmtpConfig = i.parseFmtpConfig, Le.parsePayloads = i.parsePayloads, Le.parseRemoteCandidates = i.parseRemoteCandidates, Le.parseImageAttributes = i.parseImageAttributes, Le.parseSimulcastStreamList = i.parseSimulcastStreamList, Le;
12324
12336
  }
12325
- var De = op();
12326
- const cp = 0.7, dp = 20, gt = {
12337
+ var De = cp();
12338
+ const dp = 0.7, lp = 20, gt = {
12327
12339
  NegotiationStarted: "negotiationStarted",
12328
12340
  NegotiationComplete: "negotiationComplete",
12329
12341
  // Fired with the offerId for every successful publisher answer application,
@@ -12350,7 +12362,7 @@ class Ta extends Ie.EventEmitter {
12350
12362
  else
12351
12363
  throw r;
12352
12364
  }
12353
- }), dp), this.close = () => {
12365
+ }), lp), this.close = () => {
12354
12366
  this._pc && (this.pendingInitialOffer = void 0, this._pc.close(), this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc.onicegatheringstatechange = null, this._pc.ondatachannel = null, this._pc.onnegotiationneeded = null, this._pc.onsignalingstatechange = null, this._pc.onicecandidate = null, this._pc.ondatachannel = null, this._pc.ontrack = null, this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc = null);
12355
12367
  }, this.log = Re((n = t.loggerName) !== null && n !== void 0 ? n : pe.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new ge();
12356
12368
  }
@@ -12403,7 +12415,7 @@ class Ta extends Ie.EventEmitter {
12403
12415
  })), !1;
12404
12416
  let r;
12405
12417
  if (e.type === "offer") {
12406
- let a = lp(e), o = a.stereoMids, d = a.nackMids;
12418
+ let a = up(e), o = a.stereoMids, d = a.nackMids;
12407
12419
  this.remoteStereoMids = o, this.remoteNackMids = d;
12408
12420
  } else if (e.type === "answer") {
12409
12421
  if (this.pendingInitialOffer && this._pc) {
@@ -12505,7 +12517,7 @@ class Ta extends Ie.EventEmitter {
12505
12517
  let c = 0;
12506
12518
  if (o.rtp.some((u) => u.codec.toUpperCase() === d.codec.toUpperCase() ? (c = u.payload, !0) : !1), c === 0 || (qe(d.codec) && !Nt() && this.ensureVideoDDExtensionForSVC(o, a), !qe(d.codec)))
12507
12519
  return !0;
12508
- const l = Math.round(d.maxbr * cp);
12520
+ const l = Math.round(d.maxbr * dp);
12509
12521
  for (const u of o.fmtp)
12510
12522
  if (u.payload === c) {
12511
12523
  u.config.includes("x-google-start-bitrate") || (u.config += ";x-google-start-bitrate=".concat(l));
@@ -12686,7 +12698,7 @@ function Sa(i, e, t) {
12686
12698
  type: "nack"
12687
12699
  }), (e.includes(n) || e.length === 1 && e[0] === "all") && i.fmtp.some((r) => r.payload === s ? (r.config.includes("stereo=1") || (r.config += ";stereo=1"), !0) : !1));
12688
12700
  }
12689
- function lp(i) {
12701
+ function up(i) {
12690
12702
  var e;
12691
12703
  const t = [], n = [], s = De.parse((e = i.sdp) !== null && e !== void 0 ? e : "");
12692
12704
  let r = 0;
@@ -12708,7 +12720,7 @@ function Fn(i) {
12708
12720
  function mr(i) {
12709
12721
  return typeof i == "number" ? i.toFixed(0) : i;
12710
12722
  }
12711
- const Fs = "vp8", up = {
12723
+ const Fs = "vp8", hp = {
12712
12724
  audioPreset: Rs.music,
12713
12725
  dtx: !0,
12714
12726
  red: !0,
@@ -12732,11 +12744,11 @@ const Fs = "vp8", up = {
12732
12744
  ideal: "default"
12733
12745
  },
12734
12746
  resolution: Pn.h720.resolution
12735
- }, hp = {
12747
+ }, pp = {
12736
12748
  adaptiveStream: !1,
12737
12749
  dynacast: !1,
12738
12750
  stopLocalTrackOnUnpublish: !0,
12739
- reconnectPolicy: new Iu(),
12751
+ reconnectPolicy: new Mu(),
12740
12752
  disconnectOnPageLeave: !0,
12741
12753
  webAudioMix: !1,
12742
12754
  singlePeerConnection: !0
@@ -12946,13 +12958,13 @@ class Ca {
12946
12958
  }
12947
12959
  }
12948
12960
  const vr = typeof MediaRecorder < "u";
12949
- class pp {
12961
+ class fp {
12950
12962
  constructor() {
12951
12963
  throw new Error("MediaRecorder is not available in this environment");
12952
12964
  }
12953
12965
  }
12954
- const fp = vr ? MediaRecorder : pp;
12955
- class mp extends fp {
12966
+ const mp = vr ? MediaRecorder : fp;
12967
+ class gp extends mp {
12956
12968
  constructor(e, t) {
12957
12969
  if (!vr)
12958
12970
  throw new Error("MediaRecorder is not available in this environment");
@@ -12983,10 +12995,10 @@ class mp extends fp {
12983
12995
  }), this.addEventListener("stop", a), this.addEventListener("error", o);
12984
12996
  }
12985
12997
  }
12986
- function gp() {
12998
+ function vp() {
12987
12999
  return vr;
12988
13000
  }
12989
- const vp = 1e3, bp = 1e4;
13001
+ const bp = 1e3, yp = 1e4;
12990
13002
  class Vc extends _ {
12991
13003
  /** @internal */
12992
13004
  get sender() {
@@ -13085,7 +13097,7 @@ class Vc extends _ {
13085
13097
  waitForDimensions() {
13086
13098
  return f(this, arguments, void 0, function() {
13087
13099
  var e = this;
13088
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : vp;
13100
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bp;
13089
13101
  return function* () {
13090
13102
  var n;
13091
13103
  if (e.kind === _.Kind.Audio)
@@ -13162,7 +13174,7 @@ class Vc extends _ {
13162
13174
  const n = yield this.trackChangeLock.lock();
13163
13175
  try {
13164
13176
  e || (e = this._constraints);
13165
- const s = e, r = s.deviceId, a = s.facingMode, o = Mu(e, ["deviceId", "facingMode"]);
13177
+ const s = e, r = s.deviceId, a = s.facingMode, o = Du(e, ["deviceId", "facingMode"]);
13166
13178
  this.log.debug("restarting track with constraints", Object.assign(Object.assign({}, this.logContext), {
13167
13179
  constraints: e
13168
13180
  }));
@@ -13353,7 +13365,7 @@ class Vc extends _ {
13353
13365
  /** @internal */
13354
13366
  startPreConnectBuffer() {
13355
13367
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 100;
13356
- if (!gp()) {
13368
+ if (!vp()) {
13357
13369
  this.log.warn("MediaRecorder is not available, cannot start preconnect buffer", this.logContext);
13358
13370
  return;
13359
13371
  }
@@ -13362,13 +13374,13 @@ class Vc extends _ {
13362
13374
  return;
13363
13375
  } else {
13364
13376
  let t = "audio/webm;codecs=opus";
13365
- MediaRecorder.isTypeSupported(t) || (t = "video/mp4"), this.localTrackRecorder = new mp(this, {
13377
+ MediaRecorder.isTypeSupported(t) || (t = "video/mp4"), this.localTrackRecorder = new gp(this, {
13366
13378
  mimeType: t
13367
13379
  });
13368
13380
  }
13369
13381
  this.localTrackRecorder.start(e), this.autoStopPreConnectBuffer = setTimeout(() => {
13370
13382
  this.log.warn("preconnect buffer timed out, stopping recording automatically", this.logContext), this.stopPreConnectBuffer();
13371
- }, bp);
13383
+ }, yp);
13372
13384
  }
13373
13385
  /** @internal */
13374
13386
  stopPreConnectBuffer() {
@@ -13535,7 +13547,7 @@ class pi extends Vc {
13535
13547
  });
13536
13548
  }
13537
13549
  }
13538
- function yp(i, e, t) {
13550
+ function kp(i, e, t) {
13539
13551
  switch (i.kind) {
13540
13552
  case "audio":
13541
13553
  return new pi(i, e, !1, void 0, t);
@@ -13545,7 +13557,7 @@ function yp(i, e, t) {
13545
13557
  throw new ct("unsupported track type: ".concat(i.kind));
13546
13558
  }
13547
13559
  }
13548
- const kp = Object.values(Pn), Tp = Object.values(Is), Sp = Object.values(sr), Cp = [Pn.h180, Pn.h360], _p = [Is.h180, Is.h360], wp = (i) => [{
13560
+ const Tp = Object.values(Pn), Sp = Object.values(Is), Cp = Object.values(sr), _p = [Pn.h180, Pn.h360], wp = [Is.h180, Is.h360], Ep = (i) => [{
13549
13561
  scaleResolutionDownBy: 2,
13550
13562
  fps: i.encoding.maxFramerate
13551
13563
  }].map((t) => {
@@ -13559,7 +13571,7 @@ function fi(i, e, t, n) {
13559
13571
  const o = n == null ? void 0 : n.simulcast, d = n == null ? void 0 : n.scalabilityMode, c = n == null ? void 0 : n.videoCodec;
13560
13572
  if (!a && !o && !d || !e || !t)
13561
13573
  return [{}];
13562
- a || (a = Ep(i, e, t, c), q.debug("using video encoding", a));
13574
+ a || (a = Pp(i, e, t, c), q.debug("using video encoding", a));
13563
13575
  const l = a.maxFramerate, u = new $(e, t, a.maxBitrate, a.maxFramerate, a.priority);
13564
13576
  if (d && qe(c)) {
13565
13577
  const T = new jc(d), k = [];
@@ -13570,11 +13582,11 @@ function fi(i, e, t, n) {
13570
13582
  // is provided. So we'll use the legacy SVC specification for now.
13571
13583
  // TODO: when we upstream libwebrtc, this will need additional verification
13572
13584
  Ge() || (S == null ? void 0 : S.name) === "Chrome" && et(S == null ? void 0 : S.version, "113") < 0) {
13573
- const L = T.suffix == "h" ? 2 : 3, v = gh(S);
13585
+ const N = T.suffix == "h" ? 2 : 3, v = vh(S);
13574
13586
  for (let y = 0; y < T.spatial; y += 1)
13575
13587
  k.push({
13576
13588
  rid: Bs[2 - y],
13577
- maxBitrate: a.maxBitrate / Math.pow(L, y),
13589
+ maxBitrate: a.maxBitrate / Math.pow(N, y),
13578
13590
  maxFramerate: u.encoding.maxFramerate,
13579
13591
  scaleResolutionDownBy: v ? Math.pow(2, y) : void 0
13580
13592
  });
@@ -13620,8 +13632,8 @@ function qc(i, e, t) {
13620
13632
  const o = i.mediaStreamTrack.getSettings(), d = (n = o.width) !== null && n !== void 0 ? n : (s = i.dimensions) === null || s === void 0 ? void 0 : s.width, c = (r = o.height) !== null && r !== void 0 ? r : (a = i.dimensions) === null || a === void 0 ? void 0 : a.height;
13621
13633
  return i.source === _.Source.ScreenShare && t.simulcast && (t.simulcast = !1), fi(i.source === _.Source.ScreenShare, d, c, t);
13622
13634
  }
13623
- function Ep(i, e, t, n) {
13624
- const s = Pp(i, e, t);
13635
+ function Pp(i, e, t, n) {
13636
+ const s = Rp(i, e, t);
13625
13637
  let r = s[0].encoding;
13626
13638
  const a = Math.max(e, t);
13627
13639
  for (let o = 0; o < s.length; o += 1) {
@@ -13641,17 +13653,17 @@ function Ep(i, e, t, n) {
13641
13653
  }
13642
13654
  return r;
13643
13655
  }
13644
- function Pp(i, e, t) {
13656
+ function Rp(i, e, t) {
13645
13657
  if (i)
13646
- return Sp;
13658
+ return Cp;
13647
13659
  const n = e > t ? e / t : t / e;
13648
- return Math.abs(n - 16 / 9) < Math.abs(n - 4 / 3) ? kp : Tp;
13660
+ return Math.abs(n - 16 / 9) < Math.abs(n - 4 / 3) ? Tp : Sp;
13649
13661
  }
13650
13662
  function _a(i, e) {
13651
13663
  if (i)
13652
- return wp(e);
13664
+ return Ep(e);
13653
13665
  const t = e.width, n = e.height, s = t > n ? t / n : n / t;
13654
- return Math.abs(s - 16 / 9) < Math.abs(s - 4 / 3) ? Cp : _p;
13666
+ return Math.abs(s - 16 / 9) < Math.abs(s - 4 / 3) ? _p : wp;
13655
13667
  }
13656
13668
  function as(i, e, t, n) {
13657
13669
  const s = [];
@@ -13704,10 +13716,10 @@ class jc {
13704
13716
  return "L".concat(this.spatial, "T").concat(this.temporal).concat((e = this.suffix) !== null && e !== void 0 ? e : "");
13705
13717
  }
13706
13718
  }
13707
- function Rp(i) {
13719
+ function Ip(i) {
13708
13720
  return i.source === _.Source.ScreenShare || i.constraints.height && At(i.constraints.height) >= 1080 ? "maintain-resolution" : "balanced";
13709
13721
  }
13710
- const Ip = 5e3;
13722
+ const Mp = 5e3;
13711
13723
  class mi extends Vc {
13712
13724
  get sender() {
13713
13725
  return this._sender;
@@ -14053,7 +14065,7 @@ class mi extends Vc {
14053
14065
  const n = this.simulcastCodecs.get(e);
14054
14066
  n && (n.sender = t, setTimeout(() => {
14055
14067
  this.subscribedCodecs && this.setPublishingCodecs(this.subscribedCodecs);
14056
- }, Ip));
14068
+ }, Mp));
14057
14069
  }
14058
14070
  /**
14059
14071
  * @internal
@@ -14244,7 +14256,7 @@ function Pa(i, e, t, n) {
14244
14256
  });
14245
14257
  });
14246
14258
  }
14247
- const Ra = "_lossy", Ia = "_reliable", Ma = "_data_track", Mp = 2 * 1e3, os = "leave-reconnect", Dp = 3e4, Ap = 8 * 1024, Op = 256 * 1024, xp = 3, Lp = 3;
14259
+ const Ra = "_lossy", Ia = "_reliable", Ma = "_data_track", Dp = 2 * 1e3, os = "leave-reconnect", Ap = 3e4, Op = 8 * 1024, xp = 256 * 1024, Lp = 3, Np = 3;
14248
14260
  var Ae;
14249
14261
  (function(i) {
14250
14262
  i[i.New = 0] = "New", i[i.Connected = 1] = "Connected", i[i.Disconnected = 2] = "Disconnected", i[i.Reconnecting = 3] = "Reconnecting", i[i.Closed = 4] = "Closed";
@@ -14254,7 +14266,7 @@ var j;
14254
14266
  i[i.RELIABLE = 0] = "RELIABLE", i[i.LOSSY = 1] = "LOSSY", i[i.DATA_TRACK_LOSSY = 2] = "DATA_TRACK_LOSSY";
14255
14267
  })(j || (j = {}));
14256
14268
  const Da = 64e3;
14257
- class Np extends Ie.EventEmitter {
14269
+ class Up extends Ie.EventEmitter {
14258
14270
  get isClosed() {
14259
14271
  return this._isClosed;
14260
14272
  }
@@ -14266,7 +14278,7 @@ class Np extends Ie.EventEmitter {
14266
14278
  }
14267
14279
  constructor(e) {
14268
14280
  var t;
14269
- super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = gr.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Ae.New, this._isClosed = !0, this._isNewlyCreated = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.shouldFailOnV1Path = !1, this.log = q, this.reliableDataSequence = 1, this.reliableMessageBuffer = new ga(), this.reliableReceivedState = new sp(Dp), this.lossyDataStatCurrentBytes = 0, this.lossyDataStatByterate = 0, this.lossyDataDropCount = 0, this.midToTrackId = {}, this.isWaitingForNetworkReconnect = !1, this.bufferStatusLowClosingFuture = new he(), this.handleDataChannel = (n) => f(this, [n], void 0, function(s) {
14281
+ super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = gr.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Ae.New, this._isClosed = !0, this._isNewlyCreated = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.shouldFailOnV1Path = !1, this.log = q, this.reliableDataSequence = 1, this.reliableMessageBuffer = new ga(), this.reliableReceivedState = new rp(Ap), this.lossyDataStatCurrentBytes = 0, this.lossyDataStatByterate = 0, this.lossyDataDropCount = 0, this.midToTrackId = {}, this.isWaitingForNetworkReconnect = !1, this.bufferStatusLowClosingFuture = new he(), this.handleDataChannel = (n) => f(this, [n], void 0, function(s) {
14270
14282
  var r = this;
14271
14283
  let a = s.channel;
14272
14284
  return function* () {
@@ -14395,7 +14407,7 @@ class Np extends Ie.EventEmitter {
14395
14407
  const s = /* @__PURE__ */ new Map();
14396
14408
  n.forEach((r) => {
14397
14409
  const a = r.codec.toLowerCase();
14398
- Th(a) && s.set(r.payload, a);
14410
+ Sh(a) && s.set(r.payload, a);
14399
14411
  }), this.emit(P.RTPVideoMapUpdate, s);
14400
14412
  }, this.handleBrowserOnLine = () => f(this, void 0, void 0, function* () {
14401
14413
  !this.url || !(yield fetch(In(this.url), {
@@ -14444,7 +14456,7 @@ class Np extends Ie.EventEmitter {
14444
14456
  c._isNewlyCreated = !1, c.url = r, c.token = a, c.signalOpts = o, c.maxJoinAttempts = o.maxRetries;
14445
14457
  try {
14446
14458
  c.joinAttempts += 1, c.setupSignalClientCallbacks();
14447
- const g = !l && Ih();
14459
+ const g = !l && Mh();
14448
14460
  let m;
14449
14461
  if (g) {
14450
14462
  c.pcManager || (yield c.configure(), c.applyInitialPublisherLayout());
@@ -14464,7 +14476,7 @@ class Np extends Ie.EventEmitter {
14464
14476
  version: T.serverVersion,
14465
14477
  region: T.serverRegion
14466
14478
  }), c.log.info("connected to Livekit Server ".concat(Object.entries(k).map((S) => {
14467
- let L = U(S, 2), v = L[0], y = L[1];
14479
+ let N = U(S, 2), v = N[0], y = N[1];
14468
14480
  return "".concat(v, ": ").concat(y);
14469
14481
  }).join(", "))), {
14470
14482
  joinResponse: T,
@@ -14692,7 +14704,7 @@ class Np extends Ie.EventEmitter {
14692
14704
  * build a meaningful initial offer. Must be called on a configured pcManager.
14693
14705
  */
14694
14706
  applyInitialPublisherLayout() {
14695
- this.createDataChannels(), Ge() || this.addMediaSections(xp, Lp);
14707
+ this.createDataChannels(), Ge() || this.addMediaSections(Lp, Np);
14696
14708
  }
14697
14709
  addMediaSections(e, t) {
14698
14710
  var n, s;
@@ -14718,7 +14730,7 @@ class Np extends Ie.EventEmitter {
14718
14730
  const e = this.dataChannelForKind(j.LOSSY);
14719
14731
  if (e) {
14720
14732
  const t = this.lossyDataStatByterate / 10;
14721
- e.bufferedAmountLowThreshold = Math.min(Math.max(t, Ap), Op);
14733
+ e.bufferedAmountLowThreshold = Math.min(Math.max(t, Op), xp);
14722
14734
  }
14723
14735
  }, 1e3));
14724
14736
  }
@@ -14916,7 +14928,7 @@ class Np extends Ie.EventEmitter {
14916
14928
  return f(this, void 0, void 0, function* () {
14917
14929
  this.pcState = Ae.Reconnecting, this.log.debug("waiting for peer connection to reconnect");
14918
14930
  try {
14919
- if (yield be(Mp), !this.pcManager)
14931
+ if (yield be(Dp), !this.pcManager)
14920
14932
  throw new ne("PC manager is closed");
14921
14933
  yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Ae.Connected;
14922
14934
  } catch (e) {
@@ -14945,7 +14957,7 @@ class Np extends Ie.EventEmitter {
14945
14957
  return f(this, void 0, void 0, function* () {
14946
14958
  var n, s;
14947
14959
  if (yield this.ensurePublisherConnected(t), this.e2eeManager && this.e2eeManager.isDataChannelEncryptionEnabled) {
14948
- const o = Bh(e);
14960
+ const o = Vh(e);
14949
14961
  if (o) {
14950
14962
  const d = yield this.e2eeManager.encryptData(o.toBinary());
14951
14963
  e.value = {
@@ -14961,7 +14973,7 @@ class Np extends Ie.EventEmitter {
14961
14973
  t === j.RELIABLE && (e.sequence = this.reliableDataSequence, this.reliableDataSequence += 1);
14962
14974
  const r = e.toBinary(), a = Math.min((s = (n = this.pcManager) === null || n === void 0 ? void 0 : n.getMaxPublisherMessageSize()) !== null && s !== void 0 ? s : Da, Da);
14963
14975
  if (typeof a < "u" && a !== 0 && r.byteLength > a)
14964
- throw new Yu("cannot publish data packet larger than ".concat(a, " bytes (got ").concat(r.byteLength, ")"));
14976
+ throw new Qu("cannot publish data packet larger than ".concat(a, " bytes (got ").concat(r.byteLength, ")"));
14965
14977
  switch (t) {
14966
14978
  case j.LOSSY:
14967
14979
  case j.DATA_TRACK_LOSSY:
@@ -15141,7 +15153,7 @@ class Np extends Ie.EventEmitter {
15141
15153
  subscribe: !h,
15142
15154
  participantTracks: []
15143
15155
  }),
15144
- publishTracks: ih(t),
15156
+ publishTracks: sh(t),
15145
15157
  dataChannels: this.dataChannelsInfo(),
15146
15158
  trackSidsDisabled: g,
15147
15159
  datachannelReceiveStates: this.reliableReceivedState.map((m, T) => new jo({
@@ -15199,20 +15211,20 @@ function Aa(i, e) {
15199
15211
  const n = i.destinationIdentities.length !== 0 ? i.destinationIdentities : e.destinationIdentities;
15200
15212
  i.destinationIdentities = n, e.destinationIdentities = n;
15201
15213
  }
15202
- const Vs = 5e3, Up = 3e4;
15214
+ const Vs = 5e3, Fp = 3e4;
15203
15215
  class G {
15204
15216
  static fetchRegionSettings(e, t, n) {
15205
15217
  return f(this, void 0, void 0, function* () {
15206
15218
  const s = yield G.fetchLock.lock();
15207
15219
  try {
15208
- const r = yield fetch("".concat(Fp(e), "/regions"), {
15220
+ const r = yield fetch("".concat(Bp(e), "/regions"), {
15209
15221
  headers: {
15210
15222
  authorization: "Bearer ".concat(t)
15211
15223
  },
15212
15224
  signal: n
15213
15225
  });
15214
15226
  if (r.ok) {
15215
- const a = Rh(r.headers), o = a ? a * 1e3 : Vs;
15227
+ const a = Ih(r.headers), o = a ? a * 1e3 : Vs;
15216
15228
  return {
15217
15229
  regionSettings: yield r.json(),
15218
15230
  updatedAtInMs: Date.now(),
@@ -15260,7 +15272,7 @@ class G {
15260
15272
  n && n.connectionCount === 0 && (q.debug("stopping region refetch after disconnect delay", {
15261
15273
  hostname: e
15262
15274
  }), G.stopRefetch(e)), n && (n.cleanupTimeout = void 0);
15263
- }, Up));
15275
+ }, Fp));
15264
15276
  }
15265
15277
  static cancelCleanup(e) {
15266
15278
  const t = G.connectionTrackers.get(e);
@@ -15323,7 +15335,7 @@ G.cache = /* @__PURE__ */ new Map();
15323
15335
  G.settingsTimeouts = /* @__PURE__ */ new Map();
15324
15336
  G.connectionTrackers = /* @__PURE__ */ new Map();
15325
15337
  G.fetchLock = new ge();
15326
- function Fp(i) {
15338
+ function Bp(i) {
15327
15339
  return "".concat(i.protocol.replace("ws", "http"), "//").concat(i.host, "/settings");
15328
15340
  }
15329
15341
  class Hc {
@@ -15344,7 +15356,7 @@ class Hc {
15344
15356
  this.reader = t, this.totalByteSize = n, this._info = e, this.bytesReceived = 0;
15345
15357
  }
15346
15358
  }
15347
- class Bp extends Hc {
15359
+ class Vp extends Hc {
15348
15360
  handleChunkReceived(e) {
15349
15361
  var t;
15350
15362
  this.bytesReceived += e.content.byteLength, this.validateBytesReceived();
@@ -15438,7 +15450,7 @@ class Bp extends Hc {
15438
15450
  });
15439
15451
  }
15440
15452
  }
15441
- class Vp extends Hc {
15453
+ class qp extends Hc {
15442
15454
  /**
15443
15455
  * A TextStreamReader instance can be used as an AsyncIterator that returns the entire string
15444
15456
  * that has been received up to the current point in time.
@@ -15556,7 +15568,7 @@ class Vp extends Hc {
15556
15568
  });
15557
15569
  }
15558
15570
  }
15559
- class qp {
15571
+ class jp {
15560
15572
  constructor() {
15561
15573
  this.log = q, this.byteStreamControllers = /* @__PURE__ */ new Map(), this.textStreamControllers = /* @__PURE__ */ new Map(), this.byteStreamHandlers = /* @__PURE__ */ new Map(), this.textStreamHandlers = /* @__PURE__ */ new Map(), this.isConnected = !1, this.bufferedPackets = [];
15562
15574
  }
@@ -15655,7 +15667,7 @@ class qp {
15655
15667
  });
15656
15668
  }
15657
15669
  });
15658
- r(new Bp(o, d, Xn(e.totalLength)), {
15670
+ r(new Vp(o, d, Xn(e.totalLength)), {
15659
15671
  identity: t
15660
15672
  });
15661
15673
  } else if (e.contentHeader.case === "textHeader") {
@@ -15686,7 +15698,7 @@ class qp {
15686
15698
  });
15687
15699
  }
15688
15700
  });
15689
- r(new Vp(o, d, Xn(e.totalLength)), {
15701
+ r(new qp(o, d, Xn(e.totalLength)), {
15690
15702
  identity: t
15691
15703
  });
15692
15704
  }
@@ -15718,12 +15730,12 @@ class Kc {
15718
15730
  });
15719
15731
  }
15720
15732
  }
15721
- class jp extends Kc {
15722
- }
15723
15733
  class Wp extends Kc {
15724
15734
  }
15735
+ class Hp extends Kc {
15736
+ }
15725
15737
  const Oa = 15e3;
15726
- class Hp {
15738
+ class Kp {
15727
15739
  constructor(e, t) {
15728
15740
  this.engine = e, this.log = t;
15729
15741
  }
@@ -15802,7 +15814,7 @@ class Hp {
15802
15814
  // Implement the sink
15803
15815
  write(m) {
15804
15816
  return f(this, void 0, void 0, function* () {
15805
- for (const T of Ph(m, Oa)) {
15817
+ for (const T of Rh(m, Oa)) {
15806
15818
  const k = new oi({
15807
15819
  content: T,
15808
15820
  streamId: r,
@@ -15839,7 +15851,7 @@ class Hp {
15839
15851
  yield g.close();
15840
15852
  });
15841
15853
  u.once(P.Closing, p);
15842
- const g = new jp(h, a, () => this.engine.off(P.Closing, p));
15854
+ const g = new Wp(h, a, () => this.engine.off(P.Closing, p));
15843
15855
  return g;
15844
15856
  });
15845
15857
  }
@@ -15908,7 +15920,7 @@ class Hp {
15908
15920
  const p = new ge(), g = this.engine, m = this.log, T = new WritableStream({
15909
15921
  write(S) {
15910
15922
  return f(this, void 0, void 0, function* () {
15911
- const L = yield p.lock();
15923
+ const N = yield p.lock();
15912
15924
  let v = 0;
15913
15925
  try {
15914
15926
  for (; v < S.byteLength; ) {
@@ -15926,7 +15938,7 @@ class Hp {
15926
15938
  yield g.sendDataPacket(C, j.RELIABLE), h += 1, v += y.byteLength;
15927
15939
  }
15928
15940
  } finally {
15929
- L();
15941
+ N();
15930
15942
  }
15931
15943
  });
15932
15944
  },
@@ -15934,21 +15946,21 @@ class Hp {
15934
15946
  return f(this, void 0, void 0, function* () {
15935
15947
  const S = new ci({
15936
15948
  streamId: o
15937
- }), L = new ve({
15949
+ }), N = new ve({
15938
15950
  destinationIdentities: d,
15939
15951
  value: {
15940
15952
  case: "streamTrailer",
15941
15953
  value: S
15942
15954
  }
15943
15955
  });
15944
- yield g.sendDataPacket(L, j.RELIABLE);
15956
+ yield g.sendDataPacket(N, j.RELIABLE);
15945
15957
  });
15946
15958
  },
15947
15959
  abort(S) {
15948
15960
  m.error("Sink error:", S);
15949
15961
  }
15950
15962
  });
15951
- return new Wp(T, c);
15963
+ return new Hp(T, c);
15952
15964
  });
15953
15965
  }
15954
15966
  }
@@ -15977,7 +15989,7 @@ function zc(i) {
15977
15989
  e.abort(new DOMException("signal timed out after ".concat(i, " ms"), "TimeoutError"));
15978
15990
  }, i), e.signal;
15979
15991
  }
15980
- const re = 1, tt = 2, xa = 4, Kp = 8, La = 0, Na = 12, Ua = 5, Gp = 7, Fa = 3, zp = 3, Ba = 2, Va = 1, qa = 0, ja = 3, Bn = 2, Wa = 2, Jp = 1, $p = 0;
15992
+ const re = 1, tt = 2, xa = 4, Gp = 8, La = 0, Na = 12, Ua = 5, zp = 7, Fa = 3, Jp = 3, Ba = 2, Va = 1, qa = 0, ja = 3, Bn = 2, Wa = 2, $p = 1, Yp = 0;
15981
15993
  var it;
15982
15994
  (function(i) {
15983
15995
  i[i.TooShort = 0] = "TooShort", i[i.HeaderOverrun = 1] = "HeaderOverrun", i[i.MissingExtWords = 2] = "MissingExtWords", i[i.UnsupportedVersion = 3] = "UnsupportedVersion", i[i.InvalidHandle = 4] = "InvalidHandle", i[i.MalformedExt = 5] = "MalformedExt";
@@ -16046,7 +16058,7 @@ class je extends Jc {
16046
16058
  }
16047
16059
  toBinaryInto(e) {
16048
16060
  let t = 0;
16049
- e.setUint8(t, je.tag), t += re, e.setUint8(t, je.lengthBytes), t += re, e.setBigUint64(t, this.timestamp), t += Kp;
16061
+ e.setUint8(t, je.tag), t += re, e.setUint8(t, je.lengthBytes), t += re, e.setBigUint64(t, this.timestamp), t += Gp;
16050
16062
  const n = this.toBinaryLengthBytes();
16051
16063
  if (t !== n)
16052
16064
  throw new Error("DataTrackUserTimestampExtension.toBinaryInto: Wrote ".concat(t, " bytes but expected length was ").concat(n, " bytes"));
@@ -16121,7 +16133,7 @@ class Yt extends Ri {
16121
16133
  const a = t.getUint8(r);
16122
16134
  r += re;
16123
16135
  const o = t.getUint8(r);
16124
- if (r += re, a !== $p)
16136
+ if (r += re, a !== Yp)
16125
16137
  switch (a) {
16126
16138
  case nn.UserTimestamp:
16127
16139
  if (t.byteLength - r < je.lengthBytes)
@@ -16277,11 +16289,11 @@ class On extends Ri {
16277
16289
  let n = 0;
16278
16290
  const s = t.getUint8(n);
16279
16291
  n += re;
16280
- const r = s >> Ua & Gp;
16292
+ const r = s >> Ua & zp;
16281
16293
  if (r > La)
16282
16294
  throw Te.unsupportedVersion(r);
16283
16295
  let a;
16284
- switch (s >> Fa & zp) {
16296
+ switch (s >> Fa & Jp) {
16285
16297
  case Ba:
16286
16298
  a = ee.Start;
16287
16299
  break;
@@ -16296,11 +16308,11 @@ class On extends Ri {
16296
16308
  a = ee.Inter;
16297
16309
  break;
16298
16310
  }
16299
- const o = (s >> Wa & Jp) > 0;
16311
+ const o = (s >> Wa & $p) > 0;
16300
16312
  n += re;
16301
16313
  let d;
16302
16314
  try {
16303
- d = $h.fromNumber(t.getUint16(n));
16315
+ d = Yh.fromNumber(t.getUint16(n));
16304
16316
  } catch (p) {
16305
16317
  throw p instanceof tn && (p.isReason(Ot.Reserved) || p.isReason(Ot.TooLarge)) ? Te.invalidHandle(p) : p;
16306
16318
  }
@@ -16321,8 +16333,8 @@ class On extends Ri {
16321
16333
  if (n + m > t.byteLength)
16322
16334
  throw Te.headerOverrun();
16323
16335
  let T = new DataView(t.buffer, t.byteOffset + n, m);
16324
- const k = Yt.fromBinary(T), S = U(k, 2), L = S[0], v = S[1];
16325
- h = L, n += v;
16336
+ const k = Yt.fromBinary(T), S = U(k, 2), N = S[0], v = S[1];
16337
+ h = N, n += v;
16326
16338
  }
16327
16339
  return [new On({
16328
16340
  marker: a,
@@ -16528,7 +16540,7 @@ class we extends xe {
16528
16540
  }
16529
16541
  }
16530
16542
  const ds = Re(pe.DataTracks);
16531
- class Yp {
16543
+ class Qp {
16532
16544
  /**
16533
16545
  * Creates a new pipeline with the given options.
16534
16546
  */
@@ -16592,8 +16604,8 @@ class Yp {
16592
16604
  });
16593
16605
  }
16594
16606
  }
16595
- const fe = Re(pe.DataTracks), Qp = 1e4, Xp = 16;
16596
- class Zp extends Ie.EventEmitter {
16607
+ const fe = Re(pe.DataTracks), Xp = 1e4, Zp = 16;
16608
+ class ef extends Ie.EventEmitter {
16597
16609
  constructor(e) {
16598
16610
  var t;
16599
16611
  super(), this.descriptors = /* @__PURE__ */ new Map(), this.subscriptionHandles = /* @__PURE__ */ new Map(), this.e2eeManager = (t = e == null ? void 0 : e.e2eeManager) !== null && t !== void 0 ? t : null;
@@ -16622,7 +16634,7 @@ class Zp extends Ie.EventEmitter {
16622
16634
  * @internal
16623
16635
  **/
16624
16636
  openSubscriptionStream(e, t) {
16625
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Xp, s = null;
16637
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Zp, s = null;
16626
16638
  const r = new he(), a = () => {
16627
16639
  t == null || t.removeEventListener("abort", d);
16628
16640
  }, o = () => {
@@ -16746,7 +16758,7 @@ class Zp extends Ie.EventEmitter {
16746
16758
  sid: e,
16747
16759
  subscribe: !0
16748
16760
  });
16749
- const r = zc(Qp);
16761
+ const r = zc(Xp);
16750
16762
  yield s(n, t, r);
16751
16763
  return;
16752
16764
  }
@@ -16901,7 +16913,7 @@ class Zp extends Ie.EventEmitter {
16901
16913
  return;
16902
16914
  }
16903
16915
  case "pending": {
16904
- const a = new Yp({
16916
+ const a = new Qp({
16905
16917
  info: r.info,
16906
16918
  publisherIdentity: r.publisherIdentity,
16907
16919
  e2eeManager: this.e2eeManager,
@@ -17245,10 +17257,10 @@ class Oi {
17245
17257
  this.e2eeManager = e;
17246
17258
  }
17247
17259
  processFrame(e) {
17248
- return Du(this, arguments, function* () {
17260
+ return Au(this, arguments, function* () {
17249
17261
  const n = yield Zt(this.encryptIfNeeded(e));
17250
17262
  try {
17251
- yield Zt(yield* Au(Ve(this.packetizer.packetize(n))));
17263
+ yield Zt(yield* Ou(Ve(this.packetizer.packetize(n))));
17252
17264
  } catch (s) {
17253
17265
  throw s instanceof Di ? xn.packetizer(s) : s;
17254
17266
  }
@@ -17288,11 +17300,11 @@ const $e = Re(pe.DataTracks), Ha = {
17288
17300
  unpublishingFuture: new he()
17289
17301
  };
17290
17302
  }
17291
- }, ef = 1e4;
17303
+ }, tf = 1e4;
17292
17304
  class yr extends Ie.EventEmitter {
17293
17305
  constructor(e) {
17294
17306
  var t;
17295
- super(), this.handleAllocator = new Yh(), this.descriptors = /* @__PURE__ */ new Map(), this.inFlightPacketCounter = /* @__PURE__ */ new Map(), this.e2eeManager = (t = e == null ? void 0 : e.e2eeManager) !== null && t !== void 0 ? t : null;
17307
+ super(), this.handleAllocator = new Qh(), this.descriptors = /* @__PURE__ */ new Map(), this.inFlightPacketCounter = /* @__PURE__ */ new Map(), this.e2eeManager = (t = e == null ? void 0 : e.e2eeManager) !== null && t !== void 0 ? t : null;
17296
17308
  }
17297
17309
  static withDescriptors(e) {
17298
17310
  const t = new yr();
@@ -17378,7 +17390,7 @@ class yr extends Ie.EventEmitter {
17378
17390
  const n = this.handleAllocator.get();
17379
17391
  if (!n)
17380
17392
  throw de.limitReached();
17381
- const s = zc(ef), r = t ? Gc([t, s]) : s;
17393
+ const s = zc(tf), r = t ? Gc([t, s]) : s;
17382
17394
  if (this.descriptors.has(n))
17383
17395
  throw new Error("Descriptor for handle already exists");
17384
17396
  const a = Ha.pending();
@@ -17603,7 +17615,7 @@ var me;
17603
17615
  (function(i) {
17604
17616
  i.RPC_REQUEST_ID = "lk.rpc_request_id", i.RPC_REQUEST_METHOD = "lk.rpc_request_method", i.RPC_REQUEST_RESPONSE_TIMEOUT_MS = "lk.rpc_request_response_timeout_ms", i.RPC_REQUEST_VERSION = "lk.rpc_request_version";
17605
17617
  })(me || (me = {}));
17606
- const tf = 1, nd = 2;
17618
+ const nf = 1, nd = 2;
17607
17619
  function kr(i) {
17608
17620
  return new TextEncoder().encode(i).length;
17609
17621
  }
@@ -17618,7 +17630,7 @@ function Ka(i, e) {
17618
17630
  }
17619
17631
  return i.slice(0, t);
17620
17632
  }
17621
- class nf extends Ie.EventEmitter {
17633
+ class sf extends Ie.EventEmitter {
17622
17634
  constructor(e, t, n, s) {
17623
17635
  super(), this.pendingAcks = /* @__PURE__ */ new Map(), this.pendingResponses = /* @__PURE__ */ new Map(), this.log = e, this.outgoingDataStreamManager = t, this.getRemoteParticipantClientProtocol = n, this.getServerVersion = s;
17624
17636
  }
@@ -17651,10 +17663,10 @@ class nf extends Ie.EventEmitter {
17651
17663
  var v;
17652
17664
  n.pendingResponses.delete(m), (v = T.reject) === null || v === void 0 || v.call(T, J.builtIn("RESPONSE_TIMEOUT"));
17653
17665
  }, d);
17654
- const L = T.promise.finally(() => {
17666
+ const N = T.promise.finally(() => {
17655
17667
  clearTimeout(k), n.pendingAcks.has(m) && (n.log.warn("RPC response received before ack", m), n.pendingAcks.delete(m), clearTimeout(S));
17656
17668
  });
17657
- return [m, L];
17669
+ return [m, N];
17658
17670
  }();
17659
17671
  });
17660
17672
  }
@@ -17685,7 +17697,7 @@ class nf extends Ie.EventEmitter {
17685
17697
  method: n,
17686
17698
  payload: s,
17687
17699
  responseTimeoutMs: r,
17688
- version: tf
17700
+ version: nf
17689
17701
  })
17690
17702
  }
17691
17703
  })
@@ -17754,7 +17766,7 @@ class nf extends Ie.EventEmitter {
17754
17766
  }
17755
17767
  }
17756
17768
  }
17757
- class sf extends Ie.EventEmitter {
17769
+ class rf extends Ie.EventEmitter {
17758
17770
  constructor(e, t, n) {
17759
17771
  super(), this.rpcHandlers = /* @__PURE__ */ new Map(), this.log = e, this.outgoingDataStreamManager = t, this.getRemoteParticipantClientProtocol = n;
17760
17772
  }
@@ -17907,7 +17919,7 @@ class sf extends Ie.EventEmitter {
17907
17919
  });
17908
17920
  }
17909
17921
  }
17910
- class rf extends Nc {
17922
+ class af extends Nc {
17911
17923
  constructor(e, t, n, s, r, a) {
17912
17924
  super(e, t, _.Kind.Audio, n, a), this.monitorReceiver = () => f(this, void 0, void 0, function* () {
17913
17925
  if (!this.receiver) {
@@ -18196,7 +18208,7 @@ function xi(i, e) {
18196
18208
  m != null && m.deviceId && At(m.deviceId) !== k ? m.deviceId = k : m || (m = {
18197
18209
  deviceId: k
18198
18210
  });
18199
- const S = yp(p, m, e);
18211
+ const S = kp(p, m, e);
18200
18212
  return S.kind === _.Kind.Video ? S.source = _.Source.Camera : S.kind === _.Kind.Audio && (S.source = _.Source.Microphone), S.mediaStream = h, Ze(S) && s ? yield S.setProcessor(s) : dt(S) && r && (yield S.setProcessor(r)), S;
18201
18213
  })));
18202
18214
  } catch (h) {
@@ -18209,7 +18221,7 @@ function xi(i, e) {
18209
18221
  }
18210
18222
  });
18211
18223
  }
18212
- function af(i) {
18224
+ function of(i) {
18213
18225
  return f(this, void 0, void 0, function* () {
18214
18226
  return (yield xi({
18215
18227
  audio: !1,
@@ -18217,7 +18229,7 @@ function af(i) {
18217
18229
  }))[0];
18218
18230
  });
18219
18231
  }
18220
- function of(i) {
18232
+ function cf(i) {
18221
18233
  return f(this, void 0, void 0, function* () {
18222
18234
  return (yield xi({
18223
18235
  audio: !0,
@@ -18229,7 +18241,7 @@ var ft;
18229
18241
  (function(i) {
18230
18242
  i.Excellent = "excellent", i.Good = "good", i.Poor = "poor", i.Lost = "lost", i.Unknown = "unknown";
18231
18243
  })(ft || (ft = {}));
18232
- function cf(i) {
18244
+ function df(i) {
18233
18245
  switch (i) {
18234
18246
  case fn.EXCELLENT:
18235
18247
  return ft.Excellent;
@@ -18351,7 +18363,7 @@ class id extends Ie.EventEmitter {
18351
18363
  * Updates metadata from server
18352
18364
  **/
18353
18365
  _setAttributes(e) {
18354
- const t = rh(this.attributes, e);
18366
+ const t = ah(this.attributes, e);
18355
18367
  this._attributes = e, Object.keys(t).length > 0 && this.emit(M.AttributesChanged, t);
18356
18368
  }
18357
18369
  /** @internal */
@@ -18370,7 +18382,7 @@ class id extends Ie.EventEmitter {
18370
18382
  /** @internal */
18371
18383
  setConnectionQuality(e) {
18372
18384
  const t = this._connectionQuality;
18373
- this._connectionQuality = cf(e), t !== this._connectionQuality && this.emit(M.ConnectionQualityChanged, this._connectionQuality);
18385
+ this._connectionQuality = df(e), t !== this._connectionQuality && this.emit(M.ConnectionQualityChanged, this._connectionQuality);
18374
18386
  }
18375
18387
  /**
18376
18388
  * @internal
@@ -18402,7 +18414,7 @@ class id extends Ie.EventEmitter {
18402
18414
  }
18403
18415
  }
18404
18416
  }
18405
- function df(i) {
18417
+ function lf(i) {
18406
18418
  var e, t, n;
18407
18419
  if (!i.participantSid && !i.participantIdentity)
18408
18420
  throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");
@@ -18413,7 +18425,7 @@ function df(i) {
18413
18425
  trackSids: i.allowedTrackSids || []
18414
18426
  });
18415
18427
  }
18416
- class lf extends id {
18428
+ class uf extends id {
18417
18429
  /** @internal */
18418
18430
  constructor(e, t, n, s, r, a, o, d) {
18419
18431
  super(e, t, void 0, void 0, void 0, {
@@ -18463,7 +18475,7 @@ class lf extends id {
18463
18475
  this.log.debug("updating track subscription permissions", {
18464
18476
  allParticipantsAllowed: this.allParticipantsAllowedToSubscribe,
18465
18477
  participantTrackPermissions: this.participantTrackPermissions
18466
- }), this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe, this.participantTrackPermissions.map((c) => df(c)));
18478
+ }), this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe, this.participantTrackPermissions.map((c) => lf(c)));
18467
18479
  }, this.onTrackUnmuted = (c) => {
18468
18480
  this.onTrackMuted(c, c.isUpstreamPaused);
18469
18481
  }, this.onTrackMuted = (c, l) => {
@@ -18500,10 +18512,10 @@ class lf extends id {
18500
18512
  return;
18501
18513
  const T = yield m.videoTrack.setPublishingCodecs(c.subscribedCodecs);
18502
18514
  try {
18503
- for (var k = !0, S = Ve(T), L; L = yield S.next(), l = L.done, !l; k = !0) {
18504
- p = L.value, k = !1;
18515
+ for (var k = !0, S = Ve(T), N; N = yield S.next(), l = N.done, !l; k = !0) {
18516
+ p = N.value, k = !1;
18505
18517
  const v = p;
18506
- eh(v) && (this.log.debug("publish ".concat(v, " for ").concat(m.videoTrack.sid), H(m)), yield this.publishAdditionalCodecForTrack(m.videoTrack, v, m.options));
18518
+ th(v) && (this.log.debug("publish ".concat(v, " for ").concat(m.videoTrack.sid), H(m)), yield this.publishAdditionalCodecForTrack(m.videoTrack, v, m.options));
18507
18519
  }
18508
18520
  } catch (v) {
18509
18521
  u = {
@@ -18821,8 +18833,8 @@ class lf extends id {
18821
18833
  return f(this, void 0, void 0, function* () {
18822
18834
  if (e === void 0 && (e = {}), navigator.mediaDevices.getDisplayMedia === void 0)
18823
18835
  throw new ir("getDisplayMedia not supported");
18824
- e.resolution === void 0 && !mh() && (e.resolution = sr.h1080fps30.resolution);
18825
- const t = nh(e), n = yield navigator.mediaDevices.getDisplayMedia(t), s = n.getVideoTracks();
18836
+ e.resolution === void 0 && !gh() && (e.resolution = sr.h1080fps30.resolution);
18837
+ const t = ih(e), n = yield navigator.mediaDevices.getDisplayMedia(t), s = n.getVideoTracks();
18826
18838
  if (s.length === 0)
18827
18839
  throw new ct("no video track found");
18828
18840
  const r = new mi(s[0], void 0, !1, {
@@ -18927,8 +18939,8 @@ class lf extends id {
18927
18939
  return r.log.warn("track has already been published, skipping", H(p)), p;
18928
18940
  const g = Object.assign(Object.assign({}, r.roomOptions.publishDefaults), s), m = "channelCount" in n.mediaStreamTrack.getSettings() && // @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
18929
18941
  n.mediaStreamTrack.getSettings().channelCount === 2 || n.mediaStreamTrack.getConstraints().channelCount === 2, T = (c = g.forceStereo) !== null && c !== void 0 ? c : m;
18930
- T && (g.dtx === void 0 && r.log.debug("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", H(n)), g.red === void 0 && r.log.debug("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = g.dtx) !== null && l !== void 0 || (g.dtx = !1), (u = g.red) !== null && u !== void 0 || (g.red = !1)), !vh() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2"), g.simulcast = !1), g.source && (n.source = g.source);
18931
- const k = new Promise((S, L) => f(r, void 0, void 0, function* () {
18942
+ T && (g.dtx === void 0 && r.log.debug("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", H(n)), g.red === void 0 && r.log.debug("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = g.dtx) !== null && l !== void 0 || (g.dtx = !1), (u = g.red) !== null && u !== void 0 || (g.red = !1)), !bh() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2"), g.simulcast = !1), g.source && (n.source = g.source);
18943
+ const k = new Promise((S, N) => f(r, void 0, void 0, function* () {
18932
18944
  try {
18933
18945
  if (this.engine.client.currentState !== Y.CONNECTED) {
18934
18946
  this.log.debug("deferring track publication until signal is connected", {
@@ -18936,7 +18948,7 @@ class lf extends id {
18936
18948
  });
18937
18949
  let v = !1;
18938
18950
  const y = setTimeout(() => {
18939
- v = !0, n.stop(), L(new ta("publishing rejected as engine not connected within timeout", 408));
18951
+ v = !0, n.stop(), N(new ta("publishing rejected as engine not connected within timeout", 408));
18940
18952
  }, 15e3);
18941
18953
  if (yield this.waitUntilEngineConnected(), clearTimeout(y), v)
18942
18954
  return;
@@ -18947,10 +18959,10 @@ class lf extends id {
18947
18959
  const v = yield this.publish(n, g, T);
18948
18960
  S(v);
18949
18961
  } catch (v) {
18950
- L(v);
18962
+ N(v);
18951
18963
  }
18952
18964
  } catch (v) {
18953
- L(v);
18965
+ N(v);
18954
18966
  }
18955
18967
  }));
18956
18968
  r.pendingPublishPromises.set(n, k);
@@ -18975,19 +18987,19 @@ class lf extends id {
18975
18987
  if (!this.permissions)
18976
18988
  return this.log.warn("no permissions present for publishing track", H(e)), !1;
18977
18989
  const t = this.permissions, n = t.canPublish, s = t.canPublishSources;
18978
- return n && (s.length === 0 || s.map((r) => ah(r)).includes(e.source)) ? !0 : (this.log.warn("insufficient permissions to publish", H(e)), !1);
18990
+ return n && (s.length === 0 || s.map((r) => oh(r)).includes(e.source)) ? !0 : (this.log.warn("insufficient permissions to publish", H(e)), !1);
18979
18991
  }
18980
18992
  publish(e, t, n) {
18981
18993
  return f(this, void 0, void 0, function* () {
18982
18994
  var s, r, a, o, d, c, l, u, h, p;
18983
18995
  if (!this.hasPermissionsToPublish(e))
18984
18996
  throw new ta("failed to publish track, insufficient permissions", 403);
18985
- Array.from(this.trackPublications.values()).find((A) => zt(e) && A.source === e.source) && e.source !== _.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), H(e)), t.stopMicTrackOnMute && Ze(e) && (e.stopOnMute = !0), e.source === _.Source.ScreenShare && Lt() && (t.simulcast = !1), t.videoCodec === "av1" && !uh() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !hh() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Fs), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((A) => t.videoCodec === yn(A.mime)) || (t.videoCodec = yn(this.enabledPublishVideoCodecs[0].mime)));
18997
+ Array.from(this.trackPublications.values()).find((A) => zt(e) && A.source === e.source) && e.source !== _.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), H(e)), t.stopMicTrackOnMute && Ze(e) && (e.stopOnMute = !0), e.source === _.Source.ScreenShare && Lt() && (t.simulcast = !1), t.videoCodec === "av1" && !hh() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !ph() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Fs), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((A) => t.videoCodec === yn(A.mime)) || (t.videoCodec = yn(this.enabledPublishVideoCodecs[0].mime)));
18986
18998
  const m = t.videoCodec;
18987
18999
  e.on(R.Muted, this.onTrackMuted), e.on(R.Unmuted, this.onTrackUnmuted), e.on(R.Ended, this.handleTrackEnded), e.on(R.UpstreamPaused, this.onTrackUpstreamPaused), e.on(R.UpstreamResumed, this.onTrackUpstreamResumed), e.on(R.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
18988
19000
  const T = [], k = !(!((s = t.dtx) !== null && s !== void 0) || s), S = e.getSourceTrackSettings();
18989
19001
  S.autoGainControl && T.push(le.TF_AUTO_GAIN_CONTROL), S.echoCancellation && T.push(le.TF_ECHO_CANCELLATION), S.noiseSuppression && T.push(le.TF_NOISE_SUPPRESSION), S.channelCount && S.channelCount > 1 && T.push(le.TF_STEREO), k && T.push(le.TF_NO_DTX), nt(e) && e.hasPreConnectBuffer && T.push(le.TF_PRECONNECT_BUFFER);
18990
- const L = this.normalizeRequestedFrameMetadataOptions(e, t), v = new En({
19002
+ const N = this.normalizeRequestedFrameMetadataOptions(e, t), v = new En({
18991
19003
  // get local track id for use during publishing
18992
19004
  cid: e.mediaStreamTrack.id,
18993
19005
  name: t.name,
@@ -19001,7 +19013,7 @@ class lf extends id {
19001
19013
  stream: t == null ? void 0 : t.stream,
19002
19014
  backupCodecPolicy: t == null ? void 0 : t.backupCodecPolicy,
19003
19015
  audioFeatures: T,
19004
- packetTrailerFeatures: L
19016
+ packetTrailerFeatures: N
19005
19017
  });
19006
19018
  let y;
19007
19019
  if (e.kind === _.Kind.Video) {
@@ -19038,7 +19050,7 @@ class lf extends id {
19038
19050
  var A, O, B;
19039
19051
  if (!this.engine.pcManager)
19040
19052
  throw new ne("pcManager is not ready");
19041
- if (e.sender = yield this.engine.createSender(e, t, y), Je(e) && (e.publishOptions = t), this.emit(M.LocalSenderCreated, e.sender, e), Je(e) && ((A = t.degradationPreference) !== null && A !== void 0 || (t.degradationPreference = Rp(e)), e.setDegradationPreference(t.degradationPreference)), y)
19053
+ if (e.sender = yield this.engine.createSender(e, t, y), Je(e) && (e.publishOptions = t), this.emit(M.LocalSenderCreated, e.sender, e), Je(e) && ((A = t.degradationPreference) !== null && A !== void 0 || (t.degradationPreference = Ip(e)), e.setDegradationPreference(t.degradationPreference)), y)
19042
19054
  if (Lt() && e.kind === _.Kind.Audio) {
19043
19055
  let W;
19044
19056
  for (const Z of this.engine.pcManager.publisher.getTransceivers())
@@ -19059,7 +19071,7 @@ class lf extends id {
19059
19071
  yield this.engine.negotiate();
19060
19072
  });
19061
19073
  let I;
19062
- const x = new Promise((A, O) => f(this, void 0, void 0, function* () {
19074
+ const L = new Promise((A, O) => f(this, void 0, void 0, function* () {
19063
19075
  var B;
19064
19076
  try {
19065
19077
  I = yield this.engine.addTrack(v), A(I);
@@ -19079,10 +19091,10 @@ class lf extends id {
19079
19091
  O(W);
19080
19092
  }
19081
19093
  }));
19082
- if (this.enabledPublishVideoCodecs.length > 0 && L.length === 0)
19083
- I = (yield Promise.all([x, C()]))[0];
19094
+ if (this.enabledPublishVideoCodecs.length > 0 && N.length === 0)
19095
+ I = (yield Promise.all([L, C()]))[0];
19084
19096
  else {
19085
- I = yield x;
19097
+ I = yield L;
19086
19098
  let A;
19087
19099
  if (I.codecs.forEach((O) => {
19088
19100
  A === void 0 && (A = O.mimeType);
@@ -19176,7 +19188,7 @@ class lf extends id {
19176
19188
  return t.frameMetadata = void 0, t.packetTrailer = void 0, [];
19177
19189
  if (!this.canPublishFrameMetadata())
19178
19190
  return this.log.warn("frame metadata transform not supported; not advertising features", Object.assign(Object.assign({}, this.logContext), H(e))), t.frameMetadata = void 0, t.packetTrailer = void 0, [];
19179
- const r = Vh(s), a = qh(r);
19191
+ const r = qh(s), a = jh(r);
19180
19192
  return t.frameMetadata = a, t.packetTrailer = a, r;
19181
19193
  }
19182
19194
  get isLocal() {
@@ -19553,7 +19565,7 @@ class Ga extends DOMException {
19553
19565
  super(e, "AbortError"), this.reason = t;
19554
19566
  }
19555
19567
  }
19556
- class uf extends Map {
19568
+ class hf extends Map {
19557
19569
  constructor() {
19558
19570
  super(...arguments), this.pending = /* @__PURE__ */ new Map();
19559
19571
  }
@@ -19600,7 +19612,7 @@ class uf extends Map {
19600
19612
  });
19601
19613
  }
19602
19614
  }
19603
- class hf extends rt {
19615
+ class pf extends rt {
19604
19616
  constructor(e, t, n, s) {
19605
19617
  super(e, t.sid, t.name, s), this.track = void 0, this.allowed = !0, this.requestedDisabled = void 0, this.visible = !0, this.handleEnded = (r) => {
19606
19618
  this.setTrack(void 0), this.emit(R.Ended, r);
@@ -19734,7 +19746,7 @@ class hf extends rt {
19734
19746
  if (t)
19735
19747
  sa(this.videoDimensionsAdaptiveStream, t) && (this.log.debug("using adaptive stream dimensions instead of requested", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream);
19736
19748
  else if (this.requestedMaxQuality !== void 0 && this.trackInfo) {
19737
- const n = oh(this.trackInfo, this.requestedMaxQuality);
19749
+ const n = ch(this.trackInfo, this.requestedMaxQuality);
19738
19750
  n && sa(this.videoDimensionsAdaptiveStream, n) && (this.log.debug("using adaptive stream dimensions instead of max quality layer", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream);
19739
19751
  } else
19740
19752
  this.log.debug("using adaptive stream dimensions", Object.assign(Object.assign({}, this.logContext), this.videoDimensionsAdaptiveStream)), t = this.videoDimensionsAdaptiveStream;
@@ -19766,7 +19778,7 @@ class vi extends id {
19766
19778
  /** @internal */
19767
19779
  constructor(e, t, n, s, r, a, o) {
19768
19780
  let d = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : wn.STANDARD, c = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : [], l = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : wc;
19769
- super(t, n || "", s, r, a, o, d), this.signalClient = e, this.trackPublications = /* @__PURE__ */ new Map(), this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.dataTracks = new uf(c.map((u) => [u.info.name, u])), this.volumeMap = /* @__PURE__ */ new Map(), this.clientProtocol = l;
19781
+ super(t, n || "", s, r, a, o, d), this.signalClient = e, this.trackPublications = /* @__PURE__ */ new Map(), this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.dataTracks = new hf(c.map((u) => [u.info.name, u])), this.volumeMap = /* @__PURE__ */ new Map(), this.clientProtocol = l;
19770
19782
  }
19771
19783
  addTrackPublication(e) {
19772
19784
  super.addTrackPublication(e), e.on(R.UpdateSettings, (t) => {
@@ -19842,7 +19854,7 @@ class vi extends id {
19842
19854
  }
19843
19855
  const d = e.kind === "video";
19844
19856
  let c;
19845
- return d ? c = new lr(e, t, s, r) : c = new rf(e, t, s, this.audioContext, this.audioOutput), c.source = o.source, c.isMuted = o.isMuted, c.setMediaStream(n), c.start(), o.setTrack(c), this.volumeMap.has(o.source) && Ns(c) && Ze(c) && c.setVolume(this.volumeMap.get(o.source)), o;
19857
+ return d ? c = new lr(e, t, s, r) : c = new af(e, t, s, this.audioContext, this.audioOutput), c.source = o.source, c.isMuted = o.isMuted, c.setMediaStream(n), c.start(), o.setTrack(c), this.volumeMap.has(o.source) && Ns(c) && Ze(c) && c.setVolume(this.volumeMap.get(o.source)), o;
19846
19858
  }
19847
19859
  /** @internal */
19848
19860
  get hasMetadata() {
@@ -19868,7 +19880,7 @@ class vi extends id {
19868
19880
  const d = _.kindFromProto(s.type);
19869
19881
  if (!d)
19870
19882
  return;
19871
- o = new hf(d, s, (r = this.signalClient.connectOptions) === null || r === void 0 ? void 0 : r.autoSubscribe, {
19883
+ o = new pf(d, s, (r = this.signalClient.connectOptions) === null || r === void 0 ? void 0 : r.autoSubscribe, {
19872
19884
  loggerContextCb: () => this.logContext,
19873
19885
  loggerName: (a = this.loggerOptions) === null || a === void 0 ? void 0 : a.loggerName
19874
19886
  }), o.updateInfo(s), n.set(s.sid, o);
@@ -19940,7 +19952,7 @@ var z;
19940
19952
  (function(i) {
19941
19953
  i.Disconnected = "disconnected", i.Connecting = "connecting", i.Connected = "connected", i.Reconnecting = "reconnecting", i.SignalReconnecting = "signalReconnecting";
19942
19954
  })(z || (z = {}));
19943
- const pf = 4 * 1e3;
19955
+ const ff = 4 * 1e3;
19944
19956
  class sn extends Ie.EventEmitter {
19945
19957
  get hasE2EESetup() {
19946
19958
  return this.e2eeManager !== void 0;
@@ -19953,7 +19965,7 @@ class sn extends Ie.EventEmitter {
19953
19965
  var t, n, s, r, a, o, d;
19954
19966
  if (super(), t = this, this.state = z.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.e2eeStateMutex = new ge(), this.isVideoPlaybackBlocked = !1, this.log = q, this.bufferedEvents = [], this.isResuming = !1, this.connect = (c, l, u) => f(this, void 0, void 0, function* () {
19955
19967
  var h;
19956
- if (!ph())
19968
+ if (!fh())
19957
19969
  throw Ge() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
19958
19970
  const p = yield this.disconnectLock.lock();
19959
19971
  if (this.state === z.Connected)
@@ -19969,7 +19981,7 @@ class sn extends Ie.EventEmitter {
19969
19981
  });
19970
19982
  }));
19971
19983
  const g = (T, k, S) => f(this, void 0, void 0, function* () {
19972
- var L, v;
19984
+ var N, v;
19973
19985
  this.abortController && this.abortController.abort();
19974
19986
  const y = new AbortController();
19975
19987
  this.abortController = y, p == null || p();
@@ -19981,10 +19993,10 @@ class sn extends Ie.EventEmitter {
19981
19993
  if (this.regionUrlProvider && C instanceof F && C.reason !== Q.Cancelled && C.reason !== Q.NotAllowed) {
19982
19994
  let I = null;
19983
19995
  try {
19984
- this.log.debug("Fetching next region"), I = yield this.regionUrlProvider.getNextBestRegionUrl((L = this.abortController) === null || L === void 0 ? void 0 : L.signal);
19985
- } catch (x) {
19986
- if (x instanceof F && (x.status === 401 || x.reason === Q.Cancelled)) {
19987
- this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), k(x);
19996
+ this.log.debug("Fetching next region"), I = yield this.regionUrlProvider.getNextBestRegionUrl((N = this.abortController) === null || N === void 0 ? void 0 : N.signal);
19997
+ } catch (L) {
19998
+ if (L instanceof F && (L.status === 401 || L.reason === Q.Cancelled)) {
19999
+ this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), k(L);
19988
20000
  return;
19989
20001
  }
19990
20002
  }
@@ -20012,7 +20024,7 @@ class sn extends Ie.EventEmitter {
20012
20024
  websocketTimeout: h.websocketTimeout
20013
20025
  }, g.signal, !p.singlePeerConnection), k = T.joinResponse, S = T.serverInfo;
20014
20026
  if (this.serverInfo = S, !S.version)
20015
- throw new $u("unknown server version");
20027
+ throw new Yu("unknown server version");
20016
20028
  return S.version === "0.15.1" && this.options.dynacast && (this.log.debug("disabling dynacast due to server version"), p.dynacast = !1), k;
20017
20029
  }), this.applyJoinResponse = (c) => {
20018
20030
  const l = c.participant;
@@ -20237,10 +20249,10 @@ class sn extends Ie.EventEmitter {
20237
20249
  }, this.handleSipDtmf = (c, l) => {
20238
20250
  this.emit(E.SipDTMFReceived, l, c), c == null || c.emit(M.SipDTMFReceived, l);
20239
20251
  }, this.handleTranscription = (c, l) => {
20240
- const u = l.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(l.transcribedParticipantIdentity), h = u == null ? void 0 : u.trackPublications.get(l.trackId), p = Ch(l, this.transcriptionReceivedTimes);
20252
+ const u = l.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(l.transcribedParticipantIdentity), h = u == null ? void 0 : u.trackPublications.get(l.trackId), p = _h(l, this.transcriptionReceivedTimes);
20241
20253
  h == null || h.emit(R.TranscriptionReceived, p), u == null || u.emit(M.TranscriptionReceived, p, h), this.emit(E.TranscriptionReceived, p, u, h);
20242
20254
  }, this.handleChatMessage = (c, l) => {
20243
- const u = _h(l);
20255
+ const u = wh(l);
20244
20256
  this.emit(E.ChatMessage, u, c);
20245
20257
  }, this.handleMetrics = (c, l) => {
20246
20258
  this.emit(E.MetricsReceived, c, l);
@@ -20306,7 +20318,7 @@ class sn extends Ie.EventEmitter {
20306
20318
  this.emit(E.ParticipantPermissionsChanged, c, this.localParticipant);
20307
20319
  }, this.onLocalChatMessageSent = (c) => {
20308
20320
  this.emit(E.ChatMessage, c, this.localParticipant);
20309
- }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, hp), e), this.log = Re((n = this.options.loggerName) !== null && n !== void 0 ? n : pe.Room, () => this.logContext), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, Fc), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, Bc), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, up), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new qp(), this.outgoingDataStreamManager = new Hp(this.engine, this.log), this.incomingDataTrackManager = new Zp({
20321
+ }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, pp), e), this.log = Re((n = this.options.loggerName) !== null && n !== void 0 ? n : pe.Room, () => this.logContext), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, Fc), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, Bc), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, hp), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new jp(), this.outgoingDataStreamManager = new Kp(this.engine, this.log), this.incomingDataTrackManager = new ef({
20310
20322
  e2eeManager: this.e2eeManager
20311
20323
  }), this.incomingDataTrackManager.on("sfuUpdateSubscription", (c) => {
20312
20324
  this.engine.client.sendUpdateDataSubscription(c.sid, c.subscribe);
@@ -20329,18 +20341,18 @@ class sn extends Ie.EventEmitter {
20329
20341
  }).on("packetAvailable", (c) => {
20330
20342
  let l = c.handle, u = c.bytes;
20331
20343
  this.engine.sendLossyBytes(u, j.DATA_TRACK_LOSSY, "wait").finally(() => this.outgoingDataTrackManager.handlePacketSendComplete(l));
20332
- }), this.registerRpcDataStreamHandler(), this.rpcClientManager = new nf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol, () => {
20344
+ }), this.registerRpcDataStreamHandler(), this.rpcClientManager = new sf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol, () => {
20333
20345
  var c, l;
20334
20346
  return (l = (c = this.engine.latestJoinResponse) === null || c === void 0 ? void 0 : c.serverInfo) === null || l === void 0 ? void 0 : l.version;
20335
20347
  }), this.rpcClientManager.on("sendDataPacket", (c) => {
20336
20348
  let l = c.packet;
20337
20349
  var u;
20338
20350
  (u = this.engine) === null || u === void 0 || u.sendDataPacket(l, j.RELIABLE);
20339
- }), this.rpcServerManager = new sf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol), this.rpcServerManager.on("sendDataPacket", (c) => {
20351
+ }), this.rpcServerManager = new rf(this.log, this.outgoingDataStreamManager, this.getRemoteParticipantClientProtocol), this.rpcServerManager.on("sendDataPacket", (c) => {
20340
20352
  let l = c.packet;
20341
20353
  var u;
20342
20354
  (u = this.engine) === null || u === void 0 || u.sendDataPacket(l, j.RELIABLE);
20343
- }), this.disconnectLock = new ge(), this.localParticipant = new lf("", "", this.engine, this.options, this.outgoingDataStreamManager, this.outgoingDataTrackManager, this.rpcClientManager, this.rpcServerManager), this.setupFrameMetadata(), (this.options.e2ee || this.options.encryption) && this.setupE2EE(), this.engine.e2eeManager = this.e2eeManager, this.incomingDataTrackManager.updateE2eeManager((s = this.e2eeManager) !== null && s !== void 0 ? s : null), this.outgoingDataTrackManager.updateE2eeManager((r = this.e2eeManager) !== null && r !== void 0 ? r : null), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", At(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", At(this.options.audioCaptureDefaults.deviceId)), !((a = this.options.audioOutput) === null || a === void 0) && a.deviceId && this.switchActiveDevice("audiooutput", At(this.options.audioOutput.deviceId)).catch((c) => this.log.warn("Could not set audio output: ".concat(c.message))), Pe()) {
20355
+ }), this.disconnectLock = new ge(), this.localParticipant = new uf("", "", this.engine, this.options, this.outgoingDataStreamManager, this.outgoingDataTrackManager, this.rpcClientManager, this.rpcServerManager), this.setupFrameMetadata(), (this.options.e2ee || this.options.encryption) && this.setupE2EE(), this.engine.e2eeManager = this.e2eeManager, this.incomingDataTrackManager.updateE2eeManager((s = this.e2eeManager) !== null && s !== void 0 ? s : null), this.outgoingDataTrackManager.updateE2eeManager((r = this.e2eeManager) !== null && r !== void 0 ? r : null), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", At(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", At(this.options.audioCaptureDefaults.deviceId)), !((a = this.options.audioOutput) === null || a === void 0) && a.deviceId && this.switchActiveDevice("audiooutput", At(this.options.audioOutput.deviceId)).catch((c) => this.log.warn("Could not set audio output: ".concat(c.message))), Pe()) {
20344
20356
  const c = new AbortController();
20345
20357
  let l;
20346
20358
  if (sn.cleanupRegistry) {
@@ -20426,8 +20438,8 @@ class sn extends Ie.EventEmitter {
20426
20438
  setupE2EE() {
20427
20439
  var e, t;
20428
20440
  const n = !!this.options.encryption, s = this.options.encryption || this.options.e2ee;
20429
- s && ("e2eeManager" in s ? (this.e2eeManager = s.e2eeManager, this.e2eeManager.isDataChannelEncryptionEnabled = n) : this.e2eeManager = new Wh(s, n), this.e2eeManager.on(mt.ParticipantEncryptionStatusChanged, (r, a) => {
20430
- Eh(a) && (this.isE2EEEnabled = r), this.emit(E.ParticipantEncryptionStatusChanged, r, a);
20441
+ s && ("e2eeManager" in s ? (this.e2eeManager = s.e2eeManager, this.e2eeManager.isDataChannelEncryptionEnabled = n) : this.e2eeManager = new Hh(s, n), this.e2eeManager.on(mt.ParticipantEncryptionStatusChanged, (r, a) => {
20442
+ Ph(a) && (this.isE2EEEnabled = r), this.emit(E.ParticipantEncryptionStatusChanged, r, a);
20431
20443
  }), this.e2eeManager.on(mt.EncryptionError, (r, a) => {
20432
20444
  const o = a ? this.getParticipantByIdentity(a) : void 0;
20433
20445
  this.emit(E.EncryptionError, r, o);
@@ -20436,7 +20448,7 @@ class sn extends Ie.EventEmitter {
20436
20448
  setupFrameMetadata() {
20437
20449
  var e;
20438
20450
  const t = (e = this.options.frameMetadata) !== null && e !== void 0 ? e : this.options.packetTrailer;
20439
- this.frameMetadataManager = new Gh(t), this.frameMetadataManager.setup(this);
20451
+ this.frameMetadataManager = new zh(t), this.frameMetadataManager.setup(this);
20440
20452
  }
20441
20453
  get logContext() {
20442
20454
  var e, t, n;
@@ -20487,7 +20499,7 @@ class sn extends Ie.EventEmitter {
20487
20499
  return (t = (e = this.roomInfo) === null || e === void 0 ? void 0 : e.numPublishers) !== null && t !== void 0 ? t : 0;
20488
20500
  }
20489
20501
  maybeCreateEngine() {
20490
- this.engine && (this.engine.isNewlyCreated || !this.engine.isClosed) || (this.engine = new Np(this.options), this.engine.e2eeManager = this.e2eeManager, this.engine.on(P.ParticipantUpdate, this.handleParticipantUpdates).on(P.RoomUpdate, this.handleRoomUpdate).on(P.SpeakersChanged, this.handleSpeakersChanged).on(P.StreamStateChanged, this.handleStreamStateUpdate).on(P.ConnectionQualityUpdate, this.handleConnectionQualityUpdate).on(P.SubscriptionError, this.handleSubscriptionError).on(P.SubscriptionPermissionUpdate, this.handleSubscriptionPermissionUpdate).on(P.MediaTrackAdded, (e, t, n) => {
20502
+ this.engine && (this.engine.isNewlyCreated || !this.engine.isClosed) || (this.engine = new Up(this.options), this.engine.e2eeManager = this.e2eeManager, this.engine.on(P.ParticipantUpdate, this.handleParticipantUpdates).on(P.RoomUpdate, this.handleRoomUpdate).on(P.SpeakersChanged, this.handleSpeakersChanged).on(P.StreamStateChanged, this.handleStreamStateUpdate).on(P.ConnectionQualityUpdate, this.handleConnectionQualityUpdate).on(P.SubscriptionError, this.handleSubscriptionError).on(P.SubscriptionPermissionUpdate, this.handleSubscriptionPermissionUpdate).on(P.MediaTrackAdded, (e, t, n) => {
20491
20503
  this.onTrackAdded(e, t, n);
20492
20504
  }).on(P.Disconnected, (e) => {
20493
20505
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, e);
@@ -20775,11 +20787,11 @@ class sn extends Ie.EventEmitter {
20775
20787
  } catch (v) {
20776
20788
  throw r.options.audioCaptureDefaults.deviceId = k, v;
20777
20789
  }
20778
- const L = S.some((v) => {
20790
+ const N = S.some((v) => {
20779
20791
  var y, C;
20780
20792
  return (C = (y = v.track) === null || y === void 0 ? void 0 : y.isMuted) !== null && C !== void 0 ? C : !1;
20781
20793
  });
20782
- g && L && (m = !0);
20794
+ g && N && (m = !0);
20783
20795
  } else if (n === "videoinput") {
20784
20796
  m = r.localParticipant.videoTrackPublications.size === 0;
20785
20797
  const k = (d = r.getActiveDevice(n)) !== null && d !== void 0 ? d : r.options.videoCaptureDefaults.deviceId;
@@ -20793,11 +20805,11 @@ class sn extends Ie.EventEmitter {
20793
20805
  } catch (v) {
20794
20806
  throw r.options.videoCaptureDefaults.deviceId = k, v;
20795
20807
  }
20796
- const L = S.some((v) => {
20808
+ const N = S.some((v) => {
20797
20809
  var y, C;
20798
20810
  return (C = (y = v.track) === null || y === void 0 ? void 0 : y.isMuted) !== null && C !== void 0 ? C : !1;
20799
20811
  });
20800
- g && L && (m = !0);
20812
+ g && N && (m = !0);
20801
20813
  } else if (n === "audiooutput") {
20802
20814
  if (m = !0, !xs() && !r.options.webAudioMix || r.options.webAudioMix && r.audioContext && !("setSinkId" in r.audioContext))
20803
20815
  throw new Error("cannot switch audio output, the current browser does not support it");
@@ -20845,7 +20857,7 @@ class sn extends Ie.EventEmitter {
20845
20857
  this.log.debug("skipping incoming track as it already ended");
20846
20858
  return;
20847
20859
  }
20848
- const s = lh(t.id), r = s[0];
20860
+ const s = uh(t.id), r = s[0];
20849
20861
  let a = s[1], o = e.id;
20850
20862
  if (a && a.startsWith("TR") && (o = a), r === this.localParticipant.sid) {
20851
20863
  this.log.warn("tried to create RemoteParticipant for local participant");
@@ -20939,7 +20951,7 @@ class sn extends Ie.EventEmitter {
20939
20951
  }
20940
20952
  const o = ["audiooutput", "audioinput", "videoinput"];
20941
20953
  for (let d of o) {
20942
- const c = th(d), l = this.localParticipant.getTrackPublication(c);
20954
+ const c = nh(d), l = this.localParticipant.getTrackPublication(c);
20943
20955
  if (l && (!((e = l.track) === null || e === void 0) && e.isUserProvided))
20944
20956
  continue;
20945
20957
  const u = r.filter((p) => p.kind === d), h = this.getActiveDevice(d);
@@ -21027,7 +21039,7 @@ class sn extends Ie.EventEmitter {
21027
21039
  updateSubscriptions() {
21028
21040
  for (const e of this.remoteParticipants.values())
21029
21041
  for (const t of e.videoTrackPublications.values())
21030
- t.isSubscribed && wh(t) && t.emitTrackUpdate();
21042
+ t.isSubscribed && Eh(t) && t.emitTrackUpdate();
21031
21043
  }
21032
21044
  getRemoteParticipantBySid(e) {
21033
21045
  const t = this.sidToIdentity.get(e);
@@ -21067,7 +21079,7 @@ class sn extends Ie.EventEmitter {
21067
21079
  transportsConnectedOrConnecting: this.engine.verifyTransport()
21068
21080
  } : void 0
21069
21081
  }), e >= 3 && (this.recreateEngine(), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, He.STATE_MISMATCH))) : e = 0;
21070
- }, pf);
21082
+ }, ff);
21071
21083
  }
21072
21084
  clearConnectionReconcile() {
21073
21085
  this.connectionReconcileInterval && ce.clearInterval(this.connectionReconcileInterval);
@@ -21301,7 +21313,7 @@ class Ct extends Ie.EventEmitter {
21301
21313
  };
21302
21314
  }
21303
21315
  }
21304
- class ff extends Ct {
21316
+ class mf extends Ct {
21305
21317
  get description() {
21306
21318
  return "Cloud regions";
21307
21319
  }
@@ -21357,7 +21369,7 @@ class ff extends Ct {
21357
21369
  }
21358
21370
  }
21359
21371
  const ls = 1e4;
21360
- class mf extends Ct {
21372
+ class gf extends Ct {
21361
21373
  get description() {
21362
21374
  return "Connection via UDP vs TCP";
21363
21375
  }
@@ -21411,14 +21423,14 @@ class mf extends Ct {
21411
21423
  });
21412
21424
  }
21413
21425
  }
21414
- class gf extends Ct {
21426
+ class vf extends Ct {
21415
21427
  get description() {
21416
21428
  return "Can publish audio";
21417
21429
  }
21418
21430
  perform() {
21419
21431
  return f(this, void 0, void 0, function* () {
21420
21432
  var e;
21421
- const t = yield this.connect(), n = yield of();
21433
+ const t = yield this.connect(), n = yield cf();
21422
21434
  if (yield Rc(n, 1e3))
21423
21435
  throw new Error("unable to detect audio from microphone");
21424
21436
  this.appendMessage("detected audio from microphone"), t.localParticipant.publishTrack(n), yield new Promise((o) => setTimeout(o, 3e3));
@@ -21434,14 +21446,14 @@ class gf extends Ct {
21434
21446
  });
21435
21447
  }
21436
21448
  }
21437
- class vf extends Ct {
21449
+ class bf extends Ct {
21438
21450
  get description() {
21439
21451
  return "Can publish video";
21440
21452
  }
21441
21453
  perform() {
21442
21454
  return f(this, void 0, void 0, function* () {
21443
21455
  var e;
21444
- const t = yield this.connect(), n = yield af();
21456
+ const t = yield this.connect(), n = yield of();
21445
21457
  yield this.checkForVideo(n.mediaStreamTrack), t.localParticipant.publishTrack(n), yield new Promise((a) => setTimeout(a, 5e3));
21446
21458
  const s = yield (e = n.sender) === null || e === void 0 ? void 0 : e.getStats();
21447
21459
  if (!s)
@@ -21481,7 +21493,7 @@ class vf extends Ct {
21481
21493
  });
21482
21494
  }
21483
21495
  }
21484
- class bf extends Ct {
21496
+ class yf extends Ct {
21485
21497
  get description() {
21486
21498
  return "Resuming connection after interruption";
21487
21499
  }
@@ -21506,7 +21518,7 @@ class bf extends Ct {
21506
21518
  });
21507
21519
  }
21508
21520
  }
21509
- class yf extends Ct {
21521
+ class kf extends Ct {
21510
21522
  get description() {
21511
21523
  return "Can connect via TURN";
21512
21524
  }
@@ -21532,7 +21544,7 @@ class yf extends Ct {
21532
21544
  });
21533
21545
  }
21534
21546
  }
21535
- class kf extends Ct {
21547
+ class Tf extends Ct {
21536
21548
  get description() {
21537
21549
  return "Establishing WebRTC connection";
21538
21550
  }
@@ -21546,7 +21558,7 @@ class kf extends Ct {
21546
21558
  if (r.candidate) {
21547
21559
  const o = new RTCIceCandidate(r);
21548
21560
  let d = "".concat(o.protocol, " ").concat(o.address, ":").concat(o.port, " ").concat(o.type);
21549
- o.address && (Tf(o.address) ? d += " (private)" : o.protocol === "tcp" && o.tcpType === "passive" ? (e = !0, d += " (passive)") : o.protocol === "udp" && (t = !0)), this.appendMessage(d);
21561
+ o.address && (Sf(o.address) ? d += " (private)" : o.protocol === "tcp" && o.tcpType === "passive" ? (e = !0, d += " (passive)") : o.protocol === "udp" && (t = !0)), this.appendMessage(d);
21550
21562
  }
21551
21563
  s && s(r, a);
21552
21564
  }, !((n = this.room.engine.pcManager) === null || n === void 0) && n.subscriber && (this.room.engine.pcManager.subscriber.onIceCandidateError = (r) => {
@@ -21562,7 +21574,7 @@ class kf extends Ct {
21562
21574
  });
21563
21575
  }
21564
21576
  }
21565
- function Tf(i) {
21577
+ function Sf(i) {
21566
21578
  const e = i.split(".");
21567
21579
  if (e.length === 4) {
21568
21580
  if (e[0] === "10")
@@ -21577,7 +21589,7 @@ function Tf(i) {
21577
21589
  }
21578
21590
  return !1;
21579
21591
  }
21580
- class Sf extends Ct {
21592
+ class Cf extends Ct {
21581
21593
  get description() {
21582
21594
  return "Connecting to signal connection via WebSocket";
21583
21595
  }
@@ -21609,7 +21621,7 @@ class Sf extends Ct {
21609
21621
  });
21610
21622
  }
21611
21623
  }
21612
- class Hf extends Ie.EventEmitter {
21624
+ class Kf extends Ie.EventEmitter {
21613
21625
  constructor(e, t) {
21614
21626
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
21615
21627
  super(), this.options = {}, this.checkResults = /* @__PURE__ */ new Map(), this.url = e, this.token = t, this.options = n;
@@ -21644,37 +21656,37 @@ class Hf extends Ie.EventEmitter {
21644
21656
  }
21645
21657
  checkWebsocket() {
21646
21658
  return f(this, void 0, void 0, function* () {
21647
- return this.createAndRunCheck(Sf);
21659
+ return this.createAndRunCheck(Cf);
21648
21660
  });
21649
21661
  }
21650
21662
  checkWebRTC() {
21651
21663
  return f(this, void 0, void 0, function* () {
21652
- return this.createAndRunCheck(kf);
21664
+ return this.createAndRunCheck(Tf);
21653
21665
  });
21654
21666
  }
21655
21667
  checkTURN() {
21656
21668
  return f(this, void 0, void 0, function* () {
21657
- return this.createAndRunCheck(yf);
21669
+ return this.createAndRunCheck(kf);
21658
21670
  });
21659
21671
  }
21660
21672
  checkReconnect() {
21661
21673
  return f(this, void 0, void 0, function* () {
21662
- return this.createAndRunCheck(bf);
21674
+ return this.createAndRunCheck(yf);
21663
21675
  });
21664
21676
  }
21665
21677
  checkPublishAudio() {
21666
21678
  return f(this, void 0, void 0, function* () {
21667
- return this.createAndRunCheck(gf);
21679
+ return this.createAndRunCheck(vf);
21668
21680
  });
21669
21681
  }
21670
21682
  checkPublishVideo() {
21671
21683
  return f(this, void 0, void 0, function* () {
21672
- return this.createAndRunCheck(vf);
21684
+ return this.createAndRunCheck(bf);
21673
21685
  });
21674
21686
  }
21675
21687
  checkConnectionProtocol() {
21676
21688
  return f(this, void 0, void 0, function* () {
21677
- const e = yield this.createAndRunCheck(mf);
21689
+ const e = yield this.createAndRunCheck(gf);
21678
21690
  if (e.data && "protocol" in e.data) {
21679
21691
  const t = e.data;
21680
21692
  this.options.protocol = t.protocol;
@@ -21684,7 +21696,7 @@ class Hf extends Ie.EventEmitter {
21684
21696
  }
21685
21697
  checkCloudRegion() {
21686
21698
  return f(this, void 0, void 0, function* () {
21687
- return this.createAndRunCheck(ff);
21699
+ return this.createAndRunCheck(mf);
21688
21700
  });
21689
21701
  }
21690
21702
  }
@@ -21697,7 +21709,7 @@ class _e extends Error {
21697
21709
  }
21698
21710
  }
21699
21711
  K(_e, "code", "ERR_JOSE_GENERIC");
21700
- class Cf extends _e {
21712
+ class _f extends _e {
21701
21713
  constructor(e, t) {
21702
21714
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "unspecified", s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unspecified";
21703
21715
  super(e, {
@@ -21709,8 +21721,8 @@ class Cf extends _e {
21709
21721
  }), K(this, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED"), K(this, "claim", void 0), K(this, "reason", void 0), K(this, "payload", void 0), this.claim = n, this.reason = s, this.payload = t;
21710
21722
  }
21711
21723
  }
21712
- K(Cf, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
21713
- class _f extends _e {
21724
+ K(_f, "code", "ERR_JWT_CLAIM_VALIDATION_FAILED");
21725
+ class wf extends _e {
21714
21726
  constructor(e, t) {
21715
21727
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "unspecified", s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "unspecified";
21716
21728
  super(e, {
@@ -21722,92 +21734,92 @@ class _f extends _e {
21722
21734
  }), K(this, "code", "ERR_JWT_EXPIRED"), K(this, "claim", void 0), K(this, "reason", void 0), K(this, "payload", void 0), this.claim = n, this.reason = s, this.payload = t;
21723
21735
  }
21724
21736
  }
21725
- K(_f, "code", "ERR_JWT_EXPIRED");
21726
- class wf extends _e {
21737
+ K(wf, "code", "ERR_JWT_EXPIRED");
21738
+ class Ef extends _e {
21727
21739
  constructor() {
21728
21740
  super(...arguments), K(this, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
21729
21741
  }
21730
21742
  }
21731
- K(wf, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
21732
- class Ef extends _e {
21743
+ K(Ef, "code", "ERR_JOSE_ALG_NOT_ALLOWED");
21744
+ class Pf extends _e {
21733
21745
  constructor() {
21734
21746
  super(...arguments), K(this, "code", "ERR_JOSE_NOT_SUPPORTED");
21735
21747
  }
21736
21748
  }
21737
- K(Ef, "code", "ERR_JOSE_NOT_SUPPORTED");
21738
- class Pf extends _e {
21749
+ K(Pf, "code", "ERR_JOSE_NOT_SUPPORTED");
21750
+ class Rf extends _e {
21739
21751
  constructor() {
21740
21752
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "decryption operation failed", t = arguments.length > 1 ? arguments[1] : void 0;
21741
21753
  super(e, t), K(this, "code", "ERR_JWE_DECRYPTION_FAILED");
21742
21754
  }
21743
21755
  }
21744
- K(Pf, "code", "ERR_JWE_DECRYPTION_FAILED");
21745
- class Rf extends _e {
21756
+ K(Rf, "code", "ERR_JWE_DECRYPTION_FAILED");
21757
+ class If extends _e {
21746
21758
  constructor() {
21747
21759
  super(...arguments), K(this, "code", "ERR_JWE_INVALID");
21748
21760
  }
21749
21761
  }
21750
- K(Rf, "code", "ERR_JWE_INVALID");
21751
- class If extends _e {
21762
+ K(If, "code", "ERR_JWE_INVALID");
21763
+ class Mf extends _e {
21752
21764
  constructor() {
21753
21765
  super(...arguments), K(this, "code", "ERR_JWS_INVALID");
21754
21766
  }
21755
21767
  }
21756
- K(If, "code", "ERR_JWS_INVALID");
21757
- class Mf extends _e {
21768
+ K(Mf, "code", "ERR_JWS_INVALID");
21769
+ class Df extends _e {
21758
21770
  constructor() {
21759
21771
  super(...arguments), K(this, "code", "ERR_JWT_INVALID");
21760
21772
  }
21761
21773
  }
21762
- K(Mf, "code", "ERR_JWT_INVALID");
21763
- class Df extends _e {
21774
+ K(Df, "code", "ERR_JWT_INVALID");
21775
+ class Af extends _e {
21764
21776
  constructor() {
21765
21777
  super(...arguments), K(this, "code", "ERR_JWK_INVALID");
21766
21778
  }
21767
21779
  }
21768
- K(Df, "code", "ERR_JWK_INVALID");
21769
- class Af extends _e {
21780
+ K(Af, "code", "ERR_JWK_INVALID");
21781
+ class Of extends _e {
21770
21782
  constructor() {
21771
21783
  super(...arguments), K(this, "code", "ERR_JWKS_INVALID");
21772
21784
  }
21773
21785
  }
21774
- K(Af, "code", "ERR_JWKS_INVALID");
21775
- class Of extends _e {
21786
+ K(Of, "code", "ERR_JWKS_INVALID");
21787
+ class xf extends _e {
21776
21788
  constructor() {
21777
21789
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "no applicable key found in the JSON Web Key Set", t = arguments.length > 1 ? arguments[1] : void 0;
21778
21790
  super(e, t), K(this, "code", "ERR_JWKS_NO_MATCHING_KEY");
21779
21791
  }
21780
21792
  }
21781
- K(Of, "code", "ERR_JWKS_NO_MATCHING_KEY");
21782
- class xf extends _e {
21793
+ K(xf, "code", "ERR_JWKS_NO_MATCHING_KEY");
21794
+ class Lf extends _e {
21783
21795
  constructor() {
21784
21796
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "multiple matching keys found in the JSON Web Key Set", t = arguments.length > 1 ? arguments[1] : void 0;
21785
21797
  super(e, t), K(this, Symbol.asyncIterator, void 0), K(this, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
21786
21798
  }
21787
21799
  }
21788
- K(xf, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
21789
- class Lf extends _e {
21800
+ K(Lf, "code", "ERR_JWKS_MULTIPLE_MATCHING_KEYS");
21801
+ class Nf extends _e {
21790
21802
  constructor() {
21791
21803
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "request timed out", t = arguments.length > 1 ? arguments[1] : void 0;
21792
21804
  super(e, t), K(this, "code", "ERR_JWKS_TIMEOUT");
21793
21805
  }
21794
21806
  }
21795
- K(Lf, "code", "ERR_JWKS_TIMEOUT");
21796
- class Nf extends _e {
21807
+ K(Nf, "code", "ERR_JWKS_TIMEOUT");
21808
+ class Uf extends _e {
21797
21809
  constructor() {
21798
21810
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "signature verification failed", t = arguments.length > 1 ? arguments[1] : void 0;
21799
21811
  super(e, t), K(this, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
21800
21812
  }
21801
21813
  }
21802
- K(Nf, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
21803
- const Uf = "core-bridge-";
21804
- function Ff(i) {
21814
+ K(Uf, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
21815
+ const Ff = "core-bridge-";
21816
+ function Bf(i) {
21805
21817
  return i.replace(/\/$/, "");
21806
21818
  }
21807
- function Bf() {
21819
+ function Vf() {
21808
21820
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `call-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
21809
21821
  }
21810
- class Kf {
21822
+ class Gf {
21811
21823
  constructor(e) {
21812
21824
  D(this, "serverUrl");
21813
21825
  D(this, "agentId");
@@ -21824,7 +21836,7 @@ class Kf {
21824
21836
  D(this, "disconnecting", !1);
21825
21837
  if (!e.serverUrl) throw new Error("serverUrl is required");
21826
21838
  if (!e.agentId) throw new Error("agentId is required");
21827
- this.serverUrl = Ff(e.serverUrl), this.agentId = e.agentId, this.callId = e.callId ?? Bf(), this.authToken = e.token, this.continuedCallId = e.continuedCallId, this.bridgePrefix = e.bridgeIdentityPrefix ?? Uf, this.onConnected = e.onConnected, this.onDisconnected = e.onDisconnected, this.onError = e.onError;
21839
+ this.serverUrl = Bf(e.serverUrl), this.agentId = e.agentId, this.callId = e.callId ?? Vf(), this.authToken = e.token, this.continuedCallId = e.continuedCallId, this.bridgePrefix = e.bridgeIdentityPrefix ?? Ff, this.onConnected = e.onConnected, this.onDisconnected = e.onDisconnected, this.onError = e.onError;
21828
21840
  }
21829
21841
  get isConnected() {
21830
21842
  return this.connected;
@@ -22071,7 +22083,7 @@ const jt = class jt {
22071
22083
  D(jt, "HEARTBEAT_INTERVAL_MS", 5e3), /** How old (ms) a heartbeat must be before we consider the tab dead */
22072
22084
  D(jt, "HEARTBEAT_TIMEOUT_MS", 15e3);
22073
22085
  let za = jt;
22074
- class Gf {
22086
+ class zf {
22075
22087
  static async fetchWidgetConfig(e, t) {
22076
22088
  var s;
22077
22089
  const n = { "Content-Type": "application/json" };
@@ -22091,8 +22103,8 @@ class Gf {
22091
22103
  }
22092
22104
  }
22093
22105
  let hn = "https://inboxapi.vanira.io";
22094
- const Vf = "https://coredb.travelr.club/v1/graphql";
22095
- class zf {
22106
+ const qf = "https://coredb.travelr.club/v1/graphql";
22107
+ class Jf {
22096
22108
  static setChatUrl(e) {
22097
22109
  hn = e;
22098
22110
  }
@@ -22106,7 +22118,7 @@ class zf {
22106
22118
  }
22107
22119
  `;
22108
22120
  try {
22109
- const a = await (await fetch(Vf, {
22121
+ const a = await (await fetch(qf, {
22110
22122
  method: "POST",
22111
22123
  headers: { "Content-Type": "application/json" },
22112
22124
  body: JSON.stringify({
@@ -22163,11 +22175,11 @@ class zf {
22163
22175
  if (!T.ok) throw new Error("Chat request failed");
22164
22176
  const k = (l = T.body) == null ? void 0 : l.getReader(), S = new TextDecoder();
22165
22177
  if (!k) throw new Error("No reader");
22166
- let L = "", v = "", y = null, C = null;
22178
+ let N = "", v = "", y = null, C = null;
22167
22179
  for (; ; ) {
22168
- const { done: I, value: x } = await k.read();
22180
+ const { done: I, value: L } = await k.read();
22169
22181
  if (I) break;
22170
- v += S.decode(x, { stream: !0 });
22182
+ v += S.decode(L, { stream: !0 });
22171
22183
  const V = v.split(`
22172
22184
  `);
22173
22185
  v = V.pop() || "";
@@ -22186,7 +22198,7 @@ class zf {
22186
22198
  continue;
22187
22199
  }
22188
22200
  const Z = (p = (h = (u = W.choices) == null ? void 0 : u[0]) == null ? void 0 : h.delta) == null ? void 0 : p.content;
22189
- Z && (L += Z, r(L)), W.widget && a(W.widget), W.chat_id && !y && (y = W.chat_id), W.conversation_id && !C && (C = W.conversation_id);
22201
+ Z && (N += Z, r(N)), W.widget && a(W.widget), W.chat_id && !y && (y = W.chat_id), W.conversation_id && !C && (C = W.conversation_id);
22190
22202
  } catch {
22191
22203
  }
22192
22204
  }
@@ -22264,15 +22276,15 @@ export {
22264
22276
  pd as BrowserDataChannelAdapter,
22265
22277
  ld as BrowserMediaAdapter,
22266
22278
  ud as BrowserPeerAdapter,
22267
- zf as ChatService,
22268
- Gf as ConfigService,
22269
- Kf as LiveKitVoiceClient,
22279
+ Jf as ChatService,
22280
+ zf as ConfigService,
22281
+ Gf as LiveKitVoiceClient,
22270
22282
  za as SessionManager,
22271
22283
  fs as VaniraAI,
22272
22284
  fs as VaniraClient,
22273
22285
  fs as WebRTCClient,
22274
- Od as browserCapabilities,
22275
- xd as browserRuntime,
22276
- jf as createBrowserAI,
22277
- Ld as createBrowserClient
22286
+ xd as browserCapabilities,
22287
+ Ld as browserRuntime,
22288
+ Wf as createBrowserAI,
22289
+ Nd as createBrowserClient
22278
22290
  };