@vc-shell/framework 2.4.0-pr292.5ff2800 → 2.4.0-pr293.07f2a8c
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/ai-agent/index.js +2 -2
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_script_setup_true_lang-AGljCkDc.js → VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cm_izaFs.js} +366 -375
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cm_izaFs.js.map +1 -0
- package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-BJ-Srwxo.js → VcScheduler.vue_vue_type_script_setup_true_lang-BUv6ZtsI.js} +2 -2
- package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-BJ-Srwxo.js.map → VcScheduler.vue_vue_type_script_setup_true_lang-BUv6ZtsI.js.map} +1 -1
- package/dist/chunks/{VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js → VcScheduler.vue_vue_type_style_index_0_lang-Dj-nP2Jc.js} +532 -520
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-Dj-nP2Jc.js.map +1 -0
- package/dist/chunks/{dashboard-feed-row.vue_vue_type_script_setup_true_lang-C9fu-sdk.js → dashboard-feed-row.vue_vue_type_script_setup_true_lang-C6gLMw3Z.js} +1 -1
- package/dist/chunks/{dashboard-feed-row.vue_vue_type_script_setup_true_lang-C9fu-sdk.js.map → dashboard-feed-row.vue_vue_type_script_setup_true_lang-C6gLMw3Z.js.map} +1 -1
- package/dist/chunks/{index-DuNGRQBR.js → index-C-SEYj46.js} +1 -1
- package/dist/chunks/{index-DuNGRQBR.js.map → index-C-SEYj46.js.map} +1 -1
- package/dist/core/plugins/ai-agent/services/ai-agent-service.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts +0 -2
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/types.d.ts +1 -1
- package/dist/core/plugins/ai-agent/types.d.ts.map +1 -1
- package/dist/core/utilities/error.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/framework.js +13 -13
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/index.js +2 -2
- package/package.json +4 -4
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-AGljCkDc.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as D, computed as
|
|
1
|
+
import { ref as D, computed as E, shallowRef as Ge, watch as q, getCurrentInstance as ee, inject as N, isRef as Ve, provide as ke, defineComponent as H, openBlock as y, createElementBlock as x, createElementVNode as A, createCommentVNode as z, createStaticVNode as Ke, Fragment as Ae, renderList as qe, toDisplayString as K, createVNode as O, createBlock as se, unref as T, withCtx as F, withKeys as U, withModifiers as G, createTextVNode as Ce, Transition as Pe, normalizeClass as Me, onUnmounted as ze, normalizeStyle as He } from "vue";
|
|
2
2
|
import { c as W, b as De, d as We, B as Ze, e as Xe, f as Ye, A as be, L as je, g as Qe, T as Je, a as me, _ as ie, E as et } from "./VcAiAgentPanel.vue_vue_type_style_index_0_lang-DrGobYkj.js";
|
|
3
3
|
import { c as te } from "./vendor-lodash-es-D2n90GJy.js";
|
|
4
4
|
import { u as tt } from "./vendor-vueuse-core-BFa9je5E.js";
|
|
@@ -20,7 +20,7 @@ const at = {
|
|
|
20
20
|
AI_CHAT_MESSAGE: "AI_CHAT_MESSAGE"
|
|
21
21
|
}, ot = "ai-agent-toggle", rt = "lucide-sparkles", it = "AI Assistant", ne = W("ai-agent-panel");
|
|
22
22
|
function st() {
|
|
23
|
-
const e = D("closed"), o = D(!1), t =
|
|
23
|
+
const e = D("closed"), o = D(!1), t = E(() => e.value !== "closed"), s = E(() => e.value === "expanded"), n = () => {
|
|
24
24
|
e.value === "closed" && (e.value = "open", ne.debug("Panel opened"));
|
|
25
25
|
}, c = () => {
|
|
26
26
|
e.value = "closed", o.value = !1, ne.debug("Panel closed, reset initialized state");
|
|
@@ -57,8 +57,8 @@ function we(e) {
|
|
|
57
57
|
}
|
|
58
58
|
function lt(e) {
|
|
59
59
|
const { userGetter: o, bladeGetter: t, localeGetter: s, tokenGetter: n } = e, c = D(/* @__PURE__ */ new Map()), f = () => {
|
|
60
|
-
const
|
|
61
|
-
return
|
|
60
|
+
const v = t();
|
|
61
|
+
return v ? c.value.get(v.id) ?? {
|
|
62
62
|
items: [],
|
|
63
63
|
type: "list",
|
|
64
64
|
suggestions: void 0
|
|
@@ -67,174 +67,166 @@ function lt(e) {
|
|
|
67
67
|
type: "list",
|
|
68
68
|
suggestions: void 0
|
|
69
69
|
};
|
|
70
|
-
},
|
|
70
|
+
}, d = E(() => f().items), u = E(() => f().type), g = E(() => f().suggestions), m = E(() => d.value.length);
|
|
71
71
|
return {
|
|
72
|
-
contextItems:
|
|
73
|
-
contextType:
|
|
74
|
-
contextSuggestions:
|
|
75
|
-
totalItemsCount:
|
|
76
|
-
setContextData: (
|
|
77
|
-
const M = t()?.id ||
|
|
78
|
-
return M ?
|
|
72
|
+
contextItems: d,
|
|
73
|
+
contextType: u,
|
|
74
|
+
contextSuggestions: g,
|
|
75
|
+
totalItemsCount: m,
|
|
76
|
+
setContextData: (v, I, P, $) => {
|
|
77
|
+
const M = t()?.id || $;
|
|
78
|
+
return M ? v.length === 0 && !P ? (c.value.delete(M), he.debug(`Context cleared for blade: ${M}`), { cleared: !0 }) : (c.value.set(M, { items: v, type: I, suggestions: P }), he.debug(`Context set for blade: ${M}, items: ${v.length}, type: ${I}`), { cleared: !1 }) : (he.warn("Cannot set context data: no blade id available"), { cleared: !1 });
|
|
79
79
|
},
|
|
80
80
|
buildInitPayload: async () => {
|
|
81
|
-
const
|
|
81
|
+
const v = n ? await n() ?? void 0 : void 0;
|
|
82
82
|
return {
|
|
83
83
|
userId: o()?.id || "",
|
|
84
84
|
locale: s(),
|
|
85
85
|
blade: we(t()),
|
|
86
|
-
contextType:
|
|
87
|
-
items: te(
|
|
88
|
-
suggestions:
|
|
89
|
-
accessToken:
|
|
86
|
+
contextType: u.value,
|
|
87
|
+
items: te(d.value),
|
|
88
|
+
suggestions: g.value ? te(g.value) : void 0,
|
|
89
|
+
accessToken: v
|
|
90
90
|
};
|
|
91
91
|
},
|
|
92
92
|
buildUpdatePayload: async () => {
|
|
93
|
-
const
|
|
93
|
+
const v = n ? await n() ?? void 0 : void 0;
|
|
94
94
|
return {
|
|
95
95
|
blade: we(t()),
|
|
96
|
-
contextType:
|
|
97
|
-
items: te(
|
|
98
|
-
suggestions:
|
|
96
|
+
contextType: u.value,
|
|
97
|
+
items: te(d.value),
|
|
98
|
+
suggestions: g.value ? te(g.value) : void 0,
|
|
99
99
|
locale: s(),
|
|
100
|
-
accessToken:
|
|
100
|
+
accessToken: v
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
107
|
-
const { getConfig: o, isEmbedded: t, navigateToBlade: s
|
|
108
|
-
function
|
|
109
|
-
switch (
|
|
105
|
+
const S = W("ai-agent-transport");
|
|
106
|
+
function dt(e) {
|
|
107
|
+
const { getConfig: o, isEmbedded: t, navigateToBlade: s } = e, n = Ge(null), c = D(!1), f = D(!1), d = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
108
|
+
function g(l, b) {
|
|
109
|
+
switch (l) {
|
|
110
110
|
case "NAVIGATE_TO_APP": {
|
|
111
|
-
const
|
|
112
|
-
s &&
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
// The panel's own Escape handler listens on the host document, which never sees a
|
|
116
|
-
// keystroke delivered to a cross-origin iframe. So while the chatbot holds focus the
|
|
117
|
-
// only route back is the chatbot relaying it here (VCST-5673). Closing a panel exposes
|
|
118
|
-
// nothing, and the sender's origin is already checked before this runs.
|
|
119
|
-
case "CLOSE_PANEL": {
|
|
120
|
-
n && (n(), O.debug("Panel close requested by the chatbot"));
|
|
111
|
+
const v = b;
|
|
112
|
+
s && v?.bladeName && (s(v.bladeName, v.param, v.options), S.debug(`Navigation requested to: ${v.bladeName}`));
|
|
121
113
|
break;
|
|
122
114
|
}
|
|
123
115
|
}
|
|
124
|
-
const
|
|
125
|
-
type:
|
|
126
|
-
payload:
|
|
116
|
+
const _ = {
|
|
117
|
+
type: l,
|
|
118
|
+
payload: b,
|
|
127
119
|
timestamp: Date.now()
|
|
128
120
|
};
|
|
129
|
-
d.forEach((
|
|
121
|
+
d.forEach((v) => {
|
|
130
122
|
try {
|
|
131
|
-
|
|
132
|
-
} catch (
|
|
133
|
-
|
|
123
|
+
v(_);
|
|
124
|
+
} catch (I) {
|
|
125
|
+
S.error("Handler error:", I);
|
|
134
126
|
}
|
|
135
127
|
});
|
|
136
128
|
}
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
129
|
+
function m(l) {
|
|
130
|
+
const _ = o().allowedOrigins ?? [];
|
|
131
|
+
if (_.length === 0) {
|
|
132
|
+
S.warn(
|
|
141
133
|
"Ignoring postMessage: aiAgentConfig.allowedOrigins is empty. Configure explicit origins to enable the AI agent bridge.",
|
|
142
|
-
{ origin:
|
|
134
|
+
{ origin: l.origin, type: l.data?.type }
|
|
143
135
|
);
|
|
144
136
|
return;
|
|
145
137
|
}
|
|
146
|
-
if (
|
|
147
|
-
|
|
138
|
+
if (_.includes("*")) {
|
|
139
|
+
S.error(
|
|
148
140
|
'Refusing postMessage with wildcard allowedOrigins. Replace "*" with explicit origins (e.g. ["https://chat.example.com"]).'
|
|
149
141
|
);
|
|
150
142
|
return;
|
|
151
143
|
}
|
|
152
|
-
if (!
|
|
144
|
+
if (!_.includes(l.origin))
|
|
153
145
|
return;
|
|
154
|
-
const
|
|
155
|
-
if (!(!
|
|
156
|
-
switch (
|
|
146
|
+
const v = l.data;
|
|
147
|
+
if (!(!v?.type || typeof v.type != "string"))
|
|
148
|
+
switch (S.debug(`Message received: ${v.type}`), v.type) {
|
|
157
149
|
// Embedded: parent forwards chat messages wrapped in AI_CHAT_MESSAGE
|
|
158
150
|
case "AI_CHAT_MESSAGE": {
|
|
159
151
|
if (t) {
|
|
160
|
-
const
|
|
161
|
-
|
|
152
|
+
const I = v.payload;
|
|
153
|
+
I?.type && g(I.type, I.payload);
|
|
162
154
|
}
|
|
163
155
|
return;
|
|
164
156
|
}
|
|
165
157
|
// Normal: chatbot signals it's ready
|
|
166
158
|
case "CHAT_READY":
|
|
167
|
-
u.forEach((
|
|
159
|
+
u.forEach((I) => {
|
|
168
160
|
try {
|
|
169
|
-
|
|
170
|
-
} catch (
|
|
171
|
-
|
|
161
|
+
I();
|
|
162
|
+
} catch (P) {
|
|
163
|
+
S.error("ChatReady handler error:", P);
|
|
172
164
|
}
|
|
173
165
|
});
|
|
174
166
|
break;
|
|
175
167
|
// Normal: direct chat protocol messages
|
|
176
168
|
default:
|
|
177
|
-
|
|
169
|
+
g(v.type, v.payload);
|
|
178
170
|
break;
|
|
179
171
|
}
|
|
180
172
|
}
|
|
181
173
|
return {
|
|
182
|
-
iframeRef:
|
|
183
|
-
pendingInitContext:
|
|
184
|
-
isListenerRegistered:
|
|
185
|
-
setIframeRef(
|
|
186
|
-
|
|
174
|
+
iframeRef: n,
|
|
175
|
+
pendingInitContext: c,
|
|
176
|
+
isListenerRegistered: f,
|
|
177
|
+
setIframeRef(l) {
|
|
178
|
+
n.value = l, S.debug("Iframe ref set:", l ? "available" : "null");
|
|
187
179
|
},
|
|
188
|
-
sendToIframe(
|
|
189
|
-
if (!
|
|
190
|
-
|
|
180
|
+
sendToIframe(l) {
|
|
181
|
+
if (!n.value?.contentWindow) {
|
|
182
|
+
S.warn("Cannot send message: iframe not available");
|
|
191
183
|
return;
|
|
192
184
|
}
|
|
193
|
-
const
|
|
194
|
-
if (!
|
|
195
|
-
|
|
185
|
+
const b = o().allowedOrigins?.[0];
|
|
186
|
+
if (!b || b === "*") {
|
|
187
|
+
S.error(
|
|
196
188
|
"Refusing to send to iframe: aiAgentConfig.allowedOrigins must contain an explicit origin. Message dropped to avoid leaking data (including access tokens) to arbitrary origins.",
|
|
197
|
-
{ type:
|
|
189
|
+
{ type: l.type }
|
|
198
190
|
);
|
|
199
191
|
return;
|
|
200
192
|
}
|
|
201
|
-
|
|
193
|
+
n.value.contentWindow.postMessage(l, b), S.debug(`Sent to iframe: ${l.type}`);
|
|
202
194
|
},
|
|
203
|
-
sendToParent(
|
|
195
|
+
sendToParent(l) {
|
|
204
196
|
if (!window.parent || window.parent === window) {
|
|
205
|
-
|
|
197
|
+
S.warn("Cannot send to parent: not in iframe");
|
|
206
198
|
return;
|
|
207
199
|
}
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
210
|
-
|
|
200
|
+
const b = o().parentOrigin;
|
|
201
|
+
if (!b || b === "*") {
|
|
202
|
+
S.error(
|
|
211
203
|
"Refusing to send to parent: aiAgentConfig.parentOrigin must be an explicit origin. Message dropped to avoid leaking data (including access tokens) to arbitrary origins.",
|
|
212
|
-
{ type:
|
|
204
|
+
{ type: l.type }
|
|
213
205
|
);
|
|
214
206
|
return;
|
|
215
207
|
}
|
|
216
|
-
window.parent.postMessage(
|
|
208
|
+
window.parent.postMessage(l, b), S.debug(`Sent to parent: ${l.type}`);
|
|
217
209
|
},
|
|
218
210
|
startListening() {
|
|
219
|
-
|
|
211
|
+
f.value || (window.addEventListener("message", m), f.value = !0);
|
|
220
212
|
},
|
|
221
213
|
stopListening() {
|
|
222
|
-
|
|
214
|
+
f.value && (window.removeEventListener("message", m), f.value = !1);
|
|
223
215
|
},
|
|
224
|
-
onChatReady(
|
|
225
|
-
return u.add(
|
|
226
|
-
u.delete(
|
|
216
|
+
onChatReady(l) {
|
|
217
|
+
return u.add(l), () => {
|
|
218
|
+
u.delete(l);
|
|
227
219
|
};
|
|
228
220
|
},
|
|
229
|
-
onMessage(
|
|
230
|
-
return d.add(
|
|
231
|
-
d.delete(
|
|
221
|
+
onMessage(l) {
|
|
222
|
+
return d.add(l), () => {
|
|
223
|
+
d.delete(l);
|
|
232
224
|
};
|
|
233
225
|
}
|
|
234
226
|
};
|
|
235
227
|
}
|
|
236
228
|
const ae = W("ai-agent-service");
|
|
237
|
-
function
|
|
229
|
+
function ct(e) {
|
|
238
230
|
const {
|
|
239
231
|
userGetter: o,
|
|
240
232
|
bladeGetter: t,
|
|
@@ -242,84 +234,83 @@ function dt(e) {
|
|
|
242
234
|
tokenGetter: n,
|
|
243
235
|
navigateToBlade: c,
|
|
244
236
|
initialConfig: f,
|
|
245
|
-
isEmbedded:
|
|
246
|
-
} = e,
|
|
237
|
+
isEmbedded: d = !1
|
|
238
|
+
} = e, u = D({ ...at, ...f }), g = st(), m = lt({
|
|
247
239
|
userGetter: o,
|
|
248
240
|
bladeGetter: t,
|
|
249
241
|
localeGetter: s,
|
|
250
242
|
tokenGetter: n
|
|
251
|
-
}),
|
|
252
|
-
getConfig: () =>
|
|
253
|
-
isEmbedded:
|
|
254
|
-
navigateToBlade: c
|
|
255
|
-
|
|
256
|
-
}), g = b(() => ({
|
|
243
|
+
}), l = dt({
|
|
244
|
+
getConfig: () => u.value,
|
|
245
|
+
isEmbedded: d,
|
|
246
|
+
navigateToBlade: c
|
|
247
|
+
}), b = E(() => ({
|
|
257
248
|
user: o(),
|
|
258
249
|
currentBlade: t(),
|
|
259
|
-
items:
|
|
260
|
-
})),
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
|
|
250
|
+
items: m.contextItems.value
|
|
251
|
+
})), _ = async () => {
|
|
252
|
+
if (l.pendingInitContext.value && l.iframeRef.value?.contentWindow) {
|
|
253
|
+
l.pendingInitContext.value = !1, g.isInitialized.value = !0;
|
|
254
|
+
const B = await m.buildInitPayload();
|
|
255
|
+
l.sendToIframe({ type: "INIT_CONTEXT", payload: B }), ae.debug("Flushed pending INIT_CONTEXT");
|
|
265
256
|
}
|
|
266
257
|
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
})) : (
|
|
271
|
-
}), q(
|
|
272
|
-
() => ({ currentBlade:
|
|
258
|
+
l.onChatReady(() => {
|
|
259
|
+
l.iframeRef.value?.contentWindow ? (g.isInitialized.value = !0, m.buildInitPayload().then((B) => {
|
|
260
|
+
l.sendToIframe({ type: "INIT_CONTEXT", payload: B }), ae.info("Chatbot ready, sent INIT_CONTEXT");
|
|
261
|
+
})) : (l.pendingInitContext.value = !0, ae.info("Chatbot ready, iframe ref not available yet — pending INIT_CONTEXT"));
|
|
262
|
+
}), q(l.iframeRef, () => _()), q(
|
|
263
|
+
() => ({ currentBlade: b.value.currentBlade, items: b.value.items }),
|
|
273
264
|
async () => {
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
|
|
265
|
+
if (d) {
|
|
266
|
+
const B = await m.buildInitPayload();
|
|
267
|
+
l.sendToParent({ type: "AI_CONTEXT_UPDATE", payload: B });
|
|
277
268
|
return;
|
|
278
269
|
}
|
|
279
|
-
if (
|
|
280
|
-
const
|
|
281
|
-
|
|
270
|
+
if (g.isOpen.value && g.isInitialized.value && l.iframeRef.value?.contentWindow) {
|
|
271
|
+
const B = await m.buildUpdatePayload();
|
|
272
|
+
l.sendToIframe({ type: "UPDATE_CONTEXT", payload: B });
|
|
282
273
|
}
|
|
283
274
|
},
|
|
284
275
|
{ deep: !0 }
|
|
285
276
|
);
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
}, M = (
|
|
289
|
-
const { cleared: Y } =
|
|
290
|
-
|
|
277
|
+
const v = () => d ? l.sendToParent({ type: "AI_TOGGLE_PANEL" }) : g.open(), I = () => d ? l.sendToParent({ type: "AI_TOGGLE_PANEL" }) : g.close(), P = () => d ? l.sendToParent({ type: "AI_TOGGLE_PANEL" }) : g.toggle(), $ = (B) => {
|
|
278
|
+
l.setIframeRef(B), _();
|
|
279
|
+
}, M = (B, R, Z, X) => {
|
|
280
|
+
const { cleared: Y } = m.setContextData(B, R, Z, X);
|
|
281
|
+
d && Y && l.sendToParent({ type: "AI_CONTEXT_CLEAR" });
|
|
291
282
|
};
|
|
292
|
-
return
|
|
283
|
+
return l.startListening(), d && (l.sendToParent({
|
|
293
284
|
type: "EMBEDDED_APP_READY",
|
|
294
285
|
payload: { supportedFeatures: ["ai-agent"] }
|
|
295
286
|
}), ae.info("Embedded mode: sent EMBEDDED_APP_READY to parent")), {
|
|
296
287
|
// State
|
|
297
|
-
panelState:
|
|
298
|
-
config:
|
|
299
|
-
context:
|
|
300
|
-
isOpen:
|
|
301
|
-
isExpanded:
|
|
302
|
-
totalItemsCount:
|
|
288
|
+
panelState: g.panelState,
|
|
289
|
+
config: u,
|
|
290
|
+
context: b,
|
|
291
|
+
isOpen: E(() => !d && g.isOpen.value),
|
|
292
|
+
isExpanded: g.isExpanded,
|
|
293
|
+
totalItemsCount: m.totalItemsCount,
|
|
303
294
|
// Panel control
|
|
304
|
-
openPanel:
|
|
305
|
-
closePanel:
|
|
306
|
-
togglePanel:
|
|
307
|
-
expandPanel: () =>
|
|
308
|
-
collapsePanel: () =>
|
|
295
|
+
openPanel: v,
|
|
296
|
+
closePanel: I,
|
|
297
|
+
togglePanel: P,
|
|
298
|
+
expandPanel: () => g.expand(),
|
|
299
|
+
collapsePanel: () => g.collapse(),
|
|
309
300
|
// Configuration
|
|
310
|
-
setConfig: (
|
|
311
|
-
|
|
301
|
+
setConfig: (B) => {
|
|
302
|
+
u.value = { ...u.value, ...B };
|
|
312
303
|
},
|
|
313
304
|
// Communication
|
|
314
|
-
sendMessage: (
|
|
315
|
-
|
|
305
|
+
sendMessage: (B, R) => {
|
|
306
|
+
l.sendToIframe({ type: B, payload: R });
|
|
316
307
|
},
|
|
317
|
-
onMessage:
|
|
308
|
+
onMessage: l.onMessage,
|
|
318
309
|
// Internal API
|
|
319
|
-
iframeRef:
|
|
320
|
-
_setIframeRef:
|
|
321
|
-
_startListening:
|
|
322
|
-
_stopListening:
|
|
310
|
+
iframeRef: l.iframeRef,
|
|
311
|
+
_setIframeRef: $,
|
|
312
|
+
_startListening: l.startListening,
|
|
313
|
+
_stopListening: l.stopListening,
|
|
323
314
|
_setContextData: M
|
|
324
315
|
};
|
|
325
316
|
}
|
|
@@ -472,19 +463,19 @@ function xe(e, o) {
|
|
|
472
463
|
return { path: e ? `/${e}` : "/", query: {} };
|
|
473
464
|
const t = o[0], s = Se(t.url);
|
|
474
465
|
let n;
|
|
475
|
-
for (let
|
|
476
|
-
if (o[
|
|
477
|
-
n = o[
|
|
466
|
+
for (let d = o.length - 1; d >= 1; d--)
|
|
467
|
+
if (o[d].visible) {
|
|
468
|
+
n = o[d];
|
|
478
469
|
break;
|
|
479
470
|
}
|
|
480
471
|
let c = e ? `/${e}` : "";
|
|
481
472
|
if (s && (c += `/${s}`), n) {
|
|
482
|
-
const
|
|
483
|
-
|
|
473
|
+
const d = Se(n.url);
|
|
474
|
+
d && (c += `/${d}`), n.param && (c += `/${n.param}`);
|
|
484
475
|
}
|
|
485
476
|
const f = {};
|
|
486
|
-
for (const
|
|
487
|
-
|
|
477
|
+
for (const d of o)
|
|
478
|
+
d.visible && d.query && Object.assign(f, d.query);
|
|
488
479
|
return { path: c || "/", query: f };
|
|
489
480
|
}
|
|
490
481
|
function Bn(e, o) {
|
|
@@ -515,7 +506,7 @@ function yt(e, o) {
|
|
|
515
506
|
return { syncUrlPush: t, syncUrlReplace: s };
|
|
516
507
|
}
|
|
517
508
|
const Bt = "useBlade() was called outside a blade. Navigation methods (openBlade) work everywhere, but blade-specific methods require the component to be rendered inside VcBladeSlot.";
|
|
518
|
-
function
|
|
509
|
+
function w(e) {
|
|
519
510
|
throw new Error(`[vc-shell] ${e} requires blade context.
|
|
520
511
|
${Bt}`);
|
|
521
512
|
}
|
|
@@ -527,129 +518,129 @@ function It() {
|
|
|
527
518
|
);
|
|
528
519
|
const t = e, s = o, n = ee() ? N(Ze, void 0) : void 0, c = ee() ? N(Xe, void 0) : void 0;
|
|
529
520
|
let f;
|
|
530
|
-
function
|
|
521
|
+
function d() {
|
|
531
522
|
if (f) return f;
|
|
532
523
|
const r = Fe?.router;
|
|
533
524
|
return r && (f = yt(r, t)), f;
|
|
534
525
|
}
|
|
535
|
-
const
|
|
526
|
+
const u = E(() => (n || w("id"), n.value.id)), g = E(() => (n || w("param"), n.value.param)), m = E(() => (n || w("options"), n.value.options)), l = E(() => (n || w("query"), n.value.query)), b = E(() => (n || w("closable"), n.value.parentId !== void 0)), _ = E(() => (n || w("expanded"), t.activeBlade.value?.id === n.value.id)), v = E(() => (n || w("name"), n.value.name)), I = E(() => {
|
|
536
527
|
if (!n) return;
|
|
537
528
|
const r = n.value.id;
|
|
538
|
-
return t.blades.value.find((
|
|
529
|
+
return t.blades.value.find((C) => C.parentId === r)?.param;
|
|
539
530
|
});
|
|
540
|
-
let
|
|
541
|
-
function
|
|
542
|
-
if (
|
|
531
|
+
let P = !1;
|
|
532
|
+
function $(r) {
|
|
533
|
+
if (P) {
|
|
543
534
|
console.warn(
|
|
544
535
|
"[vc-shell] provideBladeData() called more than once in the same blade. Only the first call takes effect."
|
|
545
536
|
);
|
|
546
537
|
return;
|
|
547
538
|
}
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
539
|
+
P = !0;
|
|
540
|
+
const C = Ve(r) ? r : D(r);
|
|
541
|
+
ke(Ye, C);
|
|
551
542
|
}
|
|
552
543
|
async function M(r) {
|
|
553
|
-
const { isWorkspace:
|
|
554
|
-
if (
|
|
544
|
+
const { isWorkspace: C, ...k } = r;
|
|
545
|
+
if (C)
|
|
555
546
|
await t.openWorkspace(k);
|
|
556
547
|
else {
|
|
557
548
|
const L = n?.value.id;
|
|
558
549
|
L ? await t.openBlade({ ...k, parentId: L }) : await t.openBlade(k);
|
|
559
550
|
}
|
|
560
|
-
t.activeBlade.value?.url &&
|
|
551
|
+
t.activeBlade.value?.url && d()?.syncUrlPush();
|
|
561
552
|
}
|
|
562
|
-
async function
|
|
563
|
-
n ||
|
|
553
|
+
async function B() {
|
|
554
|
+
n || w("closeSelf()");
|
|
564
555
|
const r = await t.closeBlade(n.value.id);
|
|
565
|
-
return r ||
|
|
556
|
+
return r || d()?.syncUrlReplace(), r;
|
|
566
557
|
}
|
|
567
558
|
async function R() {
|
|
568
|
-
n ||
|
|
559
|
+
n || w("closeChildren()"), await t.closeChildren(n.value.id), d()?.syncUrlReplace();
|
|
569
560
|
}
|
|
570
561
|
async function Z(r) {
|
|
571
|
-
n ||
|
|
562
|
+
n || w("replaceWith()"), await t.replaceCurrentBlade({
|
|
572
563
|
...r,
|
|
573
564
|
parentId: n.value.parentId
|
|
574
|
-
}), t.activeBlade.value?.url &&
|
|
565
|
+
}), t.activeBlade.value?.url && d()?.syncUrlReplace();
|
|
575
566
|
}
|
|
576
567
|
async function X(r) {
|
|
577
|
-
n ||
|
|
568
|
+
n || w("coverWith()"), await t.coverCurrentBlade({
|
|
578
569
|
...r,
|
|
579
570
|
parentId: n.value.parentId
|
|
580
|
-
}), t.activeBlade.value?.url &&
|
|
571
|
+
}), t.activeBlade.value?.url && d()?.syncUrlPush();
|
|
581
572
|
}
|
|
582
|
-
async function Y(r,
|
|
583
|
-
return n ||
|
|
573
|
+
async function Y(r, C) {
|
|
574
|
+
return n || w("callParent()"), s.callParent(n.value.id, r, C);
|
|
584
575
|
}
|
|
585
576
|
function le(r) {
|
|
586
|
-
n ||
|
|
587
|
-
}
|
|
588
|
-
function ce(r) {
|
|
589
|
-
n || y("onBeforeClose()"), t.registerBeforeClose(n.value.id, r);
|
|
577
|
+
n || w("exposeToChildren()"), s.exposeToChildren(n.value.id, r);
|
|
590
578
|
}
|
|
591
579
|
function de(r) {
|
|
592
|
-
n ||
|
|
580
|
+
n || w("onBeforeClose()"), t.registerBeforeClose(n.value.id, r);
|
|
581
|
+
}
|
|
582
|
+
function ce(r) {
|
|
583
|
+
n || w("setError()"), t.setBladeError(n.value.id, r);
|
|
593
584
|
}
|
|
594
585
|
function j() {
|
|
595
|
-
n ||
|
|
586
|
+
n || w("clearError()"), t.clearBladeError(n.value.id);
|
|
596
587
|
}
|
|
597
588
|
let ue = 0;
|
|
598
589
|
function pe(r) {
|
|
599
|
-
c ||
|
|
600
|
-
const
|
|
590
|
+
c || w("addBanner()");
|
|
591
|
+
const C = `banner-${n.value.id}-${++ue}`;
|
|
601
592
|
return c.value.push({
|
|
602
593
|
...r,
|
|
603
|
-
id:
|
|
594
|
+
id: C,
|
|
604
595
|
dismissible: r.dismissible ?? !1
|
|
605
|
-
}),
|
|
596
|
+
}), C;
|
|
606
597
|
}
|
|
607
598
|
function fe(r) {
|
|
608
|
-
c ||
|
|
599
|
+
c || w("removeBanner()"), c.value = c.value.filter((C) => C.id !== r);
|
|
609
600
|
}
|
|
610
601
|
function ge() {
|
|
611
|
-
c ||
|
|
602
|
+
c || w("clearBanners()"), c.value = c.value.filter((r) => r._system);
|
|
612
603
|
}
|
|
613
604
|
let a = !1, i = !1;
|
|
614
605
|
function p(r) {
|
|
615
|
-
if (n ||
|
|
606
|
+
if (n || w("onActivated()"), a) {
|
|
616
607
|
console.warn("[useBlade] onActivated() already registered in this blade.");
|
|
617
608
|
return;
|
|
618
609
|
}
|
|
619
|
-
a = !0, q(
|
|
620
|
-
|
|
610
|
+
a = !0, q(_, (C) => {
|
|
611
|
+
C && r();
|
|
621
612
|
});
|
|
622
613
|
}
|
|
623
|
-
function
|
|
624
|
-
if (n ||
|
|
614
|
+
function h(r) {
|
|
615
|
+
if (n || w("onDeactivated()"), i) {
|
|
625
616
|
console.warn("[useBlade] onDeactivated() already registered in this blade.");
|
|
626
617
|
return;
|
|
627
618
|
}
|
|
628
|
-
i = !0, q(
|
|
629
|
-
|
|
619
|
+
i = !0, q(_, (C) => {
|
|
620
|
+
C || r();
|
|
630
621
|
});
|
|
631
622
|
}
|
|
632
623
|
return {
|
|
633
|
-
id:
|
|
634
|
-
param:
|
|
635
|
-
activeChildParam:
|
|
636
|
-
options:
|
|
637
|
-
query:
|
|
638
|
-
closable:
|
|
639
|
-
expanded:
|
|
640
|
-
name:
|
|
641
|
-
provideBladeData:
|
|
624
|
+
id: u,
|
|
625
|
+
param: g,
|
|
626
|
+
activeChildParam: I,
|
|
627
|
+
options: m,
|
|
628
|
+
query: l,
|
|
629
|
+
closable: b,
|
|
630
|
+
expanded: _,
|
|
631
|
+
name: v,
|
|
632
|
+
provideBladeData: $,
|
|
642
633
|
openBlade: M,
|
|
643
|
-
closeSelf:
|
|
634
|
+
closeSelf: B,
|
|
644
635
|
closeChildren: R,
|
|
645
636
|
replaceWith: Z,
|
|
646
637
|
coverWith: X,
|
|
647
638
|
callParent: Y,
|
|
648
639
|
exposeToChildren: le,
|
|
649
|
-
onBeforeClose:
|
|
640
|
+
onBeforeClose: de,
|
|
650
641
|
onActivated: p,
|
|
651
|
-
onDeactivated:
|
|
652
|
-
setError:
|
|
642
|
+
onDeactivated: h,
|
|
643
|
+
setError: ce,
|
|
653
644
|
clearError: j,
|
|
654
645
|
addBanner: pe,
|
|
655
646
|
removeBanner: fe,
|
|
@@ -703,28 +694,28 @@ function Ot(e, o, t) {
|
|
|
703
694
|
visible: !0
|
|
704
695
|
};
|
|
705
696
|
}
|
|
706
|
-
let
|
|
707
|
-
function
|
|
708
|
-
return `blade_${++
|
|
697
|
+
let kt = 0;
|
|
698
|
+
function Pt() {
|
|
699
|
+
return `blade_${++kt}_${Math.random().toString(36).slice(2, 8)}`;
|
|
709
700
|
}
|
|
710
701
|
function In(e, o) {
|
|
711
|
-
const t = D([]), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(),
|
|
702
|
+
const t = D([]), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = E(() => t.value[0]), u = E(() => t.value), g = E(() => {
|
|
712
703
|
for (let a = t.value.length - 1; a >= 0; a--)
|
|
713
704
|
if (t.value[a].visible) return t.value[a];
|
|
714
705
|
});
|
|
715
|
-
function
|
|
706
|
+
function m(a) {
|
|
716
707
|
s.delete(a), n.delete(a), c.delete(a), f.delete(a);
|
|
717
708
|
}
|
|
718
|
-
function
|
|
709
|
+
function l(a) {
|
|
719
710
|
const i = e.getBlade(a);
|
|
720
711
|
if (i)
|
|
721
712
|
return i.route;
|
|
722
713
|
}
|
|
723
|
-
const
|
|
724
|
-
generateId:
|
|
725
|
-
resolveUrl:
|
|
714
|
+
const b = {
|
|
715
|
+
generateId: Pt,
|
|
716
|
+
resolveUrl: l
|
|
726
717
|
};
|
|
727
|
-
async function
|
|
718
|
+
async function _(a) {
|
|
728
719
|
for (let i = a.length - 1; i >= 0; i--) {
|
|
729
720
|
const p = s.get(a[i].id);
|
|
730
721
|
if (p && await p())
|
|
@@ -732,12 +723,12 @@ function In(e, o) {
|
|
|
732
723
|
}
|
|
733
724
|
return !1;
|
|
734
725
|
}
|
|
735
|
-
function
|
|
726
|
+
function v(a) {
|
|
736
727
|
for (const i of a)
|
|
737
|
-
c.get(i.id)?.(),
|
|
728
|
+
c.get(i.id)?.(), m(i.id);
|
|
738
729
|
}
|
|
739
|
-
async function
|
|
740
|
-
if (
|
|
730
|
+
async function I(a) {
|
|
731
|
+
if (d.value?.name === a.name) return;
|
|
741
732
|
const p = e.getBlade(a.name);
|
|
742
733
|
if (!p)
|
|
743
734
|
throw new Error(`[BladeStack] Blade '${a.name}' not found in registry`);
|
|
@@ -745,41 +736,41 @@ function In(e, o) {
|
|
|
745
736
|
console.warn(`[BladeStack] Access denied to workspace '${a.name}'`);
|
|
746
737
|
return;
|
|
747
738
|
}
|
|
748
|
-
|
|
749
|
-
const
|
|
750
|
-
t.value = [
|
|
739
|
+
v([...t.value]);
|
|
740
|
+
const h = Tt(a, b);
|
|
741
|
+
t.value = [h], a.onOpen && n.set(h.id, a.onOpen), a.onClose && c.set(h.id, a.onClose), a.onOpen?.();
|
|
751
742
|
}
|
|
752
|
-
async function
|
|
743
|
+
async function P(a) {
|
|
753
744
|
if (!e.getBlade(a.name))
|
|
754
745
|
throw new Error(`[BladeStack] Blade '${a.name}' not found in registry`);
|
|
755
|
-
const i = a.parentId ??
|
|
746
|
+
const i = a.parentId ?? g.value?.id ?? d.value?.id;
|
|
756
747
|
if (!i)
|
|
757
748
|
throw new Error("[BladeStack] Cannot open blade: no parent blade found");
|
|
758
|
-
const p = t.value.findIndex((
|
|
749
|
+
const p = t.value.findIndex((C) => C.id === i);
|
|
759
750
|
if (p === -1)
|
|
760
751
|
throw new Error(`[BladeStack] Parent blade '${i}' not found in stack`);
|
|
761
|
-
const
|
|
762
|
-
if (
|
|
752
|
+
const h = t.value.slice(p + 1);
|
|
753
|
+
if (h.length > 0 && await _(h))
|
|
763
754
|
return;
|
|
764
|
-
|
|
765
|
-
const r = xt(a, i,
|
|
755
|
+
v(h);
|
|
756
|
+
const r = xt(a, i, b);
|
|
766
757
|
t.value = [...t.value.slice(0, p + 1), r], a.onOpen && n.set(r.id, a.onOpen), a.onClose && c.set(r.id, a.onClose), a.onOpen?.();
|
|
767
758
|
}
|
|
768
|
-
async function
|
|
769
|
-
const i = t.value.findIndex((
|
|
759
|
+
async function $(a) {
|
|
760
|
+
const i = t.value.findIndex((C) => C.id === a);
|
|
770
761
|
if (i === -1 || i === 0) return !1;
|
|
771
762
|
const p = t.value.slice(i);
|
|
772
|
-
if (await
|
|
773
|
-
|
|
763
|
+
if (await _(p)) return !0;
|
|
764
|
+
v(p), t.value = t.value.slice(0, i);
|
|
774
765
|
const r = t.value.length - 1;
|
|
775
766
|
if (r > 0 && !t.value[r].visible) {
|
|
776
|
-
const
|
|
777
|
-
|
|
767
|
+
const C = [...t.value];
|
|
768
|
+
C[r] = { ...C[r], visible: !0 }, t.value = C;
|
|
778
769
|
}
|
|
779
770
|
return !1;
|
|
780
771
|
}
|
|
781
772
|
async function M(a) {
|
|
782
|
-
const i =
|
|
773
|
+
const i = g.value;
|
|
783
774
|
if (!i)
|
|
784
775
|
throw new Error("[BladeStack] No active blade to replace");
|
|
785
776
|
if (!e.getBlade(a.name))
|
|
@@ -787,18 +778,18 @@ function In(e, o) {
|
|
|
787
778
|
const p = t.value.findIndex((k) => k.id === i.id);
|
|
788
779
|
if (p === -1)
|
|
789
780
|
throw new Error(`[BladeStack] Active blade '${i.id}' not found in stack`);
|
|
790
|
-
const
|
|
791
|
-
if (
|
|
792
|
-
if (await
|
|
793
|
-
|
|
781
|
+
const h = t.value.slice(p + 1);
|
|
782
|
+
if (h.length > 0) {
|
|
783
|
+
if (await _(h)) return;
|
|
784
|
+
v(h);
|
|
794
785
|
}
|
|
795
|
-
const r = St(a, i.parentId,
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
t.value =
|
|
786
|
+
const r = St(a, i.parentId, b);
|
|
787
|
+
v([i]);
|
|
788
|
+
const C = [...t.value.slice(0, p), r, ...t.value.slice(p + 1)];
|
|
789
|
+
t.value = C, a.onOpen && n.set(r.id, a.onOpen), a.onClose && c.set(r.id, a.onClose), a.onOpen?.();
|
|
799
790
|
}
|
|
800
|
-
async function
|
|
801
|
-
const i =
|
|
791
|
+
async function B(a) {
|
|
792
|
+
const i = g.value;
|
|
802
793
|
if (!i)
|
|
803
794
|
throw new Error("[BladeStack] No active blade to cover");
|
|
804
795
|
if (!e.getBlade(a.name))
|
|
@@ -806,19 +797,19 @@ function In(e, o) {
|
|
|
806
797
|
const p = t.value.findIndex((k) => k.id === i.id);
|
|
807
798
|
if (p === -1)
|
|
808
799
|
throw new Error(`[BladeStack] Active blade '${i.id}' not found in stack`);
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
if (await
|
|
812
|
-
|
|
800
|
+
const h = t.value.slice(p + 1);
|
|
801
|
+
if (h.length > 0) {
|
|
802
|
+
if (await _(h)) return;
|
|
803
|
+
v(h);
|
|
813
804
|
}
|
|
814
|
-
const r = Ot(a, i.id,
|
|
815
|
-
|
|
805
|
+
const r = Ot(a, i.id, b), C = t.value.slice(0, p);
|
|
806
|
+
C.push({ ...i, visible: !1 }), C.push(r), t.value = C, a.onOpen && n.set(r.id, a.onOpen), a.onClose && c.set(r.id, a.onClose), a.onOpen?.();
|
|
816
807
|
}
|
|
817
808
|
async function R(a) {
|
|
818
809
|
const i = t.value.findIndex((r) => r.id === a);
|
|
819
810
|
if (i === -1) return;
|
|
820
811
|
const p = t.value.slice(i + 1);
|
|
821
|
-
p.length === 0 || await
|
|
812
|
+
p.length === 0 || await _(p) || (v(p), t.value = t.value.slice(0, i + 1));
|
|
822
813
|
}
|
|
823
814
|
function Z(a, i) {
|
|
824
815
|
s.set(a, i);
|
|
@@ -829,29 +820,29 @@ function In(e, o) {
|
|
|
829
820
|
function Y(a, i) {
|
|
830
821
|
const p = t.value.findIndex((r) => r.id === a);
|
|
831
822
|
if (p === -1) return;
|
|
832
|
-
const
|
|
833
|
-
|
|
823
|
+
const h = [...t.value];
|
|
824
|
+
h[p] = { ...h[p], error: i }, t.value = h;
|
|
834
825
|
}
|
|
835
826
|
function le(a) {
|
|
836
|
-
const i = t.value.findIndex((
|
|
827
|
+
const i = t.value.findIndex((h) => h.id === a);
|
|
837
828
|
if (i === -1) return;
|
|
838
829
|
const p = [...t.value];
|
|
839
830
|
p[i] = { ...p[i], error: void 0 }, t.value = p;
|
|
840
831
|
}
|
|
841
|
-
function
|
|
832
|
+
function de(a, i) {
|
|
842
833
|
const p = t.value.findIndex((r) => r.id === a);
|
|
843
834
|
if (p === -1 || t.value[p].title === i) return;
|
|
844
|
-
const
|
|
845
|
-
|
|
835
|
+
const h = [...t.value];
|
|
836
|
+
h[p] = { ...h[p], title: i }, t.value = h;
|
|
846
837
|
}
|
|
847
|
-
function
|
|
838
|
+
function ce(a, i) {
|
|
848
839
|
const p = t.value.findIndex((L) => L.id === a);
|
|
849
840
|
if (p === -1) return;
|
|
850
|
-
const
|
|
841
|
+
const h = t.value[p].query ?? {}, r = { ...h };
|
|
851
842
|
for (const [L, ve] of Object.entries(i))
|
|
852
843
|
ve === "" || ve == null ? delete r[L] : r[L] = ve;
|
|
853
|
-
const
|
|
854
|
-
if (
|
|
844
|
+
const C = Object.keys(h), k = Object.keys(r);
|
|
845
|
+
if (C.length === k.length && k.every((L) => h[L] === r[L]))
|
|
855
846
|
return;
|
|
856
847
|
const J = [...t.value];
|
|
857
848
|
J[p] = { ...J[p], query: r }, t.value = J;
|
|
@@ -872,25 +863,25 @@ function In(e, o) {
|
|
|
872
863
|
}
|
|
873
864
|
function ge(a) {
|
|
874
865
|
for (const i of t.value)
|
|
875
|
-
|
|
866
|
+
m(i.id);
|
|
876
867
|
t.value = a;
|
|
877
868
|
}
|
|
878
869
|
return {
|
|
879
|
-
workspace:
|
|
880
|
-
blades:
|
|
881
|
-
activeBlade:
|
|
882
|
-
openWorkspace:
|
|
883
|
-
openBlade:
|
|
884
|
-
closeBlade:
|
|
870
|
+
workspace: d,
|
|
871
|
+
blades: u,
|
|
872
|
+
activeBlade: g,
|
|
873
|
+
openWorkspace: I,
|
|
874
|
+
openBlade: P,
|
|
875
|
+
closeBlade: $,
|
|
885
876
|
closeChildren: R,
|
|
886
877
|
replaceCurrentBlade: M,
|
|
887
|
-
coverCurrentBlade:
|
|
878
|
+
coverCurrentBlade: B,
|
|
888
879
|
registerBeforeClose: Z,
|
|
889
880
|
unregisterBeforeClose: X,
|
|
890
881
|
setBladeError: Y,
|
|
891
882
|
clearBladeError: le,
|
|
892
|
-
setBladeTitle:
|
|
893
|
-
updateBladeQuery:
|
|
883
|
+
setBladeTitle: de,
|
|
884
|
+
updateBladeQuery: ce,
|
|
894
885
|
getMaximizedRef: j,
|
|
895
886
|
isMaximized: ue,
|
|
896
887
|
setMaximized: pe,
|
|
@@ -906,7 +897,7 @@ function Mt() {
|
|
|
906
897
|
}
|
|
907
898
|
const V = W("use-ai-agent");
|
|
908
899
|
function Tn(e) {
|
|
909
|
-
const o = N(je), { user: t, getAccessToken: s } = Qe(), { openBlade: n } = It(), { blades: c, activeBlade: f } = Mt(),
|
|
900
|
+
const o = N(je), { user: t, getAccessToken: s } = Qe(), { openBlade: n } = It(), { blades: c, activeBlade: f } = Mt(), d = e?.isEmbedded, u = ct({
|
|
910
901
|
userGetter: () => {
|
|
911
902
|
if (t.value)
|
|
912
903
|
return {
|
|
@@ -917,44 +908,44 @@ function Tn(e) {
|
|
|
917
908
|
};
|
|
918
909
|
},
|
|
919
910
|
bladeGetter: () => {
|
|
920
|
-
const
|
|
921
|
-
return
|
|
922
|
-
id:
|
|
923
|
-
name:
|
|
924
|
-
title:
|
|
925
|
-
param:
|
|
926
|
-
options:
|
|
911
|
+
const m = f.value ?? c.value[c.value.length - 1];
|
|
912
|
+
return m ? {
|
|
913
|
+
id: m.id,
|
|
914
|
+
name: m.name,
|
|
915
|
+
title: m.title,
|
|
916
|
+
param: m.param,
|
|
917
|
+
options: m.options
|
|
927
918
|
} : null;
|
|
928
919
|
},
|
|
929
920
|
localeGetter: () => o?.currentLocale.value ?? "en",
|
|
930
921
|
tokenGetter: s,
|
|
931
|
-
navigateToBlade: (
|
|
932
|
-
n({ name:
|
|
933
|
-
V.debug(`Navigated to blade: ${
|
|
934
|
-
}).catch((
|
|
935
|
-
V.warn(`Blade not found or cannot be opened: ${
|
|
922
|
+
navigateToBlade: (m, l, b) => {
|
|
923
|
+
n({ name: m, param: l, options: b }).then(() => {
|
|
924
|
+
V.debug(`Navigated to blade: ${m}`);
|
|
925
|
+
}).catch((_) => {
|
|
926
|
+
V.warn(`Blade not found or cannot be opened: ${m}`, _);
|
|
936
927
|
});
|
|
937
928
|
},
|
|
938
929
|
initialConfig: e?.config,
|
|
939
|
-
isEmbedded:
|
|
930
|
+
isEmbedded: d
|
|
940
931
|
});
|
|
941
|
-
if (
|
|
942
|
-
const
|
|
943
|
-
|
|
932
|
+
if (ke(be, u), V.debug("AiAgentService provided"), e?.addGlobalToolbarButton ?? !0) {
|
|
933
|
+
const m = N(Je, null);
|
|
934
|
+
m ? (m.registerToolbarItem(
|
|
944
935
|
{
|
|
945
936
|
id: ot,
|
|
946
937
|
icon: rt,
|
|
947
938
|
title: it,
|
|
948
939
|
shortcut: Q.mod.i,
|
|
949
940
|
clickHandler: () => {
|
|
950
|
-
|
|
941
|
+
u.togglePanel();
|
|
951
942
|
}
|
|
952
943
|
},
|
|
953
944
|
"*"
|
|
954
945
|
// Wildcard for all blades
|
|
955
946
|
), V.debug("Global AI toolbar button registered with wildcard '*'")) : V.warn("Toolbar service not available, AI button not registered");
|
|
956
947
|
}
|
|
957
|
-
return
|
|
948
|
+
return u;
|
|
958
949
|
}
|
|
959
950
|
function xn() {
|
|
960
951
|
const e = N(be);
|
|
@@ -1013,8 +1004,8 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1013
1004
|
animated: { type: Boolean, default: !1 }
|
|
1014
1005
|
},
|
|
1015
1006
|
setup(e) {
|
|
1016
|
-
const o =
|
|
1017
|
-
return (t, s) => (
|
|
1007
|
+
const o = E(() => `virto-oz-clip-${Math.random().toString(36).substring(2, 11)}`);
|
|
1008
|
+
return (t, s) => (y(), x("svg", {
|
|
1018
1009
|
width: e.width,
|
|
1019
1010
|
height: e.height,
|
|
1020
1011
|
viewBox: "0 0 99 108",
|
|
@@ -1026,7 +1017,7 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1026
1017
|
d: "M40.1199 2.41576C45.6989 -0.805254 52.5724 -0.805253 58.1514 2.41576L89.2556 20.3738C94.8345 23.5948 98.2713 29.5475 98.2713 35.9895V71.9055C98.2713 78.3475 94.8345 84.3002 89.2556 87.5212L58.1514 105.479C52.5724 108.7 45.6989 108.7 40.1199 105.479L9.01574 87.5212C3.43678 84.3002 0 78.3475 0 71.9055V35.9895C0 29.5475 3.43678 23.5948 9.01574 20.3738L40.1199 2.41576Z",
|
|
1027
1018
|
fill: "white"
|
|
1028
1019
|
}, null, -1)),
|
|
1029
|
-
e.animated ? (
|
|
1020
|
+
e.animated ? (y(), x("path", Nt)) : (y(), x("g", {
|
|
1030
1021
|
key: 0,
|
|
1031
1022
|
"clip-path": `url(#${o.value})`
|
|
1032
1023
|
}, [...s[0] || (s[0] = [
|
|
@@ -1078,13 +1069,13 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1078
1069
|
fill: "#6C6C6C"
|
|
1079
1070
|
}, null, -1)),
|
|
1080
1071
|
A("defs", null, [
|
|
1081
|
-
e.animated ? z("", !0) : (
|
|
1072
|
+
e.animated ? z("", !0) : (y(), x("clipPath", {
|
|
1082
1073
|
key: 0,
|
|
1083
1074
|
id: o.value
|
|
1084
1075
|
}, [...s[1] || (s[1] = [
|
|
1085
1076
|
A("path", { d: "M72.9199 46.4165C73.2527 46.9495 73.5831 47.4996 73.9092 48.0679C78.4022 55.8976 79.0605 66.3551 76.7793 76.6079C74.5635 86.5668 69.6096 96.1504 62.9795 102.692L58.1514 105.48C52.5725 108.701 45.699 108.701 40.1201 105.48L21.665 94.8247C29.1398 95.4723 37.0781 94.4072 44.3848 91.9233C54.5984 88.4512 63.7463 82.1497 68.6807 73.6548C75.124 62.5619 75.4351 53.2694 72.9199 46.4165ZM56.5205 29.5093C65.5697 29.5331 75.1259 33.9964 83.0215 40.8853C89.9848 46.9608 95.5441 54.8286 98.2715 62.9478V71.9058C98.2715 78.3478 94.8348 84.301 89.2559 87.522L69.4658 98.9468C74.0688 92.6731 77.4601 84.9996 79.207 77.1479C81.5723 66.517 80.9666 55.3703 76.0654 46.8296C69.6817 35.7054 61.7917 30.789 54.6006 29.5396C55.2271 29.5179 55.867 29.5076 56.5205 29.5093ZM0 50.688C3.16812 57.476 8.04614 63.7935 13.8389 68.853C21.9305 75.9204 31.9368 80.6465 41.7578 80.6724C54.5833 80.706 62.7851 76.3308 67.4629 70.728C67.1684 71.2812 66.8584 71.8408 66.5303 72.4058C61.9844 80.2318 53.417 86.2251 43.584 89.5679C34.4355 92.6779 24.3375 93.4401 15.6328 91.3423L9.01562 87.522C3.43667 84.301 0 78.3478 0 71.9058V50.688ZM26.7559 10.1313C22.5672 16.2131 19.6599 23.483 18.2695 30.9126C16.3077 41.3962 17.3358 52.3558 22.2188 60.8647C28.6034 71.9905 36.4946 76.9061 43.6865 78.1548C43.0594 78.1765 42.4188 78.1868 41.7646 78.1851C32.7113 78.1612 23.2602 73.7801 15.4746 66.98C8.2197 60.6434 2.52684 52.3035 0 43.7075V35.9897C6.33247e-05 29.5479 3.43687 23.5955 9.01562 20.3745L26.7559 10.1313ZM51.2432 31.6978C54.0287 31.7659 57.0796 32.4389 60.1875 33.9976C58.8529 33.7029 57.5584 33.677 56.3965 33.9722L57.0088 36.3833C58.4774 36.0102 60.6741 36.4134 63.0332 37.8237C65.3553 39.212 67.6865 41.4953 69.375 44.5923C70.7081 47.0376 71.6489 50.015 71.8535 53.4839C71.4414 52.1828 70.818 51.0505 69.9824 50.1929L68.2012 51.9282C69.2585 53.0135 70.0076 55.1176 69.9658 57.8657C69.9246 60.5708 69.1121 63.731 67.2744 66.7417C65.8225 69.1203 63.7129 71.4251 60.8086 73.3374C61.7311 72.329 62.4012 71.2217 62.7266 70.0679L60.333 69.3931C59.9218 70.8514 58.4742 72.5523 56.0732 73.8901C53.71 75.207 50.5672 76.0837 47.041 75.9976C44.2551 75.9294 41.204 75.2549 38.0957 73.6958C39.4307 73.9907 40.7254 74.0184 41.8877 73.7231L41.2754 71.312C39.8069 71.6851 37.6101 71.2818 35.251 69.8716C32.9289 68.4834 30.5977 66.2 28.9092 63.103C27.5754 60.6565 26.6337 57.6775 26.4297 54.2065C26.8418 55.5096 27.4661 56.6438 28.3027 57.5024L30.084 55.7661C29.0267 54.6807 28.2775 52.5767 28.3193 49.8286C28.3606 47.1236 29.173 43.9633 31.0107 40.9526C32.4621 38.5751 34.5702 36.2706 37.4727 34.3589C36.5514 35.3666 35.8827 36.4736 35.5576 37.6265L37.9512 38.3013C38.3625 36.8429 39.8101 35.142 42.2109 33.8042C44.5742 32.4874 47.717 31.6116 51.2432 31.6978ZM40.1201 2.4165C45.6991 -0.804509 52.5724 -0.804509 58.1514 2.4165L75.6777 12.5356C68.4683 12.0708 60.8765 13.1991 53.8691 15.6333C43.6671 19.1774 34.5353 25.5492 29.6035 34.0396C23.1612 45.1305 22.8486 54.4223 25.3623 61.2749C25.0301 60.7429 24.7004 60.1936 24.375 59.6265C19.8639 51.765 18.8286 41.4457 20.7139 31.3706C22.4486 22.1007 26.633 13.1734 32.6709 6.71631L40.1201 2.4165ZM54.6855 17.9829C63.3703 14.966 72.9092 14.0715 81.3008 15.7817L89.2559 20.3745C94.8346 23.5955 98.2714 29.5479 98.2715 35.9897V56.4692C95.0606 49.9731 90.2759 43.9144 84.6562 39.0112C76.4636 31.8632 66.3524 27.0488 56.5273 27.0229C43.6978 26.9893 35.4935 31.3659 30.8164 36.9712C31.1117 36.4161 31.4247 35.8554 31.7539 35.2886C36.3024 27.4582 44.8633 21.395 54.6855 17.9829Z" }, null, -1)
|
|
1086
1077
|
])], 8, Ft)),
|
|
1087
|
-
e.animated ? (
|
|
1078
|
+
e.animated ? (y(), x("linearGradient", $t, [...s[2] || (s[2] = [
|
|
1088
1079
|
Ke('<stop offset="0%" stop-color="#FF9533"><animate attributeName="stop-color" values="#FF9533;#FF4FBB;#EAFF4F;#1C91FC;#9A2DF8;#FF9533" dur="4s" repeatCount="indefinite"></animate></stop><stop offset="25%" stop-color="#FF4FBB"><animate attributeName="stop-color" values="#FF4FBB;#EAFF4F;#1C91FC;#9A2DF8;#FF9533;#FF4FBB" dur="4s" repeatCount="indefinite"></animate></stop><stop offset="50%" stop-color="#EAFF4F"><animate attributeName="stop-color" values="#EAFF4F;#1C91FC;#9A2DF8;#FF9533;#FF4FBB;#EAFF4F" dur="4s" repeatCount="indefinite"></animate></stop><stop offset="75%" stop-color="#1C91FC"><animate attributeName="stop-color" values="#1C91FC;#9A2DF8;#FF9533;#FF4FBB;#EAFF4F;#1C91FC" dur="4s" repeatCount="indefinite"></animate></stop><stop offset="100%" stop-color="#9A2DF8"><animate attributeName="stop-color" values="#9A2DF8;#FF9533;#FF4FBB;#EAFF4F;#1C91FC;#9A2DF8" dur="4s" repeatCount="indefinite"></animate></stop>', 5)
|
|
1089
1080
|
])])) : z("", !0)
|
|
1090
1081
|
])
|
|
@@ -1100,9 +1091,9 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1100
1091
|
separated: { type: Boolean, default: !1 }
|
|
1101
1092
|
},
|
|
1102
1093
|
setup(e) {
|
|
1103
|
-
return (o, t) => (
|
|
1104
|
-
(
|
|
1105
|
-
e.separated && n > 0 ? (
|
|
1094
|
+
return (o, t) => (y(), x("span", Rt, [
|
|
1095
|
+
(y(!0), x(Ae, null, qe(e.parts, (s, n) => (y(), x(Ae, { key: n }, [
|
|
1096
|
+
e.separated && n > 0 ? (y(), x("span", Ut, "+")) : z("", !0),
|
|
1106
1097
|
A("kbd", Gt, K(s), 1)
|
|
1107
1098
|
], 64))), 128))
|
|
1108
1099
|
]));
|
|
@@ -1116,10 +1107,10 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1116
1107
|
},
|
|
1117
1108
|
emits: ["close", "expand", "collapse"],
|
|
1118
1109
|
setup(e) {
|
|
1119
|
-
const { t: o } = nt(), { isMac: t } = Ne(), s =
|
|
1120
|
-
return (
|
|
1110
|
+
const { t: o } = nt(), { isMac: t } = Ne(), s = E(() => Ee(Q.escape, t)), n = E(() => Ee(Q.mod.backslash, t)), c = E(() => s.value.aria), f = E(() => n.value.aria);
|
|
1111
|
+
return (d, u) => (y(), x("div", Vt, [
|
|
1121
1112
|
A("div", Kt, [
|
|
1122
|
-
|
|
1113
|
+
O(Ue, {
|
|
1123
1114
|
width: 22,
|
|
1124
1115
|
height: 24,
|
|
1125
1116
|
"show-dots": ""
|
|
@@ -1131,91 +1122,91 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1131
1122
|
])
|
|
1132
1123
|
]),
|
|
1133
1124
|
A("div", Wt, [
|
|
1134
|
-
e.isExpanded ? (
|
|
1125
|
+
e.isExpanded ? (y(), se(T(me), {
|
|
1135
1126
|
key: 0,
|
|
1136
1127
|
placement: "bottom"
|
|
1137
1128
|
}, {
|
|
1138
|
-
tooltip:
|
|
1129
|
+
tooltip: F(() => [
|
|
1139
1130
|
A("span", Xt, [
|
|
1140
|
-
Ce(K(
|
|
1141
|
-
|
|
1131
|
+
Ce(K(T(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.RESTORE")) + " ", 1),
|
|
1132
|
+
O(_e, {
|
|
1142
1133
|
parts: n.value.parts,
|
|
1143
|
-
separated: !
|
|
1134
|
+
separated: !T(t)
|
|
1144
1135
|
}, null, 8, ["parts", "separated"])
|
|
1145
1136
|
])
|
|
1146
1137
|
]),
|
|
1147
|
-
default:
|
|
1138
|
+
default: F(() => [
|
|
1148
1139
|
A("div", {
|
|
1149
1140
|
class: "vc-ai-agent-header__button",
|
|
1150
1141
|
role: "button",
|
|
1151
1142
|
tabindex: "0",
|
|
1152
|
-
"aria-label":
|
|
1143
|
+
"aria-label": T(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.RESTORE"),
|
|
1153
1144
|
"aria-keyshortcuts": f.value,
|
|
1154
|
-
onClick:
|
|
1145
|
+
onClick: u[0] || (u[0] = (g) => d.$emit("collapse")),
|
|
1155
1146
|
onKeydown: [
|
|
1156
|
-
|
|
1157
|
-
|
|
1147
|
+
u[1] || (u[1] = U(G((g) => d.$emit("collapse"), ["prevent"]), ["enter"])),
|
|
1148
|
+
u[2] || (u[2] = U(G((g) => d.$emit("collapse"), ["prevent"]), ["space"]))
|
|
1158
1149
|
]
|
|
1159
1150
|
}, [
|
|
1160
|
-
|
|
1151
|
+
O(T(ie), { icon: "lucide-minus" })
|
|
1161
1152
|
], 40, Zt)
|
|
1162
1153
|
]),
|
|
1163
1154
|
_: 1
|
|
1164
|
-
})) : (
|
|
1155
|
+
})) : (y(), se(T(me), {
|
|
1165
1156
|
key: 1,
|
|
1166
1157
|
placement: "bottom"
|
|
1167
1158
|
}, {
|
|
1168
|
-
tooltip:
|
|
1159
|
+
tooltip: F(() => [
|
|
1169
1160
|
A("span", jt, [
|
|
1170
|
-
Ce(K(
|
|
1171
|
-
|
|
1161
|
+
Ce(K(T(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.MAXIMIZE")) + " ", 1),
|
|
1162
|
+
O(_e, {
|
|
1172
1163
|
parts: n.value.parts,
|
|
1173
|
-
separated: !
|
|
1164
|
+
separated: !T(t)
|
|
1174
1165
|
}, null, 8, ["parts", "separated"])
|
|
1175
1166
|
])
|
|
1176
1167
|
]),
|
|
1177
|
-
default:
|
|
1168
|
+
default: F(() => [
|
|
1178
1169
|
A("div", {
|
|
1179
1170
|
class: "vc-ai-agent-header__button",
|
|
1180
1171
|
role: "button",
|
|
1181
1172
|
tabindex: "0",
|
|
1182
|
-
"aria-label":
|
|
1173
|
+
"aria-label": T(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.MAXIMIZE"),
|
|
1183
1174
|
"aria-keyshortcuts": f.value,
|
|
1184
|
-
onClick:
|
|
1175
|
+
onClick: u[3] || (u[3] = (g) => d.$emit("expand")),
|
|
1185
1176
|
onKeydown: [
|
|
1186
|
-
|
|
1187
|
-
|
|
1177
|
+
u[4] || (u[4] = U(G((g) => d.$emit("expand"), ["prevent"]), ["enter"])),
|
|
1178
|
+
u[5] || (u[5] = U(G((g) => d.$emit("expand"), ["prevent"]), ["space"]))
|
|
1188
1179
|
]
|
|
1189
1180
|
}, [
|
|
1190
|
-
|
|
1181
|
+
O(T(ie), { icon: "lucide-panel-top" })
|
|
1191
1182
|
], 40, Yt)
|
|
1192
1183
|
]),
|
|
1193
1184
|
_: 1
|
|
1194
1185
|
})),
|
|
1195
|
-
|
|
1196
|
-
tooltip:
|
|
1186
|
+
O(T(me), { placement: "bottom" }, {
|
|
1187
|
+
tooltip: F(() => [
|
|
1197
1188
|
A("span", Jt, [
|
|
1198
|
-
Ce(K(
|
|
1199
|
-
|
|
1189
|
+
Ce(K(T(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.CLOSE")) + " ", 1),
|
|
1190
|
+
O(_e, {
|
|
1200
1191
|
parts: s.value.parts,
|
|
1201
|
-
separated: !
|
|
1192
|
+
separated: !T(t)
|
|
1202
1193
|
}, null, 8, ["parts", "separated"])
|
|
1203
1194
|
])
|
|
1204
1195
|
]),
|
|
1205
|
-
default:
|
|
1196
|
+
default: F(() => [
|
|
1206
1197
|
A("div", {
|
|
1207
1198
|
class: "vc-ai-agent-header__button",
|
|
1208
1199
|
role: "button",
|
|
1209
1200
|
tabindex: "0",
|
|
1210
|
-
"aria-label":
|
|
1201
|
+
"aria-label": T(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.CLOSE"),
|
|
1211
1202
|
"aria-keyshortcuts": c.value,
|
|
1212
|
-
onClick:
|
|
1203
|
+
onClick: u[6] || (u[6] = (g) => d.$emit("close")),
|
|
1213
1204
|
onKeydown: [
|
|
1214
|
-
|
|
1215
|
-
|
|
1205
|
+
u[7] || (u[7] = U(G((g) => d.$emit("close"), ["prevent"]), ["enter"])),
|
|
1206
|
+
u[8] || (u[8] = U(G((g) => d.$emit("close"), ["prevent"]), ["space"]))
|
|
1216
1207
|
]
|
|
1217
1208
|
}, [
|
|
1218
|
-
|
|
1209
|
+
O(T(ie), { icon: "lucide-x" })
|
|
1219
1210
|
], 40, Qt)
|
|
1220
1211
|
]),
|
|
1221
1212
|
_: 1
|
|
@@ -1232,23 +1223,23 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1232
1223
|
text: {}
|
|
1233
1224
|
},
|
|
1234
1225
|
setup(e) {
|
|
1235
|
-
return (o, t) => (
|
|
1226
|
+
return (o, t) => (y(), x("div", tn, [
|
|
1236
1227
|
A("div", nn, [
|
|
1237
1228
|
A("div", an, [
|
|
1238
|
-
|
|
1229
|
+
O(Ue, {
|
|
1239
1230
|
width: 80,
|
|
1240
1231
|
height: 87,
|
|
1241
1232
|
animated: ""
|
|
1242
1233
|
})
|
|
1243
1234
|
]),
|
|
1244
|
-
e.text ? (
|
|
1235
|
+
e.text ? (y(), x("p", on, K(e.text), 1)) : z("", !0)
|
|
1245
1236
|
])
|
|
1246
1237
|
]));
|
|
1247
1238
|
}
|
|
1248
|
-
}), sn = { class: "vc-ai-agent-iframe" }, ln = ["src"],
|
|
1239
|
+
}), sn = { class: "vc-ai-agent-iframe" }, ln = ["src"], dn = {
|
|
1249
1240
|
key: 1,
|
|
1250
1241
|
class: "vc-ai-agent-iframe__placeholder"
|
|
1251
|
-
},
|
|
1242
|
+
}, cn = /* @__PURE__ */ H({
|
|
1252
1243
|
__name: "VcAiAgentIframe",
|
|
1253
1244
|
props: {
|
|
1254
1245
|
url: {}
|
|
@@ -1258,12 +1249,12 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1258
1249
|
const t = W("ai-agent-iframe"), s = e, n = o, c = D(null), f = D(!0);
|
|
1259
1250
|
q(
|
|
1260
1251
|
c,
|
|
1261
|
-
(
|
|
1262
|
-
|
|
1252
|
+
(u) => {
|
|
1253
|
+
u && n("iframe-ready", u);
|
|
1263
1254
|
},
|
|
1264
1255
|
{ immediate: !0 }
|
|
1265
1256
|
);
|
|
1266
|
-
const
|
|
1257
|
+
const d = () => {
|
|
1267
1258
|
f.value = !1, t.debug("Iframe loaded");
|
|
1268
1259
|
};
|
|
1269
1260
|
return q(
|
|
@@ -1271,17 +1262,17 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1271
1262
|
() => {
|
|
1272
1263
|
f.value = !0;
|
|
1273
1264
|
}
|
|
1274
|
-
), (
|
|
1275
|
-
|
|
1276
|
-
default:
|
|
1277
|
-
f.value && e.url ? (
|
|
1265
|
+
), (u, g) => (y(), x("div", sn, [
|
|
1266
|
+
O(Pe, { name: "fade" }, {
|
|
1267
|
+
default: F(() => [
|
|
1268
|
+
f.value && e.url ? (y(), se(rn, {
|
|
1278
1269
|
key: 0,
|
|
1279
|
-
text:
|
|
1270
|
+
text: u.$t("AI_AGENT.LOADING")
|
|
1280
1271
|
}, null, 8, ["text"])) : z("", !0)
|
|
1281
1272
|
]),
|
|
1282
1273
|
_: 1
|
|
1283
1274
|
}),
|
|
1284
|
-
e.url ? (
|
|
1275
|
+
e.url ? (y(), x("iframe", {
|
|
1285
1276
|
key: 0,
|
|
1286
1277
|
ref_key: "iframeRef",
|
|
1287
1278
|
ref: c,
|
|
@@ -1289,14 +1280,14 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1289
1280
|
class: Me(["vc-ai-agent-iframe__frame", { "vc-ai-agent-iframe__frame--loading": f.value }]),
|
|
1290
1281
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",
|
|
1291
1282
|
allow: "clipboard-read; clipboard-write",
|
|
1292
|
-
onLoad:
|
|
1293
|
-
}, null, 42, ln)) : (
|
|
1294
|
-
|
|
1283
|
+
onLoad: d
|
|
1284
|
+
}, null, 42, ln)) : (y(), x("div", dn, [
|
|
1285
|
+
O(T(ie), {
|
|
1295
1286
|
icon: "lucide-sparkles",
|
|
1296
1287
|
size: "xl",
|
|
1297
1288
|
class: "vc-ai-agent-iframe__placeholder-icon"
|
|
1298
1289
|
}),
|
|
1299
|
-
|
|
1290
|
+
g[0] || (g[0] = A("p", { class: "vc-ai-agent-iframe__placeholder-text" }, "AI Agent URL not configured", -1))
|
|
1300
1291
|
]))
|
|
1301
1292
|
]));
|
|
1302
1293
|
}
|
|
@@ -1305,46 +1296,46 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1305
1296
|
setup(e) {
|
|
1306
1297
|
const { isMac: o } = Ne(), t = N(be), s = N(et, !1);
|
|
1307
1298
|
t || console.error("[VcAiAgentPanel] AiAgentService not provided");
|
|
1308
|
-
const n =
|
|
1299
|
+
const n = E(
|
|
1309
1300
|
() => t?.config.value ?? { url: "", title: "AI Assistant", width: 362, expandedWidth: 500 }
|
|
1310
|
-
), c =
|
|
1301
|
+
), c = E(() => !s && (t?.isOpen.value ?? !1)), f = E(() => t?.isExpanded.value ?? !1), d = E(() => t?.totalItemsCount.value ?? 0), u = E(() => ({
|
|
1311
1302
|
width: f.value ? `${n.value.expandedWidth ?? 500}px` : `${n.value.width ?? 362}px`
|
|
1312
|
-
})),
|
|
1313
|
-
tt(document, "keydown", (
|
|
1314
|
-
if (c.value && !
|
|
1315
|
-
if (
|
|
1316
|
-
|
|
1303
|
+
})), g = () => t?.closePanel(), m = () => t?.expandPanel(), l = () => t?.collapsePanel();
|
|
1304
|
+
tt(document, "keydown", (_) => {
|
|
1305
|
+
if (c.value && !_.isComposing && !_.defaultPrevented) {
|
|
1306
|
+
if (_.key === "Escape") {
|
|
1307
|
+
_.preventDefault(), g();
|
|
1317
1308
|
return;
|
|
1318
1309
|
}
|
|
1319
|
-
Et(Q.mod.backslash,
|
|
1310
|
+
Et(Q.mod.backslash, _, o) && (_.preventDefault(), f.value ? l() : m());
|
|
1320
1311
|
}
|
|
1321
1312
|
});
|
|
1322
|
-
const
|
|
1323
|
-
t?._setIframeRef(
|
|
1313
|
+
const b = (_) => {
|
|
1314
|
+
t?._setIframeRef(_);
|
|
1324
1315
|
};
|
|
1325
1316
|
return ze(() => {
|
|
1326
1317
|
t?._setIframeRef(null);
|
|
1327
|
-
}), (
|
|
1328
|
-
default:
|
|
1329
|
-
c.value ? (
|
|
1318
|
+
}), (_, v) => (y(), se(Pe, { name: "ai-panel-slide" }, {
|
|
1319
|
+
default: F(() => [
|
|
1320
|
+
c.value ? (y(), x("div", {
|
|
1330
1321
|
key: 0,
|
|
1331
1322
|
class: Me(["vc-ai-agent-panel", {
|
|
1332
1323
|
"vc-ai-agent-panel--expanded": f.value
|
|
1333
1324
|
}]),
|
|
1334
|
-
style: He(
|
|
1325
|
+
style: He(u.value)
|
|
1335
1326
|
}, [
|
|
1336
|
-
|
|
1327
|
+
O(en, {
|
|
1337
1328
|
title: n.value.title,
|
|
1338
1329
|
"is-expanded": f.value,
|
|
1339
|
-
"items-count":
|
|
1340
|
-
onClose:
|
|
1341
|
-
onExpand:
|
|
1342
|
-
onCollapse:
|
|
1330
|
+
"items-count": d.value,
|
|
1331
|
+
onClose: g,
|
|
1332
|
+
onExpand: m,
|
|
1333
|
+
onCollapse: l
|
|
1343
1334
|
}, null, 8, ["title", "is-expanded", "items-count"]),
|
|
1344
1335
|
A("div", un, [
|
|
1345
|
-
|
|
1336
|
+
O(cn, {
|
|
1346
1337
|
url: n.value.url,
|
|
1347
|
-
onIframeReady:
|
|
1338
|
+
onIframeReady: b
|
|
1348
1339
|
}, null, 8, ["url"])
|
|
1349
1340
|
])
|
|
1350
1341
|
], 6)) : z("", !0)
|