@bymos/agentkit-sdk 0.9.3 → 0.9.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/README.md +4 -4
- package/agentkit-widget.iife.js +149 -126
- package/agentkit-widget.js +150 -127
- package/index.cjs +145 -122
- package/index.d.ts +1 -1
- package/index.js +165 -237
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRoot as e } from "preact/compat/client";
|
|
2
2
|
import { createElement as t, useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "preact/compat";
|
|
3
3
|
import { Fragment as s, jsx as c, jsxs as l } from "preact/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
5
5
|
var u;
|
|
6
6
|
(function(e) {
|
|
7
7
|
e.assertEqual = (e) => {};
|
|
@@ -148,8 +148,7 @@ var f = u.arrayToEnum([
|
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
h.create = (e) => new h(e);
|
|
151
|
-
|
|
152
|
-
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
151
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
153
152
|
var g = (e, t) => {
|
|
154
153
|
let n;
|
|
155
154
|
switch (e.code) {
|
|
@@ -208,8 +207,7 @@ var g = (e, t) => {
|
|
|
208
207
|
function v() {
|
|
209
208
|
return _;
|
|
210
209
|
}
|
|
211
|
-
|
|
212
|
-
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
210
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
213
211
|
var y = (e) => {
|
|
214
212
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
215
213
|
...i,
|
|
@@ -299,8 +297,7 @@ var x = class e {
|
|
|
299
297
|
(function(e) {
|
|
300
298
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
301
299
|
})(k ||= {});
|
|
302
|
-
|
|
303
|
-
//#region ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
300
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
304
301
|
var A = class {
|
|
305
302
|
constructor(e, t, n, r) {
|
|
306
303
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
@@ -580,7 +577,7 @@ function be(e) {
|
|
|
580
577
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
581
578
|
}
|
|
582
579
|
function xe(e, t) {
|
|
583
|
-
return
|
|
580
|
+
return !((t !== "v4" && t || !ue.test(e)) && (t !== "v6" && t || !fe.test(e)));
|
|
584
581
|
}
|
|
585
582
|
function Se(e, t) {
|
|
586
583
|
if (!ae.test(e)) return !1;
|
|
@@ -594,7 +591,7 @@ function Se(e, t) {
|
|
|
594
591
|
}
|
|
595
592
|
}
|
|
596
593
|
function Ce(e, t) {
|
|
597
|
-
return
|
|
594
|
+
return !((t !== "v4" && t || !de.test(e)) && (t !== "v6" && t || !pe.test(e)));
|
|
598
595
|
}
|
|
599
596
|
var we = class e extends M {
|
|
600
597
|
_parse(e) {
|
|
@@ -1590,14 +1587,11 @@ function Le(e) {
|
|
|
1590
1587
|
...e._def,
|
|
1591
1588
|
shape: () => t
|
|
1592
1589
|
});
|
|
1593
|
-
}
|
|
1590
|
+
}
|
|
1591
|
+
return e instanceof Ie ? new Ie({
|
|
1594
1592
|
...e._def,
|
|
1595
1593
|
type: Le(e.element)
|
|
1596
|
-
});
|
|
1597
|
-
else if (e instanceof R) return R.create(Le(e.unwrap()));
|
|
1598
|
-
else if (e instanceof $e) return $e.create(Le(e.unwrap()));
|
|
1599
|
-
else if (e instanceof He) return He.create(e.items.map((e) => Le(e)));
|
|
1600
|
-
else return e;
|
|
1594
|
+
}) : e instanceof R ? R.create(Le(e.unwrap())) : e instanceof $e ? $e.create(Le(e.unwrap())) : e instanceof He ? He.create(e.items.map((e) => Le(e))) : e;
|
|
1601
1595
|
}
|
|
1602
1596
|
var F = class e extends M {
|
|
1603
1597
|
constructor() {
|
|
@@ -1755,7 +1749,7 @@ var F = class e extends M {
|
|
|
1755
1749
|
let n = {};
|
|
1756
1750
|
for (let e of u.objectKeys(this.shape)) {
|
|
1757
1751
|
let r = this.shape[e];
|
|
1758
|
-
t && !t[e] ?
|
|
1752
|
+
n[e] = t && !t[e] ? r : r.optional();
|
|
1759
1753
|
}
|
|
1760
1754
|
return new e({
|
|
1761
1755
|
...this._def,
|
|
@@ -1937,7 +1931,8 @@ function Be(e, t) {
|
|
|
1937
1931
|
valid: !0,
|
|
1938
1932
|
data: i
|
|
1939
1933
|
};
|
|
1940
|
-
}
|
|
1934
|
+
}
|
|
1935
|
+
if (n === f.array && r === f.array) {
|
|
1941
1936
|
if (e.length !== t.length) return { valid: !1 };
|
|
1942
1937
|
let n = [];
|
|
1943
1938
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -1949,11 +1944,11 @@ function Be(e, t) {
|
|
|
1949
1944
|
valid: !0,
|
|
1950
1945
|
data: n
|
|
1951
1946
|
};
|
|
1952
|
-
}
|
|
1947
|
+
}
|
|
1948
|
+
return n === f.date && r === f.date && +e == +t ? {
|
|
1953
1949
|
valid: !0,
|
|
1954
1950
|
data: e
|
|
1955
|
-
};
|
|
1956
|
-
else return { valid: !1 };
|
|
1951
|
+
} : { valid: !1 };
|
|
1957
1952
|
}
|
|
1958
1953
|
var Ve = class extends M {
|
|
1959
1954
|
_parse(e) {
|
|
@@ -2106,7 +2101,8 @@ var Ue = class e extends M {
|
|
|
2106
2101
|
value: e
|
|
2107
2102
|
};
|
|
2108
2103
|
});
|
|
2109
|
-
}
|
|
2104
|
+
}
|
|
2105
|
+
{
|
|
2110
2106
|
let e = /* @__PURE__ */ new Map();
|
|
2111
2107
|
for (let n of a) {
|
|
2112
2108
|
let r = n.key, i = n.value;
|
|
@@ -2251,7 +2247,8 @@ var Ke = class e extends M {
|
|
|
2251
2247
|
throw o.addIssue(r(c, e)), o;
|
|
2252
2248
|
});
|
|
2253
2249
|
});
|
|
2254
|
-
}
|
|
2250
|
+
}
|
|
2251
|
+
{
|
|
2255
2252
|
let e = this;
|
|
2256
2253
|
return w(function(...t) {
|
|
2257
2254
|
let o = e._def.args.safeParse(t, i);
|
|
@@ -2500,7 +2497,8 @@ var L = class extends M {
|
|
|
2500
2497
|
status: t.value,
|
|
2501
2498
|
value: r.value
|
|
2502
2499
|
});
|
|
2503
|
-
}
|
|
2500
|
+
}
|
|
2501
|
+
return this._def.schema._parseAsync({
|
|
2504
2502
|
data: n.data,
|
|
2505
2503
|
path: n.path,
|
|
2506
2504
|
parent: n
|
|
@@ -2509,27 +2507,30 @@ var L = class extends M {
|
|
|
2509
2507
|
value: n.value
|
|
2510
2508
|
}))));
|
|
2511
2509
|
}
|
|
2512
|
-
if (r.type === "transform")
|
|
2513
|
-
|
|
2510
|
+
if (r.type === "transform") {
|
|
2511
|
+
if (n.common.async === !1) {
|
|
2512
|
+
let e = this._def.schema._parseSync({
|
|
2513
|
+
data: n.data,
|
|
2514
|
+
path: n.path,
|
|
2515
|
+
parent: n
|
|
2516
|
+
});
|
|
2517
|
+
if (!D(e)) return S;
|
|
2518
|
+
let a = r.transform(e.value, i);
|
|
2519
|
+
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2520
|
+
return {
|
|
2521
|
+
status: t.value,
|
|
2522
|
+
value: a
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
return this._def.schema._parseAsync({
|
|
2514
2526
|
data: n.data,
|
|
2515
2527
|
path: n.path,
|
|
2516
2528
|
parent: n
|
|
2517
|
-
})
|
|
2518
|
-
if (!D(e)) return S;
|
|
2519
|
-
let a = r.transform(e.value, i);
|
|
2520
|
-
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2521
|
-
return {
|
|
2529
|
+
}).then((e) => D(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2522
2530
|
status: t.value,
|
|
2523
|
-
value:
|
|
2524
|
-
};
|
|
2525
|
-
}
|
|
2526
|
-
data: n.data,
|
|
2527
|
-
path: n.path,
|
|
2528
|
-
parent: n
|
|
2529
|
-
}).then((e) => D(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2530
|
-
status: t.value,
|
|
2531
|
-
value: e
|
|
2532
|
-
})) : S);
|
|
2531
|
+
value: e
|
|
2532
|
+
})) : S);
|
|
2533
|
+
}
|
|
2533
2534
|
u.assertNever(r);
|
|
2534
2535
|
}
|
|
2535
2536
|
};
|
|
@@ -2733,8 +2734,7 @@ var lt = Ue.create;
|
|
|
2733
2734
|
We.create, Ge.create, Ke.create, qe.create, Je.create;
|
|
2734
2735
|
var ut = Xe.create;
|
|
2735
2736
|
Ze.create, Qe.create, L.create, R.create, $e.create, L.createWithPreprocess, it.create;
|
|
2736
|
-
|
|
2737
|
-
//#region ../../packages/widget-sdk/src/config/schema.ts
|
|
2737
|
+
// ../../packages/widget-sdk/src/config/schema.ts
|
|
2738
2738
|
var dt = ct({
|
|
2739
2739
|
mode: ut([
|
|
2740
2740
|
"light",
|
|
@@ -2775,7 +2775,7 @@ var dt = ct({
|
|
|
2775
2775
|
title: "AI Assistant",
|
|
2776
2776
|
theme: {
|
|
2777
2777
|
mode: "light",
|
|
2778
|
-
accentColor: "#
|
|
2778
|
+
accentColor: "#4f46e5",
|
|
2779
2779
|
fontFamily: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
|
|
2780
2780
|
borderRadius: "12px"
|
|
2781
2781
|
}
|
|
@@ -2786,7 +2786,7 @@ function gt(e, t) {
|
|
|
2786
2786
|
r && typeof r.theme == "object" && r.theme !== null ? (n = r.theme, delete r.theme) : r && typeof r.theme == "string" && (n = { mode: r.theme }, delete r.theme);
|
|
2787
2787
|
let i = r ? mt.passthrough().safeParse(r).data : void 0, a = i ? _t(i, e) : e, o = {
|
|
2788
2788
|
mode: a.theme?.mode ?? n?.mode ?? ht.theme.mode,
|
|
2789
|
-
accentColor: a.theme?.accentColor
|
|
2789
|
+
accentColor: a.theme?.accentColor || n?.accentColor || ht.theme.accentColor,
|
|
2790
2790
|
fontFamily: a.theme?.fontFamily ?? n?.fontFamily ?? ht.theme.fontFamily,
|
|
2791
2791
|
borderRadius: a.theme?.borderRadius ?? n?.borderRadius ?? ht.theme.borderRadius
|
|
2792
2792
|
};
|
|
@@ -2841,12 +2841,11 @@ function _t(e, t) {
|
|
|
2841
2841
|
let n = { ...e };
|
|
2842
2842
|
for (let e of Object.keys(t)) {
|
|
2843
2843
|
let r = t[e];
|
|
2844
|
-
r != null && (typeof r == "object" && !Array.isArray(r) && n[e] !== null && typeof n[e] == "object" ?
|
|
2844
|
+
r != null && (n[e] = typeof r == "object" && !Array.isArray(r) && n[e] !== null && typeof n[e] == "object" ? _t(n[e], r) : r);
|
|
2845
2845
|
}
|
|
2846
2846
|
return n;
|
|
2847
2847
|
}
|
|
2848
|
-
|
|
2849
|
-
//#region ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
2848
|
+
// ../../node_modules/.pnpm/tslib@2.9.1/node_modules/tslib/tslib.es6.mjs
|
|
2850
2849
|
var vt = function() {
|
|
2851
2850
|
return vt = Object.assign || function(e) {
|
|
2852
2851
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
@@ -2918,7 +2917,7 @@ function H(e, t) {
|
|
|
2918
2917
|
s = n.ops.pop(), n.trys.pop();
|
|
2919
2918
|
continue;
|
|
2920
2919
|
default:
|
|
2921
|
-
if (
|
|
2920
|
+
if (a = n.trys, !(a = a.length > 0 && a[a.length - 1]) && (s[0] === 6 || s[0] === 2)) {
|
|
2922
2921
|
n = 0;
|
|
2923
2922
|
continue;
|
|
2924
2923
|
}
|
|
@@ -2954,8 +2953,7 @@ function yt(e, t, n) {
|
|
|
2954
2953
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
2955
2954
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
2956
2955
|
}
|
|
2957
|
-
|
|
2958
|
-
//#region ../../node_modules/.pnpm/@fingerprintjs+fingerprintjs@4.6.2/node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js
|
|
2956
|
+
// ../../node_modules/.pnpm/@fingerprintjs+fingerprintjs@4.6.2/node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js
|
|
2959
2957
|
var bt = "4.6.2";
|
|
2960
2958
|
function xt(e, t) {
|
|
2961
2959
|
return new Promise(function(n) {
|
|
@@ -3096,8 +3094,7 @@ var zt = [2277735313, 289559509], Bt = [1291169091, 658871167], Vt = [0, 5], Ht
|
|
|
3096
3094
|
function Wt(e, t) {
|
|
3097
3095
|
var n = Nt(e);
|
|
3098
3096
|
t ||= 0;
|
|
3099
|
-
var r = [0, n.length], i = r[1] % 16, a = r[1] - i, o = [0, t], s = [0, t], c = [0, 0], l = [0, 0], u;
|
|
3100
|
-
for (u = 0; u < a; u += 16) c[0] = n[u + 4] | n[u + 5] << 8 | n[u + 6] << 16 | n[u + 7] << 24, c[1] = n[u] | n[u + 1] << 8 | n[u + 2] << 16 | n[u + 3] << 24, l[0] = n[u + 12] | n[u + 13] << 8 | n[u + 14] << 16 | n[u + 15] << 24, l[1] = n[u + 8] | n[u + 9] << 8 | n[u + 10] << 16 | n[u + 11] << 24, K(c, zt), Ft(c, 31), K(c, Bt), J(o, c), Ft(o, 27), Pt(o, s), K(o, Vt), Pt(o, Ht), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l), Ft(s, 31), Pt(s, o), K(s, Vt), Pt(s, Ut);
|
|
3097
|
+
for (var r = [0, n.length], i = r[1] % 16, a = r[1] - i, o = [0, t], s = [0, t], c = [0, 0], l = [0, 0], u = 0; u < a; u += 16) c[0] = n[u + 4] | n[u + 5] << 8 | n[u + 6] << 16 | n[u + 7] << 24, c[1] = n[u] | n[u + 1] << 8 | n[u + 2] << 16 | n[u + 3] << 24, l[0] = n[u + 12] | n[u + 13] << 8 | n[u + 14] << 16 | n[u + 15] << 24, l[1] = n[u + 8] | n[u + 9] << 8 | n[u + 10] << 16 | n[u + 11] << 24, K(c, zt), Ft(c, 31), K(c, Bt), J(o, c), Ft(o, 27), Pt(o, s), K(o, Vt), Pt(o, Ht), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l), Ft(s, 31), Pt(s, o), K(s, Vt), Pt(s, Ut);
|
|
3101
3098
|
c[0] = 0, c[1] = 0, l[0] = 0, l[1] = 0;
|
|
3102
3099
|
var d = [0, 0];
|
|
3103
3100
|
switch (i) {
|
|
@@ -3370,35 +3367,33 @@ function hn() {
|
|
|
3370
3367
|
return Y() && on() && en() || Qt() && dn() && rn();
|
|
3371
3368
|
}
|
|
3372
3369
|
function gn(e) {
|
|
3373
|
-
var t =
|
|
3374
|
-
return [new Promise(function(
|
|
3375
|
-
var
|
|
3370
|
+
var t = function() {};
|
|
3371
|
+
return [new Promise(function(n, r) {
|
|
3372
|
+
var i = !1, a = 0, o = 0;
|
|
3376
3373
|
e.oncomplete = function(e) {
|
|
3377
|
-
return
|
|
3374
|
+
return n(e.renderedBuffer);
|
|
3378
3375
|
};
|
|
3379
|
-
var
|
|
3376
|
+
var s = function() {
|
|
3380
3377
|
setTimeout(function() {
|
|
3381
|
-
return
|
|
3382
|
-
}, Math.min(
|
|
3383
|
-
},
|
|
3378
|
+
return r(vn("timeout"));
|
|
3379
|
+
}, Math.min(500, o + 5e3 - Date.now()));
|
|
3380
|
+
}, c = function() {
|
|
3384
3381
|
try {
|
|
3385
|
-
var
|
|
3386
|
-
switch (wt(
|
|
3382
|
+
var t = e.startRendering();
|
|
3383
|
+
switch (wt(t) && Dt(t), e.state) {
|
|
3387
3384
|
case "running":
|
|
3388
|
-
|
|
3389
|
-
break;
|
|
3390
|
-
case "suspended":
|
|
3391
|
-
document.hidden || l++, c && l >= t ? s(vn("suspended")) : setTimeout(f, n);
|
|
3385
|
+
o = Date.now(), i && s();
|
|
3392
3386
|
break;
|
|
3387
|
+
case "suspended": document.hidden || a++, i && a >= 3 ? r(vn("suspended")) : setTimeout(c, 500);
|
|
3393
3388
|
}
|
|
3394
3389
|
} catch (e) {
|
|
3395
|
-
|
|
3390
|
+
r(e);
|
|
3396
3391
|
}
|
|
3397
3392
|
};
|
|
3398
|
-
|
|
3399
|
-
|
|
3393
|
+
c(), t = function() {
|
|
3394
|
+
i || (i = !0, o > 0 && s());
|
|
3400
3395
|
};
|
|
3401
|
-
}),
|
|
3396
|
+
}), t];
|
|
3402
3397
|
}
|
|
3403
3398
|
function _n(e) {
|
|
3404
3399
|
for (var t = 0, n = 0; n < e.length; ++n) t += Math.abs(e[n]);
|
|
@@ -3569,7 +3564,7 @@ function Pn(e, t) {
|
|
|
3569
3564
|
}
|
|
3570
3565
|
function Fn(e, t) {
|
|
3571
3566
|
e.width = 240, e.height = 60, t.textBaseline = "alphabetic", t.fillStyle = "#f60", t.fillRect(100, 1, 62, 20), t.fillStyle = "#069", t.font = "11pt \"Times New Roman\"";
|
|
3572
|
-
var n =
|
|
3567
|
+
var n = "Cwm fjordbank gly 😃";
|
|
3573
3568
|
t.fillText(n, 2, 15), t.fillStyle = "rgba(102, 204, 0, 0.2)", t.font = "18pt Arial", t.fillText(n, 4, 45);
|
|
3574
3569
|
}
|
|
3575
3570
|
function In(e, t) {
|
|
@@ -4214,11 +4209,11 @@ function Pr() {
|
|
|
4214
4209
|
asin: n(.12312423423423424),
|
|
4215
4210
|
asinh: r(1),
|
|
4216
4211
|
asinhPf: function(e) {
|
|
4217
|
-
return X.log(e + X.sqrt(
|
|
4212
|
+
return X.log(e + X.sqrt(2));
|
|
4218
4213
|
}(1),
|
|
4219
4214
|
atanh: i(.5),
|
|
4220
4215
|
atanhPf: function(e) {
|
|
4221
|
-
return X.log(
|
|
4216
|
+
return X.log(3) / 2;
|
|
4222
4217
|
}(.5),
|
|
4223
4218
|
atan: a(.5),
|
|
4224
4219
|
sin: o(-1e300),
|
|
@@ -4234,7 +4229,7 @@ function Pr() {
|
|
|
4234
4229
|
tan: u(-1e300),
|
|
4235
4230
|
tanh: d(1),
|
|
4236
4231
|
tanhPf: function(e) {
|
|
4237
|
-
return (X.exp(2
|
|
4232
|
+
return (X.exp(2) - 1) / (X.exp(2) + 1);
|
|
4238
4233
|
}(1),
|
|
4239
4234
|
exp: f(1),
|
|
4240
4235
|
expm1: p(1),
|
|
@@ -4243,7 +4238,7 @@ function Pr() {
|
|
|
4243
4238
|
}(1),
|
|
4244
4239
|
log1p: m(10),
|
|
4245
4240
|
log1pPf: function(e) {
|
|
4246
|
-
return X.log(
|
|
4241
|
+
return X.log(11);
|
|
4247
4242
|
}(10),
|
|
4248
4243
|
powPI: function(e) {
|
|
4249
4244
|
return X.pow(X.PI, e);
|
|
@@ -4282,7 +4277,7 @@ function Rr(e, t) {
|
|
|
4282
4277
|
var i = r.document, a = i.body, o = a.style;
|
|
4283
4278
|
o.width = `${t}px`, o.webkitTextSizeAdjust = o.textSizeAdjust = "none", Qt() ? a.style.zoom = `${1 / r.devicePixelRatio}` : Y() && (a.style.zoom = "reset");
|
|
4284
4279
|
var s = i.createElement("div");
|
|
4285
|
-
return s.textContent = yt([], Array(t / 20
|
|
4280
|
+
return s.textContent = yt([], Array(t / 20 | 0), !0).map(function() {
|
|
4286
4281
|
return "word";
|
|
4287
4282
|
}).join(" "), a.appendChild(s), e(i, a);
|
|
4288
4283
|
}, "<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
|
|
@@ -4291,7 +4286,7 @@ function zr() {
|
|
|
4291
4286
|
return navigator.pdfViewerEnabled;
|
|
4292
4287
|
}
|
|
4293
4288
|
function Br() {
|
|
4294
|
-
var e = new Float32Array(1), t = new Uint8Array(e.buffer);
|
|
4289
|
+
var e = /* @__PURE__ */ new Float32Array(1), t = new Uint8Array(e.buffer);
|
|
4295
4290
|
return e[0] = Infinity, e[0] -= e[0], t[3];
|
|
4296
4291
|
}
|
|
4297
4292
|
function Vr() {
|
|
@@ -4313,7 +4308,7 @@ function Wr() {
|
|
|
4313
4308
|
var e = document.createElement("a"), t = e.attributionSourceId ?? e.attributionsourceid;
|
|
4314
4309
|
return t === void 0 ? void 0 : String(t);
|
|
4315
4310
|
}
|
|
4316
|
-
var Gr = -1, Kr = -2, qr = new Set([
|
|
4311
|
+
var Gr = -1, Kr = -2, qr = /* @__PURE__ */ new Set([
|
|
4317
4312
|
10752,
|
|
4318
4313
|
2849,
|
|
4319
4314
|
2884,
|
|
@@ -4395,7 +4390,7 @@ var Gr = -1, Kr = -2, qr = new Set([
|
|
|
4395
4390
|
7936,
|
|
4396
4391
|
7937,
|
|
4397
4392
|
7938
|
|
4398
|
-
]), Jr = new Set([
|
|
4393
|
+
]), Jr = /* @__PURE__ */ new Set([
|
|
4399
4394
|
34047,
|
|
4400
4395
|
35723,
|
|
4401
4396
|
36063,
|
|
@@ -4445,11 +4440,8 @@ function ei(e) {
|
|
|
4445
4440
|
var b = y[v];
|
|
4446
4441
|
if (!(b === Zr && ai() || b === Qr && oi())) {
|
|
4447
4442
|
var x = n.getExtension(b);
|
|
4448
|
-
if (!x)
|
|
4449
|
-
|
|
4450
|
-
continue;
|
|
4451
|
-
}
|
|
4452
|
-
for (var S = 0, C = ri(x); S < C.length; S++) {
|
|
4443
|
+
if (!x) a.push(b);
|
|
4444
|
+
else for (var S = 0, C = ri(x); S < C.length; S++) {
|
|
4453
4445
|
var g = C[S], _ = x[g];
|
|
4454
4446
|
c.push(`${g}=${_}${Jr.has(_) ? `=${n.getParameter(_)}` : ""}`);
|
|
4455
4447
|
}
|
|
@@ -4652,8 +4644,7 @@ var wi = {
|
|
|
4652
4644
|
hashComponents: vi,
|
|
4653
4645
|
componentsToDebugString: _i
|
|
4654
4646
|
};
|
|
4655
|
-
|
|
4656
|
-
//#region ../../packages/widget-sdk/src/api/request-options.ts
|
|
4647
|
+
// ../../packages/widget-sdk/src/api/request-options.ts
|
|
4657
4648
|
function Ti(e) {
|
|
4658
4649
|
return e.preview ? "include" : "same-origin";
|
|
4659
4650
|
}
|
|
@@ -4663,8 +4654,7 @@ function Ei(e) {
|
|
|
4663
4654
|
function Di(e, t) {
|
|
4664
4655
|
return t.configChannel === "draft" ? `${e}${e.includes("?") ? "&" : "?"}configChannel=draft` : e;
|
|
4665
4656
|
}
|
|
4666
|
-
|
|
4667
|
-
//#region ../../packages/widget-sdk/src/api/client.ts
|
|
4657
|
+
// ../../packages/widget-sdk/src/api/client.ts
|
|
4668
4658
|
var Oi = class {
|
|
4669
4659
|
baseUrl;
|
|
4670
4660
|
options;
|
|
@@ -4867,8 +4857,7 @@ var Oi = class {
|
|
|
4867
4857
|
if (!s.success) throw Error(s.error ?? "Failed to end session");
|
|
4868
4858
|
}
|
|
4869
4859
|
};
|
|
4870
|
-
|
|
4871
|
-
//#region ../../packages/widget-sdk/src/api/sse-reader.ts
|
|
4860
|
+
// ../../packages/widget-sdk/src/api/sse-reader.ts
|
|
4872
4861
|
async function* ki(e, t) {
|
|
4873
4862
|
if (!e.body) return;
|
|
4874
4863
|
let n = e.body.getReader(), r = new TextDecoder(), i = "", a = () => {
|
|
@@ -4894,8 +4883,7 @@ async function* ki(e, t) {
|
|
|
4894
4883
|
}
|
|
4895
4884
|
}
|
|
4896
4885
|
}
|
|
4897
|
-
|
|
4898
|
-
//#region ../../packages/widget-sdk/src/api/stream.ts
|
|
4886
|
+
// ../../packages/widget-sdk/src/api/stream.ts
|
|
4899
4887
|
var Ai = 12e4;
|
|
4900
4888
|
async function ji(e, t, n, r = {}) {
|
|
4901
4889
|
let i = "", a = !1;
|
|
@@ -5015,8 +5003,7 @@ function Mi(e) {
|
|
|
5015
5003
|
}
|
|
5016
5004
|
return e.response || (e.text ?? e.content ?? "");
|
|
5017
5005
|
}
|
|
5018
|
-
|
|
5019
|
-
//#region ../../packages/widget-sdk/src/api/reconnect.ts
|
|
5006
|
+
// ../../packages/widget-sdk/src/api/reconnect.ts
|
|
5020
5007
|
function Ni(e, t, n) {
|
|
5021
5008
|
let r = t * 2 ** (e - 1), i = Math.min(r, n), a = i * .3;
|
|
5022
5009
|
return Math.floor(i - a + a * 2 * Math.random());
|
|
@@ -5044,14 +5031,13 @@ async function Fi(e, t, n, r = {}) {
|
|
|
5044
5031
|
}
|
|
5045
5032
|
throw a ?? /* @__PURE__ */ Error(`Failed to fetch run ${n}`);
|
|
5046
5033
|
}
|
|
5047
|
-
|
|
5048
|
-
//#region ../../packages/widget-sdk/src/api/turnstile.ts
|
|
5034
|
+
// ../../packages/widget-sdk/src/api/turnstile.ts
|
|
5049
5035
|
var Ii = 15e3, Q, Li, Ri, zi, Bi = [];
|
|
5050
5036
|
function Vi() {
|
|
5051
5037
|
zi || (zi = (e) => {
|
|
5052
5038
|
if (!Q || e.source !== Q.contentWindow || Ri && e.origin !== Ri) return;
|
|
5053
5039
|
let t = e.data;
|
|
5054
|
-
|
|
5040
|
+
t && typeof t.type == "string" && (t.type === "turnstile-token" && typeof t.token == "string" ? Bi.shift()?.resolve(t.token) : t.type === "turnstile-error" && Bi.shift()?.reject(Error(t.message ?? "Turnstile verification failed")));
|
|
5055
5041
|
}, window.addEventListener("message", zi));
|
|
5056
5042
|
}
|
|
5057
5043
|
function Hi() {
|
|
@@ -5092,8 +5078,7 @@ async function Wi(e) {
|
|
|
5092
5078
|
Bi.push(i), t.postMessage({ type: "turnstile-solve" }, n);
|
|
5093
5079
|
});
|
|
5094
5080
|
}
|
|
5095
|
-
|
|
5096
|
-
//#region ../../packages/widget-sdk/src/events/emitter.ts
|
|
5081
|
+
// ../../packages/widget-sdk/src/events/emitter.ts
|
|
5097
5082
|
var Gi = class {
|
|
5098
5083
|
listeners = /* @__PURE__ */ new Map();
|
|
5099
5084
|
on(e, t) {
|
|
@@ -5130,8 +5115,7 @@ function Xi(e) {
|
|
|
5130
5115
|
sessionStorage.removeItem(qi(e));
|
|
5131
5116
|
} catch {}
|
|
5132
5117
|
}
|
|
5133
|
-
|
|
5134
|
-
//#region ../../packages/widget-sdk/src/progress-trail.ts
|
|
5118
|
+
// ../../packages/widget-sdk/src/progress-trail.ts
|
|
5135
5119
|
function Zi(e, t, n) {
|
|
5136
5120
|
return e.map((e) => {
|
|
5137
5121
|
if (e.status !== "active" || e.stage === "calling_tool") return e;
|
|
@@ -5158,8 +5142,7 @@ function $i(e) {
|
|
|
5158
5142
|
let t = Math.floor(e / 6e4), n = Math.round(e % 6e4 / 1e3);
|
|
5159
5143
|
return n > 0 ? `${t}m ${n}s` : `${t}m`;
|
|
5160
5144
|
}
|
|
5161
|
-
|
|
5162
|
-
//#region ../../packages/widget-sdk/src/voice-transcript.ts
|
|
5145
|
+
// ../../packages/widget-sdk/src/voice-transcript.ts
|
|
5163
5146
|
var ea = "[Voice note] ";
|
|
5164
5147
|
function ta(e, t) {
|
|
5165
5148
|
let n = t?.trim();
|
|
@@ -5176,8 +5159,7 @@ function na(e) {
|
|
|
5176
5159
|
rest: t.slice(n + 2)
|
|
5177
5160
|
};
|
|
5178
5161
|
}
|
|
5179
|
-
|
|
5180
|
-
//#region ../../packages/widget-sdk/src/create-client.ts
|
|
5162
|
+
// ../../packages/widget-sdk/src/create-client.ts
|
|
5181
5163
|
function ra() {
|
|
5182
5164
|
return `msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
|
|
5183
5165
|
}
|
|
@@ -5243,7 +5225,7 @@ var ia = 2e3, aa = class {
|
|
|
5243
5225
|
e ? (this.ensureSessionToken(), this.openWithGreeting()) : this.setState({ isOpen: !1 });
|
|
5244
5226
|
}
|
|
5245
5227
|
openWithGreeting() {
|
|
5246
|
-
this.state.initStatus
|
|
5228
|
+
this.state.initStatus !== "error" && this.state.initStatus !== "disabled" && this.setState({ isOpen: !0 });
|
|
5247
5229
|
}
|
|
5248
5230
|
async hydrate() {
|
|
5249
5231
|
let e = await this.apiClient.validateWidget(this.config.agentId, this.config.tenantId);
|
|
@@ -5667,13 +5649,9 @@ var ia = 2e3, aa = class {
|
|
|
5667
5649
|
let t = this.state.messages.find((e) => e.id === i);
|
|
5668
5650
|
t && this.emitter.emit("message:received", t);
|
|
5669
5651
|
}, a = this.state.messages.find((e) => e.id === i)?.runId, s = this.state.sessionId;
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
}).catch(() => t(e.message || "Something went wrong. Please try again."));
|
|
5674
|
-
return;
|
|
5675
|
-
}
|
|
5676
|
-
t(e.message || "Something went wrong. Please try again.");
|
|
5652
|
+
a && s ? Fi(this.config.apiBaseUrl, s, a, { preview: this.config.preview }).then((r) => {
|
|
5653
|
+
r.status === "done" && r.finalText ? n(r.finalText) : t(r.errorMessage || e.message || "Something went wrong. Please try again.");
|
|
5654
|
+
}).catch(() => t(e.message || "Something went wrong. Please try again.")) : t(e.message || "Something went wrong. Please try again.");
|
|
5677
5655
|
}
|
|
5678
5656
|
}, {
|
|
5679
5657
|
preview: this.config.preview,
|
|
@@ -5697,8 +5675,7 @@ function sa(e) {
|
|
|
5697
5675
|
}, r.onerror = () => n(/* @__PURE__ */ Error("Failed to read file")), r.readAsDataURL(e);
|
|
5698
5676
|
});
|
|
5699
5677
|
}
|
|
5700
|
-
|
|
5701
|
-
//#region ../../packages/widget-sdk/src/dom/shadow-root.ts
|
|
5678
|
+
// ../../packages/widget-sdk/src/dom/shadow-root.ts
|
|
5702
5679
|
function ca(e) {
|
|
5703
5680
|
let t = document.createElement("div");
|
|
5704
5681
|
t.setAttribute("data-agentkit-widget", ""), e.appendChild(t);
|
|
@@ -5718,31 +5695,18 @@ function la(e, t) {
|
|
|
5718
5695
|
function ua(e) {
|
|
5719
5696
|
e.remove();
|
|
5720
5697
|
}
|
|
5721
|
-
|
|
5722
|
-
//#region ../../packages/widget-sdk/src/dom/mount.ts
|
|
5698
|
+
// ../../packages/widget-sdk/src/dom/mount.ts
|
|
5723
5699
|
function da(e) {
|
|
5724
5700
|
document.body ? document.body.appendChild(e) : document.addEventListener("DOMContentLoaded", () => document.body.appendChild(e), { once: !0 });
|
|
5725
5701
|
}
|
|
5726
5702
|
function fa() {
|
|
5727
5703
|
let e = document.createElement("div");
|
|
5728
|
-
return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText =
|
|
5729
|
-
"position: fixed",
|
|
5730
|
-
"bottom: 24px",
|
|
5731
|
-
"right: 24px",
|
|
5732
|
-
"z-index: 2147483647",
|
|
5733
|
-
"pointer-events: none"
|
|
5734
|
-
].join("; "), da(e), e;
|
|
5704
|
+
return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText = "position: fixed; bottom: 24px; right: 24px; z-index: 2147483647; pointer-events: none", da(e), e;
|
|
5735
5705
|
}
|
|
5736
5706
|
function pa(e) {
|
|
5737
5707
|
getComputedStyle(e).position === "static" && (e.style.position = "relative");
|
|
5738
5708
|
let t = document.createElement("div");
|
|
5739
|
-
return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText =
|
|
5740
|
-
"position: absolute",
|
|
5741
|
-
"bottom: 24px",
|
|
5742
|
-
"right: 24px",
|
|
5743
|
-
"z-index: 2147483647",
|
|
5744
|
-
"pointer-events: none"
|
|
5745
|
-
].join("; "), e.appendChild(t), t;
|
|
5709
|
+
return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText = "position: absolute; bottom: 24px; right: 24px; z-index: 2147483647; pointer-events: none", e.appendChild(t), t;
|
|
5746
5710
|
}
|
|
5747
5711
|
function ma(e) {
|
|
5748
5712
|
return e.setAttribute("data-agentkit-root", "inline"), getComputedStyle(e).position === "static" && (e.style.position = "relative"), e;
|
|
@@ -5753,8 +5717,7 @@ function ha(e) {
|
|
|
5753
5717
|
function ga(e) {
|
|
5754
5718
|
e.removeAttribute("data-agentkit-root");
|
|
5755
5719
|
}
|
|
5756
|
-
|
|
5757
|
-
//#region ../../packages/widget-sdk/src/create-widget.ts
|
|
5720
|
+
// ../../packages/widget-sdk/src/create-widget.ts
|
|
5758
5721
|
function _a(e, t, n, r, i) {
|
|
5759
5722
|
let a = e.mode === "inline", o = !1, s = a && i ? ma(i) : !a && i ? pa(i) : fa(), c = ca(s);
|
|
5760
5723
|
la(c.styleSlot, r);
|
|
@@ -5804,8 +5767,7 @@ function _a(e, t, n, r, i) {
|
|
|
5804
5767
|
};
|
|
5805
5768
|
return d;
|
|
5806
5769
|
}
|
|
5807
|
-
|
|
5808
|
-
//#region ../../packages/widget-sdk/src/init.ts
|
|
5770
|
+
// ../../packages/widget-sdk/src/init.ts
|
|
5809
5771
|
var va = /* @__PURE__ */ new Map(), ya = 0;
|
|
5810
5772
|
function ba(e) {
|
|
5811
5773
|
let t = `agentkit-widget-${++ya}`, n = e.destroy.bind(e);
|
|
@@ -5840,8 +5802,7 @@ function wa(e) {
|
|
|
5840
5802
|
function Ta() {
|
|
5841
5803
|
return Array.from(va.keys());
|
|
5842
5804
|
}
|
|
5843
|
-
|
|
5844
|
-
//#region ../../packages/widget-ui/src/theme/tokens.ts
|
|
5805
|
+
// ../../packages/widget-ui/src/theme/tokens.ts
|
|
5845
5806
|
function Ea(e) {
|
|
5846
5807
|
let { theme: t } = e, n = [
|
|
5847
5808
|
`--ak-accent: ${t.accentColor}`,
|
|
@@ -5853,11 +5814,9 @@ function Ea(e) {
|
|
|
5853
5814
|
function Da(e) {
|
|
5854
5815
|
return e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
|
|
5855
5816
|
}
|
|
5856
|
-
|
|
5857
|
-
//#region ../../packages/widget-ui/src/theme/styles.ts
|
|
5858
|
-
var Oa = "\n*, *::before, *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n --ak-accent: #6366f1;\n --ak-accent-hover: #4f46e5;\n --ak-bg: #ffffff;\n --ak-surface: #f9fafb;\n --ak-text: #111827;\n --ak-text-muted: #6b7280;\n --ak-border: #e5e7eb;\n --ak-user-bg: var(--ak-accent);\n --ak-user-text: #ffffff;\n --ak-bot-bg: #f3f4f6;\n --ak-bot-text: #111827;\n --ak-maintenance-fg: #92400e;\n --ak-maintenance-bg: #fffbeb;\n --ak-maintenance-halo: #fcd34d;\n --ak-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n --ak-radius: 12px;\n /* Chat surface texture — scattered line doodles, tiled. Neutral stroke (not accent-tinted)\n so it stays a texture rather than competing with brand colour. Alpha is baked into the\n SVG stroke, so the light/dark variants differ only in stroke rgba. */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(0,0,0,0.045)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-pattern-size: 210px;\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);\n --ak-launcher-size: 56px;\n /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.\n Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */\n --ak-launcher-gap: -12px;\n font-family: var(--ak-font);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Dark mode — set data-theme=\"dark\" on the shadow host element.\n Slate palette, aligned with the KlicForge dashboard dark tokens. */\n:host([data-theme=\"dark\"]) {\n --ak-bg: #0f172a; /* slate-900 — panel surface */\n --ak-surface: #1e293b; /* slate-800 — inputs, insets (lift off panel) */\n --ak-text: #f1f5f9; /* slate-100 */\n --ak-text-muted: #94a3b8;/* slate-400 */\n --ak-border: #334155; /* slate-700 */\n --ak-bot-bg: #1e293b; /* slate-800 — assistant bubble */\n --ak-bot-text: #f1f5f9; /* slate-100 */\n /* Same doodle tile, white stroke — dark surfaces need ~1.5x the alpha to read the same */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);\n --ak-maintenance-fg: #fde68a;\n --ak-maintenance-bg: rgba(253, 230, 138, 0.06);\n --ak-maintenance-halo: #f59e0b;\n}\n\n/* ── Floating layout ─────────────────────────────────────────── */\n.ak-floating {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0;\n pointer-events: none;\n}\n.ak-floating > * {\n pointer-events: all;\n}\n\n/* ── Inline layout ───────────────────────────────────────────── */\n.ak-inline {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n}\n\n/* ── Launcher button ─────────────────────────────────────────── */\n.ak-launcher {\n width: var(--ak-launcher-size);\n height: var(--ak-launcher-size);\n border-radius: 50%;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);\n transition: background 0.2s, transform 0.15s, box-shadow 0.2s;\n flex-shrink: 0;\n}\n.ak-launcher:hover {\n background: var(--ak-accent-hover);\n transform: scale(1.08);\n box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);\n}\n.ak-launcher:active {\n transform: scale(0.95);\n}\n.ak-launcher svg {\n pointer-events: none;\n}\n/* Launcher showing avatar image instead of chat icon */\n.ak-launcher--avatar {\n padding: 0;\n overflow: hidden;\n}\n.ak-launcher__avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n pointer-events: none;\n}\n\n/* ── Shell wrapper (positions the hanging branding tab) ─────── */\n.ak-shell-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: var(--ak-launcher-gap);\n}\n\n/* ── Widget shell / panel ────────────────────────────────────── */\n.ak-shell {\n background: var(--ak-bg);\n border-radius: var(--ak-radius);\n box-shadow: var(--ak-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n}\n.ak-shell--floating {\n width: 380px;\n height: 580px;\n}\n.ak-shell--inline {\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n display: flex;\n flex-direction: column;\n}\n/* Inline shell-wrap fills its container and suppresses the duplicate widget header\n (the sidebar already renders its own header and close button). */\n.ak-inline .ak-shell-wrap {\n width: 100%;\n height: 100%;\n /* No launcher in inline mode — the negative offset would overflow the host. */\n margin-bottom: 0;\n}\n.ak-inline .ak-header {\n display: none;\n}\n.ak-shell-enter {\n animation: ak-panel-in 0.2s ease-out;\n}\n@keyframes ak-panel-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n/* ── Header ──────────────────────────────────────────────────── */\n.ak-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--ak-accent);\n color: #fff;\n flex-shrink: 0;\n gap: 8px;\n}\n.ak-header--confirming {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 0;\n}\n.ak-header__row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n}\n.ak-header__status {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #4ade80;\n flex-shrink: 0;\n}\n.ak-header__title-group {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n}\n.ak-header__title {\n font-size: 15px;\n font-weight: 600;\n letter-spacing: -0.01em;\n}\n.ak-header__subtitle {\n font-size: 11px;\n font-weight: 400;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ak-header__close {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__close:hover {\n background: rgba(255, 255, 255, 0.35);\n}\n.ak-header__avatar {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__bot-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n flex-shrink: 0;\n}\n.ak-header__button {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__button:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__button--active {\n background: rgba(255, 255, 255, 0.3);\n}\n.ak-header__confirm {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n animation: ak-confirm-in 0.18s ease-out;\n}\n@keyframes ak-confirm-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-header__confirm-text {\n display: flex;\n flex-direction: column;\n gap: 1px;\n flex: 1;\n min-width: 0;\n}\n.ak-header__confirm-title {\n font-size: 13px;\n font-weight: 600;\n color: #fff;\n line-height: 1.3;\n}\n.ak-header__confirm-sub {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.75);\n line-height: 1.3;\n}\n.ak-header__confirm-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-shrink: 0;\n}\n.ak-header__confirm-cancel {\n padding: 5px 10px;\n border-radius: 6px;\n border: 1px solid rgba(255, 255, 255, 0.4);\n background: transparent;\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__confirm-cancel:active {\n background: rgba(255, 255, 255, 0.25);\n}\n.ak-header__confirm-ok {\n padding: 5px 10px;\n border-radius: 6px;\n border: none;\n background: rgba(255, 255, 255, 0.2);\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-ok:hover {\n background: rgba(239, 68, 68, 0.7);\n}\n.ak-header__confirm-ok:active {\n background: rgba(239, 68, 68, 0.85);\n}\n\n/* ── Message list ────────────────────────────────────────────── */\n.ak-messages {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n scroll-behavior: smooth;\n min-height: 0; /* Allow flex child to shrink below its content height */\n /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.\n background-attachment defaults to scroll = anchored to the padding box, so the\n pattern stays put while messages scroll. */\n background-image: var(--ak-pattern);\n background-size: var(--ak-pattern-size) var(--ak-pattern-size);\n}\n.ak-messages::-webkit-scrollbar { width: 4px; }\n.ak-messages::-webkit-scrollbar-track { background: transparent; }\n.ak-messages::-webkit-scrollbar-thumb {\n background: var(--ak-border);\n border-radius: 4px;\n}\n\n/* ── Empty state ─────────────────────────────────────────────── */\n.ak-empty-state {\n flex: 1;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: safe center;\n padding: 16px;\n text-align: center;\n gap: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0;\n /* Glow layer is translucent so the same doodle texture as .ak-messages shows through —\n keeps empty state and message list on one continuous surface. */\n background-color: var(--ak-bg);\n background-image:\n radial-gradient(ellipse 110% 55% at 50% 0%,\n color-mix(in srgb, var(--ak-accent) 10%, transparent),\n transparent 72%\n ),\n var(--ak-pattern);\n background-size: auto, var(--ak-pattern-size) var(--ak-pattern-size);\n}\n/* Decorative blurred orb behind the avatar */\n.ak-empty-state__glow {\n position: absolute;\n top: -24px;\n left: 50%;\n transform: translateX(-50%);\n width: 180px;\n height: 180px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--ak-accent) 18%, transparent);\n filter: blur(48px);\n pointer-events: none;\n}\n.ak-empty-state__body {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n position: relative;\n width: 100%;\n}\n.ak-empty-state__avatar {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n background: var(--ak-bg);\n border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));\n box-shadow:\n 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),\n 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-accent);\n margin-bottom: 4px;\n flex-shrink: 0;\n}\n.ak-empty-state__avatar-img {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n object-fit: cover;\n}\n.ak-empty-state__bot-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ak-empty-state__title {\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-empty-state__description {\n margin: 0;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.55;\n width: 100%;\n}\n/* Suggested question chips — 2-column grid */\n.ak-empty-state__suggestions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n width: 100%;\n}\n.ak-empty-state__suggestion {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: color-mix(in srgb, var(--ak-accent) 5%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 16%, var(--ak-border));\n border-radius: 10px;\n padding: 10px 12px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n/* Odd last item spans both columns so the grid doesn't look lopsided */\n.ak-empty-state__suggestion:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n.ak-empty-state__suggestion:hover {\n background: color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg));\n border-color: color-mix(in srgb, var(--ak-accent) 30%, var(--ak-border));\n}\n.ak-empty-state__suggestion-title {\n font-size: 13px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.4;\n}\n.ak-empty-state__suggestion-desc {\n font-size: 12px;\n color: var(--ak-text-muted);\n line-height: 1.4;\n margin-top: 2px;\n}\n\n/* ── Message bubbles ─────────────────────────────────────────── */\n.ak-message {\n display: flex;\n flex-direction: column;\n max-width: 86%;\n animation: ak-msg-in 0.15s ease-out;\n}\n@keyframes ak-msg-in {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-message--user {\n align-self: flex-end;\n align-items: flex-end;\n}\n.ak-message--assistant {\n align-self: flex-start;\n align-items: flex-start;\n}\n.ak-message__bubble {\n padding: 8px 12px;\n border-radius: 16px;\n font-size: 14px;\n line-height: 1.55;\n word-break: break-word;\n white-space: pre-wrap;\n max-width: 100%;\n min-width: 0;\n}\n.ak-message__bubble--md {\n white-space: normal;\n}\n.ak-message--user .ak-message__bubble {\n background: var(--ak-user-bg);\n color: var(--ak-user-text);\n border-bottom-right-radius: 4px;\n}\n.ak-message--assistant .ak-message__bubble {\n background: var(--ak-bot-bg);\n color: var(--ak-bot-text);\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n}\n.ak-message--error .ak-message__bubble {\n background: #fee2e2;\n color: #991b1b;\n border-color: #fca5a5;\n}\n.ak-message--operator .ak-message__bubble--operator {\n background: color-mix(in srgb, var(--ak-accent) 8%, var(--ak-bot-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));\n}\n.ak-message__time {\n display: block;\n text-align: right;\n font-size: 11px;\n color: var(--ak-text-muted);\n margin-top: 2px;\n padding: 0 4px;\n}\n.ak-message--user .ak-message__time {\n color: rgba(255, 255, 255, 0.7);\n}\n.ak-message__sender-label {\n font-size: 11px;\n font-weight: 500;\n color: var(--ak-text-muted);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 0 2px;\n margin-bottom: 4px;\n}\n.ak-message--operator .ak-message__sender-label {\n color: var(--ak-accent);\n font-weight: 600;\n}\n.ak-message__operator-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: var(--ak-accent);\n color: #fff;\n font-size: 10px;\n font-weight: 700;\n line-height: 1;\n flex-shrink: 0;\n}\n.ak-message__operator-name {\n line-height: 1;\n}\n.ak-handoff-divider {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 8px 4px;\n color: var(--ak-text-muted);\n font-size: 11px;\n font-weight: 500;\n}\n.ak-handoff-divider::before,\n.ak-handoff-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--ak-border);\n}\n.ak-handoff-divider__label {\n white-space: nowrap;\n padding: 2px 8px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 14%, var(--ak-border));\n color: color-mix(in srgb, var(--ak-accent) 70%, var(--ak-text));\n}\n/* ── Message avatar (assistant only, when avatarUrl is set) ─── */\n.ak-message--with-avatar {\n flex-direction: row;\n align-items: flex-end;\n gap: 8px;\n}\n.ak-message__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--ak-surface);\n}\n.ak-message__body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 0;\n}\n\n/* ── Generated images ────────────────────────────────────────── */\n\n/* Bubble that contains an image — remove padding so image is flush at top */\n.ak-message__bubble--has-image {\n padding: 0;\n overflow: hidden;\n}\n\n.ak-message__images {\n display: flex;\n flex-direction: column;\n gap: 0;\n}\n\n.ak-message__image-wrap {\n position: relative;\n line-height: 0;\n}\n\n/* Clicking the image opens it in a new tab */\n.ak-message__image-link {\n display: block;\n line-height: 0;\n}\n\n.ak-message__image {\n width: 100%;\n display: block;\n transition: filter 0.2s;\n}\n\n.ak-message__image-link:hover .ak-message__image {\n filter: brightness(0.93);\n}\n\n/* ── Image gallery (count-aware layouts) ───────────────────────────────── */\n.ak-gallery {\n position: relative;\n width: 100%;\n background: #ffffff;\n overflow: hidden;\n}\n\n/* Single hero: natural aspect, contained inside a white frame so transparent\n * product PNGs read clearly. Caps at 320px tall to keep bubble compact. */\n.ak-gallery--single {\n line-height: 0;\n}\n.ak-gallery--single .ak-gallery__cell--hero {\n display: block;\n background: #ffffff;\n}\n.ak-gallery__img--contain {\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n background: #ffffff;\n display: block;\n}\n\n/* 2-up: side-by-side squares, gap-1 */\n.ak-gallery--two {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n/* 3-up: big left + 2 stacked right; container holds aspect */\n.ak-gallery--three {\n display: grid;\n grid-template-columns: 2fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n aspect-ratio: 4 / 3;\n}\n.ak-gallery--three > .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n}\n.ak-gallery--three .ak-gallery__col {\n display: grid;\n grid-template-rows: 1fr 1fr;\n gap: 2px;\n}\n\n/* 4-up (and 5+): 2x2 grid */\n.ak-gallery--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n.ak-gallery__cell {\n position: relative;\n display: block;\n overflow: hidden;\n background: #f8fafc;\n aspect-ratio: 1 / 1;\n line-height: 0;\n text-decoration: none;\n}\n\n/* Override aspect-ratio for the 3-up layout's column cells (they take parent height) */\n.ak-gallery--three .ak-gallery__col .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n width: 100%;\n}\n\n.ak-gallery__img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n transition: transform 0.2s ease-out, filter 0.2s;\n}\n\n.ak-gallery__cell:hover .ak-gallery__img {\n transform: scale(1.04);\n filter: brightness(0.97);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n.ak-gallery__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.6);\n color: #ffffff;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n pointer-events: none;\n}\n\n/* ── File chips (user-uploaded .pdf/.md/.txt/.csv) ─────────────────────── */\n.ak-message__files {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px 4px;\n}\n.ak-message__bubble--has-image .ak-message__files {\n padding: 8px 8px 4px;\n}\n\n.ak-file-chip {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border, #e2e8f0);\n border-radius: 12px;\n text-decoration: none;\n color: var(--ak-text, #0f172a);\n transition: border-color 0.15s, box-shadow 0.15s;\n max-width: 100%;\n}\n\n.ak-file-chip:hover {\n border-color: #cbd5e1;\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);\n}\n\n.ak-file-chip:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: 2px;\n}\n\n.ak-file-chip__icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n\n.ak-file-chip__icon--pdf { background: #fff1f2; color: #e11d48; }\n.ak-file-chip__icon--csv { background: #ecfdf5; color: #059669; }\n.ak-file-chip__icon--md { background: #f5f3ff; color: #7c3aed; }\n.ak-file-chip__icon--txt { background: #f1f5f9; color: #475569; }\n.ak-file-chip__icon--default { background: #eef2ff; color: #4f46e5; }\n\n.ak-file-chip__body {\n display: flex;\n flex-direction: column;\n min-width: 0;\n line-height: 1.2;\n}\n\n.ak-file-chip__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--ak-text, #0f172a);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n\n.ak-file-chip__label {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n color: #64748b;\n margin-top: 2px;\n}\n\n/* In user-side bubble (dark primary background), invert chip surface for legibility */\n.ak-message--user .ak-file-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n/* ── Voice note player (audio attachment) ──────────────────────────────── */\n.ak-audio-chip {\n display: inline-flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border, #e2e8f0);\n border-radius: 12px;\n max-width: 100%;\n}\n\n.ak-message--user .ak-audio-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n.ak-audio-chip__player {\n height: 36px;\n max-width: 260px;\n}\n\n.ak-audio-chip__transcript {\n margin: 0;\n font-size: 12px;\n font-style: italic;\n line-height: 1.4;\n color: var(--ak-text-muted);\n}\n\n/* ── Lightbox (image preview modal) ────────────────────────────────────── */\n.ak-lightbox {\n position: fixed;\n inset: 0;\n z-index: 2147483600; /* near max int — sits above any host-page content */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(15, 23, 42, 0.85);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n animation: ak-lightbox-in 0.12s ease-out;\n}\n\n@keyframes ak-lightbox-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.ak-lightbox__img {\n max-width: 92vw;\n max-height: 88vh;\n border-radius: 8px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);\n user-select: none;\n display: block;\n}\n\n.ak-lightbox__toolbar {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ak-lightbox__counter {\n display: inline-flex;\n align-items: center;\n height: 28px;\n padding: 0 12px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n font-size: 12px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n\n.ak-lightbox__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n text-decoration: none;\n padding: 0;\n}\n\n.ak-lightbox__btn:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__btn:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n.ak-lightbox__nav {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n padding: 0;\n}\n\n.ak-lightbox__nav:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__nav--prev { left: 16px; }\n.ak-lightbox__nav--next { right: 16px; }\n\n.ak-lightbox__nav:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n/* Gallery cells must be styled as plain buttons (we converted from <a>) */\n.ak-gallery__cell {\n border: none;\n padding: 0;\n margin: 0;\n cursor: zoom-in;\n font: inherit;\n color: inherit;\n background: #f8fafc;\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n/* Faint download icon — always present, top-right corner of the image */\n.ak-message__image-dl-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 26px;\n height: 26px;\n background: rgba(0, 0, 0, 0.28);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgba(255, 255, 255, 0.75);\n text-decoration: none;\n transition: background 0.15s, color 0.15s;\n}\n\n.ak-message__image-dl-icon:hover {\n background: rgba(0, 0, 0, 0.55);\n color: #ffffff;\n}\n\n/* Caption / text below the image, inside the same bubble */\n.ak-message__image-caption {\n padding: 8px 10px 8px;\n font-size: 14px;\n font-style: normal;\n color: var(--ak-text);\n line-height: 1.45;\n}\n\n/* User-uploaded image caption uses user bubble colors */\n.ak-message--user .ak-message__image-caption {\n color: rgba(255, 255, 255, 0.8);\n font-style: normal;\n}\n\n/* ── Typing indicator ────────────────────────────────────────── */\n.ak-typing {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 9px 12px;\n background: var(--ak-bot-bg);\n border-radius: 16px;\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n align-self: flex-start;\n width: fit-content;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing__dot {\n width: 7px;\n height: 7px;\n background: var(--ak-text-muted);\n border-radius: 50%;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing__dot:nth-child(3) { animation-delay: 0.4s; }\n@keyframes ak-bounce {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }\n 30% { transform: translateY(-5px); opacity: 1; }\n}\n\n/* ── Init status (validating / error) ───────────────────────── */\n.ak-init-status {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.ak-init-spinner {\n width: 28px;\n height: 28px;\n border: 3px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n animation: ak-spin 0.7s linear infinite;\n}\n@keyframes ak-spin {\n to { transform: rotate(360deg); }\n}\n.ak-init-status--error {\n justify-content: flex-start;\n}\n.ak-init-status--maintenance {\n padding: 28px 24px;\n}\n\n/* ── Composer ────────────────────────────────────────────────── */\n.ak-composer {\n position: relative; /* establishes positioning context for the attachment submenu */\n padding: 8px 12px 10px;\n border-top: 1px solid var(--ak-border);\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ak-bg);\n flex-shrink: 0;\n}\n\n/* Hidden native file input */\n.ak-composer__file-input {\n display: none;\n}\n\n/* Unified input container — wraps +, textarea, send as one row */\n.ak-composer__input-wrap {\n display: flex;\n align-items: center;\n gap: 6px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 14px;\n padding: 5px 5px 5px 6px;\n transition: border-color 0.15s;\n}\n.ak-composer__input-wrap:focus-within {\n border-color: var(--ak-accent);\n}\n\n/* Attach button wrapper */\n.ak-composer__attach-wrap {\n flex-shrink: 0;\n}\n\n/* \"+\" attachment button — square with rounded corners */\n.ak-composer__attach {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, border-color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__attach:hover:not(:disabled) {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n}\n.ak-composer__attach--open {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent);\n}\n.ak-composer__attach:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Attachment submenu — floats above the composer, positioned relative to .ak-composer */\n.ak-composer__attach-menu {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 12px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 10px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n padding: 4px;\n min-width: 130px;\n z-index: 10;\n}\n\n/* Individual item inside the attachment submenu */\n.ak-composer__attach-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: none;\n border-radius: 7px;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n cursor: pointer;\n transition: background 0.12s;\n text-align: left;\n}\n.ak-composer__attach-menu-item:hover:not(:disabled) {\n background: var(--ak-bg);\n}\n.ak-composer__attach-menu-item:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Textarea — borderless, transparent, sits inside the container */\n.ak-composer__input {\n flex: 1;\n padding: 4px 6px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 16px; /* iOS zooms the page when a focused input is under 16px */\n line-height: 1.45;\n resize: none;\n outline: none;\n min-height: 28px;\n max-height: 110px;\n overflow-y: auto;\n}\n.ak-composer__input::placeholder {\n color: var(--ak-text-muted);\n}\n\n/* Mic button — square with rounded corners, sibling of the \"+\" attach button */\n.ak-composer__mic {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, border-color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__mic:hover:not(:disabled) {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n}\n.ak-composer__mic:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Recording bar — replaces the input row while a voice note is being recorded */\n.ak-composer__recording {\n display: flex;\n align-items: center;\n gap: 10px;\n flex: 1;\n padding: 2px 2px 2px 6px;\n}\n.ak-composer__recording-timer {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n font-variant-numeric: tabular-nums;\n}\n.ak-composer__recording-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #ef4444;\n animation: ak-recording-pulse 1.4s ease-in-out infinite;\n}\n@keyframes ak-recording-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.35;\n }\n}\n.ak-composer__recording-cancel,\n.ak-composer__recording-stop {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n}\n.ak-composer__recording-cancel {\n background: transparent;\n color: var(--ak-text-muted);\n}\n.ak-composer__recording-cancel:hover {\n color: var(--ak-text);\n background: var(--ak-bg);\n}\n.ak-composer__recording-stop {\n background: var(--ak-accent);\n color: white;\n}\n.ak-composer__recording-stop:hover {\n background: var(--ak-accent-hover);\n}\n\n/* Send button — square with rounded corners */\n.ak-composer__send {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n transition: background 0.15s, opacity 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__send:hover:not(:disabled) {\n background: var(--ak-accent-hover);\n}\n.ak-composer__send:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n/* Old photo button — hidden but keep so file-input trigger still works */\n.ak-composer__photo {\n display: none;\n}\n\n/* Image preview strip above the input row */\n.ak-composer__preview {\n display: flex;\n gap: 6px;\n padding: 0 2px;\n}\n.ak-composer__preview-wrap {\n position: relative;\n width: 60px;\n height: 60px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n flex-shrink: 0;\n}\n.ak-composer__preview-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n.ak-composer__preview-remove {\n position: absolute;\n top: 3px;\n right: 3px;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n padding: 0;\n transition: background 0.15s;\n}\n.ak-composer__preview-remove:hover {\n background: rgba(0, 0, 0, 0.8);\n}\n\n/* ── Streaming cursor ────────────────────────────────────────── */\n.ak-cursor {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n margin-left: 4px;\n vertical-align: middle;\n}\n.ak-cursor__dot {\n display: inline-block;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.6;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }\n\n/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item\n and .ak-progress__summary so dots → activity line → summary never reflow. */\n.ak-typing-row {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* One text line at the shared row metrics, so the dots occupy exactly the\n box the activity line and summary will occupy (border-box). */\n min-height: calc(0.76rem * 1.4 + 4px);\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing-row__dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--ak-bot-text);\n opacity: 0.5;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }\n@media (prefers-reduced-motion: reduce) {\n .ak-typing-row__dot,\n .ak-cursor__dot,\n .ak-typing__dot,\n .ak-progress__item--active,\n .ak-agent-status__icon {\n animation: none;\n }\n}\n\n/* ── Markdown rendering ──────────────────────────────────────── */\n.ak-message__bubble--md {\n white-space: normal;\n min-width: 0;\n}\n.ak-message__bubble--md .ak-md-p {\n margin: 0 0 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-p:last-child {\n margin-bottom: 0;\n}\n/* Collapse margins between paragraph and following list */\n.ak-message__bubble--md .ak-md-p + .ak-md-ul,\n.ak-message__bubble--md .ak-md-p + .ak-md-ol {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1,\n.ak-message__bubble--md .ak-md-h2,\n.ak-message__bubble--md .ak-md-h3 {\n font-weight: 700;\n line-height: 1.3;\n margin: 0.6em 0 0.3em;\n}\n.ak-message__bubble--md .ak-md-h1:first-child,\n.ak-message__bubble--md .ak-md-h2:first-child,\n.ak-message__bubble--md .ak-md-h3:first-child {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1 { font-size: 1.12em; }\n.ak-message__bubble--md .ak-md-h2 { font-size: 1.04em; }\n.ak-message__bubble--md .ak-md-h3 { font-size: 0.97em; }\n.ak-message__bubble--md .ak-md-ul,\n.ak-message__bubble--md .ak-md-ol {\n padding-left: 1.4em;\n margin: 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-ul li,\n.ak-message__bubble--md .ak-md-ol li {\n margin-bottom: 0.15em;\n}\n.ak-message__bubble--md .ak-md-pre-wrap {\n position: relative;\n margin: 0.4em 0;\n border-radius: 6px;\n overflow-x: auto;\n overflow-y: hidden;\n background: rgba(0, 0, 0, 0.08);\n max-width: 100%;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-wrap {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre-lang {\n display: block;\n padding: 3px 10px;\n font-size: 10px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.55;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-lang {\n border-bottom-color: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre {\n margin: 0;\n padding: 8px 10px;\n font-size: 12px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n white-space: pre;\n box-sizing: border-box;\n}\n.ak-message__bubble--md .ak-md-code {\n display: block;\n font-family: inherit;\n font-size: inherit;\n}\n.ak-message__bubble--md .ak-md-ic {\n background: rgba(0, 0, 0, 0.08);\n border-radius: 3px;\n padding: 1px 5px;\n font-size: 0.87em;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-ic {\n background: rgba(255, 255, 255, 0.2);\n}\n.ak-message__bubble--md .ak-md-hr {\n border: none;\n border-top: 1px solid currentColor;\n opacity: 0.2;\n margin: 0.5em 0;\n}\n.ak-message__bubble--md a {\n color: var(--ak-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-message--user .ak-message__bubble--md a {\n color: rgba(255, 255, 255, 0.9);\n}\n.ak-message__bubble--md .ak-md-table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.4em 0;\n font-size: 0.95em;\n line-height: 1.5;\n}\n.ak-message__bubble--md .ak-md-th {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 2px solid var(--ak-accent) !important;\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent) !important;\n font-weight: 600;\n color: var(--ak-text) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-th {\n border-bottom-color: rgba(255, 255, 255, 0.5) !important;\n background: rgba(0, 0, 0, 0.25) !important;\n color: #ffffff !important;\n font-weight: 700;\n}\n.ak-message__bubble--md .ak-md-td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--ak-border) !important;\n color: var(--ak-text) !important;\n}\n.ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: color-mix(in srgb, var(--ak-surface), transparent 40%) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-td {\n color: #ffffff !important;\n border-bottom-color: rgba(255, 255, 255, 0.25) !important;\n}\n.ak-message--user .ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: rgba(0, 0, 0, 0.15) !important;\n}\n\n/* ── Composer disclaimer ─────────────────────────────────────── */\n.ak-composer__disclaimer {\n font-size: 11px;\n color: var(--ak-text-muted);\n text-align: center;\n line-height: 1.4;\n}\n.ak-composer__disclaimer a {\n color: var(--ak-text-muted);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-composer__disclaimer a:hover {\n color: var(--ak-accent);\n}\n\n/* ── Maintenance state ───────────────────────────────────────── */\n.ak-maintenance {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n max-width: 320px;\n padding: 8px 4px;\n animation: ak-maintenance-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;\n}\n.ak-maintenance__halo {\n position: absolute;\n top: -6px;\n left: 50%;\n width: 120px;\n height: 120px;\n transform: translateX(-50%);\n border-radius: 50%;\n background: radial-gradient(\n closest-side,\n var(--ak-maintenance-halo) 0%,\n transparent 72%\n );\n opacity: 0.22;\n filter: blur(4px);\n pointer-events: none;\n animation: ak-maintenance-pulse 2.8s ease-in-out infinite;\n}\n.ak-maintenance__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--ak-maintenance-bg);\n color: var(--ak-maintenance-fg);\n border: 1px solid color-mix(in srgb, var(--ak-maintenance-halo) 40%, transparent);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n.ak-maintenance__title {\n margin-top: 16px;\n font-size: 15px;\n font-weight: 600;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-maintenance__description {\n margin-top: 6px;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.5;\n max-width: 28ch;\n}\n\n@keyframes ak-maintenance-enter {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n@keyframes ak-maintenance-pulse {\n 0%, 100% { opacity: 0.18; transform: translateX(-50%) scale(1); }\n 50% { opacity: 0.32; transform: translateX(-50%) scale(1.06); }\n}\n@media (prefers-reduced-motion: reduce) {\n .ak-maintenance,\n .ak-maintenance__halo,\n .ak-maintenance__icon {\n animation: none;\n }\n}\n\n/* ── Error banner ────────────────────────────────────────────── */\n.ak-error {\n padding: 12px 16px;\n background: #fee2e2;\n color: #991b1b;\n font-size: 13px;\n border-top: 1px solid #fca5a5;\n text-align: left;\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n}\n\n.ak-error__icon {\n font-size: 16px;\n line-height: 1;\n flex-shrink: 0;\n margin-top: 1px;\n}\n\n.ak-error__content {\n flex: 1;\n}\n\n.ak-error__title {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 4px 0;\n line-height: 1.3;\n}\n\n.ak-error__description {\n font-size: 13px;\n margin: 0 0 4px 0;\n line-height: 1.4;\n opacity: 0.9;\n}\n\n.ak-error__message {\n font-size: 13px;\n margin: 0;\n line-height: 1.4;\n opacity: 0.85;\n}\n\n/* Specific styling for origin restriction errors */\n.ak-error--origin {\n background: #fef3c7; /* Amber background instead of red for less scary appearance */\n color: #92400e; /* Amber text color */\n border-top: 1px solid #fbbf24;\n}\n\n/* ── Agent status indicator ──────────────────────────────────── */\n/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants\n see the tool status swap in without the surrounding box changing size. */\n.ak-agent-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 4px;\n padding: 2px 0;\n color: var(--ak-bot-text);\n font-size: 0.76rem;\n line-height: 1.4;\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-agent-status__icon {\n flex-shrink: 0;\n color: var(--ak-primary, #6366f1);\n animation: ak-sparkle-pulse 2.5s ease-in-out infinite;\n}\n.ak-agent-status__text {\n line-height: 1.4;\n}\n@keyframes ak-sparkle-pulse {\n 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }\n 50% { opacity: 0.45; transform: scale(0.85) rotate(15deg); }\n}\n\n/* ── Progress block (tool execution / streaming chain) ───────── */\n.ak-progress {\n margin-bottom: 4px;\n max-width: 80%;\n}\n.ak-progress__block {\n display: inline-flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 12px;\n border-radius: 14px;\n background: var(--ak-bot-bg);\n border: 1px solid var(--ak-border);\n font-size: 0.8rem;\n color: var(--ak-bot-text);\n opacity: 0.85;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ak-progress__label {\n font-weight: 600;\n font-size: 0.78rem;\n color: var(--ak-primary, #6366f1);\n}\n.ak-progress__toggle {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n padding: 1px 7px;\n border: 1px solid var(--ak-border);\n border-radius: 8px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.72rem;\n cursor: pointer;\n opacity: 0.65;\n transition: opacity 0.15s;\n}\n.ak-progress__toggle:hover { opacity: 0.9; }\n.ak-progress__toggle--collapsed {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.78rem;\n cursor: pointer;\n opacity: 0.55;\n transition: opacity 0.15s;\n margin-bottom: 4px;\n}\n.ak-progress__toggle--collapsed:hover { opacity: 0.85; }\n.ak-progress__text {\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n line-height: 1.4;\n margin: 0;\n}\n/* Active streaming state */\n.ak-progress__list {\n list-style: none;\n margin: 0 0 4px;\n padding: 0;\n}\n/* Bare row, not a pill — identical metrics to .ak-progress__summary so the\n live line and the post-turn \"Worked for Ns\" swap without a size change. */\n.ak-progress__item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n line-height: 1.4;\n color: var(--ak-bot-text);\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__item--active {\n /* inherits base .ak-progress__item; subtle pulse to signal in-flight */\n animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;\n}\n@keyframes ak-active-pulse {\n 0%, 100% { opacity: 0.6; }\n 50% { opacity: 0.9; }\n}\n/* Claude-style step list (detailed mode) */\n.ak-progress__steps {\n list-style: none;\n margin: 0 0 4px;\n padding: 2px 0;\n}\n.ak-progress__step {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n line-height: 1.4;\n}\n.ak-progress__step--active {\n opacity: 0.9;\n}\n.ak-progress__step-text {\n min-width: 0;\n}\n.ak-progress__step-dur {\n opacity: 0.65;\n flex-shrink: 0;\n}\n.ak-progress__step-icon {\n flex-shrink: 0;\n opacity: 0.55;\n}\n.ak-progress__step-icon--fail {\n color: #ef4444;\n opacity: 0.9;\n}\n/* Post-turn summary row (\"Worked for Ns · N steps\") */\n.ak-progress__summary {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* Shrink-to-fit as a column flex item would otherwise break \"Worked for 8.4s\"\n onto two lines, doubling the row height as the turn ends. */\n white-space: nowrap;\n border: none;\n background: transparent;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.ak-progress__summary:hover { opacity: 0.85; }\n.ak-progress__summary--static {\n cursor: default;\n}\n.ak-progress__summary--static:hover { opacity: 0.6; }\n.ak-progress__spinner {\n display: inline-block;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--ak-border);\n border-top-color: var(--ak-primary, #6366f1);\n border-radius: 50%;\n flex-shrink: 0;\n animation: ak-spin 0.7s linear infinite;\n}\n\n/* ── Powered by hanging tab ──────────────────────────────────── */\n.ak-branding {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px 4px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n margin-left: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);\n}\n.ak-branding__logo {\n width: 11px;\n height: 11px;\n flex-shrink: 0;\n color: var(--ak-accent);\n opacity: 0.75;\n}\n.ak-branding__label {\n font-size: 9px;\n color: var(--ak-text-muted);\n opacity: 0.75;\n}\n.ak-branding__name {\n font-size: 9px;\n font-weight: 600;\n color: var(--ak-accent);\n opacity: 0.75;\n letter-spacing: -0.01em;\n}\n\n/* ── Mobile: full-viewport panel ─────────────────────────────── */\n@media (max-width: 639px) {\n @keyframes ak-panel-in-mobile {\n from { opacity: 0; transform: translateY(32px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.\n Give it its own fixed position so it fills the viewport independently,\n bypassing the outer container's bottom/right offsets. */\n :host([data-open]) {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n pointer-events: none;\n }\n\n :host([data-open]) .ak-floating {\n width: 100%;\n height: 100%;\n align-items: stretch;\n gap: 0;\n }\n\n :host([data-open]) .ak-shell-wrap {\n flex: 1;\n min-height: 0;\n width: 100%;\n align-items: stretch;\n /* Launcher is hidden here — the negative offset would leave a dead strip. */\n margin-bottom: 0;\n }\n\n :host([data-open]) .ak-shell--floating {\n width: 100%;\n flex: 1;\n height: auto;\n border-radius: 0;\n box-shadow: none;\n border-left: none;\n border-right: none;\n border-top: none;\n }\n\n :host([data-open]) .ak-launcher {\n display: none;\n }\n\n :host([data-open]) .ak-shell-enter {\n animation: ak-panel-in-mobile 0.22s ease-out;\n }\n\n :host([data-open]) .ak-branding {\n display: none;\n }\n}\n";
|
|
5859
|
-
//#endregion
|
|
5860
|
-
//#region ../../packages/widget-ui/src/components/Header.tsx
|
|
5817
|
+
// ../../packages/widget-ui/src/theme/styles.ts
|
|
5818
|
+
var Oa = "\n*, *::before, *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n /* Neutral and status defaults are copied from packages/design-tokens/tokens.css (light\n :root / dark .dark) — the widget is CDN-bundled, so they stay literals here.\n __tests__/design-token-parity.test.ts fails when the two drift. */\n --ak-accent: #4f46e5; /* --primary (white text 6.3:1) */\n --ak-accent-hover: #4338ca; /* --primary-hover */\n --ak-bg: #ffffff; /* --surface */\n --ak-surface: #f7f8fa; /* --bg */\n --ak-text: #0e1220; /* --fg */\n --ak-text-muted: #525c70; /* --fg-muted */\n --ak-border: #e3e6ec; /* --border */\n --ak-border-strong: #818a9d; /* --border-strong */\n --ak-hover: rgb(14 18 32 / 0.04); /* --hover */\n --ak-user-bg: var(--ak-accent);\n --ak-user-text: #ffffff;\n --ak-bot-bg: #eef0f4; /* --surface-muted */\n --ak-bot-text: #0e1220; /* --fg */\n --ak-success: #0a9466; /* --success */\n --ak-warning: #d98a0b; /* --warning */\n --ak-warning-fg: #8a4b06; /* --warning-fg */\n --ak-warning-soft: #fdf3e2; /* --warning-soft */\n --ak-danger: #c4302b; /* --danger */\n --ak-danger-fg: #b4232b; /* --danger-fg */\n --ak-danger-soft: #fdeced; /* --danger-soft */\n --ak-danger-border: color-mix(in srgb, var(--ak-danger) 35%, transparent);\n --ak-maintenance-fg: var(--ak-warning-fg);\n --ak-maintenance-bg: var(--ak-warning-soft);\n --ak-maintenance-halo: var(--ak-warning);\n --ak-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n --ak-radius: 12px;\n /* Chat surface texture — scattered line doodles, tiled. Neutral stroke (not accent-tinted)\n so it stays a texture rather than competing with brand colour. Alpha is baked into the\n SVG stroke, so the light/dark variants differ only in stroke rgba. */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(0,0,0,0.045)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-pattern-size: 210px;\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);\n --ak-launcher-size: 56px;\n /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.\n Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */\n --ak-launcher-gap: -12px;\n font-family: var(--ak-font);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Dark mode — set data-theme=\"dark\" on the shadow host element.\n Values from tokens.css .dark (see the :host note above). */\n:host([data-theme=\"dark\"]) {\n --ak-bg: #111521; /* --surface — panel */\n --ak-surface: #171c2a; /* --surface-raised — inputs, insets lift off the panel */\n --ak-text: #eef0f6; /* --fg */\n --ak-text-muted: #a3acbd; /* --fg-muted */\n --ak-border: #232a3a; /* --border */\n --ak-border-strong: #5f687c; /* --border-strong */\n --ak-hover: rgb(255 255 255 / 0.05); /* --hover */\n --ak-bot-bg: #20263a; /* --surface-muted — assistant bubble */\n --ak-bot-text: #eef0f6; /* --fg */\n --ak-success: #2fbf87;\n --ak-warning: #e5a43a;\n --ak-warning-fg: #f2bd5c;\n --ak-warning-soft: #2c2110;\n --ak-danger: #d93a3f;\n --ak-danger-fg: #ff8a8f;\n --ak-danger-soft: #331417;\n /* Same doodle tile, white stroke — dark surfaces need ~1.5x the alpha to read the same */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);\n}\n\n/* ── Floating layout ─────────────────────────────────────────── */\n.ak-floating {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0;\n pointer-events: none;\n}\n.ak-floating > * {\n pointer-events: all;\n}\n\n/* ── Inline layout ───────────────────────────────────────────── */\n.ak-inline {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n}\n\n/* ── Launcher button ─────────────────────────────────────────── */\n.ak-launcher {\n width: var(--ak-launcher-size);\n height: var(--ak-launcher-size);\n border-radius: 50%;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n box-shadow: 0 4px 16px color-mix(in srgb, var(--ak-accent) 45%, transparent);\n transition: background 0.2s, transform 0.15s, box-shadow 0.2s;\n flex-shrink: 0;\n}\n.ak-launcher:hover {\n background: var(--ak-accent-hover);\n transform: scale(1.08);\n box-shadow: 0 6px 24px color-mix(in srgb, var(--ak-accent) 55%, transparent);\n}\n.ak-launcher:active {\n transform: scale(0.95);\n}\n.ak-launcher svg {\n pointer-events: none;\n}\n/* Launcher showing avatar image instead of chat icon */\n.ak-launcher--avatar {\n padding: 0;\n overflow: hidden;\n}\n.ak-launcher__avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n pointer-events: none;\n}\n\n/* ── Shell wrapper (positions the hanging branding tab) ─────── */\n.ak-shell-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: var(--ak-launcher-gap);\n}\n\n/* ── Widget shell / panel ────────────────────────────────────── */\n.ak-shell {\n background: var(--ak-bg);\n border-radius: var(--ak-radius);\n box-shadow: var(--ak-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n}\n.ak-shell--floating {\n width: 380px;\n height: 580px;\n}\n.ak-shell--inline {\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n display: flex;\n flex-direction: column;\n}\n/* Inline shell-wrap fills its container and suppresses the duplicate widget header\n (the sidebar already renders its own header and close button). */\n.ak-inline .ak-shell-wrap {\n width: 100%;\n height: 100%;\n /* No launcher in inline mode — the negative offset would overflow the host. */\n margin-bottom: 0;\n}\n.ak-inline .ak-header {\n display: none;\n}\n.ak-shell-enter {\n animation: ak-panel-in 0.2s ease-out;\n}\n@keyframes ak-panel-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n/* ── Header ──────────────────────────────────────────────────── */\n.ak-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--ak-accent);\n color: #fff;\n flex-shrink: 0;\n gap: 8px;\n}\n.ak-header--confirming {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 0;\n}\n.ak-header__row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n}\n.ak-header__status {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n /* Not --ak-success: this dot sits on the accent fill, where the token green is too dark. */\n background: #4ade80;\n flex-shrink: 0;\n}\n.ak-header__title-group {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n}\n.ak-header__title {\n font-size: 15px;\n font-weight: 600;\n letter-spacing: -0.01em;\n}\n.ak-header__subtitle {\n font-size: 11px;\n font-weight: 400;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ak-header__close {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__close:hover {\n background: rgba(255, 255, 255, 0.35);\n}\n.ak-header__avatar {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__bot-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n flex-shrink: 0;\n}\n.ak-header__button {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__button:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__button--active {\n background: rgba(255, 255, 255, 0.3);\n}\n.ak-header__confirm {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n animation: ak-confirm-in 0.18s ease-out;\n}\n@keyframes ak-confirm-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-header__confirm-text {\n display: flex;\n flex-direction: column;\n gap: 1px;\n flex: 1;\n min-width: 0;\n}\n.ak-header__confirm-title {\n font-size: 13px;\n font-weight: 600;\n color: #fff;\n line-height: 1.3;\n}\n.ak-header__confirm-sub {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.75);\n line-height: 1.3;\n}\n.ak-header__confirm-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-shrink: 0;\n}\n.ak-header__confirm-cancel {\n padding: 5px 10px;\n border-radius: 6px;\n border: 1px solid rgba(255, 255, 255, 0.4);\n background: transparent;\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__confirm-cancel:active {\n background: rgba(255, 255, 255, 0.25);\n}\n.ak-header__confirm-ok {\n padding: 5px 10px;\n border-radius: 6px;\n border: none;\n background: rgba(255, 255, 255, 0.2);\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-ok:hover {\n background: rgba(239, 68, 68, 0.7);\n}\n.ak-header__confirm-ok:active {\n background: rgba(239, 68, 68, 0.85);\n}\n\n/* ── Message list ────────────────────────────────────────────── */\n.ak-messages {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n scroll-behavior: smooth;\n min-height: 0; /* Allow flex child to shrink below its content height */\n /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.\n background-attachment defaults to scroll = anchored to the padding box, so the\n pattern stays put while messages scroll. */\n background-image: var(--ak-pattern);\n background-size: var(--ak-pattern-size) var(--ak-pattern-size);\n}\n.ak-messages::-webkit-scrollbar { width: 4px; }\n.ak-messages::-webkit-scrollbar-track { background: transparent; }\n.ak-messages::-webkit-scrollbar-thumb {\n background: var(--ak-border);\n border-radius: 4px;\n}\n\n/* ── Empty state ─────────────────────────────────────────────── */\n.ak-empty-state {\n flex: 1;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: safe center;\n padding: 16px;\n text-align: center;\n gap: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0;\n /* Glow layer is translucent so the same doodle texture as .ak-messages shows through —\n keeps empty state and message list on one continuous surface. */\n background-color: var(--ak-bg);\n background-image:\n radial-gradient(ellipse 110% 55% at 50% 0%,\n color-mix(in srgb, var(--ak-accent) 10%, transparent),\n transparent 72%\n ),\n var(--ak-pattern);\n background-size: auto, var(--ak-pattern-size) var(--ak-pattern-size);\n}\n/* Decorative blurred orb behind the avatar */\n.ak-empty-state__glow {\n position: absolute;\n top: -24px;\n left: 50%;\n transform: translateX(-50%);\n width: 180px;\n height: 180px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--ak-accent) 18%, transparent);\n filter: blur(48px);\n pointer-events: none;\n}\n.ak-empty-state__body {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n position: relative;\n width: 100%;\n}\n.ak-empty-state__avatar {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n background: var(--ak-bg);\n border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));\n box-shadow:\n 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),\n 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-accent);\n margin-bottom: 4px;\n flex-shrink: 0;\n}\n.ak-empty-state__avatar-img {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n object-fit: cover;\n}\n.ak-empty-state__bot-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ak-empty-state__title {\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-empty-state__description {\n margin: 0;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.55;\n width: 100%;\n}\n/* Suggested question chips — 2-column grid */\n.ak-empty-state__suggestions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n width: 100%;\n}\n.ak-empty-state__suggestion {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: color-mix(in srgb, var(--ak-accent) 5%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 16%, var(--ak-border));\n border-radius: 10px;\n padding: 10px 12px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n/* Odd last item spans both columns so the grid doesn't look lopsided */\n.ak-empty-state__suggestion:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n.ak-empty-state__suggestion:hover {\n background: color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg));\n border-color: color-mix(in srgb, var(--ak-accent) 30%, var(--ak-border));\n}\n.ak-empty-state__suggestion-title {\n font-size: 13px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.4;\n}\n.ak-empty-state__suggestion-desc {\n font-size: 12px;\n color: var(--ak-text-muted);\n line-height: 1.4;\n margin-top: 2px;\n}\n\n/* ── Message bubbles ─────────────────────────────────────────── */\n.ak-message {\n display: flex;\n flex-direction: column;\n max-width: 86%;\n animation: ak-msg-in 0.15s ease-out;\n}\n@keyframes ak-msg-in {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-message--user {\n align-self: flex-end;\n align-items: flex-end;\n}\n.ak-message--assistant {\n align-self: flex-start;\n align-items: flex-start;\n}\n.ak-message__bubble {\n padding: 8px 12px;\n border-radius: 16px;\n font-size: 14px;\n line-height: 1.55;\n word-break: break-word;\n white-space: pre-wrap;\n max-width: 100%;\n min-width: 0;\n}\n.ak-message__bubble--md {\n white-space: normal;\n}\n.ak-message--user .ak-message__bubble {\n background: var(--ak-user-bg);\n color: var(--ak-user-text);\n border-bottom-right-radius: 4px;\n}\n.ak-message--assistant .ak-message__bubble {\n background: var(--ak-bot-bg);\n color: var(--ak-bot-text);\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n}\n.ak-message--error .ak-message__bubble {\n background: var(--ak-danger-soft);\n color: var(--ak-danger-fg);\n border-color: var(--ak-danger-border);\n}\n.ak-message--operator .ak-message__bubble--operator {\n background: color-mix(in srgb, var(--ak-accent) 8%, var(--ak-bot-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));\n}\n.ak-message__time {\n display: block;\n text-align: right;\n font-size: 11px;\n color: var(--ak-text-muted);\n margin-top: 2px;\n padding: 0 4px;\n}\n.ak-message--user .ak-message__time {\n color: rgba(255, 255, 255, 0.7);\n}\n.ak-message__sender-label {\n font-size: 11px;\n font-weight: 500;\n color: var(--ak-text-muted);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 0 2px;\n margin-bottom: 4px;\n}\n.ak-message--operator .ak-message__sender-label {\n color: var(--ak-accent);\n font-weight: 600;\n}\n.ak-message__operator-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: var(--ak-accent);\n color: #fff;\n font-size: 10px;\n font-weight: 700;\n line-height: 1;\n flex-shrink: 0;\n}\n.ak-message__operator-name {\n line-height: 1;\n}\n.ak-handoff-divider {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 8px 4px;\n color: var(--ak-text-muted);\n font-size: 11px;\n font-weight: 500;\n}\n.ak-handoff-divider::before,\n.ak-handoff-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--ak-border);\n}\n.ak-handoff-divider__label {\n white-space: nowrap;\n padding: 2px 8px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 14%, var(--ak-border));\n color: color-mix(in srgb, var(--ak-accent) 70%, var(--ak-text));\n}\n/* ── Message avatar (assistant only, when avatarUrl is set) ─── */\n.ak-message--with-avatar {\n flex-direction: row;\n align-items: flex-end;\n gap: 8px;\n}\n.ak-message__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--ak-surface);\n}\n.ak-message__body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 0;\n}\n\n/* ── Generated images ────────────────────────────────────────── */\n\n/* Bubble that contains an image — remove padding so image is flush at top */\n.ak-message__bubble--has-image {\n padding: 0;\n overflow: hidden;\n}\n\n.ak-message__images {\n display: flex;\n flex-direction: column;\n gap: 0;\n}\n\n.ak-message__image-wrap {\n position: relative;\n line-height: 0;\n}\n\n/* Clicking the image opens it in a new tab */\n.ak-message__image-link {\n display: block;\n line-height: 0;\n}\n\n.ak-message__image {\n width: 100%;\n display: block;\n transition: filter 0.2s;\n}\n\n.ak-message__image-link:hover .ak-message__image {\n filter: brightness(0.93);\n}\n\n/* ── Image gallery (count-aware layouts) ───────────────────────────────── */\n.ak-gallery {\n position: relative;\n width: 100%;\n background: var(--ak-bg);\n overflow: hidden;\n}\n\n/* Single hero: natural aspect, contained inside a white frame so transparent\n * product PNGs read clearly. Caps at 320px tall to keep bubble compact. */\n.ak-gallery--single {\n line-height: 0;\n}\n.ak-gallery--single .ak-gallery__cell--hero {\n display: block;\n background: var(--ak-bg);\n}\n.ak-gallery__img--contain {\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n background: var(--ak-bg);\n display: block;\n}\n\n/* 2-up: side-by-side squares, gap-1 */\n.ak-gallery--two {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: var(--ak-border);\n}\n\n/* 3-up: big left + 2 stacked right; container holds aspect */\n.ak-gallery--three {\n display: grid;\n grid-template-columns: 2fr 1fr;\n gap: 2px;\n background: var(--ak-border);\n aspect-ratio: 4 / 3;\n}\n.ak-gallery--three > .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n}\n.ak-gallery--three .ak-gallery__col {\n display: grid;\n grid-template-rows: 1fr 1fr;\n gap: 2px;\n}\n\n/* 4-up (and 5+): 2x2 grid */\n.ak-gallery--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: var(--ak-border);\n}\n\n.ak-gallery__cell {\n position: relative;\n display: block;\n overflow: hidden;\n background: var(--ak-surface);\n aspect-ratio: 1 / 1;\n line-height: 0;\n text-decoration: none;\n}\n\n/* Override aspect-ratio for the 3-up layout's column cells (they take parent height) */\n.ak-gallery--three .ak-gallery__col .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n width: 100%;\n}\n\n.ak-gallery__img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n transition: transform 0.2s ease-out, filter 0.2s;\n}\n\n.ak-gallery__cell:hover .ak-gallery__img {\n transform: scale(1.04);\n filter: brightness(0.97);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: -2px;\n}\n\n.ak-gallery__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.6);\n color: #ffffff;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n pointer-events: none;\n}\n\n/* ── File chips (user-uploaded .pdf/.md/.txt/.csv) ─────────────────────── */\n.ak-message__files {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px 4px;\n}\n.ak-message__bubble--has-image .ak-message__files {\n padding: 8px 8px 4px;\n}\n\n.ak-file-chip {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n text-decoration: none;\n color: var(--ak-text);\n transition: border-color 0.15s, box-shadow 0.15s;\n max-width: 100%;\n}\n\n.ak-file-chip:hover {\n border-color: var(--ak-border-strong);\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);\n}\n\n.ak-file-chip:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: 2px;\n}\n\n.ak-file-chip__icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n\n.ak-file-chip__icon--pdf { background: #fff1f2; color: #e11d48; }\n.ak-file-chip__icon--csv { background: #ecfdf5; color: #059669; }\n.ak-file-chip__icon--md { background: #f5f3ff; color: #7c3aed; }\n.ak-file-chip__icon--txt { background: #f1f5f9; color: #475569; }\n.ak-file-chip__icon--default { background: #eef2ff; color: #4f46e5; }\n\n.ak-file-chip__body {\n display: flex;\n flex-direction: column;\n min-width: 0;\n line-height: 1.2;\n}\n\n.ak-file-chip__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--ak-text);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n\n.ak-file-chip__label {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n color: var(--ak-text-muted);\n margin-top: 2px;\n}\n\n/* In user-side bubble (dark primary background), invert chip surface for legibility */\n.ak-message--user .ak-file-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n/* ── Voice note player (audio attachment) ──────────────────────────────── */\n.ak-audio-chip {\n display: inline-flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n max-width: 100%;\n}\n\n.ak-message--user .ak-audio-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n.ak-audio-chip__player {\n height: 36px;\n max-width: 260px;\n}\n\n.ak-audio-chip__transcript {\n margin: 0;\n font-size: 12px;\n font-style: italic;\n line-height: 1.4;\n color: var(--ak-text-muted);\n}\n\n/* ── Lightbox (image preview modal) ────────────────────────────────────── */\n.ak-lightbox {\n position: fixed;\n inset: 0;\n z-index: 2147483600; /* near max int — sits above any host-page content */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(15, 23, 42, 0.85);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n animation: ak-lightbox-in 0.12s ease-out;\n}\n\n@keyframes ak-lightbox-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.ak-lightbox__img {\n max-width: 92vw;\n max-height: 88vh;\n border-radius: 8px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);\n user-select: none;\n display: block;\n}\n\n.ak-lightbox__toolbar {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ak-lightbox__counter {\n display: inline-flex;\n align-items: center;\n height: 28px;\n padding: 0 12px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n font-size: 12px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n\n.ak-lightbox__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n text-decoration: none;\n padding: 0;\n}\n\n.ak-lightbox__btn:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__btn:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n.ak-lightbox__nav {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n padding: 0;\n}\n\n.ak-lightbox__nav:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__nav--prev { left: 16px; }\n.ak-lightbox__nav--next { right: 16px; }\n\n.ak-lightbox__nav:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n/* Gallery cells must be styled as plain buttons (we converted from <a>) */\n.ak-gallery__cell {\n border: none;\n padding: 0;\n margin: 0;\n cursor: zoom-in;\n font: inherit;\n color: inherit;\n background: var(--ak-surface);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: -2px;\n}\n\n/* Faint download icon — always present, top-right corner of the image */\n.ak-message__image-dl-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 26px;\n height: 26px;\n background: rgba(0, 0, 0, 0.28);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgba(255, 255, 255, 0.75);\n text-decoration: none;\n transition: background 0.15s, color 0.15s;\n}\n\n.ak-message__image-dl-icon:hover {\n background: rgba(0, 0, 0, 0.55);\n color: #ffffff;\n}\n\n/* Caption / text below the image, inside the same bubble */\n.ak-message__image-caption {\n padding: 8px 10px 8px;\n font-size: 14px;\n font-style: normal;\n color: var(--ak-text);\n line-height: 1.45;\n}\n\n/* User-uploaded image caption uses user bubble colors */\n.ak-message--user .ak-message__image-caption {\n color: rgba(255, 255, 255, 0.8);\n font-style: normal;\n}\n\n/* ── Typing indicator ────────────────────────────────────────── */\n.ak-typing {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 9px 12px;\n background: var(--ak-bot-bg);\n border-radius: 16px;\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n align-self: flex-start;\n width: fit-content;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing__dot {\n width: 7px;\n height: 7px;\n background: var(--ak-text-muted);\n border-radius: 50%;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing__dot:nth-child(3) { animation-delay: 0.4s; }\n@keyframes ak-bounce {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }\n 30% { transform: translateY(-5px); opacity: 1; }\n}\n\n/* ── Init status (validating / error) ───────────────────────── */\n.ak-init-status {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.ak-init-spinner {\n width: 28px;\n height: 28px;\n border: 3px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n animation: ak-spin 0.7s linear infinite;\n}\n@keyframes ak-spin {\n to { transform: rotate(360deg); }\n}\n.ak-init-status--error {\n justify-content: flex-start;\n}\n.ak-init-status--maintenance {\n padding: 28px 24px;\n}\n\n/* ── Composer ────────────────────────────────────────────────── */\n.ak-composer {\n position: relative; /* establishes positioning context for the attachment submenu */\n padding: 8px 12px 10px;\n border-top: 1px solid var(--ak-border);\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ak-bg);\n flex-shrink: 0;\n}\n\n/* Hidden native file input */\n.ak-composer__file-input {\n display: none;\n}\n\n/* Composer card — the dashboard ChatComposer layout: the message row (text, mic at its\n right edge) over a divider and a toolbar (+ … send), both on the same side padding.\n The + and mic glyphs (20px in a 32px box) are pulled flush with the text edges. */\n.ak-composer__input-wrap {\n display: flex;\n flex-direction: column;\n background: var(--ak-bg);\n border: 1px solid color-mix(in srgb, var(--ak-border-strong) 40%, transparent);\n border-radius: 16px;\n box-shadow: 0 1px 3px rgba(14, 18, 32, 0.06), 0 1px 2px rgba(14, 18, 32, 0.04);\n transition: border-color 0.15s;\n}\n.ak-composer__input-wrap:focus-within {\n border-color: var(--ak-accent);\n}\n.ak-composer__row {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px 8px;\n}\n.ak-composer__toolbar {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 12px;\n border-top: 1px solid var(--ak-border);\n}\n\n/* Attach button wrapper */\n.ak-composer__attach-wrap {\n flex-shrink: 0;\n margin-left: -6px;\n}\n\n/* Icon controls (\"+\" and mic): borderless, a hover fill rather than an outline */\n.ak-composer__attach,\n.ak-composer__mic {\n width: 32px;\n height: 32px;\n border-radius: 8px;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__attach:hover:not(:disabled),\n.ak-composer__mic:hover:not(:disabled),\n.ak-composer__attach--open {\n color: var(--ak-text);\n background: var(--ak-hover);\n}\n.ak-composer__attach:focus-visible,\n.ak-composer__mic:focus-visible,\n.ak-composer__send:focus-visible {\n outline: 2px solid var(--ak-accent);\n outline-offset: 2px;\n}\n.ak-composer__attach:disabled,\n.ak-composer__mic:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n/* Flush right, and -4px vertically so the 32px box doesn't grow the 24px text row */\n.ak-composer__mic {\n margin: -4px -6px -4px 0;\n}\n\n/* Attachment submenu — floats above the composer, positioned relative to .ak-composer */\n.ak-composer__attach-menu {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 12px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 10px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n padding: 4px;\n min-width: 130px;\n z-index: 10;\n}\n\n/* Individual item inside the attachment submenu */\n.ak-composer__attach-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: none;\n border-radius: 7px;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n cursor: pointer;\n transition: background 0.12s;\n text-align: left;\n}\n.ak-composer__attach-menu-item:hover:not(:disabled) {\n background: var(--ak-bg);\n}\n.ak-composer__attach-menu-item:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Textarea — borderless, transparent, fills the message row */\n.ak-composer__input {\n flex: 1;\n padding: 0;\n border: none;\n border-radius: 0;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 16px; /* iOS zooms the page when a focused input is under 16px */\n line-height: 1.5;\n resize: none;\n outline: none;\n min-height: 24px;\n max-height: 110px;\n overflow-y: auto;\n}\n.ak-composer__input::placeholder {\n color: var(--ak-text-muted);\n}\n\n/* Recording bar — replaces the input row while a voice note is being recorded */\n.ak-composer__recording {\n display: flex;\n align-items: center;\n gap: 10px;\n flex: 1;\n padding: 8px 12px;\n}\n.ak-composer__recording-timer {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n font-variant-numeric: tabular-nums;\n}\n.ak-composer__recording-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--ak-danger);\n animation: ak-recording-pulse 1.4s ease-in-out infinite;\n}\n@keyframes ak-recording-pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.35;\n }\n}\n.ak-composer__recording-cancel,\n.ak-composer__recording-stop {\n width: 32px;\n height: 32px;\n border-radius: 8px;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n}\n.ak-composer__recording-cancel {\n background: transparent;\n color: var(--ak-text-muted);\n}\n.ak-composer__recording-cancel:hover {\n color: var(--ak-text);\n background: var(--ak-hover);\n}\n.ak-composer__recording-stop {\n background: var(--ak-accent);\n color: white;\n}\n.ak-composer__recording-stop:hover {\n background: var(--ak-accent-hover);\n}\n\n/* Send button — rounded square at the toolbar's right end */\n.ak-composer__send {\n width: 32px;\n height: 32px;\n margin-left: auto;\n border-radius: 8px;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n transition: background 0.15s, color 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__send:hover:not(:disabled) {\n background: var(--ak-accent-hover);\n}\n/* Disabled sits on the muted fill rather than a faded accent, so it stays visible on dark */\n.ak-composer__send:disabled {\n background: var(--ak-bot-bg);\n color: var(--ak-text-muted);\n cursor: not-allowed;\n}\n\n/* Old photo button — hidden but keep so file-input trigger still works */\n.ak-composer__photo {\n display: none;\n}\n\n/* Image preview strip above the input row */\n.ak-composer__preview {\n display: flex;\n gap: 6px;\n padding: 0 2px;\n}\n.ak-composer__preview-wrap {\n position: relative;\n width: 60px;\n height: 60px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n flex-shrink: 0;\n}\n.ak-composer__preview-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n.ak-composer__preview-remove {\n position: absolute;\n top: 3px;\n right: 3px;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n padding: 0;\n transition: background 0.15s;\n}\n.ak-composer__preview-remove:hover {\n background: rgba(0, 0, 0, 0.8);\n}\n\n/* ── Streaming cursor ────────────────────────────────────────── */\n.ak-cursor {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n margin-left: 4px;\n vertical-align: middle;\n}\n.ak-cursor__dot {\n display: inline-block;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.6;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }\n\n/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item\n and .ak-progress__summary so dots → activity line → summary never reflow. */\n.ak-typing-row {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* One text line at the shared row metrics, so the dots occupy exactly the\n box the activity line and summary will occupy (border-box). */\n min-height: calc(0.76rem * 1.4 + 4px);\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing-row__dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--ak-bot-text);\n opacity: 0.5;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }\n@media (prefers-reduced-motion: reduce) {\n .ak-typing-row__dot,\n .ak-cursor__dot,\n .ak-typing__dot,\n .ak-progress__item--active,\n .ak-agent-status__icon {\n animation: none;\n }\n}\n\n/* ── Markdown rendering ──────────────────────────────────────── */\n.ak-message__bubble--md {\n white-space: normal;\n min-width: 0;\n}\n.ak-message__bubble--md .ak-md-p {\n margin: 0 0 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-p:last-child {\n margin-bottom: 0;\n}\n/* Collapse margins between paragraph and following list */\n.ak-message__bubble--md .ak-md-p + .ak-md-ul,\n.ak-message__bubble--md .ak-md-p + .ak-md-ol {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1,\n.ak-message__bubble--md .ak-md-h2,\n.ak-message__bubble--md .ak-md-h3 {\n font-weight: 700;\n line-height: 1.3;\n margin: 0.6em 0 0.3em;\n}\n.ak-message__bubble--md .ak-md-h1:first-child,\n.ak-message__bubble--md .ak-md-h2:first-child,\n.ak-message__bubble--md .ak-md-h3:first-child {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1 { font-size: 1.12em; }\n.ak-message__bubble--md .ak-md-h2 { font-size: 1.04em; }\n.ak-message__bubble--md .ak-md-h3 { font-size: 0.97em; }\n.ak-message__bubble--md .ak-md-ul,\n.ak-message__bubble--md .ak-md-ol {\n padding-left: 1.4em;\n margin: 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-ul li,\n.ak-message__bubble--md .ak-md-ol li {\n margin-bottom: 0.15em;\n}\n.ak-message__bubble--md .ak-md-pre-wrap {\n position: relative;\n margin: 0.4em 0;\n border-radius: 6px;\n overflow-x: auto;\n overflow-y: hidden;\n background: rgba(0, 0, 0, 0.08);\n max-width: 100%;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-wrap {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre-lang {\n display: block;\n padding: 3px 10px;\n font-size: 10px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.55;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-lang {\n border-bottom-color: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre {\n margin: 0;\n padding: 8px 10px;\n font-size: 12px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n white-space: pre;\n box-sizing: border-box;\n}\n.ak-message__bubble--md .ak-md-code {\n display: block;\n font-family: inherit;\n font-size: inherit;\n}\n.ak-message__bubble--md .ak-md-ic {\n background: rgba(0, 0, 0, 0.08);\n border-radius: 3px;\n padding: 1px 5px;\n font-size: 0.87em;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-ic {\n background: rgba(255, 255, 255, 0.2);\n}\n.ak-message__bubble--md .ak-md-hr {\n border: none;\n border-top: 1px solid currentColor;\n opacity: 0.2;\n margin: 0.5em 0;\n}\n.ak-message__bubble--md a {\n color: var(--ak-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-message--user .ak-message__bubble--md a {\n color: rgba(255, 255, 255, 0.9);\n}\n.ak-message__bubble--md .ak-md-table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.4em 0;\n font-size: 0.95em;\n line-height: 1.5;\n}\n.ak-message__bubble--md .ak-md-th {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 2px solid var(--ak-accent) !important;\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent) !important;\n font-weight: 600;\n color: var(--ak-text) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-th {\n border-bottom-color: rgba(255, 255, 255, 0.5) !important;\n background: rgba(0, 0, 0, 0.25) !important;\n color: #ffffff !important;\n font-weight: 700;\n}\n.ak-message__bubble--md .ak-md-td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--ak-border) !important;\n color: var(--ak-text) !important;\n}\n.ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: color-mix(in srgb, var(--ak-surface), transparent 40%) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-td {\n color: #ffffff !important;\n border-bottom-color: rgba(255, 255, 255, 0.25) !important;\n}\n.ak-message--user .ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: rgba(0, 0, 0, 0.15) !important;\n}\n\n/* ── Composer disclaimer ─────────────────────────────────────── */\n.ak-composer__disclaimer {\n font-size: 11px;\n color: var(--ak-text-muted);\n text-align: center;\n line-height: 1.4;\n}\n.ak-composer__disclaimer a {\n color: var(--ak-text-muted);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-composer__disclaimer a:hover {\n color: var(--ak-accent);\n}\n\n/* ── Maintenance state ───────────────────────────────────────── */\n.ak-maintenance {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n max-width: 320px;\n padding: 8px 4px;\n animation: ak-maintenance-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;\n}\n.ak-maintenance__halo {\n position: absolute;\n top: -6px;\n left: 50%;\n width: 120px;\n height: 120px;\n transform: translateX(-50%);\n border-radius: 50%;\n background: radial-gradient(\n closest-side,\n var(--ak-maintenance-halo) 0%,\n transparent 72%\n );\n opacity: 0.22;\n filter: blur(4px);\n pointer-events: none;\n animation: ak-maintenance-pulse 2.8s ease-in-out infinite;\n}\n.ak-maintenance__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--ak-maintenance-bg);\n color: var(--ak-maintenance-fg);\n border: 1px solid color-mix(in srgb, var(--ak-maintenance-halo) 40%, transparent);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n.ak-maintenance__title {\n margin-top: 16px;\n font-size: 15px;\n font-weight: 600;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-maintenance__description {\n margin-top: 6px;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.5;\n max-width: 28ch;\n}\n\n@keyframes ak-maintenance-enter {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n@keyframes ak-maintenance-pulse {\n 0%, 100% { opacity: 0.18; transform: translateX(-50%) scale(1); }\n 50% { opacity: 0.32; transform: translateX(-50%) scale(1.06); }\n}\n@media (prefers-reduced-motion: reduce) {\n .ak-maintenance,\n .ak-maintenance__halo,\n .ak-maintenance__icon {\n animation: none;\n }\n}\n\n/* ── Error banner ────────────────────────────────────────────── */\n.ak-error {\n padding: 12px 16px;\n background: var(--ak-danger-soft);\n color: var(--ak-danger-fg);\n font-size: 13px;\n border-top: 1px solid var(--ak-danger-border);\n text-align: left;\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n}\n\n.ak-error__icon {\n font-size: 16px;\n line-height: 1;\n flex-shrink: 0;\n margin-top: 1px;\n}\n\n.ak-error__content {\n flex: 1;\n}\n\n.ak-error__title {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 4px 0;\n line-height: 1.3;\n}\n\n.ak-error__description {\n font-size: 13px;\n margin: 0 0 4px 0;\n line-height: 1.4;\n opacity: 0.9;\n}\n\n.ak-error__message {\n font-size: 13px;\n margin: 0;\n line-height: 1.4;\n opacity: 0.85;\n}\n\n/* Specific styling for origin restriction errors */\n.ak-error--origin {\n background: var(--ak-warning-soft); /* warning, not danger: less alarming */\n color: var(--ak-warning-fg);\n border-top: 1px solid var(--ak-warning);\n}\n\n/* ── Agent status indicator ──────────────────────────────────── */\n/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants\n see the tool status swap in without the surrounding box changing size. */\n.ak-agent-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 4px;\n padding: 2px 0;\n color: var(--ak-bot-text);\n font-size: 0.76rem;\n line-height: 1.4;\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-agent-status__icon {\n flex-shrink: 0;\n color: var(--ak-accent);\n animation: ak-sparkle-pulse 2.5s ease-in-out infinite;\n}\n.ak-agent-status__text {\n line-height: 1.4;\n}\n@keyframes ak-sparkle-pulse {\n 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }\n 50% { opacity: 0.45; transform: scale(0.85) rotate(15deg); }\n}\n\n/* ── Progress block (tool execution / streaming chain) ───────── */\n.ak-progress {\n margin-bottom: 4px;\n max-width: 80%;\n}\n.ak-progress__block {\n display: inline-flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 12px;\n border-radius: 14px;\n background: var(--ak-bot-bg);\n border: 1px solid var(--ak-border);\n font-size: 0.8rem;\n color: var(--ak-bot-text);\n opacity: 0.85;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ak-progress__label {\n font-weight: 600;\n font-size: 0.78rem;\n color: var(--ak-accent);\n}\n.ak-progress__toggle {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n padding: 1px 7px;\n border: 1px solid var(--ak-border);\n border-radius: 8px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.72rem;\n cursor: pointer;\n opacity: 0.65;\n transition: opacity 0.15s;\n}\n.ak-progress__toggle:hover { opacity: 0.9; }\n.ak-progress__toggle--collapsed {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.78rem;\n cursor: pointer;\n opacity: 0.55;\n transition: opacity 0.15s;\n margin-bottom: 4px;\n}\n.ak-progress__toggle--collapsed:hover { opacity: 0.85; }\n.ak-progress__text {\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n line-height: 1.4;\n margin: 0;\n}\n/* Active streaming state */\n.ak-progress__list {\n list-style: none;\n margin: 0 0 4px;\n padding: 0;\n}\n/* Bare row, not a pill — identical metrics to .ak-progress__summary so the\n live line and the post-turn \"Worked for Ns\" swap without a size change. */\n.ak-progress__item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n line-height: 1.4;\n color: var(--ak-bot-text);\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__item--active {\n /* inherits base .ak-progress__item; subtle pulse to signal in-flight */\n animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;\n}\n@keyframes ak-active-pulse {\n 0%, 100% { opacity: 0.6; }\n 50% { opacity: 0.9; }\n}\n/* Claude-style step list (detailed mode) */\n.ak-progress__steps {\n list-style: none;\n margin: 0 0 4px;\n padding: 2px 0;\n}\n.ak-progress__step {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n line-height: 1.4;\n}\n.ak-progress__step--active {\n opacity: 0.9;\n}\n.ak-progress__step-text {\n min-width: 0;\n}\n.ak-progress__step-dur {\n opacity: 0.65;\n flex-shrink: 0;\n}\n.ak-progress__step-icon {\n flex-shrink: 0;\n opacity: 0.55;\n}\n.ak-progress__step-icon--fail {\n color: var(--ak-danger);\n opacity: 0.9;\n}\n/* Post-turn summary row (\"Worked for Ns · N steps\") */\n.ak-progress__summary {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* Shrink-to-fit as a column flex item would otherwise break \"Worked for 8.4s\"\n onto two lines, doubling the row height as the turn ends. */\n white-space: nowrap;\n border: none;\n background: transparent;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.ak-progress__summary:hover { opacity: 0.85; }\n.ak-progress__summary--static {\n cursor: default;\n}\n.ak-progress__summary--static:hover { opacity: 0.6; }\n.ak-progress__spinner {\n display: inline-block;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n flex-shrink: 0;\n animation: ak-spin 0.7s linear infinite;\n}\n\n/* ── Powered by hanging tab ──────────────────────────────────── */\n.ak-branding {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px 4px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n margin-left: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);\n}\n.ak-branding__logo {\n width: 11px;\n height: 11px;\n flex-shrink: 0;\n color: var(--ak-accent);\n opacity: 0.75;\n}\n.ak-branding__label {\n font-size: 9px;\n color: var(--ak-text-muted);\n opacity: 0.75;\n}\n.ak-branding__name {\n font-size: 9px;\n font-weight: 600;\n color: var(--ak-accent);\n opacity: 0.75;\n letter-spacing: -0.01em;\n}\n\n/* ── Mobile: full-viewport panel ─────────────────────────────── */\n@media (max-width: 639px) {\n @keyframes ak-panel-in-mobile {\n from { opacity: 0; transform: translateY(32px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.\n Give it its own fixed position so it fills the viewport independently,\n bypassing the outer container's bottom/right offsets. */\n :host([data-open]) {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n pointer-events: none;\n }\n\n :host([data-open]) .ak-floating {\n width: 100%;\n height: 100%;\n align-items: stretch;\n gap: 0;\n }\n\n :host([data-open]) .ak-shell-wrap {\n flex: 1;\n min-height: 0;\n width: 100%;\n align-items: stretch;\n /* Launcher is hidden here — the negative offset would leave a dead strip. */\n margin-bottom: 0;\n }\n\n :host([data-open]) .ak-shell--floating {\n width: 100%;\n flex: 1;\n height: auto;\n border-radius: 0;\n box-shadow: none;\n border-left: none;\n border-right: none;\n border-top: none;\n }\n\n :host([data-open]) .ak-launcher {\n display: none;\n }\n\n :host([data-open]) .ak-shell-enter {\n animation: ak-panel-in-mobile 0.22s ease-out;\n }\n\n :host([data-open]) .ak-branding {\n display: none;\n }\n}\n";
|
|
5819
|
+
// ../../packages/widget-ui/src/components/Header.tsx
|
|
5861
5820
|
function ka() {
|
|
5862
5821
|
return /* @__PURE__ */ l("svg", {
|
|
5863
5822
|
width: "16",
|
|
@@ -6019,8 +5978,7 @@ function Ma({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
|
|
|
6019
5978
|
})]
|
|
6020
5979
|
});
|
|
6021
5980
|
}
|
|
6022
|
-
|
|
6023
|
-
//#region ../../packages/widget-ui/src/lib/safe-url.ts
|
|
5981
|
+
// ../../packages/widget-ui/src/lib/safe-url.ts
|
|
6024
5982
|
function Na(e) {
|
|
6025
5983
|
if (!e) return null;
|
|
6026
5984
|
let t = e.trim();
|
|
@@ -6034,13 +5992,11 @@ function Na(e) {
|
|
|
6034
5992
|
"tel"
|
|
6035
5993
|
].includes(n) ? t : null : t;
|
|
6036
5994
|
}
|
|
6037
|
-
|
|
6038
|
-
//#region ../../packages/widget-ui/src/lib/strip-latex.ts
|
|
5995
|
+
// ../../packages/widget-ui/src/lib/strip-latex.ts
|
|
6039
5996
|
function Pa(e) {
|
|
6040
5997
|
return e.replace(/\\text\{([^}]*)\}/g, "$1").replace(/\\implies/g, "→").replace(/\\Rightarrow/g, "⟹").replace(/\\times/g, "×").replace(/\\div/g, "÷").replace(/\\cdot/g, "·").replace(/\\quad/g, " ").replace(/\\qquad/g, " ").replace(/\\leq/g, "≤").replace(/\\geq/g, "≥").replace(/\\neq/g, "≠").replace(/\\approx/g, "≈").replace(/\\infty/g, "∞").replace(/\\\((.+?)\\\)/gs, "$1").replace(/\\\[[\s\S]+?\\\]/g, "").replace(/\\\$/g, "\0DOLLAR\0").replace(/\$\$(?!\d)[\s\S]+?\$\$/g, "").replace(/\$(?![\s\d])([^$\n]+?)(?<!\s)\$(?!\d)/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, "\n\n");
|
|
6041
5998
|
}
|
|
6042
|
-
|
|
6043
|
-
//#region ../../packages/widget-ui/src/components/ProgressBlock.tsx
|
|
5999
|
+
// ../../packages/widget-ui/src/components/ProgressBlock.tsx
|
|
6044
6000
|
function Fa(e) {
|
|
6045
6001
|
let [, t] = o(0);
|
|
6046
6002
|
r(() => {
|
|
@@ -6237,8 +6193,7 @@ function Va({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
|
|
|
6237
6193
|
})
|
|
6238
6194
|
}) : null;
|
|
6239
6195
|
}
|
|
6240
|
-
|
|
6241
|
-
//#region ../../packages/widget-ui/src/components/MessageBubble.tsx
|
|
6196
|
+
// ../../packages/widget-ui/src/components/MessageBubble.tsx
|
|
6242
6197
|
function Ha() {
|
|
6243
6198
|
return /* @__PURE__ */ c("svg", {
|
|
6244
6199
|
className: "ak-agent-status__icon",
|
|
@@ -6937,8 +6892,7 @@ function Qa({ message: e }) {
|
|
|
6937
6892
|
]
|
|
6938
6893
|
});
|
|
6939
6894
|
}
|
|
6940
|
-
|
|
6941
|
-
//#region ../../packages/widget-ui/src/components/TypingIndicator.tsx
|
|
6895
|
+
// ../../packages/widget-ui/src/components/TypingIndicator.tsx
|
|
6942
6896
|
function $a() {
|
|
6943
6897
|
return /* @__PURE__ */ l("div", {
|
|
6944
6898
|
className: "ak-typing",
|
|
@@ -6950,8 +6904,7 @@ function $a() {
|
|
|
6950
6904
|
]
|
|
6951
6905
|
});
|
|
6952
6906
|
}
|
|
6953
|
-
|
|
6954
|
-
//#region ../../packages/widget-ui/src/components/MessageList.tsx
|
|
6907
|
+
// ../../packages/widget-ui/src/components/MessageList.tsx
|
|
6955
6908
|
function eo(e, t) {
|
|
6956
6909
|
let n = [], r = null;
|
|
6957
6910
|
for (let i of e) {
|
|
@@ -6972,7 +6925,7 @@ function eo(e, t) {
|
|
|
6972
6925
|
}
|
|
6973
6926
|
function to({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }) {
|
|
6974
6927
|
let o = a(null), s = a(null), u = a(!0), d = i(() => eo(e, n), [e, n]);
|
|
6975
|
-
|
|
6928
|
+
r(() => {
|
|
6976
6929
|
if (!(o.current?.parentElement ?? o.current)) return;
|
|
6977
6930
|
let e = (e) => {
|
|
6978
6931
|
u.current = e.scrollHeight - e.scrollTop - e.clientHeight < 120;
|
|
@@ -6983,9 +6936,11 @@ function to({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }
|
|
|
6983
6936
|
return t.addEventListener("scroll", n, { passive: !0 }), () => t.removeEventListener("scroll", n);
|
|
6984
6937
|
}, []), r(() => {
|
|
6985
6938
|
e[e.length - 1]?.role === "user" && (u.current = !0), u.current && s.current?.scrollIntoView({ behavior: "smooth" });
|
|
6986
|
-
}, [e])
|
|
6939
|
+
}, [e]);
|
|
6940
|
+
let f = e.find((e) => e.status === "streaming")?.content ?? "";
|
|
6941
|
+
return r(() => {
|
|
6987
6942
|
u.current && s.current?.scrollIntoView({ behavior: "smooth" });
|
|
6988
|
-
}, [t,
|
|
6943
|
+
}, [t, f]), /* @__PURE__ */ l("div", {
|
|
6989
6944
|
ref: o,
|
|
6990
6945
|
className: "ak-messages",
|
|
6991
6946
|
role: "log",
|
|
@@ -7005,8 +6960,7 @@ function to({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }
|
|
|
7005
6960
|
]
|
|
7006
6961
|
});
|
|
7007
6962
|
}
|
|
7008
|
-
|
|
7009
|
-
//#region ../../packages/widget-ui/src/components/EmptyState.tsx
|
|
6963
|
+
// ../../packages/widget-ui/src/components/EmptyState.tsx
|
|
7010
6964
|
function no() {
|
|
7011
6965
|
return /* @__PURE__ */ l("svg", {
|
|
7012
6966
|
width: "30",
|
|
@@ -7101,8 +7055,7 @@ function ro({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
|
|
|
7101
7055
|
]
|
|
7102
7056
|
});
|
|
7103
7057
|
}
|
|
7104
|
-
|
|
7105
|
-
//#region ../../packages/widget-ui/src/components/Composer.tsx
|
|
7058
|
+
// ../../packages/widget-ui/src/components/Composer.tsx
|
|
7106
7059
|
var io = "https://klicforge.ai/privacy-policy", ao = "https://klicforge.ai/terms-of-service";
|
|
7107
7060
|
function oo() {
|
|
7108
7061
|
return /* @__PURE__ */ l("svg", {
|
|
@@ -7111,25 +7064,25 @@ function oo() {
|
|
|
7111
7064
|
viewBox: "0 0 24 24",
|
|
7112
7065
|
fill: "none",
|
|
7113
7066
|
stroke: "currentColor",
|
|
7114
|
-
strokeWidth: "2
|
|
7067
|
+
strokeWidth: "2",
|
|
7115
7068
|
strokeLinecap: "round",
|
|
7116
7069
|
strokeLinejoin: "round",
|
|
7117
7070
|
children: [/* @__PURE__ */ c("line", {
|
|
7118
|
-
x1: "
|
|
7119
|
-
y1: "
|
|
7120
|
-
x2: "
|
|
7121
|
-
y2: "
|
|
7122
|
-
}), /* @__PURE__ */ c("
|
|
7071
|
+
x1: "12",
|
|
7072
|
+
y1: "19",
|
|
7073
|
+
x2: "12",
|
|
7074
|
+
y2: "5"
|
|
7075
|
+
}), /* @__PURE__ */ c("polyline", { points: "5 12 12 5 19 12" })]
|
|
7123
7076
|
});
|
|
7124
7077
|
}
|
|
7125
7078
|
function so() {
|
|
7126
7079
|
return /* @__PURE__ */ l("svg", {
|
|
7127
|
-
width: "
|
|
7128
|
-
height: "
|
|
7080
|
+
width: "20",
|
|
7081
|
+
height: "20",
|
|
7129
7082
|
viewBox: "0 0 24 24",
|
|
7130
7083
|
fill: "none",
|
|
7131
7084
|
stroke: "currentColor",
|
|
7132
|
-
strokeWidth: "2
|
|
7085
|
+
strokeWidth: "2",
|
|
7133
7086
|
strokeLinecap: "round",
|
|
7134
7087
|
children: [/* @__PURE__ */ c("line", {
|
|
7135
7088
|
x1: "12",
|
|
@@ -7199,8 +7152,8 @@ function uo() {
|
|
|
7199
7152
|
}
|
|
7200
7153
|
function fo() {
|
|
7201
7154
|
return /* @__PURE__ */ l("svg", {
|
|
7202
|
-
width: "
|
|
7203
|
-
height: "
|
|
7155
|
+
width: "20",
|
|
7156
|
+
height: "20",
|
|
7204
7157
|
viewBox: "0 0 24 24",
|
|
7205
7158
|
fill: "none",
|
|
7206
7159
|
stroke: "currentColor",
|
|
@@ -7294,7 +7247,7 @@ function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7294
7247
|
r(() => {
|
|
7295
7248
|
if (t) return;
|
|
7296
7249
|
let e = he.current;
|
|
7297
|
-
he.current = t,
|
|
7250
|
+
he.current = t, e === null && typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches || A.current?.focus();
|
|
7298
7251
|
}, [t]);
|
|
7299
7252
|
let ge = a(!1);
|
|
7300
7253
|
r(() => {
|
|
@@ -7368,11 +7321,7 @@ function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7368
7321
|
kind: "audio",
|
|
7369
7322
|
durationMs: r
|
|
7370
7323
|
}];
|
|
7371
|
-
|
|
7372
|
-
_?.(`Only ${h} attachments can be sent at once`);
|
|
7373
|
-
return;
|
|
7374
|
-
}
|
|
7375
|
-
e(o, s), y(""), ve(), A.current && (A.current.style.height = "auto");
|
|
7324
|
+
s.length > h ? _?.(`Only ${h} attachments can be sent at once`) : (e(o, s), y(""), ve(), A.current && (A.current.style.height = "auto"));
|
|
7376
7325
|
}, N.current = i, ae.current = Date.now(), k(0), i.start(), D(!0), oe.current = setInterval(() => {
|
|
7377
7326
|
let e = Date.now() - ae.current;
|
|
7378
7327
|
k(e), e >= m * 1e3 && Ce(!1);
|
|
@@ -7391,24 +7340,10 @@ function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7391
7340
|
function Ee(e, t) {
|
|
7392
7341
|
if (e.length === 0) return;
|
|
7393
7342
|
let n = [], r = [];
|
|
7394
|
-
for (let i of e) {
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
}
|
|
7399
|
-
if (t === "file" && !Co(i)) {
|
|
7400
|
-
r.push(`${i.name} (file type not supported)`);
|
|
7401
|
-
continue;
|
|
7402
|
-
}
|
|
7403
|
-
if (i.size > pe) {
|
|
7404
|
-
r.push(`${i.name} (over ${g} MB)`);
|
|
7405
|
-
continue;
|
|
7406
|
-
}
|
|
7407
|
-
n.push({
|
|
7408
|
-
file: i,
|
|
7409
|
-
kind: t
|
|
7410
|
-
});
|
|
7411
|
-
}
|
|
7343
|
+
for (let i of e) t === "image" && !wo(i) ? r.push(`${i.name} (image type not supported)`) : t === "file" && !Co(i) ? r.push(`${i.name} (file type not supported)`) : i.size > pe ? r.push(`${i.name} (over ${g} MB)`) : n.push({
|
|
7344
|
+
file: i,
|
|
7345
|
+
kind: t
|
|
7346
|
+
});
|
|
7412
7347
|
x((e) => {
|
|
7413
7348
|
let t = [...e, ...n], i = t.slice(0, h);
|
|
7414
7349
|
return t.length > h && r.push(`max ${h} attachments allowed`), C((e) => {
|
|
@@ -7546,8 +7481,30 @@ function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7546
7481
|
children: /* @__PURE__ */ c(po, {})
|
|
7547
7482
|
})
|
|
7548
7483
|
]
|
|
7549
|
-
}) : /* @__PURE__ */ l(s, { children: [
|
|
7550
|
-
|
|
7484
|
+
}) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
|
|
7485
|
+
className: "ak-composer__row",
|
|
7486
|
+
children: [/* @__PURE__ */ c("textarea", {
|
|
7487
|
+
ref: A,
|
|
7488
|
+
className: "ak-composer__input",
|
|
7489
|
+
value: v,
|
|
7490
|
+
onInput: Te,
|
|
7491
|
+
onKeyDown: we,
|
|
7492
|
+
placeholder: u,
|
|
7493
|
+
disabled: t,
|
|
7494
|
+
rows: 1,
|
|
7495
|
+
"aria-label": "Message input"
|
|
7496
|
+
}), me && /* @__PURE__ */ c("button", {
|
|
7497
|
+
className: "ak-composer__mic",
|
|
7498
|
+
onClick: () => void Se(),
|
|
7499
|
+
disabled: t || b.length >= h,
|
|
7500
|
+
"aria-label": b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7501
|
+
title: b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7502
|
+
type: "button",
|
|
7503
|
+
children: /* @__PURE__ */ c(fo, {})
|
|
7504
|
+
})]
|
|
7505
|
+
}), /* @__PURE__ */ l("div", {
|
|
7506
|
+
className: "ak-composer__toolbar",
|
|
7507
|
+
children: [fe && /* @__PURE__ */ c("div", {
|
|
7551
7508
|
className: "ak-composer__attach-wrap",
|
|
7552
7509
|
children: /* @__PURE__ */ c("button", {
|
|
7553
7510
|
ref: te,
|
|
@@ -7560,36 +7517,15 @@ function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7560
7517
|
type: "button",
|
|
7561
7518
|
children: /* @__PURE__ */ c(so, {})
|
|
7562
7519
|
})
|
|
7563
|
-
}),
|
|
7564
|
-
me && /* @__PURE__ */ c("button", {
|
|
7565
|
-
className: "ak-composer__mic",
|
|
7566
|
-
onClick: () => void Se(),
|
|
7567
|
-
disabled: t || b.length >= h,
|
|
7568
|
-
"aria-label": b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7569
|
-
title: b.length >= h ? `Only ${h} attachments can be sent at once` : "Record a voice note",
|
|
7570
|
-
type: "button",
|
|
7571
|
-
children: /* @__PURE__ */ c(fo, {})
|
|
7572
|
-
}),
|
|
7573
|
-
/* @__PURE__ */ c("textarea", {
|
|
7574
|
-
ref: A,
|
|
7575
|
-
className: "ak-composer__input",
|
|
7576
|
-
value: v,
|
|
7577
|
-
onInput: Te,
|
|
7578
|
-
onKeyDown: we,
|
|
7579
|
-
placeholder: u,
|
|
7580
|
-
disabled: t,
|
|
7581
|
-
rows: 1,
|
|
7582
|
-
"aria-label": "Message input"
|
|
7583
|
-
}),
|
|
7584
|
-
/* @__PURE__ */ c("button", {
|
|
7520
|
+
}), /* @__PURE__ */ c("button", {
|
|
7585
7521
|
className: "ak-composer__send",
|
|
7586
7522
|
onClick: be,
|
|
7587
7523
|
disabled: !je,
|
|
7588
7524
|
"aria-label": "Send message",
|
|
7589
7525
|
type: "button",
|
|
7590
7526
|
children: /* @__PURE__ */ c(oo, {})
|
|
7591
|
-
})
|
|
7592
|
-
] })
|
|
7527
|
+
})]
|
|
7528
|
+
})] })
|
|
7593
7529
|
}),
|
|
7594
7530
|
/* @__PURE__ */ l("p", {
|
|
7595
7531
|
className: "ak-composer__disclaimer",
|
|
@@ -7618,8 +7554,7 @@ function To({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
|
|
|
7618
7554
|
]
|
|
7619
7555
|
});
|
|
7620
7556
|
}
|
|
7621
|
-
|
|
7622
|
-
//#region ../../packages/widget-ui/src/components/ErrorState.tsx
|
|
7557
|
+
// ../../packages/widget-ui/src/components/ErrorState.tsx
|
|
7623
7558
|
function Eo({ message: e }) {
|
|
7624
7559
|
return e.includes("Origin not allowed") ? /* @__PURE__ */ l("div", {
|
|
7625
7560
|
className: "ak-error ak-error--origin",
|
|
@@ -7652,8 +7587,7 @@ function Eo({ message: e }) {
|
|
|
7652
7587
|
})]
|
|
7653
7588
|
});
|
|
7654
7589
|
}
|
|
7655
|
-
|
|
7656
|
-
//#region ../../packages/widget-ui/src/components/MaintenanceState.tsx
|
|
7590
|
+
// ../../packages/widget-ui/src/components/MaintenanceState.tsx
|
|
7657
7591
|
function Do() {
|
|
7658
7592
|
return /* @__PURE__ */ l("svg", {
|
|
7659
7593
|
width: "28",
|
|
@@ -7697,8 +7631,7 @@ function Oo() {
|
|
|
7697
7631
|
]
|
|
7698
7632
|
});
|
|
7699
7633
|
}
|
|
7700
|
-
|
|
7701
|
-
//#region ../../packages/widget-ui/src/components/WidgetShell.tsx
|
|
7634
|
+
// ../../packages/widget-ui/src/components/WidgetShell.tsx
|
|
7702
7635
|
function ko() {
|
|
7703
7636
|
return /* @__PURE__ */ l("svg", {
|
|
7704
7637
|
width: "11",
|
|
@@ -7797,8 +7730,7 @@ function jo({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
|
|
|
7797
7730
|
}), !i && /* @__PURE__ */ c(Ao, {})]
|
|
7798
7731
|
});
|
|
7799
7732
|
}
|
|
7800
|
-
|
|
7801
|
-
//#region ../../packages/widget-ui/src/components/Launcher.tsx
|
|
7733
|
+
// ../../packages/widget-ui/src/components/Launcher.tsx
|
|
7802
7734
|
function Mo() {
|
|
7803
7735
|
return /* @__PURE__ */ c("svg", {
|
|
7804
7736
|
width: "24",
|
|
@@ -7841,8 +7773,7 @@ function Po({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat"
|
|
|
7841
7773
|
}) : /* @__PURE__ */ c(Mo, {})
|
|
7842
7774
|
});
|
|
7843
7775
|
}
|
|
7844
|
-
|
|
7845
|
-
//#region ../../packages/widget-ui/src/WidgetApp.tsx
|
|
7776
|
+
// ../../packages/widget-ui/src/WidgetApp.tsx
|
|
7846
7777
|
function Fo({ config: e, state: t, callbacks: n }) {
|
|
7847
7778
|
let i = e.mode === "inline", o = a(null);
|
|
7848
7779
|
return r(() => {
|
|
@@ -7886,8 +7817,7 @@ function Fo({ config: e, state: t, callbacks: n }) {
|
|
|
7886
7817
|
})]
|
|
7887
7818
|
});
|
|
7888
7819
|
}
|
|
7889
|
-
|
|
7890
|
-
//#region ../../packages/widget-ui/src/index.ts
|
|
7820
|
+
// ../../packages/widget-ui/src/index.ts
|
|
7891
7821
|
var Io = (n, r, i, a) => {
|
|
7892
7822
|
let o = e(n);
|
|
7893
7823
|
return o.render(t(Fo, {
|
|
@@ -7912,8 +7842,7 @@ var Io = (n, r, i, a) => {
|
|
|
7912
7842
|
function Lo(e) {
|
|
7913
7843
|
return Oa + "\n" + Ea(e);
|
|
7914
7844
|
}
|
|
7915
|
-
|
|
7916
|
-
//#region src/api.ts
|
|
7845
|
+
// src/api.ts
|
|
7917
7846
|
function Ro(e, t) {
|
|
7918
7847
|
return Lo(gt({
|
|
7919
7848
|
...e,
|
|
@@ -7932,5 +7861,4 @@ function Vo(e, t, n = Io, r) {
|
|
|
7932
7861
|
function Ho(e) {
|
|
7933
7862
|
wa(e);
|
|
7934
7863
|
}
|
|
7935
|
-
//#endregion
|
|
7936
7864
|
export { Oi as ApiClient, To as Composer, Eo as ErrorState, Gi as EventEmitter, Ma as Header, Po as Launcher, Qa as MessageBubble, to as MessageList, $a as TypingIndicator, Fo as WidgetApp, aa as WidgetClient, jo as WidgetShell, Ea as buildThemeVars, Lo as buildWidgetCSS, Xi as clearSession, fa as createFloatingContainer, ca as createShadowHost, _a as createWidget, Ho as destroy, wa as destroyWidget, Ji as getSessionId, zo as init, la as injectStyles, Ta as listWidgets, Bo as mount, Vo as mountFloating, gt as normalizeConfig, ma as prepareInlineContainer, ua as removeShadowHost, Io as renderWidget, Da as resolveThemeMode, Yi as setSessionId, ji as streamChat, Oa as widgetCSS };
|