@ibiz-template-plugin/ai-chat 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2083 -1026
- package/dist/index.legacy.js +1 -1
- package/dist/polyfills.legacy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/chat-container/chat-container.d.ts +94 -7
- package/dist/types/components/chat-message-item/chat-message-item.d.ts +8 -1
- package/dist/types/components/chat-message-item/error-message/error-message.d.ts +8 -0
- package/dist/types/components/chat-message-item/markdown-message/markdown-message.d.ts +8 -0
- package/dist/types/components/chat-message-item/user-message/user-message.d.ts +8 -0
- package/dist/types/components/chat-messages/chat-messages.d.ts +8 -0
- package/dist/types/components/chat-toolbar/chat-toolbar.d.ts +41 -0
- package/dist/types/components/chat-topic-item/chat-topic-item.d.ts +9 -0
- package/dist/types/components/chat-topics/chat-topics.d.ts +12 -0
- package/dist/types/components/popup/popup.d.ts +15 -0
- package/dist/types/constants/index.d.ts +17 -1
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +48 -0
- package/dist/types/controller/ai-topic/ai-topic.controller.d.ts +96 -0
- package/dist/types/controller/chat/chat.controller.d.ts +76 -5
- package/dist/types/controller/index.d.ts +1 -0
- package/dist/types/entity/chart-topic/chart-topic.d.ts +20 -0
- package/dist/types/entity/index.d.ts +1 -0
- package/dist/types/icons/ai-svg.d.ts +1 -0
- package/dist/types/icons/audio-svg.d.ts +1 -0
- package/dist/types/icons/index.d.ts +8 -0
- package/dist/types/icons/link-svg.d.ts +3 -0
- package/dist/types/icons/minimize-svg.d.ts +1 -0
- package/dist/types/icons/more-svg.d.ts +4 -0
- package/dist/types/icons/new-dialogue.d.ts +1 -0
- package/dist/types/icons/recording-svg.d.ts +1 -0
- package/dist/types/icons/remove-svg.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interface/i-chat-options/i-chat-options.d.ts +104 -25
- package/dist/types/interface/i-chat-toolbar-item/i-chat-toolbar-item.d.ts +53 -0
- package/dist/types/interface/i-config-service/i-config-service.d.ts +27 -0
- package/dist/types/interface/i-container-options/i-container-options.d.ts +45 -0
- package/dist/types/interface/i-topic-options/i-topic-options.d.ts +102 -0
- package/dist/types/interface/index.d.ts +4 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/util/indexdb-util.d.ts +91 -0
- package/package.json +5 -3
package/dist/index.es.js
CHANGED
|
@@ -1,297 +1,298 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import './style.css';
|
|
2
|
+
var Gt = Object.defineProperty;
|
|
3
|
+
var Jt = (n, e, t) => e in n ? Gt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
4
|
+
var y = (n, e, t) => (Jt(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import Ae from "interactjs";
|
|
6
|
+
import Kt from "cherry-markdown";
|
|
7
|
+
var $e, v, Et, $t, j, qe, Tt, Le, G = {}, kt = [], Qt = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Te = Array.isArray;
|
|
8
|
+
function U(n, e) {
|
|
9
|
+
for (var t in e)
|
|
10
|
+
n[t] = e[t];
|
|
11
|
+
return n;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
var e =
|
|
14
|
-
e && e.removeChild(
|
|
13
|
+
function xt(n) {
|
|
14
|
+
var e = n.parentNode;
|
|
15
|
+
e && e.removeChild(n);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function H(n, e, t) {
|
|
17
18
|
var i, s, r, o = {};
|
|
18
19
|
for (r in e)
|
|
19
20
|
r == "key" ? i = e[r] : r == "ref" ? s = e[r] : o[r] = e[r];
|
|
20
|
-
if (arguments.length > 2 && (o.children = arguments.length > 3 ?
|
|
21
|
-
for (r in
|
|
22
|
-
o[r] === void 0 && (o[r] =
|
|
23
|
-
return
|
|
21
|
+
if (arguments.length > 2 && (o.children = arguments.length > 3 ? $e.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
|
|
22
|
+
for (r in n.defaultProps)
|
|
23
|
+
o[r] === void 0 && (o[r] = n.defaultProps[r]);
|
|
24
|
+
return me(n, o, i, s, null);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
var r = { type:
|
|
27
|
-
return s == null &&
|
|
26
|
+
function me(n, e, t, i, s) {
|
|
27
|
+
var r = { 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 ? ++Et : s };
|
|
28
|
+
return s == null && v.vnode != null && v.vnode(r), r;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function Ie() {
|
|
30
31
|
return { current: null };
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
33
|
+
function K(n) {
|
|
34
|
+
return n.children;
|
|
34
35
|
}
|
|
35
|
-
function M(
|
|
36
|
-
this.props =
|
|
36
|
+
function M(n, e) {
|
|
37
|
+
this.props = n, this.context = e;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function oe(n, e) {
|
|
39
40
|
if (e == null)
|
|
40
|
-
return
|
|
41
|
-
for (var
|
|
42
|
-
if ((
|
|
43
|
-
return
|
|
44
|
-
return typeof
|
|
45
|
-
}
|
|
46
|
-
function
|
|
47
|
-
var e,
|
|
48
|
-
if ((
|
|
49
|
-
for (
|
|
50
|
-
if ((
|
|
51
|
-
|
|
41
|
+
return n.__ ? oe(n.__, n.__.__k.indexOf(n) + 1) : null;
|
|
42
|
+
for (var t; e < n.__k.length; e++)
|
|
43
|
+
if ((t = n.__k[e]) != null && t.__e != null)
|
|
44
|
+
return t.__d || t.__e;
|
|
45
|
+
return typeof n.type == "function" ? oe(n) : null;
|
|
46
|
+
}
|
|
47
|
+
function Nt(n) {
|
|
48
|
+
var e, t;
|
|
49
|
+
if ((n = n.__) != null && n.__c != null) {
|
|
50
|
+
for (n.__e = n.__c.base = null, e = 0; e < n.__k.length; e++)
|
|
51
|
+
if ((t = n.__k[e]) != null && t.__e != null) {
|
|
52
|
+
n.__e = n.__c.base = t.__e;
|
|
52
53
|
break;
|
|
53
54
|
}
|
|
54
|
-
return
|
|
55
|
+
return Nt(n);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
(!
|
|
59
|
-
}
|
|
60
|
-
function ae() {
|
|
61
|
-
var t, e, n, i, s, r, o, l, c;
|
|
62
|
-
for (B.sort(Ee); t = B.shift(); )
|
|
63
|
-
t.__d && (e = B.length, i = void 0, s = void 0, r = void 0, l = (o = (n = t).__v).__e, (c = n.__P) && (i = [], s = [], (r = F({}, o)).__v = o.__v + 1, Pe(c, o, r, n.__n, c.ownerSVGElement !== void 0, o.__h != null ? [l] : null, i, l == null ? Q(o) : l, o.__h, s), wt(i, o, s), o.__e != l && mt(o)), B.length > e && B.sort(Ee));
|
|
64
|
-
ae.__r = 0;
|
|
65
|
-
}
|
|
66
|
-
function gt(t, e, n, i, s, r, o, l, c, p, h) {
|
|
67
|
-
var a, m, d, _, v, P, g, b, C, w = 0, $ = i && i.__k || vt, R = $.length, E = R, T = e.length;
|
|
68
|
-
for (n.__k = [], a = 0; a < T; a++)
|
|
69
|
-
(_ = n.__k[a] = (_ = e[a]) == null || typeof _ == "boolean" || typeof _ == "function" ? null : typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" ? re(null, _, null, null, _) : ge(_) ? re(Y, { children: _ }, null, null, null) : _.__b > 0 ? re(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : _) != null ? (_.__ = n, _.__b = n.__b + 1, (b = It(_, $, g = a + w, E)) === -1 ? d = I : (d = $[b] || I, $[b] = void 0, E--), Pe(t, _, d, s, r, o, l, c, p, h), v = _.__e, (m = _.ref) && d.ref != m && (d.ref && Re(d.ref, null, _), h.push(m, _.__c || v, _)), v != null && (P == null && (P = v), (C = d === I || d.__v === null) ? b == -1 && w-- : b !== g && (b === g + 1 ? w++ : b > g ? E > T - g ? w += b - g : w-- : w = b < g && b == g - 1 ? b - g : 0), g = a + w, typeof _.type != "function" || b === g && d.__k !== _.__k ? typeof _.type == "function" || b === g && !C ? _.__d !== void 0 ? (c = _.__d, _.__d = void 0) : c = v.nextSibling : c = bt(t, v, c) : c = yt(_, c, t), typeof n.type == "function" && (n.__d = c))) : (d = $[a]) && d.key == null && d.__e && (d.__e == c && (d.__ = i, c = Q(d)), Ae(d, d, !1), $[a] = null);
|
|
70
|
-
for (n.__e = P, a = R; a--; )
|
|
71
|
-
$[a] != null && (typeof n.type == "function" && $[a].__e != null && $[a].__e == n.__d && (n.__d = $[a].__e.nextSibling), Ae($[a], $[a]));
|
|
58
|
+
function Xe(n) {
|
|
59
|
+
(!n.__d && (n.__d = !0) && j.push(n) && !be.__r++ || qe !== v.debounceRendering) && ((qe = v.debounceRendering) || Tt)(be);
|
|
72
60
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
function be() {
|
|
62
|
+
var n, e, t, i, s, r, o, c, l;
|
|
63
|
+
for (j.sort(Le); n = j.shift(); )
|
|
64
|
+
n.__d && (e = j.length, i = void 0, s = void 0, r = void 0, c = (o = (t = n).__v).__e, (l = t.__P) && (i = [], s = [], (r = U({}, o)).__v = o.__v + 1, Be(l, o, r, t.__n, l.ownerSVGElement !== void 0, o.__h != null ? [c] : null, i, c == null ? oe(o) : c, o.__h, s), Mt(i, o, s), o.__e != c && Nt(o)), j.length > e && j.sort(Le));
|
|
65
|
+
be.__r = 0;
|
|
66
|
+
}
|
|
67
|
+
function At(n, e, t, i, s, r, o, c, l, f, h) {
|
|
68
|
+
var a, _, p, d, g, k, b, C, x, S = 0, E = i && i.__k || kt, L = E.length, N = L, R = e.length;
|
|
69
|
+
for (t.__k = [], a = 0; a < R; a++)
|
|
70
|
+
(d = t.__k[a] = (d = e[a]) == null || typeof d == "boolean" || typeof d == "function" ? null : typeof d == "string" || typeof d == "number" || typeof d == "bigint" ? me(null, d, null, null, d) : Te(d) ? me(K, { children: d }, null, null, null) : d.__b > 0 ? me(d.type, d.props, d.key, d.ref ? d.ref : null, d.__v) : d) != null ? (d.__ = t, d.__b = t.__b + 1, (C = en(d, E, b = a + S, N)) === -1 ? p = G : (p = E[C] || G, E[C] = void 0, N--), Be(n, d, p, s, r, o, c, l, f, h), g = d.__e, (_ = d.ref) && p.ref != _ && (p.ref && Fe(p.ref, null, d), h.push(_, d.__c || g, d)), g != null && (k == null && (k = g), (x = p === G || p.__v === null) ? C == -1 && S-- : C !== b && (C === b + 1 ? S++ : C > b ? N > R - b ? S += C - b : S-- : S = C < b && C == b - 1 ? C - b : 0), b = a + S, typeof d.type != "function" || C === b && p.__k !== d.__k ? typeof d.type == "function" || C === b && !x ? d.__d !== void 0 ? (l = d.__d, d.__d = void 0) : l = g.nextSibling : l = Dt(n, g, l) : l = It(d, l, n), typeof t.type == "function" && (t.__d = l))) : (p = E[a]) && p.key == null && p.__e && (p.__e == l && (p.__ = i, l = oe(p)), Re(p, p, !1), E[a] = null);
|
|
71
|
+
for (t.__e = k, a = L; a--; )
|
|
72
|
+
E[a] != null && (typeof t.type == "function" && E[a].__e != null && E[a].__e == t.__d && (t.__d = E[a].__e.nextSibling), Re(E[a], E[a]));
|
|
73
|
+
}
|
|
74
|
+
function It(n, e, t) {
|
|
75
|
+
for (var i, s = n.__k, r = 0; s && r < s.length; r++)
|
|
76
|
+
(i = s[r]) && (i.__ = n, e = typeof i.type == "function" ? It(i, e, t) : Dt(t, i.__e, e));
|
|
76
77
|
return e;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
return e = e || [],
|
|
80
|
-
|
|
81
|
-
}) : e.push(
|
|
79
|
+
function we(n, e) {
|
|
80
|
+
return e = e || [], n == null || typeof n == "boolean" || (Te(n) ? n.some(function(t) {
|
|
81
|
+
we(t, e);
|
|
82
|
+
}) : e.push(n)), e;
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
return
|
|
84
|
+
function Dt(n, e, t) {
|
|
85
|
+
return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
var s =
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
90
|
-
if (i > (
|
|
91
|
-
for (; o >= 0 ||
|
|
87
|
+
function en(n, e, t, i) {
|
|
88
|
+
var s = n.key, r = n.type, o = t - 1, c = t + 1, l = e[t];
|
|
89
|
+
if (l === null || l && s == l.key && r === l.type)
|
|
90
|
+
return t;
|
|
91
|
+
if (i > (l != null ? 1 : 0))
|
|
92
|
+
for (; o >= 0 || c < e.length; ) {
|
|
92
93
|
if (o >= 0) {
|
|
93
|
-
if ((
|
|
94
|
+
if ((l = e[o]) && s == l.key && r === l.type)
|
|
94
95
|
return o;
|
|
95
96
|
o--;
|
|
96
97
|
}
|
|
97
|
-
if (
|
|
98
|
-
if ((
|
|
99
|
-
return
|
|
100
|
-
|
|
98
|
+
if (c < e.length) {
|
|
99
|
+
if ((l = e[c]) && s == l.key && r === l.type)
|
|
100
|
+
return c;
|
|
101
|
+
c++;
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
return -1;
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function tn(n, e, t, i, s) {
|
|
106
107
|
var r;
|
|
107
|
-
for (r in
|
|
108
|
-
r === "children" || r === "key" || r in e ||
|
|
108
|
+
for (r in t)
|
|
109
|
+
r === "children" || r === "key" || r in e || Ce(n, r, null, t[r], i);
|
|
109
110
|
for (r in e)
|
|
110
|
-
s && typeof e[r] != "function" || r === "children" || r === "key" || r === "value" || r === "checked" ||
|
|
111
|
+
s && typeof e[r] != "function" || r === "children" || r === "key" || r === "value" || r === "checked" || t[r] === e[r] || Ce(n, r, e[r], t[r], i);
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
e[0] === "-" ?
|
|
113
|
+
function Ze(n, e, t) {
|
|
114
|
+
e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || Qt.test(e) ? t : t + "px";
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function Ce(n, e, t, i, s) {
|
|
116
117
|
var r;
|
|
117
118
|
e:
|
|
118
119
|
if (e === "style")
|
|
119
|
-
if (typeof
|
|
120
|
-
|
|
120
|
+
if (typeof t == "string")
|
|
121
|
+
n.style.cssText = t;
|
|
121
122
|
else {
|
|
122
|
-
if (typeof i == "string" && (
|
|
123
|
+
if (typeof i == "string" && (n.style.cssText = i = ""), i)
|
|
123
124
|
for (e in i)
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
for (e in
|
|
127
|
-
i &&
|
|
125
|
+
t && e in t || Ze(n.style, e, "");
|
|
126
|
+
if (t)
|
|
127
|
+
for (e in t)
|
|
128
|
+
i && t[e] === i[e] || Ze(n.style, e, t[e]);
|
|
128
129
|
}
|
|
129
130
|
else if (e[0] === "o" && e[1] === "n")
|
|
130
|
-
r = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in
|
|
131
|
+
r = 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 + r] = t, t ? i ? t.u = i.u : (t.u = Date.now(), n.addEventListener(e, r ? Je : Ge, r)) : n.removeEventListener(e, r ? Je : Ge, r);
|
|
131
132
|
else if (e !== "dangerouslySetInnerHTML") {
|
|
132
133
|
if (s)
|
|
133
134
|
e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
134
|
-
else if (e !== "width" && e !== "height" && e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e !== "rowSpan" && e !== "colSpan" && e !== "role" && e in
|
|
135
|
+
else if (e !== "width" && e !== "height" && e !== "href" && e !== "list" && e !== "form" && e !== "tabIndex" && e !== "download" && e !== "rowSpan" && e !== "colSpan" && e !== "role" && e in n)
|
|
135
136
|
try {
|
|
136
|
-
|
|
137
|
+
n[e] = t == null ? "" : t;
|
|
137
138
|
break e;
|
|
138
139
|
} catch (o) {
|
|
139
140
|
}
|
|
140
|
-
typeof
|
|
141
|
+
typeof t == "function" || (t == null || t === !1 && e[4] !== "-" ? n.removeAttribute(e) : n.setAttribute(e, t));
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
var e = this.l[
|
|
145
|
-
if (
|
|
146
|
-
if (
|
|
144
|
+
function Ge(n) {
|
|
145
|
+
var e = this.l[n.type + !1];
|
|
146
|
+
if (n.t) {
|
|
147
|
+
if (n.t <= e.u)
|
|
147
148
|
return;
|
|
148
149
|
} else
|
|
149
|
-
|
|
150
|
-
return e(
|
|
150
|
+
n.t = Date.now();
|
|
151
|
+
return e(v.event ? v.event(n) : n);
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
-
return this.l[
|
|
153
|
+
function Je(n) {
|
|
154
|
+
return this.l[n.type + !0](v.event ? v.event(n) : n);
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
-
var h, a,
|
|
156
|
+
function Be(n, e, t, i, s, r, o, c, l, f) {
|
|
157
|
+
var h, a, _, p, d, g, k, b, C, x, S, E, L, N, R, A = e.type;
|
|
157
158
|
if (e.constructor !== void 0)
|
|
158
159
|
return null;
|
|
159
|
-
|
|
160
|
+
t.__h != null && (l = t.__h, c = e.__e = t.__e, e.__h = null, r = [c]), (h = v.__b) && h(e);
|
|
160
161
|
e:
|
|
161
162
|
if (typeof A == "function")
|
|
162
163
|
try {
|
|
163
|
-
if (
|
|
164
|
+
if (b = e.props, C = (h = A.contextType) && i[h.__c], x = h ? C ? C.props.value : h.__ : i, t.__c ? k = (a = e.__c = t.__c).__ = a.__E : ("prototype" in A && A.prototype.render ? e.__c = a = new A(b, x) : (e.__c = a = new M(b, x), a.constructor = A, a.render = sn), C && C.sub(a), a.props = b, a.state || (a.state = {}), a.context = x, a.__n = i, _ = a.__d = !0, a.__h = [], a._sb = []), a.__s == null && (a.__s = a.state), A.getDerivedStateFromProps != null && (a.__s == a.state && (a.__s = U({}, a.__s)), U(a.__s, A.getDerivedStateFromProps(b, a.__s))), p = a.props, d = a.state, a.__v = e, _)
|
|
164
165
|
A.getDerivedStateFromProps == null && a.componentWillMount != null && a.componentWillMount(), a.componentDidMount != null && a.__h.push(a.componentDidMount);
|
|
165
166
|
else {
|
|
166
|
-
if (A.getDerivedStateFromProps == null &&
|
|
167
|
-
for (e.__v !==
|
|
168
|
-
|
|
169
|
-
}),
|
|
170
|
-
a.__h.push(a._sb[
|
|
167
|
+
if (A.getDerivedStateFromProps == null && b !== p && a.componentWillReceiveProps != null && a.componentWillReceiveProps(b, x), !a.__e && (a.shouldComponentUpdate != null && a.shouldComponentUpdate(b, a.__s, x) === !1 || e.__v === t.__v)) {
|
|
168
|
+
for (e.__v !== t.__v && (a.props = b, a.state = a.__s, a.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(fe) {
|
|
169
|
+
fe && (fe.__ = e);
|
|
170
|
+
}), S = 0; S < a._sb.length; S++)
|
|
171
|
+
a.__h.push(a._sb[S]);
|
|
171
172
|
a._sb = [], a.__h.length && o.push(a);
|
|
172
173
|
break e;
|
|
173
174
|
}
|
|
174
|
-
a.componentWillUpdate != null && a.componentWillUpdate(
|
|
175
|
-
a.componentDidUpdate(
|
|
175
|
+
a.componentWillUpdate != null && a.componentWillUpdate(b, a.__s, x), a.componentDidUpdate != null && a.__h.push(function() {
|
|
176
|
+
a.componentDidUpdate(p, d, g);
|
|
176
177
|
});
|
|
177
178
|
}
|
|
178
|
-
if (a.context =
|
|
179
|
-
for (a.state = a.__s, a.__d = !1,
|
|
180
|
-
a.__h.push(a._sb[
|
|
179
|
+
if (a.context = x, a.props = b, a.__P = n, a.__e = !1, E = v.__r, L = 0, "prototype" in A && A.prototype.render) {
|
|
180
|
+
for (a.state = a.__s, a.__d = !1, E && E(e), h = a.render(a.props, a.state, a.context), N = 0; N < a._sb.length; N++)
|
|
181
|
+
a.__h.push(a._sb[N]);
|
|
181
182
|
a._sb = [];
|
|
182
183
|
} else
|
|
183
184
|
do
|
|
184
|
-
a.__d = !1,
|
|
185
|
-
while (a.__d && ++
|
|
186
|
-
a.state = a.__s, a.getChildContext != null && (i =
|
|
187
|
-
} catch (
|
|
188
|
-
e.__v = null, (
|
|
185
|
+
a.__d = !1, E && E(e), h = a.render(a.props, a.state, a.context), a.state = a.__s;
|
|
186
|
+
while (a.__d && ++L < 25);
|
|
187
|
+
a.state = a.__s, a.getChildContext != null && (i = U(U({}, i), a.getChildContext())), _ || a.getSnapshotBeforeUpdate == null || (g = a.getSnapshotBeforeUpdate(p, d)), At(n, Te(R = h != null && h.type === K && h.key == null ? h.props.children : h) ? R : [R], e, t, i, s, r, o, c, l, f), a.base = e.__e, e.__h = null, a.__h.length && o.push(a), k && (a.__E = a.__ = null);
|
|
188
|
+
} catch (fe) {
|
|
189
|
+
e.__v = null, (l || r != null) && (e.__e = c, e.__h = !!l, r[r.indexOf(c)] = null), v.__e(fe, e, t);
|
|
189
190
|
}
|
|
190
191
|
else
|
|
191
|
-
r == null && e.__v ===
|
|
192
|
-
(h =
|
|
192
|
+
r == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = nn(t.__e, e, t, i, s, r, o, l, f);
|
|
193
|
+
(h = v.diffed) && h(e);
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
for (var i = 0; i <
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
function Mt(n, e, t) {
|
|
196
|
+
for (var i = 0; i < t.length; i++)
|
|
197
|
+
Fe(t[i], t[++i], t[++i]);
|
|
198
|
+
v.__c && v.__c(e, n), n.some(function(s) {
|
|
198
199
|
try {
|
|
199
|
-
|
|
200
|
+
n = s.__h, s.__h = [], n.some(function(r) {
|
|
200
201
|
r.call(s);
|
|
201
202
|
});
|
|
202
203
|
} catch (r) {
|
|
203
|
-
|
|
204
|
+
v.__e(r, s.__v);
|
|
204
205
|
}
|
|
205
206
|
});
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
-
var
|
|
209
|
-
if (
|
|
210
|
-
for (;
|
|
211
|
-
if ((
|
|
212
|
-
|
|
208
|
+
function nn(n, e, t, i, s, r, o, c, l) {
|
|
209
|
+
var f, h, a, _ = t.props, p = e.props, d = e.type, g = 0;
|
|
210
|
+
if (d === "svg" && (s = !0), r != null) {
|
|
211
|
+
for (; g < r.length; g++)
|
|
212
|
+
if ((f = r[g]) && "setAttribute" in f == !!d && (d ? f.localName === d : f.nodeType === 3)) {
|
|
213
|
+
n = f, r[g] = null;
|
|
213
214
|
break;
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
if (
|
|
217
|
-
if (
|
|
218
|
-
return document.createTextNode(
|
|
219
|
-
|
|
217
|
+
if (n == null) {
|
|
218
|
+
if (d === null)
|
|
219
|
+
return document.createTextNode(p);
|
|
220
|
+
n = s ? document.createElementNS("http://www.w3.org/2000/svg", d) : document.createElement(d, p.is && p), r = null, c = !1;
|
|
220
221
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
222
|
+
if (d === null)
|
|
223
|
+
_ === p || c && n.data === p || (n.data = p);
|
|
223
224
|
else {
|
|
224
|
-
if (r = r &&
|
|
225
|
+
if (r = r && $e.call(n.childNodes), h = (_ = t.props || G).dangerouslySetInnerHTML, a = p.dangerouslySetInnerHTML, !c) {
|
|
225
226
|
if (r != null)
|
|
226
|
-
for (
|
|
227
|
-
|
|
228
|
-
(a || h) && (a && (h && a.__html == h.__html || a.__html ===
|
|
227
|
+
for (_ = {}, g = 0; g < n.attributes.length; g++)
|
|
228
|
+
_[n.attributes[g].name] = n.attributes[g].value;
|
|
229
|
+
(a || h) && (a && (h && a.__html == h.__html || a.__html === n.innerHTML) || (n.innerHTML = a && a.__html || ""));
|
|
229
230
|
}
|
|
230
|
-
if (
|
|
231
|
+
if (tn(n, p, _, s, c), a)
|
|
231
232
|
e.__k = [];
|
|
232
|
-
else if (
|
|
233
|
-
for (
|
|
234
|
-
r[
|
|
235
|
-
|
|
233
|
+
else if (At(n, Te(g = e.props.children) ? g : [g], e, t, i, s && d !== "foreignObject", r, o, r ? r[0] : t.__k && oe(t, 0), c, l), r != null)
|
|
234
|
+
for (g = r.length; g--; )
|
|
235
|
+
r[g] != null && xt(r[g]);
|
|
236
|
+
c || ("value" in p && (g = p.value) !== void 0 && (g !== n.value || d === "progress" && !g || d === "option" && g !== _.value) && Ce(n, "value", g, _.value, !1), "checked" in p && (g = p.checked) !== void 0 && g !== n.checked && Ce(n, "checked", g, _.checked, !1));
|
|
236
237
|
}
|
|
237
|
-
return
|
|
238
|
+
return n;
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
+
function Fe(n, e, t) {
|
|
240
241
|
try {
|
|
241
|
-
typeof
|
|
242
|
+
typeof n == "function" ? n(e) : n.current = e;
|
|
242
243
|
} catch (i) {
|
|
243
|
-
|
|
244
|
+
v.__e(i, t);
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
+
function Re(n, e, t) {
|
|
247
248
|
var i, s;
|
|
248
|
-
if (
|
|
249
|
+
if (v.unmount && v.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Fe(i, null, e)), (i = n.__c) != null) {
|
|
249
250
|
if (i.componentWillUnmount)
|
|
250
251
|
try {
|
|
251
252
|
i.componentWillUnmount();
|
|
252
253
|
} catch (r) {
|
|
253
|
-
|
|
254
|
+
v.__e(r, e);
|
|
254
255
|
}
|
|
255
|
-
i.base = i.__P = null,
|
|
256
|
+
i.base = i.__P = null, n.__c = void 0;
|
|
256
257
|
}
|
|
257
|
-
if (i =
|
|
258
|
+
if (i = n.__k)
|
|
258
259
|
for (s = 0; s < i.length; s++)
|
|
259
|
-
i[s] &&
|
|
260
|
-
|
|
260
|
+
i[s] && Re(i[s], e, t || typeof n.type != "function");
|
|
261
|
+
t || n.__e == null || xt(n.__e), n.__ = n.__e = n.__d = void 0;
|
|
261
262
|
}
|
|
262
|
-
function
|
|
263
|
-
return this.constructor(
|
|
263
|
+
function sn(n, e, t) {
|
|
264
|
+
return this.constructor(n, t);
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
+
function Z(n, e, t) {
|
|
266
267
|
var i, s, r, o;
|
|
267
|
-
|
|
268
|
+
v.__ && v.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, r = [], o = [], Be(e, n = (!i && t || e).__k = H(K, null, [n]), s || G, G, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? $e.call(e.childNodes) : null, r, !i && t ? t : s ? s.__e : e.firstChild, i, o), Mt(r, n, o);
|
|
268
269
|
}
|
|
269
|
-
|
|
270
|
+
$e = kt.slice, v = { __e: function(n, e, t, i) {
|
|
270
271
|
for (var s, r, o; e = e.__; )
|
|
271
272
|
if ((s = e.__c) && !s.__)
|
|
272
273
|
try {
|
|
273
|
-
if ((r = s.constructor) && r.getDerivedStateFromError != null && (s.setState(r.getDerivedStateFromError(
|
|
274
|
+
if ((r = s.constructor) && r.getDerivedStateFromError != null && (s.setState(r.getDerivedStateFromError(n)), o = s.__d), s.componentDidCatch != null && (s.componentDidCatch(n, i || {}), o = s.__d), o)
|
|
274
275
|
return s.__E = s;
|
|
275
|
-
} catch (
|
|
276
|
-
|
|
276
|
+
} catch (c) {
|
|
277
|
+
n = c;
|
|
277
278
|
}
|
|
278
|
-
throw
|
|
279
|
-
} },
|
|
280
|
-
return
|
|
281
|
-
}, M.prototype.setState = function(
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
}, M.prototype.forceUpdate = function(
|
|
285
|
-
this.__v && (this.__e = !0,
|
|
286
|
-
}, M.prototype.render =
|
|
287
|
-
return
|
|
288
|
-
},
|
|
289
|
-
const
|
|
290
|
-
function
|
|
291
|
-
let r = "".concat(
|
|
292
|
-
return
|
|
293
|
-
}
|
|
294
|
-
class
|
|
279
|
+
throw n;
|
|
280
|
+
} }, Et = 0, $t = function(n) {
|
|
281
|
+
return n != null && n.constructor === void 0;
|
|
282
|
+
}, M.prototype.setState = function(n, e) {
|
|
283
|
+
var t;
|
|
284
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = U({}, this.state), typeof n == "function" && (n = n(U({}, t), this.props)), n && U(t, n), n != null && this.__v && (e && this._sb.push(e), Xe(this));
|
|
285
|
+
}, M.prototype.forceUpdate = function(n) {
|
|
286
|
+
this.__v && (this.__e = !0, n && this.__h.push(n), Xe(this));
|
|
287
|
+
}, M.prototype.render = K, j = [], Tt = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Le = function(n, e) {
|
|
288
|
+
return n.__v.__b - e.__v.__b;
|
|
289
|
+
}, be.__r = 0;
|
|
290
|
+
const rn = "ibiz", on = "is-";
|
|
291
|
+
function F(n, e, t, i, s) {
|
|
292
|
+
let r = "".concat(n, "-").concat(e);
|
|
293
|
+
return t && (r += "-".concat(t)), i && (r += "__".concat(i)), s && (r += "--".concat(s)), r;
|
|
294
|
+
}
|
|
295
|
+
class D {
|
|
295
296
|
/**
|
|
296
297
|
* Creates an instance of Namespace.
|
|
297
298
|
*
|
|
@@ -300,7 +301,7 @@ class U {
|
|
|
300
301
|
* @param {string} block 当前命名空间的根模块,例如组件的名称
|
|
301
302
|
* @param {string} [namespace] 指定命名空间,未指定使用默认值 ibiz
|
|
302
303
|
*/
|
|
303
|
-
constructor(e,
|
|
304
|
+
constructor(e, t) {
|
|
304
305
|
/**
|
|
305
306
|
* 命名空间
|
|
306
307
|
*
|
|
@@ -308,8 +309,8 @@ class U {
|
|
|
308
309
|
* @date 2023-11-03 10:11:31
|
|
309
310
|
* @type {string}
|
|
310
311
|
*/
|
|
311
|
-
|
|
312
|
-
this.block = e, this.namespace =
|
|
312
|
+
y(this, "namespace");
|
|
313
|
+
this.block = e, this.namespace = t || rn;
|
|
313
314
|
}
|
|
314
315
|
/**
|
|
315
316
|
* namespace-block
|
|
@@ -321,7 +322,7 @@ class U {
|
|
|
321
322
|
* @return {*} {string}
|
|
322
323
|
*/
|
|
323
324
|
b(e = "") {
|
|
324
|
-
return
|
|
325
|
+
return F(this.namespace, this.block, e, "", "");
|
|
325
326
|
}
|
|
326
327
|
/**
|
|
327
328
|
* namespace-block__element
|
|
@@ -332,7 +333,7 @@ class U {
|
|
|
332
333
|
* @return {*} {string}
|
|
333
334
|
*/
|
|
334
335
|
e(e) {
|
|
335
|
-
return e ?
|
|
336
|
+
return e ? F(this.namespace, this.block, "", e, "") : "";
|
|
336
337
|
}
|
|
337
338
|
/**
|
|
338
339
|
* namespace-block--modifier
|
|
@@ -343,7 +344,7 @@ class U {
|
|
|
343
344
|
* @return {*} {string}
|
|
344
345
|
*/
|
|
345
346
|
m(e) {
|
|
346
|
-
return e ?
|
|
347
|
+
return e ? F(this.namespace, this.block, "", "", e) : "";
|
|
347
348
|
}
|
|
348
349
|
/**
|
|
349
350
|
* namespace-block-blockSuffix__element
|
|
@@ -354,8 +355,8 @@ class U {
|
|
|
354
355
|
* @param {string} [element]
|
|
355
356
|
* @return {*} {string}
|
|
356
357
|
*/
|
|
357
|
-
be(e,
|
|
358
|
-
return e &&
|
|
358
|
+
be(e, t) {
|
|
359
|
+
return e && t ? F(this.namespace, this.block, e, t, "") : "";
|
|
359
360
|
}
|
|
360
361
|
/**
|
|
361
362
|
* namespace-block__element--modifier
|
|
@@ -366,8 +367,8 @@ class U {
|
|
|
366
367
|
* @param {string} [modifier]
|
|
367
368
|
* @return {*} {string}
|
|
368
369
|
*/
|
|
369
|
-
em(e,
|
|
370
|
-
return e &&
|
|
370
|
+
em(e, t) {
|
|
371
|
+
return e && t ? F(this.namespace, this.block, "", e, t) : "";
|
|
371
372
|
}
|
|
372
373
|
/**
|
|
373
374
|
* namespace-block-blockSuffix--modifier
|
|
@@ -378,8 +379,8 @@ class U {
|
|
|
378
379
|
* @param {string} [modifier]
|
|
379
380
|
* @return {*} {string}
|
|
380
381
|
*/
|
|
381
|
-
bm(e,
|
|
382
|
-
return e &&
|
|
382
|
+
bm(e, t) {
|
|
383
|
+
return e && t ? F(this.namespace, this.block, e, "", t) : "";
|
|
383
384
|
}
|
|
384
385
|
/**
|
|
385
386
|
* namespace-block-blockSuffix__element--modifier
|
|
@@ -391,8 +392,8 @@ class U {
|
|
|
391
392
|
* @param {string} [modifier]
|
|
392
393
|
* @return {*} {string}
|
|
393
394
|
*/
|
|
394
|
-
bem(e,
|
|
395
|
-
return e &&
|
|
395
|
+
bem(e, t, i) {
|
|
396
|
+
return e && t && i ? F(this.namespace, this.block, e, t, i) : "";
|
|
396
397
|
}
|
|
397
398
|
/**
|
|
398
399
|
* 返回状态 class
|
|
@@ -406,8 +407,8 @@ class U {
|
|
|
406
407
|
* @param {boolean} [state]
|
|
407
408
|
* @return {*} {string}
|
|
408
409
|
*/
|
|
409
|
-
is(e,
|
|
410
|
-
return e &&
|
|
410
|
+
is(e, t) {
|
|
411
|
+
return e && t ? "".concat(on).concat(e) : "";
|
|
411
412
|
}
|
|
412
413
|
/**
|
|
413
414
|
* 生成使用到的 css 变量 style 对象
|
|
@@ -418,10 +419,10 @@ class U {
|
|
|
418
419
|
* @return {*} {Record<string, string>}
|
|
419
420
|
*/
|
|
420
421
|
cssVar(e) {
|
|
421
|
-
const
|
|
422
|
+
const t = {};
|
|
422
423
|
for (const i in e)
|
|
423
|
-
e[i] && (
|
|
424
|
-
return
|
|
424
|
+
e[i] && (t[this.cssVarName(i)] = e[i]);
|
|
425
|
+
return t;
|
|
425
426
|
}
|
|
426
427
|
/**
|
|
427
428
|
* 生成使用到的 css block 变量 style 对象
|
|
@@ -432,10 +433,10 @@ class U {
|
|
|
432
433
|
* @return {*} {Record<string, string>}
|
|
433
434
|
*/
|
|
434
435
|
cssVarBlock(e) {
|
|
435
|
-
const
|
|
436
|
+
const t = {};
|
|
436
437
|
for (const i in e)
|
|
437
|
-
e[i] && (
|
|
438
|
-
return
|
|
438
|
+
e[i] && (t[this.cssVarBlockName(i)] = e[i]);
|
|
439
|
+
return t;
|
|
439
440
|
}
|
|
440
441
|
/**
|
|
441
442
|
* 生成 css var 变量名称
|
|
@@ -460,61 +461,61 @@ class U {
|
|
|
460
461
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
461
462
|
}
|
|
462
463
|
}
|
|
463
|
-
function z(
|
|
464
|
-
if (typeof
|
|
465
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
464
|
+
function z(n) {
|
|
465
|
+
if (typeof n != "string")
|
|
466
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
466
467
|
}
|
|
467
|
-
function
|
|
468
|
-
for (var
|
|
469
|
-
if (
|
|
470
|
-
o =
|
|
468
|
+
function Ke(n, e) {
|
|
469
|
+
for (var t = "", i = 0, s = -1, r = 0, o, c = 0; c <= n.length; ++c) {
|
|
470
|
+
if (c < n.length)
|
|
471
|
+
o = n.charCodeAt(c);
|
|
471
472
|
else {
|
|
472
473
|
if (o === 47)
|
|
473
474
|
break;
|
|
474
475
|
o = 47;
|
|
475
476
|
}
|
|
476
477
|
if (o === 47) {
|
|
477
|
-
if (!(s ===
|
|
478
|
-
if (s !==
|
|
479
|
-
if (
|
|
480
|
-
if (
|
|
481
|
-
var
|
|
482
|
-
if (
|
|
483
|
-
|
|
478
|
+
if (!(s === c - 1 || r === 1))
|
|
479
|
+
if (s !== c - 1 && r === 2) {
|
|
480
|
+
if (t.length < 2 || i !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
|
|
481
|
+
if (t.length > 2) {
|
|
482
|
+
var l = t.lastIndexOf("/");
|
|
483
|
+
if (l !== t.length - 1) {
|
|
484
|
+
l === -1 ? (t = "", i = 0) : (t = t.slice(0, l), i = t.length - 1 - t.lastIndexOf("/")), s = c, r = 0;
|
|
484
485
|
continue;
|
|
485
486
|
}
|
|
486
|
-
} else if (
|
|
487
|
-
|
|
487
|
+
} else if (t.length === 2 || t.length === 1) {
|
|
488
|
+
t = "", i = 0, s = c, r = 0;
|
|
488
489
|
continue;
|
|
489
490
|
}
|
|
490
491
|
}
|
|
491
|
-
e && (
|
|
492
|
+
e && (t.length > 0 ? t += "/.." : t = "..", i = 2);
|
|
492
493
|
} else
|
|
493
|
-
|
|
494
|
-
s =
|
|
494
|
+
t.length > 0 ? t += "/" + n.slice(s + 1, c) : t = n.slice(s + 1, c), i = c - s - 1;
|
|
495
|
+
s = c, r = 0;
|
|
495
496
|
} else
|
|
496
497
|
o === 46 && r !== -1 ? ++r : r = -1;
|
|
497
498
|
}
|
|
498
|
-
return
|
|
499
|
+
return t;
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
-
var
|
|
502
|
-
return
|
|
501
|
+
function an(n, e) {
|
|
502
|
+
var t = e.dir || e.root, i = e.base || (e.name || "") + (e.ext || "");
|
|
503
|
+
return t ? t === e.root ? t + i : t + n + i : i;
|
|
503
504
|
}
|
|
504
|
-
var
|
|
505
|
+
var ie = {
|
|
505
506
|
// path.resolve([from ...], to)
|
|
506
507
|
resolve: function() {
|
|
507
|
-
for (var e = "",
|
|
508
|
+
for (var e = "", t = !1, i, s = arguments.length - 1; s >= -1 && !t; s--) {
|
|
508
509
|
var r;
|
|
509
|
-
s >= 0 ? r = arguments[s] : (i === void 0 && (i = process.cwd()), r = i), z(r), r.length !== 0 && (e = r + "/" + e,
|
|
510
|
+
s >= 0 ? r = arguments[s] : (i === void 0 && (i = process.cwd()), r = i), z(r), r.length !== 0 && (e = r + "/" + e, t = r.charCodeAt(0) === 47);
|
|
510
511
|
}
|
|
511
|
-
return e =
|
|
512
|
+
return e = Ke(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
512
513
|
},
|
|
513
514
|
normalize: function(e) {
|
|
514
515
|
if (z(e), e.length === 0)
|
|
515
516
|
return ".";
|
|
516
|
-
var
|
|
517
|
-
return e =
|
|
517
|
+
var t = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
|
|
518
|
+
return e = Ke(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && i && (e += "/"), t ? "/" + e : e;
|
|
518
519
|
},
|
|
519
520
|
isAbsolute: function(e) {
|
|
520
521
|
return z(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
@@ -522,39 +523,39 @@ var J = {
|
|
|
522
523
|
join: function() {
|
|
523
524
|
if (arguments.length === 0)
|
|
524
525
|
return ".";
|
|
525
|
-
for (var e,
|
|
526
|
-
var i = arguments[
|
|
526
|
+
for (var e, t = 0; t < arguments.length; ++t) {
|
|
527
|
+
var i = arguments[t];
|
|
527
528
|
z(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
|
|
528
529
|
}
|
|
529
|
-
return e === void 0 ? "." :
|
|
530
|
+
return e === void 0 ? "." : ie.normalize(e);
|
|
530
531
|
},
|
|
531
|
-
relative: function(e,
|
|
532
|
-
if (z(e), z(
|
|
532
|
+
relative: function(e, t) {
|
|
533
|
+
if (z(e), z(t), e === t || (e = ie.resolve(e), t = ie.resolve(t), e === t))
|
|
533
534
|
return "";
|
|
534
535
|
for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i)
|
|
535
536
|
;
|
|
536
|
-
for (var s = e.length, r = s - i, o = 1; o <
|
|
537
|
+
for (var s = e.length, r = s - i, o = 1; o < t.length && t.charCodeAt(o) === 47; ++o)
|
|
537
538
|
;
|
|
538
|
-
for (var
|
|
539
|
-
if (a ===
|
|
540
|
-
if (
|
|
541
|
-
if (
|
|
542
|
-
return
|
|
539
|
+
for (var c = t.length, l = c - o, f = r < l ? r : l, h = -1, a = 0; a <= f; ++a) {
|
|
540
|
+
if (a === f) {
|
|
541
|
+
if (l > f) {
|
|
542
|
+
if (t.charCodeAt(o + a) === 47)
|
|
543
|
+
return t.slice(o + a + 1);
|
|
543
544
|
if (a === 0)
|
|
544
|
-
return
|
|
545
|
+
return t.slice(o + a);
|
|
545
546
|
} else
|
|
546
|
-
r >
|
|
547
|
+
r > f && (e.charCodeAt(i + a) === 47 ? h = a : a === 0 && (h = 0));
|
|
547
548
|
break;
|
|
548
549
|
}
|
|
549
|
-
var
|
|
550
|
-
if (
|
|
550
|
+
var _ = e.charCodeAt(i + a), p = t.charCodeAt(o + a);
|
|
551
|
+
if (_ !== p)
|
|
551
552
|
break;
|
|
552
|
-
|
|
553
|
+
_ === 47 && (h = a);
|
|
553
554
|
}
|
|
554
|
-
var
|
|
555
|
+
var d = "";
|
|
555
556
|
for (a = i + h + 1; a <= s; ++a)
|
|
556
|
-
(a === s || e.charCodeAt(a) === 47) && (
|
|
557
|
-
return
|
|
557
|
+
(a === s || e.charCodeAt(a) === 47) && (d.length === 0 ? d += ".." : d += "/..");
|
|
558
|
+
return d.length > 0 ? d + t.slice(o + h) : (o += h, t.charCodeAt(o) === 47 && ++o, t.slice(o));
|
|
558
559
|
},
|
|
559
560
|
_makeLong: function(e) {
|
|
560
561
|
return e;
|
|
@@ -562,8 +563,8 @@ var J = {
|
|
|
562
563
|
dirname: function(e) {
|
|
563
564
|
if (z(e), e.length === 0)
|
|
564
565
|
return ".";
|
|
565
|
-
for (var
|
|
566
|
-
if (
|
|
566
|
+
for (var t = e.charCodeAt(0), i = t === 47, s = -1, r = !0, o = e.length - 1; o >= 1; --o)
|
|
567
|
+
if (t = e.charCodeAt(o), t === 47) {
|
|
567
568
|
if (!r) {
|
|
568
569
|
s = o;
|
|
569
570
|
break;
|
|
@@ -572,26 +573,26 @@ var J = {
|
|
|
572
573
|
r = !1;
|
|
573
574
|
return s === -1 ? i ? "/" : "." : i && s === 1 ? "//" : e.slice(0, s);
|
|
574
575
|
},
|
|
575
|
-
basename: function(e,
|
|
576
|
-
if (
|
|
576
|
+
basename: function(e, t) {
|
|
577
|
+
if (t !== void 0 && typeof t != "string")
|
|
577
578
|
throw new TypeError('"ext" argument must be a string');
|
|
578
579
|
z(e);
|
|
579
580
|
var i = 0, s = -1, r = !0, o;
|
|
580
|
-
if (
|
|
581
|
-
if (
|
|
581
|
+
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
582
|
+
if (t.length === e.length && t === e)
|
|
582
583
|
return "";
|
|
583
|
-
var
|
|
584
|
+
var c = t.length - 1, l = -1;
|
|
584
585
|
for (o = e.length - 1; o >= 0; --o) {
|
|
585
|
-
var
|
|
586
|
-
if (
|
|
586
|
+
var f = e.charCodeAt(o);
|
|
587
|
+
if (f === 47) {
|
|
587
588
|
if (!r) {
|
|
588
589
|
i = o + 1;
|
|
589
590
|
break;
|
|
590
591
|
}
|
|
591
592
|
} else
|
|
592
|
-
|
|
593
|
+
l === -1 && (r = !1, l = o + 1), c >= 0 && (f === t.charCodeAt(c) ? --c === -1 && (s = o) : (c = -1, s = l));
|
|
593
594
|
}
|
|
594
|
-
return i === s ? s =
|
|
595
|
+
return i === s ? s = l : s === -1 && (s = e.length), e.slice(i, s);
|
|
595
596
|
} else {
|
|
596
597
|
for (o = e.length - 1; o >= 0; --o)
|
|
597
598
|
if (e.charCodeAt(o) === 47) {
|
|
@@ -606,60 +607,60 @@ var J = {
|
|
|
606
607
|
},
|
|
607
608
|
extname: function(e) {
|
|
608
609
|
z(e);
|
|
609
|
-
for (var
|
|
610
|
-
var
|
|
611
|
-
if (
|
|
610
|
+
for (var t = -1, i = 0, s = -1, r = !0, o = 0, c = e.length - 1; c >= 0; --c) {
|
|
611
|
+
var l = e.charCodeAt(c);
|
|
612
|
+
if (l === 47) {
|
|
612
613
|
if (!r) {
|
|
613
|
-
i =
|
|
614
|
+
i = c + 1;
|
|
614
615
|
break;
|
|
615
616
|
}
|
|
616
617
|
continue;
|
|
617
618
|
}
|
|
618
|
-
s === -1 && (r = !1, s =
|
|
619
|
+
s === -1 && (r = !1, s = c + 1), l === 46 ? t === -1 ? t = c : o !== 1 && (o = 1) : t !== -1 && (o = -1);
|
|
619
620
|
}
|
|
620
|
-
return
|
|
621
|
+
return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
|
|
621
622
|
o === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
622
|
-
o === 1 &&
|
|
623
|
+
o === 1 && t === s - 1 && t === i + 1 ? "" : e.slice(t, s);
|
|
623
624
|
},
|
|
624
625
|
format: function(e) {
|
|
625
626
|
if (e === null || typeof e != "object")
|
|
626
627
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
|
|
627
|
-
return
|
|
628
|
+
return an("/", e);
|
|
628
629
|
},
|
|
629
630
|
parse: function(e) {
|
|
630
631
|
z(e);
|
|
631
|
-
var
|
|
632
|
+
var t = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
632
633
|
if (e.length === 0)
|
|
633
|
-
return
|
|
634
|
+
return t;
|
|
634
635
|
var i = e.charCodeAt(0), s = i === 47, r;
|
|
635
|
-
s ? (
|
|
636
|
-
for (var o = -1,
|
|
636
|
+
s ? (t.root = "/", r = 1) : r = 0;
|
|
637
|
+
for (var o = -1, c = 0, l = -1, f = !0, h = e.length - 1, a = 0; h >= r; --h) {
|
|
637
638
|
if (i = e.charCodeAt(h), i === 47) {
|
|
638
|
-
if (!
|
|
639
|
-
|
|
639
|
+
if (!f) {
|
|
640
|
+
c = h + 1;
|
|
640
641
|
break;
|
|
641
642
|
}
|
|
642
643
|
continue;
|
|
643
644
|
}
|
|
644
|
-
|
|
645
|
+
l === -1 && (f = !1, l = h + 1), i === 46 ? o === -1 ? o = h : a !== 1 && (a = 1) : o !== -1 && (a = -1);
|
|
645
646
|
}
|
|
646
|
-
return o === -1 ||
|
|
647
|
+
return o === -1 || l === -1 || // We saw a non-dot character immediately before the dot
|
|
647
648
|
a === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
648
|
-
a === 1 && o ===
|
|
649
|
+
a === 1 && o === l - 1 && o === c + 1 ? l !== -1 && (c === 0 && s ? t.base = t.name = e.slice(1, l) : t.base = t.name = e.slice(c, l)) : (c === 0 && s ? (t.name = e.slice(1, o), t.base = e.slice(1, l)) : (t.name = e.slice(c, o), t.base = e.slice(c, l)), t.ext = e.slice(o, l)), c > 0 ? t.dir = e.slice(0, c - 1) : s && (t.dir = "/"), t;
|
|
649
650
|
},
|
|
650
651
|
sep: "/",
|
|
651
652
|
delimiter: ":",
|
|
652
653
|
win32: null,
|
|
653
654
|
posix: null
|
|
654
655
|
};
|
|
655
|
-
|
|
656
|
-
function
|
|
656
|
+
ie.posix = ie;
|
|
657
|
+
function P() {
|
|
657
658
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
-
return "".concat(
|
|
660
|
+
function zt() {
|
|
661
|
+
return "".concat(P() + P(), "-").concat(P(), "-").concat(P(), "-").concat(P(), "-").concat(P()).concat(P()).concat(P());
|
|
661
662
|
}
|
|
662
|
-
class
|
|
663
|
+
class Ht {
|
|
663
664
|
/**
|
|
664
665
|
* 拷贝文本
|
|
665
666
|
*
|
|
@@ -680,341 +681,621 @@ class kt {
|
|
|
680
681
|
* @private
|
|
681
682
|
* @type {(HTMLInputElement | null)}
|
|
682
683
|
*/
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
684
|
+
y(Ht, "inputElement", null);
|
|
685
|
+
const m = class m {
|
|
686
|
+
/**
|
|
687
|
+
* 检查数据库是否存在
|
|
688
|
+
*
|
|
689
|
+
* @param {string} storeName
|
|
690
|
+
* @return {*} {Promise<boolean>}
|
|
691
|
+
* @memberof IndexedDBUtil
|
|
692
|
+
*/
|
|
693
|
+
static async checkDataBaseExists(e) {
|
|
694
|
+
try {
|
|
695
|
+
return (await indexedDB.databases()).some((i) => i.name === e);
|
|
696
|
+
} catch (t) {
|
|
697
|
+
return console.error("检查数据库是否存在时出错:", t), !1;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* 删除数据库
|
|
702
|
+
*
|
|
703
|
+
* @return {*} {Promise<void>}
|
|
704
|
+
* @memberof IndexedDBUtil
|
|
705
|
+
*/
|
|
706
|
+
static async deleteDatabase(e) {
|
|
707
|
+
var t, i;
|
|
708
|
+
return m.lastLink && ((i = (t = m.lastLink).close) == null || i.call(t)), new Promise((s, r) => {
|
|
709
|
+
const o = indexedDB.deleteDatabase(e);
|
|
710
|
+
o.onsuccess = () => {
|
|
711
|
+
s(!0);
|
|
712
|
+
}, o.onerror = () => {
|
|
713
|
+
s(!1);
|
|
714
|
+
}, o.onblocked = () => {
|
|
715
|
+
console.warn("删除数据库 ".concat(e, " 被阻塞,可能有其他连接正在使用该数据库。")), r(new Error("删除数据库 ".concat(e, " 被阻塞")));
|
|
716
|
+
};
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* 检查是否存在某个库以及库内是否存在某个表
|
|
721
|
+
*
|
|
722
|
+
* @param {string} storeName
|
|
723
|
+
* @param {string} tableName
|
|
724
|
+
* @return {*}
|
|
725
|
+
* @memberof IndexedDBUtil
|
|
726
|
+
*/
|
|
727
|
+
static async checkTableExists(e, t) {
|
|
728
|
+
return await m.checkDataBaseExists(e) ? new Promise((s, r) => {
|
|
729
|
+
const o = indexedDB.open(e);
|
|
730
|
+
o.onupgradeneeded = (c) => {
|
|
731
|
+
m.db = c.target.result, m.version = m.db.version;
|
|
732
|
+
}, o.onsuccess = (c) => {
|
|
733
|
+
m.db = c.target.result, m.lastLink = o.result;
|
|
734
|
+
const l = m.db.objectStoreNames.contains(t);
|
|
735
|
+
o.result.close(), s(l);
|
|
736
|
+
}, o.onerror = (c) => {
|
|
737
|
+
r(c.target.error);
|
|
738
|
+
};
|
|
739
|
+
}) : !1;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* 创建表
|
|
743
|
+
*
|
|
744
|
+
* @param {string} storeName 库名称
|
|
745
|
+
* @param {(string | null)} keyPath 表主键
|
|
746
|
+
* @param {boolean} [useAutoIncrement=false] 是否使用自增
|
|
747
|
+
* @return {*} {Promise<void>}
|
|
748
|
+
* @memberof IndexedDBUtil
|
|
749
|
+
*/
|
|
750
|
+
static async createTable(e, t, i, s = !1) {
|
|
751
|
+
return new Promise((r) => {
|
|
752
|
+
var c, l;
|
|
753
|
+
m.version += 1, m.lastLink && ((l = (c = m.lastLink).close) == null || l.call(c));
|
|
754
|
+
const o = indexedDB.open(e, m.version);
|
|
755
|
+
o.onupgradeneeded = (f) => {
|
|
756
|
+
if (m.db = f.target.result, !m.db.objectStoreNames.contains(t)) {
|
|
757
|
+
const h = {};
|
|
758
|
+
i ? h.keyPath = i : s && (h.autoIncrement = !0), m.db.createObjectStore(t, h);
|
|
759
|
+
}
|
|
760
|
+
}, o.onsuccess = () => {
|
|
761
|
+
m.lastLink = o.result, o.result.close(), r(!0);
|
|
762
|
+
}, o.onerror = () => {
|
|
763
|
+
r(!1);
|
|
764
|
+
};
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* 删除表
|
|
769
|
+
*
|
|
770
|
+
* @param {string} storeName 表名称
|
|
771
|
+
* @return {*} {Promise<void>}
|
|
772
|
+
* @memberof IndexedDBUtil
|
|
773
|
+
*/
|
|
774
|
+
static async deleteTable(e, t) {
|
|
775
|
+
return new Promise((i) => {
|
|
776
|
+
var r, o;
|
|
777
|
+
m.version += 1, m.lastLink && ((o = (r = m.lastLink).close) == null || o.call(r));
|
|
778
|
+
const s = indexedDB.open(e, m.version);
|
|
779
|
+
s.onupgradeneeded = (c) => {
|
|
780
|
+
m.db = c.target.result, m.lastLink = s.result, m.db.objectStoreNames.contains(t) && m.db.deleteObjectStore(t);
|
|
781
|
+
}, s.onsuccess = (c) => {
|
|
782
|
+
m.db = c.target.result, m.lastLink = s.result, s.result.close(), i(!0);
|
|
783
|
+
}, s.onerror = () => {
|
|
784
|
+
s.result.close(), i(!1);
|
|
785
|
+
};
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* 新增数据
|
|
790
|
+
*
|
|
791
|
+
* @param {string} storeName 表名称
|
|
792
|
+
* @param {*} data 新增数据
|
|
793
|
+
* @return {*} {Promise<void>}
|
|
794
|
+
* @memberof IndexedDBUtil
|
|
795
|
+
*/
|
|
796
|
+
static async addData(e, t, i) {
|
|
797
|
+
return new Promise((s, r) => {
|
|
798
|
+
const o = indexedDB.open(e);
|
|
799
|
+
o.onsuccess = (c) => {
|
|
800
|
+
if (m.db = c.target.result, m.lastLink = o.result, m.db.objectStoreNames.contains(t)) {
|
|
801
|
+
const h = m.db.transaction([t], "readwrite").objectStore(t).add(i);
|
|
802
|
+
h.onsuccess = (a) => {
|
|
803
|
+
s(i);
|
|
804
|
+
}, h.onerror = () => {
|
|
805
|
+
s(null);
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
o.result.close();
|
|
809
|
+
}, o.onerror = () => {
|
|
810
|
+
o.result.close(), r();
|
|
811
|
+
};
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* 删除数据
|
|
816
|
+
*
|
|
817
|
+
* @param {string} storeName 表名称
|
|
818
|
+
* @param {IDBValidKey} key 数据键
|
|
819
|
+
* @return {*} {Promise<void>}
|
|
820
|
+
* @memberof IndexedDBUtil
|
|
821
|
+
*/
|
|
822
|
+
static async deleteData(e, t, i) {
|
|
823
|
+
return new Promise((s, r) => {
|
|
824
|
+
const o = indexedDB.open(e);
|
|
825
|
+
o.onsuccess = (c) => {
|
|
826
|
+
if (m.db = c.target.result, m.lastLink = o.result, m.db.objectStoreNames.contains(t)) {
|
|
827
|
+
const h = m.db.transaction([t], "readwrite").objectStore(t).delete(i);
|
|
828
|
+
h.onsuccess = (a) => {
|
|
829
|
+
s(!0);
|
|
830
|
+
}, h.onerror = () => {
|
|
831
|
+
s(!1);
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
o.result.close();
|
|
835
|
+
}, o.onerror = () => {
|
|
836
|
+
o.result.close(), r();
|
|
837
|
+
};
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* 修改数据
|
|
842
|
+
*
|
|
843
|
+
* @param {string} storeName 表名称
|
|
844
|
+
* @param {*} data 需要修改的数据
|
|
845
|
+
* @return {*} {Promise<void>}
|
|
846
|
+
* @memberof IndexedDBUtil
|
|
847
|
+
*/
|
|
848
|
+
static async updateData(e, t, i) {
|
|
849
|
+
return new Promise((s, r) => {
|
|
850
|
+
const o = indexedDB.open(e);
|
|
851
|
+
o.onsuccess = (c) => {
|
|
852
|
+
if (m.db = c.target.result, m.lastLink = o.result, m.db.objectStoreNames.contains(t)) {
|
|
853
|
+
const h = m.db.transaction([t], "readwrite").objectStore(t).put(i);
|
|
854
|
+
h.onsuccess = (a) => {
|
|
855
|
+
s(i);
|
|
856
|
+
}, h.onerror = () => {
|
|
857
|
+
s(i);
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
o.result.close();
|
|
861
|
+
}, o.onerror = () => {
|
|
862
|
+
o.result.close(), r();
|
|
863
|
+
};
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* 读取单条数据
|
|
868
|
+
*
|
|
869
|
+
* @param {string} storeName 表名称
|
|
870
|
+
* @param {IDBValidKey} key 数据主键
|
|
871
|
+
* @return {*} {Promise<any>}
|
|
872
|
+
* @memberof IndexedDBUtil
|
|
873
|
+
*/
|
|
874
|
+
static async getData(e, t, i) {
|
|
875
|
+
return new Promise((s, r) => {
|
|
876
|
+
const o = indexedDB.open(e);
|
|
877
|
+
o.onsuccess = (c) => {
|
|
878
|
+
if (m.db = c.target.result, m.lastLink = o.result, m.db.objectStoreNames.contains(t)) {
|
|
879
|
+
const h = m.db.transaction([t], "readonly").objectStore(t).get(i);
|
|
880
|
+
h.onsuccess = (a) => {
|
|
881
|
+
s(h.result);
|
|
882
|
+
}, h.onerror = () => {
|
|
883
|
+
r(new Error("未找到数据".concat(i)));
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
o.result.close();
|
|
887
|
+
}, o.onerror = () => {
|
|
888
|
+
o.result.close(), r();
|
|
889
|
+
};
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* 读取所有数据
|
|
894
|
+
*
|
|
895
|
+
* @param {string} storeName 表名称
|
|
896
|
+
* @return {*} {Promise<any[]>}
|
|
897
|
+
* @memberof IndexedDBUtil
|
|
898
|
+
*/
|
|
899
|
+
static async getAllData(e, t) {
|
|
900
|
+
return new Promise((i, s) => {
|
|
901
|
+
const r = indexedDB.open(e);
|
|
902
|
+
r.onsuccess = (o) => {
|
|
903
|
+
if (m.db = o.target.result, m.lastLink = r.result, m.db.objectStoreNames.contains(t)) {
|
|
904
|
+
const f = m.db.transaction([t], "readonly").objectStore(t).getAll();
|
|
905
|
+
f.onsuccess = (h) => {
|
|
906
|
+
i(f.result);
|
|
907
|
+
}, f.onerror = () => {
|
|
908
|
+
i([]);
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
r.result.close();
|
|
912
|
+
}, r.onerror = () => {
|
|
913
|
+
r.result.close(), s();
|
|
914
|
+
};
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
// 数据库版本
|
|
919
|
+
y(m, "version", 1), // 数据库连接句柄
|
|
920
|
+
y(m, "db", null), // 上一个连接
|
|
921
|
+
y(m, "lastLink");
|
|
922
|
+
let ae = m;
|
|
923
|
+
var ce, $, De, Qe, le = 0, Lt = [], ge = [], et = v.__b, tt = v.__r, nt = v.diffed, it = v.__c, st = v.unmount;
|
|
924
|
+
function Ve(n, e) {
|
|
925
|
+
v.__h && v.__h($, n, le || e), le = 0;
|
|
926
|
+
var t = $.__H || ($.__H = { __: [], __h: [] });
|
|
927
|
+
return n >= t.__.length && t.__.push({ __V: ge }), t.__[n];
|
|
928
|
+
}
|
|
929
|
+
function Rt(n) {
|
|
930
|
+
return le = 1, cn(Ot, n);
|
|
931
|
+
}
|
|
932
|
+
function cn(n, e, t) {
|
|
933
|
+
var i = Ve(ce++, 2);
|
|
934
|
+
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Ot(void 0, e), function(c) {
|
|
935
|
+
var l = i.__N ? i.__N[0] : i.__[0], f = i.t(l, c);
|
|
936
|
+
l !== f && (i.__N = [f, i.__[1]], i.__c.setState({}));
|
|
937
|
+
}], i.__c = $, !$.u)) {
|
|
938
|
+
var s = function(c, l, f) {
|
|
939
|
+
if (!i.__c.__H)
|
|
940
|
+
return !0;
|
|
941
|
+
var h = i.__c.__H.__.filter(function(_) {
|
|
942
|
+
return _.__c;
|
|
943
|
+
});
|
|
944
|
+
if (h.every(function(_) {
|
|
945
|
+
return !_.__N;
|
|
946
|
+
}))
|
|
947
|
+
return !r || r.call(this, c, l, f);
|
|
948
|
+
var a = !1;
|
|
949
|
+
return h.forEach(function(_) {
|
|
950
|
+
if (_.__N) {
|
|
951
|
+
var p = _.__[0];
|
|
952
|
+
_.__ = _.__N, _.__N = void 0, p !== _.__[0] && (a = !0);
|
|
953
|
+
}
|
|
954
|
+
}), !(!a && i.__c.props === c) && (!r || r.call(this, c, l, f));
|
|
955
|
+
};
|
|
956
|
+
$.u = !0;
|
|
957
|
+
var r = $.shouldComponentUpdate, o = $.componentWillUpdate;
|
|
958
|
+
$.componentWillUpdate = function(c, l, f) {
|
|
959
|
+
if (this.__e) {
|
|
960
|
+
var h = r;
|
|
961
|
+
r = void 0, s(c, l, f), r = h;
|
|
962
|
+
}
|
|
963
|
+
o && o.call(this, c, l, f);
|
|
964
|
+
}, $.shouldComponentUpdate = s;
|
|
965
|
+
}
|
|
966
|
+
return i.__N || i.__;
|
|
967
|
+
}
|
|
968
|
+
function Y(n, e) {
|
|
969
|
+
var t = Ve(ce++, 3);
|
|
970
|
+
!v.__s && Pt(t.__H, e) && (t.__ = n, t.i = e, $.__H.__h.push(t));
|
|
971
|
+
}
|
|
972
|
+
function q(n) {
|
|
973
|
+
return le = 5, he(function() {
|
|
974
|
+
return { current: n };
|
|
697
975
|
}, []);
|
|
698
976
|
}
|
|
699
|
-
function
|
|
700
|
-
var
|
|
701
|
-
return
|
|
977
|
+
function he(n, e) {
|
|
978
|
+
var t = Ve(ce++, 7);
|
|
979
|
+
return Pt(t.__H, e) ? (t.__V = n(), t.i = e, t.__h = n, t.__V) : t.__;
|
|
702
980
|
}
|
|
703
|
-
function
|
|
704
|
-
return
|
|
705
|
-
return
|
|
981
|
+
function rt(n, e) {
|
|
982
|
+
return le = 8, he(function() {
|
|
983
|
+
return n;
|
|
706
984
|
}, e);
|
|
707
985
|
}
|
|
708
|
-
function
|
|
709
|
-
for (var
|
|
710
|
-
if (
|
|
986
|
+
function ln() {
|
|
987
|
+
for (var n; n = Lt.shift(); )
|
|
988
|
+
if (n.__P && n.__H)
|
|
711
989
|
try {
|
|
712
|
-
|
|
990
|
+
n.__H.__h.forEach(ye), n.__H.__h.forEach(Pe), n.__H.__h = [];
|
|
713
991
|
} catch (e) {
|
|
714
|
-
|
|
992
|
+
n.__H.__h = [], v.__e(e, n.__v);
|
|
715
993
|
}
|
|
716
994
|
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
},
|
|
720
|
-
|
|
721
|
-
var e = (
|
|
722
|
-
e && (
|
|
723
|
-
|
|
724
|
-
})) : (e.__h.forEach(
|
|
725
|
-
},
|
|
726
|
-
|
|
727
|
-
var e =
|
|
728
|
-
e && e.__H && (e.__H.__h.length && (
|
|
729
|
-
|
|
730
|
-
})),
|
|
731
|
-
},
|
|
732
|
-
e.some(function(
|
|
995
|
+
v.__b = function(n) {
|
|
996
|
+
$ = null, et && et(n);
|
|
997
|
+
}, v.__r = function(n) {
|
|
998
|
+
tt && tt(n), ce = 0;
|
|
999
|
+
var e = ($ = n.__c).__H;
|
|
1000
|
+
e && (De === $ ? (e.__h = [], $.__h = [], e.__.forEach(function(t) {
|
|
1001
|
+
t.__N && (t.__ = t.__N), t.__V = ge, t.__N = t.i = void 0;
|
|
1002
|
+
})) : (e.__h.forEach(ye), e.__h.forEach(Pe), e.__h = [], ce = 0)), De = $;
|
|
1003
|
+
}, v.diffed = function(n) {
|
|
1004
|
+
nt && nt(n);
|
|
1005
|
+
var e = n.__c;
|
|
1006
|
+
e && e.__H && (e.__H.__h.length && (Lt.push(e) !== 1 && Qe === v.requestAnimationFrame || ((Qe = v.requestAnimationFrame) || un)(ln)), e.__H.__.forEach(function(t) {
|
|
1007
|
+
t.i && (t.__H = t.i), t.__V !== ge && (t.__ = t.__V), t.i = void 0, t.__V = ge;
|
|
1008
|
+
})), De = $ = null;
|
|
1009
|
+
}, v.__c = function(n, e) {
|
|
1010
|
+
e.some(function(t) {
|
|
733
1011
|
try {
|
|
734
|
-
|
|
735
|
-
return !i.__ ||
|
|
1012
|
+
t.__h.forEach(ye), t.__h = t.__h.filter(function(i) {
|
|
1013
|
+
return !i.__ || Pe(i);
|
|
736
1014
|
});
|
|
737
1015
|
} catch (i) {
|
|
738
1016
|
e.some(function(s) {
|
|
739
1017
|
s.__h && (s.__h = []);
|
|
740
|
-
}), e = [],
|
|
1018
|
+
}), e = [], v.__e(i, t.__v);
|
|
741
1019
|
}
|
|
742
|
-
}),
|
|
743
|
-
},
|
|
744
|
-
|
|
745
|
-
var e,
|
|
746
|
-
|
|
1020
|
+
}), it && it(n, e);
|
|
1021
|
+
}, v.unmount = function(n) {
|
|
1022
|
+
st && st(n);
|
|
1023
|
+
var e, t = n.__c;
|
|
1024
|
+
t && t.__H && (t.__H.__.forEach(function(i) {
|
|
747
1025
|
try {
|
|
748
|
-
|
|
1026
|
+
ye(i);
|
|
749
1027
|
} catch (s) {
|
|
750
1028
|
e = s;
|
|
751
1029
|
}
|
|
752
|
-
}),
|
|
1030
|
+
}), t.__H = void 0, e && v.__e(e, t.__v));
|
|
753
1031
|
};
|
|
754
|
-
var
|
|
755
|
-
function
|
|
756
|
-
var e,
|
|
757
|
-
clearTimeout(i),
|
|
758
|
-
}, i = setTimeout(
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
function
|
|
762
|
-
var e =
|
|
763
|
-
typeof
|
|
764
|
-
}
|
|
765
|
-
function
|
|
766
|
-
var e =
|
|
767
|
-
|
|
768
|
-
}
|
|
769
|
-
function
|
|
770
|
-
return !
|
|
771
|
-
return
|
|
1032
|
+
var ot = typeof requestAnimationFrame == "function";
|
|
1033
|
+
function un(n) {
|
|
1034
|
+
var e, t = function() {
|
|
1035
|
+
clearTimeout(i), ot && cancelAnimationFrame(e), setTimeout(n);
|
|
1036
|
+
}, i = setTimeout(t, 100);
|
|
1037
|
+
ot && (e = requestAnimationFrame(t));
|
|
1038
|
+
}
|
|
1039
|
+
function ye(n) {
|
|
1040
|
+
var e = $, t = n.__c;
|
|
1041
|
+
typeof t == "function" && (n.__c = void 0, t()), $ = e;
|
|
1042
|
+
}
|
|
1043
|
+
function Pe(n) {
|
|
1044
|
+
var e = $;
|
|
1045
|
+
n.__c = n.__(), $ = e;
|
|
1046
|
+
}
|
|
1047
|
+
function Pt(n, e) {
|
|
1048
|
+
return !n || n.length !== e.length || e.some(function(t, i) {
|
|
1049
|
+
return t !== n[i];
|
|
772
1050
|
});
|
|
773
1051
|
}
|
|
774
|
-
function
|
|
1052
|
+
function Ot(n, e) {
|
|
1053
|
+
return typeof e == "function" ? e(n) : e;
|
|
1054
|
+
}
|
|
1055
|
+
function ke() {
|
|
775
1056
|
throw new Error("Cycle detected");
|
|
776
1057
|
}
|
|
777
|
-
var
|
|
778
|
-
function
|
|
779
|
-
if (
|
|
780
|
-
|
|
1058
|
+
var hn = Symbol.for("preact-signals");
|
|
1059
|
+
function We() {
|
|
1060
|
+
if (J > 1)
|
|
1061
|
+
J--;
|
|
781
1062
|
else {
|
|
782
|
-
for (var
|
|
783
|
-
var
|
|
784
|
-
for (
|
|
785
|
-
var i =
|
|
786
|
-
if (
|
|
1063
|
+
for (var n, e = !1; se !== void 0; ) {
|
|
1064
|
+
var t = se;
|
|
1065
|
+
for (se = void 0, Oe++; t !== void 0; ) {
|
|
1066
|
+
var i = t.o;
|
|
1067
|
+
if (t.o = void 0, t.f &= -3, !(8 & t.f) && Bt(t))
|
|
787
1068
|
try {
|
|
788
|
-
|
|
1069
|
+
t.c();
|
|
789
1070
|
} catch (s) {
|
|
790
|
-
e || (
|
|
1071
|
+
e || (n = s, e = !0);
|
|
791
1072
|
}
|
|
792
|
-
|
|
1073
|
+
t = i;
|
|
793
1074
|
}
|
|
794
1075
|
}
|
|
795
|
-
if (
|
|
796
|
-
throw
|
|
1076
|
+
if (Oe = 0, J--, e)
|
|
1077
|
+
throw n;
|
|
797
1078
|
}
|
|
798
1079
|
}
|
|
799
|
-
var
|
|
800
|
-
function
|
|
801
|
-
if (
|
|
802
|
-
var e =
|
|
803
|
-
if (e === void 0 || e.t !==
|
|
804
|
-
return e = { i: 0, S:
|
|
1080
|
+
var w = void 0, se = void 0, J = 0, Oe = 0, Se = 0;
|
|
1081
|
+
function Ut(n) {
|
|
1082
|
+
if (w !== void 0) {
|
|
1083
|
+
var e = n.n;
|
|
1084
|
+
if (e === void 0 || e.t !== w)
|
|
1085
|
+
return e = { i: 0, S: n, p: w.s, n: void 0, t: w, e: void 0, x: void 0, r: e }, w.s !== void 0 && (w.s.n = e), w.s = e, n.n = e, 32 & w.f && n.S(e), e;
|
|
805
1086
|
if (e.i === -1)
|
|
806
|
-
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p =
|
|
1087
|
+
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = w.s, e.n = void 0, w.s.n = e, w.s = e), e;
|
|
807
1088
|
}
|
|
808
1089
|
}
|
|
809
|
-
function
|
|
810
|
-
this.v =
|
|
1090
|
+
function T(n) {
|
|
1091
|
+
this.v = n, this.i = 0, this.n = void 0, this.t = void 0;
|
|
811
1092
|
}
|
|
812
|
-
|
|
813
|
-
|
|
1093
|
+
T.prototype.brand = hn;
|
|
1094
|
+
T.prototype.h = function() {
|
|
814
1095
|
return !0;
|
|
815
1096
|
};
|
|
816
|
-
|
|
817
|
-
this.t !==
|
|
1097
|
+
T.prototype.S = function(n) {
|
|
1098
|
+
this.t !== n && n.e === void 0 && (n.x = this.t, this.t !== void 0 && (this.t.e = n), this.t = n);
|
|
818
1099
|
};
|
|
819
|
-
|
|
1100
|
+
T.prototype.U = function(n) {
|
|
820
1101
|
if (this.t !== void 0) {
|
|
821
|
-
var e =
|
|
822
|
-
e !== void 0 && (e.x =
|
|
1102
|
+
var e = n.e, t = n.x;
|
|
1103
|
+
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);
|
|
823
1104
|
}
|
|
824
1105
|
};
|
|
825
|
-
|
|
1106
|
+
T.prototype.subscribe = function(n) {
|
|
826
1107
|
var e = this;
|
|
827
|
-
return
|
|
828
|
-
var
|
|
1108
|
+
return xe(function() {
|
|
1109
|
+
var t = e.value, i = 32 & this.f;
|
|
829
1110
|
this.f &= -33;
|
|
830
1111
|
try {
|
|
831
|
-
t
|
|
1112
|
+
n(t);
|
|
832
1113
|
} finally {
|
|
833
1114
|
this.f |= i;
|
|
834
1115
|
}
|
|
835
1116
|
});
|
|
836
1117
|
};
|
|
837
|
-
|
|
1118
|
+
T.prototype.valueOf = function() {
|
|
838
1119
|
return this.value;
|
|
839
1120
|
};
|
|
840
|
-
|
|
1121
|
+
T.prototype.toString = function() {
|
|
841
1122
|
return this.value + "";
|
|
842
1123
|
};
|
|
843
|
-
|
|
1124
|
+
T.prototype.toJSON = function() {
|
|
844
1125
|
return this.value;
|
|
845
1126
|
};
|
|
846
|
-
|
|
1127
|
+
T.prototype.peek = function() {
|
|
847
1128
|
return this.v;
|
|
848
1129
|
};
|
|
849
|
-
Object.defineProperty(
|
|
850
|
-
var
|
|
851
|
-
return
|
|
852
|
-
}, set: function(
|
|
853
|
-
if (
|
|
1130
|
+
Object.defineProperty(T.prototype, "value", { get: function() {
|
|
1131
|
+
var n = Ut(this);
|
|
1132
|
+
return n !== void 0 && (n.i = this.i), this.v;
|
|
1133
|
+
}, set: function(n) {
|
|
1134
|
+
if (w instanceof B && function() {
|
|
854
1135
|
throw new Error("Computed cannot have side-effects");
|
|
855
|
-
}(),
|
|
856
|
-
|
|
1136
|
+
}(), n !== this.v) {
|
|
1137
|
+
Oe > 100 && ke(), this.v = n, this.i++, Se++, J++;
|
|
857
1138
|
try {
|
|
858
1139
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
859
1140
|
e.t.N();
|
|
860
1141
|
} finally {
|
|
861
|
-
|
|
1142
|
+
We();
|
|
862
1143
|
}
|
|
863
1144
|
}
|
|
864
1145
|
} });
|
|
865
|
-
function
|
|
866
|
-
return new
|
|
1146
|
+
function Q(n) {
|
|
1147
|
+
return new T(n);
|
|
867
1148
|
}
|
|
868
|
-
function
|
|
869
|
-
for (var e =
|
|
1149
|
+
function Bt(n) {
|
|
1150
|
+
for (var e = n.s; e !== void 0; e = e.n)
|
|
870
1151
|
if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
|
|
871
1152
|
return !0;
|
|
872
1153
|
return !1;
|
|
873
1154
|
}
|
|
874
|
-
function
|
|
875
|
-
for (var e =
|
|
876
|
-
var
|
|
877
|
-
if (
|
|
878
|
-
|
|
1155
|
+
function Ft(n) {
|
|
1156
|
+
for (var e = n.s; e !== void 0; e = e.n) {
|
|
1157
|
+
var t = e.S.n;
|
|
1158
|
+
if (t !== void 0 && (e.r = t), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
1159
|
+
n.s = e;
|
|
879
1160
|
break;
|
|
880
1161
|
}
|
|
881
1162
|
}
|
|
882
1163
|
}
|
|
883
|
-
function
|
|
884
|
-
for (var e =
|
|
1164
|
+
function Vt(n) {
|
|
1165
|
+
for (var e = n.s, t = void 0; e !== void 0; ) {
|
|
885
1166
|
var i = e.p;
|
|
886
|
-
e.i === -1 ? (e.S.U(e), i !== void 0 && (i.n = e.n), e.n !== void 0 && (e.n.p = i)) :
|
|
1167
|
+
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;
|
|
887
1168
|
}
|
|
888
|
-
|
|
1169
|
+
n.s = t;
|
|
889
1170
|
}
|
|
890
|
-
function
|
|
891
|
-
|
|
1171
|
+
function B(n) {
|
|
1172
|
+
T.call(this, void 0), this.x = n, this.s = void 0, this.g = Se - 1, this.f = 4;
|
|
892
1173
|
}
|
|
893
|
-
(
|
|
1174
|
+
(B.prototype = new T()).h = function() {
|
|
894
1175
|
if (this.f &= -3, 1 & this.f)
|
|
895
1176
|
return !1;
|
|
896
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
1177
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Se))
|
|
897
1178
|
return !0;
|
|
898
|
-
if (this.g =
|
|
1179
|
+
if (this.g = Se, this.f |= 1, this.i > 0 && !Bt(this))
|
|
899
1180
|
return this.f &= -2, !0;
|
|
900
|
-
var
|
|
1181
|
+
var n = w;
|
|
901
1182
|
try {
|
|
902
|
-
|
|
1183
|
+
Ft(this), w = this;
|
|
903
1184
|
var e = this.x();
|
|
904
1185
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
905
|
-
} catch (
|
|
906
|
-
this.v =
|
|
1186
|
+
} catch (t) {
|
|
1187
|
+
this.v = t, this.f |= 16, this.i++;
|
|
907
1188
|
}
|
|
908
|
-
return
|
|
1189
|
+
return w = n, Vt(this), this.f &= -2, !0;
|
|
909
1190
|
};
|
|
910
|
-
|
|
1191
|
+
B.prototype.S = function(n) {
|
|
911
1192
|
if (this.t === void 0) {
|
|
912
1193
|
this.f |= 36;
|
|
913
1194
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
914
1195
|
e.S.S(e);
|
|
915
1196
|
}
|
|
916
|
-
|
|
1197
|
+
T.prototype.S.call(this, n);
|
|
917
1198
|
};
|
|
918
|
-
|
|
919
|
-
if (this.t !== void 0 && (
|
|
1199
|
+
B.prototype.U = function(n) {
|
|
1200
|
+
if (this.t !== void 0 && (T.prototype.U.call(this, n), this.t === void 0)) {
|
|
920
1201
|
this.f &= -33;
|
|
921
1202
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
922
1203
|
e.S.U(e);
|
|
923
1204
|
}
|
|
924
1205
|
};
|
|
925
|
-
|
|
1206
|
+
B.prototype.N = function() {
|
|
926
1207
|
if (!(2 & this.f)) {
|
|
927
1208
|
this.f |= 6;
|
|
928
|
-
for (var
|
|
929
|
-
|
|
1209
|
+
for (var n = this.t; n !== void 0; n = n.x)
|
|
1210
|
+
n.t.N();
|
|
930
1211
|
}
|
|
931
1212
|
};
|
|
932
|
-
|
|
933
|
-
if (this.h() ||
|
|
1213
|
+
B.prototype.peek = function() {
|
|
1214
|
+
if (this.h() || ke(), 16 & this.f)
|
|
934
1215
|
throw this.v;
|
|
935
1216
|
return this.v;
|
|
936
1217
|
};
|
|
937
|
-
Object.defineProperty(
|
|
938
|
-
1 & this.f &&
|
|
939
|
-
var
|
|
940
|
-
if (this.h(),
|
|
1218
|
+
Object.defineProperty(B.prototype, "value", { get: function() {
|
|
1219
|
+
1 & this.f && ke();
|
|
1220
|
+
var n = Ut(this);
|
|
1221
|
+
if (this.h(), n !== void 0 && (n.i = this.i), 16 & this.f)
|
|
941
1222
|
throw this.v;
|
|
942
1223
|
return this.v;
|
|
943
1224
|
} });
|
|
944
|
-
function
|
|
945
|
-
return new
|
|
946
|
-
}
|
|
947
|
-
function
|
|
948
|
-
var e =
|
|
949
|
-
if (
|
|
950
|
-
|
|
951
|
-
var
|
|
952
|
-
|
|
1225
|
+
function Wt(n) {
|
|
1226
|
+
return new B(n);
|
|
1227
|
+
}
|
|
1228
|
+
function jt(n) {
|
|
1229
|
+
var e = n.u;
|
|
1230
|
+
if (n.u = void 0, typeof e == "function") {
|
|
1231
|
+
J++;
|
|
1232
|
+
var t = w;
|
|
1233
|
+
w = void 0;
|
|
953
1234
|
try {
|
|
954
1235
|
e();
|
|
955
1236
|
} catch (i) {
|
|
956
|
-
throw
|
|
1237
|
+
throw n.f &= -2, n.f |= 8, je(n), i;
|
|
957
1238
|
} finally {
|
|
958
|
-
|
|
1239
|
+
w = t, We();
|
|
959
1240
|
}
|
|
960
1241
|
}
|
|
961
1242
|
}
|
|
962
|
-
function
|
|
963
|
-
for (var e =
|
|
1243
|
+
function je(n) {
|
|
1244
|
+
for (var e = n.s; e !== void 0; e = e.n)
|
|
964
1245
|
e.S.U(e);
|
|
965
|
-
|
|
1246
|
+
n.x = void 0, n.s = void 0, jt(n);
|
|
966
1247
|
}
|
|
967
|
-
function
|
|
968
|
-
if (
|
|
1248
|
+
function dn(n) {
|
|
1249
|
+
if (w !== this)
|
|
969
1250
|
throw new Error("Out-of-order effect");
|
|
970
|
-
|
|
1251
|
+
Vt(this), w = n, this.f &= -2, 8 & this.f && je(this), We();
|
|
971
1252
|
}
|
|
972
|
-
function
|
|
973
|
-
this.x =
|
|
1253
|
+
function de(n) {
|
|
1254
|
+
this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
974
1255
|
}
|
|
975
|
-
|
|
976
|
-
var
|
|
1256
|
+
de.prototype.c = function() {
|
|
1257
|
+
var n = this.S();
|
|
977
1258
|
try {
|
|
978
1259
|
if (8 & this.f || this.x === void 0)
|
|
979
1260
|
return;
|
|
980
1261
|
var e = this.x();
|
|
981
1262
|
typeof e == "function" && (this.u = e);
|
|
982
1263
|
} finally {
|
|
983
|
-
|
|
1264
|
+
n();
|
|
984
1265
|
}
|
|
985
1266
|
};
|
|
986
|
-
|
|
987
|
-
1 & this.f &&
|
|
988
|
-
var
|
|
989
|
-
return
|
|
1267
|
+
de.prototype.S = function() {
|
|
1268
|
+
1 & this.f && ke(), this.f |= 1, this.f &= -9, jt(this), Ft(this), J++;
|
|
1269
|
+
var n = w;
|
|
1270
|
+
return w = this, dn.bind(this, n);
|
|
990
1271
|
};
|
|
991
|
-
|
|
992
|
-
2 & this.f || (this.f |= 2, this.o =
|
|
1272
|
+
de.prototype.N = function() {
|
|
1273
|
+
2 & this.f || (this.f |= 2, this.o = se, se = this);
|
|
993
1274
|
};
|
|
994
|
-
|
|
995
|
-
this.f |= 8, 1 & this.f ||
|
|
1275
|
+
de.prototype.d = function() {
|
|
1276
|
+
this.f |= 8, 1 & this.f || je(this);
|
|
996
1277
|
};
|
|
997
|
-
function
|
|
998
|
-
var e = new
|
|
1278
|
+
function xe(n) {
|
|
1279
|
+
var e = new de(n);
|
|
999
1280
|
try {
|
|
1000
1281
|
e.c();
|
|
1001
|
-
} catch (
|
|
1002
|
-
throw e.d(),
|
|
1282
|
+
} catch (t) {
|
|
1283
|
+
throw e.d(), t;
|
|
1003
1284
|
}
|
|
1004
1285
|
return e.d.bind(e);
|
|
1005
1286
|
}
|
|
1006
|
-
var
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1287
|
+
var Ne, Me;
|
|
1288
|
+
function ee(n, e) {
|
|
1289
|
+
v[n] = e.bind(null, v[n] || function() {
|
|
1009
1290
|
});
|
|
1010
1291
|
}
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1292
|
+
function Ee(n) {
|
|
1293
|
+
Me && Me(), Me = n && n.S();
|
|
1013
1294
|
}
|
|
1014
|
-
function
|
|
1015
|
-
var e = this,
|
|
1016
|
-
i.value =
|
|
1017
|
-
var s =
|
|
1295
|
+
function Yt(n) {
|
|
1296
|
+
var e = this, t = n.data, i = ue(t);
|
|
1297
|
+
i.value = t;
|
|
1298
|
+
var s = he(function() {
|
|
1018
1299
|
for (var r = e.__v; r = r.__; )
|
|
1019
1300
|
if (r.__c) {
|
|
1020
1301
|
r.__c.__$f |= 4;
|
|
@@ -1022,82 +1303,82 @@ function Pt(t) {
|
|
|
1022
1303
|
}
|
|
1023
1304
|
return e.__$u.c = function() {
|
|
1024
1305
|
var o;
|
|
1025
|
-
|
|
1026
|
-
},
|
|
1306
|
+
!$t(s.peek()) && ((o = e.base) == null ? void 0 : o.nodeType) === 3 ? e.base.data = s.peek() : (e.__$f |= 1, e.setState({}));
|
|
1307
|
+
}, Wt(function() {
|
|
1027
1308
|
var o = i.value.value;
|
|
1028
1309
|
return o === 0 ? 0 : o === !0 ? "" : o || "";
|
|
1029
1310
|
});
|
|
1030
1311
|
}, []);
|
|
1031
1312
|
return s.value;
|
|
1032
1313
|
}
|
|
1033
|
-
|
|
1034
|
-
Object.defineProperties(
|
|
1314
|
+
Yt.displayName = "_st";
|
|
1315
|
+
Object.defineProperties(T.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Yt }, props: { configurable: !0, get: function() {
|
|
1035
1316
|
return { data: this };
|
|
1036
1317
|
} }, __b: { configurable: !0, value: 1 } });
|
|
1037
|
-
|
|
1318
|
+
ee("__b", function(n, e) {
|
|
1038
1319
|
if (typeof e.type == "string") {
|
|
1039
|
-
var
|
|
1320
|
+
var t, i = e.props;
|
|
1040
1321
|
for (var s in i)
|
|
1041
1322
|
if (s !== "children") {
|
|
1042
1323
|
var r = i[s];
|
|
1043
|
-
r instanceof
|
|
1324
|
+
r instanceof T && (t || (e.__np = t = {}), t[s] = r, i[s] = r.peek());
|
|
1044
1325
|
}
|
|
1045
1326
|
}
|
|
1046
|
-
|
|
1327
|
+
n(e);
|
|
1047
1328
|
});
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
var
|
|
1051
|
-
i && (i.__$f &= -2, (
|
|
1329
|
+
ee("__r", function(n, e) {
|
|
1330
|
+
Ee();
|
|
1331
|
+
var t, i = e.__c;
|
|
1332
|
+
i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
|
|
1052
1333
|
var r;
|
|
1053
|
-
return
|
|
1334
|
+
return xe(function() {
|
|
1054
1335
|
r = this;
|
|
1055
1336
|
}), r.c = function() {
|
|
1056
1337
|
i.__$f |= 1, i.setState({});
|
|
1057
1338
|
}, r;
|
|
1058
|
-
}())),
|
|
1339
|
+
}())), Ne = i, Ee(t), n(e);
|
|
1059
1340
|
});
|
|
1060
|
-
|
|
1061
|
-
|
|
1341
|
+
ee("__e", function(n, e, t, i) {
|
|
1342
|
+
Ee(), Ne = void 0, n(e, t, i);
|
|
1062
1343
|
});
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
var
|
|
1066
|
-
if (typeof e.type == "string" && (
|
|
1344
|
+
ee("diffed", function(n, e) {
|
|
1345
|
+
Ee(), Ne = void 0;
|
|
1346
|
+
var t;
|
|
1347
|
+
if (typeof e.type == "string" && (t = e.__e)) {
|
|
1067
1348
|
var i = e.__np, s = e.props;
|
|
1068
1349
|
if (i) {
|
|
1069
|
-
var r =
|
|
1350
|
+
var r = t.U;
|
|
1070
1351
|
if (r)
|
|
1071
1352
|
for (var o in r) {
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1353
|
+
var c = r[o];
|
|
1354
|
+
c !== void 0 && !(o in i) && (c.d(), r[o] = void 0);
|
|
1074
1355
|
}
|
|
1075
1356
|
else
|
|
1076
|
-
|
|
1077
|
-
for (var
|
|
1078
|
-
var
|
|
1079
|
-
|
|
1357
|
+
t.U = r = {};
|
|
1358
|
+
for (var l in i) {
|
|
1359
|
+
var f = r[l], h = i[l];
|
|
1360
|
+
f === void 0 ? (f = fn(t, l, h, s), r[l] = f) : f.o(h, s);
|
|
1080
1361
|
}
|
|
1081
1362
|
}
|
|
1082
1363
|
}
|
|
1083
|
-
|
|
1364
|
+
n(e);
|
|
1084
1365
|
});
|
|
1085
|
-
function
|
|
1086
|
-
var s = e in
|
|
1087
|
-
return { o: function(o,
|
|
1088
|
-
r.value = o, i =
|
|
1089
|
-
}, d:
|
|
1366
|
+
function fn(n, e, t, i) {
|
|
1367
|
+
var s = e in n && n.ownerSVGElement === void 0, r = Q(t);
|
|
1368
|
+
return { o: function(o, c) {
|
|
1369
|
+
r.value = o, i = c;
|
|
1370
|
+
}, d: xe(function() {
|
|
1090
1371
|
var o = r.value.value;
|
|
1091
|
-
i[e] !== o && (i[e] = o, s ?
|
|
1372
|
+
i[e] !== o && (i[e] = o, s ? n[e] = o : o ? n.setAttribute(e, o) : n.removeAttribute(e));
|
|
1092
1373
|
}) };
|
|
1093
1374
|
}
|
|
1094
|
-
|
|
1375
|
+
ee("unmount", function(n, e) {
|
|
1095
1376
|
if (typeof e.type == "string") {
|
|
1096
|
-
var
|
|
1097
|
-
if (
|
|
1098
|
-
var i =
|
|
1377
|
+
var t = e.__e;
|
|
1378
|
+
if (t) {
|
|
1379
|
+
var i = t.U;
|
|
1099
1380
|
if (i) {
|
|
1100
|
-
|
|
1381
|
+
t.U = void 0;
|
|
1101
1382
|
for (var s in i) {
|
|
1102
1383
|
var r = i[s];
|
|
1103
1384
|
r && r.d();
|
|
@@ -1107,217 +1388,109 @@ j("unmount", function(t, e) {
|
|
|
1107
1388
|
} else {
|
|
1108
1389
|
var o = e.__c;
|
|
1109
1390
|
if (o) {
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1391
|
+
var c = o.__$u;
|
|
1392
|
+
c && (o.__$u = void 0, c.d());
|
|
1112
1393
|
}
|
|
1113
1394
|
}
|
|
1114
|
-
|
|
1395
|
+
n(e);
|
|
1115
1396
|
});
|
|
1116
|
-
|
|
1117
|
-
(i < 3 || i === 9) && (e.__$f |= 2),
|
|
1397
|
+
ee("__h", function(n, e, t, i) {
|
|
1398
|
+
(i < 3 || i === 9) && (e.__$f |= 2), n(e, t, i);
|
|
1118
1399
|
});
|
|
1119
|
-
M.prototype.shouldComponentUpdate = function(
|
|
1120
|
-
var
|
|
1121
|
-
if (!(
|
|
1400
|
+
M.prototype.shouldComponentUpdate = function(n, e) {
|
|
1401
|
+
var t = this.__$u;
|
|
1402
|
+
if (!(t && t.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
|
|
1122
1403
|
return !0;
|
|
1123
1404
|
for (var i in e)
|
|
1124
1405
|
return !0;
|
|
1125
|
-
for (var s in
|
|
1126
|
-
if (s !== "__source" &&
|
|
1406
|
+
for (var s in n)
|
|
1407
|
+
if (s !== "__source" && n[s] !== this.props[s])
|
|
1127
1408
|
return !0;
|
|
1128
1409
|
for (var r in this.props)
|
|
1129
|
-
if (!(r in
|
|
1410
|
+
if (!(r in n))
|
|
1130
1411
|
return !0;
|
|
1131
1412
|
return !1;
|
|
1132
1413
|
};
|
|
1133
|
-
function
|
|
1134
|
-
return
|
|
1135
|
-
return
|
|
1414
|
+
function ue(n) {
|
|
1415
|
+
return he(function() {
|
|
1416
|
+
return Q(n);
|
|
1136
1417
|
}, []);
|
|
1137
1418
|
}
|
|
1138
|
-
function
|
|
1139
|
-
var e =
|
|
1140
|
-
return e.current =
|
|
1141
|
-
return
|
|
1419
|
+
function Ye(n) {
|
|
1420
|
+
var e = q(n);
|
|
1421
|
+
return e.current = n, Ne.__$f |= 4, he(function() {
|
|
1422
|
+
return Wt(function() {
|
|
1142
1423
|
return e.current();
|
|
1143
1424
|
});
|
|
1144
1425
|
}, []);
|
|
1145
1426
|
}
|
|
1146
|
-
function
|
|
1147
|
-
var e =
|
|
1148
|
-
e.current =
|
|
1149
|
-
return
|
|
1427
|
+
function _n(n) {
|
|
1428
|
+
var e = q(n);
|
|
1429
|
+
e.current = n, Y(function() {
|
|
1430
|
+
return xe(function() {
|
|
1150
1431
|
return e.current();
|
|
1151
1432
|
});
|
|
1152
1433
|
}, []);
|
|
1153
1434
|
}
|
|
1154
|
-
var
|
|
1155
|
-
function u(
|
|
1156
|
-
var o,
|
|
1157
|
-
for (
|
|
1158
|
-
|
|
1159
|
-
var
|
|
1160
|
-
if (typeof
|
|
1161
|
-
for (
|
|
1162
|
-
c
|
|
1163
|
-
return
|
|
1164
|
-
}
|
|
1165
|
-
const
|
|
1166
|
-
viewBox: "0 0 1024 1024",
|
|
1167
|
-
version: "1.1",
|
|
1168
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1169
|
-
children: u("path", {
|
|
1170
|
-
d: "M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"
|
|
1171
|
-
})
|
|
1172
|
-
}), Rt = () => u("svg", {
|
|
1173
|
-
className: "icon",
|
|
1174
|
-
viewBox: "0 0 1024 1024",
|
|
1175
|
-
version: "1.1",
|
|
1176
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1177
|
-
children: u("path", {
|
|
1178
|
-
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"
|
|
1179
|
-
})
|
|
1180
|
-
}), on = () => u("svg", {
|
|
1181
|
-
viewBox: "0 0 1024 1024",
|
|
1182
|
-
version: "1.1",
|
|
1183
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1184
|
-
children: u("path", {
|
|
1185
|
-
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"
|
|
1186
|
-
})
|
|
1187
|
-
}), Tt = () => u("svg", {
|
|
1188
|
-
viewBox: "0 0 1024 1024",
|
|
1189
|
-
version: "1.1",
|
|
1190
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1191
|
-
children: u("path", {
|
|
1192
|
-
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"
|
|
1193
|
-
})
|
|
1194
|
-
}), Ue = () => u("svg", {
|
|
1195
|
-
viewBox: "0 0 1024 1024",
|
|
1196
|
-
version: "1.1",
|
|
1197
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1198
|
-
children: u("path", {
|
|
1199
|
-
d: "M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"
|
|
1200
|
-
})
|
|
1201
|
-
}), Lt = () => u("svg", {
|
|
1202
|
-
viewBox: "0 0 1024 1024",
|
|
1203
|
-
version: "1.1",
|
|
1204
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1205
|
-
children: u("path", {
|
|
1206
|
-
d: "M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"
|
|
1207
|
-
})
|
|
1208
|
-
}), an = () => u("svg", {
|
|
1209
|
-
viewBox: "0 0 1024 1024",
|
|
1210
|
-
version: "1.1",
|
|
1211
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1212
|
-
children: u("path", {
|
|
1213
|
-
d: "M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"
|
|
1214
|
-
})
|
|
1215
|
-
}), ln = () => u("svg", {
|
|
1216
|
-
viewBox: "0 0 1024 1024",
|
|
1217
|
-
version: "1.1",
|
|
1218
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1219
|
-
children: u("path", {
|
|
1220
|
-
d: "M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"
|
|
1221
|
-
})
|
|
1222
|
-
});
|
|
1223
|
-
const S = new U("markdown-message"), cn = (t) => {
|
|
1435
|
+
var pn = 0;
|
|
1436
|
+
function u(n, e, t, i, s, r) {
|
|
1437
|
+
var o, c, l = {};
|
|
1438
|
+
for (c in e)
|
|
1439
|
+
c == "ref" ? o = e[c] : l[c] = e[c];
|
|
1440
|
+
var f = { type: n, props: l, key: t, ref: o, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --pn, __source: s, __self: r };
|
|
1441
|
+
if (typeof n == "function" && (o = n.defaultProps))
|
|
1442
|
+
for (c in o)
|
|
1443
|
+
l[c] === void 0 && (l[c] = o[c]);
|
|
1444
|
+
return v.vnode && v.vnode(f), f;
|
|
1445
|
+
}
|
|
1446
|
+
const X = new D("markdown-message"), vn = (n) => {
|
|
1224
1447
|
const {
|
|
1225
1448
|
message: e,
|
|
1226
|
-
size:
|
|
1227
|
-
} =
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}, [e,
|
|
1231
|
-
s.value = new
|
|
1449
|
+
size: t
|
|
1450
|
+
} = n, i = ue(zt()), s = ue(null);
|
|
1451
|
+
return Y(() => {
|
|
1452
|
+
t >= 0 && s.value && s.value.setMarkdown(e.content);
|
|
1453
|
+
}, [e, t]), Y(() => {
|
|
1454
|
+
s.value = new Kt({
|
|
1232
1455
|
id: i,
|
|
1233
1456
|
value: e.content,
|
|
1234
1457
|
editor: {
|
|
1235
1458
|
defaultModel: "previewOnly"
|
|
1236
1459
|
}
|
|
1237
1460
|
});
|
|
1238
|
-
}, [])
|
|
1239
|
-
|
|
1240
|
-
t.controller.backfill(e);
|
|
1241
|
-
}, o = () => {
|
|
1242
|
-
t.controller.deleteMessage(e);
|
|
1243
|
-
}, l = () => {
|
|
1244
|
-
t.controller.refreshMessage(e);
|
|
1245
|
-
}, c = () => {
|
|
1246
|
-
t.controller.copyMessage(e);
|
|
1247
|
-
};
|
|
1248
|
-
return u("div", {
|
|
1249
|
-
className: "".concat(S.b(), " ").concat(S.is("loading", e.state === 20)),
|
|
1461
|
+
}, []), u("div", {
|
|
1462
|
+
className: "".concat(X.b(), " ").concat(X.is("loading", e.state === 20)),
|
|
1250
1463
|
children: [u("div", {
|
|
1251
|
-
className:
|
|
1464
|
+
className: X.b("header"),
|
|
1252
1465
|
children: [u("div", {
|
|
1253
|
-
className:
|
|
1466
|
+
className: X.be("header", "caption"),
|
|
1254
1467
|
children: "AI "
|
|
1255
|
-
}),
|
|
1256
|
-
className: S.b("header-action-wrapper"),
|
|
1257
|
-
children: [u("div", {
|
|
1258
|
-
className: S.be("header", "action-item"),
|
|
1259
|
-
onClick: r,
|
|
1260
|
-
children: [u(Rt, {}), u("span", {
|
|
1261
|
-
className: S.bem("header", "action-item", "title"),
|
|
1262
|
-
children: "回填"
|
|
1263
|
-
})]
|
|
1264
|
-
}), u("div", {
|
|
1265
|
-
className: S.be("header", "action-item"),
|
|
1266
|
-
onClick: l,
|
|
1267
|
-
children: [u(Ue, {}), u("span", {
|
|
1268
|
-
className: S.bem("header", "action-item", "title"),
|
|
1269
|
-
children: "刷新"
|
|
1270
|
-
})]
|
|
1271
|
-
}), u("div", {
|
|
1272
|
-
className: S.be("header", "action-item"),
|
|
1273
|
-
onClick: o,
|
|
1274
|
-
children: [u(Tt, {}), u("span", {
|
|
1275
|
-
className: S.bem("header", "action-item", "title"),
|
|
1276
|
-
children: "删除"
|
|
1277
|
-
})]
|
|
1278
|
-
}), u("div", {
|
|
1279
|
-
className: S.be("header", "action-item"),
|
|
1280
|
-
onClick: c,
|
|
1281
|
-
children: [u(Lt, {}), u("span", {
|
|
1282
|
-
className: S.bem("header", "action-item", "title"),
|
|
1283
|
-
children: "复制"
|
|
1284
|
-
})]
|
|
1285
|
-
})]
|
|
1286
|
-
})]
|
|
1468
|
+
}), n.children]
|
|
1287
1469
|
}), u("div", {
|
|
1288
|
-
className: "".concat(
|
|
1470
|
+
className: "".concat(X.b("content"), " pre-wrap-container"),
|
|
1289
1471
|
children: u("div", {
|
|
1290
1472
|
id: i
|
|
1291
1473
|
})
|
|
1292
1474
|
}), u("div", {
|
|
1293
|
-
className:
|
|
1475
|
+
className: X.b("footer")
|
|
1294
1476
|
})]
|
|
1295
1477
|
});
|
|
1296
1478
|
};
|
|
1297
|
-
const
|
|
1298
|
-
const e =
|
|
1299
|
-
t.controller.refreshMessage(t.message, !0);
|
|
1300
|
-
};
|
|
1479
|
+
const te = new D("user-message-question"), mn = (n) => {
|
|
1480
|
+
const e = Ye(() => n.message.content);
|
|
1301
1481
|
return u("div", {
|
|
1302
|
-
className:
|
|
1482
|
+
className: te.b(),
|
|
1303
1483
|
children: [u("div", {
|
|
1304
|
-
className:
|
|
1305
|
-
children: [u("div", {
|
|
1306
|
-
className:
|
|
1307
|
-
onClick: n,
|
|
1308
|
-
children: [u(Ue, {}), u("span", {
|
|
1309
|
-
className: O.em("user-action", "title"),
|
|
1310
|
-
children: "刷新"
|
|
1311
|
-
})]
|
|
1312
|
-
}), u("div", {
|
|
1313
|
-
className: O.e("user"),
|
|
1484
|
+
className: te.e("user-header"),
|
|
1485
|
+
children: [n.children, u("div", {
|
|
1486
|
+
className: te.e("user"),
|
|
1314
1487
|
children: "我"
|
|
1315
1488
|
})]
|
|
1316
1489
|
}), u("div", {
|
|
1317
|
-
className:
|
|
1490
|
+
className: te.e("content"),
|
|
1318
1491
|
children: u("div", {
|
|
1319
1492
|
dir: "auto",
|
|
1320
|
-
className:
|
|
1493
|
+
className: te.em("content", "body"),
|
|
1321
1494
|
children: u("p", {
|
|
1322
1495
|
dir: "auto",
|
|
1323
1496
|
className: "pre-wrap-container",
|
|
@@ -1327,360 +1500,604 @@ const O = new U("user-message-question"), un = (t) => {
|
|
|
1327
1500
|
})]
|
|
1328
1501
|
});
|
|
1329
1502
|
};
|
|
1330
|
-
const
|
|
1331
|
-
const e =
|
|
1332
|
-
t.controller.backfill(t.message);
|
|
1333
|
-
}, i = () => {
|
|
1334
|
-
t.controller.deleteMessage(t.message);
|
|
1335
|
-
}, s = () => {
|
|
1336
|
-
t.controller.refreshMessage(t.message);
|
|
1337
|
-
}, r = () => {
|
|
1338
|
-
t.controller.copyMessage(t.message);
|
|
1339
|
-
};
|
|
1503
|
+
const _e = new D("error-message"), gn = (n) => {
|
|
1504
|
+
const e = Ye(() => n.message.content);
|
|
1340
1505
|
return u("div", {
|
|
1341
|
-
className:
|
|
1506
|
+
className: _e.b(),
|
|
1342
1507
|
children: [u("div", {
|
|
1343
|
-
className:
|
|
1508
|
+
className: _e.b("header"),
|
|
1344
1509
|
children: [u("div", {
|
|
1345
|
-
className:
|
|
1510
|
+
className: _e.be("header", "caption"),
|
|
1346
1511
|
children: "AI "
|
|
1347
|
-
}),
|
|
1348
|
-
className: x.b("header-action-wrapper"),
|
|
1349
|
-
children: [u("div", {
|
|
1350
|
-
className: x.be("header", "action-item"),
|
|
1351
|
-
onClick: n,
|
|
1352
|
-
children: [u(Rt, {}), u("span", {
|
|
1353
|
-
className: x.bem("header", "action-item", "title"),
|
|
1354
|
-
children: "回填"
|
|
1355
|
-
})]
|
|
1356
|
-
}), u("div", {
|
|
1357
|
-
className: x.be("header", "action-item"),
|
|
1358
|
-
onClick: s,
|
|
1359
|
-
children: [u(Ue, {}), u("span", {
|
|
1360
|
-
className: x.bem("header", "action-item", "title"),
|
|
1361
|
-
children: "刷新"
|
|
1362
|
-
})]
|
|
1363
|
-
}), u("div", {
|
|
1364
|
-
className: x.be("header", "action-item"),
|
|
1365
|
-
onClick: i,
|
|
1366
|
-
children: [u(Tt, {}), u("span", {
|
|
1367
|
-
className: x.bem("header", "action-item", "title"),
|
|
1368
|
-
children: "删除"
|
|
1369
|
-
})]
|
|
1370
|
-
}), u("div", {
|
|
1371
|
-
className: x.be("header", "action-item"),
|
|
1372
|
-
onClick: r,
|
|
1373
|
-
children: [u(Lt, {}), u("span", {
|
|
1374
|
-
className: x.bem("header", "action-item", "title"),
|
|
1375
|
-
children: "复制"
|
|
1376
|
-
})]
|
|
1377
|
-
})]
|
|
1378
|
-
})]
|
|
1512
|
+
}), n.children]
|
|
1379
1513
|
}), u("div", {
|
|
1380
|
-
className: "".concat(
|
|
1514
|
+
className: "".concat(_e.e("content"), " pre-wrap-container"),
|
|
1381
1515
|
children: u("span", {
|
|
1382
1516
|
children: e
|
|
1383
1517
|
})
|
|
1384
1518
|
})]
|
|
1385
1519
|
});
|
|
1386
1520
|
};
|
|
1387
|
-
const
|
|
1388
|
-
className:
|
|
1521
|
+
const at = new D("unknown-message"), yn = (n) => u("div", {
|
|
1522
|
+
className: at.b(),
|
|
1389
1523
|
children: u("span", {
|
|
1390
|
-
className: "".concat(
|
|
1391
|
-
children: ["暂未支持的消息类型: ",
|
|
1524
|
+
className: "".concat(at.e("content"), " pre-wrap-container"),
|
|
1525
|
+
children: ["暂未支持的消息类型: ", n.message.type]
|
|
1392
1526
|
})
|
|
1393
|
-
})
|
|
1527
|
+
});
|
|
1528
|
+
const bn = new D("chat-message-item"), wn = (n) => {
|
|
1394
1529
|
const {
|
|
1395
1530
|
message: e,
|
|
1396
|
-
size:
|
|
1397
|
-
} =
|
|
1531
|
+
size: t
|
|
1532
|
+
} = n;
|
|
1398
1533
|
let i = null;
|
|
1399
1534
|
switch (e.type) {
|
|
1400
1535
|
case "DEFAULT":
|
|
1401
|
-
i = e.role === "ASSISTANT" ?
|
|
1536
|
+
i = e.role === "ASSISTANT" ? vn : mn;
|
|
1402
1537
|
break;
|
|
1403
1538
|
case "ERROR":
|
|
1404
|
-
i =
|
|
1539
|
+
i = gn;
|
|
1405
1540
|
break;
|
|
1406
1541
|
default:
|
|
1407
|
-
i =
|
|
1542
|
+
i = yn;
|
|
1408
1543
|
}
|
|
1409
1544
|
return u("div", {
|
|
1410
|
-
className:
|
|
1411
|
-
children:
|
|
1412
|
-
size:
|
|
1545
|
+
className: bn.b(),
|
|
1546
|
+
children: H(i, {
|
|
1547
|
+
size: t,
|
|
1413
1548
|
message: e,
|
|
1414
|
-
controller:
|
|
1549
|
+
controller: n.controller,
|
|
1550
|
+
children: n.children
|
|
1551
|
+
})
|
|
1552
|
+
});
|
|
1553
|
+
}, Cn = () => u("svg", {
|
|
1554
|
+
viewBox: "0 0 1024 1024",
|
|
1555
|
+
version: "1.1",
|
|
1556
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1557
|
+
children: u("path", {
|
|
1558
|
+
d: "M843.904 783.573333 783.573333 843.904 512.042667 572.373333 240.512 843.904 180.181333 783.573333 451.712 512.042667 180.181333 240.512 240.512 180.181333 512.042667 451.712 783.573333 180.181333 843.904 240.512 572.373333 512.042667 843.904 783.573333Z"
|
|
1559
|
+
})
|
|
1560
|
+
}), Sn = () => u("svg", {
|
|
1561
|
+
className: "icon",
|
|
1562
|
+
viewBox: "0 0 1024 1024",
|
|
1563
|
+
version: "1.1",
|
|
1564
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1565
|
+
children: u("path", {
|
|
1566
|
+
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"
|
|
1567
|
+
})
|
|
1568
|
+
}), En = () => u("svg", {
|
|
1569
|
+
viewBox: "0 0 1024 1024",
|
|
1570
|
+
version: "1.1",
|
|
1571
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1572
|
+
children: u("path", {
|
|
1573
|
+
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"
|
|
1574
|
+
})
|
|
1575
|
+
}), $n = () => u("svg", {
|
|
1576
|
+
viewBox: "0 0 1024 1024",
|
|
1577
|
+
version: "1.1",
|
|
1578
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1579
|
+
children: u("path", {
|
|
1580
|
+
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"
|
|
1581
|
+
})
|
|
1582
|
+
}), ct = () => u("svg", {
|
|
1583
|
+
viewBox: "0 0 1024 1024",
|
|
1584
|
+
version: "1.1",
|
|
1585
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1586
|
+
children: u("path", {
|
|
1587
|
+
d: "M511.582491 63.413262C265.134543 63.413262 64.62588 263.921925 64.62588 510.369873s200.508663 446.957635 446.957635 446.957635 446.957635-200.508663 446.957635-446.957635S758.031463 63.413262 511.582491 63.413262zM509.001713 751.859903c-98.517781 0-182.467775-62.623269-214.771505-150.056598l0.327458-0.134053c-2.007727-4.036943-3.38305-8.422833-3.38305-13.237489 0-16.647145 13.494339-30.142507 30.142507-30.142507 13.389962 0 24.358781 8.877181 28.2893 20.955264l0.422625-0.172939c23.269983 65.442478 85.645612 112.503307 158.972665 112.503307 93.106538 0 168.845523-75.738985 168.845523-168.845523s-75.738985-168.845523-168.845523-168.845523c-20.432355 0-39.874149 3.980661-58.013275 10.66899l21.248953 40.742936c2.486634 2.677992 4.0175 6.2831 4.0175 10.243295 0 8.417717-8.404414 14.921851-15.365966 15.07023-0.102331 0-0.206708 0-0.309038 0-0.220011 0-0.427742 0-0.647753-0.013303l-150.579507-6.463202c-5.372358-0.234337-10.229992-3.310396-12.716626-8.093329-2.486634-4.76963-2.236947-10.509355 0.647753-15.055904l80.890308-127.179564c2.8847-4.533246 8.006348-7.151887 13.365402-6.960529 5.372358 0.234337 10.227945 3.312442 12.71458 8.095375l18.580171 35.625382c26.629497-10.855232 55.683207-16.963347 86.168522-16.963347 126.338407 0 229.130537 102.791108 229.130537 229.130537S635.340119 751.859903 509.001713 751.859903z"
|
|
1588
|
+
})
|
|
1589
|
+
}), Tn = () => u("svg", {
|
|
1590
|
+
viewBox: "0 0 1024 1024",
|
|
1591
|
+
version: "1.1",
|
|
1592
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1593
|
+
children: u("path", {
|
|
1594
|
+
d: "M891.072 822.144V167.36a34.432 34.432 0 0 0-34.432-34.432H201.856C201.856 94.848 232.704 64 270.784 64h620.288C929.152 64 960 94.848 960 132.928v620.288c0 38.08-30.848 68.928-68.928 68.928z m-68.928-551.36v620.288c0 38.08-30.848 68.928-68.928 68.928H132.928A68.928 68.928 0 0 1 64 891.072V270.784c0-38.08 30.848-68.928 68.928-68.928h620.288c38.08 0 68.928 30.848 68.928 68.928z m-137.856 137.856H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z m0 206.72H201.856a34.432 34.432 0 0 0 0 68.864h482.432a34.432 34.432 0 0 0 0-68.864z"
|
|
1595
|
+
})
|
|
1596
|
+
}), kn = () => u("svg", {
|
|
1597
|
+
viewBox: "0 0 1024 1024",
|
|
1598
|
+
version: "1.1",
|
|
1599
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1600
|
+
children: u("path", {
|
|
1601
|
+
d: "M547.4 197.4v46l200.3 0.1L546.1 444l32.4 32.6 201.9-200.7v200.9h46V197.5zM471.4 584.4l-32.6-32.6L243.6 747V547.9h-46v278.7h279v-46H275z"
|
|
1602
|
+
})
|
|
1603
|
+
}), xn = () => u("svg", {
|
|
1604
|
+
viewBox: "0 0 1024 1024",
|
|
1605
|
+
version: "1.1",
|
|
1606
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1607
|
+
children: u("path", {
|
|
1608
|
+
d: "M544 480V282.944h52.224l0.064 107.968L763.072 224l36.928 36.928-166.976 166.976 108.032-0.128V480H544zM260.928 800l-36.928-36.928 166.912-166.784-107.968-0.064V544H480v197.056h-52.224l0.064-107.968L260.928 800z"
|
|
1609
|
+
})
|
|
1610
|
+
}), Nn = () => u("svg", {
|
|
1611
|
+
viewBox: "0 0 1024 1024",
|
|
1612
|
+
version: "1.1",
|
|
1613
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1614
|
+
children: u("path", {
|
|
1615
|
+
d: "M960 544H64a32 32 0 1 1 0-64h896a32 32 0 1 1 0 64"
|
|
1616
|
+
})
|
|
1617
|
+
}), An = () => u("svg", {
|
|
1618
|
+
viewBox: "0 0 1024 1024",
|
|
1619
|
+
version: "1.1",
|
|
1620
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1621
|
+
children: [u("path", {
|
|
1622
|
+
d: "M481.0752 263.3728l50.9952 1.024 1.8432-105.8816-50.9952-0.8192z"
|
|
1623
|
+
}), u("path", {
|
|
1624
|
+
d: "M486.441426 180.895362a66.56 66.56 0 1 0 42.091944-126.290153 66.56 66.56 0 1 0-42.091944 126.290153Z"
|
|
1625
|
+
}), u("path", {
|
|
1626
|
+
d: "M138.8544 664.3712c-52.8384 0-95.8464-43.008-95.8464-95.8464s43.008-95.8464 95.8464-95.8464M880.0256 472.6784c52.8384 0 95.8464 43.008 95.8464 95.8464s-43.008 95.8464-95.8464 95.8464"
|
|
1627
|
+
}), u("path", {
|
|
1628
|
+
d: "M507.4944 220.5696c-220.16 0-398.7456 162.816-398.7456 363.7248s178.5856 363.7248 398.7456 363.7248 398.7456-162.816 398.7456-363.7248-178.5856-363.7248-398.7456-363.7248z m0 559.9232c-166.2976 0-301.2608-100.5568-301.2608-224.4608s134.9632-224.4608 301.2608-224.4608S808.7552 432.128 808.7552 556.032 673.792 780.4928 507.4944 780.4928z"
|
|
1629
|
+
}), u("path", {
|
|
1630
|
+
d: "M319.6928 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
|
|
1631
|
+
}), u("path", {
|
|
1632
|
+
d: "M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
|
|
1633
|
+
})]
|
|
1634
|
+
}), In = () => u("svg", {
|
|
1635
|
+
viewBox: "0 0 18 18",
|
|
1636
|
+
fill: "none",
|
|
1637
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1638
|
+
children: [u("path", {
|
|
1639
|
+
d: "M5.856 17.121a.979.979 0 0 1-.327-.06.839.839 0 0 1-.283-.177.739.739 0 0 1-.187-.255.724.724 0 0 1-.07-.303l-.02-1.609a4.663 4.663 0 0 1-1.446-.455 4.252 4.252 0 0 1-.637-.401c-.199-.146-.385-.31-.553-.492a4.442 4.442 0 0 1-.45-.577 4.303 4.303 0 0 1-.327-.637 3.823 3.823 0 0 1-.206-.686 3.729 3.729 0 0 1-.064-.704V6.478c0-.261.025-.516.077-.771a4.43 4.43 0 0 1 .244-.747 4.062 4.062 0 0 1 .932-1.28c.2-.183.418-.347.65-.493.23-.145.482-.267.739-.364a4.21 4.21 0 0 1 .81-.225c.27-.054.553-.078.835-.078H8.55c.103 0 .2.018.29.054a.7.7 0 0 1 .411.376.667.667 0 0 1-.161.766.736.736 0 0 1-.25.151.764.764 0 0 1-.29.055H5.573c-.186 0-.366.012-.54.049-.18.03-.353.079-.52.145-.167.061-.328.14-.482.237-.148.091-.29.2-.418.316a2.897 2.897 0 0 0-.347.388c-.097.14-.187.286-.257.444a2.473 2.473 0 0 0-.206.977v4.287c0 .17.013.333.051.503a2.549 2.549 0 0 0 .772 1.33 2.721 2.721 0 0 0 .913.559c.167.066.347.115.527.152.18.03.36.048.546.048a.904.904 0 0 1 .61.23.848.848 0 0 1 .194.262.84.84 0 0 1 .07.303l.007.99 1.915-1.293a2.877 2.877 0 0 1 1.64-.492h2.372c.186 0 .366-.018.54-.048.18-.03.353-.08.52-.146.168-.067.329-.146.483-.237.148-.091.29-.2.418-.316.128-.121.244-.249.347-.388a2.8 2.8 0 0 0 .257-.444 2.47 2.47 0 0 0 .206-.977V8.585a.646.646 0 0 1 .225-.492.679.679 0 0 1 .244-.152.814.814 0 0 1 .585 0c.09.03.174.085.244.152a.657.657 0 0 1 .225.492V10.8c0 .261-.032.516-.083.771a4.192 4.192 0 0 1-.245.74c-.109.244-.244.468-.398.687a3.735 3.735 0 0 1-.534.6c-.2.183-.418.347-.65.493a4.134 4.134 0 0 1-.738.364 4.7 4.7 0 0 1-.81.225c-.27.054-.553.079-.836.079h-1.877c-.604 0-1.144.164-1.633.491l-2.54 1.713a.913.913 0 0 1-.514.157z",
|
|
1640
|
+
fill: "currentColor"
|
|
1641
|
+
}), u("path", {
|
|
1642
|
+
d: "M15.866 4.125h-4.174c-.41 0-.741.313-.741.7 0 .387.332.7.741.7h4.174c.41 0 .742-.313.742-.7 0-.387-.332-.7-.742-.7z",
|
|
1643
|
+
fill: "currentColor"
|
|
1644
|
+
}), u("path", {
|
|
1645
|
+
d: "M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",
|
|
1646
|
+
fill: "currentColor"
|
|
1647
|
+
})]
|
|
1648
|
+
}), Dn = () => u("svg", {
|
|
1649
|
+
viewBox: "64 64 896 896",
|
|
1650
|
+
focusable: "false",
|
|
1651
|
+
width: "1em",
|
|
1652
|
+
height: "1em",
|
|
1653
|
+
fill: "currentColor",
|
|
1654
|
+
"aria-hidden": "true",
|
|
1655
|
+
children: u("path", {
|
|
1656
|
+
d: "M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
1657
|
+
})
|
|
1658
|
+
}), Mn = () => u("svg", {
|
|
1659
|
+
fill: "currentColor",
|
|
1660
|
+
viewBox: "0 0 1000 1000",
|
|
1661
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1662
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1663
|
+
children: Array.from({
|
|
1664
|
+
length: 4
|
|
1665
|
+
}).map((c, l) => {
|
|
1666
|
+
const h = l * (146.66666666666666 + 140), a = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
|
|
1667
|
+
return u("rect", {
|
|
1668
|
+
fill: "currentColor",
|
|
1669
|
+
rx: 70,
|
|
1670
|
+
ry: 70,
|
|
1671
|
+
height: 250,
|
|
1672
|
+
width: 140,
|
|
1673
|
+
x: h,
|
|
1674
|
+
y: a,
|
|
1675
|
+
children: [u("animate", {
|
|
1676
|
+
attributeName: "height",
|
|
1677
|
+
values: "250; 500; 250",
|
|
1678
|
+
keyTimes: "0; 0.5; 1",
|
|
1679
|
+
dur: "".concat(0.8, "s"),
|
|
1680
|
+
begin: "".concat(0.8 / 4 * l, "s"),
|
|
1681
|
+
repeatCount: "indefinite"
|
|
1682
|
+
}), u("animate", {
|
|
1683
|
+
attributeName: "y",
|
|
1684
|
+
values: "".concat(a, "; ").concat(_, "; ").concat(a),
|
|
1685
|
+
keyTimes: "0; 0.5; 1",
|
|
1686
|
+
dur: "".concat(0.8, "s"),
|
|
1687
|
+
begin: "".concat(0.8 / 4 * l, "s"),
|
|
1688
|
+
repeatCount: "indefinite"
|
|
1689
|
+
})]
|
|
1690
|
+
}, l);
|
|
1691
|
+
})
|
|
1692
|
+
}), zn = (n) => u("svg", {
|
|
1693
|
+
className: n.className,
|
|
1694
|
+
onClick: n.onClick,
|
|
1695
|
+
viewBox: "0 0 1024 1024",
|
|
1696
|
+
version: "1.1",
|
|
1697
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1698
|
+
children: u("path", {
|
|
1699
|
+
d: "M128 384a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m768 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z m-372.4288 0a128 128 0 1 1 0 256 128 128 0 0 1 0-256z"
|
|
1700
|
+
})
|
|
1701
|
+
}), Hn = (n) => u("svg", {
|
|
1702
|
+
className: n.className,
|
|
1703
|
+
viewBox: "0 0 1024 1024",
|
|
1704
|
+
version: "1.1",
|
|
1705
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1706
|
+
children: u("path", {
|
|
1707
|
+
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"
|
|
1708
|
+
})
|
|
1709
|
+
});
|
|
1710
|
+
const V = new D("chat-toolbar"), Ue = (n) => {
|
|
1711
|
+
const {
|
|
1712
|
+
controller: e,
|
|
1713
|
+
items: t = [],
|
|
1714
|
+
data: i,
|
|
1715
|
+
type: s,
|
|
1716
|
+
className: r
|
|
1717
|
+
} = n;
|
|
1718
|
+
let o = [], c = "default";
|
|
1719
|
+
const l = [{
|
|
1720
|
+
label: "新建对话",
|
|
1721
|
+
title: "新建对话",
|
|
1722
|
+
icon: u(In, {}),
|
|
1723
|
+
onClick: () => {
|
|
1724
|
+
console.log("TODO 新建对话");
|
|
1725
|
+
}
|
|
1726
|
+
}], f = [{
|
|
1727
|
+
label: "回填",
|
|
1728
|
+
title: "回填",
|
|
1729
|
+
icon: u(Sn, {}),
|
|
1730
|
+
onClick: () => {
|
|
1731
|
+
e.backfill(i);
|
|
1732
|
+
}
|
|
1733
|
+
}, {
|
|
1734
|
+
label: "刷新",
|
|
1735
|
+
title: "刷新",
|
|
1736
|
+
icon: u(ct, {}),
|
|
1737
|
+
onClick: () => {
|
|
1738
|
+
e.refreshMessage(i);
|
|
1739
|
+
}
|
|
1740
|
+
}, {
|
|
1741
|
+
label: "删除",
|
|
1742
|
+
title: "删除",
|
|
1743
|
+
icon: u($n, {}),
|
|
1744
|
+
onClick: () => {
|
|
1745
|
+
e.deleteMessage(i);
|
|
1746
|
+
}
|
|
1747
|
+
}, {
|
|
1748
|
+
label: "复制",
|
|
1749
|
+
title: "复制",
|
|
1750
|
+
icon: u(Tn, {}),
|
|
1751
|
+
onClick: () => {
|
|
1752
|
+
e.copyMessage(i);
|
|
1753
|
+
}
|
|
1754
|
+
}], h = [{
|
|
1755
|
+
label: "刷新",
|
|
1756
|
+
title: "刷新",
|
|
1757
|
+
icon: u(ct, {}),
|
|
1758
|
+
onClick: () => {
|
|
1759
|
+
e.refreshMessage(i, !0);
|
|
1760
|
+
}
|
|
1761
|
+
}];
|
|
1762
|
+
if (s === "content")
|
|
1763
|
+
switch (c = "circle", i.type) {
|
|
1764
|
+
case "DEFAULT":
|
|
1765
|
+
i.role === "ASSISTANT" ? o = [...f, ...t] : o = [...h];
|
|
1766
|
+
break;
|
|
1767
|
+
case "ERROR":
|
|
1768
|
+
o = [...f, ...t];
|
|
1769
|
+
break;
|
|
1770
|
+
}
|
|
1771
|
+
else
|
|
1772
|
+
o = [...l, ...t];
|
|
1773
|
+
const a = (d) => typeof d.hidden == "function" ? d.hidden(i) : d.hidden === !0, _ = (d) => typeof d.disabled == "function" ? d.disabled(i) : d.disabled === !0, p = (d, g) => {
|
|
1774
|
+
var k;
|
|
1775
|
+
_(g) || (k = g.onClick) == null || k.call(g, d, e.context, e.params, i);
|
|
1776
|
+
};
|
|
1777
|
+
return u("div", {
|
|
1778
|
+
className: "".concat(V.b(), " ").concat(V.e(c), " ").concat(r || ""),
|
|
1779
|
+
children: o.map((d, g) => {
|
|
1780
|
+
if (!a(d))
|
|
1781
|
+
return u("div", {
|
|
1782
|
+
className: "".concat(V.e("item"), " ").concat(V.is("disabled", _(d)), " ").concat(V.is("loading", i.state === 20), " ").concat(r || ""),
|
|
1783
|
+
title: d.title,
|
|
1784
|
+
onClick: (k) => p(k, d),
|
|
1785
|
+
children: [u("div", {
|
|
1786
|
+
className: "".concat(V.em("item", "icon")),
|
|
1787
|
+
children: typeof d.icon == "function" ? d.icon(H) : d.icon
|
|
1788
|
+
}), u("div", {
|
|
1789
|
+
className: "".concat(V.em("item", "label")),
|
|
1790
|
+
children: typeof d.label == "function" ? d.label(H) : d.label
|
|
1791
|
+
})]
|
|
1792
|
+
}, g);
|
|
1415
1793
|
})
|
|
1416
1794
|
});
|
|
1417
1795
|
};
|
|
1418
|
-
const
|
|
1419
|
-
const e =
|
|
1420
|
-
return
|
|
1421
|
-
e.current &&
|
|
1796
|
+
const Ln = new D("chat-messages"), lt = (n) => {
|
|
1797
|
+
const e = q(null), t = n.controller.messages;
|
|
1798
|
+
return _n(() => {
|
|
1799
|
+
e.current && t.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
|
|
1422
1800
|
}), u("div", {
|
|
1423
1801
|
ref: e,
|
|
1424
|
-
className:
|
|
1425
|
-
children:
|
|
1802
|
+
className: Ln.b(),
|
|
1803
|
+
children: t.value.map((i) => {
|
|
1426
1804
|
var r;
|
|
1427
1805
|
const s = ((r = i.content) == null ? void 0 : r.length) || 0;
|
|
1428
|
-
return u(
|
|
1429
|
-
message: i,
|
|
1806
|
+
return u(wn, {
|
|
1430
1807
|
size: s,
|
|
1431
|
-
|
|
1808
|
+
message: i,
|
|
1809
|
+
controller: n.controller,
|
|
1810
|
+
children: u(Ue, {
|
|
1811
|
+
data: i,
|
|
1812
|
+
type: "content",
|
|
1813
|
+
items: n.toolbarItems,
|
|
1814
|
+
controller: n.controller
|
|
1815
|
+
})
|
|
1432
1816
|
}, i.messageid);
|
|
1433
1817
|
})
|
|
1434
1818
|
});
|
|
1435
1819
|
};
|
|
1436
|
-
function
|
|
1437
|
-
for (var
|
|
1438
|
-
t
|
|
1439
|
-
return
|
|
1820
|
+
function Rn(n, e) {
|
|
1821
|
+
for (var t in e)
|
|
1822
|
+
n[t] = e[t];
|
|
1823
|
+
return n;
|
|
1440
1824
|
}
|
|
1441
|
-
function
|
|
1442
|
-
for (var
|
|
1443
|
-
if (
|
|
1825
|
+
function ut(n, e) {
|
|
1826
|
+
for (var t in n)
|
|
1827
|
+
if (t !== "__source" && !(t in e))
|
|
1444
1828
|
return !0;
|
|
1445
1829
|
for (var i in e)
|
|
1446
|
-
if (i !== "__source" &&
|
|
1830
|
+
if (i !== "__source" && n[i] !== e[i])
|
|
1447
1831
|
return !0;
|
|
1448
1832
|
return !1;
|
|
1449
1833
|
}
|
|
1450
|
-
function
|
|
1451
|
-
this.props =
|
|
1834
|
+
function ht(n) {
|
|
1835
|
+
this.props = n;
|
|
1452
1836
|
}
|
|
1453
|
-
(
|
|
1454
|
-
return
|
|
1837
|
+
(ht.prototype = new M()).isPureReactComponent = !0, ht.prototype.shouldComponentUpdate = function(n, e) {
|
|
1838
|
+
return ut(this.props, n) || ut(this.state, e);
|
|
1455
1839
|
};
|
|
1456
|
-
var
|
|
1457
|
-
|
|
1458
|
-
|
|
1840
|
+
var dt = v.__b;
|
|
1841
|
+
v.__b = function(n) {
|
|
1842
|
+
n.type && n.type.__f && n.ref && (n.props.ref = n.ref, n.ref = null), dt && dt(n);
|
|
1459
1843
|
};
|
|
1460
|
-
var
|
|
1461
|
-
|
|
1462
|
-
if (
|
|
1844
|
+
var Pn = v.__e;
|
|
1845
|
+
v.__e = function(n, e, t, i) {
|
|
1846
|
+
if (n.then) {
|
|
1463
1847
|
for (var s, r = e; r = r.__; )
|
|
1464
1848
|
if ((s = r.__c) && s.__c)
|
|
1465
|
-
return e.__e == null && (e.__e =
|
|
1849
|
+
return e.__e == null && (e.__e = t.__e, e.__k = t.__k), s.__c(n, e);
|
|
1466
1850
|
}
|
|
1467
|
-
|
|
1851
|
+
Pn(n, e, t, i);
|
|
1468
1852
|
};
|
|
1469
|
-
var
|
|
1470
|
-
function
|
|
1471
|
-
return
|
|
1853
|
+
var ft = v.unmount;
|
|
1854
|
+
function qt(n, e, t) {
|
|
1855
|
+
return n && (n.__c && n.__c.__H && (n.__c.__H.__.forEach(function(i) {
|
|
1472
1856
|
typeof i.__c == "function" && i.__c();
|
|
1473
|
-
}),
|
|
1474
|
-
return
|
|
1475
|
-
})),
|
|
1857
|
+
}), n.__c.__H = null), (n = Rn({}, n)).__c != null && (n.__c.__P === t && (n.__c.__P = e), n.__c = null), n.__k = n.__k && n.__k.map(function(i) {
|
|
1858
|
+
return qt(i, e, t);
|
|
1859
|
+
})), n;
|
|
1476
1860
|
}
|
|
1477
|
-
function
|
|
1478
|
-
return
|
|
1479
|
-
return
|
|
1480
|
-
}),
|
|
1861
|
+
function Xt(n, e, t) {
|
|
1862
|
+
return n && t && (n.__v = null, n.__k = n.__k && n.__k.map(function(i) {
|
|
1863
|
+
return Xt(i, e, t);
|
|
1864
|
+
}), n.__c && n.__c.__P === e && (n.__e && t.insertBefore(n.__e, n.__d), n.__c.__e = !0, n.__c.__P = t)), n;
|
|
1481
1865
|
}
|
|
1482
|
-
function
|
|
1866
|
+
function ze() {
|
|
1483
1867
|
this.__u = 0, this.t = null, this.__b = null;
|
|
1484
1868
|
}
|
|
1485
|
-
function
|
|
1486
|
-
var e =
|
|
1487
|
-
return e && e.__a && e.__a(
|
|
1869
|
+
function Zt(n) {
|
|
1870
|
+
var e = n.__.__c;
|
|
1871
|
+
return e && e.__a && e.__a(n);
|
|
1488
1872
|
}
|
|
1489
|
-
function
|
|
1873
|
+
function pe() {
|
|
1490
1874
|
this.u = null, this.o = null;
|
|
1491
1875
|
}
|
|
1492
|
-
|
|
1493
|
-
var e =
|
|
1494
|
-
e && e.__R && e.__R(), e &&
|
|
1495
|
-
}, (
|
|
1496
|
-
var
|
|
1497
|
-
i.t == null && (i.t = []), i.t.push(
|
|
1498
|
-
var s =
|
|
1499
|
-
r || (r = !0,
|
|
1876
|
+
v.unmount = function(n) {
|
|
1877
|
+
var e = n.__c;
|
|
1878
|
+
e && e.__R && e.__R(), e && n.__h === !0 && (n.type = null), ft && ft(n);
|
|
1879
|
+
}, (ze.prototype = new M()).__c = function(n, e) {
|
|
1880
|
+
var t = e.__c, i = this;
|
|
1881
|
+
i.t == null && (i.t = []), i.t.push(t);
|
|
1882
|
+
var s = Zt(i.__v), r = !1, o = function() {
|
|
1883
|
+
r || (r = !0, t.__R = null, s ? s(c) : c());
|
|
1500
1884
|
};
|
|
1501
|
-
|
|
1502
|
-
var
|
|
1885
|
+
t.__R = o;
|
|
1886
|
+
var c = function() {
|
|
1503
1887
|
if (!--i.__u) {
|
|
1504
1888
|
if (i.state.__a) {
|
|
1505
|
-
var
|
|
1506
|
-
i.__v.__k[0] =
|
|
1889
|
+
var f = i.state.__a;
|
|
1890
|
+
i.__v.__k[0] = Xt(f, f.__c.__P, f.__c.__O);
|
|
1507
1891
|
}
|
|
1508
1892
|
var h;
|
|
1509
1893
|
for (i.setState({ __a: i.__b = null }); h = i.t.pop(); )
|
|
1510
1894
|
h.forceUpdate();
|
|
1511
1895
|
}
|
|
1512
|
-
},
|
|
1513
|
-
i.__u++ ||
|
|
1514
|
-
},
|
|
1896
|
+
}, l = e.__h === !0;
|
|
1897
|
+
i.__u++ || l || i.setState({ __a: i.__b = i.__v.__k[0] }), n.then(o, o);
|
|
1898
|
+
}, ze.prototype.componentWillUnmount = function() {
|
|
1515
1899
|
this.t = [];
|
|
1516
|
-
},
|
|
1900
|
+
}, ze.prototype.render = function(n, e) {
|
|
1517
1901
|
if (this.__b) {
|
|
1518
1902
|
if (this.__v.__k) {
|
|
1519
|
-
var
|
|
1520
|
-
this.__v.__k[0] =
|
|
1903
|
+
var t = document.createElement("div"), i = this.__v.__k[0].__c;
|
|
1904
|
+
this.__v.__k[0] = qt(this.__b, t, i.__O = i.__P);
|
|
1521
1905
|
}
|
|
1522
1906
|
this.__b = null;
|
|
1523
1907
|
}
|
|
1524
|
-
var s = e.__a && K
|
|
1525
|
-
return s && (s.__h = null), [K
|
|
1908
|
+
var s = e.__a && H(K, null, n.fallback);
|
|
1909
|
+
return s && (s.__h = null), [H(K, null, e.__a ? null : n.children), s];
|
|
1526
1910
|
};
|
|
1527
|
-
var
|
|
1528
|
-
if (++
|
|
1529
|
-
for (
|
|
1530
|
-
for (;
|
|
1531
|
-
|
|
1532
|
-
if (
|
|
1911
|
+
var _t = function(n, e, t) {
|
|
1912
|
+
if (++t[1] === t[0] && n.o.delete(e), n.props.revealOrder && (n.props.revealOrder[0] !== "t" || !n.o.size))
|
|
1913
|
+
for (t = n.u; t; ) {
|
|
1914
|
+
for (; t.length > 3; )
|
|
1915
|
+
t.pop()();
|
|
1916
|
+
if (t[1] < t[0])
|
|
1533
1917
|
break;
|
|
1534
|
-
|
|
1918
|
+
n.u = t = t[2];
|
|
1535
1919
|
}
|
|
1536
1920
|
};
|
|
1537
|
-
|
|
1538
|
-
|
|
1921
|
+
function On(n) {
|
|
1922
|
+
return this.getChildContext = function() {
|
|
1923
|
+
return n.context;
|
|
1924
|
+
}, n.children;
|
|
1925
|
+
}
|
|
1926
|
+
function Un(n) {
|
|
1927
|
+
var e = this, t = n.i;
|
|
1928
|
+
e.componentWillUnmount = function() {
|
|
1929
|
+
Z(null, e.l), e.l = null, e.i = null;
|
|
1930
|
+
}, e.i && e.i !== t && e.componentWillUnmount(), e.l || (e.i = t, e.l = { nodeType: 1, parentNode: t, childNodes: [], appendChild: function(i) {
|
|
1931
|
+
this.childNodes.push(i), e.i.appendChild(i);
|
|
1932
|
+
}, insertBefore: function(i, s) {
|
|
1933
|
+
this.childNodes.push(i), e.i.appendChild(i);
|
|
1934
|
+
}, removeChild: function(i) {
|
|
1935
|
+
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.i.removeChild(i);
|
|
1936
|
+
} }), Z(H(On, { context: e.context }, n.__v), e.l);
|
|
1937
|
+
}
|
|
1938
|
+
function Bn(n, e) {
|
|
1939
|
+
var t = H(Un, { __v: n, i: e });
|
|
1940
|
+
return t.containerInfo = e, t;
|
|
1941
|
+
}
|
|
1942
|
+
(pe.prototype = new M()).__a = function(n) {
|
|
1943
|
+
var e = this, t = Zt(e.__v), i = e.o.get(n);
|
|
1539
1944
|
return i[0]++, function(s) {
|
|
1540
1945
|
var r = function() {
|
|
1541
|
-
e.props.revealOrder ? (i.push(s),
|
|
1946
|
+
e.props.revealOrder ? (i.push(s), _t(e, n, i)) : s();
|
|
1542
1947
|
};
|
|
1543
|
-
|
|
1948
|
+
t ? t(r) : r();
|
|
1544
1949
|
};
|
|
1545
|
-
},
|
|
1950
|
+
}, pe.prototype.render = function(n) {
|
|
1546
1951
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
1547
|
-
var e =
|
|
1548
|
-
|
|
1549
|
-
for (var
|
|
1550
|
-
this.o.set(e[
|
|
1551
|
-
return
|
|
1552
|
-
},
|
|
1553
|
-
var
|
|
1554
|
-
this.o.forEach(function(e,
|
|
1555
|
-
|
|
1952
|
+
var e = we(n.children);
|
|
1953
|
+
n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
|
|
1954
|
+
for (var t = e.length; t--; )
|
|
1955
|
+
this.o.set(e[t], this.u = [1, 0, this.u]);
|
|
1956
|
+
return n.children;
|
|
1957
|
+
}, pe.prototype.componentDidUpdate = pe.prototype.componentDidMount = function() {
|
|
1958
|
+
var n = this;
|
|
1959
|
+
this.o.forEach(function(e, t) {
|
|
1960
|
+
_t(n, t, e);
|
|
1556
1961
|
});
|
|
1557
1962
|
};
|
|
1558
|
-
var
|
|
1559
|
-
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(
|
|
1963
|
+
var Fn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Vn = /^(?: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]/, Wn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, jn = /[A-Z0-9]/g, Yn = typeof document < "u", qn = function(n) {
|
|
1964
|
+
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(n);
|
|
1560
1965
|
};
|
|
1561
|
-
M.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(
|
|
1562
|
-
Object.defineProperty(M.prototype,
|
|
1563
|
-
return this["UNSAFE_" +
|
|
1966
|
+
M.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(n) {
|
|
1967
|
+
Object.defineProperty(M.prototype, n, { configurable: !0, get: function() {
|
|
1968
|
+
return this["UNSAFE_" + n];
|
|
1564
1969
|
}, set: function(e) {
|
|
1565
|
-
Object.defineProperty(this,
|
|
1970
|
+
Object.defineProperty(this, n, { configurable: !0, writable: !0, value: e });
|
|
1566
1971
|
} });
|
|
1567
1972
|
});
|
|
1568
|
-
var
|
|
1569
|
-
function
|
|
1973
|
+
var pt = v.event;
|
|
1974
|
+
function Xn() {
|
|
1570
1975
|
}
|
|
1571
|
-
function
|
|
1976
|
+
function Zn() {
|
|
1572
1977
|
return this.cancelBubble;
|
|
1573
1978
|
}
|
|
1574
|
-
function
|
|
1979
|
+
function Gn() {
|
|
1575
1980
|
return this.defaultPrevented;
|
|
1576
1981
|
}
|
|
1577
|
-
|
|
1578
|
-
return
|
|
1982
|
+
v.event = function(n) {
|
|
1983
|
+
return pt && (n = pt(n)), n.persist = Xn, n.isPropagationStopped = Zn, n.isDefaultPrevented = Gn, n.nativeEvent = n;
|
|
1579
1984
|
};
|
|
1580
|
-
var
|
|
1985
|
+
var Jn = { enumerable: !1, configurable: !0, get: function() {
|
|
1581
1986
|
return this.class;
|
|
1582
|
-
} },
|
|
1583
|
-
|
|
1584
|
-
typeof
|
|
1585
|
-
var
|
|
1586
|
-
for (var r in
|
|
1587
|
-
var o =
|
|
1588
|
-
if (!(r === "value" && "defaultValue" in
|
|
1589
|
-
var
|
|
1590
|
-
r === "defaultValue" && "value" in
|
|
1987
|
+
} }, vt = v.vnode;
|
|
1988
|
+
v.vnode = function(n) {
|
|
1989
|
+
typeof n.type == "string" && function(e) {
|
|
1990
|
+
var t = e.props, i = e.type, s = {};
|
|
1991
|
+
for (var r in t) {
|
|
1992
|
+
var o = t[r];
|
|
1993
|
+
if (!(r === "value" && "defaultValue" in t && o == null || Yn && r === "children" && i === "noscript" || r === "class" || r === "className")) {
|
|
1994
|
+
var c = r.toLowerCase();
|
|
1995
|
+
r === "defaultValue" && "value" in t && t.value == null ? r = "value" : r === "download" && o === !0 ? o = "" : c === "ondoubleclick" ? r = "ondblclick" : c !== "onchange" || i !== "input" && i !== "textarea" || qn(t.type) ? c === "onfocus" ? r = "onfocusin" : c === "onblur" ? r = "onfocusout" : Wn.test(r) ? r = c : i.indexOf("-") === -1 && Vn.test(r) ? r = r.replace(jn, "-$&").toLowerCase() : o === null && (o = void 0) : c = r = "oninput", c === "oninput" && s[r = c] && (r = "oninputCapture"), s[r] = o;
|
|
1591
1996
|
}
|
|
1592
1997
|
}
|
|
1593
|
-
i == "select" && s.multiple && Array.isArray(s.value) && (s.value =
|
|
1594
|
-
|
|
1595
|
-
})), i == "select" && s.defaultValue != null && (s.value =
|
|
1596
|
-
|
|
1597
|
-
})),
|
|
1598
|
-
}(
|
|
1998
|
+
i == "select" && s.multiple && Array.isArray(s.value) && (s.value = we(t.children).forEach(function(l) {
|
|
1999
|
+
l.props.selected = s.value.indexOf(l.props.value) != -1;
|
|
2000
|
+
})), i == "select" && s.defaultValue != null && (s.value = we(t.children).forEach(function(l) {
|
|
2001
|
+
l.props.selected = s.multiple ? s.defaultValue.indexOf(l.props.value) != -1 : s.defaultValue == l.props.value;
|
|
2002
|
+
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Jn)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
|
|
2003
|
+
}(n), n.$$typeof = Fn, vt && vt(n);
|
|
1599
2004
|
};
|
|
1600
|
-
var
|
|
1601
|
-
|
|
1602
|
-
|
|
2005
|
+
var mt = v.__r;
|
|
2006
|
+
v.__r = function(n) {
|
|
2007
|
+
mt && mt(n), n.__c;
|
|
1603
2008
|
};
|
|
1604
|
-
var
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
var e =
|
|
1608
|
-
|
|
2009
|
+
var gt = v.diffed;
|
|
2010
|
+
v.diffed = function(n) {
|
|
2011
|
+
gt && gt(n);
|
|
2012
|
+
var e = n.props, t = n.__e;
|
|
2013
|
+
t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
|
|
1609
2014
|
};
|
|
1610
|
-
var
|
|
1611
|
-
function
|
|
1612
|
-
var e =
|
|
2015
|
+
var re = /* @__PURE__ */ new Map();
|
|
2016
|
+
function Kn(n) {
|
|
2017
|
+
var e = re.get(n);
|
|
1613
2018
|
e && e.destroy();
|
|
1614
2019
|
}
|
|
1615
|
-
function
|
|
1616
|
-
var e =
|
|
2020
|
+
function Qn(n) {
|
|
2021
|
+
var e = re.get(n);
|
|
1617
2022
|
e && e.update();
|
|
1618
2023
|
}
|
|
1619
|
-
var
|
|
1620
|
-
typeof window > "u" ? ((
|
|
1621
|
-
return
|
|
1622
|
-
}).destroy = function(
|
|
1623
|
-
return
|
|
1624
|
-
},
|
|
1625
|
-
return
|
|
1626
|
-
}) : ((
|
|
1627
|
-
return
|
|
2024
|
+
var ne = null;
|
|
2025
|
+
typeof window > "u" ? ((ne = function(n) {
|
|
2026
|
+
return n;
|
|
2027
|
+
}).destroy = function(n) {
|
|
2028
|
+
return n;
|
|
2029
|
+
}, ne.update = function(n) {
|
|
2030
|
+
return n;
|
|
2031
|
+
}) : ((ne = function(n, e) {
|
|
2032
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
|
|
1628
2033
|
return function(i) {
|
|
1629
|
-
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !
|
|
1630
|
-
var s, r = null, o = window.getComputedStyle(i),
|
|
1631
|
-
|
|
1632
|
-
}),
|
|
1633
|
-
i.removeEventListener("autosize:destroy",
|
|
1634
|
-
return i.style[
|
|
1635
|
-
}),
|
|
2034
|
+
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !re.has(i)) {
|
|
2035
|
+
var s, r = null, o = window.getComputedStyle(i), c = (s = i.value, function() {
|
|
2036
|
+
f({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
|
|
2037
|
+
}), l = (function(a) {
|
|
2038
|
+
i.removeEventListener("autosize:destroy", l), i.removeEventListener("autosize:update", h), i.removeEventListener("input", c), window.removeEventListener("resize", h), Object.keys(a).forEach(function(_) {
|
|
2039
|
+
return i.style[_] = a[_];
|
|
2040
|
+
}), re.delete(i);
|
|
1636
2041
|
}).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 });
|
|
1637
|
-
i.addEventListener("autosize:destroy",
|
|
2042
|
+
i.addEventListener("autosize:destroy", l), i.addEventListener("autosize:update", h), i.addEventListener("input", c), window.addEventListener("resize", h), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", re.set(i, { destroy: l, update: h }), h();
|
|
1638
2043
|
}
|
|
1639
|
-
function
|
|
1640
|
-
var
|
|
1641
|
-
if (i.scrollHeight !== 0 && (o.resize === "vertical" ? i.style.resize = "none" : o.resize === "both" && (i.style.resize = "horizontal"),
|
|
1642
|
-
for (var
|
|
1643
|
-
|
|
2044
|
+
function f(a) {
|
|
2045
|
+
var _, p, d = a.restoreTextAlign, g = d === void 0 ? null : d, k = a.testForHeightReduction, b = k === void 0 || k, C = o.overflowY;
|
|
2046
|
+
if (i.scrollHeight !== 0 && (o.resize === "vertical" ? i.style.resize = "none" : o.resize === "both" && (i.style.resize = "horizontal"), b && (_ = function(S) {
|
|
2047
|
+
for (var E = []; S && S.parentNode && S.parentNode instanceof Element; )
|
|
2048
|
+
S.parentNode.scrollTop && E.push([S.parentNode, S.parentNode.scrollTop]), S = S.parentNode;
|
|
1644
2049
|
return function() {
|
|
1645
|
-
return
|
|
1646
|
-
var
|
|
1647
|
-
|
|
2050
|
+
return E.forEach(function(L) {
|
|
2051
|
+
var N = L[0], R = L[1];
|
|
2052
|
+
N.style.scrollBehavior = "auto", N.scrollTop = R, N.style.scrollBehavior = null;
|
|
1648
2053
|
});
|
|
1649
2054
|
};
|
|
1650
|
-
}(i), i.style.height = ""),
|
|
1651
|
-
var
|
|
1652
|
-
o.overflow === "hidden" && (i.style.textAlign =
|
|
2055
|
+
}(i), i.style.height = ""), p = o.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(o.paddingTop) + parseFloat(o.paddingBottom)) : i.scrollHeight + parseFloat(o.borderTopWidth) + parseFloat(o.borderBottomWidth), o.maxHeight !== "none" && p > parseFloat(o.maxHeight) ? (o.overflowY === "hidden" && (i.style.overflow = "scroll"), p = parseFloat(o.maxHeight)) : o.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = p + "px", g && (i.style.textAlign = g), _ && _(), r !== p && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), r = p), C !== o.overflow && !g)) {
|
|
2056
|
+
var x = o.textAlign;
|
|
2057
|
+
o.overflow === "hidden" && (i.style.textAlign = x === "start" ? "end" : "start"), f({ restoreTextAlign: x, testForHeightReduction: !0 });
|
|
1653
2058
|
}
|
|
1654
2059
|
}
|
|
1655
2060
|
function h() {
|
|
1656
|
-
|
|
2061
|
+
f({ testForHeightReduction: !0, restoreTextAlign: null });
|
|
1657
2062
|
}
|
|
1658
|
-
}(
|
|
1659
|
-
}),
|
|
1660
|
-
}).destroy = function(
|
|
1661
|
-
return
|
|
1662
|
-
},
|
|
1663
|
-
return
|
|
2063
|
+
}(t);
|
|
2064
|
+
}), n;
|
|
2065
|
+
}).destroy = function(n) {
|
|
2066
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], Kn), n;
|
|
2067
|
+
}, ne.update = function(n) {
|
|
2068
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], Qn), n;
|
|
1664
2069
|
});
|
|
1665
|
-
var
|
|
1666
|
-
const W = new
|
|
1667
|
-
const e =
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
2070
|
+
var yt = ne;
|
|
2071
|
+
const W = new D("chat-input"), bt = window.SpeechRecognition || window.webkitSpeechRecognition, wt = (n) => {
|
|
2072
|
+
const e = q(null), t = n.controller.input, i = ue(!1), s = ue(!1), r = q();
|
|
2073
|
+
bt && !r.current && (r.current = new bt(), r.current.onstart = () => {
|
|
2074
|
+
s.value = !0;
|
|
2075
|
+
}, r.current.onend = () => {
|
|
2076
|
+
s.value = !1;
|
|
2077
|
+
}, r.current.onresult = (a) => {
|
|
2078
|
+
var p, d, g;
|
|
2079
|
+
const _ = (g = (d = (p = a.results) == null ? void 0 : p[0]) == null ? void 0 : d[0]) == null ? void 0 : g.transcript;
|
|
2080
|
+
_ && (t.value = "".concat(t.value).concat(_));
|
|
2081
|
+
});
|
|
2082
|
+
const o = () => {
|
|
2083
|
+
r.current && !s.value && r.current.start();
|
|
2084
|
+
}, c = rt((a) => {
|
|
2085
|
+
t.value = a.target.value;
|
|
2086
|
+
}, [t]), l = Ye(() => t.value.length <= 0 || i.value === !0);
|
|
2087
|
+
Y(() => (e.current && yt(e.current), () => {
|
|
2088
|
+
e.current && yt.destroy(e.current);
|
|
1672
2089
|
}), [e]);
|
|
1673
|
-
const
|
|
2090
|
+
const f = rt(async () => {
|
|
1674
2091
|
i.value = !0;
|
|
1675
2092
|
try {
|
|
1676
|
-
await
|
|
1677
|
-
} catch (
|
|
1678
|
-
console.error(
|
|
2093
|
+
await n.controller.question(t.value), t.value = "";
|
|
2094
|
+
} catch (a) {
|
|
2095
|
+
console.error(a);
|
|
1679
2096
|
} finally {
|
|
1680
2097
|
i.value = !1;
|
|
1681
2098
|
}
|
|
1682
|
-
}, [
|
|
1683
|
-
|
|
2099
|
+
}, [t, i]), h = (a) => {
|
|
2100
|
+
a.code === "Enter" && (a.stopPropagation(), a.shiftKey === !1 && f());
|
|
1684
2101
|
};
|
|
1685
2102
|
return u("div", {
|
|
1686
2103
|
className: W.b(),
|
|
@@ -1691,90 +2108,300 @@ const W = new U("chat-input"), Hn = (t) => {
|
|
|
1691
2108
|
autoCorrect: "off",
|
|
1692
2109
|
autoCapitalize: "off",
|
|
1693
2110
|
autoComplete: "off",
|
|
1694
|
-
value:
|
|
1695
|
-
onInput:
|
|
1696
|
-
onKeyDown:
|
|
2111
|
+
value: t,
|
|
2112
|
+
onInput: c,
|
|
2113
|
+
onKeyDown: h,
|
|
1697
2114
|
ref: e,
|
|
1698
2115
|
disabled: i
|
|
1699
2116
|
}), u("div", {
|
|
1700
2117
|
className: W.b("action-wrapper"),
|
|
1701
|
-
children: u("div", {
|
|
1702
|
-
title:
|
|
1703
|
-
className: "".concat(W.be("action-wrapper", "action-item")
|
|
2118
|
+
children: [u("div", {
|
|
2119
|
+
title: s.value ? "语音输入中..." : "语音输入",
|
|
2120
|
+
className: "".concat(W.be("action-wrapper", "action-item")),
|
|
1704
2121
|
onClick: o,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
2122
|
+
children: s.value ? u(Mn, {}) : u(Dn, {})
|
|
2123
|
+
}), u("div", {
|
|
2124
|
+
title: i.value ? "思考中..." : "发送消息",
|
|
2125
|
+
className: "".concat(W.be("action-wrapper", "action-item"), " ").concat(W.is("disabled", l.value), " ").concat(W.is("loading", i.value)),
|
|
2126
|
+
onClick: f,
|
|
2127
|
+
disabled: l,
|
|
2128
|
+
children: u(En, {})
|
|
2129
|
+
})]
|
|
2130
|
+
})]
|
|
2131
|
+
});
|
|
2132
|
+
};
|
|
2133
|
+
var I = /* @__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))(I || {});
|
|
2134
|
+
const ei = ({
|
|
2135
|
+
children: n,
|
|
2136
|
+
actions: e,
|
|
2137
|
+
// 接收行为数据
|
|
2138
|
+
position: t = "bottom",
|
|
2139
|
+
isOpen: i,
|
|
2140
|
+
onToggleOpen: s,
|
|
2141
|
+
onAction: r
|
|
2142
|
+
// 接收行为事件回调
|
|
2143
|
+
}) => {
|
|
2144
|
+
const o = new D("pop"), [c, l] = Rt(i || !1), f = q(null), h = q(null);
|
|
2145
|
+
Y(() => {
|
|
2146
|
+
i !== void 0 && l(i);
|
|
2147
|
+
}, [i]), Y(() => (h.current || (h.current = document.createElement("div"), h.current.className = o.b("content-container"), document.body.appendChild(h.current)), () => {
|
|
2148
|
+
h.current && document.body.removeChild(h.current);
|
|
2149
|
+
}), []), Y(() => {
|
|
2150
|
+
const _ = (p) => {
|
|
2151
|
+
f.current && !f.current.contains(p.target) && !p.target.closest(o.b("content")) && (l(!1), s == null || s(!1));
|
|
2152
|
+
};
|
|
2153
|
+
return c && document.addEventListener("mousedown", _), () => {
|
|
2154
|
+
document.removeEventListener("mousedown", _);
|
|
2155
|
+
};
|
|
2156
|
+
}, [c, s]);
|
|
2157
|
+
const a = () => {
|
|
2158
|
+
if (!f.current)
|
|
2159
|
+
return {};
|
|
2160
|
+
const _ = f.current.getBoundingClientRect(), p = {
|
|
2161
|
+
position: "absolute",
|
|
2162
|
+
zIndex: 1e3
|
|
2163
|
+
}, d = {
|
|
2164
|
+
bottom: {
|
|
2165
|
+
top: _.bottom + window.scrollY,
|
|
2166
|
+
left: _.left + window.scrollX
|
|
2167
|
+
},
|
|
2168
|
+
top: {
|
|
2169
|
+
bottom: window.innerHeight - _.top + window.scrollY,
|
|
2170
|
+
left: _.left + window.scrollX
|
|
2171
|
+
},
|
|
2172
|
+
left: {
|
|
2173
|
+
top: _.top + window.scrollY,
|
|
2174
|
+
right: window.innerWidth - _.left + window.scrollX
|
|
2175
|
+
},
|
|
2176
|
+
right: {
|
|
2177
|
+
top: _.top + window.scrollY,
|
|
2178
|
+
left: _.right + window.scrollX
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
return {
|
|
2182
|
+
...p,
|
|
2183
|
+
...d[t]
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
return u("span", {
|
|
2187
|
+
className: "".concat(o.b("trigger-container")),
|
|
2188
|
+
children: [u("span", {
|
|
2189
|
+
className: "".concat(o.b("trigger-element")),
|
|
2190
|
+
ref: f,
|
|
2191
|
+
onClick: (_) => {
|
|
2192
|
+
_.stopPropagation();
|
|
2193
|
+
const p = !c;
|
|
2194
|
+
l(p), s == null || s(p);
|
|
2195
|
+
},
|
|
2196
|
+
children: n
|
|
2197
|
+
}), c && h.current && Bn(u("div", {
|
|
2198
|
+
className: "".concat(o.b("content"), " pop-").concat(t),
|
|
2199
|
+
style: a(),
|
|
2200
|
+
children: e == null ? void 0 : e.map((_) => u("div", {
|
|
2201
|
+
className: o.b("content-item"),
|
|
2202
|
+
onMouseDown: (p) => {
|
|
2203
|
+
p.stopPropagation(), r == null || r(_.id, p);
|
|
2204
|
+
},
|
|
2205
|
+
children: [_.icon && u("img", {
|
|
2206
|
+
className: o.b("content-item__icon"),
|
|
2207
|
+
src: _.icon,
|
|
2208
|
+
alt: _.caption
|
|
2209
|
+
}), u("div", {
|
|
2210
|
+
className: o.b("content-item__caption"),
|
|
2211
|
+
children: _.caption
|
|
2212
|
+
})]
|
|
2213
|
+
}, _.id))
|
|
2214
|
+
}), h.current)]
|
|
2215
|
+
});
|
|
2216
|
+
};
|
|
2217
|
+
const O = new D("chat-topic-item"), ti = (n) => {
|
|
2218
|
+
const {
|
|
2219
|
+
current: e,
|
|
2220
|
+
active: t,
|
|
2221
|
+
topic: i,
|
|
2222
|
+
onClick: s,
|
|
2223
|
+
onAction: r
|
|
2224
|
+
} = n, [o, c] = Rt(!1), l = (h) => {
|
|
2225
|
+
h.stopPropagation(), r("LINK", h);
|
|
2226
|
+
}, f = (h, a) => {
|
|
2227
|
+
h === "DELETE" && r("DELETE", a), c(!1);
|
|
2228
|
+
};
|
|
2229
|
+
return u("div", {
|
|
2230
|
+
className: "".concat(O.b(), " ").concat(O.is("active", t)),
|
|
2231
|
+
onClick: s.bind(void 0),
|
|
2232
|
+
children: [u("div", {
|
|
2233
|
+
className: O.b("caption"),
|
|
2234
|
+
title: i.caption,
|
|
2235
|
+
children: i.caption
|
|
2236
|
+
}), u("div", {
|
|
2237
|
+
className: O.b("icon"),
|
|
2238
|
+
children: [u("span", {
|
|
2239
|
+
className: O.be("icon", "item"),
|
|
2240
|
+
title: "跳转主视图",
|
|
2241
|
+
onClick: l.bind(void 0),
|
|
2242
|
+
children: u(Hn, {
|
|
2243
|
+
className: O.b("link-icon")
|
|
2244
|
+
})
|
|
2245
|
+
}), e ? null : u(ei, {
|
|
2246
|
+
actions: [{
|
|
2247
|
+
id: "DELETE",
|
|
2248
|
+
caption: "删除话题"
|
|
2249
|
+
}],
|
|
2250
|
+
position: "bottom",
|
|
2251
|
+
isOpen: o,
|
|
2252
|
+
onToggleOpen: c,
|
|
2253
|
+
onAction: f.bind(void 0),
|
|
2254
|
+
children: u("span", {
|
|
2255
|
+
className: O.be("icon", "item"),
|
|
2256
|
+
title: "更多",
|
|
2257
|
+
children: u(zn, {
|
|
2258
|
+
className: O.b("more-icon")
|
|
2259
|
+
})
|
|
2260
|
+
})
|
|
2261
|
+
})]
|
|
1708
2262
|
})]
|
|
1709
2263
|
});
|
|
1710
2264
|
};
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
2265
|
+
const ni = new D("chat-topics"), ii = (n) => {
|
|
2266
|
+
const e = n.controller.topics, t = (s) => {
|
|
2267
|
+
n.controller.handleTopicChange(s);
|
|
2268
|
+
}, i = (s, r, o) => {
|
|
2269
|
+
n.controller.handleTopicAction(s, r, o);
|
|
2270
|
+
};
|
|
2271
|
+
return u("div", {
|
|
2272
|
+
className: ni.b(),
|
|
2273
|
+
children: e.value.map((s) => {
|
|
2274
|
+
var r, o;
|
|
2275
|
+
return u(ti, {
|
|
2276
|
+
topic: s,
|
|
2277
|
+
current: s.id === ((r = n.controller.currentTopicOptions) == null ? void 0 : r.id),
|
|
2278
|
+
active: s.id === ((o = n.controller.activedTopic.value) == null ? void 0 : o.id),
|
|
2279
|
+
onClick: () => t(s),
|
|
2280
|
+
onAction: (c, l) => i(c, s, l)
|
|
2281
|
+
}, s.id);
|
|
2282
|
+
})
|
|
2283
|
+
});
|
|
2284
|
+
};
|
|
2285
|
+
class Ct extends M {
|
|
2286
|
+
constructor(t) {
|
|
2287
|
+
super(t);
|
|
2288
|
+
y(this, "ns", new D("chat-container"));
|
|
2289
|
+
y(this, "containerRef", Ie());
|
|
2290
|
+
y(this, "dragHandle", Ie());
|
|
2291
|
+
y(this, "minimizeRef", Ie());
|
|
2292
|
+
y(this, "data", {
|
|
2293
|
+
x: window.innerWidth - 600,
|
|
2294
|
+
y: 0,
|
|
1721
2295
|
width: 600,
|
|
1722
|
-
height:
|
|
2296
|
+
height: window.innerHeight,
|
|
1723
2297
|
minWidth: 300,
|
|
1724
2298
|
minHeight: 300
|
|
1725
2299
|
});
|
|
2300
|
+
y(this, "minimizeData", {
|
|
2301
|
+
x: window.innerWidth - 86,
|
|
2302
|
+
y: window.innerHeight - 86
|
|
2303
|
+
});
|
|
2304
|
+
/**
|
|
2305
|
+
* 是否禁止拖动
|
|
2306
|
+
* - 拖拽边时应禁止拖动
|
|
2307
|
+
* @type {boolean}
|
|
2308
|
+
* @memberof ChatContainer
|
|
2309
|
+
*/
|
|
2310
|
+
y(this, "disabled", !1);
|
|
2311
|
+
/**
|
|
2312
|
+
* 最小化是否在拖拽中
|
|
2313
|
+
* - 在拖拽时不应触发点击事件
|
|
2314
|
+
* @type {boolean}
|
|
2315
|
+
* @memberof ChatContainer
|
|
2316
|
+
*/
|
|
2317
|
+
y(this, "isDragging", !1);
|
|
1726
2318
|
this.state = {
|
|
1727
|
-
isFullScreen: !1
|
|
2319
|
+
isFullScreen: !1,
|
|
2320
|
+
isMinimize: !1
|
|
1728
2321
|
};
|
|
1729
2322
|
}
|
|
1730
|
-
|
|
2323
|
+
calcWindowStyle() {
|
|
1731
2324
|
return {
|
|
1732
|
-
|
|
1733
|
-
top: "
|
|
1734
|
-
height: "
|
|
2325
|
+
left: "".concat(this.data.x, "px"),
|
|
2326
|
+
top: "".concat(this.data.y, "px"),
|
|
2327
|
+
height: "".concat(this.data.height, "px"),
|
|
1735
2328
|
width: "".concat(this.data.width, "px"),
|
|
1736
2329
|
"z-index": "1000"
|
|
1737
2330
|
};
|
|
1738
2331
|
}
|
|
2332
|
+
calcMinimizeStyle() {
|
|
2333
|
+
return {
|
|
2334
|
+
left: "".concat(this.minimizeData.x, "px"),
|
|
2335
|
+
top: "".concat(this.minimizeData.y, "px"),
|
|
2336
|
+
"z-index": "99999"
|
|
2337
|
+
};
|
|
2338
|
+
}
|
|
1739
2339
|
setStyle() {
|
|
1740
|
-
Object.assign(this.containerRef.current.style, this.
|
|
2340
|
+
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
|
|
1741
2341
|
}
|
|
1742
2342
|
componentDidMount() {
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1745
|
-
const i =
|
|
1746
|
-
|
|
2343
|
+
const t = localStorage.getItem(I.MINIMIZE_STYLY_CHCHE);
|
|
2344
|
+
t && (this.minimizeData = JSON.parse(t));
|
|
2345
|
+
const i = localStorage.getItem(I.STYLE_CACHE);
|
|
2346
|
+
i && (this.data = JSON.parse(i), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
|
|
2347
|
+
const s = this.data;
|
|
2348
|
+
this.minimizeRef.current.onmousedown = (r) => {
|
|
2349
|
+
document.body.style.userSelect = "none";
|
|
2350
|
+
const o = r.clientX - this.minimizeRef.current.offsetLeft, c = r.clientY - this.minimizeRef.current.offsetTop, l = Date.now(), f = (a) => {
|
|
2351
|
+
this.minimizeData.x = a.clientX - o, this.minimizeData.y = a.clientY - c, this.setStyle();
|
|
2352
|
+
}, h = () => {
|
|
2353
|
+
const a = Date.now();
|
|
2354
|
+
this.isDragging = a - l > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h);
|
|
2355
|
+
};
|
|
2356
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", h);
|
|
2357
|
+
}, this.dragHandle.current.onmousedown = (r) => {
|
|
2358
|
+
if (this.disabled || this.state.isFullScreen)
|
|
2359
|
+
return;
|
|
2360
|
+
document.body.style.userSelect = "none";
|
|
2361
|
+
const o = r.clientX - this.containerRef.current.offsetLeft, c = r.clientY - this.containerRef.current.offsetTop, l = (h) => {
|
|
2362
|
+
s.x = h.clientX - o, s.y = h.clientY - c, this.setStyle();
|
|
2363
|
+
}, f = () => {
|
|
2364
|
+
document.body.style.userSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", f);
|
|
2365
|
+
};
|
|
2366
|
+
document.addEventListener("mousemove", l), document.addEventListener("mouseup", f);
|
|
2367
|
+
}, Ae(this.containerRef.current).resizable({
|
|
1747
2368
|
// 可拖拽的边缘
|
|
1748
2369
|
edges: {
|
|
1749
|
-
top: !
|
|
2370
|
+
top: !0,
|
|
1750
2371
|
right: !0,
|
|
1751
|
-
bottom: !
|
|
2372
|
+
bottom: !0,
|
|
1752
2373
|
left: !0
|
|
1753
2374
|
},
|
|
1754
2375
|
margin: 6,
|
|
1755
2376
|
modifiers: [
|
|
1756
2377
|
// 保持在父对象内部
|
|
1757
|
-
|
|
2378
|
+
Ae.modifiers.restrictEdges({
|
|
1758
2379
|
outer: document.body
|
|
1759
2380
|
}),
|
|
1760
2381
|
// 缩放最小宽度
|
|
1761
|
-
|
|
2382
|
+
Ae.modifiers.restrictSize({
|
|
1762
2383
|
min: {
|
|
1763
|
-
width:
|
|
1764
|
-
height:
|
|
2384
|
+
width: s.minWidth,
|
|
2385
|
+
height: s.minHeight
|
|
1765
2386
|
}
|
|
1766
2387
|
})
|
|
1767
2388
|
],
|
|
1768
2389
|
inertia: !0,
|
|
1769
2390
|
listeners: {
|
|
1770
|
-
move: (
|
|
1771
|
-
|
|
2391
|
+
move: (r) => {
|
|
2392
|
+
this.state.isFullScreen || (s.x = r.rect.left, s.y = r.rect.top, s.width = r.rect.width, s.height = r.rect.height, this.setStyle());
|
|
2393
|
+
},
|
|
2394
|
+
start: () => {
|
|
2395
|
+
this.disabled = !0, document.body.style.userSelect = "none";
|
|
2396
|
+
},
|
|
2397
|
+
end: () => {
|
|
2398
|
+
this.disabled = !1, document.body.style.userSelect = "";
|
|
1772
2399
|
}
|
|
1773
2400
|
}
|
|
1774
2401
|
});
|
|
1775
2402
|
}
|
|
1776
2403
|
componentWillUnmount() {
|
|
1777
|
-
localStorage.setItem(
|
|
2404
|
+
localStorage.setItem(I.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(I.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
|
|
1778
2405
|
}
|
|
1779
2406
|
/**
|
|
1780
2407
|
* 关闭聊天窗口
|
|
@@ -1792,8 +2419,8 @@ class zn extends M {
|
|
|
1792
2419
|
* @date 2024-05-07 15:10:31
|
|
1793
2420
|
*/
|
|
1794
2421
|
fullScreen() {
|
|
1795
|
-
const
|
|
1796
|
-
|
|
2422
|
+
const t = this.containerRef.current;
|
|
2423
|
+
t && (t.requestFullscreen(), this.setState({
|
|
1797
2424
|
isFullScreen: !0
|
|
1798
2425
|
}), this.props.fullscreen(!0));
|
|
1799
2426
|
}
|
|
@@ -1806,49 +2433,137 @@ class zn extends M {
|
|
|
1806
2433
|
closeFullScreen() {
|
|
1807
2434
|
this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
|
|
1808
2435
|
isFullScreen: !1
|
|
1809
|
-
}), this.props.fullscreen(!1));
|
|
2436
|
+
}), this.props.fullscreen(!1), this.setStyle());
|
|
2437
|
+
}
|
|
2438
|
+
/**
|
|
2439
|
+
* 最小化
|
|
2440
|
+
*
|
|
2441
|
+
* @memberof ChatContainer
|
|
2442
|
+
*/
|
|
2443
|
+
minimize() {
|
|
2444
|
+
this.closeFullScreen(), this.setState({
|
|
2445
|
+
isMinimize: !0
|
|
2446
|
+
}), this.props.minimize(!0);
|
|
2447
|
+
}
|
|
2448
|
+
/**
|
|
2449
|
+
* 退出最小化
|
|
2450
|
+
*
|
|
2451
|
+
* @memberof ChatContainer
|
|
2452
|
+
*/
|
|
2453
|
+
exitMinimize() {
|
|
2454
|
+
this.isDragging || (this.setState({
|
|
2455
|
+
isMinimize: !1
|
|
2456
|
+
}), this.props.minimize(!1));
|
|
2457
|
+
}
|
|
2458
|
+
/**
|
|
2459
|
+
* 阻止冒泡
|
|
2460
|
+
* - 防止点击头部行为时误触发拖动监听
|
|
2461
|
+
* @param {MouseEvent} evt
|
|
2462
|
+
* @memberof ChatContainer
|
|
2463
|
+
*/
|
|
2464
|
+
stopPropagation(t) {
|
|
2465
|
+
t.stopPropagation();
|
|
1810
2466
|
}
|
|
1811
2467
|
render() {
|
|
1812
2468
|
return u("div", {
|
|
1813
|
-
className: "
|
|
1814
|
-
ref: this.containerRef,
|
|
2469
|
+
className: "".concat(this.ns.b()),
|
|
1815
2470
|
children: [u("div", {
|
|
1816
|
-
|
|
1817
|
-
|
|
2471
|
+
className: "".concat(this.ns.e("dialog"), " ").concat(this.ns.is("full-screen", this.state.isFullScreen), " ").concat(this.ns.is("hidden", this.state.isMinimize)),
|
|
2472
|
+
ref: this.containerRef,
|
|
1818
2473
|
children: [u("div", {
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
|
|
1825
|
-
onClick: this.closeFullScreen.bind(this),
|
|
1826
|
-
children: u(ln, {})
|
|
1827
|
-
}) : u("div", {
|
|
1828
|
-
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
|
|
1829
|
-
onClick: this.fullScreen.bind(this),
|
|
1830
|
-
children: u(an, {})
|
|
2474
|
+
ref: this.dragHandle,
|
|
2475
|
+
className: this.ns.b("header"),
|
|
2476
|
+
children: [u("div", {
|
|
2477
|
+
className: this.ns.b("header-caption"),
|
|
2478
|
+
children: this.props.caption || "AI助手"
|
|
1831
2479
|
}), u("div", {
|
|
1832
|
-
className:
|
|
1833
|
-
|
|
1834
|
-
|
|
2480
|
+
className: this.ns.b("header-action-wrapper"),
|
|
2481
|
+
children: [u("div", {
|
|
2482
|
+
title: "最小化",
|
|
2483
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "minimize")),
|
|
2484
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2485
|
+
onClick: this.minimize.bind(this),
|
|
2486
|
+
children: u(Nn, {})
|
|
2487
|
+
}), this.state.isFullScreen ? u("div", {
|
|
2488
|
+
title: "退出全屏",
|
|
2489
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
|
|
2490
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2491
|
+
onClick: this.closeFullScreen.bind(this),
|
|
2492
|
+
children: u(xn, {})
|
|
2493
|
+
}) : u("div", {
|
|
2494
|
+
title: "全屏",
|
|
2495
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
|
|
2496
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2497
|
+
onClick: this.fullScreen.bind(this),
|
|
2498
|
+
children: u(kn, {})
|
|
2499
|
+
}), u("div", {
|
|
2500
|
+
title: "关闭",
|
|
2501
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
|
|
2502
|
+
onMouseDown: this.stopPropagation.bind(this),
|
|
2503
|
+
onClick: this.close.bind(this),
|
|
2504
|
+
children: u(Cn, {})
|
|
2505
|
+
})]
|
|
2506
|
+
})]
|
|
2507
|
+
}), this.props.mode === "TOPIC" ? u("div", {
|
|
2508
|
+
className: "".concat(this.ns.b("main")),
|
|
2509
|
+
children: [u("div", {
|
|
2510
|
+
className: "".concat(this.ns.be("main", "left")),
|
|
2511
|
+
children: u(ii, {
|
|
2512
|
+
controller: this.props.aiTopic
|
|
2513
|
+
})
|
|
2514
|
+
}), u("div", {
|
|
2515
|
+
className: "".concat(this.ns.be("main", "right")),
|
|
2516
|
+
children: [u("div", {
|
|
2517
|
+
className: this.ns.b("content"),
|
|
2518
|
+
children: u(lt, {
|
|
2519
|
+
controller: this.props.aiChat,
|
|
2520
|
+
toolbarItems: this.props.contentToolbarItems
|
|
2521
|
+
})
|
|
2522
|
+
}), u(Ue, {
|
|
2523
|
+
data: {},
|
|
2524
|
+
type: "footer",
|
|
2525
|
+
className: this.ns.e("toolbar"),
|
|
2526
|
+
controller: this.props.aiChat,
|
|
2527
|
+
items: this.props.footerToolbarItems
|
|
2528
|
+
}), u("div", {
|
|
2529
|
+
className: this.ns.b("footer"),
|
|
2530
|
+
children: u(wt, {
|
|
2531
|
+
controller: this.props.aiChat
|
|
2532
|
+
})
|
|
2533
|
+
})]
|
|
2534
|
+
})]
|
|
2535
|
+
}) : u("div", {
|
|
2536
|
+
className: "".concat(this.ns.be("main", "default")),
|
|
2537
|
+
children: [u("div", {
|
|
2538
|
+
className: this.ns.b("content"),
|
|
2539
|
+
children: u(lt, {
|
|
2540
|
+
controller: this.props.aiChat,
|
|
2541
|
+
toolbarItems: this.props.contentToolbarItems
|
|
2542
|
+
})
|
|
2543
|
+
}), u(Ue, {
|
|
2544
|
+
data: {},
|
|
2545
|
+
type: "footer",
|
|
2546
|
+
className: this.ns.e("toolbar"),
|
|
2547
|
+
controller: this.props.aiChat,
|
|
2548
|
+
items: this.props.footerToolbarItems
|
|
2549
|
+
}), u("div", {
|
|
2550
|
+
className: this.ns.b("footer"),
|
|
2551
|
+
children: u(wt, {
|
|
2552
|
+
controller: this.props.aiChat
|
|
2553
|
+
})
|
|
1835
2554
|
})]
|
|
1836
2555
|
})]
|
|
1837
2556
|
}), u("div", {
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
className: this.ns.b("footer"),
|
|
1844
|
-
children: u(Hn, {
|
|
1845
|
-
controller: this.props.controller
|
|
1846
|
-
})
|
|
2557
|
+
title: "AI助手",
|
|
2558
|
+
ref: this.minimizeRef,
|
|
2559
|
+
className: "".concat(this.ns.e("minimize"), " ").concat(this.ns.is("hidden", !this.state.isMinimize)),
|
|
2560
|
+
onClick: this.exitMinimize.bind(this),
|
|
2561
|
+
children: u(An, {})
|
|
1847
2562
|
})]
|
|
1848
2563
|
});
|
|
1849
2564
|
}
|
|
1850
2565
|
}
|
|
1851
|
-
class
|
|
2566
|
+
class He {
|
|
1852
2567
|
constructor(e) {
|
|
1853
2568
|
this.msg = e;
|
|
1854
2569
|
}
|
|
@@ -1881,7 +2596,30 @@ class xe {
|
|
|
1881
2596
|
e.content || (e.content = ""), this.msg.content += e.content;
|
|
1882
2597
|
}
|
|
1883
2598
|
}
|
|
1884
|
-
class
|
|
2599
|
+
class ve {
|
|
2600
|
+
constructor(e) {
|
|
2601
|
+
this.data = e;
|
|
2602
|
+
}
|
|
2603
|
+
get appid() {
|
|
2604
|
+
return this.data.appid;
|
|
2605
|
+
}
|
|
2606
|
+
get id() {
|
|
2607
|
+
return this.data.id;
|
|
2608
|
+
}
|
|
2609
|
+
get type() {
|
|
2610
|
+
return this.data.type;
|
|
2611
|
+
}
|
|
2612
|
+
get caption() {
|
|
2613
|
+
return this.data.caption;
|
|
2614
|
+
}
|
|
2615
|
+
get url() {
|
|
2616
|
+
return this.data.url;
|
|
2617
|
+
}
|
|
2618
|
+
get aiChat() {
|
|
2619
|
+
return this.data.aiChat;
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
class St {
|
|
1885
2623
|
/**
|
|
1886
2624
|
* Creates an instance of AiChatController.
|
|
1887
2625
|
*
|
|
@@ -1897,7 +2635,7 @@ class Pn {
|
|
|
1897
2635
|
* @date 2023-10-16 16:10:29
|
|
1898
2636
|
* @type {Signal<ChatMessage[]>}
|
|
1899
2637
|
*/
|
|
1900
|
-
|
|
2638
|
+
y(this, "messages", Q([]));
|
|
1901
2639
|
/**
|
|
1902
2640
|
* 聊天框输入值
|
|
1903
2641
|
*
|
|
@@ -1905,8 +2643,69 @@ class Pn {
|
|
|
1905
2643
|
* @date 2023-10-16 15:10:43
|
|
1906
2644
|
* @type {Signal<string>}
|
|
1907
2645
|
*/
|
|
1908
|
-
|
|
1909
|
-
|
|
2646
|
+
y(this, "input", Q(""));
|
|
2647
|
+
/**
|
|
2648
|
+
* 视图参数
|
|
2649
|
+
*
|
|
2650
|
+
* @author tony001
|
|
2651
|
+
* @date 2025-02-24 14:02:23
|
|
2652
|
+
* @type {object}
|
|
2653
|
+
*/
|
|
2654
|
+
y(this, "context");
|
|
2655
|
+
/**
|
|
2656
|
+
* 视图参数
|
|
2657
|
+
*
|
|
2658
|
+
* @author tony001
|
|
2659
|
+
* @date 2025-02-24 14:02:32
|
|
2660
|
+
* @type {object}
|
|
2661
|
+
*/
|
|
2662
|
+
y(this, "params");
|
|
2663
|
+
/**
|
|
2664
|
+
* 应用实体标记
|
|
2665
|
+
*
|
|
2666
|
+
* @author tony001
|
|
2667
|
+
* @date 2025-02-24 14:02:10
|
|
2668
|
+
* @type {string}
|
|
2669
|
+
*/
|
|
2670
|
+
y(this, "appDataEntityId");
|
|
2671
|
+
/**
|
|
2672
|
+
* 话题标识
|
|
2673
|
+
*
|
|
2674
|
+
* @author tony001
|
|
2675
|
+
* @date 2025-02-24 18:02:02
|
|
2676
|
+
* @type {(string | undefined)}
|
|
2677
|
+
*/
|
|
2678
|
+
y(this, "topicId");
|
|
2679
|
+
this.opts = e, this.context = e.context, this.params = e.params, this.appDataEntityId = e.appDataEntityId, this.topicId = e.topicId, this.fecthHistory();
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* 获取历史记录
|
|
2683
|
+
*
|
|
2684
|
+
* @author tony001
|
|
2685
|
+
* @date 2025-02-24 13:02:52
|
|
2686
|
+
* @return {*} {Promise<boolean>}
|
|
2687
|
+
*/
|
|
2688
|
+
async fecthHistory() {
|
|
2689
|
+
return this.opts.history(this.context, this.params, {
|
|
2690
|
+
appDataEntityId: this.appDataEntityId
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* 更新数据到indexdb
|
|
2695
|
+
*
|
|
2696
|
+
* @author tony001
|
|
2697
|
+
* @date 2025-02-24 18:02:41
|
|
2698
|
+
* @return {*} {Promise<void>}
|
|
2699
|
+
*/
|
|
2700
|
+
async asyncToIndexDB(e) {
|
|
2701
|
+
if (!this.topicId)
|
|
2702
|
+
return;
|
|
2703
|
+
const t = {
|
|
2704
|
+
id: this.topicId,
|
|
2705
|
+
data: this.messages.value.map((s) => s._origin),
|
|
2706
|
+
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
2707
|
+
};
|
|
2708
|
+
await ae[e === "ADD" ? "addData" : "updateData"](I.DATA_BASE_NAME, I.DATA_TABLE_NAME, t);
|
|
1910
2709
|
}
|
|
1911
2710
|
/**
|
|
1912
2711
|
* 设置聊天框值
|
|
@@ -1926,8 +2725,8 @@ class Pn {
|
|
|
1926
2725
|
* @param {IMessage} data
|
|
1927
2726
|
*/
|
|
1928
2727
|
addMessage(e) {
|
|
1929
|
-
const
|
|
1930
|
-
|
|
2728
|
+
const t = this.messages.value.find((i) => i.messageid === e.messageid);
|
|
2729
|
+
t ? (t.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new He(e)];
|
|
1931
2730
|
}
|
|
1932
2731
|
/**
|
|
1933
2732
|
* 替换已经存在的聊天消息
|
|
@@ -1937,8 +2736,8 @@ class Pn {
|
|
|
1937
2736
|
* @param {IChatMessage} data
|
|
1938
2737
|
*/
|
|
1939
2738
|
replaceMessage(e) {
|
|
1940
|
-
const
|
|
1941
|
-
|
|
2739
|
+
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2740
|
+
t !== -1 ? (this.messages.value[t] = new He(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new He(e)];
|
|
1942
2741
|
}
|
|
1943
2742
|
/**
|
|
1944
2743
|
* 提问
|
|
@@ -1950,11 +2749,13 @@ class Pn {
|
|
|
1950
2749
|
async question(e) {
|
|
1951
2750
|
this.addMessage({
|
|
1952
2751
|
state: 30,
|
|
1953
|
-
messageid:
|
|
2752
|
+
messageid: zt(),
|
|
1954
2753
|
role: "USER",
|
|
1955
2754
|
type: "DEFAULT",
|
|
1956
2755
|
content: e
|
|
1957
|
-
}), await this.opts.question(this.
|
|
2756
|
+
}), await this.opts.question(this.context, this.params, {
|
|
2757
|
+
appDataEntityId: this.appDataEntityId
|
|
2758
|
+
}, this.messages.value.filter((t) => t.type !== "ERROR").map((t) => t._origin)), this.opts.action && this.opts.action("question", e);
|
|
1958
2759
|
}
|
|
1959
2760
|
/**
|
|
1960
2761
|
* 回填选中的消息
|
|
@@ -1974,20 +2775,24 @@ class Pn {
|
|
|
1974
2775
|
* @memberof AiChatController
|
|
1975
2776
|
*/
|
|
1976
2777
|
deleteMessage(e) {
|
|
1977
|
-
const
|
|
1978
|
-
|
|
2778
|
+
const t = this.messages.value.findIndex((i) => i.messageid === e.messageid);
|
|
2779
|
+
t !== -1 && (this.messages.value.splice(t, 1), this.messages.value = [...this.messages.value]), this.opts.action && this.opts.action("deletemsg", e);
|
|
1979
2780
|
}
|
|
1980
2781
|
/**
|
|
1981
2782
|
* 刷新当前消息
|
|
1982
2783
|
*
|
|
1983
2784
|
* @memberof AiChatController
|
|
1984
2785
|
*/
|
|
1985
|
-
async refreshMessage(e,
|
|
2786
|
+
async refreshMessage(e, t = !1) {
|
|
1986
2787
|
const i = this.messages.value.findIndex((s) => s.messageid === e.messageid);
|
|
1987
|
-
if (
|
|
1988
|
-
this.messages.value.splice(i + 1, this.messages.value.length - i - 1), this.messages.value = [...this.messages.value], await this.opts.question(this.
|
|
2788
|
+
if (t)
|
|
2789
|
+
this.messages.value.splice(i + 1, this.messages.value.length - i - 1), this.messages.value = [...this.messages.value], await this.opts.question(this.context, this.params, {
|
|
2790
|
+
appDataEntityId: this.appDataEntityId
|
|
2791
|
+
}, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
|
|
1989
2792
|
else if (i === this.messages.value.length - 1)
|
|
1990
|
-
this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(this.
|
|
2793
|
+
this.messages.value.pop(), this.messages.value = [...this.messages.value], await this.opts.question(this.context, this.params, {
|
|
2794
|
+
appDataEntityId: this.appDataEntityId
|
|
2795
|
+
}, this.messages.value.filter((s) => s.type !== "ERROR").map((s) => s._origin));
|
|
1991
2796
|
else {
|
|
1992
2797
|
const s = this.messages.value[i - 1].content;
|
|
1993
2798
|
this.messages.value.splice(i - 1, 2), this.question(s);
|
|
@@ -2001,11 +2806,148 @@ class Pn {
|
|
|
2001
2806
|
* @memberof AiChatController
|
|
2002
2807
|
*/
|
|
2003
2808
|
copyMessage(e) {
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2809
|
+
const t = e.content;
|
|
2810
|
+
Ht.copy(t), this.opts.action && this.opts.action("copymsg", e);
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
class si {
|
|
2814
|
+
/**
|
|
2815
|
+
* Creates an instance of AiTopicController.
|
|
2816
|
+
* @author tony001
|
|
2817
|
+
* @date 2025-02-24 11:02:26
|
|
2818
|
+
* @param {ChatController} chat
|
|
2819
|
+
*/
|
|
2820
|
+
constructor(e) {
|
|
2821
|
+
/**
|
|
2822
|
+
* 话题清单
|
|
2823
|
+
*
|
|
2824
|
+
* @author tony001
|
|
2825
|
+
* @date 2025-02-20 16:02:38
|
|
2826
|
+
* @type {Signal<ChatTopic[]>}
|
|
2827
|
+
*/
|
|
2828
|
+
y(this, "topics", Q([]));
|
|
2829
|
+
/**
|
|
2830
|
+
* 激活话题
|
|
2831
|
+
*
|
|
2832
|
+
* @author tony001
|
|
2833
|
+
* @date 2025-02-24 16:02:44
|
|
2834
|
+
* @type {(Signal<ITopic | null>)}
|
|
2835
|
+
*/
|
|
2836
|
+
y(this, "activedTopic", Q(null));
|
|
2837
|
+
/**
|
|
2838
|
+
* 当前话题配置备份
|
|
2839
|
+
*
|
|
2840
|
+
* @author tony001
|
|
2841
|
+
* @date 2025-02-24 16:02:28
|
|
2842
|
+
* @public
|
|
2843
|
+
* @type {(ITopicOptions | undefined)}
|
|
2844
|
+
*/
|
|
2845
|
+
y(this, "currentTopicOptions");
|
|
2846
|
+
this.chat = e;
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* 获取历史话题
|
|
2850
|
+
*
|
|
2851
|
+
* @author tony001
|
|
2852
|
+
* @date 2025-02-23 16:02:37
|
|
2853
|
+
* @return {*} {Promise<void>}
|
|
2854
|
+
*/
|
|
2855
|
+
async fetchHistory(e) {
|
|
2856
|
+
const i = await e.configService(e.appid, "aitopics", e.type).load();
|
|
2857
|
+
i && i.length > 0 && i.forEach((s) => {
|
|
2858
|
+
this.topics.value = [...this.topics.value, new ve(s)];
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2861
|
+
/**
|
|
2862
|
+
* 更新当前话题
|
|
2863
|
+
*
|
|
2864
|
+
* @author tony001
|
|
2865
|
+
* @date 2025-02-23 17:02:43
|
|
2866
|
+
* @param {ITopicOptions} options
|
|
2867
|
+
* @return {*} {Promise<void>}
|
|
2868
|
+
*/
|
|
2869
|
+
async updateCurrentTopic(e) {
|
|
2870
|
+
this.currentTopicOptions = e;
|
|
2871
|
+
const t = this.topics.value.findIndex((o) => o.id === e.id), i = new ve(e);
|
|
2872
|
+
t !== -1 ? this.topics.value.splice(t, 1, new ve(e)) : this.topics.value = [...this.topics.value, new ve(e)];
|
|
2873
|
+
const s = this.topics.value.map((o) => ({
|
|
2874
|
+
appid: o.appid,
|
|
2875
|
+
id: o.id,
|
|
2876
|
+
type: o.type,
|
|
2877
|
+
caption: o.caption,
|
|
2878
|
+
url: o.url,
|
|
2879
|
+
aiChat: o.aiChat
|
|
2880
|
+
})), r = e.configService(e.appid, "aitopics", e.type);
|
|
2881
|
+
await (r == null ? void 0 : r.save(s)), this.activedTopic.value = i;
|
|
2882
|
+
}
|
|
2883
|
+
/**
|
|
2884
|
+
* 删除话题
|
|
2885
|
+
*
|
|
2886
|
+
* @author tony001
|
|
2887
|
+
* @date 2025-02-24 16:02:03
|
|
2888
|
+
* @param {ITopicOptions} options
|
|
2889
|
+
* @param {object} context
|
|
2890
|
+
* @param {object} params
|
|
2891
|
+
* @param {ITopic} data
|
|
2892
|
+
* @param {MouseEvent} event
|
|
2893
|
+
* @return {*} {Promise<void>}
|
|
2894
|
+
*/
|
|
2895
|
+
async removeTopic(e, t, i, s, r) {
|
|
2896
|
+
var h;
|
|
2897
|
+
let o = !0;
|
|
2898
|
+
if (e.beforeDelete && (o = await e.beforeDelete(t, i, s, r)), !o)
|
|
2899
|
+
return;
|
|
2900
|
+
const c = this.topics.value.findIndex((a) => a.id === s.id);
|
|
2901
|
+
c !== -1 && (this.topics.value.splice(c, 1), this.topics.value = [...this.topics.value]);
|
|
2902
|
+
const l = this.topics.value.map((a) => ({
|
|
2903
|
+
appid: a.appid,
|
|
2904
|
+
id: a.id,
|
|
2905
|
+
type: a.type,
|
|
2906
|
+
caption: a.caption,
|
|
2907
|
+
url: a.url,
|
|
2908
|
+
aiChat: a.aiChat
|
|
2909
|
+
})), f = e.configService(e.appid, "aitopics", e.type);
|
|
2910
|
+
await (f == null ? void 0 : f.save(l)), this.topics.value.length > 0 && s.id === ((h = this.activedTopic.value) == null ? void 0 : h.id) && this.handleTopicChange(this.topics.value[0]);
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2913
|
+
* 处理选中变化
|
|
2914
|
+
*
|
|
2915
|
+
* @author tony001
|
|
2916
|
+
* @date 2025-02-20 19:02:27
|
|
2917
|
+
* @param {ChatTopic} item
|
|
2918
|
+
*/
|
|
2919
|
+
handleTopicChange(e) {
|
|
2920
|
+
var t;
|
|
2921
|
+
((t = this.activedTopic.value) == null ? void 0 : t.id) !== e.id && (this.activedTopic.value = e, this.chat.switchAiChatController(e));
|
|
2922
|
+
}
|
|
2923
|
+
/**
|
|
2924
|
+
* 处理话题行为
|
|
2925
|
+
*
|
|
2926
|
+
* @author tony001
|
|
2927
|
+
* @date 2025-02-24 16:02:58
|
|
2928
|
+
* @param {string} action
|
|
2929
|
+
* @param {ChatTopic} topic
|
|
2930
|
+
* @param {MouseEvent} event
|
|
2931
|
+
* @return {*} {Promise<void>}
|
|
2932
|
+
*/
|
|
2933
|
+
async handleTopicAction(e, t, i) {
|
|
2934
|
+
var r, o;
|
|
2935
|
+
const s = this.topics.value.find((c) => c.id === t.id);
|
|
2936
|
+
if (this.currentTopicOptions && s && s.aiChat) {
|
|
2937
|
+
const {
|
|
2938
|
+
context: c,
|
|
2939
|
+
params: l
|
|
2940
|
+
} = s.aiChat;
|
|
2941
|
+
e === "DELETE" && await this.removeTopic(this.currentTopicOptions, c, l, s, i), (o = (r = this.currentTopicOptions).action) == null || o.call(r, e, c, l, t, i);
|
|
2942
|
+
}
|
|
2006
2943
|
}
|
|
2007
2944
|
}
|
|
2008
|
-
class
|
|
2945
|
+
class ri {
|
|
2946
|
+
/**
|
|
2947
|
+
* Creates an instance of ChatController.
|
|
2948
|
+
* @author tony001
|
|
2949
|
+
* @date 2025-02-24 11:02:20
|
|
2950
|
+
*/
|
|
2009
2951
|
constructor() {
|
|
2010
2952
|
/**
|
|
2011
2953
|
* 聊天框容器
|
|
@@ -2015,27 +2957,142 @@ class Rn {
|
|
|
2015
2957
|
* @protected
|
|
2016
2958
|
* @type {HTMLDivElement}
|
|
2017
2959
|
*/
|
|
2018
|
-
|
|
2960
|
+
y(this, "container");
|
|
2961
|
+
/**
|
|
2962
|
+
* 默认模式(聊天框)和话题模式(支持多话题切换),聊天框为默认模式
|
|
2963
|
+
*
|
|
2964
|
+
* @author tony001
|
|
2965
|
+
* @date 2025-02-20 16:02:50
|
|
2966
|
+
* @protected
|
|
2967
|
+
* @type {('DEFAULT' | 'TOPIC')}
|
|
2968
|
+
*/
|
|
2969
|
+
y(this, "mode", "DEFAULT");
|
|
2970
|
+
/**
|
|
2971
|
+
* 是否挂载ai话题
|
|
2972
|
+
*
|
|
2973
|
+
* @author tony001
|
|
2974
|
+
* @date 2025-02-23 16:02:54
|
|
2975
|
+
* @protected
|
|
2976
|
+
* @type {boolean}
|
|
2977
|
+
*/
|
|
2978
|
+
y(this, "isMountedAiTopic", !1);
|
|
2979
|
+
/**
|
|
2980
|
+
* 容器配置备份
|
|
2981
|
+
*
|
|
2982
|
+
* @author tony001
|
|
2983
|
+
* @date 2025-02-24 11:02:49
|
|
2984
|
+
* @protected
|
|
2985
|
+
* @type {(IContainerOptions | undefined)}
|
|
2986
|
+
*/
|
|
2987
|
+
y(this, "backupChatOptions");
|
|
2988
|
+
/**
|
|
2989
|
+
* 话题控制器
|
|
2990
|
+
*
|
|
2991
|
+
* @author tony001
|
|
2992
|
+
* @date 2025-02-23 16:02:56
|
|
2993
|
+
* @public
|
|
2994
|
+
* @type {AiTopicController}
|
|
2995
|
+
*/
|
|
2996
|
+
y(this, "aiTopic");
|
|
2997
|
+
/**
|
|
2998
|
+
* 聊天控制器
|
|
2999
|
+
*
|
|
3000
|
+
* @author tony001
|
|
3001
|
+
* @date 2025-02-23 16:02:09
|
|
3002
|
+
* @public
|
|
3003
|
+
* @type {(AiChatController | undefined)}
|
|
3004
|
+
*/
|
|
3005
|
+
y(this, "aiChat");
|
|
3006
|
+
this.aiTopic = new si(this);
|
|
3007
|
+
}
|
|
3008
|
+
/**
|
|
3009
|
+
* 初始化IndexDB
|
|
3010
|
+
*
|
|
3011
|
+
* @author tony001
|
|
3012
|
+
* @date 2025-02-24 18:02:50
|
|
3013
|
+
* @return {*} {Promise<void>}
|
|
3014
|
+
*/
|
|
3015
|
+
async initIndexDB() {
|
|
3016
|
+
await ae.checkTableExists(I.DATA_BASE_NAME, I.DATA_TABLE_NAME) || await ae.createTable(I.DATA_BASE_NAME, I.DATA_TABLE_NAME, I.DATA_TABLE_KEY_NAME, !1);
|
|
2019
3017
|
}
|
|
2020
3018
|
/**
|
|
2021
3019
|
* 创建聊天窗口(会同时显示出来)
|
|
2022
3020
|
*
|
|
2023
|
-
* @author
|
|
2024
|
-
* @date
|
|
3021
|
+
* @author tony001
|
|
3022
|
+
* @date 2025-02-24 12:02:58
|
|
3023
|
+
* @param {IContainerOptions} opts
|
|
3024
|
+
* @return {*} {Promise<AiChatController>}
|
|
3025
|
+
*/
|
|
3026
|
+
async create(e) {
|
|
3027
|
+
await this.initIndexDB(), this.backupChatOptions = e, this.close(), this.container = document.createElement("div"), this.container.classList.add("ibiz-ai-chat"), document.body.appendChild(this.container);
|
|
3028
|
+
const t = e.chatOptions;
|
|
3029
|
+
let i;
|
|
3030
|
+
return e.mode && e.mode === "TOPIC" && (this.isMountedAiTopic || (await this.aiTopic.fetchHistory(e.topicOptions), this.isMountedAiTopic = !0), i = e.topicOptions, Object.assign(i, {
|
|
3031
|
+
aiChat: {
|
|
3032
|
+
caption: t.caption,
|
|
3033
|
+
context: t.context,
|
|
3034
|
+
params: t.params,
|
|
3035
|
+
appDataEntityId: t.appDataEntityId,
|
|
3036
|
+
contentToolbarItems: t.contentToolbarItems,
|
|
3037
|
+
footerToolbarItems: t.footerToolbarItems
|
|
3038
|
+
}
|
|
3039
|
+
}), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
|
|
3040
|
+
topicId: i == null ? void 0 : i.id
|
|
3041
|
+
}), this.aiChat = new St(t), Z(H(Ct, {
|
|
3042
|
+
aiTopic: this.aiTopic,
|
|
3043
|
+
aiChat: this.aiChat,
|
|
3044
|
+
mode: e.mode ? e.mode : "DEFAULT",
|
|
3045
|
+
caption: e.mode && e.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3046
|
+
contentToolbarItems: t.contentToolbarItems,
|
|
3047
|
+
footerToolbarItems: t.footerToolbarItems,
|
|
3048
|
+
close: () => {
|
|
3049
|
+
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3050
|
+
},
|
|
3051
|
+
fullscreen: (s) => {
|
|
3052
|
+
t.fullscreen && t.fullscreen(s, t.context, t.params);
|
|
3053
|
+
},
|
|
3054
|
+
minimize: (s) => {
|
|
3055
|
+
t.minimize && t.minimize(s, t.context, t.params);
|
|
3056
|
+
}
|
|
3057
|
+
}), this.container), this.aiChat;
|
|
3058
|
+
}
|
|
3059
|
+
/**
|
|
3060
|
+
* 切换聊天控制器
|
|
3061
|
+
*
|
|
3062
|
+
* @author tony001
|
|
3063
|
+
* @date 2025-02-24 11:02:24
|
|
3064
|
+
* @param {ChatTopic} topic
|
|
2025
3065
|
*/
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
3066
|
+
switchAiChatController(e) {
|
|
3067
|
+
var i, s;
|
|
3068
|
+
const t = {
|
|
3069
|
+
...this.backupChatOptions.chatOptions
|
|
3070
|
+
};
|
|
3071
|
+
e.aiChat && Object.assign(t, {
|
|
3072
|
+
caption: e.aiChat.caption,
|
|
3073
|
+
context: e.aiChat.context,
|
|
3074
|
+
params: e.aiChat.params,
|
|
3075
|
+
contentToolbarItems: e.aiChat.contentToolbarItems,
|
|
3076
|
+
footerToolbarItems: e.aiChat.footerToolbarItems,
|
|
3077
|
+
appDataEntityId: e.aiChat.appDataEntityId,
|
|
3078
|
+
topicId: e.id
|
|
3079
|
+
}), this.aiChat = new St(t), this.container && (Z(null, this.container), Z(H(Ct, {
|
|
3080
|
+
aiTopic: this.aiTopic,
|
|
3081
|
+
aiChat: this.aiChat,
|
|
3082
|
+
mode: (i = this.backupChatOptions) != null && i.mode ? this.backupChatOptions.mode : "DEFAULT",
|
|
3083
|
+
caption: (s = this.backupChatOptions) != null && s.mode && this.backupChatOptions.mode === "TOPIC" ? "AI助手" : t.caption,
|
|
3084
|
+
contentToolbarItems: t.contentToolbarItems,
|
|
3085
|
+
footerToolbarItems: t.footerToolbarItems,
|
|
2032
3086
|
close: () => {
|
|
2033
|
-
this.close(),
|
|
3087
|
+
this.close(), t.closed && t.closed(t.context, t.params);
|
|
3088
|
+
},
|
|
3089
|
+
fullscreen: (r) => {
|
|
3090
|
+
t.fullscreen && t.fullscreen(r, t.context, t.params);
|
|
2034
3091
|
},
|
|
2035
|
-
|
|
2036
|
-
|
|
3092
|
+
minimize: (r) => {
|
|
3093
|
+
t.minimize && t.minimize(r, t.context, t.params);
|
|
2037
3094
|
}
|
|
2038
|
-
}), this.container)
|
|
3095
|
+
}), this.container));
|
|
2039
3096
|
}
|
|
2040
3097
|
/**
|
|
2041
3098
|
* 隐藏聊天窗口(必须先创建)
|
|
@@ -2062,11 +3119,11 @@ class Rn {
|
|
|
2062
3119
|
* @date 2023-10-13 17:10:10
|
|
2063
3120
|
*/
|
|
2064
3121
|
close() {
|
|
2065
|
-
this.container && (
|
|
3122
|
+
this.container && (Z(null, this.container), this.container.remove(), this.container = void 0);
|
|
2066
3123
|
}
|
|
2067
3124
|
}
|
|
2068
|
-
const
|
|
3125
|
+
const li = new ri();
|
|
2069
3126
|
export {
|
|
2070
|
-
|
|
2071
|
-
|
|
3127
|
+
Ct as ChatContainer,
|
|
3128
|
+
li as chat
|
|
2072
3129
|
};
|