hanc-webrtc-widgets 2.6.10 → 2.6.13

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.
@@ -581,7 +581,7 @@ const Cg = { attribute: !0, type: String, converter: no, reflect: !1, hasChanged
581
581
  }
582
582
  throw Error("Unsupported decorator location: " + n);
583
583
  };
584
- function $(i) {
584
+ function X(i) {
585
585
  return (e, t) => typeof t == "object" ? Eg(i, e, t) : ((n, s, r) => {
586
586
  const a = s.hasOwnProperty(r);
587
587
  return s.constructor.createProperty(r, a ? { ...n, wrapped: !0 } : n), a ? Object.getOwnPropertyDescriptor(s, r) : void 0;
@@ -593,7 +593,7 @@ function $(i) {
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
595
  function St(i) {
596
- return $({ ...i, state: !0, attribute: !1 });
596
+ return X({ ...i, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
599
599
  * @license
@@ -739,7 +739,7 @@ var Ng = Object.defineProperty, Og = (i, e, t) => e in i ? Ng(i, e, {
739
739
  writable: !0,
740
740
  value: t
741
741
  }) : i[e] = t, Tu = (i, e, t) => Og(i, typeof e != "symbol" ? e + "" : e, t);
742
- class gn {
742
+ class bn {
743
743
  constructor() {
744
744
  Tu(this, "_locking"), Tu(this, "_locks"), this._locking = Promise.resolve(), this._locks = 0;
745
745
  }
@@ -2706,7 +2706,7 @@ const V = vv(
2706
2706
  }
2707
2707
  }
2708
2708
  );
2709
- class fn extends Md {
2709
+ class mn extends Md {
2710
2710
  constructor(e) {
2711
2711
  super(), this.seconds = kt.zero, this.nanos = 0, V.util.initPartial(e, this);
2712
2712
  }
@@ -2740,31 +2740,31 @@ class fn extends Md {
2740
2740
  return new Date(Number(this.seconds) * 1e3 + Math.ceil(this.nanos / 1e6));
2741
2741
  }
2742
2742
  static now() {
2743
- return fn.fromDate(/* @__PURE__ */ new Date());
2743
+ return mn.fromDate(/* @__PURE__ */ new Date());
2744
2744
  }
2745
2745
  static fromDate(e) {
2746
2746
  const t = e.getTime();
2747
- return new fn({
2747
+ return new mn({
2748
2748
  seconds: kt.parse(Math.floor(t / 1e3)),
2749
2749
  nanos: t % 1e3 * 1e6
2750
2750
  });
2751
2751
  }
2752
2752
  static fromBinary(e, t) {
2753
- return new fn().fromBinary(e, t);
2753
+ return new mn().fromBinary(e, t);
2754
2754
  }
2755
2755
  static fromJson(e, t) {
2756
- return new fn().fromJson(e, t);
2756
+ return new mn().fromJson(e, t);
2757
2757
  }
2758
2758
  static fromJsonString(e, t) {
2759
- return new fn().fromJsonString(e, t);
2759
+ return new mn().fromJsonString(e, t);
2760
2760
  }
2761
2761
  static equals(e, t) {
2762
- return V.util.equals(fn, e, t);
2762
+ return V.util.equals(mn, e, t);
2763
2763
  }
2764
2764
  }
2765
- fn.runtime = V;
2766
- fn.typeName = "google.protobuf.Timestamp";
2767
- fn.fields = V.util.newFieldList(() => [{
2765
+ mn.runtime = V;
2766
+ mn.typeName = "google.protobuf.Timestamp";
2767
+ mn.fields = V.util.newFieldList(() => [{
2768
2768
  no: 1,
2769
2769
  name: "seconds",
2770
2770
  kind: "scalar",
@@ -2787,7 +2787,7 @@ const wv = /* @__PURE__ */ V.makeMessageType("livekit.MetricsBatch", () => [{
2787
2787
  no: 2,
2788
2788
  name: "normalized_timestamp",
2789
2789
  kind: "message",
2790
- T: fn
2790
+ T: mn
2791
2791
  }, {
2792
2792
  no: 3,
2793
2793
  name: "str_data",
@@ -2846,7 +2846,7 @@ const wv = /* @__PURE__ */ V.makeMessageType("livekit.MetricsBatch", () => [{
2846
2846
  no: 2,
2847
2847
  name: "normalized_timestamp",
2848
2848
  kind: "message",
2849
- T: fn
2849
+ T: mn
2850
2850
  }, {
2851
2851
  no: 3,
2852
2852
  name: "value",
@@ -2887,12 +2887,12 @@ const wv = /* @__PURE__ */ V.makeMessageType("livekit.MetricsBatch", () => [{
2887
2887
  no: 6,
2888
2888
  name: "normalized_start_timestamp",
2889
2889
  kind: "message",
2890
- T: fn
2890
+ T: mn
2891
2891
  }, {
2892
2892
  no: 7,
2893
2893
  name: "normalized_end_timestamp",
2894
2894
  kind: "message",
2895
- T: fn,
2895
+ T: mn,
2896
2896
  opt: !0
2897
2897
  }, {
2898
2898
  no: 8,
@@ -3532,11 +3532,11 @@ const wv = /* @__PURE__ */ V.makeMessageType("livekit.MetricsBatch", () => [{
3532
3532
  kind: "scalar",
3533
3533
  T: 9
3534
3534
  /* ScalarType.STRING */
3535
- }]), pn = /* @__PURE__ */ V.makeMessageType("livekit.DataPacket", () => [{
3535
+ }]), gn = /* @__PURE__ */ V.makeMessageType("livekit.DataPacket", () => [{
3536
3536
  no: 1,
3537
3537
  name: "kind",
3538
3538
  kind: "enum",
3539
- T: V.getEnumType(je)
3539
+ T: V.getEnumType(qe)
3540
3540
  }, {
3541
3541
  no: 4,
3542
3542
  name: "participant_identity",
@@ -3633,7 +3633,7 @@ const wv = /* @__PURE__ */ V.makeMessageType("livekit.MetricsBatch", () => [{
3633
3633
  kind: "scalar",
3634
3634
  T: 9
3635
3635
  /* ScalarType.STRING */
3636
- }]), je = /* @__PURE__ */ V.makeEnum("livekit.DataPacket.Kind", [{
3636
+ }]), qe = /* @__PURE__ */ V.makeEnum("livekit.DataPacket.Kind", [{
3637
3637
  no: 0,
3638
3638
  name: "RELIABLE"
3639
3639
  }, {
@@ -5549,12 +5549,12 @@ var jn;
5549
5549
  (function(i) {
5550
5550
  i.Default = "livekit", i.Room = "livekit-room", i.Participant = "livekit-participant", i.Track = "livekit-track", i.Publication = "livekit-track-publication", i.Engine = "livekit-engine", i.Signal = "livekit-signal", i.PCManager = "livekit-pc-manager", i.PCTransport = "livekit-pc-transport", i.E2EE = "lk-e2ee";
5551
5551
  })(jn || (jn = {}));
5552
- let nt = Eo.getLogger("livekit");
5552
+ let Qe = Eo.getLogger("livekit");
5553
5553
  Object.values(jn).map((i) => Eo.getLogger(i));
5554
- nt.setDefaultLevel(tl.info);
5554
+ Qe.setDefaultLevel(tl.info);
5555
5555
  function Pi(i) {
5556
5556
  const e = Eo.getLogger(i);
5557
- return e.setDefaultLevel(nt.getLevel()), e;
5557
+ return e.setDefaultLevel(Qe.getLevel()), e;
5558
5558
  }
5559
5559
  const h0 = Eo.getLogger("lk-e2ee"), _r = 7e3, f0 = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, _r, _r, _r, _r, _r];
5560
5560
  class p0 {
@@ -7390,11 +7390,11 @@ function R0() {
7390
7390
  return typeof window.RTCRtpSender < "u" && // @ts-ignore
7391
7391
  typeof window.RTCRtpSender.prototype.createEncodedStreams < "u";
7392
7392
  }
7393
- class oM extends hi.EventEmitter {
7393
+ class rM extends hi.EventEmitter {
7394
7394
  constructor() {
7395
7395
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
7396
7396
  super(), this.onKeyRatcheted = (t, n, s) => {
7397
- nt.debug("key ratcheted event received", {
7397
+ Qe.debug("key ratcheted event received", {
7398
7398
  ratchetResult: t,
7399
7399
  participantId: n,
7400
7400
  keyIndex: s
@@ -7618,13 +7618,13 @@ class Z extends hi.EventEmitter {
7618
7618
  constructor(e, t) {
7619
7619
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
7620
7620
  var s;
7621
- super(), this.attachedElements = [], this.isMuted = !1, this._streamState = Z.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = nt, this.appVisibilityChangedListener = () => {
7621
+ super(), this.attachedElements = [], this.isMuted = !1, this._streamState = Z.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = Qe, this.appVisibilityChangedListener = () => {
7622
7622
  this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), O0) : this.handleAppVisibilityChanged();
7623
7623
  }, this.log = Pi((s = n.loggerName) !== null && s !== void 0 ? s : jn.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = Z.Source.Unknown;
7624
7624
  }
7625
7625
  get logContext() {
7626
7626
  var e;
7627
- return Object.assign(Object.assign({}, (e = this.loggerContextCb) === null || e === void 0 ? void 0 : e.call(this)), Ze(this));
7627
+ return Object.assign(Object.assign({}, (e = this.loggerContextCb) === null || e === void 0 ? void 0 : e.call(this)), Je(this));
7628
7628
  }
7629
7629
  /** current receive bits per second */
7630
7630
  get currentBitrate() {
@@ -7650,7 +7650,7 @@ class Z extends hi.EventEmitter {
7650
7650
  return e.play().then(() => {
7651
7651
  this.emit(s ? ae.AudioPlaybackStarted : ae.VideoPlaybackStarted);
7652
7652
  }).catch((r) => {
7653
- r.name === "NotAllowedError" ? this.emit(s ? ae.AudioPlaybackFailed : ae.VideoPlaybackFailed, r) : r.name === "AbortError" ? nt.debug("".concat(s ? "audio" : "video", " playback aborted, likely due to new play request")) : nt.warn("could not playback ".concat(s ? "audio" : "video"), r), s && e && n.some((a) => a.kind === "video") && r.name === "NotAllowedError" && (e.muted = !0, e.play().catch(() => {
7653
+ r.name === "NotAllowedError" ? this.emit(s ? ae.AudioPlaybackFailed : ae.VideoPlaybackFailed, r) : r.name === "AbortError" ? Qe.debug("".concat(s ? "audio" : "video", " playback aborted, likely due to new play request")) : Qe.warn("could not playback ".concat(s ? "audio" : "video"), r), s && e && n.some((a) => a.kind === "video") && r.name === "NotAllowedError" && (e.muted = !0, e.play().catch(() => {
7654
7654
  }));
7655
7655
  }), this.emit(ae.ElementAttached, e), e;
7656
7656
  }
@@ -7701,10 +7701,10 @@ class Z extends hi.EventEmitter {
7701
7701
  });
7702
7702
  }
7703
7703
  addAppVisibilityListener() {
7704
- mn() ? (this.isInBackground = document.visibilityState === "hidden", document.addEventListener("visibilitychange", this.appVisibilityChangedListener)) : this.isInBackground = !1;
7704
+ vn() ? (this.isInBackground = document.visibilityState === "hidden", document.addEventListener("visibilitychange", this.appVisibilityChangedListener)) : this.isInBackground = !1;
7705
7705
  }
7706
7706
  removeAppVisibilityListener() {
7707
- mn() && document.removeEventListener("visibilitychange", this.appVisibilityChangedListener);
7707
+ vn() && document.removeEventListener("visibilitychange", this.appVisibilityChangedListener);
7708
7708
  }
7709
7709
  }
7710
7710
  function Ys(i, e) {
@@ -7886,7 +7886,7 @@ function G0(i) {
7886
7886
  const e = i.split(V0);
7887
7887
  return e.length > 1 ? [e[0], i.substr(e[0].length + 1)] : [i, ""];
7888
7888
  }
7889
- function vn(i) {
7889
+ function yn(i) {
7890
7890
  return P(this, void 0, void 0, function* () {
7891
7891
  return new Promise((e) => Zt.setTimeout(e, i));
7892
7892
  });
@@ -7960,7 +7960,7 @@ function $0(i) {
7960
7960
  }
7961
7961
  function Kp() {
7962
7962
  var i, e;
7963
- return mn() ? (
7963
+ return vn() ? (
7964
7964
  // @ts-expect-error `userAgentData` is not yet part of typescript
7965
7965
  (e = (i = navigator.userAgentData) === null || i === void 0 ? void 0 : i.mobile) !== null && e !== void 0 ? e : /Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent)
7966
7966
  ) : !1;
@@ -7970,7 +7970,7 @@ function X0() {
7970
7970
  if (i)
7971
7971
  return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && di(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && di(i.version, e) >= 0;
7972
7972
  }
7973
- function mn() {
7973
+ function vn() {
7974
7974
  return typeof document < "u";
7975
7975
  }
7976
7976
  function li() {
@@ -7991,7 +7991,7 @@ function Zp() {
7991
7991
  return i.platform;
7992
7992
  }
7993
7993
  function nh() {
7994
- if (mn())
7994
+ if (vn())
7995
7995
  return window.devicePixelRatio;
7996
7996
  if (li()) {
7997
7997
  let i = Jp();
@@ -8250,7 +8250,7 @@ function em(i) {
8250
8250
  const s = n.createAnalyser();
8251
8251
  s.fftSize = 2048;
8252
8252
  const r = s.frequencyBinCount, a = new Uint8Array(r);
8253
- n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(s), yield vn(t), s.getByteTimeDomainData(a);
8253
+ n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(s), yield yn(t), s.getByteTimeDomainData(a);
8254
8254
  const c = a.some((l) => l !== 128 && l !== 0);
8255
8255
  return n.close(), !c;
8256
8256
  }
@@ -8331,7 +8331,7 @@ function ob(i) {
8331
8331
  }));
8332
8332
  }), e;
8333
8333
  }
8334
- function Ze(i) {
8334
+ function Je(i) {
8335
8335
  return "mediaStreamTrack" in i ? {
8336
8336
  trackID: i.sid,
8337
8337
  source: i.source,
@@ -8350,7 +8350,7 @@ function Ze(i) {
8350
8350
  encrypted: i.isEncrypted,
8351
8351
  kind: i.kind,
8352
8352
  source: i.source
8353
- }, i.track ? Ze(i.track) : {})
8353
+ }, i.track ? Je(i.track) : {})
8354
8354
  };
8355
8355
  }
8356
8356
  function cb() {
@@ -8408,7 +8408,7 @@ class hb extends hi.EventEmitter {
8408
8408
  } = t.data;
8409
8409
  switch (r) {
8410
8410
  case "error":
8411
- nt.error(a.error.message), this.emit(Yi.EncryptionError, a.error);
8411
+ Qe.error(a.error.message), this.emit(Yi.EncryptionError, a.error);
8412
8412
  break;
8413
8413
  case "initAck":
8414
8414
  a.enabled && this.keyProvider.getKeys().forEach((o) => {
@@ -8432,7 +8432,7 @@ class hb extends hi.EventEmitter {
8432
8432
  break;
8433
8433
  }
8434
8434
  }, this.onWorkerError = (t) => {
8435
- nt.error("e2ee worker encountered an error:", {
8435
+ Qe.error("e2ee worker encountered an error:", {
8436
8436
  error: t.error
8437
8437
  }), this.emit(Yi.EncryptionError, t.error);
8438
8438
  }, this.keyProvider = e.keyProvider, this.worker = e.worker, this.encryptionEnabled = !1;
@@ -8443,7 +8443,7 @@ class hb extends hi.EventEmitter {
8443
8443
  setup(e) {
8444
8444
  if (!A0())
8445
8445
  throw new Ud("tried to setup end-to-end encryption on an unsupported browser");
8446
- if (nt.info("setting up e2ee"), e !== this.room) {
8446
+ if (Qe.info("setting up e2ee"), e !== this.room) {
8447
8447
  this.room = e, this.setupEventListeners(e, this.keyProvider);
8448
8448
  const t = {
8449
8449
  kind: "init",
@@ -8452,7 +8452,7 @@ class hb extends hi.EventEmitter {
8452
8452
  loglevel: h0.getLevel()
8453
8453
  }
8454
8454
  };
8455
- this.worker && (nt.info("initializing worker", {
8455
+ this.worker && (Qe.info("initializing worker", {
8456
8456
  worker: this.worker
8457
8457
  }), this.worker.onmessage = this.onWorkerMessage, this.worker.onerror = this.onWorkerError, this.worker.postMessage(t));
8458
8458
  }
@@ -8461,13 +8461,13 @@ class hb extends hi.EventEmitter {
8461
8461
  * @internal
8462
8462
  */
8463
8463
  setParticipantCryptorEnabled(e, t) {
8464
- nt.debug("set e2ee to ".concat(e, " for participant ").concat(t)), this.postEnable(e, t);
8464
+ Qe.debug("set e2ee to ".concat(e, " for participant ").concat(t)), this.postEnable(e, t);
8465
8465
  }
8466
8466
  /**
8467
8467
  * @internal
8468
8468
  */
8469
8469
  setSifTrailer(e) {
8470
- !e || e.length === 0 ? nt.warn("ignoring server sent trailer as it's empty") : this.postSifTrailer(e);
8470
+ !e || e.length === 0 ? Qe.warn("ignoring server sent trailer as it's empty") : this.postSifTrailer(e);
8471
8471
  }
8472
8472
  setupEngine(e) {
8473
8473
  e.on(le.RTPVideoMapUpdate, (t) => {
@@ -8595,7 +8595,7 @@ class hb extends hi.EventEmitter {
8595
8595
  }
8596
8596
  setupE2EESender(e, t) {
8597
8597
  if (!tr(e) || !t) {
8598
- t || nt.warn("early return because sender is not ready");
8598
+ t || Qe.warn("early return because sender is not ready");
8599
8599
  return;
8600
8600
  }
8601
8601
  this.handleSender(t, e.mediaStreamID, void 0);
@@ -8662,7 +8662,7 @@ class hb extends hi.EventEmitter {
8662
8662
  if (!(!((s = this.room) === null || s === void 0) && s.localParticipant.identity) || this.room.localParticipant.identity === "")
8663
8663
  throw TypeError("local identity needs to be known in order to set up encrypted sender");
8664
8664
  if (cl()) {
8665
- nt.info("initialize script transform");
8665
+ Qe.info("initialize script transform");
8666
8666
  const r = {
8667
8667
  kind: "encode",
8668
8668
  participantIdentity: this.room.localParticipant.identity,
@@ -8671,7 +8671,7 @@ class hb extends hi.EventEmitter {
8671
8671
  };
8672
8672
  e.transform = new RTCRtpScriptTransform(this.worker, r);
8673
8673
  } else {
8674
- nt.info("initialize encoded streams");
8674
+ Qe.info("initialize encoded streams");
8675
8675
  const r = e.createEncodedStreams(), a = {
8676
8676
  kind: "encode",
8677
8677
  data: {
@@ -8707,11 +8707,11 @@ class Jt {
8707
8707
  return function* () {
8708
8708
  var r;
8709
8709
  if (((r = Jt.userMediaPromiseMap) === null || r === void 0 ? void 0 : r.size) > 0) {
8710
- nt.debug("awaiting getUserMedia promise");
8710
+ Qe.debug("awaiting getUserMedia promise");
8711
8711
  try {
8712
8712
  t ? yield Jt.userMediaPromiseMap.get(t) : yield Promise.all(Jt.userMediaPromiseMap.values());
8713
8713
  } catch {
8714
- nt.warn("error waiting for media permissons");
8714
+ Qe.warn("error waiting for media permissons");
8715
8715
  }
8716
8716
  }
8717
8717
  let a = yield navigator.mediaDevices.enumerateDevices();
@@ -8742,12 +8742,12 @@ class Jt {
8742
8742
  return t;
8743
8743
  const s = yield this.getDevices(e), r = s.find((o) => o.deviceId === ac);
8744
8744
  if (!r) {
8745
- nt.warn("could not reliably determine default device");
8745
+ Qe.warn("could not reliably determine default device");
8746
8746
  return;
8747
8747
  }
8748
8748
  const a = s.find((o) => o.deviceId !== ac && o.groupId === (n ?? r.groupId));
8749
8749
  if (!a) {
8750
- nt.warn("could not reliably determine default device");
8750
+ Qe.warn("could not reliably determine default device");
8751
8751
  return;
8752
8752
  }
8753
8753
  return a == null ? void 0 : a.deviceId;
@@ -8765,7 +8765,7 @@ var Gr;
8765
8765
  })(Gr || (Gr = {}));
8766
8766
  class fb {
8767
8767
  constructor() {
8768
- this.pendingTasks = /* @__PURE__ */ new Map(), this.taskMutex = new gn(), this.nextTaskIndex = 0;
8768
+ this.pendingTasks = /* @__PURE__ */ new Map(), this.taskMutex = new bn(), this.nextTaskIndex = 0;
8769
8769
  }
8770
8770
  run(e) {
8771
8771
  return P(this, void 0, void 0, function* () {
@@ -8812,7 +8812,7 @@ function im(i, e) {
8812
8812
  const vb = ["syncState", "trickle", "offer", "answer", "simulate", "leave"];
8813
8813
  function bb(i) {
8814
8814
  const e = vb.indexOf(i.case) >= 0;
8815
- return nt.trace("request allowed to bypass queue:", {
8815
+ return Qe.trace("request allowed to bypass queue:", {
8816
8816
  canPass: e,
8817
8817
  req: i
8818
8818
  }), e;
@@ -8837,9 +8837,9 @@ class Fd {
8837
8837
  constructor() {
8838
8838
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
8839
8839
  var n;
8840
- this.rtt = 0, this.state = Pt.DISCONNECTED, this.log = nt, this._requestId = 0, this.resetCallbacks = () => {
8840
+ this.rtt = 0, this.state = Pt.DISCONNECTED, this.log = Qe, this._requestId = 0, this.resetCallbacks = () => {
8841
8841
  this.onAnswer = void 0, this.onLeave = void 0, this.onLocalTrackPublished = void 0, this.onLocalTrackUnpublished = void 0, this.onNegotiateRequested = void 0, this.onOffer = void 0, this.onRemoteMuteChanged = void 0, this.onSubscribedQualityUpdate = void 0, this.onTokenRefresh = void 0, this.onTrickle = void 0, this.onClose = void 0;
8842
- }, this.log = Pi((n = t.loggerName) !== null && n !== void 0 ? n : jn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new fb(), this.queuedRequests = [], this.closingLock = new gn(), this.connectionLock = new gn(), this.state = Pt.DISCONNECTED;
8842
+ }, this.log = Pi((n = t.loggerName) !== null && n !== void 0 ? n : jn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new fb(), this.queuedRequests = [], this.closingLock = new bn(), this.connectionLock = new bn(), this.state = Pt.DISCONNECTED;
8843
8843
  }
8844
8844
  get logContext() {
8845
8845
  var e, t;
@@ -8919,7 +8919,7 @@ class Fd {
8919
8919
  })), this.startPingInterval()), l(C.message.value)) : this.state === Pt.RECONNECTING && C.message.case !== "leave" ? (this.state = Pt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((p = C.message) === null || p === void 0 ? void 0 : p.case) === "reconnect" ? l(C.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), b = !0)) : this.isEstablishingConnection && C.message.case === "leave" ? d(new Ct("Received leave request while trying to (re)connect", st.LeaveRequest, void 0, C.message.value.reason)) : n.reconnect || d(new Ct("did not receive join response, got ".concat((x = C.message) === null || x === void 0 ? void 0 : x.case, " instead"), st.InternalError)), !b)
8920
8920
  return;
8921
8921
  }
8922
- this.signalLatency && (yield vn(this.signalLatency)), this.handleSignalResponse(C);
8922
+ this.signalLatency && (yield yn(this.signalLatency)), this.handleSignalResponse(C);
8923
8923
  }), this.ws.onclose = (v) => {
8924
8924
  this.isEstablishingConnection && d(new Ct("Websocket got closed during a (re)connection attempt", st.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8925
8925
  reason: v.reason,
@@ -8947,7 +8947,7 @@ class Fd {
8947
8947
  r();
8948
8948
  } : r();
8949
8949
  });
8950
- e.ws.readyState < e.ws.CLOSING && (e.ws.close(), yield Promise.race([s, vn(250)])), e.ws = void 0;
8950
+ e.ws.readyState < e.ws.CLOSING && (e.ws.close(), yield Promise.race([s, yn(250)])), e.ws = void 0;
8951
8951
  }
8952
8952
  } finally {
8953
8953
  t && (e.state = Pt.DISCONNECTED), n();
@@ -9101,7 +9101,7 @@ class Fd {
9101
9101
  }));
9102
9102
  return;
9103
9103
  }
9104
- if (s || (yield n.requestQueue.flush()), n.signalLatency && (yield vn(n.signalLatency)), n.isDisconnected) {
9104
+ if (s || (yield n.requestQueue.flush()), n.signalLatency && (yield yn(n.signalLatency)), n.isDisconnected) {
9105
9105
  n.log.debug("skipping signal request (type: ".concat(t.case, ") - SignalClient disconnected"));
9106
9106
  return;
9107
9107
  }
@@ -9958,7 +9958,7 @@ class ph extends hi.EventEmitter {
9958
9958
  constructor(e) {
9959
9959
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
9960
9960
  var n;
9961
- super(), this.log = nt, this.ddExtID = 0, this.latestOfferId = 0, this.pendingCandidates = [], this.restartingIce = !1, this.renegotiate = !1, this.trackBitrates = [], this.remoteStereoMids = [], this.remoteNackMids = [], this.negotiate = zd((s) => P(this, void 0, void 0, function* () {
9961
+ super(), this.log = Qe, this.ddExtID = 0, this.latestOfferId = 0, this.pendingCandidates = [], this.restartingIce = !1, this.renegotiate = !1, this.trackBitrates = [], this.remoteStereoMids = [], this.remoteNackMids = [], this.negotiate = zd((s) => P(this, void 0, void 0, function* () {
9962
9962
  this.emit(nr.NegotiationStarted);
9963
9963
  try {
9964
9964
  yield this.createAndSendOffer();
@@ -9970,7 +9970,7 @@ class ph extends hi.EventEmitter {
9970
9970
  }
9971
9971
  }), Eb), this.close = () => {
9972
9972
  this._pc && (this._pc.close(), this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc.onicegatheringstatechange = null, this._pc.ondatachannel = null, this._pc.onnegotiationneeded = null, this._pc.onsignalingstatechange = null, this._pc.onicecandidate = null, this._pc.ondatachannel = null, this._pc.ontrack = null, this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc = null);
9973
- }, this.log = Pi((n = t.loggerName) !== null && n !== void 0 ? n : jn.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new gn();
9973
+ }, this.log = Pi((n = t.loggerName) !== null && n !== void 0 ? n : jn.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new bn();
9974
9974
  }
9975
9975
  createPC() {
9976
9976
  const e = new RTCPeerConnection(this.config);
@@ -10331,7 +10331,7 @@ class Rb {
10331
10331
  }
10332
10332
  constructor(e, t, n) {
10333
10333
  var s;
10334
- this.peerConnectionTimeout = Vd.peerConnectionTimeout, this.log = nt, this.updateState = () => {
10334
+ this.peerConnectionTimeout = Vd.peerConnectionTimeout, this.log = Qe, this.updateState = () => {
10335
10335
  var r;
10336
10336
  const a = this.state, o = this.requiredTransports.map((c) => c.getConnectionState());
10337
10337
  o.every((c) => c === "connected") ? this.state = Lt.CONNECTED : o.some((c) => c === "failed") ? this.state = Lt.FAILED : o.some((c) => c === "connecting") ? this.state = Lt.CONNECTING : o.every((c) => c === "closed") ? this.state = Lt.CLOSED : o.some((c) => c === "closed") ? this.state = Lt.CLOSING : o.every((c) => c === "new") && (this.state = Lt.NEW), a !== this.state && (this.log.debug("pc state change: from ".concat(Lt[a], " to ").concat(Lt[this.state]), this.logContext), (r = this.onStateChange) === null || r === void 0 || r.call(this, this.state, this.publisher.getConnectionState(), this.subscriber.getConnectionState()));
@@ -10350,7 +10350,7 @@ class Rb {
10350
10350
  }, this.publisher.onOffer = (r, a) => {
10351
10351
  var o;
10352
10352
  (o = this.onPublisherOffer) === null || o === void 0 || o.call(this, r, a);
10353
- }, this.state = Lt.NEW, this.connectionLock = new gn(), this.remoteOfferLock = new gn();
10353
+ }, this.state = Lt.NEW, this.connectionLock = new bn(), this.remoteOfferLock = new bn();
10354
10354
  }
10355
10355
  get logContext() {
10356
10356
  var e, t;
@@ -10482,7 +10482,7 @@ class Rb {
10482
10482
  s == null || s.signal.removeEventListener("abort", d), l(new Ct("could not establish pc connection", st.InternalError));
10483
10483
  }, a);
10484
10484
  for (; this.state !== Lt.CONNECTED; )
10485
- if (yield vn(50), s != null && s.signal.aborted) {
10485
+ if (yield yn(50), s != null && s.signal.aborted) {
10486
10486
  l(new Ct("room connection has been cancelled", st.Cancelled));
10487
10487
  return;
10488
10488
  }
@@ -10650,7 +10650,7 @@ class om extends Z {
10650
10650
  this.debouncedTrackMuteHandler.cancel("unmute"), yield this.resumeUpstream();
10651
10651
  }), this.handleEnded = () => {
10652
10652
  this.isInBackground && (this.reacquireTrack = !0), this._mediaStreamTrack.removeEventListener("mute", this.handleTrackMuteEvent), this._mediaStreamTrack.removeEventListener("unmute", this.handleTrackUnmuteEvent), this.emit(ae.Ended, this);
10653
- }, this.reacquireTrack = !1, this.providedByUser = s, this.muteLock = new gn(), this.pauseUpstreamLock = new gn(), this.trackChangeLock = new gn(), this.trackChangeLock.lock().then((a) => P(this, void 0, void 0, function* () {
10653
+ }, this.reacquireTrack = !1, this.providedByUser = s, this.muteLock = new bn(), this.pauseUpstreamLock = new bn(), this.trackChangeLock = new bn(), this.trackChangeLock.lock().then((a) => P(this, void 0, void 0, function* () {
10654
10654
  try {
10655
10655
  yield this.setMediaStreamTrack(e, !0);
10656
10656
  } finally {
@@ -10725,13 +10725,13 @@ class om extends Z {
10725
10725
  var n;
10726
10726
  if (e.kind === Z.Kind.Audio)
10727
10727
  throw new Error("cannot get dimensions for audio tracks");
10728
- ((n = Mn()) === null || n === void 0 ? void 0 : n.os) === "iOS" && (yield vn(10));
10728
+ ((n = Mn()) === null || n === void 0 ? void 0 : n.os) === "iOS" && (yield yn(10));
10729
10729
  const s = Date.now();
10730
10730
  for (; Date.now() - s < t; ) {
10731
10731
  const r = e.dimensions;
10732
10732
  if (r)
10733
10733
  return r;
10734
- yield vn(50);
10734
+ yield yn(50);
10735
10735
  }
10736
10736
  throw new Ci("unable to get track dimensions after timeout");
10737
10737
  }();
@@ -11109,7 +11109,7 @@ class uo extends om {
11109
11109
  }
11110
11110
  /* @internal */
11111
11111
  startMonitor() {
11112
- mn() && (this.monitorInterval || (this.monitorInterval = setInterval(() => {
11112
+ vn() && (this.monitorInterval || (this.monitorInterval = setInterval(() => {
11113
11113
  this.monitorSender();
11114
11114
  }, Hd)));
11115
11115
  }
@@ -11192,7 +11192,7 @@ function xl(i, e, t, n) {
11192
11192
  const o = n == null ? void 0 : n.simulcast, c = n == null ? void 0 : n.scalabilityMode, l = n == null ? void 0 : n.videoCodec;
11193
11193
  if (!a && !o && !c || !e || !t)
11194
11194
  return [{}];
11195
- a || (a = Wb(i, e, t, l), nt.debug("using video encoding", a));
11195
+ a || (a = Wb(i, e, t, l), Qe.debug("using video encoding", a));
11196
11196
  const d = a.maxFramerate, u = new _t(e, t, a.maxBitrate, a.maxFramerate, a.priority);
11197
11197
  if (c && ei(l)) {
11198
11198
  const g = new cm(c), v = [];
@@ -11219,7 +11219,7 @@ function xl(i, e, t, n) {
11219
11219
  /* @ts-ignore */
11220
11220
  scalabilityMode: c
11221
11221
  });
11222
- return u.encoding.priority && (v[0].priority = u.encoding.priority, v[0].networkPriority = u.encoding.priority), nt.debug("using svc encoding", {
11222
+ return u.encoding.priority && (v[0].priority = u.encoding.priority, v[0].networkPriority = u.encoding.priority), Qe.debug("using svc encoding", {
11223
11223
  encodings: v
11224
11224
  }), v;
11225
11225
  }
@@ -11243,7 +11243,7 @@ function Hb(i, e, t) {
11243
11243
  var n, s, r, a;
11244
11244
  if (!t.backupCodec || t.backupCodec === !0 || t.backupCodec.codec === t.videoCodec)
11245
11245
  return;
11246
- e !== t.backupCodec.codec && nt.warn("requested a different codec than specified as backup", {
11246
+ e !== t.backupCodec.codec && Qe.warn("requested a different codec than specified as backup", {
11247
11247
  serverRequested: e,
11248
11248
  backup: t.backupCodec.codec
11249
11249
  }), t.videoCodec = e, t.videoEncoding = t.backupCodec.encoding;
@@ -11309,7 +11309,7 @@ function dc(i, e, t, n) {
11309
11309
  let a = !0;
11310
11310
  s.forEach((o) => {
11311
11311
  var c;
11312
- o.maxFramerate != r && (a && (a = !1, nt.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")), nt.info('Setting framerate of encoding "'.concat((c = o.rid) !== null && c !== void 0 ? c : "", '" to ').concat(r)), o.maxFramerate = r);
11312
+ o.maxFramerate != r && (a && (a = !1, Qe.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")), Qe.info('Setting framerate of encoding "'.concat((c = o.rid) !== null && c !== void 0 ? c : "", '" to ').concat(r)), o.maxFramerate = r);
11313
11313
  });
11314
11314
  }
11315
11315
  return s;
@@ -11386,7 +11386,7 @@ class ho extends om {
11386
11386
  }), this._currentBitrate = c;
11387
11387
  }
11388
11388
  this.prevStats = a;
11389
- }), this.senderLock = new gn();
11389
+ }), this.senderLock = new bn();
11390
11390
  }
11391
11391
  get isSimulcast() {
11392
11392
  return !!(this.sender && this.sender.getParameters().encodings.length > 1);
@@ -11394,7 +11394,7 @@ class ho extends om {
11394
11394
  /* @internal */
11395
11395
  startMonitor(e) {
11396
11396
  var t;
11397
- if (this.signalClient = e, !mn())
11397
+ if (this.signalClient = e, !vn())
11398
11398
  return;
11399
11399
  const n = (t = this.sender) === null || t === void 0 ? void 0 : t.getParameters();
11400
11400
  n && (this.encodings = n.encodings), !this.monitorInterval && (this.monitorInterval = setInterval(() => {
@@ -11837,7 +11837,7 @@ class Kb extends hi.EventEmitter {
11837
11837
  }
11838
11838
  constructor(e) {
11839
11839
  var t;
11840
- super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = Vd.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Fn.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = nt, this.reliableDataSequence = 1, this.reliableMessageBuffer = new lh(), this.reliableReceivedState = new _b(Yb), this.handleDataChannel = (n) => P(this, [n], void 0, function(s) {
11840
+ super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = Vd.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Fn.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = Qe, this.reliableDataSequence = 1, this.reliableMessageBuffer = new lh(), this.reliableReceivedState = new _b(Yb), this.handleDataChannel = (n) => P(this, [n], void 0, function(s) {
11841
11841
  var r = this;
11842
11842
  let {
11843
11843
  channel: a
@@ -11868,7 +11868,7 @@ class Kb extends hi.EventEmitter {
11868
11868
  }));
11869
11869
  return;
11870
11870
  }
11871
- const c = pn.fromBinary(new Uint8Array(o));
11871
+ const c = gn.fromBinary(new Uint8Array(o));
11872
11872
  if (c.sequence > 0 && c.participantSid !== "") {
11873
11873
  const l = this.reliableReceivedState.get(c.participantSid);
11874
11874
  if (l && c.sequence <= l)
@@ -11893,7 +11893,7 @@ class Kb extends hi.EventEmitter {
11893
11893
  event: n
11894
11894
  }));
11895
11895
  }, this.handleBufferedAmountLow = (n) => {
11896
- const r = n.currentTarget.maxRetransmits === 0 ? je.LOSSY : je.RELIABLE;
11896
+ const r = n.currentTarget.maxRetransmits === 0 ? qe.LOSSY : qe.RELIABLE;
11897
11897
  this.updateAndEmitDCBufferStatus(r);
11898
11898
  }, this.handleDisconnect = (n, s) => {
11899
11899
  if (this._isClosed)
@@ -11925,13 +11925,13 @@ class Kb extends hi.EventEmitter {
11925
11925
  }, this.isBufferStatusLow = (n) => {
11926
11926
  const s = this.dataChannelForKind(n);
11927
11927
  if (s)
11928
- return n === je.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(s.bufferedAmount), s.bufferedAmount <= s.bufferedAmountLowThreshold;
11928
+ return n === qe.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(s.bufferedAmount), s.bufferedAmount <= s.bufferedAmountLowThreshold;
11929
11929
  }, this.handleBrowserOnLine = () => {
11930
11930
  this.client.currentState === Pt.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(ks.RR_SIGNAL_DISCONNECTED));
11931
11931
  }, this.log = Pi((t = e.loggerName) !== null && t !== void 0 ? t : jn.Engine), this.loggerOptions = {
11932
11932
  loggerName: e.loggerName,
11933
11933
  loggerContextCb: () => this.logContext
11934
- }, this.client = new Fd(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new gn(), this.dataProcessLock = new gn(), this.dcBufferStatus = /* @__PURE__ */ new Map([[je.LOSSY, !0], [je.RELIABLE, !0]]), this.client.onParticipantUpdate = (n) => this.emit(le.ParticipantUpdate, n), this.client.onConnectionQuality = (n) => this.emit(le.ConnectionQualityUpdate, n), this.client.onRoomUpdate = (n) => this.emit(le.RoomUpdate, n), this.client.onSubscriptionError = (n) => this.emit(le.SubscriptionError, n), this.client.onSubscriptionPermissionUpdate = (n) => this.emit(le.SubscriptionPermissionUpdate, n), this.client.onSpeakersChanged = (n) => this.emit(le.SpeakersChanged, n), this.client.onStreamStateUpdate = (n) => this.emit(le.StreamStateChanged, n), this.client.onRequestResponse = (n) => this.emit(le.SignalRequestResponse, n);
11934
+ }, this.client = new Fd(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new bn(), this.dataProcessLock = new bn(), this.dcBufferStatus = /* @__PURE__ */ new Map([[qe.LOSSY, !0], [qe.RELIABLE, !0]]), this.client.onParticipantUpdate = (n) => this.emit(le.ParticipantUpdate, n), this.client.onConnectionQuality = (n) => this.emit(le.ConnectionQualityUpdate, n), this.client.onRoomUpdate = (n) => this.emit(le.RoomUpdate, n), this.client.onSubscriptionError = (n) => this.emit(le.SubscriptionError, n), this.client.onSubscriptionPermissionUpdate = (n) => this.emit(le.SubscriptionPermissionUpdate, n), this.client.onSpeakersChanged = (n) => this.emit(le.SpeakersChanged, n), this.client.onStreamStateUpdate = (n) => this.emit(le.StreamStateChanged, n), this.client.onRequestResponse = (n) => this.emit(le.SignalRequestResponse, n);
11935
11935
  }
11936
11936
  /** @internal */
11937
11937
  get logContext() {
@@ -12203,7 +12203,7 @@ class Kb extends hi.EventEmitter {
12203
12203
  var t, n, s;
12204
12204
  if (!this._isClosed) {
12205
12205
  if (this.attemptingReconnect) {
12206
- nt.warn("already attempting reconnect, returning early", this.logContext);
12206
+ Qe.warn("already attempting reconnect, returning early", this.logContext);
12207
12207
  return;
12208
12208
  }
12209
12209
  (((t = this.clientConfiguration) === null || t === void 0 ? void 0 : t.resumeConnection) === jr.DISABLED || // signaling state could change to closed due to hardware sleep
@@ -12303,7 +12303,7 @@ class Kb extends hi.EventEmitter {
12303
12303
  return P(this, void 0, void 0, function* () {
12304
12304
  this.pcState = Fn.Reconnecting, this.log.debug("waiting for peer connection to reconnect", this.logContext);
12305
12305
  try {
12306
- if (yield vn(Xb), !this.pcManager)
12306
+ if (yield yn(Xb), !this.pcManager)
12307
12307
  throw new qt("PC manager is closed");
12308
12308
  yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Fn.Connected;
12309
12309
  } catch (e) {
@@ -12314,9 +12314,9 @@ class Kb extends hi.EventEmitter {
12314
12314
  /** @internal */
12315
12315
  publishRpcResponse(e, t, n, s) {
12316
12316
  return P(this, void 0, void 0, function* () {
12317
- const r = new pn({
12317
+ const r = new gn({
12318
12318
  destinationIdentities: [e],
12319
- kind: je.RELIABLE,
12319
+ kind: qe.RELIABLE,
12320
12320
  value: {
12321
12321
  case: "rpcResponse",
12322
12322
  value: new Jf({
@@ -12331,15 +12331,15 @@ class Kb extends hi.EventEmitter {
12331
12331
  })
12332
12332
  }
12333
12333
  });
12334
- yield this.sendDataPacket(r, je.RELIABLE);
12334
+ yield this.sendDataPacket(r, qe.RELIABLE);
12335
12335
  });
12336
12336
  }
12337
12337
  /** @internal */
12338
12338
  publishRpcAck(e, t) {
12339
12339
  return P(this, void 0, void 0, function* () {
12340
- const n = new pn({
12340
+ const n = new gn({
12341
12341
  destinationIdentities: [e],
12342
- kind: je.RELIABLE,
12342
+ kind: qe.RELIABLE,
12343
12343
  value: {
12344
12344
  case: "rpcAck",
12345
12345
  value: new Kf({
@@ -12347,16 +12347,16 @@ class Kb extends hi.EventEmitter {
12347
12347
  })
12348
12348
  }
12349
12349
  });
12350
- yield this.sendDataPacket(n, je.RELIABLE);
12350
+ yield this.sendDataPacket(n, qe.RELIABLE);
12351
12351
  });
12352
12352
  }
12353
12353
  /* @internal */
12354
12354
  sendDataPacket(e, t) {
12355
12355
  return P(this, void 0, void 0, function* () {
12356
- yield this.ensurePublisherConnected(t), t === je.RELIABLE && (e.sequence = this.reliableDataSequence, this.reliableDataSequence += 1);
12356
+ yield this.ensurePublisherConnected(t), t === qe.RELIABLE && (e.sequence = this.reliableDataSequence, this.reliableDataSequence += 1);
12357
12357
  const n = e.toBinary(), s = this.dataChannelForKind(t);
12358
12358
  if (s) {
12359
- if (t === je.RELIABLE && this.reliableMessageBuffer.push({
12359
+ if (t === qe.RELIABLE && this.reliableMessageBuffer.push({
12360
12360
  data: n,
12361
12361
  sequence: e.sequence
12362
12362
  }), this.attemptingReconnect)
@@ -12368,11 +12368,11 @@ class Kb extends hi.EventEmitter {
12368
12368
  }
12369
12369
  resendReliableMessagesForResume(e) {
12370
12370
  return P(this, void 0, void 0, function* () {
12371
- yield this.ensurePublisherConnected(je.RELIABLE);
12372
- const t = this.dataChannelForKind(je.RELIABLE);
12371
+ yield this.ensurePublisherConnected(qe.RELIABLE);
12372
+ const t = this.dataChannelForKind(qe.RELIABLE);
12373
12373
  t && (this.reliableMessageBuffer.popToSequence(e), this.reliableMessageBuffer.getAll().forEach((n) => {
12374
12374
  t.send(n.data);
12375
- })), this.updateAndEmitDCBufferStatus(je.RELIABLE);
12375
+ })), this.updateAndEmitDCBufferStatus(qe.RELIABLE);
12376
12376
  });
12377
12377
  }
12378
12378
  waitForBufferStatusLow(e) {
@@ -12382,7 +12382,7 @@ class Kb extends hi.EventEmitter {
12382
12382
  else {
12383
12383
  const s = () => n("Engine closed");
12384
12384
  for (this.once(le.Closing, s); !this.dcBufferStatus.get(e); )
12385
- yield vn(10);
12385
+ yield yn(10);
12386
12386
  this.off(le.Closing, s), t();
12387
12387
  }
12388
12388
  }));
@@ -12410,7 +12410,7 @@ class Kb extends hi.EventEmitter {
12410
12410
  for (; (/* @__PURE__ */ new Date()).getTime() < d; ) {
12411
12411
  if (a.isICEConnected && ((r = n.dataChannelForKind(t, s)) === null || r === void 0 ? void 0 : r.readyState) === "open")
12412
12412
  return;
12413
- yield vn(50);
12413
+ yield yn(50);
12414
12414
  }
12415
12415
  throw new Ct("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), st.InternalError);
12416
12416
  }();
@@ -12456,14 +12456,14 @@ class Kb extends hi.EventEmitter {
12456
12456
  }
12457
12457
  dataChannelForKind(e, t) {
12458
12458
  if (t) {
12459
- if (e === je.LOSSY)
12459
+ if (e === qe.LOSSY)
12460
12460
  return this.lossyDCSub;
12461
- if (e === je.RELIABLE)
12461
+ if (e === qe.RELIABLE)
12462
12462
  return this.reliableDCSub;
12463
12463
  } else {
12464
- if (e === je.LOSSY)
12464
+ if (e === qe.LOSSY)
12465
12465
  return this.lossyDC;
12466
- if (e === je.RELIABLE)
12466
+ if (e === qe.RELIABLE)
12467
12467
  return this.reliableDC;
12468
12468
  }
12469
12469
  }
@@ -12512,7 +12512,7 @@ class Kb extends hi.EventEmitter {
12512
12512
  target: s
12513
12513
  }));
12514
12514
  };
12515
- return t(this.dataChannelForKind(je.LOSSY), Vn.PUBLISHER), t(this.dataChannelForKind(je.RELIABLE), Vn.PUBLISHER), t(this.dataChannelForKind(je.LOSSY, !0), Vn.SUBSCRIBER), t(this.dataChannelForKind(je.RELIABLE, !0), Vn.SUBSCRIBER), e;
12515
+ return t(this.dataChannelForKind(qe.LOSSY), Vn.PUBLISHER), t(this.dataChannelForKind(qe.RELIABLE), Vn.PUBLISHER), t(this.dataChannelForKind(qe.LOSSY, !0), Vn.SUBSCRIBER), t(this.dataChannelForKind(qe.RELIABLE, !0), Vn.SUBSCRIBER), e;
12516
12516
  }
12517
12517
  clearReconnectTimeout() {
12518
12518
  this.reconnectTimeout && Zt.clearTimeout(this.reconnectTimeout);
@@ -12521,10 +12521,10 @@ class Kb extends hi.EventEmitter {
12521
12521
  this.clearReconnectTimeout(), this.reconnectAttempts = 0;
12522
12522
  }
12523
12523
  registerOnLineListener() {
12524
- mn() && window.addEventListener("online", this.handleBrowserOnLine);
12524
+ vn() && window.addEventListener("online", this.handleBrowserOnLine);
12525
12525
  }
12526
12526
  deregisterOnLineListener() {
12527
- mn() && window.removeEventListener("online", this.handleBrowserOnLine);
12527
+ vn() && window.removeEventListener("online", this.handleBrowserOnLine);
12528
12528
  }
12529
12529
  }
12530
12530
  class Is extends Error {
@@ -12559,7 +12559,7 @@ class Tl {
12559
12559
  const t = this.regionSettings.regions.filter((n) => !this.attemptedRegions.find((s) => s.url === n.url));
12560
12560
  if (t.length > 0) {
12561
12561
  const n = t[0];
12562
- return this.attemptedRegions.push(n), nt.debug("next region: ".concat(n.region)), n.url;
12562
+ return this.attemptedRegions.push(n), Qe.debug("next region: ".concat(n.region)), n.url;
12563
12563
  } else
12564
12564
  return null;
12565
12565
  });
@@ -12831,7 +12831,7 @@ class ty extends dm {
12831
12831
  }
12832
12832
  class ny {
12833
12833
  constructor() {
12834
- this.log = nt, this.byteStreamControllers = /* @__PURE__ */ new Map(), this.textStreamControllers = /* @__PURE__ */ new Map(), this.byteStreamHandlers = /* @__PURE__ */ new Map(), this.textStreamHandlers = /* @__PURE__ */ new Map();
12834
+ this.log = Qe, this.byteStreamControllers = /* @__PURE__ */ new Map(), this.textStreamControllers = /* @__PURE__ */ new Map(), this.byteStreamHandlers = /* @__PURE__ */ new Map(), this.textStreamHandlers = /* @__PURE__ */ new Map();
12835
12835
  }
12836
12836
  registerTextStreamHandler(e, t) {
12837
12837
  if (this.textStreamHandlers.has(e))
@@ -13041,33 +13041,33 @@ class ry {
13041
13041
  operationType: (e == null ? void 0 : e.type) === "update" ? Xc.UPDATE : Xc.CREATE
13042
13042
  })
13043
13043
  }
13044
- }), o = e == null ? void 0 : e.destinationIdentities, c = new pn({
13044
+ }), o = e == null ? void 0 : e.destinationIdentities, c = new gn({
13045
13045
  destinationIdentities: o,
13046
13046
  value: {
13047
13047
  case: "streamHeader",
13048
13048
  value: a
13049
13049
  }
13050
13050
  });
13051
- yield this.engine.sendDataPacket(c, je.RELIABLE);
13051
+ yield this.engine.sendDataPacket(c, qe.RELIABLE);
13052
13052
  let l = 0;
13053
13053
  const d = this.engine, u = new WritableStream({
13054
13054
  // Implement the sink
13055
13055
  write(g) {
13056
13056
  return P(this, void 0, void 0, function* () {
13057
13057
  for (const v of sb(g, Ch)) {
13058
- yield d.waitForBufferStatusLow(je.RELIABLE);
13058
+ yield d.waitForBufferStatusLow(qe.RELIABLE);
13059
13059
  const m = new Kc({
13060
13060
  content: v,
13061
13061
  streamId: s,
13062
13062
  chunkIndex: hs(l)
13063
- }), p = new pn({
13063
+ }), p = new gn({
13064
13064
  destinationIdentities: o,
13065
13065
  value: {
13066
13066
  case: "streamChunk",
13067
13067
  value: m
13068
13068
  }
13069
13069
  });
13070
- yield d.sendDataPacket(p, je.RELIABLE), l += 1;
13070
+ yield d.sendDataPacket(p, qe.RELIABLE), l += 1;
13071
13071
  }
13072
13072
  });
13073
13073
  },
@@ -13075,14 +13075,14 @@ class ry {
13075
13075
  return P(this, void 0, void 0, function* () {
13076
13076
  const g = new Jc({
13077
13077
  streamId: s
13078
- }), v = new pn({
13078
+ }), v = new gn({
13079
13079
  destinationIdentities: o,
13080
13080
  value: {
13081
13081
  case: "streamTrailer",
13082
13082
  value: g
13083
13083
  }
13084
13084
  });
13085
- yield d.sendDataPacket(v, je.RELIABLE);
13085
+ yield d.sendDataPacket(v, qe.RELIABLE);
13086
13086
  });
13087
13087
  },
13088
13088
  abort(g) {
@@ -13152,16 +13152,16 @@ class ry {
13152
13152
  name: l.name
13153
13153
  })
13154
13154
  }
13155
- }), u = new pn({
13155
+ }), u = new gn({
13156
13156
  destinationIdentities: c,
13157
13157
  value: {
13158
13158
  case: "streamHeader",
13159
13159
  value: d
13160
13160
  }
13161
13161
  });
13162
- yield this.engine.sendDataPacket(u, je.RELIABLE);
13162
+ yield this.engine.sendDataPacket(u, qe.RELIABLE);
13163
13163
  let h = 0;
13164
- const f = new gn(), g = this.engine, v = this.log, m = new WritableStream({
13164
+ const f = new bn(), g = this.engine, v = this.log, m = new WritableStream({
13165
13165
  write(x) {
13166
13166
  return P(this, void 0, void 0, function* () {
13167
13167
  const C = yield f.lock();
@@ -13169,8 +13169,8 @@ class ry {
13169
13169
  try {
13170
13170
  for (; b < x.byteLength; ) {
13171
13171
  const S = x.slice(b, b + Ch);
13172
- yield g.waitForBufferStatusLow(je.RELIABLE);
13173
- const M = new pn({
13172
+ yield g.waitForBufferStatusLow(qe.RELIABLE);
13173
+ const M = new gn({
13174
13174
  destinationIdentities: c,
13175
13175
  value: {
13176
13176
  case: "streamChunk",
@@ -13181,7 +13181,7 @@ class ry {
13181
13181
  })
13182
13182
  }
13183
13183
  });
13184
- yield g.sendDataPacket(M, je.RELIABLE), h += 1, b += S.byteLength;
13184
+ yield g.sendDataPacket(M, qe.RELIABLE), h += 1, b += S.byteLength;
13185
13185
  }
13186
13186
  } finally {
13187
13187
  C();
@@ -13192,14 +13192,14 @@ class ry {
13192
13192
  return P(this, void 0, void 0, function* () {
13193
13193
  const x = new Jc({
13194
13194
  streamId: o
13195
- }), C = new pn({
13195
+ }), C = new gn({
13196
13196
  destinationIdentities: c,
13197
13197
  value: {
13198
13198
  case: "streamTrailer",
13199
13199
  value: x
13200
13200
  }
13201
13201
  });
13202
- yield g.sendDataPacket(C, je.RELIABLE);
13202
+ yield g.sendDataPacket(C, qe.RELIABLE);
13203
13203
  });
13204
13204
  },
13205
13205
  abort(x) {
@@ -13575,7 +13575,7 @@ class cy {
13575
13575
  }, this.onLeavePiP = () => {
13576
13576
  var n;
13577
13577
  this.isPiP = Cr(this.element), (n = this.handleVisibilityChanged) === null || n === void 0 || n.call(this);
13578
- }, this.element = e, this.isIntersecting = t ?? Cl(e), this.isPiP = mn() && Cr(e), this.visibilityChangedAt = 0;
13578
+ }, this.element = e, this.isIntersecting = t ?? Cl(e), this.isPiP = vn() && Cr(e), this.visibilityChangedAt = 0;
13579
13579
  }
13580
13580
  width() {
13581
13581
  return this.element.clientWidth;
@@ -13614,7 +13614,7 @@ function Cl(i, e) {
13614
13614
  class _i extends hi.EventEmitter {
13615
13615
  constructor(e, t, n, s) {
13616
13616
  var r;
13617
- super(), this.metadataMuted = !1, this.encryption = Cn.NONE, this.log = nt, this.handleMuted = () => {
13617
+ super(), this.metadataMuted = !1, this.encryption = Cn.NONE, this.log = Qe, this.handleMuted = () => {
13618
13618
  this.emit(ae.Muted);
13619
13619
  }, this.handleUnmuted = () => {
13620
13620
  this.emit(ae.Unmuted);
@@ -13626,7 +13626,7 @@ class _i extends hi.EventEmitter {
13626
13626
  }
13627
13627
  get logContext() {
13628
13628
  var e;
13629
- return Object.assign(Object.assign({}, (e = this.loggerContextCb) === null || e === void 0 ? void 0 : e.call(this)), Ze(this));
13629
+ return Object.assign(Object.assign({}, (e = this.loggerContextCb) === null || e === void 0 ? void 0 : e.call(this)), Je(this));
13630
13630
  }
13631
13631
  get isMuted() {
13632
13632
  return this.metadataMuted;
@@ -13869,7 +13869,7 @@ class fm extends hi.EventEmitter {
13869
13869
  constructor(e, t, n, s, r, a) {
13870
13870
  let o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : $r.STANDARD;
13871
13871
  var c;
13872
- super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = $i.Unknown, this.log = nt, this.log = Pi((c = a == null ? void 0 : a.loggerName) !== null && c !== void 0 ? c : jn.Participant), this.loggerOptions = a, this.setMaxListeners(100), this.sid = e, this.identity = t, this.name = n, this.metadata = s, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = o, this._attributes = r ?? {};
13872
+ super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = $i.Unknown, this.log = Qe, this.log = Pi((c = a == null ? void 0 : a.loggerName) !== null && c !== void 0 ? c : jn.Participant), this.loggerOptions = a, this.setMaxListeners(100), this.sid = e, this.identity = t, this.name = n, this.metadata = s, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = o, this._attributes = r ?? {};
13873
13873
  }
13874
13874
  getTrackPublications() {
13875
13875
  return Array.from(this.trackPublications.values());
@@ -14050,14 +14050,14 @@ class fy extends fm {
14050
14050
  this.onTrackMuted(o, o.isUpstreamPaused);
14051
14051
  }, this.onTrackMuted = (o, c) => {
14052
14052
  if (c === void 0 && (c = !0), !o.sid) {
14053
- this.log.error("could not update mute status for unpublished track", Object.assign(Object.assign({}, this.logContext), Ze(o)));
14053
+ this.log.error("could not update mute status for unpublished track", Object.assign(Object.assign({}, this.logContext), Je(o)));
14054
14054
  return;
14055
14055
  }
14056
14056
  this.engine.updateMuteStatus(o.sid, c);
14057
14057
  }, this.onTrackUpstreamPaused = (o) => {
14058
- this.log.debug("upstream paused", Object.assign(Object.assign({}, this.logContext), Ze(o))), this.onTrackMuted(o, !0);
14058
+ this.log.debug("upstream paused", Object.assign(Object.assign({}, this.logContext), Je(o))), this.onTrackMuted(o, !0);
14059
14059
  }, this.onTrackUpstreamResumed = (o) => {
14060
- this.log.debug("upstream resumed", Object.assign(Object.assign({}, this.logContext), Ze(o))), this.onTrackMuted(o, o.isMuted);
14060
+ this.log.debug("upstream resumed", Object.assign(Object.assign({}, this.logContext), Je(o))), this.onTrackMuted(o, o.isMuted);
14061
14061
  }, this.onTrackFeatureUpdate = (o) => {
14062
14062
  const c = this.audioTrackPublications.get(o.sid);
14063
14063
  if (!c) {
@@ -14066,7 +14066,7 @@ class fy extends fm {
14066
14066
  }
14067
14067
  this.engine.client.sendUpdateLocalAudioTrack(c.trackSid, c.getTrackFeatures());
14068
14068
  }, this.onTrackCpuConstrained = (o, c) => {
14069
- this.log.debug("track cpu constrained", Object.assign(Object.assign({}, this.logContext), Ze(c))), this.emit(ce.LocalTrackCpuConstrained, o, c);
14069
+ this.log.debug("track cpu constrained", Object.assign(Object.assign({}, this.logContext), Je(c))), this.emit(ce.LocalTrackCpuConstrained, o, c);
14070
14070
  }, this.handleSubscribedQualityUpdate = (o) => P(this, void 0, void 0, function* () {
14071
14071
  var c, l, d, u, h;
14072
14072
  if (!(!((h = this.roomOptions) === null || h === void 0) && h.dynacast))
@@ -14085,7 +14085,7 @@ class fy extends fm {
14085
14085
  for (var v = !0, m = Ti(g), p; p = yield m.next(), c = p.done, !c; v = !0) {
14086
14086
  u = p.value, v = !1;
14087
14087
  const x = u;
14088
- z0(x) && (this.log.debug("publish ".concat(x, " for ").concat(f.videoTrack.sid), Object.assign(Object.assign({}, this.logContext), Ze(f))), yield this.publishAdditionalCodecForTrack(f.videoTrack, x, f.options));
14088
+ z0(x) && (this.log.debug("publish ".concat(x, " for ").concat(f.videoTrack.sid), Object.assign(Object.assign({}, this.logContext), Je(f))), yield this.publishAdditionalCodecForTrack(f.videoTrack, x, f.options));
14089
14089
  }
14090
14090
  } catch (x) {
14091
14091
  l = {
@@ -14109,12 +14109,12 @@ class fy extends fm {
14109
14109
  this.unpublishTrack(c.track);
14110
14110
  }, this.handleTrackEnded = (o) => P(this, void 0, void 0, function* () {
14111
14111
  if (o.source === Z.Source.ScreenShare || o.source === Z.Source.ScreenShareAudio)
14112
- this.log.debug("unpublishing local track due to TrackEnded", Object.assign(Object.assign({}, this.logContext), Ze(o))), this.unpublishTrack(o);
14112
+ this.log.debug("unpublishing local track due to TrackEnded", Object.assign(Object.assign({}, this.logContext), Je(o))), this.unpublishTrack(o);
14113
14113
  else if (o.isUserProvided)
14114
14114
  yield o.mute();
14115
14115
  else if (yi(o) || Oi(o))
14116
14116
  try {
14117
- if (mn())
14117
+ if (vn())
14118
14118
  try {
14119
14119
  const c = yield navigator == null ? void 0 : navigator.permissions.query({
14120
14120
  // the permission query for camera and microphone currently not supported in Safari and Firefox
@@ -14122,16 +14122,16 @@ class fy extends fm {
14122
14122
  name: o.source === Z.Source.Camera ? "camera" : "microphone"
14123
14123
  });
14124
14124
  if (c && c.state === "denied")
14125
- throw this.log.warn("user has revoked access to ".concat(o.source), Object.assign(Object.assign({}, this.logContext), Ze(o))), c.onchange = () => {
14125
+ throw this.log.warn("user has revoked access to ".concat(o.source), Object.assign(Object.assign({}, this.logContext), Je(o))), c.onchange = () => {
14126
14126
  c.state !== "denied" && (o.isMuted || o.restartTrack(), c.onchange = null);
14127
14127
  }, new Error("GetUserMedia Permission denied");
14128
14128
  } catch {
14129
14129
  }
14130
- o.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Ze(o))), yi(o) ? yield o.restartTrack({
14130
+ o.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Je(o))), yi(o) ? yield o.restartTrack({
14131
14131
  deviceId: "default"
14132
14132
  }) : yield o.restartTrack());
14133
14133
  } catch {
14134
- this.log.warn("could not restart track, muting instead", Object.assign(Object.assign({}, this.logContext), Ze(o))), yield o.mute();
14134
+ this.log.warn("could not restart track, muting instead", Object.assign(Object.assign({}, this.logContext), Je(o))), yield o.mute();
14135
14135
  }
14136
14136
  }), this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this.engine = n, this.roomOptions = s, this.setupEngine(n), this.activeDeviceMap = /* @__PURE__ */ new Map([["audioinput", "default"], ["videoinput", "default"], ["audiooutput", "default"]]), this.pendingSignalRequests = /* @__PURE__ */ new Map(), this.rpcHandlers = r, this.roomOutgoingDataStreamManager = a;
14137
14137
  }
@@ -14235,7 +14235,7 @@ class fy extends fm {
14235
14235
  this.pendingSignalRequests.delete(h), o();
14236
14236
  return;
14237
14237
  }
14238
- yield vn(50);
14238
+ yield yn(50);
14239
14239
  }
14240
14240
  c(new Zu("Request to update local metadata timed out", "TimeoutError"));
14241
14241
  } catch (u) {
@@ -14331,7 +14331,7 @@ class fy extends fm {
14331
14331
  try {
14332
14332
  const l = [];
14333
14333
  for (const u of c)
14334
- this.log.info("publishing track", Object.assign(Object.assign({}, this.logContext), Ze(u))), l.push(this.publishTrack(u, s));
14334
+ this.log.info("publishing track", Object.assign(Object.assign({}, this.logContext), Je(u))), l.push(this.publishTrack(u, s));
14335
14335
  [o] = yield Promise.all(l);
14336
14336
  } catch (l) {
14337
14337
  throw c == null || c.forEach((d) => {
@@ -14483,17 +14483,17 @@ class fy extends fm {
14483
14483
  if (r.trackPublications.forEach((p) => {
14484
14484
  p.track && p.track === n && (h = p);
14485
14485
  }), h)
14486
- return r.log.warn("track has already been published, skipping", Object.assign(Object.assign({}, r.logContext), Ze(h))), h;
14486
+ return r.log.warn("track has already been published, skipping", Object.assign(Object.assign({}, r.logContext), Je(h))), h;
14487
14487
  const f = "channelCount" in n.mediaStreamTrack.getSettings() && // @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
14488
14488
  n.mediaStreamTrack.getSettings().channelCount === 2 || n.mediaStreamTrack.getConstraints().channelCount === 2, g = (c = s == null ? void 0 : s.forceStereo) !== null && c !== void 0 ? c : f;
14489
- g && (s || (s = {}), s.dtx === void 0 && r.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", Object.assign(Object.assign({}, r.logContext), Ze(n))), s.red === void 0 && r.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = s.dtx) !== null && l !== void 0 || (s.dtx = !1), (d = s.red) !== null && d !== void 0 || (s.red = !1));
14489
+ g && (s || (s = {}), s.dtx === void 0 && r.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", Object.assign(Object.assign({}, r.logContext), Je(n))), s.red === void 0 && r.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (l = s.dtx) !== null && l !== void 0 || (s.dtx = !1), (d = s.red) !== null && d !== void 0 || (s.red = !1));
14490
14490
  const v = Object.assign(Object.assign({}, r.roomOptions.publishDefaults), s);
14491
14491
  !X0() && r.roomOptions.e2ee && (r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2", Object.assign({}, r.logContext)), v.simulcast = !1), v.source && (n.source = v.source);
14492
14492
  const m = new Promise((p, x) => P(r, void 0, void 0, function* () {
14493
14493
  try {
14494
14494
  if (this.engine.client.currentState !== Pt.CONNECTED) {
14495
14495
  this.log.debug("deferring track publication until signal is connected", Object.assign(Object.assign({}, this.logContext), {
14496
- track: Ze(n)
14496
+ track: Je(n)
14497
14497
  }));
14498
14498
  const C = setTimeout(() => {
14499
14499
  x(new Ju("publishing rejected as engine not connected within timeout", 408));
@@ -14528,19 +14528,19 @@ class fy extends fm {
14528
14528
  }
14529
14529
  hasPermissionsToPublish(e) {
14530
14530
  if (!this.permissions)
14531
- return this.log.warn("no permissions present for publishing track", Object.assign(Object.assign({}, this.logContext), Ze(e))), !1;
14531
+ return this.log.warn("no permissions present for publishing track", Object.assign(Object.assign({}, this.logContext), Je(e))), !1;
14532
14532
  const {
14533
14533
  canPublish: t,
14534
14534
  canPublishSources: n
14535
14535
  } = this.permissions;
14536
- return t && (n.length === 0 || n.map((s) => db(s)).includes(e.source)) ? !0 : (this.log.warn("insufficient permissions to publish", Object.assign(Object.assign({}, this.logContext), Ze(e))), !1);
14536
+ return t && (n.length === 0 || n.map((s) => db(s)).includes(e.source)) ? !0 : (this.log.warn("insufficient permissions to publish", Object.assign(Object.assign({}, this.logContext), Je(e))), !1);
14537
14537
  }
14538
14538
  publish(e, t, n) {
14539
14539
  return P(this, void 0, void 0, function* () {
14540
14540
  var s, r, a, o, c, l, d, u, h, f;
14541
14541
  if (!this.hasPermissionsToPublish(e))
14542
14542
  throw new Ju("failed to publish track, insufficient permissions", 403);
14543
- Array.from(this.trackPublications.values()).find((_) => tr(e) && _.source === e.source) && e.source !== Z.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), Object.assign(Object.assign({}, this.logContext), Ze(e))), t.stopMicTrackOnMute && ri(e) && (e.stopOnMute = !0), e.source === Z.Source.ScreenShare && Cs() && (t.simulcast = !1), t.videoCodec === "av1" && !H0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !W0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = _l), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((_) => t.videoCodec === Vr(_.mime)) || (t.videoCodec = Vr(this.enabledPublishVideoCodecs[0].mime)));
14543
+ Array.from(this.trackPublications.values()).find((_) => tr(e) && _.source === e.source) && e.source !== Z.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), Object.assign(Object.assign({}, this.logContext), Je(e))), t.stopMicTrackOnMute && ri(e) && (e.stopOnMute = !0), e.source === Z.Source.ScreenShare && Cs() && (t.simulcast = !1), t.videoCodec === "av1" && !H0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !W0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = _l), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((_) => t.videoCodec === Vr(_.mime)) || (t.videoCodec = Vr(this.enabledPublishVideoCodecs[0].mime)));
14544
14544
  const v = t.videoCodec;
14545
14545
  e.on(ae.Muted, this.onTrackMuted), e.on(ae.Unmuted, this.onTrackUnmuted), e.on(ae.Ended, this.handleTrackEnded), e.on(ae.UpstreamPaused, this.onTrackUpstreamPaused), e.on(ae.UpstreamResumed, this.onTrackUpstreamResumed), e.on(ae.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
14546
14546
  const m = [], p = !(!((s = t.dtx) !== null && s !== void 0) || s), x = e.getSourceTrackSettings();
@@ -14573,11 +14573,11 @@ class fy extends fm {
14573
14573
  _ = {
14574
14574
  width: R.width,
14575
14575
  height: R.height
14576
- }, this.log.error("could not determine track dimensions, using defaults", Object.assign(Object.assign(Object.assign({}, this.logContext), Ze(e)), {
14576
+ }, this.log.error("could not determine track dimensions, using defaults", Object.assign(Object.assign(Object.assign({}, this.logContext), Je(e)), {
14577
14577
  dims: _
14578
14578
  }));
14579
14579
  }
14580
- C.width = _.width, C.height = _.height, Oi(e) && (ei(v) && (e.source === Z.Source.ScreenShare && (t.scalabilityMode = "L1T3", "contentHint" in e.mediaStreamTrack && (e.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Ze(e))))), t.scalabilityMode = (c = t.scalabilityMode) !== null && c !== void 0 ? c : "L3T3_KEY"), C.simulcastCodecs = [new Qc({
14580
+ C.width = _.width, C.height = _.height, Oi(e) && (ei(v) && (e.source === Z.Source.ScreenShare && (t.scalabilityMode = "L1T3", "contentHint" in e.mediaStreamTrack && (e.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Je(e))))), t.scalabilityMode = (c = t.scalabilityMode) !== null && c !== void 0 ? c : "L3T3_KEY"), C.simulcastCodecs = [new Qc({
14581
14581
  codec: v,
14582
14582
  cid: e.mediaStreamTrack.id
14583
14583
  })], t.backupCodec === !0 && (t.backupCodec = {
@@ -14625,7 +14625,7 @@ class fy extends fm {
14625
14625
  M = yield this.engine.addTrack(C), _(M);
14626
14626
  } catch (N) {
14627
14627
  e.sender && (!((R = this.engine.pcManager) === null || R === void 0) && R.publisher) && (this.engine.pcManager.publisher.removeTrack(e.sender), yield this.engine.negotiate().catch((F) => {
14628
- this.log.error("failed to negotiate after removing track due to failed add track request", Object.assign(Object.assign(Object.assign({}, this.logContext), Ze(e)), {
14628
+ this.log.error("failed to negotiate after removing track due to failed add track request", Object.assign(Object.assign(Object.assign({}, this.logContext), Je(e)), {
14629
14629
  error: F
14630
14630
  }));
14631
14631
  })), T(N);
@@ -14640,7 +14640,7 @@ class fy extends fm {
14640
14640
  _ === void 0 && (_ = T.mimeType);
14641
14641
  }), _ && e.kind === Z.Kind.Video) {
14642
14642
  const T = Vr(_);
14643
- T !== v && (this.log.debug("falling back to server selected codec", Object.assign(Object.assign(Object.assign({}, this.logContext), Ze(e)), {
14643
+ T !== v && (this.log.debug("falling back to server selected codec", Object.assign(Object.assign(Object.assign({}, this.logContext), Je(e)), {
14644
14644
  codec: T
14645
14645
  })), t.videoCodec = T, b = xl(e.source === Z.Source.ScreenShare, C.width, C.height, t));
14646
14646
  }
@@ -14661,16 +14661,16 @@ class fy extends fm {
14661
14661
  this.log.warn("subscribe event came to late, buffer already closed", this.logContext);
14662
14662
  return;
14663
14663
  }
14664
- this.log.debug("finished recording preconnect buffer", Object.assign(Object.assign({}, this.logContext), Ze(e))), e.stopPreConnectBuffer();
14664
+ this.log.debug("finished recording preconnect buffer", Object.assign(Object.assign({}, this.logContext), Je(e))), e.stopPreConnectBuffer();
14665
14665
  }
14666
14666
  }), _ && new Promise((N, F) => P(this, void 0, void 0, function* () {
14667
14667
  var q, K, H, W, te, ve;
14668
14668
  try {
14669
- this.log.debug("waiting for agent", Object.assign(Object.assign({}, this.logContext), Ze(e)));
14669
+ this.log.debug("waiting for agent", Object.assign(Object.assign({}, this.logContext), Je(e)));
14670
14670
  const Fe = setTimeout(() => {
14671
14671
  F(new Error("agent not active within 10 seconds"));
14672
14672
  }, 1e4), Rt = yield this.waitUntilActiveAgentPresent();
14673
- clearTimeout(Fe), this.log.debug("sending preconnect buffer", Object.assign(Object.assign({}, this.logContext), Ze(e)));
14673
+ clearTimeout(Fe), this.log.debug("sending preconnect buffer", Object.assign(Object.assign({}, this.logContext), Je(e)));
14674
14674
  const bt = yield this.streamBytes({
14675
14675
  name: "preconnect-buffer",
14676
14676
  mimeType: T,
@@ -14704,9 +14704,9 @@ class fy extends fm {
14704
14704
  F(Fe);
14705
14705
  }
14706
14706
  })).then(() => {
14707
- this.log.debug("preconnect buffer sent successfully", Object.assign(Object.assign({}, this.logContext), Ze(e)));
14707
+ this.log.debug("preconnect buffer sent successfully", Object.assign(Object.assign({}, this.logContext), Je(e)));
14708
14708
  }).catch((N) => {
14709
- this.log.error("error sending preconnect buffer", Object.assign(Object.assign(Object.assign({}, this.logContext), Ze(e)), {
14709
+ this.log.error("error sending preconnect buffer", Object.assign(Object.assign(Object.assign({}, this.logContext), Je(e)), {
14710
14710
  error: N
14711
14711
  }));
14712
14712
  });
@@ -14734,7 +14734,7 @@ class fy extends fm {
14734
14734
  throw new Ci("track is not a video track");
14735
14735
  const a = Object.assign(Object.assign({}, (s = this.roomOptions) === null || s === void 0 ? void 0 : s.publishDefaults), n), o = Hb(e, t, a);
14736
14736
  if (!o) {
14737
- this.log.info("backup codec has been disabled, ignoring request to add additional codec for track", Object.assign(Object.assign({}, this.logContext), Ze(e)));
14737
+ this.log.info("backup codec has been disabled, ignoring request to add additional codec for track", Object.assign(Object.assign({}, this.logContext), Je(e)));
14738
14738
  return;
14739
14739
  }
14740
14740
  const c = e.addSimulcastTrack(t, o);
@@ -14767,9 +14767,9 @@ class fy extends fm {
14767
14767
  var n, s;
14768
14768
  if (tr(e)) {
14769
14769
  const l = this.pendingPublishPromises.get(e);
14770
- l && (this.log.info("awaiting publish promise before attempting to unpublish", Object.assign(Object.assign({}, this.logContext), Ze(e))), yield l);
14770
+ l && (this.log.info("awaiting publish promise before attempting to unpublish", Object.assign(Object.assign({}, this.logContext), Je(e))), yield l);
14771
14771
  }
14772
- const r = this.getPublicationForTrack(e), a = r ? Ze(r) : void 0;
14772
+ const r = this.getPublicationForTrack(e), a = r ? Je(r) : void 0;
14773
14773
  if (this.log.debug("unpublishing track", Object.assign(Object.assign({}, this.logContext), a)), !r || !r.track) {
14774
14774
  this.log.warn("track was not unpublished because no publication was found", Object.assign(Object.assign({}, this.logContext), a));
14775
14775
  return;
@@ -14844,7 +14844,7 @@ class fy extends fm {
14844
14844
  var n = this;
14845
14845
  let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
14846
14846
  return function* () {
14847
- const r = s.reliable ? je.RELIABLE : je.LOSSY, a = s.destinationIdentities, o = s.topic, c = new pn({
14847
+ const r = s.reliable ? qe.RELIABLE : qe.LOSSY, a = s.destinationIdentities, o = s.topic, c = new gn({
14848
14848
  kind: r,
14849
14849
  value: {
14850
14850
  case: "user",
@@ -14868,8 +14868,8 @@ class fy extends fm {
14868
14868
  */
14869
14869
  publishDtmf(e, t) {
14870
14870
  return P(this, void 0, void 0, function* () {
14871
- const n = new pn({
14872
- kind: je.RELIABLE,
14871
+ const n = new gn({
14872
+ kind: qe.RELIABLE,
14873
14873
  value: {
14874
14874
  case: "sipDtmf",
14875
14875
  value: new Xf({
@@ -14878,7 +14878,7 @@ class fy extends fm {
14878
14878
  })
14879
14879
  }
14880
14880
  });
14881
- yield this.engine.sendDataPacket(n, je.RELIABLE);
14881
+ yield this.engine.sendDataPacket(n, qe.RELIABLE);
14882
14882
  });
14883
14883
  }
14884
14884
  /** @deprecated Consider migrating to {@link sendText} */
@@ -14889,7 +14889,7 @@ class fy extends fm {
14889
14889
  message: e,
14890
14890
  timestamp: Date.now(),
14891
14891
  attachedFiles: t == null ? void 0 : t.attachments
14892
- }, s = new pn({
14892
+ }, s = new gn({
14893
14893
  value: {
14894
14894
  case: "chatMessage",
14895
14895
  value: new $c(Object.assign(Object.assign({}, n), {
@@ -14897,7 +14897,7 @@ class fy extends fm {
14897
14897
  }))
14898
14898
  }
14899
14899
  });
14900
- return yield this.engine.sendDataPacket(s, je.RELIABLE), this.emit(ce.ChatMessage, n), n;
14900
+ return yield this.engine.sendDataPacket(s, qe.RELIABLE), this.emit(ce.ChatMessage, n), n;
14901
14901
  });
14902
14902
  }
14903
14903
  /** @deprecated Consider migrating to {@link sendText} */
@@ -14906,7 +14906,7 @@ class fy extends fm {
14906
14906
  const n = Object.assign(Object.assign({}, t), {
14907
14907
  message: e,
14908
14908
  editTimestamp: Date.now()
14909
- }), s = new pn({
14909
+ }), s = new gn({
14910
14910
  value: {
14911
14911
  case: "chatMessage",
14912
14912
  value: new $c(Object.assign(Object.assign({}, n), {
@@ -14915,7 +14915,7 @@ class fy extends fm {
14915
14915
  }))
14916
14916
  }
14917
14917
  });
14918
- return yield this.engine.sendDataPacket(s, je.RELIABLE), this.emit(ce.ChatMessage, n), n;
14918
+ return yield this.engine.sendDataPacket(s, qe.RELIABLE), this.emit(ce.ChatMessage, n), n;
14919
14919
  });
14920
14920
  }
14921
14921
  /**
@@ -15059,9 +15059,9 @@ class fy extends fm {
15059
15059
  /** @internal */
15060
15060
  publishRpcRequest(e, t, n, s, r) {
15061
15061
  return P(this, void 0, void 0, function* () {
15062
- const a = new pn({
15062
+ const a = new gn({
15063
15063
  destinationIdentities: [e],
15064
- kind: je.RELIABLE,
15064
+ kind: qe.RELIABLE,
15065
15065
  value: {
15066
15066
  case: "rpcRequest",
15067
15067
  value: new Yf({
@@ -15073,7 +15073,7 @@ class fy extends fm {
15073
15073
  })
15074
15074
  }
15075
15075
  });
15076
- yield this.engine.sendDataPacket(a, je.RELIABLE);
15076
+ yield this.engine.sendDataPacket(a, qe.RELIABLE);
15077
15077
  });
15078
15078
  }
15079
15079
  /** @internal */
@@ -15099,7 +15099,7 @@ class fy extends fm {
15099
15099
  const r = this.trackPublications.get(t.sid);
15100
15100
  if (r) {
15101
15101
  const a = r.isMuted || ((s = (n = r.track) === null || n === void 0 ? void 0 : n.isUpstreamPaused) !== null && s !== void 0 ? s : !1);
15102
- a !== t.muted && (this.log.debug("updating server mute state after reconcile", Object.assign(Object.assign(Object.assign({}, this.logContext), Ze(r)), {
15102
+ a !== t.muted && (this.log.debug("updating server mute state after reconcile", Object.assign(Object.assign(Object.assign({}, this.logContext), Je(r)), {
15103
15103
  mutedOnServer: a
15104
15104
  })), this.engine.client.sendMuteTrack(t.sid, a));
15105
15105
  }
@@ -15130,7 +15130,7 @@ class fy extends fm {
15130
15130
  });
15131
15131
  if (s)
15132
15132
  return s[1];
15133
- yield vn(20);
15133
+ yield yn(20);
15134
15134
  }
15135
15135
  });
15136
15136
  }
@@ -15300,7 +15300,7 @@ class fo extends fm {
15300
15300
  }
15301
15301
  addTrackPublication(e) {
15302
15302
  super.addTrackPublication(e), e.on(ae.UpdateSettings, (t) => {
15303
- this.log.debug("send update settings", Object.assign(Object.assign(Object.assign({}, this.logContext), Ze(e)), {
15303
+ this.log.debug("send update settings", Object.assign(Object.assign(Object.assign({}, this.logContext), Je(e)), {
15304
15304
  settings: t
15305
15305
  })), this.signalClient.sendUpdateTrackSettings(t);
15306
15306
  }), e.on(ae.UpdateSubscription, (t) => {
@@ -15367,7 +15367,7 @@ class fo extends fm {
15367
15367
  return;
15368
15368
  }
15369
15369
  if (e.readyState === "ended") {
15370
- this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()", Object.assign(Object.assign({}, this.logContext), Ze(o))), this.emit(ce.TrackSubscriptionFailed, t);
15370
+ this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()", Object.assign(Object.assign({}, this.logContext), Je(o))), this.emit(ce.TrackSubscriptionFailed, t);
15371
15371
  return;
15372
15372
  }
15373
15373
  const c = e.kind === "video";
@@ -15404,13 +15404,13 @@ class fo extends fm {
15404
15404
  }), o.updateInfo(s), n.set(s.sid, o);
15405
15405
  const l = Array.from(this.trackPublications.values()).find((d) => d.source === (o == null ? void 0 : o.source));
15406
15406
  l && o.source !== Z.Source.Unknown && this.log.debug("received a second track publication for ".concat(this.identity, " with the same source: ").concat(o.source), Object.assign(Object.assign({}, this.logContext), {
15407
- oldTrack: Ze(l),
15408
- newTrack: Ze(o)
15407
+ oldTrack: Je(l),
15408
+ newTrack: Je(o)
15409
15409
  })), this.addTrackPublication(o);
15410
15410
  }
15411
15411
  t.set(s.sid, o);
15412
15412
  }), this.trackPublications.forEach((s) => {
15413
- t.has(s.trackSid) || (this.log.trace("detected removed track on remote participant, unpublishing", Object.assign(Object.assign({}, this.logContext), Ze(s))), this.unpublishTrack(s.trackSid, !0));
15413
+ t.has(s.trackSid) || (this.log.trace("detected removed track on remote participant, unpublishing", Object.assign(Object.assign({}, this.logContext), Je(s))), this.unpublishTrack(s.trackSid, !0));
15414
15414
  }), n.forEach((s) => {
15415
15415
  this.emit(ce.TrackPublished, s);
15416
15416
  }), !0;
@@ -15468,7 +15468,7 @@ class cr extends hi.EventEmitter {
15468
15468
  */
15469
15469
  constructor(e) {
15470
15470
  var t, n, s, r;
15471
- if (super(), t = this, this.state = ut.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.isVideoPlaybackBlocked = !1, this.log = nt, this.bufferedEvents = [], this.isResuming = !1, this.rpcHandlers = /* @__PURE__ */ new Map(), this.connect = (a, o, c) => P(this, void 0, void 0, function* () {
15471
+ if (super(), t = this, this.state = ut.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.isVideoPlaybackBlocked = !1, this.log = Qe, this.bufferedEvents = [], this.isResuming = !1, this.rpcHandlers = /* @__PURE__ */ new Map(), this.connect = (a, o, c) => P(this, void 0, void 0, function* () {
15472
15472
  var l;
15473
15473
  if (!q0())
15474
15474
  throw li() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
@@ -15569,7 +15569,7 @@ class cr extends hi.EventEmitter {
15569
15569
  } catch (h) {
15570
15570
  throw yield this.engine.close(), this.recreateEngine(), h;
15571
15571
  }
15572
- mn() && this.options.disconnectOnPageLeave && (window.addEventListener("pagehide", this.onPageLeave), window.addEventListener("beforeunload", this.onPageLeave)), mn() && document.addEventListener("freeze", this.onPageLeave), this.setAndEmitConnectionState(ut.Connected), this.emit(ne.Connected), this.registerConnectionReconcile();
15572
+ vn() && this.options.disconnectOnPageLeave && (window.addEventListener("pagehide", this.onPageLeave), window.addEventListener("beforeunload", this.onPageLeave)), vn() && document.addEventListener("freeze", this.onPageLeave), this.setAndEmitConnectionState(ut.Connected), this.emit(ne.Connected), this.registerConnectionReconcile();
15573
15573
  }), this.disconnect = function() {
15574
15574
  for (var a = arguments.length, o = new Array(a), c = 0; c < a; c++)
15575
15575
  o[c] = arguments[c];
@@ -15806,7 +15806,7 @@ class cr extends hi.EventEmitter {
15806
15806
  this.emit(ne.ParticipantPermissionsChanged, a, this.localParticipant);
15807
15807
  }, this.onLocalChatMessageSent = (a) => {
15808
15808
  this.emit(ne.ChatMessage, a, this.localParticipant);
15809
- }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, Ab), e), this.log = Pi((n = this.options.loggerName) !== null && n !== void 0 ? n : jn.Room), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, sm), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, rm), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, wb), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new ny(), this.outgoingDataStreamManager = new ry(this.engine, this.log), this.disconnectLock = new gn(), this.localParticipant = new fy("", "", this.engine, this.options, this.rpcHandlers, this.outgoingDataStreamManager), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", Qi(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", Qi(this.options.audioCaptureDefaults.deviceId)), !((s = this.options.audioOutput) === null || s === void 0) && s.deviceId && this.switchActiveDevice("audiooutput", Qi(this.options.audioOutput.deviceId)).catch((a) => this.log.warn("Could not set audio output: ".concat(a.message), this.logContext)), this.options.e2ee && this.setupE2EE(), mn()) {
15809
+ }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, Ab), e), this.log = Pi((n = this.options.loggerName) !== null && n !== void 0 ? n : jn.Room), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, sm), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, rm), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, wb), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new ny(), this.outgoingDataStreamManager = new ry(this.engine, this.log), this.disconnectLock = new bn(), this.localParticipant = new fy("", "", this.engine, this.options, this.rpcHandlers, this.outgoingDataStreamManager), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", Qi(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", Qi(this.options.audioCaptureDefaults.deviceId)), !((s = this.options.audioOutput) === null || s === void 0) && s.deviceId && this.switchActiveDevice("audiooutput", Qi(this.options.audioOutput.deviceId)).catch((a) => this.log.warn("Could not set audio output: ".concat(a.message), this.logContext)), this.options.e2ee && this.setupE2EE(), vn()) {
15810
15810
  const a = new AbortController();
15811
15811
  (r = navigator.mediaDevices) === null || r === void 0 || r.addEventListener("devicechange", this.handleDeviceChange, {
15812
15812
  signal: a.signal
@@ -16268,7 +16268,7 @@ class cr extends hi.EventEmitter {
16268
16268
  }), this.localParticipant.trackPublications.forEach((s) => {
16269
16269
  var r, a, o;
16270
16270
  s.track && this.localParticipant.unpublishTrack(s.track, e), e ? ((r = s.track) === null || r === void 0 || r.detach(), (a = s.track) === null || a === void 0 || a.stop()) : (o = s.track) === null || o === void 0 || o.stopMonitor();
16271
- }), this.localParticipant.off(ce.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).off(ce.ParticipantNameChanged, this.onLocalParticipantNameChanged).off(ce.AttributesChanged, this.onLocalAttributesChanged).off(ce.TrackMuted, this.onLocalTrackMuted).off(ce.TrackUnmuted, this.onLocalTrackUnmuted).off(ce.LocalTrackPublished, this.onLocalTrackPublished).off(ce.LocalTrackUnpublished, this.onLocalTrackUnpublished).off(ce.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).off(ce.MediaDevicesError, this.onMediaDevicesError).off(ce.AudioStreamAcquired, this.startAudio).off(ce.ChatMessage, this.onLocalChatMessageSent).off(ce.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged), this.localParticipant.trackPublications.clear(), this.localParticipant.videoTrackPublications.clear(), this.localParticipant.audioTrackPublications.clear(), this.remoteParticipants.clear(), this.sidToIdentity.clear(), this.activeSpeakers = [], this.audioContext && typeof this.options.webAudioMix == "boolean" && (this.audioContext.close(), this.audioContext = void 0), mn() && (window.removeEventListener("beforeunload", this.onPageLeave), window.removeEventListener("pagehide", this.onPageLeave), window.removeEventListener("freeze", this.onPageLeave), (n = navigator.mediaDevices) === null || n === void 0 || n.removeEventListener("devicechange", this.handleDeviceChange));
16271
+ }), this.localParticipant.off(ce.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).off(ce.ParticipantNameChanged, this.onLocalParticipantNameChanged).off(ce.AttributesChanged, this.onLocalAttributesChanged).off(ce.TrackMuted, this.onLocalTrackMuted).off(ce.TrackUnmuted, this.onLocalTrackUnmuted).off(ce.LocalTrackPublished, this.onLocalTrackPublished).off(ce.LocalTrackUnpublished, this.onLocalTrackUnpublished).off(ce.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).off(ce.MediaDevicesError, this.onMediaDevicesError).off(ce.AudioStreamAcquired, this.startAudio).off(ce.ChatMessage, this.onLocalChatMessageSent).off(ce.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged), this.localParticipant.trackPublications.clear(), this.localParticipant.videoTrackPublications.clear(), this.localParticipant.audioTrackPublications.clear(), this.remoteParticipants.clear(), this.sidToIdentity.clear(), this.activeSpeakers = [], this.audioContext && typeof this.options.webAudioMix == "boolean" && (this.audioContext.close(), this.audioContext = void 0), vn() && (window.removeEventListener("beforeunload", this.onPageLeave), window.removeEventListener("pagehide", this.onPageLeave), window.removeEventListener("freeze", this.onPageLeave), (n = navigator.mediaDevices) === null || n === void 0 || n.removeEventListener("devicechange", this.handleDeviceChange));
16272
16272
  } finally {
16273
16273
  this.setAndEmitConnectionState(ut.Disconnected), this.emit(ne.Disconnected, t);
16274
16274
  }
@@ -16338,7 +16338,7 @@ class cr extends hi.EventEmitter {
16338
16338
  var e, t;
16339
16339
  if (typeof this.options.webAudioMix != "boolean" && this.options.webAudioMix.audioContext ? this.audioContext = this.options.webAudioMix.audioContext : (!this.audioContext || this.audioContext.state === "closed") && (this.audioContext = (e = tm()) !== null && e !== void 0 ? e : void 0), this.options.webAudioMix && this.remoteParticipants.forEach((s) => s.setAudioContext(this.audioContext)), this.localParticipant.setAudioContext(this.audioContext), this.audioContext && this.audioContext.state === "suspended")
16340
16340
  try {
16341
- yield Promise.race([this.audioContext.resume(), vn(200)]);
16341
+ yield Promise.race([this.audioContext.resume(), yn(200)]);
16342
16342
  } catch (s) {
16343
16343
  this.log.warn("Could not resume audio context", Object.assign(Object.assign({}, this.logContext), {
16344
16344
  error: s
@@ -16621,7 +16621,7 @@ class ns extends hi.EventEmitter {
16621
16621
  for (; Date.now() < s; ) {
16622
16622
  if (n)
16623
16623
  return;
16624
- yield vn(100);
16624
+ yield yn(100);
16625
16625
  }
16626
16626
  throw new Error("Could not reconnect using ".concat(e, " protocol after 10 seconds"));
16627
16627
  });
@@ -16911,7 +16911,7 @@ class xy extends ns {
16911
16911
  });
16912
16912
  });
16913
16913
  try {
16914
- yield this.connect(), nt.info("now the room is connected");
16914
+ yield this.connect(), Qe.info("now the room is connected");
16915
16915
  } catch (n) {
16916
16916
  throw this.appendWarning("ports need to be open on firewall in order to connect."), n;
16917
16917
  }
@@ -16953,7 +16953,7 @@ class Cy extends ns {
16953
16953
  });
16954
16954
  }
16955
16955
  }
16956
- class cM extends hi.EventEmitter {
16956
+ class aM extends hi.EventEmitter {
16957
16957
  constructor(e, t) {
16958
16958
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
16959
16959
  super(), this.options = {}, this.checkResults = /* @__PURE__ */ new Map(), this.url = e, this.token = t, this.options = n;
@@ -17139,7 +17139,7 @@ const ni = Ks.getInstance();
17139
17139
  typeof window < "u" && window.addEventListener("pagehide", () => {
17140
17140
  ni.forceClose();
17141
17141
  });
17142
- const hn = class hn extends EventTarget {
17142
+ const pn = class pn extends EventTarget {
17143
17143
  constructor() {
17144
17144
  super(...arguments), this.room = null, this.callStatus = "idle", this.isReady = !1, this.error = null, this.microphoneEnabled = !1, this.connectedParticipants = [], this.userIdentity = "", this.roomName = "", this.audioPlaybackPrompt = !1, this.isAppleDevice = /iPhone|iPad|iPod|Macintosh|Mac OS/i.test(navigator.userAgent), this.agentAudioElements = [], this.unmuteTimer = null, this.speakingHandler = null, this.fadeContext = null, this.fadeContextAcquired = !1, this.fadeGains = /* @__PURE__ */ new Map(), this.fadeSetupPromise = null;
17145
17145
  }
@@ -17238,10 +17238,10 @@ const hn = class hn extends EventTarget {
17238
17238
  const h = setTimeout(() => {
17239
17239
  s.off(ne.ParticipantConnected, f), u();
17240
17240
  }, 2e3), f = (g) => {
17241
- hn.isAgentIdentity(g.identity) && (clearTimeout(h), s.off(ne.ParticipantConnected, f), u());
17241
+ pn.isAgentIdentity(g.identity) && (clearTimeout(h), s.off(ne.ParticipantConnected, f), u());
17242
17242
  };
17243
17243
  for (const g of s.remoteParticipants.values())
17244
- if (hn.isAgentIdentity(g.identity)) {
17244
+ if (pn.isAgentIdentity(g.identity)) {
17245
17245
  clearTimeout(h), u();
17246
17246
  return;
17247
17247
  }
@@ -17275,7 +17275,7 @@ const hn = class hn extends EventTarget {
17275
17275
  ...this.connectedParticipants,
17276
17276
  t.identity
17277
17277
  ];
17278
- const n = hn.isAgentIdentity(t.identity);
17278
+ const n = pn.isAgentIdentity(t.identity);
17279
17279
  n && (this.updateStatus("agent-connected"), this.audioPlaybackPrompt = !0, this.dispatchEvent(
17280
17280
  new CustomEvent("agent-connected", {
17281
17281
  detail: { participant: t.identity }
@@ -17292,7 +17292,7 @@ const hn = class hn extends EventTarget {
17292
17292
  this.connectedParticipants = this.connectedParticipants.filter(
17293
17293
  (s) => s !== t.identity
17294
17294
  );
17295
- const n = hn.isAgentIdentity(t.identity);
17295
+ const n = pn.isAgentIdentity(t.identity);
17296
17296
  n && (this.audioPlaybackPrompt = !1, this.updateStatus("connected"), this.dispatchEvent(
17297
17297
  new CustomEvent("agent-disconnected", {
17298
17298
  detail: { participant: t.identity }
@@ -17308,7 +17308,7 @@ const hn = class hn extends EventTarget {
17308
17308
  (t, n, s) => {
17309
17309
  if (t.kind === "audio") {
17310
17310
  const r = t.attach();
17311
- document.body.appendChild(r), hn.isAgentIdentity(s.identity) && (this.agentAudioElements.push(r), this.setupAgentAudioFade(r)), this.dispatchEvent(
17311
+ document.body.appendChild(r), pn.isAgentIdentity(s.identity) && (this.agentAudioElements.push(r), this.setupAgentAudioFade(r)), this.dispatchEvent(
17312
17312
  new CustomEvent("audio-track-added", {
17313
17313
  detail: {
17314
17314
  participant: s.identity,
@@ -17358,16 +17358,16 @@ const hn = class hn extends EventTarget {
17358
17358
  );
17359
17359
  }), e.on(ne.AudioPlaybackStatusChanged, async () => {
17360
17360
  e.canPlaybackAudio || this.connectedParticipants.some(
17361
- (n) => hn.isAgentIdentity(n)
17361
+ (n) => pn.isAgentIdentity(n)
17362
17362
  ) && !this.audioPlaybackPrompt && (this.updateStatus("agent-connected"), this.audioPlaybackPrompt = !0), this.dispatchEvent(
17363
17363
  new CustomEvent("audio-playback-status-changed", {
17364
17364
  detail: { canPlayback: e.canPlaybackAudio }
17365
17365
  })
17366
17366
  );
17367
17367
  }), this.speakingHandler = (t) => {
17368
- t ? (this.unmuteTimer && (clearTimeout(this.unmuteTimer), this.unmuteTimer = null), this.rampAgentGain(0, hn.FADEOUT_TC)) : this.unmuteTimer = setTimeout(() => {
17369
- this.unmuteTimer = null, this.rampAgentGain(1, hn.FADEIN_TC);
17370
- }, hn.UNMUTE_HOLDOVER_MS);
17368
+ t ? (this.unmuteTimer && (clearTimeout(this.unmuteTimer), this.unmuteTimer = null), this.rampAgentGain(0, pn.FADEOUT_TC)) : this.unmuteTimer = setTimeout(() => {
17369
+ this.unmuteTimer = null, this.rampAgentGain(1, pn.FADEIN_TC);
17370
+ }, pn.UNMUTE_HOLDOVER_MS);
17371
17371
  }, e.localParticipant.on("isSpeakingChanged", this.speakingHandler);
17372
17372
  }
17373
17373
  async toggleMicrophone() {
@@ -17477,8 +17477,8 @@ const hn = class hn extends EventTarget {
17477
17477
  });
17478
17478
  }
17479
17479
  };
17480
- hn.UNMUTE_HOLDOVER_MS = 350, hn.FADEOUT_TC = 0.045, hn.FADEIN_TC = 0.03;
17481
- let lr = hn;
17480
+ pn.UNMUTE_HOLDOVER_MS = 350, pn.FADEOUT_TC = 0.045, pn.FADEIN_TC = 0.03;
17481
+ let lr = pn;
17482
17482
  /**
17483
17483
  * @license
17484
17484
  * Copyright 2010-2025 Three.js Authors
@@ -22106,7 +22106,7 @@ class Wt {
22106
22106
  */
22107
22107
  lookAt(e, t, n) {
22108
22108
  const s = this.elements;
22109
- return _n.subVectors(e, t), _n.lengthSq() === 0 && (_n.z = 1), _n.normalize(), Vi.crossVectors(n, _n), Vi.lengthSq() === 0 && (Math.abs(n.z) === 1 ? _n.x += 1e-4 : _n.z += 1e-4, _n.normalize(), Vi.crossVectors(n, _n)), Vi.normalize(), Sa.crossVectors(_n, Vi), s[0] = Vi.x, s[4] = Sa.x, s[8] = _n.x, s[1] = Vi.y, s[5] = Sa.y, s[9] = _n.y, s[2] = Vi.z, s[6] = Sa.z, s[10] = _n.z, this;
22109
+ return xn.subVectors(e, t), xn.lengthSq() === 0 && (xn.z = 1), xn.normalize(), Vi.crossVectors(n, xn), Vi.lengthSq() === 0 && (Math.abs(n.z) === 1 ? xn.x += 1e-4 : xn.z += 1e-4, xn.normalize(), Vi.crossVectors(n, xn)), Vi.normalize(), Sa.crossVectors(xn, Vi), s[0] = Vi.x, s[4] = Sa.x, s[8] = xn.x, s[1] = Vi.y, s[5] = Sa.y, s[9] = xn.y, s[2] = Vi.z, s[6] = Sa.z, s[10] = xn.z, this;
22110
22110
  }
22111
22111
  /**
22112
22112
  * Post-multiplies this matrix by the given 4x4 matrix.
@@ -22561,7 +22561,7 @@ class Wt {
22561
22561
  return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e;
22562
22562
  }
22563
22563
  }
22564
- const Fs = /* @__PURE__ */ new B(), Nn = /* @__PURE__ */ new Wt(), m_ = /* @__PURE__ */ new B(0, 0, 0), g_ = /* @__PURE__ */ new B(1, 1, 1), Vi = /* @__PURE__ */ new B(), Sa = /* @__PURE__ */ new B(), _n = /* @__PURE__ */ new B(), Nh = /* @__PURE__ */ new Wt(), Oh = /* @__PURE__ */ new ra();
22564
+ const Fs = /* @__PURE__ */ new B(), Nn = /* @__PURE__ */ new Wt(), m_ = /* @__PURE__ */ new B(0, 0, 0), g_ = /* @__PURE__ */ new B(1, 1, 1), Vi = /* @__PURE__ */ new B(), Sa = /* @__PURE__ */ new B(), xn = /* @__PURE__ */ new B(), Nh = /* @__PURE__ */ new Wt(), Oh = /* @__PURE__ */ new ra();
22565
22565
  class Li {
22566
22566
  /**
22567
22567
  * Constructs a new euler instance.
@@ -24946,7 +24946,7 @@ class cn extends ci {
24946
24946
  }
24947
24947
  }
24948
24948
  let T_ = 0;
24949
- const Rn = /* @__PURE__ */ new Wt(), Uc = /* @__PURE__ */ new wn(), Hs = /* @__PURE__ */ new B(), Sn = /* @__PURE__ */ new aa(), Rr = /* @__PURE__ */ new aa(), Yt = /* @__PURE__ */ new B();
24949
+ const Rn = /* @__PURE__ */ new Wt(), Uc = /* @__PURE__ */ new wn(), Hs = /* @__PURE__ */ new B(), Tn = /* @__PURE__ */ new aa(), Rr = /* @__PURE__ */ new aa(), Yt = /* @__PURE__ */ new B();
24950
24950
  class Xn extends mr {
24951
24951
  /**
24952
24952
  * Constructs a new geometry.
@@ -25211,7 +25211,7 @@ class Xn extends mr {
25211
25211
  if (this.boundingBox.setFromBufferAttribute(e), t)
25212
25212
  for (let n = 0, s = t.length; n < s; n++) {
25213
25213
  const r = t[n];
25214
- Sn.setFromBufferAttribute(r), this.morphTargetsRelative ? (Yt.addVectors(this.boundingBox.min, Sn.min), this.boundingBox.expandByPoint(Yt), Yt.addVectors(this.boundingBox.max, Sn.max), this.boundingBox.expandByPoint(Yt)) : (this.boundingBox.expandByPoint(Sn.min), this.boundingBox.expandByPoint(Sn.max));
25214
+ Tn.setFromBufferAttribute(r), this.morphTargetsRelative ? (Yt.addVectors(this.boundingBox.min, Tn.min), this.boundingBox.expandByPoint(Yt), Yt.addVectors(this.boundingBox.max, Tn.max), this.boundingBox.expandByPoint(Yt)) : (this.boundingBox.expandByPoint(Tn.min), this.boundingBox.expandByPoint(Tn.max));
25215
25215
  }
25216
25216
  } else
25217
25217
  this.boundingBox.makeEmpty();
@@ -25231,12 +25231,12 @@ class Xn extends mr {
25231
25231
  }
25232
25232
  if (e) {
25233
25233
  const n = this.boundingSphere.center;
25234
- if (Sn.setFromBufferAttribute(e), t)
25234
+ if (Tn.setFromBufferAttribute(e), t)
25235
25235
  for (let r = 0, a = t.length; r < a; r++) {
25236
25236
  const o = t[r];
25237
- Rr.setFromBufferAttribute(o), this.morphTargetsRelative ? (Yt.addVectors(Sn.min, Rr.min), Sn.expandByPoint(Yt), Yt.addVectors(Sn.max, Rr.max), Sn.expandByPoint(Yt)) : (Sn.expandByPoint(Rr.min), Sn.expandByPoint(Rr.max));
25237
+ Rr.setFromBufferAttribute(o), this.morphTargetsRelative ? (Yt.addVectors(Tn.min, Rr.min), Tn.expandByPoint(Yt), Yt.addVectors(Tn.max, Rr.max), Tn.expandByPoint(Yt)) : (Tn.expandByPoint(Rr.min), Tn.expandByPoint(Rr.max));
25238
25238
  }
25239
- Sn.getCenter(n);
25239
+ Tn.getCenter(n);
25240
25240
  let s = 0;
25241
25241
  for (let r = 0, a = e.count; r < a; r++)
25242
25242
  Yt.fromBufferAttribute(e, r), s = Math.max(s, n.distanceToSquared(Yt));
@@ -34190,7 +34190,7 @@ function lE(i, e, t, n, s, r, a) {
34190
34190
  Fe = mt.vertexShader, Rt = mt.fragmentShader;
34191
34191
  } else
34192
34192
  Fe = _.vertexShader, Rt = _.fragmentShader, c.update(_), bt = c.getVertexShaderID(_), Y = c.getFragmentShaderID(_);
34193
- const ie = i.getRenderTarget(), Te = i.state.buffers.depth.getReversed(), ze = F.isInstancedMesh === !0, Me = F.isBatchedMesh === !0, ct = !!_.map, Xt = !!_.matcap, at = !!W, pt = !!_.aoMap, xt = !!_.lightMap, We = !!_.bumpMap, Bt = !!_.normalMap, I = !!_.displacementMap, zt = !!_.emissiveMap, ft = !!_.metalnessMap, Mt = !!_.roughnessMap, Ae = _.anisotropy > 0, w = _.clearcoat > 0, y = _.dispersion > 0, L = _.iridescence > 0, X = _.sheen > 0, ee = _.transmission > 0, j = Ae && !!_.anisotropyMap, Pe = w && !!_.clearcoatMap, he = w && !!_.clearcoatNormalMap, we = w && !!_.clearcoatRoughnessMap, Ue = L && !!_.iridescenceMap, re = L && !!_.iridescenceThicknessMap, pe = X && !!_.sheenColorMap, Ee = X && !!_.sheenRoughnessMap, Re = !!_.specularMap, fe = !!_.specularColorMap, qe = !!_.specularIntensityMap, D = ee && !!_.transmissionMap, _e = ee && !!_.thicknessMap, oe = !!_.gradientMap, Se = !!_.alphaMap, se = _.alphaTest > 0, J = !!_.alphaHash, ue = !!_.extensions;
34193
+ const ie = i.getRenderTarget(), Te = i.state.buffers.depth.getReversed(), ze = F.isInstancedMesh === !0, Me = F.isBatchedMesh === !0, ct = !!_.map, Xt = !!_.matcap, at = !!W, pt = !!_.aoMap, xt = !!_.lightMap, He = !!_.bumpMap, Bt = !!_.normalMap, I = !!_.displacementMap, zt = !!_.emissiveMap, ft = !!_.metalnessMap, Mt = !!_.roughnessMap, Ae = _.anisotropy > 0, w = _.clearcoat > 0, y = _.dispersion > 0, L = _.iridescence > 0, $ = _.sheen > 0, ee = _.transmission > 0, j = Ae && !!_.anisotropyMap, Pe = w && !!_.clearcoatMap, he = w && !!_.clearcoatNormalMap, we = w && !!_.clearcoatRoughnessMap, Ue = L && !!_.iridescenceMap, re = L && !!_.iridescenceThicknessMap, pe = $ && !!_.sheenColorMap, Ee = $ && !!_.sheenRoughnessMap, Re = !!_.specularMap, fe = !!_.specularColorMap, We = !!_.specularIntensityMap, D = ee && !!_.transmissionMap, _e = ee && !!_.thicknessMap, oe = !!_.gradientMap, Se = !!_.alphaMap, se = _.alphaTest > 0, J = !!_.alphaHash, ue = !!_.extensions;
34194
34194
  let Ne = ai;
34195
34195
  _.toneMapped && (ie === null || ie.isXRRenderTarget === !0) && (Ne = i.toneMapping);
34196
34196
  const wt = {
@@ -34219,7 +34219,7 @@ function lE(i, e, t, n, s, r, a) {
34219
34219
  envMapCubeUVHeight: te,
34220
34220
  aoMap: pt,
34221
34221
  lightMap: xt,
34222
- bumpMap: We,
34222
+ bumpMap: He,
34223
34223
  normalMap: Bt,
34224
34224
  displacementMap: I,
34225
34225
  emissiveMap: zt,
@@ -34237,12 +34237,12 @@ function lE(i, e, t, n, s, r, a) {
34237
34237
  iridescence: L,
34238
34238
  iridescenceMap: Ue,
34239
34239
  iridescenceThicknessMap: re,
34240
- sheen: X,
34240
+ sheen: $,
34241
34241
  sheenColorMap: pe,
34242
34242
  sheenRoughnessMap: Ee,
34243
34243
  specularMap: Re,
34244
34244
  specularColorMap: fe,
34245
- specularIntensityMap: qe,
34245
+ specularIntensityMap: We,
34246
34246
  transmission: ee,
34247
34247
  transmissionMap: D,
34248
34248
  thicknessMap: _e,
@@ -34256,7 +34256,7 @@ function lE(i, e, t, n, s, r, a) {
34256
34256
  mapUv: ct && v(_.map.channel),
34257
34257
  aoMapUv: pt && v(_.aoMap.channel),
34258
34258
  lightMapUv: xt && v(_.lightMap.channel),
34259
- bumpMapUv: We && v(_.bumpMap.channel),
34259
+ bumpMapUv: He && v(_.bumpMap.channel),
34260
34260
  normalMapUv: Bt && v(_.normalMap.channel),
34261
34261
  displacementMapUv: I && v(_.displacementMap.channel),
34262
34262
  emissiveMapUv: zt && v(_.emissiveMap.channel),
@@ -34272,7 +34272,7 @@ function lE(i, e, t, n, s, r, a) {
34272
34272
  sheenRoughnessMapUv: Ee && v(_.sheenRoughnessMap.channel),
34273
34273
  specularMapUv: Re && v(_.specularMap.channel),
34274
34274
  specularColorMapUv: fe && v(_.specularColorMap.channel),
34275
- specularIntensityMapUv: qe && v(_.specularIntensityMap.channel),
34275
+ specularIntensityMapUv: We && v(_.specularIntensityMap.channel),
34276
34276
  transmissionMapUv: D && v(_.transmissionMap.channel),
34277
34277
  thicknessMapUv: _e && v(_.thicknessMap.channel),
34278
34278
  alphaMapUv: Se && v(_.alphaMap.channel),
@@ -35061,7 +35061,7 @@ function EE(i, e) {
35061
35061
  return J;
35062
35062
  }
35063
35063
  const Y = {};
35064
- Y[i.TEXTURE_2D] = bt(i.TEXTURE_2D, i.TEXTURE_2D, 1), Y[i.TEXTURE_CUBE_MAP] = bt(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), Y[i.TEXTURE_2D_ARRAY] = bt(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), Y[i.TEXTURE_3D] = bt(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), ie(i.DEPTH_TEST), a.setFunc(dr), We(!1), Bt(Eh), ie(i.CULL_FACE), pt(Ai);
35064
+ Y[i.TEXTURE_2D] = bt(i.TEXTURE_2D, i.TEXTURE_2D, 1), Y[i.TEXTURE_CUBE_MAP] = bt(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), Y[i.TEXTURE_2D_ARRAY] = bt(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), Y[i.TEXTURE_3D] = bt(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), ie(i.DEPTH_TEST), a.setFunc(dr), He(!1), Bt(Eh), ie(i.CULL_FACE), pt(Ai);
35065
35065
  function ie(D) {
35066
35066
  d[D] !== !0 && (i.enable(D), d[D] = !0);
35067
35067
  }
@@ -35163,11 +35163,11 @@ function EE(i, e) {
35163
35163
  function xt(D, _e) {
35164
35164
  D.side === Ei ? Te(i.CULL_FACE) : ie(i.CULL_FACE);
35165
35165
  let oe = D.side === an;
35166
- _e && (oe = !oe), We(oe), D.blending === ir && D.transparent === !1 ? pt(Ai) : pt(D.blending, D.blendEquation, D.blendSrc, D.blendDst, D.blendEquationAlpha, D.blendSrcAlpha, D.blendDstAlpha, D.blendColor, D.blendAlpha, D.premultipliedAlpha), a.setFunc(D.depthFunc), a.setTest(D.depthTest), a.setMask(D.depthWrite), r.setMask(D.colorWrite);
35166
+ _e && (oe = !oe), He(oe), D.blending === ir && D.transparent === !1 ? pt(Ai) : pt(D.blending, D.blendEquation, D.blendSrc, D.blendDst, D.blendEquationAlpha, D.blendSrcAlpha, D.blendDstAlpha, D.blendColor, D.blendAlpha, D.premultipliedAlpha), a.setFunc(D.depthFunc), a.setTest(D.depthTest), a.setMask(D.depthWrite), r.setMask(D.colorWrite);
35167
35167
  const Se = D.stencilWrite;
35168
35168
  o.setTest(Se), Se && (o.setMask(D.stencilWriteMask), o.setFunc(D.stencilFunc, D.stencilRef, D.stencilFuncMask), o.setOp(D.stencilFail, D.stencilZFail, D.stencilZPass)), zt(D.polygonOffset, D.polygonOffsetFactor, D.polygonOffsetUnits), D.alphaToCoverage === !0 ? ie(i.SAMPLE_ALPHA_TO_COVERAGE) : Te(i.SAMPLE_ALPHA_TO_COVERAGE);
35169
35169
  }
35170
- function We(D) {
35170
+ function He(D) {
35171
35171
  T !== D && (D ? i.frontFace(i.CW) : i.frontFace(i.CCW), T = D);
35172
35172
  }
35173
35173
  function Bt(D) {
@@ -35208,7 +35208,7 @@ function EE(i, e) {
35208
35208
  dt("WebGLState:", D);
35209
35209
  }
35210
35210
  }
35211
- function X() {
35211
+ function $() {
35212
35212
  try {
35213
35213
  i.texSubImage2D(...arguments);
35214
35214
  } catch (D) {
@@ -35280,7 +35280,7 @@ function EE(i, e) {
35280
35280
  const Se = l.get(_e).get(D);
35281
35281
  c.get(_e) !== Se && (i.uniformBlockBinding(_e, Se, D.__bindingPointIndex), c.set(_e, Se));
35282
35282
  }
35283
- function qe() {
35283
+ function We() {
35284
35284
  i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), a.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), d = {}, ve = null, de = {}, u = {}, h = /* @__PURE__ */ new WeakMap(), f = [], g = null, v = !1, m = null, p = null, x = null, C = null, b = null, S = null, M = null, A = new rt(0, 0, 0), k = 0, _ = !1, T = null, R = null, N = null, F = null, q = null, Fe.set(0, 0, i.canvas.width, i.canvas.height), Rt.set(0, 0, i.canvas.width, i.canvas.height), r.reset(), a.reset(), o.reset();
35285
35285
  }
35286
35286
  return {
@@ -35296,7 +35296,7 @@ function EE(i, e) {
35296
35296
  useProgram: ct,
35297
35297
  setBlending: pt,
35298
35298
  setMaterial: xt,
35299
- setFlipSided: We,
35299
+ setFlipSided: He,
35300
35300
  setCullFace: Bt,
35301
35301
  setLineWidth: I,
35302
35302
  setPolygonOffset: zt,
@@ -35312,13 +35312,13 @@ function EE(i, e) {
35312
35312
  uniformBlockBinding: fe,
35313
35313
  texStorage2D: he,
35314
35314
  texStorage3D: we,
35315
- texSubImage2D: X,
35315
+ texSubImage2D: $,
35316
35316
  texSubImage3D: ee,
35317
35317
  compressedTexSubImage2D: j,
35318
35318
  compressedTexSubImage3D: Pe,
35319
35319
  scissor: pe,
35320
35320
  viewport: Ee,
35321
- reset: qe
35321
+ reset: We
35322
35322
  };
35323
35323
  }
35324
35324
  function ME(i, e, t, n, s, r, a) {
@@ -35334,11 +35334,11 @@ function ME(i, e, t, n, s, r, a) {
35334
35334
  return f ? new OffscreenCanvas(w, y) : go("canvas");
35335
35335
  }
35336
35336
  function v(w, y, L) {
35337
- let X = 1;
35337
+ let $ = 1;
35338
35338
  const ee = Ae(w);
35339
- if ((ee.width > L || ee.height > L) && (X = L / Math.max(ee.width, ee.height)), X < 1)
35339
+ if ((ee.width > L || ee.height > L) && ($ = L / Math.max(ee.width, ee.height)), $ < 1)
35340
35340
  if (typeof HTMLImageElement < "u" && w instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && w instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && w instanceof ImageBitmap || typeof VideoFrame < "u" && w instanceof VideoFrame) {
35341
- const j = Math.floor(X * ee.width), Pe = Math.floor(X * ee.height);
35341
+ const j = Math.floor($ * ee.width), Pe = Math.floor($ * ee.height);
35342
35342
  u === void 0 && (u = g(j, Pe));
35343
35343
  const he = y ? g(j, Pe) : u;
35344
35344
  return he.width = j, he.height = Pe, he.getContext("2d").drawImage(w, 0, 0, j, Pe), Oe("WebGLRenderer: Texture has been resized from (" + ee.width + "x" + ee.height + ") to (" + j + "x" + Pe + ")."), he;
@@ -35355,14 +35355,14 @@ function ME(i, e, t, n, s, r, a) {
35355
35355
  function x(w) {
35356
35356
  return w.isWebGLCubeRenderTarget ? i.TEXTURE_CUBE_MAP : w.isWebGL3DRenderTarget ? i.TEXTURE_3D : w.isWebGLArrayRenderTarget || w.isCompressedArrayTexture ? i.TEXTURE_2D_ARRAY : i.TEXTURE_2D;
35357
35357
  }
35358
- function C(w, y, L, X, ee = !1) {
35358
+ function C(w, y, L, $, ee = !1) {
35359
35359
  if (w !== null) {
35360
35360
  if (i[w] !== void 0) return i[w];
35361
35361
  Oe("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + w + "'");
35362
35362
  }
35363
35363
  let j = y;
35364
35364
  if (y === i.RED && (L === i.FLOAT && (j = i.R32F), L === i.HALF_FLOAT && (j = i.R16F), L === i.UNSIGNED_BYTE && (j = i.R8)), y === i.RED_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.R8UI), L === i.UNSIGNED_SHORT && (j = i.R16UI), L === i.UNSIGNED_INT && (j = i.R32UI), L === i.BYTE && (j = i.R8I), L === i.SHORT && (j = i.R16I), L === i.INT && (j = i.R32I)), y === i.RG && (L === i.FLOAT && (j = i.RG32F), L === i.HALF_FLOAT && (j = i.RG16F), L === i.UNSIGNED_BYTE && (j = i.RG8)), y === i.RG_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RG8UI), L === i.UNSIGNED_SHORT && (j = i.RG16UI), L === i.UNSIGNED_INT && (j = i.RG32UI), L === i.BYTE && (j = i.RG8I), L === i.SHORT && (j = i.RG16I), L === i.INT && (j = i.RG32I)), y === i.RGB_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RGB8UI), L === i.UNSIGNED_SHORT && (j = i.RGB16UI), L === i.UNSIGNED_INT && (j = i.RGB32UI), L === i.BYTE && (j = i.RGB8I), L === i.SHORT && (j = i.RGB16I), L === i.INT && (j = i.RGB32I)), y === i.RGBA_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RGBA8UI), L === i.UNSIGNED_SHORT && (j = i.RGBA16UI), L === i.UNSIGNED_INT && (j = i.RGBA32UI), L === i.BYTE && (j = i.RGBA8I), L === i.SHORT && (j = i.RGBA16I), L === i.INT && (j = i.RGBA32I)), y === i.RGB && (L === i.UNSIGNED_INT_5_9_9_9_REV && (j = i.RGB9_E5), L === i.UNSIGNED_INT_10F_11F_11F_REV && (j = i.R11F_G11F_B10F)), y === i.RGBA) {
35365
- const Pe = ee ? po : ot.getTransfer(X);
35365
+ const Pe = ee ? po : ot.getTransfer($);
35366
35366
  L === i.FLOAT && (j = i.RGBA32F), L === i.HALF_FLOAT && (j = i.RGBA16F), L === i.UNSIGNED_BYTE && (j = Pe === vt ? i.SRGB8_ALPHA8 : i.RGBA8), L === i.UNSIGNED_SHORT_4_4_4_4 && (j = i.RGBA4), L === i.UNSIGNED_SHORT_5_5_5_1 && (j = i.RGB5_A1);
35367
35367
  }
35368
35368
  return (j === i.R16F || j === i.R32F || j === i.RG16F || j === i.RG32F || j === i.RGBA16F || j === i.RGBA32F) && e.get("EXT_color_buffer_float"), j;
@@ -35385,43 +35385,43 @@ function ME(i, e, t, n, s, r, a) {
35385
35385
  function k(w) {
35386
35386
  const y = n.get(w);
35387
35387
  if (y.__webglInit === void 0) return;
35388
- const L = w.source, X = h.get(L);
35389
- if (X) {
35390
- const ee = X[y.__cacheKey];
35391
- ee.usedTimes--, ee.usedTimes === 0 && _(w), Object.keys(X).length === 0 && h.delete(L);
35388
+ const L = w.source, $ = h.get(L);
35389
+ if ($) {
35390
+ const ee = $[y.__cacheKey];
35391
+ ee.usedTimes--, ee.usedTimes === 0 && _(w), Object.keys($).length === 0 && h.delete(L);
35392
35392
  }
35393
35393
  n.remove(w);
35394
35394
  }
35395
35395
  function _(w) {
35396
35396
  const y = n.get(w);
35397
35397
  i.deleteTexture(y.__webglTexture);
35398
- const L = w.source, X = h.get(L);
35399
- delete X[y.__cacheKey], a.memory.textures--;
35398
+ const L = w.source, $ = h.get(L);
35399
+ delete $[y.__cacheKey], a.memory.textures--;
35400
35400
  }
35401
35401
  function T(w) {
35402
35402
  const y = n.get(w);
35403
35403
  if (w.depthTexture && (w.depthTexture.dispose(), n.remove(w.depthTexture)), w.isWebGLCubeRenderTarget)
35404
- for (let X = 0; X < 6; X++) {
35405
- if (Array.isArray(y.__webglFramebuffer[X]))
35406
- for (let ee = 0; ee < y.__webglFramebuffer[X].length; ee++) i.deleteFramebuffer(y.__webglFramebuffer[X][ee]);
35404
+ for (let $ = 0; $ < 6; $++) {
35405
+ if (Array.isArray(y.__webglFramebuffer[$]))
35406
+ for (let ee = 0; ee < y.__webglFramebuffer[$].length; ee++) i.deleteFramebuffer(y.__webglFramebuffer[$][ee]);
35407
35407
  else
35408
- i.deleteFramebuffer(y.__webglFramebuffer[X]);
35409
- y.__webglDepthbuffer && i.deleteRenderbuffer(y.__webglDepthbuffer[X]);
35408
+ i.deleteFramebuffer(y.__webglFramebuffer[$]);
35409
+ y.__webglDepthbuffer && i.deleteRenderbuffer(y.__webglDepthbuffer[$]);
35410
35410
  }
35411
35411
  else {
35412
35412
  if (Array.isArray(y.__webglFramebuffer))
35413
- for (let X = 0; X < y.__webglFramebuffer.length; X++) i.deleteFramebuffer(y.__webglFramebuffer[X]);
35413
+ for (let $ = 0; $ < y.__webglFramebuffer.length; $++) i.deleteFramebuffer(y.__webglFramebuffer[$]);
35414
35414
  else
35415
35415
  i.deleteFramebuffer(y.__webglFramebuffer);
35416
35416
  if (y.__webglDepthbuffer && i.deleteRenderbuffer(y.__webglDepthbuffer), y.__webglMultisampledFramebuffer && i.deleteFramebuffer(y.__webglMultisampledFramebuffer), y.__webglColorRenderbuffer)
35417
- for (let X = 0; X < y.__webglColorRenderbuffer.length; X++)
35418
- y.__webglColorRenderbuffer[X] && i.deleteRenderbuffer(y.__webglColorRenderbuffer[X]);
35417
+ for (let $ = 0; $ < y.__webglColorRenderbuffer.length; $++)
35418
+ y.__webglColorRenderbuffer[$] && i.deleteRenderbuffer(y.__webglColorRenderbuffer[$]);
35419
35419
  y.__webglDepthRenderbuffer && i.deleteRenderbuffer(y.__webglDepthRenderbuffer);
35420
35420
  }
35421
35421
  const L = w.textures;
35422
- for (let X = 0, ee = L.length; X < ee; X++) {
35423
- const j = n.get(L[X]);
35424
- j.__webglTexture && (i.deleteTexture(j.__webglTexture), a.memory.textures--), n.remove(L[X]);
35422
+ for (let $ = 0, ee = L.length; $ < ee; $++) {
35423
+ const j = n.get(L[$]);
35424
+ j.__webglTexture && (i.deleteTexture(j.__webglTexture), a.memory.textures--), n.remove(L[$]);
35425
35425
  }
35426
35426
  n.remove(w);
35427
35427
  }
@@ -35440,10 +35440,10 @@ function ME(i, e, t, n, s, r, a) {
35440
35440
  function K(w, y) {
35441
35441
  const L = n.get(w);
35442
35442
  if (w.isVideoTexture && ft(w), w.isRenderTargetTexture === !1 && w.isExternalTexture !== !0 && w.version > 0 && L.__version !== w.version) {
35443
- const X = w.image;
35444
- if (X === null)
35443
+ const $ = w.image;
35444
+ if ($ === null)
35445
35445
  Oe("WebGLRenderer: Texture marked for update but no image data found.");
35446
- else if (X.complete === !1)
35446
+ else if ($.complete === !1)
35447
35447
  Oe("WebGLRenderer: Texture marked for update but image is incomplete");
35448
35448
  else {
35449
35449
  Y(L, w, y);
@@ -35509,9 +35509,9 @@ function ME(i, e, t, n, s, r, a) {
35509
35509
  function Fe(w, y) {
35510
35510
  let L = !1;
35511
35511
  w.__webglInit === void 0 && (w.__webglInit = !0, y.addEventListener("dispose", M));
35512
- const X = y.source;
35513
- let ee = h.get(X);
35514
- ee === void 0 && (ee = {}, h.set(X, ee));
35512
+ const $ = y.source;
35513
+ let ee = h.get($);
35514
+ ee === void 0 && (ee = {}, h.set($, ee));
35515
35515
  const j = q(y);
35516
35516
  if (j !== w.__cacheKey) {
35517
35517
  ee[j] === void 0 && (ee[j] = {
@@ -35526,16 +35526,16 @@ function ME(i, e, t, n, s, r, a) {
35526
35526
  function Rt(w, y, L) {
35527
35527
  return Math.floor(Math.floor(w / L) / y);
35528
35528
  }
35529
- function bt(w, y, L, X) {
35529
+ function bt(w, y, L, $) {
35530
35530
  const j = w.updateRanges;
35531
35531
  if (j.length === 0)
35532
- t.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, y.width, y.height, L, X, y.data);
35532
+ t.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, y.width, y.height, L, $, y.data);
35533
35533
  else {
35534
35534
  j.sort((re, pe) => re.start - pe.start);
35535
35535
  let Pe = 0;
35536
35536
  for (let re = 1; re < j.length; re++) {
35537
- const pe = j[Pe], Ee = j[re], Re = pe.start + pe.count, fe = Rt(Ee.start, y.width, 4), qe = Rt(pe.start, y.width, 4);
35538
- Ee.start <= Re + 1 && fe === qe && Rt(Ee.start + Ee.count - 1, y.width, 4) === fe ? pe.count = Math.max(
35537
+ const pe = j[Pe], Ee = j[re], Re = pe.start + pe.count, fe = Rt(Ee.start, y.width, 4), We = Rt(pe.start, y.width, 4);
35538
+ Ee.start <= Re + 1 && fe === We && Rt(Ee.start + Ee.count - 1, y.width, 4) === fe ? pe.count = Math.max(
35539
35539
  pe.count,
35540
35540
  Ee.start + Ee.count - pe.start
35541
35541
  ) : (++Pe, j[Pe] = Ee);
@@ -35544,17 +35544,17 @@ function ME(i, e, t, n, s, r, a) {
35544
35544
  const he = i.getParameter(i.UNPACK_ROW_LENGTH), we = i.getParameter(i.UNPACK_SKIP_PIXELS), Ue = i.getParameter(i.UNPACK_SKIP_ROWS);
35545
35545
  i.pixelStorei(i.UNPACK_ROW_LENGTH, y.width);
35546
35546
  for (let re = 0, pe = j.length; re < pe; re++) {
35547
- const Ee = j[re], Re = Math.floor(Ee.start / 4), fe = Math.ceil(Ee.count / 4), qe = Re % y.width, D = Math.floor(Re / y.width), _e = fe, oe = 1;
35548
- i.pixelStorei(i.UNPACK_SKIP_PIXELS, qe), i.pixelStorei(i.UNPACK_SKIP_ROWS, D), t.texSubImage2D(i.TEXTURE_2D, 0, qe, D, _e, oe, L, X, y.data);
35547
+ const Ee = j[re], Re = Math.floor(Ee.start / 4), fe = Math.ceil(Ee.count / 4), We = Re % y.width, D = Math.floor(Re / y.width), _e = fe, oe = 1;
35548
+ i.pixelStorei(i.UNPACK_SKIP_PIXELS, We), i.pixelStorei(i.UNPACK_SKIP_ROWS, D), t.texSubImage2D(i.TEXTURE_2D, 0, We, D, _e, oe, L, $, y.data);
35549
35549
  }
35550
35550
  w.clearUpdateRanges(), i.pixelStorei(i.UNPACK_ROW_LENGTH, he), i.pixelStorei(i.UNPACK_SKIP_PIXELS, we), i.pixelStorei(i.UNPACK_SKIP_ROWS, Ue);
35551
35551
  }
35552
35552
  }
35553
35553
  function Y(w, y, L) {
35554
- let X = i.TEXTURE_2D;
35555
- (y.isDataArrayTexture || y.isCompressedArrayTexture) && (X = i.TEXTURE_2D_ARRAY), y.isData3DTexture && (X = i.TEXTURE_3D);
35554
+ let $ = i.TEXTURE_2D;
35555
+ (y.isDataArrayTexture || y.isCompressedArrayTexture) && ($ = i.TEXTURE_2D_ARRAY), y.isData3DTexture && ($ = i.TEXTURE_3D);
35556
35556
  const ee = Fe(w, y), j = y.source;
35557
- t.bindTexture(X, w.__webglTexture, i.TEXTURE0 + L);
35557
+ t.bindTexture($, w.__webglTexture, i.TEXTURE0 + L);
35558
35558
  const Pe = n.get(j);
35559
35559
  if (j.version !== Pe.__version || ee === !0) {
35560
35560
  t.activeTexture(i.TEXTURE0 + L);
@@ -35564,24 +35564,24 @@ function ME(i, e, t, n, s, r, a) {
35564
35564
  re = Mt(y, re);
35565
35565
  const pe = r.convert(y.format, y.colorSpace), Ee = r.convert(y.type);
35566
35566
  let Re = C(y.internalFormat, pe, Ee, y.colorSpace, y.isVideoTexture);
35567
- Be(X, y);
35567
+ Be($, y);
35568
35568
  let fe;
35569
- const qe = y.mipmaps, D = y.isVideoTexture !== !0, _e = Pe.__version === void 0 || ee === !0, oe = j.dataReady, Se = S(y, re);
35569
+ const We = y.mipmaps, D = y.isVideoTexture !== !0, _e = Pe.__version === void 0 || ee === !0, oe = j.dataReady, Se = S(y, re);
35570
35570
  if (y.isDepthTexture)
35571
35571
  Re = b(y.format === ys, y.type), _e && (D ? t.texStorage2D(i.TEXTURE_2D, 1, Re, re.width, re.height) : t.texImage2D(i.TEXTURE_2D, 0, Re, re.width, re.height, 0, pe, Ee, null));
35572
35572
  else if (y.isDataTexture)
35573
- if (qe.length > 0) {
35574
- D && _e && t.texStorage2D(i.TEXTURE_2D, Se, Re, qe[0].width, qe[0].height);
35575
- for (let se = 0, J = qe.length; se < J; se++)
35576
- fe = qe[se], D ? oe && t.texSubImage2D(i.TEXTURE_2D, se, 0, 0, fe.width, fe.height, pe, Ee, fe.data) : t.texImage2D(i.TEXTURE_2D, se, Re, fe.width, fe.height, 0, pe, Ee, fe.data);
35573
+ if (We.length > 0) {
35574
+ D && _e && t.texStorage2D(i.TEXTURE_2D, Se, Re, We[0].width, We[0].height);
35575
+ for (let se = 0, J = We.length; se < J; se++)
35576
+ fe = We[se], D ? oe && t.texSubImage2D(i.TEXTURE_2D, se, 0, 0, fe.width, fe.height, pe, Ee, fe.data) : t.texImage2D(i.TEXTURE_2D, se, Re, fe.width, fe.height, 0, pe, Ee, fe.data);
35577
35577
  y.generateMipmaps = !1;
35578
35578
  } else
35579
35579
  D ? (_e && t.texStorage2D(i.TEXTURE_2D, Se, Re, re.width, re.height), oe && bt(y, re, pe, Ee)) : t.texImage2D(i.TEXTURE_2D, 0, Re, re.width, re.height, 0, pe, Ee, re.data);
35580
35580
  else if (y.isCompressedTexture)
35581
35581
  if (y.isCompressedArrayTexture) {
35582
- D && _e && t.texStorage3D(i.TEXTURE_2D_ARRAY, Se, Re, qe[0].width, qe[0].height, re.depth);
35583
- for (let se = 0, J = qe.length; se < J; se++)
35584
- if (fe = qe[se], y.format !== qn)
35582
+ D && _e && t.texStorage3D(i.TEXTURE_2D_ARRAY, Se, Re, We[0].width, We[0].height, re.depth);
35583
+ for (let se = 0, J = We.length; se < J; se++)
35584
+ if (fe = We[se], y.format !== qn)
35585
35585
  if (pe !== null)
35586
35586
  if (D) {
35587
35587
  if (oe)
@@ -35604,9 +35604,9 @@ function ME(i, e, t, n, s, r, a) {
35604
35604
  else
35605
35605
  D ? oe && t.texSubImage3D(i.TEXTURE_2D_ARRAY, se, 0, 0, 0, fe.width, fe.height, re.depth, pe, Ee, fe.data) : t.texImage3D(i.TEXTURE_2D_ARRAY, se, Re, fe.width, fe.height, re.depth, 0, pe, Ee, fe.data);
35606
35606
  } else {
35607
- D && _e && t.texStorage2D(i.TEXTURE_2D, Se, Re, qe[0].width, qe[0].height);
35608
- for (let se = 0, J = qe.length; se < J; se++)
35609
- fe = qe[se], y.format !== qn ? pe !== null ? D ? oe && t.compressedTexSubImage2D(i.TEXTURE_2D, se, 0, 0, fe.width, fe.height, pe, fe.data) : t.compressedTexImage2D(i.TEXTURE_2D, se, Re, fe.width, fe.height, 0, fe.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : D ? oe && t.texSubImage2D(i.TEXTURE_2D, se, 0, 0, fe.width, fe.height, pe, Ee, fe.data) : t.texImage2D(i.TEXTURE_2D, se, Re, fe.width, fe.height, 0, pe, Ee, fe.data);
35607
+ D && _e && t.texStorage2D(i.TEXTURE_2D, Se, Re, We[0].width, We[0].height);
35608
+ for (let se = 0, J = We.length; se < J; se++)
35609
+ fe = We[se], y.format !== qn ? pe !== null ? D ? oe && t.compressedTexSubImage2D(i.TEXTURE_2D, se, 0, 0, fe.width, fe.height, pe, fe.data) : t.compressedTexImage2D(i.TEXTURE_2D, se, Re, fe.width, fe.height, 0, fe.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : D ? oe && t.texSubImage2D(i.TEXTURE_2D, se, 0, 0, fe.width, fe.height, pe, Ee, fe.data) : t.texImage2D(i.TEXTURE_2D, se, Re, fe.width, fe.height, 0, pe, Ee, fe.data);
35610
35610
  }
35611
35611
  else if (y.isDataArrayTexture)
35612
35612
  if (D) {
@@ -35636,13 +35636,13 @@ function ME(i, e, t, n, s, r, a) {
35636
35636
  for (let ue = 0; ue < Se; ue++)
35637
35637
  t.texImage2D(i.TEXTURE_2D, ue, Re, se, J, 0, pe, Ee, null), se >>= 1, J >>= 1;
35638
35638
  }
35639
- } else if (qe.length > 0) {
35639
+ } else if (We.length > 0) {
35640
35640
  if (D && _e) {
35641
- const se = Ae(qe[0]);
35641
+ const se = Ae(We[0]);
35642
35642
  t.texStorage2D(i.TEXTURE_2D, Se, Re, se.width, se.height);
35643
35643
  }
35644
- for (let se = 0, J = qe.length; se < J; se++)
35645
- fe = qe[se], D ? oe && t.texSubImage2D(i.TEXTURE_2D, se, 0, 0, pe, Ee, fe) : t.texImage2D(i.TEXTURE_2D, se, Re, pe, Ee, fe);
35644
+ for (let se = 0, J = We.length; se < J; se++)
35645
+ fe = We[se], D ? oe && t.texSubImage2D(i.TEXTURE_2D, se, 0, 0, pe, Ee, fe) : t.texImage2D(i.TEXTURE_2D, se, Re, pe, Ee, fe);
35646
35646
  y.generateMipmaps = !1;
35647
35647
  } else if (D) {
35648
35648
  if (_e) {
@@ -35652,53 +35652,53 @@ function ME(i, e, t, n, s, r, a) {
35652
35652
  oe && t.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, pe, Ee, re);
35653
35653
  } else
35654
35654
  t.texImage2D(i.TEXTURE_2D, 0, Re, pe, Ee, re);
35655
- m(y) && p(X), Pe.__version = j.version, y.onUpdate && y.onUpdate(y);
35655
+ m(y) && p($), Pe.__version = j.version, y.onUpdate && y.onUpdate(y);
35656
35656
  }
35657
35657
  w.__version = y.version;
35658
35658
  }
35659
35659
  function ie(w, y, L) {
35660
35660
  if (y.image.length !== 6) return;
35661
- const X = Fe(w, y), ee = y.source;
35661
+ const $ = Fe(w, y), ee = y.source;
35662
35662
  t.bindTexture(i.TEXTURE_CUBE_MAP, w.__webglTexture, i.TEXTURE0 + L);
35663
35663
  const j = n.get(ee);
35664
- if (ee.version !== j.__version || X === !0) {
35664
+ if (ee.version !== j.__version || $ === !0) {
35665
35665
  t.activeTexture(i.TEXTURE0 + L);
35666
35666
  const Pe = ot.getPrimaries(ot.workingColorSpace), he = y.colorSpace === Xi ? null : ot.getPrimaries(y.colorSpace), we = y.colorSpace === Xi || Pe === he ? i.NONE : i.BROWSER_DEFAULT_WEBGL;
35667
35667
  i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, y.flipY), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, y.premultiplyAlpha), i.pixelStorei(i.UNPACK_ALIGNMENT, y.unpackAlignment), i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL, we);
35668
35668
  const Ue = y.isCompressedTexture || y.image[0].isCompressedTexture, re = y.image[0] && y.image[0].isDataTexture, pe = [];
35669
35669
  for (let J = 0; J < 6; J++)
35670
35670
  !Ue && !re ? pe[J] = v(y.image[J], !0, s.maxCubemapSize) : pe[J] = re ? y.image[J].image : y.image[J], pe[J] = Mt(y, pe[J]);
35671
- const Ee = pe[0], Re = r.convert(y.format, y.colorSpace), fe = r.convert(y.type), qe = C(y.internalFormat, Re, fe, y.colorSpace), D = y.isVideoTexture !== !0, _e = j.__version === void 0 || X === !0, oe = ee.dataReady;
35671
+ const Ee = pe[0], Re = r.convert(y.format, y.colorSpace), fe = r.convert(y.type), We = C(y.internalFormat, Re, fe, y.colorSpace), D = y.isVideoTexture !== !0, _e = j.__version === void 0 || $ === !0, oe = ee.dataReady;
35672
35672
  let Se = S(y, Ee);
35673
35673
  Be(i.TEXTURE_CUBE_MAP, y);
35674
35674
  let se;
35675
35675
  if (Ue) {
35676
- D && _e && t.texStorage2D(i.TEXTURE_CUBE_MAP, Se, qe, Ee.width, Ee.height);
35676
+ D && _e && t.texStorage2D(i.TEXTURE_CUBE_MAP, Se, We, Ee.width, Ee.height);
35677
35677
  for (let J = 0; J < 6; J++) {
35678
35678
  se = pe[J].mipmaps;
35679
35679
  for (let ue = 0; ue < se.length; ue++) {
35680
35680
  const Ne = se[ue];
35681
- y.format !== qn ? Re !== null ? D ? oe && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, 0, 0, Ne.width, Ne.height, Re, Ne.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, qe, Ne.width, Ne.height, 0, Ne.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, 0, 0, Ne.width, Ne.height, Re, fe, Ne.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, qe, Ne.width, Ne.height, 0, Re, fe, Ne.data);
35681
+ y.format !== qn ? Re !== null ? D ? oe && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, 0, 0, Ne.width, Ne.height, Re, Ne.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, We, Ne.width, Ne.height, 0, Ne.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, 0, 0, Ne.width, Ne.height, Re, fe, Ne.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue, We, Ne.width, Ne.height, 0, Re, fe, Ne.data);
35682
35682
  }
35683
35683
  }
35684
35684
  } else {
35685
35685
  if (se = y.mipmaps, D && _e) {
35686
35686
  se.length > 0 && Se++;
35687
35687
  const J = Ae(pe[0]);
35688
- t.texStorage2D(i.TEXTURE_CUBE_MAP, Se, qe, J.width, J.height);
35688
+ t.texStorage2D(i.TEXTURE_CUBE_MAP, Se, We, J.width, J.height);
35689
35689
  }
35690
35690
  for (let J = 0; J < 6; J++)
35691
35691
  if (re) {
35692
- D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, 0, 0, pe[J].width, pe[J].height, Re, fe, pe[J].data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, qe, pe[J].width, pe[J].height, 0, Re, fe, pe[J].data);
35692
+ D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, 0, 0, pe[J].width, pe[J].height, Re, fe, pe[J].data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, We, pe[J].width, pe[J].height, 0, Re, fe, pe[J].data);
35693
35693
  for (let ue = 0; ue < se.length; ue++) {
35694
35694
  const wt = se[ue].image[J].image;
35695
- D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, 0, 0, wt.width, wt.height, Re, fe, wt.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, qe, wt.width, wt.height, 0, Re, fe, wt.data);
35695
+ D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, 0, 0, wt.width, wt.height, Re, fe, wt.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, We, wt.width, wt.height, 0, Re, fe, wt.data);
35696
35696
  }
35697
35697
  } else {
35698
- D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, 0, 0, Re, fe, pe[J]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, qe, Re, fe, pe[J]);
35698
+ D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, 0, 0, Re, fe, pe[J]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, 0, We, Re, fe, pe[J]);
35699
35699
  for (let ue = 0; ue < se.length; ue++) {
35700
35700
  const Ne = se[ue];
35701
- D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, 0, 0, Re, fe, Ne.image[J]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, qe, Re, fe, Ne.image[J]);
35701
+ D ? oe && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, 0, 0, Re, fe, Ne.image[J]) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + J, ue + 1, We, Re, fe, Ne.image[J]);
35702
35702
  }
35703
35703
  }
35704
35704
  }
@@ -35706,33 +35706,33 @@ function ME(i, e, t, n, s, r, a) {
35706
35706
  }
35707
35707
  w.__version = y.version;
35708
35708
  }
35709
- function Te(w, y, L, X, ee, j) {
35709
+ function Te(w, y, L, $, ee, j) {
35710
35710
  const Pe = r.convert(L.format, L.colorSpace), he = r.convert(L.type), we = C(L.internalFormat, Pe, he, L.colorSpace), Ue = n.get(y), re = n.get(L);
35711
35711
  if (re.__renderTarget = y, !Ue.__hasExternalTextures) {
35712
35712
  const pe = Math.max(1, y.width >> j), Ee = Math.max(1, y.height >> j);
35713
35713
  ee === i.TEXTURE_3D || ee === i.TEXTURE_2D_ARRAY ? t.texImage3D(ee, j, we, pe, Ee, y.depth, 0, Pe, he, null) : t.texImage2D(ee, j, we, pe, Ee, 0, Pe, he, null);
35714
35714
  }
35715
- t.bindFramebuffer(i.FRAMEBUFFER, w), zt(y) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, X, ee, re.__webglTexture, 0, I(y)) : (ee === i.TEXTURE_2D || ee >= i.TEXTURE_CUBE_MAP_POSITIVE_X && ee <= i.TEXTURE_CUBE_MAP_NEGATIVE_Z) && i.framebufferTexture2D(i.FRAMEBUFFER, X, ee, re.__webglTexture, j), t.bindFramebuffer(i.FRAMEBUFFER, null);
35715
+ t.bindFramebuffer(i.FRAMEBUFFER, w), zt(y) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, $, ee, re.__webglTexture, 0, I(y)) : (ee === i.TEXTURE_2D || ee >= i.TEXTURE_CUBE_MAP_POSITIVE_X && ee <= i.TEXTURE_CUBE_MAP_NEGATIVE_Z) && i.framebufferTexture2D(i.FRAMEBUFFER, $, ee, re.__webglTexture, j), t.bindFramebuffer(i.FRAMEBUFFER, null);
35716
35716
  }
35717
35717
  function ze(w, y, L) {
35718
35718
  if (i.bindRenderbuffer(i.RENDERBUFFER, w), y.depthBuffer) {
35719
- const X = y.depthTexture, ee = X && X.isDepthTexture ? X.type : null, j = b(y.stencilBuffer, ee), Pe = y.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
35719
+ const $ = y.depthTexture, ee = $ && $.isDepthTexture ? $.type : null, j = b(y.stencilBuffer, ee), Pe = y.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
35720
35720
  zt(y) ? o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, I(y), j, y.width, y.height) : L ? i.renderbufferStorageMultisample(i.RENDERBUFFER, I(y), j, y.width, y.height) : i.renderbufferStorage(i.RENDERBUFFER, j, y.width, y.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, Pe, i.RENDERBUFFER, w);
35721
35721
  } else {
35722
- const X = y.textures;
35723
- for (let ee = 0; ee < X.length; ee++) {
35724
- const j = X[ee], Pe = r.convert(j.format, j.colorSpace), he = r.convert(j.type), we = C(j.internalFormat, Pe, he, j.colorSpace);
35722
+ const $ = y.textures;
35723
+ for (let ee = 0; ee < $.length; ee++) {
35724
+ const j = $[ee], Pe = r.convert(j.format, j.colorSpace), he = r.convert(j.type), we = C(j.internalFormat, Pe, he, j.colorSpace);
35725
35725
  zt(y) ? o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, I(y), we, y.width, y.height) : L ? i.renderbufferStorageMultisample(i.RENDERBUFFER, I(y), we, y.width, y.height) : i.renderbufferStorage(i.RENDERBUFFER, we, y.width, y.height);
35726
35726
  }
35727
35727
  }
35728
35728
  i.bindRenderbuffer(i.RENDERBUFFER, null);
35729
35729
  }
35730
35730
  function Me(w, y, L) {
35731
- const X = y.isWebGLCubeRenderTarget === !0;
35731
+ const $ = y.isWebGLCubeRenderTarget === !0;
35732
35732
  if (t.bindFramebuffer(i.FRAMEBUFFER, w), !(y.depthTexture && y.depthTexture.isDepthTexture))
35733
35733
  throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
35734
35734
  const ee = n.get(y.depthTexture);
35735
- if (ee.__renderTarget = y, (!ee.__webglTexture || y.depthTexture.image.width !== y.width || y.depthTexture.image.height !== y.height) && (y.depthTexture.image.width = y.width, y.depthTexture.image.height = y.height, y.depthTexture.needsUpdate = !0), X) {
35735
+ if (ee.__renderTarget = y, (!ee.__webglTexture || y.depthTexture.image.width !== y.width || y.depthTexture.image.height !== y.height) && (y.depthTexture.image.width = y.width, y.depthTexture.image.height = y.height, y.depthTexture.needsUpdate = !0), $) {
35736
35736
  if (ee.__webglInit === void 0 && (ee.__webglInit = !0, y.depthTexture.addEventListener("dispose", M)), ee.__webglTexture === void 0) {
35737
35737
  ee.__webglTexture = i.createTexture(), t.bindTexture(i.TEXTURE_CUBE_MAP, ee.__webglTexture), Be(i.TEXTURE_CUBE_MAP, y.depthTexture);
35738
35738
  const Ue = r.convert(y.depthTexture.format), re = r.convert(y.depthTexture.type);
@@ -35743,7 +35743,7 @@ function ME(i, e, t, n, s, r, a) {
35743
35743
  }
35744
35744
  } else
35745
35745
  K(y.depthTexture, 0);
35746
- const j = ee.__webglTexture, Pe = I(y), he = X ? i.TEXTURE_CUBE_MAP_POSITIVE_X + L : i.TEXTURE_2D, we = y.depthTexture.format === ys ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
35746
+ const j = ee.__webglTexture, Pe = I(y), he = $ ? i.TEXTURE_CUBE_MAP_POSITIVE_X + L : i.TEXTURE_2D, we = y.depthTexture.format === ys ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
35747
35747
  if (y.depthTexture.format === Di)
35748
35748
  zt(y) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, we, he, j, 0, Pe) : i.framebufferTexture2D(i.FRAMEBUFFER, we, he, j, 0);
35749
35749
  else if (y.depthTexture.format === ys)
@@ -35754,35 +35754,35 @@ function ME(i, e, t, n, s, r, a) {
35754
35754
  function ct(w) {
35755
35755
  const y = n.get(w), L = w.isWebGLCubeRenderTarget === !0;
35756
35756
  if (y.__boundDepthTexture !== w.depthTexture) {
35757
- const X = w.depthTexture;
35758
- if (y.__depthDisposeCallback && y.__depthDisposeCallback(), X) {
35757
+ const $ = w.depthTexture;
35758
+ if (y.__depthDisposeCallback && y.__depthDisposeCallback(), $) {
35759
35759
  const ee = () => {
35760
- delete y.__boundDepthTexture, delete y.__depthDisposeCallback, X.removeEventListener("dispose", ee);
35760
+ delete y.__boundDepthTexture, delete y.__depthDisposeCallback, $.removeEventListener("dispose", ee);
35761
35761
  };
35762
- X.addEventListener("dispose", ee), y.__depthDisposeCallback = ee;
35762
+ $.addEventListener("dispose", ee), y.__depthDisposeCallback = ee;
35763
35763
  }
35764
- y.__boundDepthTexture = X;
35764
+ y.__boundDepthTexture = $;
35765
35765
  }
35766
35766
  if (w.depthTexture && !y.__autoAllocateDepthBuffer)
35767
35767
  if (L)
35768
- for (let X = 0; X < 6; X++)
35769
- Me(y.__webglFramebuffer[X], w, X);
35768
+ for (let $ = 0; $ < 6; $++)
35769
+ Me(y.__webglFramebuffer[$], w, $);
35770
35770
  else {
35771
- const X = w.texture.mipmaps;
35772
- X && X.length > 0 ? Me(y.__webglFramebuffer[0], w, 0) : Me(y.__webglFramebuffer, w, 0);
35771
+ const $ = w.texture.mipmaps;
35772
+ $ && $.length > 0 ? Me(y.__webglFramebuffer[0], w, 0) : Me(y.__webglFramebuffer, w, 0);
35773
35773
  }
35774
35774
  else if (L) {
35775
35775
  y.__webglDepthbuffer = [];
35776
- for (let X = 0; X < 6; X++)
35777
- if (t.bindFramebuffer(i.FRAMEBUFFER, y.__webglFramebuffer[X]), y.__webglDepthbuffer[X] === void 0)
35778
- y.__webglDepthbuffer[X] = i.createRenderbuffer(), ze(y.__webglDepthbuffer[X], w, !1);
35776
+ for (let $ = 0; $ < 6; $++)
35777
+ if (t.bindFramebuffer(i.FRAMEBUFFER, y.__webglFramebuffer[$]), y.__webglDepthbuffer[$] === void 0)
35778
+ y.__webglDepthbuffer[$] = i.createRenderbuffer(), ze(y.__webglDepthbuffer[$], w, !1);
35779
35779
  else {
35780
- const ee = w.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, j = y.__webglDepthbuffer[X];
35780
+ const ee = w.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, j = y.__webglDepthbuffer[$];
35781
35781
  i.bindRenderbuffer(i.RENDERBUFFER, j), i.framebufferRenderbuffer(i.FRAMEBUFFER, ee, i.RENDERBUFFER, j);
35782
35782
  }
35783
35783
  } else {
35784
- const X = w.texture.mipmaps;
35785
- if (X && X.length > 0 ? t.bindFramebuffer(i.FRAMEBUFFER, y.__webglFramebuffer[0]) : t.bindFramebuffer(i.FRAMEBUFFER, y.__webglFramebuffer), y.__webglDepthbuffer === void 0)
35784
+ const $ = w.texture.mipmaps;
35785
+ if ($ && $.length > 0 ? t.bindFramebuffer(i.FRAMEBUFFER, y.__webglFramebuffer[0]) : t.bindFramebuffer(i.FRAMEBUFFER, y.__webglFramebuffer), y.__webglDepthbuffer === void 0)
35786
35786
  y.__webglDepthbuffer = i.createRenderbuffer(), ze(y.__webglDepthbuffer, w, !1);
35787
35787
  else {
35788
35788
  const ee = w.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, j = y.__webglDepthbuffer;
@@ -35792,14 +35792,14 @@ function ME(i, e, t, n, s, r, a) {
35792
35792
  t.bindFramebuffer(i.FRAMEBUFFER, null);
35793
35793
  }
35794
35794
  function Xt(w, y, L) {
35795
- const X = n.get(w);
35796
- y !== void 0 && Te(X.__webglFramebuffer, w, w.texture, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, 0), L !== void 0 && ct(w);
35795
+ const $ = n.get(w);
35796
+ y !== void 0 && Te($.__webglFramebuffer, w, w.texture, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, 0), L !== void 0 && ct(w);
35797
35797
  }
35798
35798
  function at(w) {
35799
- const y = w.texture, L = n.get(w), X = n.get(y);
35799
+ const y = w.texture, L = n.get(w), $ = n.get(y);
35800
35800
  w.addEventListener("dispose", A);
35801
35801
  const ee = w.textures, j = w.isWebGLCubeRenderTarget === !0, Pe = ee.length > 1;
35802
- if (Pe || (X.__webglTexture === void 0 && (X.__webglTexture = i.createTexture()), X.__version = y.version, a.memory.textures++), j) {
35802
+ if (Pe || ($.__webglTexture === void 0 && ($.__webglTexture = i.createTexture()), $.__version = y.version, a.memory.textures++), j) {
35803
35803
  L.__webglFramebuffer = [];
35804
35804
  for (let he = 0; he < 6; he++)
35805
35805
  if (y.mipmaps && y.mipmaps.length > 0) {
@@ -35832,7 +35832,7 @@ function ME(i, e, t, n, s, r, a) {
35832
35832
  }
35833
35833
  }
35834
35834
  if (j) {
35835
- t.bindTexture(i.TEXTURE_CUBE_MAP, X.__webglTexture), Be(i.TEXTURE_CUBE_MAP, y);
35835
+ t.bindTexture(i.TEXTURE_CUBE_MAP, $.__webglTexture), Be(i.TEXTURE_CUBE_MAP, y);
35836
35836
  for (let he = 0; he < 6; he++)
35837
35837
  if (y.mipmaps && y.mipmaps.length > 0)
35838
35838
  for (let we = 0; we < y.mipmaps.length; we++)
@@ -35849,7 +35849,7 @@ function ME(i, e, t, n, s, r, a) {
35849
35849
  t.unbindTexture();
35850
35850
  } else {
35851
35851
  let he = i.TEXTURE_2D;
35852
- if ((w.isWebGL3DRenderTarget || w.isWebGLArrayRenderTarget) && (he = w.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), t.bindTexture(he, X.__webglTexture), Be(he, y), y.mipmaps && y.mipmaps.length > 0)
35852
+ if ((w.isWebGL3DRenderTarget || w.isWebGLArrayRenderTarget) && (he = w.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), t.bindTexture(he, $.__webglTexture), Be(he, y), y.mipmaps && y.mipmaps.length > 0)
35853
35853
  for (let we = 0; we < y.mipmaps.length; we++)
35854
35854
  Te(L.__webglFramebuffer[we], w, y, i.COLOR_ATTACHMENT0, he, we);
35855
35855
  else
@@ -35860,7 +35860,7 @@ function ME(i, e, t, n, s, r, a) {
35860
35860
  }
35861
35861
  function pt(w) {
35862
35862
  const y = w.textures;
35863
- for (let L = 0, X = y.length; L < X; L++) {
35863
+ for (let L = 0, $ = y.length; L < $; L++) {
35864
35864
  const ee = y[L];
35865
35865
  if (m(ee)) {
35866
35866
  const j = x(w), Pe = n.get(ee).__webglTexture;
@@ -35868,11 +35868,11 @@ function ME(i, e, t, n, s, r, a) {
35868
35868
  }
35869
35869
  }
35870
35870
  }
35871
- const xt = [], We = [];
35871
+ const xt = [], He = [];
35872
35872
  function Bt(w) {
35873
35873
  if (w.samples > 0) {
35874
35874
  if (zt(w) === !1) {
35875
- const y = w.textures, L = w.width, X = w.height;
35875
+ const y = w.textures, L = w.width, $ = w.height;
35876
35876
  let ee = i.COLOR_BUFFER_BIT;
35877
35877
  const j = w.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, Pe = n.get(w), he = y.length > 1;
35878
35878
  if (he)
@@ -35887,7 +35887,7 @@ function ME(i, e, t, n, s, r, a) {
35887
35887
  const re = n.get(y[Ue]).__webglTexture;
35888
35888
  i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, re, 0);
35889
35889
  }
35890
- i.blitFramebuffer(0, 0, L, X, 0, 0, L, X, ee, i.NEAREST), c === !0 && (xt.length = 0, We.length = 0, xt.push(i.COLOR_ATTACHMENT0 + Ue), w.depthBuffer && w.resolveDepthBuffer === !1 && (xt.push(j), We.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, We)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, xt));
35890
+ i.blitFramebuffer(0, 0, L, $, 0, 0, L, $, ee, i.NEAREST), c === !0 && (xt.length = 0, He.length = 0, xt.push(i.COLOR_ATTACHMENT0 + Ue), w.depthBuffer && w.resolveDepthBuffer === !1 && (xt.push(j), He.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, He)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, xt));
35891
35891
  }
35892
35892
  if (t.bindFramebuffer(i.READ_FRAMEBUFFER, null), t.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), he)
35893
35893
  for (let Ue = 0; Ue < y.length; Ue++) {
@@ -35914,8 +35914,8 @@ function ME(i, e, t, n, s, r, a) {
35914
35914
  d.get(w) !== y && (d.set(w, y), w.update());
35915
35915
  }
35916
35916
  function Mt(w, y) {
35917
- const L = w.colorSpace, X = w.format, ee = w.type;
35918
- return w.isCompressedTexture === !0 || w.isVideoTexture === !0 || L !== fr && L !== Xi && (ot.getTransfer(L) === vt ? (X !== qn || ee !== In) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : dt("WebGLTextures: Unsupported texture color space:", L)), y;
35917
+ const L = w.colorSpace, $ = w.format, ee = w.type;
35918
+ return w.isCompressedTexture === !0 || w.isVideoTexture === !0 || L !== fr && L !== Xi && (ot.getTransfer(L) === vt ? ($ !== qn || ee !== In) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : dt("WebGLTextures: Unsupported texture color space:", L)), y;
35919
35919
  }
35920
35920
  function Ae(w) {
35921
35921
  return typeof HTMLImageElement < "u" && w instanceof HTMLImageElement ? (l.width = w.naturalWidth || w.width, l.height = w.naturalHeight || w.height) : typeof VideoFrame < "u" && w instanceof VideoFrame ? (l.width = w.displayWidth, l.height = w.displayHeight) : (l.width = w.width, l.height = w.height), l;
@@ -36245,12 +36245,12 @@ class kE extends mr {
36245
36245
  const te = new B(), ve = new B();
36246
36246
  function de(Y, ie, Te) {
36247
36247
  te.setFromMatrixPosition(ie.matrixWorld), ve.setFromMatrixPosition(Te.matrixWorld);
36248
- const ze = te.distanceTo(ve), Me = ie.projectionMatrix.elements, ct = Te.projectionMatrix.elements, Xt = Me[14] / (Me[10] - 1), at = Me[14] / (Me[10] + 1), pt = (Me[9] + 1) / Me[5], xt = (Me[9] - 1) / Me[5], We = (Me[8] - 1) / Me[0], Bt = (ct[8] + 1) / ct[0], I = Xt * We, zt = Xt * Bt, ft = ze / (-We + Bt), Mt = ft * -We;
36248
+ const ze = te.distanceTo(ve), Me = ie.projectionMatrix.elements, ct = Te.projectionMatrix.elements, Xt = Me[14] / (Me[10] - 1), at = Me[14] / (Me[10] + 1), pt = (Me[9] + 1) / Me[5], xt = (Me[9] - 1) / Me[5], He = (Me[8] - 1) / Me[0], Bt = (ct[8] + 1) / ct[0], I = Xt * He, zt = Xt * Bt, ft = ze / (-He + Bt), Mt = ft * -He;
36249
36249
  if (ie.matrixWorld.decompose(Y.position, Y.quaternion, Y.scale), Y.translateX(Mt), Y.translateZ(ft), Y.matrixWorld.compose(Y.position, Y.quaternion, Y.scale), Y.matrixWorldInverse.copy(Y.matrixWorld).invert(), Me[10] === -1)
36250
36250
  Y.projectionMatrix.copy(ie.projectionMatrix), Y.projectionMatrixInverse.copy(ie.projectionMatrixInverse);
36251
36251
  else {
36252
- const Ae = Xt + ft, w = at + ft, y = I - Mt, L = zt + (ze - Mt), X = pt * at / w * Ae, ee = xt * at / w * Ae;
36253
- Y.projectionMatrix.makePerspective(y, L, X, ee, Ae, w), Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert();
36252
+ const Ae = Xt + ft, w = at + ft, y = I - Mt, L = zt + (ze - Mt), $ = pt * at / w * Ae, ee = xt * at / w * Ae;
36253
+ Y.projectionMatrix.makePerspective(y, L, $, ee, Ae, w), Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert();
36254
36254
  }
36255
36255
  }
36256
36256
  function ye(Y, ie) {
@@ -36306,8 +36306,8 @@ class kE extends mr {
36306
36306
  Bt.depthStencilTexture
36307
36307
  ), e.setRenderTarget(b));
36308
36308
  }
36309
- let We = R[at];
36310
- We === void 0 && (We = new kn(), We.layers.enable(at), We.viewport = new Ft(), R[at] = We), We.matrix.fromArray(pt.transform.matrix), We.matrix.decompose(We.position, We.quaternion, We.scale), We.projectionMatrix.fromArray(pt.projectionMatrix), We.projectionMatrixInverse.copy(We.projectionMatrix).invert(), We.viewport.set(xt.x, xt.y, xt.width, xt.height), at === 0 && (N.matrix.copy(We.matrix), N.matrix.decompose(N.position, N.quaternion, N.scale)), ze === !0 && N.cameras.push(We);
36309
+ let He = R[at];
36310
+ He === void 0 && (He = new kn(), He.layers.enable(at), He.viewport = new Ft(), R[at] = He), He.matrix.fromArray(pt.transform.matrix), He.matrix.decompose(He.position, He.quaternion, He.scale), He.projectionMatrix.fromArray(pt.projectionMatrix), He.projectionMatrixInverse.copy(He.projectionMatrix).invert(), He.viewport.set(xt.x, xt.y, xt.width, xt.height), at === 0 && (N.matrix.copy(He.matrix), N.matrix.decompose(N.position, N.quaternion, N.scale)), ze === !0 && N.cameras.push(He);
36311
36311
  }
36312
36312
  const Me = s.enabledFeatures;
36313
36313
  if (Me && Me.includes("depth-sensing") && s.depthUsage == "gpu-optimized" && v) {
@@ -36322,8 +36322,8 @@ class kE extends mr {
36322
36322
  if (pt) {
36323
36323
  let xt = p[pt];
36324
36324
  xt || (xt = new Hm(), p[pt] = xt);
36325
- const We = u.getCameraImage(pt);
36326
- xt.sourceTexture = We;
36325
+ const He = u.getCameraImage(pt);
36326
+ xt.sourceTexture = He;
36327
36327
  }
36328
36328
  }
36329
36329
  }
@@ -37084,7 +37084,7 @@ class OE {
37084
37084
  const ze = new Gm();
37085
37085
  let Me = !1, ct = !1;
37086
37086
  const Xt = new Wt(), at = new B(), pt = new Ft(), xt = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
37087
- let We = !1;
37087
+ let He = !1;
37088
37088
  function Bt() {
37089
37089
  return F === null ? Fe : 1;
37090
37090
  }
@@ -37111,9 +37111,9 @@ class OE {
37111
37111
  } catch (E) {
37112
37112
  throw dt("WebGLRenderer: " + E.message), E;
37113
37113
  }
37114
- let ft, Mt, Ae, w, y, L, X, ee, j, Pe, he, we, Ue, re, pe, Ee, Re, fe, qe, D, _e, oe, Se, se;
37114
+ let ft, Mt, Ae, w, y, L, $, ee, j, Pe, he, we, Ue, re, pe, Ee, Re, fe, We, D, _e, oe, Se, se;
37115
37115
  function J() {
37116
- ft = new NT(I), ft.init(), oe = new wE(I, ft), Mt = new wT(I, ft, e, oe), Ae = new EE(I, ft), Mt.reversedDepthBuffer && h && Ae.buffers.depth.setReversed(!0), w = new BT(I), y = new dE(), L = new ME(I, ft, Ae, y, Mt, oe, w), X = new RT(_), ee = new UT(_), j = new H_(I), Se = new ET(I, j), Pe = new OT(I, j, w, Se), he = new VT(I, Pe, j, w), qe = new zT(I, Mt, L), Ee = new AT(y), we = new lE(_, X, ee, ft, Mt, Se, Ee), Ue = new DE(_, y), re = new hE(), pe = new bE(ft), fe = new CT(_, X, ee, Ae, he, g, c), Re = new TE(_, he, Mt), se = new LE(I, w, Mt, Ae), D = new MT(I, ft, w), _e = new FT(I, ft, w), w.programs = we.programs, _.capabilities = Mt, _.extensions = ft, _.properties = y, _.renderLists = re, _.shadowMap = Re, _.state = Ae, _.info = w;
37116
+ ft = new NT(I), ft.init(), oe = new wE(I, ft), Mt = new wT(I, ft, e, oe), Ae = new EE(I, ft), Mt.reversedDepthBuffer && h && Ae.buffers.depth.setReversed(!0), w = new BT(I), y = new dE(), L = new ME(I, ft, Ae, y, Mt, oe, w), $ = new RT(_), ee = new UT(_), j = new H_(I), Se = new ET(I, j), Pe = new OT(I, j, w, Se), he = new VT(I, Pe, j, w), We = new zT(I, Mt, L), Ee = new AT(y), we = new lE(_, $, ee, ft, Mt, Se, Ee), Ue = new DE(_, y), re = new hE(), pe = new bE(ft), fe = new CT(_, $, ee, Ae, he, g, c), Re = new TE(_, he, Mt), se = new LE(I, w, Mt, Ae), D = new MT(I, ft, w), _e = new FT(I, ft, w), w.programs = we.programs, _.capabilities = Mt, _.extensions = ft, _.properties = y, _.renderLists = re, _.shadowMap = Re, _.state = Ae, _.info = w;
37117
37117
  }
37118
37118
  J(), v !== In && (k = new HT(v, t.width, t.height, s, r));
37119
37119
  const ue = new kE(_, I);
@@ -37204,7 +37204,7 @@ class OE {
37204
37204
  }, this.clearStencil = function() {
37205
37205
  this.clear(!1, !1, !0);
37206
37206
  }, this.dispose = function() {
37207
- t.removeEventListener("webglcontextlost", Ne, !1), t.removeEventListener("webglcontextrestored", wt, !1), t.removeEventListener("webglcontextcreationerror", mt, !1), fe.dispose(), re.dispose(), pe.dispose(), y.dispose(), X.dispose(), ee.dispose(), he.dispose(), Se.dispose(), se.dispose(), we.dispose(), ue.dispose(), ue.removeEventListener("sessionstart", au), ue.removeEventListener("sessionend", ou), is.stop();
37207
+ t.removeEventListener("webglcontextlost", Ne, !1), t.removeEventListener("webglcontextrestored", wt, !1), t.removeEventListener("webglcontextcreationerror", mt, !1), fe.dispose(), re.dispose(), pe.dispose(), y.dispose(), $.dispose(), ee.dispose(), he.dispose(), Se.dispose(), se.dispose(), we.dispose(), ue.dispose(), ue.removeEventListener("sessionstart", au), ue.removeEventListener("sessionend", ou), is.stop();
37208
37208
  };
37209
37209
  function Ne(E) {
37210
37210
  E.preventDefault(), Ih("WebGLRenderer: Context Lost."), T = !0;
@@ -37240,9 +37240,9 @@ class OE {
37240
37240
  ke = 2;
37241
37241
  }
37242
37242
  const Le = G.drawRange, Ie = G.attributes.position;
37243
- let Ke = Le.start * ke, yt = (Le.start + Le.count) * ke;
37244
- me !== null && (Ke = Math.max(Ke, me.start * ke), yt = Math.min(yt, (me.start + me.count) * ke)), Ce !== null ? (Ke = Math.max(Ke, 0), yt = Math.min(yt, Ce.count)) : Ie != null && (Ke = Math.max(Ke, 0), yt = Math.min(yt, Ie.count));
37245
- const It = yt - Ke;
37243
+ let $e = Le.start * ke, yt = (Le.start + Le.count) * ke;
37244
+ me !== null && ($e = Math.max($e, me.start * ke), yt = Math.min(yt, (me.start + me.count) * ke)), Ce !== null ? ($e = Math.max($e, 0), yt = Math.min(yt, Ce.count)) : Ie != null && ($e = Math.max($e, 0), yt = Math.min(yt, Ie.count));
37245
+ const It = yt - $e;
37246
37246
  if (It < 0 || It === 1 / 0) return;
37247
37247
  Se.setup(O, z, be, G, Ce);
37248
37248
  let Dt, Tt = D;
@@ -37258,17 +37258,17 @@ class OE {
37258
37258
  else if (ft.get("WEBGL_multi_draw"))
37259
37259
  Tt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37260
37260
  else {
37261
- const De = O._multiDrawStarts, gt = O._multiDrawCounts, lt = O._multiDrawCount, bn = Ce ? j.get(Ce).bytesPerElement : 1, Rs = y.get(z).currentProgram.getUniforms();
37262
- for (let yn = 0; yn < lt; yn++)
37263
- Rs.setValue(I, "_gl_DrawID", yn), Tt.render(De[yn] / bn, gt[yn]);
37261
+ const De = O._multiDrawStarts, gt = O._multiDrawCounts, lt = O._multiDrawCount, _n = Ce ? j.get(Ce).bytesPerElement : 1, Rs = y.get(z).currentProgram.getUniforms();
37262
+ for (let Sn = 0; Sn < lt; Sn++)
37263
+ Rs.setValue(I, "_gl_DrawID", Sn), Tt.render(De[Sn] / _n, gt[Sn]);
37264
37264
  }
37265
37265
  else if (O.isInstancedMesh)
37266
- Tt.renderInstances(Ke, It, O.count);
37266
+ Tt.renderInstances($e, It, O.count);
37267
37267
  else if (G.isInstancedBufferGeometry) {
37268
37268
  const De = G._maxInstanceCount !== void 0 ? G._maxInstanceCount : 1 / 0, gt = Math.min(G.instanceCount, De);
37269
- Tt.renderInstances(Ke, It, gt);
37269
+ Tt.renderInstances($e, It, gt);
37270
37270
  } else
37271
- Tt.render(Ke, It);
37271
+ Tt.render($e, It);
37272
37272
  };
37273
37273
  function ru(E, U, G) {
37274
37274
  E.transparent === !0 && E.side === Ei && E.forceSinglePass === !1 ? (E.side = an, E.needsUpdate = !0, ha(E, U, G), E.side = ki, E.needsUpdate = !0, ha(E, U, G), E.side = Ei) : ha(E, U, G);
@@ -37332,7 +37332,7 @@ class OE {
37332
37332
  const xe = _.xr.getDepthSensingMesh();
37333
37333
  xe !== null && Ho(xe, U, -1 / 0, _.sortObjects);
37334
37334
  }
37335
- Ho(E, U, 0, _.sortObjects), b.finish(), _.sortObjects === !0 && b.sort(Rt, bt), We = ue.enabled === !1 || ue.isPresenting === !1 || ue.hasDepthSensing() === !1, We && fe.addToRenderList(b, E), this.info.render.frame++, Me === !0 && Ee.beginShadows();
37335
+ Ho(E, U, 0, _.sortObjects), b.finish(), _.sortObjects === !0 && b.sort(Rt, bt), He = ue.enabled === !1 || ue.isPresenting === !1 || ue.hasDepthSensing() === !1, He && fe.addToRenderList(b, E), this.info.render.frame++, Me === !0 && Ee.beginShadows();
37336
37336
  const O = S.state.shadowsArray;
37337
37337
  if (Re.render(O, E, U), Me === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset(), (z && k.hasRenderPass()) === !1) {
37338
37338
  const xe = b.opaque, be = b.transmissive;
@@ -37343,13 +37343,13 @@ class OE {
37343
37343
  const Ie = Ce[ke];
37344
37344
  lu(xe, be, E, Ie);
37345
37345
  }
37346
- We && fe.render(E);
37346
+ He && fe.render(E);
37347
37347
  for (let ke = 0, Le = Ce.length; ke < Le; ke++) {
37348
37348
  const Ie = Ce[ke];
37349
37349
  cu(b, E, Ie, Ie.viewport);
37350
37350
  }
37351
37351
  } else
37352
- be.length > 0 && lu(xe, be, E, U), We && fe.render(E), cu(b, E, U);
37352
+ be.length > 0 && lu(xe, be, E, U), He && fe.render(E), cu(b, E, U);
37353
37353
  }
37354
37354
  F !== null && N === 0 && (L.updateMultisampleRenderTarget(F), L.updateRenderTargetMipmap(F)), z && k.end(_), E.isScene === !0 && E.onAfterRender(_, E, U), Se.resetDefaultState(), q = -1, K = null, A.pop(), A.length > 0 ? (S = A[A.length - 1], Me === !0 && Ee.setGlobalState(_.clippingPlanes, S.state.camera)) : S = null, M.pop(), M.length > 0 ? b = M[M.length - 1] : b = null;
37355
37355
  };
@@ -37373,8 +37373,8 @@ class OE {
37373
37373
  if (z && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), pt.copy(E.boundingSphere.center)) : (xe.boundingSphere === null && xe.computeBoundingSphere(), pt.copy(xe.boundingSphere.center)), pt.applyMatrix4(E.matrixWorld).applyMatrix4(Xt)), Array.isArray(be)) {
37374
37374
  const Ce = xe.groups;
37375
37375
  for (let ke = 0, Le = Ce.length; ke < Le; ke++) {
37376
- const Ie = Ce[ke], Ke = be[Ie.materialIndex];
37377
- Ke && Ke.visible && b.push(E, xe, Ke, G, pt.z, Ie);
37376
+ const Ie = Ce[ke], $e = be[Ie.materialIndex];
37377
+ $e && $e.visible && b.push(E, xe, $e, G, pt.z, Ie);
37378
37378
  }
37379
37379
  } else be.visible && b.push(E, xe, be, G, pt.z, null);
37380
37380
  }
@@ -37391,10 +37391,10 @@ class OE {
37391
37391
  if ((G.isScene === !0 ? G.overrideMaterial : null) !== null)
37392
37392
  return;
37393
37393
  if (S.state.transmissionRenderTarget[z.id] === void 0) {
37394
- const Ke = ft.has("EXT_color_buffer_half_float") || ft.has("EXT_color_buffer_float");
37394
+ const $e = ft.has("EXT_color_buffer_half_float") || ft.has("EXT_color_buffer_float");
37395
37395
  S.state.transmissionRenderTarget[z.id] = new oi(1, 1, {
37396
37396
  generateMipmaps: !0,
37397
- type: Ke ? Ii : In,
37397
+ type: $e ? Ii : In,
37398
37398
  minFilter: bs,
37399
37399
  samples: Mt.samples,
37400
37400
  stencilBuffer: r,
@@ -37406,20 +37406,20 @@ class OE {
37406
37406
  const me = S.state.transmissionRenderTarget[z.id], xe = z.viewport || H;
37407
37407
  me.setSize(xe.z * _.transmissionResolutionScale, xe.w * _.transmissionResolutionScale);
37408
37408
  const be = _.getRenderTarget(), Ce = _.getActiveCubeFace(), ke = _.getActiveMipmapLevel();
37409
- _.setRenderTarget(me), _.getClearColor(ve), de = _.getClearAlpha(), de < 1 && _.setClearColor(16777215, 0.5), _.clear(), We && fe.render(G);
37409
+ _.setRenderTarget(me), _.getClearColor(ve), de = _.getClearAlpha(), de < 1 && _.setClearColor(16777215, 0.5), _.clear(), He && fe.render(G);
37410
37410
  const Le = _.toneMapping;
37411
37411
  _.toneMapping = ai;
37412
37412
  const Ie = z.viewport;
37413
37413
  if (z.viewport !== void 0 && (z.viewport = void 0), S.setupLightsView(z), Me === !0 && Ee.setGlobalState(_.clippingPlanes, z), ua(E, G, z), L.updateMultisampleRenderTarget(me), L.updateRenderTargetMipmap(me), ft.has("WEBGL_multisampled_render_to_texture") === !1) {
37414
- let Ke = !1;
37414
+ let $e = !1;
37415
37415
  for (let yt = 0, It = U.length; yt < It; yt++) {
37416
37416
  const Dt = U[yt], { object: Tt, geometry: De, material: gt, group: lt } = Dt;
37417
37417
  if (gt.side === Ei && Tt.layers.test(z.layers)) {
37418
- const bn = gt.side;
37419
- gt.side = an, gt.needsUpdate = !0, du(Tt, G, z, De, gt, lt), gt.side = bn, gt.needsUpdate = !0, Ke = !0;
37418
+ const _n = gt.side;
37419
+ gt.side = an, gt.needsUpdate = !0, du(Tt, G, z, De, gt, lt), gt.side = _n, gt.needsUpdate = !0, $e = !0;
37420
37420
  }
37421
37421
  }
37422
- Ke === !0 && (L.updateMultisampleRenderTarget(me), L.updateRenderTargetMipmap(me));
37422
+ $e === !0 && (L.updateMultisampleRenderTarget(me), L.updateRenderTargetMipmap(me));
37423
37423
  }
37424
37424
  _.setRenderTarget(be, Ce, ke), _.setClearColor(ve, de), Ie !== void 0 && (z.viewport = Ie), _.toneMapping = Le;
37425
37425
  }
@@ -37438,7 +37438,7 @@ class OE {
37438
37438
  U.isScene !== !0 && (U = xt);
37439
37439
  const z = y.get(E), O = S.state.lights, me = S.state.shadowsArray, xe = O.state.version, be = we.getParameters(E, O.state, me, U, G), Ce = we.getProgramCacheKey(be);
37440
37440
  let ke = z.programs;
37441
- z.environment = E.isMeshStandardMaterial ? U.environment : null, z.fog = U.fog, z.envMap = (E.isMeshStandardMaterial ? ee : X).get(E.envMap || z.environment), z.envMapRotation = z.environment !== null && E.envMap === null ? U.environmentRotation : E.envMapRotation, ke === void 0 && (E.addEventListener("dispose", Yn), ke = /* @__PURE__ */ new Map(), z.programs = ke);
37441
+ z.environment = E.isMeshStandardMaterial ? U.environment : null, z.fog = U.fog, z.envMap = (E.isMeshStandardMaterial ? ee : $).get(E.envMap || z.environment), z.envMapRotation = z.environment !== null && E.envMap === null ? U.environmentRotation : E.envMapRotation, ke === void 0 && (E.addEventListener("dispose", Yn), ke = /* @__PURE__ */ new Map(), z.programs = ke);
37442
37442
  let Le = ke.get(Ce);
37443
37443
  if (Le !== void 0) {
37444
37444
  if (z.currentProgram === Le && z.lightsStateVersion === xe)
@@ -37461,7 +37461,7 @@ class OE {
37461
37461
  }
37462
37462
  function Qm(E, U, G, z, O) {
37463
37463
  U.isScene !== !0 && (U = xt), L.resetTextureUnits();
37464
- const me = U.fog, xe = z.isMeshStandardMaterial ? U.environment : null, be = F === null ? _.outputColorSpace : F.isXRRenderTarget === !0 ? F.texture.colorSpace : fr, Ce = (z.isMeshStandardMaterial ? ee : X).get(z.envMap || xe), ke = z.vertexColors === !0 && !!G.attributes.color && G.attributes.color.itemSize === 4, Le = !!G.attributes.tangent && (!!z.normalMap || z.anisotropy > 0), Ie = !!G.morphAttributes.position, Ke = !!G.morphAttributes.normal, yt = !!G.morphAttributes.color;
37464
+ const me = U.fog, xe = z.isMeshStandardMaterial ? U.environment : null, be = F === null ? _.outputColorSpace : F.isXRRenderTarget === !0 ? F.texture.colorSpace : fr, Ce = (z.isMeshStandardMaterial ? ee : $).get(z.envMap || xe), ke = z.vertexColors === !0 && !!G.attributes.color && G.attributes.color.itemSize === 4, Le = !!G.attributes.tangent && (!!z.normalMap || z.anisotropy > 0), Ie = !!G.morphAttributes.position, $e = !!G.morphAttributes.normal, yt = !!G.morphAttributes.color;
37465
37465
  let It = ai;
37466
37466
  z.toneMapped && (F === null || F.isXRRenderTarget === !0) && (It = _.toneMapping);
37467
37467
  const Dt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, Tt = Dt !== void 0 ? Dt.length : 0, De = y.get(z), gt = S.state.lights;
@@ -37470,19 +37470,19 @@ class OE {
37470
37470
  Ee.setState(z, E, sn);
37471
37471
  }
37472
37472
  let lt = !1;
37473
- z.version === De.__version ? (De.needsLights && De.lightsStateVersion !== gt.state.version || De.outputColorSpace !== be || O.isBatchedMesh && De.batching === !1 || !O.isBatchedMesh && De.batching === !0 || O.isBatchedMesh && De.batchingColor === !0 && O.colorTexture === null || O.isBatchedMesh && De.batchingColor === !1 && O.colorTexture !== null || O.isInstancedMesh && De.instancing === !1 || !O.isInstancedMesh && De.instancing === !0 || O.isSkinnedMesh && De.skinning === !1 || !O.isSkinnedMesh && De.skinning === !0 || O.isInstancedMesh && De.instancingColor === !0 && O.instanceColor === null || O.isInstancedMesh && De.instancingColor === !1 && O.instanceColor !== null || O.isInstancedMesh && De.instancingMorph === !0 && O.morphTexture === null || O.isInstancedMesh && De.instancingMorph === !1 && O.morphTexture !== null || De.envMap !== Ce || z.fog === !0 && De.fog !== me || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ee.numPlanes || De.numIntersection !== Ee.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== Ke || De.morphColors !== yt || De.toneMapping !== It || De.morphTargetsCount !== Tt) && (lt = !0) : (lt = !0, De.__version = z.version);
37474
- let bn = De.currentProgram;
37475
- lt === !0 && (bn = ha(z, U, O));
37476
- let Rs = !1, yn = !1, vr = !1;
37477
- const At = bn.getUniforms(), ln = De.uniforms;
37478
- if (Ae.useProgram(bn.program) && (Rs = !0, yn = !0, vr = !0), z.id !== q && (q = z.id, yn = !0), Rs || K !== E) {
37473
+ z.version === De.__version ? (De.needsLights && De.lightsStateVersion !== gt.state.version || De.outputColorSpace !== be || O.isBatchedMesh && De.batching === !1 || !O.isBatchedMesh && De.batching === !0 || O.isBatchedMesh && De.batchingColor === !0 && O.colorTexture === null || O.isBatchedMesh && De.batchingColor === !1 && O.colorTexture !== null || O.isInstancedMesh && De.instancing === !1 || !O.isInstancedMesh && De.instancing === !0 || O.isSkinnedMesh && De.skinning === !1 || !O.isSkinnedMesh && De.skinning === !0 || O.isInstancedMesh && De.instancingColor === !0 && O.instanceColor === null || O.isInstancedMesh && De.instancingColor === !1 && O.instanceColor !== null || O.isInstancedMesh && De.instancingMorph === !0 && O.morphTexture === null || O.isInstancedMesh && De.instancingMorph === !1 && O.morphTexture !== null || De.envMap !== Ce || z.fog === !0 && De.fog !== me || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ee.numPlanes || De.numIntersection !== Ee.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== $e || De.morphColors !== yt || De.toneMapping !== It || De.morphTargetsCount !== Tt) && (lt = !0) : (lt = !0, De.__version = z.version);
37474
+ let _n = De.currentProgram;
37475
+ lt === !0 && (_n = ha(z, U, O));
37476
+ let Rs = !1, Sn = !1, vr = !1;
37477
+ const At = _n.getUniforms(), ln = De.uniforms;
37478
+ if (Ae.useProgram(_n.program) && (Rs = !0, Sn = !0, vr = !0), z.id !== q && (q = z.id, Sn = !0), Rs || K !== E) {
37479
37479
  Ae.buffers.depth.getReversed() && E.reversedDepth !== !0 && (E._reversedDepth = !0, E.updateProjectionMatrix()), At.setValue(I, "projectionMatrix", E.projectionMatrix), At.setValue(I, "viewMatrix", E.matrixWorldInverse);
37480
37480
  const dn = At.map.cameraPosition;
37481
37481
  dn !== void 0 && dn.setValue(I, at.setFromMatrixPosition(E.matrixWorld)), Mt.logarithmicDepthBuffer && At.setValue(
37482
37482
  I,
37483
37483
  "logDepthBufFC",
37484
37484
  2 / (Math.log(E.far + 1) / Math.LN2)
37485
- ), (z.isMeshPhongMaterial || z.isMeshToonMaterial || z.isMeshLambertMaterial || z.isMeshBasicMaterial || z.isMeshStandardMaterial || z.isShaderMaterial) && At.setValue(I, "isOrthographic", E.isOrthographicCamera === !0), K !== E && (K = E, yn = !0, vr = !0);
37485
+ ), (z.isMeshPhongMaterial || z.isMeshToonMaterial || z.isMeshLambertMaterial || z.isMeshBasicMaterial || z.isMeshStandardMaterial || z.isShaderMaterial) && At.setValue(I, "isOrthographic", E.isOrthographicCamera === !0), K !== E && (K = E, Sn = !0, vr = !0);
37486
37486
  }
37487
37487
  if (De.needsLights && (gt.state.directionalShadowMap.length > 0 && At.setValue(I, "directionalShadowMap", gt.state.directionalShadowMap, L), gt.state.spotShadowMap.length > 0 && At.setValue(I, "spotShadowMap", gt.state.spotShadowMap, L), gt.state.pointShadowMap.length > 0 && At.setValue(I, "pointShadowMap", gt.state.pointShadowMap, L)), O.isSkinnedMesh) {
37488
37488
  At.setOptional(I, O, "bindMatrix"), At.setOptional(I, O, "bindMatrixInverse");
@@ -37491,14 +37491,14 @@ class OE {
37491
37491
  }
37492
37492
  O.isBatchedMesh && (At.setOptional(I, O, "batchingTexture"), At.setValue(I, "batchingTexture", O._matricesTexture, L), At.setOptional(I, O, "batchingIdTexture"), At.setValue(I, "batchingIdTexture", O._indirectTexture, L), At.setOptional(I, O, "batchingColorTexture"), O._colorsTexture !== null && At.setValue(I, "batchingColorTexture", O._colorsTexture, L));
37493
37493
  const An = G.morphAttributes;
37494
- if ((An.position !== void 0 || An.normal !== void 0 || An.color !== void 0) && qe.update(O, G, bn), (yn || De.receiveShadow !== O.receiveShadow) && (De.receiveShadow = O.receiveShadow, At.setValue(I, "receiveShadow", O.receiveShadow)), z.isMeshGouraudMaterial && z.envMap !== null && (ln.envMap.value = Ce, ln.flipEnvMap.value = Ce.isCubeTexture && Ce.isRenderTargetTexture === !1 ? -1 : 1), z.isMeshStandardMaterial && z.envMap === null && U.environment !== null && (ln.envMapIntensity.value = U.environmentIntensity), ln.dfgLUT !== void 0 && (ln.dfgLUT.value = NE()), yn && (At.setValue(I, "toneMappingExposure", _.toneMappingExposure), De.needsLights && eg(ln, vr), me && z.fog === !0 && Ue.refreshFogUniforms(ln, me), Ue.refreshMaterialUniforms(ln, z, Fe, Be, S.state.transmissionRenderTarget[E.id]), to.upload(I, uu(De), ln, L)), z.isShaderMaterial && z.uniformsNeedUpdate === !0 && (to.upload(I, uu(De), ln, L), z.uniformsNeedUpdate = !1), z.isSpriteMaterial && At.setValue(I, "center", O.center), At.setValue(I, "modelViewMatrix", O.modelViewMatrix), At.setValue(I, "normalMatrix", O.normalMatrix), At.setValue(I, "modelMatrix", O.matrixWorld), z.isShaderMaterial || z.isRawShaderMaterial) {
37494
+ if ((An.position !== void 0 || An.normal !== void 0 || An.color !== void 0) && We.update(O, G, _n), (Sn || De.receiveShadow !== O.receiveShadow) && (De.receiveShadow = O.receiveShadow, At.setValue(I, "receiveShadow", O.receiveShadow)), z.isMeshGouraudMaterial && z.envMap !== null && (ln.envMap.value = Ce, ln.flipEnvMap.value = Ce.isCubeTexture && Ce.isRenderTargetTexture === !1 ? -1 : 1), z.isMeshStandardMaterial && z.envMap === null && U.environment !== null && (ln.envMapIntensity.value = U.environmentIntensity), ln.dfgLUT !== void 0 && (ln.dfgLUT.value = NE()), Sn && (At.setValue(I, "toneMappingExposure", _.toneMappingExposure), De.needsLights && eg(ln, vr), me && z.fog === !0 && Ue.refreshFogUniforms(ln, me), Ue.refreshMaterialUniforms(ln, z, Fe, Be, S.state.transmissionRenderTarget[E.id]), to.upload(I, uu(De), ln, L)), z.isShaderMaterial && z.uniformsNeedUpdate === !0 && (to.upload(I, uu(De), ln, L), z.uniformsNeedUpdate = !1), z.isSpriteMaterial && At.setValue(I, "center", O.center), At.setValue(I, "modelViewMatrix", O.modelViewMatrix), At.setValue(I, "normalMatrix", O.normalMatrix), At.setValue(I, "modelMatrix", O.matrixWorld), z.isShaderMaterial || z.isRawShaderMaterial) {
37495
37495
  const sn = z.uniformsGroups;
37496
37496
  for (let dn = 0, Wo = sn.length; dn < Wo; dn++) {
37497
37497
  const ss = sn[dn];
37498
- se.update(ss, bn), se.bind(ss, bn);
37498
+ se.update(ss, _n), se.bind(ss, _n);
37499
37499
  }
37500
37500
  }
37501
- return bn;
37501
+ return _n;
37502
37502
  }
37503
37503
  function eg(E, U) {
37504
37504
  E.ambientLightColor.needsUpdate = U, E.lightProbe.needsUpdate = U, E.directionalLights.needsUpdate = U, E.directionalLightShadows.needsUpdate = U, E.pointLights.needsUpdate = U, E.pointLightShadows.needsUpdate = U, E.spotLights.needsUpdate = U, E.spotLightShadows.needsUpdate = U, E.rectAreaLights.needsUpdate = U, E.hemisphereLights.needsUpdate = U;
@@ -37596,12 +37596,12 @@ class OE {
37596
37596
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
37597
37597
  if (!Mt.textureTypeReadable(Ie))
37598
37598
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
37599
- const Ke = I.createBuffer();
37600
- I.bindBuffer(I.PIXEL_PACK_BUFFER, Ke), I.bufferData(I.PIXEL_PACK_BUFFER, me.byteLength, I.STREAM_READ), E.textures.length > 1 && I.readBuffer(I.COLOR_ATTACHMENT0 + be), I.readPixels(U, G, z, O, oe.convert(Le), oe.convert(Ie), 0);
37599
+ const $e = I.createBuffer();
37600
+ I.bindBuffer(I.PIXEL_PACK_BUFFER, $e), I.bufferData(I.PIXEL_PACK_BUFFER, me.byteLength, I.STREAM_READ), E.textures.length > 1 && I.readBuffer(I.COLOR_ATTACHMENT0 + be), I.readPixels(U, G, z, O, oe.convert(Le), oe.convert(Ie), 0);
37601
37601
  const yt = F !== null ? y.get(F).__webglFramebuffer : null;
37602
37602
  Ae.bindFramebuffer(I.FRAMEBUFFER, yt);
37603
37603
  const It = I.fenceSync(I.SYNC_GPU_COMMANDS_COMPLETE, 0);
37604
- return I.flush(), await r_(I, It, 4), I.bindBuffer(I.PIXEL_PACK_BUFFER, Ke), I.getBufferSubData(I.PIXEL_PACK_BUFFER, 0, me), I.deleteBuffer(Ke), I.deleteSync(It), me;
37604
+ return I.flush(), await r_(I, It, 4), I.bindBuffer(I.PIXEL_PACK_BUFFER, $e), I.getBufferSubData(I.PIXEL_PACK_BUFFER, 0, me), I.deleteBuffer($e), I.deleteSync(It), me;
37605
37605
  } else
37606
37606
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
37607
37607
  }, this.copyFramebufferToTexture = function(E, U = null, G = 0) {
@@ -37611,7 +37611,7 @@ class OE {
37611
37611
  const ig = I.createFramebuffer(), sg = I.createFramebuffer();
37612
37612
  this.copyTextureToTexture = function(E, U, G = null, z = null, O = 0, me = null) {
37613
37613
  me === null && (O !== 0 ? (Zr("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), me = O, O = 0) : me = 0);
37614
- let xe, be, Ce, ke, Le, Ie, Ke, yt, It;
37614
+ let xe, be, Ce, ke, Le, Ie, $e, yt, It;
37615
37615
  const Dt = E.isCompressedTexture ? E.mipmaps[me] : E.image;
37616
37616
  if (G !== null)
37617
37617
  xe = G.max.x - G.min.x, be = G.max.y - G.min.y, Ce = G.isBox3 ? G.max.z - G.min.z : 1, ke = G.min.x, Le = G.min.y, Ie = G.isBox3 ? G.min.z : 0;
@@ -37619,28 +37619,28 @@ class OE {
37619
37619
  const An = Math.pow(2, -O);
37620
37620
  xe = Math.floor(Dt.width * An), be = Math.floor(Dt.height * An), E.isDataArrayTexture ? Ce = Dt.depth : E.isData3DTexture ? Ce = Math.floor(Dt.depth * An) : Ce = 1, ke = 0, Le = 0, Ie = 0;
37621
37621
  }
37622
- z !== null ? (Ke = z.x, yt = z.y, It = z.z) : (Ke = 0, yt = 0, It = 0);
37622
+ z !== null ? ($e = z.x, yt = z.y, It = z.z) : ($e = 0, yt = 0, It = 0);
37623
37623
  const Tt = oe.convert(U.format), De = oe.convert(U.type);
37624
37624
  let gt;
37625
37625
  U.isData3DTexture ? (L.setTexture3D(U, 0), gt = I.TEXTURE_3D) : U.isDataArrayTexture || U.isCompressedArrayTexture ? (L.setTexture2DArray(U, 0), gt = I.TEXTURE_2D_ARRAY) : (L.setTexture2D(U, 0), gt = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, U.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, U.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, U.unpackAlignment);
37626
- const lt = I.getParameter(I.UNPACK_ROW_LENGTH), bn = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Rs = I.getParameter(I.UNPACK_SKIP_PIXELS), yn = I.getParameter(I.UNPACK_SKIP_ROWS), vr = I.getParameter(I.UNPACK_SKIP_IMAGES);
37626
+ const lt = I.getParameter(I.UNPACK_ROW_LENGTH), _n = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Rs = I.getParameter(I.UNPACK_SKIP_PIXELS), Sn = I.getParameter(I.UNPACK_SKIP_ROWS), vr = I.getParameter(I.UNPACK_SKIP_IMAGES);
37627
37627
  I.pixelStorei(I.UNPACK_ROW_LENGTH, Dt.width), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Dt.height), I.pixelStorei(I.UNPACK_SKIP_PIXELS, ke), I.pixelStorei(I.UNPACK_SKIP_ROWS, Le), I.pixelStorei(I.UNPACK_SKIP_IMAGES, Ie);
37628
37628
  const At = E.isDataArrayTexture || E.isData3DTexture, ln = U.isDataArrayTexture || U.isData3DTexture;
37629
37629
  if (E.isDepthTexture) {
37630
37630
  const An = y.get(E), sn = y.get(U), dn = y.get(An.__renderTarget), Wo = y.get(sn.__renderTarget);
37631
37631
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, dn.__webglFramebuffer), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, Wo.__webglFramebuffer);
37632
37632
  for (let ss = 0; ss < Ce; ss++)
37633
- At && (I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, y.get(E).__webglTexture, O, Ie + ss), I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, y.get(U).__webglTexture, me, It + ss)), I.blitFramebuffer(ke, Le, xe, be, Ke, yt, xe, be, I.DEPTH_BUFFER_BIT, I.NEAREST);
37633
+ At && (I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, y.get(E).__webglTexture, O, Ie + ss), I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, y.get(U).__webglTexture, me, It + ss)), I.blitFramebuffer(ke, Le, xe, be, $e, yt, xe, be, I.DEPTH_BUFFER_BIT, I.NEAREST);
37634
37634
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, null), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, null);
37635
37635
  } else if (O !== 0 || E.isRenderTargetTexture || y.has(E)) {
37636
37636
  const An = y.get(E), sn = y.get(U);
37637
37637
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, ig), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, sg);
37638
37638
  for (let dn = 0; dn < Ce; dn++)
37639
- At ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, An.__webglTexture, O, Ie + dn) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, An.__webglTexture, O), ln ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, sn.__webglTexture, me, It + dn) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, sn.__webglTexture, me), O !== 0 ? I.blitFramebuffer(ke, Le, xe, be, Ke, yt, xe, be, I.COLOR_BUFFER_BIT, I.NEAREST) : ln ? I.copyTexSubImage3D(gt, me, Ke, yt, It + dn, ke, Le, xe, be) : I.copyTexSubImage2D(gt, me, Ke, yt, ke, Le, xe, be);
37639
+ At ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, An.__webglTexture, O, Ie + dn) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, An.__webglTexture, O), ln ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, sn.__webglTexture, me, It + dn) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, sn.__webglTexture, me), O !== 0 ? I.blitFramebuffer(ke, Le, xe, be, $e, yt, xe, be, I.COLOR_BUFFER_BIT, I.NEAREST) : ln ? I.copyTexSubImage3D(gt, me, $e, yt, It + dn, ke, Le, xe, be) : I.copyTexSubImage2D(gt, me, $e, yt, ke, Le, xe, be);
37640
37640
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, null), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, null);
37641
37641
  } else
37642
- ln ? E.isDataTexture || E.isData3DTexture ? I.texSubImage3D(gt, me, Ke, yt, It, xe, be, Ce, Tt, De, Dt.data) : U.isCompressedArrayTexture ? I.compressedTexSubImage3D(gt, me, Ke, yt, It, xe, be, Ce, Tt, Dt.data) : I.texSubImage3D(gt, me, Ke, yt, It, xe, be, Ce, Tt, De, Dt) : E.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, me, Ke, yt, xe, be, Tt, De, Dt.data) : E.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, me, Ke, yt, Dt.width, Dt.height, Tt, Dt.data) : I.texSubImage2D(I.TEXTURE_2D, me, Ke, yt, xe, be, Tt, De, Dt);
37643
- I.pixelStorei(I.UNPACK_ROW_LENGTH, lt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, bn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Rs), I.pixelStorei(I.UNPACK_SKIP_ROWS, yn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, vr), me === 0 && U.generateMipmaps && I.generateMipmap(gt), Ae.unbindTexture();
37642
+ ln ? E.isDataTexture || E.isData3DTexture ? I.texSubImage3D(gt, me, $e, yt, It, xe, be, Ce, Tt, De, Dt.data) : U.isCompressedArrayTexture ? I.compressedTexSubImage3D(gt, me, $e, yt, It, xe, be, Ce, Tt, Dt.data) : I.texSubImage3D(gt, me, $e, yt, It, xe, be, Ce, Tt, De, Dt) : E.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, me, $e, yt, xe, be, Tt, De, Dt.data) : E.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, me, $e, yt, Dt.width, Dt.height, Tt, Dt.data) : I.texSubImage2D(I.TEXTURE_2D, me, $e, yt, xe, be, Tt, De, Dt);
37643
+ I.pixelStorei(I.UNPACK_ROW_LENGTH, lt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, _n), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Rs), I.pixelStorei(I.UNPACK_SKIP_ROWS, Sn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, vr), me === 0 && U.generateMipmaps && I.generateMipmap(gt), Ae.unbindTexture();
37644
37644
  }, this.initRenderTarget = function(E) {
37645
37645
  y.get(E).__webglFramebuffer === void 0 && L.setupRenderTarget(E);
37646
37646
  }, this.initTexture = function(E) {
@@ -38604,7 +38604,7 @@ class Uo {
38604
38604
  this.hasAcquired && (ni.release(), this.hasAcquired = !1);
38605
38605
  }
38606
38606
  }
38607
- const xn = {
38607
+ const hn = {
38608
38608
  default: {
38609
38609
  primary: "#6366f1",
38610
38610
  secondary: "#8b5cf6",
@@ -38725,8 +38725,19 @@ const xn = {
38725
38725
  // Deep pure red
38726
38726
  highlight: "#ff2030"
38727
38727
  // Bright red
38728
- }
38729
- }, Tn = {
38728
+ },
38729
+ "tangerine-neon": {
38730
+ primary: "#F97316",
38731
+ secondary: "#EF4444",
38732
+ accent: "#EC4899",
38733
+ glow: "#F97316",
38734
+ atmosphere: "#FB923C",
38735
+ depth: "#C2410C",
38736
+ // Deep burnt orange
38737
+ highlight: "#FDBA74"
38738
+ // Neon orange glow
38739
+ }
38740
+ }, fn = {
38730
38741
  indigo: {
38731
38742
  primary: "#3730a3",
38732
38743
  secondary: "#4338ca",
@@ -38836,178 +38847,185 @@ const xn = {
38836
38847
  // Deep dark red
38837
38848
  highlight: "#ff8a80"
38838
38849
  // Light red
38850
+ },
38851
+ "tangerine-neon": {
38852
+ primary: "#EA580C",
38853
+ secondary: "#F97316",
38854
+ accent: "#FB923C",
38855
+ glow: "#EA580C",
38856
+ atmosphere: "#F97316",
38857
+ depth: "#9A3412",
38858
+ // Deep orange-brown
38859
+ highlight: "#FDBA74"
38860
+ // Warm neon orange
38839
38861
  }
38840
38862
  };
38841
- function lM(i, e = "dark") {
38842
- const t = e === "dark" ? xn : Tn;
38863
+ function oM(i, e = "dark") {
38864
+ const t = e === "dark" ? hn : fn;
38843
38865
  return t[i] || t[Object.keys(t)[0]];
38844
38866
  }
38845
- function dM(i = "dark") {
38846
- return Object.keys(i === "dark" ? xn : Tn);
38867
+ function cM(i = "dark") {
38868
+ return Object.keys(i === "dark" ? hn : fn);
38847
38869
  }
38848
38870
  const ea = {
38849
38871
  default: {
38850
38872
  dark: {
38851
- colors: xn.default,
38873
+ colors: hn.default,
38852
38874
  glowIntensity: 1.2,
38853
38875
  idleGlowMultiplier: 0.6
38854
38876
  },
38855
38877
  light: {
38856
- colors: Tn.indigo,
38878
+ colors: fn.indigo,
38857
38879
  glowIntensity: 1.8,
38858
38880
  idleGlowMultiplier: 1.2
38859
38881
  }
38860
38882
  },
38861
38883
  emerald: {
38862
38884
  dark: {
38863
- colors: xn.emerald,
38885
+ colors: hn.emerald,
38864
38886
  glowIntensity: 1.2,
38865
38887
  idleGlowMultiplier: 0.6
38866
38888
  },
38867
38889
  light: {
38868
- colors: Tn.teal,
38890
+ colors: fn.teal,
38869
38891
  glowIntensity: 1.8,
38870
38892
  idleGlowMultiplier: 1.2
38871
38893
  }
38872
38894
  },
38873
38895
  rose: {
38874
38896
  dark: {
38875
- colors: xn.rose,
38897
+ colors: hn.rose,
38876
38898
  glowIntensity: 1.2,
38877
38899
  idleGlowMultiplier: 0.6
38878
38900
  },
38879
38901
  light: {
38880
- colors: Tn.pink,
38902
+ colors: fn.pink,
38881
38903
  glowIntensity: 1.8,
38882
38904
  idleGlowMultiplier: 1.2
38883
38905
  }
38884
38906
  },
38885
38907
  amber: {
38886
38908
  dark: {
38887
- colors: xn.amber,
38909
+ colors: hn.amber,
38888
38910
  glowIntensity: 1.2,
38889
38911
  idleGlowMultiplier: 0.6
38890
38912
  },
38891
38913
  light: {
38892
- colors: Tn.orange,
38914
+ colors: fn.orange,
38893
38915
  glowIntensity: 1.8,
38894
38916
  idleGlowMultiplier: 1.2
38895
38917
  }
38896
38918
  },
38897
38919
  cyan: {
38898
38920
  dark: {
38899
- colors: xn.cyan,
38921
+ colors: hn.cyan,
38900
38922
  glowIntensity: 1.2,
38901
38923
  idleGlowMultiplier: 0.6
38902
38924
  },
38903
38925
  light: {
38904
- colors: Tn.blue,
38926
+ colors: fn.blue,
38905
38927
  glowIntensity: 1.8,
38906
38928
  idleGlowMultiplier: 1.2
38907
38929
  }
38908
38930
  },
38909
38931
  purple: {
38910
38932
  dark: {
38911
- colors: xn.purple,
38933
+ colors: hn.purple,
38912
38934
  glowIntensity: 1.2,
38913
38935
  idleGlowMultiplier: 0.6
38914
38936
  },
38915
38937
  light: {
38916
- colors: Tn.violet,
38938
+ colors: fn.violet,
38917
38939
  glowIntensity: 1.8,
38918
38940
  idleGlowMultiplier: 1.2
38919
38941
  }
38920
38942
  },
38921
38943
  blue: {
38922
38944
  dark: {
38923
- colors: xn.blue,
38945
+ colors: hn.blue,
38924
38946
  glowIntensity: 1.2,
38925
38947
  idleGlowMultiplier: 0.6
38926
38948
  },
38927
38949
  light: {
38928
- colors: Tn.blue,
38950
+ colors: fn.blue,
38929
38951
  glowIntensity: 1.8,
38930
38952
  idleGlowMultiplier: 1.2
38931
38953
  }
38932
38954
  },
38933
38955
  white: {
38934
38956
  dark: {
38935
- colors: xn.white,
38957
+ colors: hn.white,
38936
38958
  glowIntensity: 1.2,
38937
38959
  idleGlowMultiplier: 0.6
38938
38960
  },
38939
38961
  light: {
38940
- colors: Tn.silver,
38962
+ colors: fn.silver,
38941
38963
  glowIntensity: 1.8,
38942
38964
  idleGlowMultiplier: 1.2
38943
38965
  }
38944
38966
  },
38945
38967
  black: {
38946
38968
  dark: {
38947
- colors: xn.black,
38969
+ colors: hn.black,
38948
38970
  glowIntensity: 1.2,
38949
38971
  idleGlowMultiplier: 0.6
38950
38972
  },
38951
38973
  light: {
38952
- colors: Tn.charcoal,
38974
+ colors: fn.charcoal,
38953
38975
  glowIntensity: 1.8,
38954
38976
  idleGlowMultiplier: 1.2
38955
38977
  }
38956
38978
  },
38957
38979
  tangerine: {
38958
38980
  dark: {
38959
- colors: xn.tangerine,
38981
+ colors: hn.tangerine,
38960
38982
  glowIntensity: 1.2,
38961
38983
  idleGlowMultiplier: 0.6
38962
38984
  },
38963
38985
  light: {
38964
- colors: Tn.tangerine,
38986
+ colors: fn.tangerine,
38965
38987
  glowIntensity: 1.8,
38966
38988
  idleGlowMultiplier: 1.2
38967
38989
  }
38968
38990
  },
38969
38991
  ember: {
38970
38992
  dark: {
38971
- colors: xn.ember,
38993
+ colors: hn.ember,
38972
38994
  glowIntensity: 1.2,
38973
38995
  idleGlowMultiplier: 0.6
38974
38996
  },
38975
38997
  light: {
38976
- colors: Tn.ember,
38998
+ colors: fn.ember,
38977
38999
  glowIntensity: 1.8,
38978
39000
  idleGlowMultiplier: 1.2
38979
39001
  }
39002
+ },
39003
+ "tangerine-neon": {
39004
+ dark: {
39005
+ colors: hn["tangerine-neon"],
39006
+ glowIntensity: 1.4,
39007
+ idleGlowMultiplier: 0.7
39008
+ },
39009
+ light: {
39010
+ colors: fn["tangerine-neon"],
39011
+ glowIntensity: 2,
39012
+ idleGlowMultiplier: 1.3
39013
+ }
38980
39014
  }
38981
- }, uM = Object.fromEntries(
39015
+ }, lM = Object.fromEntries(
38982
39016
  Object.entries(ea).map(([i, e]) => [i, e.dark])
38983
- ), hM = Object.fromEntries(
39017
+ ), dM = Object.fromEntries(
38984
39018
  Object.entries(ea).map(([i, e]) => [i, e.light])
38985
39019
  );
38986
- function HE() {
38987
- return typeof window > "u" || window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
39020
+ function ca(i) {
39021
+ return (ea[i] || ea.default).dark;
38988
39022
  }
38989
- function ca(i, e = "auto") {
38990
- const t = ea[i] || ea.default, n = e === "auto" ? HE() : e;
38991
- return t[n];
38992
- }
38993
- function fM() {
39023
+ function uM() {
38994
39024
  return Object.keys(ea);
38995
39025
  }
38996
- function WE(i, e, t = "auto") {
38997
- const n = ca(e, t);
38998
- i.orbColors = n.colors, i.glowIntensity = n.glowIntensity, i.idleGlowMultiplier = n.idleGlowMultiplier;
38999
- }
39000
- function pM(i, e) {
39001
- if (typeof window > "u")
39002
- return () => {
39003
- };
39004
- const t = window.matchMedia("(prefers-color-scheme: dark)"), n = () => {
39005
- const s = t.matches ? "dark" : "light";
39006
- WE(i, e, s);
39007
- };
39008
- return n(), t.addEventListener("change", n), () => {
39009
- t.removeEventListener("change", n);
39010
- };
39026
+ function hM(i, e) {
39027
+ const t = ca(e);
39028
+ i.orbColors = t.colors, i.glowIntensity = t.glowIntensity, i.idleGlowMultiplier = t.idleGlowMultiplier;
39011
39029
  }
39012
39030
  const Km = "privacy_accepted", Sd = "user_identity";
39013
39031
  function No() {
@@ -39038,12 +39056,12 @@ function Bo() {
39038
39056
  return null;
39039
39057
  }
39040
39058
  }
39041
- function qE() {
39059
+ function HE() {
39042
39060
  if (typeof window > "u") return "https://api.hanc.ai";
39043
39061
  const i = window.location.hostname;
39044
39062
  return i.endsWith(".hanc.me") || i === "hanc.me" || i === "localhost" ? "https://api.hanc.me" : "https://api.hanc.ai";
39045
39063
  }
39046
- const la = qE(), qc = {
39064
+ const la = HE(), qc = {
39047
39065
  terms_enabled: !1,
39048
39066
  terms_content: "",
39049
39067
  terms_url: "https://hanc.ai/terms",
@@ -39051,12 +39069,12 @@ const la = qE(), qc = {
39051
39069
  theme: "default",
39052
39070
  allow_all_domains: !0,
39053
39071
  allowed_domains: []
39054
- }, vo = /* @__PURE__ */ new Map(), jE = 1e3;
39072
+ }, vo = /* @__PURE__ */ new Map(), WE = 1e3;
39055
39073
  async function zo(i, e = la) {
39056
39074
  if (!i)
39057
39075
  return console.warn("[hanc-widget] No agentId provided, using default config"), qc;
39058
39076
  const t = vo.get(i);
39059
- if (t && Date.now() - t.timestamp < jE)
39077
+ if (t && Date.now() - t.timestamp < WE)
39060
39078
  return t.config;
39061
39079
  try {
39062
39080
  const n = await fetch(`${e}/v1/site/widget-config/${i}`, {
@@ -39076,18 +39094,18 @@ async function zo(i, e = la) {
39076
39094
  return console.error("[hanc-widget] Failed to fetch widget config:", n), qc;
39077
39095
  }
39078
39096
  }
39079
- const $E = ["hanc.ai", "hanc.me", "localhost"];
39097
+ const qE = ["hanc.ai", "hanc.me", "localhost"];
39080
39098
  function Vo(i) {
39081
39099
  const e = window.location.hostname;
39082
- return $E.some((n) => e === n || e.endsWith(`.${n}`)) || i.allow_all_domains || !i.allowed_domains || i.allowed_domains.length === 0 ? !0 : i.allowed_domains.some((n) => e === n || e.endsWith(`.${n}`));
39100
+ return qE.some((n) => e === n || e.endsWith(`.${n}`)) || i.allow_all_domains || !i.allowed_domains || i.allowed_domains.length === 0 ? !0 : i.allowed_domains.some((n) => e === n || e.endsWith(`.${n}`));
39083
39101
  }
39084
- function mM(i) {
39102
+ function fM(i) {
39085
39103
  i ? vo.delete(i) : vo.clear();
39086
39104
  }
39087
- var XE = Object.defineProperty, YE = Object.getOwnPropertyDescriptor, da = (i, e, t, n) => {
39088
- for (var s = n > 1 ? void 0 : n ? YE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39105
+ var jE = Object.defineProperty, $E = Object.getOwnPropertyDescriptor, da = (i, e, t, n) => {
39106
+ for (var s = n > 1 ? void 0 : n ? $E(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39089
39107
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39090
- return n && s && XE(e, t, s), s;
39108
+ return n && s && jE(e, t, s), s;
39091
39109
  };
39092
39110
  let ws = class extends wi {
39093
39111
  constructor() {
@@ -39353,28 +39371,28 @@ ws.styles = ta`
39353
39371
  }
39354
39372
  `;
39355
39373
  da([
39356
- $({ type: String, attribute: "privacy-url" })
39374
+ X({ type: String, attribute: "privacy-url" })
39357
39375
  ], ws.prototype, "privacyUrl", 2);
39358
39376
  da([
39359
- $({ type: String, attribute: "terms-url" })
39377
+ X({ type: String, attribute: "terms-url" })
39360
39378
  ], ws.prototype, "termsUrl", 2);
39361
39379
  da([
39362
- $({ type: String, attribute: "terms-content" })
39380
+ X({ type: String, attribute: "terms-content" })
39363
39381
  ], ws.prototype, "termsContent", 2);
39364
39382
  da([
39365
- $({ type: String, attribute: "modal-title" })
39383
+ X({ type: String, attribute: "modal-title" })
39366
39384
  ], ws.prototype, "modalTitle", 2);
39367
39385
  ws = da([
39368
39386
  ia("hanc-privacy-modal")
39369
39387
  ], ws);
39370
- var KE = Object.defineProperty, JE = Object.getOwnPropertyDescriptor, Qe = (i, e, t, n) => {
39371
- for (var s = n > 1 ? void 0 : n ? JE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39388
+ var XE = Object.defineProperty, YE = Object.getOwnPropertyDescriptor, et = (i, e, t, n) => {
39389
+ for (var s = n > 1 ? void 0 : n ? YE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39372
39390
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39373
- return n && s && KE(e, t, s), s;
39391
+ return n && s && XE(e, t, s), s;
39374
39392
  };
39375
- let $e = class extends wi {
39393
+ let Xe = class extends wi {
39376
39394
  constructor() {
39377
- super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39395
+ super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, 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 (i) => {
39378
39396
  const t = i.detail;
39379
39397
  if (!(!t || !this.audioAnalyzer))
39380
39398
  try {
@@ -39498,11 +39516,11 @@ let $e = class extends wi {
39498
39516
  }
39499
39517
  updated(i) {
39500
39518
  var e, t, n;
39501
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
39519
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), i.has("theme") && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
39502
39520
  }
39503
39521
  applyTheme() {
39504
39522
  if (this.theme) {
39505
- const i = ca(this.theme, this.themeMode);
39523
+ const i = ca(this.theme);
39506
39524
  this.orbColors = i.colors, this.glowIntensity = i.glowIntensity, this.idleGlowMultiplier = i.idleGlowMultiplier, this.orbRenderer && (this.orbRenderer.setColors(this.orbColors), this.orbRenderer.setGlowSettings(this.glowIntensity, this.idleGlowMultiplier));
39507
39525
  }
39508
39526
  }
@@ -39872,131 +39890,128 @@ let $e = class extends wi {
39872
39890
  `;
39873
39891
  }
39874
39892
  };
39875
- $e.styles = ta`
39893
+ Xe.styles = ta`
39876
39894
  :host {
39877
39895
  display: inline-block;
39878
39896
  contain: layout style;
39879
39897
  }
39880
39898
  `;
39881
- Qe([
39882
- $({ type: String, attribute: "agent-id" })
39883
- ], $e.prototype, "agentId", 2);
39884
- Qe([
39885
- $({ type: String, attribute: "voice-service-url" })
39886
- ], $e.prototype, "voiceServiceUrl", 2);
39887
- Qe([
39899
+ et([
39900
+ X({ type: String, attribute: "agent-id" })
39901
+ ], Xe.prototype, "agentId", 2);
39902
+ et([
39903
+ X({ type: String, attribute: "voice-service-url" })
39904
+ ], Xe.prototype, "voiceServiceUrl", 2);
39905
+ et([
39888
39906
  St()
39889
- ], $e.prototype, "callStatus", 2);
39890
- Qe([
39907
+ ], Xe.prototype, "callStatus", 2);
39908
+ et([
39891
39909
  St()
39892
- ], $e.prototype, "microphoneEnabled", 2);
39893
- Qe([
39910
+ ], Xe.prototype, "microphoneEnabled", 2);
39911
+ et([
39894
39912
  St()
39895
- ], $e.prototype, "microphoneInitialized", 2);
39896
- Qe([
39913
+ ], Xe.prototype, "microphoneInitialized", 2);
39914
+ et([
39897
39915
  St()
39898
- ], $e.prototype, "showPrivacyModal", 2);
39899
- Qe([
39916
+ ], Xe.prototype, "showPrivacyModal", 2);
39917
+ et([
39900
39918
  St()
39901
- ], $e.prototype, "widgetConfig", 2);
39902
- Qe([
39919
+ ], Xe.prototype, "widgetConfig", 2);
39920
+ et([
39903
39921
  St()
39904
- ], $e.prototype, "configLoading", 2);
39905
- Qe([
39922
+ ], Xe.prototype, "configLoading", 2);
39923
+ et([
39906
39924
  St()
39907
- ], $e.prototype, "domainBlocked", 2);
39908
- Qe([
39909
- $({ type: String, attribute: "privacy-url" })
39910
- ], $e.prototype, "privacyUrl", 2);
39911
- Qe([
39912
- $({ type: String, attribute: "terms-url" })
39913
- ], $e.prototype, "termsUrl", 2);
39914
- Qe([
39915
- $({ type: Boolean, attribute: "terms-enabled" })
39916
- ], $e.prototype, "termsEnabled", 2);
39917
- Qe([
39918
- $({ type: String, attribute: "terms-content" })
39919
- ], $e.prototype, "termsContent", 2);
39920
- Qe([
39921
- $({ type: Boolean, attribute: "skip-fetch" })
39922
- ], $e.prototype, "skipFetch", 2);
39923
- Qe([
39924
- $({ type: String, attribute: "api-base-url" })
39925
- ], $e.prototype, "apiBaseUrl", 2);
39926
- Qe([
39927
- $({ type: String, attribute: "button-start-text" })
39928
- ], $e.prototype, "buttonStartText", 2);
39929
- Qe([
39930
- $({ type: String, attribute: "button-connecting-text" })
39931
- ], $e.prototype, "buttonConnectingText", 2);
39932
- Qe([
39933
- $({ type: Number, attribute: "size" })
39934
- ], $e.prototype, "size", 2);
39935
- Qe([
39936
- $({ type: Number, attribute: "container-padding" })
39937
- ], $e.prototype, "containerPadding", 2);
39938
- Qe([
39939
- $({ type: String, attribute: "theme", reflect: !0 })
39940
- ], $e.prototype, "theme", 2);
39941
- Qe([
39942
- $({ type: String, attribute: "theme-mode" })
39943
- ], $e.prototype, "themeMode", 2);
39944
- Qe([
39945
- $({ type: Object, attribute: "orb-colors" })
39946
- ], $e.prototype, "orbColors", 2);
39947
- Qe([
39948
- $({ type: Number, attribute: "glow-intensity" })
39949
- ], $e.prototype, "glowIntensity", 2);
39950
- Qe([
39951
- $({ type: Number, attribute: "idle-glow-multiplier" })
39952
- ], $e.prototype, "idleGlowMultiplier", 2);
39953
- Qe([
39954
- $({ type: Number, attribute: "morph-strength" })
39955
- ], $e.prototype, "morphStrength", 2);
39956
- Qe([
39957
- $({ type: Number, attribute: "noise-scale" })
39958
- ], $e.prototype, "noiseScale", 2);
39959
- Qe([
39960
- $({ type: Number, attribute: "noise-speed" })
39961
- ], $e.prototype, "noiseSpeed", 2);
39962
- Qe([
39963
- $({ type: Number, attribute: "fresnel-power" })
39964
- ], $e.prototype, "fresnelPower", 2);
39965
- Qe([
39966
- $({ type: Number, attribute: "rotation-speed" })
39967
- ], $e.prototype, "rotationSpeed", 2);
39968
- Qe([
39969
- $({ type: Number, attribute: "audio-reactivity" })
39970
- ], $e.prototype, "audioReactivity", 2);
39971
- Qe([
39972
- $({ type: Number, attribute: "audio-smoothing" })
39973
- ], $e.prototype, "audioSmoothing", 2);
39974
- Qe([
39975
- $({ type: Number, attribute: "idle-morph-multiplier" })
39976
- ], $e.prototype, "idleMorphMultiplier", 2);
39977
- Qe([
39978
- $({ type: Number, attribute: "color-contrast" })
39979
- ], $e.prototype, "colorContrast", 2);
39980
- Qe([
39981
- $({ type: Boolean, attribute: "sound-enabled" })
39982
- ], $e.prototype, "soundEnabled", 2);
39983
- Qe([
39984
- $({ type: Number, attribute: "sound-volume" })
39985
- ], $e.prototype, "soundVolume", 2);
39986
- Qe([
39987
- $({ type: String, attribute: "sound-preset" })
39988
- ], $e.prototype, "soundPreset", 2);
39989
- $e = Qe([
39925
+ ], Xe.prototype, "domainBlocked", 2);
39926
+ et([
39927
+ X({ type: String, attribute: "privacy-url" })
39928
+ ], Xe.prototype, "privacyUrl", 2);
39929
+ et([
39930
+ X({ type: String, attribute: "terms-url" })
39931
+ ], Xe.prototype, "termsUrl", 2);
39932
+ et([
39933
+ X({ type: Boolean, attribute: "terms-enabled" })
39934
+ ], Xe.prototype, "termsEnabled", 2);
39935
+ et([
39936
+ X({ type: String, attribute: "terms-content" })
39937
+ ], Xe.prototype, "termsContent", 2);
39938
+ et([
39939
+ X({ type: Boolean, attribute: "skip-fetch" })
39940
+ ], Xe.prototype, "skipFetch", 2);
39941
+ et([
39942
+ X({ type: String, attribute: "api-base-url" })
39943
+ ], Xe.prototype, "apiBaseUrl", 2);
39944
+ et([
39945
+ X({ type: String, attribute: "button-start-text" })
39946
+ ], Xe.prototype, "buttonStartText", 2);
39947
+ et([
39948
+ X({ type: String, attribute: "button-connecting-text" })
39949
+ ], Xe.prototype, "buttonConnectingText", 2);
39950
+ et([
39951
+ X({ type: Number, attribute: "size" })
39952
+ ], Xe.prototype, "size", 2);
39953
+ et([
39954
+ X({ type: Number, attribute: "container-padding" })
39955
+ ], Xe.prototype, "containerPadding", 2);
39956
+ et([
39957
+ X({ type: String, attribute: "theme", reflect: !0 })
39958
+ ], Xe.prototype, "theme", 2);
39959
+ et([
39960
+ X({ type: Object, attribute: "orb-colors" })
39961
+ ], Xe.prototype, "orbColors", 2);
39962
+ et([
39963
+ X({ type: Number, attribute: "glow-intensity" })
39964
+ ], Xe.prototype, "glowIntensity", 2);
39965
+ et([
39966
+ X({ type: Number, attribute: "idle-glow-multiplier" })
39967
+ ], Xe.prototype, "idleGlowMultiplier", 2);
39968
+ et([
39969
+ X({ type: Number, attribute: "morph-strength" })
39970
+ ], Xe.prototype, "morphStrength", 2);
39971
+ et([
39972
+ X({ type: Number, attribute: "noise-scale" })
39973
+ ], Xe.prototype, "noiseScale", 2);
39974
+ et([
39975
+ X({ type: Number, attribute: "noise-speed" })
39976
+ ], Xe.prototype, "noiseSpeed", 2);
39977
+ et([
39978
+ X({ type: Number, attribute: "fresnel-power" })
39979
+ ], Xe.prototype, "fresnelPower", 2);
39980
+ et([
39981
+ X({ type: Number, attribute: "rotation-speed" })
39982
+ ], Xe.prototype, "rotationSpeed", 2);
39983
+ et([
39984
+ X({ type: Number, attribute: "audio-reactivity" })
39985
+ ], Xe.prototype, "audioReactivity", 2);
39986
+ et([
39987
+ X({ type: Number, attribute: "audio-smoothing" })
39988
+ ], Xe.prototype, "audioSmoothing", 2);
39989
+ et([
39990
+ X({ type: Number, attribute: "idle-morph-multiplier" })
39991
+ ], Xe.prototype, "idleMorphMultiplier", 2);
39992
+ et([
39993
+ X({ type: Number, attribute: "color-contrast" })
39994
+ ], Xe.prototype, "colorContrast", 2);
39995
+ et([
39996
+ X({ type: Boolean, attribute: "sound-enabled" })
39997
+ ], Xe.prototype, "soundEnabled", 2);
39998
+ et([
39999
+ X({ type: Number, attribute: "sound-volume" })
40000
+ ], Xe.prototype, "soundVolume", 2);
40001
+ et([
40002
+ X({ type: String, attribute: "sound-preset" })
40003
+ ], Xe.prototype, "soundPreset", 2);
40004
+ Xe = et([
39990
40005
  ia("hanc-ai-inline-call")
39991
- ], $e);
39992
- var ZE = Object.defineProperty, QE = Object.getOwnPropertyDescriptor, et = (i, e, t, n) => {
39993
- for (var s = n > 1 ? void 0 : n ? QE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
40006
+ ], Xe);
40007
+ var KE = Object.defineProperty, JE = Object.getOwnPropertyDescriptor, tt = (i, e, t, n) => {
40008
+ for (var s = n > 1 ? void 0 : n ? JE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39994
40009
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39995
- return n && s && ZE(e, t, s), s;
40010
+ return n && s && KE(e, t, s), s;
39996
40011
  };
39997
- let Xe = class extends wi {
40012
+ let Ye = class extends wi {
39998
40013
  constructor() {
39999
- super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
40014
+ super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, 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 (i) => {
40000
40015
  const t = i.detail;
40001
40016
  if (!(!t || !this.audioAnalyzer))
40002
40017
  try {
@@ -40129,11 +40144,11 @@ let Xe = class extends wi {
40129
40144
  }
40130
40145
  updated(i) {
40131
40146
  var e, t, n;
40132
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
40147
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), i.has("theme") && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
40133
40148
  }
40134
40149
  applyTheme() {
40135
40150
  if (this.theme) {
40136
- const i = ca(this.theme, this.themeMode);
40151
+ const i = ca(this.theme);
40137
40152
  this.orbColors = i.colors, this.glowIntensity = i.glowIntensity, this.idleGlowMultiplier = i.idleGlowMultiplier, this.orbRenderer && (this.orbRenderer.setColors(this.orbColors), this.orbRenderer.setGlowSettings(this.glowIntensity, this.idleGlowMultiplier));
40138
40153
  }
40139
40154
  }
@@ -40492,130 +40507,127 @@ let Xe = class extends wi {
40492
40507
  `;
40493
40508
  }
40494
40509
  };
40495
- Xe.styles = ta`
40510
+ Ye.styles = ta`
40496
40511
  :host {
40497
40512
  display: block;
40498
40513
  }
40499
40514
  `;
40500
- et([
40501
- $({ type: String, attribute: "agent-id" })
40502
- ], Xe.prototype, "agentId", 2);
40503
- et([
40504
- $({ type: String, attribute: "voice-service-url" })
40505
- ], Xe.prototype, "voiceServiceUrl", 2);
40506
- et([
40515
+ tt([
40516
+ X({ type: String, attribute: "agent-id" })
40517
+ ], Ye.prototype, "agentId", 2);
40518
+ tt([
40519
+ X({ type: String, attribute: "voice-service-url" })
40520
+ ], Ye.prototype, "voiceServiceUrl", 2);
40521
+ tt([
40507
40522
  St()
40508
- ], Xe.prototype, "callStatus", 2);
40509
- et([
40523
+ ], Ye.prototype, "callStatus", 2);
40524
+ tt([
40510
40525
  St()
40511
- ], Xe.prototype, "microphoneEnabled", 2);
40512
- et([
40526
+ ], Ye.prototype, "microphoneEnabled", 2);
40527
+ tt([
40513
40528
  St()
40514
- ], Xe.prototype, "microphoneInitialized", 2);
40515
- et([
40529
+ ], Ye.prototype, "microphoneInitialized", 2);
40530
+ tt([
40516
40531
  St()
40517
- ], Xe.prototype, "showPrivacyModal", 2);
40518
- et([
40532
+ ], Ye.prototype, "showPrivacyModal", 2);
40533
+ tt([
40519
40534
  St()
40520
- ], Xe.prototype, "widgetConfig", 2);
40521
- et([
40535
+ ], Ye.prototype, "widgetConfig", 2);
40536
+ tt([
40522
40537
  St()
40523
- ], Xe.prototype, "configLoading", 2);
40524
- et([
40538
+ ], Ye.prototype, "configLoading", 2);
40539
+ tt([
40525
40540
  St()
40526
- ], Xe.prototype, "domainBlocked", 2);
40527
- et([
40528
- $({ type: String, attribute: "privacy-url" })
40529
- ], Xe.prototype, "privacyUrl", 2);
40530
- et([
40531
- $({ type: String, attribute: "terms-url" })
40532
- ], Xe.prototype, "termsUrl", 2);
40533
- et([
40534
- $({ type: Boolean, attribute: "terms-enabled" })
40535
- ], Xe.prototype, "termsEnabled", 2);
40536
- et([
40537
- $({ type: String, attribute: "terms-content" })
40538
- ], Xe.prototype, "termsContent", 2);
40539
- et([
40540
- $({ type: Boolean, attribute: "skip-fetch" })
40541
- ], Xe.prototype, "skipFetch", 2);
40542
- et([
40543
- $({ type: String, attribute: "api-base-url" })
40544
- ], Xe.prototype, "apiBaseUrl", 2);
40545
- et([
40546
- $({ type: String, attribute: "button-start-text" })
40547
- ], Xe.prototype, "buttonStartText", 2);
40548
- et([
40549
- $({ type: String, attribute: "button-connecting-text" })
40550
- ], Xe.prototype, "buttonConnectingText", 2);
40551
- et([
40552
- $({ type: String, attribute: "position" })
40553
- ], Xe.prototype, "position", 2);
40554
- et([
40555
- $({ type: Number, attribute: "size" })
40556
- ], Xe.prototype, "size", 2);
40557
- et([
40558
- $({ type: String, attribute: "theme" })
40559
- ], Xe.prototype, "theme", 2);
40560
- et([
40561
- $({ type: String, attribute: "theme-mode" })
40562
- ], Xe.prototype, "themeMode", 2);
40563
- et([
40564
- $({ type: Object, attribute: "orb-colors" })
40565
- ], Xe.prototype, "orbColors", 2);
40566
- et([
40567
- $({ type: Number, attribute: "glow-intensity" })
40568
- ], Xe.prototype, "glowIntensity", 2);
40569
- et([
40570
- $({ type: Number, attribute: "idle-glow-multiplier" })
40571
- ], Xe.prototype, "idleGlowMultiplier", 2);
40572
- et([
40573
- $({ type: Number, attribute: "morph-strength" })
40574
- ], Xe.prototype, "morphStrength", 2);
40575
- et([
40576
- $({ type: Number, attribute: "noise-scale" })
40577
- ], Xe.prototype, "noiseScale", 2);
40578
- et([
40579
- $({ type: Number, attribute: "noise-speed" })
40580
- ], Xe.prototype, "noiseSpeed", 2);
40581
- et([
40582
- $({ type: Number, attribute: "fresnel-power" })
40583
- ], Xe.prototype, "fresnelPower", 2);
40584
- et([
40585
- $({ type: Number, attribute: "rotation-speed" })
40586
- ], Xe.prototype, "rotationSpeed", 2);
40587
- et([
40588
- $({ type: Number, attribute: "audio-reactivity" })
40589
- ], Xe.prototype, "audioReactivity", 2);
40590
- et([
40591
- $({ type: Number, attribute: "audio-smoothing" })
40592
- ], Xe.prototype, "audioSmoothing", 2);
40593
- et([
40594
- $({ type: Number, attribute: "idle-morph-multiplier" })
40595
- ], Xe.prototype, "idleMorphMultiplier", 2);
40596
- et([
40597
- $({ type: Number, attribute: "color-contrast" })
40598
- ], Xe.prototype, "colorContrast", 2);
40599
- et([
40600
- $({ type: Boolean, attribute: "sound-enabled" })
40601
- ], Xe.prototype, "soundEnabled", 2);
40602
- et([
40603
- $({ type: Number, attribute: "sound-volume" })
40604
- ], Xe.prototype, "soundVolume", 2);
40605
- et([
40606
- $({ type: String, attribute: "sound-preset" })
40607
- ], Xe.prototype, "soundPreset", 2);
40608
- Xe = et([
40541
+ ], Ye.prototype, "domainBlocked", 2);
40542
+ tt([
40543
+ X({ type: String, attribute: "privacy-url" })
40544
+ ], Ye.prototype, "privacyUrl", 2);
40545
+ tt([
40546
+ X({ type: String, attribute: "terms-url" })
40547
+ ], Ye.prototype, "termsUrl", 2);
40548
+ tt([
40549
+ X({ type: Boolean, attribute: "terms-enabled" })
40550
+ ], Ye.prototype, "termsEnabled", 2);
40551
+ tt([
40552
+ X({ type: String, attribute: "terms-content" })
40553
+ ], Ye.prototype, "termsContent", 2);
40554
+ tt([
40555
+ X({ type: Boolean, attribute: "skip-fetch" })
40556
+ ], Ye.prototype, "skipFetch", 2);
40557
+ tt([
40558
+ X({ type: String, attribute: "api-base-url" })
40559
+ ], Ye.prototype, "apiBaseUrl", 2);
40560
+ tt([
40561
+ X({ type: String, attribute: "button-start-text" })
40562
+ ], Ye.prototype, "buttonStartText", 2);
40563
+ tt([
40564
+ X({ type: String, attribute: "button-connecting-text" })
40565
+ ], Ye.prototype, "buttonConnectingText", 2);
40566
+ tt([
40567
+ X({ type: String, attribute: "position" })
40568
+ ], Ye.prototype, "position", 2);
40569
+ tt([
40570
+ X({ type: Number, attribute: "size" })
40571
+ ], Ye.prototype, "size", 2);
40572
+ tt([
40573
+ X({ type: String, attribute: "theme" })
40574
+ ], Ye.prototype, "theme", 2);
40575
+ tt([
40576
+ X({ type: Object, attribute: "orb-colors" })
40577
+ ], Ye.prototype, "orbColors", 2);
40578
+ tt([
40579
+ X({ type: Number, attribute: "glow-intensity" })
40580
+ ], Ye.prototype, "glowIntensity", 2);
40581
+ tt([
40582
+ X({ type: Number, attribute: "idle-glow-multiplier" })
40583
+ ], Ye.prototype, "idleGlowMultiplier", 2);
40584
+ tt([
40585
+ X({ type: Number, attribute: "morph-strength" })
40586
+ ], Ye.prototype, "morphStrength", 2);
40587
+ tt([
40588
+ X({ type: Number, attribute: "noise-scale" })
40589
+ ], Ye.prototype, "noiseScale", 2);
40590
+ tt([
40591
+ X({ type: Number, attribute: "noise-speed" })
40592
+ ], Ye.prototype, "noiseSpeed", 2);
40593
+ tt([
40594
+ X({ type: Number, attribute: "fresnel-power" })
40595
+ ], Ye.prototype, "fresnelPower", 2);
40596
+ tt([
40597
+ X({ type: Number, attribute: "rotation-speed" })
40598
+ ], Ye.prototype, "rotationSpeed", 2);
40599
+ tt([
40600
+ X({ type: Number, attribute: "audio-reactivity" })
40601
+ ], Ye.prototype, "audioReactivity", 2);
40602
+ tt([
40603
+ X({ type: Number, attribute: "audio-smoothing" })
40604
+ ], Ye.prototype, "audioSmoothing", 2);
40605
+ tt([
40606
+ X({ type: Number, attribute: "idle-morph-multiplier" })
40607
+ ], Ye.prototype, "idleMorphMultiplier", 2);
40608
+ tt([
40609
+ X({ type: Number, attribute: "color-contrast" })
40610
+ ], Ye.prototype, "colorContrast", 2);
40611
+ tt([
40612
+ X({ type: Boolean, attribute: "sound-enabled" })
40613
+ ], Ye.prototype, "soundEnabled", 2);
40614
+ tt([
40615
+ X({ type: Number, attribute: "sound-volume" })
40616
+ ], Ye.prototype, "soundVolume", 2);
40617
+ tt([
40618
+ X({ type: String, attribute: "sound-preset" })
40619
+ ], Ye.prototype, "soundPreset", 2);
40620
+ Ye = tt([
40609
40621
  ia("hanc-ai-floating-call")
40610
- ], Xe);
40611
- var eM = Object.defineProperty, tM = Object.getOwnPropertyDescriptor, tt = (i, e, t, n) => {
40612
- for (var s = n > 1 ? void 0 : n ? tM(e, t) : e, r = i.length - 1, a; r >= 0; r--)
40622
+ ], Ye);
40623
+ var ZE = Object.defineProperty, QE = Object.getOwnPropertyDescriptor, nt = (i, e, t, n) => {
40624
+ for (var s = n > 1 ? void 0 : n ? QE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
40613
40625
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
40614
- return n && s && eM(e, t, s), s;
40626
+ return n && s && ZE(e, t, s), s;
40615
40627
  };
40616
- let Ye = class extends wi {
40628
+ let Ke = class extends wi {
40617
40629
  constructor() {
40618
- super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
40630
+ super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, 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 (i) => {
40619
40631
  const t = i.detail;
40620
40632
  if (!(!t || !this.audioAnalyzer))
40621
40633
  try {
@@ -40748,11 +40760,11 @@ let Ye = class extends wi {
40748
40760
  }
40749
40761
  updated(i) {
40750
40762
  var e, t, n;
40751
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
40763
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), i.has("theme") && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
40752
40764
  }
40753
40765
  applyTheme() {
40754
40766
  if (this.theme) {
40755
- const i = ca(this.theme, this.themeMode);
40767
+ const i = ca(this.theme);
40756
40768
  this.orbColors = i.colors, this.glowIntensity = i.glowIntensity, this.idleGlowMultiplier = i.idleGlowMultiplier, this.orbRenderer && (this.orbRenderer.setColors(this.orbColors), this.orbRenderer.setGlowSettings(
40757
40769
  this.glowIntensity,
40758
40770
  this.idleGlowMultiplier
@@ -41044,131 +41056,128 @@ let Ye = class extends wi {
41044
41056
  `;
41045
41057
  }
41046
41058
  };
41047
- Ye.styles = ta`
41059
+ Ke.styles = ta`
41048
41060
  :host {
41049
41061
  display: inline-block;
41050
41062
  contain: layout style;
41051
41063
  }
41052
41064
  `;
41053
- tt([
41054
- $({ type: String, attribute: "agent-id" })
41055
- ], Ye.prototype, "agentId", 2);
41056
- tt([
41057
- $({ type: String, attribute: "voice-service-url" })
41058
- ], Ye.prototype, "voiceServiceUrl", 2);
41059
- tt([
41065
+ nt([
41066
+ X({ type: String, attribute: "agent-id" })
41067
+ ], Ke.prototype, "agentId", 2);
41068
+ nt([
41069
+ X({ type: String, attribute: "voice-service-url" })
41070
+ ], Ke.prototype, "voiceServiceUrl", 2);
41071
+ nt([
41060
41072
  St()
41061
- ], Ye.prototype, "callStatus", 2);
41062
- tt([
41073
+ ], Ke.prototype, "callStatus", 2);
41074
+ nt([
41063
41075
  St()
41064
- ], Ye.prototype, "microphoneEnabled", 2);
41065
- tt([
41076
+ ], Ke.prototype, "microphoneEnabled", 2);
41077
+ nt([
41066
41078
  St()
41067
- ], Ye.prototype, "microphoneInitialized", 2);
41068
- tt([
41079
+ ], Ke.prototype, "microphoneInitialized", 2);
41080
+ nt([
41069
41081
  St()
41070
- ], Ye.prototype, "showPrivacyModal", 2);
41071
- tt([
41082
+ ], Ke.prototype, "showPrivacyModal", 2);
41083
+ nt([
41072
41084
  St()
41073
- ], Ye.prototype, "widgetConfig", 2);
41074
- tt([
41085
+ ], Ke.prototype, "widgetConfig", 2);
41086
+ nt([
41075
41087
  St()
41076
- ], Ye.prototype, "configLoading", 2);
41077
- tt([
41088
+ ], Ke.prototype, "configLoading", 2);
41089
+ nt([
41078
41090
  St()
41079
- ], Ye.prototype, "domainBlocked", 2);
41080
- tt([
41081
- $({ type: String, attribute: "privacy-url" })
41082
- ], Ye.prototype, "privacyUrl", 2);
41083
- tt([
41084
- $({ type: String, attribute: "terms-url" })
41085
- ], Ye.prototype, "termsUrl", 2);
41086
- tt([
41087
- $({ type: Boolean, attribute: "terms-enabled" })
41088
- ], Ye.prototype, "termsEnabled", 2);
41089
- tt([
41090
- $({ type: String, attribute: "terms-content" })
41091
- ], Ye.prototype, "termsContent", 2);
41092
- tt([
41093
- $({ type: Boolean, attribute: "skip-fetch" })
41094
- ], Ye.prototype, "skipFetch", 2);
41095
- tt([
41096
- $({ type: String, attribute: "api-base-url" })
41097
- ], Ye.prototype, "apiBaseUrl", 2);
41098
- tt([
41099
- $({ type: String, attribute: "button-start-text" })
41100
- ], Ye.prototype, "buttonStartText", 2);
41101
- tt([
41102
- $({ type: String, attribute: "button-connecting-text" })
41103
- ], Ye.prototype, "buttonConnectingText", 2);
41104
- tt([
41105
- $({ type: String, attribute: "button-end-text" })
41106
- ], Ye.prototype, "buttonEndText", 2);
41107
- tt([
41108
- $({ type: Number, attribute: "orb-size" })
41109
- ], Ye.prototype, "orbSize", 2);
41110
- tt([
41111
- $({ type: String, attribute: "theme" })
41112
- ], Ye.prototype, "theme", 2);
41113
- tt([
41114
- $({ type: String, attribute: "theme-mode" })
41115
- ], Ye.prototype, "themeMode", 2);
41116
- tt([
41117
- $({ type: Object, attribute: "orb-colors" })
41118
- ], Ye.prototype, "orbColors", 2);
41119
- tt([
41120
- $({ type: Number, attribute: "glow-intensity" })
41121
- ], Ye.prototype, "glowIntensity", 2);
41122
- tt([
41123
- $({ type: Number, attribute: "idle-glow-multiplier" })
41124
- ], Ye.prototype, "idleGlowMultiplier", 2);
41125
- tt([
41126
- $({ type: Number, attribute: "morph-strength" })
41127
- ], Ye.prototype, "morphStrength", 2);
41128
- tt([
41129
- $({ type: Number, attribute: "noise-scale" })
41130
- ], Ye.prototype, "noiseScale", 2);
41131
- tt([
41132
- $({ type: Number, attribute: "noise-speed" })
41133
- ], Ye.prototype, "noiseSpeed", 2);
41134
- tt([
41135
- $({ type: Number, attribute: "fresnel-power" })
41136
- ], Ye.prototype, "fresnelPower", 2);
41137
- tt([
41138
- $({ type: Number, attribute: "rotation-speed" })
41139
- ], Ye.prototype, "rotationSpeed", 2);
41140
- tt([
41141
- $({ type: Number, attribute: "audio-reactivity" })
41142
- ], Ye.prototype, "audioReactivity", 2);
41143
- tt([
41144
- $({ type: Number, attribute: "audio-smoothing" })
41145
- ], Ye.prototype, "audioSmoothing", 2);
41146
- tt([
41147
- $({ type: Number, attribute: "idle-morph-multiplier" })
41148
- ], Ye.prototype, "idleMorphMultiplier", 2);
41149
- tt([
41150
- $({ type: Number, attribute: "color-contrast" })
41151
- ], Ye.prototype, "colorContrast", 2);
41152
- tt([
41153
- $({ type: Boolean, attribute: "sound-enabled" })
41154
- ], Ye.prototype, "soundEnabled", 2);
41155
- tt([
41156
- $({ type: Number, attribute: "sound-volume" })
41157
- ], Ye.prototype, "soundVolume", 2);
41158
- tt([
41159
- $({ type: String, attribute: "sound-preset" })
41160
- ], Ye.prototype, "soundPreset", 2);
41161
- Ye = tt([
41091
+ ], Ke.prototype, "domainBlocked", 2);
41092
+ nt([
41093
+ X({ type: String, attribute: "privacy-url" })
41094
+ ], Ke.prototype, "privacyUrl", 2);
41095
+ nt([
41096
+ X({ type: String, attribute: "terms-url" })
41097
+ ], Ke.prototype, "termsUrl", 2);
41098
+ nt([
41099
+ X({ type: Boolean, attribute: "terms-enabled" })
41100
+ ], Ke.prototype, "termsEnabled", 2);
41101
+ nt([
41102
+ X({ type: String, attribute: "terms-content" })
41103
+ ], Ke.prototype, "termsContent", 2);
41104
+ nt([
41105
+ X({ type: Boolean, attribute: "skip-fetch" })
41106
+ ], Ke.prototype, "skipFetch", 2);
41107
+ nt([
41108
+ X({ type: String, attribute: "api-base-url" })
41109
+ ], Ke.prototype, "apiBaseUrl", 2);
41110
+ nt([
41111
+ X({ type: String, attribute: "button-start-text" })
41112
+ ], Ke.prototype, "buttonStartText", 2);
41113
+ nt([
41114
+ X({ type: String, attribute: "button-connecting-text" })
41115
+ ], Ke.prototype, "buttonConnectingText", 2);
41116
+ nt([
41117
+ X({ type: String, attribute: "button-end-text" })
41118
+ ], Ke.prototype, "buttonEndText", 2);
41119
+ nt([
41120
+ X({ type: Number, attribute: "orb-size" })
41121
+ ], Ke.prototype, "orbSize", 2);
41122
+ nt([
41123
+ X({ type: String, attribute: "theme" })
41124
+ ], Ke.prototype, "theme", 2);
41125
+ nt([
41126
+ X({ type: Object, attribute: "orb-colors" })
41127
+ ], Ke.prototype, "orbColors", 2);
41128
+ nt([
41129
+ X({ type: Number, attribute: "glow-intensity" })
41130
+ ], Ke.prototype, "glowIntensity", 2);
41131
+ nt([
41132
+ X({ type: Number, attribute: "idle-glow-multiplier" })
41133
+ ], Ke.prototype, "idleGlowMultiplier", 2);
41134
+ nt([
41135
+ X({ type: Number, attribute: "morph-strength" })
41136
+ ], Ke.prototype, "morphStrength", 2);
41137
+ nt([
41138
+ X({ type: Number, attribute: "noise-scale" })
41139
+ ], Ke.prototype, "noiseScale", 2);
41140
+ nt([
41141
+ X({ type: Number, attribute: "noise-speed" })
41142
+ ], Ke.prototype, "noiseSpeed", 2);
41143
+ nt([
41144
+ X({ type: Number, attribute: "fresnel-power" })
41145
+ ], Ke.prototype, "fresnelPower", 2);
41146
+ nt([
41147
+ X({ type: Number, attribute: "rotation-speed" })
41148
+ ], Ke.prototype, "rotationSpeed", 2);
41149
+ nt([
41150
+ X({ type: Number, attribute: "audio-reactivity" })
41151
+ ], Ke.prototype, "audioReactivity", 2);
41152
+ nt([
41153
+ X({ type: Number, attribute: "audio-smoothing" })
41154
+ ], Ke.prototype, "audioSmoothing", 2);
41155
+ nt([
41156
+ X({ type: Number, attribute: "idle-morph-multiplier" })
41157
+ ], Ke.prototype, "idleMorphMultiplier", 2);
41158
+ nt([
41159
+ X({ type: Number, attribute: "color-contrast" })
41160
+ ], Ke.prototype, "colorContrast", 2);
41161
+ nt([
41162
+ X({ type: Boolean, attribute: "sound-enabled" })
41163
+ ], Ke.prototype, "soundEnabled", 2);
41164
+ nt([
41165
+ X({ type: Number, attribute: "sound-volume" })
41166
+ ], Ke.prototype, "soundVolume", 2);
41167
+ nt([
41168
+ X({ type: String, attribute: "sound-preset" })
41169
+ ], Ke.prototype, "soundPreset", 2);
41170
+ Ke = nt([
41162
41171
  ia("hanc-ai-pill-call")
41163
- ], Ye);
41164
- var nM = Object.defineProperty, iM = Object.getOwnPropertyDescriptor, Je = (i, e, t, n) => {
41165
- for (var s = n > 1 ? void 0 : n ? iM(e, t) : e, r = i.length - 1, a; r >= 0; r--)
41172
+ ], Ke);
41173
+ var eM = Object.defineProperty, tM = Object.getOwnPropertyDescriptor, Ze = (i, e, t, n) => {
41174
+ for (var s = n > 1 ? void 0 : n ? tM(e, t) : e, r = i.length - 1, a; r >= 0; r--)
41166
41175
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
41167
- return n && s && nM(e, t, s), s;
41176
+ return n && s && eM(e, t, s), s;
41168
41177
  };
41169
- let He = class extends wi {
41178
+ let je = class extends wi {
41170
41179
  constructor() {
41171
- super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.position = "bottom-right", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
41180
+ super(...arguments), this.callManager = new lr(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = yo(), this.animationId = null, this.user_identity = Bo(), 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 = la, 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 (i) => {
41172
41181
  const t = i.detail;
41173
41182
  if (!(!t || !this.audioAnalyzer))
41174
41183
  try {
@@ -41292,11 +41301,11 @@ let He = class extends wi {
41292
41301
  }
41293
41302
  updated(i) {
41294
41303
  var e, t, n;
41295
- super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
41304
+ super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), i.has("theme") && this.applyTheme(), i.has("soundEnabled") && ((e = this.soundManager) == null || e.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((t = this.soundManager) == null || t.setVolume(this.soundVolume)), i.has("soundPreset") && ((n = this.soundManager) == null || n.setPreset(this.soundPreset));
41296
41305
  }
41297
41306
  applyTheme() {
41298
41307
  if (this.theme) {
41299
- const i = ca(this.theme, this.themeMode);
41308
+ const i = ca(this.theme);
41300
41309
  this.orbColors = i.colors, this.glowIntensity = i.glowIntensity, this.idleGlowMultiplier = i.idleGlowMultiplier, this.orbRenderer && (this.orbRenderer.setColors(this.orbColors), this.orbRenderer.setGlowSettings(this.glowIntensity, this.idleGlowMultiplier));
41301
41310
  }
41302
41311
  }
@@ -41592,144 +41601,139 @@ let He = class extends wi {
41592
41601
  `;
41593
41602
  }
41594
41603
  };
41595
- He.styles = ta`
41604
+ je.styles = ta`
41596
41605
  :host {
41597
41606
  display: block;
41598
41607
  }
41599
41608
  `;
41600
- Je([
41601
- $({ type: String, attribute: "agent-id" })
41602
- ], He.prototype, "agentId", 2);
41603
- Je([
41604
- $({ type: String, attribute: "voice-service-url" })
41605
- ], He.prototype, "voiceServiceUrl", 2);
41606
- Je([
41609
+ Ze([
41610
+ X({ type: String, attribute: "agent-id" })
41611
+ ], je.prototype, "agentId", 2);
41612
+ Ze([
41613
+ X({ type: String, attribute: "voice-service-url" })
41614
+ ], je.prototype, "voiceServiceUrl", 2);
41615
+ Ze([
41607
41616
  St()
41608
- ], He.prototype, "callStatus", 2);
41609
- Je([
41617
+ ], je.prototype, "callStatus", 2);
41618
+ Ze([
41610
41619
  St()
41611
- ], He.prototype, "microphoneEnabled", 2);
41612
- Je([
41620
+ ], je.prototype, "microphoneEnabled", 2);
41621
+ Ze([
41613
41622
  St()
41614
- ], He.prototype, "microphoneInitialized", 2);
41615
- Je([
41623
+ ], je.prototype, "microphoneInitialized", 2);
41624
+ Ze([
41616
41625
  St()
41617
- ], He.prototype, "showPrivacyModal", 2);
41618
- Je([
41626
+ ], je.prototype, "showPrivacyModal", 2);
41627
+ Ze([
41619
41628
  St()
41620
- ], He.prototype, "widgetConfig", 2);
41621
- Je([
41629
+ ], je.prototype, "widgetConfig", 2);
41630
+ Ze([
41622
41631
  St()
41623
- ], He.prototype, "configLoading", 2);
41624
- Je([
41632
+ ], je.prototype, "configLoading", 2);
41633
+ Ze([
41625
41634
  St()
41626
- ], He.prototype, "domainBlocked", 2);
41627
- Je([
41628
- $({ type: String, attribute: "privacy-url" })
41629
- ], He.prototype, "privacyUrl", 2);
41630
- Je([
41631
- $({ type: String, attribute: "terms-url" })
41632
- ], He.prototype, "termsUrl", 2);
41633
- Je([
41634
- $({ type: Boolean, attribute: "terms-enabled" })
41635
- ], He.prototype, "termsEnabled", 2);
41636
- Je([
41637
- $({ type: String, attribute: "terms-content" })
41638
- ], He.prototype, "termsContent", 2);
41639
- Je([
41640
- $({ type: Boolean, attribute: "skip-fetch" })
41641
- ], He.prototype, "skipFetch", 2);
41642
- Je([
41643
- $({ type: String, attribute: "api-base-url" })
41644
- ], He.prototype, "apiBaseUrl", 2);
41645
- Je([
41646
- $({ type: String, attribute: "button-start-text" })
41647
- ], He.prototype, "buttonStartText", 2);
41648
- Je([
41649
- $({ type: String, attribute: "button-connecting-text" })
41650
- ], He.prototype, "buttonConnectingText", 2);
41651
- Je([
41652
- $({ type: String, attribute: "button-end-text" })
41653
- ], He.prototype, "buttonEndText", 2);
41654
- Je([
41655
- $({ type: String, attribute: "position" })
41656
- ], He.prototype, "position", 2);
41657
- Je([
41658
- $({ type: Number, attribute: "orb-size" })
41659
- ], He.prototype, "orbSize", 2);
41660
- Je([
41661
- $({ type: String, attribute: "theme" })
41662
- ], He.prototype, "theme", 2);
41663
- Je([
41664
- $({ type: String, attribute: "theme-mode" })
41665
- ], He.prototype, "themeMode", 2);
41666
- Je([
41667
- $({ type: Object, attribute: "orb-colors" })
41668
- ], He.prototype, "orbColors", 2);
41669
- Je([
41670
- $({ type: Number, attribute: "glow-intensity" })
41671
- ], He.prototype, "glowIntensity", 2);
41672
- Je([
41673
- $({ type: Number, attribute: "idle-glow-multiplier" })
41674
- ], He.prototype, "idleGlowMultiplier", 2);
41675
- Je([
41676
- $({ type: Number, attribute: "morph-strength" })
41677
- ], He.prototype, "morphStrength", 2);
41678
- Je([
41679
- $({ type: Number, attribute: "noise-scale" })
41680
- ], He.prototype, "noiseScale", 2);
41681
- Je([
41682
- $({ type: Number, attribute: "noise-speed" })
41683
- ], He.prototype, "noiseSpeed", 2);
41684
- Je([
41685
- $({ type: Number, attribute: "fresnel-power" })
41686
- ], He.prototype, "fresnelPower", 2);
41687
- Je([
41688
- $({ type: Number, attribute: "rotation-speed" })
41689
- ], He.prototype, "rotationSpeed", 2);
41690
- Je([
41691
- $({ type: Number, attribute: "audio-reactivity" })
41692
- ], He.prototype, "audioReactivity", 2);
41693
- Je([
41694
- $({ type: Number, attribute: "audio-smoothing" })
41695
- ], He.prototype, "audioSmoothing", 2);
41696
- Je([
41697
- $({ type: Number, attribute: "idle-morph-multiplier" })
41698
- ], He.prototype, "idleMorphMultiplier", 2);
41699
- Je([
41700
- $({ type: Number, attribute: "color-contrast" })
41701
- ], He.prototype, "colorContrast", 2);
41702
- Je([
41703
- $({ type: Boolean, attribute: "sound-enabled" })
41704
- ], He.prototype, "soundEnabled", 2);
41705
- Je([
41706
- $({ type: Number, attribute: "sound-volume" })
41707
- ], He.prototype, "soundVolume", 2);
41708
- Je([
41709
- $({ type: String, attribute: "sound-preset" })
41710
- ], He.prototype, "soundPreset", 2);
41711
- He = Je([
41635
+ ], je.prototype, "domainBlocked", 2);
41636
+ Ze([
41637
+ X({ type: String, attribute: "privacy-url" })
41638
+ ], je.prototype, "privacyUrl", 2);
41639
+ Ze([
41640
+ X({ type: String, attribute: "terms-url" })
41641
+ ], je.prototype, "termsUrl", 2);
41642
+ Ze([
41643
+ X({ type: Boolean, attribute: "terms-enabled" })
41644
+ ], je.prototype, "termsEnabled", 2);
41645
+ Ze([
41646
+ X({ type: String, attribute: "terms-content" })
41647
+ ], je.prototype, "termsContent", 2);
41648
+ Ze([
41649
+ X({ type: Boolean, attribute: "skip-fetch" })
41650
+ ], je.prototype, "skipFetch", 2);
41651
+ Ze([
41652
+ X({ type: String, attribute: "api-base-url" })
41653
+ ], je.prototype, "apiBaseUrl", 2);
41654
+ Ze([
41655
+ X({ type: String, attribute: "button-start-text" })
41656
+ ], je.prototype, "buttonStartText", 2);
41657
+ Ze([
41658
+ X({ type: String, attribute: "button-connecting-text" })
41659
+ ], je.prototype, "buttonConnectingText", 2);
41660
+ Ze([
41661
+ X({ type: String, attribute: "button-end-text" })
41662
+ ], je.prototype, "buttonEndText", 2);
41663
+ Ze([
41664
+ X({ type: String, attribute: "position" })
41665
+ ], je.prototype, "position", 2);
41666
+ Ze([
41667
+ X({ type: Number, attribute: "orb-size" })
41668
+ ], je.prototype, "orbSize", 2);
41669
+ Ze([
41670
+ X({ type: String, attribute: "theme" })
41671
+ ], je.prototype, "theme", 2);
41672
+ Ze([
41673
+ X({ type: Object, attribute: "orb-colors" })
41674
+ ], je.prototype, "orbColors", 2);
41675
+ Ze([
41676
+ X({ type: Number, attribute: "glow-intensity" })
41677
+ ], je.prototype, "glowIntensity", 2);
41678
+ Ze([
41679
+ X({ type: Number, attribute: "idle-glow-multiplier" })
41680
+ ], je.prototype, "idleGlowMultiplier", 2);
41681
+ Ze([
41682
+ X({ type: Number, attribute: "morph-strength" })
41683
+ ], je.prototype, "morphStrength", 2);
41684
+ Ze([
41685
+ X({ type: Number, attribute: "noise-scale" })
41686
+ ], je.prototype, "noiseScale", 2);
41687
+ Ze([
41688
+ X({ type: Number, attribute: "noise-speed" })
41689
+ ], je.prototype, "noiseSpeed", 2);
41690
+ Ze([
41691
+ X({ type: Number, attribute: "fresnel-power" })
41692
+ ], je.prototype, "fresnelPower", 2);
41693
+ Ze([
41694
+ X({ type: Number, attribute: "rotation-speed" })
41695
+ ], je.prototype, "rotationSpeed", 2);
41696
+ Ze([
41697
+ X({ type: Number, attribute: "audio-reactivity" })
41698
+ ], je.prototype, "audioReactivity", 2);
41699
+ Ze([
41700
+ X({ type: Number, attribute: "audio-smoothing" })
41701
+ ], je.prototype, "audioSmoothing", 2);
41702
+ Ze([
41703
+ X({ type: Number, attribute: "idle-morph-multiplier" })
41704
+ ], je.prototype, "idleMorphMultiplier", 2);
41705
+ Ze([
41706
+ X({ type: Number, attribute: "color-contrast" })
41707
+ ], je.prototype, "colorContrast", 2);
41708
+ Ze([
41709
+ X({ type: Boolean, attribute: "sound-enabled" })
41710
+ ], je.prototype, "soundEnabled", 2);
41711
+ Ze([
41712
+ X({ type: Number, attribute: "sound-volume" })
41713
+ ], je.prototype, "soundVolume", 2);
41714
+ Ze([
41715
+ X({ type: String, attribute: "sound-preset" })
41716
+ ], je.prototype, "soundPreset", 2);
41717
+ je = Ze([
41712
41718
  ia("hanc-ai-pill-floating-call")
41713
- ], He);
41719
+ ], je);
41714
41720
  export {
41715
- Xe as FloatingCall,
41716
- $e as InlineCall,
41717
- Ye as PillCall,
41718
- He as PillFloatingCall,
41721
+ Ye as FloatingCall,
41722
+ Xe as InlineCall,
41723
+ Ke as PillCall,
41724
+ je as PillFloatingCall,
41719
41725
  Uo as SoundManager,
41720
- WE as applyTheme,
41721
- mM as clearConfigCache,
41722
- xn as darkPresets,
41723
- uM as darkThemes,
41724
- HE as detectSystemTheme,
41726
+ hM as applyTheme,
41727
+ fM as clearConfigCache,
41728
+ hn as darkPresets,
41729
+ lM as darkThemes,
41725
41730
  zo as fetchWidgetConfig,
41726
- lM as getColorPreset,
41727
- dM as getPresetNames,
41731
+ oM as getColorPreset,
41732
+ cM as getPresetNames,
41728
41733
  ca as getTheme,
41729
- fM as getThemeNames,
41734
+ uM as getThemeNames,
41730
41735
  Vo as isDomainAllowed,
41731
- Tn as lightPresets,
41732
- hM as lightThemes,
41733
- ea as themes,
41734
- pM as watchSystemTheme
41736
+ fn as lightPresets,
41737
+ dM as lightThemes,
41738
+ ea as themes
41735
41739
  };