sip-connector 19.0.1 → 19.1.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.
@@ -1,18 +1,18 @@
1
1
  import { Events as U, TypedEvents as k } from "events-constructor";
2
2
  import x from "debug";
3
- import { CancelableRequest as G, isCanceledError as _e } from "@krivega/cancelable-promise";
4
- import { resolveRequesterByTimeout as Me, requesterByTimeoutsWithFailCalls as ve, DelayRequester as fe, hasCanceledError as Pe, SetTimeoutRequest as Z } from "@krivega/timeout-requester";
5
- import { hasCanceledError as Oe, repeatedCallsAsync as ee } from "repeated-calls";
6
- import { setup as De, createActor as ye } from "xstate";
7
- import { createStackPromises as te, isPromiseIsNotActualError as be } from "stack-promises";
3
+ import { CancelableRequest as G, isCanceledError as me } from "@krivega/cancelable-promise";
4
+ import { resolveRequesterByTimeout as _e, requesterByTimeoutsWithFailCalls as Me, DelayRequester as ve, hasCanceledError as fe, SetTimeoutRequest as Z } from "@krivega/timeout-requester";
5
+ import { hasCanceledError as Pe, repeatedCallsAsync as ee } from "repeated-calls";
6
+ import { setup as Oe, createActor as De } from "xstate";
7
+ import { createStackPromises as te, isPromiseIsNotActualError as ye } from "stack-promises";
8
8
  import "ua-parser-js";
9
9
  import "sequent-promises";
10
- const Q = "sip-connector", d = x(Q), Hn = () => {
10
+ const Q = "sip-connector", d = x(Q), Wn = () => {
11
11
  x.enable(Q);
12
- }, xn = () => {
12
+ }, Hn = () => {
13
13
  x.enable(`-${Q}`);
14
- }, we = "Error decline with 603", Ue = 1006, Le = (n) => typeof n == "object" && n !== null && "code" in n && n.code === Ue, Be = (n) => n.message === we;
15
- var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n))(l || {}), B = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(B || {}), q = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(q || {}), f = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.RESTART = "application/vinteo.webrtc.restart", n))(f || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), v = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(v || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}), Fe = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Fe || {}), u = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n.RESTART = "restart", n))(u || {});
14
+ }, be = "Error decline with 603", we = 1006, Ue = (n) => typeof n == "object" && n !== null && "code" in n && n.code === we, Le = (n) => n.message === be;
15
+ var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n))(l || {}), B = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(B || {}), q = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(q || {}), f = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.RESTART = "application/vinteo.webrtc.restart", n))(f || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), v = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(v || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}), Be = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Be || {}), u = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n.RESTART = "restart", n))(u || {});
16
16
  const ne = [
17
17
  "participation:accepting-word-request",
18
18
  "participation:cancelling-word-request",
@@ -44,7 +44,7 @@ const ne = [
44
44
  "restart"
45
45
  ];
46
46
  var p = /* @__PURE__ */ ((n) => (n.CHANNELS = "channels", n.WEBCAST_STARTED = "WebcastStarted", n.WEBCAST_STOPPED = "WebcastStopped", n.ACCOUNT_CHANGED = "accountChanged", n.ACCOUNT_DELETED = "accountDeleted", n.ADDED_TO_LIST_MODERATORS = "addedToListModerators", n.REMOVED_FROM_LIST_MODERATORS = "removedFromListModerators", n.ACCEPTING_WORD_REQUEST = "ParticipationRequestAccepted", n.CANCELLING_WORD_REQUEST = "ParticipationRequestRejected", n.MOVE_REQUEST_TO_STREAM = "ParticipantMovedToWebcast", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "ConferenceParticipantTokenIssued", n))(p || {});
47
- class ke {
47
+ class Fe {
48
48
  events;
49
49
  connectionManager;
50
50
  callManager;
@@ -150,7 +150,7 @@ class ke {
150
150
  ...e,
151
151
  extraHeaders: s
152
152
  }).catch((i) => {
153
- if (Be(i))
153
+ if (Le(i))
154
154
  throw i;
155
155
  });
156
156
  }
@@ -460,7 +460,7 @@ class ke {
460
460
  this.events.trigger(u.RESTART, r);
461
461
  };
462
462
  }
