@levo-so/studio 0.3.12 → 0.3.13
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/{BillingStep-BG4hhiaE.js → BillingStep-Cskl5Sbc.js} +1 -1
- package/{Button-CYXSFoBr.js → Button-D6OAkNtW.js} +1 -1
- package/{EntryCard-Btvieg4y.js → EntryCard-NCSYl-4A.js} +1 -1
- package/{KBChatWidget-aK7vt64V.js → KBChatWidget-C69g1bLL.js} +171 -102
- package/{LoginCard-HUsLBH9Y.js → LoginCard-BC05UxFH.js} +1 -1
- package/{PendingApprovalCard-Cf58Fj0h.js → PendingApprovalCard-B7sm8CZ_.js} +1 -1
- package/{PopupBody-BI-MJqmd-Cj3VgwnW.js → PopupBody-BI-MJqmd-C9i44N2h.js} +1 -1
- package/{PopupRenderer-D66Gx63H-CU-scfrr.js → PopupRenderer-D66Gx63H-dYKKhHdA.js} +1 -1
- package/{ProfileCard-WC8XhXzF.js → ProfileCard-DM1Jspj_.js} +1 -1
- package/{bookingCard-CmsUeDr3.js → bookingCard-DcK7qJ97.js} +2 -2
- package/collection.d.ts +1 -1
- package/collection.js +1 -1
- package/{dist-CveI0e3_.js → dist-Dq-z9c3T.js} +3 -3
- package/index.js +6 -6
- package/{kbChat-DfcTNf0n.js → kbChat-BKA7Fl9L.js} +1 -1
- package/package.json +4 -4
- package/studio.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./Button-
|
|
2
|
+
import { t as e } from "./Button-D6OAkNtW.js";
|
|
3
3
|
import { useState as t } from "react";
|
|
4
4
|
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/bookingCard/BillingStep.tsx
|
|
@@ -20,7 +20,7 @@ import oe from "isomorphic-dompurify";
|
|
|
20
20
|
var O = async (e, t) => {
|
|
21
21
|
let n = {};
|
|
22
22
|
return t?.site_id && (n.site_id = t.site_id), t?.locale && (n.locale = t.locale), t?.country && (n.country = t.country), (await e.url("/v1/studio/popup/list-active").query(n).get().json())?.content?.data ?? [];
|
|
23
|
-
}, k = _(() => import("./PopupRenderer-D66Gx63H-
|
|
23
|
+
}, k = _(() => import("./PopupRenderer-D66Gx63H-dYKKhHdA.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), A = (e) => {
|
|
24
24
|
let t = u(9), { siteId: n, pageId: r } = e, { fetch: a, logger: o } = f(), [s, c] = S(null), l = x(!1), p, h;
|
|
25
25
|
if (t[0] !== a || t[1] !== o || t[2] !== n ? (p = () => {
|
|
26
26
|
if (l.current) return;
|
|
@@ -151,7 +151,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
-
},
|
|
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",
|
|
@@ -161,7 +161,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
161
161
|
color: "var(--color-brand-foreground, #fff)"
|
|
162
162
|
},
|
|
163
163
|
children: /* @__PURE__ */ k(R, { className: "h-3.5 w-3.5 fill-current" })
|
|
164
|
-
}),
|
|
164
|
+
}), Ce = () => /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(V.If, {
|
|
165
165
|
dictation: !1,
|
|
166
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",
|
|
@@ -173,7 +173,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
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
174
|
children: /* @__PURE__ */ k(R, { className: "h-3 w-3 fill-current" })
|
|
175
175
|
})
|
|
176
|
-
})] }),
|
|
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: {
|
|
@@ -181,7 +181,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
181
181
|
color: "var(--color-brand-foreground, #fff)"
|
|
182
182
|
},
|
|
183
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
|
};
|
|
@@ -189,7 +189,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
189
189
|
className: "rounded-lg border border-zinc-200 bg-white shadow-sm transition-colors focus-within:border-[var(--color-brand,#a1a1aa)]",
|
|
190
190
|
children: [/* @__PURE__ */ k(V.Input, {
|
|
191
191
|
"data-ai-chat-composer": "",
|
|
192
|
-
className:
|
|
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…",
|
|
194
194
|
rows: 1,
|
|
195
195
|
submitMode: "enter",
|
|
@@ -201,14 +201,14 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
201
201
|
onKeyDown: r
|
|
202
202
|
}), /* @__PURE__ */ A("div", {
|
|
203
203
|
className: "flex items-center justify-between px-3 pt-1 pb-2",
|
|
204
|
-
children: [/* @__PURE__ */ k(
|
|
204
|
+
children: [/* @__PURE__ */ k(Ce, {}), t ? /* @__PURE__ */ k(Se, { onStop: n }) : /* @__PURE__ */ k(we, {})]
|
|
205
205
|
})]
|
|
206
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
209
|
/* @__PURE__ */ k(V.Input, {
|
|
210
210
|
"data-ai-chat-composer": "",
|
|
211
|
-
className:
|
|
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…",
|
|
213
213
|
rows: 1,
|
|
214
214
|
submitMode: "enter",
|
|
@@ -219,11 +219,11 @@ 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__ */ k(
|
|
223
|
-
t ? /* @__PURE__ */ k(
|
|
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
228
|
return /* @__PURE__ */ k(H.Root, {
|
|
229
229
|
className: "mb-4 pr-2 pl-0",
|
|
@@ -247,34 +247,92 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
247
247
|
})]
|
|
248
248
|
})] })
|
|
249
249
|
});
|
|
250
|
-
},
|
|
251
|
-
let [
|
|
252
|
-
T(() => {
|
|
253
|
-
if (
|
|
254
|
-
let
|
|
255
|
-
return () => clearTimeout(
|
|
256
|
-
}, [
|
|
257
|
-
|
|
250
|
+
}, je = 1500, Me = () => {
|
|
251
|
+
let [e, t] = D("idle");
|
|
252
|
+
return T(() => {
|
|
253
|
+
if (e === "idle") return;
|
|
254
|
+
let n = setTimeout(() => t("idle"), je);
|
|
255
|
+
return () => clearTimeout(n);
|
|
256
|
+
}, [e]), {
|
|
257
|
+
state: e,
|
|
258
|
+
run: C(async (e) => {
|
|
259
|
+
try {
|
|
260
|
+
await e(), t("copied");
|
|
261
|
+
} catch {
|
|
262
|
+
t("error");
|
|
263
|
+
}
|
|
264
|
+
}, [])
|
|
265
|
+
};
|
|
266
|
+
}, Ne = {
|
|
267
|
+
idle: {
|
|
268
|
+
Icon: P,
|
|
269
|
+
label: "Copy"
|
|
270
|
+
},
|
|
271
|
+
copied: {
|
|
272
|
+
Icon: M,
|
|
273
|
+
label: "Copied",
|
|
274
|
+
tone: "text-emerald-500"
|
|
275
|
+
},
|
|
276
|
+
error: {
|
|
277
|
+
Icon: z,
|
|
278
|
+
label: "Copy failed",
|
|
279
|
+
tone: "text-rose-500"
|
|
280
|
+
}
|
|
281
|
+
}, Pe = ({ onCopy: e, idleLabel: t, className: n }) => {
|
|
282
|
+
let { state: r, run: i } = Me(), { Icon: a, label: o, tone: s } = Ne[r], c = r === "idle" ? t : o;
|
|
283
|
+
return /* @__PURE__ */ A("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
"aria-label": c,
|
|
286
|
+
onClick: () => i(e),
|
|
287
|
+
className: `${n} flex items-center gap-1.5 rounded px-2 py-0.5 text-[10px] transition-colors`,
|
|
288
|
+
children: [/* @__PURE__ */ k(a, { className: ["h-3 w-3", s].filter(Boolean).join(" ") }), /* @__PURE__ */ k("span", { children: c })]
|
|
289
|
+
});
|
|
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
|
+
let { state: a, run: o } = Me(), s = G((e) => e.message), c = () => {
|
|
258
292
|
let e = s.content.filter((e) => e.type === "text").map((e) => e.text).join("");
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
293
|
+
return o(() => navigator.clipboard.writeText(e));
|
|
294
|
+
}, { Icon: l, label: u } = Ne[a], d = {
|
|
295
|
+
idle: e,
|
|
296
|
+
copied: t,
|
|
297
|
+
error: n
|
|
298
|
+
}[a];
|
|
265
299
|
return /* @__PURE__ */ k("button", {
|
|
266
300
|
type: "button",
|
|
267
|
-
"aria-label": u,
|
|
301
|
+
"aria-label": a === "idle" ? "Copy message" : u,
|
|
268
302
|
onClick: c,
|
|
269
|
-
className:
|
|
270
|
-
children: /* @__PURE__ */ k(
|
|
303
|
+
className: `${r} ${d}`,
|
|
304
|
+
children: /* @__PURE__ */ k(l, { className: i })
|
|
271
305
|
});
|
|
272
|
-
},
|
|
273
|
-
|
|
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
|
+
"colspan",
|
|
308
|
+
"rowspan",
|
|
309
|
+
"href",
|
|
310
|
+
"title",
|
|
311
|
+
"align",
|
|
312
|
+
"scope"
|
|
313
|
+
]), Ve = (e) => {
|
|
314
|
+
let t = e.cloneNode(!0);
|
|
315
|
+
for (let e of [t, ...Array.from(t.querySelectorAll("*"))]) for (let t of Array.from(e.attributes, (e) => e.name)) Be.has(t.toLowerCase()) || e.removeAttribute(t);
|
|
316
|
+
for (let e of Array.from(t.querySelectorAll("th, td"))) Ie.test((e.textContent ?? "").trim()) && e.insertBefore(t.ownerDocument.createTextNode("'"), e.firstChild);
|
|
317
|
+
return `<meta charset="utf-8">${t.outerHTML}`;
|
|
318
|
+
}, He = async (e) => {
|
|
319
|
+
if (!e) throw Error("No table to copy");
|
|
320
|
+
let t = ze(e);
|
|
321
|
+
try {
|
|
322
|
+
if (typeof ClipboardItem > "u" || !navigator.clipboard?.write) throw Error("Rich clipboard unavailable");
|
|
323
|
+
await navigator.clipboard.write([new ClipboardItem({
|
|
324
|
+
"text/html": new Blob([Ve(e)], { type: "text/html" }),
|
|
325
|
+
"text/plain": new Blob([t], { type: "text/plain" })
|
|
326
|
+
})]);
|
|
327
|
+
} catch {
|
|
328
|
+
await navigator.clipboard.writeText(t);
|
|
329
|
+
}
|
|
330
|
+
}, Ue = ({ children: e }) => {
|
|
331
|
+
let t = "plaintext", n = "";
|
|
274
332
|
return b.forEach(e, (e) => {
|
|
275
333
|
if (S(e)) {
|
|
276
|
-
let
|
|
277
|
-
|
|
334
|
+
let r = e.props, i = /language-(\w+)/.exec(r.className ?? "");
|
|
335
|
+
i && (t = i[1] ?? t), typeof r.children == "string" && (n = r.children.trim());
|
|
278
336
|
}
|
|
279
337
|
}), /* @__PURE__ */ A("div", {
|
|
280
338
|
className: "ai-chat-code not-prose my-4 overflow-hidden rounded-xl border",
|
|
@@ -282,38 +340,49 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
282
340
|
className: "ai-chat-code__header flex items-center justify-between px-4 py-2",
|
|
283
341
|
children: [/* @__PURE__ */ k("span", {
|
|
284
342
|
className: "ai-chat-code__label font-mono text-[10px] uppercase tracking-widest",
|
|
285
|
-
children:
|
|
286
|
-
}), /* @__PURE__ */ k(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}).catch(() => {}),
|
|
291
|
-
className: "ai-chat-code__copy flex items-center gap-1.5 rounded px-2 py-0.5 text-[10px] transition-colors",
|
|
292
|
-
children: t ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(M, { className: "h-3 w-3 text-emerald-500" }), /* @__PURE__ */ k("span", { children: "Copied!" })] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(P, { className: "h-3 w-3" }), /* @__PURE__ */ k("span", { children: "Copy" })] })
|
|
343
|
+
children: t
|
|
344
|
+
}), /* @__PURE__ */ k(Pe, {
|
|
345
|
+
idleLabel: "Copy",
|
|
346
|
+
onCopy: () => navigator.clipboard.writeText(n),
|
|
347
|
+
className: "ai-chat-code__copy"
|
|
293
348
|
})]
|
|
294
349
|
}), /* @__PURE__ */ k("pre", {
|
|
295
350
|
className: "ai-chat-code__pre overflow-x-auto px-4 py-4 font-mono text-sm leading-relaxed",
|
|
296
351
|
children: e
|
|
297
352
|
})]
|
|
298
353
|
});
|
|
299
|
-
},
|
|
354
|
+
}, We = (e) => /* @__PURE__ */ k("a", {
|
|
300
355
|
...e,
|
|
301
356
|
target: "_blank",
|
|
302
357
|
rel: "noopener noreferrer"
|
|
303
|
-
}),
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
358
|
+
}), Ge = ({ className: e, ...t }) => {
|
|
359
|
+
let n = E(null);
|
|
360
|
+
return /* @__PURE__ */ A("div", {
|
|
361
|
+
className: "w-full",
|
|
362
|
+
children: [/* @__PURE__ */ k("div", {
|
|
363
|
+
className: "not-prose mb-1 flex justify-end",
|
|
364
|
+
children: /* @__PURE__ */ k(Pe, {
|
|
365
|
+
idleLabel: "Copy table",
|
|
366
|
+
onCopy: () => He(n.current),
|
|
367
|
+
className: "ai-chat-table__copy"
|
|
368
|
+
})
|
|
369
|
+
}), /* @__PURE__ */ k("div", {
|
|
370
|
+
className: "w-full max-w-full overflow-x-auto",
|
|
371
|
+
children: /* @__PURE__ */ k("table", {
|
|
372
|
+
...t,
|
|
373
|
+
ref: n,
|
|
374
|
+
className: ["w-max min-w-full [&_td]:max-w-[20rem] [&_th]:max-w-[20rem]", e].filter(Boolean).join(" ")
|
|
375
|
+
})
|
|
376
|
+
})]
|
|
377
|
+
});
|
|
378
|
+
}, Ke = () => /* @__PURE__ */ k(oe, {
|
|
310
379
|
remarkPlugins: [se],
|
|
311
380
|
components: {
|
|
312
|
-
pre:
|
|
313
|
-
a:
|
|
314
|
-
table:
|
|
381
|
+
pre: Ue,
|
|
382
|
+
a: We,
|
|
383
|
+
table: Ge
|
|
315
384
|
}
|
|
316
|
-
}),
|
|
385
|
+
}), qe = [
|
|
317
386
|
"Thinking",
|
|
318
387
|
"Pondering",
|
|
319
388
|
"Drafting",
|
|
@@ -327,10 +396,10 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
327
396
|
"Untangling",
|
|
328
397
|
"Threading the needle",
|
|
329
398
|
"Lining up ideas"
|
|
330
|
-
],
|
|
399
|
+
], Je = (e) => {
|
|
331
400
|
let t = Math.floor(e / 60), n = e % 60;
|
|
332
401
|
return t > 0 ? `${t}m ${n.toString().padStart(2, "0")}s` : `${n}s`;
|
|
333
|
-
},
|
|
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" }) => {
|
|
334
403
|
let [a, o] = D(() => e.length > 0 ? Math.floor(Math.random() * e.length) : 0), [s, c] = D(0);
|
|
335
404
|
T(() => {
|
|
336
405
|
let t = e.length > 0 ? setInterval(() => {
|
|
@@ -369,17 +438,17 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
369
438
|
})]
|
|
370
439
|
}), u && /* @__PURE__ */ A("span", {
|
|
371
440
|
className: `${n} min-w-0 truncate`,
|
|
372
|
-
children: [
|
|
441
|
+
children: [Je(s), d && /* @__PURE__ */ k("span", {
|
|
373
442
|
className: r,
|
|
374
443
|
children: i
|
|
375
444
|
})]
|
|
376
445
|
})]
|
|
377
446
|
});
|
|
378
|
-
},
|
|
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, timeClassName: p = et, timeFormatOptions: m, readOnly: h = !1, belowContent: g, footerSlot: _ }) => {
|
|
379
448
|
let y = G((e) => e.message), b = e(y), x = n ?? H.Content, S = y.status?.type === "running", C = /* @__PURE__ */ k("div", {
|
|
380
449
|
className: o,
|
|
381
450
|
children: /* @__PURE__ */ k(x, { components: {
|
|
382
|
-
Text:
|
|
451
|
+
Text: Ke,
|
|
383
452
|
tools: { Fallback: t }
|
|
384
453
|
} })
|
|
385
454
|
});
|
|
@@ -408,7 +477,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
408
477
|
l,
|
|
409
478
|
/* @__PURE__ */ A(B.Root, {
|
|
410
479
|
className: "flex items-center gap-0.5",
|
|
411
|
-
children: [/* @__PURE__ */ k(
|
|
480
|
+
children: [/* @__PURE__ */ k(Fe, {
|
|
412
481
|
idleClassName: u,
|
|
413
482
|
copiedClassName: d
|
|
414
483
|
}), !h && /* @__PURE__ */ k(B.Reload, {
|
|
@@ -422,7 +491,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
422
491
|
]
|
|
423
492
|
})
|
|
424
493
|
});
|
|
425
|
-
},
|
|
494
|
+
}, 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 }) => {
|
|
426
495
|
let p = G((e) => e.message), m = G((e) => e.thread.isRunning), h = e(p);
|
|
427
496
|
return /* @__PURE__ */ A(H.Root, {
|
|
428
497
|
className: n,
|
|
@@ -441,7 +510,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
441
510
|
children: v(h, d)
|
|
442
511
|
}), /* @__PURE__ */ A(B.Root, {
|
|
443
512
|
className: "flex items-center gap-0.5",
|
|
444
|
-
children: [/* @__PURE__ */ k(
|
|
513
|
+
children: [/* @__PURE__ */ k(Fe, {
|
|
445
514
|
idleClassName: l,
|
|
446
515
|
copiedClassName: u
|
|
447
516
|
}), !f && /* @__PURE__ */ k(B.Edit, {
|
|
@@ -453,20 +522,20 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
453
522
|
})
|
|
454
523
|
]
|
|
455
524
|
});
|
|
456
|
-
},
|
|
525
|
+
}, lt = () => /* @__PURE__ */ k(Ae, { sendStyle: {
|
|
457
526
|
backgroundColor: "var(--color-brand, #0a0a0a)",
|
|
458
527
|
color: "var(--color-brand-foreground, #fff)"
|
|
459
|
-
} }),
|
|
528
|
+
} }), ut = [
|
|
460
529
|
"What do you offer?",
|
|
461
530
|
"How much does it cost?",
|
|
462
531
|
"Why should I choose you?",
|
|
463
532
|
"How do I get in touch?"
|
|
464
|
-
],
|
|
533
|
+
], dt = [
|
|
465
534
|
"w-3/4",
|
|
466
535
|
"w-4/5",
|
|
467
536
|
"w-2/3",
|
|
468
537
|
"w-3/5"
|
|
469
|
-
],
|
|
538
|
+
], ft = ({ workspaceId: e, siteName: t, siteLogo: n, apiBaseUrl: r, authHeaders: i, agentId: a, followUps: s, hideComposer: c = !1 }) => {
|
|
470
539
|
let l = W(), u = G((e) => e.thread.isRunning), { agentUnavailable: d } = fe(), f = E(null), { isAtBottom: p, scrollToBottom: m } = be({
|
|
471
540
|
viewportRef: f,
|
|
472
541
|
isRunning: u
|
|
@@ -476,7 +545,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
476
545
|
...o(i),
|
|
477
546
|
"Levo-Workspace": e
|
|
478
547
|
} : void 0,
|
|
479
|
-
fallback:
|
|
548
|
+
fallback: ut
|
|
480
549
|
}), g = C((e) => {
|
|
481
550
|
y(l.thread.composer(), e);
|
|
482
551
|
}, [l]), _ = C(() => l.thread.cancelRun(), [l]), v = E(u);
|
|
@@ -542,7 +611,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
542
611
|
]
|
|
543
612
|
}), /* @__PURE__ */ k("div", {
|
|
544
613
|
className: "flex w-full max-w-md flex-col gap-2",
|
|
545
|
-
children: h === null ?
|
|
614
|
+
children: h === null ? dt.map((e, t) => /* @__PURE__ */ k("div", {
|
|
546
615
|
className: "flex h-[42px] items-center rounded-xl border border-zinc-200 bg-white px-4",
|
|
547
616
|
children: /* @__PURE__ */ k("span", { className: `block h-3 animate-pulse rounded bg-zinc-200 ${e}` })
|
|
548
617
|
}, `skeleton-${t}`)) : h.map((e, t) => /* @__PURE__ */ k("button", {
|
|
@@ -558,9 +627,9 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
558
627
|
children: /* @__PURE__ */ k("div", {
|
|
559
628
|
className: "ai-chat-kb-messages mx-auto max-w-3xl px-6 py-6 pt-8",
|
|
560
629
|
children: /* @__PURE__ */ k(U.Messages, { components: {
|
|
561
|
-
UserMessage:
|
|
562
|
-
AssistantMessage:
|
|
563
|
-
EditComposer:
|
|
630
|
+
UserMessage: ct,
|
|
631
|
+
AssistantMessage: nt,
|
|
632
|
+
EditComposer: lt
|
|
564
633
|
} })
|
|
565
634
|
})
|
|
566
635
|
})]
|
|
@@ -589,7 +658,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
589
658
|
/* @__PURE__ */ A(V.Root, { children: [
|
|
590
659
|
/* @__PURE__ */ k(U.If, {
|
|
591
660
|
empty: !0,
|
|
592
|
-
children: /* @__PURE__ */ k(
|
|
661
|
+
children: /* @__PURE__ */ k(Te, {
|
|
593
662
|
variant: "expanded",
|
|
594
663
|
isRunning: u,
|
|
595
664
|
onStop: _
|
|
@@ -597,7 +666,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
597
666
|
}),
|
|
598
667
|
/* @__PURE__ */ k(U.If, {
|
|
599
668
|
empty: !1,
|
|
600
|
-
children: /* @__PURE__ */ k(
|
|
669
|
+
children: /* @__PURE__ */ k(Te, {
|
|
601
670
|
variant: "compact",
|
|
602
671
|
isRunning: u,
|
|
603
672
|
onStop: _
|
|
@@ -626,26 +695,26 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
626
695
|
})
|
|
627
696
|
]
|
|
628
697
|
});
|
|
629
|
-
},
|
|
698
|
+
}, J = 4096, pt = 400, mt = 300, ht = 2e3, gt = (e) => document.querySelector(e)?.content?.trim() || void 0, _t = (e) => {
|
|
630
699
|
for (let t of e) {
|
|
631
|
-
let e =
|
|
700
|
+
let e = gt(t);
|
|
632
701
|
if (e) return e;
|
|
633
702
|
}
|
|
634
|
-
},
|
|
703
|
+
}, vt = (e, t) => e.length > t ? `${e.slice(0, t - 1).trimEnd()}…` : e, Y = (e) => JSON.stringify(e).length, yt = () => {
|
|
635
704
|
if (typeof window > "u" || typeof document > "u") return;
|
|
636
705
|
let e = {}, t = window.location?.href;
|
|
637
706
|
t && (e.url = t);
|
|
638
|
-
let n = document.title?.trim() ||
|
|
639
|
-
n && (e.page_title =
|
|
640
|
-
let r =
|
|
707
|
+
let n = document.title?.trim() || _t(["meta[property=\"og:title\"]", "meta[name=\"twitter:title\"]"]);
|
|
708
|
+
n && (e.page_title = vt(n, mt));
|
|
709
|
+
let r = _t([
|
|
641
710
|
"meta[name=\"description\"]",
|
|
642
711
|
"meta[property=\"og:description\"]",
|
|
643
712
|
"meta[name=\"twitter:description\"]"
|
|
644
713
|
]);
|
|
645
|
-
r && (e.description =
|
|
714
|
+
r && (e.description = vt(r, pt));
|
|
646
715
|
let i = document.referrer?.trim();
|
|
647
|
-
if (i && (e.referrer = i), Object.keys(e).length !== 0) return e.description &&
|
|
648
|
-
},
|
|
716
|
+
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;
|
|
717
|
+
}, bt = ({ workspaceId: e, siteName: t, siteLogo: n, agentId: r, apiBaseUrl: i, authHeaders: a, children: s }) => {
|
|
649
718
|
let c = E(e);
|
|
650
719
|
c.current = e;
|
|
651
720
|
let l = E(r);
|
|
@@ -668,7 +737,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
668
737
|
workspace_id: c.current
|
|
669
738
|
};
|
|
670
739
|
h.current && (t.conversation_id = h.current), l.current && (t.agent_id = l.current);
|
|
671
|
-
let n =
|
|
740
|
+
let n = yt();
|
|
672
741
|
return n && (t.context = n), t;
|
|
673
742
|
}
|
|
674
743
|
}),
|
|
@@ -694,7 +763,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
694
763
|
children: s ? s({
|
|
695
764
|
followUps: u,
|
|
696
765
|
onResetChat: y
|
|
697
|
-
}) : /* @__PURE__ */ k(
|
|
766
|
+
}) : /* @__PURE__ */ k(ft, {
|
|
698
767
|
workspaceId: e,
|
|
699
768
|
siteName: t,
|
|
700
769
|
siteLogo: n,
|
|
@@ -705,7 +774,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
705
774
|
})
|
|
706
775
|
})
|
|
707
776
|
});
|
|
708
|
-
},
|
|
777
|
+
}, xt = (e, t, n) => {
|
|
709
778
|
T(() => {
|
|
710
779
|
if (!e) return;
|
|
711
780
|
let r = (e) => {
|
|
@@ -723,16 +792,16 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
723
792
|
t,
|
|
724
793
|
n
|
|
725
794
|
]);
|
|
726
|
-
},
|
|
727
|
-
let [e, t] = D(() => typeof window < "u" && window.matchMedia(
|
|
795
|
+
}, X = "(max-width: 639px)", Z = () => {
|
|
796
|
+
let [e, t] = D(() => typeof window < "u" && window.matchMedia(X).matches);
|
|
728
797
|
return T(() => {
|
|
729
|
-
let e = window.matchMedia(
|
|
798
|
+
let e = window.matchMedia(X), n = () => t(e.matches);
|
|
730
799
|
return n(), e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
731
800
|
}, []), e;
|
|
732
|
-
},
|
|
801
|
+
}, St = (e, t) => {
|
|
733
802
|
T(() => {
|
|
734
803
|
let n = t.current, r = window.visualViewport;
|
|
735
|
-
if (!e || !n || !r || !window.matchMedia(
|
|
804
|
+
if (!e || !n || !r || !window.matchMedia(X).matches) return;
|
|
736
805
|
let i = () => {
|
|
737
806
|
n.style.setProperty("--ai-vv-top", `${r.offsetTop}px`), n.style.setProperty("--ai-vv-height", `${r.height}px`);
|
|
738
807
|
};
|
|
@@ -740,7 +809,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
740
809
|
r.removeEventListener("resize", i), r.removeEventListener("scroll", i), n.style.removeProperty("--ai-vv-top"), n.style.removeProperty("--ai-vv-height");
|
|
741
810
|
};
|
|
742
811
|
}, [e, t]);
|
|
743
|
-
},
|
|
812
|
+
}, Ct = (e, t, n) => {
|
|
744
813
|
T(() => {
|
|
745
814
|
if (!e) return;
|
|
746
815
|
let r = (e) => {
|
|
@@ -753,8 +822,8 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
753
822
|
t,
|
|
754
823
|
n
|
|
755
824
|
]);
|
|
756
|
-
}, Q = (...e) => e.filter(Boolean).join(" "),
|
|
757
|
-
let _ = W(), v =
|
|
825
|
+
}, Q = (...e) => e.filter(Boolean).join(" "), wt = ({ open: e, onToggle: t, askLabel: r, panelId: o, initialDraft: s }) => {
|
|
826
|
+
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);
|
|
758
827
|
T(() => {
|
|
759
828
|
s && _.thread.composer().setText(s);
|
|
760
829
|
}, []);
|
|
@@ -872,7 +941,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
872
941
|
]
|
|
873
942
|
})
|
|
874
943
|
});
|
|
875
|
-
},
|
|
944
|
+
}, 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 }) => {
|
|
876
945
|
let [f, p] = D(!1);
|
|
877
946
|
T(() => {
|
|
878
947
|
if (!l) return;
|
|
@@ -880,19 +949,19 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
880
949
|
return () => cancelAnimationFrame(e);
|
|
881
950
|
}, [l]);
|
|
882
951
|
let m = `kb-chat-panel-${e ?? "default"}`, h = E(null), g = E(null), _ = C(() => p(!1), []);
|
|
883
|
-
|
|
952
|
+
xt(f, g, _), Ct(f, h, _), St(f, h);
|
|
884
953
|
let v = s(t);
|
|
885
954
|
return /* @__PURE__ */ k("div", {
|
|
886
955
|
ref: h,
|
|
887
956
|
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]"),
|
|
888
|
-
children: /* @__PURE__ */ k(
|
|
957
|
+
children: /* @__PURE__ */ k(bt, {
|
|
889
958
|
workspaceId: e,
|
|
890
959
|
siteName: t,
|
|
891
960
|
siteLogo: n,
|
|
892
961
|
agentId: a,
|
|
893
962
|
apiBaseUrl: o,
|
|
894
963
|
authHeaders: c,
|
|
895
|
-
children: ({ followUps: s, onResetChat: l }) => /* @__PURE__ */ k(
|
|
964
|
+
children: ({ followUps: s, onResetChat: l }) => /* @__PURE__ */ k(Ot, {
|
|
896
965
|
open: f,
|
|
897
966
|
onToggle: () => p((e) => !e),
|
|
898
967
|
threadStateRef: g,
|
|
@@ -905,7 +974,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
905
974
|
initialDraft: u,
|
|
906
975
|
showBranding: d,
|
|
907
976
|
followUps: s,
|
|
908
|
-
thread: /* @__PURE__ */ k(
|
|
977
|
+
thread: /* @__PURE__ */ k(ft, {
|
|
909
978
|
workspaceId: e,
|
|
910
979
|
siteName: t,
|
|
911
980
|
siteLogo: n,
|
|
@@ -918,12 +987,12 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
918
987
|
})
|
|
919
988
|
})
|
|
920
989
|
});
|
|
921
|
-
},
|
|
990
|
+
}, Dt = [
|
|
922
991
|
"rounded-full border border-zinc-200 bg-white text-zinc-700",
|
|
923
992
|
"px-3 py-1 text-[13px] leading-snug",
|
|
924
993
|
"transition-[border-color,background-color,color,transform] duration-150 hover:border-zinc-300 hover:bg-zinc-50 hover:text-zinc-900 active:scale-95"
|
|
925
|
-
].join(" "),
|
|
926
|
-
let p = W(), m = G((e) => e.thread.isRunning), h = G((e) => e.thread.messages.length > 0), g =
|
|
994
|
+
].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 }) => {
|
|
995
|
+
let p = W(), m = G((e) => e.thread.isRunning), h = G((e) => e.thread.messages.length > 0), g = Z() ? d.slice(0, 2) : d;
|
|
927
996
|
T(() => (n.current = {
|
|
928
997
|
isRunning: m,
|
|
929
998
|
cancelRun: () => p.thread.cancelRun()
|
|
@@ -944,7 +1013,7 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
944
1013
|
style: { filter: "drop-shadow(0 16px 32px rgba(0,0,0,0.16)) drop-shadow(0 2px 8px rgba(0,0,0,0.08))" },
|
|
945
1014
|
children: /* @__PURE__ */ k("div", {
|
|
946
1015
|
className: $("ai-chat-kb-surface h-full w-full p-[2px]", !e && "ai-chat-kb-surface-closed"),
|
|
947
|
-
style: { background:
|
|
1016
|
+
style: { background: Tt },
|
|
948
1017
|
children: /* @__PURE__ */ k("div", { className: "h-full w-full rounded-t-[26px] rounded-b-[40px] bg-white" })
|
|
949
1018
|
})
|
|
950
1019
|
}),
|
|
@@ -994,14 +1063,14 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
994
1063
|
children: /* @__PURE__ */ k(K, {
|
|
995
1064
|
chips: g,
|
|
996
1065
|
onSelect: _,
|
|
997
|
-
chipClassName:
|
|
1066
|
+
chipClassName: Dt
|
|
998
1067
|
})
|
|
999
1068
|
})
|
|
1000
1069
|
]
|
|
1001
1070
|
}),
|
|
1002
1071
|
/* @__PURE__ */ k("div", {
|
|
1003
1072
|
className: "ai-chat-kb-pillbox pointer-events-auto relative z-20 mx-3 mt-1",
|
|
1004
|
-
children: /* @__PURE__ */ k(
|
|
1073
|
+
children: /* @__PURE__ */ k(wt, {
|
|
1005
1074
|
open: e,
|
|
1006
1075
|
onToggle: t,
|
|
1007
1076
|
askLabel: i,
|
|
@@ -1029,4 +1098,4 @@ var K = ({ chips: e, onSelect: t, size: n = "comfortable", className: r, chipCla
|
|
|
1029
1098
|
] });
|
|
1030
1099
|
};
|
|
1031
1100
|
//#endregion
|
|
1032
|
-
export {
|
|
1101
|
+
export { Et as KBChatWidget };
|
|
@@ -8,7 +8,7 @@ var s = {
|
|
|
8
8
|
title: "_title_s7k8g_7",
|
|
9
9
|
subtitle: "_subtitle_s7k8g_14",
|
|
10
10
|
formWrapper: "_formWrapper_s7k8g_20"
|
|
11
|
-
}, c = r(() => import("./PendingApprovalCard-
|
|
11
|
+
}, c = r(() => import("./PendingApprovalCard-B7sm8CZ_.js")), l = ({ logo: r, siteName: l, page: u }) => {
|
|
12
12
|
let [d, f] = i(!1), [p, m] = i(!1), h = u.access?.find((e) => e.kind === "gating" && e.enabled)?.options;
|
|
13
13
|
return p ? /* @__PURE__ */ a(n, {
|
|
14
14
|
fallback: /* @__PURE__ */ a("div", {}),
|
|
@@ -75,7 +75,7 @@ var Q = [
|
|
|
75
75
|
...i,
|
|
76
76
|
children: o
|
|
77
77
|
}) : null;
|
|
78
|
-
}, te = /* @__PURE__ */ d({ PopupBody: () => oe }), ne = b(() => import("./dist-
|
|
78
|
+
}, te = /* @__PURE__ */ d({ PopupBody: () => oe }), ne = b(() => import("./dist-Dq-z9c3T.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), re = a({ baseSpacing: ".625rem" }), ie = { style: l({ form: { gap: "1rem" } }) }, ae = {
|
|
79
79
|
left: u,
|
|
80
80
|
center: h,
|
|
81
81
|
right: p
|