hanc-webrtc-widgets 2.2.14 → 2.3.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.
@@ -592,7 +592,7 @@ function ye(i) {
592
592
  * Copyright 2017 Google LLC
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
- function Ri(i) {
595
+ function An(i) {
596
596
  return ye({ ...i, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
@@ -1532,10 +1532,10 @@ function zg(i, e) {
1532
1532
  }
1533
1533
  return i.filter((t) => t.no === e.no);
1534
1534
  }
1535
- let gi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), co = [];
1536
- for (let i = 0; i < gi.length; i++) co[gi[i].charCodeAt(0)] = i;
1537
- co[45] = gi.indexOf("+");
1538
- co[95] = gi.indexOf("/");
1535
+ let vi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), co = [];
1536
+ for (let i = 0; i < vi.length; i++) co[vi[i].charCodeAt(0)] = i;
1537
+ co[45] = vi.indexOf("+");
1538
+ co[95] = vi.indexOf("/");
1539
1539
  const Tf = {
1540
1540
  /**
1541
1541
  * Decodes a base64 string to a byte array.
@@ -1596,16 +1596,16 @@ const Tf = {
1596
1596
  for (let r = 0; r < i.length; r++)
1597
1597
  switch (n = i[r], t) {
1598
1598
  case 0:
1599
- e += gi[n >> 2], s = (n & 3) << 4, t = 1;
1599
+ e += vi[n >> 2], s = (n & 3) << 4, t = 1;
1600
1600
  break;
1601
1601
  case 1:
1602
- e += gi[s | n >> 4], s = (n & 15) << 2, t = 2;
1602
+ e += vi[s | n >> 4], s = (n & 15) << 2, t = 2;
1603
1603
  break;
1604
1604
  case 2:
1605
- e += gi[s | n >> 6], e += gi[n & 63], t = 0;
1605
+ e += vi[s | n >> 6], e += vi[n & 63], t = 0;
1606
1606
  break;
1607
1607
  }
1608
- return t && (e += gi[s], e += "=", t == 1 && (e += "=")), e;
1608
+ return t && (e += vi[s], e += "=", t == 1 && (e += "=")), e;
1609
1609
  }
1610
1610
  };
1611
1611
  function Gg(i, e, t) {
@@ -1682,14 +1682,14 @@ function pu(i, e) {
1682
1682
  break;
1683
1683
  }
1684
1684
  }
1685
- function vi(i, e) {
1685
+ function bi(i, e) {
1686
1686
  if (i === null || typeof i != "object" || !Object.getOwnPropertyNames(cd.prototype).every((n) => n in i && typeof i[n] == "function"))
1687
1687
  return !1;
1688
1688
  const t = i.getType();
1689
1689
  return t === null || typeof t != "function" || !("typeName" in t) || typeof t.typeName != "string" ? !1 : e === void 0 ? !0 : t.typeName == e.typeName;
1690
1690
  }
1691
1691
  function wf(i, e) {
1692
- return vi(e) || !i.fieldWrapper ? e : i.fieldWrapper.wrapField(e);
1692
+ return bi(e) || !i.fieldWrapper ? e : i.fieldWrapper.wrapField(e);
1693
1693
  }
1694
1694
  Z.DOUBLE, Z.FLOAT, Z.INT64, Z.UINT64, Z.INT32, Z.UINT32, Z.BOOL, Z.STRING, Z.BYTES;
1695
1695
  const mu = {
@@ -1713,7 +1713,7 @@ function jg() {
1713
1713
  makeWriteOptions: qg,
1714
1714
  readMessage(i, e, t, n) {
1715
1715
  if (e == null || Array.isArray(e) || typeof e != "object")
1716
- throw new Error("cannot decode message ".concat(i.typeName, " from JSON: ").concat(jn(e)));
1716
+ throw new Error("cannot decode message ".concat(i.typeName, " from JSON: ").concat(Xn(e)));
1717
1717
  n = n ?? new i();
1718
1718
  const s = /* @__PURE__ */ new Map(), r = t.typeRegistry;
1719
1719
  for (const [a, o] of Object.entries(e)) {
@@ -1780,10 +1780,10 @@ function jg() {
1780
1780
  if (e !== void 0 && (t || Sf(i, e)))
1781
1781
  return ka(i, e);
1782
1782
  },
1783
- debug: jn
1783
+ debug: Xn
1784
1784
  };
1785
1785
  }
1786
- function jn(i) {
1786
+ function Xn(i) {
1787
1787
  if (i === null)
1788
1788
  return "null";
1789
1789
  switch (typeof i) {
@@ -1801,11 +1801,11 @@ function vu(i, e, t, n, s) {
1801
1801
  if (kt(t.kind != "map"), e === null)
1802
1802
  return;
1803
1803
  if (!Array.isArray(e))
1804
- throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e)));
1804
+ throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e)));
1805
1805
  const a = i[r];
1806
1806
  for (const o of e) {
1807
1807
  if (o === null)
1808
- throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(o)));
1808
+ throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(o)));
1809
1809
  switch (t.kind) {
1810
1810
  case "message":
1811
1811
  a.push(t.T.fromJson(o, n));
@@ -1818,7 +1818,7 @@ function vu(i, e, t, n, s) {
1818
1818
  try {
1819
1819
  a.push(Nr(t.T, o, t.L, !0));
1820
1820
  } catch (l) {
1821
- let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(o));
1821
+ let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(o));
1822
1822
  throw l instanceof Error && l.message.length > 0 && (d += ": ".concat(l.message)), new Error(d);
1823
1823
  }
1824
1824
  break;
@@ -1828,7 +1828,7 @@ function vu(i, e, t, n, s) {
1828
1828
  if (e === null)
1829
1829
  return;
1830
1830
  if (typeof e != "object" || Array.isArray(e))
1831
- throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e)));
1831
+ throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e)));
1832
1832
  const a = i[r];
1833
1833
  for (const [o, c] of Object.entries(e)) {
1834
1834
  if (c === null)
@@ -1837,7 +1837,7 @@ function vu(i, e, t, n, s) {
1837
1837
  try {
1838
1838
  l = Xg(t.K, o);
1839
1839
  } catch (d) {
1840
- let u = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e));
1840
+ let u = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e));
1841
1841
  throw d instanceof Error && d.message.length > 0 && (u += ": ".concat(d.message)), new Error(u);
1842
1842
  }
1843
1843
  switch (t.V.kind) {
@@ -1852,7 +1852,7 @@ function vu(i, e, t, n, s) {
1852
1852
  try {
1853
1853
  a[l] = Nr(t.V.T, c, Yi.BIGINT, !0);
1854
1854
  } catch (u) {
1855
- let h = "cannot decode map value for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e));
1855
+ let h = "cannot decode map value for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e));
1856
1856
  throw u instanceof Error && u.message.length > 0 && (h += ": ".concat(u.message)), new Error(h);
1857
1857
  }
1858
1858
  break;
@@ -1867,7 +1867,7 @@ function vu(i, e, t, n, s) {
1867
1867
  if (e === null && a.typeName != "google.protobuf.Value")
1868
1868
  return;
1869
1869
  let o = i[r];
1870
- vi(o) ? o.fromJson(e, n) : (i[r] = o = a.fromJson(e, n), a.fieldWrapper && !t.oneof && (i[r] = a.fieldWrapper.unwrapField(o)));
1870
+ bi(o) ? o.fromJson(e, n) : (i[r] = o = a.fromJson(e, n), a.fieldWrapper && !t.oneof && (i[r] = a.fieldWrapper.unwrapField(o)));
1871
1871
  break;
1872
1872
  case "enum":
1873
1873
  const c = ko(t.T, e, n.ignoreUnknownFields, !1);
@@ -1894,7 +1894,7 @@ function vu(i, e, t, n, s) {
1894
1894
  break;
1895
1895
  }
1896
1896
  } catch (l) {
1897
- let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e));
1897
+ let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e));
1898
1898
  throw l instanceof Error && l.message.length > 0 && (d += ": ".concat(l.message)), new Error(d);
1899
1899
  }
1900
1900
  break;
@@ -1989,7 +1989,7 @@ function ko(i, e, t, n) {
1989
1989
  return Pa;
1990
1990
  break;
1991
1991
  }
1992
- throw new Error("cannot decode enum ".concat(i.typeName, " from JSON: ").concat(jn(e)));
1992
+ throw new Error("cannot decode enum ".concat(i.typeName, " from JSON: ").concat(Xn(e)));
1993
1993
  }
1994
1994
  function $g(i) {
1995
1995
  return i.repeated || i.kind == "map" ? !0 : !(i.oneof || i.kind == "message" || i.opt || i.req);
@@ -2182,7 +2182,7 @@ function Su(i, e, t, n, s) {
2182
2182
  break;
2183
2183
  case "message":
2184
2184
  const l = t.T;
2185
- r ? i[a].push(Ia(e, new l(), s, t)) : vi(i[a]) ? Ia(e, i[a], s, t) : (i[a] = Ia(e, new l(), s, t), l.fieldWrapper && !t.oneof && !t.repeated && (i[a] = l.fieldWrapper.unwrapField(i[a])));
2185
+ r ? i[a].push(Ia(e, new l(), s, t)) : bi(i[a]) ? Ia(e, i[a], s, t) : (i[a] = Ia(e, new l(), s, t), l.fieldWrapper && !t.oneof && !t.repeated && (i[a] = l.fieldWrapper.unwrapField(i[a])));
2186
2186
  break;
2187
2187
  case "map":
2188
2188
  let [d, u] = Zg(t, e, s);
@@ -2392,7 +2392,7 @@ function nv() {
2392
2392
  continue;
2393
2393
  const c = n.findField(o);
2394
2394
  let l = a[s].value;
2395
- c && c.kind == "message" && !vi(l, c.T) ? l = new c.T(l) : c && c.kind === "scalar" && c.T === Z.BYTES && (l = mr(l)), r[s] = {
2395
+ c && c.kind == "message" && !bi(l, c.T) ? l = new c.T(l) : c && c.kind === "scalar" && c.T === Z.BYTES && (l = mr(l)), r[s] = {
2396
2396
  case: o,
2397
2397
  value: l
2398
2398
  };
@@ -2424,10 +2424,10 @@ function nv() {
2424
2424
  case "message":
2425
2425
  const u = n.T;
2426
2426
  if (n.repeated)
2427
- r[s] = a[s].map((h) => vi(h, u) ? h : new u(h));
2427
+ r[s] = a[s].map((h) => bi(h, u) ? h : new u(h));
2428
2428
  else {
2429
2429
  const h = a[s];
2430
- u.fieldWrapper ? /* We can't use BytesValue.typeName as that will create a circular import */ u.typeName === "google.protobuf.BytesValue" ? r[s] = mr(h) : r[s] = h : r[s] = vi(h, u) ? h : new u(h);
2430
+ u.fieldWrapper ? /* We can't use BytesValue.typeName as that will create a circular import */ u.typeName === "google.protobuf.BytesValue" ? r[s] = mr(h) : r[s] = h : r[s] = bi(h, u) ? h : new u(h);
2431
2431
  }
2432
2432
  break;
2433
2433
  }
@@ -2453,7 +2453,7 @@ function nv() {
2453
2453
  switch (n.kind) {
2454
2454
  case "message":
2455
2455
  let a = s, o = r;
2456
- return n.T.fieldWrapper && (a !== void 0 && !vi(a) && (a = n.T.fieldWrapper.wrapField(a)), o !== void 0 && !vi(o) && (o = n.T.fieldWrapper.wrapField(o))), n.T.equals(a, o);
2456
+ return n.T.fieldWrapper && (a !== void 0 && !bi(a) && (a = n.T.fieldWrapper.wrapField(a)), o !== void 0 && !bi(o) && (o = n.T.fieldWrapper.wrapField(o))), n.T.equals(a, o);
2457
2457
  case "enum":
2458
2458
  return ki(Z.INT32, s, r);
2459
2459
  case "scalar":
@@ -2518,7 +2518,7 @@ function nv() {
2518
2518
  function sa(i) {
2519
2519
  if (i === void 0)
2520
2520
  return i;
2521
- if (vi(i))
2521
+ if (bi(i))
2522
2522
  return i.clone();
2523
2523
  if (i instanceof Uint8Array) {
2524
2524
  const e = new Uint8Array(i.byteLength);
@@ -2915,7 +2915,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
2915
2915
  }, {
2916
2916
  no: 2,
2917
2917
  name: "REGRESSION"
2918
- }]), Ln = /* @__PURE__ */ z.makeEnum("livekit.TrackType", [{
2918
+ }]), Nn = /* @__PURE__ */ z.makeEnum("livekit.TrackType", [{
2919
2919
  no: 0,
2920
2920
  name: "AUDIO"
2921
2921
  }, {
@@ -2972,7 +2972,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
2972
2972
  }, {
2973
2973
  no: 2,
2974
2974
  name: "ENABLED"
2975
- }]), Fn = /* @__PURE__ */ z.makeEnum("livekit.DisconnectReason", [{
2975
+ }]), Bn = /* @__PURE__ */ z.makeEnum("livekit.DisconnectReason", [{
2976
2976
  no: 0,
2977
2977
  name: "UNKNOWN_REASON"
2978
2978
  }, {
@@ -3303,7 +3303,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
3303
3303
  no: 16,
3304
3304
  name: "disconnect_reason",
3305
3305
  kind: "enum",
3306
- T: z.getEnumType(Fn)
3306
+ T: z.getEnumType(Bn)
3307
3307
  }, {
3308
3308
  no: 18,
3309
3309
  name: "kind_details",
@@ -3386,7 +3386,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
3386
3386
  no: 2,
3387
3387
  name: "type",
3388
3388
  kind: "enum",
3389
- T: z.getEnumType(Ln)
3389
+ T: z.getEnumType(Nn)
3390
3390
  }, {
3391
3391
  no: 3,
3392
3392
  name: "name",
@@ -4286,7 +4286,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4286
4286
  }
4287
4287
  }], {
4288
4288
  localName: "DataStream_Trailer"
4289
- }), Nn = /* @__PURE__ */ z.makeEnum("livekit.SignalTarget", [{
4289
+ }), Un = /* @__PURE__ */ z.makeEnum("livekit.SignalTarget", [{
4290
4290
  no: 0,
4291
4291
  name: "PUBLISHER"
4292
4292
  }, {
@@ -4377,7 +4377,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4377
4377
  no: 13,
4378
4378
  name: "simulate",
4379
4379
  kind: "message",
4380
- T: qn,
4380
+ T: jn,
4381
4381
  oneof: "message"
4382
4382
  }, {
4383
4383
  no: 14,
@@ -4575,7 +4575,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4575
4575
  no: 3,
4576
4576
  name: "type",
4577
4577
  kind: "enum",
4578
- T: z.getEnumType(Ln)
4578
+ T: z.getEnumType(Nn)
4579
4579
  }, {
4580
4580
  no: 4,
4581
4581
  name: "width",
@@ -4667,7 +4667,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4667
4667
  no: 2,
4668
4668
  name: "target",
4669
4669
  kind: "enum",
4670
- T: z.getEnumType(Nn)
4670
+ T: z.getEnumType(Un)
4671
4671
  }, {
4672
4672
  no: 3,
4673
4673
  name: "final",
@@ -4934,7 +4934,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4934
4934
  no: 2,
4935
4935
  name: "reason",
4936
4936
  kind: "enum",
4937
- T: z.getEnumType(Fn)
4937
+ T: z.getEnumType(Bn)
4938
4938
  }, {
4939
4939
  no: 3,
4940
4940
  name: "action",
@@ -5253,8 +5253,8 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
5253
5253
  no: 3,
5254
5254
  name: "target",
5255
5255
  kind: "enum",
5256
- T: z.getEnumType(Nn)
5257
- }]), qn = /* @__PURE__ */ z.makeMessageType("livekit.SimulateScenario", () => [{
5256
+ T: z.getEnumType(Un)
5257
+ }]), jn = /* @__PURE__ */ z.makeMessageType("livekit.SimulateScenario", () => [{
5258
5258
  no: 1,
5259
5259
  name: "speaker_update",
5260
5260
  kind: "scalar",
@@ -5545,14 +5545,14 @@ var fo = Jv(), Lc;
5545
5545
  (function(i) {
5546
5546
  i[i.trace = 0] = "trace", i[i.debug = 1] = "debug", i[i.info = 2] = "info", i[i.warn = 3] = "warn", i[i.error = 4] = "error", i[i.silent = 5] = "silent";
5547
5547
  })(Lc || (Lc = {}));
5548
- var Vn;
5548
+ var zn;
5549
5549
  (function(i) {
5550
5550
  i.Default = "livekit", i.Room = "livekit-room", i.Participant = "livekit-participant", i.Track = "livekit-track", i.Publication = "livekit-track-publication", i.Engine = "livekit-engine", i.Signal = "livekit-signal", i.PCManager = "livekit-pc-manager", i.PCTransport = "livekit-pc-transport", i.E2EE = "lk-e2ee";
5551
- })(Vn || (Vn = {}));
5551
+ })(zn || (zn = {}));
5552
5552
  let $e = fo.getLogger("livekit");
5553
- Object.values(Vn).map((i) => fo.getLogger(i));
5553
+ Object.values(zn).map((i) => fo.getLogger(i));
5554
5554
  $e.setDefaultLevel(Lc.info);
5555
- function Ci(i) {
5555
+ function Ei(i) {
5556
5556
  const e = fo.getLogger(i);
5557
5557
  return e.setDefaultLevel($e.getLevel()), e;
5558
5558
  }
@@ -5612,7 +5612,7 @@ function wu(i) {
5612
5612
  };
5613
5613
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
5614
5614
  }
5615
- function bi(i) {
5615
+ function _i(i) {
5616
5616
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5617
5617
  var e = i[Symbol.asyncIterator], t;
5618
5618
  return e ? e.call(i) : (i = typeof wu == "function" ? wu(i) : i[Symbol.iterator](), t = {}, n("next"), n("throw"), n("return"), t[Symbol.asyncIterator] = function() {
@@ -5838,7 +5838,7 @@ function n0() {
5838
5838
  }
5839
5839
  return ra.exports;
5840
5840
  }
5841
- var ri = n0();
5841
+ var ai = n0();
5842
5842
  let rp = !0, ap = !0;
5843
5843
  function Rr(i, e, t) {
5844
5844
  const n = i.match(e);
@@ -7390,7 +7390,7 @@ function m0() {
7390
7390
  return typeof window.RTCRtpSender < "u" && // @ts-ignore
7391
7391
  typeof window.RTCRtpSender.prototype.createEncodedStreams < "u";
7392
7392
  }
7393
- class zE extends ri.EventEmitter {
7393
+ class zE extends ai.EventEmitter {
7394
7394
  constructor() {
7395
7395
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
7396
7396
  super(), this.onKeyRatcheted = (t, n, s) => {
@@ -7436,7 +7436,7 @@ var Ye;
7436
7436
  (function(i) {
7437
7437
  i[i.NotAllowed = 0] = "NotAllowed", i[i.ServerUnreachable = 1] = "ServerUnreachable", i[i.InternalError = 2] = "InternalError", i[i.Cancelled = 3] = "Cancelled", i[i.LeaveRequest = 4] = "LeaveRequest", i[i.Timeout = 5] = "Timeout";
7438
7438
  })(Ye || (Ye = {}));
7439
- class bt extends Pi {
7439
+ class St extends Pi {
7440
7440
  constructor(e, t, n, s) {
7441
7441
  super(1, e), this.name = "ConnectionError", this.status = n, this.reason = t, this.context = s, this.reasonName = Ye[t];
7442
7442
  }
@@ -7446,7 +7446,7 @@ class vd extends Pi {
7446
7446
  super(21, e ?? "device is unsupported"), this.name = "DeviceUnsupportedError";
7447
7447
  }
7448
7448
  }
7449
- class _i extends Pi {
7449
+ class yi extends Pi {
7450
7450
  constructor(e) {
7451
7451
  super(20, e ?? "track is invalid"), this.name = "TrackInvalidError";
7452
7452
  }
@@ -7476,13 +7476,13 @@ class Bu extends Pi {
7476
7476
  super(15, e), this.reason = t, this.reasonName = typeof t == "string" ? t : md[t];
7477
7477
  }
7478
7478
  }
7479
- var Un;
7479
+ var On;
7480
7480
  (function(i) {
7481
7481
  i[i.AlreadyOpened = 0] = "AlreadyOpened", i[i.AbnormalEnd = 1] = "AbnormalEnd", i[i.DecodeFailed = 2] = "DecodeFailed", i[i.LengthExceeded = 3] = "LengthExceeded", i[i.Incomplete = 4] = "Incomplete", i[i.HandlerAlreadyRegistered = 7] = "HandlerAlreadyRegistered";
7482
- })(Un || (Un = {}));
7482
+ })(On || (On = {}));
7483
7483
  class Gi extends Pi {
7484
7484
  constructor(e, t) {
7485
- super(16, e), this.name = "DataStreamError", this.reason = t, this.reasonName = Un[t];
7485
+ super(16, e), this.name = "DataStreamError", this.reason = t, this.reasonName = On[t];
7486
7486
  }
7487
7487
  }
7488
7488
  var Qa;
@@ -7603,7 +7603,7 @@ var _n;
7603
7603
  (function(i) {
7604
7604
  i[i.LOW = 0] = "LOW", i[i.MEDIUM = 1] = "MEDIUM", i[i.HIGH = 2] = "HIGH";
7605
7605
  })(_n || (_n = {}));
7606
- class J extends ri.EventEmitter {
7606
+ class J extends ai.EventEmitter {
7607
7607
  /**
7608
7608
  * indicates current state of stream, it'll indicate `paused` if the track
7609
7609
  * has been paused by congestion controller
@@ -7620,7 +7620,7 @@ class J extends ri.EventEmitter {
7620
7620
  var s;
7621
7621
  super(), this.attachedElements = [], this.isMuted = !1, this._streamState = J.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = $e, this.appVisibilityChangedListener = () => {
7622
7622
  this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), T0) : this.handleAppVisibilityChanged();
7623
- }, this.log = Ci((s = n.loggerName) !== null && s !== void 0 ? s : Vn.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = J.Source.Unknown;
7623
+ }, this.log = Ei((s = n.loggerName) !== null && s !== void 0 ? s : zn.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = J.Source.Unknown;
7624
7624
  }
7625
7625
  get logContext() {
7626
7626
  var e;
@@ -7684,7 +7684,7 @@ class J extends ri.EventEmitter {
7684
7684
  }
7685
7685
  /** @internal */
7686
7686
  updateLoggerOptions(e) {
7687
- e.loggerName && (this.log = Ci(e.loggerName)), e.loggerContextCb && (this.loggerContextCb = e.loggerContextCb);
7687
+ e.loggerName && (this.log = Ei(e.loggerName)), e.loggerContextCb && (this.loggerContextCb = e.loggerContextCb);
7688
7688
  }
7689
7689
  recycleElement(e) {
7690
7690
  if (e instanceof HTMLAudioElement) {
@@ -7740,19 +7740,19 @@ function Ys(i, e) {
7740
7740
  function s(l) {
7741
7741
  switch (l) {
7742
7742
  case e.Audio:
7743
- return Ln.AUDIO;
7743
+ return Nn.AUDIO;
7744
7744
  case e.Video:
7745
- return Ln.VIDEO;
7745
+ return Nn.VIDEO;
7746
7746
  default:
7747
- return Ln.DATA;
7747
+ return Nn.DATA;
7748
7748
  }
7749
7749
  }
7750
7750
  i.kindToProto = s;
7751
7751
  function r(l) {
7752
7752
  switch (l) {
7753
- case Ln.AUDIO:
7753
+ case Nn.AUDIO:
7754
7754
  return e.Audio;
7755
- case Ln.VIDEO:
7755
+ case Nn.VIDEO:
7756
7756
  return e.Video;
7757
7757
  default:
7758
7758
  return e.Unknown;
@@ -7916,7 +7916,7 @@ function P0() {
7916
7916
  return !1;
7917
7917
  if (xs()) {
7918
7918
  const t = yn();
7919
- if (t != null && t.version && ii(t.version, "16") < 0 || (t == null ? void 0 : t.os) === "iOS" && (t != null && t.osVersion) && ii(t.osVersion, "16") < 0)
7919
+ if (t != null && t.version && si(t.version, "16") < 0 || (t == null ? void 0 : t.os) === "iOS" && (t != null && t.osVersion) && si(t.osVersion, "16") < 0)
7920
7920
  return !1;
7921
7921
  }
7922
7922
  const i = RTCRtpSender.getCapabilities("video");
@@ -7930,7 +7930,7 @@ function P0() {
7930
7930
  }
7931
7931
  return e;
7932
7932
  }
7933
- function $n(i) {
7933
+ function Kn(i) {
7934
7934
  return i === "av1" || i === "vp9";
7935
7935
  }
7936
7936
  function Xc(i) {
@@ -7953,10 +7953,10 @@ function qr() {
7953
7953
  }
7954
7954
  function I0() {
7955
7955
  const i = yn();
7956
- return (i == null ? void 0 : i.name) === "Safari" && i.version.startsWith("17.") || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && ii(i.osVersion, "17") >= 0;
7956
+ return (i == null ? void 0 : i.name) === "Safari" && i.version.startsWith("17.") || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && si(i.osVersion, "17") >= 0;
7957
7957
  }
7958
7958
  function D0(i) {
7959
- return i || (i = yn()), (i == null ? void 0 : i.name) === "Safari" && ii(i.version, "18.3") > 0 || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && ii(i.osVersion, "18.3") > 0;
7959
+ return i || (i = yn()), (i == null ? void 0 : i.name) === "Safari" && si(i.version, "18.3") > 0 || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && si(i.osVersion, "18.3") > 0;
7960
7960
  }
7961
7961
  function Op() {
7962
7962
  var i, e;
@@ -7968,12 +7968,12 @@ function Op() {
7968
7968
  function L0() {
7969
7969
  const i = yn(), e = "17.2";
7970
7970
  if (i)
7971
- return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && ii(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && ii(i.version, e) >= 0;
7971
+ return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && si(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && si(i.version, e) >= 0;
7972
7972
  }
7973
7973
  function un() {
7974
7974
  return typeof document < "u";
7975
7975
  }
7976
- function ni() {
7976
+ function ii() {
7977
7977
  return navigator.product == "ReactNative";
7978
7978
  }
7979
7979
  function $c(i) {
@@ -7984,7 +7984,7 @@ function Fp() {
7984
7984
  return global.LiveKitReactNativeGlobal;
7985
7985
  }
7986
7986
  function Bp() {
7987
- if (!ni())
7987
+ if (!ii())
7988
7988
  return;
7989
7989
  let i = Fp();
7990
7990
  if (i)
@@ -7993,14 +7993,14 @@ function Bp() {
7993
7993
  function Hu() {
7994
7994
  if (un())
7995
7995
  return window.devicePixelRatio;
7996
- if (ni()) {
7996
+ if (ii()) {
7997
7997
  let i = Fp();
7998
7998
  if (i)
7999
7999
  return i.devicePixelRatio;
8000
8000
  }
8001
8001
  return 1;
8002
8002
  }
8003
- function ii(i, e) {
8003
+ function si(i, e) {
8004
8004
  const t = i.split("."), n = e.split("."), s = Math.min(t.length, n.length);
8005
8005
  for (let r = 0; r < s; ++r) {
8006
8006
  const a = parseInt(t[r], 10), o = parseInt(n[r], 10);
@@ -8032,7 +8032,7 @@ function O0() {
8032
8032
  protocol: x0,
8033
8033
  version: S0
8034
8034
  });
8035
- return ni() && (e.os = (i = Bp()) !== null && i !== void 0 ? i : ""), e;
8035
+ return ii() && (e.os = (i = Bp()) !== null && i !== void 0 ? i : ""), e;
8036
8036
  }
8037
8037
  function ju() {
8038
8038
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 16, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 16, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
@@ -8057,7 +8057,7 @@ function Fo() {
8057
8057
  }
8058
8058
  return _r.clone();
8059
8059
  }
8060
- class Kn {
8060
+ class Yn {
8061
8061
  get isResolved() {
8062
8062
  return this._isResolved;
8063
8063
  }
@@ -8133,13 +8133,13 @@ function Xu(i) {
8133
8133
  case Ye.LeaveRequest:
8134
8134
  return i.context;
8135
8135
  case Ye.Cancelled:
8136
- return Fn.CLIENT_INITIATED;
8136
+ return Bn.CLIENT_INITIATED;
8137
8137
  case Ye.NotAllowed:
8138
- return Fn.USER_REJECTED;
8138
+ return Bn.USER_REJECTED;
8139
8139
  case Ye.ServerUnreachable:
8140
- return Fn.JOIN_FAILURE;
8140
+ return Bn.JOIN_FAILURE;
8141
8141
  default:
8142
- return Fn.UNKNOWN_REASON;
8142
+ return Bn.UNKNOWN_REASON;
8143
8143
  }
8144
8144
  }
8145
8145
  function Va(i) {
@@ -8151,7 +8151,7 @@ function cs(i) {
8151
8151
  function Js(i) {
8152
8152
  return !!i && !(i instanceof MediaStreamTrack) && i.isLocal;
8153
8153
  }
8154
- function Zn(i) {
8154
+ function Qn(i) {
8155
8155
  return !!i && i.kind == J.Kind.Audio;
8156
8156
  }
8157
8157
  function Ji(i) {
@@ -8160,8 +8160,8 @@ function Ji(i) {
8160
8160
  function Ii(i) {
8161
8161
  return Js(i) && Ji(i);
8162
8162
  }
8163
- function hi(i) {
8164
- return Js(i) && Zn(i);
8163
+ function fi(i) {
8164
+ return Js(i) && Qn(i);
8165
8165
  }
8166
8166
  function Yc(i) {
8167
8167
  return !!i && !i.isLocal;
@@ -8398,7 +8398,7 @@ function J0(i, e) {
8398
8398
  var t;
8399
8399
  return (t = i.layers) === null || t === void 0 ? void 0 : t.find((n) => n.quality === e);
8400
8400
  }
8401
- class Z0 extends ri.EventEmitter {
8401
+ class Z0 extends ai.EventEmitter {
8402
8402
  constructor(e) {
8403
8403
  super(), this.onWorkerMessage = (t) => {
8404
8404
  var n, s;
@@ -8839,7 +8839,7 @@ class yd {
8839
8839
  var n;
8840
8840
  this.rtt = 0, this.state = Mt.DISCONNECTED, this.log = $e, this._requestId = 0, this.resetCallbacks = () => {
8841
8841
  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;
8842
- }, this.log = Ci((n = t.loggerName) !== null && n !== void 0 ? n : Vn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new Q0(), this.queuedRequests = [], this.closingLock = new hn(), this.connectionLock = new hn(), this.state = Mt.DISCONNECTED;
8842
+ }, this.log = Ei((n = t.loggerName) !== null && n !== void 0 ? n : zn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new Q0(), this.queuedRequests = [], this.closingLock = new hn(), this.connectionLock = new hn(), this.state = Mt.DISCONNECTED;
8843
8843
  }
8844
8844
  get logContext() {
8845
8845
  var e, t;
@@ -8870,9 +8870,9 @@ class yd {
8870
8870
  const u = yield this.connectionLock.lock();
8871
8871
  try {
8872
8872
  const h = () => P(this, void 0, void 0, function* () {
8873
- this.close(), clearTimeout(f), d(new bt("room connection has been cancelled (signal)", Ye.Cancelled));
8873
+ this.close(), clearTimeout(f), d(new St("room connection has been cancelled (signal)", Ye.Cancelled));
8874
8874
  }), f = setTimeout(() => {
8875
- this.close(), d(new bt("room connection has timed out (signal)", Ye.ServerUnreachable));
8875
+ this.close(), d(new St("room connection has timed out (signal)", Ye.ServerUnreachable));
8876
8876
  }, n.websocketTimeout);
8877
8877
  s != null && s.aborted && h(), s == null || s.addEventListener("abort", h);
8878
8878
  const g = new URL(o);
@@ -8888,11 +8888,11 @@ class yd {
8888
8888
  const m = yield fetch(c);
8889
8889
  if (m.status.toFixed(0).startsWith("4")) {
8890
8890
  const p = yield m.text();
8891
- d(new bt(p, Ye.NotAllowed, m.status));
8891
+ d(new St(p, Ye.NotAllowed, m.status));
8892
8892
  } else
8893
- d(new bt("Encountered unknown websocket error during connection: ".concat(v.toString()), Ye.InternalError, m.status));
8893
+ d(new St("Encountered unknown websocket error during connection: ".concat(v.toString()), Ye.InternalError, m.status));
8894
8894
  } catch (m) {
8895
- d(new bt(m instanceof Error ? m.message : "server was not reachable", Ye.ServerUnreachable));
8895
+ d(new St(m instanceof Error ? m.message : "server was not reachable", Ye.ServerUnreachable));
8896
8896
  }
8897
8897
  return;
8898
8898
  }
@@ -8916,12 +8916,12 @@ class yd {
8916
8916
  if (((m = C.message) === null || m === void 0 ? void 0 : m.case) === "join" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.pingTimeoutDuration = C.message.value.pingTimeout, this.pingIntervalDuration = C.message.value.pingInterval, this.pingTimeoutDuration && this.pingTimeoutDuration > 0 && (this.log.debug("ping config", Object.assign(Object.assign({}, this.logContext), {
8917
8917
  timeout: this.pingTimeoutDuration,
8918
8918
  interval: this.pingIntervalDuration
8919
- })), this.startPingInterval()), l(C.message.value)) : this.state === Mt.RECONNECTING && C.message.case !== "leave" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((p = C.message) === null || p === void 0 ? void 0 : p.case) === "reconnect" ? l(C.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), b = !0)) : this.isEstablishingConnection && C.message.case === "leave" ? d(new bt("Received leave request while trying to (re)connect", Ye.LeaveRequest, void 0, C.message.value.reason)) : n.reconnect || d(new bt("did not receive join response, got ".concat((x = C.message) === null || x === void 0 ? void 0 : x.case, " instead"), Ye.InternalError)), !b)
8919
+ })), this.startPingInterval()), l(C.message.value)) : this.state === Mt.RECONNECTING && C.message.case !== "leave" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((p = C.message) === null || p === void 0 ? void 0 : p.case) === "reconnect" ? l(C.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), b = !0)) : this.isEstablishingConnection && C.message.case === "leave" ? d(new St("Received leave request while trying to (re)connect", Ye.LeaveRequest, void 0, C.message.value.reason)) : n.reconnect || d(new St("did not receive join response, got ".concat((x = C.message) === null || x === void 0 ? void 0 : x.case, " instead"), Ye.InternalError)), !b)
8920
8920
  return;
8921
8921
  }
8922
8922
  this.signalLatency && (yield fn(this.signalLatency)), this.handleSignalResponse(C);
8923
8923
  }), this.ws.onclose = (v) => {
8924
- this.isEstablishingConnection && d(new bt("Websocket got closed during a (re)connection attempt", Ye.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8924
+ this.isEstablishingConnection && d(new St("Websocket got closed during a (re)connection attempt", Ye.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8925
8925
  reason: v.reason,
8926
8926
  code: v.code,
8927
8927
  wasClean: v.wasClean,
@@ -9084,7 +9084,7 @@ class yd {
9084
9084
  return this.sendRequest({
9085
9085
  case: "leave",
9086
9086
  value: new ho({
9087
- reason: Fn.CLIENT_INITIATED,
9087
+ reason: Bn.CLIENT_INITIATED,
9088
9088
  // server doesn't process this field, keeping it here to indicate the intent of a full disconnect
9089
9089
  action: $s.DISCONNECT
9090
9090
  })
@@ -9221,7 +9221,7 @@ function eo(i, e) {
9221
9221
  function rb(i, e, t) {
9222
9222
  var n;
9223
9223
  const s = new URLSearchParams();
9224
- return s.set("access_token", i), t.reconnect && (s.set("reconnect", "1"), t.sid && s.set("sid", t.sid)), s.set("auto_subscribe", t.autoSubscribe ? "1" : "0"), s.set("sdk", ni() ? "reactnative" : "js"), s.set("version", e.version), s.set("protocol", e.protocol.toString()), e.deviceModel && s.set("device_model", e.deviceModel), e.os && s.set("os", e.os), e.osVersion && s.set("os_version", e.osVersion), e.browser && s.set("browser", e.browser), e.browserVersion && s.set("browser_version", e.browserVersion), t.adaptiveStream && s.set("adaptive_stream", "1"), t.reconnectReason && s.set("reconnect_reason", t.reconnectReason.toString()), !((n = navigator.connection) === null || n === void 0) && n.type && s.set("network", navigator.connection.type), s;
9224
+ return s.set("access_token", i), t.reconnect && (s.set("reconnect", "1"), t.sid && s.set("sid", t.sid)), s.set("auto_subscribe", t.autoSubscribe ? "1" : "0"), s.set("sdk", ii() ? "reactnative" : "js"), s.set("version", e.version), s.set("protocol", e.protocol.toString()), e.deviceModel && s.set("device_model", e.deviceModel), e.os && s.set("os", e.os), e.osVersion && s.set("os_version", e.osVersion), e.browser && s.set("browser", e.browser), e.browserVersion && s.set("browser_version", e.browserVersion), t.adaptiveStream && s.set("adaptive_stream", "1"), t.reconnectReason && s.set("reconnect_reason", t.reconnectReason.toString()), !((n = navigator.connection) === null || n === void 0) && n.type && s.set("network", navigator.connection.type), s;
9225
9225
  }
9226
9226
  class Yu {
9227
9227
  constructor() {
@@ -9317,7 +9317,7 @@ class ab {
9317
9317
  return e;
9318
9318
  }
9319
9319
  }
9320
- var An = {}, zo = {}, Go = { exports: {} }, Ju;
9320
+ var Rn = {}, zo = {}, Go = { exports: {} }, Ju;
9321
9321
  function Sd() {
9322
9322
  if (Ju) return Go.exports;
9323
9323
  Ju = 1;
@@ -9902,10 +9902,10 @@ function cb() {
9902
9902
  }
9903
9903
  var eh;
9904
9904
  function lb() {
9905
- if (eh) return An;
9905
+ if (eh) return Rn;
9906
9906
  eh = 1;
9907
9907
  var i = ob(), e = cb(), t = Sd();
9908
- return An.grammar = t, An.write = e, An.parse = i.parse, An.parseParams = i.parseParams, An.parseFmtpConfig = i.parseFmtpConfig, An.parsePayloads = i.parsePayloads, An.parseRemoteCandidates = i.parseRemoteCandidates, An.parseImageAttributes = i.parseImageAttributes, An.parseSimulcastStreamList = i.parseSimulcastStreamList, An;
9908
+ return Rn.grammar = t, Rn.write = e, Rn.parse = i.parse, Rn.parseParams = i.parseParams, Rn.parseFmtpConfig = i.parseFmtpConfig, Rn.parsePayloads = i.parsePayloads, Rn.parseRemoteCandidates = i.parseRemoteCandidates, Rn.parseImageAttributes = i.parseImageAttributes, Rn.parseSimulcastStreamList = i.parseSimulcastStreamList, Rn;
9909
9909
  }
9910
9910
  var Vi = lb();
9911
9911
  function xd(i, e, t) {
@@ -9951,7 +9951,7 @@ const db = 0.7, ub = 20, Zs = {
9951
9951
  NegotiationComplete: "negotiationComplete",
9952
9952
  RTPVideoPayloadTypes: "rtpVideoPayloadTypes"
9953
9953
  };
9954
- class th extends ri.EventEmitter {
9954
+ class th extends ai.EventEmitter {
9955
9955
  get pc() {
9956
9956
  return this._pc || (this._pc = this.createPC()), this._pc;
9957
9957
  }
@@ -9970,7 +9970,7 @@ class th extends ri.EventEmitter {
9970
9970
  }
9971
9971
  }), ub), this.close = () => {
9972
9972
  this._pc && (this._pc.close(), this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc.onicegatheringstatechange = null, this._pc.ondatachannel = null, this._pc.onnegotiationneeded = null, this._pc.onsignalingstatechange = null, this._pc.onicecandidate = null, this._pc.ondatachannel = null, this._pc.ontrack = null, this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc = null);
9973
- }, this.log = Ci((n = t.loggerName) !== null && n !== void 0 ? n : Vn.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new hn();
9973
+ }, this.log = Ei((n = t.loggerName) !== null && n !== void 0 ? n : zn.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new hn();
9974
9974
  }
9975
9975
  createPC() {
9976
9976
  const e = new RTCPeerConnection(this.config);
@@ -10087,7 +10087,7 @@ class th extends ri.EventEmitter {
10087
10087
  if (!o.msid || !c.cid || !o.msid.includes(c.cid))
10088
10088
  return !1;
10089
10089
  let l = 0;
10090
- if (o.rtp.some((u) => u.codec.toUpperCase() === c.codec.toUpperCase() ? (l = u.payload, !0) : !1), l === 0 || ($n(c.codec) && !xs() && this.ensureVideoDDExtensionForSVC(o, a), c.codec !== "av1"))
10090
+ if (o.rtp.some((u) => u.codec.toUpperCase() === c.codec.toUpperCase() ? (l = u.payload, !0) : !1), l === 0 || (Kn(c.codec) && !xs() && this.ensureVideoDDExtensionForSVC(o, a), c.codec !== "av1"))
10091
10091
  return !0;
10092
10092
  const d = Math.round(c.maxbr * db);
10093
10093
  for (const u of o.fmtp)
@@ -10335,12 +10335,12 @@ class mb {
10335
10335
  var r;
10336
10336
  const a = this.state, o = this.requiredTransports.map((c) => c.getConnectionState());
10337
10337
  o.every((c) => c === "connected") ? this.state = Pt.CONNECTED : o.some((c) => c === "failed") ? this.state = Pt.FAILED : o.some((c) => c === "connecting") ? this.state = Pt.CONNECTING : o.every((c) => c === "closed") ? this.state = Pt.CLOSED : o.some((c) => c === "closed") ? this.state = Pt.CLOSING : o.every((c) => c === "new") && (this.state = Pt.NEW), a !== this.state && (this.log.debug("pc state change: from ".concat(Pt[a], " to ").concat(Pt[this.state]), this.logContext), (r = this.onStateChange) === null || r === void 0 || r.call(this, this.state, this.publisher.getConnectionState(), this.subscriber.getConnectionState()));
10338
- }, this.log = Ci((s = n.loggerName) !== null && s !== void 0 ? s : Vn.PCManager), this.loggerOptions = n, this.isPublisherConnectionRequired = !t, this.isSubscriberConnectionRequired = t, this.publisher = new th(e, n), this.subscriber = new th(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) => {
10338
+ }, this.log = Ei((s = n.loggerName) !== null && s !== void 0 ? s : zn.PCManager), this.loggerOptions = n, this.isPublisherConnectionRequired = !t, this.isSubscriberConnectionRequired = t, this.publisher = new th(e, n), this.subscriber = new th(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) => {
10339
10339
  var a;
10340
- (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Nn.PUBLISHER);
10340
+ (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Un.PUBLISHER);
10341
10341
  }, this.subscriber.onIceCandidate = (r) => {
10342
10342
  var a;
10343
- (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Nn.SUBSCRIBER);
10343
+ (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Un.SUBSCRIBER);
10344
10344
  }, this.subscriber.onDataChannel = (r) => {
10345
10345
  var a;
10346
10346
  (a = this.onDataChannel) === null || a === void 0 || a.call(this, r);
@@ -10398,7 +10398,7 @@ class mb {
10398
10398
  }
10399
10399
  addIceCandidate(e, t) {
10400
10400
  return P(this, void 0, void 0, function* () {
10401
- t === Nn.PUBLISHER ? yield this.publisher.addIceCandidate(e) : yield this.subscriber.addIceCandidate(e);
10401
+ t === Un.PUBLISHER ? yield this.publisher.addIceCandidate(e) : yield this.subscriber.addIceCandidate(e);
10402
10402
  });
10403
10403
  }
10404
10404
  createSubscriberAnswerFromOffer(e, t) {
@@ -10461,7 +10461,7 @@ class mb {
10461
10461
  * Returns the first required transport's address if no explicit target is specified
10462
10462
  */
10463
10463
  getConnectedAddress(e) {
10464
- return e === Nn.PUBLISHER ? this.publisher.getConnectedAddress() : e === Nn.SUBSCRIBER ? this.publisher.getConnectedAddress() : this.requiredTransports[0].getConnectedAddress();
10464
+ return e === Un.PUBLISHER ? this.publisher.getConnectedAddress() : e === Un.SUBSCRIBER ? this.publisher.getConnectedAddress() : this.requiredTransports[0].getConnectedAddress();
10465
10465
  }
10466
10466
  get requiredTransports() {
10467
10467
  const e = [];
@@ -10475,15 +10475,15 @@ class mb {
10475
10475
  if (n.getConnectionState() !== "connected")
10476
10476
  return new Promise((c, l) => P(r, void 0, void 0, function* () {
10477
10477
  const d = () => {
10478
- this.log.warn("abort transport connection", this.logContext), Kt.clearTimeout(u), l(new bt("room connection has been cancelled", Ye.Cancelled));
10478
+ this.log.warn("abort transport connection", this.logContext), Kt.clearTimeout(u), l(new St("room connection has been cancelled", Ye.Cancelled));
10479
10479
  };
10480
10480
  s != null && s.signal.aborted && d(), s == null || s.signal.addEventListener("abort", d);
10481
10481
  const u = Kt.setTimeout(() => {
10482
- s == null || s.signal.removeEventListener("abort", d), l(new bt("could not establish pc connection", Ye.InternalError));
10482
+ s == null || s.signal.removeEventListener("abort", d), l(new St("could not establish pc connection", Ye.InternalError));
10483
10483
  }, a);
10484
10484
  for (; this.state !== Pt.CONNECTED; )
10485
10485
  if (yield fn(50), s != null && s.signal.aborted) {
10486
- l(new bt("room connection has been cancelled", Ye.Cancelled));
10486
+ l(new St("room connection has been cancelled", Ye.Cancelled));
10487
10487
  return;
10488
10488
  }
10489
10489
  Kt.clearTimeout(u), s == null || s.signal.removeEventListener("abort", d), c();
@@ -10733,7 +10733,7 @@ class $p extends J {
10733
10733
  return r;
10734
10734
  yield fn(50);
10735
10735
  }
10736
- throw new _i("unable to get track dimensions after timeout");
10736
+ throw new yi("unable to get track dimensions after timeout");
10737
10737
  }();
10738
10738
  });
10739
10739
  }
@@ -10775,7 +10775,7 @@ class $p extends J {
10775
10775
  const n = yield this.trackChangeLock.lock();
10776
10776
  try {
10777
10777
  if (!this.sender)
10778
- throw new _i("unable to replace an unpublished track");
10778
+ throw new yi("unable to replace an unpublished track");
10779
10779
  let s, r;
10780
10780
  return typeof t == "boolean" ? s = t : t !== void 0 && (s = t.userProvidedTrack, r = t.stopProcessor), this.providedByUser = s ?? !0, this.log.debug("replace MediaStreamTrack", this.logContext), yield this.setMediaStreamTrack(e), r && this.processor && (yield this.internalStopProcessor()), this;
10781
10781
  } finally {
@@ -10854,7 +10854,7 @@ class $p extends J {
10854
10854
  }
10855
10855
  this._isUpstreamPaused = !0, this.emit(re.UpstreamPaused, this);
10856
10856
  const n = yn();
10857
- if ((n == null ? void 0 : n.name) === "Safari" && ii(n.version, "12.0") < 0)
10857
+ if ((n == null ? void 0 : n.name) === "Safari" && si(n.version, "12.0") < 0)
10858
10858
  throw new vd("pauseUpstream is not supported on Safari < 12.");
10859
10859
  ((e = this.sender.transport) === null || e === void 0 ? void 0 : e.state) !== "closed" && (yield this.sender.replaceTrack(null));
10860
10860
  } finally {
@@ -11118,7 +11118,7 @@ class to extends $p {
11118
11118
  var t;
11119
11119
  const n = yield this.trackChangeLock.lock();
11120
11120
  try {
11121
- if (!ni() && !this.audioContext)
11121
+ if (!ii() && !this.audioContext)
11122
11122
  throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");
11123
11123
  this.processor && (yield this.internalStopProcessor());
11124
11124
  const s = {
@@ -11175,7 +11175,7 @@ function xb(i, e, t) {
11175
11175
  case "video":
11176
11176
  return new no(i, e, !1, t);
11177
11177
  default:
11178
- throw new _i("unsupported track type: ".concat(i.kind));
11178
+ throw new yi("unsupported track type: ".concat(i.kind));
11179
11179
  }
11180
11180
  }
11181
11181
  const Tb = Object.values(Wr), Cb = Object.values(Wc), Eb = Object.values(bd), Mb = [Wr.h180, Wr.h360], wb = [Wc.h180, Wc.h360], Ab = (i) => [{
@@ -11194,7 +11194,7 @@ function tl(i, e, t, n) {
11194
11194
  return [{}];
11195
11195
  a || (a = Pb(i, e, t, l), $e.debug("using video encoding", a));
11196
11196
  const d = a.maxFramerate, u = new mt(e, t, a.maxBitrate, a.maxFramerate, a.priority);
11197
- if (c && $n(l)) {
11197
+ if (c && Kn(l)) {
11198
11198
  const g = new Kp(c), v = [];
11199
11199
  if (g.spatial > 3)
11200
11200
  throw new Error("unsupported scalabilityMode: ".concat(c));
@@ -11202,7 +11202,7 @@ function tl(i, e, t, n) {
11202
11202
  if (qr() || // Even tho RN runs M114, it does not produce SVC layers when a single encoding
11203
11203
  // is provided. So we'll use the legacy SVC specification for now.
11204
11204
  // TODO: when we upstream libwebrtc, this will need additional verification
11205
- ni() || (m == null ? void 0 : m.name) === "Chrome" && ii(m == null ? void 0 : m.version, "113") < 0) {
11205
+ ii() || (m == null ? void 0 : m.name) === "Chrome" && si(m == null ? void 0 : m.version, "113") < 0) {
11206
11206
  const p = g.suffix == "h" ? 2 : 3, x = D0(m);
11207
11207
  for (let C = 0; C < g.spatial; C += 1)
11208
11208
  v.push({
@@ -11301,7 +11301,7 @@ function Wo(i, e, t, n) {
11301
11301
  d && (l.maxFramerate = d);
11302
11302
  const u = Ss() || a === 0;
11303
11303
  r.encoding.priority && u && (l.priority = r.encoding.priority, l.networkPriority = r.encoding.priority), s.push(l);
11304
- }), ni() && Bp() === "ios") {
11304
+ }), ii() && Bp() === "ios") {
11305
11305
  let r;
11306
11306
  s.forEach((o) => {
11307
11307
  r ? o.maxFramerate && o.maxFramerate > r && (r = o.maxFramerate) : r = o.maxFramerate;
@@ -11416,7 +11416,7 @@ class no extends $p {
11416
11416
  var t, n, s, r, a;
11417
11417
  yield e.pauseUpstream.call(this);
11418
11418
  try {
11419
- for (var o = !0, c = bi(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0)
11419
+ for (var o = !0, c = _i(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0)
11420
11420
  r = l.value, o = !1, yield (a = r.sender) === null || a === void 0 ? void 0 : a.replaceTrack(null);
11421
11421
  } catch (d) {
11422
11422
  n = {
@@ -11441,7 +11441,7 @@ class no extends $p {
11441
11441
  var t, n, s, r, a;
11442
11442
  yield e.resumeUpstream.call(this);
11443
11443
  try {
11444
- for (var o = !0, c = bi(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0) {
11444
+ for (var o = !0, c = _i(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0) {
11445
11445
  r = l.value, o = !1;
11446
11446
  const d = r;
11447
11447
  yield (a = d.sender) === null || a === void 0 ? void 0 : a.replaceTrack(d.mediaStreamTrack);
@@ -11538,7 +11538,7 @@ class no extends $p {
11538
11538
  quality: n,
11539
11539
  enabled: n <= e
11540
11540
  }));
11541
- this.log.debug("setting publishing quality. max quality ".concat(e), this.logContext), this.setPublishingLayers($n(this.codec), t);
11541
+ this.log.debug("setting publishing quality. max quality ".concat(e), this.logContext), this.setPublishingLayers(Kn(this.codec), t);
11542
11542
  }
11543
11543
  restartTrack(e) {
11544
11544
  return P(this, void 0, void 0, function* () {
@@ -11552,7 +11552,7 @@ class no extends $p {
11552
11552
  }
11553
11553
  yield this.restart(o), this.isCpuConstrained = !1;
11554
11554
  try {
11555
- for (var c = !0, l = bi(this.simulcastCodecs.values()), d; d = yield l.next(), t = d.done, !t; c = !0) {
11555
+ for (var c = !0, l = _i(this.simulcastCodecs.values()), d; d = yield l.next(), t = d.done, !t; c = !0) {
11556
11556
  r = d.value, c = !1;
11557
11557
  const u = r;
11558
11558
  u.sender && ((a = u.sender.transport) === null || a === void 0 ? void 0 : a.state) !== "closed" && (u.mediaStreamTrack = this.mediaStreamTrack.clone(), yield u.sender.replaceTrack(u.mediaStreamTrack));
@@ -11583,7 +11583,7 @@ class no extends $p {
11583
11583
  var a, o, c, l, d, u;
11584
11584
  if (yield t.setProcessor.call(s, n, r), !((d = s.processor) === null || d === void 0) && d.processedTrack)
11585
11585
  try {
11586
- for (var h = !0, f = bi(s.simulcastCodecs.values()), g; g = yield f.next(), a = g.done, !a; h = !0)
11586
+ for (var h = !0, f = _i(s.simulcastCodecs.values()), g; g = yield f.next(), a = g.done, !a; h = !0)
11587
11587
  l = g.value, h = !1, yield (u = l.sender) === null || u === void 0 ? void 0 : u.replaceTrack(s.processor.processedTrack);
11588
11588
  } catch (v) {
11589
11589
  o = {
@@ -11644,15 +11644,15 @@ class no extends $p {
11644
11644
  codecs: e,
11645
11645
  currentCodec: this.codec
11646
11646
  })), !this.codec && e.length > 0)
11647
- return yield this.setPublishingLayers($n(e[0].codec), e[0].qualities), [];
11647
+ return yield this.setPublishingLayers(Kn(e[0].codec), e[0].qualities), [];
11648
11648
  this.subscribedCodecs = e;
11649
11649
  const l = [];
11650
11650
  try {
11651
- for (t = !0, n = bi(e); s = yield n.next(), r = s.done, !r; t = !0) {
11651
+ for (t = !0, n = _i(e); s = yield n.next(), r = s.done, !r; t = !0) {
11652
11652
  c = s.value, t = !1;
11653
11653
  const d = c;
11654
11654
  if (!this.codec || this.codec === d.codec)
11655
- yield this.setPublishingLayers($n(d.codec), d.qualities);
11655
+ yield this.setPublishingLayers(Kn(d.codec), d.qualities);
11656
11656
  else {
11657
11657
  const u = this.simulcastCodecs.get(d.codec);
11658
11658
  if (this.log.debug("try setPublishingCodec for ".concat(d.codec), Object.assign(Object.assign({}, this.logContext), {
@@ -11663,7 +11663,7 @@ class no extends $p {
11663
11663
  l.push(d.codec);
11664
11664
  break;
11665
11665
  }
11666
- } else u.encodings && (this.log.debug("try setPublishingLayersForSender ".concat(d.codec), this.logContext), yield oh(u.sender, u.encodings, d.qualities, this.senderLock, $n(d.codec), this.log, this.logContext));
11666
+ } else u.encodings && (this.log.debug("try setPublishingLayersForSender ".concat(d.codec), this.logContext), yield oh(u.sender, u.encodings, d.qualities, this.senderLock, Kn(d.codec), this.log, this.logContext));
11667
11667
  }
11668
11668
  }
11669
11669
  } catch (d) {
@@ -11714,7 +11714,7 @@ class no extends $p {
11714
11714
  return Object.assign(Object.assign({}, n), {
11715
11715
  active: s === 0,
11716
11716
  scaleResolutionDownBy: Math.max(1, Math.ceil(((r = this.mediaStreamTrack.getSettings().height) !== null && r !== void 0 ? r : 360) / 360)),
11717
- scalabilityMode: s === 0 && $n(this.codec) ? "L1T3" : void 0,
11717
+ scalabilityMode: s === 0 && Kn(this.codec) ? "L1T3" : void 0,
11718
11718
  maxFramerate: s === 0 ? 15 : 0,
11719
11719
  maxBitrate: s === 0 ? n.maxBitrate : 0
11720
11720
  });
@@ -11824,11 +11824,11 @@ function ch(i, e, t, n) {
11824
11824
  });
11825
11825
  }
11826
11826
  const lh = "_lossy", dh = "_reliable", Lb = 2 * 1e3, qo = "leave-reconnect", Nb = 3e4;
11827
- var In;
11827
+ var Dn;
11828
11828
  (function(i) {
11829
11829
  i[i.New = 0] = "New", i[i.Connected = 1] = "Connected", i[i.Disconnected = 2] = "Disconnected", i[i.Reconnecting = 3] = "Reconnecting", i[i.Closed = 4] = "Closed";
11830
- })(In || (In = {}));
11831
- class Ub extends ri.EventEmitter {
11830
+ })(Dn || (Dn = {}));
11831
+ class Ub extends ai.EventEmitter {
11832
11832
  get isClosed() {
11833
11833
  return this._isClosed;
11834
11834
  }
@@ -11837,7 +11837,7 @@ class Ub extends ri.EventEmitter {
11837
11837
  }
11838
11838
  constructor(e) {
11839
11839
  var t;
11840
- super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = Td.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = In.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = $e, this.reliableDataSequence = 1, this.reliableMessageBuffer = new Yu(), this.reliableReceivedState = new ab(Nb), this.handleDataChannel = (n) => P(this, [n], void 0, function(s) {
11840
+ super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = Td.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Dn.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = $e, this.reliableDataSequence = 1, this.reliableMessageBuffer = new Yu(), this.reliableReceivedState = new ab(Nb), this.handleDataChannel = (n) => P(this, [n], void 0, function(s) {
11841
11841
  var r = this;
11842
11842
  let {
11843
11843
  channel: a
@@ -11912,7 +11912,7 @@ class Ub extends ri.EventEmitter {
11912
11912
  }
11913
11913
  n === qo && (o = 0), this.log.debug("reconnecting in ".concat(o, "ms"), this.logContext), this.clearReconnectTimeout(), this.token && this.regionUrlProvider && this.regionUrlProvider.updateToken(this.token), this.reconnectTimeout = Kt.setTimeout(() => this.attemptReconnect(s).finally(() => this.reconnectTimeout = void 0), o);
11914
11914
  }, this.waitForRestarted = () => new Promise((n, s) => {
11915
- this.pcState === In.Connected && n();
11915
+ this.pcState === Dn.Connected && n();
11916
11916
  const r = () => {
11917
11917
  this.off(ce.Disconnected, a), n();
11918
11918
  }, a = () => {
@@ -11928,7 +11928,7 @@ class Ub extends ri.EventEmitter {
11928
11928
  return n === qe.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(s.bufferedAmount), s.bufferedAmount <= s.bufferedAmountLowThreshold;
11929
11929
  }, this.handleBrowserOnLine = () => {
11930
11930
  this.client.currentState === Mt.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(ws.RR_SIGNAL_DISCONNECTED));
11931
- }, this.log = Ci((t = e.loggerName) !== null && t !== void 0 ? t : Vn.Engine), this.loggerOptions = {
11931
+ }, this.log = Ei((t = e.loggerName) !== null && t !== void 0 ? t : zn.Engine), this.loggerOptions = {
11932
11932
  loggerName: e.loggerName,
11933
11933
  loggerContextCb: () => this.logContext
11934
11934
  }, this.client = new yd(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new hn(), this.dataProcessLock = new hn(), this.dcBufferStatus = /* @__PURE__ */ new Map([[qe.LOSSY, !0], [qe.RELIABLE, !0]]), this.client.onParticipantUpdate = (n) => this.emit(ce.ParticipantUpdate, n), this.client.onConnectionQuality = (n) => this.emit(ce.ConnectionQualityUpdate, n), this.client.onRoomUpdate = (n) => this.emit(ce.RoomUpdate, n), this.client.onSubscriptionError = (n) => this.emit(ce.SubscriptionError, n), this.client.onSubscriptionPermissionUpdate = (n) => this.emit(ce.SubscriptionPermissionUpdate, n), this.client.onSpeakersChanged = (n) => this.emit(ce.SpeakersChanged, n), this.client.onStreamStateUpdate = (n) => this.emit(ce.StreamStateChanged, n), this.client.onRequestResponse = (n) => this.emit(ce.SignalRequestResponse, n);
@@ -11951,7 +11951,7 @@ class Ub extends ri.EventEmitter {
11951
11951
  const r = yield this.client.join(e, t, n, s);
11952
11952
  return this._isClosed = !1, this.latestJoinResponse = r, this.subscriberPrimary = r.subscriberPrimary, this.pcManager || (yield this.configure(r)), (!this.subscriberPrimary || r.fastPublish) && this.negotiate(), this.clientConfiguration = r.clientConfiguration, this.emit(ce.SignalConnected, r), r;
11953
11953
  } catch (r) {
11954
- if (r instanceof bt && r.reason === Ye.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
11954
+ if (r instanceof St && r.reason === Ye.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
11955
11955
  return this.join(e, t, n, s);
11956
11956
  throw r;
11957
11957
  }
@@ -11988,10 +11988,10 @@ class Ub extends ri.EventEmitter {
11988
11988
  }
11989
11989
  addTrack(e) {
11990
11990
  if (this.pendingTrackResolvers[e.cid])
11991
- throw new _i("a track with the same ID has already been published");
11991
+ throw new yi("a track with the same ID has already been published");
11992
11992
  return new Promise((t, n) => {
11993
11993
  const s = setTimeout(() => {
11994
- delete this.pendingTrackResolvers[e.cid], n(new bt("publication of local track timed out, no response from server", Ye.Timeout));
11994
+ delete this.pendingTrackResolvers[e.cid], n(new St("publication of local track timed out, no response from server", Ye.Timeout));
11995
11995
  }, 1e4);
11996
11996
  this.pendingTrackResolvers[e.cid] = {
11997
11997
  resolve: (r) => {
@@ -12055,9 +12055,9 @@ class Ub extends ri.EventEmitter {
12055
12055
  this.client.sendOffer(r, a);
12056
12056
  }, this.pcManager.onDataChannel = this.handleDataChannel, this.pcManager.onStateChange = (r, a, o) => P(this, void 0, void 0, function* () {
12057
12057
  if (this.log.debug("primary PC state changed ".concat(r), this.logContext), ["closed", "disconnected", "failed"].includes(a) && (this.publisherConnectionPromise = void 0), r === Pt.CONNECTED) {
12058
- const d = this.pcState === In.New;
12059
- this.pcState = In.Connected, d && this.emit(ce.Connected, e);
12060
- } else r === Pt.FAILED && this.pcState === In.Connected && (this.pcState = In.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? ws.RR_SUBSCRIBER_FAILED : ws.RR_PUBLISHER_FAILED));
12058
+ const d = this.pcState === Dn.New;
12059
+ this.pcState = Dn.Connected, d && this.emit(ce.Connected, e);
12060
+ } else r === Pt.FAILED && this.pcState === Dn.Connected && (this.pcState = Dn.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? ws.RR_SUBSCRIBER_FAILED : ws.RR_PUBLISHER_FAILED));
12061
12061
  const c = this.client.isDisconnected || this.client.currentState === Mt.RECONNECTING, l = [Pt.FAILED, Pt.CLOSING, Pt.CLOSED].includes(r);
12062
12062
  c && l && !this._isClosed && this.emit(ce.Offline);
12063
12063
  }), this.pcManager.onTrack = (r) => {
@@ -12246,7 +12246,7 @@ class Ub extends ri.EventEmitter {
12246
12246
  throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new As();
12247
12247
  r = yield this.join(e ?? this.url, this.token, this.signalOpts);
12248
12248
  } catch (a) {
12249
- throw a instanceof bt && a.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : new As();
12249
+ throw a instanceof St && a.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : new As();
12250
12250
  }
12251
12251
  if (this.shouldFailNext)
12252
12252
  throw this.shouldFailNext = !1, new Error("simulated failure");
@@ -12278,7 +12278,7 @@ class Ub extends ri.EventEmitter {
12278
12278
  let r = "";
12279
12279
  throw s instanceof Error && (r = s.message, this.log.error(s.message, Object.assign(Object.assign({}, this.logContext), {
12280
12280
  error: s
12281
- }))), s instanceof bt && s.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : s instanceof bt && s.reason === Ye.LeaveRequest ? s : new As(r);
12281
+ }))), s instanceof St && s.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : s instanceof St && s.reason === Ye.LeaveRequest ? s : new As(r);
12282
12282
  }
12283
12283
  if (this.emit(ce.SignalResumed), n) {
12284
12284
  const s = this.makeRTCConfiguration(n);
@@ -12301,13 +12301,13 @@ class Ub extends ri.EventEmitter {
12301
12301
  }
12302
12302
  waitForPCReconnected() {
12303
12303
  return P(this, void 0, void 0, function* () {
12304
- this.pcState = In.Reconnecting, this.log.debug("waiting for peer connection to reconnect", this.logContext);
12304
+ this.pcState = Dn.Reconnecting, this.log.debug("waiting for peer connection to reconnect", this.logContext);
12305
12305
  try {
12306
12306
  if (yield fn(Lb), !this.pcManager)
12307
12307
  throw new zt("PC manager is closed");
12308
- yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = In.Connected;
12308
+ yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Dn.Connected;
12309
12309
  } catch (e) {
12310
- throw this.pcState = In.Disconnected, new bt("could not establish PC connection, ".concat(e.message), Ye.InternalError);
12310
+ throw this.pcState = Dn.Disconnected, new St("could not establish PC connection, ".concat(e.message), Ye.InternalError);
12311
12311
  }
12312
12312
  });
12313
12313
  }
@@ -12400,7 +12400,7 @@ class Ub extends ri.EventEmitter {
12400
12400
  throw new zt("PC manager is closed");
12401
12401
  const a = s ? n.pcManager.subscriber : n.pcManager.publisher, o = s ? "Subscriber" : "Publisher";
12402
12402
  if (!a)
12403
- throw new bt("".concat(o, " connection not set"), Ye.InternalError);
12403
+ throw new St("".concat(o, " connection not set"), Ye.InternalError);
12404
12404
  let c = !1;
12405
12405
  !s && !n.dataChannelForKind(t, s) && (n.createDataChannels(), c = !0), !c && !s && !n.pcManager.publisher.isICEConnected && n.pcManager.publisher.getICEConnectionState() !== "checking" && (c = !0), c && n.negotiate();
12406
12406
  const l = n.dataChannelForKind(t, s);
@@ -12412,7 +12412,7 @@ class Ub extends ri.EventEmitter {
12412
12412
  return;
12413
12413
  yield fn(50);
12414
12414
  }
12415
- throw new bt("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), Ye.InternalError);
12415
+ throw new St("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), Ye.InternalError);
12416
12416
  }();
12417
12417
  });
12418
12418
  }
@@ -12512,7 +12512,7 @@ class Ub extends ri.EventEmitter {
12512
12512
  target: s
12513
12513
  }));
12514
12514
  };
12515
- return t(this.dataChannelForKind(qe.LOSSY), Nn.PUBLISHER), t(this.dataChannelForKind(qe.RELIABLE), Nn.PUBLISHER), t(this.dataChannelForKind(qe.LOSSY, !0), Nn.SUBSCRIBER), t(this.dataChannelForKind(qe.RELIABLE, !0), Nn.SUBSCRIBER), e;
12515
+ return t(this.dataChannelForKind(qe.LOSSY), Un.PUBLISHER), t(this.dataChannelForKind(qe.RELIABLE), Un.PUBLISHER), t(this.dataChannelForKind(qe.LOSSY, !0), Un.SUBSCRIBER), t(this.dataChannelForKind(qe.RELIABLE, !0), Un.SUBSCRIBER), e;
12516
12516
  }
12517
12517
  clearReconnectTimeout() {
12518
12518
  this.reconnectTimeout && Kt.clearTimeout(this.reconnectTimeout);
@@ -12580,7 +12580,7 @@ class nl {
12580
12580
  const n = yield t.json();
12581
12581
  return this.lastUpdateAt = Date.now(), n;
12582
12582
  } else
12583
- throw new bt("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? Ye.NotAllowed : Ye.InternalError, t.status);
12583
+ throw new St("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? Ye.NotAllowed : Ye.InternalError, t.status);
12584
12584
  });
12585
12585
  }
12586
12586
  setServerReportedRegions(e) {
@@ -12599,9 +12599,9 @@ class Jp {
12599
12599
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
12600
12600
  if (!(typeof this.totalByteSize != "number" || this.totalByteSize === 0)) {
12601
12601
  if (e && this.bytesReceived < this.totalByteSize)
12602
- throw new Gi("Not enough chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, only received ").concat(this.bytesReceived, " bytes"), Un.Incomplete);
12602
+ throw new Gi("Not enough chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, only received ").concat(this.bytesReceived, " bytes"), On.Incomplete);
12603
12603
  if (this.bytesReceived > this.totalByteSize)
12604
- throw new Gi("Extra chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, received ").concat(this.bytesReceived, " bytes"), Un.LengthExceeded);
12604
+ throw new Gi("Extra chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, received ").concat(this.bytesReceived, " bytes"), On.LengthExceeded);
12605
12605
  }
12606
12606
  }
12607
12607
  constructor(e, t, n, s) {
@@ -12617,7 +12617,7 @@ class Vb extends Jp {
12617
12617
  }
12618
12618
  [Symbol.asyncIterator]() {
12619
12619
  const e = this.reader.getReader();
12620
- let t = new Kn(), n = null, s = null;
12620
+ let t = new Yn(), n = null, s = null;
12621
12621
  if (this.signal) {
12622
12622
  const a = this.signal;
12623
12623
  s = () => {
@@ -12685,7 +12685,7 @@ class Vb extends Jp {
12685
12685
  let o = /* @__PURE__ */ new Set();
12686
12686
  const c = t.signal ? e.withAbortSignal(t.signal) : e;
12687
12687
  try {
12688
- for (var l = !0, d = bi(c), u; u = yield d.next(), n = u.done, !n; l = !0) {
12688
+ for (var l = !0, d = _i(c), u; u = yield d.next(), n = u.done, !n; l = !0) {
12689
12689
  a = u.value, l = !1;
12690
12690
  const h = a;
12691
12691
  o.add(h);
@@ -12732,7 +12732,7 @@ class zb extends Jp {
12732
12732
  const e = this.reader.getReader(), t = new TextDecoder("utf-8", {
12733
12733
  fatal: !0
12734
12734
  });
12735
- let n = new Kn(), s = null, r = null;
12735
+ let n = new Yn(), s = null, r = null;
12736
12736
  if (this.signal) {
12737
12737
  const o = this.signal;
12738
12738
  r = () => {
@@ -12769,7 +12769,7 @@ class zb extends Jp {
12769
12769
  try {
12770
12770
  u = t.decode(d.content);
12771
12771
  } catch (h) {
12772
- throw new Gi("Cannot decode datastream chunk ".concat(d.chunkIndex, " as text: ").concat(h), Un.DecodeFailed);
12772
+ throw new Gi("Cannot decode datastream chunk ".concat(d.chunkIndex, " as text: ").concat(h), On.DecodeFailed);
12773
12773
  }
12774
12774
  return {
12775
12775
  done: !1,
@@ -12811,7 +12811,7 @@ class zb extends Jp {
12811
12811
  let o = "";
12812
12812
  const c = t.signal ? e.withAbortSignal(t.signal) : e;
12813
12813
  try {
12814
- for (var l = !0, d = bi(c), u; u = yield d.next(), n = u.done, !n; l = !0)
12814
+ for (var l = !0, d = _i(c), u; u = yield d.next(), n = u.done, !n; l = !0)
12815
12815
  a = u.value, l = !1, o += a;
12816
12816
  } catch (h) {
12817
12817
  s = {
@@ -12835,7 +12835,7 @@ class Gb {
12835
12835
  }
12836
12836
  registerTextStreamHandler(e, t) {
12837
12837
  if (this.textStreamHandlers.has(e))
12838
- throw new Gi('A text stream handler for topic "'.concat(e, '" has already been set.'), Un.HandlerAlreadyRegistered);
12838
+ throw new Gi('A text stream handler for topic "'.concat(e, '" has already been set.'), On.HandlerAlreadyRegistered);
12839
12839
  this.textStreamHandlers.set(e, t);
12840
12840
  }
12841
12841
  unregisterTextStreamHandler(e) {
@@ -12843,7 +12843,7 @@ class Gb {
12843
12843
  }
12844
12844
  registerByteStreamHandler(e, t) {
12845
12845
  if (this.byteStreamHandlers.has(e))
12846
- throw new Gi('A byte stream handler for topic "'.concat(e, '" has already been set.'), Un.HandlerAlreadyRegistered);
12846
+ throw new Gi('A byte stream handler for topic "'.concat(e, '" has already been set.'), On.HandlerAlreadyRegistered);
12847
12847
  this.byteStreamHandlers.set(e, t);
12848
12848
  }
12849
12849
  unregisterByteStreamHandler(e) {
@@ -12856,7 +12856,7 @@ class Gb {
12856
12856
  var t, n, s, r;
12857
12857
  const a = Array.from(this.textStreamControllers.entries()).filter((c) => c[1].sendingParticipantIdentity === e), o = Array.from(this.byteStreamControllers.entries()).filter((c) => c[1].sendingParticipantIdentity === e);
12858
12858
  if (a.length > 0 || o.length > 0) {
12859
- const c = new Gi("Participant ".concat(e, " unexpectedly disconnected in the middle of sending data"), Un.AbnormalEnd);
12859
+ const c = new Gi("Participant ".concat(e, " unexpectedly disconnected in the middle of sending data"), On.AbnormalEnd);
12860
12860
  for (const [l, d] of o)
12861
12861
  (n = (t = d.outOfBandFailureRejectingFuture).reject) === null || n === void 0 || n.call(t, c), this.byteStreamControllers.delete(l);
12862
12862
  for (const [l, d] of a)
@@ -12887,7 +12887,7 @@ class Gb {
12887
12887
  return;
12888
12888
  }
12889
12889
  let r;
12890
- const a = new Kn(), o = {
12890
+ const a = new Yn(), o = {
12891
12891
  id: e.streamId,
12892
12892
  name: (n = e.contentHeader.value.name) !== null && n !== void 0 ? n : "unknown",
12893
12893
  mimeType: e.mimeType,
@@ -12898,7 +12898,7 @@ class Gb {
12898
12898
  }, c = new ReadableStream({
12899
12899
  start: (l) => {
12900
12900
  if (r = l, this.textStreamControllers.has(e.streamId))
12901
- throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), Un.AlreadyOpened);
12901
+ throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), On.AlreadyOpened);
12902
12902
  this.byteStreamControllers.set(e.streamId, {
12903
12903
  info: o,
12904
12904
  controller: r,
@@ -12918,7 +12918,7 @@ class Gb {
12918
12918
  return;
12919
12919
  }
12920
12920
  let r;
12921
- const a = new Kn(), o = {
12921
+ const a = new Yn(), o = {
12922
12922
  id: e.streamId,
12923
12923
  mimeType: e.mimeType,
12924
12924
  size: e.totalLength ? Number(e.totalLength) : void 0,
@@ -12928,7 +12928,7 @@ class Gb {
12928
12928
  }, c = new ReadableStream({
12929
12929
  start: (l) => {
12930
12930
  if (r = l, this.textStreamControllers.has(e.streamId))
12931
- throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), Un.AlreadyOpened);
12931
+ throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), On.AlreadyOpened);
12932
12932
  this.textStreamControllers.set(e.streamId, {
12933
12933
  info: o,
12934
12934
  controller: r,
@@ -13308,7 +13308,7 @@ class jb extends Qp {
13308
13308
  var t;
13309
13309
  for (const n of this.attachedElements)
13310
13310
  this.audioContext ? (t = this.gainNode) === null || t === void 0 || t.gain.setTargetAtTime(e, 0, 0.1) : n.volume = e;
13311
- ni() && this._mediaStreamTrack._setVolume(e), this.elementVolume = e;
13311
+ ii() && this._mediaStreamTrack._setVolume(e), this.elementVolume = e;
13312
13312
  }
13313
13313
  /**
13314
13314
  * gets the volume of attached audio elements (loudest)
@@ -13316,7 +13316,7 @@ class jb extends Qp {
13316
13316
  getVolume() {
13317
13317
  if (this.elementVolume)
13318
13318
  return this.elementVolume;
13319
- if (ni())
13319
+ if (ii())
13320
13320
  return 1;
13321
13321
  let e = 0;
13322
13322
  return this.attachedElements.forEach((t) => {
@@ -13611,14 +13611,14 @@ function il(i, e) {
13611
13611
  i = i.offsetParent, n += i.offsetTop, s += i.offsetLeft;
13612
13612
  return n < t.pageYOffset + t.innerHeight && s < t.pageXOffset + t.innerWidth && n + a > t.pageYOffset && s + r > t.pageXOffset && !o && c !== "none";
13613
13613
  }
13614
- class mi extends ri.EventEmitter {
13614
+ class gi extends ai.EventEmitter {
13615
13615
  constructor(e, t, n, s) {
13616
13616
  var r;
13617
13617
  super(), this.metadataMuted = !1, this.encryption = bn.NONE, this.log = $e, this.handleMuted = () => {
13618
13618
  this.emit(re.Muted);
13619
13619
  }, this.handleUnmuted = () => {
13620
13620
  this.emit(re.Unmuted);
13621
- }, this.log = Ci((r = s == null ? void 0 : s.loggerName) !== null && r !== void 0 ? r : Vn.Publication), this.loggerContextCb = this.loggerContextCb, this.setMaxListeners(100), this.kind = e, this.trackSid = t, this.trackName = n, this.source = J.Source.Unknown;
13621
+ }, this.log = Ei((r = s == null ? void 0 : s.loggerName) !== null && r !== void 0 ? r : zn.Publication), this.loggerContextCb = this.loggerContextCb, this.setMaxListeners(100), this.kind = e, this.trackSid = t, this.trackName = n, this.source = J.Source.Unknown;
13622
13622
  }
13623
13623
  /** @internal */
13624
13624
  setTrack(e) {
@@ -13644,7 +13644,7 @@ class mi extends ri.EventEmitter {
13644
13644
  * an [AudioTrack] if this publication holds an audio track
13645
13645
  */
13646
13646
  get audioTrack() {
13647
- if (Zn(this.track))
13647
+ if (Qn(this.track))
13648
13648
  return this.track;
13649
13649
  }
13650
13650
  /**
@@ -13670,8 +13670,8 @@ class mi extends ri.EventEmitter {
13670
13670
  })(i.SubscriptionStatus || (i.SubscriptionStatus = {})), function(e) {
13671
13671
  e.Allowed = "allowed", e.NotAllowed = "not_allowed";
13672
13672
  }(i.PermissionStatus || (i.PermissionStatus = {}));
13673
- })(mi || (mi = {}));
13674
- class sl extends mi {
13673
+ })(gi || (gi = {}));
13674
+ class sl extends gi {
13675
13675
  get isUpstreamPaused() {
13676
13676
  var e;
13677
13677
  return (e = this.track) === null || e === void 0 ? void 0 : e.isUpstreamPaused;
@@ -13739,7 +13739,7 @@ class sl extends mi {
13739
13739
  }
13740
13740
  getTrackFeatures() {
13741
13741
  var e;
13742
- if (Zn(this.track)) {
13742
+ if (Qn(this.track)) {
13743
13743
  const t = this.track.getSourceTrackSettings(), n = /* @__PURE__ */ new Set();
13744
13744
  return t.autoGainControl && n.add(jt.TF_AUTO_GAIN_CONTROL), t.echoCancellation && n.add(jt.TF_ECHO_CANCELLATION), t.noiseSuppression && n.add(jt.TF_NOISE_SUPPRESSION), t.channelCount && t.channelCount > 1 && n.add(jt.TF_STEREO), !((e = this.options) === null || e === void 0) && e.dtx || n.add(jt.TF_NO_DTX), this.track.enhancedNoiseCancellation && n.add(jt.TF_ENHANCED_NOISE_CANCELLATION), Array.from(n.values());
13745
13745
  } else return [];
@@ -13796,7 +13796,7 @@ function mo(i, e) {
13796
13796
  deviceId: p
13797
13797
  });
13798
13798
  const x = xb(h, v, e);
13799
- return x.kind === J.Kind.Video ? x.source = J.Source.Camera : x.kind === J.Kind.Audio && (x.source = J.Source.Microphone), x.mediaStream = u, Zn(x) && n ? yield x.setProcessor(n) : Ji(x) && s && (yield x.setProcessor(s)), x;
13799
+ return x.kind === J.Kind.Video ? x.source = J.Source.Camera : x.kind === J.Kind.Audio && (x.source = J.Source.Microphone), x.mediaStream = u, Qn(x) && n ? yield x.setProcessor(n) : Ji(x) && s && (yield x.setProcessor(s)), x;
13800
13800
  })));
13801
13801
  } catch (u) {
13802
13802
  if (!t)
@@ -13842,7 +13842,7 @@ function Jb(i) {
13842
13842
  return Hi.Unknown;
13843
13843
  }
13844
13844
  }
13845
- class em extends ri.EventEmitter {
13845
+ class em extends ai.EventEmitter {
13846
13846
  get logContext() {
13847
13847
  var e, t;
13848
13848
  return Object.assign({}, (t = (e = this.loggerOptions) === null || e === void 0 ? void 0 : e.loggerContextCb) === null || t === void 0 ? void 0 : t.call(e));
@@ -13869,7 +13869,7 @@ class em extends ri.EventEmitter {
13869
13869
  constructor(e, t, n, s, r, a) {
13870
13870
  let o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : Hr.STANDARD;
13871
13871
  var c;
13872
- super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = Hi.Unknown, this.log = $e, this.log = Ci((c = a == null ? void 0 : a.loggerName) !== null && c !== void 0 ? c : Vn.Participant), this.loggerOptions = a, this.setMaxListeners(100), this.sid = e, this.identity = t, this.name = n, this.metadata = s, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = o, this._attributes = r ?? {};
13872
+ super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = Hi.Unknown, this.log = $e, this.log = Ei((c = a == null ? void 0 : a.loggerName) !== null && c !== void 0 ? c : zn.Participant), this.loggerOptions = a, this.setMaxListeners(100), this.sid = e, this.identity = t, this.name = n, this.metadata = s, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = o, this._attributes = r ?? {};
13873
13873
  }
13874
13874
  getTrackPublications() {
13875
13875
  return Array.from(this.trackPublications.values());
@@ -13896,7 +13896,7 @@ class em extends ri.EventEmitter {
13896
13896
  * @returns a promise that resolves when the participant is active
13897
13897
  */
13898
13898
  waitUntilActive() {
13899
- return this.isActive ? Promise.resolve() : this.activeFuture ? this.activeFuture.promise : (this.activeFuture = new Kn(), this.once(oe.Active, () => {
13899
+ return this.isActive ? Promise.resolve() : this.activeFuture ? this.activeFuture.promise : (this.activeFuture = new Yn(), this.once(oe.Active, () => {
13900
13900
  var e, t;
13901
13901
  (t = (e = this.activeFuture) === null || e === void 0 ? void 0 : e.resolve) === null || t === void 0 || t.call(e), this.activeFuture = void 0;
13902
13902
  }), this.activeFuture.promise);
@@ -13976,7 +13976,7 @@ class em extends ri.EventEmitter {
13976
13976
  * @internal
13977
13977
  */
13978
13978
  setAudioContext(e) {
13979
- this.audioContext = e, this.audioTrackPublications.forEach((t) => Zn(t.track) && t.track.setAudioContext(e));
13979
+ this.audioContext = e, this.audioTrackPublications.forEach((t) => Qn(t.track) && t.track.setAudioContext(e));
13980
13980
  }
13981
13981
  addTrackPublication(e) {
13982
13982
  e.on(re.Muted, () => {
@@ -14013,7 +14013,7 @@ class Qb extends em {
14013
14013
  loggerName: s.loggerName,
14014
14014
  loggerContextCb: () => this.engine.logContext
14015
14015
  }), this.pendingPublishing = /* @__PURE__ */ new Set(), this.pendingPublishPromises = /* @__PURE__ */ new Map(), this.participantTrackPermissions = [], this.allParticipantsAllowedToSubscribe = !0, this.encryptionType = bn.NONE, this.enabledPublishVideoCodecs = [], this.pendingAcks = /* @__PURE__ */ new Map(), this.pendingResponses = /* @__PURE__ */ new Map(), this.handleReconnecting = () => {
14016
- this.reconnectFuture || (this.reconnectFuture = new Kn());
14016
+ this.reconnectFuture || (this.reconnectFuture = new Yn());
14017
14017
  }, this.handleReconnected = () => {
14018
14018
  var o, c;
14019
14019
  (c = (o = this.reconnectFuture) === null || o === void 0 ? void 0 : o.resolve) === null || c === void 0 || c.call(o), this.reconnectFuture = void 0, this.updateTrackSubscriptionPermissions();
@@ -14022,7 +14022,7 @@ class Qb extends em {
14022
14022
  this.reconnectFuture && (this.reconnectFuture.promise.catch((f) => this.log.warn(f.message, this.logContext)), (c = (o = this.reconnectFuture) === null || o === void 0 ? void 0 : o.reject) === null || c === void 0 || c.call(o, "Got disconnected during reconnection attempt"), this.reconnectFuture = void 0), this.signalConnectedFuture && ((d = (l = this.signalConnectedFuture).reject) === null || d === void 0 || d.call(l, "Got disconnected without signal connected"), this.signalConnectedFuture = void 0), (h = (u = this.activeAgentFuture) === null || u === void 0 ? void 0 : u.reject) === null || h === void 0 || h.call(u, "Got disconnected without active agent present"), this.activeAgentFuture = void 0, this.firstActiveAgent = void 0;
14023
14023
  }, this.handleSignalConnected = (o) => {
14024
14024
  var c, l;
14025
- o.participant && this.updateInfo(o.participant), this.signalConnectedFuture || (this.signalConnectedFuture = new Kn()), (l = (c = this.signalConnectedFuture).resolve) === null || l === void 0 || l.call(c);
14025
+ o.participant && this.updateInfo(o.participant), this.signalConnectedFuture || (this.signalConnectedFuture = new Yn()), (l = (c = this.signalConnectedFuture).resolve) === null || l === void 0 || l.call(c);
14026
14026
  }, this.handleSignalRequestResponse = (o) => {
14027
14027
  const {
14028
14028
  requestId: c,
@@ -14082,7 +14082,7 @@ class Qb extends em {
14082
14082
  return;
14083
14083
  const g = yield f.videoTrack.setPublishingCodecs(o.subscribedCodecs);
14084
14084
  try {
14085
- for (var v = !0, m = bi(g), p; p = yield m.next(), c = p.done, !c; v = !0) {
14085
+ for (var v = !0, m = _i(g), p; p = yield m.next(), c = p.done, !c; v = !0) {
14086
14086
  u = p.value, v = !1;
14087
14087
  const x = u;
14088
14088
  M0(x) && (this.log.debug("publish ".concat(x, " for ").concat(f.videoTrack.sid), Object.assign(Object.assign({}, this.logContext), Xe(f))), yield this.publishAdditionalCodecForTrack(f.videoTrack, x, f.options));
@@ -14112,7 +14112,7 @@ class Qb extends em {
14112
14112
  this.log.debug("unpublishing local track due to TrackEnded", Object.assign(Object.assign({}, this.logContext), Xe(o))), this.unpublishTrack(o);
14113
14113
  else if (o.isUserProvided)
14114
14114
  yield o.mute();
14115
- else if (hi(o) || Ii(o))
14115
+ else if (fi(o) || Ii(o))
14116
14116
  try {
14117
14117
  if (un())
14118
14118
  try {
@@ -14127,7 +14127,7 @@ class Qb extends em {
14127
14127
  }, new Error("GetUserMedia Permission denied");
14128
14128
  } catch {
14129
14129
  }
14130
- o.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Xe(o))), hi(o) ? yield o.restartTrack({
14130
+ o.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Xe(o))), fi(o) ? yield o.restartTrack({
14131
14131
  deviceId: "default"
14132
14132
  }) : yield o.restartTrack());
14133
14133
  } catch {
@@ -14317,7 +14317,7 @@ class Qb extends em {
14317
14317
  c = yield this.createScreenTracks(Object.assign({}, n));
14318
14318
  break;
14319
14319
  default:
14320
- throw new _i(e);
14320
+ throw new yi(e);
14321
14321
  }
14322
14322
  } catch (l) {
14323
14323
  throw c == null || c.forEach((d) => {
@@ -14326,7 +14326,7 @@ class Qb extends em {
14326
14326
  }
14327
14327
  for (const l of c) {
14328
14328
  const d = Object.assign(Object.assign({}, this.roomOptions.publishDefaults), n);
14329
- e === J.Source.Microphone && Zn(l) && d.preConnectBuffer && (this.log.info("starting preconnect buffer for microphone", Object.assign({}, this.logContext)), l.startPreConnectBuffer());
14329
+ e === J.Source.Microphone && Qn(l) && d.preConnectBuffer && (this.log.info("starting preconnect buffer for microphone", Object.assign({}, this.logContext)), l.startPreConnectBuffer());
14330
14330
  }
14331
14331
  try {
14332
14332
  const l = [];
@@ -14387,7 +14387,7 @@ class Qb extends em {
14387
14387
  return (yield mo(s, {
14388
14388
  loggerName: this.roomOptions.loggerName,
14389
14389
  loggerContextCb: () => this.logContext
14390
- })).map((o) => (Zn(o) && (this.microphoneError = void 0, o.setAudioContext(this.audioContext), o.source = J.Source.Microphone, this.emit(oe.AudioStreamAcquired)), Ji(o) && (this.cameraError = void 0, o.source = J.Source.Camera), o));
14390
+ })).map((o) => (Qn(o) && (this.microphoneError = void 0, o.setAudioContext(this.audioContext), o.source = J.Source.Microphone, this.emit(oe.AudioStreamAcquired)), Ji(o) && (this.cameraError = void 0, o.source = J.Source.Camera), o));
14391
14391
  } catch (r) {
14392
14392
  throw r instanceof Error && (e.audio && (this.microphoneError = r), e.video && (this.cameraError = r)), r;
14393
14393
  }
@@ -14405,7 +14405,7 @@ class Qb extends em {
14405
14405
  e.resolution === void 0 && !I0() && (e.resolution = bd.h1080fps30.resolution);
14406
14406
  const t = j0(e), n = yield navigator.mediaDevices.getDisplayMedia(t), s = n.getVideoTracks();
14407
14407
  if (s.length === 0)
14408
- throw new _i("no video track found");
14408
+ throw new yi("no video track found");
14409
14409
  const r = new no(s[0], void 0, !1, {
14410
14410
  loggerName: this.roomOptions.loggerName,
14411
14411
  loggerContextCb: () => this.logContext
@@ -14439,7 +14439,7 @@ class Qb extends em {
14439
14439
  let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
14440
14440
  return function* () {
14441
14441
  var o, c, l, d;
14442
- hi(n) && n.setAudioContext(r.audioContext), yield (o = r.reconnectFuture) === null || o === void 0 ? void 0 : o.promise, r.republishPromise && !a && (yield r.republishPromise), Js(n) && r.pendingPublishPromises.has(n) && (yield r.pendingPublishPromises.get(n));
14442
+ fi(n) && n.setAudioContext(r.audioContext), yield (o = r.reconnectFuture) === null || o === void 0 ? void 0 : o.promise, r.republishPromise && !a && (yield r.republishPromise), Js(n) && r.pendingPublishPromises.has(n) && (yield r.pendingPublishPromises.get(n));
14443
14443
  let u;
14444
14444
  if (n instanceof MediaStreamTrack)
14445
14445
  u = n.getConstraints();
@@ -14472,7 +14472,7 @@ class Qb extends em {
14472
14472
  });
14473
14473
  break;
14474
14474
  default:
14475
- throw new _i("unsupported MediaStreamTrack kind ".concat(n.kind));
14475
+ throw new yi("unsupported MediaStreamTrack kind ".concat(n.kind));
14476
14476
  }
14477
14477
  else
14478
14478
  n.updateLoggerOptions({
@@ -14524,7 +14524,7 @@ class Qb extends em {
14524
14524
  });
14525
14525
  }
14526
14526
  waitUntilEngineConnected() {
14527
- return this.signalConnectedFuture || (this.signalConnectedFuture = new Kn()), this.signalConnectedFuture.promise;
14527
+ return this.signalConnectedFuture || (this.signalConnectedFuture = new Yn()), this.signalConnectedFuture.promise;
14528
14528
  }
14529
14529
  hasPermissionsToPublish(e) {
14530
14530
  if (!this.permissions)
@@ -14540,11 +14540,11 @@ class Qb extends em {
14540
14540
  var s, r, a, o, c, l, d, u, h, f;
14541
14541
  if (!this.hasPermissionsToPublish(e))
14542
14542
  throw new Fu("failed to publish track, insufficient permissions", 403);
14543
- Array.from(this.trackPublications.values()).find((y) => Js(e) && y.source === e.source) && e.source !== J.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), Object.assign(Object.assign({}, this.logContext), Xe(e))), t.stopMicTrackOnMute && Zn(e) && (e.stopOnMute = !0), e.source === J.Source.ScreenShare && Ss() && (t.simulcast = !1), t.videoCodec === "av1" && !R0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !P0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Qc), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((y) => t.videoCodec === Or(y.mime)) || (t.videoCodec = Or(this.enabledPublishVideoCodecs[0].mime)));
14543
+ Array.from(this.trackPublications.values()).find((y) => Js(e) && y.source === e.source) && e.source !== J.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), Object.assign(Object.assign({}, this.logContext), Xe(e))), t.stopMicTrackOnMute && Qn(e) && (e.stopOnMute = !0), e.source === J.Source.ScreenShare && Ss() && (t.simulcast = !1), t.videoCodec === "av1" && !R0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !P0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Qc), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((y) => t.videoCodec === Or(y.mime)) || (t.videoCodec = Or(this.enabledPublishVideoCodecs[0].mime)));
14544
14544
  const v = t.videoCodec;
14545
14545
  e.on(re.Muted, this.onTrackMuted), e.on(re.Unmuted, this.onTrackUnmuted), e.on(re.Ended, this.handleTrackEnded), e.on(re.UpstreamPaused, this.onTrackUpstreamPaused), e.on(re.UpstreamResumed, this.onTrackUpstreamResumed), e.on(re.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
14546
14546
  const m = [], p = !(!((s = t.dtx) !== null && s !== void 0) || s), x = e.getSourceTrackSettings();
14547
- x.autoGainControl && m.push(jt.TF_AUTO_GAIN_CONTROL), x.echoCancellation && m.push(jt.TF_ECHO_CANCELLATION), x.noiseSuppression && m.push(jt.TF_NOISE_SUPPRESSION), x.channelCount && x.channelCount > 1 && m.push(jt.TF_STEREO), p && m.push(jt.TF_NO_DTX), hi(e) && e.hasPreConnectBuffer && m.push(jt.TF_PRECONNECT_BUFFER);
14547
+ x.autoGainControl && m.push(jt.TF_AUTO_GAIN_CONTROL), x.echoCancellation && m.push(jt.TF_ECHO_CANCELLATION), x.noiseSuppression && m.push(jt.TF_NOISE_SUPPRESSION), x.channelCount && x.channelCount > 1 && m.push(jt.TF_STEREO), p && m.push(jt.TF_NO_DTX), fi(e) && e.hasPreConnectBuffer && m.push(jt.TF_PRECONNECT_BUFFER);
14548
14548
  const C = new Dc({
14549
14549
  // get local track id for use during publishing
14550
14550
  cid: e.mediaStreamTrack.id,
@@ -14577,7 +14577,7 @@ class Qb extends em {
14577
14577
  dims: y
14578
14578
  }));
14579
14579
  }
14580
- C.width = y.width, C.height = y.height, Ii(e) && ($n(v) && (e.source === J.Source.ScreenShare && (t.scalabilityMode = "L1T3", "contentHint" in e.mediaStreamTrack && (e.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Xe(e))))), t.scalabilityMode = (c = t.scalabilityMode) !== null && c !== void 0 ? c : "L3T3_KEY"), C.simulcastCodecs = [new Ic({
14580
+ C.width = y.width, C.height = y.height, Ii(e) && (Kn(v) && (e.source === J.Source.ScreenShare && (t.scalabilityMode = "L1T3", "contentHint" in e.mediaStreamTrack && (e.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Xe(e))))), t.scalabilityMode = (c = t.scalabilityMode) !== null && c !== void 0 ? c : "L3T3_KEY"), C.simulcastCodecs = [new Ic({
14581
14581
  codec: v,
14582
14582
  cid: e.mediaStreamTrack.id
14583
14583
  })], t.backupCodec === !0 && (t.backupCodec = {
@@ -14586,7 +14586,7 @@ class Qb extends em {
14586
14586
  C.encryption === bn.NONE && (this.roomOptions.dynacast || (this.roomOptions.dynacast = !0), C.simulcastCodecs.push(new Ic({
14587
14587
  codec: t.backupCodec.codec,
14588
14588
  cid: ""
14589
- })))), b = tl(e.source === J.Source.ScreenShare, C.width, C.height, t), C.layers = ch(C.width, C.height, b, $n(t.videoCodec));
14589
+ })))), b = tl(e.source === J.Source.ScreenShare, C.width, C.height, t), C.layers = ch(C.width, C.height, b, Kn(t.videoCodec));
14590
14590
  } else e.kind === J.Kind.Audio && (b = [{
14591
14591
  maxBitrate: (l = t.audioPreset) === null || l === void 0 ? void 0 : l.maxBitrate,
14592
14592
  priority: (u = (d = t.audioPreset) === null || d === void 0 ? void 0 : d.priority) !== null && u !== void 0 ? u : "high",
@@ -14611,7 +14611,7 @@ class Qb extends em {
14611
14611
  codec: "opus",
14612
14612
  maxbr: !((T = b[0]) === null || T === void 0) && T.maxBitrate ? b[0].maxBitrate / 1e3 : 0
14613
14613
  });
14614
- } else e.codec && $n(e.codec) && (!((R = b[0]) === null || R === void 0) && R.maxBitrate) && this.engine.pcManager.publisher.setTrackCodecBitrate({
14614
+ } else e.codec && Kn(e.codec) && (!((R = b[0]) === null || R === void 0) && R.maxBitrate) && this.engine.pcManager.publisher.setTrackCodecBitrate({
14615
14615
  cid: C.cid,
14616
14616
  codec: e.codec,
14617
14617
  maxbr: b[0].maxBitrate / 1e3
@@ -14653,7 +14653,7 @@ class Qb extends em {
14653
14653
  if (k.on(re.CpuConstrained, (y) => this.onTrackCpuConstrained(y, k)), k.options = t, e.sid = M.sid, this.log.debug("publishing ".concat(e.kind, " with encodings"), Object.assign(Object.assign({}, this.logContext), {
14654
14654
  encodings: b,
14655
14655
  trackInfo: M
14656
- })), Ii(e) ? e.startMonitor(this.engine.client) : hi(e) && e.startMonitor(), this.addTrackPublication(k), this.emit(oe.LocalTrackPublished, k), hi(e) && M.audioFeatures.includes(jt.TF_PRECONNECT_BUFFER)) {
14656
+ })), Ii(e) ? e.startMonitor(this.engine.client) : fi(e) && e.startMonitor(), this.addTrackPublication(k), this.emit(oe.LocalTrackPublished, k), fi(e) && M.audioFeatures.includes(jt.TF_PRECONNECT_BUFFER)) {
14657
14657
  const y = e.getPreConnectBuffer(), T = e.getPreConnectBufferMimeType();
14658
14658
  this.on(oe.LocalTrackSubscribed, (R) => {
14659
14659
  if (R.trackSid === M.sid) {
@@ -14683,7 +14683,7 @@ class Qb extends em {
14683
14683
  }
14684
14684
  });
14685
14685
  try {
14686
- for (var le = !0, be = bi(y), Be; Be = yield be.next(), q = Be.done, !q; le = !0) {
14686
+ for (var le = !0, be = _i(y), Be; Be = yield be.next(), q = Be.done, !q; le = !0) {
14687
14687
  W = Be.value, le = !1;
14688
14688
  const $ = W;
14689
14689
  yield ft.write($);
@@ -14729,9 +14729,9 @@ class Qb extends em {
14729
14729
  if (this.trackPublications.forEach((f) => {
14730
14730
  f.track && f.track === e && (r = f);
14731
14731
  }), !r)
14732
- throw new _i("track is not published");
14732
+ throw new yi("track is not published");
14733
14733
  if (!Ii(e))
14734
- throw new _i("track is not a video track");
14734
+ throw new yi("track is not a video track");
14735
14735
  const a = Object.assign(Object.assign({}, (s = this.roomOptions) === null || s === void 0 ? void 0 : s.publishDefaults), n), o = Rb(e, t, a);
14736
14736
  if (!o) {
14737
14737
  this.log.info("backup codec has been disabled, ignoring request to add additional codec for track", Object.assign(Object.assign({}, this.logContext), Xe(e)));
@@ -14819,7 +14819,7 @@ class Qb extends em {
14819
14819
  c.track && (t && (c.options = Object.assign(Object.assign({}, c.options), t)), o.push(c));
14820
14820
  }), yield Promise.all(o.map((c) => P(this, void 0, void 0, function* () {
14821
14821
  const l = c.track;
14822
- yield this.unpublishTrack(l, !1), s && !l.isMuted && l.source !== J.Source.ScreenShare && l.source !== J.Source.ScreenShareAudio && (hi(l) || Ii(l)) && !l.isUserProvided && (this.log.debug("restarting existing track", Object.assign(Object.assign({}, this.logContext), {
14822
+ yield this.unpublishTrack(l, !1), s && !l.isMuted && l.source !== J.Source.ScreenShare && l.source !== J.Source.ScreenShareAudio && (fi(l) || Ii(l)) && !l.isUserProvided && (this.log.debug("restarting existing track", Object.assign(Object.assign({}, this.logContext), {
14823
14823
  track: c.trackSid
14824
14824
  })), yield l.restartTrack()), yield this.publishOrRepublishTrack(l, c.options, !0);
14825
14825
  }))), r();
@@ -14987,7 +14987,7 @@ class Qb extends em {
14987
14987
  d(It.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));
14988
14988
  return;
14989
14989
  }
14990
- if (!((h = (u = this.engine.latestJoinResponse) === null || u === void 0 ? void 0 : u.serverInfo) === null || h === void 0) && h.version && ii((g = (f = this.engine.latestJoinResponse) === null || f === void 0 ? void 0 : f.serverInfo) === null || g === void 0 ? void 0 : g.version, "1.8.0") < 0) {
14990
+ if (!((h = (u = this.engine.latestJoinResponse) === null || u === void 0 ? void 0 : u.serverInfo) === null || h === void 0) && h.version && si((g = (f = this.engine.latestJoinResponse) === null || f === void 0 ? void 0 : f.serverInfo) === null || g === void 0 ? void 0 : g.version, "1.8.0") < 0) {
14991
14991
  d(It.builtIn("UNSUPPORTED_SERVER"));
14992
14992
  return;
14993
14993
  }
@@ -15111,13 +15111,13 @@ class Qb extends em {
15111
15111
  this.firstActiveAgent = e, e && !this.firstActiveAgent && (this.firstActiveAgent = e), e ? (n = (t = this.activeAgentFuture) === null || t === void 0 ? void 0 : t.resolve) === null || n === void 0 || n.call(t, e) : (r = (s = this.activeAgentFuture) === null || s === void 0 ? void 0 : s.reject) === null || r === void 0 || r.call(s, "Agent disconnected"), this.activeAgentFuture = void 0;
15112
15112
  }
15113
15113
  waitUntilActiveAgentPresent() {
15114
- return this.firstActiveAgent ? Promise.resolve(this.firstActiveAgent) : (this.activeAgentFuture || (this.activeAgentFuture = new Kn()), this.activeAgentFuture.promise);
15114
+ return this.firstActiveAgent ? Promise.resolve(this.firstActiveAgent) : (this.activeAgentFuture || (this.activeAgentFuture = new Yn()), this.activeAgentFuture.promise);
15115
15115
  }
15116
15116
  getPublicationForTrack(e) {
15117
15117
  let t;
15118
15118
  return this.trackPublications.forEach((n) => {
15119
15119
  const s = n.track;
15120
- s && (e instanceof MediaStreamTrack ? (hi(s) || Ii(s)) && s.mediaStreamTrack === e && (t = n) : e === s && (t = n));
15120
+ s && (e instanceof MediaStreamTrack ? (fi(s) || Ii(s)) && s.mediaStreamTrack === e && (t = n) : e === s && (t = n));
15121
15121
  }), t;
15122
15122
  }
15123
15123
  waitForPendingPublicationOfSource(e) {
@@ -15135,7 +15135,7 @@ class Qb extends em {
15135
15135
  });
15136
15136
  }
15137
15137
  }
15138
- class e_ extends mi {
15138
+ class e_ extends gi {
15139
15139
  constructor(e, t, n, s) {
15140
15140
  super(e, t.sid, t.name, s), this.track = void 0, this.allowed = !0, this.requestedDisabled = void 0, this.visible = !0, this.handleEnded = (r) => {
15141
15141
  this.setTrack(void 0), this.emit(re.Ended, r);
@@ -15165,10 +15165,10 @@ class e_ extends mi {
15165
15165
  this.emit(re.UpdateSubscription, s), this.emitSubscriptionUpdateIfChanged(t), this.emitPermissionUpdateIfChanged(n);
15166
15166
  }
15167
15167
  get subscriptionStatus() {
15168
- return this.subscribed === !1 ? mi.SubscriptionStatus.Unsubscribed : super.isSubscribed ? mi.SubscriptionStatus.Subscribed : mi.SubscriptionStatus.Desired;
15168
+ return this.subscribed === !1 ? gi.SubscriptionStatus.Unsubscribed : super.isSubscribed ? gi.SubscriptionStatus.Subscribed : gi.SubscriptionStatus.Desired;
15169
15169
  }
15170
15170
  get permissionStatus() {
15171
- return this.allowed ? mi.PermissionStatus.Allowed : mi.PermissionStatus.NotAllowed;
15171
+ return this.allowed ? gi.PermissionStatus.Allowed : gi.PermissionStatus.NotAllowed;
15172
15172
  }
15173
15173
  /**
15174
15174
  * Returns true if track is subscribed, and ready for playback
@@ -15372,7 +15372,7 @@ class io extends em {
15372
15372
  }
15373
15373
  const c = e.kind === "video";
15374
15374
  let l;
15375
- return c ? l = new Xb(e, t, s, r) : l = new jb(e, t, s, this.audioContext, this.audioOutput), l.source = o.source, l.isMuted = o.isMuted, l.setMediaStream(n), l.start(), o.setTrack(l), this.volumeMap.has(o.source) && Yc(l) && Zn(l) && l.setVolume(this.volumeMap.get(o.source)), o;
15375
+ return c ? l = new Xb(e, t, s, r) : l = new jb(e, t, s, this.audioContext, this.audioOutput), l.source = o.source, l.isMuted = o.isMuted, l.setMediaStream(n), l.start(), o.setTrack(l), this.volumeMap.has(o.source) && Yc(l) && Qn(l) && l.setVolume(this.volumeMap.get(o.source)), o;
15376
15376
  }
15377
15377
  /** @internal */
15378
15378
  get hasMetadata() {
@@ -15442,7 +15442,7 @@ class io extends em {
15442
15442
  const t = [];
15443
15443
  this.audioTrackPublications.forEach((n) => {
15444
15444
  var s;
15445
- Zn(n.track) && Yc(n.track) && t.push(n.track.setSinkId((s = e.deviceId) !== null && s !== void 0 ? s : "default"));
15445
+ Qn(n.track) && Yc(n.track) && t.push(n.track.setSinkId((s = e.deviceId) !== null && s !== void 0 ? s : "default"));
15446
15446
  }), yield Promise.all(t);
15447
15447
  });
15448
15448
  }
@@ -15461,7 +15461,7 @@ var it;
15461
15461
  i.Disconnected = "disconnected", i.Connecting = "connecting", i.Connected = "connected", i.Reconnecting = "reconnecting", i.SignalReconnecting = "signalReconnecting";
15462
15462
  })(it || (it = {}));
15463
15463
  const t_ = 4 * 1e3;
15464
- class rr extends ri.EventEmitter {
15464
+ class rr extends ai.EventEmitter {
15465
15465
  /**
15466
15466
  * Creates a new Room, the primary construct for a LiveKit session.
15467
15467
  * @param options
@@ -15471,7 +15471,7 @@ class rr extends ri.EventEmitter {
15471
15471
  if (super(), t = this, this.state = it.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.isVideoPlaybackBlocked = !1, this.log = $e, this.bufferedEvents = [], this.isResuming = !1, this.rpcHandlers = /* @__PURE__ */ new Map(), this.connect = (a, o, c) => P(this, void 0, void 0, function* () {
15472
15472
  var l;
15473
15473
  if (!k0())
15474
- throw ni() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
15474
+ throw ii() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
15475
15475
  const d = yield this.disconnectLock.lock();
15476
15476
  if (this.state === it.Connected)
15477
15477
  return this.log.info("already connected to room ".concat(this.name), this.logContext), d(), Promise.resolve();
@@ -15493,24 +15493,24 @@ class rr extends ri.EventEmitter {
15493
15493
  try {
15494
15494
  yield this.attemptConnection(v ?? a, o, c, x), this.abortController = void 0, f();
15495
15495
  } catch (C) {
15496
- if (this.regionUrlProvider && C instanceof bt && C.reason !== Ye.Cancelled && C.reason !== Ye.NotAllowed) {
15496
+ if (this.regionUrlProvider && C instanceof St && C.reason !== Ye.Cancelled && C.reason !== Ye.NotAllowed) {
15497
15497
  let b = null;
15498
15498
  try {
15499
15499
  b = yield this.regionUrlProvider.getNextBestRegionUrl((m = this.abortController) === null || m === void 0 ? void 0 : m.signal);
15500
15500
  } catch (S) {
15501
- if (S instanceof bt && (S.status === 401 || S.reason === Ye.Cancelled)) {
15501
+ if (S instanceof St && (S.status === 401 || S.reason === Ye.Cancelled)) {
15502
15502
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), g(S);
15503
15503
  return;
15504
15504
  }
15505
15505
  }
15506
15506
  b && !(!((p = this.abortController) === null || p === void 0) && p.signal.aborted) ? (this.log.info("Initial connection failed with ConnectionError: ".concat(C.message, ". Retrying with another region: ").concat(b), this.logContext), this.recreateEngine(), yield u(f, g, b)) : (this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Xu(C)), g(C));
15507
15507
  } else {
15508
- let b = Fn.UNKNOWN_REASON;
15509
- C instanceof bt && (b = Xu(C)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, b), g(C);
15508
+ let b = Bn.UNKNOWN_REASON;
15509
+ C instanceof St && (b = Xu(C)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, b), g(C);
15510
15510
  }
15511
15511
  }
15512
15512
  }), h = this.regionUrl;
15513
- return this.regionUrl = void 0, this.connectFuture = new Kn((f, g) => {
15513
+ return this.regionUrl = void 0, this.connectFuture = new Yn((f, g) => {
15514
15514
  u(f, g, h);
15515
15515
  }, () => {
15516
15516
  this.clearConnectionFutures();
@@ -15557,13 +15557,13 @@ class rr extends ri.EventEmitter {
15557
15557
  this.applyJoinResponse(h), this.setupLocalParticipantEvents(), this.emit(te.SignalConnected);
15558
15558
  } catch (h) {
15559
15559
  yield this.engine.close(), this.recreateEngine();
15560
- const f = new bt("could not establish signal connection", Ye.ServerUnreachable);
15561
- throw h instanceof Error && (f.message = "".concat(f.message, ": ").concat(h.message)), h instanceof bt && (f.reason = h.reason, f.status = h.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
15560
+ const f = new St("could not establish signal connection", Ye.ServerUnreachable);
15561
+ throw h instanceof Error && (f.message = "".concat(f.message, ": ").concat(h.message)), h instanceof St && (f.reason = h.reason, f.status = h.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
15562
15562
  error: h
15563
15563
  })), f;
15564
15564
  }
15565
15565
  if (l.signal.aborted)
15566
- throw yield this.engine.close(), this.recreateEngine(), new bt("Connection attempt aborted", Ye.Cancelled);
15566
+ throw yield this.engine.close(), this.recreateEngine(), new St("Connection attempt aborted", Ye.Cancelled);
15567
15567
  try {
15568
15568
  yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout, l);
15569
15569
  } catch (h) {
@@ -15584,7 +15584,7 @@ class rr extends ri.EventEmitter {
15584
15584
  l.log.debug("already disconnected", l.logContext);
15585
15585
  return;
15586
15586
  }
15587
- l.log.info("disconnect from room", Object.assign({}, l.logContext)), (l.state === it.Connecting || l.state === it.Reconnecting || l.isResuming) && (l.log.warn("abort connection attempt", l.logContext), (u = l.abortController) === null || u === void 0 || u.abort(), (f = (h = l.connectFuture) === null || h === void 0 ? void 0 : h.reject) === null || f === void 0 || f.call(h, new bt("Client initiated disconnect", Ye.Cancelled)), l.connectFuture = void 0), !((g = l.engine) === null || g === void 0) && g.client.isDisconnected || (yield l.engine.client.sendLeave()), l.engine && (yield l.engine.close()), l.handleDisconnect(d, Fn.CLIENT_INITIATED), l.engine = void 0;
15587
+ l.log.info("disconnect from room", Object.assign({}, l.logContext)), (l.state === it.Connecting || l.state === it.Reconnecting || l.isResuming) && (l.log.warn("abort connection attempt", l.logContext), (u = l.abortController) === null || u === void 0 || u.abort(), (f = (h = l.connectFuture) === null || h === void 0 ? void 0 : h.reject) === null || f === void 0 || f.call(h, new St("Client initiated disconnect", Ye.Cancelled)), l.connectFuture = void 0), !((g = l.engine) === null || g === void 0) && g.client.isDisconnected || (yield l.engine.client.sendLeave()), l.engine && (yield l.engine.close()), l.handleDisconnect(d, Bn.CLIENT_INITIATED), l.engine = void 0;
15588
15588
  } finally {
15589
15589
  v();
15590
15590
  }
@@ -15789,7 +15789,7 @@ class rr extends ri.EventEmitter {
15789
15789
  (o = a == null ? void 0 : a.onPublish) === null || o === void 0 || o.call(a, this);
15790
15790
  }, this.onLocalTrackPublished = (a) => P(this, void 0, void 0, function* () {
15791
15791
  var o, c, l, d, u, h;
15792
- (o = a.track) === null || o === void 0 || o.on(re.TrackProcessorUpdate, this.onTrackProcessorUpdate), (c = a.track) === null || c === void 0 || c.on(re.Restarted, this.onLocalTrackRestarted), (u = (d = (l = a.track) === null || l === void 0 ? void 0 : l.getProcessor()) === null || d === void 0 ? void 0 : d.onPublish) === null || u === void 0 || u.call(d, this), this.emit(te.LocalTrackPublished, a, this.localParticipant), hi(a.track) && (yield a.track.checkForSilence()) && this.emit(te.LocalAudioSilenceDetected, a);
15792
+ (o = a.track) === null || o === void 0 || o.on(re.TrackProcessorUpdate, this.onTrackProcessorUpdate), (c = a.track) === null || c === void 0 || c.on(re.Restarted, this.onLocalTrackRestarted), (u = (d = (l = a.track) === null || l === void 0 ? void 0 : l.getProcessor()) === null || d === void 0 ? void 0 : d.onPublish) === null || u === void 0 || u.call(d, this), this.emit(te.LocalTrackPublished, a, this.localParticipant), fi(a.track) && (yield a.track.checkForSilence()) && this.emit(te.LocalAudioSilenceDetected, a);
15793
15793
  const f = yield (h = a.track) === null || h === void 0 ? void 0 : h.getDeviceId(!1), g = Zc(a.source);
15794
15794
  g && f && f !== this.localParticipant.activeDeviceMap.get(g) && (this.localParticipant.activeDeviceMap.set(g, f), this.emit(te.ActiveDeviceChanged, g, f));
15795
15795
  }), this.onLocalTrackUnpublished = (a) => {
@@ -15806,7 +15806,7 @@ class rr extends ri.EventEmitter {
15806
15806
  this.emit(te.ParticipantPermissionsChanged, a, this.localParticipant);
15807
15807
  }, this.onLocalChatMessageSent = (a) => {
15808
15808
  this.emit(te.ChatMessage, a, this.localParticipant);
15809
- }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, pb), e), this.log = Ci((n = this.options.loggerName) !== null && n !== void 0 ? n : Vn.Room), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, qp), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, jp), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, fb), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new Gb(), this.outgoingDataStreamManager = new qb(this.engine, this.log), this.disconnectLock = new hn(), this.localParticipant = new Qb("", "", this.engine, this.options, this.rpcHandlers, this.outgoingDataStreamManager), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", Ki(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", Ki(this.options.audioCaptureDefaults.deviceId)), !((s = this.options.audioOutput) === null || s === void 0) && s.deviceId && this.switchActiveDevice("audiooutput", Ki(this.options.audioOutput.deviceId)).catch((a) => this.log.warn("Could not set audio output: ".concat(a.message), this.logContext)), this.options.e2ee && this.setupE2EE(), un()) {
15809
+ }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, pb), e), this.log = Ei((n = this.options.loggerName) !== null && n !== void 0 ? n : zn.Room), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, qp), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, jp), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, fb), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new Gb(), this.outgoingDataStreamManager = new qb(this.engine, this.log), this.disconnectLock = new hn(), this.localParticipant = new Qb("", "", this.engine, this.options, this.rpcHandlers, this.outgoingDataStreamManager), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", Ki(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", Ki(this.options.audioCaptureDefaults.deviceId)), !((s = this.options.audioOutput) === null || s === void 0) && s.deviceId && this.switchActiveDevice("audiooutput", Ki(this.options.audioOutput.deviceId)).catch((a) => this.log.warn("Could not set audio output: ".concat(a.message), this.logContext)), this.options.e2ee && this.setupE2EE(), un()) {
15810
15810
  const a = new AbortController();
15811
15811
  (r = navigator.mediaDevices) === null || r === void 0 || r.addEventListener("devicechange", this.handleDeviceChange, {
15812
15812
  signal: a.signal
@@ -16032,7 +16032,7 @@ class rr extends ri.EventEmitter {
16032
16032
  yield this.engine.client.handleOnClose("simulate disconnect");
16033
16033
  break;
16034
16034
  case "speaker":
16035
- s = new qn({
16035
+ s = new jn({
16036
16036
  scenario: {
16037
16037
  case: "speakerUpdate",
16038
16038
  value: 3
@@ -16040,7 +16040,7 @@ class rr extends ri.EventEmitter {
16040
16040
  });
16041
16041
  break;
16042
16042
  case "node-failure":
16043
- s = new qn({
16043
+ s = new jn({
16044
16044
  scenario: {
16045
16045
  case: "nodeFailure",
16046
16046
  value: !0
@@ -16048,7 +16048,7 @@ class rr extends ri.EventEmitter {
16048
16048
  });
16049
16049
  break;
16050
16050
  case "server-leave":
16051
- s = new qn({
16051
+ s = new jn({
16052
16052
  scenario: {
16053
16053
  case: "serverLeave",
16054
16054
  value: !0
@@ -16056,7 +16056,7 @@ class rr extends ri.EventEmitter {
16056
16056
  });
16057
16057
  break;
16058
16058
  case "migration":
16059
- s = new qn({
16059
+ s = new jn({
16060
16060
  scenario: {
16061
16061
  case: "migration",
16062
16062
  value: !0
@@ -16069,7 +16069,7 @@ class rr extends ri.EventEmitter {
16069
16069
  case "disconnect-signal-on-resume":
16070
16070
  n = () => P(this, void 0, void 0, function* () {
16071
16071
  yield this.engine.client.handleOnClose("simulate resume-disconnect");
16072
- }), s = new qn({
16072
+ }), s = new jn({
16073
16073
  scenario: {
16074
16074
  case: "disconnectSignalOnResume",
16075
16075
  value: !0
@@ -16079,7 +16079,7 @@ class rr extends ri.EventEmitter {
16079
16079
  case "disconnect-signal-on-resume-no-messages":
16080
16080
  n = () => P(this, void 0, void 0, function* () {
16081
16081
  yield this.engine.client.handleOnClose("simulate resume-disconnect");
16082
- }), s = new qn({
16082
+ }), s = new jn({
16083
16083
  scenario: {
16084
16084
  case: "disconnectSignalOnResumeNoMessages",
16085
16085
  value: !0
@@ -16091,7 +16091,7 @@ class rr extends ri.EventEmitter {
16091
16091
  break;
16092
16092
  case "force-tcp":
16093
16093
  case "force-tls":
16094
- s = new qn({
16094
+ s = new jn({
16095
16095
  scenario: {
16096
16096
  case: "switchCandidateProtocol",
16097
16097
  value: e === "force-tls" ? 2 : 1
@@ -16099,7 +16099,7 @@ class rr extends ri.EventEmitter {
16099
16099
  }), n = () => P(this, void 0, void 0, function* () {
16100
16100
  const r = this.engine.client.onLeave;
16101
16101
  r && r(new ho({
16102
- reason: Fn.CLIENT_INITIATED,
16102
+ reason: Bn.CLIENT_INITIATED,
16103
16103
  action: $s.RECONNECT
16104
16104
  }));
16105
16105
  });
@@ -16107,7 +16107,7 @@ class rr extends ri.EventEmitter {
16107
16107
  case "subscriber-bandwidth":
16108
16108
  if (t === void 0 || typeof t != "number")
16109
16109
  throw new Error("subscriber-bandwidth requires a number as argument");
16110
- s = new qn({
16110
+ s = new jn({
16111
16111
  scenario: {
16112
16112
  case: "subscriberBandwidth",
16113
16113
  value: cs(t)
@@ -16115,7 +16115,7 @@ class rr extends ri.EventEmitter {
16115
16115
  });
16116
16116
  break;
16117
16117
  case "leave-full-reconnect":
16118
- s = new qn({
16118
+ s = new jn({
16119
16119
  scenario: {
16120
16120
  case: "leaveRequestFullReconnect",
16121
16121
  value: !0
@@ -16428,7 +16428,7 @@ class rr extends ri.EventEmitter {
16428
16428
  closed: this.engine.isClosed,
16429
16429
  transportsConnected: this.engine.verifyTransport()
16430
16430
  } : void 0
16431
- })), e >= 3 && (this.recreateEngine(), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Fn.STATE_MISMATCH))) : e = 0;
16431
+ })), e >= 3 && (this.recreateEngine(), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Bn.STATE_MISMATCH))) : e = 0;
16432
16432
  }, t_);
16433
16433
  }
16434
16434
  clearConnectionReconcile() {
@@ -16489,7 +16489,7 @@ class rr extends ri.EventEmitter {
16489
16489
  const a = new sl(J.Kind.Video, new Ws({
16490
16490
  source: Ft.CAMERA,
16491
16491
  sid: Math.floor(Math.random() * 1e4).toString(),
16492
- type: Ln.AUDIO,
16492
+ type: Nn.AUDIO,
16493
16493
  name: "video-dummy"
16494
16494
  }), new no(s.useRealTracks ? (yield window.navigator.mediaDevices.getUserMedia({
16495
16495
  video: !0
@@ -16506,7 +16506,7 @@ class rr extends ri.EventEmitter {
16506
16506
  const a = new sl(J.Kind.Audio, new Ws({
16507
16507
  source: Ft.MICROPHONE,
16508
16508
  sid: Math.floor(Math.random() * 1e4).toString(),
16509
- type: Ln.AUDIO
16509
+ type: Nn.AUDIO
16510
16510
  }), new to(s.useRealTracks ? (yield navigator.mediaDevices.getUserMedia({
16511
16511
  audio: !0
16512
16512
  })).getAudioTracks()[0] : Fo(), void 0, !1, this.audioContext, {
@@ -16531,7 +16531,7 @@ class rr extends ri.EventEmitter {
16531
16531
  const l = ju(160 * ((n = r.aspectRatios[a % r.aspectRatios.length]) !== null && n !== void 0 ? n : 1), 160, !1, !0), d = new Ws({
16532
16532
  source: Ft.CAMERA,
16533
16533
  sid: Math.floor(Math.random() * 1e4).toString(),
16534
- type: Ln.AUDIO
16534
+ type: Nn.AUDIO
16535
16535
  });
16536
16536
  c.addSubscribedMediaTrack(l, d.sid, new MediaStream([l]), new RTCRtpReceiver()), o.tracks = [...o.tracks, d];
16537
16537
  }
@@ -16539,7 +16539,7 @@ class rr extends ri.EventEmitter {
16539
16539
  const l = Fo(), d = new Ws({
16540
16540
  source: Ft.MICROPHONE,
16541
16541
  sid: Math.floor(Math.random() * 1e4).toString(),
16542
- type: Ln.AUDIO
16542
+ type: Nn.AUDIO
16543
16543
  });
16544
16544
  c.addSubscribedMediaTrack(l, d.sid, new MediaStream([l]), new RTCRtpReceiver()), o.tracks = [...o.tracks, d];
16545
16545
  }
@@ -16570,26 +16570,26 @@ function tm(i) {
16570
16570
  return Array.isArray(e) ? tm(e) : typeof e == "object" ? "logContext" in e ? e.logContext : void 0 : e;
16571
16571
  });
16572
16572
  }
16573
- var Dn;
16573
+ var Ln;
16574
16574
  (function(i) {
16575
16575
  i[i.IDLE = 0] = "IDLE", i[i.RUNNING = 1] = "RUNNING", i[i.SKIPPED = 2] = "SKIPPED", i[i.SUCCESS = 3] = "SUCCESS", i[i.FAILED = 4] = "FAILED";
16576
- })(Dn || (Dn = {}));
16577
- class Zi extends ri.EventEmitter {
16576
+ })(Ln || (Ln = {}));
16577
+ class Zi extends ai.EventEmitter {
16578
16578
  constructor(e, t) {
16579
16579
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
16580
- super(), this.status = Dn.IDLE, this.logs = [], this.options = {}, this.url = e, this.token = t, this.name = this.constructor.name, this.room = new rr(n.roomOptions), this.connectOptions = n.connectOptions, this.options = n;
16580
+ super(), this.status = Ln.IDLE, this.logs = [], this.options = {}, this.url = e, this.token = t, this.name = this.constructor.name, this.room = new rr(n.roomOptions), this.connectOptions = n.connectOptions, this.options = n;
16581
16581
  }
16582
16582
  run(e) {
16583
16583
  return P(this, void 0, void 0, function* () {
16584
- if (this.status !== Dn.IDLE)
16584
+ if (this.status !== Ln.IDLE)
16585
16585
  throw Error("check is running already");
16586
- this.setStatus(Dn.RUNNING);
16586
+ this.setStatus(Ln.RUNNING);
16587
16587
  try {
16588
16588
  yield this.perform();
16589
16589
  } catch (t) {
16590
16590
  t instanceof Error && (this.options.errorsAsWarnings ? this.appendWarning(t.message) : this.appendError(t.message));
16591
16591
  }
16592
- return yield this.disconnect(), yield new Promise((t) => setTimeout(t, 500)), this.status !== Dn.SKIPPED && this.setStatus(this.isSuccess() ? Dn.SUCCESS : Dn.FAILED), e && e(), this.getInfo();
16592
+ return yield this.disconnect(), yield new Promise((t) => setTimeout(t, 500)), this.status !== Ln.SKIPPED && this.setStatus(this.isSuccess() ? Ln.SUCCESS : Ln.FAILED), e && e(), this.getInfo();
16593
16593
  });
16594
16594
  }
16595
16595
  isSuccess() {
@@ -16606,7 +16606,7 @@ class Zi extends ri.EventEmitter {
16606
16606
  });
16607
16607
  }
16608
16608
  skip() {
16609
- this.setStatus(Dn.SKIPPED);
16609
+ this.setStatus(Ln.SKIPPED);
16610
16610
  }
16611
16611
  switchProtocol(e) {
16612
16612
  return P(this, void 0, void 0, function* () {
@@ -16953,7 +16953,7 @@ class d_ extends Zi {
16953
16953
  });
16954
16954
  }
16955
16955
  }
16956
- class GE extends ri.EventEmitter {
16956
+ class GE extends ai.EventEmitter {
16957
16957
  constructor(e, t) {
16958
16958
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
16959
16959
  super(), this.options = {}, this.checkResults = /* @__PURE__ */ new Map(), this.url = e, this.token = t, this.options = n;
@@ -16962,7 +16962,7 @@ class GE extends ri.EventEmitter {
16962
16962
  const e = this.checkResults.size;
16963
16963
  return this.checkResults.set(e, {
16964
16964
  logs: [],
16965
- status: Dn.IDLE,
16965
+ status: Ln.IDLE,
16966
16966
  name: "",
16967
16967
  description: ""
16968
16968
  }), e;
@@ -16971,7 +16971,7 @@ class GE extends ri.EventEmitter {
16971
16971
  this.checkResults.set(e, t), this.emit("checkUpdate", e, t);
16972
16972
  }
16973
16973
  isSuccess() {
16974
- return Array.from(this.checkResults.values()).every((e) => e.status !== Dn.FAILED);
16974
+ return Array.from(this.checkResults.values()).every((e) => e.status !== Ln.FAILED);
16975
16975
  }
16976
16976
  getResults() {
16977
16977
  return Array.from(this.checkResults.values());
@@ -17259,26 +17259,24 @@ class wd extends EventTarget {
17259
17259
  }
17260
17260
  async makeCall({ agentId: e }) {
17261
17261
  if (this.room && this.room.state === "connected") return;
17262
- if (this.isAppleDevice)
17262
+ if (this.updateStatus("connecting"), this.isAppleDevice)
17263
17263
  try {
17264
17264
  const n = new Audio(
17265
17265
  "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA="
17266
17266
  );
17267
- n.volume = 1e-3, await n.play().catch(() => {
17268
- }), n.pause(), n.remove(), console.log("[LiveKit] iOS audio playback unlocked");
17267
+ n.volume = 1e-3, n.play().then(() => {
17268
+ n.pause(), n.remove(), console.log("[LiveKit] iOS audio playback unlocked");
17269
+ }).catch(() => {
17270
+ n.remove();
17271
+ });
17269
17272
  } catch (n) {
17270
17273
  console.warn("[LiveKit] Failed to unlock iOS audio:", n);
17271
17274
  }
17272
- let t = null;
17273
- try {
17274
- t = await navigator.mediaDevices.getUserMedia({
17275
- audio: !0,
17276
- video: !1
17277
- }), console.log("Microphone permission granted");
17278
- } catch (n) {
17279
- console.warn("Microphone permission denied or not available:", n);
17280
- }
17281
- this.updateStatus("connecting"), this.error = null, this.isReady = !1, this.room && (await this.room.disconnect(), this.room = null);
17275
+ const t = navigator.mediaDevices.getUserMedia({
17276
+ audio: !0,
17277
+ video: !1
17278
+ }).then((n) => (console.log("Microphone permission granted"), n)).catch((n) => (console.warn("Microphone permission denied or not available:", n), null));
17279
+ this.error = null, this.isReady = !1, this.room && (await this.room.disconnect(), this.room = null);
17282
17280
  try {
17283
17281
  const n = new rr({
17284
17282
  webAudioMix: !0
@@ -17314,40 +17312,49 @@ class wd extends EventTarget {
17314
17312
  const { token: r, url: a, room_name: o, user_identity: c } = await s.json();
17315
17313
  this.roomName = o, this.userIdentity = c, this.reconnectAttempts = 0, this.wasConnectedBeforeHidden = !1, await this.connectWithTimeout(n, a, r, 2e4);
17316
17314
  try {
17317
- await n.startAudio(), console.log("[LiveKit] Audio playback started");
17315
+ await Promise.race([
17316
+ n.startAudio(),
17317
+ new Promise((l) => setTimeout(l, 3e3))
17318
+ ]), console.log("[LiveKit] Audio playback started");
17318
17319
  } catch (l) {
17319
17320
  console.warn("[LiveKit] Failed to start audio:", l);
17320
17321
  }
17321
17322
  this.updateStatus("connected"), this.isReady = !0, requestAnimationFrame(() => {
17322
17323
  this.scheduleTimer(async () => {
17323
17324
  if (this.isDestroyed || !this.room || this.room.state !== "connected") {
17324
- t && t.getTracks().forEach((l) => l.stop());
17325
+ t.then((d) => {
17326
+ d && d.getTracks().forEach((u) => u.stop());
17327
+ });
17325
17328
  return;
17326
17329
  }
17327
- if (t)
17330
+ const l = await Promise.race([
17331
+ t,
17332
+ new Promise((d) => setTimeout(() => d(null), 5e3))
17333
+ ]);
17334
+ if (l)
17328
17335
  try {
17329
17336
  await n.localParticipant.setMicrophoneEnabled(!0, {
17330
17337
  echoCancellation: !0,
17331
17338
  noiseSuppression: !0,
17332
17339
  autoGainControl: !this.isAppleDevice
17333
- }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), t.getTracks().forEach((l) => l.stop()), this.scheduleTimer(() => {
17340
+ }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), l.getTracks().forEach((d) => d.stop()), this.scheduleTimer(() => {
17334
17341
  if (!(this.isDestroyed || !this.room || this.room.state !== "connected"))
17335
17342
  try {
17336
- const l = Array.from(n.localParticipant.audioTrackPublications.values()).find((d) => d.kind === "audio");
17337
- if (l != null && l.track) {
17338
- const d = l.track.mediaStreamTrack;
17339
- d && this.dispatchEvent(
17343
+ const d = Array.from(n.localParticipant.audioTrackPublications.values()).find((u) => u.kind === "audio");
17344
+ if (d != null && d.track) {
17345
+ const u = d.track.mediaStreamTrack;
17346
+ u && this.dispatchEvent(
17340
17347
  new CustomEvent("local-audio-track", {
17341
- detail: d
17348
+ detail: u
17342
17349
  })
17343
17350
  );
17344
17351
  }
17345
- } catch (l) {
17346
- console.warn("[LiveKit] Error getting local audio track:", l);
17352
+ } catch (d) {
17353
+ console.warn("[LiveKit] Error getting local audio track:", d);
17347
17354
  }
17348
17355
  }, 100);
17349
- } catch (l) {
17350
- console.warn("Could not enable microphone on connect:", l), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
17356
+ } catch (d) {
17357
+ console.warn("Could not enable microphone on connect:", d), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
17351
17358
  }
17352
17359
  else
17353
17360
  this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
@@ -17358,7 +17365,9 @@ class wd extends EventTarget {
17358
17365
  })
17359
17366
  );
17360
17367
  } catch (n) {
17361
- t && t.getTracks().forEach((s) => s.stop()), this.error = `Connection failed: ${n instanceof Error ? n.message : String(n)}`, this.updateStatus("error"), this.isReady = !1, this.room = null, this.dispatchEvent(
17368
+ t.then((s) => {
17369
+ s && s.getTracks().forEach((r) => r.stop());
17370
+ }), this.error = `Connection failed: ${n instanceof Error ? n.message : String(n)}`, this.updateStatus("error"), this.isReady = !1, this.room = null, this.dispatchEvent(
17362
17371
  new CustomEvent("error", {
17363
17372
  detail: { error: this.error }
17364
17373
  })
@@ -17603,7 +17612,7 @@ class Ad {
17603
17612
  * Copyright 2010-2025 Three.js Authors
17604
17613
  * SPDX-License-Identifier: MIT
17605
17614
  */
17606
- const Rd = "182", h_ = 0, hh = 1, f_ = 2, za = 1, p_ = 2, Pr = 3, Ei = 0, nn = 1, yi = 2, xi = 0, Qs = 1, rl = 2, fh = 3, ph = 4, m_ = 5, us = 100, g_ = 101, v_ = 102, b_ = 103, __ = 104, y_ = 200, S_ = 201, x_ = 202, T_ = 203, al = 204, ol = 205, C_ = 206, E_ = 207, M_ = 208, w_ = 209, A_ = 210, R_ = 211, P_ = 212, k_ = 213, I_ = 214, cl = 0, ll = 1, dl = 2, ar = 3, ul = 4, hl = 5, fl = 6, pl = 7, nm = 0, D_ = 1, L_ = 2, Qn = 0, im = 1, sm = 2, rm = 3, am = 4, om = 5, cm = 6, lm = 7, dm = 300, Ts = 301, or = 302, ml = 303, gl = 304, go = 306, vl = 1e3, Si = 1001, bl = 1002, Yt = 1003, N_ = 1004, aa = 1005, Qt = 1006, $o = 1007, ps = 1008, Mn = 1009, um = 1010, hm = 1011, jr = 1012, Pd = 1013, si = 1014, Yn = 1015, Mi = 1016, kd = 1017, Id = 1018, Xr = 1020, fm = 35902, pm = 35899, mm = 1021, gm = 1022, Bn = 1023, wi = 1026, ms = 1027, vm = 1028, Dd = 1029, cr = 1030, Ld = 1031, Nd = 1033, Ga = 33776, Ha = 33777, Wa = 33778, qa = 33779, _l = 35840, yl = 35841, Sl = 35842, xl = 35843, Tl = 36196, Cl = 37492, El = 37496, Ml = 37488, wl = 37489, Al = 37490, Rl = 37491, Pl = 37808, kl = 37809, Il = 37810, Dl = 37811, Ll = 37812, Nl = 37813, Ul = 37814, Ol = 37815, Fl = 37816, Bl = 37817, Vl = 37818, zl = 37819, Gl = 37820, Hl = 37821, Wl = 36492, ql = 36494, jl = 36495, Xl = 36283, $l = 36284, Kl = 36285, Yl = 36286, U_ = 3200, O_ = 0, F_ = 1, Wi = "", Cn = "srgb", lr = "srgb-linear", so = "linear", lt = "srgb", Rs = 7680, mh = 519, B_ = 512, V_ = 513, z_ = 514, Ud = 515, G_ = 516, H_ = 517, Od = 518, W_ = 519, gh = 35044, vh = "300 es", Jn = 2e3, ro = 2001;
17615
+ const Rd = "182", h_ = 0, hh = 1, f_ = 2, za = 1, p_ = 2, Pr = 3, Mi = 0, nn = 1, Si = 2, Ti = 0, Qs = 1, rl = 2, fh = 3, ph = 4, m_ = 5, us = 100, g_ = 101, v_ = 102, b_ = 103, __ = 104, y_ = 200, S_ = 201, x_ = 202, T_ = 203, al = 204, ol = 205, C_ = 206, E_ = 207, M_ = 208, w_ = 209, A_ = 210, R_ = 211, P_ = 212, k_ = 213, I_ = 214, cl = 0, ll = 1, dl = 2, ar = 3, ul = 4, hl = 5, fl = 6, pl = 7, nm = 0, D_ = 1, L_ = 2, ei = 0, im = 1, sm = 2, rm = 3, am = 4, om = 5, cm = 6, lm = 7, dm = 300, Ts = 301, or = 302, ml = 303, gl = 304, go = 306, vl = 1e3, xi = 1001, bl = 1002, Yt = 1003, N_ = 1004, aa = 1005, Qt = 1006, $o = 1007, ps = 1008, Mn = 1009, um = 1010, hm = 1011, jr = 1012, Pd = 1013, ri = 1014, Jn = 1015, wi = 1016, kd = 1017, Id = 1018, Xr = 1020, fm = 35902, pm = 35899, mm = 1021, gm = 1022, Vn = 1023, Ai = 1026, ms = 1027, vm = 1028, Dd = 1029, cr = 1030, Ld = 1031, Nd = 1033, Ga = 33776, Ha = 33777, Wa = 33778, qa = 33779, _l = 35840, yl = 35841, Sl = 35842, xl = 35843, Tl = 36196, Cl = 37492, El = 37496, Ml = 37488, wl = 37489, Al = 37490, Rl = 37491, Pl = 37808, kl = 37809, Il = 37810, Dl = 37811, Ll = 37812, Nl = 37813, Ul = 37814, Ol = 37815, Fl = 37816, Bl = 37817, Vl = 37818, zl = 37819, Gl = 37820, Hl = 37821, Wl = 36492, ql = 36494, jl = 36495, Xl = 36283, $l = 36284, Kl = 36285, Yl = 36286, U_ = 3200, O_ = 0, F_ = 1, Wi = "", Cn = "srgb", lr = "srgb-linear", so = "linear", ht = "srgb", Rs = 7680, mh = 519, B_ = 512, V_ = 513, z_ = 514, Ud = 515, G_ = 516, H_ = 517, Od = 518, W_ = 519, gh = 35044, vh = "300 es", Zn = 2e3, ro = 2001;
17607
17616
  function bm(i) {
17608
17617
  for (let e = i.length - 1; e >= 0; --e)
17609
17618
  if (i[e] >= 65535) return !0;
@@ -19920,7 +19929,7 @@ function $_() {
19920
19929
  */
19921
19930
  spaces: {},
19922
19931
  convert: function(s, r, a) {
19923
- return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === lt && (s.r = Ti(s.r), s.g = Ti(s.g), s.b = Ti(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === lt && (s.r = er(s.r), s.g = er(s.g), s.b = er(s.b))), s;
19932
+ return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === ht && (s.r = Ci(s.r), s.g = Ci(s.g), s.b = Ci(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === ht && (s.r = er(s.r), s.g = er(s.g), s.b = er(s.b))), s;
19924
19933
  },
19925
19934
  workingToColorSpace: function(s, r) {
19926
19935
  return this.convert(s, this.workingColorSpace, r);
@@ -19975,7 +19984,7 @@ function $_() {
19975
19984
  [Cn]: {
19976
19985
  primaries: e,
19977
19986
  whitePoint: n,
19978
- transfer: lt,
19987
+ transfer: ht,
19979
19988
  toXYZ: Sh,
19980
19989
  fromXYZ: xh,
19981
19990
  luminanceCoefficients: t,
@@ -19984,7 +19993,7 @@ function $_() {
19984
19993
  }), i;
19985
19994
  }
19986
19995
  const Qe = /* @__PURE__ */ $_();
19987
- function Ti(i) {
19996
+ function Ci(i) {
19988
19997
  return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4);
19989
19998
  }
19990
19999
  function er(i) {
@@ -20026,12 +20035,12 @@ class K_ {
20026
20035
  n.drawImage(e, 0, 0, e.width, e.height);
20027
20036
  const s = n.getImageData(0, 0, e.width, e.height), r = s.data;
20028
20037
  for (let a = 0; a < r.length; a++)
20029
- r[a] = Ti(r[a] / 255) * 255;
20038
+ r[a] = Ci(r[a] / 255) * 255;
20030
20039
  return n.putImageData(s, 0, 0), t;
20031
20040
  } else if (e.data) {
20032
20041
  const t = e.data.slice(0);
20033
20042
  for (let n = 0; n < t.length; n++)
20034
- t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(Ti(t[n] / 255) * 255) : t[n] = Ti(t[n]);
20043
+ t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(Ci(t[n] / 255) * 255) : t[n] = Ci(t[n]);
20035
20044
  return {
20036
20045
  data: t,
20037
20046
  width: e.width,
@@ -20126,7 +20135,7 @@ class sn extends ur {
20126
20135
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
20127
20136
  * @param {string} [colorSpace=NoColorSpace] - The color space.
20128
20137
  */
20129
- constructor(e = sn.DEFAULT_IMAGE, t = sn.DEFAULT_MAPPING, n = Si, s = Si, r = Qt, a = ps, o = Bn, c = Mn, l = sn.DEFAULT_ANISOTROPY, d = Wi) {
20138
+ constructor(e = sn.DEFAULT_IMAGE, t = sn.DEFAULT_MAPPING, n = xi, s = xi, r = Qt, a = ps, o = Vn, c = Mn, l = sn.DEFAULT_ANISOTROPY, d = Wi) {
20130
20139
  super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: J_++ }), this.uuid = Zr(), this.name = "", this.source = new Fd(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = s, this.magFilter = r, this.minFilter = a, this.anisotropy = l, this.format = o, this.internalFormat = null, this.type = c, this.offset = new st(0, 0), this.repeat = new st(1, 1), this.center = new st(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ze(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = d, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0;
20131
20140
  }
20132
20141
  /**
@@ -20279,7 +20288,7 @@ class sn extends ur {
20279
20288
  case vl:
20280
20289
  e.x = e.x - Math.floor(e.x);
20281
20290
  break;
20282
- case Si:
20291
+ case xi:
20283
20292
  e.x = e.x < 0 ? 0 : 1;
20284
20293
  break;
20285
20294
  case bl:
@@ -20291,7 +20300,7 @@ class sn extends ur {
20291
20300
  case vl:
20292
20301
  e.y = e.y - Math.floor(e.y);
20293
20302
  break;
20294
- case Si:
20303
+ case xi:
20295
20304
  e.y = e.y < 0 ? 0 : 1;
20296
20305
  break;
20297
20306
  case bl:
@@ -21013,7 +21022,7 @@ class Z_ extends ur {
21013
21022
  this.dispatchEvent({ type: "dispose" });
21014
21023
  }
21015
21024
  }
21016
- class ei extends Z_ {
21025
+ class ti extends Z_ {
21017
21026
  /**
21018
21027
  * Constructs a new 3D render target.
21019
21028
  *
@@ -21035,7 +21044,7 @@ class _m extends sn {
21035
21044
  * @param {number} [depth=1] - The depth of the texture.
21036
21045
  */
21037
21046
  constructor(e = null, t = 1, n = 1, s = 1) {
21038
- super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = Si, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
21047
+ super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = xi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
21039
21048
  }
21040
21049
  /**
21041
21050
  * Describes that a specific layer of the texture needs to be updated.
@@ -21066,7 +21075,7 @@ class Q_ extends sn {
21066
21075
  * @param {number} [depth=1] - The depth of the texture.
21067
21076
  */
21068
21077
  constructor(e = null, t = 1, n = 1, s = 1) {
21069
- super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = Si, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
21078
+ super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = xi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
21070
21079
  }
21071
21080
  }
21072
21081
  class ea {
@@ -21100,7 +21109,7 @@ class ea {
21100
21109
  setFromArray(e) {
21101
21110
  this.makeEmpty();
21102
21111
  for (let t = 0, n = e.length; t < n; t += 3)
21103
- this.expandByPoint(Rn.fromArray(e, t));
21112
+ this.expandByPoint(Pn.fromArray(e, t));
21104
21113
  return this;
21105
21114
  }
21106
21115
  /**
@@ -21113,7 +21122,7 @@ class ea {
21113
21122
  setFromBufferAttribute(e) {
21114
21123
  this.makeEmpty();
21115
21124
  for (let t = 0, n = e.count; t < n; t++)
21116
- this.expandByPoint(Rn.fromBufferAttribute(e, t));
21125
+ this.expandByPoint(Pn.fromBufferAttribute(e, t));
21117
21126
  return this;
21118
21127
  }
21119
21128
  /**
@@ -21138,7 +21147,7 @@ class ea {
21138
21147
  * @return {Box3} A reference to this bounding box.
21139
21148
  */
21140
21149
  setFromCenterAndSize(e, t) {
21141
- const n = Rn.copy(t).multiplyScalar(0.5);
21150
+ const n = Pn.copy(t).multiplyScalar(0.5);
21142
21151
  return this.min.copy(e).sub(n), this.max.copy(e).add(n), this;
21143
21152
  }
21144
21153
  /**
@@ -21257,7 +21266,7 @@ class ea {
21257
21266
  const r = n.getAttribute("position");
21258
21267
  if (t === !0 && r !== void 0 && e.isInstancedMesh !== !0)
21259
21268
  for (let a = 0, o = r.count; a < o; a++)
21260
- e.isMesh === !0 ? e.getVertexPosition(a, Rn) : Rn.fromBufferAttribute(r, a), Rn.applyMatrix4(e.matrixWorld), this.expandByPoint(Rn);
21269
+ e.isMesh === !0 ? e.getVertexPosition(a, Pn) : Pn.fromBufferAttribute(r, a), Pn.applyMatrix4(e.matrixWorld), this.expandByPoint(Pn);
21261
21270
  else
21262
21271
  e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), oa.copy(e.boundingBox)) : (n.boundingBox === null && n.computeBoundingBox(), oa.copy(n.boundingBox)), oa.applyMatrix4(e.matrixWorld), this.union(oa);
21263
21272
  }
@@ -21315,7 +21324,7 @@ class ea {
21315
21324
  * @return {boolean} Whether the given bounding sphere intersects with this bounding box.
21316
21325
  */
21317
21326
  intersectsSphere(e) {
21318
- return this.clampPoint(e.center, Rn), Rn.distanceToSquared(e.center) <= e.radius * e.radius;
21327
+ return this.clampPoint(e.center, Pn), Pn.distanceToSquared(e.center) <= e.radius * e.radius;
21319
21328
  }
21320
21329
  /**
21321
21330
  * Returns `true` if the given plane intersects with this bounding box.
@@ -21386,7 +21395,7 @@ class ea {
21386
21395
  * @return {number} The euclidean distance.
21387
21396
  */
21388
21397
  distanceToPoint(e) {
21389
- return this.clampPoint(e, Rn).distanceTo(e);
21398
+ return this.clampPoint(e, Pn).distanceTo(e);
21390
21399
  }
21391
21400
  /**
21392
21401
  * Returns a bounding sphere that encloses this bounding box.
@@ -21395,7 +21404,7 @@ class ea {
21395
21404
  * @return {Sphere} The bounding sphere that encloses this bounding box.
21396
21405
  */
21397
21406
  getBoundingSphere(e) {
21398
- return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(Rn).length() * 0.5), e;
21407
+ return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(Pn).length() * 0.5), e;
21399
21408
  }
21400
21409
  /**
21401
21410
  * Computes the intersection of this bounding box and the given one, setting the upper
@@ -21427,7 +21436,7 @@ class ea {
21427
21436
  * @return {Box3} A reference to this bounding box.
21428
21437
  */
21429
21438
  applyMatrix4(e) {
21430
- return this.isEmpty() ? this : (oi[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), oi[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), oi[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), oi[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), oi[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), oi[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), oi[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), oi[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(oi), this);
21439
+ return this.isEmpty() ? this : (ci[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), ci[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), ci[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), ci[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), ci[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), ci[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), ci[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), ci[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(ci), this);
21431
21440
  }
21432
21441
  /**
21433
21442
  * Adds the given offset to both the upper and lower bounds of this bounding box,
@@ -21469,7 +21478,7 @@ class ea {
21469
21478
  return this.min.fromArray(e.min), this.max.fromArray(e.max), this;
21470
21479
  }
21471
21480
  }
21472
- const oi = [
21481
+ const ci = [
21473
21482
  /* @__PURE__ */ new B(),
21474
21483
  /* @__PURE__ */ new B(),
21475
21484
  /* @__PURE__ */ new B(),
@@ -21478,7 +21487,7 @@ const oi = [
21478
21487
  /* @__PURE__ */ new B(),
21479
21488
  /* @__PURE__ */ new B(),
21480
21489
  /* @__PURE__ */ new B()
21481
- ], Rn = /* @__PURE__ */ new B(), oa = /* @__PURE__ */ new ea(), ks = /* @__PURE__ */ new B(), Is = /* @__PURE__ */ new B(), Ds = /* @__PURE__ */ new B(), Li = /* @__PURE__ */ new B(), Ni = /* @__PURE__ */ new B(), ns = /* @__PURE__ */ new B(), xr = /* @__PURE__ */ new B(), ca = /* @__PURE__ */ new B(), la = /* @__PURE__ */ new B(), is = /* @__PURE__ */ new B();
21490
+ ], Pn = /* @__PURE__ */ new B(), oa = /* @__PURE__ */ new ea(), ks = /* @__PURE__ */ new B(), Is = /* @__PURE__ */ new B(), Ds = /* @__PURE__ */ new B(), Li = /* @__PURE__ */ new B(), Ni = /* @__PURE__ */ new B(), ns = /* @__PURE__ */ new B(), xr = /* @__PURE__ */ new B(), ca = /* @__PURE__ */ new B(), la = /* @__PURE__ */ new B(), is = /* @__PURE__ */ new B();
21482
21491
  function tc(i, e, t, n, s) {
21483
21492
  for (let r = 0, a = i.length - 3; r <= a; r += 3) {
21484
21493
  is.fromArray(i, r);
@@ -21708,7 +21717,7 @@ class Bd {
21708
21717
  return this.radius = e.radius, this.center.fromArray(e.center), this;
21709
21718
  }
21710
21719
  }
21711
- const ci = /* @__PURE__ */ new B(), ic = /* @__PURE__ */ new B(), da = /* @__PURE__ */ new B(), Ui = /* @__PURE__ */ new B(), sc = /* @__PURE__ */ new B(), ua = /* @__PURE__ */ new B(), rc = /* @__PURE__ */ new B();
21720
+ const li = /* @__PURE__ */ new B(), ic = /* @__PURE__ */ new B(), da = /* @__PURE__ */ new B(), Ui = /* @__PURE__ */ new B(), sc = /* @__PURE__ */ new B(), ua = /* @__PURE__ */ new B(), rc = /* @__PURE__ */ new B();
21712
21721
  class ty {
21713
21722
  /**
21714
21723
  * Constructs a new ray.
@@ -21764,7 +21773,7 @@ class ty {
21764
21773
  * @return {Ray} A reference to this ray.
21765
21774
  */
21766
21775
  recast(e) {
21767
- return this.origin.copy(this.at(e, ci)), this;
21776
+ return this.origin.copy(this.at(e, li)), this;
21768
21777
  }
21769
21778
  /**
21770
21779
  * Returns the point along this ray that is closest to the given point.
@@ -21794,8 +21803,8 @@ class ty {
21794
21803
  * @return {number} The squared distance.
21795
21804
  */
21796
21805
  distanceSqToPoint(e) {
21797
- const t = ci.subVectors(e, this.origin).dot(this.direction);
21798
- return t < 0 ? this.origin.distanceToSquared(e) : (ci.copy(this.origin).addScaledVector(this.direction, t), ci.distanceToSquared(e));
21806
+ const t = li.subVectors(e, this.origin).dot(this.direction);
21807
+ return t < 0 ? this.origin.distanceToSquared(e) : (li.copy(this.origin).addScaledVector(this.direction, t), li.distanceToSquared(e));
21799
21808
  }
21800
21809
  /**
21801
21810
  * Returns the squared distance between this ray and the given line segment.
@@ -21835,8 +21844,8 @@ class ty {
21835
21844
  * @return {?Vector3} The intersection point.
21836
21845
  */
21837
21846
  intersectSphere(e, t) {
21838
- ci.subVectors(e.center, this.origin);
21839
- const n = ci.dot(this.direction), s = ci.dot(ci) - n * n, r = e.radius * e.radius;
21847
+ li.subVectors(e.center, this.origin);
21848
+ const n = li.dot(this.direction), s = li.dot(li) - n * n, r = e.radius * e.radius;
21840
21849
  if (s > r) return null;
21841
21850
  const a = Math.sqrt(r - s), o = n - a, c = n + a;
21842
21851
  return c < 0 ? null : o < 0 ? this.at(c, t) : this.at(o, t);
@@ -21906,7 +21915,7 @@ class ty {
21906
21915
  * @return {boolean} Whether this ray intersects with the given box or not.
21907
21916
  */
21908
21917
  intersectsBox(e) {
21909
- return this.intersectBox(e, ci) !== null;
21918
+ return this.intersectBox(e, li) !== null;
21910
21919
  }
21911
21920
  /**
21912
21921
  * Intersects this ray with the given triangle, returning the intersection
@@ -22585,9 +22594,9 @@ class Vt {
22585
22594
  return n.set(1, 1, 1), t.identity(), this;
22586
22595
  let r = Ls.set(s[0], s[1], s[2]).length();
22587
22596
  const a = Ls.set(s[4], s[5], s[6]).length(), o = Ls.set(s[8], s[9], s[10]).length();
22588
- this.determinant() < 0 && (r = -r), Pn.copy(this);
22597
+ this.determinant() < 0 && (r = -r), kn.copy(this);
22589
22598
  const l = 1 / r, d = 1 / a, u = 1 / o;
22590
- return Pn.elements[0] *= l, Pn.elements[1] *= l, Pn.elements[2] *= l, Pn.elements[4] *= d, Pn.elements[5] *= d, Pn.elements[6] *= d, Pn.elements[8] *= u, Pn.elements[9] *= u, Pn.elements[10] *= u, t.setFromRotationMatrix(Pn), n.x = r, n.y = a, n.z = o, this;
22599
+ return kn.elements[0] *= l, kn.elements[1] *= l, kn.elements[2] *= l, kn.elements[4] *= d, kn.elements[5] *= d, kn.elements[6] *= d, kn.elements[8] *= u, kn.elements[9] *= u, kn.elements[10] *= u, t.setFromRotationMatrix(kn), n.x = r, n.y = a, n.z = o, this;
22591
22600
  }
22592
22601
  /**
22593
22602
  * Creates a perspective projection matrix. This is used internally by
@@ -22603,12 +22612,12 @@ class Vt {
22603
22612
  * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
22604
22613
  * @return {Matrix4} A reference to this matrix.
22605
22614
  */
22606
- makePerspective(e, t, n, s, r, a, o = Jn, c = !1) {
22615
+ makePerspective(e, t, n, s, r, a, o = Zn, c = !1) {
22607
22616
  const l = this.elements, d = 2 * r / (t - e), u = 2 * r / (n - s), h = (t + e) / (t - e), f = (n + s) / (n - s);
22608
22617
  let g, v;
22609
22618
  if (c)
22610
22619
  g = r / (a - r), v = a * r / (a - r);
22611
- else if (o === Jn)
22620
+ else if (o === Zn)
22612
22621
  g = -(a + r) / (a - r), v = -2 * a * r / (a - r);
22613
22622
  else if (o === ro)
22614
22623
  g = -a / (a - r), v = -a * r / (a - r);
@@ -22630,12 +22639,12 @@ class Vt {
22630
22639
  * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
22631
22640
  * @return {Matrix4} A reference to this matrix.
22632
22641
  */
22633
- makeOrthographic(e, t, n, s, r, a, o = Jn, c = !1) {
22642
+ makeOrthographic(e, t, n, s, r, a, o = Zn, c = !1) {
22634
22643
  const l = this.elements, d = 2 / (t - e), u = 2 / (n - s), h = -(t + e) / (t - e), f = -(n + s) / (n - s);
22635
22644
  let g, v;
22636
22645
  if (c)
22637
22646
  g = 1 / (a - r), v = a / (a - r);
22638
- else if (o === Jn)
22647
+ else if (o === Zn)
22639
22648
  g = -2 / (a - r), v = -(a + r) / (a - r);
22640
22649
  else if (o === ro)
22641
22650
  g = -1 / (a - r), v = -r / (a - r);
@@ -22680,8 +22689,8 @@ class Vt {
22680
22689
  return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e;
22681
22690
  }
22682
22691
  }
22683
- const Ls = /* @__PURE__ */ new B(), Pn = /* @__PURE__ */ new Vt(), ny = /* @__PURE__ */ new B(0, 0, 0), iy = /* @__PURE__ */ new B(1, 1, 1), Oi = /* @__PURE__ */ new B(), ha = /* @__PURE__ */ new B(), gn = /* @__PURE__ */ new B(), Th = /* @__PURE__ */ new Vt(), Ch = /* @__PURE__ */ new Qr();
22684
- class Ai {
22692
+ const Ls = /* @__PURE__ */ new B(), kn = /* @__PURE__ */ new Vt(), ny = /* @__PURE__ */ new B(0, 0, 0), iy = /* @__PURE__ */ new B(1, 1, 1), Oi = /* @__PURE__ */ new B(), ha = /* @__PURE__ */ new B(), gn = /* @__PURE__ */ new B(), Th = /* @__PURE__ */ new Vt(), Ch = /* @__PURE__ */ new Qr();
22693
+ class Ri {
22685
22694
  /**
22686
22695
  * Constructs a new euler instance.
22687
22696
  *
@@ -22690,7 +22699,7 @@ class Ai {
22690
22699
  * @param {number} [z=0] - The angle of the z axis in radians.
22691
22700
  * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.
22692
22701
  */
22693
- constructor(e = 0, t = 0, n = 0, s = Ai.DEFAULT_ORDER) {
22702
+ constructor(e = 0, t = 0, n = 0, s = Ri.DEFAULT_ORDER) {
22694
22703
  this.isEuler = !0, this._x = e, this._y = t, this._z = n, this._order = s;
22695
22704
  }
22696
22705
  /**
@@ -22878,7 +22887,7 @@ class Ai {
22878
22887
  yield this._x, yield this._y, yield this._z, yield this._order;
22879
22888
  }
22880
22889
  }
22881
- Ai.DEFAULT_ORDER = "XYZ";
22890
+ Ri.DEFAULT_ORDER = "XYZ";
22882
22891
  class ym {
22883
22892
  /**
22884
22893
  * Constructs a new layers instance, with membership
@@ -22952,14 +22961,14 @@ class ym {
22952
22961
  }
22953
22962
  }
22954
22963
  let sy = 0;
22955
- const Eh = /* @__PURE__ */ new B(), Ns = /* @__PURE__ */ new Qr(), li = /* @__PURE__ */ new Vt(), fa = /* @__PURE__ */ new B(), Cr = /* @__PURE__ */ new B(), ry = /* @__PURE__ */ new B(), ay = /* @__PURE__ */ new Qr(), Mh = /* @__PURE__ */ new B(1, 0, 0), wh = /* @__PURE__ */ new B(0, 1, 0), Ah = /* @__PURE__ */ new B(0, 0, 1), Rh = { type: "added" }, oy = { type: "removed" }, Us = { type: "childadded", child: null }, ac = { type: "childremoved", child: null };
22964
+ const Eh = /* @__PURE__ */ new B(), Ns = /* @__PURE__ */ new Qr(), di = /* @__PURE__ */ new Vt(), fa = /* @__PURE__ */ new B(), Cr = /* @__PURE__ */ new B(), ry = /* @__PURE__ */ new B(), ay = /* @__PURE__ */ new Qr(), Mh = /* @__PURE__ */ new B(1, 0, 0), wh = /* @__PURE__ */ new B(0, 1, 0), Ah = /* @__PURE__ */ new B(0, 0, 1), Rh = { type: "added" }, oy = { type: "removed" }, Us = { type: "childadded", child: null }, ac = { type: "childremoved", child: null };
22956
22965
  class Sn extends ur {
22957
22966
  /**
22958
22967
  * Constructs a new 3D object.
22959
22968
  */
22960
22969
  constructor() {
22961
22970
  super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: sy++ }), this.uuid = Zr(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = Sn.DEFAULT_UP.clone();
22962
- const e = new B(), t = new Ai(), n = new Qr(), s = new B(1, 1, 1);
22971
+ const e = new B(), t = new Ri(), n = new Qr(), s = new B(1, 1, 1);
22963
22972
  function r() {
22964
22973
  n.setFromEuler(t, !1);
22965
22974
  }
@@ -23236,7 +23245,7 @@ class Sn extends ur {
23236
23245
  * @return {Vector3} The converted vector.
23237
23246
  */
23238
23247
  worldToLocal(e) {
23239
- return this.updateWorldMatrix(!0, !1), e.applyMatrix4(li.copy(this.matrixWorld).invert());
23248
+ return this.updateWorldMatrix(!0, !1), e.applyMatrix4(di.copy(this.matrixWorld).invert());
23240
23249
  }
23241
23250
  /**
23242
23251
  * Rotates the object to face a point in world space.
@@ -23250,7 +23259,7 @@ class Sn extends ur {
23250
23259
  lookAt(e, t, n) {
23251
23260
  e.isVector3 ? fa.copy(e) : fa.set(e, t, n);
23252
23261
  const s = this.parent;
23253
- this.updateWorldMatrix(!0, !1), Cr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? li.lookAt(Cr, fa, this.up) : li.lookAt(fa, Cr, this.up), this.quaternion.setFromRotationMatrix(li), s && (li.extractRotation(s.matrixWorld), Ns.setFromRotationMatrix(li), this.quaternion.premultiply(Ns.invert()));
23262
+ this.updateWorldMatrix(!0, !1), Cr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? di.lookAt(Cr, fa, this.up) : di.lookAt(fa, Cr, this.up), this.quaternion.setFromRotationMatrix(di), s && (di.extractRotation(s.matrixWorld), Ns.setFromRotationMatrix(di), this.quaternion.premultiply(Ns.invert()));
23254
23263
  }
23255
23264
  /**
23256
23265
  * Adds the given 3D object as a child to this 3D object. An arbitrary number of
@@ -23319,7 +23328,7 @@ class Sn extends ur {
23319
23328
  * @return {Object3D} A reference to this instance.
23320
23329
  */
23321
23330
  attach(e) {
23322
- return this.updateWorldMatrix(!0, !1), li.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), li.multiply(e.parent.matrixWorld)), e.applyMatrix4(li), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Rh), Us.child = e, this.dispatchEvent(Us), Us.child = null, this;
23331
+ return this.updateWorldMatrix(!0, !1), di.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), di.multiply(e.parent.matrixWorld)), e.applyMatrix4(di), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Rh), Us.child = e, this.dispatchEvent(Us), Us.child = null, this;
23323
23332
  }
23324
23333
  /**
23325
23334
  * Searches through the 3D object and its children, starting with the 3D object
@@ -23610,8 +23619,8 @@ class Sn extends ur {
23610
23619
  Sn.DEFAULT_UP = /* @__PURE__ */ new B(0, 1, 0);
23611
23620
  Sn.DEFAULT_MATRIX_AUTO_UPDATE = !0;
23612
23621
  Sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
23613
- const kn = /* @__PURE__ */ new B(), di = /* @__PURE__ */ new B(), oc = /* @__PURE__ */ new B(), ui = /* @__PURE__ */ new B(), Os = /* @__PURE__ */ new B(), Fs = /* @__PURE__ */ new B(), Ph = /* @__PURE__ */ new B(), cc = /* @__PURE__ */ new B(), lc = /* @__PURE__ */ new B(), dc = /* @__PURE__ */ new B(), uc = /* @__PURE__ */ new Lt(), hc = /* @__PURE__ */ new Lt(), fc = /* @__PURE__ */ new Lt();
23614
- class On {
23622
+ const In = /* @__PURE__ */ new B(), ui = /* @__PURE__ */ new B(), oc = /* @__PURE__ */ new B(), hi = /* @__PURE__ */ new B(), Os = /* @__PURE__ */ new B(), Fs = /* @__PURE__ */ new B(), Ph = /* @__PURE__ */ new B(), cc = /* @__PURE__ */ new B(), lc = /* @__PURE__ */ new B(), dc = /* @__PURE__ */ new B(), uc = /* @__PURE__ */ new Lt(), hc = /* @__PURE__ */ new Lt(), fc = /* @__PURE__ */ new Lt();
23623
+ class Fn {
23615
23624
  /**
23616
23625
  * Constructs a new triangle.
23617
23626
  *
@@ -23632,7 +23641,7 @@ class On {
23632
23641
  * @return {Vector3} The triangle's normal.
23633
23642
  */
23634
23643
  static getNormal(e, t, n, s) {
23635
- s.subVectors(n, t), kn.subVectors(e, t), s.cross(kn);
23644
+ s.subVectors(n, t), In.subVectors(e, t), s.cross(In);
23636
23645
  const r = s.lengthSq();
23637
23646
  return r > 0 ? s.multiplyScalar(1 / Math.sqrt(r)) : s.set(0, 0, 0);
23638
23647
  }
@@ -23648,8 +23657,8 @@ class On {
23648
23657
  * @return {?Vector3} The barycentric coordinates for the given point
23649
23658
  */
23650
23659
  static getBarycoord(e, t, n, s, r) {
23651
- kn.subVectors(s, t), di.subVectors(n, t), oc.subVectors(e, t);
23652
- const a = kn.dot(kn), o = kn.dot(di), c = kn.dot(oc), l = di.dot(di), d = di.dot(oc), u = a * l - o * o;
23660
+ In.subVectors(s, t), ui.subVectors(n, t), oc.subVectors(e, t);
23661
+ const a = In.dot(In), o = In.dot(ui), c = In.dot(oc), l = ui.dot(ui), d = ui.dot(oc), u = a * l - o * o;
23653
23662
  if (u === 0)
23654
23663
  return r.set(0, 0, 0), null;
23655
23664
  const h = 1 / u, f = (l * c - o * d) * h, g = (a * d - o * c) * h;
@@ -23667,7 +23676,7 @@ class On {
23667
23676
  * triangle, lies within the triangle or not.
23668
23677
  */
23669
23678
  static containsPoint(e, t, n, s) {
23670
- return this.getBarycoord(e, t, n, s, ui) === null ? !1 : ui.x >= 0 && ui.y >= 0 && ui.x + ui.y <= 1;
23679
+ return this.getBarycoord(e, t, n, s, hi) === null ? !1 : hi.x >= 0 && hi.y >= 0 && hi.x + hi.y <= 1;
23671
23680
  }
23672
23681
  /**
23673
23682
  * Computes the value barycentrically interpolated for the given point on the
@@ -23684,7 +23693,7 @@ class On {
23684
23693
  * @return {?Vector3} The interpolated value.
23685
23694
  */
23686
23695
  static getInterpolation(e, t, n, s, r, a, o, c) {
23687
- return this.getBarycoord(e, t, n, s, ui) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, ui.x), c.addScaledVector(a, ui.y), c.addScaledVector(o, ui.z), c);
23696
+ return this.getBarycoord(e, t, n, s, hi) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, hi.x), c.addScaledVector(a, hi.y), c.addScaledVector(o, hi.z), c);
23688
23697
  }
23689
23698
  /**
23690
23699
  * Computes the value barycentrically interpolated for the given attribute and indices.
@@ -23710,7 +23719,7 @@ class On {
23710
23719
  * @return {boolean} Whether the triangle is oriented towards the given direction or not.
23711
23720
  */
23712
23721
  static isFrontFacing(e, t, n, s) {
23713
- return kn.subVectors(n, t), di.subVectors(e, t), kn.cross(di).dot(s) < 0;
23722
+ return In.subVectors(n, t), ui.subVectors(e, t), In.cross(ui).dot(s) < 0;
23714
23723
  }
23715
23724
  /**
23716
23725
  * Sets the triangle's vertices by copying the given values.
@@ -23770,7 +23779,7 @@ class On {
23770
23779
  * @return {number} The triangle's area.
23771
23780
  */
23772
23781
  getArea() {
23773
- return kn.subVectors(this.c, this.b), di.subVectors(this.a, this.b), kn.cross(di).length() * 0.5;
23782
+ return In.subVectors(this.c, this.b), ui.subVectors(this.a, this.b), In.cross(ui).length() * 0.5;
23774
23783
  }
23775
23784
  /**
23776
23785
  * Computes the midpoint of the triangle.
@@ -23788,7 +23797,7 @@ class On {
23788
23797
  * @return {Vector3} The triangle's normal.
23789
23798
  */
23790
23799
  getNormal(e) {
23791
- return On.getNormal(this.a, this.b, this.c, e);
23800
+ return Fn.getNormal(this.a, this.b, this.c, e);
23792
23801
  }
23793
23802
  /**
23794
23803
  * Computes a plane the triangle lies within.
@@ -23808,7 +23817,7 @@ class On {
23808
23817
  * @return {?Vector3} The barycentric coordinates for the given point
23809
23818
  */
23810
23819
  getBarycoord(e, t) {
23811
- return On.getBarycoord(e, this.a, this.b, this.c, t);
23820
+ return Fn.getBarycoord(e, this.a, this.b, this.c, t);
23812
23821
  }
23813
23822
  /**
23814
23823
  * Computes the value barycentrically interpolated for the given point on the
@@ -23822,7 +23831,7 @@ class On {
23822
23831
  * @return {?Vector3} The interpolated value.
23823
23832
  */
23824
23833
  getInterpolation(e, t, n, s, r) {
23825
- return On.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);
23834
+ return Fn.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);
23826
23835
  }
23827
23836
  /**
23828
23837
  * Returns `true` if the given point, when projected onto the plane of the
@@ -23833,7 +23842,7 @@ class On {
23833
23842
  * triangle, lies within the triangle or not.
23834
23843
  */
23835
23844
  containsPoint(e) {
23836
- return On.containsPoint(e, this.a, this.b, this.c);
23845
+ return Fn.containsPoint(e, this.a, this.b, this.c);
23837
23846
  }
23838
23847
  /**
23839
23848
  * Returns `true` if the triangle is oriented towards the given direction.
@@ -23842,7 +23851,7 @@ class On {
23842
23851
  * @return {boolean} Whether the triangle is oriented towards the given direction or not.
23843
23852
  */
23844
23853
  isFrontFacing(e) {
23845
- return On.isFrontFacing(this.a, this.b, this.c, e);
23854
+ return Fn.isFrontFacing(this.a, this.b, this.c, e);
23846
23855
  }
23847
23856
  /**
23848
23857
  * Returns `true` if this triangle intersects with the given box.
@@ -24238,7 +24247,7 @@ class Je {
24238
24247
  * @return {Color} A reference to this color.
24239
24248
  */
24240
24249
  copySRGBToLinear(e) {
24241
- return this.r = Ti(e.r), this.g = Ti(e.g), this.b = Ti(e.b), this;
24250
+ return this.r = Ci(e.r), this.g = Ci(e.g), this.b = Ci(e.b), this;
24242
24251
  }
24243
24252
  /**
24244
24253
  * Copies the given color into this color, and then converts this color from
@@ -24526,7 +24535,7 @@ class vo extends ur {
24526
24535
  * Constructs a new material.
24527
24536
  */
24528
24537
  constructor() {
24529
- super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: cy++ }), this.uuid = Zr(), this.name = "", this.type = "Material", this.blending = Qs, this.side = Ei, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = al, this.blendDst = ol, this.blendEquation = us, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Je(0, 0, 0), this.blendAlpha = 0, this.depthFunc = ar, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = mh, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Rs, this.stencilZFail = Rs, this.stencilZPass = Rs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
24538
+ super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: cy++ }), this.uuid = Zr(), this.name = "", this.type = "Material", this.blending = Qs, this.side = Mi, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = al, this.blendDst = ol, this.blendEquation = us, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Je(0, 0, 0), this.blendAlpha = 0, this.depthFunc = ar, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = mh, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Rs, this.stencilZFail = Rs, this.stencilZPass = Rs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
24530
24539
  }
24531
24540
  /**
24532
24541
  * Sets the alpha value to be used when running an alpha test. The material
@@ -24625,7 +24634,7 @@ class vo extends ur {
24625
24634
  generator: "Material.toJSON"
24626
24635
  }
24627
24636
  };
24628
- n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== Qs && (n.blending = this.blending), this.side !== Ei && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== al && (n.blendSrc = this.blendSrc), this.blendDst !== ol && (n.blendDst = this.blendDst), this.blendEquation !== us && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== ar && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== mh && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Rs && (n.stencilFail = this.stencilFail), this.stencilZFail !== Rs && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Rs && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.allowOverride === !1 && (n.allowOverride = !1), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData);
24637
+ n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== Qs && (n.blending = this.blending), this.side !== Mi && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== al && (n.blendSrc = this.blendSrc), this.blendDst !== ol && (n.blendDst = this.blendDst), this.blendEquation !== us && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== ar && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== mh && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Rs && (n.stencilFail = this.stencilFail), this.stencilZFail !== Rs && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Rs && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.allowOverride === !1 && (n.allowOverride = !1), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData);
24629
24638
  function s(r) {
24630
24639
  const a = [];
24631
24640
  for (const o in r) {
@@ -24698,7 +24707,7 @@ class xm extends vo {
24698
24707
  * by {@link Color#set}.
24699
24708
  */
24700
24709
  constructor(e) {
24701
- super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Je(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new Ai(), this.combine = nm, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e);
24710
+ super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Je(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new Ri(), this.combine = nm, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e);
24702
24711
  }
24703
24712
  copy(e) {
24704
24713
  return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.fog = e.fog, this;
@@ -24706,7 +24715,7 @@ class xm extends vo {
24706
24715
  }
24707
24716
  const Ot = /* @__PURE__ */ new B(), ma = /* @__PURE__ */ new st();
24708
24717
  let ly = 0;
24709
- class ti {
24718
+ class ni {
24710
24719
  /**
24711
24720
  * Constructs a new buffer attribute.
24712
24721
  *
@@ -24717,7 +24726,7 @@ class ti {
24717
24726
  constructor(e, t, n = !1) {
24718
24727
  if (Array.isArray(e))
24719
24728
  throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
24720
- this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: ly++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = gh, this.updateRanges = [], this.gpuType = Yn, this.version = 0;
24729
+ this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: ly++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = gh, this.updateRanges = [], this.gpuType = Jn, this.version = 0;
24721
24730
  }
24722
24731
  /**
24723
24732
  * A callback function that is executed after the renderer has transferred the attribute
@@ -25028,7 +25037,7 @@ class ti {
25028
25037
  return this.name !== "" && (e.name = this.name), this.usage !== gh && (e.usage = this.usage), e;
25029
25038
  }
25030
25039
  }
25031
- class Tm extends ti {
25040
+ class Tm extends ni {
25032
25041
  /**
25033
25042
  * Constructs a new buffer attribute.
25034
25043
  *
@@ -25040,7 +25049,7 @@ class Tm extends ti {
25040
25049
  super(new Uint16Array(e), t, n);
25041
25050
  }
25042
25051
  }
25043
- class Cm extends ti {
25052
+ class Cm extends ni {
25044
25053
  /**
25045
25054
  * Constructs a new buffer attribute.
25046
25055
  *
@@ -25052,7 +25061,7 @@ class Cm extends ti {
25052
25061
  super(new Uint32Array(e), t, n);
25053
25062
  }
25054
25063
  }
25055
- class rn extends ti {
25064
+ class rn extends ni {
25056
25065
  /**
25057
25066
  * Constructs a new buffer attribute.
25058
25067
  *
@@ -25066,7 +25075,7 @@ class rn extends ti {
25066
25075
  }
25067
25076
  let dy = 0;
25068
25077
  const Tn = /* @__PURE__ */ new Vt(), mc = /* @__PURE__ */ new Sn(), Bs = /* @__PURE__ */ new B(), vn = /* @__PURE__ */ new ea(), Er = /* @__PURE__ */ new ea(), qt = /* @__PURE__ */ new B();
25069
- class Gn extends ur {
25078
+ class Hn extends ur {
25070
25079
  /**
25071
25080
  * Constructs a new geometry.
25072
25081
  */
@@ -25382,7 +25391,7 @@ class Gn extends ur {
25382
25391
  return;
25383
25392
  }
25384
25393
  const n = t.position, s = t.normal, r = t.uv;
25385
- this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new ti(new Float32Array(4 * n.count), 4));
25394
+ this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new ni(new Float32Array(4 * n.count), 4));
25386
25395
  const a = this.getAttribute("tangent"), o = [], c = [];
25387
25396
  for (let k = 0; k < n.count; k++)
25388
25397
  o[k] = new B(), c[k] = new B();
@@ -25431,7 +25440,7 @@ class Gn extends ur {
25431
25440
  if (t !== void 0) {
25432
25441
  let n = this.getAttribute("normal");
25433
25442
  if (n === void 0)
25434
- n = new ti(new Float32Array(t.count * 3), 3), this.setAttribute("normal", n);
25443
+ n = new ni(new Float32Array(t.count * 3), 3), this.setAttribute("normal", n);
25435
25444
  else
25436
25445
  for (let h = 0, f = n.count; h < f; h++)
25437
25446
  n.setXYZ(h, 0, 0, 0);
@@ -25471,11 +25480,11 @@ class Gn extends ur {
25471
25480
  for (let p = 0; p < d; p++)
25472
25481
  h[g++] = l[f++];
25473
25482
  }
25474
- return new ti(h, d, u);
25483
+ return new ni(h, d, u);
25475
25484
  }
25476
25485
  if (this.index === null)
25477
25486
  return Oe("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
25478
- const t = new Gn(), n = this.index.array, s = this.attributes;
25487
+ const t = new Hn(), n = this.index.array, s = this.attributes;
25479
25488
  for (const o in s) {
25480
25489
  const c = s[o], l = e(c, n);
25481
25490
  t.setAttribute(o, l);
@@ -25597,14 +25606,14 @@ class Gn extends ur {
25597
25606
  }
25598
25607
  }
25599
25608
  const kh = /* @__PURE__ */ new Vt(), ss = /* @__PURE__ */ new ty(), ga = /* @__PURE__ */ new Bd(), Ih = /* @__PURE__ */ new B(), va = /* @__PURE__ */ new B(), ba = /* @__PURE__ */ new B(), _a = /* @__PURE__ */ new B(), gc = /* @__PURE__ */ new B(), ya = /* @__PURE__ */ new B(), Dh = /* @__PURE__ */ new B(), Sa = /* @__PURE__ */ new B();
25600
- class zn extends Sn {
25609
+ class Gn extends Sn {
25601
25610
  /**
25602
25611
  * Constructs a new mesh.
25603
25612
  *
25604
25613
  * @param {BufferGeometry} [geometry] - The mesh geometry.
25605
25614
  * @param {Material|Array<Material>} [material] - The mesh material.
25606
25615
  */
25607
- constructor(e = new Gn(), t = new xm()) {
25616
+ constructor(e = new Hn(), t = new xm()) {
25608
25617
  super(), this.isMesh = !0, this.type = "Mesh", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();
25609
25618
  }
25610
25619
  copy(e, t) {
@@ -25698,7 +25707,7 @@ class zn extends Sn {
25698
25707
  }
25699
25708
  function uy(i, e, t, n, s, r, a, o) {
25700
25709
  let c;
25701
- if (e.side === nn ? c = n.intersectTriangle(a, r, s, !0, o) : c = n.intersectTriangle(s, r, a, e.side === Ei, o), c === null) return null;
25710
+ if (e.side === nn ? c = n.intersectTriangle(a, r, s, !0, o) : c = n.intersectTriangle(s, r, a, e.side === Mi, o), c === null) return null;
25702
25711
  Sa.copy(o), Sa.applyMatrix4(i.matrixWorld);
25703
25712
  const l = t.ray.origin.distanceTo(Sa);
25704
25713
  return l < t.near || l > t.far ? null : {
@@ -25712,7 +25721,7 @@ function xa(i, e, t, n, s, r, a, o, c, l) {
25712
25721
  const d = uy(i, e, t, n, va, ba, _a, Dh);
25713
25722
  if (d) {
25714
25723
  const u = new B();
25715
- On.getBarycoord(Dh, va, ba, _a, u), s && (d.uv = On.getInterpolatedAttribute(s, o, c, l, u, new st())), r && (d.uv1 = On.getInterpolatedAttribute(r, o, c, l, u, new st())), a && (d.normal = On.getInterpolatedAttribute(a, o, c, l, u, new B()), d.normal.dot(n.direction) > 0 && d.normal.multiplyScalar(-1));
25724
+ Fn.getBarycoord(Dh, va, ba, _a, u), s && (d.uv = Fn.getInterpolatedAttribute(s, o, c, l, u, new st())), r && (d.uv1 = Fn.getInterpolatedAttribute(r, o, c, l, u, new st())), a && (d.normal = Fn.getInterpolatedAttribute(a, o, c, l, u, new B()), d.normal.dot(n.direction) > 0 && d.normal.multiplyScalar(-1));
25716
25725
  const h = {
25717
25726
  a: o,
25718
25727
  b: c,
@@ -25720,11 +25729,11 @@ function xa(i, e, t, n, s, r, a, o, c, l) {
25720
25729
  normal: new B(),
25721
25730
  materialIndex: 0
25722
25731
  };
25723
- On.getNormal(va, ba, _a, h.normal), d.face = h, d.barycoord = u;
25732
+ Fn.getNormal(va, ba, _a, h.normal), d.face = h, d.barycoord = u;
25724
25733
  }
25725
25734
  return d;
25726
25735
  }
25727
- class ta extends Gn {
25736
+ class ta extends Hn {
25728
25737
  /**
25729
25738
  * Constructs a new box geometry.
25730
25739
  *
@@ -25885,7 +25894,7 @@ class Mm extends Sn {
25885
25894
  * Constructs a new camera.
25886
25895
  */
25887
25896
  constructor() {
25888
- super(), this.isCamera = !0, this.type = "Camera", this.matrixWorldInverse = new Vt(), this.projectionMatrix = new Vt(), this.projectionMatrixInverse = new Vt(), this.coordinateSystem = Jn, this._reversedDepth = !1;
25897
+ super(), this.isCamera = !0, this.type = "Camera", this.matrixWorldInverse = new Vt(), this.projectionMatrix = new Vt(), this.projectionMatrixInverse = new Vt(), this.coordinateSystem = Zn, this._reversedDepth = !1;
25889
25898
  }
25890
25899
  /**
25891
25900
  * The flag that indicates whether the camera uses a reversed depth buffer.
@@ -26118,7 +26127,7 @@ class gy extends Sn {
26118
26127
  updateCoordinateSystem() {
26119
26128
  const e = this.coordinateSystem, t = this.children.concat(), [n, s, r, a, o, c] = t;
26120
26129
  for (const l of t) this.remove(l);
26121
- if (e === Jn)
26130
+ if (e === Zn)
26122
26131
  n.up.set(0, 1, 0), n.lookAt(1, 0, 0), s.up.set(0, 1, 0), s.lookAt(-1, 0, 0), r.up.set(0, 0, -1), r.lookAt(0, 1, 0), a.up.set(0, 0, 1), a.lookAt(0, -1, 0), o.up.set(0, 1, 0), o.lookAt(0, 0, 1), c.up.set(0, 1, 0), c.lookAt(0, 0, -1);
26123
26132
  else if (e === ro)
26124
26133
  n.up.set(0, -1, 0), n.lookAt(-1, 0, 0), s.up.set(0, -1, 0), s.lookAt(1, 0, 0), r.up.set(0, 0, 1), r.lookAt(0, 1, 0), a.up.set(0, 0, -1), a.lookAt(0, -1, 0), o.up.set(0, -1, 0), o.lookAt(0, 0, 1), c.up.set(0, -1, 0), c.lookAt(0, 0, -1);
@@ -26174,7 +26183,7 @@ class wm extends sn {
26174
26183
  this.image = e;
26175
26184
  }
26176
26185
  }
26177
- class Am extends ei {
26186
+ class Am extends ti {
26178
26187
  /**
26179
26188
  * Constructs a new cube render target.
26180
26189
  *
@@ -26248,10 +26257,10 @@ class Am extends ei {
26248
26257
  vertexShader: n.vertexShader,
26249
26258
  fragmentShader: n.fragmentShader,
26250
26259
  side: nn,
26251
- blending: xi
26260
+ blending: Ti
26252
26261
  });
26253
26262
  r.uniforms.tEquirect.value = t;
26254
- const a = new zn(s, r), o = t.minFilter;
26263
+ const a = new Gn(s, r), o = t.minFilter;
26255
26264
  return t.minFilter === ps && (t.minFilter = Qt), new gy(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;
26256
26265
  }
26257
26266
  /**
@@ -26397,7 +26406,7 @@ class by extends Sn {
26397
26406
  * Constructs a new scene.
26398
26407
  */
26399
26408
  constructor() {
26400
- super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Ai(), this.environmentIntensity = 1, this.environmentRotation = new Ai(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
26409
+ super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Ri(), this.environmentIntensity = 1, this.environmentRotation = new Ri(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
26401
26410
  }
26402
26411
  copy(e, t) {
26403
26412
  return super.copy(e, t), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), this.backgroundBlurriness = e.backgroundBlurriness, this.backgroundIntensity = e.backgroundIntensity, this.backgroundRotation.copy(e.backgroundRotation), this.environmentIntensity = e.environmentIntensity, this.environmentRotation.copy(e.environmentRotation), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.matrixAutoUpdate = e.matrixAutoUpdate, this;
@@ -26689,11 +26698,11 @@ class Rm {
26689
26698
  * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
26690
26699
  * @return {Frustum} A reference to this frustum.
26691
26700
  */
26692
- setFromProjectionMatrix(e, t = Jn, n = !1) {
26701
+ setFromProjectionMatrix(e, t = Zn, n = !1) {
26693
26702
  const s = this.planes, r = e.elements, a = r[0], o = r[1], c = r[2], l = r[3], d = r[4], u = r[5], h = r[6], f = r[7], g = r[8], v = r[9], m = r[10], p = r[11], x = r[12], C = r[13], b = r[14], S = r[15];
26694
26703
  if (s[0].setComponents(l - a, f - d, p - g, S - x).normalize(), s[1].setComponents(l + a, f + d, p + g, S + x).normalize(), s[2].setComponents(l + o, f + u, p + v, S + C).normalize(), s[3].setComponents(l - o, f - u, p - v, S - C).normalize(), n)
26695
26704
  s[4].setComponents(c, h, m, b).normalize(), s[5].setComponents(l - c, f - h, p - m, S - b).normalize();
26696
- else if (s[4].setComponents(l - c, f - h, p - m, S - b).normalize(), t === Jn)
26705
+ else if (s[4].setComponents(l - c, f - h, p - m, S - b).normalize(), t === Zn)
26697
26706
  s[5].setComponents(l + c, f + h, p + m, S + b).normalize();
26698
26707
  else if (t === ro)
26699
26708
  s[5].setComponents(c, h, m, b).normalize();
@@ -26795,8 +26804,8 @@ class Kr extends sn {
26795
26804
  * @param {number} [format=DepthFormat] - The texture format.
26796
26805
  * @param {number} [depth=1] - The depth of the texture.
26797
26806
  */
26798
- constructor(e, t, n = si, s, r, a, o = Yt, c = Yt, l, d = wi, u = 1) {
26799
- if (d !== wi && d !== ms)
26807
+ constructor(e, t, n = ri, s, r, a, o = Yt, c = Yt, l, d = Ai, u = 1) {
26808
+ if (d !== Ai && d !== ms)
26800
26809
  throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
26801
26810
  const h = { width: e, height: t, depth: u };
26802
26811
  super(h, s, r, a, o, c, d, n, l), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;
@@ -26823,7 +26832,7 @@ class Ty extends Kr {
26823
26832
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
26824
26833
  * @param {number} [format=DepthFormat] - The texture format.
26825
26834
  */
26826
- constructor(e, t = si, n = Ts, s, r, a = Yt, o = Yt, c, l = wi) {
26835
+ constructor(e, t = ri, n = Ts, s, r, a = Yt, o = Yt, c, l = Ai) {
26827
26836
  const d = { width: e, height: e, depth: 1 }, u = [d, d, d, d, d, d];
26828
26837
  super(e, e, t, n, s, r, a, o, c, l), this.image = u, this.isCubeDepthTexture = !0, this.isCubeTexture = !0;
26829
26838
  }
@@ -26852,7 +26861,7 @@ class Pm extends sn {
26852
26861
  return super.copy(e), this.sourceTexture = e.sourceTexture, this;
26853
26862
  }
26854
26863
  }
26855
- class Vd extends Gn {
26864
+ class Vd extends Hn {
26856
26865
  /**
26857
26866
  * Constructs a new polyhedron geometry.
26858
26867
  *
@@ -27071,7 +27080,7 @@ class zd extends Vd {
27071
27080
  return new zd(e.radius, e.detail);
27072
27081
  }
27073
27082
  }
27074
- class bo extends Gn {
27083
+ class bo extends Hn {
27075
27084
  /**
27076
27085
  * Constructs a new plane geometry.
27077
27086
  *
@@ -27116,7 +27125,7 @@ class bo extends Gn {
27116
27125
  return new bo(e.width, e.height, e.widthSegments, e.heightSegments);
27117
27126
  }
27118
27127
  }
27119
- class Gd extends Gn {
27128
+ class Gd extends Hn {
27120
27129
  /**
27121
27130
  * Constructs a new sphere geometry.
27122
27131
  *
@@ -27357,7 +27366,7 @@ function Uh(i, e, t, n) {
27357
27366
  return i * e * 2 / s.components * s.byteLength;
27358
27367
  case gm:
27359
27368
  return i * e * 3 / s.components * s.byteLength;
27360
- case Bn:
27369
+ case Vn:
27361
27370
  return i * e * 4 / s.components * s.byteLength;
27362
27371
  case Nd:
27363
27372
  return i * e * 4 / s.components * s.byteLength;
@@ -27438,14 +27447,14 @@ function Ry(i) {
27438
27447
  return { byteLength: 1, components: 1 };
27439
27448
  case jr:
27440
27449
  case hm:
27441
- case Mi:
27450
+ case wi:
27442
27451
  return { byteLength: 2, components: 1 };
27443
27452
  case kd:
27444
27453
  case Id:
27445
27454
  return { byteLength: 2, components: 4 };
27446
- case si:
27455
+ case ri:
27447
27456
  case Pd:
27448
- case Yn:
27457
+ case Jn:
27449
27458
  return { byteLength: 4, components: 1 };
27450
27459
  case fm:
27451
27460
  case pm:
@@ -31450,7 +31459,7 @@ void main() {
31450
31459
  alphaMapTransform: { value: /* @__PURE__ */ new ze() },
31451
31460
  alphaTest: { value: 0 }
31452
31461
  }
31453
- }, Xn = {
31462
+ }, $n = {
31454
31463
  basic: {
31455
31464
  uniforms: /* @__PURE__ */ tn([
31456
31465
  me.common,
@@ -31674,9 +31683,9 @@ void main() {
31674
31683
  fragmentShader: Ge.shadow_frag
31675
31684
  }
31676
31685
  };
31677
- Xn.physical = {
31686
+ $n.physical = {
31678
31687
  uniforms: /* @__PURE__ */ tn([
31679
- Xn.standard.uniforms,
31688
+ $n.standard.uniforms,
31680
31689
  {
31681
31690
  clearcoat: { value: 0 },
31682
31691
  clearcoatMap: { value: null },
@@ -31727,7 +31736,7 @@ Xn.physical = {
31727
31736
  vertexShader: Ge.meshphysical_vert,
31728
31737
  fragmentShader: Ge.meshphysical_frag
31729
31738
  };
31730
- const Ea = { r: 0, b: 0, g: 0 }, as = /* @__PURE__ */ new Ai(), dT = /* @__PURE__ */ new Vt();
31739
+ const Ea = { r: 0, b: 0, g: 0 }, as = /* @__PURE__ */ new Ri(), dT = /* @__PURE__ */ new Vt();
31731
31740
  function uT(i, e, t, n, s, r, a) {
31732
31741
  const o = new Je(0);
31733
31742
  let c = r === !0 ? 0 : 1, l, d, u = null, h = 0, f = null;
@@ -31744,13 +31753,13 @@ function uT(i, e, t, n, s, r, a) {
31744
31753
  }
31745
31754
  function m(C, b) {
31746
31755
  const S = g(b);
31747
- S && (S.isCubeTexture || S.mapping === go) ? (d === void 0 && (d = new zn(
31756
+ S && (S.isCubeTexture || S.mapping === go) ? (d === void 0 && (d = new Gn(
31748
31757
  new ta(1, 1, 1),
31749
31758
  new wn({
31750
31759
  name: "BackgroundCubeMaterial",
31751
- uniforms: dr(Xn.backgroundCube.uniforms),
31752
- vertexShader: Xn.backgroundCube.vertexShader,
31753
- fragmentShader: Xn.backgroundCube.fragmentShader,
31760
+ uniforms: dr($n.backgroundCube.uniforms),
31761
+ vertexShader: $n.backgroundCube.vertexShader,
31762
+ fragmentShader: $n.backgroundCube.fragmentShader,
31754
31763
  side: nn,
31755
31764
  depthTest: !1,
31756
31765
  depthWrite: !1,
@@ -31763,14 +31772,14 @@ function uT(i, e, t, n, s, r, a) {
31763
31772
  get: function() {
31764
31773
  return this.uniforms.envMap.value;
31765
31774
  }
31766
- }), s.update(d)), as.copy(b.backgroundRotation), as.x *= -1, as.y *= -1, as.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (as.y *= -1, as.z *= -1), d.material.uniforms.envMap.value = S, d.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, d.material.uniforms.backgroundBlurriness.value = b.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(dT.makeRotationFromEuler(as)), d.material.toneMapped = Qe.getTransfer(S.colorSpace) !== lt, (u !== S || h !== S.version || f !== i.toneMapping) && (d.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), d.layers.enableAll(), C.unshift(d, d.geometry, d.material, 0, 0, null)) : S && S.isTexture && (l === void 0 && (l = new zn(
31775
+ }), s.update(d)), as.copy(b.backgroundRotation), as.x *= -1, as.y *= -1, as.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (as.y *= -1, as.z *= -1), d.material.uniforms.envMap.value = S, d.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, d.material.uniforms.backgroundBlurriness.value = b.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(dT.makeRotationFromEuler(as)), d.material.toneMapped = Qe.getTransfer(S.colorSpace) !== ht, (u !== S || h !== S.version || f !== i.toneMapping) && (d.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), d.layers.enableAll(), C.unshift(d, d.geometry, d.material, 0, 0, null)) : S && S.isTexture && (l === void 0 && (l = new Gn(
31767
31776
  new bo(2, 2),
31768
31777
  new wn({
31769
31778
  name: "BackgroundMaterial",
31770
- uniforms: dr(Xn.background.uniforms),
31771
- vertexShader: Xn.background.vertexShader,
31772
- fragmentShader: Xn.background.fragmentShader,
31773
- side: Ei,
31779
+ uniforms: dr($n.background.uniforms),
31780
+ vertexShader: $n.background.vertexShader,
31781
+ fragmentShader: $n.background.fragmentShader,
31782
+ side: Mi,
31774
31783
  depthTest: !1,
31775
31784
  depthWrite: !1,
31776
31785
  fog: !1,
@@ -31780,7 +31789,7 @@ function uT(i, e, t, n, s, r, a) {
31780
31789
  get: function() {
31781
31790
  return this.uniforms.t2D.value;
31782
31791
  }
31783
- }), s.update(l)), l.material.uniforms.t2D.value = S, l.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, l.material.toneMapped = Qe.getTransfer(S.colorSpace) !== lt, S.matrixAutoUpdate === !0 && S.updateMatrix(), l.material.uniforms.uvTransform.value.copy(S.matrix), (u !== S || h !== S.version || f !== i.toneMapping) && (l.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), l.layers.enableAll(), C.unshift(l, l.geometry, l.material, 0, 0, null));
31792
+ }), s.update(l)), l.material.uniforms.t2D.value = S, l.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, l.material.toneMapped = Qe.getTransfer(S.colorSpace) !== ht, S.matrixAutoUpdate === !0 && S.updateMatrix(), l.material.uniforms.uvTransform.value.copy(S.matrix), (u !== S || h !== S.version || f !== i.toneMapping) && (l.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), l.layers.enableAll(), C.unshift(l, l.geometry, l.material, 0, 0, null));
31784
31793
  }
31785
31794
  function p(C, b) {
31786
31795
  C.getRGB(Ea, Em(i)), n.buffers.color.setClear(Ea.r, Ea.g, Ea.b, b, a);
@@ -32066,12 +32075,12 @@ function pT(i, e, t, n) {
32066
32075
  return s;
32067
32076
  }
32068
32077
  function a(A) {
32069
- return !(A !== Bn && n.convert(A) !== i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT));
32078
+ return !(A !== Vn && n.convert(A) !== i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT));
32070
32079
  }
32071
32080
  function o(A) {
32072
- const k = A === Mi && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
32081
+ const k = A === wi && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
32073
32082
  return !(A !== Mn && n.convert(A) !== i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)
32074
- A !== Yn && !k);
32083
+ A !== Jn && !k);
32075
32084
  }
32076
32085
  function c(A) {
32077
32086
  if (A === "highp") {
@@ -32294,8 +32303,8 @@ class Bh {
32294
32303
  magFilter: Qt,
32295
32304
  minFilter: Qt,
32296
32305
  generateMipmaps: !1,
32297
- type: Mi,
32298
- format: Bn,
32306
+ type: wi,
32307
+ format: Vn,
32299
32308
  colorSpace: lr,
32300
32309
  depthBuffer: !1
32301
32310
  }, s = Vh(e, t, n);
@@ -32307,12 +32316,12 @@ class Bh {
32307
32316
  return s;
32308
32317
  }
32309
32318
  _compileMaterial(e) {
32310
- const t = new zn(new Gn(), e);
32319
+ const t = new Gn(new Hn(), e);
32311
32320
  this._renderer.compile(t, Mr);
32312
32321
  }
32313
32322
  _sceneToCubeUV(e, t, n, s, r) {
32314
32323
  const c = new En(90, 1, t, n), l = [1, -1, 1, 1, 1, 1], d = [1, 1, 1, -1, -1, -1], u = this._renderer, h = u.autoClear, f = u.toneMapping;
32315
- u.getClearColor(Fh), u.toneMapping = Qn, u.autoClear = !1, u.state.buffers.depth.getReversed() && (u.setRenderTarget(s), u.clearDepth(), u.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new zn(
32324
+ u.getClearColor(Fh), u.toneMapping = ei, u.autoClear = !1, u.state.buffers.depth.getReversed() && (u.setRenderTarget(s), u.clearDepth(), u.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new Gn(
32316
32325
  new ta(),
32317
32326
  new xm({
32318
32327
  name: "PMREM.Background",
@@ -32463,13 +32472,13 @@ function _T(i) {
32463
32472
  const T = [M, M, M, M, M, M];
32464
32473
  b.set(T, p * g * M);
32465
32474
  }
32466
- const S = new Gn();
32467
- S.setAttribute("position", new ti(x, v)), S.setAttribute("uv", new ti(C, m)), S.setAttribute("faceIndex", new ti(b, p)), n.push(new zn(S, null)), s > ji && s--;
32475
+ const S = new Hn();
32476
+ S.setAttribute("position", new ni(x, v)), S.setAttribute("uv", new ni(C, m)), S.setAttribute("faceIndex", new ni(b, p)), n.push(new Gn(S, null)), s > ji && s--;
32468
32477
  }
32469
32478
  return { lodMeshes: n, sizeLods: e, sigmas: t };
32470
32479
  }
32471
32480
  function Vh(i, e, t) {
32472
- const n = new ei(i, e, t);
32481
+ const n = new ti(i, e, t);
32473
32482
  return n.texture.mapping = go, n.texture.name = "PMREM.cubeUv", n.scissorTest = !0, n;
32474
32483
  }
32475
32484
  function Gs(i, e, t, n, s) {
@@ -32602,7 +32611,7 @@ function yT(i, e, t) {
32602
32611
  }
32603
32612
  `
32604
32613
  ),
32605
- blending: xi,
32614
+ blending: Ti,
32606
32615
  depthTest: !1,
32607
32616
  depthWrite: !1
32608
32617
  });
@@ -32691,7 +32700,7 @@ function ST(i, e, t) {
32691
32700
  }
32692
32701
  `
32693
32702
  ),
32694
- blending: xi,
32703
+ blending: Ti,
32695
32704
  depthTest: !1,
32696
32705
  depthWrite: !1
32697
32706
  });
@@ -32726,7 +32735,7 @@ function zh() {
32726
32735
  }
32727
32736
  `
32728
32737
  ),
32729
- blending: xi,
32738
+ blending: Ti,
32730
32739
  depthTest: !1,
32731
32740
  depthWrite: !1
32732
32741
  });
@@ -32759,7 +32768,7 @@ function Gh() {
32759
32768
  }
32760
32769
  `
32761
32770
  ),
32762
- blending: xi,
32771
+ blending: Ti,
32763
32772
  depthTest: !1,
32764
32773
  depthWrite: !1
32765
32774
  });
@@ -33045,7 +33054,7 @@ function wT(i, e, t) {
33045
33054
  let b = o.attributes.position.count * C, S = 1;
33046
33055
  b > e.maxTextureSize && (S = Math.ceil(b / e.maxTextureSize), b = e.maxTextureSize);
33047
33056
  const M = new Float32Array(b * S * 4 * u), A = new _m(M, b, S, u);
33048
- A.type = Yn, A.needsUpdate = !0;
33057
+ A.type = Jn, A.needsUpdate = !0;
33049
33058
  const k = C * 4;
33050
33059
  for (let T = 0; T < u; T++) {
33051
33060
  const R = m[T], U = p[T], F = x[T], q = b * S * 4 * T;
@@ -33107,15 +33116,15 @@ const RT = {
33107
33116
  [om]: "CUSTOM_TONE_MAPPING"
33108
33117
  };
33109
33118
  function PT(i, e, t, n, s) {
33110
- const r = new ei(e, t, {
33119
+ const r = new ti(e, t, {
33111
33120
  type: i,
33112
33121
  depthBuffer: n,
33113
33122
  stencilBuffer: s
33114
- }), a = new ei(e, t, {
33115
- type: Mi,
33123
+ }), a = new ti(e, t, {
33124
+ type: wi,
33116
33125
  depthBuffer: !1,
33117
33126
  stencilBuffer: !1
33118
- }), o = new Gn();
33127
+ }), o = new Hn();
33119
33128
  o.setAttribute("position", new rn([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), o.setAttribute("uv", new rn([0, 2, 0, 0, 2, 0], 2));
33120
33129
  const c = new Cy({
33121
33130
  uniforms: {
@@ -33177,7 +33186,7 @@ function PT(i, e, t, n, s) {
33177
33186
  ),
33178
33187
  depthTest: !1,
33179
33188
  depthWrite: !1
33180
- }), l = new zn(o, c), d = new km(-1, 1, 1, -1, 0, 1);
33189
+ }), l = new Gn(o, c), d = new km(-1, 1, 1, -1, 0, 1);
33181
33190
  let u = null, h = null, f = !1, g, v = null, m = [], p = !1;
33182
33191
  this.setSize = function(x, C) {
33183
33192
  r.setSize(x, C), a.setSize(x, C);
@@ -33193,12 +33202,12 @@ function PT(i, e, t, n, s) {
33193
33202
  M.setSize && M.setSize(C, b);
33194
33203
  }
33195
33204
  }, this.begin = function(x, C) {
33196
- if (f || x.toneMapping === Qn && m.length === 0) return !1;
33205
+ if (f || x.toneMapping === ei && m.length === 0) return !1;
33197
33206
  if (v = C, C !== null) {
33198
33207
  const b = C.width, S = C.height;
33199
33208
  (r.width !== b || r.height !== S) && this.setSize(b, S);
33200
33209
  }
33201
- return p === !1 && x.setRenderTarget(r), g = x.toneMapping, x.toneMapping = Qn, !0;
33210
+ return p === !1 && x.setRenderTarget(r), g = x.toneMapping, x.toneMapping = ei, !0;
33202
33211
  }, this.hasRenderPass = function() {
33203
33212
  return p;
33204
33213
  }, this.end = function(x, C) {
@@ -33212,7 +33221,7 @@ function PT(i, e, t, n, s) {
33212
33221
  }
33213
33222
  }
33214
33223
  if (u !== x.outputColorSpace || h !== x.toneMapping) {
33215
- u = x.outputColorSpace, h = x.toneMapping, c.defines = {}, Qe.getTransfer(u) === lt && (c.defines.SRGB_TRANSFER = "");
33224
+ u = x.outputColorSpace, h = x.toneMapping, c.defines = {}, Qe.getTransfer(u) === ht && (c.defines.SRGB_TRANSFER = "");
33216
33225
  const M = RT[h];
33217
33226
  M && (c.defines[M] = ""), c.needsUpdate = !0;
33218
33227
  }
@@ -33743,7 +33752,7 @@ function CC(i) {
33743
33752
  switch (Qe.getTransfer(i)) {
33744
33753
  case so:
33745
33754
  return [e, "LinearTransferOETF"];
33746
- case lt:
33755
+ case ht:
33747
33756
  return [e, "sRGBTransferOETF"];
33748
33757
  default:
33749
33758
  return Oe("WebGLProgram: Unsupported color space: ", i), [e, "LinearTransferOETF"];
@@ -34142,10 +34151,10 @@ function jC(i, e, t, n) {
34142
34151
  "uniform mat4 viewMatrix;",
34143
34152
  "uniform vec3 cameraPosition;",
34144
34153
  "uniform bool isOrthographic;",
34145
- t.toneMapping !== Qn ? "#define TONE_MAPPING" : "",
34146
- t.toneMapping !== Qn ? Ge.tonemapping_pars_fragment : "",
34154
+ t.toneMapping !== ei ? "#define TONE_MAPPING" : "",
34155
+ t.toneMapping !== ei ? Ge.tonemapping_pars_fragment : "",
34147
34156
  // this code is required here because it is used by the toneMapping() function defined below
34148
- t.toneMapping !== Qn ? wC("toneMapping", t.toneMapping) : "",
34157
+ t.toneMapping !== ei ? wC("toneMapping", t.toneMapping) : "",
34149
34158
  t.dithering ? "#define DITHERING" : "",
34150
34159
  t.opaque ? "#define OPAQUE" : "",
34151
34160
  Ge.colorspace_pars_fragment,
@@ -34305,12 +34314,12 @@ function YC(i, e, t, n, s, r, a) {
34305
34314
  K.morphAttributes.position !== void 0 && (Be = 1), K.morphAttributes.normal !== void 0 && (Be = 2), K.morphAttributes.color !== void 0 && (Be = 3);
34306
34315
  let Fe, Et, ft, $;
34307
34316
  if (ge) {
34308
- const ot = Xn[ge];
34309
- Fe = ot.vertexShader, Et = ot.fragmentShader;
34317
+ const dt = $n[ge];
34318
+ Fe = dt.vertexShader, Et = dt.fragmentShader;
34310
34319
  } else
34311
34320
  Fe = y.vertexShader, Et = y.fragmentShader, c.update(y), ft = c.getVertexShaderID(y), $ = c.getFragmentShaderID(y);
34312
- const ne = i.getRenderTarget(), Te = i.state.buffers.depth.getReversed(), Ve = F.isInstancedMesh === !0, Me = F.isBatchedMesh === !0, et = !!y.map, Wt = !!y.matcap, Ze = !!W, at = !!y.aoMap, gt = !!y.lightMap, He = !!y.bumpMap, Nt = !!y.normalMap, I = !!y.displacementMap, Ut = !!y.emissiveMap, rt = !!y.metalnessMap, xt = !!y.roughnessMap, Ae = y.anisotropy > 0, w = y.clearcoat > 0, _ = y.dispersion > 0, L = y.iridescence > 0, X = y.sheen > 0, Q = y.transmission > 0, j = Ae && !!y.anisotropyMap, Pe = w && !!y.clearcoatMap, ue = w && !!y.clearcoatNormalMap, we = w && !!y.clearcoatRoughnessMap, Ne = L && !!y.iridescenceMap, se = L && !!y.iridescenceThicknessMap, fe = X && !!y.sheenColorMap, Ee = X && !!y.sheenRoughnessMap, Re = !!y.specularMap, he = !!y.specularColorMap, We = !!y.specularIntensityMap, D = Q && !!y.transmissionMap, _e = Q && !!y.thicknessMap, ae = !!y.gradientMap, Se = !!y.alphaMap, ie = y.alphaTest > 0, Y = !!y.alphaHash, de = !!y.extensions;
34313
- let Ue = Qn;
34321
+ const ne = i.getRenderTarget(), Te = i.state.buffers.depth.getReversed(), Ve = F.isInstancedMesh === !0, Me = F.isBatchedMesh === !0, et = !!y.map, Wt = !!y.matcap, Ze = !!W, lt = !!y.aoMap, _t = !!y.lightMap, He = !!y.bumpMap, Nt = !!y.normalMap, I = !!y.displacementMap, Ut = !!y.emissiveMap, rt = !!y.metalnessMap, xt = !!y.roughnessMap, Ae = y.anisotropy > 0, w = y.clearcoat > 0, _ = y.dispersion > 0, L = y.iridescence > 0, X = y.sheen > 0, Q = y.transmission > 0, j = Ae && !!y.anisotropyMap, Pe = w && !!y.clearcoatMap, ue = w && !!y.clearcoatNormalMap, we = w && !!y.clearcoatRoughnessMap, Ne = L && !!y.iridescenceMap, se = L && !!y.iridescenceThicknessMap, fe = X && !!y.sheenColorMap, Ee = X && !!y.sheenRoughnessMap, Re = !!y.specularMap, he = !!y.specularColorMap, We = !!y.specularIntensityMap, D = Q && !!y.transmissionMap, _e = Q && !!y.thicknessMap, ae = !!y.gradientMap, Se = !!y.alphaMap, ie = y.alphaTest > 0, Y = !!y.alphaHash, de = !!y.extensions;
34322
+ let Ue = ei;
34314
34323
  y.toneMapped && (ne === null || ne.isXRRenderTarget === !0) && (Ue = i.toneMapping);
34315
34324
  const Tt = {
34316
34325
  shaderID: ge,
@@ -34336,8 +34345,8 @@ function YC(i, e, t, n, s, r, a) {
34336
34345
  envMap: Ze,
34337
34346
  envMapMode: Ze && W.mapping,
34338
34347
  envMapCubeUVHeight: ee,
34339
- aoMap: at,
34340
- lightMap: gt,
34348
+ aoMap: lt,
34349
+ lightMap: _t,
34341
34350
  bumpMap: He,
34342
34351
  normalMap: Nt,
34343
34352
  displacementMap: I,
@@ -34373,8 +34382,8 @@ function YC(i, e, t, n, s, r, a) {
34373
34382
  combine: y.combine,
34374
34383
  //
34375
34384
  mapUv: et && v(y.map.channel),
34376
- aoMapUv: at && v(y.aoMap.channel),
34377
- lightMapUv: gt && v(y.lightMap.channel),
34385
+ aoMapUv: lt && v(y.aoMap.channel),
34386
+ lightMapUv: _t && v(y.lightMap.channel),
34378
34387
  bumpMapUv: He && v(y.bumpMap.channel),
34379
34388
  normalMapUv: Nt && v(y.normalMap.channel),
34380
34389
  displacementMapUv: I && v(y.displacementMap.channel),
@@ -34430,10 +34439,10 @@ function YC(i, e, t, n, s, r, a) {
34430
34439
  shadowMapEnabled: i.shadowMap.enabled && R.length > 0,
34431
34440
  shadowMapType: i.shadowMap.type,
34432
34441
  toneMapping: Ue,
34433
- decodeVideoTexture: et && y.map.isVideoTexture === !0 && Qe.getTransfer(y.map.colorSpace) === lt,
34434
- decodeVideoTextureEmissive: Ut && y.emissiveMap.isVideoTexture === !0 && Qe.getTransfer(y.emissiveMap.colorSpace) === lt,
34442
+ decodeVideoTexture: et && y.map.isVideoTexture === !0 && Qe.getTransfer(y.map.colorSpace) === ht,
34443
+ decodeVideoTextureEmissive: Ut && y.emissiveMap.isVideoTexture === !0 && Qe.getTransfer(y.emissiveMap.colorSpace) === ht,
34435
34444
  premultipliedAlpha: y.premultipliedAlpha,
34436
- doubleSided: y.side === yi,
34445
+ doubleSided: y.side === Si,
34437
34446
  flipSided: y.side === nn,
34438
34447
  useDepthPacking: y.depthPacking >= 0,
34439
34448
  depthPacking: y.depthPacking || 0,
@@ -34462,7 +34471,7 @@ function YC(i, e, t, n, s, r, a) {
34462
34471
  const T = g[y.type];
34463
34472
  let R;
34464
34473
  if (T) {
34465
- const U = Xn[T];
34474
+ const U = $n[T];
34466
34475
  R = fy.clone(U.uniforms);
34467
34476
  } else
34468
34477
  R = y.uniforms;
@@ -34900,7 +34909,7 @@ void main() {
34900
34909
  ], af = /* @__PURE__ */ new Vt(), wr = /* @__PURE__ */ new B(), Cc = /* @__PURE__ */ new B();
34901
34910
  function dE(i, e, t) {
34902
34911
  let n = new Rm();
34903
- const s = new st(), r = new st(), a = new Lt(), o = new Ey(), c = new My(), l = {}, d = t.maxTextureSize, u = { [Ei]: nn, [nn]: Ei, [yi]: yi }, h = new wn({
34912
+ const s = new st(), r = new st(), a = new Lt(), o = new Ey(), c = new My(), l = {}, d = t.maxTextureSize, u = { [Mi]: nn, [nn]: Mi, [Si]: Si }, h = new wn({
34904
34913
  defines: {
34905
34914
  VSM_SAMPLES: 8
34906
34915
  },
@@ -34913,22 +34922,22 @@ function dE(i, e, t) {
34913
34922
  fragmentShader: oE
34914
34923
  }), f = h.clone();
34915
34924
  f.defines.HORIZONTAL_PASS = 1;
34916
- const g = new Gn();
34925
+ const g = new Hn();
34917
34926
  g.setAttribute(
34918
34927
  "position",
34919
- new ti(
34928
+ new ni(
34920
34929
  new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]),
34921
34930
  3
34922
34931
  )
34923
34932
  );
34924
- const v = new zn(g, h), m = this;
34933
+ const v = new Gn(g, h), m = this;
34925
34934
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = za;
34926
34935
  let p = this.type;
34927
34936
  this.render = function(M, A, k) {
34928
34937
  if (m.enabled === !1 || m.autoUpdate === !1 && m.needsUpdate === !1 || M.length === 0) return;
34929
34938
  M.type === p_ && (Oe("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), M.type = za);
34930
34939
  const y = i.getRenderTarget(), T = i.getActiveCubeFace(), R = i.getActiveMipmapLevel(), U = i.state;
34931
- U.setBlending(xi), U.buffers.depth.getReversed() === !0 ? U.buffers.color.setClear(0, 0, 0, 0) : U.buffers.color.setClear(1, 1, 1, 1), U.buffers.depth.setTest(!0), U.setScissorTest(!1);
34940
+ U.setBlending(Ti), U.buffers.depth.getReversed() === !0 ? U.buffers.color.setClear(0, 0, 0, 0) : U.buffers.color.setClear(1, 1, 1, 1), U.buffers.depth.setTest(!0), U.setScissorTest(!1);
34932
34941
  const F = p !== this.type;
34933
34942
  F && A.traverse(function(q) {
34934
34943
  q.material && (Array.isArray(q.material) ? q.material.forEach((K) => K.needsUpdate = !0) : q.material.needsUpdate = !0);
@@ -34948,15 +34957,15 @@ function dE(i, e, t) {
34948
34957
  Oe("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
34949
34958
  continue;
34950
34959
  }
34951
- W.map = new ei(s.x, s.y, {
34960
+ W.map = new ti(s.x, s.y, {
34952
34961
  format: cr,
34953
- type: Mi,
34962
+ type: wi,
34954
34963
  minFilter: Qt,
34955
34964
  magFilter: Qt,
34956
34965
  generateMipmaps: !1
34957
- }), W.map.texture.name = H.name + ".shadowMap", W.map.depthTexture = new Kr(s.x, s.y, Yn), W.map.depthTexture.name = H.name + ".shadowMapDepth", W.map.depthTexture.format = wi, W.map.depthTexture.compareFunction = null, W.map.depthTexture.minFilter = Yt, W.map.depthTexture.magFilter = Yt;
34966
+ }), W.map.texture.name = H.name + ".shadowMap", W.map.depthTexture = new Kr(s.x, s.y, Jn), W.map.depthTexture.name = H.name + ".shadowMapDepth", W.map.depthTexture.format = Ai, W.map.depthTexture.compareFunction = null, W.map.depthTexture.minFilter = Yt, W.map.depthTexture.magFilter = Yt;
34958
34967
  } else {
34959
- H.isPointLight ? (W.map = new Am(s.x), W.map.depthTexture = new Ty(s.x, si)) : (W.map = new ei(s.x, s.y), W.map.depthTexture = new Kr(s.x, s.y, si)), W.map.depthTexture.name = H.name + ".shadowMap", W.map.depthTexture.format = wi;
34968
+ H.isPointLight ? (W.map = new Am(s.x), W.map.depthTexture = new Ty(s.x, ri)) : (W.map = new ti(s.x, s.y), W.map.depthTexture = new Kr(s.x, s.y, ri)), W.map.depthTexture.name = H.name + ".shadowMap", W.map.depthTexture.format = Ai;
34960
34969
  const le = i.state.buffers.depth.getReversed();
34961
34970
  this.type === za ? (W.map.depthTexture.compareFunction = le ? Od : Ud, W.map.depthTexture.minFilter = Qt, W.map.depthTexture.magFilter = Qt) : (W.map.depthTexture.compareFunction = null, W.map.depthTexture.minFilter = Yt, W.map.depthTexture.magFilter = Yt);
34962
34971
  }
@@ -34989,9 +34998,9 @@ function dE(i, e, t) {
34989
34998
  };
34990
34999
  function x(M, A) {
34991
35000
  const k = e.update(v);
34992
- h.defines.VSM_SAMPLES !== M.blurSamples && (h.defines.VSM_SAMPLES = M.blurSamples, f.defines.VSM_SAMPLES = M.blurSamples, h.needsUpdate = !0, f.needsUpdate = !0), M.mapPass === null && (M.mapPass = new ei(s.x, s.y, {
35001
+ h.defines.VSM_SAMPLES !== M.blurSamples && (h.defines.VSM_SAMPLES = M.blurSamples, f.defines.VSM_SAMPLES = M.blurSamples, h.needsUpdate = !0, f.needsUpdate = !0), M.mapPass === null && (M.mapPass = new ti(s.x, s.y, {
34993
35002
  format: cr,
34994
- type: Mi
35003
+ type: wi
34995
35004
  })), h.uniforms.shadow_pass.value = M.map.depthTexture, h.uniforms.resolution.value = M.mapSize, h.uniforms.radius.value = M.radius, i.setRenderTarget(M.mapPass), i.clear(), i.renderBufferDirect(A, null, k, h, v, null), f.uniforms.shadow_pass.value = M.mapPass.texture, f.uniforms.resolution.value = M.mapSize, f.uniforms.radius.value = M.radius, i.setRenderTarget(M.map), i.clear(), i.renderBufferDirect(A, null, k, f, v, null);
34996
35005
  }
34997
35006
  function C(M, A, k, y) {
@@ -35141,23 +35150,23 @@ function hE(i, e) {
35141
35150
  function s() {
35142
35151
  let D = !1, _e = null, ae = null, Se = null, ie = null, Y = null, de = null, Ue = null, Tt = null;
35143
35152
  return {
35144
- setTest: function(ot) {
35145
- D || (ot ? ne(i.STENCIL_TEST) : Te(i.STENCIL_TEST));
35153
+ setTest: function(dt) {
35154
+ D || (dt ? ne(i.STENCIL_TEST) : Te(i.STENCIL_TEST));
35146
35155
  },
35147
- setMask: function(ot) {
35148
- _e !== ot && !D && (i.stencilMask(ot), _e = ot);
35156
+ setMask: function(dt) {
35157
+ _e !== dt && !D && (i.stencilMask(dt), _e = dt);
35149
35158
  },
35150
- setFunc: function(ot, Hn, ai) {
35151
- (ae !== ot || Se !== Hn || ie !== ai) && (i.stencilFunc(ot, Hn, ai), ae = ot, Se = Hn, ie = ai);
35159
+ setFunc: function(dt, Wn, oi) {
35160
+ (ae !== dt || Se !== Wn || ie !== oi) && (i.stencilFunc(dt, Wn, oi), ae = dt, Se = Wn, ie = oi);
35152
35161
  },
35153
- setOp: function(ot, Hn, ai) {
35154
- (Y !== ot || de !== Hn || Ue !== ai) && (i.stencilOp(ot, Hn, ai), Y = ot, de = Hn, Ue = ai);
35162
+ setOp: function(dt, Wn, oi) {
35163
+ (Y !== dt || de !== Wn || Ue !== oi) && (i.stencilOp(dt, Wn, oi), Y = dt, de = Wn, Ue = oi);
35155
35164
  },
35156
- setLocked: function(ot) {
35157
- D = ot;
35165
+ setLocked: function(dt) {
35166
+ D = dt;
35158
35167
  },
35159
- setClear: function(ot) {
35160
- Tt !== ot && (i.clearStencil(ot), Tt = ot);
35168
+ setClear: function(dt) {
35169
+ Tt !== dt && (i.clearStencil(dt), Tt = dt);
35161
35170
  },
35162
35171
  reset: function() {
35163
35172
  D = !1, _e = null, ae = null, Se = null, ie = null, Y = null, de = null, Ue = null, Tt = null;
@@ -35180,7 +35189,7 @@ function hE(i, e) {
35180
35189
  return Y;
35181
35190
  }
35182
35191
  const $ = {};
35183
- $[i.TEXTURE_2D] = ft(i.TEXTURE_2D, i.TEXTURE_2D, 1), $[i.TEXTURE_CUBE_MAP] = ft(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), $[i.TEXTURE_2D_ARRAY] = ft(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), $[i.TEXTURE_3D] = ft(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), ne(i.DEPTH_TEST), a.setFunc(ar), He(!1), Nt(hh), ne(i.CULL_FACE), at(xi);
35192
+ $[i.TEXTURE_2D] = ft(i.TEXTURE_2D, i.TEXTURE_2D, 1), $[i.TEXTURE_CUBE_MAP] = ft(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), $[i.TEXTURE_2D_ARRAY] = ft(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), $[i.TEXTURE_3D] = ft(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), ne(i.DEPTH_TEST), a.setFunc(ar), He(!1), Nt(hh), ne(i.CULL_FACE), lt(Ti);
35184
35193
  function ne(D) {
35185
35194
  d[D] !== !0 && (i.enable(D), d[D] = !0);
35186
35195
  }
@@ -35230,14 +35239,14 @@ function hE(i, e) {
35230
35239
  [k_]: i.CONSTANT_ALPHA,
35231
35240
  [I_]: i.ONE_MINUS_CONSTANT_ALPHA
35232
35241
  };
35233
- function at(D, _e, ae, Se, ie, Y, de, Ue, Tt, ot) {
35234
- if (D === xi) {
35242
+ function lt(D, _e, ae, Se, ie, Y, de, Ue, Tt, dt) {
35243
+ if (D === Ti) {
35235
35244
  v === !0 && (Te(i.BLEND), v = !1);
35236
35245
  return;
35237
35246
  }
35238
35247
  if (v === !1 && (ne(i.BLEND), v = !0), D !== m_) {
35239
- if (D !== m || ot !== y) {
35240
- if ((p !== us || b !== us) && (i.blendEquation(i.FUNC_ADD), p = us, b = us), ot)
35248
+ if (D !== m || dt !== y) {
35249
+ if ((p !== us || b !== us) && (i.blendEquation(i.FUNC_ADD), p = us, b = us), dt)
35241
35250
  switch (D) {
35242
35251
  case Qs:
35243
35252
  i.blendFuncSeparate(i.ONE, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);
@@ -35273,16 +35282,16 @@ function hE(i, e) {
35273
35282
  nt("WebGLState: Invalid blending: ", D);
35274
35283
  break;
35275
35284
  }
35276
- x = null, C = null, S = null, M = null, A.set(0, 0, 0), k = 0, m = D, y = ot;
35285
+ x = null, C = null, S = null, M = null, A.set(0, 0, 0), k = 0, m = D, y = dt;
35277
35286
  }
35278
35287
  return;
35279
35288
  }
35280
35289
  ie = ie || _e, Y = Y || ae, de = de || Se, (_e !== p || ie !== b) && (i.blendEquationSeparate(Wt[_e], Wt[ie]), p = _e, b = ie), (ae !== x || Se !== C || Y !== S || de !== M) && (i.blendFuncSeparate(Ze[ae], Ze[Se], Ze[Y], Ze[de]), x = ae, C = Se, S = Y, M = de), (Ue.equals(A) === !1 || Tt !== k) && (i.blendColor(Ue.r, Ue.g, Ue.b, Tt), A.copy(Ue), k = Tt), m = D, y = !1;
35281
35290
  }
35282
- function gt(D, _e) {
35283
- D.side === yi ? Te(i.CULL_FACE) : ne(i.CULL_FACE);
35291
+ function _t(D, _e) {
35292
+ D.side === Si ? Te(i.CULL_FACE) : ne(i.CULL_FACE);
35284
35293
  let ae = D.side === nn;
35285
- _e && (ae = !ae), He(ae), D.blending === Qs && D.transparent === !1 ? at(xi) : at(D.blending, D.blendEquation, D.blendSrc, D.blendDst, D.blendEquationAlpha, D.blendSrcAlpha, D.blendDstAlpha, D.blendColor, D.blendAlpha, D.premultipliedAlpha), a.setFunc(D.depthFunc), a.setTest(D.depthTest), a.setMask(D.depthWrite), r.setMask(D.colorWrite);
35294
+ _e && (ae = !ae), He(ae), D.blending === Qs && D.transparent === !1 ? lt(Ti) : lt(D.blending, D.blendEquation, D.blendSrc, D.blendDst, D.blendEquationAlpha, D.blendSrcAlpha, D.blendDstAlpha, D.blendColor, D.blendAlpha, D.premultipliedAlpha), a.setFunc(D.depthFunc), a.setTest(D.depthTest), a.setMask(D.depthWrite), r.setMask(D.colorWrite);
35286
35295
  const Se = D.stencilWrite;
35287
35296
  o.setTest(Se), Se && (o.setMask(D.stencilWriteMask), o.setFunc(D.stencilFunc, D.stencilRef, D.stencilFuncMask), o.setOp(D.stencilFail, D.stencilZFail, D.stencilZPass)), Ut(D.polygonOffset, D.polygonOffsetFactor, D.polygonOffsetUnits), D.alphaToCoverage === !0 ? ne(i.SAMPLE_ALPHA_TO_COVERAGE) : Te(i.SAMPLE_ALPHA_TO_COVERAGE);
35288
35297
  }
@@ -35413,8 +35422,8 @@ function hE(i, e) {
35413
35422
  bindFramebuffer: Ve,
35414
35423
  drawBuffers: Me,
35415
35424
  useProgram: et,
35416
- setBlending: at,
35417
- setMaterial: gt,
35425
+ setBlending: lt,
35426
+ setMaterial: _t,
35418
35427
  setFlipSided: He,
35419
35428
  setCullFace: Nt,
35420
35429
  setLineWidth: I,
@@ -35482,13 +35491,13 @@ function fE(i, e, t, n, s, r, a) {
35482
35491
  let j = _;
35483
35492
  if (_ === i.RED && (L === i.FLOAT && (j = i.R32F), L === i.HALF_FLOAT && (j = i.R16F), L === i.UNSIGNED_BYTE && (j = i.R8)), _ === i.RED_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.R8UI), L === i.UNSIGNED_SHORT && (j = i.R16UI), L === i.UNSIGNED_INT && (j = i.R32UI), L === i.BYTE && (j = i.R8I), L === i.SHORT && (j = i.R16I), L === i.INT && (j = i.R32I)), _ === i.RG && (L === i.FLOAT && (j = i.RG32F), L === i.HALF_FLOAT && (j = i.RG16F), L === i.UNSIGNED_BYTE && (j = i.RG8)), _ === i.RG_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RG8UI), L === i.UNSIGNED_SHORT && (j = i.RG16UI), L === i.UNSIGNED_INT && (j = i.RG32UI), L === i.BYTE && (j = i.RG8I), L === i.SHORT && (j = i.RG16I), L === i.INT && (j = i.RG32I)), _ === i.RGB_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RGB8UI), L === i.UNSIGNED_SHORT && (j = i.RGB16UI), L === i.UNSIGNED_INT && (j = i.RGB32UI), L === i.BYTE && (j = i.RGB8I), L === i.SHORT && (j = i.RGB16I), L === i.INT && (j = i.RGB32I)), _ === i.RGBA_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RGBA8UI), L === i.UNSIGNED_SHORT && (j = i.RGBA16UI), L === i.UNSIGNED_INT && (j = i.RGBA32UI), L === i.BYTE && (j = i.RGBA8I), L === i.SHORT && (j = i.RGBA16I), L === i.INT && (j = i.RGBA32I)), _ === i.RGB && (L === i.UNSIGNED_INT_5_9_9_9_REV && (j = i.RGB9_E5), L === i.UNSIGNED_INT_10F_11F_11F_REV && (j = i.R11F_G11F_B10F)), _ === i.RGBA) {
35484
35493
  const Pe = Q ? so : Qe.getTransfer(X);
35485
- L === i.FLOAT && (j = i.RGBA32F), L === i.HALF_FLOAT && (j = i.RGBA16F), L === i.UNSIGNED_BYTE && (j = Pe === lt ? i.SRGB8_ALPHA8 : i.RGBA8), L === i.UNSIGNED_SHORT_4_4_4_4 && (j = i.RGBA4), L === i.UNSIGNED_SHORT_5_5_5_1 && (j = i.RGB5_A1);
35494
+ L === i.FLOAT && (j = i.RGBA32F), L === i.HALF_FLOAT && (j = i.RGBA16F), L === i.UNSIGNED_BYTE && (j = Pe === ht ? i.SRGB8_ALPHA8 : i.RGBA8), L === i.UNSIGNED_SHORT_4_4_4_4 && (j = i.RGBA4), L === i.UNSIGNED_SHORT_5_5_5_1 && (j = i.RGB5_A1);
35486
35495
  }
35487
35496
  return (j === i.R16F || j === i.R32F || j === i.RG16F || j === i.RG32F || j === i.RGBA16F || j === i.RGBA32F) && e.get("EXT_color_buffer_float"), j;
35488
35497
  }
35489
35498
  function b(w, _) {
35490
35499
  let L;
35491
- return w ? _ === null || _ === si || _ === Xr ? L = i.DEPTH24_STENCIL8 : _ === Yn ? L = i.DEPTH32F_STENCIL8 : _ === jr && (L = i.DEPTH24_STENCIL8, Oe("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : _ === null || _ === si || _ === Xr ? L = i.DEPTH_COMPONENT24 : _ === Yn ? L = i.DEPTH_COMPONENT32F : _ === jr && (L = i.DEPTH_COMPONENT16), L;
35500
+ return w ? _ === null || _ === ri || _ === Xr ? L = i.DEPTH24_STENCIL8 : _ === Jn ? L = i.DEPTH32F_STENCIL8 : _ === jr && (L = i.DEPTH24_STENCIL8, Oe("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : _ === null || _ === ri || _ === Xr ? L = i.DEPTH_COMPONENT24 : _ === Jn ? L = i.DEPTH_COMPONENT32F : _ === jr && (L = i.DEPTH_COMPONENT16), L;
35492
35501
  }
35493
35502
  function S(w, _) {
35494
35503
  return m(w) === !0 || w.isFramebufferTexture && w.minFilter !== Yt && w.minFilter !== Qt ? Math.log2(Math.max(_.width, _.height)) + 1 : w.mipmaps !== void 0 && w.mipmaps.length > 0 ? w.mipmaps.length : w.isCompressedTexture && Array.isArray(w.image) ? _.mipmaps.length : 1;
@@ -35597,7 +35606,7 @@ function fE(i, e, t, n, s, r, a) {
35597
35606
  }
35598
35607
  const ge = {
35599
35608
  [vl]: i.REPEAT,
35600
- [Si]: i.CLAMP_TO_EDGE,
35609
+ [xi]: i.CLAMP_TO_EDGE,
35601
35610
  [bl]: i.MIRRORED_REPEAT
35602
35611
  }, le = {
35603
35612
  [Yt]: i.NEAREST,
@@ -35617,8 +35626,8 @@ function fE(i, e, t, n, s, r, a) {
35617
35626
  [H_]: i.NOTEQUAL
35618
35627
  };
35619
35628
  function Be(w, _) {
35620
- if (_.type === Yn && e.has("OES_texture_float_linear") === !1 && (_.magFilter === Qt || _.magFilter === $o || _.magFilter === aa || _.magFilter === ps || _.minFilter === Qt || _.minFilter === $o || _.minFilter === aa || _.minFilter === ps) && Oe("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), i.texParameteri(w, i.TEXTURE_WRAP_S, ge[_.wrapS]), i.texParameteri(w, i.TEXTURE_WRAP_T, ge[_.wrapT]), (w === i.TEXTURE_3D || w === i.TEXTURE_2D_ARRAY) && i.texParameteri(w, i.TEXTURE_WRAP_R, ge[_.wrapR]), i.texParameteri(w, i.TEXTURE_MAG_FILTER, le[_.magFilter]), i.texParameteri(w, i.TEXTURE_MIN_FILTER, le[_.minFilter]), _.compareFunction && (i.texParameteri(w, i.TEXTURE_COMPARE_MODE, i.COMPARE_REF_TO_TEXTURE), i.texParameteri(w, i.TEXTURE_COMPARE_FUNC, be[_.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
35621
- if (_.magFilter === Yt || _.minFilter !== aa && _.minFilter !== ps || _.type === Yn && e.has("OES_texture_float_linear") === !1) return;
35629
+ if (_.type === Jn && e.has("OES_texture_float_linear") === !1 && (_.magFilter === Qt || _.magFilter === $o || _.magFilter === aa || _.magFilter === ps || _.minFilter === Qt || _.minFilter === $o || _.minFilter === aa || _.minFilter === ps) && Oe("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), i.texParameteri(w, i.TEXTURE_WRAP_S, ge[_.wrapS]), i.texParameteri(w, i.TEXTURE_WRAP_T, ge[_.wrapT]), (w === i.TEXTURE_3D || w === i.TEXTURE_2D_ARRAY) && i.texParameteri(w, i.TEXTURE_WRAP_R, ge[_.wrapR]), i.texParameteri(w, i.TEXTURE_MAG_FILTER, le[_.magFilter]), i.texParameteri(w, i.TEXTURE_MIN_FILTER, le[_.minFilter]), _.compareFunction && (i.texParameteri(w, i.TEXTURE_COMPARE_MODE, i.COMPARE_REF_TO_TEXTURE), i.texParameteri(w, i.TEXTURE_COMPARE_FUNC, be[_.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
35630
+ if (_.magFilter === Yt || _.minFilter !== aa && _.minFilter !== ps || _.type === Jn && e.has("OES_texture_float_linear") === !1) return;
35622
35631
  if (_.anisotropy > 1 || n.get(_).__currentAnisotropy) {
35623
35632
  const L = e.get("EXT_texture_filter_anisotropic");
35624
35633
  i.texParameterf(w, L.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(_.anisotropy, s.getMaxAnisotropy())), n.get(_).__currentAnisotropy = _.anisotropy;
@@ -35700,7 +35709,7 @@ function fE(i, e, t, n, s, r, a) {
35700
35709
  if (_.isCompressedArrayTexture) {
35701
35710
  D && _e && t.texStorage3D(i.TEXTURE_2D_ARRAY, Se, Re, We[0].width, We[0].height, se.depth);
35702
35711
  for (let ie = 0, Y = We.length; ie < Y; ie++)
35703
- if (he = We[ie], _.format !== Bn)
35712
+ if (he = We[ie], _.format !== Vn)
35704
35713
  if (fe !== null)
35705
35714
  if (D) {
35706
35715
  if (ae)
@@ -35725,7 +35734,7 @@ function fE(i, e, t, n, s, r, a) {
35725
35734
  } else {
35726
35735
  D && _e && t.texStorage2D(i.TEXTURE_2D, Se, Re, We[0].width, We[0].height);
35727
35736
  for (let ie = 0, Y = We.length; ie < Y; ie++)
35728
- he = We[ie], _.format !== Bn ? fe !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, he.data) : t.compressedTexImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, he.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : D ? ae && t.texSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, Ee, he.data) : t.texImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, fe, Ee, he.data);
35737
+ he = We[ie], _.format !== Vn ? fe !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, he.data) : t.compressedTexImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, he.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : D ? ae && t.texSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, Ee, he.data) : t.texImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, fe, Ee, he.data);
35729
35738
  }
35730
35739
  else if (_.isDataArrayTexture)
35731
35740
  if (D) {
@@ -35797,7 +35806,7 @@ function fE(i, e, t, n, s, r, a) {
35797
35806
  ie = fe[Y].mipmaps;
35798
35807
  for (let de = 0; de < ie.length; de++) {
35799
35808
  const Ue = ie[de];
35800
- _.format !== Bn ? Re !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, Ue.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Ue.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : D ? ae && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, he, Ue.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Re, he, Ue.data);
35809
+ _.format !== Vn ? Re !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, Ue.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Ue.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : D ? ae && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, he, Ue.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Re, he, Ue.data);
35801
35810
  }
35802
35811
  }
35803
35812
  } else {
@@ -35856,14 +35865,14 @@ function fE(i, e, t, n, s, r, a) {
35856
35865
  Q.__webglTexture = i.createTexture(), t.bindTexture(i.TEXTURE_CUBE_MAP, Q.__webglTexture), Be(i.TEXTURE_CUBE_MAP, _.depthTexture);
35857
35866
  const Ne = r.convert(_.depthTexture.format), se = r.convert(_.depthTexture.type);
35858
35867
  let fe;
35859
- _.depthTexture.format === wi ? fe = i.DEPTH_COMPONENT24 : _.depthTexture.format === ms && (fe = i.DEPTH24_STENCIL8);
35868
+ _.depthTexture.format === Ai ? fe = i.DEPTH_COMPONENT24 : _.depthTexture.format === ms && (fe = i.DEPTH24_STENCIL8);
35860
35869
  for (let Ee = 0; Ee < 6; Ee++)
35861
35870
  i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Ee, 0, fe, _.width, _.height, 0, Ne, se, null);
35862
35871
  }
35863
35872
  } else
35864
35873
  K(_.depthTexture, 0);
35865
35874
  const j = Q.__webglTexture, Pe = I(_), ue = X ? i.TEXTURE_CUBE_MAP_POSITIVE_X + L : i.TEXTURE_2D, we = _.depthTexture.format === ms ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
35866
- if (_.depthTexture.format === wi)
35875
+ if (_.depthTexture.format === Ai)
35867
35876
  Ut(_) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, we, ue, j, 0, Pe) : i.framebufferTexture2D(i.FRAMEBUFFER, we, ue, j, 0);
35868
35877
  else if (_.depthTexture.format === ms)
35869
35878
  Ut(_) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, we, ue, j, 0, Pe) : i.framebufferTexture2D(i.FRAMEBUFFER, we, ue, j, 0);
@@ -35977,7 +35986,7 @@ function fE(i, e, t, n, s, r, a) {
35977
35986
  }
35978
35987
  w.depthBuffer && et(w);
35979
35988
  }
35980
- function at(w) {
35989
+ function lt(w) {
35981
35990
  const _ = w.textures;
35982
35991
  for (let L = 0, X = _.length; L < X; L++) {
35983
35992
  const Q = _[L];
@@ -35987,7 +35996,7 @@ function fE(i, e, t, n, s, r, a) {
35987
35996
  }
35988
35997
  }
35989
35998
  }
35990
- const gt = [], He = [];
35999
+ const _t = [], He = [];
35991
36000
  function Nt(w) {
35992
36001
  if (w.samples > 0) {
35993
36002
  if (Ut(w) === !1) {
@@ -36006,7 +36015,7 @@ function fE(i, e, t, n, s, r, a) {
36006
36015
  const se = n.get(_[Ne]).__webglTexture;
36007
36016
  i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, se, 0);
36008
36017
  }
36009
- i.blitFramebuffer(0, 0, L, X, 0, 0, L, X, Q, i.NEAREST), c === !0 && (gt.length = 0, He.length = 0, gt.push(i.COLOR_ATTACHMENT0 + Ne), w.depthBuffer && w.resolveDepthBuffer === !1 && (gt.push(j), He.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, He)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, gt));
36018
+ i.blitFramebuffer(0, 0, L, X, 0, 0, L, X, Q, i.NEAREST), c === !0 && (_t.length = 0, He.length = 0, _t.push(i.COLOR_ATTACHMENT0 + Ne), w.depthBuffer && w.resolveDepthBuffer === !1 && (_t.push(j), He.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, He)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, _t));
36010
36019
  }
36011
36020
  if (t.bindFramebuffer(i.READ_FRAMEBUFFER, null), t.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), ue)
36012
36021
  for (let Ne = 0; Ne < _.length; Ne++) {
@@ -36034,12 +36043,12 @@ function fE(i, e, t, n, s, r, a) {
36034
36043
  }
36035
36044
  function xt(w, _) {
36036
36045
  const L = w.colorSpace, X = w.format, Q = w.type;
36037
- return w.isCompressedTexture === !0 || w.isVideoTexture === !0 || L !== lr && L !== Wi && (Qe.getTransfer(L) === lt ? (X !== Bn || Q !== Mn) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : nt("WebGLTextures: Unsupported texture color space:", L)), _;
36046
+ return w.isCompressedTexture === !0 || w.isVideoTexture === !0 || L !== lr && L !== Wi && (Qe.getTransfer(L) === ht ? (X !== Vn || Q !== Mn) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : nt("WebGLTextures: Unsupported texture color space:", L)), _;
36038
36047
  }
36039
36048
  function Ae(w) {
36040
36049
  return typeof HTMLImageElement < "u" && w instanceof HTMLImageElement ? (l.width = w.naturalWidth || w.width, l.height = w.naturalHeight || w.height) : typeof VideoFrame < "u" && w instanceof VideoFrame ? (l.width = w.displayWidth, l.height = w.displayHeight) : (l.width = w.width, l.height = w.height), l;
36041
36050
  }
36042
- this.allocateTextureUnit = F, this.resetTextureUnits = U, this.setTexture2D = K, this.setTexture2DArray = H, this.setTexture3D = W, this.setTextureCube = ee, this.rebindTextures = Wt, this.setupRenderTarget = Ze, this.updateRenderTargetMipmap = at, this.updateMultisampleRenderTarget = Nt, this.setupDepthRenderbuffer = et, this.setupFrameBufferTexture = Te, this.useMultisampledRTT = Ut, this.isReversedDepthBuffer = function() {
36051
+ this.allocateTextureUnit = F, this.resetTextureUnits = U, this.setTexture2D = K, this.setTexture2DArray = H, this.setTexture3D = W, this.setTextureCube = ee, this.rebindTextures = Wt, this.setupRenderTarget = Ze, this.updateRenderTargetMipmap = lt, this.updateMultisampleRenderTarget = Nt, this.setupDepthRenderbuffer = et, this.setupFrameBufferTexture = Te, this.useMultisampledRTT = Ut, this.isReversedDepthBuffer = function() {
36043
36052
  return t.buffers.depth.getReversed();
36044
36053
  };
36045
36054
  }
@@ -36056,13 +36065,13 @@ function pE(i, e) {
36056
36065
  if (n === hm) return i.SHORT;
36057
36066
  if (n === jr) return i.UNSIGNED_SHORT;
36058
36067
  if (n === Pd) return i.INT;
36059
- if (n === si) return i.UNSIGNED_INT;
36060
- if (n === Yn) return i.FLOAT;
36061
- if (n === Mi) return i.HALF_FLOAT;
36068
+ if (n === ri) return i.UNSIGNED_INT;
36069
+ if (n === Jn) return i.FLOAT;
36070
+ if (n === wi) return i.HALF_FLOAT;
36062
36071
  if (n === mm) return i.ALPHA;
36063
36072
  if (n === gm) return i.RGB;
36064
- if (n === Bn) return i.RGBA;
36065
- if (n === wi) return i.DEPTH_COMPONENT;
36073
+ if (n === Vn) return i.RGBA;
36074
+ if (n === Ai) return i.DEPTH_COMPONENT;
36066
36075
  if (n === ms) return i.DEPTH_STENCIL;
36067
36076
  if (n === vm) return i.RED;
36068
36077
  if (n === Dd) return i.RED_INTEGER;
@@ -36070,7 +36079,7 @@ function pE(i, e) {
36070
36079
  if (n === Ld) return i.RG_INTEGER;
36071
36080
  if (n === Nd) return i.RGBA_INTEGER;
36072
36081
  if (n === Ga || n === Ha || n === Wa || n === qa)
36073
- if (a === lt)
36082
+ if (a === ht)
36074
36083
  if (r = e.get("WEBGL_compressed_texture_s3tc_srgb"), r !== null) {
36075
36084
  if (n === Ga) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;
36076
36085
  if (n === Ha) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
@@ -36095,8 +36104,8 @@ function pE(i, e) {
36095
36104
  return null;
36096
36105
  if (n === Tl || n === Cl || n === El || n === Ml || n === wl || n === Al || n === Rl)
36097
36106
  if (r = e.get("WEBGL_compressed_texture_etc"), r !== null) {
36098
- if (n === Tl || n === Cl) return a === lt ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;
36099
- if (n === El) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;
36107
+ if (n === Tl || n === Cl) return a === ht ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;
36108
+ if (n === El) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;
36100
36109
  if (n === Ml) return r.COMPRESSED_R11_EAC;
36101
36110
  if (n === wl) return r.COMPRESSED_SIGNED_R11_EAC;
36102
36111
  if (n === Al) return r.COMPRESSED_RG11_EAC;
@@ -36105,25 +36114,25 @@ function pE(i, e) {
36105
36114
  return null;
36106
36115
  if (n === Pl || n === kl || n === Il || n === Dl || n === Ll || n === Nl || n === Ul || n === Ol || n === Fl || n === Bl || n === Vl || n === zl || n === Gl || n === Hl)
36107
36116
  if (r = e.get("WEBGL_compressed_texture_astc"), r !== null) {
36108
- if (n === Pl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;
36109
- if (n === kl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;
36110
- if (n === Il) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;
36111
- if (n === Dl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;
36112
- if (n === Ll) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;
36113
- if (n === Nl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;
36114
- if (n === Ul) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;
36115
- if (n === Ol) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;
36116
- if (n === Fl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;
36117
- if (n === Bl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;
36118
- if (n === Vl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;
36119
- if (n === zl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;
36120
- if (n === Gl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;
36121
- if (n === Hl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;
36117
+ if (n === Pl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;
36118
+ if (n === kl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;
36119
+ if (n === Il) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;
36120
+ if (n === Dl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;
36121
+ if (n === Ll) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;
36122
+ if (n === Nl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;
36123
+ if (n === Ul) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;
36124
+ if (n === Ol) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;
36125
+ if (n === Fl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;
36126
+ if (n === Bl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;
36127
+ if (n === Vl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;
36128
+ if (n === zl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;
36129
+ if (n === Gl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;
36130
+ if (n === Hl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;
36122
36131
  } else
36123
36132
  return null;
36124
36133
  if (n === Wl || n === ql || n === jl)
36125
36134
  if (r = e.get("EXT_texture_compression_bptc"), r !== null) {
36126
- if (n === Wl) return a === lt ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;
36135
+ if (n === Wl) return a === ht ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;
36127
36136
  if (n === ql) return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
36128
36137
  if (n === jl) return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
36129
36138
  } else
@@ -36201,7 +36210,7 @@ class vE {
36201
36210
  depthHeight: { value: t.w }
36202
36211
  }
36203
36212
  });
36204
- this.mesh = new zn(new bo(20, 20), n);
36213
+ this.mesh = new Gn(new bo(20, 20), n);
36205
36214
  }
36206
36215
  return this.mesh;
36207
36216
  }
@@ -36289,17 +36298,17 @@ class bE extends ur {
36289
36298
  if (s = $, s !== null) {
36290
36299
  if (C = e.getRenderTarget(), s.addEventListener("select", K), s.addEventListener("selectstart", K), s.addEventListener("selectend", K), s.addEventListener("squeeze", K), s.addEventListener("squeezestart", K), s.addEventListener("squeezeend", K), s.addEventListener("end", H), s.addEventListener("inputsourceschange", W), x.xrCompatible !== !0 && await t.makeXRCompatible(), k = e.getPixelRatio(), e.getSize(A), v && "createProjectionLayer" in XRWebGLBinding.prototype) {
36291
36300
  let Te = null, Ve = null, Me = null;
36292
- x.depth && (Me = x.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, Te = x.stencil ? ms : wi, Ve = x.stencil ? Xr : si);
36301
+ x.depth && (Me = x.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, Te = x.stencil ? ms : Ai, Ve = x.stencil ? Xr : ri);
36293
36302
  const et = {
36294
36303
  colorFormat: t.RGBA8,
36295
36304
  depthFormat: Me,
36296
36305
  scaleFactor: r
36297
36306
  };
36298
- u = this.getBinding(), h = u.createProjectionLayer(et), s.updateRenderState({ layers: [h] }), e.setPixelRatio(1), e.setSize(h.textureWidth, h.textureHeight, !1), b = new ei(
36307
+ u = this.getBinding(), h = u.createProjectionLayer(et), s.updateRenderState({ layers: [h] }), e.setPixelRatio(1), e.setSize(h.textureWidth, h.textureHeight, !1), b = new ti(
36299
36308
  h.textureWidth,
36300
36309
  h.textureHeight,
36301
36310
  {
36302
- format: Bn,
36311
+ format: Vn,
36303
36312
  type: Mn,
36304
36313
  depthTexture: new Kr(h.textureWidth, h.textureHeight, Ve, void 0, void 0, void 0, void 0, void 0, void 0, Te),
36305
36314
  stencilBuffer: x.stencil,
@@ -36317,11 +36326,11 @@ class bE extends ur {
36317
36326
  stencil: x.stencil,
36318
36327
  framebufferScaleFactor: r
36319
36328
  };
36320
- f = new XRWebGLLayer(s, t, Te), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), b = new ei(
36329
+ f = new XRWebGLLayer(s, t, Te), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), b = new ti(
36321
36330
  f.framebufferWidth,
36322
36331
  f.framebufferHeight,
36323
36332
  {
36324
- format: Bn,
36333
+ format: Vn,
36325
36334
  type: Mn,
36326
36335
  colorSpace: e.outputColorSpace,
36327
36336
  stencilBuffer: x.stencil,
@@ -36364,11 +36373,11 @@ class bE extends ur {
36364
36373
  const ee = new B(), ge = new B();
36365
36374
  function le($, ne, Te) {
36366
36375
  ee.setFromMatrixPosition(ne.matrixWorld), ge.setFromMatrixPosition(Te.matrixWorld);
36367
- const Ve = ee.distanceTo(ge), Me = ne.projectionMatrix.elements, et = Te.projectionMatrix.elements, Wt = Me[14] / (Me[10] - 1), Ze = Me[14] / (Me[10] + 1), at = (Me[9] + 1) / Me[5], gt = (Me[9] - 1) / Me[5], He = (Me[8] - 1) / Me[0], Nt = (et[8] + 1) / et[0], I = Wt * He, Ut = Wt * Nt, rt = Ve / (-He + Nt), xt = rt * -He;
36376
+ const Ve = ee.distanceTo(ge), Me = ne.projectionMatrix.elements, et = Te.projectionMatrix.elements, Wt = Me[14] / (Me[10] - 1), Ze = Me[14] / (Me[10] + 1), lt = (Me[9] + 1) / Me[5], _t = (Me[9] - 1) / Me[5], He = (Me[8] - 1) / Me[0], Nt = (et[8] + 1) / et[0], I = Wt * He, Ut = Wt * Nt, rt = Ve / (-He + Nt), xt = rt * -He;
36368
36377
  if (ne.matrixWorld.decompose($.position, $.quaternion, $.scale), $.translateX(xt), $.translateZ(rt), $.matrixWorld.compose($.position, $.quaternion, $.scale), $.matrixWorldInverse.copy($.matrixWorld).invert(), Me[10] === -1)
36369
36378
  $.projectionMatrix.copy(ne.projectionMatrix), $.projectionMatrixInverse.copy(ne.projectionMatrixInverse);
36370
36379
  else {
36371
- const Ae = Wt + rt, w = Ze + rt, _ = I - xt, L = Ut + (Ve - xt), X = at * Ze / w * Ae, Q = gt * Ze / w * Ae;
36380
+ const Ae = Wt + rt, w = Ze + rt, _ = I - xt, L = Ut + (Ve - xt), X = lt * Ze / w * Ae, Q = _t * Ze / w * Ae;
36372
36381
  $.projectionMatrix.makePerspective(_, L, X, Q, Ae, w), $.projectionMatrixInverse.copy($.projectionMatrix).invert();
36373
36382
  }
36374
36383
  }
@@ -36413,20 +36422,20 @@ class bE extends ur {
36413
36422
  let Ve = !1;
36414
36423
  Te.length !== U.cameras.length && (U.cameras.length = 0, Ve = !0);
36415
36424
  for (let Ze = 0; Ze < Te.length; Ze++) {
36416
- const at = Te[Ze];
36417
- let gt = null;
36425
+ const lt = Te[Ze];
36426
+ let _t = null;
36418
36427
  if (f !== null)
36419
- gt = f.getViewport(at);
36428
+ _t = f.getViewport(lt);
36420
36429
  else {
36421
- const Nt = u.getViewSubImage(h, at);
36422
- gt = Nt.viewport, Ze === 0 && (e.setRenderTargetTextures(
36430
+ const Nt = u.getViewSubImage(h, lt);
36431
+ _t = Nt.viewport, Ze === 0 && (e.setRenderTargetTextures(
36423
36432
  b,
36424
36433
  Nt.colorTexture,
36425
36434
  Nt.depthStencilTexture
36426
36435
  ), e.setRenderTarget(b));
36427
36436
  }
36428
36437
  let He = R[Ze];
36429
- He === void 0 && (He = new En(), He.layers.enable(Ze), He.viewport = new Lt(), R[Ze] = He), He.matrix.fromArray(at.transform.matrix), He.matrix.decompose(He.position, He.quaternion, He.scale), He.projectionMatrix.fromArray(at.projectionMatrix), He.projectionMatrixInverse.copy(He.projectionMatrix).invert(), He.viewport.set(gt.x, gt.y, gt.width, gt.height), Ze === 0 && (U.matrix.copy(He.matrix), U.matrix.decompose(U.position, U.quaternion, U.scale)), Ve === !0 && U.cameras.push(He);
36438
+ He === void 0 && (He = new En(), He.layers.enable(Ze), He.viewport = new Lt(), R[Ze] = He), He.matrix.fromArray(lt.transform.matrix), He.matrix.decompose(He.position, He.quaternion, He.scale), He.projectionMatrix.fromArray(lt.projectionMatrix), He.projectionMatrixInverse.copy(He.projectionMatrix).invert(), He.viewport.set(_t.x, _t.y, _t.width, _t.height), Ze === 0 && (U.matrix.copy(He.matrix), U.matrix.decompose(U.position, U.quaternion, U.scale)), Ve === !0 && U.cameras.push(He);
36430
36439
  }
36431
36440
  const Me = s.enabledFeatures;
36432
36441
  if (Me && Me.includes("depth-sensing") && s.depthUsage == "gpu-optimized" && v) {
@@ -36437,12 +36446,12 @@ class bE extends ur {
36437
36446
  if (Me && Me.includes("camera-access") && v) {
36438
36447
  e.state.unbindTexture(), u = n.getBinding();
36439
36448
  for (let Ze = 0; Ze < Te.length; Ze++) {
36440
- const at = Te[Ze].camera;
36441
- if (at) {
36442
- let gt = p[at];
36443
- gt || (gt = new Pm(), p[at] = gt);
36444
- const He = u.getCameraImage(at);
36445
- gt.sourceTexture = He;
36449
+ const lt = Te[Ze].camera;
36450
+ if (lt) {
36451
+ let _t = p[lt];
36452
+ _t || (_t = new Pm(), p[lt] = _t);
36453
+ const He = u.getCameraImage(lt);
36454
+ _t.sourceTexture = He;
36446
36455
  }
36447
36456
  }
36448
36457
  }
@@ -36460,7 +36469,7 @@ class bE extends ur {
36460
36469
  };
36461
36470
  }
36462
36471
  }
36463
- const os = /* @__PURE__ */ new Ai(), _E = /* @__PURE__ */ new Vt();
36472
+ const os = /* @__PURE__ */ new Ri(), _E = /* @__PURE__ */ new Vt();
36464
36473
  function yE(i, e) {
36465
36474
  function t(m, p) {
36466
36475
  m.matrixAutoUpdate === !0 && m.updateMatrix(), p.value.copy(m.matrix);
@@ -37130,9 +37139,9 @@ const xE = new Uint16Array([
37130
37139
  13702,
37131
37140
  1183
37132
37141
  ]);
37133
- let Wn = null;
37142
+ let qn = null;
37134
37143
  function TE() {
37135
- return Wn === null && (Wn = new _y(xE, 16, 16, cr, Mi), Wn.name = "DFG_LUT", Wn.minFilter = Qt, Wn.magFilter = Qt, Wn.wrapS = Si, Wn.wrapT = Si, Wn.generateMipmaps = !1, Wn.needsUpdate = !0), Wn;
37144
+ return qn === null && (qn = new _y(xE, 16, 16, cr, wi), qn.name = "DFG_LUT", qn.minFilter = Qt, qn.magFilter = Qt, qn.wrapS = xi, qn.wrapT = xi, qn.generateMipmaps = !1, qn.needsUpdate = !0), qn;
37136
37145
  }
37137
37146
  class CE {
37138
37147
  /**
@@ -37169,7 +37178,7 @@ class CE {
37169
37178
  Dd
37170
37179
  ]), p = /* @__PURE__ */ new Set([
37171
37180
  Mn,
37172
- si,
37181
+ ri,
37173
37182
  jr,
37174
37183
  Xr,
37175
37184
  kd,
@@ -37189,7 +37198,7 @@ class CE {
37189
37198
  * @type {?Function}
37190
37199
  */
37191
37200
  onShaderError: null
37192
- }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = Qn, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
37201
+ }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = ei, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
37193
37202
  const y = this;
37194
37203
  let T = !1;
37195
37204
  this._outputColorSpace = Cn;
@@ -37202,7 +37211,7 @@ class CE {
37202
37211
  let Te = !1;
37203
37212
  const Ve = new Rm();
37204
37213
  let Me = !1, et = !1;
37205
- const Wt = new Vt(), Ze = new B(), at = new Lt(), gt = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
37214
+ const Wt = new Vt(), Ze = new B(), lt = new Lt(), _t = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
37206
37215
  let He = !1;
37207
37216
  function Nt() {
37208
37217
  return F === null ? Fe : 1;
@@ -37222,7 +37231,7 @@ class CE {
37222
37231
  powerPreference: d,
37223
37232
  failIfMajorPerformanceCaveat: u
37224
37233
  };
37225
- if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${Rd}`), t.addEventListener("webglcontextlost", Ue, !1), t.addEventListener("webglcontextrestored", Tt, !1), t.addEventListener("webglcontextcreationerror", ot, !1), I === null) {
37234
+ if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${Rd}`), t.addEventListener("webglcontextlost", Ue, !1), t.addEventListener("webglcontextrestored", Tt, !1), t.addEventListener("webglcontextcreationerror", dt, !1), I === null) {
37226
37235
  const N = "webgl2";
37227
37236
  if (I = Ut(N, E), I === null)
37228
37237
  throw Ut(N) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
@@ -37323,7 +37332,7 @@ class CE {
37323
37332
  }, this.clearStencil = function() {
37324
37333
  this.clear(!1, !1, !0);
37325
37334
  }, this.dispose = function() {
37326
- t.removeEventListener("webglcontextlost", Ue, !1), t.removeEventListener("webglcontextrestored", Tt, !1), t.removeEventListener("webglcontextcreationerror", ot, !1), he.dispose(), se.dispose(), fe.dispose(), _.dispose(), X.dispose(), Q.dispose(), ue.dispose(), Se.dispose(), ie.dispose(), we.dispose(), de.dispose(), de.removeEventListener("sessionstart", Xd), de.removeEventListener("sessionend", $d), Qi.stop();
37335
+ t.removeEventListener("webglcontextlost", Ue, !1), t.removeEventListener("webglcontextrestored", Tt, !1), t.removeEventListener("webglcontextcreationerror", dt, !1), he.dispose(), se.dispose(), fe.dispose(), _.dispose(), X.dispose(), Q.dispose(), ue.dispose(), Se.dispose(), ie.dispose(), we.dispose(), de.dispose(), de.removeEventListener("sessionstart", Xd), de.removeEventListener("sessionend", $d), Qi.stop();
37327
37336
  };
37328
37337
  function Ue(E) {
37329
37338
  E.preventDefault(), _h("WebGLRenderer: Context Lost."), T = !0;
@@ -37333,14 +37342,14 @@ class CE {
37333
37342
  const E = w.autoReset, N = Re.enabled, G = Re.autoUpdate, V = Re.needsUpdate, O = Re.type;
37334
37343
  Y(), w.autoReset = E, Re.enabled = N, Re.autoUpdate = G, Re.needsUpdate = V, Re.type = O;
37335
37344
  }
37336
- function ot(E) {
37345
+ function dt(E) {
37337
37346
  nt("WebGLRenderer: A WebGL context could not be created. Reason: ", E.statusMessage);
37338
37347
  }
37339
- function Hn(E) {
37348
+ function Wn(E) {
37340
37349
  const N = E.target;
37341
- N.removeEventListener("dispose", Hn), ai(N);
37350
+ N.removeEventListener("dispose", Wn), oi(N);
37342
37351
  }
37343
- function ai(E) {
37352
+ function oi(E) {
37344
37353
  Om(E), _.remove(E);
37345
37354
  }
37346
37355
  function Om(E) {
@@ -37350,7 +37359,7 @@ class CE {
37350
37359
  }), E.isShaderMaterial && we.releaseShaderCache(E));
37351
37360
  }
37352
37361
  this.renderBufferDirect = function(E, N, G, V, O, pe) {
37353
- N === null && (N = gt);
37362
+ N === null && (N = _t);
37354
37363
  const xe = O.isMesh && O.matrixWorld.determinant() < 0, ve = Bm(E, N, G, V, O);
37355
37364
  Ae.setMaterial(V, xe);
37356
37365
  let Ce = G.index, ke = 1;
@@ -37364,33 +37373,33 @@ class CE {
37364
37373
  const At = pt - je;
37365
37374
  if (At < 0 || At === 1 / 0) return;
37366
37375
  Se.setup(O, V, ve, G, Ce);
37367
- let Rt, vt = D;
37368
- if (Ce !== null && (Rt = j.get(Ce), vt = _e, vt.setIndex(Rt)), O.isMesh)
37369
- V.wireframe === !0 ? (Ae.setLineWidth(V.wireframeLinewidth * Nt()), vt.setMode(I.LINES)) : vt.setMode(I.TRIANGLES);
37376
+ let Rt, yt = D;
37377
+ if (Ce !== null && (Rt = j.get(Ce), yt = _e, yt.setIndex(Rt)), O.isMesh)
37378
+ V.wireframe === !0 ? (Ae.setLineWidth(V.wireframeLinewidth * Nt()), yt.setMode(I.LINES)) : yt.setMode(I.TRIANGLES);
37370
37379
  else if (O.isLine) {
37371
37380
  let De = V.linewidth;
37372
- De === void 0 && (De = 1), Ae.setLineWidth(De * Nt()), O.isLineSegments ? vt.setMode(I.LINES) : O.isLineLoop ? vt.setMode(I.LINE_LOOP) : vt.setMode(I.LINE_STRIP);
37373
- } else O.isPoints ? vt.setMode(I.POINTS) : O.isSprite && vt.setMode(I.TRIANGLES);
37381
+ De === void 0 && (De = 1), Ae.setLineWidth(De * Nt()), O.isLineSegments ? yt.setMode(I.LINES) : O.isLineLoop ? yt.setMode(I.LINE_LOOP) : yt.setMode(I.LINE_STRIP);
37382
+ } else O.isPoints ? yt.setMode(I.POINTS) : O.isSprite && yt.setMode(I.TRIANGLES);
37374
37383
  if (O.isBatchedMesh)
37375
37384
  if (O._multiDrawInstances !== null)
37376
- $r("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), vt.renderMultiDrawInstances(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount, O._multiDrawInstances);
37385
+ $r("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), yt.renderMultiDrawInstances(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount, O._multiDrawInstances);
37377
37386
  else if (rt.get("WEBGL_multi_draw"))
37378
- vt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37387
+ yt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37379
37388
  else {
37380
- const De = O._multiDrawStarts, ct = O._multiDrawCounts, tt = O._multiDrawCount, pn = Ce ? j.get(Ce).bytesPerElement : 1, Es = _.get(V).currentProgram.getUniforms();
37389
+ const De = O._multiDrawStarts, ut = O._multiDrawCounts, tt = O._multiDrawCount, pn = Ce ? j.get(Ce).bytesPerElement : 1, Es = _.get(V).currentProgram.getUniforms();
37381
37390
  for (let mn = 0; mn < tt; mn++)
37382
- Es.setValue(I, "_gl_DrawID", mn), vt.render(De[mn] / pn, ct[mn]);
37391
+ Es.setValue(I, "_gl_DrawID", mn), yt.render(De[mn] / pn, ut[mn]);
37383
37392
  }
37384
37393
  else if (O.isInstancedMesh)
37385
- vt.renderInstances(je, At, O.count);
37394
+ yt.renderInstances(je, At, O.count);
37386
37395
  else if (G.isInstancedBufferGeometry) {
37387
- const De = G._maxInstanceCount !== void 0 ? G._maxInstanceCount : 1 / 0, ct = Math.min(G.instanceCount, De);
37388
- vt.renderInstances(je, At, ct);
37396
+ const De = G._maxInstanceCount !== void 0 ? G._maxInstanceCount : 1 / 0, ut = Math.min(G.instanceCount, De);
37397
+ yt.renderInstances(je, At, ut);
37389
37398
  } else
37390
- vt.render(je, At);
37399
+ yt.render(je, At);
37391
37400
  };
37392
37401
  function jd(E, N, G) {
37393
- E.transparent === !0 && E.side === yi && E.forceSinglePass === !1 ? (E.side = nn, E.needsUpdate = !0, ia(E, N, G), E.side = Ei, E.needsUpdate = !0, ia(E, N, G), E.side = yi) : ia(E, N, G);
37402
+ E.transparent === !0 && E.side === Si && E.forceSinglePass === !1 ? (E.side = nn, E.needsUpdate = !0, ia(E, N, G), E.side = Mi, E.needsUpdate = !0, ia(E, N, G), E.side = Si) : ia(E, N, G);
37394
37403
  }
37395
37404
  this.compile = function(E, N, G = null) {
37396
37405
  G === null && (G = E), S = fe.get(G), S.init(N), A.push(S), G.traverseVisible(function(O) {
@@ -37447,7 +37456,7 @@ class CE {
37447
37456
  }
37448
37457
  if (T === !0) return;
37449
37458
  const G = de.enabled === !0 && de.isPresenting === !0, V = k !== null && (F === null || G) && k.begin(y, F);
37450
- if (E.matrixWorldAutoUpdate === !0 && E.updateMatrixWorld(), N.parent === null && N.matrixWorldAutoUpdate === !0 && N.updateMatrixWorld(), de.enabled === !0 && de.isPresenting === !0 && (k === null || k.isCompositing() === !1) && (de.cameraAutoUpdate === !0 && de.updateCamera(N), N = de.getCamera()), E.isScene === !0 && E.onBeforeRender(y, E, N, F), S = fe.get(E, A.length), S.init(N), A.push(S), Wt.multiplyMatrices(N.projectionMatrix, N.matrixWorldInverse), Ve.setFromProjectionMatrix(Wt, Jn, N.reversedDepth), et = this.localClippingEnabled, Me = Ee.init(this.clippingPlanes, et), b = se.get(E, M.length), b.init(), M.push(b), de.enabled === !0 && de.isPresenting === !0) {
37459
+ if (E.matrixWorldAutoUpdate === !0 && E.updateMatrixWorld(), N.parent === null && N.matrixWorldAutoUpdate === !0 && N.updateMatrixWorld(), de.enabled === !0 && de.isPresenting === !0 && (k === null || k.isCompositing() === !1) && (de.cameraAutoUpdate === !0 && de.updateCamera(N), N = de.getCamera()), E.isScene === !0 && E.onBeforeRender(y, E, N, F), S = fe.get(E, A.length), S.init(N), A.push(S), Wt.multiplyMatrices(N.projectionMatrix, N.matrixWorldInverse), Ve.setFromProjectionMatrix(Wt, Zn, N.reversedDepth), et = this.localClippingEnabled, Me = Ee.init(this.clippingPlanes, et), b = se.get(E, M.length), b.init(), M.push(b), de.enabled === !0 && de.isPresenting === !0) {
37451
37460
  const xe = y.xr.getDepthSensingMesh();
37452
37461
  xe !== null && To(xe, N, -1 / 0, y.sortObjects);
37453
37462
  }
@@ -37483,19 +37492,19 @@ class CE {
37483
37492
  S.pushLight(E), E.castShadow && S.pushShadow(E);
37484
37493
  else if (E.isSprite) {
37485
37494
  if (!E.frustumCulled || Ve.intersectsSprite(E)) {
37486
- V && at.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Wt);
37495
+ V && lt.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Wt);
37487
37496
  const xe = ue.update(E), ve = E.material;
37488
- ve.visible && b.push(E, xe, ve, G, at.z, null);
37497
+ ve.visible && b.push(E, xe, ve, G, lt.z, null);
37489
37498
  }
37490
37499
  } else if ((E.isMesh || E.isLine || E.isPoints) && (!E.frustumCulled || Ve.intersectsObject(E))) {
37491
37500
  const xe = ue.update(E), ve = E.material;
37492
- if (V && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), at.copy(E.boundingSphere.center)) : (xe.boundingSphere === null && xe.computeBoundingSphere(), at.copy(xe.boundingSphere.center)), at.applyMatrix4(E.matrixWorld).applyMatrix4(Wt)), Array.isArray(ve)) {
37501
+ if (V && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), lt.copy(E.boundingSphere.center)) : (xe.boundingSphere === null && xe.computeBoundingSphere(), lt.copy(xe.boundingSphere.center)), lt.applyMatrix4(E.matrixWorld).applyMatrix4(Wt)), Array.isArray(ve)) {
37493
37502
  const Ce = xe.groups;
37494
37503
  for (let ke = 0, Le = Ce.length; ke < Le; ke++) {
37495
37504
  const Ie = Ce[ke], je = ve[Ie.materialIndex];
37496
- je && je.visible && b.push(E, xe, je, G, at.z, Ie);
37505
+ je && je.visible && b.push(E, xe, je, G, lt.z, Ie);
37497
37506
  }
37498
- } else ve.visible && b.push(E, xe, ve, G, at.z, null);
37507
+ } else ve.visible && b.push(E, xe, ve, G, lt.z, null);
37499
37508
  }
37500
37509
  }
37501
37510
  const pe = E.children;
@@ -37511,9 +37520,9 @@ class CE {
37511
37520
  return;
37512
37521
  if (S.state.transmissionRenderTarget[V.id] === void 0) {
37513
37522
  const je = rt.has("EXT_color_buffer_half_float") || rt.has("EXT_color_buffer_float");
37514
- S.state.transmissionRenderTarget[V.id] = new ei(1, 1, {
37523
+ S.state.transmissionRenderTarget[V.id] = new ti(1, 1, {
37515
37524
  generateMipmaps: !0,
37516
- type: je ? Mi : Mn,
37525
+ type: je ? wi : Mn,
37517
37526
  minFilter: ps,
37518
37527
  samples: xt.samples,
37519
37528
  stencilBuffer: r,
@@ -37527,15 +37536,15 @@ class CE {
37527
37536
  const ve = y.getRenderTarget(), Ce = y.getActiveCubeFace(), ke = y.getActiveMipmapLevel();
37528
37537
  y.setRenderTarget(pe), y.getClearColor(ge), le = y.getClearAlpha(), le < 1 && y.setClearColor(16777215, 0.5), y.clear(), He && he.render(G);
37529
37538
  const Le = y.toneMapping;
37530
- y.toneMapping = Qn;
37539
+ y.toneMapping = ei;
37531
37540
  const Ie = V.viewport;
37532
37541
  if (V.viewport !== void 0 && (V.viewport = void 0), S.setupLightsView(V), Me === !0 && Ee.setGlobalState(y.clippingPlanes, V), na(E, G, V), L.updateMultisampleRenderTarget(pe), L.updateRenderTargetMipmap(pe), rt.has("WEBGL_multisampled_render_to_texture") === !1) {
37533
37542
  let je = !1;
37534
37543
  for (let pt = 0, At = N.length; pt < At; pt++) {
37535
- const Rt = N[pt], { object: vt, geometry: De, material: ct, group: tt } = Rt;
37536
- if (ct.side === yi && vt.layers.test(V.layers)) {
37537
- const pn = ct.side;
37538
- ct.side = nn, ct.needsUpdate = !0, Jd(vt, G, V, De, ct, tt), ct.side = pn, ct.needsUpdate = !0, je = !0;
37544
+ const Rt = N[pt], { object: yt, geometry: De, material: ut, group: tt } = Rt;
37545
+ if (ut.side === Si && yt.layers.test(V.layers)) {
37546
+ const pn = ut.side;
37547
+ ut.side = nn, ut.needsUpdate = !0, Jd(yt, G, V, De, ut, tt), ut.side = pn, ut.needsUpdate = !0, je = !0;
37539
37548
  }
37540
37549
  }
37541
37550
  je === !0 && (L.updateMultisampleRenderTarget(pe), L.updateRenderTargetMipmap(pe));
@@ -37551,13 +37560,13 @@ class CE {
37551
37560
  }
37552
37561
  }
37553
37562
  function Jd(E, N, G, V, O, pe) {
37554
- E.onBeforeRender(y, N, G, V, O, pe), E.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse, E.matrixWorld), E.normalMatrix.getNormalMatrix(E.modelViewMatrix), O.onBeforeRender(y, N, G, V, E, pe), O.transparent === !0 && O.side === yi && O.forceSinglePass === !1 ? (O.side = nn, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = Ei, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = yi) : y.renderBufferDirect(G, N, V, O, E, pe), E.onAfterRender(y, N, G, V, O, pe);
37563
+ E.onBeforeRender(y, N, G, V, O, pe), E.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse, E.matrixWorld), E.normalMatrix.getNormalMatrix(E.modelViewMatrix), O.onBeforeRender(y, N, G, V, E, pe), O.transparent === !0 && O.side === Si && O.forceSinglePass === !1 ? (O.side = nn, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = Mi, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = Si) : y.renderBufferDirect(G, N, V, O, E, pe), E.onAfterRender(y, N, G, V, O, pe);
37555
37564
  }
37556
37565
  function ia(E, N, G) {
37557
- N.isScene !== !0 && (N = gt);
37566
+ N.isScene !== !0 && (N = _t);
37558
37567
  const V = _.get(E), O = S.state.lights, pe = S.state.shadowsArray, xe = O.state.version, ve = we.getParameters(E, O.state, pe, N, G), Ce = we.getProgramCacheKey(ve);
37559
37568
  let ke = V.programs;
37560
- V.environment = E.isMeshStandardMaterial ? N.environment : null, V.fog = N.fog, V.envMap = (E.isMeshStandardMaterial ? Q : X).get(E.envMap || V.environment), V.envMapRotation = V.environment !== null && E.envMap === null ? N.environmentRotation : E.envMapRotation, ke === void 0 && (E.addEventListener("dispose", Hn), ke = /* @__PURE__ */ new Map(), V.programs = ke);
37569
+ V.environment = E.isMeshStandardMaterial ? N.environment : null, V.fog = N.fog, V.envMap = (E.isMeshStandardMaterial ? Q : X).get(E.envMap || V.environment), V.envMapRotation = V.environment !== null && E.envMap === null ? N.environmentRotation : E.envMapRotation, ke === void 0 && (E.addEventListener("dispose", Wn), ke = /* @__PURE__ */ new Map(), V.programs = ke);
37561
37570
  let Le = ke.get(Ce);
37562
37571
  if (Le !== void 0) {
37563
37572
  if (V.currentProgram === Le && V.lightsStateVersion === xe)
@@ -37579,17 +37588,17 @@ class CE {
37579
37588
  G.outputColorSpace = N.outputColorSpace, G.batching = N.batching, G.batchingColor = N.batchingColor, G.instancing = N.instancing, G.instancingColor = N.instancingColor, G.instancingMorph = N.instancingMorph, G.skinning = N.skinning, G.morphTargets = N.morphTargets, G.morphNormals = N.morphNormals, G.morphColors = N.morphColors, G.morphTargetsCount = N.morphTargetsCount, G.numClippingPlanes = N.numClippingPlanes, G.numIntersection = N.numClipIntersection, G.vertexAlphas = N.vertexAlphas, G.vertexTangents = N.vertexTangents, G.toneMapping = N.toneMapping;
37580
37589
  }
37581
37590
  function Bm(E, N, G, V, O) {
37582
- N.isScene !== !0 && (N = gt), L.resetTextureUnits();
37591
+ N.isScene !== !0 && (N = _t), L.resetTextureUnits();
37583
37592
  const pe = N.fog, xe = V.isMeshStandardMaterial ? N.environment : null, ve = F === null ? y.outputColorSpace : F.isXRRenderTarget === !0 ? F.texture.colorSpace : lr, Ce = (V.isMeshStandardMaterial ? Q : X).get(V.envMap || xe), ke = V.vertexColors === !0 && !!G.attributes.color && G.attributes.color.itemSize === 4, Le = !!G.attributes.tangent && (!!V.normalMap || V.anisotropy > 0), Ie = !!G.morphAttributes.position, je = !!G.morphAttributes.normal, pt = !!G.morphAttributes.color;
37584
- let At = Qn;
37593
+ let At = ei;
37585
37594
  V.toneMapped && (F === null || F.isXRRenderTarget === !0) && (At = y.toneMapping);
37586
- const Rt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, vt = Rt !== void 0 ? Rt.length : 0, De = _.get(V), ct = S.state.lights;
37595
+ const Rt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, yt = Rt !== void 0 ? Rt.length : 0, De = _.get(V), ut = S.state.lights;
37587
37596
  if (Me === !0 && (et === !0 || E !== K)) {
37588
37597
  const en = E === K && V.id === q;
37589
37598
  Ee.setState(V, E, en);
37590
37599
  }
37591
37600
  let tt = !1;
37592
- V.version === De.__version ? (De.needsLights && De.lightsStateVersion !== ct.state.version || De.outputColorSpace !== ve || O.isBatchedMesh && De.batching === !1 || !O.isBatchedMesh && De.batching === !0 || O.isBatchedMesh && De.batchingColor === !0 && O.colorTexture === null || O.isBatchedMesh && De.batchingColor === !1 && O.colorTexture !== null || O.isInstancedMesh && De.instancing === !1 || !O.isInstancedMesh && De.instancing === !0 || O.isSkinnedMesh && De.skinning === !1 || !O.isSkinnedMesh && De.skinning === !0 || O.isInstancedMesh && De.instancingColor === !0 && O.instanceColor === null || O.isInstancedMesh && De.instancingColor === !1 && O.instanceColor !== null || O.isInstancedMesh && De.instancingMorph === !0 && O.morphTexture === null || O.isInstancedMesh && De.instancingMorph === !1 && O.morphTexture !== null || De.envMap !== Ce || V.fog === !0 && De.fog !== pe || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ee.numPlanes || De.numIntersection !== Ee.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== je || De.morphColors !== pt || De.toneMapping !== At || De.morphTargetsCount !== vt) && (tt = !0) : (tt = !0, De.__version = V.version);
37601
+ V.version === De.__version ? (De.needsLights && De.lightsStateVersion !== ut.state.version || De.outputColorSpace !== ve || O.isBatchedMesh && De.batching === !1 || !O.isBatchedMesh && De.batching === !0 || O.isBatchedMesh && De.batchingColor === !0 && O.colorTexture === null || O.isBatchedMesh && De.batchingColor === !1 && O.colorTexture !== null || O.isInstancedMesh && De.instancing === !1 || !O.isInstancedMesh && De.instancing === !0 || O.isSkinnedMesh && De.skinning === !1 || !O.isSkinnedMesh && De.skinning === !0 || O.isInstancedMesh && De.instancingColor === !0 && O.instanceColor === null || O.isInstancedMesh && De.instancingColor === !1 && O.instanceColor !== null || O.isInstancedMesh && De.instancingMorph === !0 && O.morphTexture === null || O.isInstancedMesh && De.instancingMorph === !1 && O.morphTexture !== null || De.envMap !== Ce || V.fog === !0 && De.fog !== pe || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ee.numPlanes || De.numIntersection !== Ee.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== je || De.morphColors !== pt || De.toneMapping !== At || De.morphTargetsCount !== yt) && (tt = !0) : (tt = !0, De.__version = V.version);
37593
37602
  let pn = De.currentProgram;
37594
37603
  tt === !0 && (pn = ia(V, N, O));
37595
37604
  let Es = !1, mn = !1, fr = !1;
@@ -37603,7 +37612,7 @@ class CE {
37603
37612
  2 / (Math.log(E.far + 1) / Math.LN2)
37604
37613
  ), (V.isMeshPhongMaterial || V.isMeshToonMaterial || V.isMeshLambertMaterial || V.isMeshBasicMaterial || V.isMeshStandardMaterial || V.isShaderMaterial) && Ct.setValue(I, "isOrthographic", E.isOrthographicCamera === !0), K !== E && (K = E, mn = !0, fr = !0);
37605
37614
  }
37606
- if (De.needsLights && (ct.state.directionalShadowMap.length > 0 && Ct.setValue(I, "directionalShadowMap", ct.state.directionalShadowMap, L), ct.state.spotShadowMap.length > 0 && Ct.setValue(I, "spotShadowMap", ct.state.spotShadowMap, L), ct.state.pointShadowMap.length > 0 && Ct.setValue(I, "pointShadowMap", ct.state.pointShadowMap, L)), O.isSkinnedMesh) {
37615
+ if (De.needsLights && (ut.state.directionalShadowMap.length > 0 && Ct.setValue(I, "directionalShadowMap", ut.state.directionalShadowMap, L), ut.state.spotShadowMap.length > 0 && Ct.setValue(I, "spotShadowMap", ut.state.spotShadowMap, L), ut.state.pointShadowMap.length > 0 && Ct.setValue(I, "pointShadowMap", ut.state.pointShadowMap, L)), O.isSkinnedMesh) {
37607
37616
  Ct.setOptional(I, O, "bindMatrix"), Ct.setOptional(I, O, "bindMatrixInverse");
37608
37617
  const en = O.skeleton;
37609
37618
  en && (en.boneTexture === null && en.computeBoneTexture(), Ct.setValue(I, "boneTexture", en.boneTexture, L));
@@ -37739,9 +37748,9 @@ class CE {
37739
37748
  xe = Math.floor(Rt.width * xn), ve = Math.floor(Rt.height * xn), E.isDataArrayTexture ? Ce = Rt.depth : E.isData3DTexture ? Ce = Math.floor(Rt.depth * xn) : Ce = 1, ke = 0, Le = 0, Ie = 0;
37740
37749
  }
37741
37750
  V !== null ? (je = V.x, pt = V.y, At = V.z) : (je = 0, pt = 0, At = 0);
37742
- const vt = ae.convert(N.format), De = ae.convert(N.type);
37743
- let ct;
37744
- N.isData3DTexture ? (L.setTexture3D(N, 0), ct = I.TEXTURE_3D) : N.isDataArrayTexture || N.isCompressedArrayTexture ? (L.setTexture2DArray(N, 0), ct = I.TEXTURE_2D_ARRAY) : (L.setTexture2D(N, 0), ct = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, N.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, N.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, N.unpackAlignment);
37751
+ const yt = ae.convert(N.format), De = ae.convert(N.type);
37752
+ let ut;
37753
+ N.isData3DTexture ? (L.setTexture3D(N, 0), ut = I.TEXTURE_3D) : N.isDataArrayTexture || N.isCompressedArrayTexture ? (L.setTexture2DArray(N, 0), ut = I.TEXTURE_2D_ARRAY) : (L.setTexture2D(N, 0), ut = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, N.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, N.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, N.unpackAlignment);
37745
37754
  const tt = I.getParameter(I.UNPACK_ROW_LENGTH), pn = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Es = I.getParameter(I.UNPACK_SKIP_PIXELS), mn = I.getParameter(I.UNPACK_SKIP_ROWS), fr = I.getParameter(I.UNPACK_SKIP_IMAGES);
37746
37755
  I.pixelStorei(I.UNPACK_ROW_LENGTH, Rt.width), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Rt.height), I.pixelStorei(I.UNPACK_SKIP_PIXELS, ke), I.pixelStorei(I.UNPACK_SKIP_ROWS, Le), I.pixelStorei(I.UNPACK_SKIP_IMAGES, Ie);
37747
37756
  const Ct = E.isDataArrayTexture || E.isData3DTexture, an = N.isDataArrayTexture || N.isData3DTexture;
@@ -37755,11 +37764,11 @@ class CE {
37755
37764
  const xn = _.get(E), en = _.get(N);
37756
37765
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, Hm), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, Wm);
37757
37766
  for (let on = 0; on < Ce; on++)
37758
- Ct ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, xn.__webglTexture, O, Ie + on) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, xn.__webglTexture, O), an ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, en.__webglTexture, pe, At + on) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, en.__webglTexture, pe), O !== 0 ? I.blitFramebuffer(ke, Le, xe, ve, je, pt, xe, ve, I.COLOR_BUFFER_BIT, I.NEAREST) : an ? I.copyTexSubImage3D(ct, pe, je, pt, At + on, ke, Le, xe, ve) : I.copyTexSubImage2D(ct, pe, je, pt, ke, Le, xe, ve);
37767
+ Ct ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, xn.__webglTexture, O, Ie + on) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, xn.__webglTexture, O), an ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, en.__webglTexture, pe, At + on) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, en.__webglTexture, pe), O !== 0 ? I.blitFramebuffer(ke, Le, xe, ve, je, pt, xe, ve, I.COLOR_BUFFER_BIT, I.NEAREST) : an ? I.copyTexSubImage3D(ut, pe, je, pt, At + on, ke, Le, xe, ve) : I.copyTexSubImage2D(ut, pe, je, pt, ke, Le, xe, ve);
37759
37768
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, null), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, null);
37760
37769
  } else
37761
- an ? E.isDataTexture || E.isData3DTexture ? I.texSubImage3D(ct, pe, je, pt, At, xe, ve, Ce, vt, De, Rt.data) : N.isCompressedArrayTexture ? I.compressedTexSubImage3D(ct, pe, je, pt, At, xe, ve, Ce, vt, Rt.data) : I.texSubImage3D(ct, pe, je, pt, At, xe, ve, Ce, vt, De, Rt) : E.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, vt, De, Rt.data) : E.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, pe, je, pt, Rt.width, Rt.height, vt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, vt, De, Rt);
37762
- I.pixelStorei(I.UNPACK_ROW_LENGTH, tt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, pn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Es), I.pixelStorei(I.UNPACK_SKIP_ROWS, mn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, fr), pe === 0 && N.generateMipmaps && I.generateMipmap(ct), Ae.unbindTexture();
37770
+ an ? E.isDataTexture || E.isData3DTexture ? I.texSubImage3D(ut, pe, je, pt, At, xe, ve, Ce, yt, De, Rt.data) : N.isCompressedArrayTexture ? I.compressedTexSubImage3D(ut, pe, je, pt, At, xe, ve, Ce, yt, Rt.data) : I.texSubImage3D(ut, pe, je, pt, At, xe, ve, Ce, yt, De, Rt) : E.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, yt, De, Rt.data) : E.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, pe, je, pt, Rt.width, Rt.height, yt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, yt, De, Rt);
37771
+ I.pixelStorei(I.UNPACK_ROW_LENGTH, tt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, pn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Es), I.pixelStorei(I.UNPACK_SKIP_ROWS, mn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, fr), pe === 0 && N.generateMipmaps && I.generateMipmap(ut), Ae.unbindTexture();
37763
37772
  }, this.initRenderTarget = function(E) {
37764
37773
  _.get(E).__webglFramebuffer === void 0 && L.setupRenderTarget(E);
37765
37774
  }, this.initTexture = function(E) {
@@ -37778,7 +37787,7 @@ class CE {
37778
37787
  * @readonly
37779
37788
  */
37780
37789
  get coordinateSystem() {
37781
- return Jn;
37790
+ return Zn;
37782
37791
  }
37783
37792
  /**
37784
37793
  * Defines the output color space of the renderer.
@@ -38307,8 +38316,8 @@ class Hd {
38307
38316
  uColorContrast: { value: this.config.colorContrast }
38308
38317
  },
38309
38318
  transparent: !0,
38310
- side: Ei
38311
- }), this.orb = new zn(t, this.orbMaterial), this.scene.add(this.orb);
38319
+ side: Mi
38320
+ }), this.orb = new Gn(t, this.orbMaterial), this.scene.add(this.orb);
38312
38321
  const n = new Gd(
38313
38322
  this.config.size,
38314
38323
  64,
@@ -38330,7 +38339,7 @@ class Hd {
38330
38339
  side: nn,
38331
38340
  blending: rl,
38332
38341
  depthWrite: !1
38333
- }), this.glowMesh = new zn(n, this.glowMaterial), this.scene.add(this.glowMesh);
38342
+ }), this.glowMesh = new Gn(n, this.glowMaterial), this.scene.add(this.glowMesh);
38334
38343
  }
38335
38344
  /**
38336
38345
  * Update audio data with smoothing
@@ -38816,7 +38825,7 @@ class qd {
38816
38825
  this.hasAcquired && (tr.release(), this.hasAcquired = !1);
38817
38826
  }
38818
38827
  }
38819
- const fi = {
38828
+ const pi = {
38820
38829
  default: {
38821
38830
  primary: "#6366f1",
38822
38831
  secondary: "#8b5cf6",
@@ -38894,7 +38903,7 @@ const fi = {
38894
38903
  highlight: "#dbeafe"
38895
38904
  // Light blue
38896
38905
  }
38897
- }, pi = {
38906
+ }, mi = {
38898
38907
  indigo: {
38899
38908
  primary: "#3730a3",
38900
38909
  secondary: "#4338ca",
@@ -38963,93 +38972,93 @@ const fi = {
38963
38972
  }
38964
38973
  };
38965
38974
  function HE(i, e = "dark") {
38966
- const t = e === "dark" ? fi : pi;
38975
+ const t = e === "dark" ? pi : mi;
38967
38976
  return t[i] || t[Object.keys(t)[0]];
38968
38977
  }
38969
38978
  function WE(i = "dark") {
38970
- return Object.keys(i === "dark" ? fi : pi);
38979
+ return Object.keys(i === "dark" ? pi : mi);
38971
38980
  }
38972
38981
  const Yr = {
38973
38982
  default: {
38974
38983
  dark: {
38975
- colors: fi.default,
38984
+ colors: pi.default,
38976
38985
  glowIntensity: 1.2,
38977
38986
  idleGlowMultiplier: 0.6
38978
38987
  },
38979
38988
  light: {
38980
- colors: pi.indigo,
38989
+ colors: mi.indigo,
38981
38990
  glowIntensity: 1.8,
38982
38991
  idleGlowMultiplier: 1.2
38983
38992
  }
38984
38993
  },
38985
38994
  emerald: {
38986
38995
  dark: {
38987
- colors: fi.emerald,
38996
+ colors: pi.emerald,
38988
38997
  glowIntensity: 1.2,
38989
38998
  idleGlowMultiplier: 0.6
38990
38999
  },
38991
39000
  light: {
38992
- colors: pi.teal,
39001
+ colors: mi.teal,
38993
39002
  glowIntensity: 1.8,
38994
39003
  idleGlowMultiplier: 1.2
38995
39004
  }
38996
39005
  },
38997
39006
  rose: {
38998
39007
  dark: {
38999
- colors: fi.rose,
39008
+ colors: pi.rose,
39000
39009
  glowIntensity: 1.2,
39001
39010
  idleGlowMultiplier: 0.6
39002
39011
  },
39003
39012
  light: {
39004
- colors: pi.pink,
39013
+ colors: mi.pink,
39005
39014
  glowIntensity: 1.8,
39006
39015
  idleGlowMultiplier: 1.2
39007
39016
  }
39008
39017
  },
39009
39018
  amber: {
39010
39019
  dark: {
39011
- colors: fi.amber,
39020
+ colors: pi.amber,
39012
39021
  glowIntensity: 1.2,
39013
39022
  idleGlowMultiplier: 0.6
39014
39023
  },
39015
39024
  light: {
39016
- colors: pi.orange,
39025
+ colors: mi.orange,
39017
39026
  glowIntensity: 1.8,
39018
39027
  idleGlowMultiplier: 1.2
39019
39028
  }
39020
39029
  },
39021
39030
  cyan: {
39022
39031
  dark: {
39023
- colors: fi.cyan,
39032
+ colors: pi.cyan,
39024
39033
  glowIntensity: 1.2,
39025
39034
  idleGlowMultiplier: 0.6
39026
39035
  },
39027
39036
  light: {
39028
- colors: pi.blue,
39037
+ colors: mi.blue,
39029
39038
  glowIntensity: 1.8,
39030
39039
  idleGlowMultiplier: 1.2
39031
39040
  }
39032
39041
  },
39033
39042
  purple: {
39034
39043
  dark: {
39035
- colors: fi.purple,
39044
+ colors: pi.purple,
39036
39045
  glowIntensity: 1.2,
39037
39046
  idleGlowMultiplier: 0.6
39038
39047
  },
39039
39048
  light: {
39040
- colors: pi.violet,
39049
+ colors: mi.violet,
39041
39050
  glowIntensity: 1.8,
39042
39051
  idleGlowMultiplier: 1.2
39043
39052
  }
39044
39053
  },
39045
39054
  blue: {
39046
39055
  dark: {
39047
- colors: fi.blue,
39056
+ colors: pi.blue,
39048
39057
  glowIntensity: 1.2,
39049
39058
  idleGlowMultiplier: 0.6
39050
39059
  },
39051
39060
  light: {
39052
- colors: pi.blue,
39061
+ colors: mi.blue,
39053
39062
  glowIntensity: 1.8,
39054
39063
  idleGlowMultiplier: 1.2
39055
39064
  }
@@ -39085,14 +39094,14 @@ function $E(i, e) {
39085
39094
  t.removeEventListener("change", n);
39086
39095
  };
39087
39096
  }
39088
- var IE = Object.defineProperty, DE = Object.getOwnPropertyDescriptor, _t = (i, e, t, n) => {
39097
+ var IE = Object.defineProperty, DE = Object.getOwnPropertyDescriptor, gt = (i, e, t, n) => {
39089
39098
  for (var s = n > 1 ? void 0 : n ? DE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39090
39099
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39091
39100
  return n && s && IE(e, t, s), s;
39092
39101
  };
39093
- let dt = class extends gs {
39102
+ let at = class extends gs {
39094
39103
  constructor() {
39095
- super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.intersectionTimeoutId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39104
+ super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.intersectionTimeoutId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.serviceUnavailable = !1, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39096
39105
  const t = i.detail;
39097
39106
  if (!(!t || !this.audioAnalyzer))
39098
39107
  try {
@@ -39111,9 +39120,9 @@ let dt = class extends gs {
39111
39120
  console.error("Failed to connect local audio stream:", n);
39112
39121
  }
39113
39122
  }, this.handleMicrophoneEnabled = () => {
39114
- this.microphoneEnabled = !0;
39123
+ this.microphoneEnabled = !0, this.microphoneInitialized = !0;
39115
39124
  }, this.handleMicrophoneDisabled = () => {
39116
- this.microphoneEnabled = !1;
39125
+ this.microphoneEnabled = !1, this.microphoneInitialized = !0;
39117
39126
  }, this.handleHealthChange = (i) => {
39118
39127
  const e = i.detail;
39119
39128
  this.serviceUnavailable = e === "unhealthy";
@@ -39132,7 +39141,7 @@ let dt = class extends gs {
39132
39141
  );
39133
39142
  break;
39134
39143
  case "disconnected":
39135
- this.callStatus = "idle", (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39144
+ this.callStatus = "idle", this.microphoneInitialized = !1, (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39136
39145
  var o;
39137
39146
  (o = this.soundManager) == null || o.playCallEndSound();
39138
39147
  }, 150), this.dispatchEvent(
@@ -39568,7 +39577,7 @@ let dt = class extends gs {
39568
39577
  @click=${this.toggleCall}
39569
39578
  ${od(this.orbContainerRef)}
39570
39579
  >
39571
- ${this.callStatus === "connected" && !this.microphoneEnabled ? Xt`
39580
+ ${this.callStatus === "connected" && this.microphoneInitialized && !this.microphoneEnabled ? Xt`
39572
39581
  <div class="microphone-indicator visible">
39573
39582
  <svg viewBox="0 0 24 24" fill="none">
39574
39583
  <path
@@ -39618,101 +39627,104 @@ let dt = class extends gs {
39618
39627
  `;
39619
39628
  }
39620
39629
  };
39621
- dt.styles = nd`
39630
+ at.styles = nd`
39622
39631
  :host {
39623
39632
  display: inline-block;
39624
39633
  contain: layout style;
39625
39634
  }
39626
39635
  `;
39627
- _t([
39636
+ gt([
39628
39637
  ye({ type: String, attribute: "agent-id" })
39629
- ], dt.prototype, "agentId", 2);
39630
- _t([
39638
+ ], at.prototype, "agentId", 2);
39639
+ gt([
39631
39640
  ye({ type: String, attribute: "voice-service-url" })
39632
- ], dt.prototype, "voiceServiceUrl", 2);
39633
- _t([
39634
- Ri()
39635
- ], dt.prototype, "callStatus", 2);
39636
- _t([
39637
- Ri()
39638
- ], dt.prototype, "microphoneEnabled", 2);
39639
- _t([
39640
- Ri()
39641
- ], dt.prototype, "serviceUnavailable", 2);
39642
- _t([
39641
+ ], at.prototype, "voiceServiceUrl", 2);
39642
+ gt([
39643
+ An()
39644
+ ], at.prototype, "callStatus", 2);
39645
+ gt([
39646
+ An()
39647
+ ], at.prototype, "microphoneEnabled", 2);
39648
+ gt([
39649
+ An()
39650
+ ], at.prototype, "microphoneInitialized", 2);
39651
+ gt([
39652
+ An()
39653
+ ], at.prototype, "serviceUnavailable", 2);
39654
+ gt([
39643
39655
  ye({ type: String, attribute: "button-start-text" })
39644
- ], dt.prototype, "buttonStartText", 2);
39645
- _t([
39656
+ ], at.prototype, "buttonStartText", 2);
39657
+ gt([
39646
39658
  ye({ type: String, attribute: "button-connecting-text" })
39647
- ], dt.prototype, "buttonConnectingText", 2);
39648
- _t([
39659
+ ], at.prototype, "buttonConnectingText", 2);
39660
+ gt([
39649
39661
  ye({ type: Number, attribute: "size" })
39650
- ], dt.prototype, "size", 2);
39651
- _t([
39662
+ ], at.prototype, "size", 2);
39663
+ gt([
39652
39664
  ye({ type: Number, attribute: "container-padding" })
39653
- ], dt.prototype, "containerPadding", 2);
39654
- _t([
39665
+ ], at.prototype, "containerPadding", 2);
39666
+ gt([
39655
39667
  ye({ type: String, attribute: "theme", reflect: !0 })
39656
- ], dt.prototype, "theme", 2);
39657
- _t([
39668
+ ], at.prototype, "theme", 2);
39669
+ gt([
39658
39670
  ye({ type: String, attribute: "theme-mode" })
39659
- ], dt.prototype, "themeMode", 2);
39660
- _t([
39671
+ ], at.prototype, "themeMode", 2);
39672
+ gt([
39661
39673
  ye({ type: Object, attribute: "orb-colors" })
39662
- ], dt.prototype, "orbColors", 2);
39663
- _t([
39674
+ ], at.prototype, "orbColors", 2);
39675
+ gt([
39664
39676
  ye({ type: Number, attribute: "glow-intensity" })
39665
- ], dt.prototype, "glowIntensity", 2);
39666
- _t([
39677
+ ], at.prototype, "glowIntensity", 2);
39678
+ gt([
39667
39679
  ye({ type: Number, attribute: "idle-glow-multiplier" })
39668
- ], dt.prototype, "idleGlowMultiplier", 2);
39669
- _t([
39680
+ ], at.prototype, "idleGlowMultiplier", 2);
39681
+ gt([
39670
39682
  ye({ type: Number, attribute: "morph-strength" })
39671
- ], dt.prototype, "morphStrength", 2);
39672
- _t([
39683
+ ], at.prototype, "morphStrength", 2);
39684
+ gt([
39673
39685
  ye({ type: Number, attribute: "noise-scale" })
39674
- ], dt.prototype, "noiseScale", 2);
39675
- _t([
39686
+ ], at.prototype, "noiseScale", 2);
39687
+ gt([
39676
39688
  ye({ type: Number, attribute: "noise-speed" })
39677
- ], dt.prototype, "noiseSpeed", 2);
39678
- _t([
39689
+ ], at.prototype, "noiseSpeed", 2);
39690
+ gt([
39679
39691
  ye({ type: Number, attribute: "fresnel-power" })
39680
- ], dt.prototype, "fresnelPower", 2);
39681
- _t([
39692
+ ], at.prototype, "fresnelPower", 2);
39693
+ gt([
39682
39694
  ye({ type: Number, attribute: "rotation-speed" })
39683
- ], dt.prototype, "rotationSpeed", 2);
39684
- _t([
39695
+ ], at.prototype, "rotationSpeed", 2);
39696
+ gt([
39685
39697
  ye({ type: Number, attribute: "audio-reactivity" })
39686
- ], dt.prototype, "audioReactivity", 2);
39687
- _t([
39698
+ ], at.prototype, "audioReactivity", 2);
39699
+ gt([
39688
39700
  ye({ type: Number, attribute: "audio-smoothing" })
39689
- ], dt.prototype, "audioSmoothing", 2);
39690
- _t([
39701
+ ], at.prototype, "audioSmoothing", 2);
39702
+ gt([
39691
39703
  ye({ type: Number, attribute: "idle-morph-multiplier" })
39692
- ], dt.prototype, "idleMorphMultiplier", 2);
39693
- _t([
39704
+ ], at.prototype, "idleMorphMultiplier", 2);
39705
+ gt([
39694
39706
  ye({ type: Number, attribute: "color-contrast" })
39695
- ], dt.prototype, "colorContrast", 2);
39696
- _t([
39707
+ ], at.prototype, "colorContrast", 2);
39708
+ gt([
39697
39709
  ye({ type: Boolean, attribute: "sound-enabled" })
39698
- ], dt.prototype, "soundEnabled", 2);
39699
- _t([
39710
+ ], at.prototype, "soundEnabled", 2);
39711
+ gt([
39700
39712
  ye({ type: Number, attribute: "sound-volume" })
39701
- ], dt.prototype, "soundVolume", 2);
39702
- _t([
39713
+ ], at.prototype, "soundVolume", 2);
39714
+ gt([
39703
39715
  ye({ type: String, attribute: "sound-preset" })
39704
- ], dt.prototype, "soundPreset", 2);
39705
- dt = _t([
39716
+ ], at.prototype, "soundPreset", 2);
39717
+ at = gt([
39706
39718
  rd("hanc-ai-inline-call")
39707
- ], dt);
39708
- var LE = Object.defineProperty, NE = Object.getOwnPropertyDescriptor, yt = (i, e, t, n) => {
39719
+ ], at);
39720
+ var LE = Object.defineProperty, NE = Object.getOwnPropertyDescriptor, vt = (i, e, t, n) => {
39709
39721
  for (var s = n > 1 ? void 0 : n ? NE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39710
39722
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39711
39723
  return n && s && LE(e, t, s), s;
39712
39724
  };
39713
- let ut = class extends gs {
39725
+ let ot = class extends gs {
39714
39726
  constructor() {
39715
- super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39727
+ super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.serviceUnavailable = !1, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39716
39728
  const t = i.detail;
39717
39729
  if (!(!t || !this.audioAnalyzer))
39718
39730
  try {
@@ -39731,9 +39743,9 @@ let ut = class extends gs {
39731
39743
  console.error("Failed to connect local audio stream:", n);
39732
39744
  }
39733
39745
  }, this.handleMicrophoneEnabled = () => {
39734
- this.microphoneEnabled = !0;
39746
+ this.microphoneEnabled = !0, this.microphoneInitialized = !0;
39735
39747
  }, this.handleMicrophoneDisabled = () => {
39736
- this.microphoneEnabled = !1;
39748
+ this.microphoneEnabled = !1, this.microphoneInitialized = !0;
39737
39749
  }, this.handleHealthChange = (i) => {
39738
39750
  const e = i.detail;
39739
39751
  this.serviceUnavailable = e === "unhealthy";
@@ -39752,7 +39764,7 @@ let ut = class extends gs {
39752
39764
  );
39753
39765
  break;
39754
39766
  case "disconnected":
39755
- this.callStatus = "idle", (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39767
+ this.callStatus = "idle", this.microphoneInitialized = !1, (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39756
39768
  var o;
39757
39769
  (o = this.soundManager) == null || o.playCallEndSound();
39758
39770
  }, 150), this.dispatchEvent(
@@ -40171,7 +40183,7 @@ let ut = class extends gs {
40171
40183
  @click=${this.toggleCall}
40172
40184
  ${od(this.orbContainerRef)}
40173
40185
  >
40174
- ${this.callStatus === "connected" && !this.microphoneEnabled ? Xt`
40186
+ ${this.callStatus === "connected" && this.microphoneInitialized && !this.microphoneEnabled ? Xt`
40175
40187
  <div class="microphone-indicator visible">
40176
40188
  <svg viewBox="0 0 24 24" fill="none">
40177
40189
  <path
@@ -40220,100 +40232,103 @@ let ut = class extends gs {
40220
40232
  `;
40221
40233
  }
40222
40234
  };
40223
- ut.styles = nd`
40235
+ ot.styles = nd`
40224
40236
  :host {
40225
40237
  display: block;
40226
40238
  }
40227
40239
  `;
40228
- yt([
40240
+ vt([
40229
40241
  ye({ type: String, attribute: "agent-id" })
40230
- ], ut.prototype, "agentId", 2);
40231
- yt([
40242
+ ], ot.prototype, "agentId", 2);
40243
+ vt([
40232
40244
  ye({ type: String, attribute: "voice-service-url" })
40233
- ], ut.prototype, "voiceServiceUrl", 2);
40234
- yt([
40235
- Ri()
40236
- ], ut.prototype, "callStatus", 2);
40237
- yt([
40238
- Ri()
40239
- ], ut.prototype, "microphoneEnabled", 2);
40240
- yt([
40241
- Ri()
40242
- ], ut.prototype, "serviceUnavailable", 2);
40243
- yt([
40245
+ ], ot.prototype, "voiceServiceUrl", 2);
40246
+ vt([
40247
+ An()
40248
+ ], ot.prototype, "callStatus", 2);
40249
+ vt([
40250
+ An()
40251
+ ], ot.prototype, "microphoneEnabled", 2);
40252
+ vt([
40253
+ An()
40254
+ ], ot.prototype, "microphoneInitialized", 2);
40255
+ vt([
40256
+ An()
40257
+ ], ot.prototype, "serviceUnavailable", 2);
40258
+ vt([
40244
40259
  ye({ type: String, attribute: "button-start-text" })
40245
- ], ut.prototype, "buttonStartText", 2);
40246
- yt([
40260
+ ], ot.prototype, "buttonStartText", 2);
40261
+ vt([
40247
40262
  ye({ type: String, attribute: "button-connecting-text" })
40248
- ], ut.prototype, "buttonConnectingText", 2);
40249
- yt([
40263
+ ], ot.prototype, "buttonConnectingText", 2);
40264
+ vt([
40250
40265
  ye({ type: String, attribute: "position" })
40251
- ], ut.prototype, "position", 2);
40252
- yt([
40266
+ ], ot.prototype, "position", 2);
40267
+ vt([
40253
40268
  ye({ type: Number, attribute: "size" })
40254
- ], ut.prototype, "size", 2);
40255
- yt([
40269
+ ], ot.prototype, "size", 2);
40270
+ vt([
40256
40271
  ye({ type: String, attribute: "theme" })
40257
- ], ut.prototype, "theme", 2);
40258
- yt([
40272
+ ], ot.prototype, "theme", 2);
40273
+ vt([
40259
40274
  ye({ type: String, attribute: "theme-mode" })
40260
- ], ut.prototype, "themeMode", 2);
40261
- yt([
40275
+ ], ot.prototype, "themeMode", 2);
40276
+ vt([
40262
40277
  ye({ type: Object, attribute: "orb-colors" })
40263
- ], ut.prototype, "orbColors", 2);
40264
- yt([
40278
+ ], ot.prototype, "orbColors", 2);
40279
+ vt([
40265
40280
  ye({ type: Number, attribute: "glow-intensity" })
40266
- ], ut.prototype, "glowIntensity", 2);
40267
- yt([
40281
+ ], ot.prototype, "glowIntensity", 2);
40282
+ vt([
40268
40283
  ye({ type: Number, attribute: "idle-glow-multiplier" })
40269
- ], ut.prototype, "idleGlowMultiplier", 2);
40270
- yt([
40284
+ ], ot.prototype, "idleGlowMultiplier", 2);
40285
+ vt([
40271
40286
  ye({ type: Number, attribute: "morph-strength" })
40272
- ], ut.prototype, "morphStrength", 2);
40273
- yt([
40287
+ ], ot.prototype, "morphStrength", 2);
40288
+ vt([
40274
40289
  ye({ type: Number, attribute: "noise-scale" })
40275
- ], ut.prototype, "noiseScale", 2);
40276
- yt([
40290
+ ], ot.prototype, "noiseScale", 2);
40291
+ vt([
40277
40292
  ye({ type: Number, attribute: "noise-speed" })
40278
- ], ut.prototype, "noiseSpeed", 2);
40279
- yt([
40293
+ ], ot.prototype, "noiseSpeed", 2);
40294
+ vt([
40280
40295
  ye({ type: Number, attribute: "fresnel-power" })
40281
- ], ut.prototype, "fresnelPower", 2);
40282
- yt([
40296
+ ], ot.prototype, "fresnelPower", 2);
40297
+ vt([
40283
40298
  ye({ type: Number, attribute: "rotation-speed" })
40284
- ], ut.prototype, "rotationSpeed", 2);
40285
- yt([
40299
+ ], ot.prototype, "rotationSpeed", 2);
40300
+ vt([
40286
40301
  ye({ type: Number, attribute: "audio-reactivity" })
40287
- ], ut.prototype, "audioReactivity", 2);
40288
- yt([
40302
+ ], ot.prototype, "audioReactivity", 2);
40303
+ vt([
40289
40304
  ye({ type: Number, attribute: "audio-smoothing" })
40290
- ], ut.prototype, "audioSmoothing", 2);
40291
- yt([
40305
+ ], ot.prototype, "audioSmoothing", 2);
40306
+ vt([
40292
40307
  ye({ type: Number, attribute: "idle-morph-multiplier" })
40293
- ], ut.prototype, "idleMorphMultiplier", 2);
40294
- yt([
40308
+ ], ot.prototype, "idleMorphMultiplier", 2);
40309
+ vt([
40295
40310
  ye({ type: Number, attribute: "color-contrast" })
40296
- ], ut.prototype, "colorContrast", 2);
40297
- yt([
40311
+ ], ot.prototype, "colorContrast", 2);
40312
+ vt([
40298
40313
  ye({ type: Boolean, attribute: "sound-enabled" })
40299
- ], ut.prototype, "soundEnabled", 2);
40300
- yt([
40314
+ ], ot.prototype, "soundEnabled", 2);
40315
+ vt([
40301
40316
  ye({ type: Number, attribute: "sound-volume" })
40302
- ], ut.prototype, "soundVolume", 2);
40303
- yt([
40317
+ ], ot.prototype, "soundVolume", 2);
40318
+ vt([
40304
40319
  ye({ type: String, attribute: "sound-preset" })
40305
- ], ut.prototype, "soundPreset", 2);
40306
- ut = yt([
40320
+ ], ot.prototype, "soundPreset", 2);
40321
+ ot = vt([
40307
40322
  rd("hanc-ai-floating-call")
40308
- ], ut);
40309
- var UE = Object.defineProperty, OE = Object.getOwnPropertyDescriptor, St = (i, e, t, n) => {
40323
+ ], ot);
40324
+ var UE = Object.defineProperty, OE = Object.getOwnPropertyDescriptor, bt = (i, e, t, n) => {
40310
40325
  for (var s = n > 1 ? void 0 : n ? OE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
40311
40326
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
40312
40327
  return n && s && UE(e, t, s), s;
40313
40328
  };
40314
- let ht = class extends gs {
40329
+ let ct = class extends gs {
40315
40330
  constructor() {
40316
- super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
40331
+ super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.serviceUnavailable = !1, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
40317
40332
  const t = i.detail;
40318
40333
  if (!(!t || !this.audioAnalyzer))
40319
40334
  try {
@@ -40332,9 +40347,9 @@ let ht = class extends gs {
40332
40347
  console.error("Failed to connect local audio stream:", n);
40333
40348
  }
40334
40349
  }, this.handleMicrophoneEnabled = () => {
40335
- this.microphoneEnabled = !0;
40350
+ this.microphoneEnabled = !0, this.microphoneInitialized = !0;
40336
40351
  }, this.handleMicrophoneDisabled = () => {
40337
- this.microphoneEnabled = !1;
40352
+ this.microphoneEnabled = !1, this.microphoneInitialized = !0;
40338
40353
  }, this.handleHealthChange = (i) => {
40339
40354
  const e = i.detail;
40340
40355
  this.serviceUnavailable = e === "unhealthy";
@@ -40353,7 +40368,7 @@ let ht = class extends gs {
40353
40368
  );
40354
40369
  break;
40355
40370
  case "disconnected":
40356
- this.callStatus = "idle", (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
40371
+ this.callStatus = "idle", this.microphoneInitialized = !1, (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
40357
40372
  var o;
40358
40373
  (o = this.soundManager) == null || o.playCallEndSound();
40359
40374
  }, 150), this.dispatchEvent(
@@ -40688,7 +40703,7 @@ let ht = class extends gs {
40688
40703
  part="orb-container"
40689
40704
  ${od(this.orbContainerRef)}
40690
40705
  ></div>
40691
- ${this.callStatus === "connected" && !this.microphoneEnabled ? Xt`
40706
+ ${this.callStatus === "connected" && this.microphoneInitialized && !this.microphoneEnabled ? Xt`
40692
40707
  <div class="microphone-indicator visible">
40693
40708
  <svg viewBox="0 0 24 24" fill="none">
40694
40709
  <path
@@ -40720,107 +40735,110 @@ let ht = class extends gs {
40720
40735
  `;
40721
40736
  }
40722
40737
  };
40723
- ht.styles = nd`
40738
+ ct.styles = nd`
40724
40739
  :host {
40725
40740
  display: inline-block;
40726
40741
  contain: layout style;
40727
40742
  }
40728
40743
  `;
40729
- St([
40744
+ bt([
40730
40745
  ye({ type: String, attribute: "agent-id" })
40731
- ], ht.prototype, "agentId", 2);
40732
- St([
40746
+ ], ct.prototype, "agentId", 2);
40747
+ bt([
40733
40748
  ye({ type: String, attribute: "voice-service-url" })
40734
- ], ht.prototype, "voiceServiceUrl", 2);
40735
- St([
40736
- Ri()
40737
- ], ht.prototype, "callStatus", 2);
40738
- St([
40739
- Ri()
40740
- ], ht.prototype, "microphoneEnabled", 2);
40741
- St([
40742
- Ri()
40743
- ], ht.prototype, "serviceUnavailable", 2);
40744
- St([
40749
+ ], ct.prototype, "voiceServiceUrl", 2);
40750
+ bt([
40751
+ An()
40752
+ ], ct.prototype, "callStatus", 2);
40753
+ bt([
40754
+ An()
40755
+ ], ct.prototype, "microphoneEnabled", 2);
40756
+ bt([
40757
+ An()
40758
+ ], ct.prototype, "microphoneInitialized", 2);
40759
+ bt([
40760
+ An()
40761
+ ], ct.prototype, "serviceUnavailable", 2);
40762
+ bt([
40745
40763
  ye({ type: String, attribute: "button-start-text" })
40746
- ], ht.prototype, "buttonStartText", 2);
40747
- St([
40764
+ ], ct.prototype, "buttonStartText", 2);
40765
+ bt([
40748
40766
  ye({ type: String, attribute: "button-connecting-text" })
40749
- ], ht.prototype, "buttonConnectingText", 2);
40750
- St([
40767
+ ], ct.prototype, "buttonConnectingText", 2);
40768
+ bt([
40751
40769
  ye({ type: String, attribute: "button-end-text" })
40752
- ], ht.prototype, "buttonEndText", 2);
40753
- St([
40770
+ ], ct.prototype, "buttonEndText", 2);
40771
+ bt([
40754
40772
  ye({ type: Number, attribute: "orb-size" })
40755
- ], ht.prototype, "orbSize", 2);
40756
- St([
40773
+ ], ct.prototype, "orbSize", 2);
40774
+ bt([
40757
40775
  ye({ type: String, attribute: "theme" })
40758
- ], ht.prototype, "theme", 2);
40759
- St([
40776
+ ], ct.prototype, "theme", 2);
40777
+ bt([
40760
40778
  ye({ type: String, attribute: "theme-mode" })
40761
- ], ht.prototype, "themeMode", 2);
40762
- St([
40779
+ ], ct.prototype, "themeMode", 2);
40780
+ bt([
40763
40781
  ye({ type: Object, attribute: "orb-colors" })
40764
- ], ht.prototype, "orbColors", 2);
40765
- St([
40782
+ ], ct.prototype, "orbColors", 2);
40783
+ bt([
40766
40784
  ye({ type: Number, attribute: "glow-intensity" })
40767
- ], ht.prototype, "glowIntensity", 2);
40768
- St([
40785
+ ], ct.prototype, "glowIntensity", 2);
40786
+ bt([
40769
40787
  ye({ type: Number, attribute: "idle-glow-multiplier" })
40770
- ], ht.prototype, "idleGlowMultiplier", 2);
40771
- St([
40788
+ ], ct.prototype, "idleGlowMultiplier", 2);
40789
+ bt([
40772
40790
  ye({ type: Number, attribute: "morph-strength" })
40773
- ], ht.prototype, "morphStrength", 2);
40774
- St([
40791
+ ], ct.prototype, "morphStrength", 2);
40792
+ bt([
40775
40793
  ye({ type: Number, attribute: "noise-scale" })
40776
- ], ht.prototype, "noiseScale", 2);
40777
- St([
40794
+ ], ct.prototype, "noiseScale", 2);
40795
+ bt([
40778
40796
  ye({ type: Number, attribute: "noise-speed" })
40779
- ], ht.prototype, "noiseSpeed", 2);
40780
- St([
40797
+ ], ct.prototype, "noiseSpeed", 2);
40798
+ bt([
40781
40799
  ye({ type: Number, attribute: "fresnel-power" })
40782
- ], ht.prototype, "fresnelPower", 2);
40783
- St([
40800
+ ], ct.prototype, "fresnelPower", 2);
40801
+ bt([
40784
40802
  ye({ type: Number, attribute: "rotation-speed" })
40785
- ], ht.prototype, "rotationSpeed", 2);
40786
- St([
40803
+ ], ct.prototype, "rotationSpeed", 2);
40804
+ bt([
40787
40805
  ye({ type: Number, attribute: "audio-reactivity" })
40788
- ], ht.prototype, "audioReactivity", 2);
40789
- St([
40806
+ ], ct.prototype, "audioReactivity", 2);
40807
+ bt([
40790
40808
  ye({ type: Number, attribute: "audio-smoothing" })
40791
- ], ht.prototype, "audioSmoothing", 2);
40792
- St([
40809
+ ], ct.prototype, "audioSmoothing", 2);
40810
+ bt([
40793
40811
  ye({ type: Number, attribute: "idle-morph-multiplier" })
40794
- ], ht.prototype, "idleMorphMultiplier", 2);
40795
- St([
40812
+ ], ct.prototype, "idleMorphMultiplier", 2);
40813
+ bt([
40796
40814
  ye({ type: Number, attribute: "color-contrast" })
40797
- ], ht.prototype, "colorContrast", 2);
40798
- St([
40815
+ ], ct.prototype, "colorContrast", 2);
40816
+ bt([
40799
40817
  ye({ type: Boolean, attribute: "sound-enabled" })
40800
- ], ht.prototype, "soundEnabled", 2);
40801
- St([
40818
+ ], ct.prototype, "soundEnabled", 2);
40819
+ bt([
40802
40820
  ye({ type: Number, attribute: "sound-volume" })
40803
- ], ht.prototype, "soundVolume", 2);
40804
- St([
40821
+ ], ct.prototype, "soundVolume", 2);
40822
+ bt([
40805
40823
  ye({ type: String, attribute: "sound-preset" })
40806
- ], ht.prototype, "soundPreset", 2);
40807
- ht = St([
40824
+ ], ct.prototype, "soundPreset", 2);
40825
+ ct = bt([
40808
40826
  rd("hanc-ai-pill-call")
40809
- ], ht);
40827
+ ], ct);
40810
40828
  export {
40811
- ut as FloatingCall,
40812
- dt as InlineCall,
40813
- ht as PillCall,
40829
+ ot as FloatingCall,
40830
+ at as InlineCall,
40831
+ ct as PillCall,
40814
40832
  qd as SoundManager,
40815
40833
  kE as applyTheme,
40816
- fi as darkPresets,
40834
+ pi as darkPresets,
40817
40835
  qE as darkThemes,
40818
40836
  PE as detectSystemTheme,
40819
40837
  HE as getColorPreset,
40820
40838
  WE as getPresetNames,
40821
40839
  So as getTheme,
40822
40840
  XE as getThemeNames,
40823
- pi as lightPresets,
40841
+ mi as lightPresets,
40824
40842
  jE as lightThemes,
40825
40843
  Yr as themes,
40826
40844
  $E as watchSystemTheme