463
- var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n.CALL_STATUS_CHANGED = "call-status-changed", n))(N || {}), $e = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))($e || {});
463
+ var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n.CALL_STATUS_CHANGED = "call-status-changed", n))(N || {}), ke = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(ke || {});
464
464
  const se = [
465
465
  "peerconnection",
466
466
  "connecting",
@@ -488,15 +488,15 @@ const se = [
488
488
  "peerconnection:createanswerfailed",
489
489
  "peerconnection:setlocaldescriptionfailed",
490
490
  "peerconnection:setremotedescriptionfailed"
491
- ], Ve = [
491
+ ], $e = [
492
492
  "peerconnection:confirmed",
493
493
  "peerconnection:ontrack",
494
494
  "ended:fromserver",
495
495
  "call-status-changed"
496
496
  ], ie = [
497
497
  ...se,
498
- ...Ve
499
- ], qe = (n, e) => {
498
+ ...$e
499
+ ], Ve = (n, e) => {
500
500
  n.getVideoTracks().forEach((s) => {
501
501
  "contentHint" in s && s.contentHint !== e && (s.contentHint = e);
502
502
  });
@@ -508,16 +508,16 @@ const se = [
508
508
  if (!n || e === "recvonly" && t === "recvonly")
509
509
  return;
510
510
  const i = t === "recvonly" ? [] : n.getAudioTracks(), r = e === "recvonly" ? [] : n.getVideoTracks(), a = [...i, ...r], o = new MediaStream(a);
511
- return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && qe(o, s), o;
511
+ return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && Ve(o, s), o;
512
512
  };
513
- function We(n) {
513
+ function qe(n) {
514
514
  return (e) => `sip:${e}@${n}`;
515
515
  }
516
- const He = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, re = (n) => n.trim().replaceAll(" ", "_"), xe = He(1e5, 99999999), Ge = (n) => n.some((t) => {
516
+ const We = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, re = (n) => n.trim().replaceAll(" ", "_"), He = We(1e5, 99999999), xe = (n) => n.some((t) => {
517
517
  const { kind: s } = t;
518
518
  return s === "video";
519
519
  });
520
- class Qe {
520
+ class Ge {
521
521
  isPendingCall = !1;
522
522
  isPendingAnswer = !1;
523
523
  rtcSession;
@@ -529,7 +529,7 @@ class Qe {
529
529
  }
530
530
  }
531
531
  var ae = /* @__PURE__ */ ((n) => (n.BYE = "Terminated", n.WEBRTC_ERROR = "WebRTC Error", n.CANCELED = "Canceled", n.REQUEST_TIMEOUT = "Request Timeout", n.REJECTED = "Rejected", n.REDIRECTED = "Redirected", n.UNAVAILABLE = "Unavailable", n.NOT_FOUND = "Not Found", n.ADDRESS_INCOMPLETE = "Address Incomplete", n.INCOMPATIBLE_SDP = "Incompatible SDP", n.BAD_MEDIA_DESCRIPTION = "Bad Media Description", n))(ae || {});
532
- class Ye {
532
+ class Qe {
533
533
  remoteStreams = {};
534
534
  reset() {
535
535
  this.remoteStreams = {};
@@ -558,8 +558,8 @@ class Ye {
558
558
  return e.map((t) => this.generateAudioStream(t));
559
559
  }
560
560
  }
561
- class ze extends Qe {
562
- remoteStreamsManager = new Ye();
561
+ class Ye extends Ge {
562
+ remoteStreamsManager = new Qe();
563
563
  disposers = /* @__PURE__ */ new Set();
564
564
  constructor(e) {
565
565
  super(e), e.on(N.FAILED, this.handleEnded), e.on(N.ENDED, this.handleEnded);
@@ -684,7 +684,7 @@ class ze extends Qe {
684
684
  if (!this.connection)
685
685
  return;
686
686
  const t = this.connection.getReceivers().map(({ track: s }) => s);
687
- return Ge(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
687
+ return xe(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
688
688
  }
689
689
  async replaceMediaStream(e, t) {
690
690
  if (!this.rtcSession)
@@ -753,11 +753,11 @@ class ze extends Qe {
753
753
  delete this.rtcSession, this.remoteStreamsManager.reset(), this.unsubscribeFromSessionEvents(), this.callConfiguration.number = void 0, this.callConfiguration.answer = !1;
754
754
  };
755
755
  }
756
- class Xe {
756
+ class ze {
757
757
  events;
758
758
  strategy;
759
759
  constructor(e) {
760
- this.events = new k(ie), this.strategy = e ?? new ze(this.events), this.subscribeCallStatusChange();
760
+ this.events = new k(ie), this.strategy = e ?? new Ye(this.events), this.subscribeCallStatusChange();
761
761
  }
762
762
  get requested() {
763
763
  return this.strategy.requested;
@@ -813,39 +813,39 @@ class Xe {
813
813
  return t !== e && this.events.trigger(N.CALL_STATUS_CHANGED, { isCallActive: t }), t;
814
814
  }
815
815
  }
816
- const Je = (n, e) => (n.degradationPreference = e.degradationPreference, n), Ke = (n, e) => {
816
+ const Xe = (n, e) => (n.degradationPreference = e.degradationPreference, n), Je = (n, e) => {
817
817
  n.encodings ??= [];
818
818
  for (let t = n.encodings.length; t < e; t += 1)
819
819
  n.encodings.push({});
820
820
  return n;
821
- }, oe = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, je = oe(), Ze = (n, e) => {
822
- if (je(n, e))
821
+ }, oe = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, Ke = oe(), je = (n, e) => {
822
+ if (Ke(n, e))
823
823
  return n;
824
- }, et = (n, e) => {
825
- const t = n.maxBitrate, s = Ze(e, t);
824
+ }, Ze = (n, e) => {
825
+ const t = n.maxBitrate, s = je(e, t);
826
826
  return s !== void 0 && (n.maxBitrate = s), n;
827
- }, ce = 1, tt = oe(
827
+ }, ce = 1, et = oe(
828
828
  ce
829
- ), nt = (n, e) => {
829
+ ), tt = (n, e) => {
830
830
  const t = n === void 0 ? void 0 : Math.max(n, ce);
831
- if (t !== void 0 && tt(
831
+ if (t !== void 0 && et(
832
832
  t,
833
833
  e
834
834
  ))
835
835
  return t;
836
- }, st = (n, e) => {
837
- const t = n.scaleResolutionDownBy, s = nt(
836
+ }, nt = (n, e) => {
837
+ const t = n.scaleResolutionDownBy, s = tt(
838
838
  e,
839
839
  t
840
840
  );
841
841
  return s !== void 0 && (n.scaleResolutionDownBy = s), n;
842
- }, it = (n, e) => {
842
+ }, st = (n, e) => {
843
843
  const t = e.encodings?.length ?? 0;
844
- return Ke(n, t), n.encodings.forEach((s, i) => {
844
+ return Je(n, t), n.encodings.forEach((s, i) => {
845
845
  const r = (e?.encodings ?? [])[i], a = r?.maxBitrate, o = r?.scaleResolutionDownBy;
846
- et(s, a), st(s, o);
846
+ Ze(s, a), nt(s, o);
847
847
  }), n;
848
- }, rt = (n, e) => {
848
+ }, it = (n, e) => {
849
849
  if (n.codecs?.length !== e.codecs?.length)
850
850
  return !0;
851
851
  for (let t = 0; t < (n.codecs?.length ?? 0); t++)
@@ -862,15 +862,15 @@ const Je = (n, e) => (n.degradationPreference = e.degradationPreference, n), Ke
862
862
  if (JSON.stringify(n.encodings[t]) !== JSON.stringify(e.encodings[t]))
863
863
  return !0;
864
864
  return n.rtcp?.cname !== e.rtcp?.cname || n.rtcp?.reducedSize !== e.rtcp?.reducedSize || n.degradationPreference !== e.degradationPreference;
865
- }, at = async (n, e) => {
865
+ }, rt = async (n, e) => {
866
866
  const t = n.getParameters(), s = JSON.parse(
867
867
  JSON.stringify(t)
868
868
  );
869
- it(t, e), Je(t, e);
870
- const i = rt(s, t);
869
+ st(t, e), Xe(t, e);
870
+ const i = it(s, t);
871
871
  return i && await n.setParameters(t), { parameters: t, isChanged: i };
872
872
  }, de = async (n, e, t) => {
873
- const { isChanged: s, parameters: i } = await at(n, {
873
+ const { isChanged: s, parameters: i } = await rt(n, {
874
874
  encodings: [
875
875
  {
876
876
  scaleResolutionDownBy: e.scaleResolutionDownBy,
@@ -879,8 +879,8 @@ const Je = (n, e) => (n.degradationPreference = e.degradationPreference, n), Ke
879
879
  ]
880
880
  });
881
881
  return s && t && t(i), { isChanged: s, parameters: i };
882
- }, ot = (n, e) => n.find((t) => t.track !== null && e.getTracks().includes(t.track)), ct = async (n, e, t) => {
883
- const s = ot(n, e);
882
+ }, at = (n, e) => n.find((t) => t.track !== null && e.getTracks().includes(t.track)), ot = async (n, e, t) => {
883
+ const s = at(n, e);
884
884
  if (s)
885
885
  return de(s, { maxBitrate: t });
886
886
  };
@@ -891,8 +891,8 @@ const he = [
891
891
  "presentation:end",
892
892
  "presentation:ended",
893
893
  "presentation:failed"
894
- ], dt = 1, Gn = (n) => Oe(n);
895
- class ht {
894
+ ], ct = 1, xn = (n) => Pe(n);
895
+ class dt {
896
896
  events;
897
897
  promisePendingStartPresentation;
898
898
  promisePendingStopPresentation;
@@ -999,7 +999,7 @@ class ht {
999
999
  stream: s,
1000
1000
  presentationOptions: i,
1001
1001
  options: r = {
1002
- callLimit: dt
1002
+ callLimit: ct
1003
1003
  }
1004
1004
  }) {
1005
1005
  const a = async () => this.sendPresentation(
@@ -1043,7 +1043,7 @@ class ht {
1043
1043
  if (!e || !t || s === void 0)
1044
1044
  return;
1045
1045
  const i = e.getSenders();
1046
- await ct(i, t, s);
1046
+ await ot(i, t, s);
1047
1047
  };
1048
1048
  getRtcSessionProtected = () => {
1049
1049
  const e = this.callManager.getEstablishedRTCSession();
@@ -1064,7 +1064,7 @@ class ht {
1064
1064
  delete this.streamPresentationCurrent;
1065
1065
  }
1066
1066
  }
1067
- class lt {
1067
+ class ht {
1068
1068
  data = {};
1069
1069
  getUa;
1070
1070
  constructor(e) {
@@ -1148,13 +1148,13 @@ const le = [
1148
1148
  "registrationFailed",
1149
1149
  "newMessage",
1150
1150
  "sipEvent"
1151
- ], gt = [
1151
+ ], lt = [
1152
1152
  "disconnecting",
1153
1153
  "connect-started",
1154
1154
  "connect-succeeded",
1155
1155
  "connect-failed"
1156
- ], ge = [...le, ...gt], ut = 3;
1157
- class Tt {
1156
+ ], ge = [...le, ...lt], gt = 3;
1157
+ class ut {
1158
1158
  cancelableConnectWithRepeatedCalls;
1159
1159
  JsSIP;
1160
1160
  events;
@@ -1198,9 +1198,9 @@ class Tt {
1198
1198
  cancelRequests() {
1199
1199
  this.cancelConnectWithRepeatedCalls();
1200
1200
  }
1201
- connectWithDuplicatedCalls = async (e, { callLimit: t = ut } = {}) => {
1201
+ connectWithDuplicatedCalls = async (e, { callLimit: t = gt } = {}) => {
1202
1202
  const s = async () => this.connectInner(e), i = (r) => {
1203
- const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), h = r != null && !Le(r);
1203
+ const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), h = r != null && !Ue(r);
1204
1204
  return c || h;
1205
1205
  };
1206
1206
  return this.stateMachine.startConnect(), this.cancelableConnectWithRepeatedCalls = ee({
@@ -1291,7 +1291,7 @@ class Tt {
1291
1291
  }
1292
1292
  }
1293
1293
  var ue = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(ue || {});
1294
- const St = De({
1294
+ const Tt = Oe({
1295
1295
  types: {
1296
1296
  context: {},
1297
1297
  events: {}
@@ -1605,14 +1605,14 @@ const St = De({
1605
1605
  }
1606
1606
  }
1607
1607
  });
1608
- class Ct {
1608
+ class St {
1609
1609
  actor;
1610
1610
  stateChangeListeners = /* @__PURE__ */ new Set();
1611
1611
  events;
1612
1612
  unsubscribeFromEvents;
1613
1613
  actorSubscription;
1614
1614
  constructor(e) {
1615
- this.events = e, this.actor = ye(St), this.actorSubscription = this.actor.subscribe((t) => {
1615
+ this.events = e, this.actor = De(Tt), this.actorSubscription = this.actor.subscribe((t) => {
1616
1616
  const s = t.value;
1617
1617
  this.stateChangeListeners.forEach((i) => {
1618
1618
  i(s);
@@ -1767,7 +1767,7 @@ class Ct {
1767
1767
  };
1768
1768
  }
1769
1769
  }
1770
- class Et {
1770
+ class Ct {
1771
1771
  events;
1772
1772
  getUaProtected;
1773
1773
  constructor(e) {
@@ -1804,7 +1804,7 @@ class Et {
1804
1804
  };
1805
1805
  }
1806
1806
  }
1807
- class At {
1807
+ class Et {
1808
1808
  uaFactory;
1809
1809
  getUaProtected;
1810
1810
  constructor(e) {
@@ -1869,7 +1869,7 @@ class At {
1869
1869
  });
1870
1870
  }
1871
1871
  }
1872
- const Nt = (n) => {
1872
+ const At = (n) => {
1873
1873
  const e = [];
1874
1874
  return n !== void 0 && n !== "" && e.push(`X-Vinteo-Remote: ${n}`), e;
1875
1875
  };
@@ -1881,7 +1881,7 @@ class D {
1881
1881
  static isRegisteredUA(e) {
1882
1882
  return !!e && e.isRegistered();
1883
1883
  }
1884
- static validateConfiguration({
1884
+ static validateParametersConnection({
1885
1885
  register: e,
1886
1886
  password: t,
1887
1887
  user: s,
@@ -1898,10 +1898,10 @@ class D {
1898
1898
  throw new Error("user is required for authorized connection");
1899
1899
  }
1900
1900
  static resolveAuthorizationUser(e, t) {
1901
- return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${xe()}`;
1901
+ return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${He()}`;
1902
1902
  }
1903
1903
  static buildExtraHeaders(e, t) {
1904
- const s = e !== void 0 && e !== "" ? Nt(e) : [];
1904
+ const s = e !== void 0 && e !== "" ? At(e) : [];
1905
1905
  return t === void 0 ? s : [...s, ...t];
1906
1906
  }
1907
1907
  createConfiguration({
@@ -1918,14 +1918,14 @@ class D {
1918
1918
  connectionRecoveryMaxInterval: T = 6,
1919
1919
  userAgent: S
1920
1920
  }) {
1921
- D.validateConfiguration({
1921
+ D.validateParametersConnection({
1922
1922
  register: a,
1923
1923
  password: t,
1924
1924
  user: e,
1925
1925
  sipServerUrl: r,
1926
1926
  sipWebSocketServerURL: s
1927
1927
  });
1928
- const g = D.resolveAuthorizationUser(a, e), C = We(r), m = C(g), I = new this.JsSIP.WebSocketInterface(s);
1928
+ const g = D.resolveAuthorizationUser(a, e), C = qe(r), m = C(g), I = new this.JsSIP.WebSocketInterface(s);
1929
1929
  return {
1930
1930
  configuration: {
1931
1931
  password: t,
@@ -1965,8 +1965,8 @@ class D {
1965
1965
  }), { ua: r, helpers: i };
1966
1966
  }
1967
1967
  }
1968
- const Te = "Not ready for connection", Rt = (n) => n instanceof Error && n.message === Te, It = () => new Error(Te), pt = async (n) => typeof n == "function" ? n() : n;
1969
- class mt {
1968
+ const Te = "Not ready for connection", Nt = (n) => n instanceof Error && n.message === Te, Rt = () => new Error(Te), It = async (n) => typeof n == "function" ? n() : n;
1969
+ class pt {
1970
1970
  events;
1971
1971
  ua;
1972
1972
  socket;
@@ -1978,15 +1978,15 @@ class mt {
1978
1978
  configurationManager;
1979
1979
  JsSIP;
1980
1980
  constructor({ JsSIP: e }) {
1981
- this.JsSIP = e, this.events = new U(ge), this.uaFactory = new D(e), this.registrationManager = new Et({
1981
+ this.JsSIP = e, this.events = new U(ge), this.uaFactory = new D(e), this.registrationManager = new Ct({
1982
1982
  events: this.events,
1983
1983
  getUaProtected: this.getUaProtected
1984
- }), this.stateMachine = new Ct(this.events), this.configurationManager = new lt({
1984
+ }), this.stateMachine = new St(this.events), this.configurationManager = new ht({
1985
1985
  getUa: this.getUa
1986
- }), this.sipOperations = new At({
1986
+ }), this.sipOperations = new Et({
1987
1987
  uaFactory: this.uaFactory,
1988
1988
  getUaProtected: this.getUaProtected
1989
- }), this.connectionFlow = new Tt({
1989
+ }), this.connectionFlow = new ut({
1990
1990
  JsSIP: this.JsSIP,
1991
1991
  events: this.events,
1992
1992
  uaFactory: this.uaFactory,
@@ -2092,7 +2092,7 @@ class mt {
2092
2092
  getUa = () => this.ua;
2093
2093
  connectWithProcessError = async (e, t) => {
2094
2094
  if (!(t?.hasReadyForConnection?.() ?? !0))
2095
- throw It();
2095
+ throw Rt();
2096
2096
  return this.processConnect(e, t).catch(async (i) => {
2097
2097
  const r = i;
2098
2098
  return this.disconnect().then(() => {
@@ -2102,12 +2102,12 @@ class mt {
2102
2102
  });
2103
2103
  });
2104
2104
  };
2105
- processConnect = async (e, t) => (this.events.trigger(A.CONNECT_STARTED, {}), pt(e).then(async (s) => this.connectionFlow.connect(s, t)).then((s) => (this.events.trigger(A.CONNECT_SUCCEEDED, { ua: s }), s)).catch((s) => {
2105
+ processConnect = async (e, t) => (this.events.trigger(A.CONNECT_STARTED, {}), It(e).then(async (s) => this.connectionFlow.connect(s, t)).then((s) => (this.events.trigger(A.CONNECT_SUCCEEDED, { ua: s }), s)).catch((s) => {
2106
2106
  const i = s ?? new Error("Failed to connect to server");
2107
2107
  throw this.events.trigger(A.CONNECT_FAILED, i), i;
2108
2108
  }));
2109
2109
  }
2110
- class _t {
2110
+ class mt {
2111
2111
  connectionManager;
2112
2112
  stackPromises = te({
2113
2113
  noRunIsNotActual: !0
@@ -2128,12 +2128,12 @@ const Se = [
2128
2128
  "failed-attempt",
2129
2129
  "cancelled-attempt",
2130
2130
  "changed-attempt-status"
2131
- ], z = 0, Mt = 30;
2132
- class vt {
2131
+ ], z = 0, _t = 30;
2132
+ class Mt {
2133
2133
  events;
2134
2134
  countInner = z;
2135
2135
  initialCount = z;
2136
- limitInner = Mt;
2136
+ limitInner = _t;
2137
2137
  isInProgress = !1;
2138
2138
  constructor({ events: e }) {
2139
2139
  this.events = e;
@@ -2166,7 +2166,7 @@ class vt {
2166
2166
  this.events.trigger(O.CHANGED_ATTEMPT_STATUS, { isInProgress: this.isInProgress });
2167
2167
  }
2168
2168
  }
2169
- class ft {
2169
+ class vt {
2170
2170
  connectionManager;
2171
2171
  interval;
2172
2172
  checkTelephonyByTimeout = void 0;
@@ -2182,7 +2182,7 @@ class ft {
2182
2182
  onSuccessRequest: t,
2183
2183
  onFailRequest: s
2184
2184
  }) {
2185
- this.stop(), this.cancelableBeforeRequest = new G(e), this.checkTelephonyByTimeout = Me({
2185
+ this.stop(), this.cancelableBeforeRequest = new G(e), this.checkTelephonyByTimeout = _e({
2186
2186
  isDontStopOnFail: !0,
2187
2187
  requestInterval: this.interval,
2188
2188
  request: async () => {
@@ -2202,15 +2202,15 @@ class ft {
2202
2202
  this.checkTelephonyByTimeout?.stop(), this.checkTelephonyByTimeout = void 0, this.cancelableBeforeRequest?.cancelRequest(), this.cancelableBeforeRequest = void 0;
2203
2203
  }
2204
2204
  }
2205
- const Pt = 15e3, Ot = 2;
2206
- class Dt {
2205
+ const ft = 15e3, Pt = 2;
2206
+ class Ot {
2207
2207
  connectionManager;
2208
2208
  pingServerByTimeoutWithFailCalls;
2209
2209
  constructor({ connectionManager: e }) {
2210
- this.connectionManager = e, this.pingServerByTimeoutWithFailCalls = ve(Ot, {
2210
+ this.connectionManager = e, this.pingServerByTimeoutWithFailCalls = Me(Pt, {
2211
2211
  whenPossibleRequest: async () => {
2212
2212
  },
2213
- requestInterval: Pt,
2213
+ requestInterval: ft,
2214
2214
  request: async () => (d("ping"), this.connectionManager.ping().then(() => {
2215
2215
  d("ping success");
2216
2216
  }))
@@ -2223,7 +2223,7 @@ class Dt {
2223
2223
  this.pingServerByTimeoutWithFailCalls.stop();
2224
2224
  }
2225
2225
  }
2226
- class yt {
2226
+ class Dt {
2227
2227
  callManager;
2228
2228
  pingServerRequester;
2229
2229
  disposeCallStatusChange;
@@ -2231,7 +2231,7 @@ class yt {
2231
2231
  connectionManager: e,
2232
2232
  callManager: t
2233
2233
  }) {
2234
- this.callManager = t, this.pingServerRequester = new Dt({
2234
+ this.callManager = t, this.pingServerRequester = new Ot({
2235
2235
  connectionManager: e
2236
2236
  });
2237
2237
  }
@@ -2250,7 +2250,7 @@ class yt {
2250
2250
  this.callManager.isCallActive ? this.pingServerRequester.stop() : this.pingServerRequester.start({ onFailRequest: e });
2251
2251
  }
2252
2252
  }
2253
- class bt {
2253
+ class yt {
2254
2254
  connectionManager;
2255
2255
  callManager;
2256
2256
  isRegistrationFailed = !1;
@@ -2284,9 +2284,9 @@ class bt {
2284
2284
  this.isRegistrationFailed = !1;
2285
2285
  }
2286
2286
  }
2287
- const Ce = "Parameters are missing", wt = (n) => n instanceof Error && n.message === Ce, Qn = () => new Error(Ce), Ut = 3e3, Lt = 15e3, Bt = async () => {
2288
- };
2289
- class Ft {
2287
+ const bt = 3e3, wt = 15e3, Ut = async () => {
2288
+ }, Lt = (n) => !0;
2289
+ class Bt {
2290
2290
  events;
2291
2291
  connectionManager;
2292
2292
  connectionQueueManager;
@@ -2297,25 +2297,26 @@ class Ft {
2297
2297
  delayBetweenAttempts;
2298
2298
  cancelableRequestBeforeRetry;
2299
2299
  onBeforeRetry;
2300
+ canRetryOnError;
2300
2301
  constructor({
2301
2302
  connectionQueueManager: e,
2302
2303
  connectionManager: t,
2303
2304
  callManager: s
2304
2305
  }, i) {
2305
- const r = i?.onBeforeRetry ?? Bt;
2306
- this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.events = new k(Se), this.checkTelephonyRequester = new ft({
2306
+ const r = i?.onBeforeRetry ?? Ut, a = i?.canRetryOnError ?? Lt;
2307
+ this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.canRetryOnError = a, this.events = new k(Se), this.checkTelephonyRequester = new vt({
2307
2308
  connectionManager: t,
2308
- interval: i?.checkTelephonyRequestInterval ?? Lt
2309
- }), this.pingServerIfNotActiveCallRequester = new yt({
2309
+ interval: i?.checkTelephonyRequestInterval ?? wt
2310
+ }), this.pingServerIfNotActiveCallRequester = new Dt({
2310
2311
  connectionManager: t,
2311
2312
  callManager: s
2312
- }), this.registrationFailedOutOfCallSubscriber = new bt({
2313
+ }), this.registrationFailedOutOfCallSubscriber = new yt({
2313
2314
  connectionManager: t,
2314
2315
  callManager: s
2315
- }), this.attemptsState = new vt({
2316
+ }), this.attemptsState = new Mt({
2316
2317
  events: this.events
2317
- }), this.cancelableRequestBeforeRetry = new G(r), this.delayBetweenAttempts = new fe(
2318
- i?.timeoutBetweenAttempts ?? Ut
2318
+ }), this.cancelableRequestBeforeRetry = new G(r), this.delayBetweenAttempts = new ve(
2319
+ i?.timeoutBetweenAttempts ?? bt
2319
2320
  );
2320
2321
  }
2321
2322
  start(e) {
@@ -2371,15 +2372,15 @@ class Ft {
2371
2372
  try {
2372
2373
  await this.connectionQueueManager.connect(e.getParameters, e.options), d("processConnect success"), this.handleSucceededAttempt(e);
2373
2374
  } catch (t) {
2374
- if (Rt(t)) {
2375
+ if (Nt(t)) {
2375
2376
  this.handleSucceededAttempt(e);
2376
2377
  return;
2377
2378
  }
2378
- if (wt(t)) {
2379
- d("processConnect: parameters not exist error", t);
2379
+ if (!this.canRetryOnError(t)) {
2380
+ d("processConnect: error does not allow retry", t);
2380
2381
  return;
2381
2382
  }
2382
- if (be(t)) {
2383
+ if (ye(t)) {
2383
2384
  d("processConnect: not actual error", t), this.events.trigger(O.CANCELLED_ATTEMPT, t);
2384
2385
  return;
2385
2386
  }
@@ -2408,7 +2409,7 @@ class Ft {
2408
2409
  reconnect(e) {
2409
2410
  d("reconnect"), this.delayBetweenAttempts.request().then(async () => (d("reconnect: delayBetweenAttempts success"), this.cancelableRequestBeforeRetry.request())).then(async () => (d("reconnect: onBeforeRetry success"), this.connect(e))).catch((t) => {
2410
2411
  const s = t instanceof Error ? t : new Error("Failed to reconnect");
2411
- _e(t) || Pe(t) ? this.events.trigger(O.CANCELLED_ATTEMPT, s) : this.events.trigger(O.FAILED_ATTEMPT, s), d("reconnect: error", t);
2412
+ me(t) || fe(t) ? this.events.trigger(O.CANCELLED_ATTEMPT, s) : this.events.trigger(O.FAILED_ATTEMPT, s), d("reconnect: error", t);
2412
2413
  });
2413
2414
  }
2414
2415
  hasFailedOrDisconnectedConnection() {
@@ -2417,18 +2418,18 @@ class Ft {
2417
2418
  }
2418
2419
  }
2419
2420
  var w = /* @__PURE__ */ ((n) => (n.INCOMING_CALL = "incomingCall", n.DECLINED_INCOMING_CALL = "declinedIncomingCall", n.TERMINATED_INCOMING_CALL = "terminatedIncomingCall", n.FAILED_INCOMING_CALL = "failedIncomingCall", n))(w || {});
2420
- const Ee = [
2421
+ const Ce = [
2421
2422
  "incomingCall",
2422
2423
  "declinedIncomingCall",
2423
2424
  "terminatedIncomingCall",
2424
2425
  "failedIncomingCall"
2425
- ], kt = 486, $t = 487;
2426
- class Vt {
2426
+ ], Ft = 486, kt = 487;
2427
+ class $t {
2427
2428
  events;
2428
2429
  incomingRTCSession;
2429
2430
  connectionManager;
2430
2431
  constructor(e) {
2431
- this.connectionManager = e, this.events = new U(Ee), this.start();
2432
+ this.connectionManager = e, this.events = new U(Ce), this.start();
2432
2433
  }
2433
2434
  get remoteCallerData() {
2434
2435
  return {
@@ -2458,7 +2459,7 @@ class Vt {
2458
2459
  return this.removeIncomingSession(), e;
2459
2460
  };
2460
2461
  async declineToIncomingCall({
2461
- statusCode: e = $t
2462
+ statusCode: e = kt
2462
2463
  } = {}) {
2463
2464
  return new Promise((t, s) => {
2464
2465
  try {
@@ -2470,7 +2471,7 @@ class Vt {
2470
2471
  });
2471
2472
  }
2472
2473
  async busyIncomingCall() {
2473
- return this.declineToIncomingCall({ statusCode: kt });
2474
+ return this.declineToIncomingCall({ statusCode: Ft });
2474
2475
  }
2475
2476
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2476
2477
  on(e, t) {
@@ -2516,10 +2517,10 @@ class Vt {
2516
2517
  }
2517
2518
  const b = 1e3;
2518
2519
  var E = /* @__PURE__ */ ((n) => (n.INBOUND_RTP = "inbound-rtp", n.REMOTE_OUTBOUND_RTP = "remote-outbound-rtp", n.MEDIA_SOURCE = "media-source", n.OUTBOUND_RTP = "outbound-rtp", n.REMOTE_INBOUND_RTP = "remote-inbound-rtp", n.CODEC = "codec", n.CANDIDATE_PAIR = "candidate-pair", n.CERTIFICATE = "certificate", n.TRANSPORT = "transport", n.LOCAL_CANDIDATE = "local-candidate", n.REMOTE_CANDIDATE = "remote-candidate", n))(E || {});
2519
- const Ae = ["collected"], X = () => "performance" in window ? performance.now() : Date.now(), L = (n) => [...n.keys()].reduce((e, t) => {
2520
+ const Ee = ["collected"], X = () => "performance" in window ? performance.now() : Date.now(), L = (n) => [...n.keys()].reduce((e, t) => {
2520
2521
  const s = n.get(t);
2521
2522
  return s === void 0 ? e : { ...e, [s.type]: s };
2522
- }, {}), qt = (n) => {
2523
+ }, {}), Vt = (n) => {
2523
2524
  if (!n)
2524
2525
  return {
2525
2526
  outboundRtp: void 0,
@@ -2565,7 +2566,7 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2565
2566
  codec: t[E.CODEC],
2566
2567
  synchronizationSources: e
2567
2568
  };
2568
- }, Wt = ({
2569
+ }, qt = ({
2569
2570
  audioReceiverStats: n,
2570
2571
  synchronizationSourcesAudio: e
2571
2572
  }) => {
@@ -2583,7 +2584,7 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2583
2584
  remoteOutboundRtp: t[E.REMOTE_OUTBOUND_RTP],
2584
2585
  synchronizationSources: e
2585
2586
  };
2586
- }, Ne = (n) => {
2587
+ }, Ae = (n) => {
2587
2588
  if (!n)
2588
2589
  return {
2589
2590
  candidatePair: void 0,
@@ -2600,18 +2601,18 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2600
2601
  remoteCandidate: e[E.REMOTE_CANDIDATE],
2601
2602
  transport: e[E.TRANSPORT]
2602
2603
  };
2603
- }, Ht = ({
2604
+ }, Wt = ({
2604
2605
  audioSenderStats: n,
2605
2606
  videoSenderFirstStats: e,
2606
2607
  videoSenderSecondStats: t
2607
2608
  }) => ({
2608
2609
  video: J(e),
2609
2610
  secondVideo: J(t),
2610
- audio: qt(n),
2611
- additional: Ne(
2611
+ audio: Vt(n),
2612
+ additional: Ae(
2612
2613
  n ?? e ?? t
2613
2614
  )
2614
- }), xt = ({
2615
+ }), Ht = ({
2615
2616
  audioReceiverStats: n,
2616
2617
  videoReceiverFirstStats: e,
2617
2618
  videoReceiverSecondStats: t,
@@ -2625,14 +2626,14 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2625
2626
  videoReceiversStats: t,
2626
2627
  synchronizationSourcesVideo: s.video
2627
2628
  }),
2628
- audio: Wt({
2629
+ audio: qt({
2629
2630
  audioReceiverStats: n,
2630
2631
  synchronizationSourcesAudio: s.audio
2631
2632
  }),
2632
- additional: Ne(
2633
+ additional: Ae(
2633
2634
  n ?? e ?? t
2634
2635
  )
2635
- }), Gt = ({
2636
+ }), xt = ({
2636
2637
  audioSenderStats: n,
2637
2638
  videoSenderFirstStats: e,
2638
2639
  videoSenderSecondStats: t,
@@ -2641,11 +2642,11 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2641
2642
  videoReceiverSecondStats: r,
2642
2643
  synchronizationSources: a
2643
2644
  }) => {
2644
- const o = Ht({
2645
+ const o = Wt({
2645
2646
  audioSenderStats: n,
2646
2647
  videoSenderFirstStats: e,
2647
2648
  videoSenderSecondStats: t
2648
- }), c = xt({
2649
+ }), c = Ht({
2649
2650
  audioReceiverStats: s,
2650
2651
  videoReceiverFirstStats: i,
2651
2652
  videoReceiverSecondStats: r,
@@ -2655,7 +2656,7 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2655
2656
  outbound: o,
2656
2657
  inbound: c
2657
2658
  };
2658
- }, Qt = async (n) => {
2659
+ }, Gt = async (n) => {
2659
2660
  const e = "audio", t = "video", s = n.getSenders(), i = s.find((g) => g.track?.kind === e), r = s.filter((g) => g.track?.kind === t), a = n.getReceivers(), o = a.find((g) => g.track.kind === e), c = a.filter((g) => g.track.kind === t), h = {
2660
2661
  trackIdentifier: o?.track.id,
2661
2662
  item: o?.getSynchronizationSources()[0]
@@ -2692,22 +2693,22 @@ const Ae = ["collected"], X = () => "performance" in window ? performance.now()
2692
2693
  videoReceiverSecondStats: $
2693
2694
  };
2694
2695
  });
2695
- }, Yt = (n) => {
2696
+ }, Qt = (n) => {
2696
2697
  d(String(n));
2697
2698
  };
2698
- class zt {
2699
+ class Yt {
2699
2700
  events;
2700
2701
  setTimeoutRequest;
2701
- requesterAllStatistics = new G(Qt);
2702
+ requesterAllStatistics = new G(Gt);
2702
2703
  constructor() {
2703
- this.events = new k(Ae), this.setTimeoutRequest = new Z();
2704
+ this.events = new k(Ee), this.setTimeoutRequest = new Z();
2704
2705
  }
2705
2706
  get requested() {
2706
2707
  return this.setTimeoutRequest.requested;
2707
2708
  }
2708
2709
  start(e, {
2709
2710
  interval: t = b,
2710
- onError: s = Yt
2711
+ onError: s = Qt
2711
2712
  } = {}) {
2712
2713
  this.stop(), this.setTimeoutRequest.request(() => {
2713
2714
  this.collectStatistics(e, {
@@ -2738,7 +2739,7 @@ class zt {
2738
2739
  }) => {
2739
2740
  const s = X();
2740
2741
  this.requesterAllStatistics.request(e).then((i) => {
2741
- this.events.trigger("collected", Gt(i));
2742
+ this.events.trigger("collected", xt(i));
2742
2743
  const a = X() - s;
2743
2744
  let o = b;
2744
2745
  a > 48 ? o = b * 4 : a > 32 ? o = b * 3 : a > 16 && (o = b * 2), this.start(e, {
@@ -2750,7 +2751,7 @@ class zt {
2750
2751
  });
2751
2752
  };
2752
2753
  }
2753
- class Xt {
2754
+ class zt {
2754
2755
  availableIncomingBitrate;
2755
2756
  statsPeerConnection;
2756
2757
  callManager;
@@ -2760,7 +2761,7 @@ class Xt {
2760
2761
  callManager: e,
2761
2762
  apiManager: t
2762
2763
  }) {
2763
- this.callManager = e, this.apiManager = t, this.statsPeerConnection = new zt(), this.subscribe();
2764
+ this.callManager = e, this.apiManager = t, this.statsPeerConnection = new Yt(), this.subscribe();
2764
2765
  }
2765
2766
  get events() {
2766
2767
  return this.statsPeerConnection.events;
@@ -2802,26 +2803,26 @@ class Xt {
2802
2803
  });
2803
2804
  }
2804
2805
  }
2805
- const Jt = (n, e) => n.filter((s) => e.some((i) => i.clockRate === s.clockRate && i.mimeType === s.mimeType && i.channels === s.channels && i.sdpFmtpLine === s.sdpFmtpLine)), Kt = (n) => {
2806
+ const Xt = (n, e) => n.filter((s) => e.some((i) => i.clockRate === s.clockRate && i.mimeType === s.mimeType && i.channels === s.channels && i.sdpFmtpLine === s.sdpFmtpLine)), Jt = (n) => {
2806
2807
  const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, i = t === null ? [] : t.codecs;
2807
- return Jt(s, i);
2808
- }, jt = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
2808
+ return Xt(s, i);
2809
+ }, Kt = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
2809
2810
  const i = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), a = i === -1 ? Number.MAX_VALUE : i, o = r === -1 ? Number.MAX_VALUE : r;
2810
2811
  return a - o;
2811
- }), Zt = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), en = (n, {
2812
+ }), jt = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), Zt = (n, {
2812
2813
  preferredMimeTypesVideoCodecs: e,
2813
2814
  excludeMimeTypesVideoCodecs: t
2814
2815
  }) => {
2815
2816
  try {
2816
2817
  if (typeof n.setCodecPreferences == "function" && n.sender.track?.kind === "video" && (e !== void 0 && e.length > 0 || t !== void 0 && t.length > 0)) {
2817
- const s = Kt("video"), i = Zt(s, t), r = jt(i, e);
2818
+ const s = Jt("video"), i = jt(s, t), r = Kt(i, e);
2818
2819
  n.setCodecPreferences(r);
2819
2820
  }
2820
2821
  } catch (s) {
2821
2822
  d("setCodecPreferences error", s);
2822
2823
  }
2823
2824
  };
2824
- class tn {
2825
+ class en {
2825
2826
  /**
2826
2827
  * Хранилище основных transceiver'ов
2827
2828
  */
@@ -2928,14 +2929,14 @@ class tn {
2928
2929
  this.clear();
2929
2930
  };
2930
2931
  }
2931
- const nn = (n) => [...n.keys()].map((e) => n.get(e)), sn = (n, e) => nn(n).find((t) => t?.type === e), rn = async (n) => n.getStats().then((e) => sn(e, "codec")?.mimeType);
2932
- class an {
2932
+ const tn = (n) => [...n.keys()].map((e) => n.get(e)), nn = (n, e) => tn(n).find((t) => t?.type === e), sn = async (n) => n.getStats().then((e) => nn(e, "codec")?.mimeType);
2933
+ class rn {
2933
2934
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
2934
2935
  async getCodecFromSender(e) {
2935
- return await rn(e) ?? "";
2936
+ return await sn(e) ?? "";
2936
2937
  }
2937
2938
  }
2938
- class on {
2939
+ class an {
2939
2940
  stackPromises = te({
2940
2941
  noRunIsNotActual: !0
2941
2942
  });
@@ -2960,11 +2961,11 @@ class on {
2960
2961
  });
2961
2962
  }
2962
2963
  }
2963
- class cn {
2964
+ class on {
2964
2965
  taskQueue;
2965
2966
  onSetParameters;
2966
2967
  constructor(e) {
2967
- this.onSetParameters = e, this.taskQueue = new on();
2968
+ this.onSetParameters = e, this.taskQueue = new an();
2968
2969
  }
2969
2970
  async setEncodingsToSender(e, t) {
2970
2971
  return this.taskQueue.add(async () => de(e, t, this.onSetParameters));
@@ -2973,17 +2974,17 @@ class cn {
2973
2974
  this.taskQueue.stop();
2974
2975
  }
2975
2976
  }
2976
- const Re = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), dn = 1e6, M = (n) => n * dn, Ie = M(0.06), pe = M(4), hn = (n) => n <= 64 ? Ie : n <= 128 ? M(0.12) : n <= 256 ? M(0.25) : n <= 384 ? M(0.32) : n <= 426 ? M(0.38) : n <= 640 ? M(0.5) : n <= 848 ? M(0.7) : n <= 1280 ? M(1) : n <= 1920 ? M(2) : pe, ln = "av1", gn = (n) => Re(n, ln), un = 0.6, Y = (n, e) => gn(e) ? n * un : n, Tn = (n) => Y(Ie, n), Sn = (n) => Y(pe, n), j = (n, e) => {
2977
- const t = hn(n);
2977
+ const Ne = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), cn = 1e6, M = (n) => n * cn, Re = M(0.06), Ie = M(4), dn = (n) => n <= 64 ? Re : n <= 128 ? M(0.12) : n <= 256 ? M(0.25) : n <= 384 ? M(0.32) : n <= 426 ? M(0.38) : n <= 640 ? M(0.5) : n <= 848 ? M(0.7) : n <= 1280 ? M(1) : n <= 1920 ? M(2) : Ie, hn = "av1", ln = (n) => Ne(n, hn), gn = 0.6, Y = (n, e) => ln(e) ? n * gn : n, un = (n) => Y(Re, n), Tn = (n) => Y(Ie, n), j = (n, e) => {
2978
+ const t = dn(n);
2978
2979
  return Y(t, e);
2979
- }, V = 1, Cn = ({
2980
+ }, V = 1, Sn = ({
2980
2981
  videoTrack: n,
2981
2982
  targetSize: e
2982
2983
  }) => {
2983
2984
  const t = n.getSettings(), s = t.width, i = t.height, r = s === void 0 ? V : s / e.width, a = i === void 0 ? V : i / e.height;
2984
2985
  return Math.max(r, a, V);
2985
2986
  };
2986
- class En {
2987
+ class Cn {
2987
2988
  ignoreForCodec;
2988
2989
  senderFinder;
2989
2990
  codecProvider;
@@ -3016,7 +3017,7 @@ class En {
3016
3017
  if (!i?.track)
3017
3018
  return { ...this.resultNoChanged, sender: i };
3018
3019
  const r = await this.codecProvider.getCodecFromSender(i);
3019
- if (Re(r, this.ignoreForCodec))
3020
+ if (Ne(r, this.ignoreForCodec))
3020
3021
  return { ...this.resultNoChanged, sender: i };
3021
3022
  const { mainCam: a, resolutionMainCam: o } = t ?? {};
3022
3023
  return this.processSender(
@@ -3058,7 +3059,7 @@ class En {
3058
3059
  async downgradeResolutionSender(e) {
3059
3060
  const { sender: t, codec: s } = e, i = {
3060
3061
  scaleResolutionDownBy: 200,
3061
- maxBitrate: Tn(s)
3062
+ maxBitrate: un(s)
3062
3063
  };
3063
3064
  return this.parametersSetter.setEncodingsToSender(t, i);
3064
3065
  }
@@ -3068,7 +3069,7 @@ class En {
3068
3069
  * @returns Promise с результатом
3069
3070
  */
3070
3071
  async setBitrateByTrackResolution(e) {
3071
- const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ? Sn(i) : j(a, i);
3072
+ const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ? Tn(i) : j(a, i);
3072
3073
  return this.parametersSetter.setEncodingsToSender(t, {
3073
3074
  scaleResolutionDownBy: 1,
3074
3075
  maxBitrate: o
@@ -3084,7 +3085,7 @@ class En {
3084
3085
  const [s, i] = e.split("x"), { sender: r, videoTrack: a, codec: o } = t, c = {
3085
3086
  width: Number(s),
3086
3087
  height: Number(i)
3087
- }, h = Cn({
3088
+ }, h = Sn({
3088
3089
  videoTrack: a,
3089
3090
  targetSize: c
3090
3091
  }), T = j(c.width, o), S = {
@@ -3094,14 +3095,14 @@ class En {
3094
3095
  return this.parametersSetter.setEncodingsToSender(r, S);
3095
3096
  }
3096
3097
  }
3097
- const An = (n) => n.find((e) => e.track?.kind === "video");
3098
- class Nn {
3098
+ const En = (n) => n.find((e) => e.track?.kind === "video");
3099
+ class An {
3099
3100
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
3100
3101
  findVideoSender(e) {
3101
- return An(e);
3102
+ return En(e);
3102
3103
  }
3103
3104
  }
3104
- class Rn {
3105
+ class Nn {
3105
3106
  currentSender;
3106
3107
  originalReplaceTrack;
3107
3108
  lastWidth;
@@ -3165,7 +3166,7 @@ class Rn {
3165
3166
  this.setTimeoutRequest.cancelRequest(), this.lastWidth = void 0, this.lastHeight = void 0;
3166
3167
  }
3167
3168
  }
3168
- class In {
3169
+ class Rn {
3169
3170
  apiManager;
3170
3171
  currentHandler;
3171
3172
  constructor(e) {
@@ -3185,7 +3186,7 @@ class In {
3185
3186
  this.currentHandler && (this.apiManager.off("main-cam-control", this.currentHandler), this.currentHandler = void 0);
3186
3187
  }
3187
3188
  }
3188
- class pn {
3189
+ class In {
3189
3190
  eventHandler;
3190
3191
  senderBalancer;
3191
3192
  parametersSetterWithQueue;
@@ -3197,16 +3198,16 @@ class pn {
3197
3198
  onSetParameters: i,
3198
3199
  pollIntervalMs: r
3199
3200
  } = {}) {
3200
- this.getConnection = t, this.eventHandler = new In(e), this.parametersSetterWithQueue = new cn(i), this.senderBalancer = new En(
3201
+ this.getConnection = t, this.eventHandler = new Rn(e), this.parametersSetterWithQueue = new on(i), this.senderBalancer = new Cn(
3201
3202
  {
3202
- senderFinder: new Nn(),
3203
- codecProvider: new an(),
3203
+ senderFinder: new An(),
3204
+ codecProvider: new rn(),
3204
3205
  parametersSetter: this.parametersSetterWithQueue
3205
3206
  },
3206
3207
  {
3207
3208
  ignoreForCodec: s
3208
3209
  }
3209
- ), this.trackMonitor = new Rn({ pollIntervalMs: r });
3210
+ ), this.trackMonitor = new Nn({ pollIntervalMs: r });
3210
3211
  }
3211
3212
  /**
3212
3213
  * Подписывается на события управления главной камерой
@@ -3251,13 +3252,13 @@ class pn {
3251
3252
  });
3252
3253
  };
3253
3254
  }
3254
- const me = [
3255
+ const pe = [
3255
3256
  "balancing-scheduled",
3256
3257
  "balancing-started",
3257
3258
  "balancing-stopped",
3258
3259
  "parameters-updated"
3259
3260
  ];
3260
- class mn {
3261
+ class pn {
3261
3262
  isBalancingActive = !1;
3262
3263
  events;
3263
3264
  callManager;
@@ -3265,7 +3266,7 @@ class mn {
3265
3266
  videoSendingBalancer;
3266
3267
  startBalancingTimer;
3267
3268
  constructor(e, t, s = {}) {
3268
- this.events = new k(me), this.callManager = e, this.balancingStartDelay = s.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new pn(
3269
+ this.events = new k(pe), this.callManager = e, this.balancingStartDelay = s.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new In(
3269
3270
  t,
3270
3271
  () => e.connection,
3271
3272
  {
@@ -3335,17 +3336,17 @@ class mn {
3335
3336
  this.startBalancingTimer && (clearTimeout(this.startBalancingTimer), this.startBalancingTimer = void 0);
3336
3337
  }
3337
3338
  }
3338
- const _n = 1e6, Mn = Se.map((n) => `auto-connect:${n}`), vn = ge.map((n) => `connection:${n}`), fn = ie.map((n) => `call:${n}`), Pn = ne.map((n) => `api:${n}`), On = Ee.map((n) => `incoming-call:${n}`), Dn = he.map((n) => `presentation:${n}`), yn = Ae.map((n) => `stats:${n}`), bn = me.map((n) => `video-balancer:${n}`), wn = [
3339
+ const mn = 1e6, _n = Se.map((n) => `auto-connect:${n}`), Mn = ge.map((n) => `connection:${n}`), vn = ie.map((n) => `call:${n}`), fn = ne.map((n) => `api:${n}`), Pn = Ce.map((n) => `incoming-call:${n}`), On = he.map((n) => `presentation:${n}`), Dn = Ee.map((n) => `stats:${n}`), yn = pe.map((n) => `video-balancer:${n}`), bn = [
3340
+ ..._n,
3339
3341
  ...Mn,
3340
3342
  ...vn,
3341
3343
  ...fn,
3342
3344
  ...Pn,
3343
3345
  ...On,
3344
3346
  ...Dn,
3345
- ...yn,
3346
- ...bn
3347
+ ...yn
3347
3348
  ];
3348
- class Yn {
3349
+ class Gn {
3349
3350
  events;
3350
3351
  connectionManager;
3351
3352
  connectionQueueManager;
@@ -3365,28 +3366,28 @@ class Yn {
3365
3366
  videoBalancerOptions: i,
3366
3367
  autoConnectorOptions: r
3367
3368
  } = {}) {
3368
- this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = new U(wn), this.connectionManager = new mt({ JsSIP: e }), this.connectionQueueManager = new _t({
3369
+ this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = new U(bn), this.connectionManager = new pt({ JsSIP: e }), this.connectionQueueManager = new mt({
3369
3370
  connectionManager: this.connectionManager
3370
- }), this.callManager = new Xe(), this.apiManager = new ke({
3371
+ }), this.callManager = new ze(), this.apiManager = new Fe({
3371
3372
  connectionManager: this.connectionManager,
3372
3373
  callManager: this.callManager
3373
- }), this.incomingCallManager = new Vt(this.connectionManager), this.presentationManager = new ht({
3374
+ }), this.incomingCallManager = new $t(this.connectionManager), this.presentationManager = new dt({
3374
3375
  callManager: this.callManager,
3375
- maxBitrate: _n
3376
- }), this.statsManager = new Xt({
3376
+ maxBitrate: mn
3377
+ }), this.statsManager = new zt({
3377
3378
  callManager: this.callManager,
3378
3379
  apiManager: this.apiManager
3379
- }), this.autoConnectorManager = new Ft(
3380
+ }), this.autoConnectorManager = new Bt(
3380
3381
  {
3381
3382
  connectionQueueManager: this.connectionQueueManager,
3382
3383
  connectionManager: this.connectionManager,
3383
3384
  callManager: this.callManager
3384
3385
  },
3385
3386
  r
3386
- ), this.transceiverManager = new tn({
3387
+ ), this.transceiverManager = new en({
3387
3388
  callManager: this.callManager,
3388
3389
  apiManager: this.apiManager
3389
- }), this.videoSendingBalancerManager = new mn(
3390
+ }), this.videoSendingBalancerManager = new pn(
3390
3391
  this.callManager,
3391
3392
  this.apiManager,
3392
3393
  i
@@ -3571,7 +3572,7 @@ class Yn {
3571
3572
  return this.apiManager.askPermissionToEnableCam(...e);
3572
3573
  }
3573
3574
  setCodecPreferences(e) {
3574
- en(e, {
3575
+ Zt(e, {
3575
3576
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
3576
3577
  excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
3577
3578
  });
@@ -3592,20 +3593,19 @@ class Yn {
3592
3593
  }
3593
3594
  export {
3594
3595
  ae as E,
3595
- $e as O,
3596
- Yn as S,
3597
- at as a,
3598
- Fe as b,
3599
- Gn as c,
3600
- xn as d,
3601
- Hn as e,
3596
+ ke as O,
3597
+ Gn as S,
3598
+ rt as a,
3599
+ Be as b,
3600
+ xn as c,
3601
+ Hn as d,
3602
+ Wn as e,
3602
3603
  E as f,
3603
- zt as g,
3604
- Rt as h,
3605
- rn as i,
3606
- Qn as j,
3604
+ Yt as g,
3605
+ Nt as h,
3606
+ sn as i,
3607
3607
  d as l,
3608
3608
  F as p,
3609
- pt as r,
3609
+ It as r,
3610
3610
  de as s
3611
3611
  };