@gengage/assistant-fe 0.6.44 → 0.6.45

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.
@@ -1,8 +1,8 @@
1
- import { c as Xt, f as Sa, g as Ea, i as Pa, l as La, m as Ta, n as Aa, t as Ia } from "./request-response-cache-Ddw59jGs.js";
2
- import { A as Ce, C as Ma, D as Na, E as Ba, M as de, N as be, O as za, S as yt, T as Ra, _ as Ha, a as _e, b as Fa, d as Da, f as Oa, g as Ua, h as ja, j as ve, l as qa, m as $a, p as Va, u as Ga, v as Wa, w as at, x as Ka } from "./context-UTzCGyR9.js";
3
- import { i as ze, s as Qt, t as Ya } from "./widget-base-DRNUkp-i.js";
4
- import { d as he, f as Za, i as Xa, n as Qa, p as Ja, r as en, t as wt, u as tn } from "./fastIntent-DOgXE46i.js";
5
- import { t as Ue } from "./locale-uQ5XZ2yS.js";
1
+ import { c as Xt, f as Sa, g as Ea, i as Pa, l as La, m as Ta, n as Aa, t as Ia } from "./request-response-cache-DIu22gmN.js";
2
+ import { A as Ce, C as Ma, D as Na, E as Ba, M as de, N as ve, O as za, S as yt, T as Ra, _ as Ha, a as _e, b as Fa, d as Da, f as Ua, g as Oa, h as ja, j as he, l as qa, m as $a, p as Va, u as Ga, v as Wa, w as at, x as Ka } from "./context-UTzCGyR9.js";
3
+ import { i as ze, s as Qt, t as Ya } from "./widget-base-DH9dsYIO.js";
4
+ import { d as ue, f as Za, i as Xa, n as Qa, p as Ja, r as en, t as wt, u as tn } from "./fastIntent-DtopsdAD.js";
5
+ import { t as Oe } from "./locale-uQ5XZ2yS.js";
6
6
  import { a as Jt, i as ea, n as xe, r as ta, t as ae } from "./price-formatter-CHUmYq8I.js";
