@somecat/ai-assist-sdk 1.1.1 → 1.1.4

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.
@@ -1,32 +1,33 @@
1
- import { defineComponent as q, reactive as J, openBlock as b, createElementBlock as O, normalizeClass as X, Fragment as U, createStaticVNode as he, createCommentVNode as j, renderList as rt, createElementVNode as h, createVNode as G, unref as N, toDisplayString as B, Transition as ge, withCtx as pe, createBlock as z, ref as M, shallowRef as ve, onMounted as W, watch as Pt, onUnmounted as mt, h as $t, nextTick as lt, withKeys as me, computed as et, withModifiers as Ft, Teleport as ye, withDirectives as At, vShow as jt, vModelText as we, normalizeStyle as ke, createApp as be } from "vue";
2
- import { r as Bt, p as It, u as Ce, c as Ae, g as Se, s as Ee, a as Te, b as xe, d as Re, e as wt, f as Oe, h as Me, i as Pe, j as De, k as te } from "../chunks/index-DctVgLU4.mjs";
3
- import { SearchOutlined as Le, CheckOutlined as He, CopyOutlined as Ne, RedoOutlined as $e, PlusOutlined as Fe } from "@ant-design/icons-vue";
4
- import { f as je, s as ct, a as Be, b as Ie, c as Qe, d as _e, e as Ye, g as Ve } from "../chunks/index-Co5SARS3.mjs";
5
- const We = "data:image/png;base64,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", Xe = {
1
+ import { defineComponent as nt, reactive as K, openBlock as g, createElementBlock as y, normalizeClass as U, Fragment as z, createStaticVNode as bt, createCommentVNode as Y, renderList as at, createElementVNode as n, createVNode as F, unref as M, toDisplayString as X, Transition as St, withCtx as Et, createBlock as j, withKeys as Rt, ref as T, nextTick as ut, computed as et, watch as wt, onMounted as q, onUnmounted as mt, withModifiers as ft, Teleport as Tt, withDirectives as gt, vShow as pt, vModelText as Dt, normalizeStyle as Mt, createApp as Ot } from "vue";
2
+ import { r as yt, p as kt, u as Ht, c as Pt, g as $t, s as Lt, a as Bt, b as Nt, d as Yt, e as vt, f as Qt, h as _t, i as Xt, j as Wt, k as Ct } from "../chunks/index-DctVgLU4.mjs";
3
+ import { SearchOutlined as Gt, CheckOutlined as Vt, CopyOutlined as Jt, RedoOutlined as Ft } from "@ant-design/icons-vue";
4
+ import { Icon as x } from "@iconify/vue";
5
+ import { f as Ut, s as it, a as jt, b as qt, c as xt } from "../chunks/index-CgnkZbtP.mjs";
6
+ const zt = "data:image/png;base64,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", Kt = {
6
7
  key: 0,
7
8
  class: "message-content ba-markdown"
8
- }, Ge = { class: "agent-thought__spinner" }, Ue = { class: "agent-thought__text" }, ze = ["onClick"], Je = { class: "thinking-block__title" }, qe = {
9
+ }, Zt = { class: "agent-thought__spinner" }, It = { class: "agent-thought__text" }, te = ["onClick"], ee = { class: "thinking-block__title" }, ne = {
9
10
  key: 0,
10
11
  class: "thinking-block__content"
11
- }, Ke = { key: 2 }, Ze = ["innerHTML"], tn = {
12
+ }, se = { key: 2 }, oe = ["innerHTML"], ae = {
12
13
  key: 0,
13
14
  class: "streaming-cursor"
14
- }, en = ["innerHTML"], nn = {
15
+ }, ie = ["innerHTML"], le = {
15
16
  key: 0,
16
17
  class: "streaming-cursor"
17
- }, sn = {
18
+ }, ce = {
18
19
  key: 3,
19
20
  class: "message-error"
20
- }, on = {
21
+ }, re = {
21
22
  key: 4,
22
23
  class: "message-toolbar"
23
- }, an = ["data-tooltip"], rn = {
24
+ }, ue = ["data-tooltip"], ve = {
24
25
  class: "tooltip-enhanced",
25
26
  "data-tooltip": "重新回答"
26
- }, ln = {
27
+ }, de = {
27
28
  key: 1,
28
29
  class: "message-content"
29
- }, cn = /* @__PURE__ */ q({
30
+ }, ge = /* @__PURE__ */ nt({
30
31
  __name: "MessageItem",
31
32
  props: {
32
33
  msg: {},
@@ -37,62 +38,62 @@ const We = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
37
38
  setMessageRef: { type: Function }
38
39
  },
39
40
  emits: ["regenerate"],
40
- setup(t, { emit: s }) {
41
- const e = J(/* @__PURE__ */ new Map());
42
- function o(a) {
43
- e.set(a, e.get(a) !== !0);
41
+ setup(t, { emit: v }) {
42
+ const a = K(/* @__PURE__ */ new Map());
43
+ function u(C) {
44
+ a.set(C, a.get(C) !== !0);
44
45
  }
45
- const n = J(/* @__PURE__ */ new Map());
46
- function i(a, c) {
47
- var f;
46
+ const i = K(/* @__PURE__ */ new Map());
47
+ function s(C, o) {
48
+ var h;
48
49
  try {
49
- let r = a.content;
50
- if (!r && ((f = a.segments) != null && f.length) && (r = a.segments.filter((u) => u.type !== "thinking" && u.type !== "agent_thought").map((u) => u.content).join(`
51
- `)), r) {
52
- const { copy: u } = Ce();
53
- u(r), n.set(c, !0), setTimeout(() => n.set(c, !1), 2e3);
50
+ let c = C.content;
51
+ if (!c && ((h = C.segments) != null && h.length) && (c = C.segments.filter((l) => l.type !== "thinking" && l.type !== "agent_thought").map((l) => l.content).join(`
52
+ `)), c) {
53
+ const { copy: l } = Ht();
54
+ l(c), i.set(o, !0), setTimeout(() => i.set(o, !1), 2e3);
54
55
  }
55
56
  } catch {
56
57
  }
57
58
  }
58
- return (a, c) => {
59
- var f;
60
- return b(), O("div", {
61
- class: X(["message", `${t.msg.type}-message`])
59
+ return (C, o) => {
60
+ var h;
61
+ return g(), y("div", {
62
+ class: U(["message", `${t.msg.type}-message`])
62
63
  }, [
63
- t.msg.type === "ai" ? (b(), O(U, { key: 0 }, [
64
- (t.msg.status === t.STATUS.THINKING || t.msg.status === t.STATUS.RETHINKING) && !t.msg.thinkingContent && !t.msg.content ? (b(), O("div", Xe, [...c[2] || (c[2] = [
65
- he('<div class="scale-animation-container"><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span></div>', 1)
66
- ])])) : j("", !0),
67
- t.msg.segments && t.msg.segments.length ? (b(), O("div", {
64
+ t.msg.type === "ai" ? (g(), y(z, { key: 0 }, [
65
+ (t.msg.status === t.STATUS.THINKING || t.msg.status === t.STATUS.RETHINKING) && !t.msg.thinkingContent && !t.msg.content ? (g(), y("div", Kt, [...o[2] || (o[2] = [
66
+ bt('<div class="scale-animation-container"><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span><span class="scale-dot"></span></div>', 1)
67
+ ])])) : Y("", !0),
68
+ t.msg.segments && t.msg.segments.length ? (g(), y("div", {
68
69
  key: 1,
69
70
  class: "message-content ba-markdown",
70
- ref: (r) => t.setMessageRef(r, t.index)
71
+ ref: (c) => t.setMessageRef(c, t.index)
71
72
  }, [
72
- (b(!0), O(U, null, rt(t.msg.segments, (r, u) => (b(), O(U, { key: u }, [
73
- r.type === "agent_thought" ? (b(), O("div", {
73
+ (g(!0), y(z, null, at(t.msg.segments, (c, l) => (g(), y(z, { key: l }, [
74
+ c.type === "agent_thought" ? (g(), y("div", {
74
75
  key: 0,
75
- class: X(["agent-thought", { "agent-thought--done": r.duration != null }])
76
+ class: U(["agent-thought", { "agent-thought--done": c.duration != null }])
76
77
  }, [
77
- h("span", Ge, [
78
- G(N(Le))
78
+ n("span", Zt, [
79
+ F(M(Gt))
79
80
  ]),
80
- h("span", Ue, B(r.duration != null ? "工具调用" : "工具调用中..."), 1)
81
- ], 2)) : r.type === "thinking" ? (b(), O("div", {
81
+ n("span", It, X(c.duration != null ? "工具调用" : "工具调用中..."), 1)
82
+ ], 2)) : c.type === "thinking" ? (g(), y("div", {
82
83
  key: 1,
83
- class: X(["thinking-block", {
84
- "thinking-block--expanded": e.get(u) === !0,
85
- "thinking-block--active": r.duration == null
84
+ class: U(["thinking-block", {
85
+ "thinking-block--expanded": a.get(l) === !0,
86
+ "thinking-block--active": c.duration == null
86
87
  }])
87
88
  }, [
88
- h("div", {
89
+ n("div", {
89
90
  class: "thinking-block__header",
90
- onClick: (d) => o(u)
91
+ onClick: (r) => u(l)
91
92
  }, [
92
- c[4] || (c[4] = h("span", { class: "thinking-block__indicator" }, null, -1)),
93
- h("span", Je, B(r.duration != null ? "深度思考" : "深度思考中"), 1),
94
- (b(), O("svg", {
95
- class: X(["thinking-block__arrow", { "thinking-block__arrow--down": e.get(u) === !0 }]),
93
+ o[4] || (o[4] = n("span", { class: "thinking-block__indicator" }, null, -1)),
94
+ n("span", ee, X(c.duration != null ? "深度思考" : "深度思考中"), 1),
95
+ (g(), y("svg", {
96
+ class: U(["thinking-block__arrow", { "thinking-block__arrow--down": a.get(l) === !0 }]),
96
97
  viewBox: "0 0 24 24",
97
98
  width: "14",
98
99
  height: "14",
@@ -101,1125 +102,69 @@ const We = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAA
101
102
  "stroke-width": "2.5",
102
103
  "stroke-linecap": "round",
103
104
  "stroke-linejoin": "round"
104
- }, [...c[3] || (c[3] = [
105
- h("polyline", { points: "6 9 12 15 18 9" }, null, -1)
105
+ }, [...o[3] || (o[3] = [
106
+ n("polyline", { points: "6 9 12 15 18 9" }, null, -1)
106
107
  ])], 2))
107
- ], 8, ze),
108
- G(ge, { name: "thinking-expand" }, {
109
- default: pe(() => [
110
- e.get(u) === !0 ? (b(), O("div", qe, B(r.content), 1)) : j("", !0)
108
+ ], 8, te),
109
+ F(St, { name: "thinking-expand" }, {
110
+ default: Et(() => [
111
+ a.get(l) === !0 ? (g(), y("div", ne, X(c.content), 1)) : Y("", !0)
111
112
  ]),
112
113
  _: 2
113
114
  }, 1024)
114
- ], 2)) : (b(), O("div", Ke, [
115
- h("div", {
116
- innerHTML: N(Bt)(N(It)(t.getSegmentDisplayContent(t.index, u, r, t.msg)))
117
- }, null, 8, Ze)
115
+ ], 2)) : (g(), y("div", se, [
116
+ n("div", {
117
+ innerHTML: M(yt)(M(kt)(t.getSegmentDisplayContent(t.index, l, c, t.msg)))
118
+ }, null, 8, oe)
118
119
  ]))
119
120
  ], 64))), 128)),
120
- t.msg.status === t.STATUS.ANSWERING ? (b(), O("span", tn)) : j("", !0)
121
- ], 512)) : j("", !0),
122
- !((f = t.msg.segments) != null && f.length) && t.msg.content ? (b(), O("div", {
121
+ t.msg.status === t.STATUS.ANSWERING ? (g(), y("span", ae)) : Y("", !0)
122
+ ], 512)) : Y("", !0),
123
+ !((h = t.msg.segments) != null && h.length) && t.msg.content ? (g(), y("div", {
123
124
  key: 2,
124
125
  class: "message-content ba-markdown",
125
- ref: (r) => t.setMessageRef(r, t.index)
126
+ ref: (c) => t.setMessageRef(c, t.index)
126
127
  }, [
127
- h("div", {
128
- innerHTML: N(Bt)(N(It)(t.displayedContent.get(t.index) ?? t.msg.content))
129
- }, null, 8, en),
130
- t.msg.status === t.STATUS.ANSWERING ? (b(), O("span", nn)) : j("", !0)
131
- ], 512)) : j("", !0),
132
- t.msg.errorMessage ? (b(), O("div", sn, [
133
- c[5] || (c[5] = h("span", { class: "message-error__icon" }, "⚠️", -1)),
134
- h("span", null, B(t.msg.errorMessage), 1)
135
- ])) : j("", !0),
136
- t.msg.status === t.STATUS.COMPLETED || t.msg.status === t.STATUS.STOP ? (b(), O("div", on, [
137
- h("div", {
128
+ n("div", {
129
+ innerHTML: M(yt)(M(kt)(t.displayedContent.get(t.index) ?? t.msg.content))
130
+ }, null, 8, ie),
131
+ t.msg.status === t.STATUS.ANSWERING ? (g(), y("span", le)) : Y("", !0)
132
+ ], 512)) : Y("", !0),
133
+ t.msg.errorMessage ? (g(), y("div", ce, [
134
+ o[5] || (o[5] = n("span", { class: "message-error__icon" }, "⚠️", -1)),
135
+ n("span", null, X(t.msg.errorMessage), 1)
136
+ ])) : Y("", !0),
137
+ t.msg.status === t.STATUS.COMPLETED || t.msg.status === t.STATUS.STOP ? (g(), y("div", re, [
138
+ n("div", {
138
139
  class: "tooltip-enhanced",
139
- "data-tooltip": n.get(t.index) ? "已复制" : "复制回答"
140
+ "data-tooltip": i.get(t.index) ? "已复制" : "复制回答"
140
141
  }, [
141
- n.get(t.index) ? (b(), z(N(He), {
142
+ i.get(t.index) ? (g(), j(M(Vt), {
142
143
  key: 0,
143
144
  class: "message-toolbar__check"
144
- })) : (b(), z(N(Ne), {
145
+ })) : (g(), j(M(Jt), {
145
146
  key: 1,
146
- onClick: c[0] || (c[0] = (r) => i(t.msg, t.index))
147
+ onClick: o[0] || (o[0] = (c) => s(t.msg, t.index))
147
148
  }))
148
- ], 8, an),
149
- h("div", rn, [
150
- G(N($e), {
151
- onClick: c[1] || (c[1] = (r) => a.$emit("regenerate"))
149
+ ], 8, ue),
150
+ n("div", ve, [
151
+ F(M(Ft), {
152
+ onClick: o[1] || (o[1] = (c) => C.$emit("regenerate"))
152
153
  })
153
154
  ])
154
- ])) : j("", !0)
155
- ], 64)) : (b(), O("div", ln, B(t.msg.content), 1))
155
+ ])) : Y("", !0)
156
+ ], 64)) : (g(), y("div", de, X(t.msg.content), 1))
156
157
  ], 2);
157
158
  };
158
159
  }
159
- }), ee = /^[a-z0-9]+(-[a-z0-9]+)*$/, kt = (t, s, e, o = "") => {
160
- const n = t.split(":");
161
- if (t.slice(0, 1) === "@") {
162
- if (n.length < 2 || n.length > 3) return null;
163
- o = n.shift().slice(1);
164
- }
165
- if (n.length > 3 || !n.length) return null;
166
- if (n.length > 1) {
167
- const c = n.pop(), f = n.pop(), r = {
168
- provider: n.length > 0 ? n[0] : o,
169
- prefix: f,
170
- name: c
171
- };
172
- return s && !gt(r) ? null : r;
173
- }
174
- const i = n[0], a = i.split("-");
175
- if (a.length > 1) {
176
- const c = {
177
- provider: o,
178
- prefix: a.shift(),
179
- name: a.join("-")
180
- };
181
- return s && !gt(c) ? null : c;
182
- }
183
- if (e && o === "") {
184
- const c = {
185
- provider: o,
186
- prefix: "",
187
- name: i
188
- };
189
- return s && !gt(c, e) ? null : c;
190
- }
191
- return null;
192
- }, gt = (t, s) => t ? !!((s && t.prefix === "" || t.prefix) && t.name) : !1;
193
- function un(t, s) {
194
- const e = t.icons, o = t.aliases || /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null);
195
- function i(a) {
196
- if (e[a]) return n[a] = [];
197
- if (!(a in n)) {
198
- n[a] = null;
199
- const c = o[a] && o[a].parent, f = c && i(c);
200
- f && (n[a] = [c].concat(f));
201
- }
202
- return n[a];
203
- }
204
- return Object.keys(e).concat(Object.keys(o)).forEach(i), n;
205
- }
206
- const ne = Object.freeze({
207
- left: 0,
208
- top: 0,
209
- width: 16,
210
- height: 16
211
- }), yt = Object.freeze({
212
- rotate: 0,
213
- vFlip: !1,
214
- hFlip: !1
215
- }), bt = Object.freeze({
216
- ...ne,
217
- ...yt
218
- }), xt = Object.freeze({
219
- ...bt,
220
- body: "",
221
- hidden: !1
222
- });
223
- function fn(t, s) {
224
- const e = {};
225
- !t.hFlip != !s.hFlip && (e.hFlip = !0), !t.vFlip != !s.vFlip && (e.vFlip = !0);
226
- const o = ((t.rotate || 0) + (s.rotate || 0)) % 4;
227
- return o && (e.rotate = o), e;
228
- }
229
- function Qt(t, s) {
230
- const e = fn(t, s);
231
- for (const o in xt) o in yt ? o in t && !(o in e) && (e[o] = yt[o]) : o in s ? e[o] = s[o] : o in t && (e[o] = t[o]);
232
- return e;
233
- }
234
- function dn(t, s, e) {
235
- const o = t.icons, n = t.aliases || /* @__PURE__ */ Object.create(null);
236
- let i = {};
237
- function a(c) {
238
- i = Qt(o[c] || n[c], i);
239
- }
240
- return a(s), e.forEach(a), Qt(t, i);
241
- }
242
- function se(t, s) {
243
- const e = [];
244
- if (typeof t != "object" || typeof t.icons != "object") return e;
245
- t.not_found instanceof Array && t.not_found.forEach((n) => {
246
- s(n, null), e.push(n);
247
- });
248
- const o = un(t);
249
- for (const n in o) {
250
- const i = o[n];
251
- i && (s(n, dn(t, n, i)), e.push(n));
252
- }
253
- return e;
254
- }
255
- const hn = {
256
- provider: "",
257
- aliases: {},
258
- not_found: {},
259
- ...ne
260
- };
261
- function St(t, s) {
262
- for (const e in s) if (e in t && typeof t[e] != typeof s[e]) return !1;
263
- return !0;
264
- }
265
- function oe(t) {
266
- if (typeof t != "object" || t === null) return null;
267
- const s = t;
268
- if (typeof s.prefix != "string" || !t.icons || typeof t.icons != "object" || !St(t, hn)) return null;
269
- const e = s.icons;
270
- for (const n in e) {
271
- const i = e[n];
272
- if (!n || typeof i.body != "string" || !St(i, xt)) return null;
273
- }
274
- const o = s.aliases || /* @__PURE__ */ Object.create(null);
275
- for (const n in o) {
276
- const i = o[n], a = i.parent;
277
- if (!n || typeof a != "string" || !e[a] && !o[a] || !St(i, xt)) return null;
278
- }
279
- return s;
280
- }
281
- const _t = /* @__PURE__ */ Object.create(null);
282
- function gn(t, s) {
283
- return {
284
- provider: t,
285
- prefix: s,
286
- icons: /* @__PURE__ */ Object.create(null),
287
- missing: /* @__PURE__ */ new Set()
288
- };
289
- }
290
- function nt(t, s) {
291
- const e = _t[t] || (_t[t] = /* @__PURE__ */ Object.create(null));
292
- return e[s] || (e[s] = gn(t, s));
293
- }
294
- function ie(t, s) {
295
- return oe(s) ? se(s, (e, o) => {
296
- o ? t.icons[e] = o : t.missing.add(e);
297
- }) : [];
298
- }
299
- function pn(t, s, e) {
300
- try {
301
- if (typeof e.body == "string")
302
- return t.icons[s] = { ...e }, !0;
303
- } catch {
304
- }
305
- return !1;
306
- }
307
- let ut = !1;
308
- function ae(t) {
309
- return typeof t == "boolean" && (ut = t), ut;
310
- }
311
- function vn(t) {
312
- const s = typeof t == "string" ? kt(t, !0, ut) : t;
313
- if (s) {
314
- const e = nt(s.provider, s.prefix), o = s.name;
315
- return e.icons[o] || (e.missing.has(o) ? null : void 0);
316
- }
317
- }
318
- function mn(t, s) {
319
- const e = kt(t, !0, ut);
320
- if (!e) return !1;
321
- const o = nt(e.provider, e.prefix);
322
- return s ? pn(o, e.name, s) : (o.missing.add(e.name), !0);
323
- }
324
- function yn(t, s) {
325
- if (typeof t != "object") return !1;
326
- if (typeof s != "string" && (s = t.provider || ""), ut && !s && !t.prefix) {
327
- let o = !1;
328
- return oe(t) && (t.prefix = "", se(t, (n, i) => {
329
- mn(n, i) && (o = !0);
330
- })), o;
331
- }
332
- const e = t.prefix;
333
- return gt({
334
- prefix: e,
335
- name: "a"
336
- }) ? !!ie(nt(s, e), t) : !1;
337
- }
338
- const re = Object.freeze({
339
- width: null,
340
- height: null
341
- }), le = Object.freeze({
342
- ...re,
343
- ...yt
344
- }), wn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, kn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
345
- function Yt(t, s, e) {
346
- if (s === 1) return t;
347
- if (e = e || 100, typeof t == "number") return Math.ceil(t * s * e) / e;
348
- if (typeof t != "string") return t;
349
- const o = t.split(wn);
350
- if (o === null || !o.length) return t;
351
- const n = [];
352
- let i = o.shift(), a = kn.test(i);
353
- for (; ; ) {
354
- if (a) {
355
- const c = parseFloat(i);
356
- isNaN(c) ? n.push(i) : n.push(Math.ceil(c * s * e) / e);
357
- } else n.push(i);
358
- if (i = o.shift(), i === void 0) return n.join("");
359
- a = !a;
360
- }
361
- }
362
- function bn(t, s = "defs") {
363
- let e = "";
364
- const o = t.indexOf("<" + s);
365
- for (; o >= 0; ) {
366
- const n = t.indexOf(">", o), i = t.indexOf("</" + s);
367
- if (n === -1 || i === -1) break;
368
- const a = t.indexOf(">", i);
369
- if (a === -1) break;
370
- e += t.slice(n + 1, i).trim(), t = t.slice(0, o).trim() + t.slice(a + 1);
371
- }
372
- return {
373
- defs: e,
374
- content: t
375
- };
376
- }
377
- function Cn(t, s) {
378
- return t ? "<defs>" + t + "</defs>" + s : s;
379
- }
380
- function An(t, s, e) {
381
- const o = bn(t);
382
- return Cn(o.defs, s + o.content + e);
383
- }
384
- const Sn = (t) => t === "unset" || t === "undefined" || t === "none";
385
- function En(t, s) {
386
- const e = {
387
- ...bt,
388
- ...t
389
- }, o = {
390
- ...le,
391
- ...s
392
- }, n = {
393
- left: e.left,
394
- top: e.top,
395
- width: e.width,
396
- height: e.height
397
- };
398
- let i = e.body;
399
- [e, o].forEach((y) => {
400
- const v = [], l = y.hFlip, g = y.vFlip;
401
- let A = y.rotate;
402
- l ? g ? A += 2 : (v.push("translate(" + (n.width + n.left).toString() + " " + (0 - n.top).toString() + ")"), v.push("scale(-1 1)"), n.top = n.left = 0) : g && (v.push("translate(" + (0 - n.left).toString() + " " + (n.height + n.top).toString() + ")"), v.push("scale(1 -1)"), n.top = n.left = 0);
403
- let w;
404
- switch (A < 0 && (A -= Math.floor(A / 4) * 4), A = A % 4, A) {
405
- case 1:
406
- w = n.height / 2 + n.top, v.unshift("rotate(90 " + w.toString() + " " + w.toString() + ")");
407
- break;
408
- case 2:
409
- v.unshift("rotate(180 " + (n.width / 2 + n.left).toString() + " " + (n.height / 2 + n.top).toString() + ")");
410
- break;
411
- case 3:
412
- w = n.width / 2 + n.left, v.unshift("rotate(-90 " + w.toString() + " " + w.toString() + ")");
413
- break;
414
- }
415
- A % 2 === 1 && (n.left !== n.top && (w = n.left, n.left = n.top, n.top = w), n.width !== n.height && (w = n.width, n.width = n.height, n.height = w)), v.length && (i = An(i, '<g transform="' + v.join(" ") + '">', "</g>"));
416
- });
417
- const a = o.width, c = o.height, f = n.width, r = n.height;
418
- let u, d;
419
- a === null ? (d = c === null ? "1em" : c === "auto" ? r : c, u = Yt(d, f / r)) : (u = a === "auto" ? f : a, d = c === null ? Yt(u, r / f) : c === "auto" ? r : c);
420
- const p = {}, E = (y, v) => {
421
- Sn(v) || (p[y] = v.toString());
422
- };
423
- E("width", u), E("height", d);
424
- const D = [
425
- n.left,
426
- n.top,
427
- f,
428
- r
429
- ];
430
- return p.viewBox = D.join(" "), {
431
- attributes: p,
432
- viewBox: D,
433
- body: i
434
- };
435
- }
436
- const Tn = /\sid="(\S+)"/g, Vt = /* @__PURE__ */ new Map();
437
- function xn(t) {
438
- t = t.replace(/[0-9]+$/, "") || "a";
439
- const s = Vt.get(t) || 0;
440
- return Vt.set(t, s + 1), s ? `${t}${s}` : t;
441
- }
442
- function Rn(t) {
443
- const s = [];
444
- let e;
445
- for (; e = Tn.exec(t); ) s.push(e[1]);
446
- if (!s.length) return t;
447
- const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
448
- return s.forEach((n) => {
449
- const i = xn(n), a = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
450
- t = t.replace(new RegExp('([#;"])(' + a + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
451
- }), t = t.replace(new RegExp(o, "g"), ""), t;
452
- }
453
- const Rt = /* @__PURE__ */ Object.create(null);
454
- function On(t, s) {
455
- Rt[t] = s;
456
- }
457
- function Ot(t) {
458
- return Rt[t] || Rt[""];
459
- }
460
- function Dt(t) {
461
- let s;
462
- if (typeof t.resources == "string") s = [t.resources];
463
- else if (s = t.resources, !(s instanceof Array) || !s.length) return null;
464
- return {
465
- resources: s,
466
- path: t.path || "/",
467
- maxURL: t.maxURL || 500,
468
- rotate: t.rotate || 750,
469
- timeout: t.timeout || 5e3,
470
- random: t.random === !0,
471
- index: t.index || 0,
472
- dataAfterTimeout: t.dataAfterTimeout !== !1
473
- };
474
- }
475
- const Lt = /* @__PURE__ */ Object.create(null), st = ["https://api.simplesvg.com", "https://api.unisvg.com"], pt = [];
476
- for (; st.length > 0; ) st.length === 1 || Math.random() > 0.5 ? pt.push(st.shift()) : pt.push(st.pop());
477
- Lt[""] = Dt({ resources: ["https://api.iconify.design"].concat(pt) });
478
- function Mn(t, s) {
479
- const e = Dt(s);
480
- return e === null ? !1 : (Lt[t] = e, !0);
481
- }
482
- function Ht(t) {
483
- return Lt[t];
484
- }
485
- const Pn = () => {
486
- let t;
487
- try {
488
- if (t = fetch, typeof t == "function") return t;
489
- } catch {
490
- }
491
- };
492
- let Wt = Pn();
493
- function Dn(t, s) {
494
- const e = Ht(t);
495
- if (!e) return 0;
496
- let o;
497
- if (!e.maxURL) o = 0;
498
- else {
499
- let n = 0;
500
- e.resources.forEach((a) => {
501
- n = Math.max(n, a.length);
502
- });
503
- const i = s + ".json?icons=";
504
- o = e.maxURL - n - e.path.length - i.length;
505
- }
506
- return o;
507
- }
508
- function Ln(t) {
509
- return t === 404;
510
- }
511
- const Hn = (t, s, e) => {
512
- const o = [], n = Dn(t, s), i = "icons";
513
- let a = {
514
- type: i,
515
- provider: t,
516
- prefix: s,
517
- icons: []
518
- }, c = 0;
519
- return e.forEach((f, r) => {
520
- c += f.length + 1, c >= n && r > 0 && (o.push(a), a = {
521
- type: i,
522
- provider: t,
523
- prefix: s,
524
- icons: []
525
- }, c = f.length), a.icons.push(f);
526
- }), o.push(a), o;
527
- };
528
- function Nn(t) {
529
- if (typeof t == "string") {
530
- const s = Ht(t);
531
- if (s) return s.path;
532
- }
533
- return "/";
534
- }
535
- const $n = (t, s, e) => {
536
- if (!Wt) {
537
- e("abort", 424);
538
- return;
539
- }
540
- let o = Nn(s.provider);
541
- switch (s.type) {
542
- case "icons": {
543
- const i = s.prefix, a = s.icons.join(","), c = new URLSearchParams({ icons: a });
544
- o += i + ".json?" + c.toString();
545
- break;
546
- }
547
- case "custom": {
548
- const i = s.uri;
549
- o += i.slice(0, 1) === "/" ? i.slice(1) : i;
550
- break;
551
- }
552
- default:
553
- e("abort", 400);
554
- return;
555
- }
556
- let n = 503;
557
- Wt(t + o).then((i) => {
558
- const a = i.status;
559
- if (a !== 200) {
560
- setTimeout(() => {
561
- e(Ln(a) ? "abort" : "next", a);
562
- });
563
- return;
564
- }
565
- return n = 501, i.json();
566
- }).then((i) => {
567
- if (typeof i != "object" || i === null) {
568
- setTimeout(() => {
569
- i === 404 ? e("abort", i) : e("next", n);
570
- });
571
- return;
572
- }
573
- setTimeout(() => {
574
- e("success", i);
575
- });
576
- }).catch(() => {
577
- e("next", n);
578
- });
579
- }, Fn = {
580
- prepare: Hn,
581
- send: $n
582
- };
583
- function ce(t, s) {
584
- t.forEach((e) => {
585
- const o = e.loaderCallbacks;
586
- o && (e.loaderCallbacks = o.filter((n) => n.id !== s));
587
- });
588
- }
589
- function jn(t) {
590
- t.pendingCallbacksFlag || (t.pendingCallbacksFlag = !0, setTimeout(() => {
591
- t.pendingCallbacksFlag = !1;
592
- const s = t.loaderCallbacks ? t.loaderCallbacks.slice(0) : [];
593
- if (!s.length) return;
594
- let e = !1;
595
- const o = t.provider, n = t.prefix;
596
- s.forEach((i) => {
597
- const a = i.icons, c = a.pending.length;
598
- a.pending = a.pending.filter((f) => {
599
- if (f.prefix !== n) return !0;
600
- const r = f.name;
601
- if (t.icons[r]) a.loaded.push({
602
- provider: o,
603
- prefix: n,
604
- name: r
605
- });
606
- else if (t.missing.has(r)) a.missing.push({
607
- provider: o,
608
- prefix: n,
609
- name: r
610
- });
611
- else
612
- return e = !0, !0;
613
- return !1;
614
- }), a.pending.length !== c && (e || ce([t], i.id), i.callback(a.loaded.slice(0), a.missing.slice(0), a.pending.slice(0), i.abort));
615
- });
616
- }));
617
- }
618
- let Bn = 0;
619
- function In(t, s, e) {
620
- const o = Bn++, n = ce.bind(null, e, o);
621
- if (!s.pending.length) return n;
622
- const i = {
623
- id: o,
624
- icons: s,
625
- callback: t,
626
- abort: n
627
- };
628
- return e.forEach((a) => {
629
- (a.loaderCallbacks || (a.loaderCallbacks = [])).push(i);
630
- }), n;
631
- }
632
- function Qn(t) {
633
- const s = {
634
- loaded: [],
635
- missing: [],
636
- pending: []
637
- }, e = /* @__PURE__ */ Object.create(null);
638
- t.sort((n, i) => n.provider !== i.provider ? n.provider.localeCompare(i.provider) : n.prefix !== i.prefix ? n.prefix.localeCompare(i.prefix) : n.name.localeCompare(i.name));
639
- let o = {
640
- provider: "",
641
- prefix: "",
642
- name: ""
643
- };
644
- return t.forEach((n) => {
645
- if (o.name === n.name && o.prefix === n.prefix && o.provider === n.provider) return;
646
- o = n;
647
- const i = n.provider, a = n.prefix, c = n.name, f = e[i] || (e[i] = /* @__PURE__ */ Object.create(null)), r = f[a] || (f[a] = nt(i, a));
648
- let u;
649
- c in r.icons ? u = s.loaded : a === "" || r.missing.has(c) ? u = s.missing : u = s.pending;
650
- const d = {
651
- provider: i,
652
- prefix: a,
653
- name: c
654
- };
655
- u.push(d);
656
- }), s;
657
- }
658
- function _n(t, s = !0, e = !1) {
659
- const o = [];
660
- return t.forEach((n) => {
661
- const i = typeof n == "string" ? kt(n, s, e) : n;
662
- i && o.push(i);
663
- }), o;
664
- }
665
- const Yn = {
666
- resources: [],
667
- index: 0,
668
- timeout: 2e3,
669
- rotate: 750,
670
- random: !1,
671
- dataAfterTimeout: !1
672
- };
673
- function Vn(t, s, e, o) {
674
- const n = t.resources.length, i = t.random ? Math.floor(Math.random() * n) : t.index;
675
- let a;
676
- if (t.random) {
677
- let m = t.resources.slice(0);
678
- for (a = []; m.length > 1; ) {
679
- const L = Math.floor(Math.random() * m.length);
680
- a.push(m[L]), m = m.slice(0, L).concat(m.slice(L + 1));
681
- }
682
- a = a.concat(m);
683
- } else a = t.resources.slice(i).concat(t.resources.slice(0, i));
684
- const c = Date.now();
685
- let f = "pending", r = 0, u, d = null, p = [], E = [];
686
- typeof o == "function" && E.push(o);
687
- function D() {
688
- d && (clearTimeout(d), d = null);
689
- }
690
- function y() {
691
- f === "pending" && (f = "aborted"), D(), p.forEach((m) => {
692
- m.status === "pending" && (m.status = "aborted");
693
- }), p = [];
694
- }
695
- function v(m, L) {
696
- L && (E = []), typeof m == "function" && E.push(m);
697
- }
698
- function l() {
699
- return {
700
- startTime: c,
701
- payload: s,
702
- status: f,
703
- queriesSent: r,
704
- queriesPending: p.length,
705
- subscribe: v,
706
- abort: y
707
- };
708
- }
709
- function g() {
710
- f = "failed", E.forEach((m) => {
711
- m(void 0, u);
712
- });
713
- }
714
- function A() {
715
- p.forEach((m) => {
716
- m.status === "pending" && (m.status = "aborted");
717
- }), p = [];
718
- }
719
- function w(m, L, T) {
720
- const k = L !== "success";
721
- switch (p = p.filter((C) => C !== m), f) {
722
- case "pending":
723
- break;
724
- case "failed":
725
- if (k || !t.dataAfterTimeout) return;
726
- break;
727
- default:
728
- return;
729
- }
730
- if (L === "abort") {
731
- u = T, g();
732
- return;
733
- }
734
- if (k) {
735
- u = T, p.length || (a.length ? S() : g());
736
- return;
737
- }
738
- if (D(), A(), !t.random) {
739
- const C = t.resources.indexOf(m.resource);
740
- C !== -1 && C !== t.index && (t.index = C);
741
- }
742
- f = "completed", E.forEach((C) => {
743
- C(T);
744
- });
745
- }
746
- function S() {
747
- if (f !== "pending") return;
748
- D();
749
- const m = a.shift();
750
- if (m === void 0) {
751
- if (p.length) {
752
- d = setTimeout(() => {
753
- D(), f === "pending" && (A(), g());
754
- }, t.timeout);
755
- return;
756
- }
757
- g();
758
- return;
759
- }
760
- const L = {
761
- status: "pending",
762
- resource: m,
763
- callback: (T, k) => {
764
- w(L, T, k);
765
- }
766
- };
767
- p.push(L), r++, d = setTimeout(S, t.rotate), e(m, s, L.callback);
768
- }
769
- return setTimeout(S), l;
770
- }
771
- function ue(t) {
772
- const s = {
773
- ...Yn,
774
- ...t
775
- };
776
- let e = [];
777
- function o() {
778
- e = e.filter((a) => a().status === "pending");
779
- }
780
- function n(a, c, f) {
781
- const r = Vn(s, a, c, (u, d) => {
782
- o(), f && f(u, d);
783
- });
784
- return e.push(r), r;
785
- }
786
- function i(a) {
787
- return e.find((c) => a(c)) || null;
788
- }
789
- return {
790
- query: n,
791
- find: i,
792
- setIndex: (a) => {
793
- s.index = a;
794
- },
795
- getIndex: () => s.index,
796
- cleanup: o
797
- };
798
- }
799
- function Xt() {
800
- }
801
- const Et = /* @__PURE__ */ Object.create(null);
802
- function Wn(t) {
803
- if (!Et[t]) {
804
- const s = Ht(t);
805
- if (!s) return;
806
- Et[t] = {
807
- config: s,
808
- redundancy: ue(s)
809
- };
810
- }
811
- return Et[t];
812
- }
813
- function Xn(t, s, e) {
814
- let o, n;
815
- if (typeof t == "string") {
816
- const i = Ot(t);
817
- if (!i)
818
- return e(void 0, 424), Xt;
819
- n = i.send;
820
- const a = Wn(t);
821
- a && (o = a.redundancy);
822
- } else {
823
- const i = Dt(t);
824
- if (i) {
825
- o = ue(i);
826
- const a = Ot(t.resources ? t.resources[0] : "");
827
- a && (n = a.send);
828
- }
829
- }
830
- return !o || !n ? (e(void 0, 424), Xt) : o.query(s, n, e)().abort;
831
- }
832
- function Gt() {
833
- }
834
- function Gn(t) {
835
- t.iconsLoaderFlag || (t.iconsLoaderFlag = !0, setTimeout(() => {
836
- t.iconsLoaderFlag = !1, jn(t);
837
- }));
838
- }
839
- function Un(t) {
840
- const s = [], e = [];
841
- return t.forEach((o) => {
842
- (o.match(ee) ? s : e).push(o);
843
- }), {
844
- valid: s,
845
- invalid: e
846
- };
847
- }
848
- function ot(t, s, e) {
849
- function o() {
850
- const n = t.pendingIcons;
851
- s.forEach((i) => {
852
- n && n.delete(i), t.icons[i] || t.missing.add(i);
853
- });
854
- }
855
- if (e && typeof e == "object") try {
856
- if (!ie(t, e).length) {
857
- o();
858
- return;
859
- }
860
- } catch (n) {
861
- console.error(n);
862
- }
863
- o(), Gn(t);
864
- }
865
- function Ut(t, s) {
866
- t instanceof Promise ? t.then((e) => {
867
- s(e);
868
- }).catch(() => {
869
- s(null);
870
- }) : s(t);
871
- }
872
- function zn(t, s) {
873
- t.iconsToLoad ? t.iconsToLoad = t.iconsToLoad.concat(s).sort() : t.iconsToLoad = s, t.iconsQueueFlag || (t.iconsQueueFlag = !0, setTimeout(() => {
874
- t.iconsQueueFlag = !1;
875
- const { provider: e, prefix: o } = t, n = t.iconsToLoad;
876
- if (delete t.iconsToLoad, !n || !n.length) return;
877
- const i = t.loadIcon;
878
- if (t.loadIcons && (n.length > 1 || !i)) {
879
- Ut(t.loadIcons(n, o, e), (r) => {
880
- ot(t, n, r);
881
- });
882
- return;
883
- }
884
- if (i) {
885
- n.forEach((r) => {
886
- Ut(i(r, o, e), (u) => {
887
- ot(t, [r], u ? {
888
- prefix: o,
889
- icons: { [r]: u }
890
- } : null);
891
- });
892
- });
893
- return;
894
- }
895
- const { valid: a, invalid: c } = Un(n);
896
- if (c.length && ot(t, c, null), !a.length) return;
897
- const f = o.match(ee) ? Ot(e) : null;
898
- if (!f) {
899
- ot(t, a, null);
900
- return;
901
- }
902
- f.prepare(e, o, a).forEach((r) => {
903
- Xn(e, r, (u) => {
904
- ot(t, r.icons, u);
905
- });
906
- });
907
- }));
908
- }
909
- const Jn = (t, s) => {
910
- const e = Qn(_n(t, !0, ae()));
911
- if (!e.pending.length) {
912
- let c = !0;
913
- return s && setTimeout(() => {
914
- c && s(e.loaded, e.missing, e.pending, Gt);
915
- }), () => {
916
- c = !1;
917
- };
918
- }
919
- const o = /* @__PURE__ */ Object.create(null), n = [];
920
- let i, a;
921
- return e.pending.forEach((c) => {
922
- const { provider: f, prefix: r } = c;
923
- if (r === a && f === i) return;
924
- i = f, a = r, n.push(nt(f, r));
925
- const u = o[f] || (o[f] = /* @__PURE__ */ Object.create(null));
926
- u[r] || (u[r] = []);
927
- }), e.pending.forEach((c) => {
928
- const { provider: f, prefix: r, name: u } = c, d = nt(f, r), p = d.pendingIcons || (d.pendingIcons = /* @__PURE__ */ new Set());
929
- p.has(u) || (p.add(u), o[f][r].push(u));
930
- }), n.forEach((c) => {
931
- const f = o[c.provider][c.prefix];
932
- f.length && zn(c, f);
933
- }), s ? In(s, e, n) : Gt;
934
- };
935
- function qn(t, s) {
936
- const e = { ...t };
937
- for (const o in s) {
938
- const n = s[o], i = typeof n;
939
- o in re ? (n === null || n && (i === "string" || i === "number")) && (e[o] = n) : i === typeof e[o] && (e[o] = o === "rotate" ? n % 4 : n);
940
- }
941
- return e;
942
- }
943
- const Kn = /[\s,]+/;
944
- function Zn(t, s) {
945
- s.split(Kn).forEach((e) => {
946
- switch (e.trim()) {
947
- case "horizontal":
948
- t.hFlip = !0;
949
- break;
950
- case "vertical":
951
- t.vFlip = !0;
952
- break;
953
- }
954
- });
955
- }
956
- function ts(t, s = 0) {
957
- const e = t.replace(/^-?[0-9.]*/, "");
958
- function o(n) {
959
- for (; n < 0; ) n += 4;
960
- return n % 4;
961
- }
962
- if (e === "") {
963
- const n = parseInt(t);
964
- return isNaN(n) ? 0 : o(n);
965
- } else if (e !== t) {
966
- let n = 0;
967
- switch (e) {
968
- case "%":
969
- n = 25;
970
- break;
971
- case "deg":
972
- n = 90;
973
- }
974
- if (n) {
975
- let i = parseFloat(t.slice(0, t.length - e.length));
976
- return isNaN(i) ? 0 : (i = i / n, i % 1 === 0 ? o(i) : 0);
977
- }
978
- }
979
- return s;
980
- }
981
- function es(t, s) {
982
- let e = t.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
983
- for (const o in s) e += " " + o + '="' + s[o] + '"';
984
- return '<svg xmlns="http://www.w3.org/2000/svg"' + e + ">" + t + "</svg>";
985
- }
986
- function ns(t) {
987
- return t.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
988
- }
989
- function ss(t) {
990
- return "data:image/svg+xml," + ns(t);
991
- }
992
- function os(t) {
993
- return 'url("' + ss(t) + '")';
994
- }
995
- const zt = {
996
- ...le,
997
- inline: !1
998
- }, is = {
999
- xmlns: "http://www.w3.org/2000/svg",
1000
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1001
- "aria-hidden": !0,
1002
- role: "img"
1003
- }, as = {
1004
- display: "inline-block"
1005
- }, Mt = {
1006
- backgroundColor: "currentColor"
1007
- }, fe = {
1008
- backgroundColor: "transparent"
1009
- }, Jt = {
1010
- Image: "var(--svg)",
1011
- Repeat: "no-repeat",
1012
- Size: "100% 100%"
1013
- }, qt = {
1014
- webkitMask: Mt,
1015
- mask: Mt,
1016
- background: fe
1017
- };
1018
- for (const t in qt) {
1019
- const s = qt[t];
1020
- for (const e in Jt)
1021
- s[t + e] = Jt[e];
1022
- }
1023
- const vt = {};
1024
- ["horizontal", "vertical"].forEach((t) => {
1025
- const s = t.slice(0, 1) + "Flip";
1026
- vt[t + "-flip"] = s, vt[t.slice(0, 1) + "-flip"] = s, vt[t + "Flip"] = s;
1027
- });
1028
- function Kt(t) {
1029
- return t + (t.match(/^[-0-9.]+$/) ? "px" : "");
1030
- }
1031
- const Zt = (t, s) => {
1032
- const e = qn(zt, s), o = { ...is }, n = s.mode || "svg", i = {}, a = s.style, c = typeof a == "object" && !(a instanceof Array) ? a : {};
1033
- for (let y in s) {
1034
- const v = s[y];
1035
- if (v !== void 0)
1036
- switch (y) {
1037
- // Properties to ignore
1038
- case "icon":
1039
- case "style":
1040
- case "onLoad":
1041
- case "mode":
1042
- case "ssr":
1043
- case "customise":
1044
- break;
1045
- // Boolean attributes
1046
- case "inline":
1047
- case "hFlip":
1048
- case "vFlip":
1049
- e[y] = v === !0 || v === "true" || v === 1;
1050
- break;
1051
- // Flip as string: 'horizontal,vertical'
1052
- case "flip":
1053
- typeof v == "string" && Zn(e, v);
1054
- break;
1055
- // Color: override style
1056
- case "color":
1057
- i.color = v;
1058
- break;
1059
- // Rotation as string
1060
- case "rotate":
1061
- typeof v == "string" ? e[y] = ts(v) : typeof v == "number" && (e[y] = v);
1062
- break;
1063
- // Remove aria-hidden
1064
- case "ariaHidden":
1065
- case "aria-hidden":
1066
- v !== !0 && v !== "true" && delete o["aria-hidden"];
1067
- break;
1068
- default: {
1069
- const l = vt[y];
1070
- l ? (v === !0 || v === "true" || v === 1) && (e[l] = !0) : zt[y] === void 0 && (o[y] = v);
1071
- }
1072
- }
1073
- }
1074
- const f = En(t, e), r = f.attributes;
1075
- if (e.inline && (i.verticalAlign = "-0.125em"), n === "svg")
1076
- return o.style = {
1077
- ...i,
1078
- ...c
1079
- }, Object.assign(o, r), o.innerHTML = Rn(f.body), $t("svg", o);
1080
- const { body: u, width: d, height: p } = t, E = n === "mask" || (n === "bg" ? !1 : u.indexOf("currentColor") !== -1), D = es(u, {
1081
- ...r,
1082
- width: d + "",
1083
- height: p + ""
1084
- });
1085
- return o.style = {
1086
- ...i,
1087
- "--svg": os(D),
1088
- width: Kt(r.width),
1089
- height: Kt(r.height),
1090
- ...as,
1091
- ...E ? Mt : fe,
1092
- ...c
1093
- }, $t("span", o);
1094
- };
1095
- ae(!0);
1096
- On("", Fn);
1097
- if (typeof document < "u" && typeof window < "u") {
1098
- const t = window;
1099
- if (t.IconifyPreload !== void 0) {
1100
- const s = t.IconifyPreload, e = "Invalid IconifyPreload syntax.";
1101
- typeof s == "object" && s !== null && (s instanceof Array ? s : [s]).forEach((o) => {
1102
- try {
1103
- // Check if item is an object and not null/array
1104
- (typeof o != "object" || o === null || o instanceof Array || // Check for 'icons' and 'prefix'
1105
- typeof o.icons != "object" || typeof o.prefix != "string" || // Add icon set
1106
- !yn(o)) && console.error(e);
1107
- } catch {
1108
- console.error(e);
1109
- }
1110
- });
1111
- }
1112
- if (t.IconifyProviders !== void 0) {
1113
- const s = t.IconifyProviders;
1114
- if (typeof s == "object" && s !== null)
1115
- for (let e in s) {
1116
- const o = "IconifyProviders[" + e + "] is invalid.";
1117
- try {
1118
- const n = s[e];
1119
- if (typeof n != "object" || !n || n.resources === void 0)
1120
- continue;
1121
- Mn(e, n) || console.error(o);
1122
- } catch {
1123
- console.error(o);
1124
- }
1125
- }
1126
- }
1127
- }
1128
- const rs = {
1129
- ...bt,
1130
- body: ""
1131
- }, Tt = q((t, { emit: s }) => {
1132
- const e = M(null);
1133
- function o() {
1134
- var r, u;
1135
- e.value && ((u = (r = e.value).abort) == null || u.call(r), e.value = null);
1136
- }
1137
- const n = M(!!t.ssr), i = M(""), a = ve(null);
1138
- function c() {
1139
- const r = t.icon;
1140
- if (typeof r == "object" && r !== null && typeof r.body == "string")
1141
- return i.value = "", {
1142
- data: r
1143
- };
1144
- let u;
1145
- if (typeof r != "string" || (u = kt(r, !1, !0)) === null)
1146
- return null;
1147
- let d = vn(u);
1148
- if (!d) {
1149
- const D = e.value;
1150
- return (!D || D.name !== r) && (d === null ? e.value = {
1151
- name: r
1152
- } : e.value = {
1153
- name: r,
1154
- abort: Jn([u], f)
1155
- }), null;
1156
- }
1157
- o(), i.value !== r && (i.value = r, lt(() => {
1158
- s("load", r);
1159
- }));
1160
- const p = t.customise;
1161
- if (p) {
1162
- d = Object.assign({}, d);
1163
- const D = p(d.body, u.name, u.prefix, u.provider);
1164
- typeof D == "string" && (d.body = D);
1165
- }
1166
- const E = ["iconify"];
1167
- return u.prefix !== "" && E.push("iconify--" + u.prefix), u.provider !== "" && E.push("iconify--" + u.provider), { data: d, classes: E };
1168
- }
1169
- function f() {
1170
- var u;
1171
- const r = c();
1172
- r ? r.data !== ((u = a.value) == null ? void 0 : u.data) && (a.value = r) : a.value = null;
1173
- }
1174
- return n.value ? f() : W(() => {
1175
- n.value = !0, f();
1176
- }), Pt(() => t.icon, f), mt(o), () => {
1177
- const r = a.value;
1178
- if (!r)
1179
- return Zt(rs, t);
1180
- let u = t;
1181
- return r.classes && (u = {
1182
- ...t,
1183
- class: r.classes.join(" ")
1184
- }), Zt({
1185
- ...bt,
1186
- ...r.data
1187
- }, u);
1188
- };
1189
- }, {
1190
- props: [
1191
- // Icon and render mode
1192
- "icon",
1193
- "mode",
1194
- "ssr",
1195
- // Layout and style
1196
- "width",
1197
- "height",
1198
- "style",
1199
- "color",
1200
- "inline",
1201
- // Transformations
1202
- "rotate",
1203
- "hFlip",
1204
- "horizontalFlip",
1205
- "vFlip",
1206
- "verticalFlip",
1207
- "flip",
1208
- // Misc
1209
- "id",
1210
- "ariaHidden",
1211
- "customise",
1212
- "title"
1213
- ],
1214
- emits: ["load"]
1215
- }), ls = { class: "input-container" }, cs = ["value", "disabled"], us = {
160
+ }), me = { class: "input-container" }, he = ["value", "disabled"], fe = {
1216
161
  key: 0,
1217
162
  class: "tooltip-enhanced stop",
1218
163
  "data-tooltip": "停止生成"
1219
- }, fs = ["data-tooltip"], ds = {
164
+ }, pe = ["data-tooltip"], ye = {
1220
165
  key: 2,
1221
166
  class: "moveTB"
1222
- }, hs = /* @__PURE__ */ q({
167
+ }, ke = /* @__PURE__ */ nt({
1223
168
  __name: "ChatInput",
1224
169
  props: {
1225
170
  modelValue: {},
@@ -1230,498 +175,498 @@ const rs = {
1230
175
  },
1231
176
  emits: ["update:modelValue", "send", "stop", "scroll-to-bottom"],
1232
177
  setup(t) {
1233
- return (s, e) => (b(), O("div", ls, [
1234
- h("input", {
178
+ return (v, a) => (g(), y("div", me, [
179
+ n("input", {
1235
180
  value: t.modelValue,
1236
181
  type: "text",
1237
182
  placeholder: "给AI助手发送消息...",
1238
- onInput: e[0] || (e[0] = (o) => s.$emit("update:modelValue", o.target.value)),
1239
- onKeyup: e[1] || (e[1] = me((o) => t.modelValue.trim() && s.$emit("send"), ["enter"])),
183
+ onInput: a[0] || (a[0] = (u) => v.$emit("update:modelValue", u.target.value)),
184
+ onKeyup: a[1] || (a[1] = Rt((u) => t.modelValue.trim() && v.$emit("send"), ["enter"])),
1240
185
  disabled: t.isGenerating
1241
- }, null, 40, cs),
1242
- t.isGenerating && t.lastUserMessage ? (b(), O("div", us, [
1243
- G(N(Tt), {
186
+ }, null, 40, he),
187
+ t.isGenerating && t.lastUserMessage ? (g(), y("div", fe, [
188
+ F(M(x), {
1244
189
  class: "op-icon stop-icon",
1245
190
  icon: "heroicons-solid:stop",
1246
- onClick: e[2] || (e[2] = (o) => s.$emit("stop"))
191
+ onClick: a[2] || (a[2] = (u) => v.$emit("stop"))
1247
192
  })
1248
- ])) : (b(), O("div", {
193
+ ])) : (g(), y("div", {
1249
194
  key: 1,
1250
- class: X(["tooltip-enhanced send", { disabled: !t.modelValue.trim() }]),
195
+ class: U(["tooltip-enhanced send", { disabled: !t.modelValue.trim() }]),
1251
196
  "data-tooltip": t.modelValue.trim() ? "开始回答" : "请输入你的问题"
1252
197
  }, [
1253
- G(N(Tt), {
198
+ F(M(x), {
1254
199
  class: "op-icon",
1255
200
  icon: "fluent-color:send-16",
1256
- onClick: e[3] || (e[3] = (o) => t.modelValue.trim() && s.$emit("send"))
201
+ onClick: a[3] || (a[3] = (u) => t.modelValue.trim() && v.$emit("send"))
1257
202
  })
1258
- ], 10, fs)),
1259
- t.hasScroll && !t.isAtBottom ? (b(), O("div", ds, [
1260
- G(N(Tt), {
203
+ ], 10, pe)),
204
+ t.hasScroll && !t.isAtBottom ? (g(), y("div", ye, [
205
+ F(M(x), {
1261
206
  class: "op-icon",
1262
207
  icon: "ep:bottom",
1263
- onClick: e[4] || (e[4] = (o) => s.$emit("scroll-to-bottom"))
208
+ onClick: a[4] || (a[4] = (u) => v.$emit("scroll-to-bottom"))
1264
209
  })
1265
- ])) : j("", !0)
210
+ ])) : Y("", !0)
1266
211
  ]));
1267
212
  }
1268
213
  });
1269
- function gs(t) {
1270
- const s = M(!0), e = M(!1);
1271
- function o() {
1272
- lt(() => {
214
+ function we(t) {
215
+ const v = T(!0), a = T(!1);
216
+ function u() {
217
+ ut(() => {
1273
218
  t.value && (t.value.scrollTop = t.value.scrollHeight);
1274
219
  });
1275
220
  }
1276
- function n() {
221
+ function i() {
1277
222
  if (!t.value) return;
1278
- const i = t.value, a = i.scrollTop + i.clientHeight >= i.scrollHeight - 1, c = i.scrollHeight > i.clientHeight;
1279
- s.value = a, e.value = c;
1280
- }
1281
- return { isAtBottom: s, hasScroll: e, scrollToBottom: o, checkScrollStatus: n };
1282
- }
1283
- function ps() {
1284
- function t(s) {
1285
- s.querySelectorAll("pre").forEach((o) => {
1286
- if (o.querySelector(".copy-button")) return;
1287
- const n = o.querySelector("code");
1288
- if (!n) return;
1289
- const a = (Array.from(n.classList).find((f) => f.startsWith("language-")) || "").replace("language-", "");
1290
- if (a) {
1291
- const f = document.createElement("span");
1292
- f.className = "code-lang", f.textContent = a, o.appendChild(f);
223
+ const s = t.value, C = s.scrollTop + s.clientHeight >= s.scrollHeight - 1, o = s.scrollHeight > s.clientHeight;
224
+ v.value = C, a.value = o;
225
+ }
226
+ return { isAtBottom: v, hasScroll: a, scrollToBottom: u, checkScrollStatus: i };
227
+ }
228
+ function Ce() {
229
+ function t(v) {
230
+ v.querySelectorAll("pre").forEach((u) => {
231
+ if (u.querySelector(".copy-button")) return;
232
+ const i = u.querySelector("code");
233
+ if (!i) return;
234
+ const C = (Array.from(i.classList).find((h) => h.startsWith("language-")) || "").replace("language-", "");
235
+ if (C) {
236
+ const h = document.createElement("span");
237
+ h.className = "code-lang", h.textContent = C, u.appendChild(h);
1293
238
  }
1294
- const c = document.createElement("button");
1295
- c.className = "copy-button", c.textContent = "复制", c.onclick = () => {
1296
- navigator.clipboard.writeText(n.textContent || "").then(() => {
1297
- c.textContent = "已复制", setTimeout(() => {
1298
- c.textContent = "复制";
239
+ const o = document.createElement("button");
240
+ o.className = "copy-button", o.textContent = "复制", o.onclick = () => {
241
+ navigator.clipboard.writeText(i.textContent || "").then(() => {
242
+ o.textContent = "已复制", setTimeout(() => {
243
+ o.textContent = "复制";
1299
244
  }, 2e3);
1300
245
  });
1301
- }, o.appendChild(c);
246
+ }, u.appendChild(o);
1302
247
  });
1303
248
  }
1304
249
  return { enhanceCodeBlocks: t };
1305
250
  }
1306
- function vs(t) {
1307
- let s = null, e = 0;
1308
- function o(i) {
1309
- s = i(s || [...t.value]), e || (e = requestAnimationFrame(() => {
1310
- e = 0, s && (t.value = s, s = null);
251
+ function Ae(t) {
252
+ let v = null, a = 0;
253
+ function u(s) {
254
+ v = s(v || [...t.value]), a || (a = requestAnimationFrame(() => {
255
+ a = 0, v && (t.value = v, v = null);
1311
256
  }));
1312
257
  }
1313
- function n() {
1314
- e && (cancelAnimationFrame(e), e = 0), s && (t.value = s, s = null);
258
+ function i() {
259
+ a && (cancelAnimationFrame(a), a = 0), v && (t.value = v, v = null);
1315
260
  }
1316
- return { batchMessagesUpdate: o, flushMessagesBatch: n };
261
+ return { batchMessagesUpdate: u, flushMessagesBatch: i };
1317
262
  }
1318
- function ms(t, s, e) {
1319
- const o = J(/* @__PURE__ */ new Map()), n = M(/* @__PURE__ */ new Map());
1320
- let i = 0, a = 0;
1321
- function c() {
1322
- if (i) return;
1323
- const d = 16, p = 1, E = 40, D = (y) => {
1324
- if (y - a >= d) {
1325
- a = y;
1326
- let v = !1;
1327
- if (t.value.forEach((g, A) => {
1328
- if (g.type !== "ai" || g.status !== e) return;
1329
- const w = g.content, S = n.value.get(A) ?? 0, m = w.length - S;
1330
- if (m > 0) {
1331
- v = !0;
1332
- const L = m > 15 ? Math.min(Math.ceil(m * 0.3), E) : p, T = Math.min(S + L, w.length);
1333
- n.value.set(A, T), o.set(A, w.slice(0, T));
263
+ function be(t, v, a) {
264
+ const u = K(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Map());
265
+ let s = 0, C = 0;
266
+ function o() {
267
+ if (s) return;
268
+ const r = 16, R = 1, L = 40, Q = (D) => {
269
+ if (D - C >= r) {
270
+ C = D;
271
+ let B = !1;
272
+ if (t.value.forEach((d, O) => {
273
+ if (d.type !== "ai" || d.status !== a) return;
274
+ const A = d.content, k = i.value.get(O) ?? 0, P = A.length - k;
275
+ if (P > 0) {
276
+ B = !0;
277
+ const N = P > 15 ? Math.min(Math.ceil(P * 0.3), L) : R, b = Math.min(k + N, A.length);
278
+ i.value.set(O, b), u.set(O, A.slice(0, b));
1334
279
  }
1335
- }), v && s(), !t.value.some((g) => g.type === "ai" && g.status === e)) {
1336
- i = 0;
280
+ }), B && v(), !t.value.some((d) => d.type === "ai" && d.status === a)) {
281
+ s = 0;
1337
282
  return;
1338
283
  }
1339
284
  }
1340
- i = requestAnimationFrame(D);
285
+ s = requestAnimationFrame(Q);
1341
286
  };
1342
- i = requestAnimationFrame(D);
287
+ s = requestAnimationFrame(Q);
1343
288
  }
1344
- function f() {
1345
- i && (cancelAnimationFrame(i), i = 0), t.value.forEach((d, p) => {
1346
- d.type === "ai" && (o.set(p, d.content), n.value.set(p, d.content.length));
289
+ function h() {
290
+ s && (cancelAnimationFrame(s), s = 0), t.value.forEach((r, R) => {
291
+ r.type === "ai" && (u.set(R, r.content), i.value.set(R, r.content.length));
1347
292
  });
1348
293
  }
1349
- function r() {
1350
- i && (cancelAnimationFrame(i), i = 0);
1351
- }
1352
- function u(d, p, E, D) {
1353
- if (E.type !== "answer" || D.status !== e) return E.content;
1354
- const y = D.segments || [];
1355
- if (y.slice(p + 1).some((w) => w.type === "answer")) return E.content;
1356
- const l = n.value.get(d);
1357
- if (l == null) return E.content;
1358
- let g = 0;
1359
- for (let w = 0; w < p; w++)
1360
- y[w].type === "answer" && (g += y[w].content.length);
1361
- const A = g + E.content.length;
1362
- return l >= A ? E.content : l <= g ? "" : E.content.slice(0, l - g);
1363
- }
1364
- return { displayedContent: o, streamingIndexRef: n, startTypewriter: c, flushTypewriter: f, getSegmentDisplayContent: u, stopTypewriter: r };
1365
- }
1366
- function ys({
294
+ function c() {
295
+ s && (cancelAnimationFrame(s), s = 0);
296
+ }
297
+ function l(r, R, L, Q) {
298
+ if (L.type !== "answer" || Q.status !== a) return L.content;
299
+ const D = Q.segments || [];
300
+ if (D.slice(R + 1).some((A) => A.type === "answer")) return L.content;
301
+ const e = i.value.get(r);
302
+ if (e == null) return L.content;
303
+ let d = 0;
304
+ for (let A = 0; A < R; A++)
305
+ D[A].type === "answer" && (d += D[A].content.length);
306
+ const O = d + L.content.length;
307
+ return e >= O ? L.content : e <= d ? "" : L.content.slice(0, e - d);
308
+ }
309
+ return { displayedContent: u, streamingIndexRef: i, startTypewriter: o, flushTypewriter: h, getSegmentDisplayContent: l, stopTypewriter: c };
310
+ }
311
+ function Se({
1367
312
  messages: t,
1368
- isGenerating: s,
1369
- lastUserMessage: e,
1370
- batchMessagesUpdate: o,
1371
- flushMessagesBatch: n,
1372
- STATUS: i,
1373
- cfg: a
313
+ isGenerating: v,
314
+ lastUserMessage: a,
315
+ batchMessagesUpdate: u,
316
+ flushMessagesBatch: i,
317
+ STATUS: s,
318
+ cfg: C
1374
319
  }) {
1375
- const c = M(/* @__PURE__ */ new Map()), f = M(/* @__PURE__ */ new Map()), r = M(/* @__PURE__ */ new Map()), u = M(/* @__PURE__ */ new Map()), d = M(!1);
1376
- function p(y) {
1377
- const v = c.value.get(y) || [];
1378
- o((l) => {
1379
- if (l[y]) {
1380
- const g = [...l];
1381
- return g[y] = { ...g[y], segments: v.map((A) => ({ ...A })) }, g;
320
+ const o = T(/* @__PURE__ */ new Map()), h = T(/* @__PURE__ */ new Map()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), r = T(!1);
321
+ function R(D) {
322
+ const B = o.value.get(D) || [];
323
+ u((e) => {
324
+ if (e[D]) {
325
+ const d = [...e];
326
+ return d[D] = { ...d[D], segments: B.map((O) => ({ ...O })) }, d;
1382
327
  }
1383
- return l;
328
+ return e;
1384
329
  });
1385
330
  }
1386
- function E(y) {
1387
- const v = c.value.get(y) || [], l = r.value.get(y);
1388
- let g = 0, A = !1;
1389
- v.forEach((w) => {
1390
- if (w.type === "thinking" && w.duration == null) {
1391
- const S = l ? Math.round((Date.now() - l) / 1e3 * 10) / 10 : 0;
1392
- w.duration = S, g += S, A = !0;
331
+ function L(D) {
332
+ const B = o.value.get(D) || [], e = c.value.get(D);
333
+ let d = 0, O = !1;
334
+ B.forEach((A) => {
335
+ if (A.type === "thinking" && A.duration == null) {
336
+ const k = e ? Math.round((Date.now() - e) / 1e3 * 10) / 10 : 0;
337
+ A.duration = k, d += k, O = !0;
1393
338
  }
1394
- }), A && (c.value.set(y, v), o((w) => {
1395
- if (w[y]) {
1396
- const S = [...w];
1397
- return S[y] = {
1398
- ...S[y],
1399
- segments: v.map((m) => ({ ...m })),
1400
- thinkingDuration: (S[y].thinkingDuration || 0) + g
1401
- }, S;
339
+ }), O && (o.value.set(D, B), u((A) => {
340
+ if (A[D]) {
341
+ const k = [...A];
342
+ return k[D] = {
343
+ ...k[D],
344
+ segments: B.map((P) => ({ ...P })),
345
+ thinkingDuration: (k[D].thinkingDuration || 0) + d
346
+ }, k;
1402
347
  }
1403
- return w;
348
+ return A;
1404
349
  }));
1405
350
  }
1406
- async function D(y, v, l, g, A = !1) {
1407
- d.value = !1, c.value.set(l, []), s.value = !0;
351
+ async function Q(D, B, e, d, O = !1) {
352
+ r.value = !1, o.value.set(e, []), v.value = !0;
1408
353
  try {
1409
- const w = a.baseUrl.replace(/\/+$/, "") + "/" + y.replace(/^\/+/, "");
1410
- await je(w, {
354
+ const A = C.baseUrl.replace(/\/+$/, "") + "/" + D.replace(/^\/+/, "");
355
+ await Ut(A, {
1411
356
  method: "POST",
1412
357
  headers: { "Content-Type": "application/json" },
1413
- body: JSON.stringify({ app: a.app ?? 1, data: v }),
1414
- signal: g,
358
+ body: JSON.stringify({ app: C.app ?? 1, data: B }),
359
+ signal: d,
1415
360
  openWhenHidden: !0,
1416
- async onopen(S) {
1417
- S.ok || console.error("[ai-assist-sdk] ❌ SSE 连接失败:", S.status, S.statusText);
361
+ async onopen(k) {
362
+ k.ok || console.error("[ai-assist-sdk] ❌ SSE 连接失败:", k.status, k.statusText);
1418
363
  },
1419
- onmessage(S) {
1420
- var m;
364
+ onmessage(k) {
365
+ var P;
1421
366
  try {
1422
- let L = S.data || "";
1423
- for (; L.startsWith("data:"); )
1424
- L = L.replace(/^data:\s*/, "");
1425
- if (!L) return;
1426
- let T;
367
+ let N = k.data || "";
368
+ for (; N.startsWith("data:"); )
369
+ N = N.replace(/^data:\s*/, "");
370
+ if (!N) return;
371
+ let b;
1427
372
  try {
1428
- T = JSON.parse(L);
373
+ b = JSON.parse(N);
1429
374
  } catch {
1430
375
  return;
1431
376
  }
1432
- switch (T.event) {
377
+ switch (b.event) {
1433
378
  case "message_start":
1434
- A || (e.value = T.id), f.value.set(l, "answer");
379
+ O || (a.value = b.id), h.value.set(e, "answer");
1435
380
  break;
1436
381
  case "think_message_output_start": {
1437
- r.value.set(l, Date.now()), f.value.set(l, "thinking");
1438
- const k = c.value.get(l) || [];
1439
- c.value.set(l, [...k, { type: "thinking", content: "" }]), p(l);
382
+ c.value.set(e, Date.now()), h.value.set(e, "thinking");
383
+ const m = o.value.get(e) || [];
384
+ o.value.set(e, [...m, { type: "thinking", content: "" }]), R(e);
1440
385
  break;
1441
386
  }
1442
387
  case "agent_thought": {
1443
- const k = T.thought || T.thinking || "", C = c.value.get(l) || [], R = C[C.length - 1];
1444
- R && R.type === "agent_thought" ? R.content += k : (f.value.set(l, "agent_thought"), C.push({ type: "agent_thought", content: k }), u.value.set(l, Date.now())), c.value.set(l, C), o((P) => {
1445
- if (P[l]) {
1446
- const $ = [...P];
1447
- return $[l] = {
1448
- ...$[l],
1449
- segments: C.map((F) => ({ ...F })),
1450
- thinkingContent: ($[l].thinkingContent || "") + k,
1451
- status: i.THINKING
1452
- }, $;
388
+ const m = b.thought || b.thinking || "", w = o.value.get(e) || [], p = w[w.length - 1];
389
+ p && p.type === "agent_thought" ? p.content += m : (h.value.set(e, "agent_thought"), w.push({ type: "agent_thought", content: m }), l.value.set(e, Date.now())), o.value.set(e, w), u((S) => {
390
+ if (S[e]) {
391
+ const H = [...S];
392
+ return H[e] = {
393
+ ...H[e],
394
+ segments: w.map(($) => ({ ...$ })),
395
+ thinkingContent: (H[e].thinkingContent || "") + m,
396
+ status: s.THINKING
397
+ }, H;
1453
398
  }
1454
- return P;
399
+ return S;
1455
400
  });
1456
401
  break;
1457
402
  }
1458
403
  case "think_message": {
1459
- const k = T.thinking || T.answer || T.text || "", C = c.value.get(l) || [], R = C[C.length - 1];
1460
- R && R.type === "thinking" ? R.content += k : (C.push({ type: "thinking", content: k }), r.value.set(l, Date.now())), c.value.set(l, C), o((P) => {
1461
- if (P[l]) {
1462
- const $ = [...P];
1463
- return $[l] = {
1464
- ...$[l],
1465
- segments: C.map((F) => ({ ...F })),
1466
- thinkingContent: ($[l].thinkingContent || "") + k,
1467
- status: i.THINKING
1468
- }, $;
404
+ const m = b.thinking || b.answer || b.text || "", w = o.value.get(e) || [], p = w[w.length - 1];
405
+ p && p.type === "thinking" ? p.content += m : (w.push({ type: "thinking", content: m }), c.value.set(e, Date.now())), o.value.set(e, w), u((S) => {
406
+ if (S[e]) {
407
+ const H = [...S];
408
+ return H[e] = {
409
+ ...H[e],
410
+ segments: w.map(($) => ({ ...$ })),
411
+ thinkingContent: (H[e].thinkingContent || "") + m,
412
+ status: s.THINKING
413
+ }, H;
1469
414
  }
1470
- return P;
415
+ return S;
1471
416
  });
1472
417
  break;
1473
418
  }
1474
419
  case "agent_thought_end": {
1475
- const k = u.value.get(l), C = k ? Math.round((Date.now() - k) / 1e3 * 10) / 10 : 0, R = c.value.get(l) || [], P = R[R.length - 1];
1476
- P && P.type === "agent_thought" && (P.duration = C), c.value.set(l, R), o(($) => {
1477
- if ($[l]) {
1478
- const F = [...$];
1479
- return F[l] = {
1480
- ...F[l],
1481
- segments: R.map((Y) => ({ ...Y })),
1482
- thinkingDuration: (F[l].thinkingDuration || 0) + C
1483
- }, F;
420
+ const m = l.value.get(e), w = m ? Math.round((Date.now() - m) / 1e3 * 10) / 10 : 0, p = o.value.get(e) || [], S = p[p.length - 1];
421
+ S && S.type === "agent_thought" && (S.duration = w), o.value.set(e, p), u((H) => {
422
+ if (H[e]) {
423
+ const $ = [...H];
424
+ return $[e] = {
425
+ ...$[e],
426
+ segments: p.map((V) => ({ ...V })),
427
+ thinkingDuration: ($[e].thinkingDuration || 0) + w
428
+ }, $;
1484
429
  }
1485
- return $;
430
+ return H;
1486
431
  });
1487
432
  break;
1488
433
  }
1489
434
  case "think_message_output_end": {
1490
- const k = r.value.get(l), C = k ? Math.round((Date.now() - k) / 1e3 * 10) / 10 : 0, R = c.value.get(l) || [], P = R[R.length - 1];
1491
- P && P.type === "thinking" && (P.duration = C), c.value.set(l, R), o(($) => {
1492
- if ($[l]) {
1493
- const F = [...$];
1494
- return F[l] = {
1495
- ...F[l],
1496
- segments: R.map((Y) => ({ ...Y })),
1497
- thinkingDuration: (F[l].thinkingDuration || 0) + C
1498
- }, F;
435
+ const m = c.value.get(e), w = m ? Math.round((Date.now() - m) / 1e3 * 10) / 10 : 0, p = o.value.get(e) || [], S = p[p.length - 1];
436
+ S && S.type === "thinking" && (S.duration = w), o.value.set(e, p), u((H) => {
437
+ if (H[e]) {
438
+ const $ = [...H];
439
+ return $[e] = {
440
+ ...$[e],
441
+ segments: p.map((V) => ({ ...V })),
442
+ thinkingDuration: ($[e].thinkingDuration || 0) + w
443
+ }, $;
1499
444
  }
1500
- return $;
445
+ return H;
1501
446
  });
1502
447
  break;
1503
448
  }
1504
449
  case "tool_message": {
1505
- const k = T.answer || T.text || T.content || "";
1506
- if (!k) break;
1507
- const C = c.value.get(l) || [];
1508
- C.push({ type: "answer", content: k }), c.value.set(l, C), p(l);
450
+ const m = b.answer || b.text || b.content || "";
451
+ if (!m) break;
452
+ const w = o.value.get(e) || [];
453
+ w.push({ type: "answer", content: m }), o.value.set(e, w), R(e);
1509
454
  break;
1510
455
  }
1511
456
  case "message_output_start":
1512
- f.value.set(l, "answer"), E(l);
457
+ h.value.set(e, "answer"), L(e);
1513
458
  break;
1514
459
  case "message": {
1515
- const k = T.answer || "", C = f.value.get(l), R = c.value.get(l) || [], P = R[R.length - 1];
1516
- C === "answer" && P && P.type === "answer" ? P.content += k : (E(l), f.value.set(l, "answer"), R.push({ type: "answer", content: k })), c.value.set(l, R);
1517
- const $ = R.filter((F) => F.type === "answer").map((F) => F.content).join("");
1518
- o((F) => {
1519
- if (F[l]) {
1520
- const Y = [...F];
1521
- return Y[l] = {
1522
- ...Y[l],
1523
- segments: R.map((K) => ({ ...K })),
1524
- content: $,
1525
- status: d.value ? i.STOP : i.ANSWERING
1526
- }, Y;
460
+ const m = b.answer || "", w = h.value.get(e), p = o.value.get(e) || [], S = p[p.length - 1];
461
+ w === "answer" && S && S.type === "answer" ? S.content += m : (L(e), h.value.set(e, "answer"), p.push({ type: "answer", content: m })), o.value.set(e, p);
462
+ const H = p.filter(($) => $.type === "answer").map(($) => $.content).join("");
463
+ u(($) => {
464
+ if ($[e]) {
465
+ const V = [...$];
466
+ return V[e] = {
467
+ ...V[e],
468
+ segments: p.map((Z) => ({ ...Z })),
469
+ content: H,
470
+ status: r.value ? s.STOP : s.ANSWERING
471
+ }, V;
1527
472
  }
1528
- return F;
473
+ return $;
1529
474
  });
1530
475
  break;
1531
476
  }
1532
477
  case "message_end": {
1533
- n();
1534
- const k = [...t.value];
1535
- k[l] && (k[l] = { ...k[l], status: d.value ? i.STOP : i.COMPLETED }), t.value = k, s.value = !1;
478
+ i();
479
+ const m = [...t.value];
480
+ m[e] && (m[e] = { ...m[e], status: r.value ? s.STOP : s.COMPLETED }), t.value = m, v.value = !1;
1536
481
  break;
1537
482
  }
1538
483
  case "agent_error":
1539
484
  case "message_failed": {
1540
- n();
1541
- const k = [...t.value];
1542
- k[l] && (k[l] = {
1543
- ...k[l],
1544
- status: i.ERROR,
1545
- content: T.error_msg || T.message || "请求失败",
1546
- errorMessage: T.error_msg || T.message || "请求失败"
1547
- }, t.value = k), s.value = !1;
485
+ i();
486
+ const m = [...t.value];
487
+ m[e] && (m[e] = {
488
+ ...m[e],
489
+ status: s.ERROR,
490
+ content: b.error_msg || b.message || "请求失败",
491
+ errorMessage: b.error_msg || b.message || "请求失败"
492
+ }, t.value = m), v.value = !1;
1548
493
  break;
1549
494
  }
1550
495
  case "message_replace": {
1551
- const k = T.answer || "", C = c.value.get(l) || [], R = (m = C.map((P, $) => ({ s: P, i: $ })).reverse().find((P) => P.s.type === "answer")) == null ? void 0 : m.i;
1552
- R != null ? C[R] = { ...C[R], content: k } : C.push({ type: "answer", content: k }), c.value.set(l, C), o((P) => {
1553
- if (P[l]) {
1554
- const $ = [...P];
1555
- return $[l] = {
1556
- ...$[l],
1557
- segments: C.map((F) => ({ ...F })),
1558
- content: k
1559
- }, $;
496
+ const m = b.answer || "", w = o.value.get(e) || [], p = (P = w.map((S, H) => ({ s: S, i: H })).reverse().find((S) => S.s.type === "answer")) == null ? void 0 : P.i;
497
+ p != null ? w[p] = { ...w[p], content: m } : w.push({ type: "answer", content: m }), o.value.set(e, w), u((S) => {
498
+ if (S[e]) {
499
+ const H = [...S];
500
+ return H[e] = {
501
+ ...H[e],
502
+ segments: w.map(($) => ({ ...$ })),
503
+ content: m
504
+ }, H;
1560
505
  }
1561
- return P;
506
+ return S;
1562
507
  });
1563
508
  break;
1564
509
  }
1565
510
  case "message_cost": {
1566
- const k = {
1567
- inputTokens: T.input_tokens || 0,
1568
- outputTokens: T.output_tokens || 0,
1569
- latency: T.latency || 0,
1570
- latencyFirstResp: T.latency_first_resp
511
+ const m = {
512
+ inputTokens: b.input_tokens || 0,
513
+ outputTokens: b.output_tokens || 0,
514
+ latency: b.latency || 0,
515
+ latencyFirstResp: b.latency_first_resp
1571
516
  };
1572
- o((C) => {
1573
- if (C[l]) {
1574
- const R = [...C];
1575
- return R[l] = { ...R[l], cost: k }, R;
517
+ u((w) => {
518
+ if (w[e]) {
519
+ const p = [...w];
520
+ return p[e] = { ...p[e], cost: m }, p;
1576
521
  }
1577
- return C;
522
+ return w;
1578
523
  });
1579
524
  break;
1580
525
  }
1581
526
  default:
1582
527
  }
1583
- } catch (L) {
1584
- console.error("[ai-assist-sdk] onmessage 解析失败:", L);
528
+ } catch (N) {
529
+ console.error("[ai-assist-sdk] onmessage 解析失败:", N);
1585
530
  }
1586
531
  },
1587
532
  onclose() {
1588
- n(), E(l), n();
1589
- const m = (c.value.get(l) || []).filter((T) => T.type === "answer").map((T) => T.content).join(""), L = [...t.value];
1590
- L[l] && L[l].status !== i.ERROR && (L[l] = {
1591
- ...L[l],
1592
- content: d.value && !m ? "已停止回答" : m,
1593
- status: d.value ? i.STOP : i.COMPLETED
1594
- }), t.value = L, s.value = !1;
533
+ i(), L(e), i();
534
+ const P = (o.value.get(e) || []).filter((b) => b.type === "answer").map((b) => b.content).join(""), N = [...t.value];
535
+ N[e] && N[e].status !== s.ERROR && (N[e] = {
536
+ ...N[e],
537
+ content: r.value && !P ? "已停止回答" : P,
538
+ status: r.value ? s.STOP : s.COMPLETED
539
+ }), t.value = N, v.value = !1;
1595
540
  },
1596
- onerror(S) {
1597
- console.error("[ai-assist-sdk] ❌ 连接错误:", S), n();
1598
- const m = [...t.value];
1599
- m[l] && (m[l] = { ...m[l], content: `
1600
- ⚠️ 请求异常,已终止`, status: i.ERROR }), t.value = m, s.value = !1;
541
+ onerror(k) {
542
+ console.error("[ai-assist-sdk] ❌ 连接错误:", k), i();
543
+ const P = [...t.value];
544
+ P[e] && (P[e] = { ...P[e], content: `
545
+ ⚠️ 请求异常,已终止`, status: s.ERROR }), t.value = P, v.value = !1;
1601
546
  }
1602
547
  });
1603
- } catch (w) {
1604
- if (console.error("[ai-assist-sdk] doStreamRequest error:", w), !d.value) {
1605
- n();
1606
- const S = [...t.value];
1607
- S[l] && (S[l] = { ...S[l], content: "服务连接失败,请稍后重试", status: i.ERROR }), t.value = S, s.value = !1;
548
+ } catch (A) {
549
+ if (console.error("[ai-assist-sdk] doStreamRequest error:", A), !r.value) {
550
+ i();
551
+ const k = [...t.value];
552
+ k[e] && (k[e] = { ...k[e], content: "服务连接失败,请稍后重试", status: s.ERROR }), t.value = k, v.value = !1;
1608
553
  }
1609
554
  }
1610
555
  }
1611
- return { doStreamRequest: D, issTop: d };
556
+ return { doStreamRequest: Q, issTop: r };
1612
557
  }
1613
- function ws(t) {
1614
- var s;
558
+ function Ee(t) {
559
+ var v;
1615
560
  if (typeof t == "string") {
1616
- const e = xe(t);
1617
- return Re(e) || t;
561
+ const a = Nt(t);
562
+ return Yt(a) || t;
1618
563
  }
1619
- return (t == null ? void 0 : t.answer) || ((s = t == null ? void 0 : t.data) == null ? void 0 : s.answer) || String(t || "");
564
+ return (t == null ? void 0 : t.answer) || ((v = t == null ? void 0 : t.data) == null ? void 0 : v.answer) || String(t || "");
1620
565
  }
1621
- function ks(t) {
566
+ function Re(t) {
1622
567
  return t.queryAgainStreamApi || t.queryAgainApi || t.chatQueryStreamApi || t.chatQueryApi;
1623
568
  }
1624
- function bs({
569
+ function Te({
1625
570
  messages: t,
1626
- userInput: s,
1627
- isGenerating: e,
1628
- lastUserMessage: o,
1629
- conversationId: n,
1630
- doStreamRequest: i,
1631
- issTop: a,
1632
- scrollToBottom: c,
1633
- STATUS: f,
1634
- cfg: r
571
+ userInput: v,
572
+ isGenerating: a,
573
+ lastUserMessage: u,
574
+ conversationId: i,
575
+ doStreamRequest: s,
576
+ issTop: C,
577
+ scrollToBottom: o,
578
+ STATUS: h,
579
+ cfg: c
1635
580
  }) {
1636
- const u = r.apis, d = J({
581
+ const l = c.apis, r = K({
1637
582
  first: new AbortController(),
1638
583
  again: new AbortController()
1639
584
  });
1640
- async function p() {
1641
- const l = s.value.trim();
1642
- if (!l || e.value) return;
1643
- const g = [
585
+ async function R() {
586
+ const e = v.value.trim();
587
+ if (!e || a.value) return;
588
+ const d = [
1644
589
  ...t.value,
1645
- { type: "user", content: l },
1646
- { type: "ai", content: "", status: f.THINKING }
590
+ { type: "user", content: e },
591
+ { type: "ai", content: "", status: h.THINKING }
1647
592
  ];
1648
- t.value = g, s.value = "", c();
1649
- const A = g.length - 1;
1650
- if (u.chatQueryStreamApi) {
1651
- console.log("[ai-assist-sdk] ✅ 使用流式 SSE:", u.chatQueryStreamApi), await i(u.chatQueryStreamApi, {
1652
- Query: l,
1653
- AppConversationID: n.value,
593
+ t.value = d, v.value = "", o();
594
+ const O = d.length - 1;
595
+ if (l.chatQueryStreamApi) {
596
+ console.log("[ai-assist-sdk] ✅ 使用流式 SSE:", l.chatQueryStreamApi), await s(l.chatQueryStreamApi, {
597
+ Query: e,
598
+ AppConversationID: i.value,
1654
599
  ResponseMode: "streaming"
1655
- }, A, d.first.signal);
600
+ }, O, r.first.signal);
1656
601
  return;
1657
602
  }
1658
603
  console.warn("[ai-assist-sdk] ⚠️ 未配置 chatQueryStreamApi,降级为非流式请求");
1659
604
  try {
1660
- const S = await Te().post(u.chatQueryApi, {
1661
- app: r.app ?? 1,
1662
- data: { Query: l, AppConversationID: n.value }
1663
- }), m = ws(S.data);
1664
- t.value = [...t.value.slice(0, -1), { type: "ai", content: m, status: f.COMPLETED }];
1665
- } catch (w) {
1666
- t.value = [...t.value.slice(0, -1), { type: "ai", content: (w == null ? void 0 : w.message) || "服务连接失败,请稍后重试", status: f.ERROR }];
605
+ const k = await Bt().post(l.chatQueryApi, {
606
+ app: c.app ?? 1,
607
+ data: { Query: e, AppConversationID: i.value }
608
+ }), P = Ee(k.data);
609
+ t.value = [...t.value.slice(0, -1), { type: "ai", content: P, status: h.COMPLETED }];
610
+ } catch (A) {
611
+ t.value = [...t.value.slice(0, -1), { type: "ai", content: (A == null ? void 0 : A.message) || "服务连接失败,请稍后重试", status: h.ERROR }];
1667
612
  }
1668
613
  }
1669
- async function E() {
1670
- if (!o.value || e.value) return;
1671
- d.again.abort(), d.again = new AbortController();
1672
- const l = [...t.value];
1673
- l.length > 0 && l[l.length - 1].type === "ai" && l.pop(), l.push({ type: "ai", content: "", status: f.RETHINKING }), t.value = l, c();
1674
- const g = t.value.length - 1, A = ks(u);
1675
- await i(A, {
1676
- MessageID: o.value,
1677
- AppConversationID: n.value,
614
+ async function L() {
615
+ if (!u.value || a.value) return;
616
+ r.again.abort(), r.again = new AbortController();
617
+ const e = [...t.value];
618
+ e.length > 0 && e[e.length - 1].type === "ai" && e.pop(), e.push({ type: "ai", content: "", status: h.RETHINKING }), t.value = e, o();
619
+ const d = t.value.length - 1, O = Re(l);
620
+ await s(O, {
621
+ MessageID: u.value,
622
+ AppConversationID: i.value,
1678
623
  ResponseMode: "streaming"
1679
- }, g, d.again.signal, !0);
624
+ }, d, r.again.signal, !0);
1680
625
  }
1681
- async function D() {
1682
- if (!u.stopMessageApi || !e.value) return;
1683
- const l = t.value.length - 1 - 1;
626
+ async function Q() {
627
+ if (!l.stopMessageApi || !a.value) return;
628
+ const e = t.value.length - 1 - 1;
1684
629
  try {
1685
- await Ee(u, o.value);
1686
- const g = [...t.value];
1687
- g[l] && (g[l] = { ...g[l], content: g[l].content || "已停止回答", status: f.STOP }), t.value = g, e.value = !1, d.first.abort(), d.first = new AbortController(), d.again.abort(), d.again = new AbortController(), a.value = !0;
1688
- } catch (g) {
1689
- const A = [...t.value];
1690
- A[l] && (A[l] = { ...A[l], content: (g == null ? void 0 : g.message) || "系统繁忙,请稍后再试", status: f.ERROR }), t.value = A;
630
+ await Lt(l, u.value);
631
+ const d = [...t.value];
632
+ d[e] && (d[e] = { ...d[e], content: d[e].content || "已停止回答", status: h.STOP }), t.value = d, a.value = !1, r.first.abort(), r.first = new AbortController(), r.again.abort(), r.again = new AbortController(), C.value = !0;
633
+ } catch (d) {
634
+ const O = [...t.value];
635
+ O[e] && (O[e] = { ...O[e], content: (d == null ? void 0 : d.message) || "系统繁忙,请稍后再试", status: h.ERROR }), t.value = O;
1691
636
  }
1692
637
  }
1693
- async function y(l) {
1694
- var g, A, w;
1695
- n.value = l;
638
+ async function D(e) {
639
+ var d, O, A;
640
+ i.value = e;
1696
641
  try {
1697
- const S = await Se(u, l), m = (w = (A = (g = S == null ? void 0 : S.messages) == null ? void 0 : g[0]) == null ? void 0 : A.answerInfo) == null ? void 0 : w.answer;
1698
- m && (t.value = [...t.value, { type: "ai", content: m, status: f.COMPLETED }]);
1699
- } catch (S) {
1700
- ct((S == null ? void 0 : S.message) || "加载历史会话失败");
642
+ const k = await $t(l, e), P = (A = (O = (d = k == null ? void 0 : k.messages) == null ? void 0 : d[0]) == null ? void 0 : O.answerInfo) == null ? void 0 : A.answer;
643
+ P && (t.value = [...t.value, { type: "ai", content: P, status: h.COMPLETED }]);
644
+ } catch (k) {
645
+ it((k == null ? void 0 : k.message) || "加载历史会话失败");
1701
646
  }
1702
647
  }
1703
- async function v() {
1704
- var l;
648
+ async function B() {
649
+ var e;
1705
650
  try {
1706
- const g = await Ae(u);
1707
- (l = g == null ? void 0 : g.conversation) != null && l.appConversationID && (n.value = g.conversation.appConversationID);
1708
- } catch (g) {
1709
- ct((g == null ? void 0 : g.message) || "创建会话失败");
651
+ const d = await Pt(l);
652
+ (e = d == null ? void 0 : d.conversation) != null && e.appConversationID && (i.value = d.conversation.appConversationID);
653
+ } catch (d) {
654
+ it((d == null ? void 0 : d.message) || "创建会话失败");
1710
655
  }
1711
656
  }
1712
- return { sendMessage: p, regenerateResponse: E, toggleStop: D, goHistoryMessage: y, initConversation: v, controllers: d };
657
+ return { sendMessage: R, regenerateResponse: L, toggleStop: Q, goHistoryMessage: D, initConversation: B, controllers: r };
1713
658
  }
1714
- const Cs = { class: "container" }, As = { class: "message ai-message greet-message" }, Ss = { class: "ai-greet" }, Es = {
659
+ const De = { class: "container" }, Me = { class: "message ai-message greet-message" }, Oe = { class: "ai-greet" }, He = {
1715
660
  key: 0,
1716
661
  class: "message ai-message recommend-message"
1717
- }, Ts = { class: "ai-recommend" }, xs = { class: "recommend-header" }, Rs = ["src"], Os = ["onClick"], Ms = /* @__PURE__ */ q({
662
+ }, Pe = { class: "ai-recommend" }, $e = { class: "recommend-header" }, Le = ["src"], Be = ["onClick"], Ne = /* @__PURE__ */ nt({
1718
663
  __name: "Answer",
1719
664
  props: {
1720
665
  defaultSayhello: {},
1721
666
  defaultRecommend: {}
1722
667
  },
1723
- setup(t, { expose: s }) {
1724
- const e = {
668
+ setup(t, { expose: v }) {
669
+ const a = {
1725
670
  THINKING: "thinking",
1726
671
  RETHINKING: "rethinking",
1727
672
  ANSWERING: "answering",
@@ -1729,467 +674,471 @@ const Cs = { class: "container" }, As = { class: "message ai-message greet-messa
1729
674
  COMPLETED: "completed",
1730
675
  STOP: "stop",
1731
676
  ERROR: "error"
1732
- }, o = t, n = wt(), i = M([]), a = M(""), c = M(!1), f = M(""), r = M(""), u = M(null), d = J({ text1: "", text2: "" }), p = M([]), E = M(0), D = et(
1733
- () => p.value[E.value % (p.value.length || 1)]
677
+ }, u = t, i = vt(), s = T([]), C = T(""), o = T(!1), h = T(""), c = T(""), l = T(null), r = K({ text1: "", text2: "" }), R = T([]), L = T(0), Q = et(
678
+ () => R.value[L.value % (R.value.length || 1)]
1734
679
  );
1735
- function y() {
1736
- E.value++;
680
+ function D() {
681
+ L.value++;
1737
682
  }
1738
- function v(Q) {
1739
- a.value = Q;
683
+ function B(W) {
684
+ C.value = W;
1740
685
  }
1741
- const { isAtBottom: l, hasScroll: g, scrollToBottom: A, checkScrollStatus: w } = gs(u), { enhanceCodeBlocks: S } = ps(), { batchMessagesUpdate: m, flushMessagesBatch: L } = vs(i), { displayedContent: T, streamingIndexRef: k, startTypewriter: C, stopTypewriter: R, getSegmentDisplayContent: P } = ms(
1742
- i,
1743
- A,
1744
- e.ANSWERING
1745
- ), { doStreamRequest: $, issTop: F } = ys({
1746
- messages: i,
1747
- isGenerating: c,
1748
- lastUserMessage: f,
1749
- batchMessagesUpdate: m,
1750
- flushMessagesBatch: L,
1751
- STATUS: e,
1752
- cfg: n
1753
- }), { sendMessage: Y, regenerateResponse: K, toggleStop: Ct, goHistoryMessage: ft, initConversation: x } = bs({
1754
- messages: i,
1755
- userInput: a,
1756
- isGenerating: c,
1757
- lastUserMessage: f,
1758
- conversationId: r,
1759
- doStreamRequest: $,
1760
- issTop: F,
1761
- scrollToBottom: A,
1762
- STATUS: e,
1763
- cfg: n
686
+ const { isAtBottom: e, hasScroll: d, scrollToBottom: O, checkScrollStatus: A } = we(l), { enhanceCodeBlocks: k } = Ce(), { batchMessagesUpdate: P, flushMessagesBatch: N } = Ae(s), { displayedContent: b, streamingIndexRef: m, startTypewriter: w, stopTypewriter: p, getSegmentDisplayContent: S } = be(
687
+ s,
688
+ O,
689
+ a.ANSWERING
690
+ ), { doStreamRequest: H, issTop: $ } = Se({
691
+ messages: s,
692
+ isGenerating: o,
693
+ lastUserMessage: h,
694
+ batchMessagesUpdate: P,
695
+ flushMessagesBatch: N,
696
+ STATUS: a,
697
+ cfg: i
698
+ }), { sendMessage: V, regenerateResponse: Z, toggleStop: dt, goHistoryMessage: lt, initConversation: f } = Te({
699
+ messages: s,
700
+ userInput: C,
701
+ isGenerating: o,
702
+ lastUserMessage: h,
703
+ conversationId: c,
704
+ doStreamRequest: H,
705
+ issTop: $,
706
+ scrollToBottom: O,
707
+ STATUS: a,
708
+ cfg: i
1764
709
  });
1765
- function H() {
1766
- i.value = [], f.value = "", x();
710
+ function E() {
711
+ s.value = [], h.value = "", f();
1767
712
  }
1768
- const I = et(() => !!r.value && i.value.length === 0);
1769
- s({ goHistoryMessage: ft, createNewConversation: H, isEmptyConversation: I });
1770
- const V = M(/* @__PURE__ */ new Map());
1771
- function dt(Q, _) {
1772
- Q ? V.value.set(_, Q) : V.value.delete(_);
713
+ const _ = et(() => !!c.value && s.value.length === 0);
714
+ v({ goHistoryMessage: lt, createNewConversation: E, isEmptyConversation: _ });
715
+ const J = T(/* @__PURE__ */ new Map());
716
+ function ct(W, G) {
717
+ W ? J.value.set(G, W) : J.value.delete(G);
1773
718
  }
1774
- Pt(i, () => {
1775
- lt(() => {
1776
- i.value.forEach((Q, _) => {
1777
- Q.type === "ai" && Q.status !== e.ANSWERING && (T.set(_, Q.content), k.value.set(_, Q.content.length));
1778
- }), C(), V.value.forEach((Q) => {
1779
- S(Q);
719
+ wt(s, () => {
720
+ ut(() => {
721
+ s.value.forEach((W, G) => {
722
+ W.type === "ai" && W.status !== a.ANSWERING && (b.set(G, W.content), m.value.set(G, W.content.length));
723
+ }), w(), J.value.forEach((W) => {
724
+ k(W);
1780
725
  });
1781
726
  });
1782
727
  }, { deep: !0 });
1783
- let Z = null;
1784
- return W(() => {
1785
- o.defaultSayhello && (d.text1 = o.defaultSayhello.text1, d.text2 = o.defaultSayhello.text2), o.defaultRecommend && (p.value = Oe(o.defaultRecommend));
1786
- }), W(() => {
1787
- x();
1788
- }), W(() => {
1789
- u.value && (Z = () => w(), u.value.addEventListener("scroll", Z));
728
+ let I = null;
729
+ return q(() => {
730
+ u.defaultSayhello && (r.text1 = u.defaultSayhello.text1, r.text2 = u.defaultSayhello.text2), u.defaultRecommend && (R.value = Qt(u.defaultRecommend));
731
+ }), q(() => {
732
+ f();
733
+ }), q(() => {
734
+ l.value && (I = () => A(), l.value.addEventListener("scroll", I));
1790
735
  }), mt(() => {
1791
- R(), u.value && Z && u.value.removeEventListener("scroll", Z);
1792
- }), (Q, _) => {
1793
- var Nt;
1794
- return b(), O("div", Cs, [
1795
- h("div", {
736
+ p(), l.value && I && l.value.removeEventListener("scroll", I);
737
+ }), (W, G) => {
738
+ var ht;
739
+ return g(), y("div", De, [
740
+ n("div", {
1796
741
  class: "chat-box scrollWrap",
1797
742
  ref_key: "chatBoxRef",
1798
- ref: u
743
+ ref: l
1799
744
  }, [
1800
- h("div", As, [
1801
- h("div", Ss, [
1802
- h("h1", null, B(d.text1), 1),
1803
- h("p", null, B(d.text2), 1)
745
+ n("div", Me, [
746
+ n("div", Oe, [
747
+ n("h1", null, X(r.text1), 1),
748
+ n("p", null, X(r.text2), 1)
1804
749
  ])
1805
750
  ]),
1806
- (Nt = D.value) != null && Nt.length ? (b(), O("div", Es, [
1807
- h("div", Ts, [
1808
- h("div", xs, [
1809
- _[2] || (_[2] = h("span", null, "你可以尝试这样问我:", -1)),
1810
- h("p", {
751
+ (ht = Q.value) != null && ht.length ? (g(), y("div", He, [
752
+ n("div", Pe, [
753
+ n("div", $e, [
754
+ G[2] || (G[2] = n("span", null, "你可以尝试这样问我:", -1)),
755
+ n("p", {
1811
756
  class: "refresh-btn",
1812
- onClick: y
757
+ onClick: D
1813
758
  }, [
1814
- h("img", { src: N(We) }, null, 8, Rs),
1815
- _[1] || (_[1] = h("span", null, "换一换", -1))
759
+ n("img", { src: M(zt) }, null, 8, Le),
760
+ G[1] || (G[1] = n("span", null, "换一换", -1))
1816
761
  ])
1817
762
  ]),
1818
- h("ul", null, [
1819
- (b(!0), O(U, null, rt(D.value, (tt, ht) => (b(), O("li", {
1820
- key: ht,
1821
- onClick: (yo) => v(tt)
1822
- }, B(tt), 9, Os))), 128))
763
+ n("ul", null, [
764
+ (g(!0), y(z, null, at(Q.value, (tt, rt) => (g(), y("li", {
765
+ key: rt,
766
+ onClick: (bn) => B(tt)
767
+ }, X(tt), 9, Be))), 128))
1823
768
  ])
1824
769
  ])
1825
- ])) : j("", !0),
1826
- (b(!0), O(U, null, rt(i.value, (tt, ht) => (b(), z(cn, {
1827
- key: ht,
770
+ ])) : Y("", !0),
771
+ (g(!0), y(z, null, at(s.value, (tt, rt) => (g(), j(ge, {
772
+ key: rt,
1828
773
  msg: tt,
1829
- index: ht,
1830
- STATUS: e,
1831
- displayedContent: N(T),
1832
- getSegmentDisplayContent: N(P),
1833
- setMessageRef: dt,
1834
- onRegenerate: N(K)
774
+ index: rt,
775
+ STATUS: a,
776
+ displayedContent: M(b),
777
+ getSegmentDisplayContent: M(S),
778
+ setMessageRef: ct,
779
+ onRegenerate: M(Z)
1835
780
  }, null, 8, ["msg", "index", "displayedContent", "getSegmentDisplayContent", "onRegenerate"]))), 128))
1836
781
  ], 512),
1837
- G(hs, {
1838
- modelValue: a.value,
1839
- "onUpdate:modelValue": _[0] || (_[0] = (tt) => a.value = tt),
1840
- isGenerating: c.value,
1841
- lastUserMessage: f.value,
1842
- hasScroll: N(g),
1843
- isAtBottom: N(l),
1844
- onSend: N(Y),
1845
- onRegenerate: N(K),
1846
- onStop: N(Ct),
1847
- onScrollToBottom: N(A)
782
+ F(ke, {
783
+ modelValue: C.value,
784
+ "onUpdate:modelValue": G[0] || (G[0] = (tt) => C.value = tt),
785
+ isGenerating: o.value,
786
+ lastUserMessage: h.value,
787
+ hasScroll: M(d),
788
+ isAtBottom: M(e),
789
+ onSend: M(V),
790
+ onRegenerate: M(Z),
791
+ onStop: M(dt),
792
+ onScrollToBottom: M(O)
1848
793
  }, null, 8, ["modelValue", "isGenerating", "lastUserMessage", "hasScroll", "isAtBottom", "onSend", "onRegenerate", "onStop", "onScrollToBottom"])
1849
794
  ]);
1850
795
  };
1851
796
  }
1852
- }), Ps = { class: "ai-history" }, Ds = { class: "content" }, Ls = { key: 0 }, Hs = ["onClick"], Ns = { class: "info-pic" }, $s = { class: "info-content" }, Fs = { class: "info-content-title" }, js = { class: "info-content-time" }, Bs = ["onClick"], Is = ["src"], Qs = { class: "ai-modal" }, _s = { class: "ai-modal-footer" }, Ys = /* @__PURE__ */ q({
797
+ }), Ye = { class: "ai-history" }, Qe = { class: "content" }, _e = { key: 0 }, Xe = ["onClick"], We = { class: "info-pic" }, Ge = { class: "info-content" }, Ve = { class: "info-content-title" }, Je = { class: "info-content-time" }, Fe = ["onClick"], Ue = ["src"], je = { class: "ai-modal" }, qe = { class: "ai-modal-footer" }, xe = /* @__PURE__ */ nt({
1853
798
  __name: "History",
1854
799
  emits: ["history-detail", "new-answer"],
1855
- setup(t, { emit: s }) {
1856
- const o = wt().apis, n = M([]), i = M(!1), a = M("");
1857
- async function c() {
800
+ setup(t, { emit: v }) {
801
+ const u = vt().apis, i = T([]), s = T(!1), C = T("");
802
+ async function o() {
1858
803
  try {
1859
- const u = await Me(o);
1860
- u != null && u.conversationList && (n.value = u.conversationList.filter((d) => d !== null).map((d) => ({ ...d, selected: !1 })));
1861
- } catch (u) {
1862
- ct((u == null ? void 0 : u.message) || "获取历史记录失败");
804
+ const l = await _t(u);
805
+ l != null && l.conversationList && (i.value = l.conversationList.filter((r) => r !== null).map((r) => ({ ...r, selected: !1 })));
806
+ } catch (l) {
807
+ it((l == null ? void 0 : l.message) || "获取历史记录失败");
1863
808
  }
1864
809
  }
1865
- function f(u) {
1866
- a.value = u, i.value = !0;
810
+ function h(l) {
811
+ C.value = l, s.value = !0;
1867
812
  }
1868
- async function r() {
1869
- i.value = !1;
813
+ async function c() {
814
+ s.value = !1;
1870
815
  try {
1871
- await Pe(o, a.value), await c();
1872
- } catch (u) {
1873
- ct((u == null ? void 0 : u.message) || "删除失败"), await c();
816
+ await Xt(u, C.value), await o();
817
+ } catch (l) {
818
+ it((l == null ? void 0 : l.message) || "删除失败"), await o();
1874
819
  }
1875
820
  }
1876
- return W(() => {
1877
- c();
1878
- }), (u, d) => (b(), O("div", Ps, [
1879
- h("div", Ds, [
1880
- n.value.length > 0 ? (b(), O("div", Ls, [
1881
- (b(!0), O(U, null, rt(n.value, (p) => (b(), O("div", {
1882
- key: p.appConversationID,
821
+ return q(() => {
822
+ o();
823
+ }), (l, r) => (g(), y("div", Ye, [
824
+ n("div", Qe, [
825
+ i.value.length > 0 ? (g(), y("div", _e, [
826
+ (g(!0), y(z, null, at(i.value, (R) => (g(), y("div", {
827
+ key: R.appConversationID,
1883
828
  class: "info",
1884
- onClick: (E) => u.$emit("history-detail", p.appConversationID)
829
+ onClick: (L) => l.$emit("history-detail", R.appConversationID)
1885
830
  }, [
1886
- h("div", Ns, B(p.conversationName.slice(0, 1)), 1),
1887
- h("div", $s, [
1888
- h("div", Fs, B(p.conversationName), 1),
1889
- h("div", js, B(p.createTime), 1)
831
+ n("div", We, X(R.conversationName.slice(0, 1)), 1),
832
+ n("div", Ge, [
833
+ n("div", Ve, X(R.conversationName), 1),
834
+ n("div", Je, X(R.createTime), 1)
1890
835
  ]),
1891
- h("div", {
836
+ n("div", {
1892
837
  class: "clear-history",
1893
- onClick: Ft((E) => f(p.appConversationID), ["stop"])
1894
- }, "删除", 8, Bs)
1895
- ], 8, Hs))), 128))
1896
- ])) : j("", !0)
838
+ onClick: ft((L) => h(R.appConversationID), ["stop"])
839
+ }, "删除", 8, Fe)
840
+ ], 8, Xe))), 128))
841
+ ])) : Y("", !0)
1897
842
  ]),
1898
- h("div", {
843
+ n("div", {
1899
844
  class: "ai-add",
1900
- onClick: d[0] || (d[0] = (p) => u.$emit("new-answer"))
845
+ onClick: r[0] || (r[0] = (R) => l.$emit("new-answer"))
1901
846
  }, [
1902
- h("img", { src: N(Be) }, null, 8, Is),
1903
- d[3] || (d[3] = h("span", { style: { color: "#333333" } }, "新建AI对话", -1))
847
+ n("img", { src: M(jt) }, null, 8, Ue),
848
+ r[3] || (r[3] = n("span", { style: { color: "#333333" } }, "新建AI对话", -1))
1904
849
  ]),
1905
- (b(), z(ye, { to: "body" }, [
1906
- i.value ? (b(), O("div", {
850
+ (g(), j(Tt, { to: "body" }, [
851
+ s.value ? (g(), y("div", {
1907
852
  key: 0,
1908
853
  class: "ai-modal-overlay",
1909
- onClick: d[2] || (d[2] = Ft((p) => i.value = !1, ["self"]))
854
+ onClick: r[2] || (r[2] = ft((R) => s.value = !1, ["self"]))
1910
855
  }, [
1911
- h("div", Qs, [
1912
- d[4] || (d[4] = h("div", { class: "ai-modal-header" }, "确定要删除该历史记录吗?", -1)),
1913
- d[5] || (d[5] = h("div", { class: "ai-modal-body" }, "一旦删除,数据将无法恢复。", -1)),
1914
- h("div", _s, [
1915
- h("button", {
856
+ n("div", je, [
857
+ r[4] || (r[4] = n("div", { class: "ai-modal-header" }, "确定要删除该历史记录吗?", -1)),
858
+ r[5] || (r[5] = n("div", { class: "ai-modal-body" }, "一旦删除,数据将无法恢复。", -1)),
859
+ n("div", qe, [
860
+ n("button", {
1916
861
  class: "ai-modal-btn cancel",
1917
- onClick: d[1] || (d[1] = (p) => i.value = !1)
862
+ onClick: r[1] || (r[1] = (R) => s.value = !1)
1918
863
  }, "取消"),
1919
- h("button", {
864
+ n("button", {
1920
865
  class: "ai-modal-btn confirm",
1921
- onClick: r
866
+ onClick: c
1922
867
  }, "确定")
1923
868
  ])
1924
869
  ])
1925
- ])) : j("", !0)
870
+ ])) : Y("", !0)
1926
871
  ]))
1927
872
  ]));
1928
873
  }
1929
- }), Vs = (t, s) => {
1930
- const e = t.__vccOpts || t;
1931
- for (const [o, n] of s)
1932
- e[o] = n;
1933
- return e;
1934
- }, Ws = /* @__PURE__ */ Vs(Ys, [["__scopeId", "data-v-9267d81a"]]), Xs = { class: "container info" }, Gs = { class: "info-item" }, Us = { class: "basic-content" }, zs = { class: "basic-content-text" }, Js = { class: "basic-content" }, qs = { class: "basic-content-text" }, Ks = { class: "info-item" }, Zs = { class: "permission-content" }, to = { class: "info-item" }, eo = { class: "basic-content" }, no = { class: "basic-content-text" }, so = { class: "basic-content" }, oo = { class: "basic-content-text" }, io = /* @__PURE__ */ q({
874
+ }), ze = (t, v) => {
875
+ const a = t.__vccOpts || t;
876
+ for (const [u, i] of v)
877
+ a[u] = i;
878
+ return a;
879
+ }, Ke = /* @__PURE__ */ ze(xe, [["__scopeId", "data-v-9267d81a"]]), Ze = { class: "container info" }, Ie = { class: "info-item" }, tn = { class: "basic-content" }, en = { class: "basic-content-text" }, nn = { class: "basic-content" }, sn = { class: "basic-content-text" }, on = { class: "info-item" }, an = { class: "permission-content" }, ln = { class: "info-item" }, cn = { class: "basic-content" }, rn = { class: "basic-content-text" }, un = { class: "basic-content" }, vn = { class: "basic-content-text" }, dn = /* @__PURE__ */ nt({
1935
880
  __name: "Info",
1936
881
  setup(t) {
1937
- const s = wt(), e = M(null);
1938
- return W(async () => {
882
+ const v = vt(), a = T(null);
883
+ return q(async () => {
1939
884
  try {
1940
- e.value = await De(s.apis);
1941
- } catch (o) {
1942
- ct((o == null ? void 0 : o.message) || "获取个人信息失败");
885
+ a.value = await Wt(v.apis);
886
+ } catch (u) {
887
+ it((u == null ? void 0 : u.message) || "获取个人信息失败");
1943
888
  }
1944
- }), (o, n) => {
1945
- var i, a, c, f, r;
1946
- return b(), O("div", Xs, [
1947
- h("div", Gs, [
1948
- n[2] || (n[2] = h("div", { class: "heading" }, [
1949
- h("div", { class: "heading-column" }),
1950
- h("div", { class: "heading-title" }, "基本信息")
889
+ }), (u, i) => {
890
+ var s, C, o, h, c;
891
+ return g(), y("div", Ze, [
892
+ n("div", Ie, [
893
+ i[2] || (i[2] = n("div", { class: "heading" }, [
894
+ n("div", { class: "heading-column" }),
895
+ n("div", { class: "heading-title" }, "基本信息")
1951
896
  ], -1)),
1952
- h("div", Us, [
1953
- n[0] || (n[0] = h("div", { class: "basic-content-text basic-content-key" }, "姓名", -1)),
1954
- h("div", zs, B(((i = e.value) == null ? void 0 : i.name) || ""), 1)
897
+ n("div", tn, [
898
+ i[0] || (i[0] = n("div", { class: "basic-content-text basic-content-key" }, "姓名", -1)),
899
+ n("div", en, X(((s = a.value) == null ? void 0 : s.name) || ""), 1)
1955
900
  ]),
1956
- h("div", Js, [
1957
- n[1] || (n[1] = h("div", { class: "basic-content-text basic-content-key" }, "用户名", -1)),
1958
- h("div", qs, B(((a = e.value) == null ? void 0 : a.userName) || ""), 1)
901
+ n("div", nn, [
902
+ i[1] || (i[1] = n("div", { class: "basic-content-text basic-content-key" }, "用户名", -1)),
903
+ n("div", sn, X(((C = a.value) == null ? void 0 : C.userName) || ""), 1)
1959
904
  ])
1960
905
  ]),
1961
- h("div", Ks, [
1962
- n[3] || (n[3] = h("div", { class: "heading" }, [
1963
- h("div", { class: "heading-column" }),
1964
- h("div", { class: "heading-title" }, "数据权限")
906
+ n("div", on, [
907
+ i[3] || (i[3] = n("div", { class: "heading" }, [
908
+ n("div", { class: "heading-column" }),
909
+ n("div", { class: "heading-title" }, "数据权限")
1965
910
  ], -1)),
1966
- h("div", Zs, [
1967
- (b(!0), O(U, null, rt((c = e.value) == null ? void 0 : c.ptnameList, (u, d) => (b(), O("div", {
1968
- key: d,
911
+ n("div", an, [
912
+ (g(!0), y(z, null, at((o = a.value) == null ? void 0 : o.ptnameList, (l, r) => (g(), y("div", {
913
+ key: r,
1969
914
  class: "permission-content-text"
1970
- }, B(u), 1))), 128))
915
+ }, X(l), 1))), 128))
1971
916
  ])
1972
917
  ]),
1973
- h("div", to, [
1974
- n[6] || (n[6] = h("div", { class: "heading" }, [
1975
- h("div", { class: "heading-column" }),
1976
- h("div", { class: "heading-title" }, "帮助信息")
918
+ n("div", ln, [
919
+ i[6] || (i[6] = n("div", { class: "heading" }, [
920
+ n("div", { class: "heading-column" }),
921
+ n("div", { class: "heading-title" }, "帮助信息")
1977
922
  ], -1)),
1978
- h("div", eo, [
1979
- n[4] || (n[4] = h("div", { class: "basic-content-text basic-content-key" }, "部门", -1)),
1980
- h("div", no, B(((f = e.value) == null ? void 0 : f.dept) || ""), 1)
923
+ n("div", cn, [
924
+ i[4] || (i[4] = n("div", { class: "basic-content-text basic-content-key" }, "部门", -1)),
925
+ n("div", rn, X(((h = a.value) == null ? void 0 : h.dept) || ""), 1)
1981
926
  ]),
1982
- h("div", so, [
1983
- n[5] || (n[5] = h("div", { class: "basic-content-text basic-content-key" }, "邮箱", -1)),
1984
- h("div", oo, B(((r = e.value) == null ? void 0 : r.email) || ""), 1)
927
+ n("div", un, [
928
+ i[5] || (i[5] = n("div", { class: "basic-content-text basic-content-key" }, "邮箱", -1)),
929
+ n("div", vn, X(((c = a.value) == null ? void 0 : c.email) || ""), 1)
1985
930
  ])
1986
931
  ])
1987
932
  ]);
1988
933
  };
1989
934
  }
1990
- }), ao = { class: "header" }, ro = ["src"], lo = { class: "header-title" }, co = ["src"], uo = ["src"], fo = { class: "setTitle" }, ho = { class: "content" }, go = { class: "main" }, po = { class: "btn" }, vo = ["src"], mo = 117, it = 118, de = /* @__PURE__ */ q({
935
+ }), gn = { class: "header" }, mn = { key: 1 }, hn = ["src"], fn = { class: "header-title" }, pn = { class: "setTitle" }, yn = { class: "content" }, kn = { class: "main" }, wn = { class: "btn" }, Cn = ["src"], An = 117, st = 118, At = /* @__PURE__ */ nt({
1991
936
  __name: "AiAssist",
1992
937
  setup(t) {
1993
- const s = mo / 2, e = wt(), o = M(!1), n = M(!1), i = M("answer"), a = M(!1), c = M(""), f = M(""), r = J({
1994
- x: window.innerWidth - s,
1995
- y: window.innerHeight / 2 - it / 2
1996
- }), u = M(!1), d = M(!1), p = M("right"), E = M("left"), D = J({ x: 0, y: 0 }), y = M(!1), v = M(null);
1997
- let l = null;
1998
- const g = et(() => {
1999
- const x = window.innerWidth / 2;
2000
- return r.x + s < x ? 5 : -5;
2001
- }), A = et(() => n.value ? "" : `panel-${p.value}`), w = et(() => {
2002
- var x;
2003
- return !((x = v.value) != null && x.isEmptyConversation);
2004
- }), S = et(() => ({
2005
- left: `${r.x}px`,
2006
- top: `${r.y}px`,
2007
- transition: u.value ? "none" : "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)",
2008
- "--direction": String(g.value)
938
+ const v = An / 2, a = vt(), u = T(!1), i = T(!1), s = T("answer"), C = T(!1), o = T(""), h = T(""), c = K({
939
+ x: window.innerWidth - v,
940
+ y: window.innerHeight / 2 - st / 2
941
+ }), l = T(!1), r = T(!1), R = T("right"), L = T("left"), Q = K({ x: 0, y: 0 }), D = T(!1), B = T(null);
942
+ let e = null;
943
+ const d = et(() => {
944
+ const f = window.innerWidth / 2;
945
+ return c.x + v < f ? 5 : -5;
946
+ }), O = et(() => i.value ? "" : `panel-${R.value}`), A = et(() => {
947
+ var f;
948
+ return !((f = B.value) != null && f.isEmptyConversation);
949
+ }), k = et(() => ({
950
+ left: `${c.x}px`,
951
+ top: `${c.y}px`,
952
+ transition: l.value ? "none" : "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1)",
953
+ "--direction": String(d.value)
2009
954
  }));
2010
- function m() {
2011
- const x = window.innerWidth / 2;
2012
- r.x + s < x ? (p.value = "left", E.value = "right") : (p.value = "right", E.value = "left");
955
+ function P() {
956
+ const f = window.innerWidth / 2;
957
+ c.x + v < f ? (R.value = "left", L.value = "right") : (R.value = "right", L.value = "left");
2013
958
  }
2014
- function L() {
2015
- const x = window.innerWidth, H = Math.max(0, Math.min(r.y, window.innerHeight - it));
2016
- return { x: r.x + s >= x / 2 ? x - s : -s, y: H };
959
+ function N() {
960
+ const f = window.innerWidth, E = Math.max(0, Math.min(c.y, window.innerHeight - st));
961
+ return { x: c.x + v >= f / 2 ? f - v : -v, y: E };
2017
962
  }
2018
- function T() {
2019
- d.value = !0;
2020
- const x = L();
2021
- r.x = x.x, r.y = x.y, setTimeout(() => {
2022
- d.value = !1, m(), k();
963
+ function b() {
964
+ r.value = !0;
965
+ const f = N();
966
+ c.x = f.x, c.y = f.y, setTimeout(() => {
967
+ r.value = !1, P(), m();
2023
968
  }, 400);
2024
969
  }
2025
- function k() {
970
+ function m() {
2026
971
  try {
2027
- localStorage.setItem("characterPosition", JSON.stringify({ x: r.x, y: r.y })), localStorage.setItem("panelPosition", p.value), localStorage.setItem("backPosition", E.value);
972
+ localStorage.setItem("characterPosition", JSON.stringify({ x: c.x, y: c.y })), localStorage.setItem("panelPosition", R.value), localStorage.setItem("backPosition", L.value);
2028
973
  } catch {
2029
974
  }
2030
975
  }
2031
- function C() {
2032
- const x = localStorage.getItem("characterPosition");
2033
- if (x) {
2034
- const V = JSON.parse(x);
2035
- r.x = V.x, r.y = Math.min(Math.max(V.y, 0), window.innerHeight - it);
976
+ function w() {
977
+ const f = localStorage.getItem("characterPosition");
978
+ if (f) {
979
+ const J = JSON.parse(f);
980
+ c.x = J.x, c.y = Math.min(Math.max(J.y, 0), window.innerHeight - st);
2036
981
  } else
2037
- r.x = window.innerWidth - s, r.y = window.innerHeight / 2 - it / 2;
2038
- const H = localStorage.getItem("panelPosition"), I = localStorage.getItem("backPosition");
2039
- H && (p.value = H), I && (E.value = I);
982
+ c.x = window.innerWidth - v, c.y = window.innerHeight / 2 - st / 2;
983
+ const E = localStorage.getItem("panelPosition"), _ = localStorage.getItem("backPosition");
984
+ E && (R.value = E), _ && (L.value = _);
2040
985
  }
2041
- function R(x) {
2042
- if (!u.value) return;
2043
- const H = "touches" in x ? x.touches[0].clientX : x.clientX, I = "touches" in x ? x.touches[0].clientY : x.clientY, V = H - D.x, dt = Math.max(0, Math.min(I - D.y, window.innerHeight - it)), Z = Math.abs(V - r.x), Q = Math.abs(dt - r.y);
2044
- Z + Q > 5 && (y.value = !0), r.x = V, r.y = dt;
986
+ function p(f) {
987
+ if (!l.value) return;
988
+ const E = "touches" in f ? f.touches[0].clientX : f.clientX, _ = "touches" in f ? f.touches[0].clientY : f.clientY, J = E - Q.x, ct = Math.max(0, Math.min(_ - Q.y, window.innerHeight - st)), I = Math.abs(J - c.x), W = Math.abs(ct - c.y);
989
+ I + W > 5 && (D.value = !0), c.x = J, c.y = ct;
2045
990
  }
2046
- function P() {
2047
- u.value && (u.value = !1, y.value && (T(), y.value = !1));
991
+ function S() {
992
+ l.value && (l.value = !1, D.value && (b(), D.value = !1));
2048
993
  }
2049
- function $(x) {
2050
- d.value = !1, u.value = !0, y.value = !1;
2051
- const H = "touches" in x ? x.touches[0].clientX : x.clientX, I = "touches" in x ? x.touches[0].clientY : x.clientY;
2052
- D.x = H - r.x, D.y = I - r.y;
994
+ function H(f) {
995
+ r.value = !1, l.value = !0, D.value = !1;
996
+ const E = "touches" in f ? f.touches[0].clientX : f.clientX, _ = "touches" in f ? f.touches[0].clientY : f.clientY;
997
+ Q.x = E - c.x, Q.y = _ - c.y;
2053
998
  }
2054
- function F() {
2055
- !y.value && !d.value ? (m(), o.value = !0) : y.value = !1;
999
+ function $() {
1000
+ !D.value && !r.value ? (P(), u.value = !0) : D.value = !1;
2056
1001
  }
2057
- function Y(x) {
2058
- i.value = "answer", lt(() => {
2059
- var H;
2060
- (H = v.value) == null || H.goHistoryMessage(x);
1002
+ function V(f) {
1003
+ s.value = "answer", ut(() => {
1004
+ var E;
1005
+ (E = B.value) == null || E.goHistoryMessage(f);
2061
1006
  });
2062
1007
  }
2063
- function K() {
2064
- i.value = "answer", lt(() => {
2065
- var x;
2066
- (x = v.value) == null || x.createNewConversation();
1008
+ function Z() {
1009
+ s.value = "answer", ut(() => {
1010
+ var f;
1011
+ (f = B.value) == null || f.createNewConversation();
2067
1012
  });
2068
1013
  }
2069
- function Ct() {
2070
- f.value = c.value, a.value = !1;
1014
+ function dt() {
1015
+ h.value = o.value, C.value = !1;
2071
1016
  }
2072
- Pt(n, (x) => {
2073
- x ? p.value = "center" : m();
2074
- }), W(() => {
2075
- C();
1017
+ wt(i, (f) => {
1018
+ f ? R.value = "center" : P();
1019
+ }), q(() => {
1020
+ w();
2076
1021
  });
2077
- function ft() {
2078
- l && clearTimeout(l), l = setTimeout(() => T(), 100);
1022
+ function lt() {
1023
+ e && clearTimeout(e), e = setTimeout(() => b(), 100);
2079
1024
  }
2080
- return W(() => {
2081
- window.addEventListener("resize", ft);
1025
+ return q(() => {
1026
+ window.addEventListener("resize", lt);
2082
1027
  }), mt(() => {
2083
- window.removeEventListener("resize", ft), l && clearTimeout(l);
2084
- }), W(() => {
2085
- document.addEventListener("mousemove", R), document.addEventListener("touchmove", R, { passive: !0 }), document.addEventListener("mouseup", P), document.addEventListener("touchend", P);
1028
+ window.removeEventListener("resize", lt), e && clearTimeout(e);
1029
+ }), q(() => {
1030
+ document.addEventListener("mousemove", p), document.addEventListener("touchmove", p, { passive: !0 }), document.addEventListener("mouseup", S), document.addEventListener("touchend", S);
2086
1031
  }), mt(() => {
2087
- document.removeEventListener("mousemove", R), document.removeEventListener("touchmove", R), document.removeEventListener("mouseup", P), document.removeEventListener("touchend", P);
2088
- }), (x, H) => (b(), O("div", null, [
2089
- o.value ? (b(), O("div", {
1032
+ document.removeEventListener("mousemove", p), document.removeEventListener("touchmove", p), document.removeEventListener("mouseup", S), document.removeEventListener("touchend", S);
1033
+ }), (f, E) => (g(), y("div", null, [
1034
+ u.value ? (g(), y("div", {
2090
1035
  key: 0,
2091
- class: X(["ai-panel", n.value ? "maxWrap" : "minWrap", A.value])
1036
+ class: U(["ai-panel", i.value ? "maxWrap" : "minWrap", O.value])
2092
1037
  }, [
2093
- h("div", ao, [
2094
- h("p", null, [
2095
- i.value === "info" || i.value === "history" ? (b(), O("span", {
2096
- key: 0,
2097
- class: X(["back", E.value]),
2098
- onClick: H[0] || (H[0] = (I) => i.value = "answer")
2099
- }, [...H[6] || (H[6] = [
2100
- h("span", { style: { "font-size": "18px" } }, "←", -1)
2101
- ])], 2)) : (b(), O("img", {
2102
- key: 1,
2103
- src: N(Ie)
2104
- }, null, 8, ro))
2105
- ]),
2106
- h("div", lo, [
2107
- h("span", null, B(i.value === "info" ? "个人信息" : i.value === "history" ? "历史信息" : N(e).name), 1)
1038
+ n("div", gn, [
1039
+ s.value === "info" || s.value === "history" ? (g(), y("span", {
1040
+ key: 0,
1041
+ class: U(["back", L.value]),
1042
+ onClick: E[0] || (E[0] = (_) => s.value = "answer")
1043
+ }, [...E[7] || (E[7] = [
1044
+ n("span", { style: { "font-size": "14px" } }, "←", -1)
1045
+ ])], 2)) : (g(), y("p", mn, [
1046
+ n("img", { src: M(qt) }, null, 8, hn)
1047
+ ])),
1048
+ n("div", fn, [
1049
+ n("span", null, X(s.value === "info" ? "个人信息" : s.value === "history" ? "历史信息" : M(a).name), 1)
2108
1050
  ]),
2109
- h("p", null, [
2110
- At(G(N(Fe), {
1051
+ n("p", null, [
1052
+ gt(F(M(x), {
2111
1053
  class: "op-icon",
2112
- onClick: K
1054
+ icon: "humbleicons:plus",
1055
+ onClick: Z
2113
1056
  }, null, 512), [
2114
- [jt, w.value]
1057
+ [pt, A.value]
2115
1058
  ]),
2116
- h("img", {
2117
- onClick: H[1] || (H[1] = (I) => n.value = !n.value),
2118
- src: n.value ? N(Qe) : N(_e)
2119
- }, null, 8, co),
2120
- h("img", {
2121
- onClick: H[2] || (H[2] = (I) => o.value = !1),
2122
- src: N(Ye)
2123
- }, null, 8, uo)
1059
+ s.value !== "history" ? (g(), j(M(x), {
1060
+ key: 0,
1061
+ class: "mute",
1062
+ icon: "humbleicons:history",
1063
+ onClick: E[1] || (E[1] = (_) => s.value = "history")
1064
+ })) : Y("", !0),
1065
+ F(M(x), {
1066
+ onClick: E[2] || (E[2] = (_) => i.value = !i.value),
1067
+ icon: i.value ? "humbleicons:align-objects-right" : "humbleicons:arrows-horizontal"
1068
+ }, null, 8, ["icon"]),
1069
+ F(M(x), {
1070
+ onClick: E[3] || (E[3] = (_) => u.value = !1),
1071
+ icon: "humbleicons:times"
1072
+ })
2124
1073
  ])
2125
1074
  ]),
2126
- i.value === "answer" ? (b(), z(Ms, {
1075
+ s.value === "answer" ? (g(), j(Ne, {
2127
1076
  key: 0,
2128
1077
  ref_key: "answerRef",
2129
- ref: v,
2130
- defaultSayhello: N(e).defaultSayhello,
2131
- defaultRecommend: N(e).defaultRecommend
2132
- }, null, 8, ["defaultSayhello", "defaultRecommend"])) : j("", !0),
2133
- i.value === "history" ? (b(), z(Ws, {
1078
+ ref: B,
1079
+ defaultSayhello: M(a).defaultSayhello,
1080
+ defaultRecommend: M(a).defaultRecommend
1081
+ }, null, 8, ["defaultSayhello", "defaultRecommend"])) : Y("", !0),
1082
+ s.value === "history" ? (g(), j(Ke, {
2134
1083
  key: 1,
2135
- onHistoryDetail: Y,
2136
- onNewAnswer: H[3] || (H[3] = (I) => i.value = "answer")
2137
- })) : j("", !0),
2138
- i.value === "info" ? (b(), z(io, { key: 2 })) : j("", !0),
2139
- At(h("div", fo, [
2140
- h("div", ho, [
2141
- h("div", go, [
2142
- H[7] || (H[7] = h("p", { class: "title" }, "修改标题", -1)),
2143
- At(h("textarea", {
2144
- "onUpdate:modelValue": H[4] || (H[4] = (I) => c.value = I),
1084
+ onHistoryDetail: V,
1085
+ onNewAnswer: E[4] || (E[4] = (_) => s.value = "answer")
1086
+ })) : Y("", !0),
1087
+ s.value === "info" ? (g(), j(dn, { key: 2 })) : Y("", !0),
1088
+ gt(n("div", pn, [
1089
+ n("div", yn, [
1090
+ n("div", kn, [
1091
+ E[8] || (E[8] = n("p", { class: "title" }, "修改标题", -1)),
1092
+ gt(n("textarea", {
1093
+ "onUpdate:modelValue": E[5] || (E[5] = (_) => o.value = _),
2145
1094
  placeholder: "请输入新标题"
2146
1095
  }, null, 512), [
2147
- [we, c.value]
1096
+ [Dt, o.value]
2148
1097
  ]),
2149
- h("p", po, [
2150
- h("span", {
2151
- onClick: H[5] || (H[5] = (I) => a.value = !1)
1098
+ n("p", wn, [
1099
+ n("span", {
1100
+ onClick: E[6] || (E[6] = (_) => C.value = !1)
2152
1101
  }, "取消"),
2153
- h("span", { onClick: Ct }, "确定")
1102
+ n("span", { onClick: dt }, "确定")
2154
1103
  ])
2155
1104
  ])
2156
1105
  ])
2157
1106
  ], 512), [
2158
- [jt, a.value]
1107
+ [pt, C.value]
2159
1108
  ])
2160
- ], 2)) : j("", !0),
2161
- o.value ? j("", !0) : (b(), O("div", {
1109
+ ], 2)) : Y("", !0),
1110
+ u.value ? Y("", !0) : (g(), y("div", {
2162
1111
  key: 1,
2163
- class: X(["character", { dragging: u.value, recycling: d.value }]),
2164
- style: ke(S.value),
2165
- onMousedown: $,
2166
- onTouchstart: $,
2167
- onClick: F
1112
+ class: U(["character", { dragging: l.value, recycling: r.value }]),
1113
+ style: Mt(k.value),
1114
+ onMousedown: H,
1115
+ onTouchstart: H,
1116
+ onClick: $
2168
1117
  }, [
2169
- h("img", { src: N(Ve) }, null, 8, vo)
1118
+ n("img", { src: M(xt) }, null, 8, Cn)
2170
1119
  ], 38))
2171
1120
  ]));
2172
1121
  }
2173
1122
  });
2174
- let at = null;
2175
- const Ao = (t) => {
2176
- te(t);
2177
- }, So = (t) => {
2178
- const s = t || document.body, e = document.createElement("div");
2179
- e.id = "ai-assist-root", s.appendChild(e), at = be(de), at.mount(e);
2180
- }, Eo = () => {
2181
- at && (at.unmount(), at = null);
1123
+ let ot = null;
1124
+ const Mn = (t) => {
1125
+ Ct(t);
1126
+ }, On = (t) => {
1127
+ const v = t || document.body, a = document.createElement("div");
1128
+ a.id = "ai-assist-root", v.appendChild(a), ot = Ot(At), ot.mount(a);
1129
+ }, Hn = () => {
1130
+ ot && (ot.unmount(), ot = null);
2182
1131
  const t = document.getElementById("ai-assist-root");
2183
1132
  t && t.remove();
2184
- }, To = {
2185
- install(t, s) {
2186
- te(s), t.component("AiAssist", de);
1133
+ }, Pn = {
1134
+ install(t, v) {
1135
+ Ct(v), t.component("AiAssist", At);
2187
1136
  }
2188
1137
  };
2189
1138
  export {
2190
- de as AiAssist,
2191
- To as default,
2192
- Ao as initAiAssist,
2193
- So as mountAiAssist,
2194
- Eo as unmountAiAssist
1139
+ At as AiAssist,
1140
+ Pn as default,
1141
+ Mn as initAiAssist,
1142
+ On as mountAiAssist,
1143
+ Hn as unmountAiAssist
2195
1144
  };