@bymos/agentkit-sdk 0.7.1 → 0.7.2

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRoot as fa } from "preact/compat/client";
2
2
  import { createElement as qt, useCallback as pa, useEffect as X, useMemo as Mr, useRef as he, useState as ne } from "preact/compat";
3
- import { Fragment as ve, jsx as d, jsxs as y } from "preact/jsx-runtime";
3
+ import { Fragment as ye, jsx as c, jsxs as y } from "preact/jsx-runtime";
4
4
  var A;
5
5
  (function(e) {
6
6
  e.assertEqual = (n) => {
@@ -123,8 +123,8 @@ var _ = A.arrayToEnum([
123
123
  else {
124
124
  let o = a, l = 0;
125
125
  for (; l < s.path.length; ) {
126
- const c = s.path[l];
127
- l !== s.path.length - 1 ? o[c] = o[c] || { _errors: [] } : (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(r(s))), o = o[c], l++;
126
+ const d = s.path[l];
127
+ l !== s.path.length - 1 ? o[d] = o[d] || { _errors: [] } : (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(r(s))), o = o[d], l++;
128
128
  }
129
129
  }
130
130
  };
@@ -228,8 +228,8 @@ var xt = (e) => {
228
228
  message: n.message
229
229
  };
230
230
  let o = "";
231
- const l = a.filter((c) => !!c).slice().reverse();
232
- for (const c of l) o = c(s, {
231
+ const l = a.filter((d) => !!d).slice().reverse();
232
+ for (const d of l) o = d(s, {
233
233
  data: t,
234
234
  defaultError: o
235
235
  }).message;
@@ -266,7 +266,7 @@ var J = class Tr {
266
266
  static mergeArray(t, r) {
267
267
  const a = [];
268
268
  for (const n of r) {
269
- if (n.status === "aborted") return w;
269
+ if (n.status === "aborted") return C;
270
270
  n.status === "dirty" && t.dirty(), a.push(n.value);
271
271
  }
272
272
  return {
@@ -289,7 +289,7 @@ var J = class Tr {
289
289
  const a = {};
290
290
  for (const n of r) {
291
291
  const { key: i, value: s } = n;
292
- if (i.status === "aborted" || s.status === "aborted") return w;
292
+ if (i.status === "aborted" || s.status === "aborted") return C;
293
293
  i.status === "dirty" && t.dirty(), s.status === "dirty" && t.dirty(), i.value !== "__proto__" && (typeof s.value < "u" || n.alwaysSet) && (a[i.value] = s.value);
294
294
  }
295
295
  return {
@@ -297,10 +297,10 @@ var J = class Tr {
297
297
  value: a
298
298
  };
299
299
  }
300
- }, w = Object.freeze({ status: "aborted" }), je = (e) => ({
300
+ }, C = Object.freeze({ status: "aborted" }), je = (e) => ({
301
301
  status: "dirty",
302
302
  value: e
303
- }), U = (e) => ({
303
+ }), B = (e) => ({
304
304
  status: "valid",
305
305
  value: e
306
306
  }), tr = (e) => e.status === "aborted", rr = (e) => e.status === "dirty", Me = (e) => e.status === "valid", Ke = (e) => typeof Promise < "u" && e instanceof Promise, x;
@@ -478,7 +478,7 @@ var L = class {
478
478
  _refinement(e) {
479
479
  return new pe({
480
480
  schema: this,
481
- typeName: S.ZodEffects,
481
+ typeName: I.ZodEffects,
482
482
  effect: {
483
483
  type: "refinement",
484
484
  refinement: e
@@ -520,7 +520,7 @@ var L = class {
520
520
  return new pe({
521
521
  ...E(this._def),
522
522
  schema: this,
523
- typeName: S.ZodEffects,
523
+ typeName: I.ZodEffects,
524
524
  effect: {
525
525
  type: "transform",
526
526
  transform: e
@@ -533,12 +533,12 @@ var L = class {
533
533
  ...E(this._def),
534
534
  innerType: this,
535
535
  defaultValue: t,
536
- typeName: S.ZodDefault
536
+ typeName: I.ZodDefault
537
537
  });
538
538
  }
539
539
  brand() {
540
540
  return new Pr({
541
- typeName: S.ZodBranded,
541
+ typeName: I.ZodBranded,
542
542
  type: this,
543
543
  ...E(this._def)
544
544
  });
@@ -549,7 +549,7 @@ var L = class {
549
549
  ...E(this._def),
550
550
  innerType: this,
551
551
  catchValue: t,
552
- typeName: S.ZodCatch
552
+ typeName: I.ZodCatch
553
553
  });
554
554
  }
555
555
  describe(e) {
@@ -611,7 +611,7 @@ var qe = class Ze extends L {
611
611
  code: m.invalid_type,
612
612
  expected: _.string,
613
613
  received: n.parsedType
614
- }), w;
614
+ }), C;
615
615
  }
616
616
  const r = new J();
617
617
  let a;
@@ -1023,7 +1023,7 @@ var qe = class Ze extends L {
1023
1023
  };
1024
1024
  qe.create = (e) => new qe({
1025
1025
  checks: [],
1026
- typeName: S.ZodString,
1026
+ typeName: I.ZodString,
1027
1027
  coerce: e?.coerce ?? !1,
1028
1028
  ...E(e)
1029
1029
  });
@@ -1042,7 +1042,7 @@ var wt = class St extends L {
1042
1042
  code: m.invalid_type,
1043
1043
  expected: _.number,
1044
1044
  received: n.parsedType
1045
- }), w;
1045
+ }), C;
1046
1046
  }
1047
1047
  let r;
1048
1048
  const a = new J();
@@ -1195,7 +1195,7 @@ var wt = class St extends L {
1195
1195
  };
1196
1196
  wt.create = (e) => new wt({
1197
1197
  checks: [],
1198
- typeName: S.ZodNumber,
1198
+ typeName: I.ZodNumber,
1199
1199
  coerce: e?.coerce || !1,
1200
1200
  ...E(e)
1201
1201
  });
@@ -1240,7 +1240,7 @@ var Ct = class It extends L {
1240
1240
  code: m.invalid_type,
1241
1241
  expected: _.bigint,
1242
1242
  received: r.parsedType
1243
- }), w;
1243
+ }), C;
1244
1244
  }
1245
1245
  gte(t, r) {
1246
1246
  return this.setLimit("min", t, !0, x.toString(r));
@@ -1323,7 +1323,7 @@ var Ct = class It extends L {
1323
1323
  };
1324
1324
  Ct.create = (e) => new Ct({
1325
1325
  checks: [],
1326
- typeName: S.ZodBigInt,
1326
+ typeName: I.ZodBigInt,
1327
1327
  coerce: e?.coerce ?? !1,
1328
1328
  ...E(e)
1329
1329
  });
@@ -1335,13 +1335,13 @@ var Nt = class extends L {
1335
1335
  code: m.invalid_type,
1336
1336
  expected: _.boolean,
1337
1337
  received: t.parsedType
1338
- }), w;
1338
+ }), C;
1339
1339
  }
1340
- return U(e.data);
1340
+ return B(e.data);
1341
1341
  }
1342
1342
  };
1343
1343
  Nt.create = (e) => new Nt({
1344
- typeName: S.ZodBoolean,
1344
+ typeName: I.ZodBoolean,
1345
1345
  coerce: e?.coerce || !1,
1346
1346
  ...E(e)
1347
1347
  });
@@ -1353,10 +1353,10 @@ var Et = class jr extends L {
1353
1353
  code: m.invalid_type,
1354
1354
  expected: _.date,
1355
1355
  received: n.parsedType
1356
- }), w;
1356
+ }), C;
1357
1357
  }
1358
1358
  if (Number.isNaN(t.data.getTime()))
1359
- return b(this._getOrReturnCtx(t), { code: m.invalid_date }), w;
1359
+ return b(this._getOrReturnCtx(t), { code: m.invalid_date }), C;
1360
1360
  const r = new J();
1361
1361
  let a;
1362
1362
  for (const n of this._def.checks) n.kind === "min" ? t.data.getTime() < n.value && (a = this._getOrReturnCtx(t, a), b(a, {
@@ -1413,7 +1413,7 @@ var Et = class jr extends L {
1413
1413
  Et.create = (e) => new Et({
1414
1414
  checks: [],
1415
1415
  coerce: e?.coerce || !1,
1416
- typeName: S.ZodDate,
1416
+ typeName: I.ZodDate,
1417
1417
  ...E(e)
1418
1418
  });
1419
1419
  var Mt = class extends L {
@@ -1424,13 +1424,13 @@ var Mt = class extends L {
1424
1424
  code: m.invalid_type,
1425
1425
  expected: _.symbol,
1426
1426
  received: t.parsedType
1427
- }), w;
1427
+ }), C;
1428
1428
  }
1429
- return U(e.data);
1429
+ return B(e.data);
1430
1430
  }
1431
1431
  };
1432
1432
  Mt.create = (e) => new Mt({
1433
- typeName: S.ZodSymbol,
1433
+ typeName: I.ZodSymbol,
1434
1434
  ...E(e)
1435
1435
  });
1436
1436
  var et = class extends L {
@@ -1441,13 +1441,13 @@ var et = class extends L {
1441
1441
  code: m.invalid_type,
1442
1442
  expected: _.undefined,
1443
1443
  received: t.parsedType
1444
- }), w;
1444
+ }), C;
1445
1445
  }
1446
- return U(e.data);
1446
+ return B(e.data);
1447
1447
  }
1448
1448
  };
1449
1449
  et.create = (e) => new et({
1450
- typeName: S.ZodUndefined,
1450
+ typeName: I.ZodUndefined,
1451
1451
  ...E(e)
1452
1452
  });
1453
1453
  var tt = class extends L {
@@ -1458,13 +1458,13 @@ var tt = class extends L {
1458
1458
  code: m.invalid_type,
1459
1459
  expected: _.null,
1460
1460
  received: t.parsedType
1461
- }), w;
1461
+ }), C;
1462
1462
  }
1463
- return U(e.data);
1463
+ return B(e.data);
1464
1464
  }
1465
1465
  };
1466
1466
  tt.create = (e) => new tt({
1467
- typeName: S.ZodNull,
1467
+ typeName: I.ZodNull,
1468
1468
  ...E(e)
1469
1469
  });
1470
1470
  var Lt = class extends L {
@@ -1472,11 +1472,11 @@ var Lt = class extends L {
1472
1472
  super(...arguments), this._any = !0;
1473
1473
  }
1474
1474
  _parse(e) {
1475
- return U(e.data);
1475
+ return B(e.data);
1476
1476
  }
1477
1477
  };
1478
1478
  Lt.create = (e) => new Lt({
1479
- typeName: S.ZodAny,
1479
+ typeName: I.ZodAny,
1480
1480
  ...E(e)
1481
1481
  });
1482
1482
  var Ne = class extends L {
@@ -1484,25 +1484,25 @@ var Ne = class extends L {
1484
1484
  super(...arguments), this._unknown = !0;
1485
1485
  }
1486
1486
  _parse(e) {
1487
- return U(e.data);
1487
+ return B(e.data);
1488
1488
  }
1489
1489
  };
1490
1490
  Ne.create = (e) => new Ne({
1491
- typeName: S.ZodUnknown,
1491
+ typeName: I.ZodUnknown,
1492
1492
  ...E(e)
1493
1493
  });
1494
- var ke = class extends L {
1494
+ var ve = class extends L {
1495
1495
  _parse(e) {
1496
1496
  const t = this._getOrReturnCtx(e);
1497
1497
  return b(t, {
1498
1498
  code: m.invalid_type,
1499
1499
  expected: _.never,
1500
1500
  received: t.parsedType
1501
- }), w;
1501
+ }), C;
1502
1502
  }
1503
1503
  };
1504
- ke.create = (e) => new ke({
1505
- typeName: S.ZodNever,
1504
+ ve.create = (e) => new ve({
1505
+ typeName: I.ZodNever,
1506
1506
  ...E(e)
1507
1507
  });
1508
1508
  var Tt = class extends L {
@@ -1513,13 +1513,13 @@ var Tt = class extends L {
1513
1513
  code: m.invalid_type,
1514
1514
  expected: _.void,
1515
1515
  received: t.parsedType
1516
- }), w;
1516
+ }), C;
1517
1517
  }
1518
- return U(e.data);
1518
+ return B(e.data);
1519
1519
  }
1520
1520
  };
1521
1521
  Tt.create = (e) => new Tt({
1522
- typeName: S.ZodVoid,
1522
+ typeName: I.ZodVoid,
1523
1523
  ...E(e)
1524
1524
  });
1525
1525
  var Le = class Xe extends L {
@@ -1530,7 +1530,7 @@ var Le = class Xe extends L {
1530
1530
  code: m.invalid_type,
1531
1531
  expected: _.array,
1532
1532
  received: r.parsedType
1533
- }), w;
1533
+ }), C;
1534
1534
  if (n.exactLength !== null) {
1535
1535
  const s = r.data.length > n.exactLength.value, o = r.data.length < n.exactLength.value;
1536
1536
  (s || o) && (b(r, {
@@ -1600,7 +1600,7 @@ Le.create = (e, t) => new Le({
1600
1600
  minLength: null,
1601
1601
  maxLength: null,
1602
1602
  exactLength: null,
1603
- typeName: S.ZodArray,
1603
+ typeName: I.ZodArray,
1604
1604
  ...E(t)
1605
1605
  });
1606
1606
  function Ie(e) {
@@ -1638,33 +1638,33 @@ var te = class q extends L {
1638
1638
  code: m.invalid_type,
1639
1639
  expected: _.object,
1640
1640
  received: l.parsedType
1641
- }), w;
1641
+ }), C;
1642
1642
  }
1643
1643
  const { status: r, ctx: a } = this._processInputParams(t), { shape: n, keys: i } = this._getCached(), s = [];
1644
- if (!(this._def.catchall instanceof ke && this._def.unknownKeys === "strip"))
1644
+ if (!(this._def.catchall instanceof ve && this._def.unknownKeys === "strip"))
1645
1645
  for (const l in a.data) i.includes(l) || s.push(l);
1646
1646
  const o = [];
1647
1647
  for (const l of i) {
1648
- const c = n[l], u = a.data[l];
1648
+ const d = n[l], h = a.data[l];
1649
1649
  o.push({
1650
1650
  key: {
1651
1651
  status: "valid",
1652
1652
  value: l
1653
1653
  },
1654
- value: c._parse(new se(a, u, a.path, l)),
1654
+ value: d._parse(new se(a, h, a.path, l)),
1655
1655
  alwaysSet: l in a.data
1656
1656
  });
1657
1657
  }
1658
- if (this._def.catchall instanceof ke) {
1658
+ if (this._def.catchall instanceof ve) {
1659
1659
  const l = this._def.unknownKeys;
1660
- if (l === "passthrough") for (const c of s) o.push({
1660
+ if (l === "passthrough") for (const d of s) o.push({
1661
1661
  key: {
1662
1662
  status: "valid",
1663
- value: c
1663
+ value: d
1664
1664
  },
1665
1665
  value: {
1666
1666
  status: "valid",
1667
- value: a.data[c]
1667
+ value: a.data[d]
1668
1668
  }
1669
1669
  });
1670
1670
  else if (l === "strict")
@@ -1676,26 +1676,26 @@ var te = class q extends L {
1676
1676
  throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1677
1677
  } else {
1678
1678
  const l = this._def.catchall;
1679
- for (const c of s) {
1680
- const u = a.data[c];
1679
+ for (const d of s) {
1680
+ const h = a.data[d];
1681
1681
  o.push({
1682
1682
  key: {
1683
1683
  status: "valid",
1684
- value: c
1684
+ value: d
1685
1685
  },
1686
- value: l._parse(new se(a, u, a.path, c)),
1687
- alwaysSet: c in a.data
1686
+ value: l._parse(new se(a, h, a.path, d)),
1687
+ alwaysSet: d in a.data
1688
1688
  });
1689
1689
  }
1690
1690
  }
1691
1691
  return a.common.async ? Promise.resolve().then(async () => {
1692
1692
  const l = [];
1693
- for (const c of o) {
1694
- const u = await c.key, h = await c.value;
1693
+ for (const d of o) {
1694
+ const h = await d.key, u = await d.value;
1695
1695
  l.push({
1696
- key: u,
1697
- value: h,
1698
- alwaysSet: c.alwaysSet
1696
+ key: h,
1697
+ value: u,
1698
+ alwaysSet: d.alwaysSet
1699
1699
  });
1700
1700
  }
1701
1701
  return l;
@@ -1743,7 +1743,7 @@ var te = class q extends L {
1743
1743
  ...this._def.shape(),
1744
1744
  ...t._def.shape()
1745
1745
  }),
1746
- typeName: S.ZodObject
1746
+ typeName: I.ZodObject
1747
1747
  });
1748
1748
  }
1749
1749
  setKey(t, r) {
@@ -1805,22 +1805,22 @@ var te = class q extends L {
1805
1805
  te.create = (e, t) => new te({
1806
1806
  shape: () => e,
1807
1807
  unknownKeys: "strip",
1808
- catchall: ke.create(),
1809
- typeName: S.ZodObject,
1808
+ catchall: ve.create(),
1809
+ typeName: I.ZodObject,
1810
1810
  ...E(t)
1811
1811
  });
1812
1812
  te.strictCreate = (e, t) => new te({
1813
1813
  shape: () => e,
1814
1814
  unknownKeys: "strict",
1815
- catchall: ke.create(),
1816
- typeName: S.ZodObject,
1815
+ catchall: ve.create(),
1816
+ typeName: I.ZodObject,
1817
1817
  ...E(t)
1818
1818
  });
1819
1819
  te.lazycreate = (e, t) => new te({
1820
1820
  shape: e,
1821
1821
  unknownKeys: "strip",
1822
- catchall: ke.create(),
1823
- typeName: S.ZodObject,
1822
+ catchall: ve.create(),
1823
+ typeName: I.ZodObject,
1824
1824
  ...E(t)
1825
1825
  });
1826
1826
  var rt = class extends L {
@@ -1834,7 +1834,7 @@ var rt = class extends L {
1834
1834
  return b(t, {
1835
1835
  code: m.invalid_union,
1836
1836
  unionErrors: i
1837
- }), w;
1837
+ }), C;
1838
1838
  }
1839
1839
  if (t.common.async) return Promise.all(r.map(async (n) => {
1840
1840
  const i = {
@@ -1865,14 +1865,14 @@ var rt = class extends L {
1865
1865
  issues: []
1866
1866
  },
1867
1867
  parent: null
1868
- }, c = o._parseSync({
1868
+ }, d = o._parseSync({
1869
1869
  data: t.data,
1870
1870
  path: t.path,
1871
1871
  parent: l
1872
1872
  });
1873
- if (c.status === "valid") return c;
1874
- c.status === "dirty" && !n && (n = {
1875
- result: c,
1873
+ if (d.status === "valid") return d;
1874
+ d.status === "dirty" && !n && (n = {
1875
+ result: d,
1876
1876
  ctx: l
1877
1877
  }), l.common.issues.length && i.push(l.common.issues);
1878
1878
  }
@@ -1882,7 +1882,7 @@ var rt = class extends L {
1882
1882
  return b(t, {
1883
1883
  code: m.invalid_union,
1884
1884
  unionErrors: s
1885
- }), w;
1885
+ }), C;
1886
1886
  }
1887
1887
  }
1888
1888
  get options() {
@@ -1891,7 +1891,7 @@ var rt = class extends L {
1891
1891
  };
1892
1892
  rt.create = (e, t) => new rt({
1893
1893
  options: e,
1894
- typeName: S.ZodUnion,
1894
+ typeName: I.ZodUnion,
1895
1895
  ...E(t)
1896
1896
  });
1897
1897
  var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerType()) : e instanceof it ? [e.value] : e instanceof ft ? e.options : e instanceof st ? A.objectValues(e.enum) : e instanceof ot ? de(e._def.innerType) : e instanceof et ? [void 0] : e instanceof tt ? [null] : e instanceof fe ? [void 0, ...de(e.unwrap())] : e instanceof _e ? [null, ...de(e.unwrap())] : e instanceof Pr || e instanceof ct ? de(e.unwrap()) : e instanceof lt ? de(e._def.innerType) : [], Pa = class Zr extends L {
@@ -1902,7 +1902,7 @@ var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerTyp
1902
1902
  code: m.invalid_type,
1903
1903
  expected: _.object,
1904
1904
  received: r.parsedType
1905
- }), w;
1905
+ }), C;
1906
1906
  const a = this.discriminator, n = r.data[a], i = this.optionsMap.get(n);
1907
1907
  return i ? r.common.async ? i._parseAsync({
1908
1908
  data: r.data,
@@ -1916,7 +1916,7 @@ var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerTyp
1916
1916
  code: m.invalid_union_discriminator,
1917
1917
  options: Array.from(this.optionsMap.keys()),
1918
1918
  path: [a]
1919
- }), w);
1919
+ }), C);
1920
1920
  }
1921
1921
  get discriminator() {
1922
1922
  return this._def.discriminator;
@@ -1938,7 +1938,7 @@ var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerTyp
1938
1938
  }
1939
1939
  }
