hanc-webrtc-widgets 2.6.20 → 2.7.1

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.
@@ -75,7 +75,7 @@ const { is: vc, defineProperty: Jc, getOwnPropertyDescriptor: Yc, getOwnProperty
75
75
  return e;
76
76
  } }, Pn = (g, A) => !vc(g, A), vs = { attribute: !0, type: String, converter: lo, reflect: !1, hasChanged: Pn };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), ai.litPropertyMetadata ?? (ai.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
- let oI = class extends HTMLElement {
78
+ let aI = class extends HTMLElement {
79
79
  static addInitializer(A) {
80
80
  this._$Ei(), (this.l ?? (this.l = [])).push(A);
81
81
  }
@@ -273,7 +273,7 @@ let oI = class extends HTMLElement {
273
273
  firstUpdated(A) {
274
274
  }
275
275
  };
276
- oI.elementStyles = [], oI.shadowRootOptions = { mode: "open" }, oI[$I("elementProperties")] = /* @__PURE__ */ new Map(), oI[$I("finalized")] = /* @__PURE__ */ new Map(), Qa == null || Qa({ ReactiveElement: oI }), (ai.reactiveElementVersions ?? (ai.reactiveElementVersions = [])).push("2.0.4");
276
+ aI.elementStyles = [], aI.shadowRootOptions = { mode: "open" }, aI[$I("elementProperties")] = /* @__PURE__ */ new Map(), aI[$I("finalized")] = /* @__PURE__ */ new Map(), Qa == null || Qa({ ReactiveElement: aI }), (ai.reactiveElementVersions ?? (ai.reactiveElementVersions = [])).push("2.0.4");
277
277
  /**
278
278
  * @license
279
279
  * Copyright 2017 Google LLC
@@ -281,7 +281,7 @@ oI.elementStyles = [], oI.shadowRootOptions = { mode: "open" }, oI[$I("elementPr
281
281
  */
282
282
  const AC = globalThis, fo = AC.trustedTypes, Js = fo ? fo.createPolicy("lit-html", { createHTML: (g) => g }) : void 0, XE = "$lit$", ti = `lit$${Math.random().toFixed(9).slice(2)}$`, ZE = "?" + ti, Oc = `<${ZE}>`, Fi = document, CC = () => Fi.createComment(""), oC = (g) => g === null || typeof g != "object" && typeof g != "function", On = Array.isArray, Vc = (g) => On(g) || typeof (g == null ? void 0 : g[Symbol.iterator]) == "function", na = `[
283
283
  \f\r]`, MI = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ys = /-->/g, Ts = />/g, xi = RegExp(`>|${na}(?:([^\\s"'>=/]+)(${na}*=${na}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), qs = /'/g, Hs = /"/g, zE = /^(?:script|style|textarea|title)$/i, jc = (g) => (A, ...e) => ({ _$litType$: g, strings: A, values: e }), ee = jc(1), lI = Symbol.for("lit-noChange"), Me = Symbol.for("lit-nothing"), Ps = /* @__PURE__ */ new WeakMap(), ki = Fi.createTreeWalker(Fi, 129);
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), qs = /'/g, Hs = /"/g, zE = /^(?:script|style|textarea|title)$/i, jc = (g) => (A, ...e) => ({ _$litType$: g, strings: A, values: e }), ee = jc(1), fI = Symbol.for("lit-noChange"), Me = Symbol.for("lit-nothing"), Ps = /* @__PURE__ */ new WeakMap(), ki = Fi.createTreeWalker(Fi, 129);
285
285
  function $E(g, A) {
286
286
  if (!On(g) || !g.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
287
  return Js !== void 0 ? Js.createHTML(A) : A;
@@ -335,12 +335,12 @@ class aC {
335
335
  return t.innerHTML = A, t;
336
336
  }
337
337
  }
338
- function fI(g, A, e = g, t) {
338
+ function uI(g, A, e = g, t) {
339
339
  var C, o;
340
- if (A === lI) return A;
340
+ if (A === fI) return A;
341
341
  let i = t !== void 0 ? (C = e._$Co) == null ? void 0 : C[t] : e._$Cl;
342
342
  const I = oC(A) ? void 0 : A._$litDirective$;
343
- return (i == null ? void 0 : i.constructor) !== I && ((o = i == null ? void 0 : i._$AO) == null || o.call(i, !1), I === void 0 ? i = void 0 : (i = new I(g), i._$AT(g, e, t)), t !== void 0 ? (e._$Co ?? (e._$Co = []))[t] = i : e._$Cl = i), i !== void 0 && (A = fI(g, i._$AS(g, A.values), i, t)), A;
343
+ return (i == null ? void 0 : i.constructor) !== I && ((o = i == null ? void 0 : i._$AO) == null || o.call(i, !1), I === void 0 ? i = void 0 : (i = new I(g), i._$AT(g, e, t)), t !== void 0 ? (e._$Co ?? (e._$Co = []))[t] = i : e._$Cl = i), i !== void 0 && (A = uI(g, i._$AS(g, A.values), i, t)), A;
344
344
  }
345
345
  let Xc = class {
346
346
  constructor(A, e) {
@@ -390,7 +390,7 @@ class xC {
390
390
  return this._$AB;
391
391
  }
392
392
  _$AI(A, e = this) {
393
- A = fI(this, A, e), oC(A) ? A === Me || A == null || A === "" ? (this._$AH !== Me && this._$AR(), this._$AH = Me) : A !== this._$AH && A !== lI && this._(A) : A._$litType$ !== void 0 ? this.$(A) : A.nodeType !== void 0 ? this.T(A) : Vc(A) ? this.k(A) : this._(A);
393
+ A = uI(this, A, e), oC(A) ? A === Me || A == null || A === "" ? (this._$AH !== Me && this._$AR(), this._$AH = Me) : A !== this._$AH && A !== fI && this._(A) : A._$litType$ !== void 0 ? this.$(A) : A.nodeType !== void 0 ? this.T(A) : Vc(A) ? this.k(A) : this._(A);
394
394
  }
395
395
  O(A) {
396
396
  return this._$AA.parentNode.insertBefore(A, this._$AB);
@@ -446,11 +446,11 @@ let Lo = class {
446
446
  _$AI(A, e = this, t, i) {
447
447
  const I = this.strings;
448
448
  let C = !1;
449
- if (I === void 0) A = fI(this, A, e, 0), C = !oC(A) || A !== this._$AH && A !== lI, C && (this._$AH = A);
449
+ if (I === void 0) A = uI(this, A, e, 0), C = !oC(A) || A !== this._$AH && A !== fI, C && (this._$AH = A);
450
450
  else {
451
451
  const o = A;
452
452
  let a, Q;
453
- for (A = I[0], a = 0; a < I.length - 1; a++) Q = fI(this, o[t + a], e, a), Q === lI && (Q = this._$AH[a]), C || (C = !oC(Q) || Q !== this._$AH[a]), Q === Me ? A = Me : A !== Me && (A += (Q ?? "") + I[a + 1]), this._$AH[a] = Q;
453
+ for (A = I[0], a = 0; a < I.length - 1; a++) Q = uI(this, o[t + a], e, a), Q === fI && (Q = this._$AH[a]), C || (C = !oC(Q) || Q !== this._$AH[a]), Q === Me ? A = Me : A !== Me && (A += (Q ?? "") + I[a + 1]), this._$AH[a] = Q;
454
454
  }
455
455
  C && !i && this.j(A);
456
456
  }
@@ -478,7 +478,7 @@ class $c extends Lo {
478
478
  super(A, e, t, i, I), this.type = 5;
479
479
  }
480
480
  _$AI(A, e = this) {
481
- if ((A = fI(this, A, e, 0) ?? Me) === lI) return;
481
+ if ((A = uI(this, A, e, 0) ?? Me) === fI) return;
482
482
  const t = this._$AH, i = A === Me && t !== Me || A.capture !== t.capture || A.once !== t.once || A.passive !== t.passive, I = A !== Me && (t === Me || i);
483
483
  i && this.element.removeEventListener(this.name, this, t), I && this.element.addEventListener(this.name, this, A), this._$AH = A;
484
484
  }
@@ -495,7 +495,7 @@ class Ah {
495
495
  return this._$AM._$AU;
496
496
  }
497
497
  _$AI(A) {
498
- fI(this, A);
498
+ uI(this, A);
499
499
  }
500
500
  }
501
501
  const sa = AC.litHtmlPolyfillSupport;
@@ -514,7 +514,7 @@ const eh = (g, A, e) => {
514
514
  * Copyright 2017 Google LLC
515
515
  * SPDX-License-Identifier: BSD-3-Clause
516
516
  */
517
- let ng = class extends oI {
517
+ let ng = class extends aI {
518
518
  constructor() {
519
519
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
520
520
  }
@@ -536,7 +536,7 @@ let ng = class extends oI {
536
536
  super.disconnectedCallback(), (A = this._$Do) == null || A.setConnected(!1);
537
537
  }
538
538
  render() {
539
- return lI;
539
+ return fI;
540
540
  }
541
541
  };
542
542
  var jE;
@@ -1140,7 +1140,7 @@ function Pg(g, A, e) {
1140
1140
  }
1141
1141
  return !1;
1142
1142
  }
1143
- function uI(g, A) {
1143
+ function DI(g, A) {
1144
1144
  switch (g) {
1145
1145
  case AA.BOOL:
1146
1146
  return !1;
@@ -1514,7 +1514,7 @@ function Rh(g) {
1514
1514
  case "enum":
1515
1515
  return A.T.values[0].no;
1516
1516
  case "scalar":
1517
- return uI(A.T, A.L);
1517
+ return DI(A.T, A.L);
1518
1518
  case "message":
1519
1519
  const e = A.T, t = new e();
1520
1520
  return e.fieldWrapper ? e.fieldWrapper.unwrapField(t) : t;
@@ -1674,7 +1674,7 @@ function Xs(g, A) {
1674
1674
  A[e] = t ? g.T.values[0].no : void 0;
1675
1675
  break;
1676
1676
  case "scalar":
1677
- A[e] = t ? uI(g.T, g.L) : void 0;
1677
+ A[e] = t ? DI(g.T, g.L) : void 0;
1678
1678
  break;
1679
1679
  case "message":
1680
1680
  A[e] = void 0;
@@ -1913,7 +1913,7 @@ function vh(g, A) {
1913
1913
  }
1914
1914
  function tC(g, A, e, t) {
1915
1915
  if (A === null)
1916
- return t ? uI(g, e) : Do;
1916
+ return t ? DI(g, e) : Do;
1917
1917
  switch (g) {
1918
1918
  // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
1919
1919
  // Either numbers or strings are accepted. Exponent notation is also accepted.
@@ -2085,7 +2085,7 @@ function eo(g, A) {
2085
2085
  return Ke(A instanceof Uint8Array), nr.enc(A);
2086
2086
  }
2087
2087
  }
2088
- const Hi = Symbol("@bufbuild/protobuf/unknown-fields"), eB = {
2088
+ const Pi = Symbol("@bufbuild/protobuf/unknown-fields"), eB = {
2089
2089
  readUnknownFields: !0,
2090
2090
  readerFactory: (g) => new Sh(g)
2091
2091
  }, tB = {
@@ -2104,20 +2104,20 @@ function qh() {
2104
2104
  makeWriteOptions: Th,
2105
2105
  listUnknownFields(g) {
2106
2106
  var A;
2107
- return (A = g[Hi]) !== null && A !== void 0 ? A : [];
2107
+ return (A = g[Pi]) !== null && A !== void 0 ? A : [];
2108
2108
  },
2109
2109
  discardUnknownFields(g) {
2110
- delete g[Hi];
2110
+ delete g[Pi];
2111
2111
  },
2112
2112
  writeUnknownFields(g, A) {
2113
- const t = g[Hi];
2113
+ const t = g[Pi];
2114
2114
  if (t)
2115
2115
  for (const i of t)
2116
2116
  A.tag(i.no, i.wireType).raw(i.data);
2117
2117
  },
2118
2118
  onUnknownField(g, A, e, t) {
2119
2119
  const i = g;
2120
- Array.isArray(i[Hi]) || (i[Hi] = []), i[Hi].push({
2120
+ Array.isArray(i[Pi]) || (i[Pi] = []), i[Pi].push({
2121
2121
  no: A,
2122
2122
  wireType: e,
2123
2123
  data: t
@@ -2224,10 +2224,10 @@ function Hh(g, A, e) {
2224
2224
  break;
2225
2225
  }
2226
2226
  }
2227
- if (I === void 0 && (I = uI(g.K, si.BIGINT)), typeof I != "string" && typeof I != "number" && (I = I.toString()), C === void 0)
2227
+ if (I === void 0 && (I = DI(g.K, si.BIGINT)), typeof I != "string" && typeof I != "number" && (I = I.toString()), C === void 0)
2228
2228
  switch (g.V.kind) {
2229
2229
  case "scalar":
2230
- C = uI(g.V.T, si.BIGINT);
2230
+ C = DI(g.V.T, si.BIGINT);
2231
2231
  break;
2232
2232
  case "enum":
2233
2233
  C = g.V.T.values[0].no;
@@ -2699,7 +2699,7 @@ const Y = Wh(
2699
2699
  t[e] = {};
2700
2700
  break;
2701
2701
  case "scalar":
2702
- t[e] = uI(A.T, A.L);
2702
+ t[e] = DI(A.T, A.L);
2703
2703
  break;
2704
2704
  }
2705
2705
  }
@@ -3019,7 +3019,7 @@ const Id = /* @__PURE__ */ Y.makeMessageType("livekit.MetricsBatch", () => [{
3019
3019
  }, {
3020
3020
  no: 15,
3021
3021
  name: "MEDIA_FAILURE"
3022
- }]), Pi = /* @__PURE__ */ Y.makeEnum("livekit.ReconnectReason", [{
3022
+ }]), Oi = /* @__PURE__ */ Y.makeEnum("livekit.ReconnectReason", [{
3023
3023
  no: 0,
3024
3024
  name: "RR_UNKNOWN"
3025
3025
  }, {
@@ -3229,12 +3229,12 @@ const Id = /* @__PURE__ */ Y.makeMessageType("livekit.MetricsBatch", () => [{
3229
3229
  no: 3,
3230
3230
  name: "state",
3231
3231
  kind: "enum",
3232
- T: Y.getEnumType(sI)
3232
+ T: Y.getEnumType(BI)
3233
3233
  }, {
3234
3234
  no: 4,
3235
3235
  name: "tracks",
3236
3236
  kind: "message",
3237
- T: aI,
3237
+ T: QI,
3238
3238
  repeated: !0
3239
3239
  }, {
3240
3240
  no: 5,
@@ -3309,7 +3309,7 @@ const Id = /* @__PURE__ */ Y.makeMessageType("livekit.MetricsBatch", () => [{
3309
3309
  kind: "enum",
3310
3310
  T: Y.getEnumType(sd),
3311
3311
  repeated: !0
3312
- }]), sI = /* @__PURE__ */ Y.makeEnum("livekit.ParticipantInfo.State", [{
3312
+ }]), BI = /* @__PURE__ */ Y.makeEnum("livekit.ParticipantInfo.State", [{
3313
3313
  no: 0,
3314
3314
  name: "JOINING"
3315
3315
  }, {
@@ -3375,7 +3375,7 @@ const Id = /* @__PURE__ */ Y.makeMessageType("livekit.MetricsBatch", () => [{
3375
3375
  kind: "message",
3376
3376
  T: Mi,
3377
3377
  repeated: !0
3378
- }]), aI = /* @__PURE__ */ Y.makeMessageType("livekit.TrackInfo", () => [{
3378
+ }]), QI = /* @__PURE__ */ Y.makeMessageType("livekit.TrackInfo", () => [{
3379
3379
  no: 1,
3380
3380
  name: "sid",
3381
3381
  kind: "scalar",
@@ -4803,7 +4803,7 @@ const Id = /* @__PURE__ */ Y.makeMessageType("livekit.MetricsBatch", () => [{
4803
4803
  no: 2,
4804
4804
  name: "track",
4805
4805
  kind: "message",
4806
- T: aI
4806
+ T: QI
4807
4807
  }]), Dd = /* @__PURE__ */ Y.makeMessageType("livekit.TrackUnpublishedResponse", () => [{
4808
4808
  no: 1,
4809
4809
  name: "track_sid",
@@ -4938,13 +4938,13 @@ const Id = /* @__PURE__ */ Y.makeMessageType("livekit.MetricsBatch", () => [{
4938
4938
  no: 3,
4939
4939
  name: "action",
4940
4940
  kind: "enum",
4941
- T: Y.getEnumType(BI)
4941
+ T: Y.getEnumType(EI)
4942
4942
  }, {
4943
4943
  no: 4,
4944
4944
  name: "regions",
4945
4945
  kind: "message",
4946
4946
  T: Ud
4947
- }]), BI = /* @__PURE__ */ Y.makeEnum("livekit.LeaveRequest.Action", [{
4947
+ }]), EI = /* @__PURE__ */ Y.makeEnum("livekit.LeaveRequest.Action", [{
4948
4948
  no: 0,
4949
4949
  name: "DISCONNECT"
4950
4950
  }, {
@@ -5843,7 +5843,7 @@ function WI(g, A, e) {
5843
5843
  const t = g.match(A);
5844
5844
  return t && t.length >= e && parseFloat(t[e], 10);
5845
5845
  }
5846
- function Ti(g, A, e) {
5846
+ function qi(g, A, e) {
5847
5847
  if (!g.RTCPeerConnection)
5848
5848
  return;
5849
5849
  const t = g.RTCPeerConnection.prototype, i = t.addEventListener;
@@ -6091,7 +6091,7 @@ function zr(g) {
6091
6091
  }, this.addEventListener("addstream", this._ontrackpoly)), A.apply(this, arguments);
6092
6092
  };
6093
6093
  } else
6094
- Ti(g, "track", (A) => (A.transceiver || Object.defineProperty(A, "transceiver", {
6094
+ qi(g, "track", (A) => (A.transceiver || Object.defineProperty(A, "transceiver", {
6095
6095
  value: {
6096
6096
  receiver: A.receiver
6097
6097
  }
@@ -6178,7 +6178,7 @@ function A0(g) {
6178
6178
  e && (g.RTCPeerConnection.prototype.getReceivers = function() {
6179
6179
  const i = e.apply(this, []);
6180
6180
  return i.forEach((I) => I._pc = this), i;
6181
- }), Ti(g, "track", (t) => (t.receiver._pc = t.srcElement, t)), g.RTCRtpReceiver.prototype.getStats = function() {
6181
+ }), qi(g, "track", (t) => (t.receiver._pc = t.srcElement, t)), g.RTCRtpReceiver.prototype.getStats = function() {
6182
6182
  const i = this;
6183
6183
  return this._pc.getStats().then((I) => BB(I, i.track, !1));
6184
6184
  };
@@ -6345,7 +6345,7 @@ function DQ(g, A) {
6345
6345
  });
6346
6346
  }
6347
6347
  function g0(g, A) {
6348
- Ti(g, "negotiationneeded", (e) => {
6348
+ qi(g, "negotiationneeded", (e) => {
6349
6349
  const t = e.target;
6350
6350
  if (!((A.version < 72 || t.getConfiguration && t.getConfiguration().sdpSemantics === "plan-b") && t.signalingState !== "stable"))
6351
6351
  return e;
@@ -6470,7 +6470,7 @@ function o0(g) {
6470
6470
  A && (g.RTCPeerConnection.prototype.getReceivers = function() {
6471
6471
  const t = A.apply(this, []);
6472
6472
  return t.forEach((i) => i._pc = this), t;
6473
- }), Ti(g, "track", (e) => (e.receiver._pc = e.srcElement, e)), g.RTCRtpReceiver.prototype.getStats = function() {
6473
+ }), qi(g, "track", (e) => (e.receiver._pc = e.srcElement, e)), g.RTCRtpReceiver.prototype.getStats = function() {
6474
6474
  return this._pc.getStats(this.track);
6475
6475
  };
6476
6476
  }
@@ -7094,9 +7094,9 @@ t=0 0\r
7094
7094
  }, g.exports = A;
7095
7095
  }(da)), da.exports;
7096
7096
  }
7097
- var _0 = $d(), EI = /* @__PURE__ */ Yd(_0), Ax = /* @__PURE__ */ Eh({
7097
+ var _0 = $d(), rI = /* @__PURE__ */ Yd(_0), Ax = /* @__PURE__ */ Eh({
7098
7098
  __proto__: null,
7099
- default: EI
7099
+ default: rI
7100
7100
  }, [_0]);
7101
7101
  function io(g) {
7102
7102
  if (!g.RTCIceCandidate || g.RTCIceCandidate && "foundation" in g.RTCIceCandidate.prototype)
@@ -7104,7 +7104,7 @@ function io(g) {
7104
7104
  const A = g.RTCIceCandidate;
7105
7105
  g.RTCIceCandidate = function(t) {
7106
7106
  if (typeof t == "object" && t.candidate && t.candidate.indexOf("a=") === 0 && (t = JSON.parse(JSON.stringify(t)), t.candidate = t.candidate.substring(2)), t.candidate && t.candidate.length) {
7107
- const i = new A(t), I = EI.parseCandidate(t.candidate);
7107
+ const i = new A(t), I = rI.parseCandidate(t.candidate);
7108
7108
  for (const C in I)
7109
7109
  C in i || Object.defineProperty(i, C, {
7110
7110
  value: I[C]
@@ -7119,15 +7119,15 @@ function io(g) {
7119
7119
  }, i;
7120
7120
  }
7121
7121
  return new A(t);
7122
- }, g.RTCIceCandidate.prototype = A.prototype, Ti(g, "icecandidate", (e) => (e.candidate && Object.defineProperty(e, "candidate", {
7122
+ }, g.RTCIceCandidate.prototype = A.prototype, qi(g, "icecandidate", (e) => (e.candidate && Object.defineProperty(e, "candidate", {
7123
7123
  value: new g.RTCIceCandidate(e.candidate),
7124
7124
  writable: "false"
7125
7125
  }), e));
7126
7126
  }
7127
7127
  function pQ(g) {
7128
- !g.RTCIceCandidate || g.RTCIceCandidate && "relayProtocol" in g.RTCIceCandidate.prototype || Ti(g, "icecandidate", (A) => {
7128
+ !g.RTCIceCandidate || g.RTCIceCandidate && "relayProtocol" in g.RTCIceCandidate.prototype || qi(g, "icecandidate", (A) => {
7129
7129
  if (A.candidate) {
7130
- const e = EI.parseCandidate(A.candidate.candidate);
7130
+ const e = rI.parseCandidate(A.candidate.candidate);
7131
7131
  e.type === "relay" && (A.candidate.relayProtocol = {
7132
7132
  0: "tls",
7133
7133
  1: "tcp",
@@ -7148,9 +7148,9 @@ function Io(g, A) {
7148
7148
  const e = function(o) {
7149
7149
  if (!o || !o.sdp)
7150
7150
  return !1;
7151
- const a = EI.splitSections(o.sdp);
7151
+ const a = rI.splitSections(o.sdp);
7152
7152
  return a.shift(), a.some((Q) => {
7153
- const n = EI.parseMLine(Q);
7153
+ const n = rI.parseMLine(Q);
7154
7154
  return n && n.kind === "application" && n.protocol.indexOf("SCTP") !== -1;
7155
7155
  });
7156
7156
  }, t = function(o) {
@@ -7165,7 +7165,7 @@ function Io(g, A) {
7165
7165
  }, I = function(o, a) {
7166
7166
  let Q = 65536;
7167
7167
  A.browser === "firefox" && A.version === 57 && (Q = 65535);
7168
- const n = EI.matchPrefix(o.sdp, "a=max-message-size:");
7168
+ const n = rI.matchPrefix(o.sdp, "a=max-message-size:");
7169
7169
  return n.length > 0 ? Q = parseInt(n[0].substring(19), 10) : A.browser === "firefox" && a !== -1 && (Q = 2147483637), Q;
7170
7170
  }, C = g.RTCPeerConnection.prototype.setRemoteDescription;
7171
7171
  g.RTCPeerConnection.prototype.setRemoteDescription = function() {
@@ -7211,7 +7211,7 @@ function Co(g) {
7211
7211
  g.RTCPeerConnection.prototype.createDataChannel = function() {
7212
7212
  const i = e.apply(this, arguments);
7213
7213
  return A(i, this), i;
7214
- }, Ti(g, "datachannel", (t) => (A(t.channel, t.target), t));
7214
+ }, qi(g, "datachannel", (t) => (A(t.channel, t.target), t));
7215
7215
  }
7216
7216
  function wQ(g) {
7217
7217
  if (!g.RTCPeerConnection || "connectionState" in g.RTCPeerConnection.prototype)
@@ -7644,7 +7644,7 @@ class $ extends lg.EventEmitter {
7644
7644
  let e = "audio";
7645
7645
  this.kind === $.Kind.Video && (e = "video"), this.attachedElements.length === 0 && this.kind === $.Kind.Video && this.addAppVisibilityListener(), A || (e === "audio" && (KI.forEach((I) => {
7646
7646
  I.parentElement === null && !A && (A = I);
7647
- }), A && KI.splice(KI.indexOf(A), 1)), A || (A = document.createElement(e))), this.attachedElements.includes(A) || this.attachedElements.push(A), QI(this.mediaStreamTrack, A);
7647
+ }), A && KI.splice(KI.indexOf(A), 1)), A || (A = document.createElement(e))), this.attachedElements.includes(A) || this.attachedElements.push(A), nI(this.mediaStreamTrack, A);
7648
7648
  const t = A.srcObject.getTracks(), i = t.some((I) => I.kind === "audio");
7649
7649
  return A.play().then(() => {
7650
7650
  this.emit(i ? CA.AudioPlaybackStarted : CA.VideoPlaybackStarted);
@@ -7656,13 +7656,13 @@ class $ extends lg.EventEmitter {
7656
7656
  detach(A) {
7657
7657
  try {
7658
7658
  if (A) {
7659
- rI(this.mediaStreamTrack, A);
7659
+ cI(this.mediaStreamTrack, A);
7660
7660
  const t = this.attachedElements.indexOf(A);
7661
7661
  return t >= 0 && (this.attachedElements.splice(t, 1), this.recycleElement(A), this.emit(CA.ElementDetached, A)), A;
7662
7662
  }
7663
7663
  const e = [];
7664
7664
  return this.attachedElements.forEach((t) => {
7665
- rI(this.mediaStreamTrack, t), e.push(t), this.recycleElement(t), this.emit(CA.ElementDetached, t);
7665
+ cI(this.mediaStreamTrack, t), e.push(t), this.recycleElement(t), this.emit(CA.ElementDetached, t);
7666
7666
  }), this.attachedElements = [], e;
7667
7667
  } finally {
7668
7668
  this.attachedElements.length === 0 && this.removeAppVisibilityListener();
@@ -7706,7 +7706,7 @@ class $ extends lg.EventEmitter {
7706
7706
  lt() && document.removeEventListener("visibilitychange", this.appVisibilityChangedListener);
7707
7707
  }
7708
7708
  }
7709
- function QI(g, A) {
7709
+ function nI(g, A) {
7710
7710
  let e;
7711
7711
  A.srcObject instanceof MediaStream ? e = A.srcObject : e = new MediaStream();
7712
7712
  let t;
@@ -7717,7 +7717,7 @@ function QI(g, A) {
7717
7717
  });
7718
7718
  }, 0));
7719
7719
  }
7720
- function rI(g, A) {
7720
+ function cI(g, A) {
7721
7721
  if (A.srcObject instanceof MediaStream) {
7722
7722
  const e = A.srcObject;
7723
7723
  e.removeTrack(g), e.getTracks().length > 0 ? A.srcObject = e : A.srcObject = null;
@@ -8147,7 +8147,7 @@ function no(g) {
8147
8147
  function wi(g) {
8148
8148
  return g !== void 0 ? BigInt(g) : void 0;
8149
8149
  }
8150
- function cI(g) {
8150
+ function hI(g) {
8151
8151
  return !!g && !(g instanceof MediaStreamTrack) && g.isLocal;
8152
8152
  }
8153
8153
  function sg(g) {
@@ -8157,10 +8157,10 @@ function Ei(g) {
8157
8157
  return !!g && g.kind == $.Kind.Video;
8158
8158
  }
8159
8159
  function Og(g) {
8160
- return cI(g) && Ei(g);
8160
+ return hI(g) && Ei(g);
8161
8161
  }
8162
8162
  function mg(g) {
8163
- return cI(g) && sg(g);
8163
+ return hI(g) && sg(g);
8164
8164
  }
8165
8165
  function UQ(g) {
8166
8166
  return !!g && !g.isLocal;
@@ -8593,7 +8593,7 @@ class Hx extends lg.EventEmitter {
8593
8593
  }
8594
8594
  }
8595
8595
  setupE2EESender(A, e) {
8596
- if (!cI(A) || !e) {
8596
+ if (!hI(A) || !e) {
8597
8597
  e || te.warn("early return because sender is not ready");
8598
8598
  return;
8599
8599
  }
@@ -9085,7 +9085,7 @@ class Is {
9085
9085
  value: new qo({
9086
9086
  reason: Wt.CLIENT_INITIATED,
9087
9087
  // server doesn't process this field, keeping it here to indicate the intent of a full disconnect
9088
- action: BI.DISCONNECT
9088
+ action: EI.DISCONNECT
9089
9089
  })
9090
9090
  });
9091
9091
  }
@@ -9945,7 +9945,7 @@ function os(g, A, e) {
9945
9945
  }), n = [];
9946
9946
  }, B;
9947
9947
  }
9948
- const tl = 0.7, gl = 20, hI = {
9948
+ const tl = 0.7, gl = 20, dI = {
9949
9949
  NegotiationStarted: "negotiationStarted",
9950
9950
  NegotiationComplete: "negotiationComplete",
9951
9951
  RTPVideoPayloadTypes: "rtpVideoPayloadTypes"
@@ -9958,7 +9958,7 @@ class LB extends lg.EventEmitter {
9958
9958
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
9959
9959
  var t;
9960
9960
  super(), this.log = te, this.ddExtID = 0, this.latestOfferId = 0, this.pendingCandidates = [], this.restartingIce = !1, this.renegotiate = !1, this.trackBitrates = [], this.remoteStereoMids = [], this.remoteNackMids = [], this.negotiate = os((i) => S(this, void 0, void 0, function* () {
9961
- this.emit(hI.NegotiationStarted);
9961
+ this.emit(dI.NegotiationStarted);
9962
9962
  try {
9963
9963
  yield this.createAndSendOffer();
9964
9964
  } catch (I) {
@@ -10049,8 +10049,8 @@ class LB extends lg.EventEmitter {
10049
10049
  }
10050
10050
  return yield this.setMungedSDP(A, i, !0), this.pendingCandidates.forEach((I) => {
10051
10051
  this.pc.addIceCandidate(I);
10052
- }), this.pendingCandidates = [], this.restartingIce = !1, this.renegotiate ? (this.renegotiate = !1, yield this.createAndSendOffer()) : A.type === "answer" && (this.emit(hI.NegotiationComplete), A.sdp && $g.parse(A.sdp).media.forEach((C) => {
10053
- C.type === "video" && this.emit(hI.RTPVideoPayloadTypes, C.rtp);
10052
+ }), this.pendingCandidates = [], this.restartingIce = !1, this.renegotiate ? (this.renegotiate = !1, yield this.createAndSendOffer()) : A.type === "answer" && (this.emit(dI.NegotiationComplete), A.sdp && $g.parse(A.sdp).media.forEach((C) => {
10053
+ C.type === "video" && this.emit(dI.RTPVideoPayloadTypes, C.rtp);
10054
10054
  })), !0;
10055
10055
  });
10056
10056
  }
@@ -10437,8 +10437,8 @@ class ol {
10437
10437
  }, this.peerConnectionTimeout), I = () => {
10438
10438
  clearTimeout(i), t("negotiation aborted");
10439
10439
  };
10440
- A.signal.addEventListener("abort", I), this.publisher.once(hI.NegotiationStarted, () => {
10441
- A.signal.aborted || this.publisher.once(hI.NegotiationComplete, () => {
10440
+ A.signal.addEventListener("abort", I), this.publisher.once(dI.NegotiationStarted, () => {
10441
+ A.signal.aborted || this.publisher.once(dI.NegotiationComplete, () => {
10442
10442
  clearTimeout(i), e();
10443
10443
  });
10444
10444
  }), yield this.publisher.negotiate((C) => {
@@ -10699,20 +10699,20 @@ class F0 extends $ {
10699
10699
  if (A === this._mediaStreamTrack && !e)
10700
10700
  return;
10701
10701
  this._mediaStreamTrack && (this.attachedElements.forEach((I) => {
10702
- rI(this._mediaStreamTrack, I);
10702
+ cI(this._mediaStreamTrack, I);
10703
10703
  }), this.debouncedTrackMuteHandler.cancel("new-track"), this._mediaStreamTrack.removeEventListener("ended", this.handleEnded), this._mediaStreamTrack.removeEventListener("mute", this.handleTrackMuteEvent), this._mediaStreamTrack.removeEventListener("unmute", this.handleTrackUnmuteEvent)), this.mediaStream = new MediaStream([A]), A && (A.addEventListener("ended", this.handleEnded), A.addEventListener("mute", this.handleTrackMuteEvent), A.addEventListener("unmute", this.handleTrackUnmuteEvent), this._constraints = A.getConstraints());
10704
10704
  let i;
10705
10705
  if (this.processor && A) {
10706
10706
  if (this.log.debug("restarting processor", this.logContext), this.kind === "unknown")
10707
10707
  throw TypeError("cannot set processor on track of unknown kind");
10708
- this.processorElement && (QI(A, this.processorElement), this.processorElement.muted = !0), yield this.processor.restart({
10708
+ this.processorElement && (nI(A, this.processorElement), this.processorElement.muted = !0), yield this.processor.restart({
10709
10709
  track: A,
10710
10710
  kind: this.kind,
10711
10711
  element: this.processorElement
10712
10712
  }), i = this.processor.processedTrack;
10713
10713
  }
10714
10714
  this.sender && ((t = this.sender.transport) === null || t === void 0 ? void 0 : t.state) !== "closed" && (yield this.sender.replaceTrack(i ?? A)), !this.providedByUser && this._mediaStreamTrack !== A && this._mediaStreamTrack.stop(), this._mediaStreamTrack = A, A && (this._mediaStreamTrack.enabled = !this.isMuted, yield this.resumeUpstream(), this.attachedElements.forEach((I) => {
10715
- QI(i ?? A, I);
10715
+ nI(i ?? A, I);
10716
10716
  }));
10717
10717
  });
10718
10718
  }
@@ -10805,7 +10805,7 @@ class F0 extends $ {
10805
10805
  } : !0 : C.audio = t ? Object.assign({
10806
10806
  deviceId: t
10807
10807
  }, I) : !0, this.attachedElements.forEach((Q) => {
10808
- rI(this.mediaStreamTrack, Q);
10808
+ cI(this.mediaStreamTrack, Q);
10809
10809
  }), this._mediaStreamTrack.removeEventListener("ended", this.handleEnded), this._mediaStreamTrack.stop();
10810
10810
  const a = (yield navigator.mediaDevices.getUserMedia(C)).getTracks()[0];
10811
10811
  return this.kind === $.Kind.Video && (yield a.applyConstraints(I)), a.addEventListener("ended", this.handleEnded), this.log.debug("re-acquired MediaStreamTrack", this.logContext), yield this.setMediaStreamTrack(a), this._constraints = A, this.emit(CA.Restarted, this), this.manuallyStopped && (this.log.warn("track was stopped during a restart, stopping restarted track", this.logContext), this.stop()), this;
@@ -10917,7 +10917,7 @@ class F0 extends $ {
10917
10917
  };
10918
10918
  if (yield e.init(a), t.log.debug("processor initialized", t.logContext), t.processor && (yield t.internalStopProcessor()), t.kind === "unknown")
10919
10919
  throw TypeError("cannot set processor on track of unknown kind");
10920
- if (QI(t._mediaStreamTrack, o), o.muted = !0, o.play().catch((Q) => {
10920
+ if (nI(t._mediaStreamTrack, o), o.muted = !0, o.play().catch((Q) => {
10921
10921
  Q instanceof DOMException && Q.name === "AbortError" ? (t.log.warn("failed to play processor element, retrying", Object.assign(Object.assign({}, t.logContext), {
10922
10922
  error: Q
10923
10923
  })), setTimeout(() => {
@@ -10931,7 +10931,7 @@ class F0 extends $ {
10931
10931
  }));
10932
10932
  }), t.processor = e, t.processorElement = o, t.processor.processedTrack) {
10933
10933
  for (const Q of t.attachedElements)
10934
- Q !== t.processorElement && i && (rI(t._mediaStreamTrack, Q), QI(t.processor.processedTrack, Q));
10934
+ Q !== t.processorElement && i && (cI(t._mediaStreamTrack, Q), nI(t.processor.processedTrack, Q));
10935
10935
  yield (I = t.sender) === null || I === void 0 ? void 0 : I.replaceTrack(t.processor.processedTrack);
10936
10936
  }
10937
10937
  t.emit(CA.TrackProcessorUpdate, t.processor);
@@ -11926,7 +11926,7 @@ class bl extends lg.EventEmitter {
11926
11926
  if (i)
11927
11927
  return t === OA.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(i.bufferedAmount), i.bufferedAmount <= i.bufferedAmountLowThreshold;
11928
11928
  }, this.handleBrowserOnLine = () => {
11929
- this.client.currentState === ke.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(Pi.RR_SIGNAL_DISCONNECTED));
11929
+ this.client.currentState === ke.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(Oi.RR_SIGNAL_DISCONNECTED));
11930
11930
  }, this.log = vg((e = A.loggerName) !== null && e !== void 0 ? e : Zt.Engine), this.loggerOptions = {
11931
11931
  loggerName: A.loggerName,
11932
11932
  loggerContextCb: () => this.logContext
@@ -12056,7 +12056,7 @@ class bl extends lg.EventEmitter {
12056
12056
  if (this.log.debug("primary PC state changed ".concat(I), this.logContext), ["closed", "disconnected", "failed"].includes(C) && (this.publisherConnectionPromise = void 0), I === Le.CONNECTED) {
12057
12057
  const n = this.pcState === qt.New;
12058
12058
  this.pcState = qt.Connected, n && this.emit(QA.Connected, A);
12059
- } else I === Le.FAILED && this.pcState === qt.Connected && (this.pcState = qt.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? Pi.RR_SUBSCRIBER_FAILED : Pi.RR_PUBLISHER_FAILED));
12059
+ } else I === Le.FAILED && this.pcState === qt.Connected && (this.pcState = qt.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? Oi.RR_SUBSCRIBER_FAILED : Oi.RR_PUBLISHER_FAILED));
12060
12060
  const a = this.client.isDisconnected || this.client.currentState === ke.RECONNECTING, Q = [Le.FAILED, Le.CLOSING, Le.CLOSED].includes(I);
12061
12061
  a && Q && !this._isClosed && this.emit(QA.Offline);
12062
12062
  }), this.pcManager.onTrack = (I) => {
@@ -12108,18 +12108,18 @@ class bl extends lg.EventEmitter {
12108
12108
  var e;
12109
12109
  this.participantSid = (e = A.participant) === null || e === void 0 ? void 0 : e.sid, this.latestJoinResponse && (this.latestJoinResponse.room = A.room), this.emit(QA.RoomMoved, A);
12110
12110
  }, this.client.onClose = () => {
12111
- this.handleDisconnect("signal", Pi.RR_SIGNAL_DISCONNECTED);
12111
+ this.handleDisconnect("signal", Oi.RR_SIGNAL_DISCONNECTED);
12112
12112
  }, this.client.onLeave = (A) => {
12113
12113
  switch (this.log.debug("client leave request", Object.assign(Object.assign({}, this.logContext), {
12114
12114
  reason: A == null ? void 0 : A.reason
12115
12115
  })), A.regions && this.regionUrlProvider && (this.log.debug("updating regions", this.logContext), this.regionUrlProvider.setServerReportedRegions(A.regions)), A.action) {
12116
- case BI.DISCONNECT:
12116
+ case EI.DISCONNECT:
12117
12117
  this.emit(QA.Disconnected, A == null ? void 0 : A.reason), this.close();
12118
12118
  break;
12119
- case BI.RECONNECT:
12119
+ case EI.RECONNECT:
12120
12120
  this.fullReconnectOnNext = !0, this.handleDisconnect(Na);
12121
12121
  break;
12122
- case BI.RESUME:
12122
+ case EI.RESUME:
12123
12123
  this.handleDisconnect(Na);
12124
12124
  }
12125
12125
  };
@@ -12215,7 +12215,7 @@ class bl extends lg.EventEmitter {
12215
12215
  let C = !0;
12216
12216
  I instanceof je ? (this.log.debug("received unrecoverable error", Object.assign(Object.assign({}, this.logContext), {
12217
12217
  error: I
12218
- })), C = !1) : I instanceof Oi || (this.fullReconnectOnNext = !0), C ? this.handleDisconnect("reconnect", Pi.RR_UNKNOWN) : (this.log.info("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(Date.now() - this.reconnectStart, "ms. giving up"), this.logContext), this.emit(QA.Disconnected), yield this.close());
12218
+ })), C = !1) : I instanceof Vi || (this.fullReconnectOnNext = !0), C ? this.handleDisconnect("reconnect", Oi.RR_UNKNOWN) : (this.log.info("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(Date.now() - this.reconnectStart, "ms. giving up"), this.logContext), this.emit(QA.Disconnected), yield this.close());
12219
12219
  } finally {
12220
12220
  this.attemptingReconnect = !1;
12221
12221
  }
@@ -12242,15 +12242,15 @@ class bl extends lg.EventEmitter {
12242
12242
  let I;
12243
12243
  try {
12244
12244
  if (!this.signalOpts)
12245
- throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Oi();
12245
+ throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Vi();
12246
12246
  I = yield this.join(A ?? this.url, this.token, this.signalOpts);
12247
12247
  } catch (C) {
12248
- throw C instanceof me && C.reason === oe.NotAllowed ? new je("could not reconnect, token might be expired") : new Oi();
12248
+ throw C instanceof me && C.reason === oe.NotAllowed ? new je("could not reconnect, token might be expired") : new Vi();
12249
12249
  }
12250
12250
  if (this.shouldFailNext)
12251
12251
  throw this.shouldFailNext = !1, new Error("simulated failure");
12252
12252
  if (this.client.setReconnected(), this.emit(QA.SignalRestarted, I), yield this.waitForPCReconnected(), this.client.currentState !== ke.CONNECTED)
12253
- throw new Oi("Signal connection got severed during reconnect");
12253
+ throw new Vi("Signal connection got severed during reconnect");
12254
12254
  (e = this.regionUrlProvider) === null || e === void 0 || e.resetAttempts(), this.emit(QA.Restarted);
12255
12255
  } catch (I) {
12256
12256
  const C = yield (t = this.regionUrlProvider) === null || t === void 0 ? void 0 : t.getNextBestRegionUrl();
@@ -12277,7 +12277,7 @@ class bl extends lg.EventEmitter {
12277
12277
  let I = "";
12278
12278
  throw i instanceof Error && (I = i.message, this.log.error(i.message, Object.assign(Object.assign({}, this.logContext), {
12279
12279
  error: i
12280
- }))), i instanceof me && i.reason === oe.NotAllowed ? new je("could not reconnect, token might be expired") : i instanceof me && i.reason === oe.LeaveRequest ? i : new Oi(I);
12280
+ }))), i instanceof me && i.reason === oe.NotAllowed ? new je("could not reconnect, token might be expired") : i instanceof me && i.reason === oe.LeaveRequest ? i : new Vi(I);
12281
12281
  }
12282
12282
  if (this.emit(QA.SignalResumed), t) {
12283
12283
  const i = this.makeRTCConfiguration(t);
@@ -12287,7 +12287,7 @@ class bl extends lg.EventEmitter {
12287
12287
  if (this.shouldFailNext)
12288
12288
  throw this.shouldFailNext = !1, new Error("simulated failure");
12289
12289
  if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== ke.CONNECTED)
12290
- throw new Oi("Signal connection got severed during reconnect");
12290
+ throw new Vi("Signal connection got severed during reconnect");
12291
12291
  this.client.setReconnected(), ((e = this.reliableDC) === null || e === void 0 ? void 0 : e.readyState) === "open" && this.reliableDC.id === null && this.createDataChannels(), t != null && t.lastMessageSeq && this.resendReliableMessagesForResume(t.lastMessageSeq), this.emit(QA.Resumed);
12292
12292
  });
12293
12293
  }
@@ -12436,7 +12436,7 @@ class bl extends lg.EventEmitter {
12436
12436
  const t = new AbortController(), i = () => {
12437
12437
  t.abort(), this.log.debug("engine disconnected while negotiation was ongoing", this.logContext), A();
12438
12438
  };
12439
- this.isClosed && e("cannot negotiate on closed engine"), this.on(QA.Closing, i), this.pcManager.publisher.once(hI.RTPVideoPayloadTypes, (I) => {
12439
+ this.isClosed && e("cannot negotiate on closed engine"), this.on(QA.Closing, i), this.pcManager.publisher.once(dI.RTPVideoPayloadTypes, (I) => {
12440
12440
  const C = /* @__PURE__ */ new Map();
12441
12441
  I.forEach((o) => {
12442
12442
  const a = o.codec.toLowerCase();
@@ -12446,7 +12446,7 @@ class bl extends lg.EventEmitter {
12446
12446
  try {
12447
12447
  yield this.pcManager.negotiate(t), A();
12448
12448
  } catch (I) {
12449
- I instanceof bQ && (this.fullReconnectOnNext = !0), this.handleDisconnect("negotiation", Pi.RR_UNKNOWN), e(I);
12449
+ I instanceof bQ && (this.fullReconnectOnNext = !0), this.handleDisconnect("negotiation", Oi.RR_UNKNOWN), e(I);
12450
12450
  } finally {
12451
12451
  this.off(QA.Closing, i);
12452
12452
  }
@@ -12526,7 +12526,7 @@ class bl extends lg.EventEmitter {
12526
12526
  lt() && window.removeEventListener("online", this.handleBrowserOnLine);
12527
12527
  }
12528
12528
  }
12529
- class Oi extends Error {
12529
+ class Vi extends Error {
12530
12530
  }
12531
12531
  function Nl(g) {
12532
12532
  return g !== void 0 && g > 13;
@@ -13427,7 +13427,7 @@ class vl extends J0 {
13427
13427
  /** @internal */
13428
13428
  setMuted(A) {
13429
13429
  super.setMuted(A), this.attachedElements.forEach((e) => {
13430
- A ? rI(this._mediaStreamTrack, e) : QI(this._mediaStreamTrack, e);
13430
+ A ? cI(this._mediaStreamTrack, e) : nI(this._mediaStreamTrack, e);
13431
13431
  });
13432
13432
  }
13433
13433
  attach(A) {
@@ -13855,7 +13855,7 @@ class Y0 extends lg.EventEmitter {
13855
13855
  }
13856
13856
  get isActive() {
13857
13857
  var A;
13858
- return ((A = this.participantInfo) === null || A === void 0 ? void 0 : A.state) === sI.ACTIVE;
13858
+ return ((A = this.participantInfo) === null || A === void 0 ? void 0 : A.state) === BI.ACTIVE;
13859
13859
  }
13860
13860
  get kind() {
13861
13861
  return this._kind;
@@ -13926,7 +13926,7 @@ class Y0 extends lg.EventEmitter {
13926
13926
  /** @internal */
13927
13927
  updateInfo(A) {
13928
13928
  var e;
13929
- return this.participantInfo && this.participantInfo.sid === A.sid && this.participantInfo.version > A.version ? !1 : (this.identity = A.identity, this.sid = A.sid, this._setName(A.name), this._setMetadata(A.metadata), this._setAttributes(A.attributes), A.state === sI.ACTIVE && ((e = this.participantInfo) === null || e === void 0 ? void 0 : e.state) !== sI.ACTIVE && this.emit(aA.Active), A.permission && this.setPermissions(A.permission), this.participantInfo = A, !0);
13929
+ return this.participantInfo && this.participantInfo.sid === A.sid && this.participantInfo.version > A.version ? !1 : (this.identity = A.identity, this.sid = A.sid, this._setName(A.name), this._setMetadata(A.metadata), this._setAttributes(A.attributes), A.state === BI.ACTIVE && ((e = this.participantInfo) === null || e === void 0 ? void 0 : e.state) !== BI.ACTIVE && this.emit(aA.Active), A.permission && this.setPermissions(A.permission), this.participantInfo = A, !0);
13930
13930
  }
13931
13931
  /**
13932
13932
  * Updates metadata from server
@@ -14438,7 +14438,7 @@ class Pl extends Y0 {
14438
14438
  let C = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
14439
14439
  return function* () {
14440
14440
  var o, a, Q, n;
14441
- mg(t) && t.setAudioContext(I.audioContext), yield (o = I.reconnectFuture) === null || o === void 0 ? void 0 : o.promise, I.republishPromise && !C && (yield I.republishPromise), cI(t) && I.pendingPublishPromises.has(t) && (yield I.pendingPublishPromises.get(t));
14441
+ mg(t) && t.setAudioContext(I.audioContext), yield (o = I.reconnectFuture) === null || o === void 0 ? void 0 : o.promise, I.republishPromise && !C && (yield I.republishPromise), hI(t) && I.pendingPublishPromises.has(t) && (yield I.pendingPublishPromises.get(t));
14442
14442
  let s;
14443
14443
  if (t instanceof MediaStreamTrack)
14444
14444
  s = t.getConstraints();
@@ -14539,7 +14539,7 @@ class Pl extends Y0 {
14539
14539
  var i, I, C, o, a, Q, n, s, B, E;
14540
14540
  if (!this.hasPermissionsToPublish(A))
14541
14541
  throw new fB("failed to publish track, insufficient permissions", 403);
14542
- Array.from(this.trackPublications.values()).find((x) => cI(A) && x.source === A.source) && A.source !== $.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(A.source), Object.assign(Object.assign({}, this.logContext), zA(A))), e.stopMicTrackOnMute && sg(A) && (A.stopOnMute = !0), A.source === $.Source.ScreenShare && Ki() && (e.simulcast = !1), e.videoCodec === "av1" && !ux() && (e.videoCodec = void 0), e.videoCodec === "vp9" && !Dx() && (e.videoCodec = void 0), e.videoCodec === void 0 && (e.videoCodec = vQ), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((x) => e.videoCodec === iC(x.mime)) || (e.videoCodec = iC(this.enabledPublishVideoCodecs[0].mime)));
14542
+ Array.from(this.trackPublications.values()).find((x) => hI(A) && x.source === A.source) && A.source !== $.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(A.source), Object.assign(Object.assign({}, this.logContext), zA(A))), e.stopMicTrackOnMute && sg(A) && (A.stopOnMute = !0), A.source === $.Source.ScreenShare && Ki() && (e.simulcast = !1), e.videoCodec === "av1" && !ux() && (e.videoCodec = void 0), e.videoCodec === "vp9" && !Dx() && (e.videoCodec = void 0), e.videoCodec === void 0 && (e.videoCodec = vQ), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((x) => e.videoCodec === iC(x.mime)) || (e.videoCodec = iC(this.enabledPublishVideoCodecs[0].mime)));
14543
14543
  const c = e.videoCodec;
14544
14544
  A.on(CA.Muted, this.onTrackMuted), A.on(CA.Unmuted, this.onTrackUnmuted), A.on(CA.Ended, this.handleTrackEnded), A.on(CA.UpstreamPaused, this.onTrackUpstreamPaused), A.on(CA.UpstreamResumed, this.onTrackUpstreamResumed), A.on(CA.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
14545
14545
  const h = [], r = !(!((i = e.dtx) !== null && i !== void 0) || i), f = A.getSourceTrackSettings();
@@ -14764,7 +14764,7 @@ class Pl extends Y0 {
14764
14764
  unpublishTrack(A, e) {
14765
14765
  return S(this, void 0, void 0, function* () {
14766
14766
  var t, i;
14767
- if (cI(A)) {
14767
+ if (hI(A)) {
14768
14768
  const Q = this.pendingPublishPromises.get(A);
14769
14769
  Q && (this.log.info("awaiting publish promise before attempting to unpublish", Object.assign(Object.assign({}, this.logContext), zA(A))), yield Q);
14770
14770
  }
@@ -15460,7 +15460,7 @@ var re;
15460
15460
  g.Disconnected = "disconnected", g.Connecting = "connecting", g.Connected = "connected", g.Reconnecting = "reconnecting", g.SignalReconnecting = "signalReconnecting";
15461
15461
  })(re || (re = {}));
15462
15462
  const Vl = 4 * 1e3;
15463
- class DI extends lg.EventEmitter {
15463
+ class _I extends lg.EventEmitter {
15464
15464
  /**
15465
15465
  * Creates a new Room, the primary construct for a LiveKit session.
15466
15466
  * @param options
@@ -15668,7 +15668,7 @@ class DI extends lg.EventEmitter {
15668
15668
  }
15669
15669
  o.identity === "" && (o.identity = (a = this.sidToIdentity.get(o.sid)) !== null && a !== void 0 ? a : "");
15670
15670
  let Q = this.remoteParticipants.get(o.identity);
15671
- o.state === sI.DISCONNECTED ? this.handleParticipantDisconnected(o.identity, Q) : Q = this.getOrCreateParticipant(o.identity, o);
15671
+ o.state === BI.DISCONNECTED ? this.handleParticipantDisconnected(o.identity, Q) : Q = this.getOrCreateParticipant(o.identity, o);
15672
15672
  });
15673
15673
  }, this.handleActiveSpeakersUpdate = (C) => {
15674
15674
  const o = [], a = {};
@@ -15809,7 +15809,7 @@ class DI extends lg.EventEmitter {
15809
15809
  const C = new AbortController();
15810
15810
  (I = navigator.mediaDevices) === null || I === void 0 || I.addEventListener("devicechange", this.handleDeviceChange, {
15811
15811
  signal: C.signal
15812
- }), DI.cleanupRegistry && DI.cleanupRegistry.register(this, () => {
15812
+ }), _I.cleanupRegistry && _I.cleanupRegistry.register(this, () => {
15813
15813
  C.abort();
15814
15814
  });
15815
15815
  }
@@ -16099,7 +16099,7 @@ class DI extends lg.EventEmitter {
16099
16099
  const I = this.engine.client.onLeave;
16100
16100
  I && I(new qo({
16101
16101
  reason: Wt.CLIENT_INITIATED,
16102
- action: BI.RECONNECT
16102
+ action: EI.RECONNECT
16103
16103
  }));
16104
16104
  });
16105
16105
  break;
@@ -16485,7 +16485,7 @@ class DI extends lg.EventEmitter {
16485
16485
  identity: "simulated-local",
16486
16486
  name: "local-name"
16487
16487
  })), this.setupLocalParticipantEvents(), this.emit(tA.SignalConnected), this.emit(tA.Connected), this.setAndEmitConnectionState(re.Connected), i.video) {
16488
- const C = new HQ($.Kind.Video, new aI({
16488
+ const C = new HQ($.Kind.Video, new QI({
16489
16489
  source: Oe.CAMERA,
16490
16490
  sid: Math.floor(Math.random() * 1e4).toString(),
16491
16491
  type: Pt.AUDIO,
@@ -16502,7 +16502,7 @@ class DI extends lg.EventEmitter {
16502
16502
  this.localParticipant.addTrackPublication(C), this.localParticipant.emit(aA.LocalTrackPublished, C);
16503
16503
  }
16504
16504
  if (i.audio) {
16505
- const C = new HQ($.Kind.Audio, new aI({
16505
+ const C = new HQ($.Kind.Audio, new QI({
16506
16506
  source: Oe.MICROPHONE,
16507
16507
  sid: Math.floor(Math.random() * 1e4).toString(),
16508
16508
  type: Pt.AUDIO
@@ -16521,13 +16521,13 @@ class DI extends lg.EventEmitter {
16521
16521
  let o = new Ui({
16522
16522
  sid: Math.floor(Math.random() * 1e4).toString(),
16523
16523
  identity: "simulated-".concat(C),
16524
- state: sI.ACTIVE,
16524
+ state: BI.ACTIVE,
16525
16525
  tracks: [],
16526
16526
  joinedAt: Ge.parse(Date.now())
16527
16527
  });
16528
16528
  const a = this.getOrCreateParticipant(o.identity, o);
16529
16529
  if (I.video) {
16530
- const Q = bB(160 * ((t = I.aspectRatios[C % I.aspectRatios.length]) !== null && t !== void 0 ? t : 1), 160, !1, !0), n = new aI({
16530
+ const Q = bB(160 * ((t = I.aspectRatios[C % I.aspectRatios.length]) !== null && t !== void 0 ? t : 1), 160, !1, !0), n = new QI({
16531
16531
  source: Oe.CAMERA,
16532
16532
  sid: Math.floor(Math.random() * 1e4).toString(),
16533
16533
  type: Pt.AUDIO
@@ -16535,7 +16535,7 @@ class DI extends lg.EventEmitter {
16535
16535
  a.addSubscribedMediaTrack(Q, n.sid, new MediaStream([Q]), new RTCRtpReceiver()), o.tracks = [...o.tracks, n];
16536
16536
  }
16537
16537
  if (I.audio) {
16538
- const Q = Da(), n = new aI({
16538
+ const Q = Da(), n = new QI({
16539
16539
  source: Oe.MICROPHONE,
16540
16540
  sid: Math.floor(Math.random() * 1e4).toString(),
16541
16541
  type: Pt.AUDIO
@@ -16560,7 +16560,7 @@ class DI extends lg.EventEmitter {
16560
16560
  return super.emit(A, ...t);
16561
16561
  }
16562
16562
  }
16563
- DI.cleanupRegistry = typeof FinalizationRegistry < "u" && new FinalizationRegistry((g) => {
16563
+ _I.cleanupRegistry = typeof FinalizationRegistry < "u" && new FinalizationRegistry((g) => {
16564
16564
  g();
16565
16565
  });
16566
16566
  function T0(g) {
@@ -16576,7 +16576,7 @@ var Ht;
16576
16576
  class ri extends lg.EventEmitter {
16577
16577
  constructor(A, e) {
16578
16578
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
16579
- super(), this.status = Ht.IDLE, this.logs = [], this.options = {}, this.url = A, this.token = e, this.name = this.constructor.name, this.room = new DI(t.roomOptions), this.connectOptions = t.connectOptions, this.options = t;
16579
+ super(), this.status = Ht.IDLE, this.logs = [], this.options = {}, this.url = A, this.token = e, this.name = this.constructor.name, this.room = new _I(t.roomOptions), this.connectOptions = t.connectOptions, this.options = t;
16580
16580
  }
16581
16581
  run(A) {
16582
16582
  return S(this, void 0, void 0, function* () {
@@ -17917,12 +17917,12 @@ class O0 {
17917
17917
  }
17918
17918
  yt = /* @__PURE__ */ new WeakMap();
17919
17919
  const of = O0.isSupported, af = () => new O0();
17920
- class nI {
17920
+ class sI {
17921
17921
  constructor() {
17922
17922
  this.audioContext = null, this.refCount = 0, this.resumePromise = null;
17923
17923
  }
17924
17924
  static getInstance() {
17925
- return nI.instance || (nI.instance = new nI()), nI.instance;
17925
+ return sI.instance || (sI.instance = new sI()), sI.instance;
17926
17926
  }
17927
17927
  /**
17928
17928
  * Acquire a reference to the shared AudioContext
@@ -18020,7 +18020,7 @@ class nI {
18020
18020
  return ((A = this.audioContext) == null ? void 0 : A.destination) ?? null;
18021
18021
  }
18022
18022
  }
18023
- const og = nI.getInstance();
18023
+ const og = sI.getInstance();
18024
18024
  typeof window < "u" && window.addEventListener("pagehide", () => {
18025
18025
  og.forceClose();
18026
18026
  });
@@ -18076,7 +18076,7 @@ const Qf = of(), $B = Qf ? af() : null, at = class at extends EventTarget {
18076
18076
  if (!(this.room && this.room.state === "connected")) {
18077
18077
  this.updateStatus("connecting"), this.error = null, this.isReady = !1, this.room && (await this.room.disconnect(), this.room = null);
18078
18078
  try {
18079
- const i = new DI({
18079
+ const i = new _I({
18080
18080
  webAudioMix: !1,
18081
18081
  // Disabled: we manage our own Web Audio chain (GainNode fadeout).
18082
18082
  // LiveKit's built-in web audio mixing would conflict with
@@ -18391,7 +18391,7 @@ const Qf = of(), $B = Qf ? af() : null, at = class at extends EventTarget {
18391
18391
  }
18392
18392
  this.updateStatus("disconnecting");
18393
18393
  const A = this.room;
18394
- this.room = null, this.connectedParticipants = [], this.microphoneEnabled = !1, this.audioPlaybackPrompt = !1, this.isReady = !1, this.cleanupFadeContext(), this.unmuteTimer && (clearTimeout(this.unmuteTimer), this.unmuteTimer = null), this.speakingHandler && (A.localParticipant.off("isSpeakingChanged", this.speakingHandler), this.speakingHandler = null), this.updateStatus("disconnected"), this.dispatchEvent(new CustomEvent("call-ended")), requestAnimationFrame(() => {
18394
+ this.room = null, this.connectedParticipants = [], this.microphoneEnabled = !1, this.audioPlaybackPrompt = !1, this.isReady = !1, this.cleanupFadeContext(), this.unmuteTimer && (clearTimeout(this.unmuteTimer), this.unmuteTimer = null), this.speakingHandler && (A.localParticipant.off("isSpeakingChanged", this.speakingHandler), this.speakingHandler = null), this.updateStatus("disconnected"), this.dispatchEvent(new CustomEvent("call-ended")), A.removeAllListeners(), this.noiseFilterAttached = !1, requestAnimationFrame(() => {
18395
18395
  setTimeout(async () => {
18396
18396
  try {
18397
18397
  await A.disconnect();
@@ -18403,13 +18403,13 @@ const Qf = of(), $B = Qf ? af() : null, at = class at extends EventTarget {
18403
18403
  }
18404
18404
  };
18405
18405
  at.UNMUTE_HOLDOVER_MS = 350, at.FADEOUT_TC = 0.045, at.FADEIN_TC = 0.03;
18406
- let _I = at;
18406
+ let Ji = at;
18407
18407
  /**
18408
18408
  * @license
18409
18409
  * Copyright 2010-2025 Three.js Authors
18410
18410
  * SPDX-License-Identifier: MIT
18411
18411
  */
18412
- const rs = "182", nf = 0, AE = 1, sf = 2, so = 1, Bf = 2, ZI = 3, Jg = 0, Qt = 1, Fg = 2, Lg = 0, dI = 1, VQ = 2, eE = 3, tE = 4, Ef = 5, Ni = 100, rf = 101, cf = 102, hf = 103, df = 104, xf = 200, lf = 201, ff = 202, uf = 203, jQ = 204, WQ = 205, Df = 206, _f = 207, pf = 208, wf = 209, mf = 210, yf = 211, bf = 212, Nf = 213, Sf = 214, XQ = 0, ZQ = 1, zQ = 2, pI = 3, $Q = 4, An = 5, en = 6, tn = 7, V0 = 0, kf = 1, Rf = 2, Bg = 0, j0 = 1, W0 = 2, X0 = 3, Z0 = 4, z0 = 5, $0 = 6, Ac = 7, ec = 300, Ji = 301, wI = 302, gn = 303, In = 304, Vo = 306, Cn = 1e3, Ug = 1001, on = 1002, tt = 1003, Gf = 1004, SC = 1005, It = 1006, Ga = 1007, Ri = 1008, Lt = 1009, tc = 1010, gc = 1011, EC = 1012, cs = 1013, dg = 1014, ag = 1015, Yg = 1016, hs = 1017, ds = 1018, rC = 1020, ic = 35902, Ic = 35899, Cc = 1021, oc = 1022, Xt = 1023, Tg = 1026, Gi = 1027, ac = 1028, xs = 1029, mI = 1030, ls = 1031, fs = 1033, Bo = 33776, Eo = 33777, ro = 33778, co = 33779, an = 35840, Qn = 35841, nn = 35842, sn = 35843, Bn = 36196, En = 37492, rn = 37496, cn = 37488, hn = 37489, dn = 37490, xn = 37491, ln = 37808, fn = 37809, un = 37810, Dn = 37811, _n = 37812, pn = 37813, wn = 37814, mn = 37815, yn = 37816, bn = 37817, Nn = 37818, Sn = 37819, kn = 37820, Rn = 37821, Gn = 36492, Mn = 36494, Fn = 36495, Un = 36283, Ln = 36284, Kn = 36285, vn = 36286, Mf = 3200, Ff = 0, Uf = 1, Ii = "", Ft = "srgb", yI = "srgb-linear", Go = "linear", fe = "srgb", Vi = 7680, gE = 519, Lf = 512, Kf = 513, vf = 514, us = 515, Jf = 516, Yf = 517, Ds = 518, Tf = 519, iE = 35044, IE = "300 es", Qg = 2e3, Mo = 2001;
18412
+ const rs = "182", nf = 0, AE = 1, sf = 2, so = 1, Bf = 2, ZI = 3, Jg = 0, Qt = 1, Fg = 2, Lg = 0, xI = 1, VQ = 2, eE = 3, tE = 4, Ef = 5, Ni = 100, rf = 101, cf = 102, hf = 103, df = 104, xf = 200, lf = 201, ff = 202, uf = 203, jQ = 204, WQ = 205, Df = 206, _f = 207, pf = 208, wf = 209, mf = 210, yf = 211, bf = 212, Nf = 213, Sf = 214, XQ = 0, ZQ = 1, zQ = 2, pI = 3, $Q = 4, An = 5, en = 6, tn = 7, V0 = 0, kf = 1, Rf = 2, Bg = 0, j0 = 1, W0 = 2, X0 = 3, Z0 = 4, z0 = 5, $0 = 6, Ac = 7, ec = 300, Yi = 301, wI = 302, gn = 303, In = 304, Vo = 306, Cn = 1e3, Ug = 1001, on = 1002, tt = 1003, Gf = 1004, SC = 1005, It = 1006, Ga = 1007, Ri = 1008, Lt = 1009, tc = 1010, gc = 1011, EC = 1012, cs = 1013, dg = 1014, ag = 1015, Yg = 1016, hs = 1017, ds = 1018, rC = 1020, ic = 35902, Ic = 35899, Cc = 1021, oc = 1022, Xt = 1023, Tg = 1026, Gi = 1027, ac = 1028, xs = 1029, mI = 1030, ls = 1031, fs = 1033, Bo = 33776, Eo = 33777, ro = 33778, co = 33779, an = 35840, Qn = 35841, nn = 35842, sn = 35843, Bn = 36196, En = 37492, rn = 37496, cn = 37488, hn = 37489, dn = 37490, xn = 37491, ln = 37808, fn = 37809, un = 37810, Dn = 37811, _n = 37812, pn = 37813, wn = 37814, mn = 37815, yn = 37816, bn = 37817, Nn = 37818, Sn = 37819, kn = 37820, Rn = 37821, Gn = 36492, Mn = 36494, Fn = 36495, Un = 36283, Ln = 36284, Kn = 36285, vn = 36286, Mf = 3200, Ff = 0, Uf = 1, Ii = "", Ft = "srgb", yI = "srgb-linear", Go = "linear", fe = "srgb", ji = 7680, gE = 519, Lf = 512, Kf = 513, vf = 514, us = 515, Jf = 516, Yf = 517, Ds = 518, Tf = 519, iE = 35044, IE = "300 es", Qg = 2e3, Mo = 2001;
18413
18413
  function Qc(g) {
18414
18414
  for (let A = g.length - 1; A >= 0; --A)
18415
18415
  if (g[A] >= 65535) return !0;
@@ -20726,7 +20726,7 @@ function Of() {
20726
20726
  */
20727
20727
  spaces: {},
20728
20728
  convert: function(i, I, C) {
20729
- return this.enabled === !1 || I === C || !I || !C || (this.spaces[I].transfer === fe && (i.r = Kg(i.r), i.g = Kg(i.g), i.b = Kg(i.b)), this.spaces[I].primaries !== this.spaces[C].primaries && (i.applyMatrix3(this.spaces[I].toXYZ), i.applyMatrix3(this.spaces[C].fromXYZ)), this.spaces[C].transfer === fe && (i.r = xI(i.r), i.g = xI(i.g), i.b = xI(i.b))), i;
20729
+ return this.enabled === !1 || I === C || !I || !C || (this.spaces[I].transfer === fe && (i.r = Kg(i.r), i.g = Kg(i.g), i.b = Kg(i.b)), this.spaces[I].primaries !== this.spaces[C].primaries && (i.applyMatrix3(this.spaces[I].toXYZ), i.applyMatrix3(this.spaces[C].fromXYZ)), this.spaces[C].transfer === fe && (i.r = lI(i.r), i.g = lI(i.g), i.b = lI(i.b))), i;
20730
20730
  },
20731
20731
  workingToColorSpace: function(i, I) {
20732
20732
  return this.convert(i, this.workingColorSpace, I);
@@ -20793,10 +20793,10 @@ const ne = /* @__PURE__ */ Of();
20793
20793
  function Kg(g) {
20794
20794
  return g < 0.04045 ? g * 0.0773993808 : Math.pow(g * 0.9478672986 + 0.0521327014, 2.4);
20795
20795
  }
20796
- function xI(g) {
20796
+ function lI(g) {
20797
20797
  return g < 31308e-7 ? g * 12.92 : 1.055 * Math.pow(g, 0.41666) - 0.055;
20798
20798
  }
20799
- let ji;
20799
+ let Wi;
20800
20800
  class Vf {
20801
20801
  /**
20802
20802
  * Returns a data URI containing a representation of the given image.
@@ -20812,9 +20812,9 @@ class Vf {
20812
20812
  if (A instanceof HTMLCanvasElement)
20813
20813
  t = A;
20814
20814
  else {
20815
- ji === void 0 && (ji = Fo("canvas")), ji.width = A.width, ji.height = A.height;
20816
- const i = ji.getContext("2d");
20817
- A instanceof ImageData ? i.putImageData(A, 0, 0) : i.drawImage(A, 0, 0, A.width, A.height), t = ji;
20815
+ Wi === void 0 && (Wi = Fo("canvas")), Wi.width = A.width, Wi.height = A.height;
20816
+ const i = Wi.getContext("2d");
20817
+ A instanceof ImageData ? i.putImageData(A, 0, 0) : i.drawImage(A, 0, 0, A.width, A.height), t = Wi;
20818
20818
  }
20819
20819
  return t.toDataURL(e);
20820
20820
  }
@@ -22142,7 +22142,7 @@ class uC {
22142
22142
  intersectsTriangle(A) {
22143
22143
  if (this.isEmpty())
22144
22144
  return !1;
22145
- this.getCenter(TI), RC.subVectors(this.max, TI), Wi.subVectors(A.a, TI), Xi.subVectors(A.b, TI), Zi.subVectors(A.c, TI), Vg.subVectors(Xi, Wi), jg.subVectors(Zi, Xi), li.subVectors(Wi, Zi);
22145
+ this.getCenter(TI), RC.subVectors(this.max, TI), Xi.subVectors(A.a, TI), Zi.subVectors(A.b, TI), zi.subVectors(A.c, TI), Vg.subVectors(Zi, Xi), jg.subVectors(zi, Zi), li.subVectors(Xi, zi);
22146
22146
  let e = [
22147
22147
  0,
22148
22148
  -Vg.z,
@@ -22172,7 +22172,7 @@ class uC {
22172
22172
  li.x,
22173
22173
  0
22174
22174
  ];
22175
- return !Ja(e, Wi, Xi, Zi, RC) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Ja(e, Wi, Xi, Zi, RC)) ? !1 : (GC.crossVectors(Vg, jg), e = [GC.x, GC.y, GC.z], Ja(e, Wi, Xi, Zi, RC));
22175
+ return !Ja(e, Xi, Zi, zi, RC) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Ja(e, Xi, Zi, zi, RC)) ? !1 : (GC.crossVectors(Vg, jg), e = [GC.x, GC.y, GC.z], Ja(e, Xi, Zi, zi, RC));
22176
22176
  }
22177
22177
  /**
22178
22178
  * Clamps the given point within the bounds of this box.
@@ -22284,7 +22284,7 @@ const ug = [
22284
22284
  /* @__PURE__ */ new v(),
22285
22285
  /* @__PURE__ */ new v(),
22286
22286
  /* @__PURE__ */ new v()
22287
- ], Jt = /* @__PURE__ */ new v(), kC = /* @__PURE__ */ new uC(), Wi = /* @__PURE__ */ new v(), Xi = /* @__PURE__ */ new v(), Zi = /* @__PURE__ */ new v(), Vg = /* @__PURE__ */ new v(), jg = /* @__PURE__ */ new v(), li = /* @__PURE__ */ new v(), TI = /* @__PURE__ */ new v(), RC = /* @__PURE__ */ new v(), GC = /* @__PURE__ */ new v(), fi = /* @__PURE__ */ new v();
22287
+ ], Jt = /* @__PURE__ */ new v(), kC = /* @__PURE__ */ new uC(), Xi = /* @__PURE__ */ new v(), Zi = /* @__PURE__ */ new v(), zi = /* @__PURE__ */ new v(), Vg = /* @__PURE__ */ new v(), jg = /* @__PURE__ */ new v(), li = /* @__PURE__ */ new v(), TI = /* @__PURE__ */ new v(), RC = /* @__PURE__ */ new v(), GC = /* @__PURE__ */ new v(), fi = /* @__PURE__ */ new v();
22288
22288
  function Ja(g, A, e, t, i) {
22289
22289
  for (let I = 0, C = g.length - 3; I <= C; I += 3) {
22290
22290
  fi.fromArray(g, I);
@@ -22973,7 +22973,7 @@ class Ve {
22973
22973
  extractRotation(A) {
22974
22974
  if (A.determinant() === 0)
22975
22975
  return this.identity();
22976
- const e = this.elements, t = A.elements, i = 1 / zi.setFromMatrixColumn(A, 0).length(), I = 1 / zi.setFromMatrixColumn(A, 1).length(), C = 1 / zi.setFromMatrixColumn(A, 2).length();
22976
+ const e = this.elements, t = A.elements, i = 1 / $i.setFromMatrixColumn(A, 0).length(), I = 1 / $i.setFromMatrixColumn(A, 1).length(), C = 1 / $i.setFromMatrixColumn(A, 2).length();
22977
22977
  return e[0] = t[0] * i, e[1] = t[1] * i, e[2] = t[2] * i, e[3] = 0, e[4] = t[4] * I, e[5] = t[5] * I, e[6] = t[6] * I, e[7] = 0, e[8] = t[8] * C, e[9] = t[9] * C, e[10] = t[10] * C, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this;
22978
22978
  }
22979
22979
  /**
@@ -23389,8 +23389,8 @@ class Ve {
23389
23389
  const i = this.elements;
23390
23390
  if (A.x = i[12], A.y = i[13], A.z = i[14], this.determinant() === 0)
23391
23391
  return t.set(1, 1, 1), e.identity(), this;
23392
- let I = zi.set(i[0], i[1], i[2]).length();
23393
- const C = zi.set(i[4], i[5], i[6]).length(), o = zi.set(i[8], i[9], i[10]).length();
23392
+ let I = $i.set(i[0], i[1], i[2]).length();
23393
+ const C = $i.set(i[4], i[5], i[6]).length(), o = $i.set(i[8], i[9], i[10]).length();
23394
23394
  this.determinant() < 0 && (I = -I), Yt.copy(this);
23395
23395
  const Q = 1 / I, n = 1 / C, s = 1 / o;
23396
23396
  return Yt.elements[0] *= Q, Yt.elements[1] *= Q, Yt.elements[2] *= Q, Yt.elements[4] *= n, Yt.elements[5] *= n, Yt.elements[6] *= n, Yt.elements[8] *= s, Yt.elements[9] *= s, Yt.elements[10] *= s, e.setFromRotationMatrix(Yt), t.x = I, t.y = C, t.z = o, this;
@@ -23486,7 +23486,7 @@ class Ve {
23486
23486
  return A[e] = t[0], A[e + 1] = t[1], A[e + 2] = t[2], A[e + 3] = t[3], A[e + 4] = t[4], A[e + 5] = t[5], A[e + 6] = t[6], A[e + 7] = t[7], A[e + 8] = t[8], A[e + 9] = t[9], A[e + 10] = t[10], A[e + 11] = t[11], A[e + 12] = t[12], A[e + 13] = t[13], A[e + 14] = t[14], A[e + 15] = t[15], A;
23487
23487
  }
23488
23488
  }
23489
- const zi = /* @__PURE__ */ new v(), Yt = /* @__PURE__ */ new Ve(), Au = /* @__PURE__ */ new v(0, 0, 0), eu = /* @__PURE__ */ new v(1, 1, 1), Xg = /* @__PURE__ */ new v(), UC = /* @__PURE__ */ new v(), pt = /* @__PURE__ */ new v(), sE = /* @__PURE__ */ new Ve(), BE = /* @__PURE__ */ new fC();
23489
+ const $i = /* @__PURE__ */ new v(), Yt = /* @__PURE__ */ new Ve(), Au = /* @__PURE__ */ new v(0, 0, 0), eu = /* @__PURE__ */ new v(1, 1, 1), Xg = /* @__PURE__ */ new v(), UC = /* @__PURE__ */ new v(), pt = /* @__PURE__ */ new v(), sE = /* @__PURE__ */ new Ve(), BE = /* @__PURE__ */ new fC();
23490
23490
  class qg {
23491
23491
  /**
23492
23492
  * Constructs a new euler instance.
@@ -23758,7 +23758,7 @@ class sc {
23758
23758
  }
23759
23759
  }
23760
23760
  let tu = 0;
23761
- const EE = /* @__PURE__ */ new v(), $i = /* @__PURE__ */ new fC(), _g = /* @__PURE__ */ new Ve(), LC = /* @__PURE__ */ new v(), HI = /* @__PURE__ */ new v(), gu = /* @__PURE__ */ new v(), iu = /* @__PURE__ */ new fC(), rE = /* @__PURE__ */ new v(1, 0, 0), cE = /* @__PURE__ */ new v(0, 1, 0), hE = /* @__PURE__ */ new v(0, 0, 1), dE = { type: "added" }, Iu = { type: "removed" }, AI = { type: "childadded", child: null }, Pa = { type: "childremoved", child: null };
23761
+ const EE = /* @__PURE__ */ new v(), AI = /* @__PURE__ */ new fC(), _g = /* @__PURE__ */ new Ve(), LC = /* @__PURE__ */ new v(), HI = /* @__PURE__ */ new v(), gu = /* @__PURE__ */ new v(), iu = /* @__PURE__ */ new fC(), rE = /* @__PURE__ */ new v(1, 0, 0), cE = /* @__PURE__ */ new v(0, 1, 0), hE = /* @__PURE__ */ new v(0, 0, 1), dE = { type: "added" }, Iu = { type: "removed" }, eI = { type: "childadded", child: null }, Pa = { type: "childremoved", child: null };
23762
23762
  class kt extends kI {
23763
23763
  /**
23764
23764
  * Constructs a new 3D object.
@@ -23950,7 +23950,7 @@ class kt extends kI {
23950
23950
  * @return {Object3D} A reference to this instance.
23951
23951
  */
23952
23952
  rotateOnAxis(A, e) {
23953
- return $i.setFromAxisAngle(A, e), this.quaternion.multiply($i), this;
23953
+ return AI.setFromAxisAngle(A, e), this.quaternion.multiply(AI), this;
23954
23954
  }
23955
23955
  /**
23956
23956
  * Rotates the 3D object along an axis in world space.
@@ -23960,7 +23960,7 @@ class kt extends kI {
23960
23960
  * @return {Object3D} A reference to this instance.
23961
23961
  */
23962
23962
  rotateOnWorldAxis(A, e) {
23963
- return $i.setFromAxisAngle(A, e), this.quaternion.premultiply($i), this;
23963
+ return AI.setFromAxisAngle(A, e), this.quaternion.premultiply(AI), this;
23964
23964
  }
23965
23965
  /**
23966
23966
  * Rotates the 3D object around its X axis in local space.
@@ -24056,7 +24056,7 @@ class kt extends kI {
24056
24056
  lookAt(A, e, t) {
24057
24057
  A.isVector3 ? LC.copy(A) : LC.set(A, e, t);
24058
24058
  const i = this.parent;
24059
- this.updateWorldMatrix(!0, !1), HI.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? _g.lookAt(HI, LC, this.up) : _g.lookAt(LC, HI, this.up), this.quaternion.setFromRotationMatrix(_g), i && (_g.extractRotation(i.matrixWorld), $i.setFromRotationMatrix(_g), this.quaternion.premultiply($i.invert()));
24059
+ this.updateWorldMatrix(!0, !1), HI.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? _g.lookAt(HI, LC, this.up) : _g.lookAt(LC, HI, this.up), this.quaternion.setFromRotationMatrix(_g), i && (_g.extractRotation(i.matrixWorld), AI.setFromRotationMatrix(_g), this.quaternion.premultiply(AI.invert()));
24060
24060
  }
24061
24061
  /**
24062
24062
  * Adds the given 3D object as a child to this 3D object. An arbitrary number of
@@ -24074,7 +24074,7 @@ class kt extends kI {
24074
24074
  this.add(arguments[e]);
24075
24075
  return this;
24076
24076
  }
24077
- return A === this ? (Ee("Object3D.add: object can't be added as a child of itself.", A), this) : (A && A.isObject3D ? (A.removeFromParent(), A.parent = this, this.children.push(A), A.dispatchEvent(dE), AI.child = A, this.dispatchEvent(AI), AI.child = null) : Ee("Object3D.add: object not an instance of THREE.Object3D.", A), this);
24077
+ return A === this ? (Ee("Object3D.add: object can't be added as a child of itself.", A), this) : (A && A.isObject3D ? (A.removeFromParent(), A.parent = this, this.children.push(A), A.dispatchEvent(dE), eI.child = A, this.dispatchEvent(eI), eI.child = null) : Ee("Object3D.add: object not an instance of THREE.Object3D.", A), this);
24078
24078
  }
24079
24079
  /**
24080
24080
  * Removes the given 3D object as child from this 3D object.
@@ -24125,7 +24125,7 @@ class kt extends kI {
24125
24125
  * @return {Object3D} A reference to this instance.
24126
24126
  */
24127
24127
  attach(A) {
24128
- return this.updateWorldMatrix(!0, !1), _g.copy(this.matrixWorld).invert(), A.parent !== null && (A.parent.updateWorldMatrix(!0, !1), _g.multiply(A.parent.matrixWorld)), A.applyMatrix4(_g), A.removeFromParent(), A.parent = this, this.children.push(A), A.updateWorldMatrix(!1, !0), A.dispatchEvent(dE), AI.child = A, this.dispatchEvent(AI), AI.child = null, this;
24128
+ return this.updateWorldMatrix(!0, !1), _g.copy(this.matrixWorld).invert(), A.parent !== null && (A.parent.updateWorldMatrix(!0, !1), _g.multiply(A.parent.matrixWorld)), A.applyMatrix4(_g), A.removeFromParent(), A.parent = this, this.children.push(A), A.updateWorldMatrix(!1, !0), A.dispatchEvent(dE), eI.child = A, this.dispatchEvent(eI), eI.child = null, this;
24129
24129
  }
24130
24130
  /**
24131
24131
  * Searches through the 3D object and its children, starting with the 3D object
@@ -24416,7 +24416,7 @@ class kt extends kI {
24416
24416
  kt.DEFAULT_UP = /* @__PURE__ */ new v(0, 1, 0);
24417
24417
  kt.DEFAULT_MATRIX_AUTO_UPDATE = !0;
24418
24418
  kt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
24419
- const Tt = /* @__PURE__ */ new v(), pg = /* @__PURE__ */ new v(), Oa = /* @__PURE__ */ new v(), wg = /* @__PURE__ */ new v(), eI = /* @__PURE__ */ new v(), tI = /* @__PURE__ */ new v(), xE = /* @__PURE__ */ new v(), Va = /* @__PURE__ */ new v(), ja = /* @__PURE__ */ new v(), Wa = /* @__PURE__ */ new v(), Xa = /* @__PURE__ */ new Ye(), Za = /* @__PURE__ */ new Ye(), za = /* @__PURE__ */ new Ye();
24419
+ const Tt = /* @__PURE__ */ new v(), pg = /* @__PURE__ */ new v(), Oa = /* @__PURE__ */ new v(), wg = /* @__PURE__ */ new v(), tI = /* @__PURE__ */ new v(), gI = /* @__PURE__ */ new v(), xE = /* @__PURE__ */ new v(), Va = /* @__PURE__ */ new v(), ja = /* @__PURE__ */ new v(), Wa = /* @__PURE__ */ new v(), Xa = /* @__PURE__ */ new Ye(), Za = /* @__PURE__ */ new Ye(), za = /* @__PURE__ */ new Ye();
24420
24420
  class jt {
24421
24421
  /**
24422
24422
  * Constructs a new triangle.
@@ -24669,29 +24669,29 @@ class jt {
24669
24669
  closestPointToPoint(A, e) {
24670
24670
  const t = this.a, i = this.b, I = this.c;
24671
24671
  let C, o;
24672
- eI.subVectors(i, t), tI.subVectors(I, t), Va.subVectors(A, t);
24673
- const a = eI.dot(Va), Q = tI.dot(Va);
24672
+ tI.subVectors(i, t), gI.subVectors(I, t), Va.subVectors(A, t);
24673
+ const a = tI.dot(Va), Q = gI.dot(Va);
24674
24674
  if (a <= 0 && Q <= 0)
24675
24675
  return e.copy(t);
24676
24676
  ja.subVectors(A, i);
24677
- const n = eI.dot(ja), s = tI.dot(ja);
24677
+ const n = tI.dot(ja), s = gI.dot(ja);
24678
24678
  if (n >= 0 && s <= n)
24679
24679
  return e.copy(i);
24680
24680
  const B = a * s - n * Q;
24681
24681
  if (B <= 0 && a >= 0 && n <= 0)
24682
- return C = a / (a - n), e.copy(t).addScaledVector(eI, C);
24682
+ return C = a / (a - n), e.copy(t).addScaledVector(tI, C);
24683
24683
  Wa.subVectors(A, I);
24684
- const E = eI.dot(Wa), d = tI.dot(Wa);
24684
+ const E = tI.dot(Wa), d = gI.dot(Wa);
24685
24685
  if (d >= 0 && E <= d)
24686
24686
  return e.copy(I);
24687
24687
  const c = E * Q - a * d;
24688
24688
  if (c <= 0 && Q >= 0 && d <= 0)
24689
- return o = Q / (Q - d), e.copy(t).addScaledVector(tI, o);
24689
+ return o = Q / (Q - d), e.copy(t).addScaledVector(gI, o);
24690
24690
  const h = n * d - E * s;
24691
24691
  if (h <= 0 && s - n >= 0 && E - d >= 0)
24692
24692
  return xE.subVectors(I, i), o = (s - n) / (s - n + (E - d)), e.copy(i).addScaledVector(xE, o);
24693
24693
  const r = 1 / (h + c + B);
24694
- return C = c * r, o = B * r, e.copy(t).addScaledVector(eI, C).addScaledVector(tI, o);
24694
+ return C = c * r, o = B * r, e.copy(t).addScaledVector(tI, C).addScaledVector(gI, o);
24695
24695
  }
24696
24696
  /**
24697
24697
  * Returns `true` if this triangle is equal with the given one.
@@ -25054,7 +25054,7 @@ class ae {
25054
25054
  * @return {Color} A reference to this color.
25055
25055
  */
25056
25056
  copyLinearToSRGB(A) {
25057
- return this.r = xI(A.r), this.g = xI(A.g), this.b = xI(A.b), this;
25057
+ return this.r = lI(A.r), this.g = lI(A.g), this.b = lI(A.b), this;
25058
25058
  }
25059
25059
  /**
25060
25060
  * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.
@@ -25332,7 +25332,7 @@ class jo extends kI {
25332
25332
  * Constructs a new material.
25333
25333
  */
25334
25334
  constructor() {
25335
- super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: Cu++ }), this.uuid = lC(), this.name = "", this.type = "Material", this.blending = dI, this.side = Jg, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = jQ, this.blendDst = WQ, this.blendEquation = Ni, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new ae(0, 0, 0), this.blendAlpha = 0, this.depthFunc = pI, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = gE, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Vi, this.stencilZFail = Vi, this.stencilZPass = Vi, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
25335
+ super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: Cu++ }), this.uuid = lC(), this.name = "", this.type = "Material", this.blending = xI, this.side = Jg, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = jQ, this.blendDst = WQ, this.blendEquation = Ni, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new ae(0, 0, 0), this.blendAlpha = 0, this.depthFunc = pI, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = gE, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = ji, this.stencilZFail = ji, this.stencilZPass = ji, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
25336
25336
  }
25337
25337
  /**
25338
25338
  * Sets the alpha value to be used when running an alpha test. The material
@@ -25431,7 +25431,7 @@ class jo extends kI {
25431
25431
  generator: "Material.toJSON"
25432
25432
  }
25433
25433
  };
25434
- t.uuid = this.uuid, t.type = this.type, this.name !== "" && (t.name = this.name), this.color && this.color.isColor && (t.color = this.color.getHex()), this.roughness !== void 0 && (t.roughness = this.roughness), this.metalness !== void 0 && (t.metalness = this.metalness), this.sheen !== void 0 && (t.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (t.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (t.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (t.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (t.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (t.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (t.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (t.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (t.shininess = this.shininess), this.clearcoat !== void 0 && (t.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (t.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (t.clearcoatMap = this.clearcoatMap.toJSON(A).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (t.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(A).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (t.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(A).uuid, t.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (t.sheenColorMap = this.sheenColorMap.toJSON(A).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (t.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(A).uuid), this.dispersion !== void 0 && (t.dispersion = this.dispersion), this.iridescence !== void 0 && (t.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (t.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (t.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (t.iridescenceMap = this.iridescenceMap.toJSON(A).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (t.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(A).uuid), this.anisotropy !== void 0 && (t.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (t.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (t.anisotropyMap = this.anisotropyMap.toJSON(A).uuid), this.map && this.map.isTexture && (t.map = this.map.toJSON(A).uuid), this.matcap && this.matcap.isTexture && (t.matcap = this.matcap.toJSON(A).uuid), this.alphaMap && this.alphaMap.isTexture && (t.alphaMap = this.alphaMap.toJSON(A).uuid), this.lightMap && this.lightMap.isTexture && (t.lightMap = this.lightMap.toJSON(A).uuid, t.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (t.aoMap = this.aoMap.toJSON(A).uuid, t.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (t.bumpMap = this.bumpMap.toJSON(A).uuid, t.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (t.normalMap = this.normalMap.toJSON(A).uuid, t.normalMapType = this.normalMapType, t.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (t.displacementMap = this.displacementMap.toJSON(A).uuid, t.displacementScale = this.displacementScale, t.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (t.roughnessMap = this.roughnessMap.toJSON(A).uuid), this.metalnessMap && this.metalnessMap.isTexture && (t.metalnessMap = this.metalnessMap.toJSON(A).uuid), this.emissiveMap && this.emissiveMap.isTexture && (t.emissiveMap = this.emissiveMap.toJSON(A).uuid), this.specularMap && this.specularMap.isTexture && (t.specularMap = this.specularMap.toJSON(A).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (t.specularIntensityMap = this.specularIntensityMap.toJSON(A).uuid), this.specularColorMap && this.specularColorMap.isTexture && (t.specularColorMap = this.specularColorMap.toJSON(A).uuid), this.envMap && this.envMap.isTexture && (t.envMap = this.envMap.toJSON(A).uuid, this.combine !== void 0 && (t.combine = this.combine)), this.envMapRotation !== void 0 && (t.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (t.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (t.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (t.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (t.gradientMap = this.gradientMap.toJSON(A).uuid), this.transmission !== void 0 && (t.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (t.transmissionMap = this.transmissionMap.toJSON(A).uuid), this.thickness !== void 0 && (t.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (t.thicknessMap = this.thicknessMap.toJSON(A).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (t.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (t.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (t.size = this.size), this.shadowSide !== null && (t.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (t.sizeAttenuation = this.sizeAttenuation), this.blending !== dI && (t.blending = this.blending), this.side !== Jg && (t.side = this.side), this.vertexColors === !0 && (t.vertexColors = !0), this.opacity < 1 && (t.opacity = this.opacity), this.transparent === !0 && (t.transparent = !0), this.blendSrc !== jQ && (t.blendSrc = this.blendSrc), this.blendDst !== WQ && (t.blendDst = this.blendDst), this.blendEquation !== Ni && (t.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (t.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (t.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (t.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (t.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (t.blendAlpha = this.blendAlpha), this.depthFunc !== pI && (t.depthFunc = this.depthFunc), this.depthTest === !1 && (t.depthTest = this.depthTest), this.depthWrite === !1 && (t.depthWrite = this.depthWrite), this.colorWrite === !1 && (t.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (t.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== gE && (t.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (t.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (t.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Vi && (t.stencilFail = this.stencilFail), this.stencilZFail !== Vi && (t.stencilZFail = this.stencilZFail), this.stencilZPass !== Vi && (t.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (t.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (t.rotation = this.rotation), this.polygonOffset === !0 && (t.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (t.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (t.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (t.linewidth = this.linewidth), this.dashSize !== void 0 && (t.dashSize = this.dashSize), this.gapSize !== void 0 && (t.gapSize = this.gapSize), this.scale !== void 0 && (t.scale = this.scale), this.dithering === !0 && (t.dithering = !0), this.alphaTest > 0 && (t.alphaTest = this.alphaTest), this.alphaHash === !0 && (t.alphaHash = !0), this.alphaToCoverage === !0 && (t.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (t.premultipliedAlpha = !0), this.forceSinglePass === !0 && (t.forceSinglePass = !0), this.allowOverride === !1 && (t.allowOverride = !1), this.wireframe === !0 && (t.wireframe = !0), this.wireframeLinewidth > 1 && (t.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (t.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (t.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (t.flatShading = !0), this.visible === !1 && (t.visible = !1), this.toneMapped === !1 && (t.toneMapped = !1), this.fog === !1 && (t.fog = !1), Object.keys(this.userData).length > 0 && (t.userData = this.userData);
25434
+ t.uuid = this.uuid, t.type = this.type, this.name !== "" && (t.name = this.name), this.color && this.color.isColor && (t.color = this.color.getHex()), this.roughness !== void 0 && (t.roughness = this.roughness), this.metalness !== void 0 && (t.metalness = this.metalness), this.sheen !== void 0 && (t.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (t.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (t.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (t.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (t.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (t.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (t.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (t.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (t.shininess = this.shininess), this.clearcoat !== void 0 && (t.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (t.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (t.clearcoatMap = this.clearcoatMap.toJSON(A).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (t.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(A).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (t.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(A).uuid, t.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (t.sheenColorMap = this.sheenColorMap.toJSON(A).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (t.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(A).uuid), this.dispersion !== void 0 && (t.dispersion = this.dispersion), this.iridescence !== void 0 && (t.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (t.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (t.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (t.iridescenceMap = this.iridescenceMap.toJSON(A).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (t.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(A).uuid), this.anisotropy !== void 0 && (t.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (t.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (t.anisotropyMap = this.anisotropyMap.toJSON(A).uuid), this.map && this.map.isTexture && (t.map = this.map.toJSON(A).uuid), this.matcap && this.matcap.isTexture && (t.matcap = this.matcap.toJSON(A).uuid), this.alphaMap && this.alphaMap.isTexture && (t.alphaMap = this.alphaMap.toJSON(A).uuid), this.lightMap && this.lightMap.isTexture && (t.lightMap = this.lightMap.toJSON(A).uuid, t.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (t.aoMap = this.aoMap.toJSON(A).uuid, t.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (t.bumpMap = this.bumpMap.toJSON(A).uuid, t.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (t.normalMap = this.normalMap.toJSON(A).uuid, t.normalMapType = this.normalMapType, t.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (t.displacementMap = this.displacementMap.toJSON(A).uuid, t.displacementScale = this.displacementScale, t.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (t.roughnessMap = this.roughnessMap.toJSON(A).uuid), this.metalnessMap && this.metalnessMap.isTexture && (t.metalnessMap = this.metalnessMap.toJSON(A).uuid), this.emissiveMap && this.emissiveMap.isTexture && (t.emissiveMap = this.emissiveMap.toJSON(A).uuid), this.specularMap && this.specularMap.isTexture && (t.specularMap = this.specularMap.toJSON(A).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (t.specularIntensityMap = this.specularIntensityMap.toJSON(A).uuid), this.specularColorMap && this.specularColorMap.isTexture && (t.specularColorMap = this.specularColorMap.toJSON(A).uuid), this.envMap && this.envMap.isTexture && (t.envMap = this.envMap.toJSON(A).uuid, this.combine !== void 0 && (t.combine = this.combine)), this.envMapRotation !== void 0 && (t.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (t.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (t.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (t.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (t.gradientMap = this.gradientMap.toJSON(A).uuid), this.transmission !== void 0 && (t.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (t.transmissionMap = this.transmissionMap.toJSON(A).uuid), this.thickness !== void 0 && (t.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (t.thicknessMap = this.thicknessMap.toJSON(A).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (t.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (t.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (t.size = this.size), this.shadowSide !== null && (t.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (t.sizeAttenuation = this.sizeAttenuation), this.blending !== xI && (t.blending = this.blending), this.side !== Jg && (t.side = this.side), this.vertexColors === !0 && (t.vertexColors = !0), this.opacity < 1 && (t.opacity = this.opacity), this.transparent === !0 && (t.transparent = !0), this.blendSrc !== jQ && (t.blendSrc = this.blendSrc), this.blendDst !== WQ && (t.blendDst = this.blendDst), this.blendEquation !== Ni && (t.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (t.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (t.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (t.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (t.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (t.blendAlpha = this.blendAlpha), this.depthFunc !== pI && (t.depthFunc = this.depthFunc), this.depthTest === !1 && (t.depthTest = this.depthTest), this.depthWrite === !1 && (t.depthWrite = this.depthWrite), this.colorWrite === !1 && (t.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (t.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== gE && (t.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (t.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (t.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== ji && (t.stencilFail = this.stencilFail), this.stencilZFail !== ji && (t.stencilZFail = this.stencilZFail), this.stencilZPass !== ji && (t.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (t.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (t.rotation = this.rotation), this.polygonOffset === !0 && (t.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (t.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (t.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (t.linewidth = this.linewidth), this.dashSize !== void 0 && (t.dashSize = this.dashSize), this.gapSize !== void 0 && (t.gapSize = this.gapSize), this.scale !== void 0 && (t.scale = this.scale), this.dithering === !0 && (t.dithering = !0), this.alphaTest > 0 && (t.alphaTest = this.alphaTest), this.alphaHash === !0 && (t.alphaHash = !0), this.alphaToCoverage === !0 && (t.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (t.premultipliedAlpha = !0), this.forceSinglePass === !0 && (t.forceSinglePass = !0), this.allowOverride === !1 && (t.allowOverride = !1), this.wireframe === !0 && (t.wireframe = !0), this.wireframeLinewidth > 1 && (t.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (t.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (t.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (t.flatShading = !0), this.visible === !1 && (t.visible = !1), this.toneMapped === !1 && (t.toneMapped = !1), this.fog === !1 && (t.fog = !1), Object.keys(this.userData).length > 0 && (t.userData = this.userData);
25435
25435
  function i(I) {
25436
25436
  const C = [];
25437
25437
  for (const o in I) {
@@ -25871,7 +25871,7 @@ class st extends rg {
25871
25871
  }
25872
25872
  }
25873
25873
  let au = 0;
25874
- const Gt = /* @__PURE__ */ new Ve(), AQ = /* @__PURE__ */ new kt(), gI = /* @__PURE__ */ new v(), wt = /* @__PURE__ */ new uC(), PI = /* @__PURE__ */ new uC(), ze = /* @__PURE__ */ new v();
25874
+ const Gt = /* @__PURE__ */ new Ve(), AQ = /* @__PURE__ */ new kt(), iI = /* @__PURE__ */ new v(), wt = /* @__PURE__ */ new uC(), PI = /* @__PURE__ */ new uC(), ze = /* @__PURE__ */ new v();
25875
25875
  class $t extends kI {
25876
25876
  /**
25877
25877
  * Constructs a new geometry.
@@ -26085,7 +26085,7 @@ class $t extends kI {
26085
26085
  * @return {BufferGeometry} A reference to this instance.
26086
26086
  */
26087
26087
  center() {
26088
- return this.computeBoundingBox(), this.boundingBox.getCenter(gI).negate(), this.translate(gI.x, gI.y, gI.z), this;
26088
+ return this.computeBoundingBox(), this.boundingBox.getCenter(iI).negate(), this.translate(iI.x, iI.y, iI.z), this;
26089
26089
  }
26090
26090
  /**
26091
26091
  * Defines a geometry by creating a `position` attribute based on the given array of points. The array
@@ -26169,7 +26169,7 @@ class $t extends kI {
26169
26169
  for (let I = 0, C = e.length; I < C; I++) {
26170
26170
  const o = e[I], a = this.morphTargetsRelative;
26171
26171
  for (let Q = 0, n = o.count; Q < n; Q++)
26172
- ze.fromBufferAttribute(o, Q), a && (gI.fromBufferAttribute(A, Q), ze.add(gI)), i = Math.max(i, t.distanceToSquared(ze));
26172
+ ze.fromBufferAttribute(o, Q), a && (iI.fromBufferAttribute(A, Q), ze.add(iI)), i = Math.max(i, t.distanceToSquared(ze));
26173
26173
  }
26174
26174
  this.boundingSphere.radius = Math.sqrt(i), isNaN(this.boundingSphere.radius) && Ee('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
26175
26175
  }
@@ -26894,7 +26894,7 @@ class Ut extends dc {
26894
26894
  return e.object.fov = this.fov, e.object.zoom = this.zoom, e.object.near = this.near, e.object.far = this.far, e.object.focus = this.focus, e.object.aspect = this.aspect, this.view !== null && (e.object.view = Object.assign({}, this.view)), e.object.filmGauge = this.filmGauge, e.object.filmOffset = this.filmOffset, e;
26895
26895
  }
26896
26896
  }
26897
- const iI = -90, II = 1;
26897
+ const II = -90, CI = 1;
26898
26898
  class ru extends kt {
26899
26899
  /**
26900
26900
  * Constructs a new cube camera.
@@ -26905,17 +26905,17 @@ class ru extends kt {
26905
26905
  */
26906
26906
  constructor(A, e, t) {
26907
26907
  super(), this.type = "CubeCamera", this.renderTarget = t, this.coordinateSystem = null, this.activeMipmapLevel = 0;
26908
- const i = new Ut(iI, II, A, e);
26908
+ const i = new Ut(II, CI, A, e);
26909
26909
  i.layers = this.layers, this.add(i);
26910
- const I = new Ut(iI, II, A, e);
26910
+ const I = new Ut(II, CI, A, e);
26911
26911
  I.layers = this.layers, this.add(I);
26912
- const C = new Ut(iI, II, A, e);
26912
+ const C = new Ut(II, CI, A, e);
26913
26913
  C.layers = this.layers, this.add(C);
26914
- const o = new Ut(iI, II, A, e);
26914
+ const o = new Ut(II, CI, A, e);
26915
26915
  o.layers = this.layers, this.add(o);
26916
- const a = new Ut(iI, II, A, e);
26916
+ const a = new Ut(II, CI, A, e);
26917
26917
  a.layers = this.layers, this.add(a);
26918
- const Q = new Ut(iI, II, A, e);
26918
+ const Q = new Ut(II, CI, A, e);
26919
26919
  Q.layers = this.layers, this.add(Q);
26920
26920
  }
26921
26921
  /**
@@ -26965,7 +26965,7 @@ class xc extends nt {
26965
26965
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
26966
26966
  * @param {string} [colorSpace=NoColorSpace] - The color space value.
26967
26967
  */
26968
- constructor(A = [], e = Ji, t, i, I, C, o, a, Q, n) {
26968
+ constructor(A = [], e = Yi, t, i, I, C, o, a, Q, n) {
26969
26969
  super(A, e, t, i, I, C, o, a, Q, n), this.isCubeTexture = !0, this.flipY = !1;
26970
26970
  }
26971
26971
  /**
@@ -27629,7 +27629,7 @@ class uu extends hC {
27629
27629
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
27630
27630
  * @param {number} [format=DepthFormat] - The texture format.
27631
27631
  */
27632
- constructor(A, e = dg, t = Ji, i, I, C = tt, o = tt, a, Q = Tg) {
27632
+ constructor(A, e = dg, t = Yi, i, I, C = tt, o = tt, a, Q = Tg) {
27633
27633
  const n = { width: A, height: A, depth: 1 }, s = [n, n, n, n, n, n];
27634
27634
  super(A, A, e, t, i, I, C, o, a, Q), this.image = s, this.isCubeDepthTexture = !0, this.isCubeTexture = !0;
27635
27635
  }
@@ -32962,7 +32962,7 @@ function E2(g) {
32962
32962
  function r2(g) {
32963
32963
  let A = /* @__PURE__ */ new WeakMap();
32964
32964
  function e(C, o) {
32965
- return o === gn ? C.mapping = Ji : o === In && (C.mapping = wI), C;
32965
+ return o === gn ? C.mapping = Yi : o === In && (C.mapping = wI), C;
32966
32966
  }
32967
32967
  function t(C) {
32968
32968
  if (C && C.isTexture) {
@@ -33088,10 +33088,10 @@ class yE {
33088
33088
  this._lodMeshes[A].geometry.dispose();
33089
33089
  }
33090
33090
  _cleanup(A) {
33091
- this._renderer.setRenderTarget(iQ, IQ, CQ), this._renderer.xr.enabled = oQ, A.scissorTest = !1, CI(A, 0, 0, A.width, A.height);
33091
+ this._renderer.setRenderTarget(iQ, IQ, CQ), this._renderer.xr.enabled = oQ, A.scissorTest = !1, oI(A, 0, 0, A.width, A.height);
33092
33092
  }
33093
33093
  _fromTexture(A, e) {
33094
- A.mapping === Ji || A.mapping === wI ? this._setSize(A.image.length === 0 ? 16 : A.image[0].width || A.image[0].image.width) : this._setSize(A.image.width / 4), iQ = this._renderer.getRenderTarget(), IQ = this._renderer.getActiveCubeFace(), CQ = this._renderer.getActiveMipmapLevel(), oQ = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
33094
+ A.mapping === Yi || A.mapping === wI ? this._setSize(A.image.length === 0 ? 16 : A.image[0].width || A.image[0].image.width) : this._setSize(A.image.width / 4), iQ = this._renderer.getRenderTarget(), IQ = this._renderer.getActiveCubeFace(), CQ = this._renderer.getActiveMipmapLevel(), oQ = this._renderer.xr.enabled, this._renderer.xr.enabled = !1;
33095
33095
  const t = e || this._allocateTargets();
33096
33096
  return this._textureToCubeUV(A, t), this._applyPMREM(t), this._cleanup(t), t;
33097
33097
  }
@@ -33135,19 +33135,19 @@ class yE {
33135
33135
  const l = _ % 3;
33136
33136
  l === 0 ? (a.up.set(0, Q[_], 0), a.position.set(I.x, I.y, I.z), a.lookAt(I.x + n[_], I.y, I.z)) : l === 1 ? (a.up.set(0, 0, Q[_]), a.position.set(I.x, I.y, I.z), a.lookAt(I.x, I.y + n[_], I.z)) : (a.up.set(0, Q[_], 0), a.position.set(I.x, I.y, I.z), a.lookAt(I.x, I.y, I.z + n[_]));
33137
33137
  const D = this._cubeSize;
33138
- CI(i, l * D, _ > 2 ? D : 0, D, D), s.setRenderTarget(i), r && s.render(c, a), s.render(A, a);
33138
+ oI(i, l * D, _ > 2 ? D : 0, D, D), s.setRenderTarget(i), r && s.render(c, a), s.render(A, a);
33139
33139
  }
33140
33140
  s.toneMapping = E, s.autoClear = B, A.background = f;
33141
33141
  }
33142
33142
  _textureToCubeUV(A, e) {
33143
- const t = this._renderer, i = A.mapping === Ji || A.mapping === wI;
33143
+ const t = this._renderer, i = A.mapping === Yi || A.mapping === wI;
33144
33144
  i ? (this._cubemapMaterial === null && (this._cubemapMaterial = SE()), this._cubemapMaterial.uniforms.flipEnvMap.value = A.isRenderTargetTexture === !1 ? -1 : 1) : this._equirectMaterial === null && (this._equirectMaterial = NE());
33145
33145
  const I = i ? this._cubemapMaterial : this._equirectMaterial, C = this._lodMeshes[0];
33146
33146
  C.material = I;
33147
33147
  const o = I.uniforms;
33148
33148
  o.envMap.value = A;
33149
33149
  const a = this._cubeSize;
33150
- CI(e, 0, 0, 3 * a, 2 * a), t.setRenderTarget(e), t.render(C, OI);
33150
+ oI(e, 0, 0, 3 * a, 2 * a), t.setRenderTarget(e), t.render(C, OI);
33151
33151
  }
33152
33152
  _applyPMREM(A) {
33153
33153
  const e = this._renderer, t = e.autoClear;
@@ -33172,7 +33172,7 @@ class yE {
33172
33172
  const i = this._renderer, I = this._pingPongRenderTarget, C = this._ggxMaterial, o = this._lodMeshes[t];
33173
33173
  o.material = C;
33174
33174
  const a = C.uniforms, Q = t / (this._lodMeshes.length - 1), n = e / (this._lodMeshes.length - 1), s = Math.sqrt(Q * Q - n * n), B = 0 + Q * 1.25, E = s * B, { _lodMax: d } = this, c = this._sizeLods[t], h = 3 * c * (t > d - oi ? t - d + oi : 0), r = 4 * (this._cubeSize - c);
33175
- a.envMap.value = A.texture, a.roughness.value = E, a.mipInt.value = d - e, CI(I, h, r, 3 * c, 2 * c), i.setRenderTarget(I), i.render(o, OI), a.envMap.value = I.texture, a.roughness.value = 0, a.mipInt.value = d - t, CI(A, h, r, 3 * c, 2 * c), i.setRenderTarget(A), i.render(o, OI);
33175
+ a.envMap.value = A.texture, a.roughness.value = E, a.mipInt.value = d - e, oI(I, h, r, 3 * c, 2 * c), i.setRenderTarget(I), i.render(o, OI), a.envMap.value = I.texture, a.roughness.value = 0, a.mipInt.value = d - t, oI(A, h, r, 3 * c, 2 * c), i.setRenderTarget(A), i.render(o, OI);
33176
33176
  }
33177
33177
  /**
33178
33178
  * This is a two-pass Gaussian blur for a cubemap. Normally this is done
@@ -33231,7 +33231,7 @@ class yE {
33231
33231
  const { _lodMax: _ } = this;
33232
33232
  B.dTheta.value = d, B.mipInt.value = _ - t;
33233
33233
  const l = this._sizeLods[i], D = 3 * l * (i > _ - oi ? i - _ + oi : 0), w = 4 * (this._cubeSize - l);
33234
- CI(e, D, w, 3 * l, 2 * l), a.setRenderTarget(e), a.render(s, OI);
33234
+ oI(e, D, w, 3 * l, 2 * l), a.setRenderTarget(e), a.render(s, OI);
33235
33235
  }
33236
33236
  }
33237
33237
  function d2(g) {
@@ -33278,7 +33278,7 @@ function bE(g, A, e) {
33278
33278
  const t = new Eg(g, A, e);
33279
33279
  return t.texture.mapping = Vo, t.texture.name = "PMREM.cubeUv", t.scissorTest = !0, t;
33280
33280
  }
33281
- function CI(g, A, e, t, i) {
33281
+ function oI(g, A, e, t, i) {
33282
33282
  g.viewport.set(A, e, t, i), g.scissor.set(A, e, t, i);
33283
33283
  }
33284
33284
  function x2(g, A, e) {
@@ -33635,7 +33635,7 @@ function f2(g) {
33635
33635
  let A = /* @__PURE__ */ new WeakMap(), e = null;
33636
33636
  function t(o) {
33637
33637
  if (o && o.isTexture) {
33638
- const a = o.mapping, Q = a === gn || a === In, n = a === Ji || a === wI;
33638
+ const a = o.mapping, Q = a === gn || a === In, n = a === Yi || a === wI;
33639
33639
  if (Q || n) {
33640
33640
  let s = A.get(o);
33641
33641
  const B = s !== void 0 ? s.texture.pmremVersion : 0;
@@ -34700,7 +34700,7 @@ function Up(g) {
34700
34700
  return Fp[g.shadowMapType] || "SHADOWMAP_TYPE_BASIC";
34701
34701
  }
34702
34702
  const Lp = {
34703
- [Ji]: "ENVMAP_TYPE_CUBE",
34703
+ [Yi]: "ENVMAP_TYPE_CUBE",
34704
34704
  [wI]: "ENVMAP_TYPE_CUBE",
34705
34705
  [Vo]: "ENVMAP_TYPE_CUBE_UV"
34706
34706
  };
@@ -35172,7 +35172,7 @@ function jp(g, A, e, t, i, I, C) {
35172
35172
  transmissionMap: G,
35173
35173
  thicknessMap: fA,
35174
35174
  gradientMap: oA,
35175
- opaque: x.transparent === !1 && x.blending === dI && x.alphaToCoverage === !1,
35175
+ opaque: x.transparent === !1 && x.blending === xI && x.alphaToCoverage === !1,
35176
35176
  alphaMap: uA,
35177
35177
  alphaTest: iA,
35178
35178
  alphaHash: z,
@@ -36045,7 +36045,7 @@ function nw(g, A) {
36045
36045
  if (G !== h || xe !== x) {
36046
36046
  if ((r !== Ni || l !== Ni) && (g.blendEquation(g.FUNC_ADD), r = Ni, l = Ni), xe)
36047
36047
  switch (G) {
36048
- case dI:
36048
+ case xI:
36049
36049
  g.blendFuncSeparate(g.ONE, g.ONE_MINUS_SRC_ALPHA, g.ONE, g.ONE_MINUS_SRC_ALPHA);
36050
36050
  break;
36051
36051
  case VQ:
@@ -36063,7 +36063,7 @@ function nw(g, A) {
36063
36063
  }
36064
36064
  else
36065
36065
  switch (G) {
36066
- case dI:
36066
+ case xI:
36067
36067
  g.blendFuncSeparate(g.SRC_ALPHA, g.ONE_MINUS_SRC_ALPHA, g.ONE, g.ONE_MINUS_SRC_ALPHA);
36068
36068
  break;
36069
36069
  case VQ:
@@ -36088,7 +36088,7 @@ function nw(g, A) {
36088
36088
  function pe(G, fA) {
36089
36089
  G.side === Fg ? _A(g.CULL_FACE) : gA(g.CULL_FACE);
36090
36090
  let oA = G.side === Qt;
36091
- fA && (oA = !oA), HA(oA), G.blending === dI && G.transparent === !1 ? de(Lg) : de(G.blending, G.blendEquation, G.blendSrc, G.blendDst, G.blendEquationAlpha, G.blendSrcAlpha, G.blendDstAlpha, G.blendColor, G.blendAlpha, G.premultipliedAlpha), C.setFunc(G.depthFunc), C.setTest(G.depthTest), C.setMask(G.depthWrite), I.setMask(G.colorWrite);
36091
+ fA && (oA = !oA), HA(oA), G.blending === xI && G.transparent === !1 ? de(Lg) : de(G.blending, G.blendEquation, G.blendSrc, G.blendDst, G.blendEquationAlpha, G.blendSrcAlpha, G.blendDstAlpha, G.blendColor, G.blendAlpha, G.premultipliedAlpha), C.setFunc(G.depthFunc), C.setTest(G.depthTest), C.setMask(G.depthWrite), I.setMask(G.colorWrite);
36092
36092
  const uA = G.stencilWrite;
36093
36093
  o.setTest(uA), uA && (o.setMask(G.stencilWriteMask), o.setFunc(G.stencilFunc, G.stencilRef, G.stencilFuncMask), o.setOp(G.stencilFail, G.stencilZFail, G.stencilZPass)), qe(G.polygonOffset, G.polygonOffsetFactor, G.polygonOffsetUnits), G.alphaToCoverage === !0 ? gA(g.SAMPLE_ALPHA_TO_COVERAGE) : _A(g.SAMPLE_ALPHA_TO_COVERAGE);
36094
36094
  }
@@ -38183,9 +38183,9 @@ class Dw {
38183
38183
  else if (he.get("WEBGL_multi_draw"))
38184
38184
  we.renderMultiDraw(K._multiDrawStarts, K._multiDrawCounts, K._multiDrawCount);
38185
38185
  else {
38186
- const GA = K._multiDrawStarts, le = K._multiDrawCounts, Be = K._multiDrawCount, Dt = pA ? O.get(pA).bytesPerElement : 1, qi = u.get(J).currentProgram.getUniforms();
38186
+ const GA = K._multiDrawStarts, le = K._multiDrawCounts, Be = K._multiDrawCount, Dt = pA ? O.get(pA).bytesPerElement : 1, Hi = u.get(J).currentProgram.getUniforms();
38187
38187
  for (let _t = 0; _t < Be; _t++)
38188
- qi.setValue(R, "_gl_DrawID", _t), we.render(GA[_t] / Dt, le[_t]);
38188
+ Hi.setValue(R, "_gl_DrawID", _t), we.render(GA[_t] / Dt, le[_t]);
38189
38189
  }
38190
38190
  else if (K.isInstancedMesh)
38191
38191
  we.renderInstances(WA, Fe, K.count);
@@ -38398,9 +38398,9 @@ class Dw {
38398
38398
  J.version === GA.__version ? (GA.needsLights && GA.lightsStateVersion !== le.state.version || GA.outputColorSpace !== xA || K.isBatchedMesh && GA.batching === !1 || !K.isBatchedMesh && GA.batching === !0 || K.isBatchedMesh && GA.batchingColor === !0 && K.colorTexture === null || K.isBatchedMesh && GA.batchingColor === !1 && K.colorTexture !== null || K.isInstancedMesh && GA.instancing === !1 || !K.isInstancedMesh && GA.instancing === !0 || K.isSkinnedMesh && GA.skinning === !1 || !K.isSkinnedMesh && GA.skinning === !0 || K.isInstancedMesh && GA.instancingColor === !0 && K.instanceColor === null || K.isInstancedMesh && GA.instancingColor === !1 && K.instanceColor !== null || K.isInstancedMesh && GA.instancingMorph === !0 && K.morphTexture === null || K.isInstancedMesh && GA.instancingMorph === !1 && K.morphTexture !== null || GA.envMap !== pA || J.fog === !0 && GA.fog !== cA || GA.numClippingPlanes !== void 0 && (GA.numClippingPlanes !== wA.numPlanes || GA.numIntersection !== wA.numIntersection) || GA.vertexAlphas !== kA || GA.vertexTangents !== MA || GA.morphTargets !== RA || GA.morphNormals !== WA || GA.morphColors !== De || GA.toneMapping !== Fe || GA.morphTargetsCount !== we) && (Be = !0) : (Be = !0, GA.__version = J.version);
38399
38399
  let Dt = GA.currentProgram;
38400
38400
  Be === !0 && (Dt = yC(J, U, K));
38401
- let qi = !1, _t = !1, GI = !1;
38401
+ let Hi = !1, _t = !1, GI = !1;
38402
38402
  const Ne = Dt.getUniforms(), Bt = GA.uniforms;
38403
- if (bA.useProgram(Dt.program) && (qi = !0, _t = !0, GI = !0), J.id !== H && (H = J.id, _t = !0), qi || V !== m) {
38403
+ if (bA.useProgram(Dt.program) && (Hi = !0, _t = !0, GI = !0), J.id !== H && (H = J.id, _t = !0), Hi || V !== m) {
38404
38404
  bA.buffers.depth.getReversed() && m.reversedDepth !== !0 && (m._reversedDepth = !0, m.updateProjectionMatrix()), Ne.setValue(R, "projectionMatrix", m.projectionMatrix), Ne.setValue(R, "viewMatrix", m.matrixWorldInverse);
38405
38405
  const Et = Ne.map.cameraPosition;
38406
38406
  Et !== void 0 && Et.setValue(R, Qe.setFromMatrixPosition(m.matrixWorld)), ye.logarithmicDepthBuffer && Ne.setValue(
@@ -38548,7 +38548,7 @@ class Dw {
38548
38548
  const we = oA.convert(U.format), GA = oA.convert(U.type);
38549
38549
  let le;
38550
38550
  U.isData3DTexture ? (M.setTexture3D(U, 0), le = R.TEXTURE_3D) : U.isDataArrayTexture || U.isCompressedArrayTexture ? (M.setTexture2DArray(U, 0), le = R.TEXTURE_2D_ARRAY) : (M.setTexture2D(U, 0), le = R.TEXTURE_2D), R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL, U.flipY), R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL, U.premultiplyAlpha), R.pixelStorei(R.UNPACK_ALIGNMENT, U.unpackAlignment);
38551
- const Be = R.getParameter(R.UNPACK_ROW_LENGTH), Dt = R.getParameter(R.UNPACK_IMAGE_HEIGHT), qi = R.getParameter(R.UNPACK_SKIP_PIXELS), _t = R.getParameter(R.UNPACK_SKIP_ROWS), GI = R.getParameter(R.UNPACK_SKIP_IMAGES);
38551
+ const Be = R.getParameter(R.UNPACK_ROW_LENGTH), Dt = R.getParameter(R.UNPACK_IMAGE_HEIGHT), Hi = R.getParameter(R.UNPACK_SKIP_PIXELS), _t = R.getParameter(R.UNPACK_SKIP_ROWS), GI = R.getParameter(R.UNPACK_SKIP_IMAGES);
38552
38552
  R.pixelStorei(R.UNPACK_ROW_LENGTH, Ue.width), R.pixelStorei(R.UNPACK_IMAGE_HEIGHT, Ue.height), R.pixelStorei(R.UNPACK_SKIP_PIXELS, kA), R.pixelStorei(R.UNPACK_SKIP_ROWS, MA), R.pixelStorei(R.UNPACK_SKIP_IMAGES, RA);
38553
38553
  const Ne = m.isDataArrayTexture || m.isData3DTexture, Bt = U.isDataArrayTexture || U.isData3DTexture;
38554
38554
  if (m.isDepthTexture) {
@@ -38565,7 +38565,7 @@ class Dw {
38565
38565
  bA.bindFramebuffer(R.READ_FRAMEBUFFER, null), bA.bindFramebuffer(R.DRAW_FRAMEBUFFER, null);
38566
38566
  } else
38567
38567
  Bt ? m.isDataTexture || m.isData3DTexture ? R.texSubImage3D(le, cA, WA, De, Fe, DA, xA, pA, we, GA, Ue.data) : U.isCompressedArrayTexture ? R.compressedTexSubImage3D(le, cA, WA, De, Fe, DA, xA, pA, we, Ue.data) : R.texSubImage3D(le, cA, WA, De, Fe, DA, xA, pA, we, GA, Ue) : m.isDataTexture ? R.texSubImage2D(R.TEXTURE_2D, cA, WA, De, DA, xA, we, GA, Ue.data) : m.isCompressedTexture ? R.compressedTexSubImage2D(R.TEXTURE_2D, cA, WA, De, Ue.width, Ue.height, we, Ue.data) : R.texSubImage2D(R.TEXTURE_2D, cA, WA, De, DA, xA, we, GA, Ue);
38568
- R.pixelStorei(R.UNPACK_ROW_LENGTH, Be), R.pixelStorei(R.UNPACK_IMAGE_HEIGHT, Dt), R.pixelStorei(R.UNPACK_SKIP_PIXELS, qi), R.pixelStorei(R.UNPACK_SKIP_ROWS, _t), R.pixelStorei(R.UNPACK_SKIP_IMAGES, GI), cA === 0 && U.generateMipmaps && R.generateMipmap(le), bA.unbindTexture();
38568
+ R.pixelStorei(R.UNPACK_ROW_LENGTH, Be), R.pixelStorei(R.UNPACK_IMAGE_HEIGHT, Dt), R.pixelStorei(R.UNPACK_SKIP_PIXELS, Hi), R.pixelStorei(R.UNPACK_SKIP_ROWS, _t), R.pixelStorei(R.UNPACK_SKIP_IMAGES, GI), cA === 0 && U.generateMipmaps && R.generateMipmap(le), bA.unbindTexture();
38569
38569
  }, this.initRenderTarget = function(m) {
38570
38570
  u.get(m).__webglFramebuffer === void 0 && M.setupRenderTarget(m);
38571
38571
  }, this.initTexture = function(m) {
@@ -40038,7 +40038,7 @@ var kw = Object.defineProperty, Rw = Object.getOwnPropertyDescriptor, wC = (g, A
40038
40038
  (C = g[I]) && (i = (t ? C(A, e, i) : C(i)) || i);
40039
40039
  return t && i && kw(A, e, i), i;
40040
40040
  };
40041
- let Yi = class extends ng {
40041
+ let Ti = class extends ng {
40042
40042
  constructor() {
40043
40043
  super(...arguments), this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsContent = "", this.modalTitle = "Before we start", this.modalContainer = null;
40044
40044
  }
@@ -40296,26 +40296,26 @@ let Yi = class extends ng {
40296
40296
  return ee``;
40297
40297
  }
40298
40298
  };
40299
- Yi.styles = NI`
40299
+ Ti.styles = NI`
40300
40300
  :host {
40301
40301
  display: contents;
40302
40302
  }
40303
40303
  `;
40304
40304
  wC([
40305
40305
  j({ type: String, attribute: "privacy-url" })
40306
- ], Yi.prototype, "privacyUrl", 2);
40306
+ ], Ti.prototype, "privacyUrl", 2);
40307
40307
  wC([
40308
40308
  j({ type: String, attribute: "terms-url" })
40309
- ], Yi.prototype, "termsUrl", 2);
40309
+ ], Ti.prototype, "termsUrl", 2);
40310
40310
  wC([
40311
40311
  j({ type: String, attribute: "terms-content" })
40312
- ], Yi.prototype, "termsContent", 2);
40312
+ ], Ti.prototype, "termsContent", 2);
40313
40313
  wC([
40314
40314
  j({ type: String, attribute: "modal-title" })
40315
- ], Yi.prototype, "modalTitle", 2);
40316
- Yi = wC([
40315
+ ], Ti.prototype, "modalTitle", 2);
40316
+ Ti = wC([
40317
40317
  SI("hanc-privacy-modal")
40318
- ], Yi);
40318
+ ], Ti);
40319
40319
  const Gw = NI`
40320
40320
  :host {
40321
40321
  display: block;
@@ -40646,7 +40646,7 @@ var Uw = Object.defineProperty, Lw = Object.getOwnPropertyDescriptor, jA = (g, A
40646
40646
  };
40647
40647
  let TA = class extends ng {
40648
40648
  constructor() {
40649
- super(...arguments), this.callManager = new _I(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.formVisible = !1, this.formRequestId = "", this.formFields = [], this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", 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 (g) => {
40649
+ super(...arguments), this.callManager = new Ji(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.formVisible = !1, this.formRequestId = "", this.formFields = [], this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", 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 (g) => {
40650
40650
  const e = g.detail;
40651
40651
  if (!(!e || !this.audioAnalyzer))
40652
40652
  try {
@@ -40708,7 +40708,7 @@ let TA = class extends ng {
40708
40708
  this.showPrivacyModal = !0;
40709
40709
  return;
40710
40710
  }
40711
- this.user_identity = Bi(), this.callStatus = "connecting", await this.callManager.makeCall({
40711
+ this.user_identity = Bi(), this.callStatus = "connecting", this.resetCallManager(), await this.callManager.makeCall({
40712
40712
  agentId: this.agentId,
40713
40713
  user_identity: this.user_identity
40714
40714
  });
@@ -40731,7 +40731,7 @@ let TA = class extends ng {
40731
40731
  }, this.handleFormDone = () => {
40732
40732
  this.formVisible = !1;
40733
40733
  }, this.handlePrivacyAccept = async () => {
40734
- ta(), this.user_identity = Bi(), this.showPrivacyModal = !1, this.callStatus = "connecting", await this.callManager.makeCall({
40734
+ ta(), this.user_identity = Bi(), this.showPrivacyModal = !1, this.callStatus = "connecting", this.resetCallManager(), await this.callManager.makeCall({
40735
40735
  agentId: this.agentId,
40736
40736
  user_identity: this.user_identity
40737
40737
  });
@@ -40744,10 +40744,7 @@ let TA = class extends ng {
40744
40744
  enabled: this.soundEnabled,
40745
40745
  volume: this.soundVolume,
40746
40746
  preset: this.soundPreset
40747
- }), this.callManager.addEventListener(
40748
- "status-changed",
40749
- this.handleStatusChange
40750
- ), this.callManager.addEventListener("audio-track", this.handleAudioTrack), this.callManager.addEventListener("local-audio-track", this.handleLocalAudioTrack), this.callManager.addEventListener("microphone-enabled", this.handleMicrophoneEnabled), this.callManager.addEventListener("microphone-disabled", this.handleMicrophoneDisabled), this.callManager.addEventListener("agent-command", this.handleAgentCommand), this.loadWidgetConfig();
40747
+ }), this.attachCallManagerListeners(this.callManager), this.loadWidgetConfig();
40751
40748
  }
40752
40749
  async loadWidgetConfig() {
40753
40750
  if (this.skipFetch) {
@@ -40776,10 +40773,7 @@ let TA = class extends ng {
40776
40773
  }
40777
40774
  disconnectedCallback() {
40778
40775
  var g;
40779
- super.disconnectedCallback(), this.callManager.removeEventListener(
40780
- "status-changed",
40781
- this.handleStatusChange
40782
- ), this.callManager.removeEventListener("audio-track", this.handleAudioTrack), this.callManager.removeEventListener("local-audio-track", this.handleLocalAudioTrack), this.callManager.removeEventListener("microphone-enabled", this.handleMicrophoneEnabled), this.callManager.removeEventListener("microphone-disabled", this.handleMicrophoneDisabled), this.callManager.removeEventListener("agent-command", this.handleAgentCommand), this.callManager.hangUp(), this.cleanupOrb(), (g = this.soundManager) == null || g.destroy(), this.soundManager = null;
40776
+ super.disconnectedCallback(), this.detachCallManagerListeners(this.callManager), this.callManager.hangUp(), this.cleanupOrb(), (g = this.soundManager) == null || g.destroy(), this.soundManager = null;
40783
40777
  }
40784
40778
  firstUpdated() {
40785
40779
  this.applyTheme(), this.initializeOrb();
@@ -40837,6 +40831,16 @@ let TA = class extends ng {
40837
40831
  };
40838
40832
  this.animationId = requestAnimationFrame(g);
40839
40833
  }
40834
+ attachCallManagerListeners(g) {
40835
+ g.addEventListener("status-changed", this.handleStatusChange), g.addEventListener("audio-track", this.handleAudioTrack), g.addEventListener("local-audio-track", this.handleLocalAudioTrack), g.addEventListener("microphone-enabled", this.handleMicrophoneEnabled), g.addEventListener("microphone-disabled", this.handleMicrophoneDisabled), g.addEventListener("agent-command", this.handleAgentCommand);
40836
+ }
40837
+ detachCallManagerListeners(g) {
40838
+ g.removeEventListener("status-changed", this.handleStatusChange), g.removeEventListener("audio-track", this.handleAudioTrack), g.removeEventListener("local-audio-track", this.handleLocalAudioTrack), g.removeEventListener("microphone-enabled", this.handleMicrophoneEnabled), g.removeEventListener("microphone-disabled", this.handleMicrophoneDisabled), g.removeEventListener("agent-command", this.handleAgentCommand);
40839
+ }
40840
+ // Fresh manager per call: prevents stale async events from mutating new call state.
40841
+ resetCallManager() {
40842
+ this.detachCallManagerListeners(this.callManager), this.callManager.hangUp(), this.callManager = new Ji(), this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), this.attachCallManagerListeners(this.callManager);
40843
+ }
40840
40844
  getButtonIcon() {
40841
40845
  return this.callStatus === "connecting" ? ee`