7
7
  function _t() {
8
8
  const t = Date.now(), e = new Uint8Array(16);
@@ -602,7 +602,7 @@ function wn(t) {
602
602
  const e = document.createElement("div");
603
603
  e.className = "gengage-chat-kvkk-banner", e.dataset.gengagePart = "kvkk-banner", e.setAttribute("role", "note");
604
604
  const a = document.createElement("div");
605
- return a.className = "gengage-chat-kvkk-content", a.dataset.gengagePart = "kvkk-content", a.innerHTML = be(t.htmlContent), e.appendChild(a), e;
605
+ return a.className = "gengage-chat-kvkk-content", a.dataset.gengagePart = "kvkk-content", a.innerHTML = ve(t.htmlContent), e.appendChild(a), e;
606
606
  }
607
607
  var _n = class {
608
608
  constructor(t) {
@@ -822,7 +822,7 @@ var Bn = class {
822
822
  t.className = "gengage-chat-footer", t.dataset.gengagePart = "chat-footer";
823
823
  const e = this._options.footerAttribution, a = typeof e?.label == "string" ? e.label.trim() : "", n = typeof e?.href == "string" ? e.href.trim() : "", r = typeof this.i18n.poweredBy == "string" ? this.i18n.poweredBy.trim() : "", i = a || r;
824
824
  if (!i) return null;
825
- if (n && ve(n)) {
825
+ if (n && he(n)) {
826
826
  const o = document.createElement("a");
827
827
  return o.className = "gengage-chat-footer-link", o.dataset.gengagePart = "chat-footer-link", o.href = n, o.target = e?.target || "_blank", o.rel = e?.rel || "noopener noreferrer", o.textContent = i, typeof e?.ariaLabel == "string" && e.ariaLabel.trim() && o.setAttribute("aria-label", e.ariaLabel.trim()), t.appendChild(o), t;
828
828
  }
@@ -837,8 +837,8 @@ var Bn = class {
837
837
  n.id = a, n.className = "gengage-sr-only", n.textContent = this.i18n.headerTitle ?? "AI shopping assistant", this.root.appendChild(n), this.root.setAttribute("aria-describedby", a);
838
838
  let r = null;
839
839
  {
840
- const y = document.createElement("div");
841
- y.className = "gengage-chat-drawer-handle", y.dataset.gengagePart = "chat-drawer-handle", y.setAttribute("aria-hidden", "true"), y.style.pointerEvents = "none", r = y;
840
+ const w = document.createElement("div");
841
+ w.className = "gengage-chat-drawer-handle", w.dataset.gengagePart = "chat-drawer-handle", w.setAttribute("aria-hidden", "true"), w.style.pointerEvents = "none", r = w;
842
842
  }
843
843
  const i = document.createElement("div");
844
844
  i.className = "gengage-chat-header gds-shell-header", i.dataset.gengagePart = "chat-header";
@@ -846,8 +846,8 @@ var Bn = class {
846
846
  o.className = "gengage-chat-header-left", o.dataset.gengagePart = "chat-header-left";
847
847
  const s = e.headerAvatarUrl ?? e.launcherImageUrl, c = typeof e.headerAvatarUrl == "string" && e.headerAvatarUrl.length > 0 && e.headerAvatarUrl !== e.launcherImageUrl;
848
848
  if (s) {
849
- const y = document.createElement("img");
850
- y.className = "gengage-chat-header-avatar", c && y.classList.add("gengage-chat-header-avatar--logo"), y.dataset.gengagePart = "chat-header-avatar", y.src = s, y.alt = e.headerTitle ?? "Assistant", o.appendChild(y);
849
+ const w = document.createElement("img");
850
+ w.className = "gengage-chat-header-avatar", c && w.classList.add("gengage-chat-header-avatar--logo"), w.dataset.gengagePart = "chat-header-avatar", w.src = s, w.alt = e.headerTitle ?? "Assistant", o.appendChild(w);
851
851
  }
852
852
  const l = document.createElement("div");
853
853
  l.className = "gengage-chat-header-info", l.dataset.gengagePart = "chat-header-info";
@@ -855,65 +855,65 @@ var Bn = class {
855
855
  d.className = "gengage-chat-header-title-row", d.dataset.gengagePart = "chat-header-title-row";
856
856
  const p = document.createElement("span");
857
857
  if (p.className = "gengage-chat-header-title", p.dataset.gengagePart = "chat-header-title", p.textContent = e.headerTitle ?? this.i18n.headerTitle ?? "Product Expert", d.appendChild(p), e.headerBadge) {
858
- const y = document.createElement("span");
859
- y.className = "gengage-chat-header-badge gds-badge gds-badge-brand", y.dataset.gengagePart = "chat-header-badge", y.textContent = e.headerBadge, d.appendChild(y);
858
+ const w = document.createElement("span");
859
+ w.className = "gengage-chat-header-badge gds-badge gds-badge-brand", w.dataset.gengagePart = "chat-header-badge", w.textContent = e.headerBadge, d.appendChild(w);
860
860
  }
861
861
  if (l.appendChild(d), e.footerAttribution === void 0) {
862
- const y = this._createLegacyHeaderPoweredBy();
863
- y && l.appendChild(y);
862
+ const w = this._createLegacyHeaderPoweredBy();
863
+ w && l.appendChild(w);
864
864
  }
865
865
  o.appendChild(l), i.appendChild(o);
866
866
  const h = document.createElement("div");
867
867
  h.className = "gengage-chat-header-right", h.dataset.gengagePart = "chat-header-actions";
868
868
  {
869
- const y = document.createElement("button");
870
- y.type = "button", y.className = "gengage-chat-header-btn gengage-chat-header-btn--reopen-panel gds-btn gds-btn-ghost gds-icon-btn", y.dataset.gengagePart = "chat-header-reopen-panel", y.setAttribute("aria-label", this.i18n.showPanelAriaLabel), y.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="9" y1="3" x2="9" y2="21"/></svg>', y.addEventListener("click", () => this._showMobilePanelFromBtn()), h.appendChild(y), this._reopenPanelBtn = y;
869
+ const w = document.createElement("button");
870
+ w.type = "button", w.className = "gengage-chat-header-btn gengage-chat-header-btn--reopen-panel gds-btn gds-btn-ghost gds-icon-btn", w.dataset.gengagePart = "chat-header-reopen-panel", w.setAttribute("aria-label", this.i18n.showPanelAriaLabel), w.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="9" y1="3" x2="9" y2="21"/></svg>', w.addEventListener("click", () => this._showMobilePanelFromBtn()), h.appendChild(w), this._reopenPanelBtn = w;
871
871
  }
872
872
  if (e.headerCartUrl || e.onCartClick) {
873
- const y = document.createElement("button");
874
- y.type = "button", y.className = "gengage-chat-header-btn gengage-chat-header-btn--cart gds-btn gds-btn-ghost gds-icon-btn", y.dataset.gengagePart = "chat-header-cart", y.setAttribute("aria-label", this.i18n.cartAriaLabel), y.title = this.i18n.cartAriaLabel, y.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>', y.addEventListener("click", () => e.onCartClick?.()), h.appendChild(y), this._cartBtn = y;
873
+ const w = document.createElement("button");
874
+ w.type = "button", w.className = "gengage-chat-header-btn gengage-chat-header-btn--cart gds-btn gds-btn-ghost gds-icon-btn", w.dataset.gengagePart = "chat-header-cart", w.setAttribute("aria-label", this.i18n.cartAriaLabel), w.title = this.i18n.cartAriaLabel, w.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>', w.addEventListener("click", () => e.onCartClick?.()), h.appendChild(w), this._cartBtn = w;
875
875
  }
876
876
  if (e.onHistoryClick) {
877
- const y = document.createElement("button");
878
- y.type = "button", y.className = "gengage-chat-header-btn gengage-chat-header-btn--history gds-btn gds-btn-ghost gds-icon-btn", y.dataset.gengagePart = "chat-header-history", y.setAttribute("aria-label", this.i18n.historyAriaLabel), y.title = this.i18n.historyAriaLabel, y.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 8v5l3 2"/><path d="M3.05 11A9 9 0 1 1 5 17.5"/><path d="M3 8v4h4"/></svg>', y.addEventListener("click", () => e.onHistoryClick?.()), h.appendChild(y);
877
+ const w = document.createElement("button");
878
+ w.type = "button", w.className = "gengage-chat-header-btn gengage-chat-header-btn--history gds-btn gds-btn-ghost gds-icon-btn", w.dataset.gengagePart = "chat-header-history", w.setAttribute("aria-label", this.i18n.historyAriaLabel), w.title = this.i18n.historyAriaLabel, w.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 8v5l3 2"/><path d="M3.05 11A9 9 0 1 1 5 17.5"/><path d="M3 8v4h4"/></svg>', w.addEventListener("click", () => e.onHistoryClick?.()), h.appendChild(w);
879
879
  }
880
880
  if (e.onNewChat) {
881
- const y = document.createElement("button");
882
- y.className = "gengage-chat-header-btn gengage-chat-new-chat gds-btn gds-btn-ghost gds-icon-btn", y.dataset.gengagePart = "chat-header-new-chat", y.type = "button", y.setAttribute("aria-label", this.i18n.newChatButton), y.title = this.i18n.newChatButton, y.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>', y.addEventListener("click", () => e.onNewChat?.()), h.appendChild(y);
881
+ const w = document.createElement("button");
882
+ w.className = "gengage-chat-header-btn gengage-chat-new-chat gds-btn gds-btn-ghost gds-icon-btn", w.dataset.gengagePart = "chat-header-new-chat", w.type = "button", w.setAttribute("aria-label", this.i18n.newChatButton), w.title = this.i18n.newChatButton, w.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>', w.addEventListener("click", () => e.onNewChat?.()), h.appendChild(w);
883
883
  }
884
884
  const m = document.createElement("button");
885
885
  if (m.className = "gengage-chat-close gds-btn gds-btn-ghost gds-icon-btn", m.dataset.gengagePart = "chat-header-close", m.type = "button", m.setAttribute("aria-label", this.i18n.closeButton), m.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>', m.addEventListener("click", e.onClose), e.showHeaderFavorites) {
886
- const y = document.createElement("button");
887
- y.className = "gengage-chat-header-btn gengage-chat-header-btn--fav gds-btn gds-btn-ghost gds-icon-btn", y.dataset.gengagePart = "chat-header-favorites", y.type = "button", y.setAttribute("aria-label", this.i18n.favoritesAriaLabel), y.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>';
886
+ const w = document.createElement("button");
887
+ w.className = "gengage-chat-header-btn gengage-chat-header-btn--fav gds-btn gds-btn-ghost gds-icon-btn", w.dataset.gengagePart = "chat-header-favorites", w.type = "button", w.setAttribute("aria-label", this.i18n.favoritesAriaLabel), w.innerHTML = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>';
888
888
  const Y = document.createElement("span");
889
- Y.className = "gengage-chat-header-fav-badge", Y.dataset.gengagePart = "chat-header-favorites-badge", Y.setAttribute("aria-hidden", "true"), Y.style.display = "none", y.appendChild(Y), this._favBadgeEl = Y, y.addEventListener("click", () => {
889
+ Y.className = "gengage-chat-header-fav-badge", Y.dataset.gengagePart = "chat-header-favorites-badge", Y.setAttribute("aria-hidden", "true"), Y.style.display = "none", w.appendChild(Y), this._favBadgeEl = Y, w.addEventListener("click", () => {
890
890
  e.onFavoritesClick?.();
891
- }), h.appendChild(y);
891
+ }), h.appendChild(w);
892
892
  }
893
893
  h.appendChild(m), r && i.insertBefore(r, i.firstChild), i.appendChild(h);
894
894
  {
895
- let Y = 0, ce = 0, ie = !1;
895
+ let Y = 0, ce = 0, oe = !1;
896
896
  const M = (V) => {
897
897
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || V.target.closest('button, a, input, [role="button"]')) return;
898
898
  const G = V.changedTouches?.[0];
899
- G && (Y = G.clientY, ce = 0, ie = !0, this.root.style.transition = "none");
899
+ G && (Y = G.clientY, ce = 0, oe = !0, this.root.style.transition = "none");
900
900
  }, H = (V) => {
901
- if (!ie) return;
901
+ if (!oe) return;
902
902
  const G = V.changedTouches?.[0];
903
903
  if (!G) return;
904
904
  ce = G.clientY - Y;
905
905
  const J = (e.getMobileState?.() ?? "full") === "full" ? Math.max(0, ce) : ce;
906
906
  V.preventDefault(), this.root.style.transform = `translateY(${J}px)`;
907
907
  }, ee = () => {
908
- if (!ie) return;
909
- ie = !1;
908
+ if (!oe) return;
909
+ oe = !1;
910
910
  const V = e.getMobileState?.() ?? "full";
911
911
  let G;
912
912
  ce > 72 ? G = V === "full" ? "half" : "close" : ce < -72 && V === "half" ? G = "full" : G = V, this.root.style.transition = "", G === "close" ? (this.root.style.transform = "translateY(100%)", setTimeout(() => {
913
913
  this.root.style.transform = "", e.onMobileSnap?.("close");
914
914
  }, 280)) : (this.root.style.transform = "", e.onMobileSnap?.(G)), ce = 0;
915
915
  }, pe = () => {
916
- ie && (ie = !1, ce = 0, this.root.style.transition = "", this.root.style.transform = "");
916
+ oe && (oe = !1, ce = 0, this.root.style.transition = "", this.root.style.transform = "");
917
917
  };
918
918
  i.addEventListener("touchstart", M, { passive: !0 }), i.addEventListener("touchmove", H, { passive: !1 }), i.addEventListener("touchend", ee, { passive: !0 }), i.addEventListener("touchcancel", pe, { passive: !0 }), this._cleanups.push(() => {
919
919
  i.removeEventListener("touchstart", M), i.removeEventListener("touchmove", H), i.removeEventListener("touchend", ee), i.removeEventListener("touchcancel", pe);
@@ -941,17 +941,17 @@ var Bn = class {
941
941
  this.togglePanel(), this._onPanelToggle?.();
942
942
  });
943
943
  let g = null, _ = null;
944
- const w = 24, b = (y) => {
944
+ const y = 24, b = (w) => {
945
945
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768)) return;
946
- const Y = y.changedTouches?.[0];
946
+ const Y = w.changedTouches?.[0];
947
947
  Y && (g = Y.clientX, _ = Y.clientY);
948
- }, A = (y) => {
948
+ }, A = (w) => {
949
949
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || g === null || _ === null) return;
950
- const Y = y.changedTouches?.[0];
950
+ const Y = w.changedTouches?.[0];
951
951
  if (!Y) return;
952
- const ce = Y.clientX - g, ie = Y.clientY - _;
953
- if (g = null, _ = null, Math.abs(ie) < w || Math.abs(ie) < Math.abs(ce)) return;
954
- const M = ie < 0;
952
+ const ce = Y.clientX - g, oe = Y.clientY - _;
953
+ if (g = null, _ = null, Math.abs(oe) < y || Math.abs(oe) < Math.abs(ce)) return;
954
+ const M = oe < 0;
955
955
  M !== this._panelCollapsed && (this._ignoreNextDividerClick = !0, this.setPanelCollapsed(M), this._onPanelToggle?.());
956
956
  };
957
957
  this._dividerEl.addEventListener("touchstart", b, { passive: !0 }), this._dividerEl.addEventListener("touchend", A, { passive: !0 }), this._cleanups.push(() => {
@@ -961,14 +961,14 @@ var Bn = class {
961
961
  T.className = "gengage-chat-conversation", T.dataset.gengagePart = "chat-conversation", this._conversationEl = T, T.appendChild(i);
962
962
  const k = document.createElement("div");
963
963
  k.className = "gengage-chat-offline-bar gds-evidence-card gds-evidence-card-warning", k.dataset.gengagePart = "chat-offline-bar", k.setAttribute("role", "status"), k.setAttribute("aria-live", "polite"), k.textContent = this.i18n.offlineMessage, typeof navigator < "u" && !navigator.onLine && k.classList.add("gengage-chat-offline-bar--visible"), T.appendChild(k);
964
- const P = () => k.classList.add("gengage-chat-offline-bar--visible"), z = () => k.classList.remove("gengage-chat-offline-bar--visible");
965
- window.addEventListener("offline", P), window.addEventListener("online", z), this._cleanups.push(() => {
966
- window.removeEventListener("offline", P), window.removeEventListener("online", z);
964
+ const L = () => k.classList.add("gengage-chat-offline-bar--visible"), z = () => k.classList.remove("gengage-chat-offline-bar--visible");
965
+ window.addEventListener("offline", L), window.addEventListener("online", z), this._cleanups.push(() => {
966
+ window.removeEventListener("offline", L), window.removeEventListener("online", z);
967
967
  }), this._kvkkSlot = document.createElement("div"), this._kvkkSlot.className = "gengage-chat-kvkk-slot", this._kvkkSlot.dataset.gengagePart = "chat-kvkk-slot", T.appendChild(this._kvkkSlot), this.messagesEl = document.createElement("div"), this.messagesEl.id = dt, this.messagesEl.className = "gengage-chat-messages", this.messagesEl.dataset.gengagePart = "chat-messages", this.messagesEl.setAttribute("role", "log"), this.messagesEl.setAttribute("aria-live", "polite"), this.messagesEl.setAttribute("aria-atomic", "false"), this.messagesEl.setAttribute("aria-label", this.i18n.chatMessagesAriaLabel), Ct(this.messagesEl);
968
- const U = document.createElement("button");
969
- U.type = "button", U.className = "gengage-chat-former-messages-btn gds-chip", U.dataset.gengagePart = "chat-former-messages-button", U.textContent = this.i18n.showFormerMessagesButton, U.setAttribute("aria-label", this.i18n.showFormerMessagesButton), U.style.display = "none", U.addEventListener("click", () => {
968
+ const O = document.createElement("button");
969
+ O.type = "button", O.className = "gengage-chat-former-messages-btn gds-chip", O.dataset.gengagePart = "chat-former-messages-button", O.textContent = this.i18n.showFormerMessagesButton, O.setAttribute("aria-label", this.i18n.showFormerMessagesButton), O.style.display = "none", O.addEventListener("click", () => {
970
970
  this._options.presentation?.onReleasePresentationFocus?.();
971
- }), this.messagesEl.appendChild(U), this._formerMessagesBtn = U;
971
+ }), this.messagesEl.appendChild(O), this._formerMessagesBtn = O;
972
972
  const X = () => {
973
973
  this._userInteractionUntil = Date.now() + 2e3;
974
974
  };
@@ -976,28 +976,28 @@ var Bn = class {
976
976
  const R = () => this._options.presentation, F = () => {
977
977
  E || (E = !0, requestAnimationFrame(() => {
978
978
  E = !1;
979
- const { scrollTop: y, scrollHeight: Y, clientHeight: ce } = this.messagesEl, ie = Y - y - ce;
980
- this._userScrolledUp = ie > 10;
981
- const M = this._presentationPinned ? ie < 96 : ie < 32, H = Date.now(), ee = H < this._programmaticScrollUntil, pe = !M && H < this._userInteractionUntil, V = ee ? !1 : pe;
979
+ const { scrollTop: w, scrollHeight: Y, clientHeight: ce } = this.messagesEl, oe = Y - w - ce;
980
+ this._userScrolledUp = oe > 10;
981
+ const M = this._presentationPinned ? oe < 96 : oe < 32, H = Date.now(), ee = H < this._programmaticScrollUntil, pe = !M && H < this._userInteractionUntil, V = ee ? !1 : pe;
982
982
  M !== this._presentationPinned && (this._presentationPinned = M, R()?.onPinnedToBottomChange?.(M)), V !== this._presentationUserInteracting && (this._presentationUserInteracting = V, R()?.onUserInteractingChange?.(V));
983
983
  }));
984
984
  };
985
985
  this.messagesEl.addEventListener("scroll", F, { passive: !0 }), this._cleanups.push(() => {
986
986
  this.messagesEl.removeEventListener("scroll", F);
987
987
  });
988
- const B = (y) => {
989
- X(), y.deltaY < -6 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
988
+ const B = (w) => {
989
+ X(), w.deltaY < -6 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
990
990
  };
991
991
  this.messagesEl.addEventListener("wheel", B, { passive: !0 }), this._cleanups.push(() => this.messagesEl.removeEventListener("wheel", B));
992
- const C = (y) => {
993
- X(), this._touchStartY = y.touches[0]?.clientY ?? null;
994
- }, O = (y) => {
992
+ const C = (w) => {
993
+ X(), this._touchStartY = w.touches[0]?.clientY ?? null;
994
+ }, U = (w) => {
995
995
  X();
996
- const Y = y.touches[0]?.clientY, ce = this._touchStartY;
996
+ const Y = w.touches[0]?.clientY, ce = this._touchStartY;
997
997
  typeof Y == "number" && typeof ce == "number" && Y - ce > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
998
998
  };
999
- this.messagesEl.addEventListener("touchstart", C, { passive: !0 }), this.messagesEl.addEventListener("touchmove", O, { passive: !0 }), this._cleanups.push(() => {
1000
- this.messagesEl.removeEventListener("touchstart", C), this.messagesEl.removeEventListener("touchmove", O);
999
+ this.messagesEl.addEventListener("touchstart", C, { passive: !0 }), this.messagesEl.addEventListener("touchmove", U, { passive: !0 }), this._cleanups.push(() => {
1000
+ this.messagesEl.removeEventListener("touchstart", C), this.messagesEl.removeEventListener("touchmove", U);
1001
1001
  }), T.appendChild(this.messagesEl), this._panelFloatingEl = document.createElement("div"), this._panelFloatingEl.className = "gengage-chat-panel-float", this._panelFloatingEl.dataset.gengagePart = "chat-panel-floating-layer", this._panelEl.appendChild(this._panelFloatingEl), this._resetPanelAiZoneElement(), this._pillsEl = document.createElement("div"), this._pillsEl.className = "gengage-chat-pills", this._pillsEl.dataset.gengagePart = "chat-suggestion-pills", this._pillsEl.setAttribute("role", "toolbar"), this._pillsEl.setAttribute("aria-label", this.i18n.suggestionsAriaLabel), this._pillsEl.style.display = "none";
1002
1002
  const N = document.createElement("div");
1003
1003
  N.className = "gengage-chat-pills-scroll", N.dataset.gengagePart = "chat-suggestion-pills-scroll", this._pillsEl.appendChild(N);
@@ -1012,8 +1012,8 @@ var Bn = class {
1012
1012
  const ne = () => {
1013
1013
  D || (D = !0, requestAnimationFrame(() => {
1014
1014
  D = !1;
1015
- const y = N.scrollLeft + N.clientWidth >= N.scrollWidth - 4;
1016
- q.style.display = y ? "none" : "";
1015
+ const w = N.scrollLeft + N.clientWidth >= N.scrollWidth - 4;
1016
+ q.style.display = w ? "none" : "";
1017
1017
  }));
1018
1018
  };
1019
1019
  N.addEventListener("scroll", ne, { passive: !0 }), this._cleanups.push(() => {
@@ -1024,14 +1024,14 @@ var Bn = class {
1024
1024
  this._resizeRafId !== null && cancelAnimationFrame(this._resizeRafId), this._resizeRafId = requestAnimationFrame(() => {
1025
1025
  this._resizeRafId = null, this.inputEl.style.height = "auto", this.inputEl.style.height = `${Math.min(this.inputEl.scrollHeight, 120)}px`;
1026
1026
  }), this._updateSendEnabled();
1027
- }), this.inputEl.addEventListener("keydown", (y) => {
1028
- y.key === "Enter" && !y.isComposing && ((this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || !y.shiftKey) && (y.preventDefault(), this._submit());
1029
- }), this.inputEl.addEventListener("paste", (y) => {
1030
- const Y = y.clipboardData;
1027
+ }), this.inputEl.addEventListener("keydown", (w) => {
1028
+ w.key === "Enter" && !w.isComposing && ((this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || !w.shiftKey) && (w.preventDefault(), this._submit());
1029
+ }), this.inputEl.addEventListener("paste", (w) => {
1030
+ const Y = w.clipboardData;
1031
1031
  if (!Y) return;
1032
1032
  let ce = null;
1033
- const ie = Y.files?.[0];
1034
- if (ie && ie.type.startsWith("image/")) ce = ie;
1033
+ const oe = Y.files?.[0];
1034
+ if (oe && oe.type.startsWith("image/")) ce = oe;
1035
1035
  else if (Y.items?.length) for (let M = 0; M < Y.items.length; M++) {
1036
1036
  const H = Y.items[M];
1037
1037
  if (H?.kind === "file" && H.type.startsWith("image/")) {
@@ -1042,74 +1042,74 @@ var Bn = class {
1042
1042
  }
1043
1043
  }
1044
1044
  }
1045
- ce && (y.preventDefault(), this._routeAttachmentFile(ce));
1045
+ ce && (w.preventDefault(), this._routeAttachmentFile(ce));
1046
1046
  }), this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.accept = "image/jpeg,image/png,image/webp", this._fileInput.style.display = "none", this._fileInput.addEventListener("change", () => {
1047
- const y = this._fileInput.files?.[0];
1048
- y && this._routeAttachmentFile(y), this._fileInput.value = "";
1047
+ const w = this._fileInput.files?.[0];
1048
+ w && this._routeAttachmentFile(w), this._fileInput.value = "";
1049
1049
  });
1050
1050
  const K = document.createElement("div");
1051
1051
  K.className = "gengage-chat-attach-wrap", K.dataset.gengagePart = "chat-attach-wrap", this._attachWrapEl = K;
1052
1052
  const f = document.createElement("button");
1053
- this._attachBtn = f, f.className = "gengage-chat-attach-btn gds-btn gds-btn-ghost", f.dataset.gengagePart = "chat-attach-button", f.type = "button", f.setAttribute("aria-label", this.i18n.attachImageButton), f.setAttribute("aria-haspopup", "menu"), f.setAttribute("aria-expanded", "false"), f.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>', f.addEventListener("click", (y) => {
1054
- y.stopPropagation(), this._toggleAttachMenu();
1053
+ this._attachBtn = f, f.className = "gengage-chat-attach-btn gds-btn gds-btn-ghost", f.dataset.gengagePart = "chat-attach-button", f.type = "button", f.setAttribute("aria-label", this.i18n.attachImageButton), f.setAttribute("aria-haspopup", "menu"), f.setAttribute("aria-expanded", "false"), f.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>', f.addEventListener("click", (w) => {
1054
+ w.stopPropagation(), this._toggleAttachMenu();
1055
1055
  });
1056
1056
  const S = document.createElement("div");
1057
1057
  this._attachMenuEl = S, S.className = "gengage-chat-attach-menu gds-menu", S.dataset.gengagePart = "chat-attach-menu", S.setAttribute("role", "menu"), S.setAttribute("hidden", "");
1058
- const L = document.createElement("button");
1059
- L.type = "button", L.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", L.dataset.gengagePart = "chat-attach-menu-select-photo", L.setAttribute("role", "menuitem"), L.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuSelectPhoto}</span>`, L.addEventListener("click", (y) => {
1060
- y.stopPropagation(), this._closeAttachMenu(), this._fileInput.click();
1058
+ const P = document.createElement("button");
1059
+ P.type = "button", P.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", P.dataset.gengagePart = "chat-attach-menu-select-photo", P.setAttribute("role", "menuitem"), P.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuSelectPhoto}</span>`, P.addEventListener("click", (w) => {
1060
+ w.stopPropagation(), this._closeAttachMenu(), this._fileInput.click();
1061
1061
  });
1062
1062
  const $ = document.createElement("div");
1063
1063
  $.className = "gengage-chat-attach-menu-sep", $.dataset.gengagePart = "chat-attach-menu-separator", $.setAttribute("aria-hidden", "true");
1064
1064
  const I = document.createElement("button");
1065
- I.type = "button", I.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", I.dataset.gengagePart = "chat-attach-menu-paste", I.setAttribute("role", "menuitem"), I.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H9a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/><path d="M16 4h2a2 2 0 0 1 2 2v4"/><path d="M21 14H11"/><path d="m15 10-4 4 4 4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuPaste}</span>`, I.addEventListener("click", (y) => {
1066
- y.stopPropagation();
1065
+ I.type = "button", I.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", I.dataset.gengagePart = "chat-attach-menu-paste", I.setAttribute("role", "menuitem"), I.innerHTML = `<span class="gengage-chat-attach-menu-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H9a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"/><path d="M16 4h2a2 2 0 0 1 2 2v4"/><path d="M21 14H11"/><path d="m15 10-4 4 4 4"/></svg></span><span class="gengage-chat-attach-menu-label">${this.i18n.attachMenuPaste}</span>`, I.addEventListener("click", (w) => {
1066
+ w.stopPropagation();
1067
1067
  const Y = typeof navigator.clipboard?.read == "function" ? navigator.clipboard.read() : void 0;
1068
1068
  this._pasteImageFromClipboardMenu(Y);
1069
- }), S.appendChild(L), S.appendChild($), S.appendChild(I), K.appendChild(f), K.appendChild(S), this._previewStrip = document.createElement("div"), this._previewStrip.className = "gengage-chat-attachment-preview gengage-chat-attachment-preview--hidden gds-card-soft", this._previewStrip.dataset.gengagePart = "chat-attachment-preview";
1069
+ }), S.appendChild(P), S.appendChild($), S.appendChild(I), K.appendChild(f), K.appendChild(S), this._previewStrip = document.createElement("div"), this._previewStrip.className = "gengage-chat-attachment-preview gengage-chat-attachment-preview--hidden gds-card-soft", this._previewStrip.dataset.gengagePart = "chat-attachment-preview";
1070
1070
  const j = document.createElement("img");
1071
1071
  j.className = "gengage-chat-attachment-preview-thumb", j.dataset.gengagePart = "chat-attachment-preview-thumb", j.alt = "", this._previewName = document.createElement("span"), this._previewName.className = "gengage-chat-attachment-name", this._previewName.dataset.gengagePart = "chat-attachment-preview-name";
1072
1072
  const Q = document.createElement("button");
1073
1073
  Q.className = "gengage-chat-attachment-remove gds-btn gds-btn-ghost", Q.dataset.gengagePart = "chat-attachment-preview-remove", Q.type = "button", Q.setAttribute("aria-label", this.i18n.removeAttachmentButton), Q.textContent = "×", Q.addEventListener("click", () => this.clearAttachment()), this._previewStrip.appendChild(j), this._previewStrip.appendChild(this._previewName), this._previewStrip.appendChild(Q), this.sendBtn = document.createElement("button"), this.sendBtn.className = "gengage-chat-send gds-btn gds-btn-primary", this.sendBtn.dataset.gengagePart = "chat-send", this.sendBtn.type = "button", this.sendBtn.disabled = !0, this.sendBtn.setAttribute("aria-label", this.i18n.sendButton), this.sendBtn.dataset.tooltip = this.i18n.sendButton, this._renderSendButtonIcon("send"), this.sendBtn.addEventListener("click", () => {
1074
1074
  if (this._sendStopHandler) {
1075
- const y = this._sendStopHandler;
1076
- this.hideStopButton(), y();
1075
+ const w = this._sendStopHandler;
1076
+ this.hideStopButton(), w();
1077
1077
  return;
1078
1078
  }
1079
1079
  this._submit();
1080
- }), W.addEventListener("dragover", (y) => {
1081
- y.preventDefault(), W.classList.add("gengage-chat-input-area--dragover");
1080
+ }), W.addEventListener("dragover", (w) => {
1081
+ w.preventDefault(), W.classList.add("gengage-chat-input-area--dragover");
1082
1082
  }), W.addEventListener("dragleave", () => {
1083
1083
  W.classList.remove("gengage-chat-input-area--dragover");
1084
- }), W.addEventListener("drop", (y) => {
1085
- y.preventDefault(), W.classList.remove("gengage-chat-input-area--dragover");
1086
- const Y = y.dataTransfer?.files[0];
1084
+ }), W.addEventListener("drop", (w) => {
1085
+ w.preventDefault(), W.classList.remove("gengage-chat-input-area--dragover");
1086
+ const Y = w.dataTransfer?.files[0];
1087
1087
  Y && this._routeAttachmentFile(Y);
1088
1088
  });
1089
1089
  const te = document.createElement("div");
1090
1090
  te.className = "gengage-chat-input-pill gds-input-shell", te.dataset.gengagePart = "chat-input-shell", te.appendChild(K), te.appendChild(this.inputEl), this._voiceEnabled && Xa() && (this._micBtn = document.createElement("button"), this._micBtn.className = "gengage-chat-mic-btn gds-btn gds-btn-ghost", this._micBtn.dataset.gengagePart = "chat-mic-button", this._micBtn.type = "button", this._micBtn.setAttribute("aria-label", this.i18n.voiceButton), this._micBtn.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/></svg>', this._micBtn.addEventListener("click", () => this._toggleVoice()), te.appendChild(this._micBtn), this._voiceInput = new en({
1091
- onInterim: (y) => {
1092
- this._resizeRafId !== null && (cancelAnimationFrame(this._resizeRafId), this._resizeRafId = null), this.inputEl.value = y, this.inputEl.style.height = "auto", this.inputEl.style.height = `${Math.min(this.inputEl.scrollHeight, 120)}px`;
1091
+ onInterim: (w) => {
1092
+ this._resizeRafId !== null && (cancelAnimationFrame(this._resizeRafId), this._resizeRafId = null), this.inputEl.value = w, this.inputEl.style.height = "auto", this.inputEl.style.height = `${Math.min(this.inputEl.scrollHeight, 120)}px`;
1093
1093
  },
1094
- onFinal: (y) => {
1095
- this.inputEl.value = y;
1094
+ onFinal: (w) => {
1095
+ this.inputEl.value = w;
1096
1096
  },
1097
- onAutoSubmit: (y) => {
1098
- this.inputEl.value = y, this._micBtn?.classList.remove("gengage-chat-mic-btn--active"), this._submit();
1097
+ onAutoSubmit: (w) => {
1098
+ this.inputEl.value = w, this._micBtn?.classList.remove("gengage-chat-mic-btn--active"), this._submit();
1099
1099
  },
1100
- onStateChange: (y) => {
1101
- y === "listening" ? this._micBtn?.classList.add("gengage-chat-mic-btn--active") : this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1100
+ onStateChange: (w) => {
1101
+ w === "listening" ? this._micBtn?.classList.add("gengage-chat-mic-btn--active") : this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1102
1102
  },
1103
- onError: (y, Y) => {
1103
+ onError: (w, Y) => {
1104
1104
  this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1105
1105
  }
1106
1106
  }, { lang: this._voiceLang })), te.appendChild(this.sendBtn), W.appendChild(this._previewStrip), W.appendChild(this._fileInput), W.appendChild(te), T.appendChild(W), x.appendChild(T), this._comparisonDockSlotEl = document.createElement("div"), this._comparisonDockSlotEl.className = "gengage-chat-comparison-dock-slot", this._comparisonDockSlotEl.dataset.gengagePart = "comparison-dock-slot", x.appendChild(this._comparisonDockSlotEl), this.root.appendChild(x), this._setupHorizontalSwipe(T);
1107
- const oe = this._createFooterAttribution();
1108
- oe && this.root.appendChild(oe);
1109
- const se = (y) => {
1110
- y.key === "Escape" && e.onClose();
1107
+ const se = this._createFooterAttribution();
1108
+ se && this.root.appendChild(se);
1109
+ const re = (w) => {
1110
+ w.key === "Escape" && e.onClose();
1111
1111
  };
1112
- this.root.addEventListener("keydown", se), this._cleanups.push(() => this.root.removeEventListener("keydown", se)), t.appendChild(this.root);
1112
+ this.root.addEventListener("keydown", re), this._cleanups.push(() => this.root.removeEventListener("keydown", re)), t.appendChild(this.root);
1113
1113
  }
1114
1114
  addMessage(t) {
1115
1115
  const e = this._options.renderMessageUISpec?.(t) ?? null;
@@ -1124,7 +1124,7 @@ var Bn = class {
1124
1124
  if (t.content) {
1125
1125
  const n = document.createElement("div");
1126
1126
  if (n.className = "gengage-chat-bubble-text", n.dataset.gengagePart = "chat-message-text", t.role === "assistant") {
1127
- if (t.renderHint === "photo_analysis" ? (a.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(n, t.photoAnalysis)) : n.innerHTML = be(t.content), this._onLinkClick) {
1127
+ if (t.renderHint === "photo_analysis" ? (a.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(n, t.photoAnalysis)) : n.innerHTML = ve(t.content), this._onLinkClick) {
1128
1128
  const r = n.querySelectorAll("a[href]");
1129
1129
  for (const i of r) i.addEventListener("click", (o) => {
1130
1130
  o.preventDefault();
@@ -1144,7 +1144,7 @@ var Bn = class {
1144
1144
  this.messagesEl.appendChild(a), this._presentationFocusThreadId && this._applyPresentationCollapsed(), this._scrollToBottom(t.role === "user");
1145
1145
  }
1146
1146
  removeMessageBubble(t) {
1147
- this._firstBotMessageIds.delete(t), this.messagesEl.querySelector(`[data-message-id="${he(t)}"]`)?.remove(), this._presentationFocusThreadId && this._applyPresentationCollapsed();
1147
+ this._firstBotMessageIds.delete(t), this.messagesEl.querySelector(`[data-message-id="${ue(t)}"]`)?.remove(), this._presentationFocusThreadId && this._applyPresentationCollapsed();
1148
1148
  }
1149
1149
  showTypingIndicator(t, e = "auto") {
1150
1150
  this.removeTypingIndicator();
@@ -1451,8 +1451,8 @@ var Bn = class {
1451
1451
  const d = document.createElement("div");
1452
1452
  d.className = "gengage-chat-comparison-recommended-info";
1453
1453
  for (let k = 0; k < 2; k++) {
1454
- const P = document.createElement("div");
1455
- P.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-title", k === 1 && P.classList.add("gengage-chat-comparison-skeleton-rec-title--short"), d.appendChild(P);
1454
+ const L = document.createElement("div");
1455
+ L.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-title", k === 1 && L.classList.add("gengage-chat-comparison-skeleton-rec-title--short"), d.appendChild(L);
1456
1456
  }
1457
1457
  const p = document.createElement("div");
1458
1458
  p.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-price", d.appendChild(p), c.appendChild(l), c.appendChild(d), o.appendChild(c);
@@ -1463,8 +1463,8 @@ var Bn = class {
1463
1463
  const x = document.createElement("ul");
1464
1464
  x.className = "gengage-chat-comparison-skeleton-hl-list";
1465
1465
  for (let k = 0; k < 3; k++) {
1466
- const P = document.createElement("li"), z = document.createElement("div");
1467
- z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", k === 1 && z.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), k === 2 && z.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), P.appendChild(z), x.appendChild(P);
1466
+ const L = document.createElement("li"), z = document.createElement("div");
1467
+ z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", k === 1 && z.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), k === 2 && z.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), L.appendChild(z), x.appendChild(L);
1468
1468
  }
1469
1469
  h.appendChild(x), o.appendChild(h), i.appendChild(o);
1470
1470
  const v = document.createElement("div");
@@ -1474,14 +1474,14 @@ var Bn = class {
1474
1474
  const g = document.createElement("div");
1475
1475
  g.className = "gengage-chat-comparison-key-differences-content";
1476
1476
  for (let k = 0; k < 4; k++) {
1477
- const P = document.createElement("div");
1478
- P.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-line", g.appendChild(P);
1477
+ const L = document.createElement("div");
1478
+ L.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-line", g.appendChild(L);
1479
1479
  }
1480
1480
  v.appendChild(g), i.appendChild(v);
1481
1481
  const _ = document.createElement("div");
1482
1482
  _.className = "gengage-chat-comparison-special gengage-chat-comparison-special--skeleton";
1483
- const w = document.createElement("div");
1484
- w.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-special-line", _.appendChild(w), i.appendChild(_);
1483
+ const y = document.createElement("div");
1484
+ y.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-special-line", _.appendChild(y), i.appendChild(_);
1485
1485
  const b = document.createElement("div");
1486
1486
  b.className = "gengage-chat-comparison-skeleton-table-wrap";
1487
1487
  const A = document.createElement("div");
@@ -1489,26 +1489,26 @@ var Bn = class {
1489
1489
  const T = document.createElement("div");
1490
1490
  T.className = "gengage-chat-comparison-skeleton-table-corner", A.appendChild(T);
1491
1491
  for (let k = 0; k < 3; k++) {
1492
- const P = document.createElement("div");
1493
- P.className = "gengage-chat-comparison-skeleton-table-col";
1492
+ const L = document.createElement("div");
1493
+ L.className = "gengage-chat-comparison-skeleton-table-col";
1494
1494
  const z = document.createElement("div");
1495
1495
  z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1496
- const U = document.createElement("div");
1497
- U.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1496
+ const O = document.createElement("div");
1497
+ O.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1498
1498
  const X = document.createElement("div");
1499
- X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", P.appendChild(z), P.appendChild(U), P.appendChild(X), A.appendChild(P);
1499
+ X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", L.appendChild(z), L.appendChild(O), L.appendChild(X), A.appendChild(L);
1500
1500
  }
1501
1501
  b.appendChild(A);
1502
1502
  for (let k = 0; k < 3; k++) {
1503
- const P = document.createElement("div");
1504
- P.className = "gengage-chat-comparison-skeleton-table-row";
1503
+ const L = document.createElement("div");
1504
+ L.className = "gengage-chat-comparison-skeleton-table-row";
1505
1505
  const z = document.createElement("div");
1506
- z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", P.appendChild(z);
1507
- for (let U = 0; U < 3; U++) {
1506
+ z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", L.appendChild(z);
1507
+ for (let O = 0; O < 3; O++) {
1508
1508
  const X = document.createElement("div");
1509
- X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", P.appendChild(X);
1509
+ X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", L.appendChild(X);
1510
1510
  }
1511
- b.appendChild(P);
1511
+ b.appendChild(L);
1512
1512
  }
1513
1513
  i.appendChild(b), e.appendChild(i);
1514
1514
  break;
@@ -1694,14 +1694,14 @@ var Bn = class {
1694
1694
  this._scrollToBottom(!1);
1695
1695
  }
1696
1696
  updateBotMessage(t, e, a, n) {
1697
- const r = this.messagesEl.querySelector(`[data-message-id="${he(t)}"]`);
1697
+ const r = this.messagesEl.querySelector(`[data-message-id="${ue(t)}"]`);
1698
1698
  if (!r) return;
1699
1699
  let i = r.querySelector(".gengage-chat-bubble-text");
1700
- i || (i = document.createElement("div"), i.className = "gengage-chat-bubble-text", r.appendChild(i)), a === "photo_analysis" ? (r.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(i, n)) : (r.classList.remove("gengage-chat-bubble--photo-analysis"), i.innerHTML = be(e)), this._scrollToBottom(!1);
1700
+ i || (i = document.createElement("div"), i.className = "gengage-chat-bubble-text", r.appendChild(i)), a === "photo_analysis" ? (r.classList.add("gengage-chat-bubble--photo-analysis"), this._renderPhotoAnalysisCard(i, n)) : (r.classList.remove("gengage-chat-bubble--photo-analysis"), i.innerHTML = ve(e)), this._scrollToBottom(!1);
1701
1701
  }
1702
1702
  markFirstBotMessage(t) {
1703
1703
  this._firstBotMessageIds.add(t);
1704
- const e = this.messagesEl.querySelector(`[data-message-id="${he(t)}"]`);
1704
+ const e = this.messagesEl.querySelector(`[data-message-id="${ue(t)}"]`);
1705
1705
  e && e.classList.add("gengage-chat-bubble--first");
1706
1706
  }
1707
1707
  scrollToLastThread() {
@@ -1716,7 +1716,7 @@ var Bn = class {
1716
1716
  return;
1717
1717
  }
1718
1718
  this._programmaticScrollUntil = Date.now() + 700;
1719
- const a = this.messagesEl.querySelector(`[data-thread-id="${he(e)}"]`);
1719
+ const a = this.messagesEl.querySelector(`[data-thread-id="${ue(e)}"]`);
1720
1720
  a ? requestAnimationFrame(() => {
1721
1721
  a.scrollIntoView({
1722
1722
  block: "start",
@@ -1725,7 +1725,7 @@ var Bn = class {
1725
1725
  }) : this._scrollToBottom(!0);
1726
1726
  }
1727
1727
  scrollThreadIntoView(t, e = "smooth") {
1728
- const a = this.messagesEl.querySelectorAll(`[data-thread-id="${he(t)}"]`), n = this.messagesEl.ownerDocument.defaultView?.HTMLElement;
1728
+ const a = this.messagesEl.querySelectorAll(`[data-thread-id="${ue(t)}"]`), n = this.messagesEl.ownerDocument.defaultView?.HTMLElement;
1729
1729
  if (!n) return !1;
1730
1730
  let r = null, i = null;
1731
1731
  for (let c = 0; c < a.length; c++) {
@@ -1850,7 +1850,7 @@ function oa(t) {
1850
1850
  function Rn(t) {
1851
1851
  return typeof t == "string" ? oa(t) : null;
1852
1852
  }
1853
- function ue(t) {
1853
+ function me(t) {
1854
1854
  return t == null || typeof t != "object" || Array.isArray(t) ? null : t;
1855
1855
  }
1856
1856
  function Hn(...t) {
@@ -1860,7 +1860,7 @@ function Hn(...t) {
1860
1860
  }
1861
1861
  }
1862
1862
  function Fn(t) {
1863
- const e = ue(t);
1863
+ const e = me(t);
1864
1864
  if (!e) return null;
1865
1865
  const a = Hn(e.assistant_mode, e.assistantMode);
1866
1866
  if (!a) return null;
@@ -1870,7 +1870,7 @@ function Fn(t) {
1870
1870
  function Dn(t) {
1871
1871
  return t === "beauty_consulting" ? "user_message" : "findSimilar";
1872
1872
  }
1873
- var On = class {
1873
+ var Un = class {
1874
1874
  constructor() {
1875
1875
  this._mode = "shopping", this._uiHints = null;
1876
1876
  }
@@ -1919,7 +1919,7 @@ var On = class {
1919
1919
  const a = Rn(e);
1920
1920
  a ? this._mode = a : ze("mode", "ignoring unrecognised assistant_mode from context", e);
1921
1921
  } else e === null && (this._mode = "shopping");
1922
- this._uiHints = ue(t.ui_hints) ?? null;
1922
+ this._uiHints = me(t.ui_hints) ?? null;
1923
1923
  }
1924
1924
  reset() {
1925
1925
  const t = this._mode !== "shopping";
@@ -1932,7 +1932,7 @@ var On = class {
1932
1932
  return this._mode !== "shopping";
1933
1933
  }
1934
1934
  };
1935
- function Un() {
1935
+ function On() {
1936
1936
  return {
1937
1937
  streamIncludedBeautyPhotoStep: !1,
1938
1938
  pendingPhotoStepSkip: !1
@@ -2002,7 +2002,7 @@ function Wn(t, e, a) {
2002
2002
  }
2003
2003
  function Kn(t, e) {
2004
2004
  try {
2005
- return t.toLocaleUpperCase(Ue(e));
2005
+ return t.toLocaleUpperCase(Oe(e));
2006
2006
  } catch {
2007
2007
  return t.toLocaleUpperCase("tr");
2008
2008
  }
@@ -2053,7 +2053,7 @@ function Xn(t) {
2053
2053
  }
2054
2054
  if (v.childElementCount > 0 && m.appendChild(v), t.recommendedText) {
2055
2055
  const g = document.createElement("p");
2056
- g.className = "gengage-chat-comparison-recommended-text", g.innerHTML = be(t.recommendedText), m.appendChild(g);
2056
+ g.className = "gengage-chat-comparison-recommended-text", g.innerHTML = ve(t.recommendedText), m.appendChild(g);
2057
2057
  }
2058
2058
  p.appendChild(m);
2059
2059
  const u = () => {
@@ -2069,12 +2069,12 @@ function Xn(t) {
2069
2069
  g.className = "gengage-chat-comparison-highlights", g.dataset.gengagePart = "comparison-highlights";
2070
2070
  const _ = document.createElement("div");
2071
2071
  _.className = "gengage-chat-comparison-highlights-label", _.textContent = s?.highlightsLabel ?? "Key Highlights", g.appendChild(_);
2072
- const w = document.createElement("ul");
2072
+ const y = document.createElement("ul");
2073
2073
  for (const b of r) {
2074
2074
  const A = document.createElement("li");
2075
- A.textContent = b, w.appendChild(A);
2075
+ A.textContent = b, y.appendChild(A);
2076
2076
  }
2077
- g.appendChild(w), l.appendChild(g);
2077
+ g.appendChild(y), l.appendChild(g);
2078
2078
  }
2079
2079
  c.appendChild(l);
2080
2080
  }
@@ -2088,7 +2088,7 @@ function Xn(t) {
2088
2088
  const h = document.createElement("span");
2089
2089
  h.className = "gengage-chat-comparison-key-differences-summary-meta", h.textContent = s?.viewMoreLabel ?? "Show More", d.appendChild(p), d.appendChild(h), l.appendChild(d);
2090
2090
  const m = document.createElement("div");
2091
- m.className = "gengage-chat-comparison-key-differences-content", m.innerHTML = be(Qn(t.keyDifferencesHtml)), l.appendChild(m), c.appendChild(l);
2091
+ m.className = "gengage-chat-comparison-key-differences-content", m.innerHTML = ve(Qn(t.keyDifferencesHtml)), l.appendChild(m), c.appendChild(l);
2092
2092
  }
2093
2093
  if (i && i.length > 0) {
2094
2094
  const l = document.createElement("details");
@@ -2126,8 +2126,8 @@ function Xn(t) {
2126
2126
  const b = document.createElement("div");
2127
2127
  b.className = "gengage-chat-comparison-table-header-img-placeholder", b.setAttribute("aria-hidden", "true"), g.appendChild(b);
2128
2128
  }
2129
- const w = document.createElement("div");
2130
- if (w.className = "gengage-chat-comparison-table-product-name", w.textContent = v.name, g.appendChild(w), Tt(v.price)) {
2129
+ const y = document.createElement("div");
2130
+ if (y.className = "gengage-chat-comparison-table-product-name", y.textContent = v.name, g.appendChild(y), Tt(v.price)) {
2131
2131
  const b = document.createElement("div");
2132
2132
  b.className = "gengage-chat-comparison-table-price", b.textContent = ae(v.price, t.pricing), g.appendChild(b);
2133
2133
  }
@@ -2139,10 +2139,10 @@ function Xn(t) {
2139
2139
  const u = document.createElement("tr"), g = document.createElement("td");
2140
2140
  g.className = "gengage-chat-comparison-label", g.textContent = Wn(v.label, s?.criteriaLabels, t.locale), u.appendChild(g);
2141
2141
  for (let _ = 0; _ < v.values.length; _++) {
2142
- const w = document.createElement("td");
2143
- a[_]?.sku === e?.sku && (w.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
2142
+ const y = document.createElement("td");
2143
+ a[_]?.sku === e?.sku && (y.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
2144
2144
  const b = v.values[_] ?? "";
2145
- sa(b) ? w.innerHTML = be(b) : w.textContent = b, u.appendChild(w);
2145
+ sa(b) ? y.innerHTML = ve(b) : y.textContent = b, u.appendChild(y);
2146
2146
  }
2147
2147
  m.appendChild(u);
2148
2148
  }
@@ -2165,7 +2165,7 @@ function Qn(t) {
2165
2165
  return e.length <= 1 ? t : "<ul>" + e.map((a) => `<li>${a.trim()}</li>`).join("") + "</ul>";
2166
2166
  }
2167
2167
  function Jn(t, e) {
2168
- const a = be(e);
2168
+ const a = ve(e);
2169
2169
  if (!a) return;
2170
2170
  const n = document.createElement("template");
2171
2171
  n.innerHTML = a;
@@ -2173,7 +2173,7 @@ function Jn(t, e) {
2173
2173
  if (r.length > 0) {
2174
2174
  for (const o of r) {
2175
2175
  const s = document.createElement("li");
2176
- s.innerHTML = be(o.innerHTML), t.appendChild(s);
2176
+ s.innerHTML = ve(o.innerHTML), t.appendChild(s);
2177
2177
  }
2178
2178
  return;
2179
2179
  }
@@ -2226,12 +2226,12 @@ function sr(t, e) {
2226
2226
  const r = n.filter((v) => v !== null && typeof v == "object"), i = /* @__PURE__ */ new Map();
2227
2227
  for (const v of r) {
2228
2228
  const u = ar(v.review_class), g = nr(v.review_text), _ = tr(v.review_tag);
2229
- for (const w of _) {
2230
- const b = w.toLocaleLowerCase();
2229
+ for (const y of _) {
2230
+ const b = y.toLocaleLowerCase();
2231
2231
  let A = i.get(b);
2232
2232
  if (A || (A = {
2233
2233
  key: b,
2234
- label: w,
2234
+ label: y,
2235
2235
  mentions: 0,
2236
2236
  positive: 0,
2237
2237
  negative: 0,
@@ -2261,29 +2261,29 @@ function sr(t, e) {
2261
2261
  const m = () => {
2262
2262
  for (; h.firstChild; ) h.removeChild(h.firstChild);
2263
2263
  if (!d) return;
2264
- const v = o.find((w) => w.key === d);
2264
+ const v = o.find((y) => y.key === d);
2265
2265
  if (!v) return;
2266
2266
  const u = document.createElement("div");
2267
2267
  u.className = "gengage-chat-review-detail-meta";
2268
2268
  const g = document.createElement("span");
2269
2269
  if (g.className = "gengage-chat-review-detail-mentions", g.textContent = `${or(v.mentions, e?.reviewCustomersMentionSingular, e?.reviewCustomersMentionPlural)} "${v.label}"`, u.appendChild(g), v.positive > 0) {
2270
- const w = document.createElement("span");
2271
- w.className = "gengage-chat-review-detail-positive", w.textContent = `${v.positive} ${s}`, u.appendChild(w);
2270
+ const y = document.createElement("span");
2271
+ y.className = "gengage-chat-review-detail-positive", y.textContent = `${v.positive} ${s}`, u.appendChild(y);
2272
2272
  }
2273
2273
  if (v.negative > 0) {
2274
- const w = document.createElement("span");
2275
- w.className = "gengage-chat-review-detail-negative", w.textContent = `${v.negative} ${c}`, u.appendChild(w);
2274
+ const y = document.createElement("span");
2275
+ y.className = "gengage-chat-review-detail-negative", y.textContent = `${v.negative} ${c}`, u.appendChild(y);
2276
2276
  }
2277
2277
  h.appendChild(u);
2278
2278
  const _ = document.createElement("div");
2279
2279
  _.className = "gengage-chat-review-snippets";
2280
- for (const w of v.snippets) {
2280
+ for (const y of v.snippets) {
2281
2281
  const b = document.createElement("article");
2282
- b.className = "gengage-chat-review-snippet", b.dataset.tone = w.tone;
2282
+ b.className = "gengage-chat-review-snippet", b.dataset.tone = y.tone;
2283
2283
  const A = document.createElement("div");
2284
- if (A.className = "gengage-chat-review-snippet-text", A.textContent = `"${w.text}"`, b.appendChild(A), w.rating !== void 0 && String(w.rating).length > 0) {
2284
+ if (A.className = "gengage-chat-review-snippet-text", A.textContent = `"${y.text}"`, b.appendChild(A), y.rating !== void 0 && String(y.rating).length > 0) {
2285
2285
  const T = document.createElement("div");
2286
- T.className = "gengage-chat-review-snippet-rating", T.textContent = `★ ${String(w.rating)}`, b.appendChild(T);
2286
+ T.className = "gengage-chat-review-snippet-rating", T.textContent = `★ ${String(y.rating)}`, b.appendChild(T);
2287
2287
  }
2288
2288
  _.appendChild(b);
2289
2289
  }
@@ -2299,8 +2299,8 @@ function sr(t, e) {
2299
2299
  g.type = "button", g.className = "gengage-chat-review-subject gds-chip", g.dataset.subjectKey = v.key, g.dataset.tone = u;
2300
2300
  const _ = document.createElement("span");
2301
2301
  _.className = "gengage-chat-review-subject-icon", _.appendChild(ir(u)), g.appendChild(_);
2302
- const w = document.createElement("span");
2303
- w.className = "gengage-chat-review-subject-label", w.textContent = v.label, g.appendChild(w);
2302
+ const y = document.createElement("span");
2303
+ y.className = "gengage-chat-review-subject-label", y.textContent = v.label, g.appendChild(y);
2304
2304
  const b = document.createElement("span");
2305
2305
  b.className = "gengage-chat-review-subject-count", b.textContent = `(${v.mentions})`, g.appendChild(b), g.addEventListener("click", () => {
2306
2306
  d = v.key, x(), m();
@@ -2494,11 +2494,11 @@ function Mt(t, e, a, n) {
2494
2494
  const o = t.product, s = ca(t), c = o.url ?? "", l = o.cartCode, d = o.inStock, p = !!(s && l && d !== !1), h = t.action;
2495
2495
  s && e.onProductClick ? (r.classList.add("gds-clickable"), r.addEventListener("click", (k) => {
2496
2496
  if (k.target.closest(".gengage-chat-ai-toppick-cta") || k.target.closest(".gengage-chat-favorite-btn") || k.target.closest(".gengage-chat-find-similar-pill")) return;
2497
- const P = o.name;
2497
+ const L = o.name;
2498
2498
  e.onProductClick?.({
2499
2499
  sku: s,
2500
2500
  url: c,
2501
- ...P ? { name: P } : {}
2501
+ ...L ? { name: L } : {}
2502
2502
  });
2503
2503
  })) : h && (r.classList.add("gds-clickable"), r.addEventListener("click", (k) => {
2504
2504
  k.target.closest(".gengage-chat-ai-toppick-cta") || k.target.closest(".gengage-chat-favorite-btn") || k.target.closest(".gengage-chat-find-similar-pill") || e.onAction(h);
@@ -2520,15 +2520,15 @@ function Mt(t, e, a, n) {
2520
2520
  const k = document.createElement("div");
2521
2521
  k.className = "gengage-chat-ai-toppick-name", k.dataset.gengagePart = "ai-top-pick-name", k.textContent = _, g.appendChild(k);
2522
2522
  }
2523
- const w = dr(o);
2524
- w && g.appendChild(w), hr(o, g, e), t.labels && t.labels.length > 0 && g.appendChild(fr(t.labels)), u.appendChild(g), r.appendChild(u);
2523
+ const y = dr(o);
2524
+ y && g.appendChild(y), hr(o, g, e), t.labels && t.labels.length > 0 && g.appendChild(fr(t.labels)), u.appendChild(g), r.appendChild(u);
2525
2525
  const b = document.createElement("div");
2526
2526
  if (b.className = "gengage-chat-ai-toppick-detail", b.dataset.gengagePart = "ai-top-pick-detail", a) ur(t, b, e);
2527
2527
  else {
2528
2528
  const k = typeof t.reason == "string" ? t.reason.trim() : "";
2529
2529
  if (k) {
2530
- const P = document.createElement("p");
2531
- P.className = "gengage-chat-ai-toppick-snippet", P.dataset.gengagePart = "ai-top-pick-snippet", P.textContent = k, b.appendChild(P);
2530
+ const L = document.createElement("p");
2531
+ L.className = "gengage-chat-ai-toppick-snippet", L.dataset.gengagePart = "ai-top-pick-snippet", L.textContent = k, b.appendChild(L);
2532
2532
  }
2533
2533
  }
2534
2534
  b.childNodes.length > 0 && r.appendChild(b);
@@ -2536,8 +2536,8 @@ function Mt(t, e, a, n) {
2536
2536
  if (A || p || h) {
2537
2537
  const k = document.createElement("div");
2538
2538
  if (k.className = "gengage-chat-ai-toppick-spinner", k.dataset.gengagePart = "ai-top-pick-spinner", k.style.display = A ? "" : "none", r.appendChild(k), T) {
2539
- const P = document.createElement("button");
2540
- P.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", P.dataset.gengagePart = "ai-top-pick-cta", P.type = "button", P.textContent = p ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", P.addEventListener("click", (z) => {
2539
+ const L = document.createElement("button");
2540
+ L.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", L.dataset.gengagePart = "ai-top-pick-cta", L.type = "button", L.textContent = p ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", L.addEventListener("click", (z) => {
2541
2541
  if (z.stopPropagation(), p) {
2542
2542
  e.onAction({
2543
2543
  title: e.i18n?.addToCartButton ?? "Add to Cart",
@@ -2552,17 +2552,17 @@ function Mt(t, e, a, n) {
2552
2552
  }
2553
2553
  if (h) {
2554
2554
  if (h.type === "findSimilar" && s && e.onProductClick) {
2555
- const U = o.name;
2555
+ const O = o.name;
2556
2556
  e.onProductClick({
2557
2557
  sku: s,
2558
2558
  url: c,
2559
- ...U ? { name: U } : {}
2559
+ ...O ? { name: O } : {}
2560
2560
  });
2561
2561
  return;
2562
2562
  }
2563
2563
  e.onAction(h);
2564
2564
  }
2565
- }), r.appendChild(P);
2565
+ }), r.appendChild(L);
2566
2566
  }
2567
2567
  }
2568
2568
  return r;
@@ -2834,13 +2834,13 @@ function Tr(t, e) {
2834
2834
  for (let d = 0; d < a.length; d++) {
2835
2835
  const p = a[d], h = `${r}-tab-${d}`, m = `${r}-panel-${d}`, x = document.createElement("button");
2836
2836
  if (x.className = "gengage-chat-categories-tab gds-tab", x.type = "button", x.dataset.gengagePart = "categories-tab", x.id = h, x.setAttribute("role", "tab"), x.setAttribute("aria-controls", m), x.setAttribute("aria-selected", String(d === 0)), x.tabIndex = d === 0 ? 0 : -1, d === 0 && x.classList.add("gengage-chat-categories-tab--active", "is-active"), p.image && Ce(p.image)) {
2837
- const w = document.createElement("img");
2838
- w.className = "gengage-chat-categories-tab-image", w.draggable = !1, w.src = p.image, w.alt = p.groupName, w.loading = "lazy", xe(w), x.appendChild(w);
2837
+ const y = document.createElement("img");
2838
+ y.className = "gengage-chat-categories-tab-image", y.draggable = !1, y.src = p.image, y.alt = p.groupName, y.loading = "lazy", xe(y), x.appendChild(y);
2839
2839
  }
2840
2840
  const v = document.createElement("span");
2841
- v.className = "gengage-chat-categories-tab-text", v.textContent = p.groupName, x.appendChild(v), x.addEventListener("click", () => l(d)), x.addEventListener("keydown", (w) => {
2841
+ v.className = "gengage-chat-categories-tab-text", v.textContent = p.groupName, x.appendChild(v), x.addEventListener("click", () => l(d)), x.addEventListener("keydown", (y) => {
2842
2842
  let b = -1;
2843
- w.key === "ArrowRight" || w.key === "ArrowDown" ? b = (d + 1) % a.length : w.key === "ArrowLeft" || w.key === "ArrowUp" ? b = (d - 1 + a.length) % a.length : w.key === "Home" ? b = 0 : w.key === "End" && (b = a.length - 1), b >= 0 && (w.preventDefault(), l(b), s[b].focus());
2843
+ y.key === "ArrowRight" || y.key === "ArrowDown" ? b = (d + 1) % a.length : y.key === "ArrowLeft" || y.key === "ArrowUp" ? b = (d - 1 + a.length) % a.length : y.key === "Home" ? b = 0 : y.key === "End" && (b = a.length - 1), b >= 0 && (y.preventDefault(), l(b), s[b].focus());
2844
2844
  }), s.push(x), o.appendChild(x);
2845
2845
  const u = document.createElement("div");
2846
2846
  u.className = "gengage-chat-categories-panel", u.dataset.gengagePart = "categories-panel", u.id = m, u.setAttribute("role", "tabpanel"), u.setAttribute("aria-labelledby", h), d !== 0 && (u.style.display = "none");
@@ -2848,8 +2848,8 @@ function Tr(t, e) {
2848
2848
  g && u.appendChild(g);
2849
2849
  const _ = document.createElement("div");
2850
2850
  _.className = "gengage-chat-categories-grid", _.dataset.gengagePart = "categories-grid";
2851
- for (const w of p.products) {
2852
- const b = Ar(w, e);
2851
+ for (const y of p.products) {
2852
+ const b = Ar(y, e);
2853
2853
  _.appendChild(b);
2854
2854
  }
2855
2855
  u.appendChild(_), c.push(u);
@@ -2947,9 +2947,9 @@ function Br(t, e) {
2947
2947
  const g = document.createElement("div");
2948
2948
  g.className = "gengage-chat-panel-restore-card__thumb";
2949
2949
  const _ = u.imageUrl;
2950
- if (_ && ve(_)) {
2951
- const w = document.createElement("img");
2952
- w.loading = "lazy", w.alt = u.name || r, de(w, "src", _), xe(w), g.appendChild(w);
2950
+ if (_ && he(_)) {
2951
+ const y = document.createElement("img");
2952
+ y.loading = "lazy", y.alt = u.name || r, de(y, "src", _), xe(y), g.appendChild(y);
2953
2953
  }
2954
2954
  v.appendChild(g);
2955
2955
  }
@@ -2969,7 +2969,7 @@ function zr(t, e) {
2969
2969
  g.target.closest("a") || e.onProductSelect?.(a);
2970
2970
  });
2971
2971
  const r = a.imageUrl;
2972
- if (r && ve(r)) {
2972
+ if (r && he(r)) {
2973
2973
  const g = document.createElement("div");
2974
2974
  g.className = "gengage-chat-product-summary__image", g.dataset.gengagePart = "product-summary-image";
2975
2975
  const _ = document.createElement("img");
@@ -2995,40 +2995,40 @@ function zr(t, e) {
2995
2995
  }
2996
2996
  const d = a.price, p = a.originalPrice;
2997
2997
  if (d) {
2998
- const g = He(e, a), _ = $e(e, a), w = !!(p && p !== d), b = document.createElement("div");
2998
+ const g = He(e, a), _ = $e(e, a), y = !!(p && p !== d), b = document.createElement("div");
2999
2999
  b.className = "gengage-chat-product-summary__price", b.dataset.gengagePart = "product-summary-price";
3000
- const A = !!(g && w), T = Je(e, a);
3000
+ const A = !!(g && y), T = Je(e, a);
3001
3001
  if (A) {
3002
3002
  const k = et({
3003
3003
  reasonText: g,
3004
3004
  salePriceFormatted: ae(d, e.pricing),
3005
3005
  ...T !== void 0 ? { logoUrl: T } : {}
3006
3006
  });
3007
- if (w && _ === "inline") {
3007
+ if (y && _ === "inline") {
3008
3008
  b.classList.add("gengage-chat-product-summary__price--inline"), b.appendChild(k);
3009
- const P = document.createElement("span");
3010
- P.className = "gengage-chat-product-summary__price-sep", P.setAttribute("aria-hidden", "true");
3009
+ const L = document.createElement("span");
3010
+ L.className = "gengage-chat-product-summary__price-sep", L.setAttribute("aria-hidden", "true");
3011
3011
  const z = document.createElement("span");
3012
- z.className = "gengage-chat-product-summary__price-original", z.textContent = ae(p, e.pricing), b.appendChild(P), b.appendChild(z);
3012
+ z.className = "gengage-chat-product-summary__price-original", z.textContent = ae(p, e.pricing), b.appendChild(L), b.appendChild(z);
3013
3013
  } else {
3014
- const P = document.createElement("span");
3015
- P.className = "gengage-chat-product-summary__price-original", P.textContent = ae(p, e.pricing), b.appendChild(P), b.appendChild(document.createTextNode(" ")), b.appendChild(k);
3014
+ const L = document.createElement("span");
3015
+ L.className = "gengage-chat-product-summary__price-original", L.textContent = ae(p, e.pricing), b.appendChild(L), b.appendChild(document.createTextNode(" ")), b.appendChild(k);
3016
3016
  }
3017
3017
  i.appendChild(b);
3018
3018
  } else {
3019
- if (w && _ === "inline") {
3019
+ if (y && _ === "inline") {
3020
3020
  b.classList.add("gengage-chat-product-summary__price--inline");
3021
3021
  const k = document.createElement("span");
3022
3022
  k.className = "gengage-chat-product-summary__price-current", k.textContent = ae(d, e.pricing);
3023
- const P = document.createElement("span");
3024
- P.className = "gengage-chat-product-summary__price-sep", P.setAttribute("aria-hidden", "true");
3023
+ const L = document.createElement("span");
3024
+ L.className = "gengage-chat-product-summary__price-sep", L.setAttribute("aria-hidden", "true");
3025
3025
  const z = document.createElement("span");
3026
- z.className = "gengage-chat-product-summary__price-original", z.textContent = ae(p, e.pricing), b.appendChild(k), b.appendChild(P), b.appendChild(z);
3027
- } else if (w) {
3026
+ z.className = "gengage-chat-product-summary__price-original", z.textContent = ae(p, e.pricing), b.appendChild(k), b.appendChild(L), b.appendChild(z);
3027
+ } else if (y) {
3028
3028
  const k = document.createElement("span");
3029
3029
  k.className = "gengage-chat-product-summary__price-original", k.textContent = ae(p, e.pricing), b.appendChild(k), b.appendChild(document.createTextNode(" "));
3030
- const P = document.createElement("span");
3031
- P.className = "gengage-chat-product-summary__price-current", P.textContent = ae(d, e.pricing), b.appendChild(P);
3030
+ const L = document.createElement("span");
3031
+ L.className = "gengage-chat-product-summary__price-current", L.textContent = ae(d, e.pricing), b.appendChild(L);
3032
3032
  } else {
3033
3033
  const k = document.createElement("span");
3034
3034
  k.className = "gengage-chat-product-summary__price-current", k.textContent = ae(d, e.pricing), b.appendChild(k);
@@ -3054,7 +3054,7 @@ function zr(t, e) {
3054
3054
  }
3055
3055
  });
3056
3056
  }), n.appendChild(g);
3057
- } else if (h && ve(h)) {
3057
+ } else if (h && he(h)) {
3058
3058
  const g = document.createElement("a");
3059
3059
  g.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", g.dataset.gengagePart = "product-summary-cta", de(g, "href", h), de(g, "target", "_blank"), de(g, "rel", "noopener noreferrer"), g.textContent = e.i18n?.productCtaLabel ?? "View", n.appendChild(g);
3060
3060
  }
@@ -3069,7 +3069,7 @@ function Ve() {
3069
3069
  }
3070
3070
  var ga = {
3071
3071
  ActionButtons: ({ element: t, context: e }) => Dr(t, e),
3072
- ActionButton: ({ element: t, context: e }) => Or(t, e),
3072
+ ActionButton: ({ element: t, context: e }) => Ur(t, e),
3073
3073
  InlineQuestionButtons: ({ element: t, context: e }) => wr(t, e),
3074
3074
  ProductCard: ({ element: t, context: e }) => pt(t, e),
3075
3075
  ProductDetailsPanel: ({ element: t, context: e }) => si(t, e),
@@ -3125,7 +3125,7 @@ function Dr(t, e) {
3125
3125
  }
3126
3126
  return a;
3127
3127
  }
3128
- function Or(t, e) {
3128
+ function Ur(t, e) {
3129
3129
  const a = document.createElement("button");
3130
3130
  a.className = "gengage-chat-action-btn";
3131
3131
  const n = t.props?.label;
@@ -3231,7 +3231,7 @@ function pt(t, e) {
3231
3231
  if (!n) return a;
3232
3232
  const r = n.sku;
3233
3233
  r && (a.dataset.sku = r);
3234
- const i = t.props?.action, o = n.name, s = n.url, c = n.sku, l = s && ve(s) ? s : void 0, d = () => i?.type !== "launchSingleProduct" || l === void 0 || c === void 0 || e.onProductClick === void 0 ? !1 : (e.onProductClick({
3234
+ const i = t.props?.action, o = n.name, s = n.url, c = n.sku, l = s && he(s) ? s : void 0, d = () => i?.type !== "launchSingleProduct" || l === void 0 || c === void 0 || e.onProductClick === void 0 ? !1 : (e.onProductClick({
3235
3235
  sku: c,
3236
3236
  url: l,
3237
3237
  ...typeof o == "string" ? { name: o } : {}
@@ -3246,13 +3246,13 @@ function pt(t, e) {
3246
3246
  }
3247
3247
  }));
3248
3248
  const p = n.imageUrl;
3249
- if (p && ve(p)) {
3249
+ if (p && he(p)) {
3250
3250
  const C = document.createElement("div");
3251
3251
  C.className = "gengage-chat-product-card-img-wrapper";
3252
- const O = document.createElement("img");
3253
- O.className = "gengage-chat-product-card-img", O.loading = "lazy", de(O, "src", p);
3252
+ const U = document.createElement("img");
3253
+ U.className = "gengage-chat-product-card-img", U.loading = "lazy", de(U, "src", p);
3254
3254
  const N = n.name;
3255
- N && (O.alt = N), xe(O), C.appendChild(O);
3255
+ N && (U.alt = N), xe(U), C.appendChild(U);
3256
3256
  const q = n.discountPercent;
3257
3257
  if (!e.hideProductDiscountBadge && typeof q == "number" && q > 0) {
3258
3258
  const f = document.createElement("span");
@@ -3265,8 +3265,8 @@ function pt(t, e) {
3265
3265
  const f = document.createElement("button");
3266
3266
  f.className = "gengage-chat-favorite-btn", f.type = "button", f.dataset.gengageFavoriteSku = ne, f.setAttribute("aria-label", e.i18n?.addToFavoritesLabel ?? "Add to favorites");
3267
3267
  const S = e.favoritedSkus?.has(ne) ?? !1;
3268
- S && f.classList.add("gengage-chat-favorite-btn--active"), f.innerHTML = `<svg width="14" height="14" viewBox="0 0 24 24" fill="${S ? "currentColor" : "none"}" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>`, f.addEventListener("click", (L) => {
3269
- L.stopPropagation(), f.classList.toggle("gengage-chat-favorite-btn--active");
3268
+ S && f.classList.add("gengage-chat-favorite-btn--active"), f.innerHTML = `<svg width="14" height="14" viewBox="0 0 24 24" fill="${S ? "currentColor" : "none"}" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>`, f.addEventListener("click", (P) => {
3269
+ P.stopPropagation(), f.classList.toggle("gengage-chat-favorite-btn--active");
3270
3270
  const $ = f.querySelector("svg");
3271
3271
  $ && $.setAttribute("fill", f.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), e.onFavoriteToggle(ne, n);
3272
3272
  }), D.appendChild(f);
@@ -3276,8 +3276,8 @@ function pt(t, e) {
3276
3276
  const f = document.createElement("button");
3277
3277
  f.className = "gengage-chat-find-similar-pill", f.type = "button", f.setAttribute("aria-label", K), f.dataset.tooltip = K, f.innerHTML = '<span class="gengage-chat-find-similar-pill-icon" aria-hidden="true"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M16 16l5.5 5.5"/></svg></span>';
3278
3278
  const S = document.createElement("span");
3279
- S.className = "gengage-chat-find-similar-pill-text", S.textContent = K, f.appendChild(S), f.addEventListener("click", (L) => {
3280
- L.stopPropagation(), e.onAction({
3279
+ S.className = "gengage-chat-find-similar-pill-text", S.textContent = K, f.appendChild(S), f.addEventListener("click", (P) => {
3280
+ P.stopPropagation(), e.onAction({
3281
3281
  title: K,
3282
3282
  type: "findSimilar",
3283
3283
  payload: { sku: W }
@@ -3293,29 +3293,29 @@ function pt(t, e) {
3293
3293
  const C = document.createElement("div");
3294
3294
  C.className = "gengage-chat-product-card-brand", C.textContent = m, h.appendChild(C);
3295
3295
  }
3296
- const x = n.rating, v = n.reviewCount, u = n.price, g = n.originalPrice, _ = n.price_async, w = He(e, n), b = $e(e, n), A = !!(g && u && g !== u && parseFloat(u) > 0), T = !!(w && A), k = !!(w && !T || A && b === "inline"), P = typeof x == "number" && Number.isFinite(x) && x > 0, z = document.createElement("div");
3296
+ const x = n.rating, v = n.reviewCount, u = n.price, g = n.originalPrice, _ = n.price_async, y = He(e, n), b = $e(e, n), A = !!(g && u && g !== u && parseFloat(u) > 0), T = !!(y && A), k = !!(y && !T || A && b === "inline"), L = typeof x == "number" && Number.isFinite(x) && x > 0, z = document.createElement("div");
3297
3297
  z.className = "gengage-chat-product-card-meta-row";
3298
- const U = document.createElement("div");
3299
- U.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3298
+ const O = document.createElement("div");
3299
+ O.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3300
3300
  const X = k ? (() => {
3301
3301
  const C = document.createElement("div");
3302
- return C.className = "gengage-chat-product-card-price-stack", w && !T && C.appendChild(Qe(w)), C.appendChild(U), C;
3303
- })() : U;
3302
+ return C.className = "gengage-chat-product-card-price-stack", y && !T && C.appendChild(Qe(y)), C.appendChild(O), C;
3303
+ })() : O;
3304
3304
  if (_ === !0) {
3305
3305
  const C = document.createElement("span");
3306
- C.className = "gengage-chat-price-skeleton", U.appendChild(C), setTimeout(() => {
3307
- C.parentElement && (u && parseFloat(u) > 0 ? Nt(U, e, n, u, n.originalPrice) : C.remove());
3306
+ C.className = "gengage-chat-price-skeleton", O.appendChild(C), setTimeout(() => {
3307
+ C.parentElement && (u && parseFloat(u) > 0 ? Nt(O, e, n, u, n.originalPrice) : C.remove());
3308
3308
  }, 300);
3309
- } else u && parseFloat(u) > 0 && Nt(U, e, n, u, g);
3310
- if ((U.childElementCount > 0 || _ === !0) && z.appendChild(X), P) {
3309
+ } else u && parseFloat(u) > 0 && Nt(O, e, n, u, g);
3310
+ if ((O.childElementCount > 0 || _ === !0) && z.appendChild(X), L) {
3311
3311
  const C = document.createElement("div");
3312
3312
  C.className = "gengage-chat-product-card-rating gengage-chat-product-card-rating-compact";
3313
- const O = ea(x), N = [`${O.toFixed(1)}`, "out of 5 stars"];
3313
+ const U = ea(x), N = [`${U.toFixed(1)}`, "out of 5 stars"];
3314
3314
  typeof v == "number" && Number.isFinite(v) && N.push(`(${v} reviews)`), C.setAttribute("aria-label", N.join(" "));
3315
3315
  const q = document.createElement("span");
3316
3316
  q.className = "gengage-chat-product-card-rating-compact-star", q.setAttribute("aria-hidden", "true"), q.innerHTML = '<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3.6l2.58 5.23 5.77.84-4.17 4.07.98 5.75L12 16.78l-5.16 2.71.99-5.75L3.66 9.67l5.76-.84L12 3.6z"/></svg>';
3317
3317
  const D = document.createElement("span");
3318
- D.className = "gengage-chat-product-card-rating-compact-value", D.textContent = O.toFixed(1), C.appendChild(q), C.appendChild(D), z.appendChild(C);
3318
+ D.className = "gengage-chat-product-card-rating-compact-value", D.textContent = U.toFixed(1), C.appendChild(q), C.appendChild(D), z.appendChild(C);
3319
3319
  }
3320
3320
  if (z.childElementCount === 0 && (z.classList.add("gengage-chat-product-card-meta-row--empty"), z.setAttribute("aria-hidden", "true")), h.appendChild(z), o) {
3321
3321
  const C = document.createElement("div");
@@ -3331,8 +3331,8 @@ function pt(t, e) {
3331
3331
  if (F) {
3332
3332
  const C = document.createElement("div");
3333
3333
  C.className = "gengage-chat-product-card-buy-footer";
3334
- const O = document.createElement("button");
3335
- O.type = "button", O.className = "gengage-chat-product-card-buy-trigger", O.textContent = B, O.addEventListener("click", (N) => {
3334
+ const U = document.createElement("button");
3335
+ U.type = "button", U.className = "gengage-chat-product-card-buy-trigger", U.textContent = B, U.addEventListener("click", (N) => {
3336
3336
  N.stopPropagation(), e.onAction({
3337
3337
  title: e.i18n?.addToCartButton ?? B,
3338
3338
  type: "addToCart",
@@ -3342,24 +3342,24 @@ function pt(t, e) {
3342
3342
  quantity: 1
3343
3343
  }
3344
3344
  });
3345
- }), C.appendChild(O), a.appendChild(C);
3345
+ }), C.appendChild(U), a.appendChild(C);
3346
3346
  } else if (i) {
3347
3347
  const C = document.createElement("button");
3348
- C.className = "gengage-chat-product-card-cta", C.type = "button", C.textContent = i.type === "launchSingleProduct" ? B : i.title || B, C.addEventListener("click", (O) => {
3348
+ C.className = "gengage-chat-product-card-cta", C.type = "button", C.textContent = i.type === "launchSingleProduct" ? B : i.title || B, C.addEventListener("click", (U) => {
3349
3349
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3350
- O.stopPropagation();
3350
+ U.stopPropagation();
3351
3351
  return;
3352
3352
  }
3353
3353
  d() || e.onAction(i);
3354
3354
  }), a.appendChild(C);
3355
3355
  } else if (l) {
3356
3356
  const C = document.createElement("a");
3357
- C.className = "gengage-chat-product-card-cta", de(C, "href", l), de(C, "target", "_blank"), de(C, "rel", "noopener noreferrer"), C.textContent = B, C.addEventListener("click", (O) => {
3357
+ C.className = "gengage-chat-product-card-cta", de(C, "href", l), de(C, "target", "_blank"), de(C, "rel", "noopener noreferrer"), C.textContent = B, C.addEventListener("click", (U) => {
3358
3358
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3359
- O.preventDefault(), O.stopPropagation();
3359
+ U.preventDefault(), U.stopPropagation();
3360
3360
  return;
3361
3361
  }
3362
- e.onProductClick && c && (O.preventDefault(), e.onProductClick({
3362
+ e.onProductClick && c && (U.preventDefault(), e.onProductClick({
3363
3363
  sku: c,
3364
3364
  url: l,
3365
3365
  ...o ? { name: o } : {}
@@ -3369,16 +3369,16 @@ function pt(t, e) {
3369
3369
  if (e.comparisonSelectMode && c && e.onToggleComparisonSku) {
3370
3370
  const C = document.createElement("div");
3371
3371
  C.className = "gengage-chat-comparison-select-wrapper";
3372
- const O = e.comparisonSelectedSkus?.includes(c) ?? !1;
3373
- O && C.classList.add("gengage-chat-comparison-select-wrapper--selected");
3372
+ const U = e.comparisonSelectedSkus?.includes(c) ?? !1;
3373
+ U && C.classList.add("gengage-chat-comparison-select-wrapper--selected");
3374
3374
  const N = n.name ?? c, q = e.i18n?.comparisonSelectCardHint ?? "Tap anywhere on the card to add or remove it from comparison.";
3375
3375
  C.setAttribute("role", "group"), C.setAttribute("aria-label", `${String(N)}. ${q}`);
3376
3376
  const D = document.createElement("button");
3377
- D.type = "button", D.className = "gengage-chat-comparison-checkbox", D.dataset.selected = O ? "true" : "false", D.setAttribute("aria-pressed", O ? "true" : "false");
3377
+ D.type = "button", D.className = "gengage-chat-comparison-checkbox", D.dataset.selected = U ? "true" : "false", D.setAttribute("aria-pressed", U ? "true" : "false");
3378
3378
  const ne = document.createElement("span");
3379
- ne.className = "gengage-chat-comparison-checkbox-icon", ne.innerHTML = O ? '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>' : '<span class="gengage-chat-comparison-checkbox-dot"></span>';
3379
+ ne.className = "gengage-chat-comparison-checkbox-icon", ne.innerHTML = U ? '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>' : '<span class="gengage-chat-comparison-checkbox-dot"></span>';
3380
3380
  const W = document.createElement("span");
3381
- W.className = "gengage-chat-comparison-checkbox-label", W.textContent = O ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", D.appendChild(ne), D.appendChild(W), D.addEventListener("click", (f) => {
3381
+ W.className = "gengage-chat-comparison-checkbox-label", W.textContent = U ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", D.appendChild(ne), D.appendChild(W), D.addEventListener("click", (f) => {
3382
3382
  f.stopPropagation(), e.onToggleComparisonSku?.(c);
3383
3383
  });
3384
3384
  const K = document.createElement("div");
@@ -3394,7 +3394,7 @@ var pa = /* @__PURE__ */ new Set([
3394
3394
  "renk",
3395
3395
  "renk kodu",
3396
3396
  "color code"
3397
- ]), Ur = /* @__PURE__ */ new Set([
3397
+ ]), Or = /* @__PURE__ */ new Set([
3398
3398
  "size",
3399
3399
  "beden",
3400
3400
  "boyut"
@@ -3430,7 +3430,7 @@ var pa = /* @__PURE__ */ new Set([
3430
3430
  "OBJECT",
3431
3431
  "EMBED"
3432
3432
  ]);
3433
- function fe(t, ...e) {
3433
+ function be(t, ...e) {
3434
3434
  for (const a of e) {
3435
3435
  const n = t[a];
3436
3436
  if (typeof n == "string") {
@@ -3465,14 +3465,14 @@ function Wr(t) {
3465
3465
  return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
3466
3466
  }
3467
3467
  function Kr(t) {
3468
- const e = [...Wr(t.images), fe(t, "imageUrl", "image_url", "image")].filter((a) => !!a && ve(a));
3468
+ const e = [...Wr(t.images), be(t, "imageUrl", "image_url", "image")].filter((a) => !!a && he(a));
3469
3469
  return Array.from(new Set(e));
3470
3470
  }
3471
3471
  function Yr(t) {
3472
3472
  return typeof DOMParser < "u" ? (new DOMParser().parseFromString(t, "text/html").body.textContent ?? "").replace(/\s+/g, " ").trim() : t.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
3473
3473
  }
3474
3474
  function Zr(t) {
3475
- const e = fe(t, "description_html", "descriptionHtml");
3475
+ const e = be(t, "description_html", "descriptionHtml");
3476
3476
  if (e) {
3477
3477
  const n = Yr(e);
3478
3478
  if (n) return {
@@ -3480,13 +3480,13 @@ function Zr(t) {
3480
3480
  html: e
3481
3481
  };
3482
3482
  }
3483
- const a = fe(t, "description");
3483
+ const a = be(t, "description");
3484
3484
  return a ? { text: a } : void 0;
3485
3485
  }
3486
3486
  function Ye(t) {
3487
3487
  return Array.isArray(t) ? t.map((e) => {
3488
3488
  if (!e || typeof e != "object") return null;
3489
- const a = e, n = fe(a, "key", "name", "label", "title"), r = a.value, i = typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? String(r).trim() : void 0;
3489
+ const a = e, n = be(a, "key", "name", "label", "title"), r = a.value, i = typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? String(r).trim() : void 0;
3490
3490
  return !n || !i ? null : {
3491
3491
  key: n,
3492
3492
  value: i
@@ -3510,7 +3510,7 @@ function Xr(t) {
3510
3510
  return n.length > 0 ? n : void 0;
3511
3511
  }
3512
3512
  function Ee(t, ...e) {
3513
- return fe(t, ...e);
3513
+ return be(t, ...e);
3514
3514
  }
3515
3515
  function zt(t, ...e) {
3516
3516
  return Ke(t, ...e);
@@ -3524,7 +3524,7 @@ function ma(t) {
3524
3524
  }
3525
3525
  function Qr(t) {
3526
3526
  const e = ma(t)?.toLowerCase();
3527
- return !!(fe(t, "color", "colour", "color_hex", "hex", "swatch", "swatchColor") || e && pa.has(e));
3527
+ return !!(be(t, "color", "colour", "color_hex", "hex", "swatch", "swatchColor") || e && pa.has(e));
3528
3528
  }
3529
3529
  function Rt(t) {
3530
3530
  if (!t) return;
@@ -3546,7 +3546,7 @@ function ti(t) {
3546
3546
  }
3547
3547
  function ai(t) {
3548
3548
  const e = t.trim().toLowerCase();
3549
- return pa.has(e) || Ur.has(e) || jr.has(e);
3549
+ return pa.has(e) || Or.has(e) || jr.has(e);
3550
3550
  }
3551
3551
  function ni(t) {
3552
3552
  const e = t.trim().toLowerCase();
@@ -3563,7 +3563,7 @@ function ri(t) {
3563
3563
  function ii(t) {
3564
3564
  const e = ri(t);
3565
3565
  if (e) return e;
3566
- const a = fe(t, "sku"), n = Ge(t, "inStock", "in_stock"), r = [], i = /* @__PURE__ */ new Set(), o = (c, l) => {
3566
+ const a = be(t, "sku"), n = Ge(t, "inStock", "in_stock"), r = [], i = /* @__PURE__ */ new Set(), o = (c, l) => {
3567
3567
  if (!ai(c) || typeof l != "string" && typeof l != "number" && typeof l != "boolean") return;
3568
3568
  const d = String(l).trim();
3569
3569
  if (!d) return;
@@ -3588,7 +3588,7 @@ function si(t, e) {
3588
3588
  a.className = "gengage-chat-product-details-panel";
3589
3589
  const n = t.props?.product ?? t.props;
3590
3590
  if (!n) return a;
3591
- const r = fe(n, "name"), i = fe(n, "brand"), o = fe(n, "sku"), s = fe(n, "cartCode", "cart_code"), c = fe(n, "price"), l = fe(n, "originalPrice", "price_original"), d = Ge(n, "price_async"), p = He(e, n), h = $e(e, n), m = !!(l && c && l !== c), x = Ge(n, "inStock", "in_stock"), v = Ke(n, "reviewCount", "review_count"), u = Ke(n, "rating"), g = Kr(n), _ = ha(n).slice(0, 4);
3591
+ const r = be(n, "name"), i = be(n, "brand"), o = be(n, "sku"), s = be(n, "cartCode", "cart_code"), c = be(n, "price"), l = be(n, "originalPrice", "price_original"), d = Ge(n, "price_async"), p = He(e, n), h = $e(e, n), m = !!(l && c && l !== c), x = Ge(n, "inStock", "in_stock"), v = Ke(n, "reviewCount", "review_count"), u = Ke(n, "rating"), g = Kr(n), _ = ha(n).slice(0, 4);
3592
3592
  if (g.length > 1) {
3593
3593
  const E = document.createElement("div");
3594
3594
  E.className = "gengage-chat-product-details-media gengage-chat-product-details-gallery gengage-chat-product-details-img-wrap";
@@ -3597,20 +3597,20 @@ function si(t, e) {
3597
3597
  const F = document.createElement("div");
3598
3598
  F.className = "gengage-chat-product-gallery-thumbs";
3599
3599
  const B = 6;
3600
- let C = null, O = 0;
3600
+ let C = null, U = 0;
3601
3601
  const N = e.i18n, q = N?.galleryPrevAriaLabel ?? "Previous image", D = N?.galleryNextAriaLabel ?? "Next image", ne = (I) => I === "prev" ? '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>' : '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>', W = document.createElement("button");
3602
3602
  W.type = "button", W.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--prev gds-btn gds-btn-ghost gds-icon-btn", W.setAttribute("aria-label", q), W.innerHTML = ne("prev");
3603
3603
  const K = document.createElement("button");
3604
3604
  K.type = "button", K.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--next gds-btn gds-btn-ghost gds-icon-btn", K.setAttribute("aria-label", D), K.innerHTML = ne("next");
3605
3605
  const f = () => {
3606
- W.disabled = O <= 0, K.disabled = O >= g.length - 1;
3606
+ W.disabled = U <= 0, K.disabled = U >= g.length - 1;
3607
3607
  }, S = (I) => {
3608
- if (I < 0 || I >= g.length || I === O) return;
3608
+ if (I < 0 || I >= g.length || I === U) return;
3609
3609
  const j = g[I];
3610
3610
  if (!j) return;
3611
3611
  de(R, "src", j);
3612
3612
  const Q = F.querySelectorAll(".gengage-chat-product-gallery-thumb");
3613
- C && C.classList.remove("gengage-chat-product-gallery-thumb--active"), I < B && Q[I] ? (Q[I].classList.add("gengage-chat-product-gallery-thumb--active"), C = Q[I]) : C = null, O = I, f();
3613
+ C && C.classList.remove("gengage-chat-product-gallery-thumb--active"), I < B && Q[I] ? (Q[I].classList.add("gengage-chat-product-gallery-thumb--active"), C = Q[I]) : C = null, U = I, f();
3614
3614
  };
3615
3615
  for (let I = 0; I < g.length; I++) {
3616
3616
  const j = g[I];
@@ -3625,17 +3625,17 @@ function si(t, e) {
3625
3625
  I.className = "gengage-chat-product-gallery-thumb-more", I.textContent = `+${g.length - B}`, F.appendChild(I);
3626
3626
  }
3627
3627
  W.addEventListener("click", (I) => {
3628
- I.stopPropagation(), S(O - 1);
3628
+ I.stopPropagation(), S(U - 1);
3629
3629
  }), K.addEventListener("click", (I) => {
3630
- I.stopPropagation(), S(O + 1);
3630
+ I.stopPropagation(), S(U + 1);
3631
3631
  }), f();
3632
- let L = 0;
3632
+ let P = 0;
3633
3633
  const $ = 50;
3634
3634
  R.addEventListener("touchstart", (I) => {
3635
- L = I.changedTouches[0].clientX;
3635
+ P = I.changedTouches[0].clientX;
3636
3636
  }, { passive: !0 }), R.addEventListener("touchend", (I) => {
3637
- const j = I.changedTouches[0].clientX, Q = L - j;
3638
- Math.abs(Q) < $ || S(Q > 0 ? Math.min(O + 1, g.length - 1) : Math.max(O - 1, 0));
3637
+ const j = I.changedTouches[0].clientX, Q = P - j;
3638
+ Math.abs(Q) < $ || S(Q > 0 ? Math.min(U + 1, g.length - 1) : Math.max(U - 1, 0));
3639
3639
  }), E.appendChild(W), E.appendChild(K), E.appendChild(F), a.appendChild(E);
3640
3640
  } else if (g.length === 1) {
3641
3641
  const E = document.createElement("div");
@@ -3643,14 +3643,14 @@ function si(t, e) {
3643
3643
  const R = document.createElement("img");
3644
3644
  R.className = "gengage-chat-product-details-img", R.loading = "lazy", de(R, "src", g[0]), xe(R), R.alt = r ?? "Product image", E.appendChild(R), a.appendChild(E);
3645
3645
  }
3646
- const w = document.createElement("div");
3647
- if (w.className = "gengage-chat-product-details-content", i && (!r || !r.toLowerCase().startsWith(i.toLowerCase()))) {
3646
+ const y = document.createElement("div");
3647
+ if (y.className = "gengage-chat-product-details-content", i && (!r || !r.toLowerCase().startsWith(i.toLowerCase()))) {
3648
3648
  const E = document.createElement("div");
3649
- E.className = "gengage-chat-product-details-brand", E.textContent = i, w.appendChild(E);
3649
+ E.className = "gengage-chat-product-details-brand", E.textContent = i, y.appendChild(E);
3650
3650
  }
3651
3651
  if (r) {
3652
3652
  const E = document.createElement("h3");
3653
- E.className = "gengage-chat-product-details-title", E.textContent = r, E.title = r, w.appendChild(E);
3653
+ E.className = "gengage-chat-product-details-title", E.textContent = r, E.title = r, y.appendChild(E);
3654
3654
  }
3655
3655
  if (e.hideUserReviews !== !0 && typeof u == "number" && Number.isFinite(u) && u > 0) {
3656
3656
  const E = document.createElement(o ? "button" : "div");
@@ -3666,14 +3666,14 @@ function si(t, e) {
3666
3666
  const F = document.createElement("span");
3667
3667
  F.className = "gengage-chat-product-details-review-count", F.textContent = ` (${v})`, E.appendChild(F);
3668
3668
  }
3669
- w.appendChild(E);
3669
+ y.appendChild(E);
3670
3670
  }
3671
3671
  {
3672
3672
  const E = !!(p && m);
3673
- let R = w;
3673
+ let R = y;
3674
3674
  if (p && !E) {
3675
3675
  const B = document.createElement("div");
3676
- B.className = "gengage-chat-product-details-price-stack", B.appendChild(Qe(p)), w.appendChild(B), R = B;
3676
+ B.className = "gengage-chat-product-details-price-stack", B.appendChild(Qe(p)), y.appendChild(B), R = B;
3677
3677
  }
3678
3678
  const F = document.createElement("div");
3679
3679
  if (F.className = "gengage-chat-product-details-price", d === !0) {
@@ -3695,7 +3695,7 @@ function si(t, e) {
3695
3695
  }
3696
3696
  if (e.hideStockStatus !== !0 && typeof x == "boolean") {
3697
3697
  const E = document.createElement("div");
3698
- E.className = `gengage-chat-product-details-stock ${x ? "is-in-stock" : "is-out-of-stock"}`, E.textContent = x ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", w.appendChild(E);
3698
+ E.className = `gengage-chat-product-details-stock ${x ? "is-in-stock" : "is-out-of-stock"}`, E.textContent = x ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", y.appendChild(E);
3699
3699
  }
3700
3700
  const b = n.promotions;
3701
3701
  if (b && b.length > 0) {
@@ -3706,7 +3706,7 @@ function si(t, e) {
3706
3706
  const F = document.createElement("span");
3707
3707
  F.className = "gengage-chat-product-details-promo-badge", F.textContent = R, F.title = R, E.appendChild(F);
3708
3708
  }
3709
- E.childElementCount > 0 && w.appendChild(E);
3709
+ E.childElementCount > 0 && y.appendChild(E);
3710
3710
  }
3711
3711
  if (_.length > 0) {
3712
3712
  const E = document.createElement("dl");
@@ -3719,7 +3719,7 @@ function si(t, e) {
3719
3719
  const C = document.createElement("dd");
3720
3720
  C.textContent = R.value, F.appendChild(B), F.appendChild(C), E.appendChild(F);
3721
3721
  }
3722
- w.appendChild(E);
3722
+ y.appendChild(E);
3723
3723
  }
3724
3724
  const A = ii(n);
3725
3725
  if (A.length > 0) {
@@ -3730,16 +3730,16 @@ function si(t, e) {
3730
3730
  const F = document.createElement("div");
3731
3731
  F.className = "gengage-chat-product-variants-list";
3732
3732
  for (const B of A) {
3733
- const C = ua(B), O = Ee(B, "sku");
3734
- if (!C && !O) continue;
3733
+ const C = ua(B), U = Ee(B, "sku");
3734
+ if (!C && !U) continue;
3735
3735
  const N = document.createElement("button");
3736
3736
  N.className = "gengage-chat-product-variant-btn gds-chip", N.type = "button";
3737
- const q = C ?? O ?? "";
3737
+ const q = C ?? U ?? "";
3738
3738
  N.title = q;
3739
3739
  const D = Ge(B, "in_stock", "inStock");
3740
- O && o && O === o ? (N.classList.add("gengage-chat-product-variant-btn--active"), N.setAttribute("aria-pressed", "true")) : N.setAttribute("aria-pressed", "false"), D === !1 && (N.classList.add("gengage-chat-product-variant-btn--out"), N.disabled = !0);
3740
+ U && o && U === o ? (N.classList.add("gengage-chat-product-variant-btn--active"), N.setAttribute("aria-pressed", "true")) : N.setAttribute("aria-pressed", "false"), D === !1 && (N.classList.add("gengage-chat-product-variant-btn--out"), N.disabled = !0);
3741
3741
  const ne = ei(B), W = Jr(B);
3742
- if (ne && ve(ne)) {
3742
+ if (ne && he(ne)) {
3743
3743
  const S = document.createElement("img");
3744
3744
  S.className = "gengage-chat-product-variant-swatch gengage-chat-product-variant-swatch--image", de(S, "src", ne), S.alt = "", S.setAttribute("aria-hidden", "true"), xe(S), N.appendChild(S);
3745
3745
  } else if (W) {
@@ -3753,19 +3753,19 @@ function si(t, e) {
3753
3753
  const S = document.createElement("span");
3754
3754
  S.className = "gengage-chat-product-variant-price", S.textContent = ae(String(f), e.pricing), N.appendChild(S);
3755
3755
  }
3756
- if (O && O !== o) {
3757
- const S = r ?? "", L = (typeof B.value == "string" ? B.value.trim() : "") || (typeof B.name == "string" ? B.name.trim() : "") || (typeof B.variant_name == "string" ? B.variant_name.trim() : "") || "", $ = S.length > 0 ? L.length > 0 && L !== S ? `${S} (${L})` : S : q;
3756
+ if (U && U !== o) {
3757
+ const S = r ?? "", P = (typeof B.value == "string" ? B.value.trim() : "") || (typeof B.name == "string" ? B.name.trim() : "") || (typeof B.variant_name == "string" ? B.variant_name.trim() : "") || "", $ = S.length > 0 ? P.length > 0 && P !== S ? `${S} (${P})` : S : q;
3758
3758
  N.addEventListener("click", () => {
3759
3759
  e.onAction({
3760
3760
  title: $,
3761
3761
  type: "launchVariant",
3762
- payload: { sku: O }
3762
+ payload: { sku: U }
3763
3763
  });
3764
3764
  });
3765
3765
  }
3766
3766
  F.appendChild(N);
3767
3767
  }
3768
- F.childElementCount > 0 && (E.appendChild(F), w.appendChild(E));
3768
+ F.childElementCount > 0 && (E.appendChild(F), y.appendChild(E));
3769
3769
  }
3770
3770
  const T = document.createElement("div");
3771
3771
  T.className = "gengage-chat-product-details-actions";
@@ -3788,23 +3788,23 @@ function si(t, e) {
3788
3788
  });
3789
3789
  }), T.appendChild(E);
3790
3790
  }
3791
- const P = fe(n, "url");
3792
- if (!k && P && ve(P)) {
3791
+ const L = be(n, "url");
3792
+ if (!k && L && he(L)) {
3793
3793
  const E = document.createElement("a");
3794
- E.className = "gengage-chat-product-details-cta gds-btn gds-btn-secondary", de(E, "href", P), de(E, "target", "_blank"), de(E, "rel", "noopener noreferrer"), E.textContent = e.i18n?.viewOnSiteLabel ?? e.i18n?.productCtaLabel ?? "View on Site", E.addEventListener("click", (R) => {
3794
+ E.className = "gengage-chat-product-details-cta gds-btn gds-btn-secondary", de(E, "href", L), de(E, "target", "_blank"), de(E, "rel", "noopener noreferrer"), E.textContent = e.i18n?.viewOnSiteLabel ?? e.i18n?.productCtaLabel ?? "View on Site", E.addEventListener("click", (R) => {
3795
3795
  e.onProductClick && o && (R.preventDefault(), e.onProductClick({
3796
3796
  sku: o,
3797
- url: P,
3797
+ url: L,
3798
3798
  ...r ? { name: r } : {}
3799
3799
  }));
3800
3800
  }), T.appendChild(E);
3801
3801
  }
3802
- const z = P;
3803
- if (z && ve(z)) {
3802
+ const z = L;
3803
+ if (z && he(z)) {
3804
3804
  let C = function(N, q) {
3805
3805
  const D = document.createElementNS(F, "circle");
3806
3806
  D.setAttribute("cx", N), D.setAttribute("cy", q), D.setAttribute("r", "3"), B.appendChild(D);
3807
- }, O = function(N, q, D, ne) {
3807
+ }, U = function(N, q, D, ne) {
3808
3808
  const W = document.createElementNS(F, "line");
3809
3809
  W.setAttribute("x1", N), W.setAttribute("y1", q), W.setAttribute("x2", D), W.setAttribute("y2", ne), B.appendChild(W);
3810
3810
  };
@@ -3813,7 +3813,7 @@ function si(t, e) {
3813
3813
  const R = e.i18n?.shareButton ?? "Share";
3814
3814
  E.title = R, E.setAttribute("aria-label", R);
3815
3815
  const F = "http://www.w3.org/2000/svg", B = document.createElementNS(F, "svg");
3816
- B.setAttribute("width", "18"), B.setAttribute("height", "18"), B.setAttribute("viewBox", "0 0 24 24"), B.setAttribute("fill", "none"), B.setAttribute("stroke", "currentColor"), B.setAttribute("stroke-width", "2"), B.setAttribute("stroke-linecap", "round"), B.setAttribute("stroke-linejoin", "round"), C("18", "5"), C("6", "12"), C("18", "19"), O("8.59", "13.51", "15.42", "17.49"), O("15.41", "6.51", "8.59", "10.49"), E.appendChild(B), E.addEventListener("click", async () => {
3816
+ B.setAttribute("width", "18"), B.setAttribute("height", "18"), B.setAttribute("viewBox", "0 0 24 24"), B.setAttribute("fill", "none"), B.setAttribute("stroke", "currentColor"), B.setAttribute("stroke-width", "2"), B.setAttribute("stroke-linecap", "round"), B.setAttribute("stroke-linejoin", "round"), C("18", "5"), C("6", "12"), C("18", "19"), U("8.59", "13.51", "15.42", "17.49"), U("15.41", "6.51", "8.59", "10.49"), E.appendChild(B), E.addEventListener("click", async () => {
3817
3817
  try {
3818
3818
  navigator.share ? await navigator.share({
3819
3819
  title: r ?? "",
@@ -3823,9 +3823,9 @@ function si(t, e) {
3823
3823
  }
3824
3824
  }), T.appendChild(E);
3825
3825
  }
3826
- T.childElementCount > 0 && w.appendChild(T), a.appendChild(w);
3827
- const U = Zr(n), X = Xr(n);
3828
- return (U || X) && a.appendChild(gi(U, X, e)), a;
3826
+ T.childElementCount > 0 && y.appendChild(T), a.appendChild(y);
3827
+ const O = Zr(n), X = Xr(n);
3828
+ return (O || X) && a.appendChild(gi(O, X, e)), a;
3829
3829
  }
3830
3830
  function ht(t) {
3831
3831
  if (t.nodeType === Node.TEXT_NODE) return document.createTextNode(t.textContent ?? "");
@@ -3968,17 +3968,17 @@ function mi(t, e, a, n) {
3968
3968
  if (!n?.onToggleComparisonSku) return;
3969
3969
  const _ = document.createElement("button");
3970
3970
  _.className = "gengage-chat-comparison-toggle-btn gds-btn gds-btn-ghost", _.type = "button", n.comparisonSelectMode && _.classList.add("gengage-chat-comparison-toggle-btn--active"), n.isStreaming && _.classList.add("gengage-chat-comparison-toggle-btn--hidden");
3971
- const w = document.createElement("span");
3972
- w.className = "gengage-chat-comparison-toggle-icon", w.innerHTML = hi();
3971
+ const y = document.createElement("span");
3972
+ y.className = "gengage-chat-comparison-toggle-icon", y.innerHTML = hi();
3973
3973
  const b = document.createElement("span");
3974
3974
  b.className = "gengage-chat-comparison-toggle-label";
3975
3975
  const A = n.i18n?.compareSelected ?? "Compare";
3976
- b.textContent = A, _.setAttribute("aria-label", A), _.title = A, _.appendChild(w), _.appendChild(b), _.addEventListener("click", () => {
3976
+ b.textContent = A, _.setAttribute("aria-label", A), _.title = A, _.appendChild(y), _.appendChild(b), _.addEventListener("click", () => {
3977
3977
  n.onToggleComparisonSku?.("");
3978
3978
  }), g.appendChild(_);
3979
3979
  }, v = (g, _ = s.length) => {
3980
- const w = t.props?.endOfList;
3981
- if (o || !(d ? w === !1 : w !== !0) || _ === 0) return;
3980
+ const y = t.props?.endOfList;
3981
+ if (o || !(d ? y === !1 : y !== !0) || _ === 0) return;
3982
3982
  const b = n?.i18n?.viewMoreLabel ?? "Show More", A = document.createElement("button");
3983
3983
  A.className = "gengage-chat-product-grid-view-more", A.type = "button", A.textContent = b, A.addEventListener("click", () => {
3984
3984
  n?.onAction({
@@ -3995,7 +3995,7 @@ function mi(t, e, a, n) {
3995
3995
  const g = document.createElement("div");
3996
3996
  g.className = "gengage-chat-product-sort-toolbar", g.setAttribute("role", "toolbar"), g.setAttribute("aria-label", n.i18n?.sortToolbarAriaLabel ?? "Sort products");
3997
3997
  let _ = n.productSort ?? { type: "related" };
3998
- const w = [
3998
+ const y = [
3999
3999
  {
4000
4000
  label: n.i18n?.sortRelated ?? "Related",
4001
4001
  sortState: { type: "related" },
@@ -4023,15 +4023,15 @@ function mi(t, e, a, n) {
4023
4023
  A.type = "button", A.className = "gengage-chat-product-sort-trigger gds-btn gds-btn-ghost", A.setAttribute("aria-haspopup", "listbox"), A.setAttribute("aria-expanded", "false");
4024
4024
  const T = n.i18n?.sortToolbarAriaLabel ?? "Sort products", k = document.createElement("span");
4025
4025
  k.className = "gengage-chat-product-sort-trigger-icon";
4026
- const P = document.createElement("span");
4027
- P.className = "gengage-chat-product-sort-trigger-label";
4026
+ const L = document.createElement("span");
4027
+ L.className = "gengage-chat-product-sort-trigger-label";
4028
4028
  const z = (N) => {
4029
- const q = w.find((D) => Ft(D.sortState, N)) ?? w[0];
4030
- P.textContent = q.label, k.innerHTML = Ht(q.icon), b.dataset.sortIcon = q.icon, A.setAttribute("aria-label", `${T}: ${q.label}`), A.title = q.label;
4029
+ const q = y.find((D) => Ft(D.sortState, N)) ?? y[0];
4030
+ L.textContent = q.label, k.innerHTML = Ht(q.icon), b.dataset.sortIcon = q.icon, A.setAttribute("aria-label", `${T}: ${q.label}`), A.title = q.label;
4031
4031
  };
4032
4032
  z(_);
4033
- const U = document.createElement("span");
4034
- U.className = "gengage-chat-product-sort-trigger-chevron", U.innerHTML = di(), A.appendChild(k), A.appendChild(P), A.appendChild(U);
4033
+ const O = document.createElement("span");
4034
+ O.className = "gengage-chat-product-sort-trigger-chevron", O.innerHTML = di(), A.appendChild(k), A.appendChild(L), A.appendChild(O);
4035
4035
  const X = document.createElement("div");
4036
4036
  X.className = "gengage-chat-product-sort-menu gds-menu", X.hidden = !0, X.setAttribute("role", "listbox"), X.setAttribute("aria-label", T);
4037
4037
  const E = g.ownerDocument;
@@ -4042,7 +4042,7 @@ function mi(t, e, a, n) {
4042
4042
  b.classList.contains("gengage-chat-product-sort-dropdown--open") && (b.contains(N.target) || F());
4043
4043
  }, C = (N) => {
4044
4044
  N.key === "Escape" && (N.preventDefault(), F());
4045
- }, O = () => {
4045
+ }, U = () => {
4046
4046
  X.hidden = !1, b.classList.add("gengage-chat-product-sort-dropdown--open"), A.setAttribute("aria-expanded", "true"), R = new AbortController();
4047
4047
  const { signal: N } = R;
4048
4048
  E.addEventListener("click", B, { signal: N }), E.addEventListener("keydown", C, {
@@ -4051,9 +4051,9 @@ function mi(t, e, a, n) {
4051
4051
  });
4052
4052
  };
4053
4053
  A.addEventListener("click", (N) => {
4054
- N.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? F() : O();
4054
+ N.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? F() : U();
4055
4055
  });
4056
- for (const N of w) {
4056
+ for (const N of y) {
4057
4057
  const q = document.createElement("button");
4058
4058
  q.type = "button", q.className = "gengage-chat-product-sort-option gds-menu-option", q.setAttribute("role", "option");
4059
4059
  const D = Ft(_, N.sortState);
@@ -4067,8 +4067,8 @@ function mi(t, e, a, n) {
4067
4067
  const f = document.createElement("span");
4068
4068
  f.className = "gengage-chat-product-sort-option-check", f.innerHTML = pi(), f.setAttribute("aria-hidden", "true"), D || f.classList.add("gengage-chat-product-sort-option-check--hidden"), q.appendChild(W), q.appendChild(K), q.appendChild(f), q.addEventListener("click", () => {
4069
4069
  _ = N.sortState, n.onSortChange?.(N.sortState), ui(c, s, e, N.sortState), X.querySelectorAll(".gengage-chat-product-sort-option").forEach((S) => {
4070
- const L = S, $ = L.dataset.sortKey === ne;
4071
- L.classList.toggle("gengage-chat-product-sort-option--active", $), L.classList.toggle("gds-menu-option-active", $), L.setAttribute("aria-selected", $ ? "true" : "false"), L.querySelector(".gengage-chat-product-sort-option-check")?.classList.toggle("gengage-chat-product-sort-option-check--hidden", !$);
4070
+ const P = S, $ = P.dataset.sortKey === ne;
4071
+ P.classList.toggle("gengage-chat-product-sort-option--active", $), P.classList.toggle("gds-menu-option-active", $), P.setAttribute("aria-selected", $ ? "true" : "false"), P.querySelector(".gengage-chat-product-sort-option-check")?.classList.toggle("gengage-chat-product-sort-option-check--hidden", !$);
4072
4072
  }), z(N.sortState), F();
4073
4073
  }), X.appendChild(q);
4074
4074
  }
@@ -4095,35 +4095,35 @@ function mi(t, e, a, n) {
4095
4095
  const g = document.createElement("div");
4096
4096
  g.className = "gengage-chat-product-grid-sections", g.setAttribute("role", "list");
4097
4097
  const _ = t.props?.rankingState;
4098
- let w = 0;
4098
+ let y = 0;
4099
4099
  for (const b of l) {
4100
- w += b.children.length;
4100
+ y += b.children.length;
4101
4101
  const A = fi(b.children.length, n), T = document.createElement("section");
4102
4102
  T.className = "gengage-chat-product-grid-section", T.setAttribute("role", "listitem");
4103
4103
  const k = document.createElement("div");
4104
4104
  if (k.className = "gengage-chat-product-grid-section-head", b.title) {
4105
- const U = document.createElement("h3");
4106
- U.className = "gengage-chat-product-grid-section-title", U.textContent = b.title, k.appendChild(U);
4105
+ const O = document.createElement("h3");
4106
+ O.className = "gengage-chat-product-grid-section-title", O.textContent = b.title, k.appendChild(O);
4107
4107
  }
4108
- const P = document.createElement("span");
4109
- P.className = "gengage-chat-product-grid-section-count", P.textContent = A, k.appendChild(P), T.appendChild(k);
4108
+ const L = document.createElement("span");
4109
+ L.className = "gengage-chat-product-grid-section-count", L.textContent = A, k.appendChild(L), T.appendChild(k);
4110
4110
  const z = document.createElement("div");
4111
4111
  z.className = "gengage-chat-product-grid gengage-chat-product-grid--section";
4112
- for (const U of b.children) {
4113
- const X = a(U);
4114
- X && (X.dataset.elementId = U, z.appendChild(X));
4112
+ for (const O of b.children) {
4113
+ const X = a(O);
4114
+ X && (X.dataset.elementId = O, z.appendChild(X));
4115
4115
  }
4116
4116
  (n?.isMobile ?? Ve()) && z.classList.add("gengage-chat-product-grid--mobile"), _ === "pending" && (z.classList.add("gengage-chat-product-grid--pending"), z.inert = !0, z.setAttribute("aria-busy", "true")), T.appendChild(z), g.appendChild(T);
4117
4117
  }
4118
- return r.appendChild(g), v(r, w), u(), r;
4118
+ return r.appendChild(g), v(r, y), u(), r;
4119
4119
  }
4120
4120
  if (o) Ci(r, c, i, n);
4121
4121
  else {
4122
4122
  const g = fa(s, e, n?.productSort);
4123
4123
  for (const _ of g) {
4124
4124
  if (!e.elements[_]) continue;
4125
- const w = a(_);
4126
- w && (w.dataset.elementId = _, c.appendChild(w));
4125
+ const y = a(_);
4126
+ y && (y.dataset.elementId = _, c.appendChild(y));
4127
4127
  }
4128
4128
  }
4129
4129
  return (n?.isMobile ?? Ve()) && c.classList.add("gengage-chat-product-grid--mobile"), t.props?.rankingState === "pending" && (c.classList.add("gengage-chat-product-grid--pending"), c.inert = !0, c.setAttribute("aria-busy", "true")), r.appendChild(c), v(r), u(), r;
@@ -4259,24 +4259,24 @@ function vt(t, e) {
4259
4259
  const g = typeof u?.sku == "string" ? u.sku : void 0;
4260
4260
  g && d.set(g, u);
4261
4261
  }
4262
- const p = (u, g, _, w) => {
4262
+ const p = (u, g, _, y) => {
4263
4263
  if (g.length === 0) return;
4264
4264
  const b = document.createElement("section");
4265
4265
  b.className = "gengage-chat-consulting-group";
4266
4266
  const A = document.createElement("div");
4267
4267
  A.className = "gengage-chat-consulting-group-header";
4268
4268
  const T = document.createElement("h4");
4269
- if (T.className = "gengage-chat-consulting-group-label", T.textContent = `${u} (${g.length})`, A.appendChild(T), typeof w == "string" && w.trim().length > 0) {
4270
- const P = document.createElement("p");
4271
- P.className = "gengage-chat-consulting-group-reason", P.textContent = w, A.appendChild(P);
4269
+ if (T.className = "gengage-chat-consulting-group-label", T.textContent = `${u} (${g.length})`, A.appendChild(T), typeof y == "string" && y.trim().length > 0) {
4270
+ const L = document.createElement("p");
4271
+ L.className = "gengage-chat-consulting-group-reason", L.textContent = y, A.appendChild(L);
4272
4272
  }
4273
4273
  b.appendChild(A);
4274
4274
  const k = document.createElement("div");
4275
4275
  k.className = "gengage-chat-product-grid gengage-chat-consulting-group-grid", _ && k.classList.add("gengage-chat-consulting-group-grid--single-group"), k.style.setProperty("--consulting-group-columns", String(Math.max(1, Math.min(4, g.length))));
4276
- for (const P of g) {
4276
+ for (const L of g) {
4277
4277
  const z = pt({
4278
4278
  type: "ProductCard",
4279
- props: { product: P }
4279
+ props: { product: L }
4280
4280
  }, r ?? { onAction: () => {
4281
4281
  } });
4282
4282
  k.appendChild(z);
@@ -4286,11 +4286,11 @@ function vt(t, e) {
4286
4286
  for (const u of l) {
4287
4287
  const g = (Array.isArray(u.skus) ? u.skus.filter((b) => typeof b == "string" && b.trim().length > 0) : []).map((b) => (h.add(b), d.get(b))).filter((b) => !!b);
4288
4288
  if (g.length === 0) continue;
4289
- const _ = typeof u.label == "string" && u.label.trim().length > 0 ? u.label : i.consultingFallbackGroupLabel, w = typeof u.reason == "string" ? u.reason : void 0;
4289
+ const _ = typeof u.label == "string" && u.label.trim().length > 0 ? u.label : i.consultingFallbackGroupLabel, y = typeof u.reason == "string" ? u.reason : void 0;
4290
4290
  m.push({
4291
4291
  labelText: _,
4292
4292
  products: g,
4293
- ...w !== void 0 ? { reasonText: w } : {}
4293
+ ...y !== void 0 ? { reasonText: y } : {}
4294
4294
  });
4295
4295
  }
4296
4296
  const x = c.filter((u) => {
@@ -4320,7 +4320,7 @@ function mt(t, e, a, n) {
4320
4320
  let s = t.querySelector(".gengage-chat-consulting-style-media");
4321
4321
  s ? s.innerHTML = "" : (s = document.createElement("div"), s.className = "gengage-chat-consulting-style-media", t.appendChild(s));
4322
4322
  const c = yi(e.image_url);
4323
- if (c && ve(c)) {
4323
+ if (c && he(c)) {
4324
4324
  const d = document.createElement("img");
4325
4325
  d.className = "gengage-chat-consulting-style-image", d.draggable = !1, de(d, "src", c), d.alt = We(e, a + 1, n), d.loading = "lazy", xe(d), s.appendChild(d);
4326
4326
  }
@@ -4458,7 +4458,7 @@ function Li(t) {
4458
4458
  contentAreaBottom: r
4459
4459
  };
4460
4460
  }
4461
- var Ot = "gengage-floating-launcher-style";
4461
+ var Ut = "gengage-floating-launcher-style";
4462
4462
  function Ti(t) {
4463
4463
  return `
4464
4464
  @property --gengage-fl-ring-angle {
@@ -4753,10 +4753,10 @@ function Ii(t, e, a) {
4753
4753
  "Ürün ara",
4754
4754
  "Karşılaştır",
4755
4755
  "Soru sor"
4756
- ], placeholderInterval: x = 2e3, voiceLang: v = "tr-TR", showBorderAnimation: u = !0, sendAriaLabel: g = "Gönder", micAriaLabel: _ = "Sesli giriş", cancelAriaLabel: w = "Ses kaydını durdur", openChatAriaLabel: b = "Chat'i aç" } = t;
4757
- if (!a.getElementById(Ot)) {
4756
+ ], placeholderInterval: x = 2e3, voiceLang: v = "tr-TR", showBorderAnimation: u = !0, sendAriaLabel: g = "Gönder", micAriaLabel: _ = "Sesli giriş", cancelAriaLabel: y = "Ses kaydını durdur", openChatAriaLabel: b = "Chat'i aç" } = t;
4757
+ if (!a.getElementById(Ut)) {
4758
4758
  const V = document.createElement("style");
4759
- V.id = Ot, V.textContent = Ti({
4759
+ V.id = Ut, V.textContent = Ti({
4760
4760
  primaryColor: n,
4761
4761
  backgroundColor: r,
4762
4762
  textColor: i,
@@ -4771,16 +4771,16 @@ function Ii(t, e, a) {
4771
4771
  }
4772
4772
  const A = document.createElement("div");
4773
4773
  A.className = "gengage-fl", A.dataset.gengagePart = "floating-launcher", A.innerHTML = Ai();
4774
- const T = A.querySelector(".gengage-fl-input"), k = A.querySelector(".gengage-fl-transcript"), P = A.querySelector(".gengage-fl-transcript-final"), z = A.querySelector(".gengage-fl-transcript-interim"), U = A.querySelector(".gengage-fl-btn-send"), X = A.querySelector(".gengage-fl-btn-mic"), E = A.querySelector(".gengage-fl-btn-open-chat"), R = A.querySelector(".gengage-fl-cancel"), F = A.querySelector(".gengage-fl-wave"), B = A.querySelector(".gengage-fl-ring");
4775
- T.placeholder = m[0] ?? "", U.setAttribute("aria-label", g), X.setAttribute("aria-label", _), R.setAttribute("aria-label", w), E.setAttribute("aria-label", b);
4776
- let C = !1, O = !1, N = "", q = !1, D = null, ne = 0, W = null, K = null, f = null, S = null, L = null, $ = 0;
4774
+ const T = A.querySelector(".gengage-fl-input"), k = A.querySelector(".gengage-fl-transcript"), L = A.querySelector(".gengage-fl-transcript-final"), z = A.querySelector(".gengage-fl-transcript-interim"), O = A.querySelector(".gengage-fl-btn-send"), X = A.querySelector(".gengage-fl-btn-mic"), E = A.querySelector(".gengage-fl-btn-open-chat"), R = A.querySelector(".gengage-fl-cancel"), F = A.querySelector(".gengage-fl-wave"), B = A.querySelector(".gengage-fl-ring");
4775
+ T.placeholder = m[0] ?? "", O.setAttribute("aria-label", g), X.setAttribute("aria-label", _), R.setAttribute("aria-label", y), E.setAttribute("aria-label", b);
4776
+ let C = !1, U = !1, N = "", q = !1, D = null, ne = 0, W = null, K = null, f = null, S = null, P = null, $ = 0;
4777
4777
  function I() {
4778
4778
  const V = T.value.trim().length > 0;
4779
4779
  if (X.classList.toggle("is-recording", C), C) {
4780
- U.style.display = "flex", X.style.display = "flex", R.style.display = "flex", E.style.display = "none";
4780
+ O.style.display = "flex", X.style.display = "flex", R.style.display = "flex", E.style.display = "none";
4781
4781
  return;
4782
4782
  }
4783
- U.style.display = V ? "flex" : "none", X.style.display = V ? "none" : "flex", R.style.display = "none", E.style.display = !V && q ? "flex" : "none";
4783
+ O.style.display = V ? "flex" : "none", X.style.display = V ? "none" : "flex", R.style.display = "none", E.style.display = !V && q ? "flex" : "none";
4784
4784
  }
4785
4785
  function j() {
4786
4786
  ne = (ne + 1) % m.length, T.placeholder = m[ne] ?? "", W = setTimeout(j, x);
@@ -4791,27 +4791,27 @@ function Ii(t, e, a) {
4791
4791
  function te() {
4792
4792
  W !== null && (clearTimeout(W), W = null);
4793
4793
  }
4794
- function oe() {
4795
- C && (C = !1, y(), O = !1, ie(), u && H(), N = "", T.style.display = "", k.style.display = "none", P.textContent = "", z.textContent = "");
4794
+ function se() {
4795
+ C && (C = !1, w(), U = !1, oe(), u && H(), N = "", T.style.display = "", k.style.display = "none", L.textContent = "", z.textContent = "");
4796
4796
  const V = T.value.trim();
4797
4797
  V && (e.onSend(V), q || (q = !0)), T.value = "", N = "", I();
4798
4798
  }
4799
- function se() {
4799
+ function re() {
4800
4800
  const V = window, G = V.SpeechRecognition ?? V.webkitSpeechRecognition;
4801
4801
  if (!G) {
4802
4802
  console.warn("[FloatingLauncher] SpeechRecognition not supported.");
4803
4803
  return;
4804
4804
  }
4805
- D || (D = new G(), D.continuous = !0, D.interimResults = !0, D.lang = v), C = !0, O = !0, N = "", T.value = "", T.style.display = "none", k.style.display = "flex", P.textContent = "", z.textContent = "", I(), ce(), u && M(), D.onresult = (J) => {
4805
+ D || (D = new G(), D.continuous = !0, D.interimResults = !0, D.lang = v), C = !0, U = !0, N = "", T.value = "", T.style.display = "none", k.style.display = "flex", L.textContent = "", z.textContent = "", I(), ce(), u && M(), D.onresult = (J) => {
4806
4806
  if (!C) return;
4807
- let re = "", Z = "";
4807
+ let ie = "", Z = "";
4808
4808
  for (let le = J.resultIndex; le < J.results.length; le++) {
4809
4809
  const Ae = J.results[le];
4810
4810
  if (!Ae) continue;
4811
4811
  const Fe = Ae[0]?.transcript ?? "";
4812
- Ae.isFinal ? Z += Fe : re += Fe;
4812
+ Ae.isFinal ? Z += Fe : ie += Fe;
4813
4813
  }
4814
- N += Z, P.textContent = N, z.textContent = re, T.value = `${N} ${re}`.trim(), I();
4814
+ N += Z, L.textContent = N, z.textContent = ie, T.value = `${N} ${ie}`.trim(), I();
4815
4815
  }, D.onend = () => Y(), D.onerror = () => Y();
4816
4816
  try {
4817
4817
  D.start();
@@ -4819,14 +4819,14 @@ function Ii(t, e, a) {
4819
4819
  Y();
4820
4820
  }
4821
4821
  }
4822
- function y() {
4822
+ function w() {
4823
4823
  try {
4824
4824
  D?.stop();
4825
4825
  } catch {
4826
4826
  }
4827
4827
  }
4828
4828
  function Y() {
4829
- O && (O = !1, C = !1, ie(), u && H(), N.trim() && (T.value = N.trim()), T.style.display = "", k.style.display = "none", P.textContent = "", z.textContent = "", I());
4829
+ U && (U = !1, C = !1, oe(), u && H(), N.trim() && (T.value = N.trim()), T.style.display = "", k.style.display = "none", L.textContent = "", z.textContent = "", I());
4830
4830
  }
4831
4831
  async function ce() {
4832
4832
  const V = ++$, G = Array.from(F.querySelectorAll("span"));
@@ -4837,7 +4837,7 @@ function Ii(t, e, a) {
4837
4837
  return;
4838
4838
  }
4839
4839
  K = J;
4840
- const re = window, Z = re.AudioContext ?? re.webkitAudioContext;
4840
+ const ie = window, Z = ie.AudioContext ?? ie.webkitAudioContext;
4841
4841
  if (!Z)
4842
4842
  throw K = null, J.getTracks().forEach((Ie) => Ie.stop()), new Error("AudioContext not supported");
4843
4843
  const le = new Z();
@@ -4853,17 +4853,17 @@ function Ii(t, e, a) {
4853
4853
  const Ie = Math.max(1, Math.floor(Ae.length / G.length));
4854
4854
  G.forEach((ka, Ca) => {
4855
4855
  ka.style.height = `${4 + Math.round((Ae[Ca * Ie] ?? 0) / 255 * 8)}px`;
4856
- }), L = requestAnimationFrame(Fe);
4856
+ }), P = requestAnimationFrame(Fe);
4857
4857
  };
4858
4858
  Fe();
4859
4859
  } catch {
4860
4860
  if (!C || V !== $) return;
4861
- L !== null && (cancelAnimationFrame(L), L = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4861
+ P !== null && (cancelAnimationFrame(P), P = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4862
4862
  }), f = null), K && (K.getTracks().forEach((J) => J.stop()), K = null), F.classList.add("is-css-animated");
4863
4863
  }
4864
4864
  }
4865
- function ie() {
4866
- $ += 1, F.classList.remove("is-css-animated"), L !== null && (cancelAnimationFrame(L), L = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4865
+ function oe() {
4866
+ $ += 1, F.classList.remove("is-css-animated"), P !== null && (cancelAnimationFrame(P), P = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4867
4867
  }), f = null), K && (K.getTracks().forEach((V) => V.stop()), K = null), Array.from(F.querySelectorAll("span")).forEach((V) => {
4868
4868
  V.style.height = "4px";
4869
4869
  });
@@ -4874,20 +4874,20 @@ function Ii(t, e, a) {
4874
4874
  function H() {
4875
4875
  B.classList.remove("is-active");
4876
4876
  }
4877
- U.addEventListener("click", oe), X.addEventListener("click", (V) => {
4878
- V.preventDefault(), V.stopPropagation(), C ? y() : se();
4877
+ O.addEventListener("click", se), X.addEventListener("click", (V) => {
4878
+ V.preventDefault(), V.stopPropagation(), C ? w() : re();
4879
4879
  }), R.addEventListener("click", () => {
4880
- C && (C = !1, y(), O = !1, ie(), u && H(), N = "", T.style.display = "", k.style.display = "none", P.textContent = "", z.textContent = "", I());
4880
+ C && (C = !1, w(), U = !1, oe(), u && H(), N = "", T.style.display = "", k.style.display = "none", L.textContent = "", z.textContent = "", I());
4881
4881
  }), E.addEventListener("click", (V) => {
4882
4882
  V.preventDefault(), V.stopPropagation(), e.onOpenChat();
4883
4883
  }), T.addEventListener("input", I), T.addEventListener("keydown", (V) => {
4884
- V.key === "Enter" && oe();
4884
+ V.key === "Enter" && se();
4885
4885
  }), I(), Q();
4886
4886
  function ee() {
4887
4887
  q = !0, I();
4888
4888
  }
4889
4889
  function pe() {
4890
- te(), ie(), H(), C && (C = !1, y()), D && (D.onresult = null, D.onend = null, D.onerror = null, D = null);
4890
+ te(), oe(), H(), C && (C = !1, w()), D && (D.onresult = null, D.onend = null, D.onerror = null, D = null);
4891
4891
  }
4892
4892
  return {
4893
4893
  container: A,
@@ -4895,7 +4895,7 @@ function Ii(t, e, a) {
4895
4895
  destroy: pe
4896
4896
  };
4897
4897
  }
4898
- var Mi = "gengage-inline-launcher-style", Ut = "gengage-inline-launcher-hide-floating", me = "gengage-inline-launcher", Ni = "gengage-inline-launcher", je = "data-gengage-inline-sibling", rt = "data-gengage-inline-sibling-restore-index", Bi = '<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M8.85 2.4c.23 0 .43.16.48.39l.9 3.77a3.8 3.8 0 0 0 2.8 2.8l3.77.9a.5.5 0 0 1 0 .98l-3.77.9a3.8 3.8 0 0 0-2.8 2.8l-.9 3.77a.5.5 0 0 1-.98 0l-.9-3.77a3.8 3.8 0 0 0-2.8-2.8l-3.77-.9a.5.5 0 0 1 0-.98l3.77-.9a3.8 3.8 0 0 0 2.8-2.8l.9-3.77c.05-.23.25-.39.48-.39Z" fill="currentColor"/><path d="M15.95 1.1c.12 0 .23.08.26.2l.32 1.34c.16.68.7 1.21 1.37 1.37l1.34.32a.27.27 0 0 1 0 .53l-1.34.32a1.87 1.87 0 0 0-1.37 1.37l-.32 1.34a.27.27 0 0 1-.53 0l-.32-1.34A1.87 1.87 0 0 0 14 5.18l-1.34-.32a.27.27 0 0 1 0-.53L14 4a1.87 1.87 0 0 0 1.37-1.37l.32-1.34c.03-.12.14-.2.26-.2Z" fill="currentColor" opacity=".72"/></svg>', ge = {
4898
+ var Mi = "gengage-inline-launcher-style", Ot = "gengage-inline-launcher-hide-floating", fe = "gengage-inline-launcher", Ni = "gengage-inline-launcher", je = "data-gengage-inline-sibling", rt = "data-gengage-inline-sibling-restore-index", Bi = '<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M8.85 2.4c.23 0 .43.16.48.39l.9 3.77a3.8 3.8 0 0 0 2.8 2.8l3.77.9a.5.5 0 0 1 0 .98l-3.77.9a3.8 3.8 0 0 0-2.8 2.8l-.9 3.77a.5.5 0 0 1-.98 0l-.9-3.77a3.8 3.8 0 0 0-2.8-2.8l-3.77-.9a.5.5 0 0 1 0-.98l3.77-.9a3.8 3.8 0 0 0 2.8-2.8l.9-3.77c.05-.23.25-.39.48-.39Z" fill="currentColor"/><path d="M15.95 1.1c.12 0 .23.08.26.2l.32 1.34c.16.68.7 1.21 1.37 1.37l1.34.32a.27.27 0 0 1 0 .53l-1.34.32a1.87 1.87 0 0 0-1.37 1.37l-.32 1.34a.27.27 0 0 1-.53 0l-.32-1.34A1.87 1.87 0 0 0 14 5.18l-1.34-.32a.27.27 0 0 1 0-.53L14 4a1.87 1.87 0 0 0 1.37-1.37l.32-1.34c.03-.12.14-.2.26-.2Z" fill="currentColor" opacity=".72"/></svg>', ge = {
4899
4899
  rowGap: "14px",
4900
4900
  buttonHeight: "46px",
4901
4901
  buttonPadding: "0 14px 0 10px",
@@ -4947,7 +4947,7 @@ function zi(t) {
4947
4947
  };
4948
4948
  }
4949
4949
  function Ri(t) {
4950
- const e = `.${t.rowClassName}`, a = `#${CSS.escape(t.buttonId)}`, n = `.${me}-icon`, r = `.${me}-copy`, i = `.${me}-title`, o = `.${me}-spark`, s = `@media (max-width: ${t.compactBelowWidth - 0.02}px)`, { sizes: c } = t, l = c.mobile.hideTitle ? "display:none;" : "display:flex;flex:0 1 auto;min-width:0;", d = c.mobile.hideSpark ? "display:none;" : "display:inline-flex;", p = c.mobile.hideLogo ? "display:none !important;width:0 !important;height:0 !important;flex:0 0 0 !important;overflow:hidden !important;" : "display:inline-flex;";
4950
+ const e = `.${t.rowClassName}`, a = `#${CSS.escape(t.buttonId)}`, n = `.${fe}-icon`, r = `.${fe}-copy`, i = `.${fe}-title`, o = `.${fe}-spark`, s = `@media (max-width: ${t.compactBelowWidth - 0.02}px)`, { sizes: c } = t, l = c.mobile.hideTitle ? "display:none;" : "display:flex;flex:0 1 auto;min-width:0;", d = c.mobile.hideSpark ? "display:none;" : "display:inline-flex;", p = c.mobile.hideLogo ? "display:none !important;width:0 !important;height:0 !important;flex:0 0 0 !important;overflow:hidden !important;" : "display:inline-flex;";
4951
4951
  return `
4952
4952
  ${e}{
4953
4953
  display:flex;
@@ -4999,7 +4999,7 @@ ${a}:focus-visible{
4999
4999
  outline:2px solid color-mix(in srgb, ${t.primaryColor} 34%, white);
5000
5000
  outline-offset:2px;
5001
5001
  }
5002
- ${a}.${me}--active{
5002
+ ${a}.${fe}--active{
5003
5003
  border-color:${t.primaryColor};
5004
5004
  background:linear-gradient(180deg,#fff7ef 0%,#ffe7d5 100%);
5005
5005
  box-shadow:0 16px 28px color-mix(in srgb, ${t.primaryColor} 24%, transparent);
@@ -5079,9 +5079,9 @@ function Hi(t) {
5079
5079
  return new Promise((e) => window.setTimeout(e, t));
5080
5080
  }
5081
5081
  function Fi(t, e, a) {
5082
- const { hostSelector: n, rowClassName: r = "gengage-inline-launcher-row", siblingSelector: i, siblingPlacement: o = "before", rowPlacement: s = "end", title: c = "Ask", iconUrl: l, primaryColor: d = "#6366f1", textColor: p = "#222222", fontFamily: h = "inherit", borderRadius: m = "3px", showSparkIcon: x = !0, desktopMinWidth: v = 0, enableOnMobile: u = !1, disabledPageTypes: g = ["pdp"], hideFloatingLauncher: _ = !0, mountPollFrames: w = 90, debounceMs: b = 90, buttonId: A = Ni } = t, T = t.ariaLabel ?? c, k = t.siblingRestoreParentSelector ?? n, P = u && v > 0 ? v : 576, z = zi(t.size), U = `${Mi}-${A}`;
5082
+ const { hostSelector: n, rowClassName: r = "gengage-inline-launcher-row", siblingSelector: i, siblingPlacement: o = "before", rowPlacement: s = "end", title: c = "Ask", iconUrl: l, primaryColor: d = "#6366f1", textColor: p = "#222222", fontFamily: h = "inherit", borderRadius: m = "3px", showSparkIcon: x = !0, desktopMinWidth: v = 0, enableOnMobile: u = !1, disabledPageTypes: g = ["pdp"], hideFloatingLauncher: _ = !0, mountPollFrames: y = 90, debounceMs: b = 90, buttonId: A = Ni } = t, T = t.ariaLabel ?? c, k = t.siblingRestoreParentSelector ?? n, L = u && v > 0 ? v : 576, z = zi(t.size), O = `${Mi}-${A}`;
5083
5083
  let X = !1, E = !1, R = null, F = null, B = null, C = null;
5084
- const O = () => {
5084
+ const U = () => {
5085
5085
  if (u && v > 0 && window.innerWidth < v && t.mobileHost && t.mobileHost) {
5086
5086
  const M = t.mobileHost;
5087
5087
  return {
@@ -5104,28 +5104,28 @@ function Fi(t, e, a) {
5104
5104
  M.siblingSelector ?? "",
5105
5105
  M.siblingRestoreParentSelector
5106
5106
  ].join("|"), q = () => {
5107
- if (document.getElementById(U)) return;
5107
+ if (document.getElementById(O)) return;
5108
5108
  const M = document.createElement("style");
5109
- M.id = U, M.textContent = Ri({
5109
+ M.id = O, M.textContent = Ri({
5110
5110
  primaryColor: d,
5111
5111
  textColor: p,
5112
5112
  fontFamily: h,
5113
5113
  borderRadius: m,
5114
5114
  rowClassName: r,
5115
- compactBelowWidth: P,
5115
+ compactBelowWidth: L,
5116
5116
  buttonId: A,
5117
5117
  sizes: z
5118
5118
  }), document.head.appendChild(M);
5119
5119
  }, D = (M) => {
5120
5120
  if (!_ || !a.shadowRoot) return;
5121
- const H = a.shadowRoot.getElementById(Ut);
5121
+ const H = a.shadowRoot.getElementById(Ot);
5122
5122
  if (!M) {
5123
5123
  H?.remove();
5124
5124
  return;
5125
5125
  }
5126
5126
  if (H) return;
5127
5127
  const ee = document.createElement("style");
5128
- ee.id = Ut, ee.textContent = ".gengage-chat-launcher-container,.gengage-fl{display:none!important;}", a.shadowRoot.appendChild(ee);
5128
+ ee.id = Ot, ee.textContent = ".gengage-chat-launcher-container,.gengage-fl{display:none!important;}", a.shadowRoot.appendChild(ee);
5129
5129
  }, ne = (M) => {
5130
5130
  const H = document.querySelector(M);
5131
5131
  return H instanceof HTMLElement ? H : null;
@@ -5146,14 +5146,14 @@ function Fi(t, e, a) {
5146
5146
  if (!H) return;
5147
5147
  const ee = Array.from(H.children).indexOf(M);
5148
5148
  ee >= 0 && M.setAttribute(rt, String(ee));
5149
- }, L = (M) => {
5149
+ }, P = (M) => {
5150
5150
  const H = K(M), ee = f(M.siblingRestoreParentSelector);
5151
5151
  if (!H || !ee) return;
5152
5152
  if (S(H), H.parentElement === ee) {
5153
5153
  H.removeAttribute(je);
5154
5154
  return;
5155
5155
  }
5156
- const pe = H.getAttribute(rt), V = pe ? Number.parseInt(pe, 10) : 0, G = Array.from(ee.children).filter((re) => !(re instanceof HTMLElement && re.classList.contains(r))), J = Number.isFinite(V) && V >= 0 ? G[V] ?? null : null;
5156
+ const pe = H.getAttribute(rt), V = pe ? Number.parseInt(pe, 10) : 0, G = Array.from(ee.children).filter((ie) => !(ie instanceof HTMLElement && ie.classList.contains(r))), J = Number.isFinite(V) && V >= 0 ? G[V] ?? null : null;
5157
5157
  if (J) {
5158
5158
  ee.insertBefore(H, J), H.removeAttribute(je);
5159
5159
  return;
@@ -5163,12 +5163,12 @@ function Fi(t, e, a) {
5163
5163
  M.querySelector(`.${r}`)?.remove();
5164
5164
  }, I = () => {
5165
5165
  const M = document.createElement("span");
5166
- M.className = `${me}-icon`;
5166
+ M.className = `${fe}-icon`;
5167
5167
  const H = document.createElement("img");
5168
5168
  return H.src = l, H.alt = "", H.draggable = !1, M.appendChild(H), M;
5169
- }, j = () => window.innerWidth < P, Q = (M) => {
5169
+ }, j = () => window.innerWidth < L, Q = (M) => {
5170
5170
  if (!l) return;
5171
- const H = M.querySelector(`.${me}-icon`);
5171
+ const H = M.querySelector(`.${fe}-icon`);
5172
5172
  if (j() && z.mobile.hideLogo) {
5173
5173
  H?.remove();
5174
5174
  return;
@@ -5176,55 +5176,55 @@ function Fi(t, e, a) {
5176
5176
  H || M.insertBefore(I(), M.firstChild);
5177
5177
  }, te = () => {
5178
5178
  const M = document.createElement("button");
5179
- M.type = "button", M.id = A, M.className = me, M.setAttribute("aria-label", T), l && M.appendChild(I());
5179
+ M.type = "button", M.id = A, M.className = fe, M.setAttribute("aria-label", T), l && M.appendChild(I());
5180
5180
  const H = document.createElement("span");
5181
- H.className = `${me}-copy`;
5181
+ H.className = `${fe}-copy`;
5182
5182
  const ee = document.createElement("span");
5183
- if (ee.className = `${me}-title`, ee.textContent = c, H.appendChild(ee), M.appendChild(H), x) {
5183
+ if (ee.className = `${fe}-title`, ee.textContent = c, H.appendChild(ee), M.appendChild(H), x) {
5184
5184
  const pe = document.createElement("span");
5185
- pe.className = `${me}-spark`, pe.innerHTML = Bi, M.appendChild(pe);
5185
+ pe.className = `${fe}-spark`, pe.innerHTML = Bi, M.appendChild(pe);
5186
5186
  }
5187
5187
  return M.addEventListener("click", () => e.onClick()), M;
5188
- }, oe = (M, H, ee) => {
5188
+ }, se = (M, H, ee) => {
5189
5189
  if (S(H), H.setAttribute(je, "true"), o === "before") {
5190
5190
  (H.parentElement !== M || H.nextElementSibling !== ee) && M.insertBefore(H, ee);
5191
5191
  return;
5192
5192
  }
5193
5193
  (H.parentElement !== M || ee.nextElementSibling !== H) && M.appendChild(H);
5194
- }, se = () => {
5194
+ }, re = () => {
5195
5195
  if (B) {
5196
- L(B);
5196
+ P(B);
5197
5197
  const M = ne(B.hostSelector);
5198
5198
  M && $(M), B = null;
5199
5199
  }
5200
5200
  C = null, D(!1), X = !1;
5201
- }, y = (M) => !(M && g.includes(M) || v > 0 && window.innerWidth < v && !u), Y = async (M) => {
5201
+ }, w = (M) => !(M && g.includes(M) || v > 0 && window.innerWidth < v && !u), Y = async (M) => {
5202
5202
  const H = M ?? a.getPageType();
5203
- if (!y(H))
5204
- return se(), !1;
5203
+ if (!w(H))
5204
+ return re(), !1;
5205
5205
  q();
5206
- const ee = O();
5207
- B && N(B) !== N(ee) && se();
5208
- for (let pe = 0; pe < w; pe += 1) {
5209
- if (!y(H))
5210
- return se(), !1;
5211
- const V = O(), G = ne(V.hostSelector), J = K(V);
5206
+ const ee = U();
5207
+ B && N(B) !== N(ee) && re();
5208
+ for (let pe = 0; pe < y; pe += 1) {
5209
+ if (!w(H))
5210
+ return re(), !1;
5211
+ const V = U(), G = ne(V.hostSelector), J = K(V);
5212
5212
  if (G && (!V.siblingSelector || J)) {
5213
- B && N(B) !== N(V) && se(), J && S(J);
5214
- let re = G.querySelector(`.${r}`);
5215
- re instanceof HTMLElement || (re = document.createElement("div"), re.className = r, V.rowPlacement === "start" ? G.insertBefore(re, G.firstChild) : G.appendChild(re));
5216
- let Z = re.querySelector(`#${CSS.escape(A)}`);
5217
- return Z instanceof HTMLButtonElement ? F = Z : (Z = te(), F = Z, re.appendChild(Z)), J && oe(re, J, Z), Q(Z), E ? Z.classList.add(`${me}--active`) : Z.classList.remove(`${me}--active`), D(!0), X = !0, B = V, !0;
5213
+ B && N(B) !== N(V) && re(), J && S(J);
5214
+ let ie = G.querySelector(`.${r}`);
5215
+ ie instanceof HTMLElement || (ie = document.createElement("div"), ie.className = r, V.rowPlacement === "start" ? G.insertBefore(ie, G.firstChild) : G.appendChild(ie));
5216
+ let Z = ie.querySelector(`#${CSS.escape(A)}`);
5217
+ return Z instanceof HTMLButtonElement ? F = Z : (Z = te(), F = Z, ie.appendChild(Z)), J && se(ie, J, Z), Q(Z), E ? Z.classList.add(`${fe}--active`) : Z.classList.remove(`${fe}--active`), D(!0), X = !0, B = V, !0;
5218
5218
  }
5219
5219
  await Hi(16);
5220
5220
  }
5221
- return se(), !1;
5221
+ return re(), !1;
5222
5222
  }, ce = () => {
5223
5223
  R !== null && window.clearTimeout(R), R = window.setTimeout(() => {
5224
5224
  R = null, Y();
5225
5225
  }, b);
5226
- }, ie = () => ce();
5227
- return window.addEventListener("resize", ie, { passive: !0 }), window.addEventListener("orientationchange", ie), {
5226
+ }, oe = () => ce();
5227
+ return window.addEventListener("resize", oe, { passive: !0 }), window.addEventListener("orientationchange", oe), {
5228
5228
  get isMounted() {
5229
5229
  return X;
5230
5230
  },
@@ -5232,10 +5232,10 @@ function Fi(t, e, a) {
5232
5232
  return Y(M);
5233
5233
  },
5234
5234
  setActive(M) {
5235
- E = M, F?.classList.toggle(`${me}--active`, M);
5235
+ E = M, F?.classList.toggle(`${fe}--active`, M);
5236
5236
  },
5237
5237
  destroy() {
5238
- R !== null && (window.clearTimeout(R), R = null), window.removeEventListener("resize", ie), window.removeEventListener("orientationchange", ie), se(), document.getElementById(U)?.remove(), F = null;
5238
+ R !== null && (window.clearTimeout(R), R = null), window.removeEventListener("resize", oe), window.removeEventListener("orientationchange", oe), re(), document.getElementById(O)?.remove(), F = null;
5239
5239
  }
5240
5240
  };
5241
5241
  }
@@ -5251,7 +5251,7 @@ var Di = /* @__PURE__ */ new Set([
5251
5251
  function it(t) {
5252
5252
  t.pause(), t.removeAttribute("src"), t.load(), ya.delete(t);
5253
5253
  }
5254
- function Oi(t, e = "audio/ogg") {
5254
+ function Ui(t, e = "audio/ogg") {
5255
5255
  const a = e.split(";")[0].trim();
5256
5256
  if (!Di.has(a)) return null;
5257
5257
  try {
@@ -5263,7 +5263,7 @@ function Oi(t, e = "audio/ogg") {
5263
5263
  return null;
5264
5264
  }
5265
5265
  }
5266
- var Ui = /* @__PURE__ */ new Set([
5266
+ var Oi = /* @__PURE__ */ new Set([
5267
5267
  "P",
5268
5268
  "DIV",
5269
5269
  "H1",
@@ -5289,7 +5289,7 @@ var Ui = /* @__PURE__ */ new Set([
5289
5289
  function ji(t) {
5290
5290
  const e = [];
5291
5291
  let a = [];
5292
- for (const n of t) n.nodeType === Node.ELEMENT_NODE && Ui.has(n.tagName) ? (a.length > 0 && (e.push(a), a = []), e.push([n])) : a.push(n);
5292
+ for (const n of t) n.nodeType === Node.ELEMENT_NODE && Oi.has(n.tagName) ? (a.length > 0 && (e.push(a), a = []), e.push([n])) : a.push(n);
5293
5293
  return a.length > 0 && e.push(a), e;
5294
5294
  }
5295
5295
  function qi(t) {
@@ -5364,10 +5364,10 @@ function Gi(t) {
5364
5364
  c = s.nextNode();
5365
5365
  continue;
5366
5366
  }
5367
- const _ = document.createElement("a");
5368
- _.className = "gengage-product-mention", _.textContent = v, _.href = "#", _.addEventListener("click", (w) => {
5369
- w.preventDefault(), n(o.sku);
5370
- }), x && g.insertBefore(document.createTextNode(x), c), g.insertBefore(_, c), u && g.insertBefore(document.createTextNode(u), c), g.removeChild(c), l = !0;
5367
+ const _ = typeof o.url == "string" && o.url.trim() && he(o.url.trim()) ? o.url.trim() : void 0, y = document.createElement("a");
5368
+ y.className = "gengage-product-mention", y.textContent = v, y.href = _ ?? "#", y.addEventListener("click", (b) => {
5369
+ b.preventDefault(), n(o);
5370
+ }), x && g.insertBefore(document.createTextNode(x), c), g.insertBefore(y, c), u && g.insertBefore(document.createTextNode(u), c), g.removeChild(c), l = !0;
5371
5371
  }
5372
5372
  }
5373
5373
  }
@@ -5658,7 +5658,7 @@ var ao = class {
5658
5658
  const a = this._snapshotRebuilders.get(t), n = this.snapshots.get(t);
5659
5659
  if (!a && !n) return !1;
5660
5660
  const r = this.deps.shadow(), i = this.deps.drawer();
5661
- this.activePanelMessageId && r?.querySelector(`[data-message-id="${he(this.activePanelMessageId)}"]`)?.classList.remove("gengage-chat-bubble--active"), r?.querySelector(`[data-message-id="${he(e)}"]`)?.classList.add("gengage-chat-bubble--active"), this.activePanelMessageId = e;
5661
+ this.activePanelMessageId && r?.querySelector(`[data-message-id="${ue(this.activePanelMessageId)}"]`)?.classList.remove("gengage-chat-bubble--active"), r?.querySelector(`[data-message-id="${ue(e)}"]`)?.classList.add("gengage-chat-bubble--active"), this.activePanelMessageId = e;
5662
5662
  const o = a ? a() : n.cloneNode(!0);
5663
5663
  i?.setPanelContent(o);
5664
5664
  const s = this.snapshotTypes.get(t);
@@ -5792,7 +5792,7 @@ function po(t, e) {
5792
5792
  function ot(t) {
5793
5793
  return `${so}:${t}`;
5794
5794
  }
5795
- function Oe(t, e) {
5795
+ function Ue(t, e) {
5796
5796
  return `${co}:${t}:${e}`;
5797
5797
  }
5798
5798
  function wa(t) {
@@ -5869,7 +5869,7 @@ var xo = class {
5869
5869
  return t ? t.map(bo).sort((e, a) => a.updatedAt.localeCompare(e.updatedAt)) : [];
5870
5870
  }
5871
5871
  loadSession(t) {
5872
- const e = Gt(this._storage?.getItem(Oe(this._scope, t)) ?? null);
5872
+ const e = Gt(this._storage?.getItem(Ue(this._scope, t)) ?? null);
5873
5873
  return !e || e.version !== Vt ? null : vo(e);
5874
5874
  }
5875
5875
  saveSession(t) {
@@ -5920,14 +5920,14 @@ var xo = class {
5920
5920
  sourceSessionId: l.sourceSessionId
5921
5921
  }); d.length > lo; ) {
5922
5922
  const p = d.pop();
5923
- p && this._storage.removeItem(Oe(this._scope, p.id));
5923
+ p && this._storage.removeItem(Ue(this._scope, p.id));
5924
5924
  }
5925
5925
  return this._commitRecord(l, d) ? l : null;
5926
5926
  }
5927
5927
  deleteSession(t) {
5928
5928
  if (!this._storage) return;
5929
5929
  const e = this.listSessions().filter((a) => a.id !== t);
5930
- this._storage.removeItem(Oe(this._scope, t));
5930
+ this._storage.removeItem(Ue(this._scope, t));
5931
5931
  try {
5932
5932
  this._storage.setItem(ot(this._scope), JSON.stringify(e));
5933
5933
  } catch {
@@ -5937,12 +5937,12 @@ var xo = class {
5937
5937
  if (!this._storage) return !1;
5938
5938
  const a = [...e];
5939
5939
  for (; a.length > 0; ) try {
5940
- return this._storage.setItem(Oe(this._scope, t.id), JSON.stringify(t)), this._storage.setItem(ot(this._scope), JSON.stringify(a)), !0;
5940
+ return this._storage.setItem(Ue(this._scope, t.id), JSON.stringify(t)), this._storage.setItem(ot(this._scope), JSON.stringify(a)), !0;
5941
5941
  } catch {
5942
5942
  const n = a.pop();
5943
5943
  if (!n) break;
5944
5944
  if (n.id !== t.id) {
5945
- this._storage.removeItem(Oe(this._scope, n.id));
5945
+ this._storage.removeItem(Ue(this._scope, n.id));
5946
5946
  continue;
5947
5947
  }
5948
5948
  break;
@@ -6023,7 +6023,7 @@ var xo = class {
6023
6023
  await e();
6024
6024
  } catch {
6025
6025
  }
6026
- a?.send("openURLInNewTab", { url: t }), ve(t) && n(t);
6026
+ a?.send("openURLInNewTab", { url: t }), he(t) && n(t);
6027
6027
  }
6028
6028
  async loadPayload(t, e) {
6029
6029
  if (!this._db) return null;
@@ -6234,7 +6234,7 @@ function Ro(t) {
6234
6234
  function Ho(t) {
6235
6235
  if (!t.trim()) return !1;
6236
6236
  const e = document.createElement("template");
6237
- return e.innerHTML = be(t), (e.content.textContent ?? "").trim().length > 0;
6237
+ return e.innerHTML = ve(t), (e.content.textContent ?? "").trim().length > 0;
6238
6238
  }
6239
6239
  function Zt(t) {
6240
6240
  return t.length > 120 ? !1 : /^[a-zA-Z0-9#(),.\s%/\-]+$/.test(t);
@@ -6255,7 +6255,7 @@ var Fo = class Me extends Ya {
6255
6255
  if (!this._hostScrollLockActive || !this._hostScrollLockViewport || this._hostScrollPinning || this._isMobileViewport && window.visualViewport && window.visualViewport.height < window.innerHeight) return;
6256
6256
  const a = this._hostScrollLockViewport;
6257
6257
  window.scrollX === a.x && window.scrollY === a.y || (this._hostScrollPinning = !0, window.scrollTo(a.x, a.y), this._hostScrollPinning = !1);
6258
- }, this._messages = [], this._currentMessageId = 0, this._abortControllers = /* @__PURE__ */ new Set(), this._currentThreadId = null, this._lastThreadId = null, this._chatCreatedAt = "", this._lastBackendContext = null, this._productSort = { type: "related" }, this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._comparisonRefreshRafId = null, this._lastAppliedKeyboardInset = 0, this._syncVisualVh = null, this._viewedProductSkus = /* @__PURE__ */ new Set(), this._panelAiSpecByThread = /* @__PURE__ */ new Map(), this._choicePrompterEl = null, this._openState = "full", this._mobileBreakpoint = 768, this._isMobileViewport = !1, this._gaPrevMainPaneExpanded = !1, this._pdpLaunched = !1, this._plpLaunched = !1, this._homepageLaunched = !1, this._entryContextPrimed = !1, this._contextPrimingInFlight = !1, this._queuedUserMessages = [], this._productContextUnavailableSku = null, this._i18n = Re, this._extendedModeManager = null, this._activeTypewriter = null, this._activeTtsHandle = null, this._activeRequestThreadId = null, this._skuToProductItem = {}, this._conversationMode = null, this._initComplete = !1, this._pendingActions = [], this._bridgeContext = null, this._cartQuantity = null, this._threadsWithFirstBot = /* @__PURE__ */ new Set(), this._panel = null, this._localPanelHistory = [], this._currentPanelSource = null, this._currentInlineProductSummaryRecord = null, this._session = null, this._historyStorage = null, this._activeHistorySessionId = null, this._presentation = new yo(), this._presentationScrollTimerIds = /* @__PURE__ */ new Set(), this._eventCallbacks = /* @__PURE__ */ new Map(), this._pendingAddToCartKeys = /* @__PURE__ */ new Set(), this._lastSentAction = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", this._launcherAnchorCleanup = null, this._modeController = new On(), this._syncLauncherAnchor = null;
6258
+ }, this._messages = [], this._currentMessageId = 0, this._abortControllers = /* @__PURE__ */ new Set(), this._currentThreadId = null, this._lastThreadId = null, this._chatCreatedAt = "", this._lastBackendContext = null, this._productSort = { type: "related" }, this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._comparisonRefreshRafId = null, this._lastAppliedKeyboardInset = 0, this._syncVisualVh = null, this._viewedProductSkus = /* @__PURE__ */ new Set(), this._panelAiSpecByThread = /* @__PURE__ */ new Map(), this._choicePrompterEl = null, this._openState = "full", this._mobileBreakpoint = 768, this._isMobileViewport = !1, this._gaPrevMainPaneExpanded = !1, this._pdpLaunched = !1, this._plpLaunched = !1, this._homepageLaunched = !1, this._entryContextPrimed = !1, this._contextPrimingInFlight = !1, this._queuedUserMessages = [], this._productContextUnavailableSku = null, this._i18n = Re, this._extendedModeManager = null, this._activeTypewriter = null, this._activeTtsHandle = null, this._activeRequestThreadId = null, this._skuToProductItem = {}, this._conversationMode = null, this._initComplete = !1, this._pendingActions = [], this._bridgeContext = null, this._cartQuantity = null, this._threadsWithFirstBot = /* @__PURE__ */ new Set(), this._panel = null, this._localPanelHistory = [], this._currentPanelSource = null, this._currentInlineProductSummaryRecord = null, this._session = null, this._historyStorage = null, this._activeHistorySessionId = null, this._presentation = new yo(), this._presentationScrollTimerIds = /* @__PURE__ */ new Set(), this._eventCallbacks = /* @__PURE__ */ new Map(), this._pendingAddToCartKeys = /* @__PURE__ */ new Set(), this._lastSentAction = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", this._launcherAnchorCleanup = null, this._modeController = new Un(), this._syncLauncherAnchor = null;
6259
6259
  }
6260
6260
  static {
6261
6261
  this._MAX_COMPARISON_SELECTION = 5;
@@ -6290,7 +6290,7 @@ var Fo = class Me extends Ya {
6290
6290
  for (const [u, g] of Object.entries(e.theme)) u.startsWith("--") && typeof g == "string" && r(u, g);
6291
6291
  this._applyDiscountedPriceColorVar(e.productPriceUi?.discountedPriceColor);
6292
6292
  const i = document.createElement("div");
6293
- i.className = "gengage-chat-root", i.lang = Ue(e.locale), this._rootEl = i, this._shadow.appendChild(i);
6293
+ i.className = "gengage-chat-root", i.lang = Oe(e.locale), this._rootEl = i, this._shadow.appendChild(i);
6294
6294
  const o = e.variant ?? "floating";
6295
6295
  if (o === "inline" && i.classList.add("gengage-chat--inline"), o !== "inline") {
6296
6296
  const u = document.createElement("div");
@@ -6420,15 +6420,15 @@ var Fo = class Me extends Ya {
6420
6420
  if (!this._drawerVisible || !this._isMobileViewport) return;
6421
6421
  const _ = this._drawer?.getElement();
6422
6422
  if (!_) return;
6423
- const w = window.visualViewport, b = Math.max(0, Math.round(window.innerHeight - (w.height + w.offsetTop))), A = b > 90, T = this._openState === "full" && A ? b : 0;
6424
- T !== this._lastAppliedKeyboardInset && (this._lastAppliedKeyboardInset = T, _.style.setProperty("--gengage-chat-keyboard-inset", `${T}px`)), this._openState === "full" && (_.style.setProperty("--gengage-chat-visual-vh", `${Math.round(w.height)}px`), _.style.setProperty("--gengage-chat-visual-top", `${Math.round(w.offsetTop)}px`));
6423
+ const y = window.visualViewport, b = Math.max(0, Math.round(window.innerHeight - (y.height + y.offsetTop))), A = b > 90, T = this._openState === "full" && A ? b : 0;
6424
+ T !== this._lastAppliedKeyboardInset && (this._lastAppliedKeyboardInset = T, _.style.setProperty("--gengage-chat-keyboard-inset", `${T}px`)), this._openState === "full" && (_.style.setProperty("--gengage-chat-visual-vh", `${Math.round(y.height)}px`), _.style.setProperty("--gengage-chat-visual-top", `${Math.round(y.offsetTop)}px`));
6425
6425
  };
6426
6426
  this._syncVisualVh = () => {
6427
6427
  if (!this._isMobileViewport || this._openState !== "full") return;
6428
6428
  const _ = this._drawer?.getElement();
6429
6429
  if (!_ || !window.visualViewport) return;
6430
- const w = window.visualViewport;
6431
- _.style.setProperty("--gengage-chat-visual-vh", `${Math.round(w.height)}px`), _.style.setProperty("--gengage-chat-visual-top", `${Math.round(w.offsetTop)}px`);
6430
+ const y = window.visualViewport;
6431
+ _.style.setProperty("--gengage-chat-visual-vh", `${Math.round(y.height)}px`), _.style.setProperty("--gengage-chat-visual-top", `${Math.round(y.offsetTop)}px`);
6432
6432
  }, window.visualViewport.addEventListener("resize", g), window.visualViewport.addEventListener("scroll", g), this.addCleanup(() => {
6433
6433
  window.visualViewport?.removeEventListener("resize", g), window.visualViewport?.removeEventListener("scroll", g);
6434
6434
  });
@@ -6505,20 +6505,20 @@ var Fo = class Me extends Ya {
6505
6505
  const l = () => {
6506
6506
  const T = window.innerWidth <= r ? a.mobile : a.desktop;
6507
6507
  if (!T) return;
6508
- const k = T.selector, P = !!k, z = (P ? document.querySelector(k) : null)?.getBoundingClientRect();
6508
+ const k = T.selector, L = !!k, z = (L ? document.querySelector(k) : null)?.getBoundingClientRect();
6509
6509
  if (T.bottom !== void 0) {
6510
- const { offset: U, type: X } = T.bottom;
6511
- if (!P) n.style.setProperty(s, `${Math.max(0, U)}px`);
6510
+ const { offset: O, type: X } = T.bottom;
6511
+ if (!L) n.style.setProperty(s, `${Math.max(0, O)}px`);
6512
6512
  else if (z) {
6513
- const E = X === "root" || U === 0 ? z.bottom : z.top, R = Math.max(0, window.innerHeight - E + U);
6513
+ const E = X === "root" || O === 0 ? z.bottom : z.top, R = Math.max(0, window.innerHeight - E + O);
6514
6514
  n.style.setProperty(s, `${R}px`);
6515
6515
  }
6516
6516
  }
6517
6517
  if (T.right !== void 0) {
6518
- const { offset: U, type: X } = T.right;
6519
- if (!P) n.style.setProperty(c, `${Math.max(0, U)}px`);
6518
+ const { offset: O, type: X } = T.right;
6519
+ if (!L) n.style.setProperty(c, `${Math.max(0, O)}px`);
6520
6520
  else if (z) {
6521
- const E = X === "root" || U === 0 ? z.right : z.left, R = Math.max(0, window.innerWidth - E + U);
6521
+ const E = X === "root" || O === 0 ? z.right : z.left, R = Math.max(0, window.innerWidth - E + O);
6522
6522
  n.style.setProperty(c, `${R}px`);
6523
6523
  }
6524
6524
  }
@@ -6539,12 +6539,12 @@ var Fo = class Me extends Ya {
6539
6539
  return !T || !!document.querySelector(T);
6540
6540
  }, _ = () => {
6541
6541
  !o() || g() || (u?.disconnect(), u = new MutationObserver(() => {
6542
- g() && (u?.disconnect(), u = null, w());
6542
+ g() && (u?.disconnect(), u = null, y());
6543
6543
  }), u.observe(document.body, {
6544
6544
  childList: !0,
6545
6545
  subtree: !0
6546
6546
  }));
6547
- }, w = () => {
6547
+ }, y = () => {
6548
6548
  x.disconnect(), v?.disconnect(), v = null, p = !1;
6549
6549
  const T = i();
6550
6550
  if (!T) return;
@@ -6553,19 +6553,19 @@ var Fo = class Me extends Ya {
6553
6553
  return;
6554
6554
  }
6555
6555
  const k = document.querySelector(T.selector);
6556
- k && (x.observe(k), o() ? (v = new IntersectionObserver((P) => {
6557
- for (const z of P) z.isIntersecting ? (p = !0, l()) : (p = !1, d(), _());
6556
+ k && (x.observe(k), o() ? (v = new IntersectionObserver((L) => {
6557
+ for (const z of L) z.isIntersecting ? (p = !0, l()) : (p = !1, d(), _());
6558
6558
  }, { threshold: 0 }), v.observe(k)) : l());
6559
6559
  };
6560
- w();
6560
+ y();
6561
6561
  let b = 0;
6562
6562
  const A = () => {
6563
6563
  b || (b = requestAnimationFrame(() => {
6564
- b = 0, p = !1, d(), u?.disconnect(), u = null, w(), _(), o() || l();
6564
+ b = 0, p = !1, d(), u?.disconnect(), u = null, y(), _(), o() || l();
6565
6565
  }));
6566
6566
  };
6567
6567
  window.addEventListener("resize", A, { passive: !0 }), window.addEventListener("scroll", m, { passive: !0 }), window.visualViewport?.addEventListener("scroll", m, { passive: !0 }), this._syncLauncherAnchor = () => {
6568
- p = !1, d(), u?.disconnect(), u = null, w(), _();
6568
+ p = !1, d(), u?.disconnect(), u = null, y(), _();
6569
6569
  }, o() ? _() : (l(), [
6570
6570
  100,
6571
6571
  400,
@@ -6640,7 +6640,7 @@ var Fo = class Me extends Ya {
6640
6640
  if (a.role === "assistant" && !a.frontendOnly && (a.status === "streaming" || a.status === "done") && (a.content == null || a.content.length === 0)) {
6641
6641
  if (a.threadId) {
6642
6642
  const n = this._messages.some((r) => r.id !== a.id && r.threadId === a.threadId && r.frontendOnly) || this._panel?.snapshotTypes.has(a.id) === !0;
6643
- this._threadsWithFirstBot.delete(a.threadId), this._presentation.finalizeAssistantGroup(a.threadId), this._shadow?.querySelectorAll(`[data-thread-id="${he(a.threadId)}"]:not([data-message-id])`).forEach((r) => r.remove()), this._panel && !n && (this._panel.threads = this._panel.threads.filter((r) => r !== a.threadId));
6643
+ this._threadsWithFirstBot.delete(a.threadId), this._presentation.finalizeAssistantGroup(a.threadId), this._shadow?.querySelectorAll(`[data-thread-id="${ue(a.threadId)}"]:not([data-message-id])`).forEach((r) => r.remove()), this._panel && !n && (this._panel.threads = this._panel.threads.filter((r) => r !== a.threadId));
6644
6644
  }
6645
6645
  this._drawer?.removeMessageBubble(a.id), this._panel?.snapshots.delete(a.id), this._panel?.snapshotTypes.delete(a.id);
6646
6646
  continue;
@@ -7051,7 +7051,7 @@ var Fo = class Me extends Ya {
7051
7051
  }
7052
7052
  if (this._maybeHandleDirectAddToCartCommand(e)) return;
7053
7053
  }
7054
- this._contextPrimingInFlight && (this._abortAllActiveRequests(), this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._ensureMobileFullSheetForPanel(), Ma(), this._messages.some((r) => r.role === "user") || Ua(), ze("chat", "sendMessage", {
7054
+ this._contextPrimingInFlight && (this._abortAllActiveRequests(), this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._ensureMobileFullSheetForPanel(), Ma(), this._messages.some((r) => r.role === "user") || Oa(), ze("chat", "sendMessage", {
7055
7055
  mode: this._assistantMode,
7056
7056
  hasAttachment: a !== void 0,
7057
7057
  textLength: e.length
@@ -7093,12 +7093,12 @@ var Fo = class Me extends Ya {
7093
7093
  return;
7094
7094
  }
7095
7095
  if (this._clearChoicePrompter(), a?.preservePanel || qt(), !a?.preservePanel && this._comparisonSelectMode && e.type !== "getComparisonTable" && (this._comparisonSelectMode = !1, this._comparisonSelectedSkus = []), a?.preservePanel || (this._localPanelHistory = []), this._currentThreadId && this._lastThreadId && this._lastThreadId > this._currentThreadId) {
7096
- const f = this._currentThreadId, S = this._messages.filter((L) => L.threadId !== void 0 && L.threadId > f);
7097
- this._messages = this._messages.filter((L) => !L.threadId || L.threadId <= f);
7098
- for (const L of S)
7099
- this._shadow?.querySelector(`[data-message-id="${he(L.id)}"]`)?.remove(), this._panel?.deleteSnapshotForMessage(L.id);
7100
- this._panel?.pruneThreadsAfter(f), this._shadow?.querySelectorAll("[data-thread-id]")?.forEach((L) => {
7101
- L instanceof HTMLElement && L.dataset.threadId && L.dataset.threadId > f && L.remove();
7096
+ const f = this._currentThreadId, S = this._messages.filter((P) => P.threadId !== void 0 && P.threadId > f);
7097
+ this._messages = this._messages.filter((P) => !P.threadId || P.threadId <= f);
7098
+ for (const P of S)
7099
+ this._shadow?.querySelector(`[data-message-id="${ue(P.id)}"]`)?.remove(), this._panel?.deleteSnapshotForMessage(P.id);
7100
+ this._panel?.pruneThreadsAfter(f), this._shadow?.querySelectorAll("[data-thread-id]")?.forEach((P) => {
7101
+ P instanceof HTMLElement && P.dataset.threadId && P.dataset.threadId > f && P.remove();
7102
7102
  });
7103
7103
  }
7104
7104
  a?.preservePills || this._drawer?.setPills([]), this._drawer?.clearInputAreaChips();
@@ -7115,8 +7115,8 @@ var Fo = class Me extends Ya {
7115
7115
  const f = typeof e.payload == "string" ? e.payload : typeof e.payload?.text == "string" ? e.payload.text : e.title, S = this._messages.length > 0 ? this._messages[this._messages.length - 1] : void 0;
7116
7116
  if (!(S !== void 0 && S.role === "user" && S.content === f)) {
7117
7117
  (!this._messages.some(($) => $.role === "user") || this._drawer?.isKvkkBannerVisible()) && (ct(this.config.accountId), this._drawer?.hideKvkkBanner());
7118
- const L = this._createMessage("user", f);
7119
- L.threadId = i, a?.attachment !== void 0 && (L.attachment = a.attachment), this._drawer?.addMessage(L), a?.attachment !== void 0 && this._modeController.isBeautyConsulting && this._drawer?.setBeautyPhotoStepCard({ visible: !1 }), this._messages.push(L), this._persistHistoryToLocalStorage();
7118
+ const P = this._createMessage("user", f);
7119
+ P.threadId = i, a?.attachment !== void 0 && (P.attachment = a.attachment), this._drawer?.addMessage(P), a?.attachment !== void 0 && this._modeController.isBeautyConsulting && this._drawer?.setBeautyPhotoStepCard({ visible: !1 }), this._messages.push(P), this._persistHistoryToLocalStorage();
7120
7120
  }
7121
7121
  }
7122
7122
  const d = !a?.silent && this._assistantMode === "shopping" && this._hasUnavailableProductContext() && (e.type === "user_message" || e.type === "inputText");
@@ -7143,7 +7143,7 @@ var Fo = class Me extends Ya {
7143
7143
  ...this.config.injectorAdapter ? { injectorAdapter: this.config.injectorAdapter } : {}
7144
7144
  };
7145
7145
  a?.attachment !== void 0 && (_.attachment = a.attachment);
7146
- const w = this._getVisibleMessages().filter((f) => !f.frontendOnly && f !== g && (f.content || f.role === "assistant")).slice(-50).map((f) => ({
7146
+ const y = this._getVisibleMessages().filter((f) => !f.frontendOnly && f !== g && (f.content || f.role === "assistant")).slice(-50).map((f) => ({
7147
7147
  role: f.role === "user" ? "user" : "model",
7148
7148
  content: f.content ?? ""
7149
7149
  })), b = {
@@ -7174,44 +7174,44 @@ var Fo = class Me extends Ya {
7174
7174
  session_id: this.config.session?.sessionId ?? "",
7175
7175
  correlation_id: this.config.session?.sessionId ?? "",
7176
7176
  type: A.type,
7177
- locale: Ue(this.config.locale),
7177
+ locale: Oe(this.config.locale),
7178
7178
  meta: b,
7179
7179
  context: {
7180
7180
  ...this._lastBackendContext ?? {},
7181
- messages: w,
7181
+ messages: y,
7182
7182
  session_id: this.config.session?.sessionId ?? ""
7183
7183
  }
7184
7184
  };
7185
7185
  this.config.session?.userId !== void 0 && (T.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (T.view_id = this.config.session.viewId), A.payload !== void 0 && (T.payload = A.payload), !d && this.config.pageContext?.sku !== void 0 && (T.sku = this.config.pageContext.sku), !d && this.config.pageContext?.pageType !== void 0 && (T.page_type = this.config.pageContext.pageType);
7186
- let k = !1, P = !1, z = !1, U = !1, X = !1, E = !1;
7187
- const R = Un();
7186
+ let k = !1, L = !1, z = !1, O = !1, X = !1, E = !1;
7187
+ const R = On();
7188
7188
  let F = null, B = null;
7189
7189
  const C = () => {
7190
- if (this._drawer && !U) {
7190
+ if (this._drawer && !O) {
7191
7191
  if (!z) {
7192
7192
  this._drawer.setPanelAiZoneState("hidden");
7193
7193
  return;
7194
7194
  }
7195
7195
  X ? this._drawer.setPanelAiZoneState("hidden") : this._drawer.setPanelAiZoneState("analyzing", { analyzingLabel: this._i18n.aiAnalysisAnalyzingLabel });
7196
7196
  }
7197
- }, O = (f) => {
7197
+ }, U = (f) => {
7198
7198
  if (!F || !this._drawer) return;
7199
7199
  const S = this._buildRenderContext();
7200
7200
  S.isStreaming = f;
7201
- const L = this._renderUISpec(F, S);
7202
- U = !0, this._drawer.setPanelAiZoneState("results", { resultEl: L }), F = null;
7203
- }, N = (f, S, L) => {
7201
+ const P = this._renderUISpec(F, S);
7202
+ O = !0, this._drawer.setPanelAiZoneState("results", { resultEl: P }), F = null;
7203
+ }, N = (f, S, P) => {
7204
7204
  if (f === "ProductGrid" || f === "CategoriesContainer") {
7205
- z = !0, O(L), C();
7205
+ z = !0, U(P), C();
7206
7206
  return;
7207
7207
  }
7208
- S !== "appendSimilars" && S !== "append" && (z = !1, U = !1, F = null, this._drawer?.setPanelAiZoneState("hidden"));
7209
- }, q = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (z || U || F !== null), D = () => {
7208
+ S !== "appendSimilars" && S !== "append" && (z = !1, O = !1, F = null, this._drawer?.setPanelAiZoneState("hidden"));
7209
+ }, q = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (z || O || F !== null), D = () => {
7210
7210
  E || (E = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
7211
- }, ne = (f, S, L) => {
7211
+ }, ne = (f, S, P) => {
7212
7212
  if (!this._drawer || !this._panel) return;
7213
7213
  const $ = f.elements[f.root];
7214
- if (L === "ProductGrid" && $) {
7214
+ if (P === "ProductGrid" && $) {
7215
7215
  const I = ft($);
7216
7216
  if (I.isConsulting) {
7217
7217
  const j = this._drawer.getPanelContentElement();
@@ -7219,63 +7219,72 @@ var Fo = class Me extends Ya {
7219
7219
  this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._currentPanelSource = {
7220
7220
  kind: "spec",
7221
7221
  spec: f
7222
- }, this._panel.currentType = L, this._drawer.resyncPanelTopBarFromCurrentContent();
7222
+ }, this._panel.currentType = P, this._drawer.resyncPanelTopBarFromCurrentContent();
7223
7223
  return;
7224
7224
  }
7225
7225
  }
7226
7226
  }
7227
- this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._drawer.setPanelContent(this._renderUISpec(f, S), { preserveAiZone: q(L) }), this._currentPanelSource = {
7227
+ this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._drawer.setPanelContent(this._renderUISpec(f, S), { preserveAiZone: q(P) }), this._currentPanelSource = {
7228
7228
  kind: "spec",
7229
7229
  spec: f
7230
- }, this._panel.currentType = L;
7231
- }, W = (f, S, L, $) => {
7230
+ }, this._panel.currentType = P;
7231
+ }, W = (f, S, P, $) => {
7232
7232
  if (!this._panel) return;
7233
7233
  f === "ProductDetailsPanel" && e.type === "launchSingleProduct" && this._clearUnavailableProductContext(), g.threadId && this._panel.threads[this._panel.threads.length - 1] !== g.threadId && this._panel.threads.push(g.threadId), this._isMobileViewport && f === "ProductGrid" && this._ensureMobilePanelOverlayVisible();
7234
7234
  const I = this._panel.currentType ?? f, j = S?.props?.panelTitle;
7235
- this._panel.updateTopBar(I, j), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), N(f, L, $);
7235
+ this._panel.updateTopBar(I, j), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), N(f, P, $);
7236
7236
  };
7237
7237
  let K = null;
7238
7238
  if (K = pn(T, {
7239
- onTextChunk: (f, S, L) => {
7240
- if (!o && i !== this._activeRequestThreadId || (u += f, L?.skuToProductItem && (this._skuToProductItem = {
7239
+ onTextChunk: (f, S, P) => {
7240
+ if (!o && i !== this._activeRequestThreadId || (u += f, P?.skuToProductItem && (this._skuToProductItem = {
7241
7241
  ...this._skuToProductItem,
7242
- ...L.skuToProductItem
7243
- }), L?.conversationMode && (this._conversationMode = L.conversationMode), L?.renderHint && (g.renderHint = L.renderHint), !this._drawer)) return;
7242
+ ...P.skuToProductItem
7243
+ }), P?.conversationMode && (this._conversationMode = P.conversationMode), P?.renderHint && (g.renderHint = P.renderHint), !this._drawer)) return;
7244
7244
  let $ = u;
7245
- const I = L?.kvkk === !0, j = I ? { fallbackToFirstBlock: !0 } : void 0;
7245
+ const I = P?.kvkk === !0, j = I ? { fallbackToFirstBlock: !0 } : void 0;
7246
7246
  if (I || xt($)) {
7247
7247
  if (S) {
7248
7248
  const te = this.config.accountId;
7249
7249
  if (!Kt(te)) {
7250
- const oe = Ao($, j);
7251
- oe && this._drawer?.showKvkkBanner(oe), ct(te);
7250
+ const se = Ao($, j);
7251
+ se && this._drawer?.showKvkkBanner(se), ct(te);
7252
7252
  }
7253
7253
  }
7254
7254
  $ = To($, j), u = $;
7255
7255
  }
7256
7256
  Ho($) && D();
7257
7257
  const Q = this._shadow?.querySelector(`[data-message-id="${g.id}"] .gengage-chat-bubble-text`);
7258
- if (Q ? Q.innerHTML = be($) : (g.content = $, g.role === "assistant" && g.threadId && !this._threadsWithFirstBot.has(g.threadId) && (this._threadsWithFirstBot.add(g.threadId), this._drawer.markFirstBotMessage(g.id)), this._drawer.addMessage(g)), S)
7258
+ if (Q ? Q.innerHTML = ve($) : (g.content = $, g.role === "assistant" && g.threadId && !this._threadsWithFirstBot.has(g.threadId) && (this._threadsWithFirstBot.add(g.threadId), this._drawer.markFirstBotMessage(g.id)), this._drawer.addMessage(g)), S)
7259
7259
  if (g.content = $, g.status = "done", yt(), qn(g))
7260
7260
  this._drawer?.updateBotMessage(g.id, $, "photo_analysis", g.photoAnalysis), g.threadId && this._focusPresentationThread(g.threadId, "auto");
7261
7261
  else {
7262
7262
  const te = this._shadow?.querySelector(`[data-message-id="${g.id}"] .gengage-chat-bubble-text`);
7263
7263
  if (te) {
7264
7264
  this._activeTypewriter?.cancel();
7265
- const oe = L?.productMentions;
7265
+ const se = P?.productMentions ? this._enrichProductMentionsWithUrls(P.productMentions) : void 0;
7266
7266
  this._activeTypewriter = Vi({
7267
7267
  container: te,
7268
- html: be($),
7268
+ html: ve($),
7269
7269
  onTick: () => this._drawer?.scrollToBottomIfNeeded(),
7270
7270
  onComplete: () => {
7271
- this._activeTypewriter = null, oe && oe.length > 0 && te && Gi({
7271
+ this._activeTypewriter = null, se && se.length > 0 && te && Gi({
7272
7272
  container: te,
7273
- mentions: oe,
7274
- onProductClick: (se) => {
7273
+ mentions: se,
7274
+ onProductClick: (re) => {
7275
+ const w = re.url?.trim() ?? "";
7276
+ if (w && he(w)) {
7277
+ this._handleProductNavClick({
7278
+ sku: re.sku,
7279
+ url: w,
7280
+ name: re.short_name
7281
+ });
7282
+ return;
7283
+ }
7275
7284
  this._sendAction({
7276
- title: oe.find((y) => y.sku === se)?.short_name ?? se,
7285
+ title: re.short_name || re.sku,
7277
7286
  type: "launchSingleProduct",
7278
- payload: { sku: se }
7287
+ payload: { sku: re.sku }
7279
7288
  });
7280
7289
  }
7281
7290
  });
@@ -7284,7 +7293,7 @@ var Fo = class Me extends Ya {
7284
7293
  }
7285
7294
  }
7286
7295
  },
7287
- onUISpec: (f, S, L, $) => {
7296
+ onUISpec: (f, S, P, $) => {
7288
7297
  if (!o && i !== this._activeRequestThreadId || S !== "chat") return;
7289
7298
  $ && (this._clearAssistantPanelLikeStreamClearPanel(), k = !1, B = null);
7290
7299
  const I = f.elements[f.root], j = I?.type ?? "unknown";
@@ -7302,8 +7311,8 @@ var Fo = class Me extends Ya {
7302
7311
  }
7303
7312
  const Q = gt(I), te = this.config.productDetailsExtended !== !0 && (j === "ProductDetailsPanel" || Q);
7304
7313
  te && !$ && (this._clearAssistantPanelLikeStreamClearPanel(), k = !1);
7305
- const oe = j === "ProductDetailsPanel" && L !== "panel" ? "panel" : L, se = this._buildRenderContext();
7306
- if (se.isStreaming = !0, j === "ComparisonTable") {
7314
+ const se = j === "ProductDetailsPanel" && P !== "panel" ? "panel" : P, re = this._buildRenderContext();
7315
+ if (re.isStreaming = !0, j === "ComparisonTable") {
7307
7316
  const G = I?.props?.products;
7308
7317
  $a(Array.isArray(G) ? G.length : 0);
7309
7318
  }
@@ -7311,8 +7320,8 @@ var Fo = class Me extends Ya {
7311
7320
  const G = I?.children?.length ?? 0;
7312
7321
  Ra(void 0, G);
7313
7322
  }
7314
- const y = oe === "panel" && this._panel ? this._panel.toPanelSpec(f) : f;
7315
- if (oe === "panel" && this._panel && !te && j === "ProductGrid" && I) {
7323
+ const w = se === "panel" && this._panel ? this._panel.toPanelSpec(f) : f;
7324
+ if (se === "panel" && this._panel && !te && j === "ProductGrid" && I) {
7316
7325
  const G = ft(I);
7317
7326
  if (G.isConsulting && !Si(G)) {
7318
7327
  B = f;
@@ -7320,10 +7329,10 @@ var Fo = class Me extends Ya {
7320
7329
  }
7321
7330
  G.isConsulting && (B = null);
7322
7331
  }
7323
- if (Ro(I) && D(), oe === "panel" && this._panel && !te) {
7324
- const G = !P;
7325
- P = !0;
7326
- const J = I?.props?.replacePanel === !0, re = I?.props?.rankingState, Z = J || re === "pending" || re === "final" ? "replace" : oo({
7332
+ if (Ro(I) && D(), se === "panel" && this._panel && !te) {
7333
+ const G = !L;
7334
+ L = !0;
7335
+ const J = I?.props?.replacePanel === !0, ie = I?.props?.rankingState, Z = J || ie === "pending" || ie === "final" ? "replace" : oo({
7327
7336
  componentType: j,
7328
7337
  similarsAppend: I?.props?.similarsAppend === !0,
7329
7338
  currentPanelType: this._panel.currentType,
@@ -7331,12 +7340,12 @@ var Fo = class Me extends Ya {
7331
7340
  isPanelLoading: this._drawer?.isPanelLoading() ?? !1,
7332
7341
  isFirstPanelContentInStream: G
7333
7342
  });
7334
- se.panelProductListHeading = void 0, j === "ProductGrid" && (Z === "appendSimilars" ? se.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products" : this._applyPanelListHeadingToContext(se, {
7343
+ re.panelProductListHeading = void 0, j === "ProductGrid" && (Z === "appendSimilars" ? re.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products" : this._applyPanelListHeadingToContext(re, {
7335
7344
  kind: "spec",
7336
- spec: y
7337
- })), Z === "appendSimilars" ? this._appendSimilarsToPanel(y, se) : Z === "append" ? (this._drawer?.appendPanelContent(this._renderUISpec(y, se)), this._comparisonSelectMode && this._refreshComparisonUI()) : ne(y, se, j), W(j, I, Z, !0);
7345
+ spec: w
7346
+ })), Z === "appendSimilars" ? this._appendSimilarsToPanel(w, re) : Z === "append" ? (this._drawer?.appendPanelContent(this._renderUISpec(w, re)), this._comparisonSelectMode && this._refreshComparisonUI()) : ne(w, re, j), W(j, I, Z, !0);
7338
7347
  }
7339
- if (j === "ProductDetailsPanel" && oe === "panel" && (!g.silent || c)) {
7348
+ if (j === "ProductDetailsPanel" && se === "panel" && (!g.silent || c)) {
7340
7349
  const G = I?.props?.product;
7341
7350
  if (G) {
7342
7351
  c && (l = G), this._currentInlineProductSummaryRecord = G;
@@ -7346,36 +7355,36 @@ var Fo = class Me extends Ya {
7346
7355
  type: "ProductSummaryCard",
7347
7356
  props: { product: G }
7348
7357
  } }
7349
- }, re = this._shadow?.querySelector(".gengage-chat-messages");
7350
- if (re) {
7351
- const Z = this._renderUISpec(J, se);
7358
+ }, ie = this._shadow?.querySelector(".gengage-chat-messages");
7359
+ if (ie) {
7360
+ const Z = this._renderUISpec(J, re);
7352
7361
  g.threadId && (Z.dataset.threadId = g.threadId);
7353
7362
  const le = this._shadow?.querySelector(`[data-message-id="${g.id}"]`);
7354
- le && le.parentNode === re ? le.after(Z) : re.appendChild(Z), this._scrollInlineIntoView(Z, g.threadId), this._drawer?.refreshPresentationCollapsed(), P = !0;
7363
+ le && le.parentNode === ie ? le.after(Z) : ie.appendChild(Z), this._scrollInlineIntoView(Z, g.threadId), this._drawer?.refreshPresentationCollapsed(), L = !0;
7355
7364
  }
7356
7365
  }
7357
7366
  }
7358
- const Y = j === "AITopPicks" || j === "AIGroupingCards", ce = j === "InlineQuestionButtons", ie = j === "ActionButtons" ? I?.props?.buttons : void 0, M = j === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray(ie) && ie.length > 0 && ie.every((G) => G.action?.type === "inputText");
7367
+ const Y = j === "AITopPicks" || j === "AIGroupingCards", ce = j === "InlineQuestionButtons", oe = j === "ActionButtons" ? I?.props?.buttons : void 0, M = j === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray(oe) && oe.length > 0 && oe.every((G) => G.action?.type === "inputText");
7359
7368
  let H = !1, ee = !1;
7360
- if (te && Q && (se.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), Y && (!g.silent || s))
7369
+ if (te && Q && (re.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), Y && (!g.silent || s))
7361
7370
  if (g.threadId && this._rememberPanelAiSpec(g.threadId, f), z) {
7362
- const G = this._renderUISpec(f, se);
7363
- U = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: G }), H = !0, F = null;
7371
+ const G = this._renderUISpec(f, re);
7372
+ O = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: G }), H = !0, F = null;
7364
7373
  } else
7365
7374
  F = f, ee = !0;
7366
7375
  ce && (this._drawer?.setInputAreaChips([]), this._drawer?.setPills([]));
7367
7376
  const pe = s && (j === "GroundingReviewCard" || Y || j === "InlineQuestionButtons");
7368
- if (!Y && (!g.silent || pe) && (oe !== "panel" || j === "ProductCard" || te && j === "ProductGrid" && !Q) && (j !== "ActionButtons" || M) && !H && !(ee && Y)) {
7377
+ if (!Y && (!g.silent || pe) && (se !== "panel" || j === "ProductCard" || te && j === "ProductGrid" && !Q) && (j !== "ActionButtons" || M) && !H && !(ee && Y)) {
7369
7378
  const G = this._shadow?.querySelector(".gengage-chat-messages");
7370
7379
  if (G) {
7371
- const J = this._renderUISpec(f, se);
7372
- g.threadId && (J.dataset.threadId = g.threadId), G.appendChild(J), this._scrollInlineIntoView(J, g.threadId), this._drawer?.refreshPresentationCollapsed(), te && j === "ProductGrid" && (P = !0);
7380
+ const J = this._renderUISpec(f, re);
7381
+ g.threadId && (J.dataset.threadId = g.threadId), G.appendChild(J), this._scrollInlineIntoView(J, g.threadId), this._drawer?.refreshPresentationCollapsed(), te && j === "ProductGrid" && (L = !0);
7373
7382
  }
7374
7383
  }
7375
7384
  if ((j === "ProductGrid" || j === "ProductCard") && g.threadId) {
7376
- const G = I?.children ?? [], J = j === "ProductGrid" ? G.map((re) => f.elements[re]?.props?.product).filter(Boolean) : [I?.props?.product].filter(Boolean);
7377
- for (const re of J) {
7378
- const Z = re.sku;
7385
+ const G = I?.children ?? [], J = j === "ProductGrid" ? G.map((ie) => f.elements[ie]?.props?.product).filter(Boolean) : [I?.props?.product].filter(Boolean);
7386
+ for (const ie of J) {
7387
+ const Z = ie.sku;
7379
7388
  Z && this._viewedProductSkus.add(Z);
7380
7389
  }
7381
7390
  }
@@ -7384,7 +7393,7 @@ var Fo = class Me extends Ya {
7384
7393
  G.length > 0 && this._bridge?.send("previewImages", { images: G });
7385
7394
  }
7386
7395
  const V = I?.children?.length ?? 0;
7387
- if (j === "ProductGrid" && oe === "panel" && !te && V > 1 && !this._isMobileViewport && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Qi(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = Xi({
7396
+ if (j === "ProductGrid" && se === "panel" && !te && V > 1 && !this._isMobileViewport && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Qi(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = Xi({
7388
7397
  heading: this._i18n.choicePrompterHeading,
7389
7398
  suggestion: this._i18n.choicePrompterSuggestion,
7390
7399
  ctaLabel: this._i18n.choicePrompterCta,
@@ -7399,19 +7408,19 @@ var Fo = class Me extends Ya {
7399
7408
  }), this._mountChoicePrompter()), j === "ActionButtons") {
7400
7409
  const G = I?.props?.buttons;
7401
7410
  if (G && G.length > 0 && !M) {
7402
- const J = [], re = [];
7411
+ const J = [], ie = [];
7403
7412
  for (const Z of G) if (Yi(Z)) {
7404
7413
  const le = {
7405
7414
  label: Z.label,
7406
7415
  action: Z.action
7407
7416
  };
7408
7417
  Z.icon && (le.icon = Z.icon), J.push(le);
7409
- } else re.push(Z);
7418
+ } else ie.push(Z);
7410
7419
  J.length > 0 && this._drawer?.setInputAreaChips(J.map((Z) => ({
7411
7420
  label: Z.label,
7412
7421
  onAction: () => this._sendAction(Z.action),
7413
7422
  ...Z.icon ? { icon: Z.icon } : {}
7414
- }))), re.length > 0 && this._drawer?.setPills(re.map((Z) => {
7423
+ }))), ie.length > 0 && this._drawer?.setPills(ie.map((Z) => {
7415
7424
  const le = {
7416
7425
  label: Z.label,
7417
7426
  onAction: () => this._sendAction(Z.action)
@@ -7427,15 +7436,15 @@ var Fo = class Me extends Ya {
7427
7436
  const S = {};
7428
7437
  this.config.actionHandling?.unknownActionPolicy !== void 0 && (S.unknownActionPolicy = this.config.actionHandling.unknownActionPolicy), this.config.actionHandling?.allowScriptCall !== void 0 && (S.allowScriptCall = this.config.actionHandling.allowScriptCall), Za(f, {
7429
7438
  openChat: () => this.open(),
7430
- navigate: (L) => {
7431
- ve(L.url) && (this._bridge?.send("navigate", L), L.newTab ? window.open(L.url, "_blank", "noopener,noreferrer") : window.location.href = L.url);
7439
+ navigate: (P) => {
7440
+ he(P.url) && (this._bridge?.send("navigate", P), P.newTab ? window.open(P.url, "_blank", "noopener,noreferrer") : window.location.href = P.url);
7432
7441
  },
7433
- saveSession: (L) => this.saveSession(L.sessionId, L.sku),
7434
- addToCart: (L) => {
7435
- this._runChatAddToCartFlow(L);
7442
+ saveSession: (P) => this.saveSession(P.sessionId, P.sku),
7443
+ addToCart: (P) => {
7444
+ this._runChatAddToCartFlow(P);
7436
7445
  },
7437
- scriptCall: (L) => {
7438
- _e("gengage:chat:script-call", L), this.config.onScriptCall?.(L);
7446
+ scriptCall: (P) => {
7447
+ _e("gengage:chat:script-call", P), this.config.onScriptCall?.(P);
7439
7448
  }
7440
7449
  }, S);
7441
7450
  }
@@ -7444,34 +7453,34 @@ var Fo = class Me extends Ya {
7444
7453
  if (!(!o && i !== this._activeRequestThreadId) && f.type === "metadata" && f.meta) {
7445
7454
  if (f.meta.panel !== void 0 || f.meta.messages !== void 0 || f.meta.message_id !== void 0) {
7446
7455
  this._lastBackendContext = f.meta;
7447
- const S = ue(f.meta.panel);
7456
+ const S = me(f.meta.panel);
7448
7457
  S && (this._modeController.updateFromContext(S), this._applyUiHints());
7449
7458
  }
7450
7459
  if (f.meta.panelLoading) {
7451
7460
  const S = typeof f.meta.panelPendingType == "string" ? f.meta.panelPendingType : void 0;
7452
- this.config.productDetailsExtended !== !0 && (S === "productDetails" || S === "productDetailsSimilars") || (k = !0, P = !1, x(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(S), this._isMobileViewport && S === "productList" && this._ensureMobilePanelOverlayVisible(), S && this._panel?.updateTopBarForLoading(S));
7461
+ this.config.productDetailsExtended !== !0 && (S === "productDetails" || S === "productDetailsSimilars") || (k = !0, L = !1, x(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(S), this._isMobileViewport && S === "productList" && this._ensureMobilePanelOverlayVisible(), S && this._panel?.updateTopBarForLoading(S));
7453
7462
  }
7454
7463
  if (f.meta.voice) {
7455
7464
  const S = new CustomEvent("gengage:chat:voice", {
7456
7465
  detail: { payload: f.meta.voice },
7457
7466
  bubbles: !1,
7458
7467
  cancelable: !0
7459
- }), L = window.dispatchEvent(S);
7460
- if (za(), L) {
7468
+ }), P = window.dispatchEvent(S);
7469
+ if (za(), P) {
7461
7470
  const $ = f.meta.voice;
7462
- $.audio_base64 && (this._activeTtsHandle?.stop(), this._activeTtsHandle = Oi($.audio_base64, $.content_type ?? "audio/ogg"));
7471
+ $.audio_base64 && (this._activeTtsHandle?.stop(), this._activeTtsHandle = Ui($.audio_base64, $.content_type ?? "audio/ogg"));
7463
7472
  }
7464
7473
  }
7465
7474
  if ((f.meta.redirectTarget || f.meta.redirect) && (_e("gengage:chat:redirect", {
7466
7475
  target: f.meta.redirectTarget ?? null,
7467
7476
  payload: f.meta.redirect ?? null
7468
- }), ze("redirect", "redirect dispatched", { target: f.meta.redirectTarget ?? null }), this._handleRedirectMetadata(f.meta.redirect)), f.meta.analyzeAnimation && this.config.productDetailsExtended === !0 && (k = !0, P = !1, x(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(), this._panel?.updateTopBarForLoading("productDetails")), f.meta.loading) {
7469
- const S = Array.isArray(f.meta.thinkingMessages) ? f.meta.thinkingMessages.filter(($) => typeof $ == "string") : [], L = typeof f.meta.loadingText == "string" ? f.meta.loadingText : void 0;
7477
+ }), ze("redirect", "redirect dispatched", { target: f.meta.redirectTarget ?? null }), this._handleRedirectMetadata(f.meta.redirect)), f.meta.analyzeAnimation && this.config.productDetailsExtended === !0 && (k = !0, L = !1, x(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(), this._panel?.updateTopBarForLoading("productDetails")), f.meta.loading) {
7478
+ const S = Array.isArray(f.meta.thinkingMessages) ? f.meta.thinkingMessages.filter(($) => typeof $ == "string") : [], P = typeof f.meta.loadingText == "string" ? f.meta.loadingText : void 0;
7470
7479
  if (S.length > 0) {
7471
- const $ = L && this._modeController.shouldCondenseThinking() ? [...S.slice(0, 2), L] : S;
7480
+ const $ = P && this._modeController.shouldCondenseThinking() ? [...S.slice(0, 2), P] : S;
7472
7481
  this._drawer?.setThinkingSteps($);
7473
7482
  }
7474
- typeof L == "string" && L.length > 0 && (this._drawer?.addThinkingStep(L), E || this._bridge?.send("loadingMessage", { text: L }));
7483
+ typeof P == "string" && P.length > 0 && (this._drawer?.addThinkingStep(P), E || this._bridge?.send("loadingMessage", { text: P }));
7475
7484
  }
7476
7485
  f.meta.visitorDataResponse && this._bridge?.send("engagingMessage", f.meta.visitorDataResponse), f.meta.formType && this._bridge?.send("glovForm", {
7477
7486
  type: f.meta.formType,
@@ -7490,20 +7499,20 @@ var Fo = class Me extends Ya {
7490
7499
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7491
7500
  streamDone: !0
7492
7501
  });
7493
- const S = P;
7494
- k && !P && v(), k = !1, this._maybeHidePreservedMobilePanel(e.type, S), P = !1;
7495
- const L = g.content != null && g.content.length > 0 || u.length > 0 || S, $ = g.silent || L, I = typeof navigator < "u" && navigator.onLine === !1 && Qt(f), j = () => {
7496
- this._shadow?.querySelector(`[data-message-id="${he(g.id)}"]`)?.remove();
7497
- const oe = this._messages.indexOf(g);
7498
- oe >= 0 && this._messages.splice(oe, 1);
7502
+ const S = L;
7503
+ k && !L && v(), k = !1, this._maybeHidePreservedMobilePanel(e.type, S), L = !1;
7504
+ const P = g.content != null && g.content.length > 0 || u.length > 0 || S, $ = g.silent || P, I = typeof navigator < "u" && navigator.onLine === !1 && Qt(f), j = () => {
7505
+ this._shadow?.querySelector(`[data-message-id="${ue(g.id)}"]`)?.remove();
7506
+ const se = this._messages.indexOf(g);
7507
+ se >= 0 && this._messages.splice(se, 1);
7499
7508
  };
7500
7509
  let Q = !1;
7501
7510
  const te = () => {
7502
7511
  if (I) return;
7503
7512
  this.emit("error", f);
7504
- const oe = f.message;
7505
- oe === this._lastErrorMessage ? this._consecutiveErrorCount++ : (this._consecutiveErrorCount = 1, this._lastErrorMessage = oe);
7506
- const se = f.message.trim(), y = se.length > 0 ? se : this._i18n.errorMessage, Y = {
7513
+ const se = f.message;
7514
+ se === this._lastErrorMessage ? this._consecutiveErrorCount++ : (this._consecutiveErrorCount = 1, this._lastErrorMessage = se);
7515
+ const re = f.message.trim(), w = re.length > 0 ? re : this._i18n.errorMessage, Y = {
7507
7516
  onRetry: () => {
7508
7517
  this._lastSentAction && this._sendAction(this._lastSentAction.action, this._lastSentAction.options);
7509
7518
  },
@@ -7515,20 +7524,20 @@ var Fo = class Me extends Ya {
7515
7524
  j(), Q = !0, this._drawer?.showErrorWithRecovery(this._i18n.accountInactiveMessage, Y);
7516
7525
  return;
7517
7526
  }
7518
- if (Eo(f, y)) {
7519
- j(), Q = !0, this._drawer?.showErrorWithRecovery(y, Y);
7527
+ if (Eo(f, w)) {
7528
+ j(), Q = !0, this._drawer?.showErrorWithRecovery(w, Y);
7520
7529
  return;
7521
7530
  }
7522
- g.content = y, g.status = "done";
7523
- const ce = be(y.replace(/\r\n/g, `
7531
+ g.content = w, g.status = "done";
7532
+ const ce = ve(w.replace(/\r\n/g, `
7524
7533
  `).split(`
7525
7534
  `).join("<br />"));
7526
7535
  this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, ce), this._drawer?.showRecoveryPillsOnly(Y);
7527
7536
  };
7528
- if (s && !L) if (c || this._hasUnavailableProductContext()) {
7537
+ if (s && !P) if (c || this._hasUnavailableProductContext()) {
7529
7538
  this._drawer?.setPills([]);
7530
- const oe = this._i18n.productNotFoundMessage;
7531
- g.content = oe, g.status = "done", this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, oe), this._markUnavailableProductContext();
7539
+ const se = this._i18n.productNotFoundMessage;
7540
+ g.content = se, g.status = "done", this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, se), this._markUnavailableProductContext();
7532
7541
  } else g.status = "done";
7533
7542
  else if ($)
7534
7543
  this._drawer?.setPills([]), g.silent || te();
@@ -7546,9 +7555,9 @@ var Fo = class Me extends Ya {
7546
7555
  spec: Q
7547
7556
  });
7548
7557
  const te = j?.type ?? "ProductGrid";
7549
- ne(Q, I, te), W(te, j, "replace", !1), P = !0;
7558
+ ne(Q, I, te), W(te, j, "replace", !1), L = !0;
7550
7559
  }
7551
- B = null, F && O(!1), C(), !o && i === this._activeRequestThreadId && (this._activeRequestThreadId = null), this._consecutiveErrorCount = 0, this._lastErrorMessage = "", r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), $n(R, {
7560
+ B = null, F && U(!1), C(), !o && i === this._activeRequestThreadId && (this._activeRequestThreadId = null), this._consecutiveErrorCount = 0, this._lastErrorMessage = "", r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), $n(R, {
7552
7561
  drawer: this._drawer,
7553
7562
  ensureRendered: () => {
7554
7563
  },
@@ -7557,12 +7566,12 @@ var Fo = class Me extends Ya {
7557
7566
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7558
7567
  streamDone: !0
7559
7568
  });
7560
- const f = P;
7561
- if (k && !P && v(), k = !1, this._maybeHidePreservedMobilePanel(e.type, f), c && !u && !f) {
7569
+ const f = L;
7570
+ if (k && !L && v(), k = !1, this._maybeHidePreservedMobilePanel(e.type, f), c && !u && !f) {
7562
7571
  const I = this._i18n.productNotFoundMessage;
7563
7572
  g.content = I, this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, I), this._markUnavailableProductContext();
7564
7573
  }
7565
- if (P = !1, s) {
7574
+ if (L = !1, s) {
7566
7575
  this._contextPrimingInFlight = !1;
7567
7576
  const I = this._queuedUserMessages.length > 0;
7568
7577
  this._flushQueuedUserMessages(), !I && c && this._ensurePdpPrimeSuggestedUiIfNeeded(l);
@@ -7570,7 +7579,7 @@ var Fo = class Me extends Ya {
7570
7579
  g.status === "streaming" && (g.status = "done", yt()), this._presentation.finalizeAssistantGroup(i);
7571
7580
  const S = this._shadow?.querySelector(".gengage-chat-comparison-toggle-btn--hidden");
7572
7581
  S && (S.classList.remove("gengage-chat-comparison-toggle-btn--hidden"), S.classList.add("gengage-chat-comparison-toggle-btn--reveal")), this.emit("message", g);
7573
- const L = this._currentPanelSource, $ = L ? this._clonePanelSourceForHistory(L) : null;
7582
+ const P = this._currentPanelSource, $ = P ? this._clonePanelSourceForHistory(P) : null;
7574
7583
  this._panel?.snapshotForMessage(g.id, $ ? {
7575
7584
  source: $,
7576
7585
  threadId: g.threadId,
@@ -7615,14 +7624,14 @@ var Fo = class Me extends Ya {
7615
7624
  if (!e) return null;
7616
7625
  const a = e.elements[e.root];
7617
7626
  if (!a || a.type !== "ProductDetailsPanel") return null;
7618
- const n = ue(a.props);
7619
- return ue(n?.product) ?? n ?? null;
7627
+ const n = me(a.props);
7628
+ return me(n?.product) ?? n ?? null;
7620
7629
  }
7621
7630
  _productGridRecordFromSpec(e, a) {
7622
7631
  if (!e) return null;
7623
7632
  const n = e.elements[e.root];
7624
7633
  if (!n || n.type !== "ProductGrid") return null;
7625
- const r = Object.values(e.elements).filter((o) => o.type === "ProductCard").map((o) => ue(o.props?.product)).filter((o) => o !== null);
7634
+ const r = Object.values(e.elements).filter((o) => o.type === "ProductCard").map((o) => me(o.props?.product)).filter((o) => o !== null);
7626
7635
  if (r.length === 0) return null;
7627
7636
  const i = this._coerceSkuKey(a);
7628
7637
  if (i) {
@@ -7633,7 +7642,7 @@ var Fo = class Me extends Ya {
7633
7642
  }
7634
7643
  _productRecordMatchesSku(e, a) {
7635
7644
  if (this._coerceSkuKey(e.sku) === a || this._coerceSkuKey(e.group_id ?? e.groupId) === a) return !0;
7636
- const n = ue(e.extras);
7645
+ const n = me(e.extras);
7637
7646
  return this._coerceSkuKey(n?.group_id ?? n?.groupId) === a;
7638
7647
  }
7639
7648
  _getCurrentPanelProductRecord() {
@@ -7789,7 +7798,7 @@ var Fo = class Me extends Ya {
7789
7798
  return;
7790
7799
  this._currentThreadId = e, this._extendedModeManager?.setHiddenByUser(!1), this._lastThreadId != null && e === this._lastThreadId ? (this._presentation.setFocusedThreadId(e), this._drawer?.setPresentationFocus(e)) : (this._presentation.releaseFocusedThread(), this._drawer?.setPresentationFocus(null)), this._drawer?.setFormerMessagesButtonVisible(!1);
7791
7800
  for (const s of this._messages) {
7792
- const c = this._shadow?.querySelector(`[data-message-id="${he(s.id)}"]`);
7801
+ const c = this._shadow?.querySelector(`[data-message-id="${ue(s.id)}"]`);
7793
7802
  c && (s.threadId && s.threadId > e ? c.classList.add("gengage-chat-bubble--hidden") : c.classList.remove("gengage-chat-bubble--hidden"));
7794
7803
  }
7795
7804
  this._shadow?.querySelectorAll("[data-thread-id]").forEach((s) => {
@@ -7849,7 +7858,7 @@ var Fo = class Me extends Ya {
7849
7858
  }
7850
7859
  _formatHistoryTimestamp(e) {
7851
7860
  try {
7852
- return new Intl.DateTimeFormat(Ue(this.config.locale), {
7861
+ return new Intl.DateTimeFormat(Oe(this.config.locale), {
7853
7862
  month: "short",
7854
7863
  day: "numeric",
7855
7864
  hour: "2-digit",
@@ -7947,7 +7956,7 @@ var Fo = class Me extends Ya {
7947
7956
  const a = this._panelThreadIdByMessageId(e.messages);
7948
7957
  if (e.panelSnapshotHtml) for (const [r, i] of Object.entries(e.panelSnapshotHtml)) {
7949
7958
  const o = document.createElement("div");
7950
- o.innerHTML = be(i), this._panel.snapshots.set(r, o);
7959
+ o.innerHTML = ve(i), this._panel.snapshots.set(r, o);
7951
7960
  }
7952
7961
  if (e.panelSnapshotTypes) for (const [r, i] of Object.entries(e.panelSnapshotTypes)) this._panel.snapshotTypes.set(r, i);
7953
7962
  this._restorePanelSnapshotSources(e.panelSnapshotSources, a), e.panelAiSpecByThread && this._restorePanelAiSpecMap(e.panelAiSpecByThread);
@@ -7972,7 +7981,7 @@ var Fo = class Me extends Ya {
7972
7981
  }
7973
7982
  if (this._currentThreadId) {
7974
7983
  const r = this._currentThreadId;
7975
- for (const i of this._messages) i.threadId && i.threadId > r && this._shadow?.querySelector(`[data-message-id="${he(i.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
7984
+ for (const i of this._messages) i.threadId && i.threadId > r && this._shadow?.querySelector(`[data-message-id="${ue(i.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
7976
7985
  this._shadow?.querySelectorAll("[data-thread-id]").forEach((i) => {
7977
7986
  i instanceof HTMLElement && i.dataset.threadId && i.dataset.threadId > r && i.classList.add("gengage-chat-bubble--hidden");
7978
7987
  });
@@ -8006,6 +8015,54 @@ var Fo = class Me extends Ya {
8006
8015
  return !1;
8007
8016
  }
8008
8017
  }
8018
+ _enrichProductMentionsWithUrls(e) {
8019
+ return e.map((a) => {
8020
+ const n = a.url?.trim();
8021
+ if (n && he(n)) return n === a.url ? a : {
8022
+ ...a,
8023
+ url: n
8024
+ };
8025
+ const r = this._productMentionUrlForSku(a.sku);
8026
+ return r ? {
8027
+ ...a,
8028
+ url: r
8029
+ } : a;
8030
+ });
8031
+ }
8032
+ _productMentionUrlForSku(e) {
8033
+ const a = e.trim(), n = (this._skuToProductItem[e] ?? (a ? this._skuToProductItem[a] : void 0))?.url;
8034
+ if (typeof n != "string") return;
8035
+ const r = n.trim();
8036
+ return r && he(r) ? r : void 0;
8037
+ }
8038
+ _handleProductNavClick(e) {
8039
+ const a = this.config.isDemoWebsite === !0, n = !a && this._isSameOriginUrl(e.url);
8040
+ if (!n) {
8041
+ const o = this._coerceSkuKey(e.sku), s = this._activeSkuForProductSummaryClick();
8042
+ if (o && s && o === s) return;
8043
+ }
8044
+ if (n) {
8045
+ _e("gengage:similar:product-click", {
8046
+ sku: e.sku,
8047
+ url: e.url,
8048
+ sessionId: this.config.session?.sessionId ?? null,
8049
+ ...e.name !== void 0 && e.name !== "" ? { productName: e.name } : {}
8050
+ }), this._saveSessionAndOpenURL(e.url);
8051
+ return;
8052
+ }
8053
+ const r = e.url.trim();
8054
+ if (!a && this.config.onProductNavigate !== void 0 && r.length > 0 && he(r)) {
8055
+ at(e.sku), this.config.onProductNavigate(r, e.sku, this.config.session?.sessionId ?? null);
8056
+ return;
8057
+ }
8058
+ at(e.sku);
8059
+ const i = e.name?.trim() ? e.name.trim() : e.sku;
8060
+ this._sendAction({
8061
+ title: i,
8062
+ type: "launchSingleProduct",
8063
+ payload: { sku: e.sku }
8064
+ });
8065
+ }
8009
8066
  _markUnavailableProductContext() {
8010
8067
  this._productContextUnavailableSku = this.config.pageContext?.sku ?? null;
8011
8068
  }
@@ -8017,7 +8074,7 @@ var Fo = class Me extends Ya {
8017
8074
  return e !== void 0 && e.length > 0 && this._productContextUnavailableSku === e;
8018
8075
  }
8019
8076
  _ensureAssistantMessageRendered(e) {
8020
- if (!(this._shadow?.querySelector(`[data-message-id="${he(e.id)}"]`) || !this._drawer)) {
8077
+ if (!(this._shadow?.querySelector(`[data-message-id="${ue(e.id)}"]`) || !this._drawer)) {
8021
8078
  if (e.role === "assistant" && e.threadId && !this._threadsWithFirstBot.has(e.threadId)) {
8022
8079
  this._threadsWithFirstBot.add(e.threadId), this._drawer.addMessage(e), this._drawer.markFirstBotMessage(e.id);
8023
8080
  return;
@@ -8045,7 +8102,7 @@ var Fo = class Me extends Ya {
8045
8102
  const s = this._panelThreadIdByMessageId(i.messages);
8046
8103
  if (i.panelSnapshotHtml) for (const [l, d] of Object.entries(i.panelSnapshotHtml)) {
8047
8104
  const p = document.createElement("div");
8048
- p.innerHTML = be(d), this._panel.snapshots.set(l, p);
8105
+ p.innerHTML = ve(d), this._panel.snapshots.set(l, p);
8049
8106
  }
8050
8107
  if (i.panelSnapshotTypes) for (const [l, d] of Object.entries(i.panelSnapshotTypes)) this._panel.snapshotTypes.set(l, d);
8051
8108
  this._restorePanelSnapshotSources(i.panelSnapshotSources, s), i.panelAiSpecByThread && this._restorePanelAiSpecMap(i.panelAiSpecByThread);
@@ -8077,7 +8134,7 @@ var Fo = class Me extends Ya {
8077
8134
  }
8078
8135
  if (this._currentThreadId) {
8079
8136
  const l = this._currentThreadId;
8080
- for (const d of this._messages) d.threadId && d.threadId > l && this._shadow?.querySelector(`[data-message-id="${he(d.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
8137
+ for (const d of this._messages) d.threadId && d.threadId > l && this._shadow?.querySelector(`[data-message-id="${ue(d.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
8081
8138
  this._shadow?.querySelectorAll("[data-thread-id]").forEach((d) => {
8082
8139
  d instanceof HTMLElement && d.dataset.threadId && d.dataset.threadId > l && d.classList.add("gengage-chat-bubble--hidden");
8083
8140
  });
@@ -8124,7 +8181,7 @@ var Fo = class Me extends Ya {
8124
8181
  });
8125
8182
  return;
8126
8183
  }
8127
- this._comparisonSelectedSkus = [...this._comparisonSelectedSkus, e], this._comparisonSelectionWarning = null, Oa(e);
8184
+ this._comparisonSelectedSkus = [...this._comparisonSelectedSkus, e], this._comparisonSelectionWarning = null, Ua(e);
8128
8185
  }
8129
8186
  this._comparisonRefreshRafId !== null && cancelAnimationFrame(this._comparisonRefreshRafId), this._comparisonRefreshRafId = requestAnimationFrame(() => {
8130
8187
  this._comparisonRefreshRafId = null, this._refreshComparisonUI();
@@ -8215,10 +8272,10 @@ var Fo = class Me extends Ya {
8215
8272
  return a ? (this._runChatAddToCartFlow(a), !0) : !1;
8216
8273
  }
8217
8274
  _resolveCurrentProductAddToCartParams() {
8218
- const e = ue(this.config.pageContext?.extra), a = this._activeSkuForProductSummaryClick() ?? this._coerceSkuKey(this._bridgeContext?.sku), n = this.config.pageContext?.pageType === "pdp", r = this._getCurrentPanelProductRecord(), i = n ? this._getCurrentPanelProductGridRecord(a) : null, o = n ? this._getInlinePdpProductRecord() : null;
8275
+ const e = me(this.config.pageContext?.extra), a = this._activeSkuForProductSummaryClick() ?? this._coerceSkuKey(this._bridgeContext?.sku), n = this.config.pageContext?.pageType === "pdp", r = this._getCurrentPanelProductRecord(), i = n ? this._getCurrentPanelProductGridRecord(a) : null, o = n ? this._getInlinePdpProductRecord() : null;
8219
8276
  if (!r && !i && this._currentPanelSource && !o) return null;
8220
8277
  const s = [r, i];
8221
- n && s.push(o), this._currentPanelSource || (s.push(this._getLatestProductDetailsRecord()), n && s.push(this._getLatestProductGridRecord(a))), n && s.push(ue(this._bridgeContext?.product), ue(this._bridgeContext?.productDetails), this._bridgeContext, ue(e?.product), ue(e?.productDetails), e);
8278
+ n && s.push(o), this._currentPanelSource || (s.push(this._getLatestProductDetailsRecord()), n && s.push(this._getLatestProductGridRecord(a))), n && s.push(me(this._bridgeContext?.product), me(this._bridgeContext?.productDetails), this._bridgeContext, me(e?.product), me(e?.productDetails), e);
8222
8279
  for (const c of s) {
8223
8280
  const l = this._extractAddToCartParamsFromRecord(c, a);
8224
8281
  if (l) return l;
@@ -8287,7 +8344,7 @@ var Fo = class Me extends Ya {
8287
8344
  }
8288
8345
  _buildRenderContext() {
8289
8346
  const e = {
8290
- locale: Ue(this.config.locale),
8347
+ locale: Oe(this.config.locale),
8291
8348
  onAction: (a) => {
8292
8349
  if (a.type === "frontend_restore_panel_message") {
8293
8350
  this._restorePanelFromFrontendMessage(a.payload);
@@ -8318,32 +8375,7 @@ var Fo = class Me extends Ya {
8318
8375
  this._sendAction(a, n ? { preservePanel: !0 } : void 0);
8319
8376
  },
8320
8377
  onProductClick: (a) => {
8321
- const n = this.config.isDemoWebsite === !0, r = !n && this._isSameOriginUrl(a.url);
8322
- if (!r) {
8323
- const s = this._coerceSkuKey(a.sku), c = this._activeSkuForProductSummaryClick();
8324
- if (s && c && s === c) return;
8325
- }
8326
- if (r) {
8327
- _e("gengage:similar:product-click", {
8328
- sku: a.sku,
8329
- url: a.url,
8330
- sessionId: this.config.session?.sessionId ?? null,
8331
- ...a.name !== void 0 && a.name !== "" ? { productName: a.name } : {}
8332
- }), this._saveSessionAndOpenURL(a.url);
8333
- return;
8334
- }
8335
- const i = a.url.trim();
8336
- if (!n && this.config.onProductNavigate !== void 0 && i.length > 0 && ve(i)) {
8337
- at(a.sku), this.config.onProductNavigate(i, a.sku, this.config.session?.sessionId ?? null);
8338
- return;
8339
- }
8340
- at(a.sku);
8341
- const o = a.name?.trim() ? a.name.trim() : a.sku;
8342
- this._sendAction({
8343
- title: o,
8344
- type: "launchSingleProduct",
8345
- payload: { sku: a.sku }
8346
- });
8378
+ this._handleProductNavClick(a);
8347
8379
  },
8348
8380
  onAddToCart: (a) => {
8349
8381
  this._runChatAddToCartFlow(a);
@@ -8416,7 +8448,7 @@ var Fo = class Me extends Ya {
8416
8448
  await this._session.toggleFavorite(n, r, e, a), this._drawer?.updateFavoritesBadge(this._session.favoritedSkus.size);
8417
8449
  }
8418
8450
  _revertFavoriteHeartUi(e) {
8419
- const a = this._shadow?.querySelectorAll(`[data-gengage-favorite-sku="${he(e)}"]`);
8451
+ const a = this._shadow?.querySelectorAll(`[data-gengage-favorite-sku="${ue(e)}"]`);
8420
8452
  if (a?.length)
8421
8453
  for (const n of a) {
8422
8454
  if (!(n instanceof HTMLButtonElement)) continue;
@@ -8682,7 +8714,7 @@ var Fo = class Me extends Ya {
8682
8714
  _renderUISpec(e, a) {
8683
8715
  const n = e.elements[e.root];
8684
8716
  if (n?.type === "ProductSummaryCard") {
8685
- const c = ue(n.props), l = ue(c?.product) ?? c;
8717
+ const c = me(n.props), l = me(c?.product) ?? c;
8686
8718
  l && (this._currentInlineProductSummaryRecord = l);
8687
8719
  }
8688
8720
  const r = this._resolveUISpecRegistry(), i = this.config.renderer?.unknownRenderer ?? da, o = (c, l) => Fr(c, l, r, i), s = this.config.renderer?.renderUISpec;