1940
1940
  return new Zr({
1941
- typeName: S.ZodDiscriminatedUnion,
1941
+ typeName: I.ZodDiscriminatedUnion,
1942
1942
  discriminator: t,
1943
1943
  options: r,
1944
1944
  optionsMap: n,
@@ -1986,12 +1986,12 @@ function At(e, t) {
1986
1986
  var at = class extends L {
1987
1987
  _parse(e) {
1988
1988
  const { status: t, ctx: r } = this._processInputParams(e), a = (n, i) => {
1989
- if (tr(n) || tr(i)) return w;
1989
+ if (tr(n) || tr(i)) return C;
1990
1990
  const s = At(n.value, i.value);
1991
1991
  return s.valid ? ((rr(n) || rr(i)) && t.dirty(), {
1992
1992
  status: t.value,
1993
1993
  value: s.data
1994
- }) : (b(r, { code: m.invalid_intersection_types }), w);
1994
+ }) : (b(r, { code: m.invalid_intersection_types }), C);
1995
1995
  };
1996
1996
  return r.common.async ? Promise.all([this._def.left._parseAsync({
1997
1997
  data: r.data,
@@ -2015,7 +2015,7 @@ var at = class extends L {
2015
2015
  at.create = (e, t, r) => new at({
2016
2016
  left: e,
2017
2017
  right: t,
2018
- typeName: S.ZodIntersection,
2018
+ typeName: I.ZodIntersection,
2019
2019
  ...E(r)
2020
2020
  });
2021
2021
  var be = class Or extends L {
@@ -2026,7 +2026,7 @@ var be = class Or extends L {
2026
2026
  code: m.invalid_type,
2027
2027
  expected: _.array,
2028
2028
  received: a.parsedType
2029
- }), w;
2029
+ }), C;
2030
2030
  if (a.data.length < this._def.items.length)
2031
2031
  return b(a, {
2032
2032
  code: m.too_small,
@@ -2034,7 +2034,7 @@ var be = class Or extends L {
2034
2034
  inclusive: !0,
2035
2035
  exact: !1,
2036
2036
  type: "array"
2037
- }), w;
2037
+ }), C;
2038
2038
  !this._def.rest && a.data.length > this._def.items.length && (b(a, {
2039
2039
  code: m.too_big,
2040
2040
  maximum: this._def.items.length,
@@ -2062,7 +2062,7 @@ be.create = (e, t) => {
2062
2062
  if (!Array.isArray(e)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2063
2063
  return new be({
2064
2064
  items: e,
2065
- typeName: S.ZodTuple,
2065
+ typeName: I.ZodTuple,
2066
2066
  rest: null,
2067
2067
  ...E(t)
2068
2068
  });
@@ -2081,7 +2081,7 @@ var $a = class Rt extends L {
2081
2081
  code: m.invalid_type,
2082
2082
  expected: _.object,
2083
2083
  received: a.parsedType
2084
- }), w;
2084
+ }), C;
2085
2085
  const n = [], i = this._def.keyType, s = this._def.valueType;
2086
2086
  for (const o in a.data) n.push({
2087
2087
  key: i._parse(new se(a, o, a.path, o)),
@@ -2097,12 +2097,12 @@ var $a = class Rt extends L {
2097
2097
  return r instanceof L ? new Rt({
2098
2098
  keyType: t,
2099
2099
  valueType: r,
2100
- typeName: S.ZodRecord,
2100
+ typeName: I.ZodRecord,
2101
2101
  ...E(a)
2102
2102
  }) : new Rt({
2103
2103
  keyType: qe.create(),
2104
2104
  valueType: t,
2105
- typeName: S.ZodRecord,
2105
+ typeName: I.ZodRecord,
2106
2106
  ...E(r)
2107
2107
  });
2108
2108
  }
@@ -2120,7 +2120,7 @@ var $a = class Rt extends L {
2120
2120
  code: m.invalid_type,
2121
2121
  expected: _.map,
2122
2122
  received: r.parsedType
2123
- }), w;
2123
+ }), C;
2124
2124
  const a = this._def.keyType, n = this._def.valueType, i = [...r.data.entries()].map(([s, o], l) => ({
2125
2125
  key: a._parse(new se(r, s, r.path, [l, "key"])),
2126
2126
  value: n._parse(new se(r, o, r.path, [l, "value"]))
@@ -2129,9 +2129,9 @@ var $a = class Rt extends L {
2129
2129
  const s = /* @__PURE__ */ new Map();
2130
2130
  return Promise.resolve().then(async () => {
2131
2131
  for (const o of i) {
2132
- const l = await o.key, c = await o.value;
2133
- if (l.status === "aborted" || c.status === "aborted") return w;
2134
- (l.status === "dirty" || c.status === "dirty") && t.dirty(), s.set(l.value, c.value);
2132
+ const l = await o.key, d = await o.value;
2133
+ if (l.status === "aborted" || d.status === "aborted") return C;
2134
+ (l.status === "dirty" || d.status === "dirty") && t.dirty(), s.set(l.value, d.value);
2135
2135
  }
2136
2136
  return {
2137
2137
  status: t.value,
@@ -2141,9 +2141,9 @@ var $a = class Rt extends L {
2141
2141
  } else {
2142
2142
  const s = /* @__PURE__ */ new Map();
2143
2143
  for (const o of i) {
2144
- const l = o.key, c = o.value;
2145
- if (l.status === "aborted" || c.status === "aborted") return w;
2146
- (l.status === "dirty" || c.status === "dirty") && t.dirty(), s.set(l.value, c.value);
2144
+ const l = o.key, d = o.value;
2145
+ if (l.status === "aborted" || d.status === "aborted") return C;
2146
+ (l.status === "dirty" || d.status === "dirty") && t.dirty(), s.set(l.value, d.value);
2147
2147
  }
2148
2148
  return {
2149
2149
  status: t.value,
@@ -2155,7 +2155,7 @@ var $a = class Rt extends L {
2155
2155
  jt.create = (e, t, r) => new jt({
2156
2156
  valueType: t,
2157
2157
  keyType: e,
2158
- typeName: S.ZodMap,
2158
+ typeName: I.ZodMap,
2159
2159
  ...E(r)
2160
2160
  });
2161
2161
  var Zt = class Ot extends L {
@@ -2166,7 +2166,7 @@ var Zt = class Ot extends L {
2166
2166
  code: m.invalid_type,
2167
2167
  expected: _.set,
2168
2168
  received: a.parsedType
2169
- }), w;
2169
+ }), C;
2170
2170
  const n = this._def;
2171
2171
  n.minSize !== null && a.data.size < n.minSize.value && (b(a, {
2172
2172
  code: m.too_small,
@@ -2185,17 +2185,17 @@ var Zt = class Ot extends L {
2185
2185
  }), r.dirty());
2186
2186
  const i = this._def.valueType;
2187
2187
  function s(l) {
2188
- const c = /* @__PURE__ */ new Set();
2189
- for (const u of l) {
2190
- if (u.status === "aborted") return w;
2191
- u.status === "dirty" && r.dirty(), c.add(u.value);
2188
+ const d = /* @__PURE__ */ new Set();
2189
+ for (const h of l) {
2190
+ if (h.status === "aborted") return C;
2191
+ h.status === "dirty" && r.dirty(), d.add(h.value);
2192
2192
  }
2193
2193
  return {
2194
2194
  status: r.value,
2195
- value: c
2195
+ value: d
2196
2196
  };
2197
2197
  }
2198
- const o = [...a.data.values()].map((l, c) => i._parse(new se(a, l, a.path, c)));
2198
+ const o = [...a.data.values()].map((l, d) => i._parse(new se(a, l, a.path, d)));
2199
2199
  return a.common.async ? Promise.all(o).then((l) => s(l)) : s(o);
2200
2200
  }
2201
2201
  min(t, r) {
@@ -2227,7 +2227,7 @@ Zt.create = (e, t) => new Zt({
2227
2227
  valueType: e,
2228
2228
  minSize: null,
2229
2229
  maxSize: null,
2230
- typeName: S.ZodSet,
2230
+ typeName: I.ZodSet,
2231
2231
  ...E(t)
2232
2232
  });
2233
2233
  var Va = class Je extends L {
@@ -2241,7 +2241,7 @@ var Va = class Je extends L {
2241
2241
  code: m.invalid_type,
2242
2242
  expected: _.function,
2243
2243
  received: r.parsedType
2244
- }), w;
2244
+ }), C;
2245
2245
  function a(o, l) {
2246
2246
  return xt({
2247
2247
  data: o,
@@ -2251,7 +2251,7 @@ var Va = class Je extends L {
2251
2251
  r.schemaErrorMap,
2252
2252
  _t(),
2253
2253
  Oe
2254
- ].filter((c) => !!c),
2254
+ ].filter((d) => !!d),
2255
2255
  issueData: {
2256
2256
  code: m.invalid_arguments,
2257
2257
  argumentsError: l
@@ -2267,7 +2267,7 @@ var Va = class Je extends L {
2267
2267
  r.schemaErrorMap,
2268
2268
  _t(),
2269
2269
  Oe
2270
- ].filter((c) => !!c),
2270
+ ].filter((d) => !!d),
2271
2271
  issueData: {
2272
2272
  code: m.invalid_return_type,
2273
2273
  returnTypeError: l
@@ -2277,22 +2277,22 @@ var Va = class Je extends L {
2277
2277
  const i = { errorMap: r.common.contextualErrorMap }, s = r.data;
2278
2278
  if (this._def.returns instanceof Fe) {
2279
2279
  const o = this;
2280
- return U(async function(...l) {
2281
- const c = new ie([]), u = await o._def.args.parseAsync(l, i).catch((p) => {
2282
- throw c.addIssue(a(l, p)), c;
2283
- }), h = await Reflect.apply(s, this, u);
2284
- return await o._def.returns._def.type.parseAsync(h, i).catch((p) => {
2285
- throw c.addIssue(n(h, p)), c;
2280
+ return B(async function(...l) {
2281
+ const d = new ie([]), h = await o._def.args.parseAsync(l, i).catch((p) => {
2282
+ throw d.addIssue(a(l, p)), d;
2283
+ }), u = await Reflect.apply(s, this, h);
2284
+ return await o._def.returns._def.type.parseAsync(u, i).catch((p) => {
2285
+ throw d.addIssue(n(u, p)), d;
2286
2286
  });
2287
2287
  });
2288
2288
  } else {
2289
2289
  const o = this;
2290
- return U(function(...l) {
2291
- const c = o._def.args.safeParse(l, i);
2292
- if (!c.success) throw new ie([a(l, c.error)]);
2293
- const u = Reflect.apply(s, this, c.data), h = o._def.returns.safeParse(u, i);
2294
- if (!h.success) throw new ie([n(u, h.error)]);
2295
- return h.data;
2290
+ return B(function(...l) {
2291
+ const d = o._def.args.safeParse(l, i);
2292
+ if (!d.success) throw new ie([a(l, d.error)]);
2293
+ const h = Reflect.apply(s, this, d.data), u = o._def.returns.safeParse(h, i);
2294
+ if (!u.success) throw new ie([n(h, u.error)]);
2295
+ return u.data;
2296
2296
  });
2297
2297
  }
2298
2298
  }
@@ -2324,7 +2324,7 @@ var Va = class Je extends L {
2324
2324
  return new Je({
2325
2325
  args: t || be.create([]).rest(Ne.create()),
2326
2326
  returns: r || Ne.create(),
2327
- typeName: S.ZodFunction,
2327
+ typeName: I.ZodFunction,
2328
2328
  ...E(a)
2329
2329
  });
2330
2330
  }
@@ -2343,7 +2343,7 @@ var Va = class Je extends L {
2343
2343
  };
2344
2344
  nt.create = (e, t) => new nt({
2345
2345
  getter: e,
2346
- typeName: S.ZodLazy,
2346
+ typeName: I.ZodLazy,
2347
2347
  ...E(t)
2348
2348
  });
2349
2349
  var it = class extends L {
@@ -2354,7 +2354,7 @@ var it = class extends L {
2354
2354
  received: t.data,
2355
2355
  code: m.invalid_literal,
2356
2356
  expected: this._def.value
2357
- }), w;
2357
+ }), C;
2358
2358
  }
2359
2359
  return {
2360
2360
  status: "valid",
@@ -2367,13 +2367,13 @@ var it = class extends L {
2367
2367
  };
2368
2368
  it.create = (e, t) => new it({
2369
2369
  value: e,
2370
- typeName: S.ZodLiteral,
2370
+ typeName: I.ZodLiteral,
2371
2371
  ...E(t)
2372
2372
  });
2373
2373
  function Fr(e, t) {
2374
2374
  return new ft({
2375
2375
  values: e,
2376
- typeName: S.ZodEnum,
2376
+ typeName: I.ZodEnum,
2377
2377
  ...E(t)
2378
2378
  });
2379
2379
  }
@@ -2385,7 +2385,7 @@ var ft = class Ft extends L {
2385
2385
  expected: A.joinValues(a),
2386
2386
  received: r.parsedType,
2387
2387
  code: m.invalid_type
2388
- }), w;
2388
+ }), C;
2389
2389
  }
2390
2390
  if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(t.data)) {
2391
2391
  const r = this._getOrReturnCtx(t), a = this._def.values;
@@ -2393,9 +2393,9 @@ var ft = class Ft extends L {
2393
2393
  received: r.data,
2394
2394
  code: m.invalid_enum_value,
2395
2395
  options: a
2396
- }), w;
2396
+ }), C;
2397
2397
  }
2398
- return U(t.data);
2398
+ return B(t.data);
2399
2399
  }
2400
2400
  get options() {
2401
2401
  return this._def.values;
@@ -2438,7 +2438,7 @@ var st = class extends L {
2438
2438
  expected: A.joinValues(a),
2439
2439
  received: r.parsedType,
2440
2440
  code: m.invalid_type
2441
- }), w;
2441
+ }), C;
2442
2442
  }
2443
2443
  if (this._cache || (this._cache = new Set(A.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2444
2444
  const a = A.objectValues(t);
@@ -2446,9 +2446,9 @@ var st = class extends L {
2446
2446
  received: r.data,
2447
2447
  code: m.invalid_enum_value,
2448
2448
  options: a
2449
- }), w;
2449
+ }), C;
2450
2450
  }
2451
- return U(e.data);
2451
+ return B(e.data);
2452
2452
  }
2453
2453
  get enum() {
2454
2454
  return this._def.values;
@@ -2456,7 +2456,7 @@ var st = class extends L {
2456
2456
  };
2457
2457
  st.create = (e, t) => new st({
2458
2458
  values: e,
2459
- typeName: S.ZodNativeEnum,
2459
+ typeName: I.ZodNativeEnum,
2460
2460
  ...E(t)
2461
2461
  });
2462
2462
  var Fe = class extends L {
@@ -2469,7 +2469,7 @@ var Fe = class extends L {
2469
2469
  code: m.invalid_type,
2470
2470
  expected: _.promise,
2471
2471
  received: t.parsedType
2472
- }), w) : U((t.parsedType === _.promise ? t.data : Promise.resolve(t.data)).then((r) => this._def.type.parseAsync(r, {
2472
+ }), C) : B((t.parsedType === _.promise ? t.data : Promise.resolve(t.data)).then((r) => this._def.type.parseAsync(r, {
2473
2473
  path: t.path,
2474
2474
  errorMap: t.common.contextualErrorMap
2475
2475
  })));
@@ -2477,7 +2477,7 @@ var Fe = class extends L {
2477
2477
  };
2478
2478
  Fe.create = (e, t) => new Fe({
2479
2479
  type: e,
2480
- typeName: S.ZodPromise,
2480
+ typeName: I.ZodPromise,
2481
2481
  ...E(t)
2482
2482
  });
2483
2483
  var pe = class extends L {
@@ -2485,7 +2485,7 @@ var pe = class extends L {
2485
2485
  return this._def.schema;
2486
2486
  }
2487
2487
  sourceType() {
2488
- return this._def.schema._def.typeName === S.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2488
+ return this._def.schema._def.typeName === I.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2489
2489
  }
2490
2490
  _parse(e) {
2491
2491
  const { status: t, ctx: r } = this._processInputParams(e), a = this._def.effect || null, n = {
@@ -2499,22 +2499,22 @@ var pe = class extends L {
2499
2499
  if (n.addIssue = n.addIssue.bind(n), a.type === "preprocess") {
2500
2500
  const i = a.transform(r.data, n);
2501
2501
  if (r.common.async) return Promise.resolve(i).then(async (s) => {
2502
- if (t.value === "aborted") return w;
2502
+ if (t.value === "aborted") return C;
2503
2503
  const o = await this._def.schema._parseAsync({
2504
2504
  data: s,
2505
2505
  path: r.path,
2506
2506
  parent: r
2507
2507
  });
2508
- return o.status === "aborted" ? w : o.status === "dirty" || t.value === "dirty" ? je(o.value) : o;
2508
+ return o.status === "aborted" ? C : o.status === "dirty" || t.value === "dirty" ? je(o.value) : o;
2509
2509
  });
2510
2510
  {
2511
- if (t.value === "aborted") return w;
2511
+ if (t.value === "aborted") return C;
2512
2512
  const s = this._def.schema._parseSync({
2513
2513
  data: i,
2514
2514
  path: r.path,
2515
2515
  parent: r
2516
2516
  });
2517
- return s.status === "aborted" ? w : s.status === "dirty" || t.value === "dirty" ? je(s.value) : s;
2517
+ return s.status === "aborted" ? C : s.status === "dirty" || t.value === "dirty" ? je(s.value) : s;
2518
2518
  }
2519
2519
  }
2520
2520
  if (a.type === "refinement") {
@@ -2530,7 +2530,7 @@ var pe = class extends L {
2530
2530
  path: r.path,
2531
2531
  parent: r
2532
2532
  });
2533
- return s.status === "aborted" ? w : (s.status === "dirty" && t.dirty(), i(s.value), {
2533
+ return s.status === "aborted" ? C : (s.status === "dirty" && t.dirty(), i(s.value), {
2534
2534
  status: t.value,
2535
2535
  value: s.value
2536
2536
  });
@@ -2538,7 +2538,7 @@ var pe = class extends L {
2538
2538
  data: r.data,
2539
2539
  path: r.path,
2540
2540
  parent: r
2541
- }).then((s) => s.status === "aborted" ? w : (s.status === "dirty" && t.dirty(), i(s.value).then(() => ({
2541
+ }).then((s) => s.status === "aborted" ? C : (s.status === "dirty" && t.dirty(), i(s.value).then(() => ({
2542
2542
  status: t.value,
2543
2543
  value: s.value
2544
2544
  }))));
@@ -2549,7 +2549,7 @@ var pe = class extends L {
2549
2549
  path: r.path,
2550
2550
  parent: r
2551
2551
  });
2552
- if (!Me(i)) return w;
2552
+ if (!Me(i)) return C;
2553
2553
  const s = a.transform(i.value, n);
2554
2554
  if (s instanceof Promise) throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2555
2555
  return {
@@ -2563,13 +2563,13 @@ var pe = class extends L {
2563
2563
  }).then((i) => Me(i) ? Promise.resolve(a.transform(i.value, n)).then((s) => ({
2564
2564
  status: t.value,
2565
2565
  value: s
2566
- })) : w);
2566
+ })) : C);
2567
2567
  A.assertNever(a);
2568
2568
  }
2569
2569
  };
2570
2570
  pe.create = (e, t, r) => new pe({
2571
2571
  schema: e,
2572
- typeName: S.ZodEffects,
2572
+ typeName: I.ZodEffects,
2573
2573
  effect: t,
2574
2574
  ...E(r)
2575
2575
  });
@@ -2579,12 +2579,12 @@ pe.createWithPreprocess = (e, t, r) => new pe({
2579
2579
  type: "preprocess",
2580
2580
  transform: e
2581
2581
  },
2582
- typeName: S.ZodEffects,
2582
+ typeName: I.ZodEffects,
2583
2583
  ...E(r)
2584
2584
  });
2585
2585
  var fe = class extends L {
2586
2586
  _parse(e) {
2587
- return this._getType(e) === _.undefined ? U(void 0) : this._def.innerType._parse(e);
2587
+ return this._getType(e) === _.undefined ? B(void 0) : this._def.innerType._parse(e);
2588
2588
  }
2589
2589
  unwrap() {
2590
2590
  return this._def.innerType;
@@ -2592,12 +2592,12 @@ var fe = class extends L {
2592
2592
  };
2593
2593
  fe.create = (e, t) => new fe({
2594
2594
  innerType: e,
2595
- typeName: S.ZodOptional,
2595
+ typeName: I.ZodOptional,
2596
2596
  ...E(t)
2597
2597
  });
2598
2598
  var _e = class extends L {
2599
2599
  _parse(e) {
2600
- return this._getType(e) === _.null ? U(null) : this._def.innerType._parse(e);
2600
+ return this._getType(e) === _.null ? B(null) : this._def.innerType._parse(e);
2601
2601
  }
2602
2602
  unwrap() {
2603
2603
  return this._def.innerType;
@@ -2605,7 +2605,7 @@ var _e = class extends L {
2605
2605
  };
2606
2606
  _e.create = (e, t) => new _e({
2607
2607
  innerType: e,
2608
- typeName: S.ZodNullable,
2608
+ typeName: I.ZodNullable,
2609
2609
  ...E(t)
2610
2610
  });
2611
2611
  var ot = class extends L {
@@ -2624,7 +2624,7 @@ var ot = class extends L {
2624
2624
  };
2625
2625
  ot.create = (e, t) => new ot({
2626
2626
  innerType: e,
2627
- typeName: S.ZodDefault,
2627
+ typeName: I.ZodDefault,
2628
2628
  defaultValue: typeof t.default == "function" ? t.default : () => t.default,
2629
2629
  ...E(t)
2630
2630
  });
@@ -2665,7 +2665,7 @@ var lt = class extends L {
2665
2665
  };
2666
2666
  lt.create = (e, t) => new lt({
2667
2667
  innerType: e,
2668
- typeName: S.ZodCatch,
2668
+ typeName: I.ZodCatch,
2669
2669
  catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
2670
2670
  ...E(t)
2671
2671
  });
@@ -2677,7 +2677,7 @@ var Pt = class extends L {
2677
2677
  code: m.invalid_type,
2678
2678
  expected: _.nan,
2679
2679
  received: t.parsedType
2680
- }), w;
2680
+ }), C;
2681
2681
  }
2682
2682
  return {
2683
2683
  status: "valid",
@@ -2686,7 +2686,7 @@ var Pt = class extends L {
2686
2686
  }
2687
2687
  };
2688
2688
  Pt.create = (e) => new Pt({
2689
- typeName: S.ZodNaN,
2689
+ typeName: I.ZodNaN,
2690
2690
  ...E(e)
2691
2691
  });
2692
2692
  var Pr = class extends L {
@@ -2711,7 +2711,7 @@ var Pr = class extends L {
2711
2711
  path: a.path,
2712
2712
  parent: a
2713
2713
  });
2714
- return i.status === "aborted" ? w : i.status === "dirty" ? (r.dirty(), je(i.value)) : this._def.out._parseAsync({
2714
+ return i.status === "aborted" ? C : i.status === "dirty" ? (r.dirty(), je(i.value)) : this._def.out._parseAsync({
2715
2715
  data: i.value,
2716
2716
  path: a.path,
2717
2717
  parent: a
@@ -2723,7 +2723,7 @@ var Pr = class extends L {
2723
2723
  path: a.path,
2724
2724
  parent: a
2725
2725
  });
2726
- return n.status === "aborted" ? w : n.status === "dirty" ? (r.dirty(), {
2726
+ return n.status === "aborted" ? C : n.status === "dirty" ? (r.dirty(), {
2727
2727
  status: "dirty",
2728
2728
  value: n.value
2729
2729
  }) : this._def.out._parseSync({
@@ -2737,7 +2737,7 @@ var Pr = class extends L {
2737
2737
  return new Vr({
2738
2738
  in: t,
2739
2739
  out: r,
2740
- typeName: S.ZodPipeline
2740
+ typeName: I.ZodPipeline
2741
2741
  });
2742
2742
  }
2743
2743
  }, ct = class extends L {
@@ -2751,38 +2751,38 @@ var Pr = class extends L {
2751
2751
  };
2752
2752
  ct.create = (e, t) => new ct({
2753
2753
  innerType: e,
2754
- typeName: S.ZodReadonly,
2754
+ typeName: I.ZodReadonly,
2755
2755
  ...E(t)
2756
2756
  });
2757
- var xo = { object: te.lazycreate }, S;
2757
+ var wo = { object: te.lazycreate }, I;
2758
2758
  (function(e) {
2759
2759
  e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
2760
- })(S || (S = {}));
2761
- var z = qe.create, wo = wt.create, So = Pt.create, Co = Ct.create, vt = Nt.create, Io = Et.create, No = Mt.create, Eo = et.create, Mo = tt.create, Lo = Lt.create, za = Ne.create, To = ke.create, Ao = Tt.create, Ro = Le.create, Dt = te.create, jo = te.strictCreate, Zo = rt.create, Oo = Pa.create, Fo = at.create, Po = be.create, Wa = $a.create, $o = jt.create, Vo = Zt.create, zo = Va.create, Wo = nt.create, Do = it.create, $t = ft.create, Uo = st.create, Bo = Fe.create, Go = pe.create, Ho = fe.create, Yo = _e.create, Xo = pe.createWithPreprocess, Jo = $r.create, Da = Dt({
2760
+ })(I || (I = {}));
2761
+ var W = qe.create, So = wt.create, Co = Pt.create, Io = Ct.create, vt = Nt.create, No = Et.create, Eo = Mt.create, Mo = et.create, Lo = tt.create, To = Lt.create, za = Ne.create, Ao = ve.create, Ro = Tt.create, jo = Le.create, Dt = te.create, Zo = te.strictCreate, Oo = rt.create, Fo = Pa.create, Po = at.create, $o = be.create, Wa = $a.create, Vo = jt.create, zo = Zt.create, Wo = Va.create, Do = nt.create, Uo = it.create, $t = ft.create, Bo = st.create, Go = Fe.create, Ho = pe.create, Yo = fe.create, Xo = _e.create, Jo = pe.createWithPreprocess, Qo = $r.create, Da = Dt({
2762
2762
  mode: $t([
2763
2763
  "light",
2764
2764
  "dark",
2765
2765
  "system"
2766
2766
  ]).optional(),
2767
- accentColor: z().optional(),
2768
- fontFamily: z().optional(),
2769
- borderRadius: z().optional()
2767
+ accentColor: W().optional(),
2768
+ fontFamily: W().optional(),
2769
+ borderRadius: W().optional()
2770
2770
  }), Ua = Dt({
2771
- externalId: z().optional(),
2772
- authId: z().optional(),
2773
- name: z().optional(),
2774
- email: z().optional()
2771
+ externalId: W().optional(),
2772
+ authId: W().optional(),
2773
+ name: W().optional(),
2774
+ email: W().optional()
2775
2775
  }), zr = Dt({
2776
- agentId: z().min(1, "agentId is required"),
2777
- apiBaseUrl: z().url("apiBaseUrl must be a valid URL"),
2778
- tenantId: z().optional(),
2776
+ agentId: W().min(1, "agentId is required"),
2777
+ apiBaseUrl: W().url("apiBaseUrl must be a valid URL"),
2778
+ tenantId: W().optional(),
2779
2779
  user: Ua.optional(),
2780
- sessionId: z().optional(),
2780
+ sessionId: W().optional(),
2781
2781
  mode: $t(["floating", "inline"]).optional(),
2782
- title: z().optional(),
2783
- subtitle: z().optional(),
2784
- description: z().optional(),
2785
- avatarUrl: z().optional(),
2782
+ title: W().optional(),
2783
+ subtitle: W().optional(),
2784
+ description: W().optional(),
2785
+ avatarUrl: W().optional(),
2786
2786
  streaming: vt().optional(),
2787
2787
  preview: vt().optional(),
2788
2788
  skipServerConfigFetch: vt().optional(),
@@ -2792,7 +2792,7 @@ var z = qe.create, wo = wt.create, So = Pt.create, Co = Ct.create, vt = Nt.creat
2792
2792
  }), Ba = zr.omit({
2793
2793
  agentId: !0,
2794
2794
  apiBaseUrl: !0
2795
- }).partial(), ye = {
2795
+ }).partial(), ke = {
2796
2796
  mode: "floating",
2797
2797
  streaming: !0,
2798
2798
  title: "AI Assistant",
@@ -2809,10 +2809,10 @@ function Ve(e, t) {
2809
2809
  const a = t ? { ...t } : void 0;
2810
2810
  a && typeof a.theme == "object" && a.theme !== null ? (r = a.theme, delete a.theme) : a && typeof a.theme == "string" && (r = { mode: a.theme }, delete a.theme);
2811
2811
  const n = a ? Ba.passthrough().safeParse(a).data : void 0, i = n ? Wr(n, e) : e, s = {
2812
- mode: i.theme?.mode ?? r?.mode ?? ye.theme.mode,
2813
- accentColor: i.theme?.accentColor ?? r?.accentColor ?? ye.theme.accentColor,
2814
- fontFamily: i.theme?.fontFamily ?? r?.fontFamily ?? ye.theme.fontFamily,
2815
- borderRadius: i.theme?.borderRadius ?? r?.borderRadius ?? ye.theme.borderRadius
2812
+ mode: i.theme?.mode ?? r?.mode ?? ke.theme.mode,
2813
+ accentColor: i.theme?.accentColor ?? r?.accentColor ?? ke.theme.accentColor,
2814
+ fontFamily: i.theme?.fontFamily ?? r?.fontFamily ?? ke.theme.fontFamily,
2815
+ borderRadius: i.theme?.borderRadius ?? r?.borderRadius ?? ke.theme.borderRadius
2816
2816
  };
2817
2817
  return {
2818
2818
  agentId: i.agentId,
@@ -2825,8 +2825,8 @@ function Ve(e, t) {
2825
2825
  email: i.user?.email
2826
2826
  },
2827
2827
  sessionId: i.sessionId,
2828
- mode: i.mode ?? ye.mode,
2829
- title: i.title ?? ye.title,
2828
+ mode: i.mode ?? ke.mode,
2829
+ title: i.title ?? ke.title,
2830
2830
  subtitle: i.subtitle,
2831
2831
  description: i.description,
2832
2832
  suggestedQuestions: (() => {
@@ -2834,7 +2834,7 @@ function Ve(e, t) {
2834
2834
  return Array.isArray(o) ? o : [];
2835
2835
  })(),
2836
2836
  avatarUrl: i.avatarUrl,
2837
- streaming: i.streaming ?? ye.streaming,
2837
+ streaming: i.streaming ?? ke.streaming,
2838
2838
  preview: i.preview === !0,
2839
2839
  skipServerConfigFetch: i.skipServerConfigFetch === !0,
2840
2840
  configChannel: i.configChannel,
@@ -2876,24 +2876,24 @@ function oe(e, t, r, a) {
2876
2876
  });
2877
2877
  }
2878
2878
  return new (r || (r = Promise))(function(i, s) {
2879
- function o(u) {
2879
+ function o(h) {
2880
2880
  try {
2881
- c(a.next(u));
2882
- } catch (h) {
2883
- s(h);
2881
+ d(a.next(h));
2882
+ } catch (u) {
2883
+ s(u);
2884
2884
  }
2885
2885
  }
2886
- function l(u) {
2886
+ function l(h) {
2887
2887
  try {
2888
- c(a.throw(u));
2889
- } catch (h) {
2890
- s(h);
2888
+ d(a.throw(h));
2889
+ } catch (u) {
2890
+ s(u);
2891
2891
  }
2892
2892
  }
2893
- function c(u) {
2894
- u.done ? i(u.value) : n(u.value).then(o, l);
2893
+ function d(h) {
2894
+ h.done ? i(h.value) : n(h.value).then(o, l);
2895
2895
  }
2896
- c((a = a.apply(e, t || [])).next());
2896
+ d((a = a.apply(e, t || [])).next());
2897
2897
  });
2898
2898
  }
2899
2899
  function le(e, t) {
@@ -2909,60 +2909,60 @@ function le(e, t) {
2909
2909
  return s.next = o(0), s.throw = o(1), s.return = o(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
2910
2910
  return this;
2911
2911
  }), s;
2912
- function o(c) {
2913
- return function(u) {
2914
- return l([c, u]);
2912
+ function o(d) {
2913
+ return function(h) {
2914
+ return l([d, h]);
2915
2915
  };
2916
2916
  }
2917
- function l(c) {
2917
+ function l(d) {
2918
2918
  if (a) throw new TypeError("Generator is already executing.");
2919
- for (; s && (s = 0, c[0] && (r = 0)), r; ) try {
2920
- if (a = 1, n && (i = c[0] & 2 ? n.return : c[0] ? n.throw || ((i = n.return) && i.call(n), 0) : n.next) && !(i = i.call(n, c[1])).done) return i;
2921
- switch (n = 0, i && (c = [c[0] & 2, i.value]), c[0]) {
2919
+ for (; s && (s = 0, d[0] && (r = 0)), r; ) try {
2920
+ if (a = 1, n && (i = d[0] & 2 ? n.return : d[0] ? n.throw || ((i = n.return) && i.call(n), 0) : n.next) && !(i = i.call(n, d[1])).done) return i;
2921
+ switch (n = 0, i && (d = [d[0] & 2, i.value]), d[0]) {
2922
2922
  case 0:
2923
2923
  case 1:
2924
- i = c;
2924
+ i = d;
2925
2925
  break;
2926
2926
  case 4:
2927
2927
  return r.label++, {
2928
- value: c[1],
2928
+ value: d[1],
2929
2929
  done: !1
2930
2930
  };
2931
2931
  case 5:
2932
- r.label++, n = c[1], c = [0];
2932
+ r.label++, n = d[1], d = [0];
2933
2933
  continue;
2934
2934
  case 7:
2935
- c = r.ops.pop(), r.trys.pop();
2935
+ d = r.ops.pop(), r.trys.pop();
2936
2936
  continue;
2937
2937
  default:
2938
- if (i = r.trys, !(i = i.length > 0 && i[i.length - 1]) && (c[0] === 6 || c[0] === 2)) {
2938
+ if (i = r.trys, !(i = i.length > 0 && i[i.length - 1]) && (d[0] === 6 || d[0] === 2)) {
2939
2939
  r = 0;
2940
2940
  continue;
2941
2941
  }
2942
- if (c[0] === 3 && (!i || c[1] > i[0] && c[1] < i[3])) {
2943
- r.label = c[1];
2942
+ if (d[0] === 3 && (!i || d[1] > i[0] && d[1] < i[3])) {
2943
+ r.label = d[1];
2944
2944
  break;
2945
2945
  }
2946
- if (c[0] === 6 && r.label < i[1]) {
2947
- r.label = i[1], i = c;
2946
+ if (d[0] === 6 && r.label < i[1]) {
2947
+ r.label = i[1], i = d;
2948
2948
  break;
2949
2949
  }
2950
2950
  if (i && r.label < i[2]) {
2951
- r.label = i[2], r.ops.push(c);
2951
+ r.label = i[2], r.ops.push(d);
2952
2952
  break;
2953
2953
  }
2954
2954
  i[2] && r.ops.pop(), r.trys.pop();
2955
2955
  continue;
2956
2956
  }
2957
- c = t.call(e, r);
2958
- } catch (u) {
2959
- c = [6, u], n = 0;
2957
+ d = t.call(e, r);
2958
+ } catch (h) {
2959
+ d = [6, h], n = 0;
2960
2960
  } finally {
2961
2961
  a = i = 0;
2962
2962
  }
2963
- if (c[0] & 5) throw c[1];
2963
+ if (d[0] & 5) throw d[1];
2964
2964
  return {
2965
- value: c[0] ? c[1] : void 0,
2965
+ value: d[0] ? d[1] : void 0,
2966
2966
  done: !0
2967
2967
  };
2968
2968
  }
@@ -3049,7 +3049,7 @@ function ee(e) {
3049
3049
  function ue(e, t) {
3050
3050
  return typeof e == "number" && isNaN(e) ? t : e;
3051
3051
  }
3052
- function W(e) {
3052
+ function D(e) {
3053
3053
  return e.reduce(function(t, r) {
3054
3054
  return t + (r ? 1 : 0);
3055
3055
  }, 0);
@@ -3063,19 +3063,19 @@ function Ja(e) {
3063
3063
  for (var t, r, a = "Unexpected syntax '".concat(e, "'"), n = /^\s*([a-z-]*)(.*)$/i.exec(e), i = n[1] || void 0, s = {}, o = /([.:#][\w-]+|\[.+?\])/gi, l = function(p, f) {
3064
3064
  s[p] = s[p] || [], s[p].push(f);
3065
3065
  }; ; ) {
3066
- var c = o.exec(n[2]);
3067
- if (!c) break;
3068
- var u = c[0];
3069
- switch (u[0]) {
3066
+ var d = o.exec(n[2]);
3067
+ if (!d) break;
3068
+ var h = d[0];
3069
+ switch (h[0]) {
3070
3070
  case ".":
3071
- l("class", u.slice(1));
3071
+ l("class", h.slice(1));
3072
3072
  break;
3073
3073
  case "#":
3074
- l("id", u.slice(1));
3074
+ l("id", h.slice(1));
3075
3075
  break;
3076
3076
  case "[":
3077
- var h = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);
3078
- if (h) l(h[1], (r = (t = h[4]) !== null && t !== void 0 ? t : h[5]) !== null && r !== void 0 ? r : "");
3077
+ var u = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(h);
3078
+ if (u) l(u[1], (r = (t = u[4]) !== null && t !== void 0 ? t : u[5]) !== null && r !== void 0 ? r : "");
3079
3079
  else throw new Error(a);
3080
3080
  break;
3081
3081
  default:
@@ -3093,12 +3093,12 @@ function Qa(e) {
3093
3093
  return t;
3094
3094
  }
3095
3095
  function me(e, t) {
3096
- var r = e[0] >>> 16, a = e[0] & 65535, n = e[1] >>> 16, i = e[1] & 65535, s = t[0] >>> 16, o = t[0] & 65535, l = t[1] >>> 16, c = t[1] & 65535, u = 0, h = 0, p = 0, f = 0;
3097
- f += i + c, p += f >>> 16, f &= 65535, p += n + l, h += p >>> 16, p &= 65535, h += a + o, u += h >>> 16, h &= 65535, u += r + s, u &= 65535, e[0] = u << 16 | h, e[1] = p << 16 | f;
3096
+ var r = e[0] >>> 16, a = e[0] & 65535, n = e[1] >>> 16, i = e[1] & 65535, s = t[0] >>> 16, o = t[0] & 65535, l = t[1] >>> 16, d = t[1] & 65535, h = 0, u = 0, p = 0, f = 0;
3097
+ f += i + d, p += f >>> 16, f &= 65535, p += n + l, u += p >>> 16, p &= 65535, u += a + o, h += u >>> 16, u &= 65535, h += r + s, h &= 65535, e[0] = h << 16 | u, e[1] = p << 16 | f;
3098
3098
  }
3099
3099
  function Q(e, t) {
3100
- var r = e[0] >>> 16, a = e[0] & 65535, n = e[1] >>> 16, i = e[1] & 65535, s = t[0] >>> 16, o = t[0] & 65535, l = t[1] >>> 16, c = t[1] & 65535, u = 0, h = 0, p = 0, f = 0;
3101
- f += i * c, p += f >>> 16, f &= 65535, p += n * c, h += p >>> 16, p &= 65535, p += i * l, h += p >>> 16, p &= 65535, h += a * c, u += h >>> 16, h &= 65535, h += n * l, u += h >>> 16, h &= 65535, h += i * o, u += h >>> 16, h &= 65535, u += r * c + a * l + n * o + i * s, u &= 65535, e[0] = u << 16 | h, e[1] = p << 16 | f;
3100
+ var r = e[0] >>> 16, a = e[0] & 65535, n = e[1] >>> 16, i = e[1] & 65535, s = t[0] >>> 16, o = t[0] & 65535, l = t[1] >>> 16, d = t[1] & 65535, h = 0, u = 0, p = 0, f = 0;
3101
+ f += i * d, p += f >>> 16, f &= 65535, p += n * d, u += p >>> 16, p &= 65535, p += i * l, u += p >>> 16, p &= 65535, u += a * d, h += u >>> 16, u &= 65535, u += n * l, h += u >>> 16, u &= 65535, u += i * o, h += u >>> 16, u &= 65535, h += r * d + a * l + n * o + i * s, h &= 65535, e[0] = h << 16 | u, e[1] = p << 16 | f;
3102
3102
  }
3103
3103
  function xe(e, t) {
3104
3104
  var r = e[0];
@@ -3119,42 +3119,42 @@ var Ge = [2277735313, 289559509], He = [1291169091, 658871167], or = [0, 5], en
3119
3119
  function rn(e, t) {
3120
3120
  var r = Qa(e);
3121
3121
  t = t || 0;
3122
- var a = [0, r.length], n = a[1] % 16, i = a[1] - n, s = [0, t], o = [0, t], l = [0, 0], c = [0, 0], u;
3123
- for (u = 0; u < i; u = u + 16)
3124
- l[0] = r[u + 4] | r[u + 5] << 8 | r[u + 6] << 16 | r[u + 7] << 24, l[1] = r[u] | r[u + 1] << 8 | r[u + 2] << 16 | r[u + 3] << 24, c[0] = r[u + 12] | r[u + 13] << 8 | r[u + 14] << 16 | r[u + 15] << 24, c[1] = r[u + 8] | r[u + 9] << 8 | r[u + 10] << 16 | r[u + 11] << 24, Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l), xe(s, 27), me(s, o), Q(s, or), me(s, en), Q(c, He), xe(c, 33), Q(c, Ge), Z(o, c), xe(o, 31), me(o, s), Q(o, or), me(o, tn);
3125
- l[0] = 0, l[1] = 0, c[0] = 0, c[1] = 0;
3126
- var h = [0, 0];
3122
+ var a = [0, r.length], n = a[1] % 16, i = a[1] - n, s = [0, t], o = [0, t], l = [0, 0], d = [0, 0], h;
3123
+ for (h = 0; h < i; h = h + 16)
3124
+ l[0] = r[h + 4] | r[h + 5] << 8 | r[h + 6] << 16 | r[h + 7] << 24, l[1] = r[h] | r[h + 1] << 8 | r[h + 2] << 16 | r[h + 3] << 24, d[0] = r[h + 12] | r[h + 13] << 8 | r[h + 14] << 16 | r[h + 15] << 24, d[1] = r[h + 8] | r[h + 9] << 8 | r[h + 10] << 16 | r[h + 11] << 24, Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l), xe(s, 27), me(s, o), Q(s, or), me(s, en), Q(d, He), xe(d, 33), Q(d, Ge), Z(o, d), xe(o, 31), me(o, s), Q(o, or), me(o, tn);
3125
+ l[0] = 0, l[1] = 0, d[0] = 0, d[1] = 0;
3126
+ var u = [0, 0];
3127
3127
  switch (n) {
3128
3128
  case 15:
3129
- h[1] = r[u + 14], H(h, 48), Z(c, h);
3129
+ u[1] = r[h + 14], H(u, 48), Z(d, u);
3130
3130
  case 14:
3131
- h[1] = r[u + 13], H(h, 40), Z(c, h);
3131
+ u[1] = r[h + 13], H(u, 40), Z(d, u);
3132
3132
  case 13:
3133
- h[1] = r[u + 12], H(h, 32), Z(c, h);
3133
+ u[1] = r[h + 12], H(u, 32), Z(d, u);
3134
3134
  case 12:
3135
- h[1] = r[u + 11], H(h, 24), Z(c, h);
3135
+ u[1] = r[h + 11], H(u, 24), Z(d, u);
3136
3136
  case 11:
3137
- h[1] = r[u + 10], H(h, 16), Z(c, h);
3137
+ u[1] = r[h + 10], H(u, 16), Z(d, u);
3138
3138
  case 10:
3139
- h[1] = r[u + 9], H(h, 8), Z(c, h);
3139
+ u[1] = r[h + 9], H(u, 8), Z(d, u);
3140
3140
  case 9:
3141
- h[1] = r[u + 8], Z(c, h), Q(c, He), xe(c, 33), Q(c, Ge), Z(o, c);
3141
+ u[1] = r[h + 8], Z(d, u), Q(d, He), xe(d, 33), Q(d, Ge), Z(o, d);
3142
3142
  case 8:
3143
- h[1] = r[u + 7], H(h, 56), Z(l, h);
3143
+ u[1] = r[h + 7], H(u, 56), Z(l, u);
3144
3144
  case 7:
3145
- h[1] = r[u + 6], H(h, 48), Z(l, h);
3145
+ u[1] = r[h + 6], H(u, 48), Z(l, u);
3146
3146
  case 6:
3147
- h[1] = r[u + 5], H(h, 40), Z(l, h);
3147
+ u[1] = r[h + 5], H(u, 40), Z(l, u);
3148
3148
  case 5:
3149
- h[1] = r[u + 4], H(h, 32), Z(l, h);
3149
+ u[1] = r[h + 4], H(u, 32), Z(l, u);
3150
3150
  case 4:
3151
- h[1] = r[u + 3], H(h, 24), Z(l, h);
3151
+ u[1] = r[h + 3], H(u, 24), Z(l, u);
3152
3152
  case 3:
3153
- h[1] = r[u + 2], H(h, 16), Z(l, h);
3153
+ u[1] = r[h + 2], H(u, 16), Z(l, u);
3154
3154
  case 2:
3155
- h[1] = r[u + 1], H(h, 8), Z(l, h);
3155
+ u[1] = r[h + 1], H(u, 8), Z(l, u);
3156
3156
  case 1:
3157
- h[1] = r[u], Z(l, h), Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l);
3157
+ u[1] = r[h], Z(l, u), Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l);
3158
3158
  }
3159
3159
  return Z(s, a), Z(o, a), me(s, o), me(o, s), sr(s), sr(o), me(s, o), me(o, s), ("00000000" + (s[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[1] >>> 0).toString(16)).slice(-8);
3160
3160
  }
@@ -3193,17 +3193,17 @@ function on(e, t) {
3193
3193
  };
3194
3194
  });
3195
3195
  a(function() {
3196
- return new Promise(function(c) {
3197
- var u = Date.now();
3196
+ return new Promise(function(d) {
3197
+ var h = Date.now();
3198
3198
  nr(l, function() {
3199
- for (var h = [], p = 0; p < arguments.length; p++) h[p] = arguments[p];
3200
- var f = o + Date.now() - u;
3201
- if (!h[0]) return c({
3202
- error: h[1],
3199
+ for (var u = [], p = 0; p < arguments.length; p++) u[p] = arguments[p];
3200
+ var f = o + Date.now() - h;
3201
+ if (!u[0]) return d({
3202
+ error: u[1],
3203
3203
  duration: f
3204
3204
  });
3205
- c({
3206
- value: h[1],
3205
+ d({
3206
+ value: u[1],
3207
3207
  duration: f
3208
3208
  });
3209
3209
  });
@@ -3225,7 +3225,7 @@ function ln(e, t, r, a) {
3225
3225
  }, a));
3226
3226
  return function() {
3227
3227
  return oe(this, void 0, void 0, function() {
3228
- var o, l, c, u, h;
3228
+ var o, l, d, h, u;
3229
3229
  return le(this, function(p) {
3230
3230
  switch (p.label) {
3231
3231
  case 0:
@@ -3237,8 +3237,8 @@ function ln(e, t, r, a) {
3237
3237
  case 2:
3238
3238
  return l = p.sent(), [4, Promise.all(l)];
3239
3239
  case 3:
3240
- for (c = p.sent(), u = {}, h = 0; h < n.length; ++h) u[n[h]] = c[h];
3241
- return [2, u];
3240
+ for (d = p.sent(), h = {}, u = 0; u < n.length; ++u) h[n[u]] = d[u];
3241
+ return [2, h];
3242
3242
  }
3243
3243
  });
3244
3244
  });
@@ -3246,7 +3246,7 @@ function ln(e, t, r, a) {
3246
3246
  }
3247
3247
  function Hr() {
3248
3248
  var e = window, t = navigator;
3249
- return W([
3249
+ return D([
3250
3250
  "MSCSSMatrix" in e,
3251
3251
  "msSetImmediate" in e,
3252
3252
  "msIndexedDB" in e,
@@ -3256,7 +3256,7 @@ function Hr() {
3256
3256
  }
3257
3257
  function cn() {
3258
3258
  var e = window, t = navigator;
3259
- return W([
3259
+ return D([
3260
3260
  "msWriteProfilerMark" in e,
3261
3261
  "MSStream" in e,
3262
3262
  "msLaunchUri" in t,
@@ -3265,7 +3265,7 @@ function cn() {
3265
3265
  }
3266
3266
  function ze() {
3267
3267
  var e = window, t = navigator;
3268
- return W([
3268
+ return D([
3269
3269
  "webkitPersistentStorage" in t,
3270
3270
  "webkitTemporaryStorage" in t,
3271
3271
  (t.vendor || "").indexOf("Google") === 0,
@@ -3277,7 +3277,7 @@ function ze() {
3277
3277
  }
3278
3278
  function re() {
3279
3279
  var e = window, t = navigator;
3280
- return W([
3280
+ return D([
3281
3281
  "ApplePayError" in e,
3282
3282
  "CSSPrimitiveValue" in e,
3283
3283
  "Counter" in e,
@@ -3288,7 +3288,7 @@ function re() {
3288
3288
  }
3289
3289
  function Bt() {
3290
3290
  var e = window, t = e.HTMLElement, r = e.Document;
3291
- return W([
3291
+ return D([
3292
3292
  "safari" in e,
3293
3293
  !("ongestureend" in e),
3294
3294
  !("TouchEvent" in e),
@@ -3303,7 +3303,7 @@ function We() {
3303
3303
  }
3304
3304
  function Yr() {
3305
3305
  var e, t, r = window;
3306
- return W([
3306
+ return D([
3307
3307
  "buildID" in navigator,
3308
3308
  "MozAppearance" in ((t = (e = document.documentElement) === null || e === void 0 ? void 0 : e.style) !== null && t !== void 0 ? t : {}),
3309
3309
  "onmozfullscreenchange" in r,
@@ -3314,7 +3314,7 @@ function Yr() {
3314
3314
  }
3315
3315
  function dn() {
3316
3316
  var e = window;
3317
- return W([
3317
+ return D([
3318
3318
  !("MediaSettingsRange" in e),
3319
3319
  "RTCEncodedAudioFrame" in e,
3320
3320
  "" + e.Intl == "[object Intl]",
@@ -3323,7 +3323,7 @@ function dn() {
3323
3323
  }
3324
3324
  function un() {
3325
3325
  var e = window, t = e.URLPattern;
3326
- return W([
3326
+ return D([
3327
3327
  "union" in Set.prototype,
3328
3328
  "Iterator" in e,
3329
3329
  t && "hasRegExpGroups" in t.prototype,
@@ -3332,7 +3332,7 @@ function un() {
3332
3332
  }
3333
3333
  function hn() {
3334
3334
  var e = window;
3335
- return W([
3335
+ return D([
3336
3336
  "DOMRectList" in e,
3337
3337
  "RTCPeerConnectionIceEvent" in e,
3338
3338
  "SVGGeometryElement" in e,
@@ -3341,7 +3341,7 @@ function hn() {
3341
3341
  }
3342
3342
  function De() {
3343
3343
  var e = window, t = navigator, r = e.CSS, a = e.HTMLButtonElement;
3344
- return W([
3344
+ return D([
3345
3345
  !("getStorageUpdates" in t),
3346
3346
  a && "popover" in a.prototype,
3347
3347
  "CSSCounterStyleRule" in e,
@@ -3352,7 +3352,7 @@ function De() {
3352
3352
  function fn() {
3353
3353
  if (navigator.platform === "iPad") return !0;
3354
3354
  var e = screen, t = e.width / e.height;
3355
- return W([
3355
+ return D([
3356
3356
  "MediaSource" in window,
3357
3357
  !!Element.prototype.webkitRequestFullscreen,
3358
3358
  t > 0.65 && t < 1.53
@@ -3368,11 +3368,11 @@ function mn() {
3368
3368
  }
3369
3369
  function Gt() {
3370
3370
  var e = ze(), t = Yr(), r = window, a = navigator, n = "connection";
3371
- return e ? W([
3371
+ return e ? D([
3372
3372
  !("SharedWorker" in r),
3373
3373
  a[n] && "ontypechange" in a[n],
3374
3374
  !("sinkId" in new Audio())
3375
- ]) >= 2 : t ? W([
3375
+ ]) >= 2 : t ? D([
3376
3376
  "onorientationchange" in r,
3377
3377
  "orientation" in r,
3378
3378
  /android/i.test(a.appVersion)
@@ -3380,7 +3380,7 @@ function Gt() {
3380
3380
  }
3381
3381
  function gn() {
3382
3382
  var e = navigator, t = window, r = Audio.prototype, a = t.visualViewport;
3383
- return W([
3383
+ return D([
3384
3384
  "srLatency" in r,
3385
3385
  "srChannelCount" in r,
3386
3386
  "devicePosture" in e,
@@ -3399,14 +3399,14 @@ function kn() {
3399
3399
  n.type = "triangle", n.frequency.value = 1e4;
3400
3400
  var i = a.createDynamicsCompressor();
3401
3401
  i.threshold.value = -50, i.knee.value = 40, i.ratio.value = 12, i.attack.value = 0, i.release.value = 0.25, n.connect(i), i.connect(a.destination), n.start(0);
3402
- var s = _n(a), o = s[0], l = s[1], c = Pe(o.then(function(u) {
3403
- return xn(u.getChannelData(0).subarray(r));
3404
- }, function(u) {
3405
- if (u.name === "timeout" || u.name === "suspended") return -3;
3406
- throw u;
3402
+ var s = _n(a), o = s[0], l = s[1], d = Pe(o.then(function(h) {
3403
+ return xn(h.getChannelData(0).subarray(r));
3404
+ }, function(h) {
3405
+ if (h.name === "timeout" || h.name === "suspended") return -3;
3406
+ throw h;
3407
3407
  }));
3408
3408
  return function() {
3409
- return l(), c;
3409
+ return l(), d;
3410
3410
  };
3411
3411
  }
3412
3412
  function yn() {
@@ -3419,31 +3419,31 @@ function _n(e) {
3419
3419
  var t = 3, r = 500, a = 500, n = 5e3, i = function() {
3420
3420
  };
3421
3421
  return [new Promise(function(s, o) {
3422
- var l = !1, c = 0, u = 0;
3422
+ var l = !1, d = 0, h = 0;
3423
3423
  e.oncomplete = function(f) {
3424
3424
  return s(f.renderedBuffer);
3425
3425
  };
3426
- var h = function() {
3426
+ var u = function() {
3427
3427
  setTimeout(function() {
3428
3428
  return o(lr("timeout"));
3429
- }, Math.min(a, u + n - Date.now()));
3429
+ }, Math.min(a, h + n - Date.now()));
3430
3430
  }, p = function() {
3431
3431
  try {
3432
3432
  var f = e.startRendering();
3433
3433
  switch (Br(f) && Pe(f), e.state) {
3434
3434
  case "running":
3435
- u = Date.now(), l && h();
3435
+ h = Date.now(), l && u();
3436
3436
  break;
3437
3437
  case "suspended":
3438
- document.hidden || c++, l && c >= t ? o(lr("suspended")) : setTimeout(p, r);
3438
+ document.hidden || d++, l && d >= t ? o(lr("suspended")) : setTimeout(p, r);
3439
3439
  break;
3440
3440
  }
3441
- } catch (v) {
3442
- o(v);
3441
+ } catch (k) {
3442
+ o(k);
3443
3443
  }
3444
3444
  };
3445
3445
  p(), i = function() {
3446
- l || (l = !0, u > 0 && h());
3446
+ l || (l = !0, h > 0 && u());
3447
3447
  };
3448
3448
  }), i];
3449
3449
  }
@@ -3475,20 +3475,20 @@ function Xr(e, t, r) {
3475
3475
  ,
3476
3476
  10,
3477
3477
  11
3478
- ]), [4, new Promise(function(c, u) {
3479
- var h = !1, p = function() {
3480
- h = !0, c();
3481
- }, f = function(I) {
3482
- h = !0, u(I);
3478
+ ]), [4, new Promise(function(d, h) {
3479
+ var u = !1, p = function() {
3480
+ u = !0, d();
3481
+ }, f = function(S) {
3482
+ u = !0, h(S);
3483
3483
  };
3484
3484
  o.onload = p, o.onerror = f;
3485
- var v = o.style;
3486
- v.setProperty("display", "block", "important"), v.position = "absolute", v.top = "0", v.left = "0", v.visibility = "hidden", t && "srcdoc" in o ? o.srcdoc = t : o.src = "about:blank", s.body.appendChild(o);
3487
- var k = function() {
3488
- var I, g;
3489
- h || (((g = (I = o.contentWindow) === null || I === void 0 ? void 0 : I.document) === null || g === void 0 ? void 0 : g.readyState) === "complete" ? p() : setTimeout(k, 10));
3485
+ var k = o.style;
3486
+ k.setProperty("display", "block", "important"), k.position = "absolute", k.top = "0", k.left = "0", k.visibility = "hidden", t && "srcdoc" in o ? o.srcdoc = t : o.src = "about:blank", s.body.appendChild(o);
3487
+ var v = function() {
3488
+ var S, g;
3489
+ u || (((g = (S = o.contentWindow) === null || S === void 0 ? void 0 : S.document) === null || g === void 0 ? void 0 : g.readyState) === "complete" ? p() : setTimeout(v, 10));
3490
3490
  };
3491
- k();
3491
+ v();
3492
3492
  })];
3493
3493
  case 5:
3494
3494
  l.sent(), l.label = 6;
@@ -3600,33 +3600,33 @@ function En() {
3600
3600
  return Xr(function(t, r) {
3601
3601
  var a = r.document;
3602
3602
  return oe(e, void 0, void 0, function() {
3603
- var n, i, s, o, l, c, u, h, p, f, v, k;
3604
- return le(this, function(I) {
3603
+ var n, i, s, o, l, d, h, u, p, f, k, v;
3604
+ return le(this, function(S) {
3605
3605
  for (n = a.body, n.style.fontSize = Nn, i = a.createElement("div"), i.style.setProperty("visibility", "hidden", "important"), s = {}, o = {}, l = function(g) {
3606
- var N = a.createElement("span"), j = N.style;
3607
- return j.position = "absolute", j.top = "0", j.left = "0", j.fontFamily = g, N.textContent = In, i.appendChild(N), N;
3608
- }, c = function(g, N) {
3609
- return l("'".concat(g, "',").concat(N));
3610
- }, u = function() {
3611
- return we.map(l);
3606
+ var w = a.createElement("span"), R = w.style;
3607
+ return R.position = "absolute", R.top = "0", R.left = "0", R.fontFamily = g, w.textContent = In, i.appendChild(w), w;
3608
+ }, d = function(g, w) {
3609
+ return l("'".concat(g, "',").concat(w));
3612
3610
  }, h = function() {
3613
- for (var g = {}, N = function(D) {
3614
- g[D] = we.map(function(ae) {
3615
- return c(D, ae);
3611
+ return we.map(l);
3612
+ }, u = function() {
3613
+ for (var g = {}, w = function(U) {
3614
+ g[U] = we.map(function(ae) {
3615
+ return d(U, ae);
3616
3616
  });
3617
- }, j = 0, P = cr; j < P.length; j++) {
3618
- var B = P[j];
3619
- N(B);
3617
+ }, R = 0, F = cr; R < F.length; R++) {
3618
+ var $ = F[R];
3619
+ w($);
3620
3620
  }
3621
3621
  return g;
3622
3622
  }, p = function(g) {
3623
- return we.some(function(N, j) {
3624
- return g[j].offsetWidth !== s[N] || g[j].offsetHeight !== o[N];
3623
+ return we.some(function(w, R) {
3624
+ return g[R].offsetWidth !== s[w] || g[R].offsetHeight !== o[w];
3625
3625
  });
3626
- }, f = u(), v = h(), n.appendChild(i), k = 0; k < we.length; k++)
3627
- s[we[k]] = f[k].offsetWidth, o[we[k]] = f[k].offsetHeight;
3626
+ }, f = h(), k = u(), n.appendChild(i), v = 0; v < we.length; v++)
3627
+ s[we[v]] = f[v].offsetWidth, o[we[v]] = f[v].offsetHeight;
3628
3628
  return [2, cr.filter(function(g) {
3629
- return p(v[g]);
3629
+ return p(k[g]);
3630
3630
  })];
3631
3631
  });
3632
3632
  });
@@ -4208,15 +4208,15 @@ function di(e) {
4208
4208
  return le(this, function(l) {
4209
4209
  switch (l.label) {
4210
4210
  case 0:
4211
- return ui() ? (r = ci(), a = Object.keys(r), n = (o = []).concat.apply(o, a.map(function(c) {
4212
- return r[c];
4211
+ return ui() ? (r = ci(), a = Object.keys(r), n = (o = []).concat.apply(o, a.map(function(d) {
4212
+ return r[d];
4213
4213
  })), [4, hi(n)]) : [2, void 0];
4214
4214
  case 1:
4215
- return i = l.sent(), t && fi(r, i), s = a.filter(function(c) {
4216
- var u = r[c];
4217
- return W(u.map(function(h) {
4218
- return i[h];
4219
- })) > u.length * 0.6;
4215
+ return i = l.sent(), t && fi(r, i), s = a.filter(function(d) {
4216
+ var h = r[d];
4217
+ return D(h.map(function(u) {
4218
+ return i[u];
4219
+ })) > h.length * 0.6;
4220
4220
  }), s.sort(), [2, s];
4221
4221
  }
4222
4222
  });
@@ -4229,16 +4229,16 @@ function hi(e) {
4229
4229
  var t;
4230
4230
  return oe(this, void 0, void 0, function() {
4231
4231
  var r, a, n, i, l, s, o, l;
4232
- return le(this, function(c) {
4233
- switch (c.label) {
4232
+ return le(this, function(d) {
4233
+ switch (d.label) {
4234
4234
  case 0:
4235
4235
  for (r = document, a = r.createElement("div"), n = new Array(e.length), i = {}, dr(a), l = 0; l < e.length; ++l)
4236
4236
  s = wn(e[l]), s.tagName === "DIALOG" && s.show(), o = r.createElement("div"), dr(o), o.appendChild(s), a.appendChild(o), n[l] = s;
4237
- c.label = 1;
4237
+ d.label = 1;
4238
4238
  case 1:
4239
4239
  return r.body ? [3, 3] : [4, dt(50)];
4240
4240
  case 2:
4241
- return c.sent(), [3, 1];
4241
+ return d.sent(), [3, 1];
4242
4242
  case 3:
4243
4243
  r.body.appendChild(a);
4244
4244
  try {
@@ -4327,54 +4327,54 @@ function xi() {
4327
4327
  function mr(e) {
4328
4328
  return matchMedia("(dynamic-range: ".concat(e, ")")).matches;
4329
4329
  }
4330
- var R = Math, V = function() {
4330
+ var j = Math, z = function() {
4331
4331
  return 0;
4332
4332
  };
4333
4333
  function wi() {
4334
- var e = R.acos || V, t = R.acosh || V, r = R.asin || V, a = R.asinh || V, n = R.atanh || V, i = R.atan || V, s = R.sin || V, o = R.sinh || V, l = R.cos || V, c = R.cosh || V, u = R.tan || V, h = R.tanh || V, p = R.exp || V, f = R.expm1 || V, v = R.log1p || V, k = function(T) {
4335
- return R.pow(R.PI, T);
4336
- }, I = function(T) {
4337
- return R.log(T + R.sqrt(T * T - 1));
4334
+ var e = j.acos || z, t = j.acosh || z, r = j.asin || z, a = j.asinh || z, n = j.atanh || z, i = j.atan || z, s = j.sin || z, o = j.sinh || z, l = j.cos || z, d = j.cosh || z, h = j.tan || z, u = j.tanh || z, p = j.exp || z, f = j.expm1 || z, k = j.log1p || z, v = function(T) {
4335
+ return j.pow(j.PI, T);
4336
+ }, S = function(T) {
4337
+ return j.log(T + j.sqrt(T * T - 1));
4338
4338
  }, g = function(T) {
4339
- return R.log(T + R.sqrt(T * T + 1));
4340
- }, N = function(T) {
4341
- return R.log((1 + T) / (1 - T)) / 2;
4342
- }, j = function(T) {
4343
- return R.exp(T) - 1 / R.exp(T) / 2;
4344
- }, P = function(T) {
4345
- return (R.exp(T) + 1 / R.exp(T)) / 2;
4346
- }, B = function(T) {
4347
- return R.exp(T) - 1;
4348
- }, D = function(T) {
4349
- return (R.exp(2 * T) - 1) / (R.exp(2 * T) + 1);
4339
+ return j.log(T + j.sqrt(T * T + 1));
4340
+ }, w = function(T) {
4341
+ return j.log((1 + T) / (1 - T)) / 2;
4342
+ }, R = function(T) {
4343
+ return j.exp(T) - 1 / j.exp(T) / 2;
4344
+ }, F = function(T) {
4345
+ return (j.exp(T) + 1 / j.exp(T)) / 2;
4346
+ }, $ = function(T) {
4347
+ return j.exp(T) - 1;
4348
+ }, U = function(T) {
4349
+ return (j.exp(2 * T) - 1) / (j.exp(2 * T) + 1);
4350
4350
  }, ae = function(T) {
4351
- return R.log(1 + T);
4351
+ return j.log(1 + T);
4352
4352
  };
4353
4353
  return {
4354
4354
  acos: e(0.12312423423423424),
4355
4355
  acosh: t(1e308),
4356
- acoshPf: I(1e154),
4356
+ acoshPf: S(1e154),
4357
4357
  asin: r(0.12312423423423424),
4358
4358
  asinh: a(1),
4359
4359
  asinhPf: g(1),
4360
4360
  atanh: n(0.5),
4361
- atanhPf: N(0.5),
4361
+ atanhPf: w(0.5),
4362
4362
  atan: i(0.5),
4363
4363
  sin: s(-1e300),
4364
4364
  sinh: o(1),
4365
- sinhPf: j(1),
4365
+ sinhPf: R(1),
4366
4366
  cos: l(10.000000000123),
4367
- cosh: c(1),
4368
- coshPf: P(1),
4369
- tan: u(-1e300),
4370
- tanh: h(1),
4371
- tanhPf: D(1),
4367
+ cosh: d(1),
4368
+ coshPf: F(1),
4369
+ tan: h(-1e300),
4370
+ tanh: u(1),
4371
+ tanhPf: U(1),
4372
4372
  exp: p(1),
4373
4373
  expm1: f(1),
4374
- expm1Pf: B(1),
4375
- log1p: v(10),
4374
+ expm1Pf: $(1),
4375
+ log1p: k(10),
4376
4376
  log1pPf: ae(10),
4377
- powPI: k(-100)
4377
+ powPI: v(-100)
4378
4378
  };
4379
4379
  }
4380
4380
  var Si = "mmMwWLliI0fiflO&1", bt = {
@@ -4389,16 +4389,16 @@ var Si = "mmMwWLliI0fiflO&1", bt = {
4389
4389
  function Ci() {
4390
4390
  return Ii(function(e, t) {
4391
4391
  for (var r = {}, a = {}, n = 0, i = Object.keys(bt); n < i.length; n++) {
4392
- var s = i[n], o = bt[s], l = o[0], c = l === void 0 ? {} : l, u = o[1], h = u === void 0 ? Si : u, p = e.createElement("span");
4393
- p.textContent = h, p.style.whiteSpace = "nowrap";
4394
- for (var f = 0, v = Object.keys(c); f < v.length; f++) {
4395
- var k = v[f], I = c[k];
4396
- I !== void 0 && (p.style[k] = I);
4392
+ var s = i[n], o = bt[s], l = o[0], d = l === void 0 ? {} : l, h = o[1], u = h === void 0 ? Si : h, p = e.createElement("span");
4393
+ p.textContent = u, p.style.whiteSpace = "nowrap";
4394
+ for (var f = 0, k = Object.keys(d); f < k.length; f++) {
4395
+ var v = k[f], S = d[v];
4396
+ S !== void 0 && (p.style[v] = S);
4397
4397
  }
4398
4398
  r[s] = p, t.append(e.createElement("br"), p);
4399
4399
  }
4400
- for (var g = 0, N = Object.keys(bt); g < N.length; g++) {
4401
- var s = N[g];
4400
+ for (var g = 0, w = Object.keys(bt); g < w.length; g++) {
4401
+ var s = w[g];
4402
4402
  a[s] = r[s].getBoundingClientRect().width;
4403
4403
  }
4404
4404
  return a;
@@ -4545,13 +4545,13 @@ function Pi(e) {
4545
4545
  var t, r, a, n, i, s, o = e.cache, l = qr(o);
4546
4546
  if (!l) return Jr;
4547
4547
  if (!ta(l)) return Qr;
4548
- var c = ea() ? null : l.getExtension(Kr);
4548
+ var d = ea() ? null : l.getExtension(Kr);
4549
4549
  return {
4550
4550
  version: ((t = l.getParameter(l.VERSION)) === null || t === void 0 ? void 0 : t.toString()) || "",
4551
4551
  vendor: ((r = l.getParameter(l.VENDOR)) === null || r === void 0 ? void 0 : r.toString()) || "",
4552
- vendorUnmasked: c ? (a = l.getParameter(c.UNMASKED_VENDOR_WEBGL)) === null || a === void 0 ? void 0 : a.toString() : "",
4552
+ vendorUnmasked: d ? (a = l.getParameter(d.UNMASKED_VENDOR_WEBGL)) === null || a === void 0 ? void 0 : a.toString() : "",
4553
4553
  renderer: ((n = l.getParameter(l.RENDERER)) === null || n === void 0 ? void 0 : n.toString()) || "",
4554
- rendererUnmasked: c ? (i = l.getParameter(c.UNMASKED_RENDERER_WEBGL)) === null || i === void 0 ? void 0 : i.toString() : "",
4554
+ rendererUnmasked: d ? (i = l.getParameter(d.UNMASKED_RENDERER_WEBGL)) === null || i === void 0 ? void 0 : i.toString() : "",
4555
4555
  shadingLanguageVersion: ((s = l.getParameter(l.SHADING_LANGUAGE_VERSION)) === null || s === void 0 ? void 0 : s.toString()) || ""
4556
4556
  };
4557
4557
  }
@@ -4559,38 +4559,38 @@ function $i(e) {
4559
4559
  var t = e.cache, r = qr(t);
4560
4560
  if (!r) return Jr;
4561
4561
  if (!ta(r)) return Qr;
4562
- var a = r.getSupportedExtensions(), n = r.getContextAttributes(), i = [], s = [], o = [], l = [], c = [];
4563
- if (n) for (var u = 0, h = Object.keys(n); u < h.length; u++) {
4564
- var p = h[u];
4562
+ var a = r.getSupportedExtensions(), n = r.getContextAttributes(), i = [], s = [], o = [], l = [], d = [];
4563
+ if (n) for (var h = 0, u = Object.keys(n); h < u.length; h++) {
4564
+ var p = u[h];
4565
4565
  s.push("".concat(p, "=").concat(n[p]));
4566
4566
  }
4567
- for (var f = gr(r), v = 0, k = f; v < k.length; v++) {
4568
- var I = k[v], g = r[I];
4569
- o.push("".concat(I, "=").concat(g).concat(Ri.has(g) ? "=".concat(r.getParameter(g)) : ""));
4567
+ for (var f = gr(r), k = 0, v = f; k < v.length; k++) {
4568
+ var S = v[k], g = r[S];
4569
+ o.push("".concat(S, "=").concat(g).concat(Ri.has(g) ? "=".concat(r.getParameter(g)) : ""));
4570
4570
  }
4571
- if (a) for (var N = 0, j = a; N < j.length; N++) {
4572
- var P = j[N];
4573
- if (!(P === Kr && ea() || P === Fi && Wi())) {
4574
- var B = r.getExtension(P);
4575
- if (!B) {
4576
- i.push(P);
4571
+ if (a) for (var w = 0, R = a; w < R.length; w++) {
4572
+ var F = R[w];
4573
+ if (!(F === Kr && ea() || F === Fi && Wi())) {
4574
+ var $ = r.getExtension(F);
4575
+ if (!$) {
4576
+ i.push(F);
4577
4577
  continue;
4578
4578
  }
4579
- for (var D = 0, ae = gr(B); D < ae.length; D++) {
4580
- var I = ae[D], g = B[I];
4581
- l.push("".concat(I, "=").concat(g).concat(ji.has(g) ? "=".concat(r.getParameter(g)) : ""));
4579
+ for (var U = 0, ae = gr($); U < ae.length; U++) {
4580
+ var S = ae[U], g = $[S];
4581
+ l.push("".concat(S, "=").concat(g).concat(ji.has(g) ? "=".concat(r.getParameter(g)) : ""));
4582
4582
  }
4583
4583
  }
4584
4584
  }
4585
- for (var T = 0, C = Zi; T < C.length; T++)
4586
- for (var F = C[T], ce = 0, Te = Oi; ce < Te.length; ce++) {
4587
- var Ue = Te[ce], pt = Vi(r, F, Ue);
4588
- c.push("".concat(F, ".").concat(Ue, "=").concat(pt.join(",")));
4585
+ for (var T = 0, N = Zi; T < N.length; T++)
4586
+ for (var P = N[T], ce = 0, Te = Oi; ce < Te.length; ce++) {
4587
+ var Ue = Te[ce], pt = Vi(r, P, Ue);
4588
+ d.push("".concat(P, ".").concat(Ue, "=").concat(pt.join(",")));
4589
4589
  }
4590
4590
  return l.sort(), o.sort(), {
4591
4591
  contextAttributes: s,
4592
4592
  parameters: o,
4593
- shaderPrecisions: c,
4593
+ shaderPrecisions: d,
4594
4594
  extensions: a,
4595
4595
  extensionParameters: l,
4596
4596
  unsupportedExtensions: i
@@ -4959,13 +4959,13 @@ async function* ss(e, t) {
4959
4959
  const l = n.lastIndexOf(`
4960
4960
  `);
4961
4961
  if (l === -1) continue;
4962
- const c = n.slice(0, l);
4962
+ const d = n.slice(0, l);
4963
4963
  n = n.slice(l + 1);
4964
- for (const u of c.split(`
4964
+ for (const h of d.split(`
4965
4965
  `)) {
4966
- const h = u.trim();
4967
- if (!h.startsWith("data:")) continue;
4968
- const p = h.slice(5).trim();
4966
+ const u = h.trim();
4967
+ if (!u.startsWith("data:")) continue;
4968
+ const p = u.slice(5).trim();
4969
4969
  p && (yield p);
4970
4970
  }
4971
4971
  }
@@ -4993,86 +4993,86 @@ async function ls(e, t, r, a = {}) {
4993
4993
  })
4994
4994
  });
4995
4995
  if (!s.ok || !s.body) {
4996
- let u = `${s.status} ${s.statusText}`;
4996
+ let h = `${s.status} ${s.statusText}`;
4997
4997
  try {
4998
- const h = await s.json();
4999
- h.error && (u = h.error);
4998
+ const u = await s.json();
4999
+ u.error && (h = u.error);
5000
5000
  } catch {
5001
5001
  }
5002
- throw Object.assign(new Error(u), { status: s.status });
5002
+ throw Object.assign(new Error(h), { status: s.status });
5003
5003
  }
5004
5004
  const o = s.headers.get("x-session-id");
5005
5005
  o && r.onSession && r.onSession(o);
5006
5006
  const l = s.headers.get("x-run-id");
5007
5007
  l && r.onRunId && (i = !0, r.onRunId(l));
5008
- const c = (u) => {
5009
- if (u === "[DONE]")
5008
+ const d = (h) => {
5009
+ if (h === "[DONE]")
5010
5010
  return r.onEnd(n), !0;
5011
5011
  try {
5012
- const h = JSON.parse(u);
5013
- if (!i && typeof h.runId == "string" && r.onRunId && (i = !0, r.onRunId(h.runId)), h.type === "session") {
5014
- const f = h.sessionId;
5012
+ const u = JSON.parse(h);
5013
+ if (!i && typeof u.runId == "string" && r.onRunId && (i = !0, r.onRunId(u.runId)), u.type === "session") {
5014
+ const f = u.sessionId;
5015
5015
  return f && r.onSession && r.onSession(f), !1;
5016
5016
  }
5017
- if (h.type === "done" || h.type === "stop")
5017
+ if (u.type === "done" || u.type === "stop")
5018
5018
  return r.onEnd(n), !0;
5019
- if (h.type === "error") throw new Error(h.message ?? "Stream error");
5020
- if (h.type === "images") {
5021
- const f = h.images;
5019
+ if (u.type === "error") throw new Error(u.message ?? "Stream error");
5020
+ if (u.type === "images") {
5021
+ const f = u.images;
5022
5022
  return f && r.onImages && r.onImages(f), !1;
5023
5023
  }
5024
- if (h.type === "documents") {
5025
- const f = h.documents;
5024
+ if (u.type === "documents") {
5025
+ const f = u.documents;
5026
5026
  return f && r.onDocuments && r.onDocuments(f), !1;
5027
5027
  }
5028
- if (h.type === "control_mode") {
5029
- const f = h.mode, v = !!h.queued;
5030
- return f && r.onControlMode && r.onControlMode(f, v), v ? (r.onEnd(n), !0) : !1;
5028
+ if (u.type === "control_mode") {
5029
+ const f = u.mode, k = !!u.queued;
5030
+ return f && r.onControlMode && r.onControlMode(f, k), k ? (r.onEnd(n), !0) : !1;
5031
5031
  }
5032
- if (h.type === "tool_calls_started") {
5033
- const f = h.toolNames ?? [];
5032
+ if (u.type === "tool_calls_started") {
5033
+ const f = u.toolNames ?? [];
5034
5034
  return n.length > 0 && !n.endsWith(`
5035
5035
 
5036
5036
  `) && (n = n.replace(/\s+$/, "") + `
5037
5037
 
5038
5038
  `, r.onDelta(`
5039
5039
 
5040
- `, n)), r.onToolCallsStarted?.(f, h.activityMode), !1;
5040
+ `, n)), r.onToolCallsStarted?.(f, u.activityMode), !1;
5041
5041
  }
5042
- if (h.type === "assistant_ack") {
5043
- const f = h.text;
5042
+ if (u.type === "assistant_ack") {
5043
+ const f = u.text;
5044
5044
  return f && r.onAck && r.onAck(f), !1;
5045
5045
  }
5046
- if (h.type === "progress") {
5047
- const f = h.stage, v = h.text, k = h.mode;
5048
- return f && v && r.onProgress && r.onProgress(f, v, k), !1;
5046
+ if (u.type === "progress") {
5047
+ const f = u.stage, k = u.text, v = u.mode, S = u.timestamp;
5048
+ return f && k && r.onProgress && r.onProgress(f, k, v, S), !1;
5049
5049
  }
5050
- if (h.type === "tool_start") {
5051
- const f = h.toolId, v = h.text, k = h.toolName, I = h.mode;
5052
- return f && v && r.onToolStart && r.onToolStart(f, v, k, I), !1;
5050
+ if (u.type === "tool_start") {
5051
+ const f = u.toolId, k = u.text, v = u.toolName, S = u.mode, g = u.timestamp;
5052
+ return f && k && r.onToolStart && r.onToolStart(f, k, v, S, g), !1;
5053
5053
  }
5054
- if (h.type === "tool_complete") {
5055
- const f = h.toolId, v = h.text, k = h.durationMs, I = h.ok;
5056
- return f && v && r.onToolComplete && r.onToolComplete(f, v, k ?? 0, I), !1;
5054
+ if (u.type === "tool_complete") {
5055
+ const f = u.toolId, k = u.text, v = u.durationMs, S = u.ok;
5056
+ return f && k && r.onToolComplete && r.onToolComplete(f, k, v ?? 0, S), !1;
5057
5057
  }
5058
- if (h.type === "model_start" || h.type === "final_meta") {
5059
- if (h.type === "final_meta" && r.onFinalMeta) {
5060
- const f = h.metrics;
5058
+ if (u.type === "model_start" || u.type === "final_meta") {
5059
+ if (u.type === "final_meta" && r.onFinalMeta) {
5060
+ const f = u.metrics;
5061
5061
  r.onFinalMeta(f ?? {}, {
5062
- mode: h.mode,
5063
- collapseAfterFinal: h.collapseAfterFinal
5062
+ mode: u.mode,
5063
+ collapseAfterFinal: u.collapseAfterFinal
5064
5064
  });
5065
5065
  }
5066
5066
  return !1;
5067
5067
  }
5068
- const p = cs(h);
5068
+ const p = cs(u);
5069
5069
  p && (n += p, r.onDelta(p, n));
5070
- } catch (h) {
5071
- if (!(h instanceof SyntaxError)) throw h;
5070
+ } catch (u) {
5071
+ if (!(u instanceof SyntaxError)) throw u;
5072
5072
  }
5073
5073
  return !1;
5074
5074
  };
5075
- for await (const u of ss(s, os)) if (c(u)) break;
5075
+ for await (const h of ss(s, os)) if (d(h)) break;
5076
5076
  r.onEnd(n);
5077
5077
  } catch (s) {
5078
5078
  r.onError(s instanceof Error ? s : new Error(String(s)));
@@ -5158,12 +5158,16 @@ function vr(e) {
5158
5158
  } catch {
5159
5159
  }
5160
5160
  }
5161
- function kr(e, t) {
5162
- return e.map((r) => r.status === "active" && r.stage !== "calling_tool" ? {
5163
- ...r,
5164
- status: "done",
5165
- durationMs: r.durationMs ?? (r.startedAtMs ? t - r.startedAtMs : void 0)
5166
- } : r);
5161
+ function kr(e, t, r) {
5162
+ return e.map((a) => {
5163
+ if (a.status !== "active" || a.stage === "calling_tool") return a;
5164
+ const n = r !== void 0 && a.serverTsMs !== void 0 && Number.isFinite(r) && Number.isFinite(a.serverTsMs) && r >= a.serverTsMs ? r - a.serverTsMs : void 0;
5165
+ return {
5166
+ ...a,
5167
+ status: "done",
5168
+ durationMs: a.durationMs ?? n ?? (a.startedAtMs ? t - a.startedAtMs : void 0)
5169
+ };
5170
+ });
5167
5171
  }
5168
5172
  function gs(e) {
5169
5173
  const t = Date.now();
@@ -5397,27 +5401,27 @@ var vs = class {
5397
5401
  if (this.state.isLoading || !r || this.state.initStatus !== "ready") return;
5398
5402
  const a = [];
5399
5403
  if (t && t.length > 0) for (const l of t) try {
5400
- const c = await ys(l.file);
5404
+ const d = await ys(l.file);
5401
5405
  if (l.kind === "image") {
5402
- const u = await this.apiClient.uploadImage(c, l.file.type, l.file.name, this.config.agentId, this.config.tenantId);
5406
+ const h = await this.apiClient.uploadImage(d, l.file.type, l.file.name, this.config.agentId, this.config.tenantId);
5403
5407
  a.push({
5404
- url: u.url,
5408
+ url: h.url,
5405
5409
  mimeType: l.file.type,
5406
5410
  fileName: l.file.name,
5407
5411
  kind: "image"
5408
5412
  });
5409
5413
  } else {
5410
- const u = await this.apiClient.uploadFile(c, l.file.type || "application/octet-stream", l.file.name, this.config.agentId, this.config.tenantId);
5414
+ const h = await this.apiClient.uploadFile(d, l.file.type || "application/octet-stream", l.file.name, this.config.agentId, this.config.tenantId);
5411
5415
  a.push({
5412
- url: u.url,
5416
+ url: h.url,
5413
5417
  mimeType: l.file.type || "application/octet-stream",
5414
5418
  fileName: l.file.name,
5415
5419
  kind: "file"
5416
5420
  });
5417
5421
  }
5418
- } catch (c) {
5419
- const u = c instanceof Error ? c.message : "Attachment upload failed";
5420
- this.setState({ error: u });
5422
+ } catch (d) {
5423
+ const h = d instanceof Error ? d.message : "Attachment upload failed";
5424
+ this.setState({ error: h });
5421
5425
  return;
5422
5426
  }
5423
5427
  const n = a.filter((l) => l.kind === "image"), i = {
@@ -5497,8 +5501,9 @@ var vs = class {
5497
5501
  status: "streaming"
5498
5502
  };
5499
5503
  this.setState({ messages: [...this.state.messages, i] }), this.emitter.emit("stream:start");
5500
- let s = !1, o = !1, l = null, c = null, u = null;
5504
+ let s = !1, o = !1, l = null, d = null;
5501
5505
  const h = Date.now();
5506
+ let u = null;
5502
5507
  await ls(this.config.apiBaseUrl, {
5503
5508
  agentId: this.config.agentId,
5504
5509
  message: e,
@@ -5526,56 +5531,58 @@ var vs = class {
5526
5531
  this.updateMessage(n, { documents: p });
5527
5532
  },
5528
5533
  onToolCallsStarted: (p, f) => {
5529
- f && c === null && (c = f), (f ?? c) !== "off" && this.updateMessage(n, { toolStatus: ks(p) });
5534
+ f && l === null && (l = f), u = null, this.updateMessage(n, { answerStartedAtMs: null }), (f ?? l) !== "off" && this.updateMessage(n, { toolStatus: ks(p) });
5530
5535
  },
5531
5536
  onAck: (p) => {
5532
5537
  this.updateMessage(n, { ackText: p });
5533
5538
  },
5534
- onProgress: (p, f, v) => {
5535
- const k = this.state.messages.find((g) => g.id === n)?.progressEvents ?? [], I = Date.now();
5536
- v && c === null && (c = v, this.updateMessage(n, { turnMeta: {
5539
+ onProgress: (p, f, k, v) => {
5540
+ const S = this.state.messages.find((F) => F.id === n)?.progressEvents ?? [], g = Date.now(), w = v ? Date.parse(v) : NaN, R = Number.isNaN(w) ? void 0 : w;
5541
+ k && l === null && (l = k, this.updateMessage(n, { turnMeta: {
5537
5542
  totalMs: null,
5538
5543
  collapseAfterFinal: null,
5539
- mode: v
5540
- } })), this.updateMessage(n, { progressEvents: [...kr(k, I), {
5544
+ mode: k
5545
+ } })), this.updateMessage(n, { progressEvents: [...kr(S, g, R), {
5541
5546
  stage: p,
5542
5547
  text: f,
5543
5548
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
5544
5549
  status: "active",
5545
- startedAtMs: I
5550
+ startedAtMs: g,
5551
+ serverTsMs: R
5546
5552
  }] });
5547
5553
  },
5548
- onToolStart: (p, f, v, k) => {
5549
- const I = this.state.messages.find((N) => N.id === n)?.progressEvents ?? [], g = Date.now();
5550
- k && c === null && (c = k, this.updateMessage(n, { turnMeta: {
5554
+ onToolStart: (p, f, k, v, S) => {
5555
+ const g = this.state.messages.find(($) => $.id === n)?.progressEvents ?? [], w = Date.now(), R = S ? Date.parse(S) : NaN, F = Number.isNaN(R) ? void 0 : R;
5556
+ v && l === null && (l = v, this.updateMessage(n, { turnMeta: {
5551
5557
  totalMs: null,
5552
5558
  collapseAfterFinal: null,
5553
- mode: k
5554
- } })), this.updateMessage(n, { progressEvents: [...kr(I, g), {
5559
+ mode: v
5560
+ } })), this.updateMessage(n, { progressEvents: [...kr(g, w, F), {
5555
5561
  stage: "calling_tool",
5556
5562
  toolId: p,
5557
- toolName: v,
5563
+ toolName: k,
5558
5564
  text: f,
5559
5565
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
5560
5566
  status: "active",
5561
- startedAtMs: g
5567
+ startedAtMs: w,
5568
+ serverTsMs: F
5562
5569
  }] });
5563
5570
  },
5564
- onToolComplete: (p, f, v, k) => {
5565
- const I = this.state.messages.find((g) => g.id === n)?.progressEvents ?? [];
5566
- this.updateMessage(n, { progressEvents: I.map((g) => g.stage === "calling_tool" && g.status === "active" && g.toolId === p ? {
5571
+ onToolComplete: (p, f, k, v) => {
5572
+ const S = this.state.messages.find((g) => g.id === n)?.progressEvents ?? [];
5573
+ this.updateMessage(n, { progressEvents: S.map((g) => g.stage === "calling_tool" && g.status === "active" && g.toolId === p ? {
5567
5574
  ...g,
5568
5575
  status: "done",
5569
5576
  text: f,
5570
- durationMs: v,
5571
- ok: k
5577
+ durationMs: k,
5578
+ ok: v
5572
5579
  } : g) });
5573
5580
  },
5574
5581
  onFinalMeta: (p, f) => {
5575
- l = p.totalMs ?? null, c = f?.mode ?? c, u = f?.collapseAfterFinal ?? null;
5582
+ l = f?.mode ?? l, d = f?.collapseAfterFinal ?? null;
5576
5583
  },
5577
5584
  onDelta: (p, f) => {
5578
- f.trim() && (this.updateMessage(n, {
5585
+ p.trim() && u === null && (u = Date.now(), this.updateMessage(n, { answerStartedAtMs: u })), f.trim() && (this.updateMessage(n, {
5579
5586
  content: f,
5580
5587
  toolStatus: void 0
5581
5588
  }), this.emitter.emit("stream:delta", {
@@ -5592,21 +5599,21 @@ var vs = class {
5592
5599
  }), this.emitter.emit("stream:end", { content: "" });
5593
5600
  return;
5594
5601
  }
5595
- const f = this.state.messages.find((g) => g.id === n), v = c === "detailed", k = v || c === "standard";
5602
+ const f = this.state.messages.find((g) => g.id === n), k = l === "detailed", v = k || l === "standard";
5596
5603
  this.updateMessage(n, {
5597
5604
  content: p,
5598
5605
  status: "sent",
5599
5606
  toolStatus: void 0,
5600
- progressEvents: v && f?.progressEvents?.length ? gs(f.progressEvents) : void 0,
5601
- progressCollapsed: v ? u ?? !0 : void 0,
5602
- turnMeta: k ? {
5603
- totalMs: l ?? Date.now() - h,
5604
- collapseAfterFinal: u,
5605
- mode: c
5607
+ progressEvents: k && f?.progressEvents?.length ? gs(f.progressEvents) : void 0,
5608
+ progressCollapsed: k ? d ?? !0 : void 0,
5609
+ turnMeta: v ? {
5610
+ totalMs: (u ?? Date.now()) - h,
5611
+ collapseAfterFinal: d,
5612
+ mode: l
5606
5613
  } : void 0
5607
5614
  }), this.setState({ isLoading: !1 }), this.emitter.emit("stream:end", { content: p });
5608
- const I = this.state.messages.find((g) => g.id === n);
5609
- I && this.emitter.emit("message:received", I);
5615
+ const S = this.state.messages.find((g) => g.id === n);
5616
+ S && this.emitter.emit("message:received", S);
5610
5617
  },
5611
5618
  onControlMode: (p, f) => {
5612
5619
  f && p === "human" && (o = !0);
@@ -5620,9 +5627,9 @@ var vs = class {
5620
5627
  return;
5621
5628
  }
5622
5629
  const f = (g) => {
5623
- const N = this.state.messages.find((j) => j.id === n)?.content ?? "";
5630
+ const w = this.state.messages.find((R) => R.id === n)?.content ?? "";
5624
5631
  this.updateMessage(n, {
5625
- content: N || g,
5632
+ content: w || g,
5626
5633
  status: "error"
5627
5634
  }), this.setState({
5628
5635
  isLoading: !1,
@@ -5631,19 +5638,19 @@ var vs = class {
5631
5638
  error: g,
5632
5639
  message: null
5633
5640
  }), this.reportError(g, { stack: p.stack });
5634
- }, v = (g) => {
5641
+ }, k = (g) => {
5635
5642
  this.updateMessage(n, {
5636
5643
  content: g,
5637
5644
  status: "sent",
5638
5645
  toolStatus: void 0,
5639
5646
  progressEvents: void 0
5640
5647
  }), this.setState({ isLoading: !1 }), this.emitter.emit("stream:end", { content: g });
5641
- const N = this.state.messages.find((j) => j.id === n);
5642
- N && this.emitter.emit("message:received", N);
5643
- }, k = this.state.messages.find((g) => g.id === n)?.runId, I = this.state.sessionId;
5644
- if (k && I) {
5645
- hs(this.config.apiBaseUrl, I, k, { preview: this.config.preview }).then((g) => {
5646
- g.status === "done" && g.finalText ? v(g.finalText) : f(g.errorMessage || p.message || "Something went wrong. Please try again.");
5648
+ const w = this.state.messages.find((R) => R.id === n);
5649
+ w && this.emitter.emit("message:received", w);
5650
+ }, v = this.state.messages.find((g) => g.id === n)?.runId, S = this.state.sessionId;
5651
+ if (v && S) {
5652
+ hs(this.config.apiBaseUrl, S, v, { preview: this.config.preview }).then((g) => {
5653
+ g.status === "done" && g.finalText ? k(g.finalText) : f(g.errorMessage || p.message || "Something went wrong. Please try again.");
5647
5654
  }).catch(() => f(p.message || "Something went wrong. Please try again."));
5648
5655
  return;
5649
5656
  }
@@ -5724,51 +5731,51 @@ function Yt(e, t, r, a, n) {
5724
5731
  let s = !1;
5725
5732
  const o = i && n ? Cs(n) : !i && n ? Ss(n) : ws(), l = bs(o);
5726
5733
  _s(l.styleSlot, a);
5727
- const c = new vs(e, t, (p, f) => {
5728
- s || u.update(p, f);
5729
- }), u = r(l.mountPoint, e, c.getState(), {
5730
- onOpen: () => h.open(),
5731
- onClose: () => h.close(),
5734
+ const d = new vs(e, t, (p, f) => {
5735
+ s || h.update(p, f);
5736
+ }), h = r(l.mountPoint, e, d.getState(), {
5737
+ onOpen: () => u.open(),
5738
+ onClose: () => u.close(),
5732
5739
  onSendMessage: (p, f) => {
5733
- c.sendMessage(p, f);
5740
+ d.sendMessage(p, f);
5734
5741
  },
5735
5742
  onReset: () => {
5736
- c.resetConversation();
5743
+ d.resetConversation();
5737
5744
  }
5738
5745
  });
5739
- c.hydrate(), setTimeout(() => {
5740
- s || c.emitter.emit("ready", c.getState());
5746
+ d.hydrate(), setTimeout(() => {
5747
+ s || d.emitter.emit("ready", d.getState());
5741
5748
  }, 0);
5742
- const h = {
5749
+ const u = {
5743
5750
  open() {
5744
- s || (c.setOpen(!0), c.emitter.emit("open"));
5751
+ s || (d.setOpen(!0), d.emitter.emit("open"));
5745
5752
  },
5746
5753
  close() {
5747
- s || (c.setOpen(!1), c.emitter.emit("close"));
5754
+ s || (d.setOpen(!1), d.emitter.emit("close"));
5748
5755
  },
5749
5756
  toggle() {
5750
- c.getState().isOpen ? h.close() : h.open();
5757
+ d.getState().isOpen ? u.close() : u.open();
5751
5758
  },
5752
5759
  async sendMessage(p, f) {
5753
- await c.sendMessage(p, f);
5760
+ await d.sendMessage(p, f);
5754
5761
  },
5755
5762
  reset() {
5756
- s || (c.resetConversation(), c.emitter.emit("reset"));
5763
+ s || (d.resetConversation(), d.emitter.emit("reset"));
5757
5764
  },
5758
5765
  destroy() {
5759
- s || (s = !0, c.closeEventStream(), u.destroy(), xs(l.host), i && n ? Ns(n) : Is(o), c.emitter.emit("destroy"), c.emitter.removeAllListeners());
5766
+ s || (s = !0, d.closeEventStream(), h.destroy(), xs(l.host), i && n ? Ns(n) : Is(o), d.emitter.emit("destroy"), d.emitter.removeAllListeners());
5760
5767
  },
5761
5768
  on(p, f) {
5762
- c.emitter.on(p, f);
5769
+ d.emitter.on(p, f);
5763
5770
  },
5764
5771
  off(p, f) {
5765
- c.emitter.off(p, f);
5772
+ d.emitter.off(p, f);
5766
5773
  },
5767
5774
  getState() {
5768
- return c.getState();
5775
+ return d.getState();
5769
5776
  }
5770
5777
  };
5771
- return h;
5778
+ return u;
5772
5779
  }
5773
5780
  var Ee = /* @__PURE__ */ new Map(), Es = 0;
5774
5781
  function Xt(e) {
@@ -5801,7 +5808,7 @@ function Ts(e, t, r, a) {
5801
5808
  function As(e) {
5802
5809
  e ? Ee.get(e)?.destroy() : (Ee.forEach((t) => t.destroy()), Ee.clear());
5803
5810
  }
5804
- function Qo() {
5811
+ function Ko() {
5805
5812
  return Array.from(Ee.keys());
5806
5813
  }
5807
5814
  function Rs(e) {
@@ -5846,6 +5853,9 @@ var Zs = `
5846
5853
  --ak-pattern-size: 210px;
5847
5854
  --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
5848
5855
  --ak-launcher-size: 56px;
5856
+ /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.
5857
+ Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */
5858
+ --ak-launcher-gap: -12px;
5849
5859
  font-family: var(--ak-font);
5850
5860
  -webkit-font-smoothing: antialiased;
5851
5861
  }
@@ -5874,7 +5884,7 @@ var Zs = `
5874
5884
  display: flex;
5875
5885
  flex-direction: column;
5876
5886
  align-items: flex-end;
5877
- gap: 6px;
5887
+ gap: 0;
5878
5888
  pointer-events: none;
5879
5889
  }
5880
5890
  .ak-floating > * {
@@ -5936,6 +5946,7 @@ var Zs = `
5936
5946
  display: flex;
5937
5947
  flex-direction: column;
5938
5948
  align-items: flex-start;
5949
+ margin-bottom: var(--ak-launcher-gap);
5939
5950
  }
5940
5951
 
5941
5952
  /* ── Widget shell / panel ────────────────────────────────────── */
@@ -5968,6 +5979,8 @@ var Zs = `
5968
5979
  .ak-inline .ak-shell-wrap {
5969
5980
  width: 100%;
5970
5981
  height: 100%;
5982
+ /* No launcher in inline mode — the negative offset would overflow the host. */
5983
+ margin-bottom: 0;
5971
5984
  }
5972
5985
  .ak-inline .ak-header {
5973
5986
  display: none;
@@ -5986,7 +5999,7 @@ var Zs = `
5986
5999
  flex-direction: row;
5987
6000
  align-items: center;
5988
6001
  justify-content: space-between;
5989
- padding: 14px 18px;
6002
+ padding: 10px 14px;
5990
6003
  background: var(--ak-accent);
5991
6004
  color: #fff;
5992
6005
  flex-shrink: 0;
@@ -6171,10 +6184,10 @@ var Zs = `
6171
6184
  .ak-messages {
6172
6185
  flex: 1;
6173
6186
  overflow-y: auto;
6174
- padding: 16px;
6187
+ padding: 12px;
6175
6188
  display: flex;
6176
6189
  flex-direction: column;
6177
- gap: 10px;
6190
+ gap: 8px;
6178
6191
  scroll-behavior: smooth;
6179
6192
  min-height: 0; /* Allow flex child to shrink below its content height */
6180
6193
  /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.
@@ -6197,8 +6210,8 @@ var Zs = `
6197
6210
  display: flex;
6198
6211
  flex-direction: column;
6199
6212
  align-items: center;
6200
- justify-content: center;
6201
- padding: 0 16px;
6213
+ justify-content: safe center;
6214
+ padding: 16px;
6202
6215
  text-align: center;
6203
6216
  gap: 16px;
6204
6217
  overflow-y: auto;
@@ -6322,7 +6335,7 @@ var Zs = `
6322
6335
  .ak-message {
6323
6336
  display: flex;
6324
6337
  flex-direction: column;
6325
- max-width: 82%;
6338
+ max-width: 86%;
6326
6339
  animation: ak-msg-in 0.15s ease-out;
6327
6340
  }
6328
6341
  @keyframes ak-msg-in {
@@ -6338,7 +6351,7 @@ var Zs = `
6338
6351
  align-items: flex-start;
6339
6352
  }
6340
6353
  .ak-message__bubble {
6341
- padding: 10px 14px;
6354
+ padding: 8px 12px;
6342
6355
  border-radius: 16px;
6343
6356
  font-size: 14px;
6344
6357
  line-height: 1.55;
@@ -6371,11 +6384,16 @@ var Zs = `
6371
6384
  border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));
6372
6385
  }
6373
6386
  .ak-message__time {
6387
+ display: block;
6388
+ text-align: right;
6374
6389
  font-size: 11px;
6375
6390
  color: var(--ak-text-muted);
6376
- margin-top: 3px;
6391
+ margin-top: 2px;
6377
6392
  padding: 0 4px;
6378
6393
  }
6394
+ .ak-message--user .ak-message__time {
6395
+ color: rgba(255, 255, 255, 0.7);
6396
+ }
6379
6397
  .ak-message__sender-label {
6380
6398
  font-size: 11px;
6381
6399
  font-weight: 500;
@@ -6600,7 +6618,7 @@ var Zs = `
6600
6618
  display: flex;
6601
6619
  flex-direction: column;
6602
6620
  gap: 6px;
6603
- padding: 10px 12px 4px;
6621
+ padding: 8px 10px 4px;
6604
6622
  }
6605
6623
  .ak-message__bubble--has-image .ak-message__files {
6606
6624
  padding: 8px 8px 4px;
@@ -6823,7 +6841,7 @@ var Zs = `
6823
6841
 
6824
6842
  /* Caption / text below the image, inside the same bubble */
6825
6843
  .ak-message__image-caption {
6826
- padding: 8px 12px 10px;
6844
+ padding: 8px 10px 8px;
6827
6845
  font-size: 14px;
6828
6846
  font-style: normal;
6829
6847
  color: var(--ak-text);
@@ -6841,7 +6859,7 @@ var Zs = `
6841
6859
  display: flex;
6842
6860
  align-items: center;
6843
6861
  gap: 5px;
6844
- padding: 11px 14px;
6862
+ padding: 9px 12px;
6845
6863
  background: var(--ak-bot-bg);
6846
6864
  border-radius: 16px;
6847
6865
  border-bottom-left-radius: 4px;
@@ -6894,7 +6912,7 @@ var Zs = `
6894
6912
  /* ── Composer ────────────────────────────────────────────────── */
6895
6913
  .ak-composer {
6896
6914
  position: relative; /* establishes positioning context for the attachment submenu */
6897
- padding: 10px 14px 12px;
6915
+ padding: 8px 12px 10px;
6898
6916
  border-top: 1px solid var(--ak-border);
6899
6917
  display: flex;
6900
6918
  flex-direction: column;
@@ -6961,7 +6979,7 @@ var Zs = `
6961
6979
  .ak-composer__attach-menu {
6962
6980
  position: absolute;
6963
6981
  bottom: calc(100% + 6px);
6964
- left: 14px;
6982
+ left: 12px;
6965
6983
  background: var(--ak-surface);
6966
6984
  border: 1px solid var(--ak-border);
6967
6985
  border-radius: 10px;
@@ -7622,7 +7640,7 @@ var Zs = `
7622
7640
  display: inline-flex;
7623
7641
  align-items: center;
7624
7642
  gap: 4px;
7625
- padding: 4px 10px 5px;
7643
+ padding: 3px 8px 4px;
7626
7644
  background: var(--ak-bg);
7627
7645
  border: 1px solid var(--ak-border);
7628
7646
  border-top: none;
@@ -7682,6 +7700,8 @@ var Zs = `
7682
7700
  min-height: 0;
7683
7701
  width: 100%;
7684
7702
  align-items: stretch;
7703
+ /* Launcher is hidden here — the negative offset would leave a dead strip. */
7704
+ margin-bottom: 0;
7685
7705
  }
7686
7706
 
7687
7707
  :host([data-open]) .ak-shell--floating {
@@ -7719,26 +7739,26 @@ function Os() {
7719
7739
  strokeLinecap: "round",
7720
7740
  strokeLinejoin: "round",
7721
7741
  children: [
7722
- /* @__PURE__ */ d("rect", {
7742
+ /* @__PURE__ */ c("rect", {
7723
7743
  x: "3",
7724
7744
  y: "11",
7725
7745
  width: "18",
7726
7746
  height: "10",
7727
7747
  rx: "2"
7728
7748
  }),
7729
- /* @__PURE__ */ d("circle", {
7749
+ /* @__PURE__ */ c("circle", {
7730
7750
  cx: "12",
7731
7751
  cy: "5",
7732
7752
  r: "2"
7733
7753
  }),
7734
- /* @__PURE__ */ d("path", { d: "M12 7v4" }),
7735
- /* @__PURE__ */ d("line", {
7754
+ /* @__PURE__ */ c("path", { d: "M12 7v4" }),
7755
+ /* @__PURE__ */ c("line", {
7736
7756
  x1: "8",
7737
7757
  y1: "16",
7738
7758
  x2: "8",
7739
7759
  y2: "16"
7740
7760
  }),
7741
- /* @__PURE__ */ d("line", {
7761
+ /* @__PURE__ */ c("line", {
7742
7762
  x1: "16",
7743
7763
  y1: "16",
7744
7764
  x2: "16",
@@ -7756,12 +7776,12 @@ function Fs() {
7756
7776
  stroke: "currentColor",
7757
7777
  strokeWidth: "2.5",
7758
7778
  strokeLinecap: "round",
7759
- children: [/* @__PURE__ */ d("line", {
7779
+ children: [/* @__PURE__ */ c("line", {
7760
7780
  x1: "18",
7761
7781
  y1: "6",
7762
7782
  x2: "6",
7763
7783
  y2: "18"
7764
- }), /* @__PURE__ */ d("line", {
7784
+ }), /* @__PURE__ */ c("line", {
7765
7785
  x1: "6",
7766
7786
  y1: "6",
7767
7787
  x2: "18",
@@ -7779,7 +7799,7 @@ function Ps() {
7779
7799
  strokeWidth: "2",
7780
7800
  strokeLinecap: "round",
7781
7801
  strokeLinejoin: "round",
7782
- children: [/* @__PURE__ */ d("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ d("path", { d: "M3 3v5h5" })]
7802
+ children: [/* @__PURE__ */ c("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ c("path", { d: "M3 3v5h5" })]
7783
7803
  });
7784
7804
  }
7785
7805
  function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideClose: i = !1 }) {
@@ -7789,22 +7809,22 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
7789
7809
  children: [/* @__PURE__ */ y("div", {
7790
7810
  className: "ak-header__row",
7791
7811
  children: [
7792
- r ? /* @__PURE__ */ d("img", {
7812
+ r ? /* @__PURE__ */ c("img", {
7793
7813
  src: r,
7794
7814
  alt: "",
7795
7815
  className: "ak-header__avatar",
7796
7816
  "aria-hidden": "true"
7797
- }) : /* @__PURE__ */ d("span", {
7817
+ }) : /* @__PURE__ */ c("span", {
7798
7818
  className: "ak-header__bot-icon",
7799
7819
  "aria-hidden": "true",
7800
- children: /* @__PURE__ */ d(Os, {})
7820
+ children: /* @__PURE__ */ c(Os, {})
7801
7821
  }),
7802
7822
  /* @__PURE__ */ y("div", {
7803
7823
  className: "ak-header__title-group",
7804
- children: [/* @__PURE__ */ d("span", {
7824
+ children: [/* @__PURE__ */ c("span", {
7805
7825
  className: "ak-header__title",
7806
7826
  children: e
7807
- }), t && /* @__PURE__ */ d("span", {
7827
+ }), t && /* @__PURE__ */ c("span", {
7808
7828
  className: "ak-header__subtitle",
7809
7829
  children: t
7810
7830
  })]
@@ -7816,24 +7836,24 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
7816
7836
  gap: "8px"
7817
7837
  },
7818
7838
  children: [
7819
- /* @__PURE__ */ d("span", {
7839
+ /* @__PURE__ */ c("span", {
7820
7840
  className: "ak-header__status",
7821
7841
  "aria-hidden": "true"
7822
7842
  }),
7823
- n && /* @__PURE__ */ d("button", {
7843
+ n && /* @__PURE__ */ c("button", {
7824
7844
  className: `ak-header__button${s ? " ak-header__button--active" : ""}`,
7825
7845
  onClick: () => o(!0),
7826
7846
  "aria-label": "New conversation",
7827
7847
  type: "button",
7828
7848
  title: "Start a new conversation (Retains current conversation to memory)",
7829
- children: /* @__PURE__ */ d(Ps, {})
7849
+ children: /* @__PURE__ */ c(Ps, {})
7830
7850
  }),
7831
- !i && /* @__PURE__ */ d("button", {
7851
+ !i && /* @__PURE__ */ c("button", {
7832
7852
  className: "ak-header__close",
7833
7853
  onClick: a,
7834
7854
  "aria-label": "Close chat",
7835
7855
  type: "button",
7836
- children: /* @__PURE__ */ d(Fs, {})
7856
+ children: /* @__PURE__ */ c(Fs, {})
7837
7857
  })
7838
7858
  ]
7839
7859
  })
@@ -7843,21 +7863,21 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
7843
7863
  role: "alert",
7844
7864
  children: [/* @__PURE__ */ y("div", {
7845
7865
  className: "ak-header__confirm-text",
7846
- children: [/* @__PURE__ */ d("span", {
7866
+ children: [/* @__PURE__ */ c("span", {
7847
7867
  className: "ak-header__confirm-title",
7848
7868
  children: "End this conversation?"
7849
- }), /* @__PURE__ */ d("span", {
7869
+ }), /* @__PURE__ */ c("span", {
7850
7870
  className: "ak-header__confirm-sub",
7851
7871
  children: "All messages will be removed"
7852
7872
  })]
7853
7873
  }), /* @__PURE__ */ y("div", {
7854
7874
  className: "ak-header__confirm-actions",
7855
- children: [/* @__PURE__ */ d("button", {
7875
+ children: [/* @__PURE__ */ c("button", {
7856
7876
  className: "ak-header__confirm-cancel",
7857
7877
  type: "button",
7858
7878
  onClick: () => o(!1),
7859
7879
  children: "Cancel"
7860
- }), /* @__PURE__ */ d("button", {
7880
+ }), /* @__PURE__ */ c("button", {
7861
7881
  className: "ak-header__confirm-ok",
7862
7882
  type: "button",
7863
7883
  onClick: () => {
@@ -7882,6 +7902,11 @@ function $e(e) {
7882
7902
  "tel"
7883
7903
  ].includes(r) ? t : null : t;
7884
7904
  }
7905
+ function Vs(e) {
7906
+ 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)\$/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, `
7907
+
7908
+ `);
7909
+ }
7885
7910
  function ia(e) {
7886
7911
  const [, t] = ne(0);
7887
7912
  X(() => {
@@ -7890,9 +7915,9 @@ function ia(e) {
7890
7915
  return () => clearInterval(r);
7891
7916
  }, [e]);
7892
7917
  }
7893
- var Vs = 800;
7894
- function zs({ up: e }) {
7895
- return /* @__PURE__ */ d("svg", {
7918
+ var zs = 800;
7919
+ function Ws({ up: e }) {
7920
+ return /* @__PURE__ */ c("svg", {
7896
7921
  width: "10",
7897
7922
  height: "10",
7898
7923
  viewBox: "0 0 24 24",
@@ -7902,14 +7927,14 @@ function zs({ up: e }) {
7902
7927
  strokeLinecap: "round",
7903
7928
  strokeLinejoin: "round",
7904
7929
  "aria-hidden": "true",
7905
- children: /* @__PURE__ */ d("polyline", { points: e ? "18 15 12 9 6 15" : "6 9 12 15 18 9" })
7930
+ children: /* @__PURE__ */ c("polyline", { points: e ? "18 15 12 9 6 15" : "6 9 12 15 18 9" })
7906
7931
  });
7907
7932
  }
7908
7933
  function ht({ event: e, active: t }) {
7909
- return t ? /* @__PURE__ */ d("span", {
7934
+ return t ? /* @__PURE__ */ c("span", {
7910
7935
  className: "ak-progress__spinner",
7911
7936
  "aria-hidden": "true"
7912
- }) : /* @__PURE__ */ d("svg", {
7937
+ }) : /* @__PURE__ */ c("svg", {
7913
7938
  className: e.ok === !1 ? "ak-progress__step-icon ak-progress__step-icon--fail" : "ak-progress__step-icon",
7914
7939
  width: "11",
7915
7940
  height: "11",
@@ -7920,121 +7945,125 @@ function ht({ event: e, active: t }) {
7920
7945
  strokeLinecap: "round",
7921
7946
  strokeLinejoin: "round",
7922
7947
  "aria-hidden": "true",
7923
- children: e.ok === !1 ? /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ d("line", {
7948
+ children: e.ok === !1 ? /* @__PURE__ */ y(ye, { children: [/* @__PURE__ */ c("line", {
7924
7949
  x1: "18",
7925
7950
  y1: "6",
7926
7951
  x2: "6",
7927
7952
  y2: "18"
7928
- }), /* @__PURE__ */ d("line", {
7953
+ }), /* @__PURE__ */ c("line", {
7929
7954
  x1: "6",
7930
7955
  y1: "6",
7931
7956
  x2: "18",
7932
7957
  y2: "18"
7933
- })] }) : /* @__PURE__ */ d("polyline", { points: "20 6 9 17 4 12" })
7958
+ })] }) : /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
7934
7959
  });
7935
7960
  }
7936
- function yr({ events: e, live: t }) {
7937
- ia(t && e.some((i) => i.status === "active"));
7938
- const r = Date.now(), a = e[0]?.startedAtMs, n = e.reduce((i, s, o) => s.status === "active" ? o : i, -1);
7939
- return /* @__PURE__ */ d("ul", {
7961
+ function yr({ events: e, live: t, answerStartedAtMs: r }) {
7962
+ ia(t && !r && e.some((s) => s.status === "active"));
7963
+ const a = r ?? Date.now(), n = e[0]?.startedAtMs, i = e.reduce((s, o, l) => o.status === "active" ? l : s, -1);
7964
+ return /* @__PURE__ */ c("ul", {
7940
7965
  className: "ak-progress__steps",
7941
7966
  role: "list",
7942
- children: e.map((i, s) => {
7943
- const o = t && i.status === "active", l = o && s === n ? ut(a ? r - a : void 0) : o ? null : ut(i.durationMs);
7967
+ children: e.map((s, o) => {
7968
+ const l = t && s.status === "active", d = l && o === i ? ut(n ? a - n : void 0) : l ? null : ut(s.durationMs);
7944
7969
  return /* @__PURE__ */ y("li", {
7945
- className: o ? "ak-progress__step ak-progress__step--active" : "ak-progress__step",
7970
+ className: l ? "ak-progress__step ak-progress__step--active" : "ak-progress__step",
7946
7971
  children: [
7947
- /* @__PURE__ */ d(ht, {
7948
- event: i,
7949
- active: o
7972
+ /* @__PURE__ */ c(ht, {
7973
+ event: s,
7974
+ active: l
7950
7975
  }),
7951
- /* @__PURE__ */ d("span", {
7976
+ /* @__PURE__ */ c("span", {
7952
7977
  className: "ak-progress__step-text",
7953
- children: i.text
7978
+ children: s.text
7954
7979
  }),
7955
- l && /* @__PURE__ */ y("span", {
7980
+ d && /* @__PURE__ */ y("span", {
7956
7981
  className: "ak-progress__step-dur",
7957
- children: ["· ", l]
7982
+ children: ["· ", d]
7958
7983
  })
7959
7984
  ]
7960
- }, `${i.toolId ?? i.stage}-${s}`);
7985
+ }, `${s.toolId ?? s.stage}-${o}`);
7961
7986
  })
7962
7987
  });
7963
7988
  }
7964
- function Ws({ events: e }) {
7965
- const [t, r] = ne(0), a = Math.min(t, e.length - 1), n = a < e.length - 1;
7989
+ function Ds({ events: e, answerStartedAtMs: t }) {
7990
+ const [r, a] = ne(0), n = Math.min(r, e.length - 1), i = n < e.length - 1;
7966
7991
  X(() => {
7967
- if (!n) return;
7968
- const c = setTimeout(() => r((u) => Math.min(u + 1, e.length - 1)), Vs);
7969
- return () => clearTimeout(c);
7992
+ if (!i) return;
7993
+ const h = setTimeout(() => a((u) => Math.min(u + 1, e.length - 1)), zs);
7994
+ return () => clearTimeout(h);
7970
7995
  }, [
7996
+ i,
7971
7997
  n,
7972
- a,
7973
7998
  e.length
7974
7999
  ]);
7975
- const i = e[a], s = !n && i.status === "done";
7976
- ia(!s);
7977
- const o = e[0]?.startedAtMs, l = s ? null : ut(o ? Date.now() - o : void 0);
7978
- return /* @__PURE__ */ d("ul", {
8000
+ const s = e[n], o = !i && s.status === "done";
8001
+ ia(!o && !t);
8002
+ const l = e[0]?.startedAtMs, d = o ? null : ut(l ? (t ?? Date.now()) - l : void 0);
8003
+ return /* @__PURE__ */ c("ul", {
7979
8004
  className: "ak-progress__list",
7980
8005
  role: "list",
7981
8006
  children: /* @__PURE__ */ y("li", {
7982
8007
  className: "ak-progress__item ak-progress__item--active",
7983
8008
  children: [
7984
- s ? /* @__PURE__ */ d(ht, {
7985
- event: i,
8009
+ o ? /* @__PURE__ */ c(ht, {
8010
+ event: s,
7986
8011
  active: !1
7987
- }) : /* @__PURE__ */ d("span", {
8012
+ }) : /* @__PURE__ */ c("span", {
7988
8013
  className: "ak-progress__spinner",
7989
8014
  "aria-hidden": "true"
7990
8015
  }),
7991
- /* @__PURE__ */ d("span", {
8016
+ /* @__PURE__ */ c("span", {
7992
8017
  className: "ak-progress__text",
7993
- children: i.text
8018
+ children: s.text
7994
8019
  }),
7995
- l && /* @__PURE__ */ y("span", {
8020
+ d && /* @__PURE__ */ y("span", {
7996
8021
  className: "ak-progress__step-dur",
7997
- children: ["· ", l]
8022
+ children: ["· ", d]
7998
8023
  })
7999
8024
  ]
8000
8025
  })
8001
8026
  });
8002
8027
  }
8003
- function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1, turnMeta: n }) {
8004
- const [i, s] = ne(!r);
8028
+ function Us({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1, turnMeta: n, answerStartedAtMs: i }) {
8029
+ const [s, o] = ne(!r);
8005
8030
  X(() => {
8006
- a && s(!r);
8031
+ a && o(!r);
8007
8032
  }, [a]);
8008
- const o = n?.mode;
8033
+ const l = n?.mode;
8009
8034
  if (!a)
8010
- return t.length === 0 ? e ? /* @__PURE__ */ d("ul", {
8035
+ return t.length === 0 ? e ? /* @__PURE__ */ c("ul", {
8011
8036
  className: "ak-progress__list",
8012
8037
  role: "list",
8013
8038
  children: /* @__PURE__ */ y("li", {
8014
8039
  className: "ak-progress__item ak-progress__item--active",
8015
- children: [/* @__PURE__ */ d("span", {
8040
+ children: [/* @__PURE__ */ c("span", {
8016
8041
  className: "ak-progress__spinner",
8017
8042
  "aria-hidden": "true"
8018
- }), /* @__PURE__ */ d("span", {
8043
+ }), /* @__PURE__ */ c("span", {
8019
8044
  className: "ak-progress__text",
8020
8045
  children: e
8021
8046
  })]
8022
8047
  })
8023
- }) : null : o === "detailed" ? /* @__PURE__ */ d(yr, {
8048
+ }) : null : l === "detailed" ? /* @__PURE__ */ c(yr, {
8049
+ events: t,
8050
+ live: !0,
8051
+ answerStartedAtMs: i
8052
+ }) : /* @__PURE__ */ c(Ds, {
8024
8053
  events: t,
8025
- live: !0
8026
- }) : /* @__PURE__ */ d(Ws, { events: t });
8027
- const l = ut(n?.totalMs), c = l ? `Worked for ${l}` : "Finished working";
8028
- return o === "detailed" && t.length > 0 ? /* @__PURE__ */ y("div", {
8054
+ answerStartedAtMs: i
8055
+ });
8056
+ const d = ut(n?.totalMs), h = d ? `Worked for ${d}` : "Finished working";
8057
+ return l === "detailed" && t.length > 0 ? /* @__PURE__ */ y("div", {
8029
8058
  className: "ak-progress",
8030
8059
  children: [/* @__PURE__ */ y("button", {
8031
8060
  type: "button",
8032
- onClick: () => s((u) => !u),
8061
+ onClick: () => o((u) => !u),
8033
8062
  className: "ak-progress__summary",
8034
- "aria-expanded": i,
8035
- "aria-label": i ? "Hide working steps" : "Show working steps",
8063
+ "aria-expanded": s,
8064
+ "aria-label": s ? "Hide working steps" : "Show working steps",
8036
8065
  children: [
8037
- /* @__PURE__ */ d(ht, {
8066
+ /* @__PURE__ */ c(ht, {
8038
8067
  event: {
8039
8068
  stage: "",
8040
8069
  text: "",
@@ -8043,7 +8072,7 @@ function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
8043
8072
  },
8044
8073
  active: !1
8045
8074
  }),
8046
- /* @__PURE__ */ d("span", { children: c }),
8075
+ /* @__PURE__ */ c("span", { children: h }),
8047
8076
  /* @__PURE__ */ y("span", {
8048
8077
  className: "ak-progress__step-dur",
8049
8078
  children: [
@@ -8053,17 +8082,17 @@ function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
8053
8082
  t.length === 1 ? "" : "s"
8054
8083
  ]
8055
8084
  }),
8056
- /* @__PURE__ */ d(zs, { up: i })
8085
+ /* @__PURE__ */ c(Ws, { up: s })
8057
8086
  ]
8058
- }), i && /* @__PURE__ */ d(yr, {
8087
+ }), s && /* @__PURE__ */ c(yr, {
8059
8088
  events: t,
8060
8089
  live: !1
8061
8090
  })]
8062
- }) : o === "standard" && n ? /* @__PURE__ */ d("div", {
8091
+ }) : l === "standard" && n ? /* @__PURE__ */ c("div", {
8063
8092
  className: "ak-progress",
8064
8093
  children: /* @__PURE__ */ y("p", {
8065
8094
  className: "ak-progress__summary ak-progress__summary--static",
8066
- children: [/* @__PURE__ */ d(ht, {
8095
+ children: [/* @__PURE__ */ c(ht, {
8067
8096
  event: {
8068
8097
  stage: "",
8069
8098
  text: "",
@@ -8071,27 +8100,27 @@ function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
8071
8100
  status: "done"
8072
8101
  },
8073
8102
  active: !1
8074
- }), /* @__PURE__ */ d("span", { children: c })]
8103
+ }), /* @__PURE__ */ c("span", { children: h })]
8075
8104
  })
8076
8105
  }) : null;
8077
8106
  }
8078
- function Us() {
8079
- return /* @__PURE__ */ d("svg", {
8107
+ function Bs() {
8108
+ return /* @__PURE__ */ c("svg", {
8080
8109
  className: "ak-agent-status__icon",
8081
8110
  width: "13",
8082
8111
  height: "13",
8083
8112
  viewBox: "0 0 24 24",
8084
8113
  fill: "currentColor",
8085
8114
  "aria-hidden": "true",
8086
- children: /* @__PURE__ */ d("path", { d: "M12 2C12 2 12.7 8.1 14.5 9.5C16.3 10.9 22 12 22 12C22 12 16.3 13.1 14.5 14.5C12.7 15.9 12 22 12 22C12 22 11.3 15.9 9.5 14.5C7.7 13.1 2 12 2 12C2 12 7.7 10.9 9.5 9.5C11.3 8.1 12 2 12 2Z" })
8115
+ children: /* @__PURE__ */ c("path", { d: "M12 2C12 2 12.7 8.1 14.5 9.5C16.3 10.9 22 12 22 12C22 12 16.3 13.1 14.5 14.5C12.7 15.9 12 22 12 22C12 22 11.3 15.9 9.5 14.5C7.7 13.1 2 12 2 12C2 12 7.7 10.9 9.5 9.5C11.3 8.1 12 2 12 2Z" })
8087
8116
  });
8088
8117
  }
8089
- function Bs({ status: e }) {
8118
+ function Gs({ status: e }) {
8090
8119
  return /* @__PURE__ */ y("div", {
8091
8120
  className: "ak-agent-status",
8092
8121
  role: "status",
8093
8122
  "aria-live": "polite",
8094
- children: [/* @__PURE__ */ d(Us, {}), /* @__PURE__ */ d("span", {
8123
+ children: [/* @__PURE__ */ c(Bs, {}), /* @__PURE__ */ c("span", {
8095
8124
  className: "ak-agent-status__text",
8096
8125
  children: e
8097
8126
  })]
@@ -8104,17 +8133,17 @@ function br({ messageId: e, images: t, onCellClick: r }) {
8104
8133
  const s = t[0];
8105
8134
  return /* @__PURE__ */ y("div", {
8106
8135
  className: "ak-gallery ak-gallery--single",
8107
- children: [/* @__PURE__ */ d("button", {
8136
+ children: [/* @__PURE__ */ c("button", {
8108
8137
  type: "button",
8109
8138
  onClick: () => r(0),
8110
8139
  className: "ak-gallery__cell ak-gallery__cell--hero",
8111
8140
  "aria-label": "Open image preview",
8112
- children: /* @__PURE__ */ d("img", {
8141
+ children: /* @__PURE__ */ c("img", {
8113
8142
  src: s.src,
8114
8143
  alt: s.alt,
8115
8144
  className: "ak-gallery__img ak-gallery__img--contain"
8116
8145
  })
8117
- }), /* @__PURE__ */ d("a", {
8146
+ }), /* @__PURE__ */ c("a", {
8118
8147
  href: $e(s.downloadHref) ?? void 0,
8119
8148
  download: !0,
8120
8149
  className: "ak-message__image-dl-icon",
@@ -8130,9 +8159,9 @@ function br({ messageId: e, images: t, onCellClick: r }) {
8130
8159
  strokeLinecap: "round",
8131
8160
  strokeLinejoin: "round",
8132
8161
  children: [
8133
- /* @__PURE__ */ d("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
8134
- /* @__PURE__ */ d("polyline", { points: "7 10 12 15 17 10" }),
8135
- /* @__PURE__ */ d("line", {
8162
+ /* @__PURE__ */ c("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
8163
+ /* @__PURE__ */ c("polyline", { points: "7 10 12 15 17 10" }),
8164
+ /* @__PURE__ */ c("line", {
8136
8165
  x1: "12",
8137
8166
  y1: "15",
8138
8167
  x2: "12",
@@ -8143,9 +8172,9 @@ function br({ messageId: e, images: t, onCellClick: r }) {
8143
8172
  })]
8144
8173
  });
8145
8174
  }
8146
- if (a === 2) return /* @__PURE__ */ d("div", {
8175
+ if (a === 2) return /* @__PURE__ */ c("div", {
8147
8176
  className: "ak-gallery ak-gallery--two",
8148
- children: t.map((s, o) => /* @__PURE__ */ d(Re, {
8177
+ children: t.map((s, o) => /* @__PURE__ */ c(Re, {
8149
8178
  src: s.src,
8150
8179
  alt: s.alt,
8151
8180
  onClick: () => r(o)
@@ -8153,17 +8182,17 @@ function br({ messageId: e, images: t, onCellClick: r }) {
8153
8182
  });
8154
8183
  if (a === 3) return /* @__PURE__ */ y("div", {
8155
8184
  className: "ak-gallery ak-gallery--three",
8156
- children: [/* @__PURE__ */ d(Re, {
8185
+ children: [/* @__PURE__ */ c(Re, {
8157
8186
  src: t[0].src,
8158
8187
  alt: t[0].alt,
8159
8188
  onClick: () => r(0)
8160
8189
  }, t[0].key ?? `${e}-0`), /* @__PURE__ */ y("div", {
8161
8190
  className: "ak-gallery__col",
8162
- children: [/* @__PURE__ */ d(Re, {
8191
+ children: [/* @__PURE__ */ c(Re, {
8163
8192
  src: t[1].src,
8164
8193
  alt: t[1].alt,
8165
8194
  onClick: () => r(1)
8166
- }, t[1].key ?? `${e}-1`), /* @__PURE__ */ d(Re, {
8195
+ }, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(Re, {
8167
8196
  src: t[2].src,
8168
8197
  alt: t[2].alt,
8169
8198
  onClick: () => r(2)
@@ -8171,11 +8200,11 @@ function br({ messageId: e, images: t, onCellClick: r }) {
8171
8200
  })]
8172
8201
  });
8173
8202
  const n = t.slice(0, 4), i = a > 4 ? a - 4 : 0;
8174
- return /* @__PURE__ */ d("div", {
8203
+ return /* @__PURE__ */ c("div", {
8175
8204
  className: "ak-gallery ak-gallery--grid",
8176
8205
  children: n.map((s, o) => {
8177
8206
  const l = o === n.length - 1;
8178
- return /* @__PURE__ */ d(Re, {
8207
+ return /* @__PURE__ */ c(Re, {
8179
8208
  src: s.src,
8180
8209
  alt: s.alt,
8181
8210
  overlayCount: l && i > 0 ? i : 0,
@@ -8190,7 +8219,7 @@ function Re({ src: e, alt: t, overlayCount: r = 0, onClick: a }) {
8190
8219
  onClick: a,
8191
8220
  className: "ak-gallery__cell",
8192
8221
  "aria-label": "Open image preview",
8193
- children: [/* @__PURE__ */ d("img", {
8222
+ children: [/* @__PURE__ */ c("img", {
8194
8223
  src: e,
8195
8224
  alt: t,
8196
8225
  className: "ak-gallery__img",
@@ -8234,7 +8263,7 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8234
8263
  e.length
8235
8264
  ]
8236
8265
  }),
8237
- /* @__PURE__ */ d("a", {
8266
+ /* @__PURE__ */ c("a", {
8238
8267
  href: $e(s.downloadHref) ?? void 0,
8239
8268
  download: !0,
8240
8269
  target: "_blank",
@@ -8252,9 +8281,9 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8252
8281
  strokeLinecap: "round",
8253
8282
  strokeLinejoin: "round",
8254
8283
  children: [
8255
- /* @__PURE__ */ d("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
8256
- /* @__PURE__ */ d("polyline", { points: "7 10 12 15 17 10" }),
8257
- /* @__PURE__ */ d("line", {
8284
+ /* @__PURE__ */ c("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
8285
+ /* @__PURE__ */ c("polyline", { points: "7 10 12 15 17 10" }),
8286
+ /* @__PURE__ */ c("line", {
8258
8287
  x1: "12",
8259
8288
  y1: "15",
8260
8289
  x2: "12",
@@ -8263,7 +8292,7 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8263
8292
  ]
8264
8293
  })
8265
8294
  }),
8266
- /* @__PURE__ */ d("button", {
8295
+ /* @__PURE__ */ c("button", {
8267
8296
  type: "button",
8268
8297
  onClick: r,
8269
8298
  className: "ak-lightbox__btn",
@@ -8278,12 +8307,12 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8278
8307
  strokeWidth: "2",
8279
8308
  strokeLinecap: "round",
8280
8309
  strokeLinejoin: "round",
8281
- children: [/* @__PURE__ */ d("line", {
8310
+ children: [/* @__PURE__ */ c("line", {
8282
8311
  x1: "18",
8283
8312
  y1: "6",
8284
8313
  x2: "6",
8285
8314
  y2: "18"
8286
- }), /* @__PURE__ */ d("line", {
8315
+ }), /* @__PURE__ */ c("line", {
8287
8316
  x1: "6",
8288
8317
  y1: "6",
8289
8318
  x2: "18",
@@ -8293,14 +8322,14 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8293
8322
  })
8294
8323
  ]
8295
8324
  }),
8296
- e.length > 1 && /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ d("button", {
8325
+ e.length > 1 && /* @__PURE__ */ y(ye, { children: [/* @__PURE__ */ c("button", {
8297
8326
  type: "button",
8298
8327
  onClick: (o) => {
8299
8328
  o.stopPropagation(), a((i - 1 + e.length) % e.length);
8300
8329
  },
8301
8330
  className: "ak-lightbox__nav ak-lightbox__nav--prev",
8302
8331
  "aria-label": "Previous image",
8303
- children: /* @__PURE__ */ d("svg", {
8332
+ children: /* @__PURE__ */ c("svg", {
8304
8333
  width: "20",
8305
8334
  height: "20",
8306
8335
  viewBox: "0 0 24 24",
@@ -8309,16 +8338,16 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8309
8338
  strokeWidth: "2",
8310
8339
  strokeLinecap: "round",
8311
8340
  strokeLinejoin: "round",
8312
- children: /* @__PURE__ */ d("polyline", { points: "15 18 9 12 15 6" })
8341
+ children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
8313
8342
  })
8314
- }), /* @__PURE__ */ d("button", {
8343
+ }), /* @__PURE__ */ c("button", {
8315
8344
  type: "button",
8316
8345
  onClick: (o) => {
8317
8346
  o.stopPropagation(), a((i + 1) % e.length);
8318
8347
  },
8319
8348
  className: "ak-lightbox__nav ak-lightbox__nav--next",
8320
8349
  "aria-label": "Next image",
8321
- children: /* @__PURE__ */ d("svg", {
8350
+ children: /* @__PURE__ */ c("svg", {
8322
8351
  width: "20",
8323
8352
  height: "20",
8324
8353
  viewBox: "0 0 24 24",
@@ -8327,10 +8356,10 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
8327
8356
  strokeWidth: "2",
8328
8357
  strokeLinecap: "round",
8329
8358
  strokeLinejoin: "round",
8330
- children: /* @__PURE__ */ d("polyline", { points: "9 18 15 12 9 6" })
8359
+ children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
8331
8360
  })
8332
8361
  })] }),
8333
- /* @__PURE__ */ d("img", {
8362
+ /* @__PURE__ */ c("img", {
8334
8363
  src: s.src,
8335
8364
  alt: s.alt ?? "Image preview",
8336
8365
  className: "ak-lightbox__img",
@@ -8370,7 +8399,7 @@ function xr({ url: e, mimeType: t, fileName: r }) {
8370
8399
  rel: "noopener noreferrer",
8371
8400
  className: "ak-file-chip",
8372
8401
  title: a,
8373
- children: [/* @__PURE__ */ d("span", {
8402
+ children: [/* @__PURE__ */ c("span", {
8374
8403
  className: `ak-file-chip__icon ak-file-chip__icon--${i.variant}`,
8375
8404
  "aria-hidden": !0,
8376
8405
  children: /* @__PURE__ */ y("svg", {
@@ -8382,21 +8411,21 @@ function xr({ url: e, mimeType: t, fileName: r }) {
8382
8411
  strokeWidth: "2",
8383
8412
  strokeLinecap: "round",
8384
8413
  strokeLinejoin: "round",
8385
- children: [/* @__PURE__ */ d("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ d("polyline", { points: "14 2 14 8 20 8" })]
8414
+ children: [/* @__PURE__ */ c("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ c("polyline", { points: "14 2 14 8 20 8" })]
8386
8415
  })
8387
8416
  }), /* @__PURE__ */ y("span", {
8388
8417
  className: "ak-file-chip__body",
8389
- children: [/* @__PURE__ */ d("span", {
8418
+ children: [/* @__PURE__ */ c("span", {
8390
8419
  className: "ak-file-chip__name",
8391
8420
  children: a
8392
- }), /* @__PURE__ */ d("span", {
8421
+ }), /* @__PURE__ */ c("span", {
8393
8422
  className: "ak-file-chip__label",
8394
8423
  children: i.label
8395
8424
  })]
8396
8425
  })]
8397
8426
  });
8398
8427
  }
8399
- function Gs(e) {
8428
+ function Hs(e) {
8400
8429
  try {
8401
8430
  return new Date(e).toLocaleTimeString([], {
8402
8431
  hour: "2-digit",
@@ -8415,15 +8444,15 @@ function Y(e) {
8415
8444
  for (; (n = wr.exec(e)) !== null; ) {
8416
8445
  n.index > r && t.push(e.slice(r, n.index));
8417
8446
  const i = n[0];
8418
- if (i.startsWith("`")) t.push(/* @__PURE__ */ d("code", {
8447
+ if (i.startsWith("`")) t.push(/* @__PURE__ */ c("code", {
8419
8448
  className: "ak-md-ic",
8420
8449
  children: i.slice(1, -1)
8421
8450
  }, a++));
8422
- else if (i.startsWith("**")) t.push(/* @__PURE__ */ d("strong", { children: i.slice(2, -2) }, a++));
8423
- else if (i.startsWith("*")) t.push(/* @__PURE__ */ d("em", { children: i.slice(1, -1) }, a++));
8451
+ else if (i.startsWith("**")) t.push(/* @__PURE__ */ c("strong", { children: i.slice(2, -2) }, a++));
8452
+ else if (i.startsWith("*")) t.push(/* @__PURE__ */ c("em", { children: i.slice(1, -1) }, a++));
8424
8453
  else if (i.startsWith("![")) {
8425
8454
  const s = i.match(/!\[([^\]]*)\]\(([^)]+)\)/), o = $e(s?.[2]);
8426
- s && o ? t.push(/* @__PURE__ */ d("a", {
8455
+ s && o ? t.push(/* @__PURE__ */ c("a", {
8427
8456
  href: o,
8428
8457
  target: "_blank",
8429
8458
  rel: "noopener noreferrer",
@@ -8431,7 +8460,7 @@ function Y(e) {
8431
8460
  }, a++)) : s && t.push(s[1] || "image");
8432
8461
  } else {
8433
8462
  const s = i.match(/\[(.+?)\]\((.+?)\)/), o = $e(s?.[2]);
8434
- s && o ? t.push(/* @__PURE__ */ d("a", {
8463
+ s && o ? t.push(/* @__PURE__ */ c("a", {
8435
8464
  href: o,
8436
8465
  target: "_blank",
8437
8466
  rel: "noopener noreferrer",
@@ -8442,29 +8471,27 @@ function Y(e) {
8442
8471
  }
8443
8472
  return r < e.length && t.push(e.slice(r)), t;
8444
8473
  }
8445
- function Hs(e) {
8446
- e = 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(/\$\$[\s\S]+?\$\$/g, "").replace(/\$([^$]+)\$/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, `
8447
-
8448
- `);
8474
+ function Ys(e) {
8475
+ e = Vs(e);
8449
8476
  const t = e.split(`
8450
8477
  `), r = [];
8451
8478
  let a = 0, n = 0;
8452
8479
  for (; a < t.length; ) {
8453
8480
  const i = t[a], s = i.match(/^(\s*)```/);
8454
8481
  if (s) {
8455
- const c = s[1], u = i.trimStart().match(/^```(\w+)?\s*$/)?.[1] || "", h = [];
8482
+ const d = s[1], h = i.trimStart().match(/^```(\w+)?\s*$/)?.[1] || "", u = [];
8456
8483
  for (a++; a < t.length && !t[a].trimStart().startsWith("```"); )
8457
- h.push(t[a].startsWith(c) ? t[a].slice(c.length) : t[a]), a++;
8484
+ u.push(t[a].startsWith(d) ? t[a].slice(d.length) : t[a]), a++;
8458
8485
  a < t.length && t[a].trimStart().startsWith("```") && a++, r.push(/* @__PURE__ */ y("div", {
8459
8486
  className: "ak-md-pre-wrap",
8460
- children: [u && /* @__PURE__ */ d("span", {
8487
+ children: [h && /* @__PURE__ */ c("span", {
8461
8488
  className: "ak-md-pre-lang",
8462
- children: u
8463
- }), /* @__PURE__ */ d("pre", {
8464
- className: `ak-md-pre${u ? ` ak-md-pre--${u}` : ""}`,
8465
- children: /* @__PURE__ */ d("code", {
8489
+ children: h
8490
+ }), /* @__PURE__ */ c("pre", {
8491
+ className: `ak-md-pre${h ? ` ak-md-pre--${h}` : ""}`,
8492
+ children: /* @__PURE__ */ c("code", {
8466
8493
  className: "ak-md-code",
8467
- children: h.join(`
8494
+ children: u.join(`
8468
8495
  `)
8469
8496
  })
8470
8497
  })]
@@ -8473,56 +8500,56 @@ function Hs(e) {
8473
8500
  }
8474
8501
  const o = i.match(/^(#{1,6})(\s+.*)?$/);
8475
8502
  if (o) {
8476
- const c = o[1].length, u = o[2] ? Y(o[2].trim()) : "";
8477
- c === 1 ? r.push(/* @__PURE__ */ d("h1", {
8503
+ const d = o[1].length, h = o[2] ? Y(o[2].trim()) : "";
8504
+ d === 1 ? r.push(/* @__PURE__ */ c("h1", {
8478
8505
  className: "ak-md-h1",
8479
- children: u
8480
- }, n++)) : c === 2 ? r.push(/* @__PURE__ */ d("h2", {
8506
+ children: h
8507
+ }, n++)) : d === 2 ? r.push(/* @__PURE__ */ c("h2", {
8481
8508
  className: "ak-md-h2",
8482
- children: u
8483
- }, n++)) : c === 3 ? r.push(/* @__PURE__ */ d("h3", {
8509
+ children: h
8510
+ }, n++)) : d === 3 ? r.push(/* @__PURE__ */ c("h3", {
8484
8511
  className: "ak-md-h3",
8485
- children: u
8486
- }, n++)) : c === 4 ? r.push(/* @__PURE__ */ d("h4", {
8512
+ children: h
8513
+ }, n++)) : d === 4 ? r.push(/* @__PURE__ */ c("h4", {
8487
8514
  className: "ak-md-h4",
8488
- children: u
8489
- }, n++)) : c === 5 ? r.push(/* @__PURE__ */ d("h5", {
8515
+ children: h
8516
+ }, n++)) : d === 5 ? r.push(/* @__PURE__ */ c("h5", {
8490
8517
  className: "ak-md-h5",
8491
- children: u
8492
- }, n++)) : r.push(/* @__PURE__ */ d("h6", {
8518
+ children: h
8519
+ }, n++)) : r.push(/* @__PURE__ */ c("h6", {
8493
8520
  className: "ak-md-h6",
8494
- children: u
8521
+ children: h
8495
8522
  }, n++)), a++;
8496
8523
  continue;
8497
8524
  }
8498
8525
  if (/^[-*_]{3,}$/.test(i.trim())) {
8499
- r.push(/* @__PURE__ */ d("hr", { className: "ak-md-hr" }, n++)), a++;
8526
+ r.push(/* @__PURE__ */ c("hr", { className: "ak-md-hr" }, n++)), a++;
8500
8527
  continue;
8501
8528
  }
8502
8529
  if (/^[-*+]\s/.test(i)) {
8503
- const c = [];
8504
- let u = a;
8505
- for (; u < t.length && (/^[-*+]\s/.test(t[u]) || t[u].trim() === ""); ) {
8506
- if (t[u].trim() === "") {
8507
- u++;
8530
+ const d = [];
8531
+ let h = a;
8532
+ for (; h < t.length && (/^[-*+]\s/.test(t[h]) || t[h].trim() === ""); ) {
8533
+ if (t[h].trim() === "") {
8534
+ h++;
8508
8535
  continue;
8509
8536
  }
8510
- const h = t[u].length - t[u].trimStart().length, p = t[u].replace(/^[-*+]\s+/, ""), f = [], v = [];
8511
- let k = u + 1;
8512
- for (; k < t.length && k < u + 20; ) {
8513
- const g = t[k];
8514
- if (g.length - g.trimStart().length > h && g.trim() !== "") {
8515
- const N = g.trim();
8516
- /^[-*+]\s/.test(N) ? f.push(/* @__PURE__ */ d("li", { children: Y(N.replace(/^[-*+]\s+/, "")) }, `nested-${k}`)) : v.push(/* @__PURE__ */ d("p", {
8537
+ const u = t[h].length - t[h].trimStart().length, p = t[h].replace(/^[-*+]\s+/, ""), f = [], k = [];
8538
+ let v = h + 1;
8539
+ for (; v < t.length && v < h + 20; ) {
8540
+ const g = t[v];
8541
+ if (g.length - g.trimStart().length > u && g.trim() !== "") {
8542
+ const w = g.trim();
8543
+ /^[-*+]\s/.test(w) ? f.push(/* @__PURE__ */ c("li", { children: Y(w.replace(/^[-*+]\s+/, "")) }, `nested-${v}`)) : k.push(/* @__PURE__ */ c("p", {
8517
8544
  style: { margin: "0.2em 0 0" },
8518
- children: Y(N)
8519
- }, `cont-${k}`)), k++;
8545
+ children: Y(w)
8546
+ }, `cont-${v}`)), v++;
8520
8547
  } else break;
8521
8548
  }
8522
- const I = v.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ve, { children: [
8549
+ const S = k.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ye, { children: [
8523
8550
  Y(p),
8524
- v,
8525
- f.length > 0 && /* @__PURE__ */ d("ul", {
8551
+ k,
8552
+ f.length > 0 && /* @__PURE__ */ c("ul", {
8526
8553
  style: {
8527
8554
  margin: "0.2em 0 0",
8528
8555
  paddingLeft: "1.2em"
@@ -8530,38 +8557,38 @@ function Hs(e) {
8530
8557
  children: f
8531
8558
  })
8532
8559
  ] }) : Y(p);
8533
- c.push(/* @__PURE__ */ d("li", { children: I }, `item-${u}`)), u = k;
8560
+ d.push(/* @__PURE__ */ c("li", { children: S }, `item-${h}`)), h = v;
8534
8561
  }
8535
- r.push(/* @__PURE__ */ d("ul", {
8562
+ r.push(/* @__PURE__ */ c("ul", {
8536
8563
  className: "ak-md-ul",
8537
- children: c
8538
- }, n++)), a = u;
8564
+ children: d
8565
+ }, n++)), a = h;
8539
8566
  continue;
8540
8567
  }
8541
8568
  if (/^\d+\.\s/.test(i)) {
8542
- const c = [];
8543
- let u = a;
8544
- for (; u < t.length && (/^\d+\.\s/.test(t[u]) || t[u].trim() === ""); ) {
8545
- if (t[u].trim() === "") {
8546
- u++;
8569
+ const d = [];
8570
+ let h = a;
8571
+ for (; h < t.length && (/^\d+\.\s/.test(t[h]) || t[h].trim() === ""); ) {
8572
+ if (t[h].trim() === "") {
8573
+ h++;
8547
8574
  continue;
8548
8575
  }
8549
- const h = t[u].length - t[u].trimStart().length, p = t[u].replace(/^\d+\.\s+/, ""), f = [], v = [];
8550
- let k = u + 1;
8551
- for (; k < t.length && k < u + 20; ) {
8552
- const g = t[k];
8553
- if (g.length - g.trimStart().length > h && g.trim() !== "") {
8554
- const N = g.trim();
8555
- /^\d+\.\s/.test(N) ? f.push(/* @__PURE__ */ d("li", { children: Y(N.replace(/^\d+\.\s+/, "")) }, `nested-order-${k}`)) : /^[-*+]\s/.test(N) ? f.push(/* @__PURE__ */ d("li", { children: Y(N.replace(/^[-*+]\s+/, "")) }, `nested-unorder-${k}`)) : v.push(/* @__PURE__ */ d("p", {
8576
+ const u = t[h].length - t[h].trimStart().length, p = t[h].replace(/^\d+\.\s+/, ""), f = [], k = [];
8577
+ let v = h + 1;
8578
+ for (; v < t.length && v < h + 20; ) {
8579
+ const g = t[v];
8580
+ if (g.length - g.trimStart().length > u && g.trim() !== "") {
8581
+ const w = g.trim();
8582
+ /^\d+\.\s/.test(w) ? f.push(/* @__PURE__ */ c("li", { children: Y(w.replace(/^\d+\.\s+/, "")) }, `nested-order-${v}`)) : /^[-*+]\s/.test(w) ? f.push(/* @__PURE__ */ c("li", { children: Y(w.replace(/^[-*+]\s+/, "")) }, `nested-unorder-${v}`)) : k.push(/* @__PURE__ */ c("p", {
8556
8583
  style: { margin: "0.2em 0 0" },
8557
- children: Y(N)
8558
- }, `cont-${k}`)), k++;
8584
+ children: Y(w)
8585
+ }, `cont-${v}`)), v++;
8559
8586
  } else break;
8560
8587
  }
8561
- const I = v.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ve, { children: [
8588
+ const S = k.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ye, { children: [
8562
8589
  Y(p),
8563
- v,
8564
- f.length > 0 && /* @__PURE__ */ d("ol", {
8590
+ k,
8591
+ f.length > 0 && /* @__PURE__ */ c("ol", {
8565
8592
  style: {
8566
8593
  margin: "0.2em 0 0",
8567
8594
  paddingLeft: "1.2em"
@@ -8569,12 +8596,12 @@ function Hs(e) {
8569
8596
  children: f
8570
8597
  })
8571
8598
  ] }) : Y(p);
8572
- c.push(/* @__PURE__ */ d("li", { children: I }, `order-item-${u}`)), u = k;
8599
+ d.push(/* @__PURE__ */ c("li", { children: S }, `order-item-${h}`)), h = v;
8573
8600
  }
8574
- r.push(/* @__PURE__ */ d("ol", {
8601
+ r.push(/* @__PURE__ */ c("ol", {
8575
8602
  className: "ak-md-ol",
8576
- children: c
8577
- }, n++)), a = u;
8603
+ children: d
8604
+ }, n++)), a = h;
8578
8605
  continue;
8579
8606
  }
8580
8607
  if (i.trim() === "") {
@@ -8582,30 +8609,30 @@ function Hs(e) {
8582
8609
  continue;
8583
8610
  }
8584
8611
  if (i.includes("|") && a + 1 < t.length && t[a + 1].includes("|")) {
8585
- const c = t[a + 1];
8586
- if (/^\s*\|?[\s:|*-]+\|[\s:|*-|]+\|?[\s:|*-]*$/.test(c)) {
8587
- const u = i.split("|").map((v) => v.trim()).filter((v) => v.length > 0), h = c.split("|").map((v) => {
8588
- const k = v.trim();
8589
- return k.startsWith(":") && k.endsWith(":") ? "center" : k.endsWith(":") ? "right" : (k.startsWith(":"), "left");
8590
- }).filter((v, k) => k > 0 && k <= u.length), p = [];
8612
+ const d = t[a + 1];
8613
+ if (/^\s*\|?[\s:|*-]+\|[\s:|*-|]+\|?[\s:|*-]*$/.test(d)) {
8614
+ const h = i.split("|").map((k) => k.trim()).filter((k) => k.length > 0), u = d.split("|").map((k) => {
8615
+ const v = k.trim();
8616
+ return v.startsWith(":") && v.endsWith(":") ? "center" : v.endsWith(":") ? "right" : (v.startsWith(":"), "left");
8617
+ }).filter((k, v) => v > 0 && v <= h.length), p = [];
8591
8618
  let f = a + 2;
8592
8619
  for (; f < t.length && t[f].includes("|") && t[f].trim() !== ""; ) {
8593
- const v = t[f].split("|").map((k) => k.trim()).filter((k) => k.length > 0);
8594
- if (v.length > 0)
8595
- p.push(v), f++;
8620
+ const k = t[f].split("|").map((v) => v.trim()).filter((v) => v.length > 0);
8621
+ if (k.length > 0)
8622
+ p.push(k), f++;
8596
8623
  else break;
8597
8624
  }
8598
8625
  r.push(/* @__PURE__ */ y("table", {
8599
8626
  className: "ak-md-table",
8600
- children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: u.map((v, k) => /* @__PURE__ */ d("th", {
8601
- style: { textAlign: h[k] || "left" },
8627
+ children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: h.map((k, v) => /* @__PURE__ */ c("th", {
8628
+ style: { textAlign: u[v] || "left" },
8602
8629
  className: "ak-md-th",
8603
- children: Y(v)
8604
- }, `th-${k}`)) }) }), /* @__PURE__ */ d("tbody", { children: p.map((v, k) => /* @__PURE__ */ d("tr", { children: u.map((I, g) => /* @__PURE__ */ d("td", {
8605
- style: { textAlign: h[g] || "left" },
8630
+ children: Y(k)
8631
+ }, `th-${v}`)) }) }), /* @__PURE__ */ c("tbody", { children: p.map((k, v) => /* @__PURE__ */ c("tr", { children: h.map((S, g) => /* @__PURE__ */ c("td", {
8632
+ style: { textAlign: u[g] || "left" },
8606
8633
  className: "ak-md-td",
8607
- children: v[g] ? Y(v[g]) : ""
8608
- }, `td-${k}-${g}`)) }, `tr-${k}`)) })]
8634
+ children: k[g] ? Y(k[g]) : ""
8635
+ }, `td-${v}-${g}`)) }, `tr-${v}`)) })]
8609
8636
  }, n++)), a = f;
8610
8637
  continue;
8611
8638
  }
@@ -8614,144 +8641,146 @@ function Hs(e) {
8614
8641
  for (; a < t.length && t[a].trim() !== "" && !t[a].startsWith("#") && !/^\s*```/.test(t[a]) && !/^[-*+]\s/.test(t[a]) && !/^\d+\.\s/.test(t[a]) && !/^[-*_]{3,}$/.test(t[a].trim()); )
8615
8642
  l.push(t[a]), a++;
8616
8643
  if (l.length > 0) {
8617
- const c = [];
8618
- l.forEach((u, h) => {
8619
- c.push(...Y(u)), h < l.length - 1 && c.push(/* @__PURE__ */ d("br", {}, `br-${h}`));
8620
- }), r.push(/* @__PURE__ */ d("p", {
8644
+ const d = [];
8645
+ l.forEach((h, u) => {
8646
+ d.push(...Y(h)), u < l.length - 1 && d.push(/* @__PURE__ */ c("br", {}, `br-${u}`));
8647
+ }), r.push(/* @__PURE__ */ c("p", {
8621
8648
  className: "ak-md-p",
8622
- children: c
8649
+ children: d
8623
8650
  }, n++));
8624
8651
  }
8625
8652
  }
8626
- return /* @__PURE__ */ d(ve, { children: r });
8653
+ return /* @__PURE__ */ c(ye, { children: r });
8627
8654
  }
8628
- function Ys({ message: e }) {
8629
- const [t, r] = ne(null), [a, n] = ne(null), i = e.role === "user", s = e.status === "error", o = e.status === "streaming", l = !!(e.images && e.images.length > 0), c = !!(e.documents && e.documents.length > 0), u = (() => {
8655
+ function Xs({ message: e }) {
8656
+ const [t, r] = ne(null), [a, n] = ne(null), i = e.role === "user", s = e.status === "error", o = e.status === "streaming", l = !!(e.images && e.images.length > 0), d = !!(e.documents && e.documents.length > 0), h = (() => {
8630
8657
  if (!i) return [];
8631
- const C = (e.uploadedAttachments ?? []).filter((F) => F.kind === "image").map((F) => ({
8632
- url: F.url,
8633
- mimeType: F.mimeType,
8634
- fileName: F.fileName
8658
+ const N = (e.uploadedAttachments ?? []).filter((P) => P.kind === "image").map((P) => ({
8659
+ url: P.url,
8660
+ mimeType: P.mimeType,
8661
+ fileName: P.fileName
8635
8662
  }));
8636
- return C.length > 0 ? C : e.uploadedImageUrl ? [{
8663
+ return N.length > 0 ? N : e.uploadedImageUrl ? [{
8637
8664
  url: e.uploadedImageUrl,
8638
8665
  mimeType: "image/jpeg"
8639
8666
  }] : [];
8640
- })(), h = i ? (e.uploadedAttachments ?? []).filter((C) => C.kind === "file") : [], p = u.length > 0, f = h.length > 0, v = l || p, k = !!e.progressEvents && e.progressEvents.length > 0, I = o && !e.content && !e.toolStatus && !k, g = !i && !s, N = !!e.isHuman && !i, j = i ? "ak-message--user" : s ? "ak-message--assistant ak-message--error" : N ? "ak-message--assistant ak-message--operator" : "ak-message--assistant", P = [
8667
+ })(), u = i ? (e.uploadedAttachments ?? []).filter((N) => N.kind === "file") : [], p = h.length > 0, f = u.length > 0, k = l || p, v = !!e.progressEvents && e.progressEvents.length > 0, S = o && !e.content && !e.toolStatus && !v, g = !i && !s, w = !!e.isHuman && !i, R = i ? "ak-message--user" : s ? "ak-message--assistant ak-message--error" : w ? "ak-message--assistant ak-message--operator" : "ak-message--assistant", F = [
8641
8668
  "ak-message__bubble",
8642
8669
  g ? "ak-message__bubble--md" : "",
8643
- v ? "ak-message__bubble--has-image" : "",
8644
- N ? "ak-message__bubble--operator" : ""
8645
- ].filter(Boolean).join(" "), B = N ? e.senderDisplay?.trim() || "Operator" : null, D = B ? B.charAt(0).toUpperCase() : "", ae = /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ y("div", {
8646
- className: P,
8670
+ k ? "ak-message__bubble--has-image" : "",
8671
+ w ? "ak-message__bubble--operator" : ""
8672
+ ].filter(Boolean).join(" "), $ = w ? e.senderDisplay?.trim() || "Operator" : null, U = $ ? $.charAt(0).toUpperCase() : "", ae = /* @__PURE__ */ y("div", {
8673
+ className: F,
8647
8674
  children: [
8648
- p && /* @__PURE__ */ d(br, {
8675
+ p && /* @__PURE__ */ c(br, {
8649
8676
  messageId: `${e.id}-up`,
8650
- images: u.map((C) => ({
8651
- src: C.url,
8652
- alt: C.fileName ?? "Uploaded image",
8653
- downloadHref: C.url
8677
+ images: h.map((N) => ({
8678
+ src: N.url,
8679
+ alt: N.fileName ?? "Uploaded image",
8680
+ downloadHref: N.url
8654
8681
  })),
8655
- onCellClick: (C) => r(C)
8682
+ onCellClick: (N) => r(N)
8656
8683
  }),
8657
- f && /* @__PURE__ */ d("div", {
8684
+ f && /* @__PURE__ */ c("div", {
8658
8685
  className: "ak-message__files",
8659
- children: h.map((C, F) => /* @__PURE__ */ d(xr, {
8660
- url: C.url,
8661
- mimeType: C.mimeType,
8662
- fileName: C.fileName
8663
- }, `${e.id}-up-file-${F}`))
8686
+ children: u.map((N, P) => /* @__PURE__ */ c(xr, {
8687
+ url: N.url,
8688
+ mimeType: N.mimeType,
8689
+ fileName: N.fileName
8690
+ }, `${e.id}-up-file-${P}`))
8664
8691
  }),
8665
- l && /* @__PURE__ */ d(br, {
8692
+ l && /* @__PURE__ */ c(br, {
8666
8693
  messageId: `${e.id}-asst`,
8667
- images: e.images.map((C, F) => {
8668
- const ce = C.url ?? (C.base64 ? `data:${C.mimeType};base64,${C.base64}` : null);
8694
+ images: e.images.map((N, P) => {
8695
+ const ce = N.url ?? (N.base64 ? `data:${N.mimeType};base64,${N.base64}` : null);
8669
8696
  return ce ? {
8670
8697
  src: ce,
8671
8698
  alt: "Generated image",
8672
- downloadHref: C.url ?? ce,
8673
- key: `gen-${F}`
8699
+ downloadHref: N.url ?? ce,
8700
+ key: `gen-${P}`
8674
8701
  } : null;
8675
- }).filter((C) => C !== null),
8676
- onCellClick: (C) => n(C)
8702
+ }).filter((N) => N !== null),
8703
+ onCellClick: (N) => n(N)
8677
8704
  }),
8678
- c && /* @__PURE__ */ d("div", {
8705
+ d && /* @__PURE__ */ c("div", {
8679
8706
  className: "ak-message__files",
8680
- children: e.documents.map((C, F) => C.url ? /* @__PURE__ */ d(xr, {
8681
- url: C.url,
8682
- mimeType: C.mimeType,
8683
- fileName: C.fileName
8684
- }, `${e.id}-asst-doc-${F}`) : null)
8707
+ children: e.documents.map((N, P) => N.url ? /* @__PURE__ */ c(xr, {
8708
+ url: N.url,
8709
+ mimeType: N.mimeType,
8710
+ fileName: N.fileName
8711
+ }, `${e.id}-asst-doc-${P}`) : null)
8685
8712
  }),
8686
8713
  e.content && /* @__PURE__ */ y("div", {
8687
- className: v ? "ak-message__image-caption" : void 0,
8688
- children: [g ? Hs(e.content) : e.content, o && /* @__PURE__ */ y("span", {
8714
+ className: k ? "ak-message__image-caption" : void 0,
8715
+ children: [g ? Ys(e.content) : e.content, o && /* @__PURE__ */ y("span", {
8689
8716
  className: "ak-cursor",
8690
8717
  "aria-hidden": "true",
8691
8718
  children: [
8692
- /* @__PURE__ */ d("span", { className: "ak-cursor__dot" }),
8693
- /* @__PURE__ */ d("span", { className: "ak-cursor__dot" }),
8694
- /* @__PURE__ */ d("span", { className: "ak-cursor__dot" })
8719
+ /* @__PURE__ */ c("span", { className: "ak-cursor__dot" }),
8720
+ /* @__PURE__ */ c("span", { className: "ak-cursor__dot" }),
8721
+ /* @__PURE__ */ c("span", { className: "ak-cursor__dot" })
8695
8722
  ]
8696
8723
  })]
8724
+ }),
8725
+ /* @__PURE__ */ c("span", {
8726
+ className: "ak-message__time",
8727
+ children: Hs(e.createdAt)
8697
8728
  })
8698
8729
  ]
8699
- }), /* @__PURE__ */ d("span", {
8700
- className: "ak-message__time",
8701
- children: Gs(e.createdAt)
8702
- })] }), T = !!e.content || v || f || c || !o && !e.toolStatus;
8730
+ }), T = !!e.content || k || f || d || !o && !e.toolStatus;
8703
8731
  return /* @__PURE__ */ y("div", {
8704
- className: `ak-message ${j}`,
8732
+ className: `ak-message ${R}`,
8705
8733
  children: [
8706
- !i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ d(Ds, {
8734
+ !i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Us, {
8707
8735
  ackText: e.ackText,
8708
8736
  events: e.progressEvents,
8709
8737
  collapsed: e.progressCollapsed,
8710
8738
  isComplete: !o,
8711
- turnMeta: e.turnMeta
8739
+ turnMeta: e.turnMeta,
8740
+ answerStartedAtMs: e.answerStartedAtMs
8712
8741
  }),
8713
- I && /* @__PURE__ */ y("div", {
8742
+ S && /* @__PURE__ */ y("div", {
8714
8743
  className: "ak-typing-row",
8715
8744
  role: "status",
8716
8745
  "aria-label": "Assistant is typing",
8717
8746
  children: [
8718
- /* @__PURE__ */ d("span", { className: "ak-typing-row__dot" }),
8719
- /* @__PURE__ */ d("span", { className: "ak-typing-row__dot" }),
8720
- /* @__PURE__ */ d("span", { className: "ak-typing-row__dot" })
8747
+ /* @__PURE__ */ c("span", { className: "ak-typing-row__dot" }),
8748
+ /* @__PURE__ */ c("span", { className: "ak-typing-row__dot" }),
8749
+ /* @__PURE__ */ c("span", { className: "ak-typing-row__dot" })
8721
8750
  ]
8722
8751
  }),
8723
- !i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ d(Bs, { status: e.toolStatus }),
8724
- N && /* @__PURE__ */ y("span", {
8752
+ !i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Gs, { status: e.toolStatus }),
8753
+ w && /* @__PURE__ */ y("span", {
8725
8754
  className: "ak-message__sender-label",
8726
- children: [/* @__PURE__ */ d("span", {
8755
+ children: [/* @__PURE__ */ c("span", {
8727
8756
  className: "ak-message__operator-avatar",
8728
8757
  "aria-hidden": "true",
8729
- children: D
8730
- }), /* @__PURE__ */ d("span", {
8758
+ children: U
8759
+ }), /* @__PURE__ */ c("span", {
8731
8760
  className: "ak-message__operator-name",
8732
- children: B
8761
+ children: $
8733
8762
  })]
8734
8763
  }),
8735
8764
  T && ae,
8736
- u.length > 0 && /* @__PURE__ */ d(_r, {
8737
- images: u.map((C) => ({
8738
- src: C.url,
8739
- alt: C.fileName ?? "Uploaded image",
8740
- downloadHref: C.url
8765
+ h.length > 0 && /* @__PURE__ */ c(_r, {
8766
+ images: h.map((N) => ({
8767
+ src: N.url,
8768
+ alt: N.fileName ?? "Uploaded image",
8769
+ downloadHref: N.url
8741
8770
  })),
8742
8771
  index: t,
8743
8772
  onClose: () => r(null),
8744
8773
  onIndexChange: r
8745
8774
  }),
8746
- l && /* @__PURE__ */ d(_r, {
8747
- images: e.images.map((C) => {
8748
- const F = C.url ?? (C.base64 ? `data:${C.mimeType};base64,${C.base64}` : null);
8749
- return F ? {
8750
- src: F,
8775
+ l && /* @__PURE__ */ c(_r, {
8776
+ images: e.images.map((N) => {
8777
+ const P = N.url ?? (N.base64 ? `data:${N.mimeType};base64,${N.base64}` : null);
8778
+ return P ? {
8779
+ src: P,
8751
8780
  alt: "Generated image",
8752
- downloadHref: C.url ?? F
8781
+ downloadHref: N.url ?? P
8753
8782
  } : null;
8754
- }).filter((C) => C !== null),
8783
+ }).filter((N) => N !== null),
8755
8784
  index: a,
8756
8785
  onClose: () => n(null),
8757
8786
  onIndexChange: n
@@ -8759,18 +8788,18 @@ function Ys({ message: e }) {
8759
8788
  ]
8760
8789
  });
8761
8790
  }
8762
- function Xs() {
8791
+ function Js() {
8763
8792
  return /* @__PURE__ */ y("div", {
8764
8793
  className: "ak-typing",
8765
8794
  "aria-label": "Assistant is typing",
8766
8795
  children: [
8767
- /* @__PURE__ */ d("span", { className: "ak-typing__dot" }),
8768
- /* @__PURE__ */ d("span", { className: "ak-typing__dot" }),
8769
- /* @__PURE__ */ d("span", { className: "ak-typing__dot" })
8796
+ /* @__PURE__ */ c("span", { className: "ak-typing__dot" }),
8797
+ /* @__PURE__ */ c("span", { className: "ak-typing__dot" }),
8798
+ /* @__PURE__ */ c("span", { className: "ak-typing__dot" })
8770
8799
  ]
8771
8800
  });
8772
8801
  }
8773
- function Js(e, t) {
8802
+ function Qs(e, t) {
8774
8803
  const r = [];
8775
8804
  let a = null;
8776
8805
  for (const n of e) {
@@ -8789,18 +8818,18 @@ function Js(e, t) {
8789
8818
  }
8790
8819
  return r;
8791
8820
  }
8792
- function Qs({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }) {
8793
- const a = he(null), n = he(null), i = he(!0), s = Mr(() => Js(e, r), [e, r]);
8821
+ function Ks({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }) {
8822
+ const a = he(null), n = he(null), i = he(!0), s = Mr(() => Qs(e, r), [e, r]);
8794
8823
  return X(() => {
8795
8824
  if (!(a.current?.parentElement ?? a.current)) return;
8796
- const o = (u) => {
8797
- i.current = u.scrollHeight - u.scrollTop - u.clientHeight < 120;
8825
+ const o = (h) => {
8826
+ i.current = h.scrollHeight - h.scrollTop - h.clientHeight < 120;
8798
8827
  };
8799
8828
  let l = a.current;
8800
8829
  for (; l && getComputedStyle(l).overflowY === "visible"; ) l = l.parentElement;
8801
8830
  if (!l) return;
8802
- const c = () => o(l);
8803
- return l.addEventListener("scroll", c, { passive: !0 }), () => l.removeEventListener("scroll", c);
8831
+ const d = () => o(l);
8832
+ return l.addEventListener("scroll", d, { passive: !0 }), () => l.removeEventListener("scroll", d);
8804
8833
  }, []), X(() => {
8805
8834
  e[e.length - 1]?.role === "user" && (i.current = !0), i.current && n.current?.scrollIntoView({ behavior: "smooth" });
8806
8835
  }, [e]), X(() => {
@@ -8812,20 +8841,20 @@ function Qs({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }
8812
8841
  "aria-live": "polite",
8813
8842
  "aria-label": "Conversation",
8814
8843
  children: [
8815
- s.map((o) => o.kind === "divider" ? /* @__PURE__ */ d("div", {
8844
+ s.map((o) => o.kind === "divider" ? /* @__PURE__ */ c("div", {
8816
8845
  className: "ak-handoff-divider",
8817
8846
  role: "separator",
8818
- children: /* @__PURE__ */ d("span", {
8847
+ children: /* @__PURE__ */ c("span", {
8819
8848
  className: "ak-handoff-divider__label",
8820
8849
  children: o.label
8821
8850
  })
8822
- }, o.id) : /* @__PURE__ */ d(Ys, { message: o.message }, o.message.id)),
8823
- t && !e.some((o) => o.status === "streaming") && /* @__PURE__ */ d(Xs, {}),
8824
- /* @__PURE__ */ d("div", { ref: n })
8851
+ }, o.id) : /* @__PURE__ */ c(Xs, { message: o.message }, o.message.id)),
8852
+ t && !e.some((o) => o.status === "streaming") && /* @__PURE__ */ c(Js, {}),
8853
+ /* @__PURE__ */ c("div", { ref: n })
8825
8854
  ]
8826
8855
  });
8827
8856
  }
8828
- function Ks() {
8857
+ function qs() {
8829
8858
  return /* @__PURE__ */ y("svg", {
8830
8859
  width: "30",
8831
8860
  height: "30",
@@ -8837,26 +8866,26 @@ function Ks() {
8837
8866
  strokeLinejoin: "round",
8838
8867
  "aria-hidden": "true",
8839
8868
  children: [
8840
- /* @__PURE__ */ d("rect", {
8869
+ /* @__PURE__ */ c("rect", {
8841
8870
  x: "3",
8842
8871
  y: "11",
8843
8872
  width: "18",
8844
8873
  height: "10",
8845
8874
  rx: "2"
8846
8875
  }),
8847
- /* @__PURE__ */ d("circle", {
8876
+ /* @__PURE__ */ c("circle", {
8848
8877
  cx: "12",
8849
8878
  cy: "5",
8850
8879
  r: "2"
8851
8880
  }),
8852
- /* @__PURE__ */ d("path", { d: "M12 7v4" }),
8853
- /* @__PURE__ */ d("line", {
8881
+ /* @__PURE__ */ c("path", { d: "M12 7v4" }),
8882
+ /* @__PURE__ */ c("line", {
8854
8883
  x1: "8",
8855
8884
  y1: "16",
8856
8885
  x2: "8",
8857
8886
  y2: "16"
8858
8887
  }),
8859
- /* @__PURE__ */ d("line", {
8888
+ /* @__PURE__ */ c("line", {
8860
8889
  x1: "16",
8861
8890
  y1: "16",
8862
8891
  x2: "16",
@@ -8865,52 +8894,52 @@ function Ks() {
8865
8894
  ]
8866
8895
  });
8867
8896
  }
8868
- function qs({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onSelect: n }) {
8897
+ function eo({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onSelect: n }) {
8869
8898
  const i = (r ?? []).filter((s) => (s.title ?? "").trim().length > 0);
8870
8899
  return /* @__PURE__ */ y("div", {
8871
8900
  className: "ak-empty-state",
8872
8901
  "aria-label": "Start a conversation",
8873
8902
  children: [
8874
- /* @__PURE__ */ d("div", {
8903
+ /* @__PURE__ */ c("div", {
8875
8904
  className: "ak-empty-state__glow",
8876
8905
  "aria-hidden": "true"
8877
8906
  }),
8878
8907
  /* @__PURE__ */ y("div", {
8879
8908
  className: "ak-empty-state__body",
8880
8909
  children: [
8881
- /* @__PURE__ */ d("div", {
8910
+ /* @__PURE__ */ c("div", {
8882
8911
  className: "ak-empty-state__avatar",
8883
- children: a ? /* @__PURE__ */ d("img", {
8912
+ children: a ? /* @__PURE__ */ c("img", {
8884
8913
  src: a,
8885
8914
  alt: "",
8886
8915
  className: "ak-empty-state__avatar-img",
8887
8916
  "aria-hidden": "true"
8888
- }) : /* @__PURE__ */ d("span", {
8917
+ }) : /* @__PURE__ */ c("span", {
8889
8918
  className: "ak-empty-state__bot-icon",
8890
8919
  "aria-hidden": "true",
8891
- children: /* @__PURE__ */ d(Ks, {})
8920
+ children: /* @__PURE__ */ c(qs, {})
8892
8921
  })
8893
8922
  }),
8894
- /* @__PURE__ */ d("p", {
8923
+ /* @__PURE__ */ c("p", {
8895
8924
  className: "ak-empty-state__title",
8896
8925
  children: e
8897
8926
  }),
8898
- t && /* @__PURE__ */ d("p", {
8927
+ t && /* @__PURE__ */ c("p", {
8899
8928
  className: "ak-empty-state__description",
8900
8929
  children: t
8901
8930
  })
8902
8931
  ]
8903
8932
  }),
8904
- i.length > 0 && /* @__PURE__ */ d("div", {
8933
+ i.length > 0 && /* @__PURE__ */ c("div", {
8905
8934
  className: "ak-empty-state__suggestions",
8906
8935
  children: i.map((s, o) => /* @__PURE__ */ y("button", {
8907
8936
  className: "ak-empty-state__suggestion",
8908
8937
  onClick: () => n?.(s.prompt ?? s.title),
8909
8938
  type: "button",
8910
- children: [/* @__PURE__ */ d("span", {
8939
+ children: [/* @__PURE__ */ c("span", {
8911
8940
  className: "ak-empty-state__suggestion-title",
8912
8941
  children: s.title
8913
- }), s.description && /* @__PURE__ */ d("span", {
8942
+ }), s.description && /* @__PURE__ */ c("span", {
8914
8943
  className: "ak-empty-state__suggestion-desc",
8915
8944
  children: s.description
8916
8945
  })]
@@ -8919,8 +8948,8 @@ function qs({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onS
8919
8948
  ]
8920
8949
  });
8921
8950
  }
8922
- var eo = "https://klicforge.ai/privacy-policy", to = "https://klicforge.ai/terms-of-service";
8923
- function ro() {
8951
+ var to = "https://klicforge.ai/privacy-policy", ro = "https://klicforge.ai/terms-of-service";
8952
+ function ao() {
8924
8953
  return /* @__PURE__ */ y("svg", {
8925
8954
  width: "16",
8926
8955
  height: "16",
@@ -8930,15 +8959,15 @@ function ro() {
8930
8959
  strokeWidth: "2.5",
8931
8960
  strokeLinecap: "round",
8932
8961
  strokeLinejoin: "round",
8933
- children: [/* @__PURE__ */ d("line", {
8962
+ children: [/* @__PURE__ */ c("line", {
8934
8963
  x1: "22",
8935
8964
  y1: "2",
8936
8965
  x2: "11",
8937
8966
  y2: "13"
8938
- }), /* @__PURE__ */ d("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })]
8967
+ }), /* @__PURE__ */ c("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })]
8939
8968
  });
8940
8969
  }
8941
- function ao() {
8970
+ function no() {
8942
8971
  return /* @__PURE__ */ y("svg", {
8943
8972
  width: "14",
8944
8973
  height: "14",
@@ -8947,12 +8976,12 @@ function ao() {
8947
8976
  stroke: "currentColor",
8948
8977
  strokeWidth: "2.5",
8949
8978
  strokeLinecap: "round",
8950
- children: [/* @__PURE__ */ d("line", {
8979
+ children: [/* @__PURE__ */ c("line", {
8951
8980
  x1: "12",
8952
8981
  y1: "5",
8953
8982
  x2: "12",
8954
8983
  y2: "19"
8955
- }), /* @__PURE__ */ d("line", {
8984
+ }), /* @__PURE__ */ c("line", {
8956
8985
  x1: "5",
8957
8986
  y1: "12",
8958
8987
  x2: "19",
@@ -8960,7 +8989,7 @@ function ao() {
8960
8989
  })]
8961
8990
  });
8962
8991
  }
8963
- function no() {
8992
+ function io() {
8964
8993
  return /* @__PURE__ */ y("svg", {
8965
8994
  width: "14",
8966
8995
  height: "14",
@@ -8970,7 +8999,7 @@ function no() {
8970
8999
  strokeWidth: "2",
8971
9000
  strokeLinecap: "round",
8972
9001
  strokeLinejoin: "round",
8973
- children: [/* @__PURE__ */ d("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }), /* @__PURE__ */ d("circle", {
9002
+ children: [/* @__PURE__ */ c("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }), /* @__PURE__ */ c("circle", {
8974
9003
  cx: "12",
8975
9004
  cy: "13",
8976
9005
  r: "4"
@@ -8987,7 +9016,7 @@ function Sr() {
8987
9016
  strokeWidth: "2",
8988
9017
  strokeLinecap: "round",
8989
9018
  strokeLinejoin: "round",
8990
- children: [/* @__PURE__ */ d("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ d("polyline", { points: "14 2 14 8 20 8" })]
9019
+ children: [/* @__PURE__ */ c("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ c("polyline", { points: "14 2 14 8 20 8" })]
8991
9020
  });
8992
9021
  }
8993
9022
  function Cr() {
@@ -9000,12 +9029,12 @@ function Cr() {
9000
9029
  strokeWidth: "3",
9001
9030
  strokeLinecap: "round",
9002
9031
  strokeLinejoin: "round",
9003
- children: [/* @__PURE__ */ d("line", {
9032
+ children: [/* @__PURE__ */ c("line", {
9004
9033
  x1: "18",
9005
9034
  y1: "6",
9006
9035
  x2: "6",
9007
9036
  y2: "18"
9008
- }), /* @__PURE__ */ d("line", {
9037
+ }), /* @__PURE__ */ c("line", {
9009
9038
  x1: "6",
9010
9039
  y1: "6",
9011
9040
  x2: "18",
@@ -9023,60 +9052,60 @@ var sa = [
9023
9052
  ".md",
9024
9053
  ".txt",
9025
9054
  ".csv"
9026
- ], io = [...oa, ...sa].join(","), la = [
9055
+ ], so = [...oa, ...sa].join(","), la = [
9027
9056
  "image/jpeg",
9028
9057
  "image/png",
9029
9058
  "image/gif",
9030
9059
  "image/webp"
9031
- ], so = la.join(",");
9032
- function oo(e) {
9060
+ ], oo = la.join(",");
9061
+ function lo(e) {
9033
9062
  if (sa.includes(e.type)) return !0;
9034
9063
  const t = e.name.toLowerCase();
9035
9064
  return oa.some((r) => t.endsWith(r));
9036
9065
  }
9037
- function lo(e) {
9066
+ function co(e) {
9038
9067
  return la.includes(e.type);
9039
9068
  }
9040
- function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", photoSendingEnabled: a = !1, fileUploadEnabled: n = !1, attachmentMaxCount: i = 5, attachmentMaxFileSizeMb: s = 1 }) {
9041
- const [o, l] = ne(""), [c, u] = ne([]), [h, p] = ne(/* @__PURE__ */ new Map()), [f, v] = ne(!1), k = he(null), I = he(null), g = he(null), N = he(null), j = he(null), P = a || n, B = Mr(() => s * 1024 * 1024, [s]);
9069
+ function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", photoSendingEnabled: a = !1, fileUploadEnabled: n = !1, attachmentMaxCount: i = 5, attachmentMaxFileSizeMb: s = 1 }) {
9070
+ const [o, l] = ne(""), [d, h] = ne([]), [u, p] = ne(/* @__PURE__ */ new Map()), [f, k] = ne(!1), v = he(null), S = he(null), g = he(null), w = he(null), R = he(null), F = a || n, $ = Mr(() => s * 1024 * 1024, [s]);
9042
9071
  X(() => () => {
9043
- h.forEach((M) => URL.revokeObjectURL(M));
9072
+ u.forEach((M) => URL.revokeObjectURL(M));
9044
9073
  }, []), X(() => {
9045
- t || k.current?.focus();
9074
+ t || v.current?.focus();
9046
9075
  }, [t]);
9047
- const D = pa((M) => {
9076
+ const U = pa((M) => {
9048
9077
  if (!f) return;
9049
- const O = M.composedPath ? M.composedPath() : [], K = !!N.current && O.includes(N.current), $ = !!j.current && O.includes(j.current);
9050
- !K && !$ && v(!1);
9078
+ const O = M.composedPath ? M.composedPath() : [], K = !!w.current && O.includes(w.current), V = !!R.current && O.includes(R.current);
9079
+ !K && !V && k(!1);
9051
9080
  }, [f]);
9052
9081
  X(() => {
9053
9082
  if (f)
9054
- return document.addEventListener("click", D), () => document.removeEventListener("click", D);
9055
- }, [f, D]), X(() => {
9056
- P || v(!1);
9057
- }, [P]);
9083
+ return document.addEventListener("click", U), () => document.removeEventListener("click", U);
9084
+ }, [f, U]), X(() => {
9085
+ F || k(!1);
9086
+ }, [F]);
9058
9087
  function ae() {
9059
- h.forEach((M) => URL.revokeObjectURL(M)), p(/* @__PURE__ */ new Map()), u([]), I.current && (I.current.value = ""), g.current && (g.current.value = "");
9088
+ u.forEach((M) => URL.revokeObjectURL(M)), p(/* @__PURE__ */ new Map()), h([]), S.current && (S.current.value = ""), g.current && (g.current.value = "");
9060
9089
  }
9061
9090
  function T(M) {
9062
- u((O) => {
9091
+ h((O) => {
9063
9092
  const K = O[M];
9064
9093
  if (K) {
9065
- const $ = h.get(K.file);
9066
- $ && (URL.revokeObjectURL($), p((G) => {
9094
+ const V = u.get(K.file);
9095
+ V && (URL.revokeObjectURL(V), p((G) => {
9067
9096
  const Ae = new Map(G);
9068
9097
  return Ae.delete(K.file), Ae;
9069
9098
  }));
9070
9099
  }
9071
- return O.filter(($, G) => G !== M);
9100
+ return O.filter((V, G) => G !== M);
9072
9101
  });
9073
9102
  }
9074
- function C() {
9103
+ function N() {
9075
9104
  const M = o.trim();
9076
- !M && c.length === 0 || t || (e(M, c), l(""), ae(), k.current && (k.current.style.height = "auto"));
9105
+ !M && d.length === 0 || t || (e(M, d), l(""), ae(), v.current && (v.current.style.height = "auto"));
9077
9106
  }
9078
- function F(M) {
9079
- M.key === "Enter" && !M.shiftKey && (M.preventDefault(), C());
9107
+ function P(M) {
9108
+ M.key === "Enter" && !M.shiftKey && (M.preventDefault(), N());
9080
9109
  }
9081
9110
  function ce(M) {
9082
9111
  const O = M.currentTarget;
@@ -9084,18 +9113,18 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9084
9113
  }
9085
9114
  function Te(M, O) {
9086
9115
  if (M.length === 0) return;
9087
- const K = [], $ = [];
9116
+ const K = [], V = [];
9088
9117
  for (const G of M) {
9089
- if (O === "image" && !lo(G)) {
9090
- $.push(`${G.name} (image type not supported)`);
9118
+ if (O === "image" && !co(G)) {
9119
+ V.push(`${G.name} (image type not supported)`);
9091
9120
  continue;
9092
9121
  }
9093
- if (O === "file" && !oo(G)) {
9094
- $.push(`${G.name} (file type not supported)`);
9122
+ if (O === "file" && !lo(G)) {
9123
+ V.push(`${G.name} (file type not supported)`);
9095
9124
  continue;
9096
9125
  }
9097
- if (G.size > B) {
9098
- $.push(`${G.name} (over ${s} MB)`);
9126
+ if (G.size > $) {
9127
+ V.push(`${G.name} (over ${s} MB)`);
9099
9128
  continue;
9100
9129
  }
9101
9130
  K.push({
@@ -9103,15 +9132,15 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9103
9132
  kind: O
9104
9133
  });
9105
9134
  }
9106
- u((G) => {
9135
+ h((G) => {
9107
9136
  const Ae = [...G, ...K], Kt = Ae.slice(0, i);
9108
- return Ae.length > i && $.push(`max ${i} attachments allowed`), p((ha) => {
9137
+ return Ae.length > i && V.push(`max ${i} attachments allowed`), p((ha) => {
9109
9138
  const mt = new Map(ha);
9110
9139
  for (const Be of Kt) Be.kind === "image" && !mt.has(Be.file) && mt.set(Be.file, URL.createObjectURL(Be.file));
9111
9140
  return mt;
9112
9141
  }), Kt;
9113
- }), $.length > 0 && alert(`Some attachments were not added:
9114
- • ${$.join(`
9142
+ }), V.length > 0 && alert(`Some attachments were not added:
9143
+ • ${V.join(`
9115
9144
  • `)}`);
9116
9145
  }
9117
9146
  function Ue(M) {
@@ -9123,17 +9152,17 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9123
9152
  M.currentTarget.value = "", Te(O, "file");
9124
9153
  }
9125
9154
  function ca() {
9126
- v(!1), I.current?.click();
9155
+ k(!1), S.current?.click();
9127
9156
  }
9128
9157
  function da() {
9129
- v(!1), g.current?.click();
9158
+ k(!1), g.current?.click();
9130
9159
  }
9131
- const ua = !t && (!!o.trim() || c.length > 0);
9160
+ const ua = !t && (!!o.trim() || d.length > 0);
9132
9161
  return /* @__PURE__ */ y("div", {
9133
9162
  className: "ak-composer",
9134
9163
  children: [
9135
- P && f && /* @__PURE__ */ y("div", {
9136
- ref: N,
9164
+ F && f && /* @__PURE__ */ y("div", {
9165
+ ref: w,
9137
9166
  className: "ak-composer__attach-menu",
9138
9167
  role: "menu",
9139
9168
  children: [a && /* @__PURE__ */ y("button", {
@@ -9142,37 +9171,37 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9142
9171
  type: "button",
9143
9172
  role: "menuitem",
9144
9173
  disabled: t,
9145
- children: [/* @__PURE__ */ d(no, {}), /* @__PURE__ */ d("span", { children: "Photo" })]
9174
+ children: [/* @__PURE__ */ c(io, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
9146
9175
  }), n && /* @__PURE__ */ y("button", {
9147
9176
  className: "ak-composer__attach-menu-item",
9148
9177
  onClick: da,
9149
9178
  type: "button",
9150
9179
  role: "menuitem",
9151
9180
  disabled: t,
9152
- children: [/* @__PURE__ */ d(Sr, {}), /* @__PURE__ */ d("span", { children: "File" })]
9181
+ children: [/* @__PURE__ */ c(Sr, {}), /* @__PURE__ */ c("span", { children: "File" })]
9153
9182
  })]
9154
9183
  }),
9155
- c.length > 0 && /* @__PURE__ */ d("div", {
9184
+ d.length > 0 && /* @__PURE__ */ c("div", {
9156
9185
  className: "ak-composer__attachments",
9157
9186
  role: "list",
9158
- children: c.map((M, O) => {
9187
+ children: d.map((M, O) => {
9159
9188
  const K = `${M.file.name}-${O}`;
9160
9189
  if (M.kind === "image") {
9161
- const $ = h.get(M.file);
9190
+ const V = u.get(M.file);
9162
9191
  return /* @__PURE__ */ y("div", {
9163
9192
  className: "ak-composer__preview-wrap",
9164
9193
  role: "listitem",
9165
- children: [$ && /* @__PURE__ */ d("img", {
9166
- src: $,
9194
+ children: [V && /* @__PURE__ */ c("img", {
9195
+ src: V,
9167
9196
  alt: M.file.name,
9168
9197
  className: "ak-composer__preview-img"
9169
- }), /* @__PURE__ */ d("button", {
9198
+ }), /* @__PURE__ */ c("button", {
9170
9199
  className: "ak-composer__preview-remove",
9171
9200
  onClick: () => T(O),
9172
9201
  type: "button",
9173
9202
  "aria-label": `Remove ${M.file.name}`,
9174
9203
  disabled: t,
9175
- children: /* @__PURE__ */ d(Cr, {})
9204
+ children: /* @__PURE__ */ c(Cr, {})
9176
9205
  })]
9177
9206
  }, K);
9178
9207
  }
@@ -9180,19 +9209,19 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9180
9209
  className: "ak-composer__file-chip",
9181
9210
  role: "listitem",
9182
9211
  children: [
9183
- /* @__PURE__ */ d(Sr, {}),
9184
- /* @__PURE__ */ d("span", {
9212
+ /* @__PURE__ */ c(Sr, {}),
9213
+ /* @__PURE__ */ c("span", {
9185
9214
  className: "ak-composer__file-chip-name",
9186
9215
  title: M.file.name,
9187
9216
  children: M.file.name
9188
9217
  }),
9189
- /* @__PURE__ */ d("button", {
9218
+ /* @__PURE__ */ c("button", {
9190
9219
  className: "ak-composer__file-chip-remove",
9191
9220
  onClick: () => T(O),
9192
9221
  type: "button",
9193
9222
  "aria-label": `Remove ${M.file.name}`,
9194
9223
  disabled: t,
9195
- children: /* @__PURE__ */ d(Cr, {})
9224
+ children: /* @__PURE__ */ c(Cr, {})
9196
9225
  })
9197
9226
  ]
9198
9227
  }, K);
@@ -9201,60 +9230,60 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9201
9230
  /* @__PURE__ */ y("div", {
9202
9231
  className: "ak-composer__input-wrap",
9203
9232
  children: [
9204
- P && /* @__PURE__ */ y(ve, { children: [
9205
- a && /* @__PURE__ */ d("input", {
9206
- ref: I,
9233
+ F && /* @__PURE__ */ y(ye, { children: [
9234
+ a && /* @__PURE__ */ c("input", {
9235
+ ref: S,
9207
9236
  type: "file",
9208
9237
  multiple: !0,
9209
- accept: so,
9238
+ accept: oo,
9210
9239
  className: "ak-composer__file-input",
9211
9240
  onChange: Ue,
9212
9241
  disabled: t,
9213
9242
  "aria-label": "Attach images"
9214
9243
  }),
9215
- n && /* @__PURE__ */ d("input", {
9244
+ n && /* @__PURE__ */ c("input", {
9216
9245
  ref: g,
9217
9246
  type: "file",
9218
9247
  multiple: !0,
9219
- accept: io,
9248
+ accept: so,
9220
9249
  className: "ak-composer__file-input",
9221
9250
  onChange: pt,
9222
9251
  disabled: t,
9223
9252
  "aria-label": "Attach files"
9224
9253
  }),
9225
- /* @__PURE__ */ d("div", {
9254
+ /* @__PURE__ */ c("div", {
9226
9255
  className: "ak-composer__attach-wrap",
9227
- children: /* @__PURE__ */ d("button", {
9228
- ref: j,
9256
+ children: /* @__PURE__ */ c("button", {
9257
+ ref: R,
9229
9258
  className: `ak-composer__attach${f ? " ak-composer__attach--open" : ""}`,
9230
- onClick: () => v((M) => !M),
9259
+ onClick: () => k((M) => !M),
9231
9260
  disabled: t,
9232
9261
  "aria-label": "Attachment options",
9233
9262
  "aria-haspopup": "true",
9234
9263
  "aria-expanded": f,
9235
9264
  type: "button",
9236
- children: /* @__PURE__ */ d(ao, {})
9265
+ children: /* @__PURE__ */ c(no, {})
9237
9266
  })
9238
9267
  })
9239
9268
  ] }),
9240
- /* @__PURE__ */ d("textarea", {
9241
- ref: k,
9269
+ /* @__PURE__ */ c("textarea", {
9270
+ ref: v,
9242
9271
  className: "ak-composer__input",
9243
9272
  value: o,
9244
9273
  onInput: ce,
9245
- onKeyDown: F,
9274
+ onKeyDown: P,
9246
9275
  placeholder: r,
9247
9276
  disabled: t,
9248
9277
  rows: 1,
9249
9278
  "aria-label": "Message input"
9250
9279
  }),
9251
- /* @__PURE__ */ d("button", {
9280
+ /* @__PURE__ */ c("button", {
9252
9281
  className: "ak-composer__send",
9253
- onClick: C,
9282
+ onClick: N,
9254
9283
  disabled: !ua,
9255
9284
  "aria-label": "Send message",
9256
9285
  type: "button",
9257
- children: /* @__PURE__ */ d(ro, {})
9286
+ children: /* @__PURE__ */ c(ao, {})
9258
9287
  })
9259
9288
  ]
9260
9289
  }),
@@ -9263,8 +9292,8 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9263
9292
  children: [
9264
9293
  "By chatting you agree to our",
9265
9294
  " ",
9266
- /* @__PURE__ */ d("a", {
9267
- href: eo,
9295
+ /* @__PURE__ */ c("a", {
9296
+ href: to,
9268
9297
  target: "_blank",
9269
9298
  rel: "noopener noreferrer",
9270
9299
  children: "Privacy Policy"
@@ -9272,8 +9301,8 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
9272
9301
  " ",
9273
9302
  "and",
9274
9303
  " ",
9275
- /* @__PURE__ */ d("a", {
9276
- href: to,
9304
+ /* @__PURE__ */ c("a", {
9305
+ href: ro,
9277
9306
  target: "_blank",
9278
9307
  rel: "noopener noreferrer",
9279
9308
  children: "Terms of Service"
@@ -9289,15 +9318,15 @@ function Ir({ message: e }) {
9289
9318
  return e.includes("Origin not allowed") ? /* @__PURE__ */ y("div", {
9290
9319
  className: "ak-error ak-error--origin",
9291
9320
  role: "alert",
9292
- children: [/* @__PURE__ */ d("div", {
9321
+ children: [/* @__PURE__ */ c("div", {
9293
9322
  className: "ak-error__icon",
9294
9323
  children: "🔒"
9295
9324
  }), /* @__PURE__ */ y("div", {
9296
9325
  className: "ak-error__content",
9297
- children: [/* @__PURE__ */ d("h3", {
9326
+ children: [/* @__PURE__ */ c("h3", {
9298
9327
  className: "ak-error__title",
9299
9328
  children: "Access Restricted"
9300
- }), /* @__PURE__ */ d("p", {
9329
+ }), /* @__PURE__ */ c("p", {
9301
9330
  className: "ak-error__description",
9302
9331
  children: "This widget has been restricted to specific websites only. Contact the website administrator if you believe this is an error."
9303
9332
  })]
@@ -9305,19 +9334,19 @@ function Ir({ message: e }) {
9305
9334
  }) : /* @__PURE__ */ y("div", {
9306
9335
  className: "ak-error",
9307
9336
  role: "alert",
9308
- children: [/* @__PURE__ */ d("div", {
9337
+ children: [/* @__PURE__ */ c("div", {
9309
9338
  className: "ak-error__icon",
9310
9339
  children: "⚠️"
9311
- }), /* @__PURE__ */ d("div", {
9340
+ }), /* @__PURE__ */ c("div", {
9312
9341
  className: "ak-error__content",
9313
- children: /* @__PURE__ */ d("p", {
9342
+ children: /* @__PURE__ */ c("p", {
9314
9343
  className: "ak-error__message",
9315
9344
  children: e
9316
9345
  })
9317
9346
  })]
9318
9347
  });
9319
9348
  }
9320
- function uo() {
9349
+ function ho() {
9321
9350
  return /* @__PURE__ */ y("svg", {
9322
9351
  width: "28",
9323
9352
  height: "28",
@@ -9328,39 +9357,39 @@ function uo() {
9328
9357
  strokeLinecap: "round",
9329
9358
  strokeLinejoin: "round",
9330
9359
  "aria-hidden": "true",
9331
- children: [/* @__PURE__ */ d("circle", {
9360
+ children: [/* @__PURE__ */ c("circle", {
9332
9361
  cx: "12",
9333
9362
  cy: "12",
9334
9363
  r: "9"
9335
- }), /* @__PURE__ */ d("path", { d: "M12 7v5l3 2" })]
9364
+ }), /* @__PURE__ */ c("path", { d: "M12 7v5l3 2" })]
9336
9365
  });
9337
9366
  }
9338
- function ho() {
9367
+ function fo() {
9339
9368
  return /* @__PURE__ */ y("div", {
9340
9369
  className: "ak-maintenance",
9341
9370
  role: "status",
9342
9371
  "aria-live": "polite",
9343
9372
  children: [
9344
- /* @__PURE__ */ d("div", {
9373
+ /* @__PURE__ */ c("div", {
9345
9374
  className: "ak-maintenance__halo",
9346
9375
  "aria-hidden": "true"
9347
9376
  }),
9348
- /* @__PURE__ */ d("div", {
9377
+ /* @__PURE__ */ c("div", {
9349
9378
  className: "ak-maintenance__icon",
9350
- children: /* @__PURE__ */ d(uo, {})
9379
+ children: /* @__PURE__ */ c(ho, {})
9351
9380
  }),
9352
- /* @__PURE__ */ d("p", {
9381
+ /* @__PURE__ */ c("p", {
9353
9382
  className: "ak-maintenance__title",
9354
9383
  children: "Under maintenance"
9355
9384
  }),
9356
- /* @__PURE__ */ d("p", {
9385
+ /* @__PURE__ */ c("p", {
9357
9386
  className: "ak-maintenance__description",
9358
9387
  children: "This assistant is temporarily unavailable. Please check back in a little while."
9359
9388
  })
9360
9389
  ]
9361
9390
  });
9362
9391
  }
9363
- function fo() {
9392
+ function po() {
9364
9393
  return /* @__PURE__ */ y("svg", {
9365
9394
  width: "11",
9366
9395
  height: "11",
@@ -9368,27 +9397,27 @@ function fo() {
9368
9397
  fill: "none",
9369
9398
  "aria-hidden": "true",
9370
9399
  className: "ak-branding__logo",
9371
- children: [/* @__PURE__ */ d("rect", {
9400
+ children: [/* @__PURE__ */ c("rect", {
9372
9401
  width: "24",
9373
9402
  height: "24",
9374
9403
  rx: "5",
9375
9404
  fill: "currentColor"
9376
- }), /* @__PURE__ */ d("path", {
9405
+ }), /* @__PURE__ */ c("path", {
9377
9406
  d: "M12 5L7 13h3.5v6l6.5-9H13.5V5z",
9378
9407
  fill: "white"
9379
9408
  })]
9380
9409
  });
9381
9410
  }
9382
- function po() {
9411
+ function mo() {
9383
9412
  return /* @__PURE__ */ y("div", {
9384
9413
  className: "ak-branding",
9385
9414
  children: [
9386
- /* @__PURE__ */ d(fo, {}),
9387
- /* @__PURE__ */ d("span", {
9415
+ /* @__PURE__ */ c(po, {}),
9416
+ /* @__PURE__ */ c("span", {
9388
9417
  className: "ak-branding__label",
9389
9418
  children: "Powered by"
9390
9419
  }),
9391
- /* @__PURE__ */ d("span", {
9420
+ /* @__PURE__ */ c("span", {
9392
9421
  className: "ak-branding__name",
9393
9422
  children: "KlicForge"
9394
9423
  })
@@ -9403,7 +9432,7 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
9403
9432
  role: "dialog",
9404
9433
  "aria-label": e.title,
9405
9434
  children: [
9406
- /* @__PURE__ */ d($s, {
9435
+ /* @__PURE__ */ c($s, {
9407
9436
  title: e.title,
9408
9437
  subtitle: e.subtitle,
9409
9438
  avatarUrl: e.avatarUrl,
@@ -9411,34 +9440,34 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
9411
9440
  onReset: i === "ready" ? o.onReset : void 0,
9412
9441
  hideClose: n
9413
9442
  }),
9414
- i === "validating" && /* @__PURE__ */ d("div", {
9443
+ i === "validating" && /* @__PURE__ */ c("div", {
9415
9444
  className: "ak-init-status",
9416
- children: /* @__PURE__ */ d("div", {
9445
+ children: /* @__PURE__ */ c("div", {
9417
9446
  className: "ak-init-spinner",
9418
9447
  "aria-label": "Connecting…"
9419
9448
  })
9420
9449
  }),
9421
- i === "error" && /* @__PURE__ */ d("div", {
9450
+ i === "error" && /* @__PURE__ */ c("div", {
9422
9451
  className: "ak-init-status ak-init-status--error",
9423
- children: /* @__PURE__ */ d(Ir, { message: s ?? "Widget configuration is invalid." })
9452
+ children: /* @__PURE__ */ c(Ir, { message: s ?? "Widget configuration is invalid." })
9424
9453
  }),
9425
- i === "disabled" && /* @__PURE__ */ d("div", {
9454
+ i === "disabled" && /* @__PURE__ */ c("div", {
9426
9455
  className: "ak-init-status ak-init-status--maintenance",
9427
- children: /* @__PURE__ */ d(ho, {})
9456
+ children: /* @__PURE__ */ c(fo, {})
9428
9457
  }),
9429
- i === "ready" && /* @__PURE__ */ y(ve, { children: [
9430
- t.length === 0 ? /* @__PURE__ */ d(qs, {
9458
+ i === "ready" && /* @__PURE__ */ y(ye, { children: [
9459
+ t.length === 0 ? /* @__PURE__ */ c(eo, {
9431
9460
  title: e.title,
9432
9461
  description: e.description ?? e.subtitle,
9433
9462
  suggestedQuestions: e.suggestedQuestions,
9434
9463
  avatarUrl: e.avatarUrl,
9435
9464
  onSelect: (l) => o.onSendMessage(l, [])
9436
- }) : /* @__PURE__ */ d(Qs, {
9465
+ }) : /* @__PURE__ */ c(Ks, {
9437
9466
  messages: t,
9438
9467
  isLoading: r
9439
9468
  }),
9440
- a && /* @__PURE__ */ d(Ir, { message: a }),
9441
- /* @__PURE__ */ d(co, {
9469
+ a && /* @__PURE__ */ c(Ir, { message: a }),
9470
+ /* @__PURE__ */ c(uo, {
9442
9471
  onSend: o.onSendMessage,
9443
9472
  disabled: r,
9444
9473
  placeholder: "Type a message…",
@@ -9449,11 +9478,11 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
9449
9478
  })
9450
9479
  ] })
9451
9480
  ]
9452
- }), !n && /* @__PURE__ */ d(po, {})]
9481
+ }), !n && /* @__PURE__ */ c(mo, {})]
9453
9482
  });
9454
9483
  }
9455
- function mo() {
9456
- return /* @__PURE__ */ d("svg", {
9484
+ function go() {
9485
+ return /* @__PURE__ */ c("svg", {
9457
9486
  width: "24",
9458
9487
  height: "24",
9459
9488
  viewBox: "0 0 24 24",
@@ -9462,11 +9491,11 @@ function mo() {
9462
9491
  strokeWidth: "2",
9463
9492
  strokeLinecap: "round",
9464
9493
  strokeLinejoin: "round",
9465
- children: /* @__PURE__ */ d("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
9494
+ children: /* @__PURE__ */ c("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
9466
9495
  });
9467
9496
  }
9468
- function go() {
9469
- return /* @__PURE__ */ d("svg", {
9497
+ function vo() {
9498
+ return /* @__PURE__ */ c("svg", {
9470
9499
  width: "22",
9471
9500
  height: "22",
9472
9501
  viewBox: "0 0 24 24",
@@ -9475,23 +9504,23 @@ function go() {
9475
9504
  strokeWidth: "2.5",
9476
9505
  strokeLinecap: "round",
9477
9506
  strokeLinejoin: "round",
9478
- children: /* @__PURE__ */ d("polyline", { points: "6,9 12,15 18,9" })
9507
+ children: /* @__PURE__ */ c("polyline", { points: "6,9 12,15 18,9" })
9479
9508
  });
9480
9509
  }
9481
- function vo({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat" }) {
9510
+ function ko({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat" }) {
9482
9511
  const n = !e && !!r;
9483
- return /* @__PURE__ */ d("button", {
9512
+ return /* @__PURE__ */ c("button", {
9484
9513
  className: `ak-launcher${n ? " ak-launcher--avatar" : ""}`,
9485
9514
  onClick: t,
9486
9515
  "aria-label": a,
9487
9516
  "aria-expanded": e,
9488
9517
  type: "button",
9489
- children: e ? /* @__PURE__ */ d(go, {}) : n ? /* @__PURE__ */ d("img", {
9518
+ children: e ? /* @__PURE__ */ c(vo, {}) : n ? /* @__PURE__ */ c("img", {
9490
9519
  src: r,
9491
9520
  alt: "",
9492
9521
  className: "ak-launcher__avatar-img",
9493
9522
  "aria-hidden": "true"
9494
- }) : /* @__PURE__ */ d(mo, {})
9523
+ }) : /* @__PURE__ */ c(go, {})
9495
9524
  });
9496
9525
  }
9497
9526
  function Er({ config: e, state: t, callbacks: r }) {
@@ -9505,10 +9534,10 @@ function Er({ config: e, state: t, callbacks: r }) {
9505
9534
  if (a) return;
9506
9535
  const i = n.current?.getRootNode()?.host;
9507
9536
  i && (t.isOpen ? i.setAttribute("data-open", "") : i.removeAttribute("data-open"));
9508
- }, [a, t.isOpen]), a ? /* @__PURE__ */ d("div", {
9537
+ }, [a, t.isOpen]), a ? /* @__PURE__ */ c("div", {
9509
9538
  ref: n,
9510
9539
  className: "ak-inline",
9511
- children: /* @__PURE__ */ d(Nr, {
9540
+ children: /* @__PURE__ */ c(Nr, {
9512
9541
  config: e,
9513
9542
  messages: t.messages,
9514
9543
  isLoading: t.isLoading,
@@ -9521,7 +9550,7 @@ function Er({ config: e, state: t, callbacks: r }) {
9521
9550
  }) : /* @__PURE__ */ y("div", {
9522
9551
  ref: n,
9523
9552
  className: "ak-floating",
9524
- children: [t.isOpen && /* @__PURE__ */ d(Nr, {
9553
+ children: [t.isOpen && /* @__PURE__ */ c(Nr, {
9525
9554
  config: e,
9526
9555
  messages: t.messages,
9527
9556
  isLoading: t.isLoading,
@@ -9530,7 +9559,7 @@ function Er({ config: e, state: t, callbacks: r }) {
9530
9559
  initStatus: t.initStatus,
9531
9560
  initError: t.initError,
9532
9561
  callbacks: r
9533
- }), /* @__PURE__ */ d(vo, {
9562
+ }), /* @__PURE__ */ c(ko, {
9534
9563
  isOpen: t.isOpen,
9535
9564
  onClick: t.isOpen ? r.onClose : r.onOpen,
9536
9565
  avatarUrl: e.avatarUrl
@@ -9558,55 +9587,55 @@ var Jt = (e, t, r, a) => {
9558
9587
  }
9559
9588
  };
9560
9589
  };
9561
- function ko(e) {
9590
+ function yo(e) {
9562
9591
  return Zs + `
9563
9592
  ` + Rs(e);
9564
9593
  }
9565
9594
  function Qt(e, t) {
9566
- return ko(Ve({
9595
+ return yo(Ve({
9567
9596
  ...e,
9568
9597
  mode: t
9569
9598
  }));
9570
9599
  }
9571
- function Ko(e, t = Jt, r) {
9600
+ function qo(e, t = Jt, r) {
9572
9601
  return Ms(e, t, r ?? Qt(e, "floating"));
9573
9602
  }
9574
- function qo(e, t, r = Jt, a) {
9603
+ function el(e, t, r = Jt, a) {
9575
9604
  return Ts(e, t, r, a ?? Qt(t, "inline"));
9576
9605
  }
9577
- function el(e, t, r = Jt, a) {
9606
+ function tl(e, t, r = Jt, a) {
9578
9607
  return Ls(e, t, r, a ?? Qt(t, "floating"));
9579
9608
  }
9580
- function tl(e) {
9609
+ function rl(e) {
9581
9610
  As(e);
9582
9611
  }
9583
9612
  export {
9584
9613
  is as ApiClient,
9585
- co as Composer,
9614
+ uo as Composer,
9586
9615
  Ir as ErrorState,
9587
9616
  fs as EventEmitter,
9588
9617
  $s as Header,
9589
- vo as Launcher,
9590
- Ys as MessageBubble,
9591
- Qs as MessageList,
9592
- Xs as TypingIndicator,
9618
+ ko as Launcher,
9619
+ Xs as MessageBubble,
9620
+ Ks as MessageList,
9621
+ Js as TypingIndicator,
9593
9622
  Er as WidgetApp,
9594
9623
  vs as WidgetClient,
9595
9624
  Nr as WidgetShell,
9596
9625
  Rs as buildThemeVars,
9597
- ko as buildWidgetCSS,
9626
+ yo as buildWidgetCSS,
9598
9627
  vr as clearSession,
9599
9628
  ws as createFloatingContainer,
9600
9629
  bs as createShadowHost,
9601
9630
  Yt as createWidget,
9602
- tl as destroy,
9631
+ rl as destroy,
9603
9632
  As as destroyWidget,
9604
9633
  ms as getSessionId,
9605
- Ko as init,
9634
+ qo as init,
9606
9635
  _s as injectStyles,
9607
- Qo as listWidgets,
9608
- qo as mount,
9609
- el as mountFloating,
9636
+ Ko as listWidgets,
9637
+ el as mount,
9638
+ tl as mountFloating,
9610
9639
  Ve as normalizeConfig,
9611
9640
  Cs as prepareInlineContainer,
9612
9641
  xs as removeShadowHost,