@vkontakte/calls-sdk 2.8.11-dev.efee13f5.0 → 2.8.11-dev.f092dc48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/calls-sdk.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @vkontakte/calls-sdk v2.8.11-dev.efee13f5.0
3
- * Fri, 03 Jul 2026 10:35:46 GMT
2
+ * @vkontakte/calls-sdk v2.8.11-dev.f092dc48.0
3
+ * Fri, 03 Jul 2026 05:50:21 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -55,31 +55,31 @@ function h(e, t, n) {
55
55
  }
56
56
  //#endregion
57
57
  //#region src/utils/DebugStorage.ts
58
- var te = 25 * 1024 * 1024, ne = 10, re = "_okcls_logs_session_", ie = 3e4, ae = "ok-calls-sdk-debug-logs", oe = 1, g = "sessions", _ = "chunks", se = 120 * 1e3, ce = new Set(["WARN", "ERROR"]);
59
- function le() {
60
- return `${Date.now()}_${Math.random().toString(36).slice(2)}`;
61
- }
58
+ var te = 25 * 1024 * 1024, ne = 10, re = "_okcls_logs_session_", ie = 3e4, ae = "ok-calls-sdk-debug-logs", oe = 1, g = "sessions", se = "chunks", ce = 120 * 1e3, le = new Set(["WARN", "ERROR"]);
62
59
  function ue() {
63
- let e = le();
64
- return de(e), e;
60
+ return `${Date.now()}_${Math.random().toString(36).slice(2)}`;
65
61
  }
