@bymos/agentkit-sdk 0.7.4 → 0.8.0

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
@@ -470,9 +470,9 @@ var M = class {
470
470
  return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
471
471
  }
472
472
  _refinement(e) {
473
- return new L({
473
+ return new I({
474
474
  schema: this,
475
- typeName: z.ZodEffects,
475
+ typeName: R.ZodEffects,
476
476
  effect: {
477
477
  type: "refinement",
478
478
  refinement: e
@@ -490,10 +490,10 @@ var M = class {
490
490
  };
491
491
  }
492
492
  optional() {
493
- return R.create(this, this._def);
493
+ return L.create(this, this._def);
494
494
  }
495
495
  nullable() {
496
- return $e.create(this, this._def);
496
+ return et.create(this, this._def);
497
497
  }
498
498
  nullish() {
499
499
  return this.nullable().optional();
@@ -502,7 +502,7 @@ var M = class {
502
502
  return Le.create(this);
503
503
  }
504
504
  promise() {
505
- return Qe.create(this, this._def);
505
+ return $e.create(this, this._def);
506
506
  }
507
507
  or(e) {
508
508
  return ze.create([this, e], this._def);
@@ -511,10 +511,10 @@ var M = class {
511
511
  return He.create(this, e, this._def);
512
512
  }
513
513
  transform(e) {
514
- return new L({
514
+ return new I({
515
515
  ...j(this._def),
516
516
  schema: this,
517
- typeName: z.ZodEffects,
517
+ typeName: R.ZodEffects,
518
518
  effect: {
519
519
  type: "transform",
520
520
  transform: e
@@ -523,27 +523,27 @@ var M = class {
523
523
  }
524
524
  default(e) {
525
525
  let t = typeof e == "function" ? e : () => e;
526
- return new et({
526
+ return new tt({
527
527
  ...j(this._def),
528
528
  innerType: this,
529
529
  defaultValue: t,
530
- typeName: z.ZodDefault
530
+ typeName: R.ZodDefault
531
531
  });
532
532
  }
533
533
  brand() {
534
- return new rt({
535
- typeName: z.ZodBranded,
534
+ return new it({
535
+ typeName: R.ZodBranded,
536
536
  type: this,
537
537
  ...j(this._def)
538
538
  });
539
539
  }
540
540
  catch(e) {
541
541
  let t = typeof e == "function" ? e : () => e;
542
- return new tt({
542
+ return new nt({
543
543
  ...j(this._def),
544
544
  innerType: this,
545
545
  catchValue: t,
546
- typeName: z.ZodCatch
546
+ typeName: R.ZodCatch
547
547
  });
548
548
  }
549
549
  describe(e) {
@@ -554,10 +554,10 @@ var M = class {
554
554
  });
555
555
  }
556
556
  pipe(e) {
557
- return it.create(this, e);
557
+ return at.create(this, e);
558
558
  }
559
559
  readonly() {
560
- return at.create(this);
560
+ return ot.create(this);
561
561
  }
562
562
  isOptional() {
563
563
  return this.safeParse(void 0).success;
@@ -1006,7 +1006,7 @@ var Te = class e extends M {
1006
1006
  };
1007
1007
  Te.create = (e) => new Te({
1008
1008
  checks: [],
1009
- typeName: z.ZodString,
1009
+ typeName: R.ZodString,
1010
1010
  coerce: e?.coerce ?? !1,
1011
1011
  ...j(e)
1012
1012
  });
@@ -1175,7 +1175,7 @@ var De = class e extends M {
1175
1175
  };
1176
1176
  De.create = (e) => new De({
1177
1177
  checks: [],
1178
- typeName: z.ZodNumber,
1178
+ typeName: R.ZodNumber,
1179
1179
  coerce: e?.coerce || !1,
1180
1180
  ...j(e)
1181
1181
  });
@@ -1302,7 +1302,7 @@ var Oe = class e extends M {
1302
1302
  };
1303
1303
  Oe.create = (e) => new Oe({
1304
1304
  checks: [],
1305
- typeName: z.ZodBigInt,
1305
+ typeName: R.ZodBigInt,
1306
1306
  coerce: e?.coerce ?? !1,
1307
1307
  ...j(e)
1308
1308
  });
@@ -1320,7 +1320,7 @@ var ke = class extends M {
1320
1320
  }
1321
1321
  };
1322
1322
  ke.create = (e) => new ke({
1323
- typeName: z.ZodBoolean,
1323
+ typeName: R.ZodBoolean,
1324
1324
  coerce: e?.coerce || !1,
1325
1325
  ...j(e)
1326
1326
  });
@@ -1390,7 +1390,7 @@ var Ae = class e extends M {
1390
1390
  Ae.create = (e) => new Ae({
1391
1391
  checks: [],
1392
1392
  coerce: e?.coerce || !1,
1393
- typeName: z.ZodDate,
1393
+ typeName: R.ZodDate,
1394
1394
  ...j(e)
1395
1395
  });
1396
1396
  var je = class extends M {
@@ -1407,7 +1407,7 @@ var je = class extends M {
1407
1407
  }
1408
1408
  };
1409
1409
  je.create = (e) => new je({
1410
- typeName: z.ZodSymbol,
1410
+ typeName: R.ZodSymbol,
1411
1411
  ...j(e)
1412
1412
  });
1413
1413
  var Me = class extends M {
@@ -1424,7 +1424,7 @@ var Me = class extends M {
1424
1424
  }
1425
1425
  };
1426
1426
  Me.create = (e) => new Me({
1427
- typeName: z.ZodUndefined,
1427
+ typeName: R.ZodUndefined,
1428
1428
  ...j(e)
1429
1429
  });
1430
1430
  var Ne = class extends M {
@@ -1441,7 +1441,7 @@ var Ne = class extends M {
1441
1441
  }
1442
1442
  };
1443
1443
  Ne.create = (e) => new Ne({
1444
- typeName: z.ZodNull,
1444
+ typeName: R.ZodNull,
1445
1445
  ...j(e)
1446
1446
  });
1447
1447
  var Pe = class extends M {
@@ -1453,7 +1453,7 @@ var Pe = class extends M {
1453
1453
  }
1454
1454
  };
1455
1455
  Pe.create = (e) => new Pe({
1456
- typeName: z.ZodAny,
1456
+ typeName: R.ZodAny,
1457
1457
  ...j(e)
1458
1458
  });
1459
1459
  var Fe = class extends M {
@@ -1465,7 +1465,7 @@ var Fe = class extends M {
1465
1465
  }
1466
1466
  };
1467
1467
  Fe.create = (e) => new Fe({
1468
- typeName: z.ZodUnknown,
1468
+ typeName: R.ZodUnknown,
1469
1469
  ...j(e)
1470
1470
  });
1471
1471
  var N = class extends M {
@@ -1479,7 +1479,7 @@ var N = class extends M {
1479
1479
  }
1480
1480
  };
1481
1481
  N.create = (e) => new N({
1482
- typeName: z.ZodNever,
1482
+ typeName: R.ZodNever,
1483
1483
  ...j(e)
1484
1484
  });
1485
1485
  var Ie = class extends M {
@@ -1496,7 +1496,7 @@ var Ie = class extends M {
1496
1496
  }
1497
1497
  };
1498
1498
  Ie.create = (e) => new Ie({
1499
- typeName: z.ZodVoid,
1499
+ typeName: R.ZodVoid,
1500
1500
  ...j(e)
1501
1501
  });
1502
1502
  var Le = class e extends M {
@@ -1576,7 +1576,7 @@ Le.create = (e, t) => new Le({
1576
1576
  minLength: null,
1577
1577
  maxLength: null,
1578
1578
  exactLength: null,
1579
- typeName: z.ZodArray,
1579
+ typeName: R.ZodArray,
1580
1580
  ...j(t)
1581
1581
  });
1582
1582
  function Re(e) {
@@ -1584,7 +1584,7 @@ function Re(e) {
1584
1584
  let t = {};
1585
1585
  for (let n in e.shape) {
1586
1586
  let r = e.shape[n];
1587
- t[n] = R.create(Re(r));
1587
+ t[n] = L.create(Re(r));
1588
1588
  }
1589
1589
  return new P({
1590
1590
  ...e._def,
@@ -1594,9 +1594,9 @@ function Re(e) {
1594
1594
  ...e._def,
1595
1595
  type: Re(e.element)
1596
1596
  });
1597
- else if (e instanceof R) return R.create(Re(e.unwrap()));
1598
- else if (e instanceof $e) return $e.create(Re(e.unwrap()));
1599
- else if (e instanceof I) return I.create(e.items.map((e) => Re(e)));
1597
+ else if (e instanceof L) return L.create(Re(e.unwrap()));
1598
+ else if (e instanceof et) return et.create(Re(e.unwrap()));
1599
+ else if (e instanceof Ue) return Ue.create(e.items.map((e) => Re(e)));
1600
1600
  else return e;
1601
1601
  }
1602
1602
  var P = class e extends M {
@@ -1720,7 +1720,7 @@ var P = class e extends M {
1720
1720
  ...this._def.shape(),
1721
1721
  ...t._def.shape()
1722
1722
  }),
1723
- typeName: z.ZodObject
1723
+ typeName: R.ZodObject
1724
1724
  });
1725
1725
  }
1726
1726
  setKey(e, t) {
@@ -1767,7 +1767,7 @@ var P = class e extends M {
1767
1767
  for (let e of u.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
1768
1768
  else {
1769
1769
  let t = this.shape[e];
1770
- for (; t instanceof R;) t = t._def.innerType;
1770
+ for (; t instanceof L;) t = t._def.innerType;
1771
1771
  n[e] = t;
1772
1772
  }
1773
1773
  return new e({
@@ -1776,26 +1776,26 @@ var P = class e extends M {
1776
1776
  });
1777
1777
  }
1778
1778
  keyof() {
1779
- return Ye(u.objectKeys(this.shape));
1779
+ return Xe(u.objectKeys(this.shape));
1780
1780
  }
1781
1781
  };
1782
1782
  P.create = (e, t) => new P({
1783
1783
  shape: () => e,
1784
1784
  unknownKeys: "strip",
1785
1785
  catchall: N.create(),
1786
- typeName: z.ZodObject,
1786
+ typeName: R.ZodObject,
1787
1787
  ...j(t)
1788
1788
  }), P.strictCreate = (e, t) => new P({
1789
1789
  shape: () => e,
1790
1790
  unknownKeys: "strict",
1791
1791
  catchall: N.create(),
1792
- typeName: z.ZodObject,
1792
+ typeName: R.ZodObject,
1793
1793
  ...j(t)
1794
1794
  }), P.lazycreate = (e, t) => new P({
1795
1795
  shape: e,
1796
1796
  unknownKeys: "strip",
1797
1797
  catchall: N.create(),
1798
- typeName: z.ZodObject,
1798
+ typeName: R.ZodObject,
1799
1799
  ...j(t)
1800
1800
  });
1801
1801
  var ze = class extends M {
@@ -1863,10 +1863,10 @@ var ze = class extends M {
1863
1863
  };
1864
1864
  ze.create = (e, t) => new ze({
1865
1865
  options: e,
1866
- typeName: z.ZodUnion,
1866
+ typeName: R.ZodUnion,
1867
1867
  ...j(t)
1868
1868
  });
1869
- var F = (e) => e instanceof qe ? F(e.schema) : e instanceof L ? F(e.innerType()) : e instanceof Je ? [e.value] : e instanceof Xe ? e.options : e instanceof Ze ? u.objectValues(e.enum) : e instanceof et ? F(e._def.innerType) : e instanceof Me ? [void 0] : e instanceof Ne ? [null] : e instanceof R ? [void 0, ...F(e.unwrap())] : e instanceof $e ? [null, ...F(e.unwrap())] : e instanceof rt || e instanceof at ? F(e.unwrap()) : e instanceof tt ? F(e._def.innerType) : [], Be = class e extends M {
1869
+ var F = (e) => e instanceof Je ? F(e.schema) : e instanceof I ? F(e.innerType()) : e instanceof Ye ? [e.value] : e instanceof Ze ? e.options : e instanceof Qe ? u.objectValues(e.enum) : e instanceof tt ? F(e._def.innerType) : e instanceof Me ? [void 0] : e instanceof Ne ? [null] : e instanceof L ? [void 0, ...F(e.unwrap())] : e instanceof et ? [null, ...F(e.unwrap())] : e instanceof it || e instanceof ot ? F(e.unwrap()) : e instanceof nt ? F(e._def.innerType) : [], Be = class e extends M {
1870
1870
  _parse(e) {
1871
1871
  let { ctx: t } = this._processInputParams(e);
1872
1872
  if (t.parsedType !== f.object) return b(t, {
@@ -1909,7 +1909,7 @@ var F = (e) => e instanceof qe ? F(e.schema) : e instanceof L ? F(e.innerType())
1909
1909
  }
1910
1910
  }
1911
1911
  return new e({
1912
- typeName: z.ZodDiscriminatedUnion,
1912
+ typeName: R.ZodDiscriminatedUnion,
1913
1913
  discriminator: t,
1914
1914
  options: n,
1915
1915
  optionsMap: i,
@@ -1987,10 +1987,10 @@ var He = class extends M {
1987
1987
  He.create = (e, t, n) => new He({
1988
1988
  left: e,
1989
1989
  right: t,
1990
- typeName: z.ZodIntersection,
1990
+ typeName: R.ZodIntersection,
1991
1991
  ...j(n)
1992
1992
  });
1993
- var I = class e extends M {
1993
+ var Ue = class e extends M {
1994
1994
  _parse(e) {
1995
1995
  let { status: t, ctx: n } = this._processInputParams(e);
1996
1996
  if (n.parsedType !== f.array) return b(n, {
@@ -2028,16 +2028,16 @@ var I = class e extends M {
2028
2028
  });
2029
2029
  }
2030
2030
  };
2031
- I.create = (e, t) => {
2031
+ Ue.create = (e, t) => {
2032
2032
  if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
2033
- return new I({
2033
+ return new Ue({
2034
2034
  items: e,
2035
- typeName: z.ZodTuple,
2035
+ typeName: R.ZodTuple,
2036
2036
  rest: null,
2037
2037
  ...j(t)
2038
2038
  });
2039
2039
  };
2040
- var Ue = class e extends M {
2040
+ var We = class e extends M {
2041
2041
  get keySchema() {
2042
2042
  return this._def.keyType;
2043
2043
  }
@@ -2066,16 +2066,16 @@ var Ue = class e extends M {
2066
2066
  return n instanceof M ? new e({
2067
2067
  keyType: t,
2068
2068
  valueType: n,
2069
- typeName: z.ZodRecord,
2069
+ typeName: R.ZodRecord,
2070
2070
  ...j(r)
2071
2071
  }) : new e({
2072
2072
  keyType: Te.create(),
2073
2073
  valueType: t,
2074
- typeName: z.ZodRecord,
2074
+ typeName: R.ZodRecord,
2075
2075
  ...j(n)
2076
2076
  });
2077
2077
  }
2078
- }, We = class extends M {
2078
+ }, Ge = class extends M {
2079
2079
  get keySchema() {
2080
2080
  return this._def.keyType;
2081
2081
  }
@@ -2120,13 +2120,13 @@ var Ue = class e extends M {
2120
2120
  }
2121
2121
  }
2122
2122
  };
2123
- We.create = (e, t, n) => new We({
2123
+ Ge.create = (e, t, n) => new Ge({
2124
2124
  valueType: t,
2125
2125
  keyType: e,
2126
- typeName: z.ZodMap,
2126
+ typeName: R.ZodMap,
2127
2127
  ...j(n)
2128
2128
  });
2129
- var Ge = class e extends M {
2129
+ var Ke = class e extends M {
2130
2130
  _parse(e) {
2131
2131
  let { status: t, ctx: n } = this._processInputParams(e);
2132
2132
  if (n.parsedType !== f.set) return b(n, {
@@ -2190,14 +2190,14 @@ var Ge = class e extends M {
2190
2190
  return this.min(1, e);
2191
2191
  }
2192
2192
  };
2193
- Ge.create = (e, t) => new Ge({
2193
+ Ke.create = (e, t) => new Ke({
2194
2194
  valueType: e,
2195
2195
  minSize: null,
2196
2196
  maxSize: null,
2197
- typeName: z.ZodSet,
2197
+ typeName: R.ZodSet,
2198
2198
  ...j(t)
2199
2199
  });
2200
- var Ke = class e extends M {
2200
+ var qe = class e extends M {
2201
2201
  constructor() {
2202
2202
  super(...arguments), this.validate = this.implement;
2203
2203
  }
@@ -2241,7 +2241,7 @@ var Ke = class e extends M {
2241
2241
  });
2242
2242
  }
2243
2243
  let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
2244
- if (this._def.returns instanceof Qe) {
2244
+ if (this._def.returns instanceof $e) {
2245
2245
  let e = this;
2246
2246
  return w(async function(...t) {
2247
2247
  let o = new h([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
@@ -2271,7 +2271,7 @@ var Ke = class e extends M {
2271
2271
  args(...t) {
2272
2272
  return new e({
2273
2273
  ...this._def,
2274
- args: I.create(t).rest(Fe.create())
2274
+ args: Ue.create(t).rest(Fe.create())
2275
2275
  });
2276
2276
  }
2277
2277
  returns(t) {
@@ -2288,13 +2288,13 @@ var Ke = class e extends M {
2288
2288
  }
2289
2289
  static create(t, n, r) {
2290
2290
  return new e({
2291
- args: t || I.create([]).rest(Fe.create()),
2291
+ args: t || Ue.create([]).rest(Fe.create()),
2292
2292
  returns: n || Fe.create(),
2293
- typeName: z.ZodFunction,
2293
+ typeName: R.ZodFunction,
2294
2294
  ...j(r)
2295
2295
  });
2296
2296
  }
2297
- }, qe = class extends M {
2297
+ }, Je = class extends M {
2298
2298
  get schema() {
2299
2299
  return this._def.getter();
2300
2300
  }
@@ -2307,12 +2307,12 @@ var Ke = class e extends M {
2307
2307
  });
2308
2308
  }
2309
2309
  };
2310
- qe.create = (e, t) => new qe({
2310
+ Je.create = (e, t) => new Je({
2311
2311
  getter: e,
2312
- typeName: z.ZodLazy,
2312
+ typeName: R.ZodLazy,
2313
2313
  ...j(t)
2314
2314
  });
2315
- var Je = class extends M {
2315
+ var Ye = class extends M {
2316
2316
  _parse(e) {
2317
2317
  if (e.data !== this._def.value) {
2318
2318
  let t = this._getOrReturnCtx(e);
@@ -2331,19 +2331,19 @@ var Je = class extends M {
2331
2331
  return this._def.value;
2332
2332
  }
2333
2333
  };
2334
- Je.create = (e, t) => new Je({
2334
+ Ye.create = (e, t) => new Ye({
2335
2335
  value: e,
2336
- typeName: z.ZodLiteral,
2336
+ typeName: R.ZodLiteral,
2337
2337
  ...j(t)
2338
2338
  });
2339
- function Ye(e, t) {
2340
- return new Xe({
2339
+ function Xe(e, t) {
2340
+ return new Ze({
2341
2341
  values: e,
2342
- typeName: z.ZodEnum,
2342
+ typeName: R.ZodEnum,
2343
2343
  ...j(t)
2344
2344
  });
2345
2345
  }
2346
- var Xe = class e extends M {
2346
+ var Ze = class e extends M {
2347
2347
  _parse(e) {
2348
2348
  if (typeof e.data != "string") {
2349
2349
  let t = this._getOrReturnCtx(e), n = this._def.values;
@@ -2394,8 +2394,8 @@ var Xe = class e extends M {
2394
2394
  });
2395
2395
  }
2396
2396
  };
2397
- Xe.create = Ye;
2398
- var Ze = class extends M {
2397
+ Ze.create = Xe;
2398
+ var Qe = class extends M {
2399
2399
  _parse(e) {
2400
2400
  let t = u.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2401
2401
  if (n.parsedType !== f.string && n.parsedType !== f.number) {
@@ -2420,12 +2420,12 @@ var Ze = class extends M {
2420
2420
  return this._def.values;
2421
2421
  }
2422
2422
  };
2423
- Ze.create = (e, t) => new Ze({
2423
+ Qe.create = (e, t) => new Qe({
2424
2424
  values: e,
2425
- typeName: z.ZodNativeEnum,
2425
+ typeName: R.ZodNativeEnum,
2426
2426
  ...j(t)
2427
2427
  });
2428
- var Qe = class extends M {
2428
+ var $e = class extends M {
2429
2429
  unwrap() {
2430
2430
  return this._def.type;
2431
2431
  }
@@ -2441,17 +2441,17 @@ var Qe = class extends M {
2441
2441
  })));
2442
2442
  }
2443
2443
  };
2444
- Qe.create = (e, t) => new Qe({
2444
+ $e.create = (e, t) => new $e({
2445
2445
  type: e,
2446
- typeName: z.ZodPromise,
2446
+ typeName: R.ZodPromise,
2447
2447
  ...j(t)
2448
2448
  });
2449
- var L = class extends M {
2449
+ var I = class extends M {
2450
2450
  innerType() {
2451
2451
  return this._def.schema;
2452
2452
  }
2453
2453
  sourceType() {
2454
- return this._def.schema._def.typeName === z.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2454
+ return this._def.schema._def.typeName === R.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
2455
2455
  }
2456
2456
  _parse(e) {
2457
2457
  let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
@@ -2533,21 +2533,21 @@ var L = class extends M {
2533
2533
  u.assertNever(r);
2534
2534
  }
2535
2535
  };
2536
- L.create = (e, t, n) => new L({
2536
+ I.create = (e, t, n) => new I({
2537
2537
  schema: e,
2538
- typeName: z.ZodEffects,
2538
+ typeName: R.ZodEffects,
2539
2539
  effect: t,
2540
2540
  ...j(n)
2541
- }), L.createWithPreprocess = (e, t, n) => new L({
2541
+ }), I.createWithPreprocess = (e, t, n) => new I({
2542
2542
  schema: t,
2543
2543
  effect: {
2544
2544
  type: "preprocess",
2545
2545
  transform: e
2546
2546
  },
2547
- typeName: z.ZodEffects,
2547
+ typeName: R.ZodEffects,
2548
2548
  ...j(n)
2549
2549
  });
2550
- var R = class extends M {
2550
+ var L = class extends M {
2551
2551
  _parse(e) {
2552
2552
  return this._getType(e) === f.undefined ? w(void 0) : this._def.innerType._parse(e);
2553
2553
  }
@@ -2555,12 +2555,12 @@ var R = class extends M {
2555
2555
  return this._def.innerType;
2556
2556
  }
2557
2557
  };
2558
- R.create = (e, t) => new R({
2558
+ L.create = (e, t) => new L({
2559
2559
  innerType: e,
2560
- typeName: z.ZodOptional,
2560
+ typeName: R.ZodOptional,
2561
2561
  ...j(t)
2562
2562
  });
2563
- var $e = class extends M {
2563
+ var et = class extends M {
2564
2564
  _parse(e) {
2565
2565
  return this._getType(e) === f.null ? w(null) : this._def.innerType._parse(e);
2566
2566
  }
@@ -2568,12 +2568,12 @@ var $e = class extends M {
2568
2568
  return this._def.innerType;
2569
2569
  }
2570
2570
  };
2571
- $e.create = (e, t) => new $e({
2571
+ et.create = (e, t) => new et({
2572
2572
  innerType: e,
2573
- typeName: z.ZodNullable,
2573
+ typeName: R.ZodNullable,
2574
2574
  ...j(t)
2575
2575
  });
2576
- var et = class extends M {
2576
+ var tt = class extends M {
2577
2577
  _parse(e) {
2578
2578
  let { ctx: t } = this._processInputParams(e), n = t.data;
2579
2579
  return t.parsedType === f.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
@@ -2586,13 +2586,13 @@ var et = class extends M {
2586
2586
  return this._def.innerType;
2587
2587
  }
2588
2588
  };
2589
- et.create = (e, t) => new et({
2589
+ tt.create = (e, t) => new tt({
2590
2590
  innerType: e,
2591
- typeName: z.ZodDefault,
2591
+ typeName: R.ZodDefault,
2592
2592
  defaultValue: typeof t.default == "function" ? t.default : () => t.default,
2593
2593
  ...j(t)
2594
2594
  });
2595
- var tt = class extends M {
2595
+ var nt = class extends M {
2596
2596
  _parse(e) {
2597
2597
  let { ctx: t } = this._processInputParams(e), n = {
2598
2598
  ...t,
@@ -2627,13 +2627,13 @@ var tt = class extends M {
2627
2627
  return this._def.innerType;
2628
2628
  }
2629
2629
  };
2630
- tt.create = (e, t) => new tt({
2630
+ nt.create = (e, t) => new nt({
2631
2631
  innerType: e,
2632
- typeName: z.ZodCatch,
2632
+ typeName: R.ZodCatch,
2633
2633
  catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
2634
2634
  ...j(t)
2635
2635
  });
2636
- var nt = class extends M {
2636
+ var rt = class extends M {
2637
2637
  _parse(e) {
2638
2638
  if (this._getType(e) !== f.nan) {
2639
2639
  let t = this._getOrReturnCtx(e);
@@ -2649,11 +2649,11 @@ var nt = class extends M {
2649
2649
  };
2650
2650
  }
2651
2651
  };
2652
- nt.create = (e) => new nt({
2653
- typeName: z.ZodNaN,
2652
+ rt.create = (e) => new rt({
2653
+ typeName: R.ZodNaN,
2654
2654
  ...j(e)
2655
2655
  });
2656
- var rt = class extends M {
2656
+ var it = class extends M {
2657
2657
  _parse(e) {
2658
2658
  let { ctx: t } = this._processInputParams(e), n = t.data;
2659
2659
  return this._def.type._parse({
@@ -2665,7 +2665,7 @@ var rt = class extends M {
2665
2665
  unwrap() {
2666
2666
  return this._def.type;
2667
2667
  }
2668
- }, it = class e extends M {
2668
+ }, at = class e extends M {
2669
2669
  _parse(e) {
2670
2670
  let { status: t, ctx: n } = this._processInputParams(e);
2671
2671
  if (n.common.async) return (async () => {
@@ -2700,10 +2700,10 @@ var rt = class extends M {
2700
2700
  return new e({
2701
2701
  in: t,
2702
2702
  out: n,
2703
- typeName: z.ZodPipeline
2703
+ typeName: R.ZodPipeline
2704
2704
  });
2705
2705
  }
2706
- }, at = class extends M {
2706
+ }, ot = class extends M {
2707
2707
  _parse(e) {
2708
2708
  let t = this._def.innerType._parse(e), n = (e) => (D(e) && (e.value = Object.freeze(e.value)), e);
2709
2709
  return O(t) ? t.then((e) => n(e)) : n(t);
@@ -2712,64 +2712,64 @@ var rt = class extends M {
2712
2712
  return this._def.innerType;
2713
2713
  }
2714
2714
  };
2715
- at.create = (e, t) => new at({
2715
+ ot.create = (e, t) => new ot({
2716
2716
  innerType: e,
2717
- typeName: z.ZodReadonly,
2717
+ typeName: R.ZodReadonly,
2718
2718
  ...j(t)
2719
2719
  }), P.lazycreate;
2720
- var z;
2720
+ var R;
2721
2721
  (function(e) {
2722
2722
  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";
2723
- })(z ||= {});
2724
- var B = Te.create;
2725
- De.create, nt.create, Oe.create;
2726
- var ot = ke.create;
2723
+ })(R ||= {});
2724
+ var z = Te.create;
2725
+ De.create, rt.create, Oe.create;
2726
+ var st = ke.create;
2727
2727
  Ae.create, je.create, Me.create, Ne.create, Pe.create;
2728
- var st = Fe.create;
2728
+ var ct = Fe.create;
2729
2729
  N.create, Ie.create, Le.create;
2730
- var ct = P.create;
2731
- P.strictCreate, ze.create, Be.create, He.create, I.create;
2732
- var lt = Ue.create;
2733
- We.create, Ge.create, Ke.create, qe.create, Je.create;
2734
- var ut = Xe.create;
2735
- Ze.create, Qe.create, L.create, R.create, $e.create, L.createWithPreprocess, it.create;
2730
+ var lt = P.create;
2731
+ P.strictCreate, ze.create, Be.create, He.create, Ue.create;
2732
+ var ut = We.create;
2733
+ Ge.create, Ke.create, qe.create, Je.create, Ye.create;
2734
+ var dt = Ze.create;
2735
+ Qe.create, $e.create, I.create, L.create, et.create, I.createWithPreprocess, at.create;
2736
2736
  //#endregion
2737
2737
  //#region ../../packages/widget-sdk/src/config/schema.ts
2738
- var dt = ct({
2739
- mode: ut([
2738
+ var ft = lt({
2739
+ mode: dt([
2740
2740
  "light",
2741
2741
  "dark",
2742
2742
  "system"
2743
2743
  ]).optional(),
2744
- accentColor: B().optional(),
2745
- fontFamily: B().optional(),
2746
- borderRadius: B().optional()
2747
- }), ft = ct({
2748
- externalId: B().optional(),
2749
- authId: B().optional(),
2750
- name: B().optional(),
2751
- email: B().optional()
2752
- }), pt = ct({
2753
- agentId: B().min(1, "agentId is required"),
2754
- apiBaseUrl: B().url("apiBaseUrl must be a valid URL"),
2755
- tenantId: B().optional(),
2756
- user: ft.optional(),
2757
- sessionId: B().optional(),
2758
- mode: ut(["floating", "inline"]).optional(),
2759
- title: B().optional(),
2760
- subtitle: B().optional(),
2761
- description: B().optional(),
2762
- avatarUrl: B().optional(),
2763
- streaming: ot().optional(),
2764
- preview: ot().optional(),
2765
- skipServerConfigFetch: ot().optional(),
2766
- configChannel: ut(["draft", "published"]).optional(),
2767
- metadata: lt(st()).optional(),
2768
- theme: dt.optional()
2769
- }), mt = pt.omit({
2744
+ accentColor: z().optional(),
2745
+ fontFamily: z().optional(),
2746
+ borderRadius: z().optional()
2747
+ }), pt = lt({
2748
+ externalId: z().optional(),
2749
+ authId: z().optional(),
2750
+ name: z().optional(),
2751
+ email: z().optional()
2752
+ }), mt = lt({
2753
+ agentId: z().min(1, "agentId is required"),
2754
+ apiBaseUrl: z().url("apiBaseUrl must be a valid URL"),
2755
+ tenantId: z().optional(),
2756
+ user: pt.optional(),
2757
+ sessionId: z().optional(),
2758
+ mode: dt(["floating", "inline"]).optional(),
2759
+ title: z().optional(),
2760
+ subtitle: z().optional(),
2761
+ description: z().optional(),
2762
+ avatarUrl: z().optional(),
2763
+ streaming: st().optional(),
2764
+ preview: st().optional(),
2765
+ skipServerConfigFetch: st().optional(),
2766
+ configChannel: dt(["draft", "published"]).optional(),
2767
+ metadata: ut(ct()).optional(),
2768
+ theme: ft.optional()
2769
+ }), ht = mt.omit({
2770
2770
  agentId: !0,
2771
2771
  apiBaseUrl: !0
2772
- }).partial(), ht = {
2772
+ }).partial(), gt = {
2773
2773
  mode: "floating",
2774
2774
  streaming: !0,
2775
2775
  title: "AI Assistant",
@@ -2780,15 +2780,15 @@ var dt = ct({
2780
2780
  borderRadius: "12px"
2781
2781
  }
2782
2782
  };
2783
- function gt(e, t) {
2784
- pt.parse(e);
2783
+ function _t(e, t) {
2784
+ mt.parse(e);
2785
2785
  let n, r = t ? { ...t } : void 0;
2786
2786
  r && typeof r.theme == "object" && r.theme !== null ? (n = r.theme, delete r.theme) : r && typeof r.theme == "string" && (n = { mode: r.theme }, delete r.theme);
2787
- let i = r ? mt.passthrough().safeParse(r).data : void 0, a = i ? _t(i, e) : e, o = {
2788
- mode: a.theme?.mode ?? n?.mode ?? ht.theme.mode,
2789
- accentColor: a.theme?.accentColor ?? n?.accentColor ?? ht.theme.accentColor,
2790
- fontFamily: a.theme?.fontFamily ?? n?.fontFamily ?? ht.theme.fontFamily,
2791
- borderRadius: a.theme?.borderRadius ?? n?.borderRadius ?? ht.theme.borderRadius
2787
+ let i = r ? ht.passthrough().safeParse(r).data : void 0, a = i ? vt(i, e) : e, o = {
2788
+ mode: a.theme?.mode ?? n?.mode ?? gt.theme.mode,
2789
+ accentColor: a.theme?.accentColor ?? n?.accentColor ?? gt.theme.accentColor,
2790
+ fontFamily: a.theme?.fontFamily ?? n?.fontFamily ?? gt.theme.fontFamily,
2791
+ borderRadius: a.theme?.borderRadius ?? n?.borderRadius ?? gt.theme.borderRadius
2792
2792
  };
2793
2793
  return {
2794
2794
  agentId: a.agentId,
@@ -2801,8 +2801,8 @@ function gt(e, t) {
2801
2801
  email: a.user?.email
2802
2802
  },
2803
2803
  sessionId: a.sessionId,
2804
- mode: a.mode ?? ht.mode,
2805
- title: a.title ?? ht.title,
2804
+ mode: a.mode ?? gt.mode,
2805
+ title: a.title ?? gt.title,
2806
2806
  subtitle: a.subtitle,
2807
2807
  description: a.description,
2808
2808
  suggestedQuestions: (() => {
@@ -2810,7 +2810,7 @@ function gt(e, t) {
2810
2810
  return Array.isArray(e) ? e : [];
2811
2811
  })(),
2812
2812
  avatarUrl: a.avatarUrl,
2813
- streaming: a.streaming ?? ht.streaming,
2813
+ streaming: a.streaming ?? gt.streaming,
2814
2814
  preview: a.preview === !0,
2815
2815
  skipServerConfigFetch: a.skipServerConfigFetch === !0,
2816
2816
  configChannel: a.configChannel,
@@ -2825,26 +2825,30 @@ function gt(e, t) {
2825
2825
  attachmentMaxFileSizeMb: (() => {
2826
2826
  let e = i?.attachmentMaxFileSizeMb;
2827
2827
  return typeof e == "number" && Number.isFinite(e) ? e : 1;
2828
+ })(),
2829
+ turnstileSiteKey: (() => {
2830
+ let e = i?.turnstileSiteKey;
2831
+ return typeof e == "string" && e.length > 0 ? e : void 0;
2828
2832
  })()
2829
2833
  };
2830
2834
  }
2831
- function _t(e, t) {
2835
+ function vt(e, t) {
2832
2836
  let n = { ...e };
2833
2837
  for (let e of Object.keys(t)) {
2834
2838
  let r = t[e];
2835
- r != null && (typeof r == "object" && !Array.isArray(r) && n[e] !== null && typeof n[e] == "object" ? n[e] = _t(n[e], r) : n[e] = r);
2839
+ r != null && (typeof r == "object" && !Array.isArray(r) && n[e] !== null && typeof n[e] == "object" ? n[e] = vt(n[e], r) : n[e] = r);
2836
2840
  }
2837
2841
  return n;
2838
2842
  }
2839
2843
  //#endregion
2840
2844
  //#region ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
2841
- var vt = function() {
2842
- return vt = Object.assign || function(e) {
2845
+ var yt = function() {
2846
+ return yt = Object.assign || function(e) {
2843
2847
  for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
2844
2848
  return e;
2845
- }, vt.apply(this, arguments);
2849
+ }, yt.apply(this, arguments);
2846
2850
  };
2847
- function V(e, t, n, r) {
2851
+ function B(e, t, n, r) {
2848
2852
  function i(e) {
2849
2853
  return e instanceof n ? e : new n(function(t) {
2850
2854
  t(e);
@@ -2871,7 +2875,7 @@ function V(e, t, n, r) {
2871
2875
  c((r = r.apply(e, t || [])).next());
2872
2876
  });
2873
2877
  }
2874
- function H(e, t) {
2878
+ function V(e, t) {
2875
2879
  var n = {
2876
2880
  label: 0,
2877
2881
  sent: function() {
@@ -2941,19 +2945,19 @@ function H(e, t) {
2941
2945
  };
2942
2946
  }
2943
2947
  }
2944
- function yt(e, t, n) {
2948
+ function bt(e, t, n) {
2945
2949
  if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
2946
2950
  return e.concat(a || Array.prototype.slice.call(t));
2947
2951
  }
2948
2952
  //#endregion
2949
2953
  //#region ../../node_modules/.pnpm/@fingerprintjs+fingerprintjs@4.6.2/node_modules/@fingerprintjs/fingerprintjs/dist/fp.esm.js
2950
- var bt = "4.6.2";
2951
- function xt(e, t) {
2954
+ var xt = "4.6.2";
2955
+ function St(e, t) {
2952
2956
  return new Promise(function(n) {
2953
2957
  return setTimeout(n, e, t);
2954
2958
  });
2955
2959
  }
2956
- function St() {
2960
+ function Ct() {
2957
2961
  return new Promise(function(e) {
2958
2962
  var t = new MessageChannel();
2959
2963
  t.port1.onmessage = function() {
@@ -2961,22 +2965,22 @@ function St() {
2961
2965
  }, t.port2.postMessage(null);
2962
2966
  });
2963
2967
  }
2964
- function Ct(e, t) {
2968
+ function wt(e, t) {
2965
2969
  t === void 0 && (t = Infinity);
2966
2970
  var n = window.requestIdleCallback;
2967
2971
  return n ? new Promise(function(e) {
2968
2972
  return n.call(window, function() {
2969
2973
  return e();
2970
2974
  }, { timeout: t });
2971
- }) : xt(Math.min(e, t));
2975
+ }) : St(Math.min(e, t));
2972
2976
  }
2973
- function wt(e) {
2977
+ function Tt(e) {
2974
2978
  return !!e && typeof e.then == "function";
2975
2979
  }
2976
- function Tt(e, t) {
2980
+ function Et(e, t) {
2977
2981
  try {
2978
2982
  var n = e();
2979
- wt(n) ? n.then(function(e) {
2983
+ Tt(n) ? n.then(function(e) {
2980
2984
  return t(!0, e);
2981
2985
  }, function(e) {
2982
2986
  return t(!1, e);
@@ -2985,13 +2989,13 @@ function Tt(e, t) {
2985
2989
  t(!1, e);
2986
2990
  }
2987
2991
  }
2988
- function Et(e, t, n) {
2989
- return n === void 0 && (n = 16), V(this, void 0, void 0, function() {
2992
+ function Dt(e, t, n) {
2993
+ return n === void 0 && (n = 16), B(this, void 0, void 0, function() {
2990
2994
  var r, i, a, o;
2991
- return H(this, function(s) {
2995
+ return V(this, function(s) {
2992
2996
  switch (s.label) {
2993
2997
  case 0: r = Array(e.length), i = Date.now(), a = 0, s.label = 1;
2994
- case 1: return a < e.length ? (r[a] = t(e[a], a), o = Date.now(), o >= i + n ? (i = o, [4, St()]) : [3, 3]) : [3, 4];
2998
+ case 1: return a < e.length ? (r[a] = t(e[a], a), o = Date.now(), o >= i + n ? (i = o, [4, Ct()]) : [3, 3]) : [3, 4];
2995
2999
  case 2: s.sent(), s.label = 3;
2996
3000
  case 3: return ++a, [3, 1];
2997
3001
  case 4: return [2, r];
@@ -2999,36 +3003,36 @@ function Et(e, t, n) {
2999
3003
  });
3000
3004
  });
3001
3005
  }
3002
- function Dt(e) {
3006
+ function Ot(e) {
3003
3007
  return e.then(void 0, function() {}), e;
3004
3008
  }
3005
- function Ot(e, t) {
3009
+ function kt(e, t) {
3006
3010
  for (var n = 0, r = e.length; n < r; ++n) if (e[n] === t) return !0;
3007
3011
  return !1;
3008
3012
  }
3009
- function kt(e, t) {
3010
- return !Ot(e, t);
3013
+ function At(e, t) {
3014
+ return !kt(e, t);
3011
3015
  }
3012
- function At(e) {
3016
+ function jt(e) {
3013
3017
  return parseInt(e);
3014
3018
  }
3015
- function U(e) {
3019
+ function H(e) {
3016
3020
  return parseFloat(e);
3017
3021
  }
3018
- function W(e, t) {
3022
+ function U(e, t) {
3019
3023
  return typeof e == "number" && isNaN(e) ? t : e;
3020
3024
  }
3021
- function G(e) {
3025
+ function W(e) {
3022
3026
  return e.reduce(function(e, t) {
3023
3027
  return e + +!!t;
3024
3028
  }, 0);
3025
3029
  }
3026
- function jt(e, t) {
3030
+ function Mt(e, t) {
3027
3031
  if (t === void 0 && (t = 1), Math.abs(t) >= 1) return Math.round(e / t) * t;
3028
3032
  var n = 1 / t;
3029
3033
  return Math.round(e * n) / n;
3030
3034
  }
3031
- function Mt(e) {
3035
+ function Nt(e) {
3032
3036
  for (var t = `Unexpected syntax '${e}'`, n = /^\s*([a-z-]*)(.*)$/i.exec(e), r = n[1] || void 0, i = {}, a = /([.:#][\w-]+|\[.+?\])/gi, o = function(e, t) {
3033
3037
  i[e] = i[e] || [], i[e].push(t);
3034
3038
  };;) {
@@ -3052,7 +3056,7 @@ function Mt(e) {
3052
3056
  }
3053
3057
  return [r, i];
3054
3058
  }
3055
- function Nt(e) {
3059
+ function Pt(e) {
3056
3060
  for (var t = new Uint8Array(e.length), n = 0; n < e.length; n++) {
3057
3061
  var r = e.charCodeAt(n);
3058
3062
  if (r > 127) return new TextEncoder().encode(e);
@@ -3060,73 +3064,73 @@ function Nt(e) {
3060
3064
  }
3061
3065
  return t;
3062
3066
  }
3063
- function K(e, t) {
3067
+ function G(e, t) {
3064
3068
  var n = e[0] >>> 16, r = e[0] & 65535, i = e[1] >>> 16, a = e[1] & 65535, o = t[0] >>> 16, s = t[0] & 65535, c = t[1] >>> 16, l = t[1] & 65535, u = 0, d = 0, f = 0, p = 0;
3065
3069
  p += a + l, f += p >>> 16, p &= 65535, f += i + c, d += f >>> 16, f &= 65535, d += r + s, u += d >>> 16, d &= 65535, u += n + o, u &= 65535, e[0] = u << 16 | d, e[1] = f << 16 | p;
3066
3070
  }
3067
- function q(e, t) {
3071
+ function K(e, t) {
3068
3072
  var n = e[0] >>> 16, r = e[0] & 65535, i = e[1] >>> 16, a = e[1] & 65535, o = t[0] >>> 16, s = t[0] & 65535, c = t[1] >>> 16, l = t[1] & 65535, u = 0, d = 0, f = 0, p = 0;
3069
3073
  p += a * l, f += p >>> 16, p &= 65535, f += i * l, d += f >>> 16, f &= 65535, f += a * c, d += f >>> 16, f &= 65535, d += r * l, u += d >>> 16, d &= 65535, d += i * c, u += d >>> 16, d &= 65535, d += a * s, u += d >>> 16, d &= 65535, u += n * l + r * c + i * s + a * o, u &= 65535, e[0] = u << 16 | d, e[1] = f << 16 | p;
3070
3074
  }
3071
- function Pt(e, t) {
3075
+ function Ft(e, t) {
3072
3076
  var n = e[0];
3073
3077
  t %= 64, t === 32 ? (e[0] = e[1], e[1] = n) : t < 32 ? (e[0] = n << t | e[1] >>> 32 - t, e[1] = e[1] << t | n >>> 32 - t) : (t -= 32, e[0] = e[1] << t | n >>> 32 - t, e[1] = n << t | e[1] >>> 32 - t);
3074
3078
  }
3075
- function J(e, t) {
3079
+ function q(e, t) {
3076
3080
  t %= 64, t !== 0 && (t < 32 ? (e[0] = e[1] >>> 32 - t, e[1] <<= t) : (e[0] = e[1] << t - 32, e[1] = 0));
3077
3081
  }
3078
- function Y(e, t) {
3082
+ function J(e, t) {
3079
3083
  e[0] ^= t[0], e[1] ^= t[1];
3080
3084
  }
3081
- var Ft = [4283543511, 3981806797], It = [3301882366, 444984403];
3082
- function Lt(e) {
3085
+ var It = [4283543511, 3981806797], Lt = [3301882366, 444984403];
3086
+ function Rt(e) {
3083
3087
  var t = [0, e[0] >>> 1];
3084
- Y(e, t), q(e, Ft), t[1] = e[0] >>> 1, Y(e, t), q(e, It), t[1] = e[0] >>> 1, Y(e, t);
3088
+ J(e, t), K(e, It), t[1] = e[0] >>> 1, J(e, t), K(e, Lt), t[1] = e[0] >>> 1, J(e, t);
3085
3089
  }
3086
- var Rt = [2277735313, 289559509], zt = [1291169091, 658871167], Bt = [0, 5], Vt = [0, 1390208809], Ht = [0, 944331445];
3087
- function Ut(e, t) {
3088
- var n = Nt(e);
3090
+ var zt = [2277735313, 289559509], Bt = [1291169091, 658871167], Vt = [0, 5], Ht = [0, 1390208809], Ut = [0, 944331445];
3091
+ function Wt(e, t) {
3092
+ var n = Pt(e);
3089
3093
  t ||= 0;
3090
3094
  var r = [0, n.length], i = r[1] % 16, a = r[1] - i, o = [0, t], s = [0, t], c = [0, 0], l = [0, 0], u;
3091
- for (u = 0; u < a; u += 16) c[0] = n[u + 4] | n[u + 5] << 8 | n[u + 6] << 16 | n[u + 7] << 24, c[1] = n[u] | n[u + 1] << 8 | n[u + 2] << 16 | n[u + 3] << 24, l[0] = n[u + 12] | n[u + 13] << 8 | n[u + 14] << 16 | n[u + 15] << 24, l[1] = n[u + 8] | n[u + 9] << 8 | n[u + 10] << 16 | n[u + 11] << 24, q(c, Rt), Pt(c, 31), q(c, zt), Y(o, c), Pt(o, 27), K(o, s), q(o, Bt), K(o, Vt), q(l, zt), Pt(l, 33), q(l, Rt), Y(s, l), Pt(s, 31), K(s, o), q(s, Bt), K(s, Ht);
3095
+ for (u = 0; u < a; u += 16) c[0] = n[u + 4] | n[u + 5] << 8 | n[u + 6] << 16 | n[u + 7] << 24, c[1] = n[u] | n[u + 1] << 8 | n[u + 2] << 16 | n[u + 3] << 24, l[0] = n[u + 12] | n[u + 13] << 8 | n[u + 14] << 16 | n[u + 15] << 24, l[1] = n[u + 8] | n[u + 9] << 8 | n[u + 10] << 16 | n[u + 11] << 24, K(c, zt), Ft(c, 31), K(c, Bt), J(o, c), Ft(o, 27), G(o, s), K(o, Vt), G(o, Ht), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l), Ft(s, 31), G(s, o), K(s, Vt), G(s, Ut);
3092
3096
  c[0] = 0, c[1] = 0, l[0] = 0, l[1] = 0;
3093
3097
  var d = [0, 0];
3094
3098
  switch (i) {
3095
- case 15: d[1] = n[u + 14], J(d, 48), Y(l, d);
3096
- case 14: d[1] = n[u + 13], J(d, 40), Y(l, d);
3097
- case 13: d[1] = n[u + 12], J(d, 32), Y(l, d);
3098
- case 12: d[1] = n[u + 11], J(d, 24), Y(l, d);
3099
- case 11: d[1] = n[u + 10], J(d, 16), Y(l, d);
3100
- case 10: d[1] = n[u + 9], J(d, 8), Y(l, d);
3101
- case 9: d[1] = n[u + 8], Y(l, d), q(l, zt), Pt(l, 33), q(l, Rt), Y(s, l);
3102
- case 8: d[1] = n[u + 7], J(d, 56), Y(c, d);
3103
- case 7: d[1] = n[u + 6], J(d, 48), Y(c, d);
3104
- case 6: d[1] = n[u + 5], J(d, 40), Y(c, d);
3105
- case 5: d[1] = n[u + 4], J(d, 32), Y(c, d);
3106
- case 4: d[1] = n[u + 3], J(d, 24), Y(c, d);
3107
- case 3: d[1] = n[u + 2], J(d, 16), Y(c, d);
3108
- case 2: d[1] = n[u + 1], J(d, 8), Y(c, d);
3109
- case 1: d[1] = n[u], Y(c, d), q(c, Rt), Pt(c, 31), q(c, zt), Y(o, c);
3110
- }
3111
- return Y(o, r), Y(s, r), K(o, s), K(s, o), Lt(o), Lt(s), K(o, s), K(s, o), ("00000000" + (o[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[1] >>> 0).toString(16)).slice(-8);
3112
- }
3113
- function Wt(e) {
3114
- return vt({
3099
+ case 15: d[1] = n[u + 14], q(d, 48), J(l, d);
3100
+ case 14: d[1] = n[u + 13], q(d, 40), J(l, d);
3101
+ case 13: d[1] = n[u + 12], q(d, 32), J(l, d);
3102
+ case 12: d[1] = n[u + 11], q(d, 24), J(l, d);
3103
+ case 11: d[1] = n[u + 10], q(d, 16), J(l, d);
3104
+ case 10: d[1] = n[u + 9], q(d, 8), J(l, d);
3105
+ case 9: d[1] = n[u + 8], J(l, d), K(l, Bt), Ft(l, 33), K(l, zt), J(s, l);
3106
+ case 8: d[1] = n[u + 7], q(d, 56), J(c, d);
3107
+ case 7: d[1] = n[u + 6], q(d, 48), J(c, d);
3108
+ case 6: d[1] = n[u + 5], q(d, 40), J(c, d);
3109
+ case 5: d[1] = n[u + 4], q(d, 32), J(c, d);
3110
+ case 4: d[1] = n[u + 3], q(d, 24), J(c, d);
3111
+ case 3: d[1] = n[u + 2], q(d, 16), J(c, d);
3112
+ case 2: d[1] = n[u + 1], q(d, 8), J(c, d);
3113
+ case 1: d[1] = n[u], J(c, d), K(c, zt), Ft(c, 31), K(c, Bt), J(o, c);
3114
+ }
3115
+ return J(o, r), J(s, r), G(o, s), G(s, o), Rt(o), Rt(s), G(o, s), G(s, o), ("00000000" + (o[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[1] >>> 0).toString(16)).slice(-8);
3116
+ }
3117
+ function Gt(e) {
3118
+ return yt({
3115
3119
  name: e.name,
3116
3120
  message: e.message,
3117
3121
  stack: e.stack?.split("\n")
3118
3122
  }, e);
3119
3123
  }
3120
- function Gt(e) {
3124
+ function Kt(e) {
3121
3125
  return /^function\s.*?\{\s*\[native code]\s*}$/.test(String(e));
3122
3126
  }
3123
- function Kt(e) {
3127
+ function qt(e) {
3124
3128
  return typeof e != "function";
3125
3129
  }
3126
- function qt(e, t) {
3127
- var n = Dt(new Promise(function(n) {
3130
+ function Jt(e, t) {
3131
+ var n = Ot(new Promise(function(n) {
3128
3132
  var r = Date.now();
3129
- Tt(e.bind(null, t), function() {
3133
+ Et(e.bind(null, t), function() {
3130
3134
  var e = [...arguments], t = Date.now() - r;
3131
3135
  if (!e[0]) return n(function() {
3132
3136
  return {
@@ -3135,7 +3139,7 @@ function qt(e, t) {
3135
3139
  };
3136
3140
  });
3137
3141
  var i = e[1];
3138
- if (Kt(i)) return n(function() {
3142
+ if (qt(i)) return n(function() {
3139
3143
  return {
3140
3144
  value: i,
3141
3145
  duration: t
@@ -3144,7 +3148,7 @@ function qt(e, t) {
3144
3148
  n(function() {
3145
3149
  return new Promise(function(e) {
3146
3150
  var n = Date.now();
3147
- Tt(i, function() {
3151
+ Et(i, function() {
3148
3152
  var r = [...arguments], i = t + Date.now() - n;
3149
3153
  if (!r[0]) return e({
3150
3154
  error: r[1],
@@ -3165,20 +3169,20 @@ function qt(e, t) {
3165
3169
  });
3166
3170
  };
3167
3171
  }
3168
- function Jt(e, t, n, r) {
3172
+ function Yt(e, t, n, r) {
3169
3173
  var i = Object.keys(e).filter(function(e) {
3170
- return kt(n, e);
3171
- }), a = Dt(Et(i, function(n) {
3172
- return qt(e[n], t);
3174
+ return At(n, e);
3175
+ }), a = Ot(Dt(i, function(n) {
3176
+ return Jt(e[n], t);
3173
3177
  }, r));
3174
3178
  return function() {
3175
- return V(this, void 0, void 0, function() {
3179
+ return B(this, void 0, void 0, function() {
3176
3180
  var e, t, n, o, s;
3177
- return H(this, function(c) {
3181
+ return V(this, function(c) {
3178
3182
  switch (c.label) {
3179
3183
  case 0: return [4, a];
3180
- case 1: return e = c.sent(), [4, Et(e, function(e) {
3181
- return Dt(e());
3184
+ case 1: return e = c.sent(), [4, Dt(e, function(e) {
3185
+ return Ot(e());
3182
3186
  }, r)];
3183
3187
  case 2: return t = c.sent(), [4, Promise.all(t)];
3184
3188
  case 3:
@@ -3189,9 +3193,9 @@ function Jt(e, t, n, r) {
3189
3193
  });
3190
3194
  };
3191
3195
  }
3192
- function Yt() {
3196
+ function Xt() {
3193
3197
  var e = window, t = navigator;
3194
- return G([
3198
+ return W([
3195
3199
  "MSCSSMatrix" in e,
3196
3200
  "msSetImmediate" in e,
3197
3201
  "msIndexedDB" in e,
@@ -3199,18 +3203,18 @@ function Yt() {
3199
3203
  "msPointerEnabled" in t
3200
3204
  ]) >= 4;
3201
3205
  }
3202
- function Xt() {
3206
+ function Zt() {
3203
3207
  var e = window, t = navigator;
3204
- return G([
3208
+ return W([
3205
3209
  "msWriteProfilerMark" in e,
3206
3210
  "MSStream" in e,
3207
3211
  "msLaunchUri" in t,
3208
3212
  "msSaveBlob" in t
3209
- ]) >= 3 && !Yt();
3213
+ ]) >= 3 && !Xt();
3210
3214
  }
3211
- function Zt() {
3215
+ function Qt() {
3212
3216
  var e = window, t = navigator;
3213
- return G([
3217
+ return W([
3214
3218
  "webkitPersistentStorage" in t,
3215
3219
  "webkitTemporaryStorage" in t,
3216
3220
  (t.vendor || "").indexOf("Google") === 0,
@@ -3220,9 +3224,9 @@ function Zt() {
3220
3224
  "webkitSpeechGrammar" in e
3221
3225
  ]) >= 5;
3222
3226
  }
3223
- function X() {
3227
+ function Y() {
3224
3228
  var e = window, t = navigator;
3225
- return G([
3229
+ return W([
3226
3230
  "ApplePayError" in e,
3227
3231
  "CSSPrimitiveValue" in e,
3228
3232
  "Counter" in e,
@@ -3231,9 +3235,9 @@ function X() {
3231
3235
  "WebKitMediaKeys" in e
3232
3236
  ]) >= 4;
3233
3237
  }
3234
- function Qt() {
3238
+ function $t() {
3235
3239
  var e = window, t = e.HTMLElement, n = e.Document;
3236
- return G([
3240
+ return W([
3237
3241
  "safari" in e,
3238
3242
  !("ongestureend" in e),
3239
3243
  !("TouchEvent" in e),
@@ -3242,13 +3246,13 @@ function Qt() {
3242
3246
  n && "pointerLockElement" in n.prototype
3243
3247
  ]) >= 4;
3244
3248
  }
3245
- function $t() {
3249
+ function en() {
3246
3250
  var e = window;
3247
- return Gt(e.print) && String(e.browser) === "[object WebPageNamespace]";
3251
+ return Kt(e.print) && String(e.browser) === "[object WebPageNamespace]";
3248
3252
  }
3249
- function en() {
3253
+ function tn() {
3250
3254
  var e = window;
3251
- return G([
3255
+ return W([
3252
3256
  "buildID" in navigator,
3253
3257
  "MozAppearance" in (document.documentElement?.style ?? {}),
3254
3258
  "onmozfullscreenchange" in e,
@@ -3257,36 +3261,36 @@ function en() {
3257
3261
  "CanvasCaptureMediaStream" in e
3258
3262
  ]) >= 4;
3259
3263
  }
3260
- function tn() {
3264
+ function nn() {
3261
3265
  var e = window;
3262
- return G([
3266
+ return W([
3263
3267
  !("MediaSettingsRange" in e),
3264
3268
  "RTCEncodedAudioFrame" in e,
3265
3269
  "" + e.Intl == "[object Intl]",
3266
3270
  "" + e.Reflect == "[object Reflect]"
3267
3271
  ]) >= 3;
3268
3272
  }
3269
- function nn() {
3273
+ function rn() {
3270
3274
  var e = window, t = e.URLPattern;
3271
- return G([
3275
+ return W([
3272
3276
  "union" in Set.prototype,
3273
3277
  "Iterator" in e,
3274
3278
  t && "hasRegExpGroups" in t.prototype,
3275
3279
  "RGB8" in WebGLRenderingContext.prototype
3276
3280
  ]) >= 3;
3277
3281
  }
3278
- function rn() {
3282
+ function an() {
3279
3283
  var e = window;
3280
- return G([
3284
+ return W([
3281
3285
  "DOMRectList" in e,
3282
3286
  "RTCPeerConnectionIceEvent" in e,
3283
3287
  "SVGGeometryElement" in e,
3284
3288
  "ontransitioncancel" in e
3285
3289
  ]) >= 3;
3286
3290
  }
3287
- function an() {
3291
+ function on() {
3288
3292
  var e = window, t = navigator, n = e.CSS, r = e.HTMLButtonElement;
3289
- return G([
3293
+ return W([
3290
3294
  !("getStorageUpdates" in t),
3291
3295
  r && "popover" in r.prototype,
3292
3296
  "CSSCounterStyleRule" in e,
@@ -3294,38 +3298,38 @@ function an() {
3294
3298
  n.supports("text-transform: full-width")
3295
3299
  ]) >= 4;
3296
3300
  }
3297
- function on() {
3301
+ function sn() {
3298
3302
  if (navigator.platform === "iPad") return !0;
3299
3303
  var e = screen, t = e.width / e.height;
3300
- return G([
3304
+ return W([
3301
3305
  "MediaSource" in window,
3302
3306
  !!Element.prototype.webkitRequestFullscreen,
3303
3307
  t > .65 && t < 1.53
3304
3308
  ]) >= 2;
3305
3309
  }
3306
- function sn() {
3310
+ function cn() {
3307
3311
  var e = document;
3308
3312
  return e.fullscreenElement || e.msFullscreenElement || e.mozFullScreenElement || e.webkitFullscreenElement || null;
3309
3313
  }
3310
- function cn() {
3314
+ function ln() {
3311
3315
  var e = document;
3312
3316
  return (e.exitFullscreen || e.msExitFullscreen || e.mozCancelFullScreen || e.webkitExitFullscreen).call(e);
3313
3317
  }
3314
- function ln() {
3315
- var e = Zt(), t = en(), n = window, r = navigator, i = "connection";
3316
- return e ? G([
3318
+ function un() {
3319
+ var e = Qt(), t = tn(), n = window, r = navigator, i = "connection";
3320
+ return e ? W([
3317
3321
  !("SharedWorker" in n),
3318
3322
  r[i] && "ontypechange" in r[i],
3319
3323
  !("sinkId" in new Audio())
3320
- ]) >= 2 : t ? G([
3324
+ ]) >= 2 : t ? W([
3321
3325
  "onorientationchange" in n,
3322
3326
  "orientation" in n,
3323
3327
  /android/i.test(r.appVersion)
3324
3328
  ]) >= 2 : !1;
3325
3329
  }
3326
- function un() {
3330
+ function dn() {
3327
3331
  var e = navigator, t = window, n = Audio.prototype, r = t.visualViewport;
3328
- return G([
3332
+ return W([
3329
3333
  "srLatency" in n,
3330
3334
  "srChannelCount" in n,
3331
3335
  "devicePosture" in e,
@@ -3333,19 +3337,19 @@ function un() {
3333
3337
  "getTextInformation" in Image.prototype
3334
3338
  ]) >= 3;
3335
3339
  }
3336
- function dn() {
3337
- return mn() ? -4 : fn();
3338
- }
3339
3340
  function fn() {
3341
+ return hn() ? -4 : pn();
3342
+ }
3343
+ function pn() {
3340
3344
  var e = window, t = e.OfflineAudioContext || e.webkitOfflineAudioContext;
3341
3345
  if (!t) return -2;
3342
- if (pn()) return -1;
3346
+ if (mn()) return -1;
3343
3347
  var n = 4500, r = new t(1, 5e3, 44100), i = r.createOscillator();
3344
3348
  i.type = "triangle", i.frequency.value = 1e4;
3345
3349
  var a = r.createDynamicsCompressor();
3346
3350
  a.threshold.value = -50, a.knee.value = 40, a.ratio.value = 12, a.attack.value = 0, a.release.value = .25, i.connect(a), a.connect(r.destination), i.start(0);
3347
- var o = hn(r), s = o[0], c = o[1], l = Dt(s.then(function(e) {
3348
- return gn(e.getChannelData(0).subarray(n));
3351
+ var o = gn(r), s = o[0], c = o[1], l = Ot(s.then(function(e) {
3352
+ return _n(e.getChannelData(0).subarray(n));
3349
3353
  }, function(e) {
3350
3354
  if (e.name === "timeout" || e.name === "suspended") return -3;
3351
3355
  throw e;
@@ -3354,13 +3358,13 @@ function fn() {
3354
3358
  return c(), l;
3355
3359
  };
3356
3360
  }
3357
- function pn() {
3358
- return X() && !Qt() && !rn();
3359
- }
3360
3361
  function mn() {
3361
- return X() && an() && $t() || Zt() && un() && nn();
3362
+ return Y() && !$t() && !an();
3363
+ }
3364
+ function hn() {
3365
+ return Y() && on() && en() || Qt() && dn() && rn();
3362
3366
  }
3363
- function hn(e) {
3367
+ function gn(e) {
3364
3368
  var t = 3, n = 500, r = 500, i = 5e3, a = function() {};
3365
3369
  return [new Promise(function(o, s) {
3366
3370
  var c = !1, l = 0, u = 0;
@@ -3369,17 +3373,17 @@ function hn(e) {
3369
3373
  };
3370
3374
  var d = function() {
3371
3375
  setTimeout(function() {
3372
- return s(_n("timeout"));
3376
+ return s(vn("timeout"));
3373
3377
  }, Math.min(r, u + i - Date.now()));
3374
3378
  }, f = function() {
3375
3379
  try {
3376
3380
  var r = e.startRendering();
3377
- switch (wt(r) && Dt(r), e.state) {
3381
+ switch (Tt(r) && Ot(r), e.state) {
3378
3382
  case "running":
3379
3383
  u = Date.now(), c && d();
3380
3384
  break;
3381
3385
  case "suspended":
3382
- document.hidden || l++, c && l >= t ? s(_n("suspended")) : setTimeout(f, n);
3386
+ document.hidden || l++, c && l >= t ? s(vn("suspended")) : setTimeout(f, n);
3383
3387
  break;
3384
3388
  }
3385
3389
  } catch (e) {
@@ -3391,22 +3395,22 @@ function hn(e) {
3391
3395
  };
3392
3396
  }), a];
3393
3397
  }
3394
- function gn(e) {
3398
+ function _n(e) {
3395
3399
  for (var t = 0, n = 0; n < e.length; ++n) t += Math.abs(e[n]);
3396
3400
  return t;
3397
3401
  }
3398
- function _n(e) {
3402
+ function vn(e) {
3399
3403
  var t = Error(e);
3400
3404
  return t.name = e, t;
3401
3405
  }
3402
- function vn(e, t, n) {
3406
+ function yn(e, t, n) {
3403
3407
  var r;
3404
- return n === void 0 && (n = 50), V(this, void 0, void 0, function() {
3408
+ return n === void 0 && (n = 50), B(this, void 0, void 0, function() {
3405
3409
  var i, a;
3406
- return H(this, function(o) {
3410
+ return V(this, function(o) {
3407
3411
  switch (o.label) {
3408
3412
  case 0: i = document, o.label = 1;
3409
- case 1: return i.body ? [3, 3] : [4, xt(n)];
3413
+ case 1: return i.body ? [3, 3] : [4, St(n)];
3410
3414
  case 2: return o.sent(), [3, 1];
3411
3415
  case 3: a = i.createElement("iframe"), o.label = 4;
3412
3416
  case 4: return o.trys.push([
@@ -3429,7 +3433,7 @@ function vn(e, t, n) {
3429
3433
  c();
3430
3434
  })];
3431
3435
  case 5: o.sent(), o.label = 6;
3432
- case 6: return a.contentWindow?.document?.body ? [3, 8] : [4, xt(n)];
3436
+ case 6: return a.contentWindow?.document?.body ? [3, 8] : [4, St(n)];
3433
3437
  case 7: return o.sent(), [3, 6];
3434
3438
  case 8: return [4, e(a, a.contentWindow)];
3435
3439
  case 9: return [2, o.sent()];
@@ -3439,14 +3443,14 @@ function vn(e, t, n) {
3439
3443
  });
3440
3444
  });
3441
3445
  }
3442
- function yn(e) {
3443
- for (var t = Mt(e), n = t[0], r = t[1], i = document.createElement(n ?? "div"), a = 0, o = Object.keys(r); a < o.length; a++) {
3446
+ function bn(e) {
3447
+ for (var t = Nt(e), n = t[0], r = t[1], i = document.createElement(n ?? "div"), a = 0, o = Object.keys(r); a < o.length; a++) {
3444
3448
  var s = o[a], c = r[s].join(" ");
3445
- s === "style" ? bn(i.style, c) : i.setAttribute(s, c);
3449
+ s === "style" ? xn(i.style, c) : i.setAttribute(s, c);
3446
3450
  }
3447
3451
  return i;
3448
3452
  }
3449
- function bn(e, t) {
3453
+ function xn(e, t) {
3450
3454
  for (var n = 0, r = t.split(";"); n < r.length; n++) {
3451
3455
  var i = r[n], a = /^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(i);
3452
3456
  if (a) {
@@ -3455,7 +3459,7 @@ function bn(e, t) {
3455
3459
  }
3456
3460
  }
3457
3461
  }
3458
- function xn() {
3462
+ function Sn() {
3459
3463
  for (var e = window;;) {
3460
3464
  var t = e.parent;
3461
3465
  if (!t || t === e) return !1;
@@ -3468,48 +3472,48 @@ function xn() {
3468
3472
  e = t;
3469
3473
  }
3470
3474
  }
3471
- var Sn = "mmMwWLliI0O&1", Cn = "48px", wn = [
3475
+ var Cn = "mmMwWLliI0O&1", wn = "48px", Tn = [
3472
3476
  "monospace",
3473
3477
  "sans-serif",
3474
3478
  "serif"
3475
- ], Tn = /* @__PURE__ */ "sans-serif-thin.ARNO PRO.Agency FB.Arabic Typesetting.Arial Unicode MS.AvantGarde Bk BT.BankGothic Md BT.Batang.Bitstream Vera Sans Mono.Calibri.Century.Century Gothic.Clarendon.EUROSTILE.Franklin Gothic.Futura Bk BT.Futura Md BT.GOTHAM.Gill Sans.HELV.Haettenschweiler.Helvetica Neue.Humanst521 BT.Leelawadee.Letter Gothic.Levenim MT.Lucida Bright.Lucida Sans.Menlo.MS Mincho.MS Outlook.MS Reference Specialty.MS UI Gothic.MT Extra.MYRIAD PRO.Marlett.Meiryo UI.Microsoft Uighur.Minion Pro.Monotype Corsiva.PMingLiU.Pristina.SCRIPTINA.Segoe UI Light.Serifa.SimHei.Small Fonts.Staccato222 BT.TRAJAN PRO.Univers CE 55 Medium.Vrinda.ZWAdobeF".split(".");
3476
- function En() {
3479
+ ], En = /* @__PURE__ */ "sans-serif-thin.ARNO PRO.Agency FB.Arabic Typesetting.Arial Unicode MS.AvantGarde Bk BT.BankGothic Md BT.Batang.Bitstream Vera Sans Mono.Calibri.Century.Century Gothic.Clarendon.EUROSTILE.Franklin Gothic.Futura Bk BT.Futura Md BT.GOTHAM.Gill Sans.HELV.Haettenschweiler.Helvetica Neue.Humanst521 BT.Leelawadee.Letter Gothic.Levenim MT.Lucida Bright.Lucida Sans.Menlo.MS Mincho.MS Outlook.MS Reference Specialty.MS UI Gothic.MT Extra.MYRIAD PRO.Marlett.Meiryo UI.Microsoft Uighur.Minion Pro.Monotype Corsiva.PMingLiU.Pristina.SCRIPTINA.Segoe UI Light.Serifa.SimHei.Small Fonts.Staccato222 BT.TRAJAN PRO.Univers CE 55 Medium.Vrinda.ZWAdobeF".split(".");
3480
+ function Dn() {
3477
3481
  var e = this;
3478
- return vn(function(t, n) {
3482
+ return yn(function(t, n) {
3479
3483
  var r = n.document;
3480
- return V(e, void 0, void 0, function() {
3484
+ return B(e, void 0, void 0, function() {
3481
3485
  var e, t, n, i, a, o, s, c, l, u, d, f;
3482
- return H(this, function(p) {
3483
- for (e = r.body, e.style.fontSize = Cn, t = r.createElement("div"), t.style.setProperty("visibility", "hidden", "important"), n = {}, i = {}, a = function(e) {
3486
+ return V(this, function(p) {
3487
+ for (e = r.body, e.style.fontSize = wn, t = r.createElement("div"), t.style.setProperty("visibility", "hidden", "important"), n = {}, i = {}, a = function(e) {
3484
3488
  var n = r.createElement("span"), i = n.style;
3485
- return i.position = "absolute", i.top = "0", i.left = "0", i.fontFamily = e, n.textContent = Sn, t.appendChild(n), n;
3489
+ return i.position = "absolute", i.top = "0", i.left = "0", i.fontFamily = e, n.textContent = Cn, t.appendChild(n), n;
3486
3490
  }, o = function(e, t) {
3487
3491
  return a(`'${e}',${t}`);
3488
3492
  }, s = function() {
3489
- return wn.map(a);
3493
+ return Tn.map(a);
3490
3494
  }, c = function() {
3491
3495
  for (var e = {}, t = function(t) {
3492
- e[t] = wn.map(function(e) {
3496
+ e[t] = Tn.map(function(e) {
3493
3497
  return o(t, e);
3494
3498
  });
3495
- }, n = 0, r = Tn; n < r.length; n++) {
3499
+ }, n = 0, r = En; n < r.length; n++) {
3496
3500
  var i = r[n];
3497
3501
  t(i);
3498
3502
  }
3499
3503
  return e;
3500
3504
  }, l = function(e) {
3501
- return wn.some(function(t, r) {
3505
+ return Tn.some(function(t, r) {
3502
3506
  return e[r].offsetWidth !== n[t] || e[r].offsetHeight !== i[t];
3503
3507
  });
3504
- }, u = s(), d = c(), e.appendChild(t), f = 0; f < wn.length; f++) n[wn[f]] = u[f].offsetWidth, i[wn[f]] = u[f].offsetHeight;
3505
- return [2, Tn.filter(function(e) {
3508
+ }, u = s(), d = c(), e.appendChild(t), f = 0; f < Tn.length; f++) n[Tn[f]] = u[f].offsetWidth, i[Tn[f]] = u[f].offsetHeight;
3509
+ return [2, En.filter(function(e) {
3506
3510
  return l(d[e]);
3507
3511
  })];
3508
3512
  });
3509
3513
  });
3510
3514
  });
3511
3515
  }
3512
- function Dn() {
3516
+ function On() {
3513
3517
  var e = navigator.plugins;
3514
3518
  if (e) {
3515
3519
  for (var t = [], n = 0; n < e.length; ++n) {
@@ -3532,38 +3536,38 @@ function Dn() {
3532
3536
  return t;
3533
3537
  }
3534
3538
  }
3535
- function On() {
3536
- return kn(Ln());
3539
+ function kn() {
3540
+ return An(Rn());
3537
3541
  }
3538
- function kn(e) {
3539
- var t, n = !1, r, i, a = An(), o = a[0], s = a[1];
3540
- return jn(o, s) ? (n = Mn(s), e ? r = i = "skipped" : (t = Nn(o, s), r = t[0], i = t[1])) : r = i = "unsupported", {
3542
+ function An(e) {
3543
+ var t, n = !1, r, i, a = jn(), o = a[0], s = a[1];
3544
+ return Mn(o, s) ? (n = Nn(s), e ? r = i = "skipped" : (t = Pn(o, s), r = t[0], i = t[1])) : r = i = "unsupported", {
3541
3545
  winding: n,
3542
3546
  geometry: r,
3543
3547
  text: i
3544
3548
  };
3545
3549
  }
3546
- function An() {
3550
+ function jn() {
3547
3551
  var e = document.createElement("canvas");
3548
3552
  return e.width = 1, e.height = 1, [e, e.getContext("2d")];
3549
3553
  }
3550
- function jn(e, t) {
3554
+ function Mn(e, t) {
3551
3555
  return !!(t && e.toDataURL);
3552
3556
  }
3553
- function Mn(e) {
3557
+ function Nn(e) {
3554
3558
  return e.rect(0, 0, 10, 10), e.rect(2, 2, 6, 6), !e.isPointInPath(5, 5, "evenodd");
3555
3559
  }
3556
- function Nn(e, t) {
3557
- Pn(e, t);
3558
- var n = In(e);
3559
- return n === In(e) ? (Fn(e, t), [In(e), n]) : ["unstable", "unstable"];
3560
- }
3561
3560
  function Pn(e, t) {
3561
+ Fn(e, t);
3562
+ var n = Ln(e);
3563
+ return n === Ln(e) ? (In(e, t), [Ln(e), n]) : ["unstable", "unstable"];
3564
+ }
3565
+ function Fn(e, t) {
3562
3566
  e.width = 240, e.height = 60, t.textBaseline = "alphabetic", t.fillStyle = "#f60", t.fillRect(100, 1, 62, 20), t.fillStyle = "#069", t.font = "11pt \"Times New Roman\"";
3563
3567
  var n = `Cwm fjordbank gly ${String.fromCharCode(55357, 56835)}`;
3564
3568
  t.fillText(n, 2, 15), t.fillStyle = "rgba(102, 204, 0, 0.2)", t.font = "18pt Arial", t.fillText(n, 4, 45);
3565
3569
  }
3566
- function Fn(e, t) {
3570
+ function In(e, t) {
3567
3571
  e.width = 122, e.height = 110, t.globalCompositeOperation = "multiply";
3568
3572
  for (var n = 0, r = [
3569
3573
  [
@@ -3587,15 +3591,15 @@ function Fn(e, t) {
3587
3591
  }
3588
3592
  t.fillStyle = "#f9c", t.arc(60, 60, 60, 0, Math.PI * 2, !0), t.arc(60, 60, 20, 0, Math.PI * 2, !0), t.fill("evenodd");
3589
3593
  }
3590
- function In(e) {
3594
+ function Ln(e) {
3591
3595
  return e.toDataURL();
3592
3596
  }
3593
- function Ln() {
3594
- return X() && an() && $t();
3595
- }
3596
3597
  function Rn() {
3598
+ return Y() && on() && en();
3599
+ }
3600
+ function zn() {
3597
3601
  var e = navigator, t = 0, n;
3598
- e.maxTouchPoints === void 0 ? e.msMaxTouchPoints !== void 0 && (t = e.msMaxTouchPoints) : t = At(e.maxTouchPoints);
3602
+ e.maxTouchPoints === void 0 ? e.msMaxTouchPoints !== void 0 && (t = e.msMaxTouchPoints) : t = jt(e.maxTouchPoints);
3599
3603
  try {
3600
3604
  document.createEvent("TouchEvent"), n = !0;
3601
3605
  } catch {
@@ -3608,72 +3612,72 @@ function Rn() {
3608
3612
  touchStart: r
3609
3613
  };
3610
3614
  }
3611
- function zn() {
3615
+ function Bn() {
3612
3616
  return navigator.oscpu;
3613
3617
  }
3614
- function Bn() {
3618
+ function Vn() {
3615
3619
  var e = navigator, t = [], n = e.language || e.userLanguage || e.browserLanguage || e.systemLanguage;
3616
- if (n !== void 0 && t.push([n]), Array.isArray(e.languages)) Zt() && tn() || t.push(e.languages);
3620
+ if (n !== void 0 && t.push([n]), Array.isArray(e.languages)) Qt() && nn() || t.push(e.languages);
3617
3621
  else if (typeof e.languages == "string") {
3618
3622
  var r = e.languages;
3619
3623
  r && t.push(r.split(","));
3620
3624
  }
3621
3625
  return t;
3622
3626
  }
3623
- function Vn() {
3624
- return window.screen.colorDepth;
3625
- }
3626
3627
  function Hn() {
3627
- return W(U(navigator.deviceMemory), void 0);
3628
+ return window.screen.colorDepth;
3628
3629
  }
3629
3630
  function Un() {
3630
- if (!(X() && an() && $t())) return Wn();
3631
+ return U(H(navigator.deviceMemory), void 0);
3631
3632
  }
3632
3633
  function Wn() {
3634
+ if (!(Y() && on() && en())) return Gn();
3635
+ }
3636
+ function Gn() {
3633
3637
  var e = screen, t = function(e) {
3634
- return W(At(e), null);
3638
+ return U(jt(e), null);
3635
3639
  }, n = [t(e.width), t(e.height)];
3636
3640
  return n.sort().reverse(), n;
3637
3641
  }
3638
- var Gn = 2500, Kn = 10, qn, Jn;
3639
- function Yn() {
3640
- if (Jn === void 0) {
3642
+ var Kn = 2500, qn = 10, Jn, Yn;
3643
+ function Xn() {
3644
+ if (Yn === void 0) {
3641
3645
  var e = function() {
3642
- var t = Qn();
3643
- $n(t) ? Jn = setTimeout(e, Gn) : (qn = t, Jn = void 0);
3646
+ var t = $n();
3647
+ er(t) ? Yn = setTimeout(e, Kn) : (Jn = t, Yn = void 0);
3644
3648
  };
3645
3649
  e();
3646
3650
  }
3647
3651
  }
3648
- function Xn() {
3652
+ function Zn() {
3649
3653
  var e = this;
3650
- return Yn(), function() {
3651
- return V(e, void 0, void 0, function() {
3654
+ return Xn(), function() {
3655
+ return B(e, void 0, void 0, function() {
3652
3656
  var e;
3653
- return H(this, function(t) {
3657
+ return V(this, function(t) {
3654
3658
  switch (t.label) {
3655
- case 0: return e = Qn(), $n(e) ? qn ? [2, yt([], qn, !0)] : sn() ? [4, cn()] : [3, 2] : [3, 2];
3656
- case 1: t.sent(), e = Qn(), t.label = 2;
3657
- case 2: return $n(e) || (qn = e), [2, e];
3659
+ case 0: return e = $n(), er(e) ? Jn ? [2, bt([], Jn, !0)] : cn() ? [4, ln()] : [3, 2] : [3, 2];
3660
+ case 1: t.sent(), e = $n(), t.label = 2;
3661
+ case 2: return er(e) || (Jn = e), [2, e];
3658
3662
  }
3659
3663
  });
3660
3664
  });
3661
3665
  };
3662
3666
  }
3663
- function Zn() {
3667
+ function Qn() {
3664
3668
  var e = this;
3665
- if (X() && an() && $t()) return function() {
3669
+ if (Y() && on() && en()) return function() {
3666
3670
  return Promise.resolve(void 0);
3667
3671
  };
3668
- var t = Xn();
3672
+ var t = Zn();
3669
3673
  return function() {
3670
- return V(e, void 0, void 0, function() {
3674
+ return B(e, void 0, void 0, function() {
3671
3675
  var e, n;
3672
- return H(this, function(r) {
3676
+ return V(this, function(r) {
3673
3677
  switch (r.label) {
3674
3678
  case 0: return [4, t()];
3675
3679
  case 1: return e = r.sent(), n = function(e) {
3676
- return e === null ? null : jt(e, Kn);
3680
+ return e === null ? null : Mt(e, qn);
3677
3681
  }, [2, [
3678
3682
  n(e[0]),
3679
3683
  n(e[1]),
@@ -3685,70 +3689,70 @@ function Zn() {
3685
3689
  });
3686
3690
  };
3687
3691
  }
3688
- function Qn() {
3692
+ function $n() {
3689
3693
  var e = screen;
3690
3694
  return [
3691
- W(U(e.availTop), null),
3692
- W(U(e.width) - U(e.availWidth) - W(U(e.availLeft), 0), null),
3693
- W(U(e.height) - U(e.availHeight) - W(U(e.availTop), 0), null),
3694
- W(U(e.availLeft), null)
3695
+ U(H(e.availTop), null),
3696
+ U(H(e.width) - H(e.availWidth) - U(H(e.availLeft), 0), null),
3697
+ U(H(e.height) - H(e.availHeight) - U(H(e.availTop), 0), null),
3698
+ U(H(e.availLeft), null)
3695
3699
  ];
3696
3700
  }
3697
- function $n(e) {
3701
+ function er(e) {
3698
3702
  for (var t = 0; t < 4; ++t) if (e[t]) return !1;
3699
3703
  return !0;
3700
3704
  }
3701
- function er() {
3702
- return W(At(navigator.hardwareConcurrency), void 0);
3703
- }
3704
3705
  function tr() {
3706
+ return U(jt(navigator.hardwareConcurrency), void 0);
3707
+ }
3708
+ function nr() {
3705
3709
  var e = window.Intl?.DateTimeFormat;
3706
3710
  if (e) {
3707
3711
  var t = new e().resolvedOptions().timeZone;
3708
3712
  if (t) return t;
3709
3713
  }
3710
- var n = -nr();
3714
+ var n = -rr();
3711
3715
  return `UTC${n >= 0 ? "+" : ""}${n}`;
3712
3716
  }
3713
- function nr() {
3717
+ function rr() {
3714
3718
  var e = (/* @__PURE__ */ new Date()).getFullYear();
3715
- return Math.max(U(new Date(e, 0, 1).getTimezoneOffset()), U(new Date(e, 6, 1).getTimezoneOffset()));
3719
+ return Math.max(H(new Date(e, 0, 1).getTimezoneOffset()), H(new Date(e, 6, 1).getTimezoneOffset()));
3716
3720
  }
3717
- function rr() {
3721
+ function ir() {
3718
3722
  try {
3719
3723
  return !!window.sessionStorage;
3720
3724
  } catch {
3721
3725
  return !0;
3722
3726
  }
3723
3727
  }
3724
- function ir() {
3728
+ function ar() {
3725
3729
  try {
3726
3730
  return !!window.localStorage;
3727
3731
  } catch {
3728
3732
  return !0;
3729
3733
  }
3730
3734
  }
3731
- function ar() {
3732
- if (!(Yt() || Xt())) try {
3735
+ function or() {
3736
+ if (!(Xt() || Zt())) try {
3733
3737
  return !!window.indexedDB;
3734
3738
  } catch {
3735
3739
  return !0;
3736
3740
  }
3737
3741
  }
3738
- function or() {
3742
+ function sr() {
3739
3743
  return !!window.openDatabase;
3740
3744
  }
3741
- function sr() {
3745
+ function cr() {
3742
3746
  return navigator.cpuClass;
3743
3747
  }
3744
- function cr() {
3748
+ function lr() {
3745
3749
  var e = navigator.platform;
3746
- return e === "MacIntel" && X() && !Qt() ? on() ? "iPad" : "iPhone" : e;
3750
+ return e === "MacIntel" && Y() && !$t() ? sn() ? "iPad" : "iPhone" : e;
3747
3751
  }
3748
- function lr() {
3752
+ function ur() {
3749
3753
  return navigator.vendor || "";
3750
3754
  }
3751
- function ur() {
3755
+ function dr() {
3752
3756
  for (var e = [], t = 0, n = [
3753
3757
  "chrome",
3754
3758
  "safari",
@@ -3771,7 +3775,7 @@ function ur() {
3771
3775
  }
3772
3776
  return e.sort();
3773
3777
  }
3774
- function dr() {
3778
+ function fr() {
3775
3779
  var e = document;
3776
3780
  try {
3777
3781
  e.cookie = "cookietest=1; SameSite=Strict;";
@@ -3781,7 +3785,7 @@ function dr() {
3781
3785
  return !1;
3782
3786
  }
3783
3787
  }
3784
- function fr() {
3788
+ function pr() {
3785
3789
  var e = atob;
3786
3790
  return {
3787
3791
  abpIndo: [
@@ -4070,18 +4074,18 @@ function fr() {
4070
4074
  ]
4071
4075
  };
4072
4076
  }
4073
- function pr(e) {
4077
+ function mr(e) {
4074
4078
  var t = (e === void 0 ? {} : e).debug;
4075
- return V(this, void 0, void 0, function() {
4079
+ return B(this, void 0, void 0, function() {
4076
4080
  var e, n, r, i, a, o;
4077
- return H(this, function(s) {
4081
+ return V(this, function(s) {
4078
4082
  switch (s.label) {
4079
- case 0: return mr() ? (e = fr(), n = Object.keys(e), r = (o = []).concat.apply(o, n.map(function(t) {
4083
+ case 0: return hr() ? (e = pr(), n = Object.keys(e), r = (o = []).concat.apply(o, n.map(function(t) {
4080
4084
  return e[t];
4081
- })), [4, hr(r)]) : [2, void 0];
4082
- case 1: return i = s.sent(), t && _r(e, i), a = n.filter(function(t) {
4085
+ })), [4, gr(r)]) : [2, void 0];
4086
+ case 1: return i = s.sent(), t && vr(e, i), a = n.filter(function(t) {
4083
4087
  var n = e[t];
4084
- return G(n.map(function(e) {
4088
+ return W(n.map(function(e) {
4085
4089
  return i[e];
4086
4090
  })) > n.length * .6;
4087
4091
  }), a.sort(), [2, a];
@@ -4089,19 +4093,19 @@ function pr(e) {
4089
4093
  });
4090
4094
  });
4091
4095
  }
4092
- function mr() {
4093
- return X() || ln();
4096
+ function hr() {
4097
+ return Y() || un();
4094
4098
  }
4095
- function hr(e) {
4099
+ function gr(e) {
4096
4100
  var t;
4097
- return V(this, void 0, void 0, function() {
4101
+ return B(this, void 0, void 0, function() {
4098
4102
  var n, r, i, a, o, s, c, o;
4099
- return H(this, function(l) {
4103
+ return V(this, function(l) {
4100
4104
  switch (l.label) {
4101
4105
  case 0:
4102
- for (n = document, r = n.createElement("div"), i = Array(e.length), a = {}, gr(r), o = 0; o < e.length; ++o) s = yn(e[o]), s.tagName === "DIALOG" && s.show(), c = n.createElement("div"), gr(c), c.appendChild(s), r.appendChild(c), i[o] = s;
4106
+ for (n = document, r = n.createElement("div"), i = Array(e.length), a = {}, _r(r), o = 0; o < e.length; ++o) s = bn(e[o]), s.tagName === "DIALOG" && s.show(), c = n.createElement("div"), _r(c), c.appendChild(s), r.appendChild(c), i[o] = s;
4103
4107
  l.label = 1;
4104
- case 1: return n.body ? [3, 3] : [4, xt(50)];
4108
+ case 1: return n.body ? [3, 3] : [4, St(50)];
4105
4109
  case 2: return l.sent(), [3, 1];
4106
4110
  case 3:
4107
4111
  n.body.appendChild(r);
@@ -4115,10 +4119,10 @@ function hr(e) {
4115
4119
  });
4116
4120
  });
4117
4121
  }
4118
- function gr(e) {
4122
+ function _r(e) {
4119
4123
  e.style.setProperty("visibility", "hidden", "important"), e.style.setProperty("display", "block", "important");
4120
4124
  }
4121
- function _r(e, t) {
4125
+ function vr(e, t) {
4122
4126
  for (var n = "DOM blockers debug:\n```", r = 0, i = Object.keys(e); r < i.length; r++) {
4123
4127
  var a = i[r];
4124
4128
  n += `
@@ -4130,7 +4134,7 @@ ${a}:`;
4130
4134
  }
4131
4135
  }
4132
4136
  }
4133
- function vr() {
4137
+ function yr() {
4134
4138
  for (var e = 0, t = [
4135
4139
  "rec2020",
4136
4140
  "p3",
@@ -4140,108 +4144,108 @@ function vr() {
4140
4144
  if (matchMedia(`(color-gamut: ${n})`).matches) return n;
4141
4145
  }
4142
4146
  }
4143
- function yr() {
4144
- if (br("inverted")) return !0;
4145
- if (br("none")) return !1;
4147
+ function br() {
4148
+ if (xr("inverted")) return !0;
4149
+ if (xr("none")) return !1;
4146
4150
  }
4147
- function br(e) {
4151
+ function xr(e) {
4148
4152
  return matchMedia(`(inverted-colors: ${e})`).matches;
4149
4153
  }
4150
- function xr() {
4151
- if (Sr("active")) return !0;
4152
- if (Sr("none")) return !1;
4154
+ function Sr() {
4155
+ if (Cr("active")) return !0;
4156
+ if (Cr("none")) return !1;
4153
4157
  }
4154
- function Sr(e) {
4158
+ function Cr(e) {
4155
4159
  return matchMedia(`(forced-colors: ${e})`).matches;
4156
4160
  }
4157
- var Cr = 100;
4158
- function wr() {
4161
+ var wr = 100;
4162
+ function Tr() {
4159
4163
  if (matchMedia("(min-monochrome: 0)").matches) {
4160
- for (var e = 0; e <= Cr; ++e) if (matchMedia(`(max-monochrome: ${e})`).matches) return e;
4164
+ for (var e = 0; e <= wr; ++e) if (matchMedia(`(max-monochrome: ${e})`).matches) return e;
4161
4165
  throw Error("Too high value");
4162
4166
  }
4163
4167
  }
4164
- function Tr() {
4165
- if (Er("no-preference")) return 0;
4166
- if (Er("high") || Er("more")) return 1;
4167
- if (Er("low") || Er("less")) return -1;
4168
- if (Er("forced")) return 10;
4168
+ function Er() {
4169
+ if (Dr("no-preference")) return 0;
4170
+ if (Dr("high") || Dr("more")) return 1;
4171
+ if (Dr("low") || Dr("less")) return -1;
4172
+ if (Dr("forced")) return 10;
4169
4173
  }
4170
- function Er(e) {
4174
+ function Dr(e) {
4171
4175
  return matchMedia(`(prefers-contrast: ${e})`).matches;
4172
4176
  }
4173
- function Dr() {
4174
- if (Or("reduce")) return !0;
4175
- if (Or("no-preference")) return !1;
4177
+ function Or() {
4178
+ if (kr("reduce")) return !0;
4179
+ if (kr("no-preference")) return !1;
4176
4180
  }
4177
- function Or(e) {
4181
+ function kr(e) {
4178
4182
  return matchMedia(`(prefers-reduced-motion: ${e})`).matches;
4179
4183
  }
4180
- function kr() {
4181
- if (Ar("reduce")) return !0;
4182
- if (Ar("no-preference")) return !1;
4184
+ function Ar() {
4185
+ if (jr("reduce")) return !0;
4186
+ if (jr("no-preference")) return !1;
4183
4187
  }
4184
- function Ar(e) {
4188
+ function jr(e) {
4185
4189
  return matchMedia(`(prefers-reduced-transparency: ${e})`).matches;
4186
4190
  }
4187
- function jr() {
4188
- if (Mr("high")) return !0;
4189
- if (Mr("standard")) return !1;
4191
+ function Mr() {
4192
+ if (Nr("high")) return !0;
4193
+ if (Nr("standard")) return !1;
4190
4194
  }
4191
- function Mr(e) {
4195
+ function Nr(e) {
4192
4196
  return matchMedia(`(dynamic-range: ${e})`).matches;
4193
4197
  }
4194
- var Z = Math, Q = function() {
4198
+ var X = Math, Z = function() {
4195
4199
  return 0;
4196
4200
  };
4197
- function Nr() {
4198
- var e = Z.acos || Q, t = Z.acosh || Q, n = Z.asin || Q, r = Z.asinh || Q, i = Z.atanh || Q, a = Z.atan || Q, o = Z.sin || Q, s = Z.sinh || Q, c = Z.cos || Q, l = Z.cosh || Q, u = Z.tan || Q, d = Z.tanh || Q, f = Z.exp || Q, p = Z.expm1 || Q, m = Z.log1p || Q;
4201
+ function Pr() {
4202
+ var e = X.acos || Z, t = X.acosh || Z, n = X.asin || Z, r = X.asinh || Z, i = X.atanh || Z, a = X.atan || Z, o = X.sin || Z, s = X.sinh || Z, c = X.cos || Z, l = X.cosh || Z, u = X.tan || Z, d = X.tanh || Z, f = X.exp || Z, p = X.expm1 || Z, m = X.log1p || Z;
4199
4203
  return {
4200
4204
  acos: e(.12312423423423424),
4201
4205
  acosh: t(1e308),
4202
4206
  acoshPf: function(e) {
4203
- return Z.log(e + Z.sqrt(e * e - 1));
4207
+ return X.log(e + X.sqrt(e * e - 1));
4204
4208
  }(1e154),
4205
4209
  asin: n(.12312423423423424),
4206
4210
  asinh: r(1),
4207
4211
  asinhPf: function(e) {
4208
- return Z.log(e + Z.sqrt(e * e + 1));
4212
+ return X.log(e + X.sqrt(e * e + 1));
4209
4213
  }(1),
4210
4214
  atanh: i(.5),
4211
4215
  atanhPf: function(e) {
4212
- return Z.log((1 + e) / (1 - e)) / 2;
4216
+ return X.log((1 + e) / (1 - e)) / 2;
4213
4217
  }(.5),
4214
4218
  atan: a(.5),
4215
4219
  sin: o(-1e300),
4216
4220
  sinh: s(1),
4217
4221
  sinhPf: function(e) {
4218
- return Z.exp(e) - 1 / Z.exp(e) / 2;
4222
+ return X.exp(e) - 1 / X.exp(e) / 2;
4219
4223
  }(1),
4220
4224
  cos: c(10.000000000123),
4221
4225
  cosh: l(1),
4222
4226
  coshPf: function(e) {
4223
- return (Z.exp(e) + 1 / Z.exp(e)) / 2;
4227
+ return (X.exp(e) + 1 / X.exp(e)) / 2;
4224
4228
  }(1),
4225
4229
  tan: u(-1e300),
4226
4230
  tanh: d(1),
4227
4231
  tanhPf: function(e) {
4228
- return (Z.exp(2 * e) - 1) / (Z.exp(2 * e) + 1);
4232
+ return (X.exp(2 * e) - 1) / (X.exp(2 * e) + 1);
4229
4233
  }(1),
4230
4234
  exp: f(1),
4231
4235
  expm1: p(1),
4232
4236
  expm1Pf: function(e) {
4233
- return Z.exp(e) - 1;
4237
+ return X.exp(e) - 1;
4234
4238
  }(1),
4235
4239
  log1p: m(10),
4236
4240
  log1pPf: function(e) {
4237
- return Z.log(1 + e);
4241
+ return X.log(1 + e);
4238
4242
  }(10),
4239
4243
  powPI: function(e) {
4240
- return Z.pow(Z.PI, e);
4244
+ return X.pow(X.PI, e);
4241
4245
  }(-100)
4242
4246
  };
4243
4247
  }
4244
- var Pr = "mmMwWLliI0fiflO&1", Fr = {
4248
+ var Fr = "mmMwWLliI0fiflO&1", Ir = {
4245
4249
  default: [],
4246
4250
  apple: [{ font: "-apple-system-body" }],
4247
4251
  serif: [{ fontFamily: "serif" }],
@@ -4250,10 +4254,10 @@ var Pr = "mmMwWLliI0fiflO&1", Fr = {
4250
4254
  min: [{ fontSize: "1px" }],
4251
4255
  system: [{ fontFamily: "system-ui" }]
4252
4256
  };
4253
- function Ir() {
4254
- return Lr(function(e, t) {
4255
- for (var n = {}, r = {}, i = 0, a = Object.keys(Fr); i < a.length; i++) {
4256
- var o = a[i], s = Fr[o], c = s[0], l = c === void 0 ? {} : c, u = s[1], d = u === void 0 ? Pr : u, f = e.createElement("span");
4257
+ function Lr() {
4258
+ return Rr(function(e, t) {
4259
+ for (var n = {}, r = {}, i = 0, a = Object.keys(Ir); i < a.length; i++) {
4260
+ var o = a[i], s = Ir[o], c = s[0], l = c === void 0 ? {} : c, u = s[1], d = u === void 0 ? Fr : u, f = e.createElement("span");
4257
4261
  f.textContent = d, f.style.whiteSpace = "nowrap";
4258
4262
  for (var p = 0, m = Object.keys(l); p < m.length; p++) {
4259
4263
  var h = m[p], g = l[h];
@@ -4261,50 +4265,50 @@ function Ir() {
4261
4265
  }
4262
4266
  n[o] = f, t.append(e.createElement("br"), f);
4263
4267
  }
4264
- for (var _ = 0, v = Object.keys(Fr); _ < v.length; _++) {
4268
+ for (var _ = 0, v = Object.keys(Ir); _ < v.length; _++) {
4265
4269
  var o = v[_];
4266
4270
  r[o] = n[o].getBoundingClientRect().width;
4267
4271
  }
4268
4272
  return r;
4269
4273
  });
4270
4274
  }
4271
- function Lr(e, t) {
4272
- return t === void 0 && (t = 4e3), vn(function(n, r) {
4275
+ function Rr(e, t) {
4276
+ return t === void 0 && (t = 4e3), yn(function(n, r) {
4273
4277
  var i = r.document, a = i.body, o = a.style;
4274
- o.width = `${t}px`, o.webkitTextSizeAdjust = o.textSizeAdjust = "none", Zt() ? a.style.zoom = `${1 / r.devicePixelRatio}` : X() && (a.style.zoom = "reset");
4278
+ o.width = `${t}px`, o.webkitTextSizeAdjust = o.textSizeAdjust = "none", Qt() ? a.style.zoom = `${1 / r.devicePixelRatio}` : Y() && (a.style.zoom = "reset");
4275
4279
  var s = i.createElement("div");
4276
- return s.textContent = yt([], Array(t / 20 << 0), !0).map(function() {
4280
+ return s.textContent = bt([], Array(t / 20 << 0), !0).map(function() {
4277
4281
  return "word";
4278
4282
  }).join(" "), a.appendChild(s), e(i, a);
4279
4283
  }, "<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">");
4280
4284
  }
4281
- function Rr() {
4285
+ function zr() {
4282
4286
  return navigator.pdfViewerEnabled;
4283
4287
  }
4284
- function zr() {
4288
+ function Br() {
4285
4289
  var e = new Float32Array(1), t = new Uint8Array(e.buffer);
4286
4290
  return e[0] = Infinity, e[0] -= e[0], t[3];
4287
4291
  }
4288
- function Br() {
4292
+ function Vr() {
4289
4293
  var e = window.ApplePaySession;
4290
4294
  if (typeof e?.canMakePayments != "function") return -1;
4291
- if (Vr()) return -3;
4295
+ if (Hr()) return -3;
4292
4296
  try {
4293
4297
  return +!!e.canMakePayments();
4294
4298
  } catch (e) {
4295
- return Hr(e);
4299
+ return Ur(e);
4296
4300
  }
4297
4301
  }
4298
- var Vr = xn;
4299
- function Hr(e) {
4302
+ var Hr = Sn;
4303
+ function Ur(e) {
4300
4304
  if (e instanceof Error && e.name === "InvalidAccessError" && /\bfrom\b.*\binsecure\b/i.test(e.message)) return -2;
4301
4305
  throw e;
4302
4306
  }
4303
- function Ur() {
4307
+ function Wr() {
4304
4308
  var e = document.createElement("a"), t = e.attributionSourceId ?? e.attributionsourceid;
4305
4309
  return t === void 0 ? void 0 : String(t);
4306
4310
  }
4307
- var Wr = -1, Gr = -2, Kr = new Set([
4311
+ var Gr = -1, Kr = -2, qr = new Set([
4308
4312
  10752,
4309
4313
  2849,
4310
4314
  2884,
@@ -4386,7 +4390,7 @@ var Wr = -1, Gr = -2, Kr = new Set([
4386
4390
  7936,
4387
4391
  7937,
4388
4392
  7938
4389
- ]), qr = new Set([
4393
+ ]), Jr = new Set([
4390
4394
  34047,
4391
4395
  35723,
4392
4396
  36063,
@@ -4397,19 +4401,19 @@ var Wr = -1, Gr = -2, Kr = new Set([
4397
4401
  36392,
4398
4402
  36795,
4399
4403
  38449
4400
- ]), Jr = ["FRAGMENT_SHADER", "VERTEX_SHADER"], Yr = [
4404
+ ]), Yr = ["FRAGMENT_SHADER", "VERTEX_SHADER"], Xr = [
4401
4405
  "LOW_FLOAT",
4402
4406
  "MEDIUM_FLOAT",
4403
4407
  "HIGH_FLOAT",
4404
4408
  "LOW_INT",
4405
4409
  "MEDIUM_INT",
4406
4410
  "HIGH_INT"
4407
- ], Xr = "WEBGL_debug_renderer_info", Zr = "WEBGL_polygon_mode";
4408
- function Qr(e) {
4409
- var t = e.cache, n = ei(t);
4410
- if (!n) return Wr;
4411
- if (!oi(n)) return Gr;
4412
- var r = ii() ? null : n.getExtension(Xr);
4411
+ ], Zr = "WEBGL_debug_renderer_info", Qr = "WEBGL_polygon_mode";
4412
+ function $r(e) {
4413
+ var t = e.cache, n = ti(t);
4414
+ if (!n) return Gr;
4415
+ if (!si(n)) return Kr;
4416
+ var r = ai() ? null : n.getExtension(Zr);
4413
4417
  return {
4414
4418
  version: n.getParameter(n.VERSION)?.toString() || "",
4415
4419
  vendor: n.getParameter(n.VENDOR)?.toString() || "",
@@ -4419,35 +4423,35 @@ function Qr(e) {
4419
4423
  shadingLanguageVersion: n.getParameter(n.SHADING_LANGUAGE_VERSION)?.toString() || ""
4420
4424
  };
4421
4425
  }
4422
- function $r(e) {
4423
- var t = e.cache, n = ei(t);
4424
- if (!n) return Wr;
4425
- if (!oi(n)) return Gr;
4426
+ function ei(e) {
4427
+ var t = e.cache, n = ti(t);
4428
+ if (!n) return Gr;
4429
+ if (!si(n)) return Kr;
4426
4430
  var r = n.getSupportedExtensions(), i = n.getContextAttributes(), a = [], o = [], s = [], c = [], l = [];
4427
4431
  if (i) for (var u = 0, d = Object.keys(i); u < d.length; u++) {
4428
4432
  var f = d[u];
4429
4433
  o.push(`${f}=${i[f]}`);
4430
4434
  }
4431
- for (var p = ni(n), m = 0, h = p; m < h.length; m++) {
4435
+ for (var p = ri(n), m = 0, h = p; m < h.length; m++) {
4432
4436
  var g = h[m], _ = n[g];
4433
- s.push(`${g}=${_}${Kr.has(_) ? `=${n.getParameter(_)}` : ""}`);
4437
+ s.push(`${g}=${_}${qr.has(_) ? `=${n.getParameter(_)}` : ""}`);
4434
4438
  }
4435
4439
  if (r) for (var v = 0, y = r; v < y.length; v++) {
4436
4440
  var b = y[v];
4437
- if (!(b === Xr && ii() || b === Zr && ai())) {
4441
+ if (!(b === Zr && ai() || b === Qr && oi())) {
4438
4442
  var x = n.getExtension(b);
4439
4443
  if (!x) {
4440
4444
  a.push(b);
4441
4445
  continue;
4442
4446
  }
4443
- for (var S = 0, C = ni(x); S < C.length; S++) {
4447
+ for (var S = 0, C = ri(x); S < C.length; S++) {
4444
4448
  var g = C[S], _ = x[g];
4445
- c.push(`${g}=${_}${qr.has(_) ? `=${n.getParameter(_)}` : ""}`);
4449
+ c.push(`${g}=${_}${Jr.has(_) ? `=${n.getParameter(_)}` : ""}`);
4446
4450
  }
4447
4451
  }
4448
4452
  }
4449
- for (var w = 0, T = Jr; w < T.length; w++) for (var E = T[w], D = 0, O = Yr; D < O.length; D++) {
4450
- var k = O[D], A = ti(n, E, k);
4453
+ for (var w = 0, T = Yr; w < T.length; w++) for (var E = T[w], D = 0, O = Xr; D < O.length; D++) {
4454
+ var k = O[D], A = ni(n, E, k);
4451
4455
  l.push(`${E}.${k}=${A.join(",")}`);
4452
4456
  }
4453
4457
  return c.sort(), s.sort(), {
@@ -4459,7 +4463,7 @@ function $r(e) {
4459
4463
  unsupportedExtensions: a
4460
4464
  };
4461
4465
  }
4462
- function ei(e) {
4466
+ function ti(e) {
4463
4467
  if (e.webgl) return e.webgl.context;
4464
4468
  var t = document.createElement("canvas"), n;
4465
4469
  t.addEventListener("webglCreateContextError", function() {
@@ -4474,7 +4478,7 @@ function ei(e) {
4474
4478
  }
4475
4479
  return e.webgl = { context: n }, n;
4476
4480
  }
4477
- function ti(e, t, n) {
4481
+ function ni(e, t, n) {
4478
4482
  var r = e.getShaderPrecisionFormat(e[t], e[n]);
4479
4483
  return r ? [
4480
4484
  r.rangeMin,
@@ -4482,188 +4486,228 @@ function ti(e, t, n) {
4482
4486
  r.precision
4483
4487
  ] : [];
4484
4488
  }
4485
- function ni(e) {
4486
- return Object.keys(e.__proto__).filter(ri);
4487
- }
4488
4489
  function ri(e) {
4489
- return typeof e == "string" && !e.match(/[^A-Z0-9_x]/);
4490
+ return Object.keys(e.__proto__).filter(ii);
4490
4491
  }
4491
- function ii() {
4492
- return en();
4492
+ function ii(e) {
4493
+ return typeof e == "string" && !e.match(/[^A-Z0-9_x]/);
4493
4494
  }
4494
4495
  function ai() {
4495
- return Zt() || X();
4496
+ return tn();
4497
+ }
4498
+ function oi() {
4499
+ return Qt() || Y();
4496
4500
  }
4497
- function oi(e) {
4501
+ function si(e) {
4498
4502
  return typeof e.getParameter == "function";
4499
4503
  }
4500
- function si() {
4501
- if (!(ln() || X())) return -2;
4504
+ function ci() {
4505
+ if (!(un() || Y())) return -2;
4502
4506
  if (!window.AudioContext) return -1;
4503
4507
  var e = new AudioContext().baseLatency;
4504
4508
  return e == null ? -1 : isFinite(e) ? e : -3;
4505
4509
  }
4506
- function ci() {
4510
+ function li() {
4507
4511
  if (!window.Intl) return -1;
4508
4512
  var e = window.Intl.DateTimeFormat;
4509
4513
  if (!e) return -2;
4510
4514
  var t = e().resolvedOptions().locale;
4511
4515
  return !t && t !== "" ? -3 : t;
4512
4516
  }
4513
- var li = {
4514
- fonts: En,
4515
- domBlockers: pr,
4516
- fontPreferences: Ir,
4517
- audio: dn,
4518
- screenFrame: Zn,
4519
- canvas: On,
4520
- osCpu: zn,
4521
- languages: Bn,
4522
- colorDepth: Vn,
4523
- deviceMemory: Hn,
4524
- screenResolution: Un,
4525
- hardwareConcurrency: er,
4526
- timezone: tr,
4527
- sessionStorage: rr,
4528
- localStorage: ir,
4529
- indexedDB: ar,
4530
- openDatabase: or,
4531
- cpuClass: sr,
4532
- platform: cr,
4533
- plugins: Dn,
4534
- touchSupport: Rn,
4535
- vendor: lr,
4536
- vendorFlavors: ur,
4537
- cookiesEnabled: dr,
4538
- colorGamut: vr,
4539
- invertedColors: yr,
4540
- forcedColors: xr,
4541
- monochrome: wr,
4542
- contrast: Tr,
4543
- reducedMotion: Dr,
4544
- reducedTransparency: kr,
4545
- hdr: jr,
4546
- math: Nr,
4547
- pdfViewerEnabled: Rr,
4548
- architecture: zr,
4549
- applePay: Br,
4550
- privateClickMeasurement: Ur,
4551
- audioBaseLatency: si,
4552
- dateTimeLocale: ci,
4553
- webGlBasics: Qr,
4554
- webGlExtensions: $r
4517
+ var ui = {
4518
+ fonts: Dn,
4519
+ domBlockers: mr,
4520
+ fontPreferences: Lr,
4521
+ audio: fn,
4522
+ screenFrame: Qn,
4523
+ canvas: kn,
4524
+ osCpu: Bn,
4525
+ languages: Vn,
4526
+ colorDepth: Hn,
4527
+ deviceMemory: Un,
4528
+ screenResolution: Wn,
4529
+ hardwareConcurrency: tr,
4530
+ timezone: nr,
4531
+ sessionStorage: ir,
4532
+ localStorage: ar,
4533
+ indexedDB: or,
4534
+ openDatabase: sr,
4535
+ cpuClass: cr,
4536
+ platform: lr,
4537
+ plugins: On,
4538
+ touchSupport: zn,
4539
+ vendor: ur,
4540
+ vendorFlavors: dr,
4541
+ cookiesEnabled: fr,
4542
+ colorGamut: yr,
4543
+ invertedColors: br,
4544
+ forcedColors: Sr,
4545
+ monochrome: Tr,
4546
+ contrast: Er,
4547
+ reducedMotion: Or,
4548
+ reducedTransparency: Ar,
4549
+ hdr: Mr,
4550
+ math: Pr,
4551
+ pdfViewerEnabled: zr,
4552
+ architecture: Br,
4553
+ applePay: Vr,
4554
+ privateClickMeasurement: Wr,
4555
+ audioBaseLatency: ci,
4556
+ dateTimeLocale: li,
4557
+ webGlBasics: $r,
4558
+ webGlExtensions: ei
4555
4559
  };
4556
- function ui(e) {
4557
- return Jt(li, e, []);
4560
+ function di(e) {
4561
+ return Yt(ui, e, []);
4558
4562
  }
4559
- var di = "$ if upgrade to Pro: https://fpjs.dev/pro";
4560
- function fi(e) {
4561
- var t = pi(e), n = mi(t);
4563
+ var fi = "$ if upgrade to Pro: https://fpjs.dev/pro";
4564
+ function pi(e) {
4565
+ var t = mi(e), n = hi(t);
4562
4566
  return {
4563
4567
  score: t,
4564
- comment: di.replace(/\$/g, `${n}`)
4568
+ comment: fi.replace(/\$/g, `${n}`)
4565
4569
  };
4566
4570
  }
4567
- function pi(e) {
4568
- if (ln()) return .4;
4569
- if (X()) return Qt() && !(an() && $t()) ? .5 : .3;
4571
+ function mi(e) {
4572
+ if (un()) return .4;
4573
+ if (Y()) return $t() && !(on() && en()) ? .5 : .3;
4570
4574
  var t = "value" in e.platform ? e.platform.value : "";
4571
4575
  return /^Win/.test(t) ? .6 : /^Mac/.test(t) ? .5 : .7;
4572
4576
  }
4573
- function mi(e) {
4574
- return jt(.99 + .01 * e, 1e-4);
4575
- }
4576
4577
  function hi(e) {
4578
+ return Mt(.99 + .01 * e, 1e-4);
4579
+ }
4580
+ function gi(e) {
4577
4581
  for (var t = "", n = 0, r = Object.keys(e).sort(); n < r.length; n++) {
4578
4582
  var i = r[n], a = e[i], o = "error" in a ? "error" : JSON.stringify(a.value);
4579
4583
  t += `${t ? "|" : ""}${i.replace(/([:|\\])/g, "\\$1")}:${o}`;
4580
4584
  }
4581
4585
  return t;
4582
4586
  }
4583
- function gi(e) {
4587
+ function _i(e) {
4584
4588
  return JSON.stringify(e, function(e, t) {
4585
- return t instanceof Error ? Wt(t) : t;
4589
+ return t instanceof Error ? Gt(t) : t;
4586
4590
  }, 2);
4587
4591
  }
4588
- function _i(e) {
4589
- return Ut(hi(e));
4590
- }
4591
4592
  function vi(e) {
4593
+ return Wt(gi(e));
4594
+ }
4595
+ function yi(e) {
4592
4596
  var t;
4593
4597
  return {
4594
4598
  get visitorId() {
4595
- return t === void 0 && (t = _i(this.components)), t;
4599
+ return t === void 0 && (t = vi(this.components)), t;
4596
4600
  },
4597
4601
  set visitorId(e) {
4598
4602
  t = e;
4599
4603
  },
4600
- confidence: fi(e),
4604
+ confidence: pi(e),
4601
4605
  components: e,
4602
- version: bt
4606
+ version: xt
4603
4607
  };
4604
4608
  }
4605
- function yi(e) {
4606
- return e === void 0 && (e = 50), Ct(e, e * 2);
4609
+ function bi(e) {
4610
+ return e === void 0 && (e = 50), wt(e, e * 2);
4607
4611
  }
4608
- function bi(e, t) {
4612
+ function xi(e, t) {
4609
4613
  return { get: function(n) {
4610
- return V(this, void 0, void 0, function() {
4614
+ return B(this, void 0, void 0, function() {
4611
4615
  var r, i;
4612
- return H(this, function(a) {
4616
+ return V(this, function(a) {
4613
4617
  switch (a.label) {
4614
4618
  case 0: return [4, e()];
4615
- case 1: return r = a.sent(), i = vi(r), t || n?.debug, [2, i];
4619
+ case 1: return r = a.sent(), i = yi(r), t || n?.debug, [2, i];
4616
4620
  }
4617
4621
  });
4618
4622
  });
4619
4623
  } };
4620
4624
  }
4621
- function xi() {
4625
+ function Si() {
4622
4626
  if (!(window.__fpjs_d_m || Math.random() >= .001)) try {
4623
4627
  var e = new XMLHttpRequest();
4624
- e.open("get", `https://m1.openfpcdn.io/fingerprintjs/v${bt}/npm-monitoring`, !0), e.send();
4628
+ e.open("get", `https://m1.openfpcdn.io/fingerprintjs/v${xt}/npm-monitoring`, !0), e.send();
4625
4629
  } catch {}
4626
4630
  }
4627
- function Si(e) {
4628
- return e === void 0 && (e = {}), V(this, void 0, void 0, function() {
4631
+ function Ci(e) {
4632
+ return e === void 0 && (e = {}), B(this, void 0, void 0, function() {
4629
4633
  var t, n, r;
4630
- return H(this, function(i) {
4634
+ return V(this, function(i) {
4631
4635
  switch (i.label) {
4632
- case 0: return (e.monitoring ?? !0) && xi(), t = e.delayFallback, n = e.debug, [4, yi(t)];
4633
- case 1: return i.sent(), r = ui({
4636
+ case 0: return (e.monitoring ?? !0) && Si(), t = e.delayFallback, n = e.debug, [4, bi(t)];
4637
+ case 1: return i.sent(), r = di({
4634
4638
  cache: {},
4635
4639
  debug: n
4636
- }), [2, bi(r, n)];
4640
+ }), [2, xi(r, n)];
4637
4641
  }
4638
4642
  });
4639
4643
  });
4640
4644
  }
4641
- var Ci = {
4642
- load: Si,
4643
- hashComponents: _i,
4644
- componentsToDebugString: gi
4645
+ var wi = {
4646
+ load: Ci,
4647
+ hashComponents: vi,
4648
+ componentsToDebugString: _i
4645
4649
  };
4646
4650
  //#endregion
4647
4651
  //#region ../../packages/widget-sdk/src/api/request-options.ts
4648
- function wi(e) {
4652
+ function Ti(e) {
4649
4653
  return e.preview ? "include" : "same-origin";
4650
4654
  }
4651
- function Ti(e, t) {
4655
+ function Ei(e) {
4656
+ return e.sessionToken ? { "x-widget-session-token": e.sessionToken } : {};
4657
+ }
4658
+ function Di(e, t) {
4652
4659
  return t.configChannel === "draft" ? `${e}${e.includes("?") ? "&" : "?"}configChannel=draft` : e;
4653
4660
  }
4654
4661
  //#endregion
4655
4662
  //#region ../../packages/widget-sdk/src/api/client.ts
4656
- var Ei = class {
4663
+ var Oi = class {
4657
4664
  baseUrl;
4658
4665
  options;
4666
+ sessionToken;
4667
+ sessionTokenExpiresAt;
4659
4668
  constructor(e, t = {}) {
4660
4669
  this.baseUrl = e, this.options = t;
4661
4670
  }
4662
4671
  get credentials() {
4663
- return wi(this.options);
4672
+ return Ti(this.options);
4664
4673
  }
4665
4674
  channel(e) {
4666
- return Ti(e, this.options);
4675
+ return Di(e, this.options);
4676
+ }
4677
+ authHeaders() {
4678
+ return {
4679
+ "Content-Type": "application/json",
4680
+ ...Ei({ sessionToken: this.sessionToken })
4681
+ };
4682
+ }
4683
+ getSessionToken() {
4684
+ return this.sessionToken;
4685
+ }
4686
+ hasValidSessionToken() {
4687
+ return !!this.sessionToken && !!this.sessionTokenExpiresAt && this.sessionTokenExpiresAt - 6e4 > Date.now();
4688
+ }
4689
+ async establishSession(e, t, n) {
4690
+ if (!t) return !1;
4691
+ try {
4692
+ let r = await fetch(this.channel(`${this.baseUrl}/v1/widget/session`), {
4693
+ method: "POST",
4694
+ credentials: this.credentials,
4695
+ headers: { "Content-Type": "application/json" },
4696
+ body: JSON.stringify({
4697
+ agentId: e,
4698
+ tenantId: t,
4699
+ turnstileToken: n
4700
+ })
4701
+ });
4702
+ if (!r.ok) return !1;
4703
+ let i = await r.json();
4704
+ if (!i.success || typeof i.data?.token != "string") return !1;
4705
+ this.sessionToken = i.data.token;
4706
+ let a = typeof i.data.expiresIn == "number" ? i.data.expiresIn : 0;
4707
+ return this.sessionTokenExpiresAt = Date.now() + a * 1e3, !0;
4708
+ } catch {
4709
+ return !1;
4710
+ }
4667
4711
  }
4668
4712
  async validateWidget(e, t) {
4669
4713
  if (!t) return {
@@ -4697,7 +4741,7 @@ var Ei = class {
4697
4741
  let t = await fetch(this.channel(`${this.baseUrl}/v1/agents/${encodeURIComponent(e.agentId)}/responses`), {
4698
4742
  method: "POST",
4699
4743
  credentials: this.credentials,
4700
- headers: { "Content-Type": "application/json" },
4744
+ headers: this.authHeaders(),
4701
4745
  body: JSON.stringify({
4702
4746
  message: e.message,
4703
4747
  sessionId: e.sessionId,
@@ -4738,7 +4782,7 @@ var Ei = class {
4738
4782
  let a = await fetch(this.channel(`${this.baseUrl}/v1/upload`), {
4739
4783
  method: "POST",
4740
4784
  credentials: this.credentials,
4741
- headers: { "Content-Type": "application/json" },
4785
+ headers: this.authHeaders(),
4742
4786
  body: JSON.stringify({
4743
4787
  file: e,
4744
4788
  mimeType: t,
@@ -4756,7 +4800,7 @@ var Ei = class {
4756
4800
  let a = await fetch(this.channel(`${this.baseUrl}/v1/upload`), {
4757
4801
  method: "POST",
4758
4802
  credentials: this.credentials,
4759
- headers: { "Content-Type": "application/json" },
4803
+ headers: this.authHeaders(),
4760
4804
  body: JSON.stringify({
4761
4805
  file: e,
4762
4806
  mimeType: t,
@@ -4801,7 +4845,7 @@ var Ei = class {
4801
4845
  };
4802
4846
  //#endregion
4803
4847
  //#region ../../packages/widget-sdk/src/api/sse-reader.ts
4804
- async function* Di(e, t) {
4848
+ async function* ki(e, t) {
4805
4849
  if (!e.body) return;
4806
4850
  let n = e.body.getReader(), r = new TextDecoder(), i = "", a = () => {
4807
4851
  if (!t) return n.read();
@@ -4828,14 +4872,17 @@ async function* Di(e, t) {
4828
4872
  }
4829
4873
  //#endregion
4830
4874
  //#region ../../packages/widget-sdk/src/api/stream.ts
4831
- var Oi = 12e4;
4832
- async function ki(e, t, n, r = {}) {
4875
+ var Ai = 12e4;
4876
+ async function ji(e, t, n, r = {}) {
4833
4877
  let i = "", a = !1;
4834
4878
  try {
4835
- let o = await fetch(Ti(`${e}/v1/agents/${encodeURIComponent(t.agentId)}/responses:stream`, r), {
4879
+ let o = await fetch(Di(`${e}/v1/agents/${encodeURIComponent(t.agentId)}/responses:stream`, r), {
4836
4880
  method: "POST",
4837
- credentials: wi(r),
4838
- headers: { "Content-Type": "application/json" },
4881
+ credentials: Ti(r),
4882
+ headers: {
4883
+ "Content-Type": "application/json",
4884
+ ...Ei(r)
4885
+ },
4839
4886
  body: JSON.stringify({
4840
4887
  message: t.message,
4841
4888
  sessionId: t.sessionId,
@@ -4914,20 +4961,20 @@ async function ki(e, t, n, r = {}) {
4914
4961
  }
4915
4962
  return !1;
4916
4963
  }
4917
- let r = Ai(t);
4964
+ let r = Mi(t);
4918
4965
  r && (i += r, n.onDelta(r, i));
4919
4966
  } catch (e) {
4920
4967
  if (!(e instanceof SyntaxError)) throw e;
4921
4968
  }
4922
4969
  return !1;
4923
4970
  };
4924
- for await (let e of Di(o, Oi)) if (l(e)) break;
4971
+ for await (let e of ki(o, Ai)) if (l(e)) break;
4925
4972
  n.onEnd(i);
4926
4973
  } catch (e) {
4927
4974
  n.onError(e instanceof Error ? e : Error(String(e)));
4928
4975
  }
4929
4976
  }
4930
- function Ai(e) {
4977
+ function Mi(e) {
4931
4978
  let t = e.choices;
4932
4979
  if (Array.isArray(t) && t.length > 0) {
4933
4980
  let e = t[0]?.delta, n = e?.content ?? e?.text ?? "";
@@ -4942,26 +4989,26 @@ function Ai(e) {
4942
4989
  }
4943
4990
  //#endregion
4944
4991
  //#region ../../packages/widget-sdk/src/api/reconnect.ts
4945
- function ji(e, t, n) {
4992
+ function Ni(e, t, n) {
4946
4993
  let r = t * 2 ** (e - 1), i = Math.min(r, n), a = i * .3;
4947
4994
  return Math.floor(i - a + a * 2 * Math.random());
4948
4995
  }
4949
- async function Mi(e, t, n, r = {}) {
4996
+ async function Pi(e, t, n, r = {}) {
4950
4997
  let i = await fetch(`${e}/v1/sessions/${encodeURIComponent(t)}/runs/${encodeURIComponent(n)}`, { credentials: r.preview ? "include" : "same-origin" });
4951
4998
  if (!i.ok) throw Error(`Failed to fetch run ${n}: ${i.status}`);
4952
4999
  let a = await i.json();
4953
5000
  if (!a.success || !a.data) throw Error(a.error ?? `Failed to fetch run ${n}`);
4954
5001
  return a.data;
4955
5002
  }
4956
- async function Ni(e, t, n, r = {}) {
5003
+ async function Fi(e, t, n, r = {}) {
4957
5004
  let i = r.maxAttempts ?? 3, a;
4958
5005
  for (let o = 1; o <= i; o++) {
4959
5006
  if (o > 1) {
4960
- let e = ji(o - 1, 500, 4e3);
5007
+ let e = Ni(o - 1, 500, 4e3);
4961
5008
  await new Promise((t) => setTimeout(t, e));
4962
5009
  }
4963
5010
  try {
4964
- let a = await Mi(e, t, n, r);
5011
+ let a = await Pi(e, t, n, r);
4965
5012
  if (a.status !== "running" || o === i) return a;
4966
5013
  } catch (e) {
4967
5014
  if (a = e instanceof Error ? e : Error(String(e)), o === i) throw a;
@@ -4970,8 +5017,56 @@ async function Ni(e, t, n, r = {}) {
4970
5017
  throw a ?? /* @__PURE__ */ Error(`Failed to fetch run ${n}`);
4971
5018
  }
4972
5019
  //#endregion
5020
+ //#region ../../packages/widget-sdk/src/api/turnstile.ts
5021
+ var Ii = 15e3, Q, Li, Ri, zi, Bi = [];
5022
+ function Vi() {
5023
+ zi || (zi = (e) => {
5024
+ if (!Q || e.source !== Q.contentWindow || Ri && e.origin !== Ri) return;
5025
+ let t = e.data;
5026
+ !t || typeof t.type != "string" || (t.type === "turnstile-token" && typeof t.token == "string" ? Bi.shift()?.resolve(t.token) : t.type === "turnstile-error" && Bi.shift()?.reject(Error(t.message ?? "Turnstile verification failed")));
5027
+ }, window.addEventListener("message", zi));
5028
+ }
5029
+ function Hi() {
5030
+ Q?.remove(), Q = void 0, Li = void 0;
5031
+ }
5032
+ function Ui(e) {
5033
+ if (Q && Li) return Li;
5034
+ if (typeof window > "u" || typeof document > "u") return Promise.reject(/* @__PURE__ */ Error("Turnstile requires a browser environment"));
5035
+ Vi(), Ri = new URL(e).origin;
5036
+ let t = document.createElement("iframe");
5037
+ return t.src = `${e.replace(/\/$/, "")}/v1/widget/turnstile-challenge`, t.style.display = "none", t.setAttribute("aria-hidden", "true"), t.sandbox.add("allow-scripts", "allow-same-origin"), Li = new Promise((e, n) => {
5038
+ let r = setTimeout(() => {
5039
+ window.removeEventListener("message", i), n(/* @__PURE__ */ Error("Turnstile challenge page failed to load"));
5040
+ }, Ii);
5041
+ function i(n) {
5042
+ n.source === t.contentWindow && n.data?.type === "turnstile-ready" && (clearTimeout(r), window.removeEventListener("message", i), e());
5043
+ }
5044
+ window.addEventListener("message", i);
5045
+ }).catch((e) => {
5046
+ throw Hi(), e;
5047
+ }), Q = t, document.body.appendChild(t), Li;
5048
+ }
5049
+ async function Wi(e) {
5050
+ if (await Ui(e), !Q?.contentWindow) throw Error("Turnstile challenge frame unavailable");
5051
+ let t = Q.contentWindow, n = Ri;
5052
+ return new Promise((e, r) => {
5053
+ let i = {
5054
+ resolve: (t) => {
5055
+ clearTimeout(a), e(t);
5056
+ },
5057
+ reject: (e) => {
5058
+ clearTimeout(a), r(e);
5059
+ }
5060
+ }, a = setTimeout(() => {
5061
+ let e = Bi.indexOf(i);
5062
+ e !== -1 && Bi.splice(e, 1), r(/* @__PURE__ */ Error("Turnstile verification timed out"));
5063
+ }, Ii);
5064
+ Bi.push(i), t.postMessage({ type: "turnstile-solve" }, n);
5065
+ });
5066
+ }
5067
+ //#endregion
4973
5068
  //#region ../../packages/widget-sdk/src/events/emitter.ts
4974
- var Pi = class {
5069
+ var Gi = class {
4975
5070
  listeners = /* @__PURE__ */ new Map();
4976
5071
  on(e, t) {
4977
5072
  this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t);
@@ -4986,30 +5081,30 @@ var Pi = class {
4986
5081
  removeAllListeners() {
4987
5082
  this.listeners.clear();
4988
5083
  }
4989
- }, Fi = "agentforge";
4990
- function Ii(e) {
4991
- return `${Fi}:session:${e}`;
5084
+ }, Ki = "agentforge";
5085
+ function qi(e) {
5086
+ return `${Ki}:session:${e}`;
4992
5087
  }
4993
- function Li(e) {
5088
+ function Ji(e) {
4994
5089
  try {
4995
- return sessionStorage.getItem(Ii(e)) ?? void 0;
5090
+ return sessionStorage.getItem(qi(e)) ?? void 0;
4996
5091
  } catch {
4997
5092
  return;
4998
5093
  }
4999
5094
  }
5000
- function Ri(e, t) {
5095
+ function Yi(e, t) {
5001
5096
  try {
5002
- sessionStorage.setItem(Ii(e), t);
5097
+ sessionStorage.setItem(qi(e), t);
5003
5098
  } catch {}
5004
5099
  }
5005
- function zi(e) {
5100
+ function Xi(e) {
5006
5101
  try {
5007
- sessionStorage.removeItem(Ii(e));
5102
+ sessionStorage.removeItem(qi(e));
5008
5103
  } catch {}
5009
5104
  }
5010
5105
  //#endregion
5011
5106
  //#region ../../packages/widget-sdk/src/progress-trail.ts
5012
- function Bi(e, t, n) {
5107
+ function Zi(e, t, n) {
5013
5108
  return e.map((e) => {
5014
5109
  if (e.status !== "active" || e.stage === "calling_tool") return e;
5015
5110
  let r = n !== void 0 && e.serverTsMs !== void 0 && Number.isFinite(n) && Number.isFinite(e.serverTsMs) && n >= e.serverTsMs ? n - e.serverTsMs : void 0;
@@ -5020,7 +5115,7 @@ function Bi(e, t, n) {
5020
5115
  };
5021
5116
  });
5022
5117
  }
5023
- function Vi(e) {
5118
+ function Qi(e) {
5024
5119
  let t = Date.now();
5025
5120
  return e.map((e) => e.status === "active" ? {
5026
5121
  ...e,
@@ -5028,7 +5123,7 @@ function Vi(e) {
5028
5123
  durationMs: e.durationMs ?? (e.startedAtMs ? t - e.startedAtMs : void 0)
5029
5124
  } : e);
5030
5125
  }
5031
- function Hi(e) {
5126
+ function $i(e) {
5032
5127
  if (e == null || e < 1e3) return null;
5033
5128
  if (e < 1e4) return `${(e / 1e3).toFixed(1)}s`;
5034
5129
  if (e < 6e4) return `${Math.round(e / 1e3)}s`;
@@ -5037,12 +5132,13 @@ function Hi(e) {
5037
5132
  }
5038
5133
  //#endregion
5039
5134
  //#region ../../packages/widget-sdk/src/create-client.ts
5040
- function Ui() {
5135
+ function ea() {
5041
5136
  return `msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
5042
5137
  }
5043
- var Wi = class {
5138
+ var ta = 2e3, na = class {
5044
5139
  hostConfig;
5045
5140
  onStateChange;
5141
+ sessionTokenPromise;
5046
5142
  config;
5047
5143
  apiClient;
5048
5144
  state;
@@ -5050,12 +5146,12 @@ var Wi = class {
5050
5146
  eventSource = null;
5051
5147
  emitter;
5052
5148
  constructor(e, t, n) {
5053
- this.hostConfig = t, this.onStateChange = n, this.config = e, this.apiClient = new Ei(e.apiBaseUrl, {
5149
+ this.hostConfig = t, this.onStateChange = n, this.config = e, this.apiClient = new Oi(e.apiBaseUrl, {
5054
5150
  preview: e.preview,
5055
5151
  configChannel: e.configChannel
5056
- }), this.emitter = new Pi(), this.initializeFingerprint();
5057
- let r = e.sessionId ?? Li(e.agentId);
5058
- e.sessionId && Ri(e.agentId, e.sessionId);
5152
+ }), this.emitter = new Gi(), this.initializeFingerprint();
5153
+ let r = e.sessionId ?? Ji(e.agentId);
5154
+ e.sessionId && Yi(e.agentId, e.sessionId);
5059
5155
  let i = e.mode === "inline";
5060
5156
  this.state = {
5061
5157
  isOpen: i,
@@ -5085,7 +5181,7 @@ var Wi = class {
5085
5181
  }
5086
5182
  async initializeFingerprint() {
5087
5183
  try {
5088
- let e = await (await Ci.load()).get();
5184
+ let e = await (await wi.load()).get();
5089
5185
  this.fingerprint = e.visitorId;
5090
5186
  } catch {
5091
5187
  this.fingerprint = void 0;
@@ -5098,7 +5194,7 @@ var Wi = class {
5098
5194
  };
5099
5195
  }
5100
5196
  setOpen(e) {
5101
- e ? this.openWithGreeting() : this.setState({ isOpen: !1 });
5197
+ e ? (this.ensureSessionToken(), this.openWithGreeting()) : this.setState({ isOpen: !1 });
5102
5198
  }
5103
5199
  openWithGreeting() {
5104
5200
  this.state.initStatus === "error" || this.state.initStatus === "disabled" || this.setState({ isOpen: !0 });
@@ -5121,7 +5217,7 @@ var Wi = class {
5121
5217
  }
5122
5218
  if (!this.config.skipServerConfigFetch) {
5123
5219
  let e = await this.apiClient.fetchWidgetConfig(this.config.agentId, this.config.tenantId);
5124
- e && (this.config = gt(this.hostConfig, e), this.onStateChange(this.getState(), this.config));
5220
+ e && (this.config = _t(this.hostConfig, e), this.onStateChange(this.getState(), this.config));
5125
5221
  }
5126
5222
  if (this.setState({ initStatus: "ready" }), !this.state.sessionId) return;
5127
5223
  this.openEventStream();
@@ -5139,7 +5235,7 @@ var Wi = class {
5139
5235
  kind: e.mimeType.startsWith("image/") ? "image" : "file"
5140
5236
  })) : void 0;
5141
5237
  return {
5142
- id: Ui(),
5238
+ id: ea(),
5143
5239
  role: e.role,
5144
5240
  content: e.content,
5145
5241
  images: !n && e.images && e.images.length > 0 ? e.images : void 0,
@@ -5176,7 +5272,7 @@ var Wi = class {
5176
5272
  if (typeof e.content != "string" || e.id && this.state.messages.some((t) => t.id === e.id)) return;
5177
5273
  if (e.direction === "human") {
5178
5274
  let t = {
5179
- id: e.id ?? Ui(),
5275
+ id: e.id ?? ea(),
5180
5276
  role: "assistant",
5181
5277
  content: e.content,
5182
5278
  createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -5192,7 +5288,7 @@ var Wi = class {
5192
5288
  }
5193
5289
  if (e.direction === "ai") {
5194
5290
  let t = {
5195
- id: e.id ?? Ui(),
5291
+ id: e.id ?? ea(),
5196
5292
  role: "assistant",
5197
5293
  content: e.content,
5198
5294
  createdAt: e.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -5230,7 +5326,7 @@ var Wi = class {
5230
5326
  if (this.state.sessionId) try {
5231
5327
  await this.apiClient.endSession(this.state.sessionId, this.config.tenantId, this.config.agentId, this.fingerprint, this.config.user.externalId, !0);
5232
5328
  } catch {}
5233
- zi(this.config.agentId), this.closeEventStream(), this.setState({
5329
+ Xi(this.config.agentId), this.closeEventStream(), this.setState({
5234
5330
  sessionId: void 0,
5235
5331
  messages: [],
5236
5332
  isLoading: !1,
@@ -5239,7 +5335,7 @@ var Wi = class {
5239
5335
  }), this.emitter.emit("reset", void 0), this.state.isOpen && this.openWithGreeting();
5240
5336
  }
5241
5337
  handleSessionExpired() {
5242
- zi(this.config.agentId), this.closeEventStream(), this.setState({
5338
+ Xi(this.config.agentId), this.closeEventStream(), this.setState({
5243
5339
  sessionId: void 0,
5244
5340
  controlMode: void 0
5245
5341
  });
@@ -5249,7 +5345,7 @@ var Wi = class {
5249
5345
  if (this.state.isLoading || !n || this.state.initStatus !== "ready") return;
5250
5346
  let r = [];
5251
5347
  if (t && t.length > 0) for (let e of t) try {
5252
- let t = await Ki(e.file);
5348
+ let t = await ia(e.file);
5253
5349
  if (e.kind === "image") {
5254
5350
  let n = await this.apiClient.uploadImage(t, e.file.type, e.file.name, this.config.agentId, this.config.tenantId);
5255
5351
  r.push({
@@ -5273,7 +5369,7 @@ var Wi = class {
5273
5369
  return;
5274
5370
  }
5275
5371
  let i = r.filter((e) => e.kind === "image"), a = {
5276
- id: Ui(),
5372
+ id: ea(),
5277
5373
  role: "user",
5278
5374
  content: e.trim(),
5279
5375
  uploadedImageUrl: i[0]?.url,
@@ -5289,7 +5385,25 @@ var Wi = class {
5289
5385
  let s = r.length > 0 ? r : void 0;
5290
5386
  this.config.streaming ? await this.sendStreaming(e.trim(), void 0, s) : await this.sendNonStreaming(e.trim(), void 0, s);
5291
5387
  }
5388
+ ensureSessionToken() {
5389
+ return !this.config.turnstileSiteKey || this.apiClient.hasValidSessionToken() ? Promise.resolve() : (this.sessionTokenPromise ??= (async () => {
5390
+ try {
5391
+ let e = await Wi(this.config.apiBaseUrl);
5392
+ await this.apiClient.establishSession(this.config.agentId, this.config.tenantId, e);
5393
+ } catch {} finally {
5394
+ this.sessionTokenPromise = void 0;
5395
+ }
5396
+ })(), this.sessionTokenPromise);
5397
+ }
5398
+ async awaitSessionToken() {
5399
+ if (!this.config.turnstileSiteKey || this.apiClient.hasValidSessionToken()) return;
5400
+ let e;
5401
+ await Promise.race([this.ensureSessionToken(), new Promise((t) => {
5402
+ e = setTimeout(t, ta);
5403
+ })]).finally(() => clearTimeout(e));
5404
+ }
5292
5405
  async sendNonStreaming(e, t, n, r = !1) {
5406
+ await this.awaitSessionToken();
5293
5407
  try {
5294
5408
  let r = await this.apiClient.chat({
5295
5409
  agentId: this.config.agentId,
@@ -5310,11 +5424,11 @@ var Wi = class {
5310
5424
  isLoading: !1,
5311
5425
  controlMode: "human_takeover",
5312
5426
  ...r.sessionId ? { sessionId: r.sessionId } : {}
5313
- }), r.sessionId && (Ri(this.config.agentId, r.sessionId), this.openEventStream());
5427
+ }), r.sessionId && (Yi(this.config.agentId, r.sessionId), this.openEventStream());
5314
5428
  return;
5315
5429
  }
5316
5430
  let i = {
5317
- id: Ui(),
5431
+ id: ea(),
5318
5432
  role: "assistant",
5319
5433
  content: r.content,
5320
5434
  images: r.images,
@@ -5326,7 +5440,7 @@ var Wi = class {
5326
5440
  messages: [...this.state.messages, i],
5327
5441
  isLoading: !1,
5328
5442
  ...r.sessionId ? { sessionId: r.sessionId } : {}
5329
- }), r.sessionId && (Ri(this.config.agentId, r.sessionId), this.openEventStream()), this.emitter.emit("message:received", i);
5443
+ }), r.sessionId && (Yi(this.config.agentId, r.sessionId), this.openEventStream()), this.emitter.emit("message:received", i);
5330
5444
  } catch (i) {
5331
5445
  let a = i instanceof Error ? i.message : "Failed to send message";
5332
5446
  if (!r && a.includes("410")) return this.handleSessionExpired(), this.sendNonStreaming(e, t, n, !0);
@@ -5340,7 +5454,8 @@ var Wi = class {
5340
5454
  }
5341
5455
  }
5342
5456
  async sendStreaming(e, t, n, r = !1) {
5343
- let i = Ui(), a = {
5457
+ await this.awaitSessionToken();
5458
+ let i = ea(), a = {
5344
5459
  id: i,
5345
5460
  role: "assistant",
5346
5461
  content: "",
@@ -5349,7 +5464,7 @@ var Wi = class {
5349
5464
  };
5350
5465
  this.setState({ messages: [...this.state.messages, a] }), this.emitter.emit("stream:start");
5351
5466
  let o = !1, s = !1, c = null, l = null, u = Date.now(), d = null;
5352
- await ki(this.config.apiBaseUrl, {
5467
+ await ji(this.config.apiBaseUrl, {
5353
5468
  agentId: this.config.agentId,
5354
5469
  message: e,
5355
5470
  sessionId: this.state.sessionId,
@@ -5364,7 +5479,7 @@ var Wi = class {
5364
5479
  attachments: n
5365
5480
  }, {
5366
5481
  onSession: (e) => {
5367
- this.setState({ sessionId: e }), Ri(this.config.agentId, e), this.openEventStream();
5482
+ this.setState({ sessionId: e }), Yi(this.config.agentId, e), this.openEventStream();
5368
5483
  },
5369
5484
  onRunId: (e) => {
5370
5485
  this.updateMessage(i, { runId: e });
@@ -5376,7 +5491,7 @@ var Wi = class {
5376
5491
  this.updateMessage(i, { documents: e });
5377
5492
  },
5378
5493
  onToolCallsStarted: (e, t) => {
5379
- t && c === null && (c = t), d = null, this.updateMessage(i, { answerStartedAtMs: null }), (t ?? c) !== "off" && this.updateMessage(i, { toolStatus: Gi(e) });
5494
+ t && c === null && (c = t), d = null, this.updateMessage(i, { answerStartedAtMs: null }), (t ?? c) !== "off" && this.updateMessage(i, { toolStatus: ra(e) });
5380
5495
  },
5381
5496
  onAck: (e) => {
5382
5497
  this.updateMessage(i, { ackText: e });
@@ -5387,7 +5502,7 @@ var Wi = class {
5387
5502
  totalMs: null,
5388
5503
  collapseAfterFinal: null,
5389
5504
  mode: n
5390
- } })), this.updateMessage(i, { progressEvents: [...Bi(a, o, l), {
5505
+ } })), this.updateMessage(i, { progressEvents: [...Zi(a, o, l), {
5391
5506
  stage: e,
5392
5507
  text: t,
5393
5508
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -5402,7 +5517,7 @@ var Wi = class {
5402
5517
  totalMs: null,
5403
5518
  collapseAfterFinal: null,
5404
5519
  mode: r
5405
- } })), this.updateMessage(i, { progressEvents: [...Bi(o, s, u), {
5520
+ } })), this.updateMessage(i, { progressEvents: [...Zi(o, s, u), {
5406
5521
  stage: "calling_tool",
5407
5522
  toolId: e,
5408
5523
  toolName: n,
@@ -5449,7 +5564,7 @@ var Wi = class {
5449
5564
  content: e,
5450
5565
  status: "sent",
5451
5566
  toolStatus: void 0,
5452
- progressEvents: n && t?.progressEvents?.length ? Vi(t.progressEvents) : void 0,
5567
+ progressEvents: n && t?.progressEvents?.length ? Qi(t.progressEvents) : void 0,
5453
5568
  progressCollapsed: n ? l ?? !0 : void 0,
5454
5569
  turnMeta: r ? {
5455
5570
  totalMs: (d ?? Date.now()) - u,
@@ -5494,7 +5609,7 @@ var Wi = class {
5494
5609
  t && this.emitter.emit("message:received", t);
5495
5610
  }, a = this.state.messages.find((e) => e.id === i)?.runId, s = this.state.sessionId;
5496
5611
  if (a && s) {
5497
- Ni(this.config.apiBaseUrl, s, a, { preview: this.config.preview }).then((r) => {
5612
+ Fi(this.config.apiBaseUrl, s, a, { preview: this.config.preview }).then((r) => {
5498
5613
  r.status === "done" && r.finalText ? n(r.finalText) : t(r.errorMessage || e.message || "Something went wrong. Please try again.");
5499
5614
  }).catch(() => t(e.message || "Something went wrong. Please try again."));
5500
5615
  return;
@@ -5503,17 +5618,18 @@ var Wi = class {
5503
5618
  }
5504
5619
  }, {
5505
5620
  preview: this.config.preview,
5506
- configChannel: this.config.configChannel
5621
+ configChannel: this.config.configChannel,
5622
+ sessionToken: this.apiClient.getSessionToken()
5507
5623
  }), o && (this.handleSessionExpired(), await this.sendStreaming(e, t, n, !0));
5508
5624
  }
5509
5625
  };
5510
- function Gi(e) {
5626
+ function ra(e) {
5511
5627
  let t = e[0];
5512
5628
  if (!t) return "Working...";
5513
5629
  let n = t.indexOf(".");
5514
5630
  return n > 0 ? `Using ${t.slice(0, n).replace(/_/g, " ")}: ${t.slice(n + 1).replace(/_/g, " ")}${e.length > 1 ? ` +${e.length - 1}` : ""}` : `Using ${t.replace(/_/g, " ")}`;
5515
5631
  }
5516
- function Ki(e) {
5632
+ function ia(e) {
5517
5633
  return new Promise((t, n) => {
5518
5634
  let r = new FileReader();
5519
5635
  r.onload = () => {
@@ -5524,7 +5640,7 @@ function Ki(e) {
5524
5640
  }
5525
5641
  //#endregion
5526
5642
  //#region ../../packages/widget-sdk/src/dom/shadow-root.ts
5527
- function qi(e) {
5643
+ function aa(e) {
5528
5644
  let t = document.createElement("div");
5529
5645
  t.setAttribute("data-agentkit-widget", ""), e.appendChild(t);
5530
5646
  let n = t.attachShadow({ mode: "open" }), r = document.createElement("style");
@@ -5537,18 +5653,18 @@ function qi(e) {
5537
5653
  mountPoint: i
5538
5654
  };
5539
5655
  }
5540
- function Ji(e, t) {
5656
+ function oa(e, t) {
5541
5657
  e.textContent = t;
5542
5658
  }
5543
- function Yi(e) {
5659
+ function sa(e) {
5544
5660
  e.remove();
5545
5661
  }
5546
5662
  //#endregion
5547
5663
  //#region ../../packages/widget-sdk/src/dom/mount.ts
5548
- function Xi(e) {
5664
+ function ca(e) {
5549
5665
  document.body ? document.body.appendChild(e) : document.addEventListener("DOMContentLoaded", () => document.body.appendChild(e), { once: !0 });
5550
5666
  }
5551
- function Zi() {
5667
+ function la() {
5552
5668
  let e = document.createElement("div");
5553
5669
  return e.setAttribute("data-agentkit-root", "floating"), e.style.cssText = [
5554
5670
  "position: fixed",
@@ -5556,9 +5672,9 @@ function Zi() {
5556
5672
  "right: 24px",
5557
5673
  "z-index: 2147483647",
5558
5674
  "pointer-events: none"
5559
- ].join("; "), Xi(e), e;
5675
+ ].join("; "), ca(e), e;
5560
5676
  }
5561
- function Qi(e) {
5677
+ function ua(e) {
5562
5678
  getComputedStyle(e).position === "static" && (e.style.position = "relative");
5563
5679
  let t = document.createElement("div");
5564
5680
  return t.setAttribute("data-agentkit-root", "floating"), t.style.cssText = [
@@ -5569,21 +5685,21 @@ function Qi(e) {
5569
5685
  "pointer-events: none"
5570
5686
  ].join("; "), e.appendChild(t), t;
5571
5687
  }
5572
- function $i(e) {
5688
+ function da(e) {
5573
5689
  return e.setAttribute("data-agentkit-root", "inline"), getComputedStyle(e).position === "static" && (e.style.position = "relative"), e;
5574
5690
  }
5575
- function ea(e) {
5691
+ function fa(e) {
5576
5692
  e.remove();
5577
5693
  }
5578
- function ta(e) {
5694
+ function pa(e) {
5579
5695
  e.removeAttribute("data-agentkit-root");
5580
5696
  }
5581
5697
  //#endregion
5582
5698
  //#region ../../packages/widget-sdk/src/create-widget.ts
5583
- function na(e, t, n, r, i) {
5584
- let a = e.mode === "inline", o = !1, s = a && i ? $i(i) : !a && i ? Qi(i) : Zi(), c = qi(s);
5585
- Ji(c.styleSlot, r);
5586
- let l = new Wi(e, t, (e, t) => {
5699
+ function ma(e, t, n, r, i) {
5700
+ let a = e.mode === "inline", o = !1, s = a && i ? da(i) : !a && i ? ua(i) : la(), c = aa(s);
5701
+ oa(c.styleSlot, r);
5702
+ let l = new na(e, t, (e, t) => {
5587
5703
  o || u.update(e, t);
5588
5704
  }), u = n(c.mountPoint, e, l.getState(), {
5589
5705
  onOpen: () => d.open(),
@@ -5615,7 +5731,7 @@ function na(e, t, n, r, i) {
5615
5731
  o || (l.resetConversation(), l.emitter.emit("reset"));
5616
5732
  },
5617
5733
  destroy() {
5618
- o || (o = !0, l.closeEventStream(), u.destroy(), Yi(c.host), a && i ? ta(i) : ea(s), l.emitter.emit("destroy"), l.emitter.removeAllListeners());
5734
+ o || (o = !0, l.closeEventStream(), u.destroy(), sa(c.host), a && i ? pa(i) : fa(s), l.emitter.emit("destroy"), l.emitter.removeAllListeners());
5619
5735
  },
5620
5736
  on(e, t) {
5621
5737
  l.emitter.on(e, t);
@@ -5631,43 +5747,43 @@ function na(e, t, n, r, i) {
5631
5747
  }
5632
5748
  //#endregion
5633
5749
  //#region ../../packages/widget-sdk/src/init.ts
5634
- var ra = /* @__PURE__ */ new Map(), ia = 0;
5635
- function aa(e) {
5636
- let t = `agentkit-widget-${++ia}`, n = e.destroy.bind(e);
5750
+ var ha = /* @__PURE__ */ new Map(), ga = 0;
5751
+ function _a(e) {
5752
+ let t = `agentkit-widget-${++ga}`, n = e.destroy.bind(e);
5637
5753
  return e.destroy = () => {
5638
- ra.delete(t), n();
5639
- }, ra.set(t, e), t;
5754
+ ha.delete(t), n();
5755
+ }, ha.set(t, e), t;
5640
5756
  }
5641
- function oa(e, t, n) {
5757
+ function va(e, t, n) {
5642
5758
  let r = {
5643
5759
  ...e,
5644
5760
  mode: "floating"
5645
- }, i = na(gt(r), r, t, n);
5646
- return aa(i), i;
5761
+ }, i = ma(_t(r), r, t, n);
5762
+ return _a(i), i;
5647
5763
  }
5648
- function sa(e, t, n, r) {
5764
+ function ya(e, t, n, r) {
5649
5765
  let i = {
5650
5766
  ...t,
5651
5767
  mode: "floating"
5652
- }, a = na(gt(i), i, n, r, e);
5653
- return aa(a), a;
5768
+ }, a = ma(_t(i), i, n, r, e);
5769
+ return _a(a), a;
5654
5770
  }
5655
- function ca(e, t, n, r) {
5771
+ function ba(e, t, n, r) {
5656
5772
  let i = {
5657
5773
  ...t,
5658
5774
  mode: "inline"
5659
- }, a = na(gt(i), i, n, r, e);
5660
- return aa(a), a;
5775
+ }, a = ma(_t(i), i, n, r, e);
5776
+ return _a(a), a;
5661
5777
  }
5662
- function la(e) {
5663
- e ? ra.get(e)?.destroy() : (ra.forEach((e) => e.destroy()), ra.clear());
5778
+ function xa(e) {
5779
+ e ? ha.get(e)?.destroy() : (ha.forEach((e) => e.destroy()), ha.clear());
5664
5780
  }
5665
- function ua() {
5666
- return Array.from(ra.keys());
5781
+ function Sa() {
5782
+ return Array.from(ha.keys());
5667
5783
  }
5668
5784
  //#endregion
5669
5785
  //#region ../../packages/widget-ui/src/theme/tokens.ts
5670
- function da(e) {
5786
+ function Ca(e) {
5671
5787
  let { theme: t } = e, n = [
5672
5788
  `--ak-accent: ${t.accentColor}`,
5673
5789
  `--ak-font: ${t.fontFamily}`,
@@ -5675,15 +5791,15 @@ function da(e) {
5675
5791
  ];
5676
5792
  return n.push(`--ak-accent-hover: color-mix(in srgb, ${t.accentColor} 85%, black)`), `:host { ${n.join("; ")} }`;
5677
5793
  }
5678
- function fa(e) {
5794
+ function wa(e) {
5679
5795
  return e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : e;
5680
5796
  }
5681
5797
  //#endregion
5682
5798
  //#region ../../packages/widget-ui/src/theme/styles.ts
5683
- var pa = "\n*, *::before, *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n --ak-accent: #6366f1;\n --ak-accent-hover: #4f46e5;\n --ak-bg: #ffffff;\n --ak-surface: #f9fafb;\n --ak-text: #111827;\n --ak-text-muted: #6b7280;\n --ak-border: #e5e7eb;\n --ak-user-bg: var(--ak-accent);\n --ak-user-text: #ffffff;\n --ak-bot-bg: #f3f4f6;\n --ak-bot-text: #111827;\n --ak-maintenance-fg: #92400e;\n --ak-maintenance-bg: #fffbeb;\n --ak-maintenance-halo: #fcd34d;\n --ak-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n --ak-radius: 12px;\n /* Chat surface texture — scattered line doodles, tiled. Neutral stroke (not accent-tinted)\n so it stays a texture rather than competing with brand colour. Alpha is baked into the\n SVG stroke, so the light/dark variants differ only in stroke rgba. */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(0,0,0,0.045)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-pattern-size: 210px;\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);\n --ak-launcher-size: 56px;\n /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.\n Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */\n --ak-launcher-gap: -12px;\n font-family: var(--ak-font);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Dark mode — set data-theme=\"dark\" on the shadow host element.\n Slate palette, aligned with the KlicForge dashboard dark tokens. */\n:host([data-theme=\"dark\"]) {\n --ak-bg: #0f172a; /* slate-900 — panel surface */\n --ak-surface: #1e293b; /* slate-800 — inputs, insets (lift off panel) */\n --ak-text: #f1f5f9; /* slate-100 */\n --ak-text-muted: #94a3b8;/* slate-400 */\n --ak-border: #334155; /* slate-700 */\n --ak-bot-bg: #1e293b; /* slate-800 — assistant bubble */\n --ak-bot-text: #f1f5f9; /* slate-100 */\n /* Same doodle tile, white stroke — dark surfaces need ~1.5x the alpha to read the same */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);\n --ak-maintenance-fg: #fde68a;\n --ak-maintenance-bg: rgba(253, 230, 138, 0.06);\n --ak-maintenance-halo: #f59e0b;\n}\n\n/* ── Floating layout ─────────────────────────────────────────── */\n.ak-floating {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0;\n pointer-events: none;\n}\n.ak-floating > * {\n pointer-events: all;\n}\n\n/* ── Inline layout ───────────────────────────────────────────── */\n.ak-inline {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n}\n\n/* ── Launcher button ─────────────────────────────────────────── */\n.ak-launcher {\n width: var(--ak-launcher-size);\n height: var(--ak-launcher-size);\n border-radius: 50%;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);\n transition: background 0.2s, transform 0.15s, box-shadow 0.2s;\n flex-shrink: 0;\n}\n.ak-launcher:hover {\n background: var(--ak-accent-hover);\n transform: scale(1.08);\n box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);\n}\n.ak-launcher:active {\n transform: scale(0.95);\n}\n.ak-launcher svg {\n pointer-events: none;\n}\n/* Launcher showing avatar image instead of chat icon */\n.ak-launcher--avatar {\n padding: 0;\n overflow: hidden;\n}\n.ak-launcher__avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n pointer-events: none;\n}\n\n/* ── Shell wrapper (positions the hanging branding tab) ─────── */\n.ak-shell-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: var(--ak-launcher-gap);\n}\n\n/* ── Widget shell / panel ────────────────────────────────────── */\n.ak-shell {\n background: var(--ak-bg);\n border-radius: var(--ak-radius);\n box-shadow: var(--ak-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n}\n.ak-shell--floating {\n width: 380px;\n height: 580px;\n}\n.ak-shell--inline {\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n display: flex;\n flex-direction: column;\n}\n/* Inline shell-wrap fills its container and suppresses the duplicate widget header\n (the sidebar already renders its own header and close button). */\n.ak-inline .ak-shell-wrap {\n width: 100%;\n height: 100%;\n /* No launcher in inline mode — the negative offset would overflow the host. */\n margin-bottom: 0;\n}\n.ak-inline .ak-header {\n display: none;\n}\n.ak-shell-enter {\n animation: ak-panel-in 0.2s ease-out;\n}\n@keyframes ak-panel-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n/* ── Header ──────────────────────────────────────────────────── */\n.ak-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--ak-accent);\n color: #fff;\n flex-shrink: 0;\n gap: 8px;\n}\n.ak-header--confirming {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 0;\n}\n.ak-header__row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n}\n.ak-header__status {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #4ade80;\n flex-shrink: 0;\n}\n.ak-header__title-group {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n}\n.ak-header__title {\n font-size: 15px;\n font-weight: 600;\n letter-spacing: -0.01em;\n}\n.ak-header__subtitle {\n font-size: 11px;\n font-weight: 400;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ak-header__close {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__close:hover {\n background: rgba(255, 255, 255, 0.35);\n}\n.ak-header__avatar {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__bot-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n flex-shrink: 0;\n}\n.ak-header__button {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__button:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__button--active {\n background: rgba(255, 255, 255, 0.3);\n}\n.ak-header__confirm {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n animation: ak-confirm-in 0.18s ease-out;\n}\n@keyframes ak-confirm-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-header__confirm-text {\n display: flex;\n flex-direction: column;\n gap: 1px;\n flex: 1;\n min-width: 0;\n}\n.ak-header__confirm-title {\n font-size: 13px;\n font-weight: 600;\n color: #fff;\n line-height: 1.3;\n}\n.ak-header__confirm-sub {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.75);\n line-height: 1.3;\n}\n.ak-header__confirm-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-shrink: 0;\n}\n.ak-header__confirm-cancel {\n padding: 5px 10px;\n border-radius: 6px;\n border: 1px solid rgba(255, 255, 255, 0.4);\n background: transparent;\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__confirm-cancel:active {\n background: rgba(255, 255, 255, 0.25);\n}\n.ak-header__confirm-ok {\n padding: 5px 10px;\n border-radius: 6px;\n border: none;\n background: rgba(255, 255, 255, 0.2);\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-ok:hover {\n background: rgba(239, 68, 68, 0.7);\n}\n.ak-header__confirm-ok:active {\n background: rgba(239, 68, 68, 0.85);\n}\n\n/* ── Message list ────────────────────────────────────────────── */\n.ak-messages {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n scroll-behavior: smooth;\n min-height: 0; /* Allow flex child to shrink below its content height */\n /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.\n background-attachment defaults to scroll = anchored to the padding box, so the\n pattern stays put while messages scroll. */\n background-image: var(--ak-pattern);\n background-size: var(--ak-pattern-size) var(--ak-pattern-size);\n}\n.ak-messages::-webkit-scrollbar { width: 4px; }\n.ak-messages::-webkit-scrollbar-track { background: transparent; }\n.ak-messages::-webkit-scrollbar-thumb {\n background: var(--ak-border);\n border-radius: 4px;\n}\n\n/* ── Empty state ─────────────────────────────────────────────── */\n.ak-empty-state {\n flex: 1;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: safe center;\n padding: 16px;\n text-align: center;\n gap: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0;\n /* Glow layer is translucent so the same doodle texture as .ak-messages shows through —\n keeps empty state and message list on one continuous surface. */\n background-color: var(--ak-bg);\n background-image:\n radial-gradient(ellipse 110% 55% at 50% 0%,\n color-mix(in srgb, var(--ak-accent) 10%, transparent),\n transparent 72%\n ),\n var(--ak-pattern);\n background-size: auto, var(--ak-pattern-size) var(--ak-pattern-size);\n}\n/* Decorative blurred orb behind the avatar */\n.ak-empty-state__glow {\n position: absolute;\n top: -24px;\n left: 50%;\n transform: translateX(-50%);\n width: 180px;\n height: 180px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--ak-accent) 18%, transparent);\n filter: blur(48px);\n pointer-events: none;\n}\n.ak-empty-state__body {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n position: relative;\n width: 100%;\n}\n.ak-empty-state__avatar {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n background: var(--ak-bg);\n border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));\n box-shadow:\n 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),\n 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-accent);\n margin-bottom: 4px;\n flex-shrink: 0;\n}\n.ak-empty-state__avatar-img {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n object-fit: cover;\n}\n.ak-empty-state__bot-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ak-empty-state__title {\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-empty-state__description {\n margin: 0;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.55;\n width: 100%;\n}\n/* Suggested question chips — 2-column grid */\n.ak-empty-state__suggestions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n width: 100%;\n}\n.ak-empty-state__suggestion {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: color-mix(in srgb, var(--ak-accent) 5%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 16%, var(--ak-border));\n border-radius: 10px;\n padding: 10px 12px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n/* Odd last item spans both columns so the grid doesn't look lopsided */\n.ak-empty-state__suggestion:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n.ak-empty-state__suggestion:hover {\n background: color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg));\n border-color: color-mix(in srgb, var(--ak-accent) 30%, var(--ak-border));\n}\n.ak-empty-state__suggestion-title {\n font-size: 13px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.4;\n}\n.ak-empty-state__suggestion-desc {\n font-size: 12px;\n color: var(--ak-text-muted);\n line-height: 1.4;\n margin-top: 2px;\n}\n\n/* ── Message bubbles ─────────────────────────────────────────── */\n.ak-message {\n display: flex;\n flex-direction: column;\n max-width: 86%;\n animation: ak-msg-in 0.15s ease-out;\n}\n@keyframes ak-msg-in {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-message--user {\n align-self: flex-end;\n align-items: flex-end;\n}\n.ak-message--assistant {\n align-self: flex-start;\n align-items: flex-start;\n}\n.ak-message__bubble {\n padding: 8px 12px;\n border-radius: 16px;\n font-size: 14px;\n line-height: 1.55;\n word-break: break-word;\n white-space: pre-wrap;\n max-width: 100%;\n min-width: 0;\n}\n.ak-message__bubble--md {\n white-space: normal;\n}\n.ak-message--user .ak-message__bubble {\n background: var(--ak-user-bg);\n color: var(--ak-user-text);\n border-bottom-right-radius: 4px;\n}\n.ak-message--assistant .ak-message__bubble {\n background: var(--ak-bot-bg);\n color: var(--ak-bot-text);\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n}\n.ak-message--error .ak-message__bubble {\n background: #fee2e2;\n color: #991b1b;\n border-color: #fca5a5;\n}\n.ak-message--operator .ak-message__bubble--operator {\n background: color-mix(in srgb, var(--ak-accent) 8%, var(--ak-bot-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));\n}\n.ak-message__time {\n display: block;\n text-align: right;\n font-size: 11px;\n color: var(--ak-text-muted);\n margin-top: 2px;\n padding: 0 4px;\n}\n.ak-message--user .ak-message__time {\n color: rgba(255, 255, 255, 0.7);\n}\n.ak-message__sender-label {\n font-size: 11px;\n font-weight: 500;\n color: var(--ak-text-muted);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 0 2px;\n margin-bottom: 4px;\n}\n.ak-message--operator .ak-message__sender-label {\n color: var(--ak-accent);\n font-weight: 600;\n}\n.ak-message__operator-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: var(--ak-accent);\n color: #fff;\n font-size: 10px;\n font-weight: 700;\n line-height: 1;\n flex-shrink: 0;\n}\n.ak-message__operator-name {\n line-height: 1;\n}\n.ak-handoff-divider {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 8px 4px;\n color: var(--ak-text-muted);\n font-size: 11px;\n font-weight: 500;\n}\n.ak-handoff-divider::before,\n.ak-handoff-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--ak-border);\n}\n.ak-handoff-divider__label {\n white-space: nowrap;\n padding: 2px 8px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 14%, var(--ak-border));\n color: color-mix(in srgb, var(--ak-accent) 70%, var(--ak-text));\n}\n/* ── Message avatar (assistant only, when avatarUrl is set) ─── */\n.ak-message--with-avatar {\n flex-direction: row;\n align-items: flex-end;\n gap: 8px;\n}\n.ak-message__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--ak-surface);\n}\n.ak-message__body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 0;\n}\n\n/* ── Generated images ────────────────────────────────────────── */\n\n/* Bubble that contains an image — remove padding so image is flush at top */\n.ak-message__bubble--has-image {\n padding: 0;\n overflow: hidden;\n}\n\n.ak-message__images {\n display: flex;\n flex-direction: column;\n gap: 0;\n}\n\n.ak-message__image-wrap {\n position: relative;\n line-height: 0;\n}\n\n/* Clicking the image opens it in a new tab */\n.ak-message__image-link {\n display: block;\n line-height: 0;\n}\n\n.ak-message__image {\n width: 100%;\n display: block;\n transition: filter 0.2s;\n}\n\n.ak-message__image-link:hover .ak-message__image {\n filter: brightness(0.93);\n}\n\n/* ── Image gallery (count-aware layouts) ───────────────────────────────── */\n.ak-gallery {\n position: relative;\n width: 100%;\n background: #ffffff;\n overflow: hidden;\n}\n\n/* Single hero: natural aspect, contained inside a white frame so transparent\n * product PNGs read clearly. Caps at 320px tall to keep bubble compact. */\n.ak-gallery--single {\n line-height: 0;\n}\n.ak-gallery--single .ak-gallery__cell--hero {\n display: block;\n background: #ffffff;\n}\n.ak-gallery__img--contain {\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n background: #ffffff;\n display: block;\n}\n\n/* 2-up: side-by-side squares, gap-1 */\n.ak-gallery--two {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n/* 3-up: big left + 2 stacked right; container holds aspect */\n.ak-gallery--three {\n display: grid;\n grid-template-columns: 2fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n aspect-ratio: 4 / 3;\n}\n.ak-gallery--three > .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n}\n.ak-gallery--three .ak-gallery__col {\n display: grid;\n grid-template-rows: 1fr 1fr;\n gap: 2px;\n}\n\n/* 4-up (and 5+): 2x2 grid */\n.ak-gallery--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n.ak-gallery__cell {\n position: relative;\n display: block;\n overflow: hidden;\n background: #f8fafc;\n aspect-ratio: 1 / 1;\n line-height: 0;\n text-decoration: none;\n}\n\n/* Override aspect-ratio for the 3-up layout's column cells (they take parent height) */\n.ak-gallery--three .ak-gallery__col .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n width: 100%;\n}\n\n.ak-gallery__img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n transition: transform 0.2s ease-out, filter 0.2s;\n}\n\n.ak-gallery__cell:hover .ak-gallery__img {\n transform: scale(1.04);\n filter: brightness(0.97);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n.ak-gallery__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.6);\n color: #ffffff;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n pointer-events: none;\n}\n\n/* ── File chips (user-uploaded .pdf/.md/.txt/.csv) ─────────────────────── */\n.ak-message__files {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px 4px;\n}\n.ak-message__bubble--has-image .ak-message__files {\n padding: 8px 8px 4px;\n}\n\n.ak-file-chip {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border, #e2e8f0);\n border-radius: 12px;\n text-decoration: none;\n color: var(--ak-text, #0f172a);\n transition: border-color 0.15s, box-shadow 0.15s;\n max-width: 100%;\n}\n\n.ak-file-chip:hover {\n border-color: #cbd5e1;\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);\n}\n\n.ak-file-chip:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: 2px;\n}\n\n.ak-file-chip__icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n\n.ak-file-chip__icon--pdf { background: #fff1f2; color: #e11d48; }\n.ak-file-chip__icon--csv { background: #ecfdf5; color: #059669; }\n.ak-file-chip__icon--md { background: #f5f3ff; color: #7c3aed; }\n.ak-file-chip__icon--txt { background: #f1f5f9; color: #475569; }\n.ak-file-chip__icon--default { background: #eef2ff; color: #4f46e5; }\n\n.ak-file-chip__body {\n display: flex;\n flex-direction: column;\n min-width: 0;\n line-height: 1.2;\n}\n\n.ak-file-chip__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--ak-text, #0f172a);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n\n.ak-file-chip__label {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n color: #64748b;\n margin-top: 2px;\n}\n\n/* In user-side bubble (dark primary background), invert chip surface for legibility */\n.ak-message--user .ak-file-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n/* ── Lightbox (image preview modal) ────────────────────────────────────── */\n.ak-lightbox {\n position: fixed;\n inset: 0;\n z-index: 2147483600; /* near max int — sits above any host-page content */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(15, 23, 42, 0.85);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n animation: ak-lightbox-in 0.12s ease-out;\n}\n\n@keyframes ak-lightbox-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.ak-lightbox__img {\n max-width: 92vw;\n max-height: 88vh;\n border-radius: 8px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);\n user-select: none;\n display: block;\n}\n\n.ak-lightbox__toolbar {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ak-lightbox__counter {\n display: inline-flex;\n align-items: center;\n height: 28px;\n padding: 0 12px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n font-size: 12px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n\n.ak-lightbox__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n text-decoration: none;\n padding: 0;\n}\n\n.ak-lightbox__btn:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__btn:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n.ak-lightbox__nav {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n padding: 0;\n}\n\n.ak-lightbox__nav:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__nav--prev { left: 16px; }\n.ak-lightbox__nav--next { right: 16px; }\n\n.ak-lightbox__nav:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n/* Gallery cells must be styled as plain buttons (we converted from <a>) */\n.ak-gallery__cell {\n border: none;\n padding: 0;\n margin: 0;\n cursor: zoom-in;\n font: inherit;\n color: inherit;\n background: #f8fafc;\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n/* Faint download icon — always present, top-right corner of the image */\n.ak-message__image-dl-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 26px;\n height: 26px;\n background: rgba(0, 0, 0, 0.28);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgba(255, 255, 255, 0.75);\n text-decoration: none;\n transition: background 0.15s, color 0.15s;\n}\n\n.ak-message__image-dl-icon:hover {\n background: rgba(0, 0, 0, 0.55);\n color: #ffffff;\n}\n\n/* Caption / text below the image, inside the same bubble */\n.ak-message__image-caption {\n padding: 8px 10px 8px;\n font-size: 14px;\n font-style: normal;\n color: var(--ak-text);\n line-height: 1.45;\n}\n\n/* User-uploaded image caption uses user bubble colors */\n.ak-message--user .ak-message__image-caption {\n color: rgba(255, 255, 255, 0.8);\n font-style: normal;\n}\n\n/* ── Typing indicator ────────────────────────────────────────── */\n.ak-typing {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 9px 12px;\n background: var(--ak-bot-bg);\n border-radius: 16px;\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n align-self: flex-start;\n width: fit-content;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing__dot {\n width: 7px;\n height: 7px;\n background: var(--ak-text-muted);\n border-radius: 50%;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing__dot:nth-child(3) { animation-delay: 0.4s; }\n@keyframes ak-bounce {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }\n 30% { transform: translateY(-5px); opacity: 1; }\n}\n\n/* ── Init status (validating / error) ───────────────────────── */\n.ak-init-status {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.ak-init-spinner {\n width: 28px;\n height: 28px;\n border: 3px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n animation: ak-spin 0.7s linear infinite;\n}\n@keyframes ak-spin {\n to { transform: rotate(360deg); }\n}\n.ak-init-status--error {\n justify-content: flex-start;\n}\n.ak-init-status--maintenance {\n padding: 28px 24px;\n}\n\n/* ── Composer ────────────────────────────────────────────────── */\n.ak-composer {\n position: relative; /* establishes positioning context for the attachment submenu */\n padding: 8px 12px 10px;\n border-top: 1px solid var(--ak-border);\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ak-bg);\n flex-shrink: 0;\n}\n\n/* Hidden native file input */\n.ak-composer__file-input {\n display: none;\n}\n\n/* Unified input container — wraps +, textarea, send as one row */\n.ak-composer__input-wrap {\n display: flex;\n align-items: center;\n gap: 6px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 14px;\n padding: 5px 5px 5px 6px;\n transition: border-color 0.15s;\n}\n.ak-composer__input-wrap:focus-within {\n border-color: var(--ak-accent);\n}\n\n/* Attach button wrapper */\n.ak-composer__attach-wrap {\n flex-shrink: 0;\n}\n\n/* \"+\" attachment button — square with rounded corners */\n.ak-composer__attach {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, border-color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__attach:hover:not(:disabled) {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n}\n.ak-composer__attach--open {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent);\n}\n.ak-composer__attach:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Attachment submenu — floats above the composer, positioned relative to .ak-composer */\n.ak-composer__attach-menu {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 12px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 10px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n padding: 4px;\n min-width: 130px;\n z-index: 10;\n}\n\n/* Individual item inside the attachment submenu */\n.ak-composer__attach-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: none;\n border-radius: 7px;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n cursor: pointer;\n transition: background 0.12s;\n text-align: left;\n}\n.ak-composer__attach-menu-item:hover:not(:disabled) {\n background: var(--ak-bg);\n}\n.ak-composer__attach-menu-item:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Textarea — borderless, transparent, sits inside the container */\n.ak-composer__input {\n flex: 1;\n padding: 4px 6px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 14px;\n line-height: 1.45;\n resize: none;\n outline: none;\n min-height: 28px;\n max-height: 110px;\n overflow-y: auto;\n}\n.ak-composer__input::placeholder {\n color: var(--ak-text-muted);\n}\n\n/* Send button — square with rounded corners */\n.ak-composer__send {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n transition: background 0.15s, opacity 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__send:hover:not(:disabled) {\n background: var(--ak-accent-hover);\n}\n.ak-composer__send:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n/* Old photo button — hidden but keep so file-input trigger still works */\n.ak-composer__photo {\n display: none;\n}\n\n/* Image preview strip above the input row */\n.ak-composer__preview {\n display: flex;\n gap: 6px;\n padding: 0 2px;\n}\n.ak-composer__preview-wrap {\n position: relative;\n width: 60px;\n height: 60px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n flex-shrink: 0;\n}\n.ak-composer__preview-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n.ak-composer__preview-remove {\n position: absolute;\n top: 3px;\n right: 3px;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n padding: 0;\n transition: background 0.15s;\n}\n.ak-composer__preview-remove:hover {\n background: rgba(0, 0, 0, 0.8);\n}\n\n/* ── Streaming cursor ────────────────────────────────────────── */\n.ak-cursor {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n margin-left: 4px;\n vertical-align: middle;\n}\n.ak-cursor__dot {\n display: inline-block;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.6;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }\n\n/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item\n and .ak-progress__summary so dots → activity line → summary never reflow. */\n.ak-typing-row {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* One text line at the shared row metrics, so the dots occupy exactly the\n box the activity line and summary will occupy (border-box). */\n min-height: calc(0.76rem * 1.4 + 4px);\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing-row__dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--ak-bot-text);\n opacity: 0.5;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }\n@media (prefers-reduced-motion: reduce) {\n .ak-typing-row__dot,\n .ak-cursor__dot,\n .ak-typing__dot,\n .ak-progress__item--active,\n .ak-agent-status__icon {\n animation: none;\n }\n}\n\n/* ── Markdown rendering ──────────────────────────────────────── */\n.ak-message__bubble--md {\n white-space: normal;\n min-width: 0;\n}\n.ak-message__bubble--md .ak-md-p {\n margin: 0 0 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-p:last-child {\n margin-bottom: 0;\n}\n/* Collapse margins between paragraph and following list */\n.ak-message__bubble--md .ak-md-p + .ak-md-ul,\n.ak-message__bubble--md .ak-md-p + .ak-md-ol {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1,\n.ak-message__bubble--md .ak-md-h2,\n.ak-message__bubble--md .ak-md-h3 {\n font-weight: 700;\n line-height: 1.3;\n margin: 0.6em 0 0.3em;\n}\n.ak-message__bubble--md .ak-md-h1:first-child,\n.ak-message__bubble--md .ak-md-h2:first-child,\n.ak-message__bubble--md .ak-md-h3:first-child {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1 { font-size: 1.12em; }\n.ak-message__bubble--md .ak-md-h2 { font-size: 1.04em; }\n.ak-message__bubble--md .ak-md-h3 { font-size: 0.97em; }\n.ak-message__bubble--md .ak-md-ul,\n.ak-message__bubble--md .ak-md-ol {\n padding-left: 1.4em;\n margin: 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-ul li,\n.ak-message__bubble--md .ak-md-ol li {\n margin-bottom: 0.15em;\n}\n.ak-message__bubble--md .ak-md-pre-wrap {\n position: relative;\n margin: 0.4em 0;\n border-radius: 6px;\n overflow-x: auto;\n overflow-y: hidden;\n background: rgba(0, 0, 0, 0.08);\n max-width: 100%;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-wrap {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre-lang {\n display: block;\n padding: 3px 10px;\n font-size: 10px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.55;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-lang {\n border-bottom-color: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre {\n margin: 0;\n padding: 8px 10px;\n font-size: 12px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n white-space: pre;\n box-sizing: border-box;\n}\n.ak-message__bubble--md .ak-md-code {\n display: block;\n font-family: inherit;\n font-size: inherit;\n}\n.ak-message__bubble--md .ak-md-ic {\n background: rgba(0, 0, 0, 0.08);\n border-radius: 3px;\n padding: 1px 5px;\n font-size: 0.87em;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-ic {\n background: rgba(255, 255, 255, 0.2);\n}\n.ak-message__bubble--md .ak-md-hr {\n border: none;\n border-top: 1px solid currentColor;\n opacity: 0.2;\n margin: 0.5em 0;\n}\n.ak-message__bubble--md a {\n color: var(--ak-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-message--user .ak-message__bubble--md a {\n color: rgba(255, 255, 255, 0.9);\n}\n.ak-message__bubble--md .ak-md-table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.4em 0;\n font-size: 0.95em;\n line-height: 1.5;\n}\n.ak-message__bubble--md .ak-md-th {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 2px solid var(--ak-accent) !important;\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent) !important;\n font-weight: 600;\n color: var(--ak-text) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-th {\n border-bottom-color: rgba(255, 255, 255, 0.5) !important;\n background: rgba(0, 0, 0, 0.25) !important;\n color: #ffffff !important;\n font-weight: 700;\n}\n.ak-message__bubble--md .ak-md-td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--ak-border) !important;\n color: var(--ak-text) !important;\n}\n.ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: color-mix(in srgb, var(--ak-surface), transparent 40%) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-td {\n color: #ffffff !important;\n border-bottom-color: rgba(255, 255, 255, 0.25) !important;\n}\n.ak-message--user .ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: rgba(0, 0, 0, 0.15) !important;\n}\n\n/* ── Composer disclaimer ─────────────────────────────────────── */\n.ak-composer__disclaimer {\n font-size: 11px;\n color: var(--ak-text-muted);\n text-align: center;\n line-height: 1.4;\n}\n.ak-composer__disclaimer a {\n color: var(--ak-text-muted);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-composer__disclaimer a:hover {\n color: var(--ak-accent);\n}\n\n/* ── Maintenance state ───────────────────────────────────────── */\n.ak-maintenance {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n max-width: 320px;\n padding: 8px 4px;\n animation: ak-maintenance-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;\n}\n.ak-maintenance__halo {\n position: absolute;\n top: -6px;\n left: 50%;\n width: 120px;\n height: 120px;\n transform: translateX(-50%);\n border-radius: 50%;\n background: radial-gradient(\n closest-side,\n var(--ak-maintenance-halo) 0%,\n transparent 72%\n );\n opacity: 0.22;\n filter: blur(4px);\n pointer-events: none;\n animation: ak-maintenance-pulse 2.8s ease-in-out infinite;\n}\n.ak-maintenance__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--ak-maintenance-bg);\n color: var(--ak-maintenance-fg);\n border: 1px solid color-mix(in srgb, var(--ak-maintenance-halo) 40%, transparent);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n.ak-maintenance__title {\n margin-top: 16px;\n font-size: 15px;\n font-weight: 600;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-maintenance__description {\n margin-top: 6px;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.5;\n max-width: 28ch;\n}\n\n@keyframes ak-maintenance-enter {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n@keyframes ak-maintenance-pulse {\n 0%, 100% { opacity: 0.18; transform: translateX(-50%) scale(1); }\n 50% { opacity: 0.32; transform: translateX(-50%) scale(1.06); }\n}\n@media (prefers-reduced-motion: reduce) {\n .ak-maintenance,\n .ak-maintenance__halo,\n .ak-maintenance__icon {\n animation: none;\n }\n}\n\n/* ── Error banner ────────────────────────────────────────────── */\n.ak-error {\n padding: 12px 16px;\n background: #fee2e2;\n color: #991b1b;\n font-size: 13px;\n border-top: 1px solid #fca5a5;\n text-align: left;\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n}\n\n.ak-error__icon {\n font-size: 16px;\n line-height: 1;\n flex-shrink: 0;\n margin-top: 1px;\n}\n\n.ak-error__content {\n flex: 1;\n}\n\n.ak-error__title {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 4px 0;\n line-height: 1.3;\n}\n\n.ak-error__description {\n font-size: 13px;\n margin: 0 0 4px 0;\n line-height: 1.4;\n opacity: 0.9;\n}\n\n.ak-error__message {\n font-size: 13px;\n margin: 0;\n line-height: 1.4;\n opacity: 0.85;\n}\n\n/* Specific styling for origin restriction errors */\n.ak-error--origin {\n background: #fef3c7; /* Amber background instead of red for less scary appearance */\n color: #92400e; /* Amber text color */\n border-top: 1px solid #fbbf24;\n}\n\n/* ── Agent status indicator ──────────────────────────────────── */\n/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants\n see the tool status swap in without the surrounding box changing size. */\n.ak-agent-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 4px;\n padding: 2px 0;\n color: var(--ak-bot-text);\n font-size: 0.76rem;\n line-height: 1.4;\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-agent-status__icon {\n flex-shrink: 0;\n color: var(--ak-primary, #6366f1);\n animation: ak-sparkle-pulse 2.5s ease-in-out infinite;\n}\n.ak-agent-status__text {\n line-height: 1.4;\n}\n@keyframes ak-sparkle-pulse {\n 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }\n 50% { opacity: 0.45; transform: scale(0.85) rotate(15deg); }\n}\n\n/* ── Progress block (tool execution / streaming chain) ───────── */\n.ak-progress {\n margin-bottom: 4px;\n max-width: 80%;\n}\n.ak-progress__block {\n display: inline-flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 12px;\n border-radius: 14px;\n background: var(--ak-bot-bg);\n border: 1px solid var(--ak-border);\n font-size: 0.8rem;\n color: var(--ak-bot-text);\n opacity: 0.85;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ak-progress__label {\n font-weight: 600;\n font-size: 0.78rem;\n color: var(--ak-primary, #6366f1);\n}\n.ak-progress__toggle {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n padding: 1px 7px;\n border: 1px solid var(--ak-border);\n border-radius: 8px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.72rem;\n cursor: pointer;\n opacity: 0.65;\n transition: opacity 0.15s;\n}\n.ak-progress__toggle:hover { opacity: 0.9; }\n.ak-progress__toggle--collapsed {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.78rem;\n cursor: pointer;\n opacity: 0.55;\n transition: opacity 0.15s;\n margin-bottom: 4px;\n}\n.ak-progress__toggle--collapsed:hover { opacity: 0.85; }\n.ak-progress__text {\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n line-height: 1.4;\n margin: 0;\n}\n/* Active streaming state */\n.ak-progress__list {\n list-style: none;\n margin: 0 0 4px;\n padding: 0;\n}\n/* Bare row, not a pill — identical metrics to .ak-progress__summary so the\n live line and the post-turn \"Worked for Ns\" swap without a size change. */\n.ak-progress__item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n line-height: 1.4;\n color: var(--ak-bot-text);\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__item--active {\n /* inherits base .ak-progress__item; subtle pulse to signal in-flight */\n animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;\n}\n@keyframes ak-active-pulse {\n 0%, 100% { opacity: 0.6; }\n 50% { opacity: 0.9; }\n}\n/* Claude-style step list (detailed mode) */\n.ak-progress__steps {\n list-style: none;\n margin: 0 0 4px;\n padding: 2px 0;\n}\n.ak-progress__step {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n line-height: 1.4;\n}\n.ak-progress__step--active {\n opacity: 0.9;\n}\n.ak-progress__step-text {\n min-width: 0;\n}\n.ak-progress__step-dur {\n opacity: 0.65;\n flex-shrink: 0;\n}\n.ak-progress__step-icon {\n flex-shrink: 0;\n opacity: 0.55;\n}\n.ak-progress__step-icon--fail {\n color: #ef4444;\n opacity: 0.9;\n}\n/* Post-turn summary row (\"Worked for Ns · N steps\") */\n.ak-progress__summary {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* Shrink-to-fit as a column flex item would otherwise break \"Worked for 8.4s\"\n onto two lines, doubling the row height as the turn ends. */\n white-space: nowrap;\n border: none;\n background: transparent;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.ak-progress__summary:hover { opacity: 0.85; }\n.ak-progress__summary--static {\n cursor: default;\n}\n.ak-progress__summary--static:hover { opacity: 0.6; }\n.ak-progress__spinner {\n display: inline-block;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--ak-border);\n border-top-color: var(--ak-primary, #6366f1);\n border-radius: 50%;\n flex-shrink: 0;\n animation: ak-spin 0.7s linear infinite;\n}\n\n/* ── Powered by hanging tab ──────────────────────────────────── */\n.ak-branding {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px 4px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n margin-left: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);\n}\n.ak-branding__logo {\n width: 11px;\n height: 11px;\n flex-shrink: 0;\n color: var(--ak-accent);\n opacity: 0.75;\n}\n.ak-branding__label {\n font-size: 9px;\n color: var(--ak-text-muted);\n opacity: 0.75;\n}\n.ak-branding__name {\n font-size: 9px;\n font-weight: 600;\n color: var(--ak-accent);\n opacity: 0.75;\n letter-spacing: -0.01em;\n}\n\n/* ── Mobile: full-viewport panel ─────────────────────────────── */\n@media (max-width: 639px) {\n @keyframes ak-panel-in-mobile {\n from { opacity: 0; transform: translateY(32px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.\n Give it its own fixed position so it fills the viewport independently,\n bypassing the outer container's bottom/right offsets. */\n :host([data-open]) {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n pointer-events: none;\n }\n\n :host([data-open]) .ak-floating {\n width: 100%;\n height: 100%;\n align-items: stretch;\n gap: 0;\n }\n\n :host([data-open]) .ak-shell-wrap {\n flex: 1;\n min-height: 0;\n width: 100%;\n align-items: stretch;\n /* Launcher is hidden here — the negative offset would leave a dead strip. */\n margin-bottom: 0;\n }\n\n :host([data-open]) .ak-shell--floating {\n width: 100%;\n flex: 1;\n height: auto;\n border-radius: 0;\n box-shadow: none;\n border-left: none;\n border-right: none;\n border-top: none;\n }\n\n :host([data-open]) .ak-launcher {\n display: none;\n }\n\n :host([data-open]) .ak-shell-enter {\n animation: ak-panel-in-mobile 0.22s ease-out;\n }\n\n :host([data-open]) .ak-branding {\n display: none;\n }\n}\n";
5799
+ var Ta = "\n*, *::before, *::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n:host {\n --ak-accent: #6366f1;\n --ak-accent-hover: #4f46e5;\n --ak-bg: #ffffff;\n --ak-surface: #f9fafb;\n --ak-text: #111827;\n --ak-text-muted: #6b7280;\n --ak-border: #e5e7eb;\n --ak-user-bg: var(--ak-accent);\n --ak-user-text: #ffffff;\n --ak-bot-bg: #f3f4f6;\n --ak-bot-text: #111827;\n --ak-maintenance-fg: #92400e;\n --ak-maintenance-bg: #fffbeb;\n --ak-maintenance-halo: #fcd34d;\n --ak-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n --ak-radius: 12px;\n /* Chat surface texture — scattered line doodles, tiled. Neutral stroke (not accent-tinted)\n so it stays a texture rather than competing with brand colour. Alpha is baked into the\n SVG stroke, so the light/dark variants differ only in stroke rgba. */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(0,0,0,0.045)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-pattern-size: 210px;\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);\n --ak-launcher-size: 56px;\n /* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.\n Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */\n --ak-launcher-gap: -12px;\n font-family: var(--ak-font);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Dark mode — set data-theme=\"dark\" on the shadow host element.\n Slate palette, aligned with the KlicForge dashboard dark tokens. */\n:host([data-theme=\"dark\"]) {\n --ak-bg: #0f172a; /* slate-900 — panel surface */\n --ak-surface: #1e293b; /* slate-800 — inputs, insets (lift off panel) */\n --ak-text: #f1f5f9; /* slate-100 */\n --ak-text-muted: #94a3b8;/* slate-400 */\n --ak-border: #334155; /* slate-700 */\n --ak-bot-bg: #1e293b; /* slate-800 — assistant bubble */\n --ak-bot-text: #f1f5f9; /* slate-100 */\n /* Same doodle tile, white stroke — dark surfaces need ~1.5x the alpha to read the same */\n --ak-pattern: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='rgba(255,255,255,0.07)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30c5-8 14-8 19 0s14 8 19 0'/%3E%3Ccircle cx='96' cy='22' r='8'/%3E%3Cpath d='M150 34l6-11 6 11z'/%3E%3Cpath d='M196 18v14M189 25h14'/%3E%3Cpath d='M28 74h22M28 81h14'/%3E%3Cpath d='M84 68l8-8 8 8-8 8z'/%3E%3Cpath d='M186 76c0 7-6 12-13 12h-10l-6 6v-6c-5-1-8-6-8-12 0-7 6-12 13-12h11c7 0 13 5 13 12z'/%3E%3Ccircle cx='124' cy='104' r='5'/%3E%3Cpath d='M18 122c7-5 14-5 21 0'/%3E%3Cpath d='M62 132l7-13 7 13z'/%3E%3Cpath d='M106 156h20M106 163h12'/%3E%3Ccircle cx='176' cy='140' r='8'/%3E%3Cpath d='M32 170l6-6 6 6-6 6z'/%3E%3Cpath d='M148 196c5-7 13-7 18 0'/%3E%3Cpath d='M74 196v12M68 202h12'/%3E%3Ccircle cx='206' cy='178' r='4.5'/%3E%3Ccircle cx='58' cy='48' r='4'/%3E%3Cpath d='M128 56h16M128 62h10'/%3E%3Cpath d='M40 100l5-5 5 5-5 5z'/%3E%3Cpath d='M150 116c5-6 12-6 17 0'/%3E%3Ccircle cx='92' cy='128' r='4'/%3E%3Cpath d='M198 108v11M193 113h11'/%3E%3Cpath d='M8 148c5-7 12-7 17 0'/%3E%3Ccircle cx='142' cy='176' r='4'/%3E%3Cpath d='M76 166h16M76 172h9'/%3E%3Cpath d='M186 208l5-9 5 9z'/%3E%3Cpath d='M110 190l6-6 6 6-6 6z'/%3E%3Ccircle cx='46' cy='206' r='5'/%3E%3C/svg%3E\");\n --ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4);\n --ak-maintenance-fg: #fde68a;\n --ak-maintenance-bg: rgba(253, 230, 138, 0.06);\n --ak-maintenance-halo: #f59e0b;\n}\n\n/* ── Floating layout ─────────────────────────────────────────── */\n.ak-floating {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0;\n pointer-events: none;\n}\n.ak-floating > * {\n pointer-events: all;\n}\n\n/* ── Inline layout ───────────────────────────────────────────── */\n.ak-inline {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n}\n\n/* ── Launcher button ─────────────────────────────────────────── */\n.ak-launcher {\n width: var(--ak-launcher-size);\n height: var(--ak-launcher-size);\n border-radius: 50%;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);\n transition: background 0.2s, transform 0.15s, box-shadow 0.2s;\n flex-shrink: 0;\n}\n.ak-launcher:hover {\n background: var(--ak-accent-hover);\n transform: scale(1.08);\n box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);\n}\n.ak-launcher:active {\n transform: scale(0.95);\n}\n.ak-launcher svg {\n pointer-events: none;\n}\n/* Launcher showing avatar image instead of chat icon */\n.ak-launcher--avatar {\n padding: 0;\n overflow: hidden;\n}\n.ak-launcher__avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n pointer-events: none;\n}\n\n/* ── Shell wrapper (positions the hanging branding tab) ─────── */\n.ak-shell-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n margin-bottom: var(--ak-launcher-gap);\n}\n\n/* ── Widget shell / panel ────────────────────────────────────── */\n.ak-shell {\n background: var(--ak-bg);\n border-radius: var(--ak-radius);\n box-shadow: var(--ak-shadow);\n display: flex;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n}\n.ak-shell--floating {\n width: 380px;\n height: 580px;\n}\n.ak-shell--inline {\n width: 100%;\n height: 100%;\n min-height: 400px;\n max-height: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n display: flex;\n flex-direction: column;\n}\n/* Inline shell-wrap fills its container and suppresses the duplicate widget header\n (the sidebar already renders its own header and close button). */\n.ak-inline .ak-shell-wrap {\n width: 100%;\n height: 100%;\n /* No launcher in inline mode — the negative offset would overflow the host. */\n margin-bottom: 0;\n}\n.ak-inline .ak-header {\n display: none;\n}\n.ak-shell-enter {\n animation: ak-panel-in 0.2s ease-out;\n}\n@keyframes ak-panel-in {\n from { opacity: 0; transform: translateY(10px) scale(0.97); }\n to { opacity: 1; transform: translateY(0) scale(1); }\n}\n\n/* ── Header ──────────────────────────────────────────────────── */\n.ak-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n background: var(--ak-accent);\n color: #fff;\n flex-shrink: 0;\n gap: 8px;\n}\n.ak-header--confirming {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n gap: 0;\n}\n.ak-header__row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n}\n.ak-header__status {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: #4ade80;\n flex-shrink: 0;\n}\n.ak-header__title-group {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n}\n.ak-header__title {\n font-size: 15px;\n font-weight: 600;\n letter-spacing: -0.01em;\n}\n.ak-header__subtitle {\n font-size: 11px;\n font-weight: 400;\n opacity: 0.8;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ak-header__close {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__close:hover {\n background: rgba(255, 255, 255, 0.35);\n}\n.ak-header__avatar {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n border: 2px solid rgba(255, 255, 255, 0.3);\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__bot-icon {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n flex-shrink: 0;\n}\n.ak-header__button {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n transition: background 0.15s;\n flex-shrink: 0;\n}\n.ak-header__button:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__button--active {\n background: rgba(255, 255, 255, 0.3);\n}\n.ak-header__confirm {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 8px 0 0;\n margin: 8px 0 0;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n animation: ak-confirm-in 0.18s ease-out;\n}\n@keyframes ak-confirm-in {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-header__confirm-text {\n display: flex;\n flex-direction: column;\n gap: 1px;\n flex: 1;\n min-width: 0;\n}\n.ak-header__confirm-title {\n font-size: 13px;\n font-weight: 600;\n color: #fff;\n line-height: 1.3;\n}\n.ak-header__confirm-sub {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.75);\n line-height: 1.3;\n}\n.ak-header__confirm-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-shrink: 0;\n}\n.ak-header__confirm-cancel {\n padding: 5px 10px;\n border-radius: 6px;\n border: 1px solid rgba(255, 255, 255, 0.4);\n background: transparent;\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-header__confirm-cancel:active {\n background: rgba(255, 255, 255, 0.25);\n}\n.ak-header__confirm-ok {\n padding: 5px 10px;\n border-radius: 6px;\n border: none;\n background: rgba(255, 255, 255, 0.2);\n color: #fff;\n font-family: var(--ak-font);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s;\n white-space: nowrap;\n}\n.ak-header__confirm-ok:hover {\n background: rgba(239, 68, 68, 0.7);\n}\n.ak-header__confirm-ok:active {\n background: rgba(239, 68, 68, 0.85);\n}\n\n/* ── Message list ────────────────────────────────────────────── */\n.ak-messages {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n display: flex;\n flex-direction: column;\n gap: 8px;\n scroll-behavior: smooth;\n min-height: 0; /* Allow flex child to shrink below its content height */\n /* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.\n background-attachment defaults to scroll = anchored to the padding box, so the\n pattern stays put while messages scroll. */\n background-image: var(--ak-pattern);\n background-size: var(--ak-pattern-size) var(--ak-pattern-size);\n}\n.ak-messages::-webkit-scrollbar { width: 4px; }\n.ak-messages::-webkit-scrollbar-track { background: transparent; }\n.ak-messages::-webkit-scrollbar-thumb {\n background: var(--ak-border);\n border-radius: 4px;\n}\n\n/* ── Empty state ─────────────────────────────────────────────── */\n.ak-empty-state {\n flex: 1;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: safe center;\n padding: 16px;\n text-align: center;\n gap: 16px;\n overflow-y: auto;\n overflow-x: hidden;\n min-height: 0;\n /* Glow layer is translucent so the same doodle texture as .ak-messages shows through —\n keeps empty state and message list on one continuous surface. */\n background-color: var(--ak-bg);\n background-image:\n radial-gradient(ellipse 110% 55% at 50% 0%,\n color-mix(in srgb, var(--ak-accent) 10%, transparent),\n transparent 72%\n ),\n var(--ak-pattern);\n background-size: auto, var(--ak-pattern-size) var(--ak-pattern-size);\n}\n/* Decorative blurred orb behind the avatar */\n.ak-empty-state__glow {\n position: absolute;\n top: -24px;\n left: 50%;\n transform: translateX(-50%);\n width: 180px;\n height: 180px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--ak-accent) 18%, transparent);\n filter: blur(48px);\n pointer-events: none;\n}\n.ak-empty-state__body {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n position: relative;\n width: 100%;\n}\n.ak-empty-state__avatar {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n background: var(--ak-bg);\n border: 2px solid color-mix(in srgb, var(--ak-accent) 25%, var(--ak-border));\n box-shadow:\n 0 0 0 4px color-mix(in srgb, var(--ak-accent) 10%, transparent),\n 0 4px 16px color-mix(in srgb, var(--ak-accent) 20%, transparent);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-accent);\n margin-bottom: 4px;\n flex-shrink: 0;\n}\n.ak-empty-state__avatar-img {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n object-fit: cover;\n}\n.ak-empty-state__bot-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ak-empty-state__title {\n margin: 0;\n font-size: 16px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-empty-state__description {\n margin: 0;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.55;\n width: 100%;\n}\n/* Suggested question chips — 2-column grid */\n.ak-empty-state__suggestions {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n width: 100%;\n}\n.ak-empty-state__suggestion {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n background: color-mix(in srgb, var(--ak-accent) 5%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 16%, var(--ak-border));\n border-radius: 10px;\n padding: 10px 12px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n/* Odd last item spans both columns so the grid doesn't look lopsided */\n.ak-empty-state__suggestion:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n.ak-empty-state__suggestion:hover {\n background: color-mix(in srgb, var(--ak-accent) 10%, var(--ak-bg));\n border-color: color-mix(in srgb, var(--ak-accent) 30%, var(--ak-border));\n}\n.ak-empty-state__suggestion-title {\n font-size: 13px;\n font-weight: 700;\n color: var(--ak-text);\n line-height: 1.4;\n}\n.ak-empty-state__suggestion-desc {\n font-size: 12px;\n color: var(--ak-text-muted);\n line-height: 1.4;\n margin-top: 2px;\n}\n\n/* ── Message bubbles ─────────────────────────────────────────── */\n.ak-message {\n display: flex;\n flex-direction: column;\n max-width: 86%;\n animation: ak-msg-in 0.15s ease-out;\n}\n@keyframes ak-msg-in {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ak-message--user {\n align-self: flex-end;\n align-items: flex-end;\n}\n.ak-message--assistant {\n align-self: flex-start;\n align-items: flex-start;\n}\n.ak-message__bubble {\n padding: 8px 12px;\n border-radius: 16px;\n font-size: 14px;\n line-height: 1.55;\n word-break: break-word;\n white-space: pre-wrap;\n max-width: 100%;\n min-width: 0;\n}\n.ak-message__bubble--md {\n white-space: normal;\n}\n.ak-message--user .ak-message__bubble {\n background: var(--ak-user-bg);\n color: var(--ak-user-text);\n border-bottom-right-radius: 4px;\n}\n.ak-message--assistant .ak-message__bubble {\n background: var(--ak-bot-bg);\n color: var(--ak-bot-text);\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n}\n.ak-message--error .ak-message__bubble {\n background: #fee2e2;\n color: #991b1b;\n border-color: #fca5a5;\n}\n.ak-message--operator .ak-message__bubble--operator {\n background: color-mix(in srgb, var(--ak-accent) 8%, var(--ak-bot-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));\n}\n.ak-message__time {\n display: block;\n text-align: right;\n font-size: 11px;\n color: var(--ak-text-muted);\n margin-top: 2px;\n padding: 0 4px;\n}\n.ak-message--user .ak-message__time {\n color: rgba(255, 255, 255, 0.7);\n}\n.ak-message__sender-label {\n font-size: 11px;\n font-weight: 500;\n color: var(--ak-text-muted);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 0 2px;\n margin-bottom: 4px;\n}\n.ak-message--operator .ak-message__sender-label {\n color: var(--ak-accent);\n font-weight: 600;\n}\n.ak-message__operator-avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: var(--ak-accent);\n color: #fff;\n font-size: 10px;\n font-weight: 700;\n line-height: 1;\n flex-shrink: 0;\n}\n.ak-message__operator-name {\n line-height: 1;\n}\n.ak-handoff-divider {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 8px 4px;\n color: var(--ak-text-muted);\n font-size: 11px;\n font-weight: 500;\n}\n.ak-handoff-divider::before,\n.ak-handoff-divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--ak-border);\n}\n.ak-handoff-divider__label {\n white-space: nowrap;\n padding: 2px 8px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--ak-accent) 6%, var(--ak-bg));\n border: 1px solid color-mix(in srgb, var(--ak-accent) 14%, var(--ak-border));\n color: color-mix(in srgb, var(--ak-accent) 70%, var(--ak-text));\n}\n/* ── Message avatar (assistant only, when avatarUrl is set) ─── */\n.ak-message--with-avatar {\n flex-direction: row;\n align-items: flex-end;\n gap: 8px;\n}\n.ak-message__avatar {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n background: var(--ak-surface);\n}\n.ak-message__body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 0;\n}\n\n/* ── Generated images ────────────────────────────────────────── */\n\n/* Bubble that contains an image — remove padding so image is flush at top */\n.ak-message__bubble--has-image {\n padding: 0;\n overflow: hidden;\n}\n\n.ak-message__images {\n display: flex;\n flex-direction: column;\n gap: 0;\n}\n\n.ak-message__image-wrap {\n position: relative;\n line-height: 0;\n}\n\n/* Clicking the image opens it in a new tab */\n.ak-message__image-link {\n display: block;\n line-height: 0;\n}\n\n.ak-message__image {\n width: 100%;\n display: block;\n transition: filter 0.2s;\n}\n\n.ak-message__image-link:hover .ak-message__image {\n filter: brightness(0.93);\n}\n\n/* ── Image gallery (count-aware layouts) ───────────────────────────────── */\n.ak-gallery {\n position: relative;\n width: 100%;\n background: #ffffff;\n overflow: hidden;\n}\n\n/* Single hero: natural aspect, contained inside a white frame so transparent\n * product PNGs read clearly. Caps at 320px tall to keep bubble compact. */\n.ak-gallery--single {\n line-height: 0;\n}\n.ak-gallery--single .ak-gallery__cell--hero {\n display: block;\n background: #ffffff;\n}\n.ak-gallery__img--contain {\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n background: #ffffff;\n display: block;\n}\n\n/* 2-up: side-by-side squares, gap-1 */\n.ak-gallery--two {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n/* 3-up: big left + 2 stacked right; container holds aspect */\n.ak-gallery--three {\n display: grid;\n grid-template-columns: 2fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n aspect-ratio: 4 / 3;\n}\n.ak-gallery--three > .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n}\n.ak-gallery--three .ak-gallery__col {\n display: grid;\n grid-template-rows: 1fr 1fr;\n gap: 2px;\n}\n\n/* 4-up (and 5+): 2x2 grid */\n.ak-gallery--grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2px;\n background: #e2e8f0;\n}\n\n.ak-gallery__cell {\n position: relative;\n display: block;\n overflow: hidden;\n background: #f8fafc;\n aspect-ratio: 1 / 1;\n line-height: 0;\n text-decoration: none;\n}\n\n/* Override aspect-ratio for the 3-up layout's column cells (they take parent height) */\n.ak-gallery--three .ak-gallery__col .ak-gallery__cell {\n aspect-ratio: auto;\n height: 100%;\n width: 100%;\n}\n\n.ak-gallery__img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n transition: transform 0.2s ease-out, filter 0.2s;\n}\n\n.ak-gallery__cell:hover .ak-gallery__img {\n transform: scale(1.04);\n filter: brightness(0.97);\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n.ak-gallery__overlay {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.6);\n color: #ffffff;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n pointer-events: none;\n}\n\n/* ── File chips (user-uploaded .pdf/.md/.txt/.csv) ─────────────────────── */\n.ak-message__files {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px 10px 4px;\n}\n.ak-message__bubble--has-image .ak-message__files {\n padding: 8px 8px 4px;\n}\n\n.ak-file-chip {\n display: inline-flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border, #e2e8f0);\n border-radius: 12px;\n text-decoration: none;\n color: var(--ak-text, #0f172a);\n transition: border-color 0.15s, box-shadow 0.15s;\n max-width: 100%;\n}\n\n.ak-file-chip:hover {\n border-color: #cbd5e1;\n box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);\n}\n\n.ak-file-chip:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: 2px;\n}\n\n.ak-file-chip__icon {\n flex-shrink: 0;\n width: 34px;\n height: 34px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n}\n\n.ak-file-chip__icon--pdf { background: #fff1f2; color: #e11d48; }\n.ak-file-chip__icon--csv { background: #ecfdf5; color: #059669; }\n.ak-file-chip__icon--md { background: #f5f3ff; color: #7c3aed; }\n.ak-file-chip__icon--txt { background: #f1f5f9; color: #475569; }\n.ak-file-chip__icon--default { background: #eef2ff; color: #4f46e5; }\n\n.ak-file-chip__body {\n display: flex;\n flex-direction: column;\n min-width: 0;\n line-height: 1.2;\n}\n\n.ak-file-chip__name {\n font-size: 13px;\n font-weight: 500;\n color: var(--ak-text, #0f172a);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n\n.ak-file-chip__label {\n font-size: 10px;\n font-weight: 600;\n letter-spacing: 0.05em;\n color: #64748b;\n margin-top: 2px;\n}\n\n/* In user-side bubble (dark primary background), invert chip surface for legibility */\n.ak-message--user .ak-file-chip {\n background: rgba(255, 255, 255, 0.96);\n border-color: transparent;\n}\n\n/* ── Lightbox (image preview modal) ────────────────────────────────────── */\n.ak-lightbox {\n position: fixed;\n inset: 0;\n z-index: 2147483600; /* near max int — sits above any host-page content */\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: rgba(15, 23, 42, 0.85);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n animation: ak-lightbox-in 0.12s ease-out;\n}\n\n@keyframes ak-lightbox-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n.ak-lightbox__img {\n max-width: 92vw;\n max-height: 88vh;\n border-radius: 8px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);\n user-select: none;\n display: block;\n}\n\n.ak-lightbox__toolbar {\n position: absolute;\n top: 16px;\n right: 16px;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.ak-lightbox__counter {\n display: inline-flex;\n align-items: center;\n height: 28px;\n padding: 0 12px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n font-size: 12px;\n font-weight: 500;\n font-variant-numeric: tabular-nums;\n}\n\n.ak-lightbox__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n text-decoration: none;\n padding: 0;\n}\n\n.ak-lightbox__btn:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__btn:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n.ak-lightbox__nav {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border: none;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.12);\n color: #ffffff;\n cursor: pointer;\n transition: background 0.15s;\n padding: 0;\n}\n\n.ak-lightbox__nav:hover {\n background: rgba(255, 255, 255, 0.22);\n}\n\n.ak-lightbox__nav--prev { left: 16px; }\n.ak-lightbox__nav--next { right: 16px; }\n\n.ak-lightbox__nav:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.8);\n outline-offset: 2px;\n}\n\n/* Gallery cells must be styled as plain buttons (we converted from <a>) */\n.ak-gallery__cell {\n border: none;\n padding: 0;\n margin: 0;\n cursor: zoom-in;\n font: inherit;\n color: inherit;\n background: #f8fafc;\n}\n\n.ak-gallery__cell:focus-visible {\n outline: 2px solid var(--ak-primary, #6366f1);\n outline-offset: -2px;\n}\n\n/* Faint download icon — always present, top-right corner of the image */\n.ak-message__image-dl-icon {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 26px;\n height: 26px;\n background: rgba(0, 0, 0, 0.28);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgba(255, 255, 255, 0.75);\n text-decoration: none;\n transition: background 0.15s, color 0.15s;\n}\n\n.ak-message__image-dl-icon:hover {\n background: rgba(0, 0, 0, 0.55);\n color: #ffffff;\n}\n\n/* Caption / text below the image, inside the same bubble */\n.ak-message__image-caption {\n padding: 8px 10px 8px;\n font-size: 14px;\n font-style: normal;\n color: var(--ak-text);\n line-height: 1.45;\n}\n\n/* User-uploaded image caption uses user bubble colors */\n.ak-message--user .ak-message__image-caption {\n color: rgba(255, 255, 255, 0.8);\n font-style: normal;\n}\n\n/* ── Typing indicator ────────────────────────────────────────── */\n.ak-typing {\n display: flex;\n align-items: center;\n gap: 5px;\n padding: 9px 12px;\n background: var(--ak-bot-bg);\n border-radius: 16px;\n border-bottom-left-radius: 4px;\n border: 1px solid var(--ak-border);\n align-self: flex-start;\n width: fit-content;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing__dot {\n width: 7px;\n height: 7px;\n background: var(--ak-text-muted);\n border-radius: 50%;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing__dot:nth-child(3) { animation-delay: 0.4s; }\n@keyframes ak-bounce {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }\n 30% { transform: translateY(-5px); opacity: 1; }\n}\n\n/* ── Init status (validating / error) ───────────────────────── */\n.ak-init-status {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 24px;\n}\n.ak-init-spinner {\n width: 28px;\n height: 28px;\n border: 3px solid var(--ak-border);\n border-top-color: var(--ak-accent);\n border-radius: 50%;\n animation: ak-spin 0.7s linear infinite;\n}\n@keyframes ak-spin {\n to { transform: rotate(360deg); }\n}\n.ak-init-status--error {\n justify-content: flex-start;\n}\n.ak-init-status--maintenance {\n padding: 28px 24px;\n}\n\n/* ── Composer ────────────────────────────────────────────────── */\n.ak-composer {\n position: relative; /* establishes positioning context for the attachment submenu */\n padding: 8px 12px 10px;\n border-top: 1px solid var(--ak-border);\n display: flex;\n flex-direction: column;\n gap: 8px;\n background: var(--ak-bg);\n flex-shrink: 0;\n}\n\n/* Hidden native file input */\n.ak-composer__file-input {\n display: none;\n}\n\n/* Unified input container — wraps +, textarea, send as one row */\n.ak-composer__input-wrap {\n display: flex;\n align-items: center;\n gap: 6px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 14px;\n padding: 5px 5px 5px 6px;\n transition: border-color 0.15s;\n}\n.ak-composer__input-wrap:focus-within {\n border-color: var(--ak-accent);\n}\n\n/* Attach button wrapper */\n.ak-composer__attach-wrap {\n flex-shrink: 0;\n}\n\n/* \"+\" attachment button — square with rounded corners */\n.ak-composer__attach {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--ak-text-muted);\n transition: color 0.15s, border-color 0.15s, background 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__attach:hover:not(:disabled) {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n}\n.ak-composer__attach--open {\n color: var(--ak-accent);\n border-color: var(--ak-accent);\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent);\n}\n.ak-composer__attach:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Attachment submenu — floats above the composer, positioned relative to .ak-composer */\n.ak-composer__attach-menu {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 12px;\n background: var(--ak-surface);\n border: 1px solid var(--ak-border);\n border-radius: 10px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n padding: 4px;\n min-width: 130px;\n z-index: 10;\n}\n\n/* Individual item inside the attachment submenu */\n.ak-composer__attach-menu-item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 10px;\n border: none;\n border-radius: 7px;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 13px;\n cursor: pointer;\n transition: background 0.12s;\n text-align: left;\n}\n.ak-composer__attach-menu-item:hover:not(:disabled) {\n background: var(--ak-bg);\n}\n.ak-composer__attach-menu-item:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Textarea — borderless, transparent, sits inside the container */\n.ak-composer__input {\n flex: 1;\n padding: 4px 6px;\n border: none;\n border-radius: 0;\n background: transparent;\n color: var(--ak-text);\n font-family: var(--ak-font);\n font-size: 14px;\n line-height: 1.45;\n resize: none;\n outline: none;\n min-height: 28px;\n max-height: 110px;\n overflow-y: auto;\n}\n.ak-composer__input::placeholder {\n color: var(--ak-text-muted);\n}\n\n/* Send button — square with rounded corners */\n.ak-composer__send {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n background: var(--ak-accent);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n transition: background 0.15s, opacity 0.15s;\n flex-shrink: 0;\n}\n.ak-composer__send:hover:not(:disabled) {\n background: var(--ak-accent-hover);\n}\n.ak-composer__send:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n/* Old photo button — hidden but keep so file-input trigger still works */\n.ak-composer__photo {\n display: none;\n}\n\n/* Image preview strip above the input row */\n.ak-composer__preview {\n display: flex;\n gap: 6px;\n padding: 0 2px;\n}\n.ak-composer__preview-wrap {\n position: relative;\n width: 60px;\n height: 60px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid var(--ak-border);\n flex-shrink: 0;\n}\n.ak-composer__preview-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n}\n.ak-composer__preview-remove {\n position: absolute;\n top: 3px;\n right: 3px;\n width: 18px;\n height: 18px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.55);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #ffffff;\n padding: 0;\n transition: background 0.15s;\n}\n.ak-composer__preview-remove:hover {\n background: rgba(0, 0, 0, 0.8);\n}\n\n/* ── Streaming cursor ────────────────────────────────────────── */\n.ak-cursor {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n margin-left: 4px;\n vertical-align: middle;\n}\n.ak-cursor__dot {\n display: inline-block;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0.6;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }\n\n/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item\n and .ak-progress__summary so dots → activity line → summary never reflow. */\n.ak-typing-row {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* One text line at the shared row metrics, so the dots occupy exactly the\n box the activity line and summary will occupy (border-box). */\n min-height: calc(0.76rem * 1.4 + 4px);\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-typing-row__dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--ak-bot-text);\n opacity: 0.5;\n animation: ak-bounce 1.3s infinite ease-in-out;\n}\n.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }\n.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }\n@media (prefers-reduced-motion: reduce) {\n .ak-typing-row__dot,\n .ak-cursor__dot,\n .ak-typing__dot,\n .ak-progress__item--active,\n .ak-agent-status__icon {\n animation: none;\n }\n}\n\n/* ── Markdown rendering ──────────────────────────────────────── */\n.ak-message__bubble--md {\n white-space: normal;\n min-width: 0;\n}\n.ak-message__bubble--md .ak-md-p {\n margin: 0 0 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-p:last-child {\n margin-bottom: 0;\n}\n/* Collapse margins between paragraph and following list */\n.ak-message__bubble--md .ak-md-p + .ak-md-ul,\n.ak-message__bubble--md .ak-md-p + .ak-md-ol {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1,\n.ak-message__bubble--md .ak-md-h2,\n.ak-message__bubble--md .ak-md-h3 {\n font-weight: 700;\n line-height: 1.3;\n margin: 0.6em 0 0.3em;\n}\n.ak-message__bubble--md .ak-md-h1:first-child,\n.ak-message__bubble--md .ak-md-h2:first-child,\n.ak-message__bubble--md .ak-md-h3:first-child {\n margin-top: 0;\n}\n.ak-message__bubble--md .ak-md-h1 { font-size: 1.12em; }\n.ak-message__bubble--md .ak-md-h2 { font-size: 1.04em; }\n.ak-message__bubble--md .ak-md-h3 { font-size: 0.97em; }\n.ak-message__bubble--md .ak-md-ul,\n.ak-message__bubble--md .ak-md-ol {\n padding-left: 1.4em;\n margin: 0.4em 0;\n}\n.ak-message__bubble--md .ak-md-ul li,\n.ak-message__bubble--md .ak-md-ol li {\n margin-bottom: 0.15em;\n}\n.ak-message__bubble--md .ak-md-pre-wrap {\n position: relative;\n margin: 0.4em 0;\n border-radius: 6px;\n overflow-x: auto;\n overflow-y: hidden;\n background: rgba(0, 0, 0, 0.08);\n max-width: 100%;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-wrap {\n background: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre-lang {\n display: block;\n padding: 3px 10px;\n font-size: 10px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.55;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n}\n.ak-message--user .ak-message__bubble--md .ak-md-pre-lang {\n border-bottom-color: rgba(255, 255, 255, 0.15);\n}\n.ak-message__bubble--md .ak-md-pre {\n margin: 0;\n padding: 8px 10px;\n font-size: 12px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n white-space: pre;\n box-sizing: border-box;\n}\n.ak-message__bubble--md .ak-md-code {\n display: block;\n font-family: inherit;\n font-size: inherit;\n}\n.ak-message__bubble--md .ak-md-ic {\n background: rgba(0, 0, 0, 0.08);\n border-radius: 3px;\n padding: 1px 5px;\n font-size: 0.87em;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-ic {\n background: rgba(255, 255, 255, 0.2);\n}\n.ak-message__bubble--md .ak-md-hr {\n border: none;\n border-top: 1px solid currentColor;\n opacity: 0.2;\n margin: 0.5em 0;\n}\n.ak-message__bubble--md a {\n color: var(--ak-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-message--user .ak-message__bubble--md a {\n color: rgba(255, 255, 255, 0.9);\n}\n.ak-message__bubble--md .ak-md-table {\n width: 100%;\n border-collapse: collapse;\n margin: 0.4em 0;\n font-size: 0.95em;\n line-height: 1.5;\n}\n.ak-message__bubble--md .ak-md-th {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 2px solid var(--ak-accent) !important;\n background: color-mix(in srgb, var(--ak-accent) 8%, transparent) !important;\n font-weight: 600;\n color: var(--ak-text) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-th {\n border-bottom-color: rgba(255, 255, 255, 0.5) !important;\n background: rgba(0, 0, 0, 0.25) !important;\n color: #ffffff !important;\n font-weight: 700;\n}\n.ak-message__bubble--md .ak-md-td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--ak-border) !important;\n color: var(--ak-text) !important;\n}\n.ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: color-mix(in srgb, var(--ak-surface), transparent 40%) !important;\n}\n.ak-message--user .ak-message__bubble--md .ak-md-td {\n color: #ffffff !important;\n border-bottom-color: rgba(255, 255, 255, 0.25) !important;\n}\n.ak-message--user .ak-message__bubble--md tr:nth-child(even) .ak-md-td {\n background: rgba(0, 0, 0, 0.15) !important;\n}\n\n/* ── Composer disclaimer ─────────────────────────────────────── */\n.ak-composer__disclaimer {\n font-size: 11px;\n color: var(--ak-text-muted);\n text-align: center;\n line-height: 1.4;\n}\n.ak-composer__disclaimer a {\n color: var(--ak-text-muted);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.ak-composer__disclaimer a:hover {\n color: var(--ak-accent);\n}\n\n/* ── Maintenance state ───────────────────────────────────────── */\n.ak-maintenance {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n max-width: 320px;\n padding: 8px 4px;\n animation: ak-maintenance-enter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;\n}\n.ak-maintenance__halo {\n position: absolute;\n top: -6px;\n left: 50%;\n width: 120px;\n height: 120px;\n transform: translateX(-50%);\n border-radius: 50%;\n background: radial-gradient(\n closest-side,\n var(--ak-maintenance-halo) 0%,\n transparent 72%\n );\n opacity: 0.22;\n filter: blur(4px);\n pointer-events: none;\n animation: ak-maintenance-pulse 2.8s ease-in-out infinite;\n}\n.ak-maintenance__icon {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n border-radius: 50%;\n background: var(--ak-maintenance-bg);\n color: var(--ak-maintenance-fg);\n border: 1px solid color-mix(in srgb, var(--ak-maintenance-halo) 40%, transparent);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n.ak-maintenance__title {\n margin-top: 16px;\n font-size: 15px;\n font-weight: 600;\n color: var(--ak-text);\n line-height: 1.3;\n letter-spacing: -0.01em;\n}\n.ak-maintenance__description {\n margin-top: 6px;\n font-size: 13px;\n color: var(--ak-text-muted);\n line-height: 1.5;\n max-width: 28ch;\n}\n\n@keyframes ak-maintenance-enter {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n@keyframes ak-maintenance-pulse {\n 0%, 100% { opacity: 0.18; transform: translateX(-50%) scale(1); }\n 50% { opacity: 0.32; transform: translateX(-50%) scale(1.06); }\n}\n@media (prefers-reduced-motion: reduce) {\n .ak-maintenance,\n .ak-maintenance__halo,\n .ak-maintenance__icon {\n animation: none;\n }\n}\n\n/* ── Error banner ────────────────────────────────────────────── */\n.ak-error {\n padding: 12px 16px;\n background: #fee2e2;\n color: #991b1b;\n font-size: 13px;\n border-top: 1px solid #fca5a5;\n text-align: left;\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: 10px;\n}\n\n.ak-error__icon {\n font-size: 16px;\n line-height: 1;\n flex-shrink: 0;\n margin-top: 1px;\n}\n\n.ak-error__content {\n flex: 1;\n}\n\n.ak-error__title {\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 4px 0;\n line-height: 1.3;\n}\n\n.ak-error__description {\n font-size: 13px;\n margin: 0 0 4px 0;\n line-height: 1.4;\n opacity: 0.9;\n}\n\n.ak-error__message {\n font-size: 13px;\n margin: 0;\n line-height: 1.4;\n opacity: 0.85;\n}\n\n/* Specific styling for origin restriction errors */\n.ak-error--origin {\n background: #fef3c7; /* Amber background instead of red for less scary appearance */\n color: #92400e; /* Amber text color */\n border-top: 1px solid #fbbf24;\n}\n\n/* ── Agent status indicator ──────────────────────────────────── */\n/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants\n see the tool status swap in without the surrounding box changing size. */\n.ak-agent-status {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin-bottom: 4px;\n padding: 2px 0;\n color: var(--ak-bot-text);\n font-size: 0.76rem;\n line-height: 1.4;\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-agent-status__icon {\n flex-shrink: 0;\n color: var(--ak-primary, #6366f1);\n animation: ak-sparkle-pulse 2.5s ease-in-out infinite;\n}\n.ak-agent-status__text {\n line-height: 1.4;\n}\n@keyframes ak-sparkle-pulse {\n 0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }\n 50% { opacity: 0.45; transform: scale(0.85) rotate(15deg); }\n}\n\n/* ── Progress block (tool execution / streaming chain) ───────── */\n.ak-progress {\n margin-bottom: 4px;\n max-width: 80%;\n}\n.ak-progress__block {\n display: inline-flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 12px;\n border-radius: 14px;\n background: var(--ak-bot-bg);\n border: 1px solid var(--ak-border);\n font-size: 0.8rem;\n color: var(--ak-bot-text);\n opacity: 0.85;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__header {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.ak-progress__label {\n font-weight: 600;\n font-size: 0.78rem;\n color: var(--ak-primary, #6366f1);\n}\n.ak-progress__toggle {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n padding: 1px 7px;\n border: 1px solid var(--ak-border);\n border-radius: 8px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.72rem;\n cursor: pointer;\n opacity: 0.65;\n transition: opacity 0.15s;\n}\n.ak-progress__toggle:hover { opacity: 0.9; }\n.ak-progress__toggle--collapsed {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 5px 10px;\n border: 1px solid var(--ak-border);\n border-radius: 12px;\n background: transparent;\n color: var(--ak-bot-text);\n font-size: 0.78rem;\n cursor: pointer;\n opacity: 0.55;\n transition: opacity 0.15s;\n margin-bottom: 4px;\n}\n.ak-progress__toggle--collapsed:hover { opacity: 0.85; }\n.ak-progress__text {\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n line-height: 1.4;\n margin: 0;\n}\n/* Active streaming state */\n.ak-progress__list {\n list-style: none;\n margin: 0 0 4px;\n padding: 0;\n}\n/* Bare row, not a pill — identical metrics to .ak-progress__summary so the\n live line and the post-turn \"Worked for Ns\" swap without a size change. */\n.ak-progress__item {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n line-height: 1.4;\n color: var(--ak-bot-text);\n opacity: 0.6;\n animation: ak-msg-in 0.15s ease-out;\n}\n.ak-progress__item--active {\n /* inherits base .ak-progress__item; subtle pulse to signal in-flight */\n animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;\n}\n@keyframes ak-active-pulse {\n 0%, 100% { opacity: 0.6; }\n 50% { opacity: 0.9; }\n}\n/* Claude-style step list (detailed mode) */\n.ak-progress__steps {\n list-style: none;\n margin: 0 0 4px;\n padding: 2px 0;\n}\n.ak-progress__step {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n line-height: 1.4;\n}\n.ak-progress__step--active {\n opacity: 0.9;\n}\n.ak-progress__step-text {\n min-width: 0;\n}\n.ak-progress__step-dur {\n opacity: 0.65;\n flex-shrink: 0;\n}\n.ak-progress__step-icon {\n flex-shrink: 0;\n opacity: 0.55;\n}\n.ak-progress__step-icon--fail {\n color: #ef4444;\n opacity: 0.9;\n}\n/* Post-turn summary row (\"Worked for Ns · N steps\") */\n.ak-progress__summary {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 0;\n margin: 0 0 4px;\n /* Shrink-to-fit as a column flex item would otherwise break \"Worked for 8.4s\"\n onto two lines, doubling the row height as the turn ends. */\n white-space: nowrap;\n border: none;\n background: transparent;\n font-size: 0.76rem;\n color: var(--ak-bot-text);\n opacity: 0.6;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.ak-progress__summary:hover { opacity: 0.85; }\n.ak-progress__summary--static {\n cursor: default;\n}\n.ak-progress__summary--static:hover { opacity: 0.6; }\n.ak-progress__spinner {\n display: inline-block;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--ak-border);\n border-top-color: var(--ak-primary, #6366f1);\n border-radius: 50%;\n flex-shrink: 0;\n animation: ak-spin 0.7s linear infinite;\n}\n\n/* ── Powered by hanging tab ──────────────────────────────────── */\n.ak-branding {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px 4px;\n background: var(--ak-bg);\n border: 1px solid var(--ak-border);\n border-top: none;\n border-radius: 0 0 8px 8px;\n margin-left: 16px;\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);\n}\n.ak-branding__logo {\n width: 11px;\n height: 11px;\n flex-shrink: 0;\n color: var(--ak-accent);\n opacity: 0.75;\n}\n.ak-branding__label {\n font-size: 9px;\n color: var(--ak-text-muted);\n opacity: 0.75;\n}\n.ak-branding__name {\n font-size: 9px;\n font-weight: 600;\n color: var(--ak-accent);\n opacity: 0.75;\n letter-spacing: -0.01em;\n}\n\n/* ── Mobile: full-viewport panel ─────────────────────────────── */\n@media (max-width: 639px) {\n @keyframes ak-panel-in-mobile {\n from { opacity: 0; transform: translateY(32px); }\n to { opacity: 1; transform: translateY(0); }\n }\n\n /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.\n Give it its own fixed position so it fills the viewport independently,\n bypassing the outer container's bottom/right offsets. */\n :host([data-open]) {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2147483647;\n pointer-events: none;\n }\n\n :host([data-open]) .ak-floating {\n width: 100%;\n height: 100%;\n align-items: stretch;\n gap: 0;\n }\n\n :host([data-open]) .ak-shell-wrap {\n flex: 1;\n min-height: 0;\n width: 100%;\n align-items: stretch;\n /* Launcher is hidden here — the negative offset would leave a dead strip. */\n margin-bottom: 0;\n }\n\n :host([data-open]) .ak-shell--floating {\n width: 100%;\n flex: 1;\n height: auto;\n border-radius: 0;\n box-shadow: none;\n border-left: none;\n border-right: none;\n border-top: none;\n }\n\n :host([data-open]) .ak-launcher {\n display: none;\n }\n\n :host([data-open]) .ak-shell-enter {\n animation: ak-panel-in-mobile 0.22s ease-out;\n }\n\n :host([data-open]) .ak-branding {\n display: none;\n }\n}\n";
5684
5800
  //#endregion
5685
5801
  //#region ../../packages/widget-ui/src/components/Header.tsx
5686
- function ma() {
5802
+ function Ea() {
5687
5803
  return /* @__PURE__ */ l("svg", {
5688
5804
  width: "16",
5689
5805
  height: "16",
@@ -5722,7 +5838,7 @@ function ma() {
5722
5838
  ]
5723
5839
  });
5724
5840
  }
5725
- function ha() {
5841
+ function Da() {
5726
5842
  return /* @__PURE__ */ l("svg", {
5727
5843
  width: "14",
5728
5844
  height: "14",
@@ -5744,7 +5860,7 @@ function ha() {
5744
5860
  })]
5745
5861
  });
5746
5862
  }
5747
- function ga() {
5863
+ function Oa() {
5748
5864
  return /* @__PURE__ */ l("svg", {
5749
5865
  width: "16",
5750
5866
  height: "16",
@@ -5757,7 +5873,7 @@ function ga() {
5757
5873
  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" })]
5758
5874
  });
5759
5875
  }
5760
- function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideClose: a = !1 }) {
5876
+ function ka({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideClose: a = !1 }) {
5761
5877
  let [s, u] = o(!1);
5762
5878
  return /* @__PURE__ */ l("div", {
5763
5879
  className: `ak-header${s ? " ak-header--confirming" : ""}`,
@@ -5772,7 +5888,7 @@ function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
5772
5888
  }) : /* @__PURE__ */ c("span", {
5773
5889
  className: "ak-header__bot-icon",
5774
5890
  "aria-hidden": "true",
5775
- children: /* @__PURE__ */ c(ma, {})
5891
+ children: /* @__PURE__ */ c(Ea, {})
5776
5892
  }),
5777
5893
  /* @__PURE__ */ l("div", {
5778
5894
  className: "ak-header__title-group",
@@ -5801,14 +5917,14 @@ function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
5801
5917
  "aria-label": "New conversation",
5802
5918
  type: "button",
5803
5919
  title: "Start a new conversation (Retains current conversation to memory)",
5804
- children: /* @__PURE__ */ c(ga, {})
5920
+ children: /* @__PURE__ */ c(Oa, {})
5805
5921
  }),
5806
5922
  !a && /* @__PURE__ */ c("button", {
5807
5923
  className: "ak-header__close",
5808
5924
  onClick: r,
5809
5925
  "aria-label": "Close chat",
5810
5926
  type: "button",
5811
- children: /* @__PURE__ */ c(ha, {})
5927
+ children: /* @__PURE__ */ c(Da, {})
5812
5928
  })
5813
5929
  ]
5814
5930
  })
@@ -5846,7 +5962,7 @@ function _a({ title: e, subtitle: t, avatarUrl: n, onClose: r, onReset: i, hideC
5846
5962
  }
5847
5963
  //#endregion
5848
5964
  //#region ../../packages/widget-ui/src/lib/safe-url.ts
5849
- function va(e) {
5965
+ function Aa(e) {
5850
5966
  if (!e) return null;
5851
5967
  let t = e.trim();
5852
5968
  if (!t) return null;
@@ -5861,12 +5977,12 @@ function va(e) {
5861
5977
  }
5862
5978
  //#endregion
5863
5979
  //#region ../../packages/widget-ui/src/lib/strip-latex.ts
5864
- function ya(e) {
5980
+ function ja(e) {
5865
5981
  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, "\n\n");
5866
5982
  }
5867
5983
  //#endregion
5868
5984
  //#region ../../packages/widget-ui/src/components/ProgressBlock.tsx
5869
- function ba(e) {
5985
+ function Ma(e) {
5870
5986
  let [, t] = o(0);
5871
5987
  r(() => {
5872
5988
  if (!e) return;
@@ -5874,8 +5990,8 @@ function ba(e) {
5874
5990
  return () => clearInterval(n);
5875
5991
  }, [e]);
5876
5992
  }
5877
- var xa = 800;
5878
- function Sa({ up: e }) {
5993
+ var Na = 800;
5994
+ function Pa({ up: e }) {
5879
5995
  return /* @__PURE__ */ c("svg", {
5880
5996
  width: "10",
5881
5997
  height: "10",
@@ -5889,7 +6005,7 @@ function Sa({ up: e }) {
5889
6005
  children: /* @__PURE__ */ c("polyline", { points: e ? "18 15 12 9 6 15" : "6 9 12 15 18 9" })
5890
6006
  });
5891
6007
  }
5892
- function Ca({ event: e, active: t }) {
6008
+ function Fa({ event: e, active: t }) {
5893
6009
  return t ? /* @__PURE__ */ c("span", {
5894
6010
  className: "ak-progress__spinner",
5895
6011
  "aria-hidden": "true"
@@ -5917,18 +6033,18 @@ function Ca({ event: e, active: t }) {
5917
6033
  })] }) : /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
5918
6034
  });
5919
6035
  }
5920
- function wa({ events: e, live: t, answerStartedAtMs: n }) {
5921
- ba(t && !n && e.some((e) => e.status === "active"));
6036
+ function Ia({ events: e, live: t, answerStartedAtMs: n }) {
6037
+ Ma(t && !n && e.some((e) => e.status === "active"));
5922
6038
  let r = n ?? Date.now(), i = e[0]?.startedAtMs, a = e.reduce((e, t, n) => t.status === "active" ? n : e, -1);
5923
6039
  return /* @__PURE__ */ c("ul", {
5924
6040
  className: "ak-progress__steps",
5925
6041
  role: "list",
5926
6042
  children: e.map((e, n) => {
5927
- let o = t && e.status === "active", s = o && n === a ? Hi(i ? r - i : void 0) : o ? null : Hi(e.durationMs);
6043
+ let o = t && e.status === "active", s = o && n === a ? $i(i ? r - i : void 0) : o ? null : $i(e.durationMs);
5928
6044
  return /* @__PURE__ */ l("li", {
5929
6045
  className: o ? "ak-progress__step ak-progress__step--active" : "ak-progress__step",
5930
6046
  children: [
5931
- /* @__PURE__ */ c(Ca, {
6047
+ /* @__PURE__ */ c(Fa, {
5932
6048
  event: e,
5933
6049
  active: o
5934
6050
  }),
@@ -5945,11 +6061,11 @@ function wa({ events: e, live: t, answerStartedAtMs: n }) {
5945
6061
  })
5946
6062
  });
5947
6063
  }
5948
- function Ta({ events: e, answerStartedAtMs: t }) {
6064
+ function La({ events: e, answerStartedAtMs: t }) {
5949
6065
  let [n, i] = o(0), a = Math.min(n, e.length - 1), s = a < e.length - 1;
5950
6066
  r(() => {
5951
6067
  if (!s) return;
5952
- let t = setTimeout(() => i((t) => Math.min(t + 1, e.length - 1)), xa);
6068
+ let t = setTimeout(() => i((t) => Math.min(t + 1, e.length - 1)), Na);
5953
6069
  return () => clearTimeout(t);
5954
6070
  }, [
5955
6071
  s,
@@ -5957,15 +6073,15 @@ function Ta({ events: e, answerStartedAtMs: t }) {
5957
6073
  e.length
5958
6074
  ]);
5959
6075
  let u = e[a], d = !s && u.status === "done";
5960
- ba(!d && !t);
5961
- let f = e[0]?.startedAtMs, p = d ? null : Hi(f ? (t ?? Date.now()) - f : void 0);
6076
+ Ma(!d && !t);
6077
+ let f = e[0]?.startedAtMs, p = d ? null : $i(f ? (t ?? Date.now()) - f : void 0);
5962
6078
  return /* @__PURE__ */ c("ul", {
5963
6079
  className: "ak-progress__list",
5964
6080
  role: "list",
5965
6081
  children: /* @__PURE__ */ l("li", {
5966
6082
  className: "ak-progress__item ak-progress__item--active",
5967
6083
  children: [
5968
- d ? /* @__PURE__ */ c(Ca, {
6084
+ d ? /* @__PURE__ */ c(Fa, {
5969
6085
  event: u,
5970
6086
  active: !1
5971
6087
  }) : /* @__PURE__ */ c("span", {
@@ -5984,7 +6100,7 @@ function Ta({ events: e, answerStartedAtMs: t }) {
5984
6100
  })
5985
6101
  });
5986
6102
  }
5987
- function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1, turnMeta: a, answerStartedAtMs: s }) {
6103
+ function Ra({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1, turnMeta: a, answerStartedAtMs: s }) {
5988
6104
  let [u, d] = o(!n);
5989
6105
  r(() => {
5990
6106
  i && d(!n);
@@ -6003,15 +6119,15 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
6003
6119
  children: e
6004
6120
  })]
6005
6121
  })
6006
- }) : null : f === "detailed" ? /* @__PURE__ */ c(wa, {
6122
+ }) : null : f === "detailed" ? /* @__PURE__ */ c(Ia, {
6007
6123
  events: t,
6008
6124
  live: !0,
6009
6125
  answerStartedAtMs: s
6010
- }) : /* @__PURE__ */ c(Ta, {
6126
+ }) : /* @__PURE__ */ c(La, {
6011
6127
  events: t,
6012
6128
  answerStartedAtMs: s
6013
6129
  });
6014
- let p = Hi(a?.totalMs), m = p ? `Worked for ${p}` : "Finished working";
6130
+ let p = $i(a?.totalMs), m = p ? `Worked for ${p}` : "Finished working";
6015
6131
  return f === "detailed" && t.length > 0 ? /* @__PURE__ */ l("div", {
6016
6132
  className: "ak-progress",
6017
6133
  children: [/* @__PURE__ */ l("button", {
@@ -6021,7 +6137,7 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
6021
6137
  "aria-expanded": u,
6022
6138
  "aria-label": u ? "Hide working steps" : "Show working steps",
6023
6139
  children: [
6024
- /* @__PURE__ */ c(Ca, {
6140
+ /* @__PURE__ */ c(Fa, {
6025
6141
  event: {
6026
6142
  stage: "",
6027
6143
  text: "",
@@ -6040,9 +6156,9 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
6040
6156
  t.length === 1 ? "" : "s"
6041
6157
  ]
6042
6158
  }),
6043
- /* @__PURE__ */ c(Sa, { up: u })
6159
+ /* @__PURE__ */ c(Pa, { up: u })
6044
6160
  ]
6045
- }), u && /* @__PURE__ */ c(wa, {
6161
+ }), u && /* @__PURE__ */ c(Ia, {
6046
6162
  events: t,
6047
6163
  live: !1
6048
6164
  })]
@@ -6050,7 +6166,7 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
6050
6166
  className: "ak-progress",
6051
6167
  children: /* @__PURE__ */ l("p", {
6052
6168
  className: "ak-progress__summary ak-progress__summary--static",
6053
- children: [/* @__PURE__ */ c(Ca, {
6169
+ children: [/* @__PURE__ */ c(Fa, {
6054
6170
  event: {
6055
6171
  stage: "",
6056
6172
  text: "",
@@ -6064,7 +6180,7 @@ function Ea({ ackText: e, events: t = [], collapsed: n = !0, isComplete: i = !1,
6064
6180
  }
6065
6181
  //#endregion
6066
6182
  //#region ../../packages/widget-ui/src/components/MessageBubble.tsx
6067
- function Da() {
6183
+ function za() {
6068
6184
  return /* @__PURE__ */ c("svg", {
6069
6185
  className: "ak-agent-status__icon",
6070
6186
  width: "13",
@@ -6075,18 +6191,18 @@ function Da() {
6075
6191
  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" })
6076
6192
  });
6077
6193
  }
6078
- function Oa({ status: e }) {
6194
+ function Ba({ status: e }) {
6079
6195
  return /* @__PURE__ */ l("div", {
6080
6196
  className: "ak-agent-status",
6081
6197
  role: "status",
6082
6198
  "aria-live": "polite",
6083
- children: [/* @__PURE__ */ c(Da, {}), /* @__PURE__ */ c("span", {
6199
+ children: [/* @__PURE__ */ c(za, {}), /* @__PURE__ */ c("span", {
6084
6200
  className: "ak-agent-status__text",
6085
6201
  children: e
6086
6202
  })]
6087
6203
  });
6088
6204
  }
6089
- function ka({ messageId: e, images: t, onCellClick: n }) {
6205
+ function Va({ messageId: e, images: t, onCellClick: n }) {
6090
6206
  if (t.length === 0) return null;
6091
6207
  let r = t.length;
6092
6208
  if (r === 1) {
@@ -6104,7 +6220,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
6104
6220
  className: "ak-gallery__img ak-gallery__img--contain"
6105
6221
  })
6106
6222
  }), /* @__PURE__ */ c("a", {
6107
- href: va(e.downloadHref) ?? void 0,
6223
+ href: Aa(e.downloadHref) ?? void 0,
6108
6224
  download: !0,
6109
6225
  className: "ak-message__image-dl-icon",
6110
6226
  title: "Download image",
@@ -6134,7 +6250,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
6134
6250
  }
6135
6251
  if (r === 2) return /* @__PURE__ */ c("div", {
6136
6252
  className: "ak-gallery ak-gallery--two",
6137
- children: t.map((t, r) => /* @__PURE__ */ c(Aa, {
6253
+ children: t.map((t, r) => /* @__PURE__ */ c(Ha, {
6138
6254
  src: t.src,
6139
6255
  alt: t.alt,
6140
6256
  onClick: () => n(r)
@@ -6142,17 +6258,17 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
6142
6258
  });
6143
6259
  if (r === 3) return /* @__PURE__ */ l("div", {
6144
6260
  className: "ak-gallery ak-gallery--three",
6145
- children: [/* @__PURE__ */ c(Aa, {
6261
+ children: [/* @__PURE__ */ c(Ha, {
6146
6262
  src: t[0].src,
6147
6263
  alt: t[0].alt,
6148
6264
  onClick: () => n(0)
6149
6265
  }, t[0].key ?? `${e}-0`), /* @__PURE__ */ l("div", {
6150
6266
  className: "ak-gallery__col",
6151
- children: [/* @__PURE__ */ c(Aa, {
6267
+ children: [/* @__PURE__ */ c(Ha, {
6152
6268
  src: t[1].src,
6153
6269
  alt: t[1].alt,
6154
6270
  onClick: () => n(1)
6155
- }, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(Aa, {
6271
+ }, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(Ha, {
6156
6272
  src: t[2].src,
6157
6273
  alt: t[2].alt,
6158
6274
  onClick: () => n(2)
@@ -6164,7 +6280,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
6164
6280
  className: "ak-gallery ak-gallery--grid",
6165
6281
  children: i.map((t, r) => {
6166
6282
  let o = r === i.length - 1;
6167
- return /* @__PURE__ */ c(Aa, {
6283
+ return /* @__PURE__ */ c(Ha, {
6168
6284
  src: t.src,
6169
6285
  alt: t.alt,
6170
6286
  overlayCount: o && a > 0 ? a : 0,
@@ -6173,7 +6289,7 @@ function ka({ messageId: e, images: t, onCellClick: n }) {
6173
6289
  })
6174
6290
  });
6175
6291
  }
6176
- function Aa({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
6292
+ function Ha({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
6177
6293
  return /* @__PURE__ */ l("button", {
6178
6294
  type: "button",
6179
6295
  onClick: r,
@@ -6190,7 +6306,7 @@ function Aa({ src: e, alt: t, overlayCount: n = 0, onClick: r }) {
6190
6306
  })]
6191
6307
  });
6192
6308
  }
6193
- function ja({ images: e, index: t, onClose: n, onIndexChange: i }) {
6309
+ function Ua({ images: e, index: t, onClose: n, onIndexChange: i }) {
6194
6310
  let a = t !== null, o = a && t !== null ? Math.min(Math.max(0, t), e.length - 1) : 0, u = a ? e[o] : null;
6195
6311
  return r(() => {
6196
6312
  if (!a) return;
@@ -6224,7 +6340,7 @@ function ja({ images: e, index: t, onClose: n, onIndexChange: i }) {
6224
6340
  ]
6225
6341
  }),
6226
6342
  /* @__PURE__ */ c("a", {
6227
- href: va(u.downloadHref) ?? void 0,
6343
+ href: Aa(u.downloadHref) ?? void 0,
6228
6344
  download: !0,
6229
6345
  target: "_blank",
6230
6346
  rel: "noopener noreferrer",
@@ -6328,7 +6444,7 @@ function ja({ images: e, index: t, onClose: n, onIndexChange: i }) {
6328
6444
  ]
6329
6445
  });
6330
6446
  }
6331
- function Ma({ url: e, mimeType: t, fileName: n }) {
6447
+ function Wa({ url: e, mimeType: t, fileName: n }) {
6332
6448
  let r = (() => {
6333
6449
  if (n) return n;
6334
6450
  try {
@@ -6354,7 +6470,7 @@ function Ma({ url: e, mimeType: t, fileName: n }) {
6354
6470
  label: i || "FILE"
6355
6471
  };
6356
6472
  return /* @__PURE__ */ l("a", {
6357
- href: va(e) ?? void 0,
6473
+ href: Aa(e) ?? void 0,
6358
6474
  target: "_blank",
6359
6475
  rel: "noopener noreferrer",
6360
6476
  className: "ak-file-chip",
@@ -6385,7 +6501,7 @@ function Ma({ url: e, mimeType: t, fileName: n }) {
6385
6501
  })]
6386
6502
  });
6387
6503
  }
6388
- function Na(e) {
6504
+ function Ga(e) {
6389
6505
  try {
6390
6506
  return new Date(e).toLocaleTimeString([], {
6391
6507
  hour: "2-digit",
@@ -6395,12 +6511,12 @@ function Na(e) {
6395
6511
  return "";
6396
6512
  }
6397
6513
  }
6398
- var Pa = /(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;
6514
+ var Ka = /(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;
6399
6515
  function $(e) {
6400
6516
  let t = [], n = 0, r = 0;
6401
- Pa.lastIndex = 0;
6517
+ Ka.lastIndex = 0;
6402
6518
  let i;
6403
- for (; (i = Pa.exec(e)) !== null;) {
6519
+ for (; (i = Ka.exec(e)) !== null;) {
6404
6520
  i.index > n && t.push(e.slice(n, i.index));
6405
6521
  let a = i[0];
6406
6522
  if (a.startsWith("`")) t.push(/* @__PURE__ */ c("code", {
@@ -6410,7 +6526,7 @@ function $(e) {
6410
6526
  else if (a.startsWith("**")) t.push(/* @__PURE__ */ c("strong", { children: a.slice(2, -2) }, r++));
6411
6527
  else if (a.startsWith("*")) t.push(/* @__PURE__ */ c("em", { children: a.slice(1, -1) }, r++));
6412
6528
  else if (a.startsWith("![")) {
6413
- let e = a.match(/!\[([^\]]*)\]\(([^)]+)\)/), n = va(e?.[2]);
6529
+ let e = a.match(/!\[([^\]]*)\]\(([^)]+)\)/), n = Aa(e?.[2]);
6414
6530
  e && n ? t.push(/* @__PURE__ */ c("a", {
6415
6531
  href: n,
6416
6532
  target: "_blank",
@@ -6418,7 +6534,7 @@ function $(e) {
6418
6534
  children: e[1] || "image"
6419
6535
  }, r++)) : e && t.push(e[1] || "image");
6420
6536
  } else {
6421
- let e = a.match(/\[(.+?)\]\((.+?)\)/), n = va(e?.[2]);
6537
+ let e = a.match(/\[(.+?)\]\((.+?)\)/), n = Aa(e?.[2]);
6422
6538
  e && n ? t.push(/* @__PURE__ */ c("a", {
6423
6539
  href: n,
6424
6540
  target: "_blank",
@@ -6430,8 +6546,8 @@ function $(e) {
6430
6546
  }
6431
6547
  return n < e.length && t.push(e.slice(n)), t;
6432
6548
  }
6433
- function Fa(e) {
6434
- e = ya(e);
6549
+ function qa(e) {
6550
+ e = ja(e);
6435
6551
  let t = e.split("\n"), n = [], r = 0, i = 0;
6436
6552
  for (; r < t.length;) {
6437
6553
  let e = t[r], a = e.match(/^(\s*)```/);
@@ -6600,7 +6716,7 @@ function Fa(e) {
6600
6716
  }
6601
6717
  return /* @__PURE__ */ c(s, { children: n });
6602
6718
  }
6603
- function Ia({ message: e }) {
6719
+ function Ja({ message: e }) {
6604
6720
  let [t, n] = o(null), [r, i] = o(null), a = e.role === "user", s = e.status === "error", u = e.status === "streaming", d = !!(e.images && e.images.length > 0), f = !!(e.documents && e.documents.length > 0), p = (() => {
6605
6721
  if (!a) return [];
6606
6722
  let t = (e.uploadedAttachments ?? []).filter((e) => e.kind === "image").map((e) => ({
@@ -6620,7 +6736,7 @@ function Ia({ message: e }) {
6620
6736
  ].filter(Boolean).join(" "), w = x ? e.senderDisplay?.trim() || "Operator" : null, T = w ? w.charAt(0).toUpperCase() : "", E = /* @__PURE__ */ l("div", {
6621
6737
  className: C,
6622
6738
  children: [
6623
- h && /* @__PURE__ */ c(ka, {
6739
+ h && /* @__PURE__ */ c(Va, {
6624
6740
  messageId: `${e.id}-up`,
6625
6741
  images: p.map((e) => ({
6626
6742
  src: e.url,
@@ -6631,13 +6747,13 @@ function Ia({ message: e }) {
6631
6747
  }),
6632
6748
  g && /* @__PURE__ */ c("div", {
6633
6749
  className: "ak-message__files",
6634
- children: m.map((t, n) => /* @__PURE__ */ c(Ma, {
6750
+ children: m.map((t, n) => /* @__PURE__ */ c(Wa, {
6635
6751
  url: t.url,
6636
6752
  mimeType: t.mimeType,
6637
6753
  fileName: t.fileName
6638
6754
  }, `${e.id}-up-file-${n}`))
6639
6755
  }),
6640
- d && /* @__PURE__ */ c(ka, {
6756
+ d && /* @__PURE__ */ c(Va, {
6641
6757
  messageId: `${e.id}-asst`,
6642
6758
  images: e.images.map((e, t) => {
6643
6759
  let n = e.url ?? (e.base64 ? `data:${e.mimeType};base64,${e.base64}` : null);
@@ -6652,7 +6768,7 @@ function Ia({ message: e }) {
6652
6768
  }),
6653
6769
  f && /* @__PURE__ */ c("div", {
6654
6770
  className: "ak-message__files",
6655
- children: e.documents.map((t, n) => t.url ? /* @__PURE__ */ c(Ma, {
6771
+ children: e.documents.map((t, n) => t.url ? /* @__PURE__ */ c(Wa, {
6656
6772
  url: t.url,
6657
6773
  mimeType: t.mimeType,
6658
6774
  fileName: t.fileName
@@ -6660,7 +6776,7 @@ function Ia({ message: e }) {
6660
6776
  }),
6661
6777
  e.content && /* @__PURE__ */ l("div", {
6662
6778
  className: _ ? "ak-message__image-caption" : void 0,
6663
- children: [b ? Fa(e.content) : e.content, u && /* @__PURE__ */ l("span", {
6779
+ children: [b ? qa(e.content) : e.content, u && /* @__PURE__ */ l("span", {
6664
6780
  className: "ak-cursor",
6665
6781
  "aria-hidden": "true",
6666
6782
  children: [
@@ -6672,14 +6788,14 @@ function Ia({ message: e }) {
6672
6788
  }),
6673
6789
  /* @__PURE__ */ c("span", {
6674
6790
  className: "ak-message__time",
6675
- children: Na(e.createdAt)
6791
+ children: Ga(e.createdAt)
6676
6792
  })
6677
6793
  ]
6678
6794
  }), D = !!e.content || _ || g || f || !u && !e.toolStatus;
6679
6795
  return /* @__PURE__ */ l("div", {
6680
6796
  className: `ak-message ${S}`,
6681
6797
  children: [
6682
- !a && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Ea, {
6798
+ !a && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Ra, {
6683
6799
  ackText: e.ackText,
6684
6800
  events: e.progressEvents,
6685
6801
  collapsed: e.progressCollapsed,
@@ -6697,7 +6813,7 @@ function Ia({ message: e }) {
6697
6813
  /* @__PURE__ */ c("span", { className: "ak-typing-row__dot" })
6698
6814
  ]
6699
6815
  }),
6700
- !a && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Oa, { status: e.toolStatus }),
6816
+ !a && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Ba, { status: e.toolStatus }),
6701
6817
  x && /* @__PURE__ */ l("span", {
6702
6818
  className: "ak-message__sender-label",
6703
6819
  children: [/* @__PURE__ */ c("span", {
@@ -6710,7 +6826,7 @@ function Ia({ message: e }) {
6710
6826
  })]
6711
6827
  }),
6712
6828
  D && E,
6713
- p.length > 0 && /* @__PURE__ */ c(ja, {
6829
+ p.length > 0 && /* @__PURE__ */ c(Ua, {
6714
6830
  images: p.map((e) => ({
6715
6831
  src: e.url,
6716
6832
  alt: e.fileName ?? "Uploaded image",
@@ -6720,7 +6836,7 @@ function Ia({ message: e }) {
6720
6836
  onClose: () => n(null),
6721
6837
  onIndexChange: n
6722
6838
  }),
6723
- d && /* @__PURE__ */ c(ja, {
6839
+ d && /* @__PURE__ */ c(Ua, {
6724
6840
  images: e.images.map((e) => {
6725
6841
  let t = e.url ?? (e.base64 ? `data:${e.mimeType};base64,${e.base64}` : null);
6726
6842
  return t ? {
@@ -6738,7 +6854,7 @@ function Ia({ message: e }) {
6738
6854
  }
6739
6855
  //#endregion
6740
6856
  //#region ../../packages/widget-ui/src/components/TypingIndicator.tsx
6741
- function La() {
6857
+ function Ya() {
6742
6858
  return /* @__PURE__ */ l("div", {
6743
6859
  className: "ak-typing",
6744
6860
  "aria-label": "Assistant is typing",
@@ -6751,7 +6867,7 @@ function La() {
6751
6867
  }
6752
6868
  //#endregion
6753
6869
  //#region ../../packages/widget-ui/src/components/MessageList.tsx
6754
- function Ra(e, t) {
6870
+ function Xa(e, t) {
6755
6871
  let n = [], r = null;
6756
6872
  for (let i of e) {
6757
6873
  if (i.role === "assistant") {
@@ -6769,8 +6885,8 @@ function Ra(e, t) {
6769
6885
  }
6770
6886
  return n;
6771
6887
  }
6772
- function za({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }) {
6773
- let o = a(null), s = a(null), u = a(!0), d = i(() => Ra(e, n), [e, n]);
6888
+ function Za({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }) {
6889
+ let o = a(null), s = a(null), u = a(!0), d = i(() => Xa(e, n), [e, n]);
6774
6890
  return r(() => {
6775
6891
  if (!(o.current?.parentElement ?? o.current)) return;
6776
6892
  let e = (e) => {
@@ -6798,15 +6914,15 @@ function za({ messages: e, isLoading: t, operatorFallbackLabel: n = "Operator" }
6798
6914
  className: "ak-handoff-divider__label",
6799
6915
  children: e.label
6800
6916
  })
6801
- }, e.id) : /* @__PURE__ */ c(Ia, { message: e.message }, e.message.id)),
6802
- t && !e.some((e) => e.status === "streaming") && /* @__PURE__ */ c(La, {}),
6917
+ }, e.id) : /* @__PURE__ */ c(Ja, { message: e.message }, e.message.id)),
6918
+ t && !e.some((e) => e.status === "streaming") && /* @__PURE__ */ c(Ya, {}),
6803
6919
  /* @__PURE__ */ c("div", { ref: s })
6804
6920
  ]
6805
6921
  });
6806
6922
  }
6807
6923
  //#endregion
6808
6924
  //#region ../../packages/widget-ui/src/components/EmptyState.tsx
6809
- function Ba() {
6925
+ function Qa() {
6810
6926
  return /* @__PURE__ */ l("svg", {
6811
6927
  width: "30",
6812
6928
  height: "30",
@@ -6846,7 +6962,7 @@ function Ba() {
6846
6962
  ]
6847
6963
  });
6848
6964
  }
6849
- function Va({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onSelect: i }) {
6965
+ function $a({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onSelect: i }) {
6850
6966
  let a = (n ?? []).filter((e) => (e.title ?? "").trim().length > 0);
6851
6967
  return /* @__PURE__ */ l("div", {
6852
6968
  className: "ak-empty-state",
@@ -6869,7 +6985,7 @@ function Va({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
6869
6985
  }) : /* @__PURE__ */ c("span", {
6870
6986
  className: "ak-empty-state__bot-icon",
6871
6987
  "aria-hidden": "true",
6872
- children: /* @__PURE__ */ c(Ba, {})
6988
+ children: /* @__PURE__ */ c(Qa, {})
6873
6989
  })
6874
6990
  }),
6875
6991
  /* @__PURE__ */ c("p", {
@@ -6902,8 +7018,8 @@ function Va({ title: e, description: t, suggestedQuestions: n, avatarUrl: r, onS
6902
7018
  }
6903
7019
  //#endregion
6904
7020
  //#region ../../packages/widget-ui/src/components/Composer.tsx
6905
- var Ha = "https://klicforge.ai/privacy-policy", Ua = "https://klicforge.ai/terms-of-service";
6906
- function Wa() {
7021
+ var eo = "https://klicforge.ai/privacy-policy", to = "https://klicforge.ai/terms-of-service";
7022
+ function no() {
6907
7023
  return /* @__PURE__ */ l("svg", {
6908
7024
  width: "16",
6909
7025
  height: "16",
@@ -6921,7 +7037,7 @@ function Wa() {
6921
7037
  }), /* @__PURE__ */ c("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })]
6922
7038
  });
6923
7039
  }
6924
- function Ga() {
7040
+ function ro() {
6925
7041
  return /* @__PURE__ */ l("svg", {
6926
7042
  width: "14",
6927
7043
  height: "14",
@@ -6943,7 +7059,7 @@ function Ga() {
6943
7059
  })]
6944
7060
  });
6945
7061
  }
6946
- function Ka() {
7062
+ function io() {
6947
7063
  return /* @__PURE__ */ l("svg", {
6948
7064
  width: "14",
6949
7065
  height: "14",
@@ -6960,7 +7076,7 @@ function Ka() {
6960
7076
  })]
6961
7077
  });
6962
7078
  }
6963
- function qa() {
7079
+ function ao() {
6964
7080
  return /* @__PURE__ */ l("svg", {
6965
7081
  width: "14",
6966
7082
  height: "14",
@@ -6973,7 +7089,7 @@ function qa() {
6973
7089
  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" })]
6974
7090
  });
6975
7091
  }
6976
- function Ja() {
7092
+ function oo() {
6977
7093
  return /* @__PURE__ */ l("svg", {
6978
7094
  width: "10",
6979
7095
  height: "10",
@@ -6996,31 +7112,31 @@ function Ja() {
6996
7112
  })]
6997
7113
  });
6998
7114
  }
6999
- var Ya = [
7115
+ var so = [
7000
7116
  "application/pdf",
7001
7117
  "text/markdown",
7002
7118
  "text/plain",
7003
7119
  "text/csv"
7004
- ], Xa = [
7120
+ ], co = [
7005
7121
  ".pdf",
7006
7122
  ".md",
7007
7123
  ".txt",
7008
7124
  ".csv"
7009
- ], Za = [...Xa, ...Ya].join(","), Qa = [
7125
+ ], lo = [...co, ...so].join(","), uo = [
7010
7126
  "image/jpeg",
7011
7127
  "image/png",
7012
7128
  "image/gif",
7013
7129
  "image/webp"
7014
- ], $a = Qa.join(",");
7015
- function eo(e) {
7016
- if (Ya.includes(e.type)) return !0;
7130
+ ], fo = uo.join(",");
7131
+ function po(e) {
7132
+ if (so.includes(e.type)) return !0;
7017
7133
  let t = e.name.toLowerCase();
7018
- return Xa.some((e) => t.endsWith(e));
7134
+ return co.some((e) => t.endsWith(e));
7019
7135
  }
7020
- function to(e) {
7021
- return Qa.includes(e.type);
7136
+ function mo(e) {
7137
+ return uo.includes(e.type);
7022
7138
  }
7023
- function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…", photoSendingEnabled: d = !1, fileUploadEnabled: f = !1, attachmentMaxCount: p = 5, attachmentMaxFileSizeMb: m = 1 }) {
7139
+ function ho({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…", photoSendingEnabled: d = !1, fileUploadEnabled: f = !1, attachmentMaxCount: p = 5, attachmentMaxFileSizeMb: m = 1 }) {
7024
7140
  let [h, g] = o(""), [_, v] = o([]), [y, b] = o(/* @__PURE__ */ new Map()), [x, S] = o(!1), C = a(null), w = a(null), T = a(null), E = a(null), D = a(null), O = d || f, k = i(() => m * 1024 * 1024, [m]);
7025
7141
  r(() => () => {
7026
7142
  y.forEach((e) => URL.revokeObjectURL(e));
@@ -7068,11 +7184,11 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7068
7184
  if (e.length === 0) return;
7069
7185
  let n = [], r = [];
7070
7186
  for (let i of e) {
7071
- if (t === "image" && !to(i)) {
7187
+ if (t === "image" && !mo(i)) {
7072
7188
  r.push(`${i.name} (image type not supported)`);
7073
7189
  continue;
7074
7190
  }
7075
- if (t === "file" && !eo(i)) {
7191
+ if (t === "file" && !po(i)) {
7076
7192
  r.push(`${i.name} (file type not supported)`);
7077
7193
  continue;
7078
7194
  }
@@ -7122,14 +7238,14 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7122
7238
  type: "button",
7123
7239
  role: "menuitem",
7124
7240
  disabled: t,
7125
- children: [/* @__PURE__ */ c(Ka, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
7241
+ children: [/* @__PURE__ */ c(io, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
7126
7242
  }), f && /* @__PURE__ */ l("button", {
7127
7243
  className: "ak-composer__attach-menu-item",
7128
7244
  onClick: se,
7129
7245
  type: "button",
7130
7246
  role: "menuitem",
7131
7247
  disabled: t,
7132
- children: [/* @__PURE__ */ c(qa, {}), /* @__PURE__ */ c("span", { children: "File" })]
7248
+ children: [/* @__PURE__ */ c(ao, {}), /* @__PURE__ */ c("span", { children: "File" })]
7133
7249
  })]
7134
7250
  }),
7135
7251
  _.length > 0 && /* @__PURE__ */ c("div", {
@@ -7152,7 +7268,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7152
7268
  type: "button",
7153
7269
  "aria-label": `Remove ${e.file.name}`,
7154
7270
  disabled: t,
7155
- children: /* @__PURE__ */ c(Ja, {})
7271
+ children: /* @__PURE__ */ c(oo, {})
7156
7272
  })]
7157
7273
  }, r);
7158
7274
  }
@@ -7160,7 +7276,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7160
7276
  className: "ak-composer__file-chip",
7161
7277
  role: "listitem",
7162
7278
  children: [
7163
- /* @__PURE__ */ c(qa, {}),
7279
+ /* @__PURE__ */ c(ao, {}),
7164
7280
  /* @__PURE__ */ c("span", {
7165
7281
  className: "ak-composer__file-chip-name",
7166
7282
  title: e.file.name,
@@ -7172,7 +7288,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7172
7288
  type: "button",
7173
7289
  "aria-label": `Remove ${e.file.name}`,
7174
7290
  disabled: t,
7175
- children: /* @__PURE__ */ c(Ja, {})
7291
+ children: /* @__PURE__ */ c(oo, {})
7176
7292
  })
7177
7293
  ]
7178
7294
  }, r);
@@ -7186,7 +7302,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7186
7302
  ref: w,
7187
7303
  type: "file",
7188
7304
  multiple: !0,
7189
- accept: $a,
7305
+ accept: fo,
7190
7306
  className: "ak-composer__file-input",
7191
7307
  onChange: ie,
7192
7308
  disabled: t,
@@ -7196,7 +7312,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7196
7312
  ref: T,
7197
7313
  type: "file",
7198
7314
  multiple: !0,
7199
- accept: Za,
7315
+ accept: lo,
7200
7316
  className: "ak-composer__file-input",
7201
7317
  onChange: ae,
7202
7318
  disabled: t,
@@ -7213,7 +7329,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7213
7329
  "aria-haspopup": "true",
7214
7330
  "aria-expanded": x,
7215
7331
  type: "button",
7216
- children: /* @__PURE__ */ c(Ga, {})
7332
+ children: /* @__PURE__ */ c(ro, {})
7217
7333
  })
7218
7334
  })
7219
7335
  ] }),
@@ -7234,7 +7350,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7234
7350
  disabled: !ce,
7235
7351
  "aria-label": "Send message",
7236
7352
  type: "button",
7237
- children: /* @__PURE__ */ c(Wa, {})
7353
+ children: /* @__PURE__ */ c(no, {})
7238
7354
  })
7239
7355
  ]
7240
7356
  }),
@@ -7244,7 +7360,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7244
7360
  "By chatting you agree to our",
7245
7361
  " ",
7246
7362
  /* @__PURE__ */ c("a", {
7247
- href: Ha,
7363
+ href: eo,
7248
7364
  target: "_blank",
7249
7365
  rel: "noopener noreferrer",
7250
7366
  children: "Privacy Policy"
@@ -7253,7 +7369,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7253
7369
  "and",
7254
7370
  " ",
7255
7371
  /* @__PURE__ */ c("a", {
7256
- href: Ua,
7372
+ href: to,
7257
7373
  target: "_blank",
7258
7374
  rel: "noopener noreferrer",
7259
7375
  children: "Terms of Service"
@@ -7267,7 +7383,7 @@ function no({ onSend: e, disabled: t = !1, placeholder: u = "Type a message…",
7267
7383
  }
7268
7384
  //#endregion
7269
7385
  //#region ../../packages/widget-ui/src/components/ErrorState.tsx
7270
- function ro({ message: e }) {
7386
+ function go({ message: e }) {
7271
7387
  return e.includes("Origin not allowed") ? /* @__PURE__ */ l("div", {
7272
7388
  className: "ak-error ak-error--origin",
7273
7389
  role: "alert",
@@ -7301,7 +7417,7 @@ function ro({ message: e }) {
7301
7417
  }
7302
7418
  //#endregion
7303
7419
  //#region ../../packages/widget-ui/src/components/MaintenanceState.tsx
7304
- function io() {
7420
+ function _o() {
7305
7421
  return /* @__PURE__ */ l("svg", {
7306
7422
  width: "28",
7307
7423
  height: "28",
@@ -7319,7 +7435,7 @@ function io() {
7319
7435
  }), /* @__PURE__ */ c("path", { d: "M12 7v5l3 2" })]
7320
7436
  });
7321
7437
  }
7322
- function ao() {
7438
+ function vo() {
7323
7439
  return /* @__PURE__ */ l("div", {
7324
7440
  className: "ak-maintenance",
7325
7441
  role: "status",
@@ -7331,7 +7447,7 @@ function ao() {
7331
7447
  }),
7332
7448
  /* @__PURE__ */ c("div", {
7333
7449
  className: "ak-maintenance__icon",
7334
- children: /* @__PURE__ */ c(io, {})
7450
+ children: /* @__PURE__ */ c(_o, {})
7335
7451
  }),
7336
7452
  /* @__PURE__ */ c("p", {
7337
7453
  className: "ak-maintenance__title",
@@ -7346,7 +7462,7 @@ function ao() {
7346
7462
  }
7347
7463
  //#endregion
7348
7464
  //#region ../../packages/widget-ui/src/components/WidgetShell.tsx
7349
- function oo() {
7465
+ function yo() {
7350
7466
  return /* @__PURE__ */ l("svg", {
7351
7467
  width: "11",
7352
7468
  height: "11",
@@ -7365,11 +7481,11 @@ function oo() {
7365
7481
  })]
7366
7482
  });
7367
7483
  }
7368
- function so() {
7484
+ function bo() {
7369
7485
  return /* @__PURE__ */ l("div", {
7370
7486
  className: "ak-branding",
7371
7487
  children: [
7372
- /* @__PURE__ */ c(oo, {}),
7488
+ /* @__PURE__ */ c(yo, {}),
7373
7489
  /* @__PURE__ */ c("span", {
7374
7490
  className: "ak-branding__label",
7375
7491
  children: "Powered by"
@@ -7381,7 +7497,7 @@ function so() {
7381
7497
  ]
7382
7498
  });
7383
7499
  }
7384
- function co({ config: e, messages: t, isLoading: n, error: r, isInline: i, initStatus: a, initError: o, callbacks: u }) {
7500
+ function xo({ config: e, messages: t, isLoading: n, error: r, isInline: i, initStatus: a, initError: o, callbacks: u }) {
7385
7501
  return /* @__PURE__ */ l("div", {
7386
7502
  className: i ? "ak-shell-wrap" : "ak-shell-wrap ak-shell-enter",
7387
7503
  children: [/* @__PURE__ */ l("div", {
@@ -7389,7 +7505,7 @@ function co({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
7389
7505
  role: "dialog",
7390
7506
  "aria-label": e.title,
7391
7507
  children: [
7392
- /* @__PURE__ */ c(_a, {
7508
+ /* @__PURE__ */ c(ka, {
7393
7509
  title: e.title,
7394
7510
  subtitle: e.subtitle,
7395
7511
  avatarUrl: e.avatarUrl,
@@ -7406,25 +7522,25 @@ function co({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
7406
7522
  }),
7407
7523
  a === "error" && /* @__PURE__ */ c("div", {
7408
7524
  className: "ak-init-status ak-init-status--error",
7409
- children: /* @__PURE__ */ c(ro, { message: o ?? "Widget configuration is invalid." })
7525
+ children: /* @__PURE__ */ c(go, { message: o ?? "Widget configuration is invalid." })
7410
7526
  }),
7411
7527
  a === "disabled" && /* @__PURE__ */ c("div", {
7412
7528
  className: "ak-init-status ak-init-status--maintenance",
7413
- children: /* @__PURE__ */ c(ao, {})
7529
+ children: /* @__PURE__ */ c(vo, {})
7414
7530
  }),
7415
7531
  a === "ready" && /* @__PURE__ */ l(s, { children: [
7416
- t.length === 0 ? /* @__PURE__ */ c(Va, {
7532
+ t.length === 0 ? /* @__PURE__ */ c($a, {
7417
7533
  title: e.title,
7418
7534
  description: e.description ?? e.subtitle,
7419
7535
  suggestedQuestions: e.suggestedQuestions,
7420
7536
  avatarUrl: e.avatarUrl,
7421
7537
  onSelect: (e) => u.onSendMessage(e, [])
7422
- }) : /* @__PURE__ */ c(za, {
7538
+ }) : /* @__PURE__ */ c(Za, {
7423
7539
  messages: t,
7424
7540
  isLoading: n
7425
7541
  }),
7426
- r && /* @__PURE__ */ c(ro, { message: r }),
7427
- /* @__PURE__ */ c(no, {
7542
+ r && /* @__PURE__ */ c(go, { message: r }),
7543
+ /* @__PURE__ */ c(ho, {
7428
7544
  onSend: u.onSendMessage,
7429
7545
  disabled: n,
7430
7546
  placeholder: "Type a message…",
@@ -7435,12 +7551,12 @@ function co({ config: e, messages: t, isLoading: n, error: r, isInline: i, initS
7435
7551
  })
7436
7552
  ] })
7437
7553
  ]
7438
- }), !i && /* @__PURE__ */ c(so, {})]
7554
+ }), !i && /* @__PURE__ */ c(bo, {})]
7439
7555
  });
7440
7556
  }
7441
7557
  //#endregion
7442
7558
  //#region ../../packages/widget-ui/src/components/Launcher.tsx
7443
- function lo() {
7559
+ function So() {
7444
7560
  return /* @__PURE__ */ c("svg", {
7445
7561
  width: "24",
7446
7562
  height: "24",
@@ -7453,7 +7569,7 @@ function lo() {
7453
7569
  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" })
7454
7570
  });
7455
7571
  }
7456
- function uo() {
7572
+ function Co() {
7457
7573
  return /* @__PURE__ */ c("svg", {
7458
7574
  width: "22",
7459
7575
  height: "22",
@@ -7466,7 +7582,7 @@ function uo() {
7466
7582
  children: /* @__PURE__ */ c("polyline", { points: "6,9 12,15 18,9" })
7467
7583
  });
7468
7584
  }
7469
- function fo({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat" }) {
7585
+ function wo({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat" }) {
7470
7586
  let i = !e && !!n;
7471
7587
  return /* @__PURE__ */ c("button", {
7472
7588
  className: `ak-launcher${i ? " ak-launcher--avatar" : ""}`,
@@ -7474,22 +7590,22 @@ function fo({ isOpen: e, onClick: t, avatarUrl: n, ariaLabel: r = "Toggle chat"
7474
7590
  "aria-label": r,
7475
7591
  "aria-expanded": e,
7476
7592
  type: "button",
7477
- children: e ? /* @__PURE__ */ c(uo, {}) : i ? /* @__PURE__ */ c("img", {
7593
+ children: e ? /* @__PURE__ */ c(Co, {}) : i ? /* @__PURE__ */ c("img", {
7478
7594
  src: n,
7479
7595
  alt: "",
7480
7596
  className: "ak-launcher__avatar-img",
7481
7597
  "aria-hidden": "true"
7482
- }) : /* @__PURE__ */ c(lo, {})
7598
+ }) : /* @__PURE__ */ c(So, {})
7483
7599
  });
7484
7600
  }
7485
7601
  //#endregion
7486
7602
  //#region ../../packages/widget-ui/src/WidgetApp.tsx
7487
- function po({ config: e, state: t, callbacks: n }) {
7603
+ function To({ config: e, state: t, callbacks: n }) {
7488
7604
  let i = e.mode === "inline", o = a(null);
7489
7605
  return r(() => {
7490
7606
  let t = o.current?.getRootNode()?.host;
7491
7607
  if (!t) return;
7492
- let n = fa(e.theme.mode);
7608
+ let n = wa(e.theme.mode);
7493
7609
  t.setAttribute("data-theme", n);
7494
7610
  }, [e.theme.mode]), r(() => {
7495
7611
  if (i) return;
@@ -7498,7 +7614,7 @@ function po({ config: e, state: t, callbacks: n }) {
7498
7614
  }, [i, t.isOpen]), i ? /* @__PURE__ */ c("div", {
7499
7615
  ref: o,
7500
7616
  className: "ak-inline",
7501
- children: /* @__PURE__ */ c(co, {
7617
+ children: /* @__PURE__ */ c(xo, {
7502
7618
  config: e,
7503
7619
  messages: t.messages,
7504
7620
  isLoading: t.isLoading,
@@ -7511,7 +7627,7 @@ function po({ config: e, state: t, callbacks: n }) {
7511
7627
  }) : /* @__PURE__ */ l("div", {
7512
7628
  ref: o,
7513
7629
  className: "ak-floating",
7514
- children: [t.isOpen && /* @__PURE__ */ c(co, {
7630
+ children: [t.isOpen && /* @__PURE__ */ c(xo, {
7515
7631
  config: e,
7516
7632
  messages: t.messages,
7517
7633
  isLoading: t.isLoading,
@@ -7520,7 +7636,7 @@ function po({ config: e, state: t, callbacks: n }) {
7520
7636
  initStatus: t.initStatus,
7521
7637
  initError: t.initError,
7522
7638
  callbacks: n
7523
- }), /* @__PURE__ */ c(fo, {
7639
+ }), /* @__PURE__ */ c(wo, {
7524
7640
  isOpen: t.isOpen,
7525
7641
  onClick: t.isOpen ? n.onClose : n.onOpen,
7526
7642
  avatarUrl: e.avatarUrl
@@ -7529,15 +7645,15 @@ function po({ config: e, state: t, callbacks: n }) {
7529
7645
  }
7530
7646
  //#endregion
7531
7647
  //#region ../../packages/widget-ui/src/index.ts
7532
- var mo = (n, r, i, a) => {
7648
+ var Eo = (n, r, i, a) => {
7533
7649
  let o = e(n);
7534
- return o.render(t(po, {
7650
+ return o.render(t(To, {
7535
7651
  config: r,
7536
7652
  state: i,
7537
7653
  callbacks: a
7538
7654
  })), {
7539
7655
  update(e, n) {
7540
- o.render(t(po, {
7656
+ o.render(t(To, {
7541
7657
  config: n,
7542
7658
  state: e,
7543
7659
  callbacks: a
@@ -7550,28 +7666,28 @@ var mo = (n, r, i, a) => {
7550
7666
  }
7551
7667
  };
7552
7668
  };
7553
- function ho(e) {
7554
- return pa + "\n" + da(e);
7669
+ function Do(e) {
7670
+ return Ta + "\n" + Ca(e);
7555
7671
  }
7556
7672
  //#endregion
7557
7673
  //#region src/api.ts
7558
- function go(e, t) {
7559
- return ho(gt({
7674
+ function Oo(e, t) {
7675
+ return Do(_t({
7560
7676
  ...e,
7561
7677
  mode: t
7562
7678
  }));
7563
7679
  }
7564
- function _o(e, t = mo, n) {
7565
- return oa(e, t, n ?? go(e, "floating"));
7680
+ function ko(e, t = Eo, n) {
7681
+ return va(e, t, n ?? Oo(e, "floating"));
7566
7682
  }
7567
- function vo(e, t, n = mo, r) {
7568
- return ca(e, t, n, r ?? go(t, "inline"));
7683
+ function Ao(e, t, n = Eo, r) {
7684
+ return ba(e, t, n, r ?? Oo(t, "inline"));
7569
7685
  }
7570
- function yo(e, t, n = mo, r) {
7571
- return sa(e, t, n, r ?? go(t, "floating"));
7686
+ function jo(e, t, n = Eo, r) {
7687
+ return ya(e, t, n, r ?? Oo(t, "floating"));
7572
7688
  }
7573
- function bo(e) {
7574
- la(e);
7689
+ function Mo(e) {
7690
+ xa(e);
7575
7691
  }
7576
7692
  //#endregion
7577
- export { Ei as ApiClient, no as Composer, ro as ErrorState, Pi as EventEmitter, _a as Header, fo as Launcher, Ia as MessageBubble, za as MessageList, La as TypingIndicator, po as WidgetApp, Wi as WidgetClient, co as WidgetShell, da as buildThemeVars, ho as buildWidgetCSS, zi as clearSession, Zi as createFloatingContainer, qi as createShadowHost, na as createWidget, bo as destroy, la as destroyWidget, Li as getSessionId, _o as init, Ji as injectStyles, ua as listWidgets, vo as mount, yo as mountFloating, gt as normalizeConfig, $i as prepareInlineContainer, Yi as removeShadowHost, mo as renderWidget, fa as resolveThemeMode, Ri as setSessionId, ki as streamChat, pa as widgetCSS };
7693
+ export { Oi as ApiClient, ho as Composer, go as ErrorState, Gi as EventEmitter, ka as Header, wo as Launcher, Ja as MessageBubble, Za as MessageList, Ya as TypingIndicator, To as WidgetApp, na as WidgetClient, xo as WidgetShell, Ca as buildThemeVars, Do as buildWidgetCSS, Xi as clearSession, la as createFloatingContainer, aa as createShadowHost, ma as createWidget, Mo as destroy, xa as destroyWidget, Ji as getSessionId, ko as init, oa as injectStyles, Sa as listWidgets, Ao as mount, jo as mountFloating, _t as normalizeConfig, da as prepareInlineContainer, sa as removeShadowHost, Eo as renderWidget, wa as resolveThemeMode, Yi as setSessionId, ji as streamChat, Ta as widgetCSS };