40842
40846
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" class="hanc-spinner">
@@ -41298,7 +41302,7 @@ var Kw = Object.defineProperty, vw = Object.getOwnPropertyDescriptor, ge = (g, A
41298
41302
  };
41299
41303
  let XA = class extends ng {
41300
41304
  constructor() {
41301
- super(...arguments), this.callManager = new _I(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this._disconnectTimer = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", 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 (g) => {
41305
+ super(...arguments), this.callManager = new Ji(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this._disconnectTimer = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", 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 (g) => {
41302
41306
  const e = g.detail;
41303
41307
  if (!(!e || !this.audioAnalyzer))
41304
41308
  try {
@@ -41914,7 +41918,7 @@ var Jw = Object.defineProperty, Yw = Object.getOwnPropertyDescriptor, ie = (g, A
41914
41918
  };
41915
41919
  let ZA = class extends ng {
41916
41920
  constructor() {
41917
- super(...arguments), this.callManager = new _I(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", 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 (g) => {
41921
+ super(...arguments), this.callManager = new Ji(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", 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 (g) => {
41918
41922
  const e = g.detail;
41919
41923
  if (!(!e || !this.audioAnalyzer))
41920
41924
  try {
@@ -42464,7 +42468,7 @@ var Tw = Object.defineProperty, qw = Object.getOwnPropertyDescriptor, Ae = (g, A
42464
42468
  };
42465
42469
  let VA = class extends ng {
42466
42470
  constructor() {
42467
- super(...arguments), this.callManager = new _I(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.position = "bottom-right", this.orbSize = 48, this.theme = "default", 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 (g) => {
42471
+ super(...arguments), this.callManager = new Ji(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Ko(), this.animationId = null, this.user_identity = ga(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = pC, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.position = "bottom-right", this.orbSize = 48, this.theme = "default", 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 (g) => {
42468
42472
  const e = g.detail;
42469
42473
  if (!(!e || !this.audioAnalyzer))
42470
42474
  try {