@gengage/assistant-fe 0.6.46 → 0.6.48

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 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-DxtNGhlh.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-DVERFkOu.js";
2
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-BsHKmSMq.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-BfYLNhFF.js";
3
+ import { i as ze, s as Qt, t as Ya } from "./widget-base-CrsfKJMB.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-BLDisAcn.js";
5
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() {
@@ -85,15 +85,15 @@ function cn(t, e) {
85
85
  case "inputText": {
86
86
  const i = typeof t.payload == "string", o = i ? { text: t.payload } : t.payload != null && typeof t.payload == "object" && !Array.isArray(t.payload) ? t.payload : n, s = e.genericNonPdpLaunch === !0 && e.pageContext?.pageType !== "pdp" && (o.is_entry_question === 1 || o.is_entry_question === !0), c = o.is_search_suggestion === 1 || o.is_search_suggestion === !0, l = { is_launcher: 0 };
87
87
  if (!s && e.pageContext?.extra && (l.page_details = e.pageContext.extra), !s && !c && !i && !("sku_list" in o)) {
88
- const p = e.pageContext?.skuList && e.pageContext.skuList.length > 0 ? e.pageContext.skuList : e.pageContext?.sku ? [e.pageContext.sku] : void 0;
89
- p && p.length > 0 && (l.sku_list = p);
88
+ const g = e.pageContext?.skuList && e.pageContext.skuList.length > 0 ? e.pageContext.skuList : e.pageContext?.sku ? [e.pageContext.sku] : void 0;
89
+ g && g.length > 0 && (l.sku_list = g);
90
90
  }
91
91
  "is_suggested_text" in o || (l.is_suggested_text = 0);
92
- const d = { ...o };
93
- for (const [p, h] of Object.entries(l)) p in d || (d[p] = h);
92
+ const p = { ...o };
93
+ for (const [g, h] of Object.entries(l)) g in p || (p[g] = h);
94
94
  return {
95
95
  ...t,
96
- payload: d
96
+ payload: p
97
97
  };
98
98
  }
99
99
  case "findSimilar": {
@@ -206,25 +206,25 @@ function pn(t, e, a) {
206
206
  body: s,
207
207
  signal: n.signal
208
208
  };
209
- const d = c ? await fetch(o, l) : await Ia(o, l);
210
- if (!d.ok) {
211
- let h = d.statusText;
209
+ const p = c ? await fetch(o, l) : await Ia(o, l);
210
+ if (!p.ok) {
211
+ let h = p.statusText;
212
212
  try {
213
- const m = await d.json(), x = m.detail ?? m.message ?? m.error;
213
+ const m = await p.json(), x = m.detail ?? m.message ?? m.error;
214
214
  typeof x == "string" && (h = x);
215
215
  } catch {
216
216
  }
217
- e.onError(/* @__PURE__ */ new Error(`HTTP ${d.status}: ${h}`));
217
+ e.onError(/* @__PURE__ */ new Error(`HTTP ${p.status}: ${h}`));
218
218
  return;
219
219
  }
220
- const p = kt(e);
221
- await Sa(d, {
220
+ const g = kt(e);
221
+ await Sa(p, {
222
222
  onEvent: (h) => {
223
223
  const m = Pa(h);
224
224
  if (m)
225
225
  switch (m.type) {
226
226
  case "text_chunk":
227
- p.callbacks.onTextChunk(m.content, m.final === !0, {
227
+ g.callbacks.onTextChunk(m.content, m.final === !0, {
228
228
  productMentions: m.productMentions,
229
229
  skuToProductItem: m.skuToProductItem,
230
230
  conversationMode: m.conversationMode,
@@ -233,25 +233,25 @@ function pn(t, e, a) {
233
233
  });
234
234
  break;
235
235
  case "ui_spec":
236
- p.callbacks.onUISpec(m.spec, m.widget, m.panelHint, m.clearPanel === !0);
236
+ g.callbacks.onUISpec(m.spec, m.widget, m.panelHint, m.clearPanel === !0);
237
237
  break;
238
238
  case "action":
239
- p.callbacks.onAction(m);
239
+ g.callbacks.onAction(m);
240
240
  break;
241
241
  case "metadata":
242
- p.callbacks.onMetadata(m);
242
+ g.callbacks.onMetadata(m);
243
243
  break;
244
244
  case "error":
245
- p.callbacks.onError(new Error(m.message));
245
+ g.callbacks.onError(new Error(m.message));
246
246
  break;
247
247
  case "done":
248
- p.fireDone();
248
+ g.fireDone();
249
249
  break;
250
250
  }
251
251
  },
252
252
  onError: e.onError,
253
253
  signal: n.signal
254
- }), p.fireDone();
254
+ }), g.fireDone();
255
255
  } catch (o) {
256
256
  if (o instanceof DOMException && o.name === "AbortError") return;
257
257
  e.onError(o instanceof Error ? o : new Error(String(o)));
@@ -311,7 +311,9 @@ var Re = {
311
311
  loadingMessage: "İsteğinizi inceliyorum...",
312
312
  loadingSequenceGeneric: [
313
313
  "İsteğinizi inceliyorum...",
314
- "Ürün ve yorumlara bakıyorum...",
314
+ "Ürün detaylarını inceliyorum...",
315
+ "Kontrol ediyorum...",
316
+ "Bulduklarımı değerlendiriyorum...",
315
317
  "Detayları inceliyorum..."
316
318
  ],
317
319
  loadingSequencePanel: [
@@ -459,7 +461,9 @@ var Re = {
459
461
  loadingMessage: "Reviewing your request...",
460
462
  loadingSequenceGeneric: [
461
463
  "Reviewing your request...",
462
- "Looking through products and reviews...",
464
+ "Reviewing product details...",
465
+ "Checking the strongest signals...",
466
+ "Evaluating what I found...",
463
467
  "Reviewing the details..."
464
468
  ],
465
469
  loadingSequencePanel: [
@@ -649,14 +653,14 @@ function na(t, e, a) {
649
653
  c.className = "gengage-chat-beauty-photo-step-content";
650
654
  const l = document.createElement("div");
651
655
  l.className = "gengage-chat-beauty-photo-step-title", l.textContent = (typeof n.title == "string" ? n.title : void 0) ?? i.beautyPhotoStepTitle;
652
- const d = document.createElement("p");
653
- d.className = "gengage-chat-beauty-photo-step-desc", d.textContent = (typeof n.description == "string" ? n.description : void 0) ?? i.beautyPhotoStepDescription;
654
- const p = document.createElement("div");
655
- p.className = "gengage-chat-beauty-photo-step-actions";
656
+ const p = document.createElement("p");
657
+ p.className = "gengage-chat-beauty-photo-step-desc", p.textContent = (typeof n.description == "string" ? n.description : void 0) ?? i.beautyPhotoStepDescription;
658
+ const g = document.createElement("div");
659
+ g.className = "gengage-chat-beauty-photo-step-actions";
656
660
  const h = document.createElement("button");
657
661
  h.type = "button", h.className = "gengage-chat-beauty-photo-step-upload gds-btn gds-btn-primary", h.textContent = r ? i.beautyPhotoStepProcessing : (typeof n.upload_label == "string" ? n.upload_label : void 0) ?? i.beautyPhotoStepUpload, h.disabled = r, a?.onUpload && h.addEventListener("click", () => a.onUpload());
658
662
  const m = document.createElement("button");
659
- return m.type = "button", m.className = "gengage-chat-beauty-photo-step-skip gds-btn gds-btn-ghost", m.textContent = (typeof n.skip_label == "string" ? n.skip_label : void 0) ?? i.beautyPhotoStepSkip, a?.onSkip && m.addEventListener("click", () => a.onSkip()), p.appendChild(h), p.appendChild(m), c.appendChild(l), c.appendChild(d), c.appendChild(p), o.appendChild(s), o.appendChild(c), o;
663
+ return m.type = "button", m.className = "gengage-chat-beauty-photo-step-skip gds-btn gds-btn-ghost", m.textContent = (typeof n.skip_label == "string" ? n.skip_label : void 0) ?? i.beautyPhotoStepSkip, a?.onSkip && m.addEventListener("click", () => a.onSkip()), g.appendChild(h), g.appendChild(m), c.appendChild(l), c.appendChild(p), c.appendChild(g), o.appendChild(s), o.appendChild(c), o;
660
664
  }
661
665
  function Cn(t, e) {
662
666
  if (t) return t;
@@ -727,10 +731,10 @@ function ia(t, e) {
727
731
  c.className = "gengage-chat-photo-analysis-section gengage-chat-photo-analysis-section--celeb";
728
732
  const l = document.createElement("h4");
729
733
  l.className = "gengage-chat-photo-analysis-section-title", l.textContent = t.celebStyle;
730
- const d = document.createElement("p");
731
- if (d.className = "gengage-chat-photo-analysis-celeb-name", d.textContent = e.celebStyle, c.appendChild(l), c.appendChild(d), e.celebStyleReason) {
732
- const p = document.createElement("p");
733
- p.className = "gengage-chat-photo-analysis-celeb-reason", p.textContent = e.celebStyleReason, c.appendChild(p);
734
+ const p = document.createElement("p");
735
+ if (p.className = "gengage-chat-photo-analysis-celeb-name", p.textContent = e.celebStyle, c.appendChild(l), c.appendChild(p), e.celebStyleReason) {
736
+ const g = document.createElement("p");
737
+ g.className = "gengage-chat-photo-analysis-celeb-reason", g.textContent = e.celebStyleReason, c.appendChild(g);
734
738
  }
735
739
  r.appendChild(c);
736
740
  }
@@ -764,7 +768,7 @@ var Et = '<svg viewBox="0 0 16 16" class="gengage-chat-icon"><path d="M3 8h10M9
764
768
  review: '<svg viewBox="0 0 16 16" class="gengage-chat-icon"><polygon points="8,1 10,6 15,6 11,9 12.5,14 8,11 3.5,14 5,9 1,6 6,6" fill="none" stroke="currentColor" stroke-width="1.5"/></svg>',
765
769
  info: '<svg viewBox="0 0 16 16" class="gengage-chat-icon"><circle cx="8" cy="8" r="7" fill="none" stroke="currentColor" stroke-width="1.5"/><line x1="8" y1="7" x2="8" y2="12" stroke="currentColor" stroke-width="1.5"/><circle cx="8" cy="4.5" r="0.8" fill="currentColor"/></svg>',
766
770
  similar: '<svg viewBox="0 0 16 16" class="gengage-chat-icon"><rect x="1" y="3" width="6" height="6" rx="1" fill="none" stroke="currentColor" stroke-width="1.5"/><rect x="9" y="3" width="6" height="6" rx="1" fill="none" stroke="currentColor" stroke-width="1.5"/></svg>'
767
- }, Tn = Re, An = 1400, Lt = 1500, In = /data:image\/(png|jpeg|jpg|webp);base64,[A-Za-z0-9+/=]+/gi;
771
+ }, Tn = Re, An = 3e3, Lt = 1500, In = /data:image\/(png|jpeg|jpg|webp);base64,[A-Za-z0-9+/=]+/gi;
768
772
  async function Mn(t) {
769
773
  for (const e of t) for (const a of e.types)
770
774
  if (a.startsWith("image/"))
@@ -853,14 +857,14 @@ var Bn = class {
853
857
  }
854
858
  const l = document.createElement("div");
855
859
  l.className = "gengage-chat-header-info", l.dataset.gengagePart = "chat-header-info";
856
- const d = document.createElement("div");
857
- d.className = "gengage-chat-header-title-row", d.dataset.gengagePart = "chat-header-title-row";
858
- const p = document.createElement("span");
859
- 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) {
860
+ const p = document.createElement("div");
861
+ p.className = "gengage-chat-header-title-row", p.dataset.gengagePart = "chat-header-title-row";
862
+ const g = document.createElement("span");
863
+ if (g.className = "gengage-chat-header-title", g.dataset.gengagePart = "chat-header-title", g.textContent = e.headerTitle ?? this.i18n.headerTitle ?? "Product Expert", p.appendChild(g), e.headerBadge) {
860
864
  const w = document.createElement("span");
861
- w.className = "gengage-chat-header-badge gds-badge gds-badge-brand", w.dataset.gengagePart = "chat-header-badge", w.textContent = e.headerBadge, d.appendChild(w);
865
+ w.className = "gengage-chat-header-badge gds-badge gds-badge-brand", w.dataset.gengagePart = "chat-header-badge", w.textContent = e.headerBadge, p.appendChild(w);
862
866
  }
863
- if (l.appendChild(d), e.footerAttribution === void 0) {
867
+ if (l.appendChild(p), e.footerAttribution === void 0) {
864
868
  const w = this._createLegacyHeaderPoweredBy();
865
869
  w && l.appendChild(w);
866
870
  }
@@ -942,85 +946,85 @@ var Bn = class {
942
946
  }
943
947
  this.togglePanel(), this._onPanelToggle?.();
944
948
  });
945
- let g = null, _ = null;
949
+ let d = null, _ = null;
946
950
  const y = 24, b = (w) => {
947
951
  if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768)) return;
948
952
  const Y = w.changedTouches?.[0];
949
- Y && (g = Y.clientX, _ = Y.clientY);
953
+ Y && (d = Y.clientX, _ = Y.clientY);
950
954
  }, A = (w) => {
951
- if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || g === null || _ === null) return;
955
+ if (!(this._options.getMobileViewport?.() ?? window.innerWidth <= 768) || d === null || _ === null) return;
952
956
  const Y = w.changedTouches?.[0];
953
957
  if (!Y) return;
954
- const ce = Y.clientX - g, oe = Y.clientY - _;
955
- if (g = null, _ = null, Math.abs(oe) < y || Math.abs(oe) < Math.abs(ce)) return;
958
+ const ce = Y.clientX - d, oe = Y.clientY - _;
959
+ if (d = null, _ = null, Math.abs(oe) < y || Math.abs(oe) < Math.abs(ce)) return;
956
960
  const M = oe < 0;
957
961
  M !== this._panelCollapsed && (this._ignoreNextDividerClick = !0, this.setPanelCollapsed(M), this._onPanelToggle?.());
958
962
  };
959
963
  this._dividerEl.addEventListener("touchstart", b, { passive: !0 }), this._dividerEl.addEventListener("touchend", A, { passive: !0 }), this._cleanups.push(() => {
960
964
  this._dividerEl.removeEventListener("touchstart", b), this._dividerEl.removeEventListener("touchend", A);
961
965
  }), this._dividerEl.appendChild(u), x.appendChild(this._dividerEl);
962
- const T = document.createElement("div");
963
- T.className = "gengage-chat-conversation", T.dataset.gengagePart = "chat-conversation", this._conversationEl = T, T.appendChild(i);
964
- const k = document.createElement("div");
965
- 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);
966
- const L = () => k.classList.add("gengage-chat-offline-bar--visible"), z = () => k.classList.remove("gengage-chat-offline-bar--visible");
967
- window.addEventListener("offline", L), window.addEventListener("online", z), this._cleanups.push(() => {
968
- window.removeEventListener("offline", L), window.removeEventListener("online", z);
969
- }), 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);
970
- const O = document.createElement("button");
971
- 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", () => {
966
+ const L = document.createElement("div");
967
+ L.className = "gengage-chat-conversation", L.dataset.gengagePart = "chat-conversation", this._conversationEl = L, L.appendChild(i);
968
+ const E = document.createElement("div");
969
+ E.className = "gengage-chat-offline-bar gds-evidence-card gds-evidence-card-warning", E.dataset.gengagePart = "chat-offline-bar", E.setAttribute("role", "status"), E.setAttribute("aria-live", "polite"), E.textContent = this.i18n.offlineMessage, typeof navigator < "u" && !navigator.onLine && E.classList.add("gengage-chat-offline-bar--visible"), L.appendChild(E);
970
+ const T = () => E.classList.add("gengage-chat-offline-bar--visible"), N = () => E.classList.remove("gengage-chat-offline-bar--visible");
971
+ window.addEventListener("offline", T), window.addEventListener("online", N), this._cleanups.push(() => {
972
+ window.removeEventListener("offline", T), window.removeEventListener("online", N);
973
+ }), this._kvkkSlot = document.createElement("div"), this._kvkkSlot.className = "gengage-chat-kvkk-slot", this._kvkkSlot.dataset.gengagePart = "chat-kvkk-slot", L.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);
974
+ const F = document.createElement("button");
975
+ F.type = "button", F.className = "gengage-chat-former-messages-btn gds-chip", F.dataset.gengagePart = "chat-former-messages-button", F.textContent = this.i18n.showFormerMessagesButton, F.setAttribute("aria-label", this.i18n.showFormerMessagesButton), F.style.display = "none", F.addEventListener("click", () => {
972
976
  this._options.presentation?.onReleasePresentationFocus?.();
973
- }), this.messagesEl.appendChild(O), this._formerMessagesBtn = O;
977
+ }), this.messagesEl.appendChild(F), this._formerMessagesBtn = F;
974
978
  const X = () => {
975
979
  this._userInteractionUntil = Date.now() + 2e3;
976
980
  };
977
- let E = !1;
978
- const R = () => this._options.presentation, F = () => {
979
- E || (E = !0, requestAnimationFrame(() => {
980
- E = !1;
981
+ let C = !1;
982
+ const R = () => this._options.presentation, D = () => {
983
+ C || (C = !0, requestAnimationFrame(() => {
984
+ C = !1;
981
985
  const { scrollTop: w, scrollHeight: Y, clientHeight: ce } = this.messagesEl, oe = Y - w - ce;
982
986
  this._userScrolledUp = oe > 10;
983
987
  const M = this._presentationPinned ? oe < 96 : oe < 32, H = Date.now(), ee = H < this._programmaticScrollUntil, pe = !M && H < this._userInteractionUntil, V = ee ? !1 : pe;
984
988
  M !== this._presentationPinned && (this._presentationPinned = M, R()?.onPinnedToBottomChange?.(M)), V !== this._presentationUserInteracting && (this._presentationUserInteracting = V, R()?.onUserInteractingChange?.(V));
985
989
  }));
986
990
  };
987
- this.messagesEl.addEventListener("scroll", F, { passive: !0 }), this._cleanups.push(() => {
988
- this.messagesEl.removeEventListener("scroll", F);
991
+ this.messagesEl.addEventListener("scroll", D, { passive: !0 }), this._cleanups.push(() => {
992
+ this.messagesEl.removeEventListener("scroll", D);
989
993
  });
990
- const B = (w) => {
994
+ const z = (w) => {
991
995
  X(), w.deltaY < -6 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
992
996
  };
993
- this.messagesEl.addEventListener("wheel", B, { passive: !0 }), this._cleanups.push(() => this.messagesEl.removeEventListener("wheel", B));
994
- const C = (w) => {
997
+ this.messagesEl.addEventListener("wheel", z, { passive: !0 }), this._cleanups.push(() => this.messagesEl.removeEventListener("wheel", z));
998
+ const k = (w) => {
995
999
  X(), this._touchStartY = w.touches[0]?.clientY ?? null;
996
- }, U = (w) => {
1000
+ }, O = (w) => {
997
1001
  X();
998
1002
  const Y = w.touches[0]?.clientY, ce = this._touchStartY;
999
1003
  typeof Y == "number" && typeof ce == "number" && Y - ce > 10 && this._presentationFocusThreadId && this._options.presentation?.onFormerMessagesHint?.();
1000
1004
  };
1001
- this.messagesEl.addEventListener("touchstart", C, { passive: !0 }), this.messagesEl.addEventListener("touchmove", U, { passive: !0 }), this._cleanups.push(() => {
1002
- this.messagesEl.removeEventListener("touchstart", C), this.messagesEl.removeEventListener("touchmove", U);
1003
- }), 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";
1004
- const N = document.createElement("div");
1005
- N.className = "gengage-chat-pills-scroll", N.dataset.gengagePart = "chat-suggestion-pills-scroll", this._pillsEl.appendChild(N);
1005
+ this.messagesEl.addEventListener("touchstart", k, { passive: !0 }), this.messagesEl.addEventListener("touchmove", O, { passive: !0 }), this._cleanups.push(() => {
1006
+ this.messagesEl.removeEventListener("touchstart", k), this.messagesEl.removeEventListener("touchmove", O);
1007
+ }), L.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";
1008
+ const B = document.createElement("div");
1009
+ B.className = "gengage-chat-pills-scroll", B.dataset.gengagePart = "chat-suggestion-pills-scroll", this._pillsEl.appendChild(B);
1006
1010
  const q = document.createElement("button");
1007
1011
  q.className = "gengage-chat-pills-arrow gds-btn gds-btn-ghost", q.dataset.gengagePart = "chat-suggestion-pills-more", q.type = "button", q.setAttribute("aria-label", this.i18n.moreSuggestionsAriaLabel), q.textContent = "›", q.addEventListener("click", () => {
1008
- N.scrollBy({
1012
+ B.scrollBy({
1009
1013
  left: 150,
1010
1014
  behavior: "smooth"
1011
1015
  });
1012
1016
  }), this._pillsEl.appendChild(q);
1013
- let D = !1;
1017
+ let U = !1;
1014
1018
  const ne = () => {
1015
- D || (D = !0, requestAnimationFrame(() => {
1016
- D = !1;
1017
- const w = N.scrollLeft + N.clientWidth >= N.scrollWidth - 4;
1019
+ U || (U = !0, requestAnimationFrame(() => {
1020
+ U = !1;
1021
+ const w = B.scrollLeft + B.clientWidth >= B.scrollWidth - 4;
1018
1022
  q.style.display = w ? "none" : "";
1019
1023
  }));
1020
1024
  };
1021
- N.addEventListener("scroll", ne, { passive: !0 }), this._cleanups.push(() => {
1022
- N.removeEventListener("scroll", ne);
1023
- }), T.appendChild(this._pillsEl), this._inputChipsEl = document.createElement("div"), this._inputChipsEl.className = "gengage-chat-input-chips", this._inputChipsEl.dataset.gengagePart = "chat-input-chips", this._inputChipsEl.style.display = "none", T.appendChild(this._inputChipsEl);
1025
+ B.addEventListener("scroll", ne, { passive: !0 }), this._cleanups.push(() => {
1026
+ B.removeEventListener("scroll", ne);
1027
+ }), L.appendChild(this._pillsEl), this._inputChipsEl = document.createElement("div"), this._inputChipsEl.className = "gengage-chat-input-chips", this._inputChipsEl.dataset.gengagePart = "chat-input-chips", this._inputChipsEl.style.display = "none", L.appendChild(this._inputChipsEl);
1024
1028
  const W = document.createElement("div");
1025
1029
  W.className = "gengage-chat-input-area", W.dataset.gengagePart = "chat-input-area", this.inputEl = document.createElement("textarea"), this.inputEl.className = "gengage-chat-input", this.inputEl.dataset.gengagePart = "chat-input", this.inputEl.rows = 1, this.inputEl.placeholder = this.i18n.inputPlaceholder, this.inputEl.setAttribute("aria-label", this.i18n.inputAriaLabel ?? this.i18n.inputPlaceholder), this.inputEl.addEventListener("input", () => {
1026
1030
  this._resizeRafId !== null && cancelAnimationFrame(this._resizeRafId), this._resizeRafId = requestAnimationFrame(() => {
@@ -1105,7 +1109,7 @@ var Bn = class {
1105
1109
  onError: (w, Y) => {
1106
1110
  this._micBtn?.classList.remove("gengage-chat-mic-btn--active");
1107
1111
  }
1108
- }, { 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);
1112
+ }, { lang: this._voiceLang })), te.appendChild(this.sendBtn), W.appendChild(this._previewStrip), W.appendChild(this._fileInput), W.appendChild(te), L.appendChild(W), x.appendChild(L), 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(L);
1109
1113
  const se = this._createFooterAttribution();
1110
1114
  se && this.root.appendChild(se);
1111
1115
  const re = (w) => {
@@ -1150,8 +1154,13 @@ var Bn = class {
1150
1154
  }
1151
1155
  showTypingIndicator(t, e = "auto") {
1152
1156
  this.removeTypingIndicator();
1153
- const a = this._thinkingSteps.length > 0 ? this._thinkingSteps.slice(-3) : t ? [t] : this.i18n.loadingSequenceGeneric, { root: n, binding: r } = this._createLoadingSequence("chat", a, "chat-typing-indicator", "gengage-chat-typing");
1154
- n.dataset.typing = "true", this._typingLoadingBinding = r, this.messagesEl.appendChild(n), this.setTypingIndicatorMode(e), this._scrollToBottom(!0);
1157
+ const a = this._thinkingSteps.length > 0, n = a ? this._thinkingSteps.slice(-3) : t ? [t] : this.i18n.loadingSequenceGeneric, { root: r, binding: i } = this._createLoadingSequence("chat", n, "chat-typing-indicator", "gengage-chat-typing");
1158
+ r.dataset.typing = "true", this._typingLoadingBinding = i, this.messagesEl.appendChild(r), a && this._applyLoadingSteps(i, this._thinkingSteps, !0), this.setTypingIndicatorMode(e), this._scrollToBottom(!0);
1159
+ }
1160
+ resumeTypingIndicator() {
1161
+ if (this._typingLoadingBinding) return;
1162
+ const t = this._thinkingSteps.length > 0, e = t ? this._thinkingSteps.slice(-3) : this.i18n.loadingSequenceGeneric, { root: a, binding: n } = this._createLoadingSequence("chat", e, "chat-typing-indicator", "gengage-chat-typing");
1163
+ a.dataset.typing = "true", this._typingLoadingBinding = n, this.messagesEl.appendChild(a), t && this._applyLoadingSteps(n, this._thinkingSteps, !0), this.setTypingIndicatorMode("auto"), this._scrollToBottom(!0);
1155
1164
  }
1156
1165
  addThinkingStep(t) {
1157
1166
  const e = t.trim();
@@ -1324,8 +1333,8 @@ var Bn = class {
1324
1333
  if (this._panelAiZoneEl.isConnected && (this._clearPanelAiZoneState(), t !== "hidden")) {
1325
1334
  if (this._panelAiZoneEl.removeAttribute("hidden"), t === "analyzing") {
1326
1335
  this._panelAiZoneEl.innerHTML = "";
1327
- const a = [e?.analyzingLabel ?? this.i18n.aiAnalysisAnalyzingLabel, ...this.i18n.loadingSequencePanel], { root: n, binding: r } = this._createLoadingSequence("panel", this._thinkingSteps.length > 0 ? this._thinkingSteps.slice(-3) : a, "panel-ai-zone-loading", "gengage-chat-panel-ai-zone-inner");
1328
- this._panelAiZoneLoadingBinding = r, this._panelAiZoneEl.appendChild(n);
1336
+ const a = [e?.analyzingLabel ?? this.i18n.aiAnalysisAnalyzingLabel, ...this.i18n.loadingSequencePanel], n = this._thinkingSteps.length > 0, { root: r, binding: i } = this._createLoadingSequence("panel", n ? this._thinkingSteps.slice(-3) : a, "panel-ai-zone-loading", "gengage-chat-panel-ai-zone-inner");
1337
+ this._panelAiZoneLoadingBinding = i, n && this._applyLoadingSteps(i, this._thinkingSteps, !0), this._panelAiZoneEl.appendChild(r);
1329
1338
  } else t === "results" && e?.resultEl && (this._panelAiZoneEl.innerHTML = "", this._panelAiZoneEl.appendChild(e.resultEl));
1330
1339
  this.setTypingIndicatorMode("auto");
1331
1340
  }
@@ -1414,112 +1423,112 @@ var Bn = class {
1414
1423
  this._destroyLoadingBinding(this._panelLoadingBinding), this._panelLoadingBinding = null, this._dividerEl.classList.remove("gengage-chat-panel-divider--hidden"), this._panelEl.innerHTML = "", this._resetPanelAiZoneElement(), this._panelEl.appendChild(this._panelTopBar.getElement()), this._panelEl.appendChild(this._panelAiZoneEl);
1415
1424
  const e = document.createElement("div");
1416
1425
  e.className = "gengage-chat-panel-skeleton";
1417
- const a = t === "comparisonTable" ? this.i18n.loadingSequenceComparison : this.i18n.loadingSequencePanel, { root: n, binding: r } = this._createLoadingSequence("panel", this._thinkingSteps.length > 0 ? this._thinkingSteps.slice(-3) : a, "panel-loading-status", "gengage-chat-panel-loading-status");
1418
- switch (this._panelLoadingBinding = r, t) {
1426
+ const a = t === "comparisonTable" ? this.i18n.loadingSequenceComparison : this.i18n.loadingSequencePanel, n = this._thinkingSteps.length > 0, { root: r, binding: i } = this._createLoadingSequence("panel", n ? this._thinkingSteps.slice(-3) : a, "panel-loading-status", "gengage-chat-panel-loading-status");
1427
+ switch (this._panelLoadingBinding = i, n && this._applyLoadingSteps(i, this._thinkingSteps, !0), t) {
1419
1428
  case "productDetails": {
1420
- e.appendChild(n);
1421
- const i = document.createElement("div");
1422
- i.className = "gengage-chat-panel-skeleton-block gengage-chat-panel-skeleton-block--image", e.appendChild(i);
1423
- for (let o = 0; o < 3; o++) {
1424
- const s = document.createElement("div");
1425
- s.className = "gengage-chat-panel-skeleton-block gengage-chat-panel-skeleton-block--text", e.appendChild(s);
1429
+ e.appendChild(r);
1430
+ const o = document.createElement("div");
1431
+ o.className = "gengage-chat-panel-skeleton-block gengage-chat-panel-skeleton-block--image", e.appendChild(o);
1432
+ for (let s = 0; s < 3; s++) {
1433
+ const c = document.createElement("div");
1434
+ c.className = "gengage-chat-panel-skeleton-block gengage-chat-panel-skeleton-block--text", e.appendChild(c);
1426
1435
  }
1427
1436
  break;
1428
1437
  }
1429
1438
  case "productList":
1430
1439
  case "groupList": {
1431
- e.appendChild(n);
1432
- const i = document.createElement("div");
1433
- i.className = "gengage-chat-panel-skeleton-grid";
1434
- for (let o = 0; o < 6; o++) {
1435
- const s = document.createElement("div");
1436
- s.className = "gengage-chat-panel-skeleton-block gengage-chat-panel-skeleton-block--card", i.appendChild(s);
1440
+ e.appendChild(r);
1441
+ const o = document.createElement("div");
1442
+ o.className = "gengage-chat-panel-skeleton-grid";
1443
+ for (let s = 0; s < 6; s++) {
1444
+ const c = document.createElement("div");
1445
+ c.className = "gengage-chat-panel-skeleton-block gengage-chat-panel-skeleton-block--card", o.appendChild(c);
1437
1446
  }
1438
- e.appendChild(i);
1447
+ e.appendChild(o);
1439
1448
  break;
1440
1449
  }
1441
1450
  case "comparisonTable": {
1442
- e.classList.add("gengage-chat-panel-skeleton--comparison"), e.appendChild(n);
1443
- const i = document.createElement("div");
1444
- i.className = "gengage-chat-comparison gengage-chat-comparison--skeleton", i.setAttribute("aria-busy", "true");
1451
+ e.classList.add("gengage-chat-panel-skeleton--comparison"), e.appendChild(r);
1445
1452
  const o = document.createElement("div");
1446
- o.className = "gengage-chat-comparison-recommended";
1453
+ o.className = "gengage-chat-comparison gengage-chat-comparison--skeleton", o.setAttribute("aria-busy", "true");
1447
1454
  const s = document.createElement("div");
1448
- s.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-label", o.appendChild(s);
1455
+ s.className = "gengage-chat-comparison-recommended";
1449
1456
  const c = document.createElement("div");
1450
- c.className = "gengage-chat-comparison-recommended-body";
1457
+ c.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-label", s.appendChild(c);
1451
1458
  const l = document.createElement("div");
1452
- l.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-img", l.setAttribute("aria-hidden", "true");
1453
- const d = document.createElement("div");
1454
- d.className = "gengage-chat-comparison-recommended-info";
1455
- for (let k = 0; k < 2; k++) {
1456
- const L = document.createElement("div");
1457
- 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);
1458
- }
1459
+ l.className = "gengage-chat-comparison-recommended-body";
1459
1460
  const p = document.createElement("div");
1460
- 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);
1461
+ p.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-img", p.setAttribute("aria-hidden", "true");
1462
+ const g = document.createElement("div");
1463
+ g.className = "gengage-chat-comparison-recommended-info";
1464
+ for (let T = 0; T < 2; T++) {
1465
+ const N = document.createElement("div");
1466
+ N.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-title", T === 1 && N.classList.add("gengage-chat-comparison-skeleton-rec-title--short"), g.appendChild(N);
1467
+ }
1461
1468
  const h = document.createElement("div");
1462
- h.className = "gengage-chat-comparison-highlights";
1469
+ h.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-rec-price", g.appendChild(h), l.appendChild(p), l.appendChild(g), s.appendChild(l);
1463
1470
  const m = document.createElement("div");
1464
- m.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-label", h.appendChild(m);
1465
- const x = document.createElement("ul");
1466
- x.className = "gengage-chat-comparison-skeleton-hl-list";
1467
- for (let k = 0; k < 3; k++) {
1468
- const L = document.createElement("li"), z = document.createElement("div");
1469
- 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);
1471
+ m.className = "gengage-chat-comparison-highlights";
1472
+ const x = document.createElement("div");
1473
+ x.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-label", m.appendChild(x);
1474
+ const v = document.createElement("ul");
1475
+ v.className = "gengage-chat-comparison-skeleton-hl-list";
1476
+ for (let T = 0; T < 3; T++) {
1477
+ const N = document.createElement("li"), F = document.createElement("div");
1478
+ F.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-hl-line", T === 1 && F.classList.add("gengage-chat-comparison-skeleton-hl-line--medium"), T === 2 && F.classList.add("gengage-chat-comparison-skeleton-hl-line--short"), N.appendChild(F), v.appendChild(N);
1470
1479
  }
1471
- h.appendChild(x), o.appendChild(h), i.appendChild(o);
1472
- const v = document.createElement("div");
1473
- v.className = "gengage-chat-comparison-key-differences";
1480
+ m.appendChild(v), s.appendChild(m), o.appendChild(s);
1474
1481
  const u = document.createElement("div");
1475
- u.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-heading", v.appendChild(u);
1476
- const g = document.createElement("div");
1477
- g.className = "gengage-chat-comparison-key-differences-content";
1478
- for (let k = 0; k < 4; k++) {
1479
- const L = document.createElement("div");
1480
- L.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-line", g.appendChild(L);
1481
- }
1482
- v.appendChild(g), i.appendChild(v);
1482
+ u.className = "gengage-chat-comparison-key-differences";
1483
+ const d = document.createElement("div");
1484
+ d.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-heading", u.appendChild(d);
1483
1485
  const _ = document.createElement("div");
1484
- _.className = "gengage-chat-comparison-special gengage-chat-comparison-special--skeleton";
1486
+ _.className = "gengage-chat-comparison-key-differences-content";
1487
+ for (let T = 0; T < 4; T++) {
1488
+ const N = document.createElement("div");
1489
+ N.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-kd-line", _.appendChild(N);
1490
+ }
1491
+ u.appendChild(_), o.appendChild(u);
1485
1492
  const y = document.createElement("div");
1486
- y.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-special-line", _.appendChild(y), i.appendChild(_);
1493
+ y.className = "gengage-chat-comparison-special gengage-chat-comparison-special--skeleton";
1487
1494
  const b = document.createElement("div");
1488
- b.className = "gengage-chat-comparison-skeleton-table-wrap";
1495
+ b.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-special-line", y.appendChild(b), o.appendChild(y);
1489
1496
  const A = document.createElement("div");
1490
- A.className = "gengage-chat-comparison-skeleton-table-head";
1491
- const T = document.createElement("div");
1492
- T.className = "gengage-chat-comparison-skeleton-table-corner", A.appendChild(T);
1493
- for (let k = 0; k < 3; k++) {
1494
- const L = document.createElement("div");
1495
- L.className = "gengage-chat-comparison-skeleton-table-col";
1496
- const z = document.createElement("div");
1497
- z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1498
- const O = document.createElement("div");
1499
- O.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1497
+ A.className = "gengage-chat-comparison-skeleton-table-wrap";
1498
+ const L = document.createElement("div");
1499
+ L.className = "gengage-chat-comparison-skeleton-table-head";
1500
+ const E = document.createElement("div");
1501
+ E.className = "gengage-chat-comparison-skeleton-table-corner", L.appendChild(E);
1502
+ for (let T = 0; T < 3; T++) {
1503
+ const N = document.createElement("div");
1504
+ N.className = "gengage-chat-comparison-skeleton-table-col";
1505
+ const F = document.createElement("div");
1506
+ F.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-img";
1500
1507
  const X = document.createElement("div");
1501
- 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);
1508
+ X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-name";
1509
+ const C = document.createElement("div");
1510
+ C.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-th-price", N.appendChild(F), N.appendChild(X), N.appendChild(C), L.appendChild(N);
1502
1511
  }
1503
- b.appendChild(A);
1504
- for (let k = 0; k < 3; k++) {
1505
- const L = document.createElement("div");
1506
- L.className = "gengage-chat-comparison-skeleton-table-row";
1507
- const z = document.createElement("div");
1508
- z.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", L.appendChild(z);
1509
- for (let O = 0; O < 3; O++) {
1510
- const X = document.createElement("div");
1511
- X.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", L.appendChild(X);
1512
+ A.appendChild(L);
1513
+ for (let T = 0; T < 3; T++) {
1514
+ const N = document.createElement("div");
1515
+ N.className = "gengage-chat-comparison-skeleton-table-row";
1516
+ const F = document.createElement("div");
1517
+ F.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-label", N.appendChild(F);
1518
+ for (let X = 0; X < 3; X++) {
1519
+ const C = document.createElement("div");
1520
+ C.className = "gengage-chat-comparison-skeleton-shimmer gengage-chat-comparison-skeleton-table-cell", N.appendChild(C);
1512
1521
  }
1513
- b.appendChild(L);
1522
+ A.appendChild(N);
1514
1523
  }
1515
- i.appendChild(b), e.appendChild(i);
1524
+ o.appendChild(A), e.appendChild(o);
1516
1525
  break;
1517
1526
  }
1518
1527
  default:
1519
- e.appendChild(n);
1520
- for (let i = 0; i < 3; i++) {
1521
- const o = document.createElement("div");
1522
- o.className = "gengage-chat-panel-skeleton-block", e.appendChild(o);
1528
+ e.appendChild(r);
1529
+ for (let o = 0; o < 3; o++) {
1530
+ const s = document.createElement("div");
1531
+ s.className = "gengage-chat-panel-skeleton-block", e.appendChild(s);
1523
1532
  }
1524
1533
  break;
1525
1534
  }
@@ -1642,15 +1651,24 @@ var Bn = class {
1642
1651
  };
1643
1652
  }
1644
1653
  _applyLoadingSteps(t, e, a = !1) {
1645
- const n = e.map((i) => i.trim()).filter(Boolean).slice(-3), r = [this.i18n.loadingMessage];
1646
- t.steps = n.length > 0 ? n : r, this._clearLoadingBindingInterval(t), t.index = a ? t.steps.length - 1 : 0, t.labelEl.textContent = t.steps[t.index], !a && t.steps.length > 1 && (t.intervalId = setInterval(() => {
1647
- if (t.index >= t.steps.length - 1) {
1648
- this._clearLoadingBindingInterval(t);
1649
- return;
1650
- }
1651
- t.index += 1, t.labelEl.textContent = t.steps[t.index], t.index >= t.steps.length - 1 && this._clearLoadingBindingInterval(t);
1654
+ const n = this._normalizeLoadingSteps(e), r = n[n.length - 1], i = this._normalizeLoadingSteps(this.i18n.loadingSequenceGeneric);
1655
+ t.steps = a && r ? [r] : n.length > 0 ? n : i.length > 0 ? i : [this.i18n.loadingMessage], this._clearLoadingBindingInterval(t), t.index = 0;
1656
+ const o = t.steps[t.index];
1657
+ t.labelEl.textContent !== o && (t.labelEl.textContent = o), t.steps.length > 1 && (t.intervalId = setInterval(() => {
1658
+ t.index = (t.index + 1) % t.steps.length, t.labelEl.textContent = t.steps[t.index];
1652
1659
  }, An));
1653
1660
  }
1661
+ _normalizeLoadingSteps(t) {
1662
+ return t.map((e) => e.trim()).filter(Boolean);
1663
+ }
1664
+ _uniqueLoadingSteps(t) {
1665
+ const e = /* @__PURE__ */ new Set(), a = [];
1666
+ for (const n of t) {
1667
+ const r = n.trim();
1668
+ !r || e.has(r) || (e.add(r), a.push(r));
1669
+ }
1670
+ return a;
1671
+ }
1654
1672
  _clearLoadingBindingInterval(t) {
1655
1673
  t?.intervalId && (clearInterval(t.intervalId), t.intervalId = null);
1656
1674
  }
@@ -1803,8 +1821,8 @@ var Bn = class {
1803
1821
  const t = (e) => {
1804
1822
  if (e.key !== "Tab") return;
1805
1823
  const a = Array.from(this.root.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter((l) => {
1806
- const d = getComputedStyle(l);
1807
- return l.hidden || l.getAttribute("aria-hidden") === "true" || d.display === "none" || d.visibility === "hidden" ? !1 : l.getClientRects().length > 0;
1824
+ const p = getComputedStyle(l);
1825
+ return l.hidden || l.getAttribute("aria-hidden") === "true" || p.display === "none" || p.visibility === "hidden" ? !1 : l.getClientRects().length > 0;
1808
1826
  });
1809
1827
  if (a.length === 0) return;
1810
1828
  const n = a[0], r = a[a.length - 1], i = e.composedPath().find((l) => l instanceof HTMLElement && this.root.contains(l)) ?? null, o = this.root.getRootNode(), s = i ?? (o instanceof ShadowRoot && o.activeElement instanceof HTMLElement ? o.activeElement : document.activeElement instanceof HTMLElement ? document.activeElement : null), c = s && this.root.contains(s) ? s : null;
@@ -2029,117 +2047,117 @@ function Xn(t) {
2029
2047
  if (c.className = "gengage-chat-comparison", c.dataset.gengagePart = "comparison-dialog", c.setAttribute("role", "dialog"), c.setAttribute("aria-label", s?.comparisonHeading ?? "Comparison Results"), e) {
2030
2048
  const l = document.createElement("article");
2031
2049
  l.className = "gengage-chat-comparison-recommended gds-card", l.dataset.gengagePart = "comparison-recommended-card";
2032
- const d = document.createElement("div");
2033
- d.className = "gengage-chat-comparison-recommended-label", d.textContent = s?.recommendedChoiceLabel ?? "Recommended Choice", l.appendChild(d);
2034
2050
  const p = document.createElement("div");
2035
- p.className = "gengage-chat-comparison-recommended-body", p.classList.add("gds-clickable"), p.tabIndex = 0, p.setAttribute("role", "button"), p.setAttribute("aria-label", e.name);
2051
+ p.className = "gengage-chat-comparison-recommended-label", p.textContent = s?.recommendedChoiceLabel ?? "Recommended Choice", l.appendChild(p);
2052
+ const g = document.createElement("div");
2053
+ g.className = "gengage-chat-comparison-recommended-body", g.classList.add("gds-clickable"), g.tabIndex = 0, g.setAttribute("role", "button"), g.setAttribute("aria-label", e.name);
2036
2054
  const h = document.createElement("div");
2037
2055
  if (h.className = "gengage-chat-comparison-recommended-media", e.imageUrl && Ce(e.imageUrl)) {
2038
- const g = document.createElement("img");
2039
- g.src = e.imageUrl, g.alt = e.name, g.loading = "lazy", g.addEventListener("error", () => {
2040
- g.style.display = "none";
2041
- }, { once: !0 }), h.appendChild(g);
2056
+ const d = document.createElement("img");
2057
+ d.src = e.imageUrl, d.alt = e.name, d.loading = "lazy", d.addEventListener("error", () => {
2058
+ d.style.display = "none";
2059
+ }, { once: !0 }), h.appendChild(d);
2042
2060
  } else {
2043
- const g = document.createElement("div");
2044
- g.className = "gengage-chat-comparison-recommended-placeholder", g.setAttribute("aria-hidden", "true"), h.appendChild(g);
2061
+ const d = document.createElement("div");
2062
+ d.className = "gengage-chat-comparison-recommended-placeholder", d.setAttribute("aria-hidden", "true"), h.appendChild(d);
2045
2063
  }
2046
- p.appendChild(h);
2064
+ g.appendChild(h);
2047
2065
  const m = document.createElement("div");
2048
2066
  m.className = "gengage-chat-comparison-recommended-info";
2049
2067
  const x = document.createElement("div");
2050
2068
  x.className = "gengage-chat-comparison-recommended-title", x.textContent = e.name, m.appendChild(x);
2051
2069
  const v = document.createElement("div");
2052
2070
  if (v.className = "gengage-chat-comparison-recommended-meta", Yn(e.rating) && v.appendChild(Zn(e.rating)), Tt(e.price)) {
2053
- const g = document.createElement("div");
2054
- g.className = "gengage-chat-comparison-recommended-price", g.textContent = ae(e.price, t.pricing), v.appendChild(g);
2071
+ const d = document.createElement("div");
2072
+ d.className = "gengage-chat-comparison-recommended-price", d.textContent = ae(e.price, t.pricing), v.appendChild(d);
2055
2073
  }
2056
2074
  if (v.childElementCount > 0 && m.appendChild(v), t.recommendedText) {
2057
- const g = document.createElement("p");
2058
- g.className = "gengage-chat-comparison-recommended-text", g.innerHTML = ve(t.recommendedText), m.appendChild(g);
2075
+ const d = document.createElement("p");
2076
+ d.className = "gengage-chat-comparison-recommended-text", d.innerHTML = ve(t.recommendedText), m.appendChild(d);
2059
2077
  }
2060
- p.appendChild(m);
2078
+ g.appendChild(m);
2061
2079
  const u = () => {
2062
2080
  o({
2063
2081
  sku: e.sku,
2064
2082
  name: e.name
2065
2083
  });
2066
2084
  };
2067
- if (p.addEventListener("click", u), p.addEventListener("keydown", (g) => {
2068
- g.key !== "Enter" && g.key !== " " || (g.preventDefault(), u());
2069
- }), l.appendChild(p), r.length > 0) {
2070
- const g = document.createElement("div");
2071
- g.className = "gengage-chat-comparison-highlights", g.dataset.gengagePart = "comparison-highlights";
2085
+ if (g.addEventListener("click", u), g.addEventListener("keydown", (d) => {
2086
+ d.key !== "Enter" && d.key !== " " || (d.preventDefault(), u());
2087
+ }), l.appendChild(g), r.length > 0) {
2088
+ const d = document.createElement("div");
2089
+ d.className = "gengage-chat-comparison-highlights", d.dataset.gengagePart = "comparison-highlights";
2072
2090
  const _ = document.createElement("div");
2073
- _.className = "gengage-chat-comparison-highlights-label", _.textContent = s?.highlightsLabel ?? "Key Highlights", g.appendChild(_);
2091
+ _.className = "gengage-chat-comparison-highlights-label", _.textContent = s?.highlightsLabel ?? "Key Highlights", d.appendChild(_);
2074
2092
  const y = document.createElement("ul");
2075
2093
  for (const b of r) {
2076
2094
  const A = document.createElement("li");
2077
2095
  A.textContent = b, y.appendChild(A);
2078
2096
  }
2079
- g.appendChild(y), l.appendChild(g);
2097
+ d.appendChild(y), l.appendChild(d);
2080
2098
  }
2081
2099
  c.appendChild(l);
2082
2100
  }
2083
2101
  if (t.keyDifferencesHtml) {
2084
2102
  const l = document.createElement("details");
2085
2103
  l.className = "gengage-chat-comparison-key-differences", l.dataset.gengagePart = "comparison-key-differences";
2086
- const d = document.createElement("summary");
2087
- d.className = "gengage-chat-comparison-key-differences-summary";
2088
- const p = document.createElement("span");
2089
- p.className = "gengage-chat-comparison-key-differences-summary-label", p.textContent = s?.keyDifferencesLabel ?? "Key Differences";
2104
+ const p = document.createElement("summary");
2105
+ p.className = "gengage-chat-comparison-key-differences-summary";
2106
+ const g = document.createElement("span");
2107
+ g.className = "gengage-chat-comparison-key-differences-summary-label", g.textContent = s?.keyDifferencesLabel ?? "Key Differences";
2090
2108
  const h = document.createElement("span");
2091
- h.className = "gengage-chat-comparison-key-differences-summary-meta", h.textContent = s?.viewMoreLabel ?? "Show More", d.appendChild(p), d.appendChild(h), l.appendChild(d);
2109
+ h.className = "gengage-chat-comparison-key-differences-summary-meta", h.textContent = s?.viewMoreLabel ?? "Show More", p.appendChild(g), p.appendChild(h), l.appendChild(p);
2092
2110
  const m = document.createElement("div");
2093
2111
  m.className = "gengage-chat-comparison-key-differences-content", m.innerHTML = ve(Qn(t.keyDifferencesHtml)), l.appendChild(m), c.appendChild(l);
2094
2112
  }
2095
2113
  if (i && i.length > 0) {
2096
2114
  const l = document.createElement("details");
2097
2115
  l.className = "gengage-chat-comparison-special gds-evidence-card gds-evidence-card-warning", l.dataset.gengagePart = "comparison-special-cases";
2098
- const d = document.createElement("summary");
2099
- d.textContent = s?.specialCasesLabel ?? "For Special Cases", l.appendChild(d);
2100
- const p = document.createElement("ul");
2101
- for (const h of i) Jn(p, h);
2102
- p.childElementCount > 0 && l.appendChild(p), c.appendChild(l);
2116
+ const p = document.createElement("summary");
2117
+ p.textContent = s?.specialCasesLabel ?? "For Special Cases", l.appendChild(p);
2118
+ const g = document.createElement("ul");
2119
+ for (const h of i) Jn(g, h);
2120
+ g.childElementCount > 0 && l.appendChild(g), c.appendChild(l);
2103
2121
  }
2104
2122
  if (a.length > 0 && n.length > 0) {
2105
2123
  const l = document.createElement("table");
2106
2124
  l.className = "gengage-chat-comparison-table gds-comparison-table";
2107
- const d = document.createElement("thead"), p = document.createElement("tr"), h = document.createElement("th");
2108
- p.appendChild(h);
2125
+ const p = document.createElement("thead"), g = document.createElement("tr"), h = document.createElement("th");
2126
+ g.appendChild(h);
2109
2127
  for (const v of a) {
2110
2128
  const u = document.createElement("th");
2111
2129
  v.sku === e?.sku && (u.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
2112
- const g = document.createElement("div");
2113
- g.className = "gengage-chat-comparison-table-header-cell gengage-chat-comparison-table-header-cell--clickable gds-clickable", g.tabIndex = 0, g.setAttribute("role", "button"), g.setAttribute("aria-label", v.name), g.title = v.name;
2130
+ const d = document.createElement("div");
2131
+ d.className = "gengage-chat-comparison-table-header-cell gengage-chat-comparison-table-header-cell--clickable gds-clickable", d.tabIndex = 0, d.setAttribute("role", "button"), d.setAttribute("aria-label", v.name), d.title = v.name;
2114
2132
  const _ = () => {
2115
2133
  o({
2116
2134
  sku: v.sku,
2117
2135
  name: v.name
2118
2136
  });
2119
2137
  };
2120
- if (g.addEventListener("click", _), g.addEventListener("keydown", (b) => {
2138
+ if (d.addEventListener("click", _), d.addEventListener("keydown", (b) => {
2121
2139
  b.key !== "Enter" && b.key !== " " || (b.preventDefault(), _());
2122
2140
  }), v.imageUrl && Ce(v.imageUrl)) {
2123
2141
  const b = document.createElement("img");
2124
2142
  b.src = v.imageUrl, b.alt = v.name, b.loading = "lazy", b.addEventListener("error", () => {
2125
2143
  b.style.display = "none";
2126
- }, { once: !0 }), g.appendChild(b);
2144
+ }, { once: !0 }), d.appendChild(b);
2127
2145
  } else {
2128
2146
  const b = document.createElement("div");
2129
- b.className = "gengage-chat-comparison-table-header-img-placeholder", b.setAttribute("aria-hidden", "true"), g.appendChild(b);
2147
+ b.className = "gengage-chat-comparison-table-header-img-placeholder", b.setAttribute("aria-hidden", "true"), d.appendChild(b);
2130
2148
  }
2131
2149
  const y = document.createElement("div");
2132
- if (y.className = "gengage-chat-comparison-table-product-name", y.textContent = v.name, g.appendChild(y), Tt(v.price)) {
2150
+ if (y.className = "gengage-chat-comparison-table-product-name", y.textContent = v.name, d.appendChild(y), Tt(v.price)) {
2133
2151
  const b = document.createElement("div");
2134
- b.className = "gengage-chat-comparison-table-price", b.textContent = ae(v.price, t.pricing), g.appendChild(b);
2152
+ b.className = "gengage-chat-comparison-table-price", b.textContent = ae(v.price, t.pricing), d.appendChild(b);
2135
2153
  }
2136
- u.appendChild(g), p.appendChild(u);
2154
+ u.appendChild(d), g.appendChild(u);
2137
2155
  }
2138
- d.appendChild(p), l.appendChild(d);
2156
+ p.appendChild(g), l.appendChild(p);
2139
2157
  const m = document.createElement("tbody");
2140
2158
  for (const v of n) {
2141
- const u = document.createElement("tr"), g = document.createElement("td");
2142
- g.className = "gengage-chat-comparison-label", g.textContent = Wn(v.label, s?.criteriaLabels, t.locale), u.appendChild(g);
2159
+ const u = document.createElement("tr"), d = document.createElement("td");
2160
+ d.className = "gengage-chat-comparison-label", d.textContent = Wn(v.label, s?.criteriaLabels, t.locale), u.appendChild(d);
2143
2161
  for (let _ = 0; _ < v.values.length; _++) {
2144
2162
  const y = document.createElement("td");
2145
2163
  a[_]?.sku === e?.sku && (y.className = "gengage-chat-comparison-selected gds-comparison-table-winner-cell");
@@ -2154,10 +2172,10 @@ function Xn(t) {
2154
2172
  }
2155
2173
  return c.addEventListener("keydown", (l) => {
2156
2174
  if (l.key !== "Tab") return;
2157
- const d = c.querySelectorAll('button, [href], input, [tabindex]:not([tabindex="-1"])');
2158
- if (d.length === 0) return;
2159
- const p = d[0], h = d[d.length - 1];
2160
- l.shiftKey && document.activeElement === p ? (l.preventDefault(), h.focus()) : !l.shiftKey && document.activeElement === h && (l.preventDefault(), p.focus());
2175
+ const p = c.querySelectorAll('button, [href], input, [tabindex]:not([tabindex="-1"])');
2176
+ if (p.length === 0) return;
2177
+ const g = p[0], h = p[p.length - 1];
2178
+ l.shiftKey && document.activeElement === g ? (l.preventDefault(), h.focus()) : !l.shiftKey && document.activeElement === h && (l.preventDefault(), g.focus());
2161
2179
  }), c;
2162
2180
  }
2163
2181
  function Qn(t) {
@@ -2227,7 +2245,7 @@ function sr(t, e) {
2227
2245
  }
2228
2246
  const r = n.filter((v) => v !== null && typeof v == "object"), i = /* @__PURE__ */ new Map();
2229
2247
  for (const v of r) {
2230
- const u = ar(v.review_class), g = nr(v.review_text), _ = tr(v.review_tag);
2248
+ const u = ar(v.review_class), d = nr(v.review_text), _ = tr(v.review_tag);
2231
2249
  for (const y of _) {
2232
2250
  const b = y.toLocaleLowerCase();
2233
2251
  let A = i.get(b);
@@ -2239,12 +2257,12 @@ function sr(t, e) {
2239
2257
  negative: 0,
2240
2258
  neutral: 0,
2241
2259
  snippets: []
2242
- }, i.set(b, A)), A.mentions += 1, u === "positive" ? A.positive += 1 : u === "negative" ? A.negative += 1 : A.neutral += 1, g.length > 0 && A.snippets.length < er && !A.snippets.some((T) => T.text === g)) {
2243
- const T = {
2244
- text: g,
2260
+ }, i.set(b, A)), A.mentions += 1, u === "positive" ? A.positive += 1 : u === "negative" ? A.negative += 1 : A.neutral += 1, d.length > 0 && A.snippets.length < er && !A.snippets.some((L) => L.text === d)) {
2261
+ const L = {
2262
+ text: d,
2245
2263
  tone: u
2246
2264
  };
2247
- v.review_rating !== void 0 && String(v.review_rating).length > 0 && (T.rating = v.review_rating), A.snippets.push(T);
2265
+ v.review_rating !== void 0 && String(v.review_rating).length > 0 && (L.rating = v.review_rating), A.snippets.push(L);
2248
2266
  }
2249
2267
  }
2250
2268
  }
@@ -2255,20 +2273,20 @@ function sr(t, e) {
2255
2273
  }
2256
2274
  const s = (e?.reviewFilterPositive ?? "positive").toLowerCase(), c = (e?.reviewFilterNegative ?? "negative").toLowerCase(), l = document.createElement("div");
2257
2275
  l.className = "gengage-chat-review-subjects-heading", l.textContent = e?.reviewSubjectsHeading ?? "Select to learn more", a.appendChild(l);
2258
- let d = o[0]?.key ?? null;
2259
- const p = document.createElement("div");
2260
- p.className = "gengage-chat-review-subjects gds-toolbar gds-toolbar-compact";
2276
+ let p = o[0]?.key ?? null;
2277
+ const g = document.createElement("div");
2278
+ g.className = "gengage-chat-review-subjects gds-toolbar gds-toolbar-compact";
2261
2279
  const h = document.createElement("section");
2262
2280
  h.className = "gengage-chat-review-detail gds-evidence-card";
2263
2281
  const m = () => {
2264
2282
  for (; h.firstChild; ) h.removeChild(h.firstChild);
2265
- if (!d) return;
2266
- const v = o.find((y) => y.key === d);
2283
+ if (!p) return;
2284
+ const v = o.find((y) => y.key === p);
2267
2285
  if (!v) return;
2268
2286
  const u = document.createElement("div");
2269
2287
  u.className = "gengage-chat-review-detail-meta";
2270
- const g = document.createElement("span");
2271
- 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) {
2288
+ const d = document.createElement("span");
2289
+ if (d.className = "gengage-chat-review-detail-mentions", d.textContent = `${or(v.mentions, e?.reviewCustomersMentionSingular, e?.reviewCustomersMentionPlural)} "${v.label}"`, u.appendChild(d), v.positive > 0) {
2272
2290
  const y = document.createElement("span");
2273
2291
  y.className = "gengage-chat-review-detail-positive", y.textContent = `${v.positive} ${s}`, u.appendChild(y);
2274
2292
  }
@@ -2284,31 +2302,31 @@ function sr(t, e) {
2284
2302
  b.className = "gengage-chat-review-snippet", b.dataset.tone = y.tone;
2285
2303
  const A = document.createElement("div");
2286
2304
  if (A.className = "gengage-chat-review-snippet-text", A.textContent = `"${y.text}"`, b.appendChild(A), y.rating !== void 0 && String(y.rating).length > 0) {
2287
- const T = document.createElement("div");
2288
- T.className = "gengage-chat-review-snippet-rating", T.textContent = `★ ${String(y.rating)}`, b.appendChild(T);
2305
+ const L = document.createElement("div");
2306
+ L.className = "gengage-chat-review-snippet-rating", L.textContent = `★ ${String(y.rating)}`, b.appendChild(L);
2289
2307
  }
2290
2308
  _.appendChild(b);
2291
2309
  }
2292
2310
  h.appendChild(_);
2293
2311
  }, x = () => {
2294
- for (const v of p.querySelectorAll(".gengage-chat-review-subject")) {
2295
- const u = v.dataset.subjectKey === d;
2312
+ for (const v of g.querySelectorAll(".gengage-chat-review-subject")) {
2313
+ const u = v.dataset.subjectKey === p;
2296
2314
  v.classList.toggle("gengage-chat-review-subject--active", u), v.classList.toggle("gds-chip-active", u), v.setAttribute("aria-pressed", String(u));
2297
2315
  }
2298
2316
  };
2299
2317
  for (const v of o) {
2300
- const u = rr(v), g = document.createElement("button");
2301
- g.type = "button", g.className = "gengage-chat-review-subject gds-chip", g.dataset.subjectKey = v.key, g.dataset.tone = u;
2318
+ const u = rr(v), d = document.createElement("button");
2319
+ d.type = "button", d.className = "gengage-chat-review-subject gds-chip", d.dataset.subjectKey = v.key, d.dataset.tone = u;
2302
2320
  const _ = document.createElement("span");
2303
- _.className = "gengage-chat-review-subject-icon", _.appendChild(ir(u)), g.appendChild(_);
2321
+ _.className = "gengage-chat-review-subject-icon", _.appendChild(ir(u)), d.appendChild(_);
2304
2322
  const y = document.createElement("span");
2305
- y.className = "gengage-chat-review-subject-label", y.textContent = v.label, g.appendChild(y);
2323
+ y.className = "gengage-chat-review-subject-label", y.textContent = v.label, d.appendChild(y);
2306
2324
  const b = document.createElement("span");
2307
- b.className = "gengage-chat-review-subject-count", b.textContent = `(${v.mentions})`, g.appendChild(b), g.addEventListener("click", () => {
2308
- d = v.key, x(), m();
2309
- }), p.appendChild(g);
2325
+ b.className = "gengage-chat-review-subject-count", b.textContent = `(${v.mentions})`, d.appendChild(b), d.addEventListener("click", () => {
2326
+ p = v.key, x(), m();
2327
+ }), g.appendChild(d);
2310
2328
  }
2311
- return a.appendChild(p), x(), m(), a.appendChild(h), a;
2329
+ return a.appendChild(g), x(), m(), a.appendChild(h), a;
2312
2330
  }
2313
2331
  function cr(t) {
2314
2332
  if (!t) return;
@@ -2417,63 +2435,63 @@ function pr(t, e, a, n, r) {
2417
2435
  v.stopPropagation(), m.classList.toggle("gengage-chat-favorite-btn--active"), m.querySelector("svg")?.setAttribute("fill", m.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), n.onFavoriteToggle?.(c, o);
2418
2436
  }), l.appendChild(m);
2419
2437
  }
2420
- const d = n.i18n?.findSimilarLabel ?? "Find Similar", p = document.createElement("button");
2421
- p.className = "gengage-chat-find-similar-pill", p.type = "button", p.setAttribute("aria-label", d), p.dataset.tooltip = d, p.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>';
2438
+ const p = n.i18n?.findSimilarLabel ?? "Find Similar", g = document.createElement("button");
2439
+ g.className = "gengage-chat-find-similar-pill", g.type = "button", g.setAttribute("aria-label", p), g.dataset.tooltip = p, g.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>';
2422
2440
  const h = document.createElement("span");
2423
- h.className = "gengage-chat-find-similar-pill-text", h.textContent = d, p.appendChild(h), p.addEventListener("click", (m) => {
2441
+ h.className = "gengage-chat-find-similar-pill-text", h.textContent = p, g.appendChild(h), g.addEventListener("click", (m) => {
2424
2442
  m.stopPropagation(), n.onAction({
2425
- title: d,
2443
+ title: p,
2426
2444
  type: "findSimilar",
2427
2445
  payload: { sku: c }
2428
2446
  });
2429
- }), l.appendChild(p), i.appendChild(l);
2447
+ }), l.appendChild(g), i.appendChild(l);
2430
2448
  }
2431
2449
  a.appendChild(i);
2432
2450
  }
2433
2451
  function hr(t, e, a) {
2434
2452
  const n = t.price, r = t.originalPrice;
2435
2453
  if (!n) return;
2436
- const i = He(a, t), o = $e(a, t), s = !!(r && r !== n), c = !!(i && s), l = Je(a, t), d = document.createElement("div");
2437
- if (d.className = "gengage-chat-ai-toppick-price", d.dataset.gengagePart = "ai-top-pick-price", c) {
2438
- const p = et({
2454
+ const i = He(a, t), o = $e(a, t), s = !!(r && r !== n), c = !!(i && s), l = Je(a, t), p = document.createElement("div");
2455
+ if (p.className = "gengage-chat-ai-toppick-price", p.dataset.gengagePart = "ai-top-pick-price", c) {
2456
+ const g = et({
2439
2457
  reasonText: i,
2440
2458
  salePriceFormatted: ae(n, a.pricing),
2441
2459
  ...l !== void 0 ? { logoUrl: l } : {}
2442
2460
  });
2443
2461
  if (s && o === "inline") {
2444
- d.classList.add("gengage-chat-ai-toppick-price--inline"), d.appendChild(p);
2462
+ p.classList.add("gengage-chat-ai-toppick-price--inline"), p.appendChild(g);
2445
2463
  const h = document.createElement("span");
2446
2464
  h.className = "gengage-chat-ai-toppick-price-sep", h.setAttribute("aria-hidden", "true");
2447
2465
  const m = document.createElement("span");
2448
- m.className = "gengage-chat-ai-toppick-original-price", m.textContent = ae(r, a.pricing), d.appendChild(h), d.appendChild(m);
2466
+ m.className = "gengage-chat-ai-toppick-original-price", m.textContent = ae(r, a.pricing), p.appendChild(h), p.appendChild(m);
2449
2467
  } else {
2450
2468
  const h = document.createElement("span");
2451
- h.className = "gengage-chat-ai-toppick-original-price", h.textContent = ae(r, a.pricing), d.appendChild(h), d.appendChild(document.createTextNode(" ")), d.appendChild(p);
2469
+ h.className = "gengage-chat-ai-toppick-original-price", h.textContent = ae(r, a.pricing), p.appendChild(h), p.appendChild(document.createTextNode(" ")), p.appendChild(g);
2452
2470
  }
2453
- e.appendChild(d);
2471
+ e.appendChild(p);
2454
2472
  return;
2455
2473
  }
2456
2474
  if (s && o === "inline") {
2457
- d.classList.add("gengage-chat-ai-toppick-price--inline");
2458
- const p = document.createElement("span");
2459
- p.className = "gengage-chat-ai-toppick-price-current", p.textContent = ae(n, a.pricing);
2475
+ p.classList.add("gengage-chat-ai-toppick-price--inline");
2476
+ const g = document.createElement("span");
2477
+ g.className = "gengage-chat-ai-toppick-price-current", g.textContent = ae(n, a.pricing);
2460
2478
  const h = document.createElement("span");
2461
2479
  h.className = "gengage-chat-ai-toppick-price-sep", h.setAttribute("aria-hidden", "true");
2462
2480
  const m = document.createElement("span");
2463
- m.className = "gengage-chat-ai-toppick-original-price", m.textContent = ae(r, a.pricing), d.appendChild(p), d.appendChild(h), d.appendChild(m);
2481
+ m.className = "gengage-chat-ai-toppick-original-price", m.textContent = ae(r, a.pricing), p.appendChild(g), p.appendChild(h), p.appendChild(m);
2464
2482
  } else if (s) {
2465
- const p = document.createElement("span");
2466
- p.className = "gengage-chat-ai-toppick-original-price", p.textContent = ae(r, a.pricing), d.appendChild(p), d.appendChild(document.createTextNode(" "));
2483
+ const g = document.createElement("span");
2484
+ g.className = "gengage-chat-ai-toppick-original-price", g.textContent = ae(r, a.pricing), p.appendChild(g), p.appendChild(document.createTextNode(" "));
2467
2485
  const h = document.createElement("span");
2468
- h.className = "gengage-chat-ai-toppick-price-current", h.textContent = ae(n, a.pricing), d.appendChild(h);
2486
+ h.className = "gengage-chat-ai-toppick-price-current", h.textContent = ae(n, a.pricing), p.appendChild(h);
2469
2487
  } else {
2470
- const p = document.createElement("span");
2471
- p.className = "gengage-chat-ai-toppick-price-current", p.textContent = ae(n, a.pricing), d.appendChild(p);
2488
+ const g = document.createElement("span");
2489
+ g.className = "gengage-chat-ai-toppick-price-current", g.textContent = ae(n, a.pricing), p.appendChild(g);
2472
2490
  }
2473
2491
  if (i) {
2474
- const p = document.createElement("div");
2475
- p.className = "gengage-chat-ai-toppick-price-stack", p.appendChild(Qe(i)), p.appendChild(d), e.appendChild(p);
2476
- } else e.appendChild(d);
2492
+ const g = document.createElement("div");
2493
+ g.className = "gengage-chat-ai-toppick-price-stack", g.appendChild(Qe(i)), g.appendChild(p), e.appendChild(g);
2494
+ } else e.appendChild(p);
2477
2495
  }
2478
2496
  function ur(t, e, a) {
2479
2497
  const n = typeof t.reason == "string" ? t.reason.trim() : "", r = a.hideUserReviews !== !0 && typeof t.reviewHighlight == "string" ? t.reviewHighlight.trim() : "";
@@ -2493,54 +2511,54 @@ function Mt(t, e, a, n) {
2493
2511
  r.className = a ? "gengage-chat-ai-toppick-card gengage-chat-ai-toppick-card--winner gds-card" : "gengage-chat-ai-toppick-card gengage-chat-ai-toppick-card--compact gds-card";
2494
2512
  const i = n?.uniformMobileLayout === !0;
2495
2513
  !a && i && r.classList.add("gengage-chat-ai-toppick-card--mobile-uniform"), r.dataset.gengagePart = a ? "ai-top-pick-card-winner" : "ai-top-pick-card";
2496
- const o = t.product, s = ca(t), c = o.url ?? "", l = o.cartCode, d = o.inStock, p = !!(s && l && d !== !1), h = t.action;
2497
- s && e.onProductClick ? (r.classList.add("gds-clickable"), r.addEventListener("click", (k) => {
2498
- 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;
2499
- const L = o.name;
2514
+ const o = t.product, s = ca(t), c = o.url ?? "", l = o.cartCode, p = o.inStock, g = !!(s && l && p !== !1), h = t.action;
2515
+ s && e.onProductClick ? (r.classList.add("gds-clickable"), r.addEventListener("click", (E) => {
2516
+ if (E.target.closest(".gengage-chat-ai-toppick-cta") || E.target.closest(".gengage-chat-favorite-btn") || E.target.closest(".gengage-chat-find-similar-pill")) return;
2517
+ const T = o.name;
2500
2518
  e.onProductClick?.({
2501
2519
  sku: s,
2502
2520
  url: c,
2503
- ...L ? { name: L } : {}
2521
+ ...T ? { name: T } : {}
2504
2522
  });
2505
- })) : h && (r.classList.add("gds-clickable"), r.addEventListener("click", (k) => {
2506
- 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);
2523
+ })) : h && (r.classList.add("gds-clickable"), r.addEventListener("click", (E) => {
2524
+ E.target.closest(".gengage-chat-ai-toppick-cta") || E.target.closest(".gengage-chat-favorite-btn") || E.target.closest(".gengage-chat-find-similar-pill") || e.onAction(h);
2507
2525
  }));
2508
2526
  const m = o.name || "Product image", x = !a && e.isMobile === !0 && !i, v = a ? It(t.role, e.i18n) ?? e.i18n?.roleWinner ?? "TOP MATCH" : It(t.role, e.i18n);
2509
2527
  if (v && !x) {
2510
- const k = document.createElement("span");
2511
- k.className = "gengage-chat-ai-toppick-badge gds-badge", k.dataset.gengagePart = "ai-top-pick-role-badge", k.textContent = v, r.appendChild(k);
2528
+ const E = document.createElement("span");
2529
+ E.className = "gengage-chat-ai-toppick-badge gds-badge", E.dataset.gengagePart = "ai-top-pick-role-badge", E.textContent = v, r.appendChild(E);
2512
2530
  }
2513
2531
  const u = document.createElement("div");
2514
2532
  u.className = "gengage-chat-ai-toppick-top-row", u.dataset.gengagePart = "ai-top-pick-top-row", pr(t, m, u, e, { skipOverlayActions: x });
2515
- const g = document.createElement("div");
2516
- if (g.className = "gengage-chat-ai-toppick-body", g.dataset.gengagePart = "ai-top-pick-body", v && x) {
2517
- const k = document.createElement("div");
2518
- k.className = "gengage-chat-ai-toppick-role-line", k.dataset.gengagePart = "ai-top-pick-role-line", k.textContent = v, g.appendChild(k);
2533
+ const d = document.createElement("div");
2534
+ if (d.className = "gengage-chat-ai-toppick-body", d.dataset.gengagePart = "ai-top-pick-body", v && x) {
2535
+ const E = document.createElement("div");
2536
+ E.className = "gengage-chat-ai-toppick-role-line", E.dataset.gengagePart = "ai-top-pick-role-line", E.textContent = v, d.appendChild(E);
2519
2537
  }
2520
2538
  const _ = o.name;
2521
2539
  if (_) {
2522
- const k = document.createElement("div");
2523
- k.className = "gengage-chat-ai-toppick-name", k.dataset.gengagePart = "ai-top-pick-name", k.textContent = _, g.appendChild(k);
2540
+ const E = document.createElement("div");
2541
+ E.className = "gengage-chat-ai-toppick-name", E.dataset.gengagePart = "ai-top-pick-name", E.textContent = _, d.appendChild(E);
2524
2542
  }
2525
2543
  const y = dr(o);
2526
- 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);
2544
+ y && d.appendChild(y), hr(o, d, e), t.labels && t.labels.length > 0 && d.appendChild(fr(t.labels)), u.appendChild(d), r.appendChild(u);
2527
2545
  const b = document.createElement("div");
2528
2546
  if (b.className = "gengage-chat-ai-toppick-detail", b.dataset.gengagePart = "ai-top-pick-detail", a) ur(t, b, e);
2529
2547
  else {
2530
- const k = typeof t.reason == "string" ? t.reason.trim() : "";
2531
- if (k) {
2532
- const L = document.createElement("p");
2533
- L.className = "gengage-chat-ai-toppick-snippet", L.dataset.gengagePart = "ai-top-pick-snippet", L.textContent = k, b.appendChild(L);
2548
+ const E = typeof t.reason == "string" ? t.reason.trim() : "";
2549
+ if (E) {
2550
+ const T = document.createElement("p");
2551
+ T.className = "gengage-chat-ai-toppick-snippet", T.dataset.gengagePart = "ai-top-pick-snippet", T.textContent = E, b.appendChild(T);
2534
2552
  }
2535
2553
  }
2536
2554
  b.childNodes.length > 0 && r.appendChild(b);
2537
- const A = !!(s && e.topPicksLoadingSku === s), T = (p || h) && !x;
2538
- if (A || p || h) {
2539
- const k = document.createElement("div");
2540
- if (k.className = "gengage-chat-ai-toppick-spinner", k.dataset.gengagePart = "ai-top-pick-spinner", k.style.display = A ? "" : "none", r.appendChild(k), T) {
2541
- const L = document.createElement("button");
2542
- 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) => {
2543
- if (z.stopPropagation(), p) {
2555
+ const A = !!(s && e.topPicksLoadingSku === s), L = (g || h) && !x;
2556
+ if (A || g || h) {
2557
+ const E = document.createElement("div");
2558
+ if (E.className = "gengage-chat-ai-toppick-spinner", E.dataset.gengagePart = "ai-top-pick-spinner", E.style.display = A ? "" : "none", r.appendChild(E), L) {
2559
+ const T = document.createElement("button");
2560
+ T.className = "gengage-chat-ai-toppick-cta gds-btn gds-btn-primary", T.dataset.gengagePart = "ai-top-pick-cta", T.type = "button", T.textContent = g ? e.i18n?.addToCartButton ?? "Add to Cart" : e.i18n?.viewDetails ?? "View Details", T.addEventListener("click", (N) => {
2561
+ if (N.stopPropagation(), g) {
2544
2562
  e.onAction({
2545
2563
  title: e.i18n?.addToCartButton ?? "Add to Cart",
2546
2564
  type: "addToCart",
@@ -2554,17 +2572,17 @@ function Mt(t, e, a, n) {
2554
2572
  }
2555
2573
  if (h) {
2556
2574
  if (h.type === "findSimilar" && s && e.onProductClick) {
2557
- const O = o.name;
2575
+ const F = o.name;
2558
2576
  e.onProductClick({
2559
2577
  sku: s,
2560
2578
  url: c,
2561
- ...O ? { name: O } : {}
2579
+ ...F ? { name: F } : {}
2562
2580
  });
2563
2581
  return;
2564
2582
  }
2565
2583
  e.onAction(h);
2566
2584
  }
2567
- }), r.appendChild(L);
2585
+ }), r.appendChild(T);
2568
2586
  }
2569
2587
  }
2570
2588
  return r;
@@ -2581,8 +2599,8 @@ function mr(t, e) {
2581
2599
  const s = document.createElement("div");
2582
2600
  s.className = "gengage-chat-ai-top-picks-rest", i && s.classList.add("gengage-chat-ai-top-picks-rest--uniform-mobile"), s.dataset.gengagePart = "ai-top-picks-rest";
2583
2601
  for (let c = 1; c < n.length; c++) {
2584
- const l = n[c], d = l.role === "winner";
2585
- s.appendChild(Mt(l, e, d, { uniformMobileLayout: i }));
2602
+ const l = n[c], p = l.role === "winner";
2603
+ s.appendChild(Mt(l, e, p, { uniformMobileLayout: i }));
2586
2604
  }
2587
2605
  r.appendChild(s);
2588
2606
  }
@@ -2608,18 +2626,18 @@ function br(t, e) {
2608
2626
  ])), a.appendChild(c);
2609
2627
  const l = document.createElement("div");
2610
2628
  l.className = "gengage-chat-grounding-review-body", l.dataset.gengagePart = "grounding-review-body";
2611
- const d = document.createElement("div");
2612
- if (d.className = "gengage-chat-grounding-review-title", d.dataset.gengagePart = "grounding-review-title", d.textContent = r ?? e.i18n?.customerReviewsTitle ?? "Customer Reviews", l.appendChild(d), i) {
2629
+ const p = document.createElement("div");
2630
+ if (p.className = "gengage-chat-grounding-review-title", p.dataset.gengagePart = "grounding-review-title", p.textContent = r ?? e.i18n?.customerReviewsTitle ?? "Customer Reviews", l.appendChild(p), i) {
2613
2631
  const x = document.createElement("div");
2614
2632
  x.className = "gengage-chat-grounding-review-subtitle", x.dataset.gengagePart = "grounding-review-subtitle", x.textContent = (e.i18n?.groundingReviewSubtitle ?? "{count} yorum mevcut").replace("{count}", i), l.appendChild(x);
2615
2633
  }
2616
2634
  a.appendChild(l);
2617
- const p = document.createElement("span");
2618
- p.className = "gengage-chat-grounding-review-cta", p.dataset.gengagePart = "grounding-review-cta";
2635
+ const g = document.createElement("span");
2636
+ g.className = "gengage-chat-grounding-review-cta", g.dataset.gengagePart = "grounding-review-cta";
2619
2637
  const h = document.createElement("span");
2620
- h.textContent = s, p.appendChild(h);
2638
+ h.textContent = s, g.appendChild(h);
2621
2639
  const m = document.createElement("span");
2622
- return m.className = "gengage-chat-grounding-review-cta-icon", m.appendChild(qe(["M5 12h14", "M15 8l4 4-4 4"], 14)), p.appendChild(m), a.appendChild(p), o && (a.classList.add("gds-clickable"), a.setAttribute("role", "button"), a.setAttribute("tabindex", "0"), a.addEventListener("click", () => e.onAction(o)), a.addEventListener("keydown", (x) => {
2640
+ return m.className = "gengage-chat-grounding-review-cta-icon", m.appendChild(qe(["M5 12h14", "M15 8l4 4-4 4"], 14)), g.appendChild(m), a.appendChild(g), o && (a.classList.add("gds-clickable"), a.setAttribute("role", "button"), a.setAttribute("tabindex", "0"), a.addEventListener("click", () => e.onAction(o)), a.addEventListener("keydown", (x) => {
2623
2641
  (x.key === "Enter" || x.key === " ") && (x.preventDefault(), e.onAction(o));
2624
2642
  })), a;
2625
2643
  }
@@ -2659,8 +2677,8 @@ function xr(t, e) {
2659
2677
  }
2660
2678
  const l = document.createElement("div");
2661
2679
  l.className = "gengage-chat-grouping-card-body", l.dataset.gengagePart = "ai-grouping-card-body";
2662
- const d = document.createElement("span");
2663
- if (d.className = "gengage-chat-grouping-card-name", d.dataset.gengagePart = "ai-grouping-card-name", d.textContent = s.name, l.appendChild(d), s.labels && s.labels.length > 0) {
2680
+ const p = document.createElement("span");
2681
+ if (p.className = "gengage-chat-grouping-card-name", p.dataset.gengagePart = "ai-grouping-card-name", p.textContent = s.name, l.appendChild(p), s.labels && s.labels.length > 0) {
2664
2682
  const h = document.createElement("div");
2665
2683
  h.className = "gengage-chat-grouping-card-labels", h.dataset.gengagePart = "ai-grouping-card-labels";
2666
2684
  for (const m of s.labels.slice(0, 2)) {
@@ -2670,8 +2688,8 @@ function xr(t, e) {
2670
2688
  l.appendChild(h);
2671
2689
  }
2672
2690
  c.appendChild(l);
2673
- const p = document.createElement("span");
2674
- p.className = "gengage-chat-grouping-card-arrow", p.textContent = "↳", c.insertBefore(p, c.firstChild), o.appendChild(c);
2691
+ const g = document.createElement("span");
2692
+ g.className = "gengage-chat-grouping-card-arrow", g.textContent = "↳", c.insertBefore(g, c.firstChild), o.appendChild(c);
2675
2693
  }
2676
2694
  return a.appendChild(o), a;
2677
2695
  }
@@ -2719,12 +2737,12 @@ function la(t, e) {
2719
2737
  c.className = "gengage-chat-comparison-floating-copy";
2720
2738
  const l = document.createElement("div");
2721
2739
  if (l.className = "gengage-chat-comparison-floating-title", l.textContent = a ? `${n} (${t.length})` : e.i18n?.compareMinHint ?? "Select at least 2 products", c.appendChild(l), r) {
2722
- const p = document.createElement("div");
2723
- p.className = "gengage-chat-comparison-floating-warning", p.setAttribute("role", "status"), p.setAttribute("aria-live", "polite"), p.textContent = r, c.appendChild(p);
2740
+ const g = document.createElement("div");
2741
+ g.className = "gengage-chat-comparison-floating-warning", g.setAttribute("role", "status"), g.setAttribute("aria-live", "polite"), g.textContent = r, c.appendChild(g);
2724
2742
  }
2725
2743
  o.appendChild(c), i.appendChild(o);
2726
- const d = document.createElement("button");
2727
- if (d.className = "gengage-chat-comparison-floating-action gds-btn gds-btn-primary", d.type = "button", d.textContent = n, d.disabled = !a, a || d.classList.add("gengage-chat-comparison-floating-action--disabled"), d.addEventListener("click", () => {
2744
+ const p = document.createElement("button");
2745
+ if (p.className = "gengage-chat-comparison-floating-action gds-btn gds-btn-primary", p.type = "button", p.textContent = n, p.disabled = !a, a || p.classList.add("gengage-chat-comparison-floating-action--disabled"), p.addEventListener("click", () => {
2728
2746
  a && e.onAction({
2729
2747
  title: n,
2730
2748
  type: "getComparisonTable",
@@ -2733,11 +2751,11 @@ function la(t, e) {
2733
2751
  gengage_analytics_source: "floating_compare_dock"
2734
2752
  }
2735
2753
  });
2736
- }), i.appendChild(d), e.onToggleComparisonSku) {
2737
- const p = document.createElement("button");
2738
- p.className = "gengage-chat-comparison-floating-close gds-btn gds-btn-ghost gds-icon-btn", p.dataset.gengagePart = "comparison-dock-close", p.type = "button", p.setAttribute("aria-label", e.i18n?.closeAriaLabel ?? "Close"), p.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6L6 18"/><path d="M6 6l12 12"/></svg>', p.addEventListener("click", (h) => {
2754
+ }), i.appendChild(p), e.onToggleComparisonSku) {
2755
+ const g = document.createElement("button");
2756
+ g.className = "gengage-chat-comparison-floating-close gds-btn gds-btn-ghost gds-icon-btn", g.dataset.gengagePart = "comparison-dock-close", g.type = "button", g.setAttribute("aria-label", e.i18n?.closeAriaLabel ?? "Close"), g.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6L6 18"/><path d="M6 6l12 12"/></svg>', g.addEventListener("click", (h) => {
2739
2757
  h.preventDefault(), h.stopPropagation(), e.onToggleComparisonSku?.("");
2740
- }), i.appendChild(p);
2758
+ }), i.appendChild(g);
2741
2759
  }
2742
2760
  return i;
2743
2761
  }
@@ -2827,47 +2845,47 @@ function Tr(t, e) {
2827
2845
  if (i.className = "gengage-chat-categories", i.dataset.gengagePart = "categories-container", a.length === 0) return i;
2828
2846
  const o = document.createElement("div");
2829
2847
  o.className = "gengage-chat-categories-tabs gds-toolbar", o.dataset.gengagePart = "categories-tab-bar", o.setAttribute("role", "tablist");
2830
- const s = [], c = [], l = (d) => {
2831
- for (let p = 0; p < s.length; p++) {
2832
- const h = p === d;
2833
- s[p].classList.toggle("gengage-chat-categories-tab--active", h), s[p].classList.toggle("is-active", h), s[p].setAttribute("aria-selected", String(h)), s[p].tabIndex = h ? 0 : -1, c[p].style.display = h ? "" : "none";
2848
+ const s = [], c = [], l = (p) => {
2849
+ for (let g = 0; g < s.length; g++) {
2850
+ const h = g === p;
2851
+ s[g].classList.toggle("gengage-chat-categories-tab--active", h), s[g].classList.toggle("is-active", h), s[g].setAttribute("aria-selected", String(h)), s[g].tabIndex = h ? 0 : -1, c[g].style.display = h ? "" : "none";
2834
2852
  }
2835
2853
  };
2836
- for (let d = 0; d < a.length; d++) {
2837
- const p = a[d], h = `${r}-tab-${d}`, m = `${r}-panel-${d}`, x = document.createElement("button");
2838
- 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)) {
2854
+ for (let p = 0; p < a.length; p++) {
2855
+ const g = a[p], h = `${r}-tab-${p}`, m = `${r}-panel-${p}`, x = document.createElement("button");
2856
+ 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(p === 0)), x.tabIndex = p === 0 ? 0 : -1, p === 0 && x.classList.add("gengage-chat-categories-tab--active", "is-active"), g.image && Ce(g.image)) {
2839
2857
  const y = document.createElement("img");
2840
- 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);
2858
+ y.className = "gengage-chat-categories-tab-image", y.draggable = !1, y.src = g.image, y.alt = g.groupName, y.loading = "lazy", xe(y), x.appendChild(y);
2841
2859
  }
2842
2860
  const v = document.createElement("span");
2843
- v.className = "gengage-chat-categories-tab-text", v.textContent = p.groupName, x.appendChild(v), x.addEventListener("click", () => l(d)), x.addEventListener("keydown", (y) => {
2861
+ v.className = "gengage-chat-categories-tab-text", v.textContent = g.groupName, x.appendChild(v), x.addEventListener("click", () => l(p)), x.addEventListener("keydown", (y) => {
2844
2862
  let b = -1;
2845
- 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());
2863
+ y.key === "ArrowRight" || y.key === "ArrowDown" ? b = (p + 1) % a.length : y.key === "ArrowLeft" || y.key === "ArrowUp" ? b = (p - 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());
2846
2864
  }), s.push(x), o.appendChild(x);
2847
2865
  const u = document.createElement("div");
2848
- 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");
2849
- const g = Er(p);
2850
- g && u.appendChild(g);
2866
+ u.className = "gengage-chat-categories-panel", u.dataset.gengagePart = "categories-panel", u.id = m, u.setAttribute("role", "tabpanel"), u.setAttribute("aria-labelledby", h), p !== 0 && (u.style.display = "none");
2867
+ const d = Er(g);
2868
+ d && u.appendChild(d);
2851
2869
  const _ = document.createElement("div");
2852
2870
  _.className = "gengage-chat-categories-grid", _.dataset.gengagePart = "categories-grid";
2853
- for (const y of p.products) {
2871
+ for (const y of g.products) {
2854
2872
  const b = Ar(y, e);
2855
2873
  _.appendChild(b);
2856
2874
  }
2857
2875
  u.appendChild(_), c.push(u);
2858
2876
  }
2859
2877
  i.appendChild(o);
2860
- for (const d of c) i.appendChild(d);
2878
+ for (const p of c) i.appendChild(p);
2861
2879
  if (n.length > 0) {
2862
- const d = document.createElement("div");
2863
- d.className = "gengage-chat-categories-filter-tags gds-toolbar", d.dataset.gengagePart = "categories-filter-tags";
2864
- for (const p of n) {
2880
+ const p = document.createElement("div");
2881
+ p.className = "gengage-chat-categories-filter-tags gds-toolbar", p.dataset.gengagePart = "categories-filter-tags";
2882
+ for (const g of n) {
2865
2883
  const h = document.createElement("button");
2866
- h.className = "gengage-chat-categories-filter-tag gds-chip", h.type = "button", h.dataset.gengagePart = "categories-filter-tag", h.textContent = p.title, p.action && h.addEventListener("click", () => {
2867
- e.onAction(p.action);
2868
- }), d.appendChild(h);
2884
+ h.className = "gengage-chat-categories-filter-tag gds-chip", h.type = "button", h.dataset.gengagePart = "categories-filter-tag", h.textContent = g.title, g.action && h.addEventListener("click", () => {
2885
+ e.onAction(g.action);
2886
+ }), p.appendChild(h);
2869
2887
  }
2870
- i.appendChild(d);
2888
+ i.appendChild(p);
2871
2889
  }
2872
2890
  return i;
2873
2891
  }
@@ -2925,10 +2943,10 @@ function Nr(t) {
2925
2943
  }).filter((e) => e !== null) : [];
2926
2944
  }
2927
2945
  function Br(t, e) {
2928
- const a = t.props ?? {}, n = Te(a.eyebrow), r = Te(a.title), i = a.showTitle !== !1, o = Te(a.ctaLabel) || e.i18n?.showPanelAriaLabel || "Show Results", s = Te(a.panelMessageId), c = Te(a.highlightMessageId), l = Te(a.threadId), d = Nr(a.products).slice(0, 3), p = document.createElement("button");
2929
- p.type = "button", p.className = "gengage-chat-panel-restore-card gds-card", !n && !i && p.classList.add("gengage-chat-panel-restore-card--minimal"), p.dataset.gengagePart = "panel-restore-card";
2946
+ const a = t.props ?? {}, n = Te(a.eyebrow), r = Te(a.title), i = a.showTitle !== !1, o = Te(a.ctaLabel) || e.i18n?.showPanelAriaLabel || "Show Results", s = Te(a.panelMessageId), c = Te(a.highlightMessageId), l = Te(a.threadId), p = Nr(a.products).slice(0, 3), g = document.createElement("button");
2947
+ g.type = "button", g.className = "gengage-chat-panel-restore-card gds-card", !n && !i && g.classList.add("gengage-chat-panel-restore-card--minimal"), g.dataset.gengagePart = "panel-restore-card";
2930
2948
  const h = r || n || o;
2931
- p.setAttribute("aria-label", r ? `${h} - ${o}` : h);
2949
+ g.setAttribute("aria-label", r ? `${h} - ${o}` : h);
2932
2950
  const m = {
2933
2951
  title: r,
2934
2952
  type: Mr,
@@ -2938,114 +2956,114 @@ function Br(t, e) {
2938
2956
  threadId: l
2939
2957
  }
2940
2958
  };
2941
- if (p.addEventListener("click", () => e.onAction(m)), n) {
2959
+ if (g.addEventListener("click", () => e.onAction(m)), n) {
2942
2960
  const v = document.createElement("div");
2943
- v.className = "gengage-chat-panel-restore-card__eyebrow", v.textContent = n, p.appendChild(v);
2961
+ v.className = "gengage-chat-panel-restore-card__eyebrow", v.textContent = n, g.appendChild(v);
2944
2962
  }
2945
- if (d.length > 0) {
2963
+ if (p.length > 0) {
2946
2964
  const v = document.createElement("div");
2947
2965
  v.className = "gengage-chat-panel-restore-card__previews";
2948
- for (const u of d) {
2949
- const g = document.createElement("div");
2950
- g.className = "gengage-chat-panel-restore-card__thumb";
2966
+ for (const u of p) {
2967
+ const d = document.createElement("div");
2968
+ d.className = "gengage-chat-panel-restore-card__thumb";
2951
2969
  const _ = u.imageUrl;
2952
2970
  if (_ && he(_)) {
2953
2971
  const y = document.createElement("img");
2954
- y.loading = "lazy", y.alt = u.name || r, de(y, "src", _), xe(y), g.appendChild(y);
2972
+ y.loading = "lazy", y.alt = u.name || r, de(y, "src", _), xe(y), d.appendChild(y);
2955
2973
  }
2956
- v.appendChild(g);
2974
+ v.appendChild(d);
2957
2975
  }
2958
- p.appendChild(v);
2976
+ g.appendChild(v);
2959
2977
  }
2960
2978
  if (i && r) {
2961
2979
  const v = document.createElement("div");
2962
- v.className = "gengage-chat-panel-restore-card__title", v.textContent = r, v.title = r, p.appendChild(v);
2980
+ v.className = "gengage-chat-panel-restore-card__title", v.textContent = r, v.title = r, g.appendChild(v);
2963
2981
  }
2964
2982
  const x = document.createElement("div");
2965
- return x.className = "gengage-chat-panel-restore-card__cta", x.textContent = o, p.appendChild(x), p;
2983
+ return x.className = "gengage-chat-panel-restore-card__cta", x.textContent = o, g.appendChild(x), g;
2966
2984
  }
2967
2985
  function zr(t, e) {
2968
2986
  const a = t.props?.product ?? t.props, n = document.createElement("div");
2969
2987
  if (n.className = "gengage-chat-product-summary gds-card", n.dataset.gengagePart = "product-summary-card", !a) return n;
2970
- n.classList.add("gds-clickable"), n.addEventListener("click", (g) => {
2971
- g.target.closest("a") || e.onProductSelect?.(a);
2988
+ n.classList.add("gds-clickable"), n.addEventListener("click", (d) => {
2989
+ d.target.closest("a") || e.onProductSelect?.(a);
2972
2990
  });
2973
2991
  const r = a.imageUrl;
2974
2992
  if (r && he(r)) {
2975
- const g = document.createElement("div");
2976
- g.className = "gengage-chat-product-summary__image", g.dataset.gengagePart = "product-summary-image";
2993
+ const d = document.createElement("div");
2994
+ d.className = "gengage-chat-product-summary__image", d.dataset.gengagePart = "product-summary-image";
2977
2995
  const _ = document.createElement("img");
2978
- _.loading = "lazy", de(_, "src", r), _.alt = a.name || "Product image", xe(_), g.appendChild(_), n.appendChild(g);
2996
+ _.loading = "lazy", de(_, "src", r), _.alt = a.name || "Product image", xe(_), d.appendChild(_), n.appendChild(d);
2979
2997
  }
2980
2998
  const i = document.createElement("div");
2981
2999
  i.className = "gengage-chat-product-summary__content", i.dataset.gengagePart = "product-summary-content";
2982
3000
  const o = a.brand, s = a.name;
2983
3001
  if (s) {
2984
- const g = document.createElement("div");
2985
- g.className = "gengage-chat-product-summary__name", g.dataset.gengagePart = "product-summary-name";
3002
+ const d = document.createElement("div");
3003
+ d.className = "gengage-chat-product-summary__name", d.dataset.gengagePart = "product-summary-name";
2986
3004
  const _ = o && !s.toLowerCase().startsWith(o.toLowerCase()) ? `${o} ${s}` : s;
2987
- g.textContent = _, g.title = _, i.appendChild(g);
3005
+ d.textContent = _, d.title = _, i.appendChild(d);
2988
3006
  }
2989
3007
  const c = a.rating, l = a.reviewCount;
2990
3008
  if (e.hideUserReviews !== !0 && typeof c == "number" && Number.isFinite(c) && c > 0) {
2991
- const g = document.createElement("div");
2992
- if (g.className = "gengage-chat-product-summary__rating", g.dataset.gengagePart = "product-summary-rating", g.appendChild(Jt(c)), typeof l == "number" && Number.isFinite(l)) {
3009
+ const d = document.createElement("div");
3010
+ if (d.className = "gengage-chat-product-summary__rating", d.dataset.gengagePart = "product-summary-rating", d.appendChild(Jt(c)), typeof l == "number" && Number.isFinite(l)) {
2993
3011
  const _ = document.createElement("span");
2994
- _.className = "gengage-chat-product-summary__review-count", _.textContent = ` (${l})`, g.appendChild(_);
3012
+ _.className = "gengage-chat-product-summary__review-count", _.textContent = ` (${l})`, d.appendChild(_);
2995
3013
  }
2996
- i.appendChild(g);
3014
+ i.appendChild(d);
2997
3015
  }
2998
- const d = a.price, p = a.originalPrice;
2999
- if (d) {
3000
- const g = He(e, a), _ = $e(e, a), y = !!(p && p !== d), b = document.createElement("div");
3016
+ const p = a.price, g = a.originalPrice;
3017
+ if (p) {
3018
+ const d = He(e, a), _ = $e(e, a), y = !!(g && g !== p), b = document.createElement("div");
3001
3019
  b.className = "gengage-chat-product-summary__price", b.dataset.gengagePart = "product-summary-price";
3002
- const A = !!(g && y), T = Je(e, a);
3020
+ const A = !!(d && y), L = Je(e, a);
3003
3021
  if (A) {
3004
- const k = et({
3005
- reasonText: g,
3006
- salePriceFormatted: ae(d, e.pricing),
3007
- ...T !== void 0 ? { logoUrl: T } : {}
3022
+ const E = et({
3023
+ reasonText: d,
3024
+ salePriceFormatted: ae(p, e.pricing),
3025
+ ...L !== void 0 ? { logoUrl: L } : {}
3008
3026
  });
3009
3027
  if (y && _ === "inline") {
3010
- b.classList.add("gengage-chat-product-summary__price--inline"), b.appendChild(k);
3011
- const L = document.createElement("span");
3012
- L.className = "gengage-chat-product-summary__price-sep", L.setAttribute("aria-hidden", "true");
3013
- const z = document.createElement("span");
3014
- z.className = "gengage-chat-product-summary__price-original", z.textContent = ae(p, e.pricing), b.appendChild(L), b.appendChild(z);
3028
+ b.classList.add("gengage-chat-product-summary__price--inline"), b.appendChild(E);
3029
+ const T = document.createElement("span");
3030
+ T.className = "gengage-chat-product-summary__price-sep", T.setAttribute("aria-hidden", "true");
3031
+ const N = document.createElement("span");
3032
+ N.className = "gengage-chat-product-summary__price-original", N.textContent = ae(g, e.pricing), b.appendChild(T), b.appendChild(N);
3015
3033
  } else {
3016
- const L = document.createElement("span");
3017
- L.className = "gengage-chat-product-summary__price-original", L.textContent = ae(p, e.pricing), b.appendChild(L), b.appendChild(document.createTextNode(" ")), b.appendChild(k);
3034
+ const T = document.createElement("span");
3035
+ T.className = "gengage-chat-product-summary__price-original", T.textContent = ae(g, e.pricing), b.appendChild(T), b.appendChild(document.createTextNode(" ")), b.appendChild(E);
3018
3036
  }
3019
3037
  i.appendChild(b);
3020
3038
  } else {
3021
3039
  if (y && _ === "inline") {
3022
3040
  b.classList.add("gengage-chat-product-summary__price--inline");
3023
- const k = document.createElement("span");
3024
- k.className = "gengage-chat-product-summary__price-current", k.textContent = ae(d, e.pricing);
3025
- const L = document.createElement("span");
3026
- L.className = "gengage-chat-product-summary__price-sep", L.setAttribute("aria-hidden", "true");
3027
- const z = document.createElement("span");
3028
- z.className = "gengage-chat-product-summary__price-original", z.textContent = ae(p, e.pricing), b.appendChild(k), b.appendChild(L), b.appendChild(z);
3041
+ const E = document.createElement("span");
3042
+ E.className = "gengage-chat-product-summary__price-current", E.textContent = ae(p, e.pricing);
3043
+ const T = document.createElement("span");
3044
+ T.className = "gengage-chat-product-summary__price-sep", T.setAttribute("aria-hidden", "true");
3045
+ const N = document.createElement("span");
3046
+ N.className = "gengage-chat-product-summary__price-original", N.textContent = ae(g, e.pricing), b.appendChild(E), b.appendChild(T), b.appendChild(N);
3029
3047
  } else if (y) {
3030
- const k = document.createElement("span");
3031
- k.className = "gengage-chat-product-summary__price-original", k.textContent = ae(p, e.pricing), b.appendChild(k), b.appendChild(document.createTextNode(" "));
3032
- const L = document.createElement("span");
3033
- L.className = "gengage-chat-product-summary__price-current", L.textContent = ae(d, e.pricing), b.appendChild(L);
3048
+ const E = document.createElement("span");
3049
+ E.className = "gengage-chat-product-summary__price-original", E.textContent = ae(g, e.pricing), b.appendChild(E), b.appendChild(document.createTextNode(" "));
3050
+ const T = document.createElement("span");
3051
+ T.className = "gengage-chat-product-summary__price-current", T.textContent = ae(p, e.pricing), b.appendChild(T);
3034
3052
  } else {
3035
- const k = document.createElement("span");
3036
- k.className = "gengage-chat-product-summary__price-current", k.textContent = ae(d, e.pricing), b.appendChild(k);
3053
+ const E = document.createElement("span");
3054
+ E.className = "gengage-chat-product-summary__price-current", E.textContent = ae(p, e.pricing), b.appendChild(E);
3037
3055
  }
3038
- if (g) {
3039
- const k = document.createElement("div");
3040
- k.className = "gengage-chat-product-summary__price-stack", k.appendChild(Qe(g)), k.appendChild(b), i.appendChild(k);
3056
+ if (d) {
3057
+ const E = document.createElement("div");
3058
+ E.className = "gengage-chat-product-summary__price-stack", E.appendChild(Qe(d)), E.appendChild(b), i.appendChild(E);
3041
3059
  } else i.appendChild(b);
3042
3060
  }
3043
3061
  }
3044
3062
  n.appendChild(i);
3045
3063
  const h = a.url, m = a.sku, x = a.cartCode ?? a.cart_code, v = typeof x == "string" && x.trim() ? x.trim() : void 0, u = a.inStock;
3046
3064
  if (m && v && u !== !1) {
3047
- const g = document.createElement("button");
3048
- g.type = "button", g.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", g.dataset.gengagePart = "product-summary-cta", g.textContent = e.i18n?.addToCartButton ?? "Add to Cart", g.addEventListener("click", (_) => {
3065
+ const d = document.createElement("button");
3066
+ d.type = "button", d.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", d.dataset.gengagePart = "product-summary-cta", d.textContent = e.i18n?.addToCartButton ?? "Add to Cart", d.addEventListener("click", (_) => {
3049
3067
  _.stopPropagation(), e.onAction({
3050
3068
  title: e.i18n?.addToCartButton ?? "Add to Cart",
3051
3069
  type: "addToCart",
@@ -3055,10 +3073,10 @@ function zr(t, e) {
3055
3073
  quantity: 1
3056
3074
  }
3057
3075
  });
3058
- }), n.appendChild(g);
3076
+ }), n.appendChild(d);
3059
3077
  } else if (h && he(h)) {
3060
- const g = document.createElement("a");
3061
- 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);
3078
+ const d = document.createElement("a");
3079
+ d.className = "gengage-chat-product-summary__cta gds-chip gds-chip-active", d.dataset.gengagePart = "product-summary-cta", de(d, "href", h), de(d, "target", "_blank"), de(d, "rel", "noopener noreferrer"), d.textContent = e.i18n?.productCtaLabel ?? "View", n.appendChild(d);
3062
3080
  }
3063
3081
  return n;
3064
3082
  }
@@ -3140,7 +3158,7 @@ function Nt(t, e, a, n, r) {
3140
3158
  const i = $e(e, a), o = !!(r && n && r !== n), s = He(e, a), c = !!(s && o), l = Je(e, a);
3141
3159
  if (!n || parseFloat(n) <= 0) return;
3142
3160
  if (c) {
3143
- const p = et({
3161
+ const g = et({
3144
3162
  reasonText: s,
3145
3163
  salePriceFormatted: ae(n, e.pricing),
3146
3164
  ...l !== void 0 ? { logoUrl: l } : {}
@@ -3148,14 +3166,14 @@ function Nt(t, e, a, n, r) {
3148
3166
  if (o && i === "inline") {
3149
3167
  t.classList.add("gengage-chat-product-card-price-block--inline");
3150
3168
  const h = document.createElement("div");
3151
- h.className = "gengage-chat-product-card-price-row", h.appendChild(p);
3169
+ h.className = "gengage-chat-product-card-price-row", h.appendChild(g);
3152
3170
  const m = document.createElement("span");
3153
3171
  m.className = "gengage-chat-product-card-price-sep", m.setAttribute("aria-hidden", "true");
3154
3172
  const x = document.createElement("span");
3155
3173
  x.className = "gengage-chat-product-card-original-price", x.textContent = ae(r, e.pricing), h.appendChild(m), h.appendChild(x), t.appendChild(h);
3156
3174
  return;
3157
3175
  }
3158
- if (t.classList.remove("gengage-chat-product-card-price-block--inline"), t.appendChild(p), o) {
3176
+ if (t.classList.remove("gengage-chat-product-card-price-block--inline"), t.appendChild(g), o) {
3159
3177
  t.appendChild(document.createTextNode(" "));
3160
3178
  const h = document.createElement("span");
3161
3179
  h.className = "gengage-chat-product-card-original-price", h.textContent = ae(r, e.pricing), t.appendChild(h);
@@ -3164,35 +3182,35 @@ function Nt(t, e, a, n, r) {
3164
3182
  }
3165
3183
  if (o && i === "inline") {
3166
3184
  t.classList.add("gengage-chat-product-card-price-block--inline");
3167
- const p = document.createElement("div");
3168
- p.className = "gengage-chat-product-card-price-row";
3185
+ const g = document.createElement("div");
3186
+ g.className = "gengage-chat-product-card-price-row";
3169
3187
  const h = document.createElement("span");
3170
3188
  h.className = "gengage-chat-product-card-current-price", h.textContent = ae(n, e.pricing);
3171
3189
  const m = document.createElement("span");
3172
3190
  m.className = "gengage-chat-product-card-price-sep", m.setAttribute("aria-hidden", "true");
3173
3191
  const x = document.createElement("span");
3174
- x.className = "gengage-chat-product-card-original-price", x.textContent = ae(r, e.pricing), p.appendChild(h), p.appendChild(m), p.appendChild(x), t.appendChild(p);
3192
+ x.className = "gengage-chat-product-card-original-price", x.textContent = ae(r, e.pricing), g.appendChild(h), g.appendChild(m), g.appendChild(x), t.appendChild(g);
3175
3193
  return;
3176
3194
  }
3177
3195
  t.classList.remove("gengage-chat-product-card-price-block--inline");
3178
- const d = document.createElement("span");
3179
- if (d.className = "gengage-chat-product-card-current-price", d.textContent = ae(n, e.pricing), t.appendChild(d), o) {
3196
+ const p = document.createElement("span");
3197
+ if (p.className = "gengage-chat-product-card-current-price", p.textContent = ae(n, e.pricing), t.appendChild(p), o) {
3180
3198
  t.appendChild(document.createTextNode(" "));
3181
- const p = document.createElement("span");
3182
- p.className = "gengage-chat-product-card-original-price", p.textContent = ae(r, e.pricing), t.appendChild(p);
3199
+ const g = document.createElement("span");
3200
+ g.className = "gengage-chat-product-card-original-price", g.textContent = ae(r, e.pricing), t.appendChild(g);
3183
3201
  }
3184
3202
  }
3185
3203
  function Bt(t, e, a, n, r, i, o) {
3186
3204
  t.classList.remove("gengage-chat-product-details-price--inline"), t.replaceChildren(), t.className = "gengage-chat-product-details-price";
3187
3205
  const s = He(e, a), c = !!(s && o), l = Je(e, a);
3188
3206
  if (c) {
3189
- const p = et({
3207
+ const g = et({
3190
3208
  reasonText: s,
3191
3209
  salePriceFormatted: ae(n, e.pricing),
3192
3210
  ...l !== void 0 ? { logoUrl: l } : {}
3193
3211
  });
3194
3212
  if (o && i === "inline") {
3195
- t.classList.add("gengage-chat-product-details-price--inline"), t.appendChild(p);
3213
+ t.classList.add("gengage-chat-product-details-price--inline"), t.appendChild(g);
3196
3214
  const h = document.createElement("span");
3197
3215
  h.className = "gengage-chat-product-details-price-sep", h.setAttribute("aria-hidden", "true");
3198
3216
  const m = document.createElement("span");
@@ -3202,28 +3220,28 @@ function Bt(t, e, a, n, r, i, o) {
3202
3220
  const h = document.createElement("span");
3203
3221
  h.className = "gengage-chat-product-details-original-price", h.textContent = ae(r, e.pricing), t.appendChild(h), t.appendChild(document.createTextNode(" "));
3204
3222
  }
3205
- t.appendChild(p);
3223
+ t.appendChild(g);
3206
3224
  }
3207
3225
  } else if (o && i === "inline") {
3208
3226
  t.classList.add("gengage-chat-product-details-price--inline");
3209
- const p = document.createElement("span");
3210
- p.className = "gengage-chat-product-details-current-price", p.textContent = ae(n, e.pricing);
3227
+ const g = document.createElement("span");
3228
+ g.className = "gengage-chat-product-details-current-price", g.textContent = ae(n, e.pricing);
3211
3229
  const h = document.createElement("span");
3212
3230
  h.className = "gengage-chat-product-details-price-sep", h.setAttribute("aria-hidden", "true");
3213
3231
  const m = document.createElement("span");
3214
- m.className = "gengage-chat-product-details-original-price", m.textContent = ae(r, e.pricing), t.appendChild(p), t.appendChild(h), t.appendChild(m);
3232
+ m.className = "gengage-chat-product-details-original-price", m.textContent = ae(r, e.pricing), t.appendChild(g), t.appendChild(h), t.appendChild(m);
3215
3233
  } else {
3216
3234
  if (o) {
3217
3235
  const h = document.createElement("span");
3218
3236
  h.className = "gengage-chat-product-details-original-price", h.textContent = ae(r, e.pricing), t.appendChild(h), t.appendChild(document.createTextNode(" "));
3219
3237
  }
3220
- const p = document.createElement("span");
3221
- p.className = "gengage-chat-product-details-current-price", p.textContent = ae(n, e.pricing), t.appendChild(p);
3238
+ const g = document.createElement("span");
3239
+ g.className = "gengage-chat-product-details-current-price", g.textContent = ae(n, e.pricing), t.appendChild(g);
3222
3240
  }
3223
- const d = Ke(a, "discountPercent", "price_discount_rate");
3224
- if (!e.hideProductDiscountBadge && typeof d == "number" && d > 0) {
3225
- const p = document.createElement("span");
3226
- p.className = "gengage-chat-product-details-discount-badge", p.textContent = `%${ta(d)}`, t.appendChild(p);
3241
+ const p = Ke(a, "discountPercent", "price_discount_rate");
3242
+ if (!e.hideProductDiscountBadge && typeof p == "number" && p > 0) {
3243
+ const g = document.createElement("span");
3244
+ g.className = "gengage-chat-product-details-discount-badge", g.textContent = `%${ta(p)}`, t.appendChild(g);
3227
3245
  }
3228
3246
  }
3229
3247
  function pt(t, e) {
@@ -3233,35 +3251,35 @@ function pt(t, e) {
3233
3251
  if (!n) return a;
3234
3252
  const r = n.sku;
3235
3253
  r && (a.dataset.sku = r);
3236
- 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({
3254
+ const i = t.props?.action, o = n.name, s = n.url, c = n.sku, l = s && he(s) ? s : void 0, p = () => i?.type !== "launchSingleProduct" || l === void 0 || c === void 0 || e.onProductClick === void 0 ? !1 : (e.onProductClick({
3237
3255
  sku: c,
3238
3256
  url: l,
3239
3257
  ...typeof o == "string" ? { name: o } : {}
3240
3258
  }), !0);
3241
- (e.onProductSelect || i) && (a.classList.add("gds-clickable"), a.addEventListener("click", (C) => {
3242
- if (!a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper") && !C.target.closest(".gengage-chat-product-card-atc") && !C.target.closest(".gengage-chat-product-card-cta")) {
3259
+ (e.onProductSelect || i) && (a.classList.add("gds-clickable"), a.addEventListener("click", (k) => {
3260
+ if (!a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper") && !k.target.closest(".gengage-chat-product-card-atc") && !k.target.closest(".gengage-chat-product-card-cta")) {
3243
3261
  if (i) {
3244
- d() || e.onAction(i);
3262
+ p() || e.onAction(i);
3245
3263
  return;
3246
3264
  }
3247
3265
  e.onProductSelect?.(n);
3248
3266
  }
3249
3267
  }));
3250
- const p = n.imageUrl;
3251
- if (p && he(p)) {
3252
- const C = document.createElement("div");
3253
- C.className = "gengage-chat-product-card-img-wrapper";
3254
- const U = document.createElement("img");
3255
- U.className = "gengage-chat-product-card-img", U.loading = "lazy", de(U, "src", p);
3256
- const N = n.name;
3257
- N && (U.alt = N), xe(U), C.appendChild(U);
3268
+ const g = n.imageUrl;
3269
+ if (g && he(g)) {
3270
+ const k = document.createElement("div");
3271
+ k.className = "gengage-chat-product-card-img-wrapper";
3272
+ const O = document.createElement("img");
3273
+ O.className = "gengage-chat-product-card-img", O.loading = "lazy", de(O, "src", g);
3274
+ const B = n.name;
3275
+ B && (O.alt = B), xe(O), k.appendChild(O);
3258
3276
  const q = n.discountPercent;
3259
3277
  if (!e.hideProductDiscountBadge && typeof q == "number" && q > 0) {
3260
3278
  const f = document.createElement("span");
3261
- f.className = "gengage-chat-product-card-discount-badge", f.textContent = `%${ta(q)}`, C.appendChild(f);
3279
+ f.className = "gengage-chat-product-card-discount-badge", f.textContent = `%${ta(q)}`, k.appendChild(f);
3262
3280
  }
3263
- const D = document.createElement("div");
3264
- D.className = "gengage-chat-product-card-img-actions";
3281
+ const U = document.createElement("div");
3282
+ U.className = "gengage-chat-product-card-img-actions";
3265
3283
  const ne = n.sku;
3266
3284
  if (ne && e.onFavoriteToggle) {
3267
3285
  const f = document.createElement("button");
@@ -3271,7 +3289,7 @@ function pt(t, e) {
3271
3289
  P.stopPropagation(), f.classList.toggle("gengage-chat-favorite-btn--active");
3272
3290
  const $ = f.querySelector("svg");
3273
3291
  $ && $.setAttribute("fill", f.classList.contains("gengage-chat-favorite-btn--active") ? "currentColor" : "none"), e.onFavoriteToggle(ne, n);
3274
- }), D.appendChild(f);
3292
+ }), U.appendChild(f);
3275
3293
  }
3276
3294
  const W = n.sku, K = e.i18n?.findSimilarLabel ?? "Find Similar";
3277
3295
  if (W) {
@@ -3284,59 +3302,59 @@ function pt(t, e) {
3284
3302
  type: "findSimilar",
3285
3303
  payload: { sku: W }
3286
3304
  });
3287
- }), D.appendChild(f);
3305
+ }), U.appendChild(f);
3288
3306
  }
3289
- D.childElementCount > 0 && C.appendChild(D), a.appendChild(C);
3307
+ U.childElementCount > 0 && k.appendChild(U), a.appendChild(k);
3290
3308
  }
3291
3309
  const h = document.createElement("div");
3292
3310
  h.className = "gengage-chat-product-card-body";
3293
3311
  const m = n.brand;
3294
3312
  if (m) {
3295
- const C = document.createElement("div");
3296
- C.className = "gengage-chat-product-card-brand", C.textContent = m, h.appendChild(C);
3313
+ const k = document.createElement("div");
3314
+ k.className = "gengage-chat-product-card-brand", k.textContent = m, h.appendChild(k);
3297
3315
  }
3298
- 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");
3299
- z.className = "gengage-chat-product-card-meta-row";
3300
- const O = document.createElement("div");
3301
- O.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3302
- const X = k ? (() => {
3303
- const C = document.createElement("div");
3304
- return C.className = "gengage-chat-product-card-price-stack", y && !T && C.appendChild(Qe(y)), C.appendChild(O), C;
3305
- })() : O;
3316
+ const x = n.rating, v = n.reviewCount, u = n.price, d = n.originalPrice, _ = n.price_async, y = He(e, n), b = $e(e, n), A = !!(d && u && d !== u && parseFloat(u) > 0), L = !!(y && A), E = !!(y && !L || A && b === "inline"), T = typeof x == "number" && Number.isFinite(x) && x > 0, N = document.createElement("div");
3317
+ N.className = "gengage-chat-product-card-meta-row";
3318
+ const F = document.createElement("div");
3319
+ F.className = "gengage-chat-product-card-price gengage-chat-product-card-price-block";
3320
+ const X = E ? (() => {
3321
+ const k = document.createElement("div");
3322
+ return k.className = "gengage-chat-product-card-price-stack", y && !L && k.appendChild(Qe(y)), k.appendChild(F), k;
3323
+ })() : F;
3306
3324
  if (_ === !0) {
3307
- const C = document.createElement("span");
3308
- C.className = "gengage-chat-price-skeleton", O.appendChild(C), setTimeout(() => {
3309
- C.parentElement && (u && parseFloat(u) > 0 ? Nt(O, e, n, u, n.originalPrice) : C.remove());
3325
+ const k = document.createElement("span");
3326
+ k.className = "gengage-chat-price-skeleton", F.appendChild(k), setTimeout(() => {
3327
+ k.parentElement && (u && parseFloat(u) > 0 ? Nt(F, e, n, u, n.originalPrice) : k.remove());
3310
3328
  }, 300);
3311
- } else u && parseFloat(u) > 0 && Nt(O, e, n, u, g);
3312
- if ((O.childElementCount > 0 || _ === !0) && z.appendChild(X), L) {
3313
- const C = document.createElement("div");
3314
- C.className = "gengage-chat-product-card-rating gengage-chat-product-card-rating-compact";
3315
- const U = ea(x), N = [`${U.toFixed(1)}`, "out of 5 stars"];
3316
- typeof v == "number" && Number.isFinite(v) && N.push(`(${v} reviews)`), C.setAttribute("aria-label", N.join(" "));
3329
+ } else u && parseFloat(u) > 0 && Nt(F, e, n, u, d);
3330
+ if ((F.childElementCount > 0 || _ === !0) && N.appendChild(X), T) {
3331
+ const k = document.createElement("div");
3332
+ k.className = "gengage-chat-product-card-rating gengage-chat-product-card-rating-compact";
3333
+ const O = ea(x), B = [`${O.toFixed(1)}`, "out of 5 stars"];
3334
+ typeof v == "number" && Number.isFinite(v) && B.push(`(${v} reviews)`), k.setAttribute("aria-label", B.join(" "));
3317
3335
  const q = document.createElement("span");
3318
3336
  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>';
3319
- const D = document.createElement("span");
3320
- D.className = "gengage-chat-product-card-rating-compact-value", D.textContent = U.toFixed(1), C.appendChild(q), C.appendChild(D), z.appendChild(C);
3337
+ const U = document.createElement("span");
3338
+ U.className = "gengage-chat-product-card-rating-compact-value", U.textContent = O.toFixed(1), k.appendChild(q), k.appendChild(U), N.appendChild(k);
3321
3339
  }
3322
- if (z.childElementCount === 0 && (z.classList.add("gengage-chat-product-card-meta-row--empty"), z.setAttribute("aria-hidden", "true")), h.appendChild(z), o) {
3323
- const C = document.createElement("div");
3324
- C.className = "gengage-chat-product-card-name", C.textContent = o, C.title = o, h.appendChild(C);
3340
+ if (N.childElementCount === 0 && (N.classList.add("gengage-chat-product-card-meta-row--empty"), N.setAttribute("aria-hidden", "true")), h.appendChild(N), o) {
3341
+ const k = document.createElement("div");
3342
+ k.className = "gengage-chat-product-card-name", k.textContent = o, k.title = o, h.appendChild(k);
3325
3343
  }
3326
- const E = n.inStock;
3327
- if (e.hideStockStatus !== !0 && typeof E == "boolean") {
3328
- const C = document.createElement("div");
3329
- C.className = `gengage-chat-product-card-stock ${E ? "is-in-stock" : "is-out-of-stock"}`, C.textContent = E ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", h.appendChild(C);
3344
+ const C = n.inStock;
3345
+ if (e.hideStockStatus !== !0 && typeof C == "boolean") {
3346
+ const k = document.createElement("div");
3347
+ k.className = `gengage-chat-product-card-stock ${C ? "is-in-stock" : "is-out-of-stock"}`, k.textContent = C ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", h.appendChild(k);
3330
3348
  }
3331
3349
  a.appendChild(h);
3332
- const R = n.cartCode, F = !!(R && c && E !== !1), B = e.i18n?.productCtaLabel ?? "View";
3333
- if (F) {
3334
- const C = document.createElement("div");
3335
- C.className = "gengage-chat-product-card-buy-footer";
3336
- const U = document.createElement("button");
3337
- U.type = "button", U.className = "gengage-chat-product-card-buy-trigger", U.textContent = B, U.addEventListener("click", (N) => {
3338
- N.stopPropagation(), e.onAction({
3339
- title: e.i18n?.addToCartButton ?? B,
3350
+ const R = n.cartCode, D = !!(R && c && C !== !1), z = e.i18n?.productCtaLabel ?? "View";
3351
+ if (D) {
3352
+ const k = document.createElement("div");
3353
+ k.className = "gengage-chat-product-card-buy-footer";
3354
+ const O = document.createElement("button");
3355
+ O.type = "button", O.className = "gengage-chat-product-card-buy-trigger", O.textContent = z, O.addEventListener("click", (B) => {
3356
+ B.stopPropagation(), e.onAction({
3357
+ title: e.i18n?.addToCartButton ?? z,
3340
3358
  type: "addToCart",
3341
3359
  payload: {
3342
3360
  sku: c,
@@ -3344,49 +3362,49 @@ function pt(t, e) {
3344
3362
  quantity: 1
3345
3363
  }
3346
3364
  });
3347
- }), C.appendChild(U), a.appendChild(C);
3365
+ }), k.appendChild(O), a.appendChild(k);
3348
3366
  } else if (i) {
3349
- const C = document.createElement("button");
3350
- C.className = "gengage-chat-product-card-cta", C.type = "button", C.textContent = i.type === "launchSingleProduct" ? B : i.title || B, C.addEventListener("click", (U) => {
3367
+ const k = document.createElement("button");
3368
+ k.className = "gengage-chat-product-card-cta", k.type = "button", k.textContent = i.type === "launchSingleProduct" ? z : i.title || z, k.addEventListener("click", (O) => {
3351
3369
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3352
- U.stopPropagation();
3370
+ O.stopPropagation();
3353
3371
  return;
3354
3372
  }
3355
- d() || e.onAction(i);
3356
- }), a.appendChild(C);
3373
+ p() || e.onAction(i);
3374
+ }), a.appendChild(k);
3357
3375
  } else if (l) {
3358
- const C = document.createElement("a");
3359
- 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) => {
3376
+ const k = document.createElement("a");
3377
+ k.className = "gengage-chat-product-card-cta", de(k, "href", l), de(k, "target", "_blank"), de(k, "rel", "noopener noreferrer"), k.textContent = z, k.addEventListener("click", (O) => {
3360
3378
  if (a.parentElement?.classList.contains("gengage-chat-comparison-select-wrapper")) {
3361
- U.preventDefault(), U.stopPropagation();
3379
+ O.preventDefault(), O.stopPropagation();
3362
3380
  return;
3363
3381
  }
3364
- e.onProductClick && c && (U.preventDefault(), e.onProductClick({
3382
+ e.onProductClick && c && (O.preventDefault(), e.onProductClick({
3365
3383
  sku: c,
3366
3384
  url: l,
3367
3385
  ...o ? { name: o } : {}
3368
3386
  }));
3369
- }), a.appendChild(C);
3387
+ }), a.appendChild(k);
3370
3388
  }
3371
3389
  if (e.comparisonSelectMode && c && e.onToggleComparisonSku) {
3372
- const C = document.createElement("div");
3373
- C.className = "gengage-chat-comparison-select-wrapper";
3374
- const U = e.comparisonSelectedSkus?.includes(c) ?? !1;
3375
- U && C.classList.add("gengage-chat-comparison-select-wrapper--selected");
3376
- const N = n.name ?? c, q = e.i18n?.comparisonSelectCardHint ?? "Tap anywhere on the card to add or remove it from comparison.";
3377
- C.setAttribute("role", "group"), C.setAttribute("aria-label", `${String(N)}. ${q}`);
3378
- const D = document.createElement("button");
3379
- D.type = "button", D.className = "gengage-chat-comparison-checkbox", D.dataset.selected = U ? "true" : "false", D.setAttribute("aria-pressed", U ? "true" : "false");
3390
+ const k = document.createElement("div");
3391
+ k.className = "gengage-chat-comparison-select-wrapper";
3392
+ const O = e.comparisonSelectedSkus?.includes(c) ?? !1;
3393
+ O && k.classList.add("gengage-chat-comparison-select-wrapper--selected");
3394
+ const B = n.name ?? c, q = e.i18n?.comparisonSelectCardHint ?? "Tap anywhere on the card to add or remove it from comparison.";
3395
+ k.setAttribute("role", "group"), k.setAttribute("aria-label", `${String(B)}. ${q}`);
3396
+ const U = document.createElement("button");
3397
+ U.type = "button", U.className = "gengage-chat-comparison-checkbox", U.dataset.selected = O ? "true" : "false", U.setAttribute("aria-pressed", O ? "true" : "false");
3380
3398
  const ne = document.createElement("span");
3381
- 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>';
3399
+ 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>';
3382
3400
  const W = document.createElement("span");
3383
- 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) => {
3401
+ W.className = "gengage-chat-comparison-checkbox-label", W.textContent = O ? e.i18n?.comparisonSelectedLabel ?? "Selected" : e.i18n?.comparisonSelectLabel ?? "Select to compare", U.appendChild(ne), U.appendChild(W), U.addEventListener("click", (f) => {
3384
3402
  f.stopPropagation(), e.onToggleComparisonSku?.(c);
3385
3403
  });
3386
3404
  const K = document.createElement("div");
3387
- return K.className = "gengage-chat-comparison-card-hint", K.setAttribute("aria-hidden", "true"), K.textContent = q, C.addEventListener("click", (f) => {
3405
+ return K.className = "gengage-chat-comparison-card-hint", K.setAttribute("aria-hidden", "true"), K.textContent = q, k.addEventListener("click", (f) => {
3388
3406
  f.target.closest(".gengage-chat-comparison-checkbox") || (f.stopPropagation(), e.onToggleComparisonSku?.(c));
3389
- }), C.appendChild(D), C.appendChild(K), C.appendChild(a), C;
3407
+ }), k.appendChild(U), k.appendChild(K), k.appendChild(a), k;
3390
3408
  }
3391
3409
  return a;
3392
3410
  }
@@ -3567,12 +3585,12 @@ function ii(t) {
3567
3585
  if (e) return e;
3568
3586
  const a = be(t, "sku"), n = Ge(t, "inStock", "in_stock"), r = [], i = /* @__PURE__ */ new Set(), o = (c, l) => {
3569
3587
  if (!ai(c) || typeof l != "string" && typeof l != "number" && typeof l != "boolean") return;
3570
- const d = String(l).trim();
3571
- if (!d) return;
3572
- const p = ni(c), h = `${p.toLowerCase()}:${d.toLowerCase()}`;
3588
+ const p = String(l).trim();
3589
+ if (!p) return;
3590
+ const g = ni(c), h = `${g.toLowerCase()}:${p.toLowerCase()}`;
3573
3591
  i.has(h) || (i.add(h), r.push({
3574
- name: p,
3575
- value: d,
3592
+ name: g,
3593
+ value: p,
3576
3594
  sku: a,
3577
3595
  inStock: n
3578
3596
  }));
@@ -3590,46 +3608,46 @@ function si(t, e) {
3590
3608
  a.className = "gengage-chat-product-details-panel";
3591
3609
  const n = t.props?.product ?? t.props;
3592
3610
  if (!n) return a;
3593
- 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);
3594
- if (g.length > 1) {
3595
- const E = document.createElement("div");
3596
- E.className = "gengage-chat-product-details-media gengage-chat-product-details-gallery gengage-chat-product-details-img-wrap";
3611
+ 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"), p = Ge(n, "price_async"), g = 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"), d = Kr(n), _ = ha(n).slice(0, 4);
3612
+ if (d.length > 1) {
3613
+ const C = document.createElement("div");
3614
+ C.className = "gengage-chat-product-details-media gengage-chat-product-details-gallery gengage-chat-product-details-img-wrap";
3597
3615
  const R = document.createElement("img");
3598
- R.className = "gengage-chat-product-details-img", de(R, "src", g[0]), R.alt = r ?? "Product image", xe(R), E.appendChild(R);
3599
- const F = document.createElement("div");
3600
- F.className = "gengage-chat-product-gallery-thumbs";
3601
- const B = 6;
3602
- let C = null, U = 0;
3603
- 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");
3616
+ R.className = "gengage-chat-product-details-img", de(R, "src", d[0]), R.alt = r ?? "Product image", xe(R), C.appendChild(R);
3617
+ const D = document.createElement("div");
3618
+ D.className = "gengage-chat-product-gallery-thumbs";
3619
+ const z = 6;
3620
+ let k = null, O = 0;
3621
+ const B = e.i18n, q = B?.galleryPrevAriaLabel ?? "Previous image", U = B?.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");
3604
3622
  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");
3605
3623
  const K = document.createElement("button");
3606
- 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");
3624
+ 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", U), K.innerHTML = ne("next");
3607
3625
  const f = () => {
3608
- W.disabled = U <= 0, K.disabled = U >= g.length - 1;
3626
+ W.disabled = O <= 0, K.disabled = O >= d.length - 1;
3609
3627
  }, S = (I) => {
3610
- if (I < 0 || I >= g.length || I === U) return;
3611
- const j = g[I];
3628
+ if (I < 0 || I >= d.length || I === O) return;
3629
+ const j = d[I];
3612
3630
  if (!j) return;
3613
3631
  de(R, "src", j);
3614
- const Q = F.querySelectorAll(".gengage-chat-product-gallery-thumb");
3615
- 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();
3632
+ const Q = D.querySelectorAll(".gengage-chat-product-gallery-thumb");
3633
+ k && k.classList.remove("gengage-chat-product-gallery-thumb--active"), I < z && Q[I] ? (Q[I].classList.add("gengage-chat-product-gallery-thumb--active"), k = Q[I]) : k = null, O = I, f();
3616
3634
  };
3617
- for (let I = 0; I < g.length; I++) {
3618
- const j = g[I];
3619
- if (I >= B) break;
3635
+ for (let I = 0; I < d.length; I++) {
3636
+ const j = d[I];
3637
+ if (I >= z) break;
3620
3638
  const Q = document.createElement("img");
3621
- Q.className = "gengage-chat-product-gallery-thumb", I === 0 && (Q.classList.add("gengage-chat-product-gallery-thumb--active"), C = Q), de(Q, "src", j), Q.alt = `${r ?? "Product"} ${I + 1}`, Q.width = 48, Q.height = 48, xe(Q), Q.addEventListener("click", () => {
3639
+ Q.className = "gengage-chat-product-gallery-thumb", I === 0 && (Q.classList.add("gengage-chat-product-gallery-thumb--active"), k = Q), de(Q, "src", j), Q.alt = `${r ?? "Product"} ${I + 1}`, Q.width = 48, Q.height = 48, xe(Q), Q.addEventListener("click", () => {
3622
3640
  S(I);
3623
- }), F.appendChild(Q);
3641
+ }), D.appendChild(Q);
3624
3642
  }
3625
- if (g.length > B) {
3643
+ if (d.length > z) {
3626
3644
  const I = document.createElement("span");
3627
- I.className = "gengage-chat-product-gallery-thumb-more", I.textContent = `+${g.length - B}`, F.appendChild(I);
3645
+ I.className = "gengage-chat-product-gallery-thumb-more", I.textContent = `+${d.length - z}`, D.appendChild(I);
3628
3646
  }
3629
3647
  W.addEventListener("click", (I) => {
3630
- I.stopPropagation(), S(U - 1);
3648
+ I.stopPropagation(), S(O - 1);
3631
3649
  }), K.addEventListener("click", (I) => {
3632
- I.stopPropagation(), S(U + 1);
3650
+ I.stopPropagation(), S(O + 1);
3633
3651
  }), f();
3634
3652
  let P = 0;
3635
3653
  const $ = 50;
@@ -3637,148 +3655,148 @@ function si(t, e) {
3637
3655
  P = I.changedTouches[0].clientX;
3638
3656
  }, { passive: !0 }), R.addEventListener("touchend", (I) => {
3639
3657
  const j = I.changedTouches[0].clientX, Q = P - j;
3640
- Math.abs(Q) < $ || S(Q > 0 ? Math.min(U + 1, g.length - 1) : Math.max(U - 1, 0));
3641
- }), E.appendChild(W), E.appendChild(K), E.appendChild(F), a.appendChild(E);
3642
- } else if (g.length === 1) {
3643
- const E = document.createElement("div");
3644
- E.className = "gengage-chat-product-details-media gengage-chat-product-details-img-wrap";
3658
+ Math.abs(Q) < $ || S(Q > 0 ? Math.min(O + 1, d.length - 1) : Math.max(O - 1, 0));
3659
+ }), C.appendChild(W), C.appendChild(K), C.appendChild(D), a.appendChild(C);
3660
+ } else if (d.length === 1) {
3661
+ const C = document.createElement("div");
3662
+ C.className = "gengage-chat-product-details-media gengage-chat-product-details-img-wrap";
3645
3663
  const R = document.createElement("img");
3646
- 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);
3664
+ R.className = "gengage-chat-product-details-img", R.loading = "lazy", de(R, "src", d[0]), xe(R), R.alt = r ?? "Product image", C.appendChild(R), a.appendChild(C);
3647
3665
  }
3648
3666
  const y = document.createElement("div");
3649
3667
  if (y.className = "gengage-chat-product-details-content", i && (!r || !r.toLowerCase().startsWith(i.toLowerCase()))) {
3650
- const E = document.createElement("div");
3651
- E.className = "gengage-chat-product-details-brand", E.textContent = i, y.appendChild(E);
3668
+ const C = document.createElement("div");
3669
+ C.className = "gengage-chat-product-details-brand", C.textContent = i, y.appendChild(C);
3652
3670
  }
3653
3671
  if (r) {
3654
- const E = document.createElement("h3");
3655
- E.className = "gengage-chat-product-details-title", E.textContent = r, E.title = r, y.appendChild(E);
3672
+ const C = document.createElement("h3");
3673
+ C.className = "gengage-chat-product-details-title", C.textContent = r, C.title = r, y.appendChild(C);
3656
3674
  }
3657
3675
  if (e.hideUserReviews !== !0 && typeof u == "number" && Number.isFinite(u) && u > 0) {
3658
- const E = document.createElement(o ? "button" : "div");
3659
- E.className = "gengage-chat-product-details-rating", o && (E.type = "button", E.classList.add("gengage-chat-product-details-rating--clickable"), E.setAttribute("aria-label", e.i18n?.groundingReviewCta ?? "Read Reviews"), E.addEventListener("click", () => {
3676
+ const C = document.createElement(o ? "button" : "div");
3677
+ C.className = "gengage-chat-product-details-rating", o && (C.type = "button", C.classList.add("gengage-chat-product-details-rating--clickable"), C.setAttribute("aria-label", e.i18n?.groundingReviewCta ?? "Read Reviews"), C.addEventListener("click", () => {
3660
3678
  e.onAction({
3661
3679
  title: e.i18n?.customerReviewsTitle ?? "Customer Reviews",
3662
3680
  type: "reviewSummary",
3663
3681
  payload: { sku: o }
3664
3682
  });
3665
- })), E.appendChild(Jt(u));
3683
+ })), C.appendChild(Jt(u));
3666
3684
  const R = document.createElement("span");
3667
- if (R.className = "gengage-chat-product-details-rating-value", R.textContent = ea(u).toFixed(1), E.appendChild(R), typeof v == "number" && Number.isFinite(v)) {
3668
- const F = document.createElement("span");
3669
- F.className = "gengage-chat-product-details-review-count", F.textContent = ` (${v})`, E.appendChild(F);
3685
+ if (R.className = "gengage-chat-product-details-rating-value", R.textContent = ea(u).toFixed(1), C.appendChild(R), typeof v == "number" && Number.isFinite(v)) {
3686
+ const D = document.createElement("span");
3687
+ D.className = "gengage-chat-product-details-review-count", D.textContent = ` (${v})`, C.appendChild(D);
3670
3688
  }
3671
- y.appendChild(E);
3689
+ y.appendChild(C);
3672
3690
  }
3673
3691
  {
3674
- const E = !!(p && m);
3692
+ const C = !!(g && m);
3675
3693
  let R = y;
3676
- if (p && !E) {
3677
- const B = document.createElement("div");
3678
- B.className = "gengage-chat-product-details-price-stack", B.appendChild(Qe(p)), y.appendChild(B), R = B;
3679
- }
3680
- const F = document.createElement("div");
3681
- if (F.className = "gengage-chat-product-details-price", d === !0) {
3682
- const B = document.createElement("span");
3683
- B.className = "gengage-chat-price-skeleton", F.appendChild(B), R.appendChild(F), setTimeout(() => {
3684
- if (B.parentElement)
3685
- if (c && parseFloat(c) > 0) Bt(F, e, n, c, l, h, m);
3694
+ if (g && !C) {
3695
+ const z = document.createElement("div");
3696
+ z.className = "gengage-chat-product-details-price-stack", z.appendChild(Qe(g)), y.appendChild(z), R = z;
3697
+ }
3698
+ const D = document.createElement("div");
3699
+ if (D.className = "gengage-chat-product-details-price", p === !0) {
3700
+ const z = document.createElement("span");
3701
+ z.className = "gengage-chat-price-skeleton", D.appendChild(z), R.appendChild(D), setTimeout(() => {
3702
+ if (z.parentElement)
3703
+ if (c && parseFloat(c) > 0) Bt(D, e, n, c, l, h, m);
3686
3704
  else {
3687
- const C = F.parentElement;
3688
- F.remove(), C?.classList.contains("gengage-chat-product-details-price-stack") && C.remove();
3705
+ const k = D.parentElement;
3706
+ D.remove(), k?.classList.contains("gengage-chat-product-details-price-stack") && k.remove();
3689
3707
  }
3690
3708
  }, 300);
3691
3709
  } else if (c && parseFloat(c) > 0)
3692
- Bt(F, e, n, c, l, h, m), R.appendChild(F);
3693
- else if (p) {
3694
- const B = R;
3695
- B.classList.contains("gengage-chat-product-details-price-stack") && B.remove();
3710
+ Bt(D, e, n, c, l, h, m), R.appendChild(D);
3711
+ else if (g) {
3712
+ const z = R;
3713
+ z.classList.contains("gengage-chat-product-details-price-stack") && z.remove();
3696
3714
  }
3697
3715
  }
3698
3716
  if (e.hideStockStatus !== !0 && typeof x == "boolean") {
3699
- const E = document.createElement("div");
3700
- 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);
3717
+ const C = document.createElement("div");
3718
+ C.className = `gengage-chat-product-details-stock ${x ? "is-in-stock" : "is-out-of-stock"}`, C.textContent = x ? e.i18n?.inStockLabel ?? "In Stock" : e.i18n?.outOfStockLabel ?? "Out of Stock", y.appendChild(C);
3701
3719
  }
3702
3720
  const b = n.promotions;
3703
3721
  if (b && b.length > 0) {
3704
- const E = document.createElement("div");
3705
- E.className = "gengage-chat-product-details-promos";
3722
+ const C = document.createElement("div");
3723
+ C.className = "gengage-chat-product-details-promos";
3706
3724
  for (const R of b.slice(0, 3)) {
3707
3725
  if (!R || /%(0(\.0+)?)\s/.test(R)) continue;
3708
- const F = document.createElement("span");
3709
- F.className = "gengage-chat-product-details-promo-badge", F.textContent = R, F.title = R, E.appendChild(F);
3726
+ const D = document.createElement("span");
3727
+ D.className = "gengage-chat-product-details-promo-badge", D.textContent = R, D.title = R, C.appendChild(D);
3710
3728
  }
3711
- E.childElementCount > 0 && y.appendChild(E);
3729
+ C.childElementCount > 0 && y.appendChild(C);
3712
3730
  }
3713
3731
  if (_.length > 0) {
3714
- const E = document.createElement("dl");
3715
- E.className = "gengage-chat-product-details-facts";
3732
+ const C = document.createElement("dl");
3733
+ C.className = "gengage-chat-product-details-facts";
3716
3734
  for (const R of _) {
3717
- const F = document.createElement("div");
3718
- F.className = "gengage-chat-product-details-fact";
3719
- const B = document.createElement("dt");
3720
- B.textContent = R.key;
3721
- const C = document.createElement("dd");
3722
- C.textContent = R.value, F.appendChild(B), F.appendChild(C), E.appendChild(F);
3735
+ const D = document.createElement("div");
3736
+ D.className = "gengage-chat-product-details-fact";
3737
+ const z = document.createElement("dt");
3738
+ z.textContent = R.key;
3739
+ const k = document.createElement("dd");
3740
+ k.textContent = R.value, D.appendChild(z), D.appendChild(k), C.appendChild(D);
3723
3741
  }
3724
- y.appendChild(E);
3742
+ y.appendChild(C);
3725
3743
  }
3726
3744
  const A = ii(n);
3727
3745
  if (A.length > 0) {
3728
- const E = document.createElement("div");
3729
- E.className = "gengage-chat-product-variants";
3746
+ const C = document.createElement("div");
3747
+ C.className = "gengage-chat-product-variants";
3730
3748
  const R = document.createElement("div");
3731
- R.className = "gengage-chat-product-variants-label", R.textContent = oi(A, e), E.appendChild(R);
3732
- const F = document.createElement("div");
3733
- F.className = "gengage-chat-product-variants-list";
3734
- for (const B of A) {
3735
- const C = ua(B), U = Ee(B, "sku");
3736
- if (!C && !U) continue;
3737
- const N = document.createElement("button");
3738
- N.className = "gengage-chat-product-variant-btn gds-chip", N.type = "button";
3739
- const q = C ?? U ?? "";
3740
- N.title = q;
3741
- const D = Ge(B, "in_stock", "inStock");
3742
- 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);
3743
- const ne = ei(B), W = Jr(B);
3749
+ R.className = "gengage-chat-product-variants-label", R.textContent = oi(A, e), C.appendChild(R);
3750
+ const D = document.createElement("div");
3751
+ D.className = "gengage-chat-product-variants-list";
3752
+ for (const z of A) {
3753
+ const k = ua(z), O = Ee(z, "sku");
3754
+ if (!k && !O) continue;
3755
+ const B = document.createElement("button");
3756
+ B.className = "gengage-chat-product-variant-btn gds-chip", B.type = "button";
3757
+ const q = k ?? O ?? "";
3758
+ B.title = q;
3759
+ const U = Ge(z, "in_stock", "inStock");
3760
+ O && o && O === o ? (B.classList.add("gengage-chat-product-variant-btn--active"), B.setAttribute("aria-pressed", "true")) : B.setAttribute("aria-pressed", "false"), U === !1 && (B.classList.add("gengage-chat-product-variant-btn--out"), B.disabled = !0);
3761
+ const ne = ei(z), W = Jr(z);
3744
3762
  if (ne && he(ne)) {
3745
3763
  const S = document.createElement("img");
3746
- 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);
3764
+ 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), B.appendChild(S);
3747
3765
  } else if (W) {
3748
3766
  const S = document.createElement("span");
3749
- S.className = "gengage-chat-product-variant-swatch", S.setAttribute("aria-hidden", "true"), S.style.backgroundColor = W, N.appendChild(S);
3767
+ S.className = "gengage-chat-product-variant-swatch", S.setAttribute("aria-hidden", "true"), S.style.backgroundColor = W, B.appendChild(S);
3750
3768
  }
3751
3769
  const K = document.createElement("span");
3752
- K.className = "gengage-chat-product-variant-label", K.textContent = q, N.appendChild(K);
3753
- const f = ti(B);
3770
+ K.className = "gengage-chat-product-variant-label", K.textContent = q, B.appendChild(K);
3771
+ const f = ti(z);
3754
3772
  if (f && String(f) !== String(c)) {
3755
3773
  const S = document.createElement("span");
3756
- S.className = "gengage-chat-product-variant-price", S.textContent = ae(String(f), e.pricing), N.appendChild(S);
3774
+ S.className = "gengage-chat-product-variant-price", S.textContent = ae(String(f), e.pricing), B.appendChild(S);
3757
3775
  }
3758
- if (U && U !== o) {
3759
- 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;
3760
- N.addEventListener("click", () => {
3776
+ if (O && O !== o) {
3777
+ const S = r ?? "", P = (typeof z.value == "string" ? z.value.trim() : "") || (typeof z.name == "string" ? z.name.trim() : "") || (typeof z.variant_name == "string" ? z.variant_name.trim() : "") || "", $ = S.length > 0 ? P.length > 0 && P !== S ? `${S} (${P})` : S : q;
3778
+ B.addEventListener("click", () => {
3761
3779
  e.onAction({
3762
3780
  title: $,
3763
3781
  type: "launchVariant",
3764
- payload: { sku: U }
3782
+ payload: { sku: O }
3765
3783
  });
3766
3784
  });
3767
3785
  }
3768
- F.appendChild(N);
3786
+ D.appendChild(B);
3769
3787
  }
3770
- F.childElementCount > 0 && (E.appendChild(F), y.appendChild(E));
3788
+ D.childElementCount > 0 && (C.appendChild(D), y.appendChild(C));
3771
3789
  }
3772
- const T = document.createElement("div");
3773
- T.className = "gengage-chat-product-details-actions";
3774
- const k = t.props?.action;
3775
- if (k) {
3776
- const E = document.createElement("button");
3777
- E.className = "gengage-chat-product-details-cta gds-btn gds-btn-primary", E.type = "button", E.textContent = k.title || e.i18n?.productCtaLabel || "View", E.addEventListener("click", () => e.onAction(k)), T.appendChild(E);
3790
+ const L = document.createElement("div");
3791
+ L.className = "gengage-chat-product-details-actions";
3792
+ const E = t.props?.action;
3793
+ if (E) {
3794
+ const C = document.createElement("button");
3795
+ C.className = "gengage-chat-product-details-cta gds-btn gds-btn-primary", C.type = "button", C.textContent = E.title || e.i18n?.productCtaLabel || "View", C.addEventListener("click", () => e.onAction(E)), L.appendChild(C);
3778
3796
  }
3779
3797
  if (s && o && x !== !1) {
3780
- const E = document.createElement("button");
3781
- E.className = "gengage-chat-product-details-atc gds-btn gds-btn-primary", E.type = "button", E.textContent = e.i18n?.addToCartButton ?? "Add to Cart", E.addEventListener("click", () => {
3798
+ const C = document.createElement("button");
3799
+ C.className = "gengage-chat-product-details-atc gds-btn gds-btn-primary", C.type = "button", C.textContent = e.i18n?.addToCartButton ?? "Add to Cart", C.addEventListener("click", () => {
3782
3800
  e.onAction({
3783
3801
  title: e.i18n?.addToCartButton ?? "Add to Cart",
3784
3802
  type: "addToCart",
@@ -3788,46 +3806,46 @@ function si(t, e) {
3788
3806
  quantity: 1
3789
3807
  }
3790
3808
  });
3791
- }), T.appendChild(E);
3809
+ }), L.appendChild(C);
3792
3810
  }
3793
- const L = be(n, "url");
3794
- if (!k && L && he(L)) {
3795
- const E = document.createElement("a");
3796
- 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) => {
3811
+ const T = be(n, "url");
3812
+ if (!E && T && he(T)) {
3813
+ const C = document.createElement("a");
3814
+ C.className = "gengage-chat-product-details-cta gds-btn gds-btn-secondary", de(C, "href", T), de(C, "target", "_blank"), de(C, "rel", "noopener noreferrer"), C.textContent = e.i18n?.viewOnSiteLabel ?? e.i18n?.productCtaLabel ?? "View on Site", C.addEventListener("click", (R) => {
3797
3815
  e.onProductClick && o && (R.preventDefault(), e.onProductClick({
3798
3816
  sku: o,
3799
- url: L,
3817
+ url: T,
3800
3818
  ...r ? { name: r } : {}
3801
3819
  }));
3802
- }), T.appendChild(E);
3803
- }
3804
- const z = L;
3805
- if (z && he(z)) {
3806
- let C = function(N, q) {
3807
- const D = document.createElementNS(F, "circle");
3808
- D.setAttribute("cx", N), D.setAttribute("cy", q), D.setAttribute("r", "3"), B.appendChild(D);
3809
- }, U = function(N, q, D, ne) {
3810
- const W = document.createElementNS(F, "line");
3811
- W.setAttribute("x1", N), W.setAttribute("y1", q), W.setAttribute("x2", D), W.setAttribute("y2", ne), B.appendChild(W);
3820
+ }), L.appendChild(C);
3821
+ }
3822
+ const N = T;
3823
+ if (N && he(N)) {
3824
+ let k = function(B, q) {
3825
+ const U = document.createElementNS(D, "circle");
3826
+ U.setAttribute("cx", B), U.setAttribute("cy", q), U.setAttribute("r", "3"), z.appendChild(U);
3827
+ }, O = function(B, q, U, ne) {
3828
+ const W = document.createElementNS(D, "line");
3829
+ W.setAttribute("x1", B), W.setAttribute("y1", q), W.setAttribute("x2", U), W.setAttribute("y2", ne), z.appendChild(W);
3812
3830
  };
3813
- const E = document.createElement("button");
3814
- E.className = "gengage-chat-product-details-share gds-btn gds-btn-ghost gds-icon-btn", E.type = "button";
3831
+ const C = document.createElement("button");
3832
+ C.className = "gengage-chat-product-details-share gds-btn gds-btn-ghost gds-icon-btn", C.type = "button";
3815
3833
  const R = e.i18n?.shareButton ?? "Share";
3816
- E.title = R, E.setAttribute("aria-label", R);
3817
- const F = "http://www.w3.org/2000/svg", B = document.createElementNS(F, "svg");
3818
- 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 () => {
3834
+ C.title = R, C.setAttribute("aria-label", R);
3835
+ const D = "http://www.w3.org/2000/svg", z = document.createElementNS(D, "svg");
3836
+ z.setAttribute("width", "18"), z.setAttribute("height", "18"), z.setAttribute("viewBox", "0 0 24 24"), z.setAttribute("fill", "none"), z.setAttribute("stroke", "currentColor"), z.setAttribute("stroke-width", "2"), z.setAttribute("stroke-linecap", "round"), z.setAttribute("stroke-linejoin", "round"), k("18", "5"), k("6", "12"), k("18", "19"), O("8.59", "13.51", "15.42", "17.49"), O("15.41", "6.51", "8.59", "10.49"), C.appendChild(z), C.addEventListener("click", async () => {
3819
3837
  try {
3820
3838
  navigator.share ? await navigator.share({
3821
3839
  title: r ?? "",
3822
- url: z
3823
- }) : navigator.clipboard && (await navigator.clipboard.writeText(z), E.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => E.classList.remove("gengage-chat-product-details-share--copied"), 1500));
3840
+ url: N
3841
+ }) : navigator.clipboard && (await navigator.clipboard.writeText(N), C.classList.add("gengage-chat-product-details-share--copied"), setTimeout(() => C.classList.remove("gengage-chat-product-details-share--copied"), 1500));
3824
3842
  } catch {
3825
3843
  }
3826
- }), T.appendChild(E);
3844
+ }), L.appendChild(C);
3827
3845
  }
3828
- T.childElementCount > 0 && y.appendChild(T), a.appendChild(y);
3829
- const O = Zr(n), X = Xr(n);
3830
- return (O || X) && a.appendChild(gi(O, X, e)), a;
3846
+ L.childElementCount > 0 && y.appendChild(L), a.appendChild(y);
3847
+ const F = Zr(n), X = Xr(n);
3848
+ return (F || X) && a.appendChild(gi(F, X, e)), a;
3831
3849
  }
3832
3850
  function ht(t) {
3833
3851
  if (t.nodeType === Node.TEXT_NODE) return document.createTextNode(t.textContent ?? "");
@@ -3886,15 +3904,15 @@ function gi(t, e, a) {
3886
3904
  c.className = "gengage-chat-product-detail-tab-panel", t && (c.style.display = "none");
3887
3905
  const l = document.createElement("table");
3888
3906
  l.className = "gengage-chat-product-specs-table";
3889
- const d = Array.isArray(e) ? e : Object.entries(e).map(([p, h]) => ({
3890
- key: p,
3907
+ const p = Array.isArray(e) ? e : Object.entries(e).map(([g, h]) => ({
3908
+ key: g,
3891
3909
  value: h
3892
3910
  }));
3893
- for (const p of d) {
3911
+ for (const g of p) {
3894
3912
  const h = document.createElement("tr"), m = document.createElement("td");
3895
- m.className = "gengage-chat-product-specs-key", m.textContent = p.key;
3913
+ m.className = "gengage-chat-product-specs-key", m.textContent = g.key;
3896
3914
  const x = document.createElement("td");
3897
- x.className = "gengage-chat-product-specs-value", x.textContent = p.value, h.appendChild(m), h.appendChild(x), l.appendChild(h);
3915
+ x.className = "gengage-chat-product-specs-value", x.textContent = g.value, h.appendChild(m), h.appendChild(x), l.appendChild(h);
3898
3916
  }
3899
3917
  c.appendChild(l), i.push(c);
3900
3918
  }
@@ -3903,8 +3921,8 @@ function gi(t, e, a) {
3903
3921
  s.addEventListener("click", () => {
3904
3922
  o.forEach((l) => {
3905
3923
  l.classList.remove("gengage-chat-product-detail-tab--active", "is-active"), l.setAttribute("aria-selected", "false");
3906
- }), s.classList.add("gengage-chat-product-detail-tab--active", "is-active"), s.setAttribute("aria-selected", "true"), i.forEach((l, d) => {
3907
- l.style.display = d === c ? "" : "none";
3924
+ }), s.classList.add("gengage-chat-product-detail-tab--active", "is-active"), s.setAttribute("aria-selected", "true"), i.forEach((l, p) => {
3925
+ l.style.display = p === c ? "" : "none";
3908
3926
  });
3909
3927
  });
3910
3928
  }), n.appendChild(r);
@@ -3963,10 +3981,10 @@ function mi(t, e, a, n) {
3963
3981
  r.className = "gengage-chat-product-grid-wrapper";
3964
3982
  const i = ft(t), o = i.isConsulting, s = t.children ?? [], c = document.createElement("div");
3965
3983
  c.className = "gengage-chat-product-grid";
3966
- const l = Array.isArray(t.props?.productSections) ? t.props.productSections.map((g) => ({
3967
- title: typeof g.title == "string" ? g.title : "",
3968
- children: Array.isArray(g.children) ? g.children.filter((_) => typeof _ == "string" && !!e.elements[_]) : []
3969
- })).filter((g) => g.children.length > 0) : [], d = l.length > 1, p = !d && l.length === 1 && l[0]?.title ? l[0].title : "", h = n?.panelProductListHeading ?? (p || void 0), m = !o && !d && s.length > 1 && n?.onSortChange, x = (g) => {
3984
+ const l = Array.isArray(t.props?.productSections) ? t.props.productSections.map((d) => ({
3985
+ title: typeof d.title == "string" ? d.title : "",
3986
+ children: Array.isArray(d.children) ? d.children.filter((_) => typeof _ == "string" && !!e.elements[_]) : []
3987
+ })).filter((d) => d.children.length > 0) : [], p = l.length > 1, g = !p && l.length === 1 && l[0]?.title ? l[0].title : "", h = n?.panelProductListHeading ?? (g || void 0), m = !o && !p && s.length > 1 && n?.onSortChange, x = (d) => {
3970
3988
  if (!n?.onToggleComparisonSku) return;
3971
3989
  const _ = document.createElement("button");
3972
3990
  _.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");
@@ -3977,10 +3995,10 @@ function mi(t, e, a, n) {
3977
3995
  const A = n.i18n?.compareSelected ?? "Compare";
3978
3996
  b.textContent = A, _.setAttribute("aria-label", A), _.title = A, _.appendChild(y), _.appendChild(b), _.addEventListener("click", () => {
3979
3997
  n.onToggleComparisonSku?.("");
3980
- }), g.appendChild(_);
3981
- }, v = (g, _ = s.length) => {
3998
+ }), d.appendChild(_);
3999
+ }, v = (d, _ = s.length) => {
3982
4000
  const y = t.props?.endOfList;
3983
- if (o || !(d ? y === !1 : y !== !0) || _ === 0) return;
4001
+ if (o || !(p ? y === !1 : y !== !0) || _ === 0) return;
3984
4002
  const b = n?.i18n?.viewMoreLabel ?? "Show More", A = document.createElement("button");
3985
4003
  A.className = "gengage-chat-product-grid-view-more", A.type = "button", A.textContent = b, A.addEventListener("click", () => {
3986
4004
  n?.onAction({
@@ -3988,14 +4006,14 @@ function mi(t, e, a, n) {
3988
4006
  type: "moreProductList",
3989
4007
  payload: {}
3990
4008
  });
3991
- }), g.appendChild(A);
4009
+ }), d.appendChild(A);
3992
4010
  }, u = () => {
3993
- const g = n?.isMobile ?? Ve();
3994
- n?.comparisonSelectMode && n.comparisonSelectedSkus && !g && r.appendChild(la(n.comparisonSelectedSkus, n));
4011
+ const d = n?.isMobile ?? Ve();
4012
+ n?.comparisonSelectMode && n.comparisonSelectedSkus && !d && r.appendChild(la(n.comparisonSelectedSkus, n));
3995
4013
  };
3996
4014
  if (m) {
3997
- const g = document.createElement("div");
3998
- g.className = "gengage-chat-product-sort-toolbar", g.setAttribute("role", "toolbar"), g.setAttribute("aria-label", n.i18n?.sortToolbarAriaLabel ?? "Sort products");
4015
+ const d = document.createElement("div");
4016
+ d.className = "gengage-chat-product-sort-toolbar", d.setAttribute("role", "toolbar"), d.setAttribute("aria-label", n.i18n?.sortToolbarAriaLabel ?? "Sort products");
3999
4017
  let _ = n.productSort ?? { type: "related" };
4000
4018
  const y = [
4001
4019
  {
@@ -4023,106 +4041,106 @@ function mi(t, e, a, n) {
4023
4041
  b.className = "gengage-chat-product-sort-dropdown";
4024
4042
  const A = document.createElement("button");
4025
4043
  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");
4026
- const T = n.i18n?.sortToolbarAriaLabel ?? "Sort products", k = document.createElement("span");
4027
- k.className = "gengage-chat-product-sort-trigger-icon";
4028
- const L = document.createElement("span");
4029
- L.className = "gengage-chat-product-sort-trigger-label";
4030
- const z = (N) => {
4031
- const q = y.find((D) => Ft(D.sortState, N)) ?? y[0];
4032
- 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;
4044
+ const L = n.i18n?.sortToolbarAriaLabel ?? "Sort products", E = document.createElement("span");
4045
+ E.className = "gengage-chat-product-sort-trigger-icon";
4046
+ const T = document.createElement("span");
4047
+ T.className = "gengage-chat-product-sort-trigger-label";
4048
+ const N = (B) => {
4049
+ const q = y.find((U) => Ft(U.sortState, B)) ?? y[0];
4050
+ T.textContent = q.label, E.innerHTML = Ht(q.icon), b.dataset.sortIcon = q.icon, A.setAttribute("aria-label", `${L}: ${q.label}`), A.title = q.label;
4033
4051
  };
4034
- z(_);
4035
- const O = document.createElement("span");
4036
- O.className = "gengage-chat-product-sort-trigger-chevron", O.innerHTML = di(), A.appendChild(k), A.appendChild(L), A.appendChild(O);
4052
+ N(_);
4053
+ const F = document.createElement("span");
4054
+ F.className = "gengage-chat-product-sort-trigger-chevron", F.innerHTML = di(), A.appendChild(E), A.appendChild(T), A.appendChild(F);
4037
4055
  const X = document.createElement("div");
4038
- X.className = "gengage-chat-product-sort-menu gds-menu", X.hidden = !0, X.setAttribute("role", "listbox"), X.setAttribute("aria-label", T);
4039
- const E = g.ownerDocument;
4056
+ X.className = "gengage-chat-product-sort-menu gds-menu", X.hidden = !0, X.setAttribute("role", "listbox"), X.setAttribute("aria-label", L);
4057
+ const C = d.ownerDocument;
4040
4058
  let R = null;
4041
- const F = () => {
4059
+ const D = () => {
4042
4060
  X.hidden = !0, b.classList.remove("gengage-chat-product-sort-dropdown--open"), A.setAttribute("aria-expanded", "false"), R?.abort(), R = null;
4043
- }, B = (N) => {
4044
- b.classList.contains("gengage-chat-product-sort-dropdown--open") && (b.contains(N.target) || F());
4045
- }, C = (N) => {
4046
- N.key === "Escape" && (N.preventDefault(), F());
4047
- }, U = () => {
4061
+ }, z = (B) => {
4062
+ b.classList.contains("gengage-chat-product-sort-dropdown--open") && (b.contains(B.target) || D());
4063
+ }, k = (B) => {
4064
+ B.key === "Escape" && (B.preventDefault(), D());
4065
+ }, O = () => {
4048
4066
  X.hidden = !1, b.classList.add("gengage-chat-product-sort-dropdown--open"), A.setAttribute("aria-expanded", "true"), R = new AbortController();
4049
- const { signal: N } = R;
4050
- E.addEventListener("click", B, { signal: N }), E.addEventListener("keydown", C, {
4067
+ const { signal: B } = R;
4068
+ C.addEventListener("click", z, { signal: B }), C.addEventListener("keydown", k, {
4051
4069
  capture: !0,
4052
- signal: N
4070
+ signal: B
4053
4071
  });
4054
4072
  };
4055
- A.addEventListener("click", (N) => {
4056
- N.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? F() : U();
4073
+ A.addEventListener("click", (B) => {
4074
+ B.stopPropagation(), b.classList.contains("gengage-chat-product-sort-dropdown--open") ? D() : O();
4057
4075
  });
4058
- for (const N of y) {
4076
+ for (const B of y) {
4059
4077
  const q = document.createElement("button");
4060
4078
  q.type = "button", q.className = "gengage-chat-product-sort-option gds-menu-option", q.setAttribute("role", "option");
4061
- const D = Ft(_, N.sortState);
4062
- q.setAttribute("aria-selected", D ? "true" : "false"), D && q.classList.add("gengage-chat-product-sort-option--active", "gds-menu-option-active");
4063
- const ne = N.sortState.type === "related" ? "related" : `price-${N.sortState.direction ?? ""}`;
4079
+ const U = Ft(_, B.sortState);
4080
+ q.setAttribute("aria-selected", U ? "true" : "false"), U && q.classList.add("gengage-chat-product-sort-option--active", "gds-menu-option-active");
4081
+ const ne = B.sortState.type === "related" ? "related" : `price-${B.sortState.direction ?? ""}`;
4064
4082
  q.dataset.sortKey = ne;
4065
4083
  const W = document.createElement("span");
4066
- W.className = "gengage-chat-product-sort-option-icon", W.innerHTML = Ht(N.icon);
4084
+ W.className = "gengage-chat-product-sort-option-icon", W.innerHTML = Ht(B.icon);
4067
4085
  const K = document.createElement("span");
4068
- K.className = "gengage-chat-product-sort-option-label", K.textContent = N.label;
4086
+ K.className = "gengage-chat-product-sort-option-label", K.textContent = B.label;
4069
4087
  const f = document.createElement("span");
4070
- 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", () => {
4071
- _ = N.sortState, n.onSortChange?.(N.sortState), ui(c, s, e, N.sortState), X.querySelectorAll(".gengage-chat-product-sort-option").forEach((S) => {
4088
+ f.className = "gengage-chat-product-sort-option-check", f.innerHTML = pi(), f.setAttribute("aria-hidden", "true"), U || f.classList.add("gengage-chat-product-sort-option-check--hidden"), q.appendChild(W), q.appendChild(K), q.appendChild(f), q.addEventListener("click", () => {
4089
+ _ = B.sortState, n.onSortChange?.(B.sortState), ui(c, s, e, B.sortState), X.querySelectorAll(".gengage-chat-product-sort-option").forEach((S) => {
4072
4090
  const P = S, $ = P.dataset.sortKey === ne;
4073
4091
  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", !$);
4074
- }), z(N.sortState), F();
4092
+ }), N(B.sortState), D();
4075
4093
  }), X.appendChild(q);
4076
4094
  }
4077
- if (b.appendChild(A), b.appendChild(X), g.appendChild(b), x(g), h) {
4078
- g.classList.add("gengage-chat-product-sort-toolbar--inline");
4079
- const N = document.createElement("div");
4080
- N.className = "gengage-chat-product-grid-head";
4095
+ if (b.appendChild(A), b.appendChild(X), d.appendChild(b), x(d), h) {
4096
+ d.classList.add("gengage-chat-product-sort-toolbar--inline");
4097
+ const B = document.createElement("div");
4098
+ B.className = "gengage-chat-product-grid-head";
4081
4099
  const q = document.createElement("span");
4082
- q.className = "gengage-chat-product-grid-head-title", q.textContent = h, N.appendChild(q);
4083
- const D = document.createElement("div");
4084
- D.className = "gengage-chat-product-grid-head-actions", D.appendChild(g), N.appendChild(D), r.appendChild(N);
4085
- } else r.appendChild(g);
4100
+ q.className = "gengage-chat-product-grid-head-title", q.textContent = h, B.appendChild(q);
4101
+ const U = document.createElement("div");
4102
+ U.className = "gengage-chat-product-grid-head-actions", U.appendChild(d), B.appendChild(U), r.appendChild(B);
4103
+ } else r.appendChild(d);
4086
4104
  } else if (h) {
4087
- const g = document.createElement("div");
4088
- g.className = "gengage-chat-product-grid-head";
4105
+ const d = document.createElement("div");
4106
+ d.className = "gengage-chat-product-grid-head";
4089
4107
  const _ = document.createElement("span");
4090
- _.className = "gengage-chat-product-grid-head-title", _.textContent = h, g.appendChild(_), r.appendChild(g);
4108
+ _.className = "gengage-chat-product-grid-head-title", _.textContent = h, d.appendChild(_), r.appendChild(d);
4091
4109
  }
4092
- if (d && !o) {
4110
+ if (p && !o) {
4093
4111
  if (r.classList.add("gengage-chat-product-grid-wrapper--grouped"), n?.onToggleComparisonSku) {
4094
4112
  const b = document.createElement("div");
4095
4113
  b.className = "gengage-chat-product-sort-toolbar gengage-chat-product-sort-toolbar--compare-only", b.setAttribute("role", "toolbar"), b.setAttribute("aria-label", n.i18n?.compareSelected ?? "Compare"), x(b), r.appendChild(b);
4096
4114
  }
4097
- const g = document.createElement("div");
4098
- g.className = "gengage-chat-product-grid-sections", g.setAttribute("role", "list");
4115
+ const d = document.createElement("div");
4116
+ d.className = "gengage-chat-product-grid-sections", d.setAttribute("role", "list");
4099
4117
  const _ = t.props?.rankingState;
4100
4118
  let y = 0;
4101
4119
  for (const b of l) {
4102
4120
  y += b.children.length;
4103
- const A = fi(b.children.length, n), T = document.createElement("section");
4104
- T.className = "gengage-chat-product-grid-section", T.setAttribute("role", "listitem");
4105
- const k = document.createElement("div");
4106
- if (k.className = "gengage-chat-product-grid-section-head", b.title) {
4107
- const O = document.createElement("h3");
4108
- O.className = "gengage-chat-product-grid-section-title", O.textContent = b.title, k.appendChild(O);
4121
+ const A = fi(b.children.length, n), L = document.createElement("section");
4122
+ L.className = "gengage-chat-product-grid-section", L.setAttribute("role", "listitem");
4123
+ const E = document.createElement("div");
4124
+ if (E.className = "gengage-chat-product-grid-section-head", b.title) {
4125
+ const F = document.createElement("h3");
4126
+ F.className = "gengage-chat-product-grid-section-title", F.textContent = b.title, E.appendChild(F);
4109
4127
  }
4110
- const L = document.createElement("span");
4111
- L.className = "gengage-chat-product-grid-section-count", L.textContent = A, k.appendChild(L), T.appendChild(k);
4112
- const z = document.createElement("div");
4113
- z.className = "gengage-chat-product-grid gengage-chat-product-grid--section";
4114
- for (const O of b.children) {
4115
- const X = a(O);
4116
- X && (X.dataset.elementId = O, z.appendChild(X));
4128
+ const T = document.createElement("span");
4129
+ T.className = "gengage-chat-product-grid-section-count", T.textContent = A, E.appendChild(T), L.appendChild(E);
4130
+ const N = document.createElement("div");
4131
+ N.className = "gengage-chat-product-grid gengage-chat-product-grid--section";
4132
+ for (const F of b.children) {
4133
+ const X = a(F);
4134
+ X && (X.dataset.elementId = F, N.appendChild(X));
4117
4135
  }
4118
- (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);
4136
+ (n?.isMobile ?? Ve()) && N.classList.add("gengage-chat-product-grid--mobile"), _ === "pending" && (N.classList.add("gengage-chat-product-grid--pending"), N.inert = !0, N.setAttribute("aria-busy", "true")), L.appendChild(N), d.appendChild(L);
4119
4137
  }
4120
- return r.appendChild(g), v(r, y), u(), r;
4138
+ return r.appendChild(d), v(r, y), u(), r;
4121
4139
  }
4122
4140
  if (o) Ci(r, c, i, n);
4123
4141
  else {
4124
- const g = fa(s, e, n?.productSort);
4125
- for (const _ of g) {
4142
+ const d = fa(s, e, n?.productSort);
4143
+ for (const _ of d) {
4126
4144
  if (!e.elements[_]) continue;
4127
4145
  const y = a(_);
4128
4146
  y && (y.dataset.elementId = _, c.appendChild(y));
@@ -4145,7 +4163,7 @@ function bi(t, e, a) {
4145
4163
  return n(a.find((r) => r.sku === t));
4146
4164
  }
4147
4165
  function vi(t, e) {
4148
- const a = t.props ?? {}, n = a.keyDifferencesHtml, r = a.recommended, i = a.products ?? [], o = a.attributes ?? [], s = a.highlights ?? [], c = a.specialCases, l = a.recommendedText, d = a.winnerHits, p = a.productActions;
4166
+ const a = t.props ?? {}, n = a.keyDifferencesHtml, r = a.recommended, i = a.products ?? [], o = a.attributes ?? [], s = a.highlights ?? [], c = a.specialCases, l = a.recommendedText, p = a.winnerHits, g = a.productActions;
4149
4167
  if (!r) return document.createElement("div");
4150
4168
  const h = {
4151
4169
  recommended: r,
@@ -4164,7 +4182,7 @@ function vi(t, e) {
4164
4182
  },
4165
4183
  pricing: e.pricing
4166
4184
  };
4167
- l !== void 0 && (h.recommendedText = l), d !== void 0 && (h.winnerHits = d), p !== void 0 && (h.productActions = p), n !== void 0 && (h.keyDifferencesHtml = n), e.i18n && (h.i18n = {
4185
+ l !== void 0 && (h.recommendedText = l), p !== void 0 && (h.winnerHits = p), g !== void 0 && (h.productActions = g), n !== void 0 && (h.keyDifferencesHtml = n), e.i18n && (h.i18n = {
4168
4186
  comparisonHeading: e.i18n.panelTitleComparisonResults,
4169
4187
  recommendedChoiceLabel: e.i18n.recommendedChoiceLabel,
4170
4188
  highlightsLabel: e.i18n.highlightsLabel,
@@ -4227,9 +4245,9 @@ function Dt(t, e, a, n) {
4227
4245
  if (c.className = "gengage-chat-consulting-loading-panel-copy", c.textContent = a === "loading" ? i.consultingStyleLoadingDescription : i.consultingStyleUnavailableDescription, o.appendChild(c), a === "loading") {
4228
4246
  const l = document.createElement("div");
4229
4247
  l.className = "gengage-chat-consulting-loading-grid";
4230
- for (let d = 0; d < 3; d += 1) {
4231
- const p = document.createElement("div");
4232
- p.className = "gengage-chat-consulting-loading-card", l.appendChild(p);
4248
+ for (let p = 0; p < 3; p += 1) {
4249
+ const g = document.createElement("div");
4250
+ g.className = "gengage-chat-consulting-loading-card", l.appendChild(g);
4233
4251
  }
4234
4252
  o.appendChild(l);
4235
4253
  }
@@ -4256,64 +4274,64 @@ function vt(t, e) {
4256
4274
  const c = Array.isArray(a.product_list) ? a.product_list : [], l = Array.isArray(a.recommendation_groups) ? a.recommendation_groups : [];
4257
4275
  if (l.length > 0) {
4258
4276
  n.classList.add("gengage-chat-product-grid--consulting-groups");
4259
- const d = /* @__PURE__ */ new Map();
4277
+ const p = /* @__PURE__ */ new Map();
4260
4278
  for (const u of c) {
4261
- const g = typeof u?.sku == "string" ? u.sku : void 0;
4262
- g && d.set(g, u);
4279
+ const d = typeof u?.sku == "string" ? u.sku : void 0;
4280
+ d && p.set(d, u);
4263
4281
  }
4264
- const p = (u, g, _, y) => {
4265
- if (g.length === 0) return;
4282
+ const g = (u, d, _, y) => {
4283
+ if (d.length === 0) return;
4266
4284
  const b = document.createElement("section");
4267
4285
  b.className = "gengage-chat-consulting-group";
4268
4286
  const A = document.createElement("div");
4269
4287
  A.className = "gengage-chat-consulting-group-header";
4270
- const T = document.createElement("h4");
4271
- if (T.className = "gengage-chat-consulting-group-label", T.textContent = `${u} (${g.length})`, A.appendChild(T), typeof y == "string" && y.trim().length > 0) {
4272
- const L = document.createElement("p");
4273
- L.className = "gengage-chat-consulting-group-reason", L.textContent = y, A.appendChild(L);
4288
+ const L = document.createElement("h4");
4289
+ if (L.className = "gengage-chat-consulting-group-label", L.textContent = `${u} (${d.length})`, A.appendChild(L), typeof y == "string" && y.trim().length > 0) {
4290
+ const T = document.createElement("p");
4291
+ T.className = "gengage-chat-consulting-group-reason", T.textContent = y, A.appendChild(T);
4274
4292
  }
4275
4293
  b.appendChild(A);
4276
- const k = document.createElement("div");
4277
- 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))));
4278
- for (const L of g) {
4279
- const z = pt({
4294
+ const E = document.createElement("div");
4295
+ E.className = "gengage-chat-product-grid gengage-chat-consulting-group-grid", _ && E.classList.add("gengage-chat-consulting-group-grid--single-group"), E.style.setProperty("--consulting-group-columns", String(Math.max(1, Math.min(4, d.length))));
4296
+ for (const T of d) {
4297
+ const N = pt({
4280
4298
  type: "ProductCard",
4281
- props: { product: L }
4299
+ props: { product: T }
4282
4300
  }, r ?? { onAction: () => {
4283
4301
  } });
4284
- k.appendChild(z);
4302
+ E.appendChild(N);
4285
4303
  }
4286
- b.appendChild(k), n.appendChild(b);
4304
+ b.appendChild(E), n.appendChild(b);
4287
4305
  }, h = /* @__PURE__ */ new Set(), m = [];
4288
4306
  for (const u of l) {
4289
- 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);
4290
- if (g.length === 0) continue;
4307
+ const d = (Array.isArray(u.skus) ? u.skus.filter((b) => typeof b == "string" && b.trim().length > 0) : []).map((b) => (h.add(b), p.get(b))).filter((b) => !!b);
4308
+ if (d.length === 0) continue;
4291
4309
  const _ = typeof u.label == "string" && u.label.trim().length > 0 ? u.label : i.consultingFallbackGroupLabel, y = typeof u.reason == "string" ? u.reason : void 0;
4292
4310
  m.push({
4293
4311
  labelText: _,
4294
- products: g,
4312
+ products: d,
4295
4313
  ...y !== void 0 ? { reasonText: y } : {}
4296
4314
  });
4297
4315
  }
4298
4316
  const x = c.filter((u) => {
4299
- const g = typeof u?.sku == "string" ? u.sku : "";
4300
- return g.length > 0 && !h.has(g);
4317
+ const d = typeof u?.sku == "string" ? u.sku : "";
4318
+ return d.length > 0 && !h.has(d);
4301
4319
  });
4302
4320
  x.length > 0 && m.push({
4303
4321
  labelText: i.consultingOtherCompatibleProductsLabel,
4304
4322
  products: x
4305
4323
  });
4306
4324
  const v = m.length === 1;
4307
- for (const u of m) p(u.labelText, u.products, v, u.reasonText);
4325
+ for (const u of m) g(u.labelText, u.products, v, u.reasonText);
4308
4326
  return;
4309
4327
  }
4310
- for (const d of c) {
4311
- const p = pt({
4328
+ for (const p of c) {
4329
+ const g = pt({
4312
4330
  type: "ProductCard",
4313
- props: { product: d }
4331
+ props: { product: p }
4314
4332
  }, r ?? { onAction: () => {
4315
4333
  } });
4316
- n.appendChild(p);
4334
+ n.appendChild(g);
4317
4335
  }
4318
4336
  }
4319
4337
  function mt(t, e, a, n) {
@@ -4323,13 +4341,13 @@ function mt(t, e, a, n) {
4323
4341
  s ? s.innerHTML = "" : (s = document.createElement("div"), s.className = "gengage-chat-consulting-style-media", t.appendChild(s));
4324
4342
  const c = yi(e.image_url);
4325
4343
  if (c && he(c)) {
4326
- const d = document.createElement("img");
4327
- 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);
4344
+ const p = document.createElement("img");
4345
+ p.className = "gengage-chat-consulting-style-image", p.draggable = !1, de(p, "src", c), p.alt = We(e, a + 1, n), p.loading = "lazy", xe(p), s.appendChild(p);
4328
4346
  }
4329
4347
  const l = document.createElement("span");
4330
4348
  if (l.className = "gengage-chat-consulting-style-caption", l.textContent = We(e, a + 1, n), s.appendChild(l), r === "loading" || r !== "ready") {
4331
- const d = document.createElement("span");
4332
- d.className = "gengage-chat-consulting-style-status", d.textContent = r === "loading" ? i : o, s.appendChild(d);
4349
+ const p = document.createElement("span");
4350
+ p.className = "gengage-chat-consulting-style-status", p.textContent = r === "loading" ? i : o, s.appendChild(p);
4333
4351
  }
4334
4352
  }
4335
4353
  function xa(t, e, a, n) {
@@ -4354,9 +4372,9 @@ function wi(t, e, a, n) {
4354
4372
  const c = document.createElement("div");
4355
4373
  c.className = "gengage-chat-consulting-style-picker-title", c.textContent = va(r).replace("{count}", String(a.length)), o.appendChild(c);
4356
4374
  const l = document.createElement("div");
4357
- l.className = "gengage-chat-consulting-style-grid", o.appendChild(l), a.forEach((d, p) => {
4375
+ l.className = "gengage-chat-consulting-style-grid", o.appendChild(l), a.forEach((p, g) => {
4358
4376
  const h = document.createElement("button");
4359
- h.type = "button", h.className = "gengage-chat-consulting-style-btn gds-card", p === i && h.classList.add("gengage-chat-consulting-style-btn--active"), mt(h, d, p, r), xa(h, o, l, p), l.appendChild(h);
4377
+ h.type = "button", h.className = "gengage-chat-consulting-style-btn gds-card", g === i && h.classList.add("gengage-chat-consulting-style-btn--active"), mt(h, p, g, r), xa(h, o, l, g), l.appendChild(h);
4360
4378
  }), t.appendChild(o), vt(s, i);
4361
4379
  }
4362
4380
  function _i(t, e, a) {
@@ -4381,14 +4399,14 @@ function _i(t, e, a) {
4381
4399
  const c = n.querySelector(".gengage-chat-consulting-style-picker-title");
4382
4400
  c && (c.textContent = va(o).replace("{count}", String(e.length)));
4383
4401
  const l = s;
4384
- let d = l.selectedIndex;
4385
- d >= e.length && (d = Math.max(0, e.length - 1)), d < 0 && (d = 0), e.length > 0 && tt(e[d] ?? {}) === "loading" && (d = ut(e)), l.selectedIndex = d;
4386
- const p = [...i.querySelectorAll(".gengage-chat-consulting-style-btn")];
4387
- if (p.length === 0) return !1;
4402
+ let p = l.selectedIndex;
4403
+ p >= e.length && (p = Math.max(0, e.length - 1)), p < 0 && (p = 0), e.length > 0 && tt(e[p] ?? {}) === "loading" && (p = ut(e)), l.selectedIndex = p;
4404
+ const g = [...i.querySelectorAll(".gengage-chat-consulting-style-btn")];
4405
+ if (g.length === 0) return !1;
4388
4406
  for (let h = 0; h < e.length; h += 1) {
4389
4407
  const m = e[h];
4390
- let x = p[h];
4391
- x ? mt(x, m, h, o) : (x = document.createElement("button"), x.type = "button", x.className = "gengage-chat-consulting-style-btn gds-card", mt(x, m, h, o), xa(x, n, i, h), i.appendChild(x), p[h] = x);
4408
+ let x = g[h];
4409
+ x ? mt(x, m, h, o) : (x = document.createElement("button"), x.type = "button", x.className = "gengage-chat-consulting-style-btn gds-card", mt(x, m, h, o), xa(x, n, i, h), i.appendChild(x), g[h] = x);
4392
4410
  }
4393
4411
  for (; i.querySelectorAll(".gengage-chat-consulting-style-btn").length > e.length; ) i.lastElementChild?.remove();
4394
4412
  return i.querySelectorAll(".gengage-chat-consulting-style-btn").forEach((h, m) => {
@@ -4751,11 +4769,11 @@ function Ai() {
4751
4769
  </div>`.trim();
4752
4770
  }
4753
4771
  function Ii(t, e, a) {
4754
- const { primaryColor: n = "#6366f1", backgroundColor: r = "#ffffff", textColor: i = "#111827", placeholderColor: o = "#9ca3af", iconColor: s = "#6b7280", borderColor: c = "#e5e7eb", borderRadius: l = "999px", height: d = "56px", maxWidth: p = "680px", fontFamily: h = "inherit", placeholders: m = [
4772
+ const { primaryColor: n = "#6366f1", backgroundColor: r = "#ffffff", textColor: i = "#111827", placeholderColor: o = "#9ca3af", iconColor: s = "#6b7280", borderColor: c = "#e5e7eb", borderRadius: l = "999px", height: p = "56px", maxWidth: g = "680px", fontFamily: h = "inherit", placeholders: m = [
4755
4773
  "Ürün ara",
4756
4774
  "Karşılaştır",
4757
4775
  "Soru sor"
4758
- ], 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;
4776
+ ], placeholderInterval: x = 2e3, voiceLang: v = "tr-TR", showBorderAnimation: u = !0, sendAriaLabel: d = "Gönder", micAriaLabel: _ = "Sesli giriş", cancelAriaLabel: y = "Ses kaydını durdur", openChatAriaLabel: b = "Chat'i aç" } = t;
4759
4777
  if (!a.getElementById(Ut)) {
4760
4778
  const V = document.createElement("style");
4761
4779
  V.id = Ut, V.textContent = Ti({
@@ -4766,26 +4784,26 @@ function Ii(t, e, a) {
4766
4784
  iconColor: s,
4767
4785
  borderColor: c,
4768
4786
  borderRadius: l,
4769
- height: d,
4770
- maxWidth: p,
4787
+ height: p,
4788
+ maxWidth: g,
4771
4789
  fontFamily: h
4772
4790
  }), a.appendChild(V);
4773
4791
  }
4774
4792
  const A = document.createElement("div");
4775
4793
  A.className = "gengage-fl", A.dataset.gengagePart = "floating-launcher", A.innerHTML = Ai();
4776
- 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");
4777
- T.placeholder = m[0] ?? "", O.setAttribute("aria-label", g), X.setAttribute("aria-label", _), R.setAttribute("aria-label", y), E.setAttribute("aria-label", b);
4778
- let C = !1, U = !1, N = "", q = !1, D = null, ne = 0, W = null, K = null, f = null, S = null, P = null, $ = 0;
4794
+ const L = A.querySelector(".gengage-fl-input"), E = A.querySelector(".gengage-fl-transcript"), T = A.querySelector(".gengage-fl-transcript-final"), N = A.querySelector(".gengage-fl-transcript-interim"), F = A.querySelector(".gengage-fl-btn-send"), X = A.querySelector(".gengage-fl-btn-mic"), C = A.querySelector(".gengage-fl-btn-open-chat"), R = A.querySelector(".gengage-fl-cancel"), D = A.querySelector(".gengage-fl-wave"), z = A.querySelector(".gengage-fl-ring");
4795
+ L.placeholder = m[0] ?? "", F.setAttribute("aria-label", d), X.setAttribute("aria-label", _), R.setAttribute("aria-label", y), C.setAttribute("aria-label", b);
4796
+ let k = !1, O = !1, B = "", q = !1, U = null, ne = 0, W = null, K = null, f = null, S = null, P = null, $ = 0;
4779
4797
  function I() {
4780
- const V = T.value.trim().length > 0;
4781
- if (X.classList.toggle("is-recording", C), C) {
4782
- O.style.display = "flex", X.style.display = "flex", R.style.display = "flex", E.style.display = "none";
4798
+ const V = L.value.trim().length > 0;
4799
+ if (X.classList.toggle("is-recording", k), k) {
4800
+ F.style.display = "flex", X.style.display = "flex", R.style.display = "flex", C.style.display = "none";
4783
4801
  return;
4784
4802
  }
4785
- O.style.display = V ? "flex" : "none", X.style.display = V ? "none" : "flex", R.style.display = "none", E.style.display = !V && q ? "flex" : "none";
4803
+ F.style.display = V ? "flex" : "none", X.style.display = V ? "none" : "flex", R.style.display = "none", C.style.display = !V && q ? "flex" : "none";
4786
4804
  }
4787
4805
  function j() {
4788
- ne = (ne + 1) % m.length, T.placeholder = m[ne] ?? "", W = setTimeout(j, x);
4806
+ ne = (ne + 1) % m.length, L.placeholder = m[ne] ?? "", W = setTimeout(j, x);
4789
4807
  }
4790
4808
  function Q() {
4791
4809
  W !== null || m.length <= 1 || (W = setTimeout(j, x));
@@ -4794,9 +4812,9 @@ function Ii(t, e, a) {
4794
4812
  W !== null && (clearTimeout(W), W = null);
4795
4813
  }
4796
4814
  function se() {
4797
- C && (C = !1, w(), U = !1, oe(), u && H(), N = "", T.style.display = "", k.style.display = "none", L.textContent = "", z.textContent = "");
4798
- const V = T.value.trim();
4799
- V && (e.onSend(V), q || (q = !0)), T.value = "", N = "", I();
4815
+ k && (k = !1, w(), O = !1, oe(), u && H(), B = "", L.style.display = "", E.style.display = "none", T.textContent = "", N.textContent = "");
4816
+ const V = L.value.trim();
4817
+ V && (e.onSend(V), q || (q = !0)), L.value = "", B = "", I();
4800
4818
  }
4801
4819
  function re() {
4802
4820
  const V = window, G = V.SpeechRecognition ?? V.webkitSpeechRecognition;
@@ -4804,8 +4822,8 @@ function Ii(t, e, a) {
4804
4822
  console.warn("[FloatingLauncher] SpeechRecognition not supported.");
4805
4823
  return;
4806
4824
  }
4807
- 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) => {
4808
- if (!C) return;
4825
+ U || (U = new G(), U.continuous = !0, U.interimResults = !0, U.lang = v), k = !0, O = !0, B = "", L.value = "", L.style.display = "none", E.style.display = "flex", T.textContent = "", N.textContent = "", I(), ce(), u && M(), U.onresult = (J) => {
4826
+ if (!k) return;
4809
4827
  let ie = "", Z = "";
4810
4828
  for (let le = J.resultIndex; le < J.results.length; le++) {
4811
4829
  const Ae = J.results[le];
@@ -4813,28 +4831,28 @@ function Ii(t, e, a) {
4813
4831
  const Fe = Ae[0]?.transcript ?? "";
4814
4832
  Ae.isFinal ? Z += Fe : ie += Fe;
4815
4833
  }
4816
- N += Z, L.textContent = N, z.textContent = ie, T.value = `${N} ${ie}`.trim(), I();
4817
- }, D.onend = () => Y(), D.onerror = () => Y();
4834
+ B += Z, T.textContent = B, N.textContent = ie, L.value = `${B} ${ie}`.trim(), I();
4835
+ }, U.onend = () => Y(), U.onerror = () => Y();
4818
4836
  try {
4819
- D.start();
4837
+ U.start();
4820
4838
  } catch {
4821
4839
  Y();
4822
4840
  }
4823
4841
  }
4824
4842
  function w() {
4825
4843
  try {
4826
- D?.stop();
4844
+ U?.stop();
4827
4845
  } catch {
4828
4846
  }
4829
4847
  }
4830
4848
  function Y() {
4831
- 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());
4849
+ O && (O = !1, k = !1, oe(), u && H(), B.trim() && (L.value = B.trim()), L.style.display = "", E.style.display = "none", T.textContent = "", N.textContent = "", I());
4832
4850
  }
4833
4851
  async function ce() {
4834
- const V = ++$, G = Array.from(F.querySelectorAll("span"));
4852
+ const V = ++$, G = Array.from(D.querySelectorAll("span"));
4835
4853
  try {
4836
4854
  const J = await navigator.mediaDevices.getUserMedia({ audio: !0 });
4837
- if (!C || V !== $) {
4855
+ if (!k || V !== $) {
4838
4856
  J.getTracks().forEach((Ie) => Ie.stop());
4839
4857
  return;
4840
4858
  }
@@ -4843,14 +4861,14 @@ function Ii(t, e, a) {
4843
4861
  if (!Z)
4844
4862
  throw K = null, J.getTracks().forEach((Ie) => Ie.stop()), new Error("AudioContext not supported");
4845
4863
  const le = new Z();
4846
- if (!C || V !== $) {
4864
+ if (!k || V !== $) {
4847
4865
  J.getTracks().forEach((Ie) => Ie.stop()), le.close().catch(() => {
4848
4866
  });
4849
4867
  return;
4850
4868
  }
4851
4869
  f = le, S = le.createAnalyser(), S.fftSize = 256, le.createMediaStreamSource(J).connect(S);
4852
4870
  const Ae = new Uint8Array(S.frequencyBinCount), Fe = () => {
4853
- if (!C || V !== $ || !S) return;
4871
+ if (!k || V !== $ || !S) return;
4854
4872
  S.getByteFrequencyData(Ae);
4855
4873
  const Ie = Math.max(1, Math.floor(Ae.length / G.length));
4856
4874
  G.forEach((ka, Ca) => {
@@ -4859,37 +4877,37 @@ function Ii(t, e, a) {
4859
4877
  };
4860
4878
  Fe();
4861
4879
  } catch {
4862
- if (!C || V !== $) return;
4880
+ if (!k || V !== $) return;
4863
4881
  P !== null && (cancelAnimationFrame(P), P = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4864
- }), f = null), K && (K.getTracks().forEach((J) => J.stop()), K = null), F.classList.add("is-css-animated");
4882
+ }), f = null), K && (K.getTracks().forEach((J) => J.stop()), K = null), D.classList.add("is-css-animated");
4865
4883
  }
4866
4884
  }
4867
4885
  function oe() {
4868
- $ += 1, F.classList.remove("is-css-animated"), P !== null && (cancelAnimationFrame(P), P = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4869
- }), f = null), K && (K.getTracks().forEach((V) => V.stop()), K = null), Array.from(F.querySelectorAll("span")).forEach((V) => {
4886
+ $ += 1, D.classList.remove("is-css-animated"), P !== null && (cancelAnimationFrame(P), P = null), S && (S.disconnect(), S = null), f && (f.close().catch(() => {
4887
+ }), f = null), K && (K.getTracks().forEach((V) => V.stop()), K = null), Array.from(D.querySelectorAll("span")).forEach((V) => {
4870
4888
  V.style.height = "4px";
4871
4889
  });
4872
4890
  }
4873
4891
  function M() {
4874
- B.classList.add("is-active");
4892
+ z.classList.add("is-active");
4875
4893
  }
4876
4894
  function H() {
4877
- B.classList.remove("is-active");
4895
+ z.classList.remove("is-active");
4878
4896
  }
4879
- O.addEventListener("click", se), X.addEventListener("click", (V) => {
4880
- V.preventDefault(), V.stopPropagation(), C ? w() : re();
4897
+ F.addEventListener("click", se), X.addEventListener("click", (V) => {
4898
+ V.preventDefault(), V.stopPropagation(), k ? w() : re();
4881
4899
  }), R.addEventListener("click", () => {
4882
- C && (C = !1, w(), U = !1, oe(), u && H(), N = "", T.style.display = "", k.style.display = "none", L.textContent = "", z.textContent = "", I());
4883
- }), E.addEventListener("click", (V) => {
4900
+ k && (k = !1, w(), O = !1, oe(), u && H(), B = "", L.style.display = "", E.style.display = "none", T.textContent = "", N.textContent = "", I());
4901
+ }), C.addEventListener("click", (V) => {
4884
4902
  V.preventDefault(), V.stopPropagation(), e.onOpenChat();
4885
- }), T.addEventListener("input", I), T.addEventListener("keydown", (V) => {
4903
+ }), L.addEventListener("input", I), L.addEventListener("keydown", (V) => {
4886
4904
  V.key === "Enter" && se();
4887
4905
  }), I(), Q();
4888
4906
  function ee() {
4889
4907
  q = !0, I();
4890
4908
  }
4891
4909
  function pe() {
4892
- te(), oe(), H(), C && (C = !1, w()), D && (D.onresult = null, D.onend = null, D.onerror = null, D = null);
4910
+ te(), oe(), H(), k && (k = !1, w()), U && (U.onresult = null, U.onend = null, U.onerror = null, U = null);
4893
4911
  }
4894
4912
  return {
4895
4913
  container: A,
@@ -4949,7 +4967,7 @@ function zi(t) {
4949
4967
  };
4950
4968
  }
4951
4969
  function Ri(t) {
4952
- 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;";
4970
+ 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;", p = c.mobile.hideSpark ? "display:none;" : "display:inline-flex;", g = c.mobile.hideLogo ? "display:none !important;width:0 !important;height:0 !important;flex:0 0 0 !important;overflow:hidden !important;" : "display:inline-flex;";
4953
4971
  return `
4954
4972
  ${e}{
4955
4973
  display:flex;
@@ -5062,10 +5080,10 @@ ${s}{
5062
5080
  line-height:1.05;
5063
5081
  }
5064
5082
  ${a} ${n}{
5065
- ${p}
5083
+ ${g}
5066
5084
  }
5067
5085
  ${a} ${o}{
5068
- ${d}
5086
+ ${p}
5069
5087
  width:${c.mobile.sparkSize};
5070
5088
  height:${c.mobile.sparkSize};
5071
5089
  flex:0 0 ${c.mobile.sparkSize};
@@ -5081,9 +5099,9 @@ function Hi(t) {
5081
5099
  return new Promise((e) => window.setTimeout(e, t));
5082
5100
  }
5083
5101
  function Fi(t, e, a) {
5084
- 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}`;
5085
- let X = !1, E = !1, R = null, F = null, B = null, C = null;
5086
- const U = () => {
5102
+ const { hostSelector: n, rowClassName: r = "gengage-inline-launcher-row", siblingSelector: i, siblingPlacement: o = "before", rowPlacement: s = "end", title: c = "Ask", iconUrl: l, primaryColor: p = "#6366f1", textColor: g = "#222222", fontFamily: h = "inherit", borderRadius: m = "3px", showSparkIcon: x = !0, desktopMinWidth: v = 0, enableOnMobile: u = !1, disabledPageTypes: d = ["pdp"], hideFloatingLauncher: _ = !0, mountPollFrames: y = 90, debounceMs: b = 90, buttonId: A = Ni } = t, L = t.ariaLabel ?? c, E = t.siblingRestoreParentSelector ?? n, T = u && v > 0 ? v : 576, N = zi(t.size), F = `${Mi}-${A}`;
5103
+ let X = !1, C = !1, R = null, D = null, z = null, k = null;
5104
+ const O = () => {
5087
5105
  if (u && v > 0 && window.innerWidth < v && t.mobileHost && t.mobileHost) {
5088
5106
  const M = t.mobileHost;
5089
5107
  return {
@@ -5097,28 +5115,28 @@ function Fi(t, e, a) {
5097
5115
  return {
5098
5116
  hostSelector: n,
5099
5117
  siblingSelector: i,
5100
- siblingRestoreParentSelector: k,
5118
+ siblingRestoreParentSelector: E,
5101
5119
  rowPlacement: s,
5102
5120
  siblingPlacement: o
5103
5121
  };
5104
- }, N = (M) => [
5122
+ }, B = (M) => [
5105
5123
  M.hostSelector,
5106
5124
  M.siblingSelector ?? "",
5107
5125
  M.siblingRestoreParentSelector
5108
5126
  ].join("|"), q = () => {
5109
- if (document.getElementById(O)) return;
5127
+ if (document.getElementById(F)) return;
5110
5128
  const M = document.createElement("style");
5111
- M.id = O, M.textContent = Ri({
5112
- primaryColor: d,
5113
- textColor: p,
5129
+ M.id = F, M.textContent = Ri({
5130
+ primaryColor: p,
5131
+ textColor: g,
5114
5132
  fontFamily: h,
5115
5133
  borderRadius: m,
5116
5134
  rowClassName: r,
5117
- compactBelowWidth: L,
5135
+ compactBelowWidth: T,
5118
5136
  buttonId: A,
5119
- sizes: z
5137
+ sizes: N
5120
5138
  }), document.head.appendChild(M);
5121
- }, D = (M) => {
5139
+ }, U = (M) => {
5122
5140
  if (!_ || !a.shadowRoot) return;
5123
5141
  const H = a.shadowRoot.getElementById(Ot);
5124
5142
  if (!M) {
@@ -5136,9 +5154,9 @@ function Fi(t, e, a) {
5136
5154
  const H = document.querySelector(M);
5137
5155
  return H instanceof HTMLElement ? H : null;
5138
5156
  }, K = (M) => {
5139
- if (C?.isConnected) return C;
5157
+ if (k?.isConnected) return k;
5140
5158
  const H = W(M.siblingSelector);
5141
- return H && (C = H), H;
5159
+ return H && (k = H), H;
5142
5160
  }, f = (M) => {
5143
5161
  const H = document.querySelector(M);
5144
5162
  return H instanceof HTMLElement ? H : null;
@@ -5168,17 +5186,17 @@ function Fi(t, e, a) {
5168
5186
  M.className = `${fe}-icon`;
5169
5187
  const H = document.createElement("img");
5170
5188
  return H.src = l, H.alt = "", H.draggable = !1, M.appendChild(H), M;
5171
- }, j = () => window.innerWidth < L, Q = (M) => {
5189
+ }, j = () => window.innerWidth < T, Q = (M) => {
5172
5190
  if (!l) return;
5173
5191
  const H = M.querySelector(`.${fe}-icon`);
5174
- if (j() && z.mobile.hideLogo) {
5192
+ if (j() && N.mobile.hideLogo) {
5175
5193
  H?.remove();
5176
5194
  return;
5177
5195
  }
5178
5196
  H || M.insertBefore(I(), M.firstChild);
5179
5197
  }, te = () => {
5180
5198
  const M = document.createElement("button");
5181
- M.type = "button", M.id = A, M.className = fe, M.setAttribute("aria-label", T), l && M.appendChild(I());
5199
+ M.type = "button", M.id = A, M.className = fe, M.setAttribute("aria-label", L), l && M.appendChild(I());
5182
5200
  const H = document.createElement("span");
5183
5201
  H.className = `${fe}-copy`;
5184
5202
  const ee = document.createElement("span");
@@ -5194,29 +5212,29 @@ function Fi(t, e, a) {
5194
5212
  }
5195
5213
  (H.parentElement !== M || ee.nextElementSibling !== H) && M.appendChild(H);
5196
5214
  }, re = () => {
5197
- if (B) {
5198
- P(B);
5199
- const M = ne(B.hostSelector);
5200
- M && $(M), B = null;
5215
+ if (z) {
5216
+ P(z);
5217
+ const M = ne(z.hostSelector);
5218
+ M && $(M), z = null;
5201
5219
  }
5202
- C = null, D(!1), X = !1;
5203
- }, w = (M) => !(M && g.includes(M) || v > 0 && window.innerWidth < v && !u), Y = async (M) => {
5220
+ k = null, U(!1), X = !1;
5221
+ }, w = (M) => !(M && d.includes(M) || v > 0 && window.innerWidth < v && !u), Y = async (M) => {
5204
5222
  const H = M ?? a.getPageType();
5205
5223
  if (!w(H))
5206
5224
  return re(), !1;
5207
5225
  q();
5208
- const ee = U();
5209
- B && N(B) !== N(ee) && re();
5226
+ const ee = O();
5227
+ z && B(z) !== B(ee) && re();
5210
5228
  for (let pe = 0; pe < y; pe += 1) {
5211
5229
  if (!w(H))
5212
5230
  return re(), !1;
5213
- const V = U(), G = ne(V.hostSelector), J = K(V);
5231
+ const V = O(), G = ne(V.hostSelector), J = K(V);
5214
5232
  if (G && (!V.siblingSelector || J)) {
5215
- B && N(B) !== N(V) && re(), J && S(J);
5233
+ z && B(z) !== B(V) && re(), J && S(J);
5216
5234
  let ie = G.querySelector(`.${r}`);
5217
5235
  ie instanceof HTMLElement || (ie = document.createElement("div"), ie.className = r, V.rowPlacement === "start" ? G.insertBefore(ie, G.firstChild) : G.appendChild(ie));
5218
5236
  let Z = ie.querySelector(`#${CSS.escape(A)}`);
5219
- 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;
5237
+ return Z instanceof HTMLButtonElement ? D = Z : (Z = te(), D = Z, ie.appendChild(Z)), J && se(ie, J, Z), Q(Z), C ? Z.classList.add(`${fe}--active`) : Z.classList.remove(`${fe}--active`), U(!0), X = !0, z = V, !0;
5220
5238
  }
5221
5239
  await Hi(16);
5222
5240
  }
@@ -5234,10 +5252,10 @@ function Fi(t, e, a) {
5234
5252
  return Y(M);
5235
5253
  },
5236
5254
  setActive(M) {
5237
- E = M, F?.classList.toggle(`${fe}--active`, M);
5255
+ C = M, D?.classList.toggle(`${fe}--active`, M);
5238
5256
  },
5239
5257
  destroy() {
5240
- R !== null && (window.clearTimeout(R), R = null), window.removeEventListener("resize", oe), window.removeEventListener("orientationchange", oe), re(), document.getElementById(O)?.remove(), F = null;
5258
+ R !== null && (window.clearTimeout(R), R = null), window.removeEventListener("resize", oe), window.removeEventListener("orientationchange", oe), re(), document.getElementById(F)?.remove(), D = null;
5241
5259
  }
5242
5260
  };
5243
5261
  }
@@ -5314,26 +5332,26 @@ function Vi(t) {
5314
5332
  isRunning: !1
5315
5333
  };
5316
5334
  e.innerHTML = "";
5317
- let c = 0, l = null, d = !0;
5318
- function p() {
5319
- if (!d || c >= s.length) {
5320
- d = !1, i?.();
5335
+ let c = 0, l = null, p = !0;
5336
+ function g() {
5337
+ if (!p || c >= s.length) {
5338
+ p = !1, i?.();
5321
5339
  return;
5322
5340
  }
5323
5341
  const h = s[c], m = document.createElement("span");
5324
5342
  m.className = "gengage-chat-typewriter-block";
5325
5343
  for (const x of h) m.appendChild(x.cloneNode(!0));
5326
- e.appendChild(m), c++, r?.(), c < s.length ? l = setTimeout(p, n) : (d = !1, i?.());
5344
+ e.appendChild(m), c++, r?.(), c < s.length ? l = setTimeout(g, n) : (p = !1, i?.());
5327
5345
  }
5328
- return p(), {
5346
+ return g(), {
5329
5347
  complete() {
5330
- d && (l !== null && clearTimeout(l), d = !1, e.innerHTML = a, i?.());
5348
+ p && (l !== null && clearTimeout(l), p = !1, e.innerHTML = a, i?.());
5331
5349
  },
5332
5350
  cancel() {
5333
- l !== null && clearTimeout(l), d = !1;
5351
+ l !== null && clearTimeout(l), p = !1;
5334
5352
  },
5335
5353
  get isRunning() {
5336
- return d;
5354
+ return p;
5337
5355
  }
5338
5356
  };
5339
5357
  }
@@ -5351,25 +5369,25 @@ function Gi(t) {
5351
5369
  const s = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
5352
5370
  let c = s.nextNode(), l = !1;
5353
5371
  for (; c && !l; ) {
5354
- const d = c.textContent ?? "", p = d.toLowerCase().indexOf(i);
5355
- if (p === -1) {
5372
+ const p = c.textContent ?? "", g = p.toLowerCase().indexOf(i);
5373
+ if (g === -1) {
5356
5374
  c = s.nextNode();
5357
5375
  continue;
5358
5376
  }
5359
- const h = p > 0 ? d[p - 1] : void 0, m = d[p + o.short_name.length];
5377
+ const h = g > 0 ? p[g - 1] : void 0, m = p[g + o.short_name.length];
5360
5378
  if (jt(h) || jt(m)) {
5361
5379
  c = s.nextNode();
5362
5380
  continue;
5363
5381
  }
5364
- const x = d.slice(0, p), v = d.slice(p, p + o.short_name.length), u = d.slice(p + o.short_name.length), g = c.parentNode;
5365
- if (!g) {
5382
+ const x = p.slice(0, g), v = p.slice(g, g + o.short_name.length), u = p.slice(g + o.short_name.length), d = c.parentNode;
5383
+ if (!d) {
5366
5384
  c = s.nextNode();
5367
5385
  continue;
5368
5386
  }
5369
5387
  const _ = typeof o.url == "string" && o.url.trim() && he(o.url.trim()) ? o.url.trim() : void 0, y = document.createElement("a");
5370
5388
  y.className = "gengage-product-mention", y.textContent = v, y.href = _ ?? "#", y.addEventListener("click", (b) => {
5371
5389
  b.preventDefault(), n(o);
5372
- }), x && g.insertBefore(document.createTextNode(x), c), g.insertBefore(y, c), u && g.insertBefore(document.createTextNode(u), c), g.removeChild(c), l = !0;
5390
+ }), x && d.insertBefore(document.createTextNode(x), c), d.insertBefore(y, c), u && d.insertBefore(document.createTextNode(u), c), d.removeChild(c), l = !0;
5373
5391
  }
5374
5392
  }
5375
5393
  }
@@ -5668,8 +5686,8 @@ var ao = class {
5668
5686
  if (this.currentType = s, o.querySelector(".gengage-chat-product-grid-head-title") && s === "ProductGrid") {
5669
5687
  const c = this.deps.currentThreadId();
5670
5688
  if (c) {
5671
- const l = this._resolvePanelHistoryIdx(c), d = l > 0, p = l >= 0 && l < this.threads.length - 1;
5672
- this.deps.drawer()?.updatePanelTopBar(d, p, "");
5689
+ const l = this._resolvePanelHistoryIdx(c), p = l > 0, g = l >= 0 && l < this.threads.length - 1;
5690
+ this.deps.drawer()?.updatePanelTopBar(p, g, "");
5673
5691
  }
5674
5692
  } else this.updateTopBar(s);
5675
5693
  return !0;
@@ -5877,16 +5895,16 @@ var xo = class {
5877
5895
  saveSession(t) {
5878
5896
  if (!this._storage) return null;
5879
5897
  const e = ho(t.messages, t.attachmentPlaceholder);
5880
- if (!e.some((p) => p.role === "user" && !p.silent && typeof p.content == "string" && ke(p.content).length > 0)) return null;
5898
+ if (!e.some((g) => g.role === "user" && !g.silent && typeof g.content == "string" && ke(g.content).length > 0)) return null;
5881
5899
  const a = (/* @__PURE__ */ new Date()).toISOString(), n = uo(e), r = mo(e), i = {};
5882
- for (const [p, h] of t.panelSnapshots)
5883
- h.querySelector(".gengage-chat-panel-skeleton") || (i[p] = h.innerHTML);
5900
+ for (const [g, h] of t.panelSnapshots)
5901
+ h.querySelector(".gengage-chat-panel-skeleton") || (i[g] = h.innerHTML);
5884
5902
  const o = {};
5885
- for (const [p, h] of t.panelSnapshotTypes) o[p] = h;
5903
+ for (const [g, h] of t.panelSnapshotTypes) o[g] = h;
5886
5904
  const s = {};
5887
- for (const [p, h] of t.panelSnapshotSources) s[p] = h;
5905
+ for (const [g, h] of t.panelSnapshotSources) s[g] = h;
5888
5906
  const c = {};
5889
- for (const [p, h] of t.panelAiSpecByThread ?? []) c[p] = h;
5907
+ for (const [g, h] of t.panelAiSpecByThread ?? []) c[g] = h;
5890
5908
  const l = {
5891
5909
  version: Vt,
5892
5910
  id: t.historyId,
@@ -5909,8 +5927,8 @@ var xo = class {
5909
5927
  panelSnapshotSources: Object.keys(s).length > 0 ? s : void 0,
5910
5928
  panelAiSpecByThread: Object.keys(c).length > 0 ? c : void 0,
5911
5929
  lastBackendContext: t.lastBackendContext
5912
- }, d = this.listSessions().filter((p) => p.id !== t.historyId);
5913
- for (d.unshift({
5930
+ }, p = this.listSessions().filter((g) => g.id !== t.historyId);
5931
+ for (p.unshift({
5914
5932
  id: l.id,
5915
5933
  title: l.title,
5916
5934
  preview: l.preview,
@@ -5920,11 +5938,11 @@ var xo = class {
5920
5938
  pageType: l.pageType,
5921
5939
  sku: l.sku,
5922
5940
  sourceSessionId: l.sourceSessionId
5923
- }); d.length > lo; ) {
5924
- const p = d.pop();
5925
- p && this._storage.removeItem(Ue(this._scope, p.id));
5941
+ }); p.length > lo; ) {
5942
+ const g = p.pop();
5943
+ g && this._storage.removeItem(Ue(this._scope, g.id));
5926
5944
  }
5927
- return this._commitRecord(l, d) ? l : null;
5945
+ return this._commitRecord(l, p) ? l : null;
5928
5946
  }
5929
5947
  deleteSession(t) {
5930
5948
  if (!this._storage) return;
@@ -6285,19 +6303,19 @@ var Fo = class Me extends Ya {
6285
6303
  this._shadow = this.root.attachShadow({ mode: "open" });
6286
6304
  const a = document.createElement("style");
6287
6305
  a.textContent = No, this._shadow.appendChild(a);
6288
- const n = this.root, r = (u, g) => {
6289
- g && Zt(g) && n.style.setProperty(u, g);
6306
+ const n = this.root, r = (u, d) => {
6307
+ d && Zt(d) && n.style.setProperty(u, d);
6290
6308
  };
6291
6309
  if (r("--gengage-chat-header-bg", e.headerBg), r("--gengage-chat-header-foreground", e.headerForeground), e.theme)
6292
- for (const [u, g] of Object.entries(e.theme)) u.startsWith("--") && typeof g == "string" && r(u, g);
6310
+ for (const [u, d] of Object.entries(e.theme)) u.startsWith("--") && typeof d == "string" && r(u, d);
6293
6311
  this._applyDiscountedPriceColorVar(e.productPriceUi?.discountedPriceColor);
6294
6312
  const i = document.createElement("div");
6295
6313
  i.className = "gengage-chat-root", i.lang = Oe(e.locale), this._rootEl = i, this._shadow.appendChild(i);
6296
6314
  const o = e.variant ?? "floating";
6297
6315
  if (o === "inline" && i.classList.add("gengage-chat--inline"), o !== "inline") {
6298
6316
  const u = document.createElement("div");
6299
- u.className = "gengage-chat-backdrop", u.setAttribute("aria-hidden", "true"), u.setAttribute("role", "button"), u.setAttribute("tabindex", "-1"), u.setAttribute("aria-label", this._i18n.closeAriaLabel), u.addEventListener("click", (g) => {
6300
- g.preventDefault(), g.stopPropagation(), this.close();
6317
+ u.className = "gengage-chat-backdrop", u.setAttribute("aria-hidden", "true"), u.setAttribute("role", "button"), u.setAttribute("tabindex", "-1"), u.setAttribute("aria-label", this._i18n.closeAriaLabel), u.addEventListener("click", (d) => {
6318
+ d.preventDefault(), d.stopPropagation(), this.close();
6301
6319
  }), this._backdropEl = u, i.prepend(u);
6302
6320
  }
6303
6321
  if (o === "floating") {
@@ -6321,7 +6339,7 @@ var Fo = class Me extends Ya {
6321
6339
  const s = document.createElement("div");
6322
6340
  i.appendChild(s), this._drawer = new Bn(s, {
6323
6341
  i18n: this._i18n,
6324
- onSend: (u, g) => this._sendMessage(u, g),
6342
+ onSend: (u, d) => this._sendMessage(u, d),
6325
6343
  onClose: () => this.close(),
6326
6344
  onAttachment: (u) => this._handleAttachment(u),
6327
6345
  onPanelToggle: () => {
@@ -6403,13 +6421,13 @@ var Fo = class Me extends Ya {
6403
6421
  }), o !== "inline" && this._drawer.getElement().classList.add("gengage-chat-drawer--hidden");
6404
6422
  const c = this._drawer.restorePanelState(e.accountId), l = e.panelMode ?? "auto";
6405
6423
  l === "collapsed" ? this._drawer.setPanelCollapsed(!0) : l === "expanded" && this._drawer.setForceExpanded();
6406
- const d = sessionStorage.getItem("gengage_restore_session_id"), p = sessionStorage.getItem("gengage_restore_sku"), h = sessionStorage.getItem("gengage_restore_history_id"), m = !!(d && p);
6424
+ const p = sessionStorage.getItem("gengage_restore_session_id"), g = sessionStorage.getItem("gengage_restore_sku"), h = sessionStorage.getItem("gengage_restore_history_id"), m = !!(p && g);
6407
6425
  m && (sessionStorage.removeItem("gengage_restore_session_id"), sessionStorage.removeItem("gengage_restore_sku")), h && sessionStorage.removeItem("gengage_restore_history_id"), this._historyStorage = new xo(this.config.accountId, this.config.session?.userId ?? "");
6408
6426
  try {
6409
6427
  const u = new ao();
6410
6428
  await u.open(), this._session = new Wt(u);
6411
- const g = h ? this._historyStorage.loadSession(h) : null;
6412
- g ? (this._activeHistorySessionId = g.id, await this._restoreFromHistoryRecord(g)) : await this._restoreFromIndexedDB(m);
6429
+ const d = h ? this._historyStorage.loadSession(h) : null;
6430
+ d ? (this._activeHistorySessionId = d.id, await this._restoreFromHistoryRecord(d)) : await this._restoreFromIndexedDB(m);
6413
6431
  } catch {
6414
6432
  this._session = new Wt(null);
6415
6433
  const u = h ? this._historyStorage.loadSession(h) : null;
@@ -6418,12 +6436,12 @@ var Fo = class Me extends Ya {
6418
6436
  this._registerPublicAPI(), e.mobileInitialState !== void 0 && (this._openState = e.mobileInitialState), this._mobileBreakpoint = e.mobileBreakpoint ?? 768, this._syncViewportState();
6419
6437
  const x = () => this._syncViewportState();
6420
6438
  if (window.addEventListener("resize", x, { passive: !0 }), this.addCleanup(() => window.removeEventListener("resize", x)), window.visualViewport) {
6421
- const g = () => {
6439
+ const d = () => {
6422
6440
  if (!this._drawerVisible || !this._isMobileViewport) return;
6423
6441
  const _ = this._drawer?.getElement();
6424
6442
  if (!_) return;
6425
- 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;
6426
- 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`));
6443
+ const y = window.visualViewport, b = Math.max(0, Math.round(window.innerHeight - (y.height + y.offsetTop))), A = b > 90, L = this._openState === "full" && A ? b : 0;
6444
+ L !== this._lastAppliedKeyboardInset && (this._lastAppliedKeyboardInset = L, _.style.setProperty("--gengage-chat-keyboard-inset", `${L}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`));
6427
6445
  };
6428
6446
  this._syncVisualVh = () => {
6429
6447
  if (!this._isMobileViewport || this._openState !== "full") return;
@@ -6431,8 +6449,8 @@ var Fo = class Me extends Ya {
6431
6449
  if (!_ || !window.visualViewport) return;
6432
6450
  const y = window.visualViewport;
6433
6451
  _.style.setProperty("--gengage-chat-visual-vh", `${Math.round(y.height)}px`), _.style.setProperty("--gengage-chat-visual-top", `${Math.round(y.offsetTop)}px`);
6434
- }, window.visualViewport.addEventListener("resize", g), window.visualViewport.addEventListener("scroll", g), this.addCleanup(() => {
6435
- window.visualViewport?.removeEventListener("resize", g), window.visualViewport?.removeEventListener("scroll", g);
6452
+ }, window.visualViewport.addEventListener("resize", d), window.visualViewport.addEventListener("scroll", d), this.addCleanup(() => {
6453
+ window.visualViewport?.removeEventListener("resize", d), window.visualViewport?.removeEventListener("scroll", d);
6436
6454
  });
6437
6455
  }
6438
6456
  o === "inline" && (this._drawerVisible = !0, this.isVisible = !0, this._applyOpenStateClasses(), this._presentation.setShown(!0), setTimeout(() => this._maybeAutoAnchorUnreadAssistant(), 60));
@@ -6500,79 +6518,79 @@ var Fo = class Me extends Ya {
6500
6518
  const a = e.launcherAnchor;
6501
6519
  if (!a || !a.mobile && !a.desktop) return;
6502
6520
  const n = this.root, r = e.mobileBreakpoint ?? 768, i = () => window.innerWidth <= r ? a.mobile : a.desktop, o = () => {
6503
- const T = i();
6504
- return !!T?.dynamicRelocate && !!T.selector;
6521
+ const L = i();
6522
+ return !!L?.dynamicRelocate && !!L.selector;
6505
6523
  }, s = "--gengage-chat-launcher-anchor-bottom", c = "--gengage-chat-launcher-anchor-right";
6506
6524
  (a.mobile?.dynamicRelocate || a.desktop?.dynamicRelocate) && n.style.setProperty("--gengage-chat-launcher-anchor-transition", "0.35s");
6507
6525
  const l = () => {
6508
- const T = window.innerWidth <= r ? a.mobile : a.desktop;
6509
- if (!T) return;
6510
- const k = T.selector, L = !!k, z = (L ? document.querySelector(k) : null)?.getBoundingClientRect();
6511
- if (T.bottom !== void 0) {
6512
- const { offset: O, type: X } = T.bottom;
6513
- if (!L) n.style.setProperty(s, `${Math.max(0, O)}px`);
6514
- else if (z) {
6515
- const E = X === "root" || O === 0 ? z.bottom : z.top, R = Math.max(0, window.innerHeight - E + O);
6526
+ const L = window.innerWidth <= r ? a.mobile : a.desktop;
6527
+ if (!L) return;
6528
+ const E = L.selector, T = !!E, N = (T ? document.querySelector(E) : null)?.getBoundingClientRect();
6529
+ if (L.bottom !== void 0) {
6530
+ const { offset: F, type: X } = L.bottom;
6531
+ if (!T) n.style.setProperty(s, `${Math.max(0, F)}px`);
6532
+ else if (N) {
6533
+ const C = X === "root" || F === 0 ? N.bottom : N.top, R = Math.max(0, window.innerHeight - C + F);
6516
6534
  n.style.setProperty(s, `${R}px`);
6517
6535
  }
6518
6536
  }
6519
- if (T.right !== void 0) {
6520
- const { offset: O, type: X } = T.right;
6521
- if (!L) n.style.setProperty(c, `${Math.max(0, O)}px`);
6522
- else if (z) {
6523
- const E = X === "root" || O === 0 ? z.right : z.left, R = Math.max(0, window.innerWidth - E + O);
6537
+ if (L.right !== void 0) {
6538
+ const { offset: F, type: X } = L.right;
6539
+ if (!T) n.style.setProperty(c, `${Math.max(0, F)}px`);
6540
+ else if (N) {
6541
+ const C = X === "root" || F === 0 ? N.right : N.left, R = Math.max(0, window.innerWidth - C + F);
6524
6542
  n.style.setProperty(c, `${R}px`);
6525
6543
  }
6526
6544
  }
6527
- }, d = () => {
6545
+ }, p = () => {
6528
6546
  n.style.removeProperty(s), n.style.removeProperty(c);
6529
6547
  };
6530
- let p = !1, h = 0;
6548
+ let g = !1, h = 0;
6531
6549
  const m = () => {
6532
- !o() || !p || h || (h = requestAnimationFrame(() => {
6533
- h = 0, o() && p && l();
6550
+ !o() || !g || h || (h = requestAnimationFrame(() => {
6551
+ h = 0, o() && g && l();
6534
6552
  }));
6535
6553
  }, x = new ResizeObserver(() => {
6536
- (!o() || p) && l();
6554
+ (!o() || g) && l();
6537
6555
  });
6538
6556
  let v = null, u = null;
6539
- const g = () => {
6540
- const T = i()?.selector;
6541
- return !T || !!document.querySelector(T);
6557
+ const d = () => {
6558
+ const L = i()?.selector;
6559
+ return !L || !!document.querySelector(L);
6542
6560
  }, _ = () => {
6543
- !o() || g() || (u?.disconnect(), u = new MutationObserver(() => {
6544
- g() && (u?.disconnect(), u = null, y());
6561
+ !o() || d() || (u?.disconnect(), u = new MutationObserver(() => {
6562
+ d() && (u?.disconnect(), u = null, y());
6545
6563
  }), u.observe(document.body, {
6546
6564
  childList: !0,
6547
6565
  subtree: !0
6548
6566
  }));
6549
6567
  }, y = () => {
6550
- x.disconnect(), v?.disconnect(), v = null, p = !1;
6551
- const T = i();
6552
- if (!T) return;
6553
- if (!T.selector) {
6568
+ x.disconnect(), v?.disconnect(), v = null, g = !1;
6569
+ const L = i();
6570
+ if (!L) return;
6571
+ if (!L.selector) {
6554
6572
  l();
6555
6573
  return;
6556
6574
  }
6557
- const k = document.querySelector(T.selector);
6558
- k && (x.observe(k), o() ? (v = new IntersectionObserver((L) => {
6559
- for (const z of L) z.isIntersecting ? (p = !0, l()) : (p = !1, d(), _());
6560
- }, { threshold: 0 }), v.observe(k)) : l());
6575
+ const E = document.querySelector(L.selector);
6576
+ E && (x.observe(E), o() ? (v = new IntersectionObserver((T) => {
6577
+ for (const N of T) N.isIntersecting ? (g = !0, l()) : (g = !1, p(), _());
6578
+ }, { threshold: 0 }), v.observe(E)) : l());
6561
6579
  };
6562
6580
  y();
6563
6581
  let b = 0;
6564
6582
  const A = () => {
6565
6583
  b || (b = requestAnimationFrame(() => {
6566
- b = 0, p = !1, d(), u?.disconnect(), u = null, y(), _(), o() || l();
6584
+ b = 0, g = !1, p(), u?.disconnect(), u = null, y(), _(), o() || l();
6567
6585
  }));
6568
6586
  };
6569
6587
  window.addEventListener("resize", A, { passive: !0 }), window.addEventListener("scroll", m, { passive: !0 }), window.visualViewport?.addEventListener("scroll", m, { passive: !0 }), this._syncLauncherAnchor = () => {
6570
- p = !1, d(), u?.disconnect(), u = null, y(), _();
6588
+ g = !1, p(), u?.disconnect(), u = null, y(), _();
6571
6589
  }, o() ? _() : (l(), [
6572
6590
  100,
6573
6591
  400,
6574
6592
  1e3
6575
- ].forEach((T) => window.setTimeout(l, T))), this._launcherAnchorCleanup = () => {
6593
+ ].forEach((L) => window.setTimeout(l, L))), this._launcherAnchorCleanup = () => {
6576
6594
  x.disconnect(), v?.disconnect(), u?.disconnect(), window.removeEventListener("resize", A), window.removeEventListener("scroll", m), window.visualViewport?.removeEventListener("scroll", m), b && cancelAnimationFrame(b), h && cancelAnimationFrame(h);
6577
6595
  };
6578
6596
  }
@@ -7121,31 +7139,31 @@ var Fo = class Me extends Ya {
7121
7139
  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();
7122
7140
  }
7123
7141
  }
7124
- const d = !a?.silent && this._assistantMode === "shopping" && this._hasUnavailableProductContext() && (e.type === "user_message" || e.type === "inputText");
7125
- let p = this._currentPanelSource, h = !1;
7142
+ const p = !a?.silent && this._assistantMode === "shopping" && this._hasUnavailableProductContext() && (e.type === "user_message" || e.type === "inputText");
7143
+ let g = this._currentPanelSource, h = !1;
7126
7144
  const m = e.type === "user_message" || e.type === "inputText", x = () => {
7127
- h || a?.preservePanel || (p = this._currentPanelSource, h = !0);
7145
+ h || a?.preservePanel || (g = this._currentPanelSource, h = !0);
7128
7146
  }, v = () => {
7129
7147
  if (this._drawer?.isPanelLoading()) {
7130
- if (!m && p) {
7131
- const f = this._buildRenderContext(), S = this._renderPanelFromSource(p, f);
7132
- this._drawer.setPanelContent(S), this._currentPanelSource = p;
7148
+ if (!m && g) {
7149
+ const f = this._buildRenderContext(), S = this._renderPanelFromSource(g, f);
7150
+ this._drawer.setPanelContent(S), this._currentPanelSource = g;
7133
7151
  } else
7134
7152
  this._drawer.clearPanel(), this._currentPanelSource = null;
7135
- p = null;
7153
+ g = null;
7136
7154
  }
7137
7155
  };
7138
7156
  e.type === "getComparisonTable" && (this._drawer?.showPanelLoading("comparisonTable"), this._panel?.updateTopBarForLoading("comparisonTable")), !a?.silent && !o && this._pruneEmptyStreamingAssistantPlaceholders(), this._drawer?.showTypingIndicator();
7139
7157
  let u = "";
7140
- const g = this._createMessage("assistant", "");
7141
- g.threadId = i, g.status = "streaming", a?.silent && (g.silent = !0), this._messages.push(g), this._presentation.registerAssistantActivity(i), this._focusPresentationThread(i, "smooth", a?.silent || o), a?.preservePanel || (this._contextPrimingInFlight && !s && (this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._abortAllActiveRequests());
7158
+ const d = this._createMessage("assistant", "");
7159
+ d.threadId = i, d.status = "streaming", a?.silent && (d.silent = !0), this._messages.push(d), this._presentation.registerAssistantActivity(i), this._focusPresentationThread(i, "smooth", a?.silent || o), a?.preservePanel || (this._contextPrimingInFlight && !s && (this._contextPrimingInFlight = !1, this._queuedUserMessages = []), this._abortAllActiveRequests());
7142
7160
  const _ = {
7143
7161
  middlewareUrl: this.config.middlewareUrl,
7144
7162
  ...this.config.accountId ? { accountId: this.config.accountId } : {},
7145
7163
  ...this.config.injectorAdapter ? { injectorAdapter: this.config.injectorAdapter } : {}
7146
7164
  };
7147
7165
  a?.attachment !== void 0 && (_.attachment = a.attachment);
7148
- const y = this._getVisibleMessages().filter((f) => !f.frontendOnly && f !== g && (f.content || f.role === "assistant")).slice(-50).map((f) => ({
7166
+ const y = this._getVisibleMessages().filter((f) => !f.frontendOnly && f !== d && (f.content || f.role === "assistant")).slice(-50).map((f) => ({
7149
7167
  role: f.role === "user" ? "user" : "model",
7150
7168
  content: f.content ?? ""
7151
7169
  })), b = {
@@ -7171,7 +7189,7 @@ var Fo = class Me extends Ya {
7171
7189
  backendContext: this._lastBackendContext,
7172
7190
  isMobile: this._isMobileViewport,
7173
7191
  genericNonPdpLaunch: this.config.genericNonPdpLaunch
7174
- }), T = {
7192
+ }), L = {
7175
7193
  account_id: this.config.accountId,
7176
7194
  session_id: this.config.session?.sessionId ?? "",
7177
7195
  correlation_id: this.config.session?.sessionId ?? "",
@@ -7184,32 +7202,32 @@ var Fo = class Me extends Ya {
7184
7202
  session_id: this.config.session?.sessionId ?? ""
7185
7203
  }
7186
7204
  };
7187
- 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);
7188
- let k = !1, L = !1, z = !1, O = !1, X = !1, E = !1;
7205
+ this.config.session?.userId !== void 0 && (L.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (L.view_id = this.config.session.viewId), A.payload !== void 0 && (L.payload = A.payload), !p && this.config.pageContext?.sku !== void 0 && (L.sku = this.config.pageContext.sku), !p && this.config.pageContext?.pageType !== void 0 && (L.page_type = this.config.pageContext.pageType);
7206
+ let E = !1, T = !1, N = !1, F = !1, X = !1, C = !1;
7189
7207
  const R = On();
7190
- let F = null, B = null;
7191
- const C = () => {
7192
- if (this._drawer && !O) {
7193
- if (!z) {
7208
+ let D = null, z = null;
7209
+ const k = () => {
7210
+ if (this._drawer && !F) {
7211
+ if (!N) {
7194
7212
  this._drawer.setPanelAiZoneState("hidden");
7195
7213
  return;
7196
7214
  }
7197
7215
  X ? this._drawer.setPanelAiZoneState("hidden") : this._drawer.setPanelAiZoneState("analyzing", { analyzingLabel: this._i18n.aiAnalysisAnalyzingLabel });
7198
7216
  }
7199
- }, U = (f) => {
7200
- if (!F || !this._drawer) return;
7217
+ }, O = (f) => {
7218
+ if (!D || !this._drawer) return;
7201
7219
  const S = this._buildRenderContext();
7202
7220
  S.isStreaming = f;
7203
- const P = this._renderUISpec(F, S);
7204
- O = !0, this._drawer.setPanelAiZoneState("results", { resultEl: P }), F = null;
7205
- }, N = (f, S, P) => {
7221
+ const P = this._renderUISpec(D, S);
7222
+ F = !0, this._drawer.setPanelAiZoneState("results", { resultEl: P }), D = null;
7223
+ }, B = (f, S, P) => {
7206
7224
  if (f === "ProductGrid" || f === "CategoriesContainer") {
7207
- z = !0, U(P), C();
7225
+ N = !0, O(P), k();
7208
7226
  return;
7209
7227
  }
7210
- S !== "appendSimilars" && S !== "append" && (z = !1, O = !1, F = null, this._drawer?.setPanelAiZoneState("hidden"));
7211
- }, q = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (z || O || F !== null), D = () => {
7212
- E || (E = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
7228
+ S !== "appendSimilars" && S !== "append" && (N = !1, F = !1, D = null, this._drawer?.setPanelAiZoneState("hidden"));
7229
+ }, q = (f) => (f === "ProductGrid" || f === "CategoriesContainer") && (N || F || D !== null), U = () => {
7230
+ C || (C = !0, this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }));
7213
7231
  }, ne = (f, S, P) => {
7214
7232
  if (!this._drawer || !this._panel) return;
7215
7233
  const $ = f.elements[f.root];
@@ -7232,17 +7250,17 @@ var Fo = class Me extends Ya {
7232
7250
  }, this._panel.currentType = P;
7233
7251
  }, W = (f, S, P, $) => {
7234
7252
  if (!this._panel) return;
7235
- 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();
7253
+ 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();
7236
7254
  const I = this._panel.currentType ?? f, j = S?.props?.panelTitle;
7237
- this._panel.updateTopBar(I, j), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), N(f, P, $);
7255
+ this._panel.updateTopBar(I, j), this._panel.updateExtendedMode(f), this._isMobileViewport && c && this._drawer?.hideMobilePanel(), B(f, P, $);
7238
7256
  };
7239
7257
  let K = null;
7240
- if (K = pn(T, {
7258
+ if (K = pn(L, {
7241
7259
  onTextChunk: (f, S, P) => {
7242
7260
  if (!o && i !== this._activeRequestThreadId || (u += f, P?.skuToProductItem && (this._skuToProductItem = {
7243
7261
  ...this._skuToProductItem,
7244
7262
  ...P.skuToProductItem
7245
- }), P?.conversationMode && (this._conversationMode = P.conversationMode), P?.renderHint && (g.renderHint = P.renderHint), !this._drawer)) return;
7263
+ }), P?.conversationMode && (this._conversationMode = P.conversationMode), P?.renderHint && (d.renderHint = P.renderHint), !this._drawer)) return;
7246
7264
  let $ = u;
7247
7265
  const I = P?.kvkk === !0, j = I ? { fallbackToFirstBlock: !0 } : void 0;
7248
7266
  if (I || xt($)) {
@@ -7255,13 +7273,13 @@ var Fo = class Me extends Ya {
7255
7273
  }
7256
7274
  $ = To($, j), u = $;
7257
7275
  }
7258
- Ho($) && D();
7259
- const Q = this._shadow?.querySelector(`[data-message-id="${g.id}"] .gengage-chat-bubble-text`);
7260
- 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)
7261
- if (g.content = $, g.status = "done", yt(), qn(g))
7262
- this._drawer?.updateBotMessage(g.id, $, "photo_analysis", g.photoAnalysis), g.threadId && this._focusPresentationThread(g.threadId, "auto");
7276
+ Ho($) && U();
7277
+ const Q = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
7278
+ if (Q ? Q.innerHTML = ve($) : (d.content = $, 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)
7279
+ if (d.content = $, d.status = "done", yt(), qn(d))
7280
+ this._drawer?.updateBotMessage(d.id, $, "photo_analysis", d.photoAnalysis), d.threadId && this._focusPresentationThread(d.threadId, "auto");
7263
7281
  else {
7264
- const te = this._shadow?.querySelector(`[data-message-id="${g.id}"] .gengage-chat-bubble-text`);
7282
+ const te = this._shadow?.querySelector(`[data-message-id="${d.id}"] .gengage-chat-bubble-text`);
7265
7283
  if (te) {
7266
7284
  this._activeTypewriter?.cancel();
7267
7285
  const se = P?.productMentions ? this._enrichProductMentionsWithUrls(P.productMentions) : void 0;
@@ -7297,22 +7315,22 @@ var Fo = class Me extends Ya {
7297
7315
  },
7298
7316
  onUISpec: (f, S, P, $) => {
7299
7317
  if (!o && i !== this._activeRequestThreadId || S !== "chat") return;
7300
- $ && (this._clearAssistantPanelLikeStreamClearPanel(), k = !1, B = null);
7318
+ $ && (this._clearAssistantPanelLikeStreamClearPanel(), E = !1, z = null);
7301
7319
  const I = f.elements[f.root], j = I?.type ?? "unknown";
7302
7320
  if (jn(j, I?.props ?? {}, R, {
7303
7321
  drawer: this._drawer,
7304
- ensureRendered: () => this._ensureAssistantMessageRendered(g),
7322
+ ensureRendered: () => this._ensureAssistantMessageRendered(d),
7305
7323
  cancelTypewriter: () => {
7306
7324
  this._activeTypewriter?.cancel(), this._activeTypewriter = null;
7307
7325
  },
7308
7326
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7309
7327
  streamDone: X
7310
- }, g)) {
7311
- j === "PhotoAnalysisCard" && g.threadId && this._focusPresentationThread(g.threadId, "auto");
7328
+ }, d)) {
7329
+ j === "PhotoAnalysisCard" && d.threadId && this._focusPresentationThread(d.threadId, "auto");
7312
7330
  return;
7313
7331
  }
7314
7332
  const Q = gt(I), te = this.config.productDetailsExtended !== !0 && (j === "ProductDetailsPanel" || Q);
7315
- te && !$ && (this._clearAssistantPanelLikeStreamClearPanel(), k = !1);
7333
+ te && !$ && (this._clearAssistantPanelLikeStreamClearPanel(), E = !1);
7316
7334
  const se = j === "ProductDetailsPanel" && P !== "panel" ? "panel" : P, re = this._buildRenderContext();
7317
7335
  if (re.isStreaming = !0, j === "ComparisonTable") {
7318
7336
  const G = I?.props?.products;
@@ -7326,14 +7344,14 @@ var Fo = class Me extends Ya {
7326
7344
  if (se === "panel" && this._panel && !te && j === "ProductGrid" && I) {
7327
7345
  const G = ft(I);
7328
7346
  if (G.isConsulting && !Si(G)) {
7329
- B = f;
7347
+ z = f;
7330
7348
  return;
7331
7349
  }
7332
- G.isConsulting && (B = null);
7350
+ G.isConsulting && (z = null);
7333
7351
  }
7334
- if (Ro(I) && D(), se === "panel" && this._panel && !te) {
7335
- const G = !L;
7336
- L = !0;
7352
+ if (Ro(I) && U(), se === "panel" && this._panel && !te) {
7353
+ const G = !T;
7354
+ T = !0;
7337
7355
  const J = I?.props?.replacePanel === !0, ie = I?.props?.rankingState, Z = J || ie === "pending" || ie === "final" ? "replace" : oo({
7338
7356
  componentType: j,
7339
7357
  similarsAppend: I?.props?.similarsAppend === !0,
@@ -7347,7 +7365,7 @@ var Fo = class Me extends Ya {
7347
7365
  spec: w
7348
7366
  })), 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);
7349
7367
  }
7350
- if (j === "ProductDetailsPanel" && se === "panel" && (!g.silent || c)) {
7368
+ if (j === "ProductDetailsPanel" && se === "panel" && (!d.silent || c)) {
7351
7369
  const G = I?.props?.product;
7352
7370
  if (G) {
7353
7371
  c && (l = G), this._currentInlineProductSummaryRecord = G;
@@ -7360,30 +7378,30 @@ var Fo = class Me extends Ya {
7360
7378
  }, ie = this._shadow?.querySelector(".gengage-chat-messages");
7361
7379
  if (ie) {
7362
7380
  const Z = this._renderUISpec(J, re);
7363
- g.threadId && (Z.dataset.threadId = g.threadId);
7364
- const le = this._shadow?.querySelector(`[data-message-id="${g.id}"]`);
7365
- le && le.parentNode === ie ? le.after(Z) : ie.appendChild(Z), this._scrollInlineIntoView(Z, g.threadId), this._drawer?.refreshPresentationCollapsed(), L = !0;
7381
+ d.threadId && (Z.dataset.threadId = d.threadId);
7382
+ const le = this._shadow?.querySelector(`[data-message-id="${d.id}"]`);
7383
+ le && le.parentNode === ie ? le.after(Z) : ie.appendChild(Z), this._scrollInlineIntoView(Z, d.threadId), this._drawer?.refreshPresentationCollapsed(), T = !0;
7366
7384
  }
7367
7385
  }
7368
7386
  }
7369
7387
  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");
7370
7388
  let H = !1, ee = !1;
7371
- if (te && Q && (re.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), Y && (!g.silent || s))
7372
- if (g.threadId && this._rememberPanelAiSpec(g.threadId, f), z) {
7389
+ if (te && Q && (re.panelProductListHeading = this._i18n.similarProductsLabel ?? "Similar Products"), Y && (!d.silent || s))
7390
+ if (d.threadId && this._rememberPanelAiSpec(d.threadId, f), N) {
7373
7391
  const G = this._renderUISpec(f, re);
7374
- O = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: G }), H = !0, F = null;
7392
+ F = !0, this._drawer?.setPanelAiZoneState("results", { resultEl: G }), H = !0, D = null;
7375
7393
  } else
7376
- F = f, ee = !0;
7394
+ D = f, ee = !0;
7377
7395
  ce && (this._drawer?.setInputAreaChips([]), this._drawer?.setPills([]));
7378
7396
  const pe = s && (j === "GroundingReviewCard" || Y || j === "InlineQuestionButtons");
7379
- if (!Y && (!g.silent || pe) && (se !== "panel" || j === "ProductCard" || te && j === "ProductGrid" && !Q) && (j !== "ActionButtons" || M) && !H && !(ee && Y)) {
7397
+ if (!Y && (!d.silent || pe) && (se !== "panel" || j === "ProductCard" || te && j === "ProductGrid" && !Q) && (j !== "ActionButtons" || M) && !H && !(ee && Y)) {
7380
7398
  const G = this._shadow?.querySelector(".gengage-chat-messages");
7381
7399
  if (G) {
7382
7400
  const J = this._renderUISpec(f, re);
7383
- g.threadId && (J.dataset.threadId = g.threadId), G.appendChild(J), this._scrollInlineIntoView(J, g.threadId), this._drawer?.refreshPresentationCollapsed(), te && j === "ProductGrid" && (L = !0);
7401
+ d.threadId && (J.dataset.threadId = d.threadId), G.appendChild(J), this._scrollInlineIntoView(J, d.threadId), this._drawer?.refreshPresentationCollapsed(), te && j === "ProductGrid" && (T = !0);
7384
7402
  }
7385
7403
  }
7386
- if ((j === "ProductGrid" || j === "ProductCard") && g.threadId) {
7404
+ if ((j === "ProductGrid" || j === "ProductCard") && d.threadId) {
7387
7405
  const G = I?.children ?? [], J = j === "ProductGrid" ? G.map((ie) => f.elements[ie]?.props?.product).filter(Boolean) : [I?.props?.product].filter(Boolean);
7388
7406
  for (const ie of J) {
7389
7407
  const Z = ie.sku;
@@ -7431,7 +7449,7 @@ var Fo = class Me extends Ya {
7431
7449
  }));
7432
7450
  }
7433
7451
  }
7434
- C(), g.uiSpec = f;
7452
+ k(), d.uiSpec = f;
7435
7453
  },
7436
7454
  onAction: (f) => {
7437
7455
  if (!(!o && i !== this._activeRequestThreadId) && f.type === "action") {
@@ -7460,7 +7478,7 @@ var Fo = class Me extends Ya {
7460
7478
  }
7461
7479
  if (f.meta.panelLoading) {
7462
7480
  const S = typeof f.meta.panelPendingType == "string" ? f.meta.panelPendingType : void 0;
7463
- 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));
7481
+ this.config.productDetailsExtended !== !0 && (S === "productDetails" || S === "productDetailsSimilars") || (E = !0, T = !1, x(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(S), this._isMobileViewport && S === "productList" && this._ensureMobilePanelOverlayVisible(), S && this._panel?.updateTopBarForLoading(S));
7464
7482
  }
7465
7483
  if (f.meta.voice) {
7466
7484
  const S = new CustomEvent("gengage:chat:voice", {
@@ -7476,13 +7494,13 @@ var Fo = class Me extends Ya {
7476
7494
  if ((f.meta.redirectTarget || f.meta.redirect) && (_e("gengage:chat:redirect", {
7477
7495
  target: f.meta.redirectTarget ?? null,
7478
7496
  payload: f.meta.redirect ?? null
7479
- }), 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) {
7497
+ }), ze("redirect", "redirect dispatched", { target: f.meta.redirectTarget ?? null }), this._handleRedirectMetadata(f.meta.redirect)), f.meta.analyzeAnimation && this.config.productDetailsExtended === !0 && (E = !0, T = !1, x(), this._panel && (this._panel.currentType = null), this._drawer?.showPanelLoading(), this._panel?.updateTopBarForLoading("productDetails")), f.meta.loading) {
7480
7498
  const S = Array.isArray(f.meta.thinkingMessages) ? f.meta.thinkingMessages.filter(($) => typeof $ == "string") : [], P = typeof f.meta.loadingText == "string" ? f.meta.loadingText : void 0;
7481
7499
  if (S.length > 0) {
7482
7500
  const $ = P && this._modeController.shouldCondenseThinking() ? [...S.slice(0, 2), P] : S;
7483
7501
  this._drawer?.setThinkingSteps($);
7484
7502
  }
7485
- typeof P == "string" && P.length > 0 && (this._drawer?.addThinkingStep(P), E || this._bridge?.send("loadingMessage", { text: P }));
7503
+ typeof P == "string" && P.length > 0 && (this._drawer?.addThinkingStep(P), C || this._bridge?.send("loadingMessage", { text: P })), C && !X && this._drawer?.resumeTypingIndicator();
7486
7504
  }
7487
7505
  f.meta.visitorDataResponse && this._bridge?.send("engagingMessage", f.meta.visitorDataResponse), f.meta.formType && this._bridge?.send("glovForm", {
7488
7506
  type: f.meta.formType,
@@ -7492,7 +7510,7 @@ var Fo = class Me extends Ya {
7492
7510
  },
7493
7511
  onError: (f) => {
7494
7512
  if (K && this._abortControllers.delete(K), !o && i !== this._activeRequestThreadId) return;
7495
- X = !0, this._activeTypewriter?.cancel(), this._activeTypewriter = null, C(), F = null, B = null, r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), this._drawer?.clearInputAreaChips(), Vn(R, {
7513
+ X = !0, this._activeTypewriter?.cancel(), this._activeTypewriter = null, k(), D = null, z = null, r(!1), this._bridge?.send("loadingMessage", { text: null }), this._drawer?.removeTypingIndicator(), this._drawer?.clearInputAreaChips(), Vn(R, {
7496
7514
  drawer: this._drawer,
7497
7515
  ensureRendered: () => {
7498
7516
  },
@@ -7501,11 +7519,11 @@ var Fo = class Me extends Ya {
7501
7519
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7502
7520
  streamDone: !0
7503
7521
  });
7504
- const S = L;
7505
- k && !L && v(), k = !1, this._maybeHidePreservedMobilePanel(e.type, S), L = !1;
7506
- 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 = () => {
7507
- this._shadow?.querySelector(`[data-message-id="${ue(g.id)}"]`)?.remove();
7508
- const se = this._messages.indexOf(g);
7522
+ const S = T;
7523
+ E && !T && v(), E = !1, this._maybeHidePreservedMobilePanel(e.type, S), T = !1;
7524
+ const P = d.content != null && d.content.length > 0 || u.length > 0 || S, $ = d.silent || P, I = typeof navigator < "u" && navigator.onLine === !1 && Qt(f), j = () => {
7525
+ this._shadow?.querySelector(`[data-message-id="${ue(d.id)}"]`)?.remove();
7526
+ const se = this._messages.indexOf(d);
7509
7527
  se >= 0 && this._messages.splice(se, 1);
7510
7528
  };
7511
7529
  let Q = !1;
@@ -7530,36 +7548,36 @@ var Fo = class Me extends Ya {
7530
7548
  j(), Q = !0, this._drawer?.showErrorWithRecovery(w, Y);
7531
7549
  return;
7532
7550
  }
7533
- g.content = w, g.status = "done";
7551
+ d.content = w, d.status = "done";
7534
7552
  const ce = ve(w.replace(/\r\n/g, `
7535
7553
  `).split(`
7536
7554
  `).join("<br />"));
7537
- this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, ce), this._drawer?.showRecoveryPillsOnly(Y);
7555
+ this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, ce), this._drawer?.showRecoveryPillsOnly(Y);
7538
7556
  };
7539
7557
  if (s && !P) if (c || this._hasUnavailableProductContext()) {
7540
7558
  this._drawer?.setPills([]);
7541
7559
  const se = this._i18n.productNotFoundMessage;
7542
- g.content = se, g.status = "done", this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, se), this._markUnavailableProductContext();
7543
- } else g.status = "done";
7560
+ d.content = se, d.status = "done", this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, se), this._markUnavailableProductContext();
7561
+ } else d.status = "done";
7544
7562
  else if ($)
7545
- this._drawer?.setPills([]), g.silent || te();
7563
+ this._drawer?.setPills([]), d.silent || te();
7546
7564
  else if (te(), I) return;
7547
- s && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !Q && g.status === "streaming" && (g.status = "error");
7565
+ s && (this._contextPrimingInFlight = !1, this._flushQueuedUserMessages()), !Q && d.status === "streaming" && (d.status = "error");
7548
7566
  },
7549
7567
  onDone: () => {
7550
7568
  if (K && this._abortControllers.delete(K), !o && i !== this._activeRequestThreadId) return;
7551
- if (X = !0, B && this._panel && this._drawer) {
7569
+ if (X = !0, z && this._panel && this._drawer) {
7552
7570
  const I = this._buildRenderContext();
7553
7571
  I.isStreaming = !1;
7554
- const j = B.elements[B.root], Q = this._panel.toPanelSpec(B);
7572
+ const j = z.elements[z.root], Q = this._panel.toPanelSpec(z);
7555
7573
  this._applyPanelListHeadingToContext(I, {
7556
7574
  kind: "spec",
7557
7575
  spec: Q
7558
7576
  });
7559
7577
  const te = j?.type ?? "ProductGrid";
7560
- ne(Q, I, te), W(te, j, "replace", !1), L = !0;
7578
+ ne(Q, I, te), W(te, j, "replace", !1), T = !0;
7561
7579
  }
7562
- 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, {
7580
+ z = null, D && O(!1), k(), !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, {
7563
7581
  drawer: this._drawer,
7564
7582
  ensureRendered: () => {
7565
7583
  },
@@ -7568,33 +7586,33 @@ var Fo = class Me extends Ya {
7568
7586
  sendSkipMessage: () => this._sendMessage(this._i18n.beautyPhotoStepSkipMessage),
7569
7587
  streamDone: !0
7570
7588
  });
7571
- const f = L;
7572
- if (k && !L && v(), k = !1, this._maybeHidePreservedMobilePanel(e.type, f), c && !u && !f) {
7589
+ const f = T;
7590
+ if (E && !T && v(), E = !1, this._maybeHidePreservedMobilePanel(e.type, f), c && !u && !f) {
7573
7591
  const I = this._i18n.productNotFoundMessage;
7574
- g.content = I, this._ensureAssistantMessageRendered(g), this._drawer?.updateBotMessage(g.id, I), this._markUnavailableProductContext();
7592
+ d.content = I, this._ensureAssistantMessageRendered(d), this._drawer?.updateBotMessage(d.id, I), this._markUnavailableProductContext();
7575
7593
  }
7576
- if (L = !1, s) {
7594
+ if (T = !1, s) {
7577
7595
  this._contextPrimingInFlight = !1;
7578
7596
  const I = this._queuedUserMessages.length > 0;
7579
7597
  this._flushQueuedUserMessages(), !I && c && this._ensurePdpPrimeSuggestedUiIfNeeded(l);
7580
7598
  }
7581
- g.status === "streaming" && (g.status = "done", yt()), this._presentation.finalizeAssistantGroup(i);
7599
+ d.status === "streaming" && (d.status = "done", yt()), this._presentation.finalizeAssistantGroup(i);
7582
7600
  const S = this._shadow?.querySelector(".gengage-chat-comparison-toggle-btn--hidden");
7583
- S && (S.classList.remove("gengage-chat-comparison-toggle-btn--hidden"), S.classList.add("gengage-chat-comparison-toggle-btn--reveal")), this.emit("message", g);
7601
+ S && (S.classList.remove("gengage-chat-comparison-toggle-btn--hidden"), S.classList.add("gengage-chat-comparison-toggle-btn--reveal")), this.emit("message", d);
7584
7602
  const P = this._currentPanelSource, $ = P ? this._clonePanelSourceForHistory(P) : null;
7585
- this._panel?.snapshotForMessage(g.id, $ ? {
7603
+ this._panel?.snapshotForMessage(d.id, $ ? {
7586
7604
  source: $,
7587
- threadId: g.threadId,
7605
+ threadId: d.threadId,
7588
7606
  rebuild: () => {
7589
7607
  const I = this._buildRenderContext();
7590
7608
  return this._renderPanelFromSource($, I);
7591
7609
  }
7592
- } : void 0), this._maybeAddPanelRestoreMessage(g), this._persistConversationState();
7610
+ } : void 0), this._maybeAddPanelRestoreMessage(d), this._persistConversationState();
7593
7611
  }
7594
7612
  }, _), this._abortControllers.add(K), !a?.silent && !o) {
7595
7613
  const f = K;
7596
7614
  this._drawer?.showStopButton(() => {
7597
- f.abort(), this._abortControllers.delete(f), this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }), g.status === "streaming" && (g.status = "done");
7615
+ f.abort(), this._abortControllers.delete(f), this._drawer?.removeTypingIndicator(), r(!1), this._bridge?.send("loadingMessage", { text: null }), d.status === "streaming" && (d.status = "done");
7598
7616
  });
7599
7617
  }
7600
7618
  }
@@ -7927,10 +7945,10 @@ var Fo = class Me extends Ya {
7927
7945
  });
7928
7946
  const l = document.createElement("div");
7929
7947
  l.className = "gengage-chat-history-item-title-row";
7930
- const d = document.createElement("span");
7931
- d.className = "gengage-chat-history-item-title", d.textContent = o.title, l.appendChild(d);
7932
7948
  const p = document.createElement("span");
7933
- p.className = "gengage-chat-history-item-meta", p.textContent = this._formatHistoryTimestamp(o.updatedAt), l.appendChild(p), c.appendChild(l);
7949
+ p.className = "gengage-chat-history-item-title", p.textContent = o.title, l.appendChild(p);
7950
+ const g = document.createElement("span");
7951
+ g.className = "gengage-chat-history-item-meta", g.textContent = this._formatHistoryTimestamp(o.updatedAt), l.appendChild(g), c.appendChild(l);
7934
7952
  const h = document.createElement("p");
7935
7953
  h.className = "gengage-chat-history-item-preview", h.textContent = this._resolveHistoryPreviewText(o), c.appendChild(h), s.appendChild(c);
7936
7954
  const m = document.createElement("button");
@@ -8102,50 +8120,50 @@ var Fo = class Me extends Ya {
8102
8120
  if (o && i.sku && i.sku !== o) return;
8103
8121
  this._markCurrentContextLaunchHandled(), this._drawer?.lockScrollForRestore(), this._currentThreadId = i.currentThreadId, this._lastThreadId = i.lastThreadId, this._currentThreadId && this._lastThreadId && this._currentThreadId > this._lastThreadId && (this._currentThreadId = this._lastThreadId), this._chatCreatedAt = i.createdAt, i.panelThreads && (this._panel.threads = i.panelThreads);
8104
8122
  const s = this._panelThreadIdByMessageId(i.messages);
8105
- if (i.panelSnapshotHtml) for (const [l, d] of Object.entries(i.panelSnapshotHtml)) {
8106
- const p = document.createElement("div");
8107
- p.innerHTML = ve(d), this._panel.snapshots.set(l, p);
8123
+ if (i.panelSnapshotHtml) for (const [l, p] of Object.entries(i.panelSnapshotHtml)) {
8124
+ const g = document.createElement("div");
8125
+ g.innerHTML = ve(p), this._panel.snapshots.set(l, g);
8108
8126
  }
8109
- if (i.panelSnapshotTypes) for (const [l, d] of Object.entries(i.panelSnapshotTypes)) this._panel.snapshotTypes.set(l, d);
8127
+ if (i.panelSnapshotTypes) for (const [l, p] of Object.entries(i.panelSnapshotTypes)) this._panel.snapshotTypes.set(l, p);
8110
8128
  this._restorePanelSnapshotSources(i.panelSnapshotSources, s), i.panelAiSpecByThread && this._restorePanelAiSpecMap(i.panelAiSpecByThread);
8111
8129
  let c = 0;
8112
8130
  for (const l of i.messages) {
8113
- const d = {
8131
+ const p = {
8114
8132
  id: l.id,
8115
8133
  role: l.role,
8116
8134
  timestamp: l.timestamp,
8117
8135
  status: l.status
8118
8136
  };
8119
- if (l.threadId !== void 0 && (d.threadId = l.threadId), l.content !== void 0 && (d.content = l.content), l.frontendOnly && (d.frontendOnly = !0), l.silent && (d.silent = !0), this._messages.push(d), d.silent) continue;
8120
- if (d.role === "assistant" && d.threadId) {
8121
- const m = await this._loadPayload(d.threadId, d.id);
8122
- m && (d.uiSpec = m, this._hydrateRestoredUISpecMetadata(d.id, d.threadId, m));
8137
+ if (l.threadId !== void 0 && (p.threadId = l.threadId), l.content !== void 0 && (p.content = l.content), l.frontendOnly && (p.frontendOnly = !0), l.silent && (p.silent = !0), this._messages.push(p), p.silent) continue;
8138
+ if (p.role === "assistant" && p.threadId) {
8139
+ const m = await this._loadPayload(p.threadId, p.id);
8140
+ m && (p.uiSpec = m, this._hydrateRestoredUISpecMetadata(p.id, p.threadId, m));
8123
8141
  }
8124
- const p = d.role !== "assistant" || !!d.content || !!d.attachment || this._isMessageHostedUISpec(d.uiSpec);
8125
- d.role === "assistant" && d.threadId && p && !this._threadsWithFirstBot.has(d.threadId) && (this._threadsWithFirstBot.add(d.threadId), this._drawer?.markFirstBotMessage(d.id)), this._drawer?.addMessage(d);
8142
+ const g = p.role !== "assistant" || !!p.content || !!p.attachment || this._isMessageHostedUISpec(p.uiSpec);
8143
+ p.role === "assistant" && p.threadId && g && !this._threadsWithFirstBot.has(p.threadId) && (this._threadsWithFirstBot.add(p.threadId), this._drawer?.markFirstBotMessage(p.id)), this._drawer?.addMessage(p);
8126
8144
  const h = parseInt(l.id.replace("msg-", ""), 10);
8127
- !isNaN(h) && h > c && (c = h), d.uiSpec && (this._isMessageHostedUISpec(d.uiSpec) || this._restoreInlineUISpec(d), delete d.uiSpec);
8145
+ !isNaN(h) && h > c && (c = h), p.uiSpec && (this._isMessageHostedUISpec(p.uiSpec) || this._restoreInlineUISpec(p), delete p.uiSpec);
8128
8146
  }
8129
8147
  if (c > this._currentMessageId && (this._currentMessageId = c), this._currentThreadId) {
8130
8148
  let l = await this._session.db?.loadContext(a, this._currentThreadId);
8131
8149
  l || (l = await this._session.db?.loadLatestContext(a)), l && (this._lastBackendContext = l.context);
8132
8150
  }
8133
8151
  if (this._currentThreadId) {
8134
- const l = [...this._messages].reverse().find((d) => d.role === "assistant" && d.threadId === this._currentThreadId && !d.silent);
8152
+ const l = [...this._messages].reverse().find((p) => p.role === "assistant" && p.threadId === this._currentThreadId && !p.silent);
8135
8153
  l && (this._panel.snapshots.has(l.id) || this._panel?.sourceForMessage(l.id)) && (this._panel?.restoreForMessage(l.id) ?? !1) && (this._currentPanelSource = this._panel?.sourceForMessage(l.id) ?? this._panelSourceFromMessage(l), this._restorePanelAiZoneForThread(this._currentThreadId));
8136
8154
  }
8137
8155
  if (this._currentThreadId) {
8138
8156
  const l = this._currentThreadId;
8139
- 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");
8140
- this._shadow?.querySelectorAll("[data-thread-id]").forEach((d) => {
8141
- d instanceof HTMLElement && d.dataset.threadId && d.dataset.threadId > l && d.classList.add("gengage-chat-bubble--hidden");
8157
+ for (const p of this._messages) p.threadId && p.threadId > l && this._shadow?.querySelector(`[data-message-id="${ue(p.id)}"]`)?.classList.add("gengage-chat-bubble--hidden");
8158
+ this._shadow?.querySelectorAll("[data-thread-id]").forEach((p) => {
8159
+ p instanceof HTMLElement && p.dataset.threadId && p.dataset.threadId > l && p.classList.add("gengage-chat-bubble--hidden");
8142
8160
  });
8143
8161
  }
8144
8162
  if (this._panel.threads.length > 0 && this._currentThreadId) {
8145
8163
  const l = this._panel.threads[this._panel.threads.length - 1];
8146
8164
  if (l) {
8147
- const d = [...this._messages].reverse().find((h) => h.role === "assistant" && h.threadId === l && ((this._panel?.snapshots.has(h.id) ?? !1) || this._panel?.sourceForMessage(h.id))), p = d ? this._panel?.snapshotTypes.get(d.id) : void 0;
8148
- p && this._panel?.updateTopBar(p);
8165
+ const p = [...this._messages].reverse().find((h) => h.role === "assistant" && h.threadId === l && ((this._panel?.snapshots.has(h.id) ?? !1) || this._panel?.sourceForMessage(h.id))), g = p ? this._panel?.snapshotTypes.get(p.id) : void 0;
8166
+ g && this._panel?.updateTopBar(g);
8149
8167
  }
8150
8168
  }
8151
8169
  this._presentation.releaseFocusedThread(), this._drawer?.setPresentationFocus(null), setTimeout(() => {
@@ -8224,10 +8242,10 @@ var Fo = class Me extends Ya {
8224
8242
  c && s.classList.add("gengage-chat-comparison-select-wrapper--selected");
8225
8243
  const l = document.createElement("button");
8226
8244
  l.type = "button", l.className = "gengage-chat-comparison-checkbox", l.dataset.selected = c ? "true" : "false", l.setAttribute("aria-pressed", c ? "true" : "false");
8227
- const d = document.createElement("span");
8228
- d.className = "gengage-chat-comparison-checkbox-icon", d.innerHTML = c ? '<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>';
8229
8245
  const p = document.createElement("span");
8230
- p.className = "gengage-chat-comparison-checkbox-label", p.textContent = c ? this._i18n.comparisonSelectedLabel ?? "Selected" : this._i18n.comparisonSelectLabel ?? "Select to compare", l.appendChild(d), l.appendChild(p), l.addEventListener("click", (h) => {
8246
+ p.className = "gengage-chat-comparison-checkbox-icon", p.innerHTML = c ? '<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>';
8247
+ const g = document.createElement("span");
8248
+ g.className = "gengage-chat-comparison-checkbox-label", g.textContent = c ? this._i18n.comparisonSelectedLabel ?? "Selected" : this._i18n.comparisonSelectLabel ?? "Select to compare", l.appendChild(p), l.appendChild(g), l.addEventListener("click", (h) => {
8231
8249
  h.stopPropagation(), this._toggleComparisonSku(o);
8232
8250
  }), i.parentNode.insertBefore(s, i), s.appendChild(l), s.appendChild(i), s.classList.add("gds-clickable"), s.addEventListener("click", (h) => {
8233
8251
  h.target.closest(".gengage-chat-comparison-checkbox") || (h.stopPropagation(), this._toggleComparisonSku(o));
@@ -8588,10 +8606,10 @@ var Fo = class Me extends Ya {
8588
8606
  const n = a.spec.elements[a.spec.root];
8589
8607
  if (!n || n.type !== "ProductGrid" || gt(n)) return;
8590
8608
  const r = (n.children ?? []).map((l) => {
8591
- const d = a.spec.elements[l]?.props?.product;
8592
- return d ? {
8593
- imageUrl: typeof d.imageUrl == "string" ? d.imageUrl : void 0,
8594
- name: typeof d.name == "string" ? d.name : void 0
8609
+ const p = a.spec.elements[l]?.props?.product;
8610
+ return p ? {
8611
+ imageUrl: typeof p.imageUrl == "string" ? p.imageUrl : void 0,
8612
+ name: typeof p.name == "string" ? p.name : void 0
8595
8613
  } : null;
8596
8614
  }).filter((l) => l !== null).slice(0, 3);
8597
8615
  if (r.length === 0) return;
@@ -8688,8 +8706,8 @@ var Fo = class Me extends Ya {
8688
8706
  type: "ProductSummaryCard",
8689
8707
  props: { product: c }
8690
8708
  } }
8691
- }, d = this._renderUISpec(l, i);
8692
- e.threadId && (d.dataset.threadId = e.threadId), o.appendChild(d), this._drawer?.refreshPresentationCollapsed();
8709
+ }, p = this._renderUISpec(l, i);
8710
+ e.threadId && (p.dataset.threadId = e.threadId), o.appendChild(p), this._drawer?.refreshPresentationCollapsed();
8693
8711
  return;
8694
8712
  }
8695
8713
  const s = this._renderUISpec(a, i);