@ibiz-template-plugin/ai-chat 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1008 -682
- 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 +28 -2
- package/dist/types/constants/index.d.ts +6 -0
- package/dist/types/controller/ai-chat/ai-chat.controller.d.ts +20 -0
- package/dist/types/icons/close-full-screen-svg.d.ts +1 -0
- package/dist/types/icons/close-svg.d.ts +1 -1
- package/dist/types/icons/copy-svg.d.ts +1 -0
- package/dist/types/icons/delete-svg.d.ts +1 -0
- package/dist/types/icons/full-screen-svg.d.ts +1 -0
- package/dist/types/icons/index.d.ts +6 -1
- package/dist/types/icons/refresh-svg.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/util/util.d.ts +20 -0
- package/package.json +25 -24
- package/dist/types/utils/namespace/namespace.d.ts +0 -147
package/dist/index.es.js
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import "path-browserify";
|
|
1
|
+
var Rt = Object.defineProperty;
|
|
2
|
+
var Ft = (t, e, n) => e in t ? Rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var H = (t, e, n) => (Ft(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import we from "interactjs";
|
|
6
5
|
import Ut from "cherry-markdown";
|
|
7
|
-
var
|
|
8
|
-
function
|
|
6
|
+
var ve, f, _t, ft, V, Re, ht, xe, W = {}, dt = [], Dt = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, pe = Array.isArray;
|
|
7
|
+
function R(t, e) {
|
|
9
8
|
for (var n in e)
|
|
10
9
|
t[n] = e[n];
|
|
11
10
|
return t;
|
|
12
11
|
}
|
|
13
|
-
function
|
|
12
|
+
function vt(t) {
|
|
14
13
|
var e = t.parentNode;
|
|
15
14
|
e && e.removeChild(t);
|
|
16
15
|
}
|
|
17
16
|
function Z(t, e, n) {
|
|
18
|
-
var
|
|
19
|
-
for (
|
|
20
|
-
|
|
21
|
-
if (arguments.length > 2 && (
|
|
22
|
-
for (
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
function
|
|
27
|
-
var
|
|
28
|
-
return o == null &&
|
|
29
|
-
}
|
|
30
|
-
function
|
|
17
|
+
var r, o, i, s = {};
|
|
18
|
+
for (i in e)
|
|
19
|
+
i == "key" ? r = e[i] : i == "ref" ? o = e[i] : s[i] = e[i];
|
|
20
|
+
if (arguments.length > 2 && (s.children = arguments.length > 3 ? ve.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null)
|
|
21
|
+
for (i in t.defaultProps)
|
|
22
|
+
s[i] === void 0 && (s[i] = t.defaultProps[i]);
|
|
23
|
+
return ne(t, s, r, o, null);
|
|
24
|
+
}
|
|
25
|
+
function ne(t, e, n, r, o) {
|
|
26
|
+
var i = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: o == null ? ++_t : o };
|
|
27
|
+
return o == null && f.vnode != null && f.vnode(i), i;
|
|
28
|
+
}
|
|
29
|
+
function Fe() {
|
|
31
30
|
return { current: null };
|
|
32
31
|
}
|
|
33
32
|
function I(t) {
|
|
34
33
|
return t.children;
|
|
35
34
|
}
|
|
36
|
-
function
|
|
35
|
+
function A(t, e) {
|
|
37
36
|
this.props = t, this.context = e;
|
|
38
37
|
}
|
|
39
38
|
function G(t, e) {
|
|
@@ -44,7 +43,7 @@ function G(t, e) {
|
|
|
44
43
|
return n.__d || n.__e;
|
|
45
44
|
return typeof t.type == "function" ? G(t) : null;
|
|
46
45
|
}
|
|
47
|
-
function
|
|
46
|
+
function pt(t) {
|
|
48
47
|
var e, n;
|
|
49
48
|
if ((t = t.__) != null && t.__c != null) {
|
|
50
49
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++)
|
|
@@ -52,83 +51,83 @@ function ft(t) {
|
|
|
52
51
|
t.__e = t.__c.base = n.__e;
|
|
53
52
|
break;
|
|
54
53
|
}
|
|
55
|
-
return
|
|
54
|
+
return pt(t);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
function
|
|
59
|
-
(!t.__d && (t.__d = !0) &&
|
|
60
|
-
}
|
|
61
|
-
function
|
|
62
|
-
var t, e, n,
|
|
63
|
-
for (
|
|
64
|
-
t.__d && (e =
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
function
|
|
68
|
-
var
|
|
69
|
-
for (n.__k = [],
|
|
70
|
-
(u = n.__k[
|
|
71
|
-
for (n.__e =
|
|
72
|
-
$[
|
|
73
|
-
}
|
|
74
|
-
function
|
|
75
|
-
for (var
|
|
76
|
-
(
|
|
57
|
+
function Ue(t) {
|
|
58
|
+
(!t.__d && (t.__d = !0) && V.push(t) && !oe.__r++ || Re !== f.debounceRendering) && ((Re = f.debounceRendering) || ht)(oe);
|
|
59
|
+
}
|
|
60
|
+
function oe() {
|
|
61
|
+
var t, e, n, r, o, i, s, l, c;
|
|
62
|
+
for (V.sort(xe); t = V.shift(); )
|
|
63
|
+
t.__d && (e = V.length, r = void 0, o = void 0, i = void 0, l = (s = (n = t).__v).__e, (c = n.__P) && (r = [], o = [], (i = R({}, s)).__v = s.__v + 1, Me(c, s, i, n.__n, c.ownerSVGElement !== void 0, s.__h != null ? [l] : null, r, l == null ? G(s) : l, s.__h, o), bt(r, s, o), s.__e != l && pt(s)), V.length > e && V.sort(xe));
|
|
64
|
+
oe.__r = 0;
|
|
65
|
+
}
|
|
66
|
+
function gt(t, e, n, r, o, i, s, l, c, p, h) {
|
|
67
|
+
var a, g, d, u, v, z, m, b, S, w = 0, $ = r && r.__k || dt, P = $.length, x = P, T = e.length;
|
|
68
|
+
for (n.__k = [], a = 0; a < T; a++)
|
|
69
|
+
(u = n.__k[a] = (u = e[a]) == null || typeof u == "boolean" || typeof u == "function" ? null : typeof u == "string" || typeof u == "number" || typeof u == "bigint" ? ne(null, u, null, null, u) : pe(u) ? ne(I, { children: u }, null, null, null) : u.__b > 0 ? ne(u.type, u.props, u.key, u.ref ? u.ref : null, u.__v) : u) != null ? (u.__ = n, u.__b = n.__b + 1, (b = Vt(u, $, m = a + w, x)) === -1 ? d = W : (d = $[b] || W, $[b] = void 0, x--), Me(t, u, d, o, i, s, l, c, p, h), v = u.__e, (g = u.ref) && d.ref != g && (d.ref && ze(d.ref, null, u), h.push(g, u.__c || v, u)), v != null && (z == null && (z = v), (S = d === W || d.__v === null) ? b == -1 && w-- : b !== m && (b === m + 1 ? w++ : b > m ? x > T - m ? w += b - m : w-- : w = b < m && b == m - 1 ? b - m : 0), m = a + w, typeof u.type != "function" || b === m && d.__k !== u.__k ? typeof u.type == "function" || b === m && !S ? u.__d !== void 0 ? (c = u.__d, u.__d = void 0) : c = v.nextSibling : c = yt(t, v, c) : c = mt(u, c, t), typeof n.type == "function" && (n.__d = c))) : (d = $[a]) && d.key == null && d.__e && (d.__e == c && (d.__ = r, c = G(d)), Ee(d, d, !1), $[a] = null);
|
|
70
|
+
for (n.__e = z, a = P; a--; )
|
|
71
|
+
$[a] != null && (typeof n.type == "function" && $[a].__e != null && $[a].__e == n.__d && (n.__d = $[a].__e.nextSibling), Ee($[a], $[a]));
|
|
72
|
+
}
|
|
73
|
+
function mt(t, e, n) {
|
|
74
|
+
for (var r, o = t.__k, i = 0; o && i < o.length; i++)
|
|
75
|
+
(r = o[i]) && (r.__ = t, e = typeof r.type == "function" ? mt(r, e, n) : yt(n, r.__e, e));
|
|
77
76
|
return e;
|
|
78
77
|
}
|
|
79
|
-
function
|
|
78
|
+
function se(t, e) {
|
|
80
79
|
return e = e || [], t == null || typeof t == "boolean" || (pe(t) ? t.some(function(n) {
|
|
81
|
-
|
|
80
|
+
se(n, e);
|
|
82
81
|
}) : e.push(t)), e;
|
|
83
82
|
}
|
|
84
|
-
function
|
|
83
|
+
function yt(t, e, n) {
|
|
85
84
|
return n == null || n.parentNode !== t ? t.insertBefore(e, null) : e == n && e.parentNode != null || t.insertBefore(e, n), e.nextSibling;
|
|
86
85
|
}
|
|
87
|
-
function
|
|
88
|
-
var o = t.key,
|
|
89
|
-
if (
|
|
86
|
+
function Vt(t, e, n, r) {
|
|
87
|
+
var o = t.key, i = t.type, s = n - 1, l = n + 1, c = e[n];
|
|
88
|
+
if (c === null || c && o == c.key && i === c.type)
|
|
90
89
|
return n;
|
|
91
|
-
if (
|
|
92
|
-
for (;
|
|
93
|
-
if (
|
|
94
|
-
if ((
|
|
95
|
-
return
|
|
96
|
-
|
|
90
|
+
if (r > (c != null ? 1 : 0))
|
|
91
|
+
for (; s >= 0 || l < e.length; ) {
|
|
92
|
+
if (s >= 0) {
|
|
93
|
+
if ((c = e[s]) && o == c.key && i === c.type)
|
|
94
|
+
return s;
|
|
95
|
+
s--;
|
|
97
96
|
}
|
|
98
|
-
if (
|
|
99
|
-
if ((
|
|
100
|
-
return
|
|
101
|
-
|
|
97
|
+
if (l < e.length) {
|
|
98
|
+
if ((c = e[l]) && o == c.key && i === c.type)
|
|
99
|
+
return l;
|
|
100
|
+
l++;
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
return -1;
|
|
105
104
|
}
|
|
106
|
-
function
|
|
107
|
-
var
|
|
108
|
-
for (
|
|
109
|
-
|
|
110
|
-
for (
|
|
111
|
-
o && typeof e[
|
|
105
|
+
function Ot(t, e, n, r, o) {
|
|
106
|
+
var i;
|
|
107
|
+
for (i in n)
|
|
108
|
+
i === "children" || i === "key" || i in e || ae(t, i, null, n[i], r);
|
|
109
|
+
for (i in e)
|
|
110
|
+
o && typeof e[i] != "function" || i === "children" || i === "key" || i === "value" || i === "checked" || n[i] === e[i] || ae(t, i, e[i], n[i], r);
|
|
112
111
|
}
|
|
113
|
-
function
|
|
114
|
-
e[0] === "-" ? t.setProperty(e, n == null ? "" : n) : t[e] = n == null ? "" : typeof n != "number" ||
|
|
112
|
+
function De(t, e, n) {
|
|
113
|
+
e[0] === "-" ? t.setProperty(e, n == null ? "" : n) : t[e] = n == null ? "" : typeof n != "number" || Dt.test(e) ? n : n + "px";
|
|
115
114
|
}
|
|
116
|
-
function
|
|
117
|
-
var
|
|
115
|
+
function ae(t, e, n, r, o) {
|
|
116
|
+
var i;
|
|
118
117
|
e:
|
|
119
118
|
if (e === "style")
|
|
120
119
|
if (typeof n == "string")
|
|
121
120
|
t.style.cssText = n;
|
|
122
121
|
else {
|
|
123
|
-
if (typeof
|
|
124
|
-
for (e in
|
|
125
|
-
n && e in n ||
|
|
122
|
+
if (typeof r == "string" && (t.style.cssText = r = ""), r)
|
|
123
|
+
for (e in r)
|
|
124
|
+
n && e in n || De(t.style, e, "");
|
|
126
125
|
if (n)
|
|
127
126
|
for (e in n)
|
|
128
|
-
|
|
127
|
+
r && n[e] === r[e] || De(t.style, e, n[e]);
|
|
129
128
|
}
|
|
130
129
|
else if (e[0] === "o" && e[1] === "n")
|
|
131
|
-
|
|
130
|
+
i = e !== (e = e.replace(/(PointerCapture)$|Capture$/, "$1")), e = e.toLowerCase() in t ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + i] = n, n ? r ? n.u = r.u : (n.u = Date.now(), t.addEventListener(e, i ? Oe : Ve, i)) : t.removeEventListener(e, i ? Oe : Ve, i);
|
|
132
131
|
else if (e !== "dangerouslySetInnerHTML") {
|
|
133
132
|
if (o)
|
|
134
133
|
e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
@@ -136,163 +135,163 @@ function se(t, e, n, i, o) {
|
|
|
136
135
|
try {
|
|
137
136
|
t[e] = n == null ? "" : n;
|
|
138
137
|
break e;
|
|
139
|
-
} catch (
|
|
138
|
+
} catch (s) {
|
|
140
139
|
}
|
|
141
140
|
typeof n == "function" || (n == null || n === !1 && e[4] !== "-" ? t.removeAttribute(e) : t.setAttribute(e, n));
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
function
|
|
143
|
+
function Ve(t) {
|
|
145
144
|
var e = this.l[t.type + !1];
|
|
146
145
|
if (t.t) {
|
|
147
146
|
if (t.t <= e.u)
|
|
148
147
|
return;
|
|
149
148
|
} else
|
|
150
149
|
t.t = Date.now();
|
|
151
|
-
return e(
|
|
150
|
+
return e(f.event ? f.event(t) : t);
|
|
152
151
|
}
|
|
153
|
-
function
|
|
154
|
-
return this.l[t.type + !0](
|
|
152
|
+
function Oe(t) {
|
|
153
|
+
return this.l[t.type + !0](f.event ? f.event(t) : t);
|
|
155
154
|
}
|
|
156
|
-
function
|
|
157
|
-
var
|
|
155
|
+
function Me(t, e, n, r, o, i, s, l, c, p) {
|
|
156
|
+
var h, a, g, d, u, v, z, m, b, S, w, $, P, x, T, E = e.type;
|
|
158
157
|
if (e.constructor !== void 0)
|
|
159
158
|
return null;
|
|
160
|
-
n.__h != null && (
|
|
159
|
+
n.__h != null && (c = n.__h, l = e.__e = n.__e, e.__h = null, i = [l]), (h = f.__b) && h(e);
|
|
161
160
|
e:
|
|
162
161
|
if (typeof E == "function")
|
|
163
162
|
try {
|
|
164
|
-
if (m = e.props, b = (
|
|
165
|
-
E.getDerivedStateFromProps == null &&
|
|
163
|
+
if (m = e.props, b = (h = E.contextType) && r[h.__c], S = h ? b ? b.props.value : h.__ : r, n.__c ? z = (a = e.__c = n.__c).__ = a.__E : ("prototype" in E && E.prototype.render ? e.__c = a = new E(m, S) : (e.__c = a = new A(m, S), a.constructor = E, a.render = Bt), b && b.sub(a), a.props = m, a.state || (a.state = {}), a.context = S, a.__n = r, g = a.__d = !0, a.__h = [], a._sb = []), a.__s == null && (a.__s = a.state), E.getDerivedStateFromProps != null && (a.__s == a.state && (a.__s = R({}, a.__s)), R(a.__s, E.getDerivedStateFromProps(m, a.__s))), d = a.props, u = a.state, a.__v = e, g)
|
|
164
|
+
E.getDerivedStateFromProps == null && a.componentWillMount != null && a.componentWillMount(), a.componentDidMount != null && a.__h.push(a.componentDidMount);
|
|
166
165
|
else {
|
|
167
|
-
if (E.getDerivedStateFromProps == null && m !==
|
|
168
|
-
for (e.__v !== n.__v && (
|
|
169
|
-
|
|
170
|
-
}), w = 0; w <
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
if (E.getDerivedStateFromProps == null && m !== d && a.componentWillReceiveProps != null && a.componentWillReceiveProps(m, S), !a.__e && (a.shouldComponentUpdate != null && a.shouldComponentUpdate(m, a.__s, S) === !1 || e.__v === n.__v)) {
|
|
167
|
+
for (e.__v !== n.__v && (a.props = m, a.state = a.__s, a.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.forEach(function(ee) {
|
|
168
|
+
ee && (ee.__ = e);
|
|
169
|
+
}), w = 0; w < a._sb.length; w++)
|
|
170
|
+
a.__h.push(a._sb[w]);
|
|
171
|
+
a._sb = [], a.__h.length && s.push(a);
|
|
173
172
|
break e;
|
|
174
173
|
}
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
a.componentWillUpdate != null && a.componentWillUpdate(m, a.__s, S), a.componentDidUpdate != null && a.__h.push(function() {
|
|
175
|
+
a.componentDidUpdate(d, u, v);
|
|
177
176
|
});
|
|
178
177
|
}
|
|
179
|
-
if (
|
|
180
|
-
for (
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
if (a.context = S, a.props = m, a.__P = t, a.__e = !1, $ = f.__r, P = 0, "prototype" in E && E.prototype.render) {
|
|
179
|
+
for (a.state = a.__s, a.__d = !1, $ && $(e), h = a.render(a.props, a.state, a.context), x = 0; x < a._sb.length; x++)
|
|
180
|
+
a.__h.push(a._sb[x]);
|
|
181
|
+
a._sb = [];
|
|
183
182
|
} else
|
|
184
183
|
do
|
|
185
|
-
|
|
186
|
-
while (
|
|
187
|
-
|
|
188
|
-
} catch (
|
|
189
|
-
e.__v = null, (
|
|
184
|
+
a.__d = !1, $ && $(e), h = a.render(a.props, a.state, a.context), a.state = a.__s;
|
|
185
|
+
while (a.__d && ++P < 25);
|
|
186
|
+
a.state = a.__s, a.getChildContext != null && (r = R(R({}, r), a.getChildContext())), g || a.getSnapshotBeforeUpdate == null || (v = a.getSnapshotBeforeUpdate(d, u)), gt(t, pe(T = h != null && h.type === I && h.key == null ? h.props.children : h) ? T : [T], e, n, r, o, i, s, l, c, p), a.base = e.__e, e.__h = null, a.__h.length && s.push(a), z && (a.__E = a.__ = null);
|
|
187
|
+
} catch (ee) {
|
|
188
|
+
e.__v = null, (c || i != null) && (e.__e = l, e.__h = !!c, i[i.indexOf(l)] = null), f.__e(ee, e, n);
|
|
190
189
|
}
|
|
191
190
|
else
|
|
192
|
-
|
|
193
|
-
(
|
|
191
|
+
i == null && e.__v === n.__v ? (e.__k = n.__k, e.__e = n.__e) : e.__e = Wt(n.__e, e, n, r, o, i, s, c, p);
|
|
192
|
+
(h = f.diffed) && h(e);
|
|
194
193
|
}
|
|
195
|
-
function
|
|
196
|
-
for (var
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
function bt(t, e, n) {
|
|
195
|
+
for (var r = 0; r < n.length; r++)
|
|
196
|
+
ze(n[r], n[++r], n[++r]);
|
|
197
|
+
f.__c && f.__c(e, t), t.some(function(o) {
|
|
199
198
|
try {
|
|
200
|
-
t = o.__h, o.__h = [], t.some(function(
|
|
201
|
-
|
|
199
|
+
t = o.__h, o.__h = [], t.some(function(i) {
|
|
200
|
+
i.call(o);
|
|
202
201
|
});
|
|
203
|
-
} catch (
|
|
204
|
-
|
|
202
|
+
} catch (i) {
|
|
203
|
+
f.__e(i, o.__v);
|
|
205
204
|
}
|
|
206
205
|
});
|
|
207
206
|
}
|
|
208
|
-
function
|
|
209
|
-
var
|
|
210
|
-
if (u === "svg" && (o = !0),
|
|
211
|
-
for (;
|
|
212
|
-
if ((
|
|
213
|
-
t =
|
|
207
|
+
function Wt(t, e, n, r, o, i, s, l, c) {
|
|
208
|
+
var p, h, a, g = n.props, d = e.props, u = e.type, v = 0;
|
|
209
|
+
if (u === "svg" && (o = !0), i != null) {
|
|
210
|
+
for (; v < i.length; v++)
|
|
211
|
+
if ((p = i[v]) && "setAttribute" in p == !!u && (u ? p.localName === u : p.nodeType === 3)) {
|
|
212
|
+
t = p, i[v] = null;
|
|
214
213
|
break;
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
216
|
if (t == null) {
|
|
218
217
|
if (u === null)
|
|
219
|
-
return document.createTextNode(
|
|
220
|
-
t = o ? document.createElementNS("http://www.w3.org/2000/svg", u) : document.createElement(u,
|
|
218
|
+
return document.createTextNode(d);
|
|
219
|
+
t = o ? document.createElementNS("http://www.w3.org/2000/svg", u) : document.createElement(u, d.is && d), i = null, l = !1;
|
|
221
220
|
}
|
|
222
221
|
if (u === null)
|
|
223
|
-
|
|
222
|
+
g === d || l && t.data === d || (t.data = d);
|
|
224
223
|
else {
|
|
225
|
-
if (
|
|
226
|
-
if (
|
|
227
|
-
for (
|
|
228
|
-
|
|
229
|
-
(
|
|
224
|
+
if (i = i && ve.call(t.childNodes), h = (g = n.props || W).dangerouslySetInnerHTML, a = d.dangerouslySetInnerHTML, !l) {
|
|
225
|
+
if (i != null)
|
|
226
|
+
for (g = {}, v = 0; v < t.attributes.length; v++)
|
|
227
|
+
g[t.attributes[v].name] = t.attributes[v].value;
|
|
228
|
+
(a || h) && (a && (h && a.__html == h.__html || a.__html === t.innerHTML) || (t.innerHTML = a && a.__html || ""));
|
|
230
229
|
}
|
|
231
|
-
if (
|
|
230
|
+
if (Ot(t, d, g, o, l), a)
|
|
232
231
|
e.__k = [];
|
|
233
|
-
else if (
|
|
234
|
-
for (
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
else if (gt(t, pe(v = e.props.children) ? v : [v], e, n, r, o && u !== "foreignObject", i, s, i ? i[0] : n.__k && G(n, 0), l, c), i != null)
|
|
233
|
+
for (v = i.length; v--; )
|
|
234
|
+
i[v] != null && vt(i[v]);
|
|
235
|
+
l || ("value" in d && (v = d.value) !== void 0 && (v !== t.value || u === "progress" && !v || u === "option" && v !== g.value) && ae(t, "value", v, g.value, !1), "checked" in d && (v = d.checked) !== void 0 && v !== t.checked && ae(t, "checked", v, g.checked, !1));
|
|
237
236
|
}
|
|
238
237
|
return t;
|
|
239
238
|
}
|
|
240
|
-
function
|
|
239
|
+
function ze(t, e, n) {
|
|
241
240
|
try {
|
|
242
241
|
typeof t == "function" ? t(e) : t.current = e;
|
|
243
|
-
} catch (
|
|
244
|
-
|
|
242
|
+
} catch (r) {
|
|
243
|
+
f.__e(r, n);
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
|
-
function
|
|
248
|
-
var
|
|
249
|
-
if (
|
|
250
|
-
if (
|
|
246
|
+
function Ee(t, e, n) {
|
|
247
|
+
var r, o;
|
|
248
|
+
if (f.unmount && f.unmount(t), (r = t.ref) && (r.current && r.current !== t.__e || ze(r, null, e)), (r = t.__c) != null) {
|
|
249
|
+
if (r.componentWillUnmount)
|
|
251
250
|
try {
|
|
252
|
-
|
|
253
|
-
} catch (
|
|
254
|
-
|
|
251
|
+
r.componentWillUnmount();
|
|
252
|
+
} catch (i) {
|
|
253
|
+
f.__e(i, e);
|
|
255
254
|
}
|
|
256
|
-
|
|
255
|
+
r.base = r.__P = null, t.__c = void 0;
|
|
257
256
|
}
|
|
258
|
-
if (
|
|
259
|
-
for (o = 0; o <
|
|
260
|
-
|
|
261
|
-
n || t.__e == null ||
|
|
257
|
+
if (r = t.__k)
|
|
258
|
+
for (o = 0; o < r.length; o++)
|
|
259
|
+
r[o] && Ee(r[o], e, n || typeof t.type != "function");
|
|
260
|
+
n || t.__e == null || vt(t.__e), t.__ = t.__e = t.__d = void 0;
|
|
262
261
|
}
|
|
263
|
-
function
|
|
262
|
+
function Bt(t, e, n) {
|
|
264
263
|
return this.constructor(t, n);
|
|
265
264
|
}
|
|
266
|
-
function
|
|
267
|
-
var
|
|
268
|
-
|
|
265
|
+
function We(t, e, n) {
|
|
266
|
+
var r, o, i, s;
|
|
267
|
+
f.__ && f.__(t, e), o = (r = typeof n == "function") ? null : n && n.__k || e.__k, i = [], s = [], Me(e, t = (!r && n || e).__k = Z(I, null, [t]), o || W, W, e.ownerSVGElement !== void 0, !r && n ? [n] : o ? null : e.firstChild ? ve.call(e.childNodes) : null, i, !r && n ? n : o ? o.__e : e.firstChild, r, s), bt(i, t, s);
|
|
269
268
|
}
|
|
270
|
-
|
|
271
|
-
for (var o,
|
|
269
|
+
ve = dt.slice, f = { __e: function(t, e, n, r) {
|
|
270
|
+
for (var o, i, s; e = e.__; )
|
|
272
271
|
if ((o = e.__c) && !o.__)
|
|
273
272
|
try {
|
|
274
|
-
if ((
|
|
273
|
+
if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(t)), s = o.__d), o.componentDidCatch != null && (o.componentDidCatch(t, r || {}), s = o.__d), s)
|
|
275
274
|
return o.__E = o;
|
|
276
|
-
} catch (
|
|
277
|
-
t =
|
|
275
|
+
} catch (l) {
|
|
276
|
+
t = l;
|
|
278
277
|
}
|
|
279
278
|
throw t;
|
|
280
|
-
} },
|
|
279
|
+
} }, _t = 0, ft = function(t) {
|
|
281
280
|
return t != null && t.constructor === void 0;
|
|
282
|
-
},
|
|
281
|
+
}, A.prototype.setState = function(t, e) {
|
|
283
282
|
var n;
|
|
284
|
-
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s =
|
|
285
|
-
},
|
|
286
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
287
|
-
},
|
|
283
|
+
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = R({}, this.state), typeof t == "function" && (t = t(R({}, n), this.props)), t && R(n, t), t != null && this.__v && (e && this._sb.push(e), Ue(this));
|
|
284
|
+
}, A.prototype.forceUpdate = function(t) {
|
|
285
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), Ue(this));
|
|
286
|
+
}, A.prototype.render = I, V = [], ht = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, xe = function(t, e) {
|
|
288
287
|
return t.__v.__b - e.__v.__b;
|
|
289
|
-
},
|
|
290
|
-
const
|
|
291
|
-
function
|
|
292
|
-
let
|
|
293
|
-
return n && (
|
|
288
|
+
}, oe.__r = 0;
|
|
289
|
+
const It = "ibiz", qt = "is-";
|
|
290
|
+
function D(t, e, n, r, o) {
|
|
291
|
+
let i = "".concat(t, "-").concat(e);
|
|
292
|
+
return n && (i += "-".concat(n)), r && (i += "__".concat(r)), o && (i += "--".concat(o)), i;
|
|
294
293
|
}
|
|
295
|
-
class
|
|
294
|
+
class F {
|
|
296
295
|
/**
|
|
297
296
|
* Creates an instance of Namespace.
|
|
298
297
|
*
|
|
@@ -306,11 +305,11 @@ class z {
|
|
|
306
305
|
* 命名空间
|
|
307
306
|
*
|
|
308
307
|
* @author chitanda
|
|
309
|
-
* @date
|
|
308
|
+
* @date 2023-11-03 10:11:31
|
|
310
309
|
* @type {string}
|
|
311
310
|
*/
|
|
312
|
-
|
|
313
|
-
this.block = e, this.namespace = n ||
|
|
311
|
+
H(this, "namespace");
|
|
312
|
+
this.block = e, this.namespace = n || It;
|
|
314
313
|
}
|
|
315
314
|
/**
|
|
316
315
|
* namespace-block
|
|
@@ -322,7 +321,7 @@ class z {
|
|
|
322
321
|
* @return {*} {string}
|
|
323
322
|
*/
|
|
324
323
|
b(e = "") {
|
|
325
|
-
return
|
|
324
|
+
return D(this.namespace, this.block, e, "", "");
|
|
326
325
|
}
|
|
327
326
|
/**
|
|
328
327
|
* namespace-block__element
|
|
@@ -333,7 +332,7 @@ class z {
|
|
|
333
332
|
* @return {*} {string}
|
|
334
333
|
*/
|
|
335
334
|
e(e) {
|
|
336
|
-
return e ?
|
|
335
|
+
return e ? D(this.namespace, this.block, "", e, "") : "";
|
|
337
336
|
}
|
|
338
337
|
/**
|
|
339
338
|
* namespace-block--modifier
|
|
@@ -344,7 +343,7 @@ class z {
|
|
|
344
343
|
* @return {*} {string}
|
|
345
344
|
*/
|
|
346
345
|
m(e) {
|
|
347
|
-
return e ?
|
|
346
|
+
return e ? D(this.namespace, this.block, "", "", e) : "";
|
|
348
347
|
}
|
|
349
348
|
/**
|
|
350
349
|
* namespace-block-blockSuffix__element
|
|
@@ -356,7 +355,7 @@ class z {
|
|
|
356
355
|
* @return {*} {string}
|
|
357
356
|
*/
|
|
358
357
|
be(e, n) {
|
|
359
|
-
return e && n ?
|
|
358
|
+
return e && n ? D(this.namespace, this.block, e, n, "") : "";
|
|
360
359
|
}
|
|
361
360
|
/**
|
|
362
361
|
* namespace-block__element--modifier
|
|
@@ -368,7 +367,7 @@ class z {
|
|
|
368
367
|
* @return {*} {string}
|
|
369
368
|
*/
|
|
370
369
|
em(e, n) {
|
|
371
|
-
return e && n ?
|
|
370
|
+
return e && n ? D(this.namespace, this.block, "", e, n) : "";
|
|
372
371
|
}
|
|
373
372
|
/**
|
|
374
373
|
* namespace-block-blockSuffix--modifier
|
|
@@ -380,7 +379,7 @@ class z {
|
|
|
380
379
|
* @return {*} {string}
|
|
381
380
|
*/
|
|
382
381
|
bm(e, n) {
|
|
383
|
-
return e && n ?
|
|
382
|
+
return e && n ? D(this.namespace, this.block, e, "", n) : "";
|
|
384
383
|
}
|
|
385
384
|
/**
|
|
386
385
|
* namespace-block-blockSuffix__element--modifier
|
|
@@ -392,8 +391,8 @@ class z {
|
|
|
392
391
|
* @param {string} [modifier]
|
|
393
392
|
* @return {*} {string}
|
|
394
393
|
*/
|
|
395
|
-
bem(e, n,
|
|
396
|
-
return e && n &&
|
|
394
|
+
bem(e, n, r) {
|
|
395
|
+
return e && n && r ? D(this.namespace, this.block, e, n, r) : "";
|
|
397
396
|
}
|
|
398
397
|
/**
|
|
399
398
|
* 返回状态 class
|
|
@@ -408,7 +407,7 @@ class z {
|
|
|
408
407
|
* @return {*} {string}
|
|
409
408
|
*/
|
|
410
409
|
is(e, n) {
|
|
411
|
-
return e && n ? "".concat(
|
|
410
|
+
return e && n ? "".concat(qt).concat(e) : "";
|
|
412
411
|
}
|
|
413
412
|
/**
|
|
414
413
|
* 生成使用到的 css 变量 style 对象
|
|
@@ -420,8 +419,8 @@ class z {
|
|
|
420
419
|
*/
|
|
421
420
|
cssVar(e) {
|
|
422
421
|
const n = {};
|
|
423
|
-
for (const
|
|
424
|
-
e[
|
|
422
|
+
for (const r in e)
|
|
423
|
+
e[r] && (n[this.cssVarName(r)] = e[r]);
|
|
425
424
|
return n;
|
|
426
425
|
}
|
|
427
426
|
/**
|
|
@@ -434,8 +433,8 @@ class z {
|
|
|
434
433
|
*/
|
|
435
434
|
cssVarBlock(e) {
|
|
436
435
|
const n = {};
|
|
437
|
-
for (const
|
|
438
|
-
e[
|
|
436
|
+
for (const r in e)
|
|
437
|
+
e[r] && (n[this.cssVarBlockName(r)] = e[r]);
|
|
439
438
|
return n;
|
|
440
439
|
}
|
|
441
440
|
/**
|
|
@@ -461,141 +460,356 @@ class z {
|
|
|
461
460
|
return "--".concat(this.namespace, "-").concat(this.block, "-").concat(e);
|
|
462
461
|
}
|
|
463
462
|
}
|
|
464
|
-
function
|
|
465
|
-
|
|
463
|
+
function M(t) {
|
|
464
|
+
if (typeof t != "string")
|
|
465
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(t));
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
|
|
467
|
+
function Be(t, e) {
|
|
468
|
+
for (var n = "", r = 0, o = -1, i = 0, s, l = 0; l <= t.length; ++l) {
|
|
469
|
+
if (l < t.length)
|
|
470
|
+
s = t.charCodeAt(l);
|
|
471
|
+
else {
|
|
472
|
+
if (s === 47)
|
|
473
|
+
break;
|
|
474
|
+
s = 47;
|
|
475
|
+
}
|
|
476
|
+
if (s === 47) {
|
|
477
|
+
if (!(o === l - 1 || i === 1))
|
|
478
|
+
if (o !== l - 1 && i === 2) {
|
|
479
|
+
if (n.length < 2 || r !== 2 || n.charCodeAt(n.length - 1) !== 46 || n.charCodeAt(n.length - 2) !== 46) {
|
|
480
|
+
if (n.length > 2) {
|
|
481
|
+
var c = n.lastIndexOf("/");
|
|
482
|
+
if (c !== n.length - 1) {
|
|
483
|
+
c === -1 ? (n = "", r = 0) : (n = n.slice(0, c), r = n.length - 1 - n.lastIndexOf("/")), o = l, i = 0;
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
} else if (n.length === 2 || n.length === 1) {
|
|
487
|
+
n = "", r = 0, o = l, i = 0;
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
e && (n.length > 0 ? n += "/.." : n = "..", r = 2);
|
|
492
|
+
} else
|
|
493
|
+
n.length > 0 ? n += "/" + t.slice(o + 1, l) : n = t.slice(o + 1, l), r = l - o - 1;
|
|
494
|
+
o = l, i = 0;
|
|
495
|
+
} else
|
|
496
|
+
s === 46 && i !== -1 ? ++i : i = -1;
|
|
497
|
+
}
|
|
498
|
+
return n;
|
|
499
|
+
}
|
|
500
|
+
function Yt(t, e) {
|
|
501
|
+
var n = e.dir || e.root, r = e.base || (e.name || "") + (e.ext || "");
|
|
502
|
+
return n ? n === e.root ? n + r : n + t + r : r;
|
|
503
|
+
}
|
|
504
|
+
var j = {
|
|
505
|
+
// path.resolve([from ...], to)
|
|
506
|
+
resolve: function() {
|
|
507
|
+
for (var e = "", n = !1, r, o = arguments.length - 1; o >= -1 && !n; o--) {
|
|
508
|
+
var i;
|
|
509
|
+
o >= 0 ? i = arguments[o] : (r === void 0 && (r = process.cwd()), i = r), M(i), i.length !== 0 && (e = i + "/" + e, n = i.charCodeAt(0) === 47);
|
|
510
|
+
}
|
|
511
|
+
return e = Be(e, !n), n ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
|
|
512
|
+
},
|
|
513
|
+
normalize: function(e) {
|
|
514
|
+
if (M(e), e.length === 0)
|
|
515
|
+
return ".";
|
|
516
|
+
var n = e.charCodeAt(0) === 47, r = e.charCodeAt(e.length - 1) === 47;
|
|
517
|
+
return e = Be(e, !n), e.length === 0 && !n && (e = "."), e.length > 0 && r && (e += "/"), n ? "/" + e : e;
|
|
518
|
+
},
|
|
519
|
+
isAbsolute: function(e) {
|
|
520
|
+
return M(e), e.length > 0 && e.charCodeAt(0) === 47;
|
|
521
|
+
},
|
|
522
|
+
join: function() {
|
|
523
|
+
if (arguments.length === 0)
|
|
524
|
+
return ".";
|
|
525
|
+
for (var e, n = 0; n < arguments.length; ++n) {
|
|
526
|
+
var r = arguments[n];
|
|
527
|
+
M(r), r.length > 0 && (e === void 0 ? e = r : e += "/" + r);
|
|
528
|
+
}
|
|
529
|
+
return e === void 0 ? "." : j.normalize(e);
|
|
530
|
+
},
|
|
531
|
+
relative: function(e, n) {
|
|
532
|
+
if (M(e), M(n), e === n || (e = j.resolve(e), n = j.resolve(n), e === n))
|
|
533
|
+
return "";
|
|
534
|
+
for (var r = 1; r < e.length && e.charCodeAt(r) === 47; ++r)
|
|
535
|
+
;
|
|
536
|
+
for (var o = e.length, i = o - r, s = 1; s < n.length && n.charCodeAt(s) === 47; ++s)
|
|
537
|
+
;
|
|
538
|
+
for (var l = n.length, c = l - s, p = i < c ? i : c, h = -1, a = 0; a <= p; ++a) {
|
|
539
|
+
if (a === p) {
|
|
540
|
+
if (c > p) {
|
|
541
|
+
if (n.charCodeAt(s + a) === 47)
|
|
542
|
+
return n.slice(s + a + 1);
|
|
543
|
+
if (a === 0)
|
|
544
|
+
return n.slice(s + a);
|
|
545
|
+
} else
|
|
546
|
+
i > p && (e.charCodeAt(r + a) === 47 ? h = a : a === 0 && (h = 0));
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
var g = e.charCodeAt(r + a), d = n.charCodeAt(s + a);
|
|
550
|
+
if (g !== d)
|
|
551
|
+
break;
|
|
552
|
+
g === 47 && (h = a);
|
|
553
|
+
}
|
|
554
|
+
var u = "";
|
|
555
|
+
for (a = r + h + 1; a <= o; ++a)
|
|
556
|
+
(a === o || e.charCodeAt(a) === 47) && (u.length === 0 ? u += ".." : u += "/..");
|
|
557
|
+
return u.length > 0 ? u + n.slice(s + h) : (s += h, n.charCodeAt(s) === 47 && ++s, n.slice(s));
|
|
558
|
+
},
|
|
559
|
+
_makeLong: function(e) {
|
|
560
|
+
return e;
|
|
561
|
+
},
|
|
562
|
+
dirname: function(e) {
|
|
563
|
+
if (M(e), e.length === 0)
|
|
564
|
+
return ".";
|
|
565
|
+
for (var n = e.charCodeAt(0), r = n === 47, o = -1, i = !0, s = e.length - 1; s >= 1; --s)
|
|
566
|
+
if (n = e.charCodeAt(s), n === 47) {
|
|
567
|
+
if (!i) {
|
|
568
|
+
o = s;
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
} else
|
|
572
|
+
i = !1;
|
|
573
|
+
return o === -1 ? r ? "/" : "." : r && o === 1 ? "//" : e.slice(0, o);
|
|
574
|
+
},
|
|
575
|
+
basename: function(e, n) {
|
|
576
|
+
if (n !== void 0 && typeof n != "string")
|
|
577
|
+
throw new TypeError('"ext" argument must be a string');
|
|
578
|
+
M(e);
|
|
579
|
+
var r = 0, o = -1, i = !0, s;
|
|
580
|
+
if (n !== void 0 && n.length > 0 && n.length <= e.length) {
|
|
581
|
+
if (n.length === e.length && n === e)
|
|
582
|
+
return "";
|
|
583
|
+
var l = n.length - 1, c = -1;
|
|
584
|
+
for (s = e.length - 1; s >= 0; --s) {
|
|
585
|
+
var p = e.charCodeAt(s);
|
|
586
|
+
if (p === 47) {
|
|
587
|
+
if (!i) {
|
|
588
|
+
r = s + 1;
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
} else
|
|
592
|
+
c === -1 && (i = !1, c = s + 1), l >= 0 && (p === n.charCodeAt(l) ? --l === -1 && (o = s) : (l = -1, o = c));
|
|
593
|
+
}
|
|
594
|
+
return r === o ? o = c : o === -1 && (o = e.length), e.slice(r, o);
|
|
595
|
+
} else {
|
|
596
|
+
for (s = e.length - 1; s >= 0; --s)
|
|
597
|
+
if (e.charCodeAt(s) === 47) {
|
|
598
|
+
if (!i) {
|
|
599
|
+
r = s + 1;
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
} else
|
|
603
|
+
o === -1 && (i = !1, o = s + 1);
|
|
604
|
+
return o === -1 ? "" : e.slice(r, o);
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
extname: function(e) {
|
|
608
|
+
M(e);
|
|
609
|
+
for (var n = -1, r = 0, o = -1, i = !0, s = 0, l = e.length - 1; l >= 0; --l) {
|
|
610
|
+
var c = e.charCodeAt(l);
|
|
611
|
+
if (c === 47) {
|
|
612
|
+
if (!i) {
|
|
613
|
+
r = l + 1;
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
o === -1 && (i = !1, o = l + 1), c === 46 ? n === -1 ? n = l : s !== 1 && (s = 1) : n !== -1 && (s = -1);
|
|
619
|
+
}
|
|
620
|
+
return n === -1 || o === -1 || // We saw a non-dot character immediately before the dot
|
|
621
|
+
s === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
622
|
+
s === 1 && n === o - 1 && n === r + 1 ? "" : e.slice(n, o);
|
|
623
|
+
},
|
|
624
|
+
format: function(e) {
|
|
625
|
+
if (e === null || typeof e != "object")
|
|
626
|
+
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
|
|
627
|
+
return Yt("/", e);
|
|
628
|
+
},
|
|
629
|
+
parse: function(e) {
|
|
630
|
+
M(e);
|
|
631
|
+
var n = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
632
|
+
if (e.length === 0)
|
|
633
|
+
return n;
|
|
634
|
+
var r = e.charCodeAt(0), o = r === 47, i;
|
|
635
|
+
o ? (n.root = "/", i = 1) : i = 0;
|
|
636
|
+
for (var s = -1, l = 0, c = -1, p = !0, h = e.length - 1, a = 0; h >= i; --h) {
|
|
637
|
+
if (r = e.charCodeAt(h), r === 47) {
|
|
638
|
+
if (!p) {
|
|
639
|
+
l = h + 1;
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
continue;
|
|
643
|
+
}
|
|
644
|
+
c === -1 && (p = !1, c = h + 1), r === 46 ? s === -1 ? s = h : a !== 1 && (a = 1) : s !== -1 && (a = -1);
|
|
645
|
+
}
|
|
646
|
+
return s === -1 || c === -1 || // We saw a non-dot character immediately before the dot
|
|
647
|
+
a === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
648
|
+
a === 1 && s === c - 1 && s === l + 1 ? c !== -1 && (l === 0 && o ? n.base = n.name = e.slice(1, c) : n.base = n.name = e.slice(l, c)) : (l === 0 && o ? (n.name = e.slice(1, s), n.base = e.slice(1, c)) : (n.name = e.slice(l, s), n.base = e.slice(l, c)), n.ext = e.slice(s, c)), l > 0 ? n.dir = e.slice(0, l - 1) : o && (n.dir = "/"), n;
|
|
649
|
+
},
|
|
650
|
+
sep: "/",
|
|
651
|
+
delimiter: ":",
|
|
652
|
+
win32: null,
|
|
653
|
+
posix: null
|
|
654
|
+
};
|
|
655
|
+
j.posix = j;
|
|
656
|
+
function L() {
|
|
657
|
+
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
469
658
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
l.__h && l.__h(S, t, _e || e), _e = 0;
|
|
473
|
-
var n = S.__H || (S.__H = { __: [], __h: [] });
|
|
474
|
-
return t >= n.__.length && n.__.push({ __V: ne }), n.__[t];
|
|
659
|
+
function wt() {
|
|
660
|
+
return "".concat(L() + L(), "-").concat(L(), "-").concat(L(), "-").concat(L(), "-").concat(L()).concat(L()).concat(L());
|
|
475
661
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
662
|
+
class $t {
|
|
663
|
+
/**
|
|
664
|
+
* 拷贝文本
|
|
665
|
+
*
|
|
666
|
+
* @author zhanghengfeng
|
|
667
|
+
* @date 2023-08-31 11:08:51
|
|
668
|
+
* @param {string} value
|
|
669
|
+
* @return {*} {boolean}
|
|
670
|
+
*/
|
|
671
|
+
static copy(e) {
|
|
672
|
+
return this.inputElement || (this.inputElement = document.createElement("input"), this.inputElement.style.position = "absolute", this.inputElement.style.left = "-9999px", document.body.appendChild(this.inputElement)), this.inputElement.value = e, this.inputElement.select(), document.execCommand("copy");
|
|
673
|
+
}
|
|
479
674
|
}
|
|
480
|
-
|
|
481
|
-
|
|
675
|
+
/**
|
|
676
|
+
* input元素,用于存储拷贝的文本
|
|
677
|
+
*
|
|
678
|
+
* @author zhanghengfeng
|
|
679
|
+
* @date 2023-08-31 20:08:06
|
|
680
|
+
* @private
|
|
681
|
+
* @type {(HTMLInputElement | null)}
|
|
682
|
+
*/
|
|
683
|
+
H($t, "inputElement", null);
|
|
684
|
+
var le, C, $e, Ie, ce = 0, kt = [], re = [], qe = f.__b, Ye = f.__r, je = f.diffed, Xe = f.__c, Je = f.unmount;
|
|
685
|
+
function St(t, e) {
|
|
686
|
+
f.__h && f.__h(C, t, ce || e), ce = 0;
|
|
687
|
+
var n = C.__H || (C.__H = { __: [], __h: [] });
|
|
688
|
+
return t >= n.__.length && n.__.push({ __V: re }), n.__[t];
|
|
689
|
+
}
|
|
690
|
+
function ue(t, e) {
|
|
691
|
+
var n = St(le++, 3);
|
|
692
|
+
!f.__s && Ct(n.__H, e) && (n.__ = t, n.i = e, C.__H.__h.push(n));
|
|
693
|
+
}
|
|
694
|
+
function ge(t) {
|
|
695
|
+
return ce = 5, K(function() {
|
|
482
696
|
return { current: t };
|
|
483
697
|
}, []);
|
|
484
698
|
}
|
|
485
699
|
function K(t, e) {
|
|
486
|
-
var n =
|
|
487
|
-
return
|
|
700
|
+
var n = St(le++, 7);
|
|
701
|
+
return Ct(n.__H, e) ? (n.__V = t(), n.i = e, n.__h = t, n.__V) : n.__;
|
|
488
702
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
703
|
+
function Ze(t, e) {
|
|
704
|
+
return ce = 8, K(function() {
|
|
491
705
|
return t;
|
|
492
706
|
}, e);
|
|
493
707
|
}
|
|
494
|
-
function
|
|
495
|
-
for (var t; t =
|
|
708
|
+
function jt() {
|
|
709
|
+
for (var t; t = kt.shift(); )
|
|
496
710
|
if (t.__P && t.__H)
|
|
497
711
|
try {
|
|
498
712
|
t.__H.__h.forEach(ie), t.__H.__h.forEach(Ne), t.__H.__h = [];
|
|
499
713
|
} catch (e) {
|
|
500
|
-
t.__H.__h = [],
|
|
714
|
+
t.__H.__h = [], f.__e(e, t.__v);
|
|
501
715
|
}
|
|
502
716
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
var e = (
|
|
508
|
-
e && (
|
|
509
|
-
n.__N && (n.__ = n.__N), n.__V =
|
|
510
|
-
})) : (e.__h.forEach(ie), e.__h.forEach(Ne), e.__h = [],
|
|
511
|
-
},
|
|
512
|
-
|
|
717
|
+
f.__b = function(t) {
|
|
718
|
+
C = null, qe && qe(t);
|
|
719
|
+
}, f.__r = function(t) {
|
|
720
|
+
Ye && Ye(t), le = 0;
|
|
721
|
+
var e = (C = t.__c).__H;
|
|
722
|
+
e && ($e === C ? (e.__h = [], C.__h = [], e.__.forEach(function(n) {
|
|
723
|
+
n.__N && (n.__ = n.__N), n.__V = re, n.__N = n.i = void 0;
|
|
724
|
+
})) : (e.__h.forEach(ie), e.__h.forEach(Ne), e.__h = [], le = 0)), $e = C;
|
|
725
|
+
}, f.diffed = function(t) {
|
|
726
|
+
je && je(t);
|
|
513
727
|
var e = t.__c;
|
|
514
|
-
e && e.__H && (e.__H.__h.length && (
|
|
515
|
-
n.i && (n.__H = n.i), n.__V !==
|
|
516
|
-
})),
|
|
517
|
-
},
|
|
728
|
+
e && e.__H && (e.__H.__h.length && (kt.push(e) !== 1 && Ie === f.requestAnimationFrame || ((Ie = f.requestAnimationFrame) || Xt)(jt)), e.__H.__.forEach(function(n) {
|
|
729
|
+
n.i && (n.__H = n.i), n.__V !== re && (n.__ = n.__V), n.i = void 0, n.__V = re;
|
|
730
|
+
})), $e = C = null;
|
|
731
|
+
}, f.__c = function(t, e) {
|
|
518
732
|
e.some(function(n) {
|
|
519
733
|
try {
|
|
520
|
-
n.__h.forEach(ie), n.__h = n.__h.filter(function(
|
|
521
|
-
return !
|
|
734
|
+
n.__h.forEach(ie), n.__h = n.__h.filter(function(r) {
|
|
735
|
+
return !r.__ || Ne(r);
|
|
522
736
|
});
|
|
523
|
-
} catch (
|
|
737
|
+
} catch (r) {
|
|
524
738
|
e.some(function(o) {
|
|
525
739
|
o.__h && (o.__h = []);
|
|
526
|
-
}), e = [],
|
|
740
|
+
}), e = [], f.__e(r, n.__v);
|
|
527
741
|
}
|
|
528
|
-
}),
|
|
529
|
-
},
|
|
530
|
-
|
|
742
|
+
}), Xe && Xe(t, e);
|
|
743
|
+
}, f.unmount = function(t) {
|
|
744
|
+
Je && Je(t);
|
|
531
745
|
var e, n = t.__c;
|
|
532
|
-
n && n.__H && (n.__H.__.forEach(function(
|
|
746
|
+
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
533
747
|
try {
|
|
534
|
-
ie(
|
|
748
|
+
ie(r);
|
|
535
749
|
} catch (o) {
|
|
536
750
|
e = o;
|
|
537
751
|
}
|
|
538
|
-
}), n.__H = void 0, e &&
|
|
752
|
+
}), n.__H = void 0, e && f.__e(e, n.__v));
|
|
539
753
|
};
|
|
540
|
-
var
|
|
541
|
-
function
|
|
754
|
+
var Ge = typeof requestAnimationFrame == "function";
|
|
755
|
+
function Xt(t) {
|
|
542
756
|
var e, n = function() {
|
|
543
|
-
clearTimeout(
|
|
544
|
-
},
|
|
545
|
-
|
|
757
|
+
clearTimeout(r), Ge && cancelAnimationFrame(e), setTimeout(t);
|
|
758
|
+
}, r = setTimeout(n, 100);
|
|
759
|
+
Ge && (e = requestAnimationFrame(n));
|
|
546
760
|
}
|
|
547
761
|
function ie(t) {
|
|
548
|
-
var e =
|
|
549
|
-
typeof n == "function" && (t.__c = void 0, n()),
|
|
762
|
+
var e = C, n = t.__c;
|
|
763
|
+
typeof n == "function" && (t.__c = void 0, n()), C = e;
|
|
550
764
|
}
|
|
551
765
|
function Ne(t) {
|
|
552
|
-
var e =
|
|
553
|
-
t.__c = t.__(),
|
|
766
|
+
var e = C;
|
|
767
|
+
t.__c = t.__(), C = e;
|
|
554
768
|
}
|
|
555
|
-
function
|
|
556
|
-
return !t || t.length !== e.length || e.some(function(n,
|
|
557
|
-
return n !== t[
|
|
769
|
+
function Ct(t, e) {
|
|
770
|
+
return !t || t.length !== e.length || e.some(function(n, r) {
|
|
771
|
+
return n !== t[r];
|
|
558
772
|
});
|
|
559
773
|
}
|
|
560
774
|
function me() {
|
|
561
775
|
throw new Error("Cycle detected");
|
|
562
776
|
}
|
|
563
|
-
var
|
|
564
|
-
function
|
|
565
|
-
if (
|
|
566
|
-
|
|
777
|
+
var Jt = Symbol.for("preact-signals");
|
|
778
|
+
function Pe() {
|
|
779
|
+
if (B > 1)
|
|
780
|
+
B--;
|
|
567
781
|
else {
|
|
568
|
-
for (var t, e = !1;
|
|
569
|
-
var n =
|
|
570
|
-
for (
|
|
571
|
-
var
|
|
572
|
-
if (n.o = void 0, n.f &= -3, !(8 & n.f) &&
|
|
782
|
+
for (var t, e = !1; X !== void 0; ) {
|
|
783
|
+
var n = X;
|
|
784
|
+
for (X = void 0, Ae++; n !== void 0; ) {
|
|
785
|
+
var r = n.o;
|
|
786
|
+
if (n.o = void 0, n.f &= -3, !(8 & n.f) && Et(n))
|
|
573
787
|
try {
|
|
574
788
|
n.c();
|
|
575
789
|
} catch (o) {
|
|
576
790
|
e || (t = o, e = !0);
|
|
577
791
|
}
|
|
578
|
-
n =
|
|
792
|
+
n = r;
|
|
579
793
|
}
|
|
580
794
|
}
|
|
581
|
-
if (
|
|
795
|
+
if (Ae = 0, B--, e)
|
|
582
796
|
throw t;
|
|
583
797
|
}
|
|
584
798
|
}
|
|
585
|
-
var
|
|
586
|
-
function
|
|
587
|
-
if (
|
|
799
|
+
var y = void 0, X = void 0, B = 0, Ae = 0, _e = 0;
|
|
800
|
+
function xt(t) {
|
|
801
|
+
if (y !== void 0) {
|
|
588
802
|
var e = t.n;
|
|
589
|
-
if (e === void 0 || e.t !==
|
|
590
|
-
return e = { i: 0, S: t, p:
|
|
803
|
+
if (e === void 0 || e.t !== y)
|
|
804
|
+
return e = { i: 0, S: t, p: y.s, n: void 0, t: y, e: void 0, x: void 0, r: e }, y.s !== void 0 && (y.s.n = e), y.s = e, t.n = e, 32 & y.f && t.S(e), e;
|
|
591
805
|
if (e.i === -1)
|
|
592
|
-
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p =
|
|
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 = y.s, e.n = void 0, y.s.n = e, y.s = e), e;
|
|
593
807
|
}
|
|
594
808
|
}
|
|
595
809
|
function k(t) {
|
|
596
810
|
this.v = t, this.i = 0, this.n = void 0, this.t = void 0;
|
|
597
811
|
}
|
|
598
|
-
k.prototype.brand =
|
|
812
|
+
k.prototype.brand = Jt;
|
|
599
813
|
k.prototype.h = function() {
|
|
600
814
|
return !0;
|
|
601
815
|
};
|
|
@@ -611,12 +825,12 @@ k.prototype.U = function(t) {
|
|
|
611
825
|
k.prototype.subscribe = function(t) {
|
|
612
826
|
var e = this;
|
|
613
827
|
return ye(function() {
|
|
614
|
-
var n = e.value,
|
|
828
|
+
var n = e.value, r = 32 & this.f;
|
|
615
829
|
this.f &= -33;
|
|
616
830
|
try {
|
|
617
831
|
t(n);
|
|
618
832
|
} finally {
|
|
619
|
-
this.f |=
|
|
833
|
+
this.f |= r;
|
|
620
834
|
}
|
|
621
835
|
});
|
|
622
836
|
};
|
|
@@ -633,31 +847,31 @@ k.prototype.peek = function() {
|
|
|
633
847
|
return this.v;
|
|
634
848
|
};
|
|
635
849
|
Object.defineProperty(k.prototype, "value", { get: function() {
|
|
636
|
-
var t =
|
|
850
|
+
var t = xt(this);
|
|
637
851
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
638
852
|
}, set: function(t) {
|
|
639
|
-
if (
|
|
853
|
+
if (y instanceof U && function() {
|
|
640
854
|
throw new Error("Computed cannot have side-effects");
|
|
641
855
|
}(), t !== this.v) {
|
|
642
|
-
|
|
856
|
+
Ae > 100 && me(), this.v = t, this.i++, _e++, B++;
|
|
643
857
|
try {
|
|
644
858
|
for (var e = this.t; e !== void 0; e = e.x)
|
|
645
859
|
e.t.N();
|
|
646
860
|
} finally {
|
|
647
|
-
|
|
861
|
+
Pe();
|
|
648
862
|
}
|
|
649
863
|
}
|
|
650
864
|
} });
|
|
651
|
-
function
|
|
865
|
+
function fe(t) {
|
|
652
866
|
return new k(t);
|
|
653
867
|
}
|
|
654
|
-
function
|
|
868
|
+
function Et(t) {
|
|
655
869
|
for (var e = t.s; e !== void 0; e = e.n)
|
|
656
870
|
if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i)
|
|
657
871
|
return !0;
|
|
658
872
|
return !1;
|
|
659
873
|
}
|
|
660
|
-
function
|
|
874
|
+
function Nt(t) {
|
|
661
875
|
for (var e = t.s; e !== void 0; e = e.n) {
|
|
662
876
|
var n = e.S.n;
|
|
663
877
|
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -666,34 +880,34 @@ function kt(t) {
|
|
|
666
880
|
}
|
|
667
881
|
}
|
|
668
882
|
}
|
|
669
|
-
function
|
|
883
|
+
function At(t) {
|
|
670
884
|
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
671
|
-
var
|
|
672
|
-
e.i === -1 ? (e.S.U(e),
|
|
885
|
+
var r = e.p;
|
|
886
|
+
e.i === -1 ? (e.S.U(e), r !== void 0 && (r.n = e.n), e.n !== void 0 && (e.n.p = r)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = r;
|
|
673
887
|
}
|
|
674
888
|
t.s = n;
|
|
675
889
|
}
|
|
676
|
-
function
|
|
677
|
-
k.call(this, void 0), this.x = t, this.s = void 0, this.g =
|
|
890
|
+
function U(t) {
|
|
891
|
+
k.call(this, void 0), this.x = t, this.s = void 0, this.g = _e - 1, this.f = 4;
|
|
678
892
|
}
|
|
679
|
-
(
|
|
893
|
+
(U.prototype = new k()).h = function() {
|
|
680
894
|
if (this.f &= -3, 1 & this.f)
|
|
681
895
|
return !1;
|
|
682
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
896
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === _e))
|
|
683
897
|
return !0;
|
|
684
|
-
if (this.g =
|
|
898
|
+
if (this.g = _e, this.f |= 1, this.i > 0 && !Et(this))
|
|
685
899
|
return this.f &= -2, !0;
|
|
686
|
-
var t =
|
|
900
|
+
var t = y;
|
|
687
901
|
try {
|
|
688
|
-
|
|
902
|
+
Nt(this), y = this;
|
|
689
903
|
var e = this.x();
|
|
690
904
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
691
905
|
} catch (n) {
|
|
692
906
|
this.v = n, this.f |= 16, this.i++;
|
|
693
907
|
}
|
|
694
|
-
return
|
|
908
|
+
return y = t, At(this), this.f &= -2, !0;
|
|
695
909
|
};
|
|
696
|
-
|
|
910
|
+
U.prototype.S = function(t) {
|
|
697
911
|
if (this.t === void 0) {
|
|
698
912
|
this.f |= 36;
|
|
699
913
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
@@ -701,64 +915,64 @@ R.prototype.S = function(t) {
|
|
|
701
915
|
}
|
|
702
916
|
k.prototype.S.call(this, t);
|
|
703
917
|
};
|
|
704
|
-
|
|
918
|
+
U.prototype.U = function(t) {
|
|
705
919
|
if (this.t !== void 0 && (k.prototype.U.call(this, t), this.t === void 0)) {
|
|
706
920
|
this.f &= -33;
|
|
707
921
|
for (var e = this.s; e !== void 0; e = e.n)
|
|
708
922
|
e.S.U(e);
|
|
709
923
|
}
|
|
710
924
|
};
|
|
711
|
-
|
|
925
|
+
U.prototype.N = function() {
|
|
712
926
|
if (!(2 & this.f)) {
|
|
713
927
|
this.f |= 6;
|
|
714
928
|
for (var t = this.t; t !== void 0; t = t.x)
|
|
715
929
|
t.t.N();
|
|
716
930
|
}
|
|
717
931
|
};
|
|
718
|
-
|
|
932
|
+
U.prototype.peek = function() {
|
|
719
933
|
if (this.h() || me(), 16 & this.f)
|
|
720
934
|
throw this.v;
|
|
721
935
|
return this.v;
|
|
722
936
|
};
|
|
723
|
-
Object.defineProperty(
|
|
937
|
+
Object.defineProperty(U.prototype, "value", { get: function() {
|
|
724
938
|
1 & this.f && me();
|
|
725
|
-
var t =
|
|
939
|
+
var t = xt(this);
|
|
726
940
|
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f)
|
|
727
941
|
throw this.v;
|
|
728
942
|
return this.v;
|
|
729
943
|
} });
|
|
730
|
-
function
|
|
731
|
-
return new
|
|
944
|
+
function Ht(t) {
|
|
945
|
+
return new U(t);
|
|
732
946
|
}
|
|
733
|
-
function
|
|
947
|
+
function Mt(t) {
|
|
734
948
|
var e = t.u;
|
|
735
949
|
if (t.u = void 0, typeof e == "function") {
|
|
736
|
-
|
|
737
|
-
var n =
|
|
738
|
-
|
|
950
|
+
B++;
|
|
951
|
+
var n = y;
|
|
952
|
+
y = void 0;
|
|
739
953
|
try {
|
|
740
954
|
e();
|
|
741
|
-
} catch (
|
|
742
|
-
throw t.f &= -2, t.f |= 8,
|
|
955
|
+
} catch (r) {
|
|
956
|
+
throw t.f &= -2, t.f |= 8, Te(t), r;
|
|
743
957
|
} finally {
|
|
744
|
-
|
|
958
|
+
y = n, Pe();
|
|
745
959
|
}
|
|
746
960
|
}
|
|
747
961
|
}
|
|
748
|
-
function
|
|
962
|
+
function Te(t) {
|
|
749
963
|
for (var e = t.s; e !== void 0; e = e.n)
|
|
750
964
|
e.S.U(e);
|
|
751
|
-
t.x = void 0, t.s = void 0,
|
|
965
|
+
t.x = void 0, t.s = void 0, Mt(t);
|
|
752
966
|
}
|
|
753
|
-
function
|
|
754
|
-
if (
|
|
967
|
+
function Zt(t) {
|
|
968
|
+
if (y !== this)
|
|
755
969
|
throw new Error("Out-of-order effect");
|
|
756
|
-
|
|
970
|
+
At(this), y = t, this.f &= -2, 8 & this.f && Te(this), Pe();
|
|
757
971
|
}
|
|
758
|
-
function
|
|
972
|
+
function Q(t) {
|
|
759
973
|
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
760
974
|
}
|
|
761
|
-
|
|
975
|
+
Q.prototype.c = function() {
|
|
762
976
|
var t = this.S();
|
|
763
977
|
try {
|
|
764
978
|
if (8 & this.f || this.x === void 0)
|
|
@@ -769,19 +983,19 @@ J.prototype.c = function() {
|
|
|
769
983
|
t();
|
|
770
984
|
}
|
|
771
985
|
};
|
|
772
|
-
|
|
773
|
-
1 & this.f && me(), this.f |= 1, this.f &= -9,
|
|
774
|
-
var t =
|
|
775
|
-
return
|
|
986
|
+
Q.prototype.S = function() {
|
|
987
|
+
1 & this.f && me(), this.f |= 1, this.f &= -9, Mt(this), Nt(this), B++;
|
|
988
|
+
var t = y;
|
|
989
|
+
return y = this, Zt.bind(this, t);
|
|
776
990
|
};
|
|
777
|
-
|
|
778
|
-
2 & this.f || (this.f |= 2, this.o =
|
|
991
|
+
Q.prototype.N = function() {
|
|
992
|
+
2 & this.f || (this.f |= 2, this.o = X, X = this);
|
|
779
993
|
};
|
|
780
|
-
|
|
781
|
-
this.f |= 8, 1 & this.f ||
|
|
994
|
+
Q.prototype.d = function() {
|
|
995
|
+
this.f |= 8, 1 & this.f || Te(this);
|
|
782
996
|
};
|
|
783
997
|
function ye(t) {
|
|
784
|
-
var e = new
|
|
998
|
+
var e = new Q(t);
|
|
785
999
|
try {
|
|
786
1000
|
e.c();
|
|
787
1001
|
} catch (n) {
|
|
@@ -789,395 +1003,450 @@ function ye(t) {
|
|
|
789
1003
|
}
|
|
790
1004
|
return e.d.bind(e);
|
|
791
1005
|
}
|
|
792
|
-
var
|
|
793
|
-
function
|
|
794
|
-
|
|
1006
|
+
var be, ke;
|
|
1007
|
+
function q(t, e) {
|
|
1008
|
+
f[t] = e.bind(null, f[t] || function() {
|
|
795
1009
|
});
|
|
796
1010
|
}
|
|
797
|
-
function
|
|
798
|
-
|
|
1011
|
+
function he(t) {
|
|
1012
|
+
ke && ke(), ke = t && t.S();
|
|
799
1013
|
}
|
|
800
|
-
function
|
|
801
|
-
var e = this, n = t.data,
|
|
802
|
-
|
|
1014
|
+
function zt(t) {
|
|
1015
|
+
var e = this, n = t.data, r = de(n);
|
|
1016
|
+
r.value = n;
|
|
803
1017
|
var o = K(function() {
|
|
804
|
-
for (var
|
|
805
|
-
if (
|
|
806
|
-
|
|
1018
|
+
for (var i = e.__v; i = i.__; )
|
|
1019
|
+
if (i.__c) {
|
|
1020
|
+
i.__c.__$f |= 4;
|
|
807
1021
|
break;
|
|
808
1022
|
}
|
|
809
1023
|
return e.__$u.c = function() {
|
|
810
|
-
var
|
|
811
|
-
!
|
|
812
|
-
},
|
|
813
|
-
var
|
|
814
|
-
return
|
|
1024
|
+
var s;
|
|
1025
|
+
!ft(o.peek()) && ((s = e.base) == null ? void 0 : s.nodeType) === 3 ? e.base.data = o.peek() : (e.__$f |= 1, e.setState({}));
|
|
1026
|
+
}, Ht(function() {
|
|
1027
|
+
var s = r.value.value;
|
|
1028
|
+
return s === 0 ? 0 : s === !0 ? "" : s || "";
|
|
815
1029
|
});
|
|
816
1030
|
}, []);
|
|
817
1031
|
return o.value;
|
|
818
1032
|
}
|
|
819
|
-
|
|
820
|
-
Object.defineProperties(k.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
1033
|
+
zt.displayName = "_st";
|
|
1034
|
+
Object.defineProperties(k.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: zt }, props: { configurable: !0, get: function() {
|
|
821
1035
|
return { data: this };
|
|
822
1036
|
} }, __b: { configurable: !0, value: 1 } });
|
|
823
|
-
|
|
1037
|
+
q("__b", function(t, e) {
|
|
824
1038
|
if (typeof e.type == "string") {
|
|
825
|
-
var n,
|
|
826
|
-
for (var o in
|
|
1039
|
+
var n, r = e.props;
|
|
1040
|
+
for (var o in r)
|
|
827
1041
|
if (o !== "children") {
|
|
828
|
-
var
|
|
829
|
-
|
|
1042
|
+
var i = r[o];
|
|
1043
|
+
i instanceof k && (n || (e.__np = n = {}), n[o] = i, r[o] = i.peek());
|
|
830
1044
|
}
|
|
831
1045
|
}
|
|
832
1046
|
t(e);
|
|
833
1047
|
});
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
var n,
|
|
837
|
-
|
|
838
|
-
var
|
|
1048
|
+
q("__r", function(t, e) {
|
|
1049
|
+
he();
|
|
1050
|
+
var n, r = e.__c;
|
|
1051
|
+
r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(o) {
|
|
1052
|
+
var i;
|
|
839
1053
|
return ye(function() {
|
|
840
|
-
|
|
841
|
-
}),
|
|
842
|
-
|
|
843
|
-
},
|
|
844
|
-
}())),
|
|
1054
|
+
i = this;
|
|
1055
|
+
}), i.c = function() {
|
|
1056
|
+
r.__$f |= 1, r.setState({});
|
|
1057
|
+
}, i;
|
|
1058
|
+
}())), be = r, he(n), t(e);
|
|
845
1059
|
});
|
|
846
|
-
|
|
847
|
-
|
|
1060
|
+
q("__e", function(t, e, n, r) {
|
|
1061
|
+
he(), be = void 0, t(e, n, r);
|
|
848
1062
|
});
|
|
849
|
-
|
|
850
|
-
|
|
1063
|
+
q("diffed", function(t, e) {
|
|
1064
|
+
he(), be = void 0;
|
|
851
1065
|
var n;
|
|
852
1066
|
if (typeof e.type == "string" && (n = e.__e)) {
|
|
853
|
-
var
|
|
854
|
-
if (
|
|
855
|
-
var
|
|
856
|
-
if (
|
|
857
|
-
for (var
|
|
858
|
-
var
|
|
859
|
-
|
|
1067
|
+
var r = e.__np, o = e.props;
|
|
1068
|
+
if (r) {
|
|
1069
|
+
var i = n.U;
|
|
1070
|
+
if (i)
|
|
1071
|
+
for (var s in i) {
|
|
1072
|
+
var l = i[s];
|
|
1073
|
+
l !== void 0 && !(s in r) && (l.d(), i[s] = void 0);
|
|
860
1074
|
}
|
|
861
1075
|
else
|
|
862
|
-
n.U =
|
|
863
|
-
for (var
|
|
864
|
-
var
|
|
865
|
-
|
|
1076
|
+
n.U = i = {};
|
|
1077
|
+
for (var c in r) {
|
|
1078
|
+
var p = i[c], h = r[c];
|
|
1079
|
+
p === void 0 ? (p = Gt(n, c, h, o), i[c] = p) : p.o(h, o);
|
|
866
1080
|
}
|
|
867
1081
|
}
|
|
868
1082
|
}
|
|
869
1083
|
t(e);
|
|
870
1084
|
});
|
|
871
|
-
function
|
|
872
|
-
var o = e in t && t.ownerSVGElement === void 0,
|
|
873
|
-
return { o: function(
|
|
874
|
-
|
|
1085
|
+
function Gt(t, e, n, r) {
|
|
1086
|
+
var o = e in t && t.ownerSVGElement === void 0, i = fe(n);
|
|
1087
|
+
return { o: function(s, l) {
|
|
1088
|
+
i.value = s, r = l;
|
|
875
1089
|
}, d: ye(function() {
|
|
876
|
-
var
|
|
877
|
-
|
|
1090
|
+
var s = i.value.value;
|
|
1091
|
+
r[e] !== s && (r[e] = s, o ? t[e] = s : s ? t.setAttribute(e, s) : t.removeAttribute(e));
|
|
878
1092
|
}) };
|
|
879
1093
|
}
|
|
880
|
-
|
|
1094
|
+
q("unmount", function(t, e) {
|
|
881
1095
|
if (typeof e.type == "string") {
|
|
882
1096
|
var n = e.__e;
|
|
883
1097
|
if (n) {
|
|
884
|
-
var
|
|
885
|
-
if (
|
|
1098
|
+
var r = n.U;
|
|
1099
|
+
if (r) {
|
|
886
1100
|
n.U = void 0;
|
|
887
|
-
for (var o in
|
|
888
|
-
var
|
|
889
|
-
|
|
1101
|
+
for (var o in r) {
|
|
1102
|
+
var i = r[o];
|
|
1103
|
+
i && i.d();
|
|
890
1104
|
}
|
|
891
1105
|
}
|
|
892
1106
|
}
|
|
893
1107
|
} else {
|
|
894
|
-
var
|
|
895
|
-
if (
|
|
896
|
-
var
|
|
897
|
-
|
|
1108
|
+
var s = e.__c;
|
|
1109
|
+
if (s) {
|
|
1110
|
+
var l = s.__$u;
|
|
1111
|
+
l && (s.__$u = void 0, l.d());
|
|
898
1112
|
}
|
|
899
1113
|
}
|
|
900
1114
|
t(e);
|
|
901
1115
|
});
|
|
902
|
-
|
|
903
|
-
(
|
|
1116
|
+
q("__h", function(t, e, n, r) {
|
|
1117
|
+
(r < 3 || r === 9) && (e.__$f |= 2), t(e, n, r);
|
|
904
1118
|
});
|
|
905
|
-
|
|
1119
|
+
A.prototype.shouldComponentUpdate = function(t, e) {
|
|
906
1120
|
var n = this.__$u;
|
|
907
1121
|
if (!(n && n.s !== void 0 || 4 & this.__$f) || 3 & this.__$f)
|
|
908
1122
|
return !0;
|
|
909
|
-
for (var
|
|
1123
|
+
for (var r in e)
|
|
910
1124
|
return !0;
|
|
911
1125
|
for (var o in t)
|
|
912
1126
|
if (o !== "__source" && t[o] !== this.props[o])
|
|
913
1127
|
return !0;
|
|
914
|
-
for (var
|
|
915
|
-
if (!(
|
|
1128
|
+
for (var i in this.props)
|
|
1129
|
+
if (!(i in t))
|
|
916
1130
|
return !0;
|
|
917
1131
|
return !1;
|
|
918
1132
|
};
|
|
919
|
-
function
|
|
1133
|
+
function de(t) {
|
|
920
1134
|
return K(function() {
|
|
921
|
-
return
|
|
1135
|
+
return fe(t);
|
|
922
1136
|
}, []);
|
|
923
1137
|
}
|
|
924
|
-
function
|
|
925
|
-
var e =
|
|
926
|
-
return e.current = t,
|
|
927
|
-
return
|
|
1138
|
+
function Le(t) {
|
|
1139
|
+
var e = ge(t);
|
|
1140
|
+
return e.current = t, be.__$f |= 4, K(function() {
|
|
1141
|
+
return Ht(function() {
|
|
928
1142
|
return e.current();
|
|
929
1143
|
});
|
|
930
1144
|
}, []);
|
|
931
1145
|
}
|
|
932
|
-
function
|
|
933
|
-
var e =
|
|
934
|
-
e.current = t,
|
|
1146
|
+
function Kt(t) {
|
|
1147
|
+
var e = ge(t);
|
|
1148
|
+
e.current = t, ue(function() {
|
|
935
1149
|
return ye(function() {
|
|
936
1150
|
return e.current();
|
|
937
1151
|
});
|
|
938
1152
|
}, []);
|
|
939
1153
|
}
|
|
940
|
-
var
|
|
941
|
-
function
|
|
942
|
-
var
|
|
943
|
-
for (
|
|
944
|
-
|
|
945
|
-
var
|
|
946
|
-
if (typeof t == "function" && (
|
|
947
|
-
for (
|
|
948
|
-
|
|
949
|
-
return
|
|
950
|
-
}
|
|
951
|
-
const
|
|
1154
|
+
var Qt = 0;
|
|
1155
|
+
function _(t, e, n, r, o, i) {
|
|
1156
|
+
var s, l, c = {};
|
|
1157
|
+
for (l in e)
|
|
1158
|
+
l == "ref" ? s = e[l] : c[l] = e[l];
|
|
1159
|
+
var p = { type: t, props: c, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Qt, __source: o, __self: i };
|
|
1160
|
+
if (typeof t == "function" && (s = t.defaultProps))
|
|
1161
|
+
for (l in s)
|
|
1162
|
+
c[l] === void 0 && (c[l] = s[l]);
|
|
1163
|
+
return f.vnode && f.vnode(p), p;
|
|
1164
|
+
}
|
|
1165
|
+
const en = () => _("svg", {
|
|
952
1166
|
viewBox: "0 0 1024 1024",
|
|
953
1167
|
version: "1.1",
|
|
954
1168
|
xmlns: "http://www.w3.org/2000/svg",
|
|
955
|
-
children:
|
|
1169
|
+
children: _("path", {
|
|
956
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"
|
|
957
1171
|
})
|
|
958
|
-
}),
|
|
1172
|
+
}), tn = () => _("svg", {
|
|
959
1173
|
className: "icon",
|
|
960
1174
|
viewBox: "0 0 1024 1024",
|
|
961
1175
|
version: "1.1",
|
|
962
1176
|
xmlns: "http://www.w3.org/2000/svg",
|
|
963
|
-
children:
|
|
1177
|
+
children: _("path", {
|
|
964
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"
|
|
965
1179
|
})
|
|
966
|
-
}),
|
|
1180
|
+
}), nn = () => _("svg", {
|
|
967
1181
|
viewBox: "0 0 1024 1024",
|
|
968
1182
|
version: "1.1",
|
|
969
1183
|
xmlns: "http://www.w3.org/2000/svg",
|
|
970
|
-
children:
|
|
1184
|
+
children: _("path", {
|
|
971
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"
|
|
972
1186
|
})
|
|
1187
|
+
}), rn = () => _("svg", {
|
|
1188
|
+
viewBox: "0 0 1024 1024",
|
|
1189
|
+
version: "1.1",
|
|
1190
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1191
|
+
children: _("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
|
+
}), on = () => _("svg", {
|
|
1195
|
+
viewBox: "0 0 1024 1024",
|
|
1196
|
+
version: "1.1",
|
|
1197
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1198
|
+
children: _("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
|
+
}), sn = () => _("svg", {
|
|
1202
|
+
viewBox: "0 0 1024 1024",
|
|
1203
|
+
version: "1.1",
|
|
1204
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1205
|
+
children: _("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 = () => _("svg", {
|
|
1209
|
+
viewBox: "0 0 1024 1024",
|
|
1210
|
+
version: "1.1",
|
|
1211
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1212
|
+
children: _("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 = () => _("svg", {
|
|
1216
|
+
viewBox: "0 0 1024 1024",
|
|
1217
|
+
version: "1.1",
|
|
1218
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1219
|
+
children: _("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
|
+
})
|
|
973
1222
|
});
|
|
974
|
-
const
|
|
1223
|
+
const N = new F("markdown-message"), cn = (t) => {
|
|
975
1224
|
const {
|
|
976
1225
|
message: e,
|
|
977
1226
|
size: n
|
|
978
|
-
} = t,
|
|
979
|
-
|
|
1227
|
+
} = t, r = de(wt()), o = de(null);
|
|
1228
|
+
ue(() => {
|
|
980
1229
|
n >= 0 && o.value && o.value.setMarkdown(e.content);
|
|
981
|
-
}, [e, n]),
|
|
1230
|
+
}, [e, n]), ue(() => {
|
|
982
1231
|
o.value = new Ut({
|
|
983
|
-
id:
|
|
1232
|
+
id: r,
|
|
984
1233
|
value: e.content,
|
|
985
1234
|
editor: {
|
|
986
1235
|
defaultModel: "previewOnly"
|
|
987
1236
|
}
|
|
988
1237
|
});
|
|
989
1238
|
}, []);
|
|
990
|
-
const
|
|
1239
|
+
const i = () => {
|
|
991
1240
|
t.controller.backfill(e);
|
|
1241
|
+
}, s = () => {
|
|
1242
|
+
t.controller.deleteMessage(e);
|
|
1243
|
+
}, l = () => {
|
|
1244
|
+
t.controller.refreshMessage(e);
|
|
1245
|
+
}, c = () => {
|
|
1246
|
+
t.controller.copyMessage(e);
|
|
992
1247
|
};
|
|
993
|
-
return
|
|
994
|
-
className:
|
|
995
|
-
children: [
|
|
996
|
-
className:
|
|
997
|
-
children:
|
|
998
|
-
className:
|
|
999
|
-
children: "AI
|
|
1000
|
-
})
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1248
|
+
return _("div", {
|
|
1249
|
+
className: "".concat(N.b(), " ").concat(N.is("loading", e.state === 20)),
|
|
1250
|
+
children: [_("div", {
|
|
1251
|
+
className: N.b("header"),
|
|
1252
|
+
children: [_("div", {
|
|
1253
|
+
className: N.be("header", "caption"),
|
|
1254
|
+
children: "AI "
|
|
1255
|
+
}), _("div", {
|
|
1256
|
+
className: N.b("header-action-wrapper"),
|
|
1257
|
+
children: [_("div", {
|
|
1258
|
+
className: N.be("header", "action-item"),
|
|
1259
|
+
title: "回填",
|
|
1260
|
+
onClick: i,
|
|
1261
|
+
children: _(tn, {})
|
|
1262
|
+
}), _("div", {
|
|
1263
|
+
className: N.be("header", "action-item"),
|
|
1264
|
+
title: "刷新",
|
|
1265
|
+
onClick: l,
|
|
1266
|
+
children: _(on, {})
|
|
1267
|
+
}), _("div", {
|
|
1268
|
+
className: N.be("header", "action-item"),
|
|
1269
|
+
title: "删除",
|
|
1270
|
+
onClick: s,
|
|
1271
|
+
children: _(rn, {})
|
|
1272
|
+
}), _("div", {
|
|
1273
|
+
className: N.be("header", "action-item"),
|
|
1274
|
+
title: "复制",
|
|
1275
|
+
onClick: c,
|
|
1276
|
+
children: _(sn, {})
|
|
1277
|
+
})]
|
|
1278
|
+
})]
|
|
1279
|
+
}), _("div", {
|
|
1280
|
+
className: N.b("content"),
|
|
1281
|
+
children: _("div", {
|
|
1282
|
+
id: r
|
|
1016
1283
|
})
|
|
1284
|
+
}), _("div", {
|
|
1285
|
+
className: N.b("footer")
|
|
1017
1286
|
})]
|
|
1018
1287
|
});
|
|
1019
1288
|
};
|
|
1020
|
-
const
|
|
1021
|
-
const e =
|
|
1022
|
-
return
|
|
1023
|
-
className:
|
|
1024
|
-
children:
|
|
1025
|
-
className:
|
|
1289
|
+
const Ke = new F("user-message"), un = (t) => {
|
|
1290
|
+
const e = Le(() => t.message.content);
|
|
1291
|
+
return _("div", {
|
|
1292
|
+
className: Ke.b(),
|
|
1293
|
+
children: _("span", {
|
|
1294
|
+
className: Ke.e("content"),
|
|
1026
1295
|
children: e
|
|
1027
1296
|
})
|
|
1028
1297
|
});
|
|
1029
1298
|
};
|
|
1030
|
-
const
|
|
1031
|
-
const e =
|
|
1032
|
-
return
|
|
1033
|
-
className:
|
|
1034
|
-
children:
|
|
1035
|
-
className:
|
|
1299
|
+
const Qe = new F("error-message"), _n = (t) => {
|
|
1300
|
+
const e = Le(() => t.message.content);
|
|
1301
|
+
return _("div", {
|
|
1302
|
+
className: Qe.b(),
|
|
1303
|
+
children: _("span", {
|
|
1304
|
+
className: Qe.e("content"),
|
|
1036
1305
|
children: e
|
|
1037
1306
|
})
|
|
1038
1307
|
});
|
|
1039
1308
|
};
|
|
1040
|
-
const
|
|
1041
|
-
className:
|
|
1042
|
-
children:
|
|
1043
|
-
className:
|
|
1309
|
+
const et = new F("unknown-message"), fn = (t) => _("div", {
|
|
1310
|
+
className: et.b(),
|
|
1311
|
+
children: _("span", {
|
|
1312
|
+
className: et.e("content"),
|
|
1044
1313
|
children: ["暂未支持的消息类型: ", t.message.type]
|
|
1045
1314
|
})
|
|
1046
|
-
}),
|
|
1315
|
+
}), hn = new F("chat-message-item"), dn = (t) => {
|
|
1047
1316
|
const {
|
|
1048
1317
|
message: e,
|
|
1049
1318
|
size: n
|
|
1050
1319
|
} = t;
|
|
1051
|
-
let
|
|
1320
|
+
let r = null;
|
|
1052
1321
|
switch (e.type) {
|
|
1053
1322
|
case "DEFAULT":
|
|
1054
|
-
|
|
1323
|
+
r = e.role === "ASSISTANT" ? cn : un;
|
|
1055
1324
|
break;
|
|
1056
1325
|
case "ERROR":
|
|
1057
|
-
|
|
1326
|
+
r = _n;
|
|
1058
1327
|
break;
|
|
1059
1328
|
default:
|
|
1060
|
-
|
|
1329
|
+
r = fn;
|
|
1061
1330
|
}
|
|
1062
|
-
return
|
|
1063
|
-
className:
|
|
1064
|
-
children: Z(
|
|
1331
|
+
return _("div", {
|
|
1332
|
+
className: hn.b(),
|
|
1333
|
+
children: Z(r, {
|
|
1065
1334
|
size: n,
|
|
1066
1335
|
message: e,
|
|
1067
1336
|
controller: t.controller
|
|
1068
1337
|
})
|
|
1069
1338
|
});
|
|
1070
1339
|
};
|
|
1071
|
-
const
|
|
1072
|
-
const e =
|
|
1073
|
-
return
|
|
1340
|
+
const vn = new F("chat-messages"), pn = (t) => {
|
|
1341
|
+
const e = ge(null), n = t.controller.messages;
|
|
1342
|
+
return Kt(() => {
|
|
1074
1343
|
e.current && n.value.length > 0 && (e.current.scrollTop = e.current.scrollHeight);
|
|
1075
|
-
}),
|
|
1344
|
+
}), _("div", {
|
|
1076
1345
|
ref: e,
|
|
1077
|
-
className:
|
|
1078
|
-
children: n.value.map((
|
|
1079
|
-
var
|
|
1080
|
-
const o = ((
|
|
1081
|
-
return
|
|
1082
|
-
message:
|
|
1346
|
+
className: vn.b(),
|
|
1347
|
+
children: n.value.map((r) => {
|
|
1348
|
+
var i;
|
|
1349
|
+
const o = ((i = r.content) == null ? void 0 : i.length) || 0;
|
|
1350
|
+
return _(dn, {
|
|
1351
|
+
message: r,
|
|
1083
1352
|
size: o,
|
|
1084
1353
|
controller: t.controller
|
|
1085
|
-
},
|
|
1354
|
+
}, r.messageid);
|
|
1086
1355
|
})
|
|
1087
1356
|
});
|
|
1088
1357
|
};
|
|
1089
|
-
function
|
|
1358
|
+
function gn(t, e) {
|
|
1090
1359
|
for (var n in e)
|
|
1091
1360
|
t[n] = e[n];
|
|
1092
1361
|
return t;
|
|
1093
1362
|
}
|
|
1094
|
-
function
|
|
1363
|
+
function tt(t, e) {
|
|
1095
1364
|
for (var n in t)
|
|
1096
1365
|
if (n !== "__source" && !(n in e))
|
|
1097
1366
|
return !0;
|
|
1098
|
-
for (var
|
|
1099
|
-
if (
|
|
1367
|
+
for (var r in e)
|
|
1368
|
+
if (r !== "__source" && t[r] !== e[r])
|
|
1100
1369
|
return !0;
|
|
1101
1370
|
return !1;
|
|
1102
1371
|
}
|
|
1103
|
-
function
|
|
1372
|
+
function nt(t) {
|
|
1104
1373
|
this.props = t;
|
|
1105
1374
|
}
|
|
1106
|
-
(
|
|
1107
|
-
return
|
|
1375
|
+
(nt.prototype = new A()).isPureReactComponent = !0, nt.prototype.shouldComponentUpdate = function(t, e) {
|
|
1376
|
+
return tt(this.props, t) || tt(this.state, e);
|
|
1108
1377
|
};
|
|
1109
|
-
var
|
|
1110
|
-
|
|
1111
|
-
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null),
|
|
1378
|
+
var rt = f.__b;
|
|
1379
|
+
f.__b = function(t) {
|
|
1380
|
+
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), rt && rt(t);
|
|
1112
1381
|
};
|
|
1113
|
-
var
|
|
1114
|
-
|
|
1382
|
+
var mn = f.__e;
|
|
1383
|
+
f.__e = function(t, e, n, r) {
|
|
1115
1384
|
if (t.then) {
|
|
1116
|
-
for (var o,
|
|
1117
|
-
if ((o =
|
|
1385
|
+
for (var o, i = e; i = i.__; )
|
|
1386
|
+
if ((o = i.__c) && o.__c)
|
|
1118
1387
|
return e.__e == null && (e.__e = n.__e, e.__k = n.__k), o.__c(t, e);
|
|
1119
1388
|
}
|
|
1120
|
-
|
|
1389
|
+
mn(t, e, n, r);
|
|
1121
1390
|
};
|
|
1122
|
-
var
|
|
1123
|
-
function
|
|
1124
|
-
return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(
|
|
1125
|
-
typeof
|
|
1126
|
-
}), t.__c.__H = null), (t =
|
|
1127
|
-
return
|
|
1391
|
+
var it = f.unmount;
|
|
1392
|
+
function Pt(t, e, n) {
|
|
1393
|
+
return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(r) {
|
|
1394
|
+
typeof r.__c == "function" && r.__c();
|
|
1395
|
+
}), t.__c.__H = null), (t = gn({}, t)).__c != null && (t.__c.__P === n && (t.__c.__P = e), t.__c = null), t.__k = t.__k && t.__k.map(function(r) {
|
|
1396
|
+
return Pt(r, e, n);
|
|
1128
1397
|
})), t;
|
|
1129
1398
|
}
|
|
1130
|
-
function
|
|
1131
|
-
return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(
|
|
1132
|
-
return
|
|
1399
|
+
function Tt(t, e, n) {
|
|
1400
|
+
return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(r) {
|
|
1401
|
+
return Tt(r, e, n);
|
|
1133
1402
|
}), t.__c && t.__c.__P === e && (t.__e && n.insertBefore(t.__e, t.__d), t.__c.__e = !0, t.__c.__P = n)), t;
|
|
1134
1403
|
}
|
|
1135
|
-
function
|
|
1404
|
+
function Se() {
|
|
1136
1405
|
this.__u = 0, this.t = null, this.__b = null;
|
|
1137
1406
|
}
|
|
1138
|
-
function
|
|
1407
|
+
function Lt(t) {
|
|
1139
1408
|
var e = t.__.__c;
|
|
1140
1409
|
return e && e.__a && e.__a(t);
|
|
1141
1410
|
}
|
|
1142
|
-
function
|
|
1411
|
+
function te() {
|
|
1143
1412
|
this.u = null, this.o = null;
|
|
1144
1413
|
}
|
|
1145
|
-
|
|
1414
|
+
f.unmount = function(t) {
|
|
1146
1415
|
var e = t.__c;
|
|
1147
|
-
e && e.__R && e.__R(), e && t.__h === !0 && (t.type = null),
|
|
1148
|
-
}, (
|
|
1149
|
-
var n = e.__c,
|
|
1150
|
-
|
|
1151
|
-
var o =
|
|
1152
|
-
|
|
1416
|
+
e && e.__R && e.__R(), e && t.__h === !0 && (t.type = null), it && it(t);
|
|
1417
|
+
}, (Se.prototype = new A()).__c = function(t, e) {
|
|
1418
|
+
var n = e.__c, r = this;
|
|
1419
|
+
r.t == null && (r.t = []), r.t.push(n);
|
|
1420
|
+
var o = Lt(r.__v), i = !1, s = function() {
|
|
1421
|
+
i || (i = !0, n.__R = null, o ? o(l) : l());
|
|
1153
1422
|
};
|
|
1154
|
-
n.__R =
|
|
1155
|
-
var
|
|
1156
|
-
if (!--
|
|
1157
|
-
if (
|
|
1158
|
-
var
|
|
1159
|
-
|
|
1423
|
+
n.__R = s;
|
|
1424
|
+
var l = function() {
|
|
1425
|
+
if (!--r.__u) {
|
|
1426
|
+
if (r.state.__a) {
|
|
1427
|
+
var p = r.state.__a;
|
|
1428
|
+
r.__v.__k[0] = Tt(p, p.__c.__P, p.__c.__O);
|
|
1160
1429
|
}
|
|
1161
|
-
var
|
|
1162
|
-
for (
|
|
1163
|
-
|
|
1430
|
+
var h;
|
|
1431
|
+
for (r.setState({ __a: r.__b = null }); h = r.t.pop(); )
|
|
1432
|
+
h.forceUpdate();
|
|
1164
1433
|
}
|
|
1165
|
-
},
|
|
1166
|
-
|
|
1167
|
-
},
|
|
1434
|
+
}, c = e.__h === !0;
|
|
1435
|
+
r.__u++ || c || r.setState({ __a: r.__b = r.__v.__k[0] }), t.then(s, s);
|
|
1436
|
+
}, Se.prototype.componentWillUnmount = function() {
|
|
1168
1437
|
this.t = [];
|
|
1169
|
-
},
|
|
1438
|
+
}, Se.prototype.render = function(t, e) {
|
|
1170
1439
|
if (this.__b) {
|
|
1171
1440
|
if (this.__v.__k) {
|
|
1172
|
-
var n = document.createElement("div"),
|
|
1173
|
-
this.__v.__k[0] =
|
|
1441
|
+
var n = document.createElement("div"), r = this.__v.__k[0].__c;
|
|
1442
|
+
this.__v.__k[0] = Pt(this.__b, n, r.__O = r.__P);
|
|
1174
1443
|
}
|
|
1175
1444
|
this.__b = null;
|
|
1176
1445
|
}
|
|
1177
1446
|
var o = e.__a && Z(I, null, t.fallback);
|
|
1178
1447
|
return o && (o.__h = null), [Z(I, null, e.__a ? null : t.children), o];
|
|
1179
1448
|
};
|
|
1180
|
-
var
|
|
1449
|
+
var ot = function(t, e, n) {
|
|
1181
1450
|
if (++n[1] === n[0] && t.o.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.o.size))
|
|
1182
1451
|
for (n = t.u; n; ) {
|
|
1183
1452
|
for (; n.length > 3; )
|
|
@@ -1187,187 +1456,189 @@ var tt = function(t, e, n) {
|
|
|
1187
1456
|
t.u = n = n[2];
|
|
1188
1457
|
}
|
|
1189
1458
|
};
|
|
1190
|
-
(
|
|
1191
|
-
var e = this, n =
|
|
1192
|
-
return
|
|
1193
|
-
var
|
|
1194
|
-
e.props.revealOrder ? (
|
|
1459
|
+
(te.prototype = new A()).__a = function(t) {
|
|
1460
|
+
var e = this, n = Lt(e.__v), r = e.o.get(t);
|
|
1461
|
+
return r[0]++, function(o) {
|
|
1462
|
+
var i = function() {
|
|
1463
|
+
e.props.revealOrder ? (r.push(o), ot(e, t, r)) : o();
|
|
1195
1464
|
};
|
|
1196
|
-
n ? n(
|
|
1465
|
+
n ? n(i) : i();
|
|
1197
1466
|
};
|
|
1198
|
-
},
|
|
1467
|
+
}, te.prototype.render = function(t) {
|
|
1199
1468
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
1200
|
-
var e =
|
|
1469
|
+
var e = se(t.children);
|
|
1201
1470
|
t.revealOrder && t.revealOrder[0] === "b" && e.reverse();
|
|
1202
1471
|
for (var n = e.length; n--; )
|
|
1203
1472
|
this.o.set(e[n], this.u = [1, 0, this.u]);
|
|
1204
1473
|
return t.children;
|
|
1205
|
-
},
|
|
1474
|
+
}, te.prototype.componentDidUpdate = te.prototype.componentDidMount = function() {
|
|
1206
1475
|
var t = this;
|
|
1207
1476
|
this.o.forEach(function(e, n) {
|
|
1208
|
-
|
|
1477
|
+
ot(t, n, e);
|
|
1209
1478
|
});
|
|
1210
1479
|
};
|
|
1211
|
-
var
|
|
1480
|
+
var yn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, bn = /^(?: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)/, $n = /[A-Z0-9]/g, kn = typeof document < "u", Sn = function(t) {
|
|
1212
1481
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t);
|
|
1213
1482
|
};
|
|
1214
|
-
|
|
1215
|
-
Object.defineProperty(
|
|
1483
|
+
A.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) {
|
|
1484
|
+
Object.defineProperty(A.prototype, t, { configurable: !0, get: function() {
|
|
1216
1485
|
return this["UNSAFE_" + t];
|
|
1217
1486
|
}, set: function(e) {
|
|
1218
1487
|
Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e });
|
|
1219
1488
|
} });
|
|
1220
1489
|
});
|
|
1221
|
-
var
|
|
1222
|
-
function
|
|
1490
|
+
var st = f.event;
|
|
1491
|
+
function Cn() {
|
|
1223
1492
|
}
|
|
1224
|
-
function
|
|
1493
|
+
function xn() {
|
|
1225
1494
|
return this.cancelBubble;
|
|
1226
1495
|
}
|
|
1227
|
-
function
|
|
1496
|
+
function En() {
|
|
1228
1497
|
return this.defaultPrevented;
|
|
1229
1498
|
}
|
|
1230
|
-
|
|
1231
|
-
return
|
|
1499
|
+
f.event = function(t) {
|
|
1500
|
+
return st && (t = st(t)), t.persist = Cn, t.isPropagationStopped = xn, t.isDefaultPrevented = En, t.nativeEvent = t;
|
|
1232
1501
|
};
|
|
1233
|
-
var
|
|
1502
|
+
var Nn = { enumerable: !1, configurable: !0, get: function() {
|
|
1234
1503
|
return this.class;
|
|
1235
|
-
} },
|
|
1236
|
-
|
|
1504
|
+
} }, at = f.vnode;
|
|
1505
|
+
f.vnode = function(t) {
|
|
1237
1506
|
typeof t.type == "string" && function(e) {
|
|
1238
|
-
var n = e.props,
|
|
1239
|
-
for (var
|
|
1240
|
-
var
|
|
1241
|
-
if (!(
|
|
1242
|
-
var
|
|
1243
|
-
|
|
1507
|
+
var n = e.props, r = e.type, o = {};
|
|
1508
|
+
for (var i in n) {
|
|
1509
|
+
var s = n[i];
|
|
1510
|
+
if (!(i === "value" && "defaultValue" in n && s == null || kn && i === "children" && r === "noscript" || i === "class" || i === "className")) {
|
|
1511
|
+
var l = i.toLowerCase();
|
|
1512
|
+
i === "defaultValue" && "value" in n && n.value == null ? i = "value" : i === "download" && s === !0 ? s = "" : l === "ondoubleclick" ? i = "ondblclick" : l !== "onchange" || r !== "input" && r !== "textarea" || Sn(n.type) ? l === "onfocus" ? i = "onfocusin" : l === "onblur" ? i = "onfocusout" : wn.test(i) ? i = l : r.indexOf("-") === -1 && bn.test(i) ? i = i.replace($n, "-$&").toLowerCase() : s === null && (s = void 0) : l = i = "oninput", l === "oninput" && o[i = l] && (i = "oninputCapture"), o[i] = s;
|
|
1244
1513
|
}
|
|
1245
1514
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
})),
|
|
1249
|
-
|
|
1250
|
-
})), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className",
|
|
1251
|
-
}(t), t.$$typeof =
|
|
1515
|
+
r == "select" && o.multiple && Array.isArray(o.value) && (o.value = se(n.children).forEach(function(c) {
|
|
1516
|
+
c.props.selected = o.value.indexOf(c.props.value) != -1;
|
|
1517
|
+
})), r == "select" && o.defaultValue != null && (o.value = se(n.children).forEach(function(c) {
|
|
1518
|
+
c.props.selected = o.multiple ? o.defaultValue.indexOf(c.props.value) != -1 : o.defaultValue == c.props.value;
|
|
1519
|
+
})), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", Nn)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), e.props = o;
|
|
1520
|
+
}(t), t.$$typeof = yn, at && at(t);
|
|
1252
1521
|
};
|
|
1253
|
-
var
|
|
1254
|
-
|
|
1255
|
-
|
|
1522
|
+
var lt = f.__r;
|
|
1523
|
+
f.__r = function(t) {
|
|
1524
|
+
lt && lt(t), t.__c;
|
|
1256
1525
|
};
|
|
1257
|
-
var
|
|
1258
|
-
|
|
1259
|
-
|
|
1526
|
+
var ct = f.diffed;
|
|
1527
|
+
f.diffed = function(t) {
|
|
1528
|
+
ct && ct(t);
|
|
1260
1529
|
var e = t.props, n = t.__e;
|
|
1261
1530
|
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value);
|
|
1262
1531
|
};
|
|
1263
|
-
var
|
|
1264
|
-
function
|
|
1265
|
-
var e =
|
|
1532
|
+
var J = /* @__PURE__ */ new Map();
|
|
1533
|
+
function An(t) {
|
|
1534
|
+
var e = J.get(t);
|
|
1266
1535
|
e && e.destroy();
|
|
1267
1536
|
}
|
|
1268
|
-
function
|
|
1269
|
-
var e =
|
|
1537
|
+
function Hn(t) {
|
|
1538
|
+
var e = J.get(t);
|
|
1270
1539
|
e && e.update();
|
|
1271
1540
|
}
|
|
1272
|
-
var
|
|
1273
|
-
typeof window > "u" ? ((
|
|
1541
|
+
var Y = null;
|
|
1542
|
+
typeof window > "u" ? ((Y = function(t) {
|
|
1274
1543
|
return t;
|
|
1275
1544
|
}).destroy = function(t) {
|
|
1276
1545
|
return t;
|
|
1277
|
-
},
|
|
1546
|
+
}, Y.update = function(t) {
|
|
1278
1547
|
return t;
|
|
1279
|
-
}) : ((
|
|
1548
|
+
}) : ((Y = function(t, e) {
|
|
1280
1549
|
return t && Array.prototype.forEach.call(t.length ? t : [t], function(n) {
|
|
1281
|
-
return function(
|
|
1282
|
-
if (
|
|
1283
|
-
var o,
|
|
1284
|
-
|
|
1285
|
-
}),
|
|
1286
|
-
|
|
1287
|
-
return
|
|
1288
|
-
}),
|
|
1289
|
-
}).bind(
|
|
1290
|
-
|
|
1550
|
+
return function(r) {
|
|
1551
|
+
if (r && r.nodeName && r.nodeName === "TEXTAREA" && !J.has(r)) {
|
|
1552
|
+
var o, i = null, s = window.getComputedStyle(r), l = (o = r.value, function() {
|
|
1553
|
+
p({ testForHeightReduction: o === "" || !r.value.startsWith(o), restoreTextAlign: null }), o = r.value;
|
|
1554
|
+
}), c = (function(a) {
|
|
1555
|
+
r.removeEventListener("autosize:destroy", c), r.removeEventListener("autosize:update", h), r.removeEventListener("input", l), window.removeEventListener("resize", h), Object.keys(a).forEach(function(g) {
|
|
1556
|
+
return r.style[g] = a[g];
|
|
1557
|
+
}), J.delete(r);
|
|
1558
|
+
}).bind(r, { height: r.style.height, resize: r.style.resize, textAlign: r.style.textAlign, overflowY: r.style.overflowY, overflowX: r.style.overflowX, wordWrap: r.style.wordWrap });
|
|
1559
|
+
r.addEventListener("autosize:destroy", c), r.addEventListener("autosize:update", h), r.addEventListener("input", l), window.addEventListener("resize", h), r.style.overflowX = "hidden", r.style.wordWrap = "break-word", J.set(r, { destroy: c, update: h }), h();
|
|
1291
1560
|
}
|
|
1292
|
-
function
|
|
1293
|
-
var
|
|
1294
|
-
if (
|
|
1561
|
+
function p(a) {
|
|
1562
|
+
var g, d, u = a.restoreTextAlign, v = u === void 0 ? null : u, z = a.testForHeightReduction, m = z === void 0 || z, b = s.overflowY;
|
|
1563
|
+
if (r.scrollHeight !== 0 && (s.resize === "vertical" ? r.style.resize = "none" : s.resize === "both" && (r.style.resize = "horizontal"), m && (g = function(w) {
|
|
1295
1564
|
for (var $ = []; w && w.parentNode && w.parentNode instanceof Element; )
|
|
1296
1565
|
w.parentNode.scrollTop && $.push([w.parentNode, w.parentNode.scrollTop]), w = w.parentNode;
|
|
1297
1566
|
return function() {
|
|
1298
|
-
return $.forEach(function(
|
|
1299
|
-
var
|
|
1300
|
-
|
|
1567
|
+
return $.forEach(function(P) {
|
|
1568
|
+
var x = P[0], T = P[1];
|
|
1569
|
+
x.style.scrollBehavior = "auto", x.scrollTop = T, x.style.scrollBehavior = null;
|
|
1301
1570
|
});
|
|
1302
1571
|
};
|
|
1303
|
-
}(
|
|
1304
|
-
var
|
|
1305
|
-
|
|
1572
|
+
}(r), r.style.height = ""), d = s.boxSizing === "content-box" ? r.scrollHeight - (parseFloat(s.paddingTop) + parseFloat(s.paddingBottom)) : r.scrollHeight + parseFloat(s.borderTopWidth) + parseFloat(s.borderBottomWidth), s.maxHeight !== "none" && d > parseFloat(s.maxHeight) ? (s.overflowY === "hidden" && (r.style.overflow = "scroll"), d = parseFloat(s.maxHeight)) : s.overflowY !== "hidden" && (r.style.overflow = "hidden"), r.style.height = d + "px", v && (r.style.textAlign = v), g && g(), i !== d && (r.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), i = d), b !== s.overflow && !v)) {
|
|
1573
|
+
var S = s.textAlign;
|
|
1574
|
+
s.overflow === "hidden" && (r.style.textAlign = S === "start" ? "end" : "start"), p({ restoreTextAlign: S, testForHeightReduction: !0 });
|
|
1306
1575
|
}
|
|
1307
1576
|
}
|
|
1308
|
-
function
|
|
1309
|
-
|
|
1577
|
+
function h() {
|
|
1578
|
+
p({ testForHeightReduction: !0, restoreTextAlign: null });
|
|
1310
1579
|
}
|
|
1311
1580
|
}(n);
|
|
1312
1581
|
}), t;
|
|
1313
1582
|
}).destroy = function(t) {
|
|
1314
|
-
return t && Array.prototype.forEach.call(t.length ? t : [t],
|
|
1315
|
-
},
|
|
1316
|
-
return t && Array.prototype.forEach.call(t.length ? t : [t],
|
|
1583
|
+
return t && Array.prototype.forEach.call(t.length ? t : [t], An), t;
|
|
1584
|
+
}, Y.update = function(t) {
|
|
1585
|
+
return t && Array.prototype.forEach.call(t.length ? t : [t], Hn), t;
|
|
1317
1586
|
});
|
|
1318
|
-
var
|
|
1319
|
-
const
|
|
1320
|
-
const e =
|
|
1321
|
-
n.value =
|
|
1322
|
-
}, [n]),
|
|
1323
|
-
|
|
1324
|
-
e.current &&
|
|
1587
|
+
var ut = Y;
|
|
1588
|
+
const O = new F("chat-input"), Mn = (t) => {
|
|
1589
|
+
const e = ge(null), n = t.controller.input, r = de(!1), o = Ze((c) => {
|
|
1590
|
+
n.value = c.target.value;
|
|
1591
|
+
}, [n]), i = Le(() => n.value.length <= 0 || r.value === !0);
|
|
1592
|
+
ue(() => (e.current && ut(e.current), () => {
|
|
1593
|
+
e.current && ut.destroy(e.current);
|
|
1325
1594
|
}), [e]);
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1595
|
+
const s = Ze(async () => {
|
|
1596
|
+
r.value = !0;
|
|
1328
1597
|
try {
|
|
1329
1598
|
await t.controller.question(n.value), n.value = "";
|
|
1330
|
-
} catch (
|
|
1331
|
-
console.error(
|
|
1599
|
+
} catch (c) {
|
|
1600
|
+
console.error(c);
|
|
1332
1601
|
} finally {
|
|
1333
|
-
|
|
1602
|
+
r.value = !1;
|
|
1334
1603
|
}
|
|
1335
|
-
}, [n,
|
|
1336
|
-
|
|
1604
|
+
}, [n, r]), l = (c) => {
|
|
1605
|
+
c.code === "Enter" && (c.stopPropagation(), c.shiftKey === !1 && s());
|
|
1337
1606
|
};
|
|
1338
|
-
return
|
|
1339
|
-
className:
|
|
1340
|
-
children: [
|
|
1341
|
-
className:
|
|
1607
|
+
return _("div", {
|
|
1608
|
+
className: O.b(),
|
|
1609
|
+
children: [_("textarea", {
|
|
1610
|
+
className: O.e("textarea"),
|
|
1342
1611
|
type: "text",
|
|
1343
1612
|
wrap: "off",
|
|
1613
|
+
rows: 6,
|
|
1344
1614
|
autoCorrect: "off",
|
|
1345
1615
|
autoCapitalize: "off",
|
|
1346
1616
|
autoComplete: "off",
|
|
1347
1617
|
value: n,
|
|
1348
1618
|
onInput: o,
|
|
1349
|
-
onKeyDown:
|
|
1619
|
+
onKeyDown: l,
|
|
1350
1620
|
ref: e,
|
|
1351
|
-
disabled:
|
|
1352
|
-
}),
|
|
1353
|
-
className:
|
|
1354
|
-
children:
|
|
1355
|
-
title:
|
|
1356
|
-
className: "".concat(
|
|
1357
|
-
onClick:
|
|
1358
|
-
disabled:
|
|
1359
|
-
children:
|
|
1621
|
+
disabled: r
|
|
1622
|
+
}), _("div", {
|
|
1623
|
+
className: O.b("action-wrapper"),
|
|
1624
|
+
children: _("div", {
|
|
1625
|
+
title: r ? "思考中..." : "发送消息",
|
|
1626
|
+
className: "".concat(O.be("action-wrapper", "action-item"), " ").concat(O.is("disabled", i.value), " ").concat(O.is("loading", r.value)),
|
|
1627
|
+
onClick: s,
|
|
1628
|
+
disabled: i,
|
|
1629
|
+
children: _(nn, {})
|
|
1360
1630
|
})
|
|
1361
1631
|
})]
|
|
1362
1632
|
});
|
|
1363
1633
|
};
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1634
|
+
var He = /* @__PURE__ */ ((t) => (t.STYLE_CACHE = "ai-chat-style-cache", t))(He || {});
|
|
1635
|
+
class zn extends A {
|
|
1636
|
+
constructor(n) {
|
|
1637
|
+
super(n);
|
|
1638
|
+
H(this, "ns", new F("chat-container"));
|
|
1639
|
+
H(this, "containerRef", Fe());
|
|
1640
|
+
H(this, "dragHandle", Fe());
|
|
1641
|
+
H(this, "data", {
|
|
1371
1642
|
x: window.innerWidth - 600 - 100,
|
|
1372
1643
|
y: 100,
|
|
1373
1644
|
width: 600,
|
|
@@ -1375,63 +1646,59 @@ class wn extends C {
|
|
|
1375
1646
|
minWidth: 300,
|
|
1376
1647
|
minHeight: 300
|
|
1377
1648
|
});
|
|
1649
|
+
this.state = {
|
|
1650
|
+
isFullScreen: !1
|
|
1651
|
+
};
|
|
1378
1652
|
}
|
|
1379
1653
|
calcStyle() {
|
|
1380
1654
|
return {
|
|
1381
|
-
|
|
1382
|
-
top: ""
|
|
1383
|
-
height: ""
|
|
1655
|
+
right: "0px",
|
|
1656
|
+
top: "0px",
|
|
1657
|
+
height: "100vh",
|
|
1384
1658
|
width: "".concat(this.data.width, "px"),
|
|
1385
|
-
"z-index": "
|
|
1659
|
+
"z-index": "1000"
|
|
1386
1660
|
};
|
|
1387
1661
|
}
|
|
1388
1662
|
setStyle() {
|
|
1389
1663
|
Object.assign(this.containerRef.current.style, this.calcStyle());
|
|
1390
1664
|
}
|
|
1391
1665
|
componentDidMount() {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
restriction: document.body,
|
|
1397
|
-
endOnly: !0
|
|
1398
|
-
})],
|
|
1399
|
-
cursorChecker: () => "move",
|
|
1400
|
-
listeners: {
|
|
1401
|
-
move: (i) => {
|
|
1402
|
-
n.x += i.dx, n.y += i.dy, this.setStyle();
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
}), q(this.containerRef.current).resizable({
|
|
1666
|
+
const n = localStorage.getItem(He.STYLE_CACHE);
|
|
1667
|
+
n && (this.data = JSON.parse(n), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
|
|
1668
|
+
const r = this.data;
|
|
1669
|
+
we(this.containerRef.current).resizable({
|
|
1406
1670
|
// 可拖拽的边缘
|
|
1407
1671
|
edges: {
|
|
1408
|
-
top: !
|
|
1672
|
+
top: !1,
|
|
1409
1673
|
right: !0,
|
|
1410
|
-
bottom: !
|
|
1674
|
+
bottom: !1,
|
|
1411
1675
|
left: !0
|
|
1412
1676
|
},
|
|
1413
1677
|
margin: 6,
|
|
1414
1678
|
modifiers: [
|
|
1415
1679
|
// 保持在父对象内部
|
|
1416
|
-
|
|
1680
|
+
we.modifiers.restrictEdges({
|
|
1417
1681
|
outer: document.body
|
|
1418
1682
|
}),
|
|
1419
1683
|
// 缩放最小宽度
|
|
1420
|
-
|
|
1684
|
+
we.modifiers.restrictSize({
|
|
1421
1685
|
min: {
|
|
1422
|
-
width:
|
|
1423
|
-
height:
|
|
1686
|
+
width: r.minWidth,
|
|
1687
|
+
height: r.minHeight
|
|
1424
1688
|
}
|
|
1425
1689
|
})
|
|
1426
1690
|
],
|
|
1427
1691
|
inertia: !0,
|
|
1428
1692
|
listeners: {
|
|
1429
|
-
move: (
|
|
1430
|
-
|
|
1693
|
+
move: (o) => {
|
|
1694
|
+
r.x += o.deltaRect.left, r.y += o.deltaRect.top, r.width = o.rect.width, r.height = o.rect.height, this.setStyle();
|
|
1431
1695
|
}
|
|
1432
1696
|
}
|
|
1433
1697
|
});
|
|
1434
1698
|
}
|
|
1699
|
+
componentWillUnmount() {
|
|
1700
|
+
localStorage.setItem(He.STYLE_CACHE, JSON.stringify(this.data));
|
|
1701
|
+
}
|
|
1435
1702
|
/**
|
|
1436
1703
|
* 关闭聊天窗口
|
|
1437
1704
|
*
|
|
@@ -1441,39 +1708,70 @@ class wn extends C {
|
|
|
1441
1708
|
close() {
|
|
1442
1709
|
this.props.close();
|
|
1443
1710
|
}
|
|
1711
|
+
/**
|
|
1712
|
+
* 全屏
|
|
1713
|
+
*
|
|
1714
|
+
* @author ljx
|
|
1715
|
+
* @date 2024-05-07 15:10:31
|
|
1716
|
+
*/
|
|
1717
|
+
fullScreen() {
|
|
1718
|
+
const n = this.containerRef.current;
|
|
1719
|
+
n && (n.requestFullscreen(), this.setState({
|
|
1720
|
+
isFullScreen: !0
|
|
1721
|
+
}));
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* 关闭全屏
|
|
1725
|
+
*
|
|
1726
|
+
* @author ljx
|
|
1727
|
+
* @date 2024-05-07 15:10:31
|
|
1728
|
+
*/
|
|
1729
|
+
closeFullScreen() {
|
|
1730
|
+
this.state.isFullScreen && (document == null || document.exitFullscreen(), this.setState({
|
|
1731
|
+
isFullScreen: !1
|
|
1732
|
+
}));
|
|
1733
|
+
}
|
|
1444
1734
|
render() {
|
|
1445
|
-
return
|
|
1446
|
-
className: this.ns.b(),
|
|
1735
|
+
return _("div", {
|
|
1736
|
+
className: "\n ".concat(this.ns.b(), "\n ").concat(this.ns.is("full-screen", this.state.isFullScreen)),
|
|
1447
1737
|
ref: this.containerRef,
|
|
1448
|
-
children: [
|
|
1738
|
+
children: [_("div", {
|
|
1449
1739
|
ref: this.dragHandle,
|
|
1450
1740
|
className: this.ns.b("header"),
|
|
1451
|
-
children: [
|
|
1741
|
+
children: [_("div", {
|
|
1452
1742
|
className: this.ns.b("header-caption"),
|
|
1453
1743
|
children: "AIChat"
|
|
1454
|
-
}),
|
|
1744
|
+
}), _("div", {
|
|
1455
1745
|
className: this.ns.b("header-action-wrapper"),
|
|
1456
|
-
children:
|
|
1746
|
+
children: [this.state.isFullScreen ? _("div", {
|
|
1747
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "close-full-screen")),
|
|
1748
|
+
onClick: this.closeFullScreen.bind(this),
|
|
1749
|
+
children: _(ln, {})
|
|
1750
|
+
}) : _("div", {
|
|
1751
|
+
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "full-screen")),
|
|
1752
|
+
onClick: this.fullScreen.bind(this),
|
|
1753
|
+
children: _(an, {})
|
|
1754
|
+
}), _("div", {
|
|
1457
1755
|
className: "".concat(this.ns.be("header-action-wrapper", "action-item"), " ").concat(this.ns.be("header-action-wrapper", "action-close")),
|
|
1458
1756
|
onClick: this.close.bind(this),
|
|
1459
|
-
children:
|
|
1460
|
-
})
|
|
1757
|
+
children: _(en, {})
|
|
1758
|
+
})]
|
|
1461
1759
|
})]
|
|
1462
|
-
}),
|
|
1760
|
+
}), _("div", {
|
|
1463
1761
|
className: this.ns.b("content"),
|
|
1464
|
-
children:
|
|
1762
|
+
children: _(pn, {
|
|
1465
1763
|
controller: this.props.controller
|
|
1466
1764
|
})
|
|
1467
|
-
}),
|
|
1765
|
+
}), _("div", {
|
|
1468
1766
|
className: this.ns.b("footer"),
|
|
1469
|
-
children:
|
|
1767
|
+
children: _(Mn, {
|
|
1470
1768
|
controller: this.props.controller
|
|
1471
1769
|
})
|
|
1472
1770
|
})]
|
|
1473
1771
|
});
|
|
1474
1772
|
}
|
|
1475
1773
|
}
|
|
1476
|
-
class
|
|
1774
|
+
class Ce {
|
|
1477
1775
|
constructor(e) {
|
|
1478
1776
|
this.msg = e;
|
|
1479
1777
|
}
|
|
@@ -1506,7 +1804,7 @@ class ke {
|
|
|
1506
1804
|
e.content || (e.content = ""), this.msg.content += e.content;
|
|
1507
1805
|
}
|
|
1508
1806
|
}
|
|
1509
|
-
class
|
|
1807
|
+
class Pn {
|
|
1510
1808
|
/**
|
|
1511
1809
|
* Creates an instance of AiChatController.
|
|
1512
1810
|
*
|
|
@@ -1522,7 +1820,7 @@ class $n {
|
|
|
1522
1820
|
* @date 2023-10-16 16:10:29
|
|
1523
1821
|
* @type {Signal<ChatMessage[]>}
|
|
1524
1822
|
*/
|
|
1525
|
-
|
|
1823
|
+
H(this, "messages", fe([]));
|
|
1526
1824
|
/**
|
|
1527
1825
|
* 聊天框输入值
|
|
1528
1826
|
*
|
|
@@ -1530,7 +1828,7 @@ class $n {
|
|
|
1530
1828
|
* @date 2023-10-16 15:10:43
|
|
1531
1829
|
* @type {Signal<string>}
|
|
1532
1830
|
*/
|
|
1533
|
-
|
|
1831
|
+
H(this, "input", fe(""));
|
|
1534
1832
|
this.opts = e;
|
|
1535
1833
|
}
|
|
1536
1834
|
/**
|
|
@@ -1551,8 +1849,8 @@ class $n {
|
|
|
1551
1849
|
* @param {IMessage} data
|
|
1552
1850
|
*/
|
|
1553
1851
|
addMessage(e) {
|
|
1554
|
-
const n = this.messages.value.find((
|
|
1555
|
-
n ? (n.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new
|
|
1852
|
+
const n = this.messages.value.find((r) => r.messageid === e.messageid);
|
|
1853
|
+
n ? (n.update(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ce(e)];
|
|
1556
1854
|
}
|
|
1557
1855
|
/**
|
|
1558
1856
|
* 替换已经存在的聊天消息
|
|
@@ -1562,8 +1860,8 @@ class $n {
|
|
|
1562
1860
|
* @param {IChatMessage} data
|
|
1563
1861
|
*/
|
|
1564
1862
|
replaceMessage(e) {
|
|
1565
|
-
const n = this.messages.value.findIndex((
|
|
1566
|
-
n !== -1 ? (this.messages.value[n] = new
|
|
1863
|
+
const n = this.messages.value.findIndex((r) => r.messageid === e.messageid);
|
|
1864
|
+
n !== -1 ? (this.messages.value[n] = new Ce(e), this.messages.value = [...this.messages.value]) : this.messages.value = [...this.messages.value, new Ce(e)];
|
|
1567
1865
|
}
|
|
1568
1866
|
/**
|
|
1569
1867
|
* 提问
|
|
@@ -1575,7 +1873,7 @@ class $n {
|
|
|
1575
1873
|
async question(e) {
|
|
1576
1874
|
this.addMessage({
|
|
1577
1875
|
state: 30,
|
|
1578
|
-
messageid:
|
|
1876
|
+
messageid: wt(),
|
|
1579
1877
|
role: "USER",
|
|
1580
1878
|
type: "DEFAULT",
|
|
1581
1879
|
content: e
|
|
@@ -1591,8 +1889,36 @@ class $n {
|
|
|
1591
1889
|
backfill(e) {
|
|
1592
1890
|
this.opts.action && this.opts.action("backfill", e);
|
|
1593
1891
|
}
|
|
1892
|
+
/**
|
|
1893
|
+
* 删除指定消息
|
|
1894
|
+
*
|
|
1895
|
+
* @param {IChatMessage} message
|
|
1896
|
+
* @memberof AiChatController
|
|
1897
|
+
*/
|
|
1898
|
+
deleteMessage(e) {
|
|
1899
|
+
const n = this.messages.value.findIndex((r) => r.messageid === e.messageid);
|
|
1900
|
+
n !== -1 && (this.messages.value.splice(n, 1), this.messages.value = [...this.messages.value]);
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* 刷新当前消息
|
|
1904
|
+
*
|
|
1905
|
+
* @memberof AiChatController
|
|
1906
|
+
*/
|
|
1907
|
+
async refreshMessage(e) {
|
|
1908
|
+
this.deleteMessage(e), await this.opts.question(this.messages.value.filter((n) => n.type !== "ERROR").map((n) => n._origin));
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* 复制消息
|
|
1912
|
+
*
|
|
1913
|
+
* @param {IChatMessage} message
|
|
1914
|
+
* @memberof AiChatController
|
|
1915
|
+
*/
|
|
1916
|
+
copyMessage(e) {
|
|
1917
|
+
const n = e.content;
|
|
1918
|
+
$t.copy(n);
|
|
1919
|
+
}
|
|
1594
1920
|
}
|
|
1595
|
-
class
|
|
1921
|
+
class Tn {
|
|
1596
1922
|
constructor() {
|
|
1597
1923
|
/**
|
|
1598
1924
|
* 聊天框容器
|
|
@@ -1602,7 +1928,7 @@ class kn {
|
|
|
1602
1928
|
* @protected
|
|
1603
1929
|
* @type {HTMLDivElement}
|
|
1604
1930
|
*/
|
|
1605
|
-
|
|
1931
|
+
H(this, "container");
|
|
1606
1932
|
}
|
|
1607
1933
|
/**
|
|
1608
1934
|
* 创建聊天窗口(会同时显示出来)
|
|
@@ -1611,9 +1937,9 @@ class kn {
|
|
|
1611
1937
|
* @date 2023-10-13 17:10:22
|
|
1612
1938
|
*/
|
|
1613
1939
|
create(e) {
|
|
1614
|
-
this.container = document.createElement("div"), this.container.classList.add("ibiz-ai-chat"), document.body.appendChild(this.container);
|
|
1615
|
-
const n = new
|
|
1616
|
-
return
|
|
1940
|
+
this.close(), this.container = document.createElement("div"), this.container.classList.add("ibiz-ai-chat"), document.body.appendChild(this.container);
|
|
1941
|
+
const n = new Pn(e);
|
|
1942
|
+
return We(Z(zn, {
|
|
1617
1943
|
controller: n,
|
|
1618
1944
|
close: () => {
|
|
1619
1945
|
this.close(), e.closed && e.closed();
|
|
@@ -1645,11 +1971,11 @@ class kn {
|
|
|
1645
1971
|
* @date 2023-10-13 17:10:10
|
|
1646
1972
|
*/
|
|
1647
1973
|
close() {
|
|
1648
|
-
this.container && (
|
|
1974
|
+
this.container && (We(null, this.container), this.container.remove(), this.container = void 0);
|
|
1649
1975
|
}
|
|
1650
1976
|
}
|
|
1651
|
-
const
|
|
1977
|
+
const Un = new Tn();
|
|
1652
1978
|
export {
|
|
1653
|
-
|
|
1654
|
-
|
|
1979
|
+
zn as ChatContainer,
|
|
1980
|
+
Un as chat
|
|
1655
1981
|
};
|