@flowengage/react-chatbot 5.0.26 → 5.0.27

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.
@@ -226,7 +226,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
226
226
  throw n.status = e.status, n;
227
227
  }
228
228
  return t;
229
- }, k = async (e, t = {}) => {
229
+ }, Ue = async (e, t = {}) => {
230
230
  try {
231
231
  return await fetch(e, {
232
232
  mode: "cors",
@@ -236,9 +236,9 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
236
236
  let n = /* @__PURE__ */ Error(`Network error reaching ${e}. Check: (1) backend is running, (2) CORS allows this origin, (3) siteId is correct. Original: ${t.message}`);
237
237
  throw n.status = 0, n.cause = t, n;
238
238
  }
239
- }, Ue = async ({ apiBaseUrl: e, userId: t, siteId: n, priorChatId: r = null, forceNew: i = !1, resumeChatId: a = null, visitorId: o = null }) => {
239
+ }, We = async ({ apiBaseUrl: e, userId: t, siteId: n, priorChatId: r = null, forceNew: i = !1, resumeChatId: a = null, visitorId: o = null }) => {
240
240
  let s = `${e}/api/visitors/resolve-session`, c = { siteId: n };
241
- return r && String(r).trim() && (c.priorChatId = String(r).trim()), i && (c.forceNew = !0), a && (c.resumeChatId = a), o && (c.visitorId = o), He(await k(s, {
241
+ return r && String(r).trim() && (c.priorChatId = String(r).trim()), i && (c.forceNew = !0), a && (c.resumeChatId = a), o && (c.visitorId = o), He(await Ue(s, {
242
242
  method: "POST",
243
243
  mode: "cors",
244
244
  headers: {
@@ -249,13 +249,13 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
249
249
  },
250
250
  body: JSON.stringify(c)
251
251
  }));
252
- }, We = async ({ apiBaseUrl: e, siteId: t }) => {
252
+ }, Ge = async ({ apiBaseUrl: e, siteId: t }) => {
253
253
  let n = typeof window < "u" ? window.location.origin : "http://localhost";
254
- return (await He(await k(`${e}/api/widget/chatbot-loader?${new URLSearchParams({
254
+ return (await He(await Ue(`${e}/api/widget/chatbot-loader?${new URLSearchParams({
255
255
  siteId: t,
256
256
  origin: n
257
257
  }).toString()}`, { method: "GET" }))).data;
258
- }, Ge = ({ apiBaseUrl: e, userId: t, siteId: n, visitorId: r = null }) => {
258
+ }, Ke = ({ apiBaseUrl: e, userId: t, siteId: n, visitorId: r = null }) => {
259
259
  let i = (t, n) => {
260
260
  let r = `${e}${t}`, i = JSON.stringify(n);
261
261
  if (typeof navigator < "u" && navigator.sendBeacon) try {
@@ -269,7 +269,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
269
269
  headers: { "Content-Type": "application/json" },
270
270
  body: i
271
271
  }).catch(() => {}), !0) : !1;
272
- }, a = async (i, a = {}) => He(await k(`${e}${i}`, {
272
+ }, a = async (i, a = {}) => He(await Ue(`${e}${i}`, {
273
273
  ...a,
274
274
  headers: {
275
275
  "Content-Type": "application/json",
@@ -284,7 +284,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
284
284
  ...n ? { "x-site-id": n } : {},
285
285
  ...a.headers || {}
286
286
  };
287
- return He(await k(`${e}${r}`, {
287
+ return He(await Ue(`${e}${r}`, {
288
288
  ...a,
289
289
  body: i,
290
290
  headers: o
@@ -413,7 +413,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
413
413
  });
414
414
  },
415
415
  async getIceServersConfig() {
416
- return He(await k(`${e}/api/calls/ice-config`, {
416
+ return He(await Ue(`${e}/api/calls/ice-config`, {
417
417
  method: "GET",
418
418
  headers: {
419
419
  "x-user-id": t,
@@ -468,82 +468,82 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
468
468
  return i.append("chatId", r), i.append("type", "widget_closed"), t && i.append("userId", String(t)), n && i.append("siteId", String(n)), navigator.sendBeacon(`${e}/api/chat/status`, i);
469
469
  }
470
470
  };
471
- }, Ke = Object.create(null);
472
- Ke.open = "0", Ke.close = "1", Ke.ping = "2", Ke.pong = "3", Ke.message = "4", Ke.upgrade = "5", Ke.noop = "6";
473
- var qe = Object.create(null);
474
- Object.keys(Ke).forEach((e) => {
475
- qe[Ke[e]] = e;
471
+ }, qe = Object.create(null);
472
+ qe.open = "0", qe.close = "1", qe.ping = "2", qe.pong = "3", qe.message = "4", qe.upgrade = "5", qe.noop = "6";
473
+ var Je = Object.create(null);
474
+ Object.keys(qe).forEach((e) => {
475
+ Je[qe[e]] = e;
476
476
  });
477
- var Je = {
477
+ var Ye = {
478
478
  type: "error",
479
479
  data: "parser error"
480
- }, Ye = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Xe = typeof ArrayBuffer == "function", Ze = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, Qe = ({ type: e, data: t }, n, r) => Ye && t instanceof Blob ? n ? r(t) : $e(t, r) : Xe && (t instanceof ArrayBuffer || Ze(t)) ? n ? r(t) : $e(new Blob([t]), r) : r(Ke[e] + (t || "")), $e = (e, t) => {
480
+ }, Xe = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Ze = typeof ArrayBuffer == "function", Qe = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, $e = ({ type: e, data: t }, n, r) => Xe && t instanceof Blob ? n ? r(t) : et(t, r) : Ze && (t instanceof ArrayBuffer || Qe(t)) ? n ? r(t) : et(new Blob([t]), r) : r(qe[e] + (t || "")), et = (e, t) => {
481
481
  let n = new FileReader();
482
482
  return n.onload = function() {
483
483
  let e = n.result.split(",")[1];
484
484
  t("b" + (e || ""));
485
485
  }, n.readAsDataURL(e);
486
486
  };
487
- function et(e) {
487
+ function tt(e) {
488
488
  return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
489
489
  }
490
- var tt;
491
- function nt(e, t) {
492
- if (Ye && e.data instanceof Blob) return e.data.arrayBuffer().then(et).then(t);
493
- if (Xe && (e.data instanceof ArrayBuffer || Ze(e.data))) return t(et(e.data));
494
- Qe(e, !1, (e) => {
495
- tt ||= new TextEncoder(), t(tt.encode(e));
490
+ var nt;
491
+ function rt(e, t) {
492
+ if (Xe && e.data instanceof Blob) return e.data.arrayBuffer().then(tt).then(t);
493
+ if (Ze && (e.data instanceof ArrayBuffer || Qe(e.data))) return t(tt(e.data));
494
+ $e(e, !1, (e) => {
495
+ nt ||= new TextEncoder(), t(nt.encode(e));
496
496
  });
497
497
  }
498
498
  //#endregion
499
499
  //#region node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js
500
- var rt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", it = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
501
- for (let e = 0; e < 64; e++) it[rt.charCodeAt(e)] = e;
502
- var at = (e) => {
500
+ var it = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", at = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
501
+ for (let e = 0; e < 64; e++) at[it.charCodeAt(e)] = e;
502
+ var k = (e) => {
503
503
  let t = e.length * .75, n = e.length, r, i = 0, a, o, s, c;
504
504
  e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
505
505
  let l = new ArrayBuffer(t), u = new Uint8Array(l);
506
- for (r = 0; r < n; r += 4) a = it[e.charCodeAt(r)], o = it[e.charCodeAt(r + 1)], s = it[e.charCodeAt(r + 2)], c = it[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
506
+ for (r = 0; r < n; r += 4) a = at[e.charCodeAt(r)], o = at[e.charCodeAt(r + 1)], s = at[e.charCodeAt(r + 2)], c = at[e.charCodeAt(r + 3)], u[i++] = a << 2 | o >> 4, u[i++] = (o & 15) << 4 | s >> 2, u[i++] = (s & 3) << 6 | c & 63;
507
507
  return l;
508
- }, A = typeof ArrayBuffer == "function", j = (e, t) => {
508
+ }, ot = typeof ArrayBuffer == "function", A = (e, t) => {
509
509
  if (typeof e != "string") return {
510
510
  type: "message",
511
- data: st(e, t)
511
+ data: ct(e, t)
512
512
  };
513
513
  let n = e.charAt(0);
514
514
  return n === "b" ? {
515
515
  type: "message",
516
- data: ot(e.substring(1), t)
517
- } : qe[n] ? e.length > 1 ? {
518
- type: qe[n],
516
+ data: st(e.substring(1), t)
517
+ } : Je[n] ? e.length > 1 ? {
518
+ type: Je[n],
519
519
  data: e.substring(1)
520
- } : { type: qe[n] } : Je;
521
- }, ot = (e, t) => A ? st(at(e), t) : {
520
+ } : { type: Je[n] } : Ye;
521
+ }, st = (e, t) => ot ? ct(k(e), t) : {
522
522
  base64: !0,
523
523
  data: e
524
- }, st = (e, t) => {
524
+ }, ct = (e, t) => {
525
525
  switch (t) {
526
526
  case "blob": return e instanceof Blob ? e : new Blob([e]);
527
527
  default: return e instanceof ArrayBuffer ? e : e.buffer;
528
528
  }
529
- }, ct = "", lt = (e, t) => {
529
+ }, lt = "", ut = (e, t) => {
530
530
  let n = e.length, r = Array(n), i = 0;
531
531
  e.forEach((e, a) => {
532
- Qe(e, !1, (e) => {
533
- r[a] = e, ++i === n && t(r.join(ct));
532
+ $e(e, !1, (e) => {
533
+ r[a] = e, ++i === n && t(r.join(lt));
534
534
  });
535
535
  });
536
- }, ut = (e, t) => {
537
- let n = e.split(ct), r = [];
536
+ }, dt = (e, t) => {
537
+ let n = e.split(lt), r = [];
538
538
  for (let e = 0; e < n.length; e++) {
539
- let i = j(n[e], t);
539
+ let i = A(n[e], t);
540
540
  if (r.push(i), i.type === "error") break;
541
541
  }
542
542
  return r;
543
543
  };
544
- function dt() {
544
+ function ft() {
545
545
  return new TransformStream({ transform(e, t) {
546
- nt(e, (n) => {
546
+ rt(e, (n) => {
547
547
  let r = n.length, i;
548
548
  if (r < 126) i = new Uint8Array(1), new DataView(i.buffer).setUint8(0, r);
549
549
  else if (r < 65536) {
@@ -559,44 +559,44 @@ function dt() {
559
559
  });
560
560
  } });
561
561
  }
562
- var ft;
563
- function pt(e) {
562
+ var pt;
563
+ function mt(e) {
564
564
  return e.reduce((e, t) => e + t.length, 0);
565
565
  }
566
- function mt(e, t) {
566
+ function ht(e, t) {
567
567
  if (e[0].length === t) return e.shift();
568
568
  let n = new Uint8Array(t), r = 0;
569
569
  for (let i = 0; i < t; i++) n[i] = e[0][r++], r === e[0].length && (e.shift(), r = 0);
570
570
  return e.length && r < e[0].length && (e[0] = e[0].slice(r)), n;
571
571
  }
572
- function ht(e, t) {
573
- ft ||= new TextDecoder();
572
+ function gt(e, t) {
573
+ pt ||= new TextDecoder();
574
574
  let n = [], r = 0, i = -1, a = !1;
575
575
  return new TransformStream({ transform(o, s) {
576
576
  for (n.push(o);;) {
577
577
  if (r === 0) {
578
- if (pt(n) < 1) break;
579
- let e = mt(n, 1);
578
+ if (mt(n) < 1) break;
579
+ let e = ht(n, 1);
580
580
  a = (e[0] & 128) == 128, i = e[0] & 127, r = i < 126 ? 3 : i === 126 ? 1 : 2;
581
581
  } else if (r === 1) {
582
- if (pt(n) < 2) break;
583
- let e = mt(n, 2);
582
+ if (mt(n) < 2) break;
583
+ let e = ht(n, 2);
584
584
  i = new DataView(e.buffer, e.byteOffset, e.length).getUint16(0), r = 3;
585
585
  } else if (r === 2) {
586
- if (pt(n) < 8) break;
587
- let e = mt(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
586
+ if (mt(n) < 8) break;
587
+ let e = ht(n, 8), t = new DataView(e.buffer, e.byteOffset, e.length), a = t.getUint32(0);
588
588
  if (a > 2 ** 21 - 1) {
589
- s.enqueue(Je);
589
+ s.enqueue(Ye);
590
590
  break;
591
591
  }
592
592
  i = a * 2 ** 32 + t.getUint32(4), r = 3;
593
593
  } else {
594
- if (pt(n) < i) break;
595
- let e = mt(n, i);
596
- s.enqueue(j(a ? e : ft.decode(e), t)), r = 0;
594
+ if (mt(n) < i) break;
595
+ let e = ht(n, i);
596
+ s.enqueue(A(a ? e : pt.decode(e), t)), r = 0;
597
597
  }
598
598
  if (i === 0 || i > e) {
599
- s.enqueue(Je);
599
+ s.enqueue(Ye);
600
600
  break;
601
601
  }
602
602
  }
@@ -604,21 +604,21 @@ function ht(e, t) {
604
604
  }
605
605
  //#endregion
606
606
  //#region node_modules/@socket.io/component-emitter/lib/esm/index.js
607
- function M(e) {
608
- if (e) return gt(e);
607
+ function j(e) {
608
+ if (e) return _t(e);
609
609
  }
610
- function gt(e) {
611
- for (var t in M.prototype) e[t] = M.prototype[t];
610
+ function _t(e) {
611
+ for (var t in j.prototype) e[t] = j.prototype[t];
612
612
  return e;
613
613
  }
614
- M.prototype.on = M.prototype.addEventListener = function(e, t) {
614
+ j.prototype.on = j.prototype.addEventListener = function(e, t) {
615
615
  return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this;
616
- }, M.prototype.once = function(e, t) {
616
+ }, j.prototype.once = function(e, t) {
617
617
  function n() {
618
618
  this.off(e, n), t.apply(this, arguments);
619
619
  }
620
620
  return n.fn = t, this.on(e, n), this;
621
- }, M.prototype.off = M.prototype.removeListener = M.prototype.removeAllListeners = M.prototype.removeEventListener = function(e, t) {
621
+ }, j.prototype.off = j.prototype.removeListener = j.prototype.removeAllListeners = j.prototype.removeEventListener = function(e, t) {
622
622
  if (this._callbacks = this._callbacks || {}, arguments.length == 0) return this._callbacks = {}, this;
623
623
  var n = this._callbacks["$" + e];
624
624
  if (!n) return this;
@@ -628,7 +628,7 @@ M.prototype.on = M.prototype.addEventListener = function(e, t) {
628
628
  break;
629
629
  }
630
630
  return n.length === 0 && delete this._callbacks["$" + e], this;
631
- }, M.prototype.emit = function(e) {
631
+ }, j.prototype.emit = function(e) {
632
632
  this._callbacks = this._callbacks || {};
633
633
  for (var t = Array(arguments.length - 1), n = this._callbacks["$" + e], r = 1; r < arguments.length; r++) t[r - 1] = arguments[r];
634
634
  if (n) {
@@ -636,43 +636,43 @@ M.prototype.on = M.prototype.addEventListener = function(e, t) {
636
636
  for (var r = 0, i = n.length; r < i; ++r) n[r].apply(this, t);
637
637
  }
638
638
  return this;
639
- }, M.prototype.emitReserved = M.prototype.emit, M.prototype.listeners = function(e) {
639
+ }, j.prototype.emitReserved = j.prototype.emit, j.prototype.listeners = function(e) {
640
640
  return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [];
641
- }, M.prototype.hasListeners = function(e) {
641
+ }, j.prototype.hasListeners = function(e) {
642
642
  return !!this.listeners(e).length;
643
643
  };
644
644
  //#endregion
645
645
  //#region node_modules/engine.io-client/build/esm/globals.js
646
- var _t = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), vt = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), yt = "arraybuffer";
646
+ var vt = typeof Promise == "function" && typeof Promise.resolve == "function" ? (e) => Promise.resolve().then(e) : (e, t) => t(e, 0), yt = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), bt = "arraybuffer";
647
647
  //#endregion
648
648
  //#region node_modules/engine.io-client/build/esm/util.js
649
- function bt(e, ...t) {
649
+ function xt(e, ...t) {
650
650
  return t.reduce((t, n) => (e.hasOwnProperty(n) && (t[n] = e[n]), t), {});
651
651
  }
652
- var xt = vt.setTimeout, St = vt.clearTimeout;
653
- function Ct(e, t) {
654
- t.useNativeTimers ? (e.setTimeoutFn = xt.bind(vt), e.clearTimeoutFn = St.bind(vt)) : (e.setTimeoutFn = vt.setTimeout.bind(vt), e.clearTimeoutFn = vt.clearTimeout.bind(vt));
655
- }
656
- var wt = 1.33;
657
- function Tt(e) {
658
- return typeof e == "string" ? Et(e) : Math.ceil((e.byteLength || e.size) * wt);
652
+ var St = yt.setTimeout, Ct = yt.clearTimeout;
653
+ function wt(e, t) {
654
+ t.useNativeTimers ? (e.setTimeoutFn = St.bind(yt), e.clearTimeoutFn = Ct.bind(yt)) : (e.setTimeoutFn = yt.setTimeout.bind(yt), e.clearTimeoutFn = yt.clearTimeout.bind(yt));
659
655
  }
656
+ var Tt = 1.33;
660
657
  function Et(e) {
658
+ return typeof e == "string" ? Dt(e) : Math.ceil((e.byteLength || e.size) * Tt);
659
+ }
660
+ function Dt(e) {
661
661
  let t = 0, n = 0;
662
662
  for (let r = 0, i = e.length; r < i; r++) t = e.charCodeAt(r), t < 128 ? n += 1 : t < 2048 ? n += 2 : t < 55296 || t >= 57344 ? n += 3 : (r++, n += 4);
663
663
  return n;
664
664
  }
665
- function Dt() {
665
+ function Ot() {
666
666
  return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
667
667
  }
668
668
  //#endregion
669
669
  //#region node_modules/engine.io-client/build/esm/contrib/parseqs.js
670
- function Ot(e) {
670
+ function kt(e) {
671
671
  let t = "";
672
672
  for (let n in e) e.hasOwnProperty(n) && (t.length && (t += "&"), t += encodeURIComponent(n) + "=" + encodeURIComponent(e[n]));
673
673
  return t;
674
674
  }
675
- function kt(e) {
675
+ function At(e) {
676
676
  let t = {}, n = e.split("&");
677
677
  for (let e = 0, r = n.length; e < r; e++) {
678
678
  let r = n[e].split("=");
@@ -682,16 +682,16 @@ function kt(e) {
682
682
  }
683
683
  //#endregion
684
684
  //#region node_modules/engine.io-client/build/esm/transport.js
685
- var At = class extends Error {
685
+ var jt = class extends Error {
686
686
  constructor(e, t, n) {
687
687
  super(e), this.description = t, this.context = n, this.type = "TransportError";
688
688
  }
689
- }, jt = class extends M {
689
+ }, Mt = class extends j {
690
690
  constructor(e) {
691
- super(), this.writable = !1, Ct(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
691
+ super(), this.writable = !1, wt(this, e), this.opts = e, this.query = e.query, this.socket = e.socket, this.supportsBinary = !e.forceBase64;
692
692
  }
693
693
  onError(e, t, n) {
694
- return super.emitReserved("error", new At(e, t, n)), this;
694
+ return super.emitReserved("error", new jt(e, t, n)), this;
695
695
  }
696
696
  open() {
697
697
  return this.readyState = "opening", this.doOpen(), this;
@@ -706,7 +706,7 @@ var At = class extends Error {
706
706
  this.readyState = "open", this.writable = !0, super.emitReserved("open");
707
707
  }
708
708
  onData(e) {
709
- let t = j(e, this.socket.binaryType);
709
+ let t = A(e, this.socket.binaryType);
710
710
  this.onPacket(t);
711
711
  }
712
712
  onPacket(e) {
@@ -727,10 +727,10 @@ var At = class extends Error {
727
727
  return this.opts.port && (this.opts.secure && Number(this.opts.port) !== 443 || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
728
728
  }
729
729
  _query(e) {
730
- let t = Ot(e);
730
+ let t = kt(e);
731
731
  return t.length ? "?" + t : "";
732
732
  }
733
- }, Mt = class extends jt {
733
+ }, Nt = class extends Mt {
734
734
  constructor() {
735
735
  super(...arguments), this._polling = !1;
736
736
  }
@@ -758,7 +758,7 @@ var At = class extends Error {
758
758
  this._polling = !0, this.doPoll(), this.emitReserved("poll");
759
759
  }
760
760
  onData(e) {
761
- ut(e, this.socket.binaryType).forEach((e) => {
761
+ dt(e, this.socket.binaryType).forEach((e) => {
762
762
  if (this.readyState === "opening" && e.type === "open" && this.onOpen(), e.type === "close") return this.onClose({ description: "transport closed by the server" }), !1;
763
763
  this.onPacket(e);
764
764
  }), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
@@ -770,7 +770,7 @@ var At = class extends Error {
770
770
  this.readyState === "open" ? e() : this.once("open", e);
771
771
  }
772
772
  write(e) {
773
- this.writable = !1, lt(e, (e) => {
773
+ this.writable = !1, ut(e, (e) => {
774
774
  this.doWrite(e, () => {
775
775
  this.writable = !0, this.emitReserved("drain");
776
776
  });
@@ -778,17 +778,17 @@ var At = class extends Error {
778
778
  }
779
779
  uri() {
780
780
  let e = this.opts.secure ? "https" : "http", t = this.query || {};
781
- return !1 !== this.opts.timestampRequests && (t[this.opts.timestampParam] = Dt()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
781
+ return !1 !== this.opts.timestampRequests && (t[this.opts.timestampParam] = Ot()), !this.supportsBinary && !t.sid && (t.b64 = 1), this.createUri(e, t);
782
782
  }
783
- }, Nt = !1;
783
+ }, Pt = !1;
784
784
  try {
785
- Nt = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
785
+ Pt = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
786
786
  } catch {}
787
- var Pt = Nt;
787
+ var Ft = Pt;
788
788
  //#endregion
789
789
  //#region node_modules/engine.io-client/build/esm/transports/polling-xhr.js
790
- function Ft() {}
791
- var It = class extends Mt {
790
+ function It() {}
791
+ var Lt = class extends Nt {
792
792
  constructor(e) {
793
793
  if (super(e), typeof location < "u") {
794
794
  let t = location.protocol === "https:", n = location.port;
@@ -810,13 +810,13 @@ var It = class extends Mt {
810
810
  this.onError("xhr poll error", e, t);
811
811
  }), this.pollXhr = e;
812
812
  }
813
- }, Lt = class e extends M {
813
+ }, Rt = class e extends j {
814
814
  constructor(e, t, n) {
815
- super(), this.createRequest = e, Ct(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
815
+ super(), this.createRequest = e, wt(this, n), this._opts = n, this._method = n.method || "GET", this._uri = t, this._data = n.data === void 0 ? null : n.data, this._create();
816
816
  }
817
817
  _create() {
818
818
  var t;
819
- let n = bt(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
819
+ let n = xt(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
820
820
  n.xdomain = !!this._opts.xd;
821
821
  let r = this._xhr = this.createRequest(n);
822
822
  try {
@@ -852,7 +852,7 @@ var It = class extends Mt {
852
852
  }
853
853
  _cleanup(t) {
854
854
  if (!(this._xhr === void 0 || this._xhr === null)) {
855
- if (this._xhr.onreadystatechange = Ft, t) try {
855
+ if (this._xhr.onreadystatechange = It, t) try {
856
856
  this._xhr.abort();
857
857
  } catch {}
858
858
  typeof document < "u" && delete e.requests[this._index], this._xhr = null;
@@ -866,46 +866,46 @@ var It = class extends Mt {
866
866
  this._cleanup();
867
867
  }
868
868
  };
869
- if (Lt.requestsCount = 0, Lt.requests = {}, typeof document < "u") {
870
- if (typeof attachEvent == "function") attachEvent("onunload", Rt);
869
+ if (Rt.requestsCount = 0, Rt.requests = {}, typeof document < "u") {
870
+ if (typeof attachEvent == "function") attachEvent("onunload", zt);
871
871
  else if (typeof addEventListener == "function") {
872
- let e = "onpagehide" in vt ? "pagehide" : "unload";
873
- addEventListener(e, Rt, !1);
872
+ let e = "onpagehide" in yt ? "pagehide" : "unload";
873
+ addEventListener(e, zt, !1);
874
874
  }
875
875
  }
876
- function Rt() {
877
- for (let e in Lt.requests) Lt.requests.hasOwnProperty(e) && Lt.requests[e].abort();
876
+ function zt() {
877
+ for (let e in Rt.requests) Rt.requests.hasOwnProperty(e) && Rt.requests[e].abort();
878
878
  }
879
- var zt = (function() {
880
- let e = Vt({ xdomain: !1 });
879
+ var Bt = (function() {
880
+ let e = Ht({ xdomain: !1 });
881
881
  return e && e.responseType !== null;
882
- })(), Bt = class extends It {
882
+ })(), Vt = class extends Lt {
883
883
  constructor(e) {
884
884
  super(e);
885
885
  let t = e && e.forceBase64;
886
- this.supportsBinary = zt && !t;
886
+ this.supportsBinary = Bt && !t;
887
887
  }
888
888
  request(e = {}) {
889
- return Object.assign(e, { xd: this.xd }, this.opts), new Lt(Vt, this.uri(), e);
889
+ return Object.assign(e, { xd: this.xd }, this.opts), new Rt(Ht, this.uri(), e);
890
890
  }
891
891
  };
892
- function Vt(e) {
892
+ function Ht(e) {
893
893
  let t = e.xdomain;
894
894
  try {
895
- if (typeof XMLHttpRequest < "u" && (!t || Pt)) return new XMLHttpRequest();
895
+ if (typeof XMLHttpRequest < "u" && (!t || Ft)) return new XMLHttpRequest();
896
896
  } catch {}
897
897
  if (!t) try {
898
- return new vt[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
898
+ return new yt[["Active", "Object"].join("X")]("Microsoft.XMLHTTP");
899
899
  } catch {}
900
900
  }
901
901
  //#endregion
902
902
  //#region node_modules/engine.io-client/build/esm/transports/websocket.js
903
- var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", Ut = class extends jt {
903
+ var Ut = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative", Wt = class extends Mt {
904
904
  get name() {
905
905
  return "websocket";
906
906
  }
907
907
  doOpen() {
908
- let e = this.uri(), t = this.opts.protocols, n = Ht ? {} : bt(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
908
+ let e = this.uri(), t = this.opts.protocols, n = Ut ? {} : xt(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
909
909
  this.opts.extraHeaders && (n.headers = this.opts.extraHeaders);
910
910
  try {
911
911
  this.ws = this.createSocket(e, t, n);
@@ -926,11 +926,11 @@ var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navig
926
926
  this.writable = !1;
927
927
  for (let t = 0; t < e.length; t++) {
928
928
  let n = e[t], r = t === e.length - 1;
929
- Qe(n, this.supportsBinary, (e) => {
929
+ $e(n, this.supportsBinary, (e) => {
930
930
  try {
931
931
  this.doWrite(n, e);
932
932
  } catch {}
933
- r && _t(() => {
933
+ r && vt(() => {
934
934
  this.writable = !0, this.emitReserved("drain");
935
935
  }, this.setTimeoutFn);
936
936
  });
@@ -941,18 +941,18 @@ var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navig
941
941
  }
942
942
  uri() {
943
943
  let e = this.opts.secure ? "wss" : "ws", t = this.query || {};
944
- return this.opts.timestampRequests && (t[this.opts.timestampParam] = Dt()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
944
+ return this.opts.timestampRequests && (t[this.opts.timestampParam] = Ot()), this.supportsBinary || (t.b64 = 1), this.createUri(e, t);
945
945
  }
946
- }, Wt = vt.WebSocket || vt.MozWebSocket, Gt = {
947
- websocket: class extends Ut {
946
+ }, Gt = yt.WebSocket || yt.MozWebSocket, Kt = {
947
+ websocket: class extends Wt {
948
948
  createSocket(e, t, n) {
949
- return Ht ? new Wt(e, t, n) : t ? new Wt(e, t) : new Wt(e);
949
+ return Ut ? new Gt(e, t, n) : t ? new Gt(e, t) : new Gt(e);
950
950
  }
951
951
  doWrite(e, t) {
952
952
  this.ws.send(t);
953
953
  }
954
954
  },
955
- webtransport: class extends jt {
955
+ webtransport: class extends Mt {
956
956
  get name() {
957
957
  return "webtransport";
958
958
  }
@@ -968,7 +968,7 @@ var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navig
968
968
  this.onError("webtransport error", e);
969
969
  }), this._transport.ready.then(() => {
970
970
  this._transport.createBidirectionalStream().then((e) => {
971
- let t = ht(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = dt();
971
+ let t = gt(2 ** 53 - 1, this.socket.binaryType), n = e.readable.pipeThrough(t).getReader(), r = ft();
972
972
  r.readable.pipeTo(e.writable), this._writer = r.writable.getWriter();
973
973
  let i = () => {
974
974
  n.read().then(({ done: e, value: t }) => {
@@ -986,7 +986,7 @@ var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navig
986
986
  for (let t = 0; t < e.length; t++) {
987
987
  let n = e[t], r = t === e.length - 1;
988
988
  this._writer.write(n).then(() => {
989
- r && _t(() => {
989
+ r && vt(() => {
990
990
  this.writable = !0, this.emitReserved("drain");
991
991
  }, this.setTimeoutFn);
992
992
  });
@@ -997,8 +997,8 @@ var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navig
997
997
  (e = this._transport) == null || e.close();
998
998
  }
999
999
  },
1000
- polling: Bt
1001
- }, Kt = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, qt = [
1000
+ polling: Vt
1001
+ }, qt = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Jt = [
1002
1002
  "source",
1003
1003
  "protocol",
1004
1004
  "authority",
@@ -1014,19 +1014,19 @@ var Ht = typeof navigator < "u" && typeof navigator.product == "string" && navig
1014
1014
  "query",
1015
1015
  "anchor"
1016
1016
  ];
1017
- function Jt(e) {
1017
+ function Yt(e) {
1018
1018
  if (e.length > 8e3) throw "URI too long";
1019
1019
  let t = e, n = e.indexOf("["), r = e.indexOf("]");
1020
1020
  n != -1 && r != -1 && (e = e.substring(0, n) + e.substring(n, r).replace(/:/g, ";") + e.substring(r, e.length));
1021
- let i = Kt.exec(e || ""), a = {}, o = 14;
1022
- for (; o--;) a[qt[o]] = i[o] || "";
1023
- return n != -1 && r != -1 && (a.source = t, a.host = a.host.substring(1, a.host.length - 1).replace(/;/g, ":"), a.authority = a.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !0), a.pathNames = Yt(a, a.path), a.queryKey = Xt(a, a.query), a;
1021
+ let i = qt.exec(e || ""), a = {}, o = 14;
1022
+ for (; o--;) a[Jt[o]] = i[o] || "";
1023
+ return n != -1 && r != -1 && (a.source = t, a.host = a.host.substring(1, a.host.length - 1).replace(/;/g, ":"), a.authority = a.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), a.ipv6uri = !0), a.pathNames = Xt(a, a.path), a.queryKey = Zt(a, a.query), a;
1024
1024
  }
1025
- function Yt(e, t) {
1025
+ function Xt(e, t) {
1026
1026
  let n = t.replace(/\/{2,9}/g, "/").split("/");
1027
1027
  return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
1028
1028
  }
1029
- function Xt(e, t) {
1029
+ function Zt(e, t) {
1030
1030
  let n = {};
1031
1031
  return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(e, t, r) {
1032
1032
  t && (n[t] = r);
@@ -1034,17 +1034,17 @@ function Xt(e, t) {
1034
1034
  }
1035
1035
  //#endregion
1036
1036
  //#region node_modules/engine.io-client/build/esm/socket.js
1037
- var Zt = typeof addEventListener == "function" && typeof removeEventListener == "function", Qt = [];
1038
- Zt && addEventListener("offline", () => {
1039
- Qt.forEach((e) => e());
1037
+ var Qt = typeof addEventListener == "function" && typeof removeEventListener == "function", $t = [];
1038
+ Qt && addEventListener("offline", () => {
1039
+ $t.forEach((e) => e());
1040
1040
  }, !1);
1041
- var $t = class e extends M {
1041
+ var en = class e extends j {
1042
1042
  constructor(e, t) {
1043
- if (super(), this.binaryType = yt, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
1044
- let n = Jt(e);
1043
+ if (super(), this.binaryType = bt, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = Infinity, e && typeof e == "object" && (t = e, e = null), e) {
1044
+ let n = Yt(e);
1045
1045
  t.hostname = n.host, t.secure = n.protocol === "https" || n.protocol === "wss", t.port = n.port, n.query && (t.query = n.query);
1046
- } else t.host && (t.hostname = Jt(t.host).host);
1047
- Ct(this, t), this.secure = t.secure == null ? typeof location < "u" && location.protocol === "https:" : t.secure, t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, t.transports.forEach((e) => {
1046
+ } else t.host && (t.hostname = Yt(t.host).host);
1047
+ wt(this, t), this.secure = t.secure == null ? typeof location < "u" && location.protocol === "https:" : t.secure, t.hostname && !t.port && (t.port = this.secure ? "443" : "80"), this.hostname = t.hostname || (typeof location < "u" ? location.hostname : "localhost"), this.port = t.port || (typeof location < "u" && location.port ? location.port : this.secure ? "443" : "80"), this.transports = [], this._transportsByName = {}, t.transports.forEach((e) => {
1048
1048
  let t = e.prototype.name;
1049
1049
  this.transports.push(t), this._transportsByName[t] = e;
1050
1050
  }), this.opts = Object.assign({
@@ -1059,11 +1059,11 @@ var $t = class e extends M {
1059
1059
  perMessageDeflate: { threshold: 1024 },
1060
1060
  transportOptions: {},
1061
1061
  closeOnBeforeunload: !1
1062
- }, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = kt(this.opts.query)), Zt && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
1062
+ }, t), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = At(this.opts.query)), Qt && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
1063
1063
  this.transport && (this.transport.removeAllListeners(), this.transport.close());
1064
1064
  }, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
1065
1065
  this._onClose("transport close", { description: "network connection lost" });
1066
- }, Qt.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
1066
+ }, $t.push(this._offlineEventListener))), this.opts.withCredentials && (this._cookieJar = void 0), this._open();
1067
1067
  }
1068
1068
  createTransport(e) {
1069
1069
  let t = Object.assign({}, this.opts.query);
@@ -1136,7 +1136,7 @@ var $t = class e extends M {
1136
1136
  let e = 1;
1137
1137
  for (let t = 0; t < this.writeBuffer.length; t++) {
1138
1138
  let n = this.writeBuffer[t].data;
1139
- if (n && (e += Tt(n)), t > 0 && e > this._maxPayload) return this.writeBuffer.slice(0, t);
1139
+ if (n && (e += Et(n)), t > 0 && e > this._maxPayload) return this.writeBuffer.slice(0, t);
1140
1140
  e += 2;
1141
1141
  }
1142
1142
  return this.writeBuffer;
@@ -1144,7 +1144,7 @@ var $t = class e extends M {
1144
1144
  _hasPingExpired() {
1145
1145
  if (!this._pingTimeoutTime) return !0;
1146
1146
  let e = Date.now() > this._pingTimeoutTime;
1147
- return e && (this._pingTimeoutTime = 0, _t(() => {
1147
+ return e && (this._pingTimeoutTime = 0, vt(() => {
1148
1148
  this._onClose("ping timeout");
1149
1149
  }, this.setTimeoutFn)), e;
1150
1150
  }
@@ -1182,16 +1182,16 @@ var $t = class e extends M {
1182
1182
  }
1183
1183
  _onClose(e, t) {
1184
1184
  if (this.readyState === "opening" || this.readyState === "open" || this.readyState === "closing") {
1185
- if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), Zt && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
1186
- let e = Qt.indexOf(this._offlineEventListener);
1187
- e !== -1 && Qt.splice(e, 1);
1185
+ if (this.clearTimeoutFn(this._pingTimeoutTimer), this.transport.removeAllListeners("close"), this.transport.close(), this.transport.removeAllListeners(), Qt && (this._beforeunloadEventListener && removeEventListener("beforeunload", this._beforeunloadEventListener, !1), this._offlineEventListener)) {
1186
+ let e = $t.indexOf(this._offlineEventListener);
1187
+ e !== -1 && $t.splice(e, 1);
1188
1188
  }
1189
1189
  this.readyState = "closed", this.id = null, this.emitReserved("close", e, t), this.writeBuffer = [], this._prevBufferLen = 0;
1190
1190
  }
1191
1191
  }
1192
1192
  };
1193
- $t.protocol = 4;
1194
- var en = class extends $t {
1193
+ en.protocol = 4;
1194
+ var tn = class extends en {
1195
1195
  constructor() {
1196
1196
  super(...arguments), this._upgrades = [];
1197
1197
  }
@@ -1200,7 +1200,7 @@ var en = class extends $t {
1200
1200
  }
1201
1201
  _probe(e) {
1202
1202
  let t = this.createTransport(e), n = !1;
1203
- $t.priorWebsocketSuccess = !1;
1203
+ en.priorWebsocketSuccess = !1;
1204
1204
  let r = () => {
1205
1205
  n || (t.send([{
1206
1206
  type: "ping",
@@ -1208,7 +1208,7 @@ var en = class extends $t {
1208
1208
  }]), t.once("packet", (e) => {
1209
1209
  if (!n) if (e.type === "pong" && e.data === "probe") {
1210
1210
  if (this.upgrading = !0, this.emitReserved("upgrading", t), !t) return;
1211
- $t.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
1211
+ en.priorWebsocketSuccess = t.name === "websocket", this.transport.pause(() => {
1212
1212
  n || this.readyState !== "closed" && (l(), this.setTransport(t), t.send([{ type: "upgrade" }]), this.emitReserved("upgrade", t), t = null, this.upgrading = !1, this.flush());
1213
1213
  });
1214
1214
  } else {
@@ -1248,54 +1248,54 @@ var en = class extends $t {
1248
1248
  for (let n = 0; n < e.length; n++) ~this.transports.indexOf(e[n]) && t.push(e[n]);
1249
1249
  return t;
1250
1250
  }
1251
- }, tn = class extends en {
1251
+ }, nn = class extends tn {
1252
1252
  constructor(e, t = {}) {
1253
1253
  let n = typeof e == "object" ? e : t;
1254
1254
  (!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || [
1255
1255
  "polling",
1256
1256
  "websocket",
1257
1257
  "webtransport"
1258
- ]).map((e) => Gt[e]).filter((e) => !!e)), super(e, n);
1258
+ ]).map((e) => Kt[e]).filter((e) => !!e)), super(e, n);
1259
1259
  }
1260
1260
  };
1261
- tn.protocol;
1261
+ nn.protocol;
1262
1262
  //#endregion
1263
1263
  //#region node_modules/socket.io-client/build/esm/url.js
1264
- function nn(e, t = "", n) {
1264
+ function rn(e, t = "", n) {
1265
1265
  let r = e;
1266
- n ||= typeof location < "u" && location, e ??= n.protocol + "//" + n.host, typeof e == "string" && (e.charAt(0) === "/" && (e = e.charAt(1) === "/" ? n.protocol + e : n.host + e), /^(https?|wss?):\/\//.test(e) || (e = n === void 0 ? "https://" + e : n.protocol + "//" + e), r = Jt(e)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
1266
+ n ||= typeof location < "u" && location, e ??= n.protocol + "//" + n.host, typeof e == "string" && (e.charAt(0) === "/" && (e = e.charAt(1) === "/" ? n.protocol + e : n.host + e), /^(https?|wss?):\/\//.test(e) || (e = n === void 0 ? "https://" + e : n.protocol + "//" + e), r = Yt(e)), r.port || (/^(http|ws)$/.test(r.protocol) ? r.port = "80" : /^(http|ws)s$/.test(r.protocol) && (r.port = "443")), r.path = r.path || "/";
1267
1267
  let i = r.host.indexOf(":") === -1 ? r.host : "[" + r.host + "]";
1268
1268
  return r.id = r.protocol + "://" + i + ":" + r.port + t, r.href = r.protocol + "://" + i + (n && n.port === r.port ? "" : ":" + r.port), r;
1269
1269
  }
1270
1270
  //#endregion
1271
1271
  //#region node_modules/socket.io-parser/build/esm/is-binary.js
1272
- var rn = typeof ArrayBuffer == "function", an = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, on = Object.prototype.toString, sn = typeof Blob == "function" || typeof Blob < "u" && on.call(Blob) === "[object BlobConstructor]", cn = typeof File == "function" || typeof File < "u" && on.call(File) === "[object FileConstructor]";
1273
- function ln(e) {
1274
- return rn && (e instanceof ArrayBuffer || an(e)) || sn && e instanceof Blob || cn && e instanceof File;
1272
+ var an = typeof ArrayBuffer == "function", on = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, sn = Object.prototype.toString, cn = typeof Blob == "function" || typeof Blob < "u" && sn.call(Blob) === "[object BlobConstructor]", ln = typeof File == "function" || typeof File < "u" && sn.call(File) === "[object FileConstructor]";
1273
+ function un(e) {
1274
+ return an && (e instanceof ArrayBuffer || on(e)) || cn && e instanceof Blob || ln && e instanceof File;
1275
1275
  }
1276
- function un(e, t) {
1276
+ function dn(e, t) {
1277
1277
  if (!e || typeof e != "object") return !1;
1278
1278
  if (Array.isArray(e)) {
1279
- for (let t = 0, n = e.length; t < n; t++) if (un(e[t])) return !0;
1279
+ for (let t = 0, n = e.length; t < n; t++) if (dn(e[t])) return !0;
1280
1280
  return !1;
1281
1281
  }
1282
- if (ln(e)) return !0;
1283
- if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return un(e.toJSON(), !0);
1284
- for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && un(e[t])) return !0;
1282
+ if (un(e)) return !0;
1283
+ if (e.toJSON && typeof e.toJSON == "function" && arguments.length === 1) return dn(e.toJSON(), !0);
1284
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && dn(e[t])) return !0;
1285
1285
  return !1;
1286
1286
  }
1287
1287
  //#endregion
1288
1288
  //#region node_modules/socket.io-parser/build/esm/binary.js
1289
- function dn(e) {
1289
+ function fn(e) {
1290
1290
  let t = [], n = e.data, r = e;
1291
- return r.data = fn(n, t), r.attachments = t.length, {
1291
+ return r.data = pn(n, t), r.attachments = t.length, {
1292
1292
  packet: r,
1293
1293
  buffers: t
1294
1294
  };
1295
1295
  }
1296
- function fn(e, t) {
1296
+ function pn(e, t) {
1297
1297
  if (!e) return e;
1298
- if (ln(e)) {
1298
+ if (un(e)) {
1299
1299
  let n = {
1300
1300
  _placeholder: !0,
1301
1301
  num: t.length
@@ -1303,53 +1303,53 @@ function fn(e, t) {
1303
1303
  return t.push(e), n;
1304
1304
  } else if (Array.isArray(e)) {
1305
1305
  let n = Array(e.length);
1306
- for (let r = 0; r < e.length; r++) n[r] = fn(e[r], t);
1306
+ for (let r = 0; r < e.length; r++) n[r] = pn(e[r], t);
1307
1307
  return n;
1308
1308
  } else if (typeof e == "object" && !(e instanceof Date)) {
1309
1309
  let n = {};
1310
- for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = fn(e[r], t));
1310
+ for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = pn(e[r], t));
1311
1311
  return n;
1312
1312
  }
1313
1313
  return e;
1314
1314
  }
1315
- function pn(e, t) {
1316
- return e.data = mn(e.data, t), delete e.attachments, e;
1317
- }
1318
1315
  function mn(e, t) {
1316
+ return e.data = hn(e.data, t), delete e.attachments, e;
1317
+ }
1318
+ function hn(e, t) {
1319
1319
  if (!e) return e;
1320
1320
  if (e && e._placeholder === !0) {
1321
1321
  if (typeof e.num == "number" && e.num >= 0 && e.num < t.length) return t[e.num];
1322
1322
  throw Error("illegal attachments");
1323
- } else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = mn(e[n], t);
1324
- else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = mn(e[n], t));
1323
+ } else if (Array.isArray(e)) for (let n = 0; n < e.length; n++) e[n] = hn(e[n], t);
1324
+ else if (typeof e == "object") for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (e[n] = hn(e[n], t));
1325
1325
  return e;
1326
1326
  }
1327
1327
  //#endregion
1328
1328
  //#region node_modules/socket.io-parser/build/esm/index.js
1329
- var hn = /* @__PURE__ */ C({
1330
- Decoder: () => vn,
1331
- Encoder: () => _n,
1332
- PacketType: () => N,
1333
- isPacketValid: () => Tn,
1329
+ var gn = /* @__PURE__ */ C({
1330
+ Decoder: () => yn,
1331
+ Encoder: () => vn,
1332
+ PacketType: () => M,
1333
+ isPacketValid: () => En,
1334
1334
  protocol: () => 5
1335
- }), gn = [
1335
+ }), _n = [
1336
1336
  "connect",
1337
1337
  "connect_error",
1338
1338
  "disconnect",
1339
1339
  "disconnecting",
1340
1340
  "newListener",
1341
1341
  "removeListener"
1342
- ], N;
1342
+ ], M;
1343
1343
  (function(e) {
1344
1344
  e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
1345
- })(N ||= {});
1346
- var _n = class {
1345
+ })(M ||= {});
1346
+ var vn = class {
1347
1347
  constructor(e) {
1348
1348
  this.replacer = e;
1349
1349
  }
1350
1350
  encode(e) {
1351
- return (e.type === N.EVENT || e.type === N.ACK) && un(e) ? this.encodeAsBinary({
1352
- type: e.type === N.EVENT ? N.BINARY_EVENT : N.BINARY_ACK,
1351
+ return (e.type === M.EVENT || e.type === M.ACK) && dn(e) ? this.encodeAsBinary({
1352
+ type: e.type === M.EVENT ? M.BINARY_EVENT : M.BINARY_ACK,
1353
1353
  nsp: e.nsp,
1354
1354
  data: e.data,
1355
1355
  id: e.id
@@ -1357,13 +1357,13 @@ var _n = class {
1357
1357
  }
1358
1358
  encodeAsString(e) {
1359
1359
  let t = "" + e.type;
1360
- return (e.type === N.BINARY_EVENT || e.type === N.BINARY_ACK) && (t += e.attachments + "-"), e.nsp && e.nsp !== "/" && (t += e.nsp + ","), e.id != null && (t += e.id), e.data != null && (t += JSON.stringify(e.data, this.replacer)), t;
1360
+ return (e.type === M.BINARY_EVENT || e.type === M.BINARY_ACK) && (t += e.attachments + "-"), e.nsp && e.nsp !== "/" && (t += e.nsp + ","), e.id != null && (t += e.id), e.data != null && (t += JSON.stringify(e.data, this.replacer)), t;
1361
1361
  }
1362
1362
  encodeAsBinary(e) {
1363
- let t = dn(e), n = this.encodeAsString(t.packet), r = t.buffers;
1363
+ let t = fn(e), n = this.encodeAsString(t.packet), r = t.buffers;
1364
1364
  return r.unshift(n), r;
1365
1365
  }
1366
- }, vn = class e extends M {
1366
+ }, yn = class e extends j {
1367
1367
  constructor(e) {
1368
1368
  super(), this.opts = Object.assign({
1369
1369
  reviver: void 0,
@@ -1375,22 +1375,22 @@ var _n = class {
1375
1375
  if (typeof e == "string") {
1376
1376
  if (this.reconstructor) throw Error("got plaintext data when reconstructing a packet");
1377
1377
  t = this.decodeString(e);
1378
- let n = t.type === N.BINARY_EVENT;
1379
- n || t.type === N.BINARY_ACK ? (t.type = n ? N.EVENT : N.ACK, this.reconstructor = new yn(t), t.attachments === 0 && super.emitReserved("decoded", t)) : super.emitReserved("decoded", t);
1380
- } else if (ln(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
1378
+ let n = t.type === M.BINARY_EVENT;
1379
+ n || t.type === M.BINARY_ACK ? (t.type = n ? M.EVENT : M.ACK, this.reconstructor = new bn(t), t.attachments === 0 && super.emitReserved("decoded", t)) : super.emitReserved("decoded", t);
1380
+ } else if (un(e) || e.base64) if (this.reconstructor) t = this.reconstructor.takeBinaryData(e), t && (this.reconstructor = null, super.emitReserved("decoded", t));
1381
1381
  else throw Error("got binary data when not reconstructing a packet");
1382
1382
  else throw Error("Unknown type: " + e);
1383
1383
  }
1384
1384
  decodeString(t) {
1385
1385
  let n = 0, r = { type: Number(t.charAt(0)) };
1386
- if (N[r.type] === void 0) throw Error("unknown packet type " + r.type);
1387
- if (r.type === N.BINARY_EVENT || r.type === N.BINARY_ACK) {
1386
+ if (M[r.type] === void 0) throw Error("unknown packet type " + r.type);
1387
+ if (r.type === M.BINARY_EVENT || r.type === M.BINARY_ACK) {
1388
1388
  let e = n + 1;
1389
1389
  for (; t.charAt(++n) !== "-" && n != t.length;);
1390
1390
  let i = t.substring(e, n);
1391
1391
  if (i != Number(i) || t.charAt(n) !== "-") throw Error("Illegal attachments");
1392
1392
  let a = Number(i);
1393
- if (!xn(a) || a < 0) throw Error("Illegal attachments");
1393
+ if (!Sn(a) || a < 0) throw Error("Illegal attachments");
1394
1394
  if (a > this.opts.maxAttachments) throw Error("too many attachments");
1395
1395
  r.attachments = a;
1396
1396
  }
@@ -1428,25 +1428,25 @@ var _n = class {
1428
1428
  }
1429
1429
  static isPayloadValid(e, t) {
1430
1430
  switch (e) {
1431
- case N.CONNECT: return Cn(t);
1432
- case N.DISCONNECT: return t === void 0;
1433
- case N.CONNECT_ERROR: return typeof t == "string" || Cn(t);
1434
- case N.EVENT:
1435
- case N.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && gn.indexOf(t[0]) === -1);
1436
- case N.ACK:
1437
- case N.BINARY_ACK: return Array.isArray(t);
1431
+ case M.CONNECT: return wn(t);
1432
+ case M.DISCONNECT: return t === void 0;
1433
+ case M.CONNECT_ERROR: return typeof t == "string" || wn(t);
1434
+ case M.EVENT:
1435
+ case M.BINARY_EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && _n.indexOf(t[0]) === -1);
1436
+ case M.ACK:
1437
+ case M.BINARY_ACK: return Array.isArray(t);
1438
1438
  }
1439
1439
  }
1440
1440
  destroy() {
1441
1441
  this.reconstructor &&= (this.reconstructor.finishedReconstruction(), null);
1442
1442
  }
1443
- }, yn = class {
1443
+ }, bn = class {
1444
1444
  constructor(e) {
1445
1445
  this.packet = e, this.buffers = [], this.reconPack = e;
1446
1446
  }
1447
1447
  takeBinaryData(e) {
1448
1448
  if (this.buffers.push(e), this.buffers.length === this.reconPack.attachments) {
1449
- let e = pn(this.reconPack, this.buffers);
1449
+ let e = mn(this.reconPack, this.buffers);
1450
1450
  return this.finishedReconstruction(), e;
1451
1451
  }
1452
1452
  return null;
@@ -1455,48 +1455,48 @@ var _n = class {
1455
1455
  this.reconPack = null, this.buffers = [];
1456
1456
  }
1457
1457
  };
1458
- function bn(e) {
1458
+ function xn(e) {
1459
1459
  return typeof e == "string";
1460
1460
  }
1461
- var xn = Number.isInteger || function(e) {
1461
+ var Sn = Number.isInteger || function(e) {
1462
1462
  return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
1463
1463
  };
1464
- function Sn(e) {
1465
- return e === void 0 || xn(e);
1466
- }
1467
1464
  function Cn(e) {
1465
+ return e === void 0 || Sn(e);
1466
+ }
1467
+ function wn(e) {
1468
1468
  return Object.prototype.toString.call(e) === "[object Object]";
1469
1469
  }
1470
- function wn(e, t) {
1470
+ function Tn(e, t) {
1471
1471
  switch (e) {
1472
- case N.CONNECT: return t === void 0 || Cn(t);
1473
- case N.DISCONNECT: return t === void 0;
1474
- case N.EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && gn.indexOf(t[0]) === -1);
1475
- case N.ACK: return Array.isArray(t);
1476
- case N.CONNECT_ERROR: return typeof t == "string" || Cn(t);
1472
+ case M.CONNECT: return t === void 0 || wn(t);
1473
+ case M.DISCONNECT: return t === void 0;
1474
+ case M.EVENT: return Array.isArray(t) && (typeof t[0] == "number" || typeof t[0] == "string" && _n.indexOf(t[0]) === -1);
1475
+ case M.ACK: return Array.isArray(t);
1476
+ case M.CONNECT_ERROR: return typeof t == "string" || wn(t);
1477
1477
  default: return !1;
1478
1478
  }
1479
1479
  }
1480
- function Tn(e) {
1481
- return bn(e.nsp) && Sn(e.id) && wn(e.type, e.data);
1480
+ function En(e) {
1481
+ return xn(e.nsp) && Cn(e.id) && Tn(e.type, e.data);
1482
1482
  }
1483
1483
  //#endregion
1484
1484
  //#region node_modules/socket.io-client/build/esm/on.js
1485
- function En(e, t, n) {
1485
+ function Dn(e, t, n) {
1486
1486
  return e.on(t, n), function() {
1487
1487
  e.off(t, n);
1488
1488
  };
1489
1489
  }
1490
1490
  //#endregion
1491
1491
  //#region node_modules/socket.io-client/build/esm/socket.js
1492
- var Dn = Object.freeze({
1492
+ var On = Object.freeze({
1493
1493
  connect: 1,
1494
1494
  connect_error: 1,
1495
1495
  disconnect: 1,
1496
1496
  disconnecting: 1,
1497
1497
  newListener: 1,
1498
1498
  removeListener: 1
1499
- }), On = class extends M {
1499
+ }), kn = class extends j {
1500
1500
  constructor(e, t, n) {
1501
1501
  super(), this.connected = !1, this.recovered = !1, this.receiveBuffer = [], this.sendBuffer = [], this._queue = [], this._queueSeq = 0, this.ids = 0, this.acks = {}, this.flags = {}, this.io = e, this.nsp = t, n && n.auth && (this.auth = n.auth), this._opts = Object.assign({}, n), this.io._autoConnect && this.open();
1502
1502
  }
@@ -1507,10 +1507,10 @@ var Dn = Object.freeze({
1507
1507
  if (this.subs) return;
1508
1508
  let e = this.io;
1509
1509
  this.subs = [
1510
- En(e, "open", this.onopen.bind(this)),
1511
- En(e, "packet", this.onpacket.bind(this)),
1512
- En(e, "error", this.onerror.bind(this)),
1513
- En(e, "close", this.onclose.bind(this))
1510
+ Dn(e, "open", this.onopen.bind(this)),
1511
+ Dn(e, "packet", this.onpacket.bind(this)),
1512
+ Dn(e, "error", this.onerror.bind(this)),
1513
+ Dn(e, "close", this.onclose.bind(this))
1514
1514
  ];
1515
1515
  }
1516
1516
  get active() {
@@ -1526,10 +1526,10 @@ var Dn = Object.freeze({
1526
1526
  return e.unshift("message"), this.emit.apply(this, e), this;
1527
1527
  }
1528
1528
  emit(e, ...t) {
1529
- if (Dn.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
1529
+ if (On.hasOwnProperty(e)) throw Error("\"" + e.toString() + "\" is a reserved event name");
1530
1530
  if (t.unshift(e), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) return this._addToQueue(t), this;
1531
1531
  let n = {
1532
- type: N.EVENT,
1532
+ type: M.EVENT,
1533
1533
  data: t
1534
1534
  };
1535
1535
  if (n.options = {}, n.options.compress = this.flags.compress !== !1, typeof t[t.length - 1] == "function") {
@@ -1587,7 +1587,7 @@ var Dn = Object.freeze({
1587
1587
  }
1588
1588
  _sendConnectPacket(e) {
1589
1589
  this.packet({
1590
- type: N.CONNECT,
1590
+ type: M.CONNECT,
1591
1591
  data: this._pid ? Object.assign({
1592
1592
  pid: this._pid,
1593
1593
  offset: this._lastOffset
@@ -1610,21 +1610,21 @@ var Dn = Object.freeze({
1610
1610
  }
1611
1611
  onpacket(e) {
1612
1612
  if (e.nsp === this.nsp) switch (e.type) {
1613
- case N.CONNECT:
1613
+ case M.CONNECT:
1614
1614
  e.data && e.data.sid ? this.onconnect(e.data.sid, e.data.pid) : this.emitReserved("connect_error", /* @__PURE__ */ Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));
1615
1615
  break;
1616
- case N.EVENT:
1617
- case N.BINARY_EVENT:
1616
+ case M.EVENT:
1617
+ case M.BINARY_EVENT:
1618
1618
  this.onevent(e);
1619
1619
  break;
1620
- case N.ACK:
1621
- case N.BINARY_ACK:
1620
+ case M.ACK:
1621
+ case M.BINARY_ACK:
1622
1622
  this.onack(e);
1623
1623
  break;
1624
- case N.DISCONNECT:
1624
+ case M.DISCONNECT:
1625
1625
  this.ondisconnect();
1626
1626
  break;
1627
- case N.CONNECT_ERROR:
1627
+ case M.CONNECT_ERROR:
1628
1628
  this.destroy();
1629
1629
  let t = Error(e.data.message);
1630
1630
  t.data = e.data.data, this.emitReserved("connect_error", t);
@@ -1646,7 +1646,7 @@ var Dn = Object.freeze({
1646
1646
  let t = this, n = !1;
1647
1647
  return function(...r) {
1648
1648
  n || (n = !0, t.packet({
1649
- type: N.ACK,
1649
+ type: M.ACK,
1650
1650
  id: e,
1651
1651
  data: r
1652
1652
  }));
@@ -1671,7 +1671,7 @@ var Dn = Object.freeze({
1671
1671
  this.subs &&= (this.subs.forEach((e) => e()), void 0), this.io._destroy(this);
1672
1672
  }
1673
1673
  disconnect() {
1674
- return this.connected && this.packet({ type: N.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
1674
+ return this.connected && this.packet({ type: M.DISCONNECT }), this.destroy(), this.connected && this.onclose("io client disconnect"), this;
1675
1675
  }
1676
1676
  close() {
1677
1677
  return this.disconnect();
@@ -1728,35 +1728,35 @@ var Dn = Object.freeze({
1728
1728
  };
1729
1729
  //#endregion
1730
1730
  //#region node_modules/socket.io-client/build/esm/contrib/backo2.js
1731
- function kn(e) {
1731
+ function An(e) {
1732
1732
  e ||= {}, this.ms = e.min || 100, this.max = e.max || 1e4, this.factor = e.factor || 2, this.jitter = e.jitter > 0 && e.jitter <= 1 ? e.jitter : 0, this.attempts = 0;
1733
1733
  }
1734
- kn.prototype.duration = function() {
1734
+ An.prototype.duration = function() {
1735
1735
  var e = this.ms * this.factor ** + this.attempts++;
1736
1736
  if (this.jitter) {
1737
1737
  var t = Math.random(), n = Math.floor(t * this.jitter * e);
1738
1738
  e = Math.floor(t * 10) & 1 ? e + n : e - n;
1739
1739
  }
1740
1740
  return Math.min(e, this.max) | 0;
1741
- }, kn.prototype.reset = function() {
1741
+ }, An.prototype.reset = function() {
1742
1742
  this.attempts = 0;
1743
- }, kn.prototype.setMin = function(e) {
1743
+ }, An.prototype.setMin = function(e) {
1744
1744
  this.ms = e;
1745
- }, kn.prototype.setMax = function(e) {
1745
+ }, An.prototype.setMax = function(e) {
1746
1746
  this.max = e;
1747
- }, kn.prototype.setJitter = function(e) {
1747
+ }, An.prototype.setJitter = function(e) {
1748
1748
  this.jitter = e;
1749
1749
  };
1750
1750
  //#endregion
1751
1751
  //#region node_modules/socket.io-client/build/esm/manager.js
1752
- var An = class extends M {
1752
+ var jn = class extends j {
1753
1753
  constructor(e, t) {
1754
- super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, Ct(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new kn({
1754
+ super(), this.nsps = {}, this.subs = [], e && typeof e == "object" && (t = e, e = void 0), t ||= {}, t.path = t.path || "/socket.io", this.opts = t, wt(this, t), this.reconnection(t.reconnection !== !1), this.reconnectionAttempts(t.reconnectionAttempts || Infinity), this.reconnectionDelay(t.reconnectionDelay || 1e3), this.reconnectionDelayMax(t.reconnectionDelayMax || 5e3), this.randomizationFactor(t.randomizationFactor ?? .5), this.backoff = new An({
1755
1755
  min: this.reconnectionDelay(),
1756
1756
  max: this.reconnectionDelayMax(),
1757
1757
  jitter: this.randomizationFactor()
1758
1758
  }), this.timeout(t.timeout == null ? 2e4 : t.timeout), this._readyState = "closed", this.uri = e;
1759
- let n = t.parser || hn;
1759
+ let n = t.parser || gn;
1760
1760
  this.encoder = new n.Encoder(), this.decoder = new n.Decoder(), this._autoConnect = t.autoConnect !== !1, this._autoConnect && this.open();
1761
1761
  }
1762
1762
  reconnection(e) {
@@ -1785,14 +1785,14 @@ var An = class extends M {
1785
1785
  }
1786
1786
  open(e) {
1787
1787
  if (~this._readyState.indexOf("open")) return this;
1788
- this.engine = new tn(this.uri, this.opts);
1788
+ this.engine = new nn(this.uri, this.opts);
1789
1789
  let t = this.engine, n = this;
1790
1790
  this._readyState = "opening", this.skipReconnect = !1;
1791
- let r = En(t, "open", function() {
1791
+ let r = Dn(t, "open", function() {
1792
1792
  n.onopen(), e && e();
1793
1793
  }), i = (t) => {
1794
1794
  this.cleanup(), this._readyState = "closed", this.emitReserved("error", t), e ? e(t) : this.maybeReconnectOnOpen();
1795
- }, a = En(t, "error", i);
1795
+ }, a = Dn(t, "error", i);
1796
1796
  if (!1 !== this._timeout) {
1797
1797
  let e = this._timeout, n = this.setTimeoutFn(() => {
1798
1798
  r(), i(/* @__PURE__ */ Error("timeout")), t.close();
@@ -1809,7 +1809,7 @@ var An = class extends M {
1809
1809
  onopen() {
1810
1810
  this.cleanup(), this._readyState = "open", this.emitReserved("open");
1811
1811
  let e = this.engine;
1812
- this.subs.push(En(e, "ping", this.onping.bind(this)), En(e, "data", this.ondata.bind(this)), En(e, "error", this.onerror.bind(this)), En(e, "close", this.onclose.bind(this)), En(this.decoder, "decoded", this.ondecoded.bind(this)));
1812
+ this.subs.push(Dn(e, "ping", this.onping.bind(this)), Dn(e, "data", this.ondata.bind(this)), Dn(e, "error", this.onerror.bind(this)), Dn(e, "close", this.onclose.bind(this)), Dn(this.decoder, "decoded", this.ondecoded.bind(this)));
1813
1813
  }
1814
1814
  onping() {
1815
1815
  this.emitReserved("ping");
@@ -1822,7 +1822,7 @@ var An = class extends M {
1822
1822
  }
1823
1823
  }
1824
1824
  ondecoded(e) {
1825
- _t(() => {
1825
+ vt(() => {
1826
1826
  this.emitReserved("packet", e);
1827
1827
  }, this.setTimeoutFn);
1828
1828
  }
@@ -1831,7 +1831,7 @@ var An = class extends M {
1831
1831
  }
1832
1832
  socket(e, t) {
1833
1833
  let n = this.nsps[e];
1834
- return n ? this._autoConnect && !n.active && n.connect() : (n = new On(this, e, t), this.nsps[e] = n), n;
1834
+ return n ? this._autoConnect && !n.active && n.connect() : (n = new kn(this, e, t), this.nsps[e] = n), n;
1835
1835
  }
1836
1836
  _destroy(e) {
1837
1837
  let t = Object.keys(this.nsps);
@@ -1876,21 +1876,21 @@ var An = class extends M {
1876
1876
  let e = this.backoff.attempts;
1877
1877
  this._reconnecting = !1, this.backoff.reset(), this.emitReserved("reconnect", e);
1878
1878
  }
1879
- }, jn = {};
1880
- function Mn(e, t) {
1879
+ }, Mn = {};
1880
+ function Nn(e, t) {
1881
1881
  typeof e == "object" && (t = e, e = void 0), t ||= {};
1882
- let n = nn(e, t.path || "/socket.io"), r = n.source, i = n.id, a = n.path, o = jn[i] && a in jn[i].nsps, s = t.forceNew || t["force new connection"] || !1 === t.multiplex || o, c;
1883
- return s ? c = new An(r, t) : (jn[i] || (jn[i] = new An(r, t)), c = jn[i]), n.query && !t.query && (t.query = n.queryKey), c.socket(n.path, t);
1884
- }
1885
- Object.assign(Mn, {
1886
- Manager: An,
1887
- Socket: On,
1888
- io: Mn,
1889
- connect: Mn
1882
+ let n = rn(e, t.path || "/socket.io"), r = n.source, i = n.id, a = n.path, o = Mn[i] && a in Mn[i].nsps, s = t.forceNew || t["force new connection"] || !1 === t.multiplex || o, c;
1883
+ return s ? c = new jn(r, t) : (Mn[i] || (Mn[i] = new jn(r, t)), c = Mn[i]), n.query && !t.query && (t.query = n.queryKey), c.socket(n.path, t);
1884
+ }
1885
+ Object.assign(Nn, {
1886
+ Manager: jn,
1887
+ Socket: kn,
1888
+ io: Nn,
1889
+ connect: Nn
1890
1890
  });
1891
1891
  //#endregion
1892
1892
  //#region src/services/socketClient.js
1893
- var Nn = ({ apiBaseUrl: e, userId: t, chatId: n, siteId: r }) => Mn(e, {
1893
+ var Pn = ({ apiBaseUrl: e, userId: t, chatId: n, siteId: r }) => Nn(e, {
1894
1894
  transports: ["polling", "websocket"],
1895
1895
  upgrade: !0,
1896
1896
  rememberUpgrade: !1,
@@ -1903,7 +1903,7 @@ var Nn = ({ apiBaseUrl: e, userId: t, chatId: n, siteId: r }) => Mn(e, {
1903
1903
  chatId: n,
1904
1904
  siteId: r
1905
1905
  }
1906
- }), Pn = ({ socket: e, chatId: t }) => {
1906
+ }), Fn = ({ socket: e, chatId: t }) => {
1907
1907
  if (!e || !t || typeof window > "u") return () => {};
1908
1908
  let n = window.location.pathname + window.location.search, r = Date.now(), i = null, a = null, o = () => {
1909
1909
  console.log("[FlowEngageTracking] visitor:session_start", {
@@ -2005,14 +2005,14 @@ var Nn = ({ apiBaseUrl: e, userId: t, chatId: n, siteId: r }) => Mn(e, {
2005
2005
  a &&= (window.clearTimeout(a), null), d(), window.history.pushState = h, window.history.replaceState = g, window.removeEventListener("popstate", m), window.removeEventListener("hashchange", m), window.removeEventListener("beforeunload", v), window.removeEventListener("pagehide", y), window.removeEventListener("visibilitychange", p);
2006
2006
  }
2007
2007
  };
2008
- }, Fn = r(null), In = () => {
2009
- let e = s(Fn);
2008
+ }, In = r(null), Ln = () => {
2009
+ let e = s(In);
2010
2010
  if (!e) throw Error("useFlowEngage must be used inside FlowEngageProvider");
2011
2011
  return e;
2012
2012
  };
2013
2013
  //#endregion
2014
2014
  //#region src/utils/feDebug.js
2015
- function Ln() {
2015
+ function Rn() {
2016
2016
  if (typeof window > "u") return !1;
2017
2017
  try {
2018
2018
  let e = window.localStorage?.getItem("FE_DEBUG_VOICE");
@@ -2023,7 +2023,7 @@ function Ln() {
2023
2023
  }
2024
2024
  //#endregion
2025
2025
  //#region src/utils/navigateAndHighlight.js
2026
- function Rn(e) {
2026
+ function zn(e) {
2027
2027
  if (!e || typeof e.closest != "function") return !1;
2028
2028
  try {
2029
2029
  return !!e.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root");
@@ -2031,38 +2031,38 @@ function Rn(e) {
2031
2031
  return !1;
2032
2032
  }
2033
2033
  }
2034
- function zn(...e) {
2035
- Ln() && console.log("[FlowEngage:shadowNavigate]", ...e);
2034
+ function Bn(...e) {
2035
+ Rn() && console.log("[FlowEngage:shadowNavigate]", ...e);
2036
2036
  }
2037
- var Bn = "fe_pending_nav_section", Vn = 15e3, Hn = "fe_voice_nav_state", Un = 2e4, Wn = !1, Gn = null;
2038
- function Kn() {
2039
- Wn || typeof window > "u" || (Wn = !0, window.addEventListener("popstate", async () => {
2037
+ var Vn = "fe_pending_nav_section", Hn = 15e3, Un = "fe_voice_nav_state", Wn = 2e4, Gn = !1, Kn = null;
2038
+ function qn() {
2039
+ Gn || typeof window > "u" || (Gn = !0, window.addEventListener("popstate", async () => {
2040
2040
  let e = window.location.href;
2041
- if (zn("popstate: body-swap to", e), Gn) {
2041
+ if (Bn("popstate: body-swap to", e), Kn) {
2042
2042
  try {
2043
- $n(Gn);
2043
+ er(Kn);
2044
2044
  } catch {}
2045
2045
  try {
2046
- nr(Gn);
2046
+ rr(Kn);
2047
2047
  } catch {}
2048
2048
  }
2049
2049
  try {
2050
- if (await _r(e, {
2050
+ if (await vr(e, {
2051
2051
  skipPushState: !0,
2052
2052
  isBack: !0
2053
2053
  })) {
2054
- zn("popstate: body-swap succeeded");
2054
+ Bn("popstate: body-swap succeeded");
2055
2055
  return;
2056
2056
  }
2057
2057
  } catch (e) {
2058
2058
  console.warn("[FlowEngage] popstate body-swap error:", e);
2059
2059
  }
2060
- zn("popstate: body-swap failed, falling back to reload"), window.location.reload();
2060
+ Bn("popstate: body-swap failed, falling back to reload"), window.location.reload();
2061
2061
  }));
2062
2062
  }
2063
- var qn = !1;
2064
- function Jn() {
2065
- qn || typeof window > "u" || typeof document > "u" || (qn = !0, document.addEventListener("click", async (e) => {
2063
+ var Jn = !1;
2064
+ function Yn() {
2065
+ Jn || typeof window > "u" || typeof document > "u" || (Jn = !0, document.addEventListener("click", async (e) => {
2066
2066
  try {
2067
2067
  if (!window.history.state?.flowengageSpa) return;
2068
2068
  } catch {
@@ -2079,26 +2079,26 @@ function Jn() {
2079
2079
  return;
2080
2080
  }
2081
2081
  if (!(r.pathname === window.location.pathname && r.hash) && !(r.pathname === window.location.pathname && r.search === window.location.search)) {
2082
- e.preventDefault(), e.stopPropagation(), zn("link-intercept: body-swap to", r.href), or();
2082
+ e.preventDefault(), e.stopPropagation(), Bn("link-intercept: body-swap to", r.href), sr();
2083
2083
  try {
2084
2084
  try {
2085
- $n();
2085
+ er();
2086
2086
  } catch {}
2087
2087
  try {
2088
- nr();
2088
+ rr();
2089
2089
  } catch {}
2090
- if (await _r(r.href)) {
2091
- zn("link-intercept: body-swap succeeded");
2090
+ if (await vr(r.href)) {
2091
+ Bn("link-intercept: body-swap succeeded");
2092
2092
  return;
2093
2093
  }
2094
2094
  } catch (e) {
2095
2095
  console.warn("[FlowEngage] link-intercept body-swap error:", e);
2096
2096
  }
2097
- zn("link-intercept: body-swap failed, falling back to normal navigation"), sr(), window.location.href = r.href;
2097
+ Bn("link-intercept: body-swap failed, falling back to normal navigation"), cr(), window.location.href = r.href;
2098
2098
  }
2099
2099
  }, !0));
2100
2100
  }
2101
- function Yn() {
2101
+ function Xn() {
2102
2102
  if (typeof window > "u") return null;
2103
2103
  if (window.next?.router || window.__NEXT_ROUTER__) return "nextjs";
2104
2104
  if (window.__remixRouter || window.__staticRouterHydrationData) return "react-router";
@@ -2114,12 +2114,12 @@ function Yn() {
2114
2114
  });
2115
2115
  return e.length === 1 && e[0].id && (e[0].querySelector("[data-reactroot]") || e[0]._reactRootContainer || e[0].__vue_app__) ? "generic-spa" : null;
2116
2116
  }
2117
- var Xn = "data-fe-swap-css";
2118
- function Zn() {
2119
- typeof document > "u" || document.querySelectorAll(`[${Xn}]`).forEach((e) => e.remove());
2117
+ var Zn = "data-fe-swap-css";
2118
+ function Qn() {
2119
+ typeof document > "u" || document.querySelectorAll(`[${Zn}]`).forEach((e) => e.remove());
2120
2120
  }
2121
- var Qn = "fe_form_state:";
2122
- function $n(e) {
2121
+ var $n = "fe_form_state:";
2122
+ function er(e) {
2123
2123
  if (typeof document > "u" || typeof sessionStorage > "u") return;
2124
2124
  let t = document.querySelectorAll("form");
2125
2125
  if (!t.length) return;
@@ -2134,16 +2134,16 @@ function $n(e) {
2134
2134
  fields: r
2135
2135
  });
2136
2136
  }), n.length) try {
2137
- let t = Qn + (e || window.location.pathname);
2137
+ let t = $n + (e || window.location.pathname);
2138
2138
  sessionStorage.setItem(t, JSON.stringify({
2139
2139
  state: n,
2140
2140
  ts: Date.now()
2141
2141
  }));
2142
2142
  } catch {}
2143
2143
  }
2144
- function er() {
2144
+ function tr() {
2145
2145
  if (typeof document > "u" || typeof sessionStorage > "u") return;
2146
- let e = Qn + window.location.pathname, t;
2146
+ let e = $n + window.location.pathname, t;
2147
2147
  try {
2148
2148
  t = JSON.parse(sessionStorage.getItem(e) || "null");
2149
2149
  } catch {
@@ -2179,19 +2179,19 @@ function er() {
2179
2179
  sessionStorage.removeItem(e);
2180
2180
  } catch {}
2181
2181
  }
2182
- var tr = "fe_scroll:";
2183
- function nr(e) {
2182
+ var nr = "fe_scroll:";
2183
+ function rr(e) {
2184
2184
  if (!(typeof window > "u" || typeof sessionStorage > "u")) try {
2185
- let t = tr + (e || window.location.pathname);
2185
+ let t = nr + (e || window.location.pathname);
2186
2186
  sessionStorage.setItem(t, JSON.stringify({
2187
2187
  y: window.scrollY,
2188
2188
  ts: Date.now()
2189
2189
  }));
2190
2190
  } catch {}
2191
2191
  }
2192
- function rr() {
2192
+ function ir() {
2193
2193
  if (typeof window > "u" || typeof sessionStorage > "u") return;
2194
- let e = tr + window.location.pathname, t;
2194
+ let e = nr + window.location.pathname, t;
2195
2195
  try {
2196
2196
  t = JSON.parse(sessionStorage.getItem(e) || "null");
2197
2197
  } catch {
@@ -2209,7 +2209,7 @@ function rr() {
2209
2209
  }, 80);
2210
2210
  }
2211
2211
  }
2212
- function ir(e) {
2212
+ function ar(e) {
2213
2213
  if (!(typeof window > "u")) try {
2214
2214
  window.dispatchEvent(new CustomEvent("flowengage:pageswap", { detail: {
2215
2215
  url: e,
@@ -2217,11 +2217,11 @@ function ir(e) {
2217
2217
  } }));
2218
2218
  } catch {}
2219
2219
  }
2220
- var ar = "fe-nav-loader";
2221
- function or() {
2222
- if (typeof document > "u" || document.getElementById(ar)) return;
2220
+ var or = "fe-nav-loader";
2221
+ function sr() {
2222
+ if (typeof document > "u" || document.getElementById(or)) return;
2223
2223
  let e = document.createElement("div");
2224
- e.id = ar, e.style.cssText = [
2224
+ e.id = or, e.style.cssText = [
2225
2225
  "position:fixed",
2226
2226
  "top:0",
2227
2227
  "left:0",
@@ -2235,52 +2235,52 @@ function or() {
2235
2235
  e.style.width = "70%";
2236
2236
  });
2237
2237
  }
2238
- function sr() {
2238
+ function cr() {
2239
2239
  if (typeof document > "u") return;
2240
- let e = document.getElementById(ar);
2240
+ let e = document.getElementById(or);
2241
2241
  e && (e.style.width = "100%", setTimeout(() => {
2242
2242
  e.style.opacity = "0", e.style.transition = "opacity 0.3s ease", setTimeout(() => e.remove(), 350);
2243
2243
  }, 200));
2244
2244
  }
2245
- function cr() {
2245
+ function lr() {
2246
2246
  if (typeof window > "u" || typeof document > "u") return;
2247
2247
  try {
2248
- window.history.state?.flowengageSpa && Kn();
2248
+ window.history.state?.flowengageSpa && qn();
2249
2249
  } catch {}
2250
2250
  let e;
2251
2251
  try {
2252
- e = JSON.parse(sessionStorage.getItem(Bn) || "null");
2252
+ e = JSON.parse(sessionStorage.getItem(Vn) || "null");
2253
2253
  } catch {
2254
2254
  return;
2255
2255
  }
2256
2256
  if (!e) return;
2257
2257
  try {
2258
- sessionStorage.removeItem(Bn);
2258
+ sessionStorage.removeItem(Vn);
2259
2259
  } catch {}
2260
2260
  let { sectionText: t, ts: n } = e;
2261
2261
  if (!t) return;
2262
- if (Date.now() - n > Vn) {
2263
- zn("initNavigationHighlight: pending section expired, skipping:", t);
2262
+ if (Date.now() - n > Hn) {
2263
+ Bn("initNavigationHighlight: pending section expired, skipping:", t);
2264
2264
  return;
2265
2265
  }
2266
- zn("initNavigationHighlight: replaying section highlight:", t);
2266
+ Bn("initNavigationHighlight: replaying section highlight:", t);
2267
2267
  let r = 0, i = () => {
2268
2268
  r += 1;
2269
- let e = ur(null, t);
2269
+ let e = dr(null, t);
2270
2270
  if (e) {
2271
- dr(e), zn("initNavigationHighlight: highlighted on attempt", r);
2271
+ fr(e), Bn("initNavigationHighlight: highlighted on attempt", r);
2272
2272
  return;
2273
2273
  }
2274
- r < 8 ? setTimeout(i, 300) : zn("initNavigationHighlight: could not find element after 8 attempts:", t);
2274
+ r < 8 ? setTimeout(i, 300) : Bn("initNavigationHighlight: could not find element after 8 attempts:", t);
2275
2275
  };
2276
2276
  setTimeout(i, 250);
2277
2277
  }
2278
- var lr = () => {
2278
+ var ur = () => {
2279
2279
  if (typeof document > "u" || document.getElementById("fe-highlight-styles")) return;
2280
2280
  let e = document.createElement("style");
2281
2281
  e.id = "fe-highlight-styles", e.textContent = "\n .fe-highlight-section {\n outline: 3px solid #7c3aed !important;\n box-shadow: 0 0 15px rgba(124, 58, 237, 0.6) !important;\n transition: outline-color 0.3s ease, box-shadow 0.3s ease !important;\n border-radius: 8px !important;\n position: relative;\n }\n /* Smooth fade-in for the speaking highlight */\n .fe-highlight-section.fe-highlight-speaking {\n outline-color: #6366f1 !important;\n box-shadow: 0 0 20px rgba(99, 102, 241, 0.45), 0 0 4px rgba(99, 102, 241, 0.3) !important;\n animation: fe-hl-pulse 2s ease-in-out infinite !important;\n }\n @keyframes fe-hl-pulse {\n 0%, 100% { box-shadow: 0 0 15px rgba(99, 102, 241, 0.40), 0 0 4px rgba(99, 102, 241, 0.25); }\n 50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.55), 0 0 8px rgba(99, 102, 241, 0.35); }\n }\n /* Exit transition — the old highlight fades out */\n .fe-highlight-exiting {\n outline: 3px solid transparent !important;\n box-shadow: none !important;\n transition: outline-color 0.25s ease, box-shadow 0.25s ease !important;\n }\n ", document.head.appendChild(e);
2282
2282
  };
2283
- function ur(e, t) {
2283
+ function dr(e, t) {
2284
2284
  if (typeof document > "u") return null;
2285
2285
  if (e) {
2286
2286
  let n = document.getElementById(e) || document.querySelector(`[data-section="${e}"]`);
@@ -2289,7 +2289,7 @@ function ur(e, t) {
2289
2289
  }
2290
2290
  if (!t) return null;
2291
2291
  let n = t.toLowerCase().trim(), r = n.split(/\s+/).filter((e) => e.length > 2), i = Array.from(document.querySelectorAll((/* @__PURE__ */ "h1.h2.h3.h4.h5.h6.[data-section].section[id].[id].main li.article li.[role='main'] li.[class*='card'].[class*='Card'].[class*='feature'].[class*='Feature'].[class*='tier'].[class*='Tier'].[class*='plan'].[class*='Plan'].[class*='pricing'].[class*='Pricing'].[class*='testimonial'].[class*='Testimonial'].[class*='team'].[class*='Team'].[class*='service'].[class*='Service'].[class*='block'].[role='listitem'].[role='article'].[role='region'].dt.dd".split(".")).join(", "))).filter((e) => {
2292
- if (Rn(e)) return !1;
2292
+ if (zn(e)) return !1;
2293
2293
  let t = e.textContent.trim();
2294
2294
  return !(t.length < 3 || t.length > 5e3 || e.closest("nav, footer, header, aside, .nav, .footer, .header"));
2295
2295
  });
@@ -2321,7 +2321,7 @@ function ur(e, t) {
2321
2321
  }
2322
2322
  if (e) return e;
2323
2323
  }
2324
- let o = Array.from(document.querySelectorAll("main [role='group']")).filter((e) => !Rn(e)), s = [];
2324
+ let o = Array.from(document.querySelectorAll("main [role='group']")).filter((e) => !zn(e)), s = [];
2325
2325
  for (let e of o) {
2326
2326
  let t = e.textContent.replace(/\s+/g, " ").toLowerCase().trim();
2327
2327
  t.length < 15 || t.length > 8e3 || t.includes(n) && s.push({
@@ -2332,7 +2332,7 @@ function ur(e, t) {
2332
2332
  if (s.length) return s.sort((e, t) => e.len - t.len), s[0].el;
2333
2333
  if (r.length > 0) {
2334
2334
  let e = Array.from(document.querySelectorAll("main a[href], article a[href], .views-row a[href], h2 a[href], h3 a[href], .card a[href], [class*='teaser'] a[href]")).filter((e) => {
2335
- if (Rn(e)) return !1;
2335
+ if (zn(e)) return !1;
2336
2336
  try {
2337
2337
  let t = e.getAttribute("href") || "";
2338
2338
  if (!t || t === "#" || t.startsWith("javascript:")) return !1;
@@ -2352,7 +2352,7 @@ function ur(e, t) {
2352
2352
  }
2353
2353
  let c = document.querySelectorAll("section, article, .card, [class*='feature'], [class*='service']");
2354
2354
  for (let e of c) {
2355
- if (Rn(e)) continue;
2355
+ if (zn(e)) continue;
2356
2356
  let t = e.querySelector("h1, h2, h3, h4, h5, h6");
2357
2357
  if (t) {
2358
2358
  let r = t.textContent.replace(/\s+/g, " ").toLowerCase().trim();
@@ -2361,11 +2361,11 @@ function ur(e, t) {
2361
2361
  }
2362
2362
  let l = document.querySelectorAll("li, strong, blockquote, dt");
2363
2363
  for (let e of l) {
2364
- if (Rn(e)) continue;
2364
+ if (zn(e)) continue;
2365
2365
  let t = e.textContent.replace(/\s+/g, " ").toLowerCase().trim();
2366
2366
  if (t.includes(n) && t.length < 500) return e.tagName === "STRONG" && e.parentElement?.tagName === "LI" ? e.parentElement : e;
2367
2367
  }
2368
- let u = Array.from(document.querySelectorAll("a[href]")).filter((e) => !Rn(e));
2368
+ let u = Array.from(document.querySelectorAll("a[href]")).filter((e) => !zn(e));
2369
2369
  u.sort((e, t) => (e.textContent || "").trim().length - (t.textContent || "").trim().length);
2370
2370
  for (let e of u) {
2371
2371
  let t = e.textContent.replace(/\s+/g, " ").toLowerCase().trim();
@@ -2373,15 +2373,15 @@ function ur(e, t) {
2373
2373
  }
2374
2374
  let d = document.querySelectorAll("p");
2375
2375
  for (let e of d) {
2376
- if (Rn(e)) continue;
2376
+ if (zn(e)) continue;
2377
2377
  let t = e.textContent.replace(/\s+/g, " ").toLowerCase().trim();
2378
2378
  if (t.includes(n) && t.length < 800) return e;
2379
2379
  }
2380
2380
  return null;
2381
2381
  }
2382
- function dr(e, { speaking: t = !1, scroll: n = !0 } = {}) {
2382
+ function fr(e, { speaking: t = !1, scroll: n = !0 } = {}) {
2383
2383
  if (!e || typeof document > "u") return;
2384
- lr();
2384
+ ur();
2385
2385
  let r = document.querySelectorAll(".fe-highlight-section");
2386
2386
  for (let t of r) t !== e && (t.classList.remove("fe-highlight-section", "fe-highlight-speaking"), t.classList.add("fe-highlight-exiting"), setTimeout(() => t.classList.remove("fe-highlight-exiting"), 300));
2387
2387
  if (e.classList.remove("fe-highlight-exiting"), e.classList.add("fe-highlight-section"), t ? e.classList.add("fe-highlight-speaking") : e.classList.remove("fe-highlight-speaking"), n) try {
@@ -2395,10 +2395,10 @@ function dr(e, { speaking: t = !1, scroll: n = !0 } = {}) {
2395
2395
  } catch {}
2396
2396
  }
2397
2397
  }
2398
- function fr() {
2398
+ function pr() {
2399
2399
  typeof document > "u" || document.querySelectorAll(".fe-highlight-section, .fe-highlight-exiting").forEach((e) => e.classList.remove("fe-highlight-section", "fe-highlight-speaking", "fe-highlight-exiting"));
2400
2400
  }
2401
- function pr(e) {
2401
+ function mr(e) {
2402
2402
  if (typeof window > "u") return e;
2403
2403
  try {
2404
2404
  let t = new URL(String(e).trim(), window.location.href);
@@ -2407,7 +2407,7 @@ function pr(e) {
2407
2407
  return e;
2408
2408
  }
2409
2409
  }
2410
- async function mr(e) {
2410
+ async function hr(e) {
2411
2411
  if (typeof window > "u") return !1;
2412
2412
  try {
2413
2413
  let t = new URL(String(e).trim(), window.location.href), n = t.origin === window.location.origin ? t.href : new URL(t.pathname + t.search + t.hash, window.location.origin).href;
@@ -2420,36 +2420,36 @@ async function mr(e) {
2420
2420
  return !1;
2421
2421
  }
2422
2422
  }
2423
- async function hr(e, { siteId: t, apiBaseUrl: n }) {
2423
+ async function gr(e, { siteId: t, apiBaseUrl: n }) {
2424
2424
  if (!e) return !1;
2425
- if (!t || !n) return console.warn("[FlowEngage] shouldProceedWithNavigation: missing siteId or apiBaseUrl"), mr(e);
2425
+ if (!t || !n) return console.warn("[FlowEngage] shouldProceedWithNavigation: missing siteId or apiBaseUrl"), hr(e);
2426
2426
  let r = String(n).replace(/\/$/, ""), i = new URLSearchParams({
2427
2427
  siteId: String(t),
2428
2428
  url: String(e).trim()
2429
2429
  });
2430
2430
  try {
2431
2431
  let t = await (await fetch(`${r}/api/widget/navigate-allowed?${i.toString()}`)).json().catch(() => ({}));
2432
- return t.success && t.allowed ? !0 : mr(e);
2432
+ return t.success && t.allowed ? !0 : hr(e);
2433
2433
  } catch (t) {
2434
- return console.warn("[FlowEngage] navigate-allowed check failed:", t?.message), mr(e);
2434
+ return console.warn("[FlowEngage] navigate-allowed check failed:", t?.message), hr(e);
2435
2435
  }
2436
2436
  }
2437
- function gr(e) {
2437
+ function _r(e) {
2438
2438
  if (!(!e || typeof sessionStorage > "u")) try {
2439
- sessionStorage.setItem(Bn, JSON.stringify({
2439
+ sessionStorage.setItem(Vn, JSON.stringify({
2440
2440
  sectionText: e,
2441
2441
  ts: Date.now()
2442
2442
  }));
2443
2443
  } catch {}
2444
2444
  }
2445
- async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2445
+ async function vr(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2446
2446
  if (typeof window > "u" || typeof document > "u") return !1;
2447
2447
  try {
2448
2448
  if (new URL(e, window.location.href).origin !== window.location.origin) return !1;
2449
2449
  } catch {
2450
2450
  return !1;
2451
2451
  }
2452
- or();
2452
+ sr();
2453
2453
  let r = new AbortController(), i = setTimeout(() => r.abort(), 8e3);
2454
2454
  try {
2455
2455
  let a = await fetch(e, {
@@ -2457,9 +2457,9 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2457
2457
  cache: "no-store",
2458
2458
  signal: r.signal
2459
2459
  });
2460
- if (clearTimeout(i), !a.ok) return sr(), !1;
2460
+ if (clearTimeout(i), !a.ok) return cr(), !1;
2461
2461
  let o = await a.text(), s = new DOMParser().parseFromString(o, "text/html"), c = document.getElementById("flowengage-root");
2462
- if (!c) return sr(), !1;
2462
+ if (!c) return cr(), !1;
2463
2463
  try {
2464
2464
  typeof window.Drupal?.detachBehaviors == "function" && window.Drupal.detachBehaviors(document.body, window.drupalSettings);
2465
2465
  } catch {}
@@ -2469,7 +2469,7 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2469
2469
  if (e === c) return;
2470
2470
  let t = e.tagName?.toUpperCase();
2471
2471
  t === "AUDIO" || t === "VIDEO" || e.remove();
2472
- }), Zn();
2472
+ }), Qn();
2473
2473
  let l = new Set(Array.from(document.querySelectorAll("link[rel='stylesheet']")).map((e) => {
2474
2474
  try {
2475
2475
  return new URL(e.getAttribute("href") || "", window.location.href).href;
@@ -2488,14 +2488,14 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2488
2488
  }
2489
2489
  if (l.has(r)) continue;
2490
2490
  let i = document.createElement("link");
2491
- i.rel = "stylesheet", i.href = r, i.setAttribute(Xn, "true"), t.media && (i.media = t.media), document.head.appendChild(i);
2491
+ i.rel = "stylesheet", i.href = r, i.setAttribute(Zn, "true"), t.media && (i.media = t.media), document.head.appendChild(i);
2492
2492
  }
2493
2493
  for (let e of Array.from(s.head.querySelectorAll("style"))) {
2494
2494
  if (!e.textContent.trim()) continue;
2495
2495
  let t = e.textContent.trim().slice(0, 120);
2496
2496
  if (Array.from(document.head.querySelectorAll("style:not([data-fe-swap-css])")).some((e) => e.textContent.trim().slice(0, 120) === t)) continue;
2497
2497
  let n = document.createElement("style");
2498
- n.textContent = e.textContent, n.setAttribute(Xn, "true"), document.head.appendChild(n);
2498
+ n.textContent = e.textContent, n.setAttribute(Zn, "true"), document.head.appendChild(n);
2499
2499
  }
2500
2500
  Array.from(s.body.children).forEach((e) => {
2501
2501
  e.tagName?.toUpperCase() !== "SCRIPT" && document.body.insertBefore(document.importNode(e, !0), c);
@@ -2512,14 +2512,14 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2512
2512
  if (Array.isArray(t)) for (let e of t) {
2513
2513
  if ((e.command === "insert" || e.command === "insert_new_content") && e.selector && e.data) {
2514
2514
  let t = document.querySelector(e.selector);
2515
- t && (e.method === "replaceWith" ? t.outerHTML = e.data : e.method === "html" || e.method === "replace" ? t.innerHTML = e.data : e.method === "append" ? t.insertAdjacentHTML("beforeend", e.data) : e.method === "prepend" ? t.insertAdjacentHTML("afterbegin", e.data) : t.innerHTML = e.data, zn("trySpaNavigate: BigPipe replacement →", e.selector));
2515
+ t && (e.method === "replaceWith" ? t.outerHTML = e.data : e.method === "html" || e.method === "replace" ? t.innerHTML = e.data : e.method === "append" ? t.insertAdjacentHTML("beforeend", e.data) : e.method === "prepend" ? t.insertAdjacentHTML("afterbegin", e.data) : t.innerHTML = e.data, Bn("trySpaNavigate: BigPipe replacement →", e.selector));
2516
2516
  }
2517
2517
  if (e.command === "settings" && e.settings) try {
2518
2518
  window.drupalSettings && typeof window.drupalSettings == "object" && Object.assign(window.drupalSettings, e.settings);
2519
2519
  } catch {}
2520
2520
  }
2521
2521
  } catch (e) {
2522
- zn("trySpaNavigate: BigPipe parse error:", e.message);
2522
+ Bn("trySpaNavigate: BigPipe parse error:", e.message);
2523
2523
  }
2524
2524
  continue;
2525
2525
  }
@@ -2540,7 +2540,7 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2540
2540
  if (t) {
2541
2541
  try {
2542
2542
  let e = JSON.parse(t[1]);
2543
- window.drupalSettings && typeof window.drupalSettings == "object" ? Object.assign(window.drupalSettings, e) : window.drupalSettings = e, zn("trySpaNavigate: updated drupalSettings from new page");
2543
+ window.drupalSettings && typeof window.drupalSettings == "object" ? Object.assign(window.drupalSettings, e) : window.drupalSettings = e, Bn("trySpaNavigate: updated drupalSettings from new page");
2544
2544
  } catch {}
2545
2545
  break;
2546
2546
  }
@@ -2549,13 +2549,13 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2549
2549
  let d = window.location.assign.bind(window.location), f = window.location.replace.bind(window.location), p = !0;
2550
2550
  window.location.assign = (e) => {
2551
2551
  if (p) {
2552
- zn("trySpaNavigate: blocked location.assign from replayed script:", e);
2552
+ Bn("trySpaNavigate: blocked location.assign from replayed script:", e);
2553
2553
  return;
2554
2554
  }
2555
2555
  return d(e);
2556
2556
  }, window.location.replace = (e) => {
2557
2557
  if (p) {
2558
- zn("trySpaNavigate: blocked location.replace from replayed script:", e);
2558
+ Bn("trySpaNavigate: blocked location.replace from replayed script:", e);
2559
2559
  return;
2560
2560
  }
2561
2561
  return f(e);
@@ -2584,13 +2584,13 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2584
2584
  }
2585
2585
  if (h.has(n)) {
2586
2586
  if (m(n)) return;
2587
- zn("trySpaNavigate: re-running theme/custom script:", n);
2587
+ Bn("trySpaNavigate: re-running theme/custom script:", n);
2588
2588
  }
2589
2589
  h.add(n), i.src = n, i.async = t.async, i.defer = t.defer;
2590
2590
  } else if (t.textContent.trim()) {
2591
2591
  let e = t.textContent;
2592
2592
  if (/window\.location\s*[.=]|location\s*\.\s*(href|assign|replace|reload)\s*[=(]/i.test(e)) {
2593
- zn("trySpaNavigate: skipping inline script with navigation:", e.slice(0, 120));
2593
+ Bn("trySpaNavigate: skipping inline script with navigation:", e.slice(0, 120));
2594
2594
  return;
2595
2595
  }
2596
2596
  if (/^\s*\(?\s*(?:window\.)?drupalSettings\s*[,=]/.test(e)) return;
@@ -2621,7 +2621,7 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2621
2621
  for (let t of e) {
2622
2622
  if (t.closest("#flowengage-root, .flowengage-shell")) continue;
2623
2623
  let e = t.getAttribute("src") || t.src;
2624
- e && e !== "about:blank" && !e.startsWith("javascript:") && (zn("trySpaNavigate: reloading iframe:", e), t.src = e);
2624
+ e && e !== "about:blank" && !e.startsWith("javascript:") && (Bn("trySpaNavigate: reloading iframe:", e), t.src = e);
2625
2625
  }
2626
2626
  } catch {}
2627
2627
  try {
@@ -2631,12 +2631,12 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2631
2631
  for (let t of e) if (!t.closest("#flowengage-root")) {
2632
2632
  t.innerHTML = "";
2633
2633
  try {
2634
- window.grecaptcha.render(t, { sitekey: t.getAttribute("data-sitekey") || "" }), zn("trySpaNavigate: re-rendered reCAPTCHA");
2634
+ window.grecaptcha.render(t, { sitekey: t.getAttribute("data-sitekey") || "" }), Bn("trySpaNavigate: re-rendered reCAPTCHA");
2635
2635
  } catch {}
2636
2636
  }
2637
2637
  } else if (!document.querySelector("script[src*='recaptcha']")) {
2638
2638
  let e = document.createElement("script");
2639
- e.src = "https://www.google.com/recaptcha/api.js?render=explicit", e.async = !0, document.head.appendChild(e), zn("trySpaNavigate: injected reCAPTCHA script");
2639
+ e.src = "https://www.google.com/recaptcha/api.js?render=explicit", e.async = !0, document.head.appendChild(e), Bn("trySpaNavigate: injected reCAPTCHA script");
2640
2640
  }
2641
2641
  }
2642
2642
  } catch {}
@@ -2645,46 +2645,46 @@ async function _r(e, { skipPushState: t = !1, isBack: n = !1 } = {}) {
2645
2645
  }, 2e3), s.title && (document.title = s.title), !t) try {
2646
2646
  history.pushState({ flowengageSpa: !0 }, "", e);
2647
2647
  } catch {}
2648
- if (Kn(), Jn(), n) {
2648
+ if (qn(), Yn(), n) {
2649
2649
  try {
2650
- er();
2650
+ tr();
2651
2651
  } catch {}
2652
2652
  try {
2653
- rr();
2653
+ ir();
2654
2654
  } catch {}
2655
2655
  } else window.scrollTo(0, 0);
2656
- sr(), ir(e);
2656
+ cr(), ar(e);
2657
2657
  try {
2658
- sessionStorage.removeItem(Bn);
2658
+ sessionStorage.removeItem(Vn);
2659
2659
  } catch {}
2660
2660
  try {
2661
- sessionStorage.removeItem(Hn);
2661
+ sessionStorage.removeItem(Un);
2662
2662
  } catch {}
2663
2663
  try {
2664
- Gn = new URL(e, window.location.origin).pathname;
2664
+ Kn = new URL(e, window.location.origin).pathname;
2665
2665
  } catch {}
2666
- return zn("trySpaNavigate: succeeded →", e), !0;
2666
+ return Bn("trySpaNavigate: succeeded →", e), !0;
2667
2667
  } catch {
2668
- return clearTimeout(i), sr(), !1;
2668
+ return clearTimeout(i), cr(), !1;
2669
2669
  }
2670
2670
  }
2671
- function vr(e) {
2671
+ function yr(e) {
2672
2672
  if (!(!e || typeof sessionStorage > "u")) try {
2673
- sessionStorage.setItem(Hn, JSON.stringify({
2673
+ sessionStorage.setItem(Un, JSON.stringify({
2674
2674
  voiceWasActive: !0,
2675
2675
  targetUrl: String(e),
2676
2676
  ts: Date.now()
2677
2677
  }));
2678
2678
  } catch {}
2679
2679
  }
2680
- function yr() {
2680
+ function br() {
2681
2681
  if (typeof window > "u" || typeof sessionStorage > "u") return {
2682
2682
  shouldResumeVoice: !1,
2683
2683
  targetUrl: null
2684
2684
  };
2685
2685
  let e;
2686
2686
  try {
2687
- e = JSON.parse(sessionStorage.getItem(Hn) || "null");
2687
+ e = JSON.parse(sessionStorage.getItem(Un) || "null");
2688
2688
  } catch {
2689
2689
  return {
2690
2690
  shouldResumeVoice: !1,
@@ -2696,12 +2696,12 @@ function yr() {
2696
2696
  targetUrl: null
2697
2697
  };
2698
2698
  try {
2699
- sessionStorage.removeItem(Hn);
2699
+ sessionStorage.removeItem(Un);
2700
2700
  } catch {}
2701
- return e.voiceWasActive ? Date.now() - e.ts > Un ? (zn("initVoiceNavResume: state expired, skipping"), {
2701
+ return e.voiceWasActive ? Date.now() - e.ts > Wn ? (Bn("initVoiceNavResume: state expired, skipping"), {
2702
2702
  shouldResumeVoice: !1,
2703
2703
  targetUrl: null
2704
- }) : (zn("initVoiceNavResume: voice was active during navigation to", e.targetUrl), {
2704
+ }) : (Bn("initVoiceNavResume: voice was active during navigation to", e.targetUrl), {
2705
2705
  shouldResumeVoice: !0,
2706
2706
  targetUrl: e.targetUrl || null
2707
2707
  }) : {
@@ -2709,11 +2709,11 @@ function yr() {
2709
2709
  targetUrl: null
2710
2710
  };
2711
2711
  }
2712
- async function br(e, t = {}) {
2712
+ async function xr(e, t = {}) {
2713
2713
  if (typeof window > "u") return !1;
2714
2714
  let { sectionText: n, voiceActive: r = !1 } = t;
2715
2715
  try {
2716
- let t = pr(e), i = new URL(t, window.location.origin);
2716
+ let t = mr(e), i = new URL(t, window.location.origin);
2717
2717
  if (i.hash && i.pathname === window.location.pathname) {
2718
2718
  let e = document.getElementById(i.hash.slice(1));
2719
2719
  if (e) return e.scrollIntoView({
@@ -2730,32 +2730,32 @@ async function br(e, t = {}) {
2730
2730
  o.events?.on("routeChangeComplete", t), o.push(a), setTimeout(t, 5e3);
2731
2731
  });
2732
2732
  if (window.__NEXT_ROUTER__?.push) return window.__NEXT_ROUTER__.push(a), !0;
2733
- if (Yn()) {
2734
- n && gr(n);
2733
+ if (Xn()) {
2734
+ n && _r(n);
2735
2735
  try {
2736
2736
  window.history.pushState({}, "", i.href), window.dispatchEvent(new PopStateEvent("popstate", { state: {} }));
2737
2737
  } catch {}
2738
2738
  return !0;
2739
2739
  }
2740
- return n && gr(n), r || Ie(), window.location.assign(i.href), !0;
2740
+ return n && _r(n), r || Ie(), window.location.assign(i.href), !0;
2741
2741
  } catch (t) {
2742
- console.warn("[FlowEngage] shadowNavigate error:", t), n && gr(n);
2742
+ console.warn("[FlowEngage] shadowNavigate error:", t), n && _r(n);
2743
2743
  try {
2744
- window.location.href = pr(e);
2744
+ window.location.href = mr(e);
2745
2745
  } catch {
2746
2746
  window.location.href = e;
2747
2747
  }
2748
2748
  return !0;
2749
2749
  }
2750
2750
  }
2751
- var xr = !1, Sr = null;
2752
- function Cr(e) {
2753
- Sr = e, typeof window < "u" && (window.__fe_triggerVoiceNavHooks = () => {
2751
+ var Sr = !1, Cr = null;
2752
+ function wr(e) {
2753
+ Cr = e, typeof window < "u" && (window.__fe_triggerVoiceNavHooks = () => {
2754
2754
  try {
2755
2755
  e.onBeforeNavigate();
2756
2756
  } catch {}
2757
- }), !xr && (xr = !0, !(typeof document > "u") && (document.addEventListener("click", (e) => {
2758
- if (!Sr) return;
2757
+ }), !Sr && (Sr = !0, !(typeof document > "u") && (document.addEventListener("click", (e) => {
2758
+ if (!Cr) return;
2759
2759
  let t = e.target.closest?.("a[href]");
2760
2760
  if (!t || t.closest("#flowengage-root, .flowengage-shell, .flowengage-widget-root")) return;
2761
2761
  let n = t.getAttribute("href") || "";
@@ -2767,32 +2767,32 @@ function Cr(e) {
2767
2767
  return;
2768
2768
  }
2769
2769
  if (!(r.pathname === window.location.pathname && r.hash) && !(r.pathname === window.location.pathname && r.search === window.location.search && !r.hash)) {
2770
- zn("voice-link-hook: saving state before navigation →", r.href);
2770
+ Bn("voice-link-hook: saving state before navigation →", r.href);
2771
2771
  try {
2772
- Sr.onBeforeNavigate();
2772
+ Cr.onBeforeNavigate();
2773
2773
  } catch {}
2774
2774
  }
2775
2775
  }, !0), document.addEventListener("submit", (e) => {
2776
- if (Sr && !e.target?.closest?.("#flowengage-root, .flowengage-shell, .flowengage-widget-root")) {
2777
- zn("voice-form-hook: saving state before form submit");
2776
+ if (Cr && !e.target?.closest?.("#flowengage-root, .flowengage-shell, .flowengage-widget-root")) {
2777
+ Bn("voice-form-hook: saving state before form submit");
2778
2778
  try {
2779
- Sr.onBeforeNavigate();
2779
+ Cr.onBeforeNavigate();
2780
2780
  } catch {}
2781
2781
  }
2782
2782
  }, !0)));
2783
2783
  }
2784
- function wr() {
2785
- Sr = null, zn("voice-nav-hooks: deactivated");
2784
+ function Tr() {
2785
+ Cr = null, Bn("voice-nav-hooks: deactivated");
2786
2786
  }
2787
2787
  //#endregion
2788
2788
  //#region src/provider/FlowEngageProvider.jsx
2789
- var Tr = (e) => !e || typeof e != "string" ? e : e.replace(/<human_assistance_request[^>]*>/gi, "").replace(/<\/human_assistance_request>/gi, "").replace(/<navigate[^>]*\/>/gi, "").replace(/<navigate[^>]*>[\s\S]*?<\/navigate>/gi, "").replace(/<[a-z]+(?:_[a-z]+)+[^>]*>[\s\S]*?<\/[a-z]+(?:_[a-z]+)+>/gi, "").replace(/<[a-z]+(?:_[a-z]+)+[^>]*\/>/gi, "").trim(), Er = (e = []) => e.filter((e) => e.type !== "call_recording" && !(typeof e.message == "string" && e.message.includes("AI chat recording"))).map((e) => ({
2789
+ var Er = (e) => !e || typeof e != "string" ? e : e.replace(/<human_assistance_request[^>]*>/gi, "").replace(/<\/human_assistance_request>/gi, "").replace(/<navigate[^>]*\/>/gi, "").replace(/<navigate[^>]*>[\s\S]*?<\/navigate>/gi, "").replace(/<[a-z]+(?:_[a-z]+)+[^>]*>[\s\S]*?<\/[a-z]+(?:_[a-z]+)+>/gi, "").replace(/<[a-z]+(?:_[a-z]+)+[^>]*\/>/gi, "").trim(), Dr = (e = []) => e.filter((e) => e.type !== "call_recording" && !(typeof e.message == "string" && e.message.includes("AI chat recording"))).map((e) => ({
2790
2790
  ...e,
2791
- message: Tr(e.message),
2791
+ message: Er(e.message),
2792
2792
  isPending: !1,
2793
2793
  id: e.messageId || `${e.sender}-${e.timestamp || Date.now()}-${Math.random()}`
2794
2794
  }));
2795
- function Dr(e) {
2795
+ function Or(e) {
2796
2796
  if (!e || typeof e != "string") return null;
2797
2797
  let t = e.match(/<navigate([^>]*?)(?:\/>|>[\s\S]*?<\/navigate>)/i);
2798
2798
  if (!t) return null;
@@ -2804,7 +2804,7 @@ function Dr(e) {
2804
2804
  section: i?.[1]?.trim() || null
2805
2805
  };
2806
2806
  }
2807
- var Or = (e, t) => e ? typeof e == "string" ? e : e.message || e.error || e.reason || t : t, kr = (e = {}) => {
2807
+ var kr = (e, t) => e ? typeof e == "string" ? e : e.message || e.error || e.reason || t : t, Ar = (e = {}) => {
2808
2808
  if (!e?.candidate) return null;
2809
2809
  if (typeof e.candidate == "object") return e.candidate;
2810
2810
  let t = e.sdpMid !== void 0 && e.sdpMid !== null && e.sdpMid !== "", n = e.sdpMLineIndex !== void 0 && e.sdpMLineIndex !== null;
@@ -2813,15 +2813,15 @@ var Or = (e, t) => e ? typeof e == "string" ? e : e.message || e.error || e.reas
2813
2813
  ...t ? { sdpMid: e.sdpMid } : {},
2814
2814
  ...n ? { sdpMLineIndex: e.sdpMLineIndex } : {}
2815
2815
  };
2816
- }, Ar = (e = [], t = "Agent") => {
2816
+ }, jr = (e = [], t = "Agent") => {
2817
2817
  for (let t of e) if (typeof t == "string" && t.trim()) return t.trim();
2818
2818
  return t;
2819
- }, jr = (e = [], t, n = 6) => !t?.message || e.slice(-n).some((e) => e.sender === "system" && e.message === t.message) ? e : [...e, t];
2820
- function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2819
+ }, Mr = (e = [], t, n = 6) => !t?.message || e.slice(-n).some((e) => e.sender === "system" && e.message === t.message) ? e : [...e, t];
2820
+ function Nr({ siteId: e, config: t, children: n, language: r = "en" }) {
2821
2821
  let i = f(() => e ? {
2822
2822
  ...t || {},
2823
2823
  siteId: e
2824
- } : t || null, [e, t]), [a, s] = m(0), [l, u] = m("booting"), [d, h] = m(null), [_, v] = m(null), [y, b] = m(""), [x, S] = m([]), [C, w] = m(ve().isOpen), [T, te] = m(ve().activeScreen), [ne, re] = m(ve().isHumanHandled), [E, D] = m(ve().agentName), [se, de] = m(ve().agentHeadshot), [fe, pe] = m(() => be(i?.siteId)), [me, Se] = m(!1), [Ce, we] = m(!1), [Ee, De] = m("idle"), [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, O] = m(""), [Pe, Fe] = m(!1), [Ie, Le] = m(0), [Re, ze] = m(0), [Ve, He] = m(!1), [k, Ke] = m(null), [qe, Je] = m(null), [Ye, Xe] = m("idle"), [Ze, Qe] = m(null), [$e, et] = m(!1), [tt, nt] = m(""), [rt, it] = m(!1), at = p(null), A = p(null), j = p(""), ot = p(!1), st = p(null), ct = p(null), lt = p(null), ut = p(null), dt = p(null), ft = p(null), pt = p([]), mt = p(null), ht = p(null), M = p(null), gt = p(!1), _t = p(!1), vt = p(""), yt = p(null), bt = p(null), xt = p([]), St = p(0), Ct = p(E), wt = p([]), Tt = p(!1), Et = p(!1), Dt = p(i), Ot = p({
2824
+ } : t || null, [e, t]), [a, s] = m(0), [l, u] = m("booting"), [d, h] = m(null), [_, v] = m(null), [y, b] = m(""), [x, S] = m([]), [C, w] = m(ve().isOpen), [T, te] = m(ve().activeScreen), [ne, re] = m(ve().isHumanHandled), [E, D] = m(ve().agentName), [se, de] = m(ve().agentHeadshot), [fe, pe] = m(() => be(i?.siteId)), [me, Se] = m(!1), [Ce, we] = m(!1), [Ee, De] = m("idle"), [Oe, ke] = m(!1), [Ae, je] = m(!1), [Me, O] = m(""), [Pe, Fe] = m(!1), [Ie, Le] = m(0), [Re, ze] = m(0), [Be, Ve] = m(!1), [He, Ue] = m(null), [qe, Je] = m(null), [Ye, Xe] = m("idle"), [Ze, Qe] = m(null), [$e, et] = m(!1), [tt, nt] = m(""), [rt, it] = m(!1), at = p(null), k = p(null), ot = p(""), A = p(!1), st = p(null), ct = p(null), lt = p(null), ut = p(null), dt = p(null), ft = p(null), pt = p([]), mt = p(null), ht = p(null), gt = p(null), j = p(!1), _t = p(!1), vt = p(""), yt = p(null), bt = p(null), xt = p([]), St = p(0), Ct = p(E), wt = p([]), Tt = p(!1), Et = p(!1), Dt = p(i), Ot = p({
2825
2825
  notifyRouteChange: () => {},
2826
2826
  cleanup: () => {}
2827
2827
  }), kt = o((e = {}) => {
@@ -2832,8 +2832,8 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2832
2832
  return Number.isFinite(t) && t > 0 ? t : ae;
2833
2833
  }, [i, _]);
2834
2834
  c(() => {
2835
- ct.current = k;
2836
- }, [k]), c(() => {
2835
+ ct.current = He;
2836
+ }, [He]), c(() => {
2837
2837
  Ct.current = E;
2838
2838
  }, [E]), c(() => {
2839
2839
  Et.current = Pe;
@@ -2843,7 +2843,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2843
2843
  let jt = () => {
2844
2844
  nt("");
2845
2845
  }, Mt = o(() => {
2846
- M.current &&= (window.clearTimeout(M.current), null);
2846
+ gt.current &&= (window.clearTimeout(gt.current), null);
2847
2847
  }, []), Nt = (e) => {
2848
2848
  let t = typeof e == "string" ? e.trim().toLowerCase() : "";
2849
2849
  return pe(t), xe(t, i?.siteId), t;
@@ -2857,9 +2857,9 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2857
2857
  if (yt.current = null, St.current = 0, r && r.state !== "inactive") {
2858
2858
  r.onstop = () => {
2859
2859
  let e = xt.current;
2860
- if (xt.current = [], e.length > 0 && t && A.current) {
2860
+ if (xt.current = [], e.length > 0 && t && k.current) {
2861
2861
  let r = new Blob(e, { type: e[0].type }), i = n > 0 ? Math.round((Date.now() - n) / 1e3) : 0;
2862
- A.current.uploadRecording(t, r, i).then((e) => console.log("[FlowEngageCall] recording upload success", e)).catch((e) => console.warn("[FlowEngageCall] recording upload failed", e));
2862
+ k.current.uploadRecording(t, r, i).then((e) => console.log("[FlowEngageCall] recording upload success", e)).catch((e) => console.warn("[FlowEngageCall] recording upload failed", e));
2863
2863
  }
2864
2864
  };
2865
2865
  try {
@@ -2869,9 +2869,9 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2869
2869
  }
2870
2870
  } else if (r && r.state === "inactive") {
2871
2871
  let e = xt.current;
2872
- if (xt.current = [], e.length > 0 && t && A.current) {
2872
+ if (xt.current = [], e.length > 0 && t && k.current) {
2873
2873
  let r = new Blob(e, { type: e[0].type }), i = n > 0 ? Math.round((Date.now() - n) / 1e3) : 0;
2874
- A.current.uploadRecording(t, r, i).then((e) => console.log("[FlowEngageCall] recording upload success", e)).catch((e) => console.warn("[FlowEngageCall] recording upload failed", e));
2874
+ k.current.uploadRecording(t, r, i).then((e) => console.log("[FlowEngageCall] recording upload success", e)).catch((e) => console.warn("[FlowEngageCall] recording upload failed", e));
2875
2875
  }
2876
2876
  } else xt.current = [];
2877
2877
  if (bt.current) {
@@ -2880,13 +2880,13 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2880
2880
  } catch {}
2881
2881
  bt.current = null;
2882
2882
  }
2883
- lt.current &&= (lt.current.close(), null), ut.current &&= (ut.current.getTracks().forEach((e) => e.stop()), null), dt.current &&= (dt.current.srcObject = null, dt.current.remove(), null), Mt(), ft.current = null, pt.current = [], mt.current = null, ht.current = null, gt.current = !1, et(!1), Ke(null), Je(null), Xe("idle"), Qe(null);
2883
+ lt.current &&= (lt.current.close(), null), ut.current &&= (ut.current.getTracks().forEach((e) => e.stop()), null), dt.current &&= (dt.current.srcObject = null, dt.current.remove(), null), Mt(), ft.current = null, pt.current = [], mt.current = null, ht.current = null, j.current = !1, et(!1), Ue(null), Je(null), Xe("idle"), Qe(null);
2884
2884
  }, Ft = (e = (/* @__PURE__ */ new Date()).toISOString()) => {
2885
2885
  let t = at.current, n = mt.current || ft.current?.callId;
2886
- if (!(!t?.connected || !n || gt.current)) {
2887
- gt.current = !0, t.emit("call:connected", {
2886
+ if (!(!t?.connected || !n || j.current)) {
2887
+ j.current = !0, t.emit("call:connected", {
2888
2888
  callId: n,
2889
- chatId: j.current,
2889
+ chatId: ot.current,
2890
2890
  connectedAt: e
2891
2891
  });
2892
2892
  try {
@@ -2932,7 +2932,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2932
2932
  if (!e.callId) return;
2933
2933
  let t = ht.current === e.callId, n = mt.current === e.callId, r = ct.current?.callId === e.callId;
2934
2934
  if (!(!t && !n && !r)) {
2935
- if (Mt(), Ke(null), t || n) {
2935
+ if (Mt(), Ue(null), t || n) {
2936
2936
  mt.current = e.callId, Je(e.callId), Xe((e) => e === "connected" ? e : "connecting"), w(!0);
2937
2937
  return;
2938
2938
  }
@@ -2946,14 +2946,14 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2946
2946
  Pt();
2947
2947
  return;
2948
2948
  }
2949
- ht.current = null, ft.current = null, pt.current = [], Ke(null), Xe("idle");
2949
+ ht.current = null, ft.current = null, pt.current = [], Ue(null), Xe("idle");
2950
2950
  }
2951
2951
  }, Rt = async (e = {}) => {
2952
2952
  let t = lt.current, n = at.current, r = e.sdpOffer || e.offer?.sdp;
2953
2953
  if (!t || !n?.connected || !r || !e.callId) {
2954
2954
  console.log("[FlowEngageProvider] deferring remote offer until peer/socket ready", {
2955
2955
  callId: e.callId,
2956
- chatId: j.current,
2956
+ chatId: ot.current,
2957
2957
  hasPeerConnection: !!t,
2958
2958
  socketConnected: !!n?.connected,
2959
2959
  hasOffer: !!r
@@ -2966,7 +2966,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2966
2966
  })), pt.current.length > 0) {
2967
2967
  console.log("[FlowEngageProvider] flushing queued agent ICE candidates after remote offer", {
2968
2968
  callId: e.callId,
2969
- chatId: j.current,
2969
+ chatId: ot.current,
2970
2970
  queuedCount: pt.current.length
2971
2971
  });
2972
2972
  for (let e of pt.current) await t.addIceCandidate(new RTCIceCandidate(e));
@@ -2976,7 +2976,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2976
2976
  await t.setLocalDescription(i), n.emit("call:answer", {
2977
2977
  callId: e.callId,
2978
2978
  sdpAnswer: i.sdp,
2979
- chatId: j.current
2979
+ chatId: ot.current
2980
2980
  });
2981
2981
  };
2982
2982
  c(() => {
@@ -2998,12 +2998,12 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
2998
2998
  return (async () => {
2999
2999
  it(!0);
3000
3000
  try {
3001
- let t = ee(i), n = await We(t);
3001
+ let t = ee(i), n = await Ge(t);
3002
3002
  if (!e) return;
3003
3003
  let a = t.siteId, o = he(a), s = Te(a), c = "";
3004
3004
  try {
3005
- let e = ot.current, r = st.current;
3006
- if (ot.current = !1, st.current = null, c = (await Ue({
3005
+ let e = A.current, r = st.current;
3006
+ if (A.current = !1, st.current = null, c = (await We({
3007
3007
  apiBaseUrl: t.apiBaseUrl,
3008
3008
  userId: n.userId,
3009
3009
  siteId: a,
@@ -3016,18 +3016,18 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3016
3016
  } catch (e) {
3017
3017
  console.warn("[FlowEngageProvider] resolve-session failed, reusing persisted or ephemeral chat id", e?.message || e), c = o || ue(), _e(a, c);
3018
3018
  }
3019
- j.current = c;
3020
- let l = Ge({
3019
+ ot.current = c;
3020
+ let l = Ke({
3021
3021
  apiBaseUrl: t.apiBaseUrl,
3022
3022
  userId: n.userId,
3023
3023
  siteId: t.siteId,
3024
3024
  visitorId: s
3025
3025
  });
3026
- A.current = l, v({
3026
+ k.current = l, v({
3027
3027
  ...n,
3028
3028
  apiBaseUrl: t.apiBaseUrl
3029
3029
  }), b(c);
3030
- let d = n?.widgetSettings?.branding?.fallbackAgentName || "Agent", f = Nn({
3030
+ let d = n?.widgetSettings?.branding?.fallbackAgentName || "Agent", f = Pn({
3031
3031
  apiBaseUrl: t.apiBaseUrl,
3032
3032
  userId: n.userId,
3033
3033
  chatId: c,
@@ -3044,7 +3044,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3044
3044
  }), f.on("messageReceived", (e) => {
3045
3045
  let t = e.message || e, n = {
3046
3046
  ...t,
3047
- message: Tr(t.message)
3047
+ message: Er(t.message)
3048
3048
  };
3049
3049
  we(!1), Se(!1), !(n.type === "call_recording" || typeof n.message == "string" && n.message.includes("AI chat recording")) && S((e) => [...e.filter((e) => !e.isPending), {
3050
3050
  ...n,
@@ -3062,7 +3062,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3062
3062
  }), f.on("message:new", (e) => {
3063
3063
  let t = e.message || e, n = {
3064
3064
  ...t,
3065
- message: Tr(t.message)
3065
+ message: Er(t.message)
3066
3066
  };
3067
3067
  we(!1), !(n.type === "call_recording" || typeof n.message == "string" && n.message.includes("AI chat recording")) && ((n.sender === "agent" || n.agent_name || n.sender === "ai" || n.sender === "bot") && Se(!1), S((e) => n.sender === "bot" || n.sender === "ai" ? [...e, {
3068
3068
  ...n,
@@ -3076,20 +3076,20 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3076
3076
  ...n,
3077
3077
  isPending: !1,
3078
3078
  id: n.messageId || `${n.sender}-${Date.now()}-${Math.random()}`
3079
- }]), (n.sender === "agent" || n.agent_name) && (re(!0), te("agent"), D(Ar([
3079
+ }]), (n.sender === "agent" || n.agent_name) && (re(!0), te("agent"), D(jr([
3080
3080
  n.agent_name,
3081
3081
  n.agentName,
3082
3082
  n.metadata?.agentName
3083
3083
  ], d)), n.sender_headshot && de(n.sender_headshot), w(!0), Le((e) => e + 1)));
3084
3084
  });
3085
3085
  let p = (e = {}) => {
3086
- let t = Ar([
3086
+ let t = jr([
3087
3087
  e.agent?.name,
3088
3088
  e.agentName,
3089
3089
  e.agent_name,
3090
3090
  Ct.current
3091
3091
  ], d);
3092
- re(!0), te("agent"), D(t), de(e.agent?.headshot || null), w(!0), Le((e) => e + 1), S((e) => jr(e, {
3092
+ re(!0), te("agent"), D(t), de(e.agent?.headshot || null), w(!0), Le((e) => e + 1), S((e) => Mr(e, {
3093
3093
  id: `agent-joined-${Date.now()}`,
3094
3094
  sender: "system",
3095
3095
  message: `${t} has joined the chat.`,
@@ -3097,13 +3097,13 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3097
3097
  isPending: !1
3098
3098
  }));
3099
3099
  }, m = (e = {}) => {
3100
- let t = Ar([
3100
+ let t = jr([
3101
3101
  e.agent?.name,
3102
3102
  e.agentName,
3103
3103
  e.agent_name,
3104
3104
  Ct.current
3105
3105
  ], d);
3106
- re(!1), te("ai"), S((e) => jr(e, {
3106
+ re(!1), te("ai"), S((e) => Mr(e, {
3107
3107
  id: `agent-left-${Date.now()}`,
3108
3108
  sender: "system",
3109
3109
  message: `${t} has left the chat.`,
@@ -3112,7 +3112,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3112
3112
  }));
3113
3113
  };
3114
3114
  f.on("agent:joined", p), f.on("agentJoined", p), f.on("agent:left", m), f.on("agentLeft", m), f.on("conversationEnded", (e) => {
3115
- He(!0);
3115
+ Ve(!0);
3116
3116
  let t = e?.message || "This conversation has ended. Thank you for reaching out!";
3117
3117
  S((e) => [...e, {
3118
3118
  id: `conversation-ended-${Date.now()}`,
@@ -3122,10 +3122,10 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3122
3122
  isPending: !1
3123
3123
  }]);
3124
3124
  }), f.on("chat:history_update", (e) => {
3125
- let t = Er(e.chat_history || []);
3126
- S(t), t.length === 0 && (He(!1), re(!1), te("ai"), we(!1), Se(!1));
3125
+ let t = Dr(e.chat_history || []);
3126
+ S(t), t.length === 0 && (Ve(!1), re(!1), te("ai"), we(!1), Se(!1));
3127
3127
  }), f.on("conversation:reset", () => {
3128
- S([]), He(!1), re(!1), te("ai"), we(!1), Se(!1);
3128
+ S([]), Ve(!1), re(!1), te("ai"), we(!1), Se(!1);
3129
3129
  }), f.on("voice:end_session", (e = {}) => {
3130
3130
  console.log("[FlowEngageProvider] voice:end_session received — ending ElevenLabs session"), ze((e) => e + 1), w(!0), Le((e) => e + 1);
3131
3131
  }), f.on("typing:start", (e) => {
@@ -3133,18 +3133,18 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3133
3133
  }), f.on("typing:stop", (e) => {
3134
3134
  e.sender === "agent" && Se(!1);
3135
3135
  }), f.on("call:incoming", (e = {}) => {
3136
- let t = Ar([
3136
+ let t = jr([
3137
3137
  e.agentName,
3138
3138
  e.ownerName,
3139
3139
  e.agent?.name,
3140
3140
  Ct.current
3141
3141
  ], "Agent");
3142
- jt(), Mt(), gt.current = !1, Ke({
3142
+ jt(), Mt(), j.current = !1, Ue({
3143
3143
  callId: e.callId,
3144
3144
  from: e.from || "owner",
3145
3145
  agentId: e.agentId || null,
3146
3146
  agentName: t
3147
- }), D((e) => Ar([t, e], "Agent")), Xe("incoming"), Qe(null), w(!0);
3147
+ }), D((e) => jr([t, e], "Agent")), Xe("incoming"), Qe(null), w(!0);
3148
3148
  }), f.on("call:offer", async (e = {}) => {
3149
3149
  ft.current = e;
3150
3150
  try {
@@ -3154,7 +3154,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3154
3154
  }
3155
3155
  }), f.on("call:ice-candidate-from-agent", async (e = {}) => {
3156
3156
  if (e.candidate) try {
3157
- let t = kr(e);
3157
+ let t = Ar(e);
3158
3158
  if (!t) {
3159
3159
  console.warn("[FlowEngageProvider] ignoring invalid ICE candidate payload", e);
3160
3160
  return;
@@ -3162,7 +3162,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3162
3162
  if (!lt.current || !lt.current.remoteDescription) {
3163
3163
  console.log("[FlowEngageProvider] queueing agent ICE candidate until peer/remote description is ready", {
3164
3164
  callId: e.callId,
3165
- chatId: e.chatId || j.current,
3165
+ chatId: e.chatId || ot.current,
3166
3166
  queueSize: pt.current.length + 1
3167
3167
  }), pt.current.push(t);
3168
3168
  return;
@@ -3187,38 +3187,38 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3187
3187
  if (!e.callId) return;
3188
3188
  let t = ht.current === e.callId, n = mt.current === e.callId, r = ft.current?.callId === e.callId, i = ct.current?.callId === e.callId;
3189
3189
  if (!t && !n && !r) {
3190
- i && (Ke(null), Xe("idle"));
3190
+ i && (Ue(null), Xe("idle"));
3191
3191
  return;
3192
3192
  }
3193
- gt.current = !0, ht.current = null, mt.current = e.callId, Je(e.callId), Ke(null), Xe("connected"), Qe(e.connectedAt || (/* @__PURE__ */ new Date()).toISOString()), w(!0);
3193
+ j.current = !0, ht.current = null, mt.current = e.callId, Je(e.callId), Ue(null), Xe("connected"), Qe(e.connectedAt || (/* @__PURE__ */ new Date()).toISOString()), w(!0);
3194
3194
  }), f.on("call:unavailable", (e = {}) => {
3195
- Pt("socket:call_unavailable"), nt(Or(e, "This visitor is not available for a call right now.")), w(!0);
3195
+ Pt("socket:call_unavailable"), nt(kr(e, "This visitor is not available for a call right now.")), w(!0);
3196
3196
  }), f.on("call:error", (e = {}) => {
3197
- Pt("socket:call_error"), nt(Or(e, "We couldn't connect the call right now.")), w(!0);
3197
+ Pt("socket:call_error"), nt(kr(e, "We couldn't connect the call right now.")), w(!0);
3198
3198
  }), f.on("visitor:navigate", async ({ url: e, section: n, highlight: r } = {}) => {
3199
- e && await hr(e, {
3199
+ e && await gr(e, {
3200
3200
  siteId: t.siteId,
3201
3201
  apiBaseUrl: t.apiBaseUrl
3202
- }) && br(e, { voiceActive: Et.current }).then((e) => {
3202
+ }) && xr(e, { voiceActive: Et.current }).then((e) => {
3203
3203
  let t = n || r;
3204
3204
  t && setTimeout(() => {
3205
- let e = ur(null, t);
3206
- e && dr(e);
3205
+ let e = dr(null, t);
3206
+ e && fr(e);
3207
3207
  }, e ? 300 : 150);
3208
3208
  });
3209
3209
  }), f.on("visitor:highlight", ({ sectionId: e, sectionText: t } = {}) => {
3210
3210
  if (!e && !t) return;
3211
- let n = ur(e || null, t || null);
3212
- n && dr(n);
3211
+ let n = dr(e || null, t || null);
3212
+ n && fr(n);
3213
3213
  }), f.on("visitor:clear_highlight", () => {
3214
- fr();
3215
- }), Ot.current = Pn({
3214
+ pr();
3215
+ }), Ot.current = Fn({
3216
3216
  socket: f,
3217
3217
  chatId: c
3218
3218
  });
3219
3219
  let h = await l.loadHistory(c, r);
3220
3220
  if (!e) return;
3221
- S(Er(h.chat_history || [])), re(!!h.is_human_handled), te(h.is_human_handled ? "agent" : T);
3221
+ S(Dr(h.chat_history || [])), re(!!h.is_human_handled), te(h.is_human_handled ? "agent" : T);
3222
3222
  let g = h?.visitor_email || h?.visitorEmail;
3223
3223
  if (g && String(g).trim() && Nt(String(g).trim()), await new Promise((e) => setTimeout(e, 500)), !e) return;
3224
3224
  u("ready");
@@ -3237,33 +3237,33 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3237
3237
  a
3238
3238
  ]), c(() => () => {
3239
3239
  if (Pe && !Tt.current && wt.current.length > 0) {
3240
- let e = j.current, t = wt.current, n = A.current;
3240
+ let e = ot.current, t = wt.current, n = k.current;
3241
3241
  n && e && t.length > 0 && (console.log("[FlowEngageProvider] safety-net: syncing voice transcript on unmount"), n.beaconSyncVoice(e, t) || n.syncVoice(e, t).catch(() => {}), Tt.current = !0);
3242
3242
  }
3243
3243
  }, [Pe, _]);
3244
3244
  let zt = p(null);
3245
3245
  c(() => {
3246
- let e = A.current;
3246
+ let e = k.current;
3247
3247
  !e || !y || zt.current !== C && (C ? e.updateChatStatus(y, "open").catch(() => {}) : zt.current === !0 && e.updateChatStatus(y, "widget_closed").catch(() => {}), zt.current = C);
3248
3248
  }, [C, y]), c(() => {
3249
3249
  if (!C || !y) return;
3250
3250
  let e = setInterval(() => {
3251
- let e = A.current;
3252
- e && y && e.updateChatStatus(y, "widget_heartbeat").catch(() => {});
3251
+ let e = k.current;
3252
+ e && y && e.updateChatStatus(y, "open").catch(() => {});
3253
3253
  }, 1e4);
3254
3254
  return () => clearInterval(e);
3255
3255
  }, [C, y]), c(() => {
3256
3256
  let e = () => {
3257
- let e = j.current, t = A.current;
3257
+ let e = ot.current, t = k.current;
3258
3258
  !e || !t || typeof navigator > "u" || t.beaconWidgetClosed?.(e) || t.updateChatStatus(e, "widget_closed").catch(() => {});
3259
3259
  };
3260
3260
  return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
3261
3261
  }, []), c(() => {
3262
- if (!A.current || !y || l !== "ready") return;
3262
+ if (!k.current || !y || l !== "ready") return;
3263
3263
  let e = window.setInterval(async () => {
3264
3264
  try {
3265
- let e = await A.current.checkHumanHandled(y);
3266
- re(!!e.is_human_handled), e.is_human_handled && (te("agent"), e.agent_info?.name && D(Ar([e.agent_info.name], "Agent")), e.agent_info?.headshot && de(e.agent_info.headshot)), kt(e);
3265
+ let e = await k.current.checkHumanHandled(y);
3266
+ re(!!e.is_human_handled), e.is_human_handled && (te("agent"), e.agent_info?.name && D(jr([e.agent_info.name], "Agent")), e.agent_info?.headshot && de(e.agent_info.headshot)), kt(e);
3267
3267
  } catch {}
3268
3268
  }, 1e4);
3269
3269
  return () => window.clearInterval(e);
@@ -3273,14 +3273,14 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3273
3273
  kt
3274
3274
  ]);
3275
3275
  let Bt = async () => {
3276
- if (!(!k?.callId || !A.current || !at.current || !y)) {
3277
- jt(), ht.current = k.callId, Mt();
3276
+ if (!(!He?.callId || !k.current || !at.current || !y)) {
3277
+ jt(), ht.current = He.callId, Mt();
3278
3278
  try {
3279
3279
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
3280
3280
  ut.current = e;
3281
3281
  let t = [{ urls: "stun:stun.l.google.com:19302" }];
3282
3282
  try {
3283
- let e = await A.current.getIceServersConfig();
3283
+ let e = await k.current.getIceServersConfig();
3284
3284
  e?.data?.iceServers?.length && (t = e.data.iceServers);
3285
3285
  } catch (e) {
3286
3286
  console.warn("[FlowEngageProvider] ice-config fetch failed, using STUN default", e);
@@ -3314,7 +3314,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3314
3314
  if (!e.candidate || !at.current?.connected) return;
3315
3315
  let t = e.candidate;
3316
3316
  at.current.emit("call:ice-candidate", {
3317
- callId: k.callId,
3317
+ callId: He.callId,
3318
3318
  candidate: t.candidate,
3319
3319
  sdpMid: t.sdpMid,
3320
3320
  sdpMLineIndex: t.sdpMLineIndex,
@@ -3328,8 +3328,8 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3328
3328
  e.id = "flowengage-remote-audio", e.autoplay = !0, e.playsInline = !0, e.onplay = () => {}, e.onpause = () => {}, e.onended = () => {}, e.onerror = (e) => {}, dt.current = e, document.body.appendChild(e);
3329
3329
  }
3330
3330
  dt.current.srcObject = e.streams[0];
3331
- let r = k?.callId, i = r && (ht.current === r || mt.current === r);
3332
- if (!gt.current && i) {
3331
+ let r = He?.callId, i = r && (ht.current === r || mt.current === r);
3332
+ if (!j.current && i) {
3333
3333
  let e = (/* @__PURE__ */ new Date()).toISOString();
3334
3334
  Xe("connected"), Qe((t) => t || e), mt.current = r, Je(r), Ft(e);
3335
3335
  }
@@ -3339,20 +3339,20 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3339
3339
  };
3340
3340
  let r = ft.current;
3341
3341
  r && (console.log("[FlowEngageProvider] found pending remote offer during accept", {
3342
- callId: r.callId || k.callId,
3342
+ callId: r.callId || He.callId,
3343
3343
  chatId: y
3344
3344
  }), await Rt({
3345
3345
  ...r,
3346
- callId: r.callId || k.callId
3347
- })), await A.current.acceptCall(k.callId, y), mt.current = k.callId, Je(k.callId), Xe((e) => e === "connected" || gt.current ? "connected" : "connecting"), Ke(null), w(!0);
3346
+ callId: r.callId || He.callId
3347
+ })), await k.current.acceptCall(He.callId, y), mt.current = He.callId, Je(He.callId), Xe((e) => e === "connected" || j.current ? "connected" : "connecting"), Ue(null), w(!0);
3348
3348
  } catch (e) {
3349
3349
  if (ht.current = null, Pt("accept_call_failed"), e?.status === 404 || e?.status === 409 || e?.status === 422) {
3350
- nt(Or(e, "This visitor call is no longer available."));
3350
+ nt(kr(e, "This visitor call is no longer available."));
3351
3351
  return;
3352
3352
  }
3353
3353
  if (e?.name === "NotAllowedError" || e?.name === "PermissionDeniedError") {
3354
3354
  try {
3355
- await A.current.rejectCall(k.callId, y);
3355
+ await k.current.rejectCall(He.callId, y);
3356
3356
  } catch (e) {
3357
3357
  console.error("[FlowEngageProvider] failed to reject call after microphone denial", e);
3358
3358
  }
@@ -3363,45 +3363,45 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3363
3363
  }
3364
3364
  }
3365
3365
  }, Vt = async () => {
3366
- if (!k?.callId || !A.current || !y) {
3366
+ if (!He?.callId || !k.current || !y) {
3367
3367
  Pt("reject_call_without_server_context");
3368
3368
  return;
3369
3369
  }
3370
3370
  Mt(), jt();
3371
3371
  try {
3372
- await A.current.rejectCall(k.callId, y);
3372
+ await k.current.rejectCall(He.callId, y);
3373
3373
  } catch (e) {
3374
- nt(Or(e, "We couldn't decline the call cleanly."));
3374
+ nt(kr(e, "We couldn't decline the call cleanly."));
3375
3375
  } finally {
3376
3376
  Pt("reject_call_finally");
3377
3377
  }
3378
3378
  }, Ht = p(Vt);
3379
3379
  Ht.current = Vt, c(() => {
3380
- if (!k?.callId || qe) {
3380
+ if (!He?.callId || qe) {
3381
3381
  Mt();
3382
3382
  return;
3383
3383
  }
3384
- let e = k.callId;
3385
- return Mt(), M.current = window.setTimeout(() => {
3384
+ let e = He.callId;
3385
+ return Mt(), gt.current = window.setTimeout(() => {
3386
3386
  ct.current?.callId === e && ht.current !== e && mt.current !== e && Ht.current();
3387
3387
  }, oe), () => {
3388
- M.current &&= (window.clearTimeout(M.current), null);
3388
+ gt.current &&= (window.clearTimeout(gt.current), null);
3389
3389
  };
3390
3390
  }, [
3391
3391
  qe,
3392
3392
  Mt,
3393
- k?.callId
3393
+ He?.callId
3394
3394
  ]);
3395
3395
  let Ut = async () => {
3396
- if (!qe || !A.current || !y) {
3396
+ if (!qe || !k.current || !y) {
3397
3397
  Pt("end_call_without_server_context");
3398
3398
  return;
3399
3399
  }
3400
3400
  jt();
3401
3401
  try {
3402
- await A.current.endWebRTCCall(qe, y);
3402
+ await k.current.endWebRTCCall(qe, y);
3403
3403
  } catch (e) {
3404
- nt(Or(e, "The call ended locally, but the server could not be updated."));
3404
+ nt(kr(e, "The call ended locally, but the server could not be updated."));
3405
3405
  } finally {
3406
3406
  Pt("end_call_finally");
3407
3407
  }
@@ -3414,23 +3414,23 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3414
3414
  }), et(r);
3415
3415
  }, Gt = async (e = {}) => {
3416
3416
  let t = e.notifyChatInitiated === !0;
3417
- if (w(!0), !(!t || !A.current || !y || typeof window > "u")) {
3417
+ if (w(!0), !(!t || !k.current || !y || typeof window > "u")) {
3418
3418
  try {
3419
- await A.current.trackVisitor({
3419
+ await k.current.trackVisitor({
3420
3420
  chatId: y,
3421
3421
  currentPagePath: window.location.pathname || "/"
3422
3422
  });
3423
3423
  } catch {}
3424
3424
  try {
3425
- await A.current.updateChatStatus(y, "open");
3425
+ await k.current.updateChatStatus(y, "open");
3426
3426
  } catch {}
3427
3427
  }
3428
3428
  }, Kt = async (e) => {
3429
3429
  let t = Nt(e);
3430
- if (!t || !A.current || !j.current) return t;
3430
+ if (!t || !k.current || !ot.current) return t;
3431
3431
  try {
3432
- await A.current.trackVisitor({
3433
- chatId: j.current,
3432
+ await k.current.trackVisitor({
3433
+ chatId: ot.current,
3434
3434
  currentPagePath: typeof window < "u" && window.location.pathname || "/",
3435
3435
  email: t
3436
3436
  });
@@ -3456,7 +3456,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3456
3456
  text: t
3457
3457
  }));
3458
3458
  }, Xt = async (e, t = "", n = null, a = {}) => {
3459
- if (!(typeof e == "string" && e.trim()) || !A.current || !y || l !== "ready" || Ve) return;
3459
+ if (!(typeof e == "string" && e.trim()) || !k.current || !y || l !== "ready" || Be) return;
3460
3460
  Jt();
3461
3461
  let o = `pending-user-${Date.now()}`, s = {
3462
3462
  id: o,
@@ -3471,7 +3471,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3471
3471
  S((e) => [...e, s]);
3472
3472
  let c = ne;
3473
3473
  if (c) try {
3474
- c = kt(await A.current.checkHumanHandled(y));
3474
+ c = kt(await k.current.checkHumanHandled(y));
3475
3475
  } catch {}
3476
3476
  if (c && at.current?.connected) {
3477
3477
  at.current.emit("customer:message", {
@@ -3487,7 +3487,7 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3487
3487
  }
3488
3488
  ke(!0);
3489
3489
  try {
3490
- let o = await A.current.sendAiMessage(y, e, r, t, {
3490
+ let o = await k.current.sendAiMessage(y, e, r, t, {
3491
3491
  ...n || {},
3492
3492
  ...fe ? { email: fe } : {}
3493
3493
  }, {
@@ -3497,44 +3497,44 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3497
3497
  currentPagePath: typeof window < "u" ? window.location.pathname : void 0
3498
3498
  }), s = o.chat_history || [], c = [...s].reverse().find((e) => e.sender === "bot" || e.sender === "assistant");
3499
3499
  if (c?.message) {
3500
- let e = Dr(c.message);
3501
- e && hr(e.url, {
3500
+ let e = Or(c.message);
3501
+ e && gr(e.url, {
3502
3502
  siteId: i?.siteId,
3503
3503
  apiBaseUrl: i?.apiBaseUrl
3504
3504
  }).then((t) => {
3505
- t && br(e.url, { voiceActive: Et.current }).then((t) => {
3505
+ t && xr(e.url, { voiceActive: Et.current }).then((t) => {
3506
3506
  e.section && setTimeout(() => {
3507
- let t = ur(null, e.section);
3508
- t && dr(t);
3507
+ let t = dr(null, e.section);
3508
+ t && fr(t);
3509
3509
  }, t ? 300 : 150);
3510
3510
  });
3511
3511
  });
3512
3512
  }
3513
- S(Er(s)), re(!!o.is_human_handled), te(o.is_human_handled ? "agent" : "ai"), we(!1), ke(!1), await A.current.updateChatStatus(y, "messageSent");
3513
+ S(Dr(s)), re(!!o.is_human_handled), te(o.is_human_handled ? "agent" : "ai"), we(!1), ke(!1), await k.current.updateChatStatus(y, "messageSent");
3514
3514
  } catch (e) {
3515
3515
  S((e) => e.filter((e) => e.id !== o)), we(!1), ke(!1), e.status === 429 ? (je(!0), O(e.message), window.setTimeout(() => {
3516
3516
  je(!1), O("");
3517
3517
  }, ie)) : h(e);
3518
3518
  }
3519
3519
  }, Zt = async (e) => {
3520
- if (!A.current || !e) throw Error("Upload is unavailable right now.");
3521
- return A.current.uploadChatFile(e);
3520
+ if (!k.current || !e) throw Error("Upload is unavailable right now.");
3521
+ return k.current.uploadChatFile(e);
3522
3522
  }, Qt = async (e) => {
3523
- if (!(!A.current || !y)) {
3523
+ if (!(!k.current || !y)) {
3524
3524
  try {
3525
3525
  let t = e ? "voice" : "text";
3526
- await A.current.setChatMode(y, t);
3526
+ await k.current.setChatMode(y, t);
3527
3527
  } catch {}
3528
3528
  Fe(e), e && (Tt.current = !1);
3529
3529
  }
3530
3530
  }, $t = async (e) => {
3531
3531
  if (Tt.current) return;
3532
- if (Tt.current = !0, !A.current || !y || !e?.length) {
3532
+ if (Tt.current = !0, !k.current || !y || !e?.length) {
3533
3533
  Fe(!1);
3534
3534
  return;
3535
3535
  }
3536
3536
  let t = () => {
3537
- let t = Er(e);
3537
+ let t = Dr(e);
3538
3538
  S((e) => {
3539
3539
  if (!e.length) return t;
3540
3540
  let n = e[e.length - 1], r = t[0];
@@ -3542,11 +3542,11 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3542
3542
  });
3543
3543
  };
3544
3544
  try {
3545
- let n = await A.current.syncVoice(y, e);
3546
- if (n?.chat_history?.length) S(Er(n.chat_history));
3545
+ let n = await k.current.syncVoice(y, e);
3546
+ if (n?.chat_history?.length) S(Dr(n.chat_history));
3547
3547
  else if (n?.success) try {
3548
- let e = await A.current.loadHistory(y, r);
3549
- e?.chat_history?.length ? S(Er(e.chat_history)) : t();
3548
+ let e = await k.current.loadHistory(y, r);
3549
+ e?.chat_history?.length ? S(Dr(e.chat_history)) : t();
3550
3550
  } catch {
3551
3551
  t();
3552
3552
  }
@@ -3557,16 +3557,16 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3557
3557
  Fe(!1);
3558
3558
  }
3559
3559
  }, en = async () => {
3560
- if (!(!A.current || !y)) {
3560
+ if (!(!k.current || !y)) {
3561
3561
  Pe && !Tt.current && wt.current.length > 0 && await $t(wt.current);
3562
3562
  try {
3563
- await A.current.endConversation(y);
3563
+ await k.current.endConversation(y);
3564
3564
  } catch {
3565
3565
  try {
3566
- await A.current.updateChatStatus(y, "ended");
3566
+ await k.current.updateChatStatus(y, "ended");
3567
3567
  } catch {}
3568
3568
  }
3569
- He(!0), S((e) => [...e, {
3569
+ Ve(!0), S((e) => [...e, {
3570
3570
  id: `conversation-ended-${Date.now()}`,
3571
3571
  sender: "system",
3572
3572
  message: "This conversation has ended. Thank you for reaching out!",
@@ -3590,13 +3590,9 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3590
3590
  At
3591
3591
  ]), c(() => {
3592
3592
  let e = () => {
3593
- let e = j.current, t = A.current;
3593
+ let e = ot.current, t = k.current;
3594
3594
  if (!t || !e) return;
3595
- if (Et.current && wt.current.length > 0) {
3596
- let e = Dt.current?.siteId;
3597
- Ne(), e && typeof window < "u" && Be(e, window.location.href);
3598
- }
3599
- if (!Tt.current && wt.current.length > 0 && (t.beaconSyncVoice(e, wt.current) || t.syncVoice(e, wt.current).catch(() => {}), Tt.current = !0), mt.current) {
3595
+ if (Et.current && wt.current.length > 0 && Ne(), !Tt.current && wt.current.length > 0 && (t.beaconSyncVoice(e, wt.current) || t.syncVoice(e, wt.current).catch(() => {}), Tt.current = !0), mt.current) {
3600
3596
  t.beaconEndWebRTCCall(mt.current, e);
3601
3597
  return;
3602
3598
  }
@@ -3609,9 +3605,9 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3609
3605
  }, []);
3610
3606
  let tn = o(() => {
3611
3607
  let e = i?.siteId;
3612
- ge(e), ot.current = !0, st.current = null, at.current?.disconnect(), S([]), b(""), j.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3608
+ ge(e), A.current = !0, st.current = null, at.current?.disconnect(), S([]), b(""), ot.current = "", Ve(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3613
3609
  }, [i?.siteId]), nn = o((e) => {
3614
- i?.siteId, ot.current = !1, st.current = e, at.current?.disconnect(), S([]), b(""), j.current = "", He(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3610
+ i?.siteId, A.current = !1, st.current = e, at.current?.disconnect(), S([]), b(""), ot.current = "", Ve(!1), re(!1), D(null), de(null), it(!0), s((e) => e + 1);
3615
3611
  }, [i?.siteId]), rn = f(() => ({
3616
3612
  status: l,
3617
3613
  error: d,
@@ -3632,11 +3628,11 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3632
3628
  isVoiceMode: Pe,
3633
3629
  isRateLimited: Ae,
3634
3630
  rateLimitMessage: Me,
3635
- isConversationEnded: Ve,
3631
+ isConversationEnded: Be,
3636
3632
  isSessionRestoring: rt,
3637
3633
  openToChatCounter: Ie,
3638
3634
  voiceEndCounter: Re,
3639
- incomingCall: k,
3635
+ incomingCall: He,
3640
3636
  activeCallId: qe,
3641
3637
  callConnectionState: Ye,
3642
3638
  callConnectedAt: Ze,
@@ -3667,8 +3663,8 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3667
3663
  endConversation: en,
3668
3664
  startNewChat: tn,
3669
3665
  resumeChat: nn,
3670
- getVisitorChatHistory: () => A.current?.getVisitorChatHistory?.(),
3671
- getVisitorChatThread: (e) => A.current?.getVisitorChatThread?.(e),
3666
+ getVisitorChatHistory: () => k.current?.getVisitorChatHistory?.(),
3667
+ getVisitorChatThread: (e) => k.current?.getVisitorChatThread?.(e),
3672
3668
  acceptCall: Bt,
3673
3669
  rejectCall: Vt,
3674
3670
  endWebRTCCall: Ut,
@@ -3693,11 +3689,11 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3693
3689
  Pe,
3694
3690
  Ae,
3695
3691
  Me,
3696
- Ve,
3692
+ Be,
3697
3693
  rt,
3698
3694
  Ie,
3699
3695
  Re,
3700
- k,
3696
+ He,
3701
3697
  qe,
3702
3698
  Ye,
3703
3699
  Ze,
@@ -3721,77 +3717,77 @@ function Mr({ siteId: e, config: t, children: n, language: r = "en" }) {
3721
3717
  tn,
3722
3718
  jt
3723
3719
  ]);
3724
- return /* @__PURE__ */ g(Fn.Provider, {
3720
+ return /* @__PURE__ */ g(In.Provider, {
3725
3721
  value: rn,
3726
3722
  children: n
3727
3723
  });
3728
3724
  }
3729
3725
  //#endregion
3730
3726
  //#region node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs
3731
- var Nr = r({});
3727
+ var Pr = r({});
3732
3728
  //#endregion
3733
3729
  //#region node_modules/framer-motion/dist/es/utils/use-constant.mjs
3734
- function Pr(e) {
3730
+ function Fr(e) {
3735
3731
  let t = p(null);
3736
3732
  return t.current === null && (t.current = e()), t.current;
3737
3733
  }
3738
3734
  //#endregion
3739
3735
  //#region node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
3740
- var Fr = typeof window < "u" ? d : c, Ir = /* @__PURE__ */ r(null);
3736
+ var Ir = typeof window < "u" ? d : c, Lr = /* @__PURE__ */ r(null);
3741
3737
  //#endregion
3742
3738
  //#region node_modules/motion-utils/dist/es/array.mjs
3743
- function Lr(e, t) {
3739
+ function Rr(e, t) {
3744
3740
  e.indexOf(t) === -1 && e.push(t);
3745
3741
  }
3746
- function Rr(e, t) {
3742
+ function zr(e, t) {
3747
3743
  let n = e.indexOf(t);
3748
3744
  n > -1 && e.splice(n, 1);
3749
3745
  }
3750
3746
  //#endregion
3751
3747
  //#region node_modules/motion-utils/dist/es/clamp.mjs
3752
- var zr = (e, t, n) => n > t ? t : n < e ? e : n;
3748
+ var Br = (e, t, n) => n > t ? t : n < e ? e : n;
3753
3749
  //#endregion
3754
3750
  //#region node_modules/motion-utils/dist/es/format-error-message.mjs
3755
- function Br(e, t) {
3751
+ function Vr(e, t) {
3756
3752
  return t ? `${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}` : e;
3757
3753
  }
3758
3754
  //#endregion
3759
3755
  //#region node_modules/motion-utils/dist/es/errors.mjs
3760
- var Vr = () => {}, Hr = () => {};
3761
- typeof process < "u" && process.env.NODE_ENV !== "production" && (Vr = (e, t, n) => {
3762
- !e && typeof console < "u" && console.warn(Br(t, n));
3763
- }, Hr = (e, t, n) => {
3764
- if (!e) throw Error(Br(t, n));
3756
+ var Hr = () => {}, Ur = () => {};
3757
+ typeof process < "u" && process.env.NODE_ENV !== "production" && (Hr = (e, t, n) => {
3758
+ !e && typeof console < "u" && console.warn(Vr(t, n));
3759
+ }, Ur = (e, t, n) => {
3760
+ if (!e) throw Error(Vr(t, n));
3765
3761
  });
3766
3762
  //#endregion
3767
3763
  //#region node_modules/motion-utils/dist/es/global-config.mjs
3768
- var Ur = {}, Wr = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
3764
+ var Wr = {}, Gr = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);
3769
3765
  //#endregion
3770
3766
  //#region node_modules/motion-utils/dist/es/is-object.mjs
3771
- function Gr(e) {
3767
+ function Kr(e) {
3772
3768
  return typeof e == "object" && !!e;
3773
3769
  }
3774
3770
  //#endregion
3775
3771
  //#region node_modules/motion-utils/dist/es/is-zero-value-string.mjs
3776
- var Kr = (e) => /^0[^.\s]+$/u.test(e);
3772
+ var qr = (e) => /^0[^.\s]+$/u.test(e);
3777
3773
  //#endregion
3778
3774
  //#region node_modules/motion-utils/dist/es/memo.mjs
3779
3775
  /* @__NO_SIDE_EFFECTS__ */
3780
- function qr(e) {
3776
+ function Jr(e) {
3781
3777
  let t;
3782
3778
  return () => (t === void 0 && (t = e()), t);
3783
3779
  }
3784
3780
  //#endregion
3785
3781
  //#region node_modules/motion-utils/dist/es/noop.mjs
3786
- var Jr = /* @__NO_SIDE_EFFECTS__ */ (e) => e, Yr = (e, t) => (n) => t(e(n)), Xr = (...e) => e.reduce(Yr), Zr = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
3782
+ var Yr = /* @__NO_SIDE_EFFECTS__ */ (e) => e, Xr = (e, t) => (n) => t(e(n)), Zr = (...e) => e.reduce(Xr), Qr = /* @__NO_SIDE_EFFECTS__ */ (e, t, n) => {
3787
3783
  let r = t - e;
3788
3784
  return r === 0 ? 1 : (n - e) / r;
3789
- }, Qr = class {
3785
+ }, $r = class {
3790
3786
  constructor() {
3791
3787
  this.subscriptions = [];
3792
3788
  }
3793
3789
  add(e) {
3794
- return Lr(this.subscriptions, e), () => Rr(this.subscriptions, e);
3790
+ return Rr(this.subscriptions, e), () => zr(this.subscriptions, e);
3795
3791
  }
3796
3792
  notify(e, t, n) {
3797
3793
  let r = this.subscriptions.length;
@@ -3807,55 +3803,55 @@ var Jr = /* @__NO_SIDE_EFFECTS__ */ (e) => e, Yr = (e, t) => (n) => t(e(n)), Xr
3807
3803
  clear() {
3808
3804
  this.subscriptions.length = 0;
3809
3805
  }
3810
- }, $r = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, ei = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3;
3806
+ }, ei = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, ti = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3;
3811
3807
  //#endregion
3812
3808
  //#region node_modules/motion-utils/dist/es/velocity-per-second.mjs
3813
- function ti(e, t) {
3809
+ function ni(e, t) {
3814
3810
  return t ? 1e3 / t * e : 0;
3815
3811
  }
3816
3812
  //#endregion
3817
3813
  //#region node_modules/motion-utils/dist/es/warn-once.mjs
3818
- var ni = /* @__PURE__ */ new Set();
3819
- function ri(e, t, n) {
3820
- e || ni.has(t) || (console.warn(Br(t, n)), ni.add(t));
3814
+ var ri = /* @__PURE__ */ new Set();
3815
+ function ii(e, t, n) {
3816
+ e || ri.has(t) || (console.warn(Vr(t, n)), ri.add(t));
3821
3817
  }
3822
3818
  //#endregion
3823
3819
  //#region node_modules/motion-utils/dist/es/easing/cubic-bezier.mjs
3824
- var ii = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, ai = 1e-7, oi = 12;
3825
- function si(e, t, n, r, i) {
3820
+ var ai = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, oi = 1e-7, si = 12;
3821
+ function ci(e, t, n, r, i) {
3826
3822
  let a, o, s = 0;
3827
3823
  do
3828
- o = t + (n - t) / 2, a = ii(o, r, i) - e, a > 0 ? n = o : t = o;
3829
- while (Math.abs(a) > ai && ++s < oi);
3824
+ o = t + (n - t) / 2, a = ai(o, r, i) - e, a > 0 ? n = o : t = o;
3825
+ while (Math.abs(a) > oi && ++s < si);
3830
3826
  return o;
3831
3827
  }
3832
- function ci(e, t, n, r) {
3833
- if (e === t && n === r) return Jr;
3834
- let i = (t) => si(t, 0, 1, e, n);
3835
- return (e) => e === 0 || e === 1 ? e : ii(i(e), t, r);
3828
+ function li(e, t, n, r) {
3829
+ if (e === t && n === r) return Yr;
3830
+ let i = (t) => ci(t, 0, 1, e, n);
3831
+ return (e) => e === 0 || e === 1 ? e : ai(i(e), t, r);
3836
3832
  }
3837
3833
  //#endregion
3838
3834
  //#region node_modules/motion-utils/dist/es/easing/modifiers/mirror.mjs
3839
- var li = (e) => (t) => t <= .5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, ui = (e) => (t) => 1 - e(1 - t), di = /* @__PURE__ */ ci(.33, 1.53, .69, .99), fi = /* @__PURE__ */ ui(di), pi = /* @__PURE__ */ li(fi), mi = (e) => e >= 1 ? 1 : (e *= 2) < 1 ? .5 * fi(e) : .5 * (2 - 2 ** (-10 * (e - 1))), hi = (e) => 1 - Math.sin(Math.acos(e)), gi = ui(hi), _i = li(hi), vi = /* @__PURE__ */ ci(.42, 0, 1, 1), yi = /* @__PURE__ */ ci(0, 0, .58, 1), bi = /* @__PURE__ */ ci(.42, 0, .58, 1), xi = (e) => Array.isArray(e) && typeof e[0] != "number", Si = (e) => Array.isArray(e) && typeof e[0] == "number", Ci = {
3840
- linear: Jr,
3841
- easeIn: vi,
3842
- easeInOut: bi,
3843
- easeOut: yi,
3844
- circIn: hi,
3845
- circInOut: _i,
3846
- circOut: gi,
3847
- backIn: fi,
3848
- backInOut: pi,
3849
- backOut: di,
3850
- anticipate: mi
3851
- }, wi = (e) => typeof e == "string", Ti = (e) => {
3852
- if (Si(e)) {
3853
- Hr(e.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
3835
+ var ui = (e) => (t) => t <= .5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, di = (e) => (t) => 1 - e(1 - t), fi = /* @__PURE__ */ li(.33, 1.53, .69, .99), pi = /* @__PURE__ */ di(fi), mi = /* @__PURE__ */ ui(pi), hi = (e) => e >= 1 ? 1 : (e *= 2) < 1 ? .5 * pi(e) : .5 * (2 - 2 ** (-10 * (e - 1))), gi = (e) => 1 - Math.sin(Math.acos(e)), _i = di(gi), vi = ui(gi), yi = /* @__PURE__ */ li(.42, 0, 1, 1), bi = /* @__PURE__ */ li(0, 0, .58, 1), xi = /* @__PURE__ */ li(.42, 0, .58, 1), Si = (e) => Array.isArray(e) && typeof e[0] != "number", Ci = (e) => Array.isArray(e) && typeof e[0] == "number", wi = {
3836
+ linear: Yr,
3837
+ easeIn: yi,
3838
+ easeInOut: xi,
3839
+ easeOut: bi,
3840
+ circIn: gi,
3841
+ circInOut: vi,
3842
+ circOut: _i,
3843
+ backIn: pi,
3844
+ backInOut: mi,
3845
+ backOut: fi,
3846
+ anticipate: hi
3847
+ }, Ti = (e) => typeof e == "string", Ei = (e) => {
3848
+ if (Ci(e)) {
3849
+ Ur(e.length === 4, "Cubic bezier arrays must contain four numerical values.", "cubic-bezier-length");
3854
3850
  let [t, n, r, i] = e;
3855
- return ci(t, n, r, i);
3856
- } else if (wi(e)) return Hr(Ci[e] !== void 0, `Invalid easing type '${e}'`, "invalid-easing-type"), Ci[e];
3851
+ return li(t, n, r, i);
3852
+ } else if (Ti(e)) return Ur(wi[e] !== void 0, `Invalid easing type '${e}'`, "invalid-easing-type"), wi[e];
3857
3853
  return e;
3858
- }, Ei = [
3854
+ }, Di = [
3859
3855
  "setup",
3860
3856
  "read",
3861
3857
  "resolveKeyframes",
@@ -3864,13 +3860,13 @@ var li = (e) => (t) => t <= .5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, ui = (
3864
3860
  "preRender",
3865
3861
  "render",
3866
3862
  "postRender"
3867
- ], Di = {
3863
+ ], Oi = {
3868
3864
  value: null,
3869
3865
  addProjectionMetrics: null
3870
3866
  };
3871
3867
  //#endregion
3872
3868
  //#region node_modules/motion-dom/dist/es/frameloop/render-step.mjs
3873
- function Oi(e, t) {
3869
+ function ki(e, t) {
3874
3870
  let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = !1, a = !1, o = /* @__PURE__ */ new WeakSet(), s = {
3875
3871
  delta: 0,
3876
3872
  timestamp: 0,
@@ -3894,32 +3890,32 @@ function Oi(e, t) {
3894
3890
  }
3895
3891
  i = !0;
3896
3892
  let o = n;
3897
- n = r, r = o, n.forEach(l), t && Di.value && Di.value.frameloop[t].push(c), c = 0, n.clear(), i = !1, a && (a = !1, u.process(e));
3893
+ n = r, r = o, n.forEach(l), t && Oi.value && Oi.value.frameloop[t].push(c), c = 0, n.clear(), i = !1, a && (a = !1, u.process(e));
3898
3894
  }
3899
3895
  };
3900
3896
  return u;
3901
3897
  }
3902
3898
  //#endregion
3903
3899
  //#region node_modules/motion-dom/dist/es/frameloop/batcher.mjs
3904
- var ki = 40;
3905
- function Ai(e, t) {
3900
+ var Ai = 40;
3901
+ function ji(e, t) {
3906
3902
  let n = !1, r = !0, i = {
3907
3903
  delta: 0,
3908
3904
  timestamp: 0,
3909
3905
  isProcessing: !1
3910
- }, a = () => n = !0, o = Ei.reduce((e, n) => (e[n] = Oi(a, t ? n : void 0), e), {}), { setup: s, read: c, resolveKeyframes: l, preUpdate: u, update: d, preRender: f, render: p, postRender: m } = o, h = () => {
3911
- let a = Ur.useManualTiming, o = a ? i.timestamp : performance.now();
3912
- n = !1, a || (i.delta = r ? 1e3 / 60 : Math.max(Math.min(o - i.timestamp, ki), 1)), i.timestamp = o, i.isProcessing = !0, s.process(i), c.process(i), l.process(i), u.process(i), d.process(i), f.process(i), p.process(i), m.process(i), i.isProcessing = !1, n && t && (r = !1, e(h));
3906
+ }, a = () => n = !0, o = Di.reduce((e, n) => (e[n] = ki(a, t ? n : void 0), e), {}), { setup: s, read: c, resolveKeyframes: l, preUpdate: u, update: d, preRender: f, render: p, postRender: m } = o, h = () => {
3907
+ let a = Wr.useManualTiming, o = a ? i.timestamp : performance.now();
3908
+ n = !1, a || (i.delta = r ? 1e3 / 60 : Math.max(Math.min(o - i.timestamp, Ai), 1)), i.timestamp = o, i.isProcessing = !0, s.process(i), c.process(i), l.process(i), u.process(i), d.process(i), f.process(i), p.process(i), m.process(i), i.isProcessing = !1, n && t && (r = !1, e(h));
3913
3909
  }, g = () => {
3914
3910
  n = !0, r = !0, i.isProcessing || e(h);
3915
3911
  };
3916
3912
  return {
3917
- schedule: Ei.reduce((e, t) => {
3913
+ schedule: Di.reduce((e, t) => {
3918
3914
  let r = o[t];
3919
3915
  return e[t] = (e, t = !1, i = !1) => (n || g(), r.schedule(e, t, i)), e;
3920
3916
  }, {}),
3921
3917
  cancel: (e) => {
3922
- for (let t = 0; t < Ei.length; t++) o[Ei[t]].cancel(e);
3918
+ for (let t = 0; t < Di.length; t++) o[Di[t]].cancel(e);
3923
3919
  },
3924
3920
  state: i,
3925
3921
  steps: o
@@ -3927,12 +3923,12 @@ function Ai(e, t) {
3927
3923
  }
3928
3924
  //#endregion
3929
3925
  //#region node_modules/motion-dom/dist/es/frameloop/frame.mjs
3930
- var { schedule: ji, cancel: Mi, state: Ni, steps: Pi } = /* @__PURE__ */ Ai(typeof requestAnimationFrame < "u" ? requestAnimationFrame : Jr, !0), Fi;
3926
+ var { schedule: N, cancel: Mi, state: Ni, steps: Pi } = /* @__PURE__ */ ji(typeof requestAnimationFrame < "u" ? requestAnimationFrame : Yr, !0), Fi;
3931
3927
  function Ii() {
3932
3928
  Fi = void 0;
3933
3929
  }
3934
3930
  var Li = {
3935
- now: () => (Fi === void 0 && Li.set(Ni.isProcessing || Ur.useManualTiming ? Ni.timestamp : performance.now()), Fi),
3931
+ now: () => (Fi === void 0 && Li.set(Ni.isProcessing || Wr.useManualTiming ? Ni.timestamp : performance.now()), Fi),
3936
3932
  set: (e) => {
3937
3933
  Fi = e, queueMicrotask(Ii);
3938
3934
  }
@@ -3952,7 +3948,7 @@ var Gi = {
3952
3948
  transform: (e) => e
3953
3949
  }, Ki = {
3954
3950
  ...Gi,
3955
- transform: (e) => zr(0, 1, e)
3951
+ transform: (e) => Br(0, 1, e)
3956
3952
  }, qi = {
3957
3953
  ...Gi,
3958
3954
  default: 1
@@ -3973,7 +3969,7 @@ var Zi = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(
3973
3969
  [n]: parseFloat(o),
3974
3970
  alpha: s === void 0 ? 1 : parseFloat(s)
3975
3971
  };
3976
- }, ea = (e) => zr(0, 255, e), ta = {
3972
+ }, ea = (e) => Br(0, 255, e), ta = {
3977
3973
  ...Gi,
3978
3974
  transform: (e) => Math.round(ea(e))
3979
3975
  }, na = {
@@ -4101,7 +4097,7 @@ var Ma = (e, t, n) => e + (t - e) * n, Na = (e, t, n) => {
4101
4097
  ], Fa = (e) => Pa.find((t) => t.test(e));
4102
4098
  function Ia(e) {
4103
4099
  let t = Fa(e);
4104
- if (Vr(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !t) return !1;
4100
+ if (Hr(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`, "color-not-animatable"), !t) return !1;
4105
4101
  let n = t.parse(e);
4106
4102
  return t === da && (n = Aa(n)), n;
4107
4103
  }
@@ -4154,7 +4150,7 @@ function Wa(e, t) {
4154
4150
  }
4155
4151
  var Ga = (e, t) => {
4156
4152
  let n = Oa.createTransformer(t), r = xa(e), i = xa(t);
4157
- return r.indexes.var.length === i.indexes.var.length && r.indexes.color.length === i.indexes.color.length && r.indexes.number.length >= i.indexes.number.length ? Ra.has(e) && !i.values.length || Ra.has(t) && !r.values.length ? za(e, t) : Xr(Ha(Wa(r, i), i.values), n) : (Vr(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), ja(e, t));
4153
+ return r.indexes.var.length === i.indexes.var.length && r.indexes.color.length === i.indexes.color.length && r.indexes.number.length >= i.indexes.number.length ? Ra.has(e) && !i.values.length || Ra.has(t) && !r.values.length ? za(e, t) : Zr(Ha(Wa(r, i), i.values), n) : (Hr(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), ja(e, t));
4158
4154
  };
4159
4155
  //#endregion
4160
4156
  //#region node_modules/motion-dom/dist/es/utils/mix/index.mjs
@@ -4166,7 +4162,7 @@ function Ka(e, t, n) {
4166
4162
  var qa = (e) => {
4167
4163
  let t = ({ timestamp: t }) => e(t);
4168
4164
  return {
4169
- start: (e = !0) => ji.update(t, e),
4165
+ start: (e = !0) => N.update(t, e),
4170
4166
  stop: () => Mi(t),
4171
4167
  now: () => Ni.isProcessing ? Ni.timestamp : Li.now()
4172
4168
  };
@@ -4190,7 +4186,7 @@ function Za(e, t = 100, n) {
4190
4186
  return {
4191
4187
  type: "keyframes",
4192
4188
  ease: (e) => r.next(i * e).value / t,
4193
- duration: /* @__PURE__ */ ei(i)
4189
+ duration: /* @__PURE__ */ ti(i)
4194
4190
  };
4195
4191
  }
4196
4192
  //#endregion
@@ -4228,9 +4224,9 @@ function to(e, t, n) {
4228
4224
  var no = .001;
4229
4225
  function ro({ duration: e = Qa.duration, bounce: t = Qa.bounce, velocity: n = Qa.velocity, mass: r = Qa.mass }) {
4230
4226
  let i, a;
4231
- Vr(e <= /* @__PURE__ */ $r(Qa.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
4227
+ Hr(e <= /* @__PURE__ */ ei(Qa.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
4232
4228
  let o = 1 - t;
4233
- o = zr(Qa.minDamping, Qa.maxDamping, o), e = zr(Qa.minDuration, Qa.maxDuration, /* @__PURE__ */ ei(e)), o < 1 ? (i = (t) => {
4229
+ o = Br(Qa.minDamping, Qa.maxDamping, o), e = Br(Qa.minDuration, Qa.maxDuration, /* @__PURE__ */ ti(e)), o < 1 ? (i = (t) => {
4234
4230
  let r = t * o, i = r * e, a = r - n, s = $a(t, o), c = Math.exp(-i);
4235
4231
  return no - a / s * c;
4236
4232
  }, a = (t) => {
@@ -4241,7 +4237,7 @@ function ro({ duration: e = Qa.duration, bounce: t = Qa.bounce, velocity: n = Qa
4241
4237
  return -no + r * i;
4242
4238
  }, a = (t) => Math.exp(-t * e) * ((n - t) * (e * e)));
4243
4239
  let s = 5 / e, c = to(i, a, s);
4244
- if (e = /* @__PURE__ */ $r(e), isNaN(c)) return {
4240
+ if (e = /* @__PURE__ */ ei(e), isNaN(c)) return {
4245
4241
  stiffness: Qa.stiffness,
4246
4242
  damping: Qa.damping,
4247
4243
  duration: e
@@ -4273,7 +4269,7 @@ function so(e) {
4273
4269
  ...e
4274
4270
  };
4275
4271
  if (!oo(e, ao) && oo(e, io)) if (t.velocity = 0, e.visualDuration) {
4276
- let n = e.visualDuration, r = 2 * Math.PI / (n * 1.2), i = r * r, a = 2 * zr(.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(i);
4272
+ let n = e.visualDuration, r = 2 * Math.PI / (n * 1.2), i = r * r, a = 2 * Br(.05, 1, 1 - (e.bounce || 0)) * Math.sqrt(i);
4277
4273
  t = {
4278
4274
  ...t,
4279
4275
  mass: Qa.mass,
@@ -4303,8 +4299,8 @@ function co(e = Qa.visualDuration, t = Qa.bounce) {
4303
4299
  value: a
4304
4300
  }, { stiffness: c, damping: l, mass: u, duration: d, velocity: f, isResolvedFromDuration: p } = so({
4305
4301
  ...n,
4306
- velocity: -/* @__PURE__ */ ei(n.velocity || 0)
4307
- }), m = f || 0, h = l / (2 * Math.sqrt(c * u)), g = o - a, _ = /* @__PURE__ */ ei(Math.sqrt(c / u)), v = Math.abs(g) < 5;
4302
+ velocity: -/* @__PURE__ */ ti(n.velocity || 0)
4303
+ }), m = f || 0, h = l / (2 * Math.sqrt(c * u)), g = o - a, _ = /* @__PURE__ */ ti(Math.sqrt(c / u)), v = Math.abs(g) < 5;
4308
4304
  r ||= v ? Qa.restSpeed.granular : Qa.restSpeed.default, i ||= v ? Qa.restDelta.granular : Qa.restDelta.default;
4309
4305
  let y, b, x, S, C, w;
4310
4306
  if (h < 1) x = $a(_, h), S = (m + h * _ * g) / x, y = (e) => o - Math.exp(-h * _ * e) * (S * Math.sin(x * e) + g * Math.cos(x * e)), C = h * _ * S + g * x, w = h * _ * g - S * x, b = (e) => Math.exp(-h * _ * e) * (C * Math.sin(x * e) + w * Math.cos(x * e));
@@ -4326,16 +4322,16 @@ function co(e = Qa.visualDuration, t = Qa.bounce) {
4326
4322
  }
4327
4323
  let T = {
4328
4324
  calculatedDuration: p && d || null,
4329
- velocity: (e) => /* @__PURE__ */ $r(b(e)),
4325
+ velocity: (e) => /* @__PURE__ */ ei(b(e)),
4330
4326
  next: (e) => {
4331
4327
  if (!p && h < 1) {
4332
- let t = Math.exp(-h * _ * e), n = Math.sin(x * e), a = Math.cos(x * e), c = o - t * (S * n + g * a), l = /* @__PURE__ */ $r(t * (C * n + w * a));
4328
+ let t = Math.exp(-h * _ * e), n = Math.sin(x * e), a = Math.cos(x * e), c = o - t * (S * n + g * a), l = /* @__PURE__ */ ei(t * (C * n + w * a));
4333
4329
  return s.done = Math.abs(l) <= r && Math.abs(o - c) <= i, s.value = s.done ? o : c, s;
4334
4330
  }
4335
4331
  let t = y(e);
4336
4332
  if (p) s.done = e >= d;
4337
4333
  else {
4338
- let n = /* @__PURE__ */ $r(b(e));
4334
+ let n = /* @__PURE__ */ ei(b(e));
4339
4335
  s.done = Math.abs(n) <= r && Math.abs(o - t) <= i;
4340
4336
  }
4341
4337
  return s.value = s.done ? o : t, s;
@@ -4350,14 +4346,14 @@ function co(e = Qa.visualDuration, t = Qa.bounce) {
4350
4346
  }
4351
4347
  co.applyToOptions = (e) => {
4352
4348
  let t = Za(e, 100, co);
4353
- return e.ease = t.ease, e.duration = /* @__PURE__ */ $r(t.duration), e.type = "keyframes", e;
4349
+ return e.ease = t.ease, e.duration = /* @__PURE__ */ ei(t.duration), e.type = "keyframes", e;
4354
4350
  };
4355
4351
  //#endregion
4356
4352
  //#region node_modules/motion-dom/dist/es/animation/generators/utils/velocity.mjs
4357
4353
  var lo = 5;
4358
4354
  function uo(e, t, n) {
4359
4355
  let r = Math.max(t - lo, 0);
4360
- return ti(n - e(r), t - r);
4356
+ return ni(n - e(r), t - r);
4361
4357
  }
4362
4358
  //#endregion
4363
4359
  //#region node_modules/motion-dom/dist/es/animation/generators/inertia.mjs
@@ -4391,16 +4387,16 @@ function fo({ keyframes: e, velocity: t = 0, power: n = .8, timeConstant: r = 32
4391
4387
  //#endregion
4392
4388
  //#region node_modules/motion-dom/dist/es/utils/interpolate.mjs
4393
4389
  function po(e, t, n) {
4394
- let r = [], i = n || Ur.mix || Ka, a = e.length - 1;
4390
+ let r = [], i = n || Wr.mix || Ka, a = e.length - 1;
4395
4391
  for (let n = 0; n < a; n++) {
4396
4392
  let a = i(e[n], e[n + 1]);
4397
- t && (a = Xr(Array.isArray(t) ? t[n] || Jr : t, a)), r.push(a);
4393
+ t && (a = Zr(Array.isArray(t) ? t[n] || Yr : t, a)), r.push(a);
4398
4394
  }
4399
4395
  return r;
4400
4396
  }
4401
4397
  function mo(e, t, { clamp: n = !0, ease: r, mixer: i } = {}) {
4402
4398
  let a = e.length;
4403
- if (Hr(a === t.length, "Both input and output ranges must be the same length", "range-length"), a === 1) return () => t[0];
4399
+ if (Ur(a === t.length, "Both input and output ranges must be the same length", "range-length"), a === 1) return () => t[0];
4404
4400
  if (a === 2 && t[0] === t[1]) return () => t[1];
4405
4401
  let o = e[0] === e[1];
4406
4402
  e[0] > e[a - 1] && (e = [...e].reverse(), t = [...t].reverse());
@@ -4408,17 +4404,17 @@ function mo(e, t, { clamp: n = !0, ease: r, mixer: i } = {}) {
4408
4404
  if (o && n < e[0]) return t[0];
4409
4405
  let r = 0;
4410
4406
  if (c > 1) for (; r < e.length - 2 && !(n < e[r + 1]); r++);
4411
- let i = /* @__PURE__ */ Zr(e[r], e[r + 1], n);
4407
+ let i = /* @__PURE__ */ Qr(e[r], e[r + 1], n);
4412
4408
  return s[r](i);
4413
4409
  };
4414
- return n ? (t) => l(zr(e[0], e[a - 1], t)) : l;
4410
+ return n ? (t) => l(Br(e[0], e[a - 1], t)) : l;
4415
4411
  }
4416
4412
  //#endregion
4417
4413
  //#region node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.mjs
4418
4414
  function ho(e, t) {
4419
4415
  let n = e[e.length - 1];
4420
4416
  for (let r = 1; r <= t; r++) {
4421
- let i = /* @__PURE__ */ Zr(0, t, r);
4417
+ let i = /* @__PURE__ */ Qr(0, t, r);
4422
4418
  e.push(Ma(n, 1, i));
4423
4419
  }
4424
4420
  }
@@ -4436,10 +4432,10 @@ function _o(e, t) {
4436
4432
  //#endregion
4437
4433
  //#region node_modules/motion-dom/dist/es/animation/generators/keyframes.mjs
4438
4434
  function vo(e, t) {
4439
- return e.map(() => t || bi).splice(0, e.length - 1);
4435
+ return e.map(() => t || xi).splice(0, e.length - 1);
4440
4436
  }
4441
4437
  function yo({ duration: e = 300, keyframes: t, times: n, ease: r = "easeInOut" }) {
4442
- let i = xi(r) ? r.map(Ti) : Ti(r), a = {
4438
+ let i = Si(r) ? r.map(Ei) : Ei(r), a = {
4443
4439
  done: !1,
4444
4440
  value: t[0]
4445
4441
  }, o = mo(_o(n && n.length === t.length ? n : go(t), e), t, { ease: Array.isArray(i) ? i : vo(t, i) });
@@ -4501,7 +4497,7 @@ var wo = class {
4501
4497
  let { options: e } = this;
4502
4498
  Co(e);
4503
4499
  let { type: t = yo, repeat: n = 0, repeatDelay: r = 0, repeatType: i, velocity: a = 0 } = e, { keyframes: o } = e, s = t || yo;
4504
- process.env.NODE_ENV !== "production" && s !== yo && Hr(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`, "spring-two-frames"), s !== yo && typeof o[0] != "number" && (this.mixKeyframes = Xr(To, Ka(o[0], o[1])), o = [0, 100]);
4500
+ process.env.NODE_ENV !== "production" && s !== yo && Ur(o.length <= 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`, "spring-two-frames"), s !== yo && typeof o[0] != "number" && (this.mixKeyframes = Zr(To, Ka(o[0], o[1])), o = [0, 100]);
4505
4501
  let c = s({
4506
4502
  ...e,
4507
4503
  keyframes: o
@@ -4528,7 +4524,7 @@ var wo = class {
4528
4524
  let v = this.currentTime, y = n;
4529
4525
  if (u) {
4530
4526
  let e = Math.min(this.currentTime, r) / o, t = Math.floor(e), n = e % 1;
4531
- !n && e >= 1 && (n = 1), n === 1 && t--, t = Math.min(t, u + 1), t % 2 && (d === "reverse" ? (n = 1 - n, f && (n -= f / o)) : d === "mirror" && (y = a)), v = zr(0, 1, n) * o;
4527
+ !n && e >= 1 && (n = 1), n === 1 && t--, t = Math.min(t, u + 1), t % 2 && (d === "reverse" ? (n = 1 - n, f && (n -= f / o)) : d === "mirror" && (y = a)), v = Br(0, 1, n) * o;
4532
4528
  }
4533
4529
  let b;
4534
4530
  _ ? (this.delayState.value = l[0], b = this.delayState) : b = y.next(v), i && !_ && (b.value = i(b.value));
@@ -4541,17 +4537,17 @@ var wo = class {
4541
4537
  return this.finished.then(e, t);
4542
4538
  }
4543
4539
  get duration() {
4544
- return /* @__PURE__ */ ei(this.calculatedDuration);
4540
+ return /* @__PURE__ */ ti(this.calculatedDuration);
4545
4541
  }
4546
4542
  get iterationDuration() {
4547
4543
  let { delay: e = 0 } = this.options || {};
4548
- return this.duration + /* @__PURE__ */ ei(e);
4544
+ return this.duration + /* @__PURE__ */ ti(e);
4549
4545
  }
4550
4546
  get time() {
4551
- return /* @__PURE__ */ ei(this.currentTime);
4547
+ return /* @__PURE__ */ ti(this.currentTime);
4552
4548
  }
4553
4549
  set time(e) {
4554
- e = /* @__PURE__ */ $r(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver ? this.driver.start(!1) : (this.startTime = 0, this.state = "paused", this.holdTime = e, this.tick(e));
4550
+ e = /* @__PURE__ */ ei(e), this.currentTime = e, this.startTime === null || this.holdTime !== null || this.playbackSpeed === 0 ? this.holdTime = e : this.driver && (this.startTime = this.driver.now() - e / this.playbackSpeed), this.driver ? this.driver.start(!1) : (this.startTime = 0, this.state = "paused", this.holdTime = e, this.tick(e));
4555
4551
  }
4556
4552
  getGeneratorVelocity() {
4557
4553
  let e = this.currentTime;
@@ -4565,7 +4561,7 @@ var wo = class {
4565
4561
  }
4566
4562
  set speed(e) {
4567
4563
  let t = this.playbackSpeed !== e;
4568
- t && this.driver && this.updateTime(Li.now()), this.playbackSpeed = e, t && this.driver && (this.time = /* @__PURE__ */ ei(this.currentTime));
4564
+ t && this.driver && this.updateTime(Li.now()), this.playbackSpeed = e, t && this.driver && (this.time = /* @__PURE__ */ ti(this.currentTime));
4569
4565
  }
4570
4566
  play() {
4571
4567
  if (this.isStopped) return;
@@ -4742,7 +4738,7 @@ var es = class {
4742
4738
  this.state = "pending", this.isAsync = !1, this.needsMeasurement = !1, this.unresolvedKeyframes = [...e], this.onComplete = t, this.name = n, this.motionValue = r, this.element = i, this.isAsync = a;
4743
4739
  }
4744
4740
  scheduleResolve() {
4745
- this.state = "scheduled", this.isAsync ? (qo.add(this), Jo || (Jo = !0, ji.read(Qo), ji.resolveKeyframes(Zo))) : (this.readKeyframes(), this.complete());
4741
+ this.state = "scheduled", this.isAsync ? (qo.add(this), Jo || (Jo = !0, N.read(Qo), N.resolveKeyframes(Zo))) : (this.readKeyframes(), this.complete());
4746
4742
  }
4747
4743
  readKeyframes() {
4748
4744
  let { unresolvedKeyframes: e, name: t, element: n, motionValue: r } = this;
@@ -4782,7 +4778,7 @@ var rs = {};
4782
4778
  //#endregion
4783
4779
  //#region node_modules/motion-dom/dist/es/utils/supports/memo.mjs
4784
4780
  function is(e, t) {
4785
- let n = /* @__PURE__ */ qr(e);
4781
+ let n = /* @__PURE__ */ Jr(e);
4786
4782
  return () => rs[t] ?? n();
4787
4783
  }
4788
4784
  //#endregion
@@ -4828,7 +4824,7 @@ var as = /* @__PURE__ */ is(() => window.ScrollTimeline !== void 0, "scrollTimel
4828
4824
  //#endregion
4829
4825
  //#region node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs
4830
4826
  function ls(e, t) {
4831
- if (e) return typeof e == "function" ? os() ? Ja(e, t) : "ease-out" : Si(e) ? ss(e) : Array.isArray(e) ? e.map((e) => ls(e, t) || cs.easeOut) : cs[e];
4827
+ if (e) return typeof e == "function" ? os() ? Ja(e, t) : "ease-out" : Ci(e) ? ss(e) : Array.isArray(e) ? e.map((e) => ls(e, t) || cs.easeOut) : cs[e];
4832
4828
  }
4833
4829
  //#endregion
4834
4830
  //#region node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs
@@ -4836,7 +4832,7 @@ function us(e, t, n, { delay: r = 0, duration: i = 300, repeat: a = 0, repeatTyp
4836
4832
  let u = { [t]: n };
4837
4833
  c && (u.offset = c);
4838
4834
  let d = ls(s, i);
4839
- Array.isArray(d) && (u.easing = d), Di.value && Ri.waapi++;
4835
+ Array.isArray(d) && (u.easing = d), Oi.value && Ri.waapi++;
4840
4836
  let f = {
4841
4837
  delay: r,
4842
4838
  duration: i,
@@ -4847,7 +4843,7 @@ function us(e, t, n, { delay: r = 0, duration: i = 300, repeat: a = 0, repeatTyp
4847
4843
  };
4848
4844
  l && (f.pseudoElement = l);
4849
4845
  let p = e.animate(u, f);
4850
- return Di.value && p.finished.finally(() => {
4846
+ return Oi.value && p.finished.finally(() => {
4851
4847
  Ri.waapi--;
4852
4848
  }), p;
4853
4849
  }
@@ -4867,7 +4863,7 @@ var ps = class extends wo {
4867
4863
  constructor(e) {
4868
4864
  if (super(), this.finishedTime = null, this.isStopped = !1, this.manualStartTime = null, !e) return;
4869
4865
  let { element: t, name: n, keyframes: r, pseudoElement: i, allowFlatten: a = !1, finalKeyframe: o, onComplete: s } = e;
4870
- this.isPseudoElement = !!i, this.allowFlatten = a, this.options = e, Hr(typeof e.type != "string", "Mini animate() doesn't support \"type\" as a string.", "mini-spring");
4866
+ this.isPseudoElement = !!i, this.allowFlatten = a, this.options = e, Ur(typeof e.type != "string", "Mini animate() doesn't support \"type\" as a string.", "mini-spring");
4871
4867
  let c = fs(e);
4872
4868
  this.animation = us(t, n, r, c, i), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {
4873
4869
  if (this.finishedTime = this.time, !i) {
@@ -4903,18 +4899,18 @@ var ps = class extends wo {
4903
4899
  }
4904
4900
  get duration() {
4905
4901
  let e = this.animation.effect?.getComputedTiming?.().duration || 0;
4906
- return /* @__PURE__ */ ei(Number(e));
4902
+ return /* @__PURE__ */ ti(Number(e));
4907
4903
  }
4908
4904
  get iterationDuration() {
4909
4905
  let { delay: e = 0 } = this.options || {};
4910
- return this.duration + /* @__PURE__ */ ei(e);
4906
+ return this.duration + /* @__PURE__ */ ti(e);
4911
4907
  }
4912
4908
  get time() {
4913
- return /* @__PURE__ */ ei(Number(this.animation.currentTime) || 0);
4909
+ return /* @__PURE__ */ ti(Number(this.animation.currentTime) || 0);
4914
4910
  }
4915
4911
  set time(e) {
4916
4912
  let t = this.finishedTime !== null;
4917
- this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ $r(e), t && this.animation.pause();
4913
+ this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ ei(e), t && this.animation.pause();
4918
4914
  }
4919
4915
  get speed() {
4920
4916
  return this.animation.playbackRate;
@@ -4932,12 +4928,12 @@ var ps = class extends wo {
4932
4928
  this.manualStartTime = this.animation.startTime = e;
4933
4929
  }
4934
4930
  attachTimeline({ timeline: e, rangeStart: t, rangeEnd: n, observe: r }) {
4935
- return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && as() ? (this.animation.timeline = e, t && (this.animation.rangeStart = t), n && (this.animation.rangeEnd = n), Jr) : r(this);
4931
+ return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && as() ? (this.animation.timeline = e, t && (this.animation.rangeStart = t), n && (this.animation.rangeEnd = n), Yr) : r(this);
4936
4932
  }
4937
4933
  }, ms = {
4938
- anticipate: mi,
4939
- backInOut: pi,
4940
- circInOut: _i
4934
+ anticipate: hi,
4935
+ backInOut: mi,
4936
+ circInOut: vi
4941
4937
  };
4942
4938
  function hs(e) {
4943
4939
  return e in ms;
@@ -4961,7 +4957,7 @@ var _s = 10, vs = class extends ps {
4961
4957
  let o = new Eo({
4962
4958
  ...a,
4963
4959
  autoplay: !1
4964
- }), s = Math.max(_s, Li.now() - this.startTime), c = zr(0, _s, s - _s), l = o.sample(s).value, { name: u } = this.options;
4960
+ }), s = Math.max(_s, Li.now() - this.startTime), c = Br(0, _s, s - _s), l = o.sample(s).value, { name: u } = this.options;
4965
4961
  i && u && ns(i, u, l), t.setWithVelocity(o.sample(Math.max(0, s - c)).value, l, c), o.stop();
4966
4962
  }
4967
4963
  }, ys = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && (Oa.test(e) || e === "0") && !e.startsWith("url("));
@@ -4977,7 +4973,7 @@ function xs(e, t, n, r) {
4977
4973
  if (i === null) return !1;
4978
4974
  if (t === "display" || t === "visibility") return !0;
4979
4975
  let a = e[e.length - 1], o = ys(i, t), s = ys(a, t);
4980
- return Vr(o === s, `You are trying to animate ${t} from "${i}" to "${a}". "${o ? a : i}" is not an animatable value.`, "value-not-animatable"), !o || !s ? !1 : bs(e) || (n === "spring" || ds(n)) && r;
4976
+ return Hr(o === s, `You are trying to animate ${t} from "${i}" to "${a}". "${o ? a : i}" is not an animatable value.`, "value-not-animatable"), !o || !s ? !1 : bs(e) || (n === "spring" || ds(n)) && r;
4981
4977
  }
4982
4978
  //#endregion
4983
4979
  //#region node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.mjs
@@ -5009,7 +5005,7 @@ var Es = new Set([
5009
5005
  "borderRightColor",
5010
5006
  "borderBottomColor",
5011
5007
  "borderLeftColor"
5012
- ]), Ds = /* @__PURE__ */ qr(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
5008
+ ]), Ds = /* @__PURE__ */ Jr(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
5013
5009
  function Os(e) {
5014
5010
  let { motionValue: t, name: n, repeatDelay: r, repeatType: i, damping: a, type: o, keyframes: s } = e;
5015
5011
  if (!(t?.owner?.current instanceof HTMLElement)) return !1;
@@ -5042,7 +5038,7 @@ var ks = 40, As = class extends wo {
5042
5038
  let { name: i, type: a, velocity: o, delay: s, isHandoff: c, onUpdate: l } = n;
5043
5039
  this.resolvedAt = Li.now();
5044
5040
  let u = !0;
5045
- xs(e, i, a, o) || (u = !1, (Ur.instantAnimations || !s) && l?.(xo(e, n, t)), e[0] = e[e.length - 1], Ss(n), n.repeat = 0);
5041
+ xs(e, i, a, o) || (u = !1, (Wr.instantAnimations || !s) && l?.(xo(e, n, t)), e[0] = e[e.length - 1], Ss(n), n.repeat = 0);
5046
5042
  let d = {
5047
5043
  startTime: r ? this.resolvedAt && this.resolvedAt - this.createdAt > ks ? this.resolvedAt : this.createdAt : void 0,
5048
5044
  finalKeyframe: t,
@@ -5060,7 +5056,7 @@ var ks = 40, As = class extends wo {
5060
5056
  else m = new Eo(d);
5061
5057
  m.finished.then(() => {
5062
5058
  this.notifyFinished();
5063
- }).catch(Jr), this.pendingTimeline &&= (this.stopTimeline = m.attachTimeline(this.pendingTimeline), void 0), this._animation = m;
5059
+ }).catch(Yr), this.pendingTimeline &&= (this.stopTimeline = m.attachTimeline(this.pendingTimeline), void 0), this._animation = m;
5064
5060
  }
5065
5061
  get finished() {
5066
5062
  return this._animation ? this.animation.finished : this._finished;
@@ -5128,13 +5124,13 @@ function Ns(e) {
5128
5124
  }
5129
5125
  var Ps = 4;
5130
5126
  function Fs(e, t, n = 1) {
5131
- Hr(n <= Ps, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
5127
+ Ur(n <= Ps, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`, "max-css-var-depth");
5132
5128
  let [r, i] = Ns(e);
5133
5129
  if (!r) return;
5134
5130
  let a = window.getComputedStyle(t).getPropertyValue(r);
5135
5131
  if (a) {
5136
5132
  let e = a.trim();
5137
- return Wr(e) ? parseFloat(e) : e;
5133
+ return Gr(e) ? parseFloat(e) : e;
5138
5134
  }
5139
5135
  return Hi(i) ? Fs(i, t, n + 1) : i;
5140
5136
  }
@@ -5203,7 +5199,7 @@ function Ws(e) {
5203
5199
  //#region node_modules/motion-dom/dist/es/animation/interfaces/motion-value.mjs
5204
5200
  var Gs = (e, t, n, r = {}, i, a) => (o) => {
5205
5201
  let s = Hs(r, e) || {}, c = s.delay || r.delay || 0, { elapsed: l = 0 } = r;
5206
- l -= /* @__PURE__ */ $r(c);
5202
+ l -= /* @__PURE__ */ ei(c);
5207
5203
  let u = {
5208
5204
  keyframes: Array.isArray(n) ? n : [null, n],
5209
5205
  ease: "easeOut",
@@ -5220,12 +5216,12 @@ var Gs = (e, t, n, r = {}, i, a) => (o) => {
5220
5216
  motionValue: t,
5221
5217
  element: a ? void 0 : i
5222
5218
  };
5223
- Ws(s) || Object.assign(u, Bs(e, u)), u.duration &&= /* @__PURE__ */ $r(u.duration), u.repeatDelay &&= /* @__PURE__ */ $r(u.repeatDelay), u.from !== void 0 && (u.keyframes[0] = u.from);
5219
+ Ws(s) || Object.assign(u, Bs(e, u)), u.duration &&= /* @__PURE__ */ ei(u.duration), u.repeatDelay &&= /* @__PURE__ */ ei(u.repeatDelay), u.from !== void 0 && (u.keyframes[0] = u.from);
5224
5220
  let d = !1;
5225
- if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (Ss(u), u.delay === 0 && (d = !0)), (Ur.instantAnimations || Ur.skipAnimations || i?.shouldSkipAnimations) && (d = !0, Ss(u), u.delay = 0), u.allowFlatten = !s.type && !s.ease, d && !a && t.get() !== void 0) {
5221
+ if ((u.type === !1 || u.duration === 0 && !u.repeatDelay) && (Ss(u), u.delay === 0 && (d = !0)), (Wr.instantAnimations || Wr.skipAnimations || i?.shouldSkipAnimations) && (d = !0, Ss(u), u.delay = 0), u.allowFlatten = !s.type && !s.ease, d && !a && t.get() !== void 0) {
5226
5222
  let e = xo(u.keyframes, s);
5227
5223
  if (e !== void 0) {
5228
- ji.update(() => {
5224
+ N.update(() => {
5229
5225
  u.onUpdate(e), u.onComplete();
5230
5226
  });
5231
5227
  return;
@@ -5282,13 +5278,13 @@ var Ys = new Set([
5282
5278
  this.prevFrameValue = e, this.prevUpdatedAt = this.updatedAt;
5283
5279
  }
5284
5280
  onChange(e) {
5285
- return process.env.NODE_ENV !== "production" && ri(!1, "value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback)."), this.on("change", e);
5281
+ return process.env.NODE_ENV !== "production" && ii(!1, "value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback)."), this.on("change", e);
5286
5282
  }
5287
5283
  on(e, t) {
5288
- this.events[e] || (this.events[e] = new Qr());
5284
+ this.events[e] || (this.events[e] = new $r());
5289
5285
  let n = this.events[e].add(t);
5290
5286
  return e === "change" ? () => {
5291
- n(), ji.read(() => {
5287
+ n(), N.read(() => {
5292
5288
  this.events.change.getSize() || this.stop();
5293
5289
  });
5294
5290
  } : n;
@@ -5327,7 +5323,7 @@ var Ys = new Set([
5327
5323
  let e = Li.now();
5328
5324
  if (!this.canTrackVelocity || this.prevFrameValue === void 0 || e - this.updatedAt > Xs) return 0;
5329
5325
  let t = Math.min(this.updatedAt - this.prevUpdatedAt, Xs);
5330
- return ti(parseFloat(this.current) - parseFloat(this.prevFrameValue), t);
5326
+ return ni(parseFloat(this.current) - parseFloat(this.prevFrameValue), t);
5331
5327
  }
5332
5328
  start(e) {
5333
5329
  return this.stop(), new Promise((t) => {
@@ -5384,8 +5380,8 @@ function oc(e) {
5384
5380
  function sc(e, t) {
5385
5381
  let n = e.getValue("willChange");
5386
5382
  if (oc(n)) return n.add(t);
5387
- if (!n && Ur.WillChange) {
5388
- let n = new Ur.WillChange("auto");
5383
+ if (!n && Wr.WillChange) {
5384
+ let n = new Wr.WillChange("auto");
5389
5385
  e.addValue("willChange", n), n.add(t);
5390
5386
  }
5391
5387
  }
@@ -5420,14 +5416,14 @@ function fc(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
5420
5416
  ...Hs(a || {}, t)
5421
5417
  }, c = r.get();
5422
5418
  if (c !== void 0 && !r.isAnimating() && !Array.isArray(i) && i === c && !o.velocity) {
5423
- ji.update(() => r.set(i));
5419
+ N.update(() => r.set(i));
5424
5420
  continue;
5425
5421
  }
5426
5422
  let f = !1;
5427
5423
  if (window.MotionHandoffAnimation) {
5428
5424
  let n = uc(e);
5429
5425
  if (n) {
5430
- let e = window.MotionHandoffAnimation(n, t, ji);
5426
+ let e = window.MotionHandoffAnimation(n, t, N);
5431
5427
  e !== null && (o.startTime = e, f = !0);
5432
5428
  }
5433
5429
  }
@@ -5438,7 +5434,7 @@ function fc(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
5438
5434
  m && u.push(m);
5439
5435
  }
5440
5436
  if (o) {
5441
- let t = () => ji.update(() => {
5437
+ let t = () => N.update(() => {
5442
5438
  o && ic(e, o);
5443
5439
  });
5444
5440
  u.length ? Promise.all(u).then(t) : t();
@@ -5501,7 +5497,7 @@ var gc = {
5501
5497
  //#endregion
5502
5498
  //#region node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.mjs
5503
5499
  function bc(e) {
5504
- return typeof e == "number" ? e === 0 : e === null ? !0 : e === "none" || e === "0" || Kr(e);
5500
+ return typeof e == "number" ? e === 0 : e === null ? !0 : e === "none" || e === "0" || qr(e);
5505
5501
  }
5506
5502
  //#endregion
5507
5503
  //#region node_modules/motion-dom/dist/es/value/types/complex/filter.mjs
@@ -5723,11 +5719,11 @@ var Ic = (e, t) => t && typeof e == "number" ? t.transform(e) : e;
5723
5719
  //#endregion
5724
5720
  //#region node_modules/motion-dom/dist/es/utils/is-html-element.mjs
5725
5721
  function Lc(e) {
5726
- return Gr(e) && "offsetHeight" in e && !("ownerSVGElement" in e);
5722
+ return Kr(e) && "offsetHeight" in e && !("ownerSVGElement" in e);
5727
5723
  }
5728
5724
  //#endregion
5729
5725
  //#region node_modules/motion-dom/dist/es/frameloop/microtask.mjs
5730
- var { schedule: Rc, cancel: zc } = /* @__PURE__ */ Ai(queueMicrotask, !1), Bc = {
5726
+ var { schedule: Rc, cancel: zc } = /* @__PURE__ */ ji(queueMicrotask, !1), Bc = {
5731
5727
  x: !1,
5732
5728
  y: !1
5733
5729
  };
@@ -5866,7 +5862,7 @@ function il(e, t, n = {}) {
5866
5862
  //#endregion
5867
5863
  //#region node_modules/motion-dom/dist/es/utils/is-svg-element.mjs
5868
5864
  function al(e) {
5869
- return Gr(e) && "ownerSVGElement" in e;
5865
+ return Kr(e) && "ownerSVGElement" in e;
5870
5866
  }
5871
5867
  //#endregion
5872
5868
  //#region node_modules/motion-dom/dist/es/resize/handle-element.mjs
@@ -6036,7 +6032,7 @@ var Ul = class {
6036
6032
  this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
6037
6033
  }, this.renderScheduledAt = 0, this.scheduleRender = () => {
6038
6034
  let e = Li.now();
6039
- this.renderScheduledAt < e && (this.renderScheduledAt = e, ji.render(this.render, !1, !0));
6035
+ this.renderScheduledAt < e && (this.renderScheduledAt = e, N.render(this.render, !1, !0));
6040
6036
  };
6041
6037
  let { latestValues: c, renderState: l } = o;
6042
6038
  this.latestValues = c, this.baseTarget = { ...c }, this.initialValues = t.initial ? { ...c } : {}, this.renderState = l, this.parent = e, this.props = t, this.presenceContext = n, this.depth = e ? e.depth + 1 : 0, this.reducedMotionConfig = r, this.skipAnimationsConfig = i, this.options = s, this.blockInitialAnimation = !!a, this.isControllingVariants = Ml(t), this.isVariantNode = Nl(t), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(e && e.current);
@@ -6048,7 +6044,7 @@ var Ul = class {
6048
6044
  }
6049
6045
  mount(e) {
6050
6046
  if (this.hasBeenMounted) for (let e in this.initialValues) this.values.get(e)?.jump(this.initialValues[e]), this.latestValues[e] = this.initialValues[e];
6051
- this.current = e, Dl.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((e, t) => this.bindToMotionValue(t, e)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = !1 : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = !0 : (Il.current || Rl(), this.shouldReduceMotion = Fl.current), process.env.NODE_ENV !== "production" && ri(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.shouldSkipAnimations = this.skipAnimationsConfig ?? !1, this.parent?.addChild(this), this.update(this.props, this.presenceContext), this.hasBeenMounted = !0;
6047
+ this.current = e, Dl.set(e, this), this.projection && !this.projection.instance && this.projection.mount(e), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((e, t) => this.bindToMotionValue(t, e)), this.reducedMotionConfig === "never" ? this.shouldReduceMotion = !1 : this.reducedMotionConfig === "always" ? this.shouldReduceMotion = !0 : (Il.current || Rl(), this.shouldReduceMotion = Fl.current), process.env.NODE_ENV !== "production" && ii(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), this.shouldSkipAnimations = this.skipAnimationsConfig ?? !1, this.parent?.addChild(this), this.update(this.props, this.presenceContext), this.hasBeenMounted = !0;
6052
6048
  }
6053
6049
  unmount() {
6054
6050
  this.projection && this.projection.unmount(), Mi(this.notifyUpdate), Mi(this.render), this.valueSubscriptions.forEach((e) => e()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent?.removeChild(this);
@@ -6073,7 +6069,7 @@ var Ul = class {
6073
6069
  keyframes: r,
6074
6070
  times: i,
6075
6071
  ease: a,
6076
- duration: /* @__PURE__ */ $r(o)
6072
+ duration: /* @__PURE__ */ ei(o)
6077
6073
  }), c = n(s);
6078
6074
  this.valueSubscriptions.set(e, () => {
6079
6075
  c(), s.cancel();
@@ -6083,7 +6079,7 @@ var Ul = class {
6083
6079
  let n = Vo.has(e);
6084
6080
  n && this.onBindTransform && this.onBindTransform();
6085
6081
  let r = t.on("change", (t) => {
6086
- this.latestValues[e] = t, this.props.onUpdate && ji.preRender(this.notifyUpdate), n && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
6082
+ this.latestValues[e] = t, this.props.onUpdate && N.preRender(this.notifyUpdate), n && this.projection && (this.projection.isTransformDirty = !0), this.scheduleRender();
6087
6083
  }), i;
6088
6084
  typeof window < "u" && window.MotionCheckAppearSync && (i = window.MotionCheckAppearSync(this, e, t)), this.valueSubscriptions.set(e, () => {
6089
6085
  r(), i && i(), t.owner && t.stop();
@@ -6164,7 +6160,7 @@ var Ul = class {
6164
6160
  }
6165
6161
  readValue(e, t) {
6166
6162
  let n = this.latestValues[e] !== void 0 || !this.current ? this.latestValues[e] : this.getBaseTargetFromProps(this.props, e) ?? this.readValueFromInstance(this.current, e, this.options);
6167
- return n != null && (typeof n == "string" && (Wr(n) || Kr(n)) ? n = parseFloat(n) : !Sl(n) && Oa.test(t) && (n = jc(e, t)), this.setBaseTarget(e, ac(n) ? n.get() : n)), ac(n) ? n.get() : n;
6163
+ return n != null && (typeof n == "string" && (Gr(n) || qr(n)) ? n = parseFloat(n) : !Sl(n) && Oa.test(t) && (n = jc(e, t)), this.setBaseTarget(e, ac(n) ? n.get() : n)), ac(n) ? n.get() : n;
6168
6164
  }
6169
6165
  setBaseTarget(e, t) {
6170
6166
  this.baseTarget[e] = t;
@@ -6180,7 +6176,7 @@ var Ul = class {
6180
6176
  return r !== void 0 && !ac(r) ? r : this.initialValues[e] !== void 0 && n === void 0 ? void 0 : this.baseTarget[e];
6181
6177
  }
6182
6178
  on(e, t) {
6183
- return this.events[e] || (this.events[e] = new Qr()), this.events[e].add(t);
6179
+ return this.events[e] || (this.events[e] = new $r()), this.events[e].add(t);
6184
6180
  }
6185
6181
  notify(e, ...t) {
6186
6182
  this.events[e] && this.events[e].notify(...t);
@@ -6825,9 +6821,9 @@ function kd(e, t, n, r, i, a) {
6825
6821
  function Ad(e, t) {
6826
6822
  return e[t] === void 0 ? e.borderRadius : e[t];
6827
6823
  }
6828
- var jd = /* @__PURE__ */ Nd(0, .5, gi), Md = /* @__PURE__ */ Nd(.5, .95, Jr);
6824
+ var jd = /* @__PURE__ */ Nd(0, .5, _i), Md = /* @__PURE__ */ Nd(.5, .95, Yr);
6829
6825
  function Nd(e, t, n) {
6830
- return (r) => r < e ? 0 : r > t ? 1 : n(/* @__PURE__ */ Zr(e, t, r));
6826
+ return (r) => r < e ? 0 : r > t ? 1 : n(/* @__PURE__ */ Qr(e, t, r));
6831
6827
  }
6832
6828
  //#endregion
6833
6829
  //#region node_modules/motion-dom/dist/es/animation/animate/single-value.mjs
@@ -6847,10 +6843,10 @@ var Id = (e, t) => e.depth - t.depth, Ld = class {
6847
6843
  this.children = [], this.isDirty = !1;
6848
6844
  }
6849
6845
  add(e) {
6850
- Lr(this.children, e), this.isDirty = !0;
6846
+ Rr(this.children, e), this.isDirty = !0;
6851
6847
  }
6852
6848
  remove(e) {
6853
- Rr(this.children, e), this.isDirty = !0;
6849
+ zr(this.children, e), this.isDirty = !0;
6854
6850
  }
6855
6851
  forEach(e) {
6856
6852
  this.isDirty && this.children.sort(Id), this.isDirty = !1, this.children.forEach(e);
@@ -6863,7 +6859,7 @@ function Rd(e, t) {
6863
6859
  let a = i - n;
6864
6860
  a >= t && (Mi(r), e(a - t));
6865
6861
  };
6866
- return ji.setup(r, !0), () => Mi(r);
6862
+ return N.setup(r, !0), () => Mi(r);
6867
6863
  }
6868
6864
  //#endregion
6869
6865
  //#region node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.mjs
@@ -6877,17 +6873,17 @@ var Bd = class {
6877
6873
  this.members = [];
6878
6874
  }
6879
6875
  add(e) {
6880
- Lr(this.members, e);
6876
+ Rr(this.members, e);
6881
6877
  for (let t = this.members.length - 1; t >= 0; t--) {
6882
6878
  let n = this.members[t];
6883
6879
  if (n === e || n === this.lead || n === this.prevLead) continue;
6884
6880
  let r = n.instance;
6885
- (!r || r.isConnected === !1) && !n.snapshot && (Rr(this.members, n), n.unmount());
6881
+ (!r || r.isConnected === !1) && !n.snapshot && (zr(this.members, n), n.unmount());
6886
6882
  }
6887
6883
  e.scheduleRender();
6888
6884
  }
6889
6885
  remove(e) {
6890
- if (Rr(this.members, e), e === this.prevLead && (this.prevLead = void 0), e === this.lead) {
6886
+ if (zr(this.members, e), e === this.prevLead && (this.prevLead = void 0), e === this.lead) {
6891
6887
  let e = this.members[this.members.length - 1];
6892
6888
  e && this.promote(e);
6893
6889
  }
@@ -6942,7 +6938,7 @@ function qd(e) {
6942
6938
  let n = uc(t);
6943
6939
  if (window.MotionHasOptimisedAnimation(n, "transform")) {
6944
6940
  let { layout: t, layoutId: r } = e.options;
6945
- window.MotionCancelOptimisedAnimation(n, "transform", ji, !(t || r));
6941
+ window.MotionCancelOptimisedAnimation(n, "transform", N, !(t || r));
6946
6942
  }
6947
6943
  let { parent: r } = e;
6948
6944
  r && !r.hasCheckedOptimisedAppear && qd(r);
@@ -6956,13 +6952,13 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
6956
6952
  }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.layoutVersion = 0, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
6957
6953
  this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
6958
6954
  }, this.updateProjection = () => {
6959
- this.projectionUpdateScheduled = !1, Di.value && (Hd.nodes = Hd.calculatedTargetDeltas = Hd.calculatedProjections = 0), this.nodes.forEach(Zd), this.nodes.forEach(sf), this.nodes.forEach(cf), this.nodes.forEach(Qd), Di.addProjectionMetrics && Di.addProjectionMetrics(Hd);
6955
+ this.projectionUpdateScheduled = !1, Oi.value && (Hd.nodes = Hd.calculatedTargetDeltas = Hd.calculatedProjections = 0), this.nodes.forEach(Zd), this.nodes.forEach(sf), this.nodes.forEach(cf), this.nodes.forEach(Qd), Oi.addProjectionMetrics && Oi.addProjectionMetrics(Hd);
6960
6956
  }, this.resolvedRelativeTargetAt = 0, this.linkedParentVersion = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = e, this.root = n ? n.root || n : this, this.path = n ? [...n.path, n] : [], this.parent = n, this.depth = n ? n.depth + 1 : 0;
6961
6957
  for (let e = 0; e < this.path.length; e++) this.path[e].shouldResetTransform = !0;
6962
6958
  this.root === this && (this.nodes = new Ld());
6963
6959
  }
6964
6960
  addEventListener(e, t) {
6965
- return this.eventHandlers.has(e) || this.eventHandlers.set(e, new Qr()), this.eventHandlers.get(e).add(t);
6961
+ return this.eventHandlers.has(e) || this.eventHandlers.set(e, new $r()), this.eventHandlers.get(e).add(t);
6966
6962
  }
6967
6963
  notifyListeners(e, ...t) {
6968
6964
  let n = this.eventHandlers.get(e);
@@ -6977,7 +6973,7 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
6977
6973
  let { layoutId: n, layout: r, visualElement: i } = this.options;
6978
6974
  if (i && !i.current && i.mount(t), this.root.nodes.add(this), this.parent && this.parent.children.add(this), this.root.hasTreeAnimated && (r || n) && (this.isLayoutDirty = !0), e) {
6979
6975
  let n, r = 0, i = () => this.root.updateBlockedByResize = !1;
6980
- ji.read(() => {
6976
+ N.read(() => {
6981
6977
  r = window.innerWidth;
6982
6978
  }), e(t, () => {
6983
6979
  let e = window.innerWidth;
@@ -7054,7 +7050,7 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
7054
7050
  }
7055
7051
  this.animationCommitId = this.animationId, this.isUpdating ? (this.isUpdating = !1, this.nodes.forEach(rf), this.nodes.forEach(af), this.nodes.forEach(Yd), this.nodes.forEach(Xd)) : this.nodes.forEach(nf), this.clearAllSnapshots();
7056
7052
  let e = Li.now();
7057
- Ni.delta = zr(0, 1e3 / 60, e - Ni.timestamp), Ni.timestamp = e, Ni.isProcessing = !0, Pi.update.process(Ni), Pi.preRender.process(Ni), Pi.render.process(Ni), Ni.isProcessing = !1;
7053
+ Ni.delta = Br(0, 1e3 / 60, e - Ni.timestamp), Ni.timestamp = e, Ni.isProcessing = !0, Pi.update.process(Ni), Pi.preRender.process(Ni), Pi.render.process(Ni), Ni.isProcessing = !1;
7058
7054
  }
7059
7055
  didUpdate() {
7060
7056
  this.updateScheduled || (this.updateScheduled = !0, Rc.read(this.scheduleUpdate));
@@ -7063,10 +7059,10 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
7063
7059
  this.nodes.forEach($d), this.sharedNodes.forEach(uf);
7064
7060
  }
7065
7061
  scheduleUpdateProjection() {
7066
- this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, ji.preRender(this.updateProjection, !1, !0));
7062
+ this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, N.preRender(this.updateProjection, !1, !0));
7067
7063
  }
7068
7064
  scheduleCheckAfterUnmount() {
7069
- ji.postRender(() => {
7065
+ N.postRender(() => {
7070
7066
  this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
7071
7067
  });
7072
7068
  }
@@ -7173,7 +7169,7 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
7173
7169
  if (!this.layout || !(r || i)) return;
7174
7170
  this.resolvedRelativeTargetAt = Ni.timestamp;
7175
7171
  let a = this.getClosestProjectingParent();
7176
- a && this.linkedParentVersion !== a.layoutVersion && !a.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (this.options.layoutAnchor !== !1 && a && a.layout ? this.createRelativeTarget(a, this.layout.layoutBox, a.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = El(), this.targetWithTransforms = El()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), od(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || void 0)) : this.targetDelta ? (this.resumingFrom ? this.applyTransform(this.layout.layoutBox, !1, this.target) : qu(this.target, this.layout.layoutBox), ru(this.target, this.targetDelta)) : qu(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, this.options.layoutAnchor !== !1 && a && !!a.resumingFrom == !!this.resumingFrom && !a.options.layoutScroll && a.target && this.animationProgress !== 1 ? this.createRelativeTarget(a, this.target, a.target) : this.relativeParent = this.relativeTarget = void 0), Di.value && Hd.calculatedTargetDeltas++);
7172
+ a && this.linkedParentVersion !== a.layoutVersion && !a.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (this.options.layoutAnchor !== !1 && a && a.layout ? this.createRelativeTarget(a, this.layout.layoutBox, a.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = El(), this.targetWithTransforms = El()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), od(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || void 0)) : this.targetDelta ? (this.resumingFrom ? this.applyTransform(this.layout.layoutBox, !1, this.target) : qu(this.target, this.layout.layoutBox), ru(this.target, this.targetDelta)) : qu(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, this.options.layoutAnchor !== !1 && a && !!a.resumingFrom == !!this.resumingFrom && !a.options.layoutScroll && a.target && this.animationProgress !== 1 ? this.createRelativeTarget(a, this.target, a.target) : this.relativeParent = this.relativeTarget = void 0), Oi.value && Hd.calculatedTargetDeltas++);
7177
7173
  }
7178
7174
  getClosestProjectingParent() {
7179
7175
  if (!(!this.parent || Xl(this.parent.latestValues) || Ql(this.parent.latestValues))) return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
@@ -7200,7 +7196,7 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
7200
7196
  this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
7201
7197
  return;
7202
7198
  }
7203
- !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (Ju(this.prevProjectionDelta.x, this.projectionDelta.x), Ju(this.prevProjectionDelta.y, this.projectionDelta.y)), id(this.projectionDelta, this.layoutCorrected, s, this.latestValues), (this.treeScale.x !== a || this.treeScale.y !== o || !Sd(this.projectionDelta.x, this.prevProjectionDelta.x) || !Sd(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", s)), Di.value && Hd.calculatedProjections++;
7199
+ !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (Ju(this.prevProjectionDelta.x, this.projectionDelta.x), Ju(this.prevProjectionDelta.y, this.projectionDelta.y)), id(this.projectionDelta, this.layoutCorrected, s, this.latestValues), (this.treeScale.x !== a || this.treeScale.y !== o || !Sd(this.projectionDelta.x, this.prevProjectionDelta.x) || !Sd(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", s)), Oi.value && Hd.calculatedProjections++;
7204
7200
  }
7205
7201
  hide() {
7206
7202
  this.isVisible = !1;
@@ -7230,7 +7226,7 @@ function Jd({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
7230
7226
  }, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
7231
7227
  }
7232
7228
  startAnimation(e) {
7233
- this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation &&= (Mi(this.pendingAnimation), void 0), this.pendingAnimation = ji.update(() => {
7229
+ this.notifyListeners("animationStart"), this.currentAnimation?.stop(), this.resumingFrom?.currentAnimation?.stop(), this.pendingAnimation &&= (Mi(this.pendingAnimation), void 0), this.pendingAnimation = N.update(() => {
7234
7230
  Vd.hasAnimatedSinceResize = !0, Ri.layout++, this.motionValue ||= ec(0), this.motionValue.jump(0, !1), this.currentAnimation = Pd(this.motionValue, [0, 1e3], {
7235
7231
  ...e,
7236
7232
  velocity: 0,
@@ -7403,7 +7399,7 @@ function Xd(e) {
7403
7399
  e.options.transition = void 0;
7404
7400
  }
7405
7401
  function Zd(e) {
7406
- Di.value && Hd.nodes++, e.parent && (e.isProjecting() || (e.isProjectionDirty = e.parent.isProjectionDirty), e.isSharedProjectionDirty ||= !!(e.isProjectionDirty || e.parent.isProjectionDirty || e.parent.isSharedProjectionDirty), e.isTransformDirty ||= e.parent.isTransformDirty);
7402
+ Oi.value && Hd.nodes++, e.parent && (e.isProjecting() || (e.isProjectionDirty = e.parent.isProjectionDirty), e.isSharedProjectionDirty ||= !!(e.isProjectionDirty || e.parent.isProjectionDirty || e.parent.isSharedProjectionDirty), e.isTransformDirty ||= e.parent.isTransformDirty);
7407
7403
  }
7408
7404
  function Qd(e) {
7409
7405
  e.isProjectionDirty = e.isSharedProjectionDirty = e.isTransformDirty = !1;
@@ -7462,7 +7458,7 @@ var hf = {
7462
7458
  .1,
7463
7459
  1
7464
7460
  ]
7465
- }, gf = (e) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(e), _f = gf("applewebkit/") && !gf("chrome/") ? Math.round : Jr;
7461
+ }, gf = (e) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(e), _f = gf("applewebkit/") && !gf("chrome/") ? Math.round : Yr;
7466
7462
  function vf(e) {
7467
7463
  e.min = _f(e.min), e.max = _f(e.max);
7468
7464
  }
@@ -7508,7 +7504,7 @@ var Sf = Jd({
7508
7504
  //#endregion
7509
7505
  //#region node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs
7510
7506
  function Ef(e = !0) {
7511
- let t = s(Ir);
7507
+ let t = s(Lr);
7512
7508
  if (t === null) return [!0, null];
7513
7509
  let { isPresent: n, onExitComplete: r, register: i } = t, a = l();
7514
7510
  c(() => {
@@ -7765,8 +7761,8 @@ function np(e, t, n, r) {
7765
7761
  return i;
7766
7762
  }
7767
7763
  var rp = (e) => (t, n) => {
7768
- let r = s(Vf), i = s(Ir), a = () => tp(e, t, r, i);
7769
- return n ? a() : Pr(a);
7764
+ let r = s(Vf), i = s(Lr), a = () => tp(e, t, r, i);
7765
+ return n ? a() : Fr(a);
7770
7766
  }, ip = /* @__PURE__ */ rp({
7771
7767
  scrapeMotionValuesFromProps: Cu,
7772
7768
  createRenderState: Gf
@@ -7804,7 +7800,7 @@ function lp(e) {
7804
7800
  //#endregion
7805
7801
  //#region node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
7806
7802
  function up(e, t, n, r, i, a) {
7807
- let { visualElement: o } = s(Vf), l = s(Df), d = s(Ir), f = s(Tf), m = f.reducedMotion, h = f.skipAnimations, g = p(null), _ = p(!1);
7803
+ let { visualElement: o } = s(Vf), l = s(Df), d = s(Lr), f = s(Tf), m = f.reducedMotion, h = f.skipAnimations, g = p(null), _ = p(!1);
7808
7804
  r ||= l.renderer, !g.current && r && (g.current = r(e, {
7809
7805
  visualState: t,
7810
7806
  parent: o,
@@ -7822,7 +7818,7 @@ function up(e, t, n, r, i, a) {
7822
7818
  v && b.current && v.update(n, d);
7823
7819
  });
7824
7820
  let x = n[lc], S = p(!!x && typeof window < "u" && !window.MotionHandoffIsComplete?.(x) && window.MotionHasOptimisedAnimation?.(x));
7825
- return Fr(() => {
7821
+ return Ir(() => {
7826
7822
  _.current = !0, v && (b.current = !0, window.MotionIsMounted = !0, v.updateFeatures(), v.scheduleRenderMicrotask(), S.current && v.animationState && v.animationState.animateChanges());
7827
7823
  }), c(() => {
7828
7824
  v && (!S.current && v.animationState && v.animationState.animateChanges(), S.current &&= (queueMicrotask(() => {
@@ -7877,14 +7873,14 @@ function pp(e, { forwardMotionProps: t = !1, type: n } = {}, r, i) {
7877
7873
  return u[op] = e, u;
7878
7874
  }
7879
7875
  function mp({ layoutId: e }) {
7880
- let t = s(Nr).id;
7876
+ let t = s(Pr).id;
7881
7877
  return t && e !== void 0 ? t + "-" + e : e;
7882
7878
  }
7883
7879
  function hp(e, t) {
7884
7880
  let n = s(Df).strict;
7885
7881
  if (process.env.NODE_ENV !== "production" && t && n) {
7886
7882
  let t = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
7887
- e.ignoreStrict ? Vr(!1, t, "lazy-strict-mode") : Hr(!1, t, "lazy-strict-mode");
7883
+ e.ignoreStrict ? Hr(!1, t, "lazy-strict-mode") : Ur(!1, t, "lazy-strict-mode");
7888
7884
  }
7889
7885
  }
7890
7886
  function gp(e) {
@@ -7904,7 +7900,7 @@ function gp(e) {
7904
7900
  function _p(e, t) {
7905
7901
  if (typeof Proxy > "u") return pp;
7906
7902
  let n = /* @__PURE__ */ new Map(), r = (n, r) => pp(n, r, e, t);
7907
- return new Proxy((e, t) => (process.env.NODE_ENV !== "production" && ri(!1, "motion() is deprecated. Use motion.create() instead."), r(e, t)), { get: (i, a) => a === "create" ? r : (n.has(a) || n.set(a, pp(a, void 0, e, t)), n.get(a)) });
7903
+ return new Proxy((e, t) => (process.env.NODE_ENV !== "production" && ii(!1, "motion() is deprecated. Use motion.create() instead."), r(e, t)), { get: (i, a) => a === "create" ? r : (n.has(a) || n.set(a, pp(a, void 0, e, t)), n.get(a)) });
7908
7904
  }
7909
7905
  //#endregion
7910
7906
  //#region node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs
@@ -8008,7 +8004,7 @@ var Op = /* @__PURE__ */ new Set(["auto", "scroll"]), kp = class {
8008
8004
  let { onStart: a, onMove: o } = this.handlers;
8009
8005
  t || (a && a(this.lastMoveEvent, e), this.startEvent = this.lastMoveEvent), o && o(this.lastMoveEvent, e);
8010
8006
  }, this.handlePointerMove = (e, t) => {
8011
- this.lastMoveEvent = e, this.lastRawMoveEventInfo = t, this.lastMoveEventInfo = Ap(t, this.transformPagePoint), ji.update(this.updatePoint, !0);
8007
+ this.lastMoveEvent = e, this.lastRawMoveEventInfo = t, this.lastMoveEventInfo = Ap(t, this.transformPagePoint), N.update(this.updatePoint, !0);
8012
8008
  }, this.handlePointerUp = (e, t) => {
8013
8009
  this.end();
8014
8010
  let { onEnd: n, onSessionEnd: r, resumeAnimation: i } = this.handlers;
@@ -8023,7 +8019,7 @@ var Op = /* @__PURE__ */ new Set(["auto", "scroll"]), kp = class {
8023
8019
  timestamp: l
8024
8020
  }];
8025
8021
  let { onSessionStart: u } = t;
8026
- u && u(e, Mp(s, this.history)), this.removeListeners = Xr(wp(this.contextWindow, "pointermove", this.handlePointerMove), wp(this.contextWindow, "pointerup", this.handlePointerUp), wp(this.contextWindow, "pointercancel", this.handlePointerUp)), o && this.startScrollTracking(o);
8022
+ u && u(e, Mp(s, this.history)), this.removeListeners = Zr(wp(this.contextWindow, "pointermove", this.handlePointerMove), wp(this.contextWindow, "pointerup", this.handlePointerUp), wp(this.contextWindow, "pointercancel", this.handlePointerUp)), o && this.startScrollTracking(o);
8027
8023
  }
8028
8024
  startScrollTracking(e) {
8029
8025
  let t = e.parentElement;
@@ -8054,7 +8050,7 @@ var Op = /* @__PURE__ */ new Set(["auto", "scroll"]), kp = class {
8054
8050
  x: r.x - t.x,
8055
8051
  y: r.y - t.y
8056
8052
  };
8057
- i.x === 0 && i.y === 0 || (n ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += i.x, this.lastMoveEventInfo.point.y += i.y) : this.history.length > 0 && (this.history[0].x -= i.x, this.history[0].y -= i.y), this.scrollPositions.set(e, r), ji.update(this.updatePoint, !0));
8053
+ i.x === 0 && i.y === 0 || (n ? this.lastMoveEventInfo && (this.lastMoveEventInfo.point.x += i.x, this.lastMoveEventInfo.point.y += i.y) : this.history.length > 0 && (this.history[0].x -= i.x, this.history[0].y -= i.y), this.scrollPositions.set(e, r), N.update(this.updatePoint, !0));
8058
8054
  }
8059
8055
  updateHandlers(e) {
8060
8056
  this.handlers = e;
@@ -8092,13 +8088,13 @@ function Fp(e, t) {
8092
8088
  y: 0
8093
8089
  };
8094
8090
  let n = e.length - 1, r = null, i = Pp(e);
8095
- for (; n >= 0 && (r = e[n], !(i.timestamp - r.timestamp > /* @__PURE__ */ $r(t)));) n--;
8091
+ for (; n >= 0 && (r = e[n], !(i.timestamp - r.timestamp > /* @__PURE__ */ ei(t)));) n--;
8096
8092
  if (!r) return {
8097
8093
  x: 0,
8098
8094
  y: 0
8099
8095
  };
8100
- r === e[0] && e.length > 2 && i.timestamp - r.timestamp > /* @__PURE__ */ $r(t) * 2 && (r = e[1]);
8101
- let a = /* @__PURE__ */ ei(i.timestamp - r.timestamp);
8096
+ r === e[0] && e.length > 2 && i.timestamp - r.timestamp > /* @__PURE__ */ ei(t) * 2 && (r = e[1]);
8097
+ let a = /* @__PURE__ */ ti(i.timestamp - r.timestamp);
8102
8098
  if (a === 0) return {
8103
8099
  x: 0,
8104
8100
  y: 0
@@ -8141,7 +8137,7 @@ function Bp(e, t) {
8141
8137
  }
8142
8138
  function Vp(e, t) {
8143
8139
  let n = .5, r = td(e), i = td(t);
8144
- return i > r ? n = /* @__PURE__ */ Zr(t.min, t.max - r, e.min) : r > i && (n = /* @__PURE__ */ Zr(e.min, e.max - i, t.min)), zr(0, 1, n);
8140
+ return i > r ? n = /* @__PURE__ */ Qr(t.min, t.max - r, e.min) : r > i && (n = /* @__PURE__ */ Qr(e.min, e.max - i, t.min)), Br(0, 1, n);
8145
8141
  }
8146
8142
  function Hp(e, t) {
8147
8143
  let n = {};
@@ -8190,7 +8186,7 @@ var qp = /* @__PURE__ */ new WeakMap(), Jp = class {
8190
8186
  }
8191
8187
  }
8192
8188
  this.originPoint[e] = t;
8193
- }), i && ji.update(() => i(e, t), !1, !0), sc(this.visualElement, "transform");
8189
+ }), i && N.update(() => i(e, t), !1, !0), sc(this.visualElement, "transform");
8194
8190
  let { animationState: a } = this.visualElement;
8195
8191
  a && a.setActive("whileDrag", !0);
8196
8192
  }, o = (e, t) => {
@@ -8202,7 +8198,7 @@ var qp = /* @__PURE__ */ new WeakMap(), Jp = class {
8202
8198
  this.currentDirection = Qp(o), this.currentDirection !== null && i && i(this.currentDirection);
8203
8199
  return;
8204
8200
  }
8205
- this.updateAxis("x", t.point, o), this.updateAxis("y", t.point, o), this.visualElement.render(), a && ji.update(() => a(e, t), !1, !0);
8201
+ this.updateAxis("x", t.point, o), this.updateAxis("y", t.point, o), this.visualElement.render(), a && N.update(() => a(e, t), !1, !0);
8206
8202
  }, s = (e, t) => {
8207
8203
  this.latestPointerEvent = e, this.latestPanInfo = t, this.stop(e, t), this.latestPointerEvent = null, this.latestPanInfo = null;
8208
8204
  }, c = () => {
@@ -8232,7 +8228,7 @@ var qp = /* @__PURE__ */ new WeakMap(), Jp = class {
8232
8228
  let { velocity: a } = r;
8233
8229
  this.startAnimation(a);
8234
8230
  let { onDragEnd: o } = this.getProps();
8235
- o && ji.postRender(() => o(n, r));
8231
+ o && N.postRender(() => o(n, r));
8236
8232
  }
8237
8233
  cancel() {
8238
8234
  this.isDragging = !1;
@@ -8260,7 +8256,7 @@ var qp = /* @__PURE__ */ new WeakMap(), Jp = class {
8260
8256
  let { dragConstraints: e, onMeasureDragConstraints: t } = this.getProps();
8261
8257
  if (!e || !lp(e)) return !1;
8262
8258
  let n = e.current;
8263
- Hr(n !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
8259
+ Ur(n !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.", "drag-constraints-ref");
8264
8260
  let { projection: r } = this.visualElement;
8265
8261
  if (!r || !r.layout) return !1;
8266
8262
  let i = fu(n, r.root, this.visualElement.getTransformPagePoint()), a = Bp(r.layout.layoutBox, i);
@@ -8351,7 +8347,7 @@ var qp = /* @__PURE__ */ new WeakMap(), Jp = class {
8351
8347
  let { dragConstraints: t } = this.getProps();
8352
8348
  lp(t) && t.current && (this.constraints = this.resolveRefConstraints(), n ||= Xp(e, t.current, () => this.scalePositionWithinConstraints()));
8353
8349
  }, { projection: i } = this.visualElement, a = i.addEventListener("measure", r);
8354
- i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), ji.read(r);
8350
+ i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), N.read(r);
8355
8351
  let o = Fd(window, "resize", () => this.scalePositionWithinConstraints()), s = i.addEventListener("didUpdate", (({ delta: e, hasLayoutChanged: t }) => {
8356
8352
  this.isDragging && t && (Cd((t) => {
8357
8353
  let n = this.getAxisMotionValue(t);
@@ -8402,11 +8398,11 @@ function Qp(e, t = 10) {
8402
8398
  //#region node_modules/framer-motion/dist/es/gestures/drag/index.mjs
8403
8399
  var $p = class extends Gl {
8404
8400
  constructor(e) {
8405
- super(e), this.removeGroupControls = Jr, this.removeListeners = Jr, this.controls = new Jp(e);
8401
+ super(e), this.removeGroupControls = Yr, this.removeListeners = Yr, this.controls = new Jp(e);
8406
8402
  }
8407
8403
  mount() {
8408
8404
  let { dragControls: e } = this.node.getProps();
8409
- e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || Jr;
8405
+ e && (this.removeGroupControls = e.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || Yr;
8410
8406
  }
8411
8407
  update() {
8412
8408
  let { dragControls: e } = this.node.getProps(), { dragControls: t } = this.node.prevProps || {};
@@ -8416,10 +8412,10 @@ var $p = class extends Gl {
8416
8412
  this.removeGroupControls(), this.removeListeners(), this.controls.isDragging || this.controls.endPanSession();
8417
8413
  }
8418
8414
  }, em = (e) => (t, n) => {
8419
- e && ji.update(() => e(t, n), !1, !0);
8415
+ e && N.update(() => e(t, n), !1, !0);
8420
8416
  }, tm = class extends Gl {
8421
8417
  constructor() {
8422
- super(...arguments), this.removePointerDownListener = Jr;
8418
+ super(...arguments), this.removePointerDownListener = Yr;
8423
8419
  }
8424
8420
  onPointerDown(e) {
8425
8421
  this.session = new kp(e, this.createPanHandlers(), {
@@ -8434,7 +8430,7 @@ var $p = class extends Gl {
8434
8430
  onStart: em(t),
8435
8431
  onMove: em(n),
8436
8432
  onEnd: (e, t) => {
8437
- delete this.session, r && ji.postRender(() => r(e, t));
8433
+ delete this.session, r && N.postRender(() => r(e, t));
8438
8434
  }
8439
8435
  };
8440
8436
  }
@@ -8463,7 +8459,7 @@ var $p = class extends Gl {
8463
8459
  return a ? (a.isPresent = i, e.layoutDependency !== t && a.setOptions({
8464
8460
  ...a.options,
8465
8461
  layoutDependency: t
8466
- }), nm = !0, r || e.layoutDependency !== t || t === void 0 || e.isPresent !== i ? a.willUpdate() : this.safeToRemove(), e.isPresent !== i && (i ? a.promote() : a.relegate() || ji.postRender(() => {
8462
+ }), nm = !0, r || e.layoutDependency !== t || t === void 0 || e.isPresent !== i ? a.willUpdate() : this.safeToRemove(), e.isPresent !== i && (i ? a.promote() : a.relegate() || N.postRender(() => {
8467
8463
  let e = a.getStack();
8468
8464
  (!e || !e.members.length) && this.safeToRemove();
8469
8465
  })), null) : null;
@@ -8487,7 +8483,7 @@ var $p = class extends Gl {
8487
8483
  }
8488
8484
  };
8489
8485
  function im(e) {
8490
- let [t, n] = Ef(), r = s(Nr);
8486
+ let [t, n] = Ef(), r = s(Pr);
8491
8487
  return g(rm, {
8492
8488
  ...e,
8493
8489
  layoutGroup: r,
@@ -8512,7 +8508,7 @@ function om(e, t, n) {
8512
8508
  let { props: r } = e;
8513
8509
  e.animationState && r.whileHover && e.animationState.setActive("whileHover", n === "Start");
8514
8510
  let i = r["onHover" + n];
8515
- i && ji.postRender(() => i(t, Sp(t)));
8511
+ i && N.postRender(() => i(t, Sp(t)));
8516
8512
  }
8517
8513
  var sm = class extends Gl {
8518
8514
  mount() {
@@ -8537,7 +8533,7 @@ var sm = class extends Gl {
8537
8533
  !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
8538
8534
  }
8539
8535
  mount() {
8540
- this.unmount = Xr(Fd(this.node.current, "focus", () => this.onFocus()), Fd(this.node.current, "blur", () => this.onBlur()));
8536
+ this.unmount = Zr(Fd(this.node.current, "focus", () => this.onFocus()), Fd(this.node.current, "blur", () => this.onBlur()));
8541
8537
  }
8542
8538
  unmount() {}
8543
8539
  };
@@ -8548,7 +8544,7 @@ function lm(e, t, n) {
8548
8544
  if (e.current instanceof HTMLButtonElement && e.current.disabled) return;
8549
8545
  e.animationState && r.whileTap && e.animationState.setActive("whileTap", n === "Start");
8550
8546
  let i = r["onTap" + (n === "End" ? "" : n)];
8551
- i && ji.postRender(() => i(t, Sp(t)));
8547
+ i && N.postRender(() => i(t, Sp(t)));
8552
8548
  }
8553
8549
  var um = class extends Gl {
8554
8550
  mount() {
@@ -28804,7 +28800,7 @@ function RO(e) {
28804
28800
  //#endregion
28805
28801
  //#region src/utils/voiceClientTools.js
28806
28802
  function $(...e) {
28807
- Ln() && console.log("[FlowEngage:voice-tools]", ...e);
28803
+ Rn() && console.log("[FlowEngage:voice-tools]", ...e);
28808
28804
  }
28809
28805
  function zO(e) {
28810
28806
  return new Promise((t) => setTimeout(t, e));
@@ -29341,7 +29337,7 @@ function yk(e) {
29341
29337
  let e = new URL(a, window.location.href);
29342
29338
  if (e.pathname === window.location.pathname && e.search === window.location.search) return $("flowengage_navigate ✖ already on page, skipping"), "OK_ALREADY_ON_PAGE. The visitor is already on this page. Do not navigate. Proceed directly with highlights, answering the question, or reading page content.";
29343
29339
  } catch {}
29344
- if (!await hr(a, {
29340
+ if (!await gr(a, {
29345
29341
  siteId: t,
29346
29342
  apiBaseUrl: e.apiBaseUrl
29347
29343
  })) {
@@ -29363,13 +29359,13 @@ function yk(e) {
29363
29359
  Ne(), t && typeof window < "u" && Be(t, window.location.href);
29364
29360
  try {
29365
29361
  let e = new URL(a, typeof window < "u" ? window.location.href : "").href;
29366
- vr(e);
29362
+ yr(e);
29367
29363
  } catch {
29368
- vr(a);
29364
+ yr(a);
29369
29365
  }
29370
29366
  $("flowengage_navigate → real navigation", a);
29371
29367
  let e = typeof window < "u" && !!(window.next?.router || window.__NEXT_ROUTER__ || window.__remixRouter || window.__staticRouterHydrationData || window.___gatsby || window.___navigate || window.__VUE_ROUTER__ || window.__NUXT__ || window.$nuxt || window.ng?.getComponent || typeof document < "u" && document.querySelector("[ng-version]") || window.__sveltekit_data || typeof document < "u" && document.querySelector("[data-sveltekit-hydrate]"));
29372
- if (typeof window < "u" && window.__fe_triggerVoiceNavHooks && window.__fe_triggerVoiceNavHooks(), br(a, { voiceActive: !0 }).catch(() => {}), e) try {
29368
+ if (typeof window < "u" && window.__fe_triggerVoiceNavHooks && window.__fe_triggerVoiceNavHooks(), xr(a, { voiceActive: !0 }).catch(() => {}), e) try {
29373
29369
  let e = (new URL(a, window.location.origin).pathname.split("/").filter(Boolean).pop() || "").replace(/[-_]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()) || "this page";
29374
29370
  return $("flowengage_navigate → SPA async navigation, new page:", e), `OK_NAVIGATE_SPA. You are now on the ${e} page. Immediately say: "I have navigated you to the ${e} page. Let me show you what's here." Then continue guiding the visitor.`;
29375
29371
  } catch {}
@@ -29389,8 +29385,8 @@ function yk(e) {
29389
29385
  $("flowengage_highlight ▶", e);
29390
29386
  let t = dk(e), n = t?.section_id || t?.sectionId, r = t?.section_text || t?.sectionText;
29391
29387
  vk();
29392
- let i = ur(n || null, r || null);
29393
- return !i && r && (await new Promise((e) => setTimeout(e, 500)), vk(), i = ur(null, r)), i ? (mO(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}"`) : ($("flowengage_highlight ✖ no element for:", r || n), `Could not find "${r || n}" on the current page. Try a shorter phrase matching a visible heading.`);
29388
+ let i = dr(n || null, r || null);
29389
+ return !i && r && (await new Promise((e) => setTimeout(e, 500)), vk(), i = dr(null, r)), i ? (mO(i), $("flowengage_highlight ✓", r || n), `OK_HIGHLIGHT: "${r || n}"`) : ($("flowengage_highlight ✖ no element for:", r || n), `Could not find "${r || n}" on the current page. Try a shorter phrase matching a visible heading.`);
29394
29390
  },
29395
29391
  flowengage_read_content: async (e) => {
29396
29392
  $("flowengage_read_content ▶", e);
@@ -29398,7 +29394,7 @@ function yk(e) {
29398
29394
  try {
29399
29395
  let e = "";
29400
29396
  if (n) {
29401
- let t = ur(null, n);
29397
+ let t = dr(null, n);
29402
29398
  if (!t) return `Could not find section "${n}" on the page.`;
29403
29399
  let r = [t.textContent.trim()], i = t.nextElementSibling;
29404
29400
  for (; i && !/^H[1-3]$/i.test(i.tagName);) {
@@ -29578,7 +29574,7 @@ function yk(e) {
29578
29574
  //#region src/utils/wrapVoiceToolsForLogging.js
29579
29575
  function bk(e) {
29580
29576
  return !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, async (n) => {
29581
- let r = Ln();
29577
+ let r = Rn();
29582
29578
  r ? console.log("[FlowEngage:voice-tool] ▶", e, n) : console.info(`[FlowEngage] voice tool » ${e}`);
29583
29579
  let i;
29584
29580
  try {
@@ -29992,7 +29988,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
29992
29988
  })
29993
29989
  }).catch((e) => console.warn("[FlowEngage] save-chat-recording failed:", e.message));
29994
29990
  }
29995
- if (ie.current = null, ae.current = null, C.current = null, v("idle"), b(!1), ee.current = !1, wr(), a) try {
29991
+ if (ie.current = null, ae.current = null, C.current = null, v("idle"), b(!1), ee.current = !1, Tr(), a) try {
29996
29992
  Me(a);
29997
29993
  } catch {}
29998
29994
  typeof d == "function" && await d(u.current), e?.();
@@ -30016,12 +30012,12 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30016
30012
  }
30017
30013
  try {
30018
30014
  if ((await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop()), e) return;
30019
- u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", Cr({ onBeforeNavigate: () => {
30015
+ u.current = [], w.current = "", ee.current = !1, ne.current = !1, re.current = !1, E.current = "minimized", wr({ onBeforeNavigate: () => {
30020
30016
  if (a && u.current.length > 0) try {
30021
30017
  let e = lO(u.current);
30022
30018
  e && Ae(a, e);
30023
30019
  } catch {}
30024
- if (!Yn()) {
30020
+ if (!Xn()) {
30025
30021
  let e = ie.current, t = ae.current;
30026
30022
  if (e && l && s) try {
30027
30023
  let n = t ? Math.round((Date.now() - t) / 1e3) : 0, r = JSON.stringify({
@@ -30100,11 +30096,10 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30100
30096
  se("minimized");
30101
30097
  return;
30102
30098
  }
30103
- te.current && n === "bot" && /are you still there|still there\??|hello\?|anyone there|checking in|you there|are you available|is anyone|did you step away/i.test(r) && (D.current += 1, D.current >= 3) && (u.current = [...u.current, {
30104
- sender: "bot",
30105
- message: "Looks like you are no longer active. I'm ending the session — you can resume it later when you want.",
30106
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
30107
- }], se("minimized"));
30099
+ if (te.current && n === "bot" && /are you still there|still there\??|hello\?|anyone there|checking in|you there|are you available|is anyone|did you step away/i.test(r)) if (D.current += 1, D.current === 2) try {
30100
+ C.current?.sendContextualUpdate?.("IMPORTANT: The visitor is muted and has not responded to your last 2 checks. Make exactly ONE more check. If there is still no response, say: 'I feel like you are not active, so I'm ending this session. You can connect with me anytime.' then immediately call the flowengage_end_session tool to end the voice session. Do NOT ask again after that.");
30101
+ } catch {}
30102
+ else D.current >= 5 && se("minimized");
30108
30103
  }
30109
30104
  },
30110
30105
  onError: (t) => {
@@ -30156,7 +30151,7 @@ function Ak({ orbColors: e, onEnterChat: t, onEndChat: n, agentId: r, voiceId: i
30156
30151
  }, 0)));
30157
30152
  }
30158
30153
  })(), () => {
30159
- e = !0, re.current = !0, wr();
30154
+ e = !0, re.current = !0, Tr();
30160
30155
  let t = i || C.current, n = ie.current, r = ae.current;
30161
30156
  if (t?.endSession?.().catch(() => {}), n && l && s) {
30162
30157
  let e = r ? Math.round((Date.now() - r) / 1e3) : 0, t = JSON.stringify({
@@ -30517,24 +30512,24 @@ var Mk = () => /* @__PURE__ */ g("div", {
30517
30512
  })
30518
30513
  });
30519
30514
  function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i, quickChatOptions: a, onQuickChatSelect: o, isMobile: s, chatHistory: l, isAiTyping: u, isAgentTyping: d, activeScreen: f, agentName: v, agentHeadshot: y, fallbackAgentName: b, input: x, setInput: S, onSubmit: C, isConversationEnded: w, isLoading: T, isRateLimited: ee, rateLimitMessage: te, selectedFile: ne, onFileSelect: re, onRemoveSelectedFile: E, attachmentError: ie, isUploadingAttachment: ae, requiresEmail: oe, emailInput: D, setEmailInput: se, emailError: ce, emailCaptureSuccess: le, replyContext: ue, setReplyContext: de, webRTCError: fe, micError: pe, setMicError: me, dismissCallError: he, activeCallId: ge, isCallMuted: _e, toggleCallMute: ve, endWebRTCCall: ye, formatCallDuration: be, callDurationSeconds: xe, isCallMinimized: Se, onExpand: Ce, onCollapse: we, onStartVoice: Te, onNewChat: Ee, onEndConversation: De, showPoweredBy: Oe, getVisitorChatHistory: ke, getVisitorChatThread: Ae, resumeChat: je, isSessionRestoring: Me, isClosing: O }) {
30520
- let Ne = l.length > 0, Pe = T || ee || w, Fe = !!ge, [Ie, Le] = m(!1), [Re, ze] = m(!1), [Be, Ve] = m([]), [He, k] = m(!1), [Ue, We] = m(null), [Ge, Ke] = m([]), qe = p(null), Je = async () => {
30521
- Le(!1), ze(!0), k(!0), We(null);
30515
+ let Ne = l.length > 0, Pe = T || ee || w, Fe = !!ge, [Ie, Le] = m(!1), [Re, ze] = m(!1), [Be, Ve] = m([]), [He, Ue] = m(!1), [We, Ge] = m(null), [Ke, qe] = m([]), Je = p(null), Ye = async () => {
30516
+ Le(!1), ze(!0), Ue(!0), Ge(null);
30522
30517
  try {
30523
30518
  let e = await ke();
30524
30519
  e?.data && Ve(e.data);
30525
30520
  } catch (e) {
30526
30521
  console.error(e);
30527
30522
  } finally {
30528
- k(!1);
30523
+ Ue(!1);
30529
30524
  }
30530
- }, Ye = async (e) => {
30525
+ }, Xe = async (e) => {
30531
30526
  ze(!1), je?.(e.chatId);
30532
30527
  };
30533
30528
  return c(() => {
30534
30529
  if (!Ie) return;
30535
30530
  let e = (e) => {
30536
30531
  let t = e.composedPath?.()?.[0] || e.target;
30537
- qe.current && !qe.current.contains(t) && Le(!1);
30532
+ Je.current && !Je.current.contains(t) && Le(!1);
30538
30533
  };
30539
30534
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
30540
30535
  }, [Ie]), /* @__PURE__ */ _("div", {
@@ -30684,7 +30679,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30684
30679
  isolation: "isolate",
30685
30680
  zIndex: 10
30686
30681
  },
30687
- ref: qe,
30682
+ ref: Je,
30688
30683
  children: [/* @__PURE__ */ g("button", {
30689
30684
  type: "button",
30690
30685
  onClick: () => Le((e) => !e),
@@ -30836,7 +30831,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30836
30831
  margin: "0 14px"
30837
30832
  } }), /* @__PURE__ */ _("button", {
30838
30833
  type: "button",
30839
- onClick: Je,
30834
+ onClick: Ye,
30840
30835
  style: {
30841
30836
  display: "flex",
30842
30837
  alignItems: "center",
@@ -30983,8 +30978,8 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
30983
30978
  borderBottom: "1px solid #f3f4f6",
30984
30979
  flexShrink: 0
30985
30980
  },
30986
- children: Ue ? /* @__PURE__ */ _("button", {
30987
- onClick: () => We(null),
30981
+ children: We ? /* @__PURE__ */ _("button", {
30982
+ onClick: () => Ge(null),
30988
30983
  style: {
30989
30984
  background: "none",
30990
30985
  border: "none",
@@ -31046,7 +31041,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31046
31041
  overflowY: "auto",
31047
31042
  position: "relative"
31048
31043
  },
31049
- children: He && !Ue ? /* @__PURE__ */ g("div", {
31044
+ children: He && !We ? /* @__PURE__ */ g("div", {
31050
31045
  style: {
31051
31046
  padding: "40px 20px",
31052
31047
  textAlign: "center",
@@ -31054,9 +31049,9 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31054
31049
  fontSize: "14px"
31055
31050
  },
31056
31051
  children: "Loading past conversations..."
31057
- }) : Ue ? /* @__PURE__ */ _("div", {
31052
+ }) : We ? /* @__PURE__ */ _("div", {
31058
31053
  style: { padding: "20px 16px" },
31059
- children: [Ge.length === 0 ? /* @__PURE__ */ g("div", {
31054
+ children: [Ke.length === 0 ? /* @__PURE__ */ g("div", {
31060
31055
  style: {
31061
31056
  color: "#9ca3af",
31062
31057
  textAlign: "center",
@@ -31064,7 +31059,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31064
31059
  fontSize: "14px"
31065
31060
  },
31066
31061
  children: "No messages"
31067
- }) : null, Ge.map((e, t) => /* @__PURE__ */ g("div", {
31062
+ }) : null, Ke.map((e, t) => /* @__PURE__ */ g("div", {
31068
31063
  style: {
31069
31064
  marginBottom: "16px",
31070
31065
  display: "flex",
@@ -31085,7 +31080,7 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31085
31080
  })
31086
31081
  }, e._id || t))]
31087
31082
  }) : Be.length > 0 ? /* @__PURE__ */ g("div", { children: Be.map((e) => /* @__PURE__ */ _("div", {
31088
- onClick: () => Ye(e),
31083
+ onClick: () => Xe(e),
31089
31084
  style: {
31090
31085
  padding: "16px 20px",
31091
31086
  borderBottom: "1px solid #f3f4f6",
@@ -31329,13 +31324,13 @@ function Nk({ copy: e, orbColors: t, primaryColor: n, chatBgGradient: r, logo: i
31329
31324
  });
31330
31325
  }
31331
31326
  function Pk() {
31332
- let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: ee, callConnectedAt: te, isCallMuted: ne, webRTCError: re, language: E, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: me, acceptCall: he, rejectCall: ge, endWebRTCCall: _e, toggleCallMute: ve, dismissCallError: ye, startTyping: be, stopTyping: xe, updateTypingDraft: Se, getVisitorChatHistory: Ce, getVisitorChatThread: we, resumeChat: Te, isSessionRestoring: Ee, openToChatCounter: De, voiceEndCounter: Oe } = In();
31327
+ let { status: e, runtimeConfig: t, resolvedConfig: n, chatHistory: r, isOpen: i, activeScreen: a, isHumanHandled: s, agentName: l, agentHeadshot: u, visitorEmail: h, isAgentTyping: v, isAiTyping: y, isLoading: b, isRateLimited: x, rateLimitMessage: S, isConversationEnded: C, incomingCall: w, activeCallId: T, callConnectionState: ee, callConnectedAt: te, isCallMuted: ne, webRTCError: re, language: E, chatId: ie, historyRef: ae, onMessageSync: oe, sendMessage: D, uploadChatFile: se, openWidget: ce, captureVisitorEmail: le, setVoiceMode: ue, endConversation: de, startNewChat: me, acceptCall: he, rejectCall: ge, endWebRTCCall: _e, toggleCallMute: ve, dismissCallError: ye, startTyping: be, stopTyping: xe, updateTypingDraft: Se, getVisitorChatHistory: Ce, getVisitorChatThread: we, resumeChat: Te, isSessionRestoring: Ee, openToChatCounter: De, voiceEndCounter: Oe } = Ln();
31333
31328
  c(() => {
31334
31329
  try {
31335
- cr();
31330
+ lr();
31336
31331
  } catch {}
31337
31332
  }, []), c(() => {
31338
- De && j !== "text_chat" && j !== "call_screen" && (ue?.(!1), ot("text_chat"));
31333
+ De && A !== "text_chat" && A !== "call_screen" && (ue?.(!1), st("text_chat"));
31339
31334
  }, [De]);
31340
31335
  let ke = t?.widgetSettings || {}, Ae = n?.widgetSettings || {}, O = {
31341
31336
  ...ke.branding || {},
@@ -31346,12 +31341,12 @@ function Pk() {
31346
31341
  }, Fe = {
31347
31342
  ...ke.features || {},
31348
31343
  ...Ae.features || {}
31349
- }, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He = Sk(Re ?? Ne.chatBgColors), k = O.logo || O.logoUrl || null, Ue = E || "en", We = ke.recommendations?.[Ue] || [], Ge = (Ae.recommendations?.[Ue] ?? We).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31344
+ }, Ie = Fe.voice !== !1, Re = Array.isArray(Ne.orbColors) && Ne.orbColors.length > 0 ? Ne.orbColors : null, ze = Ne.buttonColor || Ne.primaryColor || Re?.[0] || "#3B82F6", Be = Ne.position || "bottom-right", Ve = O.fallbackAgentName || "Agent", He = Sk(Re ?? Ne.chatBgColors), Ue = O.logo || O.logoUrl || null, We = E || "en", Ge = ke.recommendations?.[We] || [], Ke = (Ae.recommendations?.[We] ?? Ge).filter((e) => String(e?.label ?? "").trim()).map((e, t) => ({
31350
31345
  id: e.key || `qr-${t}`,
31351
31346
  label: e.label,
31352
31347
  message: e.label,
31353
31348
  text: e.label
31354
- })), Ke = Array.isArray(O.quickChatOptions) && O.quickChatOptions.length > 0 ? O.quickChatOptions : Ge, qe = O.hideWatermark === !0 ? !1 : O.showPoweredBy !== !1, Je = O.chatbotEnabled !== !1 && Ne.chatbotEnabled !== !1, Ye = ke.greetings?.[E] || Ae.greetings?.[E] || O.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Xe = {
31349
+ })), qe = Array.isArray(O.quickChatOptions) && O.quickChatOptions.length > 0 ? O.quickChatOptions : Ke, Je = O.hideWatermark === !0 ? !1 : O.showPoweredBy !== !1, Ye = O.chatbotEnabled !== !1 && Ne.chatbotEnabled !== !1, Xe = ke.greetings?.[E] || Ae.greetings?.[E] || O.introGreeting || "Hello, I'm here to help you know more about OpenSense Labs.", Ze = {
31355
31350
  entryPrompt: O.entryPrompt || "Do you want to explore in a new way?",
31356
31351
  yesLabel: O.yesLabel || "Yes",
31357
31352
  laterLabel: O.laterLabel || "Later",
@@ -31359,189 +31354,189 @@ function Pk() {
31359
31354
  voiceLabel: O.voiceLabel || "Voice",
31360
31355
  textLabel: O.textLabel || "Text",
31361
31356
  chatTitle: O.headerName || "Chat with FlowEngage",
31362
- introGreeting: Ye,
31357
+ introGreeting: Xe,
31363
31358
  inputPlaceholder: O.inputPlaceholder || "Type your message",
31364
31359
  analysingLabel: O.analysingLabel || "analysing..."
31365
- }, Ze = Ae.elevenLabsAgentId || t?.elevenLabsAgentId || null, Qe = Ae.elevenLabsVoiceId || t?.elevenLabsVoiceId || null, $e = t?.siteId || n?.siteId || null, et = t?.apiBaseUrl || "", tt = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
31360
+ }, Qe = Ae.elevenLabsAgentId || t?.elevenLabsAgentId || null, $e = Ae.elevenLabsVoiceId || t?.elevenLabsVoiceId || null, et = t?.siteId || n?.siteId || null, tt = t?.apiBaseUrl || "", nt = f(() => l && String(l).trim() || t?.ownerName && String(t.ownerName).trim() || t?.websiteName && String(t.websiteName).trim() || "Agent", [
31366
31361
  l,
31367
31362
  t?.ownerName,
31368
31363
  t?.websiteName
31369
- ]), nt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, rt = r.some((e) => e.sender === "user"), it = f(() => {
31364
+ ]), rt = u && String(u).trim() || t?.ownerProfileImageUrl && String(t.ownerProfileImageUrl).trim() || null, it = r.some((e) => e.sender === "user"), at = f(() => {
31370
31365
  let e = r.findIndex((e) => e.sender === "user");
31371
31366
  return e === -1 ? !1 : r.slice(e + 1).some((e) => e.sender === "bot" || e.sender === "ai" || e.sender === "agent");
31372
- }, [r]), at = !h && rt && it, A = !!(Ae._dashboardLivePreview || ke._dashboardLivePreview), [j, ot] = m(() => A ? "text_chat" : "entry_prompt"), [st, ct] = m(""), [lt, ut] = m(null), [dt, ft] = m(h || ""), [pt, mt] = m(""), [ht, M] = m(!1), [gt, _t] = m(0), [vt, yt] = m(null), [bt, xt] = m(null), [St, Ct] = m(""), [wt, Tt] = m(!1), [Et, Dt] = m(!1), [Ot, kt] = m(!1), At = p(null), jt = p(!1);
31367
+ }, [r]), k = !h && it && at, ot = !!(Ae._dashboardLivePreview || ke._dashboardLivePreview), [A, st] = m(() => ot ? "text_chat" : "entry_prompt"), [ct, lt] = m(""), [ut, dt] = m(null), [ft, pt] = m(h || ""), [mt, ht] = m(""), [gt, j] = m(!1), [_t, vt] = m(0), [yt, bt] = m(null), [xt, St] = m(null), [Ct, wt] = m(""), [Tt, Et] = m(!1), [Dt, Ot] = m(!1), [kt, At] = m(!1), jt = p(null), Mt = p(!1);
31373
31368
  d(() => {
31374
- if (e !== "ready" || jt.current) return;
31375
- if (jt.current = !0, !Ie) {
31376
- ot("minimized_orb");
31369
+ if (e !== "ready" || Mt.current) return;
31370
+ if (Mt.current = !0, !Ie) {
31371
+ st("minimized_orb");
31377
31372
  return;
31378
31373
  }
31379
31374
  let t = !1;
31380
31375
  try {
31381
- t = yr().shouldResumeVoice;
31376
+ t = br().shouldResumeVoice;
31382
31377
  } catch {}
31383
- let n = Pe(), r = $e ? je($e) : null, i = n || !!r?.transcript;
31378
+ let n = Pe(), r = et ? je(et) : null, i = n || !!r?.transcript;
31384
31379
  if (t) {
31385
- ce?.({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31380
+ ce?.({ notifyChatInitiated: !0 }), ue?.(!0), st("voice_mode");
31386
31381
  return;
31387
31382
  }
31388
31383
  if (Le()) {
31389
- ce?.({ notifyChatInitiated: !1 }), ot("text_chat");
31384
+ ce?.({ notifyChatInitiated: !1 }), st("text_chat");
31390
31385
  return;
31391
31386
  }
31392
- if ($e) try {
31393
- Me($e);
31387
+ if (et) try {
31388
+ Me(et);
31394
31389
  } catch {}
31395
31390
  if (i) {
31396
- ot("minimized_orb");
31391
+ st("minimized_orb");
31397
31392
  return;
31398
31393
  }
31399
- if (fe($e)) {
31400
- ot("minimized_orb");
31394
+ if (fe(et)) {
31395
+ st("minimized_orb");
31401
31396
  return;
31402
31397
  }
31403
31398
  }, [e, r]);
31404
- let [Mt, Nt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
31399
+ let [Nt, Pt] = m(() => typeof window < "u" && window.matchMedia("(max-width: 640px)").matches);
31405
31400
  c(() => {
31406
- let e = window.matchMedia("(max-width: 640px)"), t = (e) => Nt(e.matches);
31401
+ let e = window.matchMedia("(max-width: 640px)"), t = (e) => Pt(e.matches);
31407
31402
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
31408
31403
  }, []), c(() => {
31409
- ft(h || ""), h && mt("");
31404
+ pt(h || ""), h && ht("");
31410
31405
  }, [h]);
31411
- let Pt = o(() => {
31412
- xt(null), Ct("");
31413
- }, []), Ft = o((e) => {
31406
+ let Ft = o(() => {
31407
+ St(null), wt("");
31408
+ }, []), It = o((e) => {
31414
31409
  let t = RD(e);
31415
31410
  if (t) {
31416
- xt(null), Ct(t);
31411
+ St(null), wt(t);
31417
31412
  return;
31418
31413
  }
31419
- xt(e), Ct("");
31414
+ St(e), wt("");
31420
31415
  }, []);
31421
31416
  c(() => {
31422
31417
  if (!te || ee !== "connected") {
31423
- _t(0);
31418
+ vt(0);
31424
31419
  return;
31425
31420
  }
31426
31421
  let e = () => {
31427
31422
  let e = new Date(te).getTime();
31428
- isNaN(e) || _t(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
31423
+ isNaN(e) || vt(Math.max(0, Math.floor((Date.now() - e) / 1e3)));
31429
31424
  };
31430
31425
  e();
31431
31426
  let t = window.setInterval(e, 1e3);
31432
31427
  return () => window.clearInterval(t);
31433
31428
  }, [te, ee]);
31434
- let It = o(() => {
31435
- ot("call_screen"), Dt(!1);
31436
- }, []), Lt = o(() => {
31437
- ot("text_chat"), Dt(!0);
31429
+ let Lt = o(() => {
31430
+ st("call_screen"), Ot(!1);
31431
+ }, []), Rt = o(() => {
31432
+ st("text_chat"), Ot(!0);
31438
31433
  }, []);
31439
31434
  c(() => {
31440
31435
  let e = w?.callId || T || null;
31441
31436
  if (!e) {
31442
- At.current = null;
31437
+ jt.current = null;
31443
31438
  return;
31444
31439
  }
31445
31440
  if (w?.callId || ee === "connecting" || ee === "connected") {
31446
- if (j === "minimized_orb" && Et && T && !w?.callId) {
31447
- At.current = e;
31441
+ if (A === "minimized_orb" && Dt && T && !w?.callId) {
31442
+ jt.current = e;
31448
31443
  return;
31449
31444
  }
31450
- !(!i || j === "minimized_orb" || j === "voice_mode") && At.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
31445
+ !(!i || A === "minimized_orb" || A === "voice_mode") && jt.current === e || (console.log("[FlowEngageWidget] forcing call UI to front", {
31451
31446
  forcedKey: e,
31452
31447
  isOpen: i,
31453
- surface: j,
31448
+ surface: A,
31454
31449
  hasIncomingCall: !!w?.callId,
31455
31450
  activeCallId: T,
31456
31451
  callConnectionState: ee
31457
- }), At.current = e, j === "voice_mode" && ue?.(!1), ce?.(), It());
31452
+ }), jt.current = e, A === "voice_mode" && ue?.(!1), ce?.(), Lt());
31458
31453
  }
31459
31454
  }, [
31460
31455
  T,
31461
31456
  ee,
31462
- It,
31457
+ Lt,
31463
31458
  w?.callId,
31464
31459
  i,
31465
31460
  ce,
31466
31461
  ue,
31467
- j
31462
+ A
31468
31463
  ]), c(() => {
31469
- !w && !T && j === "call_screen" && ot("text_chat");
31464
+ !w && !T && A === "call_screen" && st("text_chat");
31470
31465
  }, [
31471
31466
  w,
31472
31467
  T,
31473
- j
31468
+ A
31474
31469
  ]), c(() => {
31475
- !T && Et && Dt(!1);
31476
- }, [T, Et]), c(() => {
31470
+ !T && Dt && Ot(!1);
31471
+ }, [T, Dt]), c(() => {
31477
31472
  if (!s || C) {
31478
31473
  Se?.(""), xe?.();
31479
31474
  return;
31480
31475
  }
31481
- if (!st.trim() || bt) {
31476
+ if (!ct.trim() || xt) {
31482
31477
  Se?.("");
31483
31478
  let e = window.setTimeout(() => xe?.(), 100);
31484
31479
  return () => window.clearTimeout(e);
31485
31480
  }
31486
31481
  be?.();
31487
- let e = window.setTimeout(() => Se?.(st), 120), t = window.setTimeout(() => xe?.(), 1200);
31482
+ let e = window.setTimeout(() => Se?.(ct), 120), t = window.setTimeout(() => xe?.(), 1200);
31488
31483
  return () => {
31489
31484
  window.clearTimeout(e), window.clearTimeout(t);
31490
31485
  };
31491
31486
  }, [
31492
- st,
31493
- bt,
31487
+ ct,
31488
+ xt,
31494
31489
  s,
31495
31490
  C,
31496
31491
  be,
31497
31492
  xe,
31498
31493
  Se
31499
31494
  ]);
31500
- let Rt = (e) => e ? {
31495
+ let zt = (e) => e ? {
31501
31496
  replyTo: e.messageId || e.id || null,
31502
31497
  replyToContent: (e.replyToContent || e.message || "").replace(/<[^>]+>/g, "").trim().slice(0, 200),
31503
31498
  replyToSender: e.sender || null
31504
- } : null, zt = async (e) => {
31499
+ } : null, Bt = async (e) => {
31505
31500
  if (e.preventDefault(), C) return;
31506
- if (at) {
31507
- let e = dt.trim().toLowerCase();
31501
+ if (k) {
31502
+ let e = ft.trim().toLowerCase();
31508
31503
  if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
31509
- mt("Please enter a valid email so we can continue helping you.");
31504
+ ht("Please enter a valid email so we can continue helping you.");
31510
31505
  return;
31511
31506
  }
31512
- await le(e), mt(""), M(!0), setTimeout(() => M(!1), 3e3);
31507
+ await le(e), ht(""), j(!0), setTimeout(() => j(!1), 3e3);
31513
31508
  return;
31514
31509
  }
31515
- let t = Rt(lt);
31516
- if (!st.trim() && !bt) return;
31517
- if (bt) {
31510
+ let t = zt(ut);
31511
+ if (!ct.trim() && !xt) return;
31512
+ if (xt) {
31518
31513
  try {
31519
- Tt(!0), Ct("");
31520
- let e = await se(bt), n = e?.data || e, r = st.trim() || `Shared file: ${BD(bt)}`;
31521
- ct(""), ut(null), Pt(), await D(r, "", t, {
31514
+ Et(!0), wt("");
31515
+ let e = await se(xt), n = e?.data || e, r = ct.trim() || `Shared file: ${BD(xt)}`;
31516
+ lt(""), dt(null), Ft(), await D(r, "", t, {
31522
31517
  type: "file",
31523
31518
  metadata: {
31524
31519
  fileUrl: n?.fileUrl,
31525
- fileName: n?.fileName || bt.name,
31526
- fileType: n?.fileType || bt.type,
31527
- fileSize: n?.fileSize || bt.size
31520
+ fileName: n?.fileName || xt.name,
31521
+ fileType: n?.fileType || xt.type,
31522
+ fileSize: n?.fileSize || xt.size
31528
31523
  }
31529
31524
  });
31530
31525
  } catch (e) {
31531
- Ct(e?.message || "Failed to upload the selected file.");
31526
+ wt(e?.message || "Failed to upload the selected file.");
31532
31527
  } finally {
31533
- Tt(!1);
31528
+ Et(!1);
31534
31529
  }
31535
31530
  return;
31536
31531
  }
31537
- let n = st.trim();
31538
- ct(""), ut(null), await D(n, "", t);
31539
- }, Bt = o(() => {
31532
+ let n = ct.trim();
31533
+ lt(""), dt(null), await D(n, "", t);
31534
+ }, Vt = o(() => {
31540
31535
  r.length !== 0 && me?.();
31541
- }, [r.length, me]), Vt = (e) => {
31536
+ }, [r.length, me]), Ht = (e) => {
31542
31537
  let t = Math.floor(e / 60);
31543
31538
  return `${String(t).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`;
31544
- }, Ht = o(async (e) => {
31539
+ }, Ut = o(async (e) => {
31545
31540
  if (C || b) return;
31546
31541
  let t = e.message || e.label || e.text || "";
31547
31542
  t.trim() && await D(t.trim(), "");
@@ -31549,22 +31544,22 @@ function Pk() {
31549
31544
  C,
31550
31545
  b,
31551
31546
  D
31552
- ]), Ut = Mt && j === "entry_prompt" ? { inset: 0 } : Mt && j === "text_chat" ? {
31547
+ ]), Wt = Nt && A === "entry_prompt" ? { inset: 0 } : Nt && A === "text_chat" ? {
31553
31548
  left: 0,
31554
31549
  right: 0,
31555
31550
  bottom: 0
31556
- } : Mt && j === "call_screen" ? {
31551
+ } : Nt && A === "call_screen" ? {
31557
31552
  left: 0,
31558
31553
  right: 0,
31559
31554
  bottom: 0,
31560
31555
  height: "90dvh",
31561
31556
  overflow: "hidden",
31562
31557
  borderRadius: "16px 16px 0 0"
31563
- } : Mt && j === "connection_modal" ? {
31558
+ } : Nt && A === "connection_modal" ? {
31564
31559
  left: "28px",
31565
31560
  right: "12px",
31566
31561
  bottom: "12px"
31567
- } : j === "call_screen" ? {
31562
+ } : A === "call_screen" ? {
31568
31563
  width: "min(350px, calc(100vw - 40px))",
31569
31564
  height: "min(640px, calc(100vh - 120px))",
31570
31565
  borderRadius: "22px",
@@ -31582,11 +31577,11 @@ function Pk() {
31582
31577
  } : {
31583
31578
  right: "1.5rem",
31584
31579
  bottom: "1.5rem"
31585
- }, Wt = o(() => {
31586
- j !== "minimized_orb" && (kt(!0), setTimeout(() => {
31587
- ot("minimized_orb"), kt(!1);
31580
+ }, Gt = o(() => {
31581
+ A !== "minimized_orb" && (At(!0), setTimeout(() => {
31582
+ st("minimized_orb"), At(!1);
31588
31583
  }, 280));
31589
- }, [j]), Gt = () => ot("connection_modal"), Kt = () => {
31584
+ }, [A]), Kt = () => st("connection_modal"), qt = () => {
31590
31585
  try {
31591
31586
  let e = window.AudioContext || window.webkitAudioContext;
31592
31587
  if (e) {
@@ -31594,36 +31589,36 @@ function Pk() {
31594
31589
  t.resume().catch(() => {}), setTimeout(() => t.close().catch(() => {}), 3e3);
31595
31590
  }
31596
31591
  } catch {}
31597
- ce({ notifyChatInitiated: !0 }), ue?.(!0), ot("voice_mode");
31598
- }, qt = () => {
31599
- ce({ notifyChatInitiated: !0 }), ue?.(!1), ot("text_chat");
31592
+ ce({ notifyChatInitiated: !0 }), ue?.(!0), st("voice_mode");
31600
31593
  }, Jt = () => {
31601
- ue?.(!1), Wt();
31594
+ ce({ notifyChatInitiated: !0 }), ue?.(!1), st("text_chat");
31595
+ }, Yt = () => {
31596
+ ue?.(!1), Gt();
31602
31597
  };
31603
- return e !== "ready" || !Je || Fe.chat === !1 ? null : /* @__PURE__ */ _("div", {
31598
+ return e !== "ready" || !Ye || Fe.chat === !1 ? null : /* @__PURE__ */ _("div", {
31604
31599
  className: "flowengage-widget-root",
31605
31600
  style: {
31606
31601
  position: "fixed",
31607
31602
  zIndex: 999999,
31608
- ...Ut
31603
+ ...Wt
31609
31604
  },
31610
31605
  onWheel: (e) => e.stopPropagation(),
31611
31606
  onTouchMove: (e) => e.stopPropagation(),
31612
31607
  children: [
31613
- j === "entry_prompt" && /* @__PURE__ */ g(Ok, {
31614
- copy: Xe,
31608
+ A === "entry_prompt" && /* @__PURE__ */ g(Ok, {
31609
+ copy: Ze,
31615
31610
  orbColors: Re,
31616
31611
  primaryColor: ze,
31617
31612
  onYes: () => {
31618
- pe($e), Kt();
31613
+ pe(et), qt();
31619
31614
  },
31620
31615
  onLater: () => {
31621
- pe($e), Wt();
31616
+ pe(et), Gt();
31622
31617
  },
31623
- isMobile: Mt,
31624
- isClosing: Ot
31618
+ isMobile: Nt,
31619
+ isClosing: kt
31625
31620
  }),
31626
- j === "minimized_orb" && /* @__PURE__ */ _(Sm.div, {
31621
+ A === "minimized_orb" && /* @__PURE__ */ _(Sm.div, {
31627
31622
  layoutId: "fe-main-orb",
31628
31623
  initial: {
31629
31624
  scale: .4,
@@ -31645,11 +31640,11 @@ function Pk() {
31645
31640
  alignItems: Be === "bottom-left" ? "flex-start" : "flex-end",
31646
31641
  gap: "10px"
31647
31642
  },
31648
- children: [T && Et && /* @__PURE__ */ _("button", {
31643
+ children: [T && Dt && /* @__PURE__ */ _("button", {
31649
31644
  type: "button",
31650
- onClick: It,
31645
+ onClick: Lt,
31651
31646
  style: {
31652
- maxWidth: Mt ? "220px" : "240px",
31647
+ maxWidth: Nt ? "220px" : "240px",
31653
31648
  padding: "10px 14px",
31654
31649
  borderRadius: "18px",
31655
31650
  border: "1px solid rgba(255,255,255,0.7)",
@@ -31690,111 +31685,111 @@ function Pk() {
31690
31685
  marginTop: "2px",
31691
31686
  whiteSpace: "nowrap"
31692
31687
  },
31693
- children: ee === "connected" ? `${Vt(gt)} with ${tt}` : `Tap to return to ${tt}`
31688
+ children: ee === "connected" ? `${Ht(_t)} with ${nt}` : `Tap to return to ${nt}`
31694
31689
  })]
31695
31690
  })]
31696
31691
  }), /* @__PURE__ */ g(Dk, {
31697
31692
  size: 50,
31698
31693
  orbColors: Re,
31699
- onClick: T && Et ? It : Ie ? Gt : qt
31694
+ onClick: T && Dt ? Lt : Ie ? Kt : Jt
31700
31695
  })]
31701
31696
  }),
31702
- j === "connection_modal" && /* @__PURE__ */ g(kk, {
31703
- copy: Xe,
31697
+ A === "connection_modal" && /* @__PURE__ */ g(kk, {
31698
+ copy: Ze,
31704
31699
  orbColors: Re,
31705
31700
  primaryColor: ze,
31706
- onVoice: Kt,
31707
- onText: qt,
31708
- onClose: Wt,
31709
- isMobile: Mt,
31710
- isClosing: Ot
31701
+ onVoice: qt,
31702
+ onText: Jt,
31703
+ onClose: Gt,
31704
+ isMobile: Nt,
31705
+ isClosing: kt
31711
31706
  }),
31712
- j === "voice_mode" && /* @__PURE__ */ g(Ak, {
31707
+ A === "voice_mode" && /* @__PURE__ */ g(Ak, {
31713
31708
  orbColors: Re,
31714
- onEnterChat: qt,
31715
- onEndChat: Jt,
31716
- agentId: Ze,
31717
- voiceId: Qe,
31718
- siteId: $e,
31719
- apiBaseUrl: et,
31709
+ onEnterChat: Jt,
31710
+ onEndChat: Yt,
31711
+ agentId: Qe,
31712
+ voiceId: $e,
31713
+ siteId: et,
31714
+ apiBaseUrl: tt,
31720
31715
  chatId: ie,
31721
31716
  historyRef: ae,
31722
31717
  onMessageSync: oe,
31723
31718
  voiceEndCounter: Oe
31724
31719
  }, "voice"),
31725
- j === "call_screen" && /* @__PURE__ */ g(sO, {
31720
+ A === "call_screen" && /* @__PURE__ */ g(sO, {
31726
31721
  incomingCall: w,
31727
31722
  activeCallId: T,
31728
31723
  callConnectionState: ee,
31729
- callDurationSeconds: gt,
31724
+ callDurationSeconds: _t,
31730
31725
  isCallMuted: ne,
31731
- agentName: tt,
31732
- agentHeadshot: nt,
31726
+ agentName: nt,
31727
+ agentHeadshot: rt,
31733
31728
  fallbackAgentName: Ve,
31734
31729
  acceptCall: he,
31735
31730
  rejectCall: ge,
31736
31731
  endWebRTCCall: _e,
31737
31732
  toggleCallMute: ve,
31738
- formatCallDuration: Vt,
31739
- onMinimize: Lt,
31733
+ formatCallDuration: Ht,
31734
+ onMinimize: Rt,
31740
31735
  primaryColor: ze,
31741
31736
  orbColors: Re,
31742
31737
  chatHistory: r
31743
31738
  }),
31744
- j === "text_chat" && /* @__PURE__ */ g(Nk, {
31745
- isClosing: Ot,
31746
- copy: Xe,
31739
+ A === "text_chat" && /* @__PURE__ */ g(Nk, {
31740
+ isClosing: kt,
31741
+ copy: Ze,
31747
31742
  orbColors: Re,
31748
31743
  primaryColor: ze,
31749
31744
  chatBgGradient: He,
31750
- logo: k,
31751
- quickChatOptions: Ke,
31752
- onQuickChatSelect: Ht,
31753
- isMobile: Mt,
31745
+ logo: Ue,
31746
+ quickChatOptions: qe,
31747
+ onQuickChatSelect: Ut,
31748
+ isMobile: Nt,
31754
31749
  chatHistory: r,
31755
31750
  isAiTyping: y,
31756
31751
  isAgentTyping: v,
31757
31752
  activeScreen: a,
31758
- agentName: tt,
31759
- agentHeadshot: nt,
31753
+ agentName: nt,
31754
+ agentHeadshot: rt,
31760
31755
  fallbackAgentName: Ve,
31761
- input: st,
31762
- setInput: ct,
31763
- onSubmit: zt,
31756
+ input: ct,
31757
+ setInput: lt,
31758
+ onSubmit: Bt,
31764
31759
  isConversationEnded: C,
31765
31760
  isLoading: b,
31766
31761
  isRateLimited: x,
31767
31762
  rateLimitMessage: S,
31768
- selectedFile: bt,
31769
- onFileSelect: Ft,
31770
- onRemoveSelectedFile: Pt,
31771
- attachmentError: St,
31772
- isUploadingAttachment: wt,
31773
- requiresEmail: at,
31774
- emailInput: dt,
31775
- setEmailInput: ft,
31776
- emailError: pt,
31777
- emailCaptureSuccess: ht,
31778
- replyContext: lt,
31779
- setReplyContext: ut,
31763
+ selectedFile: xt,
31764
+ onFileSelect: It,
31765
+ onRemoveSelectedFile: Ft,
31766
+ attachmentError: Ct,
31767
+ isUploadingAttachment: Tt,
31768
+ requiresEmail: k,
31769
+ emailInput: ft,
31770
+ setEmailInput: pt,
31771
+ emailError: mt,
31772
+ emailCaptureSuccess: gt,
31773
+ replyContext: ut,
31774
+ setReplyContext: dt,
31780
31775
  webRTCError: re,
31781
- micError: vt,
31782
- setMicError: yt,
31776
+ micError: yt,
31777
+ setMicError: bt,
31783
31778
  dismissCallError: ye,
31784
31779
  activeCallId: T,
31785
31780
  isCallMuted: ne,
31786
31781
  toggleCallMute: ve,
31787
31782
  endWebRTCCall: _e,
31788
- formatCallDuration: Vt,
31789
- callDurationSeconds: gt,
31790
- onCollapse: Wt,
31791
- onStartVoice: Kt,
31792
- onNewChat: Bt,
31783
+ formatCallDuration: Ht,
31784
+ callDurationSeconds: _t,
31785
+ onCollapse: Gt,
31786
+ onStartVoice: qt,
31787
+ onNewChat: Vt,
31793
31788
  onEndConversation: de,
31794
- onMinimize: Lt,
31795
- onExpand: It,
31796
- isCallMinimized: Et && !!T,
31797
- showPoweredBy: qe,
31789
+ onMinimize: Rt,
31790
+ onExpand: Lt,
31791
+ isCallMinimized: Dt && !!T,
31792
+ showPoweredBy: Je,
31798
31793
  getVisitorChatHistory: Ce,
31799
31794
  getVisitorChatThread: we,
31800
31795
  resumeChat: Te,
@@ -31821,4 +31816,4 @@ var Fk = class extends e.Component {
31821
31816
  }
31822
31817
  };
31823
31818
  //#endregion
31824
- export { eO as AnimatedOrb, Fk as ErrorBoundary, Mr as FlowEngageProvider, Pk as FlowEngageWidget, In as useFlowEngage };
31819
+ export { eO as AnimatedOrb, Fk as ErrorBoundary, Nr as FlowEngageProvider, Pk as FlowEngageWidget, Ln as useFlowEngage };