@cloudflare/realtimekit 1.5.2-staging.3 → 1.5.2-staging.4

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.es5.js CHANGED
@@ -3,7 +3,7 @@ import rv from "bowser";
3
3
  import { MessageType as _, PbLong as So, typeofJsonValue as Ug } from "@protobuf-ts/runtime";
4
4
  import * as ac from "worker-timers";
5
5
  import * as gn from "sdp-transform";
6
- var Tg = ["chat", "connectedMeetings", "plugins", "polls", "media"], wg = ["id"], Pg = ["meetingId"], ee, Rn, $e, ra, vc, Vs, An, fc, Wu, $i, Li, to, Kt, Ni, In, ta, Us, Mn, js, Fs, zt, Vi, Pr, _n, Ui, Hs, Bs, On, Dn, qs, $n, na, ji, Fi, Hi, $r, Le, Bi, qi, Cr, Ln, en, Nn, Ju, vt, Gs, Yt, Vn, ft, Ku, Ws, zu, Qu, be, Js, Un, Gi, jn, fr, Lr, Gr, Wi, Ji, rr, Ki, Ve, gt, Ne, zi, Se, ia, aa, Ks, Gd, Qi, Wr, X, gr, Qt, ye, ke, Nr, Ue, zs, Qs, pe, Oe, Fn;
6
+ var Tg = ["chat", "connectedMeetings", "plugins", "polls", "media"], wg = ["id"], Pg = ["meetingId"], ee, Rn, $e, ra, vc, Vs, An, fc, Wu, $i, Li, to, Kt, Ni, In, ta, Us, Mn, js, Fs, zt, Vi, Sr, _n, Ui, Hs, Bs, On, Dn, qs, $n, na, ji, Fi, Hi, Lr, Le, Bi, qi, Rr, Ln, en, Nn, Ju, vt, Gs, Yt, Vn, ft, Ku, Ws, zu, Qu, be, Js, Un, Gi, jn, fr, Nr, Wr, Wi, Ji, rr, Ki, Ve, gt, Ne, zi, Se, ia, aa, Ks, Gd, Qi, Jr, X, gr, Qt, ye, ke, Vr, Ue, zs, Qs, pe, Oe, Fn;
7
7
  function Wd(s, t) {
8
8
  if (s == null)
9
9
  return {};
@@ -2124,12 +2124,12 @@ var _v = /* @__PURE__ */ S(function s() {
2124
2124
  }
2125
2125
  if (d.producerStreamMap.forEach(function(re, te) {
2126
2126
  if (re.outboundVideoRtpId.length > 0) {
2127
- var Rr, kr, _a, bt, Oa, Da, $a, La, Tt, Na, Po = [];
2127
+ var Ar, kr, _a, bt, Oa, Da, $a, La, Tt, Na, Po = [];
2128
2128
  re.outboundVideoRtpId.forEach(function(rl) {
2129
2129
  Po.push(d.outboundVideoRtp.get(rl));
2130
2130
  });
2131
2131
  var Ce = n.getWorkingSimulcastVideoStats(Po);
2132
- Ce.score = Ev({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((Rr = Ce.remoteData) === null || Rr === void 0 ? void 0 : Rr.jitter) || 0, isScreenShare: n.screenShareProducers.has(te), packetsSent: (Ce.packetsSent || 0) - (((kr = n.videoProducerToStatsMap.get(te)) === null || kr === void 0 ? void 0 : kr.packetsSent) || 0), packetsLost: (((_a = Ce.remoteData) === null || _a === void 0 ? void 0 : _a.packetsLost) || 0) - (((bt = n.videoProducerToStatsMap.get(te)) === null || bt === void 0 || (bt = bt.remoteData) === null || bt === void 0 ? void 0 : bt.packetsLost) || 0), framesEncoded: (Ce.framesEncoded || 0) - (((Oa = n.videoProducerToStatsMap.get(te)) === null || Oa === void 0 ? void 0 : Oa.framesEncoded) || 0) }), b.set(te, {
2132
+ Ce.score = Ev({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((Ar = Ce.remoteData) === null || Ar === void 0 ? void 0 : Ar.jitter) || 0, isScreenShare: n.screenShareProducers.has(te), packetsSent: (Ce.packetsSent || 0) - (((kr = n.videoProducerToStatsMap.get(te)) === null || kr === void 0 ? void 0 : kr.packetsSent) || 0), packetsLost: (((_a = Ce.remoteData) === null || _a === void 0 ? void 0 : _a.packetsLost) || 0) - (((bt = n.videoProducerToStatsMap.get(te)) === null || bt === void 0 || (bt = bt.remoteData) === null || bt === void 0 ? void 0 : bt.packetsLost) || 0), framesEncoded: (Ce.framesEncoded || 0) - (((Oa = n.videoProducerToStatsMap.get(te)) === null || Oa === void 0 ? void 0 : Oa.framesEncoded) || 0) }), b.set(te, {
2133
2133
  score: +(Ce.score * 10).toFixed(),
2134
2134
  frameWidth: Ce.frameWidth || 0,
2135
2135
  frameHeight: Ce.frameHeight || 0,
@@ -2143,23 +2143,23 @@ var _v = /* @__PURE__ */ S(function s() {
2143
2143
  bandwidthLimitations: Ce.qualityLimitationReason === "bandwidth"
2144
2144
  }), n.videoProducerToStatsMap.set(te, Ce);
2145
2145
  } else if (re.outboundAudioRtpId.length > 0) {
2146
- var Va, Ua, wt, ja, Fa, Ha, Ba, Pt, qa, Ar = d.outboundAudioRtp.get(re.outboundAudioRtpId[0]);
2147
- Ar.score = Sv({ packetsSent: (Ar.packetsSent || 0) - (((Va = n.audioProducerToStatsMap.get(te)) === null || Va === void 0 ? void 0 : Va.packetsSent) || 0), packetsLost: (((Ua = Ar.remoteData) === null || Ua === void 0 ? void 0 : Ua.packetsLost) || 0) - (((wt = n.audioProducerToStatsMap.get(te)) === null || wt === void 0 || (wt = wt.remoteData) === null || wt === void 0 ? void 0 : wt.packetsLost) || 0), jitter: ((ja = Ar.remoteData) === null || ja === void 0 ? void 0 : ja.jitter) || 0 }), b.set(te, {
2148
- score: +(Ar.score * 10).toFixed(),
2149
- bitrate: ((Ar.bytesSent || 0) - (((Fa = n.audioProducerToStatsMap.get(te)) === null || Fa === void 0 ? void 0 : Fa.bytesSent) || 0)) * 8 / 7,
2146
+ var Va, Ua, wt, ja, Fa, Ha, Ba, Pt, qa, Ir = d.outboundAudioRtp.get(re.outboundAudioRtpId[0]);
2147
+ Ir.score = Sv({ packetsSent: (Ir.packetsSent || 0) - (((Va = n.audioProducerToStatsMap.get(te)) === null || Va === void 0 ? void 0 : Va.packetsSent) || 0), packetsLost: (((Ua = Ir.remoteData) === null || Ua === void 0 ? void 0 : Ua.packetsLost) || 0) - (((wt = n.audioProducerToStatsMap.get(te)) === null || wt === void 0 || (wt = wt.remoteData) === null || wt === void 0 ? void 0 : wt.packetsLost) || 0), jitter: ((ja = Ir.remoteData) === null || ja === void 0 ? void 0 : ja.jitter) || 0 }), b.set(te, {
2148
+ score: +(Ir.score * 10).toFixed(),
2149
+ bitrate: ((Ir.bytesSent || 0) - (((Fa = n.audioProducerToStatsMap.get(te)) === null || Fa === void 0 ? void 0 : Fa.bytesSent) || 0)) * 8 / 7,
2150
2150
  // Bytes received in last 7 seconds
2151
- packetsLostPercentage: mc({ packetsSent: (Ar.packetsSent || 0) - (((Ha = n.audioProducerToStatsMap.get(te)) === null || Ha === void 0 ? void 0 : Ha.packetsSent) || 0), packetsLost: (((Ba = Ar.remoteData) === null || Ba === void 0 ? void 0 : Ba.packetsLost) || 0) - (((Pt = n.audioProducerToStatsMap.get(te)) === null || Pt === void 0 || (Pt = Pt.remoteData) === null || Pt === void 0 ? void 0 : Pt.packetsLost) || 0) }),
2152
- jitter: ((qa = Ar.remoteData) === null || qa === void 0 ? void 0 : qa.jitter) || 0,
2151
+ packetsLostPercentage: mc({ packetsSent: (Ir.packetsSent || 0) - (((Ha = n.audioProducerToStatsMap.get(te)) === null || Ha === void 0 ? void 0 : Ha.packetsSent) || 0), packetsLost: (((Ba = Ir.remoteData) === null || Ba === void 0 ? void 0 : Ba.packetsLost) || 0) - (((Pt = n.audioProducerToStatsMap.get(te)) === null || Pt === void 0 || (Pt = Pt.remoteData) === null || Pt === void 0 ? void 0 : Pt.packetsLost) || 0) }),
2152
+ jitter: ((qa = Ir.remoteData) === null || qa === void 0 ? void 0 : qa.jitter) || 0,
2153
2153
  isScreenShare: n.screenShareProducers.has(te)
2154
- }), n.audioProducerToStatsMap.set(te, Ar);
2154
+ }), n.audioProducerToStatsMap.set(te, Ir);
2155
2155
  }
2156
2156
  }), g.forEach(function(re) {
2157
2157
  var te = v.find(function(kr) {
2158
2158
  return kr.id === re.localCandidateId ? (re.localCandidateId = kr.id, kr) : null;
2159
- }), Rr = f.find(function(kr) {
2159
+ }), Ar = f.find(function(kr) {
2160
2160
  return kr.id === re.remoteCandidateId ? (re.remoteCandidateId = kr.id, kr) : null;
2161
2161
  });
2162
- te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort), Rr && (re.remoteCandidateType = Rr.type, re.remoteCandidateAddress = ca(Rr.address), re.remoteCandidatePort = Rr.port, re.remoteCandidateProtocol = Rr.protocol, re.remoteCandidateUrl = Rr.url);
2162
+ te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort), Ar && (re.remoteCandidateType = Ar.type, re.remoteCandidateAddress = ca(Ar.address), re.remoteCandidatePort = Ar.port, re.remoteCandidateProtocol = Ar.protocol, re.remoteCandidateUrl = Ar.url);
2163
2163
  }), d.candidatePair && (d.transport ? (d.transport.totalRoundTripTime = d.candidatePair.totalRoundTripTime, d.transport.availableOutgoingBitrate = d.candidatePair.availableOutgoingBitrate, d.transport.availableIncomingBitrate = d.candidatePair.availableIncomingBitrate, d.transport.roundTripTime = d.candidatePair.currentRoundTripTime) : d.transport = {
2164
2164
  // candidateStats: result.candidatePair,
2165
2165
  bytesReceived: d.candidatePair.bytesReceived,
@@ -2762,12 +2762,12 @@ var _v = /* @__PURE__ */ S(function s() {
2762
2762
  }
2763
2763
  if (d.producerStreamMap.forEach(function(re, te) {
2764
2764
  if (re.outboundVideoRtpId.length > 0) {
2765
- var Rr, kr, _a, bt, Oa, Da, $a, La, Tt, Na, Po = [];
2765
+ var Ar, kr, _a, bt, Oa, Da, $a, La, Tt, Na, Po = [];
2766
2766
  re.outboundVideoRtpId.forEach(function(rl) {
2767
2767
  Po.push(d.outboundVideoRtp.get(rl));
2768
2768
  });
2769
2769
  var Ce = n.getWorkingSimulcastVideoStats(Po);
2770
- Ce.score = Ev({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((Rr = Ce.remoteData) === null || Rr === void 0 ? void 0 : Rr.jitter) || 0, isScreenShare: n.screenShareProducers.has(te), packetsSent: (Ce.packetsSent || 0) - (((kr = n.videoProducerToStatsMap.get(te)) === null || kr === void 0 ? void 0 : kr.packetsSent) || 0), packetsLost: (((_a = Ce.remoteData) === null || _a === void 0 ? void 0 : _a.packetsLost) || 0) - (((bt = n.videoProducerToStatsMap.get(te)) === null || bt === void 0 || (bt = bt.remoteData) === null || bt === void 0 ? void 0 : bt.packetsLost) || 0), framesEncoded: (Ce.framesEncoded || 0) - (((Oa = n.videoProducerToStatsMap.get(te)) === null || Oa === void 0 ? void 0 : Oa.framesEncoded) || 0) }), b.set(te, {
2770
+ Ce.score = Ev({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((Ar = Ce.remoteData) === null || Ar === void 0 ? void 0 : Ar.jitter) || 0, isScreenShare: n.screenShareProducers.has(te), packetsSent: (Ce.packetsSent || 0) - (((kr = n.videoProducerToStatsMap.get(te)) === null || kr === void 0 ? void 0 : kr.packetsSent) || 0), packetsLost: (((_a = Ce.remoteData) === null || _a === void 0 ? void 0 : _a.packetsLost) || 0) - (((bt = n.videoProducerToStatsMap.get(te)) === null || bt === void 0 || (bt = bt.remoteData) === null || bt === void 0 ? void 0 : bt.packetsLost) || 0), framesEncoded: (Ce.framesEncoded || 0) - (((Oa = n.videoProducerToStatsMap.get(te)) === null || Oa === void 0 ? void 0 : Oa.framesEncoded) || 0) }), b.set(te, {
2771
2771
  score: +(Ce.score * 10).toFixed(),
2772
2772
  frameWidth: Ce.frameWidth || 0,
2773
2773
  frameHeight: Ce.frameHeight || 0,
@@ -2781,23 +2781,23 @@ var _v = /* @__PURE__ */ S(function s() {
2781
2781
  bandwidthLimitations: Ce.qualityLimitationReason === "bandwidth"
2782
2782
  }), n.videoProducerToStatsMap.set(te, Ce);
2783
2783
  } else if (re.outboundAudioRtpId.length > 0) {
2784
- var Va, Ua, wt, ja, Fa, Ha, Ba, Pt, qa, Ar = d.outboundAudioRtp.get(re.outboundAudioRtpId[0]);
2785
- Ar.score = Sv({ packetsSent: (Ar.packetsSent || 0) - (((Va = n.audioProducerToStatsMap.get(te)) === null || Va === void 0 ? void 0 : Va.packetsSent) || 0), packetsLost: (((Ua = Ar.remoteData) === null || Ua === void 0 ? void 0 : Ua.packetsLost) || 0) - (((wt = n.audioProducerToStatsMap.get(te)) === null || wt === void 0 || (wt = wt.remoteData) === null || wt === void 0 ? void 0 : wt.packetsLost) || 0), jitter: ((ja = Ar.remoteData) === null || ja === void 0 ? void 0 : ja.jitter) || 0 }), b.set(te, {
2786
- score: +(Ar.score * 10).toFixed(),
2787
- bitrate: ((Ar.bytesSent || 0) - (((Fa = n.audioProducerToStatsMap.get(te)) === null || Fa === void 0 ? void 0 : Fa.bytesSent) || 0)) * 8 / 7,
2784
+ var Va, Ua, wt, ja, Fa, Ha, Ba, Pt, qa, Ir = d.outboundAudioRtp.get(re.outboundAudioRtpId[0]);
2785
+ Ir.score = Sv({ packetsSent: (Ir.packetsSent || 0) - (((Va = n.audioProducerToStatsMap.get(te)) === null || Va === void 0 ? void 0 : Va.packetsSent) || 0), packetsLost: (((Ua = Ir.remoteData) === null || Ua === void 0 ? void 0 : Ua.packetsLost) || 0) - (((wt = n.audioProducerToStatsMap.get(te)) === null || wt === void 0 || (wt = wt.remoteData) === null || wt === void 0 ? void 0 : wt.packetsLost) || 0), jitter: ((ja = Ir.remoteData) === null || ja === void 0 ? void 0 : ja.jitter) || 0 }), b.set(te, {
2786
+ score: +(Ir.score * 10).toFixed(),
2787
+ bitrate: ((Ir.bytesSent || 0) - (((Fa = n.audioProducerToStatsMap.get(te)) === null || Fa === void 0 ? void 0 : Fa.bytesSent) || 0)) * 8 / 7,
2788
2788
  // Bytes received in last 7 seconds
2789
- packetsLostPercentage: mc({ packetsSent: (Ar.packetsSent || 0) - (((Ha = n.audioProducerToStatsMap.get(te)) === null || Ha === void 0 ? void 0 : Ha.packetsSent) || 0), packetsLost: (((Ba = Ar.remoteData) === null || Ba === void 0 ? void 0 : Ba.packetsLost) || 0) - (((Pt = n.audioProducerToStatsMap.get(te)) === null || Pt === void 0 || (Pt = Pt.remoteData) === null || Pt === void 0 ? void 0 : Pt.packetsLost) || 0) }),
2790
- jitter: ((qa = Ar.remoteData) === null || qa === void 0 ? void 0 : qa.jitter) || 0,
2789
+ packetsLostPercentage: mc({ packetsSent: (Ir.packetsSent || 0) - (((Ha = n.audioProducerToStatsMap.get(te)) === null || Ha === void 0 ? void 0 : Ha.packetsSent) || 0), packetsLost: (((Ba = Ir.remoteData) === null || Ba === void 0 ? void 0 : Ba.packetsLost) || 0) - (((Pt = n.audioProducerToStatsMap.get(te)) === null || Pt === void 0 || (Pt = Pt.remoteData) === null || Pt === void 0 ? void 0 : Pt.packetsLost) || 0) }),
2790
+ jitter: ((qa = Ir.remoteData) === null || qa === void 0 ? void 0 : qa.jitter) || 0,
2791
2791
  isScreenShare: n.screenShareProducers.has(te)
2792
- }), n.audioProducerToStatsMap.set(te, Ar);
2792
+ }), n.audioProducerToStatsMap.set(te, Ir);
2793
2793
  }
2794
2794
  }), g.forEach(function(re) {
2795
2795
  var te = v.find(function(kr) {
2796
2796
  return kr.id === re.localCandidateId ? (re.localCandidateId = kr.id, kr) : null;
2797
- }), Rr = f.find(function(kr) {
2797
+ }), Ar = f.find(function(kr) {
2798
2798
  return kr.id === re.remoteCandidateId ? (re.remoteCandidateId = kr.id, kr) : null;
2799
2799
  });
2800
- te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort), Rr && (re.remoteCandidateType = Rr.type, re.remoteCandidateAddress = ca(Rr.address), re.remoteCandidatePort = Rr.port, re.remoteCandidateProtocol = Rr.protocol, re.remoteCandidateUrl = Rr.url);
2800
+ te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort), Ar && (re.remoteCandidateType = Ar.type, re.remoteCandidateAddress = ca(Ar.address), re.remoteCandidatePort = Ar.port, re.remoteCandidateProtocol = Ar.protocol, re.remoteCandidateUrl = Ar.url);
2801
2801
  }), d.candidatePair && (d.transport ? (d.transport.bytesReceived = d.candidatePair.bytesReceived, d.transport.bytesSent = d.candidatePair.bytesSent, d.transport.totalRoundTripTime = d.candidatePair.totalRoundTripTime, d.transport.availableOutgoingBitrate = d.candidatePair.availableOutgoingBitrate, d.transport.availableIncomingBitrate = d.candidatePair.availableIncomingBitrate, d.transport.roundTripTime = d.candidatePair.currentRoundTripTime) : d.transport = {
2802
2802
  // candidateStats: result.candidatePair,
2803
2803
  bytesReceived: d.candidatePair.bytesReceived,
@@ -5863,12 +5863,12 @@ function Yw(s) {
5863
5863
  var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
5864
5864
  var o = 0.5, u = 0.5, l = i, d = a, p = Math.min(r / l, n / d), v = l * p, f = d * p, g, b, y, k, w = 1;
5865
5865
  return v < r && (w = r / v), Math.abs(w - 1) < 1e-14 && f < n && (w = n / f), v *= w, f *= w, y = l / (v / r), k = d / (f / n), g = (l - y) * o, b = (d - k) * u, g < 0 && (g = 0), b < 0 && (b = 0), y > l && (y = l), k > d && (k = d), [g, b, y, k, t, e, r, n];
5866
- }, Vr = /* @__PURE__ */ E("canvas"), Wn = /* @__PURE__ */ E("context"), Xe = /* @__PURE__ */ E("videoContainer"), Ur = /* @__PURE__ */ E("video"), Te = /* @__PURE__ */ E("dimensions"), Qr = /* @__PURE__ */ E("colors"), Ct = /* @__PURE__ */ E("rafRequest"), ir = /* @__PURE__ */ E("sources"), Re = /* @__PURE__ */ E("self"), Ga = /* @__PURE__ */ E("pinIcon"), Wa = /* @__PURE__ */ E("handRaiseIcon"), Rt = /* @__PURE__ */ E("state"), Ja = /* @__PURE__ */ E("initComplete"), Zw = /* @__PURE__ */ function(s) {
5866
+ }, Ur = /* @__PURE__ */ E("canvas"), Wn = /* @__PURE__ */ E("context"), Xe = /* @__PURE__ */ E("videoContainer"), jr = /* @__PURE__ */ E("video"), Te = /* @__PURE__ */ E("dimensions"), Yr = /* @__PURE__ */ E("colors"), Ct = /* @__PURE__ */ E("rafRequest"), ir = /* @__PURE__ */ E("sources"), Re = /* @__PURE__ */ E("self"), Ga = /* @__PURE__ */ E("pinIcon"), Wa = /* @__PURE__ */ E("handRaiseIcon"), Rt = /* @__PURE__ */ E("state"), Ja = /* @__PURE__ */ E("initComplete"), Zw = /* @__PURE__ */ function(s) {
5867
5867
  function t(e, r, n, i) {
5868
5868
  var a;
5869
5869
  P(this, t);
5870
5870
  var o = e.getValue("logger");
5871
- return a = C(this, t, [o]), Object.defineProperty(a, Vr, { writable: !0, value: void 0 }), Object.defineProperty(a, Wn, { writable: !0, value: void 0 }), Object.defineProperty(a, Xe, { writable: !0, value: void 0 }), Object.defineProperty(a, Ur, { writable: !0, value: void 0 }), Object.defineProperty(a, Te, { writable: !0, value: { height: vh, width: fh } }), Object.defineProperty(a, Qr, { writable: !0, value: { brand: "#2160FD", background: "#141414", text: "#000000", videoBackground: "#191919", textOnBrand: "#EEEEEE" } }), Object.defineProperty(a, Ct, { writable: !0, value: void 0 }), Object.defineProperty(a, ir, { writable: !0, value: {} }), Object.defineProperty(a, Re, { writable: !0, value: void 0 }), Object.defineProperty(a, Ga, { writable: !0, value: void 0 }), Object.defineProperty(a, Wa, { writable: !0, value: void 0 }), Object.defineProperty(a, Rt, { writable: !0, value: void 0 }), Object.defineProperty(a, Ja, { writable: !0, value: !1 }), a.cleanupEventListeners = function() {
5871
+ return a = C(this, t, [o]), Object.defineProperty(a, Ur, { writable: !0, value: void 0 }), Object.defineProperty(a, Wn, { writable: !0, value: void 0 }), Object.defineProperty(a, Xe, { writable: !0, value: void 0 }), Object.defineProperty(a, jr, { writable: !0, value: void 0 }), Object.defineProperty(a, Te, { writable: !0, value: { height: vh, width: fh } }), Object.defineProperty(a, Yr, { writable: !0, value: { brand: "#2160FD", background: "#141414", text: "#000000", videoBackground: "#191919", textOnBrand: "#EEEEEE" } }), Object.defineProperty(a, Ct, { writable: !0, value: void 0 }), Object.defineProperty(a, ir, { writable: !0, value: {} }), Object.defineProperty(a, Re, { writable: !0, value: void 0 }), Object.defineProperty(a, Ga, { writable: !0, value: void 0 }), Object.defineProperty(a, Wa, { writable: !0, value: void 0 }), Object.defineProperty(a, Rt, { writable: !0, value: void 0 }), Object.defineProperty(a, Ja, { writable: !0, value: !1 }), a.cleanupEventListeners = function() {
5872
5872
  c(a, Wn)[Wn].unsubscribe("stageStatus", a.handlePipMediaControls), c(a, Re)[Re].removeListener("videoUpdate", a.onSelfVideoUpdateListener), c(a, Re)[Re].removeListener("audioUpdate", a.onSelfAudioUpdateListener), c(a, Re)[Re].removeListener("roomLeft", function() {
5873
5873
  return a.disable();
5874
5874
  });
@@ -5897,7 +5897,7 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
5897
5897
  }, a.disable = function() {
5898
5898
  var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
5899
5899
  c(a, Rt)[Rt] = "idle", a.cleanupEventListeners(), cancelAnimationFrame(c(a, Ct)[Ct]), u !== !0 && document.body.removeChild(c(a, Xe)[Xe]), c(a, Ct)[Ct] = void 0, document.pictureInPictureElement && document.exitPictureInPicture();
5900
- }, c(a, Wn)[Wn] = e, c(a, Rt)[Rt] = "idle", c(a, Re)[Re] = r, c(a, Qr)[Qr] = { brand: r.config.designTokens.colors.brand[500], background: r.config.designTokens.colors.background[1e3], text: r.config.designTokens.colors.text, videoBackground: r.config.designTokens.colors.videoBg, textOnBrand: r.config.designTokens.colors.textOnBrand }, n && a.setupIcon("pin", n), i && a.setupIcon("handRaise", i), a;
5900
+ }, c(a, Wn)[Wn] = e, c(a, Rt)[Rt] = "idle", c(a, Re)[Re] = r, c(a, Yr)[Yr] = { brand: r.config.designTokens.colors.brand[500], background: r.config.designTokens.colors.background[1e3], text: r.config.designTokens.colors.text, videoBackground: r.config.designTokens.colors.videoBg, textOnBrand: r.config.designTokens.colors.textOnBrand }, n && a.setupIcon("pin", n), i && a.setupIcon("handRaise", i), a;
5901
5901
  }
5902
5902
  return R(t, s), S(t, [{ key: "setupIcon", value: function() {
5903
5903
  var e = m(/* @__PURE__ */ h().mark(function n(i, a) {
@@ -5955,7 +5955,7 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
5955
5955
  }, n.src = a;
5956
5956
  });
5957
5957
  } }, { key: "createVideoContainer", value: function() {
5958
- c(this, Xe)[Xe] = document.createElement("div"), c(this, Xe)[Xe].style.width = "0.1px", c(this, Xe)[Xe].style.height = "0.1px", c(this, Xe)[Xe].style.overflow = "hidden", c(this, Xe)[Xe].style.position = "absolute", c(this, Xe)[Xe].style.bottom = "0", c(this, Xe)[Xe].style.right = "0", c(this, Xe)[Xe].style.opacity = "0", c(this, Xe)[Xe].appendChild(c(this, Ur)[Ur]);
5958
+ c(this, Xe)[Xe] = document.createElement("div"), c(this, Xe)[Xe].style.width = "0.1px", c(this, Xe)[Xe].style.height = "0.1px", c(this, Xe)[Xe].style.overflow = "hidden", c(this, Xe)[Xe].style.position = "absolute", c(this, Xe)[Xe].style.bottom = "0", c(this, Xe)[Xe].style.right = "0", c(this, Xe)[Xe].style.opacity = "0", c(this, Xe)[Xe].appendChild(c(this, jr)[jr]);
5959
5959
  } }, { key: "setupEventListeners", value: function() {
5960
5960
  var r = this;
5961
5961
  c(this, Wn)[Wn].subscribe("stageStatus", this.handlePipMediaControls), c(this, Re)[Re].addListener("videoUpdate", this.onSelfVideoUpdateListener), c(this, Re)[Re].addListener("audioUpdate", this.onSelfAudioUpdateListener), c(this, Re)[Re].addListener("roomLeft", function() {
@@ -5963,7 +5963,7 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
5963
5963
  });
5964
5964
  } }, { key: "createCanvas", value: function() {
5965
5965
  var r = document.createElement("canvas");
5966
- r.height = c(this, Te)[Te].height, r.width = c(this, Te)[Te].width, c(this, Vr)[Vr] = r;
5966
+ r.height = c(this, Te)[Te].height, r.width = c(this, Te)[Te].width, c(this, Ur)[Ur] = r;
5967
5967
  } }, { key: "setupMediaSessionEvents", value: function() {
5968
5968
  var r = this;
5969
5969
  navigator.mediaSession === void 0 || navigator.mediaSession.setCameraActive === void 0 || (navigator.mediaSession.setActionHandler("hangup", function() {
@@ -5985,21 +5985,21 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
5985
5985
  }, { pinned: [], regular: [] });
5986
5986
  return [].concat(Ie(n.pinned), Ie(n.regular));
5987
5987
  } }, { key: "drawEmptyTile", value: function(r, n, i, a) {
5988
- if (c(this, Vr)[Vr] !== void 0) {
5989
- var o = c(this, Vr)[Vr].getContext("2d"), u = c(this, Vr)[Vr].width, l = 0, d = 0, p = n - l * 2, v = i - l * 2, f = Math.floor(u / p), g = Math.floor(r / f), b = r % f, y = b * (p + l) + l, k = g * (v + l) + l, w = a != null ? a : {}, T = w.displayText, A = w.image;
5990
- o.fillStyle = T || A ? c(this, Qr)[Qr].videoBackground : c(this, Qr)[Qr].background, o.strokeStyle = c(this, Qr)[Qr].brand, o.beginPath(), o.moveTo(y + d, k), o.arcTo(y + p, k, y + p, k + d, d), o.arcTo(y + p, k + v, y + p - d, k + v, d), o.arcTo(y, k + v, y, k + v - d, d), o.arcTo(y, k, y + d, k, d), o.closePath(), o.fill(), o.stroke();
5988
+ if (c(this, Ur)[Ur] !== void 0) {
5989
+ var o = c(this, Ur)[Ur].getContext("2d"), u = c(this, Ur)[Ur].width, l = 0, d = 0, p = n - l * 2, v = i - l * 2, f = Math.floor(u / p), g = Math.floor(r / f), b = r % f, y = b * (p + l) + l, k = g * (v + l) + l, w = a != null ? a : {}, T = w.displayText, A = w.image;
5990
+ o.fillStyle = T || A ? c(this, Yr)[Yr].videoBackground : c(this, Yr)[Yr].background, o.strokeStyle = c(this, Yr)[Yr].brand, o.beginPath(), o.moveTo(y + d, k), o.arcTo(y + p, k, y + p, k + d, d), o.arcTo(y + p, k + v, y + p - d, k + v, d), o.arcTo(y, k + v, y, k + v - d, d), o.arcTo(y, k, y + d, k, d), o.closePath(), o.fill(), o.stroke();
5991
5991
  var M = p / 6, O = p / 2 + y, I = v / 2 + k;
5992
- o.save(), (T || A) && (o.beginPath(), o.arc(O, I, M, 0, Math.PI * 2), o.fillStyle = c(this, Qr)[Qr].brand, o.fill(), A ? (o.clip(), o.drawImage(A, O - M, I - M, M * 2, M * 2), o.restore()) : T && (o.fillStyle = c(this, Qr)[Qr].textOnBrand, o.font = "".concat(M / 2, "px sans-serif"), o.textAlign = "center", o.textBaseline = "middle", o.fillText(T, O, I)), this.drawIcons(a, y, k, Math.max(p, v)));
5992
+ o.save(), (T || A) && (o.beginPath(), o.arc(O, I, M, 0, Math.PI * 2), o.fillStyle = c(this, Yr)[Yr].brand, o.fill(), A ? (o.clip(), o.drawImage(A, O - M, I - M, M * 2, M * 2), o.restore()) : T && (o.fillStyle = c(this, Yr)[Yr].textOnBrand, o.font = "".concat(M / 2, "px sans-serif"), o.textAlign = "center", o.textBaseline = "middle", o.fillText(T, O, I)), this.drawIcons(a, y, k, Math.max(p, v)));
5993
5993
  }
5994
5994
  } }, { key: "drawIcons", value: function(r, n, i, a) {
5995
5995
  var o = this, u = Math.min(Math.max(a * 0.15, 100), 200), l = u * 0.2, d = u * 0.2, p = n + l, v = i + l, f = function(b) {
5996
- var y = c(o, Vr)[Vr].getContext("2d");
5997
- y.save(), y.fillStyle = c(o, Qr)[Qr].background, y.beginPath(), y.moveTo(p + d, v), y.arcTo(p + u, v, p + u, v + d, d), y.arcTo(p + u, v + u, p + u - d, v + u, d), y.arcTo(p, v + u, p, v + u - d, d), y.arcTo(p, v, p + d, v, d), y.closePath(), y.fill(), typeof b == "string" ? (y.font = "".concat(u / 1.5, "px sans-serif"), y.fillStyle = c(o, Qr)[Qr].text, y.textAlign = "center", y.textBaseline = "top", y.fillText(b, u / 2 + p, v + l)) : y.drawImage(b, p + l, v + l, u - l * 2, u - l * 2), p += u + l, y.restore();
5996
+ var y = c(o, Ur)[Ur].getContext("2d");
5997
+ y.save(), y.fillStyle = c(o, Yr)[Yr].background, y.beginPath(), y.moveTo(p + d, v), y.arcTo(p + u, v, p + u, v + d, d), y.arcTo(p + u, v + u, p + u - d, v + u, d), y.arcTo(p, v + u, p, v + u - d, d), y.arcTo(p, v, p + d, v, d), y.closePath(), y.fill(), typeof b == "string" ? (y.font = "".concat(u / 1.5, "px sans-serif"), y.fillStyle = c(o, Yr)[Yr].text, y.textAlign = "center", y.textBaseline = "top", y.fillText(b, u / 2 + p, v + l)) : y.drawImage(b, p + l, v + l, u - l * 2, u - l * 2), p += u + l, y.restore();
5998
5998
  };
5999
5999
  r.pinned && f(c(this, Ga)[Ga]), r.handRaised && f(c(this, Wa)[Wa]), r.reaction && f(r.reaction);
6000
6000
  } }, { key: "drawTile", value: function(r, n, i) {
6001
- if (c(this, Vr)[Vr] !== void 0)
6002
- for (var a = c(this, Vr)[Vr].getContext("2d"), o = this.getSources(), u = 0, l = 0; u < c(this, Te)[Te].height - 5; ) {
6001
+ if (c(this, Ur)[Ur] !== void 0)
6002
+ for (var a = c(this, Ur)[Ur].getContext("2d"), o = this.getSources(), u = 0, l = 0; u < c(this, Te)[Te].height - 5; ) {
6003
6003
  for (var d = 0; d < c(this, Te)[Te].width - 5 && l < i; ) {
6004
6004
  var p;
6005
6005
  if ((p = o[l]) !== null && p !== void 0 && p.enabled) {
@@ -6049,7 +6049,7 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
6049
6049
  document.body.removeChild(c(this, Xe)[Xe]);
6050
6050
  } catch (r) {
6051
6051
  }
6052
- this.removeAllSources(), c(this, Vr)[Vr] = void 0, c(this, Ur)[Ur] = void 0, c(this, Ct)[Ct] = void 0;
6052
+ this.removeAllSources(), c(this, Ur)[Ur] = void 0, c(this, jr)[jr] = void 0, c(this, Ct)[Ct] = void 0;
6053
6053
  }
6054
6054
  /**
6055
6055
  * Initialize PiP and prepare sources
@@ -6064,9 +6064,9 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
6064
6064
  if (!c(this, Ja)[Ja]) {
6065
6065
  c(this, Ja)[Ja] = !0, this.createCanvas(), this.setupMediaSessionEvents();
6066
6066
  var o = document.createElement("video");
6067
- c(this, Te)[Te] = { height: i != null ? i : vh, width: a != null ? a : fh }, o.height = c(this, Te)[Te].height, o.width = c(this, Te)[Te].width, o.autoplay = !0, o.muted = !0, o.srcObject = c(this, Vr)[Vr].captureStream(24), c(this, Ur)[Ur] = o, c(this, Ur)[Ur].onloadedmetadata = function() {
6067
+ c(this, Te)[Te] = { height: i != null ? i : vh, width: a != null ? a : fh }, o.height = c(this, Te)[Te].height, o.width = c(this, Te)[Te].width, o.autoplay = !0, o.muted = !0, o.srcObject = c(this, Ur)[Ur].captureStream(24), c(this, jr)[jr] = o, c(this, jr)[jr].onloadedmetadata = function() {
6068
6068
  try {
6069
- r.emit("pipStarted"), c(r, Ur)[Ur].onleavepictureinpicture = function() {
6069
+ r.emit("pipStarted"), c(r, jr)[jr].onleavepictureinpicture = function() {
6070
6070
  r.emit("pipEnded");
6071
6071
  };
6072
6072
  } catch (u) {
@@ -6183,11 +6183,11 @@ var vh = 1080, fh = 1920, Xw = function(t, e, r, n, i, a) {
6183
6183
  var r = this;
6184
6184
  c(this, Rt)[Rt] = "activating", this.setupEventListeners(), this.updateMediaSession("CAMERA", c(this, Re)[Re].videoEnabled), this.updateMediaSession("MIC", c(this, Re)[Re].audioEnabled), document.body.appendChild(c(this, Xe)[Xe]), c(this, Ct)[Ct] = requestAnimationFrame(function() {
6185
6185
  return r.animate();
6186
- }), c(this, Ur)[Ur].onloadedmetadata = function() {
6187
- c(r, Ur)[Ur].requestPictureInPicture().then(function() {
6186
+ }), c(this, jr)[jr].onloadedmetadata = function() {
6187
+ c(r, jr)[jr].requestPictureInPicture().then(function() {
6188
6188
  c(r, Rt)[Rt] = "active";
6189
6189
  });
6190
- }, c(this, Ur)[Ur].readyState === 4 && c(this, Ur)[Ur].requestPictureInPicture().then(function() {
6190
+ }, c(this, jr)[jr].readyState === 4 && c(this, jr)[jr].requestPictureInPicture().then(function() {
6191
6191
  c(r, Rt)[Rt] = "active";
6192
6192
  });
6193
6193
  } }], [{ key: "_init", value: function() {
@@ -10709,15 +10709,15 @@ function $f(s, t) {
10709
10709
  return e[r] = t | s[r], e;
10710
10710
  }, {});
10711
10711
  }
10712
- var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(Df, 16777216), kn = $f(Df, 50331648), cc = ju(z1, x1), eA = Object.defineProperty, rA = Object.getOwnPropertyDescriptor, fa = function(t, e, r, n) {
10712
+ var Q = ju(G1, Q1), Kr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(Df, 16777216), kn = $f(Df, 50331648), cc = ju(z1, x1), eA = Object.defineProperty, rA = Object.getOwnPropertyDescriptor, fa = function(t, e, r, n) {
10713
10713
  for (var i = n > 1 ? void 0 : n ? rA(e, r) : e, a = t.length - 1, o; a >= 0; a--)
10714
10714
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
10715
10715
  return n && i && eA(e, r, i), i;
10716
10716
  }, Zt = /* @__PURE__ */ function(s) {
10717
10717
  return s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s;
10718
- }(Zt || {}), Ir = /* @__PURE__ */ E("socket"), Ka = /* @__PURE__ */ E("context"), Mi = /* @__PURE__ */ function() {
10718
+ }(Zt || {}), Mr = /* @__PURE__ */ E("socket"), Ka = /* @__PURE__ */ E("context"), Mi = /* @__PURE__ */ function() {
10719
10719
  function s(t, e) {
10720
- P(this, s), Object.defineProperty(this, Ir, { writable: !0, value: void 0 }), Object.defineProperty(this, Ka, { writable: !0, value: void 0 }), c(this, Ir)[Ir] = e, c(this, Ka)[Ka] = t;
10720
+ P(this, s), Object.defineProperty(this, Mr, { writable: !0, value: void 0 }), Object.defineProperty(this, Ka, { writable: !0, value: void 0 }), c(this, Mr)[Mr] = e, c(this, Ka)[Ka] = t;
10721
10721
  }
10722
10722
  return S(s, [{
10723
10723
  key: "telemetry",
@@ -10737,7 +10737,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10737
10737
  }, { key: "logger", get: function() {
10738
10738
  return c(this, Ka)[Ka].getValue("logger");
10739
10739
  } }, { key: "getChatMessages", value: function() {
10740
- return c(this, Ir)[Ir].sendMessagePromise(Jr.getMessages);
10740
+ return c(this, Mr)[Mr].sendMessagePromise(Kr.getMessages);
10741
10741
  } }, { key: "getChatMessagesPaginated", value: function() {
10742
10742
  var t = m(/* @__PURE__ */ h().mark(function r(n, i, a, o) {
10743
10743
  var u, l;
@@ -10751,7 +10751,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10751
10751
  from: 0,
10752
10752
  // NOTE(ikabra): We do not need offset for timeStamp based pagination.
10753
10753
  reversed: a
10754
- }, o && { filters: { filters: o } }), p.next = 3, c(this, Ir)[Ir].sendMessagePromise(Jr.getPaginatedMessages, lR.toBinary(u));
10754
+ }, o && { filters: { filters: o } }), p.next = 3, c(this, Mr)[Mr].sendMessagePromise(Kr.getPaginatedMessages, lR.toBinary(u));
10755
10755
  case 3:
10756
10756
  if (l = p.sent, l.payload) {
10757
10757
  p.next = 6;
@@ -10772,10 +10772,10 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10772
10772
  return e;
10773
10773
  }() }, { key: "sendMessageToRoom", value: function(e, r) {
10774
10774
  var n = { payloadType: r, payload: e };
10775
- c(this, Ir)[Ir].sendMessage(Jr.sendMessageToRoom, fR.toBinary(n));
10775
+ c(this, Mr)[Mr].sendMessage(Kr.sendMessageToRoom, fR.toBinary(n));
10776
10776
  } }, { key: "sendMessageToPeers", value: function(e, r, n) {
10777
10777
  var i = { payloadType: r, peerIds: n, payload: e };
10778
- c(this, Ir)[Ir].sendMessage(Jr.sendMessageToPeers, yR.toBinary(i));
10778
+ c(this, Mr)[Mr].sendMessage(Kr.sendMessageToPeers, yR.toBinary(i));
10779
10779
  } }, { key: "sendMessage", value: function(e, r, n) {
10780
10780
  if (n && n.length > 0) {
10781
10781
  this.sendMessageToPeers(e, r, n);
@@ -10789,7 +10789,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10789
10789
  for (; ; )
10790
10790
  switch (p.prev = p.next) {
10791
10791
  case 0:
10792
- return u = { chatId: n, payloadType: a, payload: i }, o !== void 0 && (u.pinned = o), p.next = 4, c(this, Ir)[Ir].sendMessagePromise(Jr.editMessage, PR.toBinary(u));
10792
+ return u = { chatId: n, payloadType: a, payload: i }, o !== void 0 && (u.pinned = o), p.next = 4, c(this, Mr)[Mr].sendMessagePromise(Kr.editMessage, PR.toBinary(u));
10793
10793
  case 4:
10794
10794
  return l = p.sent, p.abrupt("return", rc.fromBinary(l.payload).message);
10795
10795
  case 6:
@@ -10809,7 +10809,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10809
10809
  for (; ; )
10810
10810
  switch (l.prev = l.next) {
10811
10811
  case 0:
10812
- return i = { chatId: n }, l.next = 3, c(this, Ir)[Ir].sendMessagePromise(Jr.deleteMessage, IR.toBinary(i));
10812
+ return i = { chatId: n }, l.next = 3, c(this, Mr)[Mr].sendMessagePromise(Kr.deleteMessage, IR.toBinary(i));
10813
10813
  case 3:
10814
10814
  return a = l.sent, o = tc.fromBinary(a.payload), l.abrupt("return", { id: o.chatId });
10815
10815
  case 6:
@@ -10829,7 +10829,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10829
10829
  for (; ; )
10830
10830
  switch (f.prev = f.next) {
10831
10831
  case 0:
10832
- return d = { searchTerm: n, timeStamp: (a = i.timestamp) !== null && a !== void 0 ? a : Date.now(), size: (o = i.limit) !== null && o !== void 0 ? o : 75, from: (u = i.offset) !== null && u !== void 0 ? u : 0, reversed: (l = i.reversed) !== null && l !== void 0 ? l : !0 }, f.prev = 1, f.next = 4, c(this, Ir)[Ir].sendMessagePromise(Jr.searchChannelMessages, OR.toBinary(d));
10832
+ return d = { searchTerm: n, timeStamp: (a = i.timestamp) !== null && a !== void 0 ? a : Date.now(), size: (o = i.limit) !== null && o !== void 0 ? o : 75, from: (u = i.offset) !== null && u !== void 0 ? u : 0, reversed: (l = i.reversed) !== null && l !== void 0 ? l : !0 }, f.prev = 1, f.next = 4, c(this, Mr)[Mr].sendMessagePromise(Kr.searchChannelMessages, OR.toBinary(d));
10833
10833
  case 4:
10834
10834
  return p = f.sent, f.abrupt("return", _f.fromBinary(p.payload).messages);
10835
10835
  case 8:
@@ -10851,7 +10851,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10851
10851
  for (; ; )
10852
10852
  switch (l.prev = l.next) {
10853
10853
  case 0:
10854
- return a = { chatId: n, pinned: i }, l.next = 3, c(this, Ir)[Ir].sendMessagePromise(Jr.pinMessage, ER.toBinary(a));
10854
+ return a = { chatId: n, pinned: i }, l.next = 3, c(this, Mr)[Mr].sendMessagePromise(Kr.pinMessage, ER.toBinary(a));
10855
10855
  case 3:
10856
10856
  return o = l.sent, l.abrupt("return", ec.fromBinary(o.payload));
10857
10857
  case 5:
@@ -10867,23 +10867,23 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10867
10867
  }() }, { key: "on", value: function(e, r) {
10868
10868
  var n = this, i, a;
10869
10869
  switch (e) {
10870
- case Jr.sendMessageToRoom: {
10870
+ case Kr.sendMessageToRoom: {
10871
10871
  i = cl.fromBinary.bind(cl), a = cl.create();
10872
10872
  break;
10873
10873
  }
10874
- case Jr.sendMessageToPeers: {
10874
+ case Kr.sendMessageToPeers: {
10875
10875
  i = ll.fromBinary.bind(ll), a = ll.create();
10876
10876
  break;
10877
10877
  }
10878
- case Jr.editMessage: {
10878
+ case Kr.editMessage: {
10879
10879
  i = rc.fromBinary.bind(rc), a = rc.create();
10880
10880
  break;
10881
10881
  }
10882
- case Jr.pinMessage: {
10882
+ case Kr.pinMessage: {
10883
10883
  i = ec.fromBinary.bind(ec), a = ec.create();
10884
10884
  break;
10885
10885
  }
10886
- case Jr.deleteMessage: {
10886
+ case Kr.deleteMessage: {
10887
10887
  i = tc.fromBinary.bind(tc), a = tc.create();
10888
10888
  break;
10889
10889
  }
@@ -10892,7 +10892,7 @@ var Q = ju(G1, Q1), Jr = ju(W1, Y1), mi = ju(J1, X1), yi = ju(K1, Z1), sa = $f(D
10892
10892
  this.logger.warn("ChatSocketHandler::Event ".concat(e, " is not recognized"));
10893
10893
  return;
10894
10894
  }
10895
- c(this, Ir)[Ir].on(e, function(o) {
10895
+ c(this, Mr)[Mr].on(e, function(o) {
10896
10896
  var u = o.payload, l = a;
10897
10897
  try {
10898
10898
  l = i(u);
@@ -12343,22 +12343,22 @@ var gA = Object.defineProperty, mA = Object.getOwnPropertyDescriptor, yA = funct
12343
12343
  return i.stop();
12344
12344
  }
12345
12345
  }, r);
12346
- }))), this.chatSocketHandler.on(Jr.sendMessageToRoom, function(r) {
12346
+ }))), this.chatSocketHandler.on(Kr.sendMessageToRoom, function(r) {
12347
12347
  if (r.message) {
12348
12348
  var n = Zi.formatSocketPeerMessage(r.message);
12349
12349
  e.chat.messages = [].concat(Ie(e.chat.messages), [n]), e.chat.emit("chatUpdate", { action: "add", message: n, messages: e.chat.messages });
12350
12350
  }
12351
- }), this.chatSocketHandler.on(Jr.sendMessageToPeers, function(r) {
12351
+ }), this.chatSocketHandler.on(Kr.sendMessageToPeers, function(r) {
12352
12352
  var n = Zi.formatSocketPeerMessage(r.message);
12353
12353
  e.chat.messages = [].concat(Ie(e.chat.messages), [n]), e.chat.emit("chatUpdate", { action: "add", message: n, messages: e.chat.messages });
12354
- }), this.chatSocketHandler.on(Jr.editMessage, function(r) {
12354
+ }), this.chatSocketHandler.on(Kr.editMessage, function(r) {
12355
12355
  if (r.message) {
12356
12356
  var n = Zi.formatSocketPeerMessage(r.message), i = e.chat.messages.findIndex(function(a) {
12357
12357
  return a.id === n.id;
12358
12358
  });
12359
12359
  i !== -1 && (e.chat.messages[i] = n), e.chat.emit("chatUpdate", { action: "edit", message: n, messages: e.chat.messages });
12360
12360
  }
12361
- }), this.chatSocketHandler.on(Jr.deleteMessage, function(r) {
12361
+ }), this.chatSocketHandler.on(Kr.deleteMessage, function(r) {
12362
12362
  var n = e.chat.messages.findIndex(function(u) {
12363
12363
  return u.id === r.chatId;
12364
12364
  }), i = { id: r.chatId };
@@ -12367,7 +12367,7 @@ var gA = Object.defineProperty, mA = Object.getOwnPropertyDescriptor, yA = funct
12367
12367
  i = o[0];
12368
12368
  }
12369
12369
  e.chat.emit("chatUpdate", { action: "delete", message: i, messages: e.chat.messages });
12370
- }), this.chatSocketHandler.on(Jr.pinMessage, function(r) {
12370
+ }), this.chatSocketHandler.on(Kr.pinMessage, function(r) {
12371
12371
  var n = e.chat.messages.findIndex(function(a) {
12372
12372
  return a.id === r.chatId;
12373
12373
  }), i = Zi.formatSocketPeerMessage(r.message);
@@ -12854,9 +12854,9 @@ var $A = Object.defineProperty, LA = Object.getOwnPropertyDescriptor, NA = funct
12854
12854
  for (var i = n > 1 ? void 0 : n ? LA(e, r) : e, a = t.length - 1, o; a >= 0; a--)
12855
12855
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
12856
12856
  return n && i && $A(e, r, i), i;
12857
- }, jf = (zt = /* @__PURE__ */ E("self"), Vi = /* @__PURE__ */ E("roomSocketHandler"), Pr = /* @__PURE__ */ E("context"), /* @__PURE__ */ function() {
12857
+ }, jf = (zt = /* @__PURE__ */ E("self"), Vi = /* @__PURE__ */ E("roomSocketHandler"), Sr = /* @__PURE__ */ E("context"), /* @__PURE__ */ function() {
12858
12858
  function s(t, e, r, n, i, a) {
12859
- P(this, s), this.meta = void 0, this.ai = void 0, Object.defineProperty(this, zt, { writable: !0, value: void 0 }), Object.defineProperty(this, Vi, { writable: !0, value: void 0 }), this.aiSocketHandler = void 0, Object.defineProperty(this, Pr, { writable: !0, value: void 0 }), c(this, Pr)[Pr] = t, this.meta = new nd(t, e, e.config.viewType, r, a), this.ai = n, c(this, zt)[zt] = e, c(this, Vi)[Vi] = r, this.aiSocketHandler = i, this.setupEvents();
12859
+ P(this, s), this.meta = void 0, this.ai = void 0, Object.defineProperty(this, zt, { writable: !0, value: void 0 }), Object.defineProperty(this, Vi, { writable: !0, value: void 0 }), this.aiSocketHandler = void 0, Object.defineProperty(this, Sr, { writable: !0, value: void 0 }), c(this, Sr)[Sr] = t, this.meta = new nd(t, e, e.config.viewType, r, a), this.ai = n, c(this, zt)[zt] = e, c(this, Vi)[Vi] = r, this.aiSocketHandler = i, this.setupEvents();
12860
12860
  }
12861
12861
  return S(s, [{
12862
12862
  key: "telemetry",
@@ -12866,7 +12866,7 @@ var $A = Object.defineProperty, LA = Object.getOwnPropertyDescriptor, NA = funct
12866
12866
  * Not for external use
12867
12867
  */
12868
12868
  function() {
12869
- return c(this, Pr)[Pr].getValue("telemetry");
12869
+ return c(this, Sr)[Sr].getValue("telemetry");
12870
12870
  }
12871
12871
  )
12872
12872
  /**
@@ -12874,26 +12874,26 @@ var $A = Object.defineProperty, LA = Object.getOwnPropertyDescriptor, NA = funct
12874
12874
  * Not for external use
12875
12875
  */
12876
12876
  }, { key: "logger", get: function() {
12877
- return c(this, Pr)[Pr].getValue("logger");
12877
+ return c(this, Sr)[Sr].getValue("logger");
12878
12878
  } }, { key: "conditionallySetActiveTab", value: function(e) {
12879
12879
  var r;
12880
12880
  e != null && e.currentTab && ((r = this.meta.selfActiveTab) === null || r === void 0 ? void 0 : r.id) !== e.currentTab.id && (this.meta.setSelfActiveTab(e.currentTab, Vf.Meeting), this.meta.emit("activeTabUpdate", e.currentTab));
12881
12881
  } }, { key: "setupEvents", value: function() {
12882
12882
  var e = this;
12883
- c(this, Pr)[Pr].getValue("peerSessionStore").on(F.TRANSPORT_STATE_UPDATE, function(r) {
12883
+ c(this, Sr)[Sr].getValue("peerSessionStore").on(F.TRANSPORT_STATE_UPDATE, function(r) {
12884
12884
  e.meta.emit("mediaConnectionUpdate", r);
12885
- }), c(this, Pr)[Pr].getValue("peerSessionStore").on(F.SOCKET_STATE_UPDATE, function(r) {
12885
+ }), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.SOCKET_STATE_UPDATE, function(r) {
12886
12886
  e.meta.emit("socketConnectionUpdate", r);
12887
- }), c(this, Pr)[Pr].getValue("peerSessionStore").on(F.ROOM_STATE, function(r) {
12887
+ }), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.ROOM_STATE, function(r) {
12888
12888
  var n = r.createdAt, i = r.roomUuid, a = e.meta.meetingStartedTimestamp;
12889
12889
  if (i && (e.meta.sessionId = i), n && !a) {
12890
12890
  var o = new Date(n * 1e3);
12891
12891
  e.meta.meetingStartedTimestamp = o, e.meta.emit("meetingStartTimeUpdate", { meetingStartedTimestamp: e.meta.meetingStartedTimestamp });
12892
12892
  }
12893
- }), c(this, Pr)[Pr].getValue("peerSessionStore").on(F.PRODUCER_SCORE_UPDATE, function(r) {
12893
+ }), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.PRODUCER_SCORE_UPDATE, function(r) {
12894
12894
  var n = r.score;
12895
12895
  n < 5 && e.meta.emit("poorConnection", { score: n });
12896
- }), c(this, zt)[zt].permissions.canSpotlight && (this.logger.info("MetaController::Asserting Spotlight"), this.meta.selfActiveTab && c(this, Vi)[Vi].broadcastMessage("spotlight", { userId: c(this, zt)[zt].userId, currentTab: this.meta.selfActiveTab })), c(this, Pr)[Pr].getValue("peerSessionStore").on(F.PEER_JOINED_INTERNAL, /* @__PURE__ */ function() {
12896
+ }), c(this, zt)[zt].permissions.canSpotlight && (this.logger.info("MetaController::Asserting Spotlight"), this.meta.selfActiveTab && c(this, Vi)[Vi].broadcastMessage("spotlight", { userId: c(this, zt)[zt].userId, currentTab: this.meta.selfActiveTab })), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.PEER_JOINED_INTERNAL, /* @__PURE__ */ function() {
12897
12897
  var r = m(/* @__PURE__ */ h().mark(function n(i) {
12898
12898
  return h().wrap(function(o) {
12899
12899
  for (; ; )
@@ -12909,7 +12909,7 @@ var $A = Object.defineProperty, LA = Object.getOwnPropertyDescriptor, NA = funct
12909
12909
  return function(n) {
12910
12910
  return r.apply(this, arguments);
12911
12911
  };
12912
- }()), c(this, Pr)[Pr].getValue("peerSessionStore").on(F.ROOM_MESSAGE, function(r) {
12912
+ }()), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.ROOM_MESSAGE, function(r) {
12913
12913
  var n, i, a;
12914
12914
  if ("type" in r) {
12915
12915
  if (r.type !== "spotlight")
@@ -12922,7 +12922,7 @@ var $A = Object.defineProperty, LA = Object.getOwnPropertyDescriptor, NA = funct
12922
12922
  } else
12923
12923
  return;
12924
12924
  e.logger.info("Spotlight Assertion Received", { spotlight: { spotlighter: { id: a.userId }, currentTab: { id: (n = a.currentTab) === null || n === void 0 ? void 0 : n.id, type: (i = a.currentTab) === null || i === void 0 ? void 0 : i.type } } }), e.conditionallySetActiveTab(a);
12925
- }), c(this, Pr)[Pr].getValue("peerSessionStore").on(F.MESSAGE, function(r) {
12925
+ }), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.MESSAGE, function(r) {
12926
12926
  var n, i, a;
12927
12927
  if ("type" in r) {
12928
12928
  if (r.type !== "spotlight")
@@ -13021,12 +13021,12 @@ var Ao = {}, Oi = {
13021
13021
  for (var i = n > 1 ? void 0 : n ? UA(e, r) : e, a = t.length - 1, o; a >= 0; a--)
13022
13022
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
13023
13023
  return n && i && VA(e, r, i), i;
13024
- }, jr = /* @__PURE__ */ E("stageSocketHandler"), hl = /* @__PURE__ */ E("roomSocketHandler"), se = /* @__PURE__ */ E("self"), Io = /* @__PURE__ */ E("participants"), it = /* @__PURE__ */ E("stageRequests"), Be = /* @__PURE__ */ E("context"), Mo = /* @__PURE__ */ E("roomNodeClient"), za = /* @__PURE__ */ E("setStatus"), ga = /* @__PURE__ */ function(s) {
13024
+ }, Fr = /* @__PURE__ */ E("stageSocketHandler"), hl = /* @__PURE__ */ E("roomSocketHandler"), se = /* @__PURE__ */ E("self"), Io = /* @__PURE__ */ E("participants"), it = /* @__PURE__ */ E("stageRequests"), Be = /* @__PURE__ */ E("context"), Mo = /* @__PURE__ */ E("roomNodeClient"), za = /* @__PURE__ */ E("setStatus"), ga = /* @__PURE__ */ function(s) {
13025
13025
  function t(e, r, n, i, a) {
13026
13026
  var o;
13027
13027
  P(this, t);
13028
13028
  var u = e.getValue("logger");
13029
- return o = C(this, t, [u]), Object.defineProperty(o, za, { value: FA }), Object.defineProperty(o, Mo, { get: jA, set: void 0 }), Object.defineProperty(o, jr, { writable: !0, value: void 0 }), Object.defineProperty(o, hl, { writable: !0, value: void 0 }), Object.defineProperty(o, se, { writable: !0, value: void 0 }), Object.defineProperty(o, Io, { writable: !0, value: void 0 }), Object.defineProperty(o, it, { writable: !0, value: void 0 }), Object.defineProperty(o, Be, { writable: !0, value: void 0 }), c(o, Be)[Be] = e, c(o, jr)[jr] = i, c(o, hl)[hl] = a, c(o, se)[se] = r, c(o, Io)[Io] = n, c(o, it)[it] = [], o.setupEvents(), o;
13029
+ return o = C(this, t, [u]), Object.defineProperty(o, za, { value: FA }), Object.defineProperty(o, Mo, { get: jA, set: void 0 }), Object.defineProperty(o, Fr, { writable: !0, value: void 0 }), Object.defineProperty(o, hl, { writable: !0, value: void 0 }), Object.defineProperty(o, se, { writable: !0, value: void 0 }), Object.defineProperty(o, Io, { writable: !0, value: void 0 }), Object.defineProperty(o, it, { writable: !0, value: void 0 }), Object.defineProperty(o, Be, { writable: !0, value: void 0 }), c(o, Be)[Be] = e, c(o, Fr)[Fr] = i, c(o, hl)[hl] = a, c(o, se)[se] = r, c(o, Io)[Io] = n, c(o, it)[it] = [], o.setupEvents(), o;
13030
13030
  }
13031
13031
  return R(t, s), S(t, [{ key: "telemetry", get: (
13032
13032
  /**
@@ -13095,7 +13095,7 @@ var Ao = {}, Oi = {
13095
13095
  };
13096
13096
  c(this, se)[se].permissions.on("permissionsUpdate", function(o) {
13097
13097
  var u = o.canAcceptProductionRequests;
13098
- u !== void 0 && (c(r, se)[se].permissions.acceptStageRequests ? (i(), c(r, jr)[jr].getStageRequests()) : (a(), c(r, it)[it] = [], r.emit("stageAccessRequestUpdate", c(r, it)[it])));
13098
+ u !== void 0 && (c(r, se)[se].permissions.acceptStageRequests ? (i(), c(r, Fr)[Fr].getStageRequests()) : (a(), c(r, it)[it] = [], r.emit("stageAccessRequestUpdate", c(r, it)[it])));
13099
13099
  }), c(this, se)[se].permissions.acceptStageRequests && i();
13100
13100
  } }, { key: "getAccessRequests", value: function() {
13101
13101
  if (!c(this, se)[se].permissions.stageEnabled)
@@ -13132,7 +13132,7 @@ var Ao = {}, Oi = {
13132
13132
  }
13133
13133
  return c(this, za)[za]("ACCEPTED_TO_JOIN_STAGE"), a.abrupt("return");
13134
13134
  case 8:
13135
- c(this, jr)[jr].requestAccess(), c(this, za)[za]("REQUESTED_TO_JOIN_STAGE");
13135
+ c(this, Fr)[Fr].requestAccess(), c(this, za)[za]("REQUESTED_TO_JOIN_STAGE");
13136
13136
  case 10:
13137
13137
  case "end":
13138
13138
  return a.stop();
@@ -13157,7 +13157,7 @@ var Ao = {}, Oi = {
13157
13157
  }
13158
13158
  throw this.logger.error("Stage::stage_disabled"), new H("Stage is disabled", "2003");
13159
13159
  case 3:
13160
- c(this, jr)[jr].cancelRequestAccess(), c(this, za)[za]("OFF_STAGE");
13160
+ c(this, Fr)[Fr].cancelRequestAccess(), c(this, za)[za]("OFF_STAGE");
13161
13161
  case 5:
13162
13162
  case "end":
13163
13163
  return a.stop();
@@ -13181,7 +13181,7 @@ var Ao = {}, Oi = {
13181
13181
  throw this.logger.error("Stage::stage_disabled"), new H("Stage is disabled", "2003");
13182
13182
  if (!c(this, se)[se].permissions.acceptStageRequests)
13183
13183
  throw this.logger.error("Stage::grant_access::permission_denied"), new H("You do not have permission to perform this action", "2001");
13184
- return c(this, jr)[jr].grantAccess(r);
13184
+ return c(this, Fr)[Fr].grantAccess(r);
13185
13185
  }
13186
13186
  /**
13187
13187
  * @param {string[]} userIds
@@ -13195,7 +13195,7 @@ var Ao = {}, Oi = {
13195
13195
  throw this.logger.error("Stage::stage_disabled"), new H("Stage is disabled", "2003");
13196
13196
  if (!c(this, se)[se].permissions.acceptStageRequests)
13197
13197
  throw this.logger.error("Stage::deny_access::permission_denied"), new H("You do not have permission to perform this action", "2001");
13198
- return c(this, jr)[jr].denyAccess(r);
13198
+ return c(this, Fr)[Fr].denyAccess(r);
13199
13199
  }
13200
13200
  /**
13201
13201
  * Returns the peerId of the current user
@@ -13221,7 +13221,7 @@ var Ao = {}, Oi = {
13221
13221
  }
13222
13222
  throw new H("Unable to join stage you are currently ".concat(this.status), "2006");
13223
13223
  case 5:
13224
- return c(this, Be)[Be].setValue("stageStatus", "ON_STAGE", !1), o.next = 8, c(this, jr)[jr].joinStage();
13224
+ return c(this, Be)[Be].setValue("stageStatus", "ON_STAGE", !1), o.next = 8, c(this, Fr)[Fr].joinStage();
13225
13225
  case 8:
13226
13226
  if (i !== Si.Livestream) {
13227
13227
  o.next = 12;
@@ -13262,7 +13262,7 @@ var Ao = {}, Oi = {
13262
13262
  }
13263
13263
  throw new H("Unable to leave stage you are currently ".concat(this.status), "2006");
13264
13264
  case 5:
13265
- return c(this, se)[se].setIsPinned(!1), c(this, Be)[Be].setValue("stageStatus", "OFF_STAGE", !1), a.next = 9, c(this, jr)[jr].leaveStage(c(this, se)[se].userId);
13265
+ return c(this, se)[se].setIsPinned(!1), c(this, Be)[Be].setValue("stageStatus", "OFF_STAGE", !1), a.next = 9, c(this, Fr)[Fr].leaveStage(c(this, se)[se].userId);
13266
13266
  case 9:
13267
13267
  return a.prev = 9, a.next = 12, c(this, Be)[Be].getValue("peerSessionStore").emitAsync(F.LEAVE_MEDIA_ROOM, "stageLeft");
13268
13268
  case 12:
@@ -13313,7 +13313,7 @@ var Ao = {}, Oi = {
13313
13313
  }
13314
13314
  throw this.logger.error("Stage::kick::permission_denied"), new H("You do not have permissions for kick", "2001");
13315
13315
  case 8:
13316
- return o.abrupt("return", c(this, jr)[jr].kick(i));
13316
+ return o.abrupt("return", c(this, Fr)[Fr].kick(i));
13317
13317
  case 9:
13318
13318
  case "end":
13319
13319
  return o.stop();
@@ -13382,9 +13382,9 @@ var BA = Object.defineProperty, qA = Object.getOwnPropertyDescriptor, GA = funct
13382
13382
  for (var i = n > 1 ? void 0 : n ? qA(e, r) : e, a = t.length - 1, o; a >= 0; a--)
13383
13383
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
13384
13384
  return n && i && BA(e, r, i), i;
13385
- }, tn = /* @__PURE__ */ E("self"), Yr = /* @__PURE__ */ E("participants"), nn = /* @__PURE__ */ E("stageSocketHandler"), _o = /* @__PURE__ */ E("stageRequestCount"), ar = /* @__PURE__ */ E("context"), Hf = /* @__PURE__ */ function() {
13385
+ }, tn = /* @__PURE__ */ E("self"), Xr = /* @__PURE__ */ E("participants"), nn = /* @__PURE__ */ E("stageSocketHandler"), _o = /* @__PURE__ */ E("stageRequestCount"), ar = /* @__PURE__ */ E("context"), Hf = /* @__PURE__ */ function() {
13386
13386
  function s(t, e, r, n, i) {
13387
- P(this, s), this.stage = void 0, Object.defineProperty(this, tn, { writable: !0, value: void 0 }), Object.defineProperty(this, Yr, { writable: !0, value: void 0 }), Object.defineProperty(this, nn, { writable: !0, value: void 0 }), Object.defineProperty(this, _o, { writable: !0, value: 0 }), Object.defineProperty(this, ar, { writable: !0, value: void 0 }), c(this, ar)[ar] = t, this.stage = new ga(t, n, i, e, r), c(this, nn)[nn] = e, c(this, tn)[tn] = n, c(this, Yr)[Yr] = i, this.setupEvents();
13387
+ P(this, s), this.stage = void 0, Object.defineProperty(this, tn, { writable: !0, value: void 0 }), Object.defineProperty(this, Xr, { writable: !0, value: void 0 }), Object.defineProperty(this, nn, { writable: !0, value: void 0 }), Object.defineProperty(this, _o, { writable: !0, value: 0 }), Object.defineProperty(this, ar, { writable: !0, value: void 0 }), c(this, ar)[ar] = t, this.stage = new ga(t, n, i, e, r), c(this, nn)[nn] = e, c(this, tn)[tn] = n, c(this, Xr)[Xr] = i, this.setupEvents();
13388
13388
  }
13389
13389
  return S(s, [{
13390
13390
  key: "telemetry",
@@ -13440,7 +13440,7 @@ var BA = Object.defineProperty, qA = Object.getOwnPropertyDescriptor, GA = funct
13440
13440
  };
13441
13441
  }());
13442
13442
  } }, { key: "getCurrentStageRequests", value: function() {
13443
- var e = c(this, Yr)[Yr].joined.toArray().filter(function(r) {
13443
+ var e = c(this, Xr)[Xr].joined.toArray().filter(function(r) {
13444
13444
  return r.stageStatus === "REQUESTED_TO_JOIN_STAGE";
13445
13445
  }).map(function(r) {
13446
13446
  return { displayName: r.name, userId: r.userId, peerId: r.id };
@@ -13507,7 +13507,7 @@ var BA = Object.defineProperty, qA = Object.getOwnPropertyDescriptor, GA = funct
13507
13507
  for (; ; )
13508
13508
  switch (u.prev = u.next) {
13509
13509
  case 0:
13510
- if (i = c(this, Yr)[Yr].joined.get(n.peerId), a = c(this, Yr)[Yr].viewMode === "ACTIVE_GRID", i) {
13510
+ if (i = c(this, Xr)[Xr].joined.get(n.peerId), a = c(this, Xr)[Xr].viewMode === "ACTIVE_GRID", i) {
13511
13511
  u.next = 5;
13512
13512
  break;
13513
13513
  }
@@ -13516,13 +13516,13 @@ var BA = Object.defineProperty, qA = Object.getOwnPropertyDescriptor, GA = funct
13516
13516
  u.t0 = n.stageType, u.next = u.t0 === 1 ? 8 : u.t0 === 2 ? 11 : u.t0 === 3 ? 13 : (u.t0 === 0 || u.t0 === 4, 15);
13517
13517
  break;
13518
13518
  case 8:
13519
- return i.setStageStatus("ON_STAGE"), a && c(this, ar)[ar].getValue("peerSessionStore").emit(F.UPDATE_ACTIVE, { viewMode: c(this, Yr)[Yr].viewMode, page: c(this, Yr)[Yr].currentPage }), u.abrupt("break", 18);
13519
+ return i.setStageStatus("ON_STAGE"), a && c(this, ar)[ar].getValue("peerSessionStore").emit(F.UPDATE_ACTIVE, { viewMode: c(this, Xr)[Xr].viewMode, page: c(this, Xr)[Xr].currentPage }), u.abrupt("break", 18);
13520
13520
  case 11:
13521
13521
  return i.setStageStatus("ACCEPTED_TO_JOIN_STAGE"), u.abrupt("break", 18);
13522
13522
  case 13:
13523
13523
  return i.setStageStatus("REQUESTED_TO_JOIN_STAGE"), u.abrupt("break", 18);
13524
13524
  case 15:
13525
- return i.setStageStatus("OFF_STAGE"), a && c(this, ar)[ar].getValue("peerSessionStore").emit(F.UPDATE_ACTIVE, { viewMode: c(this, Yr)[Yr].viewMode, page: c(this, Yr)[Yr].currentPage }), u.abrupt("break", 18);
13525
+ return i.setStageStatus("OFF_STAGE"), a && c(this, ar)[ar].getValue("peerSessionStore").emit(F.UPDATE_ACTIVE, { viewMode: c(this, Xr)[Xr].viewMode, page: c(this, Xr)[Xr].currentPage }), u.abrupt("break", 18);
13526
13526
  case 18:
13527
13527
  c(this, ar)[ar].getValue("peerSessionStore").emit(F.UPDATE_PEER_STAGE_STATUS, { id: i.id, status: i.stageStatus });
13528
13528
  case 19:
@@ -14180,12 +14180,12 @@ var zn = /* @__PURE__ */ E("context"), sI = /* @__PURE__ */ function() {
14180
14180
  for (var i = n > 1 ? void 0 : n ? lI(e, r) : e, a = t.length - 1, o; a >= 0; a--)
14181
14181
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
14182
14182
  return n && i && cI(e, r, i), i;
14183
- }, De = /* @__PURE__ */ E("mediaInterface"), fe = /* @__PURE__ */ E("audioMediaHandler"), ve = /* @__PURE__ */ E("videoMediaHandler"), At = /* @__PURE__ */ E("audioOutputMediaHandler"), Fr = /* @__PURE__ */ E("screenShareMediaHandler"), Do = /* @__PURE__ */ E("autoSwitchDevice"), we = /* @__PURE__ */ E("context"), yt = /* @__PURE__ */ function(s) {
14183
+ }, De = /* @__PURE__ */ E("mediaInterface"), fe = /* @__PURE__ */ E("audioMediaHandler"), ve = /* @__PURE__ */ E("videoMediaHandler"), At = /* @__PURE__ */ E("audioOutputMediaHandler"), Hr = /* @__PURE__ */ E("screenShareMediaHandler"), Do = /* @__PURE__ */ E("autoSwitchDevice"), we = /* @__PURE__ */ E("context"), yt = /* @__PURE__ */ function(s) {
14184
14184
  function t(e, r) {
14185
14185
  var n, i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Pc, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0;
14186
14186
  P(this, t);
14187
14187
  var o = e.getValue("logger");
14188
- return n = C(this, t, [o]), Object.defineProperty(n, De, { writable: !0, value: void 0 }), Object.defineProperty(n, fe, { writable: !0, value: void 0 }), Object.defineProperty(n, ve, { writable: !0, value: void 0 }), Object.defineProperty(n, At, { writable: !0, value: void 0 }), Object.defineProperty(n, Fr, { writable: !0, value: void 0 }), Object.defineProperty(n, Do, { writable: !0, value: void 0 }), Object.defineProperty(n, we, { writable: !0, value: void 0 }), n.audioUpdateInProgress = void 0, n.videoUpdateInProgress = void 0, c(n, we)[we] = e, n.audioUpdateInProgress = !1, n.videoUpdateInProgress = !1, c(n, De)[De] = new Jf(e, r), c(n, fe)[fe] = new $I(e, c(n, De)[De], void 0, i), c(n, ve)[ve] = new HI(e, c(n, De)[De], void 0, i), c(n, Fr)[Fr] = new UI(c(n, we)[we], c(n, De)[De]), c(n, At)[At] = new NI(e, c(n, De)[De]), c(n, Do)[Do] = a, c(n, fe)[fe].on("trackMuted", n.onAudioTrackMuted.bind(n)), c(n, fe)[fe].on("trackChanged", n.onAudioTrackChanged.bind(n)), c(n, ve)[ve].on("trackChanged", n.onVideoTrackChanged.bind(n)), c(n, ve)[ve].on("trackEnded", n.onVideoTrackEnded.bind(n)), c(n, Fr)[Fr].on("trackEnded", n.onScreenShareEnded.bind(n)), n.onVisibilityChange = n.onVisibilityChange.bind(n), document.addEventListener("visibilitychange", n.onVisibilityChange), n;
14188
+ return n = C(this, t, [o]), Object.defineProperty(n, De, { writable: !0, value: void 0 }), Object.defineProperty(n, fe, { writable: !0, value: void 0 }), Object.defineProperty(n, ve, { writable: !0, value: void 0 }), Object.defineProperty(n, At, { writable: !0, value: void 0 }), Object.defineProperty(n, Hr, { writable: !0, value: void 0 }), Object.defineProperty(n, Do, { writable: !0, value: void 0 }), Object.defineProperty(n, we, { writable: !0, value: void 0 }), n.audioUpdateInProgress = void 0, n.videoUpdateInProgress = void 0, c(n, we)[we] = e, n.audioUpdateInProgress = !1, n.videoUpdateInProgress = !1, c(n, De)[De] = new Jf(e, r), c(n, fe)[fe] = new $I(e, c(n, De)[De], void 0, i), c(n, ve)[ve] = new HI(e, c(n, De)[De], void 0, i), c(n, Hr)[Hr] = new UI(c(n, we)[we], c(n, De)[De]), c(n, At)[At] = new NI(e, c(n, De)[De]), c(n, Do)[Do] = a, c(n, fe)[fe].on("trackMuted", n.onAudioTrackMuted.bind(n)), c(n, fe)[fe].on("trackChanged", n.onAudioTrackChanged.bind(n)), c(n, ve)[ve].on("trackChanged", n.onVideoTrackChanged.bind(n)), c(n, ve)[ve].on("trackEnded", n.onVideoTrackEnded.bind(n)), c(n, Hr)[Hr].on("trackEnded", n.onScreenShareEnded.bind(n)), n.onVisibilityChange = n.onVisibilityChange.bind(n), document.addEventListener("visibilitychange", n.onVisibilityChange), n;
14189
14189
  }
14190
14190
  return R(t, s), S(t, [{ key: "telemetry", get: (
14191
14191
  /**
@@ -14570,16 +14570,16 @@ var zn = /* @__PURE__ */ E("context"), sI = /* @__PURE__ */ function() {
14570
14570
  }, { key: "onScreenShareEnded", value: function() {
14571
14571
  this.emit("SCREENSHARE_ENDED");
14572
14572
  } }, { key: "screenShareTracks", get: function() {
14573
- return { audio: c(this, Fr)[Fr].audioMediaTrack, video: c(this, Fr)[Fr].videoMediaTrack };
14573
+ return { audio: c(this, Hr)[Hr].audioMediaTrack, video: c(this, Hr)[Hr].videoMediaTrack };
14574
14574
  } }, { key: "screenShareEnabled", get: function() {
14575
- return c(this, Fr)[Fr].trackEnabled;
14575
+ return c(this, Hr)[Hr].trackEnabled;
14576
14576
  } }, { key: "enableScreenShare", value: function() {
14577
14577
  var e = m(/* @__PURE__ */ h().mark(function n() {
14578
14578
  return h().wrap(function(a) {
14579
14579
  for (; ; )
14580
14580
  switch (a.prev = a.next) {
14581
14581
  case 0:
14582
- return a.next = 2, c(this, Fr)[Fr].enableScreenShare();
14582
+ return a.next = 2, c(this, Hr)[Hr].enableScreenShare();
14583
14583
  case 2:
14584
14584
  case "end":
14585
14585
  return a.stop();
@@ -14596,7 +14596,7 @@ var zn = /* @__PURE__ */ E("context"), sI = /* @__PURE__ */ function() {
14596
14596
  for (; ; )
14597
14597
  switch (a.prev = a.next) {
14598
14598
  case 0:
14599
- c(this, Fr)[Fr].disableScreenShare();
14599
+ c(this, Hr)[Hr].disableScreenShare();
14600
14600
  case 1:
14601
14601
  case "end":
14602
14602
  return a.stop();
@@ -14613,7 +14613,7 @@ var zn = /* @__PURE__ */ E("context"), sI = /* @__PURE__ */ function() {
14613
14613
  for (; ; )
14614
14614
  switch (o.prev = o.next) {
14615
14615
  case 0:
14616
- return o.next = 2, c(this, Fr)[Fr].updateConstraints(i);
14616
+ return o.next = 2, c(this, Hr)[Hr].updateConstraints(i);
14617
14617
  case 2:
14618
14618
  case "end":
14619
14619
  return o.stop();
@@ -14647,7 +14647,7 @@ var zn = /* @__PURE__ */ E("context"), sI = /* @__PURE__ */ function() {
14647
14647
  } }, { key: "setVideoMiddlewareGlobalConfig", value: function(r) {
14648
14648
  return c(this, ve)[ve].setVideoMiddlewareGlobalConfig(r);
14649
14649
  } }, { key: "destruct", value: function() {
14650
- c(this, fe)[fe].disableTrack(), c(this, ve)[ve].disableTrack(), c(this, ve)[ve].terminateMiddlewareWebWorker(), c(this, Fr)[Fr].disableScreenShare(), c(this, De)[De].destruct();
14650
+ c(this, fe)[fe].disableTrack(), c(this, ve)[ve].disableTrack(), c(this, ve)[ve].terminateMiddlewareWebWorker(), c(this, Hr)[Hr].disableScreenShare(), c(this, De)[De].destruct();
14651
14651
  } }, {
14652
14652
  key: "onDeviceChange",
14653
14653
  value: function() {
@@ -15011,9 +15011,9 @@ var Qn = /* @__PURE__ */ E("middlewareWebWorkerInterval"), $o = /* @__PURE__ */
15011
15011
  return l.forEach(function(v, f) {
15012
15012
  Math.abs(v - o) < d && (d = Math.abs(v - o), p = f);
15013
15013
  }), u[p][1];
15014
- }, Sr = /* @__PURE__ */ function(s) {
15014
+ }, Er = /* @__PURE__ */ function(s) {
15015
15015
  return s.WEBCAM = "webcam", s.WEBCAM_BACKUP = "webcam_backup", s.MIC = "mic", s.SCREENSHARE_VIDEO = "screenshare_video", s.SCREENSHARE_AUDIO = "screenshare_audio", s;
15016
- }(Sr || {}), mI = Kw(), Xs = Hn(mI.config.media);
15016
+ }(Er || {}), mI = Kw(), Xs = Hn(mI.config.media);
15017
15017
  function yI(s) {
15018
15018
  var t = {};
15019
15019
  if (s.audio) {
@@ -15153,10 +15153,10 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15153
15153
  for (var i = n > 1 ? void 0 : n ? wI(e, r) : e, a = t.length - 1, o; a >= 0; a--)
15154
15154
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
15155
15155
  return n && i && TI(e, r, i), i;
15156
- }, Ht = (Hi = /* @__PURE__ */ E("deviceChangeAbortController"), $r = /* @__PURE__ */ E("constraintsBuilder"), Le = /* @__PURE__ */ E("context"), /* @__PURE__ */ function(s) {
15156
+ }, Ht = (Hi = /* @__PURE__ */ E("deviceChangeAbortController"), Lr = /* @__PURE__ */ E("constraintsBuilder"), Le = /* @__PURE__ */ E("context"), /* @__PURE__ */ function(s) {
15157
15157
  function t(e, r) {
15158
15158
  var n;
15159
- return P(this, t), n = C(this, t), Object.defineProperty(n, Hi, { writable: !0, value: void 0 }), Object.defineProperty(n, $r, { writable: !0, value: void 0 }), Object.defineProperty(n, Le, { writable: !0, value: void 0 }), c(n, Le)[Le] = e, c(n, $r)[$r] = new kI(e, r), c(n, Hi)[Hi] = new AbortController(), n;
15159
+ return P(this, t), n = C(this, t), Object.defineProperty(n, Hi, { writable: !0, value: void 0 }), Object.defineProperty(n, Lr, { writable: !0, value: void 0 }), Object.defineProperty(n, Le, { writable: !0, value: void 0 }), c(n, Le)[Le] = e, c(n, Lr)[Lr] = new kI(e, r), c(n, Hi)[Hi] = new AbortController(), n;
15160
15160
  }
15161
15161
  return R(t, s), S(t, [{
15162
15162
  key: "telemetry",
@@ -15176,7 +15176,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15176
15176
  }, { key: "logger", get: function() {
15177
15177
  return c(this, Le)[Le].getValue("logger");
15178
15178
  } }, { key: "constraintsBuilder", get: function() {
15179
- return c(this, $r)[$r];
15179
+ return c(this, Lr)[Lr];
15180
15180
  } }, { key: "destruct", value: function() {
15181
15181
  var e = m(/* @__PURE__ */ h().mark(function n() {
15182
15182
  var i;
@@ -15213,7 +15213,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15213
15213
  return B.deviceId === i;
15214
15214
  })), i && p ? v = i : l && (o = l[0]) !== null && o !== void 0 && o.deviceId && (v = (f = l[0]) === null || f === void 0 ? void 0 : f.deviceId), g = !!(d != null && d.find(function(B) {
15215
15215
  return B.deviceId === a;
15216
- })), a && g ? b = a : d && (u = d[0]) !== null && u !== void 0 && u.deviceId && (b = (y = d[0]) === null || y === void 0 ? void 0 : y.deviceId), k = { audio: c(this, $r)[$r].getAudioConstraints(v).audio, video: c(this, $r)[$r].getVideoConstraints(b).video }, this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", { constraints: JSON.stringify(k) }), D.next = 15, navigator.mediaDevices.getUserMedia(k);
15216
+ })), a && g ? b = a : d && (u = d[0]) !== null && u !== void 0 && u.deviceId && (b = (y = d[0]) === null || y === void 0 ? void 0 : y.deviceId), k = { audio: c(this, Lr)[Lr].getAudioConstraints(v).audio, video: c(this, Lr)[Lr].getVideoConstraints(b).video }, this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", { constraints: JSON.stringify(k) }), D.next = 15, navigator.mediaDevices.getUserMedia(k);
15217
15217
  case 15:
15218
15218
  if (w = D.sent, this.logger.info("getUserMediaWithoutTimeout::received_user_media", { constraints: JSON.stringify(k) }), T = w.getAudioTracks()[0], A = w.getVideoTracks()[0], this.permissions.audio = "ACCEPTED", this.permissions.video = "ACCEPTED", !A.label.includes("OBS Virtual")) {
15219
15219
  D.next = 29;
@@ -15266,7 +15266,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15266
15266
  case 0:
15267
15267
  return J.prev = 0, p = p.filter(function(Z) {
15268
15268
  return Z.deviceId !== M;
15269
- }), O = c(d, $r)[$r].getAudioConstraints(M), d.logger.info("getUserMediaWithoutTimeout::requesting_user_media", { constraints: JSON.stringify(O) }), J.next = 6, navigator.mediaDevices.getUserMedia(O);
15269
+ }), O = c(d, Lr)[Lr].getAudioConstraints(M), d.logger.info("getUserMediaWithoutTimeout::requesting_user_media", { constraints: JSON.stringify(O) }), J.next = 6, navigator.mediaDevices.getUserMedia(O);
15270
15270
  case 6:
15271
15271
  return I = J.sent.getAudioTracks(), D = je(I, 1), B = D[0], d.logger.info("getUserMediaWithoutTimeout::received_user_media", { constraints: JSON.stringify(O) }), J.abrupt("return", B);
15272
15272
  case 13:
@@ -15280,7 +15280,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15280
15280
  }
15281
15281
  throw N;
15282
15282
  case 21:
15283
- return d.logger.info("getAudioTrack::gum_failed", { constraints: JSON.stringify(O), error: J.t0 }), Y = c(d, $r)[$r].getAudioConstraints(L.deviceId), d.logger.info("getAudioTrack::retrying_gum_for_next_device", { constraints: JSON.stringify(Y) }), J.abrupt("return", b(L.deviceId));
15283
+ return d.logger.info("getAudioTrack::gum_failed", { constraints: JSON.stringify(O), error: J.t0 }), Y = c(d, Lr)[Lr].getAudioConstraints(L.deviceId), d.logger.info("getAudioTrack::retrying_gum_for_next_device", { constraints: JSON.stringify(Y) }), J.abrupt("return", b(L.deviceId));
15284
15284
  case 25:
15285
15285
  throw N;
15286
15286
  case 26:
@@ -15362,7 +15362,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15362
15362
  }
15363
15363
  throw ge;
15364
15364
  case 23:
15365
- return u.logger.info("getVideoTrack::gum_failed", { constraints: JSON.stringify(M), error: z.t0 }), Me = c(u, $r)[$r].getVideoConstraints(ae.deviceId), u.logger.info("getVideoTrack::retrying_gum_for_next_device", { constraints: JSON.stringify(Me) }), z.abrupt("return", g({ video: Me.video }));
15365
+ return u.logger.info("getVideoTrack::gum_failed", { constraints: JSON.stringify(M), error: z.t0 }), Me = c(u, Lr)[Lr].getVideoConstraints(ae.deviceId), u.logger.info("getVideoTrack::retrying_gum_for_next_device", { constraints: JSON.stringify(Me) }), z.abrupt("return", g({ video: Me.video }));
15366
15366
  case 27:
15367
15367
  throw ge;
15368
15368
  case 28:
@@ -15374,7 +15374,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15374
15374
  return function(M) {
15375
15375
  return T.apply(this, arguments);
15376
15376
  };
15377
- }(), w.prev = 22, b = c(this, $r)[$r].getVideoConstraints(v), w.next = 26, g(b);
15377
+ }(), w.prev = 22, b = c(this, Lr)[Lr].getVideoConstraints(v), w.next = 26, g(b);
15378
15378
  case 26:
15379
15379
  return y = w.sent, this.permissions.video !== "ACCEPTED" && (this.permissions.video = "ACCEPTED", c(this, Le)[Le].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, { message: this.permissions.video, kind: "video" })), w.abrupt("return", y);
15380
15380
  case 31:
@@ -15429,7 +15429,7 @@ var Yn = /* @__PURE__ */ E("mediaConstraints"), vl = /* @__PURE__ */ E("context"
15429
15429
  return function(f) {
15430
15430
  return p.apply(this, arguments);
15431
15431
  };
15432
- }(), d.prev = 1, o = c(this, $r)[$r].getScreenShareConstraints(), d.next = 5, a(o);
15432
+ }(), d.prev = 1, o = c(this, Lr)[Lr].getScreenShareConstraints(), d.next = 5, a(o);
15433
15433
  case 5:
15434
15434
  return u = d.sent, this.permissions.screenshare !== "ACCEPTED" && (this.permissions.screenshare = "ACCEPTED", c(this, Le)[Le].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, { message: this.permissions.screenshare, kind: "screenshare" })), d.abrupt("return", { audioTrack: u.getAudioTracks()[0], videoTrack: u.getVideoTracks()[0] });
15435
15435
  case 10:
@@ -17506,20 +17506,20 @@ var eM = Object.defineProperty, rM = Object.getOwnPropertyDescriptor, bo = funct
17506
17506
  for (var i = n > 1 ? void 0 : n ? rM(e, r) : e, a = t.length - 1, o; a >= 0; a--)
17507
17507
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
17508
17508
  return n && i && eM(e, r, i), i;
17509
- }, tM = 0.8, nM = 1.2, Ri = (Bi = /* @__PURE__ */ E("isPinned"), qi = /* @__PURE__ */ E("stageStatus"), Cr = /* @__PURE__ */ E("context"), Ln = /* @__PURE__ */ E("roomNodeClient"), en = /* @__PURE__ */ E("audioPlayback"), Nn = /* @__PURE__ */ E("mediaJoined"), Ju = /* @__PURE__ */ E("socketJoined"), vt = /* @__PURE__ */ E("self"), Gs = /* @__PURE__ */ E("roomSocketHandler"), Yt = /* @__PURE__ */ E("videoElements"), Vn = /* @__PURE__ */ E("pip"), ft = /* @__PURE__ */ E("maxSpatialLayer"), Ku = /* @__PURE__ */ E("videoDimensionsUpdated"), Ws = /* @__PURE__ */ E("updateVideos"), zu = /* @__PURE__ */ E("updateAudio"), Qu = /* @__PURE__ */ E("updateScreenShare"), /* @__PURE__ */ function(s) {
17509
+ }, tM = 0.8, nM = 1.2, Ri = (Bi = /* @__PURE__ */ E("isPinned"), qi = /* @__PURE__ */ E("stageStatus"), Rr = /* @__PURE__ */ E("context"), Ln = /* @__PURE__ */ E("roomNodeClient"), en = /* @__PURE__ */ E("audioPlayback"), Nn = /* @__PURE__ */ E("mediaJoined"), Ju = /* @__PURE__ */ E("socketJoined"), vt = /* @__PURE__ */ E("self"), Gs = /* @__PURE__ */ E("roomSocketHandler"), Yt = /* @__PURE__ */ E("videoElements"), Vn = /* @__PURE__ */ E("pip"), ft = /* @__PURE__ */ E("maxSpatialLayer"), Ku = /* @__PURE__ */ E("videoDimensionsUpdated"), Ws = /* @__PURE__ */ E("updateVideos"), zu = /* @__PURE__ */ E("updateAudio"), Qu = /* @__PURE__ */ E("updateScreenShare"), /* @__PURE__ */ function(s) {
17510
17510
  function t(e, r, n, i) {
17511
17511
  var a;
17512
17512
  P(this, t);
17513
17513
  var o = e.getValue("logger");
17514
- a = C(this, t, [o]), Object.defineProperty(a, Qu, { value: dM }), Object.defineProperty(a, zu, { value: lM }), Object.defineProperty(a, Ws, { value: cM }), Object.defineProperty(a, Vn, { get: uM, set: void 0 }), Object.defineProperty(a, Ju, { get: oM, set: void 0 }), Object.defineProperty(a, Nn, { get: sM, set: void 0 }), Object.defineProperty(a, en, { get: aM, set: void 0 }), Object.defineProperty(a, Ln, { get: iM, set: void 0 }), a.id = void 0, a.userId = void 0, a.name = void 0, a.picture = void 0, a.isHost = void 0, a.customParticipantId = void 0, a.flags = void 0, a.device = void 0, a.videoTrack = void 0, a.audioTrack = void 0, a.screenShareTracks = void 0, a.videoEnabled = void 0, a.audioEnabled = void 0, a.screenShareEnabled = void 0, a.producers = void 0, a.manualProducerConfig = void 0, Object.defineProperty(a, Bi, { writable: !0, value: void 0 }), a.supportsRemoteControl = !1, Object.defineProperty(a, qi, { writable: !0, value: void 0 }), a.presetName = void 0, Object.defineProperty(a, Cr, { writable: !0, value: void 0 }), Object.defineProperty(a, vt, { writable: !0, value: void 0 }), Object.defineProperty(a, Gs, { writable: !0, value: void 0 }), Object.defineProperty(a, Yt, { writable: !0, value: /* @__PURE__ */ new Map() }), Object.defineProperty(a, ft, { writable: !0, value: 1 }), Object.defineProperty(a, Ku, { writable: !0, value: cp(function(B) {
17514
+ a = C(this, t, [o]), Object.defineProperty(a, Qu, { value: dM }), Object.defineProperty(a, zu, { value: lM }), Object.defineProperty(a, Ws, { value: cM }), Object.defineProperty(a, Vn, { get: uM, set: void 0 }), Object.defineProperty(a, Ju, { get: oM, set: void 0 }), Object.defineProperty(a, Nn, { get: sM, set: void 0 }), Object.defineProperty(a, en, { get: aM, set: void 0 }), Object.defineProperty(a, Ln, { get: iM, set: void 0 }), a.id = void 0, a.userId = void 0, a.name = void 0, a.picture = void 0, a.isHost = void 0, a.customParticipantId = void 0, a.flags = void 0, a.device = void 0, a.videoTrack = void 0, a.audioTrack = void 0, a.screenShareTracks = void 0, a.videoEnabled = void 0, a.audioEnabled = void 0, a.screenShareEnabled = void 0, a.producers = void 0, a.manualProducerConfig = void 0, Object.defineProperty(a, Bi, { writable: !0, value: void 0 }), a.supportsRemoteControl = !1, Object.defineProperty(a, qi, { writable: !0, value: void 0 }), a.presetName = void 0, Object.defineProperty(a, Rr, { writable: !0, value: void 0 }), Object.defineProperty(a, vt, { writable: !0, value: void 0 }), Object.defineProperty(a, Gs, { writable: !0, value: void 0 }), Object.defineProperty(a, Yt, { writable: !0, value: /* @__PURE__ */ new Map() }), Object.defineProperty(a, ft, { writable: !0, value: 1 }), Object.defineProperty(a, Ku, { writable: !0, value: cp(function(B) {
17515
17515
  if (a.videoTrack) {
17516
17516
  var V = B.clientWidth, N = B.clientHeight, L = a.videoTrack.getSettings(), Y = L.width, U = L.height;
17517
17517
  if (!(!Y || !U)) {
17518
17518
  var J = U / N, Z = Y / V, ge = Math.max(J, Z);
17519
- ge > nM && c(a, ft)[ft] === 1 ? (c(a, ft)[ft] = 0, c(a, Cr)[Cr].getValue("peerSessionStore").emit(F.MAX_SPATIAL_LAYER_CHANGE, { peerId: a.id, maxSpatialLayer: c(a, ft)[ft] })) : ge < tM && c(a, ft)[ft] === 0 && (c(a, ft)[ft] = 1, c(a, Cr)[Cr].getValue("peerSessionStore").emit(F.MAX_SPATIAL_LAYER_CHANGE, { peerId: a.id, maxSpatialLayer: c(a, ft)[ft] }));
17519
+ ge > nM && c(a, ft)[ft] === 1 ? (c(a, ft)[ft] = 0, c(a, Rr)[Rr].getValue("peerSessionStore").emit(F.MAX_SPATIAL_LAYER_CHANGE, { peerId: a.id, maxSpatialLayer: c(a, ft)[ft] })) : ge < tM && c(a, ft)[ft] === 0 && (c(a, ft)[ft] = 1, c(a, Rr)[Rr].getValue("peerSessionStore").emit(F.MAX_SPATIAL_LAYER_CHANGE, { peerId: a.id, maxSpatialLayer: c(a, ft)[ft] }));
17520
17520
  }
17521
17521
  }
17522
- }, 2e3) }), c(a, Cr)[Cr] = e;
17522
+ }, 2e3) }), c(a, Rr)[Rr] = e;
17523
17523
  var u = r.id, l = r.userId, d = r.displayName, p = r.device, v = r.picture, f = r.isHost, g = r.flags, b = r.clientSpecificId, y = r.stageStatus, k = r.customParticipantId, w = r.audioMuted, T = r.audioTrack, A = r.videoEnabled, M = A === void 0 ? !1 : A, O = r.videoTrack, I = r.producers, D = r.metadata;
17524
17524
  return a.id = u, a.userId = l, a.name = d, a.device = p, a.picture = v, a.isHost = f, a.flags = g, a.manualProducerConfig = Ew, c(a, qi)[qi] = y != null ? y : "ON_STAGE", a.customParticipantId = k != null ? k : b, a.audioEnabled = !w, a.audioTrack = T, a.videoEnabled = M, a.videoTrack = O, a.screenShareTracks = { audio: void 0, video: void 0 }, a.producers = I != null ? I : [], a.presetName = D == null ? void 0 : D.preset_name, c(a, Bi)[Bi] = !1, c(a, vt)[vt] = n, c(a, Gs)[Gs] = i, a.setupEvents(), a.updateVideo = a.updateVideo.bind(a), c(a, Ws)[Ws](), a;
17525
17525
  }
@@ -17542,7 +17542,7 @@ var eM = Object.defineProperty, rM = Object.getOwnPropertyDescriptor, bo = funct
17542
17542
  * Not for external use
17543
17543
  */
17544
17544
  function() {
17545
- return c(this, Cr)[Cr].getValue("telemetry");
17545
+ return c(this, Rr)[Rr].getValue("telemetry");
17546
17546
  }
17547
17547
  ) }, {
17548
17548
  key: "setVideoEnabled",
@@ -17686,7 +17686,7 @@ var eM = Object.defineProperty, rM = Object.getOwnPropertyDescriptor, bo = funct
17686
17686
  o.next = 8;
17687
17687
  break;
17688
17688
  }
17689
- return o.next = 7, c(this, Cr)[Cr].getValue("peerSessionStore").emitAsync(F.KICK_PEER, { peerId: i });
17689
+ return o.next = 7, c(this, Rr)[Rr].getValue("peerSessionStore").emitAsync(F.KICK_PEER, { peerId: i });
17690
17690
  case 7:
17691
17691
  return o.abrupt("return");
17692
17692
  case 8:
@@ -17813,19 +17813,19 @@ var eM = Object.defineProperty, rM = Object.getOwnPropertyDescriptor, bo = funct
17813
17813
  ) }]);
17814
17814
  }(Bt));
17815
17815
  function iM() {
17816
- return c(this, Cr)[Cr].getValue("roomNodeClient");
17816
+ return c(this, Rr)[Rr].getValue("roomNodeClient");
17817
17817
  }
17818
17818
  function aM() {
17819
- return c(this, Cr)[Cr].getValue("audioPlayback");
17819
+ return c(this, Rr)[Rr].getValue("audioPlayback");
17820
17820
  }
17821
17821
  function sM() {
17822
- return c(this, Cr)[Cr].getValue("connectionHandler").mediaJoined;
17822
+ return c(this, Rr)[Rr].getValue("connectionHandler").mediaJoined;
17823
17823
  }
17824
17824
  function oM() {
17825
- return c(this, Cr)[Cr].getValue("connectionHandler").socketJoined;
17825
+ return c(this, Rr)[Rr].getValue("connectionHandler").socketJoined;
17826
17826
  }
17827
17827
  function uM() {
17828
- return c(this, Cr)[Cr].getValue("pip");
17828
+ return c(this, Rr)[Rr].getValue("pip");
17829
17829
  }
17830
17830
  function cM() {
17831
17831
  Array.from(c(this, Yt)[Yt].keys()).forEach(this.updateVideo);
@@ -18543,10 +18543,10 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18543
18543
  for (var i = n > 1 ? void 0 : n ? wM(e, r) : e, a = t.length - 1, o; a >= 0; a--)
18544
18544
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
18545
18545
  return n && i && TM(e, r, i), i;
18546
- }, Zf = (Lr = /* @__PURE__ */ E("currentView"), Gr = /* @__PURE__ */ E("consumersSyncing"), Wi = /* @__PURE__ */ E("resyncRequired"), /* @__PURE__ */ function() {
18546
+ }, Zf = (Nr = /* @__PURE__ */ E("currentView"), Wr = /* @__PURE__ */ E("consumersSyncing"), Wi = /* @__PURE__ */ E("resyncRequired"), /* @__PURE__ */ function() {
18547
18547
  function s(t, e, r) {
18548
18548
  var n = this;
18549
- P(this, s), this.participants = void 0, this.self = void 0, this.selectedPeers = Xf, this.maxSpatialLayerUpdates = /* @__PURE__ */ new Map(), this.consumerPeerMap = void 0, this.events = void 0, this.roomSocketHandler = void 0, this.context = void 0, this.videoPeerConsumerMap = /* @__PURE__ */ new Map(), Object.defineProperty(this, Lr, { writable: !0, value: { mode: "ACTIVE_GRID", page: 0 } }), Object.defineProperty(this, Gr, { writable: !0, value: !1 }), Object.defineProperty(this, Wi, { writable: !0, value: !1 }), this.updateConsumerSpatialLayers = cp(function() {
18549
+ P(this, s), this.participants = void 0, this.self = void 0, this.selectedPeers = Xf, this.maxSpatialLayerUpdates = /* @__PURE__ */ new Map(), this.consumerPeerMap = void 0, this.events = void 0, this.roomSocketHandler = void 0, this.context = void 0, this.videoPeerConsumerMap = /* @__PURE__ */ new Map(), Object.defineProperty(this, Nr, { writable: !0, value: { mode: "ACTIVE_GRID", page: 0 } }), Object.defineProperty(this, Wr, { writable: !0, value: !1 }), Object.defineProperty(this, Wi, { writable: !0, value: !1 }), this.updateConsumerSpatialLayers = cp(function() {
18550
18550
  var i = {}, a = new Map(n.maxSpatialLayerUpdates);
18551
18551
  n.maxSpatialLayerUpdates.clear(), Array.from(a.entries()).forEach(function(o) {
18552
18552
  var u = je(o, 2), l = u[0], d = u[1];
@@ -18561,7 +18561,7 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18561
18561
  for (; ; )
18562
18562
  switch (d.prev = d.next) {
18563
18563
  case 0:
18564
- if (n.logger.info("updateConsumers: Starting consumer updates - AddProducers: ".concat(o.length, ", RemoveProducers: ").concat(u.length, ", ConsumersSyncing: ").concat(c(n, Gr)[Gr])), d.prev = 1, o.length === 0) {
18564
+ if (n.logger.info("updateConsumers: Starting consumer updates - AddProducers: ".concat(o.length, ", RemoveProducers: ").concat(u.length, ", ConsumersSyncing: ").concat(c(n, Wr)[Wr])), d.prev = 1, o.length === 0) {
18565
18565
  d.next = 7;
18566
18566
  break;
18567
18567
  }
@@ -18665,7 +18665,7 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18665
18665
  e.logger.warn("ParticipantController::NEW_PRODUCER::participant not found", { producer: { id: i == null ? void 0 : i.producerId, kind: i == null ? void 0 : i.kind, status: "not_initialized", appData: { screenShare: i == null ? void 0 : i.screenShare } }, participant: { id: n } });
18666
18666
  return;
18667
18667
  }
18668
- a.producers.push(i), e.logger.info("ParticipantController::NEW_PRODUCER::producer_added_to_participant", { producer: { id: i == null ? void 0 : i.producerId, peerId: n, kind: i == null ? void 0 : i.kind, status: "not_initialized", appData: { screenShare: i == null ? void 0 : i.screenShare } } }), (i == null ? void 0 : i.kind) === "audio" && e.participants.audioSubscribed.get(n) || (i == null ? void 0 : i.kind) === "video" && e.participants.videoSubscribed.get(n) || i != null && i.screenShare ? (e.logger.info("NEW_PRODUCER: scheduling syncConsumer (AUTO mode) - Producer: ".concat(i.producerId, ", Peer: ").concat(n, ", Kind: ").concat(i.kind, ", ScreenShare: ").concat(i.screenShare, ", ConsumersSyncing: ").concat(c(e, Gr)[Gr], ", VideoSub: ").concat(i.kind === "video" ? e.participants.videoSubscribed.has(n) : "N/A", ", AudioSub: ").concat(i.kind === "audio" ? e.participants.audioSubscribed.has(n) : "N/A")), e.scheduleSyncConsumers({ source: "NEW_PRODUCER_AUTO" })) : e.logger.info("ParticipantController::NEW_PRODUCER::not_consuming_producer_auto", { producer: { id: i == null ? void 0 : i.producerId, peerId: n, kind: i == null ? void 0 : i.kind, status: "UNKNOWN", appData: { screenShare: i == null ? void 0 : i.screenShare } } });
18668
+ a.producers.push(i), e.logger.info("ParticipantController::NEW_PRODUCER::producer_added_to_participant", { producer: { id: i == null ? void 0 : i.producerId, peerId: n, kind: i == null ? void 0 : i.kind, status: "not_initialized", appData: { screenShare: i == null ? void 0 : i.screenShare } } }), (i == null ? void 0 : i.kind) === "audio" && e.participants.audioSubscribed.get(n) || (i == null ? void 0 : i.kind) === "video" && e.participants.videoSubscribed.get(n) || i != null && i.screenShare ? (e.logger.info("NEW_PRODUCER: scheduling syncConsumer (AUTO mode) - Producer: ".concat(i.producerId, ", Peer: ").concat(n, ", Kind: ").concat(i.kind, ", ScreenShare: ").concat(i.screenShare, ", ConsumersSyncing: ").concat(c(e, Wr)[Wr], ", VideoSub: ").concat(i.kind === "video" ? e.participants.videoSubscribed.has(n) : "N/A", ", AudioSub: ").concat(i.kind === "audio" ? e.participants.audioSubscribed.has(n) : "N/A")), e.scheduleSyncConsumers({ source: "NEW_PRODUCER_AUTO" })) : e.logger.info("ParticipantController::NEW_PRODUCER::not_consuming_producer_auto", { producer: { id: i == null ? void 0 : i.producerId, peerId: n, kind: i == null ? void 0 : i.kind, status: "UNKNOWN", appData: { screenShare: i == null ? void 0 : i.screenShare } } });
18669
18669
  }), this.context.getValue("peerSessionStore").on(F.PRODUCER_CLOSED, function(r) {
18670
18670
  var n = r.peerId, i = r.producerId, a = e.participants.joined.get(n);
18671
18671
  if (!a) {
@@ -18690,7 +18690,7 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18690
18690
  var i = n;
18691
18691
  e.onParticipantPinned(i);
18692
18692
  var a = e.participants.joined.get(i);
18693
- a && (e.logger.info("globalPeerPinBroadcast: Scheduling audio/video consumer sync for pinned participant ".concat(i, " - ProducerCount: ").concat(a.producers.length, ", ConsumersSyncing: ").concat(c(e, Gr)[Gr], ", ProducerIds: [").concat(a.producers.map(function(o) {
18693
+ a && (e.logger.info("globalPeerPinBroadcast: Scheduling audio/video consumer sync for pinned participant ".concat(i, " - ProducerCount: ").concat(a.producers.length, ", ConsumersSyncing: ").concat(c(e, Wr)[Wr], ", ProducerIds: [").concat(a.producers.map(function(o) {
18694
18694
  return o.producerId;
18695
18695
  }).join(", "), "]")), e.scheduleSyncConsumers({ source: "GLOBAL_PEER_PIN" }));
18696
18696
  }
@@ -18776,8 +18776,8 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18776
18776
  * */
18777
18777
  }, { key: "updateMediaSubscribedMaps", value: function(e, r) {
18778
18778
  var n = r != null ? r : {}, i = n.page;
18779
- e && c(this, Lr)[Lr].mode !== e && (c(this, Lr)[Lr].mode = e), i && c(this, Lr)[Lr].page !== i && (c(this, Lr)[Lr].page = i);
18780
- var a = c(this, Lr)[Lr], o = a.mode, u = a.page;
18779
+ e && c(this, Nr)[Nr].mode !== e && (c(this, Nr)[Nr].mode = e), i && c(this, Nr)[Nr].page !== i && (c(this, Nr)[Nr].page = i);
18780
+ var a = c(this, Nr)[Nr], o = a.mode, u = a.page;
18781
18781
  switch (o) {
18782
18782
  case "PAGINATED": {
18783
18783
  if (!u)
@@ -18805,7 +18805,7 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18805
18805
  for (; ; )
18806
18806
  switch (v.prev = v.next) {
18807
18807
  case 0:
18808
- l = n.source, d = ((i = c(this, Lr)[Lr]) === null || i === void 0 ? void 0 : i.mode) === "PAGINATED" && !c(this, Gr)[Gr] ? 200 : 0, this.logger.info("scheduleSyncConsumers():: Source: ".concat(l, ", ViewMode: ").concat((a = c(this, Lr)[Lr]) === null || a === void 0 ? void 0 : a.mode, ", ConsumersSyncing: ").concat(c(this, Gr)[Gr], ", Delay: ").concat(d, ", Page: ").concat((o = c(this, Lr)[Lr]) === null || o === void 0 ? void 0 : o.page)), setTimeout(function() {
18808
+ l = n.source, d = ((i = c(this, Nr)[Nr]) === null || i === void 0 ? void 0 : i.mode) === "PAGINATED" && !c(this, Wr)[Wr] ? 200 : 0, this.logger.info("scheduleSyncConsumers():: Source: ".concat(l, ", ViewMode: ").concat((a = c(this, Nr)[Nr]) === null || a === void 0 ? void 0 : a.mode, ", ConsumersSyncing: ").concat(c(this, Wr)[Wr], ", Delay: ").concat(d, ", Page: ").concat((o = c(this, Nr)[Nr]) === null || o === void 0 ? void 0 : o.page)), setTimeout(function() {
18809
18809
  return u.syncConsumers();
18810
18810
  }, d);
18811
18811
  case 4:
@@ -18852,13 +18852,13 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18852
18852
  }
18853
18853
  return this.logger.info("syncConsumers: Connection not ready, exiting."), y.abrupt("return");
18854
18854
  case 3:
18855
- if (!c(this, Gr)[Gr]) {
18855
+ if (!c(this, Wr)[Wr]) {
18856
18856
  y.next = 7;
18857
18857
  break;
18858
18858
  }
18859
18859
  return c(this, Wi)[Wi] = !0, this.logger.info("syncConsumers: Sync in progress, marking resyncRequired=true and exiting."), y.abrupt("return");
18860
18860
  case 7:
18861
- if (this.logger.info("syncConsumers: Starting sync operation."), c(this, Gr)[Gr] = !0, c(this, Wi)[Wi] = !1, l = [], this.participants.videoSubscribed.forEach(function(k) {
18861
+ if (this.logger.info("syncConsumers: Starting sync operation."), c(this, Wr)[Wr] = !0, c(this, Wi)[Wi] = !1, l = [], this.participants.videoSubscribed.forEach(function(k) {
18862
18862
  var w, T, A = i.participants.joined.get(k.id), M = (w = (T = k.producers) === null || T === void 0 ? void 0 : T.filter(function(O) {
18863
18863
  return O.kind === "video";
18864
18864
  })) !== null && w !== void 0 ? w : [];
@@ -18912,7 +18912,7 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
18912
18912
  case 34:
18913
18913
  y.prev = 34, y.t0 = y.catch(23), this.logger.error("syncConsumers: updateConsumers failed with error.", { error: y.t0 });
18914
18914
  case 37:
18915
- return y.prev = 37, this.logger.info("syncConsumers: Setting consumersSyncing=false and completing sync."), c(this, Gr)[Gr] = !1, y.finish(37);
18915
+ return y.prev = 37, this.logger.info("syncConsumers: Setting consumersSyncing=false and completing sync."), c(this, Wr)[Wr] = !1, y.finish(37);
18916
18916
  case 41:
18917
18917
  c(this, Wi)[Wi] && (this.logger.info("syncConsumers: Resync required, calling syncConsumers again."), this.syncConsumers());
18918
18918
  case 42:
@@ -19106,7 +19106,7 @@ var TM = Object.defineProperty, wM = Object.getOwnPropertyDescriptor, $s = funct
19106
19106
  for (; ; )
19107
19107
  switch (d.prev = d.next) {
19108
19108
  case 0:
19109
- n = u.length > 0 && u[0] !== void 0 ? u[0] : { viewMode: "ACTIVE_GRID", page: 0, createAllConsumers: !1 }, i = n.viewMode, a = n.page, o = n.createAllConsumers, e.logger.info("UPDATE_ACTIVE event received - viewMode: ".concat(c(e, Lr)[Lr].mode, ", page: ").concat(a, ", CreateAllConsumers: ").concat(o)), o && (e.logger.info("UPDATE_ACTIVE viewMode: ".concat(i, ", Page: ").concat(a, ", Removing existing subscriptions.")), e.participants.videoSubscribed.clear(), e.participants.audioSubscribed.clear()), e.updateMediaSubscribedMaps(i, { page: a }), e.scheduleSyncConsumers({ source: "UPDATE_ACTIVE" });
19109
+ n = u.length > 0 && u[0] !== void 0 ? u[0] : { viewMode: "ACTIVE_GRID", page: 0, createAllConsumers: !1 }, i = n.viewMode, a = n.page, o = n.createAllConsumers, e.logger.info("UPDATE_ACTIVE event received - viewMode: ".concat(c(e, Nr)[Nr].mode, ", page: ").concat(a, ", CreateAllConsumers: ").concat(o)), o && (e.logger.info("UPDATE_ACTIVE viewMode: ".concat(i, ", Page: ").concat(a, ", Removing existing subscriptions.")), e.participants.videoSubscribed.clear(), e.participants.audioSubscribed.clear()), e.updateMediaSubscribedMaps(i, { page: a }), e.scheduleSyncConsumers({ source: "UPDATE_ACTIVE" });
19110
19110
  case 5:
19111
19111
  case "end":
19112
19112
  return d.stop();
@@ -19751,10 +19751,10 @@ var or = Hn(lp().permissions), q = /* @__PURE__ */ E("permissions"), es = /* @__
19751
19751
  function SM() {
19752
19752
  return c(this, hs)[hs].getValue("stageStatus");
19753
19753
  }
19754
- var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19754
+ var _r = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19755
19755
  function t(e, r) {
19756
19756
  var n;
19757
- return P(this, t), n = C(this, t, [r]), n.localMediaHandler = void 0, Object.defineProperty(n, Mr, { writable: !0, value: void 0 }), c(n, Mr)[Mr] = e, n;
19757
+ return P(this, t), n = C(this, t, [r]), n.localMediaHandler = void 0, Object.defineProperty(n, _r, { writable: !0, value: void 0 }), c(n, _r)[_r] = e, n;
19758
19758
  }
19759
19759
  return R(t, s), S(t, [{
19760
19760
  key: "updatePermission",
@@ -19768,7 +19768,7 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19768
19768
  if (u = function(k, w) {
19769
19769
  i.mediaPermissions[k] = w;
19770
19770
  var T = { message: i.mediaPermissions[k], kind: k };
19771
- w === "DENIED" ? c(i, Mr)[Mr].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_ERROR, T) : c(i, Mr)[Mr].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, T);
19771
+ w === "DENIED" ? c(i, _r)[_r].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_ERROR, T) : c(i, _r)[_r].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, T);
19772
19772
  }, vr.getName() !== "firefox") {
19773
19773
  b.next = 3;
19774
19774
  break;
@@ -19819,11 +19819,11 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19819
19819
  a = i.message, o = i.kind, f.t0 = o, f.next = f.t0 === "audio" ? 4 : f.t0 === "video" ? 7 : f.t0 === "screenshare" ? 9 : 11;
19820
19820
  break;
19821
19821
  case 4:
19822
- return (u = c(this, Mr)[Mr]) === null || u === void 0 || u.getValue("callstats").mediaPermission("AUDIO", a), (l = c(this, Mr)[Mr]) === null || l === void 0 || l.getValue("callstats").mediaPermission("SPEAKER", a), f.abrupt("break", 11);
19822
+ return (u = c(this, _r)[_r]) === null || u === void 0 || u.getValue("callstats").mediaPermission("AUDIO", a), (l = c(this, _r)[_r]) === null || l === void 0 || l.getValue("callstats").mediaPermission("SPEAKER", a), f.abrupt("break", 11);
19823
19823
  case 7:
19824
- return (d = c(this, Mr)[Mr]) === null || d === void 0 || d.getValue("callstats").mediaPermission("VIDEO", a), f.abrupt("break", 11);
19824
+ return (d = c(this, _r)[_r]) === null || d === void 0 || d.getValue("callstats").mediaPermission("VIDEO", a), f.abrupt("break", 11);
19825
19825
  case 9:
19826
- return (p = c(this, Mr)[Mr]) === null || p === void 0 || p.getValue("callstats").mediaPermission("SCREENSHARE", a), f.abrupt("break", 11);
19826
+ return (p = c(this, _r)[_r]) === null || p === void 0 || p.getValue("callstats").mediaPermission("SCREENSHARE", a), f.abrupt("break", 11);
19827
19827
  case 11:
19828
19828
  case "end":
19829
19829
  return f.stop();
@@ -19838,7 +19838,7 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19838
19838
  key: "peerId",
19839
19839
  get: function() {
19840
19840
  var r;
19841
- return (r = c(this, Mr)[Mr]) === null || r === void 0 ? void 0 : r.getValue("peerId");
19841
+ return (r = c(this, _r)[_r]) === null || r === void 0 ? void 0 : r.getValue("peerId");
19842
19842
  }
19843
19843
  /**
19844
19844
  * @param {Object} options
@@ -19855,7 +19855,7 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19855
19855
  for (; ; )
19856
19856
  switch (O.prev = O.next) {
19857
19857
  case 0:
19858
- if (a = A.length > 0 && A[0] !== void 0 ? A[0] : {}, o = A.length > 1 && A[1] !== void 0 ? A[1] : !1, u = A.length > 2 && A[2] !== void 0 ? A[2] : null, vr.init(), u && (c(this, Mr)[Mr] = u), !this.localMediaHandler) {
19858
+ if (a = A.length > 0 && A[0] !== void 0 ? A[0] : {}, o = A.length > 1 && A[1] !== void 0 ? A[1] : !1, u = A.length > 2 && A[2] !== void 0 ? A[2] : null, vr.init(), u && (c(this, _r)[_r] = u), !this.localMediaHandler) {
19859
19859
  O.next = 7;
19860
19860
  break;
19861
19861
  }
@@ -19952,7 +19952,7 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
19952
19952
  }() }, {
19953
19953
  key: "context",
19954
19954
  set: function(r) {
19955
- c(this, Mr)[Mr] = r, this.localMediaHandler.context = r;
19955
+ c(this, _r)[_r] = r, this.localMediaHandler.context = r;
19956
19956
  }
19957
19957
  /**
19958
19958
  * Returns the `audioTrack`.
@@ -20405,7 +20405,7 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
20405
20405
  for (var i = n > 1 ? void 0 : n ? CM(e, r) : e, a = t.length - 1, o; a >= 0; a--)
20406
20406
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
20407
20407
  return n && i && EM(e, r, i), i;
20408
- }, zr = (Ji = /* @__PURE__ */ E("config"), rr = /* @__PURE__ */ E("permissions"), Ki = /* @__PURE__ */ E("isPinned"), Ve = /* @__PURE__ */ E("context"), gt = /* @__PURE__ */ E("pip"), Ne = /* @__PURE__ */ E("roomNodeClient"), zi = /* @__PURE__ */ E("audioPlayback"), Se = /* @__PURE__ */ E("mediaJoined"), ia = /* @__PURE__ */ E("previewVideoElements"), aa = /* @__PURE__ */ E("videoElements"), Ks = /* @__PURE__ */ E("updateVideos"), /* @__PURE__ */ function(s) {
20408
+ }, Qr = (Ji = /* @__PURE__ */ E("config"), rr = /* @__PURE__ */ E("permissions"), Ki = /* @__PURE__ */ E("isPinned"), Ve = /* @__PURE__ */ E("context"), gt = /* @__PURE__ */ E("pip"), Ne = /* @__PURE__ */ E("roomNodeClient"), zi = /* @__PURE__ */ E("audioPlayback"), Se = /* @__PURE__ */ E("mediaJoined"), ia = /* @__PURE__ */ E("previewVideoElements"), aa = /* @__PURE__ */ E("videoElements"), Ks = /* @__PURE__ */ E("updateVideos"), /* @__PURE__ */ function(s) {
20409
20409
  function t(e, r, n, i, a) {
20410
20410
  var o, u;
20411
20411
  P(this, t);
@@ -21211,7 +21211,7 @@ var Mr = /* @__PURE__ */ E("context"), xf = /* @__PURE__ */ function(s) {
21211
21211
  for (; ; )
21212
21212
  switch (D.prev = D.next) {
21213
21213
  case 0:
21214
- return y = O.length > 5 && O[5] !== void 0 ? O[5] : !1, k = (d = (p = i.getValue("defaults")) === null || p === void 0 ? void 0 : p.audio) !== null && d !== void 0 ? d : !0, w = (v = (f = i.getValue("defaults")) === null || f === void 0 ? void 0 : f.video) !== null && v !== void 0 ? v : !0, o.canProduceAudio !== "ALLOWED" && (k = !1), o.canProduceVideo !== "ALLOWED" && (w = !1), T = new zr(i, a, o, u, l), A = yI(u.mediaConstraints), Xi(A, (g = i.getValue("defaults")) === null || g === void 0 ? void 0 : g.mediaConfiguration), M = (b = i.getValue("defaults")) === null || b === void 0 ? void 0 : b.mediaHandler, M && (M.context = i), D.next = 12, T.init({ audio: k, video: w, constraints: A }, y, i);
21214
+ return y = O.length > 5 && O[5] !== void 0 ? O[5] : !1, k = (d = (p = i.getValue("defaults")) === null || p === void 0 ? void 0 : p.audio) !== null && d !== void 0 ? d : !0, w = (v = (f = i.getValue("defaults")) === null || f === void 0 ? void 0 : f.video) !== null && v !== void 0 ? v : !0, o.canProduceAudio !== "ALLOWED" && (k = !1), o.canProduceVideo !== "ALLOWED" && (w = !1), T = new Qr(i, a, o, u, l), A = yI(u.mediaConstraints), Xi(A, (g = i.getValue("defaults")) === null || g === void 0 ? void 0 : g.mediaConfiguration), M = (b = i.getValue("defaults")) === null || b === void 0 ? void 0 : b.mediaHandler, M && (M.context = i), D.next = 12, T.init({ audio: k, video: w, constraints: A }, y, i);
21215
21215
  case 12:
21216
21216
  return T.setupEvents(), D.abrupt("return", T);
21217
21217
  case 14:
@@ -21247,21 +21247,21 @@ function _M() {
21247
21247
  return s.updateVideo(t, !0);
21248
21248
  });
21249
21249
  }
21250
- pt([$.trace("Self.cleanupEvents")], zr.prototype, "cleanupEvents", 1);
21251
- pt([$.trace("Self.setupEvents")], zr.prototype, "setupEvents", 1);
21252
- pt([$.trace("Self.setupTracks")], zr.prototype, "setupTracks", 1);
21253
- pt([$.trace("Self.destructMediaHandler")], zr.prototype, "destructMediaHandler", 1);
21254
- pt([$.trace("Self.removeDocumentEventListeners")], zr.prototype, "removeDocumentEventListeners", 1);
21255
- pt([Oi.executeWithLock({ methodName: "meeting.self.enableAudio", lockName: "Self.toggleAudio", timeout: 3e3 }), $.trace("Self.enableAudio")], zr.prototype, "enableAudio", 1);
21256
- pt([Oi.executeWithLock({ methodName: "meeting.self.enableVideo", lockName: "Self.toggleVideo", timeout: 3e3 }), $.trace("Self.enableVideo")], zr.prototype, "enableVideo", 1);
21257
- pt([$.trace("Self.updateVideoConstraints")], zr.prototype, "updateVideoConstraints", 1);
21258
- pt([$.trace("Self.enableScreenShare"), Oi.executeWithLock({ methodName: "meeting.self.enableScreenShare", lockName: "Self.toggleScreenShare", timeout: 3e3 })], zr.prototype, "enableScreenShare", 1);
21259
- pt([$.trace("Self.updateScreenshareConstraints")], zr.prototype, "updateScreenshareConstraints", 1);
21260
- pt([Oi.executeWithLock({ methodName: "meeting.self.disableAudio", lockName: "Self.toggleAudio", timeout: 3e3 }), $.trace("Self.disableAudio")], zr.prototype, "disableAudio", 1);
21261
- pt([Oi.executeWithLock({ methodName: "meeting.self.disableVideo", lockName: "Self.toggleVideo", timeout: 3e3 }), $.trace("Self.disableVideo")], zr.prototype, "disableVideo", 1);
21262
- pt([Oi.executeWithLock({ methodName: "meeting.self.disableScreenShare", lockName: "Self.toggleScreenShare", timeout: 3e3 }), $.trace("Self.disableScreenShare")], zr.prototype, "disableScreenShare", 1);
21263
- pt([$.trace("Self.setDevice")], zr.prototype, "setDevice", 1);
21264
- zr = pt([nt("1100")], zr);
21250
+ pt([$.trace("Self.cleanupEvents")], Qr.prototype, "cleanupEvents", 1);
21251
+ pt([$.trace("Self.setupEvents")], Qr.prototype, "setupEvents", 1);
21252
+ pt([$.trace("Self.setupTracks")], Qr.prototype, "setupTracks", 1);
21253
+ pt([$.trace("Self.destructMediaHandler")], Qr.prototype, "destructMediaHandler", 1);
21254
+ pt([$.trace("Self.removeDocumentEventListeners")], Qr.prototype, "removeDocumentEventListeners", 1);
21255
+ pt([Oi.executeWithLock({ methodName: "meeting.self.enableAudio", lockName: "Self.toggleAudio", timeout: 3e3 }), $.trace("Self.enableAudio")], Qr.prototype, "enableAudio", 1);
21256
+ pt([Oi.executeWithLock({ methodName: "meeting.self.enableVideo", lockName: "Self.toggleVideo", timeout: 3e3 }), $.trace("Self.enableVideo")], Qr.prototype, "enableVideo", 1);
21257
+ pt([$.trace("Self.updateVideoConstraints")], Qr.prototype, "updateVideoConstraints", 1);
21258
+ pt([$.trace("Self.enableScreenShare"), Oi.executeWithLock({ methodName: "meeting.self.enableScreenShare", lockName: "Self.toggleScreenShare", timeout: 3e3 })], Qr.prototype, "enableScreenShare", 1);
21259
+ pt([$.trace("Self.updateScreenshareConstraints")], Qr.prototype, "updateScreenshareConstraints", 1);
21260
+ pt([Oi.executeWithLock({ methodName: "meeting.self.disableAudio", lockName: "Self.toggleAudio", timeout: 3e3 }), $.trace("Self.disableAudio")], Qr.prototype, "disableAudio", 1);
21261
+ pt([Oi.executeWithLock({ methodName: "meeting.self.disableVideo", lockName: "Self.toggleVideo", timeout: 3e3 }), $.trace("Self.disableVideo")], Qr.prototype, "disableVideo", 1);
21262
+ pt([Oi.executeWithLock({ methodName: "meeting.self.disableScreenShare", lockName: "Self.toggleScreenShare", timeout: 3e3 }), $.trace("Self.disableScreenShare")], Qr.prototype, "disableScreenShare", 1);
21263
+ pt([$.trace("Self.setDevice")], Qr.prototype, "setDevice", 1);
21264
+ Qr = pt([nt("1100")], Qr);
21265
21265
  var OM = /* @__PURE__ */ function(s) {
21266
21266
  function t(e) {
21267
21267
  var r;
@@ -22640,15 +22640,15 @@ function JM() {
22640
22640
  this.logger.error("Consumer::destroyTrack()", j(j({}, c(this, ut)[ut]), {}, { error: s }));
22641
22641
  }
22642
22642
  }
22643
- var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts = /* @__PURE__ */ E("disableTrackOnPause"), ei = /* @__PURE__ */ E("zeroRtpOnPause"), Hr = /* @__PURE__ */ E("closed"), qe = /* @__PURE__ */ E("track"), un = /* @__PURE__ */ E("paused"), ns = /* @__PURE__ */ E("maxSpatialLayer"), Pl = /* @__PURE__ */ E("context"), _r = /* @__PURE__ */ E("metadata"), KM = /* @__PURE__ */ function(s) {
22643
+ var Zr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts = /* @__PURE__ */ E("disableTrackOnPause"), ei = /* @__PURE__ */ E("zeroRtpOnPause"), Br = /* @__PURE__ */ E("closed"), qe = /* @__PURE__ */ E("track"), un = /* @__PURE__ */ E("paused"), ns = /* @__PURE__ */ E("maxSpatialLayer"), Pl = /* @__PURE__ */ E("context"), Or = /* @__PURE__ */ E("metadata"), KM = /* @__PURE__ */ function(s) {
22644
22644
  function t(e, r) {
22645
22645
  var n, i, a;
22646
- return P(this, t), a = C(this, t, [e]), Object.defineProperty(a, _r, { get: zM, set: void 0 }), a.id = void 0, a.localId = void 0, Object.defineProperty(a, Xr, { writable: !0, value: void 0 }), a.kind = void 0, a.appData = void 0, a.rtpSender = void 0, Object.defineProperty(a, rs, { writable: !0, value: void 0 }), Object.defineProperty(a, ts, { writable: !0, value: void 0 }), Object.defineProperty(a, ei, { writable: !0, value: void 0 }), Object.defineProperty(a, Hr, { writable: !0, value: !1 }), Object.defineProperty(a, qe, { writable: !0, value: void 0 }), Object.defineProperty(a, un, { writable: !0, value: void 0 }), Object.defineProperty(a, ns, { writable: !0, value: void 0 }), Object.defineProperty(a, Pl, { writable: !0, value: void 0 }), a.id = r.id, a.localId = r.localId, c(a, qe)[qe] = r.track, a.kind = (n = r.track) === null || n === void 0 ? void 0 : n.kind, c(a, un)[un] = r.disableTrackOnPause ? !((i = r.track) !== null && i !== void 0 && i.enabled) : !1, c(a, ns)[ns] = void 0, c(a, rs)[rs] = r.stopTracks, c(a, ts)[ts] = r.disableTrackOnPause, c(a, ei)[ei] = r.zeroRtpOnPause, a.appData = r.appData || {}, a._onTrackEnded = a._onTrackEnded.bind(a), c(a, Xr)[Xr] = r.handler, a.rtpSender = r.rtpSender, a._handleTrack(), c(a, Pl)[Pl] = e, a;
22646
+ return P(this, t), a = C(this, t, [e]), Object.defineProperty(a, Or, { get: zM, set: void 0 }), a.id = void 0, a.localId = void 0, Object.defineProperty(a, Zr, { writable: !0, value: void 0 }), a.kind = void 0, a.appData = void 0, a.rtpSender = void 0, Object.defineProperty(a, rs, { writable: !0, value: void 0 }), Object.defineProperty(a, ts, { writable: !0, value: void 0 }), Object.defineProperty(a, ei, { writable: !0, value: void 0 }), Object.defineProperty(a, Br, { writable: !0, value: !1 }), Object.defineProperty(a, qe, { writable: !0, value: void 0 }), Object.defineProperty(a, un, { writable: !0, value: void 0 }), Object.defineProperty(a, ns, { writable: !0, value: void 0 }), Object.defineProperty(a, Pl, { writable: !0, value: void 0 }), a.id = r.id, a.localId = r.localId, c(a, qe)[qe] = r.track, a.kind = (n = r.track) === null || n === void 0 ? void 0 : n.kind, c(a, un)[un] = r.disableTrackOnPause ? !((i = r.track) !== null && i !== void 0 && i.enabled) : !1, c(a, ns)[ns] = void 0, c(a, rs)[rs] = r.stopTracks, c(a, ts)[ts] = r.disableTrackOnPause, c(a, ei)[ei] = r.zeroRtpOnPause, a.appData = r.appData || {}, a._onTrackEnded = a._onTrackEnded.bind(a), c(a, Zr)[Zr] = r.handler, a.rtpSender = r.rtpSender, a._handleTrack(), c(a, Pl)[Pl] = e, a;
22647
22647
  }
22648
22648
  return R(t, s), S(t, [{
22649
22649
  key: "closed",
22650
22650
  get: function() {
22651
- return c(this, Hr)[Hr];
22651
+ return c(this, Br)[Br];
22652
22652
  }
22653
22653
  /**
22654
22654
  * The associated track.
@@ -22684,19 +22684,19 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22684
22684
  for (; ; )
22685
22685
  switch (v.prev = v.next) {
22686
22686
  case 0:
22687
- if (!c(this, Hr)[Hr]) {
22687
+ if (!c(this, Br)[Br]) {
22688
22688
  v.next = 2;
22689
22689
  break;
22690
22690
  }
22691
22691
  return v.abrupt("return");
22692
22692
  case 2:
22693
- if (this.logger.debug("Producer::close() ".concat(i ? "with reason ".concat(i) : ""), c(this, _r)[_r]), c(this, Hr)[Hr] = !0, this._destroyTrack(), i !== Ec) {
22693
+ if (this.logger.debug("Producer::close() ".concat(i ? "with reason ".concat(i) : ""), c(this, Or)[Or]), c(this, Br)[Br] = !0, this._destroyTrack(), i !== Ec) {
22694
22694
  v.next = 8;
22695
22695
  break;
22696
22696
  }
22697
22697
  return this.safeEmit("close", { reason: i }), v.abrupt("return");
22698
22698
  case 8:
22699
- return v.next = 10, c(this, Xr)[Xr].stopSending(this.localId);
22699
+ return v.next = 10, c(this, Zr)[Zr].stopSending(this.localId);
22700
22700
  case 10:
22701
22701
  return a = v.sent, o = a.offerSdp, u = a.callback, v.next = 15, this.safeEmitAsPromise("close", { offer: o, reason: i });
22702
22702
  case 15:
@@ -22718,13 +22718,13 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22718
22718
  for (; ; )
22719
22719
  switch (a.prev = a.next) {
22720
22720
  case 0:
22721
- if (!c(this, Hr)[Hr]) {
22721
+ if (!c(this, Br)[Br]) {
22722
22722
  a.next = 2;
22723
22723
  break;
22724
22724
  }
22725
22725
  throw new xt("closed");
22726
22726
  case 2:
22727
- return a.abrupt("return", c(this, Xr)[Xr].getSenderStats(this.localId));
22727
+ return a.abrupt("return", c(this, Zr)[Zr].getSenderStats(this.localId));
22728
22728
  case 3:
22729
22729
  case "end":
22730
22730
  return a.stop();
@@ -22738,7 +22738,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22738
22738
  }() }, {
22739
22739
  key: "pause",
22740
22740
  value: function() {
22741
- this.logger.debug("Producer::pause()", c(this, _r)[_r]), c(this, Hr)[Hr] && this.logger.error("Producer::pause() | Producer closed", c(this, _r)[_r]), c(this, un)[un] = !0, c(this, qe)[qe] && c(this, ts)[ts] && (c(this, qe)[qe].enabled = !1), c(this, ei)[ei] && c(this, Xr)[Xr].replaceTrack(this.localId, null), this.emit("pause");
22741
+ this.logger.debug("Producer::pause()", c(this, Or)[Or]), c(this, Br)[Br] && this.logger.error("Producer::pause() | Producer closed", c(this, Or)[Or]), c(this, un)[un] = !0, c(this, qe)[qe] && c(this, ts)[ts] && (c(this, qe)[qe].enabled = !1), c(this, ei)[ei] && c(this, Zr)[Zr].replaceTrack(this.localId, null), this.emit("pause");
22742
22742
  }
22743
22743
  /**
22744
22744
  * Resumes sending media.
@@ -22746,11 +22746,11 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22746
22746
  }, {
22747
22747
  key: "resume",
22748
22748
  value: function() {
22749
- if (this.logger.debug("Producer::resume()", c(this, _r)[_r]), c(this, Hr)[Hr]) {
22750
- this.logger.error("Producer::resume() | Producer closed", c(this, _r)[_r]);
22749
+ if (this.logger.debug("Producer::resume()", c(this, Or)[Or]), c(this, Br)[Br]) {
22750
+ this.logger.error("Producer::resume() | Producer closed", c(this, Or)[Or]);
22751
22751
  return;
22752
22752
  }
22753
- c(this, un)[un] = !1, c(this, qe)[qe] && c(this, ts)[ts] && (c(this, qe)[qe].enabled = !0), c(this, ei)[ei] && c(this, Xr)[Xr].replaceTrack(this.localId, c(this, qe)[qe]), this.emit("resume");
22753
+ c(this, un)[un] = !1, c(this, qe)[qe] && c(this, ts)[ts] && (c(this, qe)[qe].enabled = !0), c(this, ei)[ei] && c(this, Zr)[Zr].replaceTrack(this.localId, c(this, qe)[qe]), this.emit("resume");
22754
22754
  }
22755
22755
  /**
22756
22756
  * Replaces the current track with a new one or null.
@@ -22762,7 +22762,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22762
22762
  for (; ; )
22763
22763
  switch (u.prev = u.next) {
22764
22764
  case 0:
22765
- if (a = i.track, this.logger.debug("Producer::replaceTrack() trackId: ".concat(a == null ? void 0 : a.id), c(this, _r)[_r]), !c(this, Hr)[Hr]) {
22765
+ if (a = i.track, this.logger.debug("Producer::replaceTrack() trackId: ".concat(a == null ? void 0 : a.id), c(this, Or)[Or]), !c(this, Br)[Br]) {
22766
22766
  u.next = 7;
22767
22767
  break;
22768
22768
  }
@@ -22770,7 +22770,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22770
22770
  try {
22771
22771
  a.stop();
22772
22772
  } catch (l) {
22773
- this.logger.error("Producer::replaceTrack", j(j({}, c(this, _r)[_r]), {}, { error: l }));
22773
+ this.logger.error("Producer::replaceTrack", j(j({}, c(this, Or)[Or]), {}, { error: l }));
22774
22774
  }
22775
22775
  throw new xt("closed");
22776
22776
  case 7:
@@ -22784,13 +22784,13 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22784
22784
  u.next = 12;
22785
22785
  break;
22786
22786
  }
22787
- return this.logger.debug("replaceTrack() | same track, ignored trackId: ".concat(a.id), c(this, _r)[_r]), u.abrupt("return");
22787
+ return this.logger.debug("replaceTrack() | same track, ignored trackId: ".concat(a.id), c(this, Or)[Or]), u.abrupt("return");
22788
22788
  case 12:
22789
22789
  if (!(!c(this, ei)[ei] || !c(this, un)[un])) {
22790
22790
  u.next = 15;
22791
22791
  break;
22792
22792
  }
22793
- return u.next = 15, c(this, Xr)[Xr].replaceTrack(this.localId, a);
22793
+ return u.next = 15, c(this, Zr)[Zr].replaceTrack(this.localId, a);
22794
22794
  case 15:
22795
22795
  this._destroyTrack(), c(this, qe)[qe] = a, this._handleTrack();
22796
22796
  case 18:
@@ -22809,7 +22809,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22809
22809
  for (; ; )
22810
22810
  switch (o.prev = o.next) {
22811
22811
  case 0:
22812
- if (!c(this, Hr)[Hr]) {
22812
+ if (!c(this, Br)[Br]) {
22813
22813
  o.next = 4;
22814
22814
  break;
22815
22815
  }
@@ -22827,7 +22827,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22827
22827
  }
22828
22828
  throw new TypeError("invalid spatialLayer");
22829
22829
  case 10:
22830
- return o.next = 12, c(this, Xr)[Xr].setMaxSpatialLayer(this.localId, i);
22830
+ return o.next = 12, c(this, Zr)[Zr].setMaxSpatialLayer(this.localId, i);
22831
22831
  case 12:
22832
22832
  c(this, ns)[ns] = i;
22833
22833
  case 13:
@@ -22846,7 +22846,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22846
22846
  for (; ; )
22847
22847
  switch (o.prev = o.next) {
22848
22848
  case 0:
22849
- if (!c(this, Hr)[Hr]) {
22849
+ if (!c(this, Br)[Br]) {
22850
22850
  o.next = 4;
22851
22851
  break;
22852
22852
  }
@@ -22858,7 +22858,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22858
22858
  }
22859
22859
  throw new TypeError("invalid params");
22860
22860
  case 6:
22861
- return o.next = 8, c(this, Xr)[Xr].setRtpEncodingParameters(this.localId, i);
22861
+ return o.next = 8, c(this, Zr)[Zr].setRtpEncodingParameters(this.localId, i);
22862
22862
  case 8:
22863
22863
  case "end":
22864
22864
  return o.stop();
@@ -22870,7 +22870,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22870
22870
  }
22871
22871
  return r;
22872
22872
  }() }, { key: "_onTrackEnded", value: function() {
22873
- this.logger.debug('Producer::track "ended" event trackId: '.concat(this.track.id), c(this, _r)[_r]), this.safeEmit("trackended", this.track.id);
22873
+ this.logger.debug('Producer::track "ended" event trackId: '.concat(this.track.id), c(this, Or)[Or]), this.safeEmit("trackended", this.track.id);
22874
22874
  } }, { key: "_handleTrack", value: function() {
22875
22875
  c(this, qe)[qe] && c(this, qe)[qe].addEventListener("ended", this._onTrackEnded);
22876
22876
  } }, { key: "_destroyTrack", value: function() {
@@ -22879,7 +22879,7 @@ var Xr = /* @__PURE__ */ E("handler"), rs = /* @__PURE__ */ E("stopTracks"), ts
22879
22879
  c(this, qe)[qe].removeEventListener("ended", this._onTrackEnded), c(this, rs)[rs] && c(this, qe)[qe].stop();
22880
22880
  } catch (n) {
22881
22881
  var r;
22882
- this.logger.error("Producer::_destroyTrack trackId: ".concat((r = this.track) === null || r === void 0 ? void 0 : r.id), j(j({}, c(this, _r)[_r]), {}, { error: n }));
22882
+ this.logger.error("Producer::_destroyTrack trackId: ".concat((r = this.track) === null || r === void 0 ? void 0 : r.id), j(j({}, c(this, Or)[Or]), {}, { error: n }));
22883
22883
  }
22884
22884
  } }]);
22885
22885
  }(Jc);
@@ -24098,9 +24098,9 @@ function p_(s) {
24098
24098
  var t = s.state, e = s.direction;
24099
24099
  c(this, bs)[bs].mediaState[e] = { state: t }, this.context.getValue("peerSessionStore").emit(F.TRANSPORT_STATE_UPDATE, j({ transport: e }, c(this, bs)[bs].mediaState[e]));
24100
24100
  }
24101
- var Cl = /* @__PURE__ */ E("context"), Br = /* @__PURE__ */ E("logger"), h_ = /* @__PURE__ */ function() {
24101
+ var Cl = /* @__PURE__ */ E("context"), qr = /* @__PURE__ */ E("logger"), h_ = /* @__PURE__ */ function() {
24102
24102
  function s(t, e, r, n, i) {
24103
- P(this, s), Object.defineProperty(this, Cl, { writable: !0, value: void 0 }), Object.defineProperty(this, Br, { writable: !0, value: void 0 }), this.events = e, this.recvTransport = r, this.socket = n, this.socketHandler = i, c(this, Cl)[Cl] = t, c(this, Br)[Br] = t.getValue("logger");
24103
+ P(this, s), Object.defineProperty(this, Cl, { writable: !0, value: void 0 }), Object.defineProperty(this, qr, { writable: !0, value: void 0 }), this.events = e, this.recvTransport = r, this.socket = n, this.socketHandler = i, c(this, Cl)[Cl] = t, c(this, qr)[qr] = t.getValue("logger");
24104
24104
  }
24105
24105
  return S(s, [{ key: "create", value: function() {
24106
24106
  var t = m(/* @__PURE__ */ h().mark(function r(n) {
@@ -24126,7 +24126,7 @@ var Cl = /* @__PURE__ */ E("context"), Br = /* @__PURE__ */ E("logger"), h_ = /*
24126
24126
  var b = je(g, 2), y = b[0], k = b[1], w = l.get(y);
24127
24127
  if (w) {
24128
24128
  if (k.errorCode) {
24129
- c(i, Br)[Br].warn("Consumer request failed for producer ".concat(y), { error: { message: k.errorCode } }), p.push(j(j({}, w), {}, { errorCode: k.errorCode }));
24129
+ c(i, qr)[qr].warn("Consumer request failed for producer ".concat(y), { error: { message: k.errorCode } }), p.push(j(j({}, w), {}, { errorCode: k.errorCode }));
24130
24130
  return;
24131
24131
  }
24132
24132
  var T = {};
@@ -24154,13 +24154,13 @@ var Cl = /* @__PURE__ */ E("context"), Br = /* @__PURE__ */ E("logger"), h_ = /*
24154
24154
  for (; ; )
24155
24155
  switch (u.prev = u.next) {
24156
24156
  case 0:
24157
- return u.prev = 0, c(this, Br)[Br].info("Negotiating socket consumer", { transport: this.recvTransport }), c(this, Br)[Br].debug("[SDP] setting remote offer: ".concat(JSON.stringify(n), " on recvTransport"), { transport: this.recvTransport }), u.next = 5, this.recvTransport.setRemoteOffer(n);
24157
+ return u.prev = 0, c(this, qr)[qr].info("Negotiating socket consumer", { transport: this.recvTransport }), c(this, qr)[qr].debug("[SDP] setting remote offer: ".concat(JSON.stringify(n), " on recvTransport"), { transport: this.recvTransport }), u.next = 5, this.recvTransport.setRemoteOffer(n);
24158
24158
  case 5:
24159
- return i = u.sent, a = { transportId: this.recvTransport.serverId, description: { sdp: i.sdp, type: i.type, target: Ci.SUBSCRIBER } }, c(this, Br)[Br].debug("sending renegotiate request: ".concat(JSON.stringify(a), " on recvTransport"), { transport: this.recvTransport }), u.next = 10, this.socket.sendMessagePromise(this.events.renegotiateSessionDescription, pP.toBinary(a));
24159
+ return i = u.sent, a = { transportId: this.recvTransport.serverId, description: { sdp: i.sdp, type: i.type, target: Ci.SUBSCRIBER } }, c(this, qr)[qr].debug("sending renegotiate request: ".concat(JSON.stringify(a), " on recvTransport"), { transport: this.recvTransport }), u.next = 10, this.socket.sendMessagePromise(this.events.renegotiateSessionDescription, pP.toBinary(a));
24160
24160
  case 10:
24161
- return c(this, Br)[Br].info("Renegotiation done", { transport: this.recvTransport }), u.abrupt("return", i);
24161
+ return c(this, qr)[qr].info("Renegotiation done", { transport: this.recvTransport }), u.abrupt("return", i);
24162
24162
  case 14:
24163
- return u.prev = 14, u.t0 = u.catch(0), c(this, Br)[Br].error("Failed to renegotiate", { error: u.t0 }), u.abrupt("return", void 0);
24163
+ return u.prev = 14, u.t0 = u.catch(0), c(this, qr)[qr].error("Failed to renegotiate", { error: u.t0 }), u.abrupt("return", void 0);
24164
24164
  case 18:
24165
24165
  case "end":
24166
24166
  return u.stop();
@@ -24193,7 +24193,7 @@ var Cl = /* @__PURE__ */ E("context"), Br = /* @__PURE__ */ E("logger"), h_ = /*
24193
24193
  case 0:
24194
24194
  return f = p.map(function(T) {
24195
24195
  return T.localId;
24196
- }), c(i, Br)[Br].info("Closing consumers: ".concat(JSON.stringify(f))), g = { description: { sdp: v.sdp, type: v.type, target: Ci.SUBSCRIBER }, consumerIds: f, consumingTransportId: i.recvTransport.serverId }, w.next = 5, i.socketHandler.closeConsumer(g);
24196
+ }), c(i, qr)[qr].info("Closing consumers: ".concat(JSON.stringify(f))), g = { description: { sdp: v.sdp, type: v.type, target: Ci.SUBSCRIBER }, consumerIds: f, consumingTransportId: i.recvTransport.serverId }, w.next = 5, i.socketHandler.closeConsumer(g);
24197
24197
  case 5:
24198
24198
  return b = w.sent, y = jS.fromBinary(b).description, w.abrupt("return", { sdp: y.sdp, type: y.type });
24199
24199
  case 8:
@@ -24234,7 +24234,7 @@ var Cl = /* @__PURE__ */ E("context"), Br = /* @__PURE__ */ E("logger"), h_ = /*
24234
24234
  a.requests.push({ producerId: p, producingTransportId: v, mid: f, simulcast: { preferredRid: i === 0 ? "q" : "h", priorityOrdering: "asciibetical", ridNotAvailable: "asciibetical" } });
24235
24235
  }), l.next = 5, this.socketHandler.updateConsumersSimulcastConfig(a);
24236
24236
  case 5:
24237
- c(this, Br)[Br].info("Consumers switched layers to ".concat(i), { consumerIds: o == null ? void 0 : o.map(function(d) {
24237
+ c(this, qr)[qr].info("Consumers switched layers to ".concat(i), { consumerIds: o == null ? void 0 : o.map(function(d) {
24238
24238
  var p = d.id;
24239
24239
  return p;
24240
24240
  }) });
@@ -24604,10 +24604,10 @@ function b_(s) {
24604
24604
  };
24605
24605
  }()), c(this, mn)[mn].set(s.id, s), this.producerIdToConsumerIdMap.set(s.producerId, s.id), this.context.getValue("peerSessionStore").emit(F.NEW_CONSUMER, { id: s.id, appData: s.appData, peerId: s.peerId });
24606
24606
  }
24607
- var zo = /* @__PURE__ */ E("zeroCrossingThreshold"), Qo = /* @__PURE__ */ E("minVoiceDuration"), Yo = /* @__PURE__ */ E("hangoverFrames"), as = /* @__PURE__ */ E("initialEnergyThreshold"), Ts = /* @__PURE__ */ E("noiseAdaptationRate"), ws = /* @__PURE__ */ E("voiceAdaptationRate"), hu = /* @__PURE__ */ E("minEnergyThreshold"), vu = /* @__PURE__ */ E("maxEnergyThreshold"), ss = /* @__PURE__ */ E("energyRatioThreshold"), wr = /* @__PURE__ */ E("currentEnergyThreshold"), rt = /* @__PURE__ */ E("backgroundNoiseEnergy"), xr = /* @__PURE__ */ E("voiceDetected"), ii = /* @__PURE__ */ E("consecutiveVoiceFrames"), ai = /* @__PURE__ */ E("hangoverCount"), Nt = /* @__PURE__ */ E("noiseEnergyHistory"), fu = /* @__PURE__ */ E("noiseHistorySize"), Ml = /* @__PURE__ */ E("updateEnergyThreshold"), _l = /* @__PURE__ */ E("updateNoiseEstimate"), Cd = /* @__PURE__ */ E("calculateEnergy"), Rd = /* @__PURE__ */ E("calculateZeroCrossingRate"), bp = /* @__PURE__ */ function() {
24607
+ var zo = /* @__PURE__ */ E("zeroCrossingThreshold"), Qo = /* @__PURE__ */ E("minVoiceDuration"), Yo = /* @__PURE__ */ E("hangoverFrames"), as = /* @__PURE__ */ E("initialEnergyThreshold"), Ts = /* @__PURE__ */ E("noiseAdaptationRate"), ws = /* @__PURE__ */ E("voiceAdaptationRate"), hu = /* @__PURE__ */ E("minEnergyThreshold"), vu = /* @__PURE__ */ E("maxEnergyThreshold"), ss = /* @__PURE__ */ E("energyRatioThreshold"), Pr = /* @__PURE__ */ E("currentEnergyThreshold"), rt = /* @__PURE__ */ E("backgroundNoiseEnergy"), xr = /* @__PURE__ */ E("voiceDetected"), ii = /* @__PURE__ */ E("consecutiveVoiceFrames"), ai = /* @__PURE__ */ E("hangoverCount"), Nt = /* @__PURE__ */ E("noiseEnergyHistory"), fu = /* @__PURE__ */ E("noiseHistorySize"), Ml = /* @__PURE__ */ E("updateEnergyThreshold"), _l = /* @__PURE__ */ E("updateNoiseEstimate"), Cd = /* @__PURE__ */ E("calculateEnergy"), Rd = /* @__PURE__ */ E("calculateZeroCrossingRate"), bp = /* @__PURE__ */ function() {
24608
24608
  function s() {
24609
24609
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.initialEnergyThreshold, r = e === void 0 ? 0.015 : e, n = t.zeroCrossingThreshold, i = n === void 0 ? 20 : n, a = t.minVoiceDuration, o = a === void 0 ? 3 : a, u = t.hangoverFrames, l = u === void 0 ? 5 : u, d = t.noiseAdaptationRate, p = d === void 0 ? 0.95 : d, v = t.voiceAdaptationRate, f = v === void 0 ? 0.99 : v, g = t.minEnergyThreshold, b = g === void 0 ? 5e-3 : g, y = t.maxEnergyThreshold, k = y === void 0 ? 0.2 : y, w = t.energyRatioThreshold, T = w === void 0 ? 1.5 : w, A = t.noiseHistorySize, M = A === void 0 ? 50 : A;
24610
- P(this, s), Object.defineProperty(this, _l, { value: w_ }), Object.defineProperty(this, Ml, { value: T_ }), Object.defineProperty(this, zo, { writable: !0, value: void 0 }), Object.defineProperty(this, Qo, { writable: !0, value: void 0 }), Object.defineProperty(this, Yo, { writable: !0, value: void 0 }), Object.defineProperty(this, as, { writable: !0, value: void 0 }), Object.defineProperty(this, Ts, { writable: !0, value: void 0 }), Object.defineProperty(this, ws, { writable: !0, value: void 0 }), Object.defineProperty(this, hu, { writable: !0, value: void 0 }), Object.defineProperty(this, vu, { writable: !0, value: void 0 }), Object.defineProperty(this, ss, { writable: !0, value: void 0 }), Object.defineProperty(this, wr, { writable: !0, value: void 0 }), Object.defineProperty(this, rt, { writable: !0, value: void 0 }), Object.defineProperty(this, xr, { writable: !0, value: !1 }), Object.defineProperty(this, ii, { writable: !0, value: 0 }), Object.defineProperty(this, ai, { writable: !0, value: 0 }), Object.defineProperty(this, Nt, { writable: !0, value: [] }), Object.defineProperty(this, fu, { writable: !0, value: void 0 }), c(this, as)[as] = r, c(this, wr)[wr] = r, c(this, zo)[zo] = i, c(this, Qo)[Qo] = o, c(this, Yo)[Yo] = l, c(this, Ts)[Ts] = p, c(this, ws)[ws] = f, c(this, hu)[hu] = b, c(this, vu)[vu] = k, c(this, ss)[ss] = T, c(this, fu)[fu] = M, c(this, rt)[rt] = r / 2;
24610
+ P(this, s), Object.defineProperty(this, _l, { value: w_ }), Object.defineProperty(this, Ml, { value: T_ }), Object.defineProperty(this, zo, { writable: !0, value: void 0 }), Object.defineProperty(this, Qo, { writable: !0, value: void 0 }), Object.defineProperty(this, Yo, { writable: !0, value: void 0 }), Object.defineProperty(this, as, { writable: !0, value: void 0 }), Object.defineProperty(this, Ts, { writable: !0, value: void 0 }), Object.defineProperty(this, ws, { writable: !0, value: void 0 }), Object.defineProperty(this, hu, { writable: !0, value: void 0 }), Object.defineProperty(this, vu, { writable: !0, value: void 0 }), Object.defineProperty(this, ss, { writable: !0, value: void 0 }), Object.defineProperty(this, Pr, { writable: !0, value: void 0 }), Object.defineProperty(this, rt, { writable: !0, value: void 0 }), Object.defineProperty(this, xr, { writable: !0, value: !1 }), Object.defineProperty(this, ii, { writable: !0, value: 0 }), Object.defineProperty(this, ai, { writable: !0, value: 0 }), Object.defineProperty(this, Nt, { writable: !0, value: [] }), Object.defineProperty(this, fu, { writable: !0, value: void 0 }), c(this, as)[as] = r, c(this, Pr)[Pr] = r, c(this, zo)[zo] = i, c(this, Qo)[Qo] = o, c(this, Yo)[Yo] = l, c(this, Ts)[Ts] = p, c(this, ws)[ws] = f, c(this, hu)[hu] = b, c(this, vu)[vu] = k, c(this, ss)[ss] = T, c(this, fu)[fu] = M, c(this, rt)[rt] = r / 2;
24611
24611
  }
24612
24612
  return S(s, [{
24613
24613
  key: "voiceDetected",
@@ -24622,7 +24622,7 @@ var zo = /* @__PURE__ */ E("zeroCrossingThreshold"), Qo = /* @__PURE__ */ E("min
24622
24622
  }, { key: "processAudioChunk", value: function(e) {
24623
24623
  var r = c(s, Cd)[Cd](e), n = c(s, Rd)[Rd](e);
24624
24624
  c(this, Ml)[Ml](r);
24625
- var i = r / c(this, rt)[rt], a = i > c(this, ss)[ss] && r > c(this, wr)[wr] && n > c(this, zo)[zo];
24625
+ var i = r / c(this, rt)[rt], a = i > c(this, ss)[ss] && r > c(this, Pr)[Pr] && n > c(this, zo)[zo];
24626
24626
  return a ? (c(this, ii)[ii] += 1, c(this, ai)[ai] = c(this, Yo)[Yo], c(this, ii)[ii] >= c(this, Qo)[Qo] && (c(this, xr)[xr] = !0)) : (c(this, ii)[ii] = 0, c(this, ai)[ai] > 0 ? c(this, ai)[ai] -= 1 : c(this, xr)[xr] && (c(this, xr)[xr] = !1), c(this, xr)[xr] || c(this, _l)[_l](r)), { energy: r, isVoice: c(this, xr)[xr] };
24627
24627
  } }, {
24628
24628
  key: "reset",
@@ -24631,21 +24631,21 @@ var zo = /* @__PURE__ */ E("zeroCrossingThreshold"), Qo = /* @__PURE__ */ E("min
24631
24631
  * Reset the detector state
24632
24632
  */
24633
24633
  function() {
24634
- c(this, xr)[xr] = !1, c(this, ii)[ii] = 0, c(this, ai)[ai] = 0, c(this, wr)[wr] = c(this, as)[as], c(this, rt)[rt] = c(this, as)[as] / 2, c(this, Nt)[Nt] = [];
24634
+ c(this, xr)[xr] = !1, c(this, ii)[ii] = 0, c(this, ai)[ai] = 0, c(this, Pr)[Pr] = c(this, as)[as], c(this, rt)[rt] = c(this, as)[as] / 2, c(this, Nt)[Nt] = [];
24635
24635
  }
24636
24636
  )
24637
24637
  /**
24638
24638
  * Get current adaptive threshold values for debugging/visualization
24639
24639
  */
24640
24640
  }, { key: "getThresholdInfo", value: function() {
24641
- return { currentEnergyThreshold: c(this, wr)[wr], backgroundNoiseEnergy: c(this, rt)[rt], energyRatioThreshold: c(this, ss)[ss] };
24641
+ return { currentEnergyThreshold: c(this, Pr)[Pr], backgroundNoiseEnergy: c(this, rt)[rt], energyRatioThreshold: c(this, ss)[ss] };
24642
24642
  } }]);
24643
24643
  }();
24644
24644
  function T_(s) {
24645
- c(this, xr)[xr] ? c(this, wr)[wr] = c(this, ws)[ws] * c(this, wr)[wr] + (1 - c(this, ws)[ws]) * s : c(this, wr)[wr] = c(this, Ts)[Ts] * c(this, wr)[wr] + (1 - c(this, Ts)[Ts]) * c(this, rt)[rt], c(this, wr)[wr] = Math.max(c(this, hu)[hu], Math.min(c(this, vu)[vu], c(this, wr)[wr]));
24645
+ c(this, xr)[xr] ? c(this, Pr)[Pr] = c(this, ws)[ws] * c(this, Pr)[Pr] + (1 - c(this, ws)[ws]) * s : c(this, Pr)[Pr] = c(this, Ts)[Ts] * c(this, Pr)[Pr] + (1 - c(this, Ts)[Ts]) * c(this, rt)[rt], c(this, Pr)[Pr] = Math.max(c(this, hu)[hu], Math.min(c(this, vu)[vu], c(this, Pr)[Pr]));
24646
24646
  }
24647
24647
  function w_(s) {
24648
- if (s < c(this, wr)[wr] * 1.2)
24648
+ if (s < c(this, Pr)[Pr] * 1.2)
24649
24649
  if (c(this, Nt)[Nt].push(s), c(this, Nt)[Nt].length > c(this, fu)[fu] && c(this, Nt)[Nt].shift(), c(this, Nt)[Nt].length >= 10) {
24650
24650
  var t = Ie(c(this, Nt)[Nt]).sort(function(r, n) {
24651
24651
  return r - n;
@@ -24822,10 +24822,10 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
24822
24822
  for (var i = n > 1 ? void 0 : n ? D_(e, r) : e, a = t.length - 1, o; a >= 0; a--)
24823
24823
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
24824
24824
  return n && i && O_(e, r, i), i;
24825
- }, gu = /* @__PURE__ */ E("roomUUID"), mu = /* @__PURE__ */ E("peerDisplayName"), Ze = /* @__PURE__ */ E("socketClient"), W = /* @__PURE__ */ E("sfuHandler"), Id = /* @__PURE__ */ E("rtpCapabilities"), cr = /* @__PURE__ */ E("events"), vi = /* @__PURE__ */ E("roomJoiningInProgress"), fi = /* @__PURE__ */ E("onceJoined"), oi = /* @__PURE__ */ E("transportQueue"), eu = /* @__PURE__ */ E("rejoinRoomFn"), qr = /* @__PURE__ */ E("connectionPromise"), Dt = /* @__PURE__ */ E("screenshareConsumerProducer"), pr = /* @__PURE__ */ E("producerTypes"), br = /* @__PURE__ */ E("audioActivityReporter"), ln = /* @__PURE__ */ E("connectionHandler"), $l = /* @__PURE__ */ E("joinRoom"), Md = /* @__PURE__ */ E("completeJoinRoom"), _d = /* @__PURE__ */ E("reportRoomJoinedAnalytics"), yu = /* @__PURE__ */ E("initializeConnection"), Od = /* @__PURE__ */ E("getRtpCapabilities"), Dd = /* @__PURE__ */ E("sendJoinRoomMessage"), lr = /* @__PURE__ */ E("getProducer"), ui = /* @__PURE__ */ E("setProducer"), Ll = /* @__PURE__ */ E("deleteProducer"), Nl = /* @__PURE__ */ E("getMicProducerDefaults"), Vl = /* @__PURE__ */ E("getWebcamProducerDefaults"), Je = /* @__PURE__ */ function() {
24825
+ }, gu = /* @__PURE__ */ E("roomUUID"), mu = /* @__PURE__ */ E("peerDisplayName"), Ze = /* @__PURE__ */ E("socketClient"), W = /* @__PURE__ */ E("sfuHandler"), Id = /* @__PURE__ */ E("rtpCapabilities"), cr = /* @__PURE__ */ E("events"), vi = /* @__PURE__ */ E("roomJoiningInProgress"), fi = /* @__PURE__ */ E("onceJoined"), oi = /* @__PURE__ */ E("transportQueue"), eu = /* @__PURE__ */ E("rejoinRoomFn"), Gr = /* @__PURE__ */ E("connectionPromise"), Dt = /* @__PURE__ */ E("screenshareConsumerProducer"), pr = /* @__PURE__ */ E("producerTypes"), br = /* @__PURE__ */ E("audioActivityReporter"), ln = /* @__PURE__ */ E("connectionHandler"), $l = /* @__PURE__ */ E("joinRoom"), Md = /* @__PURE__ */ E("completeJoinRoom"), _d = /* @__PURE__ */ E("reportRoomJoinedAnalytics"), yu = /* @__PURE__ */ E("initializeConnection"), Od = /* @__PURE__ */ E("getRtpCapabilities"), Dd = /* @__PURE__ */ E("sendJoinRoomMessage"), lr = /* @__PURE__ */ E("getProducer"), ui = /* @__PURE__ */ E("setProducer"), Ll = /* @__PURE__ */ E("deleteProducer"), Nl = /* @__PURE__ */ E("getMicProducerDefaults"), Vl = /* @__PURE__ */ E("getWebcamProducerDefaults"), Je = /* @__PURE__ */ function() {
24826
24826
  function s(t, e) {
24827
24827
  var r, n, i = this;
24828
- P(this, s), Object.defineProperty(this, Vl, { value: W_ }), Object.defineProperty(this, Nl, { value: G_ }), Object.defineProperty(this, Ll, { value: q_ }), Object.defineProperty(this, ui, { value: B_ }), Object.defineProperty(this, lr, { value: H_ }), Object.defineProperty(this, Dd, { value: F_ }), Object.defineProperty(this, Od, { value: j_ }), Object.defineProperty(this, yu, { value: U_ }), Object.defineProperty(this, _d, { value: V_ }), Object.defineProperty(this, Md, { value: N_ }), Object.defineProperty(this, $l, { value: L_ }), Object.defineProperty(this, ln, { get: $_, set: void 0 }), this.context = void 0, this.authToken = void 0, this.e2ee = void 0, Object.defineProperty(this, gu, { writable: !0, value: void 0 }), Object.defineProperty(this, mu, { writable: !0, value: void 0 }), Object.defineProperty(this, Ze, { writable: !0, value: void 0 }), Object.defineProperty(this, W, { writable: !0, value: void 0 }), Object.defineProperty(this, Id, { writable: !0, value: void 0 }), Object.defineProperty(this, cr, { writable: !0, value: void 0 }), Object.defineProperty(this, vi, { writable: !0, value: void 0 }), Object.defineProperty(this, fi, { writable: !0, value: void 0 }), Object.defineProperty(this, oi, { writable: !0, value: void 0 }), Object.defineProperty(this, eu, { writable: !0, value: void 0 }), Object.defineProperty(this, qr, { writable: !0, value: null }), Object.defineProperty(this, Dt, { writable: !0, value: void 0 }), Object.defineProperty(this, pr, { writable: !0, value: void 0 }), Object.defineProperty(this, br, { writable: !0, value: void 0 }), this.context = t;
24828
+ P(this, s), Object.defineProperty(this, Vl, { value: W_ }), Object.defineProperty(this, Nl, { value: G_ }), Object.defineProperty(this, Ll, { value: q_ }), Object.defineProperty(this, ui, { value: B_ }), Object.defineProperty(this, lr, { value: H_ }), Object.defineProperty(this, Dd, { value: F_ }), Object.defineProperty(this, Od, { value: j_ }), Object.defineProperty(this, yu, { value: U_ }), Object.defineProperty(this, _d, { value: V_ }), Object.defineProperty(this, Md, { value: N_ }), Object.defineProperty(this, $l, { value: L_ }), Object.defineProperty(this, ln, { get: $_, set: void 0 }), this.context = void 0, this.authToken = void 0, this.e2ee = void 0, Object.defineProperty(this, gu, { writable: !0, value: void 0 }), Object.defineProperty(this, mu, { writable: !0, value: void 0 }), Object.defineProperty(this, Ze, { writable: !0, value: void 0 }), Object.defineProperty(this, W, { writable: !0, value: void 0 }), Object.defineProperty(this, Id, { writable: !0, value: void 0 }), Object.defineProperty(this, cr, { writable: !0, value: void 0 }), Object.defineProperty(this, vi, { writable: !0, value: void 0 }), Object.defineProperty(this, fi, { writable: !0, value: void 0 }), Object.defineProperty(this, oi, { writable: !0, value: void 0 }), Object.defineProperty(this, eu, { writable: !0, value: void 0 }), Object.defineProperty(this, Gr, { writable: !0, value: null }), Object.defineProperty(this, Dt, { writable: !0, value: void 0 }), Object.defineProperty(this, pr, { writable: !0, value: void 0 }), Object.defineProperty(this, br, { writable: !0, value: void 0 }), this.context = t;
24829
24829
  var a = e.socket;
24830
24830
  this.mediaJoined = !1, c(this, Ze)[Ze] = a, c(this, vi)[vi] = !1, c(this, W)[W] = new f_(t, a), c(this, cr)[cr] = c(this, W)[W].events, c(this, Dt)[Dt] = /* @__PURE__ */ new Set(), c(this, pr)[pr] = /* @__PURE__ */ new Map(), c(this, fi)[fi] = !1, c(this, oi)[oi] = new cd(t.getValue("logger")), c(this, br)[br] = new zc(this.context, c(this, W)[W].socketHandler.audioActivity.bind(c(this, W)[W].socketHandler)), this.e2ee = (r = (n = t.getValue("modules").e2ee) === null || n === void 0 ? void 0 : n.enabled) !== null && r !== void 0 ? r : !1, this.handleSocketEvents(), this.handleCallstatsEvents(), c(this, eu)[eu] = cp(/* @__PURE__ */ m(/* @__PURE__ */ h().mark(function o() {
24831
24831
  var u, l;
@@ -24874,7 +24874,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
24874
24874
  }, set: function(e) {
24875
24875
  c(this, ln)[ln].mediaJoined = e;
24876
24876
  } }, { key: "reset", value: function() {
24877
- c(this, W)[W].closeAllProducers(), c(this, W)[W].closeAllConsumers(), c(this, pr)[pr].clear(), c(this, Dt)[Dt].clear(), c(this, qr)[qr] = null, c(this, oi)[oi].stop(), c(this, W)[W].stopAllTransports(), c(this, W)[W].reset(), c(this, oi)[oi] = new cd();
24877
+ c(this, W)[W].closeAllProducers(), c(this, W)[W].closeAllConsumers(), c(this, pr)[pr].clear(), c(this, Dt)[Dt].clear(), c(this, Gr)[Gr] = null, c(this, oi)[oi].stop(), c(this, W)[W].stopAllTransports(), c(this, W)[W].reset(), c(this, oi)[oi] = new cd();
24878
24878
  } }, { key: "joinRoom", value: function() {
24879
24879
  var t = m(/* @__PURE__ */ h().mark(function r(n, i) {
24880
24880
  var a = this, o, u, l, d, p = arguments;
@@ -24912,13 +24912,13 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
24912
24912
  for (; ; )
24913
24913
  switch (p.prev = p.next) {
24914
24914
  case 0:
24915
- if (o = l.length > 2 && l[2] !== void 0 ? l[2] : !1, u = l.length > 3 && l[3] !== void 0 ? l[3] : {}, !c(this, qr)[qr]) {
24915
+ if (o = l.length > 2 && l[2] !== void 0 ? l[2] : !1, u = l.length > 3 && l[3] !== void 0 ? l[3] : {}, !c(this, Gr)[Gr]) {
24916
24916
  p.next = 4;
24917
24917
  break;
24918
24918
  }
24919
- return p.abrupt("return", c(this, qr)[qr]);
24919
+ return p.abrupt("return", c(this, Gr)[Gr]);
24920
24920
  case 4:
24921
- return c(this, qr)[qr] = m(/* @__PURE__ */ h().mark(function v() {
24921
+ return c(this, Gr)[Gr] = m(/* @__PURE__ */ h().mark(function v() {
24922
24922
  return h().wrap(function(g) {
24923
24923
  for (; ; )
24924
24924
  switch (g.prev = g.next) {
@@ -24928,13 +24928,13 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
24928
24928
  g.next = 9;
24929
24929
  break;
24930
24930
  case 5:
24931
- throw g.prev = 5, g.t0 = g.catch(0), c(a, qr)[qr] = null, g.t0;
24931
+ throw g.prev = 5, g.t0 = g.catch(0), c(a, Gr)[Gr] = null, g.t0;
24932
24932
  case 9:
24933
24933
  case "end":
24934
24934
  return g.stop();
24935
24935
  }
24936
24936
  }, v, null, [[0, 5]]);
24937
- }))(), p.abrupt("return", c(this, qr)[qr]);
24937
+ }))(), p.abrupt("return", c(this, Gr)[Gr]);
24938
24938
  case 6:
24939
24939
  case "end":
24940
24940
  return p.stop();
@@ -25049,7 +25049,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25049
25049
  for (; ; )
25050
25050
  switch (T.prev = T.next) {
25051
25051
  case 0:
25052
- if (u = Sr.WEBCAM, l = c(this, lr)[lr](u), !l) {
25052
+ if (u = Er.WEBCAM, l = c(this, lr)[lr](u), !l) {
25053
25053
  T.next = 17;
25054
25054
  break;
25055
25055
  }
@@ -25127,11 +25127,11 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25127
25127
  return b.abrupt("return");
25128
25128
  case 3:
25129
25129
  return u = { track: a, codecOptions: [{ name: "VP8" }], appData: { screenShare: !0, e2ee: this.e2ee, supportsRemoteControl: vr.isElectron() }, stopTracks: !1 }, l = function() {
25130
- i.logger.info("Disabling screenShare due to the producer closure"), c(i, pr)[pr].delete(Sr.SCREENSHARE_VIDEO), c(i, pr)[pr].delete(Sr.SCREENSHARE_AUDIO);
25131
- }, d = c(this, W)[W].createProducer(u, l), c(this, ui)[ui](Sr.SCREENSHARE_VIDEO, d.then(function(y) {
25130
+ i.logger.info("Disabling screenShare due to the producer closure"), c(i, pr)[pr].delete(Er.SCREENSHARE_VIDEO), c(i, pr)[pr].delete(Er.SCREENSHARE_AUDIO);
25131
+ }, d = c(this, W)[W].createProducer(u, l), c(this, ui)[ui](Er.SCREENSHARE_VIDEO, d.then(function(y) {
25132
25132
  return y.id;
25133
25133
  })), o && (v = { track: o, codecOptions: [{ name: "opus" }], appData: { screenShare: !0, e2ee: this.e2ee, supportsRemoteControl: vr.isElectron() }, stopTracks: !1, zeroRtpOnPause: !1 }, f = function() {
25134
- }, p = c(this, W)[W].createProducer(v, f), c(this, ui)[ui](Sr.SCREENSHARE_AUDIO, p.then(function(y) {
25134
+ }, p = c(this, W)[W].createProducer(v, f), c(this, ui)[ui](Er.SCREENSHARE_AUDIO, p.then(function(y) {
25135
25135
  return y.id;
25136
25136
  }))), b.next = 10, Promise.all([d, p || Promise.resolve()]);
25137
25137
  case 10:
@@ -25159,7 +25159,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25159
25159
  }
25160
25160
  throw new xt("track undefined");
25161
25161
  case 3:
25162
- if (a = c(this, lr)[lr](Sr.MIC), !a) {
25162
+ if (a = c(this, lr)[lr](Er.MIC), !a) {
25163
25163
  f.next = 22;
25164
25164
  break;
25165
25165
  }
@@ -25186,8 +25186,8 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25186
25186
  return f.abrupt("return");
25187
25187
  case 22:
25188
25188
  return l = c(this, Nl)[Nl](n), d = function() {
25189
- c(i, pr)[pr].delete(Sr.MIC);
25190
- }, p = c(this, W)[W].createProducer(l, d), c(this, ui)[ui](Sr.MIC, p.then(function(g) {
25189
+ c(i, pr)[pr].delete(Er.MIC);
25190
+ }, p = c(this, W)[W].createProducer(l, d), c(this, ui)[ui](Er.MIC, p.then(function(g) {
25191
25191
  return g.id;
25192
25192
  })), f.next = 28, p.then(function(g) {
25193
25193
  c(i, br)[br] && (c(i, br)[br].audioTrack = g.track, c(i, br)[br].producerId = g.id, c(i, br)[br].start());
@@ -25214,7 +25214,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25214
25214
  for (; ; )
25215
25215
  switch (l.prev = l.next) {
25216
25216
  case 0:
25217
- return l.next = 2, c(this, lr)[lr](Sr.MIC);
25217
+ return l.next = 2, c(this, lr)[lr](Er.MIC);
25218
25218
  case 2:
25219
25219
  if (i = l.sent, a = c(this, W)[W].producers.get(i), a) {
25220
25220
  l.next = 7;
@@ -25246,7 +25246,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25246
25246
  for (; ; )
25247
25247
  switch (u.prev = u.next) {
25248
25248
  case 0:
25249
- return u.next = 2, c(this, lr)[lr](Sr.WEBCAM);
25249
+ return u.next = 2, c(this, lr)[lr](Er.WEBCAM);
25250
25250
  case 2:
25251
25251
  if (n = u.sent, i = c(this, W)[W].producers.get(n), i) {
25252
25252
  u.next = 7;
@@ -25272,7 +25272,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25272
25272
  for (; ; )
25273
25273
  switch (u.prev = u.next) {
25274
25274
  case 0:
25275
- return u.next = 2, c(this, lr)[lr](Sr.MIC);
25275
+ return u.next = 2, c(this, lr)[lr](Er.MIC);
25276
25276
  case 2:
25277
25277
  if (n = u.sent, i = c(this, W)[W].producers.get(n), i) {
25278
25278
  u.next = 7;
@@ -25304,7 +25304,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25304
25304
  for (; ; )
25305
25305
  switch (d.prev = d.next) {
25306
25306
  case 0:
25307
- return n = u.length > 0 && u[0] !== void 0 ? u[0] : Sr.WEBCAM, d.next = 3, c(this, lr)[lr](n);
25307
+ return n = u.length > 0 && u[0] !== void 0 ? u[0] : Er.WEBCAM, d.next = 3, c(this, lr)[lr](n);
25308
25308
  case 3:
25309
25309
  if (i = d.sent, a = c(this, W)[W].producers.get(i), a) {
25310
25310
  d.next = 8;
@@ -25336,7 +25336,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25336
25336
  for (; ; )
25337
25337
  switch (o.prev = o.next) {
25338
25338
  case 0:
25339
- return n = Sr.WEBCAM, o.next = 3, c(this, lr)[lr](n);
25339
+ return n = Er.WEBCAM, o.next = 3, c(this, lr)[lr](n);
25340
25340
  case 3:
25341
25341
  if (i = o.sent, c(this, Ll)[Ll](n), !i) {
25342
25342
  o.next = 8;
@@ -25360,7 +25360,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25360
25360
  for (; ; )
25361
25361
  switch (o.prev = o.next) {
25362
25362
  case 0:
25363
- return o.next = 2, c(this, lr)[lr](Sr.MIC);
25363
+ return o.next = 2, c(this, lr)[lr](Er.MIC);
25364
25364
  case 2:
25365
25365
  if (i = o.sent, !i) {
25366
25366
  o.next = 6;
@@ -25368,7 +25368,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25368
25368
  }
25369
25369
  return o.next = 6, c(this, W)[W].closeProducer(i);
25370
25370
  case 6:
25371
- (n = c(this, br)[br]) === null || n === void 0 || n.stop(), c(this, pr)[pr].delete(Sr.MIC);
25371
+ (n = c(this, br)[br]) === null || n === void 0 || n.stop(), c(this, pr)[pr].delete(Er.MIC);
25372
25372
  case 8:
25373
25373
  case "end":
25374
25374
  return o.stop();
@@ -25386,9 +25386,9 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25386
25386
  for (; ; )
25387
25387
  switch (o.prev = o.next) {
25388
25388
  case 0:
25389
- return this.logger.info("screen_sharing_stopped"), this.context.getValue("callstats").screenShareStop(), o.next = 4, c(this, lr)[lr](Sr.SCREENSHARE_VIDEO);
25389
+ return this.logger.info("screen_sharing_stopped"), this.context.getValue("callstats").screenShareStop(), o.next = 4, c(this, lr)[lr](Er.SCREENSHARE_VIDEO);
25390
25390
  case 4:
25391
- return n = o.sent, o.next = 7, c(this, lr)[lr](Sr.SCREENSHARE_AUDIO);
25391
+ return n = o.sent, o.next = 7, c(this, lr)[lr](Er.SCREENSHARE_AUDIO);
25392
25392
  case 7:
25393
25393
  if (i = o.sent, !n) {
25394
25394
  o.next = 11;
@@ -25402,7 +25402,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25402
25402
  }
25403
25403
  return o.next = 14, c(this, W)[W].closeProducer(i);
25404
25404
  case 14:
25405
- c(this, Dt)[Dt].clear(), c(this, pr)[pr].delete(Sr.SCREENSHARE_VIDEO), c(this, pr)[pr].delete(Sr.SCREENSHARE_AUDIO);
25405
+ c(this, Dt)[Dt].clear(), c(this, pr)[pr].delete(Er.SCREENSHARE_VIDEO), c(this, pr)[pr].delete(Er.SCREENSHARE_AUDIO);
25406
25406
  case 17:
25407
25407
  case "end":
25408
25408
  return o.stop();
@@ -25441,7 +25441,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25441
25441
  l.next = 7;
25442
25442
  break;
25443
25443
  }
25444
- return l.next = 3, c(this, lr)[lr](Sr.WEBCAM);
25444
+ return l.next = 3, c(this, lr)[lr](Er.WEBCAM);
25445
25445
  case 3:
25446
25446
  return a = l.sent, l.next = 6, c(this, W)[W].closeProducer(a, { stopTrack: !1 });
25447
25447
  case 6:
@@ -25451,7 +25451,7 @@ var O_ = Object.defineProperty, D_ = Object.getOwnPropertyDescriptor, Qe = funct
25451
25451
  l.next = 14;
25452
25452
  break;
25453
25453
  }
25454
- return l.next = 10, c(this, lr)[lr](Sr.SCREENSHARE_VIDEO);
25454
+ return l.next = 10, c(this, lr)[lr](Er.SCREENSHARE_VIDEO);
25455
25455
  case 10:
25456
25456
  return o = l.sent, l.next = 13, c(this, W)[W].closeProducer(o, { stopTrack: !1 });
25457
25457
  case 13:
@@ -25755,11 +25755,11 @@ function $d() {
25755
25755
  for (; ; )
25756
25756
  switch (l.prev = l.next) {
25757
25757
  case 0:
25758
- if (c(this, mu)[mu] = t, l.prev = 1, !c(this, qr)[qr]) {
25758
+ if (c(this, mu)[mu] = t, l.prev = 1, !c(this, Gr)[Gr]) {
25759
25759
  l.next = 7;
25760
25760
  break;
25761
25761
  }
25762
- return l.next = 5, c(this, qr)[qr];
25762
+ return l.next = 5, c(this, Gr)[Gr];
25763
25763
  case 5:
25764
25764
  l.next = 9;
25765
25765
  break;
@@ -25772,7 +25772,7 @@ function $d() {
25772
25772
  case 18:
25773
25773
  return l.prev = 18, l.t0 = l.catch(1), this.logger.error("Failed to complete room join", { error: l.t0 }), l.abrupt("return", { roomJoined: !1, error: l.t0 });
25774
25774
  case 22:
25775
- return l.prev = 22, c(this, qr)[qr] = null, l.finish(22);
25775
+ return l.prev = 22, c(this, Gr)[Gr] = null, l.finish(22);
25776
25776
  case 25:
25777
25777
  case "end":
25778
25778
  return l.stop();
@@ -25953,11 +25953,11 @@ var K_ = Object.defineProperty, z_ = Object.getOwnPropertyDescriptor, Ls = funct
25953
25953
  for (var i = n > 1 ? void 0 : n ? z_(e, r) : e, a = t.length - 1, o; a >= 0; a--)
25954
25954
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
25955
25955
  return n && i && K_(e, r, i), i;
25956
- }, ng = (Qi = /* @__PURE__ */ E("socketService"), Wr = /* @__PURE__ */ E("roomSocketHandler"), X = /* @__PURE__ */ E("context"), gr = /* @__PURE__ */ E("roomNodeClient"), /* @__PURE__ */ function() {
25956
+ }, ng = (Qi = /* @__PURE__ */ E("socketService"), Jr = /* @__PURE__ */ E("roomSocketHandler"), X = /* @__PURE__ */ E("context"), gr = /* @__PURE__ */ E("roomNodeClient"), /* @__PURE__ */ function() {
25957
25957
  function s(t, e, r, n) {
25958
- P(this, s), Object.defineProperty(this, gr, { get: Q_, set: void 0 }), this.self = void 0, this.authToken = void 0, Object.defineProperty(this, Qi, { writable: !0, value: void 0 }), this.viewType = void 0, Object.defineProperty(this, Wr, { writable: !0, value: void 0 }), Object.defineProperty(this, X, { writable: !0, value: void 0 });
25958
+ P(this, s), Object.defineProperty(this, gr, { get: Q_, set: void 0 }), this.self = void 0, this.authToken = void 0, Object.defineProperty(this, Qi, { writable: !0, value: void 0 }), this.viewType = void 0, Object.defineProperty(this, Jr, { writable: !0, value: void 0 }), Object.defineProperty(this, X, { writable: !0, value: void 0 });
25959
25959
  var i = r.socket, a = t.getValue("authToken");
25960
- this.self = e, c(this, X)[X] = t, this.viewType = n, this.authToken = a, c(this, Qi)[Qi] = i, c(this, Wr)[Wr] = r, this.setupEvents();
25960
+ this.self = e, c(this, X)[X] = t, this.viewType = n, this.authToken = a, c(this, Qi)[Qi] = i, c(this, Jr)[Jr] = r, this.setupEvents();
25961
25961
  }
25962
25962
  return S(s, [{ key: "peerId", get: function() {
25963
25963
  return c(this, X)[X].getValue("peerId");
@@ -26128,17 +26128,17 @@ var K_ = Object.defineProperty, z_ = Object.getOwnPropertyDescriptor, Ls = funct
26128
26128
  }
26129
26129
  }), c(this, X)[X].getValue("peerSessionStore").on(F.SOCKET_SERVICE_FAILED, function() {
26130
26130
  e.self.roomState = "failed", e.self.emit("roomLeft", { state: "failed" });
26131
- }), c(this, Wr)[Wr].on(Q.waitingRoomRequestAccepted, function() {
26131
+ }), c(this, Jr)[Jr].on(Q.waitingRoomRequestAccepted, function() {
26132
26132
  e.waitlistAcceptHandler();
26133
- }), c(this, Wr)[Wr].on(cc.updateUserPreset, function(r) {
26133
+ }), c(this, Jr)[Jr].on(cc.updateUserPreset, function(r) {
26134
26134
  r.updatePeersPresets.forEach(function(n) {
26135
26135
  n.userIds === e.self.userId && c(e, X)[X].getValue("peerSessionStore").emit(F.UPDATE_PERMISSIONS, n.patch);
26136
26136
  });
26137
- }), c(this, Wr)[Wr].on(Q.waitingRoomRequestDenied, function() {
26137
+ }), c(this, Jr)[Jr].on(Q.waitingRoomRequestDenied, function() {
26138
26138
  e.waitlistRejectedHandler();
26139
- }), c(this, Wr)[Wr].on(Q.kick, function() {
26139
+ }), c(this, Jr)[Jr].on(Q.kick, function() {
26140
26140
  e.kickHandler({ kickType: "kick" });
26141
- }), c(this, Wr)[Wr].on(Q.kickAll, function() {
26141
+ }), c(this, Jr)[Jr].on(Q.kickAll, function() {
26142
26142
  e.kickHandler({ kickType: "kickAll" });
26143
26143
  }), c(this, X)[X].getValue("peerSessionStore").onAsync(F.JOIN_MEDIA_ROOM, this.joinMediaRoom.bind(this)), c(this, X)[X].getValue("peerSessionStore").on(F.PRODUCER_SCORE_UPDATE, function(r) {
26144
26144
  var n, i = r.score, a = r.kind, o = r.appData, u = r.scoreStats, l = (n = o == null ? void 0 : o.screenShare) !== null && n !== void 0 ? n : !1;
@@ -26185,9 +26185,9 @@ var K_ = Object.defineProperty, z_ = Object.getOwnPropertyDescriptor, Ls = funct
26185
26185
  for (; ; )
26186
26186
  switch (d.prev = d.next) {
26187
26187
  case 0:
26188
- return n = u.length > 0 && u[0] !== void 0 ? u[0] : !1, d.prev = 1, d.next = 4, c(this, Wr)[Wr].joinRoom(this.self);
26188
+ return n = u.length > 0 && u[0] !== void 0 ? u[0] : !1, d.prev = 1, d.next = 4, c(this, Jr)[Jr].joinRoom(this.self);
26189
26189
  case 4:
26190
- if (i = d.sent, a = i.peer, c(this, Wr)[Wr].socket.flush(), o = vp(a.stageType), c(this, X)[X].setValue("stageStatus", o, !1), !a.waitlisted) {
26190
+ if (i = d.sent, a = i.peer, c(this, Jr)[Jr].socket.flush(), o = vp(a.stageType), c(this, X)[X].setValue("stageStatus", o, !1), !a.waitlisted) {
26191
26191
  d.next = 12;
26192
26192
  break;
26193
26193
  }
@@ -26386,7 +26386,7 @@ var K_ = Object.defineProperty, z_ = Object.getOwnPropertyDescriptor, Ls = funct
26386
26386
  for (; ; )
26387
26387
  switch (y.prev = y.next) {
26388
26388
  case 0:
26389
- return l = mt(), d = n.getValue("peerId"), p = !!n.getValue("cachedUserDetails"), y.next = 5, zr.__init__(n, a, o, u, u.name, p);
26389
+ return l = mt(), d = n.getValue("peerId"), p = !!n.getValue("cachedUserDetails"), y.next = 5, Qr.__init__(n, a, o, u, u.name, p);
26390
26390
  case 5:
26391
26391
  return v = y.sent, n.setValue("self", v), f = n.getValue("logger"), navigator.product !== "ReactNative" ? (g = !0, setTimeout(/* @__PURE__ */ m(/* @__PURE__ */ h().mark(function k() {
26392
26392
  var w;
@@ -26550,9 +26550,9 @@ var eO = Object.defineProperty, rO = Object.getOwnPropertyDescriptor, tO = funct
26550
26550
  for (var i = n > 1 ? void 0 : n ? rO(e, r) : e, a = t.length - 1, o; a >= 0; a--)
26551
26551
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
26552
26552
  return n && i && eO(e, r, i), i;
26553
- }, Or = /* @__PURE__ */ E("context"), ig = /* @__PURE__ */ function() {
26553
+ }, Dr = /* @__PURE__ */ E("context"), ig = /* @__PURE__ */ function() {
26554
26554
  function s(t, e) {
26555
- P(this, s), this.socket = void 0, Object.defineProperty(this, Or, { writable: !0, value: void 0 }), c(this, Or)[Or] = t, this.socket = e, this.handleSocketEvents(), c(this, Or)[Or].setValue("roomSocketHandler", this);
26555
+ P(this, s), this.socket = void 0, Object.defineProperty(this, Dr, { writable: !0, value: void 0 }), c(this, Dr)[Dr] = t, this.socket = e, this.handleSocketEvents(), c(this, Dr)[Dr].setValue("roomSocketHandler", this);
26556
26556
  }
26557
26557
  return S(s, [{
26558
26558
  key: "telemetry",
@@ -26562,7 +26562,7 @@ var eO = Object.defineProperty, rO = Object.getOwnPropertyDescriptor, tO = funct
26562
26562
  * Not for external use
26563
26563
  */
26564
26564
  function() {
26565
- return c(this, Or)[Or].getValue("telemetry");
26565
+ return c(this, Dr)[Dr].getValue("telemetry");
26566
26566
  }
26567
26567
  )
26568
26568
  /**
@@ -26570,7 +26570,7 @@ var eO = Object.defineProperty, rO = Object.getOwnPropertyDescriptor, tO = funct
26570
26570
  * Not for external use
26571
26571
  */
26572
26572
  }, { key: "logger", get: function() {
26573
- return c(this, Or)[Or].getValue("logger");
26573
+ return c(this, Dr)[Dr].getValue("logger");
26574
26574
  } }, { key: "cleanup", value: function() {
26575
26575
  try {
26576
26576
  var e;
@@ -26587,9 +26587,9 @@ var eO = Object.defineProperty, rO = Object.getOwnPropertyDescriptor, tO = funct
26587
26587
  case 0:
26588
26588
  return this.socket.joinAttempted = !0, a = { capabilities: [], peer: { displayName: (i = n.name) !== null && i !== void 0 ? i : "Participant", customParticipantId: n.customParticipantId, peerId: n.id, userId: n.userId, displayPictureUrl: n.picture, waitlisted: !1 }, roomUuid: "" }, o = this.socket.sendMessagePromise(Q.joinRoom, DE.toBinary(a)), k.prev = 3, k.t0 = Zs, k.next = 7, o;
26589
26589
  case 7:
26590
- return k.t1 = k.sent.payload, u = k.t0.fromBinary.call(k.t0, k.t1), l = u.peer, c(this, Or)[Or].getValue("connectionHandler").socketJoined = !0, c(this, Or)[Or].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_ROOM_JOINED, { peer: l }), d = this.getRoomState(), p = this.getRoomPeersNonPaginated(), k.next = 16, Promise.all([d, p]);
26590
+ return k.t1 = k.sent.payload, u = k.t0.fromBinary.call(k.t0, k.t1), l = u.peer, c(this, Dr)[Dr].getValue("connectionHandler").socketJoined = !0, c(this, Dr)[Dr].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_ROOM_JOINED, { peer: l }), d = this.getRoomState(), p = this.getRoomPeersNonPaginated(), k.next = 16, Promise.all([d, p]);
26591
26591
  case 16:
26592
- return v = k.sent, f = je(v, 2), g = f[0].room, b = f[1].peers, c(this, Or)[Or].getValue("peerSessionStore").emit(F.ROOM_STATE, g), c(this, Or)[Or].getValue("peerSessionStore").emit(F.SOCKET_PEERS, b), k.abrupt("return", { peer: l });
26592
+ return v = k.sent, f = je(v, 2), g = f[0].room, b = f[1].peers, c(this, Dr)[Dr].getValue("peerSessionStore").emit(F.ROOM_STATE, g), c(this, Dr)[Dr].getValue("peerSessionStore").emit(F.SOCKET_PEERS, b), k.abrupt("return", { peer: l });
26593
26593
  case 25:
26594
26594
  throw k.prev = 25, k.t2 = k.catch(3), this.logger.error("RoomSocketHandler.joinRoom.failed", { error: k.t2 }), k.t2;
26595
26595
  case 29:
@@ -26952,7 +26952,7 @@ var eO = Object.defineProperty, rO = Object.getOwnPropertyDescriptor, tO = funct
26952
26952
  var n = r.payload;
26953
26953
  try {
26954
26954
  var i = Ro.fromBinary(n);
26955
- c(e, Or)[Or].getValue("peerSessionStore").emit(F.ROOM_MESSAGE, { payload: JSON.parse(new TextDecoder().decode(i.payload)), type: i.type, timestamp: i.timestamp });
26955
+ c(e, Dr)[Dr].getValue("peerSessionStore").emit(F.ROOM_MESSAGE, { payload: JSON.parse(new TextDecoder().decode(i.payload)), type: i.type, timestamp: i.timestamp });
26956
26956
  } catch (a) {
26957
26957
  e.logger.error("failed to decode broadcast message:", a);
26958
26958
  }
@@ -26960,7 +26960,7 @@ var eO = Object.defineProperty, rO = Object.getOwnPropertyDescriptor, tO = funct
26960
26960
  var n = r.payload;
26961
26961
  try {
26962
26962
  var i = Ro.fromBinary(n);
26963
- c(e, Or)[Or].getValue("peerSessionStore").emit(F.MESSAGE, { payload: JSON.parse(new TextDecoder().decode(i.payload)), type: i.type, timestamp: i.timestamp });
26963
+ c(e, Dr)[Dr].getValue("peerSessionStore").emit(F.MESSAGE, { payload: JSON.parse(new TextDecoder().decode(i.payload)), type: i.type, timestamp: i.timestamp });
26964
26964
  } catch (a) {
26965
26965
  e.logger.error("failed to decode peer broadcast message:", a);
26966
26966
  }
@@ -27557,18 +27557,18 @@ var Yi = { debug: 0, info: 1, warn: 2, error: 3 }, ls, ds, yO = /* @__PURE__ */
27557
27557
  ls = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap();
27558
27558
  var vg = /* @__PURE__ */ function(s) {
27559
27559
  return s[s.CONNECTING = 0] = "CONNECTING", s[s.OPEN = 1] = "OPEN", s[s.CLOSING = 2] = "CLOSING", s[s.CLOSED = 3] = "CLOSED", s;
27560
- }(vg || {}), kO = "2", bO = "3", Er, eo, mr, Dr, ea, Kr, wi, ua, yn, ro, gi, Ud, fg, su, pc, jd, gg, Fd, Qh, Rc, Hd, Bd, mg, ku, hc, bu, Ac, Ic, qd, uo, Tu, wu, Mc, TO = /* @__PURE__ */ function() {
27560
+ }(vg || {}), kO = "2", bO = "3", Cr, eo, mr, $r, ea, zr, wi, ua, yn, ro, gi, Ud, fg, su, pc, jd, gg, Fd, Qh, Rc, Hd, Bd, mg, ku, hc, bu, Ac, Ic, qd, uo, Tu, wu, Mc, TO = /* @__PURE__ */ function() {
27561
27561
  function s(t, e) {
27562
27562
  var r, n, i, a, o, u, l, d, p, v;
27563
- P(this, s), dr(this, Ud), dr(this, su), dr(this, jd), dr(this, Fd), dr(this, Rc), dr(this, Bd), dr(this, ku), dr(this, bu), dr(this, Ic), dr(this, uo), dr(this, wu), dr(this, Er, void 0), dr(this, eo, void 0), dr(this, mr, void 0), dr(this, Dr, void 0), dr(this, ea, void 0), dr(this, Kr, void 0), dr(this, wi, void 0), dr(this, ua, void 0), dr(this, yn, void 0), dr(this, ro, void 0), dr(this, gi, void 0);
27563
+ P(this, s), dr(this, Ud), dr(this, su), dr(this, jd), dr(this, Fd), dr(this, Rc), dr(this, Bd), dr(this, ku), dr(this, bu), dr(this, Ic), dr(this, uo), dr(this, wu), dr(this, Cr, void 0), dr(this, eo, void 0), dr(this, mr, void 0), dr(this, $r, void 0), dr(this, ea, void 0), dr(this, zr, void 0), dr(this, wi, void 0), dr(this, ua, void 0), dr(this, yn, void 0), dr(this, ro, void 0), dr(this, gi, void 0);
27564
27564
  var f, g, b, y, k, w, T, A, M;
27565
- We(this, eo, t), We(this, ea, []), We(this, Kr, new Cc()), We(this, wi, !0), We(this, yn, !1), We(this, mr, e != null ? e : {}), (r = (f = G(this, mr)).autoReconnect) !== null && r !== void 0 || (f.autoReconnect = !0), (n = (g = G(this, mr)).retryConnectionInterval) !== null && n !== void 0 || (g.retryConnectionInterval = 1e3), (i = (b = G(this, mr)).pingTimeout) !== null && i !== void 0 || (b.pingTimeout = 3e4), (a = (y = G(this, mr)).connectionTimeout) !== null && a !== void 0 || (y.connectionTimeout = 5e3), (o = (k = G(this, mr)).debug) !== null && o !== void 0 || (k.debug = !0), (u = (w = G(this, mr)).maxReconnectionAttempts) !== null && u !== void 0 || (w.maxReconnectionAttempts = 10), (l = (T = G(this, mr)).disconnectOnPingTimeout) !== null && l !== void 0 || (T.disconnectOnPingTimeout = !0), (d = (A = G(this, mr)).queueOnDisconnect) !== null && d !== void 0 || (A.queueOnDisconnect = !1), (p = (M = G(this, mr)).flushOnReconnect) !== null && p !== void 0 || (M.flushOnReconnect = !1), We(this, ua, { code: void 0, reason: void 0 }), We(this, Dr, (v = G(this, mr).logger) !== null && v !== void 0 ? v : new yO(G(this, mr).debug ? "debug" : "info")), We(this, gi, new mO());
27565
+ We(this, eo, t), We(this, ea, []), We(this, zr, new Cc()), We(this, wi, !0), We(this, yn, !1), We(this, mr, e != null ? e : {}), (r = (f = G(this, mr)).autoReconnect) !== null && r !== void 0 || (f.autoReconnect = !0), (n = (g = G(this, mr)).retryConnectionInterval) !== null && n !== void 0 || (g.retryConnectionInterval = 1e3), (i = (b = G(this, mr)).pingTimeout) !== null && i !== void 0 || (b.pingTimeout = 3e4), (a = (y = G(this, mr)).connectionTimeout) !== null && a !== void 0 || (y.connectionTimeout = 5e3), (o = (k = G(this, mr)).debug) !== null && o !== void 0 || (k.debug = !0), (u = (w = G(this, mr)).maxReconnectionAttempts) !== null && u !== void 0 || (w.maxReconnectionAttempts = 10), (l = (T = G(this, mr)).disconnectOnPingTimeout) !== null && l !== void 0 || (T.disconnectOnPingTimeout = !0), (d = (A = G(this, mr)).queueOnDisconnect) !== null && d !== void 0 || (A.queueOnDisconnect = !1), (p = (M = G(this, mr)).flushOnReconnect) !== null && p !== void 0 || (M.flushOnReconnect = !1), We(this, ua, { code: void 0, reason: void 0 }), We(this, $r, (v = G(this, mr).logger) !== null && v !== void 0 ? v : new yO(G(this, mr).debug ? "debug" : "info")), We(this, gi, new mO());
27566
27566
  }
27567
27567
  return S(s, [{
27568
27568
  key: "readyState",
27569
27569
  get: function() {
27570
27570
  var e;
27571
- return (e = G(this, Er)) == null ? void 0 : e.readyState;
27571
+ return (e = G(this, Cr)) == null ? void 0 : e.readyState;
27572
27572
  }
27573
27573
  /**
27574
27574
  * Sockrates connection URL.
@@ -27632,7 +27632,7 @@ var vg = /* @__PURE__ */ function(s) {
27632
27632
  u.next = 4;
27633
27633
  break;
27634
27634
  }
27635
- return G(this, Dr).debug("Websocket was already connecting or connected."), u.abrupt("return");
27635
+ return G(this, $r).debug("Websocket was already connecting or connected."), u.abrupt("return");
27636
27636
  case 4:
27637
27637
  if (G(this, wi) === !1) {
27638
27638
  u.next = 6;
@@ -27641,29 +27641,29 @@ var vg = /* @__PURE__ */ function(s) {
27641
27641
  return u.abrupt("return", new Promise(function(l, d) {
27642
27642
  yr(n, uo, Tu).call(n), yr(n, wu, Mc).call(n);
27643
27643
  try {
27644
- We(n, Er, new WebSocket(yr(n, Ud, fg).call(n, G(n, eo)))), G(n, Er).binaryType = "arraybuffer", G(n, Dr).debug("Connecting");
27644
+ We(n, Cr, new WebSocket(yr(n, Ud, fg).call(n, G(n, eo)))), G(n, Cr).binaryType = "arraybuffer", G(n, $r).debug("Connecting");
27645
27645
  var p = setTimeout(function() {
27646
- G(n, Dr).debug("Connection timeout. Closing socket"), We(n, wi, !0), yr(n, wu, Mc).call(n), G(n, Er).close(3001, "Connection Timeout"), G(n, mr).autoReconnect && !G(n, yn) && (G(n, Kr).emit(
27646
+ G(n, $r).debug("Connection timeout. Closing socket"), We(n, wi, !0), yr(n, wu, Mc).call(n), G(n, Cr).close(3001, "Connection Timeout"), G(n, mr).autoReconnect && !G(n, yn) && (G(n, zr).emit(
27647
27647
  "reconnecting"
27648
27648
  /* reconnecting */
27649
27649
  ), yr(n, ku, hc).call(n)), d(new Error("Connection timed out!"));
27650
27650
  }, G(n, mr).connectionTimeout);
27651
- G(n, Er).onopen = function() {
27652
- G(n, Dr).debug("Ready State: ".concat(vg[G(n, Er).readyState])), p && clearTimeout(p), yr(n, Ic, qd).call(n), We(n, ua, { code: void 0, reason: void 0 }), G(n, Kr).emit(
27651
+ G(n, Cr).onopen = function() {
27652
+ G(n, $r).debug("Ready State: ".concat(vg[G(n, Cr).readyState])), p && clearTimeout(p), yr(n, Ic, qd).call(n), We(n, ua, { code: void 0, reason: void 0 }), G(n, zr).emit(
27653
27653
  "connected"
27654
27654
  /* connected */
27655
27655
  ), G(n, mr).flushOnReconnect && n.flush(), l();
27656
- }, G(n, Er).onclose = function(v) {
27656
+ }, G(n, Cr).onclose = function(v) {
27657
27657
  try {
27658
27658
  p && clearTimeout(p);
27659
27659
  var f = v.code, g = v.reason;
27660
- d(g), G(n, Dr).debug("Socket closed. Close event:", { event: v }), G(n, Dr).debug("Connection closed code: ".concat(f)), G(n, Dr).debug("Connection closed reason: ".concat(g)), G(n, yn) || yr(n, Rc, Hd).call(n, f, g);
27660
+ d(g), G(n, $r).debug("Socket closed. Close event:", { event: v }), G(n, $r).debug("Connection closed code: ".concat(f)), G(n, $r).debug("Connection closed reason: ".concat(g)), G(n, yn) || yr(n, Rc, Hd).call(n, f, g);
27661
27661
  } catch (b) {
27662
27662
  yr(n, su, pc).call(n, b);
27663
27663
  }
27664
- }, G(n, Er).onerror = function(v) {
27664
+ }, G(n, Cr).onerror = function(v) {
27665
27665
  yr(n, su, pc).call(n, v);
27666
- }, G(n, Er).onmessage = function(v) {
27666
+ }, G(n, Cr).onmessage = function(v) {
27667
27667
  return yr(n, jd, gg).call(n, v);
27668
27668
  };
27669
27669
  } catch (v) {
@@ -27689,8 +27689,8 @@ var vg = /* @__PURE__ */ function(s) {
27689
27689
  key: "send",
27690
27690
  value: function(e, r, n, i) {
27691
27691
  var a = { event: e, id: r, payload: n, metadata: i };
27692
- if (G(this, mr).queueOnDisconnect && (!G(this, Er) || G(this, Er).readyState !== 1))
27693
- return G(this, Dr).debug("Queuing message since socket is not connected!", a), G(this, ea).push(a), !1;
27692
+ if (G(this, mr).queueOnDisconnect && (!G(this, Cr) || G(this, Cr).readyState !== 1))
27693
+ return G(this, $r).debug("Queuing message since socket is not connected!", a), G(this, ea).push(a), !1;
27694
27694
  var o = hg.encode(a);
27695
27695
  return yr(this, bu, Ac).call(this, o);
27696
27696
  }
@@ -27716,7 +27716,7 @@ var vg = /* @__PURE__ */ function(s) {
27716
27716
  }, {
27717
27717
  key: "receive",
27718
27718
  value: function(e, r) {
27719
- return G(this, Kr).on(e.toString(), r);
27719
+ return G(this, zr).on(e.toString(), r);
27720
27720
  }
27721
27721
  /**
27722
27722
  * Event listener that is fired on receiving socket messages.
@@ -27725,7 +27725,7 @@ var vg = /* @__PURE__ */ function(s) {
27725
27725
  key: "on",
27726
27726
  value: function(e, r) {
27727
27727
  if (typeof e == "string" && (e === "connected" || e === "disconnected" || e === "errored" || e === "reconnected" || e === "reconnecting" || e === "reconnectAttempt" || e === "reconnectFailure" || e === "failed")) {
27728
- G(this, Kr).on(e, r);
27728
+ G(this, zr).on(e, r);
27729
27729
  return;
27730
27730
  }
27731
27731
  this.receive(e, r);
@@ -27736,7 +27736,7 @@ var vg = /* @__PURE__ */ function(s) {
27736
27736
  }, {
27737
27737
  key: "removeAllListeners",
27738
27738
  value: function() {
27739
- G(this, Kr).removeAllListeners();
27739
+ G(this, zr).removeAllListeners();
27740
27740
  }
27741
27741
  /**
27742
27742
  * Alias to `removeListener`.
@@ -27752,7 +27752,7 @@ var vg = /* @__PURE__ */ function(s) {
27752
27752
  }, {
27753
27753
  key: "removeListener",
27754
27754
  value: function(e, r) {
27755
- G(this, Kr).removeListener(e.toString(), r);
27755
+ G(this, zr).removeListener(e.toString(), r);
27756
27756
  }
27757
27757
  /**
27758
27758
  * Alias to `removeListeners`.
@@ -27769,7 +27769,7 @@ var vg = /* @__PURE__ */ function(s) {
27769
27769
  key: "removeListeners",
27770
27770
  value: function(e) {
27771
27771
  var r = this;
27772
- G(this, Kr).listeners(e.toString()).map(function(n) {
27772
+ G(this, zr).listeners(e.toString()).map(function(n) {
27773
27773
  return r.removeListener(e, n);
27774
27774
  });
27775
27775
  }
@@ -27777,10 +27777,10 @@ var vg = /* @__PURE__ */ function(s) {
27777
27777
  * Disconnect the socket.
27778
27778
  */
27779
27779
  }, { key: "disconnect", value: function() {
27780
- We(this, wi, !1), yr(this, uo, Tu).call(this), this.removeAllListeners(), We(this, ua, { code: 1e3, reason: "Sockrates disconnect method called" }), G(this, Er).close(1e3, "Sockrates disconnect method called.");
27780
+ We(this, wi, !1), yr(this, uo, Tu).call(this), this.removeAllListeners(), We(this, ua, { code: 1e3, reason: "Sockrates disconnect method called" }), G(this, Cr).close(1e3, "Sockrates disconnect method called.");
27781
27781
  } }]);
27782
27782
  }();
27783
- Er = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap(), Dr = /* @__PURE__ */ new WeakMap(), ea = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), ua = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), gi = /* @__PURE__ */ new WeakMap(), Ud = /* @__PURE__ */ new WeakSet(), fg = function(t) {
27783
+ Cr = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakMap(), ea = /* @__PURE__ */ new WeakMap(), zr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), ua = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), gi = /* @__PURE__ */ new WeakMap(), Ud = /* @__PURE__ */ new WeakSet(), fg = function(t) {
27784
27784
  if (t.startsWith("ws://") || t.startsWith("wss://"))
27785
27785
  return t;
27786
27786
  if (t.startsWith("https://"))
@@ -27789,21 +27789,21 @@ Er = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /*
27789
27789
  return "ws://".concat(t.substring(7));
27790
27790
  throw new Error("Invalid URL. URL must start with http(s):// or ws(s)://.");
27791
27791
  }, su = /* @__PURE__ */ new WeakSet(), pc = function(t, e) {
27792
- G(this, Dr).error("Error:", { error: t }), G(this, Kr).emit("errored", { error: t }), e == null || e(t);
27792
+ G(this, $r).error("Error:", { error: t }), G(this, zr).emit("errored", { error: t }), e == null || e(t);
27793
27793
  }, jd = /* @__PURE__ */ new WeakSet(), gg = function(t) {
27794
27794
  if (yr(this, Ic, qd).call(this), t.data === kO) {
27795
- G(this, Dr).debug("Received ping from server"), yr(this, bu, Ac).call(this, bO);
27795
+ G(this, $r).debug("Received ping from server"), yr(this, bu, Ac).call(this, bO);
27796
27796
  return;
27797
27797
  }
27798
27798
  var e = hg.decode(t.data), r = e.id, n = e.payload;
27799
- G(this, Dr).debug("Received message", { event: e.event, messageID: r }), G(this, Kr).emit(e.event.toString(), { id: r, payload: n });
27799
+ G(this, $r).debug("Received message", { event: e.event, messageID: r }), G(this, zr).emit(e.event.toString(), { id: r, payload: n });
27800
27800
  }, Fd = /* @__PURE__ */ new WeakSet(), Qh = function() {
27801
- return G(this, Er).readyState === 1;
27801
+ return G(this, Cr).readyState === 1;
27802
27802
  }, Rc = /* @__PURE__ */ new WeakSet(), Hd = function(t, e) {
27803
- We(this, ua, { reason: e, code: t }), G(this, Kr).emit("disconnected", { code: t, reason: e });
27803
+ We(this, ua, { reason: e, code: t }), G(this, zr).emit("disconnected", { code: t, reason: e });
27804
27804
  }, Bd = /* @__PURE__ */ new WeakSet(), mg = function() {
27805
27805
  var t = G(this, ua), e = t.reason, r = t.code;
27806
- r && r !== 1e3 && G(this, wi) && G(this, mr).autoReconnect && !G(this, yn) && (G(this, Dr).debug("Triggering reconnection due to ".concat(e, ".")), G(this, Kr).emit(
27806
+ r && r !== 1e3 && G(this, wi) && G(this, mr).autoReconnect && !G(this, yn) && (G(this, $r).debug("Triggering reconnection due to ".concat(e, ".")), G(this, zr).emit(
27807
27807
  "reconnecting"
27808
27808
  /* reconnecting */
27809
27809
  ), yr(this, ku, hc).call(this));
@@ -27818,13 +27818,13 @@ Er = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /*
27818
27818
  i.next = 4;
27819
27819
  break;
27820
27820
  }
27821
- return G(this, Dr).debug("Reconnect called when already in a reconnect loop. Ignoring."), i.abrupt("return");
27821
+ return G(this, $r).debug("Reconnect called when already in a reconnect loop. Ignoring."), i.abrupt("return");
27822
27822
  case 4:
27823
27823
  if (G(this, yn) || G(this, gi).reset(), !(G(this, mr).maxReconnectionAttempts !== null && G(this, gi).getAttempts() >= G(this, mr).maxReconnectionAttempts)) {
27824
27824
  i.next = 7;
27825
27825
  break;
27826
27826
  }
27827
- return G(this, Kr).emit(
27827
+ return G(this, zr).emit(
27828
27828
  "failed"
27829
27829
  /* failed */
27830
27830
  ), We(this, yn, !1), i.abrupt("return");
@@ -27837,7 +27837,7 @@ Er = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /*
27837
27837
  }
27838
27838
  return i.abrupt("return");
27839
27839
  case 13:
27840
- return G(this, Dr).debug("Reconnection attempt ".concat(G(this, gi).getAttempts())), G(this, Kr).emit("reconnectAttempt", { attempt: G(this, gi).getAttempts() }), i.next = 17, this.connect();
27840
+ return G(this, $r).debug("Reconnection attempt ".concat(G(this, gi).getAttempts())), G(this, zr).emit("reconnectAttempt", { attempt: G(this, gi).getAttempts() }), i.next = 17, this.connect();
27841
27841
  case 17:
27842
27842
  if (yr(this, Fd, Qh).call(this)) {
27843
27843
  i.next = 19;
@@ -27845,13 +27845,13 @@ Er = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /*
27845
27845
  }
27846
27846
  throw Error("Reconnect Failed");
27847
27847
  case 19:
27848
- We(this, yn, !1), We(this, ua, { code: void 0, reason: void 0 }), G(this, Kr).emit(
27848
+ We(this, yn, !1), We(this, ua, { code: void 0, reason: void 0 }), G(this, zr).emit(
27849
27849
  "reconnected"
27850
27850
  /* reconnected */
27851
27851
  ), i.next = 25;
27852
27852
  break;
27853
27853
  case 22:
27854
- i.prev = 22, i.t0 = i.catch(8), G(this, Dr).debug("Failed to reconnect."), G(this, Kr).emit("reconnectFailure", { attempt: G(this, gi).getAttempts() }), yr(this, ku, hc).call(this, !1);
27854
+ i.prev = 22, i.t0 = i.catch(8), G(this, $r).debug("Failed to reconnect."), G(this, zr).emit("reconnectFailure", { attempt: G(this, gi).getAttempts() }), yr(this, ku, hc).call(this, !1);
27855
27855
  case 25:
27856
27856
  case "end":
27857
27857
  return i.stop();
@@ -27863,33 +27863,33 @@ Er = /* @__PURE__ */ new WeakMap(), eo = /* @__PURE__ */ new WeakMap(), mr = /*
27863
27863
  };
27864
27864
  }(), bu = /* @__PURE__ */ new WeakSet(), Ac = function(t) {
27865
27865
  try {
27866
- return G(this, Er).send(t), !0;
27866
+ return G(this, Cr).send(t), !0;
27867
27867
  } catch (e) {
27868
- return G(this, Dr).error(e.message), !1;
27868
+ return G(this, $r).error(e.message), !1;
27869
27869
  }
27870
27870
  }, Ic = /* @__PURE__ */ new WeakSet(), qd = function() {
27871
27871
  var t = this;
27872
- this.config.disconnectOnPingTimeout && (G(this, Dr).debug("Resetting ping timeout"), yr(this, uo, Tu).call(this), We(this, ro, setTimeout(function() {
27872
+ this.config.disconnectOnPingTimeout && (G(this, $r).debug("Resetting ping timeout"), yr(this, uo, Tu).call(this), We(this, ro, setTimeout(function() {
27873
27873
  var e;
27874
- G(t, Dr).debug("Disconnecting the socket due to ping timeout"), We(t, wi, !0);
27874
+ G(t, $r).debug("Disconnecting the socket due to ping timeout"), We(t, wi, !0);
27875
27875
  var r = 3002, n = "Ping timeout";
27876
- (e = G(t, Er)) == null || e.close(r, n), yr(t, Rc, Hd).call(t, r, n);
27876
+ (e = G(t, Cr)) == null || e.close(r, n), yr(t, Rc, Hd).call(t, r, n);
27877
27877
  }, G(this, mr).pingTimeout)));
27878
27878
  }, uo = /* @__PURE__ */ new WeakSet(), Tu = function() {
27879
27879
  G(this, ro) && (clearTimeout(G(this, ro)), We(this, ro, void 0));
27880
27880
  }, wu = /* @__PURE__ */ new WeakSet(), Mc = function() {
27881
- G(this, Er) && (G(this, Er).onopen = void 0, G(this, Er).onerror = void 0, G(this, Er).onmessage = void 0, G(this, Er).onclose = void 0);
27881
+ G(this, Cr) && (G(this, Cr).onopen = void 0, G(this, Cr).onerror = void 0, G(this, Cr).onmessage = void 0, G(this, Cr).onclose = void 0);
27882
27882
  };
27883
27883
  var wO = Object.defineProperty, PO = Object.getOwnPropertyDescriptor, Xc = function(t, e, r, n) {
27884
27884
  for (var i = n > 1 ? void 0 : n ? PO(e, r) : e, a = t.length - 1, o; a >= 0; a--)
27885
27885
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
27886
27886
  return n && i && wO(e, r, i), i;
27887
- }, Yh = 65535, SO = 3e3, yg = (Qt = /* @__PURE__ */ E("url"), ye = /* @__PURE__ */ E("sockrates"), ke = /* @__PURE__ */ E("connectionHandler"), Nr = /* @__PURE__ */ E("socketDisconnectionTimeout"), Ue = /* @__PURE__ */ E("context"), zs = /* @__PURE__ */ E("getSocketURL"), Qs = /* @__PURE__ */ E("generateId"), /* @__PURE__ */ function() {
27887
+ }, Yh = 65535, SO = 3e3, yg = (Qt = /* @__PURE__ */ E("url"), ye = /* @__PURE__ */ E("sockrates"), ke = /* @__PURE__ */ E("connectionHandler"), Vr = /* @__PURE__ */ E("socketDisconnectionTimeout"), Ue = /* @__PURE__ */ E("context"), zs = /* @__PURE__ */ E("getSocketURL"), Qs = /* @__PURE__ */ E("generateId"), /* @__PURE__ */ function() {
27888
27888
  function s(t, e) {
27889
27889
  var r, n = e.peerId, i = e.meetingId, a = e.authToken, o = e.capabilities;
27890
- if (P(this, s), Object.defineProperty(this, Qs, { value: RO }), Object.defineProperty(this, zs, { value: CO }), Object.defineProperty(this, ke, { get: EO, set: void 0 }), Object.defineProperty(this, Qt, { writable: !0, value: void 0 }), Object.defineProperty(this, ye, { writable: !0, value: void 0 }), this.roomName = void 0, this.authToken = void 0, this.capabilities = void 0, Object.defineProperty(this, Nr, { writable: !0, value: void 0 }), Object.defineProperty(this, Ue, { writable: !0, value: void 0 }), !n || !i || !a)
27890
+ if (P(this, s), Object.defineProperty(this, Qs, { value: RO }), Object.defineProperty(this, zs, { value: CO }), Object.defineProperty(this, ke, { get: EO, set: void 0 }), Object.defineProperty(this, Qt, { writable: !0, value: void 0 }), Object.defineProperty(this, ye, { writable: !0, value: void 0 }), this.roomName = void 0, this.authToken = void 0, this.capabilities = void 0, Object.defineProperty(this, Vr, { writable: !0, value: void 0 }), Object.defineProperty(this, Ue, { writable: !0, value: void 0 }), !n || !i || !a)
27891
27891
  throw new H("peerId, meetingId, or authToken can not be empty", "0404");
27892
- c(this, Nr)[Nr] = void 0, c(this, Ue)[Ue] = t, this.capabilities = o, this.roomName = i, this.authToken = a, c(this, Qt)[Qt] = c(this, zs)[zs](n), c(this, ye)[ye] = new TO(c(this, Qt)[Qt], { autoReconnect: !0, disconnectOnPingTimeout: (r = o.includes("PING")) !== null && r !== void 0 ? r : !1, queueOnDisconnect: !0, flushOnReconnect: !1, logger: this.logger }), this.handleSocketConnectionEvents();
27892
+ c(this, Vr)[Vr] = void 0, c(this, Ue)[Ue] = t, this.capabilities = o, this.roomName = i, this.authToken = a, c(this, Qt)[Qt] = c(this, zs)[zs](n), c(this, ye)[ye] = new TO(c(this, Qt)[Qt], { autoReconnect: !0, disconnectOnPingTimeout: (r = o.includes("PING")) !== null && r !== void 0 ? r : !1, queueOnDisconnect: !0, flushOnReconnect: !1, logger: this.logger }), this.handleSocketConnectionEvents();
27893
27893
  }
27894
27894
  return S(s, [{ key: "joinAttempted", get: function() {
27895
27895
  return c(this, ke)[ke].socketJoinAttempted;
@@ -28001,7 +28001,7 @@ var wO = Object.defineProperty, PO = Object.getOwnPropertyDescriptor, Xc = funct
28001
28001
  for (; ; )
28002
28002
  switch (i.prev = i.next) {
28003
28003
  case 0:
28004
- e.logger.info("SocketService::Connected to socket-edge"), c(e, Nr)[Nr] && (clearTimeout(c(e, Nr)[Nr]), c(e, Nr)[Nr] = void 0), c(e, ke)[ke].updateSocketConnectionState("connected");
28004
+ e.logger.info("SocketService::Connected to socket-edge"), c(e, Vr)[Vr] && (clearTimeout(c(e, Vr)[Vr]), c(e, Vr)[Vr] = void 0), c(e, ke)[ke].updateSocketConnectionState("connected");
28005
28005
  case 3:
28006
28006
  case "end":
28007
28007
  return i.stop();
@@ -28011,8 +28011,8 @@ var wO = Object.defineProperty, PO = Object.getOwnPropertyDescriptor, Xc = funct
28011
28011
  var n, i = r.code, a = r.reason;
28012
28012
  e.logger.info("SocketService::Disconnected from socket-edge", { error: { code: i, reason: a } });
28013
28013
  var o = (n = c(e, ke)[ke].mediaState) !== null && n !== void 0 ? n : {}, u = o.recv, l = o.send;
28014
- u != null && u.state && (u == null ? void 0 : u.state) !== fo.CONNECTED || l != null && l.state && (l == null ? void 0 : l.state) !== fo.CONNECTED ? c(e, Ue)[Ue].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: c(e, ke)[ke].joinAttempted }) : c(e, Nr)[Nr] = setTimeout(function() {
28015
- c(e, Ue)[Ue].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: c(e, ke)[ke].joinAttempted }), c(e, Nr)[Nr] = void 0;
28014
+ u != null && u.state && (u == null ? void 0 : u.state) !== fo.CONNECTED || l != null && l.state && (l == null ? void 0 : l.state) !== fo.CONNECTED ? c(e, Ue)[Ue].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: c(e, ke)[ke].joinAttempted }) : c(e, Vr)[Vr] = setTimeout(function() {
28015
+ c(e, Ue)[Ue].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: c(e, ke)[ke].joinAttempted }), c(e, Vr)[Vr] = void 0;
28016
28016
  }, SO), c(e, ke)[ke].updateSocketConnectionState("disconnected");
28017
28017
  }), this.onStateEvent("reconnecting", /* @__PURE__ */ m(/* @__PURE__ */ h().mark(function r() {
28018
28018
  return h().wrap(function(i) {
@@ -28050,7 +28050,7 @@ var wO = Object.defineProperty, PO = Object.getOwnPropertyDescriptor, Xc = funct
28050
28050
  for (; ; )
28051
28051
  switch (i.prev = i.next) {
28052
28052
  case 0:
28053
- e.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: c(e, ke)[ke].mediaJoinAttempted } }), c(e, Nr)[Nr] && (clearTimeout(c(e, Nr)[Nr]), c(e, Nr)[Nr] = void 0), c(e, Ue)[Ue].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_RECONNECTED, { wasJoinAttempted: c(e, ke)[ke].mediaJoinAttempted }), c(e, ke)[ke].updateSocketConnectionState("reconnected");
28053
+ e.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: c(e, ke)[ke].mediaJoinAttempted } }), c(e, Vr)[Vr] && (clearTimeout(c(e, Vr)[Vr]), c(e, Vr)[Vr] = void 0), c(e, Ue)[Ue].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_RECONNECTED, { wasJoinAttempted: c(e, ke)[ke].mediaJoinAttempted }), c(e, ke)[ke].updateSocketConnectionState("reconnected");
28054
28054
  case 4:
28055
28055
  case "end":
28056
28056
  return i.stop();
@@ -28250,22 +28250,42 @@ var AO = /* @__PURE__ */ function() {
28250
28250
  for (var i = n > 1 ? void 0 : n ? MO(e, r) : e, a = t.length - 1, o; a >= 0; a--)
28251
28251
  (o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
28252
28252
  return n && i && IO(e, r, i), i;
28253
- }, Zr = /* @__PURE__ */ E("context"), kg = /* @__PURE__ */ function(s) {
28253
+ }, wr = /* @__PURE__ */ E("context"), kg = /* @__PURE__ */ function(s) {
28254
28254
  function t(e) {
28255
28255
  var r;
28256
28256
  P(this, t);
28257
28257
  var n = e.getValue("logger");
28258
- return r = C(this, t, [n]), r.meetings = [], r.parentMeeting = null, Object.defineProperty(r, Zr, { writable: !0, value: void 0 }), c(r, Zr)[Zr] = e, r;
28258
+ return r = C(this, t, [n]), r.meetings = [], r.parentMeeting = null, Object.defineProperty(r, wr, { writable: !0, value: void 0 }), c(r, wr)[wr] = e, r;
28259
28259
  }
28260
28260
  return R(t, s), S(t, [{ key: "supportsConnectedMeetings", get: function() {
28261
- var r = c(this, Zr)[Zr].getValue("self").permissions.connectedMeetings;
28261
+ var r = c(this, wr)[wr].getValue("self").permissions.connectedMeetings;
28262
28262
  return r ? r.canAlterConnectedMeetings || r.canSwitchConnectedMeetings || r.canSwitchToParentMeeting : !1;
28263
28263
  } }, { key: "isActive", get: function() {
28264
28264
  return this.meetings.length !== 0;
28265
- } }, { key: "validateConnectedMeetingsAction", value: function() {
28266
- if (!this.supportsConnectedMeetings)
28267
- throw new Error(`You are not allowed to perform this action.
28268
- Please enable connected meetings permissions in your preset.`);
28265
+ } }, { key: "validateAlterAction", value: function() {
28266
+ var r = c(this, wr)[wr].getValue("self").permissions.connectedMeetings;
28267
+ if (!(r != null && r.canAlterConnectedMeetings))
28268
+ throw new Error("You are not allowed to perform this action. Please enable canAlterConnectedMeetings permission in your preset.");
28269
+ } }, { key: "validateMoveAction", value: function(r, n) {
28270
+ var i;
28271
+ if (!(n != null && n.length))
28272
+ throw new Error("You're trying to move participants with an empty list.");
28273
+ var a = c(this, wr)[wr].getValue("self").permissions.connectedMeetings;
28274
+ if (!a)
28275
+ throw new Error("You are not allowed to perform this action. Please enable connected meetings permissions in your preset.");
28276
+ if (!a.canAlterConnectedMeetings) {
28277
+ var o = c(this, wr)[wr].getValue("peerId"), u = n.length === 1 && n[0] === o;
28278
+ if (!u)
28279
+ throw new Error("You are not allowed to move other participants. Please enable canAlterConnectedMeetings permission in your preset.");
28280
+ var l = r === ((i = this.parentMeeting) === null || i === void 0 ? void 0 : i.id);
28281
+ if (l) {
28282
+ if (!a.canSwitchToParentMeeting)
28283
+ throw new Error("You are not allowed to move to the parent meeting. Please enable canSwitchToParentMeeting permission in your preset.");
28284
+ return;
28285
+ }
28286
+ if (!a.canSwitchConnectedMeetings)
28287
+ throw new Error("You are not allowed to move to a connected meeting. Please enable canSwitchConnectedMeetings permission in your preset.");
28288
+ }
28269
28289
  } }, {
28270
28290
  key: "getConnectedMeetings",
28271
28291
  value: function() {
@@ -28275,10 +28295,10 @@ var AO = /* @__PURE__ */ function() {
28275
28295
  for (; ; )
28276
28296
  switch (o.prev = o.next) {
28277
28297
  case 0:
28278
- return this.validateConnectedMeetingsAction(), this.logger.info("Getting connected meetings dump"), o.next = 4, c(this, Zr)[Zr].getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
28279
- case 4:
28298
+ return this.logger.info("Getting connected meetings dump"), o.next = 3, c(this, wr)[wr].getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
28299
+ case 3:
28280
28300
  return i = o.sent, this.logger.info("Got connected meetings dump"), o.abrupt("return", i);
28281
- case 7:
28301
+ case 6:
28282
28302
  case "end":
28283
28303
  return o.stop();
28284
28304
  }
@@ -28300,7 +28320,7 @@ var AO = /* @__PURE__ */ function() {
28300
28320
  for (; ; )
28301
28321
  switch (u.prev = u.next) {
28302
28322
  case 0:
28303
- return this.validateConnectedMeetingsAction(), this.logger.info("Creating connected meetings ".concat(JSON.stringify(i))), u.next = 4, c(this, Zr)[Zr].getValue("connectedMeetingsSocketHandler").createConnectedRooms(i);
28323
+ return this.validateAlterAction(), this.logger.info("Creating connected meetings ".concat(JSON.stringify(i))), u.next = 4, c(this, wr)[wr].getValue("connectedMeetingsSocketHandler").createConnectedRooms(i);
28304
28324
  case 4:
28305
28325
  return a = u.sent, this.logger.info("Created connected meetings ".concat(JSON.stringify(a))), u.abrupt("return", a.map(function(l) {
28306
28326
  return { id: l.id, title: l.title };
@@ -28321,7 +28341,7 @@ var AO = /* @__PURE__ */ function() {
28321
28341
  for (; ; )
28322
28342
  switch (o.prev = o.next) {
28323
28343
  case 0:
28324
- return this.validateConnectedMeetingsAction(), this.logger.info("Updating connected meetings ".concat(JSON.stringify(i))), o.next = 4, c(this, Zr)[Zr].getValue("connectedMeetingsSocketHandler").updateConnectedRooms(i.map(function(u) {
28344
+ return this.validateAlterAction(), this.logger.info("Updating connected meetings ".concat(JSON.stringify(i))), o.next = 4, c(this, wr)[wr].getValue("connectedMeetingsSocketHandler").updateConnectedRooms(i.map(function(u) {
28325
28345
  return { meetingId: u.id, title: u.title };
28326
28346
  }));
28327
28347
  case 4:
@@ -28343,13 +28363,13 @@ var AO = /* @__PURE__ */ function() {
28343
28363
  for (; ; )
28344
28364
  switch (d.prev = d.next) {
28345
28365
  case 0:
28346
- return this.validateConnectedMeetingsAction(), this.logger.info("Moving participants before deleting connected meetings ".concat(JSON.stringify(i))), o = this.meetings.map(function(p) {
28366
+ return this.validateAlterAction(), this.logger.info("Moving participants before deleting connected meetings ".concat(JSON.stringify(i))), o = this.meetings.map(function(p) {
28347
28367
  return i.includes(p.id) && p.participants.length !== 0 ? a.moveParticipants(p.id, a.parentMeeting.id, p.participants.map(function(v) {
28348
28368
  return v.id;
28349
28369
  })) : Promise.resolve();
28350
28370
  }), this.logger.info("Moved participants before deleting connected meetings ".concat(JSON.stringify(i), ". Deleting now.")), d.next = 6, Promise.all(o);
28351
28371
  case 6:
28352
- return d.next = 8, c(this, Zr)[Zr].getValue("connectedMeetingsSocketHandler").disableConnectedRooms(i);
28372
+ return d.next = 8, c(this, wr)[wr].getValue("connectedMeetingsSocketHandler").disableConnectedRooms(i);
28353
28373
  case 8:
28354
28374
  return u = d.sent, this.logger.info("Deleted connected meetings ".concat(JSON.stringify(i))), d.abrupt("return", u);
28355
28375
  case 11:
@@ -28369,7 +28389,7 @@ var AO = /* @__PURE__ */ function() {
28369
28389
  for (; ; )
28370
28390
  switch (d.prev = d.next) {
28371
28391
  case 0:
28372
- return this.validateConnectedMeetingsAction(), this.logger.info("Moving connected meetings participants ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this, Zr)[Zr].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: i, destinationMeetingId: a, participants: o.map(function(p) {
28392
+ return this.validateMoveAction(a, o), this.logger.info("Moving connected meetings participants ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this, wr)[wr].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: i, destinationMeetingId: a, participants: o.map(function(p) {
28373
28393
  return { id: p };
28374
28394
  }) });
28375
28395
  case 4:
@@ -28391,7 +28411,9 @@ var AO = /* @__PURE__ */ function() {
28391
28411
  for (; ; )
28392
28412
  switch (d.prev = d.next) {
28393
28413
  case 0:
28394
- return this.validateConnectedMeetingsAction(), this.logger.info("Moving connected meetings participants (custom preset) ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this, Zr)[Zr].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: i, destinationMeetingId: a, participants: o });
28414
+ return this.validateMoveAction(a, o.map(function(p) {
28415
+ return p.id;
28416
+ })), this.logger.info("Moving connected meetings participants (custom preset) ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this, wr)[wr].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: i, destinationMeetingId: a, participants: o });
28395
28417
  case 4:
28396
28418
  return u = d.sent, u.success ? (this.logger.info("Moved connected meetings participants (custom preset) ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), this.moveSuccessHandler(i, a, o.map(function(p) {
28397
28419
  return p.id;
@@ -28478,21 +28500,14 @@ var OO = Object.defineProperty, DO = Object.getOwnPropertyDescriptor, Pp = funct
28478
28500
  for (; ; )
28479
28501
  switch (b.prev = b.next) {
28480
28502
  case 0:
28481
- if (o = n.authToken, u = n.meetingId, this.connectedMeetings.supportsConnectedMeetings) {
28482
- b.next = 3;
28483
- break;
28484
- }
28485
- throw new Error(`You are not allowed to perform this action.
28486
- Please connect with our support team to enable connected meetings.`);
28487
- case 3:
28488
- return this.logger.info("ConnectedMeetingsController::switchMeeting:: asking ui-kit to show switching breakout UI"), this.connectedMeetings.emit("changingMeeting", u), l = { video: c(this, pe)[pe].getValue("self").videoEnabled, audio: c(this, pe)[pe].getValue("self").audioEnabled }, b.prev = 6, c(this, pe)[pe].getValue("self").cleanupEvents(), b.next = 10, c(this, pe)[pe].getValue("meeting").leave("connected-meeting");
28489
- case 10:
28490
- b.next = 15;
28503
+ return o = n.authToken, u = n.meetingId, this.logger.info("ConnectedMeetingsController::switchMeeting:: asking ui-kit to show switching breakout UI"), this.connectedMeetings.emit("changingMeeting", u), l = { video: c(this, pe)[pe].getValue("self").videoEnabled, audio: c(this, pe)[pe].getValue("self").audioEnabled }, b.prev = 4, c(this, pe)[pe].getValue("self").cleanupEvents(), b.next = 8, c(this, pe)[pe].getValue("meeting").leave("connected-meeting");
28504
+ case 8:
28505
+ b.next = 13;
28491
28506
  break;
28492
- case 12:
28493
- b.prev = 12, b.t0 = b.catch(6), this.logger.error("ConnectedMeetingsController:: switchMeeting:: issues in leaving previous meeting. Meeting Id: ".concat((d = c(this, pe)[pe].getValue("meeting")) === null || d === void 0 || (d = d.meta) === null || d === void 0 ? void 0 : d.meetingId), { error: b.t0 });
28494
- case 15:
28495
- return this.logger.info("ConnectedMeetingsController::switchMeeting:: initializing new meeting. Meeting Id: ".concat(u)), b.next = 18, qO.init(j(j({}, c(this, pe)[pe].getValue("options")), {}, { cachedUserDetails: null, defaults: j(j(j({}, c(this, pe)[pe].getValue("options").defaults), l), {}, {
28507
+ case 10:
28508
+ b.prev = 10, b.t0 = b.catch(4), this.logger.error("ConnectedMeetingsController:: switchMeeting:: issues in leaving previous meeting. Meeting Id: ".concat((d = c(this, pe)[pe].getValue("meeting")) === null || d === void 0 || (d = d.meta) === null || d === void 0 ? void 0 : d.meetingId), { error: b.t0 });
28509
+ case 13:
28510
+ return this.logger.info("ConnectedMeetingsController::switchMeeting:: initializing new meeting. Meeting Id: ".concat(u)), b.next = 16, qO.init(j(j({}, c(this, pe)[pe].getValue("options")), {}, { cachedUserDetails: null, defaults: j(j(j({}, c(this, pe)[pe].getValue("options").defaults), l), {}, {
28496
28511
  /**
28497
28512
  * NOTE(ravindra-cloudflare):
28498
28513
  * Protected methods & variables of SelfMedia,
@@ -28505,20 +28520,20 @@ var OO = Object.defineProperty, DO = Object.getOwnPropertyDescriptor, Pp = funct
28505
28520
  */
28506
28521
  mediaHandler: c(this, pe)[pe].getValue("self")
28507
28522
  }), authToken: o }));
28508
- case 18:
28509
- return p = b.sent, this.logger.info("ConnectedMeetingsController::switchMeeting:: initialized new meeting. Meeting Id: ".concat(p == null || (i = p.meta) === null || i === void 0 ? void 0 : i.meetingId)), b.prev = 20, v = c(this, pe)[pe].getValue("self"), f = v.hidden, p.self.setName(c(this, pe)[pe].getValue("self").name), b.next = 25, p.join();
28510
- case 25:
28511
- f && p.self.hide(), b.next = 31;
28523
+ case 16:
28524
+ return p = b.sent, this.logger.info("ConnectedMeetingsController::switchMeeting:: initialized new meeting. Meeting Id: ".concat(p == null || (i = p.meta) === null || i === void 0 ? void 0 : i.meetingId)), b.prev = 18, v = c(this, pe)[pe].getValue("self"), f = v.hidden, p.self.setName(c(this, pe)[pe].getValue("self").name), b.next = 23, p.join();
28525
+ case 23:
28526
+ f && p.self.hide(), b.next = 29;
28512
28527
  break;
28513
- case 28:
28514
- b.prev = 28, b.t1 = b.catch(20), this.logger.error("ConnectedMeetingsController.joinRoom", { error: b.t1 });
28515
- case 31:
28528
+ case 26:
28529
+ b.prev = 26, b.t1 = b.catch(18), this.logger.error("ConnectedMeetingsController.joinRoom", { error: b.t1 });
28530
+ case 29:
28516
28531
  return this.logger.info("ConnectedMeetingsController::switchMeeting:: asking ui-kit to show in-meeting ui of newly joined meeting id: ".concat(p == null || (a = p.meta) === null || a === void 0 ? void 0 : a.meetingId)), this.connectedMeetings.emit("meetingChanged", p), b.abrupt("return", p);
28517
- case 34:
28532
+ case 32:
28518
28533
  case "end":
28519
28534
  return b.stop();
28520
28535
  }
28521
- }, r, this, [[6, 12], [20, 28]]);
28536
+ }, r, this, [[4, 10], [18, 26]]);
28522
28537
  }));
28523
28538
  function e(r) {
28524
28539
  return t.apply(this, arguments);
@@ -28554,9 +28569,9 @@ var OO = Object.defineProperty, DO = Object.getOwnPropertyDescriptor, Pp = funct
28554
28569
  this.connectedMeetings.emit("stateUpdate", { meetings: this.connectedMeetings.meetings, parentMeeting: this.connectedMeetings.parentMeeting });
28555
28570
  } }], [{ key: "init", value: function(e) {
28556
28571
  var r = new bg(e);
28557
- return r.connectedMeetings.supportsConnectedMeetings && (r.setupEvents(), e.getValue("self").once("roomJoined", function() {
28572
+ return e.getValue("self").once("roomJoined", function() {
28558
28573
  return r.getConnectedMeetings();
28559
- })), r;
28574
+ }), r.setupEvents(), r;
28560
28575
  } }]);
28561
28576
  }()), Zc = bg;
28562
28577
  Pp([$.trace("ConnectedMeetingsController.getConnectedMeetings")], Zc.prototype, "getConnectedMeetings", 1);