@levo-so/site-runtime 0.3.16 → 0.3.17
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/DateTimeWidget-I0LvR-tO.js +255 -0
- package/{Dialog-dT7y641z.js → Dialog-D-vRkU9N.js} +1 -1
- package/{KBChatWidget-GRi6sLpp.js → KBChatWidget-BMuZ-VI3.js} +222 -222
- package/{LevoProvider-Bsjkcwc8.js → LevoProvider-BkbKrvrI.js} +8 -8
- package/PhoneWidget-DPECohGT.js +99 -0
- package/{Popover-C29yJ7rz.js → Popover-Cr0-X_ch.js} +1 -1
- package/{PopupBody-BI-MJqmd-DdFDtjOo.js → PopupBody-BI-MJqmd-BnSl6jJr.js} +23 -23
- package/{PopupRenderer-D66Gx63H-IgqQ0Z7U.js → PopupRenderer-D66Gx63H-B_CFOeCl.js} +47 -47
- package/{RichTextWidget-LpzXJZXc.js → RichTextWidget-C1QECDcg.js} +110 -110
- package/{RteThemeProvider-BQmfSXSl.js → RteThemeProvider-CMbSaFRQ.js} +1 -1
- package/{ThemeProvider-DutrjSTF.js → ThemeProvider-DlFehjh1.js} +30 -30
- package/{Tooltip-CQB0LyxK.js → Tooltip-BKQ5rIDh.js} +1 -1
- package/{VerifyButton-BUT70lgz.js → VerifyButton-D0cj9Z5Q.js} +38 -38
- package/blog-content.js +67 -67
- package/{dist-B1BSD6Np.js → dist-C6-eVcUB.js} +10 -10
- package/{dist-Y-Rc8Xqh.js → dist-CXoCodlj.js} +888 -888
- package/index.js +407 -407
- package/{kbChat-a2dXSeRc.js → kbChat-DtZ4vuCZ.js} +26 -26
- package/package.json +3 -3
- package/popups.js +1 -1
- package/{usePopupRedirect-CAAdcpaW-Ddjyf4KK.js → usePopupRedirect-CAAdcpaW-BDa44PXN.js} +14 -14
- package/DateTimeWidget-Cr66rni6.js +0 -255
- package/PhoneWidget-CFRaMNwc.js +0 -99
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { S as e, _ as t, a as n, b as r, c as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, r as p, s as m, t as h, u as g, v as _, x as v, y } from "./pillChrome-CEpWGNZB.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Children as b, createContext as x, isValidElement as S, useCallback as C, useContext as w, useEffect as T, useLayoutEffect as ee, useRef as E, useState as D } from "react";
|
|
4
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
5
5
|
import { ArrowUp as j, Check as M, ChevronDown as N, Copy as P, MessageSquarePlus as F, Mic as I, RefreshCw as L, Sparkles as te, Square as R, X as z } from "lucide-react";
|
|
6
6
|
import { ActionBarPrimitive as B, AssistantRuntimeProvider as ne, ComposerPrimitive as V, MessagePrimitive as H, ThreadPrimitive as U, WebSpeechDictationAdapter as re, useAui as W, useAuiState as G } from "@assistant-ui/react";
|
|
7
7
|
import { AssistantChatTransport as ie, useChatRuntime as ae } from "@assistant-ui/react-ai-sdk";
|
|
@@ -15,9 +15,9 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
15
15
|
"transition-all duration-150 hover:border-zinc-300 hover:bg-zinc-50 hover:text-zinc-900 active:scale-95",
|
|
16
16
|
n === "compact" ? "px-2.5 py-1 text-[11px] leading-none" : "px-3.5 py-1.5 text-xs"
|
|
17
17
|
].join(" ");
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ k("div", {
|
|
19
19
|
className: ["flex flex-wrap gap-1.5", r].filter(Boolean).join(" "),
|
|
20
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
20
|
+
children: e.map((e, n) => /* @__PURE__ */ k("button", {
|
|
21
21
|
type: "button",
|
|
22
22
|
onClick: () => t(e),
|
|
23
23
|
className: ["ai-chat-chip", i ?? a].join(" "),
|
|
@@ -37,10 +37,10 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
39
|
}), le = (e) => {
|
|
40
|
-
let t =
|
|
40
|
+
let t = E(null), n = E(null);
|
|
41
41
|
return n.current !== (e ?? null) && (n.current = e ?? null, t.current = null), {
|
|
42
42
|
conversationIdRef: t,
|
|
43
|
-
handleFinish:
|
|
43
|
+
handleFinish: C(({ message: e }) => {
|
|
44
44
|
let n = e.metadata;
|
|
45
45
|
if (!n || typeof n != "object") return;
|
|
46
46
|
let r = n.conversation_id;
|
|
@@ -48,33 +48,33 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
48
48
|
let i = r.trim();
|
|
49
49
|
i.length !== 0 && t.current !== i && (t.current = i);
|
|
50
50
|
}, []),
|
|
51
|
-
reset:
|
|
51
|
+
reset: C(() => {
|
|
52
52
|
t.current = null;
|
|
53
53
|
}, [])
|
|
54
54
|
};
|
|
55
55
|
}, ue = (e = []) => {
|
|
56
|
-
let [t, n] =
|
|
56
|
+
let [t, n] = D(e);
|
|
57
57
|
return {
|
|
58
58
|
followUps: t,
|
|
59
59
|
setFollowUps: n,
|
|
60
|
-
clearOnSend:
|
|
61
|
-
handleData:
|
|
60
|
+
clearOnSend: C(() => n([]), []),
|
|
61
|
+
handleData: C((e) => {
|
|
62
62
|
if (e.type !== "data-follow_ups") return !1;
|
|
63
63
|
let t = e.data?.suggestions;
|
|
64
64
|
return Array.isArray(t) ? (n(t.filter((e) => typeof e == "string")), !0) : !1;
|
|
65
65
|
}, [])
|
|
66
66
|
};
|
|
67
|
-
}, de = (e) => e instanceof Error && e.message.includes("intelligence.site_agent.NO_ACTIVE_AGENT"), q =
|
|
67
|
+
}, de = (e) => e instanceof Error && e.message.includes("intelligence.site_agent.NO_ACTIVE_AGENT"), q = x({ agentUnavailable: !1 }), fe = () => w(q), pe = (...e) => e.filter(Boolean).join(" "), me = "inline-flex items-center justify-center gap-1.5 transition-all duration-200", he = "rounded-full border border-zinc-200 bg-white/95 px-3 py-1.5 font-medium text-xs text-zinc-500 shadow-lg backdrop-blur-sm hover:text-zinc-900", ge = ({ onClick: e, isRunning: t = !1, iconOnly: n = !1, icon: r = /* @__PURE__ */ k(N, { className: "h-3 w-3" }), className: i = he }) => /* @__PURE__ */ A("button", {
|
|
68
68
|
type: "button",
|
|
69
69
|
"aria-label": "Scroll to bottom",
|
|
70
70
|
onClick: e,
|
|
71
71
|
className: pe(me, i),
|
|
72
72
|
children: [r, !n && (t ? "New messages" : "Scroll to bottom")]
|
|
73
73
|
}), _e = ({ endpoint: e, headers: t, fallback: n, enabled: r = !0 }) => {
|
|
74
|
-
let [i, a] =
|
|
74
|
+
let [i, a] = D(null), o = t ? JSON.stringify(t) : "", s = E(t);
|
|
75
75
|
s.current = t;
|
|
76
|
-
let c =
|
|
77
|
-
return c.current = n,
|
|
76
|
+
let c = E(n);
|
|
77
|
+
return c.current = n, T(() => {
|
|
78
78
|
if (!r || !e) {
|
|
79
79
|
a([...c.current]);
|
|
80
80
|
return;
|
|
@@ -104,10 +104,10 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
104
104
|
o
|
|
105
105
|
]), i;
|
|
106
106
|
}, ve = 36, ye = 80, be = ({ viewportRef: e, isRunning: t, onRunStart: n, anchorOnRunStart: r = !0, atBottomThreshold: i }) => {
|
|
107
|
-
let a =
|
|
107
|
+
let a = E(!1), [o, s] = D(!0), c = E(n);
|
|
108
108
|
c.current = n;
|
|
109
|
-
let l =
|
|
110
|
-
return l.current = i,
|
|
109
|
+
let l = E(i);
|
|
110
|
+
return l.current = i, T(() => {
|
|
111
111
|
let n = a.current;
|
|
112
112
|
if (a.current = t, !t || n || (c.current?.(), !r)) return;
|
|
113
113
|
let i = null, o = null;
|
|
@@ -128,7 +128,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
128
128
|
t,
|
|
129
129
|
e,
|
|
130
130
|
r
|
|
131
|
-
]),
|
|
131
|
+
]), T(() => {
|
|
132
132
|
let t = e.current;
|
|
133
133
|
if (!t) return;
|
|
134
134
|
let n = () => {
|
|
@@ -151,7 +151,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
-
}, xe = (...e) => e.filter(Boolean).join(" "), Se = ({ onStop: e }) => /* @__PURE__ */
|
|
154
|
+
}, xe = (...e) => e.filter(Boolean).join(" "), Se = ({ onStop: e }) => /* @__PURE__ */ k("button", {
|
|
155
155
|
type: "button",
|
|
156
156
|
onClick: e,
|
|
157
157
|
"aria-label": "Stop generating",
|
|
@@ -160,34 +160,34 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
160
160
|
backgroundColor: "var(--color-brand, #0a0a0a)",
|
|
161
161
|
color: "var(--color-brand-foreground, #fff)"
|
|
162
162
|
},
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
}), Ce = () => /* @__PURE__ */
|
|
163
|
+
children: /* @__PURE__ */ k(R, { className: "h-3.5 w-3.5 fill-current" })
|
|
164
|
+
}), Ce = () => /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(V.If, {
|
|
165
165
|
dictation: !1,
|
|
166
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ k(V.Dictate, {
|
|
167
167
|
className: "flex h-8 w-8 items-center justify-center rounded-md text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-900",
|
|
168
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ k(I, { className: "h-4 w-4" })
|
|
169
169
|
})
|
|
170
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ k(V.If, {
|
|
171
171
|
dictation: !0,
|
|
172
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ k(V.StopDictation, {
|
|
173
173
|
className: "flex h-8 w-8 animate-pulse items-center justify-center rounded-md bg-red-500/15 text-red-500 transition-colors hover:bg-red-500/25",
|
|
174
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ k(R, { className: "h-3 w-3 fill-current" })
|
|
175
175
|
})
|
|
176
|
-
})] }), we = () => /* @__PURE__ */
|
|
176
|
+
})] }), we = () => /* @__PURE__ */ k(V.Send, {
|
|
177
177
|
"aria-label": "Send message",
|
|
178
178
|
className: "flex h-9 w-9 items-center justify-center rounded-md shadow-md transition-all duration-300 hover:scale-110 active:scale-95 disabled:cursor-not-allowed disabled:opacity-40 disabled:shadow-none disabled:hover:scale-100",
|
|
179
179
|
style: {
|
|
180
180
|
backgroundColor: "var(--color-brand, #0a0a0a)",
|
|
181
181
|
color: "var(--color-brand-foreground, #fff)"
|
|
182
182
|
},
|
|
183
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ k(j, { className: "h-5 w-5 stroke-[2.5px]" })
|
|
184
184
|
}), Te = ({ variant: e, isRunning: t, onStop: n }) => {
|
|
185
185
|
let r = (e) => {
|
|
186
186
|
e.nativeEvent.isComposing || t && e.key === "Enter" && !e.shiftKey && e.preventDefault();
|
|
187
187
|
};
|
|
188
|
-
return e === "expanded" ? /* @__PURE__ */
|
|
188
|
+
return e === "expanded" ? /* @__PURE__ */ A("div", {
|
|
189
189
|
className: "rounded-lg border border-zinc-200 bg-white shadow-sm transition-colors focus-within:border-[var(--color-brand,#a1a1aa)]",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ k(V.Input, {
|
|
191
191
|
"data-ai-chat-composer": "",
|
|
192
192
|
className: xe("ai-chat-textarea w-full resize-none overflow-y-auto bg-transparent px-6 pt-4 text-base text-zinc-900 leading-relaxed placeholder:text-zinc-500 focus:outline-none", "max-h-[160px]"),
|
|
193
193
|
placeholder: "Ask anything about this site…",
|
|
@@ -199,14 +199,14 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
199
199
|
inputMode: "text",
|
|
200
200
|
onInput: (e) => _(e.currentTarget),
|
|
201
201
|
onKeyDown: r
|
|
202
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ A("div", {
|
|
203
203
|
className: "flex items-center justify-between px-3 pt-1 pb-2",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ k(Ce, {}), t ? /* @__PURE__ */ k(Se, { onStop: n }) : /* @__PURE__ */ k(we, {})]
|
|
205
205
|
})]
|
|
206
|
-
}) : /* @__PURE__ */
|
|
206
|
+
}) : /* @__PURE__ */ A("div", {
|
|
207
207
|
className: "flex items-end gap-2 rounded-lg border border-zinc-200 bg-white p-2 shadow-sm transition-colors focus-within:border-[var(--color-brand,#a1a1aa)]",
|
|
208
208
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ k(V.Input, {
|
|
210
210
|
"data-ai-chat-composer": "",
|
|
211
211
|
className: xe("ai-chat-textarea min-w-0 flex-1 resize-none overflow-y-auto bg-transparent px-2 py-1.5 text-base text-zinc-900 leading-relaxed placeholder:text-zinc-500 focus:outline-none", "max-h-[120px]"),
|
|
212
212
|
placeholder: "Ask a follow-up…",
|
|
@@ -219,27 +219,27 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
219
219
|
onInput: (e) => _(e.currentTarget),
|
|
220
220
|
onKeyDown: r
|
|
221
221
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
t ? /* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ k(Ce, {}),
|
|
223
|
+
t ? /* @__PURE__ */ k(Se, { onStop: n }) : /* @__PURE__ */ k(we, {})
|
|
224
224
|
]
|
|
225
225
|
});
|
|
226
226
|
}, Ee = "rounded-2xl border border-zinc-200 bg-zinc-100 px-3.5 py-2.5", De = "ai-chat-textarea w-full resize-none bg-transparent text-base text-zinc-900 leading-relaxed placeholder:text-zinc-500 focus:outline-none", Oe = "rounded-md px-2 py-1 text-xs text-zinc-500 transition-colors hover:bg-zinc-100", ke = "rounded-md px-2 py-1 text-xs transition-opacity hover:opacity-80", Ae = ({ autoGrowMax: e, boxClassName: n = Ee, inputClassName: r = De, cancelClassName: i = Oe, sendClassName: a = ke, sendStyle: o }) => {
|
|
227
227
|
let s = G((e) => e.thread.isRunning);
|
|
228
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ k(H.Root, {
|
|
229
229
|
className: "mb-4 pr-2 pl-0",
|
|
230
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ A(V.Root, { children: [/* @__PURE__ */ k("div", {
|
|
231
231
|
className: n,
|
|
232
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ k(V.Input, {
|
|
233
233
|
className: r,
|
|
234
234
|
rows: 1,
|
|
235
235
|
onInput: (t) => _(t.currentTarget, e)
|
|
236
236
|
})
|
|
237
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ A("div", {
|
|
238
238
|
className: "mt-2 flex justify-end gap-1.5",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ k(V.Cancel, {
|
|
240
240
|
className: i,
|
|
241
241
|
children: "Cancel"
|
|
242
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ k(V.Send, {
|
|
243
243
|
disabled: s,
|
|
244
244
|
className: `${a} ${t}`,
|
|
245
245
|
style: o,
|
|
@@ -248,14 +248,14 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
248
248
|
})] })
|
|
249
249
|
});
|
|
250
250
|
}, je = 1500, Me = () => {
|
|
251
|
-
let [e, t] =
|
|
252
|
-
return
|
|
251
|
+
let [e, t] = D("idle");
|
|
252
|
+
return T(() => {
|
|
253
253
|
if (e === "idle") return;
|
|
254
254
|
let n = setTimeout(() => t("idle"), je);
|
|
255
255
|
return () => clearTimeout(n);
|
|
256
256
|
}, [e]), {
|
|
257
257
|
state: e,
|
|
258
|
-
run:
|
|
258
|
+
run: C(async (e) => {
|
|
259
259
|
try {
|
|
260
260
|
await e(), t("copied");
|
|
261
261
|
} catch {
|
|
@@ -280,12 +280,12 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
280
280
|
}
|
|
281
281
|
}, Pe = ({ onCopy: e, idleLabel: t, className: n }) => {
|
|
282
282
|
let { state: r, run: i } = Me(), { Icon: a, label: o, tone: s } = Ne[r], c = r === "idle" ? t : o;
|
|
283
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ A("button", {
|
|
284
284
|
type: "button",
|
|
285
285
|
"aria-label": c,
|
|
286
286
|
onClick: () => i(e),
|
|
287
287
|
className: `${n} flex items-center gap-1.5 rounded px-2 py-0.5 text-[10px] transition-colors`,
|
|
288
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ k(a, { className: ["h-3 w-3", s].filter(Boolean).join(" ") }), /* @__PURE__ */ k("span", { children: c })]
|
|
289
289
|
});
|
|
290
290
|
}, Fe = ({ idleClassName: e = "text-zinc-500 hover:text-zinc-900", copiedClassName: t = "text-emerald-500", errorClassName: n = "text-rose-500", className: r = "rounded p-1.5 transition-colors", iconClassName: i = "h-3 w-3" }) => {
|
|
291
291
|
let { state: a, run: o } = Me(), s = G((e) => e.message), c = () => {
|
|
@@ -296,12 +296,12 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
296
296
|
copied: t,
|
|
297
297
|
error: n
|
|
298
298
|
}[a];
|
|
299
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ k("button", {
|
|
300
300
|
type: "button",
|
|
301
301
|
"aria-label": a === "idle" ? "Copy message" : u,
|
|
302
302
|
onClick: c,
|
|
303
303
|
className: `${r} ${d}`,
|
|
304
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ k(l, { className: i })
|
|
305
305
|
});
|
|
306
306
|
}, Ie = /^[=@]|^[+-](?![\d.,\s])/, Le = (e) => Ie.test(e) ? `'${e}` : e, Re = (e) => Le((e.innerText || e.textContent || "").replace(/\s+/g, " ").trim()), ze = (e) => Array.from(e.rows).map((e) => Array.from(e.cells).map(Re).join(" ")).join("\n"), Be = new Set([
|
|
307
307
|
"colspan",
|
|
@@ -329,53 +329,53 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
329
329
|
}
|
|
330
330
|
}, Ue = ({ children: e }) => {
|
|
331
331
|
let t = "plaintext", n = "";
|
|
332
|
-
return
|
|
333
|
-
if (
|
|
332
|
+
return b.forEach(e, (e) => {
|
|
333
|
+
if (S(e)) {
|
|
334
334
|
let r = e.props, i = /language-(\w+)/.exec(r.className ?? "");
|
|
335
335
|
i && (t = i[1] ?? t), typeof r.children == "string" && (n = r.children.trim());
|
|
336
336
|
}
|
|
337
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ A("div", {
|
|
338
338
|
className: "ai-chat-code not-prose my-4 overflow-hidden rounded-xl border",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ A("div", {
|
|
340
340
|
className: "ai-chat-code__header flex items-center justify-between px-4 py-2",
|
|
341
|
-
children: [/* @__PURE__ */
|
|
341
|
+
children: [/* @__PURE__ */ k("span", {
|
|
342
342
|
className: "ai-chat-code__label font-mono text-[10px] uppercase tracking-widest",
|
|
343
343
|
children: t
|
|
344
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ k(Pe, {
|
|
345
345
|
idleLabel: "Copy",
|
|
346
346
|
onCopy: () => navigator.clipboard.writeText(n),
|
|
347
347
|
className: "ai-chat-code__copy"
|
|
348
348
|
})]
|
|
349
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ k("pre", {
|
|
350
350
|
className: "ai-chat-code__pre overflow-x-auto px-4 py-4 font-mono text-sm leading-relaxed",
|
|
351
351
|
children: e
|
|
352
352
|
})]
|
|
353
353
|
});
|
|
354
|
-
}, We = (e) => /* @__PURE__ */
|
|
354
|
+
}, We = (e) => /* @__PURE__ */ k("a", {
|
|
355
355
|
...e,
|
|
356
356
|
target: "_blank",
|
|
357
357
|
rel: "noopener noreferrer"
|
|
358
358
|
}), Ge = ({ className: e, ...t }) => {
|
|
359
|
-
let n =
|
|
360
|
-
return /* @__PURE__ */
|
|
359
|
+
let n = E(null);
|
|
360
|
+
return /* @__PURE__ */ A("div", {
|
|
361
361
|
className: "w-full",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ k("div", {
|
|
363
363
|
className: "not-prose mb-1 flex justify-end",
|
|
364
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ k(Pe, {
|
|
365
365
|
idleLabel: "Copy table",
|
|
366
366
|
onCopy: () => He(n.current),
|
|
367
367
|
className: "ai-chat-table__copy"
|
|
368
368
|
})
|
|
369
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ k("div", {
|
|
370
370
|
className: "w-full max-w-full overflow-x-auto",
|
|
371
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ k("table", {
|
|
372
372
|
...t,
|
|
373
373
|
ref: n,
|
|
374
374
|
className: ["w-max min-w-full [&_td]:max-w-[20rem] [&_th]:max-w-[20rem]", e].filter(Boolean).join(" ")
|
|
375
375
|
})
|
|
376
376
|
})]
|
|
377
377
|
});
|
|
378
|
-
}, Ke = () => /* @__PURE__ */
|
|
378
|
+
}, Ke = () => /* @__PURE__ */ k(oe, {
|
|
379
379
|
remarkPlugins: [se],
|
|
380
380
|
components: {
|
|
381
381
|
pre: Ue,
|
|
@@ -400,8 +400,8 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
400
400
|
let t = Math.floor(e / 60), n = e % 60;
|
|
401
401
|
return t > 0 ? `${t}m ${n.toString().padStart(2, "0")}s` : `${n}s`;
|
|
402
402
|
}, Ye = ({ phrases: e = qe, textClassName: t = "ai-thinking-text", timerClassName: n = "text-xs text-zinc-500/70 tabular-nums", longRunningClassName: r = "ml-1.5 text-zinc-500/45", longRunningHint: i = "· hang tight" }) => {
|
|
403
|
-
let [a, o] =
|
|
404
|
-
|
|
403
|
+
let [a, o] = D(() => e.length > 0 ? Math.floor(Math.random() * e.length) : 0), [s, c] = D(0);
|
|
404
|
+
T(() => {
|
|
405
405
|
let t = e.length > 0 ? setInterval(() => {
|
|
406
406
|
o((t) => (t + 1) % e.length);
|
|
407
407
|
}, 2800) : null, n = setInterval(() => {
|
|
@@ -412,111 +412,111 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
412
412
|
};
|
|
413
413
|
}, [e.length]);
|
|
414
414
|
let l = e[a] ?? "Thinking", u = s >= 3, d = s >= 30;
|
|
415
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ A("div", {
|
|
416
416
|
className: "flex flex-wrap items-center gap-x-3 gap-y-0.5 py-1",
|
|
417
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ A("div", {
|
|
418
418
|
className: "flex min-w-0 items-center gap-3",
|
|
419
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ A("div", {
|
|
420
420
|
className: "ai-dust",
|
|
421
421
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ k("span", { style: {
|
|
423
423
|
left: "4px",
|
|
424
424
|
"--delay": ".3s"
|
|
425
425
|
} }),
|
|
426
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ k("span", { style: {
|
|
427
427
|
left: "12px",
|
|
428
428
|
"--delay": "0s"
|
|
429
429
|
} }),
|
|
430
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ k("span", { style: {
|
|
431
431
|
left: "20px",
|
|
432
432
|
"--delay": ".6s"
|
|
433
433
|
} })
|
|
434
434
|
]
|
|
435
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ A("span", {
|
|
436
436
|
className: `${t} min-w-0 truncate font-semibold text-sm transition-opacity duration-500`,
|
|
437
437
|
children: [l, "…"]
|
|
438
438
|
})]
|
|
439
|
-
}), u && /* @__PURE__ */
|
|
439
|
+
}), u && /* @__PURE__ */ A("span", {
|
|
440
440
|
className: `${n} min-w-0 truncate`,
|
|
441
|
-
children: [Je(s), d && /* @__PURE__ */
|
|
441
|
+
children: [Je(s), d && /* @__PURE__ */ k("span", {
|
|
442
442
|
className: r,
|
|
443
443
|
children: i
|
|
444
444
|
})]
|
|
445
445
|
})]
|
|
446
446
|
});
|
|
447
|
-
}, Xe = () => null, Ze = "max-w-none text-sm text-zinc-900 leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_a:hover]:text-sky-700 [&_a]:break-words [&_a]:font-medium [&_a]:text-sky-600 [&_a]:underline [&_a]:underline-offset-2 [&_li]:text-sm [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p]:my-2 [&_p]:text-sm [&_strong]:font-semibold [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5", Qe = "group pr-4 pb-6", $e = "mt-2 flex items-center gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100", et = "text-xs text-zinc-500/60", tt = "rounded p-1.5 text-zinc-500 transition-colors hover:text-zinc-900", nt = ({ tools: t = Xe, Parts: n, thinkingIndicator: i = /* @__PURE__ */
|
|
448
|
-
let b = G((e) => e.message),
|
|
447
|
+
}, Xe = () => null, Ze = "max-w-none text-sm text-zinc-900 leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_a:hover]:text-sky-700 [&_a]:break-words [&_a]:font-medium [&_a]:text-sky-600 [&_a]:underline [&_a]:underline-offset-2 [&_li]:text-sm [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p]:my-2 [&_p]:text-sm [&_strong]:font-semibold [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5", Qe = "group pr-4 pb-6", $e = "mt-2 flex items-center gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100", et = "text-xs text-zinc-500/60", tt = "rounded p-1.5 text-zinc-500 transition-colors hover:text-zinc-900", nt = ({ tools: t = Xe, Parts: n, thinkingIndicator: i = /* @__PURE__ */ k(Ye, {}), rootClassName: a = Qe, contentClassName: o = Ze, metaClassName: s = $e, wrapContent: c, metaSlot: l, copyIdleClassName: u, copyCopiedClassName: d, reloadClassName: f = tt, reloadDisabledReason: p, timeClassName: m = et, timeFormatOptions: h, readOnly: g = !1, belowContent: _, footerSlot: y }) => {
|
|
448
|
+
let b = G((e) => e.message), x = e(b), S = n ?? H.Content, C = b.status?.type === "running", w = /* @__PURE__ */ k("div", {
|
|
449
449
|
className: o,
|
|
450
|
-
children: /* @__PURE__ */
|
|
450
|
+
children: /* @__PURE__ */ k(S, { components: {
|
|
451
451
|
Text: Ke,
|
|
452
452
|
tools: { Fallback: t }
|
|
453
453
|
} })
|
|
454
454
|
});
|
|
455
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ k(H.Root, {
|
|
456
456
|
className: a,
|
|
457
457
|
"data-assistant-message": "true",
|
|
458
|
-
children: /* @__PURE__ */
|
|
458
|
+
children: /* @__PURE__ */ A("div", {
|
|
459
459
|
className: "flex min-w-0 flex-col",
|
|
460
460
|
children: [
|
|
461
|
-
c ? c(
|
|
462
|
-
|
|
461
|
+
c ? c(w) : w,
|
|
462
|
+
C && /* @__PURE__ */ k("div", {
|
|
463
463
|
className: "mt-1",
|
|
464
464
|
children: i
|
|
465
465
|
}),
|
|
466
|
-
!
|
|
466
|
+
!C && _ && /* @__PURE__ */ k("div", {
|
|
467
467
|
className: "mt-2",
|
|
468
468
|
children: _
|
|
469
469
|
}),
|
|
470
|
-
!
|
|
470
|
+
!C && /* @__PURE__ */ A("div", {
|
|
471
471
|
className: s,
|
|
472
472
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ k("span", {
|
|
474
474
|
className: m,
|
|
475
|
-
title: r(
|
|
476
|
-
children: v(
|
|
475
|
+
title: r(x) || void 0,
|
|
476
|
+
children: v(x, h)
|
|
477
477
|
}),
|
|
478
478
|
l,
|
|
479
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ A(B.Root, {
|
|
480
480
|
className: "flex items-center gap-0.5",
|
|
481
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ k(Fe, {
|
|
482
482
|
idleClassName: u,
|
|
483
483
|
copiedClassName: d
|
|
484
|
-
}), !g && /* @__PURE__ */
|
|
484
|
+
}), !g && /* @__PURE__ */ k(B.Reload, {
|
|
485
485
|
disabled: p ? !0 : void 0,
|
|
486
486
|
title: p,
|
|
487
487
|
className: `${f} disabled:cursor-not-allowed disabled:opacity-40`,
|
|
488
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ k(L, { className: "h-3 w-3" })
|
|
489
489
|
})]
|
|
490
490
|
})
|
|
491
491
|
]
|
|
492
492
|
}),
|
|
493
|
-
!
|
|
493
|
+
!C && y
|
|
494
494
|
]
|
|
495
495
|
})
|
|
496
496
|
});
|
|
497
497
|
}, rt = "group flex flex-col items-end pb-4 pl-12", it = "rounded-2xl border border-zinc-200 bg-zinc-100 px-3.5 py-2.5 text-sm text-zinc-900 leading-relaxed", at = "mt-1 flex items-center gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100", ot = "text-xs text-zinc-500/60", st = "rounded px-2 py-1 font-medium text-xs text-zinc-500 transition-colors hover:text-zinc-900", ct = ({ attachmentsSlot: t, rootClassName: n = rt, bubbleClassName: i = it, contentSlot: a, metaClassName: o = at, timeClassName: s = ot, editClassName: c = st, copyIdleClassName: l, copyCopiedClassName: u, timeFormatOptions: d, readOnly: f = !1, editDisabledReason: p }) => {
|
|
498
498
|
let m = G((e) => e.message), h = G((e) => e.thread.isRunning), g = e(m);
|
|
499
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ A(H.Root, {
|
|
500
500
|
className: n,
|
|
501
501
|
"data-user-message": "true",
|
|
502
502
|
children: [
|
|
503
503
|
t,
|
|
504
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ k("div", {
|
|
505
505
|
className: i,
|
|
506
|
-
children: a ?? /* @__PURE__ */
|
|
506
|
+
children: a ?? /* @__PURE__ */ k(H.Content, {})
|
|
507
507
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ A("div", {
|
|
509
509
|
className: o,
|
|
510
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ k("span", {
|
|
511
511
|
className: s,
|
|
512
512
|
title: r(g) || void 0,
|
|
513
513
|
children: v(g, d)
|
|
514
|
-
}), /* @__PURE__ */
|
|
514
|
+
}), /* @__PURE__ */ A(B.Root, {
|
|
515
515
|
className: "flex items-center gap-0.5",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ k(Fe, {
|
|
517
517
|
idleClassName: l,
|
|
518
518
|
copiedClassName: u
|
|
519
|
-
}), !f && /* @__PURE__ */
|
|
519
|
+
}), !f && /* @__PURE__ */ k(B.Edit, {
|
|
520
520
|
disabled: h || !!p,
|
|
521
521
|
title: p,
|
|
522
522
|
className: `${c} disabled:cursor-not-allowed disabled:opacity-40`,
|
|
@@ -526,7 +526,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
526
526
|
})
|
|
527
527
|
]
|
|
528
528
|
});
|
|
529
|
-
}, lt = () => /* @__PURE__ */
|
|
529
|
+
}, lt = () => /* @__PURE__ */ k(Ae, { sendStyle: {
|
|
530
530
|
backgroundColor: "var(--color-brand, #0a0a0a)",
|
|
531
531
|
color: "var(--color-brand-foreground, #fff)"
|
|
532
532
|
} }), ut = [
|
|
@@ -540,7 +540,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
540
540
|
"w-2/3",
|
|
541
541
|
"w-3/5"
|
|
542
542
|
], ft = ({ workspaceId: e, siteName: t, siteLogo: n, apiBaseUrl: r, authHeaders: i, agentId: a, followUps: s, hideComposer: c = !1 }) => {
|
|
543
|
-
let l = W(), u = G((e) => e.thread.isRunning), { agentUnavailable: d } = fe(), f =
|
|
543
|
+
let l = W(), u = G((e) => e.thread.isRunning), { agentUnavailable: d } = fe(), f = E(null), { isAtBottom: p, scrollToBottom: m } = be({
|
|
544
544
|
viewportRef: f,
|
|
545
545
|
isRunning: u
|
|
546
546
|
}), h = _e({
|
|
@@ -550,35 +550,35 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
550
550
|
"Levo-Workspace": e
|
|
551
551
|
} : void 0,
|
|
552
552
|
fallback: ut
|
|
553
|
-
}), g =
|
|
553
|
+
}), g = C((e) => {
|
|
554
554
|
y(l.thread.composer(), e);
|
|
555
|
-
}, [l]), _ =
|
|
556
|
-
return
|
|
555
|
+
}, [l]), _ = C(() => l.thread.cancelRun(), [l]), v = E(u);
|
|
556
|
+
return T(() => {
|
|
557
557
|
v.current = u;
|
|
558
|
-
}, [u]),
|
|
558
|
+
}, [u]), T(() => {
|
|
559
559
|
let e = (e) => {
|
|
560
560
|
e.key !== "Escape" || e.isComposing || !v.current || (e.preventDefault(), e.stopImmediatePropagation(), l.thread.cancelRun());
|
|
561
561
|
};
|
|
562
562
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
563
|
-
}, [l]), /* @__PURE__ */
|
|
563
|
+
}, [l]), /* @__PURE__ */ A(U.Root, {
|
|
564
564
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
565
565
|
children: [
|
|
566
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ k(U.If, {
|
|
567
567
|
empty: !0,
|
|
568
|
-
children: /* @__PURE__ */
|
|
568
|
+
children: /* @__PURE__ */ k("div", {
|
|
569
569
|
className: "pointer-events-none absolute inset-0 z-0 overflow-hidden",
|
|
570
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ k("div", {
|
|
571
571
|
className: "absolute inset-0",
|
|
572
572
|
style: { background: ["radial-gradient(at 12% 18%, color-mix(in oklch, var(--color-brand, #4691e8) 12%, transparent) 0px, transparent 55%)", "radial-gradient(at 88% 82%, color-mix(in oklch, var(--color-brand-secondary, #db646d) 8%, transparent) 0px, transparent 55%)"].join(", ") }
|
|
573
573
|
})
|
|
574
574
|
})
|
|
575
575
|
}),
|
|
576
|
-
d && /* @__PURE__ */
|
|
576
|
+
d && /* @__PURE__ */ k("div", {
|
|
577
577
|
role: "alert",
|
|
578
578
|
className: "relative z-20 shrink-0 border-amber-200 border-b bg-amber-50 px-4 py-2.5 text-amber-800 text-xs",
|
|
579
579
|
children: "This conversation is no longer available. Please refresh the page to start a new chat."
|
|
580
580
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ A(U.Viewport, {
|
|
582
582
|
ref: f,
|
|
583
583
|
turnAnchor: "top",
|
|
584
584
|
className: "relative z-10 flex-1 overflow-y-auto",
|
|
@@ -586,20 +586,20 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
586
586
|
scrollToBottomOnRunStart: !1,
|
|
587
587
|
scrollToBottomOnInitialize: !1,
|
|
588
588
|
scrollToBottomOnThreadSwitch: !1,
|
|
589
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ k(U.Empty, { children: /* @__PURE__ */ A("div", {
|
|
590
590
|
className: "flex min-h-full flex-col items-center justify-center px-6 py-6",
|
|
591
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ A("div", {
|
|
592
592
|
className: "mb-5 flex flex-col items-center gap-2 text-center",
|
|
593
593
|
children: [
|
|
594
|
-
n ? /* @__PURE__ */
|
|
594
|
+
n ? /* @__PURE__ */ k("img", {
|
|
595
595
|
src: n,
|
|
596
596
|
alt: t ?? "Site logo",
|
|
597
597
|
className: "mb-1 h-12 w-auto max-w-[180px] object-contain"
|
|
598
|
-
}) : /* @__PURE__ */
|
|
598
|
+
}) : /* @__PURE__ */ k("span", {
|
|
599
599
|
className: "font-semibold text-lg text-zinc-900 tracking-tight",
|
|
600
600
|
children: t ?? "This site"
|
|
601
601
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ k("p", {
|
|
603
603
|
className: "mt-1 text-2xl text-zinc-900 tracking-tight",
|
|
604
604
|
style: {
|
|
605
605
|
fontFamily: "var(--font-heading, inherit)",
|
|
@@ -607,18 +607,18 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
607
607
|
},
|
|
608
608
|
children: "Ask anything"
|
|
609
609
|
}),
|
|
610
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ k("p", {
|
|
611
611
|
className: "text-sm text-zinc-500",
|
|
612
612
|
style: { fontFamily: "var(--font-heading, inherit)" },
|
|
613
613
|
children: "Get instant answers about products, pricing, and how to get started."
|
|
614
614
|
})
|
|
615
615
|
]
|
|
616
|
-
}), /* @__PURE__ */
|
|
616
|
+
}), /* @__PURE__ */ k("div", {
|
|
617
617
|
className: "flex w-full max-w-md flex-col gap-2",
|
|
618
|
-
children: h === null ? dt.map((e, t) => /* @__PURE__ */
|
|
618
|
+
children: h === null ? dt.map((e, t) => /* @__PURE__ */ k("div", {
|
|
619
619
|
className: "flex h-[42px] items-center rounded-xl border border-zinc-200 bg-white px-4",
|
|
620
|
-
children: /* @__PURE__ */
|
|
621
|
-
}, `skeleton-${t}`)) : h.map((e, t) => /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ k("span", { className: `block h-3 animate-pulse rounded bg-zinc-200 ${e}` })
|
|
621
|
+
}, `skeleton-${t}`)) : h.map((e, t) => /* @__PURE__ */ k("button", {
|
|
622
622
|
type: "button",
|
|
623
623
|
onClick: () => g(e),
|
|
624
624
|
className: "ai-chat-suggestion rounded-xl border border-zinc-200 bg-white px-4 py-2.5 text-left text-sm text-zinc-700 transition-[border-color,background-color,transform] duration-150 hover:border-zinc-300 hover:bg-zinc-50 active:scale-[0.98]",
|
|
@@ -626,11 +626,11 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
626
626
|
children: e
|
|
627
627
|
}, e))
|
|
628
628
|
})]
|
|
629
|
-
}) }), /* @__PURE__ */
|
|
629
|
+
}) }), /* @__PURE__ */ k(U.If, {
|
|
630
630
|
empty: !1,
|
|
631
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ k("div", {
|
|
632
632
|
className: "ai-chat-kb-messages mx-auto max-w-3xl px-6 py-6 pt-8",
|
|
633
|
-
children: /* @__PURE__ */
|
|
633
|
+
children: /* @__PURE__ */ k(U.Messages, { components: {
|
|
634
634
|
UserMessage: ct,
|
|
635
635
|
AssistantMessage: nt,
|
|
636
636
|
EditComposer: lt
|
|
@@ -638,58 +638,58 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
638
638
|
})
|
|
639
639
|
})]
|
|
640
640
|
}),
|
|
641
|
-
!c && /* @__PURE__ */
|
|
641
|
+
!c && /* @__PURE__ */ k("div", {
|
|
642
642
|
className: "relative z-10 shrink-0 border-zinc-200 border-t bg-white/95 backdrop-blur-sm",
|
|
643
|
-
children: /* @__PURE__ */
|
|
643
|
+
children: /* @__PURE__ */ A("div", {
|
|
644
644
|
className: "relative mx-auto max-w-3xl px-4 pt-3 pb-3",
|
|
645
645
|
children: [
|
|
646
|
-
!p && /* @__PURE__ */
|
|
646
|
+
!p && /* @__PURE__ */ k("div", {
|
|
647
647
|
className: "pointer-events-none absolute inset-x-0 -top-9 z-20 flex justify-center",
|
|
648
|
-
children: /* @__PURE__ */
|
|
648
|
+
children: /* @__PURE__ */ k(ge, {
|
|
649
649
|
onClick: m,
|
|
650
650
|
isRunning: u,
|
|
651
651
|
className: "pointer-events-auto rounded-full border border-zinc-200 bg-white/95 px-3 py-1.5 font-medium text-xs text-zinc-500 shadow-lg backdrop-blur-sm hover:text-zinc-900"
|
|
652
652
|
})
|
|
653
653
|
}),
|
|
654
|
-
s.length > 0 && !u && /* @__PURE__ */
|
|
654
|
+
s.length > 0 && !u && /* @__PURE__ */ k("div", {
|
|
655
655
|
className: "mb-2",
|
|
656
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ k(K, {
|
|
657
657
|
chips: s,
|
|
658
658
|
onSelect: g,
|
|
659
659
|
size: "compact"
|
|
660
660
|
})
|
|
661
661
|
}),
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ A(V.Root, { children: [
|
|
663
|
+
/* @__PURE__ */ k(U.If, {
|
|
664
664
|
empty: !0,
|
|
665
|
-
children: /* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ k(Te, {
|
|
666
666
|
variant: "expanded",
|
|
667
667
|
isRunning: u,
|
|
668
668
|
onStop: _
|
|
669
669
|
})
|
|
670
670
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ k(U.If, {
|
|
672
672
|
empty: !1,
|
|
673
|
-
children: /* @__PURE__ */
|
|
673
|
+
children: /* @__PURE__ */ k(Te, {
|
|
674
674
|
variant: "compact",
|
|
675
675
|
isRunning: u,
|
|
676
676
|
onStop: _
|
|
677
677
|
})
|
|
678
678
|
}),
|
|
679
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ k(V.If, {
|
|
680
680
|
dictation: !0,
|
|
681
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ A("div", {
|
|
682
682
|
className: "mt-2 flex items-center justify-center gap-2",
|
|
683
|
-
children: [/* @__PURE__ */
|
|
683
|
+
children: [/* @__PURE__ */ k("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-red-500" }), /* @__PURE__ */ k("span", {
|
|
684
684
|
className: "font-medium text-red-500 text-xs tracking-wide",
|
|
685
685
|
children: "Listening… speak now"
|
|
686
686
|
})]
|
|
687
687
|
})
|
|
688
688
|
})
|
|
689
689
|
] }),
|
|
690
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ k(U.If, {
|
|
691
691
|
empty: !1,
|
|
692
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ k("p", {
|
|
693
693
|
className: "mt-2 text-center text-[10px] text-zinc-500/70",
|
|
694
694
|
children: "Answers can be inaccurate. Verify before relying on them."
|
|
695
695
|
})
|
|
@@ -719,11 +719,11 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
719
719
|
let i = document.referrer?.trim();
|
|
720
720
|
if (i && (e.referrer = i), Object.keys(e).length !== 0) return e.description && Y(e) > J && delete e.description, e.referrer && Y(e) > J && delete e.referrer, e.url && Y(e) > J && (e.url = e.url.slice(0, ht)), e;
|
|
721
721
|
}, bt = ({ workspaceId: e, siteName: t, siteLogo: n, agentId: r, apiBaseUrl: i, authHeaders: a, children: s }) => {
|
|
722
|
-
let c =
|
|
722
|
+
let c = E(e);
|
|
723
723
|
c.current = e;
|
|
724
|
-
let l =
|
|
724
|
+
let l = E(r);
|
|
725
725
|
l.current = r;
|
|
726
|
-
let { followUps: u, clearOnSend: d, handleData: f } = ue(), [p, m] =
|
|
726
|
+
let { followUps: u, clearOnSend: d, handleData: f } = ue(), [p, m] = D(!1), { conversationIdRef: h, handleFinish: g, reset: _ } = le(e), v = ae({
|
|
727
727
|
joinStrategy: "none",
|
|
728
728
|
transport: ce({
|
|
729
729
|
api: `${i}/stream`,
|
|
@@ -751,7 +751,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
751
751
|
onError: (e) => {
|
|
752
752
|
de(e) ? m(!0) : console.warn("[levo-kb-chat] stream error:", e);
|
|
753
753
|
}
|
|
754
|
-
}), y =
|
|
754
|
+
}), y = C(() => {
|
|
755
755
|
v.threads.switchToNewThread().catch((e) => {
|
|
756
756
|
console.warn("[levo-kb-chat] switchToNewThread failed:", e);
|
|
757
757
|
}), _(), d(), m(!1);
|
|
@@ -760,14 +760,14 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
760
760
|
_,
|
|
761
761
|
d
|
|
762
762
|
]);
|
|
763
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ k(ne, {
|
|
764
764
|
runtime: v,
|
|
765
|
-
children: /* @__PURE__ */
|
|
765
|
+
children: /* @__PURE__ */ k(q.Provider, {
|
|
766
766
|
value: { agentUnavailable: p },
|
|
767
767
|
children: s ? s({
|
|
768
768
|
followUps: u,
|
|
769
769
|
onResetChat: y
|
|
770
|
-
}) : /* @__PURE__ */
|
|
770
|
+
}) : /* @__PURE__ */ k(ft, {
|
|
771
771
|
workspaceId: e,
|
|
772
772
|
siteName: t,
|
|
773
773
|
siteLogo: n,
|
|
@@ -779,7 +779,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
779
779
|
})
|
|
780
780
|
});
|
|
781
781
|
}, xt = (e, t, n) => {
|
|
782
|
-
|
|
782
|
+
T(() => {
|
|
783
783
|
if (!e) return;
|
|
784
784
|
let r = (e) => {
|
|
785
785
|
if (e.key !== "Escape" || e.isComposing) return;
|
|
@@ -797,13 +797,13 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
797
797
|
n
|
|
798
798
|
]);
|
|
799
799
|
}, X = "(max-width: 639px)", Z = () => {
|
|
800
|
-
let [e, t] =
|
|
801
|
-
return
|
|
800
|
+
let [e, t] = D(() => typeof window < "u" && window.matchMedia(X).matches);
|
|
801
|
+
return T(() => {
|
|
802
802
|
let e = window.matchMedia(X), n = () => t(e.matches);
|
|
803
803
|
return n(), e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
804
804
|
}, []), e;
|
|
805
805
|
}, St = (e, t) => {
|
|
806
|
-
|
|
806
|
+
T(() => {
|
|
807
807
|
let n = t.current, r = window.visualViewport;
|
|
808
808
|
if (!e || !n || !r || !window.matchMedia(X).matches) return;
|
|
809
809
|
let i = () => {
|
|
@@ -814,7 +814,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
814
814
|
};
|
|
815
815
|
}, [e, t]);
|
|
816
816
|
}, Ct = (e, t, n) => {
|
|
817
|
-
|
|
817
|
+
T(() => {
|
|
818
818
|
if (!e) return;
|
|
819
819
|
let r = (e) => {
|
|
820
820
|
let r = e.composedPath();
|
|
@@ -827,11 +827,11 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
827
827
|
n
|
|
828
828
|
]);
|
|
829
829
|
}, Q = (...e) => e.filter(Boolean).join(" "), wt = ({ open: e, onToggle: t, askLabel: r, panelId: o, initialDraft: s }) => {
|
|
830
|
-
let _ = W(), v = Z(), y = G((e) => e.thread.isRunning),
|
|
831
|
-
|
|
830
|
+
let _ = W(), v = Z(), y = G((e) => e.thread.isRunning), b = G((e) => e.thread.messages.length > 0), x = G((e) => e.composer.text), S = x.trim().length > 0, [C, w] = D(!1);
|
|
831
|
+
T(() => {
|
|
832
832
|
s && _.thread.composer().setText(s);
|
|
833
833
|
}, []);
|
|
834
|
-
let M =
|
|
834
|
+
let M = E(null), N = E(null), P = E(!1);
|
|
835
835
|
ee(() => {
|
|
836
836
|
let e = M.current;
|
|
837
837
|
!e || document.activeElement === e || (P.current = !0, e.focus({ preventScroll: !0 }));
|
|
@@ -839,43 +839,43 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
839
839
|
let t = M.current, n = N.current;
|
|
840
840
|
if (!(!t || !n)) {
|
|
841
841
|
if (!e) {
|
|
842
|
-
t.style.height = "",
|
|
842
|
+
t.style.height = "", w(!1);
|
|
843
843
|
return;
|
|
844
844
|
}
|
|
845
|
-
|
|
845
|
+
w(u(n, t));
|
|
846
846
|
}
|
|
847
|
-
}, [
|
|
848
|
-
let F =
|
|
849
|
-
|
|
847
|
+
}, [x, e]);
|
|
848
|
+
let F = E(e);
|
|
849
|
+
T(() => {
|
|
850
850
|
let t = F.current;
|
|
851
851
|
F.current = e;
|
|
852
852
|
let n = M.current;
|
|
853
853
|
e || !t || !n || document.activeElement === n && n.blur();
|
|
854
854
|
}, [e]);
|
|
855
|
-
let L =
|
|
856
|
-
|
|
855
|
+
let L = E(y);
|
|
856
|
+
T(() => {
|
|
857
857
|
let e = !L.current && y;
|
|
858
858
|
L.current = y, v && e && M.current?.blur();
|
|
859
859
|
}, [y, v]);
|
|
860
|
-
let z =
|
|
861
|
-
return /* @__PURE__ */
|
|
860
|
+
let z = b ? "Continue conversation" : r;
|
|
861
|
+
return /* @__PURE__ */ k("div", {
|
|
862
862
|
className: Q(d, e ? m : i),
|
|
863
|
-
children: /* @__PURE__ */
|
|
863
|
+
children: /* @__PURE__ */ A("div", {
|
|
864
864
|
ref: N,
|
|
865
|
-
className: Q(g,
|
|
865
|
+
className: Q(g, C && "ai-chat-pill-surface--stacked"),
|
|
866
866
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ k("button", {
|
|
868
868
|
type: "button",
|
|
869
869
|
onClick: t,
|
|
870
870
|
"aria-label": e ? "Collapse AI chat" : "Expand AI chat",
|
|
871
871
|
"aria-expanded": e,
|
|
872
872
|
"aria-controls": o,
|
|
873
873
|
className: l,
|
|
874
|
-
children: /* @__PURE__ */
|
|
874
|
+
children: /* @__PURE__ */ k(te, { className: "h-5 w-5" })
|
|
875
875
|
}),
|
|
876
|
-
/* @__PURE__ */
|
|
876
|
+
/* @__PURE__ */ A("div", {
|
|
877
877
|
className: p,
|
|
878
|
-
children: [/* @__PURE__ */
|
|
878
|
+
children: [/* @__PURE__ */ k(V.Input, {
|
|
879
879
|
ref: M,
|
|
880
880
|
"data-ai-chat-composer": "",
|
|
881
881
|
placeholder: e ? "Ask anything…" : "",
|
|
@@ -887,7 +887,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
887
887
|
e || t();
|
|
888
888
|
},
|
|
889
889
|
onKeyDown: (e) => {
|
|
890
|
-
e.nativeEvent.isComposing || e.key !== "Enter" || e.shiftKey || (e.preventDefault(), !y &&
|
|
890
|
+
e.nativeEvent.isComposing || e.key !== "Enter" || e.shiftKey || (e.preventDefault(), !y && S && _.thread.composer().send());
|
|
891
891
|
},
|
|
892
892
|
rows: 1,
|
|
893
893
|
submitMode: "enter",
|
|
@@ -899,73 +899,73 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
899
899
|
autoCapitalize: "none",
|
|
900
900
|
inputMode: "text",
|
|
901
901
|
className: Q(a, "transition-opacity duration-200", !e && "opacity-0")
|
|
902
|
-
}), /* @__PURE__ */
|
|
902
|
+
}), /* @__PURE__ */ k("span", {
|
|
903
903
|
className: Q(c, "transition-opacity duration-150", e && "opacity-0"),
|
|
904
904
|
"aria-hidden": !0,
|
|
905
905
|
children: z
|
|
906
906
|
})]
|
|
907
907
|
}),
|
|
908
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ A("div", {
|
|
909
909
|
className: h,
|
|
910
|
-
children: [e && /* @__PURE__ */
|
|
910
|
+
children: [e && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(V.If, {
|
|
911
911
|
dictation: !1,
|
|
912
|
-
children: /* @__PURE__ */
|
|
912
|
+
children: /* @__PURE__ */ k(V.Dictate, {
|
|
913
913
|
"aria-label": "Start dictation",
|
|
914
914
|
className: "ai-chat-icon-btn flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full transition-colors active:scale-95",
|
|
915
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ k(I, { className: "h-5 w-5" })
|
|
916
916
|
})
|
|
917
|
-
}), /* @__PURE__ */
|
|
917
|
+
}), /* @__PURE__ */ k(V.If, {
|
|
918
918
|
dictation: !0,
|
|
919
|
-
children: /* @__PURE__ */
|
|
919
|
+
children: /* @__PURE__ */ k(V.StopDictation, {
|
|
920
920
|
"aria-label": "Stop dictation",
|
|
921
921
|
className: "flex h-11 w-11 flex-shrink-0 animate-pulse items-center justify-center rounded-full bg-red-500/15 text-red-500 transition-colors hover:bg-red-500/25",
|
|
922
|
-
children: /* @__PURE__ */
|
|
922
|
+
children: /* @__PURE__ */ k(R, { className: "h-4 w-4 fill-current" })
|
|
923
923
|
})
|
|
924
|
-
})] }), e ? y ? /* @__PURE__ */
|
|
924
|
+
})] }), e ? y ? /* @__PURE__ */ k("button", {
|
|
925
925
|
type: "button",
|
|
926
926
|
onClick: () => _.thread.cancelRun(),
|
|
927
927
|
"aria-label": "Stop generating",
|
|
928
928
|
className: n,
|
|
929
929
|
style: f,
|
|
930
|
-
children: /* @__PURE__ */
|
|
931
|
-
}) : /* @__PURE__ */
|
|
930
|
+
children: /* @__PURE__ */ k(R, { className: "h-4 w-4 fill-current" })
|
|
931
|
+
}) : /* @__PURE__ */ k(V.Send, {
|
|
932
932
|
"aria-label": "Send message",
|
|
933
933
|
className: Q(n, "disabled:cursor-not-allowed disabled:opacity-40 disabled:shadow-none disabled:hover:scale-100"),
|
|
934
934
|
style: f,
|
|
935
|
-
children: /* @__PURE__ */
|
|
936
|
-
}) : /* @__PURE__ */
|
|
935
|
+
children: /* @__PURE__ */ k(j, { className: "h-5 w-5 stroke-[2.5px]" })
|
|
936
|
+
}) : /* @__PURE__ */ k("button", {
|
|
937
937
|
type: "button",
|
|
938
938
|
onClick: t,
|
|
939
939
|
"aria-label": "Open AI chat",
|
|
940
940
|
className: n,
|
|
941
941
|
style: f,
|
|
942
|
-
children: /* @__PURE__ */
|
|
942
|
+
children: /* @__PURE__ */ k(j, { className: "h-5 w-5 stroke-[2.5px]" })
|
|
943
943
|
})]
|
|
944
944
|
})
|
|
945
945
|
]
|
|
946
946
|
})
|
|
947
947
|
});
|
|
948
948
|
}, Tt = "linear-gradient(to right, color-mix(in oklch, var(--ai-chat-thinking-1, oklch(0.65 0.15 253.81)) 40%, transparent), color-mix(in oklch, var(--ai-chat-thinking-2, oklch(0.65 0.15 17.5826)) 40%, transparent))", $ = (...e) => e.filter(Boolean).join(" "), Et = ({ workspaceId: e, siteName: t, siteLogo: n, siteIcon: r, siteSlug: i, agentId: a, apiBaseUrl: o, authHeaders: c, initialOpen: l, initialDraft: u, showBranding: d = !0 }) => {
|
|
949
|
-
let [f, p] =
|
|
950
|
-
|
|
949
|
+
let [f, p] = D(!1);
|
|
950
|
+
T(() => {
|
|
951
951
|
if (!l) return;
|
|
952
952
|
let e = requestAnimationFrame(() => p(!0));
|
|
953
953
|
return () => cancelAnimationFrame(e);
|
|
954
954
|
}, [l]);
|
|
955
|
-
let m = `kb-chat-panel-${e ?? "default"}`, h =
|
|
955
|
+
let m = `kb-chat-panel-${e ?? "default"}`, h = E(null), g = E(null), _ = C(() => p(!1), []);
|
|
956
956
|
xt(f, g, _), Ct(f, h, _), St(f, h);
|
|
957
957
|
let v = s(t);
|
|
958
|
-
return /* @__PURE__ */
|
|
958
|
+
return /* @__PURE__ */ k("div", {
|
|
959
959
|
ref: h,
|
|
960
960
|
className: $("ai-chat-launcher pointer-events-none fixed bottom-5 left-1/2 z-[60] flex -translate-x-1/2 flex-col", "ai-chat-kb-wrap", f ? "w-[min(34rem,calc(100vw-1.5rem))]" : "ai-chat-kb-wrap-closed w-[19.5rem]"),
|
|
961
|
-
children: /* @__PURE__ */
|
|
961
|
+
children: /* @__PURE__ */ k(bt, {
|
|
962
962
|
workspaceId: e,
|
|
963
963
|
siteName: t,
|
|
964
964
|
siteLogo: n,
|
|
965
965
|
agentId: a,
|
|
966
966
|
apiBaseUrl: o,
|
|
967
967
|
authHeaders: c,
|
|
968
|
-
children: ({ followUps: s, onResetChat: l }) => /* @__PURE__ */
|
|
968
|
+
children: ({ followUps: s, onResetChat: l }) => /* @__PURE__ */ k(Ot, {
|
|
969
969
|
open: f,
|
|
970
970
|
onToggle: () => p((e) => !e),
|
|
971
971
|
threadStateRef: g,
|
|
@@ -978,7 +978,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
978
978
|
initialDraft: u,
|
|
979
979
|
showBranding: d,
|
|
980
980
|
followUps: s,
|
|
981
|
-
thread: /* @__PURE__ */
|
|
981
|
+
thread: /* @__PURE__ */ k(ft, {
|
|
982
982
|
workspaceId: e,
|
|
983
983
|
siteName: t,
|
|
984
984
|
siteLogo: n,
|
|
@@ -997,7 +997,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
997
997
|
"transition-[border-color,background-color,color,transform] duration-150 hover:border-zinc-300 hover:bg-zinc-50 hover:text-zinc-900 active:scale-95"
|
|
998
998
|
].join(" "), Ot = ({ open: e, onToggle: t, threadStateRef: n, onResetChat: r, askLabel: i, panelId: a, siteName: o, siteIcon: s, siteSlug: c, initialDraft: l, showBranding: u, followUps: d, thread: f }) => {
|
|
999
999
|
let p = W(), m = G((e) => e.thread.isRunning), h = G((e) => e.thread.messages.length > 0), g = Z() ? d.slice(0, 2) : d;
|
|
1000
|
-
|
|
1000
|
+
T(() => (n.current = {
|
|
1001
1001
|
isRunning: m,
|
|
1002
1002
|
cancelRun: () => p.thread.cancelRun()
|
|
1003
1003
|
}, () => {
|
|
@@ -1007,64 +1007,64 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
1007
1007
|
p,
|
|
1008
1008
|
n
|
|
1009
1009
|
]);
|
|
1010
|
-
let _ =
|
|
1010
|
+
let _ = C((e) => {
|
|
1011
1011
|
y(p.thread.composer(), e);
|
|
1012
|
-
}, [p]), v = o ?? "Ask AI",
|
|
1013
|
-
return /* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1012
|
+
}, [p]), v = o ?? "Ask AI", b = `https://levo.so/?utm_source=${encodeURIComponent(c || "website")}&utm_term=Powered%20By%20levo.so&utm_campaign=site_agent&utm_medium=organic_site_agent`;
|
|
1013
|
+
return /* @__PURE__ */ A(O, { children: [
|
|
1014
|
+
/* @__PURE__ */ k("div", {
|
|
1015
1015
|
"aria-hidden": !0,
|
|
1016
1016
|
className: $("absolute inset-0", e ? "pointer-events-auto" : "pointer-events-none"),
|
|
1017
1017
|
style: { filter: "drop-shadow(0 16px 32px rgba(0,0,0,0.16)) drop-shadow(0 2px 8px rgba(0,0,0,0.08))" },
|
|
1018
|
-
children: /* @__PURE__ */
|
|
1018
|
+
children: /* @__PURE__ */ k("div", {
|
|
1019
1019
|
className: $("ai-chat-kb-surface h-full w-full p-[2px]", !e && "ai-chat-kb-surface-closed"),
|
|
1020
1020
|
style: { background: Tt },
|
|
1021
|
-
children: /* @__PURE__ */
|
|
1021
|
+
children: /* @__PURE__ */ k("div", { className: "h-full w-full rounded-t-[26px] rounded-b-[40px] bg-white" })
|
|
1022
1022
|
})
|
|
1023
1023
|
}),
|
|
1024
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ A("section", {
|
|
1025
1025
|
id: a,
|
|
1026
1026
|
"aria-label": "AI chat",
|
|
1027
1027
|
inert: !e,
|
|
1028
1028
|
className: $("relative z-10 flex min-h-0 flex-col", "ai-chat-kb-content", e ? "pointer-events-auto" : "ai-chat-kb-content-closed pointer-events-none"),
|
|
1029
1029
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ A("header", {
|
|
1031
1031
|
className: "flex h-14 w-full shrink-0 items-center justify-between gap-2 px-4",
|
|
1032
|
-
children: [/* @__PURE__ */
|
|
1032
|
+
children: [/* @__PURE__ */ A("div", {
|
|
1033
1033
|
className: "flex min-w-0 items-center gap-2",
|
|
1034
|
-
children: [s ? /* @__PURE__ */
|
|
1034
|
+
children: [s ? /* @__PURE__ */ k("img", {
|
|
1035
1035
|
src: s,
|
|
1036
1036
|
alt: "",
|
|
1037
1037
|
className: "h-6 w-6 shrink-0 rounded-sm object-contain"
|
|
1038
|
-
}) : null, /* @__PURE__ */
|
|
1038
|
+
}) : null, /* @__PURE__ */ k("span", {
|
|
1039
1039
|
className: "truncate font-semibold text-sm text-zinc-900",
|
|
1040
1040
|
children: v
|
|
1041
1041
|
})]
|
|
1042
|
-
}), /* @__PURE__ */
|
|
1042
|
+
}), /* @__PURE__ */ A("div", {
|
|
1043
1043
|
className: "flex flex-shrink-0 items-center gap-1",
|
|
1044
|
-
children: [h && /* @__PURE__ */
|
|
1044
|
+
children: [h && /* @__PURE__ */ k("button", {
|
|
1045
1045
|
type: "button",
|
|
1046
1046
|
onClick: r,
|
|
1047
1047
|
"aria-label": "Start new chat",
|
|
1048
1048
|
title: "Start new chat",
|
|
1049
1049
|
className: "ai-chat-icon-btn flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full transition-[background-color,color,transform] duration-150 active:scale-95",
|
|
1050
|
-
children: /* @__PURE__ */
|
|
1051
|
-
}), /* @__PURE__ */
|
|
1050
|
+
children: /* @__PURE__ */ k(F, { className: "h-4 w-4" })
|
|
1051
|
+
}), /* @__PURE__ */ k("button", {
|
|
1052
1052
|
type: "button",
|
|
1053
1053
|
onClick: t,
|
|
1054
1054
|
"aria-label": "Close AI chat",
|
|
1055
1055
|
className: "ai-chat-icon-btn flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full transition-[background-color,color,transform] duration-150 active:scale-95",
|
|
1056
|
-
children: /* @__PURE__ */
|
|
1056
|
+
children: /* @__PURE__ */ k(z, { className: "h-4 w-4" })
|
|
1057
1057
|
})]
|
|
1058
1058
|
})]
|
|
1059
1059
|
}),
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1060
|
+
/* @__PURE__ */ k("div", { className: "mx-4 h-px shrink-0 bg-zinc-100" }),
|
|
1061
|
+
/* @__PURE__ */ k("div", {
|
|
1062
1062
|
className: "ai-chat-kb-thread flex max-h-[min(60vh,32rem)] min-h-0 flex-col overflow-hidden",
|
|
1063
1063
|
children: f
|
|
1064
1064
|
}),
|
|
1065
|
-
g.length > 0 && !m && /* @__PURE__ */
|
|
1065
|
+
g.length > 0 && !m && /* @__PURE__ */ k("div", {
|
|
1066
1066
|
className: "shrink-0 px-4 pt-1 pb-2",
|
|
1067
|
-
children: /* @__PURE__ */
|
|
1067
|
+
children: /* @__PURE__ */ k(K, {
|
|
1068
1068
|
chips: g,
|
|
1069
1069
|
onSelect: _,
|
|
1070
1070
|
chipClassName: Dt
|
|
@@ -1072,9 +1072,9 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
1072
1072
|
})
|
|
1073
1073
|
]
|
|
1074
1074
|
}),
|
|
1075
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ k("div", {
|
|
1076
1076
|
className: "ai-chat-kb-pillbox pointer-events-auto relative z-20 mx-3 mt-1",
|
|
1077
|
-
children: /* @__PURE__ */
|
|
1077
|
+
children: /* @__PURE__ */ k(wt, {
|
|
1078
1078
|
open: e,
|
|
1079
1079
|
onToggle: t,
|
|
1080
1080
|
askLabel: i,
|
|
@@ -1082,14 +1082,14 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
1082
1082
|
initialDraft: l
|
|
1083
1083
|
})
|
|
1084
1084
|
}),
|
|
1085
|
-
u && /* @__PURE__ */
|
|
1085
|
+
u && /* @__PURE__ */ k("div", {
|
|
1086
1086
|
className: $("pointer-events-none relative z-20 grid shrink-0 transition-[grid-template-rows] duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]", e ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1087
|
+
children: /* @__PURE__ */ k("div", {
|
|
1088
1088
|
className: "overflow-hidden",
|
|
1089
|
-
children: /* @__PURE__ */
|
|
1089
|
+
children: /* @__PURE__ */ A("p", {
|
|
1090
1090
|
className: "pt-2 text-center text-[11px] text-zinc-400",
|
|
1091
|
-
children: ["Powered by ", /* @__PURE__ */
|
|
1092
|
-
href:
|
|
1091
|
+
children: ["Powered by ", /* @__PURE__ */ k("a", {
|
|
1092
|
+
href: b,
|
|
1093
1093
|
target: "_blank",
|
|
1094
1094
|
rel: "noopener noreferrer",
|
|
1095
1095
|
className: "pointer-events-auto font-medium text-zinc-500 underline-offset-2 transition-colors hover:text-zinc-700 hover:underline",
|
|
@@ -1098,7 +1098,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
1098
1098
|
})
|
|
1099
1099
|
})
|
|
1100
1100
|
}),
|
|
1101
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ k("div", { className: "h-3" })
|
|
1102
1102
|
] });
|
|
1103
1103
|
};
|
|
1104
1104
|
//#endregion
|