@ibiz-template-plugin/ai-chat 0.0.15 → 0.0.16
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/assets/gif/halo.gif +0 -0
- package/dist/index.es.js +1575 -1184
- package/dist/index.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/chat-back-bottom/chat-back-bottom.d.ts +6 -0
- package/dist/types/components/chat-container/chat-container.d.ts +1 -0
- package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +7 -0
- package/dist/types/components/chat-suggestions/chat-suggestions.d.ts +19 -0
- package/dist/types/components/popup/popup.d.ts +2 -1
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +30 -3
- package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +17 -0
- package/dist/types/entity/chart-topic/chart-topic.d.ts +1 -0
- package/dist/types/entity/chat-message/chat-message.d.ts +1 -0
- package/dist/types/entity/chat-suggestion/chat-suggestion.d.ts +8 -0
- package/dist/types/entity/index.d.ts +1 -0
- package/dist/types/icons/chevron-forward-svg.d.ts +3 -0
- package/dist/types/icons/clear-dialogue-svg.d.ts +1 -0
- package/dist/types/icons/index.d.ts +5 -1
- package/dist/types/icons/new-dialogue-svg.d.ts +1 -0
- package/dist/types/icons/rename-svg.d.ts +1 -0
- package/dist/types/icons/reset-dialogue-svg.d.ts +1 -0
- package/dist/types/interface/i-chat-message/i-chat-message.d.ts +9 -0
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +19 -0
- package/dist/types/interface/i-chat-suggestion/i-chat-suggestion.d.ts +26 -0
- package/dist/types/interface/i-topic-options/i-topic-options.d.ts +8 -0
- package/dist/types/interface/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/util/chat-suggestion-parser.d.ts +66 -0
- package/package.json +1 -1
- package/dist/types/icons/new-dialogue.d.ts +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import './style.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
var
|
|
8
|
-
function
|
|
2
|
+
var Cn = Object.defineProperty;
|
|
3
|
+
var Tn = (n, e, t) => e in n ? Cn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var T = (n, e, t) => (Tn(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import He from "interactjs";
|
|
6
|
+
import Ut from "cherry-markdown";
|
|
7
|
+
var Ae, w, Wt, Vt, te, at, qt, qe, jt, oe = {}, Yt = [], xn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ie = Array.isArray;
|
|
8
|
+
function Z(n, e) {
|
|
9
9
|
for (var t in e)
|
|
10
10
|
n[t] = e[t];
|
|
11
11
|
return n;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Xt(n) {
|
|
14
14
|
var e = n.parentNode;
|
|
15
15
|
e && e.removeChild(n);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
var i, s, o,
|
|
17
|
+
function q(n, e, t) {
|
|
18
|
+
var i, s, o, a = {};
|
|
19
19
|
for (o in e)
|
|
20
|
-
o == "key" ? i = e[o] : o == "ref" ? s = e[o] :
|
|
21
|
-
if (arguments.length > 2 && (
|
|
20
|
+
o == "key" ? i = e[o] : o == "ref" ? s = e[o] : a[o] = e[o];
|
|
21
|
+
if (arguments.length > 2 && (a.children = arguments.length > 3 ? Ae.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
|
|
22
22
|
for (o in n.defaultProps)
|
|
23
|
-
|
|
24
|
-
return Te(n,
|
|
23
|
+
a[o] === void 0 && (a[o] = n.defaultProps[o]);
|
|
24
|
+
return Te(n, a, i, s, null);
|
|
25
25
|
}
|
|
26
26
|
function Te(n, e, t, i, s) {
|
|
27
|
-
var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++
|
|
27
|
+
var o = { type: n, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: s == null ? ++Wt : s };
|
|
28
28
|
return s == null && w.vnode != null && w.vnode(o), o;
|
|
29
29
|
}
|
|
30
30
|
function rt() {
|
|
31
31
|
return { current: null };
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function j(n) {
|
|
34
34
|
return n.children;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function P(n, e) {
|
|
37
37
|
this.props = n, this.context = e;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function _e(n, e) {
|
|
40
40
|
if (e == null)
|
|
41
|
-
return n.__ ?
|
|
41
|
+
return n.__ ? _e(n.__, n.__.__k.indexOf(n) + 1) : null;
|
|
42
42
|
for (var t; e < n.__k.length; e++)
|
|
43
43
|
if ((t = n.__k[e]) != null && t.__e != null)
|
|
44
44
|
return t.__d || t.__e;
|
|
45
|
-
return typeof n.type == "function" ?
|
|
45
|
+
return typeof n.type == "function" ? _e(n) : null;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Zt(n) {
|
|
48
48
|
var e, t;
|
|
49
49
|
if ((n = n.__) != null && n.__c != null) {
|
|
50
50
|
for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
|
|
@@ -52,53 +52,53 @@ function Yt(n) {
|
|
|
52
52
|
n.__e = n.__c.base = t.__e;
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return Zt(n);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
(!n.__d && (n.__d = !0) &&
|
|
58
|
+
function je(n) {
|
|
59
|
+
(!n.__d && (n.__d = !0) && te.push(n) && !ke.__r++ || at !== w.debounceRendering) && ((at = w.debounceRendering) || qt)(ke);
|
|
60
60
|
}
|
|
61
61
|
function ke() {
|
|
62
|
-
var n, e, t, i, s, o,
|
|
63
|
-
for (
|
|
64
|
-
n.__d && (e =
|
|
62
|
+
var n, e, t, i, s, o, a, r, u;
|
|
63
|
+
for (te.sort(qe); n = te.shift(); )
|
|
64
|
+
n.__d && (e = te.length, i = void 0, s = void 0, o = void 0, r = (a = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = Z({}, a)).__v = a.__v + 1, Ke(u, a, o, t.__n, u.ownerSVGElement !== void 0, a.__h != null ? [r] : null, i, r == null ? _e(a) : r, a.__h, s), Qt(i, a, s), a.__e != r && Zt(a)), te.length > e && te.sort(qe));
|
|
65
65
|
ke.__r = 0;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
var l,
|
|
69
|
-
for (t.__k = [], l = 0; l <
|
|
70
|
-
(
|
|
71
|
-
for (t.__e =
|
|
72
|
-
S[l] != null && (typeof t.type == "function" && S[l].__e != null && S[l].__e == t.__d && (t.__d = S[l].__e.nextSibling),
|
|
67
|
+
function Gt(n, e, t, i, s, o, a, r, u, h, p) {
|
|
68
|
+
var l, v, g, d, f, _, m, b, x, C = 0, S = i && i.__k || Yt, O = S.length, I = O, F = e.length;
|
|
69
|
+
for (t.__k = [], l = 0; l < F; l++)
|
|
70
|
+
(d = t.__k[l] = (d = e[l]) == null || typeof d == "boolean" || typeof d == "function" ? null : typeof d == "string" || typeof d == "number" || typeof d == "bigint" ? Te(null, d, null, null, d) : Ie(d) ? Te(j, { children: d }, null, null, null) : d.__b > 0 ? Te(d.type, d.props, d.key, d.ref ? d.ref : null, d.__v) : d) != null ? (d.__ = t, d.__b = t.__b + 1, (b = Sn(d, S, m = l + C, I)) === -1 ? g = oe : (g = S[b] || oe, S[b] = void 0, I--), Ke(n, d, g, s, o, a, r, u, h, p), f = d.__e, (v = d.ref) && g.ref != v && (g.ref && Qe(g.ref, null, d), p.push(v, d.__c || f, d)), f != null && (_ == null && (_ = f), (x = g === oe || g.__v === null) ? b == -1 && C-- : b !== m && (b === m + 1 ? C++ : b > m ? I > F - m ? C += b - m : C-- : C = b < m && b == m - 1 ? b - m : 0), m = l + C, typeof d.type != "function" || b === m && g.__k !== d.__k ? typeof d.type == "function" || b === m && !x ? d.__d !== void 0 ? (u = d.__d, d.__d = void 0) : u = f.nextSibling : u = Kt(n, f, u) : u = Jt(d, u, n), typeof t.type == "function" && (t.__d = u))) : (g = S[l]) && g.key == null && g.__e && (g.__e == u && (g.__ = i, u = _e(g)), Ye(g, g, !1), S[l] = null);
|
|
71
|
+
for (t.__e = _, l = O; l--; )
|
|
72
|
+
S[l] != null && (typeof t.type == "function" && S[l].__e != null && S[l].__e == t.__d && (t.__d = S[l].__e.nextSibling), Ye(S[l], S[l]));
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Jt(n, e, t) {
|
|
75
75
|
for (var i, s = n.__k, o = 0; s && o < s.length; o++)
|
|
76
|
-
(i = s[o]) && (i.__ = n, e = typeof i.type == "function" ?
|
|
76
|
+
(i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Jt(i, e, t) : Kt(t, i.__e, e));
|
|
77
77
|
return e;
|
|
78
78
|
}
|
|
79
79
|
function Ee(n, e) {
|
|
80
|
-
return e = e || [], n == null || typeof n == "boolean" || (
|
|
80
|
+
return e = e || [], n == null || typeof n == "boolean" || (Ie(n) ? n.some(function(t) {
|
|
81
81
|
Ee(t, e);
|
|
82
82
|
}) : e.push(n)), e;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Kt(n, e, t) {
|
|
85
85
|
return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
|
|
86
86
|
}
|
|
87
87
|
function Sn(n, e, t, i) {
|
|
88
|
-
var s = n.key, o = n.type,
|
|
88
|
+
var s = n.key, o = n.type, a = t - 1, r = t + 1, u = e[t];
|
|
89
89
|
if (u === null || u && s == u.key && o === u.type)
|
|
90
90
|
return t;
|
|
91
91
|
if (i > (u != null ? 1 : 0))
|
|
92
|
-
for (;
|
|
93
|
-
if (
|
|
94
|
-
if ((u = e[r]) && s == u.key && o === u.type)
|
|
95
|
-
return r;
|
|
96
|
-
r--;
|
|
97
|
-
}
|
|
98
|
-
if (a < e.length) {
|
|
92
|
+
for (; a >= 0 || r < e.length; ) {
|
|
93
|
+
if (a >= 0) {
|
|
99
94
|
if ((u = e[a]) && s == u.key && o === u.type)
|
|
100
95
|
return a;
|
|
101
|
-
a
|
|
96
|
+
a--;
|
|
97
|
+
}
|
|
98
|
+
if (r < e.length) {
|
|
99
|
+
if ((u = e[r]) && s == u.key && o === u.type)
|
|
100
|
+
return r;
|
|
101
|
+
r++;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return -1;
|
|
@@ -110,7 +110,7 @@ function kn(n, e, t, i, s) {
|
|
|
110
110
|
for (o in e)
|
|
111
111
|
s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || Ne(n, o, e[o], t[o], i);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function ct(n, e, t) {
|
|
114
114
|
e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || xn.test(e) ? t : t + "px";
|
|
115
115
|
}
|
|
116
116
|
function Ne(n, e, t, i, s) {
|
|
@@ -122,13 +122,13 @@ function Ne(n, e, t, i, s) {
|
|
|
122
122
|
else {
|
|
123
123
|
if (typeof i == "string" && (n.style.cssText = i = ""), i)
|
|
124
124
|
for (e in i)
|
|
125
|
-
t && e in t ||
|
|
125
|
+
t && e in t || ct(n.style, e, "");
|
|
126
126
|
if (t)
|
|
127
127
|
for (e in t)
|
|
128
|
-
i && t[e] === i[e] ||
|
|
128
|
+
i && t[e] === i[e] || ct(n.style, e, t[e]);
|
|
129
129
|
}
|
|
130
130
|
else if (e[0] === "o" && e[1] === "n")
|
|
131
|
-
o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ?
|
|
131
|
+
o = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in n ? e.toLowerCase().slice(2) : e.slice(2), n.l || (n.l = {}), n.l[e + o] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, o ? ut : lt, o)) : n.removeEventListener(e, o ? ut : lt, o);
|
|
132
132
|
else if (e !== "dangerouslySetInnerHTML") {
|
|
133
133
|
if (s)
|
|
134
134
|
e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
@@ -136,12 +136,12 @@ function Ne(n, e, t, i, s) {
|
|
|
136
136
|
try {
|
|
137
137
|
n[e] = t == null ? "" : t;
|
|
138
138
|
break e;
|
|
139
|
-
} catch (
|
|
139
|
+
} catch (a) {
|
|
140
140
|
}
|
|
141
141
|
typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function lt(n) {
|
|
145
145
|
var e = this.l[n.type + !1];
|
|
146
146
|
if (n.t) {
|
|
147
147
|
if (n.t <= e.u)
|
|
@@ -150,51 +150,51 @@ function ct(n) {
|
|
|
150
150
|
n.t = Date.now();
|
|
151
151
|
return e(w.event ? w.event(n) : n);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function ut(n) {
|
|
154
154
|
return this.l[n.type + !0](w.event ? w.event(n) : n);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
156
|
+
function Ke(n, e, t, i, s, o, a, r, u, h) {
|
|
157
|
+
var p, l, v, g, d, f, _, m, b, x, C, S, O, I, F, D = e.type;
|
|
158
158
|
if (e.constructor !== void 0)
|
|
159
159
|
return null;
|
|
160
|
-
t.__h != null && (u = t.__h,
|
|
160
|
+
t.__h != null && (u = t.__h, r = e.__e = t.__e, e.__h = null, o = [r]), (p = w.__b) && p(e);
|
|
161
161
|
e:
|
|
162
|
-
if (typeof
|
|
162
|
+
if (typeof D == "function")
|
|
163
163
|
try {
|
|
164
|
-
if (m = e.props,
|
|
165
|
-
|
|
164
|
+
if (m = e.props, b = (p = D.contextType) && i[p.__c], x = p ? b ? b.props.value : p.__ : i, t.__c ? _ = (l = e.__c = t.__c).__ = l.__E : ("prototype" in D && D.prototype.render ? e.__c = l = new D(m, x) : (e.__c = l = new P(m, x), l.constructor = D, l.render = Nn), b && b.sub(l), l.props = m, l.state || (l.state = {}), l.context = x, l.__n = i, v = l.__d = !0, l.__h = [], l._sb = []), l.__s == null && (l.__s = l.state), D.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = Z({}, l.__s)), Z(l.__s, D.getDerivedStateFromProps(m, l.__s))), g = l.props, d = l.state, l.__v = e, v)
|
|
165
|
+
D.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), l.componentDidMount != null && l.__h.push(l.componentDidMount);
|
|
166
166
|
else {
|
|
167
|
-
if (
|
|
168
|
-
for (e.__v !== t.__v && (l.props = m, l.state = l.__s, l.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(
|
|
169
|
-
|
|
167
|
+
if (D.getDerivedStateFromProps == null && m !== g && l.componentWillReceiveProps != null && l.componentWillReceiveProps(m, x), !l.__e && (l.shouldComponentUpdate != null && l.shouldComponentUpdate(m, l.__s, x) === !1 || e.__v === t.__v)) {
|
|
168
|
+
for (e.__v !== t.__v && (l.props = m, l.state = l.__s, l.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(ye) {
|
|
169
|
+
ye && (ye.__ = e);
|
|
170
170
|
}), C = 0; C < l._sb.length; C++)
|
|
171
171
|
l.__h.push(l._sb[C]);
|
|
172
|
-
l._sb = [], l.__h.length &&
|
|
172
|
+
l._sb = [], l.__h.length && a.push(l);
|
|
173
173
|
break e;
|
|
174
174
|
}
|
|
175
|
-
l.componentWillUpdate != null && l.componentWillUpdate(m, l.__s,
|
|
176
|
-
l.componentDidUpdate(g,
|
|
175
|
+
l.componentWillUpdate != null && l.componentWillUpdate(m, l.__s, x), l.componentDidUpdate != null && l.__h.push(function() {
|
|
176
|
+
l.componentDidUpdate(g, d, f);
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
if (l.context =
|
|
180
|
-
for (l.state = l.__s, l.__d = !1, S && S(e),
|
|
181
|
-
l.__h.push(l._sb[
|
|
179
|
+
if (l.context = x, l.props = m, l.__P = n, l.__e = !1, S = w.__r, O = 0, "prototype" in D && D.prototype.render) {
|
|
180
|
+
for (l.state = l.__s, l.__d = !1, S && S(e), p = l.render(l.props, l.state, l.context), I = 0; I < l._sb.length; I++)
|
|
181
|
+
l.__h.push(l._sb[I]);
|
|
182
182
|
l._sb = [];
|
|
183
183
|
} else
|
|
184
184
|
do
|
|
185
|
-
l.__d = !1, S && S(e),
|
|
186
|
-
while (l.__d && ++
|
|
187
|
-
l.state = l.__s, l.getChildContext != null && (i =
|
|
188
|
-
} catch (
|
|
189
|
-
e.__v = null, (u || o != null) && (e.__e =
|
|
185
|
+
l.__d = !1, S && S(e), p = l.render(l.props, l.state, l.context), l.state = l.__s;
|
|
186
|
+
while (l.__d && ++O < 25);
|
|
187
|
+
l.state = l.__s, l.getChildContext != null && (i = Z(Z({}, i), l.getChildContext())), v || l.getSnapshotBeforeUpdate == null || (f = l.getSnapshotBeforeUpdate(g, d)), Gt(n, Ie(F = p != null && p.type === j && p.key == null ? p.props.children : p) ? F : [F], e, t, i, s, o, a, r, u, h), l.base = e.__e, e.__h = null, l.__h.length && a.push(l), _ && (l.__E = l.__ = null);
|
|
188
|
+
} catch (ye) {
|
|
189
|
+
e.__v = null, (u || o != null) && (e.__e = r, e.__h = !!u, o[o.indexOf(r)] = null), w.__e(ye, e, t);
|
|
190
190
|
}
|
|
191
191
|
else
|
|
192
|
-
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = En(t.__e, e, t, i, s, o,
|
|
193
|
-
(
|
|
192
|
+
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = En(t.__e, e, t, i, s, o, a, u, h);
|
|
193
|
+
(p = w.diffed) && p(e);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Qt(n, e, t) {
|
|
196
196
|
for (var i = 0; i < t.length; i++)
|
|
197
|
-
|
|
197
|
+
Qe(t[i], t[++i], t[++i]);
|
|
198
198
|
w.__c && w.__c(e, n), n.some(function(s) {
|
|
199
199
|
try {
|
|
200
200
|
n = s.__h, s.__h = [], n.some(function(o) {
|
|
@@ -205,48 +205,48 @@ function Jt(n, e, t) {
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function En(n, e, t, i, s, o,
|
|
209
|
-
var
|
|
210
|
-
if (
|
|
211
|
-
for (;
|
|
212
|
-
if ((
|
|
213
|
-
n =
|
|
208
|
+
function En(n, e, t, i, s, o, a, r, u) {
|
|
209
|
+
var h, p, l, v = t.props, g = e.props, d = e.type, f = 0;
|
|
210
|
+
if (d === "svg" && (s = !0), o != null) {
|
|
211
|
+
for (; f < o.length; f++)
|
|
212
|
+
if ((h = o[f]) && "setAttribute" in h == !!d && (d ? h.localName === d : h.nodeType === 3)) {
|
|
213
|
+
n = h, o[f] = null;
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
if (n == null) {
|
|
218
|
-
if (
|
|
218
|
+
if (d === null)
|
|
219
219
|
return document.createTextNode(g);
|
|
220
|
-
n = s ? document.createElementNS("http://www.w3.org/2000/svg",
|
|
220
|
+
n = s ? document.createElementNS("http://www.w3.org/2000/svg", d) : document.createElement(d, g.is && g), o = null, r = !1;
|
|
221
221
|
}
|
|
222
|
-
if (
|
|
223
|
-
|
|
222
|
+
if (d === null)
|
|
223
|
+
v === g || r && n.data === g || (n.data = g);
|
|
224
224
|
else {
|
|
225
|
-
if (o = o &&
|
|
225
|
+
if (o = o && Ae.call(n.childNodes), p = (v = t.props || oe).dangerouslySetInnerHTML, l = g.dangerouslySetInnerHTML, !r) {
|
|
226
226
|
if (o != null)
|
|
227
|
-
for (
|
|
228
|
-
|
|
229
|
-
(l ||
|
|
227
|
+
for (v = {}, f = 0; f < n.attributes.length; f++)
|
|
228
|
+
v[n.attributes[f].name] = n.attributes[f].value;
|
|
229
|
+
(l || p) && (l && (p && l.__html == p.__html || l.__html === n.innerHTML) || (n.innerHTML = l && l.__html || ""));
|
|
230
230
|
}
|
|
231
|
-
if (kn(n, g,
|
|
231
|
+
if (kn(n, g, v, s, r), l)
|
|
232
232
|
e.__k = [];
|
|
233
|
-
else if (
|
|
234
|
-
for (
|
|
235
|
-
o[
|
|
236
|
-
|
|
233
|
+
else if (Gt(n, Ie(f = e.props.children) ? f : [f], e, t, i, s && d !== "foreignObject", o, a, o ? o[0] : t.__k && _e(t, 0), r, u), o != null)
|
|
234
|
+
for (f = o.length; f--; )
|
|
235
|
+
o[f] != null && Xt(o[f]);
|
|
236
|
+
r || ("value" in g && (f = g.value) !== void 0 && (f !== n.value || d === "progress" && !f || d === "option" && f !== v.value) && Ne(n, "value", f, v.value, !1), "checked" in g && (f = g.checked) !== void 0 && f !== n.checked && Ne(n, "checked", f, v.checked, !1));
|
|
237
237
|
}
|
|
238
238
|
return n;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Qe(n, e, t) {
|
|
241
241
|
try {
|
|
242
242
|
typeof n == "function" ? n(e) : n.current = e;
|
|
243
243
|
} catch (i) {
|
|
244
244
|
w.__e(i, t);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function Ye(n, e, t) {
|
|
248
248
|
var i, s;
|
|
249
|
-
if (w.unmount && w.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e ||
|
|
249
|
+
if (w.unmount && w.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Qe(i, null, e)), (i = n.__c) != null) {
|
|
250
250
|
if (i.componentWillUnmount)
|
|
251
251
|
try {
|
|
252
252
|
i.componentWillUnmount();
|
|
@@ -257,63 +257,63 @@ function Xe(n, e, t) {
|
|
|
257
257
|
}
|
|
258
258
|
if (i = n.__k)
|
|
259
259
|
for (s = 0; s < i.length; s++)
|
|
260
|
-
i[s] &&
|
|
261
|
-
t || n.__e == null ||
|
|
260
|
+
i[s] && Ye(i[s], e, t || typeof n.type != "function");
|
|
261
|
+
t || n.__e == null || Xt(n.__e), n.__ = n.__e = n.__d = void 0;
|
|
262
262
|
}
|
|
263
263
|
function Nn(n, e, t) {
|
|
264
264
|
return this.constructor(n, t);
|
|
265
265
|
}
|
|
266
266
|
function se(n, e, t) {
|
|
267
|
-
var i, s, o,
|
|
268
|
-
w.__ && w.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [],
|
|
267
|
+
var i, s, o, a;
|
|
268
|
+
w.__ && w.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], a = [], Ke(e, n = (!i && t || e).__k = q(j, null, [n]), s || oe, oe, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? Ae.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, a), Qt(o, n, a);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
var t = { __c: e = "__cC" +
|
|
270
|
+
function Mn(n, e) {
|
|
271
|
+
var t = { __c: e = "__cC" + jt++, __: n, Consumer: function(i, s) {
|
|
272
272
|
return i.children(s);
|
|
273
273
|
}, Provider: function(i) {
|
|
274
274
|
var s, o;
|
|
275
275
|
return this.getChildContext || (s = [], (o = {})[e] = this, this.getChildContext = function() {
|
|
276
276
|
return o;
|
|
277
|
-
}, this.shouldComponentUpdate = function(
|
|
278
|
-
this.props.value !==
|
|
279
|
-
|
|
277
|
+
}, this.shouldComponentUpdate = function(a) {
|
|
278
|
+
this.props.value !== a.value && s.some(function(r) {
|
|
279
|
+
r.__e = !0, je(r);
|
|
280
280
|
});
|
|
281
|
-
}, this.sub = function(
|
|
282
|
-
s.push(
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
s.splice(s.indexOf(
|
|
281
|
+
}, this.sub = function(a) {
|
|
282
|
+
s.push(a);
|
|
283
|
+
var r = a.componentWillUnmount;
|
|
284
|
+
a.componentWillUnmount = function() {
|
|
285
|
+
s.splice(s.indexOf(a), 1), r && r.call(a);
|
|
286
286
|
};
|
|
287
287
|
}), i.children;
|
|
288
288
|
} };
|
|
289
289
|
return t.Provider.__ = t.Consumer.contextType = t;
|
|
290
290
|
}
|
|
291
|
-
|
|
292
|
-
for (var s, o,
|
|
291
|
+
Ae = Yt.slice, w = { __e: function(n, e, t, i) {
|
|
292
|
+
for (var s, o, a; e = e.__; )
|
|
293
293
|
if ((s = e.__c) && !s.__)
|
|
294
294
|
try {
|
|
295
|
-
if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(n)),
|
|
295
|
+
if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(n)), a = s.__d), s.componentDidCatch != null && (s.componentDidCatch(n, i || {}), a = s.__d), a)
|
|
296
296
|
return s.__E = s;
|
|
297
|
-
} catch (
|
|
298
|
-
n =
|
|
297
|
+
} catch (r) {
|
|
298
|
+
n = r;
|
|
299
299
|
}
|
|
300
300
|
throw n;
|
|
301
|
-
} },
|
|
301
|
+
} }, Wt = 0, Vt = function(n) {
|
|
302
302
|
return n != null && n.constructor === void 0;
|
|
303
|
-
},
|
|
303
|
+
}, P.prototype.setState = function(n, e) {
|
|
304
304
|
var t;
|
|
305
|
-
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s =
|
|
306
|
-
},
|
|
307
|
-
this.__v && (this.__e = !0, n && this.__h.push(n),
|
|
308
|
-
},
|
|
305
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = Z({}, this.state), typeof n == "function" && (n = n(Z({}, t), this.props)), n && Z(t, n), n != null && this.__v && (e && this._sb.push(e), je(this));
|
|
306
|
+
}, P.prototype.forceUpdate = function(n) {
|
|
307
|
+
this.__v && (this.__e = !0, n && this.__h.push(n), je(this));
|
|
308
|
+
}, P.prototype.render = j, te = [], qt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, qe = function(n, e) {
|
|
309
309
|
return n.__v.__b - e.__v.__b;
|
|
310
|
-
}, ke.__r = 0,
|
|
311
|
-
const
|
|
312
|
-
function
|
|
310
|
+
}, ke.__r = 0, jt = 0;
|
|
311
|
+
const $n = "ibiz", An = "is-";
|
|
312
|
+
function K(n, e, t, i, s) {
|
|
313
313
|
let o = "".concat(n, "-").concat(e);
|
|
314
314
|
return t && (o += "-".concat(t)), i && (o += "__".concat(i)), s && (o += "--".concat(s)), o;
|
|
315
315
|
}
|
|
316
|
-
class
|
|
316
|
+
class M {
|
|
317
317
|
/**
|
|
318
318
|
* Creates an instance of Namespace.
|
|
319
319
|
*
|
|
@@ -330,8 +330,8 @@ class $ {
|
|
|
330
330
|
* @date 2023-11-03 10:11:31
|
|
331
331
|
* @type {string}
|
|
332
332
|
*/
|
|
333
|
-
|
|
334
|
-
this.block = e, this.namespace = t ||
|
|
333
|
+
T(this, "namespace");
|
|
334
|
+
this.block = e, this.namespace = t || $n;
|
|
335
335
|
}
|
|
336
336
|
/**
|
|
337
337
|
* namespace-block
|
|
@@ -343,7 +343,7 @@ class $ {
|
|
|
343
343
|
* @return {*} {string}
|
|
344
344
|
*/
|
|
345
345
|
b(e = "") {
|
|
346
|
-
return
|
|
346
|
+
return K(this.namespace, this.block, e, "", "");
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
349
|
* namespace-block__element
|
|
@@ -354,7 +354,7 @@ class $ {
|
|
|
354
354
|
* @return {*} {string}
|
|
355
355
|
*/
|
|
356
356
|
e(e) {
|
|
357
|
-
return e ?
|
|
357
|
+
return e ? K(this.namespace, this.block, "", e, "") : "";
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
360
|
* namespace-block--modifier
|
|
@@ -365,7 +365,7 @@ class $ {
|
|
|
365
365
|
* @return {*} {string}
|
|
366
366
|
*/
|
|
367
367
|
m(e) {
|
|
368
|
-
return e ?
|
|
368
|
+
return e ? K(this.namespace, this.block, "", "", e) : "";
|
|
369
369
|
}
|
|
370
370
|
/**
|
|
371
371
|
* namespace-block-blockSuffix__element
|
|
@@ -377,7 +377,7 @@ class $ {
|
|
|
377
377
|
* @return {*} {string}
|
|
378
378
|
*/
|
|
379
379
|
be(e, t) {
|
|
380
|
-
return e && t ?
|
|
380
|
+
return e && t ? K(this.namespace, this.block, e, t, "") : "";
|
|
381
381
|
}
|
|
382
382
|
/**
|
|
383
383
|
* namespace-block__element--modifier
|
|
@@ -389,7 +389,7 @@ class $ {
|
|
|
389
389
|
* @return {*} {string}
|
|
390
390
|
*/
|
|
391
391
|
em(e, t) {
|
|
392
|
-
return e && t ?
|
|
392
|
+
return e && t ? K(this.namespace, this.block, "", e, t) : "";
|
|
393
393
|
}
|
|
394
394
|
/**
|
|
395
395
|
* namespace-block-blockSuffix--modifier
|
|
@@ -401,7 +401,7 @@ class $ {
|
|
|
401
401
|
* @return {*} {string}
|
|
402
402
|
*/
|
|
403
403
|
bm(e, t) {
|
|
404
|
-
return e && t ?
|
|
404
|
+
return e && t ? K(this.namespace, this.block, e, "", t) : "";
|
|
405
405
|
}
|
|
406
406
|
/**
|
|
407
407
|
* namespace-block-blockSuffix__element--modifier
|
|
@@ -414,7 +414,7 @@ class $ {
|
|
|
414
414
|
* @return {*} {string}
|
|
415
415
|
*/
|
|
416
416
|
bem(e, t, i) {
|
|
417
|
-
return e && t && i ?
|
|
417
|
+
return e && t && i ? K(this.namespace, this.block, e, t, i) : "";
|
|
418
418
|
}
|
|
419
419
|
/**
|
|
420
420
|
* 返回状态 class
|
|
@@ -429,7 +429,7 @@ class $ {
|
|
|
429
429
|
* @return {*} {string}
|
|
430
430
|
*/
|
|
431
431
|
is(e, t) {
|
|
432
|
-
return e && t ? "".concat(
|
|
432
|
+
return e && t ? "".concat(An).concat(e) : "";
|
|
433
433
|
}
|
|
434
434
|
/**
|
|
435
435
|
* 生成使用到的 css 变量 style 对象
|
|
@@ -482,112 +482,112 @@ class $ {
|
|
|
482
482
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function U(n) {
|
|
486
486
|
if (typeof n != "string")
|
|
487
487
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
for (var t = "", i = 0, s = -1, o = 0,
|
|
491
|
-
if (
|
|
492
|
-
|
|
489
|
+
function dt(n, e) {
|
|
490
|
+
for (var t = "", i = 0, s = -1, o = 0, a, r = 0; r <= n.length; ++r) {
|
|
491
|
+
if (r < n.length)
|
|
492
|
+
a = n.charCodeAt(r);
|
|
493
493
|
else {
|
|
494
|
-
if (
|
|
494
|
+
if (a === 47)
|
|
495
495
|
break;
|
|
496
|
-
|
|
496
|
+
a = 47;
|
|
497
497
|
}
|
|
498
|
-
if (
|
|
499
|
-
if (!(s ===
|
|
500
|
-
if (s !==
|
|
498
|
+
if (a === 47) {
|
|
499
|
+
if (!(s === r - 1 || o === 1))
|
|
500
|
+
if (s !== r - 1 && o === 2) {
|
|
501
501
|
if (t.length < 2 || i !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
|
|
502
502
|
if (t.length > 2) {
|
|
503
503
|
var u = t.lastIndexOf("/");
|
|
504
504
|
if (u !== t.length - 1) {
|
|
505
|
-
u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s =
|
|
505
|
+
u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s = r, o = 0;
|
|
506
506
|
continue;
|
|
507
507
|
}
|
|
508
508
|
} else if (t.length === 2 || t.length === 1) {
|
|
509
|
-
t = "", i = 0, s =
|
|
509
|
+
t = "", i = 0, s = r, o = 0;
|
|
510
510
|
continue;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
e && (t.length > 0 ? t += "/.." : t = "..", i = 2);
|
|
514
514
|
} else
|
|
515
|
-
t.length > 0 ? t += "/" + n.slice(s + 1,
|
|
516
|
-
s =
|
|
515
|
+
t.length > 0 ? t += "/" + n.slice(s + 1, r) : t = n.slice(s + 1, r), i = r - s - 1;
|
|
516
|
+
s = r, o = 0;
|
|
517
517
|
} else
|
|
518
|
-
|
|
518
|
+
a === 46 && o !== -1 ? ++o : o = -1;
|
|
519
519
|
}
|
|
520
520
|
return t;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function In(n, e) {
|
|
523
523
|
var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
|
|
524
524
|
return t ? t === e.root ? t + i : t + n + i : i;
|
|
525
525
|
}
|
|
526
|
-
var
|
|
526
|
+
var fe = {
|
|
527
527
|
// path.resolve([from ...], to)
|
|
528
528
|
resolve: function() {
|
|
529
529
|
for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
|
|
530
530
|
var o;
|
|
531
|
-
s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i),
|
|
531
|
+
s >= 0 ? o = arguments[s] : (i === void 0 && (i = process.cwd()), o = i), U(o), o.length !== 0 && (e = o + "/" + e, t = o.charCodeAt(0) === 47);
|
|
532
532
|
}
|
|
533
|
-
return e =
|
|
533
|
+
return e = dt(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
534
534
|
},
|
|
535
535
|
normalize: function(e) {
|
|
536
|
-
if (
|
|
536
|
+
if (U(e), e.length === 0)
|
|
537
537
|
return ".";
|
|
538
538
|
var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
|
|
539
|
-
return e =
|
|
539
|
+
return e = dt(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
|
|
540
540
|
},
|
|
541
541
|
isAbsolute: function(e) {
|
|
542
|
-
return
|
|
542
|
+
return U(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
543
543
|
},
|
|
544
544
|
join: function() {
|
|
545
545
|
if (arguments.length === 0)
|
|
546
546
|
return ".";
|
|
547
547
|
for (var e, t = 0; t < arguments.length; ++t) {
|
|
548
548
|
var i = arguments[t];
|
|
549
|
-
|
|
549
|
+
U(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
|
|
550
550
|
}
|
|
551
|
-
return e === void 0 ? "." :
|
|
551
|
+
return e === void 0 ? "." : fe.normalize(e);
|
|
552
552
|
},
|
|
553
553
|
relative: function(e, t) {
|
|
554
|
-
if (
|
|
554
|
+
if (U(e), U(t), e === t || (e = fe.resolve(e), t = fe.resolve(t), e === t))
|
|
555
555
|
return "";
|
|
556
556
|
for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
|
|
557
557
|
;
|
|
558
|
-
for (var s = e.length, o = s - i,
|
|
558
|
+
for (var s = e.length, o = s - i, a = 1; a < t.length && t.charCodeAt(a) === 47; ++a)
|
|
559
559
|
;
|
|
560
|
-
for (var
|
|
561
|
-
if (l ===
|
|
562
|
-
if (u >
|
|
563
|
-
if (t.charCodeAt(
|
|
564
|
-
return t.slice(
|
|
560
|
+
for (var r = t.length, u = r - a, h = o < u ? o : u, p = -1, l = 0; l <= h; ++l) {
|
|
561
|
+
if (l === h) {
|
|
562
|
+
if (u > h) {
|
|
563
|
+
if (t.charCodeAt(a + l) === 47)
|
|
564
|
+
return t.slice(a + l + 1);
|
|
565
565
|
if (l === 0)
|
|
566
|
-
return t.slice(
|
|
566
|
+
return t.slice(a + l);
|
|
567
567
|
} else
|
|
568
|
-
o >
|
|
568
|
+
o > h && (e.charCodeAt(i + l) === 47 ? p = l : l === 0 && (p = 0));
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
if (
|
|
571
|
+
var v = e.charCodeAt(i + l), g = t.charCodeAt(a + l);
|
|
572
|
+
if (v !== g)
|
|
573
573
|
break;
|
|
574
|
-
|
|
574
|
+
v === 47 && (p = l);
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
for (l = i +
|
|
578
|
-
(l === s || e.charCodeAt(l) === 47) && (
|
|
579
|
-
return
|
|
576
|
+
var d = "";
|
|
577
|
+
for (l = i + p + 1; l <= s; ++l)
|
|
578
|
+
(l === s || e.charCodeAt(l) === 47) && (d.length === 0 ? d += ".." : d += "/..");
|
|
579
|
+
return d.length > 0 ? d + t.slice(a + p) : (a += p, t.charCodeAt(a) === 47 && ++a, t.slice(a));
|
|
580
580
|
},
|
|
581
581
|
_makeLong: function(e) {
|
|
582
582
|
return e;
|
|
583
583
|
},
|
|
584
584
|
dirname: function(e) {
|
|
585
|
-
if (
|
|
585
|
+
if (U(e), e.length === 0)
|
|
586
586
|
return ".";
|
|
587
|
-
for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0,
|
|
588
|
-
if (t = e.charCodeAt(
|
|
587
|
+
for (var t = e.charCodeAt(0), i = t === 47, s = -1, o = !0, a = e.length - 1; a >= 1; --a)
|
|
588
|
+
if (t = e.charCodeAt(a), t === 47) {
|
|
589
589
|
if (!o) {
|
|
590
|
-
s =
|
|
590
|
+
s = a;
|
|
591
591
|
break;
|
|
592
592
|
}
|
|
593
593
|
} else
|
|
@@ -597,95 +597,95 @@ var he = {
|
|
|
597
597
|
basename: function(e, t) {
|
|
598
598
|
if (t !== void 0 && typeof t != "string")
|
|
599
599
|
throw new TypeError('"ext" argument must be a string');
|
|
600
|
-
|
|
601
|
-
var i = 0, s = -1, o = !0,
|
|
600
|
+
U(e);
|
|
601
|
+
var i = 0, s = -1, o = !0, a;
|
|
602
602
|
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
603
603
|
if (t.length === e.length && t === e)
|
|
604
604
|
return "";
|
|
605
|
-
var
|
|
606
|
-
for (
|
|
607
|
-
var
|
|
608
|
-
if (
|
|
605
|
+
var r = t.length - 1, u = -1;
|
|
606
|
+
for (a = e.length - 1; a >= 0; --a) {
|
|
607
|
+
var h = e.charCodeAt(a);
|
|
608
|
+
if (h === 47) {
|
|
609
609
|
if (!o) {
|
|
610
|
-
i =
|
|
610
|
+
i = a + 1;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
613
|
} else
|
|
614
|
-
u === -1 && (o = !1, u =
|
|
614
|
+
u === -1 && (o = !1, u = a + 1), r >= 0 && (h === t.charCodeAt(r) ? --r === -1 && (s = a) : (r = -1, s = u));
|
|
615
615
|
}
|
|
616
616
|
return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
|
|
617
617
|
} else {
|
|
618
|
-
for (
|
|
619
|
-
if (e.charCodeAt(
|
|
618
|
+
for (a = e.length - 1; a >= 0; --a)
|
|
619
|
+
if (e.charCodeAt(a) === 47) {
|
|
620
620
|
if (!o) {
|
|
621
|
-
i =
|
|
621
|
+
i = a + 1;
|
|
622
622
|
break;
|
|
623
623
|
}
|
|
624
624
|
} else
|
|
625
|
-
s === -1 && (o = !1, s =
|
|
625
|
+
s === -1 && (o = !1, s = a + 1);
|
|
626
626
|
return s === -1 ? "" : e.slice(i, s);
|
|
627
627
|
}
|
|
628
628
|
},
|
|
629
629
|
extname: function(e) {
|
|
630
|
-
|
|
631
|
-
for (var t = -1, i = 0, s = -1, o = !0,
|
|
632
|
-
var u = e.charCodeAt(
|
|
630
|
+
U(e);
|
|
631
|
+
for (var t = -1, i = 0, s = -1, o = !0, a = 0, r = e.length - 1; r >= 0; --r) {
|
|
632
|
+
var u = e.charCodeAt(r);
|
|
633
633
|
if (u === 47) {
|
|
634
634
|
if (!o) {
|
|
635
|
-
i =
|
|
635
|
+
i = r + 1;
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
continue;
|
|
639
639
|
}
|
|
640
|
-
s === -1 && (o = !1, s =
|
|
640
|
+
s === -1 && (o = !1, s = r + 1), u === 46 ? t === -1 ? t = r : a !== 1 && (a = 1) : t !== -1 && (a = -1);
|
|
641
641
|
}
|
|
642
642
|
return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
|
|
643
|
-
|
|
644
|
-
|
|
643
|
+
a === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
644
|
+
a === 1 && t === s - 1 && t === i + 1 ? "" : e.slice(t, s);
|
|
645
645
|
},
|
|
646
646
|
format: function(e) {
|
|
647
647
|
if (e === null || typeof e != "object")
|
|
648
648
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
|
|
649
|
-
return
|
|
649
|
+
return In("/", e);
|
|
650
650
|
},
|
|
651
651
|
parse: function(e) {
|
|
652
|
-
|
|
652
|
+
U(e);
|
|
653
653
|
var t = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
654
654
|
if (e.length === 0)
|
|
655
655
|
return t;
|
|
656
656
|
var i = e.charCodeAt(0), s = i === 47, o;
|
|
657
657
|
s ? (t.root = "/", o = 1) : o = 0;
|
|
658
|
-
for (var
|
|
659
|
-
if (i = e.charCodeAt(
|
|
660
|
-
if (!
|
|
661
|
-
|
|
658
|
+
for (var a = -1, r = 0, u = -1, h = !0, p = e.length - 1, l = 0; p >= o; --p) {
|
|
659
|
+
if (i = e.charCodeAt(p), i === 47) {
|
|
660
|
+
if (!h) {
|
|
661
|
+
r = p + 1;
|
|
662
662
|
break;
|
|
663
663
|
}
|
|
664
664
|
continue;
|
|
665
665
|
}
|
|
666
|
-
u === -1 && (
|
|
666
|
+
u === -1 && (h = !1, u = p + 1), i === 46 ? a === -1 ? a = p : l !== 1 && (l = 1) : a !== -1 && (l = -1);
|
|
667
667
|
}
|
|
668
|
-
return
|
|
668
|
+
return a === -1 || u === -1 || // We saw a non-dot character immediately before the dot
|
|
669
669
|
l === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
670
|
-
l === 1 &&
|
|
670
|
+
l === 1 && a === u - 1 && a === r + 1 ? u !== -1 && (r === 0 && s ? t.base = t.name = e.slice(1, u) : t.base = t.name = e.slice(r, u)) : (r === 0 && s ? (t.name = e.slice(1, a), t.base = e.slice(1, u)) : (t.name = e.slice(r, a), t.base = e.slice(r, u)), t.ext = e.slice(a, u)), r > 0 ? t.dir = e.slice(0, r - 1) : s && (t.dir = "/"), t;
|
|
671
671
|
},
|
|
672
672
|
sep: "/",
|
|
673
673
|
delimiter: ":",
|
|
674
674
|
win32: null,
|
|
675
675
|
posix: null
|
|
676
676
|
};
|
|
677
|
-
|
|
678
|
-
function
|
|
677
|
+
fe.posix = fe;
|
|
678
|
+
function X() {
|
|
679
679
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
return "".concat(
|
|
681
|
+
function et() {
|
|
682
|
+
return "".concat(X() + X(), "-").concat(X(), "-").concat(X(), "-").concat(X(), "-").concat(X()).concat(X()).concat(X());
|
|
683
683
|
}
|
|
684
684
|
const Dn = /<svg\b[^>]*>[\s\S]*?<\/svg>/;
|
|
685
685
|
function tt(n) {
|
|
686
686
|
return Dn.test(n);
|
|
687
687
|
}
|
|
688
|
-
class
|
|
688
|
+
class en {
|
|
689
689
|
/**
|
|
690
690
|
* 拷贝文本
|
|
691
691
|
*
|
|
@@ -706,8 +706,8 @@ class Qt {
|
|
|
706
706
|
* @private
|
|
707
707
|
* @type {(HTMLInputElement | null)}
|
|
708
708
|
*/
|
|
709
|
-
|
|
710
|
-
const
|
|
709
|
+
T(en, "inputElement", null);
|
|
710
|
+
const y = class y {
|
|
711
711
|
/**
|
|
712
712
|
* 检查数据库是否存在
|
|
713
713
|
*
|
|
@@ -730,13 +730,13 @@ const b = class b {
|
|
|
730
730
|
*/
|
|
731
731
|
static async deleteDatabase(e) {
|
|
732
732
|
var t, i;
|
|
733
|
-
return
|
|
734
|
-
const
|
|
735
|
-
|
|
733
|
+
return y.lastLink && ((i = (t = y.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
|
|
734
|
+
const a = indexedDB.deleteDatabase(e);
|
|
735
|
+
a.onsuccess = () => {
|
|
736
736
|
s(!0);
|
|
737
|
-
},
|
|
737
|
+
}, a.onerror = () => {
|
|
738
738
|
s(!1);
|
|
739
|
-
},
|
|
739
|
+
}, a.onblocked = () => {
|
|
740
740
|
console.warn("删除数据库 ".concat(e, " 被阻塞,可能有其他连接正在使用该数据库。")), o(new Error("删除数据库 ".concat(e, " 被阻塞")));
|
|
741
741
|
};
|
|
742
742
|
});
|
|
@@ -750,16 +750,16 @@ const b = class b {
|
|
|
750
750
|
* @memberof IndexedDBUtil
|
|
751
751
|
*/
|
|
752
752
|
static async checkTableExists(e, t) {
|
|
753
|
-
return await
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
},
|
|
758
|
-
|
|
759
|
-
const u =
|
|
760
|
-
|
|
761
|
-
},
|
|
762
|
-
o(
|
|
753
|
+
return await y.checkDataBaseExists(e) ? new Promise((s, o) => {
|
|
754
|
+
const a = indexedDB.open(e);
|
|
755
|
+
a.onupgradeneeded = (r) => {
|
|
756
|
+
y.db = r.target.result, y.version = y.db.version;
|
|
757
|
+
}, a.onsuccess = (r) => {
|
|
758
|
+
y.db = r.target.result, y.lastLink = a.result;
|
|
759
|
+
const u = y.db.objectStoreNames.contains(t);
|
|
760
|
+
a.result.close(), s(u);
|
|
761
|
+
}, a.onerror = (r) => {
|
|
762
|
+
o(r.target.error);
|
|
763
763
|
};
|
|
764
764
|
}) : !1;
|
|
765
765
|
}
|
|
@@ -774,17 +774,17 @@ const b = class b {
|
|
|
774
774
|
*/
|
|
775
775
|
static async createTable(e, t, i, s = !1) {
|
|
776
776
|
return new Promise((o) => {
|
|
777
|
-
var
|
|
778
|
-
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
if (
|
|
782
|
-
const
|
|
783
|
-
i ?
|
|
777
|
+
var r, u;
|
|
778
|
+
y.version += 1, y.lastLink && ((u = (r = y.lastLink).close) == null || u.call(r));
|
|
779
|
+
const a = indexedDB.open(e, y.version);
|
|
780
|
+
a.onupgradeneeded = (h) => {
|
|
781
|
+
if (y.db = h.target.result, !y.db.objectStoreNames.contains(t)) {
|
|
782
|
+
const p = {};
|
|
783
|
+
i ? p.keyPath = i : s && (p.autoIncrement = !0), y.db.createObjectStore(t, p);
|
|
784
784
|
}
|
|
785
|
-
},
|
|
786
|
-
|
|
787
|
-
},
|
|
785
|
+
}, a.onsuccess = () => {
|
|
786
|
+
y.lastLink = a.result, a.result.close(), o(!0);
|
|
787
|
+
}, a.onerror = () => {
|
|
788
788
|
o(!1);
|
|
789
789
|
};
|
|
790
790
|
});
|
|
@@ -798,13 +798,13 @@ const b = class b {
|
|
|
798
798
|
*/
|
|
799
799
|
static async deleteTable(e, t) {
|
|
800
800
|
return new Promise((i) => {
|
|
801
|
-
var o,
|
|
802
|
-
|
|
803
|
-
const s = indexedDB.open(e,
|
|
804
|
-
s.onupgradeneeded = (
|
|
805
|
-
|
|
806
|
-
}, s.onsuccess = (
|
|
807
|
-
|
|
801
|
+
var o, a;
|
|
802
|
+
y.version += 1, y.lastLink && ((a = (o = y.lastLink).close) == null || a.call(o));
|
|
803
|
+
const s = indexedDB.open(e, y.version);
|
|
804
|
+
s.onupgradeneeded = (r) => {
|
|
805
|
+
y.db = r.target.result, y.lastLink = s.result, y.db.objectStoreNames.contains(t) && y.db.deleteObjectStore(t);
|
|
806
|
+
}, s.onsuccess = (r) => {
|
|
807
|
+
y.db = r.target.result, y.lastLink = s.result, s.result.close(), i(!0);
|
|
808
808
|
}, s.onerror = () => {
|
|
809
809
|
s.result.close(), i(!1);
|
|
810
810
|
};
|
|
@@ -820,19 +820,19 @@ const b = class b {
|
|
|
820
820
|
*/
|
|
821
821
|
static async addData(e, t, i) {
|
|
822
822
|
return new Promise((s, o) => {
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
|
|
823
|
+
const a = indexedDB.open(e);
|
|
824
|
+
a.onsuccess = (r) => {
|
|
825
|
+
if (y.db = r.target.result, y.lastLink = a.result, y.db.objectStoreNames.contains(t)) {
|
|
826
|
+
const p = y.db.transaction([t], "readwrite").objectStore(t).add(i);
|
|
827
|
+
p.onsuccess = (l) => {
|
|
828
828
|
s(i);
|
|
829
|
-
},
|
|
829
|
+
}, p.onerror = () => {
|
|
830
830
|
s(null);
|
|
831
831
|
};
|
|
832
832
|
}
|
|
833
|
-
|
|
834
|
-
},
|
|
835
|
-
|
|
833
|
+
a.result.close();
|
|
834
|
+
}, a.onerror = () => {
|
|
835
|
+
a.result.close(), o();
|
|
836
836
|
};
|
|
837
837
|
});
|
|
838
838
|
}
|
|
@@ -846,19 +846,19 @@ const b = class b {
|
|
|
846
846
|
*/
|
|
847
847
|
static async deleteData(e, t, i) {
|
|
848
848
|
return new Promise((s, o) => {
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
if (
|
|
852
|
-
const
|
|
853
|
-
|
|
849
|
+
const a = indexedDB.open(e);
|
|
850
|
+
a.onsuccess = (r) => {
|
|
851
|
+
if (y.db = r.target.result, y.lastLink = a.result, y.db.objectStoreNames.contains(t)) {
|
|
852
|
+
const p = y.db.transaction([t], "readwrite").objectStore(t).delete(i);
|
|
853
|
+
p.onsuccess = (l) => {
|
|
854
854
|
s(!0);
|
|
855
|
-
},
|
|
855
|
+
}, p.onerror = () => {
|
|
856
856
|
s(!1);
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
|
|
859
|
+
a.result.close();
|
|
860
|
+
}, a.onerror = () => {
|
|
861
|
+
a.result.close(), o();
|
|
862
862
|
};
|
|
863
863
|
});
|
|
864
864
|
}
|
|
@@ -872,19 +872,19 @@ const b = class b {
|
|
|
872
872
|
*/
|
|
873
873
|
static async updateData(e, t, i) {
|
|
874
874
|
return new Promise((s, o) => {
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
if (
|
|
878
|
-
const
|
|
879
|
-
|
|
875
|
+
const a = indexedDB.open(e);
|
|
876
|
+
a.onsuccess = (r) => {
|
|
877
|
+
if (y.db = r.target.result, y.lastLink = a.result, y.db.objectStoreNames.contains(t)) {
|
|
878
|
+
const p = y.db.transaction([t], "readwrite").objectStore(t).put(i);
|
|
879
|
+
p.onsuccess = (l) => {
|
|
880
880
|
s(i);
|
|
881
|
-
},
|
|
881
|
+
}, p.onerror = () => {
|
|
882
882
|
s(i);
|
|
883
883
|
};
|
|
884
884
|
}
|
|
885
|
-
|
|
886
|
-
},
|
|
887
|
-
|
|
885
|
+
a.result.close();
|
|
886
|
+
}, a.onerror = () => {
|
|
887
|
+
a.result.close(), o();
|
|
888
888
|
};
|
|
889
889
|
});
|
|
890
890
|
}
|
|
@@ -898,19 +898,19 @@ const b = class b {
|
|
|
898
898
|
*/
|
|
899
899
|
static async getData(e, t, i) {
|
|
900
900
|
return new Promise((s, o) => {
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
if (
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
s(
|
|
907
|
-
},
|
|
901
|
+
const a = indexedDB.open(e);
|
|
902
|
+
a.onsuccess = (r) => {
|
|
903
|
+
if (y.db = r.target.result, y.lastLink = a.result, y.db.objectStoreNames.contains(t)) {
|
|
904
|
+
const p = y.db.transaction([t], "readonly").objectStore(t).get(i);
|
|
905
|
+
p.onsuccess = (l) => {
|
|
906
|
+
s(p.result);
|
|
907
|
+
}, p.onerror = () => {
|
|
908
908
|
o(new Error("未找到数据".concat(i)));
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
|
-
|
|
912
|
-
},
|
|
913
|
-
|
|
911
|
+
a.result.close();
|
|
912
|
+
}, a.onerror = () => {
|
|
913
|
+
a.result.close(), o();
|
|
914
914
|
};
|
|
915
915
|
});
|
|
916
916
|
}
|
|
@@ -924,12 +924,12 @@ const b = class b {
|
|
|
924
924
|
static async getAllData(e, t) {
|
|
925
925
|
return new Promise((i, s) => {
|
|
926
926
|
const o = indexedDB.open(e);
|
|
927
|
-
o.onsuccess = (
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
930
|
-
|
|
931
|
-
i(
|
|
932
|
-
},
|
|
927
|
+
o.onsuccess = (a) => {
|
|
928
|
+
if (y.db = a.target.result, y.lastLink = o.result, y.db.objectStoreNames.contains(t)) {
|
|
929
|
+
const h = y.db.transaction([t], "readonly").objectStore(t).getAll();
|
|
930
|
+
h.onsuccess = (p) => {
|
|
931
|
+
i(h.result);
|
|
932
|
+
}, h.onerror = () => {
|
|
933
933
|
i([]);
|
|
934
934
|
};
|
|
935
935
|
}
|
|
@@ -941,10 +941,10 @@ const b = class b {
|
|
|
941
941
|
}
|
|
942
942
|
};
|
|
943
943
|
// 数据库版本
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
let
|
|
944
|
+
T(y, "version", 1), // 数据库连接句柄
|
|
945
|
+
T(y, "db", null), // 上一个连接
|
|
946
|
+
T(y, "lastLink");
|
|
947
|
+
let V = y;
|
|
948
948
|
class zn {
|
|
949
949
|
/**
|
|
950
950
|
* Creates an instance of FileUploader.
|
|
@@ -953,7 +953,7 @@ class zn {
|
|
|
953
953
|
* @param {FileUploaderOptions<T>} options
|
|
954
954
|
*/
|
|
955
955
|
constructor(e) {
|
|
956
|
-
|
|
956
|
+
T(this, "options");
|
|
957
957
|
this.options = {
|
|
958
958
|
multiple: !0,
|
|
959
959
|
accept: "*/*",
|
|
@@ -979,8 +979,8 @@ class zn {
|
|
|
979
979
|
if (e.length === 0)
|
|
980
980
|
return;
|
|
981
981
|
const t = e.filter((o) => {
|
|
982
|
-
var
|
|
983
|
-
return this.options.maxSize && o.size > this.options.maxSize ? ((
|
|
982
|
+
var a, r;
|
|
983
|
+
return this.options.maxSize && o.size > this.options.maxSize ? ((r = (a = this.options).onError) == null || r.call(a, new Error("文件大小超过限制 (".concat(this.formatSize(o.size), " > ").concat(this.formatSize(this.options.maxSize), ")")), o), !1) : !0;
|
|
984
984
|
});
|
|
985
985
|
(s = (i = this.options).onSelect) == null || s.call(i, t), await Promise.all(t.map((o) => this.processFile(o)));
|
|
986
986
|
}
|
|
@@ -988,15 +988,15 @@ class zn {
|
|
|
988
988
|
* 处理单个文件上传
|
|
989
989
|
*/
|
|
990
990
|
async processFile(e) {
|
|
991
|
-
var t, i, s, o,
|
|
991
|
+
var t, i, s, o, a, r;
|
|
992
992
|
try {
|
|
993
|
-
const u = (
|
|
994
|
-
var l,
|
|
995
|
-
(
|
|
996
|
-
},
|
|
997
|
-
(i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s,
|
|
993
|
+
const u = (p) => {
|
|
994
|
+
var l, v;
|
|
995
|
+
(v = (l = this.options).onProgress) == null || v.call(l, e, p);
|
|
996
|
+
}, h = await this.options.onUpload(e, u);
|
|
997
|
+
(i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, h, e);
|
|
998
998
|
} catch (u) {
|
|
999
|
-
(
|
|
999
|
+
(r = (a = this.options).onError) == null || r.call(a, u instanceof Error ? u : new Error("上传失败"), e);
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
/**
|
|
@@ -1009,7 +1009,7 @@ class zn {
|
|
|
1009
1009
|
return "".concat((e / 1024 ** i).toFixed(2), " ").concat(t[i]);
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
class
|
|
1012
|
+
class tn {
|
|
1013
1013
|
/**
|
|
1014
1014
|
* 从XML元素中提取CDATA内容
|
|
1015
1015
|
*
|
|
@@ -1038,17 +1038,17 @@ class en {
|
|
|
1038
1038
|
static parse(e) {
|
|
1039
1039
|
const i = new DOMParser().parseFromString(e, "text/xml");
|
|
1040
1040
|
return Array.from(i.querySelectorAll("resource")).map((o) => {
|
|
1041
|
-
const
|
|
1041
|
+
const a = o.getAttribute("type") || "", r = o.querySelector("data"), u = o.querySelector("metadata");
|
|
1042
1042
|
try {
|
|
1043
|
-
const
|
|
1043
|
+
const h = this.getCdataContent(r), p = this.getCdataContent(u), l = h ? JSON.parse(h) : {}, v = p ? JSON.parse(p) : {};
|
|
1044
1044
|
return {
|
|
1045
1045
|
id: l.id,
|
|
1046
|
-
type:
|
|
1046
|
+
type: a,
|
|
1047
1047
|
data: l,
|
|
1048
|
-
metadata:
|
|
1048
|
+
metadata: v
|
|
1049
1049
|
};
|
|
1050
|
-
} catch (
|
|
1051
|
-
throw new Error("XML 解析错误: ".concat(
|
|
1050
|
+
} catch (h) {
|
|
1051
|
+
throw new Error("XML 解析错误: ".concat(h.message));
|
|
1052
1052
|
}
|
|
1053
1053
|
});
|
|
1054
1054
|
}
|
|
@@ -1074,17 +1074,17 @@ class en {
|
|
|
1074
1074
|
remainingText: e,
|
|
1075
1075
|
hasResources: !1
|
|
1076
1076
|
};
|
|
1077
|
-
const [s] = i, o = i.index,
|
|
1077
|
+
const [s] = i, o = i.index, a = o + s.length, r = (e.slice(0, o) + e.slice(a)).replace(/\n/g, "");
|
|
1078
1078
|
try {
|
|
1079
1079
|
return {
|
|
1080
1080
|
resources: this.parse(s),
|
|
1081
|
-
remainingText:
|
|
1081
|
+
remainingText: r,
|
|
1082
1082
|
hasResources: !0
|
|
1083
1083
|
};
|
|
1084
1084
|
} catch (u) {
|
|
1085
1085
|
return {
|
|
1086
1086
|
resources: [],
|
|
1087
|
-
remainingText:
|
|
1087
|
+
remainingText: r,
|
|
1088
1088
|
hasResources: !0,
|
|
1089
1089
|
error: "资源解析失败: ".concat(u.message)
|
|
1090
1090
|
};
|
|
@@ -1102,133 +1102,240 @@ class en {
|
|
|
1102
1102
|
static stringify(e) {
|
|
1103
1103
|
const t = document.implementation.createDocument(null, null, null), i = t.createElement("resources");
|
|
1104
1104
|
i.setAttribute("version", "1.0");
|
|
1105
|
-
const s = (
|
|
1106
|
-
return e.forEach((
|
|
1105
|
+
const s = (a) => "\n".concat(" ".repeat(a)), o = 1;
|
|
1106
|
+
return e.forEach((a) => {
|
|
1107
1107
|
i.appendChild(t.createTextNode(s(o)));
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
const u = (
|
|
1111
|
-
const l = t.createElement(
|
|
1108
|
+
const r = t.createElement("resource");
|
|
1109
|
+
r.setAttribute("type", a.type), r.setAttribute("version", "1.0");
|
|
1110
|
+
const u = (h, p) => {
|
|
1111
|
+
const l = t.createElement(h);
|
|
1112
1112
|
l.appendChild(t.createTextNode(s(o + 1)));
|
|
1113
|
-
const
|
|
1114
|
-
return l.appendChild(
|
|
1113
|
+
const v = t.createCDATASection(JSON.stringify(p));
|
|
1114
|
+
return l.appendChild(v), l.appendChild(t.createTextNode(s(o))), l;
|
|
1115
1115
|
};
|
|
1116
|
-
|
|
1116
|
+
r.appendChild(t.createTextNode(s(o + 1))), r.appendChild(u("data", a.data)), r.appendChild(t.createTextNode(s(o + 1))), r.appendChild(u("metadata", a.metadata)), r.appendChild(t.createTextNode(s(o))), i.appendChild(r);
|
|
1117
1117
|
}), i.appendChild(t.createTextNode("\n")), t.appendChild(i), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
|
|
1120
|
+
class Ln {
|
|
1121
|
+
/**
|
|
1122
|
+
* 从XML元素中提取CDATA内容
|
|
1123
|
+
*
|
|
1124
|
+
* @author tony001
|
|
1125
|
+
* @date 2025-03-03 15:03:43
|
|
1126
|
+
* @private
|
|
1127
|
+
* @static
|
|
1128
|
+
* @param {(Element | null)} element
|
|
1129
|
+
* @return {*} {(string | null)}
|
|
1130
|
+
*/
|
|
1131
|
+
static getCdataContent(e) {
|
|
1132
|
+
if (!e)
|
|
1133
|
+
return null;
|
|
1134
|
+
const t = Array.from(e.childNodes).find((i) => i.nodeType === i.CDATA_SECTION_NODE);
|
|
1135
|
+
return (t == null ? void 0 : t.nodeValue) || e.textContent;
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* XML 字符串转数据对象
|
|
1139
|
+
*
|
|
1140
|
+
* @author tony001
|
|
1141
|
+
* @date 2025-03-03 11:03:17
|
|
1142
|
+
* @static
|
|
1143
|
+
* @param {string} xmlString
|
|
1144
|
+
* @return {*} {IChatSuggestion[]}
|
|
1145
|
+
*/
|
|
1146
|
+
static parse(e) {
|
|
1147
|
+
const i = new DOMParser().parseFromString(e, "text/xml");
|
|
1148
|
+
return Array.from(i.querySelectorAll("suggestion")).map((o) => {
|
|
1149
|
+
const a = o.getAttribute("type") || "", r = o.querySelector("data"), u = o.querySelector("metadata");
|
|
1150
|
+
try {
|
|
1151
|
+
const h = this.getCdataContent(r), p = this.getCdataContent(u), l = h ? JSON.parse(h) : {}, v = p ? JSON.parse(p) : {};
|
|
1152
|
+
return {
|
|
1153
|
+
type: a,
|
|
1154
|
+
data: l,
|
|
1155
|
+
metadata: v
|
|
1156
|
+
};
|
|
1157
|
+
} catch (h) {
|
|
1158
|
+
throw new Error("XML 解析错误: ".concat(h.message));
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* 混合内容解析
|
|
1164
|
+
*
|
|
1165
|
+
* @author tony001
|
|
1166
|
+
* @date 2025-03-03 13:03:35
|
|
1167
|
+
* @static
|
|
1168
|
+
* @param {string} input 包含 XML 和其他文本的混合字符串
|
|
1169
|
+
* @return {*} {{
|
|
1170
|
+
* suggestions: IChatSuggestion[];
|
|
1171
|
+
* remainingText: string;
|
|
1172
|
+
* hasSuggestions: boolean;
|
|
1173
|
+
* error?: string;
|
|
1174
|
+
* }}
|
|
1175
|
+
*/
|
|
1176
|
+
static parseMixedContent(e) {
|
|
1177
|
+
const i = /<suggestions\b[^>]*>[\s\S]*?<\/suggestions>/i.exec(e);
|
|
1178
|
+
if (!i)
|
|
1179
|
+
return {
|
|
1180
|
+
suggestions: [],
|
|
1181
|
+
remainingText: e,
|
|
1182
|
+
hasSuggestions: !1
|
|
1183
|
+
};
|
|
1184
|
+
const [s] = i, o = i.index, a = o + s.length, r = (e.slice(0, o) + e.slice(a)).replace(/\n/g, "");
|
|
1185
|
+
try {
|
|
1186
|
+
return {
|
|
1187
|
+
suggestions: this.parse(s),
|
|
1188
|
+
remainingText: r,
|
|
1189
|
+
hasSuggestions: !0
|
|
1190
|
+
};
|
|
1191
|
+
} catch (u) {
|
|
1192
|
+
return {
|
|
1193
|
+
suggestions: [],
|
|
1194
|
+
remainingText: r,
|
|
1195
|
+
hasSuggestions: !0,
|
|
1196
|
+
error: "资源解析失败: ".concat(u.message)
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* 数据对象转 XML 字符串
|
|
1202
|
+
*
|
|
1203
|
+
* @author tony001
|
|
1204
|
+
* @date 2025-03-03 11:03:51
|
|
1205
|
+
* @static
|
|
1206
|
+
* @param {IChatSuggestion[]} suggestions
|
|
1207
|
+
* @return {*} {string}
|
|
1208
|
+
*/
|
|
1209
|
+
static stringify(e) {
|
|
1210
|
+
const t = document.implementation.createDocument(null, null, null), i = t.createElement("suggestions");
|
|
1211
|
+
i.setAttribute("version", "1.0");
|
|
1212
|
+
const s = (a) => "\n".concat(" ".repeat(a)), o = 1;
|
|
1213
|
+
return e.forEach((a) => {
|
|
1214
|
+
i.appendChild(t.createTextNode(s(o)));
|
|
1215
|
+
const r = t.createElement("suggestion");
|
|
1216
|
+
r.setAttribute("type", a.type), r.setAttribute("version", "1.0");
|
|
1217
|
+
const u = (h, p) => {
|
|
1218
|
+
const l = t.createElement(h);
|
|
1219
|
+
l.appendChild(t.createTextNode(s(o + 1)));
|
|
1220
|
+
const v = t.createCDATASection(JSON.stringify(p));
|
|
1221
|
+
return l.appendChild(v), l.appendChild(t.createTextNode(s(o))), l;
|
|
1222
|
+
};
|
|
1223
|
+
r.appendChild(t.createTextNode(s(o + 1))), r.appendChild(u("data", a.data)), r.appendChild(t.createTextNode(s(o + 1))), r.appendChild(u("metadata", a.metadata)), r.appendChild(t.createTextNode(s(o))), i.appendChild(r);
|
|
1224
|
+
}), i.appendChild(t.createTextNode("\n")), t.appendChild(i), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
function Xe(n) {
|
|
1121
1228
|
return n.x >= 0 && n.x <= 1 && n.y >= 0 && n.y <= 1;
|
|
1122
1229
|
}
|
|
1123
|
-
function
|
|
1124
|
-
const s = n / window.innerWidth, o = e / window.innerHeight,
|
|
1230
|
+
function nn(n, e, t, i) {
|
|
1231
|
+
const s = n / window.innerWidth, o = e / window.innerHeight, a = Math.max(0, Math.min(s, 1 - t)), r = Math.max(0, Math.min(o, 1 - i));
|
|
1125
1232
|
return {
|
|
1126
|
-
x:
|
|
1127
|
-
y:
|
|
1233
|
+
x: a,
|
|
1234
|
+
y: r
|
|
1128
1235
|
};
|
|
1129
1236
|
}
|
|
1130
|
-
var
|
|
1237
|
+
var re, k, Oe, ht, ge = 0, sn = [], xe = [], pt = w.__b, ft = w.__r, vt = w.diffed, mt = w.__c, _t = w.unmount;
|
|
1131
1238
|
function De(n, e) {
|
|
1132
|
-
w.__h && w.__h(k, n,
|
|
1239
|
+
w.__h && w.__h(k, n, ge || e), ge = 0;
|
|
1133
1240
|
var t = k.__H || (k.__H = { __: [], __h: [] });
|
|
1134
1241
|
return n >= t.__.length && t.__.push({ __V: xe }), t.__[n];
|
|
1135
1242
|
}
|
|
1136
|
-
function
|
|
1137
|
-
return
|
|
1243
|
+
function ce(n) {
|
|
1244
|
+
return ge = 1, Hn(rn, n);
|
|
1138
1245
|
}
|
|
1139
1246
|
function Hn(n, e, t) {
|
|
1140
|
-
var i = De(
|
|
1141
|
-
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : rn(void 0, e), function(
|
|
1142
|
-
var u = i.__N ? i.__N[0] : i.__[0],
|
|
1143
|
-
u !==
|
|
1247
|
+
var i = De(re++, 2);
|
|
1248
|
+
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : rn(void 0, e), function(r) {
|
|
1249
|
+
var u = i.__N ? i.__N[0] : i.__[0], h = i.t(u, r);
|
|
1250
|
+
u !== h && (i.__N = [h, i.__[1]], i.__c.setState({}));
|
|
1144
1251
|
}], i.__c = k, !k.u)) {
|
|
1145
|
-
var s = function(
|
|
1252
|
+
var s = function(r, u, h) {
|
|
1146
1253
|
if (!i.__c.__H)
|
|
1147
1254
|
return !0;
|
|
1148
|
-
var
|
|
1149
|
-
return
|
|
1255
|
+
var p = i.__c.__H.__.filter(function(v) {
|
|
1256
|
+
return v.__c;
|
|
1150
1257
|
});
|
|
1151
|
-
if (
|
|
1152
|
-
return !
|
|
1258
|
+
if (p.every(function(v) {
|
|
1259
|
+
return !v.__N;
|
|
1153
1260
|
}))
|
|
1154
|
-
return !o || o.call(this,
|
|
1261
|
+
return !o || o.call(this, r, u, h);
|
|
1155
1262
|
var l = !1;
|
|
1156
|
-
return
|
|
1157
|
-
if (
|
|
1158
|
-
var g =
|
|
1159
|
-
|
|
1263
|
+
return p.forEach(function(v) {
|
|
1264
|
+
if (v.__N) {
|
|
1265
|
+
var g = v.__[0];
|
|
1266
|
+
v.__ = v.__N, v.__N = void 0, g !== v.__[0] && (l = !0);
|
|
1160
1267
|
}
|
|
1161
|
-
}), !(!l && i.__c.props ===
|
|
1268
|
+
}), !(!l && i.__c.props === r) && (!o || o.call(this, r, u, h));
|
|
1162
1269
|
};
|
|
1163
1270
|
k.u = !0;
|
|
1164
|
-
var o = k.shouldComponentUpdate,
|
|
1165
|
-
k.componentWillUpdate = function(
|
|
1271
|
+
var o = k.shouldComponentUpdate, a = k.componentWillUpdate;
|
|
1272
|
+
k.componentWillUpdate = function(r, u, h) {
|
|
1166
1273
|
if (this.__e) {
|
|
1167
|
-
var
|
|
1168
|
-
o = void 0, s(
|
|
1274
|
+
var p = o;
|
|
1275
|
+
o = void 0, s(r, u, h), o = p;
|
|
1169
1276
|
}
|
|
1170
|
-
|
|
1277
|
+
a && a.call(this, r, u, h);
|
|
1171
1278
|
}, k.shouldComponentUpdate = s;
|
|
1172
1279
|
}
|
|
1173
1280
|
return i.__N || i.__;
|
|
1174
1281
|
}
|
|
1175
|
-
function
|
|
1176
|
-
var t = De(
|
|
1177
|
-
!w.__s &&
|
|
1282
|
+
function H(n, e) {
|
|
1283
|
+
var t = De(re++, 3);
|
|
1284
|
+
!w.__s && an(t.__H, e) && (t.__ = n, t.i = e, k.__H.__h.push(t));
|
|
1178
1285
|
}
|
|
1179
|
-
function
|
|
1180
|
-
return
|
|
1286
|
+
function R(n) {
|
|
1287
|
+
return ge = 5, Y(function() {
|
|
1181
1288
|
return { current: n };
|
|
1182
1289
|
}, []);
|
|
1183
1290
|
}
|
|
1184
|
-
function
|
|
1185
|
-
var t = De(
|
|
1186
|
-
return
|
|
1291
|
+
function Y(n, e) {
|
|
1292
|
+
var t = De(re++, 7);
|
|
1293
|
+
return an(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
|
|
1187
1294
|
}
|
|
1188
|
-
function
|
|
1189
|
-
return
|
|
1295
|
+
function Be(n, e) {
|
|
1296
|
+
return ge = 8, Y(function() {
|
|
1190
1297
|
return n;
|
|
1191
1298
|
}, e);
|
|
1192
1299
|
}
|
|
1193
|
-
function
|
|
1194
|
-
var e = k.context[n.__c], t = De(
|
|
1300
|
+
function on(n) {
|
|
1301
|
+
var e = k.context[n.__c], t = De(re++, 9);
|
|
1195
1302
|
return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(k)), e.props.value) : n.__;
|
|
1196
1303
|
}
|
|
1197
|
-
function
|
|
1198
|
-
for (var n; n =
|
|
1304
|
+
function On() {
|
|
1305
|
+
for (var n; n = sn.shift(); )
|
|
1199
1306
|
if (n.__P && n.__H)
|
|
1200
1307
|
try {
|
|
1201
|
-
n.__H.__h.forEach(Se), n.__H.__h.forEach(
|
|
1308
|
+
n.__H.__h.forEach(Se), n.__H.__h.forEach(Ze), n.__H.__h = [];
|
|
1202
1309
|
} catch (e) {
|
|
1203
1310
|
n.__H.__h = [], w.__e(e, n.__v);
|
|
1204
1311
|
}
|
|
1205
1312
|
}
|
|
1206
1313
|
w.__b = function(n) {
|
|
1207
|
-
k = null,
|
|
1314
|
+
k = null, pt && pt(n);
|
|
1208
1315
|
}, w.__r = function(n) {
|
|
1209
|
-
ft && ft(n),
|
|
1316
|
+
ft && ft(n), re = 0;
|
|
1210
1317
|
var e = (k = n.__c).__H;
|
|
1211
|
-
e && (
|
|
1318
|
+
e && (Oe === k ? (e.__h = [], k.__h = [], e.__.forEach(function(t) {
|
|
1212
1319
|
t.__N && (t.__ = t.__N), t.__V = xe, t.__N = t.i = void 0;
|
|
1213
|
-
})) : (e.__h.forEach(Se), e.__h.forEach(
|
|
1320
|
+
})) : (e.__h.forEach(Se), e.__h.forEach(Ze), e.__h = [], re = 0)), Oe = k;
|
|
1214
1321
|
}, w.diffed = function(n) {
|
|
1215
|
-
|
|
1322
|
+
vt && vt(n);
|
|
1216
1323
|
var e = n.__c;
|
|
1217
|
-
e && e.__H && (e.__H.__h.length && (
|
|
1324
|
+
e && e.__H && (e.__H.__h.length && (sn.push(e) !== 1 && ht === w.requestAnimationFrame || ((ht = w.requestAnimationFrame) || Bn)(On)), e.__H.__.forEach(function(t) {
|
|
1218
1325
|
t.i && (t.__H = t.i), t.__V !== xe && (t.__ = t.__V), t.i = void 0, t.__V = xe;
|
|
1219
|
-
})),
|
|
1326
|
+
})), Oe = k = null;
|
|
1220
1327
|
}, w.__c = function(n, e) {
|
|
1221
1328
|
e.some(function(t) {
|
|
1222
1329
|
try {
|
|
1223
1330
|
t.__h.forEach(Se), t.__h = t.__h.filter(function(i) {
|
|
1224
|
-
return !i.__ ||
|
|
1331
|
+
return !i.__ || Ze(i);
|
|
1225
1332
|
});
|
|
1226
1333
|
} catch (i) {
|
|
1227
1334
|
e.some(function(s) {
|
|
1228
1335
|
s.__h && (s.__h = []);
|
|
1229
1336
|
}), e = [], w.__e(i, t.__v);
|
|
1230
1337
|
}
|
|
1231
|
-
}),
|
|
1338
|
+
}), mt && mt(n, e);
|
|
1232
1339
|
}, w.unmount = function(n) {
|
|
1233
1340
|
_t && _t(n);
|
|
1234
1341
|
var e, t = n.__c;
|
|
@@ -1240,22 +1347,22 @@ w.__b = function(n) {
|
|
|
1240
1347
|
}
|
|
1241
1348
|
}), t.__H = void 0, e && w.__e(e, t.__v));
|
|
1242
1349
|
};
|
|
1243
|
-
var
|
|
1244
|
-
function
|
|
1350
|
+
var gt = typeof requestAnimationFrame == "function";
|
|
1351
|
+
function Bn(n) {
|
|
1245
1352
|
var e, t = function() {
|
|
1246
|
-
clearTimeout(i),
|
|
1353
|
+
clearTimeout(i), gt && cancelAnimationFrame(e), setTimeout(n);
|
|
1247
1354
|
}, i = setTimeout(t, 100);
|
|
1248
|
-
|
|
1355
|
+
gt && (e = requestAnimationFrame(t));
|
|
1249
1356
|
}
|
|
1250
1357
|
function Se(n) {
|
|
1251
1358
|
var e = k, t = n.__c;
|
|
1252
1359
|
typeof t == "function" && (n.__c = void 0, t()), k = e;
|
|
1253
1360
|
}
|
|
1254
|
-
function
|
|
1361
|
+
function Ze(n) {
|
|
1255
1362
|
var e = k;
|
|
1256
1363
|
n.__c = n.__(), k = e;
|
|
1257
1364
|
}
|
|
1258
|
-
function
|
|
1365
|
+
function an(n, e) {
|
|
1259
1366
|
return !n || n.length !== e.length || e.some(function(t, i) {
|
|
1260
1367
|
return t !== n[i];
|
|
1261
1368
|
});
|
|
@@ -1266,16 +1373,16 @@ function rn(n, e) {
|
|
|
1266
1373
|
function ze() {
|
|
1267
1374
|
throw new Error("Cycle detected");
|
|
1268
1375
|
}
|
|
1269
|
-
var
|
|
1376
|
+
var Pn = Symbol.for("preact-signals");
|
|
1270
1377
|
function nt() {
|
|
1271
|
-
if (
|
|
1272
|
-
|
|
1378
|
+
if (ae > 1)
|
|
1379
|
+
ae--;
|
|
1273
1380
|
else {
|
|
1274
|
-
for (var n, e = !1;
|
|
1275
|
-
var t =
|
|
1276
|
-
for (
|
|
1381
|
+
for (var n, e = !1; ve !== void 0; ) {
|
|
1382
|
+
var t = ve;
|
|
1383
|
+
for (ve = void 0, Ge++; t !== void 0; ) {
|
|
1277
1384
|
var i = t.o;
|
|
1278
|
-
if (t.o = void 0, t.f &= -3, !(8 & t.f) &&
|
|
1385
|
+
if (t.o = void 0, t.f &= -3, !(8 & t.f) && ln(t))
|
|
1279
1386
|
try {
|
|
1280
1387
|
t.c();
|
|
1281
1388
|
} catch (s) {
|
|
@@ -1284,12 +1391,12 @@ function nt() {
|
|
|
1284
1391
|
t = i;
|
|
1285
1392
|
}
|
|
1286
1393
|
}
|
|
1287
|
-
if (
|
|
1394
|
+
if (Ge = 0, ae--, e)
|
|
1288
1395
|
throw n;
|
|
1289
1396
|
}
|
|
1290
1397
|
}
|
|
1291
|
-
var E = void 0,
|
|
1292
|
-
function
|
|
1398
|
+
var E = void 0, ve = void 0, ae = 0, Ge = 0, Me = 0;
|
|
1399
|
+
function cn(n) {
|
|
1293
1400
|
if (E !== void 0) {
|
|
1294
1401
|
var e = n.n;
|
|
1295
1402
|
if (e === void 0 || e.t !== E)
|
|
@@ -1298,25 +1405,25 @@ function an(n) {
|
|
|
1298
1405
|
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = E.s, e.n = void 0, E.s.n = e, E.s = e), e;
|
|
1299
1406
|
}
|
|
1300
1407
|
}
|
|
1301
|
-
function
|
|
1408
|
+
function A(n) {
|
|
1302
1409
|
this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
|
|
1303
1410
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1411
|
+
A.prototype.brand = Pn;
|
|
1412
|
+
A.prototype.h = function() {
|
|
1306
1413
|
return !0;
|
|
1307
1414
|
};
|
|
1308
|
-
|
|
1415
|
+
A.prototype.S = function(n) {
|
|
1309
1416
|
this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
|
|
1310
1417
|
};
|
|
1311
|
-
|
|
1418
|
+
A.prototype.U = function(n) {
|
|
1312
1419
|
if (this.t !== void 0) {
|
|
1313
1420
|
var e = n.e, t = n.x;
|
|
1314
1421
|
e !== void 0 && (e.x = t, n.e = void 0), t !== void 0 && (t.e = e, n.x = void 0), n === this.t && (this.t = t);
|
|
1315
1422
|
}
|
|
1316
1423
|
};
|
|
1317
|
-
|
|
1424
|
+
A.prototype.subscribe = function(n) {
|
|
1318
1425
|
var e = this;
|
|
1319
|
-
return
|
|
1426
|
+
return st(function() {
|
|
1320
1427
|
var t = e.value, i = 32 & this.f;
|
|
1321
1428
|
this.f &= -33;
|
|
1322
1429
|
try {
|
|
@@ -1326,26 +1433,26 @@ I.prototype.subscribe = function(n) {
|
|
|
1326
1433
|
}
|
|
1327
1434
|
});
|
|
1328
1435
|
};
|
|
1329
|
-
|
|
1436
|
+
A.prototype.valueOf = function() {
|
|
1330
1437
|
return this.value;
|
|
1331
1438
|
};
|
|
1332
|
-
|
|
1439
|
+
A.prototype.toString = function() {
|
|
1333
1440
|
return this.value + "";
|
|
1334
1441
|
};
|
|
1335
|
-
|
|
1442
|
+
A.prototype.toJSON = function() {
|
|
1336
1443
|
return this.value;
|
|
1337
1444
|
};
|
|
1338
|
-
|
|
1445
|
+
A.prototype.peek = function() {
|
|
1339
1446
|
return this.v;
|
|
1340
1447
|
};
|
|
1341
|
-
Object.defineProperty(
|
|
1342
|
-
var n =
|
|
1448
|
+
Object.defineProperty(A.prototype, "value", { get: function() {
|
|
1449
|
+
var n = cn(this);
|
|
1343
1450
|
return n !== void 0 && (n.i = this.i), this.v;
|
|
1344
1451
|
}, set: function(n) {
|
|
1345
|
-
if (E instanceof
|
|
1452
|
+
if (E instanceof J && function() {
|
|
1346
1453
|
throw new Error("Computed cannot have side-effects");
|
|
1347
1454
|
}(), n !== this.v) {
|
|
1348
|
-
|
|
1455
|
+
Ge > 100 && ze(), this.v = n, this.i++, Me++, ae++;
|
|
1349
1456
|
try {
|
|
1350
1457
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
1351
1458
|
e.t.N();
|
|
@@ -1354,16 +1461,16 @@ Object.defineProperty(I.prototype, "value", { get: function() {
|
|
|
1354
1461
|
}
|
|
1355
1462
|
}
|
|
1356
1463
|
} });
|
|
1357
|
-
function
|
|
1358
|
-
return new
|
|
1464
|
+
function G(n) {
|
|
1465
|
+
return new A(n);
|
|
1359
1466
|
}
|
|
1360
|
-
function
|
|
1467
|
+
function ln(n) {
|
|
1361
1468
|
for (var e = n.s; e !== void 0; e = e.n)
|
|
1362
1469
|
if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
|
|
1363
1470
|
return !0;
|
|
1364
1471
|
return !1;
|
|
1365
1472
|
}
|
|
1366
|
-
function
|
|
1473
|
+
function un(n) {
|
|
1367
1474
|
for (var e = n.s; e !== void 0; e = e.n) {
|
|
1368
1475
|
var t = e.S.n;
|
|
1369
1476
|
if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -1372,74 +1479,74 @@ function ln(n) {
|
|
|
1372
1479
|
}
|
|
1373
1480
|
}
|
|
1374
1481
|
}
|
|
1375
|
-
function
|
|
1482
|
+
function dn(n) {
|
|
1376
1483
|
for (var e = n.s, t = void 0; e !== void 0; ) {
|
|
1377
1484
|
var i = e.p;
|
|
1378
1485
|
e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) : t = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = i;
|
|
1379
1486
|
}
|
|
1380
1487
|
n.s = t;
|
|
1381
1488
|
}
|
|
1382
|
-
function
|
|
1383
|
-
|
|
1489
|
+
function J(n) {
|
|
1490
|
+
A.call(this, void 0), this.x = n, this.s = void 0, this.g = Me - 1, this.f = 4;
|
|
1384
1491
|
}
|
|
1385
|
-
(
|
|
1492
|
+
(J.prototype = new A()).h = function() {
|
|
1386
1493
|
if (this.f &= -3, 1 & this.f)
|
|
1387
1494
|
return !1;
|
|
1388
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
1495
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Me))
|
|
1389
1496
|
return !0;
|
|
1390
|
-
if (this.g =
|
|
1497
|
+
if (this.g = Me, this.f |= 1, this.i > 0 && !ln(this))
|
|
1391
1498
|
return this.f &= -2, !0;
|
|
1392
1499
|
var n = E;
|
|
1393
1500
|
try {
|
|
1394
|
-
|
|
1501
|
+
un(this), E = this;
|
|
1395
1502
|
var e = this.x();
|
|
1396
1503
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
1397
1504
|
} catch (t) {
|
|
1398
1505
|
this.v = t, this.f |= 16, this.i++;
|
|
1399
1506
|
}
|
|
1400
|
-
return E = n,
|
|
1507
|
+
return E = n, dn(this), this.f &= -2, !0;
|
|
1401
1508
|
};
|
|
1402
|
-
|
|
1509
|
+
J.prototype.S = function(n) {
|
|
1403
1510
|
if (this.t === void 0) {
|
|
1404
1511
|
this.f |= 36;
|
|
1405
1512
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
1406
1513
|
e.S.S(e);
|
|
1407
1514
|
}
|
|
1408
|
-
|
|
1515
|
+
A.prototype.S.call(this, n);
|
|
1409
1516
|
};
|
|
1410
|
-
|
|
1411
|
-
if (this.t !== void 0 && (
|
|
1517
|
+
J.prototype.U = function(n) {
|
|
1518
|
+
if (this.t !== void 0 && (A.prototype.U.call(this, n), this.t === void 0)) {
|
|
1412
1519
|
this.f &= -33;
|
|
1413
1520
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
1414
1521
|
e.S.U(e);
|
|
1415
1522
|
}
|
|
1416
1523
|
};
|
|
1417
|
-
|
|
1524
|
+
J.prototype.N = function() {
|
|
1418
1525
|
if (!(2 & this.f)) {
|
|
1419
1526
|
this.f |= 6;
|
|
1420
1527
|
for (var n = this.t; n !== void 0; n = n.x)
|
|
1421
1528
|
n.t.N();
|
|
1422
1529
|
}
|
|
1423
1530
|
};
|
|
1424
|
-
|
|
1531
|
+
J.prototype.peek = function() {
|
|
1425
1532
|
if (this.h() || ze(), 16 & this.f)
|
|
1426
1533
|
throw this.v;
|
|
1427
1534
|
return this.v;
|
|
1428
1535
|
};
|
|
1429
|
-
Object.defineProperty(
|
|
1536
|
+
Object.defineProperty(J.prototype, "value", { get: function() {
|
|
1430
1537
|
1 & this.f && ze();
|
|
1431
|
-
var n =
|
|
1538
|
+
var n = cn(this);
|
|
1432
1539
|
if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
|
|
1433
1540
|
throw this.v;
|
|
1434
1541
|
return this.v;
|
|
1435
1542
|
} });
|
|
1436
|
-
function dn(n) {
|
|
1437
|
-
return new G(n);
|
|
1438
|
-
}
|
|
1439
1543
|
function hn(n) {
|
|
1544
|
+
return new J(n);
|
|
1545
|
+
}
|
|
1546
|
+
function pn(n) {
|
|
1440
1547
|
var e = n.u;
|
|
1441
1548
|
if (n.u = void 0, typeof e == "function") {
|
|
1442
|
-
|
|
1549
|
+
ae++;
|
|
1443
1550
|
var t = E;
|
|
1444
1551
|
E = void 0;
|
|
1445
1552
|
try {
|
|
@@ -1454,17 +1561,17 @@ function hn(n) {
|
|
|
1454
1561
|
function it(n) {
|
|
1455
1562
|
for (var e = n.s; e !== void 0; e = e.n)
|
|
1456
1563
|
e.S.U(e);
|
|
1457
|
-
n.x = void 0, n.s = void 0,
|
|
1564
|
+
n.x = void 0, n.s = void 0, pn(n);
|
|
1458
1565
|
}
|
|
1459
|
-
function
|
|
1566
|
+
function Rn(n) {
|
|
1460
1567
|
if (E !== this)
|
|
1461
1568
|
throw new Error("Out-of-order effect");
|
|
1462
|
-
|
|
1569
|
+
dn(this), E = n, this.f &= -2, 8 & this.f && it(this), nt();
|
|
1463
1570
|
}
|
|
1464
|
-
function
|
|
1571
|
+
function we(n) {
|
|
1465
1572
|
this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
1466
1573
|
}
|
|
1467
|
-
|
|
1574
|
+
we.prototype.c = function() {
|
|
1468
1575
|
var n = this.S();
|
|
1469
1576
|
try {
|
|
1470
1577
|
if (8 & this.f || this.x === void 0)
|
|
@@ -1475,19 +1582,19 @@ ge.prototype.c = function() {
|
|
|
1475
1582
|
n();
|
|
1476
1583
|
}
|
|
1477
1584
|
};
|
|
1478
|
-
|
|
1479
|
-
1 & this.f && ze(), this.f |= 1, this.f &= -9,
|
|
1585
|
+
we.prototype.S = function() {
|
|
1586
|
+
1 & this.f && ze(), this.f |= 1, this.f &= -9, pn(this), un(this), ae++;
|
|
1480
1587
|
var n = E;
|
|
1481
|
-
return E = this,
|
|
1588
|
+
return E = this, Rn.bind(this, n);
|
|
1482
1589
|
};
|
|
1483
|
-
|
|
1484
|
-
2 & this.f || (this.f |= 2, this.o =
|
|
1590
|
+
we.prototype.N = function() {
|
|
1591
|
+
2 & this.f || (this.f |= 2, this.o = ve, ve = this);
|
|
1485
1592
|
};
|
|
1486
|
-
|
|
1593
|
+
we.prototype.d = function() {
|
|
1487
1594
|
this.f |= 8, 1 & this.f || it(this);
|
|
1488
1595
|
};
|
|
1489
|
-
function
|
|
1490
|
-
var e = new
|
|
1596
|
+
function st(n) {
|
|
1597
|
+
var e = new we(n);
|
|
1491
1598
|
try {
|
|
1492
1599
|
e.c();
|
|
1493
1600
|
} catch (t) {
|
|
@@ -1495,95 +1602,95 @@ function He(n) {
|
|
|
1495
1602
|
}
|
|
1496
1603
|
return e.d.bind(e);
|
|
1497
1604
|
}
|
|
1498
|
-
var Le,
|
|
1499
|
-
function
|
|
1605
|
+
var Le, Pe;
|
|
1606
|
+
function le(n, e) {
|
|
1500
1607
|
w[n] = e.bind(null, w[n] || function() {
|
|
1501
1608
|
});
|
|
1502
1609
|
}
|
|
1503
|
-
function
|
|
1504
|
-
|
|
1610
|
+
function $e(n) {
|
|
1611
|
+
Pe && Pe(), Pe = n && n.S();
|
|
1505
1612
|
}
|
|
1506
1613
|
function fn(n) {
|
|
1507
|
-
var e = this, t = n.data, i =
|
|
1614
|
+
var e = this, t = n.data, i = z(t);
|
|
1508
1615
|
i.value = t;
|
|
1509
|
-
var s =
|
|
1616
|
+
var s = Y(function() {
|
|
1510
1617
|
for (var o = e.__v; o = o.__; )
|
|
1511
1618
|
if (o.__c) {
|
|
1512
1619
|
o.__c.__$f |= 4;
|
|
1513
1620
|
break;
|
|
1514
1621
|
}
|
|
1515
1622
|
return e.__$u.c = function() {
|
|
1516
|
-
var
|
|
1517
|
-
!
|
|
1518
|
-
},
|
|
1519
|
-
var
|
|
1520
|
-
return
|
|
1623
|
+
var a;
|
|
1624
|
+
!Vt(s.peek()) && ((a = e.base) == null ? void 0 : a.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
|
|
1625
|
+
}, hn(function() {
|
|
1626
|
+
var a = i.value.value;
|
|
1627
|
+
return a === 0 ? 0 : a === !0 ? "" : a || "";
|
|
1521
1628
|
});
|
|
1522
1629
|
}, []);
|
|
1523
1630
|
return s.value;
|
|
1524
1631
|
}
|
|
1525
1632
|
fn.displayName = "_st";
|
|
1526
|
-
Object.defineProperties(
|
|
1633
|
+
Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: fn }, props: { configurable: !0, get: function() {
|
|
1527
1634
|
return { data: this };
|
|
1528
1635
|
} }, __b: { configurable: !0, value: 1 } });
|
|
1529
|
-
|
|
1636
|
+
le("__b", function(n, e) {
|
|
1530
1637
|
if (typeof e.type == "string") {
|
|
1531
1638
|
var t, i = e.props;
|
|
1532
1639
|
for (var s in i)
|
|
1533
1640
|
if (s !== "children") {
|
|
1534
1641
|
var o = i[s];
|
|
1535
|
-
o instanceof
|
|
1642
|
+
o instanceof A && (t || (e.__np = t = {}), t[s] = o, i[s] = o.peek());
|
|
1536
1643
|
}
|
|
1537
1644
|
}
|
|
1538
1645
|
n(e);
|
|
1539
1646
|
});
|
|
1540
|
-
|
|
1541
|
-
|
|
1647
|
+
le("__r", function(n, e) {
|
|
1648
|
+
$e();
|
|
1542
1649
|
var t, i = e.__c;
|
|
1543
1650
|
i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
|
|
1544
1651
|
var o;
|
|
1545
|
-
return
|
|
1652
|
+
return st(function() {
|
|
1546
1653
|
o = this;
|
|
1547
1654
|
}), o.c = function() {
|
|
1548
1655
|
i.__$f |= 1, i.setState({});
|
|
1549
1656
|
}, o;
|
|
1550
|
-
}())), Le = i,
|
|
1657
|
+
}())), Le = i, $e(t), n(e);
|
|
1551
1658
|
});
|
|
1552
|
-
|
|
1553
|
-
|
|
1659
|
+
le("__e", function(n, e, t, i) {
|
|
1660
|
+
$e(), Le = void 0, n(e, t, i);
|
|
1554
1661
|
});
|
|
1555
|
-
|
|
1556
|
-
|
|
1662
|
+
le("diffed", function(n, e) {
|
|
1663
|
+
$e(), Le = void 0;
|
|
1557
1664
|
var t;
|
|
1558
1665
|
if (typeof e.type == "string" && (t = e.__e)) {
|
|
1559
1666
|
var i = e.__np, s = e.props;
|
|
1560
1667
|
if (i) {
|
|
1561
1668
|
var o = t.U;
|
|
1562
1669
|
if (o)
|
|
1563
|
-
for (var
|
|
1564
|
-
var
|
|
1565
|
-
|
|
1670
|
+
for (var a in o) {
|
|
1671
|
+
var r = o[a];
|
|
1672
|
+
r !== void 0 && !(a in i) && (r.d(), o[a] = void 0);
|
|
1566
1673
|
}
|
|
1567
1674
|
else
|
|
1568
1675
|
t.U = o = {};
|
|
1569
1676
|
for (var u in i) {
|
|
1570
|
-
var
|
|
1571
|
-
|
|
1677
|
+
var h = o[u], p = i[u];
|
|
1678
|
+
h === void 0 ? (h = Fn(t, u, p, s), o[u] = h) : h.o(p, s);
|
|
1572
1679
|
}
|
|
1573
1680
|
}
|
|
1574
1681
|
}
|
|
1575
1682
|
n(e);
|
|
1576
1683
|
});
|
|
1577
|
-
function
|
|
1578
|
-
var s = e in n && n.ownerSVGElement === void 0, o =
|
|
1579
|
-
return { o: function(
|
|
1580
|
-
o.value =
|
|
1581
|
-
}, d:
|
|
1582
|
-
var
|
|
1583
|
-
i[e] !==
|
|
1684
|
+
function Fn(n, e, t, i) {
|
|
1685
|
+
var s = e in n && n.ownerSVGElement === void 0, o = G(t);
|
|
1686
|
+
return { o: function(a, r) {
|
|
1687
|
+
o.value = a, i = r;
|
|
1688
|
+
}, d: st(function() {
|
|
1689
|
+
var a = o.value.value;
|
|
1690
|
+
i[e] !== a && (i[e] = a, s ? n[e] = a : a ? n.setAttribute(e, a) : n.removeAttribute(e));
|
|
1584
1691
|
}) };
|
|
1585
1692
|
}
|
|
1586
|
-
|
|
1693
|
+
le("unmount", function(n, e) {
|
|
1587
1694
|
if (typeof e.type == "string") {
|
|
1588
1695
|
var t = e.__e;
|
|
1589
1696
|
if (t) {
|
|
@@ -1597,18 +1704,18 @@ ce("unmount", function(n, e) {
|
|
|
1597
1704
|
}
|
|
1598
1705
|
}
|
|
1599
1706
|
} else {
|
|
1600
|
-
var
|
|
1601
|
-
if (
|
|
1602
|
-
var
|
|
1603
|
-
|
|
1707
|
+
var a = e.__c;
|
|
1708
|
+
if (a) {
|
|
1709
|
+
var r = a.__$u;
|
|
1710
|
+
r && (a.__$u = void 0, r.d());
|
|
1604
1711
|
}
|
|
1605
1712
|
}
|
|
1606
1713
|
n(e);
|
|
1607
1714
|
});
|
|
1608
|
-
|
|
1715
|
+
le("__h", function(n, e, t, i) {
|
|
1609
1716
|
(i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
|
|
1610
1717
|
});
|
|
1611
|
-
|
|
1718
|
+
P.prototype.shouldComponentUpdate = function(n, e) {
|
|
1612
1719
|
var t = this.__$u;
|
|
1613
1720
|
if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
|
|
1614
1721
|
return !0;
|
|
@@ -1622,37 +1729,29 @@ L.prototype.shouldComponentUpdate = function(n, e) {
|
|
|
1622
1729
|
return !0;
|
|
1623
1730
|
return !1;
|
|
1624
1731
|
};
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1627
|
-
return
|
|
1732
|
+
function z(n) {
|
|
1733
|
+
return Y(function() {
|
|
1734
|
+
return G(n);
|
|
1628
1735
|
}, []);
|
|
1629
1736
|
}
|
|
1630
|
-
function
|
|
1631
|
-
var e =
|
|
1632
|
-
return e.current = n, Le.__$f |= 4,
|
|
1633
|
-
return
|
|
1634
|
-
return e.current();
|
|
1635
|
-
});
|
|
1636
|
-
}, []);
|
|
1637
|
-
}
|
|
1638
|
-
function Fn(n) {
|
|
1639
|
-
var e = B(n);
|
|
1640
|
-
e.current = n, O(function() {
|
|
1641
|
-
return He(function() {
|
|
1737
|
+
function L(n) {
|
|
1738
|
+
var e = R(n);
|
|
1739
|
+
return e.current = n, Le.__$f |= 4, Y(function() {
|
|
1740
|
+
return hn(function() {
|
|
1642
1741
|
return e.current();
|
|
1643
1742
|
});
|
|
1644
1743
|
}, []);
|
|
1645
1744
|
}
|
|
1646
1745
|
var Un = 0;
|
|
1647
1746
|
function c(n, e, t, i, s, o) {
|
|
1648
|
-
var
|
|
1649
|
-
for (
|
|
1650
|
-
|
|
1651
|
-
var
|
|
1652
|
-
if (typeof n == "function" && (
|
|
1653
|
-
for (
|
|
1654
|
-
u[
|
|
1655
|
-
return w.vnode && w.vnode(
|
|
1747
|
+
var a, r, u = {};
|
|
1748
|
+
for (r in e)
|
|
1749
|
+
r == "ref" ? a = e[r] : u[r] = e[r];
|
|
1750
|
+
var h = { type: n, props: u, key: t, ref: a, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Un, __source: s, __self: o };
|
|
1751
|
+
if (typeof n == "function" && (a = n.defaultProps))
|
|
1752
|
+
for (r in a)
|
|
1753
|
+
u[r] === void 0 && (u[r] = a[r]);
|
|
1754
|
+
return w.vnode && w.vnode(h), h;
|
|
1656
1755
|
}
|
|
1657
1756
|
const Wn = () => c("svg", {
|
|
1658
1757
|
viewBox: "0 0 1024 1024",
|
|
@@ -1669,7 +1768,7 @@ const Wn = () => c("svg", {
|
|
|
1669
1768
|
children: c("path", {
|
|
1670
1769
|
d: "M900.64 379.808l-263.072-256.032c-36.448-35.328-105.76-35.392-142.304 0.096l-327.04 319.904c-56.416 54.72-70.72 76.704-70.72 150.976l0 143.936c0 132.768 26.976 192 186.912 192l131.872 0c81.12 0 128.448-46.656 193.952-111.264l290.016-297.696c18.592-17.984 29.248-43.968 29.248-71.264C929.504 423.36 918.976 397.6 900.64 379.808zM323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752z"
|
|
1671
1770
|
})
|
|
1672
|
-
}),
|
|
1771
|
+
}), qn = (n) => c("svg", {
|
|
1673
1772
|
viewBox: "0 0 1024 1024",
|
|
1674
1773
|
id: "send",
|
|
1675
1774
|
className: n.className,
|
|
@@ -1678,14 +1777,14 @@ const Wn = () => c("svg", {
|
|
|
1678
1777
|
children: c("path", {
|
|
1679
1778
|
d: "M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-0.9 3.7-0.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 0.7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-0.8 4.2-2.6 5-5 1.4-4.2-0.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"
|
|
1680
1779
|
})
|
|
1681
|
-
}),
|
|
1780
|
+
}), jn = () => c("svg", {
|
|
1682
1781
|
viewBox: "0 0 1024 1024",
|
|
1683
1782
|
version: "1.1",
|
|
1684
1783
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1685
1784
|
children: c("path", {
|
|
1686
1785
|
d: "M962 197.61H747v-60c0-55.14-44.86-100-100-100H377c-55.14 0-100 44.86-100 100v60H62c-11.05 0-20 8.95-20 20s8.95 20 20 20h60v630.57c0 66.17 53.83 120 120 120h540c66.17 0 120-53.83 120-120V237.61h60c11.05 0 20-8.95 20-20s-8.95-20-20-20zM637.34 457.66v260c0 12.01-10.72 21.63-23.06 19.77-9.84-1.48-16.94-10.25-16.94-20.2V458.09c0-9.95 7.1-18.72 16.94-20.2 12.34-1.86 23.06 7.76 23.06 19.77z m-210.68 0v260c0 11-9 20-20 20s-20-9-20-20v-260c0-11 9-20 20-20s20 9 20 20zM317 137.61c0-33.08 26.92-60 60-60h270c33.08 0 60 26.92 60 60v60H317v-60z"
|
|
1687
1786
|
})
|
|
1688
|
-
}),
|
|
1787
|
+
}), wt = () => c("svg", {
|
|
1689
1788
|
viewBox: "0 0 1024 1024",
|
|
1690
1789
|
version: "1.1",
|
|
1691
1790
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1768,15 +1867,15 @@ const Wn = () => c("svg", {
|
|
|
1768
1867
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1769
1868
|
children: Array.from({
|
|
1770
1869
|
length: 4
|
|
1771
|
-
}).map((
|
|
1772
|
-
const
|
|
1870
|
+
}).map((r, u) => {
|
|
1871
|
+
const p = u * (146.66666666666666 + 140), l = 1e3 / 2 - 250 / 2, v = 1e3 / 2 - 500 / 2;
|
|
1773
1872
|
return c("rect", {
|
|
1774
1873
|
fill: "currentColor",
|
|
1775
1874
|
rx: 70,
|
|
1776
1875
|
ry: 70,
|
|
1777
1876
|
height: 250,
|
|
1778
1877
|
width: 140,
|
|
1779
|
-
x:
|
|
1878
|
+
x: p,
|
|
1780
1879
|
y: l,
|
|
1781
1880
|
children: [c("animate", {
|
|
1782
1881
|
attributeName: "height",
|
|
@@ -1787,7 +1886,7 @@ const Wn = () => c("svg", {
|
|
|
1787
1886
|
repeatCount: "indefinite"
|
|
1788
1887
|
}), c("animate", {
|
|
1789
1888
|
attributeName: "y",
|
|
1790
|
-
values: "".concat(l, "; ").concat(
|
|
1889
|
+
values: "".concat(l, "; ").concat(v, "; ").concat(l),
|
|
1791
1890
|
keyTimes: "0; 0.5; 1",
|
|
1792
1891
|
dur: "".concat(0.8, "s"),
|
|
1793
1892
|
begin: "".concat(0.8 / 4 * u, "s"),
|
|
@@ -1812,7 +1911,15 @@ const Wn = () => c("svg", {
|
|
|
1812
1911
|
children: c("path", {
|
|
1813
1912
|
d: "M498.33984 607.8464c-10.99776-32.9728-50.09408-73.5232-82.6368-85.74976L150.9376 422.8096c-38.54336-14.4384-36.98688-69.46816 2.27328-81.73568L844.92288 124.90752c33.30048-10.40384 64.57344 20.8896 54.1696 54.1696L682.92608 870.78912a43.2128 43.2128 0 0 1-81.36704 3.25632 121682.5344 121682.5344 0 0 1-103.2192-266.19904z"
|
|
1814
1913
|
})
|
|
1815
|
-
}), ii = (
|
|
1914
|
+
}), ii = () => c("svg", {
|
|
1915
|
+
className: "icon",
|
|
1916
|
+
viewBox: "0 0 1024 1024",
|
|
1917
|
+
version: "1.1",
|
|
1918
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1919
|
+
children: c("path", {
|
|
1920
|
+
d: "M972.657609 209.348408C987.158609 209.36839 998.930114 197.571202 998.949999 182.99865 998.969882 168.426097 987.230618 156.59651 972.729617 156.576528L32.457975 155.280806C17.956974 155.260823 6.18547 167.058012 6.165585 181.630564 6.1457 196.203116 17.884965 208.032703 32.385966 208.052686L972.657609 209.348408ZM180.466902 992.356169 180.466902 1019.014859 206.993296 1018.74074 833.361858 1012.267947 859.348284 1011.999407 859.348284 985.883377 859.348284 289.397297C859.348284 274.824732 847.59289 263.011332 833.091874 263.011332 818.590859 263.011332 806.835465 274.824732 806.835465 289.397297L806.835465 985.883377 832.82189 959.498805 206.453329 965.971599 232.979723 992.356169 232.979723 282.67005C232.979723 268.097483 221.224329 256.284085 206.723313 256.284085 192.222298 256.284085 180.466902 268.097483 180.466902 282.67005L180.466902 992.356169ZM656.410257 847.079027C656.410257 861.651593 668.165651 873.464992 682.666667 873.464992 697.167682 873.464992 708.923076 861.651593 708.923076 847.079027L708.923076 372.131659C708.923076 357.559091 697.167682 345.745694 682.666667 345.745694 668.165651 345.745694 656.410257 357.559091 656.410257 372.131659L656.410257 847.079027ZM341.333333 847.079027C341.333333 861.651593 353.08873 873.464992 367.589743 873.464992 382.090758 873.464992 393.846155 861.651593 393.846155 847.079027L393.846155 372.131659C393.846155 357.559091 382.090758 345.745694 367.589743 345.745694 353.08873 345.745694 341.333333 357.559091 341.333333 372.131659L341.333333 847.079027ZM498.871795 847.079027C498.871795 861.651593 510.627189 873.464992 525.128205 873.464992 539.62922 873.464992 551.384614 861.651593 551.384614 847.079027L551.384614 372.131659C551.384614 357.559091 539.62922 345.745694 525.128205 345.745694 510.627189 345.745694 498.871795 357.559091 498.871795 372.131659L498.871795 847.079027ZM392.147755 116.721777C392.147755 102.063669 403.758665 90.363507 418.40134 90.363507L622.925796 90.363507C637.408947 90.363507 649.179381 102.1619 649.179381 116.549585L649.179381 171.644875 701.692203 171.644875 701.692203 116.549585C701.692203 72.986607 666.38105 37.591577 622.925796 37.591577L418.40134 37.591577C374.724427 37.591577 339.634933 72.950804 339.634933 116.721777L339.634933 165.310801 392.147755 165.310801 392.147755 116.721777Z"
|
|
1921
|
+
})
|
|
1922
|
+
}), si = (n) => c("svg", {
|
|
1816
1923
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1817
1924
|
className: n.className,
|
|
1818
1925
|
viewBox: "0 0 512 512",
|
|
@@ -1824,14 +1931,14 @@ const Wn = () => c("svg", {
|
|
|
1824
1931
|
strokeWidth: "48",
|
|
1825
1932
|
d: "M112 184l144 144 144-144"
|
|
1826
1933
|
})
|
|
1827
|
-
}),
|
|
1934
|
+
}), Re = (n) => c("svg", {
|
|
1828
1935
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1829
1936
|
className: "".concat(n.className, " icon"),
|
|
1830
1937
|
viewBox: "0 0 512 512",
|
|
1831
1938
|
children: c("path", {
|
|
1832
1939
|
d: "M256 48C141.31 48 48 141.31 48 256s93.31 208 208 208 208-93.31 208-208S370.69 48 256 48zm108.25 138.29l-134.4 160a16 16 0 01-12 5.71h-.27a16 16 0 01-11.89-5.3l-57.6-64a16 16 0 1123.78-21.4l45.29 50.32 122.59-145.91a16 16 0 0124.5 20.58z"
|
|
1833
1940
|
})
|
|
1834
|
-
}),
|
|
1941
|
+
}), Fe = (n) => c("svg", {
|
|
1835
1942
|
className: n.className,
|
|
1836
1943
|
width: "16",
|
|
1837
1944
|
height: "16",
|
|
@@ -1855,7 +1962,7 @@ const Wn = () => c("svg", {
|
|
|
1855
1962
|
repeatCount: "indefinite"
|
|
1856
1963
|
})
|
|
1857
1964
|
})
|
|
1858
|
-
}),
|
|
1965
|
+
}), oi = () => c("svg", {
|
|
1859
1966
|
className: "icon",
|
|
1860
1967
|
viewBox: "0 0 1024 1024",
|
|
1861
1968
|
version: "1.1",
|
|
@@ -1865,7 +1972,7 @@ const Wn = () => c("svg", {
|
|
|
1865
1972
|
children: c("path", {
|
|
1866
1973
|
d: "M704 256v490.666667a170.666667 170.666667 0 0 1-170.666667 170.666666 170.666667 170.666667 0 0 1-170.666666-170.666666V213.333333A106.666667 106.666667 0 0 1 469.333333 106.666667 106.666667 106.666667 0 0 1 576 213.333333v448a42.666667 42.666667 0 0 1-42.666667 42.666667 42.666667 42.666667 0 0 1-42.666666-42.666667V256H426.666667v405.333333a106.666667 106.666667 0 0 0 106.666666 106.666667 106.666667 106.666667 0 0 0 106.666667-106.666667V213.333333a170.666667 170.666667 0 0 0-170.666667-170.666666 170.666667 170.666667 0 0 0-170.666666 170.666666v533.333334a234.666667 234.666667 0 0 0 234.666666 234.666666 234.666667 234.666667 0 0 0 234.666667-234.666666V256h-64z"
|
|
1867
1974
|
})
|
|
1868
|
-
}),
|
|
1975
|
+
}), vn = () => c("svg", {
|
|
1869
1976
|
className: "icon",
|
|
1870
1977
|
viewBox: "0 0 1024 1024",
|
|
1871
1978
|
version: "1.1",
|
|
@@ -1879,7 +1986,7 @@ const Wn = () => c("svg", {
|
|
|
1879
1986
|
d: "M640 693.333333H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM640 522.666667H341.333333c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h298.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32zM341.333333 416h85.333334c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32h-85.333334c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32z",
|
|
1880
1987
|
fill: "currentColor"
|
|
1881
1988
|
})]
|
|
1882
|
-
}),
|
|
1989
|
+
}), ai = () => c("svg", {
|
|
1883
1990
|
className: "icon",
|
|
1884
1991
|
viewBox: "0 0 1024 1024",
|
|
1885
1992
|
version: "1.1",
|
|
@@ -1900,7 +2007,7 @@ const Wn = () => c("svg", {
|
|
|
1900
2007
|
children: c("path", {
|
|
1901
2008
|
d: "M512.43945313 904.51953125c-6.06445313 0-12.12890625-1.58203125-17.57812501-4.74609375L136.70703125 689.71484375c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867188-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l76.37695313-44.91210938L136.97070312 540.125c-10.63476563-6.24023438-17.13867188-17.66601563-17.13867187-29.97070313s6.50390625-23.73046875 17.13867188-29.97070312l73.38867187-43.15429688-73.125-42.890625C126.51171875 387.81054687 120.0078125 376.38476562 120.0078125 364.08007812c0-12.3046875 6.50390625-23.73046875 17.13867188-29.97070312L495.828125 122.99609375c10.8984375-6.41601563 24.34570313-6.41601563 35.24414063 0l358.15429687 210.05859375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-73.38867188 43.15429688 73.12500001 42.890625c10.63476563 6.24023438 17.13867188 17.66601563 17.13867187 29.97070312s-6.50390625 23.73046875-17.13867187 29.97070313L812.5859375 583.89453125l76.11328125 44.6484375c10.63476563 6.24023438 17.13867188 17.66601563 17.13867188 29.97070313s-6.50390625 23.73046875-17.13867188 29.97070312l-358.59375 211.2890625c-5.44921875 3.1640625-11.6015625 4.74609375-17.66601563 4.74609375zM223.015625 659.65625l289.42382813 169.8046875 290.12695312-170.77148438-58.44726563-34.27734374L530.28125 750.18359375a34.67285156 34.67285156 0 0 1-35.24414063 0L281.7265625 625.02734375 223.015625 659.65625z m76.90429688-104.58984375l212.69531249 124.8046875 290.12695313-170.77148438-55.546875-32.60742187-216.65039063 127.6171875a34.67285156 34.67285156 0 0 1-35.24414062 0L279.00195312 477.28320312l-55.81054687 32.78320313 75.49804688 44.296875c0.43945313 0.26367188 0.79101563 0.52734375 1.23046874 0.703125z m-2.81250001-147.83203125l215.68359376 126.5625 216.12304687-127.17773438c0.3515625-0.26367188 0.703125-0.43945313 1.0546875-0.61523437l72.86132813-42.890625-289.33593751-169.8046875-290.12695312 170.68359375 72.59765625 42.62695313c0.43945313 0.17578125 0.79101563 0.43945313 1.14257813 0.61523437z"
|
|
1902
2009
|
})
|
|
1903
|
-
}),
|
|
2010
|
+
}), ci = (n) => c("svg", {
|
|
1904
2011
|
className: n.className,
|
|
1905
2012
|
id: "stop",
|
|
1906
2013
|
viewBox: "0 0 1025 1024",
|
|
@@ -1915,7 +2022,7 @@ const Wn = () => c("svg", {
|
|
|
1915
2022
|
d: "M655.434047 694.244421 367.12637 694.244421c-21.046987 0-38.170445-17.123458-38.170445-38.170445L328.955925 367.766298c0-21.046987 17.123458-38.170445 38.170445-38.170445l288.307678 0c21.048011 0 38.170445 17.123458 38.170445 38.170445l0 288.307678C693.604492 677.120962 676.482058 694.244421 655.434047 694.244421zM380.150191 643.050154l262.260035 0L642.410226 380.79012 380.150191 380.79012 380.150191 643.050154z",
|
|
1916
2023
|
fill: "currentColor"
|
|
1917
2024
|
})]
|
|
1918
|
-
}),
|
|
2025
|
+
}), li = (n) => c("svg", {
|
|
1919
2026
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1920
2027
|
className: n.className,
|
|
1921
2028
|
viewBox: "0 0 512 512",
|
|
@@ -1927,126 +2034,209 @@ const Wn = () => c("svg", {
|
|
|
1927
2034
|
strokeWidth: "48",
|
|
1928
2035
|
d: "M112 268l144 144 144-144M256 392V100"
|
|
1929
2036
|
})
|
|
2037
|
+
}), ui = () => c("svg", {
|
|
2038
|
+
viewBox: "0 0 1024 1024",
|
|
2039
|
+
version: "1.1",
|
|
2040
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2041
|
+
width: "18",
|
|
2042
|
+
height: "18",
|
|
2043
|
+
children: [c("path", {
|
|
2044
|
+
d: "M394.688 126.208a32 32 0 0 1 32-32h170.688a32 32 0 0 1 32 32v138.624h288a32 32 0 0 1 32 32v170.688a32 32 0 0 1-32 32H106.688a32 32 0 0 1-32-32V296.832a32 32 0 0 1 32-32h288V126.208z m64 32v138.624a32 32 0 0 1-32 32h-288v106.688h746.688V328.832h-288a32 32 0 0 1-32-32V158.208H458.688z"
|
|
2045
|
+
}), c("path", {
|
|
2046
|
+
d: "M138.688 469.376a32 32 0 0 1 32-32h682.688a32 32 0 0 1 32 32v384a32 32 0 0 1-32 32H170.688a32 32 0 0 1-32-32v-384z m64 32v320h618.688v-320H202.688z"
|
|
2047
|
+
}), c("path", {
|
|
2048
|
+
d: "M341.376 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32zM512 691.2a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0v-128a32 32 0 0 1 32-32zM682.688 691.52a32 32 0 0 1 32 32V851.2a32 32 0 1 1-64 0v-127.68a32 32 0 0 1 32-32z"
|
|
2049
|
+
})]
|
|
2050
|
+
}), di = () => c("svg", {
|
|
2051
|
+
viewBox: "0 0 1024 1024",
|
|
2052
|
+
version: "1.1",
|
|
2053
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2054
|
+
width: "18",
|
|
2055
|
+
height: "18",
|
|
2056
|
+
children: c("path", {
|
|
2057
|
+
d: "M843.251 424.407l43.828-74.898c10.194-17.946 32.596-22.158 48.956-11.598 16.298 10.499 23.44 32.658 14.223 49.566l-113.11 195.212-61.164-40.044-126.418-82.285c-16.115-11.598-20.632-34.428-10.194-51.702 9.705-17.397 31.009-23.501 47.857-13.734l89.67 59.028C748.576 295.547 615.81 180.667 461.008 180.667c-177.387 0-320.042 148.758-320.042 331.335 0 183.613 143.692 331.334 319.981 331.334 107.861 0.184 208.58-56.158 268.034-149.858 1.099-1.038 1.099-2.075 2.075-2.075 6.348-9.949 17.092-15.871 28.568-15.81 19.35 0 35.648 16.848 35.648 36.93 0 7.508-2.137 14.833-6.104 21.059-72.823 114.698-196.066 183.675-328.099 183.614-216.088 0-391.4-181.478-391.4-405.195 0-223.718 175.312-405.195 391.339-405.195 183.125-0.427 342.016 131.606 382.243 317.601z"
|
|
2058
|
+
})
|
|
2059
|
+
}), hi = () => c("svg", {
|
|
2060
|
+
version: "1.1",
|
|
2061
|
+
className: "icon",
|
|
2062
|
+
viewBox: "0 0 1024 1024",
|
|
2063
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2064
|
+
children: c("path", {
|
|
2065
|
+
d: "M627.498667 55.168l170.666666 170.666667a42.624 42.624 0 0 1 0 60.330666l-469.333333 469.333334A42.538667 42.538667 0 0 1 298.666667 768H128a42.666667 42.666667 0 0 1-42.666667-42.666667v-170.666666c0-11.306667 4.48-22.186667 12.501334-30.165334l469.333333-469.333333a42.624 42.624 0 0 1 60.330667 0zM896 896a42.666667 42.666667 0 0 1 0 85.333333H128a42.666667 42.666667 0 0 1 0-85.333333h768zM597.333333 145.664l-426.666666 426.666667V682.666667h110.336l426.666666-426.666667L597.333333 145.664z"
|
|
2066
|
+
})
|
|
2067
|
+
}), pi = (n) => c("svg", {
|
|
2068
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2069
|
+
className: n.className,
|
|
2070
|
+
viewBox: "0 0 512 512",
|
|
2071
|
+
children: c("path", {
|
|
2072
|
+
fill: "none",
|
|
2073
|
+
stroke: "currentColor",
|
|
2074
|
+
strokeLinecap: "round",
|
|
2075
|
+
strokeLinejoin: "round",
|
|
2076
|
+
strokeWidth: "48",
|
|
2077
|
+
d: "M184 112l144 144-144 144"
|
|
2078
|
+
})
|
|
1930
2079
|
});
|
|
1931
|
-
const
|
|
2080
|
+
const fi = (n) => {
|
|
1932
2081
|
const {
|
|
1933
2082
|
items: e
|
|
1934
|
-
} = n, t =
|
|
1935
|
-
|
|
1936
|
-
s.value = e.filter((
|
|
1937
|
-
|
|
2083
|
+
} = n, t = z([]), i = new M("chat-thought-chain"), s = z([]);
|
|
2084
|
+
H(() => {
|
|
2085
|
+
s.value = e.filter((a) => a.description), s.value.length > 0 && s.value.forEach((a, r) => {
|
|
2086
|
+
a.done && (t.value = [...t.value, r]);
|
|
1938
2087
|
});
|
|
1939
2088
|
}, [e]);
|
|
1940
|
-
const o = (
|
|
1941
|
-
t.value.includes(
|
|
2089
|
+
const o = (a) => {
|
|
2090
|
+
t.value.includes(a) ? t.value = t.value.filter((r) => r !== a) : t.value = [...t.value, a];
|
|
1942
2091
|
};
|
|
1943
2092
|
return s.value.length === 0 ? null : c("div", {
|
|
1944
2093
|
className: "".concat(i.b(), " ").concat(i.is("single", s.value.length === 1)),
|
|
1945
|
-
children: s.value.map((
|
|
1946
|
-
if (!
|
|
2094
|
+
children: s.value.map((a, r) => {
|
|
2095
|
+
if (!a.description)
|
|
1947
2096
|
return;
|
|
1948
|
-
const u = t.value.includes(
|
|
2097
|
+
const u = t.value.includes(r);
|
|
1949
2098
|
return c("div", {
|
|
1950
2099
|
className: "".concat(i.e("item"), " ").concat(i.is("collapsed", u)),
|
|
1951
2100
|
children: [c("div", {
|
|
1952
2101
|
className: i.e("item-icon"),
|
|
1953
|
-
children:
|
|
1954
|
-
children:
|
|
2102
|
+
children: a.icon || c("span", {
|
|
2103
|
+
children: r
|
|
1955
2104
|
})
|
|
1956
2105
|
}), c("div", {
|
|
1957
2106
|
className: i.e("item-content"),
|
|
1958
2107
|
children: [c("div", {
|
|
1959
2108
|
className: i.e("item-title"),
|
|
1960
|
-
onClick: () => o(
|
|
1961
|
-
children: [
|
|
2109
|
+
onClick: () => o(r),
|
|
2110
|
+
children: [a.title, c(si, {
|
|
1962
2111
|
className: i.e("icon")
|
|
1963
2112
|
})]
|
|
1964
2113
|
}), c("div", {
|
|
1965
2114
|
className: i.e("item-description"),
|
|
1966
|
-
children:
|
|
2115
|
+
children: a.description
|
|
1967
2116
|
})]
|
|
1968
2117
|
})]
|
|
1969
|
-
},
|
|
2118
|
+
}, r);
|
|
1970
2119
|
})
|
|
1971
2120
|
});
|
|
1972
|
-
}
|
|
2121
|
+
};
|
|
2122
|
+
const vi = (n) => {
|
|
2123
|
+
const {
|
|
2124
|
+
items: e,
|
|
2125
|
+
onItemClick: t
|
|
2126
|
+
} = n, i = (o, a) => {
|
|
2127
|
+
t == null || t(o, a);
|
|
2128
|
+
}, s = new M("chat-suggestions");
|
|
2129
|
+
return c("div", {
|
|
2130
|
+
className: "".concat(s.b()),
|
|
2131
|
+
children: e.map((o, a) => c("div", {
|
|
2132
|
+
className: "".concat(s.e("item"), " ").concat(s.is("action", o.type === "action")),
|
|
2133
|
+
onClick: (r) => i(o, r),
|
|
2134
|
+
title: o.metadata.content_name,
|
|
2135
|
+
children: [o.metadata.content_name, c(pi, {
|
|
2136
|
+
className: "".concat(s.e("item-icon"))
|
|
2137
|
+
})]
|
|
2138
|
+
}, a))
|
|
2139
|
+
});
|
|
2140
|
+
};
|
|
2141
|
+
const Q = new M("markdown-message"), mi = (n) => {
|
|
1973
2142
|
const {
|
|
1974
2143
|
message: e,
|
|
1975
2144
|
size: t
|
|
1976
|
-
} = n, i =
|
|
2145
|
+
} = n, i = z(et()), s = z(null), o = Y(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), a = Y(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), r = z({
|
|
1977
2146
|
title: "",
|
|
1978
2147
|
description: "",
|
|
1979
|
-
icon: c(
|
|
1980
|
-
}), u = (
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2148
|
+
icon: c(Fe, {})
|
|
2149
|
+
}), u = z({
|
|
2150
|
+
hasSuggestions: !1,
|
|
2151
|
+
suggestions: []
|
|
2152
|
+
}), h = (v) => {
|
|
2153
|
+
v && v.length > 0 ? u.value = {
|
|
2154
|
+
hasSuggestions: !0,
|
|
2155
|
+
suggestions: v
|
|
2156
|
+
} : u.value = {
|
|
2157
|
+
hasSuggestions: !1,
|
|
2158
|
+
suggestions: []
|
|
2159
|
+
};
|
|
2160
|
+
}, p = (v, g) => {
|
|
2161
|
+
n.controller.handleSuggestionClick(n.message, v, g);
|
|
2162
|
+
}, l = (v) => {
|
|
2163
|
+
const g = v.indexOf("<think>"), d = v.indexOf("</think>");
|
|
2164
|
+
let f = "", _ = "", m = !1;
|
|
2165
|
+
return d === -1 ? (m = !1, f = v.slice(g + 7), _ = "") : (m = !0, f = v.slice(g + 7, d), _ = v.slice(d + 8)), {
|
|
2166
|
+
isThoughtCompleted: m,
|
|
2167
|
+
thoughtContent: f,
|
|
2168
|
+
answerContent: _
|
|
1987
2169
|
};
|
|
1988
2170
|
};
|
|
1989
|
-
return
|
|
1990
|
-
if (t >= 0 && s.value)
|
|
2171
|
+
return H(() => {
|
|
2172
|
+
if (t >= 0 && s.value) {
|
|
1991
2173
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1992
2174
|
const {
|
|
1993
|
-
isThoughtCompleted:
|
|
1994
|
-
thoughtContent:
|
|
1995
|
-
answerContent:
|
|
1996
|
-
} =
|
|
1997
|
-
|
|
2175
|
+
isThoughtCompleted: v,
|
|
2176
|
+
thoughtContent: g,
|
|
2177
|
+
answerContent: d
|
|
2178
|
+
} = l(e.content);
|
|
2179
|
+
v ? (r.value.icon = c(Re, {}), r.value.title = "思考完成") : e.completed === !0 ? (r.value.icon = c(Re, {}), r.value.title = "思考已停止") : (r.value.icon = c(Fe, {}), r.value.title = "思考中..."), r.value.description = g || "", s.value.setMarkdown(d || "");
|
|
1998
2180
|
} else
|
|
1999
|
-
s.value.setMarkdown(e.content);
|
|
2000
|
-
|
|
2001
|
-
|
|
2181
|
+
s.value.setMarkdown(e.content || "");
|
|
2182
|
+
h(e.suggestions);
|
|
2183
|
+
}
|
|
2184
|
+
}, [e, t]), H(() => {
|
|
2185
|
+
let v = "";
|
|
2002
2186
|
if (e.content.indexOf("<think>") !== -1) {
|
|
2003
2187
|
const {
|
|
2004
|
-
isThoughtCompleted:
|
|
2005
|
-
thoughtContent:
|
|
2006
|
-
answerContent:
|
|
2007
|
-
} =
|
|
2008
|
-
|
|
2009
|
-
title:
|
|
2010
|
-
description:
|
|
2011
|
-
icon:
|
|
2012
|
-
},
|
|
2188
|
+
isThoughtCompleted: g,
|
|
2189
|
+
thoughtContent: d,
|
|
2190
|
+
answerContent: f
|
|
2191
|
+
} = l(e.content);
|
|
2192
|
+
r.value = {
|
|
2193
|
+
title: g ? "思考完成" : e.completed === !0 ? "思考已停止" : "思考中...",
|
|
2194
|
+
description: d || "",
|
|
2195
|
+
icon: g || e.completed === !0 ? c(Re, {}) : c(Fe, {})
|
|
2196
|
+
}, f && (v = f);
|
|
2013
2197
|
} else
|
|
2014
|
-
|
|
2015
|
-
s.value = new
|
|
2198
|
+
v = e.content;
|
|
2199
|
+
h(e.suggestions), s.value = new Ut({
|
|
2016
2200
|
id: i,
|
|
2017
|
-
value:
|
|
2201
|
+
value: v || "",
|
|
2018
2202
|
editor: {
|
|
2019
2203
|
defaultModel: "previewOnly"
|
|
2020
2204
|
}
|
|
2021
2205
|
});
|
|
2022
2206
|
}, []), c("div", {
|
|
2023
|
-
className: "".concat(
|
|
2207
|
+
className: "".concat(Q.b(), " ").concat(Q.is("loading", o)),
|
|
2024
2208
|
children: [c("div", {
|
|
2025
|
-
className:
|
|
2209
|
+
className: Q.b("header"),
|
|
2026
2210
|
children: [c("div", {
|
|
2027
|
-
className:
|
|
2211
|
+
className: Q.be("header", "caption"),
|
|
2028
2212
|
children: "AI "
|
|
2029
|
-
}), n.children,
|
|
2030
|
-
className:
|
|
2213
|
+
}), n.children, a ? c("div", {
|
|
2214
|
+
className: Q.be("header", "timeout"),
|
|
2031
2215
|
children: "请求超时"
|
|
2032
2216
|
}) : null]
|
|
2033
2217
|
}), c("div", {
|
|
2034
|
-
className: "".concat(
|
|
2035
|
-
children: [c(
|
|
2036
|
-
items: [
|
|
2218
|
+
className: "".concat(Q.b("content"), " pre-wrap-container"),
|
|
2219
|
+
children: [c(fi, {
|
|
2220
|
+
items: [r.value]
|
|
2037
2221
|
}), c("div", {
|
|
2038
2222
|
id: i
|
|
2039
2223
|
})]
|
|
2040
2224
|
}), c("div", {
|
|
2041
|
-
className:
|
|
2225
|
+
className: Q.b("footer"),
|
|
2226
|
+
children: u.value.hasSuggestions ? c(vi, {
|
|
2227
|
+
items: u.value.suggestions,
|
|
2228
|
+
onItemClick: (v, g) => {
|
|
2229
|
+
p(v, g);
|
|
2230
|
+
}
|
|
2231
|
+
}) : null
|
|
2042
2232
|
})]
|
|
2043
2233
|
});
|
|
2044
2234
|
};
|
|
2045
|
-
const
|
|
2046
|
-
const e =
|
|
2235
|
+
const ue = new M("ossfile-material"), _i = (n) => {
|
|
2236
|
+
const e = L(() => n.material.data.name), t = L(() => n.material.metadata.size), i = L(() => {
|
|
2047
2237
|
const o = n.material.metadata.state;
|
|
2048
2238
|
return o === "successed" ? "上传成功" : o === "uploading" ? "上传中" : o === "failed" ? "上传失败" : "未知状态";
|
|
2049
|
-
}), s =
|
|
2239
|
+
}), s = L(() => {
|
|
2050
2240
|
switch (n.material.metadata.state) {
|
|
2051
2241
|
case "successed":
|
|
2052
2242
|
return "#1890ff";
|
|
@@ -2059,18 +2249,18 @@ const le = new $("ossfile-material"), di = (n) => {
|
|
|
2059
2249
|
}
|
|
2060
2250
|
});
|
|
2061
2251
|
return c("div", {
|
|
2062
|
-
className:
|
|
2252
|
+
className: ue.b(),
|
|
2063
2253
|
children: [c("div", {
|
|
2064
|
-
className:
|
|
2065
|
-
children: c(
|
|
2254
|
+
className: ue.b("left"),
|
|
2255
|
+
children: c(vn, {})
|
|
2066
2256
|
}), c("div", {
|
|
2067
|
-
className:
|
|
2257
|
+
className: ue.b("right"),
|
|
2068
2258
|
children: [c("div", {
|
|
2069
|
-
className:
|
|
2259
|
+
className: ue.e("name"),
|
|
2070
2260
|
title: e,
|
|
2071
2261
|
children: e
|
|
2072
2262
|
}), c("div", {
|
|
2073
|
-
className:
|
|
2263
|
+
className: ue.e("metadata"),
|
|
2074
2264
|
children: [c("div", {
|
|
2075
2265
|
children: [t, "B"]
|
|
2076
2266
|
}), c("div", {
|
|
@@ -2083,17 +2273,17 @@ const le = new $("ossfile-material"), di = (n) => {
|
|
|
2083
2273
|
})]
|
|
2084
2274
|
});
|
|
2085
2275
|
};
|
|
2086
|
-
const
|
|
2087
|
-
var i, s, o,
|
|
2088
|
-
const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((
|
|
2276
|
+
const de = new M("common-material"), gi = (n) => {
|
|
2277
|
+
var i, s, o, a;
|
|
2278
|
+
const e = (i = n.controller.opts.questionToolbarItems) == null ? void 0 : i.find((r) => r.id === n.material.metadata.actionId), t = L(() => n.material.metadata.name);
|
|
2089
2279
|
return c("div", {
|
|
2090
|
-
className:
|
|
2280
|
+
className: de.b(),
|
|
2091
2281
|
children: [c("div", {
|
|
2092
|
-
className:
|
|
2093
|
-
children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((s = e.icon) == null ? void 0 : s.showIcon) && c(
|
|
2282
|
+
className: de.b("left"),
|
|
2283
|
+
children: e && e.icon ? typeof e.icon == "function" ? e.icon() : ((s = e.icon) == null ? void 0 : s.showIcon) && c(j, {
|
|
2094
2284
|
children: (o = e.icon) != null && o.cssClass ? c("i", {
|
|
2095
2285
|
className: e.icon.cssClass
|
|
2096
|
-
}) : (
|
|
2286
|
+
}) : (a = e.icon) != null && a.imagePath ? tt(e.icon.imagePath) ? c("div", {
|
|
2097
2287
|
dangerouslySetInnerHTML: {
|
|
2098
2288
|
__html: e.icon.imagePath
|
|
2099
2289
|
}
|
|
@@ -2102,13 +2292,13 @@ const ue = new $("common-material"), hi = (n) => {
|
|
|
2102
2292
|
}) : null
|
|
2103
2293
|
}) : c(ri, {})
|
|
2104
2294
|
}), c("div", {
|
|
2105
|
-
className:
|
|
2295
|
+
className: de.b("right"),
|
|
2106
2296
|
children: [c("div", {
|
|
2107
|
-
className:
|
|
2297
|
+
className: de.e("name"),
|
|
2108
2298
|
title: t,
|
|
2109
2299
|
children: t
|
|
2110
2300
|
}), c("div", {
|
|
2111
|
-
className:
|
|
2301
|
+
className: de.e("metadata"),
|
|
2112
2302
|
children: c("div", {
|
|
2113
2303
|
children: (e == null ? void 0 : e.label) || "素材资源"
|
|
2114
2304
|
})
|
|
@@ -2116,35 +2306,44 @@ const ue = new $("common-material"), hi = (n) => {
|
|
|
2116
2306
|
})]
|
|
2117
2307
|
});
|
|
2118
2308
|
};
|
|
2119
|
-
const
|
|
2309
|
+
const Ue = new M("chat-input-material-item"), mn = (n) => {
|
|
2120
2310
|
const {
|
|
2121
2311
|
material: e
|
|
2122
2312
|
} = n;
|
|
2123
2313
|
let t = null;
|
|
2124
2314
|
switch (e.type) {
|
|
2125
2315
|
case "ossfile":
|
|
2126
|
-
t =
|
|
2316
|
+
t = _i;
|
|
2127
2317
|
break;
|
|
2128
2318
|
default:
|
|
2129
|
-
t =
|
|
2319
|
+
t = gi;
|
|
2130
2320
|
}
|
|
2131
2321
|
const i = () => {
|
|
2132
2322
|
n.controller.deleteMaterial(e);
|
|
2133
2323
|
};
|
|
2134
2324
|
return c("div", {
|
|
2135
|
-
className: "".concat(
|
|
2325
|
+
className: "".concat(Ue.b(), " ").concat(Ue.is("disabled", n.disabled)),
|
|
2136
2326
|
children: [c("div", {
|
|
2137
|
-
className:
|
|
2327
|
+
className: Ue.e("icon"),
|
|
2138
2328
|
onClick: i,
|
|
2139
|
-
children: c(
|
|
2140
|
-
}),
|
|
2329
|
+
children: c(ai, {})
|
|
2330
|
+
}), q(t, {
|
|
2141
2331
|
material: e,
|
|
2142
2332
|
controller: n.controller
|
|
2143
2333
|
})]
|
|
2144
2334
|
});
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
|
|
2335
|
+
};
|
|
2336
|
+
const ne = new M("user-message-question"), wi = (n) => {
|
|
2337
|
+
const e = z(et()), t = z(null), i = L(() => n.message.content), s = L(() => tn.parseMixedContent(i.value));
|
|
2338
|
+
return H(() => {
|
|
2339
|
+
t.value = new Ut({
|
|
2340
|
+
id: e,
|
|
2341
|
+
value: s.value.remainingText || "",
|
|
2342
|
+
editor: {
|
|
2343
|
+
defaultModel: "previewOnly"
|
|
2344
|
+
}
|
|
2345
|
+
});
|
|
2346
|
+
}, [s.value.remainingText]), c("div", {
|
|
2148
2347
|
className: ne.b(),
|
|
2149
2348
|
children: [c("div", {
|
|
2150
2349
|
className: ne.e("user-header"),
|
|
@@ -2155,51 +2354,50 @@ const We = new $("chat-input-material-item"), vn = (n) => {
|
|
|
2155
2354
|
}), c("div", {
|
|
2156
2355
|
className: ne.e("content"),
|
|
2157
2356
|
children: c("div", {
|
|
2158
|
-
dir: "auto",
|
|
2159
2357
|
className: ne.em("content", "body"),
|
|
2160
|
-
children: [c("
|
|
2161
|
-
dir: "auto",
|
|
2358
|
+
children: [s.value.hasResources && c("div", {
|
|
2162
2359
|
className: ne.em("content", "material"),
|
|
2163
|
-
children:
|
|
2164
|
-
material:
|
|
2360
|
+
children: s.value.resources.map((o) => c(mn, {
|
|
2361
|
+
material: o,
|
|
2165
2362
|
disabled: !0,
|
|
2166
2363
|
controller: n.controller
|
|
2167
|
-
},
|
|
2168
|
-
}), c("
|
|
2169
|
-
dir: "auto",
|
|
2364
|
+
}, o.id))
|
|
2365
|
+
}), c("div", {
|
|
2170
2366
|
className: "pre-wrap-container",
|
|
2171
|
-
children:
|
|
2367
|
+
children: c("div", {
|
|
2368
|
+
id: e
|
|
2369
|
+
})
|
|
2172
2370
|
})]
|
|
2173
2371
|
})
|
|
2174
2372
|
})]
|
|
2175
2373
|
});
|
|
2176
2374
|
};
|
|
2177
|
-
const
|
|
2178
|
-
const e =
|
|
2375
|
+
const be = new M("error-message"), yi = (n) => {
|
|
2376
|
+
const e = L(() => n.message.content);
|
|
2179
2377
|
return c("div", {
|
|
2180
|
-
className:
|
|
2378
|
+
className: be.b(),
|
|
2181
2379
|
children: [c("div", {
|
|
2182
|
-
className:
|
|
2380
|
+
className: be.b("header"),
|
|
2183
2381
|
children: [c("div", {
|
|
2184
|
-
className:
|
|
2382
|
+
className: be.be("header", "caption"),
|
|
2185
2383
|
children: "AI "
|
|
2186
2384
|
}), n.children]
|
|
2187
2385
|
}), c("div", {
|
|
2188
|
-
className: "".concat(
|
|
2386
|
+
className: "".concat(be.e("content"), " pre-wrap-container"),
|
|
2189
2387
|
children: c("span", {
|
|
2190
2388
|
children: e
|
|
2191
2389
|
})
|
|
2192
2390
|
})]
|
|
2193
2391
|
});
|
|
2194
2392
|
};
|
|
2195
|
-
const
|
|
2196
|
-
className:
|
|
2197
|
-
children: c("
|
|
2198
|
-
className: "".concat(
|
|
2393
|
+
const yt = new M("unknown-message"), bi = (n) => c("div", {
|
|
2394
|
+
className: yt.b(),
|
|
2395
|
+
children: c("div", {
|
|
2396
|
+
className: "".concat(yt.e("content"), " pre-wrap-container"),
|
|
2199
2397
|
children: ["暂未支持的消息类型: ", n.message.type]
|
|
2200
2398
|
})
|
|
2201
2399
|
});
|
|
2202
|
-
const
|
|
2400
|
+
const Ci = new M("chat-message-item"), Ti = (n) => {
|
|
2203
2401
|
const {
|
|
2204
2402
|
message: e,
|
|
2205
2403
|
size: t
|
|
@@ -2207,17 +2405,17 @@ const _i = new $("chat-message-item"), mi = (n) => {
|
|
|
2207
2405
|
let i = null;
|
|
2208
2406
|
switch (e.type) {
|
|
2209
2407
|
case "DEFAULT":
|
|
2210
|
-
i = e.role === "ASSISTANT" ?
|
|
2408
|
+
i = e.role === "ASSISTANT" ? mi : wi;
|
|
2211
2409
|
break;
|
|
2212
2410
|
case "ERROR":
|
|
2213
|
-
i =
|
|
2411
|
+
i = yi;
|
|
2214
2412
|
break;
|
|
2215
2413
|
default:
|
|
2216
|
-
i =
|
|
2414
|
+
i = bi;
|
|
2217
2415
|
}
|
|
2218
2416
|
return c("div", {
|
|
2219
|
-
className:
|
|
2220
|
-
children:
|
|
2417
|
+
className: Ci.b(),
|
|
2418
|
+
children: q(i, {
|
|
2221
2419
|
size: t,
|
|
2222
2420
|
message: e,
|
|
2223
2421
|
controller: n.controller,
|
|
@@ -2225,7 +2423,7 @@ const _i = new $("chat-message-item"), mi = (n) => {
|
|
|
2225
2423
|
})
|
|
2226
2424
|
});
|
|
2227
2425
|
};
|
|
2228
|
-
class
|
|
2426
|
+
class W {
|
|
2229
2427
|
constructor(e) {
|
|
2230
2428
|
this.msg = e;
|
|
2231
2429
|
}
|
|
@@ -2255,6 +2453,9 @@ class ie {
|
|
|
2255
2453
|
get completed() {
|
|
2256
2454
|
return this.msg.completed;
|
|
2257
2455
|
}
|
|
2456
|
+
get suggestions() {
|
|
2457
|
+
return this.msg.suggestions;
|
|
2458
|
+
}
|
|
2258
2459
|
get _origin() {
|
|
2259
2460
|
return this.msg;
|
|
2260
2461
|
}
|
|
@@ -2266,7 +2467,7 @@ class ie {
|
|
|
2266
2467
|
* @param {IChatMessage} msg
|
|
2267
2468
|
*/
|
|
2268
2469
|
update(e) {
|
|
2269
|
-
e.content || (e.content = ""), this.msg.content += e.content;
|
|
2470
|
+
e.content || (e.content = ""), e.content.indexOf("<think>") !== -1 && this.msg.content && (this.msg.content = ""), this.msg.content += e.content;
|
|
2270
2471
|
}
|
|
2271
2472
|
/**
|
|
2272
2473
|
* 更新消息完成状态
|
|
@@ -2279,7 +2480,7 @@ class ie {
|
|
|
2279
2480
|
this.msg.completed = e;
|
|
2280
2481
|
}
|
|
2281
2482
|
}
|
|
2282
|
-
class
|
|
2483
|
+
class he {
|
|
2283
2484
|
constructor(e) {
|
|
2284
2485
|
this.data = e;
|
|
2285
2486
|
}
|
|
@@ -2295,6 +2496,9 @@ class be {
|
|
|
2295
2496
|
get caption() {
|
|
2296
2497
|
return this.data.caption;
|
|
2297
2498
|
}
|
|
2499
|
+
get sourceCaption() {
|
|
2500
|
+
return this.data.sourceCaption || this.caption;
|
|
2501
|
+
}
|
|
2298
2502
|
get url() {
|
|
2299
2503
|
return this.data.url;
|
|
2300
2504
|
}
|
|
@@ -2302,7 +2506,7 @@ class be {
|
|
|
2302
2506
|
return this.data.aiChat;
|
|
2303
2507
|
}
|
|
2304
2508
|
}
|
|
2305
|
-
class
|
|
2509
|
+
class We {
|
|
2306
2510
|
constructor(e) {
|
|
2307
2511
|
this.material = e;
|
|
2308
2512
|
}
|
|
@@ -2319,33 +2523,47 @@ class Ve {
|
|
|
2319
2523
|
return this.material.data;
|
|
2320
2524
|
}
|
|
2321
2525
|
}
|
|
2322
|
-
const
|
|
2526
|
+
const ee = new M("chat-toolbar"), Je = (n) => {
|
|
2323
2527
|
const {
|
|
2324
2528
|
controller: e,
|
|
2325
2529
|
items: t = [],
|
|
2326
2530
|
data: i,
|
|
2327
2531
|
type: s,
|
|
2328
2532
|
className: o
|
|
2329
|
-
} = n;
|
|
2330
|
-
let r = [],
|
|
2331
|
-
const
|
|
2533
|
+
} = n, a = on(ot);
|
|
2534
|
+
let r = [], u = "default";
|
|
2535
|
+
const h = [{
|
|
2536
|
+
label: "重置对话",
|
|
2537
|
+
title: "重置对话",
|
|
2538
|
+
icon: () => c(di, {}),
|
|
2539
|
+
onClick: () => {
|
|
2540
|
+
e.resetTopic();
|
|
2541
|
+
}
|
|
2542
|
+
}, {
|
|
2543
|
+
label: "清空对话",
|
|
2544
|
+
title: "清空对话",
|
|
2545
|
+
icon: () => c(ui, {}),
|
|
2546
|
+
onClick: () => {
|
|
2547
|
+
e.clearTopic();
|
|
2548
|
+
}
|
|
2549
|
+
}, {
|
|
2332
2550
|
label: "新建对话",
|
|
2333
2551
|
title: "新建对话",
|
|
2334
2552
|
icon: () => c(Kn, {}),
|
|
2335
2553
|
onClick: () => {
|
|
2336
|
-
|
|
2554
|
+
a.newTopic && a.newTopic();
|
|
2337
2555
|
}
|
|
2338
|
-
}],
|
|
2556
|
+
}], p = L(() => n.controller.materials.value.length > 0), l = [{
|
|
2339
2557
|
label: "刷新",
|
|
2340
2558
|
title: "刷新",
|
|
2341
|
-
icon: () => c(
|
|
2559
|
+
icon: () => c(wt, {}),
|
|
2342
2560
|
onClick: () => {
|
|
2343
2561
|
e.refreshMessage(i);
|
|
2344
2562
|
}
|
|
2345
2563
|
}, {
|
|
2346
2564
|
label: "删除",
|
|
2347
2565
|
title: "删除",
|
|
2348
|
-
icon: () => c(
|
|
2566
|
+
icon: () => c(jn, {}),
|
|
2349
2567
|
onClick: () => {
|
|
2350
2568
|
e.deleteMessage(i);
|
|
2351
2569
|
}
|
|
@@ -2357,7 +2575,7 @@ const Q = new $("chat-toolbar"), Ke = (n) => {
|
|
|
2357
2575
|
e.copyMessage(i);
|
|
2358
2576
|
}
|
|
2359
2577
|
}];
|
|
2360
|
-
|
|
2578
|
+
a.enableBackFill && l.unshift({
|
|
2361
2579
|
label: "回填",
|
|
2362
2580
|
title: "回填",
|
|
2363
2581
|
icon: () => c(Vn, {}),
|
|
@@ -2365,52 +2583,52 @@ const Q = new $("chat-toolbar"), Ke = (n) => {
|
|
|
2365
2583
|
e.backfill(i);
|
|
2366
2584
|
}
|
|
2367
2585
|
});
|
|
2368
|
-
const
|
|
2586
|
+
const v = [{
|
|
2369
2587
|
label: "刷新",
|
|
2370
2588
|
title: "刷新",
|
|
2371
|
-
icon: () => c(
|
|
2589
|
+
icon: () => c(wt, {}),
|
|
2372
2590
|
onClick: () => {
|
|
2373
2591
|
e.refreshMessage(i, !0);
|
|
2374
2592
|
}
|
|
2375
2593
|
}];
|
|
2376
2594
|
if (s === "content")
|
|
2377
|
-
switch (
|
|
2595
|
+
switch (u = "circle", i.type) {
|
|
2378
2596
|
case "DEFAULT":
|
|
2379
|
-
i.role === "ASSISTANT" ? r = [...
|
|
2597
|
+
i.role === "ASSISTANT" ? r = [...l, ...t] : r = [...v];
|
|
2380
2598
|
break;
|
|
2381
2599
|
case "ERROR":
|
|
2382
|
-
r = [...
|
|
2600
|
+
r = [...l, ...t];
|
|
2383
2601
|
break;
|
|
2384
2602
|
}
|
|
2385
2603
|
else
|
|
2386
|
-
r = [...
|
|
2387
|
-
const g = (m) => typeof m.hidden == "function" ? m.hidden(i) : m.hidden === !0,
|
|
2388
|
-
if (
|
|
2604
|
+
r = [...h, ...t];
|
|
2605
|
+
const g = (m) => typeof m.hidden == "function" ? m.hidden(i) : m.hidden === !0, d = (m) => typeof m.disabled == "function" ? m.disabled(i) : m.disabled === !0, f = (m, b) => {
|
|
2606
|
+
if (d(b))
|
|
2389
2607
|
return;
|
|
2390
|
-
const
|
|
2608
|
+
const x = {
|
|
2391
2609
|
...i
|
|
2392
2610
|
};
|
|
2393
|
-
if (i instanceof
|
|
2611
|
+
if (i instanceof W && (Object.assign(x, {
|
|
2394
2612
|
topic: e.topic
|
|
2395
|
-
}),
|
|
2396
|
-
|
|
2613
|
+
}), x.msg.realcontent = i.realcontent), b.onClick && typeof b.onClick == "function")
|
|
2614
|
+
b.onClick(m, b, e.context, e.params, x);
|
|
2397
2615
|
else {
|
|
2398
2616
|
const C = n.controller.opts.extendToolbarClick;
|
|
2399
|
-
C && typeof C == "function" && C(m,
|
|
2617
|
+
C && typeof C == "function" && C(m, b, e.context, e.params, x);
|
|
2400
2618
|
}
|
|
2401
|
-
},
|
|
2619
|
+
}, _ = Y(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
|
|
2402
2620
|
return c("div", {
|
|
2403
|
-
className: "".concat(
|
|
2404
|
-
children: r.map((m,
|
|
2405
|
-
var
|
|
2621
|
+
className: "".concat(ee.b(), " ").concat(ee.is("has-materials", p.value), " ").concat(ee.e(u), " ").concat(o || ""),
|
|
2622
|
+
children: r.map((m, b) => {
|
|
2623
|
+
var x, C, S;
|
|
2406
2624
|
if (!g(m))
|
|
2407
2625
|
return c("div", {
|
|
2408
|
-
className: "".concat(
|
|
2626
|
+
className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", d(m) || _), " ").concat(o || ""),
|
|
2409
2627
|
title: m.title,
|
|
2410
|
-
onClick: (
|
|
2628
|
+
onClick: (O) => f(O, m),
|
|
2411
2629
|
children: [c("div", {
|
|
2412
|
-
className: "".concat(
|
|
2413
|
-
children: typeof m.icon == "function" ? m.icon() : ((
|
|
2630
|
+
className: "".concat(ee.em("item", "icon")),
|
|
2631
|
+
children: typeof m.icon == "function" ? m.icon() : ((x = m.icon) == null ? void 0 : x.showIcon) && c(j, {
|
|
2414
2632
|
children: (C = m.icon) != null && C.cssClass ? c("i", {
|
|
2415
2633
|
className: m.icon.cssClass
|
|
2416
2634
|
}) : (S = m.icon) != null && S.imagePath ? tt(m.icon.imagePath) ? c("div", {
|
|
@@ -2422,14 +2640,14 @@ const Q = new $("chat-toolbar"), Ke = (n) => {
|
|
|
2422
2640
|
}) : null
|
|
2423
2641
|
})
|
|
2424
2642
|
}), c("div", {
|
|
2425
|
-
className: "".concat(
|
|
2643
|
+
className: "".concat(ee.em("item", "label")),
|
|
2426
2644
|
children: m.label
|
|
2427
2645
|
})]
|
|
2428
|
-
},
|
|
2646
|
+
}, b);
|
|
2429
2647
|
})
|
|
2430
2648
|
});
|
|
2431
2649
|
};
|
|
2432
|
-
function
|
|
2650
|
+
function xi(n, e) {
|
|
2433
2651
|
let t = null;
|
|
2434
2652
|
return function(...i) {
|
|
2435
2653
|
t || (t = setTimeout(() => {
|
|
@@ -2437,93 +2655,96 @@ function gi(n, e) {
|
|
|
2437
2655
|
}, e));
|
|
2438
2656
|
};
|
|
2439
2657
|
}
|
|
2440
|
-
const
|
|
2441
|
-
const e =
|
|
2658
|
+
const Si = (n) => {
|
|
2659
|
+
const e = z(!1), t = z({}), i = new M("chat-back-bottom"), s = z(null), o = () => {
|
|
2442
2660
|
if (s.value) {
|
|
2443
|
-
const u = n.visibilityHeight || 200,
|
|
2444
|
-
e.value =
|
|
2661
|
+
const u = n.visibilityHeight || 200, h = s.value.scrollHeight - s.value.scrollTop - s.value.offsetHeight;
|
|
2662
|
+
e.value = h >= u;
|
|
2445
2663
|
}
|
|
2446
|
-
},
|
|
2447
|
-
|
|
2664
|
+
}, a = () => {
|
|
2665
|
+
var u;
|
|
2666
|
+
s.value && (s.value.scrollTo({
|
|
2448
2667
|
top: s.value.scrollHeight,
|
|
2449
2668
|
behavior: "smooth"
|
|
2450
|
-
});
|
|
2451
|
-
},
|
|
2452
|
-
return
|
|
2669
|
+
}), (u = n.onClick) == null || u.call(n));
|
|
2670
|
+
}, r = xi(o, 300);
|
|
2671
|
+
return Y(() => {
|
|
2453
2672
|
t.value = {
|
|
2454
2673
|
right: "".concat(n.right, "px"),
|
|
2455
2674
|
bottom: "".concat(n.bottom, "px")
|
|
2456
2675
|
};
|
|
2457
|
-
}, [n.right, n.bottom]),
|
|
2676
|
+
}, [n.right, n.bottom]), H(() => {
|
|
2458
2677
|
var u;
|
|
2459
2678
|
if (n.target) {
|
|
2460
|
-
const
|
|
2461
|
-
|
|
2679
|
+
const h = (u = document.querySelector(n.target)) != null ? u : void 0;
|
|
2680
|
+
h && (s.value = h, h.addEventListener("scroll", r), o());
|
|
2462
2681
|
}
|
|
2463
2682
|
}, []), c("div", {
|
|
2464
2683
|
className: "".concat(i.b(), " ").concat(i.is("visible", e.value)),
|
|
2465
2684
|
style: t.value,
|
|
2466
|
-
onClick:
|
|
2467
|
-
children: c(
|
|
2685
|
+
onClick: a,
|
|
2686
|
+
children: c(li, {
|
|
2468
2687
|
className: i.e("icon")
|
|
2469
2688
|
})
|
|
2470
2689
|
});
|
|
2471
2690
|
};
|
|
2472
|
-
const bt = new
|
|
2473
|
-
const e =
|
|
2474
|
-
const
|
|
2475
|
-
|
|
2476
|
-
top:
|
|
2477
|
-
behavior: "
|
|
2478
|
-
}))
|
|
2691
|
+
const bt = new M("chat-messages"), Ct = (n) => {
|
|
2692
|
+
const e = R(null), [t, i] = ce(!0), s = R(!1), o = n.controller.messages, a = () => {
|
|
2693
|
+
const h = e.current;
|
|
2694
|
+
h && (s.current = !0, h.scrollTo({
|
|
2695
|
+
top: h.scrollHeight,
|
|
2696
|
+
behavior: "auto"
|
|
2697
|
+
}), setTimeout(() => {
|
|
2698
|
+
s.current = !1;
|
|
2699
|
+
}, 500));
|
|
2479
2700
|
};
|
|
2480
|
-
|
|
2481
|
-
t
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
u - (a + f) < 50 ? i.current = !1 : i.current = !0;
|
|
2701
|
+
H(() => {
|
|
2702
|
+
t && a();
|
|
2703
|
+
}, [o.value]);
|
|
2704
|
+
const r = () => {
|
|
2705
|
+
if (!s.current && e.current) {
|
|
2706
|
+
const {
|
|
2707
|
+
scrollTop: h,
|
|
2708
|
+
scrollHeight: p,
|
|
2709
|
+
clientHeight: l
|
|
2710
|
+
} = e.current, v = p - (h + l) < 50;
|
|
2711
|
+
i(v);
|
|
2712
|
+
}
|
|
2713
|
+
}, u = () => {
|
|
2714
|
+
s.current = !0, i(!0);
|
|
2495
2715
|
};
|
|
2496
2716
|
return c("div", {
|
|
2497
2717
|
ref: e,
|
|
2498
2718
|
className: bt.b(),
|
|
2499
|
-
onScroll:
|
|
2500
|
-
children: [
|
|
2501
|
-
var
|
|
2502
|
-
const
|
|
2503
|
-
return
|
|
2504
|
-
size:
|
|
2505
|
-
message:
|
|
2719
|
+
onScroll: r,
|
|
2720
|
+
children: [o.value.map((h) => {
|
|
2721
|
+
var l;
|
|
2722
|
+
const p = ((l = h.content) == null ? void 0 : l.length) || 0;
|
|
2723
|
+
return h.role !== "SYSTEM" ? c(Ti, {
|
|
2724
|
+
size: p,
|
|
2725
|
+
message: h,
|
|
2506
2726
|
controller: n.controller,
|
|
2507
|
-
children: c(
|
|
2508
|
-
data:
|
|
2727
|
+
children: c(Je, {
|
|
2728
|
+
data: h,
|
|
2509
2729
|
type: "content",
|
|
2510
2730
|
items: n.toolbarItems,
|
|
2511
2731
|
controller: n.controller
|
|
2512
2732
|
})
|
|
2513
|
-
},
|
|
2514
|
-
}), c(
|
|
2733
|
+
}, h.messageid) : null;
|
|
2734
|
+
}), c(Si, {
|
|
2515
2735
|
right: 20,
|
|
2516
2736
|
bottom: 14,
|
|
2517
|
-
target: ".".concat(bt.b())
|
|
2737
|
+
target: ".".concat(bt.b()),
|
|
2738
|
+
onClick: u
|
|
2518
2739
|
})]
|
|
2519
2740
|
});
|
|
2520
2741
|
};
|
|
2521
|
-
function
|
|
2742
|
+
function ki(n, e) {
|
|
2522
2743
|
for (var t in e)
|
|
2523
2744
|
n[t] = e[t];
|
|
2524
2745
|
return n;
|
|
2525
2746
|
}
|
|
2526
|
-
function
|
|
2747
|
+
function Tt(n, e) {
|
|
2527
2748
|
for (var t in n)
|
|
2528
2749
|
if (t !== "__source" && !(t in e))
|
|
2529
2750
|
return !0;
|
|
@@ -2532,73 +2753,73 @@ function Ct(n, e) {
|
|
|
2532
2753
|
return !0;
|
|
2533
2754
|
return !1;
|
|
2534
2755
|
}
|
|
2535
|
-
function
|
|
2756
|
+
function xt(n) {
|
|
2536
2757
|
this.props = n;
|
|
2537
2758
|
}
|
|
2538
|
-
(
|
|
2539
|
-
return
|
|
2759
|
+
(xt.prototype = new P()).isPureReactComponent = !0, xt.prototype.shouldComponentUpdate = function(n, e) {
|
|
2760
|
+
return Tt(this.props, n) || Tt(this.state, e);
|
|
2540
2761
|
};
|
|
2541
|
-
var
|
|
2762
|
+
var St = w.__b;
|
|
2542
2763
|
w.__b = function(n) {
|
|
2543
|
-
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null),
|
|
2764
|
+
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), St && St(n);
|
|
2544
2765
|
};
|
|
2545
|
-
var
|
|
2766
|
+
var Ei = w.__e;
|
|
2546
2767
|
w.__e = function(n, e, t, i) {
|
|
2547
2768
|
if (n.then) {
|
|
2548
2769
|
for (var s, o = e; o = o.__; )
|
|
2549
2770
|
if ((s = o.__c) && s.__c)
|
|
2550
2771
|
return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
|
|
2551
2772
|
}
|
|
2552
|
-
|
|
2773
|
+
Ei(n, e, t, i);
|
|
2553
2774
|
};
|
|
2554
|
-
var
|
|
2775
|
+
var kt = w.unmount;
|
|
2555
2776
|
function _n(n, e, t) {
|
|
2556
2777
|
return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
|
|
2557
2778
|
typeof i.__c == "function" && i.__c();
|
|
2558
|
-
}), n.__c.__H = null), (n =
|
|
2779
|
+
}), n.__c.__H = null), (n = ki({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
|
|
2559
2780
|
return _n(i, e, t);
|
|
2560
2781
|
})), n;
|
|
2561
2782
|
}
|
|
2562
|
-
function
|
|
2783
|
+
function gn(n, e, t) {
|
|
2563
2784
|
return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
|
|
2564
|
-
return
|
|
2785
|
+
return gn(i, e, t);
|
|
2565
2786
|
}), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
|
|
2566
2787
|
}
|
|
2567
|
-
function
|
|
2788
|
+
function Ve() {
|
|
2568
2789
|
this.__u = 0, this.t = null, this.__b = null;
|
|
2569
2790
|
}
|
|
2570
|
-
function
|
|
2791
|
+
function wn(n) {
|
|
2571
2792
|
var e = n.__.__c;
|
|
2572
2793
|
return e && e.__a && e.__a(n);
|
|
2573
2794
|
}
|
|
2574
|
-
function
|
|
2795
|
+
function Ce() {
|
|
2575
2796
|
this.u = null, this.o = null;
|
|
2576
2797
|
}
|
|
2577
2798
|
w.unmount = function(n) {
|
|
2578
2799
|
var e = n.__c;
|
|
2579
|
-
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null),
|
|
2580
|
-
}, (
|
|
2800
|
+
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), kt && kt(n);
|
|
2801
|
+
}, (Ve.prototype = new P()).__c = function(n, e) {
|
|
2581
2802
|
var t = e.__c, i = this;
|
|
2582
2803
|
i.t == null && (i.t = []), i.t.push(t);
|
|
2583
|
-
var s =
|
|
2584
|
-
o || (o = !0, t.__R = null, s ? s(
|
|
2804
|
+
var s = wn(i.__v), o = !1, a = function() {
|
|
2805
|
+
o || (o = !0, t.__R = null, s ? s(r) : r());
|
|
2585
2806
|
};
|
|
2586
|
-
t.__R =
|
|
2587
|
-
var
|
|
2807
|
+
t.__R = a;
|
|
2808
|
+
var r = function() {
|
|
2588
2809
|
if (!--i.__u) {
|
|
2589
2810
|
if (i.state.__a) {
|
|
2590
|
-
var
|
|
2591
|
-
i.__v.__k[0] =
|
|
2811
|
+
var h = i.state.__a;
|
|
2812
|
+
i.__v.__k[0] = gn(h, h.__c.__P, h.__c.__O);
|
|
2592
2813
|
}
|
|
2593
|
-
var
|
|
2594
|
-
for (i.setState({ __a: i.__b = null });
|
|
2595
|
-
|
|
2814
|
+
var p;
|
|
2815
|
+
for (i.setState({ __a: i.__b = null }); p = i.t.pop(); )
|
|
2816
|
+
p.forceUpdate();
|
|
2596
2817
|
}
|
|
2597
2818
|
}, u = e.__h === !0;
|
|
2598
|
-
i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(
|
|
2599
|
-
},
|
|
2819
|
+
i.__u++ || u || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(a, a);
|
|
2820
|
+
}, Ve.prototype.componentWillUnmount = function() {
|
|
2600
2821
|
this.t = [];
|
|
2601
|
-
},
|
|
2822
|
+
}, Ve.prototype.render = function(n, e) {
|
|
2602
2823
|
if (this.__b) {
|
|
2603
2824
|
if (this.__v.__k) {
|
|
2604
2825
|
var t = document.createElement("div"), i = this.__v.__k[0].__c;
|
|
@@ -2606,10 +2827,10 @@ w.unmount = function(n) {
|
|
|
2606
2827
|
}
|
|
2607
2828
|
this.__b = null;
|
|
2608
2829
|
}
|
|
2609
|
-
var s = e.__a &&
|
|
2610
|
-
return s && (s.__h = null), [
|
|
2830
|
+
var s = e.__a && q(j, null, n.fallback);
|
|
2831
|
+
return s && (s.__h = null), [q(j, null, e.__a ? null : n.children), s];
|
|
2611
2832
|
};
|
|
2612
|
-
var
|
|
2833
|
+
var Et = function(n, e, t) {
|
|
2613
2834
|
if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
|
|
2614
2835
|
for (t = n.u; t; ) {
|
|
2615
2836
|
for (; t.length > 3; )
|
|
@@ -2619,12 +2840,12 @@ var kt = function(n, e, t) {
|
|
|
2619
2840
|
n.u = t = t[2];
|
|
2620
2841
|
}
|
|
2621
2842
|
};
|
|
2622
|
-
function
|
|
2843
|
+
function Ni(n) {
|
|
2623
2844
|
return this.getChildContext = function() {
|
|
2624
2845
|
return n.context;
|
|
2625
2846
|
}, n.children;
|
|
2626
2847
|
}
|
|
2627
|
-
function
|
|
2848
|
+
function Mi(n) {
|
|
2628
2849
|
var e = this, t = n.i;
|
|
2629
2850
|
e.componentWillUnmount = function() {
|
|
2630
2851
|
se(null, e.l), e.l = null, e.i = null;
|
|
@@ -2634,142 +2855,142 @@ function Ti(n) {
|
|
|
2634
2855
|
this.childNodes.push(i), e.i.appendChild(i);
|
|
2635
2856
|
}, removeChild: function(i) {
|
|
2636
2857
|
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
|
|
2637
|
-
} }), se(
|
|
2858
|
+
} }), se(q(Ni, { context: e.context }, n.__v), e.l);
|
|
2638
2859
|
}
|
|
2639
|
-
function
|
|
2640
|
-
var t =
|
|
2860
|
+
function $i(n, e) {
|
|
2861
|
+
var t = q(Mi, { __v: n, i: e });
|
|
2641
2862
|
return t.containerInfo = e, t;
|
|
2642
2863
|
}
|
|
2643
|
-
(
|
|
2644
|
-
var e = this, t =
|
|
2864
|
+
(Ce.prototype = new P()).__a = function(n) {
|
|
2865
|
+
var e = this, t = wn(e.__v), i = e.o.get(n);
|
|
2645
2866
|
return i[0]++, function(s) {
|
|
2646
2867
|
var o = function() {
|
|
2647
|
-
e.props.revealOrder ? (i.push(s),
|
|
2868
|
+
e.props.revealOrder ? (i.push(s), Et(e, n, i)) : s();
|
|
2648
2869
|
};
|
|
2649
2870
|
t ? t(o) : o();
|
|
2650
2871
|
};
|
|
2651
|
-
},
|
|
2872
|
+
}, Ce.prototype.render = function(n) {
|
|
2652
2873
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
2653
2874
|
var e = Ee(n.children);
|
|
2654
2875
|
n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
|
|
2655
2876
|
for (var t = e.length; t--; )
|
|
2656
2877
|
this.o.set(e[t], this.u = [1, 0, this.u]);
|
|
2657
2878
|
return n.children;
|
|
2658
|
-
},
|
|
2879
|
+
}, Ce.prototype.componentDidUpdate = Ce.prototype.componentDidMount = function() {
|
|
2659
2880
|
var n = this;
|
|
2660
2881
|
this.o.forEach(function(e, t) {
|
|
2661
|
-
|
|
2882
|
+
Et(n, t, e);
|
|
2662
2883
|
});
|
|
2663
2884
|
};
|
|
2664
|
-
var
|
|
2885
|
+
var Ai = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Ii = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Di = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, zi = /[A-Z0-9]/g, Li = typeof document < "u", Hi = function(n) {
|
|
2665
2886
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
2666
2887
|
};
|
|
2667
|
-
|
|
2668
|
-
Object.defineProperty(
|
|
2888
|
+
P.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
|
|
2889
|
+
Object.defineProperty(P.prototype, n, { configurable: !0, get: function() {
|
|
2669
2890
|
return this["UNSAFE_" + n];
|
|
2670
2891
|
}, set: function(e) {
|
|
2671
2892
|
Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
|
|
2672
2893
|
} });
|
|
2673
2894
|
});
|
|
2674
|
-
var
|
|
2675
|
-
function
|
|
2895
|
+
var Nt = w.event;
|
|
2896
|
+
function Oi() {
|
|
2676
2897
|
}
|
|
2677
|
-
function
|
|
2898
|
+
function Bi() {
|
|
2678
2899
|
return this.cancelBubble;
|
|
2679
2900
|
}
|
|
2680
|
-
function
|
|
2901
|
+
function Pi() {
|
|
2681
2902
|
return this.defaultPrevented;
|
|
2682
2903
|
}
|
|
2683
2904
|
w.event = function(n) {
|
|
2684
|
-
return
|
|
2905
|
+
return Nt && (n = Nt(n)), n.persist = Oi, n.isPropagationStopped = Bi, n.isDefaultPrevented = Pi, n.nativeEvent = n;
|
|
2685
2906
|
};
|
|
2686
|
-
var
|
|
2907
|
+
var Ri = { enumerable: !1, configurable: !0, get: function() {
|
|
2687
2908
|
return this.class;
|
|
2688
|
-
} },
|
|
2909
|
+
} }, Mt = w.vnode;
|
|
2689
2910
|
w.vnode = function(n) {
|
|
2690
2911
|
typeof n.type == "string" && function(e) {
|
|
2691
2912
|
var t = e.props, i = e.type, s = {};
|
|
2692
2913
|
for (var o in t) {
|
|
2693
|
-
var
|
|
2694
|
-
if (!(o === "value" && "defaultValue" in t &&
|
|
2695
|
-
var
|
|
2696
|
-
o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" &&
|
|
2914
|
+
var a = t[o];
|
|
2915
|
+
if (!(o === "value" && "defaultValue" in t && a == null || Li && o === "children" && i === "noscript" || o === "class" || o === "className")) {
|
|
2916
|
+
var r = o.toLowerCase();
|
|
2917
|
+
o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && a === !0 ? a = "" : r === "ondoubleclick" ? o = "ondblclick" : r !== "onchange" || i !== "input" && i !== "textarea" || Hi(t.type) ? r === "onfocus" ? o = "onfocusin" : r === "onblur" ? o = "onfocusout" : Di.test(o) ? o = r : i.indexOf("-") === -1 && Ii.test(o) ? o = o.replace(zi, "-$&").toLowerCase() : a === null && (a = void 0) : r = o = "oninput", r === "oninput" && s[o = r] && (o = "oninputCapture"), s[o] = a;
|
|
2697
2918
|
}
|
|
2698
2919
|
}
|
|
2699
2920
|
i == "select" && s.multiple && Array.isArray(s.value) && (s.value = Ee(t.children).forEach(function(u) {
|
|
2700
2921
|
u.props.selected = s.value.indexOf(u.props.value) != -1;
|
|
2701
2922
|
})), i == "select" && s.defaultValue != null && (s.value = Ee(t.children).forEach(function(u) {
|
|
2702
2923
|
u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
|
|
2703
|
-
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className",
|
|
2704
|
-
}(n), n.$$typeof =
|
|
2924
|
+
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Ri)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
|
|
2925
|
+
}(n), n.$$typeof = Ai, Mt && Mt(n);
|
|
2705
2926
|
};
|
|
2706
2927
|
var $t = w.__r;
|
|
2707
2928
|
w.__r = function(n) {
|
|
2708
2929
|
$t && $t(n), n.__c;
|
|
2709
2930
|
};
|
|
2710
|
-
var
|
|
2931
|
+
var At = w.diffed;
|
|
2711
2932
|
w.diffed = function(n) {
|
|
2712
|
-
|
|
2933
|
+
At && At(n);
|
|
2713
2934
|
var e = n.props, t = n.__e;
|
|
2714
2935
|
t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
|
|
2715
2936
|
};
|
|
2716
|
-
var
|
|
2717
|
-
function
|
|
2718
|
-
var e =
|
|
2937
|
+
var me = /* @__PURE__ */ new Map();
|
|
2938
|
+
function Fi(n) {
|
|
2939
|
+
var e = me.get(n);
|
|
2719
2940
|
e && e.destroy();
|
|
2720
2941
|
}
|
|
2721
|
-
function
|
|
2722
|
-
var e =
|
|
2942
|
+
function Ui(n) {
|
|
2943
|
+
var e = me.get(n);
|
|
2723
2944
|
e && e.update();
|
|
2724
2945
|
}
|
|
2725
|
-
var
|
|
2726
|
-
typeof window > "u" ? ((
|
|
2946
|
+
var pe = null;
|
|
2947
|
+
typeof window > "u" ? ((pe = function(n) {
|
|
2727
2948
|
return n;
|
|
2728
2949
|
}).destroy = function(n) {
|
|
2729
2950
|
return n;
|
|
2730
|
-
},
|
|
2951
|
+
}, pe.update = function(n) {
|
|
2731
2952
|
return n;
|
|
2732
|
-
}) : ((
|
|
2953
|
+
}) : ((pe = function(n, e) {
|
|
2733
2954
|
return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
|
|
2734
2955
|
return function(i) {
|
|
2735
|
-
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !
|
|
2736
|
-
var s, o = null,
|
|
2737
|
-
|
|
2956
|
+
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !me.has(i)) {
|
|
2957
|
+
var s, o = null, a = window.getComputedStyle(i), r = (s = i.value, function() {
|
|
2958
|
+
h({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
|
|
2738
2959
|
}), u = (function(l) {
|
|
2739
|
-
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update",
|
|
2740
|
-
return i.style[
|
|
2741
|
-
}),
|
|
2960
|
+
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", p), i.removeEventListener("input", r), window.removeEventListener("resize", p), Object.keys(l).forEach(function(v) {
|
|
2961
|
+
return i.style[v] = l[v];
|
|
2962
|
+
}), me.delete(i);
|
|
2742
2963
|
}).bind(i, { height: i.style.height, resize: i.style.resize, textAlign: i.style.textAlign, overflowY: i.style.overflowY, overflowX: i.style.overflowX, wordWrap: i.style.wordWrap });
|
|
2743
|
-
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update",
|
|
2964
|
+
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", p), i.addEventListener("input", r), window.addEventListener("resize", p), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", me.set(i, { destroy: u, update: p }), p();
|
|
2744
2965
|
}
|
|
2745
|
-
function
|
|
2746
|
-
var
|
|
2747
|
-
if (i.scrollHeight !== 0 && (
|
|
2966
|
+
function h(l) {
|
|
2967
|
+
var v, g, d = l.restoreTextAlign, f = d === void 0 ? null : d, _ = l.testForHeightReduction, m = _ === void 0 || _, b = a.overflowY;
|
|
2968
|
+
if (i.scrollHeight !== 0 && (a.resize === "vertical" ? i.style.resize = "none" : a.resize === "both" && (i.style.resize = "horizontal"), m && (v = function(C) {
|
|
2748
2969
|
for (var S = []; C && C.parentNode && C.parentNode instanceof Element; )
|
|
2749
2970
|
C.parentNode.scrollTop && S.push([C.parentNode, C.parentNode.scrollTop]), C = C.parentNode;
|
|
2750
2971
|
return function() {
|
|
2751
|
-
return S.forEach(function(
|
|
2752
|
-
var
|
|
2753
|
-
|
|
2972
|
+
return S.forEach(function(O) {
|
|
2973
|
+
var I = O[0], F = O[1];
|
|
2974
|
+
I.style.scrollBehavior = "auto", I.scrollTop = F, I.style.scrollBehavior = null;
|
|
2754
2975
|
});
|
|
2755
2976
|
};
|
|
2756
|
-
}(i), i.style.height = ""), g =
|
|
2757
|
-
var
|
|
2758
|
-
|
|
2977
|
+
}(i), i.style.height = ""), g = a.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(a.paddingTop) + parseFloat(a.paddingBottom)) : i.scrollHeight + parseFloat(a.borderTopWidth) + parseFloat(a.borderBottomWidth), a.maxHeight !== "none" && g > parseFloat(a.maxHeight) ? (a.overflowY === "hidden" && (i.style.overflow = "scroll"), g = parseFloat(a.maxHeight)) : a.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = g + "px", f && (i.style.textAlign = f), v && v(), o !== g && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = g), b !== a.overflow && !f)) {
|
|
2978
|
+
var x = a.textAlign;
|
|
2979
|
+
a.overflow === "hidden" && (i.style.textAlign = x === "start" ? "end" : "start"), h({ restoreTextAlign: x, testForHeightReduction: !0 });
|
|
2759
2980
|
}
|
|
2760
2981
|
}
|
|
2761
|
-
function
|
|
2762
|
-
|
|
2982
|
+
function p() {
|
|
2983
|
+
h({ testForHeightReduction: !0, restoreTextAlign: null });
|
|
2763
2984
|
}
|
|
2764
2985
|
}(t);
|
|
2765
2986
|
}), n;
|
|
2766
2987
|
}).destroy = function(n) {
|
|
2767
|
-
return n && Array.prototype.forEach.call(n.length ? n : [n],
|
|
2768
|
-
},
|
|
2769
|
-
return n && Array.prototype.forEach.call(n.length ? n : [n],
|
|
2988
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], Fi), n;
|
|
2989
|
+
}, pe.update = function(n) {
|
|
2990
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], Ui), n;
|
|
2770
2991
|
});
|
|
2771
|
-
var It =
|
|
2772
|
-
class
|
|
2992
|
+
var It = pe, N = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))(N || {});
|
|
2993
|
+
class Dt {
|
|
2773
2994
|
/**
|
|
2774
2995
|
* 聊天窗触发提问回调
|
|
2775
2996
|
*
|
|
@@ -2795,7 +3016,7 @@ class At {
|
|
|
2795
3016
|
* @date 2023-10-16 16:10:29
|
|
2796
3017
|
* @type {Signal<ChatMessage[]>}
|
|
2797
3018
|
*/
|
|
2798
|
-
|
|
3019
|
+
T(this, "messages", G([]));
|
|
2799
3020
|
/**
|
|
2800
3021
|
* 素材列表
|
|
2801
3022
|
*
|
|
@@ -2803,7 +3024,7 @@ class At {
|
|
|
2803
3024
|
* @date 2025-02-27 18:02:46
|
|
2804
3025
|
* @type {Signal<IMaterial[]>}
|
|
2805
3026
|
*/
|
|
2806
|
-
|
|
3027
|
+
T(this, "materials", G([]));
|
|
2807
3028
|
/**
|
|
2808
3029
|
* 聊天框输入值
|
|
2809
3030
|
*
|
|
@@ -2811,7 +3032,7 @@ class At {
|
|
|
2811
3032
|
* @date 2023-10-16 15:10:43
|
|
2812
3033
|
* @type {Signal<string>}
|
|
2813
3034
|
*/
|
|
2814
|
-
|
|
3035
|
+
T(this, "input", G(""));
|
|
2815
3036
|
/**
|
|
2816
3037
|
* 是否加载中
|
|
2817
3038
|
*
|
|
@@ -2819,7 +3040,7 @@ class At {
|
|
|
2819
3040
|
* @date 2025-03-10 18:03:42
|
|
2820
3041
|
* @type {Signal<boolean>}
|
|
2821
3042
|
*/
|
|
2822
|
-
|
|
3043
|
+
T(this, "isLoading", G(!1));
|
|
2823
3044
|
/**
|
|
2824
3045
|
* 视图参数
|
|
2825
3046
|
*
|
|
@@ -2827,7 +3048,7 @@ class At {
|
|
|
2827
3048
|
* @date 2025-02-24 14:02:23
|
|
2828
3049
|
* @type {object}
|
|
2829
3050
|
*/
|
|
2830
|
-
|
|
3051
|
+
T(this, "context");
|
|
2831
3052
|
/**
|
|
2832
3053
|
* 视图参数
|
|
2833
3054
|
*
|
|
@@ -2835,7 +3056,7 @@ class At {
|
|
|
2835
3056
|
* @date 2025-02-24 14:02:32
|
|
2836
3057
|
* @type {object}
|
|
2837
3058
|
*/
|
|
2838
|
-
|
|
3059
|
+
T(this, "params");
|
|
2839
3060
|
/**
|
|
2840
3061
|
* 应用实体标记
|
|
2841
3062
|
*
|
|
@@ -2843,7 +3064,7 @@ class At {
|
|
|
2843
3064
|
* @date 2025-02-24 14:02:10
|
|
2844
3065
|
* @type {string}
|
|
2845
3066
|
*/
|
|
2846
|
-
|
|
3067
|
+
T(this, "appDataEntityId");
|
|
2847
3068
|
/**
|
|
2848
3069
|
* 话题标识
|
|
2849
3070
|
*
|
|
@@ -2851,7 +3072,7 @@ class At {
|
|
|
2851
3072
|
* @date 2025-02-24 18:02:02
|
|
2852
3073
|
* @type {(string | undefined)}
|
|
2853
3074
|
*/
|
|
2854
|
-
|
|
3075
|
+
T(this, "topicId");
|
|
2855
3076
|
/**
|
|
2856
3077
|
* 话题数据
|
|
2857
3078
|
*
|
|
@@ -2859,7 +3080,7 @@ class At {
|
|
|
2859
3080
|
* @date 2025-03-10 16:03:26
|
|
2860
3081
|
* @type {(ITopic | undefined)}
|
|
2861
3082
|
*/
|
|
2862
|
-
|
|
3083
|
+
T(this, "topic");
|
|
2863
3084
|
this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.topic = e.topic, this.fecthHistory();
|
|
2864
3085
|
}
|
|
2865
3086
|
/**
|
|
@@ -2871,7 +3092,7 @@ class At {
|
|
|
2871
3092
|
*/
|
|
2872
3093
|
async fecthHistory() {
|
|
2873
3094
|
if (this.topicId) {
|
|
2874
|
-
const e = await
|
|
3095
|
+
const e = await V.getData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId);
|
|
2875
3096
|
if (e && e.data && e.data.length > 0)
|
|
2876
3097
|
return e.data.forEach((t) => {
|
|
2877
3098
|
const i = {
|
|
@@ -2880,6 +3101,7 @@ class At {
|
|
|
2880
3101
|
type: t.type,
|
|
2881
3102
|
role: t.role,
|
|
2882
3103
|
content: t.content,
|
|
3104
|
+
suggestions: t.suggestions,
|
|
2883
3105
|
completed: !0
|
|
2884
3106
|
};
|
|
2885
3107
|
this.addMessage(i);
|
|
@@ -2904,7 +3126,7 @@ class At {
|
|
|
2904
3126
|
data: this.messages.value.map((t) => t._origin),
|
|
2905
3127
|
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
2906
3128
|
};
|
|
2907
|
-
await
|
|
3129
|
+
await V.updateData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, e);
|
|
2908
3130
|
}
|
|
2909
3131
|
/**
|
|
2910
3132
|
* 设置聊天框值
|
|
@@ -2925,7 +3147,7 @@ class At {
|
|
|
2925
3147
|
*/
|
|
2926
3148
|
addMessage(e) {
|
|
2927
3149
|
const t = this.messages.value.find((i) => i.messageid === e.messageid);
|
|
2928
|
-
t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new
|
|
3150
|
+
t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new W(e)], this.asyncToIndexDB();
|
|
2929
3151
|
}
|
|
2930
3152
|
/**
|
|
2931
3153
|
* 更新消息完成状态
|
|
@@ -2948,7 +3170,11 @@ class At {
|
|
|
2948
3170
|
*/
|
|
2949
3171
|
replaceMessage(e) {
|
|
2950
3172
|
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2951
|
-
t !== -1 ? (this.messages.value[t] = new
|
|
3173
|
+
t !== -1 ? (this.messages.value[t] = new W(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new W(e)], this.asyncToIndexDB(), e.type === "DEFAULT" && this.opts.recommendPrompt && this.opts.recommendPrompt(this.context, this.params, {
|
|
3174
|
+
appDataEntityId: this.appDataEntityId
|
|
3175
|
+
}).then((i) => {
|
|
3176
|
+
i && i.content && this.updateRecommendPrompt(e, i.content);
|
|
3177
|
+
});
|
|
2952
3178
|
}
|
|
2953
3179
|
/**
|
|
2954
3180
|
* 终止消息
|
|
@@ -2961,9 +3187,9 @@ class At {
|
|
|
2961
3187
|
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2962
3188
|
if (t !== -1) {
|
|
2963
3189
|
const i = this.messages.value[t];
|
|
2964
|
-
e.content = i.content, this.messages.value[t] = new
|
|
3190
|
+
e.content = i.content, this.messages.value[t] = new W(e), this.messages.value = [...this.messages.value];
|
|
2965
3191
|
} else
|
|
2966
|
-
this.messages.value = [...this.messages.value, new
|
|
3192
|
+
this.messages.value = [...this.messages.value, new W(e)];
|
|
2967
3193
|
this.asyncToIndexDB();
|
|
2968
3194
|
}
|
|
2969
3195
|
/**
|
|
@@ -2982,7 +3208,7 @@ class At {
|
|
|
2982
3208
|
s.state && s.state === "successed" && t.push(i);
|
|
2983
3209
|
} else
|
|
2984
3210
|
t.push(i);
|
|
2985
|
-
}), this.materials.value = []), t && t.length > 0 && (e =
|
|
3211
|
+
}), this.materials.value = []), t && t.length > 0 && (e = tn.stringify(t)), e;
|
|
2986
3212
|
}
|
|
2987
3213
|
/**
|
|
2988
3214
|
* 提问
|
|
@@ -2993,11 +3219,14 @@ class At {
|
|
|
2993
3219
|
*/
|
|
2994
3220
|
async question(e) {
|
|
2995
3221
|
try {
|
|
2996
|
-
this.isLoading.value = !0
|
|
3222
|
+
this.isLoading.value = !0, this.messages.value.forEach((i, s) => {
|
|
3223
|
+
const o = i._origin;
|
|
3224
|
+
o.suggestions && (o.suggestions = void 0, this.messages.value[s] = new W(o));
|
|
3225
|
+
}), this.messages.value = [...this.messages.value], this.asyncToIndexDB();
|
|
2997
3226
|
let t = this.stringlyMaterialResource();
|
|
2998
3227
|
t ? t += "\n".concat(e) : t = e, this.addMessage({
|
|
2999
3228
|
state: 30,
|
|
3000
|
-
messageid:
|
|
3229
|
+
messageid: et(),
|
|
3001
3230
|
role: "USER",
|
|
3002
3231
|
type: "DEFAULT",
|
|
3003
3232
|
content: t
|
|
@@ -3076,18 +3305,27 @@ class At {
|
|
|
3076
3305
|
*/
|
|
3077
3306
|
copyMessage(e) {
|
|
3078
3307
|
const t = e.realcontent;
|
|
3079
|
-
|
|
3308
|
+
en.copy(t), this.opts.action && this.opts.action("copymsg", e);
|
|
3080
3309
|
}
|
|
3081
3310
|
/**
|
|
3082
|
-
*
|
|
3311
|
+
* 重置对话
|
|
3083
3312
|
*
|
|
3084
3313
|
* @memberof AiChatController
|
|
3085
3314
|
*/
|
|
3086
|
-
async
|
|
3087
|
-
this.topicId && await
|
|
3315
|
+
async resetTopic() {
|
|
3316
|
+
this.topicId && await V.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId), this.messages.value = [], this.opts.history(this.context, this.params, {
|
|
3088
3317
|
appDataEntityId: this.appDataEntityId
|
|
3089
3318
|
});
|
|
3090
3319
|
}
|
|
3320
|
+
/**
|
|
3321
|
+
* 清空对话
|
|
3322
|
+
*
|
|
3323
|
+
* @author tony001
|
|
3324
|
+
* @date 2025-03-18 17:03:57
|
|
3325
|
+
*/
|
|
3326
|
+
async clearTopic() {
|
|
3327
|
+
this.topicId && await V.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId), this.messages.value = [];
|
|
3328
|
+
}
|
|
3091
3329
|
/**
|
|
3092
3330
|
* 新增素材资源
|
|
3093
3331
|
*
|
|
@@ -3096,7 +3334,7 @@ class At {
|
|
|
3096
3334
|
* @param {IMaterial} data
|
|
3097
3335
|
*/
|
|
3098
3336
|
addMaterial(e) {
|
|
3099
|
-
this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new
|
|
3337
|
+
this.materials.value.find((i) => i.id === e.id) ? this.materials.value = [...this.materials.value] : this.materials.value = [...this.materials.value, new We(e)];
|
|
3100
3338
|
}
|
|
3101
3339
|
/**
|
|
3102
3340
|
* 替换素材资源
|
|
@@ -3108,7 +3346,7 @@ class At {
|
|
|
3108
3346
|
*/
|
|
3109
3347
|
replaceMaterial(e, t) {
|
|
3110
3348
|
const i = this.materials.value.findIndex((s) => s.id === e);
|
|
3111
|
-
i !== -1 ? (this.materials.value[i] = new
|
|
3349
|
+
i !== -1 ? (this.materials.value[i] = new We(t), this.materials.value = [...this.materials.value]) : this.materials.value = [...this.materials.value, new We(t)];
|
|
3112
3350
|
}
|
|
3113
3351
|
/**
|
|
3114
3352
|
* 删除指定素材资源
|
|
@@ -3121,8 +3359,66 @@ class At {
|
|
|
3121
3359
|
const t = this.materials.value.findIndex((i) => i.id === e.id);
|
|
3122
3360
|
t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
|
|
3123
3361
|
}
|
|
3362
|
+
/**
|
|
3363
|
+
* 更新指定消息推荐提示
|
|
3364
|
+
*
|
|
3365
|
+
* @author tony001
|
|
3366
|
+
* @date 2025-03-19 11:03:47
|
|
3367
|
+
* @param {IChatMessage} data
|
|
3368
|
+
* @param {string} suggestionStr
|
|
3369
|
+
*/
|
|
3370
|
+
updateRecommendPrompt(e, t) {
|
|
3371
|
+
if (!t)
|
|
3372
|
+
return;
|
|
3373
|
+
const i = this.messages.value.findIndex((o) => o.messageid === e.messageid), {
|
|
3374
|
+
suggestions: s
|
|
3375
|
+
} = Ln.parseMixedContent(t);
|
|
3376
|
+
s && s.length > 0 && (e.suggestions = s, i !== -1 ? (this.messages.value[i] = new W(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new W(e)], this.asyncToIndexDB());
|
|
3377
|
+
}
|
|
3378
|
+
/**
|
|
3379
|
+
* 处理建议点击
|
|
3380
|
+
*
|
|
3381
|
+
* @author tony001
|
|
3382
|
+
* @date 2025-03-19 12:03:25
|
|
3383
|
+
* @param {IChatMessage} message
|
|
3384
|
+
* @param {IChatSuggestion} suggestion
|
|
3385
|
+
* @param {MouseEvent} event
|
|
3386
|
+
* @return {*} {Promise<void>}
|
|
3387
|
+
*/
|
|
3388
|
+
async handleSuggestionClick(e, t, i) {
|
|
3389
|
+
const s = this.messages.value.findIndex((a) => a.messageid === e.messageid);
|
|
3390
|
+
if (s !== -1) {
|
|
3391
|
+
const a = this.messages.value[s]._origin;
|
|
3392
|
+
a.suggestions = void 0, this.messages.value[s] = new W(a), this.messages.value = [...this.messages.value];
|
|
3393
|
+
}
|
|
3394
|
+
this.asyncToIndexDB();
|
|
3395
|
+
const {
|
|
3396
|
+
type: o
|
|
3397
|
+
} = t;
|
|
3398
|
+
switch (o) {
|
|
3399
|
+
case "action":
|
|
3400
|
+
if (this.opts.extendToolbarClick) {
|
|
3401
|
+
const a = t.data.actionid;
|
|
3402
|
+
if (!a)
|
|
3403
|
+
throw new Error("actionid不能为空");
|
|
3404
|
+
if (this.opts.otherToolbarItems && this.opts.otherToolbarItems.length > 0) {
|
|
3405
|
+
const r = this.opts.otherToolbarItems.find((u) => u.id === a);
|
|
3406
|
+
if (!r)
|
|
3407
|
+
throw new Error("未找到".concat(a, "标识界面行为"));
|
|
3408
|
+
await this.opts.extendToolbarClick(i, r, this.context, this.params, e);
|
|
3409
|
+
} else
|
|
3410
|
+
throw new Error("未找到".concat(a, "标识界面行为"));
|
|
3411
|
+
}
|
|
3412
|
+
break;
|
|
3413
|
+
case "raw":
|
|
3414
|
+
await this.question(t.data.content);
|
|
3415
|
+
break;
|
|
3416
|
+
default:
|
|
3417
|
+
throw new Error("不支持".concat(o, "推荐类型"));
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3124
3420
|
}
|
|
3125
|
-
class
|
|
3421
|
+
class Wi {
|
|
3126
3422
|
/**
|
|
3127
3423
|
* Creates an instance of AiTopicController.
|
|
3128
3424
|
* @author tony001
|
|
@@ -3137,7 +3433,7 @@ class Oi {
|
|
|
3137
3433
|
* @date 2025-02-20 16:02:38
|
|
3138
3434
|
* @type {Signal<ChatTopic[]>}
|
|
3139
3435
|
*/
|
|
3140
|
-
|
|
3436
|
+
T(this, "topics", G([]));
|
|
3141
3437
|
/**
|
|
3142
3438
|
* 激活话题
|
|
3143
3439
|
*
|
|
@@ -3145,7 +3441,7 @@ class Oi {
|
|
|
3145
3441
|
* @date 2025-02-24 16:02:44
|
|
3146
3442
|
* @type {(Signal<ITopic | null>)}
|
|
3147
3443
|
*/
|
|
3148
|
-
|
|
3444
|
+
T(this, "activedTopic", G(null));
|
|
3149
3445
|
/**
|
|
3150
3446
|
* 当前话题配置备份
|
|
3151
3447
|
*
|
|
@@ -3154,7 +3450,7 @@ class Oi {
|
|
|
3154
3450
|
* @public
|
|
3155
3451
|
* @type {(ITopicOptions | undefined)}
|
|
3156
3452
|
*/
|
|
3157
|
-
|
|
3453
|
+
T(this, "currentTopicOptions");
|
|
3158
3454
|
this.chat = e;
|
|
3159
3455
|
}
|
|
3160
3456
|
/**
|
|
@@ -3167,7 +3463,7 @@ class Oi {
|
|
|
3167
3463
|
async fetchHistory(e) {
|
|
3168
3464
|
const i = await e.configService(e.appid, "aitopics", e.type).load();
|
|
3169
3465
|
i && i.length > 0 && i.forEach((s) => {
|
|
3170
|
-
this.topics.value = [...this.topics.value, new
|
|
3466
|
+
this.topics.value = [...this.topics.value, new he(s)];
|
|
3171
3467
|
});
|
|
3172
3468
|
}
|
|
3173
3469
|
/**
|
|
@@ -3180,15 +3476,16 @@ class Oi {
|
|
|
3180
3476
|
*/
|
|
3181
3477
|
async updateCurrentTopic(e) {
|
|
3182
3478
|
this.currentTopicOptions = e;
|
|
3183
|
-
const t = this.topics.value.findIndex((
|
|
3184
|
-
t !== -1 ? this.topics.value.splice(t, 1, new
|
|
3185
|
-
const s = this.topics.value.map((
|
|
3186
|
-
appid:
|
|
3187
|
-
id:
|
|
3188
|
-
type:
|
|
3189
|
-
caption:
|
|
3190
|
-
|
|
3191
|
-
|
|
3479
|
+
const t = this.topics.value.findIndex((a) => a.id === e.id), i = new he(e);
|
|
3480
|
+
t !== -1 ? this.topics.value.splice(t, 1, new he(e)) : this.topics.value = [...this.topics.value, new he(e)];
|
|
3481
|
+
const s = this.topics.value.map((a) => ({
|
|
3482
|
+
appid: a.appid,
|
|
3483
|
+
id: a.id,
|
|
3484
|
+
type: a.type,
|
|
3485
|
+
caption: a.caption,
|
|
3486
|
+
sourceCaption: a.sourceCaption,
|
|
3487
|
+
url: a.url,
|
|
3488
|
+
aiChat: a.aiChat
|
|
3192
3489
|
})), o = e.configService(e.appid, "aitopics", e.type);
|
|
3193
3490
|
await (o == null ? void 0 : o.save(s)), this.activedTopic.value = i;
|
|
3194
3491
|
}
|
|
@@ -3205,21 +3502,42 @@ class Oi {
|
|
|
3205
3502
|
* @return {*} {Promise<void>}
|
|
3206
3503
|
*/
|
|
3207
3504
|
async removeTopic(e, t, i, s, o) {
|
|
3208
|
-
var
|
|
3209
|
-
let
|
|
3210
|
-
if (e.beforeDelete && (
|
|
3505
|
+
var p;
|
|
3506
|
+
let a = !0;
|
|
3507
|
+
if (e.beforeDelete && (a = await e.beforeDelete(t, i, s, o)), !a)
|
|
3211
3508
|
return;
|
|
3212
|
-
const
|
|
3213
|
-
|
|
3509
|
+
const r = this.topics.value.findIndex((l) => l.id === s.id);
|
|
3510
|
+
r !== -1 && (this.topics.value.splice(r, 1), this.topics.value = [...this.topics.value]);
|
|
3214
3511
|
const u = this.topics.value.map((l) => ({
|
|
3215
3512
|
appid: l.appid,
|
|
3216
3513
|
id: l.id,
|
|
3217
3514
|
type: l.type,
|
|
3218
3515
|
caption: l.caption,
|
|
3516
|
+
sourceCaption: l.sourceCaption,
|
|
3219
3517
|
url: l.url,
|
|
3220
3518
|
aiChat: l.aiChat
|
|
3221
|
-
})),
|
|
3222
|
-
await (
|
|
3519
|
+
})), h = e.configService(e.appid, "aitopics", e.type);
|
|
3520
|
+
await (h == null ? void 0 : h.save(u)), await V.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((p = this.activedTopic.value) == null ? void 0 : p.id) && this.handleTopicChange(this.topics.value[0]);
|
|
3521
|
+
}
|
|
3522
|
+
/**
|
|
3523
|
+
* 更新话题数据
|
|
3524
|
+
*
|
|
3525
|
+
* @param {ITopicOptions} options 话题配置
|
|
3526
|
+
* @param {ChatTopic} _data 话题数据
|
|
3527
|
+
* @return {*} {Promise<void>}
|
|
3528
|
+
* @memberof AiTopicController
|
|
3529
|
+
*/
|
|
3530
|
+
async updateTopic(e, t) {
|
|
3531
|
+
const i = this.topics.value.map((o) => ({
|
|
3532
|
+
appid: o.appid,
|
|
3533
|
+
id: o.id,
|
|
3534
|
+
type: o.type,
|
|
3535
|
+
caption: o.caption,
|
|
3536
|
+
sourceCaption: o.sourceCaption,
|
|
3537
|
+
url: o.url,
|
|
3538
|
+
aiChat: o.aiChat
|
|
3539
|
+
})), s = e.configService(e.appid, "aitopics", e.type);
|
|
3540
|
+
await (s == null ? void 0 : s.save(i));
|
|
3223
3541
|
}
|
|
3224
3542
|
/**
|
|
3225
3543
|
* 处理选中变化
|
|
@@ -3243,23 +3561,58 @@ class Oi {
|
|
|
3243
3561
|
* @return {*} {Promise<void>}
|
|
3244
3562
|
*/
|
|
3245
3563
|
async handleTopicAction(e, t, i) {
|
|
3246
|
-
var o,
|
|
3247
|
-
const s = this.topics.value.find((
|
|
3564
|
+
var o, a;
|
|
3565
|
+
const s = this.topics.value.find((r) => r.id === t.id);
|
|
3248
3566
|
if (this.currentTopicOptions && s && s.aiChat) {
|
|
3249
3567
|
const {
|
|
3250
|
-
context:
|
|
3568
|
+
context: r,
|
|
3251
3569
|
params: u
|
|
3252
3570
|
} = s.aiChat;
|
|
3253
|
-
e === "DELETE"
|
|
3571
|
+
e === "DELETE" ? await this.removeTopic(this.currentTopicOptions, r, u, s, i) : e === "RENAME" && await this.updateTopic(this.currentTopicOptions, t), (a = (o = this.currentTopicOptions).action) == null || a.call(o, e, r, u, t, i);
|
|
3254
3572
|
}
|
|
3255
3573
|
}
|
|
3574
|
+
/**
|
|
3575
|
+
* 新建对话
|
|
3576
|
+
*
|
|
3577
|
+
* @author tony001
|
|
3578
|
+
* @date 2025-03-18 18:03:49
|
|
3579
|
+
* @return {*} {Promise<void>}
|
|
3580
|
+
*/
|
|
3581
|
+
async newTopic() {
|
|
3582
|
+
var u, h;
|
|
3583
|
+
const e = this.activedTopic.value;
|
|
3584
|
+
if (!e)
|
|
3585
|
+
return;
|
|
3586
|
+
const t = e.id.split("@")[0], i = this.topics.value.filter((p) => p.id.startsWith(t)), s = {
|
|
3587
|
+
appid: e.appid,
|
|
3588
|
+
// 源头数据id@当前时间戳
|
|
3589
|
+
id: "".concat(t, "@").concat(Date.now()),
|
|
3590
|
+
type: e.type,
|
|
3591
|
+
// 源头数据标题_当前话题数量(这儿源头数据可能已经被删除)
|
|
3592
|
+
caption: "".concat((u = e.sourceCaption) == null ? void 0 : u.split("_")[0], "_").concat(i.length),
|
|
3593
|
+
sourceCaption: e.sourceCaption,
|
|
3594
|
+
url: e.url,
|
|
3595
|
+
aiChat: e.aiChat
|
|
3596
|
+
}, o = new he(s);
|
|
3597
|
+
this.topics.value = [...this.topics.value, o];
|
|
3598
|
+
const a = this.topics.value.map((p) => ({
|
|
3599
|
+
appid: p.appid,
|
|
3600
|
+
id: p.id,
|
|
3601
|
+
type: p.type,
|
|
3602
|
+
caption: p.caption,
|
|
3603
|
+
sourceCaption: p.sourceCaption,
|
|
3604
|
+
url: p.url,
|
|
3605
|
+
aiChat: p.aiChat
|
|
3606
|
+
})), r = (h = this.currentTopicOptions) == null ? void 0 : h.configService(s.appid, "aitopics", s.type);
|
|
3607
|
+
await (r == null ? void 0 : r.save(a)), this.handleTopicChange(o);
|
|
3608
|
+
}
|
|
3256
3609
|
}
|
|
3257
|
-
class
|
|
3610
|
+
class yn {
|
|
3258
3611
|
constructor(e) {
|
|
3259
3612
|
this.aiChat = e;
|
|
3260
3613
|
}
|
|
3261
3614
|
}
|
|
3262
|
-
class
|
|
3615
|
+
class Vi extends yn {
|
|
3263
3616
|
/**
|
|
3264
3617
|
* 执行操作
|
|
3265
3618
|
*
|
|
@@ -3288,7 +3641,7 @@ class Bi extends wn {
|
|
|
3288
3641
|
}
|
|
3289
3642
|
}
|
|
3290
3643
|
}
|
|
3291
|
-
class
|
|
3644
|
+
class qi extends yn {
|
|
3292
3645
|
/**
|
|
3293
3646
|
* 执行操作
|
|
3294
3647
|
*
|
|
@@ -3300,60 +3653,60 @@ class Pi extends wn {
|
|
|
3300
3653
|
const i = this.aiChat.opts.uploader, {
|
|
3301
3654
|
multiple: s,
|
|
3302
3655
|
accept: o,
|
|
3303
|
-
maxSize:
|
|
3304
|
-
onSelect:
|
|
3656
|
+
maxSize: a,
|
|
3657
|
+
onSelect: r,
|
|
3305
3658
|
onUpload: u,
|
|
3306
|
-
onSuccess:
|
|
3307
|
-
onError:
|
|
3659
|
+
onSuccess: h,
|
|
3660
|
+
onError: p,
|
|
3308
3661
|
onProgress: l
|
|
3309
|
-
} = i,
|
|
3662
|
+
} = i, v = {
|
|
3310
3663
|
multiple: s || !0,
|
|
3311
3664
|
accept: o || "*/*",
|
|
3312
|
-
maxSize:
|
|
3313
|
-
onSelect: (
|
|
3314
|
-
|
|
3315
|
-
const
|
|
3316
|
-
Object.assign(
|
|
3665
|
+
maxSize: a || 5 * 1024 * 1024,
|
|
3666
|
+
onSelect: (d) => {
|
|
3667
|
+
r == null || r(d), d.length > 0 && d.forEach((f) => {
|
|
3668
|
+
const _ = this.buildMaterialObject(f);
|
|
3669
|
+
Object.assign(_.metadata, {
|
|
3317
3670
|
state: "uploading"
|
|
3318
|
-
}), this.aiChat.addMaterial(
|
|
3671
|
+
}), this.aiChat.addMaterial(_);
|
|
3319
3672
|
});
|
|
3320
3673
|
},
|
|
3321
|
-
onUpload: async (
|
|
3674
|
+
onUpload: async (d, f) => u(d, f, {
|
|
3322
3675
|
context: this.aiChat.context,
|
|
3323
3676
|
params: this.aiChat.params
|
|
3324
3677
|
}),
|
|
3325
3678
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3326
|
-
onSuccess: (
|
|
3327
|
-
const
|
|
3328
|
-
id:
|
|
3679
|
+
onSuccess: (d, f) => {
|
|
3680
|
+
const _ = {
|
|
3681
|
+
id: d.id,
|
|
3329
3682
|
type: "ossfile",
|
|
3330
3683
|
data: {
|
|
3331
|
-
id:
|
|
3332
|
-
name:
|
|
3684
|
+
id: d.id,
|
|
3685
|
+
name: d.name
|
|
3333
3686
|
},
|
|
3334
3687
|
metadata: {
|
|
3335
|
-
ext:
|
|
3336
|
-
fileext:
|
|
3337
|
-
fileid:
|
|
3338
|
-
filename:
|
|
3339
|
-
size:
|
|
3340
|
-
filesize:
|
|
3688
|
+
ext: d.ext,
|
|
3689
|
+
fileext: d.fileext,
|
|
3690
|
+
fileid: d.fileid,
|
|
3691
|
+
filename: d.filename,
|
|
3692
|
+
size: d.size,
|
|
3693
|
+
filesize: d.filesize,
|
|
3341
3694
|
state: "successed"
|
|
3342
3695
|
}
|
|
3343
3696
|
};
|
|
3344
|
-
this.aiChat.replaceMaterial(
|
|
3697
|
+
this.aiChat.replaceMaterial(f.name, _), h == null || h(d, f);
|
|
3345
3698
|
},
|
|
3346
|
-
onError: (
|
|
3347
|
-
const
|
|
3348
|
-
Object.assign(
|
|
3699
|
+
onError: (d, f) => {
|
|
3700
|
+
const _ = this.buildMaterialObject(f);
|
|
3701
|
+
Object.assign(_.metadata, {
|
|
3349
3702
|
state: "failed"
|
|
3350
|
-
}), this.aiChat.replaceMaterial(
|
|
3703
|
+
}), this.aiChat.replaceMaterial(f.name, _), p == null || p(d, f);
|
|
3351
3704
|
},
|
|
3352
|
-
onProgress: (
|
|
3353
|
-
l == null || l(
|
|
3705
|
+
onProgress: (d, f) => {
|
|
3706
|
+
l == null || l(d, f);
|
|
3354
3707
|
}
|
|
3355
3708
|
};
|
|
3356
|
-
new zn(
|
|
3709
|
+
new zn(v).openFilePicker();
|
|
3357
3710
|
}
|
|
3358
3711
|
/**
|
|
3359
3712
|
* 构建素材对象
|
|
@@ -3379,17 +3732,17 @@ class Pi extends wn {
|
|
|
3379
3732
|
};
|
|
3380
3733
|
}
|
|
3381
3734
|
}
|
|
3382
|
-
class
|
|
3735
|
+
class zt {
|
|
3383
3736
|
static getMaterialHelper(e, t) {
|
|
3384
3737
|
switch (e) {
|
|
3385
3738
|
case "ossfile":
|
|
3386
|
-
return new
|
|
3739
|
+
return new qi(t);
|
|
3387
3740
|
default:
|
|
3388
|
-
return new
|
|
3741
|
+
return new Vi(t);
|
|
3389
3742
|
}
|
|
3390
3743
|
}
|
|
3391
3744
|
}
|
|
3392
|
-
class
|
|
3745
|
+
class ji {
|
|
3393
3746
|
/**
|
|
3394
3747
|
* Creates an instance of ChatController.
|
|
3395
3748
|
* @author tony001
|
|
@@ -3404,7 +3757,7 @@ class Ri {
|
|
|
3404
3757
|
* @protected
|
|
3405
3758
|
* @type {HTMLDivElement}
|
|
3406
3759
|
*/
|
|
3407
|
-
|
|
3760
|
+
T(this, "container");
|
|
3408
3761
|
/**
|
|
3409
3762
|
* 默认模式(聊天框)和话题模式(支持多话题切换),聊天框为默认模式
|
|
3410
3763
|
*
|
|
@@ -3413,7 +3766,7 @@ class Ri {
|
|
|
3413
3766
|
* @protected
|
|
3414
3767
|
* @type {('DEFAULT' | 'TOPIC')}
|
|
3415
3768
|
*/
|
|
3416
|
-
|
|
3769
|
+
T(this, "mode", "DEFAULT");
|
|
3417
3770
|
/**
|
|
3418
3771
|
* 是否挂载ai话题
|
|
3419
3772
|
*
|
|
@@ -3422,7 +3775,7 @@ class Ri {
|
|
|
3422
3775
|
* @protected
|
|
3423
3776
|
* @type {boolean}
|
|
3424
3777
|
*/
|
|
3425
|
-
|
|
3778
|
+
T(this, "isMountedAiTopic", !1);
|
|
3426
3779
|
/**
|
|
3427
3780
|
* 容器配置备份
|
|
3428
3781
|
*
|
|
@@ -3431,7 +3784,7 @@ class Ri {
|
|
|
3431
3784
|
* @protected
|
|
3432
3785
|
* @type {(IContainerOptions | undefined)}
|
|
3433
3786
|
*/
|
|
3434
|
-
|
|
3787
|
+
T(this, "backupChatOptions");
|
|
3435
3788
|
/**
|
|
3436
3789
|
* 话题控制器
|
|
3437
3790
|
*
|
|
@@ -3440,7 +3793,7 @@ class Ri {
|
|
|
3440
3793
|
* @public
|
|
3441
3794
|
* @type {AiTopicController}
|
|
3442
3795
|
*/
|
|
3443
|
-
|
|
3796
|
+
T(this, "aiTopic");
|
|
3444
3797
|
/**
|
|
3445
3798
|
* 话题map
|
|
3446
3799
|
*
|
|
@@ -3448,8 +3801,8 @@ class Ri {
|
|
|
3448
3801
|
* @type {Map<string, AiChatController>}
|
|
3449
3802
|
* @memberof ChatController
|
|
3450
3803
|
*/
|
|
3451
|
-
|
|
3452
|
-
this.aiTopic = new
|
|
3804
|
+
T(this, "aiTopicMap", /* @__PURE__ */ new Map());
|
|
3805
|
+
this.aiTopic = new Wi(this);
|
|
3453
3806
|
}
|
|
3454
3807
|
/**
|
|
3455
3808
|
* 聊天控制器
|
|
@@ -3470,7 +3823,7 @@ class Ri {
|
|
|
3470
3823
|
* @return {*} {Promise<void>}
|
|
3471
3824
|
*/
|
|
3472
3825
|
async initIndexDB() {
|
|
3473
|
-
await
|
|
3826
|
+
await V.checkTableExists(N.DATA_BASE_NAME, N.DATA_TABLE_NAME) || await V.createTable(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, N.DATA_TABLE_KEY_NAME, !1);
|
|
3474
3827
|
}
|
|
3475
3828
|
/**
|
|
3476
3829
|
* 创建聊天窗口(会同时显示出来)
|
|
@@ -3493,14 +3846,15 @@ class Ri {
|
|
|
3493
3846
|
appDataEntityId: t.appDataEntityId,
|
|
3494
3847
|
contentToolbarItems: t.contentToolbarItems,
|
|
3495
3848
|
footerToolbarItems: t.footerToolbarItems,
|
|
3496
|
-
questionToolbarItems: t.questionToolbarItems
|
|
3849
|
+
questionToolbarItems: t.questionToolbarItems,
|
|
3850
|
+
otherToolbarItems: t.otherToolbarItems
|
|
3497
3851
|
}
|
|
3498
3852
|
}), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
|
|
3499
3853
|
topicId: i == null ? void 0 : i.id,
|
|
3500
3854
|
topic: i
|
|
3501
3855
|
});
|
|
3502
|
-
const s = new
|
|
3503
|
-
return this.aiTopicMap.set("".concat(i == null ? void 0 : i.id), s), se(
|
|
3856
|
+
const s = new Dt(t);
|
|
3857
|
+
return this.aiTopicMap.set("".concat(i == null ? void 0 : i.id), s), se(q(Ot, {
|
|
3504
3858
|
aiChat: s,
|
|
3505
3859
|
aiTopic: this.aiTopic,
|
|
3506
3860
|
mode: e.mode ? e.mode : "DEFAULT",
|
|
@@ -3513,11 +3867,11 @@ class Ri {
|
|
|
3513
3867
|
close: () => {
|
|
3514
3868
|
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3515
3869
|
},
|
|
3516
|
-
fullscreen: (
|
|
3517
|
-
t.fullscreen && t.fullscreen(
|
|
3870
|
+
fullscreen: (a) => {
|
|
3871
|
+
t.fullscreen && t.fullscreen(a, t.context, t.params);
|
|
3518
3872
|
},
|
|
3519
|
-
minimize: (
|
|
3520
|
-
t.minimize && t.minimize(
|
|
3873
|
+
minimize: (a) => {
|
|
3874
|
+
t.minimize && t.minimize(a, t.context, t.params);
|
|
3521
3875
|
}
|
|
3522
3876
|
}), this.container), s;
|
|
3523
3877
|
}
|
|
@@ -3529,7 +3883,7 @@ class Ri {
|
|
|
3529
3883
|
* @param {ChatTopic} topic
|
|
3530
3884
|
*/
|
|
3531
3885
|
switchAiChatController(e) {
|
|
3532
|
-
var s, o,
|
|
3886
|
+
var s, o, a, r, u;
|
|
3533
3887
|
const t = {
|
|
3534
3888
|
...this.backupChatOptions.chatOptions
|
|
3535
3889
|
};
|
|
@@ -3540,30 +3894,32 @@ class Ri {
|
|
|
3540
3894
|
contentToolbarItems: e.aiChat.contentToolbarItems,
|
|
3541
3895
|
footerToolbarItems: e.aiChat.footerToolbarItems,
|
|
3542
3896
|
questionToolbarItems: e.aiChat.questionToolbarItems,
|
|
3897
|
+
otherToolbarItems: e.aiChat.otherToolbarItems,
|
|
3543
3898
|
appDataEntityId: e.aiChat.appDataEntityId,
|
|
3544
3899
|
topicId: e.id,
|
|
3545
3900
|
topic: e,
|
|
3546
|
-
extendToolbarClick: this.backupChatOptions.chatOptions.extendToolbarClick
|
|
3901
|
+
extendToolbarClick: this.backupChatOptions.chatOptions.extendToolbarClick,
|
|
3902
|
+
recommendPrompt: this.backupChatOptions.chatOptions.recommendPrompt
|
|
3547
3903
|
});
|
|
3548
3904
|
let i;
|
|
3549
|
-
this.aiTopicMap.has("".concat(e.id)) ? i = this.aiTopicMap.get("".concat(e.id)) : (i = new
|
|
3905
|
+
this.aiTopicMap.has("".concat(e.id)) ? i = this.aiTopicMap.get("".concat(e.id)) : (i = new Dt(t), this.aiTopicMap.set("".concat(e.id), i)), this.container && (se(null, this.container), se(q(Ot, {
|
|
3550
3906
|
aiChat: i,
|
|
3551
3907
|
aiTopic: this.aiTopic,
|
|
3552
3908
|
mode: (s = this.backupChatOptions) != null && s.mode ? this.backupChatOptions.mode : "DEFAULT",
|
|
3553
3909
|
containerOptions: (o = this.backupChatOptions) == null ? void 0 : o.containerOptions,
|
|
3554
|
-
caption: (
|
|
3555
|
-
enableBackFill: (u = (
|
|
3910
|
+
caption: (a = this.backupChatOptions) != null && a.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3911
|
+
enableBackFill: (u = (r = this.backupChatOptions) == null ? void 0 : r.containerOptions) == null ? void 0 : u.enableBackFill,
|
|
3556
3912
|
contentToolbarItems: t.contentToolbarItems,
|
|
3557
3913
|
footerToolbarItems: t.footerToolbarItems,
|
|
3558
3914
|
questionToolbarItems: t.questionToolbarItems,
|
|
3559
3915
|
close: () => {
|
|
3560
3916
|
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3561
3917
|
},
|
|
3562
|
-
fullscreen: (
|
|
3563
|
-
t.fullscreen && t.fullscreen(
|
|
3918
|
+
fullscreen: (h) => {
|
|
3919
|
+
t.fullscreen && t.fullscreen(h, t.context, t.params);
|
|
3564
3920
|
},
|
|
3565
|
-
minimize: (
|
|
3566
|
-
t.minimize && t.minimize(
|
|
3921
|
+
minimize: (h) => {
|
|
3922
|
+
t.minimize && t.minimize(h, t.context, t.params);
|
|
3567
3923
|
}
|
|
3568
3924
|
}), this.container));
|
|
3569
3925
|
}
|
|
@@ -3595,12 +3951,12 @@ class Ri {
|
|
|
3595
3951
|
this.container && (se(null, this.container), this.container.remove(), this.container = void 0);
|
|
3596
3952
|
}
|
|
3597
3953
|
}
|
|
3598
|
-
const
|
|
3599
|
-
const
|
|
3954
|
+
const ns = new ji();
|
|
3955
|
+
const Yi = new M("chat-input-material"), Xi = (n) => {
|
|
3600
3956
|
const e = n.controller.materials;
|
|
3601
3957
|
return c("div", {
|
|
3602
|
-
className:
|
|
3603
|
-
children: e.value.map((t) => c(
|
|
3958
|
+
className: Yi.b(),
|
|
3959
|
+
children: e.value.map((t) => c(mn, {
|
|
3604
3960
|
material: t,
|
|
3605
3961
|
disabled: !1,
|
|
3606
3962
|
controller: n.controller
|
|
@@ -3615,136 +3971,133 @@ const bn = ({
|
|
|
3615
3971
|
position: i = "bottom",
|
|
3616
3972
|
isOpen: s,
|
|
3617
3973
|
onToggleOpen: o,
|
|
3618
|
-
onAction:
|
|
3974
|
+
onAction: a
|
|
3619
3975
|
// 接收行为事件回调
|
|
3620
3976
|
}) => {
|
|
3621
|
-
const
|
|
3622
|
-
|
|
3623
|
-
s !== void 0 &&
|
|
3624
|
-
}, [s]),
|
|
3625
|
-
|
|
3626
|
-
}), []),
|
|
3627
|
-
const
|
|
3628
|
-
l.current && !l.current.contains(
|
|
3977
|
+
const r = new M("pop"), u = on(ot), [h, p] = ce(s || !1), l = R(null), v = R(null);
|
|
3978
|
+
H(() => {
|
|
3979
|
+
s !== void 0 && p(s);
|
|
3980
|
+
}, [s]), H(() => (v.current || (v.current = document.createElement("div"), v.current.className = r.b("content-container"), document.body.appendChild(v.current)), () => {
|
|
3981
|
+
v.current && document.body.removeChild(v.current);
|
|
3982
|
+
}), []), H(() => {
|
|
3983
|
+
const d = (f) => {
|
|
3984
|
+
l.current && !l.current.contains(f.target) && !f.target.closest(".".concat(r.b())) && !f.target.closest(".ibiz-quick-edit") && !f.target.closest(".ibiz-picker__transfer") && (p(!1), o == null || o(!1));
|
|
3629
3985
|
};
|
|
3630
|
-
return
|
|
3631
|
-
document.removeEventListener("mousedown",
|
|
3986
|
+
return h && document.addEventListener("mousedown", d), () => {
|
|
3987
|
+
document.removeEventListener("mousedown", d);
|
|
3632
3988
|
};
|
|
3633
|
-
}, [
|
|
3989
|
+
}, [h, o]);
|
|
3634
3990
|
const g = () => {
|
|
3635
3991
|
if (!l.current)
|
|
3636
3992
|
return {};
|
|
3637
|
-
const
|
|
3993
|
+
const d = l.current.getBoundingClientRect(), f = {
|
|
3638
3994
|
position: "absolute",
|
|
3639
3995
|
zIndex: u.zIndex + 1
|
|
3640
|
-
},
|
|
3996
|
+
}, _ = {
|
|
3641
3997
|
bottom: {
|
|
3642
|
-
top:
|
|
3643
|
-
left:
|
|
3998
|
+
top: d.bottom + window.scrollY,
|
|
3999
|
+
left: d.left + window.scrollX
|
|
3644
4000
|
},
|
|
3645
4001
|
top: {
|
|
3646
|
-
bottom: window.innerHeight -
|
|
3647
|
-
left:
|
|
4002
|
+
bottom: window.innerHeight - d.top + window.scrollY,
|
|
4003
|
+
left: d.left + window.scrollX
|
|
3648
4004
|
},
|
|
3649
4005
|
left: {
|
|
3650
|
-
top:
|
|
3651
|
-
right: window.innerWidth -
|
|
4006
|
+
top: d.top + window.scrollY,
|
|
4007
|
+
right: window.innerWidth - d.left + window.scrollX
|
|
3652
4008
|
},
|
|
3653
4009
|
right: {
|
|
3654
|
-
top:
|
|
3655
|
-
left:
|
|
4010
|
+
top: d.top + window.scrollY,
|
|
4011
|
+
left: d.right + window.scrollX
|
|
3656
4012
|
},
|
|
3657
4013
|
"top-left": {
|
|
3658
|
-
bottom: window.innerHeight -
|
|
3659
|
-
right: window.innerWidth -
|
|
4014
|
+
bottom: window.innerHeight - d.top + window.scrollY,
|
|
4015
|
+
right: window.innerWidth - d.left + window.scrollX
|
|
3660
4016
|
}
|
|
3661
4017
|
};
|
|
3662
4018
|
return {
|
|
3663
|
-
...
|
|
3664
|
-
...
|
|
4019
|
+
...f,
|
|
4020
|
+
..._[i]
|
|
3665
4021
|
};
|
|
3666
4022
|
};
|
|
3667
4023
|
return c("span", {
|
|
3668
|
-
className: "".concat(
|
|
4024
|
+
className: "".concat(r.b("trigger-container")),
|
|
3669
4025
|
children: [c("span", {
|
|
3670
|
-
className: "".concat(
|
|
4026
|
+
className: "".concat(r.b("trigger-element")),
|
|
3671
4027
|
ref: l,
|
|
3672
|
-
onClick: (
|
|
3673
|
-
|
|
3674
|
-
const
|
|
3675
|
-
|
|
4028
|
+
onClick: (d) => {
|
|
4029
|
+
d.stopPropagation();
|
|
4030
|
+
const f = !h;
|
|
4031
|
+
p(f), o == null || o(f);
|
|
3676
4032
|
},
|
|
3677
4033
|
children: n
|
|
3678
|
-
}),
|
|
3679
|
-
className: "".concat(
|
|
4034
|
+
}), h && v.current && $i(c("div", {
|
|
4035
|
+
className: "".concat(r.b(), " pop-").concat(i),
|
|
3680
4036
|
style: g(),
|
|
3681
|
-
children: t || (e == null ? void 0 : e.map((
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
4037
|
+
children: t || (e == null ? void 0 : e.map((d) => c("div", {
|
|
4038
|
+
title: d.caption,
|
|
4039
|
+
className: r.e("item"),
|
|
4040
|
+
onMouseDown: (f) => {
|
|
4041
|
+
f.stopPropagation(), a == null || a(d.id, f);
|
|
3685
4042
|
},
|
|
3686
|
-
children: [
|
|
3687
|
-
className:
|
|
3688
|
-
|
|
3689
|
-
alt: h.caption
|
|
3690
|
-
}), c("div", {
|
|
3691
|
-
className: a.b("content-item__caption"),
|
|
3692
|
-
children: h.caption
|
|
4043
|
+
children: [d.icon, c("div", {
|
|
4044
|
+
className: r.em("item", "caption"),
|
|
4045
|
+
children: d.caption
|
|
3693
4046
|
})]
|
|
3694
|
-
},
|
|
3695
|
-
}),
|
|
4047
|
+
}, d.id)))
|
|
4048
|
+
}), v.current)]
|
|
3696
4049
|
});
|
|
3697
|
-
},
|
|
3698
|
-
var
|
|
3699
|
-
const [e, t] =
|
|
3700
|
-
|
|
4050
|
+
}, $ = new M("chat-input"), Lt = window.SpeechRecognition || window.webkitSpeechRecognition, Ht = (n) => {
|
|
4051
|
+
var f;
|
|
4052
|
+
const [e, t] = ce(!1), i = R(null), s = n.controller.input, o = z(!1), a = R();
|
|
4053
|
+
Lt && !a.current && (a.current = new Lt(), a.current.onstart = () => {
|
|
3701
4054
|
o.value = !0;
|
|
3702
|
-
},
|
|
4055
|
+
}, a.current.onend = () => {
|
|
3703
4056
|
o.value = !1;
|
|
3704
|
-
},
|
|
3705
|
-
var
|
|
3706
|
-
const m = (C = (
|
|
4057
|
+
}, a.current.onresult = (_) => {
|
|
4058
|
+
var b, x, C;
|
|
4059
|
+
const m = (C = (x = (b = _.results) == null ? void 0 : b[0]) == null ? void 0 : x[0]) == null ? void 0 : C.transcript;
|
|
3707
4060
|
m && (s.value = "".concat(s.value).concat(m));
|
|
3708
4061
|
});
|
|
3709
|
-
const
|
|
3710
|
-
|
|
3711
|
-
}, u =
|
|
3712
|
-
s.value =
|
|
3713
|
-
}, [s]),
|
|
3714
|
-
|
|
4062
|
+
const r = () => {
|
|
4063
|
+
a.current && !o.value && a.current.start();
|
|
4064
|
+
}, u = Be((_) => {
|
|
4065
|
+
s.value = _.target.value;
|
|
4066
|
+
}, [s]), h = L(() => s.value.length <= 0);
|
|
4067
|
+
H(() => (i.current && It(i.current), () => {
|
|
3715
4068
|
i.current && It.destroy(i.current);
|
|
3716
4069
|
}), [i]);
|
|
3717
|
-
const
|
|
4070
|
+
const p = Be(async () => {
|
|
3718
4071
|
try {
|
|
3719
|
-
const
|
|
3720
|
-
s.value = "", await n.controller.question(
|
|
3721
|
-
} catch (
|
|
3722
|
-
console.error(
|
|
4072
|
+
const _ = s.value;
|
|
4073
|
+
s.value = "", await n.controller.question(_);
|
|
4074
|
+
} catch (_) {
|
|
4075
|
+
console.error(_);
|
|
3723
4076
|
}
|
|
3724
|
-
}, [s]), l =
|
|
4077
|
+
}, [s]), l = Be(async () => {
|
|
3725
4078
|
try {
|
|
3726
4079
|
n.controller.abortQuestion();
|
|
3727
|
-
} catch (
|
|
3728
|
-
console.error(
|
|
4080
|
+
} catch (_) {
|
|
4081
|
+
console.error(_);
|
|
3729
4082
|
}
|
|
3730
|
-
}, [s]),
|
|
3731
|
-
|
|
3732
|
-
}, g = async (
|
|
3733
|
-
await
|
|
3734
|
-
},
|
|
3735
|
-
await
|
|
4083
|
+
}, [s]), v = (_) => {
|
|
4084
|
+
_.code === "Enter" && !_.isComposing && (_.stopPropagation(), _.shiftKey === !1 && p());
|
|
4085
|
+
}, g = async (_) => {
|
|
4086
|
+
await zt.getMaterialHelper("ossfile", n.controller).excuteAction(_), t(!1);
|
|
4087
|
+
}, d = async (_, m) => {
|
|
4088
|
+
await zt.getMaterialHelper("common", n.controller).excuteAction(_, m), t(!1);
|
|
3736
4089
|
};
|
|
3737
4090
|
return c("div", {
|
|
3738
|
-
className:
|
|
4091
|
+
className: $.b("wrapper"),
|
|
3739
4092
|
children: [c("div", {
|
|
3740
|
-
className:
|
|
3741
|
-
children: c(
|
|
4093
|
+
className: $.b("material-wrapper"),
|
|
4094
|
+
children: c(Xi, {
|
|
3742
4095
|
controller: n.controller
|
|
3743
4096
|
})
|
|
3744
4097
|
}), c("div", {
|
|
3745
|
-
className:
|
|
4098
|
+
className: $.b("main-wrapper"),
|
|
3746
4099
|
children: [c("textarea", {
|
|
3747
|
-
className:
|
|
4100
|
+
className: $.e("textarea"),
|
|
3748
4101
|
type: "text",
|
|
3749
4102
|
rows: 6,
|
|
3750
4103
|
autoCorrect: "off",
|
|
@@ -3752,254 +4105,289 @@ const bn = ({
|
|
|
3752
4105
|
autoComplete: "off",
|
|
3753
4106
|
value: s,
|
|
3754
4107
|
onInput: u,
|
|
3755
|
-
onKeyDown:
|
|
4108
|
+
onKeyDown: v,
|
|
3756
4109
|
ref: i,
|
|
3757
4110
|
disabled: n.controller.isLoading.value
|
|
3758
4111
|
}), c("div", {
|
|
3759
|
-
className:
|
|
4112
|
+
className: $.b("action-wrapper"),
|
|
3760
4113
|
children: [c("div", {
|
|
3761
|
-
className: "".concat(
|
|
4114
|
+
className: "".concat($.be("action-wrapper", "action-item"), " ").concat($.is("disabled", n.controller.isLoading.value)),
|
|
3762
4115
|
title: "上传资料",
|
|
3763
4116
|
children: c(bn, {
|
|
3764
4117
|
content: c("div", {
|
|
3765
|
-
className:
|
|
4118
|
+
className: $.b("pop-actions"),
|
|
3766
4119
|
children: [c("div", {
|
|
3767
|
-
className:
|
|
3768
|
-
onClick: (
|
|
3769
|
-
g(
|
|
4120
|
+
className: $.b("pop-action-item"),
|
|
4121
|
+
onClick: (_) => {
|
|
4122
|
+
g(_);
|
|
3770
4123
|
},
|
|
3771
4124
|
children: [c("span", {
|
|
3772
|
-
className:
|
|
3773
|
-
children: c(
|
|
4125
|
+
className: $.b("pop-action-item-icon"),
|
|
4126
|
+
children: c(vn, {})
|
|
3774
4127
|
}), c("span", {
|
|
3775
|
-
className:
|
|
4128
|
+
className: $.b("pop-action-item-title"),
|
|
3776
4129
|
children: "文件资料"
|
|
3777
4130
|
})]
|
|
3778
|
-
}), (
|
|
3779
|
-
var m,
|
|
4131
|
+
}), (f = n.questionToolbarItems) == null ? void 0 : f.map((_) => {
|
|
4132
|
+
var m, b, x;
|
|
3780
4133
|
return c("div", {
|
|
3781
|
-
className:
|
|
4134
|
+
className: $.b("pop-action-item"),
|
|
3782
4135
|
onClick: (C) => {
|
|
3783
|
-
|
|
4136
|
+
d(C, _);
|
|
3784
4137
|
},
|
|
3785
4138
|
children: [c("span", {
|
|
3786
|
-
className:
|
|
3787
|
-
children: typeof
|
|
3788
|
-
children: (
|
|
3789
|
-
className:
|
|
3790
|
-
}) : (
|
|
4139
|
+
className: $.b("pop-action-item-icon"),
|
|
4140
|
+
children: typeof _.icon == "function" ? _.icon() : ((m = _.icon) == null ? void 0 : m.showIcon) && c(j, {
|
|
4141
|
+
children: (b = _.icon) != null && b.cssClass ? c("i", {
|
|
4142
|
+
className: _.icon.cssClass
|
|
4143
|
+
}) : (x = _.icon) != null && x.imagePath ? tt(_.icon.imagePath) ? c("div", {
|
|
3791
4144
|
dangerouslySetInnerHTML: {
|
|
3792
|
-
__html:
|
|
4145
|
+
__html: _.icon.imagePath
|
|
3793
4146
|
}
|
|
3794
4147
|
}) : c("img", {
|
|
3795
|
-
src:
|
|
4148
|
+
src: _.icon.imagePath
|
|
3796
4149
|
}) : null
|
|
3797
4150
|
})
|
|
3798
4151
|
}), c("span", {
|
|
3799
|
-
className:
|
|
3800
|
-
children:
|
|
4152
|
+
className: $.b("pop-action-item-title"),
|
|
4153
|
+
children: _.label
|
|
3801
4154
|
})]
|
|
3802
|
-
},
|
|
4155
|
+
}, _.id);
|
|
3803
4156
|
})]
|
|
3804
4157
|
}),
|
|
3805
4158
|
position: "top-left",
|
|
3806
4159
|
isOpen: e,
|
|
3807
4160
|
onToggleOpen: t,
|
|
3808
|
-
children: c(
|
|
4161
|
+
children: c(oi, {})
|
|
3809
4162
|
})
|
|
3810
4163
|
}), c("div", {
|
|
3811
4164
|
title: o.value ? "语音输入中..." : "语音输入",
|
|
3812
|
-
className: "".concat(
|
|
3813
|
-
onClick:
|
|
4165
|
+
className: "".concat($.be("action-wrapper", "action-item"), " ").concat($.is("disabled", n.controller.isLoading.value)),
|
|
4166
|
+
onClick: r,
|
|
3814
4167
|
children: o.value ? c(ei, {}) : c(Qn, {})
|
|
3815
4168
|
}), n.controller.isLoading.value ? c("div", {
|
|
3816
4169
|
title: "停止生成",
|
|
3817
|
-
className: "".concat(
|
|
4170
|
+
className: "".concat($.be("action-wrapper", "action-item")),
|
|
3818
4171
|
onClick: l,
|
|
3819
|
-
children: c(
|
|
4172
|
+
children: c(ci, {})
|
|
3820
4173
|
}) : c("div", {
|
|
3821
4174
|
title: "发送消息",
|
|
3822
|
-
className: "".concat(
|
|
3823
|
-
onClick:
|
|
3824
|
-
children: c(
|
|
4175
|
+
className: "".concat($.be("action-wrapper", "action-item"), " ").concat($.is("disabled", h.value)),
|
|
4176
|
+
onClick: p,
|
|
4177
|
+
children: c(qn, {})
|
|
3825
4178
|
})]
|
|
3826
4179
|
})]
|
|
3827
4180
|
})]
|
|
3828
4181
|
});
|
|
3829
4182
|
};
|
|
3830
|
-
const
|
|
4183
|
+
const B = new M("chat-topic-item"), Zi = (n) => {
|
|
3831
4184
|
const {
|
|
3832
4185
|
controller: e,
|
|
3833
4186
|
topic: t,
|
|
3834
4187
|
onClick: i,
|
|
3835
4188
|
onAction: s
|
|
3836
|
-
} = n, o =
|
|
3837
|
-
var
|
|
3838
|
-
return ((
|
|
3839
|
-
}), [r,
|
|
3840
|
-
|
|
3841
|
-
},
|
|
3842
|
-
|
|
4189
|
+
} = n, o = R(null), a = L(() => {
|
|
4190
|
+
var _;
|
|
4191
|
+
return ((_ = e.activedTopic.value) == null ? void 0 : _.id) === t.id;
|
|
4192
|
+
}), [r, u] = ce(!1), h = z(!1), p = (f) => {
|
|
4193
|
+
f.stopPropagation(), s("LINK", f);
|
|
4194
|
+
}, l = (f, _) => {
|
|
4195
|
+
f === "DELETE" ? s("DELETE", _) : f === "RENAME" && (h.value = !0, setTimeout(() => {
|
|
4196
|
+
var m;
|
|
4197
|
+
(m = o.current) == null || m.focus();
|
|
4198
|
+
}, 100)), u(!1);
|
|
4199
|
+
}, v = (f) => {
|
|
4200
|
+
var _;
|
|
4201
|
+
f.stopPropagation(), t.data.caption = (_ = f.target) == null ? void 0 : _.value;
|
|
4202
|
+
}, g = (f) => {
|
|
4203
|
+
f.stopPropagation(), h.value = !1, s("RENAME", f);
|
|
4204
|
+
}, d = (f) => {
|
|
4205
|
+
f.stopPropagation(), f.key === "Enter" && (h.value = !1);
|
|
3843
4206
|
};
|
|
3844
4207
|
return c("div", {
|
|
3845
|
-
className: "".concat(
|
|
4208
|
+
className: "".concat(B.b(), " ").concat(B.is("active", a.value), " ").concat(B.is("edit", h.value)),
|
|
3846
4209
|
onClick: i.bind(void 0),
|
|
3847
4210
|
children: [c("div", {
|
|
3848
|
-
className:
|
|
4211
|
+
className: B.e("caption"),
|
|
3849
4212
|
title: t.caption,
|
|
3850
|
-
children:
|
|
3851
|
-
|
|
3852
|
-
|
|
4213
|
+
children: h.value ? c("input", {
|
|
4214
|
+
ref: o,
|
|
4215
|
+
value: t.caption,
|
|
4216
|
+
onBlur: g,
|
|
4217
|
+
onKeyDown: d,
|
|
4218
|
+
onClick: (f) => f.stopPropagation(),
|
|
4219
|
+
onChange: (f) => v(f),
|
|
4220
|
+
className: B.em("caption", "editor")
|
|
4221
|
+
}) : c("span", {
|
|
4222
|
+
className: B.em("caption", "text"),
|
|
4223
|
+
children: t.caption
|
|
4224
|
+
})
|
|
4225
|
+
}), !h.value && c("div", {
|
|
4226
|
+
className: B.e("icon"),
|
|
3853
4227
|
children: [c("span", {
|
|
3854
|
-
className: q.be("icon", "item"),
|
|
3855
4228
|
title: "跳转主视图",
|
|
3856
|
-
|
|
4229
|
+
className: B.em("icon", "item"),
|
|
4230
|
+
onClick: p.bind(void 0),
|
|
3857
4231
|
children: c(ni, {
|
|
3858
|
-
className:
|
|
4232
|
+
className: B.b("link-icon")
|
|
3859
4233
|
})
|
|
3860
|
-
}),
|
|
4234
|
+
}), a.value ? null : c(bn, {
|
|
3861
4235
|
actions: [{
|
|
4236
|
+
id: "RENAME",
|
|
4237
|
+
caption: "重命名",
|
|
4238
|
+
icon: c(hi, {})
|
|
4239
|
+
}, {
|
|
3862
4240
|
id: "DELETE",
|
|
3863
|
-
caption: "删除话题"
|
|
4241
|
+
caption: "删除话题",
|
|
4242
|
+
icon: c(ii, {})
|
|
3864
4243
|
}],
|
|
3865
4244
|
position: "bottom",
|
|
3866
4245
|
isOpen: r,
|
|
3867
|
-
onToggleOpen:
|
|
3868
|
-
onAction:
|
|
4246
|
+
onToggleOpen: u,
|
|
4247
|
+
onAction: l.bind(void 0),
|
|
3869
4248
|
children: c("span", {
|
|
3870
|
-
className:
|
|
4249
|
+
className: B.em("icon", "item"),
|
|
3871
4250
|
title: "更多",
|
|
3872
4251
|
children: c(ti, {
|
|
3873
|
-
className:
|
|
4252
|
+
className: B.e("more-icon")
|
|
3874
4253
|
})
|
|
3875
4254
|
})
|
|
3876
4255
|
})]
|
|
3877
4256
|
})]
|
|
3878
4257
|
});
|
|
3879
4258
|
};
|
|
3880
|
-
const
|
|
3881
|
-
const e = n.controller.topics, t = (
|
|
3882
|
-
n.controller.handleTopicChange(
|
|
3883
|
-
},
|
|
3884
|
-
n.controller.handleTopicAction(
|
|
4259
|
+
const Gi = new M("chat-topics"), Ji = (n) => {
|
|
4260
|
+
const e = n.controller.topics, t = R(null), i = (o) => {
|
|
4261
|
+
n.controller.handleTopicChange(o);
|
|
4262
|
+
}, s = (o, a, r) => {
|
|
4263
|
+
n.controller.handleTopicAction(o, a, r);
|
|
3885
4264
|
};
|
|
3886
|
-
return
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
4265
|
+
return H(() => {
|
|
4266
|
+
const o = t.current;
|
|
4267
|
+
if (!o)
|
|
4268
|
+
return;
|
|
4269
|
+
const a = o.querySelector(".ibiz-chat-topic-item.is-active");
|
|
4270
|
+
a == null || a.scrollIntoView({
|
|
4271
|
+
behavior: "smooth",
|
|
4272
|
+
block: "nearest"
|
|
4273
|
+
});
|
|
4274
|
+
}, [n.controller.activedTopic.value]), c("div", {
|
|
4275
|
+
ref: t,
|
|
4276
|
+
className: Gi.b(),
|
|
4277
|
+
children: e.value.map((o) => c(Zi, {
|
|
4278
|
+
topic: o,
|
|
3890
4279
|
controller: n.controller,
|
|
3891
|
-
onClick: () =>
|
|
3892
|
-
onAction: (
|
|
3893
|
-
},
|
|
4280
|
+
onClick: () => i(o),
|
|
4281
|
+
onAction: (a, r) => s(a, o, r)
|
|
4282
|
+
}, o.id))
|
|
3894
4283
|
});
|
|
3895
4284
|
};
|
|
3896
|
-
const
|
|
3897
|
-
const e =
|
|
4285
|
+
const ie = new M("chart-minimize"), Ki = (n) => {
|
|
4286
|
+
const e = R(null), [t, i] = ce(""), [s, o] = ce(0), a = R(!1), r = {
|
|
3898
4287
|
x: (window.innerWidth - 86) / window.innerWidth,
|
|
3899
4288
|
y: (window.innerHeight - 86) / window.innerHeight
|
|
3900
|
-
}
|
|
3901
|
-
|
|
3902
|
-
return
|
|
3903
|
-
}
|
|
3904
|
-
const
|
|
3905
|
-
let
|
|
3906
|
-
return
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
answerContent: T
|
|
4289
|
+
}, u = L(() => {
|
|
4290
|
+
const d = n.controller.messages.value[n.controller.messages.value.length - 1];
|
|
4291
|
+
return d ? d.role === "ASSISTANT" && d.state === 20 && d.completed !== !0 : !1;
|
|
4292
|
+
}), h = (d) => {
|
|
4293
|
+
const f = d.indexOf("<think>"), _ = d.indexOf("</think>");
|
|
4294
|
+
let m = "", b = "";
|
|
4295
|
+
return _ === -1 ? (m = d.slice(f + 7), b = "") : (m = d.slice(f + 7, _), b = d.slice(_ + 8)), {
|
|
4296
|
+
thoughtContent: m,
|
|
4297
|
+
answerContent: b
|
|
3910
4298
|
};
|
|
3911
|
-
},
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
return p;
|
|
3926
|
-
}, [u.value]), _ = () => {
|
|
4299
|
+
}, p = L(() => {
|
|
4300
|
+
let d = "";
|
|
4301
|
+
if (!u.value)
|
|
4302
|
+
return i(""), o(0), d;
|
|
4303
|
+
const f = n.controller.messages.value[n.controller.messages.value.length - 1];
|
|
4304
|
+
if (d = f.content, f.content.indexOf("<think>") !== -1) {
|
|
4305
|
+
const {
|
|
4306
|
+
thoughtContent: _,
|
|
4307
|
+
answerContent: m
|
|
4308
|
+
} = h(f.content);
|
|
4309
|
+
d = _ + m;
|
|
4310
|
+
}
|
|
4311
|
+
return d;
|
|
4312
|
+
}), l = () => {
|
|
3927
4313
|
Object.assign(e.current.style, {
|
|
3928
|
-
left: "".concat(
|
|
3929
|
-
top: "".concat(
|
|
3930
|
-
}), localStorage.setItem(
|
|
3931
|
-
},
|
|
3932
|
-
const
|
|
3933
|
-
|
|
4314
|
+
left: "".concat(r.x * 100, "%"),
|
|
4315
|
+
top: "".concat(r.y * 100, "%")
|
|
4316
|
+
}), localStorage.setItem(N.MINIMIZE_STYLY_CHCHE, JSON.stringify(r));
|
|
4317
|
+
}, v = () => {
|
|
4318
|
+
const d = e.current;
|
|
4319
|
+
d && (d.onmousedown = (f) => {
|
|
3934
4320
|
document.body.style.userSelect = "none";
|
|
3935
|
-
const
|
|
3936
|
-
const
|
|
3937
|
-
x:
|
|
3938
|
-
y:
|
|
3939
|
-
} =
|
|
3940
|
-
|
|
3941
|
-
x:
|
|
3942
|
-
y:
|
|
3943
|
-
}, requestAnimationFrame(() => {
|
|
3944
|
-
|
|
4321
|
+
const _ = f.clientX - d.offsetLeft, m = f.clientY - d.offsetTop, b = Date.now(), x = (S) => {
|
|
4322
|
+
const O = 56 / window.innerWidth, I = 56 / window.innerHeight, {
|
|
4323
|
+
x: F,
|
|
4324
|
+
y: D
|
|
4325
|
+
} = nn(S.clientX - _, S.clientY - m, O, I);
|
|
4326
|
+
Object.assign(r, {
|
|
4327
|
+
x: F,
|
|
4328
|
+
y: D
|
|
4329
|
+
}), requestAnimationFrame(() => {
|
|
4330
|
+
l();
|
|
3945
4331
|
});
|
|
3946
|
-
},
|
|
3947
|
-
const
|
|
3948
|
-
|
|
4332
|
+
}, C = () => {
|
|
4333
|
+
const S = Date.now();
|
|
4334
|
+
a.current = S - b > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", C);
|
|
3949
4335
|
};
|
|
3950
|
-
document.addEventListener("mousemove",
|
|
4336
|
+
document.addEventListener("mousemove", x), document.addEventListener("mouseup", C);
|
|
3951
4337
|
});
|
|
3952
|
-
},
|
|
3953
|
-
|
|
4338
|
+
}, g = () => {
|
|
4339
|
+
a.current || n.onClick();
|
|
3954
4340
|
};
|
|
3955
|
-
return
|
|
3956
|
-
const
|
|
3957
|
-
if (
|
|
3958
|
-
const
|
|
3959
|
-
|
|
4341
|
+
return H(() => {
|
|
4342
|
+
const d = localStorage.getItem(N.MINIMIZE_STYLY_CHCHE);
|
|
4343
|
+
if (d) {
|
|
4344
|
+
const f = JSON.parse(d);
|
|
4345
|
+
Xe(f) && Object.assign(r, f);
|
|
3960
4346
|
}
|
|
3961
|
-
|
|
3962
|
-
}, []),
|
|
3963
|
-
if (s <
|
|
3964
|
-
const
|
|
3965
|
-
i((
|
|
4347
|
+
l(), v();
|
|
4348
|
+
}, []), H(() => {
|
|
4349
|
+
if (s < p.value.length) {
|
|
4350
|
+
const d = setTimeout(() => {
|
|
4351
|
+
i((f) => f + p.value[s]), o((f) => f + 1);
|
|
3966
4352
|
}, 100);
|
|
3967
|
-
return () => clearTimeout(
|
|
4353
|
+
return () => clearTimeout(d);
|
|
3968
4354
|
}
|
|
3969
|
-
}, [s,
|
|
4355
|
+
}, [s, p.value]), c("div", {
|
|
3970
4356
|
ref: e,
|
|
3971
4357
|
title: n.title,
|
|
3972
|
-
className: "".concat(
|
|
3973
|
-
onClick:
|
|
3974
|
-
children:
|
|
3975
|
-
className: "".concat(
|
|
3976
|
-
children: [
|
|
3977
|
-
className: "".concat(
|
|
4358
|
+
className: "".concat(ie.b(), " ").concat(ie.is("hidden", !n.isMinimize), " ").concat(ie.is("show-halo", u.value)),
|
|
4359
|
+
onClick: g,
|
|
4360
|
+
children: c("div", {
|
|
4361
|
+
className: "".concat(ie.e("content"), " ").concat(ie.is("show-border", !u.value)),
|
|
4362
|
+
children: [t && c("div", {
|
|
4363
|
+
className: "".concat(ie.em("content", "popover")),
|
|
3978
4364
|
children: c("div", {
|
|
3979
4365
|
className: "typewriter",
|
|
3980
4366
|
children: t
|
|
3981
4367
|
})
|
|
3982
|
-
})]
|
|
3983
|
-
})
|
|
4368
|
+
}), c(Jn, {})]
|
|
4369
|
+
})
|
|
3984
4370
|
});
|
|
3985
4371
|
};
|
|
3986
|
-
const
|
|
4372
|
+
const ot = Mn({
|
|
3987
4373
|
zIndex: 10,
|
|
3988
|
-
enableBackFill: !0
|
|
4374
|
+
enableBackFill: !0,
|
|
4375
|
+
newTopic: () => {
|
|
4376
|
+
}
|
|
3989
4377
|
});
|
|
3990
|
-
var
|
|
3991
|
-
class
|
|
4378
|
+
var Bt, Pt, Rt, Ft;
|
|
4379
|
+
class Ot extends P {
|
|
3992
4380
|
constructor(t) {
|
|
3993
4381
|
super(t);
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4382
|
+
T(this, "ns", new M("chat-container"));
|
|
4383
|
+
T(this, "containerRef", rt());
|
|
4384
|
+
T(this, "dragHandle", rt());
|
|
3997
4385
|
/**
|
|
3998
4386
|
* 窗口样式数据
|
|
3999
4387
|
*
|
|
4000
4388
|
* @memberof ChatContainer
|
|
4001
4389
|
*/
|
|
4002
|
-
|
|
4390
|
+
T(this, "data", {
|
|
4003
4391
|
side: {
|
|
4004
4392
|
y: 0,
|
|
4005
4393
|
height: 1,
|
|
@@ -4022,14 +4410,14 @@ class Lt extends L {
|
|
|
4022
4410
|
* @type {boolean}
|
|
4023
4411
|
* @memberof ChatContainer
|
|
4024
4412
|
*/
|
|
4025
|
-
|
|
4413
|
+
T(this, "disabled", !1);
|
|
4026
4414
|
/**
|
|
4027
4415
|
* 最小化是否在拖拽中
|
|
4028
4416
|
* - 在拖拽时不应触发点击事件
|
|
4029
4417
|
* @type {boolean}
|
|
4030
4418
|
* @memberof ChatContainer
|
|
4031
4419
|
*/
|
|
4032
|
-
|
|
4420
|
+
T(this, "isDragging", !1);
|
|
4033
4421
|
/**
|
|
4034
4422
|
* 容器上下文
|
|
4035
4423
|
*
|
|
@@ -4037,9 +4425,12 @@ class Lt extends L {
|
|
|
4037
4425
|
* @date 2025-03-03 16:03:44
|
|
4038
4426
|
* @type {ContainerContext}
|
|
4039
4427
|
*/
|
|
4040
|
-
|
|
4041
|
-
zIndex: ((
|
|
4042
|
-
enableBackFill: ((
|
|
4428
|
+
T(this, "containerContext", {
|
|
4429
|
+
zIndex: ((Bt = this.props.containerOptions) == null ? void 0 : Bt.zIndex) || 10,
|
|
4430
|
+
enableBackFill: ((Pt = this.props) == null ? void 0 : Pt.enableBackFill) !== void 0 && ((Rt = this.props) == null ? void 0 : Rt.enableBackFill) !== null ? (Ft = this.props) == null ? void 0 : Ft.enableBackFill : !0,
|
|
4431
|
+
newTopic: () => {
|
|
4432
|
+
this.props.aiTopic.newTopic();
|
|
4433
|
+
}
|
|
4043
4434
|
});
|
|
4044
4435
|
this.state = {
|
|
4045
4436
|
isFullScreen: !1,
|
|
@@ -4088,7 +4479,7 @@ class Lt extends L {
|
|
|
4088
4479
|
* @memberof ChatContainer
|
|
4089
4480
|
*/
|
|
4090
4481
|
setStyle() {
|
|
4091
|
-
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), localStorage.setItem(
|
|
4482
|
+
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), localStorage.setItem(N.STYLE_CACHE, JSON.stringify(this.data));
|
|
4092
4483
|
}
|
|
4093
4484
|
/**
|
|
4094
4485
|
* 吸附边缘(窗口模式)
|
|
@@ -4100,10 +4491,10 @@ class Lt extends L {
|
|
|
4100
4491
|
const t = 20 / window.innerWidth, i = 20 / window.innerHeight, {
|
|
4101
4492
|
x: s,
|
|
4102
4493
|
y: o,
|
|
4103
|
-
width:
|
|
4104
|
-
height:
|
|
4494
|
+
width: a,
|
|
4495
|
+
height: r
|
|
4105
4496
|
} = this.data.window;
|
|
4106
|
-
s < t || s +
|
|
4497
|
+
s < t || s + a > 1 - t ? this.calcSideModeStyle(s < t ? "left" : "right") : (o < i && (this.data.window.y = 0), o + r > 1 - i && (this.data.window.y = 1 - r)), this.setStyle();
|
|
4107
4498
|
}
|
|
4108
4499
|
/**
|
|
4109
4500
|
* 注册对话框拖拽
|
|
@@ -4115,22 +4506,22 @@ class Lt extends L {
|
|
|
4115
4506
|
if (this.state.isFullScreen)
|
|
4116
4507
|
return;
|
|
4117
4508
|
document.body.style.userSelect = "none";
|
|
4118
|
-
const i = t.clientX - this.containerRef.current.offsetLeft, s = t.clientY - this.containerRef.current.offsetTop, o = (
|
|
4509
|
+
const i = t.clientX - this.containerRef.current.offsetLeft, s = t.clientY - this.containerRef.current.offsetTop, o = (r) => {
|
|
4119
4510
|
if (this.disabled)
|
|
4120
4511
|
return;
|
|
4121
4512
|
this.data.showMode = "window";
|
|
4122
4513
|
const {
|
|
4123
4514
|
x: u,
|
|
4124
|
-
y:
|
|
4125
|
-
} =
|
|
4515
|
+
y: h
|
|
4516
|
+
} = nn(r.clientX - i, r.clientY - s, this.data.window.width, this.data.window.height);
|
|
4126
4517
|
Object.assign(this.data.window, {
|
|
4127
4518
|
x: u,
|
|
4128
|
-
y:
|
|
4519
|
+
y: h
|
|
4129
4520
|
}), this.setStyle();
|
|
4130
|
-
},
|
|
4131
|
-
document.body.style.userSelect = "", document.removeEventListener("mousemove", o), document.removeEventListener("mouseup",
|
|
4521
|
+
}, a = () => {
|
|
4522
|
+
document.body.style.userSelect = "", document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a), !this.disabled && this.snapToEdge();
|
|
4132
4523
|
};
|
|
4133
|
-
document.addEventListener("mousemove", o), document.addEventListener("mouseup",
|
|
4524
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", a);
|
|
4134
4525
|
};
|
|
4135
4526
|
}
|
|
4136
4527
|
/**
|
|
@@ -4139,7 +4530,7 @@ class Lt extends L {
|
|
|
4139
4530
|
* @memberof ChatContainer
|
|
4140
4531
|
*/
|
|
4141
4532
|
registerDragDialogBorder() {
|
|
4142
|
-
|
|
4533
|
+
He(this.containerRef.current).resizable({
|
|
4143
4534
|
// 可拖拽的边缘
|
|
4144
4535
|
edges: {
|
|
4145
4536
|
top: !0,
|
|
@@ -4150,11 +4541,11 @@ class Lt extends L {
|
|
|
4150
4541
|
margin: 6,
|
|
4151
4542
|
modifiers: [
|
|
4152
4543
|
// 保持在父对象内部
|
|
4153
|
-
|
|
4544
|
+
He.modifiers.restrictEdges({
|
|
4154
4545
|
outer: document.body
|
|
4155
4546
|
}),
|
|
4156
4547
|
// 缩放最小宽度
|
|
4157
|
-
|
|
4548
|
+
He.modifiers.restrictSize({
|
|
4158
4549
|
min: {
|
|
4159
4550
|
width: this.data.minWidth,
|
|
4160
4551
|
height: this.data.minHeight
|
|
@@ -4190,10 +4581,10 @@ class Lt extends L {
|
|
|
4190
4581
|
}
|
|
4191
4582
|
componentDidMount() {
|
|
4192
4583
|
this.handleFullScreenChange = this.handleFullScreenChange.bind(this);
|
|
4193
|
-
const t = localStorage.getItem(
|
|
4584
|
+
const t = localStorage.getItem(N.STYLE_CACHE);
|
|
4194
4585
|
if (t) {
|
|
4195
4586
|
const i = JSON.parse(t);
|
|
4196
|
-
i.side &&
|
|
4587
|
+
i.side && Xe(i.side) && i.window && Xe(i.window) && Object.assign(this.data, i);
|
|
4197
4588
|
}
|
|
4198
4589
|
this.setStyle(), this.registerDragDialog(), this.registerDragDialogBorder(), document.addEventListener("fullscreenchange", this.handleFullScreenChange);
|
|
4199
4590
|
}
|
|
@@ -4258,7 +4649,7 @@ class Lt extends L {
|
|
|
4258
4649
|
t.stopPropagation();
|
|
4259
4650
|
}
|
|
4260
4651
|
render() {
|
|
4261
|
-
return c(
|
|
4652
|
+
return c(ot.Provider, {
|
|
4262
4653
|
value: this.containerContext,
|
|
4263
4654
|
children: c("div", {
|
|
4264
4655
|
className: "".concat(this.ns.b()),
|
|
@@ -4303,18 +4694,18 @@ class Lt extends L {
|
|
|
4303
4694
|
className: "".concat(this.ns.b("main")),
|
|
4304
4695
|
children: [c("div", {
|
|
4305
4696
|
className: "".concat(this.ns.be("main", "left")),
|
|
4306
|
-
children: c(
|
|
4697
|
+
children: c(Ji, {
|
|
4307
4698
|
controller: this.props.aiTopic
|
|
4308
4699
|
})
|
|
4309
4700
|
}), c("div", {
|
|
4310
4701
|
className: "".concat(this.ns.be("main", "right")),
|
|
4311
4702
|
children: [c("div", {
|
|
4312
4703
|
className: this.ns.b("content"),
|
|
4313
|
-
children: c(
|
|
4704
|
+
children: c(Ct, {
|
|
4314
4705
|
controller: this.props.aiChat,
|
|
4315
4706
|
toolbarItems: this.props.contentToolbarItems
|
|
4316
4707
|
})
|
|
4317
|
-
}), c(
|
|
4708
|
+
}), c(Je, {
|
|
4318
4709
|
data: this.props.aiTopic.activedTopic.value,
|
|
4319
4710
|
type: "footer",
|
|
4320
4711
|
className: this.ns.e("toolbar"),
|
|
@@ -4332,11 +4723,11 @@ class Lt extends L {
|
|
|
4332
4723
|
className: "".concat(this.ns.be("main", "default")),
|
|
4333
4724
|
children: [c("div", {
|
|
4334
4725
|
className: this.ns.b("content"),
|
|
4335
|
-
children: c(
|
|
4726
|
+
children: c(Ct, {
|
|
4336
4727
|
controller: this.props.aiChat,
|
|
4337
4728
|
toolbarItems: this.props.contentToolbarItems
|
|
4338
4729
|
})
|
|
4339
|
-
}), c(
|
|
4730
|
+
}), c(Je, {
|
|
4340
4731
|
type: "footer",
|
|
4341
4732
|
data: this.props.aiTopic.activedTopic.value,
|
|
4342
4733
|
className: this.ns.e("toolbar"),
|
|
@@ -4350,7 +4741,7 @@ class Lt extends L {
|
|
|
4350
4741
|
})
|
|
4351
4742
|
})]
|
|
4352
4743
|
})]
|
|
4353
|
-
}), c(
|
|
4744
|
+
}), c(Ki, {
|
|
4354
4745
|
title: this.props.caption || "AI助手",
|
|
4355
4746
|
controller: this.props.aiChat,
|
|
4356
4747
|
isMinimize: this.state.isMinimize,
|
|
@@ -4361,6 +4752,6 @@ class Lt extends L {
|
|
|
4361
4752
|
}
|
|
4362
4753
|
}
|
|
4363
4754
|
export {
|
|
4364
|
-
|
|
4365
|
-
|
|
4755
|
+
Ot as ChatContainer,
|
|
4756
|
+
ns as chat
|
|
4366
4757
|
};
|