@blueking/ai-blueking 2.2.1-beta.5 → 2.2.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/index.es.min.js +297 -288
- package/dist/standalone/index.iife.min.js +2 -2
- package/dist/standalone/index.umd.min.js +2 -2
- package/dist/vue2/index.es.min.js +2622 -2613
- package/dist/vue2/index.iife.min.js +238 -238
- package/dist/vue2/index.umd.min.js +258 -258
- package/dist/vue3/index.es.min.js +209 -200
- package/dist/vue3/index.iife.min.js +282 -282
- package/dist/vue3/index.umd.min.js +3 -3
- package/package.json +3 -3
|
@@ -56844,21 +56844,30 @@ var $2 = (e) => {
|
|
|
56844
56844
|
payload: r
|
|
56845
56845
|
}, i)
|
|
56846
56846
|
}), n4 = "upload_file", r4 = 20, i4 = (e) => {
|
|
56847
|
+
if (Array.isArray(e)) return {
|
|
56848
|
+
page: 1,
|
|
56849
|
+
numPages: 1,
|
|
56850
|
+
count: e.length,
|
|
56851
|
+
results: e.map(b2)
|
|
56852
|
+
};
|
|
56853
|
+
let t = Array.isArray(e?.results) ? e.results : [];
|
|
56854
|
+
return {
|
|
56855
|
+
page: e?.page ?? 1,
|
|
56856
|
+
numPages: e?.num_pages ?? 1,
|
|
56857
|
+
count: e?.count ?? t.length,
|
|
56858
|
+
results: t.map(b2)
|
|
56859
|
+
};
|
|
56860
|
+
}, a4 = (e) => {
|
|
56847
56861
|
let t = e.split(".").pop();
|
|
56848
56862
|
if (!t || t === e) return "";
|
|
56849
56863
|
let n = t.replace(/[^A-Za-z0-9]/g, "").slice(0, 20).toLowerCase();
|
|
56850
56864
|
return n ? `.${n}` : "";
|
|
56851
|
-
},
|
|
56865
|
+
}, o4 = (e) => `${n4}_${`${Date.now()}_${Math.random().toString(36).slice(2, 8)}`}${a4(e.name)}`, s4 = (e) => `attachment; filename="${e}"`, c4 = (e) => ({
|
|
56852
56866
|
clearSession: (t, n) => e.post(`chat_completion/${t}/clear/`, void 0, n),
|
|
56853
56867
|
getSessions: (t, n) => e.get("session/", {
|
|
56854
56868
|
page: t?.page ?? 1,
|
|
56855
56869
|
page_size: t?.page_size ?? r4
|
|
56856
|
-
}, n).then(
|
|
56857
|
-
page: e.page,
|
|
56858
|
-
numPages: e.num_pages,
|
|
56859
|
-
count: e.count,
|
|
56860
|
-
results: e.results.map(b2)
|
|
56861
|
-
})),
|
|
56870
|
+
}, n).then(i4),
|
|
56862
56871
|
plusSession: (t, n) => e.post("session/", x2(t), n).then((e) => b2(e)),
|
|
56863
56872
|
modifySession: (t, n) => e.put(`session/${t.sessionCode}/`, x2(t), n).then((e) => b2(e)),
|
|
56864
56873
|
deleteSession: (t, n) => e.delete(`session/${t}/`, void 0, n),
|
|
@@ -56868,29 +56877,29 @@ var $2 = (e) => {
|
|
|
56868
56877
|
getSessionFeedbackReasons: (t, n) => e.get("session_feedback/reasons/", { rate: t }, n),
|
|
56869
56878
|
renameSession: (t, n) => e.post(`session/${t}/ai_rename/`, void 0, n).then((e) => b2(e)),
|
|
56870
56879
|
uploadFile: (t, n, r) => {
|
|
56871
|
-
let i =
|
|
56880
|
+
let i = o4(n), a = encodeURIComponent(i), o = V2(r?.headers) ?? {};
|
|
56872
56881
|
return n.arrayBuffer().then((n) => e.post(`session/${t}/upload/${a}/`, n, {
|
|
56873
56882
|
...r,
|
|
56874
56883
|
headers: {
|
|
56875
56884
|
...o,
|
|
56876
|
-
"Content-Disposition":
|
|
56885
|
+
"Content-Disposition": s4(i)
|
|
56877
56886
|
}
|
|
56878
56887
|
}));
|
|
56879
56888
|
},
|
|
56880
56889
|
isResumeSession: (t, n) => e.get(`session/${t}/is_resume/`, void 0, n)
|
|
56881
|
-
}),
|
|
56890
|
+
}), l4 = (e) => ({
|
|
56882
56891
|
agent: e4(e),
|
|
56883
|
-
session:
|
|
56892
|
+
session: c4(e),
|
|
56884
56893
|
message: t4(e),
|
|
56885
56894
|
fetchClient: e
|
|
56886
|
-
}),
|
|
56895
|
+
}), u4 = (e) => {
|
|
56887
56896
|
let { fetchClient: t, reset: n } = $2(e);
|
|
56888
56897
|
return {
|
|
56889
|
-
...
|
|
56898
|
+
...l4(t),
|
|
56890
56899
|
reset: n,
|
|
56891
56900
|
onError: t.onError.bind(t)
|
|
56892
56901
|
};
|
|
56893
|
-
},
|
|
56902
|
+
}, d4 = () => ({
|
|
56894
56903
|
agent: null,
|
|
56895
56904
|
http: null,
|
|
56896
56905
|
message: null,
|
|
@@ -56907,7 +56916,7 @@ var $2 = (e) => {
|
|
|
56907
56916
|
registerSession(e) {
|
|
56908
56917
|
this.session = e;
|
|
56909
56918
|
}
|
|
56910
|
-
}),
|
|
56919
|
+
}), f4 = 20, p4 = (e) => {
|
|
56911
56920
|
let t = /* @__PURE__ */ R([]), n = /* @__PURE__ */ R(null), r = /* @__PURE__ */ R(0), i = /* @__PURE__ */ R(0), a = /* @__PURE__ */ R(0), o = /* @__PURE__ */ R(!1), s = /* @__PURE__ */ R(!1), c = /* @__PURE__ */ R(!1), l = /* @__PURE__ */ R(!1), u = /* @__PURE__ */ R(!1), d = /* @__PURE__ */ R(!1), f = /* @__PURE__ */ R(!1), p = /* @__PURE__ */ R(!1), m = Y(() => r.value > 0 && r.value < i.value), h = (e) => {
|
|
56912
56921
|
t.value = t.value.map((t) => t.sessionCode === e.sessionCode ? {
|
|
56913
56922
|
...t,
|
|
@@ -56917,14 +56926,14 @@ var $2 = (e) => {
|
|
|
56917
56926
|
s.value = !0;
|
|
56918
56927
|
let o = {
|
|
56919
56928
|
page: n?.page ?? 1,
|
|
56920
|
-
page_size: n?.page_size ??
|
|
56929
|
+
page_size: n?.page_size ?? f4
|
|
56921
56930
|
};
|
|
56922
56931
|
return e.http?.session.getSessions(o).then((e) => {
|
|
56923
56932
|
t.value = e.results, r.value = e.page, i.value = e.numPages, a.value = e.count;
|
|
56924
56933
|
}).finally(() => {
|
|
56925
56934
|
s.value = !1;
|
|
56926
56935
|
});
|
|
56927
|
-
}, _ = async (n =
|
|
56936
|
+
}, _ = async (n = f4) => {
|
|
56928
56937
|
if (!(!m.value || s.value || c.value)) {
|
|
56929
56938
|
c.value = !0;
|
|
56930
56939
|
try {
|
|
@@ -57017,8 +57026,8 @@ var $2 = (e) => {
|
|
|
57017
57026
|
t.value = [], n.value = null, r.value = 0, i.value = 0, a.value = 0, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1;
|
|
57018
57027
|
}
|
|
57019
57028
|
};
|
|
57020
|
-
},
|
|
57021
|
-
let t =
|
|
57029
|
+
}, m4 = (e) => {
|
|
57030
|
+
let t = d4(), n = u4(e), r = z2(t, e.protocol), i = T2(t), a = p4(t);
|
|
57022
57031
|
return t.registerHttp(n), t.registerMessage(i), t.registerAgent(r), t.registerSession(a), {
|
|
57023
57032
|
agent: r,
|
|
57024
57033
|
session: a,
|
|
@@ -57029,23 +57038,23 @@ var $2 = (e) => {
|
|
|
57029
57038
|
},
|
|
57030
57039
|
onError: n.onError
|
|
57031
57040
|
};
|
|
57032
|
-
},
|
|
57041
|
+
}, h4 = new Set([
|
|
57033
57042
|
"context_type",
|
|
57034
57043
|
"__label",
|
|
57035
57044
|
"__key",
|
|
57036
57045
|
"__value"
|
|
57037
57046
|
]);
|
|
57038
|
-
function
|
|
57047
|
+
function g4(e, t) {
|
|
57039
57048
|
return {
|
|
57040
57049
|
urlPrefix: e,
|
|
57041
57050
|
headers: () => V2(en(t)?.headers),
|
|
57042
57051
|
data: () => V2(en(t)?.data)
|
|
57043
57052
|
};
|
|
57044
57053
|
}
|
|
57045
|
-
function
|
|
57054
|
+
function _4(e) {
|
|
57046
57055
|
return e ? Array.isArray(e) ? e.map((e) => {
|
|
57047
57056
|
if (e.__key) return e;
|
|
57048
|
-
let t = Object.entries(e).filter(([e]) => !
|
|
57057
|
+
let t = Object.entries(e).filter(([e]) => !h4.has(e));
|
|
57049
57058
|
if (t.length === 0) return e;
|
|
57050
57059
|
let [n, r] = t[0];
|
|
57051
57060
|
return {
|
|
@@ -57064,14 +57073,14 @@ function g4(e) {
|
|
|
57064
57073
|
__value: t
|
|
57065
57074
|
})) : [];
|
|
57066
57075
|
}
|
|
57067
|
-
function
|
|
57076
|
+
function v4(e, t) {
|
|
57068
57077
|
if (!t) return e;
|
|
57069
57078
|
let n = t()?.context;
|
|
57070
57079
|
if (!n) return e;
|
|
57071
|
-
let r =
|
|
57072
|
-
return r.length === 0 ? e :
|
|
57080
|
+
let r = _4(n);
|
|
57081
|
+
return r.length === 0 ? e : y4(e, r);
|
|
57073
57082
|
}
|
|
57074
|
-
function
|
|
57083
|
+
function y4(e, t) {
|
|
57075
57084
|
if (t.length === 0) return e ?? {};
|
|
57076
57085
|
let n = e ?? {}, r = n.extra ?? {}, i = r.context ?? [], a = new Set(t.map((e) => e.__key).filter(Boolean)), o = i.filter((e) => {
|
|
57077
57086
|
let t = e.__key;
|
|
@@ -57087,25 +57096,25 @@ function v4(e, t) {
|
|
|
57087
57096
|
}
|
|
57088
57097
|
//#endregion
|
|
57089
57098
|
//#region src/utils/message-utils.ts
|
|
57090
|
-
function
|
|
57099
|
+
function b4(e) {
|
|
57091
57100
|
return e.some((e) => {
|
|
57092
57101
|
if (!("property" in e)) return !0;
|
|
57093
57102
|
let { property: t } = e;
|
|
57094
57103
|
return !t?.extra?.pause;
|
|
57095
57104
|
});
|
|
57096
57105
|
}
|
|
57097
|
-
function
|
|
57106
|
+
function x4(e, t) {
|
|
57098
57107
|
let n = null;
|
|
57099
57108
|
for (let r of e) if (r.role === "user" && r.id !== void 0 && (n = r), r === t) break;
|
|
57100
57109
|
return n;
|
|
57101
57110
|
}
|
|
57102
|
-
function
|
|
57103
|
-
let n =
|
|
57111
|
+
function S4(e, t) {
|
|
57112
|
+
let n = x4(e, t);
|
|
57104
57113
|
if (n?.id !== void 0) return typeof n.id == "number" ? n.id : Number(n.id);
|
|
57105
57114
|
}
|
|
57106
57115
|
//#endregion
|
|
57107
57116
|
//#region src/utils/parse-custom-blocks.ts
|
|
57108
|
-
function
|
|
57117
|
+
function C4(e) {
|
|
57109
57118
|
if (!e) return [];
|
|
57110
57119
|
if (typeof e != "string") return [{
|
|
57111
57120
|
type: "text",
|
|
@@ -57146,19 +57155,19 @@ function S4(e) {
|
|
|
57146
57155
|
}
|
|
57147
57156
|
//#endregion
|
|
57148
57157
|
//#region src/utils/index.ts
|
|
57149
|
-
var
|
|
57158
|
+
var w4 = (e) => {
|
|
57150
57159
|
let t = document.cookie.match(RegExp(`(^| )${e}=([^;]*)(;|$)`));
|
|
57151
57160
|
return t ? t[2] : "";
|
|
57152
|
-
},
|
|
57161
|
+
}, T4 = (e) => e.endsWith("/") ? e : `${e}/`, E4 = (e) => {
|
|
57153
57162
|
if (!e) return e;
|
|
57154
57163
|
try {
|
|
57155
57164
|
let t = new URL(e, window.location.origin);
|
|
57156
|
-
return t.protocol = window.location.protocol,
|
|
57165
|
+
return t.protocol = window.location.protocol, T4(t.toString());
|
|
57157
57166
|
} catch (t) {
|
|
57158
|
-
return console.warn("Failed to normalize URL:", t),
|
|
57167
|
+
return console.warn("Failed to normalize URL:", t), T4(e);
|
|
57159
57168
|
}
|
|
57160
57169
|
};
|
|
57161
|
-
async function
|
|
57170
|
+
async function D4(e) {
|
|
57162
57171
|
if (typeof navigator < "u" && "clipboard" in navigator) try {
|
|
57163
57172
|
return await navigator.clipboard.writeText(e), !0;
|
|
57164
57173
|
} catch {}
|
|
@@ -57172,23 +57181,23 @@ async function E4(e) {
|
|
|
57172
57181
|
document.body.removeChild(t);
|
|
57173
57182
|
}
|
|
57174
57183
|
}
|
|
57175
|
-
function
|
|
57184
|
+
function O4() {
|
|
57176
57185
|
let e = window.navigator.userAgent.toLowerCase(), t = window.navigator.platform.toLowerCase();
|
|
57177
57186
|
return t.includes("mac") || e.includes("mac") ? "mac" : t.includes("win") || e.includes("win") ? "windows" : t.includes("linux") || e.includes("linux") ? "linux" : "unknown";
|
|
57178
57187
|
}
|
|
57179
|
-
function O4() {
|
|
57180
|
-
return k4() ? "Cmd + I" : "Ctrl + I";
|
|
57181
|
-
}
|
|
57182
57188
|
function k4() {
|
|
57183
|
-
return
|
|
57189
|
+
return A4() ? "Cmd + I" : "Ctrl + I";
|
|
57184
57190
|
}
|
|
57185
|
-
function A4(
|
|
57186
|
-
|
|
57191
|
+
function A4() {
|
|
57192
|
+
return O4() === "mac";
|
|
57193
|
+
}
|
|
57194
|
+
function j4(e) {
|
|
57195
|
+
let t = A4() ? e.metaKey : e.ctrlKey, n = e.key.toLowerCase() === "i";
|
|
57187
57196
|
return t && n && !e.shiftKey && !e.altKey;
|
|
57188
57197
|
}
|
|
57189
57198
|
//#endregion
|
|
57190
57199
|
//#region src/lang/index.ts
|
|
57191
|
-
var
|
|
57200
|
+
var M4 = w4("blueking_language") || "zh-cn", N4 = {
|
|
57192
57201
|
小鲸: "BK GPT",
|
|
57193
57202
|
关闭: "close",
|
|
57194
57203
|
发送: "Send",
|
|
@@ -57227,7 +57236,7 @@ var j4 = C4("blueking_language") || "zh-cn", M4 = {
|
|
|
57227
57236
|
请求失败: "Request failed",
|
|
57228
57237
|
当前已是新会话: "Already in a new session",
|
|
57229
57238
|
"正在创建会话...": "Creating session..."
|
|
57230
|
-
},
|
|
57239
|
+
}, P4 = {
|
|
57231
57240
|
重命名: "重命名",
|
|
57232
57241
|
自动生成命名: "自动生成命名",
|
|
57233
57242
|
分享会话: "分享会话",
|
|
@@ -57236,10 +57245,10 @@ var j4 = C4("blueking_language") || "zh-cn", M4 = {
|
|
|
57236
57245
|
确定: "确定",
|
|
57237
57246
|
分享链接已复制到剪贴板: "分享链接已复制到剪贴板",
|
|
57238
57247
|
请求失败: "请求失败"
|
|
57239
|
-
},
|
|
57248
|
+
}, F4 = (e) => M4 === "en" ? N4[e] || e : P4[e] || e;
|
|
57240
57249
|
//#endregion
|
|
57241
57250
|
//#region src/composables/use-history-panel.ts
|
|
57242
|
-
function
|
|
57251
|
+
function I4(e) {
|
|
57243
57252
|
let { triggerRef: t, panelComponent: n, panelProps: r = {}, tippyOptions: i = {} } = e, a = /* @__PURE__ */ R(null), o = null, s = () => (o ||= document.createElement("div"), Gs(X(n, {
|
|
57244
57253
|
...r,
|
|
57245
57254
|
onClose: d
|
|
@@ -57302,7 +57311,7 @@ function F4(e) {
|
|
|
57302
57311
|
}
|
|
57303
57312
|
//#endregion
|
|
57304
57313
|
//#region src/components/ai-header/history-dropdown/history-group.vue?vue&type=script&setup=true&lang.ts
|
|
57305
|
-
var
|
|
57314
|
+
var L4 = { class: "history-group" }, R4 = { class: "history-group-title" }, z4 = { class: "history-group-list" }, B4 = /* @__PURE__ */ V({
|
|
57306
57315
|
__name: "history-group",
|
|
57307
57316
|
props: {
|
|
57308
57317
|
currentSessionCode: {},
|
|
@@ -57311,13 +57320,13 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57311
57320
|
},
|
|
57312
57321
|
setup(e) {
|
|
57313
57322
|
let t = e;
|
|
57314
|
-
return (e, n) => (U(), W("div",
|
|
57323
|
+
return (e, n) => (U(), W("div", L4, [K("div", R4, [K("span", null, L(t.title), 1)]), K("div", z4, [ui(e.$slots, "default", {}, void 0, !0)])]));
|
|
57315
57324
|
}
|
|
57316
|
-
}),
|
|
57325
|
+
}), V4 = (e, t) => {
|
|
57317
57326
|
let n = e.__vccOpts || e;
|
|
57318
57327
|
for (let [e, r] of t) n[e] = r;
|
|
57319
57328
|
return n;
|
|
57320
|
-
},
|
|
57329
|
+
}, H4 = /* @__PURE__ */ V4(B4, [["__scopeId", "data-v-3b603cb6"]]), U4 = { class: "history-item-actions" }, W4 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
57321
57330
|
__name: "history-item",
|
|
57322
57331
|
props: {
|
|
57323
57332
|
isActive: { type: Boolean },
|
|
@@ -57378,14 +57387,14 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57378
57387
|
}, null, 8, ["modelValue"])) : (U(), W(H, { key: 0 }, [q(B(UO), { style: { width: "calc(100% - 42px)" } }, {
|
|
57379
57388
|
default: Hn(() => [qa(L(n.session.sessionName), 1)]),
|
|
57380
57389
|
_: 1
|
|
57381
|
-
}), K("span",
|
|
57390
|
+
}), K("span", U4, [Un(K("i", {
|
|
57382
57391
|
class: "bkai-icon bkai-bianji",
|
|
57383
57392
|
onClick: zs(c, ["stop"])
|
|
57384
57393
|
}, null, 512), [[B(i), {
|
|
57385
|
-
content: B(
|
|
57394
|
+
content: B(F4)("编辑"),
|
|
57386
57395
|
boundary: "parent"
|
|
57387
57396
|
}]]), q(B(mN), {
|
|
57388
|
-
title: B(
|
|
57397
|
+
title: B(F4)("确认删除会话 ?"),
|
|
57389
57398
|
content: "删除操作无法撤回,请谨慎操作!",
|
|
57390
57399
|
"confirm-config": { theme: "danger" },
|
|
57391
57400
|
trigger: "click",
|
|
@@ -57396,13 +57405,13 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57396
57405
|
class: "bkai-icon bkai-shanchu",
|
|
57397
57406
|
onClick: t[0] ||= zs(() => {}, ["stop"])
|
|
57398
57407
|
}, null, 512), [[B(i), {
|
|
57399
|
-
content: B(
|
|
57408
|
+
content: B(F4)("删除"),
|
|
57400
57409
|
boundary: "parent"
|
|
57401
57410
|
}]])]),
|
|
57402
57411
|
_: 1
|
|
57403
57412
|
}, 8, ["title"])])], 64))], 2));
|
|
57404
57413
|
}
|
|
57405
|
-
}), [["__scopeId", "data-v-fea14d3a"]]),
|
|
57414
|
+
}), [["__scopeId", "data-v-fea14d3a"]]), G4 = { class: "history-search" }, K4 = { class: "input-icon" }, q4 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
57406
57415
|
__name: "history-search",
|
|
57407
57416
|
props: {
|
|
57408
57417
|
modelValue: { default: "" },
|
|
@@ -57413,21 +57422,21 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57413
57422
|
let n = e, r = t, i = (e) => {
|
|
57414
57423
|
r("update:modelValue", e);
|
|
57415
57424
|
};
|
|
57416
|
-
return (e, t) => (U(), W("div",
|
|
57425
|
+
return (e, t) => (U(), W("div", G4, [q(B(sk), {
|
|
57417
57426
|
"model-value": n.modelValue,
|
|
57418
57427
|
behavior: "simplicity",
|
|
57419
|
-
placeholder: n.placeholder || B(
|
|
57428
|
+
placeholder: n.placeholder || B(F4)("搜索会话名称"),
|
|
57420
57429
|
style: { height: "22px" },
|
|
57421
57430
|
"onUpdate:modelValue": i
|
|
57422
57431
|
}, {
|
|
57423
|
-
suffix: Hn(() => [K("span",
|
|
57432
|
+
suffix: Hn(() => [K("span", K4, [q(B(RT))])]),
|
|
57424
57433
|
_: 1
|
|
57425
57434
|
}, 8, ["model-value", "placeholder"])]));
|
|
57426
57435
|
}
|
|
57427
|
-
}), [["__scopeId", "data-v-e7ff40b2"]]),
|
|
57436
|
+
}), [["__scopeId", "data-v-e7ff40b2"]]), J4 = { class: "history-dropdown-header" }, Y4 = { class: "history-dropdown-header-title" }, X4 = { class: "history-dropdown-content" }, Z4 = {
|
|
57428
57437
|
key: 0,
|
|
57429
57438
|
class: "history-dropdown-loading"
|
|
57430
|
-
},
|
|
57439
|
+
}, Q4 = { class: "history-dropdown-loading-dots" }, $4 = 40, e3 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
57431
57440
|
__name: "index",
|
|
57432
57441
|
props: { sessionBusinessManager: {} },
|
|
57433
57442
|
emits: [
|
|
@@ -57439,37 +57448,37 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57439
57448
|
setup(e, { emit: t }) {
|
|
57440
57449
|
let n = e, r = t, i = /* @__PURE__ */ R(""), a = /* @__PURE__ */ R(null), o = Y(() => n.sessionBusinessManager.currentSession.value?.sessionCode), s = Y(() => n.sessionBusinessManager.isLoadingMore.value), c = (e) => {
|
|
57441
57450
|
let t = e.target;
|
|
57442
|
-
t.scrollHeight - t.scrollTop - t.clientHeight >
|
|
57451
|
+
t.scrollHeight - t.scrollTop - t.clientHeight > $4 || n.sessionBusinessManager.hasMoreSessions.value && (n.sessionBusinessManager.isLoadingMore.value || n.sessionBusinessManager.loadMoreSessions());
|
|
57443
57452
|
}, l = Y(() => {
|
|
57444
57453
|
let e = {
|
|
57445
57454
|
today: {
|
|
57446
57455
|
key: "today",
|
|
57447
|
-
alias:
|
|
57456
|
+
alias: F4("今天"),
|
|
57448
57457
|
sessionList: []
|
|
57449
57458
|
},
|
|
57450
57459
|
yesterday: {
|
|
57451
57460
|
key: "yesterday",
|
|
57452
|
-
alias:
|
|
57461
|
+
alias: F4("昨天"),
|
|
57453
57462
|
sessionList: []
|
|
57454
57463
|
},
|
|
57455
57464
|
"3days": {
|
|
57456
57465
|
key: "3days",
|
|
57457
|
-
alias:
|
|
57466
|
+
alias: F4("3天前"),
|
|
57458
57467
|
sessionList: []
|
|
57459
57468
|
},
|
|
57460
57469
|
"5days": {
|
|
57461
57470
|
key: "5days",
|
|
57462
|
-
alias:
|
|
57471
|
+
alias: F4("5天前"),
|
|
57463
57472
|
sessionList: []
|
|
57464
57473
|
},
|
|
57465
57474
|
"1week": {
|
|
57466
57475
|
key: "1week",
|
|
57467
|
-
alias:
|
|
57476
|
+
alias: F4("1周前"),
|
|
57468
57477
|
sessionList: []
|
|
57469
57478
|
},
|
|
57470
57479
|
before: {
|
|
57471
57480
|
key: "before",
|
|
57472
|
-
alias:
|
|
57481
|
+
alias: F4("更早"),
|
|
57473
57482
|
sessionList: []
|
|
57474
57483
|
}
|
|
57475
57484
|
}, t = n.sessionBusinessManager.sessionList.value.filter((e) => e.sessionName.toLowerCase().includes(i.value.toLowerCase())), r = /* @__PURE__ */ new Date(), a = new Date(r);
|
|
@@ -57504,17 +57513,17 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57504
57513
|
return (e, t) => (U(), W("div", {
|
|
57505
57514
|
class: "bkai-history-dropdown",
|
|
57506
57515
|
onScroll: c
|
|
57507
|
-
}, [K("div",
|
|
57516
|
+
}, [K("div", J4, [K("h1", Y4, L(B(F4)("历史会话")), 1), q(q4, {
|
|
57508
57517
|
modelValue: i.value,
|
|
57509
57518
|
"onUpdate:modelValue": t[0] ||= (e) => i.value = e,
|
|
57510
|
-
placeholder: B(
|
|
57511
|
-
}, null, 8, ["modelValue", "placeholder"])]), K("div",
|
|
57519
|
+
placeholder: B(F4)("搜索会话名称")
|
|
57520
|
+
}, null, 8, ["modelValue", "placeholder"])]), K("div", X4, [l.value.length > 0 ? (U(), W(H, { key: 0 }, [(U(!0), W(H, null, ci(l.value, (e) => (U(), G(H4, {
|
|
57512
57521
|
key: e.key,
|
|
57513
57522
|
"current-session-code": o.value,
|
|
57514
57523
|
sessions: e.sessionList,
|
|
57515
57524
|
title: e.alias
|
|
57516
57525
|
}, {
|
|
57517
|
-
default: Hn(() => [(U(!0), W(H, null, ci(e.sessionList, (e) => (U(), G(
|
|
57526
|
+
default: Hn(() => [(U(!0), W(H, null, ci(e.sessionList, (e) => (U(), G(W4, {
|
|
57518
57527
|
key: e.sessionCode,
|
|
57519
57528
|
"is-active": u(e.sessionCode),
|
|
57520
57529
|
"is-editing": a.value === e.sessionCode,
|
|
@@ -57534,13 +57543,13 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57534
57543
|
"current-session-code",
|
|
57535
57544
|
"sessions",
|
|
57536
57545
|
"title"
|
|
57537
|
-
]))), 128)), s.value ? (U(), W("div",
|
|
57546
|
+
]))), 128)), s.value ? (U(), W("div", Z4, [K("span", Q4, [(U(), W(H, null, ci(3, (e) => K("i", {
|
|
57538
57547
|
key: e,
|
|
57539
57548
|
class: "history-dropdown-loading-dot",
|
|
57540
57549
|
style: ce({ "--dot-index": e - 1 })
|
|
57541
57550
|
}, null, 4)), 64))])])) : J("v-if", !0)], 64)) : (U(), G(B(MM), {
|
|
57542
57551
|
key: 1,
|
|
57543
|
-
description: i.value ? B(
|
|
57552
|
+
description: i.value ? B(F4)("搜索为空") : B(F4)("暂无对话"),
|
|
57544
57553
|
scene: "part",
|
|
57545
57554
|
style: { "margin-top": "100px" },
|
|
57546
57555
|
type: i.value ? "search-empty" : "empty"
|
|
@@ -57549,10 +57558,10 @@ var I4 = { class: "history-group" }, L4 = { class: "history-group-title" }, R4 =
|
|
|
57549
57558
|
}), [["__scopeId", "data-v-bf2401b6"]]);
|
|
57550
57559
|
//#endregion
|
|
57551
57560
|
//#region src/components/ai-header/history-dropdown/use-history-dropdown.ts
|
|
57552
|
-
function
|
|
57553
|
-
return e.sessionBusinessManager ?
|
|
57561
|
+
function t3(e) {
|
|
57562
|
+
return e.sessionBusinessManager ? I4({
|
|
57554
57563
|
triggerRef: e.triggerRef,
|
|
57555
|
-
panelComponent:
|
|
57564
|
+
panelComponent: e3,
|
|
57556
57565
|
panelProps: {
|
|
57557
57566
|
sessionBusinessManager: e.sessionBusinessManager,
|
|
57558
57567
|
onSessionSwitch: e.onSessionSwitch,
|
|
@@ -57575,16 +57584,16 @@ function e3(e) {
|
|
|
57575
57584
|
}
|
|
57576
57585
|
//#endregion
|
|
57577
57586
|
//#region src/components/ai-header/index.vue?vue&type=script&setup=true&lang.ts
|
|
57578
|
-
var
|
|
57587
|
+
var n3 = { class: "left-section" }, r3 = { class: "logo" }, i3 = ["src"], a3 = {
|
|
57579
57588
|
key: 0,
|
|
57580
57589
|
class: "rename-tooltip"
|
|
57581
|
-
},
|
|
57590
|
+
}, o3 = { class: "rename-content" }, s3 = {
|
|
57582
57591
|
key: 0,
|
|
57583
57592
|
class: "tippy-dropdown-menu"
|
|
57584
|
-
},
|
|
57593
|
+
}, c3 = {
|
|
57585
57594
|
key: 1,
|
|
57586
57595
|
class: "bkai-icon bkai-auto-refresh-line"
|
|
57587
|
-
},
|
|
57596
|
+
}, l3 = { class: "right-section" }, u3 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
57588
57597
|
__name: "index",
|
|
57589
57598
|
props: {
|
|
57590
57599
|
title: { default: "" },
|
|
@@ -57653,14 +57662,14 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57653
57662
|
],
|
|
57654
57663
|
setup(e, { expose: t, emit: n }) {
|
|
57655
57664
|
let r = e, i = n, a = kP, o = /* @__PURE__ */ R(null), s = /* @__PURE__ */ R(null), c = Mr("moreMenuTippyRef"), l = /* @__PURE__ */ R(!1), u = /* @__PURE__ */ R(""), d = /* @__PURE__ */ R(null), f = /* @__PURE__ */ R(!1), p = () => document.querySelector(".ai-blueking-panel") || document.body, m = null, h = () => {
|
|
57656
|
-
!s.value || !r.sessionBusinessManager || (m =
|
|
57665
|
+
!s.value || !r.sessionBusinessManager || (m = t3({
|
|
57657
57666
|
triggerRef: s,
|
|
57658
57667
|
sessionBusinessManager: r.sessionBusinessManager,
|
|
57659
57668
|
onSessionSwitch: (e) => i("history-session-switch", e),
|
|
57660
57669
|
onSessionDelete: (e) => i("history-session-delete", e),
|
|
57661
57670
|
onSessionRename: (e, t) => i("history-session-rename", e, t)
|
|
57662
57671
|
}));
|
|
57663
|
-
}, g = Y(() => r.hasPermission ? r.enableChatSession ? r.title || `${r.agentName || ""}-${r.sessionName || ""}` : r.agentName :
|
|
57672
|
+
}, g = Y(() => r.hasPermission ? r.enableChatSession ? r.title || `${r.agentName || ""}-${r.sessionName || ""}` : r.agentName : F4("无智能体使用权限")), _ = Y(() => r.isCompressionHeight ? "bkai-morenchicun" : "bkai-yasuo"), v = Y(() => r.isCompressionHeight ? F4("恢复默认尺寸") : F4("缩小高度")), y = Y(() => r.hasPermission), b = (e) => y.value ? e : F4("暂无使用权限"), x = () => ({ cursor: y.value ? "pointer" : "not-allowed" }), S = /* @__PURE__ */ R(!1), C = async () => {
|
|
57664
57673
|
if (!S.value) {
|
|
57665
57674
|
S.value = !0;
|
|
57666
57675
|
try {
|
|
@@ -57674,7 +57683,7 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57674
57683
|
} catch (e) {
|
|
57675
57684
|
console.error("Failed to create new session:", e), eN({
|
|
57676
57685
|
theme: "error",
|
|
57677
|
-
message:
|
|
57686
|
+
message: F4("创建会话失败")
|
|
57678
57687
|
});
|
|
57679
57688
|
}
|
|
57680
57689
|
i("new-chat");
|
|
@@ -57737,21 +57746,21 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57737
57746
|
ref: o,
|
|
57738
57747
|
class: pe(["ai-header drag-handle", { draggable: r.draggable }])
|
|
57739
57748
|
}, [
|
|
57740
|
-
K("div",
|
|
57741
|
-
K("div",
|
|
57749
|
+
K("div", n3, [
|
|
57750
|
+
K("div", r3, [K("img", {
|
|
57742
57751
|
alt: "logo",
|
|
57743
57752
|
src: B(d2)
|
|
57744
|
-
}, null, 8,
|
|
57753
|
+
}, null, 8, i3)]),
|
|
57745
57754
|
K("div", { class: pe(["title", { "title-with-tooltip": l.value }]) }, [
|
|
57746
57755
|
qa(L(g.value) + " ", 1),
|
|
57747
57756
|
J(" 重命名 tooltip 直接绑定在 title 上 "),
|
|
57748
|
-
l.value ? (U(), W("div",
|
|
57757
|
+
l.value ? (U(), W("div", a3, [K("div", o3, [q(B(sk), {
|
|
57749
57758
|
ref_key: "renameInputRef",
|
|
57750
57759
|
ref: d,
|
|
57751
57760
|
modelValue: u.value,
|
|
57752
57761
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
57753
57762
|
class: "rename-input",
|
|
57754
|
-
placeholder: B(
|
|
57763
|
+
placeholder: B(F4)("请输入新的会话名称"),
|
|
57755
57764
|
onKeyup: N
|
|
57756
57765
|
}, null, 8, ["modelValue", "placeholder"]), K("div", { class: "rename-buttons" }, [K("i", {
|
|
57757
57766
|
class: "bkai-icon bkai-check-1 rename-btn confirm-btn",
|
|
@@ -57776,12 +57785,12 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57776
57785
|
onHidden: n[1] ||= (e) => f.value = !1,
|
|
57777
57786
|
onShown: n[2] ||= (e) => f.value = !0
|
|
57778
57787
|
}, {
|
|
57779
|
-
content: Hn(() => [f.value ? (U(), W("div",
|
|
57788
|
+
content: Hn(() => [f.value ? (U(), W("div", s3, [
|
|
57780
57789
|
r.dropdownMenuConfig?.showRename ? (U(), W("div", {
|
|
57781
57790
|
key: 0,
|
|
57782
57791
|
class: "tippy-menu-item",
|
|
57783
57792
|
onClick: D
|
|
57784
|
-
}, [n[7] ||= K("i", { class: "bkai-icon bkai-bianji" }, null, -1), K("span", null, L(B(
|
|
57793
|
+
}, [n[7] ||= K("i", { class: "bkai-icon bkai-bianji" }, null, -1), K("span", null, L(B(F4)("重命名")), 1)])) : J("v-if", !0),
|
|
57785
57794
|
r.dropdownMenuConfig?.showAutoGenerate ? Un((U(), W("div", {
|
|
57786
57795
|
key: 1,
|
|
57787
57796
|
class: pe(["tippy-menu-item", { disabled: !r.hasSessionContents || r.autoGenerateLoading }]),
|
|
@@ -57791,8 +57800,8 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57791
57800
|
mode: "spin",
|
|
57792
57801
|
size: "mini",
|
|
57793
57802
|
theme: "primary"
|
|
57794
|
-
})) : (U(), W("i",
|
|
57795
|
-
content: r.hasSessionContents ? "" : B(
|
|
57803
|
+
})) : (U(), W("i", c3)), K("span", null, L(B(F4)("自动生成命名")), 1)], 2)), [[B(QL), {
|
|
57804
|
+
content: r.hasSessionContents ? "" : B(F4)("请先发起会话"),
|
|
57796
57805
|
theme: "ai-blueking-tooltip",
|
|
57797
57806
|
arrow: !0,
|
|
57798
57807
|
delay: [300, 0],
|
|
@@ -57802,8 +57811,8 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57802
57811
|
key: 2,
|
|
57803
57812
|
class: pe(["tippy-menu-item", { disabled: !r.hasSessionContents }]),
|
|
57804
57813
|
onClick: k
|
|
57805
|
-
}, [n[8] ||= K("i", { class: "bkai-icon bkai-fenxiang" }, null, -1), K("span", null, L(B(
|
|
57806
|
-
content: r.hasSessionContents ? "" : B(
|
|
57814
|
+
}, [n[8] ||= K("i", { class: "bkai-icon bkai-fenxiang" }, null, -1), K("span", null, L(B(F4)("分享会话")), 1)], 2)), [[B(QL), {
|
|
57815
|
+
content: r.hasSessionContents ? "" : B(F4)("请先发起会话"),
|
|
57807
57816
|
theme: "ai-blueking-tooltip",
|
|
57808
57817
|
arrow: !0,
|
|
57809
57818
|
delay: [300, 0],
|
|
@@ -57818,7 +57827,7 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57818
57827
|
}, 512)) : J("v-if", !0)
|
|
57819
57828
|
]),
|
|
57820
57829
|
ui(t.$slots, "headerLeft", {}, void 0, !0),
|
|
57821
|
-
K("div",
|
|
57830
|
+
K("div", l3, [
|
|
57822
57831
|
J(" 新增会话按钮 "),
|
|
57823
57832
|
r.showNewChatIcon && e.enableChatSession !== !1 ? Un((U(), W("i", {
|
|
57824
57833
|
key: 0,
|
|
@@ -57830,7 +57839,7 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57830
57839
|
style: ce(x()),
|
|
57831
57840
|
onClick: n[3] ||= (t) => y.value && !S.value && e.hasSessionContents ? C() : void 0
|
|
57832
57841
|
}, null, 6)), [[B(a), {
|
|
57833
|
-
content: S.value ? B(
|
|
57842
|
+
content: S.value ? B(F4)("正在创建会话...") : e.hasSessionContents ? b(B(F4)("新增会话")) : B(F4)("当前已是新会话"),
|
|
57834
57843
|
boundary: "parent"
|
|
57835
57844
|
}]]) : J("v-if", !0),
|
|
57836
57845
|
J(" 历史会话按钮 "),
|
|
@@ -57846,7 +57855,7 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57846
57855
|
style: ce(x()),
|
|
57847
57856
|
onClick: n[4] ||= (e) => y.value ? w(e) : void 0
|
|
57848
57857
|
}, null, 6)), [[B(a), {
|
|
57849
|
-
content: b(B(
|
|
57858
|
+
content: b(B(F4)("历史会话")),
|
|
57850
57859
|
boundary: "parent"
|
|
57851
57860
|
}]]) : J("v-if", !0),
|
|
57852
57861
|
e.chatGroup?.enabled ? Un((U(), W("i", {
|
|
@@ -57854,7 +57863,7 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57854
57863
|
class: "bkai-icon bkai-zhushou",
|
|
57855
57864
|
onClick: T
|
|
57856
57865
|
}, null, 512)), [[B(a), {
|
|
57857
|
-
content: B(
|
|
57866
|
+
content: B(F4)("转人工"),
|
|
57858
57867
|
boundary: "parent"
|
|
57859
57868
|
}]]) : J("v-if", !0),
|
|
57860
57869
|
r.showCompressionIcon ? Un((U(), W("i", {
|
|
@@ -57869,7 +57878,7 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57869
57878
|
class: "bkai-icon bkai-close-line-2",
|
|
57870
57879
|
onClick: n[6] ||= (e) => i("close")
|
|
57871
57880
|
}, null, 512), [[B(a), {
|
|
57872
|
-
content: B(
|
|
57881
|
+
content: B(F4)("关闭"),
|
|
57873
57882
|
boundary: "parent"
|
|
57874
57883
|
}]])
|
|
57875
57884
|
])
|
|
@@ -57878,21 +57887,21 @@ var t3 = { class: "left-section" }, n3 = { class: "logo" }, r3 = ["src"], i3 = {
|
|
|
57878
57887
|
}), [["__scopeId", "data-v-32672b9d"]]);
|
|
57879
57888
|
//#endregion
|
|
57880
57889
|
//#region src/bootstrap/agent-bootstrap.ts
|
|
57881
|
-
function
|
|
57882
|
-
let t =
|
|
57890
|
+
function d3(e) {
|
|
57891
|
+
let t = E4(e);
|
|
57883
57892
|
fetch(t, {
|
|
57884
57893
|
method: "GET",
|
|
57885
57894
|
credentials: "include"
|
|
57886
57895
|
}).catch(() => {});
|
|
57887
57896
|
}
|
|
57888
|
-
async function
|
|
57897
|
+
async function f3(e) {
|
|
57889
57898
|
await Promise.all([e.agent.getAgentInfo(), e.session.getSessions()]);
|
|
57890
57899
|
let t = e.agent.info.value?.saasUrl;
|
|
57891
|
-
t &&
|
|
57900
|
+
t && d3(t);
|
|
57892
57901
|
}
|
|
57893
57902
|
//#endregion
|
|
57894
57903
|
//#region src/manager/business/chat-business-manager.ts
|
|
57895
|
-
var
|
|
57904
|
+
var p3 = class {
|
|
57896
57905
|
_isGenerating;
|
|
57897
57906
|
_isStopLoading;
|
|
57898
57907
|
agentModule;
|
|
@@ -57966,7 +57975,7 @@ var f3 = class {
|
|
|
57966
57975
|
async regenerateFromAIMessages(e, t) {
|
|
57967
57976
|
try {
|
|
57968
57977
|
if (!e || e.length === 0) throw Error("No AI messages provided");
|
|
57969
|
-
let n = this.messages.value, r =
|
|
57978
|
+
let n = this.messages.value, r = x4(n, e[0]);
|
|
57970
57979
|
if (!r) throw Error("No user message found before AI messages");
|
|
57971
57980
|
let i = r.id;
|
|
57972
57981
|
if (i === void 0) throw Error("User message has no id");
|
|
@@ -58050,7 +58059,7 @@ var f3 = class {
|
|
|
58050
58059
|
this._isStopLoading.value = !1;
|
|
58051
58060
|
}
|
|
58052
58061
|
}
|
|
58053
|
-
},
|
|
58062
|
+
}, m3 = class {
|
|
58054
58063
|
agentModule;
|
|
58055
58064
|
config;
|
|
58056
58065
|
eventEmitter;
|
|
@@ -58153,7 +58162,7 @@ var f3 = class {
|
|
|
58153
58162
|
return t == null ? !1 : t === 0;
|
|
58154
58163
|
}
|
|
58155
58164
|
isCurrentSessionEmpty(e) {
|
|
58156
|
-
return this.messageModule &&
|
|
58165
|
+
return this.messageModule && b4(this.messageModule.list.value) ? !1 : this.isSessionEmpty(e);
|
|
58157
58166
|
}
|
|
58158
58167
|
findSession(e) {
|
|
58159
58168
|
return this.sessionList.value.find((t) => t.sessionCode === e);
|
|
@@ -58229,7 +58238,7 @@ var f3 = class {
|
|
|
58229
58238
|
}), e;
|
|
58230
58239
|
}
|
|
58231
58240
|
}
|
|
58232
|
-
},
|
|
58241
|
+
}, h3 = class {
|
|
58233
58242
|
messageModule;
|
|
58234
58243
|
sessionModule;
|
|
58235
58244
|
constructor(e, t) {
|
|
@@ -58246,7 +58255,7 @@ var f3 = class {
|
|
|
58246
58255
|
userMessageIds: e.map((e) => String(e.id))
|
|
58247
58256
|
};
|
|
58248
58257
|
}
|
|
58249
|
-
},
|
|
58258
|
+
}, g3 = class {
|
|
58250
58259
|
_agentShortcuts;
|
|
58251
58260
|
_effectiveShortcuts;
|
|
58252
58261
|
_propsShortcuts;
|
|
@@ -58303,7 +58312,7 @@ var f3 = class {
|
|
|
58303
58312
|
setShortcuts(e) {
|
|
58304
58313
|
this._propsShortcuts.value = e;
|
|
58305
58314
|
}
|
|
58306
|
-
},
|
|
58315
|
+
}, _3 = class {
|
|
58307
58316
|
_isCompressed;
|
|
58308
58317
|
_isDraggingOrResizing;
|
|
58309
58318
|
_nimbusMinimized;
|
|
@@ -58518,12 +58527,12 @@ var f3 = class {
|
|
|
58518
58527
|
};
|
|
58519
58528
|
}
|
|
58520
58529
|
};
|
|
58521
|
-
function
|
|
58522
|
-
return new
|
|
58530
|
+
function v3(e) {
|
|
58531
|
+
return new _3(e);
|
|
58523
58532
|
}
|
|
58524
58533
|
//#endregion
|
|
58525
58534
|
//#region src/manager/event-types.ts
|
|
58526
|
-
var
|
|
58535
|
+
var y3 = {
|
|
58527
58536
|
"panel-show": "show",
|
|
58528
58537
|
"panel-hide": "close",
|
|
58529
58538
|
"panel-toggle": null,
|
|
@@ -58573,7 +58582,7 @@ var v3 = {
|
|
|
58573
58582
|
"agent-info-loaded": null,
|
|
58574
58583
|
error: null
|
|
58575
58584
|
};
|
|
58576
|
-
function
|
|
58585
|
+
function b3(e, t) {
|
|
58577
58586
|
switch (e) {
|
|
58578
58587
|
case "send-message": return [t.content];
|
|
58579
58588
|
case "rename": return [t.newName];
|
|
@@ -58604,7 +58613,7 @@ function y3(e, t) {
|
|
|
58604
58613
|
}
|
|
58605
58614
|
//#endregion
|
|
58606
58615
|
//#region src/manager/ui/ui-state-manager.ts
|
|
58607
|
-
var
|
|
58616
|
+
var x3 = class {
|
|
58608
58617
|
_selectedMessageIds;
|
|
58609
58618
|
_isSelectionMode;
|
|
58610
58619
|
_editingSessionCode;
|
|
@@ -58677,12 +58686,12 @@ var b3 = class {
|
|
|
58677
58686
|
reset() {
|
|
58678
58687
|
this.clearSelection(), this.disableSelectionMode(), this.stopEditingSession(), this.clearLoadingStates();
|
|
58679
58688
|
}
|
|
58680
|
-
},
|
|
58689
|
+
}, S3 = class extends Error {
|
|
58681
58690
|
constructor() {
|
|
58682
58691
|
super("[ChatBot] Initialization was superseded by a newer init"), this.name = "ChatBotInitStaleError";
|
|
58683
58692
|
}
|
|
58684
58693
|
};
|
|
58685
|
-
function
|
|
58694
|
+
function C3(e) {
|
|
58686
58695
|
let { props: t, emit: n, scrollToBottom: r } = e, i = /* @__PURE__ */ z(null), a = /* @__PURE__ */ z(null), o = /* @__PURE__ */ z(null), s = /* @__PURE__ */ z(null), c = /* @__PURE__ */ R(!1), l = /* @__PURE__ */ R(!t.chatHelper), u = /* @__PURE__ */ R(null), d = Y(() => c.value), f = () => t.chatHelper ? !t.chatHelper.agent || !t.chatHelper.session || !t.chatHelper.message ? {
|
|
58687
58696
|
valid: !1,
|
|
58688
58697
|
error: "[ChatBot] Invalid chatHelper: missing required modules (agent, session, message)"
|
|
@@ -58706,8 +58715,8 @@ function S3(e) {
|
|
|
58706
58715
|
onError: (e) => {
|
|
58707
58716
|
n("error", e);
|
|
58708
58717
|
}
|
|
58709
|
-
}), a =
|
|
58710
|
-
requestData:
|
|
58718
|
+
}), a = m4({
|
|
58719
|
+
requestData: g4(E4(t.url), () => en(t.requestOptions)),
|
|
58711
58720
|
protocol: i
|
|
58712
58721
|
});
|
|
58713
58722
|
return i.injectMessageModule(a.message), a;
|
|
@@ -58719,31 +58728,31 @@ function S3(e) {
|
|
|
58719
58728
|
}, h = 0, g = null, _ = null, v = null, y = (e) => {
|
|
58720
58729
|
v &&= (e ? v.reject(e) : v.resolve(), null), g = null;
|
|
58721
58730
|
}, b = (e) => {
|
|
58722
|
-
if (e !== h) throw new
|
|
58731
|
+
if (e !== h) throw new S3();
|
|
58723
58732
|
}, x = async (e) => {
|
|
58724
58733
|
let r = i.value, d = l.value;
|
|
58725
58734
|
c.value = !1, u.value = null, l.value = !t.chatHelper, await m(r, d), b(e), i.value = null, a.value = null, o.value = null, s.value = null;
|
|
58726
58735
|
let f = p();
|
|
58727
58736
|
if (!f) throw u.value ?? /* @__PURE__ */ Error("[ChatBot] Failed to create chatHelper");
|
|
58728
|
-
let h = new
|
|
58737
|
+
let h = new m3(f.session, f.agent, null, {
|
|
58729
58738
|
enableChatSession: !0,
|
|
58730
58739
|
autoSwitchToInitialSession: !!t.sessionCode,
|
|
58731
58740
|
loadRecentSessionOnMount: t.autoLoad,
|
|
58732
58741
|
initialSessionCode: t.sessionCode,
|
|
58733
58742
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
58734
|
-
}, f.message), g = new
|
|
58743
|
+
}, f.message), g = new p3(f.agent, f.message, f.session, null, {
|
|
58735
58744
|
openingRemark: t.helloText,
|
|
58736
58745
|
predefinedQuestions: t.prompts,
|
|
58737
58746
|
placeholder: t.placeholder
|
|
58738
|
-
}), _ = new
|
|
58747
|
+
}), _ = new g3(null, t.shortcuts || []);
|
|
58739
58748
|
i.value = f, a.value = h, o.value = g, s.value = _;
|
|
58740
58749
|
try {
|
|
58741
|
-
l.value && (await
|
|
58750
|
+
l.value && (await f3(f), b(e), await h.loadRecentSession({ skipLoadSessions: !0 }), b(e)), b(e), c.value = !0, n("agent-info-loaded", f);
|
|
58742
58751
|
} catch (t) {
|
|
58743
58752
|
throw b(e), console.error("Failed to initialize ChatBot:", t), u.value = t, n("error", t), t;
|
|
58744
58753
|
}
|
|
58745
58754
|
}, S = () => {
|
|
58746
|
-
y(new
|
|
58755
|
+
y(new S3()), _ = null;
|
|
58747
58756
|
let e = ++h;
|
|
58748
58757
|
g = new Promise((t, n) => {
|
|
58749
58758
|
v = {
|
|
@@ -58777,7 +58786,7 @@ function S3(e) {
|
|
|
58777
58786
|
}
|
|
58778
58787
|
//#endregion
|
|
58779
58788
|
//#region src/components/composables/use-chatbot-state.ts
|
|
58780
|
-
function
|
|
58789
|
+
function w3(e) {
|
|
58781
58790
|
let { props: t, chatHelper: n, chatBusinessManager: r, sessionBusinessManager: i, shortcutManager: a, isStandaloneMode: o, isInitialized: s, selectedShortcut: c } = e, l = Y(() => r.value?.isStopLoading.value ? Ac.StopLoading : ((t.chatHelper || n.value)?.agent)?.isChatting?.value ? Ac.Streaming : Ac.Complete), u = Y(() => l.value === Ac.Streaming ? rZ.Disabled : void 0), d = Y(() => r.value?.messages.value ?? []), f = Y(() => r.value?.isMessagesLoading.value ?? !1);
|
|
58782
58791
|
return {
|
|
58783
58792
|
messageStatus: l,
|
|
@@ -58806,33 +58815,33 @@ function C3(e) {
|
|
|
58806
58815
|
}
|
|
58807
58816
|
//#endregion
|
|
58808
58817
|
//#region src/components/composables/use-interrupt-resume.ts
|
|
58809
|
-
var
|
|
58818
|
+
var T3 = "others", E3 = {
|
|
58810
58819
|
[Mc.ApprovalCancel]: _2.ApprovalCancel,
|
|
58811
58820
|
[Mc.FlowNodeRetry]: _2.FlowNodeRetry,
|
|
58812
58821
|
[Mc.FlowNodeSkip]: _2.FlowNodeSkip
|
|
58813
58822
|
};
|
|
58814
|
-
function
|
|
58823
|
+
function D3(e) {
|
|
58815
58824
|
return "operation" in e;
|
|
58816
58825
|
}
|
|
58817
|
-
function
|
|
58826
|
+
function O3(e) {
|
|
58818
58827
|
return "interruptId" in e && "reason" in e && e.reason === Dc.UserQuestion;
|
|
58819
58828
|
}
|
|
58820
|
-
function
|
|
58829
|
+
function k3(e) {
|
|
58821
58830
|
return e === "cancelled" ? j2.Cancelled : j2.Resolved;
|
|
58822
58831
|
}
|
|
58823
|
-
function
|
|
58832
|
+
function A3(e) {
|
|
58824
58833
|
let t = e?.session.current?.value?.sessionCode;
|
|
58825
58834
|
if (!t) throw Error("[ChatBot] Cannot resume interrupt: no active session");
|
|
58826
58835
|
return t;
|
|
58827
58836
|
}
|
|
58828
|
-
function
|
|
58837
|
+
function j3(e) {
|
|
58829
58838
|
return {
|
|
58830
58839
|
interruptId: e.interruptId,
|
|
58831
|
-
status:
|
|
58840
|
+
status: k3(e.status),
|
|
58832
58841
|
payload: e.payload
|
|
58833
58842
|
};
|
|
58834
58843
|
}
|
|
58835
|
-
function
|
|
58844
|
+
function M3(e, t, n) {
|
|
58836
58845
|
let r = e?.metadata?.questions?.[0]?.question ?? "";
|
|
58837
58846
|
return {
|
|
58838
58847
|
interruptId: n.interruptId,
|
|
@@ -58842,23 +58851,23 @@ function j3(e, t, n) {
|
|
|
58842
58851
|
question: r,
|
|
58843
58852
|
multiSelect: !1,
|
|
58844
58853
|
answer: [{
|
|
58845
|
-
label:
|
|
58854
|
+
label: T3,
|
|
58846
58855
|
description: t
|
|
58847
58856
|
}]
|
|
58848
58857
|
}] }
|
|
58849
58858
|
};
|
|
58850
58859
|
}
|
|
58851
|
-
function
|
|
58860
|
+
function N3(e) {
|
|
58852
58861
|
let { chatHelper: t, emit: n } = e, r = async (e) => {
|
|
58853
58862
|
let n = t.value;
|
|
58854
58863
|
if (!n) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
58855
|
-
if (!
|
|
58856
|
-
let r =
|
|
58864
|
+
if (!D3(e)) throw Error("[ChatBot] Unsupported interrupt resume payload");
|
|
58865
|
+
let r = A3(n);
|
|
58857
58866
|
if (e.operation === Mc.ApprovalRefresh) {
|
|
58858
58867
|
n.agent.pollResumeSession(r);
|
|
58859
58868
|
return;
|
|
58860
58869
|
}
|
|
58861
|
-
let i =
|
|
58870
|
+
let i = E3[e.operation];
|
|
58862
58871
|
if (!i) throw Error(`[ChatBot] Unsupported interrupt resume operation: ${e.operation}`);
|
|
58863
58872
|
let a = n.agent;
|
|
58864
58873
|
if (e.operation === Mc.ApprovalCancel) {
|
|
@@ -58872,21 +58881,21 @@ function M3(e) {
|
|
|
58872
58881
|
}, i = async (e, n) => {
|
|
58873
58882
|
let r = t.value;
|
|
58874
58883
|
if (!r) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
58875
|
-
let i =
|
|
58884
|
+
let i = A3(r);
|
|
58876
58885
|
await r.agent.streamRequest({
|
|
58877
58886
|
sessionCode: i,
|
|
58878
|
-
resume:
|
|
58887
|
+
resume: j3(e),
|
|
58879
58888
|
...n ? { input: n } : {}
|
|
58880
58889
|
});
|
|
58881
58890
|
};
|
|
58882
58891
|
return {
|
|
58883
58892
|
handleInterruptResume: async (e, t) => {
|
|
58884
58893
|
try {
|
|
58885
|
-
if (
|
|
58894
|
+
if (D3(e)) {
|
|
58886
58895
|
await r(e);
|
|
58887
58896
|
return;
|
|
58888
58897
|
}
|
|
58889
|
-
if (
|
|
58898
|
+
if (O3(e)) {
|
|
58890
58899
|
await i(e);
|
|
58891
58900
|
return;
|
|
58892
58901
|
}
|
|
@@ -58897,10 +58906,10 @@ function M3(e) {
|
|
|
58897
58906
|
},
|
|
58898
58907
|
resumeUserQuestionWithInput: async (e, t) => {
|
|
58899
58908
|
try {
|
|
58900
|
-
if (!t.payload || !
|
|
58909
|
+
if (!t.payload || !O3(t.payload)) throw Error("[ChatBot] Invalid user question resume options");
|
|
58901
58910
|
let n = typeof e == "string" ? e.trim() : "";
|
|
58902
58911
|
if (!n) throw Error("[ChatBot] User question free text input is empty");
|
|
58903
|
-
await i(
|
|
58912
|
+
await i(M3(t.interrupt, n, t.payload), n);
|
|
58904
58913
|
} catch (e) {
|
|
58905
58914
|
console.error("[ChatBot] Failed to resume user question with input:", e), n("error", e instanceof Error ? e : Error(String(e)));
|
|
58906
58915
|
}
|
|
@@ -58909,7 +58918,7 @@ function M3(e) {
|
|
|
58909
58918
|
}
|
|
58910
58919
|
//#endregion
|
|
58911
58920
|
//#region src/components/composables/use-message-sender.ts
|
|
58912
|
-
function
|
|
58921
|
+
function P3(e) {
|
|
58913
58922
|
let { emit: t, chatHelper: n, chatBusinessManager: r, getRequestOptions: i, resumeUserQuestionWithInput: a, selectedShortcut: o, selectedResources: s } = e, c = /* @__PURE__ */ z([[]]), l = /* @__PURE__ */ z(""), u = (e, t) => {
|
|
58914
58923
|
c.value = e, s.value = t;
|
|
58915
58924
|
}, d = async (e, a = {}) => {
|
|
@@ -58917,7 +58926,7 @@ function N3(e) {
|
|
|
58917
58926
|
let o = n.value.session.current?.value?.sessionCode;
|
|
58918
58927
|
if (!o) throw Error("[ChatBot] Cannot send message: no active session");
|
|
58919
58928
|
c.value = [[]], l.value = "", s.value = [], t("send-message", typeof e == "string" ? e : "");
|
|
58920
|
-
let u =
|
|
58929
|
+
let u = v4(a.property, i);
|
|
58921
58930
|
await r.value.sendMessage(e, o, {
|
|
58922
58931
|
...a,
|
|
58923
58932
|
...u ? { property: u } : {}
|
|
@@ -58961,10 +58970,10 @@ function N3(e) {
|
|
|
58961
58970
|
}
|
|
58962
58971
|
//#endregion
|
|
58963
58972
|
//#region src/components/composables/use-share-selection.ts
|
|
58964
|
-
function
|
|
58973
|
+
function F3(e) {
|
|
58965
58974
|
let { emit: t, chatHelper: n, isStandaloneMode: r } = e, i = async (e) => {
|
|
58966
58975
|
if (!(!n.value || e.length === 0)) try {
|
|
58967
|
-
await
|
|
58976
|
+
await D4((await new h3(n.value.message, n.value.session).shareMessages(e)).shareUrl), eN({
|
|
58968
58977
|
message: "分享链接已复制到剪贴板",
|
|
58969
58978
|
theme: "success"
|
|
58970
58979
|
});
|
|
@@ -58981,7 +58990,7 @@ function P3(e) {
|
|
|
58981
58990
|
}
|
|
58982
58991
|
//#endregion
|
|
58983
58992
|
//#region src/components/composables/use-shortcuts.ts
|
|
58984
|
-
function
|
|
58993
|
+
function I3(e) {
|
|
58985
58994
|
let { props: t, emit: n, shortcutManager: r, doSendMessage: i, selectedShortcut: a } = e, o = Y(() => r.value?.effectiveShortcuts.value ?? []), s = (e, t) => {
|
|
58986
58995
|
let n = e, r;
|
|
58987
58996
|
if (r = n.enable_fill_back && n.fill_back_component_key ? n.fill_back_component_key : n.components?.find((e) => e.fillBack)?.key, r && t) {
|
|
@@ -59075,14 +59084,14 @@ function F3(e) {
|
|
|
59075
59084
|
}
|
|
59076
59085
|
//#endregion
|
|
59077
59086
|
//#region src/components/composables/use-tool-actions.ts
|
|
59078
|
-
function
|
|
59087
|
+
function L3(e) {
|
|
59079
59088
|
let { emit: t, chatHelper: n, chatBusinessManager: r, cite: i, focusInput: a, scrollToBottom: o, getShortcutFromMessage: s, buildShortcutProperty: c, getRequestOptions: l } = e, u = async (e) => {
|
|
59080
59089
|
if (!r.value || !n.value) {
|
|
59081
59090
|
console.error("[ChatBot] Cannot delete messages: chatBusinessManager not initialized");
|
|
59082
59091
|
return;
|
|
59083
59092
|
}
|
|
59084
59093
|
try {
|
|
59085
|
-
let t = r.value.messages.value, i =
|
|
59094
|
+
let t = r.value.messages.value, i = x4(t, e[0]);
|
|
59086
59095
|
if (!i) {
|
|
59087
59096
|
console.error("[ChatBot] No user message found before AI messages");
|
|
59088
59097
|
return;
|
|
@@ -59164,7 +59173,7 @@ function I3(e) {
|
|
|
59164
59173
|
console.error("[ChatBot] Cannot submit feedback: no active session");
|
|
59165
59174
|
return;
|
|
59166
59175
|
}
|
|
59167
|
-
let c =
|
|
59176
|
+
let c = S4(r.value?.messages.value || [], i[0]);
|
|
59168
59177
|
if (c === void 0) {
|
|
59169
59178
|
console.error("[ChatBot] Cannot submit feedback: no user message found");
|
|
59170
59179
|
return;
|
|
@@ -59209,7 +59218,7 @@ function I3(e) {
|
|
|
59209
59218
|
return;
|
|
59210
59219
|
}
|
|
59211
59220
|
try {
|
|
59212
|
-
let t = e.property, n =
|
|
59221
|
+
let t = e.property, n = v4(t, l);
|
|
59213
59222
|
await r.value?.resendMessageWithProperty(String(c), s, typeof i == "string" ? i : "", n), o();
|
|
59214
59223
|
} catch (e) {
|
|
59215
59224
|
console.error("[ChatBot] Failed to edit and resend message:", e), t("error", e);
|
|
@@ -59236,7 +59245,7 @@ function I3(e) {
|
|
|
59236
59245
|
console.error("[ChatBot] Cannot edit shortcut message: shortcut not found");
|
|
59237
59246
|
return;
|
|
59238
59247
|
}
|
|
59239
|
-
let n =
|
|
59248
|
+
let n = v4(c(t, i), l), d = String(i.input ?? "");
|
|
59240
59249
|
await r.value.resendMessageWithProperty(String(u), a, d, n), o();
|
|
59241
59250
|
} catch (e) {
|
|
59242
59251
|
console.error("[ChatBot] Failed to edit shortcut message:", e), t("error", e);
|
|
@@ -59253,7 +59262,7 @@ function I3(e) {
|
|
|
59253
59262
|
}
|
|
59254
59263
|
//#endregion
|
|
59255
59264
|
//#region src/components/chat-bot.vue
|
|
59256
|
-
var
|
|
59265
|
+
var R3 = /* @__PURE__ */ V({
|
|
59257
59266
|
__name: "chat-bot",
|
|
59258
59267
|
props: {
|
|
59259
59268
|
autoLoad: {
|
|
@@ -59319,14 +59328,14 @@ var L3 = /* @__PURE__ */ V({
|
|
|
59319
59328
|
await An(), o.value && (o.value.scrollTop = o.value.scrollHeight);
|
|
59320
59329
|
}, p = () => {
|
|
59321
59330
|
c.value?.focus?.();
|
|
59322
|
-
}, { chatHelper: m, isStandaloneMode: h, isInitialized: g, isReady: _, initError: v, whenReady: y, chatBusinessManager: b, sessionBusinessManager: x, shortcutManager: S } =
|
|
59331
|
+
}, { chatHelper: m, isStandaloneMode: h, isInitialized: g, isReady: _, initError: v, whenReady: y, chatBusinessManager: b, sessionBusinessManager: x, shortcutManager: S } = C3({
|
|
59323
59332
|
props: r,
|
|
59324
59333
|
emit: i,
|
|
59325
59334
|
scrollToBottom: f
|
|
59326
|
-
}), { handleInterruptResume: C, resumeUserQuestionWithInput: w } =
|
|
59335
|
+
}), { handleInterruptResume: C, resumeUserQuestionWithInput: w } = N3({
|
|
59327
59336
|
chatHelper: m,
|
|
59328
59337
|
emit: i
|
|
59329
|
-
}), { userInput: T, cite: E, handleUpdateModelValue: D, doSendMessage: O, handleSendMessage: k, handleUpload: A, handleStopSending: j, stopGeneration: M } =
|
|
59338
|
+
}), { userInput: T, cite: E, handleUpdateModelValue: D, doSendMessage: O, handleSendMessage: k, handleUpload: A, handleStopSending: j, stopGeneration: M } = P3({
|
|
59330
59339
|
emit: i,
|
|
59331
59340
|
chatHelper: m,
|
|
59332
59341
|
chatBusinessManager: b,
|
|
@@ -59334,14 +59343,14 @@ var L3 = /* @__PURE__ */ V({
|
|
|
59334
59343
|
resumeUserQuestionWithInput: w,
|
|
59335
59344
|
selectedShortcut: u,
|
|
59336
59345
|
selectedResources: l
|
|
59337
|
-
}), { handleSelectShortcut: N, handleCloseShortcut: P, handleShortcutSubmit: F, selectShortcutWithText: I, getShortcutFromMessage: ee, buildShortcutProperty: te, sendShortcutDirectly: ne } =
|
|
59346
|
+
}), { handleSelectShortcut: N, handleCloseShortcut: P, handleShortcutSubmit: F, selectShortcutWithText: I, getShortcutFromMessage: ee, buildShortcutProperty: te, sendShortcutDirectly: ne } = I3({
|
|
59338
59347
|
props: r,
|
|
59339
59348
|
emit: i,
|
|
59340
59349
|
chatHelper: m,
|
|
59341
59350
|
shortcutManager: S,
|
|
59342
59351
|
doSendMessage: O,
|
|
59343
59352
|
selectedShortcut: u
|
|
59344
|
-
}), { messageStatus: re, messageToolsStatus: ie, messages: ae, isMessagesLoading: oe, isGenerating: se, currentSession: le, isWelcomeState: ue, openingRemark: de, effectiveResources: fe, effectivePrompts: he, effectiveSkills: ge, effectiveSupportUpload: _e, chatbotStyle: ve, filteredShortcuts: ye } =
|
|
59353
|
+
}), { messageStatus: re, messageToolsStatus: ie, messages: ae, isMessagesLoading: oe, isGenerating: se, currentSession: le, isWelcomeState: ue, openingRemark: de, effectiveResources: fe, effectivePrompts: he, effectiveSkills: ge, effectiveSupportUpload: _e, chatbotStyle: ve, filteredShortcuts: ye } = w3({
|
|
59345
59354
|
props: r,
|
|
59346
59355
|
chatHelper: m,
|
|
59347
59356
|
chatBusinessManager: b,
|
|
@@ -59350,7 +59359,7 @@ var L3 = /* @__PURE__ */ V({
|
|
|
59350
59359
|
isStandaloneMode: h,
|
|
59351
59360
|
isInitialized: g,
|
|
59352
59361
|
selectedShortcut: u
|
|
59353
|
-
}), { handleAgentAction: be, handleAgentFeedback: L, handleUserAction: xe, handleUserInputConfirm: Se, handleUserShortcutConfirm: Ce, handleStopStreaming: we } =
|
|
59362
|
+
}), { handleAgentAction: be, handleAgentFeedback: L, handleUserAction: xe, handleUserInputConfirm: Se, handleUserShortcutConfirm: Ce, handleStopStreaming: we } = L3({
|
|
59354
59363
|
emit: i,
|
|
59355
59364
|
chatHelper: m,
|
|
59356
59365
|
chatBusinessManager: b,
|
|
@@ -59362,7 +59371,7 @@ var L3 = /* @__PURE__ */ V({
|
|
|
59362
59371
|
getRequestOptions: () => r.requestOptions
|
|
59363
59372
|
}), Te = Y(() => !g.value || oe.value), Ee = Y(() => {
|
|
59364
59373
|
if (r.useAgentName) return m.value?.agent.info.value?.agentName || void 0;
|
|
59365
|
-
}), { handleConfirmShare: De } =
|
|
59374
|
+
}), { handleConfirmShare: De } = F3({
|
|
59366
59375
|
emit: i,
|
|
59367
59376
|
chatHelper: m,
|
|
59368
59377
|
isStandaloneMode: h
|
|
@@ -59500,13 +59509,13 @@ var L3 = /* @__PURE__ */ V({
|
|
|
59500
59509
|
_: 3
|
|
59501
59510
|
}, 8, /* @__PURE__ */ "cite.selected-shortcut.render-mode.chat-loading.common-tippy-options.execution-tab-visible.message-status.message-tools-status.messages.model-value.on-agent-action.on-agent-feedback.on-interrupt-resume.get-side-render-component.get-side-tab-render-component.on-send-message.on-stop-sending.on-upload.on-user-action.on-user-input-confirm.on-user-shortcut-confirm.opening-remark.placeholder.placement.welcome-title.prompts.resize-props.resources.shortcut-id.shortcuts.skills.support-upload.onConfirmShare.onDeleteShortcut.onSelectShortcut.onShortcutClose.onShortcutSubmit.onStopStreaming.onUpdate:modelValue".split("."))], 6));
|
|
59502
59511
|
}
|
|
59503
|
-
}),
|
|
59512
|
+
}), z3 = /* @__PURE__ */ function(e) {
|
|
59504
59513
|
return e.ERROR = "error", e.IDLE = "idle", e.LOADING_AGENT = "loading_agent", e.READY = "ready", e;
|
|
59505
59514
|
}({});
|
|
59506
|
-
function
|
|
59515
|
+
function B3(e) {
|
|
59507
59516
|
let { url: t, requestOptions: n, autoInit: r = !0, protocolCallbacks: i } = e, a = en(t);
|
|
59508
59517
|
if (!a) throw Error("[useChatBootstrap] url is required");
|
|
59509
|
-
let o = /* @__PURE__ */ R(
|
|
59518
|
+
let o = /* @__PURE__ */ R(z3.IDLE), s = /* @__PURE__ */ R(null), c = /* @__PURE__ */ R(!1), l = /* @__PURE__ */ new Map(), u = new M2({
|
|
59510
59519
|
onStart: () => {
|
|
59511
59520
|
i?.onStart?.();
|
|
59512
59521
|
},
|
|
@@ -59519,19 +59528,19 @@ function z3(e) {
|
|
|
59519
59528
|
onError: (e) => {
|
|
59520
59529
|
i?.onError?.(e);
|
|
59521
59530
|
}
|
|
59522
|
-
}), d =
|
|
59523
|
-
requestData:
|
|
59531
|
+
}), d = m4({
|
|
59532
|
+
requestData: g4(a, n),
|
|
59524
59533
|
protocol: u
|
|
59525
59534
|
});
|
|
59526
59535
|
u.injectMessageModule(d.message);
|
|
59527
|
-
let f = Y(() => o.value ===
|
|
59536
|
+
let f = Y(() => o.value === z3.LOADING_AGENT), p = Y(() => o.value === z3.READY), m = Y(() => d.agent.info.value ?? null), h = Y(() => m.value?.agentName ?? ""), g = Y(() => d.session.current.value ?? null), _ = Y(() => d.session.list.value ?? []), v = null, y = 0, b = async (e) => {
|
|
59528
59537
|
s.value = null;
|
|
59529
59538
|
try {
|
|
59530
|
-
if (o.value =
|
|
59531
|
-
o.value =
|
|
59539
|
+
if (o.value = z3.LOADING_AGENT, await f3(d), e !== y) return;
|
|
59540
|
+
o.value = z3.READY, c.value = !0;
|
|
59532
59541
|
} catch (t) {
|
|
59533
59542
|
if (e !== y) return;
|
|
59534
|
-
throw console.error("[useChatBootstrap] Initialization failed:", t), s.value = t, o.value =
|
|
59543
|
+
throw console.error("[useChatBootstrap] Initialization failed:", t), s.value = t, o.value = z3.ERROR, t;
|
|
59535
59544
|
}
|
|
59536
59545
|
}, x = async () => {
|
|
59537
59546
|
if (c.value) return;
|
|
@@ -59541,7 +59550,7 @@ function z3(e) {
|
|
|
59541
59550
|
e === y && (v = null);
|
|
59542
59551
|
}), v;
|
|
59543
59552
|
}, S = () => {
|
|
59544
|
-
y += 1, o.value =
|
|
59553
|
+
y += 1, o.value = z3.IDLE, s.value = null, c.value = !1, v = null;
|
|
59545
59554
|
}, C = async () => {
|
|
59546
59555
|
S(), await x();
|
|
59547
59556
|
}, w = async (e) => {
|
|
@@ -59575,7 +59584,7 @@ function z3(e) {
|
|
|
59575
59584
|
}
|
|
59576
59585
|
//#endregion
|
|
59577
59586
|
//#region src/composables/use-event-bridge.ts
|
|
59578
|
-
function
|
|
59587
|
+
function V3(e) {
|
|
59579
59588
|
return {
|
|
59580
59589
|
sendMessage: (t) => e("send-message", { content: t }),
|
|
59581
59590
|
receiveStart: () => e("receive-start", {}),
|
|
@@ -59593,12 +59602,12 @@ function B3(e) {
|
|
|
59593
59602
|
shareMessages: (t) => e("share-messages", { messageIds: t })
|
|
59594
59603
|
};
|
|
59595
59604
|
}
|
|
59596
|
-
function
|
|
59605
|
+
function H3(e) {
|
|
59597
59606
|
let { componentManager: t, emit: n, debug: r = !1 } = e, i = [], a = () => {
|
|
59598
|
-
for (let [e, a] of Object.entries(
|
|
59607
|
+
for (let [e, a] of Object.entries(y3)) {
|
|
59599
59608
|
if (a === null) continue;
|
|
59600
59609
|
let o = t.on(e, (t) => {
|
|
59601
|
-
let i =
|
|
59610
|
+
let i = b3(e, t);
|
|
59602
59611
|
r && console.debug(`[useEventBridge] ${e} -> ${a}`, i), n(a, ...i);
|
|
59603
59612
|
});
|
|
59604
59613
|
i.push(o);
|
|
@@ -59620,22 +59629,22 @@ function V3(e) {
|
|
|
59620
59629
|
}
|
|
59621
59630
|
//#endregion
|
|
59622
59631
|
//#region src/composables/use-ai-blueking-init.ts
|
|
59623
|
-
function
|
|
59624
|
-
let { props: t, emit: n } = e, r = /* @__PURE__ */ R(), i = /* @__PURE__ */ R(), a = Y(() =>
|
|
59632
|
+
function U3(e) {
|
|
59633
|
+
let { props: t, emit: n } = e, r = /* @__PURE__ */ R(), i = /* @__PURE__ */ R(), a = Y(() => E4(t.url ?? "")), o = v3({
|
|
59625
59634
|
initialPanelVisible: !1,
|
|
59626
59635
|
initialNimbusMinimized: t.defaultMinimize,
|
|
59627
59636
|
enablePopup: t.enablePopup,
|
|
59628
59637
|
enableNimbus: !t.hideNimbus,
|
|
59629
59638
|
enableDraggable: t.draggable
|
|
59630
|
-
}), s = o.panelVisible, c = o.nimbusMinimized, { forwardToManager: l } =
|
|
59639
|
+
}), s = o.panelVisible, c = o.nimbusMinimized, { forwardToManager: l } = H3({
|
|
59631
59640
|
componentManager: o,
|
|
59632
59641
|
emit: n
|
|
59633
|
-
}), u =
|
|
59642
|
+
}), u = V3(l), d = /* @__PURE__ */ new WeakSet(), f = null, p = null, m = () => {
|
|
59634
59643
|
f &&= (clearTimeout(f.timer), null);
|
|
59635
59644
|
}, h = (e) => {
|
|
59636
59645
|
let { apiName: n, error: r, action: i, source: a, shouldToast: s = !0 } = e, c = r instanceof Error ? r.message : String(r), l = r instanceof Error ? r : null;
|
|
59637
59646
|
l && d.has(l) || (l && d.add(l), a !== "http" && l && f?.error === l && m(), console.error(`[AIBlueking] ${n} error:`, r), s && t.errorToast !== !1 && eN({
|
|
59638
|
-
message: c ||
|
|
59647
|
+
message: c || F4("请求失败"),
|
|
59639
59648
|
theme: "error"
|
|
59640
59649
|
}), o.emitInternal("sdk-error", {
|
|
59641
59650
|
apiName: n,
|
|
@@ -59672,7 +59681,7 @@ function H3(e) {
|
|
|
59672
59681
|
error: e,
|
|
59673
59682
|
source: "business"
|
|
59674
59683
|
});
|
|
59675
|
-
}, { chatHelper: y, isReady: b, error: x, agentInfo: S, agentName: C, currentSession: w, initialize: T } =
|
|
59684
|
+
}, { chatHelper: y, isReady: b, error: x, agentInfo: S, agentName: C, currentSession: w, initialize: T } = B3({
|
|
59676
59685
|
url: a,
|
|
59677
59686
|
requestOptions: () => en(t.requestOptions),
|
|
59678
59687
|
autoInit: !0,
|
|
@@ -59698,11 +59707,11 @@ function H3(e) {
|
|
|
59698
59707
|
E.onError?.((e) => {
|
|
59699
59708
|
g(e);
|
|
59700
59709
|
}, { ignoreErrors: t.ignoreErrors });
|
|
59701
|
-
let D = new
|
|
59710
|
+
let D = new m3(E.session, E.agent, null, {
|
|
59702
59711
|
enableChatSession: t.enableChatSession,
|
|
59703
59712
|
initialSessionCode: t.initialSessionCode,
|
|
59704
59713
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
59705
|
-
}, E.message), O = new
|
|
59714
|
+
}, E.message), O = new h3(E.message, E.session), k = new g3(null, t.shortcuts || []), A = null, j = () => t.loadRecentSessionOnMount ? (A ||= D.loadRecentSession({ skipLoadSessions: !0 }).finally(() => {
|
|
59706
59715
|
A = null;
|
|
59707
59716
|
}), A) : Promise.resolve(), M = async () => {
|
|
59708
59717
|
await _("init", async () => {
|
|
@@ -59752,7 +59761,7 @@ function H3(e) {
|
|
|
59752
59761
|
k.setShortcuts(e || []);
|
|
59753
59762
|
}, { immediate: !0 });
|
|
59754
59763
|
let ae = (e) => {
|
|
59755
|
-
|
|
59764
|
+
j4(e) && (e.preventDefault(), s.value ? o.hidePanel() : o.showPanel());
|
|
59756
59765
|
};
|
|
59757
59766
|
return Kr(async () => {
|
|
59758
59767
|
r.value && o.setContainerRef(r.value), window.addEventListener("keydown", ae);
|
|
@@ -59788,7 +59797,7 @@ function H3(e) {
|
|
|
59788
59797
|
}
|
|
59789
59798
|
//#endregion
|
|
59790
59799
|
//#region src/composables/use-ai-selection.ts
|
|
59791
|
-
function
|
|
59800
|
+
function W3(e) {
|
|
59792
59801
|
let { shortcutManager: t, chatBotRef: n, forwardToManager: r, show: i, props: a } = e, o = /* @__PURE__ */ R(!1), s = /* @__PURE__ */ R("");
|
|
59793
59802
|
return {
|
|
59794
59803
|
aiSelectionVisible: o,
|
|
@@ -59810,7 +59819,7 @@ function U3(e) {
|
|
|
59810
59819
|
}
|
|
59811
59820
|
//#endregion
|
|
59812
59821
|
//#region src/composables/use-nimbus.ts
|
|
59813
|
-
function
|
|
59822
|
+
function G3(e, t = !1) {
|
|
59814
59823
|
let n = window.innerHeight - 48 - 40, r = window.innerWidth - 48 - 16, i = /* @__PURE__ */ R(r), a = /* @__PURE__ */ R(n), o = /* @__PURE__ */ R(0), s = /* @__PURE__ */ R(t), c = /* @__PURE__ */ R(!1), l = /* @__PURE__ */ R(!1), u = 0, d = (e) => {
|
|
59815
59824
|
e ? i.value = window.innerWidth - 12 : i.value = r;
|
|
59816
59825
|
}, f = (e, t) => {
|
|
@@ -59863,8 +59872,8 @@ function W3(e, t = !1) {
|
|
|
59863
59872
|
}
|
|
59864
59873
|
//#endregion
|
|
59865
59874
|
//#region src/composables/use-panel-container.ts
|
|
59866
|
-
var
|
|
59867
|
-
function
|
|
59875
|
+
var K3 = 420;
|
|
59876
|
+
function q3(e) {
|
|
59868
59877
|
let { componentManager: t, chatBotRef: n, forwarders: r, forwardToManager: i, beforeNimbusClick: a, ensureSessionReady: o } = e, s = async (e) => {
|
|
59869
59878
|
t.showPanel(e), o && await o(), e && n.value && await n.value.switchSession(e);
|
|
59870
59879
|
}, c = async (e) => {
|
|
@@ -59905,7 +59914,7 @@ function K3(e) {
|
|
|
59905
59914
|
t.setCompressed(e);
|
|
59906
59915
|
},
|
|
59907
59916
|
handleExecutionPanelChange: (e) => {
|
|
59908
|
-
e ? t.collapseSidePanel() : t.expandForSidePanel(
|
|
59917
|
+
e ? t.collapseSidePanel() : t.expandForSidePanel(K3);
|
|
59909
59918
|
},
|
|
59910
59919
|
sendMessage: async (e) => {
|
|
59911
59920
|
n.value && await n.value.sendMessage(e);
|
|
@@ -59952,8 +59961,8 @@ function K3(e) {
|
|
|
59952
59961
|
}
|
|
59953
59962
|
//#endregion
|
|
59954
59963
|
//#region src/composables/use-session-handlers.ts
|
|
59955
|
-
function
|
|
59956
|
-
let { chatHelper: t, sessionBusinessManager: n, chatBotRef: r, forwarders: i, reportSdkError: a, currentSession: o } = e, s = /* @__PURE__ */ R(""), c = /* @__PURE__ */ R(!0), l = /* @__PURE__ */ R(!1), u = /* @__PURE__ */ R(!1), d = () =>
|
|
59964
|
+
function J3(e) {
|
|
59965
|
+
let { chatHelper: t, sessionBusinessManager: n, chatBotRef: r, forwarders: i, reportSdkError: a, currentSession: o } = e, s = /* @__PURE__ */ R(""), c = /* @__PURE__ */ R(!0), l = /* @__PURE__ */ R(!1), u = /* @__PURE__ */ R(!1), d = () => b4(t.message.list.value);
|
|
59957
59966
|
return Qn(() => o.value, (e) => {
|
|
59958
59967
|
e && (s.value = e.sessionName || "", l.value = (e.sessionContentCount ?? 0) > 0 || d());
|
|
59959
59968
|
}, { immediate: !0 }), Qn(() => t.message.list.value.length, () => {
|
|
@@ -60080,7 +60089,7 @@ function q3(e) {
|
|
|
60080
60089
|
}
|
|
60081
60090
|
//#endregion
|
|
60082
60091
|
//#region src/composables/use-share-handlers.ts
|
|
60083
|
-
function
|
|
60092
|
+
function Y3(e) {
|
|
60084
60093
|
let { shareBusinessManager: t, chatBotRef: n, forwarders: r, reportSdkError: i } = e, a = /* @__PURE__ */ R(!1);
|
|
60085
60094
|
return {
|
|
60086
60095
|
isShareLoading: a,
|
|
@@ -60094,8 +60103,8 @@ function J3(e) {
|
|
|
60094
60103
|
a.value = !0;
|
|
60095
60104
|
try {
|
|
60096
60105
|
let { shareUrl: i, userMessageIds: a } = await t.shareMessages(e);
|
|
60097
|
-
await
|
|
60098
|
-
message:
|
|
60106
|
+
await D4(i), eN({
|
|
60107
|
+
message: F4("分享链接已复制到剪贴板"),
|
|
60099
60108
|
theme: "success"
|
|
60100
60109
|
}), n.value?.exitShareMode(), r.shareMessages(a);
|
|
60101
60110
|
} catch (e) {
|
|
@@ -60113,7 +60122,7 @@ function J3(e) {
|
|
|
60113
60122
|
}
|
|
60114
60123
|
//#endregion
|
|
60115
60124
|
//#region src/composables/use-tippy.ts
|
|
60116
|
-
function
|
|
60125
|
+
function X3(e = {}) {
|
|
60117
60126
|
let t = /* @__PURE__ */ R([]), n = (n, r, i = {}) => {
|
|
60118
60127
|
try {
|
|
60119
60128
|
let a = typeof n == "string" ? document.querySelector(n) : n;
|
|
@@ -60166,7 +60175,7 @@ function Y3(e = {}) {
|
|
|
60166
60175
|
}
|
|
60167
60176
|
//#endregion
|
|
60168
60177
|
//#region src/config/prop-defaults.ts
|
|
60169
|
-
var
|
|
60178
|
+
var Z3 = {
|
|
60170
60179
|
url: "",
|
|
60171
60180
|
title: "",
|
|
60172
60181
|
extCls: "",
|
|
@@ -60191,7 +60200,7 @@ var X3 = {
|
|
|
60191
60200
|
requestOptions: () => ({}),
|
|
60192
60201
|
teleportTo: "body",
|
|
60193
60202
|
placeholder: void 0,
|
|
60194
|
-
helloText:
|
|
60203
|
+
helloText: F4("你好,我是小鲸"),
|
|
60195
60204
|
useAgentName: !1,
|
|
60196
60205
|
disabledInput: !1,
|
|
60197
60206
|
showHistoryIcon: !0,
|
|
@@ -60211,7 +60220,7 @@ var X3 = {
|
|
|
60211
60220
|
defaultChatInputPosition: void 0,
|
|
60212
60221
|
errorToast: !0,
|
|
60213
60222
|
ignoreErrors: () => []
|
|
60214
|
-
},
|
|
60223
|
+
}, Q3 = class extends M2 {
|
|
60215
60224
|
eventEmitter;
|
|
60216
60225
|
constructor(e = {}) {
|
|
60217
60226
|
super({
|
|
@@ -60240,7 +60249,7 @@ var X3 = {
|
|
|
60240
60249
|
super.handleToolCallStartEvent(e), this.eventEmitter?.emit("tool-call-start", { event: e });
|
|
60241
60250
|
}
|
|
60242
60251
|
};
|
|
60243
|
-
function
|
|
60252
|
+
function $3(e = {}) {
|
|
60244
60253
|
let { eventEmitter: t, onStart: n, onMessage: r, onDone: i, onError: a, onTextChunk: o } = e;
|
|
60245
60254
|
return new M2({
|
|
60246
60255
|
onStart: () => {
|
|
@@ -60259,31 +60268,31 @@ function Q3(e = {}) {
|
|
|
60259
60268
|
}
|
|
60260
60269
|
//#endregion
|
|
60261
60270
|
//#region ../../node_modules/.pnpm/vue-draggable-resizable@3.0.0_vue@3.5.32_typescript@5.9.3_/node_modules/vue-draggable-resizable/dist/vue-draggable-resizable.js
|
|
60262
|
-
function
|
|
60271
|
+
function e6(e) {
|
|
60263
60272
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
|
|
60264
60273
|
}
|
|
60265
|
-
function
|
|
60274
|
+
function t6(e, t, n, r = 1) {
|
|
60266
60275
|
let [i, a] = typeof r == "number" ? [r, r] : r;
|
|
60267
60276
|
return [Math.round(t / i / e[0]) * e[0], Math.round(n / a / e[1]) * e[1]];
|
|
60268
60277
|
}
|
|
60269
|
-
function t6(e, t, n) {
|
|
60270
|
-
return e - t - n;
|
|
60271
|
-
}
|
|
60272
60278
|
function n6(e, t, n) {
|
|
60273
60279
|
return e - t - n;
|
|
60274
60280
|
}
|
|
60275
60281
|
function r6(e, t, n) {
|
|
60276
|
-
return
|
|
60282
|
+
return e - t - n;
|
|
60277
60283
|
}
|
|
60278
60284
|
function i6(e, t, n) {
|
|
60285
|
+
return t !== null && e < t ? t : n !== null && n < e ? n : e;
|
|
60286
|
+
}
|
|
60287
|
+
function a6(e, t, n) {
|
|
60279
60288
|
let r = e, i = [
|
|
60280
60289
|
"matches",
|
|
60281
60290
|
"webkitMatchesSelector",
|
|
60282
60291
|
"mozMatchesSelector",
|
|
60283
60292
|
"msMatchesSelector",
|
|
60284
60293
|
"oMatchesSelector"
|
|
60285
|
-
].find((e) =>
|
|
60286
|
-
if (
|
|
60294
|
+
].find((e) => e6(r[e]));
|
|
60295
|
+
if (!e6(r[i])) return !1;
|
|
60287
60296
|
do {
|
|
60288
60297
|
if (r[i](t)) return !0;
|
|
60289
60298
|
if (r === n) return !1;
|
|
@@ -60291,21 +60300,21 @@ function i6(e, t, n) {
|
|
|
60291
60300
|
} while (r);
|
|
60292
60301
|
return !1;
|
|
60293
60302
|
}
|
|
60294
|
-
function
|
|
60303
|
+
function o6(e) {
|
|
60295
60304
|
let t = window.getComputedStyle(e);
|
|
60296
60305
|
return [parseFloat(t.getPropertyValue("width"), 10), parseFloat(t.getPropertyValue("height"), 10)];
|
|
60297
60306
|
}
|
|
60298
|
-
function
|
|
60307
|
+
function s6(e, t, n) {
|
|
60299
60308
|
e && (e.attachEvent ? e.attachEvent("on" + t, n) : e.addEventListener ? e.addEventListener(t, n, !0) : e["on" + t] = n);
|
|
60300
60309
|
}
|
|
60301
|
-
function
|
|
60310
|
+
function c6(e, t, n) {
|
|
60302
60311
|
e && (e.detachEvent ? e.detachEvent("on" + t, n) : e.removeEventListener ? e.removeEventListener(t, n, !0) : e["on" + t] = null);
|
|
60303
60312
|
}
|
|
60304
|
-
var
|
|
60313
|
+
var l6 = (e, t) => {
|
|
60305
60314
|
let n = e.__vccOpts || e;
|
|
60306
60315
|
for (let [e, r] of t) n[e] = r;
|
|
60307
60316
|
return n;
|
|
60308
|
-
},
|
|
60317
|
+
}, u6 = {
|
|
60309
60318
|
mouse: {
|
|
60310
60319
|
start: "mousedown",
|
|
60311
60320
|
move: "mousemove",
|
|
@@ -60316,17 +60325,17 @@ var c6 = (e, t) => {
|
|
|
60316
60325
|
move: "touchmove",
|
|
60317
60326
|
stop: "touchend"
|
|
60318
60327
|
}
|
|
60319
|
-
},
|
|
60328
|
+
}, d6 = {
|
|
60320
60329
|
userSelect: "none",
|
|
60321
60330
|
MozUserSelect: "none",
|
|
60322
60331
|
WebkitUserSelect: "none",
|
|
60323
60332
|
MsUserSelect: "none"
|
|
60324
|
-
},
|
|
60333
|
+
}, f6 = {
|
|
60325
60334
|
userSelect: "auto",
|
|
60326
60335
|
MozUserSelect: "auto",
|
|
60327
60336
|
WebkitUserSelect: "auto",
|
|
60328
60337
|
MsUserSelect: "auto"
|
|
60329
|
-
},
|
|
60338
|
+
}, p6 = u6.mouse, m6 = {
|
|
60330
60339
|
replace: !0,
|
|
60331
60340
|
name: "vue-draggable-resizable",
|
|
60332
60341
|
props: {
|
|
@@ -60531,11 +60540,11 @@ var c6 = (e, t) => {
|
|
|
60531
60540
|
this.enableNativeDrag || (this.$el.ondragstart = () => !1);
|
|
60532
60541
|
let [e, t] = this.getParentSize();
|
|
60533
60542
|
this.parentWidth = e, this.parentHeight = t;
|
|
60534
|
-
let [n, r] =
|
|
60535
|
-
this.aspectFactor = (this.w === "auto" ? n : this.w) / (this.h === "auto" ? r : this.h), this.width = this.w === "auto" ? n : this.w, this.height = this.h === "auto" ? r : this.h, this.right = this.parentWidth - this.width - this.left, this.bottom = this.parentHeight - this.height - this.top, this.active && this.$emit("activated"),
|
|
60543
|
+
let [n, r] = o6(this.$el);
|
|
60544
|
+
this.aspectFactor = (this.w === "auto" ? n : this.w) / (this.h === "auto" ? r : this.h), this.width = this.w === "auto" ? n : this.w, this.height = this.h === "auto" ? r : this.h, this.right = this.parentWidth - this.width - this.left, this.bottom = this.parentHeight - this.height - this.top, this.active && this.$emit("activated"), s6(document.documentElement, "mousedown", this.deselect), s6(document.documentElement, "touchend touchcancel", this.deselect), s6(window, "resize", this.checkParentSize);
|
|
60536
60545
|
},
|
|
60537
60546
|
beforeUnmount: function() {
|
|
60538
|
-
|
|
60547
|
+
c6(document.documentElement, "mousedown", this.deselect), c6(document.documentElement, "touchstart", this.handleUp), c6(document.documentElement, "mousemove", this.move), c6(document.documentElement, "touchmove", this.move), c6(document.documentElement, "mouseup", this.handleUp), c6(document.documentElement, "touchend touchcancel", this.deselect), c6(window, "resize", this.checkParentSize);
|
|
60539
60548
|
},
|
|
60540
60549
|
methods: {
|
|
60541
60550
|
resetBoundsAndMouseState() {
|
|
@@ -60571,21 +60580,21 @@ var c6 = (e, t) => {
|
|
|
60571
60580
|
return [null, null];
|
|
60572
60581
|
},
|
|
60573
60582
|
elementTouchDown(e) {
|
|
60574
|
-
|
|
60583
|
+
p6 = u6.touch, this.elementDown(e);
|
|
60575
60584
|
},
|
|
60576
60585
|
elementMouseDown(e) {
|
|
60577
|
-
|
|
60586
|
+
p6 = u6.mouse, this.elementDown(e);
|
|
60578
60587
|
},
|
|
60579
60588
|
elementDown(e) {
|
|
60580
60589
|
if (e instanceof MouseEvent && e.button !== 0) return;
|
|
60581
60590
|
let t = e.target || e.srcElement;
|
|
60582
60591
|
if (this.$el.contains(t)) {
|
|
60583
60592
|
if (this.onDragStart(e) === !1) return;
|
|
60584
|
-
if (this.dragHandle && !
|
|
60593
|
+
if (this.dragHandle && !a6(t, this.dragHandle, this.$el) || this.dragCancel && a6(t, this.dragCancel, this.$el)) {
|
|
60585
60594
|
this.dragging = !1;
|
|
60586
60595
|
return;
|
|
60587
60596
|
}
|
|
60588
|
-
this.enabled || (this.enabled = !0, this.$emit("activated"), this.$emit("update:active", !0)), this.draggable && (this.dragEnable = !0), this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX, this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY, this.mouseClickPosition.left = this.left, this.mouseClickPosition.right = this.right, this.mouseClickPosition.top = this.top, this.mouseClickPosition.bottom = this.bottom, this.parent && (this.bounds = this.calcDragLimits()),
|
|
60597
|
+
this.enabled || (this.enabled = !0, this.$emit("activated"), this.$emit("update:active", !0)), this.draggable && (this.dragEnable = !0), this.mouseClickPosition.mouseX = e.touches ? e.touches[0].pageX : e.pageX, this.mouseClickPosition.mouseY = e.touches ? e.touches[0].pageY : e.pageY, this.mouseClickPosition.left = this.left, this.mouseClickPosition.right = this.right, this.mouseClickPosition.top = this.top, this.mouseClickPosition.bottom = this.bottom, this.parent && (this.bounds = this.calcDragLimits()), s6(document.documentElement, p6.move, this.move), s6(document.documentElement, p6.stop, this.handleUp);
|
|
60589
60598
|
}
|
|
60590
60599
|
},
|
|
60591
60600
|
calcDragLimits() {
|
|
@@ -60602,13 +60611,13 @@ var c6 = (e, t) => {
|
|
|
60602
60611
|
},
|
|
60603
60612
|
deselect(e) {
|
|
60604
60613
|
let t = e.target || e.srcElement, n = RegExp(this.className + "-([trmbl]{2})", "");
|
|
60605
|
-
!this.$el.contains(t) && !n.test(t.className) && (this.enabled && !this.preventDeactivation && (this.enabled = !1, this.$emit("deactivated"), this.$emit("update:active", !1)),
|
|
60614
|
+
!this.$el.contains(t) && !n.test(t.className) && (this.enabled && !this.preventDeactivation && (this.enabled = !1, this.$emit("deactivated"), this.$emit("update:active", !1)), c6(document.documentElement, p6.move, this.handleResize)), this.resetBoundsAndMouseState();
|
|
60606
60615
|
},
|
|
60607
60616
|
handleTouchDown(e, t) {
|
|
60608
|
-
|
|
60617
|
+
p6 = u6.touch, this.handleDown(e, t);
|
|
60609
60618
|
},
|
|
60610
60619
|
handleDown(e, t) {
|
|
60611
|
-
t instanceof MouseEvent && t.which !== 1 || this.onResizeStart(e, t) !== !1 && (t.stopPropagation && t.stopPropagation(), this.lockAspectRatio && !e.includes("m") ? this.handle = "m" + e.substring(1) : this.handle = e, this.resizeEnable = !0, this.mouseClickPosition.mouseX = t.touches ? t.touches[0].pageX : t.pageX, this.mouseClickPosition.mouseY = t.touches ? t.touches[0].pageY : t.pageY, this.mouseClickPosition.left = this.left, this.mouseClickPosition.right = this.right, this.mouseClickPosition.top = this.top, this.mouseClickPosition.bottom = this.bottom, this.bounds = this.calcResizeLimits(),
|
|
60620
|
+
t instanceof MouseEvent && t.which !== 1 || this.onResizeStart(e, t) !== !1 && (t.stopPropagation && t.stopPropagation(), this.lockAspectRatio && !e.includes("m") ? this.handle = "m" + e.substring(1) : this.handle = e, this.resizeEnable = !0, this.mouseClickPosition.mouseX = t.touches ? t.touches[0].pageX : t.pageX, this.mouseClickPosition.mouseY = t.touches ? t.touches[0].pageY : t.pageY, this.mouseClickPosition.left = this.left, this.mouseClickPosition.right = this.right, this.mouseClickPosition.top = this.top, this.mouseClickPosition.bottom = this.bottom, this.bounds = this.calcResizeLimits(), s6(document.documentElement, p6.move, this.handleResize), s6(document.documentElement, p6.stop, this.handleUp));
|
|
60612
60621
|
},
|
|
60613
60622
|
calcResizeLimits() {
|
|
60614
60623
|
let e = this.minW, t = this.minH, n = this.maxW, r = this.maxH, i = this.aspectFactor, [a, o] = this.grid, s = this.width, c = this.height, l = this.left, u = this.top, d = this.right, f = this.bottom;
|
|
@@ -60629,41 +60638,41 @@ var c6 = (e, t) => {
|
|
|
60629
60638
|
this.resizing ? this.handleResize(e) : this.dragEnable && this.handleDrag(e);
|
|
60630
60639
|
},
|
|
60631
60640
|
handleDrag(e) {
|
|
60632
|
-
let t = this.axis, n = this.grid, r = this.bounds, i = this.mouseClickPosition, [a, o] =
|
|
60641
|
+
let t = this.axis, n = this.grid, r = this.bounds, i = this.mouseClickPosition, [a, o] = t6(n, t && t !== "y" ? i.mouseX - (e.touches ? e.touches[0].pageX : e.pageX) : 0, t && t !== "x" ? i.mouseY - (e.touches ? e.touches[0].pageY : e.pageY) : 0, this.scale), s = i6(i.left - a, r.minLeft, r.maxLeft), c = i6(i.top - o, r.minTop, r.maxTop);
|
|
60633
60642
|
if (this.onDrag(s, c) === !1) return;
|
|
60634
|
-
let l =
|
|
60643
|
+
let l = i6(i.right + a, r.minRight, r.maxRight), u = i6(i.bottom + o, r.minBottom, r.maxBottom);
|
|
60635
60644
|
this.left = s, this.top = c, this.right = l, this.bottom = u, this.$emit("dragging", this.left, this.top), this.dragging = !0;
|
|
60636
60645
|
},
|
|
60637
60646
|
moveHorizontally(e) {
|
|
60638
|
-
let [t, n] =
|
|
60647
|
+
let [t, n] = t6(this.grid, e, this.top, 1), r = i6(t, this.bounds.minLeft, this.bounds.maxLeft);
|
|
60639
60648
|
this.left = r, this.right = this.parentWidth - this.width - r;
|
|
60640
60649
|
},
|
|
60641
60650
|
moveVertically(e) {
|
|
60642
|
-
let [t, n] =
|
|
60651
|
+
let [t, n] = t6(this.grid, this.left, e, 1), r = i6(n, this.bounds.minTop, this.bounds.maxTop);
|
|
60643
60652
|
this.top = r, this.bottom = this.parentHeight - this.height - r;
|
|
60644
60653
|
},
|
|
60645
60654
|
handleResize(e) {
|
|
60646
60655
|
let t = this.left, n = this.top, r = this.right, i = this.bottom, a = this.mouseClickPosition, o = this.aspectFactor, s = a.mouseX - (e.touches ? e.touches[0].pageX : e.pageX), c = a.mouseY - (e.touches ? e.touches[0].pageY : e.pageY);
|
|
60647
60656
|
!this.widthTouched && s && (this.widthTouched = !0), !this.heightTouched && c && (this.heightTouched = !0);
|
|
60648
|
-
let [l, u] =
|
|
60649
|
-
this.handle.includes("b") ? (i =
|
|
60650
|
-
let d =
|
|
60657
|
+
let [l, u] = t6(this.grid, s, c, this.scale);
|
|
60658
|
+
this.handle.includes("b") ? (i = i6(a.bottom + u, this.bounds.minBottom, this.bounds.maxBottom), this.lockAspectRatio && this.resizingOnY && (r = this.right - (this.bottom - i) * o)) : this.handle.includes("t") && (n = i6(a.top - u, this.bounds.minTop, this.bounds.maxTop), this.lockAspectRatio && this.resizingOnY && (t = this.left - (this.top - n) * o)), this.handle.includes("r") ? (r = i6(a.right + l, this.bounds.minRight, this.bounds.maxRight), this.lockAspectRatio && this.resizingOnX && (i = this.bottom - (this.right - r) / o)) : this.handle.includes("l") && (t = i6(a.left - l, this.bounds.minLeft, this.bounds.maxLeft), this.lockAspectRatio && this.resizingOnX && (n = this.top - (this.left - t) / o));
|
|
60659
|
+
let d = n6(this.parentWidth, t, r), f = r6(this.parentHeight, n, i);
|
|
60651
60660
|
this.onResize(this.handle, t, n, d, f) !== !1 && (this.left = t, this.top = n, this.right = r, this.bottom = i, this.width = d, this.height = f, this.$emit("resizing", this.left, this.top, this.width, this.height), this.resizing = !0);
|
|
60652
60661
|
},
|
|
60653
60662
|
changeWidth(e) {
|
|
60654
|
-
let [t, n] =
|
|
60663
|
+
let [t, n] = t6(this.grid, e, 0, 1), r = i6(this.parentWidth - t - this.left, this.bounds.minRight, this.bounds.maxRight), i = this.bottom;
|
|
60655
60664
|
this.lockAspectRatio && (i = this.bottom - (this.right - r) / this.aspectFactor);
|
|
60656
|
-
let a =
|
|
60665
|
+
let a = n6(this.parentWidth, this.left, r), o = r6(this.parentHeight, this.top, i);
|
|
60657
60666
|
this.right = r, this.bottom = i, this.width = a, this.height = o;
|
|
60658
60667
|
},
|
|
60659
60668
|
changeHeight(e) {
|
|
60660
|
-
let [t, n] =
|
|
60669
|
+
let [t, n] = t6(this.grid, 0, e, 1), r = i6(this.parentHeight - n - this.top, this.bounds.minBottom, this.bounds.maxBottom), i = this.right;
|
|
60661
60670
|
this.lockAspectRatio && (i = this.right - (this.bottom - r) * this.aspectFactor);
|
|
60662
|
-
let a =
|
|
60671
|
+
let a = n6(this.parentWidth, this.left, i), o = r6(this.parentHeight, this.top, r);
|
|
60663
60672
|
this.right = i, this.bottom = r, this.width = a, this.height = o;
|
|
60664
60673
|
},
|
|
60665
60674
|
handleUp(e) {
|
|
60666
|
-
this.handle = null, this.resetBoundsAndMouseState(), this.dragEnable = !1, this.resizeEnable = !1, this.resizing && (this.resizing = !1, this.$emit("resizeStop", this.left, this.top, this.width, this.height)), this.dragging && (this.dragging = !1, this.$emit("dragStop", this.left, this.top)),
|
|
60675
|
+
this.handle = null, this.resetBoundsAndMouseState(), this.dragEnable = !1, this.resizeEnable = !1, this.resizing && (this.resizing = !1, this.$emit("resizeStop", this.left, this.top, this.width, this.height)), this.dragging && (this.dragging = !1, this.$emit("dragStop", this.left, this.top)), c6(document.documentElement, p6.move, this.handleResize);
|
|
60667
60676
|
}
|
|
60668
60677
|
},
|
|
60669
60678
|
computed: {
|
|
@@ -60673,7 +60682,7 @@ var c6 = (e, t) => {
|
|
|
60673
60682
|
width: this.computedWidth,
|
|
60674
60683
|
height: this.computedHeight,
|
|
60675
60684
|
zIndex: this.zIndex,
|
|
60676
|
-
...this.dragging && this.disableUserSelect ?
|
|
60685
|
+
...this.dragging && this.disableUserSelect ? d6 : f6
|
|
60677
60686
|
};
|
|
60678
60687
|
},
|
|
60679
60688
|
actualHandles() {
|
|
@@ -60735,8 +60744,8 @@ var c6 = (e, t) => {
|
|
|
60735
60744
|
this.resizing || this.dragging || (this.parent && (this.bounds = this.calcResizeLimits()), this.changeHeight(e));
|
|
60736
60745
|
}
|
|
60737
60746
|
}
|
|
60738
|
-
},
|
|
60739
|
-
function
|
|
60747
|
+
}, h6 = ["onMousedown", "onTouchstart"];
|
|
60748
|
+
function g6(e, t, n, r, i, a) {
|
|
60740
60749
|
return U(), W("div", {
|
|
60741
60750
|
style: ce(a.style),
|
|
60742
60751
|
class: pe([{
|
|
@@ -60754,17 +60763,17 @@ function h6(e, t, n, r, i, a) {
|
|
|
60754
60763
|
style: ce({ display: e.enabled ? "block" : "none" }),
|
|
60755
60764
|
onMousedown: zs((e) => a.handleDown(t, e), ["stop", "prevent"]),
|
|
60756
60765
|
onTouchstart: zs((e) => a.handleTouchDown(t, e), ["stop", "prevent"])
|
|
60757
|
-
}, [ui(e.$slots, t)], 46,
|
|
60766
|
+
}, [ui(e.$slots, t)], 46, h6))), 128)), ui(e.$slots, "default")], 38);
|
|
60758
60767
|
}
|
|
60759
|
-
var
|
|
60760
|
-
function
|
|
60761
|
-
|
|
60768
|
+
var _6 = /* @__PURE__ */ l6(m6, [["render", g6]]);
|
|
60769
|
+
function v6(e) {
|
|
60770
|
+
v6.installed || (v6.installed = !0, e.component("VueDraggableResizable", _6));
|
|
60762
60771
|
}
|
|
60763
|
-
var
|
|
60764
|
-
typeof window < "u" ?
|
|
60772
|
+
var y6 = { install: v6 }, b6 = null;
|
|
60773
|
+
typeof window < "u" ? b6 = window.Vue : typeof global < "u" && (b6 = global.Vue), b6 && b6.use(y6);
|
|
60765
60774
|
//#endregion
|
|
60766
60775
|
//#region src/containers/use-draggable.ts
|
|
60767
|
-
function
|
|
60776
|
+
function x6(e = {}, t) {
|
|
60768
60777
|
let n = e.initWidth || 400, r = e.minWidth || 400, i = e.minHeight || 400, a = e.maxWidthPercent || 40, o = e.compressedHeight || 800, s = e.compressedPadding === void 0 ? 0 : e.compressedPadding, c = /* @__PURE__ */ R(e.defaultLeft === void 0 ? window.innerWidth - n : e.defaultLeft), l = /* @__PURE__ */ R(e.defaultTop === void 0 ? 0 : e.defaultTop), u = /* @__PURE__ */ R(e.defaultHeight === void 0 ? window.innerHeight - (e.defaultTop === void 0 ? 0 : e.defaultTop) : e.defaultHeight), d = /* @__PURE__ */ R(n), f = /* @__PURE__ */ R(l.value), p = /* @__PURE__ */ R(c.value), m = /* @__PURE__ */ R(d.value), h = /* @__PURE__ */ R(u.value), g = /* @__PURE__ */ R(Math.max(window.innerWidth * (a / 100), m.value)), _ = /* @__PURE__ */ R(!1), v = /* @__PURE__ */ R(0), y = null, b = null, x = /* @__PURE__ */ R(!1), S = (e) => {
|
|
60769
60778
|
let t = window.innerWidth, n = { ...e };
|
|
60770
60779
|
return n.width > t && (n.width = t), n.x + n.width > t && (n.x = t - n.width), n.x < 0 && (n.x = 0), n;
|
|
@@ -60857,7 +60866,7 @@ function b6(e = {}, t) {
|
|
|
60857
60866
|
}
|
|
60858
60867
|
//#endregion
|
|
60859
60868
|
//#region src/containers/draggable-container.vue?vue&type=script&setup=true&lang.ts
|
|
60860
|
-
var
|
|
60869
|
+
var S6 = { class: "draggable-container-content" }, C6 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
60861
60870
|
__name: "draggable-container",
|
|
60862
60871
|
props: {
|
|
60863
60872
|
className: { default: "" },
|
|
@@ -60894,7 +60903,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
60894
60903
|
"compression-change"
|
|
60895
60904
|
],
|
|
60896
60905
|
setup(e, { expose: t, emit: n }) {
|
|
60897
|
-
let r = e, i = n, a = /* @__PURE__ */ R(!1), { minWidth: o, minHeight: s, maxWidth: c, top: l, left: u, width: d, height: f, isCompressed: p, isSidePanelExpanded: m, handleDragging: h, handleResizing: g, handleDragStop: _, handleResizeStop: v, toggleCompression: y, updatePosition: b, updateSize: x, updatePositionAndSize: S, expandForSidePanel: C, collapseSidePanel: w } =
|
|
60906
|
+
let r = e, i = n, a = /* @__PURE__ */ R(!1), { minWidth: o, minHeight: s, maxWidth: c, top: l, left: u, width: d, height: f, isCompressed: p, isSidePanelExpanded: m, handleDragging: h, handleResizing: g, handleDragStop: _, handleResizeStop: v, toggleCompression: y, updatePosition: b, updateSize: x, updatePositionAndSize: S, expandForSidePanel: C, collapseSidePanel: w } = x6({
|
|
60898
60907
|
initWidth: r.defaultWidth,
|
|
60899
60908
|
minWidth: r.minWidth,
|
|
60900
60909
|
minHeight: r.minHeight,
|
|
@@ -60943,7 +60952,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
60943
60952
|
positionAndSize: E,
|
|
60944
60953
|
isCompressed: p,
|
|
60945
60954
|
isSidePanelExpanded: m
|
|
60946
|
-
}), (e, t) => Un((U(), G(B(
|
|
60955
|
+
}), (e, t) => Un((U(), G(B(_6), {
|
|
60947
60956
|
ref: "draggableRef",
|
|
60948
60957
|
active: r.visible,
|
|
60949
60958
|
class: pe(["draggable-container-wrapper", r.className]),
|
|
@@ -60966,7 +60975,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
60966
60975
|
onResizeStop: M,
|
|
60967
60976
|
onResizing: A
|
|
60968
60977
|
}, {
|
|
60969
|
-
default: Hn(() => [K("div",
|
|
60978
|
+
default: Hn(() => [K("div", S6, [ui(e.$slots, "default", {}, void 0, !0)])]),
|
|
60970
60979
|
_: 3
|
|
60971
60980
|
}, 8, [
|
|
60972
60981
|
"active",
|
|
@@ -60984,11 +60993,11 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
60984
60993
|
"y"
|
|
60985
60994
|
])), [[es, r.visible]]);
|
|
60986
60995
|
}
|
|
60987
|
-
}), [["__scopeId", "data-v-1118456b"]]),
|
|
60996
|
+
}), [["__scopeId", "data-v-1118456b"]]), w6 = { class: "nimbus-bkai-wrapper" }, T6 = [
|
|
60988
60997
|
"width",
|
|
60989
60998
|
"height",
|
|
60990
60999
|
"src"
|
|
60991
|
-
],
|
|
61000
|
+
], E6 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
60992
61001
|
name: "NimbusButton",
|
|
60993
61002
|
__name: "nimbus",
|
|
60994
61003
|
props: {
|
|
@@ -61040,11 +61049,11 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61040
61049
|
right: -6
|
|
61041
61050
|
}
|
|
61042
61051
|
}
|
|
61043
|
-
}, a = Y(() => i[n.size]), o = /* @__PURE__ */ R(null), s = /* @__PURE__ */ R(null), { nimbusLeft: c, nimbusTop: l, isMinimize: u, handleClick: d, handleMinimize: f, handleDragging: p, handleMouseEnter: m, handleMouseLeave: h, handleMouseDown: g, handleMouseUp: _ } =
|
|
61052
|
+
}, a = Y(() => i[n.size]), o = /* @__PURE__ */ R(null), s = /* @__PURE__ */ R(null), { nimbusLeft: c, nimbusTop: l, isMinimize: u, handleClick: d, handleMinimize: f, handleDragging: p, handleMouseEnter: m, handleMouseLeave: h, handleMouseDown: g, handleMouseUp: _ } = G3(r, n.isMinimize);
|
|
61044
61053
|
Qn(u, (e) => {
|
|
61045
61054
|
r("update:isMinimize", e);
|
|
61046
61055
|
});
|
|
61047
|
-
let v = Y(() => u.value ?
|
|
61056
|
+
let v = Y(() => u.value ? F4("恢复默认大小") : F4("最小化,将缩成锚点")), { createTooltip: y, destroyAll: b } = X3({
|
|
61048
61057
|
theme: "ai-blueking",
|
|
61049
61058
|
delay: [0, 0]
|
|
61050
61059
|
}), x = () => {
|
|
@@ -61052,7 +61061,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61052
61061
|
S();
|
|
61053
61062
|
});
|
|
61054
61063
|
}, S = () => {
|
|
61055
|
-
b(), o.value && !u.value && y(o.value,
|
|
61064
|
+
b(), o.value && !u.value && y(o.value, k4(), { placement: "left" }), s.value && y(s.value, v.value, { placement: "top" });
|
|
61056
61065
|
};
|
|
61057
61066
|
return Qn(() => u.value, () => {
|
|
61058
61067
|
An(() => {
|
|
@@ -61064,7 +61073,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61064
61073
|
}), window.addEventListener("resize", x);
|
|
61065
61074
|
}), Yr(() => {
|
|
61066
61075
|
window.removeEventListener("resize", x);
|
|
61067
|
-
}), (t, n) => (U(), G(B(
|
|
61076
|
+
}), (t, n) => (U(), G(B(_6), {
|
|
61068
61077
|
active: !e.isPanelShow,
|
|
61069
61078
|
axis: "y",
|
|
61070
61079
|
draggable: !0,
|
|
@@ -61086,12 +61095,12 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61086
61095
|
onMouseenter: n[3] ||= (...e) => B(m) && B(m)(...e),
|
|
61087
61096
|
onMouseleave: n[4] ||= (...e) => B(h) && B(h)(...e),
|
|
61088
61097
|
onMouseup: n[5] ||= (...e) => B(_) && B(_)(...e)
|
|
61089
|
-
}, [K("div",
|
|
61098
|
+
}, [K("div", w6, [K("img", {
|
|
61090
61099
|
width: a.value.img,
|
|
61091
61100
|
height: a.value.img,
|
|
61092
61101
|
src: B(d2),
|
|
61093
61102
|
alt: "nimbus"
|
|
61094
|
-
}, null, 8,
|
|
61103
|
+
}, null, 8, T6)]), K("i", {
|
|
61095
61104
|
ref_key: "minimizeButtonRef",
|
|
61096
61105
|
ref: s,
|
|
61097
61106
|
class: pe(["nimbus-mini bkai-icon", B(u) ? "bkai-yinyong" : "bkai-minus-line"]),
|
|
@@ -61107,7 +61116,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61107
61116
|
"onDragging"
|
|
61108
61117
|
]));
|
|
61109
61118
|
}
|
|
61110
|
-
}), [["__scopeId", "data-v-26b6f3ea"]]),
|
|
61119
|
+
}), [["__scopeId", "data-v-26b6f3ea"]]), D6 = /* @__PURE__ */ V4(/* @__PURE__ */ V({
|
|
61111
61120
|
inheritAttrs: !1,
|
|
61112
61121
|
__name: "ai-blueking",
|
|
61113
61122
|
props: /* @__PURE__ */ bi({
|
|
@@ -61158,7 +61167,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61158
61167
|
beforeNimbusClick: { type: Function },
|
|
61159
61168
|
shortcutFilter: { type: Function },
|
|
61160
61169
|
resizeProps: {}
|
|
61161
|
-
},
|
|
61170
|
+
}, Z3),
|
|
61162
61171
|
emits: [
|
|
61163
61172
|
"show",
|
|
61164
61173
|
"close",
|
|
@@ -61185,29 +61194,29 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61185
61194
|
"share"
|
|
61186
61195
|
],
|
|
61187
61196
|
setup(e, { expose: t, emit: n }) {
|
|
61188
|
-
let r = e, i = n, a = _i(), { chatHelper: o, componentManager: s, sessionBusinessManager: c, shareBusinessManager: l, shortcutManager: u, forwarders: d, forwardToManager: f, chatBotRef: p, draggableContainerRef: m, panelVisible: h, nimbusMinimized: g, normalizedUrl: _, agentName: v, currentSession: y, isCompressed: b, isWelcomeState: x, messageToolsTippyOptions: S, agentResources: C, agentPrompts: w, agentSkills: T, handleError: E, reportSdkError: D, ensureSessionReady: O, updateAgentInfo: k } =
|
|
61197
|
+
let r = e, i = n, a = _i(), { chatHelper: o, componentManager: s, sessionBusinessManager: c, shareBusinessManager: l, shortcutManager: u, forwarders: d, forwardToManager: f, chatBotRef: p, draggableContainerRef: m, panelVisible: h, nimbusMinimized: g, normalizedUrl: _, agentName: v, currentSession: y, isCompressed: b, isWelcomeState: x, messageToolsTippyOptions: S, agentResources: C, agentPrompts: w, agentSkills: T, handleError: E, reportSdkError: D, ensureSessionReady: O, updateAgentInfo: k } = U3({
|
|
61189
61198
|
props: r,
|
|
61190
61199
|
emit: i
|
|
61191
|
-
}), { show: A, hide: j, handleShow: M, handleClose: N, handleNimbusClick: P, handleDragging: F, handleResizing: I, handleDragStop: ee, handleResizeStop: te, handleToggleCompression: ne, handleCompressionChange: re, handleExecutionPanelChange: ie, sendMessage: ae, handleReceiveStart: oe, handleReceiveText: se, handleReceiveEnd: le, handleStop: ue, stopGeneration: de, setCiteText: fe, focusInput: he, selectShortcut: ge, sendShortcut: _e, getChatHelper: ve, updatePosition: ye, updateSize: be, updatePositionAndSize: L, handleShortcutClick: xe } =
|
|
61200
|
+
}), { show: A, hide: j, handleShow: M, handleClose: N, handleNimbusClick: P, handleDragging: F, handleResizing: I, handleDragStop: ee, handleResizeStop: te, handleToggleCompression: ne, handleCompressionChange: re, handleExecutionPanelChange: ie, sendMessage: ae, handleReceiveStart: oe, handleReceiveText: se, handleReceiveEnd: le, handleStop: ue, stopGeneration: de, setCiteText: fe, focusInput: he, selectShortcut: ge, sendShortcut: _e, getChatHelper: ve, updatePosition: ye, updateSize: be, updatePositionAndSize: L, handleShortcutClick: xe } = q3({
|
|
61192
61201
|
componentManager: s,
|
|
61193
61202
|
chatBotRef: p,
|
|
61194
61203
|
forwarders: d,
|
|
61195
61204
|
forwardToManager: f,
|
|
61196
61205
|
beforeNimbusClick: r.beforeNimbusClick,
|
|
61197
61206
|
ensureSessionReady: O
|
|
61198
|
-
}), { sessionName: Se, hasPermission: Ce, hasSessionContents: we, autoGenerateLoading: Te, handleNewChat: Ee, handleNewChatCreated: De, handleHistoryClick: Oe, handleHistorySessionSwitch: ke, handleHistorySessionDelete: Ae, handleHistorySessionRename: je, handleAutoGenerateName: Me, handleHelpClick: Ne, handleRename: Pe, handleSessionSwitched: Fe, addNewSession: Ie, switchToSession: Le, updateSessionName: Re } =
|
|
61207
|
+
}), { sessionName: Se, hasPermission: Ce, hasSessionContents: we, autoGenerateLoading: Te, handleNewChat: Ee, handleNewChatCreated: De, handleHistoryClick: Oe, handleHistorySessionSwitch: ke, handleHistorySessionDelete: Ae, handleHistorySessionRename: je, handleAutoGenerateName: Me, handleHelpClick: Ne, handleRename: Pe, handleSessionSwitched: Fe, addNewSession: Ie, switchToSession: Le, updateSessionName: Re } = J3({
|
|
61199
61208
|
chatHelper: o,
|
|
61200
61209
|
sessionBusinessManager: c,
|
|
61201
61210
|
chatBotRef: p,
|
|
61202
61211
|
forwarders: d,
|
|
61203
61212
|
reportSdkError: D,
|
|
61204
61213
|
currentSession: y
|
|
61205
|
-
}), { isShareLoading: ze, handleShare: Be, handleCancelShare: Ve, handleConfirmShare: He } =
|
|
61214
|
+
}), { isShareLoading: ze, handleShare: Be, handleCancelShare: Ve, handleConfirmShare: He } = Y3({
|
|
61206
61215
|
shareBusinessManager: l,
|
|
61207
61216
|
chatBotRef: p,
|
|
61208
61217
|
forwarders: d,
|
|
61209
61218
|
reportSdkError: D
|
|
61210
|
-
}), { aiSelectionVisible: Ue, filteredPopupShortcuts: We, handleSelectionChange: Ge, handleAiSelectionShortcut: Ke } =
|
|
61219
|
+
}), { aiSelectionVisible: Ue, filteredPopupShortcuts: We, handleSelectionChange: Ge, handleAiSelectionShortcut: Ke } = W3({
|
|
61211
61220
|
shortcutManager: u,
|
|
61212
61221
|
chatBotRef: p,
|
|
61213
61222
|
forwardToManager: f,
|
|
@@ -61241,7 +61250,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61241
61250
|
B(a).class
|
|
61242
61251
|
]) }, [
|
|
61243
61252
|
J(" 可拖拽容器 "),
|
|
61244
|
-
q(B(
|
|
61253
|
+
q(B(C6), {
|
|
61245
61254
|
ref_key: "draggableContainerRef",
|
|
61246
61255
|
ref: m,
|
|
61247
61256
|
"compressed-padding": r.miniPadding,
|
|
@@ -61262,7 +61271,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61262
61271
|
}, {
|
|
61263
61272
|
default: Hn(() => [K("div", { class: pe(["ai-blueking-panel", { "has-messages": !B(x) }]) }, [
|
|
61264
61273
|
J(" 独立的 Header 组件 "),
|
|
61265
|
-
r.hideHeader ? J("v-if", !0) : (U(), G(
|
|
61274
|
+
r.hideHeader ? J("v-if", !0) : (U(), G(u3, {
|
|
61266
61275
|
key: 0,
|
|
61267
61276
|
"agent-name": B(v),
|
|
61268
61277
|
"chat-helper": B(o),
|
|
@@ -61299,7 +61308,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61299
61308
|
key: "0"
|
|
61300
61309
|
} : void 0]), 1032, /* @__PURE__ */ "agent-name.chat-helper.draggable.dropdown-menu-config.enable-chat-session.has-permission.has-session-contents.auto-generate-loading.is-compression-height.render-mode.session-business-manager.session-name.show-compression-icon.show-history-icon.show-more-icon.show-new-chat-icon.title.onAutoGenerateName.onClose.onHelpClick.onHistoryClick.onHistorySessionDelete.onHistorySessionRename.onHistorySessionSwitch.onNewChat.onNewChatCreated.onRename.onShare.onToggleCompression".split("."))),
|
|
61301
61310
|
J(" ChatBot 核心组件(仅聊天区域) "),
|
|
61302
|
-
q(
|
|
61311
|
+
q(R3, {
|
|
61303
61312
|
ref_key: "chatBotRef",
|
|
61304
61313
|
ref: p,
|
|
61305
61314
|
"always-create-new-session": r.alwaysCreateNewSession,
|
|
@@ -61367,7 +61376,7 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61367
61376
|
"onResizing"
|
|
61368
61377
|
]),
|
|
61369
61378
|
J(" Nimbus 悬浮球 "),
|
|
61370
|
-
r.hideNimbus ? J("v-if", !0) : (U(), G(
|
|
61379
|
+
r.hideNimbus ? J("v-if", !0) : (U(), G(E6, {
|
|
61371
61380
|
key: 0,
|
|
61372
61381
|
"is-minimize": B(g),
|
|
61373
61382
|
"onUpdate:isMinimize": t[4] ||= (e) => /* @__PURE__ */ Zt(g) ? g.value = e : null,
|
|
@@ -61405,35 +61414,35 @@ var x6 = { class: "draggable-container-content" }, S6 = /* @__PURE__ */ B4(/* @_
|
|
|
61405
61414
|
}), [["__scopeId", "data-v-b2022398"]]);
|
|
61406
61415
|
//#endregion
|
|
61407
61416
|
//#region src/vue2-wrapper.ts
|
|
61408
|
-
function
|
|
61417
|
+
function O6(e) {
|
|
61409
61418
|
return "on" + e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
|
|
61410
61419
|
}
|
|
61411
61420
|
//#endregion
|
|
61412
61421
|
//#region src/standalone-mount-core.ts
|
|
61413
|
-
function
|
|
61422
|
+
function k6() {
|
|
61414
61423
|
return "bk";
|
|
61415
61424
|
}
|
|
61416
|
-
function
|
|
61425
|
+
function A6(e) {
|
|
61417
61426
|
if (typeof e != "string") return e;
|
|
61418
61427
|
let t = document.querySelector(e);
|
|
61419
61428
|
if (!t) throw Error(`[ai-blueking] mount container not found: ${e}`);
|
|
61420
61429
|
return t;
|
|
61421
61430
|
}
|
|
61422
|
-
function
|
|
61431
|
+
function j6(e) {
|
|
61423
61432
|
if (!e) return {};
|
|
61424
61433
|
let t = {};
|
|
61425
61434
|
for (let [n, r] of Object.entries(e)) {
|
|
61426
61435
|
if (!r) continue;
|
|
61427
|
-
let e = n.startsWith("on") && n.length > 2 ? n :
|
|
61436
|
+
let e = n.startsWith("on") && n.length > 2 ? n : O6(n);
|
|
61428
61437
|
t[e] = r;
|
|
61429
61438
|
}
|
|
61430
61439
|
return t;
|
|
61431
61440
|
}
|
|
61432
|
-
function
|
|
61433
|
-
let r =
|
|
61434
|
-
return () => X(J_, { prefix:
|
|
61441
|
+
function M6(e, t, n) {
|
|
61442
|
+
let r = A6(e), i = /* @__PURE__ */ Bt({ ...n?.props ?? {} }), a = null, o = Ks({ setup() {
|
|
61443
|
+
return () => X(J_, { prefix: k6() }, { default: () => X(t, {
|
|
61435
61444
|
...i,
|
|
61436
|
-
...
|
|
61445
|
+
...j6(n?.on),
|
|
61437
61446
|
ref: (e) => {
|
|
61438
61447
|
a = e;
|
|
61439
61448
|
}
|
|
@@ -61455,11 +61464,11 @@ function j6(e, t, n) {
|
|
|
61455
61464
|
}
|
|
61456
61465
|
//#endregion
|
|
61457
61466
|
//#region src/standalone-mount.ts
|
|
61458
|
-
function M6(e, t) {
|
|
61459
|
-
return j6(e, E6, t);
|
|
61460
|
-
}
|
|
61461
61467
|
function N6(e, t) {
|
|
61462
|
-
return
|
|
61468
|
+
return M6(e, D6, t);
|
|
61469
|
+
}
|
|
61470
|
+
function P6(e, t) {
|
|
61471
|
+
return M6(e, R3, t);
|
|
61463
61472
|
}
|
|
61464
61473
|
//#endregion
|
|
61465
|
-
export { M2 as AGUIProtocol,
|
|
61474
|
+
export { M2 as AGUIProtocol, D6 as AIBlueking, Q3 as BluekingProtocol, z3 as BootstrapPhase, R3 as ChatBot, p3 as ChatBusinessManager, _3 as ComponentManager, C6 as DraggableContainer, Oc as MessageContentType, Hc as RenderMode, m3 as SessionBusinessManager, g3 as ShortcutManager, x3 as UIStateManager, j6 as buildStandaloneListeners, Ks as createApp, $3 as createBluekingProtocol, v3 as createComponentManager, Z3 as defaultProps, X as h, N6 as mountAIBlueking, P6 as mountChatBot, M6 as mountStandaloneComponent, C4 as parseCustomBlocks, Gs as render, A6 as resolveMountContainer, B3 as useChatBootstrap, m4 as useChatHelper, x6 as useDraggable };
|