@vkontakte/calls-sdk 2.8.13-dev.ab19d582.0 → 2.8.13-dev.c9243c68.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.13-dev.ab19d582.0
3
- * Wed, 09 Sep 2026 14:22:53 GMT
2
+ * @vkontakte/calls-sdk v2.8.13-dev.c9243c68.0
3
+ * Wed, 09 Sep 2026 17:43:49 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -1029,7 +1029,7 @@ var w;
1029
1029
  function g() {
1030
1030
  if (!yt || yt.readyState === "ended") {
1031
1031
  let e = w.getAudioContext(), t = e.createMediaStreamDestination(), n = e.createGain();
1032
- n.gain.value = 1e-5, n.connect(t), w.browserName() === "Safari" && n.connect(e.destination);
1032
+ n.gain.value = 1e-5, n.connect(t), n.connect(e.destination);
1033
1033
  let r = e.createOscillator();
1034
1034
  r.type = "sine", r.frequency.value = 0, r.connect(n), r.start(), yt = t.stream.getAudioTracks()[0];
1035
1035
  }
@@ -2155,7 +2155,7 @@ var yn = vn.getInstance(), M = class e {
2155
2155
  return 1.1;
2156
2156
  }
2157
2157
  static get sdkVersion() {
2158
- return "2.8.13-dev.ab19d582.0";
2158
+ return "2.8.13-dev.c9243c68.0";
2159
2159
  }
2160
2160
  static get debug() {
2161
2161
  return e._params.debug;
@@ -4916,7 +4916,7 @@ var Qr = class {
4916
4916
  }
4917
4917
  }, ui = class extends oi {
4918
4918
  constructor(e, t, n, r, i, a = R, o = null) {
4919
- super(e, t, n, r, i, a), h(this, "_renderer", void 0), h(this, "_decoder", void 0), h(this, "_decoderReady", !1), h(this, "_decoderBusy", !1), h(this, "_decoderQueue", []), h(this, "_fpsMeter", void 0), h(this, "_logger", void 0), this._logger = o, this._debug.debug(`StreamBuilder started for participant [${e}]`), this._initFpsMeter(), this._initRenderer(), this._initDecoder();
4919
+ super(e, t, n, r, i, a), h(this, "_renderer", void 0), h(this, "_decoder", void 0), h(this, "_decoderReady", !1), h(this, "_decoderBusy", !1), h(this, "_decoderQueue", []), h(this, "_webCodecsRetryAttempted", !1), h(this, "_fpsMeter", void 0), h(this, "_logger", void 0), this._logger = o, this._debug.debug(`StreamBuilder started for participant [${e}]`), this._initFpsMeter(), this._initRenderer(), this._initDecoder();
4920
4920
  }
4921
4921
  _processFrame(e) {
4922
4922
  e.keyframe && (this._decoderQueue = []), this._decoderQueue.push(e), this._decodeQueue();
@@ -4931,7 +4931,11 @@ var Qr = class {
4931
4931
  e || !ti.isBrowserSupported() ? this._decoder = new ei(this._debug, this._logger) : this._decoder = new ti(this._debug, this._logger), this._decoder.init(async (e) => {
4932
4932
  this._decoderBusy = !1, "VideoFrame" in window && e instanceof VideoFrame ? await this._renderer.drawFrame(e) : await this._renderer.drawImage(e), this._fpsMeter.increment(), this._decodeQueue();
4933
4933
  }, (e) => {
4934
- this._decoderBusy = !1, this._decodeQueue(), this._decoder instanceof ti && typeof e == "string" && e.includes("EncodingError") && this._switchToLibVPXDecoder();
4934
+ if (this._decoderBusy = !1, this._decoder instanceof ti && typeof e == "string" && e.includes("EncodingError")) {
4935
+ this._decoderQueue = [], !this._webCodecsRetryAttempted && e.includes("reset because error during decoding") ? (this._webCodecsRetryAttempted = !0, this._debug.warn("StreamBuilder retry WebCodecs with software decoder"), this._onKeyFrameRequested?.()) : this._switchToLibVPXDecoder();
4936
+ return;
4937
+ }
4938
+ this._decodeQueue();
4935
4939
  }, this._onKeyFrameRequested).then(() => {
4936
4940
  this._decoderReady = !0, this._decodeQueue();
4937
4941
  }).catch((e) => {
@@ -4939,7 +4943,7 @@ var Qr = class {
4939
4943
  });
4940
4944
  }
4941
4945
  _switchToLibVPXDecoder() {
4942
- this._debug.warn("StreamBuilder switch to LibVPX decoder"), this._fpsMeter && this._fpsMeter.destroy(), this._decoder && (this._decoderReady = !1, this._decoderBusy = !1, this._decoder.destroy()), this._renderer && this._renderer.destroy(), this._initFpsMeter(), this._initRenderer(!0), this._initDecoder(!0);
4946
+ this._debug.warn("StreamBuilder switch to LibVPX decoder"), this._decoderQueue = [], this._fpsMeter && this._fpsMeter.destroy(), this._decoder && (this._decoderReady = !1, this._decoderBusy = !1, this._decoder.destroy()), this._renderer && this._renderer.destroy(), this._initFpsMeter(), this._initRenderer(!0), this._initDecoder(!0), this._onKeyFrameRequested?.();
4943
4947
  }
4944
4948
  _decodeQueue() {
4945
4949
  if (!this._decoderReady || this._decoderBusy) return;
@@ -8365,7 +8369,7 @@ var bo = 90, xo = 3, So = class extends b {
8365
8369
  h(this, "_analyser", null), h(this, "_gainNode", null), h(this, "_fftBins", null), h(this, "_mediaStreamSource", null), h(this, "_lastSmoothedLevel", 0), h(this, "_trackId", void 0), h(this, "_track", void 0), h(this, "_stream", void 0), this._trackId = e, this._track = t, this._stream = new MediaStream([t]);
8366
8370
  try {
8367
8371
  let e = T.getAudioContext();
8368
- this._analyser = e.createAnalyser(), this._analyser.fftSize = 1024, this._analyser.smoothingTimeConstant = 0, T.browserName() === "Safari" && (this._gainNode = e.createGain(), this._gainNode.gain.value = 1e-5, this._gainNode.connect(e.destination), this._analyser.connect(this._gainNode)), this._fftBins = new Uint8Array(this._analyser.frequencyBinCount), this._mediaStreamSource = e.createMediaStreamSource(this._stream), this._mediaStreamSource.connect(this._analyser);
8372
+ this._gainNode = e.createGain(), this._gainNode.gain.value = 1e-5, this._gainNode.connect(e.destination), this._analyser = e.createAnalyser(), this._analyser.fftSize = 1024, this._analyser.smoothingTimeConstant = 0, this._analyser.connect(this._gainNode), this._fftBins = new Uint8Array(this._analyser.frequencyBinCount), this._mediaStreamSource = e.createMediaStreamSource(this._stream), this._mediaStreamSource.connect(this._analyser);
8369
8373
  } catch {}
8370
8374
  }
8371
8375
  get track() {
@@ -9384,6 +9388,9 @@ var ls = 15, $ = class e extends b {
9384
9388
  get isCallHeld() {
9385
9389
  return this._state === "HELD";
9386
9390
  }
9391
+ get isIncomingRinging() {
9392
+ return this._conversation?.direction === Ba.INCOMING && this._state === "IDLE";
9393
+ }
9387
9394
  static debugSessionId() {
9388
9395
  return e.current()?.debugSessionId ?? null;
9389
9396
  }
@@ -9404,6 +9411,9 @@ var ls = 15, $ = class e extends b {
9404
9411
  getCachedRawOkIdByExternalId(e) {
9405
9412
  return this._api.getCachedRawOkIdByExternalId(e);
9406
9413
  }
9414
+ getIncomingCallerExternalId() {
9415
+ return this._conversation?.direction === Ba.INCOMING ? Object.values(this._participants).find((e) => !this._isMe(e.id))?.externalId ?? null : null;
9416
+ }
9407
9417
  _buildInternalParams() {
9408
9418
  let e = {
9409
9419
  deviceId: this._api.deviceId(),
@@ -9445,11 +9455,15 @@ var ls = 15, $ = class e extends b {
9445
9455
  description: "not-initialized-after-start"
9446
9456
  } });
9447
9457
  if (this._participantState = Z.ACCEPTED, this._changeMediaSettings(l), await this._processConnection(d), this._allocateTransport(), this._createSpeakerDetector(), this._createSpecListener(), this._signaling.readyToSend(), this._delayedHangup) throw new O(D.CANCELED);
9448
- return this._debug.debug("Outgoing call", {
9458
+ if (this._debug.debug("Outgoing call", {
9449
9459
  opponentIds: e,
9450
9460
  opponentType: t,
9451
9461
  mediaOptions: n
9452
- }), this._processConnectionSharedMovieInfo(d), this._processConversationUrlSharingInfo(d), L.onLocalStream(this._mediaSource.getStream(), this._mediaSource.mediaSettings, this.id), L.onConversation(this._conversation.externalId, this._conversation.mediaModifiers, this._getMuteStatesForCurrentRoom(), this._getMainRoomParticipants(), void 0, this.id), this._onConversationParticipantListChunk(d), this._processPinnedParticipants(d), L.onLocalStatus(N.WAITING, this.id), this._toggleJoinAvailability(), this._changeFeatureSet(), this._changeNeedRate(), z.add(this), await z.setActive(this.id), us = null, this._conversation.concurrent && await this._acceptConcurrent(), f && !this._registeredPeerReceived && this._state !== "CLOSE" && (this._calleeUnavailableTimer = window.setTimeout(() => {
9462
+ }), this._processConnectionSharedMovieInfo(d), this._processConversationUrlSharingInfo(d), L.onLocalStream(this._mediaSource.getStream(), this._mediaSource.mediaSettings, this.id), L.onConversation(this._conversation.externalId, this._conversation.mediaModifiers, this._getMuteStatesForCurrentRoom(), this._getMainRoomParticipants(), void 0, this.id), this._onConversationParticipantListChunk(d), this._processPinnedParticipants(d), L.onLocalStatus(N.WAITING, this.id), this._toggleJoinAvailability(), this._changeFeatureSet(), this._changeNeedRate(), this._conversation?.concurrent) {
9463
+ let e = z.get(this._conversation.id);
9464
+ e && e !== this && e._close(new O(D.HUNGUP, { remote: !0 }));
9465
+ }
9466
+ return z.add(this), await z.setActive(this.id), us = null, this._conversation.concurrent && await this._acceptConcurrent(), f && !this._registeredPeerReceived && this._state !== "CLOSE" && (this._calleeUnavailableTimer = window.setTimeout(() => {
9453
9467
  this._calleeUnavailableTimer = null, this._close(new O(D.CALLEE_UNAVAILABLE), { signalingReason: D.CANCELED });
9454
9468
  }, f)), this._conversation;
9455
9469
  } catch (e) {
@@ -9731,7 +9745,8 @@ var ls = 15, $ = class e extends b {
9731
9745
  D.CALLEE_IS_OFFLINE,
9732
9746
  D.CALLEE_UNAVAILABLE,
9733
9747
  D.CALLER_IS_BLOCKED,
9734
- D.CALLER_IS_REJECTED
9748
+ D.CALLER_IS_REJECTED,
9749
+ D.HAS_ACTIVE_CALL
9735
9750
  ].indexOf(e.hangup) !== -1 || e.hangup === D.REJECTED && !e.remote) {
9736
9751
  this._emitHangupOnce(e, i), this._destroy(r);
9737
9752
  return;
@@ -10057,7 +10072,11 @@ var ls = 15, $ = class e extends b {
10057
10072
  audienceMode: this._isAudienceMode(t),
10058
10073
  restricted: this._isRestricted(t),
10059
10074
  urlSharingInfoByRoom: /* @__PURE__ */ new Map()
10060
- }, this._debug.setConversationId(t.conversation.id || e.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();
10075
+ }, this._debug.setConversationId(t.conversation.id || e.id), e.p2p_forbidden && (M.forceRelayPolicy = e.p2p_forbidden), this._stats.logger.log(C.RELAY_POLICY, M.forceRelayPolicy ? "1" : "0");
10076
+ let l = z.get(this._conversation.id);
10077
+ if (l && l !== this) this._conversation.concurrent = !0;
10078
+ else if (!M.hold && z.callsLength > 0) throw new O(D.HAS_ACTIVE_CALL);
10079
+ this._changeFeatureSet(), this._changeFeaturesPerRole(), this._logDevices();
10061
10080
  }
10062
10081
  _updateConversation(e) {
10063
10082
  if (!this._conversation) throw new O(D.UNKNOWN_ERROR, { callError: {
@@ -11239,6 +11258,7 @@ var ls = 15, $ = class e extends b {
11239
11258
  async _onAcceptedCall(e) {
11240
11259
  let t = j.composeMessageId(e), n = j.getPeerIdString(e.peerId);
11241
11260
  if (this._debug.debug(`Participant accepted call [${t}]`), this._statFirstMediaReceived.markAcceptedCall(this._transport?.getTopology()), this._conversation && this._isMe(t)) {
11261
+ if (this._conversation.concurrent) return;
11242
11262
  this._close(new O(D.MISSED), { errorText: "Call accepted on other device" });
11243
11263
  return;
11244
11264
  }
@@ -12747,10 +12767,16 @@ async function Xs(t) {
12747
12767
  }
12748
12768
  async function Zs(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
12749
12769
  let c = [];
12750
- return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), Qs([], Va.USER, t, n, r, i, a, c, o, s);
12770
+ return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), $s([], Va.USER, t, n, r, i, a, c, o, s);
12751
12771
  }
12752
- async function Qs(e, t = Va.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
12753
- if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.HAS_ACTIVE_CALL);
12772
+ function Qs(e, t = []) {
12773
+ let n = e.getIncomingCallerExternalId();
12774
+ return n ? t.length === 1 && t[0].id === n.id && t[0].type === n.type : !1;
12775
+ }
12776
+ async function $s(e, t = Va.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
12777
+ if (!M.hold && z.getActive()) throw R.error("There is already active call"), new O(D.HAS_ACTIVE_CALL);
12778
+ let u = z.getAll().find((e) => e.isIncomingRinging);
12779
+ if (!M.hold && u && !Qs(u, s)) throw R.error("There is already incoming call"), new O(D.HAS_ACTIVE_CALL);
12754
12780
  return new $(new Ps(), Hs).onStart({
12755
12781
  opponentIds: e,
12756
12782
  opponentType: t,
@@ -12764,30 +12790,30 @@ async function Qs(e, t = Va.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
12764
12790
  conversationId: l
12765
12791
  });
12766
12792
  }
12767
- async function $s(e, t) {
12768
- return ec(e, A.USER, void 0, t);
12793
+ async function ec(e, t) {
12794
+ return tc(e, A.USER, void 0, t);
12769
12795
  }
12770
- async function ec(e, t = A.USER, n, r, i, a) {
12796
+ async function tc(e, t = A.USER, n, r, i, a) {
12771
12797
  if (e === $.id()) throw Error("Push has already been processed");
12772
12798
  return new $(new Ps(), Hs).onPush(e, t, n, r, i, a);
12773
12799
  }
12774
- async function tc() {
12800
+ async function nc() {
12775
12801
  return Vs.getInbounds();
12776
12802
  }
12777
- async function nc(e, t) {
12803
+ async function rc(e, t) {
12778
12804
  return e && (M.authToken = e), t !== void 0 && M.apiBaseUrl !== t && (M.apiBaseUrl = t, hs()), Vs.authorize();
12779
12805
  }
12780
- async function rc(e = [S.AUDIO], t) {
12781
- return El(t).accept(e);
12806
+ async function ic(e = [S.AUDIO], t) {
12807
+ return Dl(t).accept(e);
12782
12808
  }
12783
- async function ic(e) {
12784
- let t = Tl(e?.conversationId);
12809
+ async function ac(e) {
12810
+ let t = El(e?.conversationId);
12785
12811
  if (t) return t.decline(e);
12786
12812
  }
12787
- async function ac(e, t = [S.AUDIO]) {
12788
- return oc(e, t);
12813
+ async function oc(e, t = [S.AUDIO]) {
12814
+ return sc(e, t);
12789
12815
  }
12790
- async function oc(e, t, n) {
12816
+ async function sc(e, t, n) {
12791
12817
  if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.HAS_ACTIVE_CALL);
12792
12818
  return new $(new Ps(), Hs).onJoin({
12793
12819
  conversationId: e,
@@ -12795,7 +12821,7 @@ async function oc(e, t, n) {
12795
12821
  chatId: n
12796
12822
  });
12797
12823
  }
12798
- async function sc(e, t = [S.AUDIO], n, r, i, a) {
12824
+ async function cc(e, t = [S.AUDIO], n, r, i, a) {
12799
12825
  if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.HAS_ACTIVE_CALL);
12800
12826
  return n && (M.anonymToken = n), new $(new Ps(), Hs).onJoin({
12801
12827
  joinLink: e,
@@ -12806,30 +12832,30 @@ async function sc(e, t = [S.AUDIO], n, r, i, a) {
12806
12832
  anonymous: !!M.anonymToken
12807
12833
  });
12808
12834
  }
12809
- function cc(e) {
12810
- let t = Tl(e?.conversationId);
12835
+ function lc(e) {
12836
+ let t = El(e?.conversationId);
12811
12837
  return t ? t.hangup(e) : ($.hangupAfterInit(e?.onFastHangup), Promise.resolve());
12812
12838
  }
12813
- async function lc(e, t) {
12839
+ async function uc(e, t) {
12814
12840
  let n = Array.isArray(e) ? e : [e], r = $.current();
12815
12841
  r && await r.addParticipant(n, t);
12816
12842
  }
12817
- async function uc(e, t) {
12843
+ async function dc(e, t) {
12818
12844
  let n = $.current();
12819
12845
  if (n) {
12820
12846
  let r = e.map((e) => j.composeUserId(e));
12821
12847
  await n.addParticipantLegacy(r, t);
12822
12848
  }
12823
12849
  }
12824
- async function dc(e, t = !1) {
12850
+ async function fc(e, t = !1) {
12825
12851
  let n = $.current()?.getCachedRawOkIdByExternalId(e) ?? null;
12826
12852
  if (!n) {
12827
12853
  R.warn("removeParticipant: externalId not found in cache", e);
12828
12854
  return;
12829
12855
  }
12830
- return fc(n, t);
12856
+ return pc(n, t);
12831
12857
  }
12832
- async function fc(e, t = !1) {
12858
+ async function pc(e, t = !1) {
12833
12859
  let n = $.current();
12834
12860
  if (n) try {
12835
12861
  await n.removeParticipant(j.composeUserId(e), t);
@@ -12837,13 +12863,13 @@ async function fc(e, t = !1) {
12837
12863
  R.warn(`Failed to remove participant ${e}. Perhaps he is no longer on the call. ${t}`);
12838
12864
  }
12839
12865
  }
12840
- async function pc(e, t) {
12866
+ async function mc(e, t) {
12841
12867
  let n = $.current();
12842
12868
  if (e === "videoinput" && jt.contains(t)) return M.videoFacingMode = t, n ? (T.isMobile() && n.stopVideoTrack(), n.changeDevice(e)) : void 0;
12843
12869
  if (!await T._saveDeviceId(e, t)) throw Error(`Device not found: ${t}`);
12844
12870
  if (n) return n.changeDevice(e);
12845
12871
  }
12846
- async function mc(e, t) {
12872
+ async function hc(e, t) {
12847
12873
  let n = typeof e == "object" ? {
12848
12874
  ...e,
12849
12875
  fastScreenSharing: e.captureScreen && e.fastScreenSharing,
@@ -12852,34 +12878,34 @@ async function mc(e, t) {
12852
12878
  captureScreen: e,
12853
12879
  fastScreenSharing: !1,
12854
12880
  captureAudio: !1
12855
- }, r = Tl(t);
12881
+ }, r = El(t);
12856
12882
  return r ? r.toggleScreenCapturing(n) : Promise.reject();
12857
12883
  }
12858
- function hc(e) {
12884
+ function gc(e) {
12859
12885
  let t = $.current();
12860
12886
  t && t.toggleAnimojiCapturing(e);
12861
12887
  }
12862
- async function gc(e, t = !1) {
12888
+ async function _c(e, t = !1) {
12863
12889
  let n = $.current();
12864
12890
  n && await n.setVideoStream(e, t);
12865
12891
  }
12866
- async function _c(e, t) {
12867
- let n = Tl(t);
12892
+ async function vc(e, t) {
12893
+ let n = El(t);
12868
12894
  n && await n.toggleLocalVideo(e);
12869
12895
  }
12870
- async function vc(e, t) {
12871
- let n = Tl(t);
12896
+ async function yc(e, t) {
12897
+ let n = El(t);
12872
12898
  n && await n.toggleLocalAudio(e);
12873
12899
  }
12874
- async function yc(e) {
12900
+ async function bc(e) {
12875
12901
  let t = $.current();
12876
12902
  if (t) return t.setLocalResolution(e);
12877
12903
  }
12878
- async function bc(e) {
12904
+ async function xc(e) {
12879
12905
  let t = $.current();
12880
12906
  t && await t.changePriorities(e);
12881
12907
  }
12882
- async function xc(e, t) {
12908
+ async function Sc(e, t) {
12883
12909
  let n = $.current();
12884
12910
  if (n) {
12885
12911
  let r;
@@ -12894,33 +12920,33 @@ async function xc(e, t) {
12894
12920
  await n.changeParticipantState(e, r);
12895
12921
  }
12896
12922
  }
12897
- async function Sc() {
12923
+ async function Cc() {
12898
12924
  let e = $.current();
12899
12925
  e && await e.putHandsDown();
12900
12926
  }
12901
- async function Cc(e) {
12927
+ async function wc(e) {
12902
12928
  let t = $.current();
12903
12929
  t && await t.updateDisplayLayout(e);
12904
12930
  }
12905
- async function wc(e) {
12931
+ async function Tc(e) {
12906
12932
  let t = $.current();
12907
12933
  t && await t.requestDisplayLayout(e);
12908
12934
  }
12909
- async function Tc(e, t, n = !1) {
12935
+ async function Ec(e, t, n = !1) {
12910
12936
  let r = $.current()?.getCachedRawOkIdByExternalId(e) ?? null;
12911
12937
  if (!r) {
12912
12938
  R.warn("grantRoles: externalId not found in cache", e);
12913
12939
  return;
12914
12940
  }
12915
- return Ec(r, Q.getDeviceIdx(e), t, n);
12941
+ return Dc(r, Q.getDeviceIdx(e), t, n);
12916
12942
  }
12917
- async function Ec(e, t, n, r = !1) {
12943
+ async function Dc(e, t, n, r = !1) {
12918
12944
  let i = $.current();
12919
12945
  i && await i.grantRoles(j.composeParticipantId(e, A.USER, t), n, r);
12920
12946
  }
12921
- async function Dc({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
12947
+ async function Oc({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
12922
12948
  let i = null;
12923
- return e && (i = $.current()?.getCachedRawOkIdByExternalId(e) ?? null, i || R.warn("muteParticipant: externalId not found in cache", e)), Oc({
12949
+ return e && (i = $.current()?.getCachedRawOkIdByExternalId(e) ?? null, i || R.warn("muteParticipant: externalId not found in cache", e)), kc({
12924
12950
  uid: i,
12925
12951
  muteStates: t,
12926
12952
  requestedMedia: n,
@@ -12928,75 +12954,75 @@ async function Dc({ externalId: e = null, muteStates: t, requestedMedia: n = [],
12928
12954
  roomId: r
12929
12955
  });
12930
12956
  }
12931
- async function Oc({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
12957
+ async function kc({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
12932
12958
  let a = $.current();
12933
12959
  if (a) {
12934
12960
  let o = e ? j.composeParticipantId(e, A.USER, r) : null;
12935
12961
  await a.muteParticipant(o, t, n, i);
12936
12962
  }
12937
12963
  }
12938
- async function kc(e, t = !1, n = null) {
12964
+ async function Ac(e, t = !1, n = null) {
12939
12965
  let r = $.current()?.getCachedRawOkIdByExternalId(e) ?? null;
12940
12966
  if (!r) {
12941
12967
  R.warn("pinParticipant: externalId not found in cache", e);
12942
12968
  return;
12943
12969
  }
12944
- return Ac(r, t, Q.getDeviceIdx(e), n);
12970
+ return jc(r, t, Q.getDeviceIdx(e), n);
12945
12971
  }
12946
- async function Ac(e, t = !1, n = 0, r = null) {
12972
+ async function jc(e, t = !1, n = 0, r = null) {
12947
12973
  let i = $.current();
12948
12974
  i && await i.pinParticipant(j.composeParticipantId(e, A.USER, n), t, r);
12949
12975
  }
12950
- async function jc(e) {
12976
+ async function Mc(e) {
12951
12977
  let t = $.current();
12952
12978
  t && await t.updateMediaModifiers(e);
12953
12979
  }
12954
- async function Mc(e) {
12980
+ async function Nc(e) {
12955
12981
  let t = $.current();
12956
12982
  t && await t.enableVideoSuspend(e);
12957
12983
  }
12958
- async function Nc(e) {
12984
+ async function Pc(e) {
12959
12985
  let t = $.current();
12960
12986
  t && await t.enableVideoSuspendSuggest(e);
12961
12987
  }
12962
- async function Pc(e) {
12988
+ async function Fc(e) {
12963
12989
  let t = $.current();
12964
12990
  t && await t.changeOptions(e);
12965
12991
  }
12966
- async function Fc(e, t = null) {
12992
+ async function Ic(e, t = null) {
12967
12993
  let n = null;
12968
- return t && (n = $.current()?.getCachedRawOkIdByExternalId(t) ?? null, n || R.warn("chatMessage: externalId not found in cache", t)), Ic(e, n);
12994
+ return t && (n = $.current()?.getCachedRawOkIdByExternalId(t) ?? null, n || R.warn("chatMessage: externalId not found in cache", t)), Lc(e, n);
12969
12995
  }
12970
- async function Ic(e, t = null) {
12996
+ async function Lc(e, t = null) {
12971
12997
  let n = $.current();
12972
12998
  if (n) {
12973
12999
  let r = t ? j.composeUserId(t) : null;
12974
13000
  await n.chatMessage(e, r);
12975
13001
  }
12976
13002
  }
12977
- async function Lc(e = 10) {
13003
+ async function Rc(e = 10) {
12978
13004
  let t = $.current();
12979
13005
  if (t) return t.chatHistory(e);
12980
13006
  }
12981
- async function Rc(e, t = null) {
13007
+ async function zc(e, t = null) {
12982
13008
  let n = null;
12983
- return t && (n = $.current()?.getCachedRawOkIdByExternalId(t) ?? null, n || R.warn("customData: externalId not found in cache", t)), zc(e, n, Q.getDeviceIdx(t));
13009
+ return t && (n = $.current()?.getCachedRawOkIdByExternalId(t) ?? null, n || R.warn("customData: externalId not found in cache", t)), Bc(e, n, Q.getDeviceIdx(t));
12984
13010
  }
12985
- async function zc(e, t = null, n = 0) {
13011
+ async function Bc(e, t = null, n = 0) {
12986
13012
  let r = $.current();
12987
13013
  if (r) {
12988
13014
  let i = t ? j.composeParticipantId(t, A.USER, n) : null;
12989
13015
  await r.customData(e, i);
12990
13016
  }
12991
13017
  }
12992
- async function Bc(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
13018
+ async function Vc(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
12993
13019
  return (await Vs.createConversation(a ?? j.uuid(), e, t, {
12994
13020
  onlyAdminCanShareMovie: n,
12995
13021
  waitForAdmin: r,
12996
13022
  closedConversation: i
12997
13023
  })).join_link;
12998
13024
  }
12999
- async function Vc(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
13025
+ async function Hc(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
13000
13026
  let a = i.map((e) => Q.fromId(e));
13001
13027
  return (await Vs.createConversation(j.uuid(), e, t, {
13002
13028
  onlyAdminCanShareMovie: n,
@@ -13004,53 +13030,53 @@ async function Vc(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r
13004
13030
  audioOnly: r
13005
13031
  }, a)).join_link;
13006
13032
  }
13007
- async function Hc() {
13033
+ async function Uc() {
13008
13034
  let e = $.current();
13009
13035
  return e ? e.createJoinLink() : Promise.reject();
13010
13036
  }
13011
- async function Uc() {
13037
+ async function Wc() {
13012
13038
  let e = $.current();
13013
13039
  return e ? e.removeJoinLink() : Promise.reject();
13014
13040
  }
13015
- async function Wc(e, t) {
13041
+ async function Gc(e, t) {
13016
13042
  return Vs.getAnonymTokenByLink(e, t);
13017
13043
  }
13018
- function Gc(e) {
13044
+ function Kc(e) {
13019
13045
  let t = $.current();
13020
13046
  t && t.setVolume(e);
13021
13047
  }
13022
- function Kc(e) {
13048
+ function qc(e) {
13023
13049
  M.forceRelayPolicy = e;
13024
13050
  }
13025
- async function qc(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
13051
+ async function Jc(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
13026
13052
  let o = $.current();
13027
13053
  return o ? o.startStream(e, t, n, r, i, a) : Promise.reject();
13028
13054
  }
13029
- async function Jc(e = null, t) {
13055
+ async function Yc(e = null, t) {
13030
13056
  let n = $.current();
13031
13057
  return n ? n.stopStream(e, t) : Promise.reject();
13032
13058
  }
13033
- async function Yc(e = null) {
13059
+ async function Xc(e = null) {
13034
13060
  let t = $.current();
13035
13061
  return t ? t.publishStream(e) : Promise.reject();
13036
13062
  }
13037
- async function Xc() {
13063
+ async function Zc() {
13038
13064
  let e = $.current();
13039
13065
  return e ? e.getStreamInfo() : Promise.reject();
13040
13066
  }
13041
- async function Zc(e) {
13067
+ async function Qc(e) {
13042
13068
  let t = $.current();
13043
13069
  return t ? t.addMovie(e) : Promise.reject();
13044
13070
  }
13045
- async function Qc(e) {
13071
+ async function $c(e) {
13046
13072
  let t = $.current();
13047
13073
  return t ? t.updateMovie(e) : Promise.reject();
13048
13074
  }
13049
- async function $c(e) {
13075
+ async function el(e) {
13050
13076
  let t = $.current();
13051
13077
  return t ? t.removeMovie(e) : Promise.reject();
13052
13078
  }
13053
- async function el(e, t) {
13079
+ async function tl(e, t) {
13054
13080
  let n = $.current();
13055
13081
  if (n) {
13056
13082
  let r = [];
@@ -13075,11 +13101,11 @@ async function el(e, t) {
13075
13101
  }
13076
13102
  return Promise.reject();
13077
13103
  }
13078
- async function tl(e, t) {
13104
+ async function nl(e, t) {
13079
13105
  let n = $.current();
13080
13106
  return n ? n.activateRooms(e, t) : Promise.reject();
13081
13107
  }
13082
- async function nl(e = null, t = null) {
13108
+ async function rl(e = null, t = null) {
13083
13109
  let n = $.current();
13084
13110
  if (!n) return Promise.reject();
13085
13111
  let r;
@@ -13094,25 +13120,25 @@ async function nl(e = null, t = null) {
13094
13120
  }
13095
13121
  return n.switchRoom(e, r);
13096
13122
  }
13097
- async function rl(e) {
13123
+ async function il(e) {
13098
13124
  let t = $.current();
13099
13125
  return t ? t.removeRooms(e) : Promise.reject();
13100
13126
  }
13101
- function il(e) {
13127
+ function al(e) {
13102
13128
  M.statisticsInterval = e;
13103
13129
  let t = $.current();
13104
13130
  if (t) return t.updateStatisticsInterval();
13105
13131
  }
13106
- function al(t) {
13132
+ function ol(t) {
13107
13133
  e.disableLog(!t), R.toggle(t);
13108
13134
  }
13109
- function ol(e, ...t) {
13135
+ function sl(e, ...t) {
13110
13136
  M.debugLog && ($.debugMessage(e, "[external]", ...t) || R.send(e, "[external]", ...t));
13111
13137
  }
13112
- function sl(e, t, ...n) {
13138
+ function cl(e, t, ...n) {
13113
13139
  M.debugLog && ($.debugMessageWithContext(e, t, "[external]", ...n) || R.send(e, "[external]", ...n));
13114
13140
  }
13115
- var cl = {
13141
+ var ll = {
13116
13142
  list: Ne,
13117
13143
  get: Pe,
13118
13144
  getJson: Fe,
@@ -13120,7 +13146,7 @@ var cl = {
13120
13146
  clear: Le,
13121
13147
  stats: Re
13122
13148
  };
13123
- function ll() {
13149
+ function ul() {
13124
13150
  let e = [
13125
13151
  [`Calls SDK ${M.sdkVersion}`, M.toJSON()],
13126
13152
  ["UserAgent:", navigator.userAgent],
@@ -13137,31 +13163,31 @@ function ll() {
13137
13163
  d: e
13138
13164
  }));
13139
13165
  }
13140
- async function ul() {
13166
+ async function dl() {
13141
13167
  let e = $.id(), t = $.debugSessionId();
13142
13168
  if (!t || !e) throw R.error("[uploadDebugLogs]", "No conversation id found"), Error("No conversation id found");
13143
13169
  let n = await Pe({ sessionId: t });
13144
13170
  if (n.length === 0) throw R.error("[uploadDebugLogs]", "No logs found"), Error("No logs found");
13145
13171
  let r = n[0].t, i = n[n.length - 1].t;
13146
13172
  try {
13147
- return Vs?.uploadDebugLogs(e, r, i, JSON.stringify([...ll(), ...n]));
13173
+ return Vs?.uploadDebugLogs(e, r, i, JSON.stringify([...ul(), ...n]));
13148
13174
  } catch (e) {
13149
13175
  throw R.error("[uploadDebugLogs]", "Error while uploading logs", e), Error("Error while uploading logs", { cause: e });
13150
13176
  }
13151
13177
  }
13152
- async function dl(e) {
13178
+ async function fl(e) {
13153
13179
  let t = $.current();
13154
13180
  if (t) return t.videoEffect(e);
13155
13181
  }
13156
- async function fl(e, t) {
13182
+ async function pl(e, t) {
13157
13183
  let n = $.current();
13158
13184
  if (n) return n.audioEffect(e.length > 0 ? e : null, t);
13159
13185
  }
13160
- async function pl(e) {
13186
+ async function ml(e) {
13161
13187
  let t = $.current();
13162
13188
  t && await t.setAudioStream(e);
13163
13189
  }
13164
- async function ml(e, t = null, n = null) {
13190
+ async function hl(e, t = null, n = null) {
13165
13191
  let r = $.current();
13166
13192
  if (!r) return;
13167
13193
  let i = n ?? t?.id, a = null;
@@ -13172,18 +13198,18 @@ async function ml(e, t = null, n = null) {
13172
13198
  }
13173
13199
  r.setAnimojiSvg(e, a, i);
13174
13200
  }
13175
- function hl(e) {
13201
+ function gl(e) {
13176
13202
  let t = $.current();
13177
13203
  t && t.setAnimojiFill(e);
13178
13204
  }
13179
- async function gl(e = null, t, n = !1) {
13180
- return El().getWaitingHall(e, t, n);
13205
+ async function _l(e = null, t, n = !1) {
13206
+ return Dl().getWaitingHall(e, t, n);
13181
13207
  }
13182
- async function _l() {
13183
- return El().getAudienceModeHands();
13208
+ async function vl() {
13209
+ return Dl().getAudienceModeHands();
13184
13210
  }
13185
- async function vl(e, t = !1) {
13186
- let n = El(), r;
13211
+ async function yl(e, t = !1) {
13212
+ let n = Dl(), r;
13187
13213
  if (e) {
13188
13214
  let t = n.getCachedRawOkIdByExternalId(e);
13189
13215
  if (!t) {
@@ -13194,67 +13220,67 @@ async function vl(e, t = !1) {
13194
13220
  }
13195
13221
  return n.promoteParticipant(r, t);
13196
13222
  }
13197
- async function yl(e = !1) {
13198
- return El().requestPromotion(e);
13199
- }
13200
13223
  async function bl(e = !1) {
13201
- return El().acceptPromotion(e);
13224
+ return Dl().requestPromotion(e);
13202
13225
  }
13203
- async function xl(e) {
13204
- return El().getParticipantListChunk(e);
13226
+ async function xl(e = !1) {
13227
+ return Dl().acceptPromotion(e);
13205
13228
  }
13206
13229
  async function Sl(e) {
13207
- return El().getParticipants(e);
13230
+ return Dl().getParticipantListChunk(e);
13208
13231
  }
13209
13232
  async function Cl(e) {
13210
- return El().feedback(e);
13233
+ return Dl().getParticipants(e);
13211
13234
  }
13212
- async function wl(e, t, n) {
13213
- return El(n).enableFeatureForRoles(e, t);
13235
+ async function wl(e) {
13236
+ return Dl().feedback(e);
13214
13237
  }
13215
- function Tl(e) {
13216
- return e ? z.get(e) ?? null : $.current() ?? z.getFirst();
13238
+ async function Tl(e, t, n) {
13239
+ return Dl(n).enableFeatureForRoles(e, t);
13217
13240
  }
13218
13241
  function El(e) {
13219
- let t = Tl(e);
13242
+ return e ? z.get(e) ?? null : $.current() ?? z.getFirst();
13243
+ }
13244
+ function Dl(e) {
13245
+ let t = El(e);
13220
13246
  if (!t) throw Error("Conversation not found");
13221
13247
  return t;
13222
13248
  }
13223
- async function Dl(e) {
13249
+ async function Ol(e) {
13224
13250
  await Vs.removeHistoryRecords(e);
13225
13251
  }
13226
- async function Ol(e) {
13252
+ async function kl(e) {
13227
13253
  let t = $.current() ?? z.getFirst();
13228
13254
  t && await t.startAsr(e);
13229
13255
  }
13230
- async function kl(e) {
13256
+ async function Al(e) {
13231
13257
  let t = $.current() ?? z.getFirst();
13232
13258
  t && await t.stopAsr(e);
13233
13259
  }
13234
- async function Al(e) {
13260
+ async function jl(e) {
13235
13261
  let t = $.current() ?? z.getFirst();
13236
13262
  t && await t.requestAsr(e);
13237
13263
  }
13238
- async function jl(e) {
13264
+ async function Ml(e) {
13239
13265
  let t = $.current();
13240
13266
  return t ? t.startUrlSharing(e) : Promise.reject();
13241
13267
  }
13242
- async function Ml() {
13268
+ async function Nl() {
13243
13269
  let e = $.current();
13244
13270
  return e ? e.stopUrlSharing() : Promise.reject();
13245
13271
  }
13246
- async function Nl(e) {
13272
+ async function Pl(e) {
13247
13273
  await z.switchCall(e);
13248
13274
  }
13249
- function Pl() {
13275
+ function Fl() {
13250
13276
  return z.getActiveId();
13251
13277
  }
13252
- function Fl() {
13278
+ function Il() {
13253
13279
  return $.getSyncedTime();
13254
13280
  }
13255
- function Il() {
13281
+ function Ll() {
13256
13282
  return M.sdkVersion;
13257
13283
  }
13258
13284
  typeof window < "u" && (window.__CALLS_SDK = yn);
13259
13285
  //#endregion
13260
- export { Ps as Api, Bs as ApiExternal, zs as ArrayDequeue, y as AuthData, f as BaseLogger, Ba as CallDirection, Va as CallType, Ha as ChatRoomEventType, Ua as ConversationFeature, Wa as ConversationOption, Sn as DebugMessageType, to as ExternalIdType, jt as FacingMode, x as FatalError, O as HangupReason, D as HangupType, S as MediaOption, k as MediaTrackKind, V as MediaType, qa as MuteState, Z as ParticipantState, Rs as ParticipantStateDataValue, N as ParticipantStatus, Ls as RecordRole, Ja as RoomsEventType, za as Signaling, B as SignalingCommandType, vr as SignalingConnectionType, K as SignalingNotification, J as TransportTopology, Za as UserRole, A as UserType, To as VolumeDetector, rc as acceptCall, bl as acceptPromotion, tl as activateRooms, Zc as addMovie, lc as addParticipant, uc as addParticipantInternal, nc as authorize, Us as browser, Qs as callInternal, Zs as callTo, mc as captureScreen, hc as captureVmoji, fl as changeAudioEffect, Pc as changeConversationOptions, pc as changeDevice, xc as changeParticipantState, bc as changePriorities, dl as changeVideoEffect, Lc as chatHistory, Fc as chatMessage, Ic as chatMessageInternal, Hc as createJoinLink, Rc as customData, zc as customDataInternal, al as debug, cl as debugLogs, ol as debugMessage, sl as debugMessageWithContext, ic as declineCall, wl as enableFeatureForRoles, Mc as enableVideoSuspend, Nc as enableVideoSuspendSuggest, Cl as feedback, Kc as forceRelayPolicy, Pl as getActiveCallId, Wc as getAnonymTokenByLink, _l as getAudienceModeHands, tc as getInbounds, xl as getParticipantListChunk, Sl as getParticipants, Xc as getStreamInfo, Fl as getSyncedTime, gl as getWaitingHall, Tc as grantRoles, Ec as grantRolesInternal, cc as hangup, Xs as init, ac as joinCall, sc as joinCallByLink, oc as joinCallInternal, Dc as muteParticipant, Oc as muteParticipantInternal, kc as pinParticipant, Ac as pinParticipantInternal, $s as processPush, ec as processPushInternal, vl as promoteParticipant, Yc as publishStream, Sc as putHandsDown, Dl as removeHistoryRecords, Uc as removeJoinLink, $c as removeMovie, dc as removeParticipant, fc as removeParticipantInternal, rl as removeRooms, Al as requestAsr, wc as requestDisplayLayout, yl as requestPromotion, qs as setAudioEffects, pl as setAudioStream, yc as setLocalResolution, Gs as setLogger, jc as setMediaModifiers, il as setStatisticsInterval, Js as setVad, Ks as setVideoEffects, gc as setVideoStream, Ys as setVmoji, hl as setVmojiFill, ml as setVmojiSvg, Gc as setVolume, Ol as startAsr, Vc as startAudienceConversation, Bc as startConversation, qc as startStream, jl as startUrlSharing, kl as stopAsr, Jc as stopStream, Ml as stopUrlSharing, Nl as switchCall, nl as switchRoom, vc as toggleLocalAudio, _c as toggleLocalVideo, Cc as updateDisplayLayout, Qc as updateMovie, el as updateRooms, ul as uploadDebugLogs, Ws as utils, Il as version };
13286
+ export { Ps as Api, Bs as ApiExternal, zs as ArrayDequeue, y as AuthData, f as BaseLogger, Ba as CallDirection, Va as CallType, Ha as ChatRoomEventType, Ua as ConversationFeature, Wa as ConversationOption, Sn as DebugMessageType, to as ExternalIdType, jt as FacingMode, x as FatalError, O as HangupReason, D as HangupType, S as MediaOption, k as MediaTrackKind, V as MediaType, qa as MuteState, Z as ParticipantState, Rs as ParticipantStateDataValue, N as ParticipantStatus, Ls as RecordRole, Ja as RoomsEventType, za as Signaling, B as SignalingCommandType, vr as SignalingConnectionType, K as SignalingNotification, J as TransportTopology, Za as UserRole, A as UserType, To as VolumeDetector, ic as acceptCall, xl as acceptPromotion, nl as activateRooms, Qc as addMovie, uc as addParticipant, dc as addParticipantInternal, rc as authorize, Us as browser, $s as callInternal, Zs as callTo, hc as captureScreen, gc as captureVmoji, pl as changeAudioEffect, Fc as changeConversationOptions, mc as changeDevice, Sc as changeParticipantState, xc as changePriorities, fl as changeVideoEffect, Rc as chatHistory, Ic as chatMessage, Lc as chatMessageInternal, Uc as createJoinLink, zc as customData, Bc as customDataInternal, ol as debug, ll as debugLogs, sl as debugMessage, cl as debugMessageWithContext, ac as declineCall, Tl as enableFeatureForRoles, Nc as enableVideoSuspend, Pc as enableVideoSuspendSuggest, wl as feedback, qc as forceRelayPolicy, Fl as getActiveCallId, Gc as getAnonymTokenByLink, vl as getAudienceModeHands, nc as getInbounds, Sl as getParticipantListChunk, Cl as getParticipants, Zc as getStreamInfo, Il as getSyncedTime, _l as getWaitingHall, Ec as grantRoles, Dc as grantRolesInternal, lc as hangup, Xs as init, oc as joinCall, cc as joinCallByLink, sc as joinCallInternal, Oc as muteParticipant, kc as muteParticipantInternal, Ac as pinParticipant, jc as pinParticipantInternal, ec as processPush, tc as processPushInternal, yl as promoteParticipant, Xc as publishStream, Cc as putHandsDown, Ol as removeHistoryRecords, Wc as removeJoinLink, el as removeMovie, fc as removeParticipant, pc as removeParticipantInternal, il as removeRooms, jl as requestAsr, Tc as requestDisplayLayout, bl as requestPromotion, qs as setAudioEffects, ml as setAudioStream, bc as setLocalResolution, Gs as setLogger, Mc as setMediaModifiers, al as setStatisticsInterval, Js as setVad, Ks as setVideoEffects, _c as setVideoStream, Ys as setVmoji, gl as setVmojiFill, hl as setVmojiSvg, Kc as setVolume, kl as startAsr, Hc as startAudienceConversation, Vc as startConversation, Jc as startStream, Ml as startUrlSharing, Al as stopAsr, Yc as stopStream, Nl as stopUrlSharing, Pl as switchCall, rl as switchRoom, yc as toggleLocalAudio, vc as toggleLocalVideo, wc as updateDisplayLayout, $c as updateMovie, tl as updateRooms, dl as uploadDebugLogs, Ws as utils, Ll as version };