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