@gengage/assistant-fe 0.4.20 → 0.5.0

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.
Files changed (165) hide show
  1. package/README.md +1 -1
  2. package/dist/{api-paths-CReMDZWg.js → api-paths-y5nkfEBG.js} +1 -1
  3. package/dist/chat-runtime.js +1 -1
  4. package/dist/chat.iife.js +43 -43
  5. package/dist/chat.js +1 -1
  6. package/dist/common-BKPSOoIP.js +324 -0
  7. package/dist/common.js +64 -81
  8. package/dist/{connection-warning-C_4e7ahZ.js → connection-warning-DJiyLM46.js} +1 -1
  9. package/dist/{fastIntent-DMNzXOSI.js → fastIntent-1T2g9art.js} +2 -2
  10. package/dist/index.js +49 -52
  11. package/dist/{native-webview-Bbcvvi_5.js → native-webview-y3a9R9hH.js} +1 -1
  12. package/dist/native.iife.js +23 -23
  13. package/dist/native.js +1 -1
  14. package/dist/{overlay-O4nlUrzw.js → overlay-v3nvcGlE.js} +2 -5
  15. package/dist/overlay.js +2 -2
  16. package/dist/qna-runtime.js +1 -1
  17. package/dist/qna.iife.js +36 -36
  18. package/dist/qna.js +1 -1
  19. package/dist/{runtime-C51WykbJ.js → runtime-BMNOS2Mq.js} +176 -196
  20. package/dist/runtime-DOS9yRRx.js +650 -0
  21. package/dist/{runtime-DBh8899B.js → runtime-DsP6go8z.js} +2194 -2225
  22. package/dist/{simbut-CO1rLVM9.js → simbut-BwxzoBcY.js} +7 -7
  23. package/dist/simbut.iife.js +12 -12
  24. package/dist/simbut.js +1 -1
  25. package/dist/{simrel-zCDlCrqG.js → simrel-C07wZN8Q.js} +2 -2
  26. package/dist/simrel-runtime.js +1 -1
  27. package/dist/simrel.iife.js +35 -35
  28. package/dist/simrel.js +2 -2
  29. package/dist/widget-base-Dliq3QAf.js +362 -0
  30. package/package.json +8 -6
  31. package/dist/chat/api.d.ts +0 -88
  32. package/dist/chat/assistant-mode.d.ts +0 -19
  33. package/dist/chat/attachment-utils.d.ts +0 -9
  34. package/dist/chat/catalog.d.ts +0 -826
  35. package/dist/chat/chat-presentation-state.d.ts +0 -53
  36. package/dist/chat/components/AIGroupingCards.d.ts +0 -3
  37. package/dist/chat/components/AISuggestedSearchCards.d.ts +0 -3
  38. package/dist/chat/components/AITopPicks.d.ts +0 -3
  39. package/dist/chat/components/BeautyPhotoStep.d.ts +0 -16
  40. package/dist/chat/components/CategoriesContainer.d.ts +0 -3
  41. package/dist/chat/components/ChatDrawer.d.ts +0 -360
  42. package/dist/chat/components/ChoicePrompter.d.ts +0 -21
  43. package/dist/chat/components/ComparisonTable.d.ts +0 -57
  44. package/dist/chat/components/ConsultingStylePicker.d.ts +0 -34
  45. package/dist/chat/components/FloatingComparisonButton.d.ts +0 -2
  46. package/dist/chat/components/FloatingLauncher.d.ts +0 -79
  47. package/dist/chat/components/GroundingReviewCard.d.ts +0 -3
  48. package/dist/chat/components/HandoffNotice.d.ts +0 -4
  49. package/dist/chat/components/KvkkBanner.d.ts +0 -6
  50. package/dist/chat/components/Launcher.d.ts +0 -28
  51. package/dist/chat/components/PanelRestoreCard.d.ts +0 -4
  52. package/dist/chat/components/PanelTopBar.d.ts +0 -32
  53. package/dist/chat/components/PhotoAnalysisCard.d.ts +0 -20
  54. package/dist/chat/components/ProductSummaryCard.d.ts +0 -3
  55. package/dist/chat/components/ProsAndCons.d.ts +0 -8
  56. package/dist/chat/components/ReviewHighlights.d.ts +0 -9
  57. package/dist/chat/components/actionClassifier.d.ts +0 -12
  58. package/dist/chat/components/product-price-layout.d.ts +0 -18
  59. package/dist/chat/components/productMentionLinker.d.ts +0 -25
  60. package/dist/chat/components/renderUISpec.d.ts +0 -11
  61. package/dist/chat/components/typewriter.d.ts +0 -24
  62. package/dist/chat/extendedModeManager.d.ts +0 -32
  63. package/dist/chat/features/beauty-consulting/consulting-grid.d.ts +0 -31
  64. package/dist/chat/features/beauty-consulting/drawer-extensions.d.ts +0 -20
  65. package/dist/chat/features/beauty-consulting/mode-controller.d.ts +0 -53
  66. package/dist/chat/features/beauty-consulting/registry.d.ts +0 -3
  67. package/dist/chat/features/beauty-consulting/stream-handler.d.ts +0 -38
  68. package/dist/chat/history-storage.d.ts +0 -85
  69. package/dist/chat/index.d.ts +0 -5
  70. package/dist/chat/kvkk.d.ts +0 -20
  71. package/dist/chat/locales/en.d.ts +0 -2
  72. package/dist/chat/locales/index.d.ts +0 -5
  73. package/dist/chat/locales/tr.d.ts +0 -2
  74. package/dist/chat/panel-manager.d.ts +0 -126
  75. package/dist/chat/runtime.d.ts +0 -400
  76. package/dist/chat/session-persistence.d.ts +0 -65
  77. package/dist/chat/stream-error-display.d.ts +0 -6
  78. package/dist/chat/types.d.ts +0 -543
  79. package/dist/chat/utils/chat-presentation-debug.d.ts +0 -19
  80. package/dist/chat/utils/get-chat-scroll-element.d.ts +0 -10
  81. package/dist/chat/utils/ui.d.ts +0 -10
  82. package/dist/common/action-router.d.ts +0 -26
  83. package/dist/common/activity-tracker.d.ts +0 -37
  84. package/dist/common/analytics-events.d.ts +0 -91
  85. package/dist/common/analytics.d.ts +0 -61
  86. package/dist/common/api-paths.d.ts +0 -15
  87. package/dist/common/client.d.ts +0 -27
  88. package/dist/common/communication-bridge.d.ts +0 -51
  89. package/dist/common/config-constants.d.ts +0 -1
  90. package/dist/common/config-schema.d.ts +0 -81
  91. package/dist/common/connection-warning.d.ts +0 -8
  92. package/dist/common/consulting-sources.d.ts +0 -9
  93. package/dist/common/context.d.ts +0 -27
  94. package/dist/common/css-escape.d.ts +0 -1
  95. package/dist/common/customization-factories.d.ts +0 -62
  96. package/dist/common/debug.d.ts +0 -13
  97. package/dist/common/events.d.ts +0 -46
  98. package/dist/common/fastIntent.d.ts +0 -1
  99. package/dist/common/find-similar-payload.d.ts +0 -3
  100. package/dist/common/ga-datalayer.d.ts +0 -89
  101. package/dist/common/global-error-toast.d.ts +0 -6
  102. package/dist/common/index.d.ts +0 -50
  103. package/dist/common/indexed-db.d.ts +0 -79
  104. package/dist/common/locale.d.ts +0 -1
  105. package/dist/common/native-webview.d.ts +0 -60
  106. package/dist/common/navigation.d.ts +0 -5
  107. package/dist/common/overlay.d.ts +0 -168
  108. package/dist/common/page-detect.d.ts +0 -30
  109. package/dist/common/pill-launcher.d.ts +0 -51
  110. package/dist/common/preflight.d.ts +0 -13
  111. package/dist/common/price-formatter.d.ts +0 -35
  112. package/dist/common/product-utils.d.ts +0 -35
  113. package/dist/common/protocol-adapter.d.ts +0 -105
  114. package/dist/common/renderer/dom.d.ts +0 -3
  115. package/dist/common/renderer/index.d.ts +0 -4
  116. package/dist/common/renderer/overrides.d.ts +0 -23
  117. package/dist/common/renderer/registry.d.ts +0 -2
  118. package/dist/common/renderer/types.d.ts +0 -19
  119. package/dist/common/safe-html.d.ts +0 -22
  120. package/dist/common/sdk-version.d.ts +0 -3
  121. package/dist/common/skeleton.d.ts +0 -8
  122. package/dist/common/streaming.d.ts +0 -37
  123. package/dist/common/suggested-search-keywords.d.ts +0 -18
  124. package/dist/common/theme-utils.d.ts +0 -15
  125. package/dist/common/tts-player.d.ts +0 -13
  126. package/dist/common/types.d.ts +0 -381
  127. package/dist/common/ui-theme.d.ts +0 -9
  128. package/dist/common/uuidv7.d.ts +0 -7
  129. package/dist/common/voice-input.d.ts +0 -74
  130. package/dist/common/widget-base.d.ts +0 -97
  131. package/dist/common-BM2ZsSLI.js +0 -491
  132. package/dist/index.d.ts +0 -25
  133. package/dist/native/index.d.ts +0 -2
  134. package/dist/overlay.d.ts +0 -4
  135. package/dist/qna/api.d.ts +0 -23
  136. package/dist/qna/catalog.d.ts +0 -73
  137. package/dist/qna/components/ButtonRow.d.ts +0 -15
  138. package/dist/qna/components/TextInput.d.ts +0 -11
  139. package/dist/qna/components/renderUISpec.d.ts +0 -7
  140. package/dist/qna/index.d.ts +0 -3
  141. package/dist/qna/locales/en.d.ts +0 -2
  142. package/dist/qna/locales/index.d.ts +0 -5
  143. package/dist/qna/locales/tr.d.ts +0 -2
  144. package/dist/qna/normalize-ui-specs.d.ts +0 -15
  145. package/dist/qna/runtime.d.ts +0 -62
  146. package/dist/qna/types.d.ts +0 -98
  147. package/dist/runtime-bbMljGVG.js +0 -688
  148. package/dist/simbut/index.d.ts +0 -22
  149. package/dist/simbut/locales.d.ts +0 -3
  150. package/dist/simbut/types.d.ts +0 -43
  151. package/dist/simrel/api.d.ts +0 -25
  152. package/dist/simrel/catalog.d.ts +0 -110
  153. package/dist/simrel/components/GroupTabs.d.ts +0 -24
  154. package/dist/simrel/components/ProductCard.d.ts +0 -19
  155. package/dist/simrel/components/ProductGrid.d.ts +0 -17
  156. package/dist/simrel/components/renderUISpec.d.ts +0 -7
  157. package/dist/simrel/index.d.ts +0 -5
  158. package/dist/simrel/locales/en.d.ts +0 -2
  159. package/dist/simrel/locales/index.d.ts +0 -5
  160. package/dist/simrel/locales/tr.d.ts +0 -2
  161. package/dist/simrel/renderers/default.d.ts +0 -40
  162. package/dist/simrel/runtime.d.ts +0 -59
  163. package/dist/simrel/types.d.ts +0 -141
  164. package/dist/widget-base-Cf9ofZhh.js +0 -589
  165. /package/dist/{context-DGz5F81j.js → context-BBuSsXZ9.js} +0 -0
