@ibiz-template-plugin/ai-chat 0.0.11 → 0.0.12
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 +431 -425
- 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 +3 -1
- package/dist/types/components/chat-topic-item/chat-topic-item.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var fn = (n, e, t) => e in n ? hn(n, e, { enumerable: !0, configurable: !0, writ
|
|
|
4
4
|
var w = (n, e, t) => (fn(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
5
|
import ze from "interactjs";
|
|
6
6
|
import pn from "cherry-markdown";
|
|
7
|
-
var
|
|
7
|
+
var $e, m, Dt, zt, G, et, Ht, We, Lt, ne = {}, Ot = [], _n = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
|
|
8
8
|
function F(n, e) {
|
|
9
9
|
for (var t in e)
|
|
10
10
|
n[t] = e[t];
|
|
@@ -18,7 +18,7 @@ function I(n, e, t) {
|
|
|
18
18
|
var i, s, o, r = {};
|
|
19
19
|
for (o in e)
|
|
20
20
|
o == "key" ? i = e[o] : o == "ref" ? s = e[o] : r[o] = e[o];
|
|
21
|
-
if (arguments.length > 2 && (r.children = arguments.length > 3 ?
|
|
21
|
+
if (arguments.length > 2 && (r.children = arguments.length > 3 ? $e.call(arguments, 2) : t), typeof n == "function" && n.defaultProps != null)
|
|
22
22
|
for (o in n.defaultProps)
|
|
23
23
|
r[o] === void 0 && (r[o] = n.defaultProps[o]);
|
|
24
24
|
return be(n, r, i, s, null);
|
|
@@ -55,50 +55,50 @@ function Pt(n) {
|
|
|
55
55
|
return Pt(n);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Ve(n) {
|
|
59
59
|
(!n.__d && (n.__d = !0) && G.push(n) && !Te.__r++ || et !== m.debounceRendering) && ((et = m.debounceRendering) || Ht)(Te);
|
|
60
60
|
}
|
|
61
61
|
function Te() {
|
|
62
|
-
var n, e, t, i, s, o, r,
|
|
63
|
-
for (G.sort(
|
|
64
|
-
n.__d && (e = G.length, i = void 0, s = void 0, o = void 0,
|
|
62
|
+
var n, e, t, i, s, o, r, c, u;
|
|
63
|
+
for (G.sort(We); n = G.shift(); )
|
|
64
|
+
n.__d && (e = G.length, i = void 0, s = void 0, o = void 0, c = (r = (t = n).__v).__e, (u = t.__P) && (i = [], s = [], (o = F({}, r)).__v = r.__v + 1, Ze(u, r, o, t.__n, u.ownerSVGElement !== void 0, r.__h != null ? [c] : null, i, c == null ? fe(r) : c, r.__h, s), Wt(i, r, s), r.__e != c && Pt(r)), G.length > e && G.sort(We));
|
|
65
65
|
Te.__r = 0;
|
|
66
66
|
}
|
|
67
|
-
function Bt(n, e, t, i, s, o, r,
|
|
68
|
-
var
|
|
69
|
-
for (t.__k = [],
|
|
70
|
-
(h = t.__k[
|
|
71
|
-
for (t.__e =
|
|
72
|
-
E[
|
|
67
|
+
function Bt(n, e, t, i, s, o, r, c, u, f, d) {
|
|
68
|
+
var a, _, v, h, p, g, b, C, $, T = 0, E = i && i.__k || Ot, R = E.length, D = R, P = e.length;
|
|
69
|
+
for (t.__k = [], a = 0; a < P; a++)
|
|
70
|
+
(h = t.__k[a] = (h = e[a]) == null || typeof h == "boolean" || typeof h == "function" ? null : typeof h == "string" || typeof h == "number" || typeof h == "bigint" ? be(null, h, null, null, h) : ke(h) ? be(se, { children: h }, null, null, null) : h.__b > 0 ? be(h.type, h.props, h.key, h.ref ? h.ref : null, h.__v) : h) != null ? (h.__ = t, h.__b = t.__b + 1, (C = vn(h, E, b = a + T, D)) === -1 ? v = ne : (v = E[C] || ne, E[C] = void 0, D--), Ze(n, h, v, s, o, r, c, u, f, d), p = h.__e, (_ = h.ref) && v.ref != _ && (v.ref && Ge(v.ref, null, h), d.push(_, h.__c || p, h)), p != null && (g == null && (g = p), ($ = v === ne || v.__v === null) ? C == -1 && T-- : C !== b && (C === b + 1 ? T++ : C > b ? D > P - b ? T += C - b : T-- : T = C < b && C == b - 1 ? C - b : 0), b = a + T, typeof h.type != "function" || C === b && v.__k !== h.__k ? typeof h.type == "function" || C === b && !$ ? h.__d !== void 0 ? (u = h.__d, h.__d = void 0) : u = p.nextSibling : u = Ft(n, p, u) : u = Ut(h, u, n), typeof t.type == "function" && (t.__d = u))) : (v = E[a]) && v.key == null && v.__e && (v.__e == u && (v.__ = i, u = fe(v)), qe(v, v, !1), E[a] = null);
|
|
71
|
+
for (t.__e = g, a = R; a--; )
|
|
72
|
+
E[a] != null && (typeof t.type == "function" && E[a].__e != null && E[a].__e == t.__d && (t.__d = E[a].__e.nextSibling), qe(E[a], E[a]));
|
|
73
73
|
}
|
|
74
74
|
function Ut(n, e, t) {
|
|
75
75
|
for (var i, s = n.__k, o = 0; s && o < s.length; o++)
|
|
76
76
|
(i = s[o]) && (i.__ = n, e = typeof i.type == "function" ? Ut(i, e, t) : Ft(t, i.__e, e));
|
|
77
77
|
return e;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function xe(n, e) {
|
|
80
80
|
return e = e || [], n == null || typeof n == "boolean" || (ke(n) ? n.some(function(t) {
|
|
81
|
-
|
|
81
|
+
xe(t, e);
|
|
82
82
|
}) : e.push(n)), e;
|
|
83
83
|
}
|
|
84
84
|
function Ft(n, e, t) {
|
|
85
85
|
return t == null || t.parentNode !== n ? n.insertBefore(e, null) : e == t && e.parentNode != null || n.insertBefore(e, t), e.nextSibling;
|
|
86
86
|
}
|
|
87
87
|
function vn(n, e, t, i) {
|
|
88
|
-
var s = n.key, o = n.type, r = t - 1,
|
|
88
|
+
var s = n.key, o = n.type, r = t - 1, c = t + 1, u = e[t];
|
|
89
89
|
if (u === null || u && s == u.key && o === u.type)
|
|
90
90
|
return t;
|
|
91
91
|
if (i > (u != null ? 1 : 0))
|
|
92
|
-
for (; r >= 0 ||
|
|
92
|
+
for (; r >= 0 || c < e.length; ) {
|
|
93
93
|
if (r >= 0) {
|
|
94
94
|
if ((u = e[r]) && s == u.key && o === u.type)
|
|
95
95
|
return r;
|
|
96
96
|
r--;
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
99
|
-
if ((u = e[
|
|
100
|
-
return
|
|
101
|
-
|
|
98
|
+
if (c < e.length) {
|
|
99
|
+
if ((u = e[c]) && s == u.key && o === u.type)
|
|
100
|
+
return c;
|
|
101
|
+
c++;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return -1;
|
|
@@ -106,14 +106,14 @@ function vn(n, e, t, i) {
|
|
|
106
106
|
function mn(n, e, t, i, s) {
|
|
107
107
|
var o;
|
|
108
108
|
for (o in t)
|
|
109
|
-
o === "children" || o === "key" || o in e ||
|
|
109
|
+
o === "children" || o === "key" || o in e || Se(n, o, null, t[o], i);
|
|
110
110
|
for (o in e)
|
|
111
|
-
s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] ||
|
|
111
|
+
s && typeof e[o] != "function" || o === "children" || o === "key" || o === "value" || o === "checked" || t[o] === e[o] || Se(n, o, e[o], t[o], i);
|
|
112
112
|
}
|
|
113
113
|
function tt(n, e, t) {
|
|
114
114
|
e[0] === "-" ? n.setProperty(e, t == null ? "" : t) : n[e] = t == null ? "" : typeof t != "number" || _n.test(e) ? t : t + "px";
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Se(n, e, t, i, s) {
|
|
117
117
|
var o;
|
|
118
118
|
e:
|
|
119
119
|
if (e === "style")
|
|
@@ -153,46 +153,46 @@ function nt(n) {
|
|
|
153
153
|
function it(n) {
|
|
154
154
|
return this.l[n.type + !0](m.event ? m.event(n) : n);
|
|
155
155
|
}
|
|
156
|
-
function Ze(n, e, t, i, s, o, r,
|
|
157
|
-
var d,
|
|
156
|
+
function Ze(n, e, t, i, s, o, r, c, u, f) {
|
|
157
|
+
var d, a, _, v, h, p, g, b, C, $, T, E, R, D, P, z = e.type;
|
|
158
158
|
if (e.constructor !== void 0)
|
|
159
159
|
return null;
|
|
160
|
-
t.__h != null && (u = t.__h,
|
|
160
|
+
t.__h != null && (u = t.__h, c = e.__e = t.__e, e.__h = null, o = [c]), (d = m.__b) && d(e);
|
|
161
161
|
e:
|
|
162
162
|
if (typeof z == "function")
|
|
163
163
|
try {
|
|
164
|
-
if (b = e.props, C = (d = z.contextType) && i[d.__c],
|
|
165
|
-
z.getDerivedStateFromProps == null &&
|
|
164
|
+
if (b = e.props, C = (d = z.contextType) && i[d.__c], $ = d ? C ? C.props.value : d.__ : i, t.__c ? g = (a = e.__c = t.__c).__ = a.__E : ("prototype" in z && z.prototype.render ? e.__c = a = new z(b, $) : (e.__c = a = new H(b, $), a.constructor = z, a.render = yn), C && C.sub(a), a.props = b, a.state || (a.state = {}), a.context = $, a.__n = i, _ = a.__d = !0, a.__h = [], a._sb = []), a.__s == null && (a.__s = a.state), z.getDerivedStateFromProps != null && (a.__s == a.state && (a.__s = F({}, a.__s)), F(a.__s, z.getDerivedStateFromProps(b, a.__s))), v = a.props, h = a.state, a.__v = e, _)
|
|
165
|
+
z.getDerivedStateFromProps == null && a.componentWillMount != null && a.componentWillMount(), a.componentDidMount != null && a.__h.push(a.componentDidMount);
|
|
166
166
|
else {
|
|
167
|
-
if (z.getDerivedStateFromProps == null && b !== v &&
|
|
168
|
-
for (e.__v !== t.__v && (
|
|
167
|
+
if (z.getDerivedStateFromProps == null && b !== v && a.componentWillReceiveProps != null && a.componentWillReceiveProps(b, $), !a.__e && (a.shouldComponentUpdate != null && a.shouldComponentUpdate(b, a.__s, $) === !1 || e.__v === t.__v)) {
|
|
168
|
+
for (e.__v !== t.__v && (a.props = b, a.state = a.__s, a.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(ve) {
|
|
169
169
|
ve && (ve.__ = e);
|
|
170
|
-
}), T = 0; T <
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
}), T = 0; T < a._sb.length; T++)
|
|
171
|
+
a.__h.push(a._sb[T]);
|
|
172
|
+
a._sb = [], a.__h.length && r.push(a);
|
|
173
173
|
break e;
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
a.componentWillUpdate != null && a.componentWillUpdate(b, a.__s, $), a.componentDidUpdate != null && a.__h.push(function() {
|
|
176
|
+
a.componentDidUpdate(v, h, p);
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
if (
|
|
180
|
-
for (
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
if (a.context = $, a.props = b, a.__P = n, a.__e = !1, E = m.__r, R = 0, "prototype" in z && z.prototype.render) {
|
|
180
|
+
for (a.state = a.__s, a.__d = !1, E && E(e), d = a.render(a.props, a.state, a.context), D = 0; D < a._sb.length; D++)
|
|
181
|
+
a.__h.push(a._sb[D]);
|
|
182
|
+
a._sb = [];
|
|
183
183
|
} else
|
|
184
184
|
do
|
|
185
|
-
|
|
186
|
-
while (
|
|
187
|
-
|
|
185
|
+
a.__d = !1, E && E(e), d = a.render(a.props, a.state, a.context), a.state = a.__s;
|
|
186
|
+
while (a.__d && ++R < 25);
|
|
187
|
+
a.state = a.__s, a.getChildContext != null && (i = F(F({}, i), a.getChildContext())), _ || a.getSnapshotBeforeUpdate == null || (p = a.getSnapshotBeforeUpdate(v, h)), Bt(n, ke(P = d != null && d.type === se && d.key == null ? d.props.children : d) ? P : [P], e, t, i, s, o, r, c, u, f), a.base = e.__e, e.__h = null, a.__h.length && r.push(a), g && (a.__E = a.__ = null);
|
|
188
188
|
} catch (ve) {
|
|
189
|
-
e.__v = null, (u || o != null) && (e.__e =
|
|
189
|
+
e.__v = null, (u || o != null) && (e.__e = c, e.__h = !!u, o[o.indexOf(c)] = null), m.__e(ve, e, t);
|
|
190
190
|
}
|
|
191
191
|
else
|
|
192
192
|
o == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = gn(t.__e, e, t, i, s, o, r, u, f);
|
|
193
193
|
(d = m.diffed) && d(e);
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function Wt(n, e, t) {
|
|
196
196
|
for (var i = 0; i < t.length; i++)
|
|
197
197
|
Ge(t[i], t[++i], t[++i]);
|
|
198
198
|
m.__c && m.__c(e, n), n.some(function(s) {
|
|
@@ -205,8 +205,8 @@ function Vt(n, e, t) {
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function gn(n, e, t, i, s, o, r,
|
|
209
|
-
var f, d,
|
|
208
|
+
function gn(n, e, t, i, s, o, r, c, u) {
|
|
209
|
+
var f, d, a, _ = t.props, v = e.props, h = e.type, p = 0;
|
|
210
210
|
if (h === "svg" && (s = !0), o != null) {
|
|
211
211
|
for (; p < o.length; p++)
|
|
212
212
|
if ((f = o[p]) && "setAttribute" in f == !!h && (h ? f.localName === h : f.nodeType === 3)) {
|
|
@@ -217,23 +217,23 @@ function gn(n, e, t, i, s, o, r, a, u) {
|
|
|
217
217
|
if (n == null) {
|
|
218
218
|
if (h === null)
|
|
219
219
|
return document.createTextNode(v);
|
|
220
|
-
n = s ? document.createElementNS("http://www.w3.org/2000/svg", h) : document.createElement(h, v.is && v), o = null,
|
|
220
|
+
n = s ? document.createElementNS("http://www.w3.org/2000/svg", h) : document.createElement(h, v.is && v), o = null, c = !1;
|
|
221
221
|
}
|
|
222
222
|
if (h === null)
|
|
223
|
-
_ === v ||
|
|
223
|
+
_ === v || c && n.data === v || (n.data = v);
|
|
224
224
|
else {
|
|
225
|
-
if (o = o &&
|
|
225
|
+
if (o = o && $e.call(n.childNodes), d = (_ = t.props || ne).dangerouslySetInnerHTML, a = v.dangerouslySetInnerHTML, !c) {
|
|
226
226
|
if (o != null)
|
|
227
227
|
for (_ = {}, p = 0; p < n.attributes.length; p++)
|
|
228
228
|
_[n.attributes[p].name] = n.attributes[p].value;
|
|
229
|
-
(
|
|
229
|
+
(a || d) && (a && (d && a.__html == d.__html || a.__html === n.innerHTML) || (n.innerHTML = a && a.__html || ""));
|
|
230
230
|
}
|
|
231
|
-
if (mn(n, v, _, s,
|
|
231
|
+
if (mn(n, v, _, s, c), a)
|
|
232
232
|
e.__k = [];
|
|
233
|
-
else if (Bt(n, ke(p = e.props.children) ? p : [p], e, t, i, s && h !== "foreignObject", o, r, o ? o[0] : t.__k && fe(t, 0),
|
|
233
|
+
else if (Bt(n, ke(p = e.props.children) ? p : [p], e, t, i, s && h !== "foreignObject", o, r, o ? o[0] : t.__k && fe(t, 0), c, u), o != null)
|
|
234
234
|
for (p = o.length; p--; )
|
|
235
235
|
o[p] != null && Rt(o[p]);
|
|
236
|
-
|
|
236
|
+
c || ("value" in v && (p = v.value) !== void 0 && (p !== n.value || h === "progress" && !p || h === "option" && p !== _.value) && Se(n, "value", p, _.value, !1), "checked" in v && (p = v.checked) !== void 0 && p !== n.checked && Se(n, "checked", p, _.checked, !1));
|
|
237
237
|
}
|
|
238
238
|
return n;
|
|
239
239
|
}
|
|
@@ -244,7 +244,7 @@ function Ge(n, e, t) {
|
|
|
244
244
|
m.__e(i, t);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function qe(n, e, t) {
|
|
248
248
|
var i, s;
|
|
249
249
|
if (m.unmount && m.unmount(n), (i = n.ref) && (i.current && i.current !== n.__e || Ge(i, null, e)), (i = n.__c) != null) {
|
|
250
250
|
if (i.componentWillUnmount)
|
|
@@ -257,7 +257,7 @@ function We(n, e, t) {
|
|
|
257
257
|
}
|
|
258
258
|
if (i = n.__k)
|
|
259
259
|
for (s = 0; s < i.length; s++)
|
|
260
|
-
i[s] &&
|
|
260
|
+
i[s] && qe(i[s], e, t || typeof n.type != "function");
|
|
261
261
|
t || n.__e == null || Rt(n.__e), n.__ = n.__e = n.__d = void 0;
|
|
262
262
|
}
|
|
263
263
|
function yn(n, e, t) {
|
|
@@ -265,7 +265,7 @@ function yn(n, e, t) {
|
|
|
265
265
|
}
|
|
266
266
|
function te(n, e, t) {
|
|
267
267
|
var i, s, o, r;
|
|
268
|
-
m.__ && m.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Ze(e, n = (!i && t || e).__k = I(se, null, [n]), s || ne, ne, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ?
|
|
268
|
+
m.__ && m.__(n, e), s = (i = typeof t == "function") ? null : t && t.__k || e.__k, o = [], r = [], Ze(e, n = (!i && t || e).__k = I(se, null, [n]), s || ne, ne, e.ownerSVGElement !== void 0, !i && t ? [t] : s ? null : e.firstChild ? $e.call(e.childNodes) : null, o, !i && t ? t : s ? s.__e : e.firstChild, i, r), Wt(o, n, r);
|
|
269
269
|
}
|
|
270
270
|
function bn(n, e) {
|
|
271
271
|
var t = { __c: e = "__cC" + Lt++, __: n, Consumer: function(i, s) {
|
|
@@ -275,37 +275,37 @@ function bn(n, e) {
|
|
|
275
275
|
return this.getChildContext || (s = [], (o = {})[e] = this, this.getChildContext = function() {
|
|
276
276
|
return o;
|
|
277
277
|
}, this.shouldComponentUpdate = function(r) {
|
|
278
|
-
this.props.value !== r.value && s.some(function(
|
|
279
|
-
|
|
278
|
+
this.props.value !== r.value && s.some(function(c) {
|
|
279
|
+
c.__e = !0, Ve(c);
|
|
280
280
|
});
|
|
281
281
|
}, this.sub = function(r) {
|
|
282
282
|
s.push(r);
|
|
283
|
-
var
|
|
283
|
+
var c = r.componentWillUnmount;
|
|
284
284
|
r.componentWillUnmount = function() {
|
|
285
|
-
s.splice(s.indexOf(r), 1),
|
|
285
|
+
s.splice(s.indexOf(r), 1), c && c.call(r);
|
|
286
286
|
};
|
|
287
287
|
}), i.children;
|
|
288
288
|
} };
|
|
289
289
|
return t.Provider.__ = t.Consumer.contextType = t;
|
|
290
290
|
}
|
|
291
|
-
|
|
291
|
+
$e = Ot.slice, m = { __e: function(n, e, t, i) {
|
|
292
292
|
for (var s, o, r; e = e.__; )
|
|
293
293
|
if ((s = e.__c) && !s.__)
|
|
294
294
|
try {
|
|
295
295
|
if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(n)), r = s.__d), s.componentDidCatch != null && (s.componentDidCatch(n, i || {}), r = s.__d), r)
|
|
296
296
|
return s.__E = s;
|
|
297
|
-
} catch (
|
|
298
|
-
n =
|
|
297
|
+
} catch (c) {
|
|
298
|
+
n = c;
|
|
299
299
|
}
|
|
300
300
|
throw n;
|
|
301
301
|
} }, Dt = 0, zt = function(n) {
|
|
302
302
|
return n != null && n.constructor === void 0;
|
|
303
303
|
}, H.prototype.setState = function(n, e) {
|
|
304
304
|
var t;
|
|
305
|
-
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = F({}, this.state), typeof n == "function" && (n = n(F({}, t), this.props)), n && F(t, n), n != null && this.__v && (e && this._sb.push(e),
|
|
305
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = F({}, this.state), typeof n == "function" && (n = n(F({}, t), this.props)), n && F(t, n), n != null && this.__v && (e && this._sb.push(e), Ve(this));
|
|
306
306
|
}, H.prototype.forceUpdate = function(n) {
|
|
307
|
-
this.__v && (this.__e = !0, n && this.__h.push(n),
|
|
308
|
-
}, H.prototype.render = se, G = [], Ht = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout,
|
|
307
|
+
this.__v && (this.__e = !0, n && this.__h.push(n), Ve(this));
|
|
308
|
+
}, H.prototype.render = se, G = [], Ht = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, We = function(n, e) {
|
|
309
309
|
return n.__v.__b - e.__v.__b;
|
|
310
310
|
}, Te.__r = 0, Lt = 0;
|
|
311
311
|
const wn = "ibiz", Cn = "is-";
|
|
@@ -487,33 +487,33 @@ function L(n) {
|
|
|
487
487
|
throw new TypeError("Path must be a string. Received " + JSON.stringify(n));
|
|
488
488
|
}
|
|
489
489
|
function st(n, e) {
|
|
490
|
-
for (var t = "", i = 0, s = -1, o = 0, r,
|
|
491
|
-
if (
|
|
492
|
-
r = n.charCodeAt(
|
|
490
|
+
for (var t = "", i = 0, s = -1, o = 0, r, c = 0; c <= n.length; ++c) {
|
|
491
|
+
if (c < n.length)
|
|
492
|
+
r = n.charCodeAt(c);
|
|
493
493
|
else {
|
|
494
494
|
if (r === 47)
|
|
495
495
|
break;
|
|
496
496
|
r = 47;
|
|
497
497
|
}
|
|
498
498
|
if (r === 47) {
|
|
499
|
-
if (!(s ===
|
|
500
|
-
if (s !==
|
|
499
|
+
if (!(s === c - 1 || o === 1))
|
|
500
|
+
if (s !== c - 1 && o === 2) {
|
|
501
501
|
if (t.length < 2 || i !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
|
|
502
502
|
if (t.length > 2) {
|
|
503
503
|
var u = t.lastIndexOf("/");
|
|
504
504
|
if (u !== t.length - 1) {
|
|
505
|
-
u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s =
|
|
505
|
+
u === -1 ? (t = "", i = 0) : (t = t.slice(0, u), i = t.length - 1 - t.lastIndexOf("/")), s = c, o = 0;
|
|
506
506
|
continue;
|
|
507
507
|
}
|
|
508
508
|
} else if (t.length === 2 || t.length === 1) {
|
|
509
|
-
t = "", i = 0, s =
|
|
509
|
+
t = "", i = 0, s = c, o = 0;
|
|
510
510
|
continue;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
513
|
e && (t.length > 0 ? t += "/.." : t = "..", i = 2);
|
|
514
514
|
} else
|
|
515
|
-
t.length > 0 ? t += "/" + n.slice(s + 1,
|
|
516
|
-
s =
|
|
515
|
+
t.length > 0 ? t += "/" + n.slice(s + 1, c) : t = n.slice(s + 1, c), i = c - s - 1;
|
|
516
|
+
s = c, o = 0;
|
|
517
517
|
} else
|
|
518
518
|
r === 46 && o !== -1 ? ++o : o = -1;
|
|
519
519
|
}
|
|
@@ -557,25 +557,25 @@ var ue = {
|
|
|
557
557
|
;
|
|
558
558
|
for (var s = e.length, o = s - i, r = 1; r < t.length && t.charCodeAt(r) === 47; ++r)
|
|
559
559
|
;
|
|
560
|
-
for (var
|
|
561
|
-
if (
|
|
560
|
+
for (var c = t.length, u = c - r, f = o < u ? o : u, d = -1, a = 0; a <= f; ++a) {
|
|
561
|
+
if (a === f) {
|
|
562
562
|
if (u > f) {
|
|
563
|
-
if (t.charCodeAt(r +
|
|
564
|
-
return t.slice(r +
|
|
565
|
-
if (
|
|
566
|
-
return t.slice(r +
|
|
563
|
+
if (t.charCodeAt(r + a) === 47)
|
|
564
|
+
return t.slice(r + a + 1);
|
|
565
|
+
if (a === 0)
|
|
566
|
+
return t.slice(r + a);
|
|
567
567
|
} else
|
|
568
|
-
o > f && (e.charCodeAt(i +
|
|
568
|
+
o > f && (e.charCodeAt(i + a) === 47 ? d = a : a === 0 && (d = 0));
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
|
-
var _ = e.charCodeAt(i +
|
|
571
|
+
var _ = e.charCodeAt(i + a), v = t.charCodeAt(r + a);
|
|
572
572
|
if (_ !== v)
|
|
573
573
|
break;
|
|
574
|
-
_ === 47 && (d =
|
|
574
|
+
_ === 47 && (d = a);
|
|
575
575
|
}
|
|
576
576
|
var h = "";
|
|
577
|
-
for (
|
|
578
|
-
(
|
|
577
|
+
for (a = i + d + 1; a <= s; ++a)
|
|
578
|
+
(a === s || e.charCodeAt(a) === 47) && (h.length === 0 ? h += ".." : h += "/..");
|
|
579
579
|
return h.length > 0 ? h + t.slice(r + d) : (r += d, t.charCodeAt(r) === 47 && ++r, t.slice(r));
|
|
580
580
|
},
|
|
581
581
|
_makeLong: function(e) {
|
|
@@ -602,7 +602,7 @@ var ue = {
|
|
|
602
602
|
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
603
603
|
if (t.length === e.length && t === e)
|
|
604
604
|
return "";
|
|
605
|
-
var
|
|
605
|
+
var c = t.length - 1, u = -1;
|
|
606
606
|
for (r = e.length - 1; r >= 0; --r) {
|
|
607
607
|
var f = e.charCodeAt(r);
|
|
608
608
|
if (f === 47) {
|
|
@@ -611,7 +611,7 @@ var ue = {
|
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
613
|
} else
|
|
614
|
-
u === -1 && (o = !1, u = r + 1),
|
|
614
|
+
u === -1 && (o = !1, u = r + 1), c >= 0 && (f === t.charCodeAt(c) ? --c === -1 && (s = r) : (c = -1, s = u));
|
|
615
615
|
}
|
|
616
616
|
return i === s ? s = u : s === -1 && (s = e.length), e.slice(i, s);
|
|
617
617
|
} else {
|
|
@@ -628,16 +628,16 @@ var ue = {
|
|
|
628
628
|
},
|
|
629
629
|
extname: function(e) {
|
|
630
630
|
L(e);
|
|
631
|
-
for (var t = -1, i = 0, s = -1, o = !0, r = 0,
|
|
632
|
-
var u = e.charCodeAt(
|
|
631
|
+
for (var t = -1, i = 0, s = -1, o = !0, r = 0, c = e.length - 1; c >= 0; --c) {
|
|
632
|
+
var u = e.charCodeAt(c);
|
|
633
633
|
if (u === 47) {
|
|
634
634
|
if (!o) {
|
|
635
|
-
i =
|
|
635
|
+
i = c + 1;
|
|
636
636
|
break;
|
|
637
637
|
}
|
|
638
638
|
continue;
|
|
639
639
|
}
|
|
640
|
-
s === -1 && (o = !1, s =
|
|
640
|
+
s === -1 && (o = !1, s = c + 1), u === 46 ? t === -1 ? t = c : r !== 1 && (r = 1) : t !== -1 && (r = -1);
|
|
641
641
|
}
|
|
642
642
|
return t === -1 || s === -1 || // We saw a non-dot character immediately before the dot
|
|
643
643
|
r === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
@@ -655,19 +655,19 @@ var ue = {
|
|
|
655
655
|
return t;
|
|
656
656
|
var i = e.charCodeAt(0), s = i === 47, o;
|
|
657
657
|
s ? (t.root = "/", o = 1) : o = 0;
|
|
658
|
-
for (var r = -1,
|
|
658
|
+
for (var r = -1, c = 0, u = -1, f = !0, d = e.length - 1, a = 0; d >= o; --d) {
|
|
659
659
|
if (i = e.charCodeAt(d), i === 47) {
|
|
660
660
|
if (!f) {
|
|
661
|
-
|
|
661
|
+
c = d + 1;
|
|
662
662
|
break;
|
|
663
663
|
}
|
|
664
664
|
continue;
|
|
665
665
|
}
|
|
666
|
-
u === -1 && (f = !1, u = d + 1), i === 46 ? r === -1 ? r = d :
|
|
666
|
+
u === -1 && (f = !1, u = d + 1), i === 46 ? r === -1 ? r = d : a !== 1 && (a = 1) : r !== -1 && (a = -1);
|
|
667
667
|
}
|
|
668
668
|
return r === -1 || u === -1 || // We saw a non-dot character immediately before the dot
|
|
669
|
-
|
|
670
|
-
|
|
669
|
+
a === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
670
|
+
a === 1 && r === u - 1 && r === c + 1 ? u !== -1 && (c === 0 && s ? t.base = t.name = e.slice(1, u) : t.base = t.name = e.slice(c, u)) : (c === 0 && s ? (t.name = e.slice(1, r), t.base = e.slice(1, u)) : (t.name = e.slice(c, r), t.base = e.slice(c, u)), t.ext = e.slice(r, u)), c > 0 ? t.dir = e.slice(0, c - 1) : s && (t.dir = "/"), t;
|
|
671
671
|
},
|
|
672
672
|
sep: "/",
|
|
673
673
|
delimiter: ":",
|
|
@@ -678,10 +678,10 @@ ue.posix = ue;
|
|
|
678
678
|
function B() {
|
|
679
679
|
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function Vt() {
|
|
682
682
|
return "".concat(B() + B(), "-").concat(B(), "-").concat(B(), "-").concat(B(), "-").concat(B()).concat(B()).concat(B());
|
|
683
683
|
}
|
|
684
|
-
class
|
|
684
|
+
class qt {
|
|
685
685
|
/**
|
|
686
686
|
* 拷贝文本
|
|
687
687
|
*
|
|
@@ -702,8 +702,8 @@ class Wt {
|
|
|
702
702
|
* @private
|
|
703
703
|
* @type {(HTMLInputElement | null)}
|
|
704
704
|
*/
|
|
705
|
-
w(
|
|
706
|
-
const
|
|
705
|
+
w(qt, "inputElement", null);
|
|
706
|
+
const y = class y {
|
|
707
707
|
/**
|
|
708
708
|
* 检查数据库是否存在
|
|
709
709
|
*
|
|
@@ -726,7 +726,7 @@ const g = class g {
|
|
|
726
726
|
*/
|
|
727
727
|
static async deleteDatabase(e) {
|
|
728
728
|
var t, i;
|
|
729
|
-
return
|
|
729
|
+
return y.lastLink && ((i = (t = y.lastLink).close) == null || i.call(t)), new Promise((s, o) => {
|
|
730
730
|
const r = indexedDB.deleteDatabase(e);
|
|
731
731
|
r.onsuccess = () => {
|
|
732
732
|
s(!0);
|
|
@@ -746,16 +746,16 @@ const g = class g {
|
|
|
746
746
|
* @memberof IndexedDBUtil
|
|
747
747
|
*/
|
|
748
748
|
static async checkTableExists(e, t) {
|
|
749
|
-
return await
|
|
749
|
+
return await y.checkDataBaseExists(e) ? new Promise((s, o) => {
|
|
750
750
|
const r = indexedDB.open(e);
|
|
751
|
-
r.onupgradeneeded = (
|
|
752
|
-
|
|
753
|
-
}, r.onsuccess = (
|
|
754
|
-
|
|
755
|
-
const u =
|
|
751
|
+
r.onupgradeneeded = (c) => {
|
|
752
|
+
y.db = c.target.result, y.version = y.db.version;
|
|
753
|
+
}, r.onsuccess = (c) => {
|
|
754
|
+
y.db = c.target.result, y.lastLink = r.result;
|
|
755
|
+
const u = y.db.objectStoreNames.contains(t);
|
|
756
756
|
r.result.close(), s(u);
|
|
757
|
-
}, r.onerror = (
|
|
758
|
-
o(
|
|
757
|
+
}, r.onerror = (c) => {
|
|
758
|
+
o(c.target.error);
|
|
759
759
|
};
|
|
760
760
|
}) : !1;
|
|
761
761
|
}
|
|
@@ -770,16 +770,16 @@ const g = class g {
|
|
|
770
770
|
*/
|
|
771
771
|
static async createTable(e, t, i, s = !1) {
|
|
772
772
|
return new Promise((o) => {
|
|
773
|
-
var
|
|
774
|
-
|
|
775
|
-
const r = indexedDB.open(e,
|
|
773
|
+
var c, u;
|
|
774
|
+
y.version += 1, y.lastLink && ((u = (c = y.lastLink).close) == null || u.call(c));
|
|
775
|
+
const r = indexedDB.open(e, y.version);
|
|
776
776
|
r.onupgradeneeded = (f) => {
|
|
777
|
-
if (
|
|
777
|
+
if (y.db = f.target.result, !y.db.objectStoreNames.contains(t)) {
|
|
778
778
|
const d = {};
|
|
779
|
-
i ? d.keyPath = i : s && (d.autoIncrement = !0),
|
|
779
|
+
i ? d.keyPath = i : s && (d.autoIncrement = !0), y.db.createObjectStore(t, d);
|
|
780
780
|
}
|
|
781
781
|
}, r.onsuccess = () => {
|
|
782
|
-
|
|
782
|
+
y.lastLink = r.result, r.result.close(), o(!0);
|
|
783
783
|
}, r.onerror = () => {
|
|
784
784
|
o(!1);
|
|
785
785
|
};
|
|
@@ -795,12 +795,12 @@ const g = class g {
|
|
|
795
795
|
static async deleteTable(e, t) {
|
|
796
796
|
return new Promise((i) => {
|
|
797
797
|
var o, r;
|
|
798
|
-
|
|
799
|
-
const s = indexedDB.open(e,
|
|
800
|
-
s.onupgradeneeded = (
|
|
801
|
-
|
|
802
|
-
}, s.onsuccess = (
|
|
803
|
-
|
|
798
|
+
y.version += 1, y.lastLink && ((r = (o = y.lastLink).close) == null || r.call(o));
|
|
799
|
+
const s = indexedDB.open(e, y.version);
|
|
800
|
+
s.onupgradeneeded = (c) => {
|
|
801
|
+
y.db = c.target.result, y.lastLink = s.result, y.db.objectStoreNames.contains(t) && y.db.deleteObjectStore(t);
|
|
802
|
+
}, s.onsuccess = (c) => {
|
|
803
|
+
y.db = c.target.result, y.lastLink = s.result, s.result.close(), i(!0);
|
|
804
804
|
}, s.onerror = () => {
|
|
805
805
|
s.result.close(), i(!1);
|
|
806
806
|
};
|
|
@@ -817,10 +817,10 @@ const g = class g {
|
|
|
817
817
|
static async addData(e, t, i) {
|
|
818
818
|
return new Promise((s, o) => {
|
|
819
819
|
const r = indexedDB.open(e);
|
|
820
|
-
r.onsuccess = (
|
|
821
|
-
if (
|
|
822
|
-
const d =
|
|
823
|
-
d.onsuccess = (
|
|
820
|
+
r.onsuccess = (c) => {
|
|
821
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
822
|
+
const d = y.db.transaction([t], "readwrite").objectStore(t).add(i);
|
|
823
|
+
d.onsuccess = (a) => {
|
|
824
824
|
s(i);
|
|
825
825
|
}, d.onerror = () => {
|
|
826
826
|
s(null);
|
|
@@ -843,10 +843,10 @@ const g = class g {
|
|
|
843
843
|
static async deleteData(e, t, i) {
|
|
844
844
|
return new Promise((s, o) => {
|
|
845
845
|
const r = indexedDB.open(e);
|
|
846
|
-
r.onsuccess = (
|
|
847
|
-
if (
|
|
848
|
-
const d =
|
|
849
|
-
d.onsuccess = (
|
|
846
|
+
r.onsuccess = (c) => {
|
|
847
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
848
|
+
const d = y.db.transaction([t], "readwrite").objectStore(t).delete(i);
|
|
849
|
+
d.onsuccess = (a) => {
|
|
850
850
|
s(!0);
|
|
851
851
|
}, d.onerror = () => {
|
|
852
852
|
s(!1);
|
|
@@ -869,10 +869,10 @@ const g = class g {
|
|
|
869
869
|
static async updateData(e, t, i) {
|
|
870
870
|
return new Promise((s, o) => {
|
|
871
871
|
const r = indexedDB.open(e);
|
|
872
|
-
r.onsuccess = (
|
|
873
|
-
if (
|
|
874
|
-
const d =
|
|
875
|
-
d.onsuccess = (
|
|
872
|
+
r.onsuccess = (c) => {
|
|
873
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
874
|
+
const d = y.db.transaction([t], "readwrite").objectStore(t).put(i);
|
|
875
|
+
d.onsuccess = (a) => {
|
|
876
876
|
s(i);
|
|
877
877
|
}, d.onerror = () => {
|
|
878
878
|
s(i);
|
|
@@ -895,10 +895,10 @@ const g = class g {
|
|
|
895
895
|
static async getData(e, t, i) {
|
|
896
896
|
return new Promise((s, o) => {
|
|
897
897
|
const r = indexedDB.open(e);
|
|
898
|
-
r.onsuccess = (
|
|
899
|
-
if (
|
|
900
|
-
const d =
|
|
901
|
-
d.onsuccess = (
|
|
898
|
+
r.onsuccess = (c) => {
|
|
899
|
+
if (y.db = c.target.result, y.lastLink = r.result, y.db.objectStoreNames.contains(t)) {
|
|
900
|
+
const d = y.db.transaction([t], "readonly").objectStore(t).get(i);
|
|
901
|
+
d.onsuccess = (a) => {
|
|
902
902
|
s(d.result);
|
|
903
903
|
}, d.onerror = () => {
|
|
904
904
|
o(new Error("未找到数据".concat(i)));
|
|
@@ -921,8 +921,8 @@ const g = class g {
|
|
|
921
921
|
return new Promise((i, s) => {
|
|
922
922
|
const o = indexedDB.open(e);
|
|
923
923
|
o.onsuccess = (r) => {
|
|
924
|
-
if (
|
|
925
|
-
const f =
|
|
924
|
+
if (y.db = r.target.result, y.lastLink = o.result, y.db.objectStoreNames.contains(t)) {
|
|
925
|
+
const f = y.db.transaction([t], "readonly").objectStore(t).getAll();
|
|
926
926
|
f.onsuccess = (d) => {
|
|
927
927
|
i(f.result);
|
|
928
928
|
}, f.onerror = () => {
|
|
@@ -937,11 +937,11 @@ const g = class g {
|
|
|
937
937
|
}
|
|
938
938
|
};
|
|
939
939
|
// 数据库版本
|
|
940
|
-
w(
|
|
941
|
-
w(
|
|
942
|
-
w(
|
|
943
|
-
let
|
|
944
|
-
class
|
|
940
|
+
w(y, "version", 1), // 数据库连接句柄
|
|
941
|
+
w(y, "db", null), // 上一个连接
|
|
942
|
+
w(y, "lastLink");
|
|
943
|
+
let W = y;
|
|
944
|
+
class xn {
|
|
945
945
|
/**
|
|
946
946
|
* Creates an instance of FileUploader.
|
|
947
947
|
* @author tony001
|
|
@@ -975,8 +975,8 @@ class Sn {
|
|
|
975
975
|
if (e.length === 0)
|
|
976
976
|
return;
|
|
977
977
|
const t = e.filter((o) => {
|
|
978
|
-
var r,
|
|
979
|
-
return this.options.maxSize && o.size > this.options.maxSize ? ((
|
|
978
|
+
var r, c;
|
|
979
|
+
return this.options.maxSize && o.size > this.options.maxSize ? ((c = (r = this.options).onError) == null || c.call(r, new Error("文件大小超过限制 (".concat(this.formatSize(o.size), " > ").concat(this.formatSize(this.options.maxSize), ")")), o), !1) : !0;
|
|
980
980
|
});
|
|
981
981
|
(s = (i = this.options).onSelect) == null || s.call(i, t), await Promise.all(t.map((o) => this.processFile(o)));
|
|
982
982
|
}
|
|
@@ -984,15 +984,15 @@ class Sn {
|
|
|
984
984
|
* 处理单个文件上传
|
|
985
985
|
*/
|
|
986
986
|
async processFile(e) {
|
|
987
|
-
var t, i, s, o, r,
|
|
987
|
+
var t, i, s, o, r, c;
|
|
988
988
|
try {
|
|
989
989
|
const u = (d) => {
|
|
990
|
-
var
|
|
991
|
-
(_ = (
|
|
990
|
+
var a, _;
|
|
991
|
+
(_ = (a = this.options).onProgress) == null || _.call(a, e, d);
|
|
992
992
|
}, f = await this.options.onUpload(e, u);
|
|
993
993
|
(i = (t = this.options).onProgress) == null || i.call(t, e, 100), (o = (s = this.options).onSuccess) == null || o.call(s, f, e);
|
|
994
994
|
} catch (u) {
|
|
995
|
-
(
|
|
995
|
+
(c = (r = this.options).onError) == null || c.call(r, u instanceof Error ? u : new Error("上传失败"), e);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
/**
|
|
@@ -1034,13 +1034,13 @@ class jt {
|
|
|
1034
1034
|
static parse(e) {
|
|
1035
1035
|
const i = new DOMParser().parseFromString(e, "text/xml");
|
|
1036
1036
|
return Array.from(i.querySelectorAll("resource")).map((o) => {
|
|
1037
|
-
const r = o.getAttribute("type") || "",
|
|
1037
|
+
const r = o.getAttribute("type") || "", c = o.querySelector("data"), u = o.querySelector("metadata");
|
|
1038
1038
|
try {
|
|
1039
|
-
const f = this.getCdataContent(
|
|
1039
|
+
const f = this.getCdataContent(c), d = this.getCdataContent(u), a = f ? JSON.parse(f) : {}, _ = d ? JSON.parse(d) : {};
|
|
1040
1040
|
return {
|
|
1041
|
-
id:
|
|
1041
|
+
id: a.id,
|
|
1042
1042
|
type: r,
|
|
1043
|
-
data:
|
|
1043
|
+
data: a,
|
|
1044
1044
|
metadata: _
|
|
1045
1045
|
};
|
|
1046
1046
|
} catch (f) {
|
|
@@ -1070,17 +1070,17 @@ class jt {
|
|
|
1070
1070
|
remainingText: e,
|
|
1071
1071
|
hasResources: !1
|
|
1072
1072
|
};
|
|
1073
|
-
const [s] = i, o = i.index, r = o + s.length,
|
|
1073
|
+
const [s] = i, o = i.index, r = o + s.length, c = (e.slice(0, o) + e.slice(r)).replace(/\n/g, "");
|
|
1074
1074
|
try {
|
|
1075
1075
|
return {
|
|
1076
1076
|
resources: this.parse(s),
|
|
1077
|
-
remainingText:
|
|
1077
|
+
remainingText: c,
|
|
1078
1078
|
hasResources: !0
|
|
1079
1079
|
};
|
|
1080
1080
|
} catch (u) {
|
|
1081
1081
|
return {
|
|
1082
1082
|
resources: [],
|
|
1083
|
-
remainingText:
|
|
1083
|
+
remainingText: c,
|
|
1084
1084
|
hasResources: !0,
|
|
1085
1085
|
error: "资源解析失败: ".concat(u.message)
|
|
1086
1086
|
};
|
|
@@ -1097,33 +1097,38 @@ class jt {
|
|
|
1097
1097
|
*/
|
|
1098
1098
|
static stringify(e) {
|
|
1099
1099
|
const t = document.implementation.createDocument(null, null, null), i = t.createElement("resources");
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1100
|
+
i.setAttribute("version", "1.0");
|
|
1101
|
+
const s = (r) => "\n".concat(" ".repeat(r)), o = 1;
|
|
1102
|
+
return e.forEach((r) => {
|
|
1103
|
+
i.appendChild(t.createTextNode(s(o)));
|
|
1104
|
+
const c = t.createElement("resource");
|
|
1105
|
+
c.setAttribute("type", r.type), c.setAttribute("version", "1.0");
|
|
1106
|
+
const u = (f, d) => {
|
|
1107
|
+
const a = t.createElement(f);
|
|
1108
|
+
a.appendChild(t.createTextNode(s(o + 1)));
|
|
1109
|
+
const _ = t.createCDATASection(JSON.stringify(d));
|
|
1110
|
+
return a.appendChild(_), a.appendChild(t.createTextNode(s(o))), a;
|
|
1106
1111
|
};
|
|
1107
|
-
o.appendChild(
|
|
1108
|
-
}), t.appendChild(i), new XMLSerializer().serializeToString(t);
|
|
1112
|
+
c.appendChild(t.createTextNode(s(o + 1))), c.appendChild(u("data", r.data)), c.appendChild(t.createTextNode(s(o + 1))), c.appendChild(u("metadata", r.metadata)), c.appendChild(t.createTextNode(s(o))), i.appendChild(c);
|
|
1113
|
+
}), i.appendChild(t.createTextNode("\n")), t.appendChild(i), new XMLSerializer().serializeToString(t).replace(/></g, ">\n<");
|
|
1109
1114
|
}
|
|
1110
1115
|
}
|
|
1111
|
-
var oe,
|
|
1116
|
+
var oe, x, Le, ot, pe = 0, Yt = [], we = [], rt = m.__b, at = m.__r, ct = m.diffed, lt = m.__c, ut = m.unmount;
|
|
1112
1117
|
function Me(n, e) {
|
|
1113
|
-
m.__h && m.__h(
|
|
1114
|
-
var t =
|
|
1118
|
+
m.__h && m.__h(x, n, pe || e), pe = 0;
|
|
1119
|
+
var t = x.__H || (x.__H = { __: [], __h: [] });
|
|
1115
1120
|
return n >= t.__.length && t.__.push({ __V: we }), t.__[n];
|
|
1116
1121
|
}
|
|
1117
1122
|
function Je(n) {
|
|
1118
|
-
return pe = 1,
|
|
1123
|
+
return pe = 1, Sn(Zt, n);
|
|
1119
1124
|
}
|
|
1120
|
-
function
|
|
1125
|
+
function Sn(n, e, t) {
|
|
1121
1126
|
var i = Me(oe++, 2);
|
|
1122
|
-
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Zt(void 0, e), function(
|
|
1123
|
-
var u = i.__N ? i.__N[0] : i.__[0], f = i.t(u,
|
|
1127
|
+
if (i.t = n, !i.__c && (i.__ = [t ? t(e) : Zt(void 0, e), function(c) {
|
|
1128
|
+
var u = i.__N ? i.__N[0] : i.__[0], f = i.t(u, c);
|
|
1124
1129
|
u !== f && (i.__N = [f, i.__[1]], i.__c.setState({}));
|
|
1125
|
-
}], i.__c =
|
|
1126
|
-
var s = function(
|
|
1130
|
+
}], i.__c = x, !x.u)) {
|
|
1131
|
+
var s = function(c, u, f) {
|
|
1127
1132
|
if (!i.__c.__H)
|
|
1128
1133
|
return !0;
|
|
1129
1134
|
var d = i.__c.__H.__.filter(function(_) {
|
|
@@ -1132,30 +1137,30 @@ function xn(n, e, t) {
|
|
|
1132
1137
|
if (d.every(function(_) {
|
|
1133
1138
|
return !_.__N;
|
|
1134
1139
|
}))
|
|
1135
|
-
return !o || o.call(this,
|
|
1136
|
-
var
|
|
1140
|
+
return !o || o.call(this, c, u, f);
|
|
1141
|
+
var a = !1;
|
|
1137
1142
|
return d.forEach(function(_) {
|
|
1138
1143
|
if (_.__N) {
|
|
1139
1144
|
var v = _.__[0];
|
|
1140
|
-
_.__ = _.__N, _.__N = void 0, v !== _.__[0] && (
|
|
1145
|
+
_.__ = _.__N, _.__N = void 0, v !== _.__[0] && (a = !0);
|
|
1141
1146
|
}
|
|
1142
|
-
}), !(!
|
|
1147
|
+
}), !(!a && i.__c.props === c) && (!o || o.call(this, c, u, f));
|
|
1143
1148
|
};
|
|
1144
|
-
|
|
1145
|
-
var o =
|
|
1146
|
-
|
|
1149
|
+
x.u = !0;
|
|
1150
|
+
var o = x.shouldComponentUpdate, r = x.componentWillUpdate;
|
|
1151
|
+
x.componentWillUpdate = function(c, u, f) {
|
|
1147
1152
|
if (this.__e) {
|
|
1148
1153
|
var d = o;
|
|
1149
|
-
o = void 0, s(
|
|
1154
|
+
o = void 0, s(c, u, f), o = d;
|
|
1150
1155
|
}
|
|
1151
|
-
r && r.call(this,
|
|
1152
|
-
},
|
|
1156
|
+
r && r.call(this, c, u, f);
|
|
1157
|
+
}, x.shouldComponentUpdate = s;
|
|
1153
1158
|
}
|
|
1154
1159
|
return i.__N || i.__;
|
|
1155
1160
|
}
|
|
1156
|
-
function
|
|
1161
|
+
function V(n, e) {
|
|
1157
1162
|
var t = Me(oe++, 3);
|
|
1158
|
-
!m.__s && Xt(t.__H, e) && (t.__ = n, t.i = e,
|
|
1163
|
+
!m.__s && Xt(t.__H, e) && (t.__ = n, t.i = e, x.__H.__h.push(t));
|
|
1159
1164
|
}
|
|
1160
1165
|
function K(n) {
|
|
1161
1166
|
return pe = 5, j(function() {
|
|
@@ -1172,10 +1177,10 @@ function dt(n, e) {
|
|
|
1172
1177
|
}, e);
|
|
1173
1178
|
}
|
|
1174
1179
|
function En(n) {
|
|
1175
|
-
var e =
|
|
1176
|
-
return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(
|
|
1180
|
+
var e = x.context[n.__c], t = Me(oe++, 9);
|
|
1181
|
+
return t.c = n, e ? (t.__ == null && (t.__ = !0, e.sub(x)), e.props.value) : n.__;
|
|
1177
1182
|
}
|
|
1178
|
-
function
|
|
1183
|
+
function Nn() {
|
|
1179
1184
|
for (var n; n = Yt.shift(); )
|
|
1180
1185
|
if (n.__P && n.__H)
|
|
1181
1186
|
try {
|
|
@@ -1185,19 +1190,19 @@ function $n() {
|
|
|
1185
1190
|
}
|
|
1186
1191
|
}
|
|
1187
1192
|
m.__b = function(n) {
|
|
1188
|
-
|
|
1193
|
+
x = null, rt && rt(n);
|
|
1189
1194
|
}, m.__r = function(n) {
|
|
1190
1195
|
at && at(n), oe = 0;
|
|
1191
|
-
var e = (
|
|
1192
|
-
e && (Le ===
|
|
1196
|
+
var e = (x = n.__c).__H;
|
|
1197
|
+
e && (Le === x ? (e.__h = [], x.__h = [], e.__.forEach(function(t) {
|
|
1193
1198
|
t.__N && (t.__ = t.__N), t.__V = we, t.__N = t.i = void 0;
|
|
1194
|
-
})) : (e.__h.forEach(Ce), e.__h.forEach(je), e.__h = [], oe = 0)), Le =
|
|
1199
|
+
})) : (e.__h.forEach(Ce), e.__h.forEach(je), e.__h = [], oe = 0)), Le = x;
|
|
1195
1200
|
}, m.diffed = function(n) {
|
|
1196
1201
|
ct && ct(n);
|
|
1197
1202
|
var e = n.__c;
|
|
1198
|
-
e && e.__H && (e.__H.__h.length && (Yt.push(e) !== 1 && ot === m.requestAnimationFrame || ((ot = m.requestAnimationFrame) ||
|
|
1203
|
+
e && e.__H && (e.__H.__h.length && (Yt.push(e) !== 1 && ot === m.requestAnimationFrame || ((ot = m.requestAnimationFrame) || $n)(Nn)), e.__H.__.forEach(function(t) {
|
|
1199
1204
|
t.i && (t.__H = t.i), t.__V !== we && (t.__ = t.__V), t.i = void 0, t.__V = we;
|
|
1200
|
-
})), Le =
|
|
1205
|
+
})), Le = x = null;
|
|
1201
1206
|
}, m.__c = function(n, e) {
|
|
1202
1207
|
e.some(function(t) {
|
|
1203
1208
|
try {
|
|
@@ -1222,19 +1227,19 @@ m.__b = function(n) {
|
|
|
1222
1227
|
}), t.__H = void 0, e && m.__e(e, t.__v));
|
|
1223
1228
|
};
|
|
1224
1229
|
var ht = typeof requestAnimationFrame == "function";
|
|
1225
|
-
function
|
|
1230
|
+
function $n(n) {
|
|
1226
1231
|
var e, t = function() {
|
|
1227
1232
|
clearTimeout(i), ht && cancelAnimationFrame(e), setTimeout(n);
|
|
1228
1233
|
}, i = setTimeout(t, 100);
|
|
1229
1234
|
ht && (e = requestAnimationFrame(t));
|
|
1230
1235
|
}
|
|
1231
1236
|
function Ce(n) {
|
|
1232
|
-
var e =
|
|
1233
|
-
typeof t == "function" && (n.__c = void 0, t()),
|
|
1237
|
+
var e = x, t = n.__c;
|
|
1238
|
+
typeof t == "function" && (n.__c = void 0, t()), x = e;
|
|
1234
1239
|
}
|
|
1235
1240
|
function je(n) {
|
|
1236
|
-
var e =
|
|
1237
|
-
n.__c = n.__(),
|
|
1241
|
+
var e = x;
|
|
1242
|
+
n.__c = n.__(), x = e;
|
|
1238
1243
|
}
|
|
1239
1244
|
function Xt(n, e) {
|
|
1240
1245
|
return !n || n.length !== e.length || e.some(function(t, i) {
|
|
@@ -1269,14 +1274,14 @@ function Ke() {
|
|
|
1269
1274
|
throw n;
|
|
1270
1275
|
}
|
|
1271
1276
|
}
|
|
1272
|
-
var
|
|
1277
|
+
var S = void 0, de = void 0, ie = 0, Ye = 0, Ee = 0;
|
|
1273
1278
|
function Gt(n) {
|
|
1274
|
-
if (
|
|
1279
|
+
if (S !== void 0) {
|
|
1275
1280
|
var e = n.n;
|
|
1276
|
-
if (e === void 0 || e.t !==
|
|
1277
|
-
return e = { i: 0, S: n, p:
|
|
1281
|
+
if (e === void 0 || e.t !== S)
|
|
1282
|
+
return e = { i: 0, S: n, p: S.s, n: void 0, t: S, e: void 0, x: void 0, r: e }, S.s !== void 0 && (S.s.n = e), S.s = e, n.n = e, 32 & S.f && n.S(e), e;
|
|
1278
1283
|
if (e.i === -1)
|
|
1279
|
-
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p =
|
|
1284
|
+
return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = S.s, e.n = void 0, S.s.n = e, S.s = e), e;
|
|
1280
1285
|
}
|
|
1281
1286
|
}
|
|
1282
1287
|
function A(n) {
|
|
@@ -1323,7 +1328,7 @@ Object.defineProperty(A.prototype, "value", { get: function() {
|
|
|
1323
1328
|
var n = Gt(this);
|
|
1324
1329
|
return n !== void 0 && (n.i = this.i), this.v;
|
|
1325
1330
|
}, set: function(n) {
|
|
1326
|
-
if (
|
|
1331
|
+
if (S instanceof Y && function() {
|
|
1327
1332
|
throw new Error("Computed cannot have side-effects");
|
|
1328
1333
|
}(), n !== this.v) {
|
|
1329
1334
|
Ye > 100 && Ae(), this.v = n, this.i++, Ee++, ie++;
|
|
@@ -1370,15 +1375,15 @@ function Y(n) {
|
|
|
1370
1375
|
return !0;
|
|
1371
1376
|
if (this.g = Ee, this.f |= 1, this.i > 0 && !Jt(this))
|
|
1372
1377
|
return this.f &= -2, !0;
|
|
1373
|
-
var n =
|
|
1378
|
+
var n = S;
|
|
1374
1379
|
try {
|
|
1375
|
-
Kt(this),
|
|
1380
|
+
Kt(this), S = this;
|
|
1376
1381
|
var e = this.x();
|
|
1377
1382
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
1378
1383
|
} catch (t) {
|
|
1379
1384
|
this.v = t, this.f |= 16, this.i++;
|
|
1380
1385
|
}
|
|
1381
|
-
return
|
|
1386
|
+
return S = n, Qt(this), this.f &= -2, !0;
|
|
1382
1387
|
};
|
|
1383
1388
|
Y.prototype.S = function(n) {
|
|
1384
1389
|
if (this.t === void 0) {
|
|
@@ -1421,14 +1426,14 @@ function tn(n) {
|
|
|
1421
1426
|
var e = n.u;
|
|
1422
1427
|
if (n.u = void 0, typeof e == "function") {
|
|
1423
1428
|
ie++;
|
|
1424
|
-
var t =
|
|
1425
|
-
|
|
1429
|
+
var t = S;
|
|
1430
|
+
S = void 0;
|
|
1426
1431
|
try {
|
|
1427
1432
|
e();
|
|
1428
1433
|
} catch (i) {
|
|
1429
1434
|
throw n.f &= -2, n.f |= 8, Qe(n), i;
|
|
1430
1435
|
} finally {
|
|
1431
|
-
|
|
1436
|
+
S = t, Ke();
|
|
1432
1437
|
}
|
|
1433
1438
|
}
|
|
1434
1439
|
}
|
|
@@ -1438,9 +1443,9 @@ function Qe(n) {
|
|
|
1438
1443
|
n.x = void 0, n.s = void 0, tn(n);
|
|
1439
1444
|
}
|
|
1440
1445
|
function Mn(n) {
|
|
1441
|
-
if (
|
|
1446
|
+
if (S !== this)
|
|
1442
1447
|
throw new Error("Out-of-order effect");
|
|
1443
|
-
Qt(this),
|
|
1448
|
+
Qt(this), S = n, this.f &= -2, 8 & this.f && Qe(this), Ke();
|
|
1444
1449
|
}
|
|
1445
1450
|
function _e(n) {
|
|
1446
1451
|
this.x = n, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
|
|
@@ -1458,8 +1463,8 @@ _e.prototype.c = function() {
|
|
|
1458
1463
|
};
|
|
1459
1464
|
_e.prototype.S = function() {
|
|
1460
1465
|
1 & this.f && Ae(), this.f |= 1, this.f &= -9, tn(this), Kt(this), ie++;
|
|
1461
|
-
var n =
|
|
1462
|
-
return
|
|
1466
|
+
var n = S;
|
|
1467
|
+
return S = this, Mn.bind(this, n);
|
|
1463
1468
|
};
|
|
1464
1469
|
_e.prototype.N = function() {
|
|
1465
1470
|
2 & this.f || (this.f |= 2, this.o = de, de = this);
|
|
@@ -1481,11 +1486,11 @@ function re(n, e) {
|
|
|
1481
1486
|
m[n] = e.bind(null, m[n] || function() {
|
|
1482
1487
|
});
|
|
1483
1488
|
}
|
|
1484
|
-
function
|
|
1489
|
+
function Ne(n) {
|
|
1485
1490
|
Oe && Oe(), Oe = n && n.S();
|
|
1486
1491
|
}
|
|
1487
1492
|
function nn(n) {
|
|
1488
|
-
var e = this, t = n.data, i =
|
|
1493
|
+
var e = this, t = n.data, i = q(t);
|
|
1489
1494
|
i.value = t;
|
|
1490
1495
|
var s = j(function() {
|
|
1491
1496
|
for (var o = e.__v; o = o.__; )
|
|
@@ -1519,7 +1524,7 @@ re("__b", function(n, e) {
|
|
|
1519
1524
|
n(e);
|
|
1520
1525
|
});
|
|
1521
1526
|
re("__r", function(n, e) {
|
|
1522
|
-
|
|
1527
|
+
Ne();
|
|
1523
1528
|
var t, i = e.__c;
|
|
1524
1529
|
i && (i.__$f &= -2, (t = i.__$u) === void 0 && (i.__$u = t = function(s) {
|
|
1525
1530
|
var o;
|
|
@@ -1528,13 +1533,13 @@ re("__r", function(n, e) {
|
|
|
1528
1533
|
}), o.c = function() {
|
|
1529
1534
|
i.__$f |= 1, i.setState({});
|
|
1530
1535
|
}, o;
|
|
1531
|
-
}())), De = i,
|
|
1536
|
+
}())), De = i, Ne(t), n(e);
|
|
1532
1537
|
});
|
|
1533
1538
|
re("__e", function(n, e, t, i) {
|
|
1534
|
-
|
|
1539
|
+
Ne(), De = void 0, n(e, t, i);
|
|
1535
1540
|
});
|
|
1536
1541
|
re("diffed", function(n, e) {
|
|
1537
|
-
|
|
1542
|
+
Ne(), De = void 0;
|
|
1538
1543
|
var t;
|
|
1539
1544
|
if (typeof e.type == "string" && (t = e.__e)) {
|
|
1540
1545
|
var i = e.__np, s = e.props;
|
|
@@ -1542,8 +1547,8 @@ re("diffed", function(n, e) {
|
|
|
1542
1547
|
var o = t.U;
|
|
1543
1548
|
if (o)
|
|
1544
1549
|
for (var r in o) {
|
|
1545
|
-
var
|
|
1546
|
-
|
|
1550
|
+
var c = o[r];
|
|
1551
|
+
c !== void 0 && !(r in i) && (c.d(), o[r] = void 0);
|
|
1547
1552
|
}
|
|
1548
1553
|
else
|
|
1549
1554
|
t.U = o = {};
|
|
@@ -1557,8 +1562,8 @@ re("diffed", function(n, e) {
|
|
|
1557
1562
|
});
|
|
1558
1563
|
function An(n, e, t, i) {
|
|
1559
1564
|
var s = e in n && n.ownerSVGElement === void 0, o = J(t);
|
|
1560
|
-
return { o: function(r,
|
|
1561
|
-
o.value = r, i =
|
|
1565
|
+
return { o: function(r, c) {
|
|
1566
|
+
o.value = r, i = c;
|
|
1562
1567
|
}, d: Ie(function() {
|
|
1563
1568
|
var r = o.value.value;
|
|
1564
1569
|
i[e] !== r && (i[e] = r, s ? n[e] = r : r ? n.setAttribute(e, r) : n.removeAttribute(e));
|
|
@@ -1580,8 +1585,8 @@ re("unmount", function(n, e) {
|
|
|
1580
1585
|
} else {
|
|
1581
1586
|
var r = e.__c;
|
|
1582
1587
|
if (r) {
|
|
1583
|
-
var
|
|
1584
|
-
|
|
1588
|
+
var c = r.__$u;
|
|
1589
|
+
c && (r.__$u = void 0, c.d());
|
|
1585
1590
|
}
|
|
1586
1591
|
}
|
|
1587
1592
|
n(e);
|
|
@@ -1603,7 +1608,7 @@ H.prototype.shouldComponentUpdate = function(n, e) {
|
|
|
1603
1608
|
return !0;
|
|
1604
1609
|
return !1;
|
|
1605
1610
|
};
|
|
1606
|
-
function
|
|
1611
|
+
function q(n) {
|
|
1607
1612
|
return j(function() {
|
|
1608
1613
|
return J(n);
|
|
1609
1614
|
}, []);
|
|
@@ -1618,7 +1623,7 @@ function O(n) {
|
|
|
1618
1623
|
}
|
|
1619
1624
|
function In(n) {
|
|
1620
1625
|
var e = K(n);
|
|
1621
|
-
e.current = n,
|
|
1626
|
+
e.current = n, V(function() {
|
|
1622
1627
|
return Ie(function() {
|
|
1623
1628
|
return e.current();
|
|
1624
1629
|
});
|
|
@@ -1626,13 +1631,13 @@ function In(n) {
|
|
|
1626
1631
|
}
|
|
1627
1632
|
var Dn = 0;
|
|
1628
1633
|
function l(n, e, t, i, s, o) {
|
|
1629
|
-
var r,
|
|
1630
|
-
for (
|
|
1631
|
-
|
|
1634
|
+
var r, c, u = {};
|
|
1635
|
+
for (c in e)
|
|
1636
|
+
c == "ref" ? r = e[c] : u[c] = e[c];
|
|
1632
1637
|
var f = { type: n, props: u, key: t, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --Dn, __source: s, __self: o };
|
|
1633
1638
|
if (typeof n == "function" && (r = n.defaultProps))
|
|
1634
|
-
for (
|
|
1635
|
-
u[
|
|
1639
|
+
for (c in r)
|
|
1640
|
+
u[c] === void 0 && (u[c] = r[c]);
|
|
1636
1641
|
return m.vnode && m.vnode(f), f;
|
|
1637
1642
|
}
|
|
1638
1643
|
const zn = () => l("svg", {
|
|
@@ -1716,7 +1721,7 @@ const zn = () => l("svg", {
|
|
|
1716
1721
|
}), l("path", {
|
|
1717
1722
|
d: "M617.472 556.032a47.9232 38.912 90 1 0 77.824 0 47.9232 38.912 90 1 0-77.824 0Z"
|
|
1718
1723
|
})]
|
|
1719
|
-
}),
|
|
1724
|
+
}), Wn = () => l("svg", {
|
|
1720
1725
|
viewBox: "0 0 18 18",
|
|
1721
1726
|
fill: "none",
|
|
1722
1727
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1730,7 +1735,7 @@ const zn = () => l("svg", {
|
|
|
1730
1735
|
d: "M14.537 2.932c0-.396-.34-.717-.759-.717s-.758.32-.758.717v3.786c0 .396.34.717.758.717.42 0 .76-.321.76-.717V2.932z",
|
|
1731
1736
|
fill: "currentColor"
|
|
1732
1737
|
})]
|
|
1733
|
-
}),
|
|
1738
|
+
}), Vn = () => l("svg", {
|
|
1734
1739
|
viewBox: "64 64 896 896",
|
|
1735
1740
|
focusable: "false",
|
|
1736
1741
|
width: "1em",
|
|
@@ -1740,15 +1745,15 @@ const zn = () => l("svg", {
|
|
|
1740
1745
|
children: l("path", {
|
|
1741
1746
|
d: "M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"
|
|
1742
1747
|
})
|
|
1743
|
-
}),
|
|
1748
|
+
}), qn = () => l("svg", {
|
|
1744
1749
|
fill: "currentColor",
|
|
1745
1750
|
viewBox: "0 0 1000 1000",
|
|
1746
1751
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1747
1752
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1748
1753
|
children: Array.from({
|
|
1749
1754
|
length: 4
|
|
1750
|
-
}).map((
|
|
1751
|
-
const d = u * (146.66666666666666 + 140),
|
|
1755
|
+
}).map((c, u) => {
|
|
1756
|
+
const d = u * (146.66666666666666 + 140), a = 1e3 / 2 - 250 / 2, _ = 1e3 / 2 - 500 / 2;
|
|
1752
1757
|
return l("rect", {
|
|
1753
1758
|
fill: "currentColor",
|
|
1754
1759
|
rx: 70,
|
|
@@ -1756,7 +1761,7 @@ const zn = () => l("svg", {
|
|
|
1756
1761
|
height: 250,
|
|
1757
1762
|
width: 140,
|
|
1758
1763
|
x: d,
|
|
1759
|
-
y:
|
|
1764
|
+
y: a,
|
|
1760
1765
|
children: [l("animate", {
|
|
1761
1766
|
attributeName: "height",
|
|
1762
1767
|
values: "250; 500; 250",
|
|
@@ -1766,7 +1771,7 @@ const zn = () => l("svg", {
|
|
|
1766
1771
|
repeatCount: "indefinite"
|
|
1767
1772
|
}), l("animate", {
|
|
1768
1773
|
attributeName: "y",
|
|
1769
|
-
values: "".concat(
|
|
1774
|
+
values: "".concat(a, "; ").concat(_, "; ").concat(a),
|
|
1770
1775
|
keyTimes: "0; 0.5; 1",
|
|
1771
1776
|
dur: "".concat(0.8, "s"),
|
|
1772
1777
|
begin: "".concat(0.8 / 4 * u, "s"),
|
|
@@ -1883,33 +1888,33 @@ const zn = () => l("svg", {
|
|
|
1883
1888
|
const Kn = (n) => {
|
|
1884
1889
|
const {
|
|
1885
1890
|
items: e
|
|
1886
|
-
} = n, t =
|
|
1887
|
-
|
|
1888
|
-
s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r,
|
|
1889
|
-
r.done && (t.value = [...t.value,
|
|
1891
|
+
} = n, t = q([]), i = new M("chat-thought-chain"), s = q([]);
|
|
1892
|
+
V(() => {
|
|
1893
|
+
s.value = e.filter((r) => r.description), s.value.length > 0 && s.value.forEach((r, c) => {
|
|
1894
|
+
r.done && (t.value = [...t.value, c]);
|
|
1890
1895
|
});
|
|
1891
1896
|
}, [e]);
|
|
1892
1897
|
const o = (r) => {
|
|
1893
|
-
t.value.includes(r) ? t.value = t.value.filter((
|
|
1898
|
+
t.value.includes(r) ? t.value = t.value.filter((c) => c !== r) : t.value = [...t.value, r];
|
|
1894
1899
|
};
|
|
1895
1900
|
return s.value.length === 0 ? null : l("div", {
|
|
1896
1901
|
className: "".concat(i.b(), " ").concat(i.is("single", s.value.length === 1)),
|
|
1897
|
-
children: s.value.map((r,
|
|
1902
|
+
children: s.value.map((r, c) => {
|
|
1898
1903
|
if (!r.description)
|
|
1899
1904
|
return;
|
|
1900
|
-
const u = t.value.includes(
|
|
1905
|
+
const u = t.value.includes(c);
|
|
1901
1906
|
return l("div", {
|
|
1902
1907
|
className: "".concat(i.e("item"), " ").concat(i.is("collapsed", u)),
|
|
1903
1908
|
children: [l("div", {
|
|
1904
1909
|
className: i.e("item-icon"),
|
|
1905
1910
|
children: r.icon || l("span", {
|
|
1906
|
-
children:
|
|
1911
|
+
children: c
|
|
1907
1912
|
})
|
|
1908
1913
|
}), l("div", {
|
|
1909
1914
|
className: i.e("item-content"),
|
|
1910
1915
|
children: [l("div", {
|
|
1911
1916
|
className: i.e("item-title"),
|
|
1912
|
-
onClick: () => o(
|
|
1917
|
+
onClick: () => o(c),
|
|
1913
1918
|
children: [r.title, l(Xn, {
|
|
1914
1919
|
className: i.e("icon")
|
|
1915
1920
|
})]
|
|
@@ -1918,48 +1923,48 @@ const Kn = (n) => {
|
|
|
1918
1923
|
children: r.description
|
|
1919
1924
|
})]
|
|
1920
1925
|
})]
|
|
1921
|
-
},
|
|
1926
|
+
}, c);
|
|
1922
1927
|
})
|
|
1923
1928
|
});
|
|
1924
1929
|
}, Z = new M("markdown-message"), Qn = (n) => {
|
|
1925
1930
|
const {
|
|
1926
1931
|
message: e,
|
|
1927
1932
|
size: t
|
|
1928
|
-
} = n, i =
|
|
1933
|
+
} = n, i = q(Vt()), s = q(null), o = j(() => e.state === 20 && e.completed !== !0, [e.state, e.completed]), r = j(() => e.state === 20 && e.completed === !0, [e.state, e.completed]), c = q({
|
|
1929
1934
|
title: "思考过程",
|
|
1930
1935
|
description: "",
|
|
1931
1936
|
icon: l(Re, {})
|
|
1932
1937
|
}), u = (f) => {
|
|
1933
|
-
const d = f.indexOf("<think>"),
|
|
1938
|
+
const d = f.indexOf("<think>"), a = f.indexOf("</think>");
|
|
1934
1939
|
let _ = "", v = "", h = !1;
|
|
1935
|
-
return
|
|
1940
|
+
return a === -1 ? (h = !1, _ = f.slice(d + 7), v = "") : (h = !0, _ = f.slice(d + 7, a), v = f.slice(a + 8)), {
|
|
1936
1941
|
isThoughtCompleted: h,
|
|
1937
1942
|
thoughtContent: _,
|
|
1938
1943
|
answerContent: v
|
|
1939
1944
|
};
|
|
1940
1945
|
};
|
|
1941
|
-
return
|
|
1946
|
+
return V(() => {
|
|
1942
1947
|
if (t >= 0 && s.value)
|
|
1943
1948
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1944
1949
|
const {
|
|
1945
1950
|
isThoughtCompleted: f,
|
|
1946
1951
|
thoughtContent: d,
|
|
1947
|
-
answerContent:
|
|
1952
|
+
answerContent: a
|
|
1948
1953
|
} = u(e.content);
|
|
1949
|
-
f && (
|
|
1954
|
+
f && (c.value.icon = f ? l(pt, {}) : l(Re, {})), d && (c.value.description = d), a && s.value.setMarkdown(a);
|
|
1950
1955
|
} else
|
|
1951
1956
|
s.value.setMarkdown(e.content);
|
|
1952
|
-
}, [e, t]),
|
|
1957
|
+
}, [e, t]), V(() => {
|
|
1953
1958
|
let f = "";
|
|
1954
1959
|
if (e.content.indexOf("<think>") !== -1) {
|
|
1955
1960
|
const {
|
|
1956
1961
|
isThoughtCompleted: d,
|
|
1957
|
-
thoughtContent:
|
|
1962
|
+
thoughtContent: a,
|
|
1958
1963
|
answerContent: _
|
|
1959
1964
|
} = u(e.content);
|
|
1960
|
-
|
|
1965
|
+
c.value = {
|
|
1961
1966
|
title: "思考过程",
|
|
1962
|
-
description:
|
|
1967
|
+
description: a || "",
|
|
1963
1968
|
icon: d ? l(pt, {}) : l(Re, {})
|
|
1964
1969
|
}, _ && (f = _);
|
|
1965
1970
|
} else
|
|
@@ -1985,7 +1990,7 @@ const Kn = (n) => {
|
|
|
1985
1990
|
}), l("div", {
|
|
1986
1991
|
className: "".concat(Z.b("content"), " pre-wrap-container"),
|
|
1987
1992
|
children: [l(Kn, {
|
|
1988
|
-
items: [
|
|
1993
|
+
items: [c.value]
|
|
1989
1994
|
}), l("div", {
|
|
1990
1995
|
id: i
|
|
1991
1996
|
})]
|
|
@@ -2175,11 +2180,11 @@ const ee = new M("chat-toolbar"), Xe = (n) => {
|
|
|
2175
2180
|
type: s,
|
|
2176
2181
|
className: o
|
|
2177
2182
|
} = n;
|
|
2178
|
-
let r = [],
|
|
2183
|
+
let r = [], c = "default";
|
|
2179
2184
|
const u = [{
|
|
2180
2185
|
label: "新建对话",
|
|
2181
2186
|
title: "新建对话",
|
|
2182
|
-
icon: l(
|
|
2187
|
+
icon: l(Wn, {}),
|
|
2183
2188
|
onClick: () => {
|
|
2184
2189
|
e.newDialogue();
|
|
2185
2190
|
}
|
|
@@ -2220,7 +2225,7 @@ const ee = new M("chat-toolbar"), Xe = (n) => {
|
|
|
2220
2225
|
}
|
|
2221
2226
|
}];
|
|
2222
2227
|
if (s === "content")
|
|
2223
|
-
switch (
|
|
2228
|
+
switch (c = "circle", i.type) {
|
|
2224
2229
|
case "DEFAULT":
|
|
2225
2230
|
i.role === "ASSISTANT" ? r = [...f, ...t] : r = [...d];
|
|
2226
2231
|
break;
|
|
@@ -2230,14 +2235,14 @@ const ee = new M("chat-toolbar"), Xe = (n) => {
|
|
|
2230
2235
|
}
|
|
2231
2236
|
else
|
|
2232
2237
|
r = [...u, ...t];
|
|
2233
|
-
const
|
|
2238
|
+
const a = (p) => typeof p.hidden == "function" ? p.hidden(i) : p.hidden === !0, _ = (p) => typeof p.disabled == "function" ? p.disabled(i) : p.disabled === !0, v = (p, g) => {
|
|
2234
2239
|
var b;
|
|
2235
|
-
_(
|
|
2240
|
+
_(g) || (b = g.onClick) == null || b.call(g, p, e.context, e.params, i);
|
|
2236
2241
|
}, h = j(() => s === "content" && (i == null ? void 0 : i.state) === 20 && (i == null ? void 0 : i.completed) !== !0, [i == null ? void 0 : i.state, i == null ? void 0 : i.completed]);
|
|
2237
2242
|
return l("div", {
|
|
2238
|
-
className: "".concat(ee.b(), " ").concat(ee.e(
|
|
2239
|
-
children: r.map((p,
|
|
2240
|
-
if (!
|
|
2243
|
+
className: "".concat(ee.b(), " ").concat(ee.e(c), " ").concat(o || ""),
|
|
2244
|
+
children: r.map((p, g) => {
|
|
2245
|
+
if (!a(p))
|
|
2241
2246
|
return l("div", {
|
|
2242
2247
|
className: "".concat(ee.e("item"), " ").concat(ee.is("disabled", _(p) || h), " ").concat(o || ""),
|
|
2243
2248
|
title: p.title,
|
|
@@ -2249,7 +2254,7 @@ const ee = new M("chat-toolbar"), Xe = (n) => {
|
|
|
2249
2254
|
className: "".concat(ee.em("item", "label")),
|
|
2250
2255
|
children: typeof p.label == "function" ? p.label(I) : p.label
|
|
2251
2256
|
})]
|
|
2252
|
-
},
|
|
2257
|
+
}, g);
|
|
2253
2258
|
})
|
|
2254
2259
|
});
|
|
2255
2260
|
};
|
|
@@ -2340,10 +2345,10 @@ m.unmount = function(n) {
|
|
|
2340
2345
|
var t = e.__c, i = this;
|
|
2341
2346
|
i.t == null && (i.t = []), i.t.push(t);
|
|
2342
2347
|
var s = cn(i.__v), o = !1, r = function() {
|
|
2343
|
-
o || (o = !0, t.__R = null, s ? s(
|
|
2348
|
+
o || (o = !0, t.__R = null, s ? s(c) : c());
|
|
2344
2349
|
};
|
|
2345
2350
|
t.__R = r;
|
|
2346
|
-
var
|
|
2351
|
+
var c = function() {
|
|
2347
2352
|
if (!--i.__u) {
|
|
2348
2353
|
if (i.state.__a) {
|
|
2349
2354
|
var f = i.state.__a;
|
|
@@ -2409,7 +2414,7 @@ function hi(n, e) {
|
|
|
2409
2414
|
};
|
|
2410
2415
|
}, ge.prototype.render = function(n) {
|
|
2411
2416
|
this.u = null, this.o = /* @__PURE__ */ new Map();
|
|
2412
|
-
var e =
|
|
2417
|
+
var e = xe(n.children);
|
|
2413
2418
|
n.revealOrder && n.revealOrder[0] === "b" && e.reverse();
|
|
2414
2419
|
for (var t = e.length; t--; )
|
|
2415
2420
|
this.o.set(e[t], this.u = [1, 0, this.u]);
|
|
@@ -2451,24 +2456,24 @@ m.vnode = function(n) {
|
|
|
2451
2456
|
for (var o in t) {
|
|
2452
2457
|
var r = t[o];
|
|
2453
2458
|
if (!(o === "value" && "defaultValue" in t && r == null || mi && o === "children" && i === "noscript" || o === "class" || o === "className")) {
|
|
2454
|
-
var
|
|
2455
|
-
o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" :
|
|
2459
|
+
var c = o.toLowerCase();
|
|
2460
|
+
o === "defaultValue" && "value" in t && t.value == null ? o = "value" : o === "download" && r === !0 ? r = "" : c === "ondoubleclick" ? o = "ondblclick" : c !== "onchange" || i !== "input" && i !== "textarea" || gi(t.type) ? c === "onfocus" ? o = "onfocusin" : c === "onblur" ? o = "onfocusout" : _i.test(o) ? o = c : i.indexOf("-") === -1 && pi.test(o) ? o = o.replace(vi, "-$&").toLowerCase() : r === null && (r = void 0) : c = o = "oninput", c === "oninput" && s[o = c] && (o = "oninputCapture"), s[o] = r;
|
|
2456
2461
|
}
|
|
2457
2462
|
}
|
|
2458
|
-
i == "select" && s.multiple && Array.isArray(s.value) && (s.value =
|
|
2463
|
+
i == "select" && s.multiple && Array.isArray(s.value) && (s.value = xe(t.children).forEach(function(u) {
|
|
2459
2464
|
u.props.selected = s.value.indexOf(u.props.value) != -1;
|
|
2460
|
-
})), i == "select" && s.defaultValue != null && (s.value =
|
|
2465
|
+
})), i == "select" && s.defaultValue != null && (s.value = xe(t.children).forEach(function(u) {
|
|
2461
2466
|
u.props.selected = s.multiple ? s.defaultValue.indexOf(u.props.value) != -1 : s.defaultValue == u.props.value;
|
|
2462
2467
|
})), t.class && !t.className ? (s.class = t.class, Object.defineProperty(s, "className", Ci)) : (t.className && !t.class || t.class && t.className) && (s.class = s.className = t.className), e.props = s;
|
|
2463
2468
|
}(n), n.$$typeof = fi, Tt && Tt(n);
|
|
2464
2469
|
};
|
|
2465
|
-
var
|
|
2470
|
+
var xt = m.__r;
|
|
2466
2471
|
m.__r = function(n) {
|
|
2467
|
-
|
|
2472
|
+
xt && xt(n), n.__c;
|
|
2468
2473
|
};
|
|
2469
|
-
var
|
|
2474
|
+
var St = m.diffed;
|
|
2470
2475
|
m.diffed = function(n) {
|
|
2471
|
-
|
|
2476
|
+
St && St(n);
|
|
2472
2477
|
var e = n.props, t = n.__e;
|
|
2473
2478
|
t != null && n.type === "textarea" && "value" in e && e.value !== t.value && (t.value = e.value == null ? "" : e.value);
|
|
2474
2479
|
};
|
|
@@ -2477,7 +2482,7 @@ function Ti(n) {
|
|
|
2477
2482
|
var e = he.get(n);
|
|
2478
2483
|
e && e.destroy();
|
|
2479
2484
|
}
|
|
2480
|
-
function
|
|
2485
|
+
function xi(n) {
|
|
2481
2486
|
var e = he.get(n);
|
|
2482
2487
|
e && e.update();
|
|
2483
2488
|
}
|
|
@@ -2492,17 +2497,17 @@ typeof window > "u" ? ((le = function(n) {
|
|
|
2492
2497
|
return n && Array.prototype.forEach.call(n.length ? n : [n], function(t) {
|
|
2493
2498
|
return function(i) {
|
|
2494
2499
|
if (i && i.nodeName && i.nodeName === "TEXTAREA" && !he.has(i)) {
|
|
2495
|
-
var s, o = null, r = window.getComputedStyle(i),
|
|
2500
|
+
var s, o = null, r = window.getComputedStyle(i), c = (s = i.value, function() {
|
|
2496
2501
|
f({ testForHeightReduction: s === "" || !i.value.startsWith(s), restoreTextAlign: null }), s = i.value;
|
|
2497
|
-
}), u = (function(
|
|
2498
|
-
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", d), i.removeEventListener("input",
|
|
2499
|
-
return i.style[_] =
|
|
2502
|
+
}), u = (function(a) {
|
|
2503
|
+
i.removeEventListener("autosize:destroy", u), i.removeEventListener("autosize:update", d), i.removeEventListener("input", c), window.removeEventListener("resize", d), Object.keys(a).forEach(function(_) {
|
|
2504
|
+
return i.style[_] = a[_];
|
|
2500
2505
|
}), he.delete(i);
|
|
2501
2506
|
}).bind(i, { height: i.style.height, resize: i.style.resize, textAlign: i.style.textAlign, overflowY: i.style.overflowY, overflowX: i.style.overflowX, wordWrap: i.style.wordWrap });
|
|
2502
|
-
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", d), i.addEventListener("input",
|
|
2507
|
+
i.addEventListener("autosize:destroy", u), i.addEventListener("autosize:update", d), i.addEventListener("input", c), window.addEventListener("resize", d), i.style.overflowX = "hidden", i.style.wordWrap = "break-word", he.set(i, { destroy: u, update: d }), d();
|
|
2503
2508
|
}
|
|
2504
|
-
function f(
|
|
2505
|
-
var _, v, h =
|
|
2509
|
+
function f(a) {
|
|
2510
|
+
var _, v, h = a.restoreTextAlign, p = h === void 0 ? null : h, g = a.testForHeightReduction, b = g === void 0 || g, C = r.overflowY;
|
|
2506
2511
|
if (i.scrollHeight !== 0 && (r.resize === "vertical" ? i.style.resize = "none" : r.resize === "both" && (i.style.resize = "horizontal"), b && (_ = function(T) {
|
|
2507
2512
|
for (var E = []; T && T.parentNode && T.parentNode instanceof Element; )
|
|
2508
2513
|
T.parentNode.scrollTop && E.push([T.parentNode, T.parentNode.scrollTop]), T = T.parentNode;
|
|
@@ -2513,8 +2518,8 @@ typeof window > "u" ? ((le = function(n) {
|
|
|
2513
2518
|
});
|
|
2514
2519
|
};
|
|
2515
2520
|
}(i), i.style.height = ""), v = r.boxSizing === "content-box" ? i.scrollHeight - (parseFloat(r.paddingTop) + parseFloat(r.paddingBottom)) : i.scrollHeight + parseFloat(r.borderTopWidth) + parseFloat(r.borderBottomWidth), r.maxHeight !== "none" && v > parseFloat(r.maxHeight) ? (r.overflowY === "hidden" && (i.style.overflow = "scroll"), v = parseFloat(r.maxHeight)) : r.overflowY !== "hidden" && (i.style.overflow = "hidden"), i.style.height = v + "px", p && (i.style.textAlign = p), _ && _(), o !== v && (i.dispatchEvent(new Event("autosize:resized", { bubbles: !0 })), o = v), C !== r.overflow && !p)) {
|
|
2516
|
-
var
|
|
2517
|
-
r.overflow === "hidden" && (i.style.textAlign =
|
|
2521
|
+
var $ = r.textAlign;
|
|
2522
|
+
r.overflow === "hidden" && (i.style.textAlign = $ === "start" ? "end" : "start"), f({ restoreTextAlign: $, testForHeightReduction: !0 });
|
|
2518
2523
|
}
|
|
2519
2524
|
}
|
|
2520
2525
|
function d() {
|
|
@@ -2525,7 +2530,7 @@ typeof window > "u" ? ((le = function(n) {
|
|
|
2525
2530
|
}).destroy = function(n) {
|
|
2526
2531
|
return n && Array.prototype.forEach.call(n.length ? n : [n], Ti), n;
|
|
2527
2532
|
}, le.update = function(n) {
|
|
2528
|
-
return n && Array.prototype.forEach.call(n.length ? n : [n],
|
|
2533
|
+
return n && Array.prototype.forEach.call(n.length ? n : [n], xi), n;
|
|
2529
2534
|
});
|
|
2530
2535
|
var Et = le;
|
|
2531
2536
|
class Ue {
|
|
@@ -2614,8 +2619,8 @@ class Fe {
|
|
|
2614
2619
|
return this.material.data;
|
|
2615
2620
|
}
|
|
2616
2621
|
}
|
|
2617
|
-
var
|
|
2618
|
-
class
|
|
2622
|
+
var N = /* @__PURE__ */ ((n) => (n.STYLE_CACHE = "ai-chat-style-cache", n.MINIMIZE_STYLY_CHCHE = "ai-chat-minimize-style-cache", n.DATA_BASE_NAME = "ibiz-chat", n.DATA_TABLE_NAME = "history-message", n.DATA_TABLE_KEY_NAME = "id", n))(N || {});
|
|
2623
|
+
class Nt {
|
|
2619
2624
|
/**
|
|
2620
2625
|
* Creates an instance of AiChatController.
|
|
2621
2626
|
*
|
|
@@ -2691,7 +2696,7 @@ class $t {
|
|
|
2691
2696
|
*/
|
|
2692
2697
|
async fecthHistory() {
|
|
2693
2698
|
if (this.topicId) {
|
|
2694
|
-
const e = await
|
|
2699
|
+
const e = await W.getData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId);
|
|
2695
2700
|
if (e && e.data && e.data.length > 0)
|
|
2696
2701
|
return e.data.forEach((t) => {
|
|
2697
2702
|
const i = {
|
|
@@ -2724,7 +2729,7 @@ class $t {
|
|
|
2724
2729
|
data: this.messages.value.map((t) => t._origin),
|
|
2725
2730
|
timestamp: (/* @__PURE__ */ new Date()).getTime()
|
|
2726
2731
|
};
|
|
2727
|
-
await
|
|
2732
|
+
await W.updateData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, e);
|
|
2728
2733
|
}
|
|
2729
2734
|
/**
|
|
2730
2735
|
* 设置聊天框值
|
|
@@ -2797,9 +2802,9 @@ class $t {
|
|
|
2797
2802
|
*/
|
|
2798
2803
|
async question(e) {
|
|
2799
2804
|
let t = this.stringlyMaterialResource();
|
|
2800
|
-
t ? t += e : t = e, this.addMessage({
|
|
2805
|
+
t ? t += "\n".concat(e) : t = e, this.addMessage({
|
|
2801
2806
|
state: 30,
|
|
2802
|
-
messageid:
|
|
2807
|
+
messageid: Vt(),
|
|
2803
2808
|
role: "USER",
|
|
2804
2809
|
type: "DEFAULT",
|
|
2805
2810
|
content: t
|
|
@@ -2857,7 +2862,7 @@ class $t {
|
|
|
2857
2862
|
*/
|
|
2858
2863
|
copyMessage(e) {
|
|
2859
2864
|
const t = e.content;
|
|
2860
|
-
|
|
2865
|
+
qt.copy(t), this.opts.action && this.opts.action("copymsg", e);
|
|
2861
2866
|
}
|
|
2862
2867
|
/**
|
|
2863
2868
|
* 新建对话
|
|
@@ -2865,7 +2870,7 @@ class $t {
|
|
|
2865
2870
|
* @memberof AiChatController
|
|
2866
2871
|
*/
|
|
2867
2872
|
async newDialogue() {
|
|
2868
|
-
this.messages.value.length = 0, this.topicId && await
|
|
2873
|
+
this.messages.value.length = 0, this.topicId && await W.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, this.topicId), this.opts.history(this.context, this.params, {
|
|
2869
2874
|
appDataEntityId: this.appDataEntityId
|
|
2870
2875
|
});
|
|
2871
2876
|
}
|
|
@@ -2903,7 +2908,7 @@ class $t {
|
|
|
2903
2908
|
t !== -1 && (this.materials.value.splice(t, 1), this.materials.value = [...this.materials.value]);
|
|
2904
2909
|
}
|
|
2905
2910
|
}
|
|
2906
|
-
class
|
|
2911
|
+
class Si {
|
|
2907
2912
|
/**
|
|
2908
2913
|
* Creates an instance of AiTopicController.
|
|
2909
2914
|
* @author tony001
|
|
@@ -2990,17 +2995,17 @@ class xi {
|
|
|
2990
2995
|
let r = !0;
|
|
2991
2996
|
if (e.beforeDelete && (r = await e.beforeDelete(t, i, s, o)), !r)
|
|
2992
2997
|
return;
|
|
2993
|
-
const
|
|
2994
|
-
|
|
2995
|
-
const u = this.topics.value.map((
|
|
2996
|
-
appid:
|
|
2997
|
-
id:
|
|
2998
|
-
type:
|
|
2999
|
-
caption:
|
|
3000
|
-
url:
|
|
3001
|
-
aiChat:
|
|
2998
|
+
const c = this.topics.value.findIndex((a) => a.id === s.id);
|
|
2999
|
+
c !== -1 && (this.topics.value.splice(c, 1), this.topics.value = [...this.topics.value]);
|
|
3000
|
+
const u = this.topics.value.map((a) => ({
|
|
3001
|
+
appid: a.appid,
|
|
3002
|
+
id: a.id,
|
|
3003
|
+
type: a.type,
|
|
3004
|
+
caption: a.caption,
|
|
3005
|
+
url: a.url,
|
|
3006
|
+
aiChat: a.aiChat
|
|
3002
3007
|
})), f = e.configService(e.appid, "aitopics", e.type);
|
|
3003
|
-
await (f == null ? void 0 : f.save(u)), await
|
|
3008
|
+
await (f == null ? void 0 : f.save(u)), await W.deleteData(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, s.id), this.topics.value.length > 0 && s.id === ((d = this.activedTopic.value) == null ? void 0 : d.id) && this.handleTopicChange(this.topics.value[0]);
|
|
3004
3009
|
}
|
|
3005
3010
|
/**
|
|
3006
3011
|
* 处理选中变化
|
|
@@ -3025,13 +3030,13 @@ class xi {
|
|
|
3025
3030
|
*/
|
|
3026
3031
|
async handleTopicAction(e, t, i) {
|
|
3027
3032
|
var o, r;
|
|
3028
|
-
const s = this.topics.value.find((
|
|
3033
|
+
const s = this.topics.value.find((c) => c.id === t.id);
|
|
3029
3034
|
if (this.currentTopicOptions && s && s.aiChat) {
|
|
3030
3035
|
const {
|
|
3031
|
-
context:
|
|
3036
|
+
context: c,
|
|
3032
3037
|
params: u
|
|
3033
3038
|
} = s.aiChat;
|
|
3034
|
-
e === "DELETE" && await this.removeTopic(this.currentTopicOptions,
|
|
3039
|
+
e === "DELETE" && await this.removeTopic(this.currentTopicOptions, c, u, s, i), (r = (o = this.currentTopicOptions).action) == null || r.call(o, e, c, u, t, i);
|
|
3035
3040
|
}
|
|
3036
3041
|
}
|
|
3037
3042
|
}
|
|
@@ -3065,7 +3070,7 @@ class Ei extends ln {
|
|
|
3065
3070
|
}
|
|
3066
3071
|
}
|
|
3067
3072
|
}
|
|
3068
|
-
class
|
|
3073
|
+
class Ni extends ln {
|
|
3069
3074
|
/**
|
|
3070
3075
|
* 执行操作
|
|
3071
3076
|
*
|
|
@@ -3078,21 +3083,21 @@ class $i extends ln {
|
|
|
3078
3083
|
multiple: s,
|
|
3079
3084
|
accept: o,
|
|
3080
3085
|
maxSize: r,
|
|
3081
|
-
onSelect:
|
|
3086
|
+
onSelect: c,
|
|
3082
3087
|
onUpload: u,
|
|
3083
3088
|
onSuccess: f,
|
|
3084
3089
|
onError: d,
|
|
3085
|
-
onProgress:
|
|
3090
|
+
onProgress: a
|
|
3086
3091
|
} = i, _ = {
|
|
3087
3092
|
multiple: s || !0,
|
|
3088
3093
|
accept: o || "*/*",
|
|
3089
3094
|
maxSize: r || 5 * 1024 * 1024,
|
|
3090
3095
|
onSelect: (h) => {
|
|
3091
|
-
|
|
3092
|
-
const
|
|
3093
|
-
Object.assign(
|
|
3096
|
+
c == null || c(h), h.length > 0 && h.forEach((p) => {
|
|
3097
|
+
const g = this.buildMaterialObject(p);
|
|
3098
|
+
Object.assign(g.metadata, {
|
|
3094
3099
|
state: "uploading"
|
|
3095
|
-
}), this.aiChat.addMaterial(
|
|
3100
|
+
}), this.aiChat.addMaterial(g);
|
|
3096
3101
|
});
|
|
3097
3102
|
},
|
|
3098
3103
|
onUpload: async (h, p) => u(h, p, {
|
|
@@ -3101,7 +3106,7 @@ class $i extends ln {
|
|
|
3101
3106
|
}),
|
|
3102
3107
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3103
3108
|
onSuccess: (h, p) => {
|
|
3104
|
-
const
|
|
3109
|
+
const g = {
|
|
3105
3110
|
id: h.id,
|
|
3106
3111
|
type: "ossfile",
|
|
3107
3112
|
data: {
|
|
@@ -3118,19 +3123,19 @@ class $i extends ln {
|
|
|
3118
3123
|
state: "successed"
|
|
3119
3124
|
}
|
|
3120
3125
|
};
|
|
3121
|
-
this.aiChat.replaceMaterial(p.name,
|
|
3126
|
+
this.aiChat.replaceMaterial(p.name, g), f == null || f(h, p);
|
|
3122
3127
|
},
|
|
3123
3128
|
onError: (h, p) => {
|
|
3124
|
-
const
|
|
3125
|
-
Object.assign(
|
|
3129
|
+
const g = this.buildMaterialObject(p);
|
|
3130
|
+
Object.assign(g.metadata, {
|
|
3126
3131
|
state: "failed"
|
|
3127
|
-
}), this.aiChat.replaceMaterial(p.name,
|
|
3132
|
+
}), this.aiChat.replaceMaterial(p.name, g), d == null || d(h, p);
|
|
3128
3133
|
},
|
|
3129
3134
|
onProgress: (h, p) => {
|
|
3130
|
-
|
|
3135
|
+
a == null || a(h, p);
|
|
3131
3136
|
}
|
|
3132
3137
|
};
|
|
3133
|
-
new
|
|
3138
|
+
new xn(_).openFilePicker();
|
|
3134
3139
|
}
|
|
3135
3140
|
/**
|
|
3136
3141
|
* 构建素材对象
|
|
@@ -3156,17 +3161,17 @@ class $i extends ln {
|
|
|
3156
3161
|
};
|
|
3157
3162
|
}
|
|
3158
3163
|
}
|
|
3159
|
-
class
|
|
3164
|
+
class $t {
|
|
3160
3165
|
static getMaterialHelper(e, t) {
|
|
3161
3166
|
switch (e) {
|
|
3162
3167
|
case "ossfile":
|
|
3163
|
-
return new
|
|
3168
|
+
return new Ni(t);
|
|
3164
3169
|
default:
|
|
3165
3170
|
return new Ei(t);
|
|
3166
3171
|
}
|
|
3167
3172
|
}
|
|
3168
3173
|
}
|
|
3169
|
-
class
|
|
3174
|
+
class $i {
|
|
3170
3175
|
/**
|
|
3171
3176
|
* Creates an instance of ChatController.
|
|
3172
3177
|
* @author tony001
|
|
@@ -3227,7 +3232,7 @@ class Ni {
|
|
|
3227
3232
|
* @type {(AiChatController | undefined)}
|
|
3228
3233
|
*/
|
|
3229
3234
|
w(this, "aiChat");
|
|
3230
|
-
this.aiTopic = new
|
|
3235
|
+
this.aiTopic = new Si(this);
|
|
3231
3236
|
}
|
|
3232
3237
|
/**
|
|
3233
3238
|
* 初始化IndexDB
|
|
@@ -3237,7 +3242,7 @@ class Ni {
|
|
|
3237
3242
|
* @return {*} {Promise<void>}
|
|
3238
3243
|
*/
|
|
3239
3244
|
async initIndexDB() {
|
|
3240
|
-
await
|
|
3245
|
+
await W.checkTableExists(N.DATA_BASE_NAME, N.DATA_TABLE_NAME) || await W.createTable(N.DATA_BASE_NAME, N.DATA_TABLE_NAME, N.DATA_TABLE_KEY_NAME, !1);
|
|
3241
3246
|
}
|
|
3242
3247
|
/**
|
|
3243
3248
|
* 创建聊天窗口(会同时显示出来)
|
|
@@ -3263,7 +3268,7 @@ class Ni {
|
|
|
3263
3268
|
}
|
|
3264
3269
|
}), await this.aiTopic.updateCurrentTopic(i)), Object.assign(t, {
|
|
3265
3270
|
topicId: i == null ? void 0 : i.id
|
|
3266
|
-
}), this.aiChat = new
|
|
3271
|
+
}), this.aiChat = new Nt(t), te(I(At, {
|
|
3267
3272
|
aiTopic: this.aiTopic,
|
|
3268
3273
|
aiChat: this.aiChat,
|
|
3269
3274
|
mode: e.mode ? e.mode : "DEFAULT",
|
|
@@ -3304,7 +3309,7 @@ class Ni {
|
|
|
3304
3309
|
questionToolbarItems: e.aiChat.questionToolbarItems,
|
|
3305
3310
|
appDataEntityId: e.aiChat.appDataEntityId,
|
|
3306
3311
|
topicId: e.id
|
|
3307
|
-
}), this.aiChat = new
|
|
3312
|
+
}), this.aiChat = new Nt(t), this.container && (te(null, this.container), te(I(At, {
|
|
3308
3313
|
aiTopic: this.aiTopic,
|
|
3309
3314
|
aiChat: this.aiChat,
|
|
3310
3315
|
mode: (i = this.backupChatOptions) != null && i.mode ? this.backupChatOptions.mode : "DEFAULT",
|
|
@@ -3352,7 +3357,7 @@ class Ni {
|
|
|
3352
3357
|
this.container && (te(null, this.container), this.container.remove(), this.container = void 0);
|
|
3353
3358
|
}
|
|
3354
3359
|
}
|
|
3355
|
-
const Oi = new
|
|
3360
|
+
const Oi = new $i();
|
|
3356
3361
|
const ki = new M("chat-input-material"), Mi = (n) => {
|
|
3357
3362
|
const e = n.controller.materials;
|
|
3358
3363
|
return l("div", {
|
|
@@ -3375,26 +3380,26 @@ const un = ({
|
|
|
3375
3380
|
onAction: r
|
|
3376
3381
|
// 接收行为事件回调
|
|
3377
3382
|
}) => {
|
|
3378
|
-
const
|
|
3379
|
-
|
|
3383
|
+
const c = new M("pop"), u = En(dn), [f, d] = Je(s || !1), a = K(null), _ = K(null);
|
|
3384
|
+
V(() => {
|
|
3380
3385
|
s !== void 0 && d(s);
|
|
3381
|
-
}, [s]),
|
|
3386
|
+
}, [s]), V(() => (_.current || (_.current = document.createElement("div"), _.current.className = c.b("content-container"), document.body.appendChild(_.current)), () => {
|
|
3382
3387
|
_.current && document.body.removeChild(_.current);
|
|
3383
|
-
}), []),
|
|
3388
|
+
}), []), V(() => {
|
|
3384
3389
|
const h = (p) => {
|
|
3385
|
-
|
|
3390
|
+
a.current && !a.current.contains(p.target) && !p.target.closest(".".concat(c.b("content"))) && !p.target.closest(".ibiz-quick-edit") && !p.target.closest(".ibiz-picker__transfer") && (d(!1), o == null || o(!1));
|
|
3386
3391
|
};
|
|
3387
3392
|
return f && document.addEventListener("mousedown", h), () => {
|
|
3388
3393
|
document.removeEventListener("mousedown", h);
|
|
3389
3394
|
};
|
|
3390
3395
|
}, [f, o]);
|
|
3391
3396
|
const v = () => {
|
|
3392
|
-
if (!
|
|
3397
|
+
if (!a.current)
|
|
3393
3398
|
return {};
|
|
3394
|
-
const h =
|
|
3399
|
+
const h = a.current.getBoundingClientRect(), p = {
|
|
3395
3400
|
position: "absolute",
|
|
3396
3401
|
zIndex: u.zIndex + 1
|
|
3397
|
-
},
|
|
3402
|
+
}, g = {
|
|
3398
3403
|
bottom: {
|
|
3399
3404
|
top: h.bottom + window.scrollY,
|
|
3400
3405
|
left: h.left + window.scrollX
|
|
@@ -3418,14 +3423,14 @@ const un = ({
|
|
|
3418
3423
|
};
|
|
3419
3424
|
return {
|
|
3420
3425
|
...p,
|
|
3421
|
-
...
|
|
3426
|
+
...g[i]
|
|
3422
3427
|
};
|
|
3423
3428
|
};
|
|
3424
3429
|
return l("span", {
|
|
3425
|
-
className: "".concat(
|
|
3430
|
+
className: "".concat(c.b("trigger-container")),
|
|
3426
3431
|
children: [l("span", {
|
|
3427
|
-
className: "".concat(
|
|
3428
|
-
ref:
|
|
3432
|
+
className: "".concat(c.b("trigger-element")),
|
|
3433
|
+
ref: a,
|
|
3429
3434
|
onClick: (h) => {
|
|
3430
3435
|
h.stopPropagation();
|
|
3431
3436
|
const p = !f;
|
|
@@ -3433,19 +3438,19 @@ const un = ({
|
|
|
3433
3438
|
},
|
|
3434
3439
|
children: n
|
|
3435
3440
|
}), f && _.current && hi(l("div", {
|
|
3436
|
-
className: "".concat(
|
|
3441
|
+
className: "".concat(c.b("content"), " pop-").concat(i),
|
|
3437
3442
|
style: v(),
|
|
3438
3443
|
children: t || (e == null ? void 0 : e.map((h) => l("div", {
|
|
3439
|
-
className:
|
|
3444
|
+
className: c.b("content-item"),
|
|
3440
3445
|
onMouseDown: (p) => {
|
|
3441
3446
|
p.stopPropagation(), r == null || r(h.id, p);
|
|
3442
3447
|
},
|
|
3443
3448
|
children: [h.icon && l("img", {
|
|
3444
|
-
className:
|
|
3449
|
+
className: c.b("content-item__icon"),
|
|
3445
3450
|
src: h.icon,
|
|
3446
3451
|
alt: h.caption
|
|
3447
3452
|
}), l("div", {
|
|
3448
|
-
className:
|
|
3453
|
+
className: c.b("content-item__caption"),
|
|
3449
3454
|
children: h.caption
|
|
3450
3455
|
})]
|
|
3451
3456
|
}, h.id)))
|
|
@@ -3453,39 +3458,40 @@ const un = ({
|
|
|
3453
3458
|
});
|
|
3454
3459
|
}, k = new M("chat-input"), kt = window.SpeechRecognition || window.webkitSpeechRecognition, Mt = (n) => {
|
|
3455
3460
|
var p;
|
|
3456
|
-
const [e, t] = Je(!1), i = K(null), s = n.controller.input, o =
|
|
3457
|
-
kt && !
|
|
3461
|
+
const [e, t] = Je(!1), i = K(null), s = n.controller.input, o = q(!1), r = q(!1), c = K();
|
|
3462
|
+
kt && !c.current && (c.current = new kt(), c.current.onstart = () => {
|
|
3458
3463
|
r.value = !0;
|
|
3459
|
-
},
|
|
3464
|
+
}, c.current.onend = () => {
|
|
3460
3465
|
r.value = !1;
|
|
3461
|
-
},
|
|
3462
|
-
var C,
|
|
3463
|
-
const b = (T = (
|
|
3466
|
+
}, c.current.onresult = (g) => {
|
|
3467
|
+
var C, $, T;
|
|
3468
|
+
const b = (T = ($ = (C = g.results) == null ? void 0 : C[0]) == null ? void 0 : $[0]) == null ? void 0 : T.transcript;
|
|
3464
3469
|
b && (s.value = "".concat(s.value).concat(b));
|
|
3465
3470
|
});
|
|
3466
3471
|
const u = () => {
|
|
3467
|
-
|
|
3468
|
-
}, f = dt((
|
|
3469
|
-
s.value =
|
|
3472
|
+
c.current && !r.value && c.current.start();
|
|
3473
|
+
}, f = dt((g) => {
|
|
3474
|
+
s.value = g.target.value;
|
|
3470
3475
|
}, [s]), d = O(() => s.value.length <= 0 || o.value === !0);
|
|
3471
|
-
|
|
3476
|
+
V(() => (i.current && Et(i.current), () => {
|
|
3472
3477
|
i.current && Et.destroy(i.current);
|
|
3473
3478
|
}), [i]);
|
|
3474
|
-
const
|
|
3479
|
+
const a = dt(async () => {
|
|
3475
3480
|
o.value = !0;
|
|
3476
3481
|
try {
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3482
|
+
const g = s.value;
|
|
3483
|
+
s.value = "", await n.controller.question(g);
|
|
3484
|
+
} catch (g) {
|
|
3485
|
+
console.error(g);
|
|
3480
3486
|
} finally {
|
|
3481
3487
|
o.value = !1;
|
|
3482
3488
|
}
|
|
3483
|
-
}, [s, o]), _ = (
|
|
3484
|
-
|
|
3485
|
-
}, v = async (
|
|
3486
|
-
await
|
|
3487
|
-
}, h = async (
|
|
3488
|
-
await
|
|
3489
|
+
}, [s, o]), _ = (g) => {
|
|
3490
|
+
g.code === "Enter" && (g.stopPropagation(), g.shiftKey === !1 && a());
|
|
3491
|
+
}, v = async (g) => {
|
|
3492
|
+
await $t.getMaterialHelper("ossfile", n.controller).excuteAction(g), t(!1);
|
|
3493
|
+
}, h = async (g, b) => {
|
|
3494
|
+
await $t.getMaterialHelper("common", n.controller).excuteAction(g, b), t(!1);
|
|
3489
3495
|
};
|
|
3490
3496
|
return l("div", {
|
|
3491
3497
|
className: k.b("wrapper"),
|
|
@@ -3517,8 +3523,8 @@ const un = ({
|
|
|
3517
3523
|
className: k.b("pop-actions"),
|
|
3518
3524
|
children: [l("div", {
|
|
3519
3525
|
className: k.b("pop-action-item"),
|
|
3520
|
-
onClick: (
|
|
3521
|
-
v(
|
|
3526
|
+
onClick: (g) => {
|
|
3527
|
+
v(g);
|
|
3522
3528
|
},
|
|
3523
3529
|
children: [l("span", {
|
|
3524
3530
|
className: k.b("pop-action-item-icon"),
|
|
@@ -3527,19 +3533,19 @@ const un = ({
|
|
|
3527
3533
|
className: k.b("pop-action-item-title"),
|
|
3528
3534
|
children: "文件资料"
|
|
3529
3535
|
})]
|
|
3530
|
-
}), (p = n.questionToolbarItems) == null ? void 0 : p.map((
|
|
3536
|
+
}), (p = n.questionToolbarItems) == null ? void 0 : p.map((g) => l("div", {
|
|
3531
3537
|
className: k.b("pop-action-item"),
|
|
3532
3538
|
onClick: (b) => {
|
|
3533
|
-
h(b,
|
|
3539
|
+
h(b, g);
|
|
3534
3540
|
},
|
|
3535
3541
|
children: [l("span", {
|
|
3536
3542
|
className: k.b("pop-action-item-icon"),
|
|
3537
|
-
children: typeof
|
|
3543
|
+
children: typeof g.icon == "function" ? g.icon(I) : g.icon
|
|
3538
3544
|
}), l("span", {
|
|
3539
3545
|
className: k.b("pop-action-item-title"),
|
|
3540
|
-
children: typeof
|
|
3546
|
+
children: typeof g.label == "function" ? g.label(I) : g.label
|
|
3541
3547
|
})]
|
|
3542
|
-
},
|
|
3548
|
+
}, g.id))]
|
|
3543
3549
|
}),
|
|
3544
3550
|
position: "top-left",
|
|
3545
3551
|
isOpen: e,
|
|
@@ -3550,11 +3556,11 @@ const un = ({
|
|
|
3550
3556
|
title: r.value ? "语音输入中..." : "语音输入",
|
|
3551
3557
|
className: "".concat(k.be("action-wrapper", "action-item")),
|
|
3552
3558
|
onClick: u,
|
|
3553
|
-
children: r.value ? l(
|
|
3559
|
+
children: r.value ? l(qn, {}) : l(Vn, {})
|
|
3554
3560
|
}), l("div", {
|
|
3555
3561
|
title: o.value ? "思考中..." : "发送消息",
|
|
3556
3562
|
className: "".concat(k.be("action-wrapper", "action-item"), " ").concat(k.is("disabled", d.value), " ").concat(k.is("loading", o.value)),
|
|
3557
|
-
onClick:
|
|
3563
|
+
onClick: a,
|
|
3558
3564
|
disabled: d,
|
|
3559
3565
|
children: l(Ln, {})
|
|
3560
3566
|
})]
|
|
@@ -3564,23 +3570,25 @@ const un = ({
|
|
|
3564
3570
|
};
|
|
3565
3571
|
const U = new M("chat-topic-item"), Ai = (n) => {
|
|
3566
3572
|
const {
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
},
|
|
3575
|
-
d
|
|
3573
|
+
controller: e,
|
|
3574
|
+
topic: t,
|
|
3575
|
+
onClick: i,
|
|
3576
|
+
onAction: s
|
|
3577
|
+
} = n, o = O(() => {
|
|
3578
|
+
var a;
|
|
3579
|
+
return ((a = e.activedTopic.value) == null ? void 0 : a.id) === t.id;
|
|
3580
|
+
}), [r, c] = Je(!1), u = (d) => {
|
|
3581
|
+
d.stopPropagation(), s("LINK", d);
|
|
3582
|
+
}, f = (d, a) => {
|
|
3583
|
+
d === "DELETE" && s("DELETE", a), c(!1);
|
|
3576
3584
|
};
|
|
3577
3585
|
return l("div", {
|
|
3578
|
-
className: "".concat(U.b(), " ").concat(U.is("active",
|
|
3579
|
-
onClick:
|
|
3586
|
+
className: "".concat(U.b(), " ").concat(U.is("active", o.value)),
|
|
3587
|
+
onClick: i.bind(void 0),
|
|
3580
3588
|
children: [l("div", {
|
|
3581
3589
|
className: U.b("caption"),
|
|
3582
|
-
title:
|
|
3583
|
-
children:
|
|
3590
|
+
title: t.caption,
|
|
3591
|
+
children: t.caption
|
|
3584
3592
|
}), l("div", {
|
|
3585
3593
|
className: U.b("icon"),
|
|
3586
3594
|
children: [l("span", {
|
|
@@ -3590,14 +3598,14 @@ const U = new M("chat-topic-item"), Ai = (n) => {
|
|
|
3590
3598
|
children: l(Yn, {
|
|
3591
3599
|
className: U.b("link-icon")
|
|
3592
3600
|
})
|
|
3593
|
-
}),
|
|
3601
|
+
}), o.value ? null : l(un, {
|
|
3594
3602
|
actions: [{
|
|
3595
3603
|
id: "DELETE",
|
|
3596
3604
|
caption: "删除话题"
|
|
3597
3605
|
}],
|
|
3598
3606
|
position: "bottom",
|
|
3599
3607
|
isOpen: r,
|
|
3600
|
-
onToggleOpen:
|
|
3608
|
+
onToggleOpen: c,
|
|
3601
3609
|
onAction: f.bind(void 0),
|
|
3602
3610
|
children: l("span", {
|
|
3603
3611
|
className: U.be("icon", "item"),
|
|
@@ -3618,16 +3626,12 @@ const Ii = new M("chat-topics"), Di = (n) => {
|
|
|
3618
3626
|
};
|
|
3619
3627
|
return l("div", {
|
|
3620
3628
|
className: Ii.b(),
|
|
3621
|
-
children: e.value.map((s) => {
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
onClick: () => t(s),
|
|
3628
|
-
onAction: (a, u) => i(a, s, u)
|
|
3629
|
-
}, s.id);
|
|
3630
|
-
})
|
|
3629
|
+
children: e.value.map((s) => l(Ai, {
|
|
3630
|
+
topic: s,
|
|
3631
|
+
controller: n.controller,
|
|
3632
|
+
onClick: () => t(s),
|
|
3633
|
+
onAction: (o, r) => i(o, s, r)
|
|
3634
|
+
}, s.id))
|
|
3631
3635
|
});
|
|
3632
3636
|
};
|
|
3633
3637
|
const dn = bn({
|
|
@@ -3646,7 +3650,7 @@ class At extends H {
|
|
|
3646
3650
|
y: 0,
|
|
3647
3651
|
width: 600,
|
|
3648
3652
|
height: window.innerHeight,
|
|
3649
|
-
minWidth:
|
|
3653
|
+
minWidth: 500,
|
|
3650
3654
|
minHeight: 300
|
|
3651
3655
|
});
|
|
3652
3656
|
w(this, "minimizeData", {
|
|
@@ -3685,17 +3689,19 @@ class At extends H {
|
|
|
3685
3689
|
calcWindowStyle() {
|
|
3686
3690
|
var t, i;
|
|
3687
3691
|
return {
|
|
3688
|
-
left: "".concat(this.data.x, "
|
|
3689
|
-
top: "".concat(this.data.y, "
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
+
left: "".concat(this.data.x / window.innerWidth * 100, "%"),
|
|
3693
|
+
top: "".concat(this.data.y / window.innerHeight * 100, "%"),
|
|
3694
|
+
width: "".concat(this.data.width / window.innerWidth * 100, "%"),
|
|
3695
|
+
height: "".concat(this.data.height / window.innerHeight * 100, "%"),
|
|
3696
|
+
minWidth: "".concat(this.data.minWidth, "px"),
|
|
3697
|
+
minHeight: "".concat(this.data.minHeight, "px"),
|
|
3692
3698
|
"z-index": ((i = (t = this.props.containerOptions) == null ? void 0 : t.zIndex) == null ? void 0 : i.toString()) || "10"
|
|
3693
3699
|
};
|
|
3694
3700
|
}
|
|
3695
3701
|
calcMinimizeStyle() {
|
|
3696
3702
|
return {
|
|
3697
|
-
left: "".concat(this.minimizeData.x, "
|
|
3698
|
-
top: "".concat(this.minimizeData.y, "
|
|
3703
|
+
left: "".concat(this.minimizeData.x / window.innerWidth * 100, "%"),
|
|
3704
|
+
top: "".concat(this.minimizeData.y / window.innerHeight * 100, "%"),
|
|
3699
3705
|
"z-index": "99999"
|
|
3700
3706
|
};
|
|
3701
3707
|
}
|
|
@@ -3703,26 +3709,26 @@ class At extends H {
|
|
|
3703
3709
|
Object.assign(this.containerRef.current.style, this.calcWindowStyle()), Object.assign(this.minimizeRef.current.style, this.calcMinimizeStyle());
|
|
3704
3710
|
}
|
|
3705
3711
|
componentDidMount() {
|
|
3706
|
-
const t = localStorage.getItem(
|
|
3712
|
+
const t = localStorage.getItem(N.MINIMIZE_STYLY_CHCHE);
|
|
3707
3713
|
t && (this.minimizeData = JSON.parse(t));
|
|
3708
|
-
const i = localStorage.getItem(
|
|
3714
|
+
const i = localStorage.getItem(N.STYLE_CACHE);
|
|
3709
3715
|
i && (this.data = JSON.parse(i), this.data.x > window.innerWidth && (this.data.x = window.innerWidth - 100), this.data.y > window.innerHeight && (this.data.y = window.innerHeight - 100)), this.setStyle();
|
|
3710
3716
|
const s = this.data;
|
|
3711
3717
|
this.minimizeRef.current.onmousedown = (o) => {
|
|
3712
3718
|
document.body.style.userSelect = "none";
|
|
3713
|
-
const r = o.clientX - this.minimizeRef.current.offsetLeft,
|
|
3714
|
-
this.minimizeData.x =
|
|
3719
|
+
const r = o.clientX - this.minimizeRef.current.offsetLeft, c = o.clientY - this.minimizeRef.current.offsetTop, u = Date.now(), f = (a) => {
|
|
3720
|
+
this.minimizeData.x = a.clientX - r, this.minimizeData.y = a.clientY - c, this.setStyle();
|
|
3715
3721
|
}, d = () => {
|
|
3716
|
-
const
|
|
3717
|
-
this.isDragging =
|
|
3722
|
+
const a = Date.now();
|
|
3723
|
+
this.isDragging = a - u > 300, document.body.style.userSelect = "", document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", d);
|
|
3718
3724
|
};
|
|
3719
3725
|
document.addEventListener("mousemove", f), document.addEventListener("mouseup", d);
|
|
3720
3726
|
}, this.dragHandle.current.onmousedown = (o) => {
|
|
3721
3727
|
if (this.disabled || this.state.isFullScreen)
|
|
3722
3728
|
return;
|
|
3723
3729
|
document.body.style.userSelect = "none";
|
|
3724
|
-
const r = o.clientX - this.containerRef.current.offsetLeft,
|
|
3725
|
-
s.x = d.clientX - r, s.y = d.clientY -
|
|
3730
|
+
const r = o.clientX - this.containerRef.current.offsetLeft, c = o.clientY - this.containerRef.current.offsetTop, u = (d) => {
|
|
3731
|
+
s.x = d.clientX - r, s.y = d.clientY - c, this.setStyle();
|
|
3726
3732
|
}, f = () => {
|
|
3727
3733
|
document.body.style.userSelect = "", document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f);
|
|
3728
3734
|
};
|
|
@@ -3764,7 +3770,7 @@ class At extends H {
|
|
|
3764
3770
|
});
|
|
3765
3771
|
}
|
|
3766
3772
|
componentWillUnmount() {
|
|
3767
|
-
localStorage.setItem(
|
|
3773
|
+
localStorage.setItem(N.STYLE_CACHE, JSON.stringify(this.data)), localStorage.setItem(N.MINIMIZE_STYLY_CHCHE, JSON.stringify(this.minimizeData));
|
|
3768
3774
|
}
|
|
3769
3775
|
/**
|
|
3770
3776
|
* 关闭聊天窗口
|