obi-sdk 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.es.js CHANGED
@@ -188,7 +188,7 @@ let it = class {
188
188
  return this._locking = this._locking.then(() => t), n;
189
189
  }
190
190
  };
191
- function Be(A, e) {
191
+ function ve(A, e) {
192
192
  if (!A)
193
193
  throw new Error(e);
194
194
  }
@@ -214,7 +214,7 @@ function sp(A) {
214
214
  const op = Symbol("@bufbuild/protobuf/enum-type");
215
215
  function Ev(A) {
216
216
  const e = A[op];
217
- return Be(e, "missing enum type on enum object"), e;
217
+ return ve(e, "missing enum type on enum object"), e;
218
218
  }
219
219
  function ap(A, e, t, n) {
220
220
  A[op] = cp(e, t.map((i) => ({
@@ -527,7 +527,7 @@ function Iv() {
527
527
  }
528
528
  };
529
529
  }
530
- const t = (i) => Be(/^-?[0-9]+$/.test(i), "int64 invalid: ".concat(i)), n = (i) => Be(/^[0-9]+$/.test(i), "uint64 invalid: ".concat(i));
530
+ const t = (i) => ve(/^-?[0-9]+$/.test(i), "int64 invalid: ".concat(i)), n = (i) => ve(/^[0-9]+$/.test(i), "uint64 invalid: ".concat(i));
531
531
  return {
532
532
  zero: "0",
533
533
  supported: !1,
@@ -1078,7 +1078,7 @@ function gp(A, e) {
1078
1078
  return e.extendee.typeName === t.typeName && !!t.runtime.bin.listUnknownFields(A).find((n) => n.no == e.field.no);
1079
1079
  }
1080
1080
  function mp(A, e) {
1081
- Be(A.extendee.typeName == e.getType().typeName, "extension ".concat(A.typeName, " can only be applied to message ").concat(A.extendee.typeName));
1081
+ ve(A.extendee.typeName == e.getType().typeName, "extension ".concat(A.typeName, " can only be applied to message ").concat(A.extendee.typeName));
1082
1082
  }
1083
1083
  function vp(A, e) {
1084
1084
  const t = A.localName;
@@ -1236,7 +1236,7 @@ function Nt(A) {
1236
1236
  function Yd(A, e, t, n, i) {
1237
1237
  let r = t.localName;
1238
1238
  if (t.repeated) {
1239
- if (Be(t.kind != "map"), e === null)
1239
+ if (ve(t.kind != "map"), e === null)
1240
1240
  return;
1241
1241
  if (!Array.isArray(e))
1242
1242
  throw new Error("cannot decode field ".concat(i.typeName, ".").concat(t.name, " from JSON: ").concat(Nt(e)));
@@ -1435,7 +1435,7 @@ function $v(A) {
1435
1435
  }
1436
1436
  function Zd(A, e, t) {
1437
1437
  if (A.kind == "map") {
1438
- Be(typeof e == "object" && e != null);
1438
+ ve(typeof e == "object" && e != null);
1439
1439
  const n = {}, i = Object.entries(e);
1440
1440
  switch (A.V.kind) {
1441
1441
  case "scalar":
@@ -1455,7 +1455,7 @@ function Zd(A, e, t) {
1455
1455
  return t.emitDefaultValues || i.length > 0 ? n : void 0;
1456
1456
  }
1457
1457
  if (A.repeated) {
1458
- Be(Array.isArray(e));
1458
+ ve(Array.isArray(e));
1459
1459
  const n = [];
1460
1460
  switch (A.kind) {
1461
1461
  case "scalar":
@@ -1484,7 +1484,7 @@ function Zd(A, e, t) {
1484
1484
  }
1485
1485
  function ba(A, e, t) {
1486
1486
  var n;
1487
- if (Be(typeof e == "number"), A.typeName == "google.protobuf.NullValue")
1487
+ if (ve(typeof e == "number"), A.typeName == "google.protobuf.NullValue")
1488
1488
  return null;
1489
1489
  if (t)
1490
1490
  return e;
@@ -1498,22 +1498,22 @@ function ys(A, e) {
1498
1498
  case T.SINT32:
1499
1499
  case T.FIXED32:
1500
1500
  case T.UINT32:
1501
- return Be(typeof e == "number"), e;
1501
+ return ve(typeof e == "number"), e;
1502
1502
  case T.FLOAT:
1503
1503
  case T.DOUBLE:
1504
- return Be(typeof e == "number"), Number.isNaN(e) ? "NaN" : e === Number.POSITIVE_INFINITY ? "Infinity" : e === Number.NEGATIVE_INFINITY ? "-Infinity" : e;
1504
+ return ve(typeof e == "number"), Number.isNaN(e) ? "NaN" : e === Number.POSITIVE_INFINITY ? "Infinity" : e === Number.NEGATIVE_INFINITY ? "-Infinity" : e;
1505
1505
  case T.STRING:
1506
- return Be(typeof e == "string"), e;
1506
+ return ve(typeof e == "string"), e;
1507
1507
  case T.BOOL:
1508
- return Be(typeof e == "boolean"), e;
1508
+ return ve(typeof e == "boolean"), e;
1509
1509
  case T.UINT64:
1510
1510
  case T.FIXED64:
1511
1511
  case T.INT64:
1512
1512
  case T.SFIXED64:
1513
1513
  case T.SINT64:
1514
- return Be(typeof e == "bigint" || typeof e == "string" || typeof e == "number"), e.toString();
1514
+ return ve(typeof e == "bigint" || typeof e == "string" || typeof e == "number"), e.toString();
1515
1515
  case T.BYTES:
1516
- return Be(e instanceof Uint8Array), pp.enc(e);
1516
+ return ve(e instanceof Uint8Array), pp.enc(e);
1517
1517
  }
1518
1518
  }
1519
1519
  const Dn = Symbol("@bufbuild/protobuf/unknown-fields"), eu = {
@@ -1708,14 +1708,14 @@ function Ws(A, e) {
1708
1708
  }
1709
1709
  }
1710
1710
  function nu(A, e, t, n) {
1711
- Be(e !== void 0);
1711
+ ve(e !== void 0);
1712
1712
  const i = A.repeated;
1713
1713
  switch (A.kind) {
1714
1714
  case "scalar":
1715
1715
  case "enum":
1716
1716
  let r = A.kind == "enum" ? T.INT32 : A.T;
1717
1717
  if (i)
1718
- if (Be(Array.isArray(e)), A.packed)
1718
+ if (ve(Array.isArray(e)), A.packed)
1719
1719
  qv(t, r, A.no, e);
1720
1720
  else
1721
1721
  for (const s of e)
@@ -1725,14 +1725,14 @@ function nu(A, e, t, n) {
1725
1725
  break;
1726
1726
  case "message":
1727
1727
  if (i) {
1728
- Be(Array.isArray(e));
1728
+ ve(Array.isArray(e));
1729
1729
  for (const s of e)
1730
1730
  iu(t, n, A, s);
1731
1731
  } else
1732
1732
  iu(t, n, A, e);
1733
1733
  break;
1734
1734
  case "map":
1735
- Be(typeof e == "object" && e != null);
1735
+ ve(typeof e == "object" && e != null);
1736
1736
  for (const [s, o] of Object.entries(e))
1737
1737
  Xv(t, n, A, s, o);
1738
1738
  break;
@@ -1750,7 +1750,7 @@ function Xv(A, e, t, n, i) {
1750
1750
  r = Number.parseInt(n);
1751
1751
  break;
1752
1752
  case T.BOOL:
1753
- Be(n == "true" || n == "false"), r = n == "true";
1753
+ ve(n == "true" || n == "false"), r = n == "true";
1754
1754
  break;
1755
1755
  }
1756
1756
  switch (Ar(A, t.K, 1, r), t.V.kind) {
@@ -1761,7 +1761,7 @@ function Xv(A, e, t, n, i) {
1761
1761
  Ar(A, T.INT32, 2, i);
1762
1762
  break;
1763
1763
  case "message":
1764
- Be(i !== void 0), A.tag(2, Se.LengthDelimited).bytes(i.toBinary(e));
1764
+ ve(i !== void 0), A.tag(2, Se.LengthDelimited).bytes(i.toBinary(e));
1765
1765
  break;
1766
1766
  }
1767
1767
  A.join();
@@ -1771,7 +1771,7 @@ function iu(A, e, t, n) {
1771
1771
  t.delimited ? A.tag(t.no, Se.StartGroup).raw(i.toBinary(e)).tag(t.no, Se.EndGroup) : A.tag(t.no, Se.LengthDelimited).bytes(i.toBinary(e));
1772
1772
  }
1773
1773
  function Ar(A, e, t, n) {
1774
- Be(n !== void 0);
1774
+ ve(n !== void 0);
1775
1775
  let [i, r] = Cp(e);
1776
1776
  A.tag(t, i)[r](n);
1777
1777
  }
@@ -2079,7 +2079,7 @@ class sB {
2079
2079
  this.kind = "oneof", this.repeated = !1, this.packed = !1, this.opt = !1, this.req = !1, this.default = void 0, this.fields = [], this.name = e, this.localName = eB(e);
2080
2080
  }
2081
2081
  addField(e) {
2082
- Be(e.oneof === this, "field ".concat(e.name, " not one of ").concat(this.name)), this.fields.push(e);
2082
+ ve(e.oneof === this, "field ".concat(e.name, " not one of ").concat(this.name)), this.fields.push(e);
2083
2083
  }
2084
2084
  findField(e) {
2085
2085
  if (!this._lookup) {
@@ -6819,7 +6819,7 @@ var z;
6819
6819
  (function(A) {
6820
6820
  A[A.NotAllowed = 0] = "NotAllowed", A[A.ServerUnreachable = 1] = "ServerUnreachable", A[A.InternalError = 2] = "InternalError", A[A.Cancelled = 3] = "Cancelled", A[A.LeaveRequest = 4] = "LeaveRequest";
6821
6821
  })(z || (z = {}));
6822
- class ce extends HA {
6822
+ class ae extends HA {
6823
6823
  constructor(e, t, n, i) {
6824
6824
  super(1, e), this.name = "ConnectionError", this.status = n, this.reason = t, this.context = i, this.reasonName = z[t];
6825
6825
  }
@@ -8152,19 +8152,19 @@ function YC(A) {
8152
8152
  req: A
8153
8153
  }), e;
8154
8154
  }
8155
- var de;
8155
+ var le;
8156
8156
  (function(A) {
8157
8157
  A[A.CONNECTING = 0] = "CONNECTING", A[A.CONNECTED = 1] = "CONNECTED", A[A.RECONNECTING = 2] = "RECONNECTING", A[A.DISCONNECTING = 3] = "DISCONNECTING", A[A.DISCONNECTED = 4] = "DISCONNECTED";
8158
- })(de || (de = {}));
8158
+ })(le || (le = {}));
8159
8159
  class id {
8160
8160
  get currentState() {
8161
8161
  return this.state;
8162
8162
  }
8163
8163
  get isDisconnected() {
8164
- return this.state === de.DISCONNECTING || this.state === de.DISCONNECTED;
8164
+ return this.state === le.DISCONNECTING || this.state === le.DISCONNECTED;
8165
8165
  }
8166
8166
  get isEstablishingConnection() {
8167
- return this.state === de.CONNECTING || this.state === de.RECONNECTING;
8167
+ return this.state === le.CONNECTING || this.state === le.RECONNECTING;
8168
8168
  }
8169
8169
  getNextRequestId() {
8170
8170
  return this._requestId += 1, this._requestId;
@@ -8172,9 +8172,9 @@ class id {
8172
8172
  constructor() {
8173
8173
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
8174
8174
  var n;
8175
- this.rtt = 0, this.state = de.DISCONNECTED, this.log = j, this._requestId = 0, this.resetCallbacks = () => {
8175
+ this.rtt = 0, this.state = le.DISCONNECTED, this.log = j, this._requestId = 0, this.resetCallbacks = () => {
8176
8176
  this.onAnswer = void 0, this.onLeave = void 0, this.onLocalTrackPublished = void 0, this.onLocalTrackUnpublished = void 0, this.onNegotiateRequested = void 0, this.onOffer = void 0, this.onRemoteMuteChanged = void 0, this.onSubscribedQualityUpdate = void 0, this.onTokenRefresh = void 0, this.onTrickle = void 0, this.onClose = void 0;
8177
- }, this.log = oA((n = t.loggerName) !== null && n !== void 0 ? n : It.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new WC(), this.queuedRequests = [], this.closingLock = new it(), this.connectionLock = new it(), this.state = de.DISCONNECTED;
8177
+ }, this.log = oA((n = t.loggerName) !== null && n !== void 0 ? n : It.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new WC(), this.queuedRequests = [], this.closingLock = new it(), this.connectionLock = new it(), this.state = le.DISCONNECTED;
8178
8178
  }
8179
8179
  get logContext() {
8180
8180
  var e, t;
@@ -8182,7 +8182,7 @@ class id {
8182
8182
  }
8183
8183
  join(e, t, n, i) {
8184
8184
  return m(this, void 0, void 0, function* () {
8185
- return this.state = de.CONNECTING, this.options = n, yield this.connect(e, t, n, i);
8185
+ return this.state = le.CONNECTING, this.options = n, yield this.connect(e, t, n, i);
8186
8186
  });
8187
8187
  }
8188
8188
  reconnect(e, t, n, i) {
@@ -8191,7 +8191,7 @@ class id {
8191
8191
  this.log.warn("attempted to reconnect without signal options being set, ignoring", this.logContext);
8192
8192
  return;
8193
8193
  }
8194
- return this.state = de.RECONNECTING, this.clearPingInterval(), yield this.connect(e, t, Object.assign(Object.assign({}, this.options), {
8194
+ return this.state = le.RECONNECTING, this.clearPingInterval(), yield this.connect(e, t, Object.assign(Object.assign({}, this.options), {
8195
8195
  reconnect: !0,
8196
8196
  sid: n,
8197
8197
  reconnectReason: i
@@ -8205,9 +8205,9 @@ class id {
8205
8205
  const d = yield this.connectionLock.lock();
8206
8206
  try {
8207
8207
  const u = () => m(this, void 0, void 0, function* () {
8208
- this.close(), clearTimeout(h), l(new ce("room connection has been cancelled (signal)", z.Cancelled));
8208
+ this.close(), clearTimeout(h), l(new ae("room connection has been cancelled (signal)", z.Cancelled));
8209
8209
  }), h = setTimeout(() => {
8210
- this.close(), l(new ce("room connection has timed out (signal)", z.ServerUnreachable));
8210
+ this.close(), l(new ae("room connection has timed out (signal)", z.ServerUnreachable));
8211
8211
  }, n.websocketTimeout);
8212
8212
  i?.aborted && u(), i?.addEventListener("abort", u);
8213
8213
  const f = new URL(o);
@@ -8217,17 +8217,17 @@ class id {
8217
8217
  }, this.logContext)), this.ws && (yield this.close(!1)), this.ws = new WebSocket(o), this.ws.binaryType = "arraybuffer", this.ws.onopen = () => {
8218
8218
  clearTimeout(h);
8219
8219
  }, this.ws.onerror = (p) => m(this, void 0, void 0, function* () {
8220
- if (this.state !== de.CONNECTED) {
8221
- this.state = de.DISCONNECTED, clearTimeout(h);
8220
+ if (this.state !== le.CONNECTED) {
8221
+ this.state = le.DISCONNECTED, clearTimeout(h);
8222
8222
  try {
8223
8223
  const g = yield fetch(a);
8224
8224
  if (g.status.toFixed(0).startsWith("4")) {
8225
8225
  const v = yield g.text();
8226
- l(new ce(v, z.NotAllowed, g.status));
8226
+ l(new ae(v, z.NotAllowed, g.status));
8227
8227
  } else
8228
- l(new ce("Encountered unknown websocket error during connection: ".concat(p.toString()), z.InternalError, g.status));
8228
+ l(new ae("Encountered unknown websocket error during connection: ".concat(p.toString()), z.InternalError, g.status));
8229
8229
  } catch (g) {
8230
- l(new ce(g instanceof Error ? g.message : "server was not reachable", z.ServerUnreachable));
8230
+ l(new ae(g instanceof Error ? g.message : "server was not reachable", z.ServerUnreachable));
8231
8231
  }
8232
8232
  return;
8233
8233
  }
@@ -8246,17 +8246,17 @@ class id {
8246
8246
  this.log.error("could not decode websocket message: ".concat(typeof p.data), this.logContext);
8247
8247
  return;
8248
8248
  }
8249
- if (this.state !== de.CONNECTED) {
8249
+ if (this.state !== le.CONNECTED) {
8250
8250
  let B = !1;
8251
- if (((g = y.message) === null || g === void 0 ? void 0 : g.case) === "join" ? (this.state = de.CONNECTED, i?.removeEventListener("abort", u), this.pingTimeoutDuration = y.message.value.pingTimeout, this.pingIntervalDuration = y.message.value.pingInterval, this.pingTimeoutDuration && this.pingTimeoutDuration > 0 && (this.log.debug("ping config", Object.assign(Object.assign({}, this.logContext), {
8251
+ if (((g = y.message) === null || g === void 0 ? void 0 : g.case) === "join" ? (this.state = le.CONNECTED, i?.removeEventListener("abort", u), this.pingTimeoutDuration = y.message.value.pingTimeout, this.pingIntervalDuration = y.message.value.pingInterval, this.pingTimeoutDuration && this.pingTimeoutDuration > 0 && (this.log.debug("ping config", Object.assign(Object.assign({}, this.logContext), {
8252
8252
  timeout: this.pingTimeoutDuration,
8253
8253
  interval: this.pingIntervalDuration
8254
- })), this.startPingInterval()), c(y.message.value)) : this.state === de.RECONNECTING && y.message.case !== "leave" ? (this.state = de.CONNECTED, i?.removeEventListener("abort", u), this.startPingInterval(), ((v = y.message) === null || v === void 0 ? void 0 : v.case) === "reconnect" ? c(y.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), c(void 0), B = !0)) : this.isEstablishingConnection && y.message.case === "leave" ? l(new ce("Received leave request while trying to (re)connect", z.LeaveRequest, void 0, y.message.value.reason)) : n.reconnect || l(new ce("did not receive join response, got ".concat((w = y.message) === null || w === void 0 ? void 0 : w.case, " instead"), z.InternalError)), !B)
8254
+ })), this.startPingInterval()), c(y.message.value)) : this.state === le.RECONNECTING && y.message.case !== "leave" ? (this.state = le.CONNECTED, i?.removeEventListener("abort", u), this.startPingInterval(), ((v = y.message) === null || v === void 0 ? void 0 : v.case) === "reconnect" ? c(y.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), c(void 0), B = !0)) : this.isEstablishingConnection && y.message.case === "leave" ? l(new ae("Received leave request while trying to (re)connect", z.LeaveRequest, void 0, y.message.value.reason)) : n.reconnect || l(new ae("did not receive join response, got ".concat((w = y.message) === null || w === void 0 ? void 0 : w.case, " instead"), z.InternalError)), !B)
8255
8255
  return;
8256
8256
  }
8257
8257
  this.signalLatency && (yield st(this.signalLatency)), this.handleSignalResponse(y);
8258
8258
  }), this.ws.onclose = (p) => {
8259
- this.isEstablishingConnection && l(new ce("Websocket got closed during a (re)connection attempt", z.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8259
+ this.isEstablishingConnection && l(new ae("Websocket got closed during a (re)connection attempt", z.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8260
8260
  reason: p.reason,
8261
8261
  code: p.code,
8262
8262
  wasClean: p.wasClean,
@@ -8275,7 +8275,7 @@ class id {
8275
8275
  return function* () {
8276
8276
  const n = yield e.closingLock.lock();
8277
8277
  try {
8278
- if (e.clearPingInterval(), t && (e.state = de.DISCONNECTING), e.ws) {
8278
+ if (e.clearPingInterval(), t && (e.state = le.DISCONNECTING), e.ws) {
8279
8279
  e.ws.onmessage = null, e.ws.onopen = null, e.ws.onclose = null;
8280
8280
  const i = new Promise((r) => {
8281
8281
  e.ws ? e.ws.onclose = () => {
@@ -8285,7 +8285,7 @@ class id {
8285
8285
  e.ws.readyState < e.ws.CLOSING && (e.ws.close(), yield Promise.race([i, st(250)])), e.ws = void 0;
8286
8286
  }
8287
8287
  } finally {
8288
- t && (e.state = de.DISCONNECTED), n();
8288
+ t && (e.state = le.DISCONNECTED), n();
8289
8289
  }
8290
8290
  }();
8291
8291
  });
@@ -8430,7 +8430,7 @@ class id {
8430
8430
  var n = this;
8431
8431
  let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
8432
8432
  return function* () {
8433
- if (!i && !YC(t) && n.state === de.RECONNECTING) {
8433
+ if (!i && !YC(t) && n.state === le.RECONNECTING) {
8434
8434
  n.queuedRequests.push(() => m(n, void 0, void 0, function* () {
8435
8435
  yield this.sendRequest(t, !0);
8436
8436
  }));
@@ -8484,7 +8484,7 @@ class id {
8484
8484
  }
8485
8485
  handleOnClose(e) {
8486
8486
  return m(this, void 0, void 0, function* () {
8487
- if (this.state === de.DISCONNECTED)
8487
+ if (this.state === le.DISCONNECTED)
8488
8488
  return;
8489
8489
  const t = this.onClose;
8490
8490
  yield this.close(), this.log.debug("websocket connection closed: ".concat(e), Object.assign(Object.assign({}, this.logContext), {
@@ -9537,10 +9537,10 @@ const Gc = "vp8", sb = {
9537
9537
  peerConnectionTimeout: 15e3,
9538
9538
  websocketTimeout: 15e3
9539
9539
  };
9540
- var ve;
9540
+ var me;
9541
9541
  (function(A) {
9542
9542
  A[A.NEW = 0] = "NEW", A[A.CONNECTING = 1] = "CONNECTING", A[A.CONNECTED = 2] = "CONNECTED", A[A.FAILED = 3] = "FAILED", A[A.CLOSING = 4] = "CLOSING", A[A.CLOSED = 5] = "CLOSED";
9543
- })(ve || (ve = {}));
9543
+ })(me || (me = {}));
9544
9544
  class ab {
9545
9545
  get needsPublisher() {
9546
9546
  return this.isPublisherConnectionRequired;
@@ -9556,7 +9556,7 @@ class ab {
9556
9556
  this.peerConnectionTimeout = od.peerConnectionTimeout, this.log = j, this.updateState = () => {
9557
9557
  var r;
9558
9558
  const s = this.state, o = this.requiredTransports.map((a) => a.getConnectionState());
9559
- o.every((a) => a === "connected") ? this.state = ve.CONNECTED : o.some((a) => a === "failed") ? this.state = ve.FAILED : o.some((a) => a === "connecting") ? this.state = ve.CONNECTING : o.every((a) => a === "closed") ? this.state = ve.CLOSED : o.some((a) => a === "closed") ? this.state = ve.CLOSING : o.every((a) => a === "new") && (this.state = ve.NEW), s !== this.state && (this.log.debug("pc state change: from ".concat(ve[s], " to ").concat(ve[this.state]), this.logContext), (r = this.onStateChange) === null || r === void 0 || r.call(this, this.state, this.publisher.getConnectionState(), this.subscriber.getConnectionState()));
9559
+ o.every((a) => a === "connected") ? this.state = me.CONNECTED : o.some((a) => a === "failed") ? this.state = me.FAILED : o.some((a) => a === "connecting") ? this.state = me.CONNECTING : o.every((a) => a === "closed") ? this.state = me.CLOSED : o.some((a) => a === "closed") ? this.state = me.CLOSING : o.every((a) => a === "new") && (this.state = me.NEW), s !== this.state && (this.log.debug("pc state change: from ".concat(me[s], " to ").concat(me[this.state]), this.logContext), (r = this.onStateChange) === null || r === void 0 || r.call(this, this.state, this.publisher.getConnectionState(), this.subscriber.getConnectionState()));
9560
9560
  }, this.log = oA((i = n.loggerName) !== null && i !== void 0 ? i : It.PCManager), this.loggerOptions = n, this.isPublisherConnectionRequired = !t, this.isSubscriberConnectionRequired = t, this.publisher = new Ru(e, n), this.subscriber = new Ru(e, n), this.publisher.onConnectionStateChange = this.updateState, this.subscriber.onConnectionStateChange = this.updateState, this.publisher.onIceConnectionStateChange = this.updateState, this.subscriber.onIceConnectionStateChange = this.updateState, this.publisher.onSignalingStatechange = this.updateState, this.subscriber.onSignalingStatechange = this.updateState, this.publisher.onIceCandidate = (r) => {
9561
9561
  var s;
9562
9562
  (s = this.onIceCandidate) === null || s === void 0 || s.call(this, r, kt.PUBLISHER);
@@ -9572,7 +9572,7 @@ class ab {
9572
9572
  }, this.publisher.onOffer = (r) => {
9573
9573
  var s;
9574
9574
  (s = this.onPublisherOffer) === null || s === void 0 || s.call(this, r);
9575
- }, this.state = ve.NEW, this.connectionLock = new it(), this.remoteOfferLock = new it();
9575
+ }, this.state = me.NEW, this.connectionLock = new it(), this.remoteOfferLock = new it();
9576
9576
  }
9577
9577
  get logContext() {
9578
9578
  var e, t;
@@ -9697,15 +9697,15 @@ class ab {
9697
9697
  if (n.getConnectionState() !== "connected")
9698
9698
  return new Promise((a, c) => m(r, void 0, void 0, function* () {
9699
9699
  const l = () => {
9700
- this.log.warn("abort transport connection", this.logContext), He.clearTimeout(d), c(new ce("room connection has been cancelled", z.Cancelled));
9700
+ this.log.warn("abort transport connection", this.logContext), He.clearTimeout(d), c(new ae("room connection has been cancelled", z.Cancelled));
9701
9701
  };
9702
9702
  i?.signal.aborted && l(), i?.signal.addEventListener("abort", l);
9703
9703
  const d = He.setTimeout(() => {
9704
- i?.signal.removeEventListener("abort", l), c(new ce("could not establish pc connection", z.InternalError));
9704
+ i?.signal.removeEventListener("abort", l), c(new ae("could not establish pc connection", z.InternalError));
9705
9705
  }, s);
9706
- for (; this.state !== ve.CONNECTED; )
9706
+ for (; this.state !== me.CONNECTED; )
9707
9707
  if (yield st(50), i?.signal.aborted) {
9708
- c(new ce("room connection has been cancelled", z.Cancelled));
9708
+ c(new ae("room connection has been cancelled", z.Cancelled));
9709
9709
  return;
9710
9710
  }
9711
9711
  He.clearTimeout(d), i?.signal.removeEventListener("abort", l), a();
@@ -9714,7 +9714,7 @@ class ab {
9714
9714
  });
9715
9715
  }
9716
9716
  }
9717
- class Ce extends Error {
9717
+ class Be extends Error {
9718
9718
  /**
9719
9719
  * Creates an error object with the given code and message, plus an optional data payload.
9720
9720
  *
@@ -9723,13 +9723,13 @@ class Ce extends Error {
9723
9723
  * Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings).
9724
9724
  */
9725
9725
  constructor(e, t, n) {
9726
- super(t), this.code = e, this.message = Ou(t, Ce.MAX_MESSAGE_BYTES), this.data = n ? Ou(n, Ce.MAX_DATA_BYTES) : void 0;
9726
+ super(t), this.code = e, this.message = Ou(t, Be.MAX_MESSAGE_BYTES), this.data = n ? Ou(n, Be.MAX_DATA_BYTES) : void 0;
9727
9727
  }
9728
9728
  /**
9729
9729
  * @internal
9730
9730
  */
9731
9731
  static fromProto(e) {
9732
- return new Ce(e.code, e.message, e.data);
9732
+ return new Be(e.code, e.message, e.data);
9733
9733
  }
9734
9734
  /**
9735
9735
  * @internal
@@ -9747,12 +9747,12 @@ class Ce extends Error {
9747
9747
  * @internal
9748
9748
  */
9749
9749
  static builtIn(e, t) {
9750
- return new Ce(Ce.ErrorCode[e], Ce.ErrorMessage[e], t);
9750
+ return new Be(Be.ErrorCode[e], Be.ErrorMessage[e], t);
9751
9751
  }
9752
9752
  }
9753
- Ce.MAX_MESSAGE_BYTES = 256;
9754
- Ce.MAX_DATA_BYTES = 15360;
9755
- Ce.ErrorCode = {
9753
+ Be.MAX_MESSAGE_BYTES = 256;
9754
+ Be.MAX_DATA_BYTES = 15360;
9755
+ Be.ErrorCode = {
9756
9756
  APPLICATION_ERROR: 1500,
9757
9757
  CONNECTION_TIMEOUT: 1501,
9758
9758
  RESPONSE_TIMEOUT: 1502,
@@ -9765,7 +9765,7 @@ Ce.ErrorCode = {
9765
9765
  UNSUPPORTED_SERVER: 1403,
9766
9766
  UNSUPPORTED_VERSION: 1404
9767
9767
  };
9768
- Ce.ErrorMessage = {
9768
+ Be.ErrorMessage = {
9769
9769
  APPLICATION_ERROR: "Application error in method handler",
9770
9770
  CONNECTION_TIMEOUT: "Connection timeout",
9771
9771
  RESPONSE_TIMEOUT: "Response timeout",
@@ -11011,7 +11011,7 @@ class yb extends Gt.EventEmitter {
11011
11011
  if (i)
11012
11012
  return i.bufferedAmount <= i.bufferedAmountLowThreshold;
11013
11013
  }, this.handleBrowserOnLine = () => {
11014
- this.client.currentState === de.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(On.RR_SIGNAL_DISCONNECTED));
11014
+ this.client.currentState === le.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(On.RR_SIGNAL_DISCONNECTED));
11015
11015
  }, this.log = oA((t = e.loggerName) !== null && t !== void 0 ? t : It.Engine), this.loggerOptions = {
11016
11016
  loggerName: e.loggerName,
11017
11017
  loggerContextCb: () => this.logContext
@@ -11037,7 +11037,7 @@ class yb extends Gt.EventEmitter {
11037
11037
  this.emit(_.SignalConnected);
11038
11038
  }, 10), r;
11039
11039
  } catch (r) {
11040
- if (r instanceof ce && r.reason === z.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
11040
+ if (r instanceof ae && r.reason === z.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
11041
11041
  return this.join(e, t, n, i);
11042
11042
  throw r;
11043
11043
  }
@@ -11077,7 +11077,7 @@ class yb extends Gt.EventEmitter {
11077
11077
  throw new iA("a track with the same ID has already been published");
11078
11078
  return new Promise((t, n) => {
11079
11079
  const i = setTimeout(() => {
11080
- delete this.pendingTrackResolvers[e.cid], n(new ce("publication of local track timed out, no response from server", z.InternalError));
11080
+ delete this.pendingTrackResolvers[e.cid], n(new ae("publication of local track timed out, no response from server", z.InternalError));
11081
11081
  }, 1e4);
11082
11082
  this.pendingTrackResolvers[e.cid] = {
11083
11083
  resolve: (r) => {
@@ -11131,7 +11131,7 @@ class yb extends Gt.EventEmitter {
11131
11131
  configure(e) {
11132
11132
  return m(this, void 0, void 0, function* () {
11133
11133
  var t, n;
11134
- if (this.pcManager && this.pcManager.currentState !== ve.NEW)
11134
+ if (this.pcManager && this.pcManager.currentState !== me.NEW)
11135
11135
  return;
11136
11136
  this.participantSid = (t = e.participant) === null || t === void 0 ? void 0 : t.sid;
11137
11137
  const i = this.makeRTCConfiguration(e);
@@ -11140,12 +11140,12 @@ class yb extends Gt.EventEmitter {
11140
11140
  }, this.pcManager.onPublisherOffer = (r) => {
11141
11141
  this.client.sendOffer(r);
11142
11142
  }, this.pcManager.onDataChannel = this.handleDataChannel, this.pcManager.onStateChange = (r, s, o) => m(this, void 0, void 0, function* () {
11143
- if (this.log.debug("primary PC state changed ".concat(r), this.logContext), ["closed", "disconnected", "failed"].includes(s) && (this.publisherConnectionPromise = void 0), r === ve.CONNECTED) {
11143
+ if (this.log.debug("primary PC state changed ".concat(r), this.logContext), ["closed", "disconnected", "failed"].includes(s) && (this.publisherConnectionPromise = void 0), r === me.CONNECTED) {
11144
11144
  const l = this.pcState === Et.New;
11145
11145
  this.pcState = Et.Connected, l && this.emit(_.Connected, e);
11146
11146
  } else
11147
- r === ve.FAILED && this.pcState === Et.Connected && (this.pcState = Et.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? On.RR_SUBSCRIBER_FAILED : On.RR_PUBLISHER_FAILED));
11148
- const a = this.client.isDisconnected || this.client.currentState === de.RECONNECTING, c = [ve.FAILED, ve.CLOSING, ve.CLOSED].includes(r);
11147
+ r === me.FAILED && this.pcState === Et.Connected && (this.pcState = Et.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? On.RR_SUBSCRIBER_FAILED : On.RR_PUBLISHER_FAILED));
11148
+ const a = this.client.isDisconnected || this.client.currentState === le.RECONNECTING, c = [me.FAILED, me.CLOSING, me.CLOSED].includes(r);
11149
11149
  a && c && !this._isClosed && this.emit(_.Offline);
11150
11150
  }), this.pcManager.onTrack = (r) => {
11151
11151
  this.emit(_.MediaTrackAdded, r.track, r.streams[0], r.receiver);
@@ -11295,7 +11295,7 @@ class yb extends Gt.EventEmitter {
11295
11295
  }
11296
11296
  (((t = this.clientConfiguration) === null || t === void 0 ? void 0 : t.resumeConnection) === fr.DISABLED || // signaling state could change to closed due to hardware sleep
11297
11297
  // those connections cannot be resumed
11298
- ((i = (n = this.pcManager) === null || n === void 0 ? void 0 : n.currentState) !== null && i !== void 0 ? i : ve.NEW) === ve.NEW) && (this.fullReconnectOnNext = !0);
11298
+ ((i = (n = this.pcManager) === null || n === void 0 ? void 0 : n.currentState) !== null && i !== void 0 ? i : me.NEW) === me.NEW) && (this.fullReconnectOnNext = !0);
11299
11299
  try {
11300
11300
  this.attemptingReconnect = !0, this.fullReconnectOnNext ? yield this.restartConnection() : yield this.resumeConnection(e), this.clearPendingReconnect(), this.fullReconnectOnNext = !1;
11301
11301
  } catch (r) {
@@ -11333,11 +11333,11 @@ class yb extends Gt.EventEmitter {
11333
11333
  throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Ln();
11334
11334
  r = yield this.join(e ?? this.url, this.token, this.signalOpts);
11335
11335
  } catch (s) {
11336
- throw s instanceof ce && s.reason === z.NotAllowed ? new Fe("could not reconnect, token might be expired") : new Ln();
11336
+ throw s instanceof ae && s.reason === z.NotAllowed ? new Fe("could not reconnect, token might be expired") : new Ln();
11337
11337
  }
11338
11338
  if (this.shouldFailNext)
11339
11339
  throw this.shouldFailNext = !1, new Error("simulated failure");
11340
- if (this.client.setReconnected(), this.emit(_.SignalRestarted, r), yield this.waitForPCReconnected(), this.client.currentState !== de.CONNECTED)
11340
+ if (this.client.setReconnected(), this.emit(_.SignalRestarted, r), yield this.waitForPCReconnected(), this.client.currentState !== le.CONNECTED)
11341
11341
  throw new Ln("Signal connection got severed during reconnect");
11342
11342
  (t = this.regionUrlProvider) === null || t === void 0 || t.resetAttempts(), this.emit(_.Restarted);
11343
11343
  } catch (r) {
@@ -11365,7 +11365,7 @@ class yb extends Gt.EventEmitter {
11365
11365
  let r = "";
11366
11366
  throw i instanceof Error && (r = i.message, this.log.error(i.message, Object.assign(Object.assign({}, this.logContext), {
11367
11367
  error: i
11368
- }))), i instanceof ce && i.reason === z.NotAllowed ? new Fe("could not reconnect, token might be expired") : i instanceof ce && i.reason === z.LeaveRequest ? i : new Ln(r);
11368
+ }))), i instanceof ae && i.reason === z.NotAllowed ? new Fe("could not reconnect, token might be expired") : i instanceof ae && i.reason === z.LeaveRequest ? i : new Ln(r);
11369
11369
  }
11370
11370
  if (this.emit(_.SignalResumed), n) {
11371
11371
  const i = this.makeRTCConfiguration(n);
@@ -11374,7 +11374,7 @@ class yb extends Gt.EventEmitter {
11374
11374
  this.log.warn("Did not receive reconnect response", this.logContext);
11375
11375
  if (this.shouldFailNext)
11376
11376
  throw this.shouldFailNext = !1, new Error("simulated failure");
11377
- if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== de.CONNECTED)
11377
+ if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== le.CONNECTED)
11378
11378
  throw new Ln("Signal connection got severed during reconnect");
11379
11379
  this.client.setReconnected(), ((t = this.reliableDC) === null || t === void 0 ? void 0 : t.readyState) === "open" && this.reliableDC.id === null && this.createDataChannels(), this.emit(_.Resumed);
11380
11380
  });
@@ -11394,7 +11394,7 @@ class yb extends Gt.EventEmitter {
11394
11394
  throw new Fe("PC manager is closed");
11395
11395
  yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Et.Connected;
11396
11396
  } catch (e) {
11397
- throw this.pcState = Et.Disconnected, new ce("could not establish PC connection, ".concat(e.message), z.InternalError);
11397
+ throw this.pcState = Et.Disconnected, new ae("could not establish PC connection, ".concat(e.message), z.InternalError);
11398
11398
  }
11399
11399
  });
11400
11400
  }
@@ -11471,7 +11471,7 @@ class yb extends Gt.EventEmitter {
11471
11471
  throw new Fe("PC manager is closed");
11472
11472
  const s = i ? n.pcManager.subscriber : n.pcManager.publisher, o = i ? "Subscriber" : "Publisher";
11473
11473
  if (!s)
11474
- throw new ce("".concat(o, " connection not set"), z.InternalError);
11474
+ throw new ae("".concat(o, " connection not set"), z.InternalError);
11475
11475
  let a = !1;
11476
11476
  !i && !n.dataChannelForKind(t, i) && (n.createDataChannels(), a = !0), !a && !i && !n.pcManager.publisher.isICEConnected && n.pcManager.publisher.getICEConnectionState() !== "checking" && (a = !0), a && n.negotiate();
11477
11477
  const c = n.dataChannelForKind(t, i);
@@ -11483,7 +11483,7 @@ class yb extends Gt.EventEmitter {
11483
11483
  return;
11484
11484
  yield st(50);
11485
11485
  }
11486
- throw new ce("could not establish ".concat(o, " connection, state: ").concat(s.getICEConnectionState()), z.InternalError);
11486
+ throw new ae("could not establish ".concat(o, " connection, state: ").concat(s.getICEConnectionState()), z.InternalError);
11487
11487
  }();
11488
11488
  });
11489
11489
  }
@@ -11494,7 +11494,7 @@ class yb extends Gt.EventEmitter {
11494
11494
  }
11495
11495
  /* @internal */
11496
11496
  verifyTransport() {
11497
- return !(!this.pcManager || this.pcManager.currentState !== ve.CONNECTED || !this.client.ws || this.client.ws.readyState === WebSocket.CLOSED);
11497
+ return !(!this.pcManager || this.pcManager.currentState !== me.CONNECTED || !this.client.ws || this.client.ws.readyState === WebSocket.CLOSED);
11498
11498
  }
11499
11499
  /** @internal */
11500
11500
  negotiate() {
@@ -11647,7 +11647,7 @@ class Jc {
11647
11647
  const n = yield t.json();
11648
11648
  return this.lastUpdateAt = Date.now(), n;
11649
11649
  } else
11650
- throw new ce("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? z.NotAllowed : z.InternalError, t.status);
11650
+ throw new ae("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? z.NotAllowed : z.InternalError, t.status);
11651
11651
  });
11652
11652
  }
11653
11653
  setServerReportedRegions(e) {
@@ -12645,7 +12645,7 @@ class Lb extends $g {
12645
12645
  switch (s.value.case) {
12646
12646
  case "rpcResponse":
12647
12647
  let o = s.value.value, a = null, c = null;
12648
- o.value.case === "payload" ? a = o.value.value : o.value.case === "error" && (c = Ce.fromProto(o.value.value)), this.handleIncomingRpcResponse(o.requestId, a, c);
12648
+ o.value.case === "payload" ? a = o.value.value : o.value.case === "error" && (c = Be.fromProto(o.value.value)), this.handleIncomingRpcResponse(o.requestId, a, c);
12649
12649
  break;
12650
12650
  case "rpcAck":
12651
12651
  let l = s.value.value;
@@ -13099,7 +13099,7 @@ class Lb extends $g {
13099
13099
  !FC() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2", Object.assign({}, r.logContext)), p.simulcast = !1), p.source && (n.source = p.source);
13100
13100
  const g = new Promise((v, w) => m(r, void 0, void 0, function* () {
13101
13101
  try {
13102
- if (this.engine.client.currentState !== de.CONNECTED) {
13102
+ if (this.engine.client.currentState !== le.CONNECTED) {
13103
13103
  this.log.debug("deferring track publication until signal is connected", Object.assign(Object.assign({}, this.logContext), {
13104
13104
  track: ne(n)
13105
13105
  }));
@@ -13318,7 +13318,7 @@ class Lb extends $g {
13318
13318
  e = r.track, e.off(Q.Muted, this.onTrackMuted), e.off(Q.Unmuted, this.onTrackUnmuted), e.off(Q.Ended, this.handleTrackEnded), e.off(Q.UpstreamPaused, this.onTrackUpstreamPaused), e.off(Q.UpstreamResumed, this.onTrackUpstreamResumed), e.off(Q.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate), t === void 0 && (t = (i = (n = this.roomOptions) === null || n === void 0 ? void 0 : n.stopLocalTrackOnUnpublish) !== null && i !== void 0 ? i : !0), t ? e.stop() : e.stopMonitor();
13319
13319
  let o = !1;
13320
13320
  const a = e.sender;
13321
- if (e.sender = void 0, this.engine.pcManager && this.engine.pcManager.currentState < ve.FAILED && a)
13321
+ if (e.sender = void 0, this.engine.pcManager && this.engine.pcManager.currentState < me.FAILED && a)
13322
13322
  try {
13323
13323
  for (const c of this.engine.pcManager.publisher.getTransceivers())
13324
13324
  c.sender === a && (c.direction = "inactive", o = !0);
@@ -13701,17 +13701,17 @@ class Lb extends $g {
13701
13701
  return new Promise((c, l) => m(n, void 0, void 0, function* () {
13702
13702
  var d, u, h, f;
13703
13703
  if (ad(s) > Og) {
13704
- l(Ce.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));
13704
+ l(Be.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));
13705
13705
  return;
13706
13706
  }
13707
13707
  if (!((u = (d = this.engine.latestJoinResponse) === null || d === void 0 ? void 0 : d.serverInfo) === null || u === void 0) && u.version && gn((f = (h = this.engine.latestJoinResponse) === null || h === void 0 ? void 0 : h.serverInfo) === null || f === void 0 ? void 0 : f.version, "1.8.0") < 0) {
13708
- l(Ce.builtIn("UNSUPPORTED_SERVER"));
13708
+ l(Be.builtIn("UNSUPPORTED_SERVER"));
13709
13709
  return;
13710
13710
  }
13711
13711
  const p = crypto.randomUUID();
13712
13712
  yield this.publishRpcRequest(i, p, r, s, o - 2e3);
13713
13713
  const g = setTimeout(() => {
13714
- this.pendingAcks.delete(p), l(Ce.builtIn("CONNECTION_TIMEOUT")), this.pendingResponses.delete(p), clearTimeout(v);
13714
+ this.pendingAcks.delete(p), l(Be.builtIn("CONNECTION_TIMEOUT")), this.pendingResponses.delete(p), clearTimeout(v);
13715
13715
  }, 2e3);
13716
13716
  this.pendingAcks.set(p, {
13717
13717
  resolve: () => {
@@ -13720,7 +13720,7 @@ class Lb extends $g {
13720
13720
  participantIdentity: i
13721
13721
  });
13722
13722
  const v = setTimeout(() => {
13723
- this.pendingResponses.delete(p), l(Ce.builtIn("RESPONSE_TIMEOUT"));
13723
+ this.pendingResponses.delete(p), l(Be.builtIn("RESPONSE_TIMEOUT"));
13724
13724
  }, o);
13725
13725
  this.pendingResponses.set(p, {
13726
13726
  resolve: (w, y) => {
@@ -13803,7 +13803,7 @@ class Lb extends $g {
13803
13803
  participantIdentity: n,
13804
13804
  resolve: i
13805
13805
  }] of this.pendingResponses)
13806
- n === e && (i(null, Ce.builtIn("RECIPIENT_DISCONNECTED")), this.pendingResponses.delete(t));
13806
+ n === e && (i(null, Be.builtIn("RECIPIENT_DISCONNECTED")), this.pendingResponses.delete(t));
13807
13807
  }
13808
13808
  /** @internal */
13809
13809
  setEnabledPublishCodecs(e) {
@@ -14176,12 +14176,12 @@ class mn extends Gt.EventEmitter {
14176
14176
  try {
14177
14177
  yield this.attemptConnection(p ?? s, o, a, w), this.abortController = void 0, h();
14178
14178
  } catch (y) {
14179
- if (this.regionUrlProvider && y instanceof ce && y.reason !== z.Cancelled && y.reason !== z.NotAllowed) {
14179
+ if (this.regionUrlProvider && y instanceof ae && y.reason !== z.Cancelled && y.reason !== z.NotAllowed) {
14180
14180
  let B = null;
14181
14181
  try {
14182
14182
  B = yield this.regionUrlProvider.getNextBestRegionUrl((g = this.abortController) === null || g === void 0 ? void 0 : g.signal);
14183
14183
  } catch (C) {
14184
- if (C instanceof ce && (C.status === 401 || C.reason === z.Cancelled)) {
14184
+ if (C instanceof ae && (C.status === 401 || C.reason === z.Cancelled)) {
14185
14185
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), f(C);
14186
14186
  return;
14187
14187
  }
@@ -14189,7 +14189,7 @@ class mn extends Gt.EventEmitter {
14189
14189
  B && !(!((v = this.abortController) === null || v === void 0) && v.signal.aborted) ? (this.log.info("Initial connection failed with ConnectionError: ".concat(y.message, ". Retrying with another region: ").concat(B), this.logContext), this.recreateEngine(), yield d(h, f, B)) : (this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Tu(y)), f(y));
14190
14190
  } else {
14191
14191
  let B = Ft.UNKNOWN_REASON;
14192
- y instanceof ce && (B = Tu(y)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, B), f(y);
14192
+ y instanceof ae && (B = Tu(y)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, B), f(y);
14193
14193
  }
14194
14194
  }
14195
14195
  }), u = this.regionUrl;
@@ -14240,13 +14240,13 @@ class mn extends Gt.EventEmitter {
14240
14240
  this.applyJoinResponse(u), this.setupLocalParticipantEvents(), this.emit(k.SignalConnected);
14241
14241
  } catch (u) {
14242
14242
  yield this.engine.close(), this.recreateEngine();
14243
- const h = new ce("could not establish signal connection", z.ServerUnreachable);
14244
- throw u instanceof Error && (h.message = "".concat(h.message, ": ").concat(u.message)), u instanceof ce && (h.reason = u.reason, h.status = u.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
14243
+ const h = new ae("could not establish signal connection", z.ServerUnreachable);
14244
+ throw u instanceof Error && (h.message = "".concat(h.message, ": ").concat(u.message)), u instanceof ae && (h.reason = u.reason, h.status = u.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
14245
14245
  error: u
14246
14246
  })), h;
14247
14247
  }
14248
14248
  if (c.signal.aborted)
14249
- throw yield this.engine.close(), this.recreateEngine(), new ce("Connection attempt aborted", z.Cancelled);
14249
+ throw yield this.engine.close(), this.recreateEngine(), new ae("Connection attempt aborted", z.Cancelled);
14250
14250
  try {
14251
14251
  yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout, c);
14252
14252
  } catch (u) {
@@ -14267,7 +14267,7 @@ class mn extends Gt.EventEmitter {
14267
14267
  c.log.debug("already disconnected", c.logContext);
14268
14268
  return;
14269
14269
  }
14270
- c.log.info("disconnect from room", Object.assign({}, c.logContext)), (c.state === ee.Connecting || c.state === ee.Reconnecting || c.isResuming) && (c.log.warn("abort connection attempt", c.logContext), (d = c.abortController) === null || d === void 0 || d.abort(), (h = (u = c.connectFuture) === null || u === void 0 ? void 0 : u.reject) === null || h === void 0 || h.call(u, new ce("Client initiated disconnect", z.Cancelled)), c.connectFuture = void 0), !((f = c.engine) === null || f === void 0) && f.client.isDisconnected || (yield c.engine.client.sendLeave()), c.engine && (yield c.engine.close()), c.handleDisconnect(l, Ft.CLIENT_INITIATED), c.engine = void 0;
14270
+ c.log.info("disconnect from room", Object.assign({}, c.logContext)), (c.state === ee.Connecting || c.state === ee.Reconnecting || c.isResuming) && (c.log.warn("abort connection attempt", c.logContext), (d = c.abortController) === null || d === void 0 || d.abort(), (h = (u = c.connectFuture) === null || u === void 0 ? void 0 : u.reject) === null || h === void 0 || h.call(u, new ae("Client initiated disconnect", z.Cancelled)), c.connectFuture = void 0), !((f = c.engine) === null || f === void 0) && f.client.isDisconnected || (yield c.engine.client.sendLeave()), c.engine && (yield c.engine.close()), c.handleDisconnect(l, Ft.CLIENT_INITIATED), c.engine = void 0;
14271
14271
  } finally {
14272
14272
  p();
14273
14273
  }
@@ -14576,12 +14576,12 @@ class mn extends Gt.EventEmitter {
14576
14576
  handleIncomingRpcRequest(e, t, n, i, r, s) {
14577
14577
  return m(this, void 0, void 0, function* () {
14578
14578
  if (yield this.engine.publishRpcAck(e, t), s !== 1) {
14579
- yield this.engine.publishRpcResponse(e, t, null, Ce.builtIn("UNSUPPORTED_VERSION"));
14579
+ yield this.engine.publishRpcResponse(e, t, null, Be.builtIn("UNSUPPORTED_VERSION"));
14580
14580
  return;
14581
14581
  }
14582
14582
  const o = this.rpcHandlers.get(n);
14583
14583
  if (!o) {
14584
- yield this.engine.publishRpcResponse(e, t, null, Ce.builtIn("UNSUPPORTED_METHOD"));
14584
+ yield this.engine.publishRpcResponse(e, t, null, Be.builtIn("UNSUPPORTED_METHOD"));
14585
14585
  return;
14586
14586
  }
14587
14587
  let a = null, c = null;
@@ -14592,9 +14592,9 @@ class mn extends Gt.EventEmitter {
14592
14592
  payload: i,
14593
14593
  responseTimeout: r
14594
14594
  });
14595
- ad(l) > Og ? (a = Ce.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"), console.warn("RPC Response payload too large for ".concat(n))) : c = l;
14595
+ ad(l) > Og ? (a = Be.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"), console.warn("RPC Response payload too large for ".concat(n))) : c = l;
14596
14596
  } catch (l) {
14597
- l instanceof Ce ? a = l : (console.warn("Uncaught error returned by RPC handler for ".concat(n, ". Returning APPLICATION_ERROR instead."), l), a = Ce.builtIn("APPLICATION_ERROR"));
14597
+ l instanceof Be ? a = l : (console.warn("Uncaught error returned by RPC handler for ".concat(n, ". Returning APPLICATION_ERROR instead."), l), a = Be.builtIn("APPLICATION_ERROR"));
14598
14598
  }
14599
14599
  yield this.engine.publishRpcResponse(e, t, c, a);
14600
14600
  });
@@ -15823,7 +15823,7 @@ function qb(...A) {
15823
15823
  throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${A.length}.`);
15824
15824
  }
15825
15825
  function Le(A) {
15826
- return Object.assign(A, { optional: () => ld(A), and: (e) => ue(A, e), or: (e) => jg(A, e), select: (e) => e === void 0 ? mr(A) : mr(e, A) });
15826
+ return Object.assign(A, { optional: () => ld(A), and: (e) => de(A, e), or: (e) => jg(A, e), select: (e) => e === void 0 ? mr(A) : mr(e, A) });
15827
15827
  }
15828
15828
  function Yc(A) {
15829
15829
  return Object.assign(((e) => Object.assign(e, { [Symbol.iterator]() {
@@ -15855,7 +15855,7 @@ const zb = (A, e) => {
15855
15855
  return !1;
15856
15856
  return !0;
15857
15857
  };
15858
- function ue(...A) {
15858
+ function de(...A) {
15859
15859
  return Le({ [nt]: () => ({ match: (e) => {
15860
15860
  let t = {};
15861
15861
  const n = (i, r) => {
@@ -15897,18 +15897,18 @@ function pA(A) {
15897
15897
  const Wg = Le(q(function(A) {
15898
15898
  return !0;
15899
15899
  })), Zb = Wg, gA = (A) => Object.assign(Le(A), { startsWith: (e) => {
15900
- return gA(ue(A, (t = e, q((n) => fA(n) && n.startsWith(t)))));
15900
+ return gA(de(A, (t = e, q((n) => fA(n) && n.startsWith(t)))));
15901
15901
  var t;
15902
15902
  }, endsWith: (e) => {
15903
- return gA(ue(A, (t = e, q((n) => fA(n) && n.endsWith(t)))));
15903
+ return gA(de(A, (t = e, q((n) => fA(n) && n.endsWith(t)))));
15904
15904
  var t;
15905
- }, minLength: (e) => gA(ue(A, ((t) => q((n) => fA(n) && n.length >= t))(e))), length: (e) => gA(ue(A, ((t) => q((n) => fA(n) && n.length === t))(e))), maxLength: (e) => gA(ue(A, ((t) => q((n) => fA(n) && n.length <= t))(e))), includes: (e) => {
15906
- return gA(ue(A, (t = e, q((n) => fA(n) && n.includes(t)))));
15905
+ }, minLength: (e) => gA(de(A, ((t) => q((n) => fA(n) && n.length >= t))(e))), length: (e) => gA(de(A, ((t) => q((n) => fA(n) && n.length === t))(e))), maxLength: (e) => gA(de(A, ((t) => q((n) => fA(n) && n.length <= t))(e))), includes: (e) => {
15906
+ return gA(de(A, (t = e, q((n) => fA(n) && n.includes(t)))));
15907
15907
  var t;
15908
15908
  }, regex: (e) => {
15909
- return gA(ue(A, (t = e, q((n) => fA(n) && !!n.match(t)))));
15909
+ return gA(de(A, (t = e, q((n) => fA(n) && !!n.match(t)))));
15910
15910
  var t;
15911
- } }), ew = gA(q(fA)), Mt = (A) => Object.assign(Le(A), { between: (e, t) => Mt(ue(A, ((n, i) => q((r) => Ht(r) && n <= r && i >= r))(e, t))), lt: (e) => Mt(ue(A, ((t) => q((n) => Ht(n) && n < t))(e))), gt: (e) => Mt(ue(A, ((t) => q((n) => Ht(n) && n > t))(e))), lte: (e) => Mt(ue(A, ((t) => q((n) => Ht(n) && n <= t))(e))), gte: (e) => Mt(ue(A, ((t) => q((n) => Ht(n) && n >= t))(e))), int: () => Mt(ue(A, q((e) => Ht(e) && Number.isInteger(e)))), finite: () => Mt(ue(A, q((e) => Ht(e) && Number.isFinite(e)))), positive: () => Mt(ue(A, q((e) => Ht(e) && e > 0))), negative: () => Mt(ue(A, q((e) => Ht(e) && e < 0))) }), tw = Mt(q(Ht)), mA = (A) => Object.assign(Le(A), { between: (e, t) => mA(ue(A, ((n, i) => q((r) => pA(r) && n <= r && i >= r))(e, t))), lt: (e) => mA(ue(A, ((t) => q((n) => pA(n) && n < t))(e))), gt: (e) => mA(ue(A, ((t) => q((n) => pA(n) && n > t))(e))), lte: (e) => mA(ue(A, ((t) => q((n) => pA(n) && n <= t))(e))), gte: (e) => mA(ue(A, ((t) => q((n) => pA(n) && n >= t))(e))), positive: () => mA(ue(A, q((e) => pA(e) && e > 0))), negative: () => mA(ue(A, q((e) => pA(e) && e < 0))) }), Aw = mA(q(pA)), nw = Le(q(function(A) {
15911
+ } }), ew = gA(q(fA)), Mt = (A) => Object.assign(Le(A), { between: (e, t) => Mt(de(A, ((n, i) => q((r) => Ht(r) && n <= r && i >= r))(e, t))), lt: (e) => Mt(de(A, ((t) => q((n) => Ht(n) && n < t))(e))), gt: (e) => Mt(de(A, ((t) => q((n) => Ht(n) && n > t))(e))), lte: (e) => Mt(de(A, ((t) => q((n) => Ht(n) && n <= t))(e))), gte: (e) => Mt(de(A, ((t) => q((n) => Ht(n) && n >= t))(e))), int: () => Mt(de(A, q((e) => Ht(e) && Number.isInteger(e)))), finite: () => Mt(de(A, q((e) => Ht(e) && Number.isFinite(e)))), positive: () => Mt(de(A, q((e) => Ht(e) && e > 0))), negative: () => Mt(de(A, q((e) => Ht(e) && e < 0))) }), tw = Mt(q(Ht)), mA = (A) => Object.assign(Le(A), { between: (e, t) => mA(de(A, ((n, i) => q((r) => pA(r) && n <= r && i >= r))(e, t))), lt: (e) => mA(de(A, ((t) => q((n) => pA(n) && n < t))(e))), gt: (e) => mA(de(A, ((t) => q((n) => pA(n) && n > t))(e))), lte: (e) => mA(de(A, ((t) => q((n) => pA(n) && n <= t))(e))), gte: (e) => mA(de(A, ((t) => q((n) => pA(n) && n >= t))(e))), positive: () => mA(de(A, q((e) => pA(e) && e > 0))), negative: () => mA(de(A, q((e) => pA(e) && e < 0))) }), Aw = mA(q(pA)), nw = Le(q(function(A) {
15912
15912
  return typeof A == "boolean";
15913
15913
  })), iw = Le(q(function(A) {
15914
15914
  return typeof A == "symbol";
@@ -15969,7 +15969,7 @@ var ow = { __proto__: null, matcher: nt, optional: ld, array: function(...A) {
15969
15969
  return c && l;
15970
15970
  }), selections: t };
15971
15971
  }, getSelectionKeys: () => A.length === 0 ? [] : [...dt(A[0]), ...dt(A[1])] }) });
15972
- }, intersection: ue, union: jg, not: function(A) {
15972
+ }, intersection: de, union: jg, not: function(A) {
15973
15973
  return Le({ [nt]: () => ({ match: (e) => ({ matched: !Oe(A, e, () => {
15974
15974
  }) }), getSelectionKeys: () => [], matcherType: "not" }) });
15975
15975
  }, when: q, select: mr, any: Wg, _: Zb, string: ew, number: tw, bigint: Aw, boolean: nw, symbol: iw, nullish: rw, nonNullable: sw, instanceOf: function(A) {
@@ -16659,7 +16659,7 @@ class Bw {
16659
16659
  }).with("share_screen", () => {
16660
16660
  this.emitter.emit("screenShareRequested");
16661
16661
  }).with("prompt_user", () => {
16662
- this.emitter.emit("promptUser");
16662
+ console.log("[obi] prompt user received"), this.emitter.emit("promptUser");
16663
16663
  }).with("capture_page_html", () => {
16664
16664
  this.emitter.emit("capturePageHTML");
16665
16665
  }).with("fill", () => {
@@ -16685,7 +16685,7 @@ class Bw {
16685
16685
  t("error");
16686
16686
  }
16687
16687
  });
16688
- }))));
16688
+ }))), this.room.localParticipant.registerRpcMethod("mic_check", async (e) => await this.checkMic() ? "ok" : "error"));
16689
16689
  }
16690
16690
  /**
16691
16691
  * Connect to the LiveKit room.
@@ -16726,6 +16726,15 @@ class Bw {
16726
16726
  getCurrentState() {
16727
16727
  return this.currentState;
16728
16728
  }
16729
+ async checkMic() {
16730
+ let e = !1;
16731
+ try {
16732
+ e = (await navigator.permissions.query({ name: "microphone" })).state === "granted";
16733
+ } catch (t) {
16734
+ console.error("[obi] error checking microphone permission:", t);
16735
+ }
16736
+ return e && await this.shareMic(), this.emitter.emit("micCheck", e), e;
16737
+ }
16729
16738
  async requestMicrophone() {
16730
16739
  try {
16731
16740
  const e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
@@ -17190,7 +17199,7 @@ function se(A) {
17190
17199
  * Copyright 2017 Google LLC
17191
17200
  * SPDX-License-Identifier: BSD-3-Clause
17192
17201
  */
17193
- function ae(A) {
17202
+ function ce(A) {
17194
17203
  return se({ ...A, state: !0, attribute: !1 });
17195
17204
  }
17196
17205
  var xw = Object.defineProperty, Rw = Object.getOwnPropertyDescriptor, Pw = (A, e, t, n) => {
@@ -18170,7 +18179,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
18170
18179
  return e === 11 && A.type === 12 || e === 28 && A.type === 29 ? !0 : e === 2 && A.type === 3;
18171
18180
  }, PA = function(A) {
18172
18181
  return A.type === 17 || A.type === 15;
18173
- }, he = function(A) {
18182
+ }, ue = function(A) {
18174
18183
  return A.type === 16 || PA(A);
18175
18184
  }, pm = function(A) {
18176
18185
  return A.length > 1 ? [A[0], A[1]] : [A[0]];
@@ -18278,7 +18287,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
18278
18287
  return 0;
18279
18288
  }, Sn = function(A) {
18280
18289
  return (A[0].type === 20 ? A[0].value : "unknown") === "from";
18281
- }, be = function(A, e, t) {
18290
+ }, Ce = function(A, e, t) {
18282
18291
  return Math.min(Math.max(A, e), t);
18283
18292
  }, ot = function(A, e) {
18284
18293
  return [
@@ -18287,10 +18296,10 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
18287
18296
  A[6] * e[0] + A[7] * e[1] + A[8] * e[2]
18288
18297
  ];
18289
18298
  }, UE = function(A) {
18290
- return Vt(be(Math.round(A[0] * 255), 0, 255), be(Math.round(A[1] * 255), 0, 255), be(Math.round(A[2] * 255), 0, 255), be(A[3], 0, 1));
18299
+ return Vt(Ce(Math.round(A[0] * 255), 0, 255), Ce(Math.round(A[1] * 255), 0, 255), Ce(Math.round(A[2] * 255), 0, 255), Ce(A[3], 0, 1));
18291
18300
  }, gd = function(A) {
18292
18301
  var e = A[0], t = A[1], n = A[2], i = A[3], r = Un([e, t, n]);
18293
- return Vt(be(Math.round(r[0] * 255), 0, 255), be(Math.round(r[1] * 255), 0, 255), be(Math.round(r[2] * 255), 0, 255), i);
18302
+ return Vt(Ce(Math.round(r[0] * 255), 0, 255), Ce(Math.round(r[1] * 255), 0, 255), Ce(Math.round(r[2] * 255), 0, 255), i);
18294
18303
  }, Ir = function(A) {
18295
18304
  var e = KA([A[0], A[1], A[2]]);
18296
18305
  return gd([e[0], e[1], e[2], A[3]]);
@@ -18298,24 +18307,24 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
18298
18307
  if (Sn(e.filter(Ke)))
18299
18308
  throw new Error("Relative color not supported for lab()");
18300
18309
  var t = No(e), n = t[0], i = t[1], r = t[2], s = t[3], o = Un(KA(Vo([n, i, r])));
18301
- return Vt(be(Math.round(o[0] * 255), 0, 255), be(Math.round(o[1] * 255), 0, 255), be(Math.round(o[2] * 255), 0, 255), s);
18310
+ return Vt(Ce(Math.round(o[0] * 255), 0, 255), Ce(Math.round(o[1] * 255), 0, 255), Ce(Math.round(o[2] * 255), 0, 255), s);
18302
18311
  }, kE = function(A, e) {
18303
18312
  if (Sn(e.filter(Ke)))
18304
18313
  throw new Error("Relative color not supported for oklab()");
18305
18314
  var t = No(e), n = t[0], i = t[1], r = t[2], s = t[3], o = Un(KA($o([n, i, r])));
18306
- return Vt(be(Math.round(o[0] * 255), 0, 255), be(Math.round(o[1] * 255), 0, 255), be(Math.round(o[2] * 255), 0, 255), s);
18315
+ return Vt(Ce(Math.round(o[0] * 255), 0, 255), Ce(Math.round(o[1] * 255), 0, 255), Ce(Math.round(o[2] * 255), 0, 255), s);
18307
18316
  }, FE = function(A, e) {
18308
18317
  if (Sn(e.filter(Ke)))
18309
18318
  throw new Error("Relative color not supported for oklch()");
18310
18319
  var t = Em(e), n = t[0], i = t[1], r = t[2], s = t[3], o = Un(KA($o(Ko([n, i, r]))));
18311
- return Vt(be(Math.round(o[0] * 255), 0, 255), be(Math.round(o[1] * 255), 0, 255), be(Math.round(o[2] * 255), 0, 255), s);
18320
+ return Vt(Ce(Math.round(o[0] * 255), 0, 255), Ce(Math.round(o[1] * 255), 0, 255), Ce(Math.round(o[2] * 255), 0, 255), s);
18312
18321
  }, QE = function(A, e) {
18313
18322
  if (Sn(e.filter(Ke)))
18314
18323
  throw new Error("Relative color not supported for lch()");
18315
18324
  var t = ym(e), n = t[0], i = t[1], r = t[2], s = t[3], o = Un(KA(Vo(Ko([n, i, r]))));
18316
- return Vt(be(Math.round(o[0] * 255), 0, 255), be(Math.round(o[1] * 255), 0, 255), be(Math.round(o[2] * 255), 0, 255), s);
18325
+ return Vt(Ce(Math.round(o[0] * 255), 0, 255), Ce(Math.round(o[1] * 255), 0, 255), Ce(Math.round(o[2] * 255), 0, 255), s);
18317
18326
  }, wm = function(A, e) {
18318
- var t = e.filter(Ke), n = t[0], i = t[1], r = t[2], s = t[3], o = (n.type === 17 ? vt(n.number) : Mo.parse(A, n)) / (Math.PI * 2), a = he(i) ? i.number / 100 : 0, c = he(r) ? r.number / 100 : 0, l = typeof s < "u" && he(s) ? re(s, 1) : 1;
18327
+ var t = e.filter(Ke), n = t[0], i = t[1], r = t[2], s = t[3], o = (n.type === 17 ? vt(n.number) : Mo.parse(A, n)) / (Math.PI * 2), a = ue(i) ? i.number / 100 : 0, c = ue(r) ? r.number / 100 : 0, l = typeof s < "u" && ue(s) ? re(s, 1) : 1;
18319
18328
  return [o, a, c, l];
18320
18329
  }, ph = function(A, e) {
18321
18330
  if (Sn(e))
@@ -18323,13 +18332,13 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
18323
18332
  var t = wm(A, e), n = t[0], i = t[1], r = t[2], s = t[3], o = Um([n, i, r]);
18324
18333
  return Vt(o[0] * 255, o[1] * 255, o[2] * 255, i === 0 ? 1 : s);
18325
18334
  }, ym = function(A) {
18326
- var e = A.filter(Ke), t = he(e[0]) ? e[0].number : 0, n = he(e[1]) ? e[1].number : 0, i = Te(e[2]) || NA(e[2]) ? e[2].number : 0, r = typeof e[4] < "u" && he(e[4]) ? re(e[4], 1) : 1;
18335
+ var e = A.filter(Ke), t = ue(e[0]) ? e[0].number : 0, n = ue(e[1]) ? e[1].number : 0, i = Te(e[2]) || NA(e[2]) ? e[2].number : 0, r = typeof e[4] < "u" && ue(e[4]) ? re(e[4], 1) : 1;
18327
18336
  return [t, n, i, r];
18328
18337
  }, No = function(A) {
18329
- var e = A.filter(Ke), t = e[0].type === 16 ? e[0].number / 100 : Te(e[0]) ? e[0].number : 0, n = e[1].type === 16 ? e[1].number / 100 : Te(e[1]) ? e[1].number : 0, i = Te(e[2]) || NA(e[2]) ? e[2].number : 0, r = typeof e[4] < "u" && he(e[4]) ? re(e[4], 1) : 1;
18338
+ var e = A.filter(Ke), t = e[0].type === 16 ? e[0].number / 100 : Te(e[0]) ? e[0].number : 0, n = e[1].type === 16 ? e[1].number / 100 : Te(e[1]) ? e[1].number : 0, i = Te(e[2]) || NA(e[2]) ? e[2].number : 0, r = typeof e[4] < "u" && ue(e[4]) ? re(e[4], 1) : 1;
18330
18339
  return [t, n, i, r];
18331
18340
  }, Em = function(A) {
18332
- var e = A.filter(Ke), t = e[0].type === 16 ? e[0].number / 100 : Te(e[0]) ? e[0].number : 0, n = e[1].type === 16 ? e[1].number / 100 : Te(e[1]) ? e[1].number : 0, i = Te(e[2]) || NA(e[2]) ? e[2].number : 0, r = typeof e[4] < "u" && he(e[4]) ? re(e[4], 1) : 1;
18341
+ var e = A.filter(Ke), t = e[0].type === 16 ? e[0].number / 100 : Te(e[0]) ? e[0].number : 0, n = e[1].type === 16 ? e[1].number / 100 : Te(e[1]) ? e[1].number : 0, i = Te(e[2]) || NA(e[2]) ? e[2].number : 0, r = typeof e[4] < "u" && ue(e[4]) ? re(e[4], 1) : 1;
18333
18342
  return [t, n, i, r];
18334
18343
  }, Sm = function(A) {
18335
18344
  return ot(
@@ -18500,9 +18509,9 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
18500
18509
  }, NE = function(A) {
18501
18510
  var e = KA([A[0], A[1], A[2]]), t = e[0], n = e[1], i = e[2];
18502
18511
  return [
18503
- be(Math.round(t * 255), 0, 255),
18504
- be(Math.round(n * 255), 0, 255),
18505
- be(Math.round(i * 255), 0, 255),
18512
+ Ce(Math.round(t * 255), 0, 255),
18513
+ Ce(Math.round(n * 255), 0, 255),
18514
+ Ce(Math.round(i * 255), 0, 255),
18506
18515
  A[3]
18507
18516
  ];
18508
18517
  }, KE = function(A) {
@@ -19035,7 +19044,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
19035
19044
  format: "color"
19036
19045
  }, Go = function(A, e) {
19037
19046
  var t = _A.parse(A, e[0]), n = e[1];
19038
- return n && he(n) ? { color: t, stop: n } : { color: t, stop: null };
19047
+ return n && ue(n) ? { color: t, stop: n } : { color: t, stop: null };
19039
19048
  }, Ch = function(A, e) {
19040
19049
  var t = A[0], n = A[A.length - 1];
19041
19050
  t.stop === null && (t.stop = Me), n.stop === null && (n.stop = TA);
@@ -19211,7 +19220,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
19211
19220
  return r.push(TA), d;
19212
19221
  }
19213
19222
  else
19214
- (he(u) || PA(u)) && r.push(u);
19223
+ (ue(u) || PA(u)) && r.push(u);
19215
19224
  else if (W(u))
19216
19225
  switch (u.value) {
19217
19226
  case xm:
@@ -19231,7 +19240,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
19231
19240
  case _m:
19232
19241
  return n = 3, !1;
19233
19242
  }
19234
- else if (PA(u) || he(u))
19243
+ else if (PA(u) || ue(u))
19235
19244
  return Array.isArray(n) || (n = []), n.push(u), !1;
19236
19245
  return d;
19237
19246
  }, a);
@@ -19264,7 +19273,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
19264
19273
  case "bottom":
19265
19274
  return r.push(TA), !1;
19266
19275
  }
19267
- else if (he(d) || PA(d))
19276
+ else if (ue(d) || PA(d))
19268
19277
  return r.push(d), !1;
19269
19278
  return l;
19270
19279
  }, a) : o === 1 && (a = s.reduce(function(l, d) {
@@ -19285,7 +19294,7 @@ var Ay = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF
19285
19294
  case _m:
19286
19295
  return n = 3, !1;
19287
19296
  }
19288
- else if (PA(d) || he(d))
19297
+ else if (PA(d) || ue(d))
19289
19298
  return Array.isArray(n) || (n = []), n.push(d), !1;
19290
19299
  return l;
19291
19300
  }, a)), a) {
@@ -19378,7 +19387,7 @@ var Om = {
19378
19387
  prefix: !1,
19379
19388
  parse: function(A, e) {
19380
19389
  return jt(e).map(function(t) {
19381
- return t.filter(he);
19390
+ return t.filter(ue);
19382
19391
  }).map(pm);
19383
19392
  }
19384
19393
  }, xS = {
@@ -19422,7 +19431,7 @@ var PS = {
19422
19431
  });
19423
19432
  }
19424
19433
  }, DS = function(A) {
19425
- return W(A) || he(A);
19434
+ return W(A) || ue(A);
19426
19435
  }, jo = function(A) {
19427
19436
  return {
19428
19437
  name: "border-".concat(A, "-color"),
@@ -19438,7 +19447,7 @@ var PS = {
19438
19447
  prefix: !1,
19439
19448
  type: 1,
19440
19449
  parse: function(e, t) {
19441
- return pm(t.filter(he));
19450
+ return pm(t.filter(ue));
19442
19451
  }
19443
19452
  };
19444
19453
  }, NS = Wo("top-left"), KS = Wo("top-right"), $S = Wo("bottom-right"), VS = Wo("bottom-left"), Jo = function(A) {
@@ -19621,7 +19630,7 @@ var rU = {
19621
19630
  type: 4
19622
19631
  /* PropertyDescriptorParsingType.TOKEN_VALUE */
19623
19632
  }, wh = function(A, e) {
19624
- return W(A) && A.value === "normal" ? 1.2 * e : A.type === 17 ? e * A.number : he(A) ? re(A, e) : e;
19633
+ return W(A) && A.value === "normal" ? 1.2 * e : A.type === 17 ? e * A.number : ue(A) ? re(A, e) : e;
19625
19634
  }, oU = {
19626
19635
  name: "list-style-image",
19627
19636
  initialValue: "none",
@@ -19931,7 +19940,7 @@ var rU = {
19931
19940
  prefix: !0,
19932
19941
  type: 1,
19933
19942
  parse: function(A, e) {
19934
- var t = e.filter(he);
19943
+ var t = e.filter(ue);
19935
19944
  return t.length !== 2 ? TU : [t[0], t[1]];
19936
19945
  }
19937
19946
  }, FU = {
@@ -20379,7 +20388,7 @@ var QU = {
20379
20388
  return PA(o) ? o : Me;
20380
20389
  case "length-percentage":
20381
20390
  var a = r.parseComponentValue();
20382
- return he(a) ? a : Me;
20391
+ return ue(a) ? a : Me;
20383
20392
  case "time":
20384
20393
  return Lm.parse(A, r.parseComponentValue());
20385
20394
  }
@@ -22031,7 +22040,7 @@ var fe = function(A, e, t, n, i) {
22031
22040
  var n = e[0], i = e[1], r = e[2], s = A[0], o = A[1];
22032
22041
  if (!s)
22033
22042
  return [0, 0];
22034
- if (he(s) && o && he(o))
22043
+ if (ue(s) && o && ue(o))
22035
22044
  return [re(s, t.width), re(o, t.height)];
22036
22045
  var a = us(r);
22037
22046
  if (W(s) && (s.value === ii.CONTAIN || s.value === ii.COVER)) {
@@ -22056,10 +22065,10 @@ var fe = function(A, e, t, n, i) {
22056
22065
  }
22057
22066
  if (a) {
22058
22067
  var v = 0, w = 0;
22059
- return he(s) ? v = re(s, t.width) : he(o) && (w = re(o, t.height)), Vn(s) ? v = w * r : (!o || Vn(o)) && (w = v / r), [v, w];
22068
+ return ue(s) ? v = re(s, t.width) : ue(o) && (w = re(o, t.height)), Vn(s) ? v = w * r : (!o || Vn(o)) && (w = v / r), [v, w];
22060
22069
  }
22061
22070
  var y = null, B = null;
22062
- if (he(s) ? y = re(s, t.width) : o && he(o) && (B = re(o, t.height)), y !== null && (!o || Vn(o)) && (B = l && d ? y / n * i : t.height), B !== null && Vn(s) && (y = l && d ? B / i * n : t.width), y !== null && B !== null)
22071
+ if (ue(s) ? y = re(s, t.width) : o && ue(o) && (B = re(o, t.height)), y !== null && (!o || Vn(o)) && (B = l && d ? y / n * i : t.height), B !== null && Vn(s) && (y = l && d ? B / i * n : t.width), y !== null && B !== null)
22063
22072
  return [y, B];
22064
22073
  throw new Error("Unable to calculate background-size for element");
22065
22074
  }, jn = function(A, e) {
@@ -28027,13 +28036,13 @@ GA([
28027
28036
  se({ type: Function })
28028
28037
  ], Dt.prototype, "onClose", 2);
28029
28038
  GA([
28030
- ae()
28039
+ ce()
28031
28040
  ], Dt.prototype, "apiBaseUrl", 2);
28032
28041
  GA([
28033
- ae()
28042
+ ce()
28034
28043
  ], Dt.prototype, "selectedCourse", 2);
28035
28044
  GA([
28036
- ae()
28045
+ ce()
28037
28046
  ], Dt.prototype, "agentName", 2);
28038
28047
  customElements.get("obi-course-modal") || customElements.define("obi-course-modal", Dt);
28039
28048
  /**
@@ -28516,7 +28525,7 @@ tv([
28516
28525
  se({ type: Object })
28517
28526
  ], Or.prototype, "volume", 2);
28518
28527
  tv([
28519
- ae()
28528
+ ce()
28520
28529
  ], Or.prototype, "canvasRef", 2);
28521
28530
  customElements.get("obi-audio-equalizer") || customElements.define("obi-audio-equalizer", Or);
28522
28531
  var ax = Object.defineProperty, cx = Object.getOwnPropertyDescriptor, lx = (A, e, t, n) => {
@@ -28604,7 +28613,7 @@ aa.styles = ge`
28604
28613
  }
28605
28614
  `;
28606
28615
  lx([
28607
- ae()
28616
+ ce()
28608
28617
  ], aa.prototype, "activeDots", 2);
28609
28618
  customElements.get("obi-dot-loader") || customElements.define("obi-dot-loader", aa);
28610
28619
  let Dd = class extends Z {
@@ -29331,7 +29340,7 @@ const Gl = Px(class extends Dx {
29331
29340
  --obi-spinner-size: 16px;
29332
29341
  --obi-spinner-border-width: 2px;
29333
29342
  }
29334
- `, we = ge`
29343
+ `, be = ge`
29335
29344
  :host {
29336
29345
  box-sizing: border-box;
29337
29346
  font-family: var(--obi-font-family-secondary);
@@ -29431,7 +29440,7 @@ class Jt extends Z {
29431
29440
  }
29432
29441
  }
29433
29442
  Jt.styles = [
29434
- we,
29443
+ be,
29435
29444
  da,
29436
29445
  ge`
29437
29446
  :host {
@@ -29605,7 +29614,7 @@ class Md extends Z {
29605
29614
  }
29606
29615
  }
29607
29616
  Md.styles = [
29608
- we,
29617
+ be,
29609
29618
  da,
29610
29619
  ge`
29611
29620
  :host {
@@ -29703,7 +29712,7 @@ class lA extends Z {
29703
29712
  }
29704
29713
  }
29705
29714
  lA.styles = [
29706
- we,
29715
+ be,
29707
29716
  da,
29708
29717
  ge`
29709
29718
  :host {
@@ -29904,7 +29913,7 @@ class Ci extends Z {
29904
29913
  }
29905
29914
  }
29906
29915
  Ci.styles = [
29907
- we,
29916
+ be,
29908
29917
  da,
29909
29918
  ge`
29910
29919
  :host {
@@ -30048,7 +30057,7 @@ class WA extends Z {
30048
30057
  }
30049
30058
  }
30050
30059
  WA.styles = [
30051
- we,
30060
+ be,
30052
30061
  ge`
30053
30062
  :host {
30054
30063
  display: block;
@@ -30236,7 +30245,7 @@ class ha extends Z {
30236
30245
  }
30237
30246
  }
30238
30247
  ha.styles = [
30239
- we,
30248
+ be,
30240
30249
  ge`
30241
30250
  :host {
30242
30251
  display: block;
@@ -30396,7 +30405,7 @@ class In extends Z {
30396
30405
  `;
30397
30406
  }
30398
30407
  }
30399
- In.styles = [we];
30408
+ In.styles = [be];
30400
30409
  Lr([
30401
30410
  P({ type: Object })
30402
30411
  ], In.prototype, "session", 2);
@@ -30453,7 +30462,7 @@ class Nd extends Z {
30453
30462
  }
30454
30463
  }
30455
30464
  Nd.styles = [
30456
- we,
30465
+ be,
30457
30466
  ge`
30458
30467
  :host {
30459
30468
  display: block;
@@ -30589,7 +30598,7 @@ class JA extends Z {
30589
30598
  `;
30590
30599
  }
30591
30600
  }
30592
- JA.styles = [we];
30601
+ JA.styles = [be];
30593
30602
  wi([
30594
30603
  P({ type: Object })
30595
30604
  ], JA.prototype, "session", 2);
@@ -30642,7 +30651,7 @@ class cv extends Z {
30642
30651
  }
30643
30652
  }
30644
30653
  cv.styles = [
30645
- we,
30654
+ be,
30646
30655
  ge`
30647
30656
  :host {
30648
30657
  display: block;
@@ -30853,7 +30862,7 @@ class XA extends Z {
30853
30862
  `;
30854
30863
  }
30855
30864
  }
30856
- XA.styles = [we];
30865
+ XA.styles = [be];
30857
30866
  yi([
30858
30867
  P({ type: Object })
30859
30868
  ], XA.prototype, "session", 2);
@@ -30928,7 +30937,7 @@ class Ei extends Z {
30928
30937
  }
30929
30938
  }
30930
30939
  Ei.styles = [
30931
- we,
30940
+ be,
30932
30941
  ge`
30933
30942
  :host {
30934
30943
  display: flex;
@@ -31063,7 +31072,7 @@ class _n extends Z {
31063
31072
  `;
31064
31073
  }
31065
31074
  }
31066
- _n.styles = [we];
31075
+ _n.styles = [be];
31067
31076
  Hr([
31068
31077
  P({ type: Object })
31069
31078
  ], _n.prototype, "session", 2);
@@ -31099,7 +31108,7 @@ class lv extends Z {
31099
31108
  }
31100
31109
  }
31101
31110
  lv.styles = [
31102
- we,
31111
+ be,
31103
31112
  ge`
31104
31113
  :host {
31105
31114
  display: flex;
@@ -31256,7 +31265,7 @@ class Kd extends Z {
31256
31265
  }
31257
31266
  }
31258
31267
  Kd.styles = [
31259
- we,
31268
+ be,
31260
31269
  ge`
31261
31270
  :host {
31262
31271
  display: block;
@@ -31433,7 +31442,7 @@ class qA extends Z {
31433
31442
  `;
31434
31443
  }
31435
31444
  }
31436
- qA.styles = [we];
31445
+ qA.styles = [be];
31437
31446
  Si([
31438
31447
  P({ type: Object })
31439
31448
  ], qA.prototype, "session", 2);
@@ -31508,7 +31517,7 @@ class pa extends Z {
31508
31517
  }
31509
31518
  }
31510
31519
  pa.styles = [
31511
- we,
31520
+ be,
31512
31521
  ge`
31513
31522
  :host {
31514
31523
  --obi-modal-width: 640px;
@@ -31607,7 +31616,7 @@ class Ui extends Z {
31607
31616
  `;
31608
31617
  }
31609
31618
  }
31610
- Ui.styles = [we];
31619
+ Ui.styles = [be];
31611
31620
  ga([
31612
31621
  P({ type: Object })
31613
31622
  ], Ui.prototype, "session", 2);
@@ -31646,7 +31655,7 @@ class xn extends Z {
31646
31655
  `;
31647
31656
  }
31648
31657
  }
31649
- xn.styles = [we];
31658
+ xn.styles = [be];
31650
31659
  Mr([
31651
31660
  P({ type: Object })
31652
31661
  ], xn.prototype, "session", 2);
@@ -31684,7 +31693,7 @@ class Ti extends Z {
31684
31693
  `;
31685
31694
  }
31686
31695
  }
31687
- Ti.styles = [we];
31696
+ Ti.styles = [be];
31688
31697
  ma([
31689
31698
  P({ type: Object })
31690
31699
  ], Ti.prototype, "session", 2);
@@ -31722,7 +31731,7 @@ class ki extends Z {
31722
31731
  `;
31723
31732
  }
31724
31733
  }
31725
- ki.styles = [we];
31734
+ ki.styles = [be];
31726
31735
  va([
31727
31736
  P({ type: Object })
31728
31737
  ], ki.prototype, "session", 2);
@@ -31763,7 +31772,7 @@ class zA extends Z {
31763
31772
  `;
31764
31773
  }
31765
31774
  }
31766
- zA.styles = [we];
31775
+ zA.styles = [be];
31767
31776
  Fi([
31768
31777
  P({ type: Object })
31769
31778
  ], zA.prototype, "session", 2);
@@ -31783,18 +31792,18 @@ Fi([
31783
31792
  P({ type: Boolean, attribute: "close-disabled" })
31784
31793
  ], zA.prototype, "closeDisabled", 2);
31785
31794
  customElements.get("obi-voice-guidance-modal") || customElements.define("obi-voice-guidance-modal", zA);
31786
- var T2 = Object.defineProperty, k2 = Object.getOwnPropertyDescriptor, me = (A, e, t, n) => {
31795
+ var T2 = Object.defineProperty, k2 = Object.getOwnPropertyDescriptor, we = (A, e, t, n) => {
31787
31796
  for (var i = n > 1 ? void 0 : n ? k2(e, t) : e, r = A.length - 1, s; r >= 0; r--)
31788
31797
  (s = A[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
31789
31798
  return n && i && T2(e, t, i), i;
31790
31799
  };
31791
- let le = class extends Z {
31800
+ let he = class extends Z {
31792
31801
  constructor() {
31793
31802
  super(), this.apiKey = "", this.isActive = !0, this.linkOnlyAccess = !1, this.urlBlacklist = [], this.position = "bottom-right", this.user = null, this.state = M.READY, this.storedActiveState = void 0, this.showCourseModal = !1, this.showSessionStartModal = !1, this.showShareMicModal = !1, this.micShareEnabled = !1, this.showVoiceGuidanceModal = !1, this.voiceGuidanceEnabled = !1, this.selectedCourse = null, this.isHovering = !1, this.navVisible = !1, this.activeSession = null, this.volume = {
31794
31803
  speaker: "ASSISTANT",
31795
31804
  volume: 0,
31796
31805
  spectrum: []
31797
- }, this.databaseConfig = null, this.configLoaded = !1, this.configAllInCode = !1, this.primaryColor = "#9500FF", this.sessionToken = null, this.roomToken = null, this.roomUrl = null, this.boundSaveSessionData = null, this.obiClient = null, this.closeNavTimeoutRef = null, this.researchingTimeoutRef = null, this.urlCheckInterval = null, this.currentUrl = "", this.connectObi = Ni(
31806
+ }, this.databaseConfig = null, this.configLoaded = !1, this.primaryColor = "#9500FF", this.sessionToken = null, this.roomToken = null, this.roomUrl = null, this.boundSaveSessionData = null, this.obiClient = null, this.closeNavTimeoutRef = null, this.researchingTimeoutRef = null, this.urlCheckInterval = null, this.currentUrl = "", this.connectObi = Ni(
31798
31807
  async (e) => {
31799
31808
  if (this.activeSession) {
31800
31809
  te("connection_already_exists", { sessionToken: e }, "ObiWidget"), console.log("Connection already exists");
@@ -31920,7 +31929,7 @@ let le = class extends Z {
31920
31929
  componentName: "ObiWidget",
31921
31930
  handlerName: "handleSessionStart",
31922
31931
  sessionToken: e
31923
- }), this.activeSession.disconnect(), this.activeSession = null), this.showSessionStartModal = !1, this.showShareMicModal = !0, this.state = M.LOADING, er({ widgetState: this.state.toString() }), await this.connectObi(e);
31932
+ }), this.activeSession.disconnect(), this.activeSession = null), this.showSessionStartModal = !1, this.showVoiceGuidanceModal = !0, this.state = M.LOADING, er({ widgetState: this.state.toString() }), await this.connectObi(e);
31924
31933
  },
31925
31934
  "handleSessionStart",
31926
31935
  "ObiWidget"
@@ -31949,7 +31958,9 @@ let le = class extends Z {
31949
31958
  }
31950
31959
  if (!this.selectedCourse.id) {
31951
31960
  const i = "Session ID is missing.";
31952
- console.error("[SessionStartModal] Validation failed:", i, { session: this.selectedCourse }), Ge(i, {
31961
+ console.error("[SessionStartModal] Validation failed:", i, {
31962
+ session: this.selectedCourse
31963
+ }), Ge(i, {
31953
31964
  componentName: "SessionStartModal",
31954
31965
  handlerName: "handleSessionModalStart",
31955
31966
  sessionData: this.selectedCourse
@@ -32093,12 +32104,7 @@ let le = class extends Z {
32093
32104
  }
32094
32105
  }
32095
32106
  updateFromConfig() {
32096
- if (window.obiWidgetConfig) {
32097
- this.apiKey = window.obiWidgetConfig.apiKey || this.apiKey, window.obiWidgetConfig.position !== void 0 && (this.position = window.obiWidgetConfig.position, this.setAttribute("position", this.position)), window.obiWidgetConfig.primaryColor !== void 0 && (this.style.setProperty("--obi-primary", window.obiWidgetConfig.primaryColor), this.generateColorVariables(window.obiWidgetConfig.primaryColor)), window.obiWidgetConfig.user !== void 0 && (this.user = window.obiWidgetConfig.user), window.obiWidgetConfig.isActive !== void 0 && (this.isActive = window.obiWidgetConfig.isActive), window.obiWidgetConfig.linkOnlyAccess !== void 0 && (this.linkOnlyAccess = window.obiWidgetConfig.linkOnlyAccess), window.obiWidgetConfig.urlBlacklist !== void 0 && (this.urlBlacklist = window.obiWidgetConfig.urlBlacklist);
32098
- const e = window.obiWidgetConfig.position !== void 0, t = window.obiWidgetConfig.primaryColor !== void 0, n = window.obiWidgetConfig.linkOnlyAccess !== void 0, i = window.obiWidgetConfig.urlBlacklist !== void 0;
32099
- this.configAllInCode = e && t && n && i, this.configAllInCode ? (this.configLoaded = !0, this.applyFinalConfiguration()) : this.configLoaded || this.fetchDatabaseConfig(), window.obiWidgetConfig.showMenu === !0 && (this.state = M.LOADING, this.showCourseModal = !0, window.obiWidgetConfig.showMenu = !1);
32100
- } else
32101
- this.configLoaded || this.fetchDatabaseConfig();
32107
+ window.obiWidgetConfig ? (this.apiKey = window.obiWidgetConfig.apiKey || this.apiKey, window.obiWidgetConfig.position !== void 0 && (this.position = window.obiWidgetConfig.position, this.setAttribute("position", this.position)), window.obiWidgetConfig.primaryColor !== void 0 && (this.style.setProperty("--obi-primary", window.obiWidgetConfig.primaryColor), this.generateColorVariables(window.obiWidgetConfig.primaryColor)), window.obiWidgetConfig.user !== void 0 && (this.user = window.obiWidgetConfig.user), window.obiWidgetConfig.isActive !== void 0 && (this.isActive = window.obiWidgetConfig.isActive), window.obiWidgetConfig.linkOnlyAccess !== void 0 && (this.linkOnlyAccess = window.obiWidgetConfig.linkOnlyAccess), window.obiWidgetConfig.urlBlacklist !== void 0 && (this.urlBlacklist = window.obiWidgetConfig.urlBlacklist), this.fetchDatabaseConfig(), window.obiWidgetConfig.showMenu === !0 && (this.state = M.LOADING, this.showCourseModal = !0, window.obiWidgetConfig.showMenu = !1)) : this.configLoaded || this.fetchDatabaseConfig();
32102
32108
  }
32103
32109
  /**
32104
32110
  * Generate additional color variables based on the primary color
@@ -32151,8 +32157,12 @@ let le = class extends Z {
32151
32157
  console.error("Session error:", n), this.state = M.ERROR, this.activeSession = null, t && t();
32152
32158
  }), e.on("micShareRequested", () => {
32153
32159
  this.micShareEnabled = !0;
32160
+ }), e.on("micCheck", (n) => {
32161
+ n ? (this.showVoiceGuidanceModal = !1, this.showShareMicModal = !0) : (this.showShareMicModal = !0, this.showVoiceGuidanceModal = !1);
32154
32162
  }), e.on("promptUser", () => {
32155
32163
  this.voiceGuidanceEnabled = !0;
32164
+ }), e.on("micCheck", (n) => {
32165
+ n && (this.showVoiceGuidanceModal = !0, this.showShareMicModal = !1);
32156
32166
  });
32157
32167
  }
32158
32168
  /**
@@ -32331,67 +32341,64 @@ let le = class extends Z {
32331
32341
  ></obi-navigation-bar>
32332
32342
  ` : zt}
32333
32343
  </div>
32334
-
32344
+
32335
32345
  ${this.showCourseModal ? O`<obi-course-modal
32336
32346
  .onClose=${this.handleCloseModals.bind(this)}
32337
32347
  .apiKey=${this.apiKey}
32338
32348
  @course-select=${this.handleCourseSelectEvent}
32339
32349
  ></obi-course-modal>` : zt}
32340
-
32341
32350
  ${this.showSessionStartModal && this.selectedCourse ? O`
32342
- <obi-session-start-modal
32343
- .session=${this.selectedCourse ? {
32351
+ <obi-session-start-modal
32352
+ .session=${this.selectedCourse ? {
32344
32353
  id: this.selectedCourse.id,
32345
32354
  name: this.selectedCourse.name,
32346
32355
  description: this.selectedCourse.description,
32347
32356
  agentName: this.databaseConfig?.agentName
32348
32357
  } : {}}
32349
- ?open=${this.showSessionStartModal && !!this.selectedCourse}
32350
- color=${this.primaryColor}
32351
- @obi-start=${this.handleSessionModalStart}
32352
- @obi-close=${this.handleSessionModalClose}
32353
- @obi-error=${this.handleSessionModalError}
32354
- >
32355
- </obi-session-start-modal>
32356
- ` : zt}
32357
-
32358
+ ?open=${this.showSessionStartModal && !!this.selectedCourse}
32359
+ color=${this.primaryColor}
32360
+ @obi-start=${this.handleSessionModalStart}
32361
+ @obi-close=${this.handleSessionModalClose}
32362
+ @obi-error=${this.handleSessionModalError}
32363
+ >
32364
+ </obi-session-start-modal>
32365
+ ` : zt}
32358
32366
  ${this.showShareMicModal ? O`
32359
- <obi-share-mic-modal
32360
- .session=${this.selectedCourse ? {
32367
+ <obi-share-mic-modal
32368
+ .session=${this.selectedCourse ? {
32361
32369
  id: this.selectedCourse.id,
32362
32370
  name: this.selectedCourse.name,
32363
32371
  description: this.selectedCourse.description,
32364
32372
  agentName: this.databaseConfig?.agentName
32365
32373
  } : {}}
32366
- ?open=${this.showShareMicModal}
32367
- ?disabled=${!this.micShareEnabled}
32368
- color=${this.primaryColor}
32369
- @obi-continue=${this.handleShareMicModalContinue}
32370
- @obi-close=${this.handleShareMicModalClose}
32371
- >
32372
- </obi-share-mic-modal>
32373
- ` : zt}
32374
-
32374
+ ?open=${this.showShareMicModal}
32375
+ ?disabled=${!this.micShareEnabled}
32376
+ color=${this.primaryColor}
32377
+ @obi-continue=${this.handleShareMicModalContinue}
32378
+ @obi-close=${this.handleShareMicModalClose}
32379
+ >
32380
+ </obi-share-mic-modal>
32381
+ ` : zt}
32375
32382
  ${this.showVoiceGuidanceModal ? O`
32376
- <obi-voice-guidance-modal
32377
- .session=${this.selectedCourse ? {
32383
+ <obi-voice-guidance-modal
32384
+ .session=${this.selectedCourse ? {
32378
32385
  id: this.selectedCourse.id,
32379
32386
  name: this.selectedCourse.name,
32380
32387
  description: this.selectedCourse.description,
32381
32388
  agentName: this.databaseConfig?.agentName
32382
32389
  } : {}}
32383
- ?open=${this.showVoiceGuidanceModal}
32384
- ?disabled=${!this.voiceGuidanceEnabled}
32385
- color=${this.primaryColor}
32386
- @obi-continue=${this.handleVoiceGuidanceModalContinue}
32387
- @obi-close=${this.handleVoiceGuidanceModalClose}
32388
- >
32389
- </obi-voice-guidance-modal>
32390
- ` : zt}
32390
+ ?open=${this.showVoiceGuidanceModal}
32391
+ ?disabled=${!this.voiceGuidanceEnabled}
32392
+ color=${this.primaryColor}
32393
+ @obi-continue=${this.handleVoiceGuidanceModalContinue}
32394
+ @obi-close=${this.handleVoiceGuidanceModalClose}
32395
+ >
32396
+ </obi-voice-guidance-modal>
32397
+ ` : zt}
32391
32398
  `;
32392
32399
  }
32393
32400
  };
32394
- le.styles = ge`
32401
+ he.styles = ge`
32395
32402
  :host {
32396
32403
  display: block;
32397
32404
  position: fixed;
@@ -32541,76 +32548,73 @@ le.styles = ge`
32541
32548
  color-mix(in srgb, var(--obi-paused-pulse, #a06df9) 75%, transparent);
32542
32549
  }
32543
32550
  `;
32544
- me([
32545
- ae()
32546
- ], le.prototype, "apiKey", 2);
32547
- me([
32548
- ae()
32549
- ], le.prototype, "isActive", 2);
32550
- me([
32551
- ae()
32552
- ], le.prototype, "linkOnlyAccess", 2);
32553
- me([
32554
- ae()
32555
- ], le.prototype, "urlBlacklist", 2);
32556
- me([
32557
- ae()
32558
- ], le.prototype, "position", 2);
32559
- me([
32560
- ae()
32561
- ], le.prototype, "user", 2);
32562
- me([
32563
- ae()
32564
- ], le.prototype, "state", 2);
32565
- me([
32566
- ae()
32567
- ], le.prototype, "storedActiveState", 2);
32568
- me([
32569
- ae()
32570
- ], le.prototype, "showCourseModal", 2);
32571
- me([
32572
- ae()
32573
- ], le.prototype, "showSessionStartModal", 2);
32574
- me([
32575
- ae()
32576
- ], le.prototype, "showShareMicModal", 2);
32577
- me([
32578
- ae()
32579
- ], le.prototype, "micShareEnabled", 2);
32580
- me([
32581
- ae()
32582
- ], le.prototype, "showVoiceGuidanceModal", 2);
32583
- me([
32584
- ae()
32585
- ], le.prototype, "voiceGuidanceEnabled", 2);
32586
- me([
32587
- ae()
32588
- ], le.prototype, "selectedCourse", 2);
32589
- me([
32590
- ae()
32591
- ], le.prototype, "isHovering", 2);
32592
- me([
32593
- ae()
32594
- ], le.prototype, "navVisible", 2);
32595
- me([
32596
- ae()
32597
- ], le.prototype, "activeSession", 2);
32598
- me([
32599
- ae()
32600
- ], le.prototype, "volume", 2);
32601
- me([
32602
- ae()
32603
- ], le.prototype, "databaseConfig", 2);
32604
- me([
32605
- ae()
32606
- ], le.prototype, "configLoaded", 2);
32607
- me([
32608
- ae()
32609
- ], le.prototype, "configAllInCode", 2);
32610
- me([
32611
- ae()
32612
- ], le.prototype, "primaryColor", 2);
32613
- customElements.get("obi-widget") || customElements.define("obi-widget", le);
32551
+ we([
32552
+ ce()
32553
+ ], he.prototype, "apiKey", 2);
32554
+ we([
32555
+ ce()
32556
+ ], he.prototype, "isActive", 2);
32557
+ we([
32558
+ ce()
32559
+ ], he.prototype, "linkOnlyAccess", 2);
32560
+ we([
32561
+ ce()
32562
+ ], he.prototype, "urlBlacklist", 2);
32563
+ we([
32564
+ ce()
32565
+ ], he.prototype, "position", 2);
32566
+ we([
32567
+ ce()
32568
+ ], he.prototype, "user", 2);
32569
+ we([
32570
+ ce()
32571
+ ], he.prototype, "state", 2);
32572
+ we([
32573
+ ce()
32574
+ ], he.prototype, "storedActiveState", 2);
32575
+ we([
32576
+ ce()
32577
+ ], he.prototype, "showCourseModal", 2);
32578
+ we([
32579
+ ce()
32580
+ ], he.prototype, "showSessionStartModal", 2);
32581
+ we([
32582
+ ce()
32583
+ ], he.prototype, "showShareMicModal", 2);
32584
+ we([
32585
+ ce()
32586
+ ], he.prototype, "micShareEnabled", 2);
32587
+ we([
32588
+ ce()
32589
+ ], he.prototype, "showVoiceGuidanceModal", 2);
32590
+ we([
32591
+ ce()
32592
+ ], he.prototype, "voiceGuidanceEnabled", 2);
32593
+ we([
32594
+ ce()
32595
+ ], he.prototype, "selectedCourse", 2);
32596
+ we([
32597
+ ce()
32598
+ ], he.prototype, "isHovering", 2);
32599
+ we([
32600
+ ce()
32601
+ ], he.prototype, "navVisible", 2);
32602
+ we([
32603
+ ce()
32604
+ ], he.prototype, "activeSession", 2);
32605
+ we([
32606
+ ce()
32607
+ ], he.prototype, "volume", 2);
32608
+ we([
32609
+ ce()
32610
+ ], he.prototype, "databaseConfig", 2);
32611
+ we([
32612
+ ce()
32613
+ ], he.prototype, "configLoaded", 2);
32614
+ we([
32615
+ ce()
32616
+ ], he.prototype, "primaryColor", 2);
32617
+ customElements.get("obi-widget") || customElements.define("obi-widget", he);
32614
32618
  const J2 = Fr({
32615
32619
  tagName: "obi-course-modal",
32616
32620
  elementClass: Dt,
@@ -32629,7 +32633,7 @@ const J2 = Fr({
32629
32633
  react: Tr
32630
32634
  }), Y2 = Fr({
32631
32635
  tagName: "obi-widget",
32632
- elementClass: le,
32636
+ elementClass: he,
32633
32637
  react: Tr
32634
32638
  });
32635
32639
  export {