@icanbwell/baileyai-chat-ui 1.0.2 → 1.0.4
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/baileyai-chat-ui.cjs +3 -3
- package/dist/baileyai-chat-ui.css +1 -1
- package/dist/baileyai-chat-ui.js +211 -186
- package/dist/index.d.ts +24 -2
- package/package.json +1 -1
package/dist/baileyai-chat-ui.js
CHANGED
|
@@ -105,38 +105,38 @@ function T(e) {
|
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/logic/useBaileyChat.ts
|
|
108
|
-
var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
108
|
+
var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `bailey-${Date.now()}-${Math.random().toString(36).slice(2)}`, k = (e, t, n) => {
|
|
109
109
|
if (e === 401 || e === 403) return "Bailey isn't reachable with your current login.";
|
|
110
110
|
let r = `Bailey request failed (status ${e ?? "network error"}).`, i = (n || t || "").trim();
|
|
111
111
|
return i ? `${r} ${i.length > E ? `${i.slice(0, E)}…` : i}` : r;
|
|
112
|
-
},
|
|
113
|
-
let [f, p] = l([]), [m, h] = l([]), [g, _] = l(null), [v, y] = l("idle"), [b, x] = l(null), S = c(null), w = c(""), E = c(0),
|
|
112
|
+
}, A = ({ transport: e, model: t, instructions: n, tools: i = [], toolChoice: o, firstUserMessagePrefix: s, onAssistantMessageComplete: u, idleTimeoutMs: d = D }) => {
|
|
113
|
+
let [f, p] = l([]), [m, h] = l([]), [g, _] = l(null), [v, y] = l("idle"), [b, x] = l(null), S = c(null), w = c(""), E = c(0), A = c([]);
|
|
114
114
|
a(() => {
|
|
115
|
-
|
|
115
|
+
A.current = f;
|
|
116
116
|
}, [f]);
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
}, []),
|
|
120
|
-
|
|
117
|
+
let j = c([]), M = c(/* @__PURE__ */ new Map()), N = c(/* @__PURE__ */ new Map()), P = c(null), F = r(() => {
|
|
118
|
+
P.current !== null && (clearTimeout(P.current), P.current = null);
|
|
119
|
+
}, []), I = r((e) => {
|
|
120
|
+
F(), P.current = setTimeout(() => {
|
|
121
121
|
e.abort(new DOMException("The assistant took too long to respond. Please try again.", "TimeoutError"));
|
|
122
122
|
}, d);
|
|
123
|
-
}, [
|
|
123
|
+
}, [F, d]);
|
|
124
124
|
a(() => () => {
|
|
125
|
-
S.current?.abort(),
|
|
126
|
-
}, [
|
|
127
|
-
let
|
|
125
|
+
S.current?.abort(), F();
|
|
126
|
+
}, [F]);
|
|
127
|
+
let L = r((e, t, n) => {
|
|
128
128
|
let r = (e) => {
|
|
129
129
|
n.push(e), h((t) => [...t, e]);
|
|
130
130
|
};
|
|
131
131
|
if (t.type === "response.output_text.delta") {
|
|
132
132
|
if (!t.delta) return !1;
|
|
133
|
-
let n =
|
|
133
|
+
let n = M.current.get(e) ?? {
|
|
134
134
|
raw: "",
|
|
135
135
|
emittedCount: 0
|
|
136
136
|
};
|
|
137
137
|
n.raw += t.delta;
|
|
138
138
|
let { cleanedText: i, matches: a } = C(n.raw), o = i.trim(), s = a.slice(n.emittedCount);
|
|
139
|
-
if (n.emittedCount = a.length,
|
|
139
|
+
if (n.emittedCount = a.length, M.current.set(e, n), N.current.set(e, o), p((t) => t.map((t) => t.id === e ? {
|
|
140
140
|
...t,
|
|
141
141
|
content: o
|
|
142
142
|
} : t)), s.length > 0) {
|
|
@@ -192,7 +192,7 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
192
192
|
at: Date.now(),
|
|
193
193
|
turnSentAt: E.current
|
|
194
194
|
}), !0);
|
|
195
|
-
}, []),
|
|
195
|
+
}, []), R = r(async (r) => {
|
|
196
196
|
y("streaming"), x(null);
|
|
197
197
|
let a = Date.now();
|
|
198
198
|
E.current = a;
|
|
@@ -203,13 +203,17 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
203
203
|
streaming: !0,
|
|
204
204
|
createdAt: a
|
|
205
205
|
};
|
|
206
|
-
p((e) => [...e, l]),
|
|
206
|
+
p((e) => [...e, l]), j.current = [...r, l];
|
|
207
207
|
let d = r.findIndex((e) => e.role === "user" && !e.hidden), f = r.map((e, t) => t === d && s ? {
|
|
208
208
|
role: e.role,
|
|
209
|
-
content: `${s}${e.content}
|
|
209
|
+
content: `${s}${e.content}`,
|
|
210
|
+
hidden: e.hidden,
|
|
211
|
+
titleHint: e.titleHint
|
|
210
212
|
} : {
|
|
211
213
|
role: e.role,
|
|
212
|
-
content: e.content
|
|
214
|
+
content: e.content,
|
|
215
|
+
hidden: e.hidden,
|
|
216
|
+
titleHint: e.titleHint
|
|
213
217
|
});
|
|
214
218
|
_({
|
|
215
219
|
model: t,
|
|
@@ -226,7 +230,7 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
226
230
|
}
|
|
227
231
|
});
|
|
228
232
|
let m = new AbortController();
|
|
229
|
-
S.current = m,
|
|
233
|
+
S.current = m, I(m);
|
|
230
234
|
let g = "", v = null, b = !1, C = !1, w = [], D = (e, t) => {
|
|
231
235
|
y("error"), x(e);
|
|
232
236
|
let n = {
|
|
@@ -237,7 +241,7 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
237
241
|
...t
|
|
238
242
|
};
|
|
239
243
|
w.push(n), h((e) => [...e, n]);
|
|
240
|
-
},
|
|
244
|
+
}, A = (e, t) => {
|
|
241
245
|
e.forEach((e) => {
|
|
242
246
|
if (e.type === "error") {
|
|
243
247
|
v = e.message;
|
|
@@ -250,7 +254,7 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
250
254
|
w.push(t), h((e) => [...e, t]);
|
|
251
255
|
return;
|
|
252
256
|
}
|
|
253
|
-
e.type === "response.output_text.delta" && e.delta && (C = !0),
|
|
257
|
+
e.type === "response.output_text.delta" && e.delta && (C = !0), L(c, e, w) && (b = !0);
|
|
254
258
|
}), t && p((e) => e.map((e) => e.id === c ? {
|
|
255
259
|
...e,
|
|
256
260
|
streaming: !1
|
|
@@ -265,9 +269,9 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
265
269
|
toolChoice: o,
|
|
266
270
|
signal: m.signal,
|
|
267
271
|
onChunk: (e) => {
|
|
268
|
-
|
|
272
|
+
I(m), g += e;
|
|
269
273
|
let { events: t, remainder: n, done: r } = T(g);
|
|
270
|
-
g = n,
|
|
274
|
+
g = n, A(t, r);
|
|
271
275
|
let i = Date.now();
|
|
272
276
|
_((e) => e && e.sentAt === a ? {
|
|
273
277
|
...e,
|
|
@@ -287,14 +291,14 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
287
291
|
});
|
|
288
292
|
if (g.trim()) {
|
|
289
293
|
let { events: e, done: t } = T(`${g}\n\n`);
|
|
290
|
-
g = "",
|
|
294
|
+
g = "", A(e, t);
|
|
291
295
|
}
|
|
292
296
|
if (v) {
|
|
293
297
|
y("error"), x(v);
|
|
294
298
|
return;
|
|
295
299
|
}
|
|
296
300
|
if (r === void 0 || r >= 400) {
|
|
297
|
-
D(
|
|
301
|
+
D(k(r, s, l), {
|
|
298
302
|
httpStatus: r,
|
|
299
303
|
rawBody: s || void 0
|
|
300
304
|
});
|
|
@@ -309,7 +313,7 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
309
313
|
return;
|
|
310
314
|
}
|
|
311
315
|
y("idle");
|
|
312
|
-
let d =
|
|
316
|
+
let d = N.current.get(c) ?? "";
|
|
313
317
|
_((e) => e && e.sentAt === a ? {
|
|
314
318
|
...e,
|
|
315
319
|
response: { content: d }
|
|
@@ -331,12 +335,12 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
331
335
|
}
|
|
332
336
|
D(t?.message || "Bailey request failed.");
|
|
333
337
|
} finally {
|
|
334
|
-
|
|
335
|
-
let e =
|
|
336
|
-
|
|
338
|
+
F();
|
|
339
|
+
let e = N.current.get(c) ?? "";
|
|
340
|
+
M.current.delete(c), N.current.delete(c), p((e) => e.flatMap((e) => e.id === c ? e.content ? [{
|
|
337
341
|
...e,
|
|
338
342
|
streaming: !1
|
|
339
|
-
}] : [] : [e])),
|
|
343
|
+
}] : [] : [e])), j.current = j.current.flatMap((t) => t.id === c ? e ? [{
|
|
340
344
|
...t,
|
|
341
345
|
content: e,
|
|
342
346
|
streaming: !1
|
|
@@ -350,11 +354,11 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
350
354
|
o,
|
|
351
355
|
s,
|
|
352
356
|
u,
|
|
357
|
+
L,
|
|
353
358
|
I,
|
|
354
|
-
F
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
k.current = e, p(e);
|
|
359
|
+
F
|
|
360
|
+
]), z = r((e) => {
|
|
361
|
+
A.current = e, p(e);
|
|
358
362
|
}, []);
|
|
359
363
|
return {
|
|
360
364
|
messages: f,
|
|
@@ -371,35 +375,36 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
371
375
|
role: "user",
|
|
372
376
|
content: t,
|
|
373
377
|
createdAt: Date.now()
|
|
374
|
-
}, r = [...
|
|
375
|
-
|
|
376
|
-
}, [
|
|
377
|
-
sendHidden: r((e) => {
|
|
378
|
+
}, r = [...j.current, n];
|
|
379
|
+
j.current = r, z([...A.current, n]), R(r);
|
|
380
|
+
}, [R, z]),
|
|
381
|
+
sendHidden: r((e, t) => {
|
|
378
382
|
if (v === "streaming") return;
|
|
379
|
-
let
|
|
380
|
-
if (!
|
|
381
|
-
w.current =
|
|
382
|
-
let
|
|
383
|
+
let n = e.trim();
|
|
384
|
+
if (!n) return;
|
|
385
|
+
w.current = n;
|
|
386
|
+
let r = t?.trim(), i = {
|
|
383
387
|
id: O(),
|
|
384
388
|
role: "user",
|
|
385
|
-
content:
|
|
389
|
+
content: n,
|
|
386
390
|
createdAt: Date.now(),
|
|
387
|
-
hidden: !0
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
+
hidden: !0,
|
|
392
|
+
...r ? { titleHint: r } : {}
|
|
393
|
+
}, a = [...j.current, i];
|
|
394
|
+
j.current = a, R(a);
|
|
395
|
+
}, [R, v]),
|
|
391
396
|
stop: r(() => {
|
|
392
397
|
S.current?.abort();
|
|
393
398
|
}, []),
|
|
394
399
|
retryLast: r(() => {
|
|
395
400
|
if (v === "streaming" || !w.current) return;
|
|
396
|
-
let e =
|
|
397
|
-
|
|
398
|
-
let r =
|
|
399
|
-
|
|
401
|
+
let e = A.current, t = e[e.length - 1], n = t && t.role === "assistant" ? e.slice(0, -1) : e;
|
|
402
|
+
z(n);
|
|
403
|
+
let r = j.current, i = r[r.length - 1], a = i && i.role === "assistant" ? r.slice(0, -1) : r;
|
|
404
|
+
j.current = a, R(a);
|
|
400
405
|
}, [
|
|
401
|
-
L,
|
|
402
406
|
R,
|
|
407
|
+
z,
|
|
403
408
|
v
|
|
404
409
|
]),
|
|
405
410
|
clearTrace: r(() => h([]), []),
|
|
@@ -407,29 +412,29 @@ var E = 200, D = 15e4, O = () => typeof crypto < "u" && typeof crypto.randomUUID
|
|
|
407
412
|
x(null), y((e) => e === "error" ? "idle" : e);
|
|
408
413
|
}, []),
|
|
409
414
|
newChat: r(() => {
|
|
410
|
-
S.current?.abort(),
|
|
411
|
-
}, [
|
|
415
|
+
S.current?.abort(), z([]), j.current = [], h([]), _(null), y("idle"), x(null), w.current = "";
|
|
416
|
+
}, [z]),
|
|
412
417
|
loadMessages: r((e) => {
|
|
413
418
|
S.current?.abort();
|
|
414
419
|
let t = e.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
415
420
|
...e,
|
|
416
421
|
streaming: !1
|
|
417
422
|
}));
|
|
418
|
-
|
|
419
|
-
}, [
|
|
423
|
+
z(t.filter((e) => !e.hidden)), j.current = t, h([]), _(null), y("idle"), x(null), w.current = "";
|
|
424
|
+
}, [z])
|
|
420
425
|
};
|
|
421
426
|
};
|
|
422
427
|
//#endregion
|
|
423
428
|
//#region src/utils/prompt.ts
|
|
424
|
-
function
|
|
429
|
+
function j(...e) {
|
|
425
430
|
return e.filter((e) => !!(e && e.trim())).join("\n\n");
|
|
426
431
|
}
|
|
427
432
|
//#endregion
|
|
428
433
|
//#region src/utils/toolCalls.ts
|
|
429
|
-
var
|
|
430
|
-
function
|
|
434
|
+
var M = "call_tool", N = "a tool";
|
|
435
|
+
function P(e, t) {
|
|
431
436
|
let n = {
|
|
432
|
-
name: e ===
|
|
437
|
+
name: e === M ? N : e,
|
|
433
438
|
args: null,
|
|
434
439
|
viaCallTool: !1
|
|
435
440
|
};
|
|
@@ -442,7 +447,7 @@ function N(e, t) {
|
|
|
442
447
|
}
|
|
443
448
|
if (typeof r != "object" || !r) return n;
|
|
444
449
|
let i = r;
|
|
445
|
-
if (e ===
|
|
450
|
+
if (e === M) {
|
|
446
451
|
let e = typeof i.name == "string" ? i.name : void 0;
|
|
447
452
|
if (!e) return n;
|
|
448
453
|
let t = i.arguments;
|
|
@@ -460,32 +465,32 @@ function N(e, t) {
|
|
|
460
465
|
}
|
|
461
466
|
//#endregion
|
|
462
467
|
//#region src/utils/table.ts
|
|
463
|
-
var
|
|
468
|
+
var F = 5, I = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map(I).join(""), L = (e) => {
|
|
464
469
|
if (e.tagName === "a" && e.properties?.href) return e.properties.href;
|
|
465
470
|
for (let t of e.children ?? []) {
|
|
466
|
-
let e =
|
|
471
|
+
let e = L(t);
|
|
467
472
|
if (e) return e;
|
|
468
473
|
}
|
|
469
|
-
},
|
|
470
|
-
let t =
|
|
474
|
+
}, R = (e, t) => (e.children ?? []).find((e) => e.tagName === t), z = (e) => {
|
|
475
|
+
let t = I(e), n = L(e);
|
|
471
476
|
return n ? {
|
|
472
477
|
text: t,
|
|
473
478
|
href: n
|
|
474
479
|
} : { text: t };
|
|
475
|
-
},
|
|
480
|
+
}, B = (e) => (e.children ?? []).filter((e) => e.type === "element").map(z), V = (e) => {
|
|
476
481
|
if (e.tagName !== "table") return null;
|
|
477
|
-
let t =
|
|
482
|
+
let t = R(e, "thead"), n = t && R(t, "tr");
|
|
478
483
|
return {
|
|
479
|
-
headers: n ?
|
|
480
|
-
rows: (
|
|
484
|
+
headers: n ? B(n).map((e) => e.text) : [],
|
|
485
|
+
rows: (R(e, "tbody")?.children ?? []).filter((e) => e.tagName === "tr").map(B)
|
|
481
486
|
};
|
|
482
|
-
},
|
|
487
|
+
}, H = (e) => e.length > 5, ee = "When a chart would help answer a question (e.g. plotting a trend over time), include a fenced code block tagged `chartjs` containing a JSON object with this exact shape: {\"type\": \"bar\" | \"line\" | \"pie\" | \"doughnut\" | \"scatter\", \"title\"?: string, \"data\": {\"labels\": string[], \"datasets\": [{\"label\": string, \"data\": number[]}]}}. For \"scatter\" charts, omit \"labels\" and give each dataset \"data\" as an array of {\"x\": number, \"y\": number} points instead of a number array. \"pie\" and \"doughnut\" charts must have exactly one dataset. Do not include any other fields (no \"options\", no colors) — the app handles styling. Example:\n```chartjs\n{\"type\": \"line\", \"title\": \"BP readings\", \"data\": {\"labels\": [\"Jul 14\", \"Jul 21\", \"Jul 28\"], \"datasets\": [{\"label\": \"Systolic\", \"data\": [120, 118, 122]}]}}\n```", U = [
|
|
483
488
|
"bar",
|
|
484
489
|
"line",
|
|
485
490
|
"pie",
|
|
486
491
|
"doughnut",
|
|
487
492
|
"scatter"
|
|
488
|
-
],
|
|
493
|
+
], te = 8, W = 50, G = 8, K = 500, ne = (e) => typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number", re = (e) => {
|
|
489
494
|
let t;
|
|
490
495
|
try {
|
|
491
496
|
t = JSON.parse(e);
|
|
@@ -494,13 +499,13 @@ var P = 5, F = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map
|
|
|
494
499
|
}
|
|
495
500
|
if (typeof t != "object" || !t) return null;
|
|
496
501
|
let n = t;
|
|
497
|
-
if (typeof n.type != "string" || !
|
|
502
|
+
if (typeof n.type != "string" || !U.includes(n.type)) return null;
|
|
498
503
|
let r = n.type;
|
|
499
504
|
if (n.title !== void 0 && typeof n.title != "string") return null;
|
|
500
505
|
let i = n.title;
|
|
501
506
|
if (typeof n.data != "object" || n.data === null) return null;
|
|
502
507
|
let a = n.data;
|
|
503
|
-
if (!Array.isArray(a.datasets) || a.datasets.length < 1 || a.datasets.length >
|
|
508
|
+
if (!Array.isArray(a.datasets) || a.datasets.length < 1 || a.datasets.length > te || (r === "pie" || r === "doughnut") && a.datasets.length !== 1) return null;
|
|
504
509
|
for (let e of a.datasets) if (typeof e != "object" || !e || typeof e.label != "string" || !Array.isArray(e.data)) return null;
|
|
505
510
|
let o = a.datasets;
|
|
506
511
|
if (r === "scatter") {
|
|
@@ -533,7 +538,7 @@ var P = 5, F = (e) => e.type === "text" ? e.value ?? "" : (e.children ?? []).map
|
|
|
533
538
|
raw: "Raw event"
|
|
534
539
|
};
|
|
535
540
|
function q(e) {
|
|
536
|
-
return e.kind !== "tool_start" && e.kind !== "tool_end" ? null :
|
|
541
|
+
return e.kind !== "tool_start" && e.kind !== "tool_end" ? null : P(e.name, e.args);
|
|
537
542
|
}
|
|
538
543
|
function J(e, t = q(e)) {
|
|
539
544
|
return e.kind === "pseudo_tool_call" ? e.name : t?.name ?? null;
|
|
@@ -560,9 +565,9 @@ function ce(e) {
|
|
|
560
565
|
}
|
|
561
566
|
function Y(e) {
|
|
562
567
|
switch (e.kind) {
|
|
563
|
-
case "tool_start": return `Calling ${
|
|
568
|
+
case "tool_start": return `Calling ${P(e.name, e.args).name}...`;
|
|
564
569
|
case "tool_end": {
|
|
565
|
-
let t =
|
|
570
|
+
let t = P(e.name, e.args).name;
|
|
566
571
|
return e.isError ? `${t} failed` : `${t} returned`;
|
|
567
572
|
}
|
|
568
573
|
case "pseudo_tool_call": return `${e.name} (written as text, not called)`;
|
|
@@ -638,7 +643,7 @@ function he(e, t) {
|
|
|
638
643
|
}
|
|
639
644
|
//#endregion
|
|
640
645
|
//#region src/styles.css?inline
|
|
641
|
-
var ge = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid;--tw-leading:initial;--tw-space-y-reverse:0}}}@layer theme{:root,:host{--font-sans:\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-bailey-accent:#4f46e5;--color-bailey-bubble-bg:#fff;--color-bailey-error:#d32f2f;--color-bailey-border:#e5e5e5;--color-bailey-surface:#fff;--color-bailey-surface-muted:#f9fafb;--color-bailey-text:#000;--color-bailey-text-secondary:#6b6b6b;--color-bailey-tooltip-bg:#000;--color-bailey-tooltip-text:#fff;--color-bailey-page-bg:#eceef4;--color-bailey-heart:#16a34a}}@layer utilities;.bailey-chat-panel{box-sizing:border-box;background-color:var(--color-bailey-page-bg);height:100%;padding:calc(var(--spacing) * 3);font-family:var(--font-sans);flex-direction:column;display:flex}.bailey-chat-panel-inner{width:100%;min-height:0;max-width:var(--container-3xl);gap:calc(var(--spacing) * 2);flex-direction:column;flex:1;margin-inline:auto;display:flex;overflow-y:auto}.bailey-toolbar-row{justify-content:flex-end;display:flex}.bailey-new-chat-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-new-chat-button:hover{text-decoration-line:underline}}.bailey-new-chat-button:disabled{cursor:default;opacity:.5;text-decoration-line:none}.bailey-chat-transcript{min-height:0;padding:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 4);flex:1;overflow-y:auto}.bailey-message-row{margin-bottom:calc(var(--spacing) * 3);justify-content:flex-start;display:flex}.bailey-message-row-user{justify-content:flex-end}.bailey-user-message{flex-direction:column;align-items:flex-end;max-width:75%;display:flex}.bailey-message-meta{margin-bottom:var(--spacing);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-message-meta-name{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-bailey-text)}.bailey-user-bubble{border-radius:var(--radius-2xl);background-color:var(--color-bailey-bubble-bg);max-width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);white-space:pre-wrap;color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.bailey-assistant-message{width:100%;padding-inline:var(--spacing)}.bailey-thinking-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);font-style:italic}.bailey-streaming-hint{margin-top:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);font-style:italic;display:block}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);display:flex}.bailey-empty-state{text-align:center;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);justify-content:center;align-items:center;display:flex}.bailey-suggestions{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-suggestions-title{padding-inline:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text)}.bailey-suggestion-card{cursor:pointer;appearance:none;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-2xl);--tw-border-style:none;background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:none;display:flex}@media (hover:hover){.bailey-suggestion-card:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.bailey-suggestion-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-text-secondary);flex-shrink:0}.bailey-privacy-note{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 4);padding-top:calc(var(--spacing) * 3);padding-bottom:var(--spacing);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-privacy-note a{color:var(--color-bailey-text-secondary);text-decoration-line:underline}.bailey-activity-line{margin-bottom:calc(var(--spacing) * 2);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-activity-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-accent);flex-shrink:0}.bailey-error-banner{margin-bottom:calc(var(--spacing) * 2);justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-error);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-bailey-error);display:flex}.bailey-retry-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-error-actions{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-dismiss-button{cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-error);background-color:#0000;border-style:none}@media (hover:hover){.bailey-dismiss-button:hover{opacity:.7}}.bailey-input-row{align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input{--tw-border-style:none;min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;background-color:#0000;border-style:none;outline-style:none;flex:1}.bailey-input:disabled{opacity:.5}.bailey-send-button,.bailey-stop-button{cursor:pointer;appearance:none;background-color:#0000;border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}:is(.bailey-send-button,.bailey-stop-button):disabled{cursor:default;opacity:.4}.bailey-send-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-heart);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:#16a34a1a}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:color-mix(in oklab, var(--color-bailey-heart) 10%, transparent)}}}.bailey-send-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-stop-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-error);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:#d32f2f1a}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:color-mix(in oklab, var(--color-bailey-error) 10%, transparent)}}}.bailey-stop-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-copy-button{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-copy-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-copy-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-copy-button:hover{color:var(--color-bailey-text)}}.bailey-copy-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-tooltip-content{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background-color:var(--color-bailey-tooltip-bg,#000);color:var(--color-bailey-tooltip-text,#fff);border-radius:.25rem}.bailey-tooltip-arrow{fill:var(--color-bailey-tooltip-bg,#000)}.bailey-markdown-content table{border-collapse:collapse;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bailey-markdown-content th{background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content td{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);vertical-align:top}.bailey-markdown-content tr:nth-child(2n){background-color:var(--color-bailey-surface-muted)}.bailey-markdown-content{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.bailey-markdown-content>:first-child{margin-top:0}.bailey-markdown-content>:last-child{margin-bottom:0}.bailey-markdown-content p{margin-block:calc(var(--spacing) * 2)}.bailey-markdown-content h1{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h2{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h3{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h4,.bailey-markdown-content h5,.bailey-markdown-content h6{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content ul{margin-block:calc(var(--spacing) * 2);list-style-type:disc}:where(.bailey-markdown-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ul{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content ol{margin-block:calc(var(--spacing) * 2);list-style-type:decimal}:where(.bailey-markdown-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ol{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content a{color:var(--color-bailey-accent);text-underline-offset:2px;text-decoration-line:underline}.bailey-markdown-content code{background-color:var(--color-bailey-surface-muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}.bailey-markdown-content pre{margin-block:calc(var(--spacing) * 2);border-radius:var(--radius-md);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 2);overflow-x:auto}.bailey-markdown-content pre code{background-color:#0000;padding:0}.bailey-markdown-content blockquote{margin-block:calc(var(--spacing) * 2);border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 3);color:var(--color-bailey-text-secondary);font-style:italic}.bailey-markdown-content hr{margin-block:calc(var(--spacing) * 3);border-color:var(--color-bailey-border)}.bailey-trace-panel{margin-bottom:calc(var(--spacing) * 2)}.bailey-trace-toggle-row{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-trace-toggle{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-trace-toggle:hover{text-decoration-line:underline}}.bailey-trace-toggle-error{color:var(--color-bailey-error)}.bailey-trace-summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-trace-summary-error{color:var(--color-bailey-error)}.bailey-trace-body{margin-top:var(--spacing);max-height:calc(var(--spacing) * 80);overflow-y:auto}.bailey-trace-actions-row{justify-content:flex-end;gap:calc(var(--spacing) * 3);display:flex}.bailey-trace-copy-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}@media (hover:hover){.bailey-trace-copy-button:hover{text-decoration-line:none}}.bailey-trace-request-details{margin-bottom:var(--spacing);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding:calc(var(--spacing) * 2)}.bailey-trace-request-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:block}.bailey-trace-rows{gap:var(--spacing);flex-direction:column;display:flex}.bailey-trace-row{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-row-header{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.bailey-trace-row-time{color:var(--color-bailey-text-secondary)}.bailey-trace-row-gap{color:var(--color-gray-400)}.bailey-trace-row-summary{word-break:break-all}.bailey-trace-chip{padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-semibold);font-size:.65rem;font-weight:var(--font-weight-semibold);border-radius:.25rem}.bailey-trace-chip-default{background-color:var(--color-gray-200);color:var(--color-gray-700)}.bailey-trace-chip-info{background-color:var(--color-blue-100);color:var(--color-blue-700)}.bailey-trace-chip-success{background-color:var(--color-green-100);color:var(--color-green-700)}.bailey-trace-chip-secondary{background-color:var(--color-purple-100);color:var(--color-purple-700)}.bailey-trace-chip-error{background-color:var(--color-red-100);color:var(--color-bailey-error)}.bailey-trace-disclosure{margin-top:var(--spacing)}.bailey-trace-disclosure-summary{cursor:pointer;color:var(--color-bailey-text-secondary);font-size:.7rem}.bailey-trace-disclosure-actions{margin-top:var(--spacing);justify-content:flex-end;display:flex}.bailey-trace-disclosure-content{margin-top:var(--spacing);max-height:calc(var(--spacing) * 48);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 1.5);word-break:break-all;white-space:pre-wrap;border-radius:.25rem;font-size:.7rem;overflow:auto}.bailey-trace-group{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing)}.bailey-trace-group-summary{cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-group-failed{margin-left:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}", _e = t(void 0), ve = /:root\s*,\s*:host\s*\{/, ye = ".bailey-chat-panel{";
|
|
646
|
+
var ge = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-border-style:solid;--tw-leading:initial;--tw-space-y-reverse:0}}}@layer theme{:root,:host{--font-sans:\"Inter\", -apple-system, \"Segoe UI\", Roboto, Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-green-100:oklch(96.2% .044 156.743);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-700:oklch(48.8% .243 264.376);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-700:oklch(37.3% .034 259.733);--color-black:#000;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-md:.375rem;--radius-2xl:1rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--color-bailey-accent:#4f46e5;--color-bailey-bubble-bg:#fff;--color-bailey-error:#d32f2f;--color-bailey-border:#e5e5e5;--color-bailey-surface:#fff;--color-bailey-surface-muted:#f9fafb;--color-bailey-text:#000;--color-bailey-text-secondary:#6b6b6b;--color-bailey-tooltip-bg:#000;--color-bailey-tooltip-text:#fff;--color-bailey-page-bg:#eceef4;--color-bailey-heart:#16a34a}}@layer utilities;.bailey-chat-panel{box-sizing:border-box;background-color:var(--color-bailey-page-bg);height:100%;padding:calc(var(--spacing) * 3);font-family:var(--font-sans);flex-direction:column;display:flex}.bailey-chat-panel-inner{width:100%;min-height:0;max-width:var(--container-3xl);gap:calc(var(--spacing) * 2);flex-direction:column;flex:1;margin-inline:auto;display:flex;overflow-y:auto}.bailey-toolbar-row{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 3);display:flex}.bailey-new-chat-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-new-chat-button:hover{text-decoration-line:underline}}.bailey-new-chat-button:disabled{cursor:default;opacity:.5;text-decoration-line:none}.bailey-history-button{height:calc(var(--spacing) * 8);width:calc(var(--spacing) * 8);color:var(--color-gray-700);border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-history-button:hover{background-color:var(--color-gray-100)}}.bailey-history-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-chat-transcript{min-height:0;padding:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 4);flex:1;overflow-y:auto}.bailey-message-row{margin-bottom:calc(var(--spacing) * 3);justify-content:flex-start;display:flex}.bailey-message-row-user{justify-content:flex-end}.bailey-user-message{flex-direction:column;align-items:flex-end;max-width:75%;display:flex}.bailey-message-meta{margin-bottom:var(--spacing);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-message-meta-name{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--color-bailey-text)}.bailey-user-bubble{border-radius:var(--radius-2xl);background-color:var(--color-bailey-bubble-bg);max-width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2);white-space:pre-wrap;color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.bailey-assistant-message{width:100%;padding-inline:var(--spacing)}.bailey-thinking-hint{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);font-style:italic}.bailey-streaming-hint{margin-top:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);font-style:italic;display:block}.bailey-message-actions{margin-top:var(--spacing);align-items:center;gap:var(--spacing);display:flex}.bailey-empty-state{text-align:center;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);justify-content:center;align-items:center;display:flex}.bailey-suggestions{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 2);flex-direction:column;display:flex}.bailey-suggestions-title{padding-inline:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-bailey-text)}.bailey-suggestion-card{cursor:pointer;appearance:none;justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-2xl);--tw-border-style:none;background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-style:none;display:flex}@media (hover:hover){.bailey-suggestion-card:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.bailey-suggestion-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-text-secondary);flex-shrink:0}.bailey-privacy-note{border-top-style:var(--tw-border-style);border-top-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 4);padding-top:calc(var(--spacing) * 3);padding-bottom:var(--spacing);text-align:center;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-privacy-note a{color:var(--color-bailey-text-secondary);text-decoration-line:underline}.bailey-activity-line{margin-bottom:calc(var(--spacing) * 2);align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-text-secondary);display:flex}.bailey-activity-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4);color:var(--color-bailey-accent);flex-shrink:0}.bailey-error-banner{margin-bottom:calc(var(--spacing) * 2);justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 2);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-error);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);color:var(--color-bailey-error);display:flex}.bailey-retry-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);background-color:#0000;border-style:none;text-decoration-line:underline}.bailey-error-actions{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-dismiss-button{cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-error);background-color:#0000;border-style:none}@media (hover:hover){.bailey-dismiss-button:hover{opacity:.7}}.bailey-input-row{align-items:center;gap:calc(var(--spacing) * 2);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:2147483647px;display:flex}.bailey-input-row:focus-within{border-color:var(--color-bailey-accent)}.bailey-input{--tw-border-style:none;min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);--tw-outline-style:none;background-color:#0000;border-style:none;outline-style:none;flex:1}.bailey-input:disabled{opacity:.5}.bailey-send-button,.bailey-stop-button{cursor:pointer;appearance:none;background-color:#0000;border-radius:2147483647px;flex-shrink:0;justify-content:center;align-items:center;display:flex}:is(.bailey-send-button,.bailey-stop-button):disabled{cursor:default;opacity:.4}.bailey-send-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-heart);border-style:none}@media (hover:hover){.bailey-send-button:hover{background-color:#16a34a1a}@supports (color:color-mix(in lab, red, red)){.bailey-send-button:hover{background-color:color-mix(in oklab, var(--color-bailey-heart) 10%, transparent)}}}.bailey-send-icon{height:calc(var(--spacing) * 5);width:calc(var(--spacing) * 5)}.bailey-stop-button{height:calc(var(--spacing) * 9);width:calc(var(--spacing) * 9);--tw-border-style:none;color:var(--color-bailey-error);border-style:none}@media (hover:hover){.bailey-stop-button:hover{background-color:#d32f2f1a}@supports (color:color-mix(in lab, red, red)){.bailey-stop-button:hover{background-color:color-mix(in oklab, var(--color-bailey-error) 10%, transparent)}}}.bailey-stop-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-copy-button{height:calc(var(--spacing) * 7);width:calc(var(--spacing) * 7);cursor:pointer;appearance:none;--tw-border-style:none;color:var(--color-bailey-text-secondary);background-color:#0000;border-style:none;border-radius:2147483647px;justify-content:center;align-items:center;display:flex}@media (hover:hover){.bailey-copy-button:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bailey-copy-button:hover{background-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.bailey-copy-button:hover{color:var(--color-bailey-text)}}.bailey-copy-icon{height:calc(var(--spacing) * 4);width:calc(var(--spacing) * 4)}.bailey-tooltip-content{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));background-color:var(--color-bailey-tooltip-bg,#000);color:var(--color-bailey-tooltip-text,#fff);border-radius:.25rem}.bailey-tooltip-arrow{fill:var(--color-bailey-tooltip-bg,#000)}.bailey-markdown-content table{border-collapse:collapse;width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.bailey-markdown-content th{background-color:var(--color-bailey-surface-muted);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);text-align:left;--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content td{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);vertical-align:top}.bailey-markdown-content tr:nth-child(2n){background-color:var(--color-bailey-surface-muted)}.bailey-markdown-content{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.bailey-markdown-content>:first-child{margin-top:0}.bailey-markdown-content>:last-child{margin-bottom:0}.bailey-markdown-content p{margin-block:calc(var(--spacing) * 2)}.bailey-markdown-content h1{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h2{margin-top:calc(var(--spacing) * 4);margin-bottom:calc(var(--spacing) * 2);font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h3{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content h4,.bailey-markdown-content h5,.bailey-markdown-content h6{margin-top:calc(var(--spacing) * 3);margin-bottom:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.bailey-markdown-content ul{margin-block:calc(var(--spacing) * 2);list-style-type:disc}:where(.bailey-markdown-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ul{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content ol{margin-block:calc(var(--spacing) * 2);list-style-type:decimal}:where(.bailey-markdown-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}.bailey-markdown-content ol{padding-left:calc(var(--spacing) * 5)}.bailey-markdown-content a{color:var(--color-bailey-accent);text-underline-offset:2px;text-decoration-line:underline}.bailey-markdown-content code{background-color:var(--color-bailey-surface-muted);padding-inline:var(--spacing);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);border-radius:.25rem;font-size:.85em}.bailey-markdown-content pre{margin-block:calc(var(--spacing) * 2);border-radius:var(--radius-md);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 2);overflow-x:auto}.bailey-markdown-content pre code{background-color:#0000;padding:0}.bailey-markdown-content blockquote{margin-block:calc(var(--spacing) * 2);border-left-style:var(--tw-border-style);border-left-width:2px;border-color:var(--color-bailey-border);padding-left:calc(var(--spacing) * 3);color:var(--color-bailey-text-secondary);font-style:italic}.bailey-markdown-content hr{margin-block:calc(var(--spacing) * 3);border-color:var(--color-bailey-border)}.bailey-trace-panel{margin-bottom:calc(var(--spacing) * 2)}.bailey-trace-toggle-row{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.bailey-trace-toggle{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none}@media (hover:hover){.bailey-trace-toggle:hover{text-decoration-line:underline}}.bailey-trace-toggle-error{color:var(--color-bailey-error)}.bailey-trace-summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary)}.bailey-trace-summary-error{color:var(--color-bailey-error)}.bailey-trace-body{margin-top:var(--spacing);max-height:calc(var(--spacing) * 80);overflow-y:auto}.bailey-trace-actions-row{justify-content:flex-end;gap:calc(var(--spacing) * 3);display:flex}.bailey-trace-copy-button{cursor:pointer;appearance:none;--tw-border-style:none;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-accent);background-color:#0000;border-style:none;text-decoration-line:underline}@media (hover:hover){.bailey-trace-copy-button:hover{text-decoration-line:none}}.bailey-trace-request-details{margin-bottom:var(--spacing);border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface);padding:calc(var(--spacing) * 2)}.bailey-trace-request-meta{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-text-secondary);display:block}.bailey-trace-rows{gap:var(--spacing);flex-direction:column;display:flex}.bailey-trace-row{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-row-header{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.bailey-trace-row-time{color:var(--color-bailey-text-secondary)}.bailey-trace-row-gap{color:var(--color-gray-400)}.bailey-trace-row-summary{word-break:break-all}.bailey-trace-chip{padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-semibold);font-size:.65rem;font-weight:var(--font-weight-semibold);border-radius:.25rem}.bailey-trace-chip-default{background-color:var(--color-gray-200);color:var(--color-gray-700)}.bailey-trace-chip-info{background-color:var(--color-blue-100);color:var(--color-blue-700)}.bailey-trace-chip-success{background-color:var(--color-green-100);color:var(--color-green-700)}.bailey-trace-chip-secondary{background-color:var(--color-purple-100);color:var(--color-purple-700)}.bailey-trace-chip-error{background-color:var(--color-red-100);color:var(--color-bailey-error)}.bailey-trace-disclosure{margin-top:var(--spacing)}.bailey-trace-disclosure-summary{cursor:pointer;color:var(--color-bailey-text-secondary);font-size:.7rem}.bailey-trace-disclosure-actions{margin-top:var(--spacing);justify-content:flex-end;display:flex}.bailey-trace-disclosure-content{margin-top:var(--spacing);max-height:calc(var(--spacing) * 48);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);background-color:var(--color-bailey-surface-muted);padding:calc(var(--spacing) * 1.5);word-break:break-all;white-space:pre-wrap;border-radius:.25rem;font-size:.7rem;overflow:auto}.bailey-trace-group{border-radius:var(--radius-md);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-bailey-border);padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing)}.bailey-trace-group-summary{cursor:pointer;font-family:var(--font-mono);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.bailey-trace-group-failed{margin-left:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--color-bailey-error)}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}", _e = t(void 0), ve = /:root\s*,\s*:host\s*\{/, ye = ".bailey-chat-panel{";
|
|
642
647
|
function be(e) {
|
|
643
648
|
let t = e.match(new RegExp(ve, "g"))?.length ?? 0;
|
|
644
649
|
if (t !== 1) throw Error(`Expected exactly one ":root, :host {" rule in the compiled styles.css, found ${t}. Tailwind likely changed how @theme compiles — update this rewrite (and its sibling, scripts/scope-theme-vars.js) before shipping.`);
|
|
@@ -685,8 +690,8 @@ function Ee({ renderTable: t, renderChart: n } = {}) {
|
|
|
685
690
|
children: n
|
|
686
691
|
}),
|
|
687
692
|
table: ({ node: n, children: r }) => {
|
|
688
|
-
let i = n &&
|
|
689
|
-
if (i &&
|
|
693
|
+
let i = n && V(n);
|
|
694
|
+
if (i && H(i.rows) && t) {
|
|
690
695
|
let n = i.rows.map((t) => t.map((t) => t.href && !e(t.href) ? { text: t.text } : t));
|
|
691
696
|
return /* @__PURE__ */ m(p, { children: t({
|
|
692
697
|
headers: i.headers,
|
|
@@ -777,6 +782,19 @@ function je({ className: e }) {
|
|
|
777
782
|
});
|
|
778
783
|
}
|
|
779
784
|
function Me({ className: e }) {
|
|
785
|
+
return /* @__PURE__ */ m("svg", {
|
|
786
|
+
viewBox: "0 0 24 24",
|
|
787
|
+
fill: "none",
|
|
788
|
+
stroke: "currentColor",
|
|
789
|
+
strokeWidth: 2,
|
|
790
|
+
strokeLinecap: "round",
|
|
791
|
+
strokeLinejoin: "round",
|
|
792
|
+
className: e,
|
|
793
|
+
"aria-hidden": "true",
|
|
794
|
+
children: /* @__PURE__ */ m("path", { d: "m22.7 13.5-2-2-2 2M21 12a9 9 0 1 1-1.245-4.57M12 7v5l3 2" })
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
function Ne({ className: e }) {
|
|
780
798
|
return /* @__PURE__ */ h("svg", {
|
|
781
799
|
viewBox: "0 0 24 24",
|
|
782
800
|
fill: "none",
|
|
@@ -795,8 +813,8 @@ function Me({ className: e }) {
|
|
|
795
813
|
}
|
|
796
814
|
//#endregion
|
|
797
815
|
//#region src/ui/CopyMarkdownButton.tsx
|
|
798
|
-
var
|
|
799
|
-
function
|
|
816
|
+
var Pe = 1500;
|
|
817
|
+
function Fe({ markdown: e, className: t, ariaLabel: n = "copy response as markdown", tooltipDefaultText: r = "Copy as markdown", tooltipCopiedText: i = "Copied!" }) {
|
|
800
818
|
let [o, s] = l(!1), [u, d] = l(!1), p = c(null), g = c(null), _ = Te(g);
|
|
801
819
|
return a(() => () => {
|
|
802
820
|
p.current !== null && clearTimeout(p.current);
|
|
@@ -816,7 +834,7 @@ function Pe({ markdown: e, className: t, ariaLabel: n = "copy response as markdo
|
|
|
816
834
|
} catch {
|
|
817
835
|
return;
|
|
818
836
|
}
|
|
819
|
-
s(!0), p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => s(!1),
|
|
837
|
+
s(!0), p.current !== null && clearTimeout(p.current), p.current = setTimeout(() => s(!1), Pe);
|
|
820
838
|
},
|
|
821
839
|
"aria-label": n,
|
|
822
840
|
className: `bailey-copy-button${t ? ` ${t}` : ""}`,
|
|
@@ -835,20 +853,20 @@ function Pe({ markdown: e, className: t, ariaLabel: n = "copy response as markdo
|
|
|
835
853
|
}
|
|
836
854
|
//#endregion
|
|
837
855
|
//#region src/ui/BaileyTracePanel.tsx
|
|
838
|
-
async function
|
|
856
|
+
async function Ie(e) {
|
|
839
857
|
try {
|
|
840
858
|
await navigator.clipboard.writeText(e);
|
|
841
859
|
} catch {}
|
|
842
860
|
}
|
|
843
|
-
function
|
|
861
|
+
function Le({ text: e, label: t = "Copy" }) {
|
|
844
862
|
return /* @__PURE__ */ m("button", {
|
|
845
863
|
type: "button",
|
|
846
|
-
onClick: () =>
|
|
864
|
+
onClick: () => Ie(e),
|
|
847
865
|
className: "bailey-trace-copy-button",
|
|
848
866
|
children: t
|
|
849
867
|
});
|
|
850
868
|
}
|
|
851
|
-
function
|
|
869
|
+
function Re(e) {
|
|
852
870
|
if (e.failed || e.kind === "error") return "bailey-trace-chip bailey-trace-chip-error";
|
|
853
871
|
switch (e.kind) {
|
|
854
872
|
case "tool_start": return "bailey-trace-chip bailey-trace-chip-info";
|
|
@@ -867,7 +885,7 @@ function $({ label: e, content: t, copyable: n }) {
|
|
|
867
885
|
}),
|
|
868
886
|
n && /* @__PURE__ */ m("div", {
|
|
869
887
|
className: "bailey-trace-disclosure-actions",
|
|
870
|
-
children: /* @__PURE__ */ m(
|
|
888
|
+
children: /* @__PURE__ */ m(Le, { text: t })
|
|
871
889
|
}),
|
|
872
890
|
/* @__PURE__ */ m("pre", {
|
|
873
891
|
className: "bailey-trace-disclosure-content",
|
|
@@ -876,7 +894,7 @@ function $({ label: e, content: t, copyable: n }) {
|
|
|
876
894
|
]
|
|
877
895
|
});
|
|
878
896
|
}
|
|
879
|
-
function
|
|
897
|
+
function ze({ row: e }) {
|
|
880
898
|
return /* @__PURE__ */ h("div", {
|
|
881
899
|
className: "bailey-trace-row",
|
|
882
900
|
children: [
|
|
@@ -893,7 +911,7 @@ function Re({ row: e }) {
|
|
|
893
911
|
children: ue(e.gapMs)
|
|
894
912
|
}),
|
|
895
913
|
/* @__PURE__ */ m("span", {
|
|
896
|
-
className:
|
|
914
|
+
className: Re(e),
|
|
897
915
|
children: e.label
|
|
898
916
|
}),
|
|
899
917
|
/* @__PURE__ */ m("span", {
|
|
@@ -917,13 +935,13 @@ function Re({ row: e }) {
|
|
|
917
935
|
]
|
|
918
936
|
});
|
|
919
937
|
}
|
|
920
|
-
function
|
|
938
|
+
function Be(e, t) {
|
|
921
939
|
if (e.chunkCount === 0) return "Streamed: no chunks received";
|
|
922
940
|
if (e.chunkCount === 1 || e.firstChunkAt === null) return "Streamed: 1 chunk (not incremental)";
|
|
923
941
|
let n = e.firstChunkAt - t, r = (e.lastChunkAt ?? e.firstChunkAt) - e.firstChunkAt;
|
|
924
942
|
return `Streamed: ${e.chunkCount} chunks · first chunk after ${n}ms · spread over ${(r / 1e3).toFixed(1)}s`;
|
|
925
943
|
}
|
|
926
|
-
function
|
|
944
|
+
function Ve({ request: e }) {
|
|
927
945
|
let t = s(() => JSON.stringify({
|
|
928
946
|
model: e.model,
|
|
929
947
|
instructions: e.systemPrompt,
|
|
@@ -947,7 +965,7 @@ function Be({ request: e }) {
|
|
|
947
965
|
}),
|
|
948
966
|
/* @__PURE__ */ m("span", {
|
|
949
967
|
className: "bailey-trace-request-meta",
|
|
950
|
-
children:
|
|
968
|
+
children: Be(e.streamStats, e.sentAt)
|
|
951
969
|
}),
|
|
952
970
|
/* @__PURE__ */ m($, {
|
|
953
971
|
label: `System prompt (${e.systemPrompt.length.toLocaleString()} chars)`,
|
|
@@ -972,14 +990,14 @@ function Be({ request: e }) {
|
|
|
972
990
|
]
|
|
973
991
|
});
|
|
974
992
|
}
|
|
975
|
-
function
|
|
993
|
+
function He({ events: e, lastRequest: t, onClear: n }) {
|
|
976
994
|
let r = s(() => de(e), [e]), i = s(() => pe(r), [r]), a = s(() => JSON.stringify(e, null, 2), [e]);
|
|
977
995
|
return /* @__PURE__ */ h("div", {
|
|
978
996
|
className: "bailey-trace-body",
|
|
979
997
|
children: [
|
|
980
998
|
/* @__PURE__ */ h("div", {
|
|
981
999
|
className: "bailey-trace-actions-row",
|
|
982
|
-
children: [e.length > 0 && /* @__PURE__ */ m(
|
|
1000
|
+
children: [e.length > 0 && /* @__PURE__ */ m(Le, {
|
|
983
1001
|
text: a,
|
|
984
1002
|
label: "Copy trace as JSON"
|
|
985
1003
|
}), /* @__PURE__ */ m("button", {
|
|
@@ -989,15 +1007,15 @@ function Ve({ events: e, lastRequest: t, onClear: n }) {
|
|
|
989
1007
|
children: "Clear"
|
|
990
1008
|
})]
|
|
991
1009
|
}),
|
|
992
|
-
t && /* @__PURE__ */ m(
|
|
1010
|
+
t && /* @__PURE__ */ m(Ve, { request: t }),
|
|
993
1011
|
/* @__PURE__ */ m("div", {
|
|
994
1012
|
className: "bailey-trace-rows",
|
|
995
1013
|
children: i.map((e, t) => {
|
|
996
|
-
if (e.type === "single") return /* @__PURE__ */ m(
|
|
1014
|
+
if (e.type === "single") return /* @__PURE__ */ m(ze, { row: e.row }, e.row.key);
|
|
997
1015
|
let n = e.rows.filter((e) => e.isToolStart).length;
|
|
998
1016
|
if (n <= 1) return /* @__PURE__ */ m("div", {
|
|
999
1017
|
className: "bailey-trace-rows",
|
|
1000
|
-
children: e.rows.map((e) => /* @__PURE__ */ m(
|
|
1018
|
+
children: e.rows.map((e) => /* @__PURE__ */ m(ze, { row: e }, e.key))
|
|
1001
1019
|
}, `group-${t}`);
|
|
1002
1020
|
let r = e.rows.filter((e) => e.failed).length;
|
|
1003
1021
|
return /* @__PURE__ */ h("details", {
|
|
@@ -1019,7 +1037,7 @@ function Ve({ events: e, lastRequest: t, onClear: n }) {
|
|
|
1019
1037
|
]
|
|
1020
1038
|
}), /* @__PURE__ */ m("div", {
|
|
1021
1039
|
className: "bailey-trace-rows",
|
|
1022
|
-
children: e.rows.map((e) => /* @__PURE__ */ m(
|
|
1040
|
+
children: e.rows.map((e) => /* @__PURE__ */ m(ze, { row: e }, e.key))
|
|
1023
1041
|
})]
|
|
1024
1042
|
}, `group-${t}`);
|
|
1025
1043
|
})
|
|
@@ -1027,7 +1045,7 @@ function Ve({ events: e, lastRequest: t, onClear: n }) {
|
|
|
1027
1045
|
]
|
|
1028
1046
|
});
|
|
1029
1047
|
}
|
|
1030
|
-
function
|
|
1048
|
+
function Ue({ events: e, lastRequest: t, onClear: n }) {
|
|
1031
1049
|
let [r, i] = l(!1), a = s(() => me(e), [e]), o = s(() => fe(e), [e]);
|
|
1032
1050
|
return e.length === 0 && !t ? null : /* @__PURE__ */ h("div", {
|
|
1033
1051
|
className: "bailey-trace-panel",
|
|
@@ -1049,7 +1067,7 @@ function He({ events: e, lastRequest: t, onClear: n }) {
|
|
|
1049
1067
|
className: a ? "bailey-trace-summary bailey-trace-summary-error" : "bailey-trace-summary",
|
|
1050
1068
|
children: o
|
|
1051
1069
|
})]
|
|
1052
|
-
}), r && /* @__PURE__ */ m(
|
|
1070
|
+
}), r && /* @__PURE__ */ m(He, {
|
|
1053
1071
|
events: e,
|
|
1054
1072
|
lastRequest: t,
|
|
1055
1073
|
onClear: n
|
|
@@ -1058,9 +1076,10 @@ function He({ events: e, lastRequest: t, onClear: n }) {
|
|
|
1058
1076
|
}
|
|
1059
1077
|
//#endregion
|
|
1060
1078
|
//#region src/ui/BaileyChatPanel.tsx
|
|
1061
|
-
var
|
|
1079
|
+
var We = "How can bailey AI help you today?", Ge = "Reply to bailey AI", Ke = {
|
|
1062
1080
|
newChatButtonText: "New chat",
|
|
1063
1081
|
newChatAriaLabel: "new chat",
|
|
1082
|
+
historyAriaLabel: "conversation history",
|
|
1064
1083
|
suggestionsTitle: "Suggested for you",
|
|
1065
1084
|
emptyStateMessage: "Ask Bailey a question to get started.",
|
|
1066
1085
|
youLabel: "You",
|
|
@@ -1073,104 +1092,110 @@ var Ue = "How can bailey AI help you today?", We = "Reply to bailey AI", Ge = {
|
|
|
1073
1092
|
copyButtonAriaLabel: "copy response as markdown",
|
|
1074
1093
|
copyButtonTooltipDefault: "Copy as markdown",
|
|
1075
1094
|
copyButtonTooltipCopied: "Copied!"
|
|
1076
|
-
},
|
|
1095
|
+
}, qe = [d], Je = {
|
|
1077
1096
|
...Ee(),
|
|
1078
1097
|
p: ({ children: e }) => /* @__PURE__ */ m(p, { children: e })
|
|
1079
|
-
},
|
|
1098
|
+
}, Ye = n(function({ content: e, components: t }) {
|
|
1080
1099
|
return /* @__PURE__ */ m("div", {
|
|
1081
1100
|
className: "bailey-markdown-content",
|
|
1082
1101
|
children: /* @__PURE__ */ m(u, {
|
|
1083
|
-
remarkPlugins:
|
|
1102
|
+
remarkPlugins: qe,
|
|
1084
1103
|
components: t,
|
|
1085
1104
|
skipHtml: !0,
|
|
1086
1105
|
children: e
|
|
1087
1106
|
})
|
|
1088
1107
|
});
|
|
1089
1108
|
});
|
|
1090
|
-
function
|
|
1109
|
+
function Xe(e, t, n) {
|
|
1091
1110
|
if (e !== "streaming") return;
|
|
1092
1111
|
let r = t.filter((e) => e.turnSentAt === n?.sentAt);
|
|
1093
1112
|
if (r.length !== 0) return Y(r[r.length - 1]);
|
|
1094
1113
|
}
|
|
1095
|
-
function
|
|
1114
|
+
function Ze(e) {
|
|
1096
1115
|
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), r = t.toLocaleTimeString([], {
|
|
1097
1116
|
hour: "numeric",
|
|
1098
1117
|
minute: "2-digit"
|
|
1099
1118
|
});
|
|
1100
1119
|
return n ? `Today ${r}` : `${t.toLocaleDateString()} ${r}`;
|
|
1101
1120
|
}
|
|
1102
|
-
function
|
|
1103
|
-
let { messages:
|
|
1104
|
-
...
|
|
1105
|
-
...
|
|
1106
|
-
},
|
|
1107
|
-
renderTable:
|
|
1108
|
-
renderChart:
|
|
1109
|
-
}), [
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
]),
|
|
1121
|
+
function Qe({ chat: e, placeholder: t, replyPlaceholder: n = Ge, emptyPlaceholder: r, suggestions: i, onHistoryClick: o, privacyNote: d, resolveActivityIcon: p, className: g, height: _, width: v, hideDeveloperDetails: y = !1, renderMessageActions: b, renderTable: x, renderChart: S, labels: C, formatMessageTime: w }) {
|
|
1122
|
+
let { messages: T, traceEvents: E, lastRequest: D, status: O, error: k, send: A, stop: j, retryLast: M, clearTrace: N, clearError: P, newChat: F } = e, [I, L] = l(""), R = {
|
|
1123
|
+
...Ke,
|
|
1124
|
+
...C
|
|
1125
|
+
}, z = w ?? Ze, B = c(null), V = we(B), H = c(null), ee = c(null), U = c(!0), te = s(() => Ee({
|
|
1126
|
+
renderTable: x,
|
|
1127
|
+
renderChart: S
|
|
1128
|
+
}), [x, S]), W = s(() => Xe(O, E, D), [
|
|
1129
|
+
O,
|
|
1130
|
+
E,
|
|
1131
|
+
D
|
|
1132
|
+
]), G = T.length === 0, K = t ?? (G ? r ?? We : n);
|
|
1114
1133
|
a(() => {
|
|
1115
|
-
let e =
|
|
1134
|
+
let e = ee.current;
|
|
1116
1135
|
if (!e) return;
|
|
1117
1136
|
let t = () => {
|
|
1118
1137
|
let t = e.scrollHeight - e.scrollTop - e.clientHeight;
|
|
1119
|
-
|
|
1138
|
+
U.current = t < 60;
|
|
1120
1139
|
};
|
|
1121
1140
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1122
1141
|
}, []), a(() => {
|
|
1123
|
-
|
|
1124
|
-
behavior:
|
|
1142
|
+
U.current && H.current?.scrollIntoView({
|
|
1143
|
+
behavior: O === "streaming" ? "auto" : "smooth",
|
|
1125
1144
|
block: "nearest"
|
|
1126
1145
|
});
|
|
1127
|
-
}, [
|
|
1128
|
-
let
|
|
1129
|
-
|
|
1146
|
+
}, [T, O]);
|
|
1147
|
+
let ne = (e) => {
|
|
1148
|
+
U.current = !0, A(e);
|
|
1130
1149
|
};
|
|
1131
1150
|
return /* @__PURE__ */ m(_e.Provider, {
|
|
1132
|
-
value:
|
|
1151
|
+
value: V,
|
|
1133
1152
|
children: /* @__PURE__ */ m("div", {
|
|
1134
|
-
ref:
|
|
1135
|
-
className: `bailey-chat-panel${
|
|
1136
|
-
style:
|
|
1137
|
-
height:
|
|
1138
|
-
width:
|
|
1153
|
+
ref: B,
|
|
1154
|
+
className: `bailey-chat-panel${g ? ` ${g}` : ""}`,
|
|
1155
|
+
style: _ !== void 0 || v !== void 0 ? {
|
|
1156
|
+
height: _,
|
|
1157
|
+
width: v
|
|
1139
1158
|
} : void 0,
|
|
1140
1159
|
children: /* @__PURE__ */ h("div", {
|
|
1141
1160
|
className: "bailey-chat-panel-inner",
|
|
1142
1161
|
children: [
|
|
1143
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ h("div", {
|
|
1144
1163
|
className: "bailey-toolbar-row",
|
|
1145
|
-
children: !
|
|
1164
|
+
children: [!G && /* @__PURE__ */ m("button", {
|
|
1146
1165
|
type: "button",
|
|
1147
|
-
onClick:
|
|
1148
|
-
"aria-label":
|
|
1166
|
+
onClick: F,
|
|
1167
|
+
"aria-label": R.newChatAriaLabel,
|
|
1149
1168
|
className: "bailey-new-chat-button",
|
|
1150
|
-
children:
|
|
1151
|
-
})
|
|
1169
|
+
children: R.newChatButtonText
|
|
1170
|
+
}), o && /* @__PURE__ */ m("button", {
|
|
1171
|
+
type: "button",
|
|
1172
|
+
onClick: o,
|
|
1173
|
+
"aria-label": R.historyAriaLabel,
|
|
1174
|
+
className: "bailey-history-button",
|
|
1175
|
+
children: /* @__PURE__ */ m(Me, { className: "bailey-history-icon" })
|
|
1176
|
+
})]
|
|
1152
1177
|
}),
|
|
1153
1178
|
/* @__PURE__ */ h("div", {
|
|
1154
1179
|
className: "bailey-chat-transcript",
|
|
1155
|
-
ref:
|
|
1180
|
+
ref: ee,
|
|
1156
1181
|
children: [
|
|
1157
|
-
|
|
1182
|
+
G && (i && i.length > 0 ? /* @__PURE__ */ h("div", {
|
|
1158
1183
|
className: "bailey-suggestions",
|
|
1159
1184
|
children: [/* @__PURE__ */ m("div", {
|
|
1160
1185
|
className: "bailey-suggestions-title",
|
|
1161
|
-
children:
|
|
1186
|
+
children: R.suggestionsTitle
|
|
1162
1187
|
}), i.map((e, t) => /* @__PURE__ */ h("button", {
|
|
1163
1188
|
type: "button",
|
|
1164
|
-
onClick: () =>
|
|
1189
|
+
onClick: () => ne(e.value ?? e.label),
|
|
1165
1190
|
className: "bailey-suggestion-card",
|
|
1166
1191
|
children: [/* @__PURE__ */ m("span", { children: e.label }), /* @__PURE__ */ m(ke, { className: "bailey-suggestion-icon" })]
|
|
1167
1192
|
}, `${e.label}-${t}`))]
|
|
1168
1193
|
}) : /* @__PURE__ */ m("div", {
|
|
1169
1194
|
className: "bailey-empty-state",
|
|
1170
|
-
children:
|
|
1195
|
+
children: R.emptyStateMessage
|
|
1171
1196
|
})),
|
|
1172
|
-
|
|
1173
|
-
let n = e.role === "assistant" && t ===
|
|
1197
|
+
T.map((e, t) => {
|
|
1198
|
+
let n = e.role === "assistant" && t === T.length - 1, r = O === "streaming" && n && e.content === "", i = e.role === "assistant" && !r ? he(E, e.createdAt) : [], a = i[i.length - 1];
|
|
1174
1199
|
return /* @__PURE__ */ m("div", {
|
|
1175
1200
|
className: e.role === "user" ? "bailey-message-row bailey-message-row-user" : "bailey-message-row",
|
|
1176
1201
|
children: e.role === "user" ? /* @__PURE__ */ h("div", {
|
|
@@ -1179,15 +1204,15 @@ function Ze({ chat: e, placeholder: t, replyPlaceholder: n = We, emptyPlaceholde
|
|
|
1179
1204
|
className: "bailey-message-meta",
|
|
1180
1205
|
children: [/* @__PURE__ */ m("span", {
|
|
1181
1206
|
className: "bailey-message-meta-name",
|
|
1182
|
-
children:
|
|
1183
|
-
}), e.createdAt !== void 0 && /* @__PURE__ */ m("span", { children:
|
|
1207
|
+
children: R.youLabel
|
|
1208
|
+
}), e.createdAt !== void 0 && /* @__PURE__ */ m("span", { children: z(e.createdAt) })]
|
|
1184
1209
|
}), /* @__PURE__ */ m("div", {
|
|
1185
1210
|
className: "bailey-user-bubble",
|
|
1186
1211
|
children: e.content
|
|
1187
1212
|
})]
|
|
1188
1213
|
}) : r ? /* @__PURE__ */ m("div", {
|
|
1189
1214
|
className: "bailey-thinking-hint",
|
|
1190
|
-
children:
|
|
1215
|
+
children: W ?? R.thinkingHint
|
|
1191
1216
|
}) : /* @__PURE__ */ h("div", {
|
|
1192
1217
|
className: "bailey-assistant-message",
|
|
1193
1218
|
children: [
|
|
@@ -1195,104 +1220,104 @@ function Ze({ chat: e, placeholder: t, replyPlaceholder: n = We, emptyPlaceholde
|
|
|
1195
1220
|
className: "bailey-activity-line",
|
|
1196
1221
|
children: [/* @__PURE__ */ m("span", {
|
|
1197
1222
|
className: "bailey-activity-icon",
|
|
1198
|
-
children:
|
|
1223
|
+
children: p?.(a.toolName) ?? /* @__PURE__ */ m(Ne, {})
|
|
1199
1224
|
}), /* @__PURE__ */ m("span", { children: a.text })]
|
|
1200
1225
|
}),
|
|
1201
|
-
/* @__PURE__ */ m(
|
|
1226
|
+
/* @__PURE__ */ m(Ye, {
|
|
1202
1227
|
content: e.content,
|
|
1203
1228
|
components: te
|
|
1204
1229
|
}),
|
|
1205
|
-
e.streaming &&
|
|
1230
|
+
e.streaming && W && /* @__PURE__ */ m("div", {
|
|
1206
1231
|
className: "bailey-streaming-hint",
|
|
1207
|
-
children:
|
|
1232
|
+
children: W
|
|
1208
1233
|
}),
|
|
1209
1234
|
!e.streaming && /* @__PURE__ */ h("div", {
|
|
1210
1235
|
className: "bailey-message-actions",
|
|
1211
|
-
children: [/* @__PURE__ */ m(
|
|
1236
|
+
children: [/* @__PURE__ */ m(Fe, {
|
|
1212
1237
|
markdown: e.content,
|
|
1213
|
-
ariaLabel:
|
|
1214
|
-
tooltipDefaultText:
|
|
1215
|
-
tooltipCopiedText:
|
|
1216
|
-
}),
|
|
1238
|
+
ariaLabel: R.copyButtonAriaLabel,
|
|
1239
|
+
tooltipDefaultText: R.copyButtonTooltipDefault,
|
|
1240
|
+
tooltipCopiedText: R.copyButtonTooltipCopied
|
|
1241
|
+
}), b?.(e)]
|
|
1217
1242
|
})
|
|
1218
1243
|
]
|
|
1219
1244
|
})
|
|
1220
1245
|
}, e.id);
|
|
1221
1246
|
}),
|
|
1222
|
-
/* @__PURE__ */ m("div", { ref:
|
|
1247
|
+
/* @__PURE__ */ m("div", { ref: H })
|
|
1223
1248
|
]
|
|
1224
1249
|
}),
|
|
1225
|
-
|
|
1250
|
+
k && /* @__PURE__ */ h("div", {
|
|
1226
1251
|
className: "bailey-error-banner",
|
|
1227
1252
|
role: "alert",
|
|
1228
|
-
children: [/* @__PURE__ */ m("span", { children:
|
|
1253
|
+
children: [/* @__PURE__ */ m("span", { children: k }), /* @__PURE__ */ h("div", {
|
|
1229
1254
|
className: "bailey-error-actions",
|
|
1230
1255
|
children: [/* @__PURE__ */ m("button", {
|
|
1231
1256
|
type: "button",
|
|
1232
|
-
onClick:
|
|
1257
|
+
onClick: M,
|
|
1233
1258
|
className: "bailey-retry-button",
|
|
1234
|
-
children:
|
|
1259
|
+
children: R.retryButtonText
|
|
1235
1260
|
}), /* @__PURE__ */ m("button", {
|
|
1236
1261
|
type: "button",
|
|
1237
|
-
onClick:
|
|
1238
|
-
"aria-label":
|
|
1262
|
+
onClick: P,
|
|
1263
|
+
"aria-label": R.dismissErrorAriaLabel,
|
|
1239
1264
|
className: "bailey-dismiss-button",
|
|
1240
1265
|
children: "✕"
|
|
1241
1266
|
})]
|
|
1242
1267
|
})]
|
|
1243
1268
|
}),
|
|
1244
|
-
!
|
|
1245
|
-
events:
|
|
1246
|
-
lastRequest:
|
|
1247
|
-
onClear:
|
|
1269
|
+
!y && /* @__PURE__ */ m(Ue, {
|
|
1270
|
+
events: E,
|
|
1271
|
+
lastRequest: D,
|
|
1272
|
+
onClear: N
|
|
1248
1273
|
}),
|
|
1249
1274
|
/* @__PURE__ */ h("form", {
|
|
1250
1275
|
onSubmit: (e) => {
|
|
1251
|
-
e.preventDefault(), !(!
|
|
1276
|
+
e.preventDefault(), !(!I.trim() || O === "streaming") && (ne(I), L(""));
|
|
1252
1277
|
},
|
|
1253
1278
|
className: "bailey-input-row",
|
|
1254
1279
|
children: [/* @__PURE__ */ m("input", {
|
|
1255
1280
|
type: "text",
|
|
1256
|
-
placeholder:
|
|
1257
|
-
"aria-label":
|
|
1258
|
-
value:
|
|
1259
|
-
onChange: (e) =>
|
|
1260
|
-
disabled:
|
|
1281
|
+
placeholder: K,
|
|
1282
|
+
"aria-label": K,
|
|
1283
|
+
value: I,
|
|
1284
|
+
onChange: (e) => L(e.target.value),
|
|
1285
|
+
disabled: O === "streaming",
|
|
1261
1286
|
className: "bailey-input"
|
|
1262
|
-
}),
|
|
1287
|
+
}), O === "streaming" ? /* @__PURE__ */ m(f.Provider, {
|
|
1263
1288
|
delayDuration: 200,
|
|
1264
1289
|
children: /* @__PURE__ */ h(f.Root, { children: [/* @__PURE__ */ m(f.Trigger, {
|
|
1265
1290
|
asChild: !0,
|
|
1266
1291
|
children: /* @__PURE__ */ m("button", {
|
|
1267
1292
|
type: "button",
|
|
1268
|
-
onClick:
|
|
1269
|
-
"aria-label":
|
|
1293
|
+
onClick: j,
|
|
1294
|
+
"aria-label": R.stopAriaLabel,
|
|
1270
1295
|
className: "bailey-stop-button",
|
|
1271
1296
|
children: /* @__PURE__ */ m(Oe, { className: "bailey-stop-icon" })
|
|
1272
1297
|
})
|
|
1273
1298
|
}), /* @__PURE__ */ m(f.Portal, {
|
|
1274
|
-
container:
|
|
1299
|
+
container: V instanceof ShadowRoot ? V : void 0,
|
|
1275
1300
|
children: /* @__PURE__ */ h(f.Content, {
|
|
1276
1301
|
side: "top",
|
|
1277
1302
|
className: "bailey-tooltip-content",
|
|
1278
|
-
children: [
|
|
1303
|
+
children: [R.stopButtonText, /* @__PURE__ */ m(f.Arrow, { className: "bailey-tooltip-arrow" })]
|
|
1279
1304
|
})
|
|
1280
1305
|
})] })
|
|
1281
1306
|
}) : /* @__PURE__ */ m("button", {
|
|
1282
1307
|
type: "submit",
|
|
1283
|
-
"aria-label":
|
|
1284
|
-
disabled: !
|
|
1308
|
+
"aria-label": R.sendAriaLabel,
|
|
1309
|
+
disabled: !I.trim(),
|
|
1285
1310
|
className: "bailey-send-button",
|
|
1286
1311
|
children: /* @__PURE__ */ m(De, { className: "bailey-send-icon" })
|
|
1287
1312
|
})]
|
|
1288
1313
|
}),
|
|
1289
|
-
(
|
|
1314
|
+
(G || d?.alwaysVisible) && d && /* @__PURE__ */ m("div", {
|
|
1290
1315
|
className: "bailey-privacy-note",
|
|
1291
1316
|
children: /* @__PURE__ */ m(u, {
|
|
1292
|
-
remarkPlugins:
|
|
1293
|
-
components:
|
|
1317
|
+
remarkPlugins: qe,
|
|
1318
|
+
components: Je,
|
|
1294
1319
|
skipHtml: !0,
|
|
1295
|
-
children:
|
|
1320
|
+
children: d.markdown
|
|
1296
1321
|
})
|
|
1297
1322
|
})
|
|
1298
1323
|
]
|
|
@@ -1302,6 +1327,6 @@ function Ze({ chat: e, placeholder: t, replyPlaceholder: n = We, emptyPlaceholde
|
|
|
1302
1327
|
}
|
|
1303
1328
|
//#endregion
|
|
1304
1329
|
//#region src/index.ts
|
|
1305
|
-
var
|
|
1330
|
+
var $e = "0.3.1-pre.2";
|
|
1306
1331
|
//#endregion
|
|
1307
|
-
export {
|
|
1332
|
+
export { Ne as ActivityIcon, ke as ArrowUpRightIcon, $e as BAILEYAI_CHAT_UI_VERSION, ee as BAILEY_CHART_PROMPT_FRAGMENT, F as BAILEY_TABLE_GRID_ROW_THRESHOLD, Qe as BaileyChatPanel, Ue as BaileyTracePanel, Fe as CopyMarkdownButton, De as HeartIcon, ie as TRACE_KIND_LABEL, Ee as createBaileyMarkdownComponents, C as extractPseudoToolCalls, V as extractTableData, ue as formatTraceGap, le as formatTraceTime, me as hasTraceFailure, e as isSafeMarkdownUrl, j as joinInstructions, re as parseBaileyChartSpec, T as parseSseFrames, P as resolveToolCall, H as shouldUseGrid, he as toActivityLines, de as toTraceRows, pe as toTraceSegments, oe as traceEventArgsDetail, Y as traceEventHint, se as traceEventOutputDetail, ce as traceEventRawDetail, ae as traceEventSummary, J as traceEventToolName, fe as traceSummaryLine, A as useBaileyChat };
|