wi-chat 0.5.0 → 0.6.0

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,10 +1,10 @@
1
1
  import { createAnswerContentMap as re, provideOutputFileConfig as de, DeepThinkingSteps as ce, AiAnswerBubble as ue } from "wi-chat/renderers";
2
- import { AiAnswerBubble as xo, ClarificationCard as Oo, DeepThinkingSteps as Do, IframePage as Qo, KnowledgeStreamResult as No, OutputFile as jo, createAnswerContentMap as Ho, injectIframeResizerChild as Wo, provideIframePageConfig as qo, provideOutputFileConfig as Ko, resolveIframePlaceholders as Yo, useIframePage as Xo } from "wi-chat/renderers";
3
- import { defineComponent as D, computed as $, openBlock as s, createElementBlock as l, normalizeClass as z, createElementVNode as t, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as C, createTextVNode as O, toDisplayString as A, createCommentVNode as g, createStaticVNode as ae, pushScopeId as q, popScopeId as K, Fragment as P, renderList as j, normalizeProps as Z, guardReactiveProps as G, ref as x, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as le, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
2
+ import { AgentActionStatus as Es, AiAnswerBubble as xs, ClarificationCard as Os, DeepThinkingSteps as Ds, IframePage as Qs, KnowledgeStreamResult as Ns, OutputFile as js, createAnswerContentMap as Hs, injectIframeResizerChild as Ws, provideIframePageConfig as qs, provideOutputFileConfig as Ks, resolveIframePlaceholders as Ys, useIframePage as Xs } from "wi-chat/renderers";
3
+ import { defineComponent as D, computed as k, openBlock as s, createElementBlock as n, normalizeClass as z, createElementVNode as t, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as $, createTextVNode as O, toDisplayString as A, createCommentVNode as g, createStaticVNode as le, pushScopeId as q, popScopeId as K, Fragment as P, renderList as j, normalizeProps as Z, guardReactiveProps as G, ref as x, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as se, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
4
4
  import { ElImage as me, ElPopover as be, ElCheckbox as fe, ElInput as ge, ElTooltip as ee } from "element-plus";
5
5
  import { isImageAttachment as ye, resolveAttachPreviewUrl as ke, normalizeAttachment as $e, resolveRemoteFileUrl as Ce, parseRealtimeAttachment as Ue } from "wi-chat/parser";
6
6
  import { downloadAttachment as Ae, useAutoScroll as Be } from "wi-chat/tools";
7
- const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-attach-card__icon" }, Fe = /* @__PURE__ */ H(() => /* @__PURE__ */ t("div", { class: "wi-web-attach-card__image-fallback" }, [
7
+ const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-attach-card__icon" }, Fe = /* @__PURE__ */ H(() => /* @__PURE__ */ t("div", { class: "wi-web-attach-card__image-fallback" }, [
8
8
  /* @__PURE__ */ t("svg", {
9
9
  viewBox: "0 0 24 24",
10
10
  width: "16",
@@ -60,7 +60,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
60
60
  fill: "none",
61
61
  stroke: "currentColor",
62
62
  "stroke-width": "2"
63
- }, Ve = /* @__PURE__ */ ae('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
63
+ }, Ve = /* @__PURE__ */ le('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
64
64
  Ve
65
65
  ], Te = {
66
66
  key: 2,
@@ -82,7 +82,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
82
82
  fill: "none",
83
83
  stroke: "currentColor",
84
84
  "stroke-width": "2"
85
- }, Oe = /* @__PURE__ */ ae('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
85
+ }, Oe = /* @__PURE__ */ le('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
86
86
  Oe
87
87
  ], Qe = { class: "wi-web-attach-card__info" }, Ne = ["title"], je = {
88
88
  key: 0,
@@ -116,54 +116,54 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
116
116
  getFileUrl: { type: Function, default: void 0 }
117
117
  },
118
118
  emits: ["click", "remove", "download"],
119
- setup(c, { emit: U }) {
120
- const n = c, i = U, h = $(() => {
119
+ setup(p, { emit: C }) {
120
+ const i = p, r = C, _ = k(() => {
121
121
  var o;
122
- return ((o = n.item) == null ? void 0 : o.attachContent) || {};
123
- }), b = $(() => ye(n.item)), f = $(() => ke(n.item, n.baseURL, n.getFileUrl)), a = $(() => {
124
- if (n.removable)
122
+ return ((o = i.item) == null ? void 0 : o.attachContent) || {};
123
+ }), m = k(() => ye(i.item)), b = k(() => ke(i.item, i.baseURL, i.getFileUrl)), a = k(() => {
124
+ if (i.removable)
125
125
  return !1;
126
- if (n.downloadable !== void 0)
127
- return n.downloadable;
128
- if (n.item.type && n.item.type !== "file")
126
+ if (i.downloadable !== void 0)
127
+ return i.downloadable;
128
+ if (i.item.type && i.item.type !== "file")
129
129
  return !1;
130
- const o = h.value;
130
+ const o = _.value;
131
131
  return !!(o.fileId || o.raw);
132
- }), d = () => {
133
- i("click", n.item);
134
- }, r = () => {
135
- i("remove", n.item);
136
- }, u = async () => {
137
- i("download", n.item), await Ae(n.item, {
138
- baseURL: n.baseURL,
139
- getFileUrl: n.getFileUrl
132
+ }), u = () => {
133
+ r("click", i.item);
134
+ }, d = () => {
135
+ r("remove", i.item);
136
+ }, h = async () => {
137
+ r("download", i.item), await Ae(i.item, {
138
+ baseURL: i.baseURL,
139
+ getFileUrl: i.getFileUrl
140
140
  });
141
141
  };
142
- return (o, p) => (s(), l("div", {
142
+ return (o, l) => (s(), n("div", {
143
143
  class: z(["wi-web-attach-card", { "is-clickable": o.clickable || !!o.$attrs.onClick }]),
144
- onClick: d
144
+ onClick: u
145
145
  }, [
146
146
  t("div", Ie, [
147
147
  S(o.$slots, "icon", { item: o.item }, () => [
148
- b.value && f.value ? (s(), V(I(me), {
148
+ m.value && b.value ? (s(), V(I(me), {
149
149
  key: 0,
150
- src: f.value,
151
- "preview-src-list": [f.value],
150
+ src: b.value,
151
+ "preview-src-list": [b.value],
152
152
  "zoom-rate": 1.2,
153
153
  "preview-teleported": "",
154
154
  fit: "cover",
155
155
  class: "wi-web-attach-card__image",
156
- onClick: p[0] || (p[0] = te(() => {
156
+ onClick: l[0] || (l[0] = te(() => {
157
157
  }, ["stop"]))
158
158
  }, {
159
- placeholder: C(() => [
159
+ placeholder: $(() => [
160
160
  Fe
161
161
  ]),
162
- error: C(() => [
162
+ error: $(() => [
163
163
  Re
164
164
  ]),
165
165
  _: 1
166
- }, 8, ["src", "preview-src-list"])) : o.item.type === "table" ? (s(), l("svg", Se, Le)) : o.item.type === "metric" ? (s(), l("svg", Te, Ee)) : (s(), l("svg", xe, De))
166
+ }, 8, ["src", "preview-src-list"])) : o.item.type === "table" ? (s(), n("svg", Se, Le)) : o.item.type === "metric" ? (s(), n("svg", Te, Ee)) : (s(), n("svg", xe, De))
167
167
  ], !0)
168
168
  ]),
169
169
  t("div", Qe, [
@@ -175,7 +175,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
175
175
  O(A(o.item.name), 1)
176
176
  ], !0)
177
177
  ], 8, Ne),
178
- o.item.description || o.$slots.description ? (s(), l("div", je, [
178
+ o.item.description || o.$slots.description ? (s(), n("div", je, [
179
179
  S(o.$slots, "description", { item: o.item }, () => [
180
180
  O(A(o.item.description), 1)
181
181
  ], !0)
@@ -183,29 +183,29 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
183
183
  ]),
184
184
  t("div", He, [
185
185
  S(o.$slots, "actions", { item: o.item }, () => [
186
- a.value ? (s(), l("button", {
186
+ a.value ? (s(), n("button", {
187
187
  key: 0,
188
188
  type: "button",
189
189
  class: "wi-web-attach-card__action-btn wi-web-attach-card__download",
190
190
  title: "下载附件",
191
- onClick: te(u, ["stop"])
191
+ onClick: te(h, ["stop"])
192
192
  }, qe)) : g("", !0),
193
- o.removable ? (s(), l("button", {
193
+ o.removable ? (s(), n("button", {
194
194
  key: 1,
195
195
  type: "button",
196
196
  class: "wi-web-attach-card__action-btn wi-web-attach-card__delete",
197
197
  title: "删除附件",
198
- onClick: te(r, ["stop"])
198
+ onClick: te(d, ["stop"])
199
199
  }, " × ")) : g("", !0)
200
200
  ], !0)
201
201
  ])
202
202
  ], 2));
203
203
  }
204
- }), Q = (c, U) => {
205
- const n = c.__vccOpts || c;
206
- for (const [i, h] of U)
207
- n[i] = h;
208
- return n;
204
+ }), Q = (p, C) => {
205
+ const i = p.__vccOpts || p;
206
+ for (const [r, _] of C)
207
+ i[r] = _;
208
+ return i;
209
209
  }, Ye = /* @__PURE__ */ Q(Ke, [["__scopeId", "data-v-dc2d5f2b"]]), Xe = {
210
210
  key: 0,
211
211
  class: "wi-web-attachment-list"
@@ -220,57 +220,57 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
220
220
  getFileUrl: { type: Function, default: void 0 }
221
221
  },
222
222
  emits: ["remove", "click", "download"],
223
- setup(c, { emit: U }) {
224
- const n = c, i = U, h = $(() => (n.items || []).map((r, u) => {
225
- var _, y;
226
- const o = $e(r), p = (_ = o.attachContent) == null ? void 0 : _.raw, m = ((y = o.attachContent) == null ? void 0 : y.fileId) || (p ? `${p.name}_${p.size}_${u}` : `${o.name}_${u}`);
223
+ setup(p, { emit: C }) {
224
+ const i = p, r = C, _ = k(() => (i.items || []).map((d, h) => {
225
+ var c, f;
226
+ const o = $e(d), l = (c = o.attachContent) == null ? void 0 : c.raw, U = ((f = o.attachContent) == null ? void 0 : f.fileId) || (l ? `${l.name}_${l.size}_${h}` : `${o.name}_${h}`);
227
227
  return {
228
228
  ...o,
229
- key: m
229
+ key: U
230
230
  };
231
- })), b = (d, r) => {
232
- i("remove", d, r);
233
- }, f = (d, r) => {
234
- i("click", d, r);
235
- }, a = (d, r) => {
236
- i("download", d, r);
231
+ })), m = (u, d) => {
232
+ r("remove", u, d);
233
+ }, b = (u, d) => {
234
+ r("click", u, d);
235
+ }, a = (u, d) => {
236
+ r("download", u, d);
237
237
  };
238
- return (d, r) => h.value.length > 0 ? (s(), l("div", Xe, [
239
- (s(!0), l(P, null, j(h.value, (u, o) => (s(), V(Ye, {
240
- key: u.key || o,
241
- item: u,
242
- removable: d.removable,
243
- downloadable: d.downloadable,
244
- clickable: d.clickable || !!d.$attrs.onClick,
245
- "base-u-r-l": d.baseURL,
246
- "get-file-url": d.getFileUrl,
247
- onClick: (p) => f(u, o),
248
- onRemove: (p) => b(o, u),
249
- onDownload: (p) => a(u, o)
238
+ return (u, d) => _.value.length > 0 ? (s(), n("div", Xe, [
239
+ (s(!0), n(P, null, j(_.value, (h, o) => (s(), V(Ye, {
240
+ key: h.key || o,
241
+ item: h,
242
+ removable: u.removable,
243
+ downloadable: u.downloadable,
244
+ clickable: u.clickable || !!u.$attrs.onClick,
245
+ "base-u-r-l": u.baseURL,
246
+ "get-file-url": u.getFileUrl,
247
+ onClick: (l) => b(h, o),
248
+ onRemove: (l) => m(o, h),
249
+ onDownload: (l) => a(h, o)
250
250
  }, {
251
- icon: C((p) => [
252
- S(d.$slots, "icon", Z(G(p)), void 0, !0)
251
+ icon: $((l) => [
252
+ S(u.$slots, "icon", Z(G(l)), void 0, !0)
253
253
  ]),
254
- title: C((p) => [
255
- S(d.$slots, "title", Z(G(p)), void 0, !0)
254
+ title: $((l) => [
255
+ S(u.$slots, "title", Z(G(l)), void 0, !0)
256
256
  ]),
257
- description: C((p) => [
258
- S(d.$slots, "description", Z(G(p)), void 0, !0)
257
+ description: $((l) => [
258
+ S(u.$slots, "description", Z(G(l)), void 0, !0)
259
259
  ]),
260
- actions: C((p) => [
261
- S(d.$slots, "actions", Z(G(p)), void 0, !0)
260
+ actions: $((l) => [
261
+ S(u.$slots, "actions", Z(G(l)), void 0, !0)
262
262
  ]),
263
263
  _: 2
264
264
  }, 1032, ["item", "removable", "downloadable", "clickable", "base-u-r-l", "get-file-url", "onClick", "onRemove", "onDownload"]))), 128))
265
265
  ])) : g("", !0);
266
266
  }
267
- }), ne = /* @__PURE__ */ Q(Ze, [["__scopeId", "data-v-ff76d134"]]), T = (c) => (q("data-v-c6f1253a"), c = c(), K(), c), Ge = { class: "wi-web-inputbox" }, Je = {
267
+ }), ne = /* @__PURE__ */ Q(Ze, [["__scopeId", "data-v-ff76d134"]]), T = (p) => (q("data-v-c6f1253a"), p = p(), K(), p), Ge = { class: "wi-web-inputbox" }, Je = {
268
268
  key: 0,
269
269
  class: "wi-web-inputbox__top-bar"
270
270
  }, et = {
271
271
  key: 0,
272
272
  class: "wi-web-inputbox__agent-bar"
273
- }, tt = { class: "wi-web-inputbox__agent-icon-wrapper" }, ot = ["src"], st = {
273
+ }, tt = { class: "wi-web-inputbox__agent-icon-wrapper" }, st = ["src"], ot = {
274
274
  key: 1,
275
275
  class: "wi-web-inputbox__agent-svg",
276
276
  viewBox: "0 0 24 24",
@@ -387,77 +387,77 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
387
387
  showIncPrevQuestion: { type: Boolean, default: !0 }
388
388
  },
389
389
  emits: ["update:modelValue", "submit", "stop", "selectAgent", "update:files", "update:attachments", "update:incPrevQuestion"],
390
- setup(c, { expose: U, emit: n }) {
391
- const i = c, h = n, b = x(null), f = x(null), a = x(!1), d = (e) => Ue(e), r = x([]), u = $(() => !!!(i.modelValue && i.modelValue.trim())), o = (e) => e ? i.getFileUrl ? i.getFileUrl(e) : Ce(e, i.baseURL, "/algorithm/get_file_data") : "", p = (e) => {
392
- h("selectAgent", e), a.value = !1;
393
- }, m = (e) => {
394
- h("update:incPrevQuestion", e ? "N" : "Y");
395
- }, _ = () => {
396
- h("update:modelValue", "");
397
- }, y = () => {
398
- f.value && (f.value.value = "", f.value.click());
390
+ setup(p, { expose: C, emit: i }) {
391
+ const r = p, _ = i, m = x(null), b = x(null), a = x(!1), u = (e) => Ue(e), d = x([]), h = k(() => !!!(r.modelValue && r.modelValue.trim())), o = (e) => e ? r.getFileUrl ? r.getFileUrl(e) : Ce(e, r.baseURL, "/algorithm/get_file_data") : "", l = (e) => {
392
+ _("selectAgent", e), a.value = !1;
393
+ }, U = (e) => {
394
+ _("update:incPrevQuestion", e ? "N" : "Y");
395
+ }, c = () => {
396
+ _("update:modelValue", "");
397
+ }, f = () => {
398
+ b.value && (b.value.value = "", b.value.click());
399
399
  }, B = (e) => {
400
400
  const w = e.target;
401
401
  if (w.files && w.files.length > 0) {
402
402
  const v = Array.from(w.files);
403
- for (const k of v)
404
- r.value.some((W) => {
405
- var se;
406
- const X = ((se = W.attachContent) == null ? void 0 : se.raw) || W.raw;
407
- return X && X.name === k.name && X.size === k.size && X.lastModified === k.lastModified;
408
- }) || r.value.push(d(k));
409
- const R = r.value.map((k) => {
403
+ for (const y of v)
404
+ d.value.some((W) => {
405
+ var ae;
406
+ const X = ((ae = W.attachContent) == null ? void 0 : ae.raw) || W.raw;
407
+ return X && X.name === y.name && X.size === y.size && X.lastModified === y.lastModified;
408
+ }) || d.value.push(u(y));
409
+ const R = d.value.map((y) => {
410
410
  var E;
411
- return ((E = k.attachContent) == null ? void 0 : E.raw) || k.raw;
411
+ return ((E = y.attachContent) == null ? void 0 : E.raw) || y.raw;
412
412
  }).filter(Boolean);
413
- h("update:files", R), h("update:attachments", [...r.value]);
413
+ _("update:files", R), _("update:attachments", [...d.value]);
414
414
  }
415
415
  }, M = (e) => {
416
- var k;
417
- const w = r.value.splice(e, 1)[0], v = ((k = w == null ? void 0 : w.attachContent) == null ? void 0 : k.url) || (w == null ? void 0 : w.url);
416
+ var y;
417
+ const w = d.value.splice(e, 1)[0], v = ((y = w == null ? void 0 : w.attachContent) == null ? void 0 : y.url) || (w == null ? void 0 : w.url);
418
418
  v && v.startsWith("blob:") && URL.revokeObjectURL(v);
419
- const R = r.value.map((E) => {
419
+ const R = d.value.map((E) => {
420
420
  var W;
421
421
  return ((W = E.attachContent) == null ? void 0 : W.raw) || E.raw;
422
422
  }).filter(Boolean);
423
- h("update:files", R), h("update:attachments", [...r.value]);
423
+ _("update:files", R), _("update:attachments", [...d.value]);
424
424
  }, N = () => {
425
- r.value.forEach((e) => {
425
+ d.value.forEach((e) => {
426
426
  var v;
427
427
  const w = ((v = e == null ? void 0 : e.attachContent) == null ? void 0 : v.url) || (e == null ? void 0 : e.url);
428
428
  w && w.startsWith("blob:") && URL.revokeObjectURL(w);
429
- }), r.value = [], h("update:files", []), h("update:attachments", []);
429
+ }), d.value = [], _("update:files", []), _("update:attachments", []);
430
430
  }, Y = () => {
431
- if (i.disabled || u.value)
431
+ if (r.disabled || h.value)
432
432
  return;
433
- const e = i.modelValue || "", w = r.value.map((R) => {
434
- var k;
435
- return ((k = R.attachContent) == null ? void 0 : k.raw) || R.raw;
436
- }).filter(Boolean), v = [...r.value];
437
- h("submit", { text: e, files: w, attachments: v, agent: i.currentAgent }), r.value = [], h("update:files", []), h("update:attachments", []);
433
+ const e = r.modelValue || "", w = d.value.map((R) => {
434
+ var y;
435
+ return ((y = R.attachContent) == null ? void 0 : y.raw) || R.raw;
436
+ }).filter(Boolean), v = [...d.value];
437
+ _("submit", { text: e, files: w, attachments: v, agent: r.currentAgent }), d.value = [], _("update:files", []), _("update:attachments", []);
438
438
  }, F = (e) => {
439
439
  e.isComposing || e.keyCode === 229 || (e.preventDefault(), Y());
440
440
  };
441
441
  return pe(() => {
442
442
  N();
443
- }), U({
443
+ }), C({
444
444
  /** 手动清空所有附件 */
445
445
  clearFiles: N,
446
446
  /** 获取当前附件原生 File 列表 */
447
- getFiles: () => r.value.map((e) => {
447
+ getFiles: () => d.value.map((e) => {
448
448
  var w;
449
449
  return ((w = e.attachContent) == null ? void 0 : w.raw) || e.raw;
450
450
  }).filter(Boolean),
451
451
  /** 获取当前附件标准化对象列表 */
452
- getAttachments: () => r.value,
452
+ getAttachments: () => d.value,
453
453
  /** 聚焦输入框 */
454
454
  focus: () => {
455
455
  var e;
456
- (e = b.value) == null || e.focus();
456
+ (e = m.value) == null || e.focus();
457
457
  }
458
- }), (e, w) => (s(), l("div", Ge, [
459
- e.showAgentBar || e.showIncPrevQuestion ? (s(), l("div", Je, [
460
- e.showAgentBar ? (s(), l("div", et, [
458
+ }), (e, w) => (s(), n("div", Ge, [
459
+ e.showAgentBar || e.showIncPrevQuestion ? (s(), n("div", Je, [
460
+ e.showAgentBar ? (s(), n("div", et, [
461
461
  L(I(be), {
462
462
  visible: a.value,
463
463
  "onUpdate:visible": w[0] || (w[0] = (v) => a.value = v),
@@ -466,21 +466,21 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
466
466
  trigger: "click",
467
467
  "popper-class": "wi-web-agent-popover"
468
468
  }, {
469
- reference: C(() => {
470
- var v, R, k;
469
+ reference: $(() => {
470
+ var v, R, y;
471
471
  return [
472
472
  t("div", {
473
473
  class: z(["wi-web-inputbox__agent-btn", { "is-disabled": e.disabled || e.talking }])
474
474
  }, [
475
475
  t("div", tt, [
476
- (v = e.currentAgent) != null && v.image_id && o(e.currentAgent.image_id) ? (s(), l("img", {
476
+ (v = e.currentAgent) != null && v.image_id && o(e.currentAgent.image_id) ? (s(), n("img", {
477
477
  key: 0,
478
478
  src: o(e.currentAgent.image_id),
479
479
  class: "wi-web-inputbox__agent-avatar"
480
- }, null, 8, ot)) : (s(), l("svg", st, nt))
480
+ }, null, 8, st)) : (s(), n("svg", ot, nt))
481
481
  ]),
482
- t("span", it, " @" + A(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((k = e.currentAgent) == null ? void 0 : k.entry_id) || e.defaultAgentTitle), 1),
483
- (s(), l("svg", {
482
+ t("span", it, " @" + A(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((y = e.currentAgent) == null ? void 0 : y.entry_id) || e.defaultAgentTitle), 1),
483
+ (s(), n("svg", {
484
484
  class: z(["wi-web-inputbox__agent-arrow", { "is-active": a.value }]),
485
485
  viewBox: "0 0 1024 1024",
486
486
  width: "12",
@@ -489,26 +489,26 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
489
489
  ], 2)
490
490
  ];
491
491
  }),
492
- default: C(() => [
492
+ default: $(() => [
493
493
  t("div", ct, [
494
494
  ut,
495
- !e.agentList || e.agentList.length === 0 ? (s(), l("div", pt, " 暂无可选智能体 ")) : g("", !0),
496
- (s(!0), l(P, null, j(e.agentList, (v) => {
497
- var R, k;
498
- return s(), l("div", {
495
+ !e.agentList || e.agentList.length === 0 ? (s(), n("div", pt, " 暂无可选智能体 ")) : g("", !0),
496
+ (s(!0), n(P, null, j(e.agentList, (v) => {
497
+ var R, y;
498
+ return s(), n("div", {
499
499
  key: v.entry_id,
500
500
  class: z(["wi-web-agent-item", { "is-active": v.entry_id === ((R = e.currentAgent) == null ? void 0 : R.entry_id) }]),
501
- onClick: (E) => p(v)
501
+ onClick: (E) => l(v)
502
502
  }, [
503
503
  t("div", _t, [
504
- v.image_id && o(v.image_id) ? (s(), l("img", {
504
+ v.image_id && o(v.image_id) ? (s(), n("img", {
505
505
  key: 0,
506
506
  src: o(v.image_id),
507
507
  class: "wi-web-agent-item__avatar"
508
- }, null, 8, vt)) : (s(), l("div", wt, bt)),
508
+ }, null, 8, vt)) : (s(), n("div", wt, bt)),
509
509
  t("span", ft, A(v.entry_title || v.entry_id), 1)
510
510
  ]),
511
- v.entry_id === ((k = e.currentAgent) == null ? void 0 : k.entry_id) ? (s(), l("span", gt, "✓")) : g("", !0)
511
+ v.entry_id === ((y = e.currentAgent) == null ? void 0 : y.entry_id) ? (s(), n("span", gt, "✓")) : g("", !0)
512
512
  ], 10, ht);
513
513
  }), 128))
514
514
  ])
@@ -516,13 +516,13 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
516
516
  _: 1
517
517
  }, 8, ["visible"])
518
518
  ])) : g("", !0),
519
- e.showIncPrevQuestion ? (s(), l("div", yt, [
519
+ e.showIncPrevQuestion ? (s(), n("div", yt, [
520
520
  L(I(fe), {
521
521
  class: "wi-web-inputbox__ignore-prev",
522
522
  "model-value": e.incPrevQuestion === "N",
523
- "onUpdate:modelValue": m
523
+ "onUpdate:modelValue": U
524
524
  }, {
525
- default: C(() => [
525
+ default: $(() => [
526
526
  O(" 忽略之前对话 ")
527
527
  ]),
528
528
  _: 1
@@ -530,9 +530,9 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
530
530
  ])) : g("", !0)
531
531
  ])) : g("", !0),
532
532
  t("div", kt, [
533
- r.value.length > 0 ? (s(), l("div", $t, [
533
+ d.value.length > 0 ? (s(), n("div", $t, [
534
534
  L(ne, {
535
- items: r.value,
535
+ items: d.value,
536
536
  "base-u-r-l": e.baseURL,
537
537
  "get-file-url": e.getFileUrl,
538
538
  removable: "",
@@ -541,7 +541,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
541
541
  ])) : g("", !0),
542
542
  L(I(ge), {
543
543
  ref_key: "textareaRef",
544
- ref: b,
544
+ ref: m,
545
545
  "model-value": e.modelValue,
546
546
  type: "textarea",
547
547
  resize: "none",
@@ -550,7 +550,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
550
550
  placeholder: e.placeholder,
551
551
  disabled: e.disabled || e.talking,
552
552
  class: "wi-web-inputbox__textarea",
553
- "onUpdate:modelValue": w[1] || (w[1] = (v) => h("update:modelValue", v)),
553
+ "onUpdate:modelValue": w[1] || (w[1] = (v) => _("update:modelValue", v)),
554
554
  onKeydown: he(te(F, ["exact"]), ["enter"])
555
555
  }, null, 8, ["model-value", "maxlength", "autosize", "placeholder", "disabled", "onKeydown"]),
556
556
  t("div", Ct, [
@@ -558,9 +558,9 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
558
558
  S(e.$slots, "footer-left", {}, void 0, !0)
559
559
  ]),
560
560
  t("div", At, [
561
- e.showWordLimit ? (s(), l("div", Bt, [
561
+ e.showWordLimit ? (s(), n("div", Bt, [
562
562
  O(A((e.modelValue || "").length), 1),
563
- e.maxlength ? (s(), l(P, { key: 0 }, [
563
+ e.maxlength ? (s(), n(P, { key: 0 }, [
564
564
  O("/" + A(e.maxlength), 1)
565
565
  ], 64)) : g("", !0)
566
566
  ])) : g("", !0),
@@ -569,11 +569,11 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
569
569
  content: "清除",
570
570
  placement: "top"
571
571
  }, {
572
- default: C(() => [
572
+ default: $(() => [
573
573
  t("button", {
574
574
  type: "button",
575
575
  class: "wi-web-inputbox__icon-btn",
576
- onClick: _
576
+ onClick: c
577
577
  }, Ft)
578
578
  ]),
579
579
  _: 1
@@ -583,19 +583,19 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
583
583
  content: "上传附件",
584
584
  placement: "top"
585
585
  }, {
586
- default: C(() => [
586
+ default: $(() => [
587
587
  t("button", {
588
588
  type: "button",
589
589
  class: "wi-web-inputbox__icon-btn",
590
590
  disabled: e.disabled || e.talking,
591
- onClick: y
591
+ onClick: f
592
592
  }, Vt, 8, Rt)
593
593
  ]),
594
594
  _: 1
595
595
  })) : g("", !0),
596
596
  t("input", {
597
597
  ref_key: "fileInputRef",
598
- ref: f,
598
+ ref: b,
599
599
  type: "file",
600
600
  multiple: "",
601
601
  accept: e.accept,
@@ -608,10 +608,10 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
608
608
  content: "停止生成",
609
609
  placement: "top"
610
610
  }, {
611
- default: C(() => [
611
+ default: $(() => [
612
612
  t("div", {
613
613
  class: "wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",
614
- onClick: w[2] || (w[2] = (v) => h("stop"))
614
+ onClick: w[2] || (w[2] = (v) => _("stop"))
615
615
  }, zt)
616
616
  ]),
617
617
  _: 1
@@ -620,9 +620,9 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
620
620
  content: "发送",
621
621
  placement: "top"
622
622
  }, {
623
- default: C(() => [
623
+ default: $(() => [
624
624
  t("div", {
625
- class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": e.disabled || !e.talking && u.value }]),
625
+ class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": e.disabled || !e.talking && h.value }]),
626
626
  onClick: Y
627
627
  }, Et, 2)
628
628
  ]),
@@ -634,8 +634,8 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
634
634
  ]));
635
635
  }
636
636
  }), Ot = /* @__PURE__ */ Q(xt, [["__scopeId", "data-v-c6f1253a"]]), Dt = [
637
- { id: "recordset", answerType: "recordset", component: _e(() => Promise.resolve().then(() => ho)) }
638
- ], Qt = (c) => re([...Dt, ...c ?? []]), Nt = (c) => (q("data-v-bcad9562"), c = c(), K(), c), jt = {
637
+ { id: "recordset", answerType: "recordset", component: _e(() => Promise.resolve().then(() => ps)) }
638
+ ], Qt = (p) => re([...Dt, ...p ?? []]), Nt = (p) => (q("data-v-c18f2f94"), p = p(), K(), p), jt = {
639
639
  key: 0,
640
640
  class: "wi-web-chat-messages__loading"
641
641
  }, Ht = {
@@ -660,81 +660,86 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
660
660
  emptyDescription: { default: "回答内容由共享渲染层统一分发" }
661
661
  },
662
662
  emits: ["loadOlder", "updateThinkingExpanded"],
663
- setup(c, { expose: U, emit: n }) {
664
- const i = c, h = n;
663
+ setup(p, { expose: C, emit: i }) {
664
+ const r = p, _ = i;
665
665
  de(
666
- i.outputFileConfig ?? {
667
- getFileUrl: (o) => {
668
- var p;
669
- return ((p = i.getFileUrl) == null ? void 0 : p.call(i, o)) ?? (i.baseURL ? `${i.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(o)}` : "");
666
+ r.outputFileConfig ?? {
667
+ getFileUrl: (l) => {
668
+ var U;
669
+ return ((U = r.getFileUrl) == null ? void 0 : U.call(r, l)) ?? (r.baseURL ? `${r.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(l)}` : "");
670
670
  }
671
671
  }
672
672
  );
673
- const b = x(), { showScrollToBottom: f, forceScrollToBottom: a, requestScrollToBottom: d, onReachTop: r } = Be(b), u = $(() => Qt(i.parsers));
674
- return le(
675
- () => i.messages[i.messages.length - 1],
673
+ const m = x(), { showScrollToBottom: b, forceScrollToBottom: a, requestScrollToBottom: u, resetScrollState: d, onReachTop: h } = Be(m), o = k(() => Qt(r.parsers));
674
+ return se(
675
+ () => r.messages.length === 0,
676
+ (l) => {
677
+ l && d();
678
+ }
679
+ ), se(
680
+ () => r.messages[r.messages.length - 1],
676
681
  () => {
677
- d();
682
+ u();
678
683
  },
679
684
  { deep: !0 }
680
- ), r(() => h("loadOlder")), U({
685
+ ), h(() => _("loadOlder")), C({
681
686
  /** 强制滚动到底部 */
682
687
  forceScrollToBottom: a,
683
688
  /** 自动滚动开启时请求滚动到底部 */
684
- requestScrollToBottom: d
685
- }), (o, p) => (s(), l("div", {
689
+ requestScrollToBottom: u
690
+ }), (l, U) => (s(), n("div", {
686
691
  ref_key: "scrollEl",
687
- ref: b,
692
+ ref: m,
688
693
  class: "wi-web-chat-messages"
689
694
  }, [
690
- o.loading ? (s(), l("div", jt, "历史加载中...")) : o.messages.length === 0 ? (s(), l("div", Ht, [
695
+ l.loading ? (s(), n("div", jt, "历史加载中...")) : l.messages.length === 0 ? (s(), n("div", Ht, [
691
696
  Wt,
692
- t("div", qt, A(o.emptyTitle), 1),
693
- t("div", Kt, A(o.emptyDescription), 1)
697
+ t("div", qt, A(l.emptyTitle), 1),
698
+ t("div", Kt, A(l.emptyDescription), 1)
694
699
  ])) : g("", !0),
695
- (s(!0), l(P, null, j(o.messages, (m) => (s(), l(P, {
696
- key: m.id
700
+ (s(!0), n(P, null, j(l.messages, (c) => (s(), n(P, {
701
+ key: c.id
697
702
  }, [
698
- m.role === "user" ? (s(), l("div", Yt, [
703
+ c.role === "user" ? (s(), n("div", Yt, [
699
704
  t("div", Xt, [
700
- m.attachments && m.attachments.length > 0 ? (s(), V(ne, {
705
+ c.attachments && c.attachments.length > 0 ? (s(), V(ne, {
701
706
  key: 0,
702
707
  class: "wi-web-chat-messages__attachments",
703
- items: m.attachments,
704
- "base-u-r-l": o.baseURL,
705
- "get-file-url": o.getFileUrl
708
+ items: c.attachments,
709
+ "base-u-r-l": l.baseURL,
710
+ "get-file-url": l.getFileUrl
706
711
  }, null, 8, ["items", "base-u-r-l", "get-file-url"])) : g("", !0),
707
- t("div", Zt, A(m.content), 1)
712
+ t("div", Zt, A(c.content), 1)
708
713
  ])
709
- ])) : (s(), l("div", Gt, [
714
+ ])) : (s(), n("div", Gt, [
710
715
  L(I(ce), {
711
- steps: m.thinking.steps,
712
- expanded: m.thinking.expanded,
713
- "onUpdate:expanded": (_) => h("updateThinkingExpanded", m, _)
716
+ steps: c.thinking.steps,
717
+ expanded: c.thinking.expanded,
718
+ "onUpdate:expanded": (f) => _("updateThinkingExpanded", c, f)
714
719
  }, null, 8, ["steps", "expanded", "onUpdate:expanded"]),
715
720
  L(I(ue), {
716
- answer: m.answer,
717
- error: m.error,
718
- stopped: m.stopped,
719
- "content-map": u.value
721
+ answer: c.answer,
722
+ error: c.error,
723
+ stopped: c.stopped,
724
+ "content-map": o.value
720
725
  }, null, 8, ["answer", "error", "stopped", "content-map"])
721
726
  ]))
722
727
  ], 64))), 128)),
723
728
  L(ve, { name: "wi-web-chat-messages-fade" }, {
724
- default: C(() => [
725
- I(f) ? (s(), l("button", {
729
+ default: $(() => [
730
+ I(b) ? (s(), n("button", {
726
731
  key: 0,
727
732
  type: "button",
728
733
  class: "wi-web-chat-messages__bottom",
729
- onClick: p[0] || (p[0] = //@ts-ignore
730
- (...m) => I(a) && I(a)(...m))
734
+ onClick: U[0] || (U[0] = //@ts-ignore
735
+ (...c) => I(a) && I(a)(...c))
731
736
  }, " 回到底部 ")) : g("", !0)
732
737
  ]),
733
738
  _: 1
734
739
  })
735
740
  ], 512));
736
741
  }
737
- }), eo = /* @__PURE__ */ Q(Jt, [["__scopeId", "data-v-bcad9562"]]), to = { class: "wi-web-chat-container" }, oo = { class: "wi-web-chat-container__footer" }, so = /* @__PURE__ */ D({
742
+ }), es = /* @__PURE__ */ Q(Jt, [["__scopeId", "data-v-c18f2f94"]]), ts = { class: "wi-web-chat-container" }, ss = { class: "wi-web-chat-container__footer" }, os = /* @__PURE__ */ D({
738
743
  __name: "ChatContainer",
739
744
  props: {
740
745
  messages: {},
@@ -756,17 +761,17 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
756
761
  disabled: { type: Boolean, default: !1 }
757
762
  },
758
763
  emits: ["update:question", "update:incPrevQuestion", "submit", "stop", "selectAgent", "loadOlder", "updateThinkingExpanded"],
759
- setup(c, { emit: U }) {
760
- const n = c, i = U, h = (a) => {
761
- i("submit", a);
762
- }, b = () => {
763
- n.hasMore && i("loadOlder");
764
- }, f = (a) => {
765
- i("selectAgent", a);
764
+ setup(p, { emit: C }) {
765
+ const i = p, r = C, _ = (a) => {
766
+ r("submit", a);
767
+ }, m = () => {
768
+ i.hasMore && r("loadOlder");
769
+ }, b = (a) => {
770
+ r("selectAgent", a);
766
771
  };
767
- return (a, d) => (s(), l("section", to, [
772
+ return (a, u) => (s(), n("section", ts, [
768
773
  S(a.$slots, "messages", {}, () => [
769
- L(eo, {
774
+ L(es, {
770
775
  messages: a.messages,
771
776
  parsers: a.parsers,
772
777
  "base-u-r-l": a.baseURL,
@@ -775,17 +780,17 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
775
780
  loading: a.loading,
776
781
  "empty-title": a.emptyTitle,
777
782
  "empty-description": a.emptyDescription,
778
- onLoadOlder: b,
779
- onUpdateThinkingExpanded: d[0] || (d[0] = (r, u) => i("updateThinkingExpanded", r, u))
783
+ onLoadOlder: m,
784
+ onUpdateThinkingExpanded: u[0] || (u[0] = (d, h) => r("updateThinkingExpanded", d, h))
780
785
  }, null, 8, ["messages", "parsers", "base-u-r-l", "get-file-url", "output-file-config", "loading", "empty-title", "empty-description"])
781
786
  ], !0),
782
787
  S(a.$slots, "above-input", {}, void 0, !0),
783
- t("footer", oo, [
788
+ t("footer", ss, [
784
789
  L(Ot, {
785
790
  "model-value": a.question,
786
- "onUpdate:modelValue": d[1] || (d[1] = (r) => i("update:question", r)),
791
+ "onUpdate:modelValue": u[1] || (u[1] = (d) => r("update:question", d)),
787
792
  "inc-prev-question": a.incPrevQuestion,
788
- "onUpdate:incPrevQuestion": d[2] || (d[2] = (r) => i("update:incPrevQuestion", r)),
793
+ "onUpdate:incPrevQuestion": u[2] || (u[2] = (d) => r("update:incPrevQuestion", d)),
789
794
  "base-u-r-l": a.baseURL,
790
795
  disabled: a.disabled || !a.session,
791
796
  talking: a.talking,
@@ -793,17 +798,17 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
793
798
  "current-agent": a.currentAgent,
794
799
  placeholder: a.placeholder,
795
800
  "get-file-url": a.getFileUrl,
796
- onSelectAgent: f,
797
- onSubmit: h,
798
- onStop: d[3] || (d[3] = (r) => i("stop"))
801
+ onSelectAgent: b,
802
+ onSubmit: _,
803
+ onStop: u[3] || (u[3] = (d) => r("stop"))
799
804
  }, null, 8, ["model-value", "inc-prev-question", "base-u-r-l", "disabled", "talking", "agent-list", "current-agent", "placeholder", "get-file-url"])
800
805
  ])
801
806
  ]));
802
807
  }
803
- }), Mo = /* @__PURE__ */ Q(so, [["__scopeId", "data-v-8663b501"]]), ie = (c) => (q("data-v-96941d57"), c = c(), K(), c), ao = {
808
+ }), Ts = /* @__PURE__ */ Q(os, [["__scopeId", "data-v-8663b501"]]), ie = (p) => (q("data-v-96941d57"), p = p(), K(), p), as = {
804
809
  key: 0,
805
810
  class: "wi-web-recordset"
806
- }, lo = { class: "wi-web-recordset__header" }, no = { class: "wi-web-recordset__title" }, io = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("button", {
811
+ }, ls = { class: "wi-web-recordset__header" }, ns = { class: "wi-web-recordset__title" }, is = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("button", {
807
812
  type: "button",
808
813
  class: "wi-web-recordset__columns-btn",
809
814
  title: "选择展示列"
@@ -825,66 +830,66 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
825
830
  /* @__PURE__ */ t("path", { d: "M9 4v16M15 4v16" })
826
831
  ]),
827
832
  /* @__PURE__ */ t("span", null, "列")
828
- ], -1)), ro = { class: "wi-web-recordset__columns-panel" }, co = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("div", { class: "wi-web-recordset__columns-panel-title" }, "选择展示列", -1)), uo = /* @__PURE__ */ D({
833
+ ], -1)), rs = { class: "wi-web-recordset__columns-panel" }, ds = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("div", { class: "wi-web-recordset__columns-panel-title" }, "选择展示列", -1)), cs = /* @__PURE__ */ D({
829
834
  __name: "RecordsetTable",
830
835
  props: {
831
836
  report: {},
832
837
  maxHeight: { default: 420 }
833
838
  },
834
- setup(c) {
835
- const U = c, n = $(() => {
836
- var _;
837
- return ((_ = U.report) == null ? void 0 : _.values) ?? {};
838
- }), i = $(() => n.value.chart === "table"), h = $(() => n.value.title ?? ""), b = $(() => (Array.isArray(n.value.cols) ? n.value.cols : []).map((y, B) => ({
839
+ setup(p) {
840
+ const C = p, i = k(() => {
841
+ var c;
842
+ return ((c = C.report) == null ? void 0 : c.values) ?? {};
843
+ }), r = k(() => i.value.chart === "table"), _ = k(() => i.value.title ?? ""), m = k(() => (Array.isArray(i.value.cols) ? i.value.cols : []).map((f, B) => ({
839
844
  key: `c${B}`,
840
- title: (y == null ? void 0 : y.title) || (y == null ? void 0 : y.name) || `列${B + 1}`
841
- }))), f = $(() => {
842
- const _ = Number(n.value.max_cols);
843
- return Number.isFinite(_) && _ > 0 ? _ : 1 / 0;
844
- }), a = $(() => b.value.length > f.value), d = x([]), r = $(() => new Set(d.value)), u = $(() => b.value.filter((_) => r.value.has(_.key)));
845
- le(
846
- () => b.value.map((_) => _.key).join("|"),
845
+ title: (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || `列${B + 1}`
846
+ }))), b = k(() => {
847
+ const c = Number(i.value.max_cols);
848
+ return Number.isFinite(c) && c > 0 ? c : 1 / 0;
849
+ }), a = k(() => m.value.length > b.value), u = x([]), d = k(() => new Set(u.value)), h = k(() => m.value.filter((c) => d.value.has(c.key)));
850
+ se(
851
+ () => m.value.map((c) => c.key).join("|"),
847
852
  () => {
848
- d.value = b.value.slice(0, f.value).map((_) => _.key);
853
+ u.value = m.value.slice(0, b.value).map((c) => c.key);
849
854
  },
850
855
  { immediate: !0 }
851
856
  );
852
- const o = $(() => (Array.isArray(n.value.values) ? n.value.values : []).map((y) => {
857
+ const o = k(() => (Array.isArray(i.value.values) ? i.value.values : []).map((f) => {
853
858
  const B = {};
854
- return b.value.forEach((M, N) => {
855
- B[M.key] = Array.isArray(y) ? y[N] : void 0;
859
+ return m.value.forEach((M, N) => {
860
+ B[M.key] = Array.isArray(f) ? f[N] : void 0;
856
861
  }), B;
857
- })), p = x(!1), m = (_, y) => {
858
- const B = new Set(d.value);
859
- y ? B.add(_) : B.delete(_), d.value = b.value.filter((M) => B.has(M.key)).map((M) => M.key);
862
+ })), l = x(!1), U = (c, f) => {
863
+ const B = new Set(u.value);
864
+ f ? B.add(c) : B.delete(c), u.value = m.value.filter((M) => B.has(M.key)).map((M) => M.key);
860
865
  };
861
- return (_, y) => {
866
+ return (c, f) => {
862
867
  const B = J("el-checkbox"), M = J("el-popover"), N = J("el-table-column"), Y = J("el-table");
863
- return i.value ? (s(), l("div", ao, [
864
- t("div", lo, [
865
- t("div", no, A(h.value), 1),
868
+ return r.value ? (s(), n("div", as, [
869
+ t("div", ls, [
870
+ t("div", ns, A(_.value), 1),
866
871
  a.value ? (s(), V(M, {
867
872
  key: 0,
868
- visible: p.value,
869
- "onUpdate:visible": y[0] || (y[0] = (F) => p.value = F),
873
+ visible: l.value,
874
+ "onUpdate:visible": f[0] || (f[0] = (F) => l.value = F),
870
875
  placement: "bottom-end",
871
876
  width: 220,
872
877
  trigger: "click",
873
878
  "popper-class": "wi-web-recordset-columns-popper"
874
879
  }, {
875
- reference: C(() => [
876
- io
880
+ reference: $(() => [
881
+ is
877
882
  ]),
878
- default: C(() => [
879
- t("div", ro, [
880
- co,
881
- (s(!0), l(P, null, j(b.value, (F) => (s(), V(B, {
883
+ default: $(() => [
884
+ t("div", rs, [
885
+ ds,
886
+ (s(!0), n(P, null, j(m.value, (F) => (s(), V(B, {
882
887
  key: F.key,
883
888
  class: "wi-web-recordset__column-item",
884
- "model-value": r.value.has(F.key),
885
- "onUpdate:modelValue": (e) => m(F.key, !!e)
889
+ "model-value": d.value.has(F.key),
890
+ "onUpdate:modelValue": (e) => U(F.key, !!e)
886
891
  }, {
887
- default: C(() => [
892
+ default: $(() => [
888
893
  O(A(F.title), 1)
889
894
  ]),
890
895
  _: 2
@@ -899,10 +904,10 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
899
904
  border: "",
900
905
  size: "small",
901
906
  class: "wi-web-recordset__table",
902
- "max-height": _.maxHeight
907
+ "max-height": c.maxHeight
903
908
  }, {
904
- default: C(() => [
905
- (s(!0), l(P, null, j(u.value, (F) => (s(), V(N, {
909
+ default: $(() => [
910
+ (s(!0), n(P, null, j(h.value, (F) => (s(), V(N, {
906
911
  key: F.key,
907
912
  prop: F.key,
908
913
  label: F.title,
@@ -915,10 +920,10 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
915
920
  ])) : g("", !0);
916
921
  };
917
922
  }
918
- }), po = /* @__PURE__ */ Q(uo, [["__scopeId", "data-v-96941d57"]]), ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
923
+ }), us = /* @__PURE__ */ Q(cs, [["__scopeId", "data-v-96941d57"]]), ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
919
924
  __proto__: null,
920
- default: po
921
- }, Symbol.toStringTag, { value: "Module" })), oe = (c) => (q("data-v-94659445"), c = c(), K(), c), _o = { class: "wi-web-env-switch__track" }, vo = { class: "wi-web-env-switch__items" }, wo = ["disabled", "onClick"], mo = { class: "wi-web-env-switch__icon" }, bo = {
925
+ default: us
926
+ }, Symbol.toStringTag, { value: "Module" })), oe = (p) => (q("data-v-94659445"), p = p(), K(), p), hs = { class: "wi-web-env-switch__track" }, _s = { class: "wi-web-env-switch__items" }, vs = ["disabled", "onClick"], ws = { class: "wi-web-env-switch__icon" }, ms = {
922
927
  key: 0,
923
928
  viewBox: "0 0 24 24",
924
929
  fill: "none",
@@ -926,32 +931,32 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
926
931
  "stroke-width": "1.8",
927
932
  "stroke-linecap": "round",
928
933
  "stroke-linejoin": "round"
929
- }, fo = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z" }, null, -1)), go = [
930
- fo
931
- ], yo = {
934
+ }, bs = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z" }, null, -1)), fs = [
935
+ bs
936
+ ], gs = {
932
937
  key: 1,
933
938
  viewBox: "0 0 24 24",
934
939
  fill: "none",
935
940
  stroke: "currentColor",
936
941
  "stroke-width": "1.8",
937
942
  "stroke-linecap": "round"
938
- }, ko = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("rect", {
943
+ }, ys = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("rect", {
939
944
  x: "2.5",
940
945
  y: "4",
941
946
  width: "19",
942
947
  height: "12",
943
948
  rx: "2",
944
949
  "stroke-linejoin": "round"
945
- }, null, -1)), $o = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M8.5 20h7M12 16v4" }, null, -1)), Co = [
946
- ko,
947
- $o
948
- ], Uo = { class: "wi-web-env-switch__label" }, Ao = {
950
+ }, null, -1)), ks = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M8.5 20h7M12 16v4" }, null, -1)), $s = [
951
+ ys,
952
+ ks
953
+ ], Cs = { class: "wi-web-env-switch__label" }, Us = {
949
954
  key: 0,
950
955
  class: "wi-web-env-switch__hint"
951
- }, Bo = { class: "wi-web-env-switch__hint-text" }, Io = {
956
+ }, As = { class: "wi-web-env-switch__hint-text" }, Bs = {
952
957
  key: 0,
953
958
  class: "wi-web-env-switch__hint-status"
954
- }, Fo = /* @__PURE__ */ D({
959
+ }, Is = /* @__PURE__ */ D({
955
960
  __name: "EnvSwitch",
956
961
  props: {
957
962
  modelValue: { default: "local" },
@@ -961,8 +966,8 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
961
966
  showHint: { type: Boolean, default: !0 }
962
967
  },
963
968
  emits: ["update:modelValue", "change"],
964
- setup(c, { emit: U }) {
965
- const n = c, i = U, h = [
969
+ setup(p, { emit: C }) {
970
+ const i = p, r = C, _ = [
966
971
  {
967
972
  value: "local",
968
973
  label: "本地电脑",
@@ -977,49 +982,49 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
977
982
  status: "未连接",
978
983
  online: !1
979
984
  }
980
- ], b = { default: 3, small: 2 }, f = $(() => {
981
- const u = n.options ?? [];
982
- return u.length > 0 ? u : h;
983
- }), a = $(() => {
984
- if (!n.showHint)
985
+ ], m = { default: 3, small: 2 }, b = k(() => {
986
+ const h = i.options ?? [];
987
+ return h.length > 0 ? h : _;
988
+ }), a = k(() => {
989
+ if (!i.showHint)
985
990
  return null;
986
- const u = f.value;
987
- return u.find((o) => o.value === n.modelValue) ?? u[0] ?? null;
988
- }), d = $(() => {
989
- const u = f.value, o = u.length || 1, p = Math.max(u.findIndex((_) => _.value === n.modelValue), 0), m = b[n.size] ?? b.default;
991
+ const h = b.value;
992
+ return h.find((o) => o.value === i.modelValue) ?? h[0] ?? null;
993
+ }), u = k(() => {
994
+ const h = b.value, o = h.length || 1, l = Math.max(h.findIndex((c) => c.value === i.modelValue), 0), U = m[i.size] ?? m.default;
990
995
  return {
991
- width: `calc(${100 / o}% - ${2 * m / o}px)`,
992
- transform: `translateX(${p * 100}%)`
996
+ width: `calc(${100 / o}% - ${2 * U / o}px)`,
997
+ transform: `translateX(${l * 100}%)`
993
998
  };
994
- }), r = (u) => {
995
- n.disabled || u.disabled || u.value !== n.modelValue && (i("update:modelValue", u.value), i("change", u));
999
+ }), d = (h) => {
1000
+ i.disabled || h.disabled || h.value !== i.modelValue && (r("update:modelValue", h.value), r("change", h));
996
1001
  };
997
- return (u, o) => (s(), l("div", {
998
- class: z(["wi-web-env-switch", [`is-${u.size}`, { "is-disabled": u.disabled }]])
1002
+ return (h, o) => (s(), n("div", {
1003
+ class: z(["wi-web-env-switch", [`is-${h.size}`, { "is-disabled": h.disabled }]])
999
1004
  }, [
1000
- t("div", _o, [
1005
+ t("div", hs, [
1001
1006
  t("span", {
1002
1007
  class: "wi-web-env-switch__thumb",
1003
- style: we(d.value)
1008
+ style: we(u.value)
1004
1009
  }, null, 4),
1005
- t("div", vo, [
1006
- (s(!0), l(P, null, j(f.value, (p) => (s(), l("button", {
1007
- key: p.value,
1010
+ t("div", _s, [
1011
+ (s(!0), n(P, null, j(b.value, (l) => (s(), n("button", {
1012
+ key: l.value,
1008
1013
  type: "button",
1009
- class: z(["wi-web-env-switch__item", { "is-active": p.value === u.modelValue, "is-disabled": p.disabled }]),
1010
- disabled: u.disabled || p.disabled,
1011
- onClick: (m) => r(p)
1014
+ class: z(["wi-web-env-switch__item", { "is-active": l.value === h.modelValue, "is-disabled": l.disabled }]),
1015
+ disabled: h.disabled || l.disabled,
1016
+ onClick: (U) => d(l)
1012
1017
  }, [
1013
- t("span", mo, [
1014
- p.value === "cloud" ? (s(), l("svg", bo, go)) : (s(), l("svg", yo, Co))
1018
+ t("span", ws, [
1019
+ l.value === "cloud" ? (s(), n("svg", ms, fs)) : (s(), n("svg", gs, $s))
1015
1020
  ]),
1016
- t("span", Uo, A(p.label), 1)
1017
- ], 10, wo))), 128))
1021
+ t("span", Cs, A(l.label), 1)
1022
+ ], 10, vs))), 128))
1018
1023
  ])
1019
1024
  ]),
1020
- a.value ? (s(), l("div", Ao, [
1021
- t("span", Bo, A(a.value.description), 1),
1022
- a.value.status ? (s(), l("span", Io, [
1025
+ a.value ? (s(), n("div", Us, [
1026
+ t("span", As, A(a.value.description), 1),
1027
+ a.value.status ? (s(), n("span", Bs, [
1023
1028
  t("i", {
1024
1029
  class: z(["wi-web-env-switch__dot", { "is-online": a.value.online }])
1025
1030
  }, null, 2),
@@ -1028,27 +1033,28 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
1028
1033
  ])) : g("", !0)
1029
1034
  ], 2));
1030
1035
  }
1031
- }), zo = /* @__PURE__ */ Q(Fo, [["__scopeId", "data-v-94659445"]]);
1036
+ }), Ms = /* @__PURE__ */ Q(Is, [["__scopeId", "data-v-94659445"]]);
1032
1037
  export {
1033
- xo as AiAnswerBubble,
1038
+ Es as AgentActionStatus,
1039
+ xs as AiAnswerBubble,
1034
1040
  Ye as AttachmentCard,
1035
1041
  ne as AttachmentList,
1036
- Mo as ChatContainer,
1037
- eo as ChatMessagesView,
1038
- Oo as ClarificationCard,
1039
- Do as DeepThinkingSteps,
1040
- zo as EnvSwitch,
1041
- Qo as IframePage,
1042
+ Ts as ChatContainer,
1043
+ es as ChatMessagesView,
1044
+ Os as ClarificationCard,
1045
+ Ds as DeepThinkingSteps,
1046
+ Ms as EnvSwitch,
1047
+ Qs as IframePage,
1042
1048
  Ot as Inputbox,
1043
- No as KnowledgeStreamResult,
1044
- jo as OutputFile,
1045
- po as RecordsetTable,
1046
- Ho as createAnswerContentMap,
1049
+ Ns as KnowledgeStreamResult,
1050
+ js as OutputFile,
1051
+ us as RecordsetTable,
1052
+ Hs as createAnswerContentMap,
1047
1053
  Qt as createWebAnswerContentMap,
1048
- Wo as injectIframeResizerChild,
1049
- qo as provideIframePageConfig,
1050
- Ko as provideOutputFileConfig,
1051
- Yo as resolveIframePlaceholders,
1052
- Xo as useIframePage
1054
+ Ws as injectIframeResizerChild,
1055
+ qs as provideIframePageConfig,
1056
+ Ks as provideOutputFileConfig,
1057
+ Ys as resolveIframePlaceholders,
1058
+ Xs as useIframePage
1053
1059
  };
1054
1060
  //# sourceMappingURL=index.js.map