@vc-shell/framework 2.4.0-pr305.1f96afd → 2.4.0-pr306.6ac3fa2
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-CzeWZLxJ.js → VcAiAgentPanel.vue_vue_type_script_setup_true_lang-B14Pt_5D.js} +341 -340
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-B14Pt_5D.js.map +1 -0
- package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-a2joBaMe.js → VcScheduler.vue_vue_type_script_setup_true_lang-CxJ7HTEq.js} +4773 -4749
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-CxJ7HTEq.js.map +1 -0
- package/dist/chunks/{index-BSOHtJam.js → index-BLL7pyCO.js} +1 -1
- package/dist/chunks/{index-BSOHtJam.js.map → index-BLL7pyCO.js.map} +1 -1
- package/dist/core/composables/usePopup/index.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts +4 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts.map +1 -1
- package/dist/framework.js +9 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts.map +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-CzeWZLxJ.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-a2joBaMe.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as D, computed as b, shallowRef as Ge, watch as q, getCurrentInstance as ee, inject as N, isRef as Ve, provide as Pe, defineComponent as H, openBlock as B, createElementBlock as S, createElementVNode as A, createCommentVNode as z, createStaticVNode as Ke, Fragment as Ae, renderList as qe, toDisplayString as K, createVNode as P, createBlock as se, unref as x, withCtx as F, withKeys as U, withModifiers as G, createTextVNode as Ce, Transition as ke, 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-CZdY18Hq.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";
|
|
@@ -10,19 +10,19 @@ const at = {
|
|
|
10
10
|
expandedWidth: 500,
|
|
11
11
|
// Secure by default: no origins trusted until the embedder configures them.
|
|
12
12
|
allowedOrigins: []
|
|
13
|
-
},
|
|
13
|
+
}, hn = "APP_AI_AGENT_URL", _n = {
|
|
14
14
|
EMBEDDED_APP_READY: "EMBEDDED_APP_READY",
|
|
15
15
|
AI_TOGGLE_PANEL: "AI_TOGGLE_PANEL",
|
|
16
16
|
AI_CONTEXT_UPDATE: "AI_CONTEXT_UPDATE",
|
|
17
17
|
AI_CONTEXT_CLEAR: "AI_CONTEXT_CLEAR"
|
|
18
|
-
},
|
|
18
|
+
}, En = {
|
|
19
19
|
EMBEDDED_HOST_READY: "EMBEDDED_HOST_READY",
|
|
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 =
|
|
23
|
+
const e = D("closed"), o = D(!1), t = b(() => e.value !== "closed"), s = b(() => 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");
|
|
27
27
|
};
|
|
28
28
|
return {
|
|
@@ -31,9 +31,9 @@ function st() {
|
|
|
31
31
|
isExpanded: s,
|
|
32
32
|
isInitialized: o,
|
|
33
33
|
open: n,
|
|
34
|
-
close:
|
|
34
|
+
close: c,
|
|
35
35
|
toggle: () => {
|
|
36
|
-
e.value === "closed" ? n() :
|
|
36
|
+
e.value === "closed" ? n() : c();
|
|
37
37
|
},
|
|
38
38
|
expand: () => {
|
|
39
39
|
e.value === "open" && (e.value = "expanded", ne.debug("Panel expanded"));
|
|
@@ -47,7 +47,7 @@ function st() {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
const he = W("ai-agent-context");
|
|
50
|
-
function
|
|
50
|
+
function we(e) {
|
|
51
51
|
return e ? {
|
|
52
52
|
id: e.id,
|
|
53
53
|
name: e.name,
|
|
@@ -56,9 +56,9 @@ function Ae(e) {
|
|
|
56
56
|
} : { id: "unknown", name: "unknown", title: "Unknown" };
|
|
57
57
|
}
|
|
58
58
|
function lt(e) {
|
|
59
|
-
const { userGetter: o, bladeGetter: t, localeGetter: s, tokenGetter: n } = e,
|
|
59
|
+
const { userGetter: o, bladeGetter: t, localeGetter: s, tokenGetter: n } = e, c = D(/* @__PURE__ */ new Map()), f = () => {
|
|
60
60
|
const E = t();
|
|
61
|
-
return E ?
|
|
61
|
+
return E ? c.value.get(E.id) ?? {
|
|
62
62
|
items: [],
|
|
63
63
|
type: "list",
|
|
64
64
|
suggestions: void 0
|
|
@@ -67,24 +67,24 @@ function lt(e) {
|
|
|
67
67
|
type: "list",
|
|
68
68
|
suggestions: void 0
|
|
69
69
|
};
|
|
70
|
-
},
|
|
70
|
+
}, l = b(() => f().items), d = b(() => f().type), u = b(() => f().suggestions), h = b(() => l.value.length);
|
|
71
71
|
return {
|
|
72
|
-
contextItems:
|
|
72
|
+
contextItems: l,
|
|
73
73
|
contextType: d,
|
|
74
74
|
contextSuggestions: u,
|
|
75
75
|
totalItemsCount: h,
|
|
76
|
-
setContextData: (E,
|
|
77
|
-
const
|
|
78
|
-
return
|
|
76
|
+
setContextData: (E, w, T, $) => {
|
|
77
|
+
const M = t()?.id || $;
|
|
78
|
+
return M ? E.length === 0 && !T ? (c.value.delete(M), he.debug(`Context cleared for blade: ${M}`), { cleared: !0 }) : (c.value.set(M, { items: E, type: w, suggestions: T }), he.debug(`Context set for blade: ${M}, items: ${E.length}, type: ${w}`), { cleared: !1 }) : (he.warn("Cannot set context data: no blade id available"), { cleared: !1 });
|
|
79
79
|
},
|
|
80
80
|
buildInitPayload: async () => {
|
|
81
81
|
const E = n ? await n() ?? void 0 : void 0;
|
|
82
82
|
return {
|
|
83
83
|
userId: o()?.id || "",
|
|
84
84
|
locale: s(),
|
|
85
|
-
blade:
|
|
85
|
+
blade: we(t()),
|
|
86
86
|
contextType: d.value,
|
|
87
|
-
items: te(
|
|
87
|
+
items: te(l.value),
|
|
88
88
|
suggestions: u.value ? te(u.value) : void 0,
|
|
89
89
|
accessToken: E
|
|
90
90
|
};
|
|
@@ -92,9 +92,9 @@ function lt(e) {
|
|
|
92
92
|
buildUpdatePayload: async () => {
|
|
93
93
|
const E = n ? await n() ?? void 0 : void 0;
|
|
94
94
|
return {
|
|
95
|
-
blade:
|
|
95
|
+
blade: we(t()),
|
|
96
96
|
contextType: d.value,
|
|
97
|
-
items: te(
|
|
97
|
+
items: te(l.value),
|
|
98
98
|
suggestions: u.value ? te(u.value) : void 0,
|
|
99
99
|
locale: s(),
|
|
100
100
|
accessToken: E
|
|
@@ -104,42 +104,42 @@ function lt(e) {
|
|
|
104
104
|
}
|
|
105
105
|
const O = W("ai-agent-transport");
|
|
106
106
|
function ct(e) {
|
|
107
|
-
const { getConfig: o, isEmbedded: t, navigateToBlade: s, closePanel: n } = e,
|
|
108
|
-
function h(
|
|
109
|
-
switch (
|
|
107
|
+
const { getConfig: o, isEmbedded: t, navigateToBlade: s, closePanel: n } = e, c = Ge(null), f = D(!1), l = D(!1), d = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
108
|
+
function h(g, C) {
|
|
109
|
+
switch (g) {
|
|
110
110
|
case "NAVIGATE_TO_APP": {
|
|
111
|
-
const
|
|
112
|
-
s &&
|
|
111
|
+
const w = C;
|
|
112
|
+
s && w?.bladeName && (s(w.bladeName, w.param, w.options), O.debug(`Navigation requested to: ${w.bladeName}`));
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
115
|
// The panel's own Escape handler listens on the host document, which never sees a
|
|
116
116
|
// keystroke delivered to a cross-origin iframe. So while the chatbot holds focus the
|
|
117
117
|
// only route back is the chatbot relaying it here (VCST-5673). Closing a panel exposes
|
|
118
|
-
// nothing, and the sender's origin
|
|
118
|
+
// nothing, and the sender's origin is already checked before this runs.
|
|
119
119
|
case "CLOSE_PANEL": {
|
|
120
120
|
n && (n(), O.debug("Panel close requested by the chatbot"));
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
const E = {
|
|
125
|
-
type:
|
|
125
|
+
type: g,
|
|
126
126
|
payload: C,
|
|
127
127
|
timestamp: Date.now()
|
|
128
128
|
};
|
|
129
|
-
d.forEach((
|
|
129
|
+
d.forEach((w) => {
|
|
130
130
|
try {
|
|
131
|
-
|
|
132
|
-
} catch (
|
|
133
|
-
O.error("Handler error:",
|
|
131
|
+
w(E);
|
|
132
|
+
} catch (T) {
|
|
133
|
+
O.error("Handler error:", T);
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
function v(
|
|
137
|
+
function v(g) {
|
|
138
138
|
const E = o().allowedOrigins ?? [];
|
|
139
139
|
if (E.length === 0) {
|
|
140
140
|
O.warn(
|
|
141
141
|
"Ignoring postMessage: aiAgentConfig.allowedOrigins is empty. Configure explicit origins to enable the AI agent bridge.",
|
|
142
|
-
{ origin:
|
|
142
|
+
{ origin: g.origin, type: g.data?.type }
|
|
143
143
|
);
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
@@ -149,47 +149,44 @@ function ct(e) {
|
|
|
149
149
|
);
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
if (!E.includes(
|
|
152
|
+
if (!E.includes(g.origin))
|
|
153
153
|
return;
|
|
154
|
-
const
|
|
155
|
-
if (!
|
|
156
|
-
|
|
157
|
-
const I = f.data;
|
|
158
|
-
if (!(!I?.type || typeof I.type != "string"))
|
|
159
|
-
switch (O.debug(`Message received: ${I.type}`), I.type) {
|
|
154
|
+
const w = g.data;
|
|
155
|
+
if (!(!w?.type || typeof w.type != "string"))
|
|
156
|
+
switch (O.debug(`Message received: ${w.type}`), w.type) {
|
|
160
157
|
// Embedded: parent forwards chat messages wrapped in AI_CHAT_MESSAGE
|
|
161
158
|
case "AI_CHAT_MESSAGE": {
|
|
162
159
|
if (t) {
|
|
163
|
-
const
|
|
164
|
-
|
|
160
|
+
const T = w.payload;
|
|
161
|
+
T?.type && h(T.type, T.payload);
|
|
165
162
|
}
|
|
166
163
|
return;
|
|
167
164
|
}
|
|
168
165
|
// Normal: chatbot signals it's ready
|
|
169
166
|
case "CHAT_READY":
|
|
170
|
-
u.forEach((
|
|
167
|
+
u.forEach((T) => {
|
|
171
168
|
try {
|
|
172
|
-
|
|
173
|
-
} catch (
|
|
174
|
-
O.error("ChatReady handler error:",
|
|
169
|
+
T();
|
|
170
|
+
} catch ($) {
|
|
171
|
+
O.error("ChatReady handler error:", $);
|
|
175
172
|
}
|
|
176
173
|
});
|
|
177
174
|
break;
|
|
178
175
|
// Normal: direct chat protocol messages
|
|
179
176
|
default:
|
|
180
|
-
h(
|
|
177
|
+
h(w.type, w.payload);
|
|
181
178
|
break;
|
|
182
179
|
}
|
|
183
180
|
}
|
|
184
181
|
return {
|
|
185
|
-
iframeRef:
|
|
186
|
-
pendingInitContext:
|
|
187
|
-
isListenerRegistered:
|
|
188
|
-
setIframeRef(
|
|
189
|
-
|
|
182
|
+
iframeRef: c,
|
|
183
|
+
pendingInitContext: f,
|
|
184
|
+
isListenerRegistered: l,
|
|
185
|
+
setIframeRef(g) {
|
|
186
|
+
c.value = g, O.debug("Iframe ref set:", g ? "available" : "null");
|
|
190
187
|
},
|
|
191
|
-
sendToIframe(
|
|
192
|
-
if (!
|
|
188
|
+
sendToIframe(g) {
|
|
189
|
+
if (!c.value?.contentWindow) {
|
|
193
190
|
O.warn("Cannot send message: iframe not available");
|
|
194
191
|
return;
|
|
195
192
|
}
|
|
@@ -197,13 +194,13 @@ function ct(e) {
|
|
|
197
194
|
if (!C || C === "*") {
|
|
198
195
|
O.error(
|
|
199
196
|
"Refusing to send to iframe: aiAgentConfig.allowedOrigins must contain an explicit origin. Message dropped to avoid leaking data (including access tokens) to arbitrary origins.",
|
|
200
|
-
{ type:
|
|
197
|
+
{ type: g.type }
|
|
201
198
|
);
|
|
202
199
|
return;
|
|
203
200
|
}
|
|
204
|
-
|
|
201
|
+
c.value.contentWindow.postMessage(g, C), O.debug(`Sent to iframe: ${g.type}`);
|
|
205
202
|
},
|
|
206
|
-
sendToParent(
|
|
203
|
+
sendToParent(g) {
|
|
207
204
|
if (!window.parent || window.parent === window) {
|
|
208
205
|
O.warn("Cannot send to parent: not in iframe");
|
|
209
206
|
return;
|
|
@@ -212,26 +209,26 @@ function ct(e) {
|
|
|
212
209
|
if (!C || C === "*") {
|
|
213
210
|
O.error(
|
|
214
211
|
"Refusing to send to parent: aiAgentConfig.parentOrigin must be an explicit origin. Message dropped to avoid leaking data (including access tokens) to arbitrary origins.",
|
|
215
|
-
{ type:
|
|
212
|
+
{ type: g.type }
|
|
216
213
|
);
|
|
217
214
|
return;
|
|
218
215
|
}
|
|
219
|
-
window.parent.postMessage(
|
|
216
|
+
window.parent.postMessage(g, C), O.debug(`Sent to parent: ${g.type}`);
|
|
220
217
|
},
|
|
221
218
|
startListening() {
|
|
222
|
-
|
|
219
|
+
l.value || (window.addEventListener("message", v), l.value = !0);
|
|
223
220
|
},
|
|
224
221
|
stopListening() {
|
|
225
|
-
|
|
222
|
+
l.value && (window.removeEventListener("message", v), l.value = !1);
|
|
226
223
|
},
|
|
227
|
-
onChatReady(
|
|
228
|
-
return u.add(
|
|
229
|
-
u.delete(
|
|
224
|
+
onChatReady(g) {
|
|
225
|
+
return u.add(g), () => {
|
|
226
|
+
u.delete(g);
|
|
230
227
|
};
|
|
231
228
|
},
|
|
232
|
-
onMessage(
|
|
233
|
-
return d.add(
|
|
234
|
-
d.delete(
|
|
229
|
+
onMessage(g) {
|
|
230
|
+
return d.add(g), () => {
|
|
231
|
+
d.delete(g);
|
|
235
232
|
};
|
|
236
233
|
}
|
|
237
234
|
};
|
|
@@ -243,87 +240,87 @@ function dt(e) {
|
|
|
243
240
|
bladeGetter: t,
|
|
244
241
|
localeGetter: s,
|
|
245
242
|
tokenGetter: n,
|
|
246
|
-
navigateToBlade:
|
|
247
|
-
initialConfig:
|
|
248
|
-
isEmbedded:
|
|
249
|
-
} = e, d =
|
|
243
|
+
navigateToBlade: c,
|
|
244
|
+
initialConfig: f,
|
|
245
|
+
isEmbedded: l = !1
|
|
246
|
+
} = e, d = D({ ...at, ...f }), u = st(), h = lt({
|
|
250
247
|
userGetter: o,
|
|
251
248
|
bladeGetter: t,
|
|
252
249
|
localeGetter: s,
|
|
253
250
|
tokenGetter: n
|
|
254
251
|
}), v = ct({
|
|
255
252
|
getConfig: () => d.value,
|
|
256
|
-
isEmbedded:
|
|
257
|
-
navigateToBlade:
|
|
253
|
+
isEmbedded: l,
|
|
254
|
+
navigateToBlade: c,
|
|
258
255
|
closePanel: () => u.close()
|
|
259
|
-
}),
|
|
256
|
+
}), g = b(() => ({
|
|
260
257
|
user: o(),
|
|
261
258
|
currentBlade: t(),
|
|
262
259
|
items: h.contextItems.value
|
|
263
260
|
})), C = async () => {
|
|
264
261
|
if (v.pendingInitContext.value && v.iframeRef.value?.contentWindow) {
|
|
265
262
|
v.pendingInitContext.value = !1, u.isInitialized.value = !0;
|
|
266
|
-
const
|
|
267
|
-
v.sendToIframe({ type: "INIT_CONTEXT", payload:
|
|
263
|
+
const I = await h.buildInitPayload();
|
|
264
|
+
v.sendToIframe({ type: "INIT_CONTEXT", payload: I }), ae.debug("Flushed pending INIT_CONTEXT");
|
|
268
265
|
}
|
|
269
266
|
};
|
|
270
267
|
v.onChatReady(() => {
|
|
271
|
-
v.iframeRef.value?.contentWindow ? (u.isInitialized.value = !0, h.buildInitPayload().then((
|
|
272
|
-
v.sendToIframe({ type: "INIT_CONTEXT", payload:
|
|
268
|
+
v.iframeRef.value?.contentWindow ? (u.isInitialized.value = !0, h.buildInitPayload().then((I) => {
|
|
269
|
+
v.sendToIframe({ type: "INIT_CONTEXT", payload: I }), ae.info("Chatbot ready, sent INIT_CONTEXT");
|
|
273
270
|
})) : (v.pendingInitContext.value = !0, ae.info("Chatbot ready, iframe ref not available yet — pending INIT_CONTEXT"));
|
|
274
271
|
}), q(v.iframeRef, () => C()), q(
|
|
275
|
-
() => ({ currentBlade:
|
|
272
|
+
() => ({ currentBlade: g.value.currentBlade, items: g.value.items }),
|
|
276
273
|
async () => {
|
|
277
|
-
if (
|
|
278
|
-
const
|
|
279
|
-
v.sendToParent({ type: "AI_CONTEXT_UPDATE", payload:
|
|
274
|
+
if (l) {
|
|
275
|
+
const I = await h.buildInitPayload();
|
|
276
|
+
v.sendToParent({ type: "AI_CONTEXT_UPDATE", payload: I });
|
|
280
277
|
return;
|
|
281
278
|
}
|
|
282
279
|
if (u.isOpen.value && u.isInitialized.value && v.iframeRef.value?.contentWindow) {
|
|
283
|
-
const
|
|
284
|
-
v.sendToIframe({ type: "UPDATE_CONTEXT", payload:
|
|
280
|
+
const I = await h.buildUpdatePayload();
|
|
281
|
+
v.sendToIframe({ type: "UPDATE_CONTEXT", payload: I });
|
|
285
282
|
}
|
|
286
283
|
},
|
|
287
284
|
{ deep: !0 }
|
|
288
285
|
);
|
|
289
|
-
const E = () =>
|
|
290
|
-
v.setIframeRef(
|
|
291
|
-
},
|
|
292
|
-
const { cleared: Y } = h.setContextData(
|
|
293
|
-
|
|
286
|
+
const E = () => l ? v.sendToParent({ type: "AI_TOGGLE_PANEL" }) : u.open(), w = () => l ? v.sendToParent({ type: "AI_TOGGLE_PANEL" }) : u.close(), T = () => l ? v.sendToParent({ type: "AI_TOGGLE_PANEL" }) : u.toggle(), $ = (I) => {
|
|
287
|
+
v.setIframeRef(I), C();
|
|
288
|
+
}, M = (I, R, Z, X) => {
|
|
289
|
+
const { cleared: Y } = h.setContextData(I, R, Z, X);
|
|
290
|
+
l && Y && v.sendToParent({ type: "AI_CONTEXT_CLEAR" });
|
|
294
291
|
};
|
|
295
|
-
return v.startListening(),
|
|
292
|
+
return v.startListening(), l && (v.sendToParent({
|
|
296
293
|
type: "EMBEDDED_APP_READY",
|
|
297
294
|
payload: { supportedFeatures: ["ai-agent"] }
|
|
298
295
|
}), ae.info("Embedded mode: sent EMBEDDED_APP_READY to parent")), {
|
|
299
296
|
// State
|
|
300
297
|
panelState: u.panelState,
|
|
301
298
|
config: d,
|
|
302
|
-
context:
|
|
303
|
-
isOpen: b(() => !
|
|
299
|
+
context: g,
|
|
300
|
+
isOpen: b(() => !l && u.isOpen.value),
|
|
304
301
|
isExpanded: u.isExpanded,
|
|
305
302
|
totalItemsCount: h.totalItemsCount,
|
|
306
303
|
// Panel control
|
|
307
304
|
openPanel: E,
|
|
308
|
-
closePanel:
|
|
309
|
-
togglePanel:
|
|
305
|
+
closePanel: w,
|
|
306
|
+
togglePanel: T,
|
|
310
307
|
expandPanel: () => u.expand(),
|
|
311
308
|
collapsePanel: () => u.collapse(),
|
|
312
309
|
// Configuration
|
|
313
|
-
setConfig: (
|
|
314
|
-
d.value = { ...d.value, ...
|
|
310
|
+
setConfig: (I) => {
|
|
311
|
+
d.value = { ...d.value, ...I };
|
|
315
312
|
},
|
|
316
313
|
// Communication
|
|
317
|
-
sendMessage: (
|
|
318
|
-
v.sendToIframe({ type:
|
|
314
|
+
sendMessage: (I, R) => {
|
|
315
|
+
v.sendToIframe({ type: I, payload: R });
|
|
319
316
|
},
|
|
320
317
|
onMessage: v.onMessage,
|
|
321
318
|
// Internal API
|
|
322
319
|
iframeRef: v.iframeRef,
|
|
323
|
-
_setIframeRef:
|
|
320
|
+
_setIframeRef: $,
|
|
324
321
|
_startListening: v.startListening,
|
|
325
322
|
_stopListening: v.stopListening,
|
|
326
|
-
_setContextData:
|
|
323
|
+
_setContextData: M
|
|
327
324
|
};
|
|
328
325
|
}
|
|
329
326
|
const ut = /* @__PURE__ */ new Set(["mod", "ctrl", "meta", "alt", "shift"]);
|
|
@@ -376,10 +373,10 @@ function ft(e) {
|
|
|
376
373
|
return e in Be ? Be[e] : e.length === 1 ? e.toUpperCase() : e.charAt(0).toUpperCase() + e.slice(1);
|
|
377
374
|
}
|
|
378
375
|
function Ee(e, o) {
|
|
379
|
-
const t = !!e.ctrl || !!e.mod && !o, s = !!e.meta || !!e.mod && o, n = [],
|
|
380
|
-
o ? (t && n.push(oe.ctrl), e.alt && n.push(oe.alt), e.shift && n.push(oe.shift), s && n.push(oe.meta)) : (t && n.push(re.ctrl), s && n.push(re.meta), e.alt && n.push(re.alt), e.shift && n.push(re.shift)), t &&
|
|
381
|
-
const
|
|
382
|
-
return { parts: n, aria:
|
|
376
|
+
const t = !!e.ctrl || !!e.mod && !o, s = !!e.meta || !!e.mod && o, n = [], c = [];
|
|
377
|
+
o ? (t && n.push(oe.ctrl), e.alt && n.push(oe.alt), e.shift && n.push(oe.shift), s && n.push(oe.meta)) : (t && n.push(re.ctrl), s && n.push(re.meta), e.alt && n.push(re.alt), e.shift && n.push(re.shift)), t && c.push("Control"), s && c.push("Meta"), e.alt && c.push("Alt"), e.shift && c.push("Shift"), n.push(pt(e.key));
|
|
378
|
+
const f = [...c, ft(e.key)].join("+");
|
|
379
|
+
return { parts: n, aria: f };
|
|
383
380
|
}
|
|
384
381
|
const Ie = {
|
|
385
382
|
backslash: "Backslash",
|
|
@@ -423,8 +420,8 @@ function _t(e, o) {
|
|
|
423
420
|
return s !== void 0 ? o.key === s : !1;
|
|
424
421
|
}
|
|
425
422
|
function Et(e, o, t) {
|
|
426
|
-
const s = !!e.ctrl || !!e.mod && !t, n = !!e.meta || !!e.mod && t,
|
|
427
|
-
return o.ctrlKey !== s || o.metaKey !== n || o.altKey !==
|
|
423
|
+
const s = !!e.ctrl || !!e.mod && !t, n = !!e.meta || !!e.mod && t, c = !!e.alt, f = !!e.shift;
|
|
424
|
+
return o.ctrlKey !== s || o.metaKey !== n || o.altKey !== c || o.shiftKey !== f ? !1 : _t(e, o);
|
|
428
425
|
}
|
|
429
426
|
const bt = /* @__PURE__ */ new Set([
|
|
430
427
|
"button",
|
|
@@ -437,7 +434,7 @@ const bt = /* @__PURE__ */ new Set([
|
|
|
437
434
|
"range",
|
|
438
435
|
"color"
|
|
439
436
|
]);
|
|
440
|
-
function
|
|
437
|
+
function bn() {
|
|
441
438
|
const e = document.activeElement;
|
|
442
439
|
if (!e) return !1;
|
|
443
440
|
const o = e.tagName;
|
|
@@ -446,51 +443,51 @@ function En() {
|
|
|
446
443
|
const t = e.getAttribute("contenteditable");
|
|
447
444
|
return t === "true" || t === "";
|
|
448
445
|
}
|
|
449
|
-
function
|
|
446
|
+
function At() {
|
|
450
447
|
return typeof navigator > "u" ? !1 : /Mac|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
451
448
|
}
|
|
452
449
|
function Ne() {
|
|
453
|
-
const e =
|
|
450
|
+
const e = At();
|
|
454
451
|
return {
|
|
455
452
|
hotkey: Q,
|
|
456
453
|
isMac: e,
|
|
457
454
|
formatShortcut: (o) => Ee(o, e)
|
|
458
455
|
};
|
|
459
456
|
}
|
|
460
|
-
let
|
|
461
|
-
function
|
|
462
|
-
|
|
457
|
+
let $e, Fe, Re, wt;
|
|
458
|
+
function An(e) {
|
|
459
|
+
$e = e;
|
|
463
460
|
}
|
|
464
461
|
function wn(e) {
|
|
465
|
-
|
|
462
|
+
Fe = e;
|
|
466
463
|
}
|
|
467
|
-
function
|
|
464
|
+
function yn(e) {
|
|
468
465
|
Re = e;
|
|
469
466
|
}
|
|
470
|
-
function
|
|
471
|
-
|
|
467
|
+
function Bn(e) {
|
|
468
|
+
wt = e;
|
|
472
469
|
}
|
|
473
470
|
function xe(e, o) {
|
|
474
471
|
if (o.length === 0)
|
|
475
472
|
return { path: e ? `/${e}` : "/", query: {} };
|
|
476
473
|
const t = o[0], s = Se(t.url);
|
|
477
474
|
let n;
|
|
478
|
-
for (let
|
|
479
|
-
if (o[
|
|
480
|
-
n = o[
|
|
475
|
+
for (let l = o.length - 1; l >= 1; l--)
|
|
476
|
+
if (o[l].visible) {
|
|
477
|
+
n = o[l];
|
|
481
478
|
break;
|
|
482
479
|
}
|
|
483
|
-
let
|
|
484
|
-
if (s && (
|
|
485
|
-
const
|
|
486
|
-
|
|
480
|
+
let c = e ? `/${e}` : "";
|
|
481
|
+
if (s && (c += `/${s}`), n) {
|
|
482
|
+
const l = Se(n.url);
|
|
483
|
+
l && (c += `/${l}`), n.param && (c += `/${n.param}`);
|
|
487
484
|
}
|
|
488
|
-
const
|
|
489
|
-
for (const
|
|
490
|
-
|
|
491
|
-
return { path:
|
|
485
|
+
const f = {};
|
|
486
|
+
for (const l of o)
|
|
487
|
+
l.visible && l.query && Object.assign(f, l.query);
|
|
488
|
+
return { path: c || "/", query: f };
|
|
492
489
|
}
|
|
493
|
-
function
|
|
490
|
+
function In(e, o) {
|
|
494
491
|
let t = e.split("/").filter(Boolean);
|
|
495
492
|
return o && t.length > 0 && t[0] === o && (t = t.slice(1)), t.length === 0 ? {} : {
|
|
496
493
|
workspaceUrl: t[0],
|
|
@@ -508,114 +505,114 @@ function Oe(e) {
|
|
|
508
505
|
}
|
|
509
506
|
function yt(e, o) {
|
|
510
507
|
function t() {
|
|
511
|
-
const { path: n, query:
|
|
512
|
-
e.push({ path: n, query:
|
|
508
|
+
const { path: n, query: c } = xe(Oe(e), o.blades.value);
|
|
509
|
+
e.push({ path: n, query: c });
|
|
513
510
|
}
|
|
514
511
|
function s() {
|
|
515
|
-
const { path: n, query:
|
|
516
|
-
e.replace({ path: n, query:
|
|
512
|
+
const { path: n, query: c } = xe(Oe(e), o.blades.value);
|
|
513
|
+
e.replace({ path: n, query: c });
|
|
517
514
|
}
|
|
518
515
|
return { syncUrlPush: t, syncUrlReplace: s };
|
|
519
516
|
}
|
|
520
517
|
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.";
|
|
521
|
-
function
|
|
518
|
+
function y(e) {
|
|
522
519
|
throw new Error(`[vc-shell] ${e} requires blade context.
|
|
523
520
|
${Bt}`);
|
|
524
521
|
}
|
|
525
522
|
function It() {
|
|
526
|
-
const e = (ee() ?
|
|
523
|
+
const e = (ee() ? N(De, void 0) : void 0) ?? Fe, o = (ee() ? N(We, void 0) : void 0) ?? Re;
|
|
527
524
|
if (!e || !o)
|
|
528
525
|
throw new Error(
|
|
529
526
|
"[vc-shell] useBlade() failed: BladeStack or BladeMessaging not available. Ensure BladeNavigationPlugin (plugin-v2) is installed."
|
|
530
527
|
);
|
|
531
|
-
const t = e, s = o, n = ee() ?
|
|
532
|
-
let
|
|
533
|
-
function
|
|
534
|
-
if (
|
|
535
|
-
const r =
|
|
536
|
-
return r && (
|
|
528
|
+
const t = e, s = o, n = ee() ? N(Ze, void 0) : void 0, c = ee() ? N(Xe, void 0) : void 0;
|
|
529
|
+
let f;
|
|
530
|
+
function l() {
|
|
531
|
+
if (f) return f;
|
|
532
|
+
const r = $e?.router;
|
|
533
|
+
return r && (f = yt(r, t)), f;
|
|
537
534
|
}
|
|
538
|
-
const d = b(() => (n ||
|
|
535
|
+
const d = b(() => (n || y("id"), n.value.id)), u = b(() => (n || y("param"), n.value.param)), h = b(() => (n || y("options"), n.value.options)), v = b(() => (n || y("query"), n.value.query)), g = b(() => (n || y("closable"), n.value.parentId !== void 0)), C = b(() => (n || y("expanded"), t.activeBlade.value?.id === n.value.id)), E = b(() => (n || y("name"), n.value.name)), w = b(() => {
|
|
539
536
|
if (!n) return;
|
|
540
537
|
const r = n.value.id;
|
|
541
538
|
return t.blades.value.find((m) => m.parentId === r)?.param;
|
|
542
539
|
});
|
|
543
|
-
let
|
|
544
|
-
function
|
|
545
|
-
if (
|
|
540
|
+
let T = !1;
|
|
541
|
+
function $(r) {
|
|
542
|
+
if (T) {
|
|
546
543
|
console.warn(
|
|
547
544
|
"[vc-shell] provideBladeData() called more than once in the same blade. Only the first call takes effect."
|
|
548
545
|
);
|
|
549
546
|
return;
|
|
550
547
|
}
|
|
551
|
-
|
|
552
|
-
const m = Ve(r) ? r :
|
|
548
|
+
T = !0;
|
|
549
|
+
const m = Ve(r) ? r : D(r);
|
|
553
550
|
Pe(Ye, m);
|
|
554
551
|
}
|
|
555
|
-
async function
|
|
556
|
-
const { isWorkspace: m, ...
|
|
552
|
+
async function M(r) {
|
|
553
|
+
const { isWorkspace: m, ...k } = r;
|
|
557
554
|
if (m)
|
|
558
|
-
await t.openWorkspace(
|
|
555
|
+
await t.openWorkspace(k);
|
|
559
556
|
else {
|
|
560
|
-
const
|
|
561
|
-
|
|
557
|
+
const L = n?.value.id;
|
|
558
|
+
L ? await t.openBlade({ ...k, parentId: L }) : await t.openBlade(k);
|
|
562
559
|
}
|
|
563
|
-
t.activeBlade.value?.url &&
|
|
560
|
+
t.activeBlade.value?.url && l()?.syncUrlPush();
|
|
564
561
|
}
|
|
565
|
-
async function
|
|
566
|
-
n ||
|
|
562
|
+
async function I() {
|
|
563
|
+
n || y("closeSelf()");
|
|
567
564
|
const r = await t.closeBlade(n.value.id);
|
|
568
|
-
return r ||
|
|
565
|
+
return r || l()?.syncUrlReplace(), r;
|
|
569
566
|
}
|
|
570
567
|
async function R() {
|
|
571
|
-
n ||
|
|
568
|
+
n || y("closeChildren()"), await t.closeChildren(n.value.id), l()?.syncUrlReplace();
|
|
572
569
|
}
|
|
573
570
|
async function Z(r) {
|
|
574
|
-
n ||
|
|
571
|
+
n || y("replaceWith()"), await t.replaceCurrentBlade({
|
|
575
572
|
...r,
|
|
576
573
|
parentId: n.value.parentId
|
|
577
|
-
}), t.activeBlade.value?.url &&
|
|
574
|
+
}), t.activeBlade.value?.url && l()?.syncUrlReplace();
|
|
578
575
|
}
|
|
579
576
|
async function X(r) {
|
|
580
|
-
n ||
|
|
577
|
+
n || y("coverWith()"), await t.coverCurrentBlade({
|
|
581
578
|
...r,
|
|
582
579
|
parentId: n.value.parentId
|
|
583
|
-
}), t.activeBlade.value?.url &&
|
|
580
|
+
}), t.activeBlade.value?.url && l()?.syncUrlPush();
|
|
584
581
|
}
|
|
585
582
|
async function Y(r, m) {
|
|
586
|
-
return n ||
|
|
583
|
+
return n || y("callParent()"), s.callParent(n.value.id, r, m);
|
|
587
584
|
}
|
|
588
585
|
function le(r) {
|
|
589
|
-
n ||
|
|
586
|
+
n || y("exposeToChildren()"), s.exposeToChildren(n.value.id, r);
|
|
590
587
|
}
|
|
591
588
|
function ce(r) {
|
|
592
|
-
n ||
|
|
589
|
+
n || y("onBeforeClose()"), t.registerBeforeClose(n.value.id, r);
|
|
593
590
|
}
|
|
594
591
|
function de(r) {
|
|
595
|
-
n ||
|
|
592
|
+
n || y("setError()"), t.setBladeError(n.value.id, r);
|
|
596
593
|
}
|
|
597
594
|
function j() {
|
|
598
|
-
n ||
|
|
595
|
+
n || y("clearError()"), t.clearBladeError(n.value.id);
|
|
599
596
|
}
|
|
600
597
|
let ue = 0;
|
|
601
598
|
function pe(r) {
|
|
602
|
-
|
|
599
|
+
c || y("addBanner()");
|
|
603
600
|
const m = `banner-${n.value.id}-${++ue}`;
|
|
604
|
-
return
|
|
601
|
+
return c.value.push({
|
|
605
602
|
...r,
|
|
606
603
|
id: m,
|
|
607
604
|
dismissible: r.dismissible ?? !1
|
|
608
605
|
}), m;
|
|
609
606
|
}
|
|
610
607
|
function fe(r) {
|
|
611
|
-
|
|
608
|
+
c || y("removeBanner()"), c.value = c.value.filter((m) => m.id !== r);
|
|
612
609
|
}
|
|
613
610
|
function ge() {
|
|
614
|
-
|
|
611
|
+
c || y("clearBanners()"), c.value = c.value.filter((r) => r._system);
|
|
615
612
|
}
|
|
616
613
|
let a = !1, i = !1;
|
|
617
614
|
function p(r) {
|
|
618
|
-
if (n ||
|
|
615
|
+
if (n || y("onActivated()"), a) {
|
|
619
616
|
console.warn("[useBlade] onActivated() already registered in this blade.");
|
|
620
617
|
return;
|
|
621
618
|
}
|
|
@@ -624,7 +621,7 @@ function It() {
|
|
|
624
621
|
});
|
|
625
622
|
}
|
|
626
623
|
function _(r) {
|
|
627
|
-
if (n ||
|
|
624
|
+
if (n || y("onDeactivated()"), i) {
|
|
628
625
|
console.warn("[useBlade] onDeactivated() already registered in this blade.");
|
|
629
626
|
return;
|
|
630
627
|
}
|
|
@@ -635,15 +632,15 @@ function It() {
|
|
|
635
632
|
return {
|
|
636
633
|
id: d,
|
|
637
634
|
param: u,
|
|
638
|
-
activeChildParam:
|
|
635
|
+
activeChildParam: w,
|
|
639
636
|
options: h,
|
|
640
637
|
query: v,
|
|
641
|
-
closable:
|
|
638
|
+
closable: g,
|
|
642
639
|
expanded: C,
|
|
643
640
|
name: E,
|
|
644
|
-
provideBladeData:
|
|
645
|
-
openBlade:
|
|
646
|
-
closeSelf:
|
|
641
|
+
provideBladeData: $,
|
|
642
|
+
openBlade: M,
|
|
643
|
+
closeSelf: I,
|
|
647
644
|
closeChildren: R,
|
|
648
645
|
replaceWith: Z,
|
|
649
646
|
coverWith: X,
|
|
@@ -710,20 +707,20 @@ let Pt = 0;
|
|
|
710
707
|
function kt() {
|
|
711
708
|
return `blade_${++Pt}_${Math.random().toString(36).slice(2, 8)}`;
|
|
712
709
|
}
|
|
713
|
-
function
|
|
714
|
-
const t =
|
|
710
|
+
function Tn(e, o) {
|
|
711
|
+
const t = D([]), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), l = b(() => t.value[0]), d = b(() => t.value), u = b(() => {
|
|
715
712
|
for (let a = t.value.length - 1; a >= 0; a--)
|
|
716
713
|
if (t.value[a].visible) return t.value[a];
|
|
717
714
|
});
|
|
718
715
|
function h(a) {
|
|
719
|
-
s.delete(a), n.delete(a),
|
|
716
|
+
s.delete(a), n.delete(a), c.delete(a), f.delete(a);
|
|
720
717
|
}
|
|
721
718
|
function v(a) {
|
|
722
719
|
const i = e.getBlade(a);
|
|
723
720
|
if (i)
|
|
724
721
|
return i.route;
|
|
725
722
|
}
|
|
726
|
-
const
|
|
723
|
+
const g = {
|
|
727
724
|
generateId: kt,
|
|
728
725
|
resolveUrl: v
|
|
729
726
|
};
|
|
@@ -737,10 +734,10 @@ function In(e, o) {
|
|
|
737
734
|
}
|
|
738
735
|
function E(a) {
|
|
739
736
|
for (const i of a)
|
|
740
|
-
|
|
737
|
+
c.get(i.id)?.(), h(i.id);
|
|
741
738
|
}
|
|
742
|
-
async function
|
|
743
|
-
if (
|
|
739
|
+
async function w(a) {
|
|
740
|
+
if (l.value?.name === a.name) return;
|
|
744
741
|
const p = e.getBlade(a.name);
|
|
745
742
|
if (!p)
|
|
746
743
|
throw new Error(`[BladeStack] Blade '${a.name}' not found in registry`);
|
|
@@ -749,13 +746,13 @@ function In(e, o) {
|
|
|
749
746
|
return;
|
|
750
747
|
}
|
|
751
748
|
E([...t.value]);
|
|
752
|
-
const _ = Tt(a,
|
|
753
|
-
t.value = [_], a.onOpen && n.set(_.id, a.onOpen), a.onClose &&
|
|
749
|
+
const _ = Tt(a, g);
|
|
750
|
+
t.value = [_], a.onOpen && n.set(_.id, a.onOpen), a.onClose && c.set(_.id, a.onClose), a.onOpen?.();
|
|
754
751
|
}
|
|
755
|
-
async function
|
|
752
|
+
async function T(a) {
|
|
756
753
|
if (!e.getBlade(a.name))
|
|
757
754
|
throw new Error(`[BladeStack] Blade '${a.name}' not found in registry`);
|
|
758
|
-
const i = a.parentId ?? u.value?.id ??
|
|
755
|
+
const i = a.parentId ?? u.value?.id ?? l.value?.id;
|
|
759
756
|
if (!i)
|
|
760
757
|
throw new Error("[BladeStack] Cannot open blade: no parent blade found");
|
|
761
758
|
const p = t.value.findIndex((m) => m.id === i);
|
|
@@ -765,10 +762,10 @@ function In(e, o) {
|
|
|
765
762
|
if (_.length > 0 && await C(_))
|
|
766
763
|
return;
|
|
767
764
|
E(_);
|
|
768
|
-
const r = xt(a, i,
|
|
769
|
-
t.value = [...t.value.slice(0, p + 1), r], a.onOpen && n.set(r.id, a.onOpen), a.onClose &&
|
|
765
|
+
const r = xt(a, i, g);
|
|
766
|
+
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?.();
|
|
770
767
|
}
|
|
771
|
-
async function
|
|
768
|
+
async function $(a) {
|
|
772
769
|
const i = t.value.findIndex((m) => m.id === a);
|
|
773
770
|
if (i === -1 || i === 0) return !1;
|
|
774
771
|
const p = t.value.slice(i);
|
|
@@ -781,13 +778,13 @@ function In(e, o) {
|
|
|
781
778
|
}
|
|
782
779
|
return !1;
|
|
783
780
|
}
|
|
784
|
-
async function
|
|
781
|
+
async function M(a) {
|
|
785
782
|
const i = u.value;
|
|
786
783
|
if (!i)
|
|
787
784
|
throw new Error("[BladeStack] No active blade to replace");
|
|
788
785
|
if (!e.getBlade(a.name))
|
|
789
786
|
throw new Error(`[BladeStack] Blade '${a.name}' not found in registry`);
|
|
790
|
-
const p = t.value.findIndex((
|
|
787
|
+
const p = t.value.findIndex((k) => k.id === i.id);
|
|
791
788
|
if (p === -1)
|
|
792
789
|
throw new Error(`[BladeStack] Active blade '${i.id}' not found in stack`);
|
|
793
790
|
const _ = t.value.slice(p + 1);
|
|
@@ -795,18 +792,18 @@ function In(e, o) {
|
|
|
795
792
|
if (await C(_)) return;
|
|
796
793
|
E(_);
|
|
797
794
|
}
|
|
798
|
-
const r = St(a, i.parentId,
|
|
795
|
+
const r = St(a, i.parentId, g);
|
|
799
796
|
E([i]);
|
|
800
797
|
const m = [...t.value.slice(0, p), r, ...t.value.slice(p + 1)];
|
|
801
|
-
t.value = m, a.onOpen && n.set(r.id, a.onOpen), a.onClose &&
|
|
798
|
+
t.value = m, a.onOpen && n.set(r.id, a.onOpen), a.onClose && c.set(r.id, a.onClose), a.onOpen?.();
|
|
802
799
|
}
|
|
803
|
-
async function
|
|
800
|
+
async function I(a) {
|
|
804
801
|
const i = u.value;
|
|
805
802
|
if (!i)
|
|
806
803
|
throw new Error("[BladeStack] No active blade to cover");
|
|
807
804
|
if (!e.getBlade(a.name))
|
|
808
805
|
throw new Error(`[BladeStack] Blade '${a.name}' not found in registry`);
|
|
809
|
-
const p = t.value.findIndex((
|
|
806
|
+
const p = t.value.findIndex((k) => k.id === i.id);
|
|
810
807
|
if (p === -1)
|
|
811
808
|
throw new Error(`[BladeStack] Active blade '${i.id}' not found in stack`);
|
|
812
809
|
const _ = t.value.slice(p + 1);
|
|
@@ -814,8 +811,8 @@ function In(e, o) {
|
|
|
814
811
|
if (await C(_)) return;
|
|
815
812
|
E(_);
|
|
816
813
|
}
|
|
817
|
-
const r = Ot(a, i.id,
|
|
818
|
-
m.push({ ...i, visible: !1 }), m.push(r), t.value = m, a.onOpen && n.set(r.id, a.onOpen), a.onClose &&
|
|
814
|
+
const r = Ot(a, i.id, g), m = t.value.slice(0, p);
|
|
815
|
+
m.push({ ...i, visible: !1 }), m.push(r), t.value = m, a.onOpen && n.set(r.id, a.onOpen), a.onClose && c.set(r.id, a.onClose), a.onOpen?.();
|
|
819
816
|
}
|
|
820
817
|
async function R(a) {
|
|
821
818
|
const i = t.value.findIndex((r) => r.id === a);
|
|
@@ -848,23 +845,23 @@ function In(e, o) {
|
|
|
848
845
|
_[p] = { ..._[p], title: i }, t.value = _;
|
|
849
846
|
}
|
|
850
847
|
function de(a, i) {
|
|
851
|
-
const p = t.value.findIndex((
|
|
848
|
+
const p = t.value.findIndex((L) => L.id === a);
|
|
852
849
|
if (p === -1) return;
|
|
853
850
|
const _ = t.value[p].query ?? {}, r = { ..._ };
|
|
854
|
-
for (const [
|
|
855
|
-
ve === "" || ve == null ? delete r[
|
|
856
|
-
const m = Object.keys(_),
|
|
857
|
-
if (m.length ===
|
|
851
|
+
for (const [L, ve] of Object.entries(i))
|
|
852
|
+
ve === "" || ve == null ? delete r[L] : r[L] = ve;
|
|
853
|
+
const m = Object.keys(_), k = Object.keys(r);
|
|
854
|
+
if (m.length === k.length && k.every((L) => _[L] === r[L]))
|
|
858
855
|
return;
|
|
859
856
|
const J = [...t.value];
|
|
860
857
|
J[p] = { ...J[p], query: r }, t.value = J;
|
|
861
858
|
}
|
|
862
859
|
function j(a) {
|
|
863
|
-
let i =
|
|
864
|
-
return i || (i =
|
|
860
|
+
let i = f.get(a);
|
|
861
|
+
return i || (i = D(!1), f.set(a, i)), i;
|
|
865
862
|
}
|
|
866
863
|
function ue(a) {
|
|
867
|
-
return
|
|
864
|
+
return f.get(a)?.value ?? !1;
|
|
868
865
|
}
|
|
869
866
|
function pe(a, i) {
|
|
870
867
|
j(a).value = i;
|
|
@@ -879,15 +876,15 @@ function In(e, o) {
|
|
|
879
876
|
t.value = a;
|
|
880
877
|
}
|
|
881
878
|
return {
|
|
882
|
-
workspace:
|
|
879
|
+
workspace: l,
|
|
883
880
|
blades: d,
|
|
884
881
|
activeBlade: u,
|
|
885
|
-
openWorkspace:
|
|
886
|
-
openBlade:
|
|
887
|
-
closeBlade:
|
|
882
|
+
openWorkspace: w,
|
|
883
|
+
openBlade: T,
|
|
884
|
+
closeBlade: $,
|
|
888
885
|
closeChildren: R,
|
|
889
|
-
replaceCurrentBlade:
|
|
890
|
-
coverCurrentBlade:
|
|
886
|
+
replaceCurrentBlade: M,
|
|
887
|
+
coverCurrentBlade: I,
|
|
891
888
|
registerBeforeClose: Z,
|
|
892
889
|
unregisterBeforeClose: X,
|
|
893
890
|
setBladeError: Y,
|
|
@@ -902,14 +899,14 @@ function In(e, o) {
|
|
|
902
899
|
};
|
|
903
900
|
}
|
|
904
901
|
function Mt() {
|
|
905
|
-
const e =
|
|
902
|
+
const e = N(De);
|
|
906
903
|
if (!e)
|
|
907
904
|
throw new Error("[useBladeStack] BladeStack not found. Ensure BladeNavigationPlugin is installed.");
|
|
908
905
|
return e;
|
|
909
906
|
}
|
|
910
907
|
const V = W("use-ai-agent");
|
|
911
|
-
function
|
|
912
|
-
const o =
|
|
908
|
+
function xn(e) {
|
|
909
|
+
const o = N(je), { user: t, getAccessToken: s } = Qe(), { openBlade: n } = It(), { blades: c, activeBlade: f } = Mt(), l = e?.isEmbedded, d = dt({
|
|
913
910
|
userGetter: () => {
|
|
914
911
|
if (t.value)
|
|
915
912
|
return {
|
|
@@ -920,7 +917,7 @@ function Tn(e) {
|
|
|
920
917
|
};
|
|
921
918
|
},
|
|
922
919
|
bladeGetter: () => {
|
|
923
|
-
const h =
|
|
920
|
+
const h = f.value ?? c.value[c.value.length - 1];
|
|
924
921
|
return h ? {
|
|
925
922
|
id: h.id,
|
|
926
923
|
name: h.name,
|
|
@@ -931,18 +928,18 @@ function Tn(e) {
|
|
|
931
928
|
},
|
|
932
929
|
localeGetter: () => o?.currentLocale.value ?? "en",
|
|
933
930
|
tokenGetter: s,
|
|
934
|
-
navigateToBlade: (h, v,
|
|
935
|
-
n({ name: h, param: v, options:
|
|
931
|
+
navigateToBlade: (h, v, g) => {
|
|
932
|
+
n({ name: h, param: v, options: g }).then(() => {
|
|
936
933
|
V.debug(`Navigated to blade: ${h}`);
|
|
937
934
|
}).catch((C) => {
|
|
938
935
|
V.warn(`Blade not found or cannot be opened: ${h}`, C);
|
|
939
936
|
});
|
|
940
937
|
},
|
|
941
938
|
initialConfig: e?.config,
|
|
942
|
-
isEmbedded:
|
|
939
|
+
isEmbedded: l
|
|
943
940
|
});
|
|
944
941
|
if (Pe(be, d), V.debug("AiAgentService provided"), e?.addGlobalToolbarButton ?? !0) {
|
|
945
|
-
const h =
|
|
942
|
+
const h = N(Je, null);
|
|
946
943
|
h ? (h.registerToolbarItem(
|
|
947
944
|
{
|
|
948
945
|
id: ot,
|
|
@@ -959,8 +956,8 @@ function Tn(e) {
|
|
|
959
956
|
}
|
|
960
957
|
return d;
|
|
961
958
|
}
|
|
962
|
-
function
|
|
963
|
-
const e =
|
|
959
|
+
function Sn() {
|
|
960
|
+
const e = N(be);
|
|
964
961
|
if (!e) {
|
|
965
962
|
V.error("AiAgentService not found. Did you forget to call provideAiAgentService()?");
|
|
966
963
|
return;
|
|
@@ -986,7 +983,7 @@ function xn() {
|
|
|
986
983
|
onMessage: e.onMessage
|
|
987
984
|
};
|
|
988
985
|
}
|
|
989
|
-
function
|
|
986
|
+
function On(e) {
|
|
990
987
|
return {
|
|
991
988
|
id: "ai-agent-toggle",
|
|
992
989
|
icon: e?.icon ?? "lucide-sparkles",
|
|
@@ -1000,7 +997,7 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1000
997
|
key: 1,
|
|
1001
998
|
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",
|
|
1002
999
|
fill: "url(#virto-oz-gradient-animated)"
|
|
1003
|
-
},
|
|
1000
|
+
}, $t = ["id"], Ft = {
|
|
1004
1001
|
key: 1,
|
|
1005
1002
|
id: "virto-oz-gradient-animated",
|
|
1006
1003
|
gradientUnits: "userSpaceOnUse",
|
|
@@ -1017,7 +1014,7 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1017
1014
|
},
|
|
1018
1015
|
setup(e) {
|
|
1019
1016
|
const o = b(() => `virto-oz-clip-${Math.random().toString(36).substring(2, 11)}`);
|
|
1020
|
-
return (t, s) => (
|
|
1017
|
+
return (t, s) => (B(), S("svg", {
|
|
1021
1018
|
width: e.width,
|
|
1022
1019
|
height: e.height,
|
|
1023
1020
|
viewBox: "0 0 99 108",
|
|
@@ -1025,22 +1022,22 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1025
1022
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1026
1023
|
class: "vc-virto-oz-logo"
|
|
1027
1024
|
}, [
|
|
1028
|
-
s[3] || (s[3] =
|
|
1025
|
+
s[3] || (s[3] = A("path", {
|
|
1029
1026
|
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",
|
|
1030
1027
|
fill: "white"
|
|
1031
1028
|
}, null, -1)),
|
|
1032
|
-
e.animated ? (
|
|
1029
|
+
e.animated ? (B(), S("path", Nt)) : (B(), S("g", {
|
|
1033
1030
|
key: 0,
|
|
1034
1031
|
"clip-path": `url(#${o.value})`
|
|
1035
1032
|
}, [...s[0] || (s[0] = [
|
|
1036
|
-
|
|
1037
|
-
|
|
1033
|
+
A("g", { transform: "matrix(0 -0.161514 0.160417 0 49.1357 53.9479)" }, [
|
|
1034
|
+
A("foreignObject", {
|
|
1038
1035
|
x: "-334.01",
|
|
1039
1036
|
y: "-334.01",
|
|
1040
1037
|
width: "668.02",
|
|
1041
1038
|
height: "668.02"
|
|
1042
1039
|
}, [
|
|
1043
|
-
|
|
1040
|
+
A("div", {
|
|
1044
1041
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
1045
1042
|
style: { background: `conic-gradient(
|
|
1046
1043
|
from 90deg,
|
|
@@ -1055,39 +1052,39 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1055
1052
|
])
|
|
1056
1053
|
], -1)
|
|
1057
1054
|
])], 8, Lt)),
|
|
1058
|
-
s[4] || (s[4] =
|
|
1055
|
+
s[4] || (s[4] = A("path", {
|
|
1059
1056
|
d: "M72.1266 54.0945C72.1266 60.0873 74.3028 71.0379 60.6238 82.8517C65.2871 73.0587 55.8339 77.1002 49.1209 77.1002C36.4152 77.1002 26.1152 66.8002 26.1152 54.0945C26.1152 41.3889 36.4152 31.0889 49.1209 31.0889C61.8266 31.0889 72.1266 41.3889 72.1266 54.0945Z",
|
|
1060
1057
|
fill: "white"
|
|
1061
1058
|
}, null, -1)),
|
|
1062
|
-
s[5] || (s[5] =
|
|
1059
|
+
s[5] || (s[5] = A("ellipse", {
|
|
1063
1060
|
cx: "49.12",
|
|
1064
1061
|
cy: "54.09",
|
|
1065
1062
|
rx: "4.05",
|
|
1066
1063
|
ry: "4.05",
|
|
1067
1064
|
fill: "#6C6C6C"
|
|
1068
1065
|
}, null, -1)),
|
|
1069
|
-
s[6] || (s[6] =
|
|
1066
|
+
s[6] || (s[6] = A("ellipse", {
|
|
1070
1067
|
cx: "60.62",
|
|
1071
1068
|
cy: "54.09",
|
|
1072
1069
|
rx: "4.05",
|
|
1073
1070
|
ry: "4.05",
|
|
1074
1071
|
fill: "#6C6C6C"
|
|
1075
1072
|
}, null, -1)),
|
|
1076
|
-
s[7] || (s[7] =
|
|
1073
|
+
s[7] || (s[7] = A("ellipse", {
|
|
1077
1074
|
cx: "37.62",
|
|
1078
1075
|
cy: "54.09",
|
|
1079
1076
|
rx: "4.05",
|
|
1080
1077
|
ry: "4.05",
|
|
1081
1078
|
fill: "#6C6C6C"
|
|
1082
1079
|
}, null, -1)),
|
|
1083
|
-
|
|
1084
|
-
e.animated ? z("", !0) : (
|
|
1080
|
+
A("defs", null, [
|
|
1081
|
+
e.animated ? z("", !0) : (B(), S("clipPath", {
|
|
1085
1082
|
key: 0,
|
|
1086
1083
|
id: o.value
|
|
1087
1084
|
}, [...s[1] || (s[1] = [
|
|
1088
|
-
|
|
1089
|
-
])], 8,
|
|
1090
|
-
e.animated ? (
|
|
1085
|
+
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
|
+
])], 8, $t)),
|
|
1087
|
+
e.animated ? (B(), S("linearGradient", Ft, [...s[2] || (s[2] = [
|
|
1091
1088
|
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)
|
|
1092
1089
|
])])) : z("", !0)
|
|
1093
1090
|
])
|
|
@@ -1103,10 +1100,10 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1103
1100
|
separated: { type: Boolean, default: !1 }
|
|
1104
1101
|
},
|
|
1105
1102
|
setup(e) {
|
|
1106
|
-
return (o, t) => (
|
|
1107
|
-
(
|
|
1108
|
-
e.separated && n > 0 ? (
|
|
1109
|
-
|
|
1103
|
+
return (o, t) => (B(), S("span", Rt, [
|
|
1104
|
+
(B(!0), S(Ae, null, qe(e.parts, (s, n) => (B(), S(Ae, { key: n }, [
|
|
1105
|
+
e.separated && n > 0 ? (B(), S("span", Ut, "+")) : z("", !0),
|
|
1106
|
+
A("kbd", Gt, K(s), 1)
|
|
1110
1107
|
], 64))), 128))
|
|
1111
1108
|
]));
|
|
1112
1109
|
}
|
|
@@ -1119,106 +1116,106 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1119
1116
|
},
|
|
1120
1117
|
emits: ["close", "expand", "collapse"],
|
|
1121
1118
|
setup(e) {
|
|
1122
|
-
const { t: o } = nt(), { isMac: t } = Ne(), s = b(() => Ee(Q.escape, t)), n = b(() => Ee(Q.mod.backslash, t)),
|
|
1123
|
-
return (
|
|
1124
|
-
|
|
1125
|
-
|
|
1119
|
+
const { t: o } = nt(), { isMac: t } = Ne(), s = b(() => Ee(Q.escape, t)), n = b(() => Ee(Q.mod.backslash, t)), c = b(() => s.value.aria), f = b(() => n.value.aria);
|
|
1120
|
+
return (l, d) => (B(), S("div", Vt, [
|
|
1121
|
+
A("div", Kt, [
|
|
1122
|
+
P(Ue, {
|
|
1126
1123
|
width: 22,
|
|
1127
1124
|
height: 24,
|
|
1128
1125
|
"show-dots": ""
|
|
1129
1126
|
})
|
|
1130
1127
|
]),
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1128
|
+
A("div", qt, [
|
|
1129
|
+
A("div", zt, [
|
|
1130
|
+
A("div", Ht, K(e.title), 1)
|
|
1134
1131
|
])
|
|
1135
1132
|
]),
|
|
1136
|
-
|
|
1137
|
-
e.isExpanded ? (
|
|
1133
|
+
A("div", Wt, [
|
|
1134
|
+
e.isExpanded ? (B(), se(x(me), {
|
|
1138
1135
|
key: 0,
|
|
1139
1136
|
placement: "bottom"
|
|
1140
1137
|
}, {
|
|
1141
|
-
tooltip:
|
|
1142
|
-
|
|
1138
|
+
tooltip: F(() => [
|
|
1139
|
+
A("span", Xt, [
|
|
1143
1140
|
Ce(K(x(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.RESTORE")) + " ", 1),
|
|
1144
|
-
|
|
1141
|
+
P(_e, {
|
|
1145
1142
|
parts: n.value.parts,
|
|
1146
1143
|
separated: !x(t)
|
|
1147
1144
|
}, null, 8, ["parts", "separated"])
|
|
1148
1145
|
])
|
|
1149
1146
|
]),
|
|
1150
|
-
default:
|
|
1151
|
-
|
|
1147
|
+
default: F(() => [
|
|
1148
|
+
A("div", {
|
|
1152
1149
|
class: "vc-ai-agent-header__button",
|
|
1153
1150
|
role: "button",
|
|
1154
1151
|
tabindex: "0",
|
|
1155
1152
|
"aria-label": x(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.RESTORE"),
|
|
1156
|
-
"aria-keyshortcuts":
|
|
1157
|
-
onClick: d[0] || (d[0] = (u) =>
|
|
1153
|
+
"aria-keyshortcuts": f.value,
|
|
1154
|
+
onClick: d[0] || (d[0] = (u) => l.$emit("collapse")),
|
|
1158
1155
|
onKeydown: [
|
|
1159
|
-
d[1] || (d[1] = U(G((u) =>
|
|
1160
|
-
d[2] || (d[2] = U(G((u) =>
|
|
1156
|
+
d[1] || (d[1] = U(G((u) => l.$emit("collapse"), ["prevent"]), ["enter"])),
|
|
1157
|
+
d[2] || (d[2] = U(G((u) => l.$emit("collapse"), ["prevent"]), ["space"]))
|
|
1161
1158
|
]
|
|
1162
1159
|
}, [
|
|
1163
|
-
|
|
1160
|
+
P(x(ie), { icon: "lucide-minus" })
|
|
1164
1161
|
], 40, Zt)
|
|
1165
1162
|
]),
|
|
1166
1163
|
_: 1
|
|
1167
|
-
})) : (
|
|
1164
|
+
})) : (B(), se(x(me), {
|
|
1168
1165
|
key: 1,
|
|
1169
1166
|
placement: "bottom"
|
|
1170
1167
|
}, {
|
|
1171
|
-
tooltip:
|
|
1172
|
-
|
|
1168
|
+
tooltip: F(() => [
|
|
1169
|
+
A("span", jt, [
|
|
1173
1170
|
Ce(K(x(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.MAXIMIZE")) + " ", 1),
|
|
1174
|
-
|
|
1171
|
+
P(_e, {
|
|
1175
1172
|
parts: n.value.parts,
|
|
1176
1173
|
separated: !x(t)
|
|
1177
1174
|
}, null, 8, ["parts", "separated"])
|
|
1178
1175
|
])
|
|
1179
1176
|
]),
|
|
1180
|
-
default:
|
|
1181
|
-
|
|
1177
|
+
default: F(() => [
|
|
1178
|
+
A("div", {
|
|
1182
1179
|
class: "vc-ai-agent-header__button",
|
|
1183
1180
|
role: "button",
|
|
1184
1181
|
tabindex: "0",
|
|
1185
1182
|
"aria-label": x(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.MAXIMIZE"),
|
|
1186
|
-
"aria-keyshortcuts":
|
|
1187
|
-
onClick: d[3] || (d[3] = (u) =>
|
|
1183
|
+
"aria-keyshortcuts": f.value,
|
|
1184
|
+
onClick: d[3] || (d[3] = (u) => l.$emit("expand")),
|
|
1188
1185
|
onKeydown: [
|
|
1189
|
-
d[4] || (d[4] = U(G((u) =>
|
|
1190
|
-
d[5] || (d[5] = U(G((u) =>
|
|
1186
|
+
d[4] || (d[4] = U(G((u) => l.$emit("expand"), ["prevent"]), ["enter"])),
|
|
1187
|
+
d[5] || (d[5] = U(G((u) => l.$emit("expand"), ["prevent"]), ["space"]))
|
|
1191
1188
|
]
|
|
1192
1189
|
}, [
|
|
1193
|
-
|
|
1190
|
+
P(x(ie), { icon: "lucide-panel-top" })
|
|
1194
1191
|
], 40, Yt)
|
|
1195
1192
|
]),
|
|
1196
1193
|
_: 1
|
|
1197
1194
|
})),
|
|
1198
|
-
|
|
1199
|
-
tooltip:
|
|
1200
|
-
|
|
1195
|
+
P(x(me), { placement: "bottom" }, {
|
|
1196
|
+
tooltip: F(() => [
|
|
1197
|
+
A("span", Jt, [
|
|
1201
1198
|
Ce(K(x(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.CLOSE")) + " ", 1),
|
|
1202
|
-
|
|
1199
|
+
P(_e, {
|
|
1203
1200
|
parts: s.value.parts,
|
|
1204
1201
|
separated: !x(t)
|
|
1205
1202
|
}, null, 8, ["parts", "separated"])
|
|
1206
1203
|
])
|
|
1207
1204
|
]),
|
|
1208
|
-
default:
|
|
1209
|
-
|
|
1205
|
+
default: F(() => [
|
|
1206
|
+
A("div", {
|
|
1210
1207
|
class: "vc-ai-agent-header__button",
|
|
1211
1208
|
role: "button",
|
|
1212
1209
|
tabindex: "0",
|
|
1213
1210
|
"aria-label": x(o)("COMPONENTS.ORGANISMS.VC_BLADE_HEADER.CLOSE"),
|
|
1214
|
-
"aria-keyshortcuts":
|
|
1215
|
-
onClick: d[6] || (d[6] = (u) =>
|
|
1211
|
+
"aria-keyshortcuts": c.value,
|
|
1212
|
+
onClick: d[6] || (d[6] = (u) => l.$emit("close")),
|
|
1216
1213
|
onKeydown: [
|
|
1217
|
-
d[7] || (d[7] = U(G((u) =>
|
|
1218
|
-
d[8] || (d[8] = U(G((u) =>
|
|
1214
|
+
d[7] || (d[7] = U(G((u) => l.$emit("close"), ["prevent"]), ["enter"])),
|
|
1215
|
+
d[8] || (d[8] = U(G((u) => l.$emit("close"), ["prevent"]), ["space"]))
|
|
1219
1216
|
]
|
|
1220
1217
|
}, [
|
|
1221
|
-
|
|
1218
|
+
P(x(ie), { icon: "lucide-x" })
|
|
1222
1219
|
], 40, Qt)
|
|
1223
1220
|
]),
|
|
1224
1221
|
_: 1
|
|
@@ -1235,16 +1232,16 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1235
1232
|
text: {}
|
|
1236
1233
|
},
|
|
1237
1234
|
setup(e) {
|
|
1238
|
-
return (o, t) => (
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1235
|
+
return (o, t) => (B(), S("div", tn, [
|
|
1236
|
+
A("div", nn, [
|
|
1237
|
+
A("div", an, [
|
|
1238
|
+
P(Ue, {
|
|
1242
1239
|
width: 80,
|
|
1243
1240
|
height: 87,
|
|
1244
1241
|
animated: ""
|
|
1245
1242
|
})
|
|
1246
1243
|
]),
|
|
1247
|
-
e.text ? (
|
|
1244
|
+
e.text ? (B(), S("p", on, K(e.text), 1)) : z("", !0)
|
|
1248
1245
|
])
|
|
1249
1246
|
]));
|
|
1250
1247
|
}
|
|
@@ -1258,135 +1255,139 @@ const Dt = ["width", "height"], Lt = ["clip-path"], Nt = {
|
|
|
1258
1255
|
},
|
|
1259
1256
|
emits: ["iframe-ready"],
|
|
1260
1257
|
setup(e, { emit: o }) {
|
|
1261
|
-
const t = W("ai-agent-iframe"), s = e, n = o,
|
|
1258
|
+
const t = W("ai-agent-iframe"), s = e, n = o, c = D(null), f = D(!0);
|
|
1262
1259
|
q(
|
|
1263
|
-
|
|
1260
|
+
c,
|
|
1264
1261
|
(d) => {
|
|
1265
1262
|
d && n("iframe-ready", d);
|
|
1266
1263
|
},
|
|
1267
1264
|
{ immediate: !0 }
|
|
1268
1265
|
);
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1266
|
+
const l = () => {
|
|
1267
|
+
f.value = !1, t.debug("Iframe loaded");
|
|
1271
1268
|
};
|
|
1272
1269
|
return q(
|
|
1273
1270
|
() => s.url,
|
|
1274
1271
|
() => {
|
|
1275
|
-
|
|
1272
|
+
f.value = !0;
|
|
1276
1273
|
}
|
|
1277
|
-
), (d, u) => (
|
|
1278
|
-
|
|
1279
|
-
default:
|
|
1280
|
-
|
|
1274
|
+
), (d, u) => (B(), S("div", sn, [
|
|
1275
|
+
P(ke, { name: "fade" }, {
|
|
1276
|
+
default: F(() => [
|
|
1277
|
+
f.value && e.url ? (B(), se(rn, {
|
|
1281
1278
|
key: 0,
|
|
1282
1279
|
text: d.$t("AI_AGENT.LOADING")
|
|
1283
1280
|
}, null, 8, ["text"])) : z("", !0)
|
|
1284
1281
|
]),
|
|
1285
1282
|
_: 1
|
|
1286
1283
|
}),
|
|
1287
|
-
e.url ? (
|
|
1284
|
+
e.url ? (B(), S("iframe", {
|
|
1288
1285
|
key: 0,
|
|
1289
1286
|
ref_key: "iframeRef",
|
|
1290
|
-
ref:
|
|
1287
|
+
ref: c,
|
|
1291
1288
|
src: e.url,
|
|
1292
|
-
class: Me(["vc-ai-agent-iframe__frame", { "vc-ai-agent-iframe__frame--loading":
|
|
1289
|
+
class: Me(["vc-ai-agent-iframe__frame", { "vc-ai-agent-iframe__frame--loading": f.value }]),
|
|
1293
1290
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",
|
|
1294
1291
|
allow: "clipboard-read; clipboard-write",
|
|
1295
|
-
onLoad:
|
|
1296
|
-
}, null, 42, ln)) : (
|
|
1297
|
-
|
|
1292
|
+
onLoad: l
|
|
1293
|
+
}, null, 42, ln)) : (B(), S("div", cn, [
|
|
1294
|
+
P(x(ie), {
|
|
1298
1295
|
icon: "lucide-sparkles",
|
|
1299
1296
|
size: "xl",
|
|
1300
1297
|
class: "vc-ai-agent-iframe__placeholder-icon"
|
|
1301
1298
|
}),
|
|
1302
|
-
u[0] || (u[0] =
|
|
1299
|
+
u[0] || (u[0] = A("p", { class: "vc-ai-agent-iframe__placeholder-text" }, "AI Agent URL not configured", -1))
|
|
1303
1300
|
]))
|
|
1304
1301
|
]));
|
|
1305
1302
|
}
|
|
1306
|
-
}), un = { class: "vc-ai-agent-panel__content" },
|
|
1303
|
+
}), un = ["inert"], pn = { class: "vc-ai-agent-panel__content" }, Pn = /* @__PURE__ */ H({
|
|
1307
1304
|
__name: "VcAiAgentPanel",
|
|
1305
|
+
props: {
|
|
1306
|
+
inert: { type: Boolean }
|
|
1307
|
+
},
|
|
1308
1308
|
setup(e) {
|
|
1309
|
-
const { isMac: o } = Ne(), t =
|
|
1309
|
+
const { isMac: o } = Ne(), t = N(be), s = N(et, !1);
|
|
1310
1310
|
t || console.error("[VcAiAgentPanel] AiAgentService not provided");
|
|
1311
1311
|
const n = b(
|
|
1312
1312
|
() => t?.config.value ?? { url: "", title: "AI Assistant", width: 362, expandedWidth: 500 }
|
|
1313
|
-
),
|
|
1314
|
-
width:
|
|
1313
|
+
), c = b(() => !s && (t?.isOpen.value ?? !1)), f = b(() => t?.isExpanded.value ?? !1), l = b(() => t?.totalItemsCount.value ?? 0), d = b(() => ({
|
|
1314
|
+
width: f.value ? `${n.value.expandedWidth ?? 500}px` : `${n.value.width ?? 362}px`
|
|
1315
1315
|
})), u = () => t?.closePanel(), h = () => t?.expandPanel(), v = () => t?.collapsePanel();
|
|
1316
1316
|
tt(document, "keydown", (C) => {
|
|
1317
|
-
if (
|
|
1317
|
+
if (c.value && !C.isComposing && !C.defaultPrevented) {
|
|
1318
1318
|
if (C.key === "Escape") {
|
|
1319
1319
|
C.preventDefault(), u();
|
|
1320
1320
|
return;
|
|
1321
1321
|
}
|
|
1322
|
-
Et(Q.mod.backslash, C, o) && (C.preventDefault(),
|
|
1322
|
+
Et(Q.mod.backslash, C, o) && (C.preventDefault(), f.value ? v() : h());
|
|
1323
1323
|
}
|
|
1324
1324
|
});
|
|
1325
|
-
const
|
|
1325
|
+
const g = (C) => {
|
|
1326
1326
|
t?._setIframeRef(C);
|
|
1327
1327
|
};
|
|
1328
1328
|
return ze(() => {
|
|
1329
1329
|
t?._setIframeRef(null);
|
|
1330
|
-
}), (C, E) => (
|
|
1331
|
-
default:
|
|
1332
|
-
|
|
1330
|
+
}), (C, E) => (B(), se(ke, { name: "ai-panel-slide" }, {
|
|
1331
|
+
default: F(() => [
|
|
1332
|
+
c.value ? (B(), S("div", {
|
|
1333
1333
|
key: 0,
|
|
1334
1334
|
class: Me(["vc-ai-agent-panel", {
|
|
1335
|
-
"vc-ai-agent-panel--expanded":
|
|
1335
|
+
"vc-ai-agent-panel--expanded": f.value
|
|
1336
1336
|
}]),
|
|
1337
|
-
style: He(d.value)
|
|
1337
|
+
style: He(d.value),
|
|
1338
|
+
inert: e.inert || void 0
|
|
1338
1339
|
}, [
|
|
1339
|
-
|
|
1340
|
+
P(en, {
|
|
1340
1341
|
title: n.value.title,
|
|
1341
|
-
"is-expanded":
|
|
1342
|
-
"items-count":
|
|
1342
|
+
"is-expanded": f.value,
|
|
1343
|
+
"items-count": l.value,
|
|
1343
1344
|
onClose: u,
|
|
1344
1345
|
onExpand: h,
|
|
1345
1346
|
onCollapse: v
|
|
1346
1347
|
}, null, 8, ["title", "is-expanded", "items-count"]),
|
|
1347
|
-
|
|
1348
|
-
|
|
1348
|
+
A("div", pn, [
|
|
1349
|
+
P(dn, {
|
|
1349
1350
|
url: n.value.url,
|
|
1350
|
-
onIframeReady:
|
|
1351
|
+
onIframeReady: g
|
|
1351
1352
|
}, null, 8, ["url"])
|
|
1352
1353
|
])
|
|
1353
|
-
],
|
|
1354
|
+
], 14, un)) : z("", !0)
|
|
1354
1355
|
]),
|
|
1355
1356
|
_: 1
|
|
1356
1357
|
}));
|
|
1357
1358
|
}
|
|
1358
1359
|
});
|
|
1359
1360
|
export {
|
|
1360
|
-
|
|
1361
|
-
|
|
1361
|
+
hn as A,
|
|
1362
|
+
xn as B,
|
|
1362
1363
|
at as D,
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1364
|
+
_n as E,
|
|
1365
|
+
En as H,
|
|
1366
|
+
Pn as _,
|
|
1367
|
+
Tn as a,
|
|
1367
1368
|
xe as b,
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1369
|
+
On as c,
|
|
1370
|
+
yn as d,
|
|
1371
|
+
An as e,
|
|
1372
|
+
Bn as f,
|
|
1372
1373
|
It as g,
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1374
|
+
$e as h,
|
|
1375
|
+
Fe as i,
|
|
1376
|
+
wt as j,
|
|
1376
1377
|
Re as k,
|
|
1377
1378
|
Oe as l,
|
|
1378
1379
|
yt as m,
|
|
1379
1380
|
mt as n,
|
|
1380
1381
|
ht as o,
|
|
1381
|
-
|
|
1382
|
+
In as p,
|
|
1382
1383
|
Ee as q,
|
|
1383
1384
|
Q as r,
|
|
1384
1385
|
wn as s,
|
|
1385
|
-
|
|
1386
|
-
|
|
1386
|
+
bn as t,
|
|
1387
|
+
Sn as u,
|
|
1387
1388
|
Et as v,
|
|
1388
1389
|
Mt as w,
|
|
1389
|
-
|
|
1390
|
+
At as x,
|
|
1390
1391
|
Ne as y,
|
|
1391
1392
|
_e as z
|
|
1392
1393
|
};
|