@gengage/assistant-fe 0.6.50 → 0.7.1
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.
- package/dist/chat/api.d.ts +1 -1
- package/dist/chat/components/ChatDrawer.d.ts +4 -1
- package/dist/chat/features/beauty-consulting/mode-controller.d.ts +1 -1
- package/dist/chat/features/beauty-consulting/stream-handler.d.ts +7 -1
- package/dist/chat/history-storage.d.ts +36 -4
- package/dist/chat/runtime.d.ts +2 -2
- package/dist/chat/utils/chat-presentation-debug.d.ts +0 -14
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +56 -56
- package/dist/chat.js +1 -1
- package/dist/common/connection-warning.d.ts +10 -0
- package/dist/common/indexed-db.d.ts +35 -2
- package/dist/common/native-webview.d.ts +1 -1
- package/dist/common/streaming.d.ts +6 -1
- package/dist/common/transport.d.ts +2 -1
- package/dist/common/types.d.ts +16 -0
- package/dist/{common-DJFI5t11.js → common-CW6814pZ.js} +61 -65
- package/dist/common.js +30 -30
- package/dist/{connection-warning-TXqyeFaf.js → connection-warning-C0e2byq5.js} +31 -25
- package/dist/{fastIntent-539wPavr.js → fastIntent-CJGhUTpS.js} +2 -2
- package/dist/global-error-toast-DvaKvPNA.js +798 -0
- package/dist/index.js +29 -29
- package/dist/native-webview-CHKpwixw.js +303 -0
- package/dist/native.iife.js +27 -27
- package/dist/native.js +1 -1
- package/dist/{overlay-BPZEIyo_.js → overlay-C3XzoSKd.js} +51 -32
- package/dist/overlay.js +6 -6
- package/dist/{price-formatter-CHUmYq8I.js → price-formatter-Q3wUKrl1.js} +2 -1
- package/dist/qna/runtime.d.ts +1 -0
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +32 -32
- package/dist/qna.js +1 -1
- package/dist/{request-response-cache-DwADBDeB.js → request-response-cache-DItrp4fO.js} +478 -454
- package/dist/{runtime-9f9SB4WE.js → runtime-B9m0kyTB.js} +2796 -2697
- package/dist/{runtime-Do3qShrH.js → runtime-CZ363BP8.js} +231 -219
- package/dist/{runtime-rTw1jMhB.js → runtime-DKkw_dca.js} +230 -212
- package/dist/{simbut-DlWvDoPI.js → simbut-D_j8YgHS.js} +5 -5
- package/dist/simbut.iife.js +2 -2
- package/dist/simbut.js +1 -1
- package/dist/simrel/components/GroupTabs.d.ts +6 -0
- package/dist/simrel/runtime.d.ts +8 -0
- package/dist/{simrel-BFPU2n5p.js → simrel-BkAtQjNa.js} +15 -15
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +22 -22
- package/dist/simrel.js +2 -2
- package/dist/widget-base-BnUjuCt7.js +141 -0
- package/package.json +1 -1
- package/dist/context-UTzCGyR9.js +0 -543
- package/dist/native-webview-CYX30O3Q.js +0 -273
- package/dist/widget-base-BwU6SI2o.js +0 -365
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
async function
|
|
7
|
-
const
|
|
1
|
+
import { f as B, g as x, i as Q, m as R, n as N, t as H } from "./request-response-cache-DItrp4fO.js";
|
|
2
|
+
import { L as O, N as U, P as j, T as M, f as T, n as F } from "./global-error-toast-DvaKvPNA.js";
|
|
3
|
+
import { t as W } from "./widget-base-BnUjuCt7.js";
|
|
4
|
+
import { t as q } from "./locale-uQ5XZ2yS.js";
|
|
5
|
+
import { r as z } from "./connection-warning-C0e2byq5.js";
|
|
6
|
+
async function D(t, e, n) {
|
|
7
|
+
const i = N("launcher_action", e), o = {
|
|
8
8
|
uiSpecs: [],
|
|
9
9
|
actions: []
|
|
10
10
|
}, a = {
|
|
@@ -13,31 +13,37 @@ async function $(t, e, n) {
|
|
|
13
13
|
body: JSON.stringify(t)
|
|
14
14
|
};
|
|
15
15
|
n !== void 0 && (a.signal = n);
|
|
16
|
-
const l = await
|
|
16
|
+
const l = await H(i, a);
|
|
17
17
|
if (!l.ok) throw new Error(`HTTP ${l.status}: ${l.statusText}`);
|
|
18
18
|
const s = { onEvent: (c) => {
|
|
19
|
-
const r =
|
|
20
|
-
if (r && (r.type === "ui_spec" &&
|
|
19
|
+
const r = Q(c);
|
|
20
|
+
if (r && (r.type === "ui_spec" && o.uiSpecs.push(r.spec), r.type === "ui_spec" && r.spec.elements)) {
|
|
21
21
|
for (const u of Object.values(r.spec.elements)) if (u.type === "ActionButton" && u.props?.action) {
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const h = u.props.action;
|
|
23
|
+
if (typeof h.title == "string" && typeof h.type == "string") {
|
|
24
|
+
const p = {
|
|
25
|
+
title: h.title,
|
|
26
|
+
type: h.type
|
|
27
|
+
};
|
|
28
|
+
h.payload !== void 0 && (p.payload = h.payload), o.actions.push(p);
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
} };
|
|
27
|
-
return n !== void 0 && (s.signal = n), await
|
|
33
|
+
return n !== void 0 && (s.signal = n), await B(l, s), o;
|
|
28
34
|
}
|
|
29
|
-
function
|
|
35
|
+
function A(t) {
|
|
30
36
|
const e = document.createElement("div");
|
|
31
37
|
e.className = "gengage-qna-buttons gds-toolbar", e.dataset.gengagePart = "qna-button-row", e.setAttribute("role", "group"), e.setAttribute("aria-label", t.quickQuestionsAriaLabel ?? "Quick questions"), t.orientation === "vertical" && (e.style.flexDirection = "column");
|
|
32
38
|
for (const n of t.actions) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
39
|
+
const i = document.createElement("button");
|
|
40
|
+
i.className = "gengage-qna-button gds-chip", i.dataset.gengagePart = "qna-quick-question", i.textContent = n.title, i.type = "button", i.addEventListener("click", () => {
|
|
41
|
+
const o = {
|
|
36
42
|
title: n.title,
|
|
37
43
|
type: n.type
|
|
38
44
|
};
|
|
39
|
-
n.payload !== void 0 && (
|
|
40
|
-
}), e.appendChild(
|
|
45
|
+
n.payload !== void 0 && (o.payload = n.payload), t.onAction(o);
|
|
46
|
+
}), e.appendChild(i);
|
|
41
47
|
}
|
|
42
48
|
if (t.ctaText || t.onOpenChat) {
|
|
43
49
|
const n = document.createElement("button");
|
|
@@ -47,69 +53,69 @@ function T(t) {
|
|
|
47
53
|
}
|
|
48
54
|
return e;
|
|
49
55
|
}
|
|
50
|
-
function
|
|
56
|
+
function $(t) {
|
|
51
57
|
const e = document.createElement("div");
|
|
52
58
|
e.className = "gengage-qna-input-wrapper", e.dataset.gengagePart = "qna-input-wrapper";
|
|
53
59
|
const n = document.createElement("div");
|
|
54
60
|
n.className = "gengage-qna-input-combo", n.dataset.gengagePart = "qna-input-combo";
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
let a = 0, l =
|
|
59
|
-
|
|
61
|
+
const i = document.createElement("input");
|
|
62
|
+
i.type = "text", i.className = "gengage-qna-input", i.dataset.gengagePart = "qna-input", i.setAttribute("aria-label", t.askQuestionAriaLabel ?? "Ask a question");
|
|
63
|
+
const o = Array.isArray(t.placeholders) ? t.placeholders : t.placeholders ? [t.placeholders] : [t.defaultInputPlaceholder ?? "Ask a question..."];
|
|
64
|
+
let a = 0, l = o[0] ?? "";
|
|
65
|
+
i.placeholder = l;
|
|
60
66
|
let s = null, c = null, r = !1;
|
|
61
67
|
const u = () => {
|
|
62
|
-
s && clearInterval(s), s = null, c && clearTimeout(c), c = null,
|
|
63
|
-
},
|
|
64
|
-
u(),
|
|
65
|
-
|
|
66
|
-
a = (a + 1) %
|
|
68
|
+
s && clearInterval(s), s = null, c && clearTimeout(c), c = null, i.classList.remove("gengage-qna-input--fade");
|
|
69
|
+
}, h = () => o.length > 1 && !r && i.value.trim().length === 0, p = () => {
|
|
70
|
+
u(), h() && (s = setInterval(() => {
|
|
71
|
+
h() && (i.classList.add("gengage-qna-input--fade"), c = setTimeout(() => {
|
|
72
|
+
a = (a + 1) % o.length, l = o[a] ?? "", i.placeholder = l, i.classList.remove("gengage-qna-input--fade");
|
|
67
73
|
}, 180));
|
|
68
74
|
}, 3e3));
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
+
}, f = document.createElement("div");
|
|
76
|
+
f.className = "gengage-qna-input-actions", f.dataset.gengagePart = "qna-input-actions";
|
|
77
|
+
const m = document.createElement("button");
|
|
78
|
+
m.className = "gengage-qna-icon-btn gengage-qna-clear gengage-qna-icon-btn--hidden", m.type = "button", m.dataset.gengagePart = "qna-clear", m.setAttribute("aria-label", "Clear question"), m.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M18 6L6 18" /><path d="M6 6L18 18" /></svg>';
|
|
79
|
+
const g = document.createElement("button");
|
|
80
|
+
g.className = "gengage-qna-icon-btn gengage-qna-send gengage-qna-icon-btn--hidden", g.type = "button", g.dataset.gengagePart = "qna-send", g.setAttribute("aria-label", t.sendQuestionAriaLabel ?? "Send question"), g.disabled = !0, g.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">${t.ctaLabel ?? t.sendButtonText ?? "Ask"}</span>`;
|
|
75
81
|
const y = () => {
|
|
76
|
-
const d =
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
const d =
|
|
82
|
+
const d = i.value.trim().length > 0;
|
|
83
|
+
m.classList.toggle("gengage-qna-icon-btn--hidden", !d), g.classList.toggle("gengage-qna-icon-btn--hidden", !d), g.classList.toggle("gengage-qna-send--active", d), g.disabled = !d;
|
|
84
|
+
}, _ = () => {
|
|
85
|
+
const d = i.value.trim();
|
|
80
86
|
d && (t.onSubmit({
|
|
81
87
|
title: d,
|
|
82
88
|
type: "user_message",
|
|
83
89
|
payload: d
|
|
84
|
-
}),
|
|
90
|
+
}), i.value = "", y(), p());
|
|
85
91
|
};
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
}),
|
|
89
|
-
r = !0, u(),
|
|
90
|
-
}),
|
|
91
|
-
r = !1,
|
|
92
|
-
}),
|
|
93
|
-
if (y(),
|
|
92
|
+
return m.addEventListener("click", () => {
|
|
93
|
+
i.value = "", y(), i.focus({ preventScroll: !0 });
|
|
94
|
+
}), g.addEventListener("click", _), i.addEventListener("focus", () => {
|
|
95
|
+
r = !0, u(), i.placeholder = "";
|
|
96
|
+
}), i.addEventListener("blur", () => {
|
|
97
|
+
r = !1, i.value.trim().length === 0 && (i.placeholder = l), p();
|
|
98
|
+
}), i.addEventListener("input", () => {
|
|
99
|
+
if (y(), i.value.trim().length > 0) {
|
|
94
100
|
u();
|
|
95
101
|
return;
|
|
96
102
|
}
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
d.key === "Enter" && (d.preventDefault(),
|
|
100
|
-
}),
|
|
103
|
+
i.placeholder = r ? "" : l, p();
|
|
104
|
+
}), i.addEventListener("keydown", (d) => {
|
|
105
|
+
d.key === "Enter" && (d.preventDefault(), _()), d.key === "Escape" && i.value.length > 0 && (i.value = "", y(), p());
|
|
106
|
+
}), f.appendChild(m), f.appendChild(g), n.appendChild(i), n.appendChild(f), e.appendChild(n), y(), p(), e._cleanup = () => {
|
|
101
107
|
u();
|
|
102
108
|
}, e;
|
|
103
109
|
}
|
|
104
110
|
function v(t, e) {
|
|
105
111
|
if (!t || typeof t != "object") return null;
|
|
106
|
-
const n = t,
|
|
107
|
-
if (typeof
|
|
108
|
-
const
|
|
112
|
+
const n = t, i = n.type;
|
|
113
|
+
if (typeof i != "string" || i.length === 0) return null;
|
|
114
|
+
const o = n.title, a = n.payload, l = typeof o == "string" && o.length > 0 ? o : e;
|
|
109
115
|
if (!l) return null;
|
|
110
116
|
const s = {
|
|
111
117
|
title: l,
|
|
112
|
-
type:
|
|
118
|
+
type: i
|
|
113
119
|
};
|
|
114
120
|
return a !== void 0 && (s.payload = a), s;
|
|
115
121
|
}
|
|
@@ -121,13 +127,13 @@ function E(t) {
|
|
|
121
127
|
return t.payload !== void 0 && (e.payload = t.payload), e;
|
|
122
128
|
}
|
|
123
129
|
function C(t, e) {
|
|
124
|
-
const n = [],
|
|
125
|
-
if (Array.isArray(
|
|
130
|
+
const n = [], i = t.props?.actions;
|
|
131
|
+
if (Array.isArray(i)) for (const l of i) {
|
|
126
132
|
const s = v(l);
|
|
127
133
|
s && n.push(s);
|
|
128
134
|
}
|
|
129
|
-
const
|
|
130
|
-
if (Array.isArray(
|
|
135
|
+
const o = t.props?.buttons;
|
|
136
|
+
if (Array.isArray(o)) for (const l of o) {
|
|
131
137
|
if (!l || typeof l != "object") continue;
|
|
132
138
|
const s = l, c = typeof s.label == "string" ? s.label : void 0, r = v(s.action, c);
|
|
133
139
|
r && n.push(r);
|
|
@@ -141,128 +147,128 @@ function C(t, e) {
|
|
|
141
147
|
const a = /* @__PURE__ */ new Set();
|
|
142
148
|
return n.filter((l) => a.has(l.title) ? !1 : (a.add(l.title), !0));
|
|
143
149
|
}
|
|
144
|
-
var
|
|
150
|
+
var I = {
|
|
145
151
|
ButtonRow: ({ element: t, spec: e, context: n }) => {
|
|
146
|
-
const
|
|
147
|
-
actions:
|
|
152
|
+
const i = C(t, e).map(E), o = t.props?.orientation, a = {
|
|
153
|
+
actions: i,
|
|
148
154
|
onAction: n.onAction,
|
|
149
155
|
defaultCtaText: n.i18n.defaultCtaText,
|
|
150
156
|
quickQuestionsAriaLabel: n.i18n.quickQuestionsAriaLabel
|
|
151
157
|
};
|
|
152
|
-
return n.onOpenChat !== void 0 && (a.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (a.ctaText = n.ctaText), (
|
|
158
|
+
return n.onOpenChat !== void 0 && (a.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (a.ctaText = n.ctaText), (o === "horizontal" || o === "vertical") && (a.orientation = o), A(a);
|
|
153
159
|
},
|
|
154
160
|
ActionButtons: ({ element: t, spec: e, context: n }) => {
|
|
155
|
-
const
|
|
161
|
+
const i = {
|
|
156
162
|
actions: C(t, e).map(E),
|
|
157
163
|
onAction: n.onAction,
|
|
158
164
|
defaultCtaText: n.i18n.defaultCtaText,
|
|
159
165
|
quickQuestionsAriaLabel: n.i18n.quickQuestionsAriaLabel
|
|
160
166
|
};
|
|
161
|
-
return n.onOpenChat !== void 0 && (
|
|
167
|
+
return n.onOpenChat !== void 0 && (i.onOpenChat = n.onOpenChat), n.ctaText !== void 0 && (i.ctaText = n.ctaText), A(i);
|
|
162
168
|
},
|
|
163
169
|
ActionButton: ({ element: t, context: e }) => {
|
|
164
170
|
const n = document.createElement("button");
|
|
165
171
|
n.className = "gengage-qna-button gds-chip", n.type = "button", n.dataset.gengagePart = "qna-action-button";
|
|
166
|
-
const
|
|
167
|
-
typeof
|
|
168
|
-
const
|
|
169
|
-
return
|
|
172
|
+
const i = t.props?.label;
|
|
173
|
+
typeof i == "string" ? n.textContent = i : n.textContent = e.i18n.defaultCtaText;
|
|
174
|
+
const o = v(t.props?.action, typeof i == "string" ? i : void 0);
|
|
175
|
+
return o && n.addEventListener("click", () => e.onAction(o)), n;
|
|
170
176
|
},
|
|
171
177
|
TextInput: ({ element: t, context: e }) => {
|
|
172
|
-
const n = t.props?.placeholder,
|
|
178
|
+
const n = t.props?.placeholder, i = typeof n == "string" || Array.isArray(n) ? n : e.inputPlaceholder, o = typeof t.props?.ctaLabel == "string" ? t.props.ctaLabel : void 0, a = {
|
|
173
179
|
onSubmit: e.onAction,
|
|
174
180
|
askQuestionAriaLabel: e.i18n.askQuestionAriaLabel,
|
|
175
181
|
defaultInputPlaceholder: e.i18n.defaultInputPlaceholder,
|
|
176
182
|
sendButtonText: e.i18n.sendButton,
|
|
177
183
|
sendQuestionAriaLabel: e.i18n.sendQuestionAriaLabel
|
|
178
184
|
};
|
|
179
|
-
return
|
|
185
|
+
return i !== void 0 && (a.placeholders = i), o !== void 0 && (a.ctaLabel = o), $(a);
|
|
180
186
|
},
|
|
181
187
|
QuestionHeading: ({ element: t, context: e }) => {
|
|
182
188
|
const n = document.createElement("h3");
|
|
183
189
|
n.className = "gengage-qna-heading", n.dataset.gengagePart = "qna-heading";
|
|
184
|
-
const
|
|
185
|
-
return n.textContent = typeof
|
|
190
|
+
const i = t.props?.text, o = e.headingTitleOverride;
|
|
191
|
+
return n.textContent = typeof o == "string" && o.trim().length > 0 ? o : typeof i == "string" ? i : "", n;
|
|
186
192
|
},
|
|
187
193
|
ProductCard: () => null
|
|
188
|
-
},
|
|
194
|
+
}, L = ({ element: t, renderElement: e }) => {
|
|
189
195
|
if (!t.children || t.children.length === 0) return null;
|
|
190
196
|
const n = document.createElement("div");
|
|
191
|
-
for (const
|
|
192
|
-
const
|
|
193
|
-
|
|
197
|
+
for (const i of t.children) {
|
|
198
|
+
const o = e(i);
|
|
199
|
+
o && n.appendChild(o);
|
|
194
200
|
}
|
|
195
201
|
return n;
|
|
196
202
|
};
|
|
197
|
-
function
|
|
198
|
-
return { ...
|
|
203
|
+
function G() {
|
|
204
|
+
return { ...I };
|
|
199
205
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
206
|
+
function J(t, e, n = I, i = L) {
|
|
207
|
+
return x({
|
|
202
208
|
spec: t,
|
|
203
209
|
context: e,
|
|
204
210
|
registry: n,
|
|
205
211
|
containerClassName: "gengage-qna-uispec",
|
|
206
|
-
unknownRenderer:
|
|
212
|
+
unknownRenderer: i
|
|
207
213
|
});
|
|
208
214
|
}
|
|
209
|
-
function
|
|
215
|
+
function V(t) {
|
|
210
216
|
if (!t) return;
|
|
211
217
|
const e = t.extra;
|
|
212
218
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
213
|
-
const
|
|
214
|
-
if (Array.isArray(
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
219
|
+
const i = e.visible_skus ?? e.visibleSkus;
|
|
220
|
+
if (Array.isArray(i)) {
|
|
221
|
+
const o = i.filter((a) => typeof a == "string" && a.trim().length > 0).map((a) => a.trim()).slice(0, 200);
|
|
222
|
+
if (o.length > 0) return o;
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
225
|
const n = typeof t.sku == "string" && t.sku.trim() ? t.sku.trim() : void 0;
|
|
220
226
|
return n ? [n] : void 0;
|
|
221
227
|
}
|
|
222
|
-
function
|
|
228
|
+
function S(t, e) {
|
|
223
229
|
if (!t) return null;
|
|
224
230
|
const n = t.action;
|
|
225
231
|
if (!n || typeof n != "object") return null;
|
|
226
|
-
const
|
|
227
|
-
if (typeof
|
|
228
|
-
const a =
|
|
232
|
+
const i = n, o = i.type;
|
|
233
|
+
if (typeof o != "string" || o.length === 0) return null;
|
|
234
|
+
const a = i.title, l = typeof a == "string" && a.length > 0 ? a : typeof e == "string" && e.length > 0 ? e : "";
|
|
229
235
|
if (!l) return null;
|
|
230
|
-
const s =
|
|
236
|
+
const s = i.payload, c = {
|
|
231
237
|
title: l,
|
|
232
|
-
type:
|
|
238
|
+
type: o
|
|
233
239
|
};
|
|
234
240
|
return s !== void 0 && (c.payload = s), c;
|
|
235
241
|
}
|
|
236
|
-
function
|
|
242
|
+
function Y(t, e) {
|
|
237
243
|
const n = t.elements[t.root];
|
|
238
244
|
if (!n) return !1;
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
const a =
|
|
245
|
+
const i = (o) => {
|
|
246
|
+
if (o.type !== "ActionButton") return !1;
|
|
247
|
+
const a = o.props;
|
|
242
248
|
if (!a || typeof a != "object") return !1;
|
|
243
249
|
const l = typeof a.label == "string" ? a.label : void 0;
|
|
244
|
-
return l === e ? !0 :
|
|
250
|
+
return l === e ? !0 : S(a, l)?.title === e;
|
|
245
251
|
};
|
|
246
|
-
if (n.type === "ActionButton") return
|
|
247
|
-
if (n.children) for (const
|
|
248
|
-
const a = t.elements[
|
|
249
|
-
if (a &&
|
|
252
|
+
if (n.type === "ActionButton") return i(n);
|
|
253
|
+
if (n.children) for (const o of n.children) {
|
|
254
|
+
const a = t.elements[o];
|
|
255
|
+
if (a && i(a)) return !0;
|
|
250
256
|
}
|
|
251
257
|
if (n.type === "ActionButtons" && Array.isArray(n.props?.buttons)) {
|
|
252
|
-
for (const
|
|
253
|
-
if (
|
|
258
|
+
for (const o of n.props.buttons)
|
|
259
|
+
if (o?.label === e || o?.action?.title === e) return !0;
|
|
254
260
|
}
|
|
255
261
|
return !1;
|
|
256
262
|
}
|
|
257
|
-
var
|
|
258
|
-
function
|
|
259
|
-
return
|
|
263
|
+
var k = 0;
|
|
264
|
+
function P() {
|
|
265
|
+
return k += 1, `gengage-merge-${k}`;
|
|
260
266
|
}
|
|
261
|
-
function
|
|
267
|
+
function Z(t, e) {
|
|
262
268
|
const n = t.elements[t.root];
|
|
263
269
|
if (!n || n.type !== "ButtonRow") return;
|
|
264
|
-
const
|
|
265
|
-
t.elements[
|
|
270
|
+
const i = P();
|
|
271
|
+
t.elements[i] = {
|
|
266
272
|
type: "ActionButton",
|
|
267
273
|
props: {
|
|
268
274
|
label: e.title,
|
|
@@ -272,13 +278,13 @@ function K(t, e) {
|
|
|
272
278
|
...e.payload !== void 0 ? { payload: e.payload } : {}
|
|
273
279
|
}
|
|
274
280
|
}
|
|
275
|
-
}, n.children = n.children ? [
|
|
281
|
+
}, n.children = n.children ? [i, ...n.children] : [i];
|
|
276
282
|
}
|
|
277
|
-
function
|
|
283
|
+
function K(t, e) {
|
|
278
284
|
const n = t.elements[t.root];
|
|
279
285
|
if (!n || n.type !== "ActionButtons") return;
|
|
280
|
-
const
|
|
281
|
-
t.elements[
|
|
286
|
+
const i = P();
|
|
287
|
+
t.elements[i] = {
|
|
282
288
|
type: "ActionButton",
|
|
283
289
|
props: {
|
|
284
290
|
label: e.title,
|
|
@@ -288,8 +294,8 @@ function X(t, e) {
|
|
|
288
294
|
...e.payload !== void 0 ? { payload: e.payload } : {}
|
|
289
295
|
}
|
|
290
296
|
}
|
|
291
|
-
}, n.children = n.children ? [
|
|
292
|
-
const
|
|
297
|
+
}, n.children = n.children ? [i, ...n.children] : [i];
|
|
298
|
+
const o = n.props?.buttons ?? [], a = {
|
|
293
299
|
label: e.title,
|
|
294
300
|
action: {
|
|
295
301
|
title: e.title,
|
|
@@ -299,21 +305,21 @@ function X(t, e) {
|
|
|
299
305
|
};
|
|
300
306
|
n.props = {
|
|
301
307
|
...n.props,
|
|
302
|
-
buttons: [a, ...
|
|
308
|
+
buttons: [a, ...o]
|
|
303
309
|
};
|
|
304
310
|
}
|
|
305
|
-
function
|
|
311
|
+
function X(t) {
|
|
306
312
|
const e = {}, n = [];
|
|
307
|
-
for (let
|
|
308
|
-
const
|
|
313
|
+
for (let i = 0; i < t.length; i++) {
|
|
314
|
+
const o = t[i], a = `action-${i}`;
|
|
309
315
|
n.push(a), e[a] = {
|
|
310
316
|
type: "ActionButton",
|
|
311
317
|
props: {
|
|
312
|
-
label:
|
|
318
|
+
label: o.title,
|
|
313
319
|
action: {
|
|
314
|
-
title:
|
|
315
|
-
type:
|
|
316
|
-
...
|
|
320
|
+
title: o.title,
|
|
321
|
+
type: o.type,
|
|
322
|
+
...o.payload !== void 0 ? { payload: o.payload } : {}
|
|
317
323
|
}
|
|
318
324
|
}
|
|
319
325
|
};
|
|
@@ -326,43 +332,45 @@ function ee(t) {
|
|
|
326
332
|
elements: e
|
|
327
333
|
};
|
|
328
334
|
}
|
|
329
|
-
function
|
|
335
|
+
function tt(t) {
|
|
330
336
|
return t.find((e) => {
|
|
331
337
|
const n = e.elements[e.root];
|
|
332
338
|
return n?.type === "ActionButtons" || n?.type === "ButtonRow";
|
|
333
339
|
});
|
|
334
340
|
}
|
|
335
|
-
function
|
|
336
|
-
const n = t.productContextQuickPillLabel,
|
|
337
|
-
return e && e.length > 0 && (
|
|
341
|
+
function et(t, e) {
|
|
342
|
+
const n = t.productContextQuickPillLabel, i = { text: n };
|
|
343
|
+
return e && e.length > 0 && (i.sku_list = e), {
|
|
338
344
|
title: n,
|
|
339
345
|
type: "user_message",
|
|
340
|
-
payload:
|
|
346
|
+
payload: i
|
|
341
347
|
};
|
|
342
348
|
}
|
|
343
|
-
function
|
|
344
|
-
const
|
|
349
|
+
function nt(t, e, n) {
|
|
350
|
+
const i = n?.skuList;
|
|
351
|
+
let o = !1;
|
|
352
|
+
const a = [];
|
|
345
353
|
for (const c of t) {
|
|
346
354
|
const r = c.elements[c.root];
|
|
347
355
|
if (r?.type === "ActionButton") {
|
|
348
356
|
const u = r.props;
|
|
349
|
-
if (
|
|
350
|
-
|
|
357
|
+
if (S(u, typeof u?.label == "string" ? u.label : void 0)?.type === "findSimilar") {
|
|
358
|
+
o = !0;
|
|
351
359
|
continue;
|
|
352
360
|
}
|
|
353
361
|
}
|
|
354
362
|
a.push(c);
|
|
355
363
|
}
|
|
356
|
-
if (
|
|
357
|
-
const l =
|
|
358
|
-
if (!s) return [...a,
|
|
359
|
-
if (!
|
|
364
|
+
if (!o) return t;
|
|
365
|
+
const l = et(e, i), s = tt(a);
|
|
366
|
+
if (!s) return [...a, X([l])];
|
|
367
|
+
if (!Y(s, l.title)) {
|
|
360
368
|
const c = s.elements[s.root];
|
|
361
|
-
c?.type === "ActionButtons" ?
|
|
369
|
+
c?.type === "ActionButtons" ? K(s, l) : c?.type === "ButtonRow" && Z(s, l);
|
|
362
370
|
}
|
|
363
371
|
return a;
|
|
364
372
|
}
|
|
365
|
-
var
|
|
373
|
+
var w = {
|
|
366
374
|
quickQuestionsAriaLabel: "Hızlı sorular",
|
|
367
375
|
askQuestionAriaLabel: "Soru sorun",
|
|
368
376
|
defaultInputPlaceholder: "Bir soru sorun...",
|
|
@@ -371,7 +379,7 @@ var B = {
|
|
|
371
379
|
defaultCtaText: "Başka bir şey sor",
|
|
372
380
|
redirectingToChat: "Sohbete yönlendiriliyor...",
|
|
373
381
|
productContextQuickPillLabel: "Bu ürün hakkında ne bilmeliyim?"
|
|
374
|
-
},
|
|
382
|
+
}, it = {
|
|
375
383
|
quickQuestionsAriaLabel: "Quick questions",
|
|
376
384
|
askQuestionAriaLabel: "Ask a question",
|
|
377
385
|
defaultInputPlaceholder: "Ask a question...",
|
|
@@ -381,25 +389,25 @@ var B = {
|
|
|
381
389
|
redirectingToChat: "Redirecting to chat...",
|
|
382
390
|
productContextQuickPillLabel: "What should I know about this product?"
|
|
383
391
|
};
|
|
384
|
-
function
|
|
392
|
+
function ot(t) {
|
|
385
393
|
return t ? t.toLowerCase().split("-")[0] ?? "tr" : "tr";
|
|
386
394
|
}
|
|
387
|
-
function
|
|
388
|
-
return
|
|
395
|
+
function at(t) {
|
|
396
|
+
return ot(t) === "en" ? it : w;
|
|
389
397
|
}
|
|
390
|
-
var
|
|
398
|
+
var st = class extends W {
|
|
391
399
|
constructor(...t) {
|
|
392
|
-
super(...t), this._abortController = null, this._debounceTimer = null, this._contentEl = null, this._i18n =
|
|
400
|
+
super(...t), this._abortController = null, this._debounceTimer = null, this._dispatchTimers = /* @__PURE__ */ new Set(), this._contentEl = null, this._i18n = w, this._actionHandler = this._handleAction.bind(this), this._openChatHandler = this._handleOpenChat.bind(this);
|
|
393
401
|
}
|
|
394
402
|
async onInit(t) {
|
|
395
|
-
this._i18n = this._resolveI18n(t), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang =
|
|
403
|
+
this._i18n = this._resolveI18n(t), this._contentEl = document.createElement("div"), this._contentEl.className = "gengage-qna-container", this._contentEl.dataset.gengagePart = "qna-container", this._contentEl.lang = q(t.locale);
|
|
396
404
|
const e = this._createChrome(t);
|
|
397
405
|
if (e) {
|
|
398
|
-
const
|
|
399
|
-
|
|
406
|
+
const i = document.createElement("div");
|
|
407
|
+
i.className = "gengage-qna-chrome-widget", i.dataset.gengagePart = "qna-chrome-widget", i.appendChild(this._contentEl), e.appendChild(i), this.root.appendChild(e);
|
|
400
408
|
} else this.root.appendChild(this._contentEl);
|
|
401
409
|
const n = t.pageContext?.sku;
|
|
402
|
-
n && (this._lastSku = n, await this._fetchAndRender(n)),
|
|
410
|
+
n && (this._lastSku = n, await this._fetchAndRender(n)), M("qna");
|
|
403
411
|
}
|
|
404
412
|
onUpdate(t) {
|
|
405
413
|
const e = t.sku;
|
|
@@ -415,7 +423,9 @@ var se = class extends D {
|
|
|
415
423
|
onHide() {
|
|
416
424
|
}
|
|
417
425
|
onDestroy() {
|
|
418
|
-
this._abort(), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null)
|
|
426
|
+
this._abort(), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null);
|
|
427
|
+
for (const t of this._dispatchTimers) clearTimeout(t);
|
|
428
|
+
this._dispatchTimers.clear(), this._contentEl && (this._cleanupTextInputTimers(), this._contentEl.remove(), this._contentEl = null);
|
|
419
429
|
}
|
|
420
430
|
_abort() {
|
|
421
431
|
this._abortController?.abort(), this._abortController = null;
|
|
@@ -436,22 +446,22 @@ var se = class extends D {
|
|
|
436
446
|
this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
|
|
437
447
|
const e = this._createLoadingIndicator();
|
|
438
448
|
this._contentEl.appendChild(e);
|
|
439
|
-
const n = { middlewareUrl: this.config.middlewareUrl },
|
|
449
|
+
const n = { middlewareUrl: this.config.middlewareUrl }, i = z({
|
|
440
450
|
source: "qna",
|
|
441
451
|
locale: this.config.locale
|
|
442
452
|
});
|
|
443
453
|
try {
|
|
444
|
-
const
|
|
454
|
+
const o = this.config.session?.sessionId ?? "", a = {
|
|
445
455
|
account_id: this.config.accountId,
|
|
446
|
-
session_id:
|
|
447
|
-
correlation_id:
|
|
456
|
+
session_id: o,
|
|
457
|
+
correlation_id: o,
|
|
448
458
|
sku: t,
|
|
449
|
-
locale:
|
|
459
|
+
locale: q(this.config.locale)
|
|
450
460
|
};
|
|
451
461
|
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
462
|
const l = this.config.pageContext?.pageType;
|
|
453
463
|
l !== void 0 && (a.page_type = l);
|
|
454
|
-
const s = await
|
|
464
|
+
const s = await D(a, n, this._abortController.signal);
|
|
455
465
|
if (!this._contentEl) return;
|
|
456
466
|
this._contentEl.innerHTML = "";
|
|
457
467
|
const c = document.createElement("div");
|
|
@@ -461,30 +471,30 @@ var se = class extends D {
|
|
|
461
471
|
const d = document.createElement("h3");
|
|
462
472
|
d.className = "gengage-qna-heading", d.textContent = u, c.appendChild(d);
|
|
463
473
|
}
|
|
464
|
-
const
|
|
465
|
-
let
|
|
466
|
-
if (
|
|
474
|
+
const h = this.config.inputPlaceholder;
|
|
475
|
+
let p;
|
|
476
|
+
if (h !== !0) p = h ?? this._i18n.defaultInputPlaceholder;
|
|
467
477
|
else if (s.actions.length > 0) {
|
|
468
|
-
const d = s.actions.filter((
|
|
469
|
-
|
|
470
|
-
} else
|
|
471
|
-
const
|
|
478
|
+
const d = s.actions.filter((b) => b.type === "user_message" || typeof b.title == "string" && b.title.includes("?")).map((b) => b.title);
|
|
479
|
+
p = d.length > 0 ? d : this._i18n.defaultInputPlaceholder;
|
|
480
|
+
} else p = this._i18n.defaultInputPlaceholder;
|
|
481
|
+
const f = {
|
|
472
482
|
onAction: this._actionHandler,
|
|
473
483
|
i18n: this._i18n
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
const
|
|
477
|
-
for (const d of
|
|
478
|
-
const
|
|
479
|
-
c.appendChild(
|
|
484
|
+
}, m = this._resolvedQnaHeaderTitle();
|
|
485
|
+
m !== void 0 && (f.headingTitleOverride = m), this.config.hideButtonRowCta || (f.onOpenChat = this._openChatHandler, this.config.ctaText !== void 0 && (f.ctaText = this.config.ctaText)), p !== void 0 && (f.inputPlaceholder = p);
|
|
486
|
+
const g = this._buildFallbackActionsSpec(s.actions), y = V(this.config.pageContext), _ = (s.uiSpecs.length > 0 ? nt(s.uiSpecs, this._i18n, { skuList: y }) : [g]).filter((d) => Object.keys(d.elements).length > 0);
|
|
487
|
+
for (const d of _) {
|
|
488
|
+
const b = this._renderUISpec(d, f);
|
|
489
|
+
c.appendChild(b);
|
|
480
490
|
}
|
|
481
|
-
|
|
482
|
-
} catch (
|
|
483
|
-
if (
|
|
484
|
-
if (
|
|
491
|
+
_.length > 0 && U("qna"), this._specIncludesType(_, "TextInput") || this._insertStandaloneInputBeforePills(c, f, p);
|
|
492
|
+
} catch (o) {
|
|
493
|
+
if (o instanceof DOMException && o.name === "AbortError") return;
|
|
494
|
+
if (this._lastSku = void 0, T("gengage:global:error", {
|
|
485
495
|
source: "qna",
|
|
486
496
|
code: "FETCH_ERROR",
|
|
487
|
-
message:
|
|
497
|
+
message: F(this.config.locale, o)
|
|
488
498
|
}), this._contentEl) {
|
|
489
499
|
this._cleanupTextInputTimers(), this._contentEl.innerHTML = "";
|
|
490
500
|
const a = document.createElement("div");
|
|
@@ -497,7 +507,7 @@ var se = class extends D {
|
|
|
497
507
|
c !== void 0 && (s.headingTitleOverride = c), this.config.ctaText !== void 0 && (s.ctaText = this.config.ctaText), this._appendStandaloneInput(s, l, a);
|
|
498
508
|
}
|
|
499
509
|
} finally {
|
|
500
|
-
|
|
510
|
+
i();
|
|
501
511
|
}
|
|
502
512
|
}
|
|
503
513
|
_createLoadingIndicator() {
|
|
@@ -511,49 +521,49 @@ var se = class extends D {
|
|
|
511
521
|
}
|
|
512
522
|
_resolveI18n(t) {
|
|
513
523
|
return {
|
|
514
|
-
...
|
|
524
|
+
...at(t.locale),
|
|
515
525
|
...t.i18n
|
|
516
526
|
};
|
|
517
527
|
}
|
|
518
528
|
_createChrome(t) {
|
|
519
529
|
const e = t.chrome;
|
|
520
530
|
if (!e) return null;
|
|
521
|
-
const n = typeof e.title == "string" ? e.title.trim() : "",
|
|
531
|
+
const n = typeof e.title == "string" ? e.title.trim() : "", i = typeof e.subtitle == "string" ? e.subtitle.trim() : "", o = typeof e.startButtonLabel == "string" ? e.startButtonLabel.trim() : "", a = typeof e.imageUrl == "string" ? e.imageUrl.trim() : "", l = typeof e.imagePadding == "string" ? e.imagePadding.trim() : "", s = document.createElement("section");
|
|
522
532
|
s.className = "gengage-qna-chrome", s.dataset.gengagePart = "qna-chrome", e.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);
|
|
523
533
|
const c = document.createElement("div");
|
|
524
534
|
if (c.className = "gengage-qna-chrome-copy", c.dataset.gengagePart = "qna-chrome-copy", n) {
|
|
525
535
|
const r = document.createElement("h2");
|
|
526
536
|
r.className = "gengage-qna-chrome-title", r.dataset.gengagePart = "qna-chrome-title", r.textContent = n, c.appendChild(r);
|
|
527
537
|
}
|
|
528
|
-
if (
|
|
538
|
+
if (i) {
|
|
529
539
|
const r = document.createElement("p");
|
|
530
|
-
r.className = "gengage-qna-chrome-subtitle", r.dataset.gengagePart = "qna-chrome-subtitle", r.textContent =
|
|
540
|
+
r.className = "gengage-qna-chrome-subtitle", r.dataset.gengagePart = "qna-chrome-subtitle", r.textContent = i, c.appendChild(r);
|
|
531
541
|
}
|
|
532
|
-
if (c.children.length > 0 && s.appendChild(c), a &&
|
|
542
|
+
if (c.children.length > 0 && s.appendChild(c), a && O(a)) {
|
|
533
543
|
const r = document.createElement("img");
|
|
534
544
|
r.className = "gengage-qna-chrome-image", r.dataset.gengagePart = "qna-chrome-image", r.src = a, r.alt = typeof e.imageAlt == "string" ? e.imageAlt : "", r.loading = "lazy", r.addEventListener("error", () => {
|
|
535
545
|
r.style.display = "none";
|
|
536
546
|
}, { once: !0 }), s.appendChild(r);
|
|
537
547
|
}
|
|
538
|
-
if (
|
|
548
|
+
if (o) {
|
|
539
549
|
const r = document.createElement("button");
|
|
540
|
-
r.className = "gengage-qna-chrome-start", r.dataset.gengagePart = "qna-chrome-start", r.type = "button", r.textContent =
|
|
550
|
+
r.className = "gengage-qna-chrome-start", r.dataset.gengagePart = "qna-chrome-start", r.type = "button", r.textContent = o, r.addEventListener("click", () => this._handleOpenChat()), s.appendChild(r);
|
|
541
551
|
}
|
|
542
552
|
return s.children.length === 0 ? null : s;
|
|
543
553
|
}
|
|
544
554
|
_resolveUISpecRegistry() {
|
|
545
|
-
return
|
|
555
|
+
return R(G(), this.config.renderer?.registry);
|
|
546
556
|
}
|
|
547
557
|
_renderUISpec(t, e) {
|
|
548
|
-
const n = this._resolveUISpecRegistry(),
|
|
558
|
+
const n = this._resolveUISpecRegistry(), i = this.config.renderer?.unknownRenderer ?? L, o = (l, s) => J(l, s, n, i), a = this.config.renderer?.renderUISpec;
|
|
549
559
|
return a ? a(t, e, {
|
|
550
560
|
registry: n,
|
|
551
|
-
unknownRenderer:
|
|
552
|
-
defaultRender:
|
|
553
|
-
}) :
|
|
561
|
+
unknownRenderer: i,
|
|
562
|
+
defaultRender: o
|
|
563
|
+
}) : o(t, e);
|
|
554
564
|
}
|
|
555
565
|
_specIncludesType(t, e) {
|
|
556
|
-
for (const n of t) for (const
|
|
566
|
+
for (const n of t) for (const i of Object.values(n.elements)) if (i.type === e) return !0;
|
|
557
567
|
return !1;
|
|
558
568
|
}
|
|
559
569
|
_buildFallbackActionsSpec(t) {
|
|
@@ -562,16 +572,16 @@ var se = class extends D {
|
|
|
562
572
|
elements: {}
|
|
563
573
|
};
|
|
564
574
|
const e = {}, n = [];
|
|
565
|
-
for (let
|
|
566
|
-
const
|
|
575
|
+
for (let i = 0; i < t.length; i++) {
|
|
576
|
+
const o = t[i], a = `action-${i}`;
|
|
567
577
|
n.push(a), e[a] = {
|
|
568
578
|
type: "ActionButton",
|
|
569
579
|
props: {
|
|
570
|
-
label:
|
|
580
|
+
label: o.title,
|
|
571
581
|
action: {
|
|
572
|
-
title:
|
|
573
|
-
type:
|
|
574
|
-
payload:
|
|
582
|
+
title: o.title,
|
|
583
|
+
type: o.type,
|
|
584
|
+
payload: o.payload
|
|
575
585
|
}
|
|
576
586
|
}
|
|
577
587
|
};
|
|
@@ -585,13 +595,13 @@ var se = class extends D {
|
|
|
585
595
|
};
|
|
586
596
|
}
|
|
587
597
|
_insertStandaloneInputBeforePills(t, e, n) {
|
|
588
|
-
const
|
|
598
|
+
const i = {
|
|
589
599
|
root: "root",
|
|
590
600
|
elements: { root: {
|
|
591
601
|
type: "TextInput",
|
|
592
602
|
props: { placeholder: n }
|
|
593
603
|
} }
|
|
594
|
-
},
|
|
604
|
+
}, o = this._renderUISpec(i, e), a = o.querySelector(".gengage-qna-input-wrapper");
|
|
595
605
|
if (!a) return;
|
|
596
606
|
const l = t.querySelector(".gengage-qna-uispec"), s = t.querySelector(".gengage-qna-uispec > .gengage-qna-buttons"), c = this.config.inputAfterPills === !0;
|
|
597
607
|
if (s) c ? s.insertAdjacentElement("afterend", a) : s.insertAdjacentElement("beforebegin", a);
|
|
@@ -599,27 +609,35 @@ var se = class extends D {
|
|
|
599
609
|
const r = l.querySelector(":scope > .gengage-qna-heading");
|
|
600
610
|
!c && r ? r.insertAdjacentElement("afterend", a) : l.appendChild(a);
|
|
601
611
|
} else {
|
|
602
|
-
t.appendChild(
|
|
612
|
+
t.appendChild(o);
|
|
603
613
|
return;
|
|
604
614
|
}
|
|
605
|
-
|
|
615
|
+
o.remove();
|
|
606
616
|
}
|
|
607
617
|
_appendStandaloneInput(t, e, n) {
|
|
608
618
|
if (!this._contentEl) return;
|
|
609
|
-
const
|
|
619
|
+
const i = {
|
|
610
620
|
root: "root",
|
|
611
621
|
elements: { root: {
|
|
612
622
|
type: "TextInput",
|
|
613
623
|
props: { placeholder: e }
|
|
614
624
|
} }
|
|
615
|
-
},
|
|
616
|
-
(n ?? this._contentEl).appendChild(
|
|
625
|
+
}, o = this._renderUISpec(i, t);
|
|
626
|
+
(n ?? this._contentEl).appendChild(o);
|
|
617
627
|
}
|
|
618
628
|
_handleAction(t) {
|
|
619
|
-
this._showTransitionIndicator(), j(t.title, t.type), this.config.onActionSelected?.(t)
|
|
629
|
+
this._showTransitionIndicator(), j(t.title, t.type), this.config.onActionSelected?.(t);
|
|
630
|
+
const e = setTimeout(() => {
|
|
631
|
+
this._dispatchTimers.delete(e), this._contentEl && T("gengage:qna:action", t);
|
|
632
|
+
}, 350);
|
|
633
|
+
this._dispatchTimers.add(e);
|
|
620
634
|
}
|
|
621
635
|
_handleOpenChat() {
|
|
622
|
-
this._showTransitionIndicator(), this.config.onOpenChat?.()
|
|
636
|
+
this._showTransitionIndicator(), this.config.onOpenChat?.();
|
|
637
|
+
const t = setTimeout(() => {
|
|
638
|
+
this._dispatchTimers.delete(t), this._contentEl && T("gengage:qna:open-chat", {});
|
|
639
|
+
}, 350);
|
|
640
|
+
this._dispatchTimers.add(t);
|
|
623
641
|
}
|
|
624
642
|
_showTransitionIndicator() {
|
|
625
643
|
if (!this._contentEl) return;
|
|
@@ -630,13 +648,13 @@ var se = class extends D {
|
|
|
630
648
|
}, 600);
|
|
631
649
|
}
|
|
632
650
|
};
|
|
633
|
-
function
|
|
634
|
-
return new
|
|
651
|
+
function pt() {
|
|
652
|
+
return new st();
|
|
635
653
|
}
|
|
636
654
|
export {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
655
|
+
J as a,
|
|
656
|
+
L as i,
|
|
657
|
+
pt as n,
|
|
658
|
+
G as r,
|
|
659
|
+
st as t
|
|
642
660
|
};
|