@@ -1,10 +1,10 @@
1
- import { d as Q, h as N, p as H, r as O, t as U } from "./api-paths-CReMDZWg.js";
2
- import { C as j, E as M, S as D, o as F, t as W, w as z } from "./widget-base-Cf9ofZhh.js";
3
- import { A as $, D as G, E as J, a as E, v as V } from "./context-DGz5F81j.js";
4
- import { t as T } from "./locale-CfqNifrU.js";
5
- import { n as Y } from "./connection-warning-C_4e7ahZ.js";
6
- async function Z(e, t, n) {
7
- const o = U("launcher_action", t), i = {
1
+ import { d as x, h as Q, p as R, r as N, t as H } from "./api-paths-y5nkfEBG.js";
2
+ import { A as O, D as U, E as j, a as q, v as M } from "./context-BBuSsXZ9.js";
3
+ import { o as F, t as W } from "./widget-base-Dliq3QAf.js";
4
+ import { t as A } from "./locale-CfqNifrU.js";
5
+ import { n as D } from "./connection-warning-DJiyLM46.js";
6
+ async function z(e, t, n) {
7
+ const o = H("launcher_action", t), i = {
8
8
  uiSpecs: [],
9
9
  actions: []
10
10
  }, a = {
@@ -15,18 +15,18 @@ async function Z(e, t, n) {
15
15
  n !== void 0 && (a.signal = n);
16
16
  const l = await fetch(o, a);
17
17
  if (!l.ok) throw new Error(`HTTP ${l.status}: ${l.statusText}`);
18
- const r = { onEvent: (c) => {
19
- const s = O(c);
20
- if (s && (s.type === "ui_spec" && i.uiSpecs.push(s.spec), s.type === "ui_spec" && s.spec.elements)) {
21
- for (const d of Object.values(s.spec.elements)) if (d.type === "ActionButton" && d.props?.action) {
22
- const b = d.props.action;
23
- i.actions.push(b);
18
+ const s = { onEvent: (c) => {
19
+ const r = N(c);
20
+ if (r && (r.type === "ui_spec" && i.uiSpecs.push(r.spec), r.type === "ui_spec" && r.spec.elements)) {
21
+ for (const u of Object.values(r.spec.elements)) if (u.type === "ActionButton" && u.props?.action) {
22
+ const m = u.props.action;
23
+ i.actions.push(m);
24
24
  }
25
25
  }
26
26
  } };
27
- return n !== void 0 && (r.signal = n), await Q(l, r), i;
27
+ return n !== void 0 && (s.signal = n), await x(l, s), i;
28
28
  }
29
- function C(e) {
29
+ function T(e) {
30
30
  const t = document.createElement("div");
31
31
  t.className = "gengage-qna-buttons gds-toolbar", t.dataset.gengagePart = "qna-button-row", t.setAttribute("role", "group"), t.setAttribute("aria-label", e.quickQuestionsAriaLabel ?? "Quick questions"), e.orientation === "vertical" && (t.style.flexDirection = "column");
32
32
  for (const n of e.actions) {
@@ -47,7 +47,7 @@ function C(e) {
47
47
  }
48
48
  return t;
49
49
  }
50
- function K(e) {
50
+ function $(e) {
51
51
  const t = document.createElement("div");
52
52
  t.className = "gengage-qna-input-wrapper", t.dataset.gengagePart = "qna-input-wrapper";
53
53
  const n = document.createElement("div");
@@ -57,115 +57,115 @@ function K(e) {
57
57
  const i = Array.isArray(e.placeholders) ? e.placeholders : e.placeholders ? [e.placeholders] : [e.defaultInputPlaceholder ?? "Ask a question..."];
58
58
  let a = 0, l = i[0] ?? "";
59
59
  o.placeholder = l;
60
- let r = null, c = null, s = !1;
61
- const d = () => {
62
- r && clearInterval(r), r = null, c && clearTimeout(c), c = null, o.classList.remove("gengage-qna-input--fade");
63
- }, b = () => i.length > 1 && !s && o.value.trim().length === 0, f = () => {
64
- d(), b() && (r = setInterval(() => {
65
- b() && (o.classList.add("gengage-qna-input--fade"), c = setTimeout(() => {
60
+ let s = null, c = null, r = !1;
61
+ const u = () => {
62
+ s && clearInterval(s), s = null, c && clearTimeout(c), c = null, o.classList.remove("gengage-qna-input--fade");
63
+ }, m = () => i.length > 1 && !r && o.value.trim().length === 0, g = () => {
64
+ u(), m() && (s = setInterval(() => {
65
+ m() && (o.classList.add("gengage-qna-input--fade"), c = setTimeout(() => {
66
66
  a = (a + 1) % i.length, l = i[a] ?? "", o.placeholder = l, o.classList.remove("gengage-qna-input--fade");
67
67
  }, 180));
68
68
  }, 3e3));
69
- }, m = document.createElement("div");
70
- m.className = "gengage-qna-input-actions", m.dataset.gengagePart = "qna-input-actions";
69
+ }, h = document.createElement("div");
70
+ h.className = "gengage-qna-input-actions", h.dataset.gengagePart = "qna-input-actions";
71
+ const f = document.createElement("button");
72
+ f.className = "gengage-qna-icon-btn gengage-qna-clear gengage-qna-icon-btn--hidden", f.type = "button", f.dataset.gengagePart = "qna-clear", f.setAttribute("aria-label", "Clear question"), f.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 6L6 18" /><path d="M6 6L18 18" /></svg>';
71
73
  const p = document.createElement("button");
72
- p.className = "gengage-qna-icon-btn gengage-qna-clear gengage-qna-icon-btn--hidden", p.type = "button", p.dataset.gengagePart = "qna-clear", p.setAttribute("aria-label", "Clear question"), p.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 6L6 18" /><path d="M6 6L18 18" /></svg>';
73
- const u = document.createElement("button");
74
- u.className = "gengage-qna-icon-btn gengage-qna-send gengage-qna-icon-btn--hidden", u.type = "button", u.dataset.gengagePart = "qna-send", u.setAttribute("aria-label", e.sendQuestionAriaLabel ?? "Send question"), u.disabled = !0, u.innerHTML = `<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M22 2L11 13" /><path d="M22 2L15 22L11 13L2 9L22 2Z" /></svg><span class="gengage-qna-sr-only">${e.ctaLabel ?? e.sendButtonText ?? "Ask"}</span>`;
74
+ p.className = "gengage-qna-icon-btn gengage-qna-send gengage-qna-icon-btn--hidden", p.type = "button", p.dataset.gengagePart = "qna-send", p.setAttribute("aria-label", e.sendQuestionAriaLabel ?? "Send question"), p.disabled = !0, p.innerHTML = `<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M22 2L11 13" /><path d="M22 2L15 22L11 13L2 9L22 2Z" /></svg><span class="gengage-qna-sr-only">${e.ctaLabel ?? e.sendButtonText ?? "Ask"}</span>`;
75
75
  const y = () => {
76
- const g = o.value.trim().length > 0;
77
- p.classList.toggle("gengage-qna-icon-btn--hidden", !g), u.classList.toggle("gengage-qna-icon-btn--hidden", !g), u.classList.toggle("gengage-qna-send--active", g), u.disabled = !g;
78
- }, v = () => {
79
- const g = o.value.trim();
80
- g && (e.onSubmit({
81
- title: g,
76
+ const d = o.value.trim().length > 0;
77
+ f.classList.toggle("gengage-qna-icon-btn--hidden", !d), p.classList.toggle("gengage-qna-icon-btn--hidden", !d), p.classList.toggle("gengage-qna-send--active", d), p.disabled = !d;
78
+ }, b = () => {
79
+ const d = o.value.trim();
80
+ d && (e.onSubmit({
81
+ title: d,
82
82
  type: "user_message",
83
- payload: g
84
- }), o.value = "", y(), f());
83
+ payload: d
84
+ }), o.value = "", y(), g());
85
85
  };
86
- return p.addEventListener("click", () => {
86
+ return f.addEventListener("click", () => {
87
87
  o.value = "", y(), o.focus({ preventScroll: !0 });
88
- }), u.addEventListener("click", v), o.addEventListener("focus", () => {
89
- s = !0, d(), o.placeholder = "";
88
+ }), p.addEventListener("click", b), o.addEventListener("focus", () => {
89
+ r = !0, u(), o.placeholder = "";
90
90
  }), o.addEventListener("blur", () => {
91
- s = !1, o.value.trim().length === 0 && (o.placeholder = l), f();
91
+ r = !1, o.value.trim().length === 0 && (o.placeholder = l), g();
92
92
  }), o.addEventListener("input", () => {
93
93
  if (y(), o.value.trim().length > 0) {
94
- d();
94
+ u();
95
95
  return;
96
96
  }
97
- o.placeholder = s ? "" : l, f();
98
- }), o.addEventListener("keydown", (g) => {
99
- g.key === "Enter" && (g.preventDefault(), v()), g.key === "Escape" && o.value.length > 0 && (o.value = "", y(), f());
100
- }), m.appendChild(p), m.appendChild(u), n.appendChild(o), n.appendChild(m), t.appendChild(n), y(), f(), t._cleanup = () => {
101
- d();
97
+ o.placeholder = r ? "" : l, g();
98
+ }), o.addEventListener("keydown", (d) => {
99
+ d.key === "Enter" && (d.preventDefault(), b()), d.key === "Escape" && o.value.length > 0 && (o.value = "", y(), g());
100
+ }), h.appendChild(f), h.appendChild(p), n.appendChild(o), n.appendChild(h), t.appendChild(n), y(), g(), t._cleanup = () => {
101
+ u();
102
102
  }, t;
103
103
  }
104
- function q(e, t) {
104
+ function v(e, t) {
105
105
  if (!e || typeof e != "object") return null;
106
106
  const n = e, o = n.type;
107
107
  if (typeof o != "string" || o.length === 0) return null;
108
108
  const i = n.title, a = n.payload, l = typeof i == "string" && i.length > 0 ? i : t;
109
109
  if (!l) return null;
110
- const r = {
110
+ const s = {
111
111
  title: l,
112
112
  type: o
113
113
  };
114
- return a !== void 0 && (r.payload = a), r;
114
+ return a !== void 0 && (s.payload = a), s;
115
115
  }
116
- function k(e) {
116
+ function E(e) {
117
117
  const t = {
118
118
  title: e.title,
119
119
  type: e.type
120
120
  };
121
121
  return e.payload !== void 0 && (t.payload = e.payload), t;
122
122
  }
123
- function I(e, t) {
123
+ function C(e, t) {
124
124
  const n = [], o = e.props?.actions;
125
125
  if (Array.isArray(o)) for (const l of o) {
126
- const r = q(l);
127
- r && n.push(r);
126
+ const s = v(l);
127
+ s && n.push(s);
128
128
  }
129
129
  const i = e.props?.buttons;
130
130
  if (Array.isArray(i)) for (const l of i) {
131
131
  if (!l || typeof l != "object") continue;
132
- const r = l, c = typeof r.label == "string" ? r.label : void 0, s = q(r.action, c);
133
- s && n.push(s);
132
+ const s = l, c = typeof s.label == "string" ? s.label : void 0, r = v(s.action, c);
133
+ r && n.push(r);
134
134
  }
135
135
  if (e.children) for (const l of e.children) {
136
- const r = t.elements[l];
137
- if (!r || r.type !== "ActionButton") continue;
138
- const c = typeof r.props?.label == "string" ? r.props.label : void 0, s = q(r.props?.action, c);
139
- s && n.push(s);
136
+ const s = t.elements[l];
137
+ if (!s || s.type !== "ActionButton") continue;
138
+ const c = typeof s.props?.label == "string" ? s.props.label : void 0, r = v(s.props?.action, c);
139
+ r && n.push(r);
140
140
  }
141
141
  const a = /* @__PURE__ */ new Set();
142
142
  return n.filter((l) => a.has(l.title) ? !1 : (a.add(l.title), !0));
143
143
  }
144
- var w = {
144
+ var L = {
145
145
  ButtonRow: ({ element: e, spec: t, context: n }) => {
146
- const o = I(e, t).map(k), i = e.props?.orientation, a = {
146
+ const o = C(e, t).map(E), i = e.props?.orientation, a = {
147
147
  actions: o,
148
148
  onAction: n.onAction,
149
149
  defaultCtaText: n.i18n.defaultCtaText,
150
150
  quickQuestionsAriaLabel: n.i18n.quickQuestionsAriaLabel
151
151
  };
152
- return n.onOpenChat !== void 0 && (a.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (a.ctaText = n.ctaText), (i === "horizontal" || i === "vertical") && (a.orientation = i), C(a);
152
+ return n.onOpenChat !== void 0 && (a.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (a.ctaText = n.ctaText), (i === "horizontal" || i === "vertical") && (a.orientation = i), T(a);
153
153
  },
154
154
  ActionButtons: ({ element: e, spec: t, context: n }) => {
155
155
  const o = {
156
- actions: I(e, t).map(k),
156
+ actions: C(e, t).map(E),
157
157
  onAction: n.onAction,
158
158
  defaultCtaText: n.i18n.defaultCtaText,
159
159
  quickQuestionsAriaLabel: n.i18n.quickQuestionsAriaLabel
160
160
  };
161
- return n.onOpenChat !== void 0 && (o.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (o.ctaText = n.ctaText), C(o);
161
+ return n.onOpenChat !== void 0 && (o.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (o.ctaText = n.ctaText), T(o);
162
162
  },
163
163
  ActionButton: ({ element: e, context: t }) => {
164
164
  const n = document.createElement("button");
165
165
  n.className = "gengage-qna-button gds-chip", n.type = "button", n.dataset.gengagePart = "qna-action-button";
166
166
  const o = e.props?.label;
167
167
  typeof o == "string" ? n.textContent = o : n.textContent = t.i18n.defaultCtaText;
168
- const i = q(e.props?.action, typeof o == "string" ? o : void 0);
168
+ const i = v(e.props?.action, typeof o == "string" ? o : void 0);
169
169
  return i && n.addEventListener("click", () => t.onAction(i)), n;
170
170
  },
171
171
  TextInput: ({ element: e, context: t }) => {
@@ -176,7 +176,7 @@ var w = {
176
176
  sendButtonText: t.i18n.sendButton,
177
177
  sendQuestionAriaLabel: t.i18n.sendQuestionAriaLabel
178
178
  };
179
- return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i), K(a);
179
+ return o !== void 0 && (a.placeholders = o), i !== void 0 && (a.ctaLabel = i), $(a);
180
180
  },
181
181
  QuestionHeading: ({ element: e, context: t }) => {
182
182
  const n = document.createElement("h3");
@@ -185,7 +185,7 @@ var w = {
185
185
  return n.textContent = typeof i == "string" && i.trim().length > 0 ? i : typeof o == "string" ? o : "", n;
186
186
  },
187
187
  ProductCard: () => null
188
- }, P = ({ element: e, renderElement: t }) => {
188
+ }, S = ({ element: e, renderElement: t }) => {
189
189
  if (!e.children || e.children.length === 0) return null;
190
190
  const n = document.createElement("div");
191
191
  for (const o of e.children) {
@@ -194,11 +194,11 @@ var w = {
194
194
  }
195
195
  return n;
196
196
  };
197
- function X() {
198
- return { ...w };
197
+ function G() {
198
+ return { ...L };
199
199
  }
200
- function tt(e, t, n = w, o = P) {
201
- return N({
200
+ function J(e, t, n = L, o = S) {
201
+ return Q({
202
202
  spec: e,
203
203
  context: t,
204
204
  registry: n,
@@ -206,7 +206,7 @@ function tt(e, t, n = w, o = P) {
206
206
  unknownRenderer: o
207
207
  });
208
208
  }
209
- function et(e) {
209
+ function V(e) {
210
210
  if (!e) return;
211
211
  const t = e.extra;
212
212
  if (t && typeof t == "object" && !Array.isArray(t)) {
@@ -219,7 +219,7 @@ function et(e) {
219
219
  const n = typeof e.sku == "string" && e.sku.trim() ? e.sku.trim() : void 0;
220
220
  return n ? [n] : void 0;
221
221
  }
222
- function x(e, t) {
222
+ function P(e, t) {
223
223
  if (!e) return null;
224
224
  const n = e.action;
225
225
  if (!n || typeof n != "object") return null;
@@ -227,13 +227,13 @@ function x(e, t) {
227
227
  if (typeof i != "string" || i.length === 0) return null;
228
228
  const a = o.title, l = typeof a == "string" && a.length > 0 ? a : typeof t == "string" && t.length > 0 ? t : "";
229
229
  if (!l) return null;
230
- const r = o.payload, c = {
230
+ const s = o.payload, c = {
231
231
  title: l,
232
232
  type: i
233
233
  };
234
- return r !== void 0 && (c.payload = r), c;
234
+ return s !== void 0 && (c.payload = s), c;
235
235
  }
236
- function nt(e, t) {
236
+ function Y(e, t) {
237
237
  const n = e.elements[e.root];
238
238
  if (!n) return !1;
239
239
  const o = (i) => {
@@ -241,7 +241,7 @@ function nt(e, t) {
241
241
  const a = i.props;
242
242
  if (!a || typeof a != "object") return !1;
243
243
  const l = typeof a.label == "string" ? a.label : void 0;
244
- return l === t ? !0 : x(a, l)?.title === t;
244
+ return l === t ? !0 : P(a, l)?.title === t;
245
245
  };
246
246
  if (n.type === "ActionButton") return o(n);
247
247
  if (n.children) for (const i of n.children) {
@@ -254,14 +254,14 @@ function nt(e, t) {
254
254
  }
255
255
  return !1;
256
256
  }
257
- var S = 0;
258
- function B() {
259
- return S += 1, `gengage-merge-${S}`;
257
+ var I = 0;
258
+ function w() {
259
+ return I += 1, `gengage-merge-${I}`;
260
260
  }
261
- function ot(e, t) {
261
+ function Z(e, t) {
262
262
  const n = e.elements[e.root];
263
263
  if (!n || n.type !== "ButtonRow") return;
264
- const o = B();
264
+ const o = w();
265
265
  e.elements[o] = {
266
266
  type: "ActionButton",
267
267
  props: {
@@ -274,10 +274,10 @@ function ot(e, t) {
274
274
  }
275
275
  }, n.children = n.children ? [o, ...n.children] : [o];
276
276
  }
277
- function it(e, t) {
277
+ function K(e, t) {
278
278
  const n = e.elements[e.root];
279
279
  if (!n || n.type !== "ActionButtons") return;
280
- const o = B();
280
+ const o = w();
281
281
  e.elements[o] = {
282
282
  type: "ActionButton",
283
283
  props: {
@@ -302,7 +302,7 @@ function it(e, t) {
302
302
  buttons: [a, ...i]
303
303
  };
304
304
  }
305
- function at(e) {
305
+ function X(e) {
306
306
  const t = {}, n = [];
307
307
  for (let o = 0; o < e.length; o++) {
308
308
  const i = e[o], a = `action-${o}`;
@@ -326,13 +326,13 @@ function at(e) {
326
326
  elements: t
327
327
  };
328
328
  }
329
- function st(e) {
329
+ function tt(e) {
330
330
  return e.find((t) => {
331
331
  const n = t.elements[t.root];
332
332
  return n?.type === "ActionButtons" || n?.type === "ButtonRow";
333
333
  });
334
334
  }
335
- function L(e, t) {
335
+ function k(e, t) {
336
336
  const n = e.productContextQuickPillLabel, o = { text: n };
337
337
  return t && t.length > 0 && (o.sku_list = t), {
338
338
  title: n,
@@ -340,29 +340,29 @@ function L(e, t) {
340
340
  payload: o
341
341
  };
342
342
  }
343
- function rt(e, t, n) {
343
+ function et(e, t, n) {
344
344
  const o = n?.skuList, i = [], a = [];
345
345
  for (const c of e) {
346
- const s = c.elements[c.root];
347
- if (s?.type === "ActionButton") {
348
- const d = s.props;
349
- if (x(d, typeof d?.label == "string" ? d.label : void 0)?.type === "findSimilar") {
350
- i.push(L(t, o));
346
+ const r = c.elements[c.root];
347
+ if (r?.type === "ActionButton") {
348
+ const u = r.props;
349
+ if (P(u, typeof u?.label == "string" ? u.label : void 0)?.type === "findSimilar") {
350
+ i.push(k(t, o));
351
351
  continue;
352
352
  }
353
353
  }
354
354
  a.push(c);
355
355
  }
356
356
  if (i.length === 0) return e;
357
- const l = L(t, o), r = st(a);
358
- if (!r) return [...a, at([l])];
359
- if (!nt(r, l.title)) {
360
- const c = r.elements[r.root];
361
- c?.type === "ActionButtons" ? it(r, l) : c?.type === "ButtonRow" && ot(r, l);
357
+ const l = k(t, o), s = tt(a);
358
+ if (!s) return [...a, X([l])];
359
+ if (!Y(s, l.title)) {
360
+ const c = s.elements[s.root];
361
+ c?.type === "ActionButtons" ? K(s, l) : c?.type === "ButtonRow" && Z(s, l);
362
362
  }
363
363
  return a;
364
364
  }
365
- var R = {
365
+ var B = {
366
366
  quickQuestionsAriaLabel: "Hızlı sorular",
367
367
  askQuestionAriaLabel: "Soru sorun",
368
368
  defaultInputPlaceholder: "Bir soru sorun...",
@@ -371,7 +371,7 @@ var R = {
371
371
  defaultCtaText: "Başka bir şey sor",
372
372
  redirectingToChat: "Sohbete yönlendiriliyor...",
373
373
  productContextQuickPillLabel: "Bu ürün hakkında ne bilmeliyim?"
374
- }, lt = {
374
+ }, nt = {
375
375
  quickQuestionsAriaLabel: "Quick questions",
376
376
  askQuestionAriaLabel: "Ask a question",
377
377
  defaultInputPlaceholder: "Ask a question...",
@@ -381,25 +381,25 @@ var R = {
381
381
  redirectingToChat: "Redirecting to chat...",
382
382
  productContextQuickPillLabel: "What should I know about this product?"
383
383
  };
384
- function ct(e) {
384
+ function ot(e) {
385
385
  return e ? e.toLowerCase().split("-")[0] ?? "tr" : "tr";
386
386
  }
387
- function dt(e) {
388
- return ct(e) === "en" ? lt : R;
387
+ function it(e) {
388
+ return ot(e) === "en" ? nt : B;
389
389
  }
390
- var ut = class extends W {
390
+ var at = class extends W {
391
391
  constructor(...e) {
392
- super(...e), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = R, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
392
+ super(...e), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n = B, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
393
393
  }
394
394
  async onInit(e) {
395
- this._i18n = this._resolveI18n(e), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = T(e.locale);
395
+ this._i18n = this._resolveI18n(e), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = A(e.locale);
396
396
  const t = this._createChrome(e);
397
397
  if (t) {
398
398
  const o = document.createElement("div");
399
399
  o.className = "gengage-qna-chrome-widget", o.dataset.gengagePart = "qna-chrome-widget", o.appendChild(this._contentEl), t.appendChild(o), this.root.appendChild(t);
400
400
  } else this.root.appendChild(this._contentEl);
401
401
  const n = e.pageContext?.sku;
402
- n && (this._lastSku = n, await this._fetchAndRender(n)), V("qna");
402
+ n && (this._lastSku = n, await this._fetchAndRender(n)), M("qna");
403
403
  }
404
404
  onUpdate(e) {
405
405
  const t = e.sku;
@@ -436,88 +436,68 @@ var ut = class extends W {
436
436
  this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
437
437
  const t = this._createLoadingIndicator();
438
438
  this._contentEl.appendChild(t);
439
- const n = { middlewareUrl: this.config.middlewareUrl }, o = crypto.randomUUID(), i = Date.now(), a = Y({
439
+ const n = { middlewareUrl: this.config.middlewareUrl }, o = D({
440
440
  source: "qna",
441
441
  locale: this.config.locale
442
442
  });
443
- this.track(z(this.analyticsContext(), {
444
- endpoint: "launcher_action",
445
- request_id: o,
446
- widget: "qna"
447
- }));
448
443
  try {
449
- const l = this.config.session?.sessionId ?? "", r = {
444
+ const i = this.config.session?.sessionId ?? "", a = {
450
445
  account_id: this.config.accountId,
451
- session_id: l,
452
- correlation_id: l,
446
+ session_id: i,
447
+ correlation_id: i,
453
448
  sku: e,
454
- locale: T(this.config.locale)
449
+ locale: A(this.config.locale)
455
450
  };
456
- this.config.session?.userId !== void 0 && (r.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (r.view_id = this.config.session.viewId);
457
- const c = this.config.pageContext?.pageType;
458
- c !== void 0 && (r.page_type = c);
459
- const s = await Z(r, n, this._abortController.signal);
460
- if (this.track(D(this.analyticsContext(), {
461
- request_id: o,
462
- latency_ms: Date.now() - i,
463
- chunk_count: s.actions.length,
464
- widget: "qna"
465
- })), this.track(M(this.analyticsContext(), {
466
- message_count: s.actions.length,
467
- history_ref: o,
468
- redaction_level: "none",
469
- widget: "qna"
470
- })), !this._contentEl) return;
451
+ this.config.session?.userId !== void 0 && (a.user_id = this.config.session.userId), this.config.session?.viewId !== void 0 && (a.view_id = this.config.session.viewId);
452
+ const l = this.config.pageContext?.pageType;
453
+ l !== void 0 && (a.page_type = l);
454
+ const s = await z(a, n, this._abortController.signal);
455
+ if (!this._contentEl) return;
471
456
  this._contentEl.innerHTML = "";
472
- const d = document.createElement("div");
473
- d.className = "gengage-qna-panel gds-panel", d.dataset.gengagePart = "qna-panel", this._contentEl.appendChild(d);
474
- const b = this._specIncludesType(s.uiSpecs, "QuestionHeading"), f = this._resolvedQnaHeaderTitle() ?? (this.config.showStaticQuestion && this.config.staticQuestionText ? this.config.staticQuestionText : void 0);
475
- if (!b && f) {
476
- const h = document.createElement("h3");
477
- h.className = "gengage-qna-heading", h.textContent = f, d.appendChild(h);
457
+ const c = document.createElement("div");
458
+ c.className = "gengage-qna-panel gds-panel", c.dataset.gengagePart = "qna-panel", this._contentEl.appendChild(c);
459
+ const r = this._specIncludesType(s.uiSpecs, "QuestionHeading"), u = this._resolvedQnaHeaderTitle() ?? (this.config.showStaticQuestion && this.config.staticQuestionText ? this.config.staticQuestionText : void 0);
460
+ if (!r && u) {
461
+ const d = document.createElement("h3");
462
+ d.className = "gengage-qna-heading", d.textContent = u, c.appendChild(d);
478
463
  }
479
464
  const m = this.config.inputPlaceholder;
480
- let p;
481
- if (m !== !0) p = m ?? this._i18n.defaultInputPlaceholder;
465
+ let g;
466
+ if (m !== !0) g = m ?? this._i18n.defaultInputPlaceholder;
482
467
  else if (s.actions.length > 0) {
483
- const h = s.actions.filter((_) => _.type === "user_message" || _.title.includes("?")).map((_) => _.title);
484
- p = h.length > 0 ? h : this._i18n.defaultInputPlaceholder;
485
- } else p = this._i18n.defaultInputPlaceholder;
486
- const u = {
468
+ const d = s.actions.filter((_) => _.type === "user_message" || _.title.includes("?")).map((_) => _.title);
469
+ g = d.length > 0 ? d : this._i18n.defaultInputPlaceholder;
470
+ } else g = this._i18n.defaultInputPlaceholder;
471
+ const h = {
487
472
  onAction: this._actionHandler,
488
473
  i18n: this._i18n
489
- }, y = this._resolvedQnaHeaderTitle();
490
- y !== void 0 && (u.headingTitleOverride = y), this.config.hideButtonRowCta || (u.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (u.ctaText = this.config.ctaText)), p !== void 0 && (u.inputPlaceholder = p);
491
- const v = this._buildFallbackActionsSpec(s.actions), g = et(this.config.pageContext), A = (s.uiSpecs.length > 0 ? rt(s.uiSpecs, this._i18n, { skuList: g }) : [v]).filter((h) => Object.keys(h.elements).length > 0);
492
- for (const h of A) {
493
- const _ = this._renderUISpec(h, u);
494
- d.appendChild(_);
474
+ }, f = this._resolvedQnaHeaderTitle();
475
+ f !== void 0 && (h.headingTitleOverride = f), this.config.hideButtonRowCta || (h.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (h.ctaText = this.config.ctaText)), g !== void 0 && (h.inputPlaceholder = g);
476
+ const p = this._buildFallbackActionsSpec(s.actions), y = V(this.config.pageContext), b = (s.uiSpecs.length > 0 ? et(s.uiSpecs, this._i18n, { skuList: y }) : [p]).filter((d) => Object.keys(d.elements).length > 0);
477
+ for (const d of b) {
478
+ const _ = this._renderUISpec(d, h);
479
+ c.appendChild(_);
495
480
  }
496
- A.length > 0 && J("qna"), this._specIncludesType(A, "TextInput") || this._insertStandaloneInputBeforePills(d, u, p);
497
- } catch (l) {
498
- if (l instanceof DOMException && l.name === "AbortError") return;
499
- if (E("gengage:global:error", {
481
+ b.length > 0 && j("qna"), this._specIncludesType(b, "TextInput") || this._insertStandaloneInputBeforePills(c, h, g);
482
+ } catch (i) {
483
+ if (i instanceof DOMException && i.name === "AbortError") return;
484
+ if (q("gengage:global:error", {
500
485
  source: "qna",
501
486
  code: "FETCH_ERROR",
502
- message: F(this.config.locale, l)
503
- }), this.track(j(this.analyticsContext(), {
504
- request_id: o,
505
- error_code: "FETCH_ERROR",
506
- error_message: l instanceof Error ? l.message : String(l),
507
- widget: "qna"
508
- })), this._contentEl) {
487
+ message: F(this.config.locale, i)
488
+ }), this._contentEl) {
509
489
  this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
510
- const r = document.createElement("div");
511
- r.className = "gengage-qna-panel", this._contentEl.appendChild(r);
512
- const c = this.config.inputPlaceholder === !0 ? this._i18n.defaultInputPlaceholder : this.config.inputPlaceholder ?? this._i18n.defaultInputPlaceholder, s = {
490
+ const a = document.createElement("div");
491
+ a.className = "gengage-qna-panel", this._contentEl.appendChild(a);
492
+ const l = this.config.inputPlaceholder === !0 ? this._i18n.defaultInputPlaceholder : this.config.inputPlaceholder ?? this._i18n.defaultInputPlaceholder, s = {
513
493
  onAction: this._actionHandler,
514
494
  i18n: this._i18n,
515
495
  onOpenChat: this._openChatHandler
516
- }, d = this._resolvedQnaHeaderTitle();
517
- d !== void 0 && (s.headingTitleOverride = d), this.config.ctaText !== void 0 && (s.ctaText = this.config.ctaText), this._appendStandaloneInput(s, c, r);
496
+ }, c = this._resolvedQnaHeaderTitle();
497
+ c !== void 0 && (s.headingTitleOverride = c), this.config.ctaText !== void 0 && (s.ctaText = this.config.ctaText), this._appendStandaloneInput(s, l, a);
518
498
  }
519
499
  } finally {
520
- a();
500
+ o();
521
501
  }
522
502
  }
523
503
  _createLoadingIndicator() {
@@ -531,41 +511,41 @@ var ut = class extends W {
531
511
  }
532
512
  _resolveI18n(e) {
533
513
  return {
534
- ...dt(e.locale),
514
+ ...it(e.locale),
535
515
  ...e.i18n
536
516
  };
537
517
  }
538
518
  _createChrome(e) {
539
519
  const t = e.chrome;
540
520
  if (!t) return null;
541
- const n = typeof t.title == "string" ? t.title.trim() : "", o = typeof t.subtitle == "string" ? t.subtitle.trim() : "", i = typeof t.startButtonLabel == "string" ? t.startButtonLabel.trim() : "", a = typeof t.imageUrl == "string" ? t.imageUrl.trim() : "", l = typeof t.imagePadding == "string" ? t.imagePadding.trim() : "", r = document.createElement("section");
542
- r.className = "gengage-qna-chrome", r.dataset.gengagePart = "qna-chrome", t.layout === "side-image" && (r.classList.add("gengage-qna-chrome--side-image"), r.dataset.gengageChromeLayout = "side-image"), l && r.style.setProperty("--gengage-qna-chrome-image-padding", l);
521
+ const n = typeof t.title == "string" ? t.title.trim() : "", o = typeof t.subtitle == "string" ? t.subtitle.trim() : "", i = typeof t.startButtonLabel == "string" ? t.startButtonLabel.trim() : "", a = typeof t.imageUrl == "string" ? t.imageUrl.trim() : "", l = typeof t.imagePadding == "string" ? t.imagePadding.trim() : "", s = document.createElement("section");
522
+ s.className = "gengage-qna-chrome", s.dataset.gengagePart = "qna-chrome", t.layout === "side-image" && (s.classList.add("gengage-qna-chrome--side-image"), s.dataset.gengageChromeLayout = "side-image"), l && s.style.setProperty("--gengage-qna-chrome-image-padding", l);
543
523
  const c = document.createElement("div");
544
524
  if (c.className = "gengage-qna-chrome-copy", c.dataset.gengagePart = "qna-chrome-copy", n) {
545
- const s = document.createElement("h2");
546
- s.className = "gengage-qna-chrome-title", s.dataset.gengagePart = "qna-chrome-title", s.textContent = n, c.appendChild(s);
525
+ const r = document.createElement("h2");
526
+ r.className = "gengage-qna-chrome-title", r.dataset.gengagePart = "qna-chrome-title", r.textContent = n, c.appendChild(r);
547
527
  }
548
528
  if (o) {
549
- const s = document.createElement("p");
550
- s.className = "gengage-qna-chrome-subtitle", s.dataset.gengagePart = "qna-chrome-subtitle", s.textContent = o, c.appendChild(s);
529
+ const r = document.createElement("p");
530
+ r.className = "gengage-qna-chrome-subtitle", r.dataset.gengagePart = "qna-chrome-subtitle", r.textContent = o, c.appendChild(r);
551
531
  }
552
- if (c.children.length > 0 && r.appendChild(c), a && $(a)) {
553
- const s = document.createElement("img");
554
- s.className = "gengage-qna-chrome-image", s.dataset.gengagePart = "qna-chrome-image", s.src = a, s.alt = typeof t.imageAlt == "string" ? t.imageAlt : "", s.loading = "lazy", s.addEventListener("error", () => {
555
- s.style.display = "none";
556
- }, { once: !0 }), r.appendChild(s);
532
+ if (c.children.length > 0 && s.appendChild(c), a && O(a)) {
533
+ const r = document.createElement("img");
534
+ r.className = "gengage-qna-chrome-image", r.dataset.gengagePart = "qna-chrome-image", r.src = a, r.alt = typeof t.imageAlt == "string" ? t.imageAlt : "", r.loading = "lazy", r.addEventListener("error", () => {
535
+ r.style.display = "none";
536
+ }, { once: !0 }), s.appendChild(r);
557
537
  }
558
538
  if (i) {
559
- const s = document.createElement("button");
560
- s.className = "gengage-qna-chrome-start", s.dataset.gengagePart = "qna-chrome-start", s.type = "button", s.textContent = i, s.addEventListener("click", () => this._handleOpenChat()), r.appendChild(s);
539
+ const r = document.createElement("button");
540
+ r.className = "gengage-qna-chrome-start", r.dataset.gengagePart = "qna-chrome-start", r.type = "button", r.textContent = i, r.addEventListener("click", () => this._handleOpenChat()), s.appendChild(r);
561
541
  }
562
- return r.children.length === 0 ? null : r;
542
+ return s.children.length === 0 ? null : s;
563
543
  }
564
544
  _resolveUISpecRegistry() {
565
- return H(X(), this.config.renderer?.registry);
545
+ return R(G(), this.config.renderer?.registry);
566
546
  }
567
547
  _renderUISpec(e, t) {
568
- const n = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? P, i = (l, r) => tt(l, r, n, o), a = this.config.renderer?.renderUISpec;
548
+ const n = this._resolveUISpecRegistry(), o = this.config.renderer?.unknownRenderer ?? S, i = (l, s) => J(l, s, n, o), a = this.config.renderer?.renderUISpec;
569
549
  return a ? a(e, t, {
570
550
  registry: n,
571
551
  unknownRenderer: o,
@@ -613,11 +593,11 @@ var ut = class extends W {
613
593
  } }
614
594
  }, i = this._renderUISpec(o, t), a = i.querySelector(".gengage-qna-input-wrapper");
615
595
  if (!a) return;
616
- const l = e.querySelector(".gengage-qna-uispec"), r = e.querySelector(".gengage-qna-uispec > .gengage-qna-buttons"), c = this.config.inputAfterPills === !0;
617
- if (r) c ? r.insertAdjacentElement("afterend", a) : r.insertAdjacentElement("beforebegin", a);
596
+ const l = e.querySelector(".gengage-qna-uispec"), s = e.querySelector(".gengage-qna-uispec > .gengage-qna-buttons"), c = this.config.inputAfterPills === !0;
597
+ if (s) c ? s.insertAdjacentElement("afterend", a) : s.insertAdjacentElement("beforebegin", a);
618
598
  else if (l) {
619
- const s = l.querySelector(":scope > .gengage-qna-heading");
620
- !c && s ? s.insertAdjacentElement("afterend", a) : l.appendChild(a);
599
+ const r = l.querySelector(":scope > .gengage-qna-heading");
600
+ !c && r ? r.insertAdjacentElement("afterend", a) : l.appendChild(a);
621
601
  } else {
622
602
  e.appendChild(i);
623
603
  return;
@@ -636,10 +616,10 @@ var ut = class extends W {
636
616
  (n ?? this._contentEl).appendChild(i);
637
617
  }
638
618
  _handleAction(e) {
639
- this._showTransitionIndicator(), G(e.title, e.type), this.config.onActionSelected?.(e), setTimeout(() => E("gengage:qna:action", e), 350);
619
+ this._showTransitionIndicator(), U(e.title, e.type), this.config.onActionSelected?.(e), setTimeout(() => q("gengage:qna:action", e), 350);
640
620
  }
641
621
  _handleOpenChat() {
642
- this._showTransitionIndicator(), this.config.onOpenChat?.(), setTimeout(() => E("gengage:qna:open-chat", {}), 350);
622
+ this._showTransitionIndicator(), this.config.onOpenChat?.(), setTimeout(() => q("gengage:qna:open-chat", {}), 350);
643
623
  }
644
624
  _showTransitionIndicator() {
645
625
  if (!this._contentEl) return;
@@ -650,13 +630,13 @@ var ut = class extends W {
650
630
  }, 600);
651
631
  }
652
632
  };
653
- function yt() {
654
- return new ut();
633
+ function ut() {
634
+ return new at();
655
635
  }
656
636
  export {
657
- tt as a,
658
- P as i,
659
- yt as n,
660
- X as r,
661
- ut as t
637
+ J as a,
638
+ S as i,
639
+ ut as n,
640
+ G as r,
641
+ at as t
662
642
  };