@ibiz-template-plugin/ai-chat 0.0.101 → 0.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js
CHANGED
|
@@ -494,9 +494,9 @@ function Vi() {
|
|
|
494
494
|
Vi.__r = 0;
|
|
495
495
|
}
|
|
496
496
|
function Lu(n, e, t, i, r, s, o, a, l, c, u) {
|
|
497
|
-
var d, f, p, m, v,
|
|
498
|
-
for (l = J0(t, e,
|
|
499
|
-
(p = t.__k[d]) != null && (f = p.__i == -1 ? Vn :
|
|
497
|
+
var d, f, p, m, v, b, g, y = i && i.__k || Ru, k = e.length;
|
|
498
|
+
for (l = J0(t, e, y, l, k), d = 0; d < k; d++)
|
|
499
|
+
(p = t.__k[d]) != null && (f = p.__i == -1 ? Vn : y[p.__i] || Vn, p.__i = d, b = Co(n, p, f, r, s, o, a, l, c, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && ko(f.ref, null, p), u.push(p.ref, p.__c || m, p)), v == null && m != null && (v = m), (g = !!(4 & p.__u)) || f.__k === p.__k ? l = zu(p, l, n, g) : typeof p.type == "function" && b !== void 0 ? l = b : m && (l = m.nextSibling), p.__u &= -7);
|
|
500
500
|
return t.__e = v, l;
|
|
501
501
|
}
|
|
502
502
|
function J0(n, e, t, i, r) {
|
|
@@ -581,17 +581,17 @@ function Ha(n) {
|
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
583
|
function Co(n, e, t, i, r, s, o, a, l, c) {
|
|
584
|
-
var u, d, f, p, m, v,
|
|
584
|
+
var u, d, f, p, m, v, b, g, y, k, w, S, x, T, E, N, R, j = e.type;
|
|
585
585
|
if (e.constructor != null)
|
|
586
586
|
return null;
|
|
587
587
|
128 & t.__u && (l = !!(32 & t.__u), s = [a = e.__e = t.__e]), (u = P.__b) && u(e);
|
|
588
588
|
e:
|
|
589
589
|
if (typeof j == "function")
|
|
590
590
|
try {
|
|
591
|
-
if (g = e.props,
|
|
592
|
-
|
|
591
|
+
if (g = e.props, y = "prototype" in j && j.prototype.render, k = (u = j.contextType) && i[u.__c], w = u ? k ? k.props.value : u.__ : i, t.__c ? b = (d = e.__c = t.__c).__ = d.__E : (y ? e.__c = d = new j(g, w) : (e.__c = d = new ze(g, w), d.constructor = j, d.render = Y0), k && k.sub(d), d.props = g, d.state || (d.state = {}), d.context = w, d.__n = i, f = d.__d = !0, d.__h = [], d._sb = []), y && d.__s == null && (d.__s = d.state), y && j.getDerivedStateFromProps != null && (d.__s == d.state && (d.__s = ot({}, d.__s)), ot(d.__s, j.getDerivedStateFromProps(g, d.__s))), p = d.props, m = d.state, d.__v = e, f)
|
|
592
|
+
y && j.getDerivedStateFromProps == null && d.componentWillMount != null && d.componentWillMount(), y && d.componentDidMount != null && d.__h.push(d.componentDidMount);
|
|
593
593
|
else {
|
|
594
|
-
if (
|
|
594
|
+
if (y && j.getDerivedStateFromProps == null && g !== p && d.componentWillReceiveProps != null && d.componentWillReceiveProps(g, w), !d.__e && d.shouldComponentUpdate != null && d.shouldComponentUpdate(g, d.__s, w) === !1 || e.__v == t.__v) {
|
|
595
595
|
for (e.__v != t.__v && (d.props = g, d.state = d.__s, d.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.some(function(te) {
|
|
596
596
|
te && (te.__ = e);
|
|
597
597
|
}), S = 0; S < d._sb.length; S++)
|
|
@@ -599,11 +599,11 @@ function Co(n, e, t, i, r, s, o, a, l, c) {
|
|
|
599
599
|
d._sb = [], d.__h.length && o.push(d);
|
|
600
600
|
break e;
|
|
601
601
|
}
|
|
602
|
-
d.componentWillUpdate != null && d.componentWillUpdate(g, d.__s, w),
|
|
602
|
+
d.componentWillUpdate != null && d.componentWillUpdate(g, d.__s, w), y && d.componentDidUpdate != null && d.__h.push(function() {
|
|
603
603
|
d.componentDidUpdate(p, m, v);
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
|
-
if (d.context = w, d.props = g, d.__P = n, d.__e = !1, x = P.__r, T = 0,
|
|
606
|
+
if (d.context = w, d.props = g, d.__P = n, d.__e = !1, x = P.__r, T = 0, y) {
|
|
607
607
|
for (d.state = d.__s, d.__d = !1, x && x(e), u = d.render(d.props, d.state, d.context), E = 0; E < d._sb.length; E++)
|
|
608
608
|
d.__h.push(d._sb[E]);
|
|
609
609
|
d._sb = [];
|
|
@@ -611,7 +611,7 @@ function Co(n, e, t, i, r, s, o, a, l, c) {
|
|
|
611
611
|
do
|
|
612
612
|
d.__d = !1, x && x(e), u = d.render(d.props, d.state, d.context), d.state = d.__s;
|
|
613
613
|
while (d.__d && ++T < 25);
|
|
614
|
-
d.state = d.__s, d.getChildContext != null && (i = ot(ot({}, i), d.getChildContext())),
|
|
614
|
+
d.state = d.__s, d.getChildContext != null && (i = ot(ot({}, i), d.getChildContext())), y && !f && d.getSnapshotBeforeUpdate != null && (v = d.getSnapshotBeforeUpdate(p, m)), N = u, u != null && u.type === We && u.key == null && (N = Fu(u.props.children)), a = Lu(n, ni(N) ? N : [N], e, t, i, r, s, o, a, l, c), d.base = e.__e, e.__u &= -161, d.__h.length && o.push(d), b && (d.__E = d.__ = null);
|
|
615
615
|
} catch (te) {
|
|
616
616
|
if (e.__v = null, l || s != null)
|
|
617
617
|
if (te.then) {
|
|
@@ -651,27 +651,27 @@ function Fu(n) {
|
|
|
651
651
|
return typeof n != "object" || n == null || n.__b && n.__b > 0 ? n : ni(n) ? n.map(Fu) : ot({}, n);
|
|
652
652
|
}
|
|
653
653
|
function X0(n, e, t, i, r, s, o, a, l) {
|
|
654
|
-
var c, u, d, f, p, m, v,
|
|
655
|
-
if (
|
|
654
|
+
var c, u, d, f, p, m, v, b = t.props, g = e.props, y = e.type;
|
|
655
|
+
if (y == "svg" ? r = "http://www.w3.org/2000/svg" : y == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
656
656
|
for (c = 0; c < s.length; c++)
|
|
657
|
-
if ((p = s[c]) && "setAttribute" in p == !!
|
|
657
|
+
if ((p = s[c]) && "setAttribute" in p == !!y && (y ? p.localName == y : p.nodeType == 3)) {
|
|
658
658
|
n = p, s[c] = null;
|
|
659
659
|
break;
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
662
|
if (n == null) {
|
|
663
|
-
if (
|
|
663
|
+
if (y == null)
|
|
664
664
|
return document.createTextNode(g);
|
|
665
|
-
n = document.createElementNS(r,
|
|
665
|
+
n = document.createElementNS(r, y, g.is && g), a && (P.__m && P.__m(e, s), a = !1), s = null;
|
|
666
666
|
}
|
|
667
|
-
if (
|
|
668
|
-
|
|
667
|
+
if (y == null)
|
|
668
|
+
b === g || a && n.data == g || (n.data = g);
|
|
669
669
|
else {
|
|
670
|
-
if (s = s && cr.call(n.childNodes),
|
|
671
|
-
for (
|
|
672
|
-
|
|
673
|
-
for (c in
|
|
674
|
-
if (p =
|
|
670
|
+
if (s = s && cr.call(n.childNodes), b = t.props || Vn, !a && s != null)
|
|
671
|
+
for (b = {}, c = 0; c < n.attributes.length; c++)
|
|
672
|
+
b[(p = n.attributes[c]).name] = p.value;
|
|
673
|
+
for (c in b)
|
|
674
|
+
if (p = b[c], c != "children") {
|
|
675
675
|
if (c == "dangerouslySetInnerHTML")
|
|
676
676
|
d = p;
|
|
677
677
|
else if (!(c in g)) {
|
|
@@ -681,13 +681,13 @@ function X0(n, e, t, i, r, s, o, a, l) {
|
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
for (c in g)
|
|
684
|
-
p = g[c], c == "children" ? f = p : c == "dangerouslySetInnerHTML" ? u = p : c == "value" ? m = p : c == "checked" ? v = p : a && typeof p != "function" ||
|
|
684
|
+
p = g[c], c == "children" ? f = p : c == "dangerouslySetInnerHTML" ? u = p : c == "value" ? m = p : c == "checked" ? v = p : a && typeof p != "function" || b[c] === p || gi(n, c, p, b[c], r);
|
|
685
685
|
if (u)
|
|
686
686
|
a || d && (u.__html == d.__html || u.__html == n.innerHTML) || (n.innerHTML = u.__html), e.__k = [];
|
|
687
|
-
else if (d && (n.innerHTML = ""), Lu(e.type == "template" ? n.content : n, ni(f) ? f : [f], e, t, i,
|
|
687
|
+
else if (d && (n.innerHTML = ""), Lu(e.type == "template" ? n.content : n, ni(f) ? f : [f], e, t, i, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, o, s ? s[0] : t.__k && gn(t, 0), a, l), s != null)
|
|
688
688
|
for (c = s.length; c--; )
|
|
689
689
|
wo(s[c]);
|
|
690
|
-
a || (c = "value",
|
|
690
|
+
a || (c = "value", y == "progress" && m == null ? n.removeAttribute("value") : m != null && (m !== n[c] || y == "progress" && !m || y == "option" && m != b[c]) && gi(n, c, m, b[c], r), c = "checked", v != null && v != n[c] && gi(n, c, v, b[c], r));
|
|
691
691
|
}
|
|
692
692
|
return n;
|
|
693
693
|
}
|
|
@@ -3712,6 +3712,8 @@ const id = () => /* @__PURE__ */ h("svg", { viewBox: "0 0 1024 1024", version: "
|
|
|
3712
3712
|
voiceInputProgress: "Voice input progress...",
|
|
3713
3713
|
stopGenerating: "Stop generating",
|
|
3714
3714
|
sendMessage: "Send message",
|
|
3715
|
+
instantSteer: "Instant steer",
|
|
3716
|
+
instantSteerTip: "Send supplementary content without interrupting the current conversation",
|
|
3715
3717
|
meterialResources: "Meterial resources",
|
|
3716
3718
|
preview: "Preview",
|
|
3717
3719
|
uploadSuccess: "Upload success",
|
|
@@ -3811,7 +3813,6 @@ const id = () => /* @__PURE__ */ h("svg", { viewBox: "0 0 1024 1024", version: "
|
|
|
3811
3813
|
deepResearch: "Depth research report",
|
|
3812
3814
|
textReport: "Text report",
|
|
3813
3815
|
deepResearchReport: "In depth research report",
|
|
3814
|
-
steer: "Steer",
|
|
3815
3816
|
noTextReportContent: "No text report content available at the moment",
|
|
3816
3817
|
chatInputPlaceholder: "Ask AI"
|
|
3817
3818
|
}, Zg = {
|
|
@@ -3840,6 +3841,8 @@ const id = () => /* @__PURE__ */ h("svg", { viewBox: "0 0 1024 1024", version: "
|
|
|
3840
3841
|
voiceInputProgress: "语音输入中...",
|
|
3841
3842
|
stopGenerating: "停止生成",
|
|
3842
3843
|
sendMessage: "发送消息",
|
|
3844
|
+
instantSteer: "即时引导",
|
|
3845
|
+
instantSteerTip: "发送补充内容,不中断当前对话",
|
|
3843
3846
|
meterialResources: "素材资源",
|
|
3844
3847
|
preview: "预览",
|
|
3845
3848
|
uploadSuccess: "上传成功",
|
|
@@ -3939,7 +3942,6 @@ const id = () => /* @__PURE__ */ h("svg", { viewBox: "0 0 1024 1024", version: "
|
|
|
3939
3942
|
deepResearch: "深度研报",
|
|
3940
3943
|
textReport: "文本报告",
|
|
3941
3944
|
deepResearchReport: "深度研究报告",
|
|
3942
|
-
steer: "调整方向",
|
|
3943
3945
|
noTextReportContent: "暂无文本报告内容",
|
|
3944
3946
|
chatInputPlaceholder: "问问 AI"
|
|
3945
3947
|
};
|
|
@@ -4114,16 +4116,16 @@ const n2 = (n) => {
|
|
|
4114
4116
|
if (Array.isArray(f)) {
|
|
4115
4117
|
if (f.length === 0)
|
|
4116
4118
|
return ["".concat(m, '<span class="array">[]</span>')];
|
|
4117
|
-
v.push("".concat(m, '<span class="array">[</span>')), f.forEach((
|
|
4118
|
-
const
|
|
4119
|
-
typeof
|
|
4119
|
+
v.push("".concat(m, '<span class="array">[</span>')), f.forEach((b, g) => {
|
|
4120
|
+
const y = l(b, p + 1), k = g < f.length - 1 ? "," : "";
|
|
4121
|
+
typeof b == "object" && b !== null ? (v.push(...y.slice(0, -1)), v.push("".concat(y[y.length - 1]).concat(k))) : v.push("".concat(y[0]).concat(k));
|
|
4120
4122
|
}), v.push("".concat(m, '<span class="array">]</span>'));
|
|
4121
4123
|
} else if (typeof f == "object" && f !== null) {
|
|
4122
|
-
const
|
|
4123
|
-
if (
|
|
4124
|
+
const b = Object.keys(f);
|
|
4125
|
+
if (b.length === 0)
|
|
4124
4126
|
return ["".concat(m, '<span class="property">{}</span>')];
|
|
4125
|
-
v.push("".concat(m, '<span class="property">{</span>')),
|
|
4126
|
-
const k = f[g], w =
|
|
4127
|
+
v.push("".concat(m, '<span class="property">{</span>')), b.forEach((g, y) => {
|
|
4128
|
+
const k = f[g], w = y < b.length - 1 ? "," : "", S = '<span class="json-key">"'.concat(g, '":</span>');
|
|
4127
4129
|
if (typeof k == "object" && k !== null) {
|
|
4128
4130
|
const x = l(k, p + 1);
|
|
4129
4131
|
v.push("".concat(m, " ").concat(S, " ").concat(x[0].trim())), x.length > 1 && (v.push(...x.slice(1, -1)), v.push("".concat(x[x.length - 1]).concat(w)));
|
|
@@ -4185,54 +4187,54 @@ const n2 = (n) => {
|
|
|
4185
4187
|
] });
|
|
4186
4188
|
};
|
|
4187
4189
|
const i2 = (n) => {
|
|
4188
|
-
var v,
|
|
4190
|
+
var v, b;
|
|
4189
4191
|
const e = new L("chunk-tool-call"), t = $([]), i = $(!1), r = $(!1);
|
|
4190
4192
|
let s;
|
|
4191
4193
|
const o = () => {
|
|
4192
4194
|
var g;
|
|
4193
4195
|
i.value = !i.value, (g = n.onCollapseChange) == null || g.call(n, i.value);
|
|
4194
4196
|
}, a = (g) => {
|
|
4195
|
-
var
|
|
4196
|
-
g.stopPropagation(), !r.value && (s && clearTimeout(s), r.value = !0, xn.copy(JSON.stringify(n.item, void 0, 2)), (
|
|
4197
|
+
var y;
|
|
4198
|
+
g.stopPropagation(), !r.value && (s && clearTimeout(s), r.value = !0, xn.copy(JSON.stringify(n.item, void 0, 2)), (y = n.controller.opts.utils) == null || y.message.success(C.t.value("copied")), s = setTimeout(() => {
|
|
4197
4199
|
r.value = !1;
|
|
4198
4200
|
}, 2e3));
|
|
4199
4201
|
}, l = (g) => {
|
|
4200
|
-
const
|
|
4201
|
-
return g.replace(
|
|
4202
|
+
const y = /\[(.+?)\]\((.+?)\)/g;
|
|
4203
|
+
return g.replace(y, (k, w, S) => '<a href="'.concat(S, '">').concat(w, "</a>"));
|
|
4202
4204
|
};
|
|
4203
4205
|
B(() => {
|
|
4204
4206
|
var w;
|
|
4205
|
-
const g = jc(((w = n.item.result) == null ? void 0 : w.chunks) || []),
|
|
4207
|
+
const g = jc(((w = n.item.result) == null ? void 0 : w.chunks) || []), y = g.filter(
|
|
4206
4208
|
(S) => S.type === "SOURCE"
|
|
4207
4209
|
), k = g.filter(
|
|
4208
4210
|
(S) => S.type !== "SOURCE"
|
|
4209
4211
|
);
|
|
4210
4212
|
k.forEach((S) => {
|
|
4211
|
-
S.type === "CLUSTER" && (S.children =
|
|
4213
|
+
S.type === "CLUSTER" && (S.children = y.filter((x) => x.pid === S.id), S.isExpand = !1);
|
|
4212
4214
|
}), t.value = k;
|
|
4213
4215
|
}, [n.item]), B(() => () => {
|
|
4214
4216
|
s && clearTimeout(s);
|
|
4215
4217
|
}, []);
|
|
4216
|
-
const c = (g,
|
|
4217
|
-
g.stopPropagation(),
|
|
4218
|
+
const c = (g, y) => {
|
|
4219
|
+
g.stopPropagation(), y.isExpand = !y.isExpand, t.value = [...t.value];
|
|
4218
4220
|
}, u = (g) => {
|
|
4219
|
-
const
|
|
4221
|
+
const y = l(g);
|
|
4220
4222
|
return /* @__PURE__ */ h(
|
|
4221
4223
|
"div",
|
|
4222
4224
|
{
|
|
4223
4225
|
onClick: (k) => n.onLinkClick(k),
|
|
4224
|
-
dangerouslySetInnerHTML: { __html:
|
|
4226
|
+
dangerouslySetInnerHTML: { __html: y }
|
|
4225
4227
|
}
|
|
4226
4228
|
);
|
|
4227
4229
|
}, d = (g) => /* @__PURE__ */ h("div", { className: e.e("footer"), children: [
|
|
4228
4230
|
g.type === "CLUSTER" && (g.source_count || g.source_count === 0) && /* @__PURE__ */ h("div", { className: e.em("footer", "description"), children: C.t.value("summaryGeneration", { count: g.source_count }) }),
|
|
4229
4231
|
/* @__PURE__ */ h("div", { className: e.em("footer", "docname"), children: g.docname })
|
|
4230
4232
|
] }), f = (g) => {
|
|
4231
|
-
var
|
|
4233
|
+
var y;
|
|
4232
4234
|
return /* @__PURE__ */ h(
|
|
4233
4235
|
"div",
|
|
4234
4236
|
{
|
|
4235
|
-
className: "".concat(e.e("item"), " ").concat(e.em("item", ((
|
|
4237
|
+
className: "".concat(e.e("item"), " ").concat(e.em("item", ((y = g.type) == null ? void 0 : y.toLowerCase()) || "default")),
|
|
4236
4238
|
children: [
|
|
4237
4239
|
g.type === "KBGUIDANCE" ? /* @__PURE__ */ h("div", { className: e.e("kbguidance"), children: C.t.value("guidance") }) : /* @__PURE__ */ h(
|
|
4238
4240
|
"div",
|
|
@@ -4251,7 +4253,7 @@ const i2 = (n) => {
|
|
|
4251
4253
|
g.id
|
|
4252
4254
|
);
|
|
4253
4255
|
}, p = (g) => {
|
|
4254
|
-
var
|
|
4256
|
+
var y, k;
|
|
4255
4257
|
return g.type === "CLUSTER" ? /* @__PURE__ */ h("div", { className: "".concat(e.e("chunk"), " ").concat(e.e("cluster")), children: [
|
|
4256
4258
|
/* @__PURE__ */ h("div", { className: e.em("cluster", "header"), children: [
|
|
4257
4259
|
/* @__PURE__ */ h(
|
|
@@ -4284,7 +4286,7 @@ const i2 = (n) => {
|
|
|
4284
4286
|
}
|
|
4285
4287
|
),
|
|
4286
4288
|
C.t.value("hitParagraph", {
|
|
4287
|
-
count: ((
|
|
4289
|
+
count: ((y = g.children) == null ? void 0 : y.length) || 0
|
|
4288
4290
|
})
|
|
4289
4291
|
]
|
|
4290
4292
|
}
|
|
@@ -4307,7 +4309,7 @@ const i2 = (n) => {
|
|
|
4307
4309
|
{
|
|
4308
4310
|
className: e.em("header-left", "desc"),
|
|
4309
4311
|
title: (v = n.item.result) == null ? void 0 : v.query,
|
|
4310
|
-
children: (
|
|
4312
|
+
children: (b = n.item.result) == null ? void 0 : b.query
|
|
4311
4313
|
}
|
|
4312
4314
|
)
|
|
4313
4315
|
] }),
|
|
@@ -4404,7 +4406,7 @@ const s2 = (n) => {
|
|
|
4404
4406
|
var p;
|
|
4405
4407
|
(p = n.item.result) != null && p.image_url && (t.value = !t.value);
|
|
4406
4408
|
}, c = () => {
|
|
4407
|
-
var p, m, v,
|
|
4409
|
+
var p, m, v, b;
|
|
4408
4410
|
return n.item.error ? /* @__PURE__ */ h("div", { className: "".concat(e.e("error"), " ").concat(e.e("center-text")), children: n.item.result }) : (p = n.item.result) != null && p.image_url || (m = n.item.result) != null && m.content ? [
|
|
4409
4411
|
/* @__PURE__ */ h(
|
|
4410
4412
|
"img",
|
|
@@ -4415,7 +4417,7 @@ const s2 = (n) => {
|
|
|
4415
4417
|
},
|
|
4416
4418
|
"image"
|
|
4417
4419
|
),
|
|
4418
|
-
/* @__PURE__ */ h("div", { className: e.e("description"), children: (
|
|
4420
|
+
/* @__PURE__ */ h("div", { className: e.e("description"), children: (b = n.item.result) == null ? void 0 : b.content }, "description")
|
|
4419
4421
|
] : /* @__PURE__ */ h("div", { className: "".concat(e.e("center-text")), children: C.t.value("noData") });
|
|
4420
4422
|
};
|
|
4421
4423
|
return /* @__PURE__ */ h("div", { className: "".concat(e.b(), " ").concat(n.className || ""), children: [
|
|
@@ -4589,7 +4591,7 @@ const we = new L("chat-single-select"), Po = (n) => {
|
|
|
4589
4591
|
icon: c,
|
|
4590
4592
|
onChange: u,
|
|
4591
4593
|
onSearch: d
|
|
4592
|
-
} = n, f = !!t.length && !s, p = H(null), m = H(null), v = $(""), [
|
|
4594
|
+
} = n, f = !!t.length && !s, p = H(null), m = H(null), v = $(""), [b, g] = U(e), [y, k] = U(t), [w, S] = U(!1), [x, T] = U(!1), E = ((Be = t.find((K) => K.value === b)) == null ? void 0 : Be.label) || l;
|
|
4593
4595
|
B(() => {
|
|
4594
4596
|
w === !1 && (v.value = "", k(t));
|
|
4595
4597
|
}, [w]), B(() => {
|
|
@@ -4621,12 +4623,12 @@ const we = new L("chat-single-select"), Po = (n) => {
|
|
|
4621
4623
|
} finally {
|
|
4622
4624
|
T(!1);
|
|
4623
4625
|
}
|
|
4624
|
-
}, te = () => x ? /* @__PURE__ */ h(pd, {}) :
|
|
4626
|
+
}, te = () => x ? /* @__PURE__ */ h(pd, {}) : y.length ? y.map((K) => /* @__PURE__ */ h(
|
|
4625
4627
|
"li",
|
|
4626
4628
|
{
|
|
4627
4629
|
title: K.label,
|
|
4628
4630
|
onClick: () => N(K),
|
|
4629
|
-
className: "".concat(we.em("dropdown", "item"), " ").concat(we.is("active", K.value ===
|
|
4631
|
+
className: "".concat(we.em("dropdown", "item"), " ").concat(we.is("active", K.value === b)),
|
|
4630
4632
|
children: K.label
|
|
4631
4633
|
},
|
|
4632
4634
|
K.value
|
|
@@ -4684,7 +4686,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
|
|
|
4684
4686
|
icon: o,
|
|
4685
4687
|
onChange: a,
|
|
4686
4688
|
onSearch: l
|
|
4687
|
-
} = n, c = H(null), u = H(null), d = $(""), [f, p] = U(!1), [m, v] = U(!1), [
|
|
4689
|
+
} = n, c = H(null), u = H(null), d = $(""), [f, p] = U(!1), [m, v] = U(!1), [b, g] = U(e || []), [y, k] = U(t);
|
|
4688
4690
|
B(() => {
|
|
4689
4691
|
g(e || []);
|
|
4690
4692
|
}, [e]), B(() => {
|
|
@@ -4699,7 +4701,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
|
|
|
4699
4701
|
};
|
|
4700
4702
|
}, []);
|
|
4701
4703
|
const w = (N) => {
|
|
4702
|
-
const j =
|
|
4704
|
+
const j = b.includes(N.value) ? b.filter((te) => te !== N.value) : [...b, N.value];
|
|
4703
4705
|
g(j), a == null || a(j);
|
|
4704
4706
|
}, S = (N) => {
|
|
4705
4707
|
d.value = N;
|
|
@@ -4724,7 +4726,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
|
|
|
4724
4726
|
B(() => {
|
|
4725
4727
|
f === !0 && (d.value = "", T(d.value));
|
|
4726
4728
|
}, [f]);
|
|
4727
|
-
const E = () => m ? /* @__PURE__ */ h(pd, {}) :
|
|
4729
|
+
const E = () => m ? /* @__PURE__ */ h(pd, {}) : y.length ? y.map((N) => /* @__PURE__ */ h(
|
|
4728
4730
|
"li",
|
|
4729
4731
|
{
|
|
4730
4732
|
title: N.label,
|
|
@@ -4737,7 +4739,7 @@ const Te = new L("chat-multiple-select"), md = (n) => {
|
|
|
4737
4739
|
type: "checkbox",
|
|
4738
4740
|
value: N.value,
|
|
4739
4741
|
className: Te.em("dropdown", "item-checkbox"),
|
|
4740
|
-
checked:
|
|
4742
|
+
checked: b.includes(N.value)
|
|
4741
4743
|
}
|
|
4742
4744
|
),
|
|
4743
4745
|
/* @__PURE__ */ h("div", { className: Te.em("dropdown", "item-label"), children: N.label })
|
|
@@ -5046,7 +5048,7 @@ const Un = ({
|
|
|
5046
5048
|
}
|
|
5047
5049
|
};
|
|
5048
5050
|
return { ...S, ...x[r] };
|
|
5049
|
-
},
|
|
5051
|
+
}, b = () => {
|
|
5050
5052
|
m.current && n === "hover" && (clearTimeout(m.current), m.current = null);
|
|
5051
5053
|
}, g = (w) => {
|
|
5052
5054
|
if (n === "click") {
|
|
@@ -5054,14 +5056,14 @@ const Un = ({
|
|
|
5054
5056
|
const S = !u;
|
|
5055
5057
|
d(S), o == null || o(S);
|
|
5056
5058
|
}
|
|
5057
|
-
},
|
|
5059
|
+
}, y = (w) => {
|
|
5058
5060
|
if (n === "hover") {
|
|
5059
|
-
w.stopPropagation(),
|
|
5061
|
+
w.stopPropagation(), b();
|
|
5060
5062
|
const S = !0;
|
|
5061
5063
|
d(S), o == null || o(S);
|
|
5062
5064
|
}
|
|
5063
5065
|
}, k = () => {
|
|
5064
|
-
n === "hover" && (
|
|
5066
|
+
n === "hover" && (b(), m.current = setTimeout(() => {
|
|
5065
5067
|
d(!1), o == null || o(!1);
|
|
5066
5068
|
}, 100));
|
|
5067
5069
|
};
|
|
@@ -5075,7 +5077,7 @@ const Un = ({
|
|
|
5075
5077
|
g(w);
|
|
5076
5078
|
},
|
|
5077
5079
|
onMouseEnter: (w) => {
|
|
5078
|
-
|
|
5080
|
+
y(w);
|
|
5079
5081
|
},
|
|
5080
5082
|
onMouseLeave: (w) => {
|
|
5081
5083
|
w.stopPropagation(), k();
|
|
@@ -5089,7 +5091,7 @@ const Un = ({
|
|
|
5089
5091
|
{
|
|
5090
5092
|
className: "".concat(l.b(), " pop-").concat(r),
|
|
5091
5093
|
style: v(),
|
|
5092
|
-
onMouseEnter:
|
|
5094
|
+
onMouseEnter: b,
|
|
5093
5095
|
onMouseLeave: k,
|
|
5094
5096
|
children: i || (t == null ? void 0 : t.map((w) => /* @__PURE__ */ h(
|
|
5095
5097
|
"div",
|
|
@@ -5135,15 +5137,15 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
|
|
|
5135
5137
|
}
|
|
5136
5138
|
}
|
|
5137
5139
|
], u = (m, v) => {
|
|
5138
|
-
var
|
|
5139
|
-
(
|
|
5140
|
+
var b;
|
|
5141
|
+
(b = v.onClick) == null || b.call(v, m, v, e.context, e.params, t);
|
|
5140
5142
|
}, d = (m) => {
|
|
5141
|
-
var v,
|
|
5143
|
+
var v, b, g, y;
|
|
5142
5144
|
if (typeof m.icon == "function")
|
|
5143
5145
|
return m.icon();
|
|
5144
|
-
if ((v = m.icon) != null && v.showIcon && ((
|
|
5146
|
+
if ((v = m.icon) != null && v.showIcon && ((b = m.icon) != null && b.cssClass))
|
|
5145
5147
|
return /* @__PURE__ */ h("i", { className: m.icon.cssClass });
|
|
5146
|
-
if ((g = m.icon) != null && g.showIcon && ((
|
|
5148
|
+
if ((g = m.icon) != null && g.showIcon && ((y = m.icon) != null && y.imagePath))
|
|
5147
5149
|
return ii(m.icon.imagePath) ? /* @__PURE__ */ h(
|
|
5148
5150
|
"div",
|
|
5149
5151
|
{
|
|
@@ -5167,13 +5169,13 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
|
|
|
5167
5169
|
}
|
|
5168
5170
|
),
|
|
5169
5171
|
!p && c.map((m, v) => {
|
|
5170
|
-
const
|
|
5172
|
+
const b = m.id === "islike" && t.islike === "1" || m.id === "isdislike" && t.isdislike === "1";
|
|
5171
5173
|
return /* @__PURE__ */ h(
|
|
5172
5174
|
"div",
|
|
5173
5175
|
{
|
|
5174
5176
|
title: m.title,
|
|
5175
5177
|
onClick: (g) => u(g, m),
|
|
5176
|
-
className: "".concat(Z.e("item"), " ").concat(Z.is("actived",
|
|
5178
|
+
className: "".concat(Z.e("item"), " ").concat(Z.is("actived", b)),
|
|
5177
5179
|
children: d(m)
|
|
5178
5180
|
},
|
|
5179
5181
|
v
|
|
@@ -5217,8 +5219,8 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
|
|
|
5217
5219
|
const { min: t, max: i, step: r, onChange: s } = n, o = H(null), a = $(n.value), l = Math.max.apply(
|
|
5218
5220
|
null,
|
|
5219
5221
|
[t, i, r].map((g) => {
|
|
5220
|
-
const
|
|
5221
|
-
return
|
|
5222
|
+
const y = "".concat(g).split(".")[1];
|
|
5223
|
+
return y ? y.length : 0;
|
|
5222
5224
|
})
|
|
5223
5225
|
), c = H({
|
|
5224
5226
|
dragging: !1,
|
|
@@ -5230,47 +5232,47 @@ const Z = new L("messsage-toolbar"), k2 = (n) => {
|
|
|
5230
5232
|
a.value = n.value;
|
|
5231
5233
|
}, [n.value]);
|
|
5232
5234
|
const d = (g) => {
|
|
5233
|
-
let
|
|
5234
|
-
return g.type.startsWith("touch") ? (k = g.touches[0].clientY,
|
|
5235
|
-
clientX:
|
|
5235
|
+
let y, k;
|
|
5236
|
+
return g.type.startsWith("touch") ? (k = g.touches[0].clientY, y = g.touches[0].clientX) : (k = g.clientY, y = g.clientX), {
|
|
5237
|
+
clientX: y,
|
|
5236
5238
|
clientY: k
|
|
5237
5239
|
};
|
|
5238
5240
|
}, f = async (g) => {
|
|
5239
5241
|
if (g === null || Number.isNaN(+g))
|
|
5240
5242
|
return;
|
|
5241
5243
|
g < 0 ? g = 0 : g > 100 && (g = 100);
|
|
5242
|
-
const
|
|
5243
|
-
let w = Math.round(g /
|
|
5244
|
+
const y = 100 / ((i - t) / r);
|
|
5245
|
+
let w = Math.round(g / y) * y * (i - t) * 0.01 + t;
|
|
5244
5246
|
w = Number.parseFloat(w.toFixed(l)), w !== n.value && s(w);
|
|
5245
5247
|
}, p = (g) => {
|
|
5246
|
-
const { clientX:
|
|
5248
|
+
const { clientX: y } = d(g), k = Number.parseFloat(u.value);
|
|
5247
5249
|
Object.assign(c.current, {
|
|
5248
5250
|
dragging: !0,
|
|
5249
|
-
startX:
|
|
5251
|
+
startX: y,
|
|
5250
5252
|
startPosition: k,
|
|
5251
5253
|
newPosition: k
|
|
5252
5254
|
});
|
|
5253
5255
|
}, m = (g) => {
|
|
5254
5256
|
if (!c.current.dragging)
|
|
5255
5257
|
return;
|
|
5256
|
-
const { clientX:
|
|
5258
|
+
const { clientX: y } = d(g), k = o.current.parentElement.clientWidth, w = (y - c.current.startX) / k * 100;
|
|
5257
5259
|
c.current.newPosition = c.current.startPosition + w, f(c.current.newPosition);
|
|
5258
5260
|
}, v = () => {
|
|
5259
5261
|
c.current.dragging && (c.current.dragging = !1, window.removeEventListener("mousemove", m), window.removeEventListener("touchmove", m), window.removeEventListener("mouseup", v), window.removeEventListener("touchend", v));
|
|
5260
|
-
},
|
|
5262
|
+
}, b = (g) => {
|
|
5261
5263
|
g.preventDefault(), p(g), window.addEventListener("mousemove", m), window.addEventListener("touchmove", m), window.addEventListener("mouseup", v), window.addEventListener("touchend", v), o.current.focus();
|
|
5262
5264
|
};
|
|
5263
5265
|
return Ju(e, () => ({
|
|
5264
5266
|
state: c,
|
|
5265
|
-
onButtonDown:
|
|
5267
|
+
onButtonDown: b,
|
|
5266
5268
|
setPosition: f
|
|
5267
5269
|
})), /* @__PURE__ */ h(
|
|
5268
5270
|
"div",
|
|
5269
5271
|
{
|
|
5270
5272
|
ref: o,
|
|
5271
5273
|
className: gl.e("button-wrapper"),
|
|
5272
|
-
onMouseDown:
|
|
5273
|
-
onTouchStart:
|
|
5274
|
+
onMouseDown: b,
|
|
5275
|
+
onTouchStart: b,
|
|
5274
5276
|
style: { left: u.value },
|
|
5275
5277
|
children: /* @__PURE__ */ h("div", { className: gl.e("button") })
|
|
5276
5278
|
}
|
|
@@ -5300,8 +5302,8 @@ const bi = new L("chat-slider"), vl = (n) => {
|
|
|
5300
5302
|
if (!c.current || c.current.state.current.dragging)
|
|
5301
5303
|
return;
|
|
5302
5304
|
let v = 0;
|
|
5303
|
-
const
|
|
5304
|
-
v = (
|
|
5305
|
+
const b = (S = (w = (k = m.touches) == null ? void 0 : k.item(0)) == null ? void 0 : w.clientX) != null ? S : m.clientX, { left: g, width: y } = l.current.getBoundingClientRect();
|
|
5306
|
+
v = (b - g) / y * 100, !(v < 0 || v > 100) && (c.current.setPosition(v), setTimeout(() => {
|
|
5305
5307
|
c.current.onButtonDown(m);
|
|
5306
5308
|
}, 0));
|
|
5307
5309
|
};
|
|
@@ -5366,7 +5368,7 @@ const Ke = new L("chat-step-item"), T2 = (n) => {
|
|
|
5366
5368
|
e.title ? S = e.title : u.value && (S = u.value), S = S.replace(/<tool_call>[\s\S]*?<\/tool_call>/g, "");
|
|
5367
5369
|
const x = S.indexOf("<tool_call>");
|
|
5368
5370
|
x !== -1 && S.indexOf("</tool_call>") === -1 && (S = S.substring(0, x)), i(S);
|
|
5369
|
-
},
|
|
5371
|
+
}, b = () => {
|
|
5370
5372
|
if (m.current) {
|
|
5371
5373
|
const S = m.current;
|
|
5372
5374
|
S.style.display = "block";
|
|
@@ -5380,7 +5382,7 @@ const Ke = new L("chat-step-item"), T2 = (n) => {
|
|
|
5380
5382
|
const S = p.current;
|
|
5381
5383
|
c(S.clientHeight);
|
|
5382
5384
|
}
|
|
5383
|
-
},
|
|
5385
|
+
}, y = () => {
|
|
5384
5386
|
let S = "", x = e.content || "";
|
|
5385
5387
|
const T = x.indexOf("<think>"), E = x.indexOf("</think>");
|
|
5386
5388
|
T !== -1 && E !== -1 && (S = x.slice(T + 7, E), x = x.slice(E + 8));
|
|
@@ -5388,7 +5390,7 @@ const Ke = new L("chat-step-item"), T2 = (n) => {
|
|
|
5388
5390
|
x = x.replace(/<tool_call>[\s\S]*?<\/tool_call>/g, ""), f.value.description = S || "", u.value = x || "", d.value = N;
|
|
5389
5391
|
};
|
|
5390
5392
|
B(() => {
|
|
5391
|
-
g(),
|
|
5393
|
+
g(), b(), y(), v();
|
|
5392
5394
|
}, []), B(() => {
|
|
5393
5395
|
setTimeout(() => {
|
|
5394
5396
|
g();
|
|
@@ -5547,17 +5549,17 @@ const Zt = new L("common-material"), _2 = (n) => {
|
|
|
5547
5549
|
const p = u.downloadAppId, m = { ...n.controller.context };
|
|
5548
5550
|
if (u.downloadContext)
|
|
5549
5551
|
try {
|
|
5550
|
-
const
|
|
5551
|
-
(g,
|
|
5552
|
-
if (
|
|
5553
|
-
const [k, w] =
|
|
5552
|
+
const b = u.downloadContext.split(";").reduce(
|
|
5553
|
+
(g, y) => {
|
|
5554
|
+
if (y.trim()) {
|
|
5555
|
+
const [k, w] = y.split(":");
|
|
5554
5556
|
k && w && (g[k.trim()] = w.trim());
|
|
5555
5557
|
}
|
|
5556
5558
|
return g;
|
|
5557
5559
|
},
|
|
5558
5560
|
{}
|
|
5559
5561
|
);
|
|
5560
|
-
|
|
5562
|
+
b && Object.keys(b).length > 0 && Object.assign(m, b);
|
|
5561
5563
|
} catch (v) {
|
|
5562
5564
|
throw new Error(C.t.value("downloadExContext"));
|
|
5563
5565
|
}
|
|
@@ -5653,7 +5655,7 @@ const ht = new L("markdown-message"), N2 = (n) => {
|
|
|
5653
5655
|
n.controller.handleSuggestionClick(n.message, x, T);
|
|
5654
5656
|
}, v = (x, T) => {
|
|
5655
5657
|
n.controller.handleUIActionClick(n.message, x, T);
|
|
5656
|
-
},
|
|
5658
|
+
}, b = (x) => {
|
|
5657
5659
|
const T = x.indexOf("<think>"), E = x.indexOf("</think>");
|
|
5658
5660
|
let N = "", R = "", j = !1;
|
|
5659
5661
|
return E === -1 ? (j = !1, N = x.slice(T + 7), R = "") : (j = !0, N = x.slice(T + 7, E), R = x.slice(E + 8)), { isThoughtCompleted: j, thoughtContent: N, answerContent: R };
|
|
@@ -5684,7 +5686,7 @@ const ht = new L("markdown-message"), N2 = (n) => {
|
|
|
5684
5686
|
}
|
|
5685
5687
|
return !1;
|
|
5686
5688
|
}
|
|
5687
|
-
},
|
|
5689
|
+
}, y = () => {
|
|
5688
5690
|
let x = "";
|
|
5689
5691
|
if (e.agent_tag && (x = e.agent_tag), x) {
|
|
5690
5692
|
const T = n.controller.agentList.value.find(
|
|
@@ -5730,17 +5732,17 @@ const ht = new L("markdown-message"), N2 = (n) => {
|
|
|
5730
5732
|
};
|
|
5731
5733
|
(() => {
|
|
5732
5734
|
if (e.content && e.content.indexOf("<think>") !== -1) {
|
|
5733
|
-
const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } =
|
|
5735
|
+
const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } = b(e.content);
|
|
5734
5736
|
d(x, T), l(E);
|
|
5735
5737
|
} else
|
|
5736
5738
|
l(e.content);
|
|
5737
|
-
|
|
5739
|
+
y();
|
|
5738
5740
|
})(), B(() => {
|
|
5739
5741
|
k();
|
|
5740
5742
|
}, [a.value.remainingText]), B(() => {
|
|
5741
5743
|
if (t >= 0 && s.value) {
|
|
5742
5744
|
if (e.content && e.content.indexOf("<think>") !== -1) {
|
|
5743
|
-
const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } =
|
|
5745
|
+
const { isThoughtCompleted: x, thoughtContent: T, answerContent: E } = b(e.content);
|
|
5744
5746
|
d(x, T), l(E);
|
|
5745
5747
|
} else
|
|
5746
5748
|
l(e.content);
|
|
@@ -9652,16 +9654,16 @@ class p6 {
|
|
|
9652
9654
|
}
|
|
9653
9655
|
let p = a.size + e - (o.content.size - o.openEnd);
|
|
9654
9656
|
for (; c < a.childCount; ) {
|
|
9655
|
-
let v = a.child(c),
|
|
9656
|
-
if (!
|
|
9657
|
+
let v = a.child(c), b = d.matchType(v.type);
|
|
9658
|
+
if (!b)
|
|
9657
9659
|
break;
|
|
9658
|
-
c++, (c > 1 || l == 0 || v.content.size) && (d =
|
|
9660
|
+
c++, (c > 1 || l == 0 || v.content.size) && (d = b, u.push(Yd(v.mark(f.allowedMarks(v.marks)), c == 1 ? l : 0, c == a.childCount ? p : -1)));
|
|
9659
9661
|
}
|
|
9660
9662
|
let m = c == a.childCount;
|
|
9661
9663
|
m || (p = -1), this.placed = In(this.placed, t, M.from(u)), this.frontier[t].match = d, m && p < 0 && i && i.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
9662
|
-
for (let v = 0,
|
|
9663
|
-
let g =
|
|
9664
|
-
this.frontier.push({ type: g.type, match: g.contentMatchAt(g.childCount) }),
|
|
9664
|
+
for (let v = 0, b = a; v < p; v++) {
|
|
9665
|
+
let g = b.lastChild;
|
|
9666
|
+
this.frontier.push({ type: g.type, match: g.contentMatchAt(g.childCount) }), b = g.content;
|
|
9665
9667
|
}
|
|
9666
9668
|
this.unplaced = m ? e == 0 ? A.empty : new A(An(o.content, e - 1, 1), e - 1, p < 0 ? o.openEnd : e - 1) : new A(An(o.content, e, c), o.openStart, o.openEnd);
|
|
9667
9669
|
}
|
|
@@ -9779,11 +9781,11 @@ function v6(n, e, t, i) {
|
|
|
9779
9781
|
let p = (f + u + 1) % (i.openStart + 1), m = c[p];
|
|
9780
9782
|
if (m)
|
|
9781
9783
|
for (let v = 0; v < o.length; v++) {
|
|
9782
|
-
let
|
|
9783
|
-
|
|
9784
|
-
let
|
|
9785
|
-
if (
|
|
9786
|
-
return n.replace(r.before(
|
|
9784
|
+
let b = o[(v + l) % o.length], g = !0;
|
|
9785
|
+
b < 0 && (g = !1, b = -b);
|
|
9786
|
+
let y = r.node(b - 1), k = r.index(b - 1);
|
|
9787
|
+
if (y.canReplaceWith(k, k, m.type, m.marks))
|
|
9788
|
+
return n.replace(r.before(b), g ? s.after(b) : t, new A(Qd(i.content, 0, i.openStart, p), p, i.openEnd));
|
|
9787
9789
|
}
|
|
9788
9790
|
}
|
|
9789
9791
|
let d = n.steps.length;
|
|
@@ -11191,8 +11193,8 @@ function ah(n, e, t, i) {
|
|
|
11191
11193
|
for (let g = o.length - 1; g >= 0; g--)
|
|
11192
11194
|
m = M.from(o[g].create(null, m));
|
|
11193
11195
|
m = M.from(r.copy(m));
|
|
11194
|
-
let v = n.tr.step(new de(e.pos - 1, p, e.pos, p, new A(m, 1, 0), o.length, !0)),
|
|
11195
|
-
|
|
11196
|
+
let v = n.tr.step(new de(e.pos - 1, p, e.pos, p, new A(m, 1, 0), o.length, !0)), b = v.doc.resolve(p + 2 * o.length);
|
|
11197
|
+
b.nodeAfter && b.nodeAfter.type == r.type && Xt(v.doc, b.pos) && v.join(b.pos), t(v.scrollIntoView());
|
|
11196
11198
|
}
|
|
11197
11199
|
return !0;
|
|
11198
11200
|
}
|
|
@@ -11203,16 +11205,16 @@ function ah(n, e, t, i) {
|
|
|
11203
11205
|
let p = r, m = [];
|
|
11204
11206
|
for (; m.push(p), !p.isTextblock; )
|
|
11205
11207
|
p = p.lastChild;
|
|
11206
|
-
let v = s,
|
|
11208
|
+
let v = s, b = 1;
|
|
11207
11209
|
for (; !v.isTextblock; v = v.firstChild)
|
|
11208
|
-
|
|
11210
|
+
b++;
|
|
11209
11211
|
if (p.canReplace(p.childCount, p.childCount, v.content)) {
|
|
11210
11212
|
if (t) {
|
|
11211
11213
|
let g = M.empty;
|
|
11212
11214
|
for (let k = m.length - 1; k >= 0; k--)
|
|
11213
11215
|
g = M.from(m[k].copy(g));
|
|
11214
|
-
let
|
|
11215
|
-
t(
|
|
11216
|
+
let y = n.tr.step(new de(e.pos - m.length, e.pos + s.nodeSize, e.pos + b, e.pos + s.nodeSize - b, new A(g, m.length, 0), 0, !0));
|
|
11217
|
+
t(y.scrollIntoView());
|
|
11216
11218
|
}
|
|
11217
11219
|
return !0;
|
|
11218
11220
|
}
|
|
@@ -11504,8 +11506,8 @@ function Fl(n, e, t) {
|
|
|
11504
11506
|
else {
|
|
11505
11507
|
let p = a.scrollLeft, m = a.scrollTop;
|
|
11506
11508
|
d && (a.scrollTop += d), u && (a.scrollLeft += u);
|
|
11507
|
-
let v = a.scrollLeft - p,
|
|
11508
|
-
e = { left: e.left - v, top: e.top -
|
|
11509
|
+
let v = a.scrollLeft - p, b = a.scrollTop - m;
|
|
11510
|
+
e = { left: e.left - v, top: e.top - b, right: e.right - v, bottom: e.bottom - b };
|
|
11509
11511
|
}
|
|
11510
11512
|
let f = l ? "fixed" : getComputedStyle(o).position;
|
|
11511
11513
|
if (/^(fixed|sticky)$/.test(f))
|
|
@@ -11788,12 +11790,12 @@ function v3(n, e, t) {
|
|
|
11788
11790
|
return a ? !g3.test(i.parent.textContent) || !a.modify ? t == "left" || t == "backward" ? s : o : vh(n, e, () => {
|
|
11789
11791
|
let { focusNode: l, focusOffset: c, anchorNode: u, anchorOffset: d } = n.domSelectionRange(), f = a.caretBidiLevel;
|
|
11790
11792
|
a.modify("move", t, "character");
|
|
11791
|
-
let p = i.depth ? n.docView.domAfterPos(i.before()) : n.dom, { focusNode: m, focusOffset: v } = n.domSelectionRange(),
|
|
11793
|
+
let p = i.depth ? n.docView.domAfterPos(i.before()) : n.dom, { focusNode: m, focusOffset: v } = n.domSelectionRange(), b = m && !p.contains(m.nodeType == 1 ? m : m.parentNode) || l == m && c == v;
|
|
11792
11794
|
try {
|
|
11793
11795
|
a.collapse(u, d), l && (l != u || c != d) && a.extend && a.extend(l, c);
|
|
11794
11796
|
} catch (g) {
|
|
11795
11797
|
}
|
|
11796
|
-
return f != null && (a.caretBidiLevel = f),
|
|
11798
|
+
return f != null && (a.caretBidiLevel = f), b;
|
|
11797
11799
|
}) : i.pos == i.start() || i.pos == i.end();
|
|
11798
11800
|
}
|
|
11799
11801
|
let Hl = null, jl = null, Ul = !1;
|
|
@@ -12054,19 +12056,19 @@ class ai {
|
|
|
12054
12056
|
setSelection(e, t, i, r = !1) {
|
|
12055
12057
|
let s = Math.min(e, t), o = Math.max(e, t);
|
|
12056
12058
|
for (let p = 0, m = 0; p < this.children.length; p++) {
|
|
12057
|
-
let v = this.children[p],
|
|
12058
|
-
if (s > m && o <
|
|
12059
|
+
let v = this.children[p], b = m + v.size;
|
|
12060
|
+
if (s > m && o < b)
|
|
12059
12061
|
return v.setSelection(e - m - v.border, t - m - v.border, i, r);
|
|
12060
|
-
m =
|
|
12062
|
+
m = b;
|
|
12061
12063
|
}
|
|
12062
12064
|
let a = this.domFromPos(e, e ? -1 : 1), l = t == e ? a : this.domFromPos(t, t ? -1 : 1), c = i.root.getSelection(), u = i.domSelectionRange(), d = !1;
|
|
12063
12065
|
if ((je || Se) && e == t) {
|
|
12064
12066
|
let { node: p, offset: m } = a;
|
|
12065
12067
|
if (p.nodeType == 3) {
|
|
12066
12068
|
if (d = !!(m && p.nodeValue[m - 1] == "\n"), d && m == p.nodeValue.length)
|
|
12067
|
-
for (let v = p,
|
|
12068
|
-
if (
|
|
12069
|
-
|
|
12069
|
+
for (let v = p, b; v; v = v.parentNode) {
|
|
12070
|
+
if (b = v.nextSibling) {
|
|
12071
|
+
b.nodeName == "BR" && (a = l = { node: b.parentNode, offset: me(b) + 1 });
|
|
12070
12072
|
break;
|
|
12071
12073
|
}
|
|
12072
12074
|
let g = v.pmViewDesc;
|
|
@@ -12749,14 +12751,14 @@ function T3(n, e, t, i) {
|
|
|
12749
12751
|
for (let c = 0; ; ) {
|
|
12750
12752
|
let u, d;
|
|
12751
12753
|
for (; o < r.length && r[o].to == s; ) {
|
|
12752
|
-
let
|
|
12753
|
-
|
|
12754
|
+
let b = r[o++];
|
|
12755
|
+
b.widget && (u ? (d || (d = [u])).push(b) : u = b);
|
|
12754
12756
|
}
|
|
12755
12757
|
if (u)
|
|
12756
12758
|
if (d) {
|
|
12757
12759
|
d.sort(x3);
|
|
12758
|
-
for (let
|
|
12759
|
-
t(d[
|
|
12760
|
+
for (let b = 0; b < d.length; b++)
|
|
12761
|
+
t(d[b], c, !!l);
|
|
12760
12762
|
} else
|
|
12761
12763
|
t(u, c, !!l);
|
|
12762
12764
|
let f, p;
|
|
@@ -12766,21 +12768,21 @@ function T3(n, e, t, i) {
|
|
|
12766
12768
|
p = c, f = n.child(c++);
|
|
12767
12769
|
else
|
|
12768
12770
|
break;
|
|
12769
|
-
for (let
|
|
12770
|
-
a[
|
|
12771
|
+
for (let b = 0; b < a.length; b++)
|
|
12772
|
+
a[b].to <= s && a.splice(b--, 1);
|
|
12771
12773
|
for (; o < r.length && r[o].from <= s && r[o].to > s; )
|
|
12772
12774
|
a.push(r[o++]);
|
|
12773
12775
|
let m = s + f.nodeSize;
|
|
12774
12776
|
if (f.isText) {
|
|
12775
|
-
let
|
|
12776
|
-
o < r.length && r[o].from <
|
|
12777
|
+
let b = m;
|
|
12778
|
+
o < r.length && r[o].from < b && (b = r[o].from);
|
|
12777
12779
|
for (let g = 0; g < a.length; g++)
|
|
12778
|
-
a[g].to <
|
|
12779
|
-
|
|
12780
|
+
a[g].to < b && (b = a[g].to);
|
|
12781
|
+
b < m && (l = f.cut(b - s), f = f.cut(0, b - s), m = b, p = -1);
|
|
12780
12782
|
} else
|
|
12781
12783
|
for (; o < r.length && r[o].to < m; )
|
|
12782
12784
|
o++;
|
|
12783
|
-
let v = f.isInline && !f.isLeaf ? a.filter((
|
|
12785
|
+
let v = f.isInline && !f.isLeaf ? a.filter((b) => !b.inline) : a.slice();
|
|
12784
12786
|
i(f, v, e.forChild(s, f), p), s = m;
|
|
12785
12787
|
}
|
|
12786
12788
|
}
|
|
@@ -13245,8 +13247,8 @@ function _h(n, e, t, i, r) {
|
|
|
13245
13247
|
else {
|
|
13246
13248
|
let f = r.marks(), { schema: p } = n.state, m = Gt.fromSchema(p);
|
|
13247
13249
|
o = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((v) => {
|
|
13248
|
-
let
|
|
13249
|
-
v &&
|
|
13250
|
+
let b = o.appendChild(document.createElement("p"));
|
|
13251
|
+
v && b.appendChild(m.serializeNode(p.text(v, f)));
|
|
13250
13252
|
});
|
|
13251
13253
|
}
|
|
13252
13254
|
} else
|
|
@@ -13804,7 +13806,7 @@ function h4(n, e, t) {
|
|
|
13804
13806
|
l.setSelection(new D(f));
|
|
13805
13807
|
else {
|
|
13806
13808
|
let p = l.mapping.map(a);
|
|
13807
|
-
l.mapping.maps[l.mapping.maps.length - 1].forEach((m, v,
|
|
13809
|
+
l.mapping.maps[l.mapping.maps.length - 1].forEach((m, v, b, g) => p = g), l.setSelection(Uo(n, f, l.doc.resolve(p)));
|
|
13808
13810
|
}
|
|
13809
13811
|
n.focus(), n.dispatch(l.setMeta("uiEvent", "drop"));
|
|
13810
13812
|
}
|
|
@@ -14210,15 +14212,15 @@ function f4(n, e, t, i, r, s, o) {
|
|
|
14210
14212
|
for (let c = 0, u = s; c < t.maps.length; c++) {
|
|
14211
14213
|
let d = 0;
|
|
14212
14214
|
t.maps[c].forEach((f, p, m, v) => {
|
|
14213
|
-
let
|
|
14215
|
+
let b = v - m - (p - f);
|
|
14214
14216
|
for (let g = 0; g < a.length; g += 3) {
|
|
14215
|
-
let
|
|
14216
|
-
if (
|
|
14217
|
+
let y = a[g + 1];
|
|
14218
|
+
if (y < 0 || f > y + u - d)
|
|
14217
14219
|
continue;
|
|
14218
14220
|
let k = a[g] + u - d;
|
|
14219
|
-
p >= k ? a[g + 1] = f <= k ? -2 : -1 : f >= u &&
|
|
14221
|
+
p >= k ? a[g + 1] = f <= k ? -2 : -1 : f >= u && b && (a[g] += b, a[g + 1] += b);
|
|
14220
14222
|
}
|
|
14221
|
-
d +=
|
|
14223
|
+
d += b;
|
|
14222
14224
|
}), u = t.maps[c].map(u, -1);
|
|
14223
14225
|
}
|
|
14224
14226
|
let l = !1;
|
|
@@ -14233,9 +14235,9 @@ function f4(n, e, t, i, r, s, o) {
|
|
|
14233
14235
|
l = !0;
|
|
14234
14236
|
continue;
|
|
14235
14237
|
}
|
|
14236
|
-
let f = t.map(n[c + 1] + s, -1), p = f - r, { index: m, offset: v } = i.content.findIndex(d),
|
|
14237
|
-
if (
|
|
14238
|
-
let g = a[c + 2].mapInner(t,
|
|
14238
|
+
let f = t.map(n[c + 1] + s, -1), p = f - r, { index: m, offset: v } = i.content.findIndex(d), b = i.maybeChild(m);
|
|
14239
|
+
if (b && v == d && v + b.nodeSize == p) {
|
|
14240
|
+
let g = a[c + 2].mapInner(t, b, u + 1, n[c] + s + 1, o);
|
|
14239
14241
|
g != Ce ? (a[c] = d, a[c + 1] = p, a[c + 2] = g) : (a[c + 1] = -2, l = !0);
|
|
14240
14242
|
} else
|
|
14241
14243
|
l = !0;
|
|
@@ -14545,13 +14547,13 @@ function C4(n, e) {
|
|
|
14545
14547
|
function k4(n, e, t) {
|
|
14546
14548
|
let { node: i, fromOffset: r, toOffset: s, from: o, to: a } = n.docView.parseRange(e, t), l = n.domSelectionRange(), c, u = l.anchorNode;
|
|
14547
14549
|
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: l.anchorOffset }], yr(l) || c.push({ node: l.focusNode, offset: l.focusOffset })), ue && n.input.lastKeyCode === 8)
|
|
14548
|
-
for (let
|
|
14549
|
-
let g = i.childNodes[
|
|
14550
|
-
if (g.nodeName == "BR" && !
|
|
14551
|
-
s =
|
|
14550
|
+
for (let b = s; b > r; b--) {
|
|
14551
|
+
let g = i.childNodes[b - 1], y = g.pmViewDesc;
|
|
14552
|
+
if (g.nodeName == "BR" && !y) {
|
|
14553
|
+
s = b;
|
|
14552
14554
|
break;
|
|
14553
14555
|
}
|
|
14554
|
-
if (!
|
|
14556
|
+
if (!y || y.size)
|
|
14555
14557
|
break;
|
|
14556
14558
|
}
|
|
14557
14559
|
let d = n.state.doc, f = n.someProp("domParser") || Pn.fromSchema(n.state.schema), p = d.resolve(o), m = null, v = f.parse(i, {
|
|
@@ -14566,8 +14568,8 @@ function k4(n, e, t) {
|
|
|
14566
14568
|
context: p
|
|
14567
14569
|
});
|
|
14568
14570
|
if (c && c[0].pos != null) {
|
|
14569
|
-
let
|
|
14570
|
-
g == null && (g =
|
|
14571
|
+
let b = c[0].pos, g = c[1] && c[1].pos;
|
|
14572
|
+
g == null && (g = b), m = { anchor: b + o, head: g + o };
|
|
14571
14573
|
}
|
|
14572
14574
|
return { doc: v, sel: m, from: o, to: a };
|
|
14573
14575
|
}
|
|
@@ -14621,16 +14623,16 @@ function T4(n, e, t, i, r) {
|
|
|
14621
14623
|
return;
|
|
14622
14624
|
}
|
|
14623
14625
|
n.state.selection.from < n.state.selection.to && m.start == m.endB && n.state.selection instanceof F && (m.start > n.state.selection.from && m.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? m.start = n.state.selection.from : m.endA < n.state.selection.to && m.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (m.endB += n.state.selection.to - m.endA, m.endA = n.state.selection.to)), De && Ct <= 11 && m.endB == m.start + 1 && m.endA == m.start && m.start > c.from && c.doc.textBetween(m.start - c.from - 1, m.start - c.from + 1) == " " && (m.start--, m.endA--, m.endB--);
|
|
14624
|
-
let v = c.doc.resolveNoCache(m.start - c.from),
|
|
14625
|
-
if ((Cn && n.input.lastIOSEnter > Date.now() - 225 && (!
|
|
14626
|
+
let v = c.doc.resolveNoCache(m.start - c.from), b = c.doc.resolveNoCache(m.endB - c.from), g = u.resolve(m.start), y = v.sameParent(b) && v.parent.inlineContent && g.end() >= m.endA;
|
|
14627
|
+
if ((Cn && n.input.lastIOSEnter > Date.now() - 225 && (!y || r.some((T) => T.nodeName == "DIV" || T.nodeName == "P")) || !y && v.pos < c.doc.content.size && (!v.sameParent(b) || !v.parent.inlineContent) && v.pos < b.pos && !/\S/.test(c.doc.textBetween(v.pos, b.pos, "", ""))) && n.someProp("handleKeyDown", (T) => T(n, Dt(13, "Enter")))) {
|
|
14626
14628
|
n.input.lastIOSEnter = 0;
|
|
14627
14629
|
return;
|
|
14628
14630
|
}
|
|
14629
|
-
if (n.state.selection.anchor > m.start && _4(u, m.start, m.endA, v,
|
|
14631
|
+
if (n.state.selection.anchor > m.start && _4(u, m.start, m.endA, v, b) && n.someProp("handleKeyDown", (T) => T(n, Dt(8, "Backspace")))) {
|
|
14630
14632
|
at && ue && n.domObserver.suppressSelectionUpdates();
|
|
14631
14633
|
return;
|
|
14632
14634
|
}
|
|
14633
|
-
ue && m.endB == m.start && (n.input.lastChromeDelete = Date.now()), at && !
|
|
14635
|
+
ue && m.endB == m.start && (n.input.lastChromeDelete = Date.now()), at && !y && v.start() != b.start() && b.parentOffset == 0 && v.depth == b.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == m.endA && (m.endB -= 2, b = c.doc.resolveNoCache(m.endB - c.from), setTimeout(() => {
|
|
14634
14636
|
n.someProp("handleKeyDown", function(T) {
|
|
14635
14637
|
return T(n, Dt(13, "Enter"));
|
|
14636
14638
|
});
|
|
@@ -14643,19 +14645,19 @@ function T4(n, e, t, i, r) {
|
|
|
14643
14645
|
}
|
|
14644
14646
|
return s && E.setMeta("composition", s), E.scrollIntoView();
|
|
14645
14647
|
}, x;
|
|
14646
|
-
if (
|
|
14647
|
-
if (v.pos ==
|
|
14648
|
+
if (y)
|
|
14649
|
+
if (v.pos == b.pos) {
|
|
14648
14650
|
De && Ct <= 11 && v.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ct(n), 20));
|
|
14649
14651
|
let T = S(n.state.tr.delete(k, w)), E = u.resolve(m.start).marksAcross(u.resolve(m.endA));
|
|
14650
14652
|
E && T.ensureMarks(E), n.dispatch(T);
|
|
14651
14653
|
} else if (
|
|
14652
14654
|
// Adding or removing a mark
|
|
14653
|
-
m.endA == m.endB && (x = M4(v.parent.content.cut(v.parentOffset,
|
|
14655
|
+
m.endA == m.endB && (x = M4(v.parent.content.cut(v.parentOffset, b.parentOffset), g.parent.content.cut(g.parentOffset, m.endA - g.start())))
|
|
14654
14656
|
) {
|
|
14655
14657
|
let T = S(n.state.tr);
|
|
14656
14658
|
x.type == "add" ? T.addMark(k, w, x.mark) : T.removeMark(k, w, x.mark), n.dispatch(T);
|
|
14657
|
-
} else if (v.parent.child(v.index()).isText && v.index() ==
|
|
14658
|
-
let T = v.parent.textBetween(v.parentOffset,
|
|
14659
|
+
} else if (v.parent.child(v.index()).isText && v.index() == b.index() - (b.textOffset ? 0 : 1)) {
|
|
14660
|
+
let T = v.parent.textBetween(v.parentOffset, b.parentOffset), E = () => S(n.state.tr.insertText(T, k, w));
|
|
14659
14661
|
n.someProp("handleTextInput", (N) => N(n, k, w, T, E)) || n.dispatch(E());
|
|
14660
14662
|
} else
|
|
14661
14663
|
n.dispatch(S());
|
|
@@ -15322,8 +15324,8 @@ var kr = class {
|
|
|
15322
15324
|
const { rawCommands: t, editor: i, state: r } = this, { view: s } = i, o = [], a = !!n, l = n || r.tr, c = () => (!a && e && !l.getMeta("preventDispatch") && !this.hasCustomState && s.dispatch(l), o.every((d) => d === !0)), u = {
|
|
15323
15325
|
...Object.fromEntries(
|
|
15324
15326
|
Object.entries(t).map(([d, f]) => [d, (...m) => {
|
|
15325
|
-
const v = this.buildProps(l, e),
|
|
15326
|
-
return o.push(
|
|
15327
|
+
const v = this.buildProps(l, e), b = f(...m)(v);
|
|
15328
|
+
return o.push(b), u;
|
|
15327
15329
|
}])
|
|
15328
15330
|
),
|
|
15329
15331
|
run: c
|
|
@@ -15674,10 +15676,10 @@ var sv = (n) => !("type" in n), ov = (n, e, t) => ({ tr: i, dispatch: r, editor:
|
|
|
15674
15676
|
...t
|
|
15675
15677
|
};
|
|
15676
15678
|
let a;
|
|
15677
|
-
const l = (
|
|
15679
|
+
const l = (b) => {
|
|
15678
15680
|
s.emit("contentError", {
|
|
15679
15681
|
editor: s,
|
|
15680
|
-
error:
|
|
15682
|
+
error: b,
|
|
15681
15683
|
disableCollaboration: () => {
|
|
15682
15684
|
"collaboration" in s.storage && typeof s.storage.collaboration == "object" && s.storage.collaboration && (s.storage.collaboration.isDisabled = !0);
|
|
15683
15685
|
}
|
|
@@ -15692,40 +15694,40 @@ var sv = (n) => !("type" in n), ov = (n, e, t) => ({ tr: i, dispatch: r, editor:
|
|
|
15692
15694
|
parseOptions: c,
|
|
15693
15695
|
errorOnInvalidContent: !0
|
|
15694
15696
|
});
|
|
15695
|
-
} catch (
|
|
15696
|
-
l(
|
|
15697
|
+
} catch (b) {
|
|
15698
|
+
l(b);
|
|
15697
15699
|
}
|
|
15698
15700
|
try {
|
|
15699
15701
|
a = Qn(e, s.schema, {
|
|
15700
15702
|
parseOptions: c,
|
|
15701
15703
|
errorOnInvalidContent: (o = t.errorOnInvalidContent) != null ? o : s.options.enableContentCheck
|
|
15702
15704
|
});
|
|
15703
|
-
} catch (
|
|
15704
|
-
return l(
|
|
15705
|
+
} catch (b) {
|
|
15706
|
+
return l(b), !1;
|
|
15705
15707
|
}
|
|
15706
15708
|
let { from: u, to: d } = typeof n == "number" ? { from: n, to: n } : { from: n.from, to: n.to }, f = !0, p = !0;
|
|
15707
|
-
if ((sv(a) ? a : [a]).forEach((
|
|
15708
|
-
|
|
15709
|
+
if ((sv(a) ? a : [a]).forEach((b) => {
|
|
15710
|
+
b.check(), f = f ? b.isText && b.marks.length === 0 : !1, p = p ? b.isBlock : !1;
|
|
15709
15711
|
}), u === d && p) {
|
|
15710
|
-
const { parent:
|
|
15711
|
-
|
|
15712
|
+
const { parent: b } = i.doc.resolve(u);
|
|
15713
|
+
b.isTextblock && !b.type.spec.code && !b.childCount && (u -= 1, d += 1);
|
|
15712
15714
|
}
|
|
15713
15715
|
let v;
|
|
15714
15716
|
if (f) {
|
|
15715
15717
|
if (Array.isArray(e))
|
|
15716
|
-
v = e.map((
|
|
15718
|
+
v = e.map((b) => b.text || "").join("");
|
|
15717
15719
|
else if (e instanceof M) {
|
|
15718
|
-
let
|
|
15720
|
+
let b = "";
|
|
15719
15721
|
e.forEach((g) => {
|
|
15720
|
-
g.text && (
|
|
15721
|
-
}), v =
|
|
15722
|
+
g.text && (b += g.text);
|
|
15723
|
+
}), v = b;
|
|
15722
15724
|
} else
|
|
15723
15725
|
typeof e == "object" && e && e.text ? v = e.text : v = e;
|
|
15724
15726
|
i.insertText(v, u, d);
|
|
15725
15727
|
} else {
|
|
15726
15728
|
v = a;
|
|
15727
|
-
const
|
|
15728
|
-
|
|
15729
|
+
const b = i.doc.resolve(u), g = b.node(), y = b.parentOffset === 0, k = g.isText || g.isTextblock, w = g.content.size > 0;
|
|
15730
|
+
y && k && w && (u = Math.max(0, u - 1)), i.replaceWith(u, d, v);
|
|
15729
15731
|
}
|
|
15730
15732
|
t.updateSelection && rv(i, i.steps.length - 1, -1), t.applyInputRules && i.setMeta("applyInputRules", { from: u, text: v }), t.applyPasteRules && i.setMeta("applyPasteRules", { from: u, text: v });
|
|
15731
15733
|
}
|
|
@@ -16070,8 +16072,8 @@ function Rv(n, e) {
|
|
|
16070
16072
|
options: c.options,
|
|
16071
16073
|
storage: c.storage,
|
|
16072
16074
|
editor: e
|
|
16073
|
-
}, f = n.reduce((g,
|
|
16074
|
-
const k = I(
|
|
16075
|
+
}, f = n.reduce((g, y) => {
|
|
16076
|
+
const k = I(y, "extendNodeSchema", d);
|
|
16075
16077
|
return {
|
|
16076
16078
|
...g,
|
|
16077
16079
|
...k ? k(c) : {}
|
|
@@ -16102,21 +16104,21 @@ function Rv(n, e) {
|
|
|
16102
16104
|
node: g,
|
|
16103
16105
|
HTMLAttributes: ir(g, u)
|
|
16104
16106
|
}));
|
|
16105
|
-
const
|
|
16106
|
-
return
|
|
16107
|
+
const b = I(c, "renderText", d);
|
|
16108
|
+
return b && (p.toText = b), [c.name, p];
|
|
16107
16109
|
})
|
|
16108
16110
|
), l = Object.fromEntries(
|
|
16109
16111
|
s.map((c) => {
|
|
16110
|
-
const u = i.filter((
|
|
16112
|
+
const u = i.filter((b) => b.type === c.name), d = {
|
|
16111
16113
|
name: c.name,
|
|
16112
16114
|
options: c.options,
|
|
16113
16115
|
storage: c.storage,
|
|
16114
16116
|
editor: e
|
|
16115
|
-
}, f = n.reduce((
|
|
16116
|
-
const
|
|
16117
|
+
}, f = n.reduce((b, g) => {
|
|
16118
|
+
const y = I(g, "extendMarkSchema", d);
|
|
16117
16119
|
return {
|
|
16118
|
-
...
|
|
16119
|
-
...
|
|
16120
|
+
...b,
|
|
16121
|
+
...y ? y(c) : {}
|
|
16120
16122
|
};
|
|
16121
16123
|
}, {}), p = wc({
|
|
16122
16124
|
...f,
|
|
@@ -16128,12 +16130,12 @@ function Rv(n, e) {
|
|
|
16128
16130
|
attrs: Object.fromEntries(u.map(Cc))
|
|
16129
16131
|
}), m = G(I(c, "parseHTML", d));
|
|
16130
16132
|
m && (p.parseDOM = m.map(
|
|
16131
|
-
(
|
|
16133
|
+
(b) => bc(b, u)
|
|
16132
16134
|
));
|
|
16133
16135
|
const v = I(c, "renderHTML", d);
|
|
16134
|
-
return v && (p.toDOM = (
|
|
16135
|
-
mark:
|
|
16136
|
-
HTMLAttributes: ir(
|
|
16136
|
+
return v && (p.toDOM = (b) => v({
|
|
16137
|
+
mark: b,
|
|
16138
|
+
HTMLAttributes: ir(b, u)
|
|
16137
16139
|
})), [c.name, p];
|
|
16138
16140
|
})
|
|
16139
16141
|
);
|
|
@@ -16277,15 +16279,15 @@ function ro(n, e, t = {}) {
|
|
|
16277
16279
|
const a = [];
|
|
16278
16280
|
if (r.forEach(({ $from: d, $to: f }) => {
|
|
16279
16281
|
const p = d.pos, m = f.pos;
|
|
16280
|
-
n.doc.nodesBetween(p, m, (v,
|
|
16282
|
+
n.doc.nodesBetween(p, m, (v, b) => {
|
|
16281
16283
|
if (!v.isText && !v.marks.length)
|
|
16282
16284
|
return;
|
|
16283
|
-
const g = Math.max(p,
|
|
16285
|
+
const g = Math.max(p, b), y = Math.min(m, b + v.nodeSize), k = y - g;
|
|
16284
16286
|
o += k, a.push(
|
|
16285
16287
|
...v.marks.map((w) => ({
|
|
16286
16288
|
mark: w,
|
|
16287
16289
|
from: g,
|
|
16288
|
-
to:
|
|
16290
|
+
to: y
|
|
16289
16291
|
}))
|
|
16290
16292
|
);
|
|
16291
16293
|
});
|
|
@@ -16478,8 +16480,8 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16478
16480
|
}
|
|
16479
16481
|
] : void 0), i) {
|
|
16480
16482
|
if (m && (s instanceof F && e.deleteSelection(), e.split(e.mapping.map(a.pos), 1, p), f && !d && !a.parentOffset && a.parent.type !== f)) {
|
|
16481
|
-
const v = e.mapping.map(a.before()),
|
|
16482
|
-
a.node(-1).canReplaceWith(
|
|
16483
|
+
const v = e.mapping.map(a.before()), b = e.doc.resolve(v);
|
|
16484
|
+
a.node(-1).canReplaceWith(b.index(), b.index() + 1, f) && e.setNodeMarkup(e.mapping.map(a.before()), f);
|
|
16483
16485
|
}
|
|
16484
16486
|
n && xc(t, r.extensionManager.splittableMarks), e.scrollIntoView();
|
|
16485
16487
|
}
|
|
@@ -16498,8 +16500,8 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16498
16500
|
return !1;
|
|
16499
16501
|
if (r) {
|
|
16500
16502
|
let g = M.empty;
|
|
16501
|
-
const
|
|
16502
|
-
for (let E = l.depth -
|
|
16503
|
+
const y = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;
|
|
16504
|
+
for (let E = l.depth - y; E >= l.depth - 3; E -= 1)
|
|
16503
16505
|
g = M.from(l.node(E).copy(g));
|
|
16504
16506
|
const k = (
|
|
16505
16507
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -16509,8 +16511,8 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16509
16511
|
...e
|
|
16510
16512
|
}, S = ((o = a.contentMatch.defaultType) == null ? void 0 : o.createAndFill(w)) || void 0;
|
|
16511
16513
|
g = g.append(M.from(a.createAndFill(null, S) || void 0));
|
|
16512
|
-
const x = l.before(l.depth - (
|
|
16513
|
-
t.replace(x, l.after(-k), new A(g, 4 -
|
|
16514
|
+
const x = l.before(l.depth - (y - 1));
|
|
16515
|
+
t.replace(x, l.after(-k), new A(g, 4 - y, 0));
|
|
16514
16516
|
let T = -1;
|
|
16515
16517
|
t.doc.nodesBetween(x, t.doc.content.size, (E, N) => {
|
|
16516
16518
|
if (T > -1)
|
|
@@ -16528,15 +16530,15 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16528
16530
|
...e
|
|
16529
16531
|
};
|
|
16530
16532
|
t.delete(l.pos, c.pos);
|
|
16531
|
-
const
|
|
16533
|
+
const b = p ? [
|
|
16532
16534
|
{ type: a, attrs: m },
|
|
16533
16535
|
{ type: p, attrs: v }
|
|
16534
16536
|
] : [{ type: a, attrs: m }];
|
|
16535
16537
|
if (!fn(t.doc, l.pos, 2))
|
|
16536
16538
|
return !1;
|
|
16537
16539
|
if (r) {
|
|
16538
|
-
const { selection: g, storedMarks:
|
|
16539
|
-
if (t.split(l.pos, 2,
|
|
16540
|
+
const { selection: g, storedMarks: y } = i, { splittableMarks: k } = s.extensionManager, w = y || g.$to.parentOffset && g.$from.marks();
|
|
16541
|
+
if (t.split(l.pos, 2, b).scrollIntoView(), !w || !r)
|
|
16540
16542
|
return !0;
|
|
16541
16543
|
const S = w.filter((x) => k.includes(x.type.name));
|
|
16542
16544
|
t.ensureMarks(S);
|
|
@@ -16561,7 +16563,7 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16561
16563
|
const r = n.doc.nodeAt(i);
|
|
16562
16564
|
return t.node.type === (r == null ? void 0 : r.type) && Xt(n.doc, i) && n.join(i), !0;
|
|
16563
16565
|
}, r8 = (n, e, t, i = {}) => ({ editor: r, tr: s, state: o, dispatch: a, chain: l, commands: c, can: u }) => {
|
|
16564
|
-
const { extensions: d, splittableMarks: f } = r.extensionManager, p = fe(n, o.schema), m = fe(e, o.schema), { selection: v, storedMarks:
|
|
16566
|
+
const { extensions: d, splittableMarks: f } = r.extensionManager, p = fe(n, o.schema), m = fe(e, o.schema), { selection: v, storedMarks: b } = o, { $from: g, $to: y } = v, k = g.blockRange(y), w = b || v.$to.parentOffset && v.$from.marks();
|
|
16565
16567
|
if (!k)
|
|
16566
16568
|
return !1;
|
|
16567
16569
|
const S = ea((x) => Sc(x.type.name, d))(v);
|
|
@@ -16617,7 +16619,7 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16617
16619
|
return !0;
|
|
16618
16620
|
if (u && o) {
|
|
16619
16621
|
let { from: f, to: p } = a;
|
|
16620
|
-
const m = (s = c.marks().find((
|
|
16622
|
+
const m = (s = c.marks().find((b) => b.type === l)) == null ? void 0 : s.attrs, v = Kh(c, l, m);
|
|
16621
16623
|
v && (f = v.from, p = v.to), t.removeMark(f, p, l);
|
|
16622
16624
|
} else
|
|
16623
16625
|
d.forEach((f) => {
|
|
@@ -16646,20 +16648,20 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16646
16648
|
return t.selection.ranges.forEach((c) => {
|
|
16647
16649
|
const u = c.$from.pos, d = c.$to.pos;
|
|
16648
16650
|
let f, p, m, v;
|
|
16649
|
-
t.selection.empty ? i.doc.nodesBetween(u, d, (
|
|
16650
|
-
s && s ===
|
|
16651
|
-
}) : i.doc.nodesBetween(u, d, (
|
|
16652
|
-
g < u && s && s ===
|
|
16653
|
-
...
|
|
16651
|
+
t.selection.empty ? i.doc.nodesBetween(u, d, (b, g) => {
|
|
16652
|
+
s && s === b.type && (l = !0, m = Math.max(g, u), v = Math.min(g + b.nodeSize, d), f = g, p = b);
|
|
16653
|
+
}) : i.doc.nodesBetween(u, d, (b, g) => {
|
|
16654
|
+
g < u && s && s === b.type && (l = !0, m = Math.max(g, u), v = Math.min(g + b.nodeSize, d), f = g, p = b), g >= u && g <= d && (s && s === b.type && (l = !0, r && t.setNodeMarkup(g, void 0, {
|
|
16655
|
+
...b.attrs,
|
|
16654
16656
|
...e
|
|
16655
|
-
})), o &&
|
|
16656
|
-
if (o ===
|
|
16657
|
-
const k = Math.max(g, u), w = Math.min(g +
|
|
16657
|
+
})), o && b.marks.length && b.marks.forEach((y) => {
|
|
16658
|
+
if (o === y.type && (l = !0, r)) {
|
|
16659
|
+
const k = Math.max(g, u), w = Math.min(g + b.nodeSize, d);
|
|
16658
16660
|
t.addMark(
|
|
16659
16661
|
k,
|
|
16660
16662
|
w,
|
|
16661
16663
|
o.create({
|
|
16662
|
-
...
|
|
16664
|
+
...y.attrs,
|
|
16663
16665
|
...e
|
|
16664
16666
|
})
|
|
16665
16667
|
);
|
|
@@ -16668,12 +16670,12 @@ var n8 = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor
|
|
|
16668
16670
|
}), p && (f !== void 0 && r && t.setNodeMarkup(f, void 0, {
|
|
16669
16671
|
...p.attrs,
|
|
16670
16672
|
...e
|
|
16671
|
-
}), o && p.marks.length && p.marks.forEach((
|
|
16672
|
-
o ===
|
|
16673
|
+
}), o && p.marks.length && p.marks.forEach((b) => {
|
|
16674
|
+
o === b.type && r && t.addMark(
|
|
16673
16675
|
m,
|
|
16674
16676
|
v,
|
|
16675
16677
|
o.create({
|
|
16676
|
-
...
|
|
16678
|
+
...b.attrs,
|
|
16677
16679
|
...e
|
|
16678
16680
|
})
|
|
16679
16681
|
);
|
|
@@ -16745,19 +16747,19 @@ function Mi(n) {
|
|
|
16745
16747
|
const m = l.state.tr, v = Cr({
|
|
16746
16748
|
state: l.state,
|
|
16747
16749
|
transaction: m
|
|
16748
|
-
}),
|
|
16750
|
+
}), b = {
|
|
16749
16751
|
from: i - (p[0].length - s.length),
|
|
16750
16752
|
to: r
|
|
16751
|
-
}, { commands: g, chain:
|
|
16753
|
+
}, { commands: g, chain: y, can: k } = new kr({
|
|
16752
16754
|
editor: t,
|
|
16753
16755
|
state: v
|
|
16754
16756
|
});
|
|
16755
16757
|
f.handler({
|
|
16756
16758
|
state: v,
|
|
16757
|
-
range:
|
|
16759
|
+
range: b,
|
|
16758
16760
|
match: p,
|
|
16759
16761
|
commands: g,
|
|
16760
|
-
chain:
|
|
16762
|
+
chain: y,
|
|
16761
16763
|
can: k
|
|
16762
16764
|
}) === null || !m.steps.length || (f.undoable && m.setMeta(a, {
|
|
16763
16765
|
transform: m,
|
|
@@ -16938,10 +16940,10 @@ function S8(n) {
|
|
|
16938
16940
|
state: t
|
|
16939
16941
|
}), d = [];
|
|
16940
16942
|
return t.doc.nodesBetween(i, r, (p, m) => {
|
|
16941
|
-
var v,
|
|
16942
|
-
if ((
|
|
16943
|
+
var v, b, g, y, k;
|
|
16944
|
+
if ((b = (v = p.type) == null ? void 0 : v.spec) != null && b.code || !(p.isText || p.isTextblock || p.isInline))
|
|
16943
16945
|
return;
|
|
16944
|
-
const w = (k = (
|
|
16946
|
+
const w = (k = (y = (g = p.content) == null ? void 0 : g.size) != null ? y : p.nodeSize) != null ? k : 0, S = Math.max(i, m), x = Math.min(r, m + w);
|
|
16945
16947
|
if (S >= x)
|
|
16946
16948
|
return;
|
|
16947
16949
|
const T = p.isText ? p.text || "" : p.textBetween(S - m, x - m, void 0, "");
|
|
@@ -16987,13 +16989,13 @@ function T8(n) {
|
|
|
16987
16989
|
rule: p,
|
|
16988
16990
|
pasteEvt: m
|
|
16989
16991
|
}) => {
|
|
16990
|
-
const v = u.tr,
|
|
16992
|
+
const v = u.tr, b = Cr({
|
|
16991
16993
|
state: u,
|
|
16992
16994
|
transaction: v
|
|
16993
16995
|
});
|
|
16994
16996
|
if (!(!S8({
|
|
16995
16997
|
editor: e,
|
|
16996
|
-
state:
|
|
16998
|
+
state: b,
|
|
16997
16999
|
from: Math.max(d - 1, 0),
|
|
16998
17000
|
to: f.b - 1,
|
|
16999
17001
|
rule: p,
|
|
@@ -17002,7 +17004,7 @@ function T8(n) {
|
|
|
17002
17004
|
}) || !v.steps.length)) {
|
|
17003
17005
|
try {
|
|
17004
17006
|
a = typeof DragEvent < "u" ? new DragEvent("drop") : null;
|
|
17005
|
-
} catch (
|
|
17007
|
+
} catch (y) {
|
|
17006
17008
|
a = null;
|
|
17007
17009
|
}
|
|
17008
17010
|
return o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, v;
|
|
@@ -17043,10 +17045,10 @@ function T8(n) {
|
|
|
17043
17045
|
}
|
|
17044
17046
|
},
|
|
17045
17047
|
appendTransaction: (d, f, p) => {
|
|
17046
|
-
const m = d[0], v = m.getMeta("uiEvent") === "paste" && !r,
|
|
17047
|
-
if (!v && !
|
|
17048
|
+
const m = d[0], v = m.getMeta("uiEvent") === "paste" && !r, b = m.getMeta("uiEvent") === "drop" && !s, g = m.getMeta("applyPasteRules"), y = !!g;
|
|
17049
|
+
if (!v && !b && !y)
|
|
17048
17050
|
return;
|
|
17049
|
-
if (
|
|
17051
|
+
if (y) {
|
|
17050
17052
|
let { text: S } = g;
|
|
17051
17053
|
typeof S == "string" ? S = S : S = na(M.from(S), p.schema);
|
|
17052
17054
|
const { from: x } = g, T = x + S.length, E = x8(S);
|
|
@@ -17334,14 +17336,14 @@ var ae = class cf extends ra {
|
|
|
17334
17336
|
const u = Av(n.before, [n, ...e]);
|
|
17335
17337
|
Hv(u).forEach((p) => {
|
|
17336
17338
|
u.mapping.mapResult(p.oldRange.from).deletedAfter && u.mapping.mapResult(p.oldRange.to).deletedBefore && u.before.nodesBetween(p.oldRange.from, p.oldRange.to, (m, v) => {
|
|
17337
|
-
const
|
|
17339
|
+
const b = v + m.nodeSize - 2, g = p.oldRange.from <= v && b <= p.oldRange.to;
|
|
17338
17340
|
this.editor.emit("delete", {
|
|
17339
17341
|
type: "node",
|
|
17340
17342
|
node: m,
|
|
17341
17343
|
from: v,
|
|
17342
|
-
to:
|
|
17344
|
+
to: b,
|
|
17343
17345
|
newFrom: u.mapping.map(v),
|
|
17344
|
-
newTo: u.mapping.map(
|
|
17346
|
+
newTo: u.mapping.map(b),
|
|
17345
17347
|
deletedRange: p.oldRange,
|
|
17346
17348
|
newRange: p.newRange,
|
|
17347
17349
|
partial: !g,
|
|
@@ -17353,9 +17355,9 @@ var ae = class cf extends ra {
|
|
|
17353
17355
|
});
|
|
17354
17356
|
const f = u.mapping;
|
|
17355
17357
|
u.steps.forEach((p, m) => {
|
|
17356
|
-
var v,
|
|
17358
|
+
var v, b;
|
|
17357
17359
|
if (p instanceof Xe) {
|
|
17358
|
-
const g = f.slice(m).map(p.from, -1),
|
|
17360
|
+
const g = f.slice(m).map(p.from, -1), y = f.slice(m).map(p.to), k = f.invert().map(g, -1), w = f.invert().map(y), S = (v = u.doc.nodeAt(g - 1)) == null ? void 0 : v.marks.some((T) => T.eq(p.mark)), x = (b = u.doc.nodeAt(y)) == null ? void 0 : b.marks.some((T) => T.eq(p.mark));
|
|
17359
17361
|
this.editor.emit("delete", {
|
|
17360
17362
|
type: "mark",
|
|
17361
17363
|
mark: p.mark,
|
|
@@ -17367,7 +17369,7 @@ var ae = class cf extends ra {
|
|
|
17367
17369
|
},
|
|
17368
17370
|
newRange: {
|
|
17369
17371
|
from: g,
|
|
17370
|
-
to:
|
|
17372
|
+
to: y
|
|
17371
17373
|
},
|
|
17372
17374
|
partial: !!(x || S),
|
|
17373
17375
|
editor: this.editor,
|
|
@@ -17441,7 +17443,7 @@ var ae = class cf extends ra {
|
|
|
17441
17443
|
() => o.undoInputRule(),
|
|
17442
17444
|
// maybe convert first text block node to default node
|
|
17443
17445
|
() => o.command(({ tr: a }) => {
|
|
17444
|
-
const { selection: l, doc: c } = a, { empty: u, $anchor: d } = l, { pos: f, parent: p } = d, m = d.parent.isTextblock && f > 0 ? a.doc.resolve(f - 1) : d, v = m.parent.type.spec.isolating,
|
|
17446
|
+
const { selection: l, doc: c } = a, { empty: u, $anchor: d } = l, { pos: f, parent: p } = d, m = d.parent.isTextblock && f > 0 ? a.doc.resolve(f - 1) : d, v = m.parent.type.spec.isolating, b = d.pos - d.parentOffset, g = v && m.parent.childCount === 1 ? b === d.pos : V.atStart(c).from === f;
|
|
17445
17447
|
return !u || !p.type.isTextblock || p.textContent.length || !g || g && d.parent.type.name === "paragraph" ? !1 : o.clearNodes();
|
|
17446
17448
|
}),
|
|
17447
17449
|
() => o.deleteSelection(),
|
|
@@ -18491,12 +18493,12 @@ function R8(n) {
|
|
|
18491
18493
|
const p = new RegExp("^:::".concat(l, "(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)")), m = u.match(p);
|
|
18492
18494
|
if (!m)
|
|
18493
18495
|
return;
|
|
18494
|
-
const v = m[1] || "",
|
|
18495
|
-
if (!o.find((
|
|
18496
|
+
const v = m[1] || "", b = i(v);
|
|
18497
|
+
if (!o.find((y) => !(y in b)))
|
|
18496
18498
|
return {
|
|
18497
18499
|
type: e,
|
|
18498
18500
|
raw: m[0],
|
|
18499
|
-
attributes:
|
|
18501
|
+
attributes: b
|
|
18500
18502
|
};
|
|
18501
18503
|
}
|
|
18502
18504
|
},
|
|
@@ -18545,10 +18547,10 @@ function P8(n) {
|
|
|
18545
18547
|
},
|
|
18546
18548
|
tokenize(d, f, p) {
|
|
18547
18549
|
var m;
|
|
18548
|
-
const v = new RegExp("^:::".concat(c, "(?:\\s+\\{([^}]*)\\})?\\s*\\n")),
|
|
18549
|
-
if (!
|
|
18550
|
+
const v = new RegExp("^:::".concat(c, "(?:\\s+\\{([^}]*)\\})?\\s*\\n")), b = d.match(v);
|
|
18551
|
+
if (!b)
|
|
18550
18552
|
return;
|
|
18551
|
-
const [g,
|
|
18553
|
+
const [g, y = ""] = b, k = r(y);
|
|
18552
18554
|
let w = 1;
|
|
18553
18555
|
const S = g.length;
|
|
18554
18556
|
let x = "";
|
|
@@ -18592,8 +18594,8 @@ function P8(n) {
|
|
|
18592
18594
|
}
|
|
18593
18595
|
},
|
|
18594
18596
|
renderMarkdown: (d, f) => {
|
|
18595
|
-
const p = u(d.attrs || {}), m = s(p), v = m ? " {".concat(m, "}") : "",
|
|
18596
|
-
return ":::".concat(c).concat(v, "\n\n").concat(
|
|
18597
|
+
const p = u(d.attrs || {}), m = s(p), v = m ? " {".concat(m, "}") : "", b = f.renderChildren(d.content || [], "\n\n");
|
|
18598
|
+
return ":::".concat(c).concat(v, "\n\n").concat(b, "\n\n:::");
|
|
18597
18599
|
}
|
|
18598
18600
|
};
|
|
18599
18601
|
}
|
|
@@ -18645,21 +18647,21 @@ function B8(n) {
|
|
|
18645
18647
|
return v !== void 0 ? v : -1;
|
|
18646
18648
|
},
|
|
18647
18649
|
tokenize(f, p, m) {
|
|
18648
|
-
const v = a ? new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]")) : new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(d, "\\]")),
|
|
18649
|
-
if (!
|
|
18650
|
+
const v = a ? new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]")) : new RegExp("^\\[".concat(d, "\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(d, "\\]")), b = f.match(v);
|
|
18651
|
+
if (!b)
|
|
18650
18652
|
return;
|
|
18651
|
-
let g = "",
|
|
18653
|
+
let g = "", y = "";
|
|
18652
18654
|
if (a) {
|
|
18653
|
-
const [, w] =
|
|
18654
|
-
|
|
18655
|
+
const [, w] = b;
|
|
18656
|
+
y = w;
|
|
18655
18657
|
} else {
|
|
18656
|
-
const [, w, S] =
|
|
18657
|
-
|
|
18658
|
+
const [, w, S] = b;
|
|
18659
|
+
y = w, g = S || "";
|
|
18658
18660
|
}
|
|
18659
|
-
const k = r(
|
|
18661
|
+
const k = r(y.trim());
|
|
18660
18662
|
return {
|
|
18661
18663
|
type: e,
|
|
18662
|
-
raw:
|
|
18664
|
+
raw: b[0],
|
|
18663
18665
|
content: g.trim(),
|
|
18664
18666
|
attributes: k
|
|
18665
18667
|
};
|
|
@@ -18668,8 +18670,8 @@ function B8(n) {
|
|
|
18668
18670
|
renderMarkdown: (f) => {
|
|
18669
18671
|
let p = "";
|
|
18670
18672
|
i ? p = i(f) : f.content && f.content.length > 0 && (p = f.content.filter((g) => g.type === "text").map((g) => g.text).join(""));
|
|
18671
|
-
const m = u(f.attrs || {}), v = s(m),
|
|
18672
|
-
return a ? "[".concat(c).concat(
|
|
18673
|
+
const m = u(f.attrs || {}), v = s(m), b = v ? " ".concat(v) : "";
|
|
18674
|
+
return a ? "[".concat(c).concat(b, "]") : "[".concat(c).concat(b, "]").concat(p, "[/").concat(c, "]");
|
|
18673
18675
|
}
|
|
18674
18676
|
};
|
|
18675
18677
|
}
|
|
@@ -18689,9 +18691,9 @@ function F8(n, e, t) {
|
|
|
18689
18691
|
} else
|
|
18690
18692
|
return;
|
|
18691
18693
|
}
|
|
18692
|
-
const m = e.extractItemData(p), { indentLevel: v, mainContent:
|
|
18694
|
+
const m = e.extractItemData(p), { indentLevel: v, mainContent: b } = m;
|
|
18693
18695
|
c = "".concat(c).concat(f, "\n");
|
|
18694
|
-
const g = [
|
|
18696
|
+
const g = [b];
|
|
18695
18697
|
for (u += 1; u < a.length; ) {
|
|
18696
18698
|
const S = a[u];
|
|
18697
18699
|
if (S.trim() === "") {
|
|
@@ -18709,13 +18711,13 @@ function F8(n, e, t) {
|
|
|
18709
18711
|
else
|
|
18710
18712
|
break;
|
|
18711
18713
|
}
|
|
18712
|
-
let
|
|
18714
|
+
let y;
|
|
18713
18715
|
const k = g.slice(1);
|
|
18714
18716
|
if (k.length > 0) {
|
|
18715
18717
|
const S = k.map((x) => x.slice(v + d)).join("\n");
|
|
18716
|
-
S.trim() && (e.customNestedParser ?
|
|
18718
|
+
S.trim() && (e.customNestedParser ? y = e.customNestedParser(S) : y = t.blockTokens(S));
|
|
18717
18719
|
}
|
|
18718
|
-
const w = e.createToken(m,
|
|
18720
|
+
const w = e.createToken(m, y);
|
|
18719
18721
|
l.push(w);
|
|
18720
18722
|
}
|
|
18721
18723
|
if (l.length !== 0)
|
|
@@ -18819,8 +18821,8 @@ class q8 {
|
|
|
18819
18821
|
if (p) {
|
|
18820
18822
|
let m = p.getBoundingClientRect(), v = d ? m.bottom : m.top;
|
|
18821
18823
|
d && f && (v = (v + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
|
|
18822
|
-
let
|
|
18823
|
-
i = { left: m.left, right: m.right, top: v -
|
|
18824
|
+
let b = this.width / 2 * a;
|
|
18825
|
+
i = { left: m.left, right: m.right, top: v - b, bottom: v + b };
|
|
18824
18826
|
}
|
|
18825
18827
|
}
|
|
18826
18828
|
}
|
|
@@ -19232,8 +19234,8 @@ class Ge {
|
|
|
19232
19234
|
o = Math.min(o, p);
|
|
19233
19235
|
let m = s.maps[p];
|
|
19234
19236
|
if (f.step) {
|
|
19235
|
-
let v = e.steps[p].invert(e.docs[p]),
|
|
19236
|
-
|
|
19237
|
+
let v = e.steps[p].invert(e.docs[p]), b = f.selection && f.selection.map(s.slice(l + 1, p));
|
|
19238
|
+
b && a++, i.push(new et(m, v, b));
|
|
19237
19239
|
} else
|
|
19238
19240
|
i.push(new et(m));
|
|
19239
19241
|
}, r);
|
|
@@ -19957,21 +19959,21 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
19957
19959
|
if (!u.current)
|
|
19958
19960
|
return;
|
|
19959
19961
|
const m = async (g) => {
|
|
19960
|
-
const
|
|
19962
|
+
const y = await t.opts.uploader.onUpload(g, () => {
|
|
19961
19963
|
}, {
|
|
19962
19964
|
context: t.context,
|
|
19963
19965
|
params: t.params
|
|
19964
19966
|
});
|
|
19965
|
-
if (!
|
|
19967
|
+
if (!y)
|
|
19966
19968
|
return { name: "", url: "" };
|
|
19967
|
-
const k = t.opts.uploader.getDownLoadUrl(
|
|
19969
|
+
const k = t.opts.uploader.getDownLoadUrl(y, {
|
|
19968
19970
|
context: t.context,
|
|
19969
19971
|
params: t.params
|
|
19970
19972
|
});
|
|
19971
|
-
return { name:
|
|
19973
|
+
return { name: y.name, url: k };
|
|
19972
19974
|
}, v = (g) => {
|
|
19973
19975
|
o(g), f();
|
|
19974
|
-
},
|
|
19976
|
+
}, b = new A8({
|
|
19975
19977
|
element: u.current,
|
|
19976
19978
|
extensions: [
|
|
19977
19979
|
U8,
|
|
@@ -19979,12 +19981,12 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
19979
19981
|
addKeyboardShortcuts() {
|
|
19980
19982
|
return {
|
|
19981
19983
|
"Mod-Enter": () => {
|
|
19982
|
-
var g,
|
|
19983
|
-
return (g = c.current) == null || g.commands.enter(), (
|
|
19984
|
+
var g, y;
|
|
19985
|
+
return (g = c.current) == null || g.commands.enter(), (y = c.current) == null || y.commands.scrollIntoView(), !0;
|
|
19984
19986
|
},
|
|
19985
19987
|
"Shift-Enter": () => {
|
|
19986
|
-
var g,
|
|
19987
|
-
return (g = c.current) == null || g.commands.setHardBreak(), (
|
|
19988
|
+
var g, y;
|
|
19989
|
+
return (g = c.current) == null || g.commands.setHardBreak(), (y = c.current) == null || y.commands.scrollIntoView(), !0;
|
|
19988
19990
|
}
|
|
19989
19991
|
};
|
|
19990
19992
|
}
|
|
@@ -20007,11 +20009,11 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20007
20009
|
draggable: !1
|
|
20008
20010
|
}),
|
|
20009
20011
|
S7.configure({
|
|
20010
|
-
onDrop: async (g,
|
|
20011
|
-
if (
|
|
20012
|
+
onDrop: async (g, y) => {
|
|
20013
|
+
if (y = y.filter((w) => w.type.startsWith("image/")), !y.length)
|
|
20012
20014
|
return;
|
|
20013
20015
|
const k = await Promise.all(
|
|
20014
|
-
|
|
20016
|
+
y.map((w) => m(w))
|
|
20015
20017
|
);
|
|
20016
20018
|
g.isDestroyed || g.chain().deleteSelection().insertContentAt(
|
|
20017
20019
|
g.state.selection.from,
|
|
@@ -20024,11 +20026,11 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20024
20026
|
}))
|
|
20025
20027
|
).focus().scrollIntoView().run();
|
|
20026
20028
|
},
|
|
20027
|
-
onPaste: async (g,
|
|
20028
|
-
if (
|
|
20029
|
+
onPaste: async (g, y) => {
|
|
20030
|
+
if (y = y.filter((w) => w.type.startsWith("image/")), !y.length)
|
|
20029
20031
|
return;
|
|
20030
20032
|
const k = await Promise.all(
|
|
20031
|
-
|
|
20033
|
+
y.map((w) => m(w))
|
|
20032
20034
|
);
|
|
20033
20035
|
g.isDestroyed || g.chain().deleteSelection().insertContentAt(
|
|
20034
20036
|
g.state.selection.from,
|
|
@@ -20045,16 +20047,16 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20045
20047
|
],
|
|
20046
20048
|
content: i || "",
|
|
20047
20049
|
editorProps: {
|
|
20048
|
-
handleKeyDown: (g,
|
|
20050
|
+
handleKeyDown: (g, y) => a(y)
|
|
20049
20051
|
},
|
|
20050
20052
|
onUpdate: () => {
|
|
20051
|
-
v(
|
|
20053
|
+
v(b.getHTML());
|
|
20052
20054
|
},
|
|
20053
20055
|
onCreate: () => {
|
|
20054
|
-
l(
|
|
20056
|
+
l(b);
|
|
20055
20057
|
}
|
|
20056
20058
|
});
|
|
20057
|
-
return c.current =
|
|
20059
|
+
return c.current = b, () => {
|
|
20058
20060
|
c.current && (c.current.destroy(), c.current = null);
|
|
20059
20061
|
};
|
|
20060
20062
|
}, []), Ju(e, () => ({
|
|
@@ -20126,27 +20128,30 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20126
20128
|
}, [l.value.remainingText, c]), B(() => {
|
|
20127
20129
|
if (!o.current || !window.ResizeObserver)
|
|
20128
20130
|
return;
|
|
20129
|
-
const
|
|
20131
|
+
const y = new ResizeObserver(() => {
|
|
20130
20132
|
var w;
|
|
20131
20133
|
const k = (w = t.value) == null ? void 0 : w.previewer.options.previewerDom;
|
|
20132
20134
|
k && (s.value = k.scrollHeight > i.value);
|
|
20133
20135
|
});
|
|
20134
|
-
return
|
|
20135
|
-
|
|
20136
|
+
return y.observe(o.current), () => {
|
|
20137
|
+
y.disconnect();
|
|
20136
20138
|
};
|
|
20137
20139
|
}, [o.current]);
|
|
20138
|
-
const p = (
|
|
20140
|
+
const p = (y) => {
|
|
20139
20141
|
!n.message || !n.controller || n.controller.refreshMessage(n.message, !0);
|
|
20140
|
-
}, m = (
|
|
20141
|
-
n.controller.reEditContent.value =
|
|
20142
|
-
}, v = (
|
|
20143
|
-
|
|
20144
|
-
},
|
|
20145
|
-
n.controller.reEditContentChanged.value && (
|
|
20146
|
-
}, g = (
|
|
20147
|
-
|
|
20148
|
-
n.controller.
|
|
20149
|
-
|
|
20142
|
+
}, m = (y) => {
|
|
20143
|
+
n.controller.reEditContent.value = y, n.controller.reEditContentChanged.value = !0;
|
|
20144
|
+
}, v = (y) => {
|
|
20145
|
+
y.stopPropagation(), n.controller.reEditCancel(n.message);
|
|
20146
|
+
}, b = (y) => {
|
|
20147
|
+
n.controller.reEditContentChanged.value && (y.stopPropagation(), n.controller.reEditSubmit(n.message));
|
|
20148
|
+
}, g = (y) => {
|
|
20149
|
+
if (y.code === "Escape" && y.key === "Escape" && n.message.reeditstate === !0)
|
|
20150
|
+
return y.stopPropagation(), n.controller.reEditCancel(n.message), !0;
|
|
20151
|
+
if (y.code === "Enter" && y.key === "Enter" && y.shiftKey === !1)
|
|
20152
|
+
return n.controller.reEditContentChanged.value && setTimeout(() => {
|
|
20153
|
+
n.controller.reEditSubmit(n.message);
|
|
20154
|
+
}, 0), y.stopPropagation(), !0;
|
|
20150
20155
|
};
|
|
20151
20156
|
return /* @__PURE__ */ h("div", { className: oe.b(), children: [
|
|
20152
20157
|
/* @__PURE__ */ h("div", { className: oe.e("user-header"), children: [
|
|
@@ -20172,15 +20177,13 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20172
20177
|
c: n.controller,
|
|
20173
20178
|
value: n.controller.reEditContent.value,
|
|
20174
20179
|
disabled: n.controller.isLoading.value,
|
|
20175
|
-
onCreate: (
|
|
20176
|
-
d.current =
|
|
20180
|
+
onCreate: (y) => {
|
|
20181
|
+
d.current = y, y.commands.focus("end");
|
|
20177
20182
|
},
|
|
20178
|
-
onChange: (
|
|
20179
|
-
m(
|
|
20183
|
+
onChange: (y) => {
|
|
20184
|
+
m(y);
|
|
20180
20185
|
},
|
|
20181
|
-
onKeyDown: (
|
|
20182
|
-
g(b);
|
|
20183
|
-
}
|
|
20186
|
+
onKeyDown: (y) => g(y)
|
|
20184
20187
|
}
|
|
20185
20188
|
),
|
|
20186
20189
|
/* @__PURE__ */ h("div", { className: oe.em("content", "re-edit-btns"), children: [
|
|
@@ -20188,8 +20191,8 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20188
20191
|
"div",
|
|
20189
20192
|
{
|
|
20190
20193
|
className: "".concat(oe.em("content", "re-edit-btn"), " ").concat(oe.em("content", "cancel-btn")),
|
|
20191
|
-
onClick: (
|
|
20192
|
-
v(
|
|
20194
|
+
onClick: (y) => {
|
|
20195
|
+
v(y);
|
|
20193
20196
|
},
|
|
20194
20197
|
children: C.t.value("cancel")
|
|
20195
20198
|
}
|
|
@@ -20198,22 +20201,22 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20198
20201
|
"div",
|
|
20199
20202
|
{
|
|
20200
20203
|
className: "".concat(oe.em("content", "re-edit-btn"), " ").concat(oe.em("content", "send-btn"), " ").concat(oe.is("disabled ", !n.controller.reEditContentChanged.value)),
|
|
20201
|
-
onClick: (
|
|
20202
|
-
y
|
|
20204
|
+
onClick: (y) => {
|
|
20205
|
+
b(y);
|
|
20203
20206
|
},
|
|
20204
20207
|
children: C.t.value("send")
|
|
20205
20208
|
}
|
|
20206
20209
|
)
|
|
20207
20210
|
] })
|
|
20208
20211
|
] }) : /* @__PURE__ */ h("div", { className: oe.em("content", "body"), children: [
|
|
20209
|
-
l.value.hasResources && /* @__PURE__ */ h("div", { className: oe.em("content", "material"), children: l.value.resources.map((
|
|
20212
|
+
l.value.hasResources && /* @__PURE__ */ h("div", { className: oe.em("content", "material"), children: l.value.resources.map((y) => /* @__PURE__ */ h(
|
|
20210
20213
|
fr,
|
|
20211
20214
|
{
|
|
20212
|
-
material:
|
|
20215
|
+
material: y,
|
|
20213
20216
|
disabled: !0,
|
|
20214
20217
|
controller: n.controller
|
|
20215
20218
|
},
|
|
20216
|
-
|
|
20219
|
+
y.id
|
|
20217
20220
|
)) }),
|
|
20218
20221
|
/* @__PURE__ */ h("div", { className: "pre-wrap-container", children: [
|
|
20219
20222
|
/* @__PURE__ */ h(
|
|
@@ -20271,11 +20274,11 @@ const nn = new L("chat-editor"), la = vd(
|
|
|
20271
20274
|
};
|
|
20272
20275
|
const Et = new L("error-message"), T7 = (n) => {
|
|
20273
20276
|
const { message: e, size: t } = n, [i, r] = U(!0), s = $(_e()), o = $(null), a = $({ resources: [], remainingText: "", hasResources: !1 }), l = (p) => {
|
|
20274
|
-
const { resources: m, remainingText: v, hasResources:
|
|
20277
|
+
const { resources: m, remainingText: v, hasResources: b, error: g } = dn.parseMixedContent(p);
|
|
20275
20278
|
a.value = {
|
|
20276
20279
|
resources: m,
|
|
20277
20280
|
remainingText: v,
|
|
20278
|
-
hasResources:
|
|
20281
|
+
hasResources: b,
|
|
20279
20282
|
error: g
|
|
20280
20283
|
};
|
|
20281
20284
|
};
|
|
@@ -20293,24 +20296,24 @@ const Et = new L("error-message"), T7 = (n) => {
|
|
|
20293
20296
|
}, e.think.done || (e.think.beginTime || (e.think.beginTime = Date.now()), e.think.endTime = void 0), e.think.done && !e.think.endTime && (e.think.endTime = Date.now(), e.think.collapse = !0);
|
|
20294
20297
|
}, u = (p) => {
|
|
20295
20298
|
const m = p.indexOf("<think>"), v = p.indexOf("</think>");
|
|
20296
|
-
let
|
|
20297
|
-
return v === -1 ? (
|
|
20299
|
+
let b = "", g = "", y = !1;
|
|
20300
|
+
return v === -1 ? (y = !1, b = p.slice(m + 7), g = "") : (y = !0, b = p.slice(m + 7, v), g = p.slice(v + 8)), { isThoughtCompleted: y, thoughtContent: b, answerContent: g };
|
|
20298
20301
|
}, d = (p) => {
|
|
20299
20302
|
const m = p.target, v = m == null ? void 0 : m.closest(
|
|
20300
20303
|
'a[href^="chunkview://"], a[href^="view://"], a[href^="action://"]'
|
|
20301
20304
|
);
|
|
20302
20305
|
if (v) {
|
|
20303
20306
|
p.preventDefault();
|
|
20304
|
-
const
|
|
20305
|
-
if (
|
|
20307
|
+
const b = v.getAttribute("href");
|
|
20308
|
+
if (b) {
|
|
20306
20309
|
let g = "";
|
|
20307
|
-
switch (
|
|
20310
|
+
switch (b.startsWith("chunkview://") ? g = "chunkview" : b.startsWith("view://") ? g = "view" : b.startsWith("action://") && (g = "action"), g) {
|
|
20308
20311
|
case "chunkview":
|
|
20309
20312
|
case "view":
|
|
20310
20313
|
case "action":
|
|
20311
20314
|
n.controller.handlePredefinedClick(
|
|
20312
20315
|
g,
|
|
20313
|
-
|
|
20316
|
+
b,
|
|
20314
20317
|
n.message,
|
|
20315
20318
|
p
|
|
20316
20319
|
);
|
|
@@ -20335,8 +20338,8 @@ const Et = new L("error-message"), T7 = (n) => {
|
|
|
20335
20338
|
}, [e, t]), B(() => {
|
|
20336
20339
|
let p = "";
|
|
20337
20340
|
if (e.content && e.content.indexOf("<think>") !== -1) {
|
|
20338
|
-
const { isThoughtCompleted: m, thoughtContent: v, answerContent:
|
|
20339
|
-
c(m, v),
|
|
20341
|
+
const { isThoughtCompleted: m, thoughtContent: v, answerContent: b } = u(e.content);
|
|
20342
|
+
c(m, v), b && l(b);
|
|
20340
20343
|
} else
|
|
20341
20344
|
l(e.content);
|
|
20342
20345
|
p = a.value.remainingText, o.value = new ao({
|
|
@@ -20720,7 +20723,7 @@ class Ac {
|
|
|
20720
20723
|
}
|
|
20721
20724
|
}
|
|
20722
20725
|
const Ie = new L("chat-toolbar-item"), E7 = (n) => {
|
|
20723
|
-
var v,
|
|
20726
|
+
var v, b, g;
|
|
20724
20727
|
const {
|
|
20725
20728
|
model: e,
|
|
20726
20729
|
data: t,
|
|
@@ -20728,35 +20731,35 @@ const Ie = new L("chat-toolbar-item"), E7 = (n) => {
|
|
|
20728
20731
|
disabled: r = !1,
|
|
20729
20732
|
buttonType: s = "default",
|
|
20730
20733
|
onClick: o
|
|
20731
|
-
} = n, [a, l] = U(!1), c = H(null), u = (
|
|
20734
|
+
} = n, [a, l] = U(!1), c = H(null), u = (y) => typeof y.hidden == "function" ? y.hidden(t) : y.hidden === !0;
|
|
20732
20735
|
if (u(e))
|
|
20733
20736
|
return /* @__PURE__ */ h(We, {});
|
|
20734
|
-
const d = (
|
|
20737
|
+
const d = (y) => r ? !0 : typeof y.disabled == "function" ? y.disabled(t) : y.disabled === !0, f = (y) => {
|
|
20735
20738
|
var k, w, S, x;
|
|
20736
|
-
if (typeof
|
|
20737
|
-
return
|
|
20738
|
-
if ((k =
|
|
20739
|
-
return /* @__PURE__ */ h("i", { className:
|
|
20740
|
-
if ((S =
|
|
20741
|
-
return ii(
|
|
20739
|
+
if (typeof y.icon == "function")
|
|
20740
|
+
return y.icon();
|
|
20741
|
+
if ((k = y.icon) != null && k.showIcon && ((w = y.icon) != null && w.cssClass))
|
|
20742
|
+
return /* @__PURE__ */ h("i", { className: y.icon.cssClass });
|
|
20743
|
+
if ((S = y.icon) != null && S.showIcon && ((x = y.icon) != null && x.imagePath))
|
|
20744
|
+
return ii(y.icon.imagePath) ? /* @__PURE__ */ h(
|
|
20742
20745
|
"div",
|
|
20743
20746
|
{
|
|
20744
20747
|
dangerouslySetInnerHTML: {
|
|
20745
|
-
__html:
|
|
20748
|
+
__html: y.icon.imagePath
|
|
20746
20749
|
}
|
|
20747
20750
|
}
|
|
20748
|
-
) : /* @__PURE__ */ h("img", { src:
|
|
20749
|
-
}, p = (
|
|
20751
|
+
) : /* @__PURE__ */ h("img", { src: y.icon.imagePath });
|
|
20752
|
+
}, p = (y) => {
|
|
20750
20753
|
d(e) || l(!0);
|
|
20751
|
-
}, m = (
|
|
20752
|
-
d(k) || (l(!1), o(
|
|
20754
|
+
}, m = (y, k) => {
|
|
20755
|
+
d(k) || (l(!1), o(y, k));
|
|
20753
20756
|
};
|
|
20754
20757
|
return B(() => {
|
|
20755
|
-
const
|
|
20758
|
+
const y = (k) => {
|
|
20756
20759
|
c.current && c.current.contains(k.target) || l(!1);
|
|
20757
20760
|
};
|
|
20758
|
-
return a && document.addEventListener("mousedown",
|
|
20759
|
-
document.removeEventListener("mousedown",
|
|
20761
|
+
return a && document.addEventListener("mousedown", y), () => {
|
|
20762
|
+
document.removeEventListener("mousedown", y);
|
|
20760
20763
|
};
|
|
20761
20764
|
}, [a]), /* @__PURE__ */ h(
|
|
20762
20765
|
"div",
|
|
@@ -20771,14 +20774,14 @@ const Ie = new L("chat-toolbar-item"), E7 = (n) => {
|
|
|
20771
20774
|
{
|
|
20772
20775
|
title: e.title,
|
|
20773
20776
|
className: Ie.e("content"),
|
|
20774
|
-
onClick: (
|
|
20777
|
+
onClick: (y) => m(y, e),
|
|
20775
20778
|
children: [
|
|
20776
20779
|
/* @__PURE__ */ h("div", { className: Ie.em("content", "icon"), children: f(e) }),
|
|
20777
20780
|
/* @__PURE__ */ h("div", { className: Ie.em("content", "label"), children: e.label })
|
|
20778
20781
|
]
|
|
20779
20782
|
}
|
|
20780
20783
|
),
|
|
20781
|
-
((
|
|
20784
|
+
((b = e.children) == null ? void 0 : b.length) && /* @__PURE__ */ h(
|
|
20782
20785
|
"div",
|
|
20783
20786
|
{
|
|
20784
20787
|
title: C.t.value("more"),
|
|
@@ -20793,17 +20796,17 @@ const Ie = new L("chat-toolbar-item"), E7 = (n) => {
|
|
|
20793
20796
|
)
|
|
20794
20797
|
}
|
|
20795
20798
|
),
|
|
20796
|
-
a && /* @__PURE__ */ h("div", { ref: c, className: Ie.b("dropdown"), children: (g = e.children) == null ? void 0 : g.map((
|
|
20797
|
-
if (!u(
|
|
20799
|
+
a && /* @__PURE__ */ h("div", { ref: c, className: Ie.b("dropdown"), children: (g = e.children) == null ? void 0 : g.map((y, k) => {
|
|
20800
|
+
if (!u(y))
|
|
20798
20801
|
return /* @__PURE__ */ h(
|
|
20799
20802
|
"div",
|
|
20800
20803
|
{
|
|
20801
|
-
title:
|
|
20802
|
-
onClick: (w) => m(w,
|
|
20803
|
-
className: "".concat(Ie.be("dropdown", "item"), " ").concat(
|
|
20804
|
+
title: y.title,
|
|
20805
|
+
onClick: (w) => m(w, y),
|
|
20806
|
+
className: "".concat(Ie.be("dropdown", "item"), " ").concat(y.customClass || "", " ").concat(Ie.is("disabled", d(y))),
|
|
20804
20807
|
children: [
|
|
20805
|
-
/* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "icon"), children: f(
|
|
20806
|
-
/* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "label"), children:
|
|
20808
|
+
/* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "icon"), children: f(y) }),
|
|
20809
|
+
/* @__PURE__ */ h("div", { className: Ie.bem("dropdown", "item", "label"), children: y.label })
|
|
20807
20810
|
]
|
|
20808
20811
|
},
|
|
20809
20812
|
k
|
|
@@ -20896,11 +20899,11 @@ const A7 = new L("chat-toolbar"), sr = (n) => {
|
|
|
20896
20899
|
else
|
|
20897
20900
|
l = [...c, ...t];
|
|
20898
20901
|
const f = (m, v) => {
|
|
20899
|
-
const
|
|
20902
|
+
const b = {
|
|
20900
20903
|
...i
|
|
20901
20904
|
};
|
|
20902
|
-
if (i instanceof It ? (Object.assign(
|
|
20903
|
-
v.onClick(m, v, e.context, e.params,
|
|
20905
|
+
if (i instanceof It ? (Object.assign(b, { topic: e.topic }), b.msg.realcontent = i.realcontent) : (b.data || (b.data = {}), Object.assign(b.data, { messages: e.messages.value })), v.onClick && typeof v.onClick == "function")
|
|
20906
|
+
v.onClick(m, v, e.context, e.params, b);
|
|
20904
20907
|
else {
|
|
20905
20908
|
const g = n.controller.opts.extendToolbarClick;
|
|
20906
20909
|
g && typeof g == "function" && g(
|
|
@@ -20908,7 +20911,7 @@ const A7 = new L("chat-toolbar"), sr = (n) => {
|
|
|
20908
20911
|
v,
|
|
20909
20912
|
e.context,
|
|
20910
20913
|
e.params,
|
|
20911
|
-
|
|
20914
|
+
b
|
|
20912
20915
|
);
|
|
20913
20916
|
}
|
|
20914
20917
|
}, p = $e(() => r === "content" ? (i == null ? void 0 : i.role) === "ASSISTANT" ? (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0 || e.isLoading.value : (i == null ? void 0 : i.role) === "USER" ? e.isLoading.value : !1 : !1, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed, i == null ? void 0 : i.role, e.isLoading.value]);
|
|
@@ -20980,8 +20983,8 @@ const Ic = new L("chat-messages"), so = (n) => {
|
|
|
20980
20983
|
}, 500));
|
|
20981
20984
|
};
|
|
20982
20985
|
B(() => {
|
|
20983
|
-
const g = u.value.length,
|
|
20984
|
-
g !==
|
|
20986
|
+
const g = u.value.length, y = d.current;
|
|
20987
|
+
g !== y && l(!0), a && m(), d.current = g;
|
|
20985
20988
|
}, [u.value]);
|
|
20986
20989
|
const v = () => {
|
|
20987
20990
|
if (c.current)
|
|
@@ -20989,8 +20992,8 @@ const Ic = new L("chat-messages"), so = (n) => {
|
|
|
20989
20992
|
const g = e.current;
|
|
20990
20993
|
if (!g)
|
|
20991
20994
|
return;
|
|
20992
|
-
const { scrollTop:
|
|
20993
|
-
|
|
20995
|
+
const { scrollTop: y, scrollHeight: k, clientHeight: w } = g;
|
|
20996
|
+
y < 100 && !s && p && (o(!0), setTimeout(() => {
|
|
20994
20997
|
const x = Math.min(
|
|
20995
20998
|
i + t,
|
|
20996
20999
|
u.value.length
|
|
@@ -21002,19 +21005,19 @@ const Ic = new L("chat-messages"), so = (n) => {
|
|
|
21002
21005
|
g.scrollTop = E - T + g.scrollTop, o(!1);
|
|
21003
21006
|
}, 0);
|
|
21004
21007
|
}, 300));
|
|
21005
|
-
const S = k - (
|
|
21008
|
+
const S = k - (y + w) < 50;
|
|
21006
21009
|
l(S);
|
|
21007
|
-
},
|
|
21010
|
+
}, b = () => {
|
|
21008
21011
|
c.current = !0, l(!0);
|
|
21009
21012
|
};
|
|
21010
21013
|
return /* @__PURE__ */ h("div", { ref: e, className: Ic.b(), onScroll: v, children: [
|
|
21011
21014
|
f.map((g) => {
|
|
21012
21015
|
var k;
|
|
21013
|
-
const
|
|
21016
|
+
const y = ((k = g.content) == null ? void 0 : k.length) || 0;
|
|
21014
21017
|
return g.role !== "SYSTEM" ? /* @__PURE__ */ h(
|
|
21015
21018
|
N7,
|
|
21016
21019
|
{
|
|
21017
|
-
size:
|
|
21020
|
+
size: y,
|
|
21018
21021
|
message: g,
|
|
21019
21022
|
controller: n.controller,
|
|
21020
21023
|
children: /* @__PURE__ */ h(
|
|
@@ -21038,7 +21041,7 @@ const Ic = new L("chat-messages"), so = (n) => {
|
|
|
21038
21041
|
right: 20,
|
|
21039
21042
|
bottom: 14,
|
|
21040
21043
|
target: ".".concat(Ic.b()),
|
|
21041
|
-
onClick:
|
|
21044
|
+
onClick: b
|
|
21042
21045
|
}
|
|
21043
21046
|
)
|
|
21044
21047
|
] });
|
|
@@ -22277,10 +22280,10 @@ class Oc {
|
|
|
22277
22280
|
if (s.action_context)
|
|
22278
22281
|
try {
|
|
22279
22282
|
const m = s.action_context.split(";").reduce(
|
|
22280
|
-
(v,
|
|
22281
|
-
if (
|
|
22282
|
-
const [g,
|
|
22283
|
-
g &&
|
|
22283
|
+
(v, b) => {
|
|
22284
|
+
if (b.trim()) {
|
|
22285
|
+
const [g, y] = b.split(":");
|
|
22286
|
+
g && y && (v[g.trim()] = y.trim());
|
|
22284
22287
|
}
|
|
22285
22288
|
return v;
|
|
22286
22289
|
},
|
|
@@ -22341,12 +22344,12 @@ class Oc {
|
|
|
22341
22344
|
if (o.action_context)
|
|
22342
22345
|
try {
|
|
22343
22346
|
const v = o.action_context.split(";").reduce(
|
|
22344
|
-
(
|
|
22347
|
+
(b, g) => {
|
|
22345
22348
|
if (g.trim()) {
|
|
22346
|
-
const [
|
|
22347
|
-
|
|
22349
|
+
const [y, k] = g.split(":");
|
|
22350
|
+
y && k && (b[y.trim()] = k.trim());
|
|
22348
22351
|
}
|
|
22349
|
-
return
|
|
22352
|
+
return b;
|
|
22350
22353
|
},
|
|
22351
22354
|
{}
|
|
22352
22355
|
);
|
|
@@ -23257,56 +23260,56 @@ class B7 extends _f {
|
|
|
23257
23260
|
getDownLoadUrl: p,
|
|
23258
23261
|
onProgress: m,
|
|
23259
23262
|
globalDownloadPrifix: v
|
|
23260
|
-
} = i,
|
|
23263
|
+
} = i, b = {
|
|
23261
23264
|
folder: r,
|
|
23262
23265
|
globalDownloadPrifix: v,
|
|
23263
23266
|
multiple: a || !0,
|
|
23264
23267
|
accept: s || "*/*",
|
|
23265
23268
|
maxSize: o || 5 * 1024 * 1024,
|
|
23266
|
-
onSelect: (
|
|
23267
|
-
c == null || c(
|
|
23269
|
+
onSelect: (y) => {
|
|
23270
|
+
c == null || c(y), y.length > 0 && y.forEach((k) => {
|
|
23268
23271
|
const w = this.buildMaterialObject(r, k);
|
|
23269
23272
|
Object.assign(w.metadata, { state: "uploading" }), this.aiChat.addMaterial(w);
|
|
23270
23273
|
});
|
|
23271
23274
|
},
|
|
23272
|
-
onUpload: async (
|
|
23275
|
+
onUpload: async (y, k) => u(y, k, {
|
|
23273
23276
|
context: this.aiChat.context,
|
|
23274
23277
|
params: this.aiChat.params
|
|
23275
23278
|
}),
|
|
23276
23279
|
onDownLoad: f,
|
|
23277
23280
|
getDownLoadUrl: p,
|
|
23278
23281
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23279
|
-
onSuccess: (
|
|
23282
|
+
onSuccess: (y, k) => {
|
|
23280
23283
|
const w = {
|
|
23281
|
-
id:
|
|
23284
|
+
id: y.id,
|
|
23282
23285
|
type: "ossfile",
|
|
23283
23286
|
data: {
|
|
23284
|
-
id:
|
|
23285
|
-
name:
|
|
23287
|
+
id: y.id,
|
|
23288
|
+
name: y.name,
|
|
23286
23289
|
folder: r
|
|
23287
23290
|
},
|
|
23288
23291
|
metadata: {
|
|
23289
|
-
ext:
|
|
23290
|
-
fileext:
|
|
23291
|
-
fileid:
|
|
23292
|
-
filename:
|
|
23293
|
-
size:
|
|
23294
|
-
filesize:
|
|
23292
|
+
ext: y.ext,
|
|
23293
|
+
fileext: y.fileext,
|
|
23294
|
+
fileid: y.fileid,
|
|
23295
|
+
filename: y.filename,
|
|
23296
|
+
size: y.size,
|
|
23297
|
+
filesize: y.filesize,
|
|
23295
23298
|
state: "successed",
|
|
23296
23299
|
folder: r
|
|
23297
23300
|
}
|
|
23298
23301
|
};
|
|
23299
|
-
this.aiChat.replaceMaterial(k.name, w), d == null || d(
|
|
23302
|
+
this.aiChat.replaceMaterial(k.name, w), d == null || d(y, k);
|
|
23300
23303
|
},
|
|
23301
|
-
onError: (
|
|
23304
|
+
onError: (y, k) => {
|
|
23302
23305
|
const w = this.buildMaterialObject(r, k);
|
|
23303
|
-
Object.assign(w.metadata, { state: "failed" }), this.aiChat.replaceMaterial(k.name, w), l == null || l(
|
|
23306
|
+
Object.assign(w.metadata, { state: "failed" }), this.aiChat.replaceMaterial(k.name, w), l == null || l(y, k);
|
|
23304
23307
|
},
|
|
23305
|
-
onProgress: (
|
|
23306
|
-
m == null || m(
|
|
23308
|
+
onProgress: (y, k) => {
|
|
23309
|
+
m == null || m(y, k);
|
|
23307
23310
|
}
|
|
23308
23311
|
};
|
|
23309
|
-
new ug(
|
|
23312
|
+
new ug(b).openFilePicker();
|
|
23310
23313
|
}
|
|
23311
23314
|
/**
|
|
23312
23315
|
* 构建素材对象
|
|
@@ -23921,8 +23924,8 @@ const Re = new L("chat-agent-setting"), j7 = (n) => {
|
|
|
23921
23924
|
const s = H(null), o = H(null), [a, l] = U(!1);
|
|
23922
23925
|
B(() => {
|
|
23923
23926
|
const p = (m) => {
|
|
23924
|
-
var v,
|
|
23925
|
-
m.target && ((v = o.current) != null && v.contains(m.target)) || ((
|
|
23927
|
+
var v, b;
|
|
23928
|
+
m.target && ((v = o.current) != null && v.contains(m.target)) || ((b = s.current) != null && b.contains(m.target) ? l((g) => !g) : l(!1));
|
|
23926
23929
|
};
|
|
23927
23930
|
return document.addEventListener("mousedown", p), () => {
|
|
23928
23931
|
document.removeEventListener("mousedown", p);
|
|
@@ -24097,9 +24100,9 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
|
|
|
24097
24100
|
).excuteAction(w, S), t(!1);
|
|
24098
24101
|
}, v = (w) => {
|
|
24099
24102
|
n.controller.setActiveAIAgentID(w);
|
|
24100
|
-
},
|
|
24103
|
+
}, b = (w) => {
|
|
24101
24104
|
n.controller.setSelectionKnowledge(w);
|
|
24102
|
-
}, g = async (w) => await n.controller.knowledgeRemoteSearch(w),
|
|
24105
|
+
}, g = async (w) => await n.controller.knowledgeRemoteSearch(w), y = async (w) => await n.controller.searchAIAgent(w);
|
|
24103
24106
|
return /* @__PURE__ */ h(
|
|
24104
24107
|
"div",
|
|
24105
24108
|
{
|
|
@@ -24135,9 +24138,10 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
|
|
|
24135
24138
|
onClick: () => {
|
|
24136
24139
|
n.controller.supplementQuestion();
|
|
24137
24140
|
},
|
|
24141
|
+
title: C.t.value("instantSteerTip"),
|
|
24138
24142
|
children: [
|
|
24139
24143
|
/* @__PURE__ */ h(W7, {}),
|
|
24140
|
-
/* @__PURE__ */ h("span", { children: C.t.value("
|
|
24144
|
+
/* @__PURE__ */ h("span", { children: C.t.value("instantSteer") })
|
|
24141
24145
|
]
|
|
24142
24146
|
}
|
|
24143
24147
|
),
|
|
@@ -24190,7 +24194,7 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
|
|
|
24190
24194
|
options: n.controller.agentList.value,
|
|
24191
24195
|
icon: () => /* @__PURE__ */ h("div", { title: C.t.value("agent"), children: cd() }),
|
|
24192
24196
|
disabled: !n.controller.enableAIAgentChange,
|
|
24193
|
-
onSearch:
|
|
24197
|
+
onSearch: y,
|
|
24194
24198
|
onChange: (w) => v(w)
|
|
24195
24199
|
}
|
|
24196
24200
|
),
|
|
@@ -24208,7 +24212,7 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
|
|
|
24208
24212
|
placeholder: C.t.value("knowledgeSearch"),
|
|
24209
24213
|
value: n.controller.selectionKnowledgeBases.value,
|
|
24210
24214
|
onSearch: (w) => g(w),
|
|
24211
|
-
onChange:
|
|
24215
|
+
onChange: b
|
|
24212
24216
|
}
|
|
24213
24217
|
),
|
|
24214
24218
|
n.controller.enableRecallConfigSetting.value && n.controller.agentList.value.length > 0 ? /* @__PURE__ */ h(j7, { controller: n.controller }) : null
|
|
@@ -24318,8 +24322,8 @@ const z = new L("chat-input"), Dc = window.SpeechRecognition || window.webkitSpe
|
|
|
24318
24322
|
};
|
|
24319
24323
|
const Pe = new L("chat-topic-item"), q7 = (n) => {
|
|
24320
24324
|
const { hasMoreThanOne: e, controller: t, topic: i, onClick: r, onAction: s } = n, o = H(null), a = ve(() => {
|
|
24321
|
-
var
|
|
24322
|
-
return ((
|
|
24325
|
+
var y;
|
|
24326
|
+
return ((y = t.activedTopic.value) == null ? void 0 : y.id) === i.id;
|
|
24323
24327
|
}), [l, c] = U(!1), u = $([]);
|
|
24324
24328
|
e ? u.value = [
|
|
24325
24329
|
{
|
|
@@ -24343,17 +24347,17 @@ const Pe = new L("chat-topic-item"), q7 = (n) => {
|
|
|
24343
24347
|
];
|
|
24344
24348
|
const d = $(!1), f = (g) => {
|
|
24345
24349
|
g.stopPropagation(), s("LINK", g);
|
|
24346
|
-
}, p = (g,
|
|
24350
|
+
}, p = (g, y) => {
|
|
24347
24351
|
g === "RENAME" ? (d.value = !0, setTimeout(() => {
|
|
24348
24352
|
var k;
|
|
24349
24353
|
(k = o.current) == null || k.focus();
|
|
24350
|
-
}, 100)) : s(g,
|
|
24354
|
+
}, 100)) : s(g, y), c(!1);
|
|
24351
24355
|
}, m = (g) => {
|
|
24352
|
-
var
|
|
24353
|
-
g.stopPropagation(), i.data.caption = (
|
|
24356
|
+
var y;
|
|
24357
|
+
g.stopPropagation(), i.data.caption = (y = g.target) == null ? void 0 : y.value;
|
|
24354
24358
|
}, v = (g) => {
|
|
24355
24359
|
g.stopPropagation(), d.value = !1, s("RENAME", g);
|
|
24356
|
-
},
|
|
24360
|
+
}, b = (g) => {
|
|
24357
24361
|
g.stopPropagation(), g.key === "Enter" && (d.value = !1);
|
|
24358
24362
|
};
|
|
24359
24363
|
return /* @__PURE__ */ h(
|
|
@@ -24371,7 +24375,7 @@ const Pe = new L("chat-topic-item"), q7 = (n) => {
|
|
|
24371
24375
|
ref: o,
|
|
24372
24376
|
value: i.caption,
|
|
24373
24377
|
onBlur: v,
|
|
24374
|
-
onKeyDown:
|
|
24378
|
+
onKeyDown: b,
|
|
24375
24379
|
onClick: (g) => g.stopPropagation(),
|
|
24376
24380
|
onChange: (g) => m(g),
|
|
24377
24381
|
className: Pe.em("caption", "editor")
|
|
@@ -24572,19 +24576,19 @@ const rn = new L("chat-minimize"), K7 = (n) => {
|
|
|
24572
24576
|
const m = n.controller.messages.value[n.controller.messages.value.length - 1];
|
|
24573
24577
|
return m ? m.role === "ASSISTANT" && m.state === 20 && m.completed !== !0 : !1;
|
|
24574
24578
|
}), c = (m) => {
|
|
24575
|
-
const v = m.indexOf("<think>"),
|
|
24576
|
-
let g = "",
|
|
24577
|
-
return
|
|
24579
|
+
const v = m.indexOf("<think>"), b = m.indexOf("</think>");
|
|
24580
|
+
let g = "", y = "";
|
|
24581
|
+
return b === -1 ? (g = m.slice(v + 7), y = "") : (g = m.slice(v + 7, b), y = m.slice(b + 8)), { thoughtContent: g, answerContent: y };
|
|
24578
24582
|
}, u = ve(() => {
|
|
24579
24583
|
let m = "";
|
|
24580
24584
|
if (!l.value)
|
|
24581
24585
|
return i(""), s(0), m;
|
|
24582
24586
|
const v = n.controller.messages.value[n.controller.messages.value.length - 1];
|
|
24583
24587
|
if (m = v.content, v.content && v.content.indexOf("<think>") !== -1) {
|
|
24584
|
-
const { thoughtContent:
|
|
24588
|
+
const { thoughtContent: b, answerContent: g } = c(
|
|
24585
24589
|
v.content
|
|
24586
24590
|
);
|
|
24587
|
-
m =
|
|
24591
|
+
m = b + g;
|
|
24588
24592
|
}
|
|
24589
24593
|
return m;
|
|
24590
24594
|
}), d = () => {
|
|
@@ -24599,9 +24603,9 @@ const rn = new L("chat-minimize"), K7 = (n) => {
|
|
|
24599
24603
|
const m = e.current;
|
|
24600
24604
|
m && (m.onmousedown = (v) => {
|
|
24601
24605
|
document.body.style.userSelect = "none";
|
|
24602
|
-
const
|
|
24606
|
+
const b = v.clientX - m.offsetLeft, g = v.clientY - m.offsetTop, y = Date.now(), k = (S) => {
|
|
24603
24607
|
const x = 56 / window.innerWidth, T = 56 / window.innerHeight, { x: E, y: N } = Uu(
|
|
24604
|
-
S.clientX -
|
|
24608
|
+
S.clientX - b,
|
|
24605
24609
|
S.clientY - g,
|
|
24606
24610
|
x,
|
|
24607
24611
|
T
|
|
@@ -24611,7 +24615,7 @@ const rn = new L("chat-minimize"), K7 = (n) => {
|
|
|
24611
24615
|
});
|
|
24612
24616
|
}, w = () => {
|
|
24613
24617
|
const S = Date.now();
|
|
24614
|
-
o.current = S -
|
|
24618
|
+
o.current = S - y > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", w);
|
|
24615
24619
|
};
|
|
24616
24620
|
document.addEventListener("mousemove", k), document.addEventListener("mouseup", w);
|
|
24617
24621
|
});
|
|
@@ -25313,18 +25317,18 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
|
|
|
25313
25317
|
r.value = !0;
|
|
25314
25318
|
}, s.current.onend = () => {
|
|
25315
25319
|
r.value = !1;
|
|
25316
|
-
}, s.current.onresult = (
|
|
25320
|
+
}, s.current.onresult = (y) => {
|
|
25317
25321
|
var w, S, x, T;
|
|
25318
|
-
const k = (x = (S = (w =
|
|
25322
|
+
const k = (x = (S = (w = y.results) == null ? void 0 : w[0]) == null ? void 0 : S[0]) == null ? void 0 : x.transcript;
|
|
25319
25323
|
k && ((T = o.current) == null || T.commands.insertContent(k));
|
|
25320
25324
|
});
|
|
25321
25325
|
const a = () => {
|
|
25322
25326
|
s.current && (r.value ? s.current.abort() : s.current.start());
|
|
25323
25327
|
}, l = ve(() => Hn(i.value).length <= 0), c = () => {
|
|
25324
|
-
var
|
|
25328
|
+
var y, k, w;
|
|
25325
25329
|
try {
|
|
25326
25330
|
const S = Hn(i.value);
|
|
25327
|
-
i.value = "", (
|
|
25331
|
+
i.value = "", (y = o.current) == null || y.chain().clearContent().run();
|
|
25328
25332
|
const x = n.controller.stringlyMaterialResource(!0);
|
|
25329
25333
|
(w = (k = n.controller.opts).action) == null || w.call(k, "send", {
|
|
25330
25334
|
content: S,
|
|
@@ -25335,23 +25339,23 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
|
|
|
25335
25339
|
} catch (S) {
|
|
25336
25340
|
console.error(S);
|
|
25337
25341
|
}
|
|
25338
|
-
}, u = (
|
|
25339
|
-
!l.value &&
|
|
25340
|
-
}, d = async (
|
|
25342
|
+
}, u = (y) => {
|
|
25343
|
+
!l.value && y.code === "Enter" && y.key === "Enter" && y.shiftKey === !1 && c();
|
|
25344
|
+
}, d = async (y) => {
|
|
25341
25345
|
await or.getMaterialHelper(
|
|
25342
25346
|
"ossfile",
|
|
25343
25347
|
n.controller
|
|
25344
|
-
).excuteAction(
|
|
25345
|
-
}, f = async (
|
|
25348
|
+
).excuteAction(y), t(!1);
|
|
25349
|
+
}, f = async (y, k) => {
|
|
25346
25350
|
await or.getMaterialHelper(
|
|
25347
25351
|
"common",
|
|
25348
25352
|
n.controller
|
|
25349
|
-
).excuteAction(
|
|
25350
|
-
}, p = (
|
|
25351
|
-
n.controller.setActiveAIAgentID(
|
|
25352
|
-
}, m = (
|
|
25353
|
-
n.controller.setSelectionKnowledge(
|
|
25354
|
-
}, v = async (
|
|
25353
|
+
).excuteAction(y, k), t(!1);
|
|
25354
|
+
}, p = (y) => {
|
|
25355
|
+
n.controller.setActiveAIAgentID(y);
|
|
25356
|
+
}, m = (y) => {
|
|
25357
|
+
n.controller.setSelectionKnowledge(y);
|
|
25358
|
+
}, v = async (y) => await n.controller.knowledgeRemoteSearch(y), b = async (y) => await n.controller.searchAIAgent(y);
|
|
25355
25359
|
return /* @__PURE__ */ h("div", { className: q.b(), children: [
|
|
25356
25360
|
/* @__PURE__ */ h("div", { className: q.e("body"), children: [
|
|
25357
25361
|
/* @__PURE__ */ h("div", { className: q.em("body", "wrapper"), children: [
|
|
@@ -25361,11 +25365,11 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
|
|
|
25361
25365
|
{
|
|
25362
25366
|
value: i.value,
|
|
25363
25367
|
c: n.controller,
|
|
25364
|
-
onCreate: (
|
|
25365
|
-
o.current =
|
|
25368
|
+
onCreate: (y) => {
|
|
25369
|
+
o.current = y;
|
|
25366
25370
|
},
|
|
25367
|
-
onChange: (
|
|
25368
|
-
i.value =
|
|
25371
|
+
onChange: (y) => {
|
|
25372
|
+
i.value = y;
|
|
25369
25373
|
},
|
|
25370
25374
|
onKeyDown: u,
|
|
25371
25375
|
placeholder: n.controller.placeholder.value,
|
|
@@ -25386,26 +25390,26 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
|
|
|
25386
25390
|
/* @__PURE__ */ h("div", { className: q.bem("popup", "item", "icon"), children: /* @__PURE__ */ h(Ao, {}) }),
|
|
25387
25391
|
/* @__PURE__ */ h("div", { className: q.bem("popup", "item", "title"), children: C.t.value("documentation") })
|
|
25388
25392
|
] }),
|
|
25389
|
-
(g = n.questionToolbarItems) == null ? void 0 : g.map((
|
|
25393
|
+
(g = n.questionToolbarItems) == null ? void 0 : g.map((y) => {
|
|
25390
25394
|
var k, w, S;
|
|
25391
25395
|
return /* @__PURE__ */ h(
|
|
25392
25396
|
"div",
|
|
25393
25397
|
{
|
|
25394
25398
|
className: q.be("popup", "item"),
|
|
25395
|
-
onClick: (x) => f(x,
|
|
25399
|
+
onClick: (x) => f(x, y),
|
|
25396
25400
|
children: [
|
|
25397
|
-
/* @__PURE__ */ h("div", { className: q.bem("popup", "item", "icon"), children: typeof
|
|
25401
|
+
/* @__PURE__ */ h("div", { className: q.bem("popup", "item", "icon"), children: typeof y.icon == "function" ? y.icon() : ((k = y.icon) == null ? void 0 : k.showIcon) && /* @__PURE__ */ h(We, { children: (w = y.icon) != null && w.cssClass ? /* @__PURE__ */ h("i", { className: y.icon.cssClass }) : (S = y.icon) != null && S.imagePath ? ii(y.icon.imagePath) ? /* @__PURE__ */ h(
|
|
25398
25402
|
"div",
|
|
25399
25403
|
{
|
|
25400
25404
|
dangerouslySetInnerHTML: {
|
|
25401
|
-
__html:
|
|
25405
|
+
__html: y.icon.imagePath
|
|
25402
25406
|
}
|
|
25403
25407
|
}
|
|
25404
|
-
) : /* @__PURE__ */ h("img", { src:
|
|
25405
|
-
/* @__PURE__ */ h("div", { className: q.bem("popup", "item", "title"), children:
|
|
25408
|
+
) : /* @__PURE__ */ h("img", { src: y.icon.imagePath }) : null }) }),
|
|
25409
|
+
/* @__PURE__ */ h("div", { className: q.bem("popup", "item", "title"), children: y.label })
|
|
25406
25410
|
]
|
|
25407
25411
|
},
|
|
25408
|
-
|
|
25412
|
+
y.id
|
|
25409
25413
|
);
|
|
25410
25414
|
})
|
|
25411
25415
|
] }),
|
|
@@ -25454,8 +25458,8 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
|
|
|
25454
25458
|
options: n.controller.agentList.value,
|
|
25455
25459
|
icon: () => /* @__PURE__ */ h("div", { title: C.t.value("agent"), children: cd() }),
|
|
25456
25460
|
disabled: !n.controller.enableAIAgentChange,
|
|
25457
|
-
onSearch:
|
|
25458
|
-
onChange: (
|
|
25461
|
+
onSearch: b,
|
|
25462
|
+
onChange: (y) => p(y)
|
|
25459
25463
|
}
|
|
25460
25464
|
),
|
|
25461
25465
|
n.controller.enableKnowledgeBaseSelect.value && /* @__PURE__ */ h(
|
|
@@ -25471,7 +25475,7 @@ const $c = window.SpeechRecognition || window.webkitSpeechRecognition, q = new L
|
|
|
25471
25475
|
icon: () => /* @__PURE__ */ h("div", { title: C.t.value("knowledge"), children: Oo }),
|
|
25472
25476
|
placeholder: C.t.value("knowledgeSearch"),
|
|
25473
25477
|
value: n.controller.selectionKnowledgeBases.value,
|
|
25474
|
-
onSearch: (
|
|
25478
|
+
onSearch: (y) => v(y),
|
|
25475
25479
|
onChange: m
|
|
25476
25480
|
}
|
|
25477
25481
|
)
|