@gengage/assistant-fe 0.6.7 → 0.6.9

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,7 +1,7 @@
1
- import { c as ya, d as wa, h as _a, p as ka, r as Ca, s as $t, t as Sa } from "./api-paths-Dkah8jhG.js";
1
+ import { c as ya, d as wa, h as _a, p as ka, r as Ca, s as $t, t as Sa } from "./api-paths-S93j7yKr.js";
2
2
  import { A as we, C as Ea, D as Pa, E as La, M as oe, N as pe, O as Aa, S as ft, T as Ta, _ as Ia, a as xe, b as Ma, d as Na, f as Ba, g as za, h as Ra, j as me, l as Ha, m as Fa, p as Da, u as Oa, v as Ua, w as Qe, x as ja } from "./context-BBuSsXZ9.js";
3
- import { i as Ne, s as Wt, t as Va } from "./widget-base-Cafa292X.js";
4
- import { d as le, f as qa, i as Ga, n as $a, p as Wa, r as Ka, t as bt, u as Ya } from "./fastIntent-HK3SqGgn.js";
3
+ import { i as Ne, s as Wt, t as Va } from "./widget-base-D_8sXVsm.js";
4
+ import { d as le, f as qa, i as Ga, n as $a, p as Wa, r as Ka, t as bt, u as Ya } from "./fastIntent-3UpvC7fR.js";
5
5
  import { t as De } from "./locale-CfqNifrU.js";
6
6
  import { a as Kt, i as Yt, n as ue, r as Zt, t as J } from "./price-formatter-xI3g9Cd4.js";
