hanc-webrtc-widgets 2.2.1 → 2.2.2

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.
@@ -293,8 +293,8 @@ const Qm = (i, e) => {
293
293
  const c = i[o];
294
294
  let l, d, u = -1, h = 0;
295
295
  for (; h < c.length && (a.lastIndex = h, d = a.exec(c), d !== null); ) h = a.lastIndex, a === ur ? d[1] === "!--" ? a = tu : d[1] !== void 0 ? a = nu : d[2] !== void 0 ? (of.test(d[2]) && (s = RegExp("</" + d[2], "g")), a = Qi) : d[3] !== void 0 && (a = Qi) : a === Qi ? d[0] === ">" ? (a = s ?? ur, u = -1) : d[1] === void 0 ? u = -2 : (u = a.lastIndex - d[2].length, l = d[1], a = d[3] === void 0 ? Qi : d[3] === '"' ? su : iu) : a === su || a === iu ? a = Qi : a === tu || a === nu ? a = ur : (a = Qi, s = void 0);
296
- const p = a === Qi && i[o + 1].startsWith("/>") ? " " : "";
297
- r += a === ur ? c + Km : u >= 0 ? (n.push(l), c.slice(0, u) + rf + c.slice(u) + Bi + p) : c + Bi + (u === -2 ? o : p);
296
+ const f = a === Qi && i[o + 1].startsWith("/>") ? " " : "";
297
+ r += a === ur ? c + Km : u >= 0 ? (n.push(l), c.slice(0, u) + rf + c.slice(u) + Bi + f) : c + Bi + (u === -2 ? o : f);
298
298
  }
299
299
  return [cf(i, r + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n];
300
300
  };
@@ -311,14 +311,14 @@ class Fr {
311
311
  for (; (s = us.nextNode()) !== null && c.length < o; ) {
312
312
  if (s.nodeType === 1) {
313
313
  if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(rf)) {
314
- const h = d[a++], p = s.getAttribute(u).split(Bi), g = /([.?@])?(.*)/.exec(h);
315
- c.push({ type: 1, index: r, name: g[2], strings: p, ctor: g[1] === "." ? tg : g[1] === "?" ? ng : g[1] === "@" ? ig : so }), s.removeAttribute(u);
314
+ const h = d[a++], f = s.getAttribute(u).split(Bi), g = /([.?@])?(.*)/.exec(h);
315
+ c.push({ type: 1, index: r, name: g[2], strings: f, ctor: g[1] === "." ? tg : g[1] === "?" ? ng : g[1] === "@" ? ig : so }), s.removeAttribute(u);
316
316
  } else u.startsWith(Bi) && (c.push({ type: 6, index: r }), s.removeAttribute(u));
317
317
  if (of.test(s.tagName)) {
318
318
  const u = s.textContent.split(Bi), h = u.length - 1;
319
319
  if (h > 0) {
320
320
  s.textContent = qa ? qa.emptyScript : "";
321
- for (let p = 0; p < h; p++) s.append(u[p], Ur()), us.nextNode(), c.push({ type: 2, index: ++r });
321
+ for (let f = 0; f < h; f++) s.append(u[f], Ur()), us.nextNode(), c.push({ type: 2, index: ++r });
322
322
  s.append(u[h], Ur());
323
323
  }
324
324
  }
@@ -581,7 +581,7 @@ const ag = { attribute: !0, type: String, converter: Wa, reflect: !1, hasChanged
581
581
  }
582
582
  throw Error("Unsupported decorator location: " + n);
583
583
  };
584
- function Se(i) {
584
+ function ye(i) {
585
585
  return (e, t) => typeof t == "object" ? og(i, e, t) : ((n, s, r) => {
586
586
  const a = s.hasOwnProperty(r);
587
587
  return s.constructor.createProperty(r, a ? { ...n, wrapped: !0 } : n), a ? Object.getOwnPropertyDescriptor(s, r) : void 0;
@@ -593,7 +593,7 @@ function Se(i) {
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
595
  function or(i) {
596
- return Se({ ...i, state: !0, attribute: !1 });
596
+ return ye({ ...i, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
599
599
  * @license
@@ -2407,16 +2407,16 @@ function Zg() {
2407
2407
  case "scalar":
2408
2408
  case "enum":
2409
2409
  if (n.V.T === Z.BYTES)
2410
- for (const [p, g] of Object.entries(a[s]))
2411
- r[s][p] = hr(g);
2410
+ for (const [f, g] of Object.entries(a[s]))
2411
+ r[s][f] = hr(g);
2412
2412
  else
2413
2413
  Object.assign(r[s], a[s]);
2414
2414
  break;
2415
2415
  case "message":
2416
2416
  const h = n.V.T;
2417
- for (const p of Object.keys(a[s])) {
2418
- let g = a[s][p];
2419
- h.fieldWrapper || (g = new h(g)), r[s][p] = g;
2417
+ for (const f of Object.keys(a[s])) {
2418
+ let g = a[s][f];
2419
+ h.fieldWrapper || (g = new h(g)), r[s][f] = g;
2420
2420
  }
2421
2421
  break;
2422
2422
  }
@@ -5415,14 +5415,14 @@ function Xv() {
5415
5415
  var e = function() {
5416
5416
  }, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), s = ["trace", "debug", "info", "warn", "error"], r = {}, a = null;
5417
5417
  function o(v, m) {
5418
- var f = v[m];
5419
- if (typeof f.bind == "function")
5420
- return f.bind(v);
5418
+ var p = v[m];
5419
+ if (typeof p.bind == "function")
5420
+ return p.bind(v);
5421
5421
  try {
5422
- return Function.prototype.bind.call(f, v);
5422
+ return Function.prototype.bind.call(p, v);
5423
5423
  } catch {
5424
5424
  return function() {
5425
- return Function.prototype.apply.apply(f, [v, arguments]);
5425
+ return Function.prototype.apply.apply(p, [v, arguments]);
5426
5426
  };
5427
5427
  }
5428
5428
  }
@@ -5434,8 +5434,8 @@ function Xv() {
5434
5434
  }
5435
5435
  function d() {
5436
5436
  for (var v = this.getLevel(), m = 0; m < s.length; m++) {
5437
- var f = s[m];
5438
- this[f] = m < v ? e : this.methodFactory(f, v, this.name);
5437
+ var p = s[m];
5438
+ this[p] = m < v ? e : this.methodFactory(p, v, this.name);
5439
5439
  }
5440
5440
  if (this.log = this.debug, typeof console === t && v < this.levels.SILENT)
5441
5441
  return "No console available for logging";
@@ -5445,11 +5445,11 @@ function Xv() {
5445
5445
  typeof console !== t && (d.call(this), this[v].apply(this, arguments));
5446
5446
  };
5447
5447
  }
5448
- function h(v, m, f) {
5448
+ function h(v, m, p) {
5449
5449
  return l(v) || u.apply(this, arguments);
5450
5450
  }
5451
- function p(v, m) {
5452
- var f = this, x, E, _, S = "loglevel";
5451
+ function f(v, m) {
5452
+ var p = this, x, E, _, S = "loglevel";
5453
5453
  typeof v == "string" ? S += ":" + v : typeof v == "symbol" && (S = void 0);
5454
5454
  function M(R) {
5455
5455
  var U = (s[R] || "silent").toUpperCase();
@@ -5478,7 +5478,7 @@ function Xv() {
5478
5478
  q !== -1 && (R = /^([^;]+)/.exec(U.slice(q + F.length + 1))[1]);
5479
5479
  } catch {
5480
5480
  }
5481
- return f.levels[R] === void 0 && (R = void 0), R;
5481
+ return p.levels[R] === void 0 && (R = void 0), R;
5482
5482
  }
5483
5483
  }
5484
5484
  function k() {
@@ -5495,42 +5495,42 @@ function Xv() {
5495
5495
  }
5496
5496
  function y(R) {
5497
5497
  var U = R;
5498
- if (typeof U == "string" && f.levels[U.toUpperCase()] !== void 0 && (U = f.levels[U.toUpperCase()]), typeof U == "number" && U >= 0 && U <= f.levels.SILENT)
5498
+ if (typeof U == "string" && p.levels[U.toUpperCase()] !== void 0 && (U = p.levels[U.toUpperCase()]), typeof U == "number" && U >= 0 && U <= p.levels.SILENT)
5499
5499
  return U;
5500
5500
  throw new TypeError("log.setLevel() called with invalid level: " + R);
5501
5501
  }
5502
- f.name = v, f.levels = {
5502
+ p.name = v, p.levels = {
5503
5503
  TRACE: 0,
5504
5504
  DEBUG: 1,
5505
5505
  INFO: 2,
5506
5506
  WARN: 3,
5507
5507
  ERROR: 4,
5508
5508
  SILENT: 5
5509
- }, f.methodFactory = m || h, f.getLevel = function() {
5509
+ }, p.methodFactory = m || h, p.getLevel = function() {
5510
5510
  return _ ?? E ?? x;
5511
- }, f.setLevel = function(R, U) {
5512
- return _ = y(R), U !== !1 && M(_), d.call(f);
5513
- }, f.setDefaultLevel = function(R) {
5514
- E = y(R), A() || f.setLevel(R, !1);
5515
- }, f.resetLevel = function() {
5516
- _ = null, k(), d.call(f);
5517
- }, f.enableAll = function(R) {
5518
- f.setLevel(f.levels.TRACE, R);
5519
- }, f.disableAll = function(R) {
5520
- f.setLevel(f.levels.SILENT, R);
5521
- }, f.rebuild = function() {
5522
- if (a !== f && (x = y(a.getLevel())), d.call(f), a === f)
5511
+ }, p.setLevel = function(R, U) {
5512
+ return _ = y(R), U !== !1 && M(_), d.call(p);
5513
+ }, p.setDefaultLevel = function(R) {
5514
+ E = y(R), A() || p.setLevel(R, !1);
5515
+ }, p.resetLevel = function() {
5516
+ _ = null, k(), d.call(p);
5517
+ }, p.enableAll = function(R) {
5518
+ p.setLevel(p.levels.TRACE, R);
5519
+ }, p.disableAll = function(R) {
5520
+ p.setLevel(p.levels.SILENT, R);
5521
+ }, p.rebuild = function() {
5522
+ if (a !== p && (x = y(a.getLevel())), d.call(p), a === p)
5523
5523
  for (var R in r)
5524
5524
  r[R].rebuild();
5525
5525
  }, x = y(a ? a.getLevel() : "WARN");
5526
5526
  var T = A();
5527
- T != null && (_ = y(T)), d.call(f);
5527
+ T != null && (_ = y(T)), d.call(p);
5528
5528
  }
5529
- a = new p(), a.getLogger = function(m) {
5529
+ a = new f(), a.getLogger = function(m) {
5530
5530
  if (typeof m != "symbol" && typeof m != "string" || m === "")
5531
5531
  throw new TypeError("You must supply a name when creating a logger.");
5532
- var f = r[m];
5533
- return f || (f = r[m] = new p(m, a.methodFactory)), f;
5532
+ var p = r[m];
5533
+ return p || (p = r[m] = new f(m, a.methodFactory)), p;
5534
5534
  };
5535
5535
  var g = typeof window !== t ? window.log : void 0;
5536
5536
  return a.noConflict = function() {
@@ -5652,7 +5652,7 @@ function Zv() {
5652
5652
  function r() {
5653
5653
  r.init.call(this);
5654
5654
  }
5655
- na.exports = r, na.exports.once = f, r.EventEmitter = r, r.prototype._events = void 0, r.prototype._eventsCount = 0, r.prototype._maxListeners = void 0;
5655
+ na.exports = r, na.exports.once = p, r.EventEmitter = r, r.prototype._events = void 0, r.prototype._eventsCount = 0, r.prototype._maxListeners = void 0;
5656
5656
  var a = 10;
5657
5657
  function o(_) {
5658
5658
  if (typeof _ != "function")
@@ -5779,9 +5779,9 @@ function Zv() {
5779
5779
  }, r.prototype.rawListeners = function(S) {
5780
5780
  return h(this, S, !1);
5781
5781
  }, r.listenerCount = function(_, S) {
5782
- return typeof _.listenerCount == "function" ? _.listenerCount(S) : p.call(_, S);
5783
- }, r.prototype.listenerCount = p;
5784
- function p(_) {
5782
+ return typeof _.listenerCount == "function" ? _.listenerCount(S) : f.call(_, S);
5783
+ }, r.prototype.listenerCount = f;
5784
+ function f(_) {
5785
5785
  var S = this._events;
5786
5786
  if (S !== void 0) {
5787
5787
  var M = S[_];
@@ -5808,7 +5808,7 @@ function Zv() {
5808
5808
  S[M] = _[M].listener || _[M];
5809
5809
  return S;
5810
5810
  }
5811
- function f(_, S) {
5811
+ function p(_, S) {
5812
5812
  return new Promise(function(M, A) {
5813
5813
  function k(T) {
5814
5814
  _.removeListener(S, y), A(T);
@@ -5967,8 +5967,8 @@ function rp(i, e) {
5967
5967
  ideal: o[l]
5968
5968
  };
5969
5969
  d.exact !== void 0 && typeof d.exact == "number" && (d.min = d.max = d.exact);
5970
- const u = function(h, p) {
5971
- return h ? h + p.charAt(0).toUpperCase() + p.slice(1) : p === "deviceId" ? "sourceId" : p;
5970
+ const u = function(h, f) {
5971
+ return h ? h + f.charAt(0).toUpperCase() + f.slice(1) : f === "deviceId" ? "sourceId" : f;
5972
5972
  };
5973
5973
  if (d.ideal !== void 0) {
5974
5974
  c.optional = c.optional || [];
@@ -6000,11 +6000,11 @@ function rp(i, e) {
6000
6000
  if (l.exact === "environment" || l.ideal === "environment" ? u = ["back", "rear"] : (l.exact === "user" || l.ideal === "user") && (u = ["front"]), u)
6001
6001
  return t.mediaDevices.enumerateDevices().then((h) => {
6002
6002
  h = h.filter((g) => g.kind === "videoinput");
6003
- let p = h.find((g) => u.some((v) => g.label.toLowerCase().includes(v)));
6004
- return !p && h.length && u.includes("back") && (p = h[h.length - 1]), p && (o.video.deviceId = l.exact ? {
6005
- exact: p.deviceId
6003
+ let f = h.find((g) => u.some((v) => g.label.toLowerCase().includes(v)));
6004
+ return !f && h.length && u.includes("back") && (f = h[h.length - 1]), f && (o.video.deviceId = l.exact ? {
6005
+ exact: f.deviceId
6006
6006
  } : {
6007
- ideal: p.deviceId
6007
+ ideal: f.deviceId
6008
6008
  }), o.video = n(o.video), wu("chrome: " + JSON.stringify(o)), c(o);
6009
6009
  });
6010
6010
  }
@@ -6246,7 +6246,7 @@ function up(i, e) {
6246
6246
  const n = i.RTCPeerConnection.prototype.addStream;
6247
6247
  i.RTCPeerConnection.prototype.addStream = function(d) {
6248
6248
  if (this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, d.getTracks().forEach((u) => {
6249
- if (this.getSenders().find((p) => p.track === u))
6249
+ if (this.getSenders().find((f) => f.track === u))
6250
6250
  throw new DOMException("Track already exists.", "InvalidAccessError");
6251
6251
  }), !this._reverseStreams[d.id]) {
6252
6252
  const u = new i.MediaStream(d.getTracks());
@@ -6280,8 +6280,8 @@ function up(i, e) {
6280
6280
  function r(l, d) {
6281
6281
  let u = d.sdp;
6282
6282
  return Object.keys(l._reverseStreams || []).forEach((h) => {
6283
- const p = l._reverseStreams[h], g = l._streams[p.id];
6284
- u = u.replace(new RegExp(g.id, "g"), p.id);
6283
+ const f = l._reverseStreams[h], g = l._streams[f.id];
6284
+ u = u.replace(new RegExp(g.id, "g"), f.id);
6285
6285
  }), new RTCSessionDescription({
6286
6286
  type: d.type,
6287
6287
  sdp: u
@@ -6290,8 +6290,8 @@ function up(i, e) {
6290
6290
  function a(l, d) {
6291
6291
  let u = d.sdp;
6292
6292
  return Object.keys(l._reverseStreams || []).forEach((h) => {
6293
- const p = l._reverseStreams[h], g = l._streams[p.id];
6294
- u = u.replace(new RegExp(p.id, "g"), g.id);
6293
+ const f = l._reverseStreams[h], g = l._streams[f.id];
6294
+ u = u.replace(new RegExp(f.id, "g"), g.id);
6295
6295
  }), new RTCSessionDescription({
6296
6296
  type: d.type,
6297
6297
  sdp: u
@@ -6330,8 +6330,8 @@ function up(i, e) {
6330
6330
  throw new DOMException("Sender was not created by this connection.", "InvalidAccessError");
6331
6331
  this._streams = this._streams || {};
6332
6332
  let h;
6333
- Object.keys(this._streams).forEach((p) => {
6334
- this._streams[p].getTracks().find((v) => d.track === v) && (h = this._streams[p]);
6333
+ Object.keys(this._streams).forEach((f) => {
6334
+ this._streams[f].getTracks().find((v) => d.track === v) && (h = this._streams[f]);
6335
6335
  }), h && (h.getTracks().length === 1 ? this.removeStream(this._reverseStreams[h.id]) : h.removeTrack(d.track), this.dispatchEvent(new Event("negotiationneeded")));
6336
6336
  };
6337
6337
  }
@@ -6966,16 +6966,16 @@ a=ice-pwd:` + t.password + `\r
6966
6966
  const d = e.matchPrefix(t, "a=ssrc-group:FID").map((h) => h.substring(17).split(" ").map((g) => parseInt(g, 10)));
6967
6967
  d.length > 0 && d[0].length > 1 && d[0][0] === c && (l = d[0][1]), s.codecs.forEach((h) => {
6968
6968
  if (h.name.toUpperCase() === "RTX" && h.parameters.apt) {
6969
- let p = {
6969
+ let f = {
6970
6970
  ssrc: c,
6971
6971
  codecPayloadType: parseInt(h.parameters.apt, 10)
6972
6972
  };
6973
- c && l && (p.rtx = {
6973
+ c && l && (f.rtx = {
6974
6974
  ssrc: l
6975
- }), n.push(p), r && (p = JSON.parse(JSON.stringify(p)), p.fec = {
6975
+ }), n.push(f), r && (f = JSON.parse(JSON.stringify(f)), f.fec = {
6976
6976
  ssrc: c,
6977
6977
  mechanism: a ? "red+ulpfec" : "red"
6978
- }, n.push(p));
6978
+ }, n.push(f));
6979
6979
  }
6980
6980
  }), n.length === 0 && c && n.push({
6981
6981
  ssrc: c
@@ -7436,7 +7436,7 @@ var Ke;
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
  })(Ke || (Ke = {}));
7439
- class mt extends Ri {
7439
+ class _t extends Ri {
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 = Ke[t];
7442
7442
  }
@@ -8817,19 +8817,19 @@ function e_(i) {
8817
8817
  req: i
8818
8818
  }), e;
8819
8819
  }
8820
- var Tt;
8820
+ var Mt;
8821
8821
  (function(i) {
8822
8822
  i[i.CONNECTING = 0] = "CONNECTING", i[i.CONNECTED = 1] = "CONNECTED", i[i.RECONNECTING = 2] = "RECONNECTING", i[i.DISCONNECTING = 3] = "DISCONNECTING", i[i.DISCONNECTED = 4] = "DISCONNECTED";
8823
- })(Tt || (Tt = {}));
8823
+ })(Mt || (Mt = {}));
8824
8824
  class vd {
8825
8825
  get currentState() {
8826
8826
  return this.state;
8827
8827
  }
8828
8828
  get isDisconnected() {
8829
- return this.state === Tt.DISCONNECTING || this.state === Tt.DISCONNECTED;
8829
+ return this.state === Mt.DISCONNECTING || this.state === Mt.DISCONNECTED;
8830
8830
  }
8831
8831
  get isEstablishingConnection() {
8832
- return this.state === Tt.CONNECTING || this.state === Tt.RECONNECTING;
8832
+ return this.state === Mt.CONNECTING || this.state === Mt.RECONNECTING;
8833
8833
  }
8834
8834
  getNextRequestId() {
8835
8835
  return this._requestId += 1, this._requestId;
@@ -8837,9 +8837,9 @@ class vd {
8837
8837
  constructor() {
8838
8838
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
8839
8839
  var n;
8840
- this.rtt = 0, this.state = Tt.DISCONNECTED, this.log = $e, this._requestId = 0, this.resetCallbacks = () => {
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 = Ei((n = t.loggerName) !== null && n !== void 0 ? n : Vn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new Y0(), this.queuedRequests = [], this.closingLock = new hn(), this.connectionLock = new hn(), this.state = Tt.DISCONNECTED;
8842
+ }, this.log = Ei((n = t.loggerName) !== null && n !== void 0 ? n : Vn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new Y0(), 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;
@@ -8847,7 +8847,7 @@ class vd {
8847
8847
  }
8848
8848
  join(e, t, n, s) {
8849
8849
  return P(this, void 0, void 0, function* () {
8850
- return this.state = Tt.CONNECTING, this.options = n, yield this.connect(e, t, n, s);
8850
+ return this.state = Mt.CONNECTING, this.options = n, yield this.connect(e, t, n, s);
8851
8851
  });
8852
8852
  }
8853
8853
  reconnect(e, t, n, s) {
@@ -8856,7 +8856,7 @@ class vd {
8856
8856
  this.log.warn("attempted to reconnect without signal options being set, ignoring", this.logContext);
8857
8857
  return;
8858
8858
  }
8859
- return this.state = Tt.RECONNECTING, this.clearPingInterval(), yield this.connect(e, t, Object.assign(Object.assign({}, this.options), {
8859
+ return this.state = Mt.RECONNECTING, this.clearPingInterval(), yield this.connect(e, t, Object.assign(Object.assign({}, this.options), {
8860
8860
  reconnect: !0,
8861
8861
  sid: n,
8862
8862
  reconnectReason: s
@@ -8870,9 +8870,9 @@ class vd {
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(p), d(new mt("room connection has been cancelled (signal)", Ke.Cancelled));
8874
- }), p = setTimeout(() => {
8875
- this.close(), d(new mt("room connection has timed out (signal)", Ke.ServerUnreachable));
8873
+ this.close(), clearTimeout(f), d(new _t("room connection has been cancelled (signal)", Ke.Cancelled));
8874
+ }), f = setTimeout(() => {
8875
+ this.close(), d(new _t("room connection has timed out (signal)", Ke.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);
@@ -8880,25 +8880,25 @@ class vd {
8880
8880
  reconnect: n.reconnect,
8881
8881
  reconnectReason: n.reconnectReason
8882
8882
  }, this.logContext)), this.ws && (yield this.close(!1)), this.ws = new WebSocket(o), this.ws.binaryType = "arraybuffer", this.ws.onopen = () => {
8883
- clearTimeout(p);
8883
+ clearTimeout(f);
8884
8884
  }, this.ws.onerror = (v) => P(this, void 0, void 0, function* () {
8885
- if (this.state !== Tt.CONNECTED) {
8886
- this.state = Tt.DISCONNECTED, clearTimeout(p);
8885
+ if (this.state !== Mt.CONNECTED) {
8886
+ this.state = Mt.DISCONNECTED, clearTimeout(f);
8887
8887
  try {
8888
8888
  const m = yield fetch(c);
8889
8889
  if (m.status.toFixed(0).startsWith("4")) {
8890
- const f = yield m.text();
8891
- d(new mt(f, Ke.NotAllowed, m.status));
8890
+ const p = yield m.text();
8891
+ d(new _t(p, Ke.NotAllowed, m.status));
8892
8892
  } else
8893
- d(new mt("Encountered unknown websocket error during connection: ".concat(v.toString()), Ke.InternalError, m.status));
8893
+ d(new _t("Encountered unknown websocket error during connection: ".concat(v.toString()), Ke.InternalError, m.status));
8894
8894
  } catch (m) {
8895
- d(new mt(m instanceof Error ? m.message : "server was not reachable", Ke.ServerUnreachable));
8895
+ d(new _t(m instanceof Error ? m.message : "server was not reachable", Ke.ServerUnreachable));
8896
8896
  }
8897
8897
  return;
8898
8898
  }
8899
8899
  this.handleWSError(v);
8900
8900
  }), this.ws.onmessage = (v) => P(this, void 0, void 0, function* () {
8901
- var m, f, x;
8901
+ var m, p, x;
8902
8902
  let E;
8903
8903
  if (typeof v.data == "string") {
8904
8904
  const _ = JSON.parse(v.data);
@@ -8911,17 +8911,17 @@ class vd {
8911
8911
  this.log.error("could not decode websocket message: ".concat(typeof v.data), this.logContext);
8912
8912
  return;
8913
8913
  }
8914
- if (this.state !== Tt.CONNECTED) {
8914
+ if (this.state !== Mt.CONNECTED) {
8915
8915
  let _ = !1;
8916
- if (((m = E.message) === null || m === void 0 ? void 0 : m.case) === "join" ? (this.state = Tt.CONNECTED, s == null || s.removeEventListener("abort", h), this.pingTimeoutDuration = E.message.value.pingTimeout, this.pingIntervalDuration = E.message.value.pingInterval, this.pingTimeoutDuration && this.pingTimeoutDuration > 0 && (this.log.debug("ping config", Object.assign(Object.assign({}, this.logContext), {
8916
+ if (((m = E.message) === null || m === void 0 ? void 0 : m.case) === "join" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.pingTimeoutDuration = E.message.value.pingTimeout, this.pingIntervalDuration = E.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(E.message.value)) : this.state === Tt.RECONNECTING && E.message.case !== "leave" ? (this.state = Tt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((f = E.message) === null || f === void 0 ? void 0 : f.case) === "reconnect" ? l(E.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), _ = !0)) : this.isEstablishingConnection && E.message.case === "leave" ? d(new mt("Received leave request while trying to (re)connect", Ke.LeaveRequest, void 0, E.message.value.reason)) : n.reconnect || d(new mt("did not receive join response, got ".concat((x = E.message) === null || x === void 0 ? void 0 : x.case, " instead"), Ke.InternalError)), !_)
8919
+ })), this.startPingInterval()), l(E.message.value)) : this.state === Mt.RECONNECTING && E.message.case !== "leave" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((p = E.message) === null || p === void 0 ? void 0 : p.case) === "reconnect" ? l(E.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), _ = !0)) : this.isEstablishingConnection && E.message.case === "leave" ? d(new _t("Received leave request while trying to (re)connect", Ke.LeaveRequest, void 0, E.message.value.reason)) : n.reconnect || d(new _t("did not receive join response, got ".concat((x = E.message) === null || x === void 0 ? void 0 : x.case, " instead"), Ke.InternalError)), !_)
8920
8920
  return;
8921
8921
  }
8922
8922
  this.signalLatency && (yield fn(this.signalLatency)), this.handleSignalResponse(E);
8923
8923
  }), this.ws.onclose = (v) => {
8924
- this.isEstablishingConnection && d(new mt("Websocket got closed during a (re)connection attempt", Ke.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8924
+ this.isEstablishingConnection && d(new _t("Websocket got closed during a (re)connection attempt", Ke.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,
@@ -8940,7 +8940,7 @@ class vd {
8940
8940
  return function* () {
8941
8941
  const n = yield e.closingLock.lock();
8942
8942
  try {
8943
- if (e.clearPingInterval(), t && (e.state = Tt.DISCONNECTING), e.ws) {
8943
+ if (e.clearPingInterval(), t && (e.state = Mt.DISCONNECTING), e.ws) {
8944
8944
  e.ws.onmessage = null, e.ws.onopen = null, e.ws.onclose = null;
8945
8945
  const s = new Promise((r) => {
8946
8946
  e.ws ? e.ws.onclose = () => {
@@ -8950,7 +8950,7 @@ class vd {
8950
8950
  e.ws.readyState < e.ws.CLOSING && (e.ws.close(), yield Promise.race([s, fn(250)])), e.ws = void 0;
8951
8951
  }
8952
8952
  } finally {
8953
- t && (e.state = Tt.DISCONNECTED), n();
8953
+ t && (e.state = Mt.DISCONNECTED), n();
8954
8954
  }
8955
8955
  }();
8956
8956
  });
@@ -9095,7 +9095,7 @@ class vd {
9095
9095
  var n = this;
9096
9096
  let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
9097
9097
  return function* () {
9098
- if (!s && !e_(t) && n.state === Tt.RECONNECTING) {
9098
+ if (!s && !e_(t) && n.state === Mt.RECONNECTING) {
9099
9099
  n.queuedRequests.push(() => P(n, void 0, void 0, function* () {
9100
9100
  yield this.sendRequest(t, !0);
9101
9101
  }));
@@ -9152,7 +9152,7 @@ class vd {
9152
9152
  }
9153
9153
  handleOnClose(e) {
9154
9154
  return P(this, void 0, void 0, function* () {
9155
- if (this.state === Tt.DISCONNECTED) return;
9155
+ if (this.state === Mt.DISCONNECTED) return;
9156
9156
  const t = this.onClose;
9157
9157
  yield this.close(), this.log.debug("websocket connection closed: ".concat(e), Object.assign(Object.assign({}, this.logContext), {
9158
9158
  reason: e
@@ -9799,15 +9799,15 @@ function i_() {
9799
9799
  i.parse = function(o) {
9800
9800
  var c = {}, l = [], d = c;
9801
9801
  return o.split(/(\r\n|\r|\n)/).filter(r).forEach(function(u) {
9802
- var h = u[0], p = u.slice(2);
9802
+ var h = u[0], f = u.slice(2);
9803
9803
  h === "m" && (l.push({
9804
9804
  rtp: [],
9805
9805
  fmtp: []
9806
9806
  }), d = l[l.length - 1]);
9807
9807
  for (var g = 0; g < (s[h] || []).length; g += 1) {
9808
9808
  var v = s[h][g];
9809
- if (v.reg.test(p))
9810
- return n(v, d, p);
9809
+ if (v.reg.test(f))
9810
+ return n(v, d, f);
9811
9811
  }
9812
9812
  }), c.media = l, c;
9813
9813
  };
@@ -9883,15 +9883,15 @@ function s_() {
9883
9883
  var c = o.outerOrder || s, l = o.innerOrder || r, d = [];
9884
9884
  return c.forEach(function(u) {
9885
9885
  i[u].forEach(function(h) {
9886
- h.name in a && a[h.name] != null ? d.push(n(u, h, a)) : h.push in a && a[h.push] != null && a[h.push].forEach(function(p) {
9887
- d.push(n(u, h, p));
9886
+ h.name in a && a[h.name] != null ? d.push(n(u, h, a)) : h.push in a && a[h.push] != null && a[h.push].forEach(function(f) {
9887
+ d.push(n(u, h, f));
9888
9888
  });
9889
9889
  });
9890
9890
  }), a.media.forEach(function(u) {
9891
9891
  d.push(n("m", i.m[0], u)), l.forEach(function(h) {
9892
- i[h].forEach(function(p) {
9893
- p.name in u && u[p.name] != null ? d.push(n(h, p, u)) : p.push in u && u[p.push] != null && u[p.push].forEach(function(g) {
9894
- d.push(n(h, p, g));
9892
+ i[h].forEach(function(f) {
9893
+ f.name in u && u[f.name] != null ? d.push(n(h, f, u)) : f.push in u && u[f.push] != null && u[f.push].forEach(function(g) {
9894
+ d.push(n(h, f, g));
9895
9895
  });
9896
9896
  });
9897
9897
  });
@@ -9914,24 +9914,24 @@ function bd(i, e, t) {
9914
9914
  var a = (n = t.isImmediate) != null && n, o = (s = t.callback) != null && s, c = t.maxWait, l = Date.now(), d = [];
9915
9915
  function u() {
9916
9916
  if (c !== void 0) {
9917
- var p = Date.now() - l;
9918
- if (p + e >= c) return c - p;
9917
+ var f = Date.now() - l;
9918
+ if (f + e >= c) return c - f;
9919
9919
  }
9920
9920
  return e;
9921
9921
  }
9922
9922
  var h = function() {
9923
- var p = [].slice.call(arguments), g = this;
9923
+ var f = [].slice.call(arguments), g = this;
9924
9924
  return new Promise(function(v, m) {
9925
- var f = a && r === void 0;
9925
+ var p = a && r === void 0;
9926
9926
  if (r !== void 0 && clearTimeout(r), r = setTimeout(function() {
9927
9927
  if (r = void 0, l = Date.now(), !a) {
9928
- var E = i.apply(g, p);
9928
+ var E = i.apply(g, f);
9929
9929
  o && o(E), d.forEach(function(_) {
9930
9930
  return (0, _.resolve)(E);
9931
9931
  }), d = [];
9932
9932
  }
9933
- }, u()), f) {
9934
- var x = i.apply(g, p);
9933
+ }, u()), p) {
9934
+ var x = i.apply(g, f);
9935
9935
  return o && o(x), v(x);
9936
9936
  }
9937
9937
  d.push({
@@ -9940,9 +9940,9 @@ function bd(i, e, t) {
9940
9940
  });
9941
9941
  });
9942
9942
  };
9943
- return h.cancel = function(p) {
9943
+ return h.cancel = function(f) {
9944
9944
  r !== void 0 && clearTimeout(r), d.forEach(function(g) {
9945
- return (0, g.reject)(p);
9945
+ return (0, g.reject)(f);
9946
9946
  }), d = [];
9947
9947
  }, h;
9948
9948
  }
@@ -10475,15 +10475,15 @@ class u_ {
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), $t.clearTimeout(u), l(new mt("room connection has been cancelled", Ke.Cancelled));
10478
+ this.log.warn("abort transport connection", this.logContext), $t.clearTimeout(u), l(new _t("room connection has been cancelled", Ke.Cancelled));
10479
10479
  };
10480
10480
  s != null && s.signal.aborted && d(), s == null || s.signal.addEventListener("abort", d);
10481
10481
  const u = $t.setTimeout(() => {
10482
- s == null || s.signal.removeEventListener("abort", d), l(new mt("could not establish pc connection", Ke.InternalError));
10482
+ s == null || s.signal.removeEventListener("abort", d), l(new _t("could not establish pc connection", Ke.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 mt("room connection has been cancelled", Ke.Cancelled));
10486
+ l(new _t("room connection has been cancelled", Ke.Cancelled));
10487
10487
  return;
10488
10488
  }
10489
10489
  $t.clearTimeout(u), s == null || s.signal.removeEventListener("abort", d), c();
@@ -11203,11 +11203,11 @@ function Zc(i, e, t, n) {
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
11205
  ni() || (m == null ? void 0 : m.name) === "Chrome" && ii(m == null ? void 0 : m.version, "113") < 0) {
11206
- const f = g.suffix == "h" ? 2 : 3, x = R0(m);
11206
+ const p = g.suffix == "h" ? 2 : 3, x = R0(m);
11207
11207
  for (let E = 0; E < g.spatial; E += 1)
11208
11208
  v.push({
11209
11209
  rid: Jc[2 - E],
11210
- maxBitrate: a.maxBitrate / Math.pow(f, E),
11210
+ maxBitrate: a.maxBitrate / Math.pow(p, E),
11211
11211
  maxFramerate: u.encoding.maxFramerate,
11212
11212
  scaleResolutionDownBy: x ? Math.pow(2, E) : void 0
11213
11213
  });
@@ -11227,13 +11227,13 @@ function Zc(i, e, t, n) {
11227
11227
  return [a];
11228
11228
  let h = [];
11229
11229
  i ? h = (s = nh(n == null ? void 0 : n.screenShareSimulcastLayers)) !== null && s !== void 0 ? s : th(i, u) : h = (r = nh(n == null ? void 0 : n.videoSimulcastLayers)) !== null && r !== void 0 ? r : th(i, u);
11230
- let p;
11230
+ let f;
11231
11231
  if (h.length > 0) {
11232
11232
  const g = h[0];
11233
- h.length > 1 && ([, p] = h);
11233
+ h.length > 1 && ([, f] = h);
11234
11234
  const v = Math.max(e, t);
11235
- if (v >= 960 && p)
11236
- return zo(e, t, [g, p, u], d);
11235
+ if (v >= 960 && f)
11236
+ return zo(e, t, [g, f, u], d);
11237
11237
  if (v >= 480)
11238
11238
  return zo(e, t, [g, u], d);
11239
11239
  }
@@ -11583,7 +11583,7 @@ class Qa extends Wp {
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, p = _i(s.simulcastCodecs.values()), g; g = yield p.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 = {
@@ -11591,7 +11591,7 @@ class Qa extends Wp {
11591
11591
  };
11592
11592
  } finally {
11593
11593
  try {
11594
- !h && !a && (c = p.return) && (yield c.call(p));
11594
+ !h && !a && (c = f.return) && (yield c.call(f));
11595
11595
  } finally {
11596
11596
  if (o) throw o.error;
11597
11597
  }
@@ -11763,12 +11763,12 @@ function ih(i, e, t, n, s, r, a) {
11763
11763
  return;
11764
11764
  }
11765
11765
  let d = !1;
11766
- !1 && l[0].scalabilityMode || (s && t.some((p) => p.enabled) && t.forEach((p) => p.enabled = !0), l.forEach((h, p) => {
11766
+ !1 && l[0].scalabilityMode || (s && t.some((f) => f.enabled) && t.forEach((f) => f.enabled = !0), l.forEach((h, f) => {
11767
11767
  var g;
11768
11768
  let v = (g = h.rid) !== null && g !== void 0 ? g : "";
11769
11769
  v === "" && (v = "q");
11770
- const m = jp(v), f = t.find((x) => x.quality === m);
11771
- f && h.active !== f.enabled && (d = !0, h.active = f.enabled, r.debug("setting layer ".concat(f.quality, " to ").concat(h.active ? "enabled" : "disabled"), a), bs() && (f.enabled ? (h.scaleResolutionDownBy = e[p].scaleResolutionDownBy, h.maxBitrate = e[p].maxBitrate, h.maxFrameRate = e[p].maxFrameRate) : (h.scaleResolutionDownBy = 4, h.maxBitrate = 10, h.maxFrameRate = 2)));
11770
+ const m = jp(v), p = t.find((x) => x.quality === m);
11771
+ p && h.active !== p.enabled && (d = !0, h.active = p.enabled, r.debug("setting layer ".concat(p.quality, " to ").concat(h.active ? "enabled" : "disabled"), a), bs() && (p.enabled ? (h.scaleResolutionDownBy = e[f].scaleResolutionDownBy, h.maxBitrate = e[f].maxBitrate, h.maxFrameRate = e[f].maxFrameRate) : (h.scaleResolutionDownBy = 4, h.maxBitrate = 10, h.maxFrameRate = 2)));
11772
11772
  })), d && (c.encodings = l, r.debug("setting encodings", Object.assign(Object.assign({}, a), {
11773
11773
  encodings: c.encodings
11774
11774
  })), yield i.setParameters(c));
@@ -11927,7 +11927,7 @@ class I_ extends ri.EventEmitter {
11927
11927
  if (s)
11928
11928
  return n === qe.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(s.bufferedAmount), s.bufferedAmount <= s.bufferedAmountLowThreshold;
11929
11929
  }, this.handleBrowserOnLine = () => {
11930
- this.client.currentState === Tt.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(Cs.RR_SIGNAL_DISCONNECTED));
11930
+ this.client.currentState === Mt.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(Cs.RR_SIGNAL_DISCONNECTED));
11931
11931
  }, this.log = Ei((t = e.loggerName) !== null && t !== void 0 ? t : Vn.Engine), this.loggerOptions = {
11932
11932
  loggerName: e.loggerName,
11933
11933
  loggerContextCb: () => this.logContext
@@ -11951,7 +11951,7 @@ class I_ 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 mt && r.reason === Ke.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 _t && r.reason === Ke.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
  }
@@ -11991,7 +11991,7 @@ class I_ extends ri.EventEmitter {
11991
11991
  throw new bi("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 mt("publication of local track timed out, no response from server", Ke.Timeout));
11994
+ delete this.pendingTrackResolvers[e.cid], n(new _t("publication of local track timed out, no response from server", Ke.Timeout));
11995
11995
  }, 1e4);
11996
11996
  this.pendingTrackResolvers[e.cid] = {
11997
11997
  resolve: (r) => {
@@ -12058,7 +12058,7 @@ class I_ extends ri.EventEmitter {
12058
12058
  const d = this.pcState === In.New;
12059
12059
  this.pcState = In.Connected, d && this.emit(ce.Connected, e);
12060
12060
  } else r === Pt.FAILED && this.pcState === In.Connected && (this.pcState = In.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? Cs.RR_SUBSCRIBER_FAILED : Cs.RR_PUBLISHER_FAILED));
12061
- const c = this.client.isDisconnected || this.client.currentState === Tt.RECONNECTING, l = [Pt.FAILED, Pt.CLOSING, Pt.CLOSED].includes(r);
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) => {
12064
12064
  this.emit(ce.MediaTrackAdded, r.track, r.streams[0], r.receiver);
@@ -12246,11 +12246,11 @@ class I_ extends ri.EventEmitter {
12246
12246
  throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Ms();
12247
12247
  r = yield this.join(e ?? this.url, this.token, this.signalOpts);
12248
12248
  } catch (a) {
12249
- throw a instanceof mt && a.reason === Ke.NotAllowed ? new zt("could not reconnect, token might be expired") : new Ms();
12249
+ throw a instanceof _t && a.reason === Ke.NotAllowed ? new zt("could not reconnect, token might be expired") : new Ms();
12250
12250
  }
12251
12251
  if (this.shouldFailNext)
12252
12252
  throw this.shouldFailNext = !1, new Error("simulated failure");
12253
- if (this.client.setReconnected(), this.emit(ce.SignalRestarted, r), yield this.waitForPCReconnected(), this.client.currentState !== Tt.CONNECTED)
12253
+ if (this.client.setReconnected(), this.emit(ce.SignalRestarted, r), yield this.waitForPCReconnected(), this.client.currentState !== Mt.CONNECTED)
12254
12254
  throw new Ms("Signal connection got severed during reconnect");
12255
12255
  (t = this.regionUrlProvider) === null || t === void 0 || t.resetAttempts(), this.emit(ce.Restarted);
12256
12256
  } catch (r) {
@@ -12278,7 +12278,7 @@ class I_ 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 mt && s.reason === Ke.NotAllowed ? new zt("could not reconnect, token might be expired") : s instanceof mt && s.reason === Ke.LeaveRequest ? s : new Ms(r);
12281
+ }))), s instanceof _t && s.reason === Ke.NotAllowed ? new zt("could not reconnect, token might be expired") : s instanceof _t && s.reason === Ke.LeaveRequest ? s : new Ms(r);
12282
12282
  }
12283
12283
  if (this.emit(ce.SignalResumed), n) {
12284
12284
  const s = this.makeRTCConfiguration(n);
@@ -12287,7 +12287,7 @@ class I_ extends ri.EventEmitter {
12287
12287
  this.log.warn("Did not receive reconnect response", this.logContext);
12288
12288
  if (this.shouldFailNext)
12289
12289
  throw this.shouldFailNext = !1, new Error("simulated failure");
12290
- if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== Tt.CONNECTED)
12290
+ if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== Mt.CONNECTED)
12291
12291
  throw new Ms("Signal connection got severed during reconnect");
12292
12292
  this.client.setReconnected(), ((t = this.reliableDC) === null || t === void 0 ? void 0 : t.readyState) === "open" && this.reliableDC.id === null && this.createDataChannels(), n != null && n.lastMessageSeq && this.resendReliableMessagesForResume(n.lastMessageSeq), this.emit(ce.Resumed);
12293
12293
  });
@@ -12307,7 +12307,7 @@ class I_ extends ri.EventEmitter {
12307
12307
  throw new zt("PC manager is closed");
12308
12308
  yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = In.Connected;
12309
12309
  } catch (e) {
12310
- throw this.pcState = In.Disconnected, new mt("could not establish PC connection, ".concat(e.message), Ke.InternalError);
12310
+ throw this.pcState = In.Disconnected, new _t("could not establish PC connection, ".concat(e.message), Ke.InternalError);
12311
12311
  }
12312
12312
  });
12313
12313
  }
@@ -12400,7 +12400,7 @@ class I_ 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 mt("".concat(o, " connection not set"), Ke.InternalError);
12403
+ throw new _t("".concat(o, " connection not set"), Ke.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 I_ extends ri.EventEmitter {
12412
12412
  return;
12413
12413
  yield fn(50);
12414
12414
  }
12415
- throw new mt("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), Ke.InternalError);
12415
+ throw new _t("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), Ke.InternalError);
12416
12416
  }();
12417
12417
  });
12418
12418
  }
@@ -12580,7 +12580,7 @@ class Qc {
12580
12580
  const n = yield t.json();
12581
12581
  return this.lastUpdateAt = Date.now(), n;
12582
12582
  } else
12583
- throw new mt("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? Ke.NotAllowed : Ke.InternalError, t.status);
12583
+ throw new _t("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? Ke.NotAllowed : Ke.InternalError, t.status);
12584
12584
  });
12585
12585
  }
12586
12586
  setServerReportedRegions(e) {
@@ -12988,10 +12988,10 @@ class z_ {
12988
12988
  return P(this, void 0, void 0, function* () {
12989
12989
  var n;
12990
12990
  const s = crypto.randomUUID(), a = new TextEncoder().encode(e).byteLength, o = (n = t == null ? void 0 : t.attachments) === null || n === void 0 ? void 0 : n.map(() => crypto.randomUUID()), c = new Array(o ? o.length + 1 : 1).fill(0), l = (u, h) => {
12991
- var p;
12991
+ var f;
12992
12992
  c[h] = u;
12993
12993
  const g = c.reduce((v, m) => v + m, 0);
12994
- (p = t == null ? void 0 : t.onProgress) === null || p === void 0 || p.call(t, g);
12994
+ (f = t == null ? void 0 : t.onProgress) === null || f === void 0 || f.call(t, g);
12995
12995
  }, d = yield this.streamText({
12996
12996
  streamId: s,
12997
12997
  totalSize: a,
@@ -13004,8 +13004,8 @@ class z_ {
13004
13004
  return this._sendFile(o[h], u, {
13005
13005
  topic: t.topic,
13006
13006
  mimeType: u.type,
13007
- onProgress: (p) => {
13008
- l(p, h + 1);
13007
+ onProgress: (f) => {
13008
+ l(f, h + 1);
13009
13009
  }
13010
13010
  });
13011
13011
  })))), d.info;
@@ -13060,14 +13060,14 @@ class z_ {
13060
13060
  content: v,
13061
13061
  streamId: s,
13062
13062
  chunkIndex: as(l)
13063
- }), f = new dn({
13063
+ }), p = new dn({
13064
13064
  destinationIdentities: o,
13065
13065
  value: {
13066
13066
  case: "streamChunk",
13067
13067
  value: m
13068
13068
  }
13069
13069
  });
13070
- yield d.sendDataPacket(f, qe.RELIABLE), l += 1;
13070
+ yield d.sendDataPacket(p, qe.RELIABLE), l += 1;
13071
13071
  }
13072
13072
  });
13073
13073
  },
@@ -13090,11 +13090,11 @@ class z_ {
13090
13090
  }
13091
13091
  });
13092
13092
  let h = () => P(this, void 0, void 0, function* () {
13093
- yield p.close();
13093
+ yield f.close();
13094
13094
  });
13095
13095
  d.once(ce.Closing, h);
13096
- const p = new B_(u, r, () => this.engine.off(ce.Closing, h));
13097
- return p;
13096
+ const f = new B_(u, r, () => this.engine.off(ce.Closing, h));
13097
+ return f;
13098
13098
  });
13099
13099
  }
13100
13100
  sendFile(e, t) {
@@ -13161,10 +13161,10 @@ class z_ {
13161
13161
  });
13162
13162
  yield this.engine.sendDataPacket(u, qe.RELIABLE);
13163
13163
  let h = 0;
13164
- const p = new hn(), g = this.engine, v = this.log, m = new WritableStream({
13164
+ const f = new hn(), g = this.engine, v = this.log, m = new WritableStream({
13165
13165
  write(x) {
13166
13166
  return P(this, void 0, void 0, function* () {
13167
- const E = yield p.lock();
13167
+ const E = yield f.lock();
13168
13168
  let _ = 0;
13169
13169
  try {
13170
13170
  for (; _ < x.byteLength; ) {
@@ -13785,15 +13785,15 @@ function ho(i, e) {
13785
13785
  try {
13786
13786
  const u = yield d;
13787
13787
  return yield Promise.all(u.getTracks().map((h) => P(this, void 0, void 0, function* () {
13788
- const p = h.kind === "audio";
13789
- let g = p ? c.audio : c.video;
13788
+ const f = h.kind === "audio";
13789
+ let g = f ? c.audio : c.video;
13790
13790
  (typeof g == "boolean" || !g) && (g = {});
13791
13791
  let v;
13792
- const m = p ? l.audio : l.video;
13792
+ const m = f ? l.audio : l.video;
13793
13793
  typeof m != "boolean" && (v = m);
13794
- const f = h.getSettings().deviceId;
13795
- v != null && v.deviceId && Xi(v.deviceId) !== f ? v.deviceId = f : v || (v = {
13796
- deviceId: f
13794
+ const p = h.getSettings().deviceId;
13795
+ v != null && v.deviceId && Xi(v.deviceId) !== p ? v.deviceId = p : v || (v = {
13796
+ deviceId: p
13797
13797
  });
13798
13798
  const x = __(h, v, e);
13799
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) : Yi(x) && s && (yield x.setProcessor(s)), x;
@@ -14019,7 +14019,7 @@ class Y_ extends Kp {
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();
14020
14020
  }, this.handleClosing = () => {
14021
14021
  var o, c, l, d, u, h;
14022
- this.reconnectFuture && (this.reconnectFuture.promise.catch((p) => this.log.warn(p.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;
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
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);
@@ -14071,21 +14071,21 @@ class Y_ extends Kp {
14071
14071
  var c, l, d, u, h;
14072
14072
  if (!(!((h = this.roomOptions) === null || h === void 0) && h.dynacast))
14073
14073
  return;
14074
- const p = this.videoTrackPublications.get(o.trackSid);
14075
- if (!p) {
14074
+ const f = this.videoTrackPublications.get(o.trackSid);
14075
+ if (!f) {
14076
14076
  this.log.warn("received subscribed quality update for unknown track", Object.assign(Object.assign({}, this.logContext), {
14077
14077
  trackSid: o.trackSid
14078
14078
  }));
14079
14079
  return;
14080
14080
  }
14081
- if (!p.videoTrack)
14081
+ if (!f.videoTrack)
14082
14082
  return;
14083
- const g = yield p.videoTrack.setPublishingCodecs(o.subscribedCodecs);
14083
+ const g = yield f.videoTrack.setPublishingCodecs(o.subscribedCodecs);
14084
14084
  try {
14085
- for (var v = !0, m = _i(g), f; f = yield m.next(), c = f.done, !c; v = !0) {
14086
- u = f.value, v = !1;
14085
+ for (var v = !0, m = _i(g), p; p = yield m.next(), c = p.done, !c; v = !0) {
14086
+ u = p.value, v = !1;
14087
14087
  const x = u;
14088
- x0(x) && (this.log.debug("publish ".concat(x, " for ").concat(p.videoTrack.sid), Object.assign(Object.assign({}, this.logContext), Xe(p))), yield this.publishAdditionalCodecForTrack(p.videoTrack, x, p.options));
14088
+ x0(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));
14089
14089
  }
14090
14090
  } catch (x) {
14091
14091
  l = {
@@ -14216,7 +14216,7 @@ class Y_ extends Kp {
14216
14216
  var l, d;
14217
14217
  try {
14218
14218
  let u = !1;
14219
- const h = yield this.engine.client.sendUpdateLocalMetadata((l = s ?? this.metadata) !== null && l !== void 0 ? l : "", (d = r ?? this.name) !== null && d !== void 0 ? d : "", a), p = performance.now();
14219
+ const h = yield this.engine.client.sendUpdateLocalMetadata((l = s ?? this.metadata) !== null && l !== void 0 ? l : "", (d = r ?? this.name) !== null && d !== void 0 ? d : "", a), f = performance.now();
14220
14220
  for (this.pendingSignalRequests.set(h, {
14221
14221
  resolve: o,
14222
14222
  reject: (g) => {
@@ -14227,7 +14227,7 @@ class Y_ extends Kp {
14227
14227
  metadata: s,
14228
14228
  attributes: a
14229
14229
  }
14230
- }); performance.now() - p < 5e3 && !u; ) {
14230
+ }); performance.now() - f < 5e3 && !u; ) {
14231
14231
  if ((!r || this.name === r) && (!s || this.metadata === s) && (!a || Object.entries(a).every((g) => {
14232
14232
  let [v, m] = g;
14233
14233
  return this.attributes[v] === m || m === "" && !this.attributes[v];
@@ -14445,16 +14445,16 @@ class Y_ extends Kp {
14445
14445
  u = n.getConstraints();
14446
14446
  else {
14447
14447
  u = n.constraints;
14448
- let f;
14448
+ let p;
14449
14449
  switch (n.source) {
14450
14450
  case J.Source.Microphone:
14451
- f = "audioinput";
14451
+ p = "audioinput";
14452
14452
  break;
14453
14453
  case J.Source.Camera:
14454
- f = "videoinput";
14454
+ p = "videoinput";
14455
14455
  }
14456
- f && r.activeDeviceMap.has(f) && (u = Object.assign(Object.assign({}, u), {
14457
- deviceId: r.activeDeviceMap.get(f)
14456
+ p && r.activeDeviceMap.has(p) && (u = Object.assign(Object.assign({}, u), {
14457
+ deviceId: r.activeDeviceMap.get(p)
14458
14458
  }));
14459
14459
  }
14460
14460
  if (n instanceof MediaStreamTrack)
@@ -14480,18 +14480,18 @@ class Y_ extends Kp {
14480
14480
  loggerContextCb: () => r.logContext
14481
14481
  });
14482
14482
  let h;
14483
- if (r.trackPublications.forEach((f) => {
14484
- f.track && f.track === n && (h = f);
14483
+ if (r.trackPublications.forEach((p) => {
14484
+ p.track && p.track === n && (h = p);
14485
14485
  }), h)
14486
14486
  return r.log.warn("track has already been published, skipping", Object.assign(Object.assign({}, r.logContext), Xe(h))), h;
14487
- const p = "channelCount" in n.mediaStreamTrack.getSettings() && // @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
14488
- n.mediaStreamTrack.getSettings().channelCount === 2 || n.mediaStreamTrack.getConstraints().channelCount === 2, g = (c = s == null ? void 0 : s.forceStereo) !== null && c !== void 0 ? c : p;
14487
+ const f = "channelCount" in n.mediaStreamTrack.getSettings() && // @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
14488
+ n.mediaStreamTrack.getSettings().channelCount === 2 || n.mediaStreamTrack.getConstraints().channelCount === 2, g = (c = s == null ? void 0 : s.forceStereo) !== null && c !== void 0 ? c : f;
14489
14489
  g && (s || (s = {}), s.dtx === void 0 && r.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", Object.assign(Object.assign({}, r.logContext), Xe(n))), s.red === void 0 && r.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = s.dtx) !== null && l !== void 0 || (s.dtx = !1), (d = s.red) !== null && d !== void 0 || (s.red = !1));
14490
14490
  const v = Object.assign(Object.assign({}, r.roomOptions.publishDefaults), s);
14491
14491
  !P0() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2", Object.assign({}, r.logContext)), v.simulcast = !1), v.source && (n.source = v.source);
14492
- const m = new Promise((f, x) => P(r, void 0, void 0, function* () {
14492
+ const m = new Promise((p, x) => P(r, void 0, void 0, function* () {
14493
14493
  try {
14494
- if (this.engine.client.currentState !== Tt.CONNECTED) {
14494
+ if (this.engine.client.currentState !== Mt.CONNECTED) {
14495
14495
  this.log.debug("deferring track publication until signal is connected", Object.assign(Object.assign({}, this.logContext), {
14496
14496
  track: Xe(n)
14497
14497
  }));
@@ -14500,11 +14500,11 @@ class Y_ extends Kp {
14500
14500
  }, 15e3);
14501
14501
  yield this.waitUntilEngineConnected(), clearTimeout(E);
14502
14502
  const _ = yield this.publish(n, v, g);
14503
- f(_);
14503
+ p(_);
14504
14504
  } else
14505
14505
  try {
14506
14506
  const E = yield this.publish(n, v, g);
14507
- f(E);
14507
+ p(E);
14508
14508
  } catch (E) {
14509
14509
  x(E);
14510
14510
  }
@@ -14515,8 +14515,8 @@ class Y_ extends Kp {
14515
14515
  r.pendingPublishPromises.set(n, m);
14516
14516
  try {
14517
14517
  return yield m;
14518
- } catch (f) {
14519
- throw f;
14518
+ } catch (p) {
14519
+ throw p;
14520
14520
  } finally {
14521
14521
  r.pendingPublishPromises.delete(n);
14522
14522
  }
@@ -14537,14 +14537,14 @@ class Y_ extends Kp {
14537
14537
  }
14538
14538
  publish(e, t, n) {
14539
14539
  return P(this, void 0, void 0, function* () {
14540
- var s, r, a, o, c, l, d, u, h, p;
14540
+ var s, r, a, o, c, l, d, u, h, f;
14541
14541
  if (!this.hasPermissionsToPublish(e))
14542
14542
  throw new Lu("failed to publish track, insufficient permissions", 403);
14543
14543
  Array.from(this.trackPublications.values()).find((y) => $s(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 && bs() && (t.simulcast = !1), t.videoCodec === "av1" && !C0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !M0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Kc), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((y) => t.videoCodec === Lr(y.mime)) || (t.videoCodec = Lr(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
- const m = [], f = !(!((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), f && m.push(jt.TF_NO_DTX), hi(e) && e.hasPreConnectBuffer && m.push(jt.TF_PRECONNECT_BUFFER);
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);
14548
14548
  const E = new Pc({
14549
14549
  // get local track id for use during publishing
14550
14550
  cid: e.mediaStreamTrack.id,
@@ -14552,7 +14552,7 @@ class Y_ extends Kp {
14552
14552
  type: J.kindToProto(e.kind),
14553
14553
  muted: e.isMuted,
14554
14554
  source: J.sourceToProto(e.source),
14555
- disableDtx: f,
14555
+ disableDtx: p,
14556
14556
  encryption: this.encryptionType,
14557
14557
  stereo: n,
14558
14558
  disableRed: this.isE2EEEnabled || !(!((r = t.red) !== null && r !== void 0) || r),
@@ -14590,7 +14590,7 @@ class Y_ extends Kp {
14590
14590
  } else e.kind === J.Kind.Audio && (_ = [{
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",
14593
- networkPriority: (p = (h = t.audioPreset) === null || h === void 0 ? void 0 : h.priority) !== null && p !== void 0 ? p : "high"
14593
+ networkPriority: (f = (h = t.audioPreset) === null || h === void 0 ? void 0 : h.priority) !== null && f !== void 0 ? f : "high"
14594
14594
  }]);
14595
14595
  if (!this.engine || this.engine.isClosed)
14596
14596
  throw new zt("cannot publish track when not connected");
@@ -14669,13 +14669,13 @@ class Y_ extends Kp {
14669
14669
  this.log.debug("waiting for agent", Object.assign(Object.assign({}, this.logContext), Xe(e)));
14670
14670
  const Fe = setTimeout(() => {
14671
14671
  F(new Error("agent not active within 10 seconds"));
14672
- }, 1e4), xt = yield this.waitUntilActiveAgentPresent();
14672
+ }, 1e4), Ct = yield this.waitUntilActiveAgentPresent();
14673
14673
  clearTimeout(Fe), this.log.debug("sending preconnect buffer", Object.assign(Object.assign({}, this.logContext), Xe(e)));
14674
14674
  const dt = yield this.streamBytes({
14675
14675
  name: "preconnect-buffer",
14676
14676
  mimeType: T,
14677
14677
  topic: "lk.agent.pre-connect-audio-buffer",
14678
- destinationIdentities: [xt.identity],
14678
+ destinationIdentities: [Ct.identity],
14679
14679
  attributes: {
14680
14680
  trackId: k.trackSid,
14681
14681
  sampleRate: String((ee = x.sampleRate) !== null && ee !== void 0 ? ee : "48000"),
@@ -14726,8 +14726,8 @@ class Y_ extends Kp {
14726
14726
  if (this.encryptionType !== _n.NONE)
14727
14727
  return;
14728
14728
  let r;
14729
- if (this.trackPublications.forEach((p) => {
14730
- p.track && p.track === e && (r = p);
14729
+ if (this.trackPublications.forEach((f) => {
14730
+ f.track && f.track === e && (r = f);
14731
14731
  }), !r)
14732
14732
  throw new bi("track is not published");
14733
14733
  if (!ki(e))
@@ -14982,19 +14982,19 @@ class Y_ extends Kp {
14982
14982
  } = t;
14983
14983
  return function* () {
14984
14984
  return new Promise((l, d) => P(n, void 0, void 0, function* () {
14985
- var u, h, p, g;
14985
+ var u, h, f, g;
14986
14986
  if (Sd(a) > Hp) {
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 = (p = this.engine.latestJoinResponse) === null || p === void 0 ? void 0 : p.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 && 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) {
14991
14991
  d(It.builtIn("UNSUPPORTED_SERVER"));
14992
14992
  return;
14993
14993
  }
14994
14994
  const v = crypto.randomUUID();
14995
14995
  yield this.publishRpcRequest(s, v, r, a, o - 2e3);
14996
14996
  const m = setTimeout(() => {
14997
- this.pendingAcks.delete(v), d(It.builtIn("CONNECTION_TIMEOUT")), this.pendingResponses.delete(v), clearTimeout(f);
14997
+ this.pendingAcks.delete(v), d(It.builtIn("CONNECTION_TIMEOUT")), this.pendingResponses.delete(v), clearTimeout(p);
14998
14998
  }, 2e3);
14999
14999
  this.pendingAcks.set(v, {
15000
15000
  resolve: () => {
@@ -15002,12 +15002,12 @@ class Y_ extends Kp {
15002
15002
  },
15003
15003
  participantIdentity: s
15004
15004
  });
15005
- const f = setTimeout(() => {
15005
+ const p = setTimeout(() => {
15006
15006
  this.pendingResponses.delete(v), d(It.builtIn("RESPONSE_TIMEOUT"));
15007
15007
  }, o);
15008
15008
  this.pendingResponses.set(v, {
15009
15009
  resolve: (x, E) => {
15010
- clearTimeout(f), this.pendingAcks.has(v) && (console.warn("RPC response received before ack", v), this.pendingAcks.delete(v), clearTimeout(m)), E ? d(E) : l(x ?? "");
15010
+ clearTimeout(p), this.pendingAcks.has(v) && (console.warn("RPC response received before ack", v), this.pendingAcks.delete(v), clearTimeout(m)), E ? d(E) : l(x ?? "");
15011
15011
  },
15012
15012
  participantIdentity: s
15013
15013
  });
@@ -15477,46 +15477,46 @@ class tr extends ri.EventEmitter {
15477
15477
  return this.log.info("already connected to room ".concat(this.name), this.logContext), d(), Promise.resolve();
15478
15478
  if (this.connectFuture)
15479
15479
  return d(), this.connectFuture.promise;
15480
- this.setAndEmitConnectionState(it.Connecting), ((l = this.regionUrlProvider) === null || l === void 0 ? void 0 : l.getServerUrl().toString()) !== a && (this.regionUrl = void 0, this.regionUrlProvider = void 0), qc(new URL(a)) && (this.regionUrlProvider === void 0 ? this.regionUrlProvider = new Qc(a, o) : this.regionUrlProvider.updateToken(o), this.regionUrlProvider.fetchRegionSettings().then((p) => {
15480
+ this.setAndEmitConnectionState(it.Connecting), ((l = this.regionUrlProvider) === null || l === void 0 ? void 0 : l.getServerUrl().toString()) !== a && (this.regionUrl = void 0, this.regionUrlProvider = void 0), qc(new URL(a)) && (this.regionUrlProvider === void 0 ? this.regionUrlProvider = new Qc(a, o) : this.regionUrlProvider.updateToken(o), this.regionUrlProvider.fetchRegionSettings().then((f) => {
15481
15481
  var g;
15482
- (g = this.regionUrlProvider) === null || g === void 0 || g.setServerReportedRegions(p);
15483
- }).catch((p) => {
15482
+ (g = this.regionUrlProvider) === null || g === void 0 || g.setServerReportedRegions(f);
15483
+ }).catch((f) => {
15484
15484
  this.log.warn("could not fetch region settings", Object.assign(Object.assign({}, this.logContext), {
15485
- error: p
15485
+ error: f
15486
15486
  }));
15487
15487
  }));
15488
- const u = (p, g, v) => P(this, void 0, void 0, function* () {
15489
- var m, f;
15488
+ const u = (f, g, v) => P(this, void 0, void 0, function* () {
15489
+ var m, p;
15490
15490
  this.abortController && this.abortController.abort();
15491
15491
  const x = new AbortController();
15492
15492
  this.abortController = x, d == null || d();
15493
15493
  try {
15494
- yield this.attemptConnection(v ?? a, o, c, x), this.abortController = void 0, p();
15494
+ yield this.attemptConnection(v ?? a, o, c, x), this.abortController = void 0, f();
15495
15495
  } catch (E) {
15496
- if (this.regionUrlProvider && E instanceof mt && E.reason !== Ke.Cancelled && E.reason !== Ke.NotAllowed) {
15496
+ if (this.regionUrlProvider && E instanceof _t && E.reason !== Ke.Cancelled && E.reason !== Ke.NotAllowed) {
15497
15497
  let _ = null;
15498
15498
  try {
15499
15499
  _ = yield this.regionUrlProvider.getNextBestRegionUrl((m = this.abortController) === null || m === void 0 ? void 0 : m.signal);
15500
15500
  } catch (S) {
15501
- if (S instanceof mt && (S.status === 401 || S.reason === Ke.Cancelled)) {
15501
+ if (S instanceof _t && (S.status === 401 || S.reason === Ke.Cancelled)) {
15502
15502
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), g(S);
15503
15503
  return;
15504
15504
  }
15505
15505
  }
15506
- _ && !(!((f = this.abortController) === null || f === void 0) && f.signal.aborted) ? (this.log.info("Initial connection failed with ConnectionError: ".concat(E.message, ". Retrying with another region: ").concat(_), this.logContext), this.recreateEngine(), yield u(p, g, _)) : (this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Hu(E)), g(E));
15506
+ _ && !(!((p = this.abortController) === null || p === void 0) && p.signal.aborted) ? (this.log.info("Initial connection failed with ConnectionError: ".concat(E.message, ". Retrying with another region: ").concat(_), this.logContext), this.recreateEngine(), yield u(f, g, _)) : (this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Hu(E)), g(E));
15507
15507
  } else {
15508
15508
  let _ = Fn.UNKNOWN_REASON;
15509
- E instanceof mt && (_ = Hu(E)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, _), g(E);
15509
+ E instanceof _t && (_ = Hu(E)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, _), g(E);
15510
15510
  }
15511
15511
  }
15512
15512
  }), h = this.regionUrl;
15513
- return this.regionUrl = void 0, this.connectFuture = new Yn((p, g) => {
15514
- u(p, g, h);
15513
+ return this.regionUrl = void 0, this.connectFuture = new Yn((f, g) => {
15514
+ u(f, g, h);
15515
15515
  }, () => {
15516
15516
  this.clearConnectionFutures();
15517
15517
  }), this.connectFuture.promise;
15518
15518
  }), this.connectSignal = (a, o, c, l, d, u) => P(this, void 0, void 0, function* () {
15519
- var h, p, g;
15519
+ var h, f, g;
15520
15520
  const v = yield c.join(a, o, {
15521
15521
  autoSubscribe: l.autoSubscribe,
15522
15522
  adaptiveStream: typeof d.adaptiveStream == "object" ? !0 : d.adaptiveStream,
@@ -15528,12 +15528,12 @@ class tr extends ri.EventEmitter {
15528
15528
  if (m || (m = {
15529
15529
  version: v.serverVersion,
15530
15530
  region: v.serverRegion
15531
- }), this.serverInfo = m, this.log.debug("connected to Livekit Server ".concat(Object.entries(m).map((f) => {
15532
- let [x, E] = f;
15531
+ }), this.serverInfo = m, this.log.debug("connected to Livekit Server ".concat(Object.entries(m).map((p) => {
15532
+ let [x, E] = p;
15533
15533
  return "".concat(x, ": ").concat(E);
15534
15534
  }).join(", ")), {
15535
15535
  room: (h = v.room) === null || h === void 0 ? void 0 : h.name,
15536
- roomSid: (p = v.room) === null || p === void 0 ? void 0 : p.sid,
15536
+ roomSid: (f = v.room) === null || f === void 0 ? void 0 : f.sid,
15537
15537
  identity: (g = v.participant) === null || g === void 0 ? void 0 : g.identity
15538
15538
  }), !m.version)
15539
15539
  throw new h0("unknown server version");
@@ -15557,13 +15557,13 @@ class tr extends ri.EventEmitter {
15557
15557
  this.applyJoinResponse(h), this.setupLocalParticipantEvents(), this.emit(ne.SignalConnected);
15558
15558
  } catch (h) {
15559
15559
  yield this.engine.close(), this.recreateEngine();
15560
- const p = new mt("could not establish signal connection", Ke.ServerUnreachable);
15561
- throw h instanceof Error && (p.message = "".concat(p.message, ": ").concat(h.message)), h instanceof mt && (p.reason = h.reason, p.status = h.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
15560
+ const f = new _t("could not establish signal connection", Ke.ServerUnreachable);
15561
+ throw h instanceof Error && (f.message = "".concat(f.message, ": ").concat(h.message)), h instanceof _t && (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
- })), p;
15563
+ })), f;
15564
15564
  }
15565
15565
  if (l.signal.aborted)
15566
- throw yield this.engine.close(), this.recreateEngine(), new mt("Connection attempt aborted", Ke.Cancelled);
15566
+ throw yield this.engine.close(), this.recreateEngine(), new _t("Connection attempt aborted", Ke.Cancelled);
15567
15567
  try {
15568
15568
  yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout, l);
15569
15569
  } catch (h) {
@@ -15577,14 +15577,14 @@ class tr extends ri.EventEmitter {
15577
15577
  var l = this;
15578
15578
  let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
15579
15579
  return function* () {
15580
- var u, h, p, g;
15580
+ var u, h, f, g;
15581
15581
  const v = yield l.disconnectLock.lock();
15582
15582
  try {
15583
15583
  if (l.state === it.Disconnected) {
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(), (p = (h = l.connectFuture) === null || h === void 0 ? void 0 : h.reject) === null || p === void 0 || p.call(h, new mt("Client initiated disconnect", Ke.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 _t("Client initiated disconnect", Ke.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;
15588
15588
  } finally {
15589
15589
  v();
15590
15590
  }
@@ -15790,8 +15790,8 @@ class tr extends ri.EventEmitter {
15790
15790
  }, this.onLocalTrackPublished = (a) => P(this, void 0, void 0, function* () {
15791
15791
  var o, c, l, d, u, h;
15792
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(ne.LocalTrackPublished, a, this.localParticipant), hi(a.track) && (yield a.track.checkForSilence()) && this.emit(ne.LocalAudioSilenceDetected, a);
15793
- const p = yield (h = a.track) === null || h === void 0 ? void 0 : h.getDeviceId(!1), g = Yc(a.source);
15794
- g && p && p !== this.localParticipant.activeDeviceMap.get(g) && (this.localParticipant.activeDeviceMap.set(g, p), this.emit(ne.ActiveDeviceChanged, g, p));
15793
+ const f = yield (h = a.track) === null || h === void 0 ? void 0 : h.getDeviceId(!1), g = Yc(a.source);
15794
+ g && f && f !== this.localParticipant.activeDeviceMap.get(g) && (this.localParticipant.activeDeviceMap.set(g, f), this.emit(ne.ActiveDeviceChanged, g, f));
15795
15795
  }), this.onLocalTrackUnpublished = (a) => {
15796
15796
  var o, c;
15797
15797
  (o = a.track) === null || o === void 0 || o.off(re.TrackProcessorUpdate, this.onTrackProcessorUpdate), (c = a.track) === null || c === void 0 || c.off(re.Restarted, this.onLocalTrackRestarted), this.emit(ne.LocalTrackUnpublished, a, this.localParticipant);
@@ -16155,14 +16155,14 @@ class tr extends ri.EventEmitter {
16155
16155
  var r = this;
16156
16156
  let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
16157
16157
  return function* () {
16158
- var o, c, l, d, u, h, p;
16158
+ var o, c, l, d, u, h, f;
16159
16159
  let g = !0, v = !1;
16160
16160
  const m = a ? {
16161
16161
  exact: s
16162
16162
  } : s;
16163
16163
  if (n === "audioinput") {
16164
16164
  v = r.localParticipant.audioTrackPublications.size === 0;
16165
- const f = (o = r.getActiveDevice(n)) !== null && o !== void 0 ? o : r.options.audioCaptureDefaults.deviceId;
16165
+ const p = (o = r.getActiveDevice(n)) !== null && o !== void 0 ? o : r.options.audioCaptureDefaults.deviceId;
16166
16166
  r.options.audioCaptureDefaults.deviceId = m;
16167
16167
  const x = Array.from(r.localParticipant.audioTrackPublications.values()).filter((_) => _.source === J.Source.Microphone);
16168
16168
  try {
@@ -16171,7 +16171,7 @@ class tr extends ri.EventEmitter {
16171
16171
  return (S = _.audioTrack) === null || S === void 0 ? void 0 : S.setDeviceId(m);
16172
16172
  }))).every((_) => _ === !0);
16173
16173
  } catch (_) {
16174
- throw r.options.audioCaptureDefaults.deviceId = f, _;
16174
+ throw r.options.audioCaptureDefaults.deviceId = p, _;
16175
16175
  }
16176
16176
  const E = x.some((_) => {
16177
16177
  var S, M;
@@ -16180,7 +16180,7 @@ class tr extends ri.EventEmitter {
16180
16180
  g && E && (v = !0);
16181
16181
  } else if (n === "videoinput") {
16182
16182
  v = r.localParticipant.videoTrackPublications.size === 0;
16183
- const f = (c = r.getActiveDevice(n)) !== null && c !== void 0 ? c : r.options.videoCaptureDefaults.deviceId;
16183
+ const p = (c = r.getActiveDevice(n)) !== null && c !== void 0 ? c : r.options.videoCaptureDefaults.deviceId;
16184
16184
  r.options.videoCaptureDefaults.deviceId = m;
16185
16185
  const x = Array.from(r.localParticipant.videoTrackPublications.values()).filter((_) => _.source === J.Source.Camera);
16186
16186
  try {
@@ -16189,7 +16189,7 @@ class tr extends ri.EventEmitter {
16189
16189
  return (S = _.videoTrack) === null || S === void 0 ? void 0 : S.setDeviceId(m);
16190
16190
  }))).every((_) => _ === !0);
16191
16191
  } catch (_) {
16192
- throw r.options.videoCaptureDefaults.deviceId = f, _;
16192
+ throw r.options.videoCaptureDefaults.deviceId = p, _;
16193
16193
  }
16194
16194
  const E = x.some((_) => {
16195
16195
  var S, M;
@@ -16199,15 +16199,15 @@ class tr extends ri.EventEmitter {
16199
16199
  } else if (n === "audiooutput") {
16200
16200
  if (v = !0, !Wc() && !r.options.webAudioMix || r.options.webAudioMix && r.audioContext && !("setSinkId" in r.audioContext))
16201
16201
  throw new Error("cannot switch audio output, the current browser does not support it");
16202
- r.options.webAudioMix && (s = (l = yield Xt.getInstance().normalizeDeviceId("audiooutput", s)) !== null && l !== void 0 ? l : ""), (d = (p = r.options).audioOutput) !== null && d !== void 0 || (p.audioOutput = {});
16203
- const f = (u = r.getActiveDevice(n)) !== null && u !== void 0 ? u : r.options.audioOutput.deviceId;
16202
+ r.options.webAudioMix && (s = (l = yield Xt.getInstance().normalizeDeviceId("audiooutput", s)) !== null && l !== void 0 ? l : ""), (d = (f = r.options).audioOutput) !== null && d !== void 0 || (f.audioOutput = {});
16203
+ const p = (u = r.getActiveDevice(n)) !== null && u !== void 0 ? u : r.options.audioOutput.deviceId;
16204
16204
  r.options.audioOutput.deviceId = s;
16205
16205
  try {
16206
16206
  r.options.webAudioMix && ((h = r.audioContext) === null || h === void 0 || h.setSinkId(s)), yield Promise.all(Array.from(r.remoteParticipants.values()).map((x) => x.setAudioOutput({
16207
16207
  deviceId: s
16208
16208
  })));
16209
16209
  } catch (x) {
16210
- throw r.options.audioOutput.deviceId = f, x;
16210
+ throw r.options.audioOutput.deviceId = p, x;
16211
16211
  }
16212
16212
  }
16213
16213
  return v && (r.localParticipant.activeDeviceMap.set(n, s), r.emit(ne.ActiveDeviceChanged, n, s)), g;
@@ -16323,12 +16323,12 @@ class tr extends ri.EventEmitter {
16323
16323
  const l = z0(c), d = this.localParticipant.getTrackPublication(l);
16324
16324
  if (d && (!((e = d.track) === null || e === void 0) && e.isUserProvided))
16325
16325
  continue;
16326
- const u = r.filter((p) => p.kind === c), h = this.getActiveDevice(c);
16327
- if (h === ((t = s.filter((p) => p.kind === c)[0]) === null || t === void 0 ? void 0 : t.deviceId) && u.length > 0 && ((n = u[0]) === null || n === void 0 ? void 0 : n.deviceId) !== h) {
16326
+ const u = r.filter((f) => f.kind === c), h = this.getActiveDevice(c);
16327
+ if (h === ((t = s.filter((f) => f.kind === c)[0]) === null || t === void 0 ? void 0 : t.deviceId) && u.length > 0 && ((n = u[0]) === null || n === void 0 ? void 0 : n.deviceId) !== h) {
16328
16328
  yield this.switchActiveDevice(c, u[0].deviceId);
16329
16329
  continue;
16330
16330
  }
16331
- c === "audioinput" && !Gr() || c === "videoinput" || u.length > 0 && !u.find((p) => p.deviceId === this.getActiveDevice(c)) && // avoid switching audio output on safari without explicit user action as it leads to slowed down audio playback
16331
+ c === "audioinput" && !Gr() || c === "videoinput" || u.length > 0 && !u.find((f) => f.deviceId === this.getActiveDevice(c)) && // avoid switching audio output on safari without explicit user action as it leads to slowed down audio playback
16332
16332
  (c !== "audiooutput" || !Gr()) && (yield this.switchActiveDevice(c, u[0].deviceId));
16333
16333
  }
16334
16334
  });
@@ -16704,14 +16704,14 @@ class Z_ extends Ki {
16704
16704
  for (let g = 0; g < c; g++)
16705
16705
  yield r.write(l);
16706
16706
  yield r.close();
16707
- const u = Date.now(), h = yield (n = this.room.engine.pcManager) === null || n === void 0 ? void 0 : n.publisher.getStats(), p = {
16707
+ const u = Date.now(), h = yield (n = this.room.engine.pcManager) === null || n === void 0 ? void 0 : n.publisher.getStats(), f = {
16708
16708
  region: s,
16709
16709
  rtt: 1e4,
16710
16710
  duration: u - d
16711
16711
  };
16712
16712
  return h == null || h.forEach((g) => {
16713
- g.type === "candidate-pair" && g.nominated && (p.rtt = g.currentRoundTripTime * 1e3);
16714
- }), yield this.disconnect(), p;
16713
+ g.type === "candidate-pair" && g.nominated && (f.rtt = g.currentRoundTripTime * 1e3);
16714
+ }), yield this.disconnect(), f;
16715
16715
  });
16716
16716
  }
16717
16717
  }
@@ -16762,8 +16762,8 @@ class Q_ extends Ki {
16762
16762
  count: 0
16763
16763
  }, u = setInterval(() => P(this, void 0, void 0, function* () {
16764
16764
  const h = yield l.getRTCStatsReport();
16765
- h == null || h.forEach((p) => {
16766
- p.type === "outbound-rtp" ? (d.packetsSent = p.packetsSent, d.qualityLimitationDurations = p.qualityLimitationDurations, d.bitrateTotal += p.targetBitrate, d.count++) : p.type === "remote-inbound-rtp" && (d.packetsLost = p.packetsLost, d.rttTotal += p.roundTripTime, d.jitterTotal += p.jitter);
16765
+ h == null || h.forEach((f) => {
16766
+ f.type === "outbound-rtp" ? (d.packetsSent = f.packetsSent, d.qualityLimitationDurations = f.qualityLimitationDurations, d.bitrateTotal += f.targetBitrate, d.count++) : f.type === "remote-inbound-rtp" && (d.packetsLost = f.packetsLost, d.rttTotal += f.roundTripTime, d.jitterTotal += f.jitter);
16767
16767
  });
16768
16768
  }), 1e3);
16769
16769
  return yield new Promise((h) => setTimeout(h, Wo)), clearInterval(u), o.stop(), t.remove(), yield this.disconnect(), d;
@@ -16824,12 +16824,12 @@ class tb extends Ki {
16824
16824
  var r, a, o, c;
16825
16825
  const l = document.createElement("canvas"), d = e.getSettings(), u = (a = (r = d.width) !== null && r !== void 0 ? r : n.videoWidth) !== null && a !== void 0 ? a : 1280, h = (c = (o = d.height) !== null && o !== void 0 ? o : n.videoHeight) !== null && c !== void 0 ? c : 720;
16826
16826
  l.width = u, l.height = h;
16827
- const p = l.getContext("2d");
16828
- p.drawImage(n, 0, 0);
16829
- const v = p.getImageData(0, 0, l.width, l.height).data;
16827
+ const f = l.getContext("2d");
16828
+ f.drawImage(n, 0, 0);
16829
+ const v = f.getImageData(0, 0, l.width, l.height).data;
16830
16830
  let m = !0;
16831
- for (let f = 0; f < v.length; f += 4)
16832
- if (v[f] !== 0 || v[f + 1] !== 0 || v[f + 2] !== 0) {
16831
+ for (let p = 0; p < v.length; p += 4)
16832
+ if (v[p] !== 0 || v[p + 1] !== 0 || v[p + 2] !== 0) {
16833
16833
  m = !1;
16834
16834
  break;
16835
16835
  }
@@ -17107,7 +17107,11 @@ class Ed extends EventTarget {
17107
17107
  setTimeout(async () => {
17108
17108
  if (t)
17109
17109
  try {
17110
- await n.localParticipant.setMicrophoneEnabled(!0), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), t.getTracks().forEach((l) => l.stop()), setTimeout(() => {
17110
+ await n.localParticipant.setMicrophoneEnabled(!0, {
17111
+ echoCancellation: !0,
17112
+ noiseSuppression: !0,
17113
+ autoGainControl: !0
17114
+ }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), t.getTracks().forEach((l) => l.stop()), setTimeout(() => {
17111
17115
  const l = Array.from(n.localParticipant.audioTrackPublications.values()).find((d) => d.kind === "audio");
17112
17116
  if (l != null && l.track) {
17113
17117
  const d = l.track.mediaStreamTrack;
@@ -17226,7 +17230,11 @@ class Ed extends EventTarget {
17226
17230
  async toggleMicrophone() {
17227
17231
  if (this.room)
17228
17232
  try {
17229
- this.microphoneEnabled ? (await this.room.localParticipant.setMicrophoneEnabled(!1), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"))) : (await this.room.localParticipant.setMicrophoneEnabled(!0), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")));
17233
+ this.microphoneEnabled ? (await this.room.localParticipant.setMicrophoneEnabled(!1), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"))) : (await this.room.localParticipant.setMicrophoneEnabled(!0, {
17234
+ echoCancellation: !0,
17235
+ noiseSuppression: !0,
17236
+ autoGainControl: !0
17237
+ }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")));
17230
17238
  } catch (e) {
17231
17239
  this.error = `Failed to toggle microphone: ${e instanceof Error ? e.message : String(e)}`, this.dispatchEvent(
17232
17240
  new CustomEvent("error", {
@@ -17994,24 +18002,24 @@ class Kr {
17994
18002
  * @see {@link Quaternion#slerp}
17995
18003
  */
17996
18004
  static slerpFlat(e, t, n, s, r, a, o) {
17997
- let c = n[s + 0], l = n[s + 1], d = n[s + 2], u = n[s + 3], h = r[a + 0], p = r[a + 1], g = r[a + 2], v = r[a + 3];
18005
+ let c = n[s + 0], l = n[s + 1], d = n[s + 2], u = n[s + 3], h = r[a + 0], f = r[a + 1], g = r[a + 2], v = r[a + 3];
17998
18006
  if (o <= 0) {
17999
18007
  e[t + 0] = c, e[t + 1] = l, e[t + 2] = d, e[t + 3] = u;
18000
18008
  return;
18001
18009
  }
18002
18010
  if (o >= 1) {
18003
- e[t + 0] = h, e[t + 1] = p, e[t + 2] = g, e[t + 3] = v;
18011
+ e[t + 0] = h, e[t + 1] = f, e[t + 2] = g, e[t + 3] = v;
18004
18012
  return;
18005
18013
  }
18006
- if (u !== v || c !== h || l !== p || d !== g) {
18007
- let m = c * h + l * p + d * g + u * v;
18008
- m < 0 && (h = -h, p = -p, g = -g, v = -v, m = -m);
18009
- let f = 1 - o;
18014
+ if (u !== v || c !== h || l !== f || d !== g) {
18015
+ let m = c * h + l * f + d * g + u * v;
18016
+ m < 0 && (h = -h, f = -f, g = -g, v = -v, m = -m);
18017
+ let p = 1 - o;
18010
18018
  if (m < 0.9995) {
18011
18019
  const x = Math.acos(m), E = Math.sin(x);
18012
- f = Math.sin(f * x) / E, o = Math.sin(o * x) / E, c = c * f + h * o, l = l * f + p * o, d = d * f + g * o, u = u * f + v * o;
18020
+ p = Math.sin(p * x) / E, o = Math.sin(o * x) / E, c = c * p + h * o, l = l * p + f * o, d = d * p + g * o, u = u * p + v * o;
18013
18021
  } else {
18014
- c = c * f + h * o, l = l * f + p * o, d = d * f + g * o, u = u * f + v * o;
18022
+ c = c * p + h * o, l = l * p + f * o, d = d * p + g * o, u = u * p + v * o;
18015
18023
  const x = 1 / Math.sqrt(c * c + l * l + d * d + u * u);
18016
18024
  c *= x, l *= x, d *= x, u *= x;
18017
18025
  }
@@ -18032,8 +18040,8 @@ class Kr {
18032
18040
  * @see {@link Quaternion#multiplyQuaternions}.
18033
18041
  */
18034
18042
  static multiplyQuaternionsFlat(e, t, n, s, r, a) {
18035
- const o = n[s], c = n[s + 1], l = n[s + 2], d = n[s + 3], u = r[a], h = r[a + 1], p = r[a + 2], g = r[a + 3];
18036
- return e[t] = o * g + d * u + c * p - l * h, e[t + 1] = c * g + d * h + l * u - o * p, e[t + 2] = l * g + d * p + o * h - c * u, e[t + 3] = d * g - o * u - c * h - l * p, e;
18043
+ const o = n[s], c = n[s + 1], l = n[s + 2], d = n[s + 3], u = r[a], h = r[a + 1], f = r[a + 2], g = r[a + 3];
18044
+ return e[t] = o * g + d * u + c * f - l * h, e[t + 1] = c * g + d * h + l * u - o * f, e[t + 2] = l * g + d * f + o * h - c * u, e[t + 3] = d * g - o * u - c * h - l * f, e;
18037
18045
  }
18038
18046
  /**
18039
18047
  * The x value of this quaternion.
@@ -18121,25 +18129,25 @@ class Kr {
18121
18129
  * @return {Quaternion} A reference to this quaternion.
18122
18130
  */
18123
18131
  setFromEuler(e, t = !0) {
18124
- const n = e._x, s = e._y, r = e._z, a = e._order, o = Math.cos, c = Math.sin, l = o(n / 2), d = o(s / 2), u = o(r / 2), h = c(n / 2), p = c(s / 2), g = c(r / 2);
18132
+ const n = e._x, s = e._y, r = e._z, a = e._order, o = Math.cos, c = Math.sin, l = o(n / 2), d = o(s / 2), u = o(r / 2), h = c(n / 2), f = c(s / 2), g = c(r / 2);
18125
18133
  switch (a) {
18126
18134
  case "XYZ":
18127
- this._x = h * d * u + l * p * g, this._y = l * p * u - h * d * g, this._z = l * d * g + h * p * u, this._w = l * d * u - h * p * g;
18135
+ this._x = h * d * u + l * f * g, this._y = l * f * u - h * d * g, this._z = l * d * g + h * f * u, this._w = l * d * u - h * f * g;
18128
18136
  break;
18129
18137
  case "YXZ":
18130
- this._x = h * d * u + l * p * g, this._y = l * p * u - h * d * g, this._z = l * d * g - h * p * u, this._w = l * d * u + h * p * g;
18138
+ this._x = h * d * u + l * f * g, this._y = l * f * u - h * d * g, this._z = l * d * g - h * f * u, this._w = l * d * u + h * f * g;
18131
18139
  break;
18132
18140
  case "ZXY":
18133
- this._x = h * d * u - l * p * g, this._y = l * p * u + h * d * g, this._z = l * d * g + h * p * u, this._w = l * d * u - h * p * g;
18141
+ this._x = h * d * u - l * f * g, this._y = l * f * u + h * d * g, this._z = l * d * g + h * f * u, this._w = l * d * u - h * f * g;
18134
18142
  break;
18135
18143
  case "ZYX":
18136
- this._x = h * d * u - l * p * g, this._y = l * p * u + h * d * g, this._z = l * d * g - h * p * u, this._w = l * d * u + h * p * g;
18144
+ this._x = h * d * u - l * f * g, this._y = l * f * u + h * d * g, this._z = l * d * g - h * f * u, this._w = l * d * u + h * f * g;
18137
18145
  break;
18138
18146
  case "YZX":
18139
- this._x = h * d * u + l * p * g, this._y = l * p * u + h * d * g, this._z = l * d * g - h * p * u, this._w = l * d * u - h * p * g;
18147
+ this._x = h * d * u + l * f * g, this._y = l * f * u + h * d * g, this._z = l * d * g - h * f * u, this._w = l * d * u - h * f * g;
18140
18148
  break;
18141
18149
  case "XZY":
18142
- this._x = h * d * u - l * p * g, this._y = l * p * u - h * d * g, this._z = l * d * g + h * p * u, this._w = l * d * u + h * p * g;
18150
+ this._x = h * d * u - l * f * g, this._y = l * f * u - h * d * g, this._z = l * d * g + h * f * u, this._w = l * d * u + h * f * g;
18143
18151
  break;
18144
18152
  default:
18145
18153
  Oe("Quaternion: .setFromEuler() encountered an unknown order: " + a);
@@ -18166,17 +18174,17 @@ class Kr {
18166
18174
  setFromRotationMatrix(e) {
18167
18175
  const t = e.elements, n = t[0], s = t[4], r = t[8], a = t[1], o = t[5], c = t[9], l = t[2], d = t[6], u = t[10], h = n + o + u;
18168
18176
  if (h > 0) {
18169
- const p = 0.5 / Math.sqrt(h + 1);
18170
- this._w = 0.25 / p, this._x = (d - c) * p, this._y = (r - l) * p, this._z = (a - s) * p;
18177
+ const f = 0.5 / Math.sqrt(h + 1);
18178
+ this._w = 0.25 / f, this._x = (d - c) * f, this._y = (r - l) * f, this._z = (a - s) * f;
18171
18179
  } else if (n > o && n > u) {
18172
- const p = 2 * Math.sqrt(1 + n - o - u);
18173
- this._w = (d - c) / p, this._x = 0.25 * p, this._y = (s + a) / p, this._z = (r + l) / p;
18180
+ const f = 2 * Math.sqrt(1 + n - o - u);
18181
+ this._w = (d - c) / f, this._x = 0.25 * f, this._y = (s + a) / f, this._z = (r + l) / f;
18174
18182
  } else if (o > u) {
18175
- const p = 2 * Math.sqrt(1 + o - n - u);
18176
- this._w = (r - l) / p, this._x = (s + a) / p, this._y = 0.25 * p, this._z = (c + d) / p;
18183
+ const f = 2 * Math.sqrt(1 + o - n - u);
18184
+ this._w = (r - l) / f, this._x = (s + a) / f, this._y = 0.25 * f, this._z = (c + d) / f;
18177
18185
  } else {
18178
- const p = 2 * Math.sqrt(1 + u - n - o);
18179
- this._w = (a - s) / p, this._x = (r + l) / p, this._y = (c + d) / p, this._z = 0.25 * p;
18186
+ const f = 2 * Math.sqrt(1 + u - n - o);
18187
+ this._w = (a - s) / f, this._x = (r + l) / f, this._y = (c + d) / f, this._z = 0.25 * f;
18180
18188
  }
18181
18189
  return this._onChangeCallback(), this;
18182
18190
  }
@@ -19308,8 +19316,8 @@ class ze {
19308
19316
  * @return {Matrix3} A reference to this matrix.
19309
19317
  */
19310
19318
  multiplyMatrices(e, t) {
19311
- const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[3], c = n[6], l = n[1], d = n[4], u = n[7], h = n[2], p = n[5], g = n[8], v = s[0], m = s[3], f = s[6], x = s[1], E = s[4], _ = s[7], S = s[2], M = s[5], A = s[8];
19312
- return r[0] = a * v + o * x + c * S, r[3] = a * m + o * E + c * M, r[6] = a * f + o * _ + c * A, r[1] = l * v + d * x + u * S, r[4] = l * m + d * E + u * M, r[7] = l * f + d * _ + u * A, r[2] = h * v + p * x + g * S, r[5] = h * m + p * E + g * M, r[8] = h * f + p * _ + g * A, this;
19319
+ const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[3], c = n[6], l = n[1], d = n[4], u = n[7], h = n[2], f = n[5], g = n[8], v = s[0], m = s[3], p = s[6], x = s[1], E = s[4], _ = s[7], S = s[2], M = s[5], A = s[8];
19320
+ return r[0] = a * v + o * x + c * S, r[3] = a * m + o * E + c * M, r[6] = a * p + o * _ + c * A, r[1] = l * v + d * x + u * S, r[4] = l * m + d * E + u * M, r[7] = l * p + d * _ + u * A, r[2] = h * v + f * x + g * S, r[5] = h * m + f * E + g * M, r[8] = h * p + f * _ + g * A, this;
19313
19321
  }
19314
19322
  /**
19315
19323
  * Multiplies every component of the matrix by the given scalar.
@@ -19338,10 +19346,10 @@ class ze {
19338
19346
  * @return {Matrix3} A reference to this matrix.
19339
19347
  */
19340
19348
  invert() {
19341
- const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], c = e[6], l = e[7], d = e[8], u = d * a - o * l, h = o * c - d * r, p = l * r - a * c, g = t * u + n * h + s * p;
19349
+ const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], c = e[6], l = e[7], d = e[8], u = d * a - o * l, h = o * c - d * r, f = l * r - a * c, g = t * u + n * h + s * f;
19342
19350
  if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
19343
19351
  const v = 1 / g;
19344
- return e[0] = u * v, e[1] = (s * l - d * n) * v, e[2] = (o * n - s * a) * v, e[3] = h * v, e[4] = (d * t - s * c) * v, e[5] = (s * r - o * t) * v, e[6] = p * v, e[7] = (n * c - l * t) * v, e[8] = (a * t - n * r) * v, this;
19352
+ return e[0] = u * v, e[1] = (s * l - d * n) * v, e[2] = (o * n - s * a) * v, e[3] = h * v, e[4] = (d * t - s * c) * v, e[5] = (s * r - o * t) * v, e[6] = f * v, e[7] = (n * c - l * t) * v, e[8] = (a * t - n * r) * v, this;
19345
19353
  }
19346
19354
  /**
19347
19355
  * Transposes this matrix in place.
@@ -20285,16 +20293,16 @@ class Lt {
20285
20293
  */
20286
20294
  setAxisAngleFromRotationMatrix(e) {
20287
20295
  let t, n, s, r;
20288
- const c = e.elements, l = c[0], d = c[4], u = c[8], h = c[1], p = c[5], g = c[9], v = c[2], m = c[6], f = c[10];
20296
+ const c = e.elements, l = c[0], d = c[4], u = c[8], h = c[1], f = c[5], g = c[9], v = c[2], m = c[6], p = c[10];
20289
20297
  if (Math.abs(d - h) < 0.01 && Math.abs(u - v) < 0.01 && Math.abs(g - m) < 0.01) {
20290
- if (Math.abs(d + h) < 0.1 && Math.abs(u + v) < 0.1 && Math.abs(g + m) < 0.1 && Math.abs(l + p + f - 3) < 0.1)
20298
+ if (Math.abs(d + h) < 0.1 && Math.abs(u + v) < 0.1 && Math.abs(g + m) < 0.1 && Math.abs(l + f + p - 3) < 0.1)
20291
20299
  return this.set(1, 0, 0, 0), this;
20292
20300
  t = Math.PI;
20293
- const E = (l + 1) / 2, _ = (p + 1) / 2, S = (f + 1) / 2, M = (d + h) / 4, A = (u + v) / 4, k = (g + m) / 4;
20301
+ const E = (l + 1) / 2, _ = (f + 1) / 2, S = (p + 1) / 2, M = (d + h) / 4, A = (u + v) / 4, k = (g + m) / 4;
20294
20302
  return E > _ && E > S ? E < 0.01 ? (n = 0, s = 0.707106781, r = 0.707106781) : (n = Math.sqrt(E), s = M / n, r = A / n) : _ > S ? _ < 0.01 ? (n = 0.707106781, s = 0, r = 0.707106781) : (s = Math.sqrt(_), n = M / s, r = k / s) : S < 0.01 ? (n = 0.707106781, s = 0.707106781, r = 0) : (r = Math.sqrt(S), n = A / r, s = k / r), this.set(n, s, r, t), this;
20295
20303
  }
20296
20304
  let x = Math.sqrt((m - g) * (m - g) + (u - v) * (u - v) + (h - d) * (h - d));
20297
- return Math.abs(x) < 1e-3 && (x = 1), this.x = (m - g) / x, this.y = (u - v) / x, this.z = (h - d) / x, this.w = Math.acos((l + p + f - 1) / 2), this;
20305
+ return Math.abs(x) < 1e-3 && (x = 1), this.x = (m - g) / x, this.y = (u - v) / x, this.z = (h - d) / x, this.w = Math.acos((l + f + p - 1) / 2), this;
20298
20306
  }
20299
20307
  /**
20300
20308
  * Sets the vector components to the position elements of the
@@ -21478,22 +21486,22 @@ class Kb {
21478
21486
  distanceSqToSegment(e, t, n, s) {
21479
21487
  ec.copy(e).add(t).multiplyScalar(0.5), oa.copy(t).sub(e).normalize(), Li.copy(this.origin).sub(ec);
21480
21488
  const r = e.distanceTo(t) * 0.5, a = -this.direction.dot(oa), o = Li.dot(this.direction), c = -Li.dot(oa), l = Li.lengthSq(), d = Math.abs(1 - a * a);
21481
- let u, h, p, g;
21489
+ let u, h, f, g;
21482
21490
  if (d > 0)
21483
21491
  if (u = a * c - o, h = a * o - c, g = r * d, u >= 0)
21484
21492
  if (h >= -g)
21485
21493
  if (h <= g) {
21486
21494
  const v = 1 / d;
21487
- u *= v, h *= v, p = u * (u + a * h + 2 * o) + h * (a * u + h + 2 * c) + l;
21495
+ u *= v, h *= v, f = u * (u + a * h + 2 * o) + h * (a * u + h + 2 * c) + l;
21488
21496
  } else
21489
- h = r, u = Math.max(0, -(a * h + o)), p = -u * u + h * (h + 2 * c) + l;
21497
+ h = r, u = Math.max(0, -(a * h + o)), f = -u * u + h * (h + 2 * c) + l;
21490
21498
  else
21491
- h = -r, u = Math.max(0, -(a * h + o)), p = -u * u + h * (h + 2 * c) + l;
21499
+ h = -r, u = Math.max(0, -(a * h + o)), f = -u * u + h * (h + 2 * c) + l;
21492
21500
  else
21493
- h <= -g ? (u = Math.max(0, -(-a * r + o)), h = u > 0 ? -r : Math.min(Math.max(-r, -c), r), p = -u * u + h * (h + 2 * c) + l) : h <= g ? (u = 0, h = Math.min(Math.max(-r, -c), r), p = h * (h + 2 * c) + l) : (u = Math.max(0, -(a * r + o)), h = u > 0 ? r : Math.min(Math.max(-r, -c), r), p = -u * u + h * (h + 2 * c) + l);
21501
+ h <= -g ? (u = Math.max(0, -(-a * r + o)), h = u > 0 ? -r : Math.min(Math.max(-r, -c), r), f = -u * u + h * (h + 2 * c) + l) : h <= g ? (u = 0, h = Math.min(Math.max(-r, -c), r), f = h * (h + 2 * c) + l) : (u = Math.max(0, -(a * r + o)), h = u > 0 ? r : Math.min(Math.max(-r, -c), r), f = -u * u + h * (h + 2 * c) + l);
21494
21502
  else
21495
- h = a > 0 ? -r : r, u = Math.max(0, -(a * h + o)), p = -u * u + h * (h + 2 * c) + l;
21496
- return n && n.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(ec).addScaledVector(oa, h), p;
21503
+ h = a > 0 ? -r : r, u = Math.max(0, -(a * h + o)), f = -u * u + h * (h + 2 * c) + l;
21504
+ return n && n.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(ec).addScaledVector(oa, h), f;
21497
21505
  }
21498
21506
  /**
21499
21507
  * Intersects this ray with the given sphere, returning the intersection
@@ -21658,7 +21666,7 @@ class Vt {
21658
21666
  * @param {number} [n43] - 4-3 matrix element.
21659
21667
  * @param {number} [n44] - 4-4 matrix element.
21660
21668
  */
21661
- constructor(e, t, n, s, r, a, o, c, l, d, u, h, p, g, v, m) {
21669
+ constructor(e, t, n, s, r, a, o, c, l, d, u, h, f, g, v, m) {
21662
21670
  Vt.prototype.isMatrix4 = !0, this.elements = [
21663
21671
  1,
21664
21672
  0,
@@ -21676,7 +21684,7 @@ class Vt {
21676
21684
  0,
21677
21685
  0,
21678
21686
  1
21679
- ], e !== void 0 && this.set(e, t, n, s, r, a, o, c, l, d, u, h, p, g, v, m);
21687
+ ], e !== void 0 && this.set(e, t, n, s, r, a, o, c, l, d, u, h, f, g, v, m);
21680
21688
  }
21681
21689
  /**
21682
21690
  * Sets the elements of the matrix.The arguments are supposed to be
@@ -21700,9 +21708,9 @@ class Vt {
21700
21708
  * @param {number} [n44] - 4-4 matrix element.
21701
21709
  * @return {Matrix4} A reference to this matrix.
21702
21710
  */
21703
- set(e, t, n, s, r, a, o, c, l, d, u, h, p, g, v, m) {
21704
- const f = this.elements;
21705
- return f[0] = e, f[4] = t, f[8] = n, f[12] = s, f[1] = r, f[5] = a, f[9] = o, f[13] = c, f[2] = l, f[6] = d, f[10] = u, f[14] = h, f[3] = p, f[7] = g, f[11] = v, f[15] = m, this;
21711
+ set(e, t, n, s, r, a, o, c, l, d, u, h, f, g, v, m) {
21712
+ const p = this.elements;
21713
+ return p[0] = e, p[4] = t, p[8] = n, p[12] = s, p[1] = r, p[5] = a, p[9] = o, p[13] = c, p[2] = l, p[6] = d, p[10] = u, p[14] = h, p[3] = f, p[7] = g, p[11] = v, p[15] = m, this;
21706
21714
  }
21707
21715
  /**
21708
21716
  * Sets this matrix to the 4x4 identity matrix.
@@ -21852,23 +21860,23 @@ class Vt {
21852
21860
  makeRotationFromEuler(e) {
21853
21861
  const t = this.elements, n = e.x, s = e.y, r = e.z, a = Math.cos(n), o = Math.sin(n), c = Math.cos(s), l = Math.sin(s), d = Math.cos(r), u = Math.sin(r);
21854
21862
  if (e.order === "XYZ") {
21855
- const h = a * d, p = a * u, g = o * d, v = o * u;
21856
- t[0] = c * d, t[4] = -c * u, t[8] = l, t[1] = p + g * l, t[5] = h - v * l, t[9] = -o * c, t[2] = v - h * l, t[6] = g + p * l, t[10] = a * c;
21863
+ const h = a * d, f = a * u, g = o * d, v = o * u;
21864
+ t[0] = c * d, t[4] = -c * u, t[8] = l, t[1] = f + g * l, t[5] = h - v * l, t[9] = -o * c, t[2] = v - h * l, t[6] = g + f * l, t[10] = a * c;
21857
21865
  } else if (e.order === "YXZ") {
21858
- const h = c * d, p = c * u, g = l * d, v = l * u;
21859
- t[0] = h + v * o, t[4] = g * o - p, t[8] = a * l, t[1] = a * u, t[5] = a * d, t[9] = -o, t[2] = p * o - g, t[6] = v + h * o, t[10] = a * c;
21866
+ const h = c * d, f = c * u, g = l * d, v = l * u;
21867
+ t[0] = h + v * o, t[4] = g * o - f, t[8] = a * l, t[1] = a * u, t[5] = a * d, t[9] = -o, t[2] = f * o - g, t[6] = v + h * o, t[10] = a * c;
21860
21868
  } else if (e.order === "ZXY") {
21861
- const h = c * d, p = c * u, g = l * d, v = l * u;
21862
- t[0] = h - v * o, t[4] = -a * u, t[8] = g + p * o, t[1] = p + g * o, t[5] = a * d, t[9] = v - h * o, t[2] = -a * l, t[6] = o, t[10] = a * c;
21869
+ const h = c * d, f = c * u, g = l * d, v = l * u;
21870
+ t[0] = h - v * o, t[4] = -a * u, t[8] = g + f * o, t[1] = f + g * o, t[5] = a * d, t[9] = v - h * o, t[2] = -a * l, t[6] = o, t[10] = a * c;
21863
21871
  } else if (e.order === "ZYX") {
21864
- const h = a * d, p = a * u, g = o * d, v = o * u;
21865
- t[0] = c * d, t[4] = g * l - p, t[8] = h * l + v, t[1] = c * u, t[5] = v * l + h, t[9] = p * l - g, t[2] = -l, t[6] = o * c, t[10] = a * c;
21872
+ const h = a * d, f = a * u, g = o * d, v = o * u;
21873
+ t[0] = c * d, t[4] = g * l - f, t[8] = h * l + v, t[1] = c * u, t[5] = v * l + h, t[9] = f * l - g, t[2] = -l, t[6] = o * c, t[10] = a * c;
21866
21874
  } else if (e.order === "YZX") {
21867
- const h = a * c, p = a * l, g = o * c, v = o * l;
21868
- t[0] = c * d, t[4] = v - h * u, t[8] = g * u + p, t[1] = u, t[5] = a * d, t[9] = -o * d, t[2] = -l * d, t[6] = p * u + g, t[10] = h - v * u;
21875
+ const h = a * c, f = a * l, g = o * c, v = o * l;
21876
+ t[0] = c * d, t[4] = v - h * u, t[8] = g * u + f, t[1] = u, t[5] = a * d, t[9] = -o * d, t[2] = -l * d, t[6] = f * u + g, t[10] = h - v * u;
21869
21877
  } else if (e.order === "XZY") {
21870
- const h = a * c, p = a * l, g = o * c, v = o * l;
21871
- t[0] = c * d, t[4] = -u, t[8] = l * d, t[1] = h * u + v, t[5] = a * d, t[9] = p * u - g, t[2] = g * u - p, t[6] = o * d, t[10] = v * u + h;
21878
+ const h = a * c, f = a * l, g = o * c, v = o * l;
21879
+ t[0] = c * d, t[4] = -u, t[8] = l * d, t[1] = h * u + v, t[5] = a * d, t[9] = f * u - g, t[2] = g * u - f, t[6] = o * d, t[10] = v * u + h;
21872
21880
  }
21873
21881
  return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
21874
21882
  }
@@ -21923,8 +21931,8 @@ class Vt {
21923
21931
  * @return {Matrix4} A reference to this matrix.
21924
21932
  */
21925
21933
  multiplyMatrices(e, t) {
21926
- const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[4], c = n[8], l = n[12], d = n[1], u = n[5], h = n[9], p = n[13], g = n[2], v = n[6], m = n[10], f = n[14], x = n[3], E = n[7], _ = n[11], S = n[15], M = s[0], A = s[4], k = s[8], y = s[12], T = s[1], R = s[5], U = s[9], F = s[13], q = s[2], Y = s[6], H = s[10], W = s[14], ee = s[3], ge = s[7], le = s[11], _e = s[15];
21927
- return r[0] = a * M + o * T + c * q + l * ee, r[4] = a * A + o * R + c * Y + l * ge, r[8] = a * k + o * U + c * H + l * le, r[12] = a * y + o * F + c * W + l * _e, r[1] = d * M + u * T + h * q + p * ee, r[5] = d * A + u * R + h * Y + p * ge, r[9] = d * k + u * U + h * H + p * le, r[13] = d * y + u * F + h * W + p * _e, r[2] = g * M + v * T + m * q + f * ee, r[6] = g * A + v * R + m * Y + f * ge, r[10] = g * k + v * U + m * H + f * le, r[14] = g * y + v * F + m * W + f * _e, r[3] = x * M + E * T + _ * q + S * ee, r[7] = x * A + E * R + _ * Y + S * ge, r[11] = x * k + E * U + _ * H + S * le, r[15] = x * y + E * F + _ * W + S * _e, this;
21934
+ const n = e.elements, s = t.elements, r = this.elements, a = n[0], o = n[4], c = n[8], l = n[12], d = n[1], u = n[5], h = n[9], f = n[13], g = n[2], v = n[6], m = n[10], p = n[14], x = n[3], E = n[7], _ = n[11], S = n[15], M = s[0], A = s[4], k = s[8], y = s[12], T = s[1], R = s[5], U = s[9], F = s[13], q = s[2], Y = s[6], H = s[10], W = s[14], ee = s[3], ge = s[7], le = s[11], _e = s[15];
21935
+ return r[0] = a * M + o * T + c * q + l * ee, r[4] = a * A + o * R + c * Y + l * ge, r[8] = a * k + o * U + c * H + l * le, r[12] = a * y + o * F + c * W + l * _e, r[1] = d * M + u * T + h * q + f * ee, r[5] = d * A + u * R + h * Y + f * ge, r[9] = d * k + u * U + h * H + f * le, r[13] = d * y + u * F + h * W + f * _e, r[2] = g * M + v * T + m * q + p * ee, r[6] = g * A + v * R + m * Y + p * ge, r[10] = g * k + v * U + m * H + p * le, r[14] = g * y + v * F + m * W + p * _e, r[3] = x * M + E * T + _ * q + S * ee, r[7] = x * A + E * R + _ * Y + S * ge, r[11] = x * k + E * U + _ * H + S * le, r[15] = x * y + E * F + _ * W + S * _e, this;
21928
21936
  }
21929
21937
  /**
21930
21938
  * Multiplies every component of the matrix by the given scalar.
@@ -21944,8 +21952,8 @@ class Vt {
21944
21952
  * @return {number} The determinant.
21945
21953
  */
21946
21954
  determinant() {
21947
- const e = this.elements, t = e[0], n = e[4], s = e[8], r = e[12], a = e[1], o = e[5], c = e[9], l = e[13], d = e[2], u = e[6], h = e[10], p = e[14], g = e[3], v = e[7], m = e[11], f = e[15], x = c * p - l * h, E = o * p - l * u, _ = o * h - c * u, S = a * p - l * d, M = a * h - c * d, A = a * u - o * d;
21948
- return t * (v * x - m * E + f * _) - n * (g * x - m * S + f * M) + s * (g * E - v * S + f * A) - r * (g * _ - v * M + m * A);
21955
+ const e = this.elements, t = e[0], n = e[4], s = e[8], r = e[12], a = e[1], o = e[5], c = e[9], l = e[13], d = e[2], u = e[6], h = e[10], f = e[14], g = e[3], v = e[7], m = e[11], p = e[15], x = c * f - l * h, E = o * f - l * u, _ = o * h - c * u, S = a * f - l * d, M = a * h - c * d, A = a * u - o * d;
21956
+ return t * (v * x - m * E + p * _) - n * (g * x - m * S + p * M) + s * (g * E - v * S + p * A) - r * (g * _ - v * M + m * A);
21949
21957
  }
21950
21958
  /**
21951
21959
  * Transposes this matrix in place.
@@ -21978,10 +21986,10 @@ class Vt {
21978
21986
  * @return {Matrix4} A reference to this matrix.
21979
21987
  */
21980
21988
  invert() {
21981
- const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], c = e[6], l = e[7], d = e[8], u = e[9], h = e[10], p = e[11], g = e[12], v = e[13], m = e[14], f = e[15], x = u * m * l - v * h * l + v * c * p - o * m * p - u * c * f + o * h * f, E = g * h * l - d * m * l - g * c * p + a * m * p + d * c * f - a * h * f, _ = d * v * l - g * u * l + g * o * p - a * v * p - d * o * f + a * u * f, S = g * u * c - d * v * c - g * o * h + a * v * h + d * o * m - a * u * m, M = t * x + n * E + s * _ + r * S;
21989
+ const e = this.elements, t = e[0], n = e[1], s = e[2], r = e[3], a = e[4], o = e[5], c = e[6], l = e[7], d = e[8], u = e[9], h = e[10], f = e[11], g = e[12], v = e[13], m = e[14], p = e[15], x = u * m * l - v * h * l + v * c * f - o * m * f - u * c * p + o * h * p, E = g * h * l - d * m * l - g * c * f + a * m * f + d * c * p - a * h * p, _ = d * v * l - g * u * l + g * o * f - a * v * f - d * o * p + a * u * p, S = g * u * c - d * v * c - g * o * h + a * v * h + d * o * m - a * u * m, M = t * x + n * E + s * _ + r * S;
21982
21990
  if (M === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
21983
21991
  const A = 1 / M;
21984
- return e[0] = x * A, e[1] = (v * h * r - u * m * r - v * s * p + n * m * p + u * s * f - n * h * f) * A, e[2] = (o * m * r - v * c * r + v * s * l - n * m * l - o * s * f + n * c * f) * A, e[3] = (u * c * r - o * h * r - u * s * l + n * h * l + o * s * p - n * c * p) * A, e[4] = E * A, e[5] = (d * m * r - g * h * r + g * s * p - t * m * p - d * s * f + t * h * f) * A, e[6] = (g * c * r - a * m * r - g * s * l + t * m * l + a * s * f - t * c * f) * A, e[7] = (a * h * r - d * c * r + d * s * l - t * h * l - a * s * p + t * c * p) * A, e[8] = _ * A, e[9] = (g * u * r - d * v * r - g * n * p + t * v * p + d * n * f - t * u * f) * A, e[10] = (a * v * r - g * o * r + g * n * l - t * v * l - a * n * f + t * o * f) * A, e[11] = (d * o * r - a * u * r - d * n * l + t * u * l + a * n * p - t * o * p) * A, e[12] = S * A, e[13] = (d * v * s - g * u * s + g * n * h - t * v * h - d * n * m + t * u * m) * A, e[14] = (g * o * s - a * v * s - g * n * c + t * v * c + a * n * m - t * o * m) * A, e[15] = (a * u * s - d * o * s + d * n * c - t * u * c - a * n * h + t * o * h) * A, this;
21992
+ return e[0] = x * A, e[1] = (v * h * r - u * m * r - v * s * f + n * m * f + u * s * p - n * h * p) * A, e[2] = (o * m * r - v * c * r + v * s * l - n * m * l - o * s * p + n * c * p) * A, e[3] = (u * c * r - o * h * r - u * s * l + n * h * l + o * s * f - n * c * f) * A, e[4] = E * A, e[5] = (d * m * r - g * h * r + g * s * f - t * m * f - d * s * p + t * h * p) * A, e[6] = (g * c * r - a * m * r - g * s * l + t * m * l + a * s * p - t * c * p) * A, e[7] = (a * h * r - d * c * r + d * s * l - t * h * l - a * s * f + t * c * f) * A, e[8] = _ * A, e[9] = (g * u * r - d * v * r - g * n * f + t * v * f + d * n * p - t * u * p) * A, e[10] = (a * v * r - g * o * r + g * n * l - t * v * l - a * n * p + t * o * p) * A, e[11] = (d * o * r - a * u * r - d * n * l + t * u * l + a * n * f - t * o * f) * A, e[12] = S * A, e[13] = (d * v * s - g * u * s + g * n * h - t * v * h - d * n * m + t * u * m) * A, e[14] = (g * o * s - a * v * s - g * n * c + t * v * c + a * n * m - t * o * m) * A, e[15] = (a * u * s - d * o * s + d * n * c - t * u * c - a * n * h + t * o * h) * A, this;
21985
21993
  }
21986
21994
  /**
21987
21995
  * Multiplies the columns of this matrix by the given vector.
@@ -22232,8 +22240,8 @@ class Vt {
22232
22240
  * @return {Matrix4} A reference to this matrix.
22233
22241
  */
22234
22242
  compose(e, t, n) {
22235
- const s = this.elements, r = t._x, a = t._y, o = t._z, c = t._w, l = r + r, d = a + a, u = o + o, h = r * l, p = r * d, g = r * u, v = a * d, m = a * u, f = o * u, x = c * l, E = c * d, _ = c * u, S = n.x, M = n.y, A = n.z;
22236
- return s[0] = (1 - (v + f)) * S, s[1] = (p + _) * S, s[2] = (g - E) * S, s[3] = 0, s[4] = (p - _) * M, s[5] = (1 - (h + f)) * M, s[6] = (m + x) * M, s[7] = 0, s[8] = (g + E) * A, s[9] = (m - x) * A, s[10] = (1 - (h + v)) * A, s[11] = 0, s[12] = e.x, s[13] = e.y, s[14] = e.z, s[15] = 1, this;
22243
+ const s = this.elements, r = t._x, a = t._y, o = t._z, c = t._w, l = r + r, d = a + a, u = o + o, h = r * l, f = r * d, g = r * u, v = a * d, m = a * u, p = o * u, x = c * l, E = c * d, _ = c * u, S = n.x, M = n.y, A = n.z;
22244
+ return s[0] = (1 - (v + p)) * S, s[1] = (f + _) * S, s[2] = (g - E) * S, s[3] = 0, s[4] = (f - _) * M, s[5] = (1 - (h + p)) * M, s[6] = (m + x) * M, s[7] = 0, s[8] = (g + E) * A, s[9] = (m - x) * A, s[10] = (1 - (h + v)) * A, s[11] = 0, s[12] = e.x, s[13] = e.y, s[14] = e.z, s[15] = 1, this;
22237
22245
  }
22238
22246
  /**
22239
22247
  * Decomposes this matrix into its position, rotation and scale components
@@ -22273,7 +22281,7 @@ class Vt {
22273
22281
  * @return {Matrix4} A reference to this matrix.
22274
22282
  */
22275
22283
  makePerspective(e, t, n, s, r, a, o = Jn, c = !1) {
22276
- const l = this.elements, d = 2 * r / (t - e), u = 2 * r / (n - s), h = (t + e) / (t - e), p = (n + s) / (n - s);
22284
+ const l = this.elements, d = 2 * r / (t - e), u = 2 * r / (n - s), h = (t + e) / (t - e), f = (n + s) / (n - s);
22277
22285
  let g, v;
22278
22286
  if (c)
22279
22287
  g = r / (a - r), v = a * r / (a - r);
@@ -22283,7 +22291,7 @@ class Vt {
22283
22291
  g = -a / (a - r), v = -a * r / (a - r);
22284
22292
  else
22285
22293
  throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + o);
22286
- return l[0] = d, l[4] = 0, l[8] = h, l[12] = 0, l[1] = 0, l[5] = u, l[9] = p, l[13] = 0, l[2] = 0, l[6] = 0, l[10] = g, l[14] = v, l[3] = 0, l[7] = 0, l[11] = -1, l[15] = 0, this;
22294
+ return l[0] = d, l[4] = 0, l[8] = h, l[12] = 0, l[1] = 0, l[5] = u, l[9] = f, l[13] = 0, l[2] = 0, l[6] = 0, l[10] = g, l[14] = v, l[3] = 0, l[7] = 0, l[11] = -1, l[15] = 0, this;
22287
22295
  }
22288
22296
  /**
22289
22297
  * Creates a orthographic projection matrix. This is used internally by
@@ -22300,7 +22308,7 @@ class Vt {
22300
22308
  * @return {Matrix4} A reference to this matrix.
22301
22309
  */
22302
22310
  makeOrthographic(e, t, n, s, r, a, o = Jn, c = !1) {
22303
- const l = this.elements, d = 2 / (t - e), u = 2 / (n - s), h = -(t + e) / (t - e), p = -(n + s) / (n - s);
22311
+ const l = this.elements, d = 2 / (t - e), u = 2 / (n - s), h = -(t + e) / (t - e), f = -(n + s) / (n - s);
22304
22312
  let g, v;
22305
22313
  if (c)
22306
22314
  g = 1 / (a - r), v = a / (a - r);
@@ -22310,7 +22318,7 @@ class Vt {
22310
22318
  g = -1 / (a - r), v = -r / (a - r);
22311
22319
  else
22312
22320
  throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + o);
22313
- return l[0] = d, l[4] = 0, l[8] = 0, l[12] = h, l[1] = 0, l[5] = u, l[9] = 0, l[13] = p, l[2] = 0, l[6] = 0, l[10] = g, l[14] = v, l[3] = 0, l[7] = 0, l[11] = 0, l[15] = 1, this;
22321
+ return l[0] = d, l[4] = 0, l[8] = 0, l[12] = h, l[1] = 0, l[5] = u, l[9] = 0, l[13] = f, l[2] = 0, l[6] = 0, l[10] = g, l[14] = v, l[3] = 0, l[7] = 0, l[11] = 0, l[15] = 1, this;
22314
22322
  }
22315
22323
  /**
22316
22324
  * Returns `true` if this matrix is equal with the given one.
@@ -22448,25 +22456,25 @@ class Ai {
22448
22456
  * @return {Euler} A reference to this Euler instance.
22449
22457
  */
22450
22458
  setFromRotationMatrix(e, t = this._order, n = !0) {
22451
- const s = e.elements, r = s[0], a = s[4], o = s[8], c = s[1], l = s[5], d = s[9], u = s[2], h = s[6], p = s[10];
22459
+ const s = e.elements, r = s[0], a = s[4], o = s[8], c = s[1], l = s[5], d = s[9], u = s[2], h = s[6], f = s[10];
22452
22460
  switch (t) {
22453
22461
  case "XYZ":
22454
- this._y = Math.asin(Ye(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-d, p), this._z = Math.atan2(-a, r)) : (this._x = Math.atan2(h, l), this._z = 0);
22462
+ this._y = Math.asin(Ye(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-d, f), this._z = Math.atan2(-a, r)) : (this._x = Math.atan2(h, l), this._z = 0);
22455
22463
  break;
22456
22464
  case "YXZ":
22457
- this._x = Math.asin(-Ye(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(o, p), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-u, r), this._z = 0);
22465
+ this._x = Math.asin(-Ye(d, -1, 1)), Math.abs(d) < 0.9999999 ? (this._y = Math.atan2(o, f), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-u, r), this._z = 0);
22458
22466
  break;
22459
22467
  case "ZXY":
22460
- this._x = Math.asin(Ye(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(-u, p), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, r));
22468
+ this._x = Math.asin(Ye(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(-u, f), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, r));
22461
22469
  break;
22462
22470
  case "ZYX":
22463
- this._y = Math.asin(-Ye(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(h, p), this._z = Math.atan2(c, r)) : (this._x = 0, this._z = Math.atan2(-a, l));
22471
+ this._y = Math.asin(-Ye(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(h, f), this._z = Math.atan2(c, r)) : (this._x = 0, this._z = Math.atan2(-a, l));
22464
22472
  break;
22465
22473
  case "YZX":
22466
- this._z = Math.asin(Ye(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-d, l), this._y = Math.atan2(-u, r)) : (this._x = 0, this._y = Math.atan2(o, p));
22474
+ this._z = Math.asin(Ye(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-d, l), this._y = Math.atan2(-u, r)) : (this._x = 0, this._y = Math.atan2(o, f));
22467
22475
  break;
22468
22476
  case "XZY":
22469
- this._z = Math.asin(-Ye(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(h, l), this._y = Math.atan2(o, r)) : (this._x = Math.atan2(-d, p), this._y = 0);
22477
+ this._z = Math.asin(-Ye(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(h, l), this._y = Math.atan2(o, r)) : (this._x = Math.atan2(-d, f), this._y = 0);
22470
22478
  break;
22471
22479
  default:
22472
22480
  Oe("Euler: .setFromRotationMatrix() encountered an unknown order: " + t);
@@ -23238,8 +23246,8 @@ class Sn extends cr {
23238
23246
  }
23239
23247
  }
23240
23248
  if (t) {
23241
- const o = a(e.geometries), c = a(e.materials), l = a(e.textures), d = a(e.images), u = a(e.shapes), h = a(e.skeletons), p = a(e.animations), g = a(e.nodes);
23242
- o.length > 0 && (n.geometries = o), c.length > 0 && (n.materials = c), l.length > 0 && (n.textures = l), d.length > 0 && (n.images = d), u.length > 0 && (n.shapes = u), h.length > 0 && (n.skeletons = h), p.length > 0 && (n.animations = p), g.length > 0 && (n.nodes = g);
23249
+ const o = a(e.geometries), c = a(e.materials), l = a(e.textures), d = a(e.images), u = a(e.shapes), h = a(e.skeletons), f = a(e.animations), g = a(e.nodes);
23250
+ o.length > 0 && (n.geometries = o), c.length > 0 && (n.materials = c), l.length > 0 && (n.textures = l), d.length > 0 && (n.images = d), u.length > 0 && (n.shapes = u), h.length > 0 && (n.skeletons = h), f.length > 0 && (n.animations = f), g.length > 0 && (n.nodes = g);
23243
23251
  }
23244
23252
  return n.object = s, n;
23245
23253
  function a(o) {
@@ -23321,8 +23329,8 @@ class On {
23321
23329
  const a = kn.dot(kn), o = kn.dot(di), c = kn.dot(sc), l = di.dot(di), d = di.dot(sc), u = a * l - o * o;
23322
23330
  if (u === 0)
23323
23331
  return r.set(0, 0, 0), null;
23324
- const h = 1 / u, p = (l * c - o * d) * h, g = (a * d - o * c) * h;
23325
- return r.set(1 - p - g, g, p);
23332
+ const h = 1 / u, f = (l * c - o * d) * h, g = (a * d - o * c) * h;
23333
+ return r.set(1 - f - g, g, f);
23326
23334
  }
23327
23335
  /**
23328
23336
  * Returns `true` if the given point, when projected onto the plane of the
@@ -23544,17 +23552,17 @@ class On {
23544
23552
  if (h <= 0 && c >= 0 && d <= 0)
23545
23553
  return a = c / (c - d), t.copy(n).addScaledVector(Ns, a);
23546
23554
  oc.subVectors(e, r);
23547
- const p = Ns.dot(oc), g = Us.dot(oc);
23548
- if (g >= 0 && p <= g)
23555
+ const f = Ns.dot(oc), g = Us.dot(oc);
23556
+ if (g >= 0 && f <= g)
23549
23557
  return t.copy(r);
23550
- const v = p * l - c * g;
23558
+ const v = f * l - c * g;
23551
23559
  if (v <= 0 && l >= 0 && g <= 0)
23552
23560
  return o = l / (l - g), t.copy(n).addScaledVector(Us, o);
23553
- const m = d * g - p * u;
23554
- if (m <= 0 && u - d >= 0 && p - g >= 0)
23555
- return Mh.subVectors(r, s), o = (u - d) / (u - d + (p - g)), t.copy(s).addScaledVector(Mh, o);
23556
- const f = 1 / (m + v + h);
23557
- return a = v * f, o = h * f, t.copy(n).addScaledVector(Ns, a).addScaledVector(Us, o);
23561
+ const m = d * g - f * u;
23562
+ if (m <= 0 && u - d >= 0 && f - g >= 0)
23563
+ return Mh.subVectors(r, s), o = (u - d) / (u - d + (f - g)), t.copy(s).addScaledVector(Mh, o);
23564
+ const p = 1 / (m + v + h);
23565
+ return a = v * p, o = h * p, t.copy(n).addScaledVector(Ns, a).addScaledVector(Us, o);
23558
23566
  }
23559
23567
  /**
23560
23568
  * Returns `true` if this triangle is equal with the given one.
@@ -25055,11 +25063,11 @@ class Gn extends cr {
25055
25063
  const a = this.getAttribute("tangent"), o = [], c = [];
25056
25064
  for (let k = 0; k < n.count; k++)
25057
25065
  o[k] = new B(), c[k] = new B();
25058
- const l = new B(), d = new B(), u = new B(), h = new st(), p = new st(), g = new st(), v = new B(), m = new B();
25059
- function f(k, y, T) {
25060
- l.fromBufferAttribute(n, k), d.fromBufferAttribute(n, y), u.fromBufferAttribute(n, T), h.fromBufferAttribute(r, k), p.fromBufferAttribute(r, y), g.fromBufferAttribute(r, T), d.sub(l), u.sub(l), p.sub(h), g.sub(h);
25061
- const R = 1 / (p.x * g.y - g.x * p.y);
25062
- isFinite(R) && (v.copy(d).multiplyScalar(g.y).addScaledVector(u, -p.y).multiplyScalar(R), m.copy(u).multiplyScalar(p.x).addScaledVector(d, -g.x).multiplyScalar(R), o[k].add(v), o[y].add(v), o[T].add(v), c[k].add(m), c[y].add(m), c[T].add(m));
25066
+ const l = new B(), d = new B(), u = new B(), h = new st(), f = new st(), g = new st(), v = new B(), m = new B();
25067
+ function p(k, y, T) {
25068
+ l.fromBufferAttribute(n, k), d.fromBufferAttribute(n, y), u.fromBufferAttribute(n, T), h.fromBufferAttribute(r, k), f.fromBufferAttribute(r, y), g.fromBufferAttribute(r, T), d.sub(l), u.sub(l), f.sub(h), g.sub(h);
25069
+ const R = 1 / (f.x * g.y - g.x * f.y);
25070
+ isFinite(R) && (v.copy(d).multiplyScalar(g.y).addScaledVector(u, -f.y).multiplyScalar(R), m.copy(u).multiplyScalar(f.x).addScaledVector(d, -g.x).multiplyScalar(R), o[k].add(v), o[y].add(v), o[T].add(v), c[k].add(m), c[y].add(m), c[T].add(m));
25063
25071
  }
25064
25072
  let x = this.groups;
25065
25073
  x.length === 0 && (x = [{
@@ -25069,7 +25077,7 @@ class Gn extends cr {
25069
25077
  for (let k = 0, y = x.length; k < y; ++k) {
25070
25078
  const T = x[k], R = T.start, U = T.count;
25071
25079
  for (let F = R, q = R + U; F < q; F += 3)
25072
- f(
25080
+ p(
25073
25081
  e.getX(F + 0),
25074
25082
  e.getX(F + 1),
25075
25083
  e.getX(F + 2)
@@ -25102,16 +25110,16 @@ class Gn extends cr {
25102
25110
  if (n === void 0)
25103
25111
  n = new ti(new Float32Array(t.count * 3), 3), this.setAttribute("normal", n);
25104
25112
  else
25105
- for (let h = 0, p = n.count; h < p; h++)
25113
+ for (let h = 0, f = n.count; h < f; h++)
25106
25114
  n.setXYZ(h, 0, 0, 0);
25107
25115
  const s = new B(), r = new B(), a = new B(), o = new B(), c = new B(), l = new B(), d = new B(), u = new B();
25108
25116
  if (e)
25109
- for (let h = 0, p = e.count; h < p; h += 3) {
25117
+ for (let h = 0, f = e.count; h < f; h += 3) {
25110
25118
  const g = e.getX(h + 0), v = e.getX(h + 1), m = e.getX(h + 2);
25111
25119
  s.fromBufferAttribute(t, g), r.fromBufferAttribute(t, v), a.fromBufferAttribute(t, m), d.subVectors(a, r), u.subVectors(s, r), d.cross(u), o.fromBufferAttribute(n, g), c.fromBufferAttribute(n, v), l.fromBufferAttribute(n, m), o.add(d), c.add(d), l.add(d), n.setXYZ(g, o.x, o.y, o.z), n.setXYZ(v, c.x, c.y, c.z), n.setXYZ(m, l.x, l.y, l.z);
25112
25120
  }
25113
25121
  else
25114
- for (let h = 0, p = t.count; h < p; h += 3)
25122
+ for (let h = 0, f = t.count; h < f; h += 3)
25115
25123
  s.fromBufferAttribute(t, h + 0), r.fromBufferAttribute(t, h + 1), a.fromBufferAttribute(t, h + 2), d.subVectors(a, r), u.subVectors(s, r), d.cross(u), n.setXYZ(h + 0, d.x, d.y, d.z), n.setXYZ(h + 1, d.x, d.y, d.z), n.setXYZ(h + 2, d.x, d.y, d.z);
25116
25124
  this.normalizeNormals(), n.needsUpdate = !0;
25117
25125
  }
@@ -25134,11 +25142,11 @@ class Gn extends cr {
25134
25142
  toNonIndexed() {
25135
25143
  function e(o, c) {
25136
25144
  const l = o.array, d = o.itemSize, u = o.normalized, h = new l.constructor(c.length * d);
25137
- let p = 0, g = 0;
25145
+ let f = 0, g = 0;
25138
25146
  for (let v = 0, m = c.length; v < m; v++) {
25139
- o.isInterleavedBufferAttribute ? p = c[v] * o.data.stride + o.offset : p = c[v] * d;
25140
- for (let f = 0; f < d; f++)
25141
- h[g++] = l[p++];
25147
+ o.isInterleavedBufferAttribute ? f = c[v] * o.data.stride + o.offset : f = c[v] * d;
25148
+ for (let p = 0; p < d; p++)
25149
+ h[g++] = l[f++];
25142
25150
  }
25143
25151
  return new ti(h, d, u);
25144
25152
  }
@@ -25153,8 +25161,8 @@ class Gn extends cr {
25153
25161
  for (const o in r) {
25154
25162
  const c = [], l = r[o];
25155
25163
  for (let d = 0, u = l.length; d < u; d++) {
25156
- const h = l[d], p = e(h, n);
25157
- c.push(p);
25164
+ const h = l[d], f = e(h, n);
25165
+ c.push(f);
25158
25166
  }
25159
25167
  t.morphAttributes[o] = c;
25160
25168
  }
@@ -25201,8 +25209,8 @@ class Gn extends cr {
25201
25209
  for (const c in this.morphAttributes) {
25202
25210
  const l = this.morphAttributes[c], d = [];
25203
25211
  for (let u = 0, h = l.length; u < h; u++) {
25204
- const p = l[u];
25205
- d.push(p.toJSON(e.data));
25212
+ const f = l[u];
25213
+ d.push(f.toJSON(e.data));
25206
25214
  }
25207
25215
  d.length > 0 && (s[c] = d, r = !0);
25208
25216
  }
@@ -25240,7 +25248,7 @@ class Gn extends cr {
25240
25248
  const r = e.morphAttributes;
25241
25249
  for (const l in r) {
25242
25250
  const d = [], u = r[l];
25243
- for (let h = 0, p = u.length; h < p; h++)
25251
+ for (let h = 0, f = u.length; h < f; h++)
25244
25252
  d.push(u[h].clone(t));
25245
25253
  this.morphAttributes[l] = d;
25246
25254
  }
@@ -25330,19 +25338,19 @@ class zn extends Sn {
25330
25338
  }
25331
25339
  _computeIntersections(e, t, n) {
25332
25340
  let s;
25333
- const r = this.geometry, a = this.material, o = r.index, c = r.attributes.position, l = r.attributes.uv, d = r.attributes.uv1, u = r.attributes.normal, h = r.groups, p = r.drawRange;
25341
+ const r = this.geometry, a = this.material, o = r.index, c = r.attributes.position, l = r.attributes.uv, d = r.attributes.uv1, u = r.attributes.normal, h = r.groups, f = r.drawRange;
25334
25342
  if (o !== null)
25335
25343
  if (Array.isArray(a))
25336
25344
  for (let g = 0, v = h.length; g < v; g++) {
25337
- const m = h[g], f = a[m.materialIndex], x = Math.max(m.start, p.start), E = Math.min(o.count, Math.min(m.start + m.count, p.start + p.count));
25345
+ const m = h[g], p = a[m.materialIndex], x = Math.max(m.start, f.start), E = Math.min(o.count, Math.min(m.start + m.count, f.start + f.count));
25338
25346
  for (let _ = x, S = E; _ < S; _ += 3) {
25339
25347
  const M = o.getX(_), A = o.getX(_ + 1), k = o.getX(_ + 2);
25340
- s = ba(this, f, e, n, l, d, u, M, A, k), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = m.materialIndex, t.push(s));
25348
+ s = ba(this, p, e, n, l, d, u, M, A, k), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = m.materialIndex, t.push(s));
25341
25349
  }
25342
25350
  }
25343
25351
  else {
25344
- const g = Math.max(0, p.start), v = Math.min(o.count, p.start + p.count);
25345
- for (let m = g, f = v; m < f; m += 3) {
25352
+ const g = Math.max(0, f.start), v = Math.min(o.count, f.start + f.count);
25353
+ for (let m = g, p = v; m < p; m += 3) {
25346
25354
  const x = o.getX(m), E = o.getX(m + 1), _ = o.getX(m + 2);
25347
25355
  s = ba(this, a, e, n, l, d, u, x, E, _), s && (s.faceIndex = Math.floor(m / 3), t.push(s));
25348
25356
  }
@@ -25350,15 +25358,15 @@ class zn extends Sn {
25350
25358
  else if (c !== void 0)
25351
25359
  if (Array.isArray(a))
25352
25360
  for (let g = 0, v = h.length; g < v; g++) {
25353
- const m = h[g], f = a[m.materialIndex], x = Math.max(m.start, p.start), E = Math.min(c.count, Math.min(m.start + m.count, p.start + p.count));
25361
+ const m = h[g], p = a[m.materialIndex], x = Math.max(m.start, f.start), E = Math.min(c.count, Math.min(m.start + m.count, f.start + f.count));
25354
25362
  for (let _ = x, S = E; _ < S; _ += 3) {
25355
25363
  const M = _, A = _ + 1, k = _ + 2;
25356
- s = ba(this, f, e, n, l, d, u, M, A, k), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = m.materialIndex, t.push(s));
25364
+ s = ba(this, p, e, n, l, d, u, M, A, k), s && (s.faceIndex = Math.floor(_ / 3), s.face.materialIndex = m.materialIndex, t.push(s));
25357
25365
  }
25358
25366
  }
25359
25367
  else {
25360
- const g = Math.max(0, p.start), v = Math.min(c.count, p.start + p.count);
25361
- for (let m = g, f = v; m < f; m += 3) {
25368
+ const g = Math.max(0, f.start), v = Math.min(c.count, f.start + f.count);
25369
+ for (let m = g, p = v; m < p; m += 3) {
25362
25370
  const x = m, E = m + 1, _ = m + 2;
25363
25371
  s = ba(this, a, e, n, l, d, u, x, E, _), s && (s.faceIndex = Math.floor(m / 3), t.push(s));
25364
25372
  }
@@ -25416,9 +25424,9 @@ class Zr extends Gn {
25416
25424
  const o = this;
25417
25425
  s = Math.floor(s), r = Math.floor(r), a = Math.floor(a);
25418
25426
  const c = [], l = [], d = [], u = [];
25419
- let h = 0, p = 0;
25427
+ let h = 0, f = 0;
25420
25428
  g("z", "y", "x", -1, -1, n, t, e, a, r, 0), g("z", "y", "x", 1, -1, n, t, -e, a, r, 1), g("x", "z", "y", 1, 1, e, n, t, s, a, 2), g("x", "z", "y", 1, -1, e, n, -t, s, a, 3), g("x", "y", "z", 1, -1, e, t, n, s, r, 4), g("x", "y", "z", -1, -1, e, t, -n, s, r, 5), this.setIndex(c), this.setAttribute("position", new rn(l, 3)), this.setAttribute("normal", new rn(d, 3)), this.setAttribute("uv", new rn(u, 2));
25421
- function g(v, m, f, x, E, _, S, M, A, k, y) {
25429
+ function g(v, m, p, x, E, _, S, M, A, k, y) {
25422
25430
  const T = _ / A, R = S / k, U = _ / 2, F = S / 2, q = M / 2, Y = A + 1, H = k + 1;
25423
25431
  let W = 0, ee = 0;
25424
25432
  const ge = new B();
@@ -25426,15 +25434,15 @@ class Zr extends Gn {
25426
25434
  const _e = le * R - F;
25427
25435
  for (let Be = 0; Be < Y; Be++) {
25428
25436
  const Fe = Be * T - U;
25429
- ge[v] = Fe * x, ge[m] = _e * E, ge[f] = q, l.push(ge.x, ge.y, ge.z), ge[v] = 0, ge[m] = 0, ge[f] = M > 0 ? 1 : -1, d.push(ge.x, ge.y, ge.z), u.push(Be / A), u.push(1 - le / k), W += 1;
25437
+ ge[v] = Fe * x, ge[m] = _e * E, ge[p] = q, l.push(ge.x, ge.y, ge.z), ge[v] = 0, ge[m] = 0, ge[p] = M > 0 ? 1 : -1, d.push(ge.x, ge.y, ge.z), u.push(Be / A), u.push(1 - le / k), W += 1;
25430
25438
  }
25431
25439
  }
25432
25440
  for (let le = 0; le < k; le++)
25433
25441
  for (let _e = 0; _e < A; _e++) {
25434
- const Be = h + _e + Y * le, Fe = h + _e + Y * (le + 1), xt = h + (_e + 1) + Y * (le + 1), dt = h + (_e + 1) + Y * le;
25435
- c.push(Be, Fe, dt), c.push(Fe, xt, dt), ee += 6;
25442
+ const Be = h + _e + Y * le, Fe = h + _e + Y * (le + 1), Ct = h + (_e + 1) + Y * (le + 1), dt = h + (_e + 1) + Y * le;
25443
+ c.push(Be, Fe, dt), c.push(Fe, Ct, dt), ee += 6;
25436
25444
  }
25437
- o.addGroup(p, ee, y), p += ee, h += W;
25445
+ o.addGroup(f, ee, y), f += ee, h += W;
25438
25446
  }
25439
25447
  }
25440
25448
  copy(e) {
@@ -25807,10 +25815,10 @@ class uy extends Sn {
25807
25815
  this.parent === null && this.updateMatrixWorld();
25808
25816
  const { renderTarget: n, activeMipmapLevel: s } = this;
25809
25817
  this.coordinateSystem !== e.coordinateSystem && (this.coordinateSystem = e.coordinateSystem, this.updateCoordinateSystem());
25810
- const [r, a, o, c, l, d] = this.children, u = e.getRenderTarget(), h = e.getActiveCubeFace(), p = e.getActiveMipmapLevel(), g = e.xr.enabled;
25818
+ const [r, a, o, c, l, d] = this.children, u = e.getRenderTarget(), h = e.getActiveCubeFace(), f = e.getActiveMipmapLevel(), g = e.xr.enabled;
25811
25819
  e.xr.enabled = !1;
25812
25820
  const v = n.texture.generateMipmaps;
25813
- n.texture.generateMipmaps = !1, e.setRenderTarget(n, 0, s), e.render(t, r), e.setRenderTarget(n, 1, s), e.render(t, a), e.setRenderTarget(n, 2, s), e.render(t, o), e.setRenderTarget(n, 3, s), e.render(t, c), e.setRenderTarget(n, 4, s), e.render(t, l), n.texture.generateMipmaps = v, e.setRenderTarget(n, 5, s), e.render(t, d), e.setRenderTarget(u, h, p), e.xr.enabled = g, n.texture.needsPMREMUpdate = !0;
25821
+ n.texture.generateMipmaps = !1, e.setRenderTarget(n, 0, s), e.render(t, r), e.setRenderTarget(n, 1, s), e.render(t, a), e.setRenderTarget(n, 2, s), e.render(t, o), e.setRenderTarget(n, 3, s), e.render(t, c), e.setRenderTarget(n, 4, s), e.render(t, l), n.texture.generateMipmaps = v, e.setRenderTarget(n, 5, s), e.render(t, d), e.setRenderTarget(u, h, f), e.xr.enabled = g, n.texture.needsPMREMUpdate = !0;
25814
25822
  }
25815
25823
  }
25816
25824
  class Tm extends sn {
@@ -26026,15 +26034,15 @@ class pc {
26026
26034
  if (l && e.hand) {
26027
26035
  a = !0;
26028
26036
  for (const v of e.hand.values()) {
26029
- const m = t.getJointPose(v, n), f = this._getHandJoint(l, v);
26030
- m !== null && (f.matrix.fromArray(m.transform.matrix), f.matrix.decompose(f.position, f.rotation, f.scale), f.matrixWorldNeedsUpdate = !0, f.jointRadius = m.radius), f.visible = m !== null;
26037
+ const m = t.getJointPose(v, n), p = this._getHandJoint(l, v);
26038
+ m !== null && (p.matrix.fromArray(m.transform.matrix), p.matrix.decompose(p.position, p.rotation, p.scale), p.matrixWorldNeedsUpdate = !0, p.jointRadius = m.radius), p.visible = m !== null;
26031
26039
  }
26032
- const d = l.joints["index-finger-tip"], u = l.joints["thumb-tip"], h = d.position.distanceTo(u.position), p = 0.02, g = 5e-3;
26033
- l.inputState.pinching && h > p + g ? (l.inputState.pinching = !1, this.dispatchEvent({
26040
+ const d = l.joints["index-finger-tip"], u = l.joints["thumb-tip"], h = d.position.distanceTo(u.position), f = 0.02, g = 5e-3;
26041
+ l.inputState.pinching && h > f + g ? (l.inputState.pinching = !1, this.dispatchEvent({
26034
26042
  type: "pinchend",
26035
26043
  handedness: e.handedness,
26036
26044
  target: this
26037
- })) : !l.inputState.pinching && h <= p - g && (l.inputState.pinching = !0, this.dispatchEvent({
26045
+ })) : !l.inputState.pinching && h <= f - g && (l.inputState.pinching = !0, this.dispatchEvent({
26038
26046
  type: "pinchstart",
26039
26047
  handedness: e.handedness,
26040
26048
  target: this
@@ -26359,11 +26367,11 @@ class Cm {
26359
26367
  * @return {Frustum} A reference to this frustum.
26360
26368
  */
26361
26369
  setFromProjectionMatrix(e, t = Jn, n = !1) {
26362
- 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], p = r[7], g = r[8], v = r[9], m = r[10], f = r[11], x = r[12], E = r[13], _ = r[14], S = r[15];
26363
- if (s[0].setComponents(l - a, p - d, f - g, S - x).normalize(), s[1].setComponents(l + a, p + d, f + g, S + x).normalize(), s[2].setComponents(l + o, p + u, f + v, S + E).normalize(), s[3].setComponents(l - o, p - u, f - v, S - E).normalize(), n)
26364
- s[4].setComponents(c, h, m, _).normalize(), s[5].setComponents(l - c, p - h, f - m, S - _).normalize();
26365
- else if (s[4].setComponents(l - c, p - h, f - m, S - _).normalize(), t === Jn)
26366
- s[5].setComponents(l + c, p + h, f + m, S + _).normalize();
26370
+ 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], E = r[13], _ = r[14], S = r[15];
26371
+ 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 + E).normalize(), s[3].setComponents(l - o, f - u, p - v, S - E).normalize(), n)
26372
+ s[4].setComponents(c, h, m, _).normalize(), s[5].setComponents(l - c, f - h, p - m, S - _).normalize();
26373
+ else if (s[4].setComponents(l - c, f - h, p - m, S - _).normalize(), t === Jn)
26374
+ s[5].setComponents(l + c, f + h, p + m, S + _).normalize();
26367
26375
  else if (t === no)
26368
26376
  s[5].setComponents(c, h, m, _).normalize();
26369
26377
  else
@@ -26542,7 +26550,7 @@ class Ud extends Gn {
26542
26550
  function o(x) {
26543
26551
  const E = new B(), _ = new B(), S = new B();
26544
26552
  for (let M = 0; M < t.length; M += 3)
26545
- p(t[M + 0], E), p(t[M + 1], _), p(t[M + 2], S), c(E, _, S, x);
26553
+ f(t[M + 0], E), f(t[M + 1], _), f(t[M + 2], S), c(E, _, S, x);
26546
26554
  }
26547
26555
  function c(x, E, _, S) {
26548
26556
  const M = S + 1, A = [];
@@ -26567,7 +26575,7 @@ class Ud extends Gn {
26567
26575
  const x = new B();
26568
26576
  for (let E = 0; E < r.length; E += 3) {
26569
26577
  x.x = r[E + 0], x.y = r[E + 1], x.z = r[E + 2];
26570
- const _ = m(x) / 2 / Math.PI + 0.5, S = f(x) / Math.PI + 0.5;
26578
+ const _ = m(x) / 2 / Math.PI + 0.5, S = p(x) / Math.PI + 0.5;
26571
26579
  a.push(_, 1 - S);
26572
26580
  }
26573
26581
  g(), u();
@@ -26581,7 +26589,7 @@ class Ud extends Gn {
26581
26589
  function h(x) {
26582
26590
  r.push(x.x, x.y, x.z);
26583
26591
  }
26584
- function p(x, E) {
26592
+ function f(x, E) {
26585
26593
  const _ = x * 3;
26586
26594
  E.x = e[_ + 0], E.y = e[_ + 1], E.z = e[_ + 2];
26587
26595
  }
@@ -26599,7 +26607,7 @@ class Ud extends Gn {
26599
26607
  function m(x) {
26600
26608
  return Math.atan2(x.z, -x.x);
26601
26609
  }
26602
- function f(x) {
26610
+ function p(x) {
26603
26611
  return Math.atan2(-x.y, Math.sqrt(x.x * x.x + x.z * x.z));
26604
26612
  }
26605
26613
  }
@@ -26756,20 +26764,20 @@ class mo extends Gn {
26756
26764
  widthSegments: n,
26757
26765
  heightSegments: s
26758
26766
  };
26759
- const r = e / 2, a = t / 2, o = Math.floor(n), c = Math.floor(s), l = o + 1, d = c + 1, u = e / o, h = t / c, p = [], g = [], v = [], m = [];
26760
- for (let f = 0; f < d; f++) {
26761
- const x = f * h - a;
26767
+ const r = e / 2, a = t / 2, o = Math.floor(n), c = Math.floor(s), l = o + 1, d = c + 1, u = e / o, h = t / c, f = [], g = [], v = [], m = [];
26768
+ for (let p = 0; p < d; p++) {
26769
+ const x = p * h - a;
26762
26770
  for (let E = 0; E < l; E++) {
26763
26771
  const _ = E * u - r;
26764
- g.push(_, -x, 0), v.push(0, 0, 1), m.push(E / o), m.push(1 - f / c);
26772
+ g.push(_, -x, 0), v.push(0, 0, 1), m.push(E / o), m.push(1 - p / c);
26765
26773
  }
26766
26774
  }
26767
- for (let f = 0; f < c; f++)
26775
+ for (let p = 0; p < c; p++)
26768
26776
  for (let x = 0; x < o; x++) {
26769
- const E = x + l * f, _ = x + l * (f + 1), S = x + 1 + l * (f + 1), M = x + 1 + l * f;
26770
- p.push(E, _, M), p.push(_, S, M);
26777
+ const E = x + l * p, _ = x + l * (p + 1), S = x + 1 + l * (p + 1), M = x + 1 + l * p;
26778
+ f.push(E, _, M), f.push(_, S, M);
26771
26779
  }
26772
- this.setIndex(p), this.setAttribute("position", new rn(g, 3)), this.setAttribute("normal", new rn(v, 3)), this.setAttribute("uv", new rn(m, 2));
26780
+ this.setIndex(f), this.setAttribute("position", new rn(g, 3)), this.setAttribute("normal", new rn(v, 3)), this.setAttribute("uv", new rn(m, 2));
26773
26781
  }
26774
26782
  copy(e) {
26775
26783
  return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;
@@ -26809,23 +26817,23 @@ class Fd extends Gn {
26809
26817
  }, t = Math.max(3, Math.floor(t)), n = Math.max(2, Math.floor(n));
26810
26818
  const c = Math.min(a + o, Math.PI);
26811
26819
  let l = 0;
26812
- const d = [], u = new B(), h = new B(), p = [], g = [], v = [], m = [];
26813
- for (let f = 0; f <= n; f++) {
26814
- const x = [], E = f / n;
26820
+ const d = [], u = new B(), h = new B(), f = [], g = [], v = [], m = [];
26821
+ for (let p = 0; p <= n; p++) {
26822
+ const x = [], E = p / n;
26815
26823
  let _ = 0;
26816
- f === 0 && a === 0 ? _ = 0.5 / t : f === n && c === Math.PI && (_ = -0.5 / t);
26824
+ p === 0 && a === 0 ? _ = 0.5 / t : p === n && c === Math.PI && (_ = -0.5 / t);
26817
26825
  for (let S = 0; S <= t; S++) {
26818
26826
  const M = S / t;
26819
26827
  u.x = -e * Math.cos(s + M * r) * Math.sin(a + E * o), u.y = e * Math.cos(a + E * o), u.z = e * Math.sin(s + M * r) * Math.sin(a + E * o), g.push(u.x, u.y, u.z), h.copy(u).normalize(), v.push(h.x, h.y, h.z), m.push(M + _, 1 - E), x.push(l++);
26820
26828
  }
26821
26829
  d.push(x);
26822
26830
  }
26823
- for (let f = 0; f < n; f++)
26831
+ for (let p = 0; p < n; p++)
26824
26832
  for (let x = 0; x < t; x++) {
26825
- const E = d[f][x + 1], _ = d[f][x], S = d[f + 1][x], M = d[f + 1][x + 1];
26826
- (f !== 0 || a > 0) && p.push(E, _, M), (f !== n - 1 || c < Math.PI) && p.push(_, S, M);
26833
+ const E = d[p][x + 1], _ = d[p][x], S = d[p + 1][x], M = d[p + 1][x + 1];
26834
+ (p !== 0 || a > 0) && f.push(E, _, M), (p !== n - 1 || c < Math.PI) && f.push(_, S, M);
26827
26835
  }
26828
- this.setIndex(p), this.setAttribute("position", new rn(g, 3)), this.setAttribute("normal", new rn(v, 3)), this.setAttribute("uv", new rn(m, 2));
26836
+ this.setIndex(f), this.setAttribute("position", new rn(g, 3)), this.setAttribute("normal", new rn(v, 3)), this.setAttribute("uv", new rn(m, 2));
26829
26837
  }
26830
26838
  copy(e) {
26831
26839
  return super.copy(e), this.parameters = Object.assign({}, e.parameters), this;
@@ -27156,30 +27164,30 @@ function Cy(i) {
27156
27164
  function t(o, c) {
27157
27165
  const l = o.array, d = o.usage, u = l.byteLength, h = i.createBuffer();
27158
27166
  i.bindBuffer(c, h), i.bufferData(c, l, d), o.onUploadCallback();
27159
- let p;
27167
+ let f;
27160
27168
  if (l instanceof Float32Array)
27161
- p = i.FLOAT;
27169
+ f = i.FLOAT;
27162
27170
  else if (typeof Float16Array < "u" && l instanceof Float16Array)
27163
- p = i.HALF_FLOAT;
27171
+ f = i.HALF_FLOAT;
27164
27172
  else if (l instanceof Uint16Array)
27165
- o.isFloat16BufferAttribute ? p = i.HALF_FLOAT : p = i.UNSIGNED_SHORT;
27173
+ o.isFloat16BufferAttribute ? f = i.HALF_FLOAT : f = i.UNSIGNED_SHORT;
27166
27174
  else if (l instanceof Int16Array)
27167
- p = i.SHORT;
27175
+ f = i.SHORT;
27168
27176
  else if (l instanceof Uint32Array)
27169
- p = i.UNSIGNED_INT;
27177
+ f = i.UNSIGNED_INT;
27170
27178
  else if (l instanceof Int32Array)
27171
- p = i.INT;
27179
+ f = i.INT;
27172
27180
  else if (l instanceof Int8Array)
27173
- p = i.BYTE;
27181
+ f = i.BYTE;
27174
27182
  else if (l instanceof Uint8Array)
27175
- p = i.UNSIGNED_BYTE;
27183
+ f = i.UNSIGNED_BYTE;
27176
27184
  else if (l instanceof Uint8ClampedArray)
27177
- p = i.UNSIGNED_BYTE;
27185
+ f = i.UNSIGNED_BYTE;
27178
27186
  else
27179
27187
  throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + l);
27180
27188
  return {
27181
27189
  buffer: h,
27182
- type: p,
27190
+ type: f,
27183
27191
  bytesPerElement: l.BYTES_PER_ELEMENT,
27184
27192
  version: o.version,
27185
27193
  size: u
@@ -27190,18 +27198,18 @@ function Cy(i) {
27190
27198
  if (i.bindBuffer(l, o), u.length === 0)
27191
27199
  i.bufferSubData(l, 0, d);
27192
27200
  else {
27193
- u.sort((p, g) => p.start - g.start);
27201
+ u.sort((f, g) => f.start - g.start);
27194
27202
  let h = 0;
27195
- for (let p = 1; p < u.length; p++) {
27196
- const g = u[h], v = u[p];
27203
+ for (let f = 1; f < u.length; f++) {
27204
+ const g = u[h], v = u[f];
27197
27205
  v.start <= g.start + g.count + 1 ? g.count = Math.max(
27198
27206
  g.count,
27199
27207
  v.start + v.count - g.start
27200
27208
  ) : (++h, u[h] = v);
27201
27209
  }
27202
27210
  u.length = h + 1;
27203
- for (let p = 0, g = u.length; p < g; p++) {
27204
- const v = u[p];
27211
+ for (let f = 0, g = u.length; f < g; f++) {
27212
+ const v = u[f];
27205
27213
  i.bufferSubData(
27206
27214
  l,
27207
27215
  v.start * d.BYTES_PER_ELEMENT,
@@ -31399,7 +31407,7 @@ Xn.physical = {
31399
31407
  const xa = { r: 0, b: 0, g: 0 }, ss = /* @__PURE__ */ new Ai(), rT = /* @__PURE__ */ new Vt();
31400
31408
  function aT(i, e, t, n, s, r, a) {
31401
31409
  const o = new Je(0);
31402
- let c = r === !0 ? 0 : 1, l, d, u = null, h = 0, p = null;
31410
+ let c = r === !0 ? 0 : 1, l, d, u = null, h = 0, f = null;
31403
31411
  function g(E) {
31404
31412
  let _ = E.isScene === !0 ? E.background : null;
31405
31413
  return _ && _.isTexture && (_ = (E.backgroundBlurriness > 0 ? t : e).get(_)), _;
@@ -31407,7 +31415,7 @@ function aT(i, e, t, n, s, r, a) {
31407
31415
  function v(E) {
31408
31416
  let _ = !1;
31409
31417
  const S = g(E);
31410
- S === null ? f(o, c) : S && S.isColor && (f(S, 1), _ = !0);
31418
+ S === null ? p(o, c) : S && S.isColor && (p(S, 1), _ = !0);
31411
31419
  const M = i.xr.getEnvironmentBlendMode();
31412
31420
  M === "additive" ? n.buffers.color.setClear(0, 0, 0, 1, a) : M === "alpha-blend" && n.buffers.color.setClear(0, 0, 0, 0, a), (i.autoClear || _) && (n.buffers.depth.setTest(!0), n.buffers.depth.setMask(!0), n.buffers.color.setMask(!0), i.clear(i.autoClearColor, i.autoClearDepth, i.autoClearStencil));
31413
31421
  }
@@ -31432,7 +31440,7 @@ function aT(i, e, t, n, s, r, a) {
31432
31440
  get: function() {
31433
31441
  return this.uniforms.envMap.value;
31434
31442
  }
31435
- }), s.update(d)), ss.copy(_.backgroundRotation), ss.x *= -1, ss.y *= -1, ss.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (ss.y *= -1, ss.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 = _.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(rT.makeRotationFromEuler(ss)), d.material.toneMapped = Qe.getTransfer(S.colorSpace) !== lt, (u !== S || h !== S.version || p !== i.toneMapping) && (d.material.needsUpdate = !0, u = S, h = S.version, p = i.toneMapping), d.layers.enableAll(), E.unshift(d, d.geometry, d.material, 0, 0, null)) : S && S.isTexture && (l === void 0 && (l = new zn(
31443
+ }), s.update(d)), ss.copy(_.backgroundRotation), ss.x *= -1, ss.y *= -1, ss.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (ss.y *= -1, ss.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 = _.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = _.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(rT.makeRotationFromEuler(ss)), 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(), E.unshift(d, d.geometry, d.material, 0, 0, null)) : S && S.isTexture && (l === void 0 && (l = new zn(
31436
31444
  new mo(2, 2),
31437
31445
  new wn({
31438
31446
  name: "BackgroundMaterial",
@@ -31449,9 +31457,9 @@ function aT(i, e, t, n, s, r, a) {
31449
31457
  get: function() {
31450
31458
  return this.uniforms.t2D.value;
31451
31459
  }
31452
- }), s.update(l)), l.material.uniforms.t2D.value = S, l.material.uniforms.backgroundIntensity.value = _.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 || p !== i.toneMapping) && (l.material.needsUpdate = !0, u = S, h = S.version, p = i.toneMapping), l.layers.enableAll(), E.unshift(l, l.geometry, l.material, 0, 0, null));
31460
+ }), s.update(l)), l.material.uniforms.t2D.value = S, l.material.uniforms.backgroundIntensity.value = _.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(), E.unshift(l, l.geometry, l.material, 0, 0, null));
31453
31461
  }
31454
- function f(E, _) {
31462
+ function p(E, _) {
31455
31463
  E.getRGB(xa, Sm(i)), n.buffers.color.setClear(xa.r, xa.g, xa.b, _, a);
31456
31464
  }
31457
31465
  function x() {
@@ -31462,13 +31470,13 @@ function aT(i, e, t, n, s, r, a) {
31462
31470
  return o;
31463
31471
  },
31464
31472
  setClearColor: function(E, _ = 1) {
31465
- o.set(E), c = _, f(o, c);
31473
+ o.set(E), c = _, p(o, c);
31466
31474
  },
31467
31475
  getClearAlpha: function() {
31468
31476
  return c;
31469
31477
  },
31470
31478
  setClearAlpha: function(E) {
31471
- c = E, f(o, c);
31479
+ c = E, p(o, c);
31472
31480
  },
31473
31481
  render: v,
31474
31482
  addToRenderList: m,
@@ -31481,7 +31489,7 @@ function oT(i, e) {
31481
31489
  function o(T, R, U, F, q) {
31482
31490
  let Y = !1;
31483
31491
  const H = u(F, U, R);
31484
- r !== H && (r = H, l(r.object)), Y = p(T, F, U, q), Y && g(T, F, U, q), q !== null && e.update(q, i.ELEMENT_ARRAY_BUFFER), (Y || a) && (a = !1, _(T, R, U, F), q !== null && i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, e.get(q).buffer));
31492
+ r !== H && (r = H, l(r.object)), Y = f(T, F, U, q), Y && g(T, F, U, q), q !== null && e.update(q, i.ELEMENT_ARRAY_BUFFER), (Y || a) && (a = !1, _(T, R, U, F), q !== null && i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, e.get(q).buffer));
31485
31493
  }
31486
31494
  function c() {
31487
31495
  return i.createVertexArray();
@@ -31518,7 +31526,7 @@ function oT(i, e) {
31518
31526
  index: null
31519
31527
  };
31520
31528
  }
31521
- function p(T, R, U, F) {
31529
+ function f(T, R, U, F) {
31522
31530
  const q = r.attributes, Y = R.attributes;
31523
31531
  let H = 0;
31524
31532
  const W = U.getAttributes();
@@ -31550,9 +31558,9 @@ function oT(i, e) {
31550
31558
  T[R] = 0;
31551
31559
  }
31552
31560
  function m(T) {
31553
- f(T, 0);
31561
+ p(T, 0);
31554
31562
  }
31555
- function f(T, R) {
31563
+ function p(T, R) {
31556
31564
  const U = r.newAttributes, F = r.enabledAttributes, q = r.attributeDivisors;
31557
31565
  U[T] = 1, F[T] === 0 && (i.enableVertexAttribArray(T), F[T] = 1), q[T] !== R && (i.vertexAttribDivisor(T, R), q[T] = R);
31558
31566
  }
@@ -31574,12 +31582,12 @@ function oT(i, e) {
31574
31582
  if (ge === void 0 && (W === "instanceMatrix" && T.instanceMatrix && (ge = T.instanceMatrix), W === "instanceColor" && T.instanceColor && (ge = T.instanceColor)), ge !== void 0) {
31575
31583
  const le = ge.normalized, _e = ge.itemSize, Be = e.get(ge);
31576
31584
  if (Be === void 0) continue;
31577
- const Fe = Be.buffer, xt = Be.type, dt = Be.bytesPerElement, $ = xt === i.INT || xt === i.UNSIGNED_INT || ge.gpuType === Md;
31585
+ const Fe = Be.buffer, Ct = Be.type, dt = Be.bytesPerElement, $ = Ct === i.INT || Ct === i.UNSIGNED_INT || ge.gpuType === Md;
31578
31586
  if (ge.isInterleavedBufferAttribute) {
31579
31587
  const te = ge.data, Te = te.stride, Ve = ge.offset;
31580
31588
  if (te.isInstancedInterleavedBuffer) {
31581
31589
  for (let Me = 0; Me < ee.locationSize; Me++)
31582
- f(ee.location + Me, te.meshPerAttribute);
31590
+ p(ee.location + Me, te.meshPerAttribute);
31583
31591
  T.isInstancedMesh !== !0 && F._maxInstanceCount === void 0 && (F._maxInstanceCount = te.meshPerAttribute * te.count);
31584
31592
  } else
31585
31593
  for (let Me = 0; Me < ee.locationSize; Me++)
@@ -31589,7 +31597,7 @@ function oT(i, e) {
31589
31597
  E(
31590
31598
  ee.location + Me,
31591
31599
  _e / ee.locationSize,
31592
- xt,
31600
+ Ct,
31593
31601
  le,
31594
31602
  Te * dt,
31595
31603
  (Ve + _e / ee.locationSize * Me) * dt,
@@ -31598,7 +31606,7 @@ function oT(i, e) {
31598
31606
  } else {
31599
31607
  if (ge.isInstancedBufferAttribute) {
31600
31608
  for (let te = 0; te < ee.locationSize; te++)
31601
- f(ee.location + te, ge.meshPerAttribute);
31609
+ p(ee.location + te, ge.meshPerAttribute);
31602
31610
  T.isInstancedMesh !== !0 && F._maxInstanceCount === void 0 && (F._maxInstanceCount = ge.meshPerAttribute * ge.count);
31603
31611
  } else
31604
31612
  for (let te = 0; te < ee.locationSize; te++)
@@ -31608,7 +31616,7 @@ function oT(i, e) {
31608
31616
  E(
31609
31617
  ee.location + te,
31610
31618
  _e / ee.locationSize,
31611
- xt,
31619
+ Ct,
31612
31620
  le,
31613
31621
  _e * dt,
31614
31622
  _e / ee.locationSize * te * dt,
@@ -31702,19 +31710,19 @@ function cT(i, e, t) {
31702
31710
  function o(l, d, u) {
31703
31711
  if (u === 0) return;
31704
31712
  e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n, l, 0, d, 0, u);
31705
- let p = 0;
31713
+ let f = 0;
31706
31714
  for (let g = 0; g < u; g++)
31707
- p += d[g];
31708
- t.update(p, n, 1);
31715
+ f += d[g];
31716
+ t.update(f, n, 1);
31709
31717
  }
31710
31718
  function c(l, d, u, h) {
31711
31719
  if (u === 0) return;
31712
- const p = e.get("WEBGL_multi_draw");
31713
- if (p === null)
31720
+ const f = e.get("WEBGL_multi_draw");
31721
+ if (f === null)
31714
31722
  for (let g = 0; g < l.length; g++)
31715
31723
  a(l[g], d[g], h[g]);
31716
31724
  else {
31717
- p.multiDrawArraysInstancedWEBGL(n, l, 0, d, 0, h, 0, u);
31725
+ f.multiDrawArraysInstancedWEBGL(n, l, 0, d, 0, h, 0, u);
31718
31726
  let g = 0;
31719
31727
  for (let v = 0; v < u; v++)
31720
31728
  g += d[v] * h[v];
@@ -31753,7 +31761,7 @@ function lT(i, e, t, n) {
31753
31761
  let l = t.precision !== void 0 ? t.precision : "highp";
31754
31762
  const d = c(l);
31755
31763
  d !== l && (Oe("WebGLRenderer:", l, "not supported, using", d, "instead."), l = d);
31756
- const u = t.logarithmicDepthBuffer === !0, h = t.reversedDepthBuffer === !0 && e.has("EXT_clip_control"), p = i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS), g = i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS), v = i.getParameter(i.MAX_TEXTURE_SIZE), m = i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE), f = i.getParameter(i.MAX_VERTEX_ATTRIBS), x = i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS), E = i.getParameter(i.MAX_VARYING_VECTORS), _ = i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS), S = i.getParameter(i.MAX_SAMPLES), M = i.getParameter(i.SAMPLES);
31764
+ const u = t.logarithmicDepthBuffer === !0, h = t.reversedDepthBuffer === !0 && e.has("EXT_clip_control"), f = i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS), g = i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS), v = i.getParameter(i.MAX_TEXTURE_SIZE), m = i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE), p = i.getParameter(i.MAX_VERTEX_ATTRIBS), x = i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS), E = i.getParameter(i.MAX_VARYING_VECTORS), _ = i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS), S = i.getParameter(i.MAX_SAMPLES), M = i.getParameter(i.SAMPLES);
31757
31765
  return {
31758
31766
  isWebGL2: !0,
31759
31767
  // keeping this for backwards compatibility
@@ -31764,11 +31772,11 @@ function lT(i, e, t, n) {
31764
31772
  precision: l,
31765
31773
  logarithmicDepthBuffer: u,
31766
31774
  reversedDepthBuffer: h,
31767
- maxTextures: p,
31775
+ maxTextures: f,
31768
31776
  maxVertexTextures: g,
31769
31777
  maxTextureSize: v,
31770
31778
  maxCubemapSize: m,
31771
- maxAttributes: f,
31779
+ maxAttributes: p,
31772
31780
  maxVertexUniforms: x,
31773
31781
  maxVaryings: E,
31774
31782
  maxFragmentUniforms: _,
@@ -31781,40 +31789,40 @@ function dT(i) {
31781
31789
  let t = null, n = 0, s = !1, r = !1;
31782
31790
  const a = new os(), o = new ze(), c = { value: null, needsUpdate: !1 };
31783
31791
  this.uniform = c, this.numPlanes = 0, this.numIntersection = 0, this.init = function(u, h) {
31784
- const p = u.length !== 0 || h || // enable state of previous frame - the clipping code has to
31792
+ const f = u.length !== 0 || h || // enable state of previous frame - the clipping code has to
31785
31793
  // run another frame in order to reset the state:
31786
31794
  n !== 0 || s;
31787
- return s = h, n = u.length, p;
31795
+ return s = h, n = u.length, f;
31788
31796
  }, this.beginShadows = function() {
31789
31797
  r = !0, d(null);
31790
31798
  }, this.endShadows = function() {
31791
31799
  r = !1;
31792
31800
  }, this.setGlobalState = function(u, h) {
31793
31801
  t = d(u, h, 0);
31794
- }, this.setState = function(u, h, p) {
31795
- const g = u.clippingPlanes, v = u.clipIntersection, m = u.clipShadows, f = i.get(u);
31802
+ }, this.setState = function(u, h, f) {
31803
+ const g = u.clippingPlanes, v = u.clipIntersection, m = u.clipShadows, p = i.get(u);
31796
31804
  if (!s || g === null || g.length === 0 || r && !m)
31797
31805
  r ? d(null) : l();
31798
31806
  else {
31799
31807
  const x = r ? 0 : n, E = x * 4;
31800
- let _ = f.clippingState || null;
31801
- c.value = _, _ = d(g, h, E, p);
31808
+ let _ = p.clippingState || null;
31809
+ c.value = _, _ = d(g, h, E, f);
31802
31810
  for (let S = 0; S !== E; ++S)
31803
31811
  _[S] = t[S];
31804
- f.clippingState = _, this.numIntersection = v ? this.numPlanes : 0, this.numPlanes += x;
31812
+ p.clippingState = _, this.numIntersection = v ? this.numPlanes : 0, this.numPlanes += x;
31805
31813
  }
31806
31814
  };
31807
31815
  function l() {
31808
31816
  c.value !== t && (c.value = t, c.needsUpdate = n > 0), e.numPlanes = n, e.numIntersection = 0;
31809
31817
  }
31810
- function d(u, h, p, g) {
31818
+ function d(u, h, f, g) {
31811
31819
  const v = u !== null ? u.length : 0;
31812
31820
  let m = null;
31813
31821
  if (v !== 0) {
31814
31822
  if (m = c.value, g !== !0 || m === null) {
31815
- const f = p + v * 4, x = h.matrixWorldInverse;
31816
- o.getNormalMatrix(x), (m === null || m.length < f) && (m = new Float32Array(f));
31817
- for (let E = 0, _ = p; E !== v; ++E, _ += 4)
31823
+ const p = f + v * 4, x = h.matrixWorldInverse;
31824
+ o.getNormalMatrix(x), (m === null || m.length < p) && (m = new Float32Array(p));
31825
+ for (let E = 0, _ = f; E !== v; ++E, _ += 4)
31818
31826
  a.copy(u[E]).applyMatrix4(x, o), a.normal.toArray(m, _), m[_ + 3] = a.constant;
31819
31827
  }
31820
31828
  c.value = m, c.needsUpdate = !0;
@@ -31980,7 +31988,7 @@ class Nh {
31980
31988
  this._renderer.compile(t, Tr);
31981
31989
  }
31982
31990
  _sceneToCubeUV(e, t, n, s, r) {
31983
- const c = new Cn(90, 1, t, n), l = [1, -1, 1, 1, 1, 1], d = [1, 1, 1, -1, -1, -1], u = this._renderer, h = u.autoClear, p = u.toneMapping;
31991
+ const c = new Cn(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;
31984
31992
  u.getClearColor(Lh), 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(
31985
31993
  new Zr(),
31986
31994
  new _m({
@@ -31991,16 +31999,16 @@ class Nh {
31991
31999
  })
31992
32000
  ));
31993
32001
  const v = this._backgroundBox, m = v.material;
31994
- let f = !1;
32002
+ let p = !1;
31995
32003
  const x = e.background;
31996
- x ? x.isColor && (m.color.copy(x), e.background = null, f = !0) : (m.color.copy(Lh), f = !0);
32004
+ x ? x.isColor && (m.color.copy(x), e.background = null, p = !0) : (m.color.copy(Lh), p = !0);
31997
32005
  for (let E = 0; E < 6; E++) {
31998
32006
  const _ = E % 3;
31999
32007
  _ === 0 ? (c.up.set(0, l[E], 0), c.position.set(r.x, r.y, r.z), c.lookAt(r.x + d[E], r.y, r.z)) : _ === 1 ? (c.up.set(0, 0, l[E]), c.position.set(r.x, r.y, r.z), c.lookAt(r.x, r.y + d[E], r.z)) : (c.up.set(0, l[E], 0), c.position.set(r.x, r.y, r.z), c.lookAt(r.x, r.y, r.z + d[E]));
32000
32008
  const S = this._cubeSize;
32001
- Vs(s, _ * S, E > 2 ? S : 0, S, S), u.setRenderTarget(s), f && u.render(v, c), u.render(e, c);
32009
+ Vs(s, _ * S, E > 2 ? S : 0, S, S), u.setRenderTarget(s), p && u.render(v, c), u.render(e, c);
32002
32010
  }
32003
- u.toneMapping = p, u.autoClear = h, e.background = x;
32011
+ u.toneMapping = f, u.autoClear = h, e.background = x;
32004
32012
  }
32005
32013
  _textureToCubeUV(e, t) {
32006
32014
  const n = this._renderer, s = e.mapping === Ss || e.mapping === ir;
@@ -32034,8 +32042,8 @@ class Nh {
32034
32042
  _applyGGXFilter(e, t, n) {
32035
32043
  const s = this._renderer, r = this._pingPongRenderTarget, a = this._ggxMaterial, o = this._lodMeshes[n];
32036
32044
  o.material = a;
32037
- const c = a.uniforms, l = n / (this._lodMeshes.length - 1), d = t / (this._lodMeshes.length - 1), u = Math.sqrt(l * l - d * d), h = 0 + l * 1.25, p = u * h, { _lodMax: g } = this, v = this._sizeLods[n], m = 3 * v * (n > g - Wi ? n - g + Wi : 0), f = 4 * (this._cubeSize - v);
32038
- c.envMap.value = e.texture, c.roughness.value = p, c.mipInt.value = g - t, Vs(r, m, f, 3 * v, 2 * v), s.setRenderTarget(r), s.render(o, Tr), c.envMap.value = r.texture, c.roughness.value = 0, c.mipInt.value = g - n, Vs(e, m, f, 3 * v, 2 * v), s.setRenderTarget(e), s.render(o, Tr);
32045
+ const c = a.uniforms, l = n / (this._lodMeshes.length - 1), d = t / (this._lodMeshes.length - 1), u = Math.sqrt(l * l - d * d), h = 0 + l * 1.25, f = u * h, { _lodMax: g } = this, v = this._sizeLods[n], m = 3 * v * (n > g - Wi ? n - g + Wi : 0), p = 4 * (this._cubeSize - v);
32046
+ c.envMap.value = e.texture, c.roughness.value = f, c.mipInt.value = g - t, Vs(r, m, p, 3 * v, 2 * v), s.setRenderTarget(r), s.render(o, Tr), c.envMap.value = r.texture, c.roughness.value = 0, c.mipInt.value = g - n, Vs(e, m, p, 3 * v, 2 * v), s.setRenderTarget(e), s.render(o, Tr);
32039
32047
  }
32040
32048
  /**
32041
32049
  * This is a two-pass Gaussian blur for a cubemap. Normally this is done
@@ -32080,17 +32088,17 @@ class Nh {
32080
32088
  );
32081
32089
  const d = 3, u = this._lodMeshes[s];
32082
32090
  u.material = l;
32083
- const h = l.uniforms, p = this._sizeLods[n] - 1, g = isFinite(r) ? Math.PI / (2 * p) : 2 * Math.PI / (2 * ds - 1), v = r / g, m = isFinite(r) ? 1 + Math.floor(d * v) : ds;
32091
+ const h = l.uniforms, f = this._sizeLods[n] - 1, g = isFinite(r) ? Math.PI / (2 * f) : 2 * Math.PI / (2 * ds - 1), v = r / g, m = isFinite(r) ? 1 + Math.floor(d * v) : ds;
32084
32092
  m > ds && Oe(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ds}`);
32085
- const f = [];
32093
+ const p = [];
32086
32094
  let x = 0;
32087
32095
  for (let A = 0; A < ds; ++A) {
32088
32096
  const k = A / v, y = Math.exp(-k * k / 2);
32089
- f.push(y), A === 0 ? x += y : A < m && (x += 2 * y);
32097
+ p.push(y), A === 0 ? x += y : A < m && (x += 2 * y);
32090
32098
  }
32091
- for (let A = 0; A < f.length; A++)
32092
- f[A] = f[A] / x;
32093
- h.envMap.value = e.texture, h.samples.value = m, h.weights.value = f, h.latitudinal.value = a === "latitudinal", o && (h.poleAxis.value = o);
32099
+ for (let A = 0; A < p.length; A++)
32100
+ p[A] = p[A] / x;
32101
+ h.envMap.value = e.texture, h.samples.value = m, h.weights.value = p, h.latitudinal.value = a === "latitudinal", o && (h.poleAxis.value = o);
32094
32102
  const { _lodMax: E } = this;
32095
32103
  h.dTheta.value = g, h.mipInt.value = E - n;
32096
32104
  const _ = this._sizeLods[s], S = 3 * _ * (s > E - Wi ? s - E + Wi : 0), M = 4 * (this._cubeSize - _);
@@ -32106,8 +32114,8 @@ function pT(i) {
32106
32114
  e.push(o);
32107
32115
  let c = 1 / o;
32108
32116
  a > i - Wi ? c = Dh[a - i + Wi - 1] : a === 0 && (c = 0), t.push(c);
32109
- const l = 1 / (o - 2), d = -l, u = 1 + l, h = [d, d, u, d, u, u, d, d, u, u, d, u], p = 6, g = 6, v = 3, m = 2, f = 1, x = new Float32Array(v * g * p), E = new Float32Array(m * g * p), _ = new Float32Array(f * g * p);
32110
- for (let M = 0; M < p; M++) {
32117
+ const l = 1 / (o - 2), d = -l, u = 1 + l, h = [d, d, u, d, u, u, d, d, u, u, d, u], f = 6, g = 6, v = 3, m = 2, p = 1, x = new Float32Array(v * g * f), E = new Float32Array(m * g * f), _ = new Float32Array(p * g * f);
32118
+ for (let M = 0; M < f; M++) {
32111
32119
  const A = M % 3 * 2 / 3 - 1, k = M > 2 ? 0 : -1, y = [
32112
32120
  A,
32113
32121
  k,
@@ -32130,10 +32138,10 @@ function pT(i) {
32130
32138
  ];
32131
32139
  x.set(y, v * g * M), E.set(h, m * g * M);
32132
32140
  const T = [M, M, M, M, M, M];
32133
- _.set(T, f * g * M);
32141
+ _.set(T, p * g * M);
32134
32142
  }
32135
32143
  const S = new Gn();
32136
- S.setAttribute("position", new ti(x, v)), S.setAttribute("uv", new ti(E, m)), S.setAttribute("faceIndex", new ti(_, f)), n.push(new zn(S, null)), s > Wi && s--;
32144
+ S.setAttribute("position", new ti(x, v)), S.setAttribute("uv", new ti(E, m)), S.setAttribute("faceIndex", new ti(_, p)), n.push(new zn(S, null)), s > Wi && s--;
32137
32145
  }
32138
32146
  return { lodMeshes: n, sizeLods: e, sigmas: t };
32139
32147
  }
@@ -32507,8 +32515,8 @@ function vT(i) {
32507
32515
  if (u !== void 0)
32508
32516
  return u.texture;
32509
32517
  {
32510
- const p = o.image;
32511
- return l && p && p.height > 0 || d && p && s(p) ? (t === null && (t = new Nh(i)), u = l ? t.fromEquirectangular(o) : t.fromCubemap(o), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), o.addEventListener("dispose", r), u.texture) : null;
32518
+ const f = o.image;
32519
+ return l && f && f.height > 0 || d && f && s(f) ? (t === null && (t = new Nh(i)), u = l ? t.fromEquirectangular(o) : t.fromCubemap(o), u.texture.pmremVersion = o.pmremVersion, e.set(o, u), o.addEventListener("dispose", r), u.texture) : null;
32512
32520
  }
32513
32521
  }
32514
32522
  }
@@ -32564,23 +32572,23 @@ function bT(i, e, t, n) {
32564
32572
  for (const g in h.attributes)
32565
32573
  e.remove(h.attributes[g]);
32566
32574
  h.removeEventListener("dispose", a), delete s[h.id];
32567
- const p = r.get(h);
32568
- p && (e.remove(p), r.delete(h)), n.releaseStatesOfGeometry(h), h.isInstancedBufferGeometry === !0 && delete h._maxInstanceCount, t.memory.geometries--;
32575
+ const f = r.get(h);
32576
+ f && (e.remove(f), r.delete(h)), n.releaseStatesOfGeometry(h), h.isInstancedBufferGeometry === !0 && delete h._maxInstanceCount, t.memory.geometries--;
32569
32577
  }
32570
32578
  function o(u, h) {
32571
32579
  return s[h.id] === !0 || (h.addEventListener("dispose", a), s[h.id] = !0, t.memory.geometries++), h;
32572
32580
  }
32573
32581
  function c(u) {
32574
32582
  const h = u.attributes;
32575
- for (const p in h)
32576
- e.update(h[p], i.ARRAY_BUFFER);
32583
+ for (const f in h)
32584
+ e.update(h[f], i.ARRAY_BUFFER);
32577
32585
  }
32578
32586
  function l(u) {
32579
- const h = [], p = u.index, g = u.attributes.position;
32587
+ const h = [], f = u.index, g = u.attributes.position;
32580
32588
  let v = 0;
32581
- if (p !== null) {
32582
- const x = p.array;
32583
- v = p.version;
32589
+ if (f !== null) {
32590
+ const x = f.array;
32591
+ v = f.version;
32584
32592
  for (let E = 0, _ = x.length; E < _; E += 3) {
32585
32593
  const S = x[E + 0], M = x[E + 1], A = x[E + 2];
32586
32594
  h.push(S, M, M, A, A, S);
@@ -32596,14 +32604,14 @@ function bT(i, e, t, n) {
32596
32604
  return;
32597
32605
  const m = new (pm(h) ? ym : bm)(h, 1);
32598
32606
  m.version = v;
32599
- const f = r.get(u);
32600
- f && e.remove(f), r.set(u, m);
32607
+ const p = r.get(u);
32608
+ p && e.remove(p), r.set(u, m);
32601
32609
  }
32602
32610
  function d(u) {
32603
32611
  const h = r.get(u);
32604
32612
  if (h) {
32605
- const p = u.index;
32606
- p !== null && h.version < p.version && l(u);
32613
+ const f = u.index;
32614
+ f !== null && h.version < f.version && l(u);
32607
32615
  } else
32608
32616
  l(u);
32609
32617
  return r.get(u);
@@ -32623,32 +32631,32 @@ function yT(i, e, t) {
32623
32631
  function o(h) {
32624
32632
  r = h.type, a = h.bytesPerElement;
32625
32633
  }
32626
- function c(h, p) {
32627
- i.drawElements(n, p, r, h * a), t.update(p, n, 1);
32634
+ function c(h, f) {
32635
+ i.drawElements(n, f, r, h * a), t.update(f, n, 1);
32628
32636
  }
32629
- function l(h, p, g) {
32630
- g !== 0 && (i.drawElementsInstanced(n, p, r, h * a, g), t.update(p, n, g));
32637
+ function l(h, f, g) {
32638
+ g !== 0 && (i.drawElementsInstanced(n, f, r, h * a, g), t.update(f, n, g));
32631
32639
  }
32632
- function d(h, p, g) {
32640
+ function d(h, f, g) {
32633
32641
  if (g === 0) return;
32634
- e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n, p, 0, r, h, 0, g);
32642
+ e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n, f, 0, r, h, 0, g);
32635
32643
  let m = 0;
32636
- for (let f = 0; f < g; f++)
32637
- m += p[f];
32644
+ for (let p = 0; p < g; p++)
32645
+ m += f[p];
32638
32646
  t.update(m, n, 1);
32639
32647
  }
32640
- function u(h, p, g, v) {
32648
+ function u(h, f, g, v) {
32641
32649
  if (g === 0) return;
32642
32650
  const m = e.get("WEBGL_multi_draw");
32643
32651
  if (m === null)
32644
- for (let f = 0; f < h.length; f++)
32645
- l(h[f] / a, p[f], v[f]);
32652
+ for (let p = 0; p < h.length; p++)
32653
+ l(h[p] / a, f[p], v[p]);
32646
32654
  else {
32647
- m.multiDrawElementsInstancedWEBGL(n, p, 0, r, h, 0, v, 0, g);
32648
- let f = 0;
32655
+ m.multiDrawElementsInstancedWEBGL(n, f, 0, r, h, 0, v, 0, g);
32656
+ let p = 0;
32649
32657
  for (let x = 0; x < g; x++)
32650
- f += p[x] * v[x];
32651
- t.update(f, n, 1);
32658
+ p += f[x] * v[x];
32659
+ t.update(p, n, 1);
32652
32660
  }
32653
32661
  }
32654
32662
  this.setMode = s, this.setIndex = o, this.render = c, this.renderInstances = l, this.renderMultiDraw = d, this.renderMultiDrawInstances = u;
@@ -32708,19 +32716,19 @@ function xT(i, e, t) {
32708
32716
  A.dispose(), n.delete(o), o.removeEventListener("dispose", y);
32709
32717
  };
32710
32718
  h !== void 0 && h.texture.dispose();
32711
- const p = o.morphAttributes.position !== void 0, g = o.morphAttributes.normal !== void 0, v = o.morphAttributes.color !== void 0, m = o.morphAttributes.position || [], f = o.morphAttributes.normal || [], x = o.morphAttributes.color || [];
32719
+ const f = o.morphAttributes.position !== void 0, g = o.morphAttributes.normal !== void 0, v = o.morphAttributes.color !== void 0, m = o.morphAttributes.position || [], p = o.morphAttributes.normal || [], x = o.morphAttributes.color || [];
32712
32720
  let E = 0;
32713
- p === !0 && (E = 1), g === !0 && (E = 2), v === !0 && (E = 3);
32721
+ f === !0 && (E = 1), g === !0 && (E = 2), v === !0 && (E = 3);
32714
32722
  let _ = o.attributes.position.count * E, S = 1;
32715
32723
  _ > e.maxTextureSize && (S = Math.ceil(_ / e.maxTextureSize), _ = e.maxTextureSize);
32716
32724
  const M = new Float32Array(_ * S * 4 * u), A = new mm(M, _, S, u);
32717
32725
  A.type = Kn, A.needsUpdate = !0;
32718
32726
  const k = E * 4;
32719
32727
  for (let T = 0; T < u; T++) {
32720
- const R = m[T], U = f[T], F = x[T], q = _ * S * 4 * T;
32728
+ const R = m[T], U = p[T], F = x[T], q = _ * S * 4 * T;
32721
32729
  for (let Y = 0; Y < R.count; Y++) {
32722
32730
  const H = Y * k;
32723
- p === !0 && (s.fromBufferAttribute(R, Y), M[q + H + 0] = s.x, M[q + H + 1] = s.y, M[q + H + 2] = s.z, M[q + H + 3] = 0), g === !0 && (s.fromBufferAttribute(U, Y), M[q + H + 4] = s.x, M[q + H + 5] = s.y, M[q + H + 6] = s.z, M[q + H + 7] = 0), v === !0 && (s.fromBufferAttribute(F, Y), M[q + H + 8] = s.x, M[q + H + 9] = s.y, M[q + H + 10] = s.z, M[q + H + 11] = F.itemSize === 4 ? s.w : 1);
32731
+ f === !0 && (s.fromBufferAttribute(R, Y), M[q + H + 0] = s.x, M[q + H + 1] = s.y, M[q + H + 2] = s.z, M[q + H + 3] = 0), g === !0 && (s.fromBufferAttribute(U, Y), M[q + H + 4] = s.x, M[q + H + 5] = s.y, M[q + H + 6] = s.z, M[q + H + 7] = 0), v === !0 && (s.fromBufferAttribute(F, Y), M[q + H + 8] = s.x, M[q + H + 9] = s.y, M[q + H + 10] = s.z, M[q + H + 11] = F.itemSize === 4 ? s.w : 1);
32724
32732
  }
32725
32733
  }
32726
32734
  h = {
@@ -32732,10 +32740,10 @@ function xT(i, e, t) {
32732
32740
  if (a.isInstancedMesh === !0 && a.morphTexture !== null)
32733
32741
  c.getUniforms().setValue(i, "morphTexture", a.morphTexture, t);
32734
32742
  else {
32735
- let p = 0;
32743
+ let f = 0;
32736
32744
  for (let v = 0; v < l.length; v++)
32737
- p += l[v];
32738
- const g = o.morphTargetsRelative ? 1 : 1 - p;
32745
+ f += l[v];
32746
+ const g = o.morphTargetsRelative ? 1 : 1 - f;
32739
32747
  c.getUniforms().setValue(i, "morphTargetBaseInfluence", g), c.getUniforms().setValue(i, "morphTargetInfluences", l);
32740
32748
  }
32741
32749
  c.getUniforms().setValue(i, "morphTargetsTexture", h.texture, t), c.getUniforms().setValue(i, "morphTargetsTextureSize", h.size);
@@ -32847,7 +32855,7 @@ function CT(i, e, t, n, s) {
32847
32855
  depthTest: !1,
32848
32856
  depthWrite: !1
32849
32857
  }), l = new zn(o, c), d = new wm(-1, 1, 1, -1, 0, 1);
32850
- let u = null, h = null, p = !1, g, v = null, m = [], f = !1;
32858
+ let u = null, h = null, f = !1, g, v = null, m = [], p = !1;
32851
32859
  this.setSize = function(x, E) {
32852
32860
  r.setSize(x, E), a.setSize(x, E);
32853
32861
  for (let _ = 0; _ < m.length; _++) {
@@ -32855,23 +32863,23 @@ function CT(i, e, t, n, s) {
32855
32863
  S.setSize && S.setSize(x, E);
32856
32864
  }
32857
32865
  }, this.setEffects = function(x) {
32858
- m = x, f = m.length > 0 && m[0].isRenderPass === !0;
32866
+ m = x, p = m.length > 0 && m[0].isRenderPass === !0;
32859
32867
  const E = r.width, _ = r.height;
32860
32868
  for (let S = 0; S < m.length; S++) {
32861
32869
  const M = m[S];
32862
32870
  M.setSize && M.setSize(E, _);
32863
32871
  }
32864
32872
  }, this.begin = function(x, E) {
32865
- if (p || x.toneMapping === Qn && m.length === 0) return !1;
32873
+ if (f || x.toneMapping === Qn && m.length === 0) return !1;
32866
32874
  if (v = E, E !== null) {
32867
32875
  const _ = E.width, S = E.height;
32868
32876
  (r.width !== _ || r.height !== S) && this.setSize(_, S);
32869
32877
  }
32870
- return f === !1 && x.setRenderTarget(r), g = x.toneMapping, x.toneMapping = Qn, !0;
32878
+ return p === !1 && x.setRenderTarget(r), g = x.toneMapping, x.toneMapping = Qn, !0;
32871
32879
  }, this.hasRenderPass = function() {
32872
- return f;
32880
+ return p;
32873
32881
  }, this.end = function(x, E) {
32874
- x.toneMapping = g, p = !0;
32882
+ x.toneMapping = g, f = !0;
32875
32883
  let _ = r, S = a;
32876
32884
  for (let M = 0; M < m.length; M++) {
32877
32885
  const A = m[M];
@@ -32885,9 +32893,9 @@ function CT(i, e, t, n, s) {
32885
32893
  const M = ET[h];
32886
32894
  M && (c.defines[M] = ""), c.needsUpdate = !0;
32887
32895
  }
32888
- c.uniforms.tDiffuse.value = _.texture, x.setRenderTarget(v), x.render(l, d), v = null, p = !1;
32896
+ c.uniforms.tDiffuse.value = _.texture, x.setRenderTarget(v), x.render(l, d), v = null, f = !1;
32889
32897
  }, this.isCompositing = function() {
32890
- return p;
32898
+ return f;
32891
32899
  }, this.dispose = function() {
32892
32900
  r.dispose(), a.dispose(), o.dispose(), c.dispose();
32893
32901
  };
@@ -33593,8 +33601,8 @@ function VE(i) {
33593
33601
  function zE(i, e, t, n) {
33594
33602
  const s = i.getContext(), r = t.defines;
33595
33603
  let a = t.vertexShader, o = t.fragmentShader;
33596
- const c = DE(t), l = NE(t), d = OE(t), u = BE(t), h = VE(t), p = EE(t), g = CE(r), v = s.createProgram();
33597
- let m, f, x = t.glslVersion ? "#version " + t.glslVersion + `
33604
+ const c = DE(t), l = NE(t), d = OE(t), u = BE(t), h = VE(t), f = EE(t), g = CE(r), v = s.createProgram();
33605
+ let m, p, x = t.glslVersion ? "#version " + t.glslVersion + `
33598
33606
  ` : "";
33599
33607
  t.isRawShaderMaterial ? (m = [
33600
33608
  "#define SHADER_TYPE " + t.shaderType,
@@ -33602,12 +33610,12 @@ function zE(i, e, t, n) {
33602
33610
  g
33603
33611
  ].filter(Ar).join(`
33604
33612
  `), m.length > 0 && (m += `
33605
- `), f = [
33613
+ `), p = [
33606
33614
  "#define SHADER_TYPE " + t.shaderType,
33607
33615
  "#define SHADER_NAME " + t.shaderName,
33608
33616
  g
33609
33617
  ].filter(Ar).join(`
33610
- `), f.length > 0 && (f += `
33618
+ `), p.length > 0 && (p += `
33611
33619
  `)) : (m = [
33612
33620
  Jh(t),
33613
33621
  "#define SHADER_TYPE " + t.shaderType,
@@ -33741,7 +33749,7 @@ function zE(i, e, t, n) {
33741
33749
  `
33742
33750
  `
33743
33751
  ].filter(Ar).join(`
33744
- `), f = [
33752
+ `), p = [
33745
33753
  Jh(t),
33746
33754
  "#define SHADER_TYPE " + t.shaderType,
33747
33755
  "#define SHADER_NAME " + t.shaderName,
@@ -33827,13 +33835,13 @@ function zE(i, e, t, n) {
33827
33835
  ].filter(Ar).join(`
33828
33836
  `)), a = Kl(a), a = $h(a, t), a = Yh(a, t), o = Kl(o), o = $h(o, t), o = Yh(o, t), a = Kh(a), o = Kh(o), t.isRawShaderMaterial !== !0 && (x = `#version 300 es
33829
33837
  `, m = [
33830
- p,
33838
+ f,
33831
33839
  "#define attribute in",
33832
33840
  "#define varying out",
33833
33841
  "#define texture2D texture"
33834
33842
  ].join(`
33835
33843
  `) + `
33836
- ` + m, f = [
33844
+ ` + m, p = [
33837
33845
  "#define varying in",
33838
33846
  t.glslVersion === fh ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",
33839
33847
  t.glslVersion === fh ? "" : "#define gl_FragColor pc_fragColor",
@@ -33849,8 +33857,8 @@ function zE(i, e, t, n) {
33849
33857
  "#define textureCubeGradEXT textureGrad"
33850
33858
  ].join(`
33851
33859
  `) + `
33852
- ` + f);
33853
- const E = x + m + a, _ = x + f + o, S = qh(s, s.VERTEX_SHADER, E), M = qh(s, s.FRAGMENT_SHADER, _);
33860
+ ` + p);
33861
+ const E = x + m + a, _ = x + p + o, S = qh(s, s.VERTEX_SHADER, E), M = qh(s, s.FRAGMENT_SHADER, _);
33854
33862
  s.attachShader(v, S), s.attachShader(v, M), t.index0AttributeName !== void 0 ? s.bindAttribLocation(v, 0, t.index0AttributeName) : t.morphTargets === !0 && s.bindAttribLocation(v, 0, "position"), s.linkProgram(v);
33855
33863
  function A(R) {
33856
33864
  if (i.debug.checkShaderErrors) {
@@ -33882,7 +33890,7 @@ Program Info Log: ` + Y + `
33882
33890
  },
33883
33891
  fragmentShader: {
33884
33892
  log: W,
33885
- prefix: f
33893
+ prefix: p
33886
33894
  }
33887
33895
  });
33888
33896
  }
@@ -33945,7 +33953,7 @@ class WE {
33945
33953
  }
33946
33954
  function qE(i, e, t, n, s, r, a) {
33947
33955
  const o = new gm(), c = new HE(), l = /* @__PURE__ */ new Set(), d = [], u = /* @__PURE__ */ new Map(), h = s.logarithmicDepthBuffer;
33948
- let p = s.precision;
33956
+ let f = s.precision;
33949
33957
  const g = {
33950
33958
  MeshDepthMaterial: "depth",
33951
33959
  MeshDistanceMaterial: "distance",
@@ -33968,17 +33976,17 @@ function qE(i, e, t, n, s, r, a) {
33968
33976
  }
33969
33977
  function m(y, T, R, U, F) {
33970
33978
  const q = U.fog, Y = F.geometry, H = y.isMeshStandardMaterial ? U.environment : null, W = (y.isMeshStandardMaterial ? t : e).get(y.envMap || H), ee = W && W.mapping === fo ? W.image.height : null, ge = g[y.type];
33971
- y.precision !== null && (p = s.getMaxPrecision(y.precision), p !== y.precision && Oe("WebGLProgram.getParameters:", y.precision, "not supported, using", p, "instead."));
33979
+ y.precision !== null && (f = s.getMaxPrecision(y.precision), f !== y.precision && Oe("WebGLProgram.getParameters:", y.precision, "not supported, using", f, "instead."));
33972
33980
  const le = Y.morphAttributes.position || Y.morphAttributes.normal || Y.morphAttributes.color, _e = le !== void 0 ? le.length : 0;
33973
33981
  let Be = 0;
33974
33982
  Y.morphAttributes.position !== void 0 && (Be = 1), Y.morphAttributes.normal !== void 0 && (Be = 2), Y.morphAttributes.color !== void 0 && (Be = 3);
33975
- let Fe, xt, dt, $;
33983
+ let Fe, Ct, dt, $;
33976
33984
  if (ge) {
33977
33985
  const ot = Xn[ge];
33978
- Fe = ot.vertexShader, xt = ot.fragmentShader;
33986
+ Fe = ot.vertexShader, Ct = ot.fragmentShader;
33979
33987
  } else
33980
- Fe = y.vertexShader, xt = y.fragmentShader, c.update(y), dt = c.getVertexShaderID(y), $ = c.getFragmentShaderID(y);
33981
- const te = 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, ft = !!y.lightMap, He = !!y.bumpMap, Nt = !!y.normalMap, I = !!y.displacementMap, Ut = !!y.emissiveMap, rt = !!y.metalnessMap, bt = !!y.roughnessMap, Ae = y.anisotropy > 0, w = y.clearcoat > 0, b = 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, Ce = X && !!y.sheenRoughnessMap, Re = !!y.specularMap, he = !!y.specularColorMap, We = !!y.specularIntensityMap, D = Q && !!y.transmissionMap, be = Q && !!y.thicknessMap, ae = !!y.gradientMap, ye = !!y.alphaMap, ie = y.alphaTest > 0, K = !!y.alphaHash, de = !!y.extensions;
33988
+ Fe = y.vertexShader, Ct = y.fragmentShader, c.update(y), dt = c.getVertexShaderID(y), $ = c.getFragmentShaderID(y);
33989
+ const te = 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, bt = !!y.roughnessMap, Ae = y.anisotropy > 0, w = y.clearcoat > 0, b = 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, Ce = X && !!y.sheenRoughnessMap, Re = !!y.specularMap, he = !!y.specularColorMap, We = !!y.specularIntensityMap, D = Q && !!y.transmissionMap, be = Q && !!y.thicknessMap, ae = !!y.gradientMap, Se = !!y.alphaMap, ie = y.alphaTest > 0, K = !!y.alphaHash, de = !!y.extensions;
33982
33990
  let Ue = Qn;
33983
33991
  y.toneMapped && (te === null || te.isXRRenderTarget === !0) && (Ue = i.toneMapping);
33984
33992
  const yt = {
@@ -33986,13 +33994,13 @@ function qE(i, e, t, n, s, r, a) {
33986
33994
  shaderType: y.type,
33987
33995
  shaderName: y.name,
33988
33996
  vertexShader: Fe,
33989
- fragmentShader: xt,
33997
+ fragmentShader: Ct,
33990
33998
  defines: y.defines,
33991
33999
  customVertexShaderID: dt,
33992
34000
  customFragmentShaderID: $,
33993
34001
  isRawShaderMaterial: y.isRawShaderMaterial === !0,
33994
34002
  glslVersion: y.glslVersion,
33995
- precision: p,
34003
+ precision: f,
33996
34004
  batching: Me,
33997
34005
  batchingColor: Me && F._colorsTexture !== null,
33998
34006
  instancing: Ve,
@@ -34006,7 +34014,7 @@ function qE(i, e, t, n, s, r, a) {
34006
34014
  envMapMode: Ze && W.mapping,
34007
34015
  envMapCubeUVHeight: ee,
34008
34016
  aoMap: at,
34009
- lightMap: ft,
34017
+ lightMap: gt,
34010
34018
  bumpMap: He,
34011
34019
  normalMap: Nt,
34012
34020
  displacementMap: I,
@@ -34036,14 +34044,14 @@ function qE(i, e, t, n, s, r, a) {
34036
34044
  thicknessMap: be,
34037
34045
  gradientMap: ae,
34038
34046
  opaque: y.transparent === !1 && y.blending === Ks && y.alphaToCoverage === !1,
34039
- alphaMap: ye,
34047
+ alphaMap: Se,
34040
34048
  alphaTest: ie,
34041
34049
  alphaHash: K,
34042
34050
  combine: y.combine,
34043
34051
  //
34044
34052
  mapUv: et && v(y.map.channel),
34045
34053
  aoMapUv: at && v(y.aoMap.channel),
34046
- lightMapUv: ft && v(y.lightMap.channel),
34054
+ lightMapUv: gt && v(y.lightMap.channel),
34047
34055
  bumpMapUv: He && v(y.bumpMap.channel),
34048
34056
  normalMapUv: Nt && v(y.normalMap.channel),
34049
34057
  displacementMapUv: I && v(y.displacementMap.channel),
@@ -34063,12 +34071,12 @@ function qE(i, e, t, n, s, r, a) {
34063
34071
  specularIntensityMapUv: We && v(y.specularIntensityMap.channel),
34064
34072
  transmissionMapUv: D && v(y.transmissionMap.channel),
34065
34073
  thicknessMapUv: be && v(y.thicknessMap.channel),
34066
- alphaMapUv: ye && v(y.alphaMap.channel),
34074
+ alphaMapUv: Se && v(y.alphaMap.channel),
34067
34075
  //
34068
34076
  vertexTangents: !!Y.attributes.tangent && (Nt || Ae),
34069
34077
  vertexColors: y.vertexColors,
34070
34078
  vertexAlphas: y.vertexColors === !0 && !!Y.attributes.color && Y.attributes.color.itemSize === 4,
34071
- pointsUvs: F.isPoints === !0 && !!Y.attributes.uv && (et || ye),
34079
+ pointsUvs: F.isPoints === !0 && !!Y.attributes.uv && (et || Se),
34072
34080
  fog: !!q,
34073
34081
  useFog: y.fog === !0,
34074
34082
  fogExp2: !!q && q.isFogExp2,
@@ -34114,7 +34122,7 @@ function qE(i, e, t, n, s, r, a) {
34114
34122
  };
34115
34123
  return yt.vertexUv1s = l.has(1), yt.vertexUv2s = l.has(2), yt.vertexUv3s = l.has(3), l.clear(), yt;
34116
34124
  }
34117
- function f(y) {
34125
+ function p(y) {
34118
34126
  const T = [];
34119
34127
  if (y.shaderID ? T.push(y.shaderID) : (T.push(y.customVertexShaderID), T.push(y.customFragmentShaderID)), y.defines !== void 0)
34120
34128
  for (const R in y.defines)
@@ -34155,7 +34163,7 @@ function qE(i, e, t, n, s, r, a) {
34155
34163
  }
34156
34164
  return {
34157
34165
  getParameters: m,
34158
- getProgramCacheKey: f,
34166
+ getProgramCacheKey: p,
34159
34167
  getUniforms: _,
34160
34168
  acquireProgram: S,
34161
34169
  releaseProgram: M,
@@ -34204,35 +34212,35 @@ function Qh() {
34204
34212
  function r() {
34205
34213
  e = 0, t.length = 0, n.length = 0, s.length = 0;
34206
34214
  }
34207
- function a(u, h, p, g, v, m) {
34208
- let f = i[e];
34209
- return f === void 0 ? (f = {
34215
+ function a(u, h, f, g, v, m) {
34216
+ let p = i[e];
34217
+ return p === void 0 ? (p = {
34210
34218
  id: u.id,
34211
34219
  object: u,
34212
34220
  geometry: h,
34213
- material: p,
34221
+ material: f,
34214
34222
  groupOrder: g,
34215
34223
  renderOrder: u.renderOrder,
34216
34224
  z: v,
34217
34225
  group: m
34218
- }, i[e] = f) : (f.id = u.id, f.object = u, f.geometry = h, f.material = p, f.groupOrder = g, f.renderOrder = u.renderOrder, f.z = v, f.group = m), e++, f;
34226
+ }, i[e] = p) : (p.id = u.id, p.object = u, p.geometry = h, p.material = f, p.groupOrder = g, p.renderOrder = u.renderOrder, p.z = v, p.group = m), e++, p;
34219
34227
  }
34220
- function o(u, h, p, g, v, m) {
34221
- const f = a(u, h, p, g, v, m);
34222
- p.transmission > 0 ? n.push(f) : p.transparent === !0 ? s.push(f) : t.push(f);
34228
+ function o(u, h, f, g, v, m) {
34229
+ const p = a(u, h, f, g, v, m);
34230
+ f.transmission > 0 ? n.push(p) : f.transparent === !0 ? s.push(p) : t.push(p);
34223
34231
  }
34224
- function c(u, h, p, g, v, m) {
34225
- const f = a(u, h, p, g, v, m);
34226
- p.transmission > 0 ? n.unshift(f) : p.transparent === !0 ? s.unshift(f) : t.unshift(f);
34232
+ function c(u, h, f, g, v, m) {
34233
+ const p = a(u, h, f, g, v, m);
34234
+ f.transmission > 0 ? n.unshift(p) : f.transparent === !0 ? s.unshift(p) : t.unshift(p);
34227
34235
  }
34228
34236
  function l(u, h) {
34229
34237
  t.length > 1 && t.sort(u || XE), n.length > 1 && n.sort(h || Zh), s.length > 1 && s.sort(h || Zh);
34230
34238
  }
34231
34239
  function d() {
34232
34240
  for (let u = e, h = i.length; u < h; u++) {
34233
- const p = i[u];
34234
- if (p.id === null) break;
34235
- p.id = null, p.object = null, p.geometry = null, p.material = null, p.group = null;
34241
+ const f = i[u];
34242
+ if (f.id === null) break;
34243
+ f.id = null, f.object = null, f.geometry = null, f.material = null, f.group = null;
34236
34244
  }
34237
34245
  }
34238
34246
  return {
@@ -34402,7 +34410,7 @@ function QE(i) {
34402
34410
  function o(l) {
34403
34411
  let d = 0, u = 0, h = 0;
34404
34412
  for (let y = 0; y < 9; y++) n.probe[y].set(0, 0, 0);
34405
- let p = 0, g = 0, v = 0, m = 0, f = 0, x = 0, E = 0, _ = 0, S = 0, M = 0, A = 0;
34413
+ let f = 0, g = 0, v = 0, m = 0, p = 0, x = 0, E = 0, _ = 0, S = 0, M = 0, A = 0;
34406
34414
  l.sort(ZE);
34407
34415
  for (let y = 0, T = l.length; y < T; y++) {
34408
34416
  const R = l[y], U = R.color, F = R.intensity, q = R.distance;
@@ -34417,9 +34425,9 @@ function QE(i) {
34417
34425
  const H = e.get(R);
34418
34426
  if (H.color.copy(R.color).multiplyScalar(R.intensity), R.castShadow) {
34419
34427
  const W = R.shadow, ee = t.get(R);
34420
- ee.shadowIntensity = W.intensity, ee.shadowBias = W.bias, ee.shadowNormalBias = W.normalBias, ee.shadowRadius = W.radius, ee.shadowMapSize = W.mapSize, n.directionalShadow[p] = ee, n.directionalShadowMap[p] = Y, n.directionalShadowMatrix[p] = R.shadow.matrix, x++;
34428
+ ee.shadowIntensity = W.intensity, ee.shadowBias = W.bias, ee.shadowNormalBias = W.normalBias, ee.shadowRadius = W.radius, ee.shadowMapSize = W.mapSize, n.directionalShadow[f] = ee, n.directionalShadowMap[f] = Y, n.directionalShadowMatrix[f] = R.shadow.matrix, x++;
34421
34429
  }
34422
- n.directional[p] = H, p++;
34430
+ n.directional[f] = H, f++;
34423
34431
  } else if (R.isSpotLight) {
34424
34432
  const H = e.get(R);
34425
34433
  H.position.setFromMatrixPosition(R.matrixWorld), H.color.copy(U).multiplyScalar(F), H.distance = q, H.coneCos = Math.cos(R.angle), H.penumbraCos = Math.cos(R.angle * (1 - R.penumbra)), H.decay = R.decay, n.spot[v] = H;
@@ -34441,24 +34449,24 @@ function QE(i) {
34441
34449
  n.point[g] = H, g++;
34442
34450
  } else if (R.isHemisphereLight) {
34443
34451
  const H = e.get(R);
34444
- H.skyColor.copy(R.color).multiplyScalar(F), H.groundColor.copy(R.groundColor).multiplyScalar(F), n.hemi[f] = H, f++;
34452
+ H.skyColor.copy(R.color).multiplyScalar(F), H.groundColor.copy(R.groundColor).multiplyScalar(F), n.hemi[p] = H, p++;
34445
34453
  }
34446
34454
  }
34447
34455
  m > 0 && (i.has("OES_texture_float_linear") === !0 ? (n.rectAreaLTC1 = me.LTC_FLOAT_1, n.rectAreaLTC2 = me.LTC_FLOAT_2) : (n.rectAreaLTC1 = me.LTC_HALF_1, n.rectAreaLTC2 = me.LTC_HALF_2)), n.ambient[0] = d, n.ambient[1] = u, n.ambient[2] = h;
34448
34456
  const k = n.hash;
34449
- (k.directionalLength !== p || k.pointLength !== g || k.spotLength !== v || k.rectAreaLength !== m || k.hemiLength !== f || k.numDirectionalShadows !== x || k.numPointShadows !== E || k.numSpotShadows !== _ || k.numSpotMaps !== S || k.numLightProbes !== A) && (n.directional.length = p, n.spot.length = v, n.rectArea.length = m, n.point.length = g, n.hemi.length = f, n.directionalShadow.length = x, n.directionalShadowMap.length = x, n.pointShadow.length = E, n.pointShadowMap.length = E, n.spotShadow.length = _, n.spotShadowMap.length = _, n.directionalShadowMatrix.length = x, n.pointShadowMatrix.length = E, n.spotLightMatrix.length = _ + S - M, n.spotLightMap.length = S, n.numSpotLightShadowsWithMaps = M, n.numLightProbes = A, k.directionalLength = p, k.pointLength = g, k.spotLength = v, k.rectAreaLength = m, k.hemiLength = f, k.numDirectionalShadows = x, k.numPointShadows = E, k.numSpotShadows = _, k.numSpotMaps = S, k.numLightProbes = A, n.version = JE++);
34457
+ (k.directionalLength !== f || k.pointLength !== g || k.spotLength !== v || k.rectAreaLength !== m || k.hemiLength !== p || k.numDirectionalShadows !== x || k.numPointShadows !== E || k.numSpotShadows !== _ || k.numSpotMaps !== S || k.numLightProbes !== A) && (n.directional.length = f, n.spot.length = v, n.rectArea.length = m, n.point.length = g, n.hemi.length = p, n.directionalShadow.length = x, n.directionalShadowMap.length = x, n.pointShadow.length = E, n.pointShadowMap.length = E, n.spotShadow.length = _, n.spotShadowMap.length = _, n.directionalShadowMatrix.length = x, n.pointShadowMatrix.length = E, n.spotLightMatrix.length = _ + S - M, n.spotLightMap.length = S, n.numSpotLightShadowsWithMaps = M, n.numLightProbes = A, k.directionalLength = f, k.pointLength = g, k.spotLength = v, k.rectAreaLength = m, k.hemiLength = p, k.numDirectionalShadows = x, k.numPointShadows = E, k.numSpotShadows = _, k.numSpotMaps = S, k.numLightProbes = A, n.version = JE++);
34450
34458
  }
34451
34459
  function c(l, d) {
34452
- let u = 0, h = 0, p = 0, g = 0, v = 0;
34460
+ let u = 0, h = 0, f = 0, g = 0, v = 0;
34453
34461
  const m = d.matrixWorldInverse;
34454
- for (let f = 0, x = l.length; f < x; f++) {
34455
- const E = l[f];
34462
+ for (let p = 0, x = l.length; p < x; p++) {
34463
+ const E = l[p];
34456
34464
  if (E.isDirectionalLight) {
34457
34465
  const _ = n.directional[u];
34458
34466
  _.direction.setFromMatrixPosition(E.matrixWorld), s.setFromMatrixPosition(E.target.matrixWorld), _.direction.sub(s), _.direction.transformDirection(m), u++;
34459
34467
  } else if (E.isSpotLight) {
34460
- const _ = n.spot[p];
34461
- _.position.setFromMatrixPosition(E.matrixWorld), _.position.applyMatrix4(m), _.direction.setFromMatrixPosition(E.matrixWorld), s.setFromMatrixPosition(E.target.matrixWorld), _.direction.sub(s), _.direction.transformDirection(m), p++;
34468
+ const _ = n.spot[f];
34469
+ _.position.setFromMatrixPosition(E.matrixWorld), _.position.applyMatrix4(m), _.direction.setFromMatrixPosition(E.matrixWorld), s.setFromMatrixPosition(E.target.matrixWorld), _.direction.sub(s), _.direction.transformDirection(m), f++;
34462
34470
  } else if (E.isRectAreaLight) {
34463
34471
  const _ = n.rectArea[g];
34464
34472
  _.position.setFromMatrixPosition(E.matrixWorld), _.position.applyMatrix4(m), a.identity(), r.copy(E.matrixWorld), r.premultiply(m), a.extractRotation(r), _.halfWidth.set(E.width * 0.5, 0, 0), _.halfHeight.set(0, E.height * 0.5, 0), _.halfWidth.applyMatrix4(a), _.halfHeight.applyMatrix4(a), g++;
@@ -34580,8 +34588,8 @@ function rC(i, e, t) {
34580
34588
  },
34581
34589
  vertexShader: tC,
34582
34590
  fragmentShader: nC
34583
- }), p = h.clone();
34584
- p.defines.HORIZONTAL_PASS = 1;
34591
+ }), f = h.clone();
34592
+ f.defines.HORIZONTAL_PASS = 1;
34585
34593
  const g = new Gn();
34586
34594
  g.setAttribute(
34587
34595
  "position",
@@ -34592,13 +34600,13 @@ function rC(i, e, t) {
34592
34600
  );
34593
34601
  const v = new zn(g, h), m = this;
34594
34602
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = Fa;
34595
- let f = this.type;
34603
+ let p = this.type;
34596
34604
  this.render = function(M, A, k) {
34597
34605
  if (m.enabled === !1 || m.autoUpdate === !1 && m.needsUpdate === !1 || M.length === 0) return;
34598
34606
  M.type === lb && (Oe("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), M.type = Fa);
34599
34607
  const y = i.getRenderTarget(), T = i.getActiveCubeFace(), R = i.getActiveMipmapLevel(), U = i.state;
34600
34608
  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);
34601
- const F = f !== this.type;
34609
+ const F = p !== this.type;
34602
34610
  F && A.traverse(function(q) {
34603
34611
  q.material && (Array.isArray(q.material) ? q.material.forEach((Y) => Y.needsUpdate = !0) : q.material.needsUpdate = !0);
34604
34612
  });
@@ -34654,14 +34662,14 @@ function rC(i, e, t) {
34654
34662
  }
34655
34663
  W.isPointLightShadow !== !0 && this.type === wr && x(W, k), W.needsUpdate = !1;
34656
34664
  }
34657
- f = this.type, m.needsUpdate = !1, i.setRenderTarget(y, T, R);
34665
+ p = this.type, m.needsUpdate = !1, i.setRenderTarget(y, T, R);
34658
34666
  };
34659
34667
  function x(M, A) {
34660
34668
  const k = e.update(v);
34661
- h.defines.VSM_SAMPLES !== M.blurSamples && (h.defines.VSM_SAMPLES = M.blurSamples, p.defines.VSM_SAMPLES = M.blurSamples, h.needsUpdate = !0, p.needsUpdate = !0), M.mapPass === null && (M.mapPass = new ei(s.x, s.y, {
34669
+ 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, {
34662
34670
  format: sr,
34663
34671
  type: Mi
34664
- })), 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), p.uniforms.shadow_pass.value = M.mapPass.texture, p.uniforms.resolution.value = M.mapSize, p.uniforms.radius.value = M.radius, i.setRenderTarget(M.map), i.clear(), i.renderBufferDirect(A, null, k, p, v, null);
34672
+ })), 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);
34665
34673
  }
34666
34674
  function E(M, A, k, y) {
34667
34675
  let T = null;
@@ -34727,7 +34735,7 @@ function oC(i, e) {
34727
34735
  let D = !1;
34728
34736
  const be = new Lt();
34729
34737
  let ae = null;
34730
- const ye = new Lt(0, 0, 0, 0);
34738
+ const Se = new Lt(0, 0, 0, 0);
34731
34739
  return {
34732
34740
  setMask: function(ie) {
34733
34741
  ae !== ie && !D && (i.colorMask(ie, ie, ie, ie), ae = ie);
@@ -34736,15 +34744,15 @@ function oC(i, e) {
34736
34744
  D = ie;
34737
34745
  },
34738
34746
  setClear: function(ie, K, de, Ue, yt) {
34739
- yt === !0 && (ie *= Ue, K *= Ue, de *= Ue), be.set(ie, K, de, Ue), ye.equals(be) === !1 && (i.clearColor(ie, K, de, Ue), ye.copy(be));
34747
+ yt === !0 && (ie *= Ue, K *= Ue, de *= Ue), be.set(ie, K, de, Ue), Se.equals(be) === !1 && (i.clearColor(ie, K, de, Ue), Se.copy(be));
34740
34748
  },
34741
34749
  reset: function() {
34742
- D = !1, ae = null, ye.set(-1, 0, 0, 0);
34750
+ D = !1, ae = null, Se.set(-1, 0, 0, 0);
34743
34751
  }
34744
34752
  };
34745
34753
  }
34746
34754
  function n() {
34747
- let D = !1, be = !1, ae = null, ye = null, ie = null;
34755
+ let D = !1, be = !1, ae = null, Se = null, ie = null;
34748
34756
  return {
34749
34757
  setReversed: function(K) {
34750
34758
  if (be !== K) {
@@ -34764,7 +34772,7 @@ function oC(i, e) {
34764
34772
  ae !== K && !D && (i.depthMask(K), ae = K);
34765
34773
  },
34766
34774
  setFunc: function(K) {
34767
- if (be && (K = aC[K]), ye !== K) {
34775
+ if (be && (K = aC[K]), Se !== K) {
34768
34776
  switch (K) {
34769
34777
  case rl:
34770
34778
  i.depthFunc(i.NEVER);
@@ -34793,7 +34801,7 @@ function oC(i, e) {
34793
34801
  default:
34794
34802
  i.depthFunc(i.LEQUAL);
34795
34803
  }
34796
- ye = K;
34804
+ Se = K;
34797
34805
  }
34798
34806
  },
34799
34807
  setLocked: function(K) {
@@ -34803,12 +34811,12 @@ function oC(i, e) {
34803
34811
  ie !== K && (be && (K = 1 - K), i.clearDepth(K), ie = K);
34804
34812
  },
34805
34813
  reset: function() {
34806
- D = !1, ae = null, ye = null, ie = null, be = !1;
34814
+ D = !1, ae = null, Se = null, ie = null, be = !1;
34807
34815
  }
34808
34816
  };
34809
34817
  }
34810
34818
  function s() {
34811
- let D = !1, be = null, ae = null, ye = null, ie = null, K = null, de = null, Ue = null, yt = null;
34819
+ let D = !1, be = null, ae = null, Se = null, ie = null, K = null, de = null, Ue = null, yt = null;
34812
34820
  return {
34813
34821
  setTest: function(ot) {
34814
34822
  D || (ot ? te(i.STENCIL_TEST) : Te(i.STENCIL_TEST));
@@ -34817,7 +34825,7 @@ function oC(i, e) {
34817
34825
  be !== ot && !D && (i.stencilMask(ot), be = ot);
34818
34826
  },
34819
34827
  setFunc: function(ot, Hn, ai) {
34820
- (ae !== ot || ye !== Hn || ie !== ai) && (i.stencilFunc(ot, Hn, ai), ae = ot, ye = Hn, ie = ai);
34828
+ (ae !== ot || Se !== Hn || ie !== ai) && (i.stencilFunc(ot, Hn, ai), ae = ot, Se = Hn, ie = ai);
34821
34829
  },
34822
34830
  setOp: function(ot, Hn, ai) {
34823
34831
  (K !== ot || de !== Hn || Ue !== ai) && (i.stencilOp(ot, Hn, ai), K = ot, de = Hn, Ue = ai);
@@ -34829,23 +34837,23 @@ function oC(i, e) {
34829
34837
  yt !== ot && (i.clearStencil(ot), yt = ot);
34830
34838
  },
34831
34839
  reset: function() {
34832
- D = !1, be = null, ae = null, ye = null, ie = null, K = null, de = null, Ue = null, yt = null;
34840
+ D = !1, be = null, ae = null, Se = null, ie = null, K = null, de = null, Ue = null, yt = null;
34833
34841
  }
34834
34842
  };
34835
34843
  }
34836
34844
  const r = new t(), a = new n(), o = new s(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
34837
- let d = {}, u = {}, h = /* @__PURE__ */ new WeakMap(), p = [], g = null, v = !1, m = null, f = null, x = null, E = null, _ = null, S = null, M = null, A = new Je(0, 0, 0), k = 0, y = !1, T = null, R = null, U = null, F = null, q = null;
34845
+ let d = {}, u = {}, h = /* @__PURE__ */ new WeakMap(), f = [], g = null, v = !1, m = null, p = null, x = null, E = null, _ = null, S = null, M = null, A = new Je(0, 0, 0), k = 0, y = !1, T = null, R = null, U = null, F = null, q = null;
34838
34846
  const Y = i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
34839
34847
  let H = !1, W = 0;
34840
34848
  const ee = i.getParameter(i.VERSION);
34841
34849
  ee.indexOf("WebGL") !== -1 ? (W = parseFloat(/^WebGL (\d)/.exec(ee)[1]), H = W >= 1) : ee.indexOf("OpenGL ES") !== -1 && (W = parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]), H = W >= 2);
34842
34850
  let ge = null, le = {};
34843
- const _e = i.getParameter(i.SCISSOR_BOX), Be = i.getParameter(i.VIEWPORT), Fe = new Lt().fromArray(_e), xt = new Lt().fromArray(Be);
34844
- function dt(D, be, ae, ye) {
34851
+ const _e = i.getParameter(i.SCISSOR_BOX), Be = i.getParameter(i.VIEWPORT), Fe = new Lt().fromArray(_e), Ct = new Lt().fromArray(Be);
34852
+ function dt(D, be, ae, Se) {
34845
34853
  const ie = new Uint8Array(4), K = i.createTexture();
34846
34854
  i.bindTexture(D, K), i.texParameteri(D, i.TEXTURE_MIN_FILTER, i.NEAREST), i.texParameteri(D, i.TEXTURE_MAG_FILTER, i.NEAREST);
34847
34855
  for (let de = 0; de < ae; de++)
34848
- D === i.TEXTURE_3D || D === i.TEXTURE_2D_ARRAY ? i.texImage3D(be, 0, i.RGBA, 1, 1, ye, 0, i.RGBA, i.UNSIGNED_BYTE, ie) : i.texImage2D(be + de, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, ie);
34856
+ D === i.TEXTURE_3D || D === i.TEXTURE_2D_ARRAY ? i.texImage3D(be, 0, i.RGBA, 1, 1, Se, 0, i.RGBA, i.UNSIGNED_BYTE, ie) : i.texImage2D(be + de, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, ie);
34849
34857
  return K;
34850
34858
  }
34851
34859
  const $ = {};
@@ -34860,18 +34868,18 @@ function oC(i, e) {
34860
34868
  return u[D] !== be ? (i.bindFramebuffer(D, be), u[D] = be, D === i.DRAW_FRAMEBUFFER && (u[i.FRAMEBUFFER] = be), D === i.FRAMEBUFFER && (u[i.DRAW_FRAMEBUFFER] = be), !0) : !1;
34861
34869
  }
34862
34870
  function Me(D, be) {
34863
- let ae = p, ye = !1;
34871
+ let ae = f, Se = !1;
34864
34872
  if (D) {
34865
34873
  ae = h.get(be), ae === void 0 && (ae = [], h.set(be, ae));
34866
34874
  const ie = D.textures;
34867
34875
  if (ae.length !== ie.length || ae[0] !== i.COLOR_ATTACHMENT0) {
34868
34876
  for (let K = 0, de = ie.length; K < de; K++)
34869
34877
  ae[K] = i.COLOR_ATTACHMENT0 + K;
34870
- ae.length = ie.length, ye = !0;
34878
+ ae.length = ie.length, Se = !0;
34871
34879
  }
34872
34880
  } else
34873
- ae[0] !== i.BACK && (ae[0] = i.BACK, ye = !0);
34874
- ye && i.drawBuffers(ae);
34881
+ ae[0] !== i.BACK && (ae[0] = i.BACK, Se = !0);
34882
+ Se && i.drawBuffers(ae);
34875
34883
  }
34876
34884
  function et(D) {
34877
34885
  return g !== D ? (i.useProgram(D), g = D, !0) : !1;
@@ -34899,14 +34907,14 @@ function oC(i, e) {
34899
34907
  [Mb]: i.CONSTANT_ALPHA,
34900
34908
  [wb]: i.ONE_MINUS_CONSTANT_ALPHA
34901
34909
  };
34902
- function at(D, be, ae, ye, ie, K, de, Ue, yt, ot) {
34910
+ function at(D, be, ae, Se, ie, K, de, Ue, yt, ot) {
34903
34911
  if (D === xi) {
34904
34912
  v === !0 && (Te(i.BLEND), v = !1);
34905
34913
  return;
34906
34914
  }
34907
34915
  if (v === !1 && (te(i.BLEND), v = !0), D !== db) {
34908
34916
  if (D !== m || ot !== y) {
34909
- if ((f !== ls || _ !== ls) && (i.blendEquation(i.FUNC_ADD), f = ls, _ = ls), ot)
34917
+ if ((p !== ls || _ !== ls) && (i.blendEquation(i.FUNC_ADD), p = ls, _ = ls), ot)
34910
34918
  switch (D) {
34911
34919
  case Ks:
34912
34920
  i.blendFuncSeparate(i.ONE, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);
@@ -34946,14 +34954,14 @@ function oC(i, e) {
34946
34954
  }
34947
34955
  return;
34948
34956
  }
34949
- ie = ie || be, K = K || ae, de = de || ye, (be !== f || ie !== _) && (i.blendEquationSeparate(Wt[be], Wt[ie]), f = be, _ = ie), (ae !== x || ye !== E || K !== S || de !== M) && (i.blendFuncSeparate(Ze[ae], Ze[ye], Ze[K], Ze[de]), x = ae, E = ye, S = K, M = de), (Ue.equals(A) === !1 || yt !== k) && (i.blendColor(Ue.r, Ue.g, Ue.b, yt), A.copy(Ue), k = yt), m = D, y = !1;
34957
+ ie = ie || be, K = K || ae, de = de || Se, (be !== p || ie !== _) && (i.blendEquationSeparate(Wt[be], Wt[ie]), p = be, _ = ie), (ae !== x || Se !== E || K !== S || de !== M) && (i.blendFuncSeparate(Ze[ae], Ze[Se], Ze[K], Ze[de]), x = ae, E = Se, S = K, M = de), (Ue.equals(A) === !1 || yt !== k) && (i.blendColor(Ue.r, Ue.g, Ue.b, yt), A.copy(Ue), k = yt), m = D, y = !1;
34950
34958
  }
34951
- function ft(D, be) {
34959
+ function gt(D, be) {
34952
34960
  D.side === yi ? Te(i.CULL_FACE) : te(i.CULL_FACE);
34953
34961
  let ae = D.side === nn;
34954
34962
  be && (ae = !ae), He(ae), D.blending === Ks && 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);
34955
- const ye = D.stencilWrite;
34956
- o.setTest(ye), ye && (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 ? te(i.SAMPLE_ALPHA_TO_COVERAGE) : Te(i.SAMPLE_ALPHA_TO_COVERAGE);
34963
+ const Se = D.stencilWrite;
34964
+ 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 ? te(i.SAMPLE_ALPHA_TO_COVERAGE) : Te(i.SAMPLE_ALPHA_TO_COVERAGE);
34957
34965
  }
34958
34966
  function He(D) {
34959
34967
  T !== D && (D ? i.frontFace(i.CW) : i.frontFace(i.CCW), T = D);
@@ -34975,8 +34983,8 @@ function oC(i, e) {
34975
34983
  }
34976
34984
  function Ae(D, be, ae) {
34977
34985
  ae === void 0 && (ge === null ? ae = i.TEXTURE0 + Y - 1 : ae = ge);
34978
- let ye = le[ae];
34979
- ye === void 0 && (ye = { type: void 0, texture: void 0 }, le[ae] = ye), (ye.type !== D || ye.texture !== be) && (ge !== ae && (i.activeTexture(ae), ge = ae), i.bindTexture(D, be || $[D]), ye.type = D, ye.texture = be);
34986
+ let Se = le[ae];
34987
+ Se === void 0 && (Se = { type: void 0, texture: void 0 }, le[ae] = Se), (Se.type !== D || Se.texture !== be) && (ge !== ae && (i.activeTexture(ae), ge = ae), i.bindTexture(D, be || $[D]), Se.type = D, Se.texture = be);
34980
34988
  }
34981
34989
  function w() {
34982
34990
  const D = le[ge];
@@ -35056,20 +35064,20 @@ function oC(i, e) {
35056
35064
  Fe.equals(D) === !1 && (i.scissor(D.x, D.y, D.z, D.w), Fe.copy(D));
35057
35065
  }
35058
35066
  function Ce(D) {
35059
- xt.equals(D) === !1 && (i.viewport(D.x, D.y, D.z, D.w), xt.copy(D));
35067
+ Ct.equals(D) === !1 && (i.viewport(D.x, D.y, D.z, D.w), Ct.copy(D));
35060
35068
  }
35061
35069
  function Re(D, be) {
35062
35070
  let ae = l.get(be);
35063
35071
  ae === void 0 && (ae = /* @__PURE__ */ new WeakMap(), l.set(be, ae));
35064
- let ye = ae.get(D);
35065
- ye === void 0 && (ye = i.getUniformBlockIndex(be, D.name), ae.set(D, ye));
35072
+ let Se = ae.get(D);
35073
+ Se === void 0 && (Se = i.getUniformBlockIndex(be, D.name), ae.set(D, Se));
35066
35074
  }
35067
35075
  function he(D, be) {
35068
- const ye = l.get(be).get(D);
35069
- c.get(be) !== ye && (i.uniformBlockBinding(be, ye, D.__bindingPointIndex), c.set(be, ye));
35076
+ const Se = l.get(be).get(D);
35077
+ c.get(be) !== Se && (i.uniformBlockBinding(be, Se, D.__bindingPointIndex), c.set(be, Se));
35070
35078
  }
35071
35079
  function We() {
35072
- i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), a.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), d = {}, ge = null, le = {}, u = {}, h = /* @__PURE__ */ new WeakMap(), p = [], g = null, v = !1, m = null, f = null, x = null, E = null, _ = null, S = null, M = null, A = new Je(0, 0, 0), k = 0, y = !1, T = null, R = null, U = null, F = null, q = null, Fe.set(0, 0, i.canvas.width, i.canvas.height), xt.set(0, 0, i.canvas.width, i.canvas.height), r.reset(), a.reset(), o.reset();
35080
+ i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), a.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), d = {}, ge = null, le = {}, u = {}, h = /* @__PURE__ */ new WeakMap(), f = [], g = null, v = !1, m = null, p = null, x = null, E = null, _ = null, S = null, M = null, A = new Je(0, 0, 0), k = 0, y = !1, T = null, R = null, U = null, F = null, q = null, Fe.set(0, 0, i.canvas.width, i.canvas.height), Ct.set(0, 0, i.canvas.width, i.canvas.height), r.reset(), a.reset(), o.reset();
35073
35081
  }
35074
35082
  return {
35075
35083
  buffers: {
@@ -35083,7 +35091,7 @@ function oC(i, e) {
35083
35091
  drawBuffers: Me,
35084
35092
  useProgram: et,
35085
35093
  setBlending: at,
35086
- setMaterial: ft,
35094
+ setMaterial: gt,
35087
35095
  setFlipSided: He,
35088
35096
  setCullFace: Nt,
35089
35097
  setLineWidth: I,
@@ -35113,13 +35121,13 @@ function cC(i, e, t, n, s, r, a) {
35113
35121
  const o = e.has("WEBGL_multisampled_render_to_texture") ? e.get("WEBGL_multisampled_render_to_texture") : null, c = typeof navigator > "u" ? !1 : /OculusBrowser/g.test(navigator.userAgent), l = new st(), d = /* @__PURE__ */ new WeakMap();
35114
35122
  let u;
35115
35123
  const h = /* @__PURE__ */ new WeakMap();
35116
- let p = !1;
35124
+ let f = !1;
35117
35125
  try {
35118
- p = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
35126
+ f = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
35119
35127
  } catch {
35120
35128
  }
35121
35129
  function g(w, b) {
35122
- return p ? new OffscreenCanvas(w, b) : io("canvas");
35130
+ return f ? new OffscreenCanvas(w, b) : io("canvas");
35123
35131
  }
35124
35132
  function v(w, b, L) {
35125
35133
  let X = 1;
@@ -35137,7 +35145,7 @@ function cC(i, e, t, n, s, r, a) {
35137
35145
  function m(w) {
35138
35146
  return w.generateMipmaps;
35139
35147
  }
35140
- function f(w) {
35148
+ function p(w) {
35141
35149
  i.generateMipmap(w);
35142
35150
  }
35143
35151
  function x(w) {
@@ -35311,7 +35319,7 @@ function cC(i, e, t, n, s, r, a) {
35311
35319
  }
35312
35320
  return L;
35313
35321
  }
35314
- function xt(w, b, L) {
35322
+ function Ct(w, b, L) {
35315
35323
  return Math.floor(Math.floor(w / L) / b);
35316
35324
  }
35317
35325
  function dt(w, b, L, X) {
@@ -35322,8 +35330,8 @@ function cC(i, e, t, n, s, r, a) {
35322
35330
  j.sort((se, fe) => se.start - fe.start);
35323
35331
  let Pe = 0;
35324
35332
  for (let se = 1; se < j.length; se++) {
35325
- const fe = j[Pe], Ce = j[se], Re = fe.start + fe.count, he = xt(Ce.start, b.width, 4), We = xt(fe.start, b.width, 4);
35326
- Ce.start <= Re + 1 && he === We && xt(Ce.start + Ce.count - 1, b.width, 4) === he ? fe.count = Math.max(
35333
+ const fe = j[Pe], Ce = j[se], Re = fe.start + fe.count, he = Ct(Ce.start, b.width, 4), We = Ct(fe.start, b.width, 4);
35334
+ Ce.start <= Re + 1 && he === We && Ct(Ce.start + Ce.count - 1, b.width, 4) === he ? fe.count = Math.max(
35327
35335
  fe.count,
35328
35336
  Ce.start + Ce.count - fe.start
35329
35337
  ) : (++Pe, j[Pe] = Ce);
@@ -35354,20 +35362,20 @@ function cC(i, e, t, n, s, r, a) {
35354
35362
  let Re = E(b.internalFormat, fe, Ce, b.colorSpace, b.isVideoTexture);
35355
35363
  Be(X, b);
35356
35364
  let he;
35357
- const We = b.mipmaps, D = b.isVideoTexture !== !0, be = Pe.__version === void 0 || Q === !0, ae = j.dataReady, ye = S(b, se);
35365
+ const We = b.mipmaps, D = b.isVideoTexture !== !0, be = Pe.__version === void 0 || Q === !0, ae = j.dataReady, Se = S(b, se);
35358
35366
  if (b.isDepthTexture)
35359
35367
  Re = _(b.format === fs, b.type), be && (D ? t.texStorage2D(i.TEXTURE_2D, 1, Re, se.width, se.height) : t.texImage2D(i.TEXTURE_2D, 0, Re, se.width, se.height, 0, fe, Ce, null));
35360
35368
  else if (b.isDataTexture)
35361
35369
  if (We.length > 0) {
35362
- D && be && t.texStorage2D(i.TEXTURE_2D, ye, Re, We[0].width, We[0].height);
35370
+ D && be && t.texStorage2D(i.TEXTURE_2D, Se, Re, We[0].width, We[0].height);
35363
35371
  for (let ie = 0, K = We.length; ie < K; ie++)
35364
35372
  he = We[ie], D ? ae && t.texSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, Ce, he.data) : t.texImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, fe, Ce, he.data);
35365
35373
  b.generateMipmaps = !1;
35366
35374
  } else
35367
- D ? (be && t.texStorage2D(i.TEXTURE_2D, ye, Re, se.width, se.height), ae && dt(b, se, fe, Ce)) : t.texImage2D(i.TEXTURE_2D, 0, Re, se.width, se.height, 0, fe, Ce, se.data);
35375
+ D ? (be && t.texStorage2D(i.TEXTURE_2D, Se, Re, se.width, se.height), ae && dt(b, se, fe, Ce)) : t.texImage2D(i.TEXTURE_2D, 0, Re, se.width, se.height, 0, fe, Ce, se.data);
35368
35376
  else if (b.isCompressedTexture)
35369
35377
  if (b.isCompressedArrayTexture) {
35370
- D && be && t.texStorage3D(i.TEXTURE_2D_ARRAY, ye, Re, We[0].width, We[0].height, se.depth);
35378
+ D && be && t.texStorage3D(i.TEXTURE_2D_ARRAY, Se, Re, We[0].width, We[0].height, se.depth);
35371
35379
  for (let ie = 0, K = We.length; ie < K; ie++)
35372
35380
  if (he = We[ie], b.format !== Bn)
35373
35381
  if (fe !== null)
@@ -35392,13 +35400,13 @@ function cC(i, e, t, n, s, r, a) {
35392
35400
  else
35393
35401
  D ? ae && t.texSubImage3D(i.TEXTURE_2D_ARRAY, ie, 0, 0, 0, he.width, he.height, se.depth, fe, Ce, he.data) : t.texImage3D(i.TEXTURE_2D_ARRAY, ie, Re, he.width, he.height, se.depth, 0, fe, Ce, he.data);
35394
35402
  } else {
35395
- D && be && t.texStorage2D(i.TEXTURE_2D, ye, Re, We[0].width, We[0].height);
35403
+ D && be && t.texStorage2D(i.TEXTURE_2D, Se, Re, We[0].width, We[0].height);
35396
35404
  for (let ie = 0, K = We.length; ie < K; ie++)
35397
35405
  he = We[ie], b.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, Ce, he.data) : t.texImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, fe, Ce, he.data);
35398
35406
  }
35399
35407
  else if (b.isDataArrayTexture)
35400
35408
  if (D) {
35401
- if (be && t.texStorage3D(i.TEXTURE_2D_ARRAY, ye, Re, se.width, se.height, se.depth), ae)
35409
+ if (be && t.texStorage3D(i.TEXTURE_2D_ARRAY, Se, Re, se.width, se.height, se.depth), ae)
35402
35410
  if (b.layerUpdates.size > 0) {
35403
35411
  const ie = Ih(se.width, se.height, b.format, b.type);
35404
35412
  for (const K of b.layerUpdates) {
@@ -35414,20 +35422,20 @@ function cC(i, e, t, n, s, r, a) {
35414
35422
  } else
35415
35423
  t.texImage3D(i.TEXTURE_2D_ARRAY, 0, Re, se.width, se.height, se.depth, 0, fe, Ce, se.data);
35416
35424
  else if (b.isData3DTexture)
35417
- D ? (be && t.texStorage3D(i.TEXTURE_3D, ye, Re, se.width, se.height, se.depth), ae && t.texSubImage3D(i.TEXTURE_3D, 0, 0, 0, 0, se.width, se.height, se.depth, fe, Ce, se.data)) : t.texImage3D(i.TEXTURE_3D, 0, Re, se.width, se.height, se.depth, 0, fe, Ce, se.data);
35425
+ D ? (be && t.texStorage3D(i.TEXTURE_3D, Se, Re, se.width, se.height, se.depth), ae && t.texSubImage3D(i.TEXTURE_3D, 0, 0, 0, 0, se.width, se.height, se.depth, fe, Ce, se.data)) : t.texImage3D(i.TEXTURE_3D, 0, Re, se.width, se.height, se.depth, 0, fe, Ce, se.data);
35418
35426
  else if (b.isFramebufferTexture) {
35419
35427
  if (be)
35420
35428
  if (D)
35421
- t.texStorage2D(i.TEXTURE_2D, ye, Re, se.width, se.height);
35429
+ t.texStorage2D(i.TEXTURE_2D, Se, Re, se.width, se.height);
35422
35430
  else {
35423
35431
  let ie = se.width, K = se.height;
35424
- for (let de = 0; de < ye; de++)
35432
+ for (let de = 0; de < Se; de++)
35425
35433
  t.texImage2D(i.TEXTURE_2D, de, Re, ie, K, 0, fe, Ce, null), ie >>= 1, K >>= 1;
35426
35434
  }
35427
35435
  } else if (We.length > 0) {
35428
35436
  if (D && be) {
35429
35437
  const ie = Ae(We[0]);
35430
- t.texStorage2D(i.TEXTURE_2D, ye, Re, ie.width, ie.height);
35438
+ t.texStorage2D(i.TEXTURE_2D, Se, Re, ie.width, ie.height);
35431
35439
  }
35432
35440
  for (let ie = 0, K = We.length; ie < K; ie++)
35433
35441
  he = We[ie], D ? ae && t.texSubImage2D(i.TEXTURE_2D, ie, 0, 0, fe, Ce, he) : t.texImage2D(i.TEXTURE_2D, ie, Re, fe, Ce, he);
@@ -35435,12 +35443,12 @@ function cC(i, e, t, n, s, r, a) {
35435
35443
  } else if (D) {
35436
35444
  if (be) {
35437
35445
  const ie = Ae(se);
35438
- t.texStorage2D(i.TEXTURE_2D, ye, Re, ie.width, ie.height);
35446
+ t.texStorage2D(i.TEXTURE_2D, Se, Re, ie.width, ie.height);
35439
35447
  }
35440
35448
  ae && t.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, fe, Ce, se);
35441
35449
  } else
35442
35450
  t.texImage2D(i.TEXTURE_2D, 0, Re, fe, Ce, se);
35443
- m(b) && f(X), Pe.__version = j.version, b.onUpdate && b.onUpdate(b);
35451
+ m(b) && p(X), Pe.__version = j.version, b.onUpdate && b.onUpdate(b);
35444
35452
  }
35445
35453
  w.__version = b.version;
35446
35454
  }
@@ -35457,11 +35465,11 @@ function cC(i, e, t, n, s, r, a) {
35457
35465
  for (let K = 0; K < 6; K++)
35458
35466
  !Ne && !se ? fe[K] = v(b.image[K], !0, s.maxCubemapSize) : fe[K] = se ? b.image[K].image : b.image[K], fe[K] = bt(b, fe[K]);
35459
35467
  const Ce = fe[0], Re = r.convert(b.format, b.colorSpace), he = r.convert(b.type), We = E(b.internalFormat, Re, he, b.colorSpace), D = b.isVideoTexture !== !0, be = j.__version === void 0 || X === !0, ae = Q.dataReady;
35460
- let ye = S(b, Ce);
35468
+ let Se = S(b, Ce);
35461
35469
  Be(i.TEXTURE_CUBE_MAP, b);
35462
35470
  let ie;
35463
35471
  if (Ne) {
35464
- D && be && t.texStorage2D(i.TEXTURE_CUBE_MAP, ye, We, Ce.width, Ce.height);
35472
+ D && be && t.texStorage2D(i.TEXTURE_CUBE_MAP, Se, We, Ce.width, Ce.height);
35465
35473
  for (let K = 0; K < 6; K++) {
35466
35474
  ie = fe[K].mipmaps;
35467
35475
  for (let de = 0; de < ie.length; de++) {
@@ -35471,9 +35479,9 @@ function cC(i, e, t, n, s, r, a) {
35471
35479
  }
35472
35480
  } else {
35473
35481
  if (ie = b.mipmaps, D && be) {
35474
- ie.length > 0 && ye++;
35482
+ ie.length > 0 && Se++;
35475
35483
  const K = Ae(fe[0]);
35476
- t.texStorage2D(i.TEXTURE_CUBE_MAP, ye, We, K.width, K.height);
35484
+ t.texStorage2D(i.TEXTURE_CUBE_MAP, Se, We, K.width, K.height);
35477
35485
  }
35478
35486
  for (let K = 0; K < 6; K++)
35479
35487
  if (se) {
@@ -35490,7 +35498,7 @@ function cC(i, e, t, n, s, r, a) {
35490
35498
  }
35491
35499
  }
35492
35500
  }
35493
- m(b) && f(i.TEXTURE_CUBE_MAP), j.__version = Q.version, b.onUpdate && b.onUpdate(b);
35501
+ m(b) && p(i.TEXTURE_CUBE_MAP), j.__version = Q.version, b.onUpdate && b.onUpdate(b);
35494
35502
  }
35495
35503
  w.__version = b.version;
35496
35504
  }
@@ -35627,12 +35635,12 @@ function cC(i, e, t, n, s, r, a) {
35627
35635
  Te(L.__webglFramebuffer[ue][we], w, b, i.COLOR_ATTACHMENT0, i.TEXTURE_CUBE_MAP_POSITIVE_X + ue, we);
35628
35636
  else
35629
35637
  Te(L.__webglFramebuffer[ue], w, b, i.COLOR_ATTACHMENT0, i.TEXTURE_CUBE_MAP_POSITIVE_X + ue, 0);
35630
- m(b) && f(i.TEXTURE_CUBE_MAP), t.unbindTexture();
35638
+ m(b) && p(i.TEXTURE_CUBE_MAP), t.unbindTexture();
35631
35639
  } else if (Pe) {
35632
35640
  for (let ue = 0, we = Q.length; ue < we; ue++) {
35633
35641
  const Ne = Q[ue], se = n.get(Ne);
35634
35642
  let fe = i.TEXTURE_2D;
35635
- (w.isWebGL3DRenderTarget || w.isWebGLArrayRenderTarget) && (fe = w.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), t.bindTexture(fe, se.__webglTexture), Be(fe, Ne), Te(L.__webglFramebuffer, w, Ne, i.COLOR_ATTACHMENT0 + ue, fe, 0), m(Ne) && f(fe);
35643
+ (w.isWebGL3DRenderTarget || w.isWebGLArrayRenderTarget) && (fe = w.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), t.bindTexture(fe, se.__webglTexture), Be(fe, Ne), Te(L.__webglFramebuffer, w, Ne, i.COLOR_ATTACHMENT0 + ue, fe, 0), m(Ne) && p(fe);
35636
35644
  }
35637
35645
  t.unbindTexture();
35638
35646
  } else {
@@ -35642,7 +35650,7 @@ function cC(i, e, t, n, s, r, a) {
35642
35650
  Te(L.__webglFramebuffer[we], w, b, i.COLOR_ATTACHMENT0, ue, we);
35643
35651
  else
35644
35652
  Te(L.__webglFramebuffer, w, b, i.COLOR_ATTACHMENT0, ue, 0);
35645
- m(b) && f(ue), t.unbindTexture();
35653
+ m(b) && p(ue), t.unbindTexture();
35646
35654
  }
35647
35655
  w.depthBuffer && et(w);
35648
35656
  }
@@ -35652,11 +35660,11 @@ function cC(i, e, t, n, s, r, a) {
35652
35660
  const Q = b[L];
35653
35661
  if (m(Q)) {
35654
35662
  const j = x(w), Pe = n.get(Q).__webglTexture;
35655
- t.bindTexture(j, Pe), f(j), t.unbindTexture();
35663
+ t.bindTexture(j, Pe), p(j), t.unbindTexture();
35656
35664
  }
35657
35665
  }
35658
35666
  }
35659
- const ft = [], He = [];
35667
+ const gt = [], He = [];
35660
35668
  function Nt(w) {
35661
35669
  if (w.samples > 0) {
35662
35670
  if (Ut(w) === !1) {
@@ -35675,7 +35683,7 @@ function cC(i, e, t, n, s, r, a) {
35675
35683
  const se = n.get(b[Ne]).__webglTexture;
35676
35684
  i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, se, 0);
35677
35685
  }
35678
- i.blitFramebuffer(0, 0, L, X, 0, 0, L, X, Q, i.NEAREST), c === !0 && (ft.length = 0, He.length = 0, ft.push(i.COLOR_ATTACHMENT0 + Ne), w.depthBuffer && w.resolveDepthBuffer === !1 && (ft.push(j), He.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, He)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, ft));
35686
+ 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));
35679
35687
  }
35680
35688
  if (t.bindFramebuffer(i.READ_FRAMEBUFFER, null), t.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), ue)
35681
35689
  for (let Ne = 0; Ne < b.length; Ne++) {
@@ -35899,8 +35907,8 @@ class fC extends cr {
35899
35907
  constructor(e, t) {
35900
35908
  super();
35901
35909
  const n = this;
35902
- let s = null, r = 1, a = null, o = "local-floor", c = 1, l = null, d = null, u = null, h = null, p = null, g = null;
35903
- const v = typeof XRWebGLBinding < "u", m = new hC(), f = {}, x = t.getContextAttributes();
35910
+ let s = null, r = 1, a = null, o = "local-floor", c = 1, l = null, d = null, u = null, h = null, f = null, g = null;
35911
+ const v = typeof XRWebGLBinding < "u", m = new hC(), p = {}, x = t.getContextAttributes();
35904
35912
  let E = null, _ = null;
35905
35913
  const S = [], M = [], A = new st();
35906
35914
  let k = null;
@@ -35934,9 +35942,9 @@ class fC extends cr {
35934
35942
  te !== null && (M[$] = null, S[$].disconnect(te));
35935
35943
  }
35936
35944
  F = null, q = null, m.reset();
35937
- for (const $ in f)
35938
- delete f[$];
35939
- e.setRenderTarget(E), p = null, h = null, u = null, s = null, _ = null, dt.stop(), n.isPresenting = !1, e.setPixelRatio(k), e.setSize(A.width, A.height, !1), n.dispatchEvent({ type: "sessionend" });
35945
+ for (const $ in p)
35946
+ delete p[$];
35947
+ e.setRenderTarget(E), f = null, h = null, u = null, s = null, _ = null, dt.stop(), n.isPresenting = !1, e.setPixelRatio(k), e.setSize(A.width, A.height, !1), n.dispatchEvent({ type: "sessionend" });
35940
35948
  }
35941
35949
  this.setFramebufferScaleFactor = function($) {
35942
35950
  r = $, n.isPresenting === !0 && Oe("WebXRManager: Cannot change framebuffer scale while presenting.");
@@ -35947,7 +35955,7 @@ class fC extends cr {
35947
35955
  }, this.setReferenceSpace = function($) {
35948
35956
  l = $;
35949
35957
  }, this.getBaseLayer = function() {
35950
- return h !== null ? h : p;
35958
+ return h !== null ? h : f;
35951
35959
  }, this.getBinding = function() {
35952
35960
  return u === null && v && (u = new XRWebGLBinding(s, t)), u;
35953
35961
  }, this.getFrame = function() {
@@ -35986,16 +35994,16 @@ class fC extends cr {
35986
35994
  stencil: x.stencil,
35987
35995
  framebufferScaleFactor: r
35988
35996
  };
35989
- p = new XRWebGLLayer(s, t, Te), s.updateRenderState({ baseLayer: p }), e.setPixelRatio(1), e.setSize(p.framebufferWidth, p.framebufferHeight, !1), _ = new ei(
35990
- p.framebufferWidth,
35991
- p.framebufferHeight,
35997
+ f = new XRWebGLLayer(s, t, Te), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), _ = new ei(
35998
+ f.framebufferWidth,
35999
+ f.framebufferHeight,
35992
36000
  {
35993
36001
  format: Bn,
35994
36002
  type: Mn,
35995
36003
  colorSpace: e.outputColorSpace,
35996
36004
  stencilBuffer: x.stencil,
35997
- resolveDepthBuffer: p.ignoreDepthValues === !1,
35998
- resolveStencilBuffer: p.ignoreDepthValues === !1
36005
+ resolveDepthBuffer: f.ignoreDepthValues === !1,
36006
+ resolveStencilBuffer: f.ignoreDepthValues === !1
35999
36007
  }
36000
36008
  );
36001
36009
  }
@@ -36033,11 +36041,11 @@ class fC extends cr {
36033
36041
  const ee = new B(), ge = new B();
36034
36042
  function le($, te, Te) {
36035
36043
  ee.setFromMatrixPosition(te.matrixWorld), ge.setFromMatrixPosition(Te.matrixWorld);
36036
- const Ve = ee.distanceTo(ge), Me = te.projectionMatrix.elements, et = Te.projectionMatrix.elements, Wt = Me[14] / (Me[10] - 1), Ze = Me[14] / (Me[10] + 1), at = (Me[9] + 1) / Me[5], ft = (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), bt = rt * -He;
36044
+ const Ve = ee.distanceTo(ge), Me = te.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), bt = rt * -He;
36037
36045
  if (te.matrixWorld.decompose($.position, $.quaternion, $.scale), $.translateX(bt), $.translateZ(rt), $.matrixWorld.compose($.position, $.quaternion, $.scale), $.matrixWorldInverse.copy($.matrixWorld).invert(), Me[10] === -1)
36038
36046
  $.projectionMatrix.copy(te.projectionMatrix), $.projectionMatrixInverse.copy(te.projectionMatrixInverse);
36039
36047
  else {
36040
- const Ae = Wt + rt, w = Ze + rt, b = I - bt, L = Ut + (Ve - bt), X = at * Ze / w * Ae, Q = ft * Ze / w * Ae;
36048
+ const Ae = Wt + rt, w = Ze + rt, b = I - bt, L = Ut + (Ve - bt), X = at * Ze / w * Ae, Q = gt * Ze / w * Ae;
36041
36049
  $.projectionMatrix.makePerspective(b, L, X, Q, Ae, w), $.projectionMatrixInverse.copy($.projectionMatrix).invert();
36042
36050
  }
36043
36051
  }
@@ -36063,39 +36071,39 @@ class fC extends cr {
36063
36071
  this.getCamera = function() {
36064
36072
  return U;
36065
36073
  }, this.getFoveation = function() {
36066
- if (!(h === null && p === null))
36074
+ if (!(h === null && f === null))
36067
36075
  return c;
36068
36076
  }, this.setFoveation = function($) {
36069
- c = $, h !== null && (h.fixedFoveation = $), p !== null && p.fixedFoveation !== void 0 && (p.fixedFoveation = $);
36077
+ c = $, h !== null && (h.fixedFoveation = $), f !== null && f.fixedFoveation !== void 0 && (f.fixedFoveation = $);
36070
36078
  }, this.hasDepthSensing = function() {
36071
36079
  return m.texture !== null;
36072
36080
  }, this.getDepthSensingMesh = function() {
36073
36081
  return m.getMesh(U);
36074
36082
  }, this.getCameraTexture = function($) {
36075
- return f[$];
36083
+ return p[$];
36076
36084
  };
36077
36085
  let Fe = null;
36078
- function xt($, te) {
36086
+ function Ct($, te) {
36079
36087
  if (d = te.getViewerPose(l || a), g = te, d !== null) {
36080
36088
  const Te = d.views;
36081
- p !== null && (e.setRenderTargetFramebuffer(_, p.framebuffer), e.setRenderTarget(_));
36089
+ f !== null && (e.setRenderTargetFramebuffer(_, f.framebuffer), e.setRenderTarget(_));
36082
36090
  let Ve = !1;
36083
36091
  Te.length !== U.cameras.length && (U.cameras.length = 0, Ve = !0);
36084
36092
  for (let Ze = 0; Ze < Te.length; Ze++) {
36085
36093
  const at = Te[Ze];
36086
- let ft = null;
36087
- if (p !== null)
36088
- ft = p.getViewport(at);
36094
+ let gt = null;
36095
+ if (f !== null)
36096
+ gt = f.getViewport(at);
36089
36097
  else {
36090
36098
  const Nt = u.getViewSubImage(h, at);
36091
- ft = Nt.viewport, Ze === 0 && (e.setRenderTargetTextures(
36099
+ gt = Nt.viewport, Ze === 0 && (e.setRenderTargetTextures(
36092
36100
  _,
36093
36101
  Nt.colorTexture,
36094
36102
  Nt.depthStencilTexture
36095
36103
  ), e.setRenderTarget(_));
36096
36104
  }
36097
36105
  let He = R[Ze];
36098
- He === void 0 && (He = new Cn(), 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(ft.x, ft.y, ft.width, ft.height), Ze === 0 && (U.matrix.copy(He.matrix), U.matrix.decompose(U.position, U.quaternion, U.scale)), Ve === !0 && U.cameras.push(He);
36106
+ He === void 0 && (He = new Cn(), 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);
36099
36107
  }
36100
36108
  const Me = s.enabledFeatures;
36101
36109
  if (Me && Me.includes("depth-sensing") && s.depthUsage == "gpu-optimized" && v) {
@@ -36108,10 +36116,10 @@ class fC extends cr {
36108
36116
  for (let Ze = 0; Ze < Te.length; Ze++) {
36109
36117
  const at = Te[Ze].camera;
36110
36118
  if (at) {
36111
- let ft = f[at];
36112
- ft || (ft = new Mm(), f[at] = ft);
36119
+ let gt = p[at];
36120
+ gt || (gt = new Mm(), p[at] = gt);
36113
36121
  const He = u.getCameraImage(at);
36114
- ft.sourceTexture = He;
36122
+ gt.sourceTexture = He;
36115
36123
  }
36116
36124
  }
36117
36125
  }
@@ -36123,7 +36131,7 @@ class fC extends cr {
36123
36131
  Fe && Fe($, te), te.detectedPlanes && n.dispatchEvent({ type: "planesdetected", data: te }), g = null;
36124
36132
  }
36125
36133
  const dt = new Am();
36126
- dt.setAnimationLoop(xt), this.setAnimationLoop = function($) {
36134
+ dt.setAnimationLoop(Ct), this.setAnimationLoop = function($) {
36127
36135
  Fe = $;
36128
36136
  }, this.dispose = function() {
36129
36137
  };
@@ -36131,49 +36139,49 @@ class fC extends cr {
36131
36139
  }
36132
36140
  const rs = /* @__PURE__ */ new Ai(), pC = /* @__PURE__ */ new Vt();
36133
36141
  function mC(i, e) {
36134
- function t(m, f) {
36135
- m.matrixAutoUpdate === !0 && m.updateMatrix(), f.value.copy(m.matrix);
36142
+ function t(m, p) {
36143
+ m.matrixAutoUpdate === !0 && m.updateMatrix(), p.value.copy(m.matrix);
36136
36144
  }
36137
- function n(m, f) {
36138
- f.color.getRGB(m.fogColor.value, Sm(i)), f.isFog ? (m.fogNear.value = f.near, m.fogFar.value = f.far) : f.isFogExp2 && (m.fogDensity.value = f.density);
36145
+ function n(m, p) {
36146
+ p.color.getRGB(m.fogColor.value, Sm(i)), p.isFog ? (m.fogNear.value = p.near, m.fogFar.value = p.far) : p.isFogExp2 && (m.fogDensity.value = p.density);
36139
36147
  }
36140
- function s(m, f, x, E, _) {
36141
- f.isMeshBasicMaterial || f.isMeshLambertMaterial ? r(m, f) : f.isMeshToonMaterial ? (r(m, f), u(m, f)) : f.isMeshPhongMaterial ? (r(m, f), d(m, f)) : f.isMeshStandardMaterial ? (r(m, f), h(m, f), f.isMeshPhysicalMaterial && p(m, f, _)) : f.isMeshMatcapMaterial ? (r(m, f), g(m, f)) : f.isMeshDepthMaterial ? r(m, f) : f.isMeshDistanceMaterial ? (r(m, f), v(m, f)) : f.isMeshNormalMaterial ? r(m, f) : f.isLineBasicMaterial ? (a(m, f), f.isLineDashedMaterial && o(m, f)) : f.isPointsMaterial ? c(m, f, x, E) : f.isSpriteMaterial ? l(m, f) : f.isShadowMaterial ? (m.color.value.copy(f.color), m.opacity.value = f.opacity) : f.isShaderMaterial && (f.uniformsNeedUpdate = !1);
36148
+ function s(m, p, x, E, _) {
36149
+ p.isMeshBasicMaterial || p.isMeshLambertMaterial ? r(m, p) : p.isMeshToonMaterial ? (r(m, p), u(m, p)) : p.isMeshPhongMaterial ? (r(m, p), d(m, p)) : p.isMeshStandardMaterial ? (r(m, p), h(m, p), p.isMeshPhysicalMaterial && f(m, p, _)) : p.isMeshMatcapMaterial ? (r(m, p), g(m, p)) : p.isMeshDepthMaterial ? r(m, p) : p.isMeshDistanceMaterial ? (r(m, p), v(m, p)) : p.isMeshNormalMaterial ? r(m, p) : p.isLineBasicMaterial ? (a(m, p), p.isLineDashedMaterial && o(m, p)) : p.isPointsMaterial ? c(m, p, x, E) : p.isSpriteMaterial ? l(m, p) : p.isShadowMaterial ? (m.color.value.copy(p.color), m.opacity.value = p.opacity) : p.isShaderMaterial && (p.uniformsNeedUpdate = !1);
36142
36150
  }
36143
- function r(m, f) {
36144
- m.opacity.value = f.opacity, f.color && m.diffuse.value.copy(f.color), f.emissive && m.emissive.value.copy(f.emissive).multiplyScalar(f.emissiveIntensity), f.map && (m.map.value = f.map, t(f.map, m.mapTransform)), f.alphaMap && (m.alphaMap.value = f.alphaMap, t(f.alphaMap, m.alphaMapTransform)), f.bumpMap && (m.bumpMap.value = f.bumpMap, t(f.bumpMap, m.bumpMapTransform), m.bumpScale.value = f.bumpScale, f.side === nn && (m.bumpScale.value *= -1)), f.normalMap && (m.normalMap.value = f.normalMap, t(f.normalMap, m.normalMapTransform), m.normalScale.value.copy(f.normalScale), f.side === nn && m.normalScale.value.negate()), f.displacementMap && (m.displacementMap.value = f.displacementMap, t(f.displacementMap, m.displacementMapTransform), m.displacementScale.value = f.displacementScale, m.displacementBias.value = f.displacementBias), f.emissiveMap && (m.emissiveMap.value = f.emissiveMap, t(f.emissiveMap, m.emissiveMapTransform)), f.specularMap && (m.specularMap.value = f.specularMap, t(f.specularMap, m.specularMapTransform)), f.alphaTest > 0 && (m.alphaTest.value = f.alphaTest);
36145
- const x = e.get(f), E = x.envMap, _ = x.envMapRotation;
36146
- E && (m.envMap.value = E, rs.copy(_), rs.x *= -1, rs.y *= -1, rs.z *= -1, E.isCubeTexture && E.isRenderTargetTexture === !1 && (rs.y *= -1, rs.z *= -1), m.envMapRotation.value.setFromMatrix4(pC.makeRotationFromEuler(rs)), m.flipEnvMap.value = E.isCubeTexture && E.isRenderTargetTexture === !1 ? -1 : 1, m.reflectivity.value = f.reflectivity, m.ior.value = f.ior, m.refractionRatio.value = f.refractionRatio), f.lightMap && (m.lightMap.value = f.lightMap, m.lightMapIntensity.value = f.lightMapIntensity, t(f.lightMap, m.lightMapTransform)), f.aoMap && (m.aoMap.value = f.aoMap, m.aoMapIntensity.value = f.aoMapIntensity, t(f.aoMap, m.aoMapTransform));
36151
+ function r(m, p) {
36152
+ m.opacity.value = p.opacity, p.color && m.diffuse.value.copy(p.color), p.emissive && m.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity), p.map && (m.map.value = p.map, t(p.map, m.mapTransform)), p.alphaMap && (m.alphaMap.value = p.alphaMap, t(p.alphaMap, m.alphaMapTransform)), p.bumpMap && (m.bumpMap.value = p.bumpMap, t(p.bumpMap, m.bumpMapTransform), m.bumpScale.value = p.bumpScale, p.side === nn && (m.bumpScale.value *= -1)), p.normalMap && (m.normalMap.value = p.normalMap, t(p.normalMap, m.normalMapTransform), m.normalScale.value.copy(p.normalScale), p.side === nn && m.normalScale.value.negate()), p.displacementMap && (m.displacementMap.value = p.displacementMap, t(p.displacementMap, m.displacementMapTransform), m.displacementScale.value = p.displacementScale, m.displacementBias.value = p.displacementBias), p.emissiveMap && (m.emissiveMap.value = p.emissiveMap, t(p.emissiveMap, m.emissiveMapTransform)), p.specularMap && (m.specularMap.value = p.specularMap, t(p.specularMap, m.specularMapTransform)), p.alphaTest > 0 && (m.alphaTest.value = p.alphaTest);
36153
+ const x = e.get(p), E = x.envMap, _ = x.envMapRotation;
36154
+ E && (m.envMap.value = E, rs.copy(_), rs.x *= -1, rs.y *= -1, rs.z *= -1, E.isCubeTexture && E.isRenderTargetTexture === !1 && (rs.y *= -1, rs.z *= -1), m.envMapRotation.value.setFromMatrix4(pC.makeRotationFromEuler(rs)), m.flipEnvMap.value = E.isCubeTexture && E.isRenderTargetTexture === !1 ? -1 : 1, m.reflectivity.value = p.reflectivity, m.ior.value = p.ior, m.refractionRatio.value = p.refractionRatio), p.lightMap && (m.lightMap.value = p.lightMap, m.lightMapIntensity.value = p.lightMapIntensity, t(p.lightMap, m.lightMapTransform)), p.aoMap && (m.aoMap.value = p.aoMap, m.aoMapIntensity.value = p.aoMapIntensity, t(p.aoMap, m.aoMapTransform));
36147
36155
  }
36148
- function a(m, f) {
36149
- m.diffuse.value.copy(f.color), m.opacity.value = f.opacity, f.map && (m.map.value = f.map, t(f.map, m.mapTransform));
36156
+ function a(m, p) {
36157
+ m.diffuse.value.copy(p.color), m.opacity.value = p.opacity, p.map && (m.map.value = p.map, t(p.map, m.mapTransform));
36150
36158
  }
36151
- function o(m, f) {
36152
- m.dashSize.value = f.dashSize, m.totalSize.value = f.dashSize + f.gapSize, m.scale.value = f.scale;
36159
+ function o(m, p) {
36160
+ m.dashSize.value = p.dashSize, m.totalSize.value = p.dashSize + p.gapSize, m.scale.value = p.scale;
36153
36161
  }
36154
- function c(m, f, x, E) {
36155
- m.diffuse.value.copy(f.color), m.opacity.value = f.opacity, m.size.value = f.size * x, m.scale.value = E * 0.5, f.map && (m.map.value = f.map, t(f.map, m.uvTransform)), f.alphaMap && (m.alphaMap.value = f.alphaMap, t(f.alphaMap, m.alphaMapTransform)), f.alphaTest > 0 && (m.alphaTest.value = f.alphaTest);
36162
+ function c(m, p, x, E) {
36163
+ m.diffuse.value.copy(p.color), m.opacity.value = p.opacity, m.size.value = p.size * x, m.scale.value = E * 0.5, p.map && (m.map.value = p.map, t(p.map, m.uvTransform)), p.alphaMap && (m.alphaMap.value = p.alphaMap, t(p.alphaMap, m.alphaMapTransform)), p.alphaTest > 0 && (m.alphaTest.value = p.alphaTest);
36156
36164
  }
36157
- function l(m, f) {
36158
- m.diffuse.value.copy(f.color), m.opacity.value = f.opacity, m.rotation.value = f.rotation, f.map && (m.map.value = f.map, t(f.map, m.mapTransform)), f.alphaMap && (m.alphaMap.value = f.alphaMap, t(f.alphaMap, m.alphaMapTransform)), f.alphaTest > 0 && (m.alphaTest.value = f.alphaTest);
36165
+ function l(m, p) {
36166
+ m.diffuse.value.copy(p.color), m.opacity.value = p.opacity, m.rotation.value = p.rotation, p.map && (m.map.value = p.map, t(p.map, m.mapTransform)), p.alphaMap && (m.alphaMap.value = p.alphaMap, t(p.alphaMap, m.alphaMapTransform)), p.alphaTest > 0 && (m.alphaTest.value = p.alphaTest);
36159
36167
  }
36160
- function d(m, f) {
36161
- m.specular.value.copy(f.specular), m.shininess.value = Math.max(f.shininess, 1e-4);
36168
+ function d(m, p) {
36169
+ m.specular.value.copy(p.specular), m.shininess.value = Math.max(p.shininess, 1e-4);
36162
36170
  }
36163
- function u(m, f) {
36164
- f.gradientMap && (m.gradientMap.value = f.gradientMap);
36171
+ function u(m, p) {
36172
+ p.gradientMap && (m.gradientMap.value = p.gradientMap);
36165
36173
  }
36166
- function h(m, f) {
36167
- m.metalness.value = f.metalness, f.metalnessMap && (m.metalnessMap.value = f.metalnessMap, t(f.metalnessMap, m.metalnessMapTransform)), m.roughness.value = f.roughness, f.roughnessMap && (m.roughnessMap.value = f.roughnessMap, t(f.roughnessMap, m.roughnessMapTransform)), f.envMap && (m.envMapIntensity.value = f.envMapIntensity);
36174
+ function h(m, p) {
36175
+ m.metalness.value = p.metalness, p.metalnessMap && (m.metalnessMap.value = p.metalnessMap, t(p.metalnessMap, m.metalnessMapTransform)), m.roughness.value = p.roughness, p.roughnessMap && (m.roughnessMap.value = p.roughnessMap, t(p.roughnessMap, m.roughnessMapTransform)), p.envMap && (m.envMapIntensity.value = p.envMapIntensity);
36168
36176
  }
36169
- function p(m, f, x) {
36170
- m.ior.value = f.ior, f.sheen > 0 && (m.sheenColor.value.copy(f.sheenColor).multiplyScalar(f.sheen), m.sheenRoughness.value = f.sheenRoughness, f.sheenColorMap && (m.sheenColorMap.value = f.sheenColorMap, t(f.sheenColorMap, m.sheenColorMapTransform)), f.sheenRoughnessMap && (m.sheenRoughnessMap.value = f.sheenRoughnessMap, t(f.sheenRoughnessMap, m.sheenRoughnessMapTransform))), f.clearcoat > 0 && (m.clearcoat.value = f.clearcoat, m.clearcoatRoughness.value = f.clearcoatRoughness, f.clearcoatMap && (m.clearcoatMap.value = f.clearcoatMap, t(f.clearcoatMap, m.clearcoatMapTransform)), f.clearcoatRoughnessMap && (m.clearcoatRoughnessMap.value = f.clearcoatRoughnessMap, t(f.clearcoatRoughnessMap, m.clearcoatRoughnessMapTransform)), f.clearcoatNormalMap && (m.clearcoatNormalMap.value = f.clearcoatNormalMap, t(f.clearcoatNormalMap, m.clearcoatNormalMapTransform), m.clearcoatNormalScale.value.copy(f.clearcoatNormalScale), f.side === nn && m.clearcoatNormalScale.value.negate())), f.dispersion > 0 && (m.dispersion.value = f.dispersion), f.iridescence > 0 && (m.iridescence.value = f.iridescence, m.iridescenceIOR.value = f.iridescenceIOR, m.iridescenceThicknessMinimum.value = f.iridescenceThicknessRange[0], m.iridescenceThicknessMaximum.value = f.iridescenceThicknessRange[1], f.iridescenceMap && (m.iridescenceMap.value = f.iridescenceMap, t(f.iridescenceMap, m.iridescenceMapTransform)), f.iridescenceThicknessMap && (m.iridescenceThicknessMap.value = f.iridescenceThicknessMap, t(f.iridescenceThicknessMap, m.iridescenceThicknessMapTransform))), f.transmission > 0 && (m.transmission.value = f.transmission, m.transmissionSamplerMap.value = x.texture, m.transmissionSamplerSize.value.set(x.width, x.height), f.transmissionMap && (m.transmissionMap.value = f.transmissionMap, t(f.transmissionMap, m.transmissionMapTransform)), m.thickness.value = f.thickness, f.thicknessMap && (m.thicknessMap.value = f.thicknessMap, t(f.thicknessMap, m.thicknessMapTransform)), m.attenuationDistance.value = f.attenuationDistance, m.attenuationColor.value.copy(f.attenuationColor)), f.anisotropy > 0 && (m.anisotropyVector.value.set(f.anisotropy * Math.cos(f.anisotropyRotation), f.anisotropy * Math.sin(f.anisotropyRotation)), f.anisotropyMap && (m.anisotropyMap.value = f.anisotropyMap, t(f.anisotropyMap, m.anisotropyMapTransform))), m.specularIntensity.value = f.specularIntensity, m.specularColor.value.copy(f.specularColor), f.specularColorMap && (m.specularColorMap.value = f.specularColorMap, t(f.specularColorMap, m.specularColorMapTransform)), f.specularIntensityMap && (m.specularIntensityMap.value = f.specularIntensityMap, t(f.specularIntensityMap, m.specularIntensityMapTransform));
36177
+ function f(m, p, x) {
36178
+ m.ior.value = p.ior, p.sheen > 0 && (m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen), m.sheenRoughness.value = p.sheenRoughness, p.sheenColorMap && (m.sheenColorMap.value = p.sheenColorMap, t(p.sheenColorMap, m.sheenColorMapTransform)), p.sheenRoughnessMap && (m.sheenRoughnessMap.value = p.sheenRoughnessMap, t(p.sheenRoughnessMap, m.sheenRoughnessMapTransform))), p.clearcoat > 0 && (m.clearcoat.value = p.clearcoat, m.clearcoatRoughness.value = p.clearcoatRoughness, p.clearcoatMap && (m.clearcoatMap.value = p.clearcoatMap, t(p.clearcoatMap, m.clearcoatMapTransform)), p.clearcoatRoughnessMap && (m.clearcoatRoughnessMap.value = p.clearcoatRoughnessMap, t(p.clearcoatRoughnessMap, m.clearcoatRoughnessMapTransform)), p.clearcoatNormalMap && (m.clearcoatNormalMap.value = p.clearcoatNormalMap, t(p.clearcoatNormalMap, m.clearcoatNormalMapTransform), m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale), p.side === nn && m.clearcoatNormalScale.value.negate())), p.dispersion > 0 && (m.dispersion.value = p.dispersion), p.iridescence > 0 && (m.iridescence.value = p.iridescence, m.iridescenceIOR.value = p.iridescenceIOR, m.iridescenceThicknessMinimum.value = p.iridescenceThicknessRange[0], m.iridescenceThicknessMaximum.value = p.iridescenceThicknessRange[1], p.iridescenceMap && (m.iridescenceMap.value = p.iridescenceMap, t(p.iridescenceMap, m.iridescenceMapTransform)), p.iridescenceThicknessMap && (m.iridescenceThicknessMap.value = p.iridescenceThicknessMap, t(p.iridescenceThicknessMap, m.iridescenceThicknessMapTransform))), p.transmission > 0 && (m.transmission.value = p.transmission, m.transmissionSamplerMap.value = x.texture, m.transmissionSamplerSize.value.set(x.width, x.height), p.transmissionMap && (m.transmissionMap.value = p.transmissionMap, t(p.transmissionMap, m.transmissionMapTransform)), m.thickness.value = p.thickness, p.thicknessMap && (m.thicknessMap.value = p.thicknessMap, t(p.thicknessMap, m.thicknessMapTransform)), m.attenuationDistance.value = p.attenuationDistance, m.attenuationColor.value.copy(p.attenuationColor)), p.anisotropy > 0 && (m.anisotropyVector.value.set(p.anisotropy * Math.cos(p.anisotropyRotation), p.anisotropy * Math.sin(p.anisotropyRotation)), p.anisotropyMap && (m.anisotropyMap.value = p.anisotropyMap, t(p.anisotropyMap, m.anisotropyMapTransform))), m.specularIntensity.value = p.specularIntensity, m.specularColor.value.copy(p.specularColor), p.specularColorMap && (m.specularColorMap.value = p.specularColorMap, t(p.specularColorMap, m.specularColorMapTransform)), p.specularIntensityMap && (m.specularIntensityMap.value = p.specularIntensityMap, t(p.specularIntensityMap, m.specularIntensityMapTransform));
36171
36179
  }
36172
- function g(m, f) {
36173
- f.matcap && (m.matcap.value = f.matcap);
36180
+ function g(m, p) {
36181
+ p.matcap && (m.matcap.value = p.matcap);
36174
36182
  }
36175
- function v(m, f) {
36176
- const x = e.get(f).light;
36183
+ function v(m, p) {
36184
+ const x = e.get(p).light;
36177
36185
  m.referencePosition.value.setFromMatrixPosition(x.matrixWorld), m.nearDistance.value = x.shadow.camera.near, m.farDistance.value = x.shadow.camera.far;
36178
36186
  }
36179
36187
  return {
@@ -36215,7 +36223,7 @@ function gC(i, e, t, n) {
36215
36223
  const k = Array.isArray(_[M]) ? _[M] : [_[M]];
36216
36224
  for (let y = 0, T = k.length; y < T; y++) {
36217
36225
  const R = k[y];
36218
- if (p(R, M, y, S) === !0) {
36226
+ if (f(R, M, y, S) === !0) {
36219
36227
  const U = R.__offset, F = Array.isArray(R.value) ? R.value : [R.value];
36220
36228
  let q = 0;
36221
36229
  for (let Y = 0; Y < F.length; Y++) {
@@ -36228,7 +36236,7 @@ function gC(i, e, t, n) {
36228
36236
  }
36229
36237
  i.bindBuffer(i.UNIFORM_BUFFER, null);
36230
36238
  }
36231
- function p(x, E, _, S) {
36239
+ function f(x, E, _, S) {
36232
36240
  const M = x.value, A = E + "_" + _;
36233
36241
  if (S[A] === void 0)
36234
36242
  return typeof M == "number" || typeof M == "boolean" ? S[A] = M : S[A] = M.clone(), !0;
@@ -36274,7 +36282,7 @@ function gC(i, e, t, n) {
36274
36282
  const _ = a.indexOf(E.__bindingPointIndex);
36275
36283
  a.splice(_, 1), i.deleteBuffer(s[E.id]), delete s[E.id], delete r[E.id];
36276
36284
  }
36277
- function f() {
36285
+ function p() {
36278
36286
  for (const x in s)
36279
36287
  i.deleteBuffer(s[x]);
36280
36288
  a = [], s = {}, r = {};
@@ -36282,7 +36290,7 @@ function gC(i, e, t, n) {
36282
36290
  return {
36283
36291
  bind: c,
36284
36292
  update: l,
36285
- dispose: f
36293
+ dispose: p
36286
36294
  };
36287
36295
  }
36288
36296
  const vC = new Uint16Array([
@@ -36822,7 +36830,7 @@ class bC {
36822
36830
  powerPreference: d = "default",
36823
36831
  failIfMajorPerformanceCaveat: u = !1,
36824
36832
  reversedDepthBuffer: h = !1,
36825
- outputBufferType: p = Mn
36833
+ outputBufferType: f = Mn
36826
36834
  } = e;
36827
36835
  this.isWebGLRenderer = !0;
36828
36836
  let g;
@@ -36832,11 +36840,11 @@ class bC {
36832
36840
  g = n.getContextAttributes().alpha;
36833
36841
  } else
36834
36842
  g = a;
36835
- const v = p, m = /* @__PURE__ */ new Set([
36843
+ const v = f, m = /* @__PURE__ */ new Set([
36836
36844
  kd,
36837
36845
  Pd,
36838
36846
  Rd
36839
- ]), f = /* @__PURE__ */ new Set([
36847
+ ]), p = /* @__PURE__ */ new Set([
36840
36848
  Mn,
36841
36849
  si,
36842
36850
  Hr,
@@ -36866,12 +36874,12 @@ class bC {
36866
36874
  const H = new Lt(), W = new Lt();
36867
36875
  let ee = null;
36868
36876
  const ge = new Je(0);
36869
- let le = 0, _e = t.width, Be = t.height, Fe = 1, xt = null, dt = null;
36877
+ let le = 0, _e = t.width, Be = t.height, Fe = 1, Ct = null, dt = null;
36870
36878
  const $ = new Lt(0, 0, _e, Be), te = new Lt(0, 0, _e, Be);
36871
36879
  let Te = !1;
36872
36880
  const Ve = new Cm();
36873
36881
  let Me = !1, et = !1;
36874
- const Wt = new Vt(), Ze = new B(), at = new Lt(), ft = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
36882
+ const Wt = new Vt(), Ze = new B(), at = new Lt(), gt = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
36875
36883
  let He = !1;
36876
36884
  function Nt() {
36877
36885
  return F === null ? Fe : 1;
@@ -36899,9 +36907,9 @@ class bC {
36899
36907
  } catch (C) {
36900
36908
  throw nt("WebGLRenderer: " + C.message), C;
36901
36909
  }
36902
- let rt, bt, Ae, w, b, L, X, Q, j, Pe, ue, we, Ne, se, fe, Ce, Re, he, We, D, be, ae, ye, ie;
36910
+ let rt, bt, Ae, w, b, L, X, Q, j, Pe, ue, we, Ne, se, fe, Ce, Re, he, We, D, be, ae, Se, ie;
36903
36911
  function K() {
36904
- rt = new _T(I), rt.init(), ae = new lC(I, rt), bt = new lT(I, rt, e, ae), Ae = new oC(I, rt), bt.reversedDepthBuffer && h && Ae.buffers.depth.setReversed(!0), w = new ST(I), b = new jE(), L = new cC(I, rt, Ae, b, bt, ae, w), X = new uT(y), Q = new vT(y), j = new Cy(I), ye = new oT(I, j), Pe = new bT(I, j, w, ye), ue = new TT(I, Pe, j, w), We = new xT(I, bt, L), Ce = new dT(b), we = new qE(y, X, Q, rt, bt, ye, Ce), Ne = new mC(y, b), se = new $E(), fe = new eC(rt), he = new aT(y, X, Q, Ae, ue, g, c), Re = new rC(y, ue, bt), ie = new gC(I, w, bt, Ae), D = new cT(I, rt, w), be = new yT(I, rt, w), w.programs = we.programs, y.capabilities = bt, y.extensions = rt, y.properties = b, y.renderLists = se, y.shadowMap = Re, y.state = Ae, y.info = w;
36912
+ rt = new _T(I), rt.init(), ae = new lC(I, rt), bt = new lT(I, rt, e, ae), Ae = new oC(I, rt), bt.reversedDepthBuffer && h && Ae.buffers.depth.setReversed(!0), w = new ST(I), b = new jE(), L = new cC(I, rt, Ae, b, bt, ae, w), X = new uT(y), Q = new vT(y), j = new Cy(I), Se = new oT(I, j), Pe = new bT(I, j, w, Se), ue = new TT(I, Pe, j, w), We = new xT(I, bt, L), Ce = new dT(b), we = new qE(y, X, Q, rt, bt, Se, Ce), Ne = new mC(y, b), se = new $E(), fe = new eC(rt), he = new aT(y, X, Q, Ae, ue, g, c), Re = new rC(y, ue, bt), ie = new gC(I, w, bt, Ae), D = new cT(I, rt, w), be = new yT(I, rt, w), w.programs = we.programs, y.capabilities = bt, y.extensions = rt, y.properties = b, y.renderLists = se, y.shadowMap = Re, y.state = Ae, y.info = w;
36905
36913
  }
36906
36914
  K(), v !== Mn && (k = new CT(v, t.width, t.height, s, r));
36907
36915
  const de = new fC(y, I);
@@ -36959,7 +36967,7 @@ class bC {
36959
36967
  }, this.setScissorTest = function(C) {
36960
36968
  Ae.setScissorTest(Te = C);
36961
36969
  }, this.setOpaqueSort = function(C) {
36962
- xt = C;
36970
+ Ct = C;
36963
36971
  }, this.setTransparentSort = function(C) {
36964
36972
  dt = C;
36965
36973
  }, this.getClearColor = function(C) {
@@ -36979,7 +36987,7 @@ class bC {
36979
36987
  O = m.has(pe);
36980
36988
  }
36981
36989
  if (O) {
36982
- const pe = F.texture.type, xe = f.has(pe), ve = he.getClearColor(), Ee = he.getClearAlpha(), ke = ve.r, Le = ve.g, Ie = ve.b;
36990
+ const pe = F.texture.type, xe = p.has(pe), ve = he.getClearColor(), Ee = he.getClearAlpha(), ke = ve.r, Le = ve.g, Ie = ve.b;
36983
36991
  xe ? (x[0] = ke, x[1] = Le, x[2] = Ie, x[3] = Ee, I.clearBufferuiv(I.COLOR, 0, x)) : (E[0] = ke, E[1] = Le, E[2] = Ie, E[3] = Ee, I.clearBufferiv(I.COLOR, 0, E));
36984
36992
  } else
36985
36993
  V |= I.COLOR_BUFFER_BIT;
@@ -36992,7 +37000,7 @@ class bC {
36992
37000
  }, this.clearStencil = function() {
36993
37001
  this.clear(!1, !1, !0);
36994
37002
  }, this.dispose = function() {
36995
- t.removeEventListener("webglcontextlost", Ue, !1), t.removeEventListener("webglcontextrestored", yt, !1), t.removeEventListener("webglcontextcreationerror", ot, !1), he.dispose(), se.dispose(), fe.dispose(), b.dispose(), X.dispose(), Q.dispose(), ue.dispose(), ye.dispose(), ie.dispose(), we.dispose(), de.dispose(), de.removeEventListener("sessionstart", Hd), de.removeEventListener("sessionend", Wd), Ji.stop();
37003
+ t.removeEventListener("webglcontextlost", Ue, !1), t.removeEventListener("webglcontextrestored", yt, !1), t.removeEventListener("webglcontextcreationerror", ot, !1), he.dispose(), se.dispose(), fe.dispose(), b.dispose(), X.dispose(), Q.dispose(), ue.dispose(), Se.dispose(), ie.dispose(), we.dispose(), de.dispose(), de.removeEventListener("sessionstart", Hd), de.removeEventListener("sessionend", Wd), Ji.stop();
36996
37004
  };
36997
37005
  function Ue(C) {
36998
37006
  C.preventDefault(), mh("WebGLRenderer: Context Lost."), T = !0;
@@ -37019,7 +37027,7 @@ class bC {
37019
37027
  }), C.isShaderMaterial && we.releaseShaderCache(C));
37020
37028
  }
37021
37029
  this.renderBufferDirect = function(C, N, G, V, O, pe) {
37022
- N === null && (N = ft);
37030
+ N === null && (N = gt);
37023
37031
  const xe = O.isMesh && O.matrixWorld.determinant() < 0, ve = Nm(C, N, G, V, O);
37024
37032
  Ae.setMaterial(V, xe);
37025
37033
  let Ee = G.index, ke = 1;
@@ -37032,31 +37040,31 @@ class bC {
37032
37040
  pe !== null && (je = Math.max(je, pe.start * ke), ut = Math.min(ut, (pe.start + pe.count) * ke)), Ee !== null ? (je = Math.max(je, 0), ut = Math.min(ut, Ee.count)) : Ie != null && (je = Math.max(je, 0), ut = Math.min(ut, Ie.count));
37033
37041
  const At = ut - je;
37034
37042
  if (At < 0 || At === 1 / 0) return;
37035
- ye.setup(O, V, ve, G, Ee);
37036
- let Rt, pt = D;
37037
- if (Ee !== null && (Rt = j.get(Ee), pt = be, pt.setIndex(Rt)), O.isMesh)
37038
- V.wireframe === !0 ? (Ae.setLineWidth(V.wireframeLinewidth * Nt()), pt.setMode(I.LINES)) : pt.setMode(I.TRIANGLES);
37043
+ Se.setup(O, V, ve, G, Ee);
37044
+ let Rt, vt = D;
37045
+ if (Ee !== null && (Rt = j.get(Ee), vt = be, vt.setIndex(Rt)), O.isMesh)
37046
+ V.wireframe === !0 ? (Ae.setLineWidth(V.wireframeLinewidth * Nt()), vt.setMode(I.LINES)) : vt.setMode(I.TRIANGLES);
37039
37047
  else if (O.isLine) {
37040
37048
  let De = V.linewidth;
37041
- De === void 0 && (De = 1), Ae.setLineWidth(De * Nt()), O.isLineSegments ? pt.setMode(I.LINES) : O.isLineLoop ? pt.setMode(I.LINE_LOOP) : pt.setMode(I.LINE_STRIP);
37042
- } else O.isPoints ? pt.setMode(I.POINTS) : O.isSprite && pt.setMode(I.TRIANGLES);
37049
+ 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);
37050
+ } else O.isPoints ? vt.setMode(I.POINTS) : O.isSprite && vt.setMode(I.TRIANGLES);
37043
37051
  if (O.isBatchedMesh)
37044
37052
  if (O._multiDrawInstances !== null)
37045
- qr("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), pt.renderMultiDrawInstances(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount, O._multiDrawInstances);
37053
+ qr("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);
37046
37054
  else if (rt.get("WEBGL_multi_draw"))
37047
- pt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37055
+ vt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37048
37056
  else {
37049
37057
  const De = O._multiDrawStarts, ct = O._multiDrawCounts, tt = O._multiDrawCount, pn = Ee ? j.get(Ee).bytesPerElement : 1, Ts = b.get(V).currentProgram.getUniforms();
37050
37058
  for (let mn = 0; mn < tt; mn++)
37051
- Ts.setValue(I, "_gl_DrawID", mn), pt.render(De[mn] / pn, ct[mn]);
37059
+ Ts.setValue(I, "_gl_DrawID", mn), vt.render(De[mn] / pn, ct[mn]);
37052
37060
  }
37053
37061
  else if (O.isInstancedMesh)
37054
- pt.renderInstances(je, At, O.count);
37062
+ vt.renderInstances(je, At, O.count);
37055
37063
  else if (G.isInstancedBufferGeometry) {
37056
37064
  const De = G._maxInstanceCount !== void 0 ? G._maxInstanceCount : 1 / 0, ct = Math.min(G.instanceCount, De);
37057
- pt.renderInstances(je, At, ct);
37065
+ vt.renderInstances(je, At, ct);
37058
37066
  } else
37059
- pt.render(je, At);
37067
+ vt.render(je, At);
37060
37068
  };
37061
37069
  function Gd(C, N, G) {
37062
37070
  C.transparent === !0 && C.side === yi && C.forceSinglePass === !1 ? (C.side = nn, C.needsUpdate = !0, ea(C, N, G), C.side = Ci, C.needsUpdate = !0, ea(C, N, G), C.side = yi) : ea(C, N, G);
@@ -37120,7 +37128,7 @@ class bC {
37120
37128
  const xe = y.xr.getDepthSensingMesh();
37121
37129
  xe !== null && yo(xe, N, -1 / 0, y.sortObjects);
37122
37130
  }
37123
- yo(C, N, 0, y.sortObjects), _.finish(), y.sortObjects === !0 && _.sort(xt, dt), He = de.enabled === !1 || de.isPresenting === !1 || de.hasDepthSensing() === !1, He && he.addToRenderList(_, C), this.info.render.frame++, Me === !0 && Ce.beginShadows();
37131
+ yo(C, N, 0, y.sortObjects), _.finish(), y.sortObjects === !0 && _.sort(Ct, dt), He = de.enabled === !1 || de.isPresenting === !1 || de.hasDepthSensing() === !1, He && he.addToRenderList(_, C), this.info.render.frame++, Me === !0 && Ce.beginShadows();
37124
37132
  const O = S.state.shadowsArray;
37125
37133
  if (Re.render(O, C, N), Me === !0 && Ce.endShadows(), this.info.autoReset === !0 && this.info.reset(), (V && k.hasRenderPass()) === !1) {
37126
37134
  const xe = _.opaque, ve = _.transmissive;
@@ -37139,7 +37147,7 @@ class bC {
37139
37147
  } else
37140
37148
  ve.length > 0 && jd(xe, ve, C, N), He && he.render(C), qd(_, C, N);
37141
37149
  }
37142
- F !== null && U === 0 && (L.updateMultisampleRenderTarget(F), L.updateRenderTargetMipmap(F)), V && k.end(y), C.isScene === !0 && C.onAfterRender(y, C, N), ye.resetDefaultState(), q = -1, Y = null, A.pop(), A.length > 0 ? (S = A[A.length - 1], Me === !0 && Ce.setGlobalState(y.clippingPlanes, S.state.camera)) : S = null, M.pop(), M.length > 0 ? _ = M[M.length - 1] : _ = null;
37150
+ F !== null && U === 0 && (L.updateMultisampleRenderTarget(F), L.updateRenderTargetMipmap(F)), V && k.end(y), C.isScene === !0 && C.onAfterRender(y, C, N), Se.resetDefaultState(), q = -1, Y = null, A.pop(), A.length > 0 ? (S = A[A.length - 1], Me === !0 && Ce.setGlobalState(y.clippingPlanes, S.state.camera)) : S = null, M.pop(), M.length > 0 ? _ = M[M.length - 1] : _ = null;
37143
37151
  };
37144
37152
  function yo(C, N, G, V) {
37145
37153
  if (C.visible === !1) return;
@@ -37201,10 +37209,10 @@ class bC {
37201
37209
  if (V.viewport !== void 0 && (V.viewport = void 0), S.setupLightsView(V), Me === !0 && Ce.setGlobalState(y.clippingPlanes, V), Qr(C, G, V), L.updateMultisampleRenderTarget(pe), L.updateRenderTargetMipmap(pe), rt.has("WEBGL_multisampled_render_to_texture") === !1) {
37202
37210
  let je = !1;
37203
37211
  for (let ut = 0, At = N.length; ut < At; ut++) {
37204
- const Rt = N[ut], { object: pt, geometry: De, material: ct, group: tt } = Rt;
37205
- if (ct.side === yi && pt.layers.test(V.layers)) {
37212
+ const Rt = N[ut], { object: vt, geometry: De, material: ct, group: tt } = Rt;
37213
+ if (ct.side === yi && vt.layers.test(V.layers)) {
37206
37214
  const pn = ct.side;
37207
- ct.side = nn, ct.needsUpdate = !0, Xd(pt, G, V, De, ct, tt), ct.side = pn, ct.needsUpdate = !0, je = !0;
37215
+ ct.side = nn, ct.needsUpdate = !0, Xd(vt, G, V, De, ct, tt), ct.side = pn, ct.needsUpdate = !0, je = !0;
37208
37216
  }
37209
37217
  }
37210
37218
  je === !0 && (L.updateMultisampleRenderTarget(pe), L.updateRenderTargetMipmap(pe));
@@ -37223,7 +37231,7 @@ class bC {
37223
37231
  C.onBeforeRender(y, N, G, V, O, pe), C.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse, C.matrixWorld), C.normalMatrix.getNormalMatrix(C.modelViewMatrix), O.onBeforeRender(y, N, G, V, C, pe), O.transparent === !0 && O.side === yi && O.forceSinglePass === !1 ? (O.side = nn, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, C, pe), O.side = Ci, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, C, pe), O.side = yi) : y.renderBufferDirect(G, N, V, O, C, pe), C.onAfterRender(y, N, G, V, O, pe);
37224
37232
  }
37225
37233
  function ea(C, N, G) {
37226
- N.isScene !== !0 && (N = ft);
37234
+ N.isScene !== !0 && (N = gt);
37227
37235
  const V = b.get(C), O = S.state.lights, pe = S.state.shadowsArray, xe = O.state.version, ve = we.getParameters(C, O.state, pe, N, G), Ee = we.getProgramCacheKey(ve);
37228
37236
  let ke = V.programs;
37229
37237
  V.environment = C.isMeshStandardMaterial ? N.environment : null, V.fog = N.fog, V.envMap = (C.isMeshStandardMaterial ? Q : X).get(C.envMap || V.environment), V.envMapRotation = V.environment !== null && C.envMap === null ? N.environmentRotation : C.envMapRotation, ke === void 0 && (C.addEventListener("dispose", Hn), ke = /* @__PURE__ */ new Map(), V.programs = ke);
@@ -37248,17 +37256,17 @@ class bC {
37248
37256
  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;
37249
37257
  }
37250
37258
  function Nm(C, N, G, V, O) {
37251
- N.isScene !== !0 && (N = ft), L.resetTextureUnits();
37259
+ N.isScene !== !0 && (N = gt), L.resetTextureUnits();
37252
37260
  const pe = N.fog, xe = V.isMeshStandardMaterial ? N.environment : null, ve = F === null ? y.outputColorSpace : F.isXRRenderTarget === !0 ? F.texture.colorSpace : rr, Ee = (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, ut = !!G.morphAttributes.color;
37253
37261
  let At = Qn;
37254
37262
  V.toneMapped && (F === null || F.isXRRenderTarget === !0) && (At = y.toneMapping);
37255
- const Rt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, pt = Rt !== void 0 ? Rt.length : 0, De = b.get(V), ct = S.state.lights;
37263
+ const Rt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, vt = Rt !== void 0 ? Rt.length : 0, De = b.get(V), ct = S.state.lights;
37256
37264
  if (Me === !0 && (et === !0 || C !== Y)) {
37257
37265
  const en = C === Y && V.id === q;
37258
37266
  Ce.setState(V, C, en);
37259
37267
  }
37260
37268
  let tt = !1;
37261
- 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 !== Ee || V.fog === !0 && De.fog !== pe || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ce.numPlanes || De.numIntersection !== Ce.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== je || De.morphColors !== ut || De.toneMapping !== At || De.morphTargetsCount !== pt) && (tt = !0) : (tt = !0, De.__version = V.version);
37269
+ 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 !== Ee || V.fog === !0 && De.fog !== pe || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ce.numPlanes || De.numIntersection !== Ce.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== je || De.morphColors !== ut || De.toneMapping !== At || De.morphTargetsCount !== vt) && (tt = !0) : (tt = !0, De.__version = V.version);
37262
37270
  let pn = De.currentProgram;
37263
37271
  tt === !0 && (pn = ea(V, N, O));
37264
37272
  let Ts = !1, mn = !1, dr = !1;
@@ -37408,7 +37416,7 @@ class bC {
37408
37416
  xe = Math.floor(Rt.width * xn), ve = Math.floor(Rt.height * xn), C.isDataArrayTexture ? Ee = Rt.depth : C.isData3DTexture ? Ee = Math.floor(Rt.depth * xn) : Ee = 1, ke = 0, Le = 0, Ie = 0;
37409
37417
  }
37410
37418
  V !== null ? (je = V.x, ut = V.y, At = V.z) : (je = 0, ut = 0, At = 0);
37411
- const pt = ae.convert(N.format), De = ae.convert(N.type);
37419
+ const vt = ae.convert(N.format), De = ae.convert(N.type);
37412
37420
  let ct;
37413
37421
  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);
37414
37422
  const tt = I.getParameter(I.UNPACK_ROW_LENGTH), pn = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Ts = I.getParameter(I.UNPACK_SKIP_PIXELS), mn = I.getParameter(I.UNPACK_SKIP_ROWS), dr = I.getParameter(I.UNPACK_SKIP_IMAGES);
@@ -37427,14 +37435,14 @@ class bC {
37427
37435
  St ? 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, ut, xe, ve, I.COLOR_BUFFER_BIT, I.NEAREST) : an ? I.copyTexSubImage3D(ct, pe, je, ut, At + on, ke, Le, xe, ve) : I.copyTexSubImage2D(ct, pe, je, ut, ke, Le, xe, ve);
37428
37436
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, null), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, null);
37429
37437
  } else
37430
- an ? C.isDataTexture || C.isData3DTexture ? I.texSubImage3D(ct, pe, je, ut, At, xe, ve, Ee, pt, De, Rt.data) : N.isCompressedArrayTexture ? I.compressedTexSubImage3D(ct, pe, je, ut, At, xe, ve, Ee, pt, Rt.data) : I.texSubImage3D(ct, pe, je, ut, At, xe, ve, Ee, pt, De, Rt) : C.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, pe, je, ut, xe, ve, pt, De, Rt.data) : C.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, pe, je, ut, Rt.width, Rt.height, pt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, pe, je, ut, xe, ve, pt, De, Rt);
37438
+ an ? C.isDataTexture || C.isData3DTexture ? I.texSubImage3D(ct, pe, je, ut, At, xe, ve, Ee, vt, De, Rt.data) : N.isCompressedArrayTexture ? I.compressedTexSubImage3D(ct, pe, je, ut, At, xe, ve, Ee, vt, Rt.data) : I.texSubImage3D(ct, pe, je, ut, At, xe, ve, Ee, vt, De, Rt) : C.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, pe, je, ut, xe, ve, vt, De, Rt.data) : C.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, pe, je, ut, Rt.width, Rt.height, vt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, pe, je, ut, xe, ve, vt, De, Rt);
37431
37439
  I.pixelStorei(I.UNPACK_ROW_LENGTH, tt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, pn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Ts), I.pixelStorei(I.UNPACK_SKIP_ROWS, mn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, dr), pe === 0 && N.generateMipmaps && I.generateMipmap(ct), Ae.unbindTexture();
37432
37440
  }, this.initRenderTarget = function(C) {
37433
37441
  b.get(C).__webglFramebuffer === void 0 && L.setupRenderTarget(C);
37434
37442
  }, this.initTexture = function(C) {
37435
37443
  C.isCubeTexture ? L.setTextureCube(C, 0) : C.isData3DTexture ? L.setTexture3D(C, 0) : C.isDataArrayTexture || C.isCompressedArrayTexture ? L.setTexture2DArray(C, 0) : L.setTexture2D(C, 0), Ae.unbindTexture();
37436
37444
  }, this.resetState = function() {
37437
- R = 0, U = 0, F = null, Ae.reset(), ye.reset();
37445
+ R = 0, U = 0, F = null, Ae.reset(), Se.reset();
37438
37446
  }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
37439
37447
  }
37440
37448
  /**
@@ -38098,8 +38106,8 @@ class Vd {
38098
38106
  const e = this.audioContext.sampleRate, t = this.frequencyData.length, n = e / (t * 2), s = Math.floor(250 / n), r = Math.floor(2e3 / n);
38099
38107
  let a = 0, o = 0, c = 0;
38100
38108
  for (let h = 0; h < t; h++) {
38101
- const p = this.frequencyData[h] / 255;
38102
- h < s ? a += p : h < r ? o += p : c += p;
38109
+ const f = this.frequencyData[h] / 255;
38110
+ h < s ? a += f : h < r ? o += f : c += f;
38103
38111
  }
38104
38112
  const l = s > 0 ? a / s : 0, d = r - s > 0 ? o / (r - s) : 0, u = t - r > 0 ? c / (t - r) : 0;
38105
38113
  return {
@@ -38158,15 +38166,13 @@ class zd {
38158
38166
  constructor(e = {}) {
38159
38167
  this.audioContext = null, this.config = {
38160
38168
  enabled: !0,
38161
- volume: 0.15,
38169
+ volume: 0.3,
38170
+ preset: "1",
38162
38171
  ...e
38163
38172
  };
38164
38173
  }
38165
- /**
38166
- * Initialize audio context (must be called from user interaction)
38167
- */
38168
38174
  async ensureContext() {
38169
- if (!this.config.enabled) return null;
38175
+ if (!this.config.enabled || this.config.preset === "none") return null;
38170
38176
  if (!this.audioContext)
38171
38177
  try {
38172
38178
  this.audioContext = new (window.AudioContext || window.webkitAudioContext)();
@@ -38175,95 +38181,113 @@ class zd {
38175
38181
  }
38176
38182
  return this.audioContext.state === "suspended" && await this.audioContext.resume(), this.audioContext;
38177
38183
  }
38178
- /**
38179
- * Prewarm audio context on user interaction
38180
- * This helps avoid audio context suspension issues
38181
- */
38182
38184
  async prewarm() {
38183
38185
  await this.ensureContext();
38184
38186
  }
38185
38187
  /**
38186
- * Create an oscillator with envelope
38188
+ * Preset 1: Drop - Капля
38189
+ * Мягкий звук с pitch drop, как капля воды
38187
38190
  */
38188
- createTone(e, t, n, s, r = "sine") {
38189
- const a = e.createOscillator(), o = e.createGain();
38190
- a.type = r, a.frequency.setValueAtTime(t, n);
38191
- const c = 0.05, l = 0.1, d = 0.7, u = 0.3;
38192
- return o.gain.setValueAtTime(0, n), o.gain.linearRampToValueAtTime(this.config.volume, n + c), o.gain.linearRampToValueAtTime(this.config.volume * d, n + c + l), o.gain.setValueAtTime(this.config.volume * d, n + s - u), o.gain.linearRampToValueAtTime(0, n + s), a.connect(o), { oscillator: a, gain: o };
38191
+ async playDrop(e) {
38192
+ const t = await this.ensureContext();
38193
+ if (!t) return;
38194
+ const n = t.currentTime, s = this.config.volume, r = e ? 900 : 700, a = e ? 500 : 400, o = t.createOscillator(), c = t.createGain();
38195
+ o.type = "sine", o.frequency.setValueAtTime(r, n), o.frequency.exponentialRampToValueAtTime(a, n + 0.15), c.gain.setValueAtTime(0, n), c.gain.linearRampToValueAtTime(s * 0.3, n + 0.015), c.gain.linearRampToValueAtTime(s * 0.2, n + 0.1), c.gain.exponentialRampToValueAtTime(1e-3, n + 0.35), o.connect(c).connect(t.destination), o.start(n), o.stop(n + 0.4);
38193
38196
  }
38194
38197
  /**
38195
- * Play pleasant notification sound for call start
38196
- * Two-tone ascending melody like messenger notifications
38198
+ * Preset 2: Glass Tap - Стеклянный тап
38199
+ * Чистый высокий звук с коротким резонансом
38197
38200
  */
38198
- async playCallStartSound() {
38199
- const e = await this.ensureContext();
38200
- if (!e || typeof e.createGain != "function") return;
38201
- const t = e.currentTime, n = e.createGain();
38202
- n.gain.setValueAtTime(1, t), n.connect(e.destination);
38203
- const { oscillator: s, gain: r } = this.createTone(e, 880, t, 0.12, "sine");
38204
- r.connect(n), s.start(t), s.stop(t + 0.12);
38205
- const { oscillator: a, gain: o } = this.createTone(e, 1046, t + 0.08, 0.15, "sine");
38206
- o.connect(n), a.start(t + 0.08), a.stop(t + 0.23), setTimeout(() => {
38207
- try {
38208
- s.disconnect();
38209
- } catch {
38210
- }
38211
- try {
38212
- a.disconnect();
38213
- } catch {
38214
- }
38215
- }, 300);
38201
+ async playGlassTap(e) {
38202
+ const t = await this.ensureContext();
38203
+ if (!t) return;
38204
+ const n = t.currentTime, s = this.config.volume, r = e ? 2200 : 1760, a = t.createOscillator(), o = t.createGain();
38205
+ a.type = "sine", a.frequency.setValueAtTime(r, n), o.gain.setValueAtTime(0, n), o.gain.linearRampToValueAtTime(s * 0.25, n + 2e-3), o.gain.exponentialRampToValueAtTime(s * 0.1, n + 0.08), o.gain.exponentialRampToValueAtTime(1e-3, n + 0.3), a.connect(o).connect(t.destination), a.start(n), a.stop(n + 0.35);
38206
+ const c = t.createOscillator(), l = t.createGain();
38207
+ c.type = "sine", c.frequency.setValueAtTime(r * 2.5, n), l.gain.setValueAtTime(0, n), l.gain.linearRampToValueAtTime(s * 0.08, n + 1e-3), l.gain.exponentialRampToValueAtTime(1e-3, n + 0.12), c.connect(l).connect(t.destination), c.start(n), c.stop(n + 0.15);
38216
38208
  }
38217
38209
  /**
38218
- * Play gentle descending sound for call end
38219
- * Single soft tone
38210
+ * Preset 3: Soft Whoosh - Airy swoosh sound
38220
38211
  */
38221
- async playCallEndSound() {
38222
- const e = await this.ensureContext();
38223
- if (!e || typeof e.createGain != "function") return;
38224
- const t = e.currentTime, n = e.createGain();
38225
- n.gain.setValueAtTime(1, t), n.connect(e.destination);
38226
- const { oscillator: s, gain: r } = this.createTone(e, 660, t, 0.2, "sine");
38227
- r.connect(n), s.start(t), s.stop(t + 0.2), setTimeout(() => {
38228
- try {
38229
- s.disconnect();
38230
- } catch {
38231
- }
38232
- }, 250);
38212
+ async playWhoosh(e) {
38213
+ const t = await this.ensureContext();
38214
+ if (!t) return;
38215
+ const n = t.currentTime, s = this.config.volume, r = t.sampleRate * 0.5, a = t.createBuffer(1, r, t.sampleRate), o = a.getChannelData(0);
38216
+ for (let f = 0; f < r; f++)
38217
+ o[f] = Math.random() * 2 - 1;
38218
+ const c = t.createBufferSource();
38219
+ c.buffer = a;
38220
+ const l = t.createBiquadFilter();
38221
+ l.type = "bandpass", l.Q.setValueAtTime(2, n);
38222
+ const d = t.createGain();
38223
+ e ? (l.frequency.setValueAtTime(300, n), l.frequency.exponentialRampToValueAtTime(2e3, n + 0.15), l.frequency.exponentialRampToValueAtTime(800, n + 0.35), d.gain.setValueAtTime(0, n), d.gain.linearRampToValueAtTime(s * 0.3, n + 0.05), d.gain.linearRampToValueAtTime(s * 0.4, n + 0.15), d.gain.exponentialRampToValueAtTime(1e-3, n + 0.4)) : (l.frequency.setValueAtTime(1500, n), l.frequency.exponentialRampToValueAtTime(200, n + 0.3), d.gain.setValueAtTime(0, n), d.gain.linearRampToValueAtTime(s * 0.35, n + 0.05), d.gain.exponentialRampToValueAtTime(1e-3, n + 0.35));
38224
+ const u = t.createOscillator(), h = t.createGain();
38225
+ u.type = "sine", e ? (u.frequency.setValueAtTime(300, n), u.frequency.linearRampToValueAtTime(500, n + 0.2)) : (u.frequency.setValueAtTime(400, n), u.frequency.linearRampToValueAtTime(200, n + 0.25)), h.gain.setValueAtTime(0, n), h.gain.linearRampToValueAtTime(s * 0.15, n + 0.05), h.gain.exponentialRampToValueAtTime(1e-3, n + 0.35), c.connect(l).connect(d).connect(t.destination), u.connect(h).connect(t.destination), c.start(n), c.stop(n + 0.5), u.start(n), u.stop(n + 0.4);
38233
38226
  }
38234
38227
  /**
38235
- * Update configuration
38228
+ * Preset 4: Gentle Note - Нежная нота
38229
+ * Одна мягкая музыкальная нота
38236
38230
  */
38231
+ async playGentleNote(e) {
38232
+ const t = await this.ensureContext();
38233
+ if (!t) return;
38234
+ const n = t.currentTime, s = this.config.volume, r = e ? 659.25 : 523.25, a = t.createOscillator(), o = t.createGain();
38235
+ a.type = "sine", a.frequency.setValueAtTime(r, n), o.gain.setValueAtTime(0, n), o.gain.linearRampToValueAtTime(s * 0.3, n + 0.02), o.gain.linearRampToValueAtTime(s * 0.25, n + 0.1), o.gain.exponentialRampToValueAtTime(s * 0.08, n + 0.3), o.gain.exponentialRampToValueAtTime(1e-3, n + 0.5), a.connect(o).connect(t.destination), a.start(n), a.stop(n + 0.55);
38236
+ const c = t.createOscillator(), l = t.createGain();
38237
+ c.type = "sine", c.frequency.setValueAtTime(r * 2, n), l.gain.setValueAtTime(0, n), l.gain.linearRampToValueAtTime(s * 0.06, n + 0.02), l.gain.exponentialRampToValueAtTime(1e-3, n + 0.2), c.connect(l).connect(t.destination), c.start(n), c.stop(n + 0.25);
38238
+ }
38239
+ async playCallStartSound() {
38240
+ if (!(!this.config.enabled || this.config.preset === "none"))
38241
+ switch (this.config.preset) {
38242
+ case "1":
38243
+ await this.playDrop(!0);
38244
+ break;
38245
+ case "2":
38246
+ await this.playGlassTap(!0);
38247
+ break;
38248
+ case "3":
38249
+ await this.playWhoosh(!0);
38250
+ break;
38251
+ case "4":
38252
+ await this.playGentleNote(!0);
38253
+ break;
38254
+ }
38255
+ }
38256
+ async playCallEndSound() {
38257
+ if (!(!this.config.enabled || this.config.preset === "none"))
38258
+ switch (this.config.preset) {
38259
+ case "1":
38260
+ await this.playDrop(!1);
38261
+ break;
38262
+ case "2":
38263
+ await this.playGlassTap(!1);
38264
+ break;
38265
+ case "3":
38266
+ await this.playWhoosh(!1);
38267
+ break;
38268
+ case "4":
38269
+ await this.playGentleNote(!1);
38270
+ break;
38271
+ }
38272
+ }
38237
38273
  setConfig(e) {
38238
38274
  this.config = { ...this.config, ...e };
38239
38275
  }
38240
- /**
38241
- * Enable or disable sounds
38242
- */
38243
38276
  setEnabled(e) {
38244
38277
  this.config.enabled = e;
38245
38278
  }
38246
- /**
38247
- * Set volume (0.0 - 1.0)
38248
- */
38249
38279
  setVolume(e) {
38250
38280
  this.config.volume = Math.max(0, Math.min(1, e));
38251
38281
  }
38252
- /**
38253
- * Get current config
38254
- */
38282
+ setPreset(e) {
38283
+ this.config.preset = e;
38284
+ }
38255
38285
  getConfig() {
38256
38286
  return { ...this.config };
38257
38287
  }
38258
- /**
38259
- * Check if sounds are enabled
38260
- */
38261
38288
  isEnabled() {
38262
- return this.config.enabled;
38289
+ return this.config.enabled && this.config.preset !== "none";
38263
38290
  }
38264
- /**
38265
- * Cleanup
38266
- */
38267
38291
  destroy() {
38268
38292
  this.audioContext && (this.audioContext.close(), this.audioContext = null);
38269
38293
  }
@@ -38537,14 +38561,14 @@ function HC(i, e) {
38537
38561
  t.removeEventListener("change", n);
38538
38562
  };
38539
38563
  }
38540
- var wC = Object.defineProperty, AC = Object.getOwnPropertyDescriptor, Et = (i, e, t, n) => {
38564
+ var wC = Object.defineProperty, AC = Object.getOwnPropertyDescriptor, xt = (i, e, t, n) => {
38541
38565
  for (var s = n > 1 ? void 0 : n ? AC(e, t) : e, r = i.length - 1, a; r >= 0; r--)
38542
38566
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
38543
38567
  return n && s && wC(e, t, s), s;
38544
38568
  };
38545
- let gt = class extends ps {
38569
+ let ft = class extends ps {
38546
38570
  constructor() {
38547
- super(...arguments), this.callManager = new Ed(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = id(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !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.15, this.handleAudioTrack = async (i) => {
38571
+ super(...arguments), this.callManager = new Ed(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = id(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !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) => {
38548
38572
  const t = i.detail;
38549
38573
  if (!(!t || !this.audioAnalyzer))
38550
38574
  try {
@@ -38596,7 +38620,7 @@ let gt = class extends ps {
38596
38620
  }
38597
38621
  }, this.toggleCall = async () => {
38598
38622
  var i;
38599
- this.agentId && ((i = this.soundManager) == null || i.prewarm(), this.callStatus === "idle" ? (this.callStatus = "connecting", await this.callManager.makeCall({
38623
+ this.agentId && (await ((i = this.soundManager) == null ? void 0 : i.prewarm()), this.callStatus === "idle" ? (this.callStatus = "connecting", await this.callManager.makeCall({
38600
38624
  agentId: this.agentId
38601
38625
  })) : this.callStatus === "connected" && this.callManager.hangUp());
38602
38626
  };
@@ -38604,7 +38628,8 @@ let gt = class extends ps {
38604
38628
  connectedCallback() {
38605
38629
  super.connectedCallback(), this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), this.soundManager = new zd({
38606
38630
  enabled: this.soundEnabled,
38607
- volume: this.soundVolume
38631
+ volume: this.soundVolume,
38632
+ preset: this.soundPreset
38608
38633
  }), this.callManager.addEventListener(
38609
38634
  "status-changed",
38610
38635
  this.handleStatusChange
@@ -38621,8 +38646,8 @@ let gt = class extends ps {
38621
38646
  this.applyTheme(), this.initializeOrb();
38622
38647
  }
38623
38648
  updated(i) {
38624
- var e, t;
38625
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle"), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume));
38649
+ var e, t, n;
38650
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle"), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
38626
38651
  }
38627
38652
  applyTheme() {
38628
38653
  if (this.theme) {
@@ -38970,95 +38995,98 @@ let gt = class extends ps {
38970
38995
  `;
38971
38996
  }
38972
38997
  };
38973
- gt.styles = Ql`
38998
+ ft.styles = Ql`
38974
38999
  :host {
38975
39000
  display: inline-block;
38976
39001
  contain: layout style;
38977
39002
  }
38978
39003
  `;
38979
- Et([
38980
- Se({ type: String, attribute: "agent-id" })
38981
- ], gt.prototype, "agentId", 2);
38982
- Et([
38983
- Se({ type: String, attribute: "voice-service-url" })
38984
- ], gt.prototype, "voiceServiceUrl", 2);
38985
- Et([
39004
+ xt([
39005
+ ye({ type: String, attribute: "agent-id" })
39006
+ ], ft.prototype, "agentId", 2);
39007
+ xt([
39008
+ ye({ type: String, attribute: "voice-service-url" })
39009
+ ], ft.prototype, "voiceServiceUrl", 2);
39010
+ xt([
38986
39011
  or()
38987
- ], gt.prototype, "callStatus", 2);
38988
- Et([
39012
+ ], ft.prototype, "callStatus", 2);
39013
+ xt([
38989
39014
  or()
38990
- ], gt.prototype, "microphoneEnabled", 2);
38991
- Et([
38992
- Se({ type: String, attribute: "button-start-text" })
38993
- ], gt.prototype, "buttonStartText", 2);
38994
- Et([
38995
- Se({ type: String, attribute: "button-connecting-text" })
38996
- ], gt.prototype, "buttonConnectingText", 2);
38997
- Et([
38998
- Se({ type: Number, attribute: "size" })
38999
- ], gt.prototype, "size", 2);
39000
- Et([
39001
- Se({ type: Number, attribute: "container-padding" })
39002
- ], gt.prototype, "containerPadding", 2);
39003
- Et([
39004
- Se({ type: String, attribute: "theme", reflect: !0 })
39005
- ], gt.prototype, "theme", 2);
39006
- Et([
39007
- Se({ type: String, attribute: "theme-mode" })
39008
- ], gt.prototype, "themeMode", 2);
39009
- Et([
39010
- Se({ type: Object, attribute: "orb-colors" })
39011
- ], gt.prototype, "orbColors", 2);
39012
- Et([
39013
- Se({ type: Number, attribute: "glow-intensity" })
39014
- ], gt.prototype, "glowIntensity", 2);
39015
- Et([
39016
- Se({ type: Number, attribute: "idle-glow-multiplier" })
39017
- ], gt.prototype, "idleGlowMultiplier", 2);
39018
- Et([
39019
- Se({ type: Number, attribute: "morph-strength" })
39020
- ], gt.prototype, "morphStrength", 2);
39021
- Et([
39022
- Se({ type: Number, attribute: "noise-scale" })
39023
- ], gt.prototype, "noiseScale", 2);
39024
- Et([
39025
- Se({ type: Number, attribute: "noise-speed" })
39026
- ], gt.prototype, "noiseSpeed", 2);
39027
- Et([
39028
- Se({ type: Number, attribute: "fresnel-power" })
39029
- ], gt.prototype, "fresnelPower", 2);
39030
- Et([
39031
- Se({ type: Number, attribute: "rotation-speed" })
39032
- ], gt.prototype, "rotationSpeed", 2);
39033
- Et([
39034
- Se({ type: Number, attribute: "audio-reactivity" })
39035
- ], gt.prototype, "audioReactivity", 2);
39036
- Et([
39037
- Se({ type: Number, attribute: "audio-smoothing" })
39038
- ], gt.prototype, "audioSmoothing", 2);
39039
- Et([
39040
- Se({ type: Number, attribute: "idle-morph-multiplier" })
39041
- ], gt.prototype, "idleMorphMultiplier", 2);
39042
- Et([
39043
- Se({ type: Number, attribute: "color-contrast" })
39044
- ], gt.prototype, "colorContrast", 2);
39045
- Et([
39046
- Se({ type: Boolean, attribute: "sound-enabled" })
39047
- ], gt.prototype, "soundEnabled", 2);
39048
- Et([
39049
- Se({ type: Number, attribute: "sound-volume" })
39050
- ], gt.prototype, "soundVolume", 2);
39051
- gt = Et([
39015
+ ], ft.prototype, "microphoneEnabled", 2);
39016
+ xt([
39017
+ ye({ type: String, attribute: "button-start-text" })
39018
+ ], ft.prototype, "buttonStartText", 2);
39019
+ xt([
39020
+ ye({ type: String, attribute: "button-connecting-text" })
39021
+ ], ft.prototype, "buttonConnectingText", 2);
39022
+ xt([
39023
+ ye({ type: Number, attribute: "size" })
39024
+ ], ft.prototype, "size", 2);
39025
+ xt([
39026
+ ye({ type: Number, attribute: "container-padding" })
39027
+ ], ft.prototype, "containerPadding", 2);
39028
+ xt([
39029
+ ye({ type: String, attribute: "theme", reflect: !0 })
39030
+ ], ft.prototype, "theme", 2);
39031
+ xt([
39032
+ ye({ type: String, attribute: "theme-mode" })
39033
+ ], ft.prototype, "themeMode", 2);
39034
+ xt([
39035
+ ye({ type: Object, attribute: "orb-colors" })
39036
+ ], ft.prototype, "orbColors", 2);
39037
+ xt([
39038
+ ye({ type: Number, attribute: "glow-intensity" })
39039
+ ], ft.prototype, "glowIntensity", 2);
39040
+ xt([
39041
+ ye({ type: Number, attribute: "idle-glow-multiplier" })
39042
+ ], ft.prototype, "idleGlowMultiplier", 2);
39043
+ xt([
39044
+ ye({ type: Number, attribute: "morph-strength" })
39045
+ ], ft.prototype, "morphStrength", 2);
39046
+ xt([
39047
+ ye({ type: Number, attribute: "noise-scale" })
39048
+ ], ft.prototype, "noiseScale", 2);
39049
+ xt([
39050
+ ye({ type: Number, attribute: "noise-speed" })
39051
+ ], ft.prototype, "noiseSpeed", 2);
39052
+ xt([
39053
+ ye({ type: Number, attribute: "fresnel-power" })
39054
+ ], ft.prototype, "fresnelPower", 2);
39055
+ xt([
39056
+ ye({ type: Number, attribute: "rotation-speed" })
39057
+ ], ft.prototype, "rotationSpeed", 2);
39058
+ xt([
39059
+ ye({ type: Number, attribute: "audio-reactivity" })
39060
+ ], ft.prototype, "audioReactivity", 2);
39061
+ xt([
39062
+ ye({ type: Number, attribute: "audio-smoothing" })
39063
+ ], ft.prototype, "audioSmoothing", 2);
39064
+ xt([
39065
+ ye({ type: Number, attribute: "idle-morph-multiplier" })
39066
+ ], ft.prototype, "idleMorphMultiplier", 2);
39067
+ xt([
39068
+ ye({ type: Number, attribute: "color-contrast" })
39069
+ ], ft.prototype, "colorContrast", 2);
39070
+ xt([
39071
+ ye({ type: Boolean, attribute: "sound-enabled" })
39072
+ ], ft.prototype, "soundEnabled", 2);
39073
+ xt([
39074
+ ye({ type: Number, attribute: "sound-volume" })
39075
+ ], ft.prototype, "soundVolume", 2);
39076
+ xt([
39077
+ ye({ type: String, attribute: "sound-preset" })
39078
+ ], ft.prototype, "soundPreset", 2);
39079
+ ft = xt([
39052
39080
  nd("hanc-ai-inline-call")
39053
- ], gt);
39054
- var RC = Object.defineProperty, PC = Object.getOwnPropertyDescriptor, Ct = (i, e, t, n) => {
39081
+ ], ft);
39082
+ var RC = Object.defineProperty, PC = Object.getOwnPropertyDescriptor, Tt = (i, e, t, n) => {
39055
39083
  for (var s = n > 1 ? void 0 : n ? PC(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39056
39084
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39057
39085
  return n && s && RC(e, t, s), s;
39058
39086
  };
39059
- let vt = class extends ps {
39087
+ let pt = class extends ps {
39060
39088
  constructor() {
39061
- super(...arguments), this.callManager = new Ed(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = id(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !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.15, this.handleAudioTrack = async (i) => {
39089
+ super(...arguments), this.callManager = new Ed(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = id(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !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) => {
39062
39090
  const t = i.detail;
39063
39091
  if (!(!t || !this.audioAnalyzer))
39064
39092
  try {
@@ -39110,7 +39138,7 @@ let vt = class extends ps {
39110
39138
  }
39111
39139
  }, this.toggleCall = async () => {
39112
39140
  var i;
39113
- this.agentId && ((i = this.soundManager) == null || i.prewarm(), this.callStatus === "idle" ? (this.callStatus = "connecting", await this.callManager.makeCall({
39141
+ this.agentId && (await ((i = this.soundManager) == null ? void 0 : i.prewarm()), this.callStatus === "idle" ? (this.callStatus = "connecting", await this.callManager.makeCall({
39114
39142
  agentId: this.agentId
39115
39143
  })) : this.callStatus === "connected" && this.callManager.hangUp());
39116
39144
  };
@@ -39118,7 +39146,8 @@ let vt = class extends ps {
39118
39146
  connectedCallback() {
39119
39147
  super.connectedCallback(), this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), this.soundManager = new zd({
39120
39148
  enabled: this.soundEnabled,
39121
- volume: this.soundVolume
39149
+ volume: this.soundVolume,
39150
+ preset: this.soundPreset
39122
39151
  }), this.callManager.addEventListener(
39123
39152
  "status-changed",
39124
39153
  this.handleStatusChange
@@ -39135,8 +39164,8 @@ let vt = class extends ps {
39135
39164
  this.applyTheme(), this.initializeOrb();
39136
39165
  }
39137
39166
  updated(i) {
39138
- var e, t;
39139
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle"), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume));
39167
+ var e, t, n;
39168
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle"), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
39140
39169
  }
39141
39170
  applyTheme() {
39142
39171
  if (this.theme) {
@@ -39469,94 +39498,97 @@ let vt = class extends ps {
39469
39498
  `;
39470
39499
  }
39471
39500
  };
39472
- vt.styles = Ql`
39501
+ pt.styles = Ql`
39473
39502
  :host {
39474
39503
  display: block;
39475
39504
  }
39476
39505
  `;
39477
- Ct([
39478
- Se({ type: String, attribute: "agent-id" })
39479
- ], vt.prototype, "agentId", 2);
39480
- Ct([
39481
- Se({ type: String, attribute: "voice-service-url" })
39482
- ], vt.prototype, "voiceServiceUrl", 2);
39483
- Ct([
39506
+ Tt([
39507
+ ye({ type: String, attribute: "agent-id" })
39508
+ ], pt.prototype, "agentId", 2);
39509
+ Tt([
39510
+ ye({ type: String, attribute: "voice-service-url" })
39511
+ ], pt.prototype, "voiceServiceUrl", 2);
39512
+ Tt([
39484
39513
  or()
39485
- ], vt.prototype, "callStatus", 2);
39486
- Ct([
39514
+ ], pt.prototype, "callStatus", 2);
39515
+ Tt([
39487
39516
  or()
39488
- ], vt.prototype, "microphoneEnabled", 2);
39489
- Ct([
39490
- Se({ type: String, attribute: "button-start-text" })
39491
- ], vt.prototype, "buttonStartText", 2);
39492
- Ct([
39493
- Se({ type: String, attribute: "button-connecting-text" })
39494
- ], vt.prototype, "buttonConnectingText", 2);
39495
- Ct([
39496
- Se({ type: String, attribute: "position" })
39497
- ], vt.prototype, "position", 2);
39498
- Ct([
39499
- Se({ type: Number, attribute: "size" })
39500
- ], vt.prototype, "size", 2);
39501
- Ct([
39502
- Se({ type: String, attribute: "theme" })
39503
- ], vt.prototype, "theme", 2);
39504
- Ct([
39505
- Se({ type: String, attribute: "theme-mode" })
39506
- ], vt.prototype, "themeMode", 2);
39507
- Ct([
39508
- Se({ type: Object, attribute: "orb-colors" })
39509
- ], vt.prototype, "orbColors", 2);
39510
- Ct([
39511
- Se({ type: Number, attribute: "glow-intensity" })
39512
- ], vt.prototype, "glowIntensity", 2);
39513
- Ct([
39514
- Se({ type: Number, attribute: "idle-glow-multiplier" })
39515
- ], vt.prototype, "idleGlowMultiplier", 2);
39516
- Ct([
39517
- Se({ type: Number, attribute: "morph-strength" })
39518
- ], vt.prototype, "morphStrength", 2);
39519
- Ct([
39520
- Se({ type: Number, attribute: "noise-scale" })
39521
- ], vt.prototype, "noiseScale", 2);
39522
- Ct([
39523
- Se({ type: Number, attribute: "noise-speed" })
39524
- ], vt.prototype, "noiseSpeed", 2);
39525
- Ct([
39526
- Se({ type: Number, attribute: "fresnel-power" })
39527
- ], vt.prototype, "fresnelPower", 2);
39528
- Ct([
39529
- Se({ type: Number, attribute: "rotation-speed" })
39530
- ], vt.prototype, "rotationSpeed", 2);
39531
- Ct([
39532
- Se({ type: Number, attribute: "audio-reactivity" })
39533
- ], vt.prototype, "audioReactivity", 2);
39534
- Ct([
39535
- Se({ type: Number, attribute: "audio-smoothing" })
39536
- ], vt.prototype, "audioSmoothing", 2);
39537
- Ct([
39538
- Se({ type: Number, attribute: "idle-morph-multiplier" })
39539
- ], vt.prototype, "idleMorphMultiplier", 2);
39540
- Ct([
39541
- Se({ type: Number, attribute: "color-contrast" })
39542
- ], vt.prototype, "colorContrast", 2);
39543
- Ct([
39544
- Se({ type: Boolean, attribute: "sound-enabled" })
39545
- ], vt.prototype, "soundEnabled", 2);
39546
- Ct([
39547
- Se({ type: Number, attribute: "sound-volume" })
39548
- ], vt.prototype, "soundVolume", 2);
39549
- vt = Ct([
39517
+ ], pt.prototype, "microphoneEnabled", 2);
39518
+ Tt([
39519
+ ye({ type: String, attribute: "button-start-text" })
39520
+ ], pt.prototype, "buttonStartText", 2);
39521
+ Tt([
39522
+ ye({ type: String, attribute: "button-connecting-text" })
39523
+ ], pt.prototype, "buttonConnectingText", 2);
39524
+ Tt([
39525
+ ye({ type: String, attribute: "position" })
39526
+ ], pt.prototype, "position", 2);
39527
+ Tt([
39528
+ ye({ type: Number, attribute: "size" })
39529
+ ], pt.prototype, "size", 2);
39530
+ Tt([
39531
+ ye({ type: String, attribute: "theme" })
39532
+ ], pt.prototype, "theme", 2);
39533
+ Tt([
39534
+ ye({ type: String, attribute: "theme-mode" })
39535
+ ], pt.prototype, "themeMode", 2);
39536
+ Tt([
39537
+ ye({ type: Object, attribute: "orb-colors" })
39538
+ ], pt.prototype, "orbColors", 2);
39539
+ Tt([
39540
+ ye({ type: Number, attribute: "glow-intensity" })
39541
+ ], pt.prototype, "glowIntensity", 2);
39542
+ Tt([
39543
+ ye({ type: Number, attribute: "idle-glow-multiplier" })
39544
+ ], pt.prototype, "idleGlowMultiplier", 2);
39545
+ Tt([
39546
+ ye({ type: Number, attribute: "morph-strength" })
39547
+ ], pt.prototype, "morphStrength", 2);
39548
+ Tt([
39549
+ ye({ type: Number, attribute: "noise-scale" })
39550
+ ], pt.prototype, "noiseScale", 2);
39551
+ Tt([
39552
+ ye({ type: Number, attribute: "noise-speed" })
39553
+ ], pt.prototype, "noiseSpeed", 2);
39554
+ Tt([
39555
+ ye({ type: Number, attribute: "fresnel-power" })
39556
+ ], pt.prototype, "fresnelPower", 2);
39557
+ Tt([
39558
+ ye({ type: Number, attribute: "rotation-speed" })
39559
+ ], pt.prototype, "rotationSpeed", 2);
39560
+ Tt([
39561
+ ye({ type: Number, attribute: "audio-reactivity" })
39562
+ ], pt.prototype, "audioReactivity", 2);
39563
+ Tt([
39564
+ ye({ type: Number, attribute: "audio-smoothing" })
39565
+ ], pt.prototype, "audioSmoothing", 2);
39566
+ Tt([
39567
+ ye({ type: Number, attribute: "idle-morph-multiplier" })
39568
+ ], pt.prototype, "idleMorphMultiplier", 2);
39569
+ Tt([
39570
+ ye({ type: Number, attribute: "color-contrast" })
39571
+ ], pt.prototype, "colorContrast", 2);
39572
+ Tt([
39573
+ ye({ type: Boolean, attribute: "sound-enabled" })
39574
+ ], pt.prototype, "soundEnabled", 2);
39575
+ Tt([
39576
+ ye({ type: Number, attribute: "sound-volume" })
39577
+ ], pt.prototype, "soundVolume", 2);
39578
+ Tt([
39579
+ ye({ type: String, attribute: "sound-preset" })
39580
+ ], pt.prototype, "soundPreset", 2);
39581
+ pt = Tt([
39550
39582
  nd("hanc-ai-floating-call")
39551
- ], vt);
39552
- var kC = Object.defineProperty, IC = Object.getOwnPropertyDescriptor, Mt = (i, e, t, n) => {
39583
+ ], pt);
39584
+ var kC = Object.defineProperty, IC = Object.getOwnPropertyDescriptor, Et = (i, e, t, n) => {
39553
39585
  for (var s = n > 1 ? void 0 : n ? IC(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39554
39586
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39555
39587
  return n && s && kC(e, t, s), s;
39556
39588
  };
39557
- let _t = class extends ps {
39589
+ let mt = class extends ps {
39558
39590
  constructor() {
39559
- super(...arguments), this.callManager = new Ed(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = id(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !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.15, this.handleAudioTrack = async (i) => {
39591
+ super(...arguments), this.callManager = new Ed(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = id(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !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) => {
39560
39592
  const t = i.detail;
39561
39593
  if (!(!t || !this.audioAnalyzer))
39562
39594
  try {
@@ -39608,7 +39640,7 @@ let _t = class extends ps {
39608
39640
  }
39609
39641
  }, this.toggleCall = async () => {
39610
39642
  var i;
39611
- this.agentId && ((i = this.soundManager) == null || i.prewarm(), this.callStatus === "idle" ? (this.callStatus = "connecting", await this.callManager.makeCall({
39643
+ this.agentId && (await ((i = this.soundManager) == null ? void 0 : i.prewarm()), this.callStatus === "idle" ? (this.callStatus = "connecting", await this.callManager.makeCall({
39612
39644
  agentId: this.agentId
39613
39645
  })) : this.callStatus === "connected" && this.callManager.hangUp());
39614
39646
  };
@@ -39616,7 +39648,8 @@ let _t = class extends ps {
39616
39648
  connectedCallback() {
39617
39649
  super.connectedCallback(), this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), this.soundManager = new zd({
39618
39650
  enabled: this.soundEnabled,
39619
- volume: this.soundVolume
39651
+ volume: this.soundVolume,
39652
+ preset: this.soundPreset
39620
39653
  }), this.callManager.addEventListener(
39621
39654
  "status-changed",
39622
39655
  this.handleStatusChange
@@ -39633,8 +39666,8 @@ let _t = class extends ps {
39633
39666
  this.applyTheme(), this.initializeOrb();
39634
39667
  }
39635
39668
  updated(i) {
39636
- var e, t;
39637
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle"), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume));
39669
+ var e, t, n;
39670
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle"), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
39638
39671
  }
39639
39672
  applyTheme() {
39640
39673
  if (this.theme) {
@@ -39888,91 +39921,94 @@ let _t = class extends ps {
39888
39921
  `;
39889
39922
  }
39890
39923
  };
39891
- _t.styles = Ql`
39924
+ mt.styles = Ql`
39892
39925
  :host {
39893
39926
  display: inline-block;
39894
39927
  contain: layout style;
39895
39928
  }
39896
39929
  `;
39897
- Mt([
39898
- Se({ type: String, attribute: "agent-id" })
39899
- ], _t.prototype, "agentId", 2);
39900
- Mt([
39901
- Se({ type: String, attribute: "voice-service-url" })
39902
- ], _t.prototype, "voiceServiceUrl", 2);
39903
- Mt([
39930
+ Et([
39931
+ ye({ type: String, attribute: "agent-id" })
39932
+ ], mt.prototype, "agentId", 2);
39933
+ Et([
39934
+ ye({ type: String, attribute: "voice-service-url" })
39935
+ ], mt.prototype, "voiceServiceUrl", 2);
39936
+ Et([
39904
39937
  or()
39905
- ], _t.prototype, "callStatus", 2);
39906
- Mt([
39938
+ ], mt.prototype, "callStatus", 2);
39939
+ Et([
39907
39940
  or()
39908
- ], _t.prototype, "microphoneEnabled", 2);
39909
- Mt([
39910
- Se({ type: String, attribute: "button-start-text" })
39911
- ], _t.prototype, "buttonStartText", 2);
39912
- Mt([
39913
- Se({ type: String, attribute: "button-connecting-text" })
39914
- ], _t.prototype, "buttonConnectingText", 2);
39915
- Mt([
39916
- Se({ type: String, attribute: "button-end-text" })
39917
- ], _t.prototype, "buttonEndText", 2);
39918
- Mt([
39919
- Se({ type: Number, attribute: "orb-size" })
39920
- ], _t.prototype, "orbSize", 2);
39921
- Mt([
39922
- Se({ type: String, attribute: "theme" })
39923
- ], _t.prototype, "theme", 2);
39924
- Mt([
39925
- Se({ type: String, attribute: "theme-mode" })
39926
- ], _t.prototype, "themeMode", 2);
39927
- Mt([
39928
- Se({ type: Object, attribute: "orb-colors" })
39929
- ], _t.prototype, "orbColors", 2);
39930
- Mt([
39931
- Se({ type: Number, attribute: "glow-intensity" })
39932
- ], _t.prototype, "glowIntensity", 2);
39933
- Mt([
39934
- Se({ type: Number, attribute: "idle-glow-multiplier" })
39935
- ], _t.prototype, "idleGlowMultiplier", 2);
39936
- Mt([
39937
- Se({ type: Number, attribute: "morph-strength" })
39938
- ], _t.prototype, "morphStrength", 2);
39939
- Mt([
39940
- Se({ type: Number, attribute: "noise-scale" })
39941
- ], _t.prototype, "noiseScale", 2);
39942
- Mt([
39943
- Se({ type: Number, attribute: "noise-speed" })
39944
- ], _t.prototype, "noiseSpeed", 2);
39945
- Mt([
39946
- Se({ type: Number, attribute: "fresnel-power" })
39947
- ], _t.prototype, "fresnelPower", 2);
39948
- Mt([
39949
- Se({ type: Number, attribute: "rotation-speed" })
39950
- ], _t.prototype, "rotationSpeed", 2);
39951
- Mt([
39952
- Se({ type: Number, attribute: "audio-reactivity" })
39953
- ], _t.prototype, "audioReactivity", 2);
39954
- Mt([
39955
- Se({ type: Number, attribute: "audio-smoothing" })
39956
- ], _t.prototype, "audioSmoothing", 2);
39957
- Mt([
39958
- Se({ type: Number, attribute: "idle-morph-multiplier" })
39959
- ], _t.prototype, "idleMorphMultiplier", 2);
39960
- Mt([
39961
- Se({ type: Number, attribute: "color-contrast" })
39962
- ], _t.prototype, "colorContrast", 2);
39963
- Mt([
39964
- Se({ type: Boolean, attribute: "sound-enabled" })
39965
- ], _t.prototype, "soundEnabled", 2);
39966
- Mt([
39967
- Se({ type: Number, attribute: "sound-volume" })
39968
- ], _t.prototype, "soundVolume", 2);
39969
- _t = Mt([
39941
+ ], mt.prototype, "microphoneEnabled", 2);
39942
+ Et([
39943
+ ye({ type: String, attribute: "button-start-text" })
39944
+ ], mt.prototype, "buttonStartText", 2);
39945
+ Et([
39946
+ ye({ type: String, attribute: "button-connecting-text" })
39947
+ ], mt.prototype, "buttonConnectingText", 2);
39948
+ Et([
39949
+ ye({ type: String, attribute: "button-end-text" })
39950
+ ], mt.prototype, "buttonEndText", 2);
39951
+ Et([
39952
+ ye({ type: Number, attribute: "orb-size" })
39953
+ ], mt.prototype, "orbSize", 2);
39954
+ Et([
39955
+ ye({ type: String, attribute: "theme" })
39956
+ ], mt.prototype, "theme", 2);
39957
+ Et([
39958
+ ye({ type: String, attribute: "theme-mode" })
39959
+ ], mt.prototype, "themeMode", 2);
39960
+ Et([
39961
+ ye({ type: Object, attribute: "orb-colors" })
39962
+ ], mt.prototype, "orbColors", 2);
39963
+ Et([
39964
+ ye({ type: Number, attribute: "glow-intensity" })
39965
+ ], mt.prototype, "glowIntensity", 2);
39966
+ Et([
39967
+ ye({ type: Number, attribute: "idle-glow-multiplier" })
39968
+ ], mt.prototype, "idleGlowMultiplier", 2);
39969
+ Et([
39970
+ ye({ type: Number, attribute: "morph-strength" })
39971
+ ], mt.prototype, "morphStrength", 2);
39972
+ Et([
39973
+ ye({ type: Number, attribute: "noise-scale" })
39974
+ ], mt.prototype, "noiseScale", 2);
39975
+ Et([
39976
+ ye({ type: Number, attribute: "noise-speed" })
39977
+ ], mt.prototype, "noiseSpeed", 2);
39978
+ Et([
39979
+ ye({ type: Number, attribute: "fresnel-power" })
39980
+ ], mt.prototype, "fresnelPower", 2);
39981
+ Et([
39982
+ ye({ type: Number, attribute: "rotation-speed" })
39983
+ ], mt.prototype, "rotationSpeed", 2);
39984
+ Et([
39985
+ ye({ type: Number, attribute: "audio-reactivity" })
39986
+ ], mt.prototype, "audioReactivity", 2);
39987
+ Et([
39988
+ ye({ type: Number, attribute: "audio-smoothing" })
39989
+ ], mt.prototype, "audioSmoothing", 2);
39990
+ Et([
39991
+ ye({ type: Number, attribute: "idle-morph-multiplier" })
39992
+ ], mt.prototype, "idleMorphMultiplier", 2);
39993
+ Et([
39994
+ ye({ type: Number, attribute: "color-contrast" })
39995
+ ], mt.prototype, "colorContrast", 2);
39996
+ Et([
39997
+ ye({ type: Boolean, attribute: "sound-enabled" })
39998
+ ], mt.prototype, "soundEnabled", 2);
39999
+ Et([
40000
+ ye({ type: Number, attribute: "sound-volume" })
40001
+ ], mt.prototype, "soundVolume", 2);
40002
+ Et([
40003
+ ye({ type: String, attribute: "sound-preset" })
40004
+ ], mt.prototype, "soundPreset", 2);
40005
+ mt = Et([
39970
40006
  nd("hanc-ai-pill-call")
39971
- ], _t);
40007
+ ], mt);
39972
40008
  export {
39973
- vt as FloatingCall,
39974
- gt as InlineCall,
39975
- _t as PillCall,
40009
+ pt as FloatingCall,
40010
+ ft as InlineCall,
40011
+ mt as PillCall,
39976
40012
  zd as SoundManager,
39977
40013
  MC as applyTheme,
39978
40014
  fi as darkPresets,