66
- function de(e) {
67
- He.has(e) || He.set(e, []), Ue.has(e) || Ue.set(e, 0), We.has(e) || We.set(e, null);
62
+ function de() {
63
+ let e = ue();
64
+ return fe(e), e;
68
65
  }
69
66
  function fe(e) {
70
- return We.get(e) ?? null;
67
+ Ue.has(e) || Ue.set(e, []), We.has(e) || We.set(e, 0), Ge.has(e) || Ge.set(e, null);
71
68
  }
72
69
  function pe(e) {
73
- let t = Ue.get(e) ?? 0;
74
- return Ue.set(e, t + 1), t;
70
+ return Ge.get(e) ?? null;
75
71
  }
76
- function me(e, t) {
72
+ function me(e) {
73
+ let t = We.get(e) ?? 0;
74
+ return We.set(e, t + 1), t;
75
+ }
76
+ function he(e, t) {
77
77
  return `${e}:${String(t).padStart(12, "0")}`;
78
78
  }
79
- function he(e) {
79
+ function ge(e) {
80
80
  return new Blob([e]).size;
81
81
  }
82
- function ge() {
82
+ function _e() {
83
83
  try {
84
84
  let e = window.localStorage;
85
85
  for (let t of Object.keys(e)) t.indexOf(re) === 0 && e.removeItem(t);
@@ -87,7 +87,7 @@ function ge() {
87
87
  console.error("Storage is blocked", e);
88
88
  }
89
89
  }
90
- var v = new class {
90
+ var _ = new class {
91
91
  constructor() {
92
92
  h(this, "_db", null), h(this, "_dbPromise", null), h(this, "_supported", this.isSupported());
93
93
  }
@@ -140,7 +140,7 @@ var v = new class {
140
140
  async getChunksBySession(e) {
141
141
  let t = await this.open();
142
142
  if (!t) return [];
143
- let n = t.transaction(_, "readonly"), r = await this.requestToPromise(n.objectStore(_).index("sessionId").getAll(e));
143
+ let n = t.transaction(se, "readonly"), r = await this.requestToPromise(n.objectStore(se).index("sessionId").getAll(e));
144
144
  return await this.txDone(n), r.sort((e, t) => e.sequence - t.sequence);
145
145
  }
146
146
  async putSession(e) {
@@ -152,8 +152,8 @@ var v = new class {
152
152
  async putSessionAndChunk(e, t) {
153
153
  let n = await this.open();
154
154
  if (!n) return !1;
155
- let r = n.transaction([g, _], "readwrite");
156
- return r.objectStore(g).put(e), r.objectStore(_).put(t), await this.txDone(r), !0;
155
+ let r = n.transaction([g, se], "readwrite");
156
+ return r.objectStore(g).put(e), r.objectStore(se).put(t), await this.txDone(r), !0;
157
157
  }
158
158
  async updateSessionConversationId(e, t) {
159
159
  let [n] = await this.getSessionBySessionId(e);
@@ -166,14 +166,14 @@ var v = new class {
166
166
  async deleteSession(e) {
167
167
  let t = await this.open();
168
168
  if (!t) return 0;
169
- let n = await this.getChunksBySession(e), r = t.transaction([g, _], "readwrite"), i = r.objectStore(_), a = 0;
169
+ let n = await this.getChunksBySession(e), r = t.transaction([g, se], "readwrite"), i = r.objectStore(se), a = 0;
170
170
  for (let e of n) a += e.bytes, i.delete(e.id);
171
171
  return r.objectStore(g).delete(e), await this.txDone(r), a;
172
172
  }
173
173
  async deleteChunks(e) {
174
174
  let t = await this.open();
175
175
  if (!t || !e.length) return;
176
- let n = t.transaction(_, "readwrite"), r = n.objectStore(_);
176
+ let n = t.transaction(se, "readwrite"), r = n.objectStore(se);
177
177
  for (let t of e) r.delete(t.id);
178
178
  await this.txDone(n);
179
179
  }
@@ -207,7 +207,7 @@ var v = new class {
207
207
  let t = e.createObjectStore(g, { keyPath: "sessionId" });
208
208
  t.createIndex("conversationId", "conversationId", { unique: !1 }), t.createIndex("updatedAt", "updatedAt", { unique: !1 });
209
209
  }
210
- e.objectStoreNames.contains(_) || e.createObjectStore(_, { keyPath: "id" }).createIndex("sessionId", "sessionId", { unique: !1 });
210
+ e.objectStoreNames.contains(se) || e.createObjectStore(se, { keyPath: "id" }).createIndex("sessionId", "sessionId", { unique: !1 });
211
211
  }
212
212
  isSupported() {
213
213
  return typeof window < "u" && !!window.indexedDB;
@@ -278,15 +278,15 @@ var v = new class {
278
278
  return i;
279
279
  }
280
280
  }();
281
- async function _e(e) {
282
- return e.sessionId ? v.getSessionBySessionId(e.sessionId) : e.conversationId ? v.getSessionsByConversationId(e.conversationId) : [];
281
+ async function ve(e) {
282
+ return e.sessionId ? _.getSessionBySessionId(e.sessionId) : e.conversationId ? _.getSessionsByConversationId(e.conversationId) : [];
283
283
  }
284
- async function ve(e, t, n, r) {
284
+ async function ye(e, t, n, r) {
285
285
  if (!r.length) return;
286
- let i = fe(e) || t, a = r, o = JSON.stringify(a), s = he(o);
287
- for (; s > te && a.length > 1;) a = a.slice(Math.floor(a.length / 2)), o = JSON.stringify(a), s = he(o);
286
+ let i = pe(e) || t, a = r, o = JSON.stringify(a), s = ge(o);
287
+ for (; s > te && a.length > 1;) a = a.slice(Math.floor(a.length / 2)), o = JSON.stringify(a), s = ge(o);
288
288
  if (s > te) return;
289
- let c = a[0].t, l = a[a.length - 1].t, [u] = await v.getSessionBySessionId(e), d = u || {
289
+ let c = a[0].t, l = a[a.length - 1].t, [u] = await _.getSessionBySessionId(e), d = u || {
290
290
  sessionId: e,
291
291
  conversationId: i,
292
292
  startTime: c,
@@ -303,7 +303,7 @@ async function ve(e, t, n, r) {
303
303
  bytes: d.bytes + s,
304
304
  entriesCount: d.entriesCount + a.length
305
305
  }, p = {
306
- id: me(e, n),
306
+ id: he(e, n),
307
307
  sessionId: e,
308
308
  sequence: n,
309
309
  startTime: c,
@@ -311,9 +311,9 @@ async function ve(e, t, n, r) {
311
311
  bytes: s,
312
312
  items: a
313
313
  };
314
- await v.putSessionAndChunk(f, p) && await v.enforceRetentionPolicy();
314
+ await _.putSessionAndChunk(f, p) && await _.enforceRetentionPolicy();
315
315
  }
316
- function ye(e) {
316
+ function be(e) {
317
317
  let t = /* @__PURE__ */ new WeakSet();
318
318
  try {
319
319
  return JSON.parse(JSON.stringify(e, (e, n) => {
@@ -328,101 +328,101 @@ function ye(e) {
328
328
  return e.map((e) => String(e));
329
329
  }
330
330
  }
331
- function be(e) {
332
- let t = He.get(e);
333
- if (!t?.length) return qe;
334
- let n = t.splice(0), r = fe(e), i = pe(e);
335
- return qe = qe.then(() => ve(e, r, i, n)).catch((e) => {
331
+ function xe(e) {
332
+ let t = Ue.get(e);
333
+ if (!t?.length) return Je;
334
+ let n = t.splice(0), r = pe(e), i = me(e);
335
+ return Je = Je.then(() => ye(e, r, i, n)).catch((e) => {
336
336
  console.warn("Failed to write debug log to storage", e);
337
- }), qe;
337
+ }), Je;
338
338
  }
339
- function xe(e) {
340
- if (e) return be(e);
341
- for (let e of He.keys()) be(e);
342
- return qe;
339
+ function Se(e) {
340
+ if (e) return xe(e);
341
+ for (let e of Ue.keys()) xe(e);
342
+ return Je;
343
343
  }
344
- async function Se(e) {
344
+ async function Ce(e) {
345
345
  let t = [];
346
346
  for (let n of e.sort((e, t) => e.startTime - t.startTime)) {
347
- let e = await v.getChunksBySession(n.sessionId);
347
+ let e = await _.getChunksBySession(n.sessionId);
348
348
  for (let n of e) t.push(...n.items);
349
349
  }
350
350
  return t;
351
351
  }
352
- async function Ce(e) {
353
- let t = await Se(e);
352
+ async function we(e) {
353
+ let t = await Ce(e);
354
354
  if (!t.length) return t;
355
- let n = t.sort(Te), r = n[0].t, i = n[n.length - 1].t;
356
- return [...await we(r, i, new Set(e.map((e) => e.sessionId))), ...n].sort(Te);
355
+ let n = t.sort(Ee), r = n[0].t, i = n[n.length - 1].t;
356
+ return [...await Te(r, i, new Set(e.map((e) => e.sessionId))), ...n].sort(Ee);
357
357
  }
358
- async function we(e, t, n) {
359
- let r = (await v.getAllSessions()).filter((r) => !n.has(r.sessionId) && r.conversationId === null && r.endTime >= e - se && r.startTime <= t), i = [];
358
+ async function Te(e, t, n) {
359
+ let r = (await _.getAllSessions()).filter((r) => !n.has(r.sessionId) && r.conversationId === null && r.endTime >= e - ce && r.startTime <= t), i = [];
360
360
  for (let n of r) {
361
- let r = await v.getChunksBySession(n.sessionId);
362
- for (let n of r) n.endTime < e - se || n.startTime > t || i.push(...n.items.filter((n) => n.t >= e - se && n.t <= e ? !0 : n.t >= e && n.t <= t && ce.has(n.l)));
361
+ let r = await _.getChunksBySession(n.sessionId);
362
+ for (let n of r) n.endTime < e - ce || n.startTime > t || i.push(...n.items.filter((n) => n.t >= e - ce && n.t <= e ? !0 : n.t >= e && n.t <= t && le.has(n.l)));
363
363
  }
364
364
  return i;
365
365
  }
366
- function Te(e, t) {
366
+ function Ee(e, t) {
367
367
  return e.t - t.t;
368
368
  }
369
- function Ee(e, t) {
369
+ function De(e, t) {
370
370
  let n = document.createElement("a"), r = new Blob([e], { type: "text/json" }), i = URL.createObjectURL(r);
371
371
  n.href = i, n.download = t, n.click(), URL.revokeObjectURL(i);
372
372
  }
373
- function De() {
374
- xe();
375
- }
376
373
  function Oe() {
377
- document.visibilityState === "hidden" && xe();
374
+ Se();
375
+ }
376
+ function ke() {
377
+ document.visibilityState === "hidden" && Se();
378
378
  }
379
- function ke(e, t, n = Ge) {
380
- Ve || Ae(), de(n);
379
+ function Ae(e, t, n = Ke) {
380
+ He || je(), fe(n);
381
381
  let r = /* @__PURE__ */ new Date(), i = {
382
382
  t: r.getTime(),
383
383
  l: e,
384
- d: ye(t),
384
+ d: be(t),
385
385
  h: r.toLocaleString("ru-RU", {
386
386
  dateStyle: "short",
387
387
  timeStyle: "long"
388
388
  })
389
389
  };
390
- return He.get(n)?.push(i), Ke || (Ke = window.setTimeout(() => {
391
- Ke = null, xe();
390
+ return Ue.get(n)?.push(i), qe || (qe = window.setTimeout(() => {
391
+ qe = null, Se();
392
392
  }, ie)), i;
393
393
  }
394
- function Ae() {
395
- Ve || (Ve = !0, ge(), v.open(), window.addEventListener("pagehide", De), document.addEventListener("visibilitychange", Oe));
396
- }
397
394
  function je() {
398
- return Ve || Ae(), xe(), ue();
395
+ He || (He = !0, _e(), _.open(), window.addEventListener("pagehide", Oe), document.addEventListener("visibilitychange", ke));
399
396
  }
400
- function Me(e, t = Ge) {
401
- t && (de(t), We.set(t, e), e && v.updateSessionConversationId(t, e));
397
+ function Me() {
398
+ return He || je(), Se(), de();
402
399
  }
403
- async function Ne() {
404
- return await xe(), (await v.getAllSessions()).sort((e, t) => t.updatedAt - e.updatedAt);
400
+ function Ne(e, t = Ke) {
401
+ t && (fe(t), Ge.set(t, e), e && _.updateSessionConversationId(t, e));
405
402
  }
406
- async function Pe(e) {
407
- return await xe(), Ce(await _e(e));
403
+ async function Pe() {
404
+ return await Se(), (await _.getAllSessions()).sort((e, t) => t.updatedAt - e.updatedAt);
408
405
  }
409
406
  async function Fe(e) {
410
- return JSON.stringify(await Pe(e));
407
+ return await Se(), we(await ve(e));
411
408
  }
412
409
  async function Ie(e) {
413
- let t = await Fe(e), n = `logs_${e.sessionId || e.conversationId}_${Date.now()}.json`;
414
- return Ee(t, n), n;
410
+ return JSON.stringify(await Fe(e));
415
411
  }
416
412
  async function Le(e) {
417
- await xe();
418
- let t = e ? await _e(e) : await v.getAllSessions();
419
- for (let e of t) await v.deleteSession(e.sessionId);
413
+ let t = await Ie(e), n = `logs_${e.sessionId || e.conversationId}_${Date.now()}.json`;
414
+ return De(t, n), n;
415
+ }
416
+ async function Re(e) {
417
+ await Se();
418
+ let t = e ? await ve(e) : await _.getAllSessions();
419
+ for (let e of t) await _.deleteSession(e.sessionId);
420
420
  }
421
- async function Re() {
422
- await xe();
423
- let e = await v.getStorageSummary(), t = await v.estimateStorage();
421
+ async function ze() {
422
+ await Se();
423
+ let e = await _.getStorageSummary(), t = await _.estimateStorage();
424
424
  return {
425
- supported: v.supported,
425
+ supported: _.supported,
426
426
  callsCount: e.callsCount,
427
427
  sessionsCount: e.sessions.length,
428
428
  usedBytes: e.usedBytes,
@@ -432,20 +432,20 @@ async function Re() {
432
432
  usageBytes: t?.usage
433
433
  };
434
434
  }
435
- async function ze() {
436
- await xe();
437
- let e = await Se(await v.getAllSessions());
438
- return JSON.stringify(e.sort(Te));
439
- }
440
435
  async function Be() {
441
- let e = await ze(), t = `logs_${Date.now()}.json`;
442
- return Ee(e, t), t;
436
+ await Se();
437
+ let e = await Ce(await _.getAllSessions());
438
+ return JSON.stringify(e.sort(Ee));
439
+ }
440
+ async function Ve() {
441
+ let e = await Be(), t = `logs_${Date.now()}.json`;
442
+ return De(e, t), t;
443
443
  }
444
- var Ve = !1, He = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = ue(), Ke = null, qe = Promise.resolve();
445
- window.__VKCallsSDKLogs__ = (e = !1) => (Ve || Ae(), e ? ze() : Be());
444
+ var He = !1, Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Ke = de(), qe = null, Je = Promise.resolve();
445
+ window.__VKCallsSDKLogs__ = (e = !1) => (He || je(), e ? Be() : Ve());
446
446
  //#endregion
447
447
  //#region src/static/AuthData.ts
448
- var y = class e {
448
+ var v = class e {
449
449
  static get sessionKey() {
450
450
  return e._sessionKey;
451
451
  }
@@ -468,10 +468,10 @@ var y = class e {
468
468
  return !e._sessionKey;
469
469
  }
470
470
  };
471
- h(y, "_sessionKey", void 0), h(y, "_sessionSecretKey", void 0), h(y, "_accessToken", void 0);
471
+ h(v, "_sessionKey", void 0), h(v, "_sessionSecretKey", void 0), h(v, "_accessToken", void 0);
472
472
  //#endregion
473
473
  //#region src/classes/EventEmitter.ts
474
- var b = class {
474
+ var y = class {
475
475
  constructor() {
476
476
  h(this, "_handlers", {}), h(this, "_listeners", []);
477
477
  }
@@ -497,14 +497,14 @@ var b = class {
497
497
  e.dispose();
498
498
  });
499
499
  }
500
- }, x = /* @__PURE__ */ function(e) {
500
+ }, b = /* @__PURE__ */ function(e) {
501
501
  return e.MIC_CAMERA_PERMISSION = "mic_camera", e.CAMERA_PERMISSION = "camera", e.MIC_PERMISSION = "mic", e.CAMERA_ACCESS = "cameralock", e.MIC_ACCESS = "miclock", e.MIC_NOT_FOUND = "nomic", e.SCREEN_PERMISSION = "screenpermission", e.SCREEN_ACCESS = "screenlock", e.CONNECTION = "connection", e.NETWORK = "network", e.UNKNOWN = "unknown", e.UNSUPPORTED = "unsupported", e.SIGNALING_FAILED = "signalingfailed", e.API = "api", e.AUTH = "auth", e.OVERCONSTRAINED = "overconstrained", e;
502
- }(x || {}), S = /* @__PURE__ */ function(e) {
502
+ }(b || {}), x = /* @__PURE__ */ function(e) {
503
503
  return e.AUDIO = "AUDIO", e.VIDEO = "VIDEO", e.SCREEN_SHARING = "SCREEN_SHARING", e.MOVIE_SHARING = "MOVIE_SHARING", e.AUDIO_SHARING = "AUDIO_SHARING", e.ANIMOJI = "ANIMOJI", e;
504
- }(S || {}), C = /* @__PURE__ */ function(e) {
504
+ }(x || {}), S = /* @__PURE__ */ function(e) {
505
505
  return e.ACCEPT_CONCURRENT = "callAcceptConcurrent", e.ACCEPT_INCOMING = "callAcceptIncoming", e.ACCEPTED_OUTGOING = "callAcceptedOutgoing", e.ADD_PARTICIPANT = "callAddParticipant", e.CALL_SPEC_ERROR = "callSpecError", e.DECLINE_INCOMING = "callDeclineIncoming", e.DEVICE_CHANGED = "callDeviceChanged", e.DEVICES = "callDevices", e.ERROR = "callError", e.HANGUP = "callHangup", e.ICE_CONNECTION_STATE = "callIceConnectionState", e.ICE_CONNECTION_TYPE = "callIceConnectionType", e.ICE_RESTART = "callIceRestart", e.JOIN_CONVERSATION = "callJoinConversation", e.MEDIA_STATUS = "callMediaStatus", e.OUTGOING_CALL = "callStart", e.OUTGOING_MULTIPARTY_CALL = "callStartMultiparty", e.PAT_ALLOCATED = "patAllocate", e.PAT_DEALLOCATED = "patDeallocate", e.PAT_ERROR = "patError", e.PAT_OUTDATED_RESPONSE = "patOutdatedResponse", e.PAT_WAITING_TIME_ERROR = "patWaitingTimeError", e.POOR_CONNECTION = "callPoorConnection", e.PUSH = "callPush", e.RECONNECT = "callReconnect", e.RELAY_POLICY = "callForceRelay", e.REMOVE_PARTICIPANT = "callRemoveParticipant", e.SOCKET_ACTION = "callSocketAction", e.TOPOLOGY_CHANGE_REQUESTED = "callTopologyChangeRequested", e;
506
- }(C || {}), Je = (e) => e.stop(), Ye = (e) => e.getTracks().forEach(Je), Xe = (e) => e.getVideoTracks().forEach(Je);
507
- async function Ze(e, t) {
506
+ }(S || {}), Ye = (e) => e.stop(), Xe = (e) => e.getTracks().forEach(Ye), Ze = (e) => e.getVideoTracks().forEach(Ye);
507
+ async function Qe(e, t) {
508
508
  try {
509
509
  let n = typeof t.width == "number" ? t.width : void 0, r = typeof t.height == "number" ? t.height : void 0;
510
510
  await e.applyConstraints({
@@ -524,7 +524,7 @@ async function Ze(e, t) {
524
524
  }
525
525
  //#endregion
526
526
  //#region src/utils/NavigatorPermissions.ts
527
- var Qe = class {
527
+ var $e = class {
528
528
  constructor() {
529
529
  h(this, "_cameraPermissionStatus", void 0), h(this, "_microphonePermissionStatus", void 0), h(this, "_listener", void 0);
530
530
  }
@@ -565,7 +565,7 @@ var Qe = class {
565
565
  }
566
566
  return t;
567
567
  }
568
- }, $e = "_okcls_", et = (() => {
568
+ }, et = "_okcls_", tt = (() => {
569
569
  try {
570
570
  let e = Date.now().toString(), t = window.localStorage, n = !1;
571
571
  return t.setItem(e, e), n = t.getItem(e) === e, t.removeItem(e), n ? t : null;
@@ -573,8 +573,8 @@ var Qe = class {
573
573
  return null;
574
574
  }
575
575
  })();
576
- function tt(e) {
577
- let t = et ? et.getItem($e + e) : null;
576
+ function nt(e) {
577
+ let t = tt ? tt.getItem(et + e) : null;
578
578
  if (t === null) return null;
579
579
  try {
580
580
  return JSON.parse(t);
@@ -582,30 +582,30 @@ function tt(e) {
582
582
  return null;
583
583
  }
584
584
  }
585
- function nt(e, t) {
585
+ function rt(e, t) {
586
586
  try {
587
- et && et.setItem($e + e, JSON.stringify(t));
587
+ tt && tt.setItem(et + e, JSON.stringify(t));
588
588
  } catch {}
589
589
  }
590
- function rt(e) {
591
- et && et.removeItem($e + e);
590
+ function it(e) {
591
+ tt && tt.removeItem(et + e);
592
592
  }
593
- var it;
593
+ var at;
594
594
  (function(e) {
595
595
  function t(e) {
596
- return tt(e) || null;
596
+ return nt(e) || null;
597
597
  }
598
598
  e.get = t;
599
599
  function n(e, t) {
600
- nt(e, t);
600
+ rt(e, t);
601
601
  }
602
602
  e.set = n;
603
603
  function r(e) {
604
- rt(e);
604
+ it(e);
605
605
  }
606
606
  e.remove = r;
607
- })(it || (it = {}));
608
- var at = it, ot = null, st = null, ct = null, lt = [], ut = [], dt = [], ft = null, pt = null, mt = null, ht = !1, gt = !1, _t, vt, yt, bt = null, xt = null, St = "", Ct = null, wt = [], Tt = null, Et = navigator.appVersion, Dt = navigator.appName, Ot = navigator.userAgent, kt = {}, At = /* @__PURE__ */ function(e) {
607
+ })(at || (at = {}));
608
+ var ot = at, st = null, ct = null, lt = null, ut = [], dt = [], ft = [], pt = null, mt = null, ht = null, gt = !1, _t = !1, vt, yt, bt, xt = null, St = null, Ct = "", wt = null, Tt = [], Et = null, Dt = navigator.appVersion, Ot = navigator.appName, C = navigator.userAgent, kt = {}, At = /* @__PURE__ */ function(e) {
609
609
  return e.USER = "user", e.ENVIRONMENT = "environment", e;
610
610
  }({});
611
611
  (function(e) {
@@ -625,8 +625,8 @@ var jt = class {
625
625
  autoGainControl: !0
626
626
  };
627
627
  let t = w.getMicrophones(), n, r;
628
- if (pt && (r = pt.groupId, n = pt.deviceId), typeof e == "string") r = t.find((t) => t.deviceId === e)?.groupId, n = e;
629
- else if (!pt && w.os() === "MacOS" && t.find((e) => e.label.includes("iPhone"))) {
628
+ if (mt && (r = mt.groupId, n = mt.deviceId), typeof e == "string") r = t.find((t) => t.deviceId === e)?.groupId, n = e;
629
+ else if (!mt && w.os() === "MacOS" && t.find((e) => e.label.includes("iPhone"))) {
630
630
  let e = t.find((e) => !e.label.includes("Virtual") && !e.label.includes("iPhone"));
631
631
  e && (r = e.groupId, n = e.deviceId);
632
632
  }
@@ -649,8 +649,8 @@ var jt = class {
649
649
  frameRate: { ideal: i }
650
650
  };
651
651
  let e = w.getCameras(), a, s;
652
- if (ft && (s = ft.groupId, a = ft.deviceId), typeof t == "string") s = e.find((e) => e.deviceId === t)?.groupId, a = t;
653
- else if (!ft && w.os() === "MacOS" && e.find((e) => e.label.includes("iPhone"))) {
652
+ if (pt && (s = pt.groupId, a = pt.deviceId), typeof t == "string") s = e.find((e) => e.deviceId === t)?.groupId, a = t;
653
+ else if (!pt && w.os() === "MacOS" && e.find((e) => e.label.includes("iPhone"))) {
654
654
  let t = e.find((e) => !e.label.includes("Virtual") && !e.label.includes("iPhone"));
655
655
  t && (s = t.groupId, a = t.deviceId);
656
656
  }
@@ -701,7 +701,7 @@ var jt = class {
701
701
  h(this, "_lockId", Math.round(Math.random() * 99998) + 1);
702
702
  }
703
703
  busy(t = null) {
704
- if (e._lockId) throw t?.log(C.ERROR, "change_device"), R.warn("Device change failed: MediaSource is busy"), Error("MediaSource is busy");
704
+ if (e._lockId) throw t?.log(S.ERROR, "change_device"), R.warn("Device change failed: MediaSource is busy"), Error("MediaSource is busy");
705
705
  e._lockId = this._lockId;
706
706
  }
707
707
  free() {
@@ -710,7 +710,7 @@ var jt = class {
710
710
  };
711
711
  h(Nt, "_lockId", 0);
712
712
  async function Pt() {
713
- gt = !1, ht = !1, ot = null;
713
+ _t = !1, gt = !1, st = null;
714
714
  let e = {
715
715
  camera: w.getSavedCamera(),
716
716
  microphone: w.getSavedMicrophone(),
@@ -722,18 +722,18 @@ function Ft(e, ...t) {
722
722
  if (kt[e]) for (let n of kt[e]) n(...t);
723
723
  }
724
724
  async function It() {
725
- return ot || (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices ? [] : (!st && navigator.mediaDevices.addEventListener && (st = j.debounce(Pt, M.enumerateDevicesDelay), navigator.mediaDevices.addEventListener("devicechange", st)), !ct && Qe.isSupported() && (ct = new Qe(), await ct.init((e, t) => {
725
+ return st || (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices ? [] : (!ct && navigator.mediaDevices.addEventListener && (ct = j.debounce(Pt, M.enumerateDevicesDelay), navigator.mediaDevices.addEventListener("devicechange", ct)), !lt && $e.isSupported() && (lt = new $e(), await lt.init((e, t) => {
726
726
  switch (t) {
727
727
  case "denied":
728
728
  case "prompt":
729
- st?.();
729
+ ct?.();
730
730
  break;
731
731
  }
732
- })), ot = navigator.mediaDevices.enumerateDevices().then((e) => {
733
- lt = e.filter((e) => e.kind === "videoinput" ? (e.label && (ht = !0), !0) : !1), ut = e.filter((e) => e.kind === "audioinput" ? (e.label ? gt = !0 : w.isMobile() && w.browserName() === "Firefox" && (gt = ht), !0) : !1), dt = e.filter((e) => e.kind === "audiooutput");
734
- let t = ft?.deviceId ?? at.get("videoinput"), n = pt?.deviceId ?? at.get("audioinput"), r = mt?.deviceId ?? at.get("audiooutput");
735
- return ft = lt.find((e) => e.deviceId === t) || null, pt = ut.find((e) => e.deviceId === n) || null, mt = dt.find((e) => e.deviceId === r) || dt[0] || null, ot = Promise.resolve(e), e;
736
- }).catch(() => (ot = null, []))));
732
+ })), st = navigator.mediaDevices.enumerateDevices().then((e) => {
733
+ ut = e.filter((e) => e.kind === "videoinput" ? (e.label && (gt = !0), !0) : !1), dt = e.filter((e) => e.kind === "audioinput" ? (e.label ? _t = !0 : w.isMobile() && w.browserName() === "Firefox" && (_t = gt), !0) : !1), ft = e.filter((e) => e.kind === "audiooutput");
734
+ let t = pt?.deviceId ?? ot.get("videoinput"), n = mt?.deviceId ?? ot.get("audioinput"), r = ht?.deviceId ?? ot.get("audiooutput");
735
+ return pt = ut.find((e) => e.deviceId === t) || null, mt = dt.find((e) => e.deviceId === n) || null, ht = ft.find((e) => e.deviceId === r) || ft[0] || null, st = Promise.resolve(e), e;
736
+ }).catch(() => (st = null, []))));
737
737
  }
738
738
  async function Lt() {
739
739
  if ("userAgentData" in navigator) try {
@@ -743,19 +743,19 @@ async function Lt() {
743
743
  return;
744
744
  }
745
745
  let t = parseInt(e.split(".")[0]);
746
- Ct = isNaN(t) ? null : t;
746
+ wt = isNaN(t) ? null : t;
747
747
  } catch (e) {
748
748
  R.warn("Failed to get OS version", e);
749
749
  }
750
750
  }
751
751
  function Rt(e) {
752
- if (ft && pt) return;
752
+ if (pt && mt) return;
753
753
  let t = (e, t) => {
754
754
  let n = t.getSettings()?.deviceId;
755
755
  return e.find((e) => e.deviceId === n || e.label === t.label) || null;
756
756
  };
757
757
  e?.getTracks().forEach((e) => {
758
- !pt && e.kind === k.audio ? pt = t(w.getMicrophones(), e) : !ft && e.kind === k.video && (ft = t(w.getCameras(), e));
758
+ !mt && e.kind === k.audio ? mt = t(w.getMicrophones(), e) : !pt && e.kind === k.video && (pt = t(w.getCameras(), e));
759
759
  });
760
760
  }
761
761
  async function zt(e, t, n = R, r = null) {
@@ -775,31 +775,31 @@ async function zt(e, t, n = R, r = null) {
775
775
  case "SecurityError":
776
776
  case "DOMException":
777
777
  case "NotFoundError":
778
- t = e.isVideoRequested() ? x.CAMERA_PERMISSION : x.MIC_PERMISSION;
778
+ t = e.isVideoRequested() ? b.CAMERA_PERMISSION : b.MIC_PERMISSION;
779
779
  break;
780
780
  case "OverconstrainedError":
781
- t = x.OVERCONSTRAINED;
781
+ t = b.OVERCONSTRAINED;
782
782
  break;
783
783
  case "TypeError":
784
- t = x.UNKNOWN;
784
+ t = b.UNKNOWN;
785
785
  break;
786
786
  case "AbortError":
787
787
  case "NotReadableError":
788
- t = e.isVideoRequested() ? x.CAMERA_ACCESS : x.MIC_ACCESS;
788
+ t = e.isVideoRequested() ? b.CAMERA_ACCESS : b.MIC_ACCESS;
789
789
  break;
790
790
  case "Error": if (i.message === "MediaSource is busy") {
791
- t = e.isVideoRequested() ? x.CAMERA_ACCESS : x.MIC_ACCESS;
791
+ t = e.isVideoRequested() ? b.CAMERA_ACCESS : b.MIC_ACCESS;
792
792
  break;
793
793
  }
794
794
  }
795
795
  if (e.canSimplify()) return zt(e.simplify(), t, n, r);
796
- let o = t || x.UNKNOWN;
796
+ let o = t || b.UNKNOWN;
797
797
  throw L.onPermissionsError(o, i), o;
798
798
  }
799
799
  }
800
800
  async function Bt(e = R) {
801
- if (!(bt || w.browserName() !== "Firefox" || !navigator.mediaDevices?.getUserMedia)) try {
802
- w.hasMicrophonePermission() || L.onPermissionsRequested(), bt = await navigator.mediaDevices.getUserMedia({
801
+ if (!(xt || w.browserName() !== "Firefox" || !navigator.mediaDevices?.getUserMedia)) try {
802
+ w.hasMicrophonePermission() || L.onPermissionsRequested(), xt = await navigator.mediaDevices.getUserMedia({
803
803
  audio: !0,
804
804
  video: !1
805
805
  });
@@ -826,17 +826,17 @@ async function Vt(e, t = R, n = null) {
826
826
  switch (e.name) {
827
827
  case "PermissionDeniedError":
828
828
  case "NotAllowedError":
829
- case "SecurityError": throw x.SCREEN_PERMISSION;
830
- default: throw x.SCREEN_ACCESS;
829
+ case "SecurityError": throw b.SCREEN_PERMISSION;
830
+ default: throw b.SCREEN_ACCESS;
831
831
  }
832
832
  } finally {
833
833
  r.free();
834
834
  }
835
835
  }
836
836
  function Ht() {
837
- return wt.length || (wt = (() => {
838
- let e, t = !1, n = 0, r = "0", i = Ot.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
839
- if (/trident/i.test(i[1])) return e = /\brv[ :]+(\d+)/g.exec(Ot), [
837
+ return Tt.length || (Tt = (() => {
838
+ let e, t = !1, n = 0, r = "0", i = C.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
839
+ if (/trident/i.test(i[1])) return e = /\brv[ :]+(\d+)/g.exec(C), [
840
840
  "IE",
841
841
  e && e[1] || "Unknown",
842
842
  t,
@@ -844,35 +844,35 @@ function Ht() {
844
844
  r
845
845
  ];
846
846
  if (i[1] === "Safari") {
847
- if (e = Ot.match(/\bEdge\/(\d+)/), e) return [
847
+ if (e = C.match(/\bEdge\/(\d+)/), e) return [
848
848
  "Edge",
849
849
  e[1] || "Unknown",
850
850
  t,
851
851
  n,
852
852
  r
853
853
  ];
854
- if (e = Ot.match(/\bCriOS\/(\d+)/), e) return [
854
+ if (e = C.match(/\bCriOS\/(\d+)/), e) return [
855
855
  "Chrome",
856
856
  e[1],
857
857
  !0,
858
858
  Number(e[1]),
859
859
  r
860
860
  ];
861
- if (e = Ot.match(/\bFxiOS\/(\d+)/), e) return [
861
+ if (e = C.match(/\bFxiOS\/(\d+)/), e) return [
862
862
  "Firefox",
863
863
  e[1],
864
864
  !1,
865
865
  n,
866
866
  r
867
867
  ];
868
- if (e = Ot.match(/\bYaBrowser\/(\d+)/), e) return [
868
+ if (e = C.match(/\bYaBrowser\/(\d+)/), e) return [
869
869
  "Yandex",
870
870
  e[1],
871
871
  !1,
872
872
  n,
873
873
  r
874
874
  ];
875
- if (e = Ot.match(/\bOPT\/(\d+)/), e) return [
875
+ if (e = C.match(/\bOPT\/(\d+)/), e) return [
876
876
  "Opera",
877
877
  e[1],
878
878
  !1,
@@ -881,28 +881,28 @@ function Ht() {
881
881
  ];
882
882
  }
883
883
  if (i[1] === "Chrome") {
884
- if (t = !0, n = Number(i[2]), e = Ot.match(/\bOPR\/(\d+)/), e) return [
884
+ if (t = !0, n = Number(i[2]), e = C.match(/\bOPR\/(\d+)/), e) return [
885
885
  "Opera",
886
886
  e[1] || "Unknown",
887
887
  t,
888
888
  n,
889
889
  r
890
890
  ];
891
- if (e = Ot.match(/\bYaBrowser\/(\d+)/), e) return [
891
+ if (e = C.match(/\bYaBrowser\/(\d+)/), e) return [
892
892
  "Yandex",
893
893
  e[1] || "Unknown",
894
894
  t,
895
895
  n,
896
896
  r
897
897
  ];
898
- if (e = Ot.match(/\bSferum\/((\d+)(?:\.\d+)*)/), e) return [
898
+ if (e = C.match(/\bSferum\/((\d+)(?:\.\d+)*)/), e) return [
899
899
  "Sferum",
900
900
  e[1] || "Unknown",
901
901
  t,
902
902
  n,
903
903
  r
904
904
  ];
905
- if (e = Ot.match(/\bEdge?\/(\d+)/), e) return [
905
+ if (e = C.match(/\bEdge?\/(\d+)/), e) return [
906
906
  "Edge",
907
907
  e[1] || "Unknown",
908
908
  t,
@@ -917,14 +917,14 @@ function Ht() {
917
917
  r
918
918
  ];
919
919
  }
920
- return e = Ot.match(/version\/(\d+)(?:(?:\.)(\d+))?/i), e && e[2] !== void 0 && (r = e[2]), [
921
- i[2] ? i[1] : Dt,
922
- e && e[1] || i[2] || Et,
920
+ return e = C.match(/version\/(\d+)(?:(?:\.)(\d+))?/i), e && e[2] !== void 0 && (r = e[2]), [
921
+ i[2] ? i[1] : Ot,
922
+ e && e[1] || i[2] || Dt,
923
923
  t,
924
924
  n,
925
925
  r
926
926
  ];
927
- })()), wt;
927
+ })()), Tt;
928
928
  }
929
929
  var w;
930
930
  (function(e) {
@@ -933,35 +933,35 @@ var w;
933
933
  }
934
934
  e.init = t;
935
935
  function n() {
936
- return lt;
936
+ return ut;
937
937
  }
938
938
  e.getCameras = n;
939
939
  function r() {
940
- return ut;
940
+ return dt;
941
941
  }
942
942
  e.getMicrophones = r;
943
943
  function i() {
944
- return dt;
944
+ return ft;
945
945
  }
946
946
  e.getOutput = i;
947
947
  function a() {
948
- return lt.length > 0;
948
+ return ut.length > 0;
949
949
  }
950
950
  e.hasCamera = a;
951
951
  function o() {
952
- return ut.length > 0;
952
+ return dt.length > 0;
953
953
  }
954
954
  e.hasMicrophone = o;
955
955
  function s() {
956
- return ft;
956
+ return pt;
957
957
  }
958
958
  e.getSavedCamera = s;
959
959
  function c() {
960
- return pt;
960
+ return mt;
961
961
  }
962
962
  e.getSavedMicrophone = c;
963
963
  function l() {
964
- return mt;
964
+ return ht;
965
965
  }
966
966
  e.getSavedOutput = l;
967
967
  function u() {
@@ -969,15 +969,15 @@ var w;
969
969
  }
970
970
  e.getVideoFacingMode = u;
971
971
  function d() {
972
- return ht;
972
+ return gt;
973
973
  }
974
974
  e.hasCameraPermission = d;
975
975
  function f() {
976
- return gt;
976
+ return _t;
977
977
  }
978
978
  e.hasMicrophonePermission = f;
979
979
  function p() {
980
- return ct?.getPermissionState("microphone") ?? null;
980
+ return lt?.getPermissionState("microphone") ?? null;
981
981
  }
982
982
  e.getMicrophonePermissionState = p;
983
983
  function m(e = !1) {
@@ -985,7 +985,7 @@ var w;
985
985
  }
986
986
  e.hasPermissions = m;
987
987
  function ee() {
988
- bt && (Ye(bt), bt = null);
988
+ xt && (Xe(xt), xt = null);
989
989
  }
990
990
  e.releaseFirefoxMicrophonePermissionWarmup = ee;
991
991
  async function h(e = !1, t = !0, n = !0, r = R, i = null) {
@@ -1020,32 +1020,32 @@ var w;
1020
1020
  async function ae(e, t) {
1021
1021
  let [n] = e.getVideoTracks();
1022
1022
  if (!n) throw Error("Video track not found in stream");
1023
- return Ze(n, t);
1023
+ return Qe(n, t);
1024
1024
  }
1025
1025
  e.setResolution = ae;
1026
1026
  async function oe(e, t) {
1027
1027
  let n = (await It()).find((n) => n.kind === e && n.deviceId === t);
1028
- return n ? (e === "videoinput" ? ft = n : e === "audioinput" ? pt = n : e === "audiooutput" && (mt = n), at.set(e, t), n) : null;
1028
+ return n ? (e === "videoinput" ? pt = n : e === "audioinput" ? mt = n : e === "audiooutput" && (ht = n), ot.set(e, t), n) : null;
1029
1029
  }
1030
1030
  e._saveDeviceId = oe;
1031
1031
  function g() {
1032
- if (!yt || yt.readyState === "ended") {
1032
+ if (!bt || bt.readyState === "ended") {
1033
1033
  let e = w.getAudioContext(), t = e.createMediaStreamDestination(), n = e.createGain();
1034
1034
  n.gain.value = 1e-5, n.connect(t), n.connect(e.destination);
1035
1035
  let r = e.createOscillator();
1036
- r.type = "sine", r.frequency.value = 0, r.connect(n), r.start(), yt = t.stream.getAudioTracks()[0];
1036
+ r.type = "sine", r.frequency.value = 0, r.connect(n), r.start(), bt = t.stream.getAudioTracks()[0];
1037
1037
  }
1038
- return Object.assign(yt.clone(), { enabled: !1 });
1038
+ return Object.assign(bt.clone(), { enabled: !1 });
1039
1039
  }
1040
1040
  e.getSilentMediaTrack = g;
1041
- function _(e = M.videoMinWidth, t = M.videoMinHeight) {
1042
- vt || (vt = document.createElement("canvas")), vt.width = e, vt.height = t;
1043
- let n = vt.getContext("2d");
1044
- return n.rect(0, 0, e, t), n.fillStyle = "black", n.fill(), (!_t || _t.readyState === "ended") && (_t = vt.captureStream(M.videoFrameRate).getVideoTracks()[0]), Object.assign(_t.clone(), { enabled: !1 });
1045
- }
1046
- e.getBlackMediaTrack = _;
1047
- function se() {
1048
- if (_e() === "Edge" && Number(ve()) < 70) return !1;
1041
+ function se(e = M.videoMinWidth, t = M.videoMinHeight) {
1042
+ yt || (yt = document.createElement("canvas")), yt.width = e, yt.height = t;
1043
+ let n = yt.getContext("2d");
1044
+ return n.rect(0, 0, e, t), n.fillStyle = "black", n.fill(), (!vt || vt.readyState === "ended") && (vt = yt.captureStream(M.videoFrameRate).getVideoTracks()[0]), Object.assign(vt.clone(), { enabled: !1 });
1045
+ }
1046
+ e.getBlackMediaTrack = se;
1047
+ function ce() {
1048
+ if (ve() === "Edge" && Number(ye()) < 70) return !1;
1049
1049
  try {
1050
1050
  let e = window;
1051
1051
  return "mediaDevices" in e.navigator && "getUserMedia" in e.navigator.mediaDevices && e.RTCPeerConnection && e.RTCIceCandidate && e.RTCSessionDescription && e.HTMLCanvasElement && e.HTMLCanvasElement.prototype.captureStream && e.RTCRtpSender && e.RTCRtpSender.prototype.replaceTrack && e.RTCRtpSender.prototype.getParameters && "sendBeacon" in navigator && !0 || !1;
@@ -1053,21 +1053,21 @@ var w;
1053
1053
  return !1;
1054
1054
  }
1055
1055
  }
1056
- e.isBrowserSupported = se;
1057
- function ce() {
1056
+ e.isBrowserSupported = ce;
1057
+ function le() {
1058
1058
  return !!navigator.mediaDevices.getDisplayMedia;
1059
1059
  }
1060
- e.isScreenCapturingSupported = ce;
1061
- function le() {
1060
+ e.isScreenCapturingSupported = le;
1061
+ function ue() {
1062
1062
  let e = w.browserName() === "Safari" && w.browserVersion() === "15" && w.browserSubVersion() === "1", t = w.browserName() === "Opera", n = w.browserName() === "Yandex";
1063
1063
  return e || t || n;
1064
1064
  }
1065
- e.isBrokenH264Decoder = le;
1066
- function ue() {
1065
+ e.isBrokenH264Decoder = ue;
1066
+ function de() {
1067
1067
  return w.browserName() === "Yandex" && w.os() === "Windows" || M.simulcast;
1068
1068
  }
1069
- e.isBrokenVP9Encoder = ue;
1070
- function de() {
1069
+ e.isBrokenVP9Encoder = de;
1070
+ function fe() {
1071
1071
  let e = w.browserName() === "Safari" && Number(w.browserVersion()) === 17 && [
1072
1072
  4,
1073
1073
  5,
@@ -1075,21 +1075,21 @@ var w;
1075
1075
  ].includes(Number(w.browserSubVersion())), t = w.os() === "Windows" && w.osVersion() === 10;
1076
1076
  return e || t;
1077
1077
  }
1078
- e.isBrokenVP9Decoder = de;
1079
- function fe() {
1078
+ e.isBrokenVP9Decoder = fe;
1079
+ function pe() {
1080
1080
  return w.browserName() === "Firefox" && Number(w.browserVersion()) < 60;
1081
1081
  }
1082
- e.isOldDataChannelDescription = fe;
1083
- function pe() {
1082
+ e.isOldDataChannelDescription = pe;
1083
+ function me() {
1084
1084
  return !(w.baseChromeVersion() && w.isMobile());
1085
1085
  }
1086
- e.canPreferH264 = pe;
1087
- function me() {
1086
+ e.canPreferH264 = me;
1087
+ function he() {
1088
1088
  return !(w.browserName() === "Firefox" || w.browserName() === "Safari");
1089
1089
  }
1090
- e.isSimulcastSupportedByBrowser = me;
1091
- function he() {
1092
- return St || (St = (() => {
1090
+ e.isSimulcastSupportedByBrowser = he;
1091
+ function ge() {
1092
+ return Ct || (Ct = (() => {
1093
1093
  let e = {
1094
1094
  Windows: /Win/,
1095
1095
  Android: /Android/,
@@ -1106,57 +1106,57 @@ var w;
1106
1106
  OS2: /OS\/2/,
1107
1107
  Bot: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/
1108
1108
  };
1109
- for (let t in e) if (Object.hasOwn(e, t) && e[t].test(Ot)) return t;
1109
+ for (let t in e) if (Object.hasOwn(e, t) && e[t].test(C)) return t;
1110
1110
  return "Unknown";
1111
- })()), St;
1111
+ })()), Ct;
1112
1112
  }
1113
- e.os = he;
1114
- function ge() {
1115
- return Ct;
1113
+ e.os = ge;
1114
+ function _e() {
1115
+ return wt;
1116
1116
  }
1117
- e.osVersion = ge;
1118
- function v() {
1119
- return xt === null && (xt = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(Et)), xt;
1117
+ e.osVersion = _e;
1118
+ function _() {
1119
+ return St === null && (St = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(Dt)), St;
1120
1120
  }
1121
- e.isMobile = v;
1122
- function _e() {
1121
+ e.isMobile = _;
1122
+ function ve() {
1123
1123
  return Ht()[0];
1124
1124
  }
1125
- e.browserName = _e;
1126
- function ve() {
1125
+ e.browserName = ve;
1126
+ function ye() {
1127
1127
  return Ht()[1];
1128
1128
  }
1129
- e.browserVersion = ve;
1130
- function ye() {
1129
+ e.browserVersion = ye;
1130
+ function be() {
1131
1131
  return Ht()[3];
1132
1132
  }
1133
- e.baseChromeVersion = ye;
1134
- function be() {
1135
- return Tt || (Tt = new (window.AudioContext || window.webkitAudioContext)()), Tt.resume().catch(() => {
1133
+ e.baseChromeVersion = be;
1134
+ function xe() {
1135
+ return Et || (Et = new (window.AudioContext || window.webkitAudioContext)()), Et.resume().catch(() => {
1136
1136
  R.warn("Failed to resume AudioContext");
1137
- }), Tt;
1137
+ }), Et;
1138
1138
  }
1139
- e.getAudioContext = be;
1140
- function xe() {
1139
+ e.getAudioContext = xe;
1140
+ function Se() {
1141
1141
  return Ht()[4];
1142
1142
  }
1143
- e.browserSubVersion = xe;
1144
- function Se() {
1143
+ e.browserSubVersion = Se;
1144
+ function Ce() {
1145
1145
  return w.baseChromeVersion() >= 105 && !w.isMobile();
1146
1146
  }
1147
- e.isAudioShareSupported = Se;
1148
- function Ce(e, t) {
1147
+ e.isAudioShareSupported = Ce;
1148
+ function we(e, t) {
1149
1149
  kt[e] || (kt[e] = []), kt[e].push(t);
1150
1150
  }
1151
- e.addEventListener = Ce;
1152
- function we(e, t) {
1151
+ e.addEventListener = we;
1152
+ function Te(e, t) {
1153
1153
  if (kt[e]) if (!t) delete kt[e];
1154
1154
  else {
1155
1155
  let n = kt[e].indexOf(t);
1156
1156
  n > -1 && kt[e].splice(n, 1);
1157
1157
  }
1158
1158
  }
1159
- e.removeEventListener = we;
1159
+ e.removeEventListener = Te;
1160
1160
  })(w || (w = {}));
1161
1161
  var T = w;
1162
1162
  //#endregion
@@ -1186,7 +1186,7 @@ var D = /* @__PURE__ */ function(e) {
1186
1186
  }
1187
1187
  }, Wt = /* @__PURE__ */ function(e) {
1188
1188
  return e.FpsLimit = "fps-limit", e;
1189
- }({}), Gt = class extends b {
1189
+ }({}), Gt = class extends y {
1190
1190
  constructor(e = R) {
1191
1191
  super(), h(this, "FPS_LIMITS", [
1192
1192
  13,
@@ -1232,7 +1232,7 @@ var D = /* @__PURE__ */ function(e) {
1232
1232
  return e.audio = "audio", e.video = "video", e.screen = "screen", e.audioshare = "audioshare", e;
1233
1233
  }({}), qt = /* @__PURE__ */ function(e) {
1234
1234
  return e[e.CAMERA = 1] = "CAMERA", e[e.SCREEN = 2] = "SCREEN", e;
1235
- }({}), Jt = class extends b {
1235
+ }({}), Jt = class extends y {
1236
1236
  constructor(e = R, t = null) {
1237
1237
  super(), h(this, "_stream", null), h(this, "_screenTrack", null), h(this, "_audioShareTrack", null), h(this, "_screenShareTrack", null), h(this, "_sendVideoTrack", null), h(this, "_cameraVideoTrack", null), h(this, "_micAudioTrack", null), h(this, "_audioEffectsTrack", null), h(this, "_mediaSettings", E()), h(this, "_lastMediaSettings", null), h(this, "_videoStatusOnScreenCapturingEnabled", !1), h(this, "_effect", null), h(this, "_audioEffectParams", null), h(this, "_onDeviceChange", void 0), h(this, "_animojiEnabled", !1), h(this, "_videoEffectsFpsLimiter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "videoTrackMuteHandler", () => {
1238
1238
  this._mediaSettings.isVideoEnabled && this.toggleVideo(!0);
@@ -1244,10 +1244,10 @@ var D = /* @__PURE__ */ function(e) {
1244
1244
  set cameraVideoTrack(e) {
1245
1245
  this._cameraVideoTrack && this._cameraVideoTrack.removeEventListener("mute", this.videoTrackMuteHandler), this._cameraVideoTrack = e, this._cameraVideoTrack && this._cameraVideoTrack.addEventListener("mute", this.videoTrackMuteHandler), M.consumerFastScreenShare && (this._screenShareTrack = this.getBlackScreenShareTrack());
1246
1246
  }
1247
- async request(e = [S.AUDIO], t = !0) {
1247
+ async request(e = [x.AUDIO], t = !0) {
1248
1248
  if (this._stream) return;
1249
- let n = e.includes(S.VIDEO), r = e.includes(S.AUDIO), i = e.includes(S.ANIMOJI);
1250
- if (!T.isBrowserSupported()) throw new O(x.UNSUPPORTED);
1249
+ let n = e.includes(x.VIDEO), r = e.includes(x.AUDIO), i = e.includes(x.ANIMOJI);
1250
+ if (!T.isBrowserSupported()) throw new O(b.UNSUPPORTED);
1251
1251
  try {
1252
1252
  this._stream = await T.getUserMedia(n, r, t, this._debug, this._logger), this.cameraVideoTrack?.stop(), this.cameraVideoTrack = this._stream.getVideoTracks()[0], this._micAudioTrack?.stop(), this._micAudioTrack = this._stream.getAudioTracks()[0], this._audioEffectsTrack?.stop(), this._mediaSettings.isVideoEnabled = n && this._stream.getVideoTracks().filter((e) => e.enabled).length > 0 || !1, this._mediaSettings.isAudioEnabled = r && this._stream.getAudioTracks().filter((e) => e.enabled).length > 0 || !1, this._mediaSettings.isAnimojiEnabled = i && !this._mediaSettings.isVideoEnabled || !1, this._animojiEnabled = i, this._triggerEvent("SOURCE_READY");
1253
1253
  } catch (e) {
@@ -1288,11 +1288,11 @@ var D = /* @__PURE__ */ function(e) {
1288
1288
  case "audioinput":
1289
1289
  if (this._mediaSettings.isAudioEnabled) return this._changeAudioInput();
1290
1290
  break;
1291
- default: return Promise.reject(x.UNKNOWN);
1291
+ default: return Promise.reject(b.UNKNOWN);
1292
1292
  }
1293
1293
  }
1294
1294
  stopVideoTrack() {
1295
- this._mediaSettings.isVideoEnabled && (this._stopEffect(), this._stream && Xe(this._stream), this.cameraVideoTrack?.stop());
1295
+ this._mediaSettings.isVideoEnabled && (this._stopEffect(), this._stream && Ze(this._stream), this.cameraVideoTrack?.stop());
1296
1296
  }
1297
1297
  async setVideoStream(e, t) {
1298
1298
  return t ? this._changeScreen(!1, !1, e) : this._changeVideoInput(e);
@@ -1312,13 +1312,13 @@ var D = /* @__PURE__ */ function(e) {
1312
1312
  async _changeVideoInput(e) {
1313
1313
  try {
1314
1314
  let t = e ? "stream" : "video", n = e || await T._getUserVideo(!!this._effect, this._frameRate, this._debug, this._logger);
1315
- if (this.cameraVideoTrack?.stop(), this.cameraVideoTrack = n.getVideoTracks()[0], !this._stream) Ye(n);
1315
+ if (this.cameraVideoTrack?.stop(), this.cameraVideoTrack = n.getVideoTracks()[0], !this._stream) Xe(n);
1316
1316
  else {
1317
1317
  let e = await this._setEffect(this._effect, this.cameraVideoTrack);
1318
- this._logger?.log(C.DEVICE_CHANGED, t), this._debug.log("Video stream changed"), await this._replaceLocalTrack(e), this._mediaSettings.isVideoEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "video" });
1318
+ this._logger?.log(S.DEVICE_CHANGED, t), this._debug.log("Video stream changed"), await this._replaceLocalTrack(e), this._mediaSettings.isVideoEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "video" });
1319
1319
  }
1320
1320
  } catch (e) {
1321
- throw this._logger?.log(C.ERROR, "change_video"), this._debug.warn("Camera change failed", e), e;
1321
+ throw this._logger?.log(S.ERROR, "change_video"), this._debug.warn("Camera change failed", e), e;
1322
1322
  }
1323
1323
  }
1324
1324
  async setAudioStream(e) {
@@ -1327,30 +1327,30 @@ var D = /* @__PURE__ */ function(e) {
1327
1327
  async _changeAudioInput(e = null) {
1328
1328
  try {
1329
1329
  let t = e || await T.getUserAudio(void 0, this._debug, this._logger);
1330
- if (this._micAudioTrack?.stop(), this._micAudioTrack = t.getAudioTracks()[0], !this._stream) Ye(t);
1330
+ if (this._micAudioTrack?.stop(), this._micAudioTrack = t.getAudioTracks()[0], !this._stream) Xe(t);
1331
1331
  else {
1332
1332
  let e = await this._applyAudioEffect();
1333
- this._logger?.log(C.DEVICE_CHANGED, "audio"), this._debug.log("Audio stream changed", e), await this._replaceLocalTrack(e), this._mediaSettings.isAudioEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "audio" });
1333
+ this._logger?.log(S.DEVICE_CHANGED, "audio"), this._debug.log("Audio stream changed", e), await this._replaceLocalTrack(e), this._mediaSettings.isAudioEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "audio" });
1334
1334
  }
1335
1335
  } catch (e) {
1336
- throw this._logger?.log(C.ERROR, "change_audio"), this._debug.error("Microphone change failed", e), e;
1336
+ throw this._logger?.log(S.ERROR, "change_audio"), this._debug.error("Microphone change failed", e), e;
1337
1337
  }
1338
1338
  }
1339
1339
  async _changeScreen(e, t, n) {
1340
1340
  try {
1341
- if (n = n || await T.getScreenMedia(e, t, this._debug, this._logger), !this._stream) Ye(n);
1341
+ if (n = n || await T.getScreenMedia(e, t, this._debug, this._logger), !this._stream) Xe(n);
1342
1342
  else {
1343
1343
  let r = n.getVideoTracks()[0];
1344
1344
  if (r.addEventListener("ended", () => {
1345
1345
  this._mediaSettings.isScreenSharingEnabled && this.disableScreenCapturing();
1346
- }, !1), this._logger?.log(C.DEVICE_CHANGED, "screen"), this._debug.log("Screen capturing started"), this._screenTrack = r, this._mediaSettings.isScreenSharingEnabled = !0, this._mediaSettings.isFastScreenSharingEnabled = e, M.consumerFastScreenShare && this._mediaSettings.isFastScreenSharingEnabled && (r.contentHint = "motion", this._screenShareTrack = r), n.getAudioTracks().length > 0) {
1346
+ }, !1), this._logger?.log(S.DEVICE_CHANGED, "screen"), this._debug.log("Screen capturing started"), this._screenTrack = r, this._mediaSettings.isScreenSharingEnabled = !0, this._mediaSettings.isFastScreenSharingEnabled = e, M.consumerFastScreenShare && this._mediaSettings.isFastScreenSharingEnabled && (r.contentHint = "motion", this._screenShareTrack = r), n.getAudioTracks().length > 0) {
1347
1347
  let e = n.getAudioTracks()[0];
1348
1348
  e.contentHint = "music", this._audioShareTrack = e, await this._replaceLocalTrack(e), this._mediaSettings.isAudioSharingEnabled = !0;
1349
1349
  }
1350
1350
  t && !this._mediaSettings.isAudioSharingEnabled && this._debug.debug("Audio share requested but not captured"), this._triggerEvent("SCREEN_STATUS", { track: r }), this._triggerEvent("SOURCE_CHANGED", { kind: "screen" });
1351
1351
  }
1352
1352
  } catch (e) {
1353
- throw this._logger?.log(C.ERROR, "screen"), this._debug.warn("Screen capturing failed", e), e;
1353
+ throw this._logger?.log(S.ERROR, "screen"), this._debug.warn("Screen capturing failed", e), e;
1354
1354
  }
1355
1355
  }
1356
1356
  async _disableScreenCapture() {
@@ -1398,7 +1398,7 @@ var D = /* @__PURE__ */ function(e) {
1398
1398
  }
1399
1399
  }
1400
1400
  destroy() {
1401
- this._destroyDeviceChangeListener(), T.releaseFirefoxMicrophonePermissionWarmup(), M.videoEffects && (this._effect = null, M.videoEffects.destroy()), M.audioEffects && M.audioEffects.destroy(), this._stream && (Ye(this._stream), this._stream = null), this.cameraVideoTrack?.stop(), this._micAudioTrack?.stop(), this._audioEffectsTrack?.stop(), this._disableScreenCapture(), T.getAudioContext()?.suspend().catch((e) => this._debug.error(e)), this._videoEffectsFpsLimiter?.destroy();
1401
+ this._destroyDeviceChangeListener(), T.releaseFirefoxMicrophonePermissionWarmup(), M.videoEffects && (this._effect = null, M.videoEffects.destroy()), M.audioEffects && M.audioEffects.destroy(), this._stream && (Xe(this._stream), this._stream = null), this.cameraVideoTrack?.stop(), this._micAudioTrack?.stop(), this._audioEffectsTrack?.stop(), this._disableScreenCapture(), T.getAudioContext()?.suspend().catch((e) => this._debug.error(e)), this._videoEffectsFpsLimiter?.destroy();
1402
1402
  }
1403
1403
  async stopLocalMedia() {
1404
1404
  this._mediaSettings.isScreenSharingEnabled && await this.disableScreenCapturing(), this._stream && (this._lastMediaSettings = { ...this._mediaSettings }, this._stream.getAudioTracks().length > 0 && await this.toggleAudio(!1), this._stream.getVideoTracks().length > 0 && await this.toggleVideo(!1), this.cameraVideoTrack = null, this._micAudioTrack = null);
@@ -1406,7 +1406,7 @@ var D = /* @__PURE__ */ function(e) {
1406
1406
  async resumeLocalMedia(e) {
1407
1407
  if (!this._lastMediaSettings) return;
1408
1408
  let t = [];
1409
- if ((e ? e.isAudioEnabled : this._lastMediaSettings.isAudioEnabled) && (t.push(S.AUDIO), await this.toggleAudio(!0)), await this.request(t), this._lastMediaSettings = null, this._stream) for (let e of this._stream.getTracks()) this._triggerEvent("TRACK_REPLACED", e);
1409
+ if ((e ? e.isAudioEnabled : this._lastMediaSettings.isAudioEnabled) && (t.push(x.AUDIO), await this.toggleAudio(!0)), await this.request(t), this._lastMediaSettings = null, this._stream) for (let e of this._stream.getTracks()) this._triggerEvent("TRACK_REPLACED", e);
1410
1410
  }
1411
1411
  async toggleScreenCapturing(e) {
1412
1412
  if (e.captureScreen) {
@@ -1474,7 +1474,7 @@ var D = /* @__PURE__ */ function(e) {
1474
1474
  }
1475
1475
  async videoEffect(e) {
1476
1476
  if (!M.videoEffects) throw Error("Video Effects library is not set");
1477
- if (this._logger?.log(C.DEVICE_CHANGED, `effect_${e?.effect || "none"}`), !this._mediaSettings.isVideoEnabled) {
1477
+ if (this._logger?.log(S.DEVICE_CHANGED, `effect_${e?.effect || "none"}`), !this._mediaSettings.isVideoEnabled) {
1478
1478
  this._effect = e;
1479
1479
  return;
1480
1480
  }
@@ -1523,7 +1523,7 @@ var D = /* @__PURE__ */ function(e) {
1523
1523
  return this._effect ? Math.min(e, M.videoFrameRate) : void 0;
1524
1524
  }
1525
1525
  async _applyVideoConstraints(e, t) {
1526
- await Ze(e, {
1526
+ await Qe(e, {
1527
1527
  width: this._effect ? M.videoEffectMaxWidth : M.videoMaxWidth,
1528
1528
  height: this._effect ? M.videoEffectMaxHeight : M.videoMaxHeight,
1529
1529
  ...this._frameRate && { frameRate: { ideal: this._frameRate } },
@@ -1799,19 +1799,19 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1799
1799
  return ae(e.id, e.idType || A.USER, e.deviceIdx);
1800
1800
  }
1801
1801
  e.composeId = g;
1802
- function _(e) {
1803
- if (e.decorativeUserId) return ae(e.decorativeUserId, e.idType || A.USER, e.deviceIdx);
1804
- }
1805
- e.composeDecorativeId = _;
1806
1802
  function se(e) {
1807
- return e.participant ? g(e.participant) : ae(e.participantId, e.participantType || A.USER, e.deviceIdx);
1803
+ if (e.decorativeUserId) return ae(e.decorativeUserId, e.idType || A.USER, e.deviceIdx);
1808
1804
  }
1809
- e.composeMessageId = se;
1805
+ e.composeDecorativeId = se;
1810
1806
  function ce(e) {
1811
- return typeof e == "string" ? le(ue(e).compositeUserId).id : e;
1807
+ return e.participant ? g(e.participant) : ae(e.participantId, e.participantType || A.USER, e.deviceIdx);
1812
1808
  }
1813
- e.extractOkId = ce;
1809
+ e.composeMessageId = ce;
1814
1810
  function le(e) {
1811
+ return typeof e == "string" ? ue(de(e).compositeUserId).id : e;
1812
+ }
1813
+ e.extractOkId = le;
1814
+ function ue(e) {
1815
1815
  let t = String(e), n = t.match(re);
1816
1816
  return n ? {
1817
1817
  id: Number(n[2]),
@@ -1821,24 +1821,24 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1821
1821
  type: A.USER
1822
1822
  });
1823
1823
  }
1824
- e.decomposeId = le;
1825
- function ue(e) {
1824
+ e.decomposeId = ue;
1825
+ function de(e) {
1826
1826
  let t = e.split(":d");
1827
1827
  return {
1828
1828
  compositeUserId: t[0],
1829
1829
  deviceIdx: t.length > 1 ? parseInt(t[1], 10) : 0
1830
1830
  };
1831
1831
  }
1832
- e.decomposeParticipantId = ue;
1833
- function de() {
1832
+ e.decomposeParticipantId = de;
1833
+ function fe() {
1834
1834
  let e = window.crypto?.randomUUID?.();
1835
1835
  if (e) return e;
1836
1836
  let t = "0123456789abcdefghijklmnopqrstuvwxyz".split(""), n = Array(36), r = 0, i, a;
1837
1837
  for (a = 0; a < 36; a++) a === 8 || a === 13 || a === 18 || a === 23 ? n[a] = "-" : a === 14 ? n[a] = "4" : (r <= 2 && (r = 33554432 + Math.random() * 16777216 | 0), i = r & 15, r >>= 4, n[a] = t[a === 19 ? i & 3 | 8 : i]);
1838
1838
  return n.join("");
1839
1839
  }
1840
- e.uuid = de;
1841
- function fe(e, t) {
1840
+ e.uuid = fe;
1841
+ function pe(e, t) {
1842
1842
  let n;
1843
1843
  function r(...r) {
1844
1844
  let i = this;
@@ -1848,8 +1848,8 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1848
1848
  }
1849
1849
  return r;
1850
1850
  }
1851
- e.debounce = fe;
1852
- function pe(e) {
1851
+ e.debounce = pe;
1852
+ function me(e) {
1853
1853
  if (!window.BigInt) return null;
1854
1854
  let t = "", n = e.split("\n");
1855
1855
  for (let e of n) if (e.startsWith("a=fingerprint")) {
@@ -1867,8 +1867,8 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1867
1867
  }
1868
1868
  return BigInt.asIntN(64, i);
1869
1869
  }
1870
- e.sdpFingerprint = pe;
1871
- async function me(e, { signal: t } = {}) {
1870
+ e.sdpFingerprint = me;
1871
+ async function he(e, { signal: t } = {}) {
1872
1872
  return new Promise((n, r) => {
1873
1873
  if (t?.aborted) return r(t.reason);
1874
1874
  let i = setTimeout(() => {
@@ -1879,13 +1879,13 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1879
1879
  t?.addEventListener("abort", a, { once: !0 });
1880
1880
  });
1881
1881
  }
1882
- e.delay = me;
1883
- function he(e, t, n, r = R) {
1882
+ e.delay = he;
1883
+ function ge(e, t, n, r = R) {
1884
1884
  let i = [];
1885
- return e.getSenders().forEach((e) => ge(t, e, e.track, n, i, r)), i;
1885
+ return e.getSenders().forEach((e) => _e(t, e, e.track, n, i, r)), i;
1886
1886
  }
1887
- e.applySettings = he;
1888
- function ge(e, t, n, r, i, a = R) {
1887
+ e.applySettings = ge;
1888
+ function _e(e, t, n, r, i, a = R) {
1889
1889
  if (!RTCRtpSender.prototype.getParameters || !RTCRtpSender.prototype.setParameters || !e || !n || n.kind !== k.video) return;
1890
1890
  let o = n.getSettings();
1891
1891
  if (!o) return;
@@ -1924,21 +1924,21 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1924
1924
  a.log(`applyVideoTrackSettings: actual encodings= ${JSON.stringify(e.encodings)}`);
1925
1925
  }
1926
1926
  }
1927
- e.applyVideoTrackSettings = ge;
1928
- function v(e, t) {
1927
+ e.applyVideoTrackSettings = _e;
1928
+ function _(e, t) {
1929
1929
  Array.isArray(t) || (t = [t]);
1930
1930
  for (let n of t) if (e.includes(n)) return !0;
1931
1931
  return !1;
1932
1932
  }
1933
- e.includesOneOf = v;
1934
- function _e(e) {
1933
+ e.includesOneOf = _;
1934
+ function ve(e) {
1935
1935
  return Object.entries(e.participantState?.state || {}).reduce((t, [n, r]) => (e.participantState && (t[n] = {
1936
1936
  ts: e.participantState.stateUpdateTs[n],
1937
1937
  state: r
1938
1938
  }), t), {});
1939
1939
  }
1940
- e.mapParticipantState = _e;
1941
- function ve(e) {
1940
+ e.mapParticipantState = ve;
1941
+ function ye(e) {
1942
1942
  let t = e.map((e) => ({
1943
1943
  uid: e.externalId,
1944
1944
  mediaSettings: e.mediaSettings,
@@ -1952,37 +1952,37 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1952
1952
  }));
1953
1953
  return M.filterObservers ? t.filter((e) => !e.uid.observer) : t;
1954
1954
  }
1955
- e.mapSharedParticipants = ve;
1956
- function ye(e, t) {
1955
+ e.mapSharedParticipants = ye;
1956
+ function be(e, t) {
1957
1957
  let n = Object.keys(e), r = Object.keys(t);
1958
1958
  if (n.length !== r.length) return !1;
1959
1959
  for (let i of n) if (!Object.hasOwn(r, i) || e[i].state !== t[i].state || e[i].ts !== t[i].ts) return !1;
1960
1960
  return !0;
1961
1961
  }
1962
- e.isEqualParticipantState = ye;
1963
- function be(e, t, n = !1) {
1962
+ e.isEqualParticipantState = be;
1963
+ function xe(e, t, n = !1) {
1964
1964
  let r = Object.keys(e), i = Object.keys(t);
1965
1965
  if (r.length !== i.length) return !1;
1966
1966
  for (let i of r) {
1967
1967
  if (!Object.hasOwn(t, i)) return !1;
1968
1968
  let r = e[i], a = t[i];
1969
- if (n && Ee(r) && Ee(a)) return be(r, a, n);
1969
+ if (n && De(r) && De(a)) return xe(r, a, n);
1970
1970
  if (r !== a) return !1;
1971
1971
  }
1972
1972
  return !0;
1973
1973
  }
1974
- e.isObjectsEquals = be;
1975
- function xe(e, t) {
1974
+ e.isObjectsEquals = xe;
1975
+ function Se(e, t) {
1976
1976
  if (e.length !== t.length) return !1;
1977
1977
  for (let n of e) if (t.indexOf(n) < 0) return !1;
1978
1978
  return !0;
1979
1979
  }
1980
- e.isArraysEquals = xe;
1981
- function Se(e) {
1980
+ e.isArraysEquals = Se;
1981
+ function Ce(e) {
1982
1982
  return !Object.keys(e).length;
1983
1983
  }
1984
- e.isEmptyObject = Se;
1985
- function Ce(e, t) {
1984
+ e.isEmptyObject = Ce;
1985
+ function we(e, t) {
1986
1986
  if (!e && !t) return 0;
1987
1987
  if (!e || !t) return e ? -1 : 1;
1988
1988
  return r(t.rank, e.rank) || r(e.ts, t.ts) || n(e, t);
@@ -1990,24 +1990,24 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1990
1990
  let n = {
1991
1991
  [A.USER]: 0,
1992
1992
  [A.GROUP]: 1
1993
- }, { compositeUserId: i, deviceIdx: a } = ue(e.id), { compositeUserId: o, deviceIdx: s } = ue(t.id), { id: c, type: l } = le(i), { id: u, type: d } = le(o);
1993
+ }, { compositeUserId: i, deviceIdx: a } = de(e.id), { compositeUserId: o, deviceIdx: s } = de(t.id), { id: c, type: l } = ue(i), { id: u, type: d } = ue(o);
1994
1994
  return r(n[l], n[d]) || r(c, u) || r(a, s);
1995
1995
  }
1996
1996
  function r(e, t) {
1997
1997
  return e < t ? -1 : e === t ? 0 : 1;
1998
1998
  }
1999
1999
  }
2000
- e.participantMarkerCompare = Ce;
2001
- function we(e, t) {
2000
+ e.participantMarkerCompare = we;
2001
+ function Te(e, t) {
2002
2002
  return rn(Object.entries(e).filter(([, e]) => Array.isArray(t) ? !t.includes(e) : e !== t));
2003
2003
  }
2004
- e.objectFilterOutValues = we;
2005
- function Te(e, t, n) {
2004
+ e.objectFilterOutValues = Te;
2005
+ function Ee(e, t, n) {
2006
2006
  let r = n;
2007
2007
  for (let n in e) Object.hasOwn(e, n) && (r = t(r, e[n], n));
2008
2008
  return r;
2009
2009
  }
2010
- e.objectReduce = Te, e.setImmediate = (() => {
2010
+ e.objectReduce = Ee, e.setImmediate = (() => {
2011
2011
  let e = 1, t = {}, n = null;
2012
2012
  return typeof MessageChannel < "u" && (n = new MessageChannel(), n.port1.onmessage = (e) => {
2013
2013
  let n = e.data;
@@ -2023,11 +2023,11 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
2023
2023
  return () => clearTimeout(i);
2024
2024
  };
2025
2025
  })();
2026
- function Ee(e) {
2026
+ function De(e) {
2027
2027
  return typeof e == "object" && !!e && !Array.isArray(e);
2028
2028
  }
2029
- e.isObject = Ee;
2030
- function De(e, n, r, i) {
2029
+ e.isObject = De;
2030
+ function Oe(e, n, r, i) {
2031
2031
  function a(e, t) {
2032
2032
  let n = 0, r = e.length, i = !1;
2033
2033
  for (let a = 0; a < e.length; a++) if (!i && e[a].startsWith("m=video") && (n = a), e[a].startsWith("a=mid:" + t) && (i = !0), i && e[a].startsWith("m=")) {
@@ -2053,7 +2053,7 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
2053
2053
  }
2054
2054
  return e;
2055
2055
  }
2056
- e.patchSimulcastAnswerSdp = De;
2056
+ e.patchSimulcastAnswerSdp = Oe;
2057
2057
  })(ln || (ln = {}));
2058
2058
  var j = ln, un = "__CALLS_SDK_DEVTOOLS_", dn = class {
2059
2059
  set(e, t) {
@@ -2142,7 +2142,7 @@ var j = ln, un = "__CALLS_SDK_DEVTOOLS_", dn = class {
2142
2142
  h(pn, "instance", null);
2143
2143
  var mn = pn.getInstance(), M = class e {
2144
2144
  static set(t) {
2145
- Object.hasOwn(t, "voiceParams") && (Object.assign(e._params.voiceParams, t.voiceParams), delete t.voiceParams), Object.hasOwn(t, "specListenerParams") && (Object.assign(e._params.specListenerParams, t.specListenerParams), delete t.specListenerParams), Object.hasOwn(t, "apiAuth") && (y.accessToken = t.apiAuth.accessToken, y.sessionKey = t.apiAuth.sessionKey, y.sessionSecretKey = t.apiAuth.sessionSecretKey);
2145
+ Object.hasOwn(t, "voiceParams") && (Object.assign(e._params.voiceParams, t.voiceParams), delete t.voiceParams), Object.hasOwn(t, "specListenerParams") && (Object.assign(e._params.specListenerParams, t.specListenerParams), delete t.specListenerParams), Object.hasOwn(t, "apiAuth") && (v.accessToken = t.apiAuth.accessToken, v.sessionKey = t.apiAuth.sessionKey, v.sessionSecretKey = t.apiAuth.sessionSecretKey);
2146
2146
  let n = mn.params.applyOverrides(t);
2147
2147
  Object.assign(e._params, j.objectFilterOutValues(n, void 0));
2148
2148
  }
@@ -2159,7 +2159,7 @@ var mn = pn.getInstance(), M = class e {
2159
2159
  return 1.1;
2160
2160
  }
2161
2161
  static get sdkVersion() {
2162
- return "2.8.11-dev.efee13f5.0";
2162
+ return "2.8.11-dev.f092dc48.0";
2163
2163
  }
2164
2164
  static get debug() {
2165
2165
  return e._params.debug;
@@ -2796,251 +2796,251 @@ var gn;
2796
2796
  F("onRemoteSharedUrl", e, t, n, r);
2797
2797
  }
2798
2798
  e.onRemoteSharedUrl = g;
2799
- function _(e, t, n) {
2799
+ function se(e, t, n) {
2800
2800
  F("onParticipantAdded", e, t, n);
2801
2801
  }
2802
- e.onParticipantAdded = _;
2803
- function se(e, t, n) {
2802
+ e.onParticipantAdded = se;
2803
+ function ce(e, t, n) {
2804
2804
  F("onParticipantJoined", e, t, n);
2805
2805
  }
2806
- e.onParticipantJoined = se;
2807
- function ce(e, t = !1, n) {
2806
+ e.onParticipantJoined = ce;
2807
+ function le(e, t = !1, n) {
2808
2808
  P("onLocalParticipantState", I(e), t, n);
2809
2809
  }
2810
- e.onLocalParticipantState = ce;
2811
- function le(e, t, n, r) {
2810
+ e.onLocalParticipantState = le;
2811
+ function ue(e, t, n, r) {
2812
2812
  F("onRemoteParticipantState", e, I(t), n, r);
2813
2813
  }
2814
- e.onRemoteParticipantState = le;
2815
- function ue(e, t, n) {
2814
+ e.onRemoteParticipantState = ue;
2815
+ function de(e, t, n) {
2816
2816
  P("onRemoteParticipantsState", e, t, n);
2817
2817
  }
2818
- e.onRemoteParticipantsState = ue;
2819
- function de(e, t, n = null, r) {
2818
+ e.onRemoteParticipantsState = de;
2819
+ function fe(e, t, n = null, r) {
2820
2820
  R.debug("Remote status:", t, e), F("onRemoteStatus", e, t, n, r);
2821
2821
  }
2822
- e.onRemoteStatus = de;
2823
- function fe() {
2822
+ e.onRemoteStatus = fe;
2823
+ function pe() {
2824
2824
  P("onPermissionsRequested");
2825
2825
  }
2826
- e.onPermissionsRequested = fe;
2827
- function pe(e, t) {
2826
+ e.onPermissionsRequested = pe;
2827
+ function me(e, t) {
2828
2828
  P("onPermissionsError", e, t);
2829
2829
  }
2830
- e.onPermissionsError = pe;
2831
- function me(e, t, n) {
2830
+ e.onPermissionsError = me;
2831
+ function he(e, t, n) {
2832
2832
  F("onRemoteRemoved", e, t, n);
2833
2833
  }
2834
- e.onRemoteRemoved = me;
2835
- function he(e, t, n, r) {
2834
+ e.onRemoteRemoved = he;
2835
+ function ge(e, t, n, r) {
2836
2836
  P("onCallState", e, t, I(n), r);
2837
2837
  }
2838
- e.onCallState = he;
2839
- function ge(e, t, n) {
2838
+ e.onCallState = ge;
2839
+ function _e(e, t, n) {
2840
2840
  P("onDeviceSwitched", e, t, n);
2841
2841
  }
2842
- e.onDeviceSwitched = ge;
2843
- function v(e, t, n, r = !1, i = !1, a = null, o = null, s, c, l = null, u) {
2842
+ e.onDeviceSwitched = _e;
2843
+ function _(e, t, n, r = !1, i = !1, a = null, o = null, s, c, l = null, u) {
2844
2844
  let d = c ? hn(c) : void 0;
2845
2845
  P("onMuteStates", I(e), hn(t), hn(n), r, i, a, o, s, d, l, u);
2846
2846
  }
2847
- e.onMuteStates = v;
2848
- function _e(e, t, n = !1, r) {
2847
+ e.onMuteStates = _;
2848
+ function ve(e, t, n = !1, r) {
2849
2849
  F("onRolesChanged", e, hn(t), n, r);
2850
2850
  }
2851
- e.onRolesChanged = _e;
2852
- function ve(e, t = !1, n) {
2851
+ e.onRolesChanged = ve;
2852
+ function ye(e, t = !1, n) {
2853
2853
  P("onLocalRolesChanged", hn(e), t, n);
2854
2854
  }
2855
- e.onLocalRolesChanged = ve;
2856
- function ye(e, t, n, r, i) {
2855
+ e.onLocalRolesChanged = ye;
2856
+ function be(e, t, n, r, i) {
2857
2857
  F("onPinnedParticipant", e, t, n, r, i);
2858
2858
  }
2859
- e.onPinnedParticipant = ye;
2860
- function be(e, t, n) {
2859
+ e.onPinnedParticipant = be;
2860
+ function xe(e, t, n) {
2861
2861
  P("onLocalPin", e, t, n);
2862
2862
  }
2863
- e.onLocalPin = be;
2864
- function xe(e, t) {
2863
+ e.onLocalPin = xe;
2864
+ function Se(e, t) {
2865
2865
  P("onOptionsChanged", hn(e), t);
2866
2866
  }
2867
- e.onOptionsChanged = xe;
2868
- function Se(e) {
2867
+ e.onOptionsChanged = Se;
2868
+ function Ce(e) {
2869
2869
  P("onCallAccepted", e);
2870
2870
  }
2871
- e.onCallAccepted = Se;
2872
- function Ce(e) {
2871
+ e.onCallAccepted = Ce;
2872
+ function we(e) {
2873
2873
  P("onCallActive", e);
2874
2874
  }
2875
- e.onCallActive = Ce;
2876
- function we(e, t, n) {
2875
+ e.onCallActive = we;
2876
+ function Te(e, t, n) {
2877
2877
  F("onAcceptedCall", e, t, n);
2878
2878
  }
2879
- e.onAcceptedCall = we;
2880
- function Te(e) {
2879
+ e.onAcceptedCall = Te;
2880
+ function Ee(e) {
2881
2881
  P("onRateNeeded", e);
2882
2882
  }
2883
- e.onRateNeeded = Te;
2884
- function Ee(e, t) {
2883
+ e.onRateNeeded = Ee;
2884
+ function De(e, t) {
2885
2885
  F("onSpeakerChanged", e, t);
2886
2886
  }
2887
- e.onSpeakerChanged = Ee;
2888
- function De(e, t) {
2887
+ e.onSpeakerChanged = De;
2888
+ function Oe(e, t) {
2889
2889
  P("onVolumesDetected", hn(e), t);
2890
2890
  }
2891
- e.onVolumesDetected = De;
2892
- function Oe(e, t) {
2891
+ e.onVolumesDetected = Oe;
2892
+ function ke(e, t) {
2893
2893
  P("onLocalVolume", e, t);
2894
2894
  }
2895
- e.onLocalVolume = Oe;
2896
- function ke(e, t, n) {
2895
+ e.onLocalVolume = ke;
2896
+ function Ae(e, t, n) {
2897
2897
  P("onJoinStatus", e, t, n);
2898
2898
  }
2899
- e.onJoinStatus = ke;
2900
- function Ae(e, t) {
2899
+ e.onJoinStatus = Ae;
2900
+ function je(e, t) {
2901
2901
  P("onHangup", e, t);
2902
2902
  }
2903
- e.onHangup = Ae;
2904
- function je(e) {
2903
+ e.onHangup = je;
2904
+ function Me(e) {
2905
2905
  P("onMultipartyChatCreated", I(e));
2906
2906
  }
2907
- e.onMultipartyChatCreated = je;
2908
- function Me() {
2907
+ e.onMultipartyChatCreated = Me;
2908
+ function Ne() {
2909
2909
  P("onDeviceChange");
2910
2910
  }
2911
- e.onDeviceChange = Me;
2912
- function Ne(e) {
2911
+ e.onDeviceChange = Ne;
2912
+ function Pe(e) {
2913
2913
  P("onFingerprintChange", e);
2914
2914
  }
2915
- e.onFingerprintChange = Ne;
2916
- function Pe() {
2915
+ e.onFingerprintChange = Pe;
2916
+ function Fe() {
2917
2917
  P("onTokenExpired");
2918
2918
  }
2919
- e.onTokenExpired = Pe;
2920
- function Fe(e, t, n = !1, r) {
2919
+ e.onTokenExpired = Fe;
2920
+ function Ie(e, t, n = !1, r) {
2921
2921
  P("onChatMessage", e, t, n, r);
2922
2922
  }
2923
- e.onChatMessage = Fe;
2924
- function Ie(e, t, n = !1, r) {
2923
+ e.onChatMessage = Ie;
2924
+ function Le(e, t, n = !1, r) {
2925
2925
  P("onCustomData", e, t, n, r);
2926
2926
  }
2927
- e.onCustomData = Ie;
2928
- function Le(e, t, n, r, i, a, o = null, s) {
2927
+ e.onCustomData = Le;
2928
+ function Re(e, t, n, r, i, a, o = null, s) {
2929
2929
  P("onRecordStarted", e, t, n, r, i, a, o, s);
2930
2930
  }
2931
- e.onRecordStarted = Le;
2932
- function Re(e = null, t, n) {
2931
+ e.onRecordStarted = Re;
2932
+ function ze(e = null, t, n) {
2933
2933
  P("onRecordStopped", e, t, n);
2934
2934
  }
2935
- e.onRecordStopped = Re;
2936
- function ze(e, t) {
2935
+ e.onRecordStopped = ze;
2936
+ function Be(e, t) {
2937
2937
  P("onLocalNetworkStatusChanged", e, t);
2938
2938
  }
2939
- e.onLocalNetworkStatusChanged = ze;
2940
- function Be(e, t) {
2939
+ e.onLocalNetworkStatusChanged = Be;
2940
+ function Ve(e, t) {
2941
2941
  P("onNetworkStatusChanged", e, t);
2942
2942
  }
2943
- e.onNetworkStatusChanged = Be;
2944
- function Ve(e, ...t) {
2943
+ e.onNetworkStatusChanged = Ve;
2944
+ function He(e, ...t) {
2945
2945
  P("onDebugMessage", e, ...t);
2946
2946
  }
2947
- e.onDebugMessage = Ve;
2948
- function He(e, t, ...n) {
2947
+ e.onDebugMessage = He;
2948
+ function Ue(e, t, ...n) {
2949
2949
  P("onDebugMessageWithContext", e, t, ...n);
2950
2950
  }
2951
- e.onDebugMessageWithContext = He;
2952
- function Ue(e, t) {
2951
+ e.onDebugMessageWithContext = Ue;
2952
+ function We(e, t) {
2953
2953
  P("onStatistics", Object.assign({}, e, { memory: t }));
2954
2954
  }
2955
- e.onStatistics = Ue;
2956
- function We() {
2955
+ e.onStatistics = We;
2956
+ function Ge() {
2957
2957
  P("onAutoplayError");
2958
2958
  }
2959
- e.onAutoplayError = We;
2960
- function Ge(e, t, n, r, i, a) {
2959
+ e.onAutoplayError = Ge;
2960
+ function Ke(e, t, n, r, i, a) {
2961
2961
  P("onChatRoomUpdated", e, t, n, r, i, a);
2962
2962
  }
2963
- e.onChatRoomUpdated = Ge;
2964
- function Ke(e, t) {
2963
+ e.onChatRoomUpdated = Ke;
2964
+ function qe(e, t) {
2965
2965
  P("onPromoted", e, t);
2966
2966
  }
2967
- e.onPromoted = Ke;
2968
- function qe(e, t) {
2967
+ e.onPromoted = qe;
2968
+ function Je(e, t) {
2969
2969
  P("onRemoteMixedAudioStream", e, t);
2970
2970
  }
2971
- e.onRemoteMixedAudioStream = qe;
2972
- function y(e, t) {
2971
+ e.onRemoteMixedAudioStream = Je;
2972
+ function v(e, t) {
2973
2973
  P("onJoinLinkChanged", e, t);
2974
2974
  }
2975
- e.onJoinLinkChanged = y;
2976
- function b(e, t) {
2975
+ e.onJoinLinkChanged = v;
2976
+ function y(e, t) {
2977
2977
  P("onRoomsUpdated", e, t);
2978
2978
  }
2979
- e.onRoomsUpdated = b;
2980
- function x(e, t, n, r, i) {
2979
+ e.onRoomsUpdated = y;
2980
+ function b(e, t, n, r, i) {
2981
2981
  P("onRoomUpdated", e, t, n, r, i);
2982
2982
  }
2983
- e.onRoomUpdated = x;
2984
- function S(e, t) {
2983
+ e.onRoomUpdated = b;
2984
+ function x(e, t) {
2985
2985
  P("onRoomParticipantsUpdated", e, t);
2986
2986
  }
2987
- e.onRoomParticipantsUpdated = S;
2988
- function C(e, t) {
2987
+ e.onRoomParticipantsUpdated = x;
2988
+ function S(e, t) {
2989
2989
  P("onRoomSwitched", e, t);
2990
2990
  }
2991
- e.onRoomSwitched = C;
2992
- function Je(e, t) {
2991
+ e.onRoomSwitched = S;
2992
+ function Ye(e, t) {
2993
2993
  P("onRoomStart", e, t);
2994
2994
  }
2995
- e.onRoomStart = Je;
2996
- function Ye(e, t = null, n) {
2995
+ e.onRoomStart = Ye;
2996
+ function Xe(e, t = null, n) {
2997
2997
  P("onFeedback", e, t, n);
2998
2998
  }
2999
- e.onFeedback = Ye;
3000
- function Xe(e, t) {
2999
+ e.onFeedback = Xe;
3000
+ function Ze(e, t) {
3001
3001
  P("onFeaturesPerRoleChanged", e, t);
3002
3002
  }
3003
- e.onFeaturesPerRoleChanged = Xe;
3004
- function Ze(e, t) {
3003
+ e.onFeaturesPerRoleChanged = Ze;
3004
+ function Qe(e, t) {
3005
3005
  P("onParticipantVmojiUpdate", e, t);
3006
3006
  }
3007
- e.onParticipantVmojiUpdate = Ze;
3008
- function Qe(e, t, n) {
3007
+ e.onParticipantVmojiUpdate = Qe;
3008
+ function $e(e, t, n) {
3009
3009
  P("onAsrSet", e, t, n);
3010
3010
  }
3011
- e.onAsrSet = Qe;
3012
- function $e(e, t, n, r) {
3011
+ e.onAsrSet = $e;
3012
+ function et(e, t, n, r) {
3013
3013
  P("onAsrStarted", e, t, n, r);
3014
3014
  }
3015
- e.onAsrStarted = $e;
3016
- function et(e, t) {
3015
+ e.onAsrStarted = et;
3016
+ function tt(e, t) {
3017
3017
  P("onAsrStopped", e, t);
3018
3018
  }
3019
- e.onAsrStopped = et;
3020
- function tt(e, t, n, r, i) {
3019
+ e.onAsrStopped = tt;
3020
+ function nt(e, t, n, r, i) {
3021
3021
  P("onAsrTranscription", e, t, n, r, i);
3022
3022
  }
3023
- e.onAsrTranscription = tt;
3024
- function nt(e, t, n) {
3023
+ e.onAsrTranscription = nt;
3024
+ function rt(e, t, n) {
3025
3025
  P("onParticipantIdChanged", e, t, n);
3026
3026
  }
3027
- e.onParticipantIdChanged = nt;
3028
- function rt(e, t) {
3027
+ e.onParticipantIdChanged = rt;
3028
+ function it(e, t) {
3029
3029
  P("onVideoSuspendSuggest", e, t);
3030
3030
  }
3031
- e.onVideoSuspendSuggest = rt;
3032
- function it(e) {
3031
+ e.onVideoSuspendSuggest = it;
3032
+ function at(e) {
3033
3033
  P("onSignalingMessage", typeof e == "string" ? e : I(e));
3034
3034
  }
3035
- e.onSignalingMessage = it;
3036
- function at(e, t) {
3035
+ e.onSignalingMessage = at;
3036
+ function ot(e, t) {
3037
3037
  P("onPromotionApproved", e, t);
3038
3038
  }
3039
- e.onPromotionApproved = at;
3040
- function ot(e) {
3039
+ e.onPromotionApproved = ot;
3040
+ function st(e) {
3041
3041
  P("onPeerRegistered", e);
3042
3042
  }
3043
- e.onPeerRegistered = ot;
3043
+ e.onPeerRegistered = st;
3044
3044
  })(gn || (gn = {}));
3045
3045
  var L = gn, _n = /* @__PURE__ */ function(e) {
3046
3046
  return e.DEBUG = "DEBUG", e.LOG = "LOG", e.WARN = "WARN", e.ERROR = "ERROR", e;
@@ -3062,7 +3062,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3062
3062
  }
3063
3063
  function u(e, t, n) {
3064
3064
  let u = l(n);
3065
- if (M.debugLog && ke(e, t, u.sessionId || void 0), c) switch (e) {
3065
+ if (M.debugLog && Ae(e, t, u.sessionId || void 0), c) switch (e) {
3066
3066
  case "DEBUG":
3067
3067
  i(...t);
3068
3068
  break;
@@ -3099,7 +3099,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3099
3099
  }
3100
3100
  e.enabled = ee;
3101
3101
  function h(e) {
3102
- c = e, M.debugLog && Ae();
3102
+ c = e, M.debugLog && je();
3103
3103
  }
3104
3104
  e.toggle = h;
3105
3105
  function te(e, ...t) {
@@ -3131,7 +3131,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3131
3131
  function re(e = null) {
3132
3132
  let t = null, n = e;
3133
3133
  function r() {
3134
- !M.debugLog || t || (t = je(), n && Me(n, t));
3134
+ !M.debugLog || t || (t = Me(), n && Ne(n, t));
3135
3135
  }
3136
3136
  let i = () => (r(), {
3137
3137
  sessionId: t,
@@ -3145,7 +3145,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3145
3145
  return n;
3146
3146
  },
3147
3147
  setConversationId(e) {
3148
- n = e, t && Me(n, t);
3148
+ n = e, t && Ne(n, t);
3149
3149
  },
3150
3150
  debug: (...e) => u("DEBUG", e, i),
3151
3151
  log: (...e) => u("LOG", e, i),
@@ -3237,7 +3237,7 @@ var R = vn, z = new class {
3237
3237
  clear() {
3238
3238
  this._conversations.clear(), this._activeId = null;
3239
3239
  }
3240
- }(), yn = class extends b {
3240
+ }(), yn = class extends y {
3241
3241
  constructor(...e) {
3242
3242
  super(...e), h(this, "_abortSignal", void 0);
3243
3243
  }
@@ -3777,7 +3777,7 @@ function Cr() {
3777
3777
  }
3778
3778
  //#endregion
3779
3779
  //#region src/classes/transport/BaseTransport.ts
3780
- var wr = class extends b {
3780
+ var wr = class extends y {
3781
3781
  constructor(e, t) {
3782
3782
  super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_state", K.IDLE), h(this, "_pc", null), this._signaling = e, this._mediaSource = t;
3783
3783
  }
@@ -3802,7 +3802,7 @@ var wr = class extends b {
3802
3802
  getValue() {
3803
3803
  return this.value;
3804
3804
  }
3805
- }, Er = .25, Dr = .35, Or = 85, kr = .1, Ar = 1.5, jr = .1, Mr = 1, Nr = .6, Pr = .3, Fr = class extends b {
3805
+ }, Er = .25, Dr = .35, Or = 85, kr = .1, Ar = 1.5, jr = .1, Mr = 1, Nr = .6, Pr = .3, Fr = class extends y {
3806
3806
  constructor(e, t = R) {
3807
3807
  super(), h(this, "_signaling", void 0), h(this, "_localNetworkStat", void 0), h(this, "_remoteNetworkStat", void 0), h(this, "_lastNetworkStat", void 0), h(this, "_networkLimits", {
3808
3808
  badNet: {
@@ -3879,7 +3879,7 @@ var wr = class extends b {
3879
3879
  }
3880
3880
  }, Ir = 30 * 1e3, Lr = class e extends wr {
3881
3881
  constructor(e, t, n, r, i, a = R, o = null, s = null, c = null) {
3882
- super(n, r), h(this, "_participantId", void 0), h(this, "_isMaster", void 0), h(this, "_remoteSDP", {}), h(this, "_remoteCandidates", {}), h(this, "_lastRemoteSDP", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_remoteAnimojiVersion", 1), h(this, "_isOpen", !1), h(this, "_remotePeerId", null), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_failedOnCreate", null), h(this, "_remoteStream", null), h(this, "_iceRestartTimeout", null), h(this, "_reconnectionTimeout", null), h(this, "_reconnectionPrevented", !1), h(this, "_lastStat", void 0), h(this, "_fingerprint", null), h(this, "_neverConnected", !0), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_networkLimitsForVideo", {
3882
+ super(n, r), h(this, "_participantId", void 0), h(this, "_isMaster", void 0), h(this, "_remoteSDP", {}), h(this, "_remoteCandidates", {}), h(this, "_lastRemoteSDP", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_remoteAnimojiVersion", 1), h(this, "_isOpen", !1), h(this, "_remotePeerId", null), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_failedOnCreate", null), h(this, "_remoteStream", null), h(this, "_iceRestartTimeout", null), h(this, "_reconnectionTimeout", null), h(this, "_reconnectionPrevented", !1), h(this, "_lastStat", void 0), h(this, "_fingerprint", null), h(this, "_neverConnected", !0), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_heldAudioSender", null), h(this, "_heldAudioTrack", null), h(this, "_networkLimitsForVideo", {
3883
3883
  bad: {
3884
3884
  loss: 4,
3885
3885
  rtt: 1e3
@@ -3908,7 +3908,7 @@ var wr = class extends b {
3908
3908
  try {
3909
3909
  this._mediaSource.addTrackToPeerConnection(this._pc, !1, !0), this._applySettings();
3910
3910
  } catch (e) {
3911
- this._logger?.log(C.ERROR, "addTrack-direct"), this._debug.error("Unable to add media source tracks", e, { participantId: this._participantId }), this._failedOnCreate = e;
3911
+ this._logger?.log(S.ERROR, "addTrack-direct"), this._debug.error("Unable to add media source tracks", e, { participantId: this._participantId }), this._failedOnCreate = e;
3912
3912
  return;
3913
3913
  }
3914
3914
  this._createOffer(!1).catch((e) => {
@@ -3942,7 +3942,7 @@ var wr = class extends b {
3942
3942
  if (this._debug.debug("DirectTransport: Open transport", { participantId: this._participantId }), this._isOpen = !0, this._remotePeerId = e, !this._isMaster) try {
3943
3943
  this._mediaSource.addTrackToPeerConnection(this._pc, !1, !0), this._applySettings();
3944
3944
  } catch (e) {
3945
- this._logger?.log(C.ERROR, "addTrack-direct"), this._debug.error("DirectTransport: Unable to add media source tracks", e, { participantId: this._participantId }), this.close(e);
3945
+ this._logger?.log(S.ERROR, "addTrack-direct"), this._debug.error("DirectTransport: Unable to add media source tracks", e, { participantId: this._participantId }), this.close(e);
3946
3946
  return;
3947
3947
  }
3948
3948
  this._setState(K.OPENED);
@@ -3968,6 +3968,17 @@ var wr = class extends b {
3968
3968
  allowRestart() {
3969
3969
  this._reconnectionPrevented = !1;
3970
3970
  }
3971
+ setOutgoingAudioEnabled(e) {
3972
+ if (this._pc) if (e) this._heldAudioSender && this._heldAudioTrack && (this._heldAudioSender.replaceTrack(this._heldAudioTrack).catch((e) => {
3973
+ this._debug.error("DirectTransport: Unable to restore audio track from hold", e);
3974
+ }), this._heldAudioSender = null, this._heldAudioTrack = null);
3975
+ else {
3976
+ let e = this._pc.getSenders().find((e) => e.track?.kind === "audio");
3977
+ e && e.track && (this._heldAudioSender = e, this._heldAudioTrack = e.track, e.replaceTrack(null).catch((e) => {
3978
+ this._debug.error("DirectTransport: Unable to null audio track for hold", e);
3979
+ }));
3980
+ }
3981
+ }
3971
3982
  setAnimojiTransport(e, t) {
3972
3983
  if (M.vmoji && (this._animojiReceiver = e, this._animojiSender = t, e.setParticipantId(this._participantId), this._animojiDataChannel)) {
3973
3984
  e.setDataChannel(this._animojiDataChannel), t.setDataChannel(this._animojiDataChannel);
@@ -4008,7 +4019,7 @@ var wr = class extends b {
4008
4019
  try {
4009
4020
  await this._pc.addIceCandidate(new RTCIceCandidate(t));
4010
4021
  } catch (e) {
4011
- throw this._logger?.log(C.ERROR, "addIceCandidate-direct"), this._debug.error("Unable to add remote ice candidate", e, {
4022
+ throw this._logger?.log(S.ERROR, "addIceCandidate-direct"), this._debug.error("Unable to add remote ice candidate", e, {
4012
4023
  participantId: this._participantId,
4013
4024
  candidate: t
4014
4025
  }), e;
@@ -4039,7 +4050,7 @@ var wr = class extends b {
4039
4050
  try {
4040
4051
  await this._pc.setRemoteDescription(n), await this._setRemoteCandidates(t), this._processAnimojiProtocolVersion(this._remoteAnimojiVersion);
4041
4052
  } catch (e) {
4042
- throw this._logger?.log(C.ERROR, "setRemoteDescription-direct"), this._debug.error("Unable to set remote description", e, {
4053
+ throw this._logger?.log(S.ERROR, "setRemoteDescription-direct"), this._debug.error("Unable to set remote description", e, {
4043
4054
  participantId: this._participantId,
4044
4055
  sdp: n
4045
4056
  }), e;
@@ -4091,11 +4102,11 @@ var wr = class extends b {
4091
4102
  }
4092
4103
  _markConnected() {
4093
4104
  this._neverConnected = !1, this._setState(K.CONNECTED), this._stopReconnection(), this._pc && j.getPeerConnectionHostInfo(this._pc).then((e) => {
4094
- e?.local && (this._logger?.log(C.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
4105
+ e?.local && (this._logger?.log(S.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
4095
4106
  }), this._startStatInterval();
4096
4107
  }
4097
4108
  _onConnectionStateChange() {
4098
- switch (this._debug.debug(`DirectTransport: Connection state changed to ${this._pc?.connectionState}`, { participantId: this._participantId }), this._logger?.log(C.ICE_CONNECTION_STATE, this._pc?.connectionState), this._pc?.connectionState) {
4109
+ switch (this._debug.debug(`DirectTransport: Connection state changed to ${this._pc?.connectionState}`, { participantId: this._participantId }), this._logger?.log(S.ICE_CONNECTION_STATE, this._pc?.connectionState), this._pc?.connectionState) {
4099
4110
  case "connected":
4100
4111
  this._markConnected();
4101
4112
  break;
@@ -4120,8 +4131,8 @@ var wr = class extends b {
4120
4131
  this._reconnectionTimeout && (clearTimeout(this._reconnectionTimeout), this._reconnectionTimeout = null), this._iceRestartTimeout && (clearTimeout(this._iceRestartTimeout), this._iceRestartTimeout = null);
4121
4132
  }
4122
4133
  _startIceRestart() {
4123
- this._isMaster ? (this._logger?.log(C.ICE_RESTART), this._debug.log("Ice restart", { participantId: this._participantId }), this._createOffer(!0).catch(this.close.bind(this))) : this._debug.debug("Waiting for ice restart...", { participantId: this._participantId }), this._iceRestartTimeout = window.setTimeout(() => {
4124
- this._iceRestartTimeout = null, this._debug.error("Ice restart failed", { participantId: this._participantId }), this._logger?.log(C.ERROR, "iceRestart-direct"), this._requestTopologySwitch();
4134
+ this._isMaster ? (this._logger?.log(S.ICE_RESTART), this._debug.log("Ice restart", { participantId: this._participantId }), this._createOffer(!0).catch(this.close.bind(this))) : this._debug.debug("Waiting for ice restart...", { participantId: this._participantId }), this._iceRestartTimeout = window.setTimeout(() => {
4135
+ this._iceRestartTimeout = null, this._debug.error("Ice restart failed", { participantId: this._participantId }), this._logger?.log(S.ERROR, "iceRestart-direct"), this._requestTopologySwitch();
4125
4136
  }, M.iceRestartWaitTime);
4126
4137
  }
4127
4138
  async _createOffer(t) {
@@ -4141,7 +4152,7 @@ var wr = class extends b {
4141
4152
  offer: r
4142
4153
  }), r = e._patchLocalDescription(r);
4143
4154
  } catch (e) {
4144
- throw this._debug.error("Unable to create offer", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "createOffer-direct"), e;
4155
+ throw this._debug.error("Unable to create offer", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "createOffer-direct"), e;
4145
4156
  }
4146
4157
  try {
4147
4158
  return this._debug.debug("Set local description", {
@@ -4149,7 +4160,7 @@ var wr = class extends b {
4149
4160
  offer: r
4150
4161
  }), this._calcFingerprint(r.sdp), await this._pc?.setLocalDescription(r), r;
4151
4162
  } catch (e) {
4152
- throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "setLocalDescription-direct"), e;
4163
+ throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "setLocalDescription-direct"), e;
4153
4164
  }
4154
4165
  }
4155
4166
  async _createAnswer() {
@@ -4161,7 +4172,7 @@ var wr = class extends b {
4161
4172
  answer: t
4162
4173
  }), t = e._patchLocalDescription(t);
4163
4174
  } catch (e) {
4164
- throw this._debug.error("Unable to create answer", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "createAnswer-direct"), e;
4175
+ throw this._debug.error("Unable to create answer", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "createAnswer-direct"), e;
4165
4176
  }
4166
4177
  try {
4167
4178
  return this._debug.debug("Set local description", {
@@ -4169,7 +4180,7 @@ var wr = class extends b {
4169
4180
  answer: t
4170
4181
  }), this._calcFingerprint(t.sdp), await this._pc?.setLocalDescription(t), t;
4171
4182
  } catch (e) {
4172
- throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "setLocalDescription-direct"), e;
4183
+ throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "setLocalDescription-direct"), e;
4173
4184
  }
4174
4185
  }
4175
4186
  static _patchLocalDescription(e) {
@@ -4182,7 +4193,7 @@ var wr = class extends b {
4182
4193
  _onReplacedTrack(e) {
4183
4194
  this._pc && (this._pc.getSenders().forEach((t) => {
4184
4195
  t.track && t.track.kind === e.kind && t.track.contentHint === e.contentHint && t.replaceTrack(e).catch((e) => {
4185
- this._debug.error("DirectTransport: Unable to replace track", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "replaceTrack-direct");
4196
+ this._debug.error("DirectTransport: Unable to replace track", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "replaceTrack-direct");
4186
4197
  });
4187
4198
  }), this._applySettings());
4188
4199
  }
@@ -4513,7 +4524,7 @@ var Ur = class {
4513
4524
  this._debug.debug(e.data.message);
4514
4525
  break;
4515
4526
  case Wr.LOG_ERROR:
4516
- this._logger?.log(C.ERROR, e.data.message);
4527
+ this._logger?.log(S.ERROR, e.data.message);
4517
4528
  break;
4518
4529
  }
4519
4530
  }, this._sendToWorker(Wr.INIT, r, i);
@@ -5489,7 +5500,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5489
5500
  }
5490
5501
  }, Zi = 90, Qi = 4294967295, $i = class e extends wr {
5491
5502
  constructor(e, t, n, r = R, i = null, a = null, o = null) {
5492
- super(e, t), h(this, "_producerNotification", null), h(this, "_producerCommand", null), h(this, "_producerScreen", null), h(this, "_consumerScreen", null), h(this, "_asr", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_isOpen", !1), h(this, "_observer", !1), h(this, "_reconnectionPrevented", !1), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_monitorRtpShareInterval", null), h(this, "_statBytes", {}), h(this, "_ssrcMap", {}), h(this, "_ssrcMapUpdated", !1), h(this, "_perfStatReporter", void 0), h(this, "_producerOfferIsProcessing", !1), h(this, "_producerNextOffer", null), h(this, "_producerNextSessionId", null), h(this, "_lastStat", null), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_prevConsumerFastSharingSettings", {}), h(this, "_asrTrack", null), h(this, "_captureSender", null), h(this, "_captureReceiver", null), h(this, "_participantIdRegistry", null), h(this, "_disabledSenders", /* @__PURE__ */ new Set()), h(this, "_rtpReceiversByStreamId", {}), h(this, "_producerSessionId", ""), h(this, "_newAudioShareTrack", null), h(this, "_simulcastInfo", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._debug = r, this._logger = i, this._statAggregator = a, this._codecStatsAggregator = o, this.subscribe(this._signaling, fr.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, Kt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, Kt.SOURCE_CHANGED, this._onSourcesChanged.bind(this)), this.subscribe(this._mediaSource, Kt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._createPerfStatsReporter(), this._serverSettings = n, this._debug.debug("ServerTransport: Created");
5503
+ super(e, t), h(this, "_producerNotification", null), h(this, "_producerCommand", null), h(this, "_producerScreen", null), h(this, "_consumerScreen", null), h(this, "_asr", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_isOpen", !1), h(this, "_observer", !1), h(this, "_reconnectionPrevented", !1), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_monitorRtpShareInterval", null), h(this, "_statBytes", {}), h(this, "_ssrcMap", {}), h(this, "_ssrcMapUpdated", !1), h(this, "_perfStatReporter", void 0), h(this, "_producerOfferIsProcessing", !1), h(this, "_producerNextOffer", null), h(this, "_producerNextSessionId", null), h(this, "_lastStat", null), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_prevConsumerFastSharingSettings", {}), h(this, "_asrTrack", null), h(this, "_captureSender", null), h(this, "_captureReceiver", null), h(this, "_participantIdRegistry", null), h(this, "_disabledSenders", /* @__PURE__ */ new Set()), h(this, "_rtpReceiversByStreamId", {}), h(this, "_producerSessionId", ""), h(this, "_newAudioShareTrack", null), h(this, "_simulcastInfo", null), h(this, "_heldAudioSender", null), h(this, "_heldAudioTrack", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._debug = r, this._logger = i, this._statAggregator = a, this._codecStatsAggregator = o, this.subscribe(this._signaling, fr.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, Kt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, Kt.SOURCE_CHANGED, this._onSourcesChanged.bind(this)), this.subscribe(this._mediaSource, Kt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._createPerfStatsReporter(), this._serverSettings = n, this._debug.debug("ServerTransport: Created");
5493
5504
  }
5494
5505
  updateStatisticsInterval() {
5495
5506
  this._stopStatInterval();
@@ -5509,6 +5520,17 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5509
5520
  removeParticipant(e) {
5510
5521
  this._captureReceiver?.close(e);
5511
5522
  }
5523
+ setOutgoingAudioEnabled(e) {
5524
+ if (this._pc) if (e) this._heldAudioSender && this._heldAudioTrack && (this._disabledSenders.delete(this._heldAudioSender), this._heldAudioSender.replaceTrack(this._heldAudioTrack).catch((e) => {
5525
+ this._debug.error("ServerTransport: Unable to restore audio track from hold", e);
5526
+ }), this._heldAudioSender = null, this._heldAudioTrack = null);
5527
+ else {
5528
+ let e = this._pc.getSenders().find((e) => e.track?.kind === k.audio && !this._disabledSenders.has(e));
5529
+ e && e.track && (this._heldAudioSender = e, this._heldAudioTrack = e.track, this._disabledSenders.add(e), e.replaceTrack(null).catch((e) => {
5530
+ this._debug.error("ServerTransport: Unable to null audio track for hold", e);
5531
+ }));
5532
+ }
5533
+ }
5512
5534
  preventRestart() {
5513
5535
  this._reconnectionPrevented = !0;
5514
5536
  }
@@ -5573,7 +5595,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5573
5595
  try {
5574
5596
  this._mediaSource.addTrackToPeerConnection(this._pc, this._observer, !1), this._prevConsumerSettings = {}, this._prevConsumerFastSharingSettings = {}, this._applyConsumerSettings();
5575
5597
  } catch (e) {
5576
- this._debug.error("ServerTransport: Unable to add media source tracks", e), this._logger?.log(C.ERROR, "addTrack-single"), this.close(e);
5598
+ this._debug.error("ServerTransport: Unable to add media source tracks", e), this._logger?.log(S.ERROR, "addTrack-single"), this.close(e);
5577
5599
  return;
5578
5600
  }
5579
5601
  this._createDataChannel(this._pc, gr.consumerScreenShare, (e) => {
@@ -5745,7 +5767,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5745
5767
  try {
5746
5768
  await this._pc.setRemoteDescription(e);
5747
5769
  } catch (e) {
5748
- throw this._debug.error("[single] unable to set remote offer", e), this._logger?.log(C.ERROR, "setRemoteDescription-single"), e;
5770
+ throw this._debug.error("[single] unable to set remote offer", e), this._logger?.log(S.ERROR, "setRemoteDescription-single"), e;
5749
5771
  }
5750
5772
  let r = this._findFirstSimTransceiver();
5751
5773
  if (M.simulcast) if (r) {
@@ -5758,13 +5780,13 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5758
5780
  if (await this._handleTracks(), this._debug.debug("[single] create local answer"), !this._pc) throw Error("Interrupt allocation");
5759
5781
  i = await this._pc.createAnswer();
5760
5782
  } catch (e) {
5761
- throw this._debug.error("[single] unable to create answer", e), this._logger?.log(C.ERROR, "createAnswer-single"), e;
5783
+ throw this._debug.error("[single] unable to create answer", e), this._logger?.log(S.ERROR, "createAnswer-single"), e;
5762
5784
  }
5763
5785
  try {
5764
5786
  if (!this._pc) throw Error("Interrupt allocation");
5765
5787
  i.sdp = j.patchLocalSDP(i.sdp, !1, T.isBrokenH264Decoder(), !1), this._debug.debug("[single] set local answer", { answer: i }), await this._pc.setLocalDescription(i);
5766
5788
  } catch (e) {
5767
- throw this._debug.error("[single] unable to set local answer", e), this._logger?.log(C.ERROR, "setLocalDescription-single"), e;
5789
+ throw this._debug.error("[single] unable to set local answer", e), this._logger?.log(S.ERROR, "setLocalDescription-single"), e;
5768
5790
  }
5769
5791
  if (n && r) {
5770
5792
  i.sdp = j.patchSimulcastAnswerSdp(i.sdp, r, Yt.WIDTH, Yt.HEIGHT);
@@ -5773,7 +5795,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5773
5795
  try {
5774
5796
  this._debug.debug("[single] transmit local answer", { answer: i }), this._updateSSRCMap(e), await this._signaling.acceptProducer(i, Object.keys(this._ssrcMap), t), this._debug.debug("[single] remote offer has been processed");
5775
5797
  } catch (e) {
5776
- this._debug.warn("[single] unable to send local answer", e), this._logger?.log(C.ERROR, "acceptProducer");
5798
+ this._debug.warn("[single] unable to send local answer", e), this._logger?.log(S.ERROR, "acceptProducer");
5777
5799
  }
5778
5800
  n && await this._changeSimulcastInfo(!0, !0);
5779
5801
  }
@@ -5847,7 +5869,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5847
5869
  try {
5848
5870
  e.direction = "sendonly", await e.sender.replaceTrack(this._newAudioShareTrack), this._newAudioShareTrack = null;
5849
5871
  } catch (e) {
5850
- this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(C.ERROR, "replaceTrack-single");
5872
+ this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(S.ERROR, "replaceTrack-single");
5851
5873
  }
5852
5874
  }
5853
5875
  async _handleScreenShareTrack() {
@@ -5892,7 +5914,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5892
5914
  this._debug.debug("[single] signaling state changed", { state: e.signalingState }, t);
5893
5915
  }
5894
5916
  _onConnectionStateChange(e, t) {
5895
- switch (this._debug.debug("[single] connection state changed", { state: e.connectionState }, t), this._logger?.log(C.ICE_CONNECTION_STATE, e.connectionState), e.connectionState) {
5917
+ switch (this._debug.debug("[single] connection state changed", { state: e.connectionState }, t), this._logger?.log(S.ICE_CONNECTION_STATE, e.connectionState), e.connectionState) {
5896
5918
  case "failed":
5897
5919
  this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error("Ice connection failed")) : this._reconnect();
5898
5920
  break;
@@ -5905,7 +5927,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5905
5927
  break;
5906
5928
  case "connected":
5907
5929
  this._setState(K.CONNECTED), j.getPeerConnectionHostInfo(e).then((e) => {
5908
- e?.local && (this._logger?.log(C.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
5930
+ e?.local && (this._logger?.log(S.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
5909
5931
  });
5910
5932
  break;
5911
5933
  }
@@ -5915,7 +5937,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5915
5937
  this._debug.debug(`_onReplacedTrack: newTrack=${e}, sendTrack=${t}`), t && (e = t);
5916
5938
  let n = (e, t) => {
5917
5939
  e.replaceTrack(t).catch((e) => {
5918
- this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(C.ERROR, "replaceTrack-single");
5940
+ this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(S.ERROR, "replaceTrack-single");
5919
5941
  });
5920
5942
  };
5921
5943
  if (this._debug.log(`_onReplacedTrack: newTrack=${e.getSettings().width}x${e.getSettings().height}`), M.simulcast && e.kind === k.video) {
@@ -5932,14 +5954,14 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5932
5954
  e === k.screen && M.consumerFastScreenShare && this._mediaSource.mediaSettings.isFastScreenSharingEnabled && await this._replaceScreenShareTrack(), this._applyConsumerSettings();
5933
5955
  }
5934
5956
  getStreamWaitingTimeMs(e, t) {
5935
- if (!this._pc) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "noConnection"), this._debug.error("Cannot get stream waiting time, peer connection is not initialized"), 0;
5936
- if (!RTCRtpReceiver.prototype.getSynchronizationSources) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "oldBrowser"), this._debug.error("Cannot get stream waiting time, RTCRtpReceiver.getSynchronizationSources is not supported"), 0;
5957
+ if (!this._pc) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noConnection"), this._debug.error("Cannot get stream waiting time, peer connection is not initialized"), 0;
5958
+ if (!RTCRtpReceiver.prototype.getSynchronizationSources) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "oldBrowser"), this._debug.error("Cannot get stream waiting time, RTCRtpReceiver.getSynchronizationSources is not supported"), 0;
5937
5959
  let n = this._rtpReceiversByStreamId[e];
5938
- if (!n) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "noReceiver"), this._debug.error(`Cannot get stream waiting time, cannot find RTP receiver by stream ID: ${e}`), 0;
5960
+ if (!n) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noReceiver"), this._debug.error(`Cannot get stream waiting time, cannot find RTP receiver by stream ID: ${e}`), 0;
5939
5961
  let r = n.getSynchronizationSources();
5940
5962
  if (!r || !r.length) return this._debug.log(`Cannot get stream waiting time, ${e} receiver has no synchronization sources`), 0;
5941
5963
  let i = r[0].rtpTimestamp;
5942
- if (!Number.isInteger(i)) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "timestampNotInteger"), this._debug.error(`Cannot get stream waiting time, ${e} receiver's RTP timestamp is not an integer: ${i}`), 0;
5964
+ if (!Number.isInteger(i)) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "timestampNotInteger"), this._debug.error(`Cannot get stream waiting time, ${e} receiver's RTP timestamp is not an integer: ${i}`), 0;
5943
5965
  let a = t - i & Qi, o = Math.ceil(a / Zi);
5944
5966
  return Math.min(100, Math.max(0, o));
5945
5967
  }
@@ -6000,7 +6022,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6000
6022
  }
6001
6023
  }, J = /* @__PURE__ */ function(e) {
6002
6024
  return e.REMOTE_TRACK_ADDED = "REMOTE_TRACK_ADDED", e.REMOTE_TRACK_REMOVED = "REMOTE_TRACK_REMOVED", e.REMOTE_STREAM_SECOND = "REMOTE_STREAM_SECOND", e.AUDIO_MIX_STALL = "AUDIO_MIX_STALL", e.REMOTE_DATA_STATS = "REMOTE_DATA_STATS", e.STATE_CHANGED = "STATE_CHANGED", e.LOCAL_STATE_CHANGED = "LOCAL_STATE_CHANGED", e.SIGNALLED_ACTIVE_PARTICIPANTS = "SIGNALLED_ACTIVE_PARTICIPANTS", e.SIGNALLED_SPEAKER_CHANGED = "SIGNALLED_SPEAKER_CHANGED", e.SIGNALLED_STALLED_PARTICIPANTS = "SIGNALLED_STALLED_PARTICIPANTS", e.TOPOLOGY_CHANGED = "TOPOLOGY_CHANGED", e.NETWORK_STATUS = "NETWORK_STATUS", e.PEER_CONNECTION_CLOSED = "PEER_CONNECTION_CLOSED", e.ASR_TRANSCRIPTION = "ASR_TRANSCRIPTION", e.ANIMOJI_STREAM = "ANIMOJI_STREAM", e.ANIMOJI_ERROR = "ANIMOJI_ERROR", e.SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT", e;
6003
- }({}), ea = class extends b {
6025
+ }({}), ea = class extends y {
6004
6026
  constructor(e, t, n, r, i = R, a = null, o = null, s = null) {
6005
6027
  super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_topology", void 0), h(this, "_allocated", []), h(this, "_opened", []), h(this, "_directTransport", null), h(this, "_serverTransport", null), h(this, "_serverSettings", void 0), h(this, "_dtListeners", []), h(this, "_stListeners", []), h(this, "_states", {}), h(this, "_localState", K.IDLE), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._signaling = t, this._mediaSource = n, this._topology = e, this._serverSettings = r, this._debug = i, this._logger = a, this._statAggregator = o, this._codecStatsAggregator = s, this.subscribe(this._signaling, fr.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, Kt.ANIMOJI_STATUS, this._onAnimojiStatus.bind(this)), this.subscribe(this._mediaSource, Kt.SOURCE_CHANGED, this._onSourceChanged.bind(this)), this._createAnimojiTransport(), e === q.SERVER && (this._serverTransport = this._createServerTransport());
6006
6028
  }
@@ -6043,11 +6065,8 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6043
6065
  for (let e of this._stListeners) e.dispose();
6044
6066
  this._removeAnimojiTransport(), M.audioEffects?.destroy(), this._directTransport?.close(), this._directTransport = null, this._serverTransport?.close(), this._serverTransport = null, this._allocated = [], this._opened = [];
6045
6067
  }
6046
- holdClose() {
6047
- this.unsubscribe();
6048
- for (let e of this._dtListeners) e.dispose();
6049
- for (let e of this._stListeners) e.dispose();
6050
- this._directTransport?.close(), this._directTransport = null, this._serverTransport?.close(), this._serverTransport = null, this._allocated = [], this._opened = [];
6068
+ setOutgoingAudioEnabled(e) {
6069
+ this._directTransport?.setOutgoingAudioEnabled(e), this._serverTransport?.setOutgoingAudioEnabled(e);
6051
6070
  }
6052
6071
  getTopology() {
6053
6072
  return this._topology;
@@ -6088,7 +6107,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6088
6107
  }
6089
6108
  _onTopologyChanged(e) {
6090
6109
  if (e.topology !== this._topology) {
6091
- if (this._debug.log(`Topology changed ${this._topology} -> ${e.topology}`), this._logger?.log(C.TOPOLOGY_CHANGE_REQUESTED, e.topology), this._topology = e.topology, this._topology === q.SERVER && (this._serverTransport ? this._serverTransport.allowRestart() : (this._serverTransport = this._createServerTransport(), this._opened.length > 0 && (this._directTransport?.preventRestart(), this._serverTransport.open()))), this._topology === q.DIRECT) {
6110
+ if (this._debug.log(`Topology changed ${this._topology} -> ${e.topology}`), this._logger?.log(S.TOPOLOGY_CHANGE_REQUESTED, e.topology), this._topology = e.topology, this._topology === q.SERVER && (this._serverTransport ? this._serverTransport.allowRestart() : (this._serverTransport = this._createServerTransport(), this._opened.length > 0 && (this._directTransport?.preventRestart(), this._serverTransport.open()))), this._topology === q.DIRECT) {
6092
6111
  let t = e.offerTo || [], n = e.offerToTypes || [], r = e.offerToDeviceIdxs || [], i = t.length && n.length ? j.composeParticipantId(t[0], n[0], r[0]) : null;
6093
6112
  if (this._serverTransport && this._serverTransport.preventRestart(), !this._allocated || this._allocated.length === 0) {
6094
6113
  this._debug.error("Topology changed to DIRECT, but the list of allocated participants is empty");
@@ -6196,9 +6215,9 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6196
6215
  this._animojiSender?.destroy(), this._animojiSender = null, this._animojiReceiver?.destroy(), this._animojiReceiver = null;
6197
6216
  }
6198
6217
  getStreamWaitingTimeMs(e, t) {
6199
- return this._topology === q.SERVER ? this._serverTransport ? this._serverTransport.getStreamWaitingTimeMs(e, t) : (this._logger?.log(C.PAT_WAITING_TIME_ERROR, "noTransport"), this._debug.error("Cannot get stream waiting time, server transport is not initialized"), 0) : (this._logger?.log(C.PAT_WAITING_TIME_ERROR, "wrongTopology"), this._debug.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`), 0);
6218
+ return this._topology === q.SERVER ? this._serverTransport ? this._serverTransport.getStreamWaitingTimeMs(e, t) : (this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noTransport"), this._debug.error("Cannot get stream waiting time, server transport is not initialized"), 0) : (this._logger?.log(S.PAT_WAITING_TIME_ERROR, "wrongTopology"), this._debug.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`), 0);
6200
6219
  }
6201
- }, ta = "videochat-epi", na = 5e3, ra = 500, ia = class extends b {
6220
+ }, ta = "videochat-epi", na = 5e3, ra = 500, ia = class extends y {
6202
6221
  constructor(e, t, n = null, r = !1, i = R) {
6203
6222
  super(), h(this, "_previousPerfStatReportTimestamp", 0), h(this, "_previousNetworkStatReportTimestamp", Date.now()), h(this, "_previousCallStatReportTimestamp", Date.now()), h(this, "_previousCallStatReport", null), h(this, "_screenShareStats", []), h(this, "_signaling", void 0), h(this, "_directTopology", void 0), h(this, "_debug", void 0), h(this, "_statAggregator", void 0), h(this, "_handleScreenSharingStat", (e) => {
6204
6223
  this._screenShareStats.push(e);
@@ -6792,7 +6811,7 @@ var ua = la, da = {
6792
6811
  async connect(e) {
6793
6812
  return new Promise((t, n) => {
6794
6813
  if (this.transport.readyState !== null && this.transport.readyState < WebSocket.CLOSING) {
6795
- this._logger?.log(C.SOCKET_ACTION, "already_opened"), n(Error("Socket already opened"));
6814
+ this._logger?.log(S.SOCKET_ACTION, "already_opened"), n(Error("Socket already opened"));
6796
6815
  return;
6797
6816
  }
6798
6817
  this.conversationResolve = (e) => {
@@ -7070,10 +7089,10 @@ var ua = la, da = {
7070
7089
  if (this._isDataChannelCommand(e)) this.datachannelCommandsQueue.push(t), this.producerCommandDataChannel?.readyState === wa && this._handleCommandsQueue(this.datachannelCommandsQueue);
7071
7090
  else {
7072
7091
  if (this.transport.readyState === null) {
7073
- this._logger?.log(C.SOCKET_ACTION, "not_opened"), this._debug.warn("[signaling] socket is not opened"), t.reject(/* @__PURE__ */ Error(`Socket not opened [${e}]`), !0);
7092
+ this._logger?.log(S.SOCKET_ACTION, "not_opened"), this._debug.warn("[signaling] socket is not opened"), t.reject(/* @__PURE__ */ Error(`Socket not opened [${e}]`), !0);
7074
7093
  return;
7075
7094
  }
7076
- this.transport.readyState > WebSocket.OPEN && (this._logger?.log(C.SOCKET_ACTION, "invalid_state"), this._debug.warn(`[signaling] socket is not opened, state ${this.transport.readyState}`)), this.websocketCommandsQueue.push(t), this.transport.readyState === WebSocket.OPEN && this._handleCommandsQueue(this.websocketCommandsQueue);
7095
+ this.transport.readyState > WebSocket.OPEN && (this._logger?.log(S.SOCKET_ACTION, "invalid_state"), this._debug.warn(`[signaling] socket is not opened, state ${this.transport.readyState}`)), this.websocketCommandsQueue.push(t), this.transport.readyState === WebSocket.OPEN && this._handleCommandsQueue(this.websocketCommandsQueue);
7077
7096
  }
7078
7097
  };
7079
7098
  return new Promise((a, o) => {
@@ -7098,7 +7117,7 @@ var ua = la, da = {
7098
7117
  return this.producerCommandDataChannelEnabled ? e === B.UPDATE_DISPLAY_LAYOUT || e === B.REPORT_PERF_STAT || e === B.REPORT_SHARING_STAT || e === B.REQUEST_ASR || e === B.ENABLE_VIDEO_SUSPEND || e === B.ENABLE_VIDEO_SUSPEND_SUGGEST || e === B.REPORT_NETWORK_STAT || e === B.CHANGE_SIMULCAST : !1;
7099
7118
  }
7100
7119
  _onOpen() {
7101
- this._debug.debug("[signaling] socket opened"), this._logger?.log(C.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === dr.RETRY ? mr.RECONNECTED : mr.CONNECTED);
7120
+ this._debug.debug("[signaling] socket opened"), this._logger?.log(S.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === dr.RETRY ? mr.RECONNECTED : mr.CONNECTED);
7102
7121
  }
7103
7122
  _onMessage(e) {
7104
7123
  if (e.data === "ping") {
@@ -7109,7 +7128,7 @@ var ua = la, da = {
7109
7128
  let t = JSON.parse(e.data);
7110
7129
  L.onSignalingMessage(t), this._handleMessage(t);
7111
7130
  } catch (t) {
7112
- this._logger?.log(C.SOCKET_ACTION, "parse_error"), this._debug.error("[signaling] unable to parse message", t, e.data);
7131
+ this._logger?.log(S.SOCKET_ACTION, "parse_error"), this._debug.error("[signaling] unable to parse message", t, e.data);
7113
7132
  }
7114
7133
  }
7115
7134
  _handleMessage(e) {
@@ -7129,12 +7148,12 @@ var ua = la, da = {
7129
7148
  case "error":
7130
7149
  this._handleErrorMessage(e);
7131
7150
  break;
7132
- default: this._logger?.log(C.SOCKET_ACTION, "unknown_message"), this._debug.warn("[signaling] unhandled message", e);
7151
+ default: this._logger?.log(S.SOCKET_ACTION, "unknown_message"), this._debug.warn("[signaling] unhandled message", e);
7133
7152
  }
7134
7153
  e.stamp && (this.lastStamp = e.stamp, this.transport.setLastStamp(e.stamp));
7135
7154
  }
7136
7155
  _handleErrorMessage(e) {
7137
- this._logger?.log(C.SOCKET_ACTION, `error-${e.error}`);
7156
+ this._logger?.log(S.SOCKET_ACTION, `error-${e.error}`);
7138
7157
  let t = e.error ? Ea.includes(e.error) : !1;
7139
7158
  switch (this._debug.debug(`[signaling] error message [${e.sequence}]`, e), e.sequence && this.responseHandlers[e.sequence] && this._handleCommandResponse(!1, e), e.error) {
7140
7159
  case "service-unavailable":
@@ -7148,7 +7167,7 @@ var ua = la, da = {
7148
7167
  });
7149
7168
  break;
7150
7169
  case "conversation-ended":
7151
- this.conversationReject ? this.conversationReject(new O(e.reason || x.SIGNALING_FAILED, {
7170
+ this.conversationReject ? this.conversationReject(new O(e.reason || b.SIGNALING_FAILED, {
7152
7171
  message: `Conversation ended: ${e.error}`,
7153
7172
  remote: !0
7154
7173
  })) : this._triggerEvent(fr.NOTIFICATION, {
@@ -7167,7 +7186,7 @@ var ua = la, da = {
7167
7186
  break;
7168
7187
  default:
7169
7188
  if (!t) break;
7170
- this.connected ? this._throwError(/* @__PURE__ */ Error(`Signaling error: ${e.error}`)) : e.sequence || (this.conversationReject?.(new O(e.reason || x.SIGNALING_FAILED, {
7189
+ this.connected ? this._throwError(/* @__PURE__ */ Error(`Signaling error: ${e.error}`)) : e.sequence || (this.conversationReject?.(new O(e.reason || b.SIGNALING_FAILED, {
7171
7190
  message: `Unable to connect to the signaling: ${e.error}`,
7172
7191
  remote: !0
7173
7192
  })), this._closeSocket());
@@ -7184,7 +7203,7 @@ var ua = la, da = {
7184
7203
  this._triggerEvent(fr.FAILED, e);
7185
7204
  }
7186
7205
  _onError(e) {
7187
- this._logger?.log(C.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(mr.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
7206
+ this._logger?.log(S.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(mr.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
7188
7207
  }
7189
7208
  _serializeErrorEvent(e) {
7190
7209
  let t = e, n = t.error instanceof Error ? t.error : null;
@@ -7199,7 +7218,7 @@ var ua = la, da = {
7199
7218
  });
7200
7219
  }
7201
7220
  _onClose(e) {
7202
- this._logger?.log(C.SOCKET_ACTION, "closed"), this._debug.debug("[signaling] connection closed", {
7221
+ this._logger?.log(S.SOCKET_ACTION, "closed"), this._debug.debug("[signaling] connection closed", {
7203
7222
  code: e.code,
7204
7223
  reason: e.reason
7205
7224
  }), this.connected = !1;
@@ -7214,7 +7233,7 @@ var ua = la, da = {
7214
7233
  let r = this.responseHandlers[n.sequence];
7215
7234
  window.clearTimeout(r.responseTimer);
7216
7235
  let i = W.measureMark(r.statMarkName);
7217
- i !== null && this._statSignalingCommands?.mark(r.name, i, this._getSocketType()), this._debug.debug(`[signaling] command response [${n.sequence}]`, n), t ? (delete this.responseHandlers[n.sequence], r.resolve(n)) : n.type === "error" ? (delete this.responseHandlers[n.sequence], this._logger?.log(C.SOCKET_ACTION, "response-error"), r.reject(Error(n.error || `Response error [${r.name}]`), !0)) : this.transport.readyState === WebSocket.OPEN ? (delete this.responseHandlers[n.sequence], this._logger?.log(C.SOCKET_ACTION, "response-timeout"), r.reject(Error(n.error || `Response timeout [${r.name}]`))) : r.responseTimer = window.setTimeout(() => this._handleCommandResponse(t, n), e.WAIT_RESPONSE_DELAY);
7236
+ i !== null && this._statSignalingCommands?.mark(r.name, i, this._getSocketType()), this._debug.debug(`[signaling] command response [${n.sequence}]`, n), t ? (delete this.responseHandlers[n.sequence], r.resolve(n)) : n.type === "error" ? (delete this.responseHandlers[n.sequence], this._logger?.log(S.SOCKET_ACTION, "response-error"), r.reject(Error(n.error || `Response error [${r.name}]`), !0)) : this.transport.readyState === WebSocket.OPEN ? (delete this.responseHandlers[n.sequence], this._logger?.log(S.SOCKET_ACTION, "response-timeout"), r.reject(Error(n.error || `Response timeout [${r.name}]`))) : r.responseTimer = window.setTimeout(() => this._handleCommandResponse(t, n), e.WAIT_RESPONSE_DELAY);
7218
7237
  }
7219
7238
  _handleCommandsQueue(e) {
7220
7239
  for (; e.length > 0;) {
@@ -7280,7 +7299,7 @@ var ua = la, da = {
7280
7299
  }
7281
7300
  _waitConnectionMessage() {
7282
7301
  this.connectionMessageWaitTimer = window.setTimeout(() => {
7283
- this.conversationReject && this.conversationReject(new O(x.SIGNALING_FAILED, {
7302
+ this.conversationReject && this.conversationReject(new O(b.SIGNALING_FAILED, {
7284
7303
  message: "Unable to connect to the signaling: connection timeout",
7285
7304
  remote: !0
7286
7305
  }));
@@ -7292,7 +7311,7 @@ var ua = la, da = {
7292
7311
  _onTransportFailed(e) {
7293
7312
  switch (e.failure) {
7294
7313
  case Sa.EMPTY_ENDPOINT:
7295
- this.conversationReject?.(new O(x.SIGNALING_FAILED, {
7314
+ this.conversationReject?.(new O(b.SIGNALING_FAILED, {
7296
7315
  message: e.message,
7297
7316
  remote: e.remote
7298
7317
  }));
@@ -7306,7 +7325,7 @@ var ua = la, da = {
7306
7325
  }
7307
7326
  }
7308
7327
  _onTransportReconnectScheduled(e) {
7309
- this.connectionType = dr.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(C.SOCKET_ACTION, "reconnect");
7328
+ this.connectionType = dr.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(S.SOCKET_ACTION, "reconnect");
7310
7329
  }
7311
7330
  _onTransportConnectionDead() {
7312
7331
  this._debug.warn("[signaling] socket is dead, trying to reconnect"), this._logTransportStat(mr.FAILED_PINGS);
@@ -7461,10 +7480,10 @@ function Wa(e) {
7461
7480
  }
7462
7481
  function Ga(e, t) {
7463
7482
  switch (e) {
7464
- case S.AUDIO: return !!t.isAudioEnabled;
7465
- case S.AUDIO_SHARING: return !!t.isAudioSharingEnabled;
7466
- case S.VIDEO: return !!t.isVideoEnabled;
7467
- case S.SCREEN_SHARING: return !!t.isFastScreenSharingEnabled || !!t.isScreenSharingEnabled;
7483
+ case x.AUDIO: return !!t.isAudioEnabled;
7484
+ case x.AUDIO_SHARING: return !!t.isAudioSharingEnabled;
7485
+ case x.VIDEO: return !!t.isVideoEnabled;
7486
+ case x.SCREEN_SHARING: return !!t.isFastScreenSharingEnabled || !!t.isScreenSharingEnabled;
7468
7487
  default: return !1;
7469
7488
  }
7470
7489
  }
@@ -7523,30 +7542,30 @@ function Ya(e, t) {
7523
7542
  //#region src/classes/AudioFix.ts
7524
7543
  var Xa = class {
7525
7544
  constructor(e, t = R, n = null) {
7526
- h(this, "_fixNoPacketsApplied", !1), h(this, "_fixNoPacketsChecked", !1), h(this, "_fixTooManyPacketsApplied", !1), h(this, "_fixTooManyPacketsSucceeded", !1), h(this, "_fixTooManyPacketsFailed", !1), h(this, "_fixTooManyPacketsTime", void 0), h(this, "_mediaSource", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_lastPacketsSent", void 0), h(this, "_lastPacketsSentTime", void 0), h(this, "_toggleAudioPromise", null), h(this, "_fixNoPacketsAppliedVideo", !1), this._mediaSource = e, this._debug = t, this._logger = n;
7545
+ h(this, "_fixNoPacketsApplied", !1), h(this, "_fixNoPacketsChecked", !1), h(this, "_fixTooManyPacketsApplied", !1), h(this, "_fixTooManyPacketsSucceeded", !1), h(this, "_fixTooManyPacketsFailed", !1), h(this, "_fixTooManyPacketsTime", void 0), h(this, "_mediaSource", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_lastPacketsSent", void 0), h(this, "_lastPacketsSentTime", void 0), h(this, "_toggleAudioPromise", null), h(this, "_fixNoPacketsAppliedVideo", !1), h(this, "_disabled", !1), this._mediaSource = e, this._debug = t, this._logger = n;
7527
7546
  }
7528
7547
  _fixAudioDeviceNoPackets(e) {
7529
- if (!(this._fixNoPacketsApplied && this._fixNoPacketsChecked)) {
7548
+ if (!this._disabled && !(this._fixNoPacketsApplied && this._fixNoPacketsChecked)) {
7530
7549
  if (this._fixNoPacketsApplied && !this._fixNoPacketsChecked) {
7531
- this._fixNoPacketsChecked = !0, this._logger?.log(C.ERROR, `audio_device_recover_${e.bandwidth ? "success" : "fail"}`);
7550
+ this._fixNoPacketsChecked = !0, this._logger?.log(S.ERROR, `audio_device_recover_${e.bandwidth ? "success" : "fail"}`);
7532
7551
  return;
7533
7552
  }
7534
- !this._fixNoPacketsApplied && !e.bandwidth && (this._fixNoPacketsApplied = !0, this._logger?.log(C.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (no packets)"), this._toggleAudioPromise = this._mediaSource.toggleAudio(T.getMicrophonePermissionState() !== "denied"), this._toggleAudioPromise.catch(() => void 0));
7553
+ !this._fixNoPacketsApplied && !e.bandwidth && (this._fixNoPacketsApplied = !0, this._logger?.log(S.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (no packets)"), this._toggleAudioPromise = this._mediaSource.toggleAudio(T.getMicrophonePermissionState() !== "denied"), this._toggleAudioPromise.catch(() => void 0));
7535
7554
  }
7536
7555
  }
7537
7556
  _fixAudioDeviceTooManyPackets(e) {
7538
- if (this._fixTooManyPacketsSucceeded || this._fixTooManyPacketsFailed) return;
7557
+ if (this._disabled || this._fixTooManyPacketsSucceeded || this._fixTooManyPacketsFailed) return;
7539
7558
  let t = Date.now();
7540
7559
  if (!this._lastPacketsSentTime) e.packetsSent > 0 && (this._lastPacketsSentTime = t, this._lastPacketsSent = e.packetsSent);
7541
7560
  else if (t - this._lastPacketsSentTime > 500) {
7542
7561
  let n = (e.packetsSent - this._lastPacketsSent) * 1e3 / (t - this._lastPacketsSentTime);
7543
- this._lastPacketsSentTime = t, this._lastPacketsSent = e.packetsSent, this._fixTooManyPacketsApplied ? n > 75 ? (this._debug.log("[AudioFix] Failed to fix RV"), this._logger?.log(C.ERROR, "audio_device_recover_rv_fail"), this._fixTooManyPacketsFailed = !0) : t - this._fixTooManyPacketsTime > 6e4 && (this._debug.log("[AudioFix] Fixed RV"), this._logger?.log(C.ERROR, "audio_device_recover_rv_success"), this._fixTooManyPacketsSucceeded = !0) : n > 75 && (this._fixTooManyPacketsApplied = !0, this._logger?.log(C.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (too many packets)"), this._mediaSource.toggleAudio(!0).catch((e) => {
7562
+ this._lastPacketsSentTime = t, this._lastPacketsSent = e.packetsSent, this._fixTooManyPacketsApplied ? n > 75 ? (this._debug.log("[AudioFix] Failed to fix RV"), this._logger?.log(S.ERROR, "audio_device_recover_rv_fail"), this._fixTooManyPacketsFailed = !0) : t - this._fixTooManyPacketsTime > 6e4 && (this._debug.log("[AudioFix] Fixed RV"), this._logger?.log(S.ERROR, "audio_device_recover_rv_success"), this._fixTooManyPacketsSucceeded = !0) : n > 75 && (this._fixTooManyPacketsApplied = !0, this._logger?.log(S.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (too many packets)"), this._mediaSource.toggleAudio(!0).catch((e) => {
7544
7563
  this._debug.warn("[AudioFix] Failed to fix RV (too many packets)", e);
7545
7564
  }), this._fixTooManyPacketsTime = t);
7546
7565
  }
7547
7566
  }
7548
7567
  fix(e) {
7549
- if (!this._mediaSource) return;
7568
+ if (this._disabled || !this._mediaSource) return;
7550
7569
  let t = e.find((e) => e.kind === k.audio);
7551
7570
  t && (this._fixAudioDeviceNoPackets(t), this._fixAudioDeviceTooManyPackets(t));
7552
7571
  }
@@ -7559,6 +7578,9 @@ var Xa = class {
7559
7578
  this._debug.warn("[AudioFix] Failed to fix RV (no packets): video restart", e);
7560
7579
  }));
7561
7580
  }
7581
+ disable() {
7582
+ this._disabled = !0;
7583
+ }
7562
7584
  }, Za = class {
7563
7585
  constructor(e, t = !1, n = R, r = null) {
7564
7586
  h(this, "_audioElement", null), h(this, "_audioTracks", /* @__PURE__ */ new Map()), h(this, "_allowMultipleTracks", void 0), h(this, "_volume", 1), h(this, "_features", { setSinkId: !!Audio.prototype.setSinkId }), h(this, "_statFirstMediaReceived", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), this._statFirstMediaReceived = e, this._allowMultipleTracks = t, this._debug = n, this._logger = r;
@@ -7600,7 +7622,7 @@ var Xa = class {
7600
7622
  let e = T.getSavedOutput();
7601
7623
  e && await this._audioElement.setSinkId?.(e.deviceId);
7602
7624
  } catch (e) {
7603
- throw this._logger?.log(C.ERROR, "change_output"), this._debug.error("[audio] Output change failed", e), e;
7625
+ throw this._logger?.log(S.ERROR, "change_output"), this._debug.error("[audio] Output change failed", e), e;
7604
7626
  }
7605
7627
  }
7606
7628
  _getTracks() {
@@ -7658,7 +7680,7 @@ function eo(e, t) {
7658
7680
  }
7659
7681
  //#endregion
7660
7682
  //#region src/classes/DebugInfo.ts
7661
- var to = 90, no = 3, ro = class extends b {
7683
+ var to = 90, no = 3, ro = class extends y {
7662
7684
  constructor(e = R) {
7663
7685
  super(), h(this, "_lastMemoryStat", {
7664
7686
  percent: 0,
@@ -7816,7 +7838,7 @@ var to = 90, no = 3, ro = class extends b {
7816
7838
  destroy() {
7817
7839
  this._mediaStreamSource && (this._mediaStreamSource.disconnect(), this._mediaStreamSource = null), this._gainNode && (this._gainNode.disconnect(), this._gainNode = null), this._analyser && (this._analyser.disconnect(), this._analyser = null, this._fftBins = null, this._lastSmoothedLevel = 0), this._stream.removeTrack(this._track);
7818
7840
  }
7819
- }, so = class extends b {
7841
+ }, so = class extends y {
7820
7842
  constructor(e) {
7821
7843
  super(), h(this, "_detector", null), h(this, "_interval", null);
7822
7844
  let t = () => {
@@ -7862,7 +7884,7 @@ var to = 90, no = 3, ro = class extends b {
7862
7884
  }
7863
7885
  }, lo = /* @__PURE__ */ function(e) {
7864
7886
  return e.VOLUMES_DETECTED = "VOLUMES_DETECTED", e;
7865
- }({}), uo = class extends b {
7887
+ }({}), uo = class extends y {
7866
7888
  constructor(e) {
7867
7889
  super(), h(this, "_detectors", /* @__PURE__ */ new Map()), h(this, "_interval", null), h(this, "_activeParticipants", void 0), h(this, "_removedParticipants", void 0), h(this, "_topology", void 0), this._topology = e.getTopology(), this.subscribe(e, J.REMOTE_TRACK_ADDED, this._onRemoteTrackAdded.bind(this)), this.subscribe(e, J.REMOTE_TRACK_REMOVED, this._onRemoteTrackRemoved.bind(this)), this.subscribe(e, J.SIGNALLED_ACTIVE_PARTICIPANTS, this._onSignalledActiveParticipants.bind(this)), this.subscribe(e, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7868
7890
  }
@@ -7930,7 +7952,7 @@ var to = 90, no = 3, ro = class extends b {
7930
7952
  }
7931
7953
  }, fo = /* @__PURE__ */ function(e) {
7932
7954
  return e.SPEAKER_CHANGED = "SPEAKER_CHANGED", e;
7933
- }({}), po = class extends b {
7955
+ }({}), po = class extends y {
7934
7956
  constructor(e, t, n) {
7935
7957
  super(), h(this, "_speakerId", null), h(this, "_serverSideSpeakerDetection", !1), this._serverSideSpeakerDetection = n === q.SERVER, this.subscribe(e, lo.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this.subscribe(t, J.SIGNALLED_SPEAKER_CHANGED, this._onServerSpeakerChanged.bind(this)), this.subscribe(t, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7936
7958
  }
@@ -7954,7 +7976,7 @@ var to = 90, no = 3, ro = class extends b {
7954
7976
  _onTopologyChanged(e) {
7955
7977
  this._serverSideSpeakerDetection = e === q.SERVER;
7956
7978
  }
7957
- }, mo = 15e3, ho = 15e3, go = class extends b {
7979
+ }, mo = 15e3, ho = 15e3, go = class extends y {
7958
7980
  constructor(e, t, n, r = R, i = null) {
7959
7981
  super(), h(this, "_transport", void 0), h(this, "_volumes", {}), h(this, "_participants", {}), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_connectionTimeout", 0), h(this, "_connectionTimeoutSuppressed", !1), h(this, "_volumeTimeout", 0), this._transport = e, this._participants = n, this._debug = r, this._logger = i, this.subscribe(e, J.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(t, lo.VOLUMES_DETECTED, this._onVolumesDetected.bind(this));
7960
7982
  }
@@ -7974,7 +7996,7 @@ var to = 90, no = 3, ro = class extends b {
7974
7996
  return this._transport.getTopology() === q.DIRECT ? ho : M.specListenerParams.volumeTimeout;
7975
7997
  }
7976
7998
  _onTransportStateChanged(e, t) {
7977
- t === K.OPENED && (this._connectionTimeout || (this._connectionTimeoutSuppressed = !1, this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), this._getConnectionTimeout()))), t === K.CONNECTED && (this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout())), this._volumeTimeout && (window.clearTimeout(this._volumeTimeout), this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout()))), t === K.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
7999
+ t === K.OPENED && (this._connectionTimeout || (this._connectionTimeoutSuppressed = !1, this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), this._getConnectionTimeout()))), t === K.CONNECTED && (this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout())), this._volumeTimeout && (window.clearTimeout(this._volumeTimeout), this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout()))), t === K.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
7978
8000
  }
7979
8001
  _onVolumesDetected(e) {
7980
8002
  Object.keys(e).forEach((t) => {
@@ -7994,14 +8016,14 @@ var to = 90, no = 3, ro = class extends b {
7994
8016
  }
7995
8017
  t = !0;
7996
8018
  }
7997
- }), this._connectionTimeoutSuppressed = e && !t, t && (this._debug.warn("There is not connected transport, send callSpecError"), this._logger?.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
8019
+ }), this._connectionTimeoutSuppressed = e && !t, t && (this._debug.warn("There is not connected transport, send callSpecError"), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
7998
8020
  }
7999
8021
  _onVolumeTimeout() {
8000
8022
  let e = [];
8001
8023
  Object.keys(this._volumes).forEach((t) => {
8002
8024
  if (this._volumes[t] > 0) return;
8003
8025
  let n = "UNKNOWN", r = this._participants[t];
8004
- r && r.platform && (n = r.platform), e.indexOf(n) < 0 && (e.push(n), this._logger?.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_VOLUME_TIMEOUT_${n}`));
8026
+ r && r.platform && (n = r.platform), e.indexOf(n) < 0 && (e.push(n), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_VOLUME_TIMEOUT_${n}`));
8005
8027
  }), e.length && this._debug.warn("There is silent participant, send callSpecError"), this._volumeTimeout = 0;
8006
8028
  }
8007
8029
  }, _o = class extends f {
@@ -8380,7 +8402,7 @@ var to = 90, no = 3, ro = class extends b {
8380
8402
  call_type: this._callType
8381
8403
  }));
8382
8404
  }
8383
- }, Do = 1e3, Oo = 1e4, ko = 15, Q = class e extends b {
8405
+ }, Do = 1e3, Oo = 1e4, ko = 15, Q = class e extends y {
8384
8406
  constructor(e, t) {
8385
8407
  super(), h(this, "_api", void 0), h(this, "_signaling", void 0), h(this, "_signalingActor", void 0), h(this, "_displayLayoutRequester", void 0), h(this, "_mediaSource", null), h(this, "_conversation", null), h(this, "_myLastRequestedLayouts", {}), h(this, "_state", "IDLE"), h(this, "_previousState", null), h(this, "_waitingHallHoldPending", !1), h(this, "_participantState", X.CALLED), h(this, "_participants", {}), h(this, "_pendingParticipants", /* @__PURE__ */ new Map()), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_debug", R.createSessionLogger()), h(this, "_volumesDetector", null), h(this, "_speakerDetector", null), h(this, "_localVolumeDetector", null), h(this, "_specListener", null), h(this, "_activeSpeakerId", null), h(this, "_lastSignalledActiveSpeakerId", null), h(this, "_isRealTimeAsrRequested", !1), h(this, "_serverSettings", Cr()), h(this, "_serverTimeOffset", 0), h(this, "_delayedHangup", !1), h(this, "_abortController", null), h(this, "_onUnload", void 0), h(this, "_audioOutput", void 0), h(this, "_stats", void 0), h(this, "_lastStalled", {}), h(this, "_audioMixStalled", !1), h(this, "_audioFix", null), h(this, "_streamByStreamId", /* @__PURE__ */ new Map()), h(this, "_streamIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_streamWaitTimerByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_sequenceNumberByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownTimestampByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownQueueCleanupTimer", null), h(this, "_statFirstMediaReceived", void 0), h(this, "_changeMediaSettings", j.debounce(async (e) => {
8386
8408
  if (this._signaling.ready) try {
@@ -8442,7 +8464,7 @@ var to = 90, no = 3, ro = class extends b {
8442
8464
  try {
8443
8465
  this._mediaSource = this._createMediaSource(), await this._mediaSource.request(n);
8444
8466
  let d = this._mediaSource.mediaSettings;
8445
- t === Oa.CHAT || e && e.length > 1 ? this._logWithMediaSettings(C.OUTGOING_MULTIPARTY_CALL, d) : this._logWithMediaSettings(C.OUTGOING_CALL, d);
8467
+ t === Oa.CHAT || e && e.length > 1 ? this._logWithMediaSettings(S.OUTGOING_MULTIPARTY_CALL, d) : this._logWithMediaSettings(S.OUTGOING_CALL, d);
8446
8468
  let f = await this._startConversation({
8447
8469
  opponentIds: e,
8448
8470
  opponentType: t,
@@ -8476,7 +8498,7 @@ var to = 90, no = 3, ro = class extends b {
8476
8498
  if (n && M.videoTracksCount > 0) throw this._debug.error("Observer mode: please set videoTracksCount=0"), new O(D.UNSUPPORTED);
8477
8499
  this._mediaSource = this._createMediaSource(), await this._mediaSource.request(e.mediaOptions, !n);
8478
8500
  let r = this._mediaSource.mediaSettings;
8479
- this._logWithMediaSettings(C.JOIN_CONVERSATION, r);
8501
+ this._logWithMediaSettings(S.JOIN_CONVERSATION, r);
8480
8502
  let i = await this._joinConversation(e, t);
8481
8503
  if (!this._conversation) throw new O(D.UNKNOWN_ERROR);
8482
8504
  return this._conversation.observer = n, L.onLocalStream(this._mediaSource.getStream(), r, this.id), this._conversation.waitForAdmin || this._conversation.waitingHall ? (this._debug.log(this._conversation.waitForAdmin ? "Wait for admin" : "In waiting hall"), z.add(this), Ao = null, this._signaling.readyToSend(), L.onLocalStatus(this._conversation.waitForAdmin ? N.WAIT_FOR_ADMIN : N.WAITING_HALL, this.id), this._conversation) : this._onJoinPart2(i);
@@ -8518,8 +8540,8 @@ var to = 90, no = 3, ro = class extends b {
8518
8540
  try {
8519
8541
  let a = Date.now(), o = await this._prepareConversation(e, t, n, r, i);
8520
8542
  if (this._mediaSource = this._createMediaSource(), !this._conversation) throw new O(D.UNKNOWN_ERROR);
8521
- if (!o.conversation.participants.find((e) => e.state === X.CALLED && e.id === this._conversation?.userId)) throw this._debug.log("Push rejected (there is an active call)"), this._stats.logger.log(C.PUSH, "rejected"), new O(D.REJECTED);
8522
- if (await this._processConnection(o), this._extractConnectionUrlSharingInfo(o), await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), await this._processPinnedParticipants(o), this._signaling.readyToSend(), this._logCallStartEvent(a, Y.INCOMING), this._stats.logger.log(C.PUSH, "accepted"), z.add(this), Ao = null, this._delayedHangup) throw new O(D.CANCELED);
8543
+ if (!o.conversation.participants.find((e) => e.state === X.CALLED && e.id === this._conversation?.userId)) throw this._debug.log("Push rejected (there is an active call)"), this._stats.logger.log(S.PUSH, "rejected"), new O(D.REJECTED);
8544
+ if (await this._processConnection(o), this._extractConnectionUrlSharingInfo(o), await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), await this._processPinnedParticipants(o), this._signaling.readyToSend(), this._logCallStartEvent(a, Y.INCOMING), this._stats.logger.log(S.PUSH, "accepted"), z.add(this), Ao = null, this._delayedHangup) throw new O(D.CANCELED);
8523
8545
  } catch (e) {
8524
8546
  throw Ao = null, this._close(e, "Unable to handle inbound call push"), e;
8525
8547
  }
@@ -8546,7 +8568,7 @@ var to = 90, no = 3, ro = class extends b {
8546
8568
  if (!this._mediaSource || !this._conversation || !this._transport) throw new O(D.UNKNOWN_ERROR);
8547
8569
  this._state = "PROCESSING";
8548
8570
  let e = this._mediaSource.mediaSettings;
8549
- this._logWithMediaSettings(C.ACCEPT_CONCURRENT, e), this._debug.debug("Concurrent call", { conversationId: this._conversation.id });
8571
+ this._logWithMediaSettings(S.ACCEPT_CONCURRENT, e), this._debug.debug("Concurrent call", { conversationId: this._conversation.id });
8550
8572
  try {
8551
8573
  this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(this._mediaSource.mediaSettings), L.onCallAccepted(this.id), this._state = "ACTIVE", this._participantState = X.ACCEPTED, this._changeFeatureSet(), this._openTransport(Object.values(await this._getParticipants()), !0);
8552
8574
  } catch (e) {
@@ -8593,13 +8615,13 @@ var to = 90, no = 3, ro = class extends b {
8593
8615
  });
8594
8616
  }
8595
8617
  async accept(e) {
8596
- if (this._state !== "IDLE") throw this._stats.logger.log(C.ERROR, "acceptIncoming"), this._debug.error("Unable to accept a call - invalid state"), Error("Unable to accept a call - invalid state");
8618
+ if (this._state !== "IDLE") throw this._stats.logger.log(S.ERROR, "acceptIncoming"), this._debug.error("Unable to accept a call - invalid state"), Error("Unable to accept a call - invalid state");
8597
8619
  if (!this._mediaSource || !this._conversation || !this._transport) throw new O(D.UNKNOWN_ERROR);
8598
8620
  this._state = "PROCESSING", this._debug.setConversationId(this._conversation.id), this._debug.debug("Accept incoming call", e);
8599
8621
  try {
8600
8622
  await this._mediaSource.request(e);
8601
8623
  let t = this._mediaSource.mediaSettings;
8602
- this._logWithMediaSettings(C.ACCEPT_INCOMING, t), this._changeMediaSettings(t), this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(t), this._participantState = X.ACCEPTED;
8624
+ this._logWithMediaSettings(S.ACCEPT_INCOMING, t), this._changeMediaSettings(t), this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(t), this._participantState = X.ACCEPTED;
8603
8625
  let n = this._getMuteStatesForCurrentRoom(), r = Object.keys(n);
8604
8626
  r.length && this._onMuteParticipant({
8605
8627
  muteStates: n,
@@ -8631,13 +8653,13 @@ var to = 90, no = 3, ro = class extends b {
8631
8653
  }
8632
8654
  }
8633
8655
  async decline() {
8634
- if (this._state !== "IDLE") throw this._stats.logger.log(C.ERROR, "declineIncoming"), this._debug.error("Unable to decline a call - invalid state"), Error("Unable to decline a call - invalid state");
8635
- this._state = "PROCESSING", this._debug.debug("Decline incoming call"), this._logWithMediaSettings(C.DECLINE_INCOMING, this.mediaSettings), this._participantState = X.HUNGUP, this._signaling.ready && await this._signaling.hangup(D.REJECTED), this._close(new O(D.REJECTED));
8656
+ if (this._state !== "IDLE") throw this._stats.logger.log(S.ERROR, "declineIncoming"), this._debug.error("Unable to decline a call - invalid state"), Error("Unable to decline a call - invalid state");
8657
+ this._state = "PROCESSING", this._debug.debug("Decline incoming call"), this._logWithMediaSettings(S.DECLINE_INCOMING, this.mediaSettings), this._participantState = X.HUNGUP, this._signaling.ready && await this._signaling.hangup(D.REJECTED), this._close(new O(D.REJECTED));
8636
8658
  }
8637
8659
  async hangup() {
8638
8660
  this._debug.debug("Hangup");
8639
8661
  let e = this._state === "ACTIVE" || this._state === "HELD" ? D.HUNGUP : D.CANCELED;
8640
- this._stats.logger.log(C.HANGUP, e), this._signaling.ready ? (await this._signaling.hangup(e), this._close(new O(e))) : L.onHangup(new O(D.HUNGUP), this._conversation && this._conversation.id), this._conversation?.id && z.has(this._conversation.id) && z.remove(this._conversation.id);
8662
+ this._stats.logger.log(S.HANGUP, e), this._signaling.ready ? (await this._signaling.hangup(e), this._close(new O(e))) : L.onHangup(new O(D.HUNGUP), this._conversation && this._conversation.id), this._conversation?.id && z.has(this._conversation.id) && z.remove(this._conversation.id);
8641
8663
  }
8642
8664
  async addParticipant(e, t) {
8643
8665
  if (!this._signaling.ready) {
@@ -8676,7 +8698,7 @@ var to = 90, no = 3, ro = class extends b {
8676
8698
  r.length ? this._transport.open(r, null, !!this._conversation?.observer) : this._transport.getTopology() === q.SERVER && this._forceOpenTransportForAloneInCall();
8677
8699
  }
8678
8700
  async _close(e, t) {
8679
- t && this._debug.error(t, e), this._debug.debug("Close conversation", e), this._stats.logHangup(e, this._transport?.getTopology()), this._stats.flushCallMetrics(this._transport?.getTopology()), this._signaling.readyToSend(!1), e.error ? this._signaling.ready && this._signaling.hangup(D.FAILED) : this._stats.logger.log(C.ERROR, e.hangup);
8701
+ t && this._debug.error(t, e), this._debug.debug("Close conversation", e), this._stats.logHangup(e, this._transport?.getTopology()), this._stats.flushCallMetrics(this._transport?.getTopology()), this._signaling.readyToSend(!1), e.error ? this._signaling.ready && this._signaling.hangup(D.FAILED) : this._stats.logger.log(S.ERROR, e.hangup);
8680
8702
  let n = this._conversation && this._conversation.id;
8681
8703
  if ([
8682
8704
  D.CANCELED,
@@ -8751,7 +8773,7 @@ var to = 90, no = 3, ro = class extends b {
8751
8773
  opponentType: t,
8752
8774
  direction: n
8753
8775
  });
8754
- let p = r.includes(S.VIDEO), m;
8776
+ let p = r.includes(x.VIDEO), m;
8755
8777
  if (u) {
8756
8778
  let e = {
8757
8779
  deviceId: this._api.deviceId(),
@@ -8809,7 +8831,7 @@ var to = 90, no = 3, ro = class extends b {
8809
8831
  joinLink: a,
8810
8832
  observedIds: o
8811
8833
  }), n && z.has(n)) throw new O(D.HAS_ACTIVE_CALL);
8812
- let l = r.includes(S.VIDEO), u, d;
8834
+ let l = r.includes(x.VIDEO), u, d;
8813
8835
  if (c) {
8814
8836
  if (!a) throw new O(D.FAST_JOIN_ERROR, { message: "joinLink is required for fast join" });
8815
8837
  let e = {
@@ -8880,7 +8902,7 @@ var to = 90, no = 3, ro = class extends b {
8880
8902
  o = n.device_idx || 0, s = i ?? `${M.wssBase}?userId=${a}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${M.wssToken}`, s = this._addGeoParamsToEndpoint(s, n), l.token = n.token, l.endpoint = s, l.device_idx = o, M.wtsBase && (c = `${M.wtsBase}?userId=${a}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${M.wssToken}`, c = this._addGeoParamsToEndpoint(c, n), l.wt_endpoint = c);
8881
8903
  }
8882
8904
  let u = await this._connectSignaling(dr.ACCEPT, l);
8883
- return z.callsLength >= M.maxParallelCalls || !M.hold && z.callsLength > 0 ? (this._debug.log("Push rejected (busy)"), this._stats.logger.log(C.PUSH, "busy"), this._signaling.ready && this._signaling.hangup(D.BUSY), Promise.reject(new O(D.BUSY))) : (await this._setConversation(l, u, Y.INCOMING, t), u);
8905
+ return z.callsLength >= M.maxParallelCalls || !M.hold && z.callsLength > 0 ? (this._debug.log("Push rejected (busy)"), this._stats.logger.log(S.PUSH, "busy"), this._signaling.ready && this._signaling.hangup(D.BUSY), Promise.reject(new O(D.BUSY))) : (await this._setConversation(l, u, Y.INCOMING, t), u);
8884
8906
  }
8885
8907
  async _createParticipant(e, t) {
8886
8908
  let n = Object.assign({
@@ -8960,7 +8982,7 @@ var to = 90, no = 3, ro = class extends b {
8960
8982
  audienceMode: this._isAudienceMode(t),
8961
8983
  restricted: this._isRestricted(t),
8962
8984
  urlSharingInfoByRoom: /* @__PURE__ */ new Map()
8963
- }, this._debug.setConversationId(t.conversation.id || e.id), this._signaling.setConversationId(this._conversation.id), e.p2p_forbidden && (M.forceRelayPolicy = e.p2p_forbidden), this._stats.logger.log(C.RELAY_POLICY, M.forceRelayPolicy ? "1" : "0"), this._changeFeatureSet(), this._changeFeaturesPerRole(), this._logDevices();
8985
+ }, this._debug.setConversationId(t.conversation.id || e.id), this._signaling.setConversationId(this._conversation.id), e.p2p_forbidden && (M.forceRelayPolicy = e.p2p_forbidden), this._stats.logger.log(S.RELAY_POLICY, M.forceRelayPolicy ? "1" : "0"), this._changeFeatureSet(), this._changeFeaturesPerRole(), this._logDevices();
8964
8986
  }
8965
8987
  _updateConversation(e) {
8966
8988
  if (!this._conversation) throw new O(D.UNKNOWN_ERROR);
@@ -9138,7 +9160,7 @@ var to = 90, no = 3, ro = class extends b {
9138
9160
  }
9139
9161
  _logDevices() {
9140
9162
  let e = T.getCameras().length, t = T.getMicrophones().length;
9141
- this._debug.debug("Cameras: " + e + (T.hasCameraPermission() ? "✔" : "✖") + ", Microphones: " + t + (T.hasMicrophonePermission() ? "✔" : "✖")), this._stats.logger.log(C.DEVICES, `${e}_${t}`);
9163
+ this._debug.debug("Cameras: " + e + (T.hasCameraPermission() ? "✔" : "✖") + ", Microphones: " + t + (T.hasMicrophonePermission() ? "✔" : "✖")), this._stats.logger.log(S.DEVICES, `${e}_${t}`);
9142
9164
  }
9143
9165
  _logWithMediaSettings(e, t) {
9144
9166
  this._stats.logger.log(e, [t?.isAudioEnabled && "audio", t?.isVideoEnabled && "video"].filter(Boolean).join("_"));
@@ -9176,9 +9198,6 @@ var to = 90, no = 3, ro = class extends b {
9176
9198
  _cleanupTransport() {
9177
9199
  this._transport && (this._transport.destroy(), this._transport = null), this._debugInfo && (this._debugInfo = null);
9178
9200
  }
9179
- _cleanupTransportForHold() {
9180
- this._transport && (this._transport.holdClose(), this._transport = null), this._debugInfo && (this._debugInfo = null), this._cleanupSpeakerDetector(), this._cleanupSpecListener();
9181
- }
9182
9201
  _cleanupSpeakerDetector() {
9183
9202
  this._speakerDetector && (this._speakerDetector.destroy(), this._speakerDetector = null), this._volumesDetector && (this._volumesDetector.destroy(), this._volumesDetector = null), this._localVolumeDetector && (this._localVolumeDetector.destroy(), this._localVolumeDetector = null);
9184
9203
  }
@@ -9208,7 +9227,7 @@ var to = 90, no = 3, ro = class extends b {
9208
9227
  observedIds: t.observedIds || []
9209
9228
  }, n), r = await this._getParticipant(e);
9210
9229
  }
9211
- this._setParticipantsStatus([r], N.WAITING), n ? (r.state = X.HUNGUP, await this._removeParticipant(r, n)) : this._transport && (r.state = X.CALLED, this._transport.allocate(r.id, !0), this._stats.logger.log(C.ADD_PARTICIPANT), this._invokeRolesChangedCallbackIfNeeded(r));
9230
+ this._setParticipantsStatus([r], N.WAITING), n ? (r.state = X.HUNGUP, await this._removeParticipant(r, n)) : this._transport && (r.state = X.CALLED, this._transport.allocate(r.id, !0), this._stats.logger.log(S.ADD_PARTICIPANT), this._invokeRolesChangedCallbackIfNeeded(r));
9212
9231
  }
9213
9232
  async _onRemoveParticipant(e) {
9214
9233
  this._debug.debug(`Remove participant [${e}]`);
@@ -9222,19 +9241,19 @@ var to = 90, no = 3, ro = class extends b {
9222
9241
  return;
9223
9242
  }
9224
9243
  if (this._transport) for (let e of t) this._transport.close(e.id);
9225
- this._stats.logger.log(C.REMOVE_PARTICIPANT);
9244
+ this._stats.logger.log(S.REMOVE_PARTICIPANT);
9226
9245
  }
9227
9246
  async changeDevice(e) {
9228
- return e === "audiooutput" ? this._audioOutput.changeOutput() : this._mediaSource ? this._mediaSource.changeDevice(e) : Promise.reject(x.UNKNOWN);
9247
+ return e === "audiooutput" ? this._audioOutput.changeOutput() : this._mediaSource ? this._mediaSource.changeDevice(e) : Promise.reject(b.UNKNOWN);
9229
9248
  }
9230
9249
  stopVideoTrack() {
9231
9250
  return this._mediaSource?.stopVideoTrack();
9232
9251
  }
9233
9252
  async toggleScreenCapturing(e) {
9234
- return this._mediaSource ? this._mediaSource.toggleScreenCapturing(e) : Promise.reject(x.UNKNOWN);
9253
+ return this._mediaSource ? this._mediaSource.toggleScreenCapturing(e) : Promise.reject(b.UNKNOWN);
9235
9254
  }
9236
9255
  async disableScreenCapturing() {
9237
- return this._mediaSource ? this._mediaSource.disableScreenCapturing() : Promise.reject(x.UNKNOWN);
9256
+ return this._mediaSource ? this._mediaSource.disableScreenCapturing() : Promise.reject(b.UNKNOWN);
9238
9257
  }
9239
9258
  toggleAnimojiCapturing(e) {
9240
9259
  this._mediaSource && this._mediaSource.toggleAnimojiCapturing(e);
@@ -9266,10 +9285,10 @@ var to = 90, no = 3, ro = class extends b {
9266
9285
  if (this._mediaSource) return this._mediaSource.setAudioStream(e);
9267
9286
  }
9268
9287
  async toggleLocalVideo(e) {
9269
- if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
9288
+ if (this._mediaSource) return this._stats.logger.log(S.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
9270
9289
  }
9271
9290
  async toggleLocalAudio(e) {
9272
- if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "audio_1" : "audio_0"), this._mediaSource.toggleAudio(e);
9291
+ if (!(e && this._state === "HELD") && this._mediaSource) return this._stats.logger.log(S.MEDIA_STATUS, e ? "audio_1" : "audio_0"), this._mediaSource.toggleAudio(e);
9273
9292
  }
9274
9293
  async changePriorities(e) {
9275
9294
  if (e.length < 2 || !this._signaling.ready) return;
@@ -9299,22 +9318,25 @@ var to = 90, no = 3, ro = class extends b {
9299
9318
  return;
9300
9319
  }
9301
9320
  if (this._isWaitingForPromotion()) {
9302
- this._waitingHallHoldPending = !1, await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), await this._resumeLocalMedia(t, this._getWaitingForPromotionStatus());
9321
+ this._waitingHallHoldPending = !1, await this._resumeLocalMedia(t, this._getWaitingForPromotionStatus());
9303
9322
  return;
9304
9323
  }
9305
9324
  let n = ua.get();
9306
9325
  await this._signaling.hold(!1, n), this._restoreStateAfterHold();
9307
9326
  let r = null;
9308
- if (this._state === "IDLE" && this._participantState === X.ACCEPTED && (r = Object.values(await this._getParticipants()), r.some((e) => e.state === X.ACCEPTED) && (this._state = "ACTIVE", this._changeFeatureSet())), await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), await this._resumeLocalMedia(t, N.WAITING), this._state === "ACTIVE") {
9327
+ if (this._state === "IDLE" && this._participantState === X.ACCEPTED && (r = Object.values(await this._getParticipants()), r.some((e) => e.state === X.ACCEPTED) && (this._state = "ACTIVE", this._changeFeatureSet())), await this._resumeLocalMedia(t, N.WAITING), this._state === "ACTIVE") {
9309
9328
  let e = this._conversation?.direction === Y.OUTGOING && !this._conversation.concurrent;
9310
9329
  this._openTransport(r ?? Object.values(await this._getParticipants()), e);
9311
9330
  }
9312
9331
  }
9313
9332
  async _holdLocally() {
9314
- this._state !== "HELD" && (this._previousState = this._state, this._state = "HELD"), await this._mediaSource?.stopLocalMedia(), this._cleanupTransportForHold(), L.onLocalStatus(N.ONHOLD, this.id);
9333
+ this._state !== "HELD" && (this._previousState = this._state, this._state = "HELD"), this._audioFix?.disable(), this._setOutgoingAudioEnabled(!1), await this._mediaSource?.stopLocalMedia(), L.onLocalStatus(N.ONHOLD, this.id);
9315
9334
  }
9316
9335
  async _resumeLocalMedia(e, t) {
9317
- this._restoreStateAfterHold(), await this._mediaSource?.resumeLocalMedia(e), L.onLocalStatus(t, this.id), this._mediaSource && L.onLocalStream(this._mediaSource?.getStream() ?? null, this._mediaSource.mediaSettings, this.id);
9336
+ this._restoreStateAfterHold(), this._setOutgoingAudioEnabled(!0), await this._mediaSource?.resumeLocalMedia(e), L.onLocalStatus(t, this.id), this._mediaSource && L.onLocalStream(this._mediaSource?.getStream() ?? null, this._mediaSource.mediaSettings, this.id);
9337
+ }
9338
+ _setOutgoingAudioEnabled(e) {
9339
+ this._transport?.setOutgoingAudioEnabled(e);
9318
9340
  }
9319
9341
  _restoreStateAfterHold() {
9320
9342
  this._state === "HELD" && (this._state = this._previousState || "ACTIVE", this._previousState = null);
@@ -9419,7 +9441,7 @@ var to = 90, no = 3, ro = class extends b {
9419
9441
  L.onRemoteScreenStream(r.externalId, null, this.id);
9420
9442
  break;
9421
9443
  }
9422
- this._stats.logger.log(C.PAT_DEALLOCATED);
9444
+ this._stats.logger.log(S.PAT_DEALLOCATED);
9423
9445
  } else this._debug.log(`Cannot find participant to stop streaming: ${n.participantId}`);
9424
9446
  }
9425
9447
  this._streamIdByStreamDescription.delete(e);
@@ -9600,7 +9622,7 @@ var to = 90, no = 3, ro = class extends b {
9600
9622
  }
9601
9623
  let a = Tn(t), o = this._sequenceNumberByStreamDescription.get(a);
9602
9624
  if (o && o > e.sequenceNumber) {
9603
- this._debug.warn(`Participant ${r} received outdated PAT response: sequence number ${e.sequenceNumber}; last sent sequence number for given participant is ${o}`), this._stats.logger.log(C.PAT_OUTDATED_RESPONSE);
9625
+ this._debug.warn(`Participant ${r} received outdated PAT response: sequence number ${e.sequenceNumber}; last sent sequence number for given participant is ${o}`), this._stats.logger.log(S.PAT_OUTDATED_RESPONSE);
9604
9626
  return;
9605
9627
  }
9606
9628
  i && e.suspend !== void 0 && n && (this._debug.debug(`participant-sources-update: mediaType=${n}, suspend=${e.suspend}`), L.onRemoteStreamSuspended(i.externalId, n, e.suspend, this.id));
@@ -9609,15 +9631,15 @@ var to = 90, no = 3, ro = class extends b {
9609
9631
  this._streamWaitTimerByStreamDescription.delete(a);
9610
9632
  let t = this._conversation?.externalId, n = this._isMe(r);
9611
9633
  if (!i && !n) {
9612
- this._stats.logger.log(C.PAT_ERROR, "participantMissing"), this._debug.error(`Could not find participant by ID: ${r}`);
9634
+ this._stats.logger.log(S.PAT_ERROR, "participantMissing"), this._debug.error(`Could not find participant by ID: ${r}`);
9613
9635
  return;
9614
9636
  }
9615
9637
  let o = n ? t : i.externalId, c = this._streamByStreamId.get(s);
9616
9638
  if (!c) {
9617
- this._stats.logger.log(C.PAT_ERROR, "streamNotFound"), this._debug.error(`Could not find stream by ID: ${s}`);
9639
+ this._stats.logger.log(S.PAT_ERROR, "streamNotFound"), this._debug.error(`Could not find stream by ID: ${s}`);
9618
9640
  return;
9619
9641
  }
9620
- this._stats.logger.log(C.PAT_ALLOCATED), this._streamIdByStreamDescription.set(a, s);
9642
+ this._stats.logger.log(S.PAT_ALLOCATED), this._streamIdByStreamDescription.set(a, s);
9621
9643
  let l = e.participantStreamDescription?.mediaType;
9622
9644
  if (l === V.STREAM || l === V.MOVIE) {
9623
9645
  if (e.participantStreamDescription?.streamName) {
@@ -9944,7 +9966,7 @@ var to = 90, no = 3, ro = class extends b {
9944
9966
  return this._debug.debug("Get initial participant list chunk", n.chunk), n.chunk;
9945
9967
  }
9946
9968
  _onLocalMediaStreamChanged(e) {
9947
- if (!this._conversation || !this._mediaSource) return;
9969
+ if (!this._conversation || !this._mediaSource || this._state === "HELD") return;
9948
9970
  let t = this._mediaSource.mediaSettings;
9949
9971
  this._debug.debug("Local media stream changed", t), e.kind === k.audio && this._mediaSource && (this._audioFix = new Xa(this._mediaSource, this._debug, this._stats.logger)), L.onLocalStreamUpdate(t, e.kind, this.id), !this._conversation?.waitingHall && !this._conversation?.observer && !this._isAudienceModeListener() && this._changeMediaSettings(t);
9950
9972
  }
@@ -10052,12 +10074,8 @@ var to = 90, no = 3, ro = class extends b {
10052
10074
  case G.DECORATIVE_PARTICIPANT_ID_CHANGED: return this._onDecorativeParticipantIdChanged(e);
10053
10075
  case G.VIDEO_SUSPEND_SUGGEST: return this._onVideoSuspendSuggest(e);
10054
10076
  case G.HOLD: return this._onParticipantHold(e);
10055
- case G.TOPOLOGY_CHANGED: return this._onSignalingTopologyChanged(e);
10056
10077
  }
10057
10078
  }
10058
- _onSignalingTopologyChanged(e) {
10059
- this._conversation && e.topology !== this._conversation.topology && (this._debug.log(`Signaling topology changed while transport is down: ${this._conversation.topology} -> ${e.topology}`), this._conversation.topology = e.topology);
10060
- }
10061
10079
  async _onPromotionApproved(e) {
10062
10080
  let t = await this._getExternalIdByParticipantId(e.adminId);
10063
10081
  if (!t) {
@@ -10124,7 +10142,7 @@ var to = 90, no = 3, ro = class extends b {
10124
10142
  mediaSettings: E(e.mediaSettings)
10125
10143
  }, i));
10126
10144
  }
10127
- r.state = X.ACCEPTED, r.mediaSettings = E(e.mediaSettings), this._logWithMediaSettings(C.ACCEPTED_OUTGOING, r.mediaSettings), this._conversation && this._conversation.direction === Y.OUTGOING && (this._state === "IDLE" || this._state === "PROCESSING") && (this._state = "ACTIVE", this._changeFeatureSet()), this._state === "ACTIVE" && this._transport && this._transport.open([r.id], n), await this._changeRemoteMediaSettings(t, r.mediaSettings), await this._changeRemoteParticipantState(t);
10145
+ r.state = X.ACCEPTED, r.mediaSettings = E(e.mediaSettings), this._logWithMediaSettings(S.ACCEPTED_OUTGOING, r.mediaSettings), this._conversation && this._conversation.direction === Y.OUTGOING && (this._state === "IDLE" || this._state === "PROCESSING") && (this._state = "ACTIVE", this._changeFeatureSet()), this._state === "ACTIVE" && this._transport && this._transport.open([r.id], n), await this._changeRemoteMediaSettings(t, r.mediaSettings), await this._changeRemoteParticipantState(t);
10128
10146
  let i = Object.keys(r.muteStates);
10129
10147
  i.length && this._onMuteParticipant({
10130
10148
  muteStates: r.muteStates,
@@ -10276,7 +10294,7 @@ var to = 90, no = 3, ro = class extends b {
10276
10294
  n && (n.clientType = e.clientType, n.platform = e.platform), L.onPeerRegistered(this.id);
10277
10295
  }
10278
10296
  async _onMicSwitched(e) {
10279
- L.onDeviceSwitched(S.AUDIO, !e.mute, this.id), await this.toggleLocalAudio(!e.mute);
10297
+ L.onDeviceSwitched(x.AUDIO, !e.mute, this.id), await this.toggleLocalAudio(!e.mute);
10280
10298
  }
10281
10299
  async _onChatMessage(e) {
10282
10300
  let t = j.composeMessageId(e), n = await this._getExternalIdByParticipantId(t);
@@ -10441,17 +10459,17 @@ var to = 90, no = 3, ro = class extends b {
10441
10459
  for (let [e, i] of d) {
10442
10460
  let a = this._isCallAdmin() && n;
10443
10461
  if (!(i !== Pa.MUTE && i !== Pa.MUTE_PERMANENT || a) && (this._isCallAdmin() && i === Pa.MUTE_PERMANENT && !n && (l[e] = Pa.MUTE), !(!t.includes(e) || r))) switch (e) {
10444
- case S.VIDEO:
10445
- u.isVideoEnabled && (L.onDeviceSwitched(S.VIDEO, !1, this.id), await this.toggleLocalVideo(!1));
10462
+ case x.VIDEO:
10463
+ u.isVideoEnabled && (L.onDeviceSwitched(x.VIDEO, !1, this.id), await this.toggleLocalVideo(!1));
10446
10464
  break;
10447
- case S.AUDIO:
10448
- u.isAudioEnabled && (L.onDeviceSwitched(S.AUDIO, !1, this.id), await this.toggleLocalAudio(!1));
10465
+ case x.AUDIO:
10466
+ u.isAudioEnabled && (L.onDeviceSwitched(x.AUDIO, !1, this.id), await this.toggleLocalAudio(!1));
10449
10467
  break;
10450
- case S.SCREEN_SHARING:
10451
- u.isScreenSharingEnabled && (L.onDeviceSwitched(S.SCREEN_SHARING, !1, this.id), await this.disableScreenCapturing());
10468
+ case x.SCREEN_SHARING:
10469
+ u.isScreenSharingEnabled && (L.onDeviceSwitched(x.SCREEN_SHARING, !1, this.id), await this.disableScreenCapturing());
10452
10470
  break;
10453
- case S.AUDIO_SHARING:
10454
- u.isAudioSharingEnabled && (L.onDeviceSwitched(S.AUDIO_SHARING, !1, this.id), await this.toggleScreenCapturing({
10471
+ case x.AUDIO_SHARING:
10472
+ u.isAudioSharingEnabled && (L.onDeviceSwitched(x.AUDIO_SHARING, !1, this.id), await this.toggleScreenCapturing({
10455
10473
  captureScreen: u.isScreenSharingEnabled,
10456
10474
  fastScreenSharing: u.isFastScreenSharingEnabled,
10457
10475
  captureAudio: !1
@@ -10528,7 +10546,7 @@ var to = 90, no = 3, ro = class extends b {
10528
10546
  }
10529
10547
  }
10530
10548
  _onPeerConnectionClosed(e) {
10531
- this._state !== "HELD" && (e === q.SERVER && this._cleanupParticipantAgnosticStreams(), this._audioOutput.destroy());
10549
+ e === q.SERVER && this._cleanupParticipantAgnosticStreams(), this._audioOutput.destroy();
10532
10550
  }
10533
10551
  _changeFeatureSet() {
10534
10552
  if (this._conversation) {
@@ -10623,10 +10641,6 @@ var to = 90, no = 3, ro = class extends b {
10623
10641
  }
10624
10642
  _removeVideoTrack(e, t, n) {}
10625
10643
  _onTopologyChanged(e) {
10626
- if (this._state === "HELD") {
10627
- this._conversation && (this._conversation.topology = e);
10628
- return;
10629
- }
10630
10644
  this._statFirstMediaReceived.markTopologyChanged(e), e === q.DIRECT && (this._onRemoteSignalledStall([]), this._onAudioMixStall(!1)), this._conversation && (this._conversation.topology = e, this._changeFeatureSet(), this._forceOpenTransportForAloneInCall()), this._audioOutput.destroy();
10631
10645
  }
10632
10646
  _onAudioMixStall(e) {
@@ -10954,7 +10968,7 @@ async function Vo(e, t) {
10954
10968
  }
10955
10969
  }
10956
10970
  function Ho(e, t = {}, n = !1) {
10957
- t.method = e, t.format = "JSON", t.application_key || (t.application_key = M.apiKey), n || (y.sessionKey ? t.session_key = y.sessionKey : y.accessToken && (t.access_token = y.accessToken));
10971
+ t.method = e, t.format = "JSON", t.application_key || (t.application_key = M.apiKey), n || (v.sessionKey ? t.session_key = v.sessionKey : v.accessToken && (t.access_token = v.accessToken));
10958
10972
  for (let [e, n] of Object.entries(t)) typeof n == "object" && (t[e] = JSON.stringify(n));
10959
10973
  let r = "";
10960
10974
  for (let [e, n] of Object.entries(t)) r && (r += "&"), r += `${e}=${encodeURIComponent(n)}`;
@@ -11069,7 +11083,7 @@ var Uo = class {
11069
11083
  return await this._callUnsafe(e, t, n);
11070
11084
  } catch (r) {
11071
11085
  R.warn("Api call error", r);
11072
- let i = x.API;
11086
+ let i = b.API;
11073
11087
  switch (r.error_code) {
11074
11088
  case 102:
11075
11089
  case 103:
@@ -11115,10 +11129,10 @@ var Uo = class {
11115
11129
  }
11116
11130
  async userId(e) {
11117
11131
  let t = j.extractOkId(e);
11118
- return y.isEmpty() ? Z.fromId(String(t)) : (this._idCache.hasByOkId(t) || await this._getExternalIdsByOkIds([t]), this._idCache.getExternalId(t) || Z.fromId(String(t)));
11132
+ return v.isEmpty() ? Z.fromId(String(t)) : (this._idCache.hasByOkId(t) || await this._getExternalIdsByOkIds([t]), this._idCache.getExternalId(t) || Z.fromId(String(t)));
11119
11133
  }
11120
11134
  async authorize() {
11121
- if (this._ensureUuid(), !M.apiKey) throw new O(x.API, { message: "Required argument apiAppKey not passed" });
11135
+ if (this._ensureUuid(), !M.apiKey) throw new O(b.API, { message: "Required argument apiAppKey not passed" });
11122
11136
  let e = { session_data: {
11123
11137
  version: 2,
11124
11138
  device_id: this._uuid,
@@ -11126,9 +11140,9 @@ var Uo = class {
11126
11140
  client_type: "SDK_JS"
11127
11141
  } };
11128
11142
  return M.authToken && (e.session_data.auth_token = M.authToken, e.session_data.version = 3), this._callUnsafe("auth.anonymLogin", e, !0).then((e) => {
11129
- e.uid && (this._userId = Number(e.uid)), y.sessionKey = e.session_key, y.sessionSecretKey = e.session_secret_key;
11143
+ e.uid && (this._userId = Number(e.uid)), v.sessionKey = e.session_key, v.sessionSecretKey = e.session_secret_key;
11130
11144
  }).catch((e) => {
11131
- throw e.error_code === 401 && L.onTokenExpired(), new O(x.AUTH, {
11145
+ throw e.error_code === 401 && L.onTokenExpired(), new O(b.AUTH, {
11132
11146
  message: e.error_msg,
11133
11147
  code: e.error_code
11134
11148
  });
@@ -11216,8 +11230,8 @@ var Uo = class {
11216
11230
  }
11217
11231
  _ensureUuid() {
11218
11232
  if (!this._uuid) {
11219
- let e = at.get("uuid");
11220
- e || (e = j.uuid(), at.set("uuid", e)), this._uuid = String(e);
11233
+ let e = ot.get("uuid");
11234
+ e || (e = j.uuid(), ot.set("uuid", e)), this._uuid = String(e);
11221
11235
  }
11222
11236
  }
11223
11237
  deviceId() {
@@ -11436,10 +11450,10 @@ function as(e, t = null, n = {}, r = 1) {
11436
11450
  }, t && e.setSDK(t);
11437
11451
  }
11438
11452
  async function os(t) {
11439
- if (M.set(t), $ || ($ = new qo()), e.disableLog(!M.debug), R.toggle(M.debug), R.log(`Calls SDK ${M.sdkVersion}`, t), await T.init(), !T.isBrowserSupported()) throw new O(x.UNSUPPORTED);
11453
+ if (M.set(t), $ || ($ = new qo()), e.disableLog(!M.debug), R.toggle(M.debug), R.log(`Calls SDK ${M.sdkVersion}`, t), await T.init(), !T.isBrowserSupported()) throw new O(b.UNSUPPORTED);
11440
11454
  R.log("UserAgent:", navigator.userAgent), R.log("Screen resolution:", `${window.screen.width}x${window.screen.height}`), R.log("Permissions:", `Camera: ${T.hasCameraPermission()}, Mic: ${T.hasMicrophonePermission()}`), R.log("Simulcast:", `${t.simulcast} => ${M.simulcast}`);
11441
11455
  }
11442
- async function ss(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
11456
+ async function ss(e, t = [x.AUDIO], n = "", r = !1, i = !1, a, o, s) {
11443
11457
  let c = [];
11444
11458
  return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), cs([], Oa.USER, t, n, r, i, a, c, o, s);
11445
11459
  }
@@ -11468,14 +11482,14 @@ async function us(e, t = A.USER, n, r, i, a) {
11468
11482
  async function ds(e, t) {
11469
11483
  return e && (M.authToken = e), t !== void 0 && M.apiBaseUrl !== t && (M.apiBaseUrl = t, Po()), $.authorize();
11470
11484
  }
11471
- async function fs(e = [S.AUDIO], t) {
11485
+ async function fs(e = [x.AUDIO], t) {
11472
11486
  return Ic(t).accept(e);
11473
11487
  }
11474
11488
  async function ps(e) {
11475
11489
  let t = Fc(e);
11476
11490
  if (t) return t.decline();
11477
11491
  }
11478
- async function ms(e, t = [S.AUDIO]) {
11492
+ async function ms(e, t = [x.AUDIO]) {
11479
11493
  return hs(e, t);
11480
11494
  }
11481
11495
  async function hs(e, t, n) {
@@ -11486,7 +11500,7 @@ async function hs(e, t, n) {
11486
11500
  chatId: n
11487
11501
  });
11488
11502
  }
11489
- async function gs(e, t = [S.AUDIO], n, r, i, a) {
11503
+ async function gs(e, t = [x.AUDIO], n, r, i, a) {
11490
11504
  if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.FAILED);
11491
11505
  return n && (M.anonymToken = n), new Q($, $o).onJoin({
11492
11506
  joinLink: e,
@@ -11801,12 +11815,12 @@ function hc(e, ...t) {
11801
11815
  M.debugLog && R.send(e, "[external]", ...t);
11802
11816
  }
11803
11817
  var gc = {
11804
- list: Ne,
11805
- get: Pe,
11806
- getJson: Fe,
11807
- download: Ie,
11808
- clear: Le,
11809
- stats: Re
11818
+ list: Pe,
11819
+ get: Fe,
11820
+ getJson: Ie,
11821
+ download: Le,
11822
+ clear: Re,
11823
+ stats: ze
11810
11824
  };
11811
11825
  function _c() {
11812
11826
  let e = [
@@ -11828,7 +11842,7 @@ function _c() {
11828
11842
  async function vc() {
11829
11843
  let e = Q.id(), t = Q.debugSessionId();
11830
11844
  if (!t || !e) throw R.error("[uploadDebugLogs]", "No conversation id found"), Error("No conversation id found");
11831
- let n = await Pe({ sessionId: t });
11845
+ let n = await Fe({ sessionId: t });
11832
11846
  if (n.length === 0) throw R.error("[uploadDebugLogs]", "No logs found"), Error("No logs found");
11833
11847
  let r = n[0].t, i = n[n.length - 1].t;
11834
11848
  try {
@@ -11952,4 +11966,4 @@ function Kc() {
11952
11966
  }
11953
11967
  typeof window < "u" && (window.__CALLS_SDK = mn);
11954
11968
  //#endregion
11955
- export { qo as Api, Qo as ApiExternal, Zo as ArrayDequeue, y as AuthData, f as BaseLogger, Y as CallDirection, Oa as CallType, ka as ChatRoomEventType, Aa as ConversationFeature, ja as ConversationOption, _n as DebugMessageType, Ba as ExternalIdType, At as FacingMode, x as FatalError, O as HangupReason, D as HangupType, S as MediaOption, k as MediaTrackKind, V as MediaType, Pa as MuteState, X as ParticipantState, Xo as ParticipantStateDataValue, N as ParticipantStatus, Yo as RecordRole, Fa as RoomsEventType, Da as Signaling, B as SignalingCommandType, dr as SignalingConnectionType, G as SignalingNotification, q as TransportTopology, Ra as UserRole, A as UserType, oo as VolumeDetector, fs as acceptCall, Oc as acceptPromotion, uc as activateRooms, oc as addMovie, vs as addParticipant, ys as addParticipantInternal, ds as authorize, es as browser, cs as callInternal, ss as callTo, Cs as captureScreen, ws as captureVmoji, bc as changeAudioEffect, Us as changeConversationOptions, Ss as changeDevice, As as changeParticipantState, ks as changePriorities, yc as changeVideoEffect, Ks as chatHistory, Ws as chatMessage, Gs as chatMessageInternal, Zs as createJoinLink, qs as customData, Js as customDataInternal, mc as debug, gc as debugLogs, hc as debugMessage, ps as declineCall, Pc as enableFeatureForRoles, Vs as enableVideoSuspend, Hs as enableVideoSuspendSuggest, jc as feedback, tc as forceRelayPolicy, Wc as getActiveCallId, $s as getAnonymTokenByLink, Tc as getAudienceModeHands, kc as getParticipantListChunk, Ac as getParticipants, ac as getStreamInfo, Gc as getSyncedTime, wc as getWaitingHall, Ps as grantRoles, Fs as grantRolesInternal, _s as hangup, os as init, ms as joinCall, gs as joinCallByLink, hs as joinCallInternal, Nc as logClientEvent, Is as muteParticipant, Ls as muteParticipantInternal, Rs as pinParticipant, zs as pinParticipantInternal, ls as processPush, us as processPushInternal, Ec as promoteParticipant, ic as publishStream, js as putHandsDown, Lc as removeHistoryRecords, Qs as removeJoinLink, cc as removeMovie, bs as removeParticipant, xs as removeParticipantInternal, fc as removeRooms, Bc as requestAsr, Ns as requestDisplayLayout, Dc as requestPromotion, is as setAudioEffects, xc as setAudioStream, Os as setLocalResolution, ns as setLogger, Bs as setMediaModifiers, pc as setStatisticsInterval, rs as setVideoEffects, Ts as setVideoStream, as as setVmoji, Cc as setVmojiFill, Sc as setVmojiSvg, ec as setVolume, Rc as startAsr, Xs as startAudienceConversation, Ys as startConversation, nc as startStream, Vc as startUrlSharing, zc as stopAsr, rc as stopStream, Hc as stopUrlSharing, Uc as switchCall, dc as switchRoom, Ds as toggleLocalAudio, Es as toggleLocalVideo, Ms as updateDisplayLayout, sc as updateMovie, lc as updateRooms, vc as uploadDebugLogs, Mc as userFeedbackStats, ts as utils, Kc as version };
11969
+ export { qo as Api, Qo as ApiExternal, Zo as ArrayDequeue, v as AuthData, f as BaseLogger, Y as CallDirection, Oa as CallType, ka as ChatRoomEventType, Aa as ConversationFeature, ja as ConversationOption, _n as DebugMessageType, Ba as ExternalIdType, At as FacingMode, b as FatalError, O as HangupReason, D as HangupType, x as MediaOption, k as MediaTrackKind, V as MediaType, Pa as MuteState, X as ParticipantState, Xo as ParticipantStateDataValue, N as ParticipantStatus, Yo as RecordRole, Fa as RoomsEventType, Da as Signaling, B as SignalingCommandType, dr as SignalingConnectionType, G as SignalingNotification, q as TransportTopology, Ra as UserRole, A as UserType, oo as VolumeDetector, fs as acceptCall, Oc as acceptPromotion, uc as activateRooms, oc as addMovie, vs as addParticipant, ys as addParticipantInternal, ds as authorize, es as browser, cs as callInternal, ss as callTo, Cs as captureScreen, ws as captureVmoji, bc as changeAudioEffect, Us as changeConversationOptions, Ss as changeDevice, As as changeParticipantState, ks as changePriorities, yc as changeVideoEffect, Ks as chatHistory, Ws as chatMessage, Gs as chatMessageInternal, Zs as createJoinLink, qs as customData, Js as customDataInternal, mc as debug, gc as debugLogs, hc as debugMessage, ps as declineCall, Pc as enableFeatureForRoles, Vs as enableVideoSuspend, Hs as enableVideoSuspendSuggest, jc as feedback, tc as forceRelayPolicy, Wc as getActiveCallId, $s as getAnonymTokenByLink, Tc as getAudienceModeHands, kc as getParticipantListChunk, Ac as getParticipants, ac as getStreamInfo, Gc as getSyncedTime, wc as getWaitingHall, Ps as grantRoles, Fs as grantRolesInternal, _s as hangup, os as init, ms as joinCall, gs as joinCallByLink, hs as joinCallInternal, Nc as logClientEvent, Is as muteParticipant, Ls as muteParticipantInternal, Rs as pinParticipant, zs as pinParticipantInternal, ls as processPush, us as processPushInternal, Ec as promoteParticipant, ic as publishStream, js as putHandsDown, Lc as removeHistoryRecords, Qs as removeJoinLink, cc as removeMovie, bs as removeParticipant, xs as removeParticipantInternal, fc as removeRooms, Bc as requestAsr, Ns as requestDisplayLayout, Dc as requestPromotion, is as setAudioEffects, xc as setAudioStream, Os as setLocalResolution, ns as setLogger, Bs as setMediaModifiers, pc as setStatisticsInterval, rs as setVideoEffects, Ts as setVideoStream, as as setVmoji, Cc as setVmojiFill, Sc as setVmojiSvg, ec as setVolume, Rc as startAsr, Xs as startAudienceConversation, Ys as startConversation, nc as startStream, Vc as startUrlSharing, zc as stopAsr, rc as stopStream, Hc as stopUrlSharing, Uc as switchCall, dc as switchRoom, Ds as toggleLocalAudio, Es as toggleLocalVideo, Ms as updateDisplayLayout, sc as updateMovie, lc as updateRooms, vc as uploadDebugLogs, Mc as userFeedbackStats, ts as utils, Kc as version };