7
7
  function vt() {
@@ -869,31 +869,31 @@ var Ln = class {
869
869
  }
870
870
  m.appendChild(v), r && i.insertBefore(r, i.firstChild), i.appendChild(m);
871
871
  {
872
- let $ = 0, ae = 0, re = !1;
873
- const ie = (Y) => {
872
+ let $ = 0, te = 0, ne = !1;
873
+ const re = (Y) => {
874
874
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || Y.target.closest('button, a, input, [role="button"]')) return;
875
875
  const Z = Y.changedTouches?.[0];
876
- Z && ($ = Z.clientY, ae = 0, re = !0, this.root.style.transition = "none");
876
+ Z && ($ = Z.clientY, te = 0, ne = !0, this.root.style.transition = "none");
877
877
  }, he = (Y) => {
878
- if (!re) return;
878
+ if (!ne) return;
879
879
  const Z = Y.changedTouches?.[0];
880
880
  if (!Z) return;
881
- ae = Z.clientY - $;
882
- const W = (e.getMobileState?.() ?? "full") === "full" ? Math.max(0, ae) : ae;
881
+ te = Z.clientY - $;
882
+ const W = (e.getMobileState?.() ?? "full") === "full" ? Math.max(0, te) : te;
883
883
  Y.preventDefault(), this.root.style.transform = `translateY(${W}px)`;
884
884
  }, fe = () => {
885
- if (!re) return;
886
- re = !1;
885
+ if (!ne) return;
886
+ ne = !1;
887
887
  const Y = e.getMobileState?.() ?? "full";
888
888
  let Z;
889
- ae > 72 ? Z = Y === "full" ? "half" : "close" : ae < -72 && Y === "half" ? Z = "full" : Z = Y, this.root.style.transition = "", Z === "close" ? (this.root.style.transform = "translateY(100%)", setTimeout(() => {
889
+ te > 72 ? Z = Y === "full" ? "half" : "close" : te < -72 && Y === "half" ? Z = "full" : Z = Y, this.root.style.transition = "", Z === "close" ? (this.root.style.transform = "translateY(100%)", setTimeout(() => {
890
890
  this.root.style.transform = "", e.onMobileSnap?.("close");
891
- }, 280)) : (this.root.style.transform = "", e.onMobileSnap?.(Z)), ae = 0;
892
- }, z = () => {
893
- re && (re = !1, ae = 0, this.root.style.transition = "", this.root.style.transform = "");
891
+ }, 280)) : (this.root.style.transform = "", e.onMobileSnap?.(Z)), te = 0;
892
+ }, R = () => {
893
+ ne && (ne = !1, te = 0, this.root.style.transition = "", this.root.style.transform = "");
894
894
  };
895
- i.addEventListener("touchstart", ie, { passive: !0 }), i.addEventListener("touchmove", he, { passive: !1 }), i.addEventListener("touchend", fe, { passive: !0 }), i.addEventListener("touchcancel", z, { passive: !0 }), this._cleanups.push(() => {
896
- i.removeEventListener("touchstart", ie), i.removeEventListener("touchmove", he), i.removeEventListener("touchend", fe), i.removeEventListener("touchcancel", z);
895
+ i.addEventListener("touchstart", re, { passive: !0 }), i.addEventListener("touchmove", he, { passive: !1 }), i.addEventListener("touchend", fe, { passive: !0 }), i.addEventListener("touchcancel", R, { passive: !0 }), this._cleanups.push(() => {
896
+ i.removeEventListener("touchstart", re), i.removeEventListener("touchmove", he), i.removeEventListener("touchend", fe), i.removeEventListener("touchcancel", R);
897
897
  });
898
898
  }
899
899
  const b = document.createElement("div");
@@ -926,10 +926,10 @@ var Ln = class {
926
926
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || P === null || y === null) return;
927
927
  const $ = x.changedTouches?.[0];
928
928
  if (!$) return;
929
- const ae = $.clientX - P, re = $.clientY - y;
930
- if (P = null, y = null, Math.abs(re) < w || Math.abs(re) < Math.abs(ae)) return;
931
- const ie = re < 0;
932
- ie !== this._panelCollapsed && (this._ignoreNextDividerClick = !0, this.setPanelCollapsed(ie), this._onPanelToggle?.());
929
+ const te = $.clientX - P, ne = $.clientY - y;
930
+ if (P = null, y = null, Math.abs(ne) < w || Math.abs(ne) < Math.abs(te)) return;
931
+ const re = ne < 0;
932
+ re !== this._panelCollapsed && (this._ignoreNextDividerClick = !0, this.setPanelCollapsed(re), this._onPanelToggle?.());
933
933
  };
934
934
  this._dividerEl.addEventListener("touchstart", B, { passive: !0 }), this._dividerEl.addEventListener("touchend", T, { passive: !0 }), this._cleanups.push(() => {
935
935
  this._dividerEl.removeEventListener("touchstart", B), this._dividerEl.removeEventListener("touchend", T);
@@ -938,9 +938,9 @@ var Ln = class {
938
938
  _.className = "gengage-chat-conversation", _.dataset.gengagePart = "chat-conversation", this._conversationEl = _, _.appendChild(i);
939
939
  const C = document.createElement("div");
940
940
  C.className = "gengage-chat-offline-bar gds-evidence-card gds-evidence-card-warning", C.dataset.gengagePart = "chat-offline-bar", C.setAttribute("role", "status"), C.setAttribute("aria-live", "polite"), C.textContent = this.i18n.offlineMessage, typeof navigator < "u" && !navigator.onLine && C.classList.add("gengage-chat-offline-bar--visible"), _.appendChild(C);
941
- const R = () => C.classList.add("gengage-chat-offline-bar--visible"), G = () => C.classList.remove("gengage-chat-offline-bar--visible");
942
- window.addEventListener("offline", R), window.addEventListener("online", G), this._cleanups.push(() => {
943
- window.removeEventListener("offline", R), window.removeEventListener("online", G);
941
+ const H = () => C.classList.add("gengage-chat-offline-bar--visible"), q = () => C.classList.remove("gengage-chat-offline-bar--visible");
942
+ window.addEventListener("offline", H), window.addEventListener("online", q), this._cleanups.push(() => {
943
+ window.removeEventListener("offline", H), window.removeEventListener("online", q);
944
944
  }), this._kvkkSlot = document.createElement("div"), this._kvkkSlot.className = "gengage-chat-kvkk-slot", this._kvkkSlot.dataset.gengagePart = "chat-kvkk-slot", _.appendChild(this._kvkkSlot), this.messagesEl = document.createElement("div"), this.messagesEl.id = ot, 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), yt(this.messagesEl);
945
945
  const X = document.createElement("button");
946
946
  X.type = "button", X.className = "gengage-chat-former-messages-btn gds-chip", X.dataset.gengagePart = "chat-former-messages-button", X.textContent = this.i18n.showFormerMessagesButton, X.setAttribute("aria-label", this.i18n.showFormerMessagesButton), X.style.display = "none", X.addEventListener("click", () => {
@@ -953,10 +953,10 @@ var Ln = class {
953
953
  const M = () => this._options.presentation, N = () => {
954
954
  L || (L = !0, requestAnimationFrame(() => {
955
955
  L = !1;
956
- const { scrollTop: x, scrollHeight: $, clientHeight: ae } = this.messagesEl, re = $ - x - ae;
957
- this._userScrolledUp = re > 10;
958
- const ie = this._presentationPinned ? re < 96 : re < 32, he = Date.now(), fe = he < this._programmaticScrollUntil, z = !ie && he < this._userInteractionUntil, Y = fe ? !1 : z;
959
- ie !== this._presentationPinned && (this._presentationPinned = ie, M()?.onPinnedToBottomChange?.(ie)), Y !== this._presentationUserInteracting && (this._presentationUserInteracting = Y, M()?.onUserInteractingChange?.(Y));
956
+ const { scrollTop: x, scrollHeight: $, clientHeight: te } = this.messagesEl, ne = $ - x - te;
957
+ this._userScrolledUp = ne > 10;
958
+ const re = this._presentationPinned ? ne < 96 : ne < 32, he = Date.now(), fe = he < this._programmaticScrollUntil, R = !re && he < this._userInteractionUntil, Y = fe ? !1 : R;
959
+ re !== this._presentationPinned && (this._presentationPinned = re, M()?.onPinnedToBottomChange?.(re)), Y !== this._presentationUserInteracting && (this._presentationUserInteracting = Y, M()?.onUserInteractingChange?.(Y));
960
960
  }));
961
961
  };
962
962
  this.messagesEl.addEventListener("scroll", N, { passive: !0 }), this._cleanups.push(() => {
@@ -966,15 +966,15 @@ var Ln = class {
966
966
  E(), x.deltaY < -6 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
967
967
  };
968
968
  this.messagesEl.addEventListener("wheel", k, { passive: !0 }), this._cleanups.push(() => this.messagesEl.removeEventListener("wheel", k));
969
- const H = (x) => {
969
+ const F = (x) => {
970
970
  E(), this._touchStartY = x.touches[0]?.clientY ?? null;
971
971
  }, j = (x) => {
972
972
  E();
973
- const $ = x.touches[0]?.clientY, ae = this._touchStartY;
974
- typeof $ == "number" && typeof ae == "number" && $ - ae > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
973
+ const $ = x.touches[0]?.clientY, te = this._touchStartY;
974
+ typeof $ == "number" && typeof te == "number" && $ - te > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
975
975
  };
976
- this.messagesEl.addEventListener("touchstart", H, { passive: !0 }), this.messagesEl.addEventListener("touchmove", j, { passive: !0 }), this._cleanups.push(() => {
977
- this.messagesEl.removeEventListener("touchstart", H), this.messagesEl.removeEventListener("touchmove", j);
976
+ this.messagesEl.addEventListener("touchstart", F, { passive: !0 }), this.messagesEl.addEventListener("touchmove", j, { passive: !0 }), this._cleanups.push(() => {
977
+ this.messagesEl.removeEventListener("touchstart", F), this.messagesEl.removeEventListener("touchmove", j);
978
978
  }), _.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";
979
979
  const V = document.createElement("div");
980
980
  V.className = "gengage-chat-pills-scroll", V.dataset.gengagePart = "chat-suggestion-pills-scroll", this._pillsEl.appendChild(V);
@@ -1006,20 +1006,20 @@ var Ln = class {
1006
1006
  }), this.inputEl.addEventListener("paste", (x) => {
1007
1007
  const $ = x.clipboardData;
1008
1008
  if (!$) return;
1009
- let ae = null;
1010
- const re = $.files?.[0];
1011
- if (re && re.type.startsWith("image/")) ae = re;
1012
- else if ($.items?.length) for (let ie = 0; ie < $.items.length; ie++) {
1013
- const he = $.items[ie];
1009
+ let te = null;
1010
+ const ne = $.files?.[0];
1011
+ if (ne && ne.type.startsWith("image/")) te = ne;
1012
+ else if ($.items?.length) for (let re = 0; re < $.items.length; re++) {
1013
+ const he = $.items[re];
1014
1014
  if (he?.kind === "file" && he.type.startsWith("image/")) {
1015
1015
  const fe = he.getAsFile();
1016
1016
  if (fe) {
1017
- ae = fe;
1017
+ te = fe;
1018
1018
  break;
1019
1019
  }
1020
1020
  }
1021
1021
  }
1022
- ae && (x.preventDefault(), this._routeAttachmentFile(ae));
1022
+ te && (x.preventDefault(), this._routeAttachmentFile(te));
1023
1023
  }), 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", () => {
1024
1024
  const x = this._fileInput.files?.[0];
1025
1025
  x && this._routeAttachmentFile(x), this._fileInput.value = "";
@@ -1038,16 +1038,16 @@ var Ln = class {
1038
1038
  });
1039
1039
  const I = document.createElement("div");
1040
1040
  I.className = "gengage-chat-attach-menu-sep", I.dataset.gengagePart = "chat-attach-menu-separator", I.setAttribute("aria-hidden", "true");
1041
- const F = document.createElement("button");
1042
- F.type = "button", F.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", F.dataset.gengagePart = "chat-attach-menu-paste", F.setAttribute("role", "menuitem"), F.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>`, F.addEventListener("click", (x) => {
1041
+ const z = document.createElement("button");
1042
+ z.type = "button", z.className = "gengage-chat-attach-menu-item gds-btn gds-btn-ghost", z.dataset.gengagePart = "chat-attach-menu-paste", z.setAttribute("role", "menuitem"), z.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>`, z.addEventListener("click", (x) => {
1043
1043
  x.stopPropagation();
1044
1044
  const $ = typeof navigator.clipboard?.read == "function" ? navigator.clipboard.read() : void 0;
1045
1045
  this._pasteImageFromClipboardMenu($);
1046
- }), A.appendChild(O), A.appendChild(I), A.appendChild(F), f.appendChild(S), f.appendChild(A), 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";
1047
- const q = document.createElement("img");
1048
- q.className = "gengage-chat-attachment-preview-thumb", q.dataset.gengagePart = "chat-attachment-preview-thumb", q.alt = "", this._previewName = document.createElement("span"), this._previewName.className = "gengage-chat-attachment-name", this._previewName.dataset.gengagePart = "chat-attachment-preview-name";
1049
- const ee = document.createElement("button");
1050
- ee.className = "gengage-chat-attachment-remove gds-btn gds-btn-ghost", ee.dataset.gengagePart = "chat-attachment-preview-remove", ee.type = "button", ee.setAttribute("aria-label", this.i18n.removeAttachmentButton), ee.textContent = "×", ee.addEventListener("click", () => this.clearAttachment()), this._previewStrip.appendChild(q), this._previewStrip.appendChild(this._previewName), this._previewStrip.appendChild(ee), 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", () => {
1046
+ }), A.appendChild(O), A.appendChild(I), A.appendChild(z), f.appendChild(S), f.appendChild(A), 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";
1047
+ const G = document.createElement("img");
1048
+ G.className = "gengage-chat-attachment-preview-thumb", G.dataset.gengagePart = "chat-attachment-preview-thumb", G.alt = "", this._previewName = document.createElement("span"), this._previewName.className = "gengage-chat-attachment-name", this._previewName.dataset.gengagePart = "chat-attachment-preview-name";
1049
+ const ae = document.createElement("button");
1050
+ ae.className = "gengage-chat-attachment-remove gds-btn gds-btn-ghost", ae.dataset.gengagePart = "chat-attachment-preview-remove", ae.type = "button", ae.setAttribute("aria-label", this.i18n.removeAttachmentButton), ae.textContent = "×", ae.addEventListener("click", () => this.clearAttachment()), this._previewStrip.appendChild(G), this._previewStrip.appendChild(this._previewName), this._previewStrip.appendChild(ae), 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", () => {
1051
1051
  if (this._sendStopHandler) {
1052
1052
  const x = this._sendStopHandler;
1053
1053
  this.hideStopButton(), x();
@@ -1063,8 +1063,8 @@ var Ln = class {
1063
1063
  const $ = x.dataTransfer?.files[0];
1064
1064
  $ && this._routeAttachmentFile($);
1065
1065
  });
1066
- const te = document.createElement("div");
1067
- te.className = "gengage-chat-input-pill gds-input-shell", te.dataset.gengagePart = "chat-input-shell", te.appendChild(f), te.appendChild(this.inputEl), this._voiceEnabled && Ga() && (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 Ka({
1066
+ const ee = document.createElement("div");
1067
+ ee.className = "gengage-chat-input-pill gds-input-shell", ee.dataset.gengagePart = "chat-input-shell", ee.appendChild(f), ee.appendChild(this.inputEl), this._voiceEnabled && Ga() && (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()), ee.appendChild(this._micBtn), this._voiceInput = new Ka({
1068
1068
  onInterim: (x) => {
1069
1069
  this._resizeRafId !== null && (cancelAnimationFrame(this._resizeRafId), this._resizeRafId = null), this.inputEl.value = x, this.inputEl.style.height = "auto", this.inputEl.style.height = `${Math.min(this.inputEl.scrollHeight, 120)}px`;
1070
1070
  },
@@ -1080,9 +1080,9 @@ var Ln = class {
1080
1080
  onError: (x, $) => {
1081
1081
  this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1082
1082
  }
1083
- }, { lang: this._voiceLang })), te.appendChild(this.sendBtn), U.appendChild(this._previewStrip), U.appendChild(this._fileInput), U.appendChild(te), _.appendChild(U), b.appendChild(_), this._comparisonDockSlotEl = document.createElement("div"), this._comparisonDockSlotEl.className = "gengage-chat-comparison-dock-slot", this._comparisonDockSlotEl.dataset.gengagePart = "comparison-dock-slot", b.appendChild(this._comparisonDockSlotEl), this.root.appendChild(b), this._setupHorizontalSwipe(_);
1084
- const ne = document.createElement("div");
1085
- ne.className = "gengage-chat-footer", ne.dataset.gengagePart = "chat-footer", ne.textContent = this.i18n.poweredBy, this.root.appendChild(ne);
1083
+ }, { lang: this._voiceLang })), ee.appendChild(this.sendBtn), U.appendChild(this._previewStrip), U.appendChild(this._fileInput), U.appendChild(ee), _.appendChild(U), b.appendChild(_), this._comparisonDockSlotEl = document.createElement("div"), this._comparisonDockSlotEl.className = "gengage-chat-comparison-dock-slot", this._comparisonDockSlotEl.dataset.gengagePart = "comparison-dock-slot", b.appendChild(this._comparisonDockSlotEl), this.root.appendChild(b), this._setupHorizontalSwipe(_);
1084
+ const ie = document.createElement("div");
1085
+ ie.className = "gengage-chat-footer", ie.dataset.gengagePart = "chat-footer", ie.textContent = this.i18n.poweredBy, this.root.appendChild(ie);
1086
1086
  const se = (x) => {
1087
1087
  x.key === "Escape" && e.onClose();
1088
1088
  };
@@ -1444,8 +1444,8 @@ var Ln = class {
1444
1444
  const v = document.createElement("ul");
1445
1445
  v.className = "gengage-chat-comparison-skeleton-hl-list";
1446
1446
  for (let _ = 0; _ < 3; _++) {
1447
- const C = document.createElement("li"), R = document.createElement("div");
1448
- R.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", _ === 1 && R.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), _ === 2 && R.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), C.appendChild(R), v.appendChild(C);
1447
+ const C = document.createElement("li"), H = document.createElement("div");
1448
+ H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", _ === 1 && H.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), _ === 2 && H.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), C.appendChild(H), v.appendChild(C);
1449
1449
  }
1450
1450
  h.appendChild(v), o.appendChild(h), i.appendChild(o);
1451
1451
  const b = document.createElement("div");
@@ -1472,20 +1472,20 @@ var Ln = class {
1472
1472
  for (let _ = 0; _ < 3; _++) {
1473
1473
  const C = document.createElement("div");
1474
1474
  C.className = "gengage-chat-comparison-skeleton-table-col";
1475
- const R = document.createElement("div");
1476
- R.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1477
- const G = document.createElement("div");
1478
- G.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1475
+ const H = document.createElement("div");
1476
+ H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1477
+ const q = document.createElement("div");
1478
+ q.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1479
1479
  const X = document.createElement("div");
1480
- X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", C.appendChild(R), C.appendChild(G), C.appendChild(X), B.appendChild(C);
1480
+ X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", C.appendChild(H), C.appendChild(q), C.appendChild(X), B.appendChild(C);
1481
1481
  }
1482
1482
  w.appendChild(B);
1483
1483
  for (let _ = 0; _ < 3; _++) {
1484
1484
  const C = document.createElement("div");
1485
1485
  C.className = "gengage-chat-comparison-skeleton-table-row";
1486
- const R = document.createElement("div");
1487
- R.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", C.appendChild(R);
1488
- for (let G = 0; G < 3; G++) {
1486
+ const H = document.createElement("div");
1487
+ H.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", C.appendChild(H);
1488
+ for (let q = 0; q < 3; q++) {
1489
1489
  const X = document.createElement("div");
1490
1490
  X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", C.appendChild(X);
1491
1491
  }
@@ -2511,8 +2511,8 @@ function Lt(t, e, a, n) {
2511
2511
  const _ = document.createElement("div");
2512
2512
  if (_.className = "gengage-chat-ai-toppick-spinner", _.dataset.gengagePart = "ai-top-pick-spinner", _.style.display = B ? "" : "none", r.appendChild(_), T) {
2513
2513
  const C = document.createElement("button");
2514
- C.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", C.dataset.gengagePart = "ai-top-pick-cta", C.type = "button", C.textContent = g ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", C.addEventListener("click", (R) => {
2515
- if (R.stopPropagation(), g) {
2514
+ C.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", C.dataset.gengagePart = "ai-top-pick-cta", C.type = "button", C.textContent = g ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", C.addEventListener("click", (H) => {
2515
+ if (H.stopPropagation(), g) {
2516
2516
  e.onAction({
2517
2517
  title: e.i18n?.addToCartButton ?? "Add to Cart",
2518
2518
  type: "addToCart",
@@ -2526,11 +2526,11 @@ function Lt(t, e, a, n) {
2526
2526
  }
2527
2527
  if (h) {
2528
2528
  if (h.type === "findSimilar" && s && e.onProductClick) {
2529
- const G = o.name;
2529
+ const q = o.name;
2530
2530
  e.onProductClick({
2531
2531
  sku: s,
2532
2532
  url: c,
2533
- ...G ? { name: G } : {}
2533
+ ...q ? { name: q } : {}
2534
2534
  });
2535
2535
  return;
2536
2536
  }
@@ -2967,8 +2967,8 @@ function Lr(t, e) {
2967
2967
  w.classList.add("gengage-chat-product-summary__price--inline"), w.appendChild(_);
2968
2968
  const C = document.createElement("span");
2969
2969
  C.className = "gengage-chat-product-summary__price-sep", C.setAttribute("aria-hidden", "true");
2970
- const R = document.createElement("span");
2971
- R.className = "gengage-chat-product-summary__price-original", R.textContent = J(g, e.pricing), w.appendChild(C), w.appendChild(R);
2970
+ const H = document.createElement("span");
2971
+ H.className = "gengage-chat-product-summary__price-original", H.textContent = J(g, e.pricing), w.appendChild(C), w.appendChild(H);
2972
2972
  } else {
2973
2973
  const C = document.createElement("span");
2974
2974
  C.className = "gengage-chat-product-summary__price-original", C.textContent = J(g, e.pricing), w.appendChild(C), w.appendChild(document.createTextNode(" ")), w.appendChild(_);
@@ -2981,8 +2981,8 @@ function Lr(t, e) {
2981
2981
  _.className = "gengage-chat-product-summary__price-current", _.textContent = J(p, e.pricing);
2982
2982
  const C = document.createElement("span");
2983
2983
  C.className = "gengage-chat-product-summary__price-sep", C.setAttribute("aria-hidden", "true");
2984
- const R = document.createElement("span");
2985
- R.className = "gengage-chat-product-summary__price-original", R.textContent = J(g, e.pricing), w.appendChild(_), w.appendChild(C), w.appendChild(R);
2984
+ const H = document.createElement("span");
2985
+ H.className = "gengage-chat-product-summary__price-original", H.textContent = J(g, e.pricing), w.appendChild(_), w.appendChild(C), w.appendChild(H);
2986
2986
  } else if (y) {
2987
2987
  const _ = document.createElement("span");
2988
2988
  _.className = "gengage-chat-product-summary__price-original", _.textContent = J(g, e.pricing), w.appendChild(_), w.appendChild(document.createTextNode(" "));
@@ -3207,10 +3207,10 @@ function ct(t, e) {
3207
3207
  if (g && me(g)) {
3208
3208
  const k = document.createElement("div");
3209
3209
  k.className = "gengage-chat-product-card-img-wrapper";
3210
- const H = document.createElement("img");
3211
- H.className = "gengage-chat-product-card-img", H.loading = "lazy", oe(H, "src", g);
3210
+ const F = document.createElement("img");
3211
+ F.className = "gengage-chat-product-card-img", F.loading = "lazy", oe(F, "src", g);
3212
3212
  const j = n.name;
3213
- j && (H.alt = j), ue(H), k.appendChild(H);
3213
+ j && (F.alt = j), ue(F), k.appendChild(F);
3214
3214
  const V = n.discountPercent;
3215
3215
  if (!e.hideProductDiscountBadge && typeof V == "number" && V > 0) {
3216
3216
  const f = document.createElement("span");
@@ -3251,31 +3251,31 @@ function ct(t, e) {
3251
3251
  const k = document.createElement("div");
3252
3252
  k.className = "gengage-chat-product-card-brand", k.textContent = m, h.appendChild(k);
3253
3253
  }
3254
- const v = n.rating, b = n.reviewCount, u = n.price, d = n.originalPrice, P = n.price_async, y = ze(e, n), w = Ue(e, n), B = !!(d && u && d !== u && parseFloat(u) > 0), T = !!(y && B), _ = !!(y && !T || B && w === "inline"), C = typeof v == "number" && Number.isFinite(v) && v > 0, R = document.createElement("div");
3255
- R.className = "gengage-chat-product-card-meta-row";
3256
- const G = document.createElement("div");
3257
- G.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3254
+ const v = n.rating, b = n.reviewCount, u = n.price, d = n.originalPrice, P = n.price_async, y = ze(e, n), w = Ue(e, n), B = !!(d && u && d !== u && parseFloat(u) > 0), T = !!(y && B), _ = !!(y && !T || B && w === "inline"), C = typeof v == "number" && Number.isFinite(v) && v > 0, H = document.createElement("div");
3255
+ H.className = "gengage-chat-product-card-meta-row";
3256
+ const q = document.createElement("div");
3257
+ q.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3258
3258
  const X = _ ? (() => {
3259
3259
  const k = document.createElement("div");
3260
- return k.className = "gengage-chat-product-card-price-stack", y && !T && k.appendChild(Ke(y)), k.appendChild(G), k;
3261
- })() : G;
3260
+ return k.className = "gengage-chat-product-card-price-stack", y && !T && k.appendChild(Ke(y)), k.appendChild(q), k;
3261
+ })() : q;
3262
3262
  if (P === !0) {
3263
3263
  const k = document.createElement("span");
3264
- k.className = "gengage-chat-price-skeleton", G.appendChild(k), setTimeout(() => {
3265
- k.parentElement && (u && parseFloat(u) > 0 ? At(G, e, n, u, n.originalPrice) : k.remove());
3264
+ k.className = "gengage-chat-price-skeleton", q.appendChild(k), setTimeout(() => {
3265
+ k.parentElement && (u && parseFloat(u) > 0 ? At(q, e, n, u, n.originalPrice) : k.remove());
3266
3266
  }, 300);
3267
- } else u && parseFloat(u) > 0 && At(G, e, n, u, d);
3268
- if ((G.childElementCount > 0 || P === !0) && R.appendChild(X), C) {
3267
+ } else u && parseFloat(u) > 0 && At(q, e, n, u, d);
3268
+ if ((q.childElementCount > 0 || P === !0) && H.appendChild(X), C) {
3269
3269
  const k = document.createElement("div");
3270
3270
  k.className = "gengage-chat-product-card-rating gengage-chat-product-card-rating-compact";
3271
- const H = Yt(v), j = [`${H.toFixed(1)}`, "out of 5 stars"];
3271
+ const F = Yt(v), j = [`${F.toFixed(1)}`, "out of 5 stars"];
3272
3272
  typeof b == "number" && Number.isFinite(b) && j.push(`(${b} reviews)`), k.setAttribute("aria-label", j.join(" "));
3273
3273
  const V = document.createElement("span");
3274
3274
  V.className = "gengage-chat-product-card-rating-compact-star", V.setAttribute("aria-hidden", "true"), V.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>';
3275
3275
  const D = document.createElement("span");
3276
- D.className = "gengage-chat-product-card-rating-compact-value", D.textContent = H.toFixed(1), k.appendChild(V), k.appendChild(D), R.appendChild(k);
3276
+ D.className = "gengage-chat-product-card-rating-compact-value", D.textContent = F.toFixed(1), k.appendChild(V), k.appendChild(D), H.appendChild(k);
3277
3277
  }
3278
- if (R.childElementCount === 0 && (R.classList.add("gengage-chat-product-card-meta-row--empty"), R.setAttribute("aria-hidden", "true")), h.appendChild(R), o) {
3278
+ if (H.childElementCount === 0 && (H.classList.add("gengage-chat-product-card-meta-row--empty"), H.setAttribute("aria-hidden", "true")), h.appendChild(H), o) {
3279
3279
  const k = document.createElement("div");
3280
3280
  k.className = "gengage-chat-product-card-name", k.textContent = o, k.title = o, h.appendChild(k);
3281
3281
  }
@@ -3289,8 +3289,8 @@ function ct(t, e) {
3289
3289
  if (M) {
3290
3290
  const k = document.createElement("div");
3291
3291
  k.className = "gengage-chat-product-card-buy-footer";
3292
- const H = document.createElement("button");
3293
- H.type = "button", H.className = "gengage-chat-product-card-buy-trigger", H.textContent = N, H.addEventListener("click", (j) => {
3292
+ const F = document.createElement("button");
3293
+ F.type = "button", F.className = "gengage-chat-product-card-buy-trigger", F.textContent = N, F.addEventListener("click", (j) => {
3294
3294
  j.stopPropagation(), e.onAction({
3295
3295
  title: e.i18n?.addToCartButton ?? N,
3296
3296
  type: "addToCart",
@@ -3300,24 +3300,24 @@ function ct(t, e) {
3300
3300
  quantity: 1
3301
3301
  }
3302
3302
  });
3303
- }), k.appendChild(H), a.appendChild(k);
3303
+ }), k.appendChild(F), a.appendChild(k);
3304
3304
  } else if (i) {
3305
3305
  const k = document.createElement("button");
3306
- k.className = "gengage-chat-product-card-cta", k.type = "button", k.textContent = i.type === "launchSingleProduct" ? N : i.title || N, k.addEventListener("click", (H) => {
3306
+ k.className = "gengage-chat-product-card-cta", k.type = "button", k.textContent = i.type === "launchSingleProduct" ? N : i.title || N, k.addEventListener("click", (F) => {
3307
3307
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3308
- H.stopPropagation();
3308
+ F.stopPropagation();
3309
3309
  return;
3310
3310
  }
3311
3311
  p() || e.onAction(i);
3312
3312
  }), a.appendChild(k);
3313
3313
  } else if (l) {
3314
3314
  const k = document.createElement("a");
3315
- k.className = "gengage-chat-product-card-cta", oe(k, "href", l), oe(k, "target", "_blank"), oe(k, "rel", "noopener noreferrer"), k.textContent = N, k.addEventListener("click", (H) => {
3315
+ k.className = "gengage-chat-product-card-cta", oe(k, "href", l), oe(k, "target", "_blank"), oe(k, "rel", "noopener noreferrer"), k.textContent = N, k.addEventListener("click", (F) => {
3316
3316
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3317
- H.preventDefault(), H.stopPropagation();
3317
+ F.preventDefault(), F.stopPropagation();
3318
3318
  return;
3319
3319
  }
3320
- e.onProductClick && c && (H.preventDefault(), e.onProductClick({
3320
+ e.onProductClick && c && (F.preventDefault(), e.onProductClick({
3321
3321
  sku: c,
3322
3322
  url: l,
3323
3323
  ...o ? { name: o } : {}
@@ -3327,16 +3327,16 @@ function ct(t, e) {
3327
3327
  if (e.comparisonSelectMode && c && e.onToggleComparisonSku) {
3328
3328
  const k = document.createElement("div");
3329
3329
  k.className = "gengage-chat-comparison-select-wrapper";
3330
- const H = e.comparisonSelectedSkus?.includes(c) ?? !1;
3331
- H && k.classList.add("gengage-chat-comparison-select-wrapper--selected");
3330
+ const F = e.comparisonSelectedSkus?.includes(c) ?? !1;
3331
+ F && k.classList.add("gengage-chat-comparison-select-wrapper--selected");
3332
3332
  const j = n.name ?? c, V = e.i18n?.comparisonSelectCardHint ?? "Tap anywhere on the card to add or remove it from comparison.";
3333
3333
  k.setAttribute("role", "group"), k.setAttribute("aria-label", `${String(j)}. ${V}`);
3334
3334
  const D = document.createElement("button");
3335
- D.type = "button", D.className = "gengage-chat-comparison-checkbox", D.dataset.selected = H ? "true" : "false", D.setAttribute("aria-pressed", H ? "true" : "false");
3335
+ D.type = "button", D.className = "gengage-chat-comparison-checkbox", D.dataset.selected = F ? "true" : "false", D.setAttribute("aria-pressed", F ? "true" : "false");
3336
3336
  const Q = document.createElement("span");
3337
- Q.className = "gengage-chat-comparison-checkbox-icon", Q.innerHTML = H ? '<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>';
3337
+ Q.className = "gengage-chat-comparison-checkbox-icon", Q.innerHTML = F ? '<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>';
3338
3338
  const K = document.createElement("span");
3339
- K.className = "gengage-chat-comparison-checkbox-label", K.textContent = H ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", D.appendChild(Q), D.appendChild(K), D.addEventListener("click", (f) => {
3339
+ K.className = "gengage-chat-comparison-checkbox-label", K.textContent = F ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", D.appendChild(Q), D.appendChild(K), D.addEventListener("click", (f) => {
3340
3340
  f.stopPropagation(), e.onToggleComparisonSku?.(c);
3341
3341
  });
3342
3342
  const U = document.createElement("div");
@@ -3555,45 +3555,45 @@ function ei(t, e) {
3555
3555
  const M = document.createElement("div");
3556
3556
  M.className = "gengage-chat-product-gallery-thumbs";
3557
3557
  const N = 6;
3558
- let k = null, H = 0;
3558
+ let k = null, F = 0;
3559
3559
  const j = e.i18n, V = j?.galleryPrevAriaLabel ?? "Previous image", D = j?.galleryNextAriaLabel ?? "Next image", Q = (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>', K = document.createElement("button");
3560
3560
  K.type = "button", K.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--prev gds-btn gds-btn-ghost gds-icon-btn", K.setAttribute("aria-label", V), K.innerHTML = Q("prev");
3561
3561
  const U = document.createElement("button");
3562
3562
  U.type = "button", U.className = "gengage-chat-product-gallery-nav gengage-chat-product-gallery-nav--next gds-btn gds-btn-ghost gds-icon-btn", U.setAttribute("aria-label", D), U.innerHTML = Q("next");
3563
3563
  const f = () => {
3564
- K.disabled = H <= 0, U.disabled = H >= d.length - 1;
3564
+ K.disabled = F <= 0, U.disabled = F >= d.length - 1;
3565
3565
  }, S = (I) => {
3566
- if (I < 0 || I >= d.length || I === H) return;
3567
- const F = d[I];
3568
- if (!F) return;
3569
- oe(L, "src", F);
3570
- const q = M.querySelectorAll(".gengage-chat-product-gallery-thumb");
3571
- k && k.classList.remove("gengage-chat-product-gallery-thumb--active"), I < N && q[I] ? (q[I].classList.add("gengage-chat-product-gallery-thumb--active"), k = q[I]) : k = null, H = I, f();
3566
+ if (I < 0 || I >= d.length || I === F) return;
3567
+ const z = d[I];
3568
+ if (!z) return;
3569
+ oe(L, "src", z);
3570
+ const G = M.querySelectorAll(".gengage-chat-product-gallery-thumb");
3571
+ k && k.classList.remove("gengage-chat-product-gallery-thumb--active"), I < N && G[I] ? (G[I].classList.add("gengage-chat-product-gallery-thumb--active"), k = G[I]) : k = null, F = I, f();
3572
3572
  };
3573
3573
  for (let I = 0; I < d.length; I++) {
3574
- const F = d[I];
3574
+ const z = d[I];
3575
3575
  if (I >= N) break;
3576
- const q = document.createElement("img");
3577
- q.className = "gengage-chat-product-gallery-thumb", I === 0 && (q.classList.add("gengage-chat-product-gallery-thumb--active"), k = q), oe(q, "src", F), q.alt = `${r ?? "Product"} ${I + 1}`, q.width = 48, q.height = 48, ue(q), q.addEventListener("click", () => {
3576
+ const G = document.createElement("img");
3577
+ G.className = "gengage-chat-product-gallery-thumb", I === 0 && (G.classList.add("gengage-chat-product-gallery-thumb--active"), k = G), oe(G, "src", z), G.alt = `${r ?? "Product"} ${I + 1}`, G.width = 48, G.height = 48, ue(G), G.addEventListener("click", () => {
3578
3578
  S(I);
3579
- }), M.appendChild(q);
3579
+ }), M.appendChild(G);
3580
3580
  }
3581
3581
  if (d.length > N) {
3582
3582
  const I = document.createElement("span");
3583
3583
  I.className = "gengage-chat-product-gallery-thumb-more", I.textContent = `+${d.length - N}`, M.appendChild(I);
3584
3584
  }
3585
3585
  K.addEventListener("click", (I) => {
3586
- I.stopPropagation(), S(H - 1);
3586
+ I.stopPropagation(), S(F - 1);
3587
3587
  }), U.addEventListener("click", (I) => {
3588
- I.stopPropagation(), S(H + 1);
3588
+ I.stopPropagation(), S(F + 1);
3589
3589
  }), f();
3590
3590
  let A = 0;
3591
3591
  const O = 50;
3592
3592
  L.addEventListener("touchstart", (I) => {
3593
3593
  A = I.changedTouches[0].clientX;
3594
3594
  }, { passive: !0 }), L.addEventListener("touchend", (I) => {
3595
- const F = I.changedTouches[0].clientX, q = A - F;
3596
- Math.abs(q) < O || S(q > 0 ? Math.min(H + 1, d.length - 1) : Math.max(H - 1, 0));
3595
+ const z = I.changedTouches[0].clientX, G = A - z;
3596
+ Math.abs(G) < O || S(G > 0 ? Math.min(F + 1, d.length - 1) : Math.max(F - 1, 0));
3597
3597
  }), E.appendChild(K), E.appendChild(U), E.appendChild(M), a.appendChild(E);
3598
3598
  } else if (d.length === 1) {
3599
3599
  const E = document.createElement("div");
@@ -3688,14 +3688,14 @@ function ei(t, e) {
3688
3688
  const M = document.createElement("div");
3689
3689
  M.className = "gengage-chat-product-variants-list";
3690
3690
  for (const N of B) {
3691
- const k = la(N), H = ke(N, "sku");
3692
- if (!k && !H) continue;
3691
+ const k = la(N), F = ke(N, "sku");
3692
+ if (!k && !F) continue;
3693
3693
  const j = document.createElement("button");
3694
3694
  j.className = "gengage-chat-product-variant-btn gds-chip", j.type = "button";
3695
- const V = k ?? H ?? "";
3695
+ const V = k ?? F ?? "";
3696
3696
  j.title = V;
3697
3697
  const D = je(N, "in_stock", "inStock");
3698
- H && o && H === o ? (j.classList.add("gengage-chat-product-variant-btn--active"), j.setAttribute("aria-pressed", "true")) : j.setAttribute("aria-pressed", "false"), D === !1 && (j.classList.add("gengage-chat-product-variant-btn--out"), j.disabled = !0);
3698
+ F && o && F === o ? (j.classList.add("gengage-chat-product-variant-btn--active"), j.setAttribute("aria-pressed", "true")) : j.setAttribute("aria-pressed", "false"), D === !1 && (j.classList.add("gengage-chat-product-variant-btn--out"), j.disabled = !0);
3699
3699
  const Q = Wr(N), K = $r(N);
3700
3700
  if (Q && me(Q)) {
3701
3701
  const S = document.createElement("img");
@@ -3711,13 +3711,13 @@ function ei(t, e) {
3711
3711
  const S = document.createElement("span");
3712
3712
  S.className = "gengage-chat-product-variant-price", S.textContent = J(String(f), e.pricing), j.appendChild(S);
3713
3713
  }
3714
- if (H && H !== o) {
3714
+ if (F && F !== o) {
3715
3715
  const S = r ?? "", A = (typeof N.value == "string" ? N.value.trim() : "") || (typeof N.name == "string" ? N.name.trim() : "") || (typeof N.variant_name == "string" ? N.variant_name.trim() : "") || "", O = S.length > 0 ? A.length > 0 && A !== S ? `${S} (${A})` : S : V;
3716
3716
  j.addEventListener("click", () => {
3717
3717
  e.onAction({
3718
3718
  title: O,
3719
3719
  type: "launchVariant",
3720
- payload: { sku: H }
3720
+ payload: { sku: F }
3721
3721
  });
3722
3722
  });
3723
3723
  }
@@ -3757,12 +3757,12 @@ function ei(t, e) {
3757
3757
  }));
3758
3758
  }), T.appendChild(E);
3759
3759
  }
3760
- const R = C;
3761
- if (R && me(R)) {
3760
+ const H = C;
3761
+ if (H && me(H)) {
3762
3762
  let k = function(j, V) {
3763
3763
  const D = document.createElementNS(M, "circle");
3764
3764
  D.setAttribute("cx", j), D.setAttribute("cy", V), D.setAttribute("r", "3"), N.appendChild(D);
3765
- }, H = function(j, V, D, Q) {
3765
+ }, F = function(j, V, D, Q) {
3766
3766
  const K = document.createElementNS(M, "line");
3767
3767
  K.setAttribute("x1", j), K.setAttribute("y1", V), K.setAttribute("x2", D), K.setAttribute("y2", Q), N.appendChild(K);
3768
3768
  };
@@ -3771,19 +3771,19 @@ function ei(t, e) {
3771
3771
  const L = e.i18n?.shareButton ?? "Share";
3772
3772
  E.title = L, E.setAttribute("aria-label", L);
3773
3773
  const M = "http://www.w3.org/2000/svg", N = document.createElementNS(M, "svg");
3774
- N.setAttribute("width", "18"), N.setAttribute("height", "18"), N.setAttribute("viewBox", "0 0 24 24"), N.setAttribute("fill", "none"), N.setAttribute("stroke", "currentColor"), N.setAttribute("stroke-width", "2"), N.setAttribute("stroke-linecap", "round"), N.setAttribute("stroke-linejoin", "round"), k("18", "5"), k("6", "12"), k("18", "19"), H("8.59", "13.51", "15.42", "17.49"), H("15.41", "6.51", "8.59", "10.49"), E.appendChild(N), E.addEventListener("click", async () => {
3774
+ N.setAttribute("width", "18"), N.setAttribute("height", "18"), N.setAttribute("viewBox", "0 0 24 24"), N.setAttribute("fill", "none"), N.setAttribute("stroke", "currentColor"), N.setAttribute("stroke-width", "2"), N.setAttribute("stroke-linecap", "round"), N.setAttribute("stroke-linejoin", "round"), k("18", "5"), k("6", "12"), k("18", "19"), F("8.59", "13.51", "15.42", "17.49"), F("15.41", "6.51", "8.59", "10.49"), E.appendChild(N), E.addEventListener("click", async () => {
3775
3775
  try {
3776
3776
  navigator.share ? await navigator.share({
3777
3777
  title: r ?? "",
3778
- url: R
3779
- }) : navigator.clipboard && (await navigator.clipboard.writeText(R), E.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => E.classList.remove("gengage-chat-product-details-share--copied"), 1500));
3778
+ url: H
3779
+ }) : navigator.clipboard && (await navigator.clipboard.writeText(H), E.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => E.classList.remove("gengage-chat-product-details-share--copied"), 1500));
3780
3780
  } catch {
3781
3781
  }
3782
3782
  }), T.appendChild(E);
3783
3783
  }
3784
3784
  T.childElementCount > 0 && y.appendChild(T), a.appendChild(y);
3785
- const G = Vr(n), X = qr(n);
3786
- return (G || X) && a.appendChild(ni(G, X, e)), a;
3785
+ const q = Vr(n), X = qr(n);
3786
+ return (q || X) && a.appendChild(ni(q, X, e)), a;
3787
3787
  }
3788
3788
  function lt(t) {
3789
3789
  if (t.nodeType === Node.TEXT_NODE) return document.createTextNode(t.textContent ?? "");
@@ -3965,22 +3965,22 @@ function ci(t, e, a, n) {
3965
3965
  T.className = "gengage-chat-product-sort-menu gds-menu", T.hidden = !0, T.setAttribute("role", "listbox"), T.setAttribute("aria-label", d);
3966
3966
  const _ = h.ownerDocument;
3967
3967
  let C = null;
3968
- const R = () => {
3968
+ const H = () => {
3969
3969
  T.hidden = !0, b.classList.remove("gengage-chat-product-sort-dropdown--open"), u.setAttribute("aria-expanded", "false"), C?.abort(), C = null;
3970
- }, G = (L) => {
3971
- b.classList.contains("gengage-chat-product-sort-dropdown--open") && (b.contains(L.target) || R());
3970
+ }, q = (L) => {
3971
+ b.classList.contains("gengage-chat-product-sort-dropdown--open") && (b.contains(L.target) || H());
3972
3972
  }, X = (L) => {
3973
- L.key === "Escape" && (L.preventDefault(), R());
3973
+ L.key === "Escape" && (L.preventDefault(), H());
3974
3974
  }, E = () => {
3975
3975
  T.hidden = !1, b.classList.add("gengage-chat-product-sort-dropdown--open"), u.setAttribute("aria-expanded", "true"), C = new AbortController();
3976
3976
  const { signal: L } = C;
3977
- _.addEventListener("click", G, { signal: L }), _.addEventListener("keydown", X, {
3977
+ _.addEventListener("click", q, { signal: L }), _.addEventListener("keydown", X, {
3978
3978
  capture: !0,
3979
3979
  signal: L
3980
3980
  });
3981
3981
  };
3982
3982
  u.addEventListener("click", (L) => {
3983
- L.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? R() : E();
3983
+ L.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? H() : E();
3984
3984
  });
3985
3985
  for (const L of v) {
3986
3986
  const M = document.createElement("button");
@@ -3989,16 +3989,16 @@ function ci(t, e, a, n) {
3989
3989
  M.setAttribute("aria-selected", N ? "true" : "false"), N && M.classList.add("gengage-chat-product-sort-option--active", "gds-menu-option-active");
3990
3990
  const k = L.sortState.type === "related" ? "related" : `price-${L.sortState.direction ?? ""}`;
3991
3991
  M.dataset.sortKey = k;
3992
- const H = document.createElement("span");
3993
- H.className = "gengage-chat-product-sort-option-icon", H.innerHTML = Nt(L.icon);
3992
+ const F = document.createElement("span");
3993
+ F.className = "gengage-chat-product-sort-option-icon", F.innerHTML = Nt(L.icon);
3994
3994
  const j = document.createElement("span");
3995
3995
  j.className = "gengage-chat-product-sort-option-label", j.textContent = L.label;
3996
3996
  const V = document.createElement("span");
3997
- V.className = "gengage-chat-product-sort-option-check", V.innerHTML = ii(), V.setAttribute("aria-hidden", "true"), N || V.classList.add("gengage-chat-product-sort-option-check--hidden"), M.appendChild(H), M.appendChild(j), M.appendChild(V), M.addEventListener("click", () => {
3997
+ V.className = "gengage-chat-product-sort-option-check", V.innerHTML = ii(), V.setAttribute("aria-hidden", "true"), N || V.classList.add("gengage-chat-product-sort-option-check--hidden"), M.appendChild(F), M.appendChild(j), M.appendChild(V), M.addEventListener("click", () => {
3998
3998
  m = L.sortState, n.onSortChange?.(L.sortState), si(c, s, e, L.sortState), T.querySelectorAll(".gengage-chat-product-sort-option").forEach((D) => {
3999
3999
  const Q = D, K = Q.dataset.sortKey === k;
4000
4000
  Q.classList.toggle("gengage-chat-product-sort-option--active", K), Q.classList.toggle("gds-menu-option-active", K), Q.setAttribute("aria-selected", K ? "true" : "false"), Q.querySelector(".gengage-chat-product-sort-option-check")?.classList.toggle("gengage-chat-product-sort-option-check--hidden", !K);
4001
- }), w(L.sortState), R();
4001
+ }), w(L.sortState), H();
4002
4002
  }), T.appendChild(M);
4003
4003
  }
4004
4004
  if (b.appendChild(u), b.appendChild(T), h.appendChild(b), n.onToggleComparisonSku) {
@@ -4199,12 +4199,12 @@ function ut(t, e) {
4199
4199
  const _ = document.createElement("div");
4200
4200
  _.className = "gengage-chat-product-grid gengage-chat-consulting-group-grid", P && _.classList.add("gengage-chat-consulting-group-grid--single-group"), _.style.setProperty("--consulting-group-columns", String(Math.max(1, Math.min(4, d.length))));
4201
4201
  for (const C of d) {
4202
- const R = ct({
4202
+ const H = ct({
4203
4203
  type: "ProductCard",
4204
4204
  props: { product: C }
4205
4205
  }, r ?? { onAction: () => {
4206
4206
  } });
4207
- _.appendChild(R);
4207
+ _.appendChild(H);
4208
4208
  }
4209
4209
  w.appendChild(_), n.appendChild(w);
4210
4210
  }, h = /* @__PURE__ */ new Set(), m = [];
@@ -4680,8 +4680,8 @@ function ki(t, e, a) {
4680
4680
  "Soru sor"
4681
4681
  ], placeholderInterval: v = 2e3, voiceLang: b = "tr-TR", showBorderAnimation: u = !0, sendAriaLabel: d = "Gönder", micAriaLabel: P = "Sesli giriş", cancelAriaLabel: y = "Ses kaydını durdur", openChatAriaLabel: w = "Chat'i aç" } = t;
4682
4682
  if (!a.getElementById(Rt)) {
4683
- const z = document.createElement("style");
4684
- z.id = Rt, z.textContent = wi({
4683
+ const R = document.createElement("style");
4684
+ R.id = Rt, R.textContent = wi({
4685
4685
  primaryColor: n,
4686
4686
  backgroundColor: r,
4687
4687
  textColor: i,
@@ -4692,42 +4692,42 @@ function ki(t, e, a) {
4692
4692
  height: p,
4693
4693
  maxWidth: g,
4694
4694
  fontFamily: h
4695
- }), a.appendChild(z);
4695
+ }), a.appendChild(R);
4696
4696
  }
4697
4697
  const B = document.createElement("div");
4698
4698
  B.className = "gengage-fl", B.dataset.gengagePart = "floating-launcher", B.innerHTML = _i();
4699
- const T = B.querySelector(".gengage-fl-input"), _ = B.querySelector(".gengage-fl-transcript"), C = B.querySelector(".gengage-fl-transcript-final"), R = B.querySelector(".gengage-fl-transcript-interim"), G = B.querySelector(".gengage-fl-btn-send"), X = B.querySelector(".gengage-fl-btn-mic"), E = B.querySelector(".gengage-fl-btn-open-chat"), L = B.querySelector(".gengage-fl-cancel"), M = B.querySelector(".gengage-fl-wave"), N = B.querySelector(".gengage-fl-ring");
4700
- T.placeholder = m[0] ?? "", G.setAttribute("aria-label", d), X.setAttribute("aria-label", P), L.setAttribute("aria-label", y), E.setAttribute("aria-label", w);
4701
- let k = !1, H = !1, j = "", V = !1, D = null, Q = 0, K = null, U = null, f = null, S = null, A = null, O = 0;
4699
+ const T = B.querySelector(".gengage-fl-input"), _ = B.querySelector(".gengage-fl-transcript"), C = B.querySelector(".gengage-fl-transcript-final"), H = B.querySelector(".gengage-fl-transcript-interim"), q = B.querySelector(".gengage-fl-btn-send"), X = B.querySelector(".gengage-fl-btn-mic"), E = B.querySelector(".gengage-fl-btn-open-chat"), L = B.querySelector(".gengage-fl-cancel"), M = B.querySelector(".gengage-fl-wave"), N = B.querySelector(".gengage-fl-ring");
4700
+ T.placeholder = m[0] ?? "", q.setAttribute("aria-label", d), X.setAttribute("aria-label", P), L.setAttribute("aria-label", y), E.setAttribute("aria-label", w);
4701
+ let k = !1, F = !1, j = "", V = !1, D = null, Q = 0, K = null, U = null, f = null, S = null, A = null, O = 0;
4702
4702
  function I() {
4703
- const z = T.value.trim().length > 0;
4703
+ const R = T.value.trim().length > 0;
4704
4704
  if (X.classList.toggle("is-recording", k), k) {
4705
- G.style.display = "flex", X.style.display = "flex", L.style.display = "flex", E.style.display = "none";
4705
+ q.style.display = "flex", X.style.display = "flex", L.style.display = "flex", E.style.display = "none";
4706
4706
  return;
4707
4707
  }
4708
- G.style.display = z ? "flex" : "none", X.style.display = z ? "none" : "flex", L.style.display = "none", E.style.display = !z && V ? "flex" : "none";
4708
+ q.style.display = R ? "flex" : "none", X.style.display = R ? "none" : "flex", L.style.display = "none", E.style.display = !R && V ? "flex" : "none";
4709
4709
  }
4710
- function F() {
4711
- Q = (Q + 1) % m.length, T.placeholder = m[Q] ?? "", K = setTimeout(F, v);
4710
+ function z() {
4711
+ Q = (Q + 1) % m.length, T.placeholder = m[Q] ?? "", K = setTimeout(z, v);
4712
4712
  }
4713
- function q() {
4714
- K !== null || m.length <= 1 || (K = setTimeout(F, v));
4713
+ function G() {
4714
+ K !== null || m.length <= 1 || (K = setTimeout(z, v));
4715
4715
  }
4716
- function ee() {
4716
+ function ae() {
4717
4717
  K !== null && (clearTimeout(K), K = null);
4718
4718
  }
4719
- function te() {
4720
- k && (k = !1, se(), H = !1, ae(), u && ie(), j = "", T.style.display = "", _.style.display = "none", C.textContent = "", R.textContent = "");
4721
- const z = T.value.trim();
4722
- z && (e.onSend(z), V || (V = !0)), T.value = "", j = "", I();
4719
+ function ee() {
4720
+ k && (k = !1, se(), F = !1, te(), u && re(), j = "", T.style.display = "", _.style.display = "none", C.textContent = "", H.textContent = "");
4721
+ const R = T.value.trim();
4722
+ R && (e.onSend(R), V || (V = !0)), T.value = "", j = "", I();
4723
4723
  }
4724
- function ne() {
4725
- const z = window, Y = z.SpeechRecognition ?? z.webkitSpeechRecognition;
4724
+ function ie() {
4725
+ const R = window, Y = R.SpeechRecognition ?? R.webkitSpeechRecognition;
4726
4726
  if (!Y) {
4727
4727
  console.warn("[FloatingLauncher] SpeechRecognition not supported.");
4728
4728
  return;
4729
4729
  }
4730
- D || (D = new Y(), D.continuous = !0, D.interimResults = !0, D.lang = b), k = !0, H = !0, j = "", T.value = "", T.style.display = "none", _.style.display = "flex", C.textContent = "", R.textContent = "", I(), $(), u && re(), D.onresult = (Z) => {
4730
+ D || (D = new Y(), D.continuous = !0, D.interimResults = !0, D.lang = b), k = !0, F = !0, j = "", T.value = "", T.style.display = "none", _.style.display = "flex", C.textContent = "", H.textContent = "", I(), $(), u && ne(), D.onresult = (Z) => {
4731
4731
  if (!k) return;
4732
4732
  let W = "", ce = "";
4733
4733
  for (let Se = Z.resultIndex; Se < Z.results.length; Se++) {
@@ -4736,7 +4736,7 @@ function ki(t, e, a) {
4736
4736
  const Re = Le[0]?.transcript ?? "";
4737
4737
  Le.isFinal ? ce += Re : W += Re;
4738
4738
  }
4739
- j += ce, C.textContent = j, R.textContent = W, T.value = `${j} ${W}`.trim(), I();
4739
+ j += ce, C.textContent = j, H.textContent = W, T.value = `${j} ${W}`.trim(), I();
4740
4740
  }, D.onend = () => x(), D.onerror = () => x();
4741
4741
  try {
4742
4742
  D.start();
@@ -4751,13 +4751,13 @@ function ki(t, e, a) {
4751
4751
  }
4752
4752
  }
4753
4753
  function x() {
4754
- H && (H = !1, k = !1, ae(), u && ie(), j.trim() && (T.value = j.trim()), T.style.display = "", _.style.display = "none", C.textContent = "", R.textContent = "", I());
4754
+ F && (F = !1, k = !1, te(), u && re(), j.trim() && (T.value = j.trim()), T.style.display = "", _.style.display = "none", C.textContent = "", H.textContent = "", I());
4755
4755
  }
4756
4756
  async function $() {
4757
- const z = ++O, Y = Array.from(M.querySelectorAll("span"));
4757
+ const R = ++O, Y = Array.from(M.querySelectorAll("span"));
4758
4758
  try {
4759
4759
  const Z = await navigator.mediaDevices.getUserMedia({ audio: !0 });
4760
- if (!k || z !== O) {
4760
+ if (!k || R !== O) {
4761
4761
  Z.getTracks().forEach((Ae) => Ae.stop());
4762
4762
  return;
4763
4763
  }
@@ -4766,14 +4766,14 @@ function ki(t, e, a) {
4766
4766
  if (!ce)
4767
4767
  throw U = null, Z.getTracks().forEach((Ae) => Ae.stop()), new Error("AudioContext not supported");
4768
4768
  const Se = new ce();
4769
- if (!k || z !== O) {
4769
+ if (!k || R !== O) {
4770
4770
  Z.getTracks().forEach((Ae) => Ae.stop()), Se.close().catch(() => {
4771
4771
  });
4772
4772
  return;
4773
4773
  }
4774
4774
  f = Se, S = Se.createAnalyser(), S.fftSize = 256, Se.createMediaStreamSource(Z).connect(S);
4775
4775
  const Le = new Uint8Array(S.frequencyBinCount), Re = () => {
4776
- if (!k || z !== O || !S) return;
4776
+ if (!k || R !== O || !S) return;
4777
4777
  S.getByteFrequencyData(Le);
4778
4778
  const Ae = Math.max(1, Math.floor(Le.length / Y.length));
4779
4779
  Y.forEach((va, xa) => {
@@ -4782,37 +4782,37 @@ function ki(t, e, a) {
4782
4782
  };
4783
4783
  Re();
4784
4784
  } catch {
4785
- if (!k || z !== O) return;
4785
+ if (!k || R !== O) return;
4786
4786
  A !== null && (cancelAnimationFrame(A), A = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4787
4787
  }), f = null), U && (U.getTracks().forEach((Z) => Z.stop()), U = null), M.classList.add("is-css-animated");
4788
4788
  }
4789
4789
  }
4790
- function ae() {
4790
+ function te() {
4791
4791
  O += 1, M.classList.remove("is-css-animated"), A !== null && (cancelAnimationFrame(A), A = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4792
- }), f = null), U && (U.getTracks().forEach((z) => z.stop()), U = null), Array.from(M.querySelectorAll("span")).forEach((z) => {
4793
- z.style.height = "4px";
4792
+ }), f = null), U && (U.getTracks().forEach((R) => R.stop()), U = null), Array.from(M.querySelectorAll("span")).forEach((R) => {
4793
+ R.style.height = "4px";
4794
4794
  });
4795
4795
  }
4796
- function re() {
4796
+ function ne() {
4797
4797
  N.classList.add("is-active");
4798
4798
  }
4799
- function ie() {
4799
+ function re() {
4800
4800
  N.classList.remove("is-active");
4801
4801
  }
4802
- G.addEventListener("click", te), X.addEventListener("click", (z) => {
4803
- z.preventDefault(), z.stopPropagation(), k ? se() : ne();
4802
+ q.addEventListener("click", ee), X.addEventListener("click", (R) => {
4803
+ R.preventDefault(), R.stopPropagation(), k ? se() : ie();
4804
4804
  }), L.addEventListener("click", () => {
4805
- k && (k = !1, se(), H = !1, ae(), u && ie(), j = "", T.style.display = "", _.style.display = "none", C.textContent = "", R.textContent = "", I());
4806
- }), E.addEventListener("click", (z) => {
4807
- z.preventDefault(), z.stopPropagation(), e.onOpenChat();
4808
- }), T.addEventListener("input", I), T.addEventListener("keydown", (z) => {
4809
- z.key === "Enter" && te();
4810
- }), I(), q();
4805
+ k && (k = !1, se(), F = !1, te(), u && re(), j = "", T.style.display = "", _.style.display = "none", C.textContent = "", H.textContent = "", I());
4806
+ }), E.addEventListener("click", (R) => {
4807
+ R.preventDefault(), R.stopPropagation(), e.onOpenChat();
4808
+ }), T.addEventListener("input", I), T.addEventListener("keydown", (R) => {
4809
+ R.key === "Enter" && ee();
4810
+ }), I(), G();
4811
4811
  function he() {
4812
4812
  V = !0, I();
4813
4813
  }
4814
4814
  function fe() {
4815
- ee(), ae(), ie(), k && (k = !1, se()), D && (D.onresult = null, D.onend = null, D.onerror = null, D = null);
4815
+ ae(), te(), re(), k && (k = !1, se()), D && (D.onresult = null, D.onend = null, D.onerror = null, D = null);
4816
4816
  }
4817
4817
  return {
4818
4818
  container: B,
@@ -6068,20 +6068,20 @@ var ko = class Te extends Va {
6068
6068
  const l = () => {
6069
6069
  const T = window.innerWidth <= r ? a.mobile : a.desktop;
6070
6070
  if (!T) return;
6071
- const _ = T.selector, C = !!_, R = (C ? document.querySelector(_) : null)?.getBoundingClientRect();
6071
+ const _ = T.selector, C = !!_, H = (C ? document.querySelector(_) : null)?.getBoundingClientRect();
6072
6072
  if (T.bottom !== void 0) {
6073
- const { offset: G, type: X } = T.bottom;
6074
- if (!C) n.style.setProperty(s, `${Math.max(0, G)}px`);
6075
- else if (R) {
6076
- const E = X === "root" || G === 0 ? R.bottom : R.top, L = Math.max(0, window.innerHeight - E + G);
6073
+ const { offset: q, type: X } = T.bottom;
6074
+ if (!C) n.style.setProperty(s, `${Math.max(0, q)}px`);
6075
+ else if (H) {
6076
+ const E = X === "root" || q === 0 ? H.bottom : H.top, L = Math.max(0, window.innerHeight - E + q);
6077
6077
  n.style.setProperty(s, `${L}px`);
6078
6078
  }
6079
6079
  }
6080
6080
  if (T.right !== void 0) {
6081
- const { offset: G, type: X } = T.right;
6082
- if (!C) n.style.setProperty(c, `${Math.max(0, G)}px`);
6083
- else if (R) {
6084
- const E = X === "root" || G === 0 ? R.right : R.left, L = Math.max(0, window.innerWidth - E + G);
6081
+ const { offset: q, type: X } = T.right;
6082
+ if (!C) n.style.setProperty(c, `${Math.max(0, q)}px`);
6083
+ else if (H) {
6084
+ const E = X === "root" || q === 0 ? H.right : H.left, L = Math.max(0, window.innerWidth - E + q);
6085
6085
  n.style.setProperty(c, `${L}px`);
6086
6086
  }
6087
6087
  }
@@ -6117,7 +6117,7 @@ var ko = class Te extends Va {
6117
6117
  }
6118
6118
  const _ = document.querySelector(T.selector);
6119
6119
  _ && (v.observe(_), o() ? (b = new IntersectionObserver((C) => {
6120
- for (const R of C) R.isIntersecting ? (g = !0, l()) : (g = !1, p(), P());
6120
+ for (const H of C) H.isIntersecting ? (g = !0, l()) : (g = !1, p(), P());
6121
6121
  }, { threshold: 0 }), b.observe(_)) : l());
6122
6122
  };
6123
6123
  y();
@@ -6704,30 +6704,30 @@ var ko = class Te extends Va {
6704
6704
  }
6705
6705
  };
6706
6706
  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), B.payload !== void 0 && (T.payload = B.payload), !p && this.config.pageContext?.sku !== void 0 && (T.sku = this.config.pageContext.sku), !p && this.config.pageContext?.pageType !== void 0 && (T.page_type = this.config.pageContext.pageType);
6707
- let _ = !1, C = !1, R = !1, G = !1, X = !1, E = !1;
6707
+ let _ = !1, C = !1, H = !1, q = !1, X = !1, E = !1;
6708
6708
  const L = zn();
6709
6709
  let M = null, N = null;
6710
6710
  const k = () => {
6711
- if (this._drawer && !G) {
6712
- if (!R) {
6711
+ if (this._drawer && !q) {
6712
+ if (!H) {
6713
6713
  this._drawer.setPanelAiZoneState("hidden");
6714
6714
  return;
6715
6715
  }
6716
6716
  X ? this._drawer.setPanelAiZoneState("hidden") : this._drawer.setPanelAiZoneState("analyzing", { analyzingLabel: this._i18n.aiAnalysisAnalyzingLabel });
6717
6717
  }
6718
- }, H = (f) => {
6718
+ }, F = (f) => {
6719
6719
  if (!M || !this._drawer) return;
6720
6720
  const S = this._buildRenderContext();
6721
6721
  S.isStreaming = f;
6722
6722
  const A = this._renderUISpec(M, S);
6723
- G = !0, this._drawer.setPanelAiZoneState("results", { resultEl: A }), M = null;
6723
+ q = !0, this._drawer.setPanelAiZoneState("results", { resultEl: A }), M = null;
6724
6724
  }, j = (f, S, A) => {
6725
6725
  if (f === "ProductGrid" || f === "CategoriesContainer") {
6726
- R = !0, H(A), k();
6726
+ H = !0, F(A), k();
6727
6727
  return;
6728
6728
  }
6729
- S !== "appendSimilars" && S !== "append" && (R = !1, G = !1, M = null, this._drawer?.setPanelAiZoneState("hidden"));
6730
- }, V = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (R || G || M !== null), D = () => {
6729
+ S !== "appendSimilars" && S !== "append" && (H = !1, q = !1, M = null, this._drawer?.setPanelAiZoneState("hidden"));
6730
+ }, V = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (H || q || M !== null), D = () => {
6731
6731
  E || (E = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
6732
6732
  }, Q = (f, S, A) => {
6733
6733
  if (!this._drawer || !this._panel) return;
@@ -6735,8 +6735,8 @@ var ko = class Te extends Va {
6735
6735
  if (A === "ProductGrid" && O) {
6736
6736
  const I = pt(O);
6737
6737
  if (I.isConsulting) {
6738
- const F = this._drawer.getPanelContentElement();
6739
- if (F && vi(F, I, S)) {
6738
+ const z = this._drawer.getPanelContentElement();
6739
+ if (z && vi(z, I, S)) {
6740
6740
  this._comparisonSelectMode = !1, this._comparisonSelectedSkus = [], this._comparisonSelectionWarning = null, this._drawer.setComparisonDockContent(null), this._currentPanelSource = {
6741
6741
  kind: "spec",
6742
6742
  spec: f
@@ -6752,8 +6752,8 @@ var ko = class Te extends Va {
6752
6752
  }, K = (f, S, A, O) => {
6753
6753
  if (!this._panel) return;
6754
6754
  f === "ProductDetailsPanel" && e.type === "launchSingleProduct" && this._clearUnavailableProductContext(), d.threadId && this._panel.threads[this._panel.threads.length - 1] !== d.threadId && this._panel.threads.push(d.threadId), this._isMobileViewport && f === "ProductGrid" && this._ensureMobilePanelOverlayVisible();
6755
- const I = this._panel.currentType ?? f, F = S?.props?.panelTitle;
6756
- this._panel.updateTopBar(I, F), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), j(f, A, O);
6755
+ const I = this._panel.currentType ?? f, z = S?.props?.panelTitle;
6756
+ this._panel.updateTopBar(I, z), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), j(f, A, O);
6757
6757
  };
6758
6758
  let U = null;
6759
6759
  if (U = on(T, {
@@ -6763,39 +6763,40 @@ var ko = class Te extends Va {
6763
6763
  ...A.skuToProductItem
6764
6764
  }), A?.conversationMode && (this._conversationMode = A.conversationMode), A?.renderHint && (d.renderHint = A.renderHint), !this._drawer)) return;
6765
6765
  let O = u;
6766
- const I = A?.kvkk === !0 || c && mt(O);
6767
- if (S && I) {
6768
- const q = this.config.accountId;
6769
- if (!Vt(q)) {
6770
- const ee = mo(O);
6771
- ee ? this._drawer?.showKvkkBanner(ee, () => {
6772
- this._drawer?.hideKvkkBanner(), nt(q);
6773
- }) : nt(q);
6766
+ if (A?.kvkk === !0 || mt(O)) {
6767
+ if (S) {
6768
+ const z = this.config.accountId;
6769
+ if (!Vt(z)) {
6770
+ const G = mo(O);
6771
+ G ? this._drawer?.showKvkkBanner(G, () => {
6772
+ this._drawer?.hideKvkkBanner(), nt(z);
6773
+ }) : nt(z);
6774
+ }
6774
6775
  }
6775
6776
  O = uo(O);
6776
6777
  }
6777
- const F = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
6778
- if (F ? F.innerHTML = pe(O) : (d.content = O, d.role === "assistant" && d.threadId && !this._threadsWithFirstBot.has(d.threadId) && (this._threadsWithFirstBot.add(d.threadId), this._drawer.markFirstBotMessage(d.id)), this._drawer.addMessage(d)), S)
6778
+ const I = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
6779
+ if (I ? I.innerHTML = pe(O) : (d.content = O, d.role === "assistant" && d.threadId && !this._threadsWithFirstBot.has(d.threadId) && (this._threadsWithFirstBot.add(d.threadId), this._drawer.markFirstBotMessage(d.id)), this._drawer.addMessage(d)), S)
6779
6780
  if (d.content = O, d.status = "done", ft(), Hn(d))
6780
6781
  this._drawer?.updateBotMessage(d.id, O, "photo_analysis", d.photoAnalysis), d.threadId && this._focusPresentationThread(d.threadId, "auto");
6781
6782
  else {
6782
- const q = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
6783
- if (q) {
6783
+ const z = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
6784
+ if (z) {
6784
6785
  this._activeTypewriter?.cancel();
6785
- const ee = A?.productMentions;
6786
+ const G = A?.productMentions;
6786
6787
  this._activeTypewriter = Ti({
6787
- container: q,
6788
+ container: z,
6788
6789
  html: pe(O),
6789
6790
  onTick: () => this._drawer?.scrollToBottomIfNeeded(),
6790
6791
  onComplete: () => {
6791
- this._activeTypewriter = null, ee && ee.length > 0 && q && Ii({
6792
- container: q,
6793
- mentions: ee,
6794
- onProductClick: (te) => {
6792
+ this._activeTypewriter = null, G && G.length > 0 && z && Ii({
6793
+ container: z,
6794
+ mentions: G,
6795
+ onProductClick: (ae) => {
6795
6796
  this._sendAction({
6796
- title: ee.find((ne) => ne.sku === te)?.short_name ?? te,
6797
+ title: G.find((ee) => ee.sku === ae)?.short_name ?? ae,
6797
6798
  type: "launchSingleProduct",
6798
- payload: { sku: te }
6799
+ payload: { sku: ae }
6799
6800
  });
6800
6801
  }
6801
6802
  });
@@ -6807,8 +6808,8 @@ var ko = class Te extends Va {
6807
6808
  onUISpec: (f, S, A, O) => {
6808
6809
  if (!o && i !== this._activeRequestThreadId || S !== "chat") return;
6809
6810
  O && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1, N = null);
6810
- const I = f.elements[f.root], F = I?.type ?? "unknown";
6811
- if (Rn(F, I?.props ?? {}, L, {
6811
+ const I = f.elements[f.root], z = I?.type ?? "unknown";
6812
+ if (Rn(z, I?.props ?? {}, L, {
6812
6813
  drawer: this._drawer,
6813
6814
  ensureRendered: () => this._ensureAssistantMessageRendered(d),
6814
6815
  cancelTypewriter: () => {
@@ -6817,93 +6818,93 @@ var ko = class Te extends Va {
6817
6818
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
6818
6819
  streamDone: X
6819
6820
  }, d)) {
6820
- F === "PhotoAnalysisCard" && d.threadId && this._focusPresentationThread(d.threadId, "auto");
6821
+ z === "PhotoAnalysisCard" && d.threadId && this._focusPresentationThread(d.threadId, "auto");
6821
6822
  return;
6822
6823
  }
6823
- const q = it(I), ee = this.config.productDetailsExtended !== !0 && (F === "ProductDetailsPanel" || q);
6824
- ee && !O && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1);
6825
- const te = F === "ProductDetailsPanel" && A !== "panel" ? "panel" : A, ne = this._buildRenderContext();
6826
- if (ne.isStreaming = !0, F === "ComparisonTable") {
6827
- const z = I?.props?.products;
6828
- Fa(Array.isArray(z) ? z.length : 0);
6824
+ const G = it(I), ae = this.config.productDetailsExtended !== !0 && (z === "ProductDetailsPanel" || G);
6825
+ ae && !O && (this._clearAssistantPanelLikeStreamClearPanel(), _ = !1);
6826
+ const ee = z === "ProductDetailsPanel" && A !== "panel" ? "panel" : A, ie = this._buildRenderContext();
6827
+ if (ie.isStreaming = !0, z === "ComparisonTable") {
6828
+ const R = I?.props?.products;
6829
+ Fa(Array.isArray(R) ? R.length : 0);
6829
6830
  }
6830
- if (F === "ProductGrid") {
6831
- const z = I?.children?.length ?? 0;
6832
- Ta(void 0, z);
6831
+ if (z === "ProductGrid") {
6832
+ const R = I?.children?.length ?? 0;
6833
+ Ta(void 0, R);
6833
6834
  }
6834
- const se = te === "panel" && this._panel ? this._panel.toPanelSpec(f) : f;
6835
- if (te === "panel" && this._panel && !ee && F === "ProductGrid" && I) {
6836
- const z = pt(I);
6837
- if (z.isConsulting && !bi(z)) {
6835
+ const se = ee === "panel" && this._panel ? this._panel.toPanelSpec(f) : f;
6836
+ if (ee === "panel" && this._panel && !ae && z === "ProductGrid" && I) {
6837
+ const R = pt(I);
6838
+ if (R.isConsulting && !bi(R)) {
6838
6839
  N = f;
6839
6840
  return;
6840
6841
  }
6841
- z.isConsulting && (N = null);
6842
+ R.isConsulting && (N = null);
6842
6843
  }
6843
- if (wo(I) && D(), te === "panel" && this._panel && !ee) {
6844
- const z = !C;
6844
+ if (wo(I) && D(), ee === "panel" && this._panel && !ae) {
6845
+ const R = !C;
6845
6846
  C = !0;
6846
6847
  const Y = I?.props?.replacePanel === !0, Z = I?.props?.rankingState, W = Y || Z === "pending" || Z === "final" ? "replace" : Gi({
6847
- componentType: F,
6848
+ componentType: z,
6848
6849
  similarsAppend: I?.props?.similarsAppend === !0,
6849
6850
  currentPanelType: this._panel.currentType,
6850
6851
  hasPanelContent: this._drawer?.hasPanelContent() ?? !1,
6851
6852
  isPanelLoading: this._drawer?.isPanelLoading() ?? !1,
6852
- isFirstPanelContentInStream: z
6853
+ isFirstPanelContentInStream: R
6853
6854
  });
6854
- ne.panelProductListHeading = void 0, F === "ProductGrid" && (W === "appendSimilars" ? ne.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products" : this._applyPanelListHeadingToContext(ne, {
6855
+ ie.panelProductListHeading = void 0, z === "ProductGrid" && (W === "appendSimilars" ? ie.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products" : this._applyPanelListHeadingToContext(ie, {
6855
6856
  kind: "spec",
6856
6857
  spec: se
6857
- })), W === "appendSimilars" ? this._appendSimilarsToPanel(se, ne) : W === "append" ? (this._drawer?.appendPanelContent(this._renderUISpec(se, ne)), this._comparisonSelectMode && this._refreshComparisonUI()) : Q(se, ne, F), K(F, I, W, !0);
6858
+ })), W === "appendSimilars" ? this._appendSimilarsToPanel(se, ie) : W === "append" ? (this._drawer?.appendPanelContent(this._renderUISpec(se, ie)), this._comparisonSelectMode && this._refreshComparisonUI()) : Q(se, ie, z), K(z, I, W, !0);
6858
6859
  }
6859
- if (F === "ProductDetailsPanel" && te === "panel" && (!d.silent || c)) {
6860
- const z = I?.props?.product;
6861
- if (z) {
6862
- c && (l = z), this._currentInlineProductSummaryRecord = z;
6860
+ if (z === "ProductDetailsPanel" && ee === "panel" && (!d.silent || c)) {
6861
+ const R = I?.props?.product;
6862
+ if (R) {
6863
+ c && (l = R), this._currentInlineProductSummaryRecord = R;
6863
6864
  const Y = {
6864
6865
  root: "root",
6865
6866
  elements: { root: {
6866
6867
  type: "ProductSummaryCard",
6867
- props: { product: z }
6868
+ props: { product: R }
6868
6869
  } }
6869
6870
  }, Z = this._shadow?.querySelector(".gengage-chat-messages");
6870
6871
  if (Z) {
6871
- const W = this._renderUISpec(Y, ne);
6872
+ const W = this._renderUISpec(Y, ie);
6872
6873
  d.threadId && (W.dataset.threadId = d.threadId);
6873
6874
  const ce = this._shadow?.querySelector(`[data-message-id="${d.id}"]`);
6874
6875
  ce && ce.parentNode === Z ? ce.after(W) : Z.appendChild(W), this._scrollInlineIntoView(W, d.threadId), this._drawer?.refreshPresentationCollapsed(), C = !0;
6875
6876
  }
6876
6877
  }
6877
6878
  }
6878
- const x = F === "AITopPicks" || F === "AIGroupingCards", $ = F === "ActionButtons" ? I?.props?.buttons : void 0, ae = F === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray($) && $.length > 0 && $.every((z) => z.action?.type === "inputText");
6879
- let re = !1, ie = !1;
6880
- if (ee && q && (ne.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), x && (!d.silent || s))
6881
- if (d.threadId && this._rememberPanelAiSpec(d.threadId, f), R) {
6882
- const z = this._renderUISpec(f, ne);
6883
- G = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: z }), re = !0, M = null;
6879
+ const x = z === "AITopPicks" || z === "AIGroupingCards", $ = z === "ActionButtons" ? I?.props?.buttons : void 0, te = z === "ActionButtons" && this._modeController.mode !== "shopping" && Array.isArray($) && $.length > 0 && $.every((R) => R.action?.type === "inputText");
6880
+ let ne = !1, re = !1;
6881
+ if (ae && G && (ie.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), x && (!d.silent || s))
6882
+ if (d.threadId && this._rememberPanelAiSpec(d.threadId, f), H) {
6883
+ const R = this._renderUISpec(f, ie);
6884
+ q = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: R }), ne = !0, M = null;
6884
6885
  } else
6885
- M = f, ie = !0;
6886
- const he = s && (F === "GroundingReviewCard" || x);
6887
- if (!x && (!d.silent || he) && (te !== "panel" || F === "ProductCard" || ee && F === "ProductGrid" && !q) && (F !== "ActionButtons" || ae) && !re && !(ie && x)) {
6888
- const z = this._shadow?.querySelector(".gengage-chat-messages");
6889
- if (z) {
6890
- const Y = this._renderUISpec(f, ne);
6891
- d.threadId && (Y.dataset.threadId = d.threadId), z.appendChild(Y), this._scrollInlineIntoView(Y, d.threadId), this._drawer?.refreshPresentationCollapsed(), ee && F === "ProductGrid" && (C = !0);
6886
+ M = f, re = !0;
6887
+ const he = s && (z === "GroundingReviewCard" || x);
6888
+ if (!x && (!d.silent || he) && (ee !== "panel" || z === "ProductCard" || ae && z === "ProductGrid" && !G) && (z !== "ActionButtons" || te) && !ne && !(re && x)) {
6889
+ const R = this._shadow?.querySelector(".gengage-chat-messages");
6890
+ if (R) {
6891
+ const Y = this._renderUISpec(f, ie);
6892
+ d.threadId && (Y.dataset.threadId = d.threadId), R.appendChild(Y), this._scrollInlineIntoView(Y, d.threadId), this._drawer?.refreshPresentationCollapsed(), ae && z === "ProductGrid" && (C = !0);
6892
6893
  }
6893
6894
  }
6894
- if ((F === "ProductGrid" || F === "ProductCard") && d.threadId) {
6895
- const z = I?.children ?? [], Y = F === "ProductGrid" ? z.map((Z) => f.elements[Z]?.props?.product).filter(Boolean) : [I?.props?.product].filter(Boolean);
6895
+ if ((z === "ProductGrid" || z === "ProductCard") && d.threadId) {
6896
+ const R = I?.children ?? [], Y = z === "ProductGrid" ? R.map((Z) => f.elements[Z]?.props?.product).filter(Boolean) : [I?.props?.product].filter(Boolean);
6896
6897
  for (const Z of Y) {
6897
6898
  const W = Z.sku;
6898
6899
  W && this._viewedProductSkus.add(W);
6899
6900
  }
6900
6901
  }
6901
- if (F === "ProductGrid" || F === "ProductDetailsPanel") {
6902
- const z = (F === "ProductGrid" ? (I?.children ?? []).map((Y) => f.elements[Y]?.props?.product).filter(Boolean) : [I?.props?.product ?? I?.props].filter(Boolean)).map((Y) => Y.imageUrl).filter((Y) => typeof Y == "string").slice(0, 5);
6903
- z.length > 0 && this._bridge?.send("previewImages", { images: z });
6902
+ if (z === "ProductGrid" || z === "ProductDetailsPanel") {
6903
+ const R = (z === "ProductGrid" ? (I?.children ?? []).map((Y) => f.elements[Y]?.props?.product).filter(Boolean) : [I?.props?.product ?? I?.props].filter(Boolean)).map((Y) => Y.imageUrl).filter((Y) => typeof Y == "string").slice(0, 5);
6904
+ R.length > 0 && this._bridge?.send("previewImages", { images: R });
6904
6905
  }
6905
6906
  const fe = I?.children?.length ?? 0;
6906
- if (F === "ProductGrid" && te === "panel" && !ee && fe > 1 && !this._isMobileViewport && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Hi(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = Ri({
6907
+ if (z === "ProductGrid" && ee === "panel" && !ae && fe > 1 && !this._isMobileViewport && !this._modeController.isChoicePrompterHidden && !this._comparisonSelectMode && !Hi(this._currentThreadId ?? "") && (this._clearChoicePrompter(), this._choicePrompterEl = Ri({
6907
6908
  heading: this._i18n.choicePrompterHeading,
6908
6909
  suggestion: this._i18n.choicePrompterSuggestion,
6909
6910
  ctaLabel: this._i18n.choicePrompterCta,
@@ -6915,11 +6916,11 @@ var ko = class Te extends Va {
6915
6916
  onDismiss: () => {
6916
6917
  this._choicePrompterEl = null;
6917
6918
  }
6918
- }), this._mountChoicePrompter()), F === "ActionButtons") {
6919
- const z = I?.props?.buttons;
6920
- if (z && z.length > 0 && !ae) {
6919
+ }), this._mountChoicePrompter()), z === "ActionButtons") {
6920
+ const R = I?.props?.buttons;
6921
+ if (R && R.length > 0 && !te) {
6921
6922
  const Y = [], Z = [];
6922
- for (const W of z) if (Bi(W)) {
6923
+ for (const W of R) if (Bi(W)) {
6923
6924
  const ce = {
6924
6925
  label: W.label,
6925
6926
  action: W.action
@@ -7011,18 +7012,18 @@ var ko = class Te extends Va {
7011
7012
  });
7012
7013
  const S = C;
7013
7014
  _ && !C && b(), _ = !1, C = !1;
7014
- const A = d.content != null && d.content.length > 0 || u.length > 0 || S, O = d.silent || A, I = typeof navigator < "u" && navigator.onLine === !1 && Wt(f), F = () => {
7015
+ const A = d.content != null && d.content.length > 0 || u.length > 0 || S, O = d.silent || A, I = typeof navigator < "u" && navigator.onLine === !1 && Wt(f), z = () => {
7015
7016
  this._shadow?.querySelector(`[data-message-id="${le(d.id)}"]`)?.remove();
7016
- const te = this._messages.indexOf(d);
7017
- te >= 0 && this._messages.splice(te, 1);
7017
+ const ee = this._messages.indexOf(d);
7018
+ ee >= 0 && this._messages.splice(ee, 1);
7018
7019
  };
7019
- let q = !1;
7020
- const ee = () => {
7020
+ let G = !1;
7021
+ const ae = () => {
7021
7022
  if (I) return;
7022
7023
  this.emit("error", f);
7023
- const te = f.message;
7024
- te === this._lastErrorMessage ? this._consecutiveErrorCount++ : (this._consecutiveErrorCount = 1, this._lastErrorMessage = te);
7025
- const ne = f.message.trim(), se = ne.length > 0 ? ne : this._i18n.errorMessage, x = {
7024
+ const ee = f.message;
7025
+ ee === this._lastErrorMessage ? this._consecutiveErrorCount++ : (this._consecutiveErrorCount = 1, this._lastErrorMessage = ee);
7026
+ const ie = f.message.trim(), se = ie.length > 0 ? ie : this._i18n.errorMessage, x = {
7026
7027
  onRetry: () => {
7027
7028
  this._lastSentAction && this._sendAction(this._lastSentAction.action, this._lastSentAction.options);
7028
7029
  },
@@ -7031,11 +7032,11 @@ var ko = class Te extends Va {
7031
7032
  }
7032
7033
  };
7033
7034
  if (this._consecutiveErrorCount >= 2) {
7034
- F(), q = !0, this._drawer?.showErrorWithRecovery(this._i18n.accountInactiveMessage, x);
7035
+ z(), G = !0, this._drawer?.showErrorWithRecovery(this._i18n.accountInactiveMessage, x);
7035
7036
  return;
7036
7037
  }
7037
7038
  if (go(f, se)) {
7038
- F(), q = !0, this._drawer?.showErrorWithRecovery(se, x);
7039
+ z(), G = !0, this._drawer?.showErrorWithRecovery(se, x);
7039
7040
  return;
7040
7041
  }
7041
7042
  d.content = se, d.status = "done";
@@ -7046,28 +7047,28 @@ var ko = class Te extends Va {
7046
7047
  };
7047
7048
  if (s && !A) if (c || this._hasUnavailableProductContext()) {
7048
7049
  this._drawer?.setPills([]);
7049
- const te = this._i18n.productNotFoundMessage;
7050
- d.content = te, d.status = "done", this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, te), this._markUnavailableProductContext();
7050
+ const ee = this._i18n.productNotFoundMessage;
7051
+ d.content = ee, d.status = "done", this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, ee), this._markUnavailableProductContext();
7051
7052
  } else d.status = "done";
7052
7053
  else if (O)
7053
- this._drawer?.setPills([]), d.silent || ee();
7054
- else if (ee(), I) return;
7055
- s && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !q && d.status === "streaming" && (d.status = "error");
7054
+ this._drawer?.setPills([]), d.silent || ae();
7055
+ else if (ae(), I) return;
7056
+ s && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !G && d.status === "streaming" && (d.status = "error");
7056
7057
  },
7057
7058
  onDone: () => {
7058
7059
  if (U && this._abortControllers.delete(U), !o && i !== this._activeRequestThreadId) return;
7059
7060
  if (X = !0, N && this._panel && this._drawer) {
7060
7061
  const I = this._buildRenderContext();
7061
7062
  I.isStreaming = !1;
7062
- const F = N.elements[N.root], q = this._panel.toPanelSpec(N);
7063
+ const z = N.elements[N.root], G = this._panel.toPanelSpec(N);
7063
7064
  this._applyPanelListHeadingToContext(I, {
7064
7065
  kind: "spec",
7065
- spec: q
7066
+ spec: G
7066
7067
  });
7067
- const ee = F?.type ?? "ProductGrid";
7068
- Q(q, I, ee), K(ee, F, "replace", !1), C = !0;
7068
+ const ae = z?.type ?? "ProductGrid";
7069
+ Q(G, I, ae), K(ae, z, "replace", !1), C = !0;
7069
7070
  }
7070
- N = null, M && H(!1), k(), this._activeRequestThreadId = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), Fn(L, {
7071
+ N = null, M && F(!1), k(), this._activeRequestThreadId = null, this._consecutiveErrorCount = 0, this._lastErrorMessage = "", r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), Fn(L, {
7071
7072
  drawer: this._drawer,
7072
7073
  ensureRendered: () => {
7073
7074
  },