sip-connector 12.2.0 → 13.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.
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- var Z = Object.defineProperty;
2
- var ee = (n, e, t) => e in n ? Z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var l = (n, e, t) => ee(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { B as X, N as j, l as a, E as k, s as ne, a as te, P as se, b as re, S as Je } from "./SipConnector-BxDInUHC.js";
5
- import { i as ln, j as dn, m as Sn, k as mn, c as Cn, d as fn, f as hn, g as Rn, e as gn, h as pn } from "./SipConnector-BxDInUHC.js";
6
- import { sequentPromises as oe } from "sequent-promises";
7
- import { createStackPromises as ce } from "stack-promises";
8
- import { isCanceledError as ie } from "@krivega/cancelable-promise";
9
- import { hasCanceledError as ae } from "repeated-calls";
10
- import { debounce as ue } from "ts-debounce";
11
- import { default as En } from "debug";
12
- const x = (n) => {
1
+ var se = Object.defineProperty;
2
+ var oe = (n, e, t) => e in n ? se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var u = (n, e, t) => oe(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { B as G, N as K, l as a, E as L, s as re, a as ie, P as ce, b as ae, S as tn } from "./SipConnector-B4xLnl6L.js";
5
+ import { i as Cn, j as fn, m as mn, k as Rn, c as gn, d as pn, f as yn, g as Tn, e as En, h as bn } from "./SipConnector-B4xLnl6L.js";
6
+ import { sequentPromises as ue } from "sequent-promises";
7
+ import { createStackPromises as de } from "stack-promises";
8
+ import { isCanceledError as le } from "@krivega/cancelable-promise";
9
+ import { hasCanceledError as Se } from "repeated-calls";
10
+ import { debounce as he } from "ts-debounce";
11
+ import { default as An } from "debug";
12
+ const H = (n) => {
13
13
  const { url: e, cause: t } = n;
14
14
  let s = e;
15
- return (t === X || t === j) && (s = `${n.message.to.uri.user}@${n.message.to.uri.host}`), s;
15
+ return (t === G || t === K) && (s = `${n.message.to.uri.user}@${n.message.to.uri.host}`), s;
16
16
  };
17
- var W = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(W || {});
18
- const le = (n = new Error()) => {
19
- var r;
17
+ var q = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(q || {});
18
+ const Ce = (n = new Error()) => {
19
+ var o;
20
20
  const { cause: e, socket: t } = n;
21
21
  let s = "CONNECT_SERVER_FAILED";
22
22
  switch (e) {
@@ -24,19 +24,19 @@ const le = (n = new Error()) => {
24
24
  s = "WRONG_USER_OR_PASSWORD";
25
25
  break;
26
26
  }
27
- case X: {
27
+ case G: {
28
28
  s = "BAD_MEDIA_ERROR";
29
29
  break;
30
30
  }
31
- case j: {
31
+ case K: {
32
32
  s = "NOT_FOUND_ERROR";
33
33
  break;
34
34
  }
35
35
  default:
36
- t && ((r = t == null ? void 0 : t._ws) == null ? void 0 : r.readyState) === 3 ? s = "WS_CONNECTION_FAILED" : x(n) && (s = "CONNECT_SERVER_FAILED_BY_LINK");
36
+ t && ((o = t == null ? void 0 : t._ws) == null ? void 0 : o.readyState) === 3 ? s = "WS_CONNECTION_FAILED" : H(n) && (s = "CONNECT_SERVER_FAILED_BY_LINK");
37
37
  }
38
38
  return s;
39
- }, de = (n) => {
39
+ }, fe = (n) => {
40
40
  let e = "";
41
41
  try {
42
42
  e = JSON.stringify(n);
@@ -44,190 +44,190 @@ const le = (n = new Error()) => {
44
44
  a("failed to stringify message", t);
45
45
  }
46
46
  return e;
47
- }, Se = (n = new Error()) => {
48
- const { code: e, cause: t, message: s } = n, r = x(n), o = { code: "", cause: "", message: "" };
49
- return typeof s == "object" && s !== null ? o.message = de(s) : s && (o.message = String(s)), r && (o.link = r), e && (o.code = e), t && (o.cause = t), o;
50
- }, me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47
+ }, me = (n = new Error()) => {
48
+ const { code: e, cause: t, message: s } = n, o = H(n), r = { code: "", cause: "", message: "" };
49
+ return typeof s == "object" && s !== null ? r.message = fe(s) : s && (r.message = String(s)), o && (r.link = o), e && (r.code = e), t && (r.cause = t), r;
50
+ }, Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
51
  __proto__: null,
52
- EErrorTypes: W,
53
- getLinkError: x,
54
- getTypeFromError: le,
55
- getValuesFromError: Se
56
- }, Symbol.toStringTag, { value: "Module" })), Ce = ({
52
+ EErrorTypes: q,
53
+ getLinkError: H,
54
+ getTypeFromError: Ce,
55
+ getValuesFromError: me
56
+ }, Symbol.toStringTag, { value: "Module" })), ge = ({
57
57
  sessionId: n,
58
58
  remoteAddress: e,
59
59
  isMutedAudio: t,
60
60
  isMutedVideo: s,
61
- isRegistered: r,
62
- isPresentationCall: o
61
+ isRegistered: o,
62
+ isPresentationCall: r
63
63
  }) => {
64
- const c = [], i = t ? "0" : "1", u = s ? "0" : "1";
65
- return c.push(`X-Vinteo-Mic-State: ${i}`, `X-Vinteo-MainCam-State: ${u}`), r || c.push("X-Vinteo-Purgatory-Call: yes"), n && c.push(`X-Vinteo-Session: ${n}`), o && c.push("X-Vinteo-Presentation-Call: yes"), e && c.push(`X-Vinteo-Remote: ${e}`), c;
66
- }, fe = "[@*!|]", he = "_", Re = (n) => {
64
+ const i = [], c = t ? "0" : "1", d = s ? "0" : "1";
65
+ return i.push(`X-Vinteo-Mic-State: ${c}`, `X-Vinteo-MainCam-State: ${d}`), o || i.push("X-Vinteo-Purgatory-Call: yes"), n && i.push(`X-Vinteo-Session: ${n}`), r && i.push("X-Vinteo-Presentation-Call: yes"), e && i.push(`X-Vinteo-Remote: ${e}`), i;
66
+ }, pe = "[@*!|]", ye = "_", Te = (n) => {
67
67
  let e = n;
68
- return e = e.replaceAll(new RegExp(fe, "g"), he), e;
69
- }, ge = ({
68
+ return e = e.replaceAll(new RegExp(pe, "g"), ye), e;
69
+ }, Ee = ({
70
70
  appName: n,
71
71
  appVersion: e,
72
72
  browserName: t,
73
73
  browserVersion: s
74
74
  }) => {
75
- const o = `${Re(n)} ${e}`;
76
- return `ChromeNew - ${t ? `${t} ${s}, ${o}` : o}`;
77
- }, pe = ({
75
+ const r = `${Te(n)} ${e}`;
76
+ return `ChromeNew - ${t ? `${t} ${s}, ${r}` : r}`;
77
+ }, be = ({
78
78
  isUnifiedSdpSemantic: n,
79
79
  appVersion: e,
80
80
  browserName: t,
81
81
  browserVersion: s,
82
- appName: r
83
- }) => n ? ge({ appVersion: e, browserName: t, browserVersion: s, appName: r }) : "Chrome", G = "purgatory", P = (n) => n === G, ye = (n) => (e) => [...e].map((s) => async () => n(s)), Ee = async ({
82
+ appName: o
83
+ }) => n ? Ee({ appVersion: e, browserName: t, browserVersion: s, appName: o }) : "Chrome", Y = "purgatory", D = (n) => n === Y, Me = (n) => (e) => [...e].map((s) => async () => n(s)), Ae = async ({
84
84
  accumulatedKeys: n,
85
85
  sendKey: e,
86
86
  canRunTask: t
87
87
  }) => {
88
- const r = ye(e)(n);
89
- return oe(r, t);
90
- }, Te = (n) => (t) => (a("onStartMainCam"), n.onSession("admin-start-main-cam", t)), be = (n) => (t) => (a("onStartMic"), n.onSession("admin-start-mic", t)), Me = (n) => (t) => (a("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), _e = (n) => (t) => (a("onStopMic"), n.onSession("admin-stop-mic", t)), Ae = ({ sipConnector: n }) => {
91
- const e = (f, g) => ({ isSyncForced: p = !1 }) => {
92
- if (p) {
88
+ const o = Me(e)(n);
89
+ return ue(o, t);
90
+ }, _e = (n) => (t) => (a("onStartMainCam"), n.onSession("admin-start-main-cam", t)), ve = (n) => (t) => (a("onStartMic"), n.onSession("admin-start-mic", t)), Oe = (n) => (t) => (a("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), Ne = (n) => (t) => (a("onStopMic"), n.onSession("admin-stop-mic", t)), we = ({ sipConnector: n }) => {
91
+ const e = (f, p) => ({ isSyncForced: m = !1 }) => {
92
+ if (m) {
93
93
  f();
94
94
  return;
95
95
  }
96
- g();
97
- }, t = Te(n), s = Me(n), r = be(n), o = _e(n);
98
- let c = () => {
99
- }, i = () => {
100
- }, u = () => {
96
+ p();
97
+ }, t = _e(n), s = Oe(n), o = ve(n), r = Ne(n);
98
+ let i = () => {
99
+ }, c = () => {
100
+ }, d = () => {
101
101
  }, S = () => {
102
102
  };
103
103
  const C = ({
104
104
  onStartMainCamForced: f,
105
- onStartMainCamNotForced: g,
106
- onStopMainCamForced: p,
107
- onStopMainCamNotForced: b,
108
- onStartMicForced: _,
109
- onStartMicNotForced: A,
110
- onStopMicForced: v,
111
- onStopMicNotForced: O
105
+ onStartMainCamNotForced: p,
106
+ onStopMainCamForced: m,
107
+ onStopMainCamNotForced: R,
108
+ onStartMicForced: y,
109
+ onStartMicNotForced: T,
110
+ onStopMicForced: E,
111
+ onStopMicNotForced: b
112
112
  }) => {
113
- const y = e(
113
+ const _ = e(
114
114
  f,
115
- g
115
+ p
116
116
  );
117
- c = t(y);
118
- const E = e(
119
- p,
120
- b
117
+ i = t(_);
118
+ const v = e(
119
+ m,
120
+ R
121
121
  );
122
- i = s(E);
123
- const w = e(_, A);
124
- u = r(w);
125
- const M = e(v, O);
126
- S = o(M);
127
- }, m = () => {
128
- c(), i(), u(), S();
122
+ c = s(v);
123
+ const O = e(y, T);
124
+ d = o(O);
125
+ const N = e(E, b);
126
+ S = r(N);
127
+ }, h = () => {
128
+ i(), c(), d(), S();
129
129
  };
130
130
  return {
131
131
  start: (f) => {
132
132
  C(f);
133
133
  },
134
134
  stop: () => {
135
- m();
135
+ h();
136
136
  }
137
137
  };
138
- }, rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
138
+ }, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
139
139
  __proto__: null,
140
- PURGATORY_CONFERENCE_NUMBER: G,
141
- createSyncMediaState: Ae,
142
- error: me,
143
- getExtraHeaders: Ce,
144
- getUserAgent: pe,
145
- hasPurgatory: P,
146
- sendDTMFAccumulated: Ee
147
- }, Symbol.toStringTag, { value: "Module" })), ve = (n) => [...n.keys()].map((e) => n.get(e)), Oe = (n, e) => ve(n).find((t) => t.type === e), Ne = async (n) => n.getStats().then((e) => {
148
- const t = Oe(e, "codec");
140
+ PURGATORY_CONFERENCE_NUMBER: Y,
141
+ createSyncMediaState: we,
142
+ error: Re,
143
+ getExtraHeaders: ge,
144
+ getUserAgent: be,
145
+ hasPurgatory: D,
146
+ sendDTMFAccumulated: Ae
147
+ }, Symbol.toStringTag, { value: "Module" })), Be = (n) => [...n.keys()].map((e) => n.get(e)), Pe = (n, e) => Be(n).find((t) => t.type === e), De = async (n) => n.getStats().then((e) => {
148
+ const t = Pe(e, "codec");
149
149
  return t == null ? void 0 : t.mimeType;
150
- }), Be = (n) => n.find((e) => {
150
+ }), Ie = (n) => n.find((e) => {
151
151
  var t;
152
152
  return ((t = e == null ? void 0 : e.track) == null ? void 0 : t.kind) === "video";
153
- }), K = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), Pe = 1e6, h = (n) => n * Pe, q = h(0.06), we = h(4), De = (n) => n <= 64 ? q : n <= 128 ? h(0.12) : n <= 256 ? h(0.25) : n <= 384 ? h(0.32) : n <= 426 ? h(0.38) : n <= 640 ? h(0.5) : n <= 848 ? h(0.7) : n <= 1280 ? h(1) : n <= 1920 ? h(2) : we, Ie = "av1", Fe = (n) => K(n, Ie), ke = 0.6, Y = (n, e) => Fe(e) ? n * ke : n, Ue = (n) => Y(q, n), z = (n, e) => {
154
- const t = De(n);
155
- return Y(t, e);
156
- }, Le = 1, Q = ({
153
+ }), z = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), Fe = 1e6, g = (n) => n * Fe, Q = g(0.06), ke = g(4), Ue = (n) => n <= 64 ? Q : n <= 128 ? g(0.12) : n <= 256 ? g(0.25) : n <= 384 ? g(0.32) : n <= 426 ? g(0.38) : n <= 640 ? g(0.5) : n <= 848 ? g(0.7) : n <= 1280 ? g(1) : n <= 1920 ? g(2) : ke, Ve = "av1", Le = (n) => z(n, Ve), xe = 0.6, J = (n, e) => Le(e) ? n * xe : n, $e = (n) => J(Q, n), Z = (n, e) => {
154
+ const t = Ue(n);
155
+ return J(t, e);
156
+ }, He = 1, ee = ({
157
157
  videoTrack: n,
158
158
  targetSize: e,
159
159
  codec: t
160
160
  }) => {
161
- const s = n.getSettings(), r = s.width, o = s.height, c = r / e.width, i = o / e.height, u = Math.max(c, i, Le), S = z(e.width, t);
162
- return { scaleResolutionDownBy: u, maxBitrate: S };
163
- }, J = ce(), xe = async () => J().catch((n) => {
161
+ const s = n.getSettings(), o = s.width, r = s.height, i = o / e.width, c = r / e.height, d = Math.max(i, c, He), S = Z(e.width, t);
162
+ return { scaleResolutionDownBy: d, maxBitrate: S };
163
+ }, ne = de(), Xe = async () => ne().catch((n) => {
164
164
  a("videoSendingBalancer: error", n);
165
- }), Ve = async (n) => (J.add(n), xe()), V = async ({
165
+ }), je = async (n) => (ne.add(n), Xe()), X = async ({
166
166
  sender: n,
167
167
  scaleResolutionDownBy: e,
168
168
  maxBitrate: t,
169
169
  onSetParameters: s
170
- }) => Ve(async () => ne(n, { scaleResolutionDownBy: e, maxBitrate: t }, s)), $e = async ({ sender: n, codec: e }, t) => {
171
- const r = Ue(e);
172
- return V({
170
+ }) => je(async () => re(n, { scaleResolutionDownBy: e, maxBitrate: t }, s)), We = async ({ sender: n, codec: e }, t) => {
171
+ const o = $e(e);
172
+ return X({
173
173
  sender: n,
174
- maxBitrate: r,
174
+ maxBitrate: o,
175
175
  onSetParameters: t,
176
176
  scaleResolutionDownBy: 200
177
177
  });
178
- }, U = async ({
178
+ }, x = async ({
179
179
  sender: n,
180
180
  videoTrack: e,
181
181
  codec: t
182
182
  }, s) => {
183
- const c = e.getSettings().width, i = z(c, t);
184
- return V({
183
+ const i = e.getSettings().width, c = Z(i, t);
184
+ return X({
185
185
  sender: n,
186
- maxBitrate: i,
186
+ maxBitrate: c,
187
187
  onSetParameters: s,
188
188
  scaleResolutionDownBy: 1
189
189
  });
190
- }, He = async ({
190
+ }, Ge = async ({
191
191
  sender: n,
192
192
  videoTrack: e,
193
193
  resolution: t,
194
194
  codec: s
195
- }, r) => {
196
- const [o, c] = t.split("x"), { maxBitrate: i, scaleResolutionDownBy: u } = Q({
195
+ }, o) => {
196
+ const [r, i] = t.split("x"), { maxBitrate: c, scaleResolutionDownBy: d } = ee({
197
197
  videoTrack: e,
198
198
  codec: s,
199
199
  targetSize: {
200
- width: Number(o),
201
- height: Number(c)
200
+ width: Number(r),
201
+ height: Number(i)
202
202
  }
203
203
  });
204
- return V({
204
+ return X({
205
205
  sender: n,
206
- maxBitrate: i,
207
- onSetParameters: r,
208
- scaleResolutionDownBy: u
206
+ maxBitrate: c,
207
+ onSetParameters: o,
208
+ scaleResolutionDownBy: d
209
209
  });
210
- }, Xe = async ({
210
+ }, Ke = async ({
211
211
  mainCam: n,
212
212
  resolutionMainCam: e,
213
213
  sender: t,
214
214
  videoTrack: s,
215
- codec: r
216
- }, o) => {
215
+ codec: o
216
+ }, r) => {
217
217
  switch (n) {
218
- case k.PAUSE_MAIN_CAM:
219
- return $e({ sender: t, codec: r }, o);
220
- case k.RESUME_MAIN_CAM:
221
- return U({ sender: t, videoTrack: s, codec: r }, o);
222
- case k.MAX_MAIN_CAM_RESOLUTION:
223
- return e !== void 0 ? He(
224
- { sender: t, videoTrack: s, codec: r, resolution: e },
225
- o
226
- ) : U({ sender: t, videoTrack: s, codec: r }, o);
218
+ case L.PAUSE_MAIN_CAM:
219
+ return We({ sender: t, codec: o }, r);
220
+ case L.RESUME_MAIN_CAM:
221
+ return x({ sender: t, videoTrack: s, codec: o }, r);
222
+ case L.MAX_MAIN_CAM_RESOLUTION:
223
+ return e !== void 0 ? Ge(
224
+ { sender: t, videoTrack: s, codec: o, resolution: e },
225
+ r
226
+ ) : x({ sender: t, videoTrack: s, codec: o }, r);
227
227
  default:
228
- return U({ sender: t, videoTrack: s, codec: r }, o);
228
+ return x({ sender: t, videoTrack: s, codec: o }, r);
229
229
  }
230
- }, $ = {
230
+ }, j = {
231
231
  isChanged: !1,
232
232
  parameters: {
233
233
  encodings: [{}],
@@ -236,167 +236,189 @@ const le = (n = new Error()) => {
236
236
  headerExtensions: [],
237
237
  rtcp: {}
238
238
  }
239
- }, H = async ({
239
+ }, W = async ({
240
240
  mainCam: n,
241
241
  resolutionMainCam: e,
242
242
  connection: t,
243
243
  onSetParameters: s,
244
- ignoreForCodec: r
244
+ ignoreForCodec: o
245
245
  }) => {
246
- const o = t.getSenders(), c = Be(o);
247
- if (!(c != null && c.track))
248
- return $;
249
- const i = await Ne(c);
250
- return K(i, r) ? $ : Xe(
246
+ const r = t.getSenders(), i = Ie(r);
247
+ if (!(i != null && i.track))
248
+ return j;
249
+ const c = await De(i);
250
+ return z(c, o) ? j : Ke(
251
251
  {
252
252
  mainCam: n,
253
253
  resolutionMainCam: e,
254
- sender: c,
255
- codec: i,
256
- videoTrack: c.track
254
+ sender: i,
255
+ codec: c,
256
+ videoTrack: i.track
257
257
  },
258
258
  s
259
259
  );
260
- }, on = (n, {
260
+ }, dn = (n, {
261
261
  ignoreForCodec: e,
262
262
  onSetParameters: t
263
263
  } = {}) => {
264
264
  const s = async () => {
265
- const { connection: u } = n;
266
- if (!u)
265
+ const { connection: d } = n;
266
+ if (!d)
267
267
  throw new Error("connection is not exist");
268
- return H({
269
- connection: u,
268
+ return W({
269
+ connection: d,
270
270
  onSetParameters: t,
271
271
  ignoreForCodec: e
272
272
  });
273
273
  };
274
- let r = s;
275
- const o = async (u) => (r = async () => {
276
- const { mainCam: S, resolutionMainCam: C } = u, { connection: m } = n;
277
- if (!m)
274
+ let o = s;
275
+ const r = async (d) => (o = async () => {
276
+ const { mainCam: S, resolutionMainCam: C } = d, { connection: h } = n;
277
+ if (!h)
278
278
  throw new Error("connection is not exist");
279
- return H({
279
+ return W({
280
280
  mainCam: S,
281
281
  resolutionMainCam: C,
282
- connection: m,
282
+ connection: h,
283
283
  onSetParameters: t,
284
284
  ignoreForCodec: e
285
285
  });
286
- }, r());
286
+ }, o());
287
287
  return {
288
288
  subscribe: () => {
289
- n.onSession("main-cam-control", o);
289
+ n.onSession("main-cam-control", r);
290
290
  },
291
291
  unsubscribe: () => {
292
- n.offSession("main-cam-control", o);
292
+ n.offSession("main-cam-control", r);
293
293
  },
294
294
  balanceByTrack: s,
295
295
  resetMainCamControl() {
296
- r = s;
296
+ o = s;
297
297
  },
298
298
  async reBalance() {
299
- return r();
299
+ return o();
300
300
  }
301
301
  };
302
- }, je = (n) => n.getVideoTracks()[0], N = ({
302
+ }, qe = (n) => n.getVideoTracks()[0], B = ({
303
303
  mediaStream: n,
304
304
  simulcastEncodings: e,
305
305
  sendEncodings: t
306
306
  }) => {
307
307
  if (e && e.length > 0) {
308
- const s = t ?? [], r = je(n);
309
- return e.forEach((o, c) => {
310
- const i = s[c] ?? {};
311
- i.active = !0, o.rid !== void 0 && (i.rid = o.rid), o.scalabilityMode !== void 0 && (i.scalabilityMode = o.scalabilityMode);
312
- const { maxBitrate: u, scaleResolutionDownBy: S } = Q({
313
- videoTrack: r,
308
+ const s = t ?? [], o = qe(n);
309
+ return e.forEach((r, i) => {
310
+ const c = s[i] ?? {};
311
+ c.active = !0, r.rid !== void 0 && (c.rid = r.rid), r.scalabilityMode !== void 0 && (c.scalabilityMode = r.scalabilityMode);
312
+ const { maxBitrate: d, scaleResolutionDownBy: S } = ee({
313
+ videoTrack: o,
314
314
  targetSize: {
315
- width: o.width,
316
- height: o.height
315
+ width: r.width,
316
+ height: r.height
317
317
  }
318
318
  });
319
- i.maxBitrate = u, i.scaleResolutionDownBy = S, s[c] = i;
319
+ c.maxBitrate = d, c.scaleResolutionDownBy = S, s[i] = c;
320
320
  }), s;
321
321
  }
322
322
  return t;
323
- }, We = (n, e) => [...n, ...e].filter((r, o, c) => o === c.findIndex((i) => i.clockRate === r.clockRate && i.mimeType === r.mimeType && i.channels === r.channels && i.sdpFmtpLine === r.sdpFmtpLine)), Ge = (n) => {
324
- const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, r = t === null ? [] : t.codecs;
325
- return We(s, r);
326
- }, Ke = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
327
- const r = e.indexOf(t.mimeType), o = e.indexOf(s.mimeType), c = r === -1 ? Number.MAX_VALUE : r, i = o === -1 ? Number.MAX_VALUE : o;
328
- return c - i;
329
- }), qe = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), B = (n, {
323
+ }, Ye = (n, e) => [...n, ...e].filter((o, r, i) => r === i.findIndex((c) => c.clockRate === o.clockRate && c.mimeType === o.mimeType && c.channels === o.channels && c.sdpFmtpLine === o.sdpFmtpLine)), ze = (n) => {
324
+ const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, o = t === null ? [] : t.codecs;
325
+ return Ye(s, o);
326
+ }, Qe = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
327
+ const o = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), i = o === -1 ? Number.MAX_VALUE : o, c = r === -1 ? Number.MAX_VALUE : r;
328
+ return i - c;
329
+ }), Je = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), P = (n, {
330
330
  preferredMimeTypesVideoCodecs: e,
331
331
  excludeMimeTypesVideoCodecs: t
332
332
  }) => async (s) => {
333
- var r;
334
- if (typeof s.setCodecPreferences == "function" && ((r = s.sender.track) == null ? void 0 : r.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
335
- const o = Ge("video"), c = qe(o, t), i = Ke(c, e);
336
- s.setCodecPreferences(i);
333
+ var o;
334
+ if (typeof s.setCodecPreferences == "function" && ((o = s.sender.track) == null ? void 0 : o.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
335
+ const r = ze("video"), i = Je(r, t), c = Qe(i, e);
336
+ s.setCodecPreferences(c);
337
337
  }
338
- Object.keys(n).length > 0 && await te(s.sender, n);
339
- }, L = (n) => {
340
- if (!ie(n) && !ae(n))
338
+ Object.keys(n).length > 0 && await ie(s.sender, n);
339
+ }, $ = (n) => {
340
+ if (!le(n) && !Se(n))
341
341
  throw n;
342
342
  return { isSuccessful: !1 };
343
- }, Ye = ({ kind: n, readyState: e }) => n === "video" && e === "live";
344
- class cn {
343
+ }, Ze = ({ kind: n, readyState: e }) => n === "video" && e === "live";
344
+ class ln {
345
345
  constructor(e, {
346
346
  preferredMimeTypesVideoCodecs: t,
347
347
  excludeMimeTypesVideoCodecs: s
348
348
  } = {}) {
349
- l(this, "sipConnector");
350
- l(this, "preferredMimeTypesVideoCodecs");
351
- l(this, "excludeMimeTypesVideoCodecs");
352
- l(this, "connectToServer", async (e) => {
349
+ u(this, "sipConnector");
350
+ u(this, "preferredMimeTypesVideoCodecs");
351
+ u(this, "excludeMimeTypesVideoCodecs");
352
+ u(this, "on");
353
+ u(this, "once");
354
+ u(this, "onceRace");
355
+ u(this, "wait");
356
+ u(this, "off");
357
+ u(this, "onSession");
358
+ u(this, "onceSession");
359
+ u(this, "onceRaceSession");
360
+ u(this, "waitSession");
361
+ u(this, "offSession");
362
+ u(this, "sendDTMF");
363
+ u(this, "hangUp");
364
+ u(this, "declineToIncomingCall");
365
+ u(this, "isConfigured");
366
+ u(this, "sendChannels");
367
+ u(this, "checkTelephony");
368
+ u(this, "waitChannels");
369
+ u(this, "ping");
370
+ u(this, "connectToServer", async (e) => {
353
371
  const {
354
372
  userAgent: t,
355
373
  sipWebSocketServerURL: s,
356
- sipServerUrl: r,
357
- remoteAddress: o,
358
- displayName: c,
359
- name: i,
360
- password: u,
374
+ sipServerUrl: o,
375
+ remoteAddress: r,
376
+ displayName: i,
377
+ name: c,
378
+ password: d,
361
379
  isRegisteredUser: S,
362
380
  isDisconnectOnFail: C
363
381
  } = e;
364
382
  return a("connectToServer", e), this.sipConnector.connect({
365
383
  userAgent: t,
366
384
  sipWebSocketServerURL: s,
367
- sipServerUrl: r,
368
- remoteAddress: o,
369
- displayName: c,
370
- password: u,
371
- user: i,
385
+ sipServerUrl: o,
386
+ remoteAddress: r,
387
+ displayName: i,
388
+ password: d,
389
+ user: c,
372
390
  register: S
373
- }).then((m) => (a("connectToServer then"), { ua: m, isSuccessful: !0 })).catch(async (m) => (a("connectToServer catch: error", m), C === !0 ? this.sipConnector.disconnect().then(() => L(m)).catch(() => L(m)) : L(m)));
391
+ }).then((h) => (a("connectToServer then"), { ua: h, isSuccessful: !0 })).catch(async (h) => (a("connectToServer catch: error", h), C === !0 ? this.sipConnector.disconnect().then(() => $(h)).catch(() => $(h)) : $(h)));
374
392
  });
375
- l(this, "callToServer", async (e) => {
393
+ u(this, "callToServer", async (e) => {
376
394
  const {
377
395
  conference: t,
378
396
  mediaStream: s,
379
- extraHeaders: r,
380
- iceServers: o,
381
- contentHint: c,
382
- simulcastEncodings: i,
383
- degradationPreference: u,
397
+ extraHeaders: o,
398
+ iceServers: r,
399
+ contentHint: i,
400
+ simulcastEncodings: c,
401
+ degradationPreference: d,
384
402
  sendEncodings: S,
385
- setRemoteStreams: C,
386
- onBeforeProgressCall: m,
387
- onSuccessProgressCall: T,
403
+ offerToReceiveAudio: C,
404
+ offerToReceiveVideo: h,
405
+ directionVideo: I,
406
+ directionAudio: F,
407
+ setRemoteStreams: f,
408
+ onBeforeProgressCall: p,
409
+ onSuccessProgressCall: m,
388
410
  onEnterPurgatory: R,
389
- onEnterConference: f,
390
- onFailProgressCall: g,
391
- onFinishProgressCall: p,
411
+ onEnterConference: y,
412
+ onFailProgressCall: T,
413
+ onFinishProgressCall: E,
392
414
  onEndedCall: b
393
415
  } = e, _ = this.resolveHandleReadyRemoteStreamsDebounced({
394
- onReadyRemoteStreams: C
395
- }), A = this.resolveHandleReadyRemoteStreams({
416
+ onReadyRemoteStreams: f
417
+ }), v = this.resolveHandleReadyRemoteStreams({
396
418
  onReadyRemoteStreams: _
397
- }), v = B(
419
+ }), O = P(
398
420
  {
399
- degradationPreference: u
421
+ degradationPreference: d
400
422
  },
401
423
  {
402
424
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
@@ -404,58 +426,66 @@ class cn {
404
426
  }
405
427
  );
406
428
  a("callToServer", e);
407
- const O = async () => (a("startCall"), this.sipConnector.call({
429
+ const N = async () => (a("startCall"), this.sipConnector.call({
408
430
  mediaStream: s,
409
- extraHeaders: r,
410
- iceServers: o,
411
- contentHint: c,
412
- sendEncodings: N({
431
+ extraHeaders: o,
432
+ iceServers: r,
433
+ contentHint: i,
434
+ offerToReceiveAudio: C,
435
+ offerToReceiveVideo: h,
436
+ directionVideo: I,
437
+ directionAudio: F,
438
+ sendEncodings: B({
413
439
  mediaStream: s,
414
- simulcastEncodings: i,
440
+ simulcastEncodings: c,
415
441
  sendEncodings: S
416
442
  }),
417
443
  number: t,
418
- onAddedTransceiver: v,
419
- ontrack: A
444
+ onAddedTransceiver: O,
445
+ ontrack: v
420
446
  }));
421
- let y = !1, E;
422
- const M = (a("subscribeEnterConference: onEnterConference", f), R ?? f ? this.sipConnector.onSession("enterRoom", ({ room: d }) => {
423
- a("enterRoom", { _room: d, isSuccessProgressCall: y }), E = d, P(E) ? R && R() : f && f({ isSuccessProgressCall: y });
447
+ let M = !1, A;
448
+ const w = (a("subscribeEnterConference: onEnterConference", y), R ?? y ? this.sipConnector.onSession("enterRoom", ({ room: l }) => {
449
+ a("enterRoom", { _room: l, isSuccessProgressCall: M }), A = l, D(A) ? R && R() : y && y({ isSuccessProgressCall: M });
424
450
  }) : () => {
425
- }), D = (d) => (a("onSuccess"), y = !0, _(), T && T({ isPurgatory: P(E) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
426
- M(), b && b();
427
- }), d), I = (d) => {
428
- throw a("onFail"), g && g(), M(), d;
429
- }, F = () => {
430
- a("onFinish"), p && p();
451
+ }), k = (l) => (a("onSuccess"), M = !0, _(), m && m({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
452
+ w(), b && b();
453
+ }), l), U = (l) => {
454
+ throw a("onFail"), T && T(), w(), l;
455
+ }, V = () => {
456
+ a("onFinish"), E && E();
431
457
  };
432
- return a("onBeforeProgressCall"), m && m(t), O().then(D).catch((d) => I(d)).finally(F);
458
+ return a("onBeforeProgressCall"), p && p(t), N().then(k).catch((l) => U(l)).finally(V);
433
459
  });
434
- l(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (a("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (a("disconnectFromServer: catch", e), { isSuccessful: !1 })));
435
- l(this, "answerIncomingCall", async (e) => {
460
+ u(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (a("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (a("disconnectFromServer: catch", e), { isSuccessful: !1 })));
461
+ u(this, "answerIncomingCall", async (e) => {
436
462
  const {
437
463
  mediaStream: t,
438
464
  extraHeaders: s,
439
- iceServers: r,
440
- contentHint: o,
441
- simulcastEncodings: c,
442
- degradationPreference: i,
443
- sendEncodings: u,
444
- setRemoteStreams: S,
445
- onBeforeProgressCall: C,
446
- onSuccessProgressCall: m,
447
- onEnterPurgatory: T,
465
+ iceServers: o,
466
+ contentHint: r,
467
+ simulcastEncodings: i,
468
+ degradationPreference: c,
469
+ sendEncodings: d,
470
+ offerToReceiveAudio: S,
471
+ offerToReceiveVideo: C,
472
+ directionVideo: h,
473
+ directionAudio: I,
474
+ setRemoteStreams: F,
475
+ onBeforeProgressCall: f,
476
+ onSuccessProgressCall: p,
477
+ onEnterPurgatory: m,
448
478
  onEnterConference: R,
449
- onFailProgressCall: f,
450
- onFinishProgressCall: g,
451
- onEndedCall: p
479
+ onFailProgressCall: y,
480
+ onFinishProgressCall: T,
481
+ onEndedCall: E
452
482
  } = e, b = this.resolveHandleReadyRemoteStreamsDebounced({
453
- onReadyRemoteStreams: S
483
+ onReadyRemoteStreams: F
454
484
  }), _ = this.resolveHandleReadyRemoteStreams({
455
485
  onReadyRemoteStreams: b
456
- }), A = B(
486
+ }), v = P(
457
487
  {
458
- degradationPreference: i
488
+ degradationPreference: c
459
489
  },
460
490
  {
461
491
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
@@ -463,88 +493,92 @@ class cn {
463
493
  }
464
494
  );
465
495
  a("answerIncomingCall", e);
466
- const v = async () => this.sipConnector.answerToIncomingCall({
496
+ const O = async () => this.sipConnector.answerToIncomingCall({
467
497
  mediaStream: t,
468
498
  extraHeaders: s,
469
- iceServers: r,
470
- contentHint: o,
471
- sendEncodings: N({
499
+ iceServers: o,
500
+ contentHint: r,
501
+ offerToReceiveAudio: S,
502
+ offerToReceiveVideo: C,
503
+ directionVideo: h,
504
+ directionAudio: I,
505
+ sendEncodings: B({
472
506
  mediaStream: t,
473
- simulcastEncodings: c,
474
- sendEncodings: u
507
+ simulcastEncodings: i,
508
+ sendEncodings: d
475
509
  }),
476
- onAddedTransceiver: A,
510
+ onAddedTransceiver: v,
477
511
  ontrack: _
478
- }), O = () => {
479
- const { remoteCallerData: d } = this.sipConnector;
480
- return d.incomingNumber;
512
+ }), N = () => {
513
+ const { remoteCallerData: l } = this.sipConnector;
514
+ return l.incomingNumber;
481
515
  };
482
- let y = !1, E;
483
- const M = (a("subscribeEnterConference: onEnterConference", R), T ?? R ? this.sipConnector.onSession("enterRoom", (d) => {
484
- a("enterRoom", { _room: d, isSuccessProgressCall: y }), E = d, P(E) ? T && T() : R && R({ isSuccessProgressCall: y });
516
+ let M = !1, A;
517
+ const w = (a("subscribeEnterConference: onEnterConference", R), m ?? R ? this.sipConnector.onSession("enterRoom", (l) => {
518
+ a("enterRoom", { _room: l, isSuccessProgressCall: M }), A = l, D(A) ? m && m() : R && R({ isSuccessProgressCall: M });
485
519
  }) : () => {
486
- }), D = (d) => (a("onSuccess"), y = !0, b(), m && m({ isPurgatory: P(E) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
487
- M(), p && p();
488
- }), d), I = (d) => {
489
- throw a("onFail"), f && f(), M(), d;
490
- }, F = () => {
491
- a("onFinish"), g && g();
520
+ }), k = (l) => (a("onSuccess"), M = !0, b(), p && p({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
521
+ w(), E && E();
522
+ }), l), U = (l) => {
523
+ throw a("onFail"), y && y(), w(), l;
524
+ }, V = () => {
525
+ a("onFinish"), T && T();
492
526
  };
493
- if (a("onBeforeProgressCall"), C) {
494
- const d = O();
495
- C(d);
527
+ if (a("onBeforeProgressCall"), f) {
528
+ const l = N();
529
+ f(l);
496
530
  }
497
- return v().then(D).catch((d) => I(d)).finally(F);
531
+ return O().then(k).catch((l) => U(l)).finally(V);
498
532
  });
499
- l(this, "updatePresentation", async ({
533
+ u(this, "updatePresentation", async ({
500
534
  mediaStream: e,
501
535
  isP2P: t,
502
536
  maxBitrate: s,
503
- contentHint: r,
504
- simulcastEncodings: o,
505
- degradationPreference: c,
506
- sendEncodings: i,
507
- preferredMimeTypesVideoCodecs: u,
537
+ contentHint: o,
538
+ simulcastEncodings: r,
539
+ degradationPreference: i,
540
+ sendEncodings: c,
541
+ preferredMimeTypesVideoCodecs: d,
508
542
  excludeMimeTypesVideoCodecs: S
509
543
  }) => {
510
- const C = B(
544
+ const C = P(
511
545
  {
512
- degradationPreference: c
546
+ degradationPreference: i
513
547
  },
514
548
  {
515
- preferredMimeTypesVideoCodecs: u,
549
+ preferredMimeTypesVideoCodecs: d,
516
550
  excludeMimeTypesVideoCodecs: S
517
551
  }
518
552
  );
519
553
  return a("updatePresentation"), this.sipConnector.updatePresentation(e, {
520
554
  isP2P: t,
521
555
  maxBitrate: s,
522
- contentHint: r,
523
- sendEncodings: N({
556
+ contentHint: o,
557
+ sendEncodings: B({
524
558
  mediaStream: e,
525
- simulcastEncodings: o,
526
- sendEncodings: i
559
+ simulcastEncodings: r,
560
+ sendEncodings: c
527
561
  }),
528
562
  onAddedTransceiver: C
529
563
  });
530
564
  });
531
- l(this, "startPresentation", async ({
565
+ u(this, "startPresentation", async ({
532
566
  mediaStream: e,
533
567
  isP2P: t,
534
568
  maxBitrate: s,
535
- contentHint: r,
536
- simulcastEncodings: o,
537
- degradationPreference: c,
538
- sendEncodings: i,
539
- preferredMimeTypesVideoCodecs: u,
569
+ contentHint: o,
570
+ simulcastEncodings: r,
571
+ degradationPreference: i,
572
+ sendEncodings: c,
573
+ preferredMimeTypesVideoCodecs: d,
540
574
  excludeMimeTypesVideoCodecs: S
541
575
  }, C) => {
542
- const m = B(
576
+ const h = P(
543
577
  {
544
- degradationPreference: c
578
+ degradationPreference: i
545
579
  },
546
580
  {
547
- preferredMimeTypesVideoCodecs: u,
581
+ preferredMimeTypesVideoCodecs: d,
548
582
  excludeMimeTypesVideoCodecs: S
549
583
  }
550
584
  );
@@ -553,53 +587,53 @@ class cn {
553
587
  {
554
588
  isP2P: t,
555
589
  maxBitrate: s,
556
- contentHint: r,
557
- sendEncodings: N({
590
+ contentHint: o,
591
+ sendEncodings: B({
558
592
  mediaStream: e,
559
- simulcastEncodings: o,
560
- sendEncodings: i
593
+ simulcastEncodings: r,
594
+ sendEncodings: c
561
595
  }),
562
- onAddedTransceiver: m
596
+ onAddedTransceiver: h
563
597
  },
564
598
  C
565
599
  );
566
600
  });
567
- l(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (a("stopShareSipConnector"), this.sipConnector.stopPresentation({
601
+ u(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (a("stopShareSipConnector"), this.sipConnector.stopPresentation({
568
602
  isP2P: e
569
603
  }).catch((t) => {
570
604
  a(t);
571
605
  })));
572
- l(this, "sendRefusalToTurnOnMic", async () => {
606
+ u(this, "sendRefusalToTurnOnMic", async () => {
573
607
  if (this.sipConnector.isCallActive)
574
608
  return a("sendRefusalToTurnOnMic"), this.sipConnector.sendRefusalToTurnOnMic().catch((e) => {
575
609
  a("sendRefusalToTurnOnMic: error", e);
576
610
  });
577
611
  });
578
- l(this, "sendRefusalToTurnOnCam", async () => {
612
+ u(this, "sendRefusalToTurnOnCam", async () => {
579
613
  if (this.sipConnector.isCallActive)
580
614
  return a("sendRefusalToTurnOnCam"), this.sipConnector.sendRefusalToTurnOnCam().catch((e) => {
581
615
  a("sendRefusalToTurnOnCam: error", e);
582
616
  });
583
617
  });
584
- l(this, "sendMediaState", async ({
618
+ u(this, "sendMediaState", async ({
585
619
  isEnabledCam: e,
586
620
  isEnabledMic: t
587
621
  }) => {
588
622
  if (this.sipConnector.isCallActive)
589
623
  return a("sendMediaState"), this.sipConnector.sendMediaState({ cam: e, mic: t });
590
624
  });
591
- l(this, "replaceMediaStream", async (e, {
625
+ u(this, "replaceMediaStream", async (e, {
592
626
  deleteExisting: t,
593
627
  addMissing: s,
594
- forceRenegotiation: r,
595
- contentHint: o,
596
- simulcastEncodings: c,
597
- degradationPreference: i,
598
- sendEncodings: u
628
+ forceRenegotiation: o,
629
+ contentHint: r,
630
+ simulcastEncodings: i,
631
+ degradationPreference: c,
632
+ sendEncodings: d
599
633
  } = {}) => {
600
- const S = B(
634
+ const S = P(
601
635
  {
602
- degradationPreference: i
636
+ degradationPreference: c
603
637
  },
604
638
  {
605
639
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
@@ -609,56 +643,59 @@ class cn {
609
643
  return a("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
610
644
  deleteExisting: t,
611
645
  addMissing: s,
612
- forceRenegotiation: r,
613
- contentHint: o,
614
- sendEncodings: N({
646
+ forceRenegotiation: o,
647
+ contentHint: r,
648
+ sendEncodings: B({
615
649
  mediaStream: e,
616
- simulcastEncodings: c,
617
- sendEncodings: u
650
+ simulcastEncodings: i,
651
+ sendEncodings: d
618
652
  }),
619
653
  onAddedTransceiver: S
620
654
  });
621
655
  });
622
- l(this, "askPermissionToEnableCam", async () => {
656
+ u(this, "askPermissionToEnableCam", async () => {
623
657
  if (this.sipConnector.isCallActive)
624
658
  return a("askPermissionToEnableCam"), this.sipConnector.askPermissionToEnableCam();
625
659
  });
626
- l(this, "resolveHandleReadyRemoteStreamsDebounced", ({
660
+ u(this, "resolveHandleReadyRemoteStreamsDebounced", ({
627
661
  onReadyRemoteStreams: e
628
- }) => ue(() => {
662
+ }) => he(() => {
629
663
  const t = this.sipConnector.getRemoteStreams();
630
664
  a("remoteStreams", t), t && e(t);
631
665
  }, 200));
632
- l(this, "resolveHandleReadyRemoteStreams", ({
666
+ u(this, "resolveHandleReadyRemoteStreams", ({
633
667
  onReadyRemoteStreams: e
634
668
  }) => ({ track: t }) => {
635
- Ye(t) && e();
669
+ Ze(t) && e();
636
670
  });
637
- l(this, "getRemoteStreams", () => (a("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
638
- l(this, "onUseLicense", (e) => (a("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
639
- l(this, "onMustStopPresentation", (e) => (a("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
640
- l(this, "onMoveToSpectators", (e) => (a("onMoveToSpectators"), this.sipConnector.onSession(se, e)));
641
- l(this, "onMoveToParticipants", (e) => (a("onMoveToParticipants"), this.sipConnector.onSession(re, e)));
642
- this.sipConnector = e, this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s;
671
+ u(this, "getRemoteStreams", () => (a("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
672
+ u(this, "onUseLicense", (e) => (a("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
673
+ u(this, "onMustStopPresentation", (e) => (a("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
674
+ u(this, "onMoveToSpectators", (e) => (a("onMoveToSpectators"), this.sipConnector.onSession(ce, e)));
675
+ u(this, "onMoveToParticipants", (e) => (a("onMoveToParticipants"), this.sipConnector.onSession(ae, e)));
676
+ this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.sipConnector = e, this.on = this.sipConnector.on.bind(e), this.once = this.sipConnector.once.bind(e), this.onceRace = this.sipConnector.onceRace.bind(e), this.wait = this.sipConnector.wait.bind(e), this.off = this.sipConnector.off.bind(e), this.onSession = this.sipConnector.onSession.bind(e), this.onceSession = this.sipConnector.onceSession.bind(e), this.onceRaceSession = this.sipConnector.onceRaceSession.bind(e), this.waitSession = this.sipConnector.waitSession.bind(e), this.offSession = this.sipConnector.offSession.bind(e), this.sendDTMF = this.sipConnector.sendDTMF.bind(e), this.hangUp = this.sipConnector.hangUp.bind(e), this.declineToIncomingCall = this.sipConnector.declineToIncomingCall.bind(e), this.isConfigured = this.sipConnector.isConfigured.bind(e), this.sendChannels = this.sipConnector.sendChannels.bind(e), this.checkTelephony = this.sipConnector.checkTelephony.bind(e), this.waitChannels = this.sipConnector.waitChannels.bind(e), this.ping = this.sipConnector.ping.bind(e);
677
+ }
678
+ get isRegistered() {
679
+ return this.sipConnector.isRegistered;
643
680
  }
644
681
  }
645
682
  export {
646
- k as EEventsMainCAM,
647
- ln as EEventsMic,
648
- dn as EEventsSyncMediaState,
649
- Sn as EMimeTypesVideoCodecs,
650
- mn as EUseLicense,
651
- cn as SipConnectorFacade,
652
- Cn as causes,
653
- fn as constants,
654
- En as debug,
655
- Je as default,
656
- hn as disableDebug,
657
- Rn as enableDebug,
658
- gn as eventNames,
659
- Ne as getCodecFromSender,
660
- pn as hasCanceledCallError,
661
- on as resolveVideoSendingBalancer,
662
- te as setParametersToSender,
663
- rn as tools
683
+ L as EEventsMainCAM,
684
+ Cn as EEventsMic,
685
+ fn as EEventsSyncMediaState,
686
+ mn as EMimeTypesVideoCodecs,
687
+ Rn as EUseLicense,
688
+ ln as SipConnectorFacade,
689
+ gn as causes,
690
+ pn as constants,
691
+ An as debug,
692
+ tn as default,
693
+ yn as disableDebug,
694
+ Tn as enableDebug,
695
+ En as eventNames,
696
+ De as getCodecFromSender,
697
+ bn as hasCanceledCallError,
698
+ dn as resolveVideoSendingBalancer,
699
+ ie as setParametersToSender,
700
+ un as tools
664
701
  };