@_solaris/messenger-widget 0.2.19 → 0.2.20
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/messenger.cjs +9 -9
- package/dist/messenger.embed.js +3 -3
- package/dist/messenger.js +188 -175
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Ae, openBlock as l, createElementBlock as d, createVNode as z, Transition as Se, withCtx as xe, withKeys as me, withModifiers as
|
|
1
|
+
import { reactive as Ae, openBlock as l, createElementBlock as d, createVNode as z, Transition as Se, withCtx as xe, withKeys as me, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as w, normalizeStyle as V, normalizeClass as E, Fragment as M, renderList as j, resolveComponent as O, createBlock as R, createTextVNode as ie, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as H, vModelText as K, vModelCheckbox as Ie, vModelSelect as Oe, createStaticVNode as ue, markRaw as fe } from "vue";
|
|
2
2
|
const Ee = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -36,9 +36,9 @@ function $e(t) {
|
|
|
36
36
|
}
|
|
37
37
|
function a(h, f) {
|
|
38
38
|
const _ = e.listeners.get(h);
|
|
39
|
-
_ && _.forEach((
|
|
39
|
+
_ && _.forEach((C) => {
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
C(f);
|
|
42
42
|
} catch (I) {
|
|
43
43
|
console.error("[transport] listener", h, I);
|
|
44
44
|
}
|
|
@@ -55,18 +55,18 @@ function $e(t) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
async function o(h, f, _) {
|
|
58
|
-
const
|
|
58
|
+
const C = await fetch(`${e.baseUrl}${f}`, {
|
|
59
59
|
method: h,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
61
61
|
body: _ !== void 0 ? JSON.stringify(_) : void 0
|
|
62
62
|
});
|
|
63
|
-
if (!
|
|
64
|
-
const I = await c(
|
|
65
|
-
`HTTP ${
|
|
63
|
+
if (!C.ok) {
|
|
64
|
+
const I = await c(C), T = new Error(
|
|
65
|
+
`HTTP ${C.status} ${h} ${f} :: ${(I == null ? void 0 : I.error) || C.statusText}`
|
|
66
66
|
);
|
|
67
|
-
throw T.status =
|
|
67
|
+
throw T.status = C.status, T.body = I, T;
|
|
68
68
|
}
|
|
69
|
-
return
|
|
69
|
+
return C.status === 204 ? null : C.json();
|
|
70
70
|
}
|
|
71
71
|
async function c(h) {
|
|
72
72
|
try {
|
|
@@ -80,8 +80,8 @@ function $e(t) {
|
|
|
80
80
|
// Public — no HMAC required.
|
|
81
81
|
fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (_) => {
|
|
82
82
|
if (!_.ok) {
|
|
83
|
-
const
|
|
84
|
-
throw new Error(`HTTP ${_.status} GET /widgets/:id/config :: ${(
|
|
83
|
+
const C = await c(_);
|
|
84
|
+
throw new Error(`HTTP ${_.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || _.statusText}`);
|
|
85
85
|
}
|
|
86
86
|
return _.json();
|
|
87
87
|
}),
|
|
@@ -96,7 +96,7 @@ function $e(t) {
|
|
|
96
96
|
customer: (f == null ? void 0 : f.customer) ?? null
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
async function
|
|
99
|
+
async function k() {
|
|
100
100
|
const h = await o("GET", "/customers/me");
|
|
101
101
|
return (h == null ? void 0 : h.customer) ?? null;
|
|
102
102
|
}
|
|
@@ -114,19 +114,19 @@ function $e(t) {
|
|
|
114
114
|
async function A(h) {
|
|
115
115
|
return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
|
|
116
116
|
}
|
|
117
|
-
async function
|
|
117
|
+
async function D(h, f) {
|
|
118
118
|
return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
|
|
119
119
|
}
|
|
120
120
|
async function x(h, f = {}) {
|
|
121
121
|
const _ = new URLSearchParams();
|
|
122
122
|
f.before && _.set("before", f.before), f.since && _.set("since", f.since), f.limit && _.set("limit", String(f.limit));
|
|
123
|
-
const
|
|
123
|
+
const C = _.toString() ? `?${_.toString()}` : "";
|
|
124
124
|
return o(
|
|
125
125
|
"GET",
|
|
126
|
-
`/conversations/${encodeURIComponent(h)}/messages${
|
|
126
|
+
`/conversations/${encodeURIComponent(h)}/messages${C}`
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
async function
|
|
129
|
+
async function N(h, f) {
|
|
130
130
|
G();
|
|
131
131
|
const _ = {
|
|
132
132
|
client_msg_id: f.client_msg_id,
|
|
@@ -152,11 +152,11 @@ function $e(t) {
|
|
|
152
152
|
const f = (
|
|
153
153
|
/** @type {File} */
|
|
154
154
|
h.name || "attachment"
|
|
155
|
-
), _ = h.type || "application/octet-stream",
|
|
155
|
+
), _ = h.type || "application/octet-stream", C = h.size || 0, I = (
|
|
156
156
|
/** @type {import('./types.js').AttachmentUploadTicket} */
|
|
157
157
|
await o("POST", "/attachments", {
|
|
158
158
|
mime_type: _,
|
|
159
|
-
size_bytes:
|
|
159
|
+
size_bytes: C,
|
|
160
160
|
name: f
|
|
161
161
|
})
|
|
162
162
|
), T = await fetch(I.upload_url, {
|
|
@@ -170,7 +170,7 @@ function $e(t) {
|
|
|
170
170
|
type: je(_),
|
|
171
171
|
path: I.path,
|
|
172
172
|
mime_type: _,
|
|
173
|
-
size_bytes:
|
|
173
|
+
size_bytes: C
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
async function q(h) {
|
|
@@ -179,7 +179,7 @@ function $e(t) {
|
|
|
179
179
|
`/attachments/sign?path=${encodeURIComponent(h)}`
|
|
180
180
|
);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Y() {
|
|
183
183
|
const h = new URLSearchParams({
|
|
184
184
|
userId: e.userId,
|
|
185
185
|
userHash: e.userHash,
|
|
@@ -190,7 +190,7 @@ function $e(t) {
|
|
|
190
190
|
function W() {
|
|
191
191
|
if (!e.eventSource && !(typeof document < "u" && document.hidden))
|
|
192
192
|
try {
|
|
193
|
-
const h = new EventSource(
|
|
193
|
+
const h = new EventSource(Y());
|
|
194
194
|
for (const f of Ee)
|
|
195
195
|
h.addEventListener(f, (_) => ae(f, _.data));
|
|
196
196
|
h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
|
|
@@ -200,18 +200,18 @@ function $e(t) {
|
|
|
200
200
|
}
|
|
201
201
|
function ae(h, f) {
|
|
202
202
|
try {
|
|
203
|
-
const _ = JSON.parse(f),
|
|
204
|
-
a(h,
|
|
203
|
+
const _ = JSON.parse(f), C = _ && typeof _ == "object" && "data" in _ ? _.data : _;
|
|
204
|
+
a(h, C);
|
|
205
205
|
} catch (_) {
|
|
206
206
|
console.error("[transport] bad SSE payload", h, _);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function J() {
|
|
210
210
|
e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
|
|
211
211
|
}
|
|
212
212
|
function G() {
|
|
213
213
|
clearTimeout(e.burstTimer), W(), e.panelOpen || (e.burstTimer = setTimeout(() => {
|
|
214
|
-
e.panelOpen ||
|
|
214
|
+
e.panelOpen || J();
|
|
215
215
|
}, Le));
|
|
216
216
|
}
|
|
217
217
|
function oe(h) {
|
|
@@ -219,16 +219,16 @@ function $e(t) {
|
|
|
219
219
|
}
|
|
220
220
|
async function le() {
|
|
221
221
|
try {
|
|
222
|
-
const h = await S(), f = h.reduce((
|
|
222
|
+
const h = await S(), f = h.reduce((C, I) => {
|
|
223
223
|
const T = I == null ? void 0 : I.last_message_at;
|
|
224
|
-
return T && (!
|
|
224
|
+
return T && (!C || T > C) ? T : C;
|
|
225
225
|
}, null);
|
|
226
226
|
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), G());
|
|
227
227
|
} catch (h) {
|
|
228
228
|
console.error("[transport] poll failed", h);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Z() {
|
|
232
232
|
u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(le, Be));
|
|
233
233
|
}
|
|
234
234
|
function u() {
|
|
@@ -237,14 +237,14 @@ function $e(t) {
|
|
|
237
237
|
function m() {
|
|
238
238
|
if (document.hidden)
|
|
239
239
|
clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
|
|
240
|
-
e.hiddenGraceTimer = null, document.hidden && (u(),
|
|
240
|
+
e.hiddenGraceTimer = null, document.hidden && (u(), J(), r("paused"));
|
|
241
241
|
}, Re);
|
|
242
242
|
else {
|
|
243
243
|
if (e.hiddenGraceTimer) {
|
|
244
244
|
clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
r("idle"),
|
|
247
|
+
r("idle"), Z(), e.panelOpen && W();
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
async function p() {
|
|
@@ -254,17 +254,17 @@ function $e(t) {
|
|
|
254
254
|
e.lastBootstrap = h;
|
|
255
255
|
try {
|
|
256
256
|
const f = await S();
|
|
257
|
-
e.lastActivityAt = f.reduce((_,
|
|
258
|
-
const I =
|
|
257
|
+
e.lastActivityAt = f.reduce((_, C) => {
|
|
258
|
+
const I = C == null ? void 0 : C.last_message_at;
|
|
259
259
|
return I && (!_ || I > _) ? I : _;
|
|
260
260
|
}, null);
|
|
261
261
|
} catch (f) {
|
|
262
262
|
console.error("[transport] initial /conversations failed", f);
|
|
263
263
|
}
|
|
264
|
-
return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)),
|
|
264
|
+
return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Z(), h;
|
|
265
265
|
}
|
|
266
266
|
function g() {
|
|
267
|
-
u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null,
|
|
267
|
+
u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, J(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
|
|
268
268
|
}
|
|
269
269
|
return {
|
|
270
270
|
on: n,
|
|
@@ -273,14 +273,14 @@ function $e(t) {
|
|
|
273
273
|
setPanelOpen: oe,
|
|
274
274
|
// REST
|
|
275
275
|
bootstrap: v,
|
|
276
|
-
getCustomer:
|
|
276
|
+
getCustomer: k,
|
|
277
277
|
patchCustomer: y,
|
|
278
278
|
listConversations: S,
|
|
279
279
|
createConversation: $,
|
|
280
280
|
getConversation: A,
|
|
281
|
-
patchConversation:
|
|
281
|
+
patchConversation: D,
|
|
282
282
|
listMessages: x,
|
|
283
|
-
postMessage:
|
|
283
|
+
postMessage: N,
|
|
284
284
|
postCallback: F,
|
|
285
285
|
uploadAttachment: P,
|
|
286
286
|
signAttachment: q,
|
|
@@ -406,7 +406,7 @@ function De(t) {
|
|
|
406
406
|
loaded: !0
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
|
-
async function
|
|
409
|
+
async function k(u) {
|
|
410
410
|
const m = e.paginationByConv[u];
|
|
411
411
|
if (!(!m || m.loading || !m.nextCursor)) {
|
|
412
412
|
y(u, { ...m, loading: !0 });
|
|
@@ -416,10 +416,10 @@ function De(t) {
|
|
|
416
416
|
const L = await t.listMessages(u, {
|
|
417
417
|
before: h,
|
|
418
418
|
limit: c
|
|
419
|
-
}),
|
|
420
|
-
if (f = [...
|
|
419
|
+
}), ee = (L == null ? void 0 : L.messages) ?? [];
|
|
420
|
+
if (f = [...ee, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !ee.length || f.length >= 60) break;
|
|
421
421
|
}
|
|
422
|
-
const
|
|
422
|
+
const C = e.messagesByConv[u] || [], I = new Set(C.map((L) => String(L == null ? void 0 : L.id))), T = [...f.filter((L) => !I.has(String(L == null ? void 0 : L.id))), ...C];
|
|
423
423
|
e.messagesByConv[u] = T, y(u, {
|
|
424
424
|
nextCursor: h,
|
|
425
425
|
loading: !1,
|
|
@@ -441,7 +441,7 @@ function De(t) {
|
|
|
441
441
|
var T;
|
|
442
442
|
const h = (m || "").trim(), f = Array.isArray(p) && p.length > 0;
|
|
443
443
|
if (!u || !h && !f) return;
|
|
444
|
-
const _ = Ue(),
|
|
444
|
+
const _ = Ue(), C = Z(u), I = {
|
|
445
445
|
id: _,
|
|
446
446
|
client_msg_id: _,
|
|
447
447
|
conversation_id: u,
|
|
@@ -451,7 +451,7 @@ function De(t) {
|
|
|
451
451
|
type: "user",
|
|
452
452
|
id: ((T = e.customer) == null ? void 0 : T.external_id) || null
|
|
453
453
|
},
|
|
454
|
-
created_at:
|
|
454
|
+
created_at: C,
|
|
455
455
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
456
456
|
_pending: !0,
|
|
457
457
|
...f ? { payload: { type: "content", attachments: p } } : {},
|
|
@@ -462,12 +462,12 @@ function De(t) {
|
|
|
462
462
|
await t.postMessage(u, {
|
|
463
463
|
client_msg_id: _,
|
|
464
464
|
text_md: h,
|
|
465
|
-
created_at:
|
|
465
|
+
created_at: C,
|
|
466
466
|
...f ? { attachments: p } : {},
|
|
467
467
|
...g && typeof g == "object" ? { metadata: g } : {}
|
|
468
468
|
});
|
|
469
469
|
} catch (L) {
|
|
470
|
-
console.error("[store] send failed", L),
|
|
470
|
+
console.error("[store] send failed", L), J(u, _, { _failed: !0, _pending: !1 });
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
async function A(u, m, p) {
|
|
@@ -478,10 +478,10 @@ function De(t) {
|
|
|
478
478
|
console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
const
|
|
481
|
+
const D = /* @__PURE__ */ new Map();
|
|
482
482
|
async function x(u) {
|
|
483
483
|
if (!u) return null;
|
|
484
|
-
const m =
|
|
484
|
+
const m = D.get(u);
|
|
485
485
|
if (m != null && m.url) {
|
|
486
486
|
const p = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
487
487
|
if (!p || p - Date.now() > 6e4) return m.url;
|
|
@@ -489,13 +489,13 @@ function De(t) {
|
|
|
489
489
|
try {
|
|
490
490
|
const p = await t.signAttachment(u);
|
|
491
491
|
if (p != null && p.signed_url)
|
|
492
|
-
return
|
|
492
|
+
return D.set(u, { url: p.signed_url, expires_at: p.expires_at }), p.signed_url;
|
|
493
493
|
} catch (p) {
|
|
494
494
|
console.error("[store] sign attachment failed", p);
|
|
495
495
|
}
|
|
496
496
|
return null;
|
|
497
497
|
}
|
|
498
|
-
async function
|
|
498
|
+
async function N(u, { rating: m, comment: p } = {}) {
|
|
499
499
|
const g = e.conversations.find((_) => _.id === u), f = {
|
|
500
500
|
...(g == null ? void 0 : g.metadata) || {},
|
|
501
501
|
feedback: {
|
|
@@ -522,9 +522,9 @@ function De(t) {
|
|
|
522
522
|
for (let f = m.length - 1; f >= 0; f--) {
|
|
523
523
|
const _ = m[f];
|
|
524
524
|
if (((p = _ == null ? void 0 : _.author) == null ? void 0 : p.type) === "user" || (_ == null ? void 0 : _.type) === "action" && ((g = _ == null ? void 0 : _.payload) == null ? void 0 : g.state) === "pending") return null;
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
return { message: _, form:
|
|
525
|
+
const C = (h = _ == null ? void 0 : _.metadata) == null ? void 0 : h.form;
|
|
526
|
+
if (C && Array.isArray(C.fields) && C.fields.length > 0)
|
|
527
|
+
return { message: _, form: C };
|
|
528
528
|
}
|
|
529
529
|
return null;
|
|
530
530
|
}
|
|
@@ -536,15 +536,15 @@ function De(t) {
|
|
|
536
536
|
const g = p[0];
|
|
537
537
|
return { id: g, payload: { name: m[g] } };
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Y(u) {
|
|
540
540
|
var p, g, h, f;
|
|
541
541
|
const m = e.messagesByConv[u] || [];
|
|
542
542
|
for (let _ = m.length - 1; _ >= 0; _--) {
|
|
543
|
-
const
|
|
544
|
-
if (((p =
|
|
545
|
-
if ((
|
|
546
|
-
if (((h =
|
|
547
|
-
const I = (f =
|
|
543
|
+
const C = m[_];
|
|
544
|
+
if (((p = C == null ? void 0 : C.author) == null ? void 0 : p.type) === "user") return [];
|
|
545
|
+
if ((C == null ? void 0 : C.type) === "action" && ((g = C == null ? void 0 : C.payload) == null ? void 0 : g.state) === "pending") return [];
|
|
546
|
+
if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
|
|
547
|
+
const I = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
|
|
548
548
|
return Array.isArray(I) && I.length ? I.map((T) => {
|
|
549
549
|
if (typeof T == "string") {
|
|
550
550
|
const L = T.trim();
|
|
@@ -553,8 +553,8 @@ function De(t) {
|
|
|
553
553
|
if (T && typeof T == "object" && typeof T.label == "string") {
|
|
554
554
|
const L = T.label.trim();
|
|
555
555
|
if (!L) return null;
|
|
556
|
-
const
|
|
557
|
-
return { label: L, kind:
|
|
556
|
+
const ee = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
|
|
557
|
+
return { label: L, kind: ee };
|
|
558
558
|
}
|
|
559
559
|
return null;
|
|
560
560
|
}).filter(Boolean).slice(0, 4) : [];
|
|
@@ -574,7 +574,7 @@ function De(t) {
|
|
|
574
574
|
function ae(u, m) {
|
|
575
575
|
return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function J(u, m, p) {
|
|
578
578
|
const g = e.messagesByConv[u];
|
|
579
579
|
if (!g) return;
|
|
580
580
|
const h = g.findIndex((_) => _.id === m);
|
|
@@ -603,7 +603,7 @@ function De(t) {
|
|
|
603
603
|
h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(p, h) : p[g] = h);
|
|
604
604
|
return Object.keys(p).length && (m.values = p), Object.keys(m).length ? m : null;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function Z(u) {
|
|
607
607
|
const m = e.messagesByConv[u] || [];
|
|
608
608
|
let p = "";
|
|
609
609
|
for (const f of m)
|
|
@@ -618,21 +618,21 @@ function De(t) {
|
|
|
618
618
|
applyCustomer: s,
|
|
619
619
|
createConversation: o,
|
|
620
620
|
openConversation: v,
|
|
621
|
-
loadMore:
|
|
621
|
+
loadMore: k,
|
|
622
622
|
patchConversation: S,
|
|
623
623
|
send: $,
|
|
624
624
|
clickCallback: A,
|
|
625
625
|
signAttachment: x,
|
|
626
|
-
submitFeedback:
|
|
626
|
+
submitFeedback: N,
|
|
627
627
|
getPendingApproval: F,
|
|
628
628
|
getActionInFlight: q,
|
|
629
|
-
getLatestSuggestions:
|
|
629
|
+
getLatestSuggestions: Y,
|
|
630
630
|
getLatestForm: P,
|
|
631
631
|
// Pass-through for panel open/close (controls SSE burst).
|
|
632
632
|
setPanelOpen: t.setPanelOpen
|
|
633
633
|
};
|
|
634
634
|
}
|
|
635
|
-
const
|
|
635
|
+
const U = {
|
|
636
636
|
w: "#ffffff",
|
|
637
637
|
g50: "#F9F9F7",
|
|
638
638
|
g100: "#F2F1EE",
|
|
@@ -664,21 +664,21 @@ const Ne = `
|
|
|
664
664
|
.wm-root {
|
|
665
665
|
--wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
666
666
|
--wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
667
|
-
--wm-w: ${
|
|
668
|
-
--wm-g50: ${
|
|
669
|
-
--wm-g100: ${
|
|
670
|
-
--wm-g150: ${
|
|
671
|
-
--wm-g200: ${
|
|
672
|
-
--wm-g300: ${
|
|
673
|
-
--wm-g400: ${
|
|
674
|
-
--wm-g500: ${
|
|
675
|
-
--wm-g700: ${
|
|
676
|
-
--wm-g900: ${
|
|
677
|
-
--wm-a: ${
|
|
678
|
-
--wm-al: ${
|
|
679
|
-
--wm-green: ${
|
|
680
|
-
--wm-red: ${
|
|
681
|
-
--wm-redBg: ${
|
|
667
|
+
--wm-w: ${U.w};
|
|
668
|
+
--wm-g50: ${U.g50};
|
|
669
|
+
--wm-g100: ${U.g100};
|
|
670
|
+
--wm-g150: ${U.g150};
|
|
671
|
+
--wm-g200: ${U.g200};
|
|
672
|
+
--wm-g300: ${U.g300};
|
|
673
|
+
--wm-g400: ${U.g400};
|
|
674
|
+
--wm-g500: ${U.g500};
|
|
675
|
+
--wm-g700: ${U.g700};
|
|
676
|
+
--wm-g900: ${U.g900};
|
|
677
|
+
--wm-a: ${U.accent};
|
|
678
|
+
--wm-al: ${U.accentLight};
|
|
679
|
+
--wm-green: ${U.green};
|
|
680
|
+
--wm-red: ${U.red};
|
|
681
|
+
--wm-redBg: ${U.redBg};
|
|
682
682
|
--wm-sh1: 0 1px 3px rgba(0,0,0,.06);
|
|
683
683
|
--wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
|
|
684
684
|
--wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
|
|
@@ -732,8 +732,8 @@ function We(t, e, n, a, r, s) {
|
|
|
732
732
|
"aria-label": "Ouvrir le messenger sur le dernier message",
|
|
733
733
|
onClick: e[1] || (e[1] = (o) => t.$emit("open")),
|
|
734
734
|
onKeydown: [
|
|
735
|
-
e[2] || (e[2] = me(
|
|
736
|
-
e[3] || (e[3] = me(
|
|
735
|
+
e[2] || (e[2] = me(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
|
|
736
|
+
e[3] || (e[3] = me(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
|
|
737
737
|
]
|
|
738
738
|
}, [
|
|
739
739
|
i("p", Ve, b(n.peek), 1),
|
|
@@ -741,7 +741,7 @@ function We(t, e, n, a, r, s) {
|
|
|
741
741
|
type: "button",
|
|
742
742
|
class: "wm-peek__close",
|
|
743
743
|
"aria-label": "Ignorer",
|
|
744
|
-
onClick: e[0] || (e[0] =
|
|
744
|
+
onClick: e[0] || (e[0] = X((o) => t.$emit("dismiss"), ["stop"]))
|
|
745
745
|
}, [...e[5] || (e[5] = [
|
|
746
746
|
i("svg", {
|
|
747
747
|
width: "11",
|
|
@@ -843,7 +843,7 @@ function Xe(t, e, n, a, r, s) {
|
|
|
843
843
|
], 2)
|
|
844
844
|
], 6);
|
|
845
845
|
}
|
|
846
|
-
const
|
|
846
|
+
const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"]]), Qe = {
|
|
847
847
|
name: "WmHumanAvatar",
|
|
848
848
|
props: {
|
|
849
849
|
name: { type: String, default: "" },
|
|
@@ -931,7 +931,7 @@ function at(t, e, n, a, r, s) {
|
|
|
931
931
|
}
|
|
932
932
|
const ot = /* @__PURE__ */ B(tt, [["render", at], ["__scopeId", "data-v-3659b9c1"]]), lt = {
|
|
933
933
|
name: "WmHeader",
|
|
934
|
-
components: { AIAvatar:
|
|
934
|
+
components: { AIAvatar: Q, HumanAvatar: ke, TeamAvatars: ot },
|
|
935
935
|
props: {
|
|
936
936
|
title: { type: String, default: "Nouvelle conversation" },
|
|
937
937
|
escalated: { type: Boolean, default: !1 },
|
|
@@ -980,7 +980,7 @@ function gt(t, e, n, a, r, s) {
|
|
|
980
980
|
type: "button",
|
|
981
981
|
class: "wm-header__icon",
|
|
982
982
|
"aria-label": "Retour à l'accueil",
|
|
983
|
-
onClick: e[0] || (e[0] = (
|
|
983
|
+
onClick: e[0] || (e[0] = (k) => t.$emit("back"))
|
|
984
984
|
}, [...e[3] || (e[3] = [
|
|
985
985
|
i("svg", {
|
|
986
986
|
width: "13",
|
|
@@ -1018,7 +1018,7 @@ function gt(t, e, n, a, r, s) {
|
|
|
1018
1018
|
}, null, 8, ["members", "response-label"])) : w("", !0),
|
|
1019
1019
|
i("span", pt, [
|
|
1020
1020
|
e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
|
|
1021
|
-
|
|
1021
|
+
ie(" " + b(s.statusText), 1)
|
|
1022
1022
|
])
|
|
1023
1023
|
])) : w("", !0)
|
|
1024
1024
|
])
|
|
@@ -1030,7 +1030,7 @@ function gt(t, e, n, a, r, s) {
|
|
|
1030
1030
|
class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
|
|
1031
1031
|
"aria-label": "Plus d'options",
|
|
1032
1032
|
title: "Plus d'options",
|
|
1033
|
-
onClick: e[1] || (e[1] = (
|
|
1033
|
+
onClick: e[1] || (e[1] = (k) => t.$emit("more"))
|
|
1034
1034
|
}, [...e[5] || (e[5] = [
|
|
1035
1035
|
i("svg", {
|
|
1036
1036
|
width: "13",
|
|
@@ -1062,7 +1062,7 @@ function gt(t, e, n, a, r, s) {
|
|
|
1062
1062
|
class: "wm-header__icon",
|
|
1063
1063
|
"aria-label": "Fermer le widget",
|
|
1064
1064
|
title: "Fermer le widget",
|
|
1065
|
-
onClick: e[2] || (e[2] = (
|
|
1065
|
+
onClick: e[2] || (e[2] = (k) => t.$emit("close"))
|
|
1066
1066
|
}, [...e[6] || (e[6] = [
|
|
1067
1067
|
i("svg", {
|
|
1068
1068
|
width: "13",
|
|
@@ -1089,7 +1089,7 @@ const yt = /* @__PURE__ */ B(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9
|
|
|
1089
1089
|
link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
|
|
1090
1090
|
}, wt = {
|
|
1091
1091
|
name: "WmOnboarding",
|
|
1092
|
-
components: { AIAvatar:
|
|
1092
|
+
components: { AIAvatar: Q },
|
|
1093
1093
|
props: {
|
|
1094
1094
|
welcomeMessage: { type: String, default: "" },
|
|
1095
1095
|
agentName: { type: String, default: "" },
|
|
@@ -1196,7 +1196,7 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1196
1196
|
key: v,
|
|
1197
1197
|
type: "button",
|
|
1198
1198
|
class: "wm-onb__link",
|
|
1199
|
-
onClick: (
|
|
1199
|
+
onClick: (k) => t.$emit("select", c)
|
|
1200
1200
|
}, [
|
|
1201
1201
|
i("span", Rt, [
|
|
1202
1202
|
(l(), d("svg", $t, [
|
|
@@ -1366,7 +1366,7 @@ function an(t, e, n, a, r, s) {
|
|
|
1366
1366
|
}, [
|
|
1367
1367
|
i("polyline", { points: "20 6 9 17 4 12" })
|
|
1368
1368
|
]),
|
|
1369
|
-
|
|
1369
|
+
ie(" Envoyé ")
|
|
1370
1370
|
], -1))
|
|
1371
1371
|
]),
|
|
1372
1372
|
i("div", sn, [
|
|
@@ -1519,7 +1519,7 @@ function Ln(t, e, n, a, r, s) {
|
|
|
1519
1519
|
class: "wm-tk__dot",
|
|
1520
1520
|
"aria-hidden": "true"
|
|
1521
1521
|
}, null, -1)),
|
|
1522
|
-
|
|
1522
|
+
ie(" " + b(n.data.status.label), 1)
|
|
1523
1523
|
], 2)
|
|
1524
1524
|
]),
|
|
1525
1525
|
n.data.body ? (l(), d("div", Tn, b(n.data.body), 1)) : w("", !0)
|
|
@@ -1747,7 +1747,7 @@ function Qn(t) {
|
|
|
1747
1747
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
|
|
1748
1748
|
}
|
|
1749
1749
|
const _e = "";
|
|
1750
|
-
function
|
|
1750
|
+
function te(t) {
|
|
1751
1751
|
let e = t;
|
|
1752
1752
|
const n = [];
|
|
1753
1753
|
return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
|
|
@@ -1764,49 +1764,49 @@ function Zn(t) {
|
|
|
1764
1764
|
const s = e[a];
|
|
1765
1765
|
if (/^\s*```([\w-]*)\s*$/.exec(s)) {
|
|
1766
1766
|
a++;
|
|
1767
|
-
const
|
|
1767
|
+
const k = [];
|
|
1768
1768
|
for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
|
|
1769
|
-
|
|
1769
|
+
k.push(e[a]), a++;
|
|
1770
1770
|
a < e.length && a++, n.push({
|
|
1771
1771
|
type: "block",
|
|
1772
|
-
html: `<pre class="wm-md-pre"><code>${
|
|
1772
|
+
html: `<pre class="wm-md-pre"><code>${k.join(`
|
|
1773
1773
|
`)}</code></pre>`
|
|
1774
1774
|
});
|
|
1775
1775
|
continue;
|
|
1776
1776
|
}
|
|
1777
1777
|
if (/^\s*[-*]\s+/.test(s)) {
|
|
1778
|
-
const
|
|
1778
|
+
const k = [];
|
|
1779
1779
|
for (; a < e.length; ) {
|
|
1780
1780
|
const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
|
|
1781
1781
|
if (!S) break;
|
|
1782
|
-
|
|
1782
|
+
k.push(S[1]), a++;
|
|
1783
1783
|
}
|
|
1784
|
-
const y =
|
|
1784
|
+
const y = k.map((S) => `<li>${te(S)}</li>`).join("");
|
|
1785
1785
|
n.push({ type: "block", html: `<ul class="wm-md-ul">${y}</ul>` });
|
|
1786
1786
|
continue;
|
|
1787
1787
|
}
|
|
1788
1788
|
const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
1789
1789
|
if (c) {
|
|
1790
|
-
const
|
|
1790
|
+
const k = parseInt(c[1], 10), y = [c[2]];
|
|
1791
1791
|
for (a++; a < e.length; ) {
|
|
1792
1792
|
const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
|
|
1793
1793
|
if (!A) break;
|
|
1794
1794
|
y.push(A[1]), a++;
|
|
1795
1795
|
}
|
|
1796
|
-
const S = y.map((A) => `<li>${
|
|
1796
|
+
const S = y.map((A) => `<li>${te(A)}</li>`).join(""), $ = k !== 1 ? ` start="${k}"` : "";
|
|
1797
1797
|
n.push({ type: "block", html: `<ol class="wm-md-ol"${$}>${S}</ol>` });
|
|
1798
1798
|
continue;
|
|
1799
1799
|
}
|
|
1800
1800
|
const v = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
1801
1801
|
if (v) {
|
|
1802
|
-
const
|
|
1802
|
+
const k = v[1].length;
|
|
1803
1803
|
n.push({
|
|
1804
1804
|
type: "block",
|
|
1805
|
-
html: `<h${
|
|
1805
|
+
html: `<h${k} class="wm-md-h wm-md-h${k}">${te(v[2])}</h${k}>`
|
|
1806
1806
|
}), a++;
|
|
1807
1807
|
continue;
|
|
1808
1808
|
}
|
|
1809
|
-
n.push({ type: "text", html:
|
|
1809
|
+
n.push({ type: "text", html: te(s) }), a++;
|
|
1810
1810
|
}
|
|
1811
1811
|
let r = "";
|
|
1812
1812
|
for (let s = 0; s < n.length; s++) {
|
|
@@ -1849,7 +1849,7 @@ function as(t, e, n, a, r, s) {
|
|
|
1849
1849
|
])]);
|
|
1850
1850
|
}
|
|
1851
1851
|
const os = /* @__PURE__ */ B(rs, [["render", as], ["__scopeId", "data-v-df2447fd"]]);
|
|
1852
|
-
function
|
|
1852
|
+
function ne(t) {
|
|
1853
1853
|
return t ? t.client_msg_id || t.id : "";
|
|
1854
1854
|
}
|
|
1855
1855
|
const ls = {
|
|
@@ -1861,7 +1861,7 @@ const ls = {
|
|
|
1861
1861
|
idle: "Conversation en pause"
|
|
1862
1862
|
}, cs = 80, ds = 200, us = {
|
|
1863
1863
|
name: "WmMessageList",
|
|
1864
|
-
components: { AIAvatar:
|
|
1864
|
+
components: { AIAvatar: Q, HumanAvatar: ke, Bubble: ss, Typing: os, ActionResult: Qt, AttachmentPreview: Jn, ArtifactRenderer: Un },
|
|
1865
1865
|
props: {
|
|
1866
1866
|
messages: { type: Array, default: () => [] },
|
|
1867
1867
|
streamingActive: { type: Boolean, default: !1 },
|
|
@@ -1900,9 +1900,9 @@ const ls = {
|
|
|
1900
1900
|
const o = this.roleOf(s);
|
|
1901
1901
|
if (o === "system") {
|
|
1902
1902
|
if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1905
|
-
key: `g-${
|
|
1903
|
+
const k = t[t.length - 1];
|
|
1904
|
+
k && k.role === "ai" ? k.messages.push(s) : t.push({
|
|
1905
|
+
key: `g-${ne(s)}`,
|
|
1906
1906
|
role: "ai",
|
|
1907
1907
|
agentName: "",
|
|
1908
1908
|
agentAvatarUrl: null,
|
|
@@ -1912,7 +1912,7 @@ const ls = {
|
|
|
1912
1912
|
continue;
|
|
1913
1913
|
}
|
|
1914
1914
|
t.push({
|
|
1915
|
-
key: `sys-${
|
|
1915
|
+
key: `sys-${ne(s)}`,
|
|
1916
1916
|
role: o,
|
|
1917
1917
|
messages: [s],
|
|
1918
1918
|
items: [],
|
|
@@ -1922,7 +1922,7 @@ const ls = {
|
|
|
1922
1922
|
}
|
|
1923
1923
|
const c = t[t.length - 1];
|
|
1924
1924
|
c && c.role === o && (o === "ai" || c.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? c.messages.push(s) : t.push({
|
|
1925
|
-
key: `g-${
|
|
1925
|
+
key: `g-${ne(s)}`,
|
|
1926
1926
|
role: o,
|
|
1927
1927
|
agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
|
|
1928
1928
|
agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
|
|
@@ -1966,7 +1966,7 @@ const ls = {
|
|
|
1966
1966
|
this._lastSeenConvId = this.conversationId, this.scrollToBottom();
|
|
1967
1967
|
},
|
|
1968
1968
|
methods: {
|
|
1969
|
-
messageKey:
|
|
1969
|
+
messageKey: ne,
|
|
1970
1970
|
isAtBottom(t) {
|
|
1971
1971
|
return t.scrollHeight - t.scrollTop - t.clientHeight <= cs;
|
|
1972
1972
|
},
|
|
@@ -2020,9 +2020,9 @@ const ls = {
|
|
|
2020
2020
|
}
|
|
2021
2021
|
if (!r.anchor) return;
|
|
2022
2022
|
const s = () => {
|
|
2023
|
-
var
|
|
2023
|
+
var k;
|
|
2024
2024
|
const o = r.anchor;
|
|
2025
|
-
if (!((
|
|
2025
|
+
if (!((k = o.el) != null && k.isConnected)) return;
|
|
2026
2026
|
const v = o.el.getBoundingClientRect().top - t.getBoundingClientRect().top - o.relY;
|
|
2027
2027
|
Math.abs(v) > 0.5 && (t.scrollTop += v);
|
|
2028
2028
|
};
|
|
@@ -2118,25 +2118,38 @@ const ls = {
|
|
|
2118
2118
|
}] : [];
|
|
2119
2119
|
},
|
|
2120
2120
|
// Per-corner border radius for an item inside a multi-item
|
|
2121
|
-
// cluster.
|
|
2122
|
-
//
|
|
2123
|
-
//
|
|
2124
|
-
//
|
|
2125
|
-
//
|
|
2126
|
-
//
|
|
2127
|
-
//
|
|
2128
|
-
//
|
|
2129
|
-
//
|
|
2130
|
-
//
|
|
2131
|
-
//
|
|
2132
|
-
//
|
|
2133
|
-
//
|
|
2134
|
-
//
|
|
2121
|
+
// cluster. Chaque coin est calculé indépendamment selon deux
|
|
2122
|
+
// familles de règles :
|
|
2123
|
+
//
|
|
2124
|
+
// Côté EXTÉRIEUR (côté avatar : left pour ai/human, right pour
|
|
2125
|
+
// user) — existence-based, kind-agnostic :
|
|
2126
|
+
// · coin haut SM s'il y a un voisin au-dessus ;
|
|
2127
|
+
// · coin bas SM s'il y a un voisin en-dessous OU si l'item
|
|
2128
|
+
// est le dernier du cluster (tail Messenger : la pointe
|
|
2129
|
+
// avatar-side du dernier item est toujours rétractée).
|
|
2130
|
+
// En pratique dans un cluster ≥ 2, le coin bas extérieur est
|
|
2131
|
+
// toujours SM ; seul le coin haut extérieur du premier item
|
|
2132
|
+
// reste LG.
|
|
2133
|
+
//
|
|
2134
|
+
// Côté INTÉRIEUR (opposé avatar) — width-based, asymétrique :
|
|
2135
|
+
// · coin haut SM si `prev.bottom` est strictement plus large
|
|
2136
|
+
// que `me.top` ;
|
|
2137
|
+
// · coin bas SM si `next.top` est strictement plus large
|
|
2138
|
+
// que `me.bottom`.
|
|
2139
|
+
// On compare *moitiés* : ma moitié haute (`me.top`) vs ce que
|
|
2140
|
+
// le voisin du dessus me présente (`prev.bottom`), et
|
|
2141
|
+
// symétriquement en bas. La comparaison de largeur est
|
|
2142
|
+
// `card > bubble`, asymétrique : à un joint `card↔bubble`,
|
|
2143
|
+
// seule la bubble voit son coin intérieur rétracté (un coin
|
|
2144
|
+
// rond rentré sous un voisin plus large semblerait flotter).
|
|
2145
|
+
// Aux joints même-kind (bubble↔bubble, card↔card), aucun coin
|
|
2146
|
+
// intérieur n'est rétracté : on n'extrapole pas la largeur
|
|
2147
|
+
// réelle, qui est content-driven.
|
|
2135
2148
|
cornersFor(t, e) {
|
|
2136
|
-
var F, P
|
|
2137
|
-
const n = t.items, a = (
|
|
2138
|
-
let
|
|
2139
|
-
return o ? (
|
|
2149
|
+
var N, F, P;
|
|
2150
|
+
const n = t.items, a = (N = n[e]) == null ? void 0 : N.kind, r = (F = n[e - 1]) == null ? void 0 : F.kind, s = (P = n[e + 1]) == null ? void 0 : P.kind, o = t.role === "user", c = 14, v = 4, k = r == null ? void 0 : r.bottom, y = s == null ? void 0 : s.top, S = (q, Y) => q === "card" && Y === "bubble";
|
|
2151
|
+
let $ = c, A = c, D = c, x = c;
|
|
2152
|
+
return o ? (k && (A = v), (y || !s) && (D = v), k && S(k, a == null ? void 0 : a.top) && ($ = v), y && S(y, a == null ? void 0 : a.bottom) && (x = v)) : (k && ($ = v), (y || !s) && (x = v), k && S(k, a == null ? void 0 : a.top) && (A = v), y && S(y, a == null ? void 0 : a.bottom) && (D = v)), { tl: $, tr: A, br: D, bl: x };
|
|
2140
2153
|
},
|
|
2141
2154
|
// Inline style emitting the four corner CSS variables. Set on
|
|
2142
2155
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -2230,7 +2243,7 @@ const ls = {
|
|
|
2230
2243
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
2231
2244
|
}, Ss = { class: "wm-list__avatarSlot" };
|
|
2232
2245
|
function xs(t, e, n, a, r, s) {
|
|
2233
|
-
const o = O("AIAvatar"), c = O("HumanAvatar"), v = O("ActionResult"),
|
|
2246
|
+
const o = O("AIAvatar"), c = O("HumanAvatar"), v = O("ActionResult"), k = O("ArtifactRenderer"), y = O("Bubble"), S = O("AttachmentPreview"), $ = O("Typing");
|
|
2234
2247
|
return l(), d("div", {
|
|
2235
2248
|
ref: "scrollEl",
|
|
2236
2249
|
class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
@@ -2248,7 +2261,7 @@ function xs(t, e, n, a, r, s) {
|
|
|
2248
2261
|
i("span", ps, b(n.dateLabel), 1),
|
|
2249
2262
|
e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
|
|
2250
2263
|
])) : w("", !0),
|
|
2251
|
-
(l(!0), d(M, null, j(s.groups, (A,
|
|
2264
|
+
(l(!0), d(M, null, j(s.groups, (A, D) => (l(), d(M, {
|
|
2252
2265
|
key: A.key
|
|
2253
2266
|
}, [
|
|
2254
2267
|
A.key === s.unreadGroupKey ? (l(), d("div", _s, [...e[4] || (e[4] = [
|
|
@@ -2264,13 +2277,13 @@ function xs(t, e, n, a, r, s) {
|
|
|
2264
2277
|
i("span", gs, b(A.systemLabel), 1),
|
|
2265
2278
|
e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
2266
2279
|
])) : (l(), d(M, { key: 1 }, [
|
|
2267
|
-
(l(!0), d(M, null, j(A.items, (x,
|
|
2280
|
+
(l(!0), d(M, null, j(A.items, (x, N) => (l(), d("div", {
|
|
2268
2281
|
key: `${s.messageKey(x.message)}-${x.partKey}`,
|
|
2269
2282
|
class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
|
|
2270
|
-
style: V(s.cornersStyle(A,
|
|
2283
|
+
style: V(s.cornersStyle(A, N))
|
|
2271
2284
|
}, [
|
|
2272
2285
|
A.role !== "user" ? (l(), d("div", ys, [
|
|
2273
|
-
|
|
2286
|
+
N === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
|
|
2274
2287
|
A.role === "ai" ? (l(), R(o, {
|
|
2275
2288
|
key: 0,
|
|
2276
2289
|
size: 26,
|
|
@@ -2293,10 +2306,10 @@ function xs(t, e, n, a, r, s) {
|
|
|
2293
2306
|
state: "awaiting",
|
|
2294
2307
|
label: "Demande d'approbation envoyée",
|
|
2295
2308
|
detail: x.message.text_md || ""
|
|
2296
|
-
}, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), R(
|
|
2309
|
+
}, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), R(k, {
|
|
2297
2310
|
key: 3,
|
|
2298
2311
|
artifact: s.actionArtifact(x.message)
|
|
2299
|
-
}, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), R(
|
|
2312
|
+
}, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), R(k, {
|
|
2300
2313
|
key: 4,
|
|
2301
2314
|
artifact: s.artifactOf(x.message)
|
|
2302
2315
|
}, null, 8, ["artifact"])) : (l(), d("div", ws, [
|
|
@@ -2338,7 +2351,7 @@ function xs(t, e, n, a, r, s) {
|
|
|
2338
2351
|
])) : w("", !0)
|
|
2339
2352
|
], 34);
|
|
2340
2353
|
}
|
|
2341
|
-
const Ms = /* @__PURE__ */ B(us, [["render", xs], ["__scopeId", "data-v-
|
|
2354
|
+
const Ms = /* @__PURE__ */ B(us, [["render", xs], ["__scopeId", "data-v-0e60114e"]]), se = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
2342
2355
|
function Ts() {
|
|
2343
2356
|
return he && [
|
|
2344
2357
|
"video/webm;codecs=vp9,opus",
|
|
@@ -2363,7 +2376,7 @@ function Ni(t) {
|
|
|
2363
2376
|
return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
|
|
2364
2377
|
}
|
|
2365
2378
|
async function Is() {
|
|
2366
|
-
if (!
|
|
2379
|
+
if (!se) return null;
|
|
2367
2380
|
let t;
|
|
2368
2381
|
try {
|
|
2369
2382
|
t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
|
|
@@ -2386,13 +2399,13 @@ async function Os(t) {
|
|
|
2386
2399
|
const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
|
|
2387
2400
|
r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
|
|
2388
2401
|
const s = await new Promise((c, v) => {
|
|
2389
|
-
r.toBlob((
|
|
2402
|
+
r.toBlob((k) => k ? c(k) : v(new Error("toBlob failed")), "image/png");
|
|
2390
2403
|
}), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
2391
2404
|
return new File([s], `capture-${o}.png`, { type: "image/png" });
|
|
2392
2405
|
}
|
|
2393
2406
|
async function Es(t = {}) {
|
|
2394
|
-
var
|
|
2395
|
-
if (!
|
|
2407
|
+
var k;
|
|
2408
|
+
if (!se || !he) return null;
|
|
2396
2409
|
let e;
|
|
2397
2410
|
try {
|
|
2398
2411
|
e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
|
|
@@ -2417,8 +2430,8 @@ async function Es(t = {}) {
|
|
|
2417
2430
|
if (s && clearInterval(s), e.getTracks().forEach(($) => {
|
|
2418
2431
|
$.stop();
|
|
2419
2432
|
}), r.length) {
|
|
2420
|
-
const $ = a.mimeType || n || "video/webm", A = new Blob(r, { type: $ }),
|
|
2421
|
-
(y = t.onfinalize) == null || y.call(t,
|
|
2433
|
+
const $ = a.mimeType || n || "video/webm", A = new Blob(r, { type: $ }), D = /mp4/.test($) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${x}.${D}`, { type: $ });
|
|
2434
|
+
(y = t.onfinalize) == null || y.call(t, N);
|
|
2422
2435
|
} else
|
|
2423
2436
|
(S = t.oncancel) == null || S.call(t);
|
|
2424
2437
|
}), e.getVideoTracks().forEach((y) => {
|
|
@@ -2439,7 +2452,7 @@ async function Es(t = {}) {
|
|
|
2439
2452
|
S.stop();
|
|
2440
2453
|
}), null;
|
|
2441
2454
|
}
|
|
2442
|
-
(
|
|
2455
|
+
(k = t.onstart) == null || k.call(t);
|
|
2443
2456
|
const v = Date.now();
|
|
2444
2457
|
return s = setInterval(() => {
|
|
2445
2458
|
var y;
|
|
@@ -2492,7 +2505,7 @@ const Bs = [
|
|
|
2492
2505
|
attachItems() {
|
|
2493
2506
|
return Bs.map((t) => ({
|
|
2494
2507
|
...t,
|
|
2495
|
-
disabled: t.action === "screenshot" && !
|
|
2508
|
+
disabled: t.action === "screenshot" && !se || t.action === "record" && (!se || !he)
|
|
2496
2509
|
}));
|
|
2497
2510
|
},
|
|
2498
2511
|
recordingElapsedLabel() {
|
|
@@ -2622,7 +2635,7 @@ function Ws(t, e, n, a, r, s) {
|
|
|
2622
2635
|
])) : w("", !0),
|
|
2623
2636
|
i("form", {
|
|
2624
2637
|
class: E(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
2625
|
-
onSubmit: e[7] || (e[7] =
|
|
2638
|
+
onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
|
|
2626
2639
|
}, [
|
|
2627
2640
|
i("input", {
|
|
2628
2641
|
ref: "fileEl",
|
|
@@ -2752,7 +2765,7 @@ function Js(t, e, n, a, r, s) {
|
|
|
2752
2765
|
}
|
|
2753
2766
|
const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d"]]), Qs = {
|
|
2754
2767
|
name: "WmApprovalCard",
|
|
2755
|
-
components: { AIAvatar:
|
|
2768
|
+
components: { AIAvatar: Q },
|
|
2756
2769
|
props: {
|
|
2757
2770
|
action: { type: String, required: !0 },
|
|
2758
2771
|
detail: { type: String, default: "" },
|
|
@@ -2827,7 +2840,7 @@ const lr = /* @__PURE__ */ new Set([
|
|
|
2827
2840
|
"date"
|
|
2828
2841
|
]), cr = {
|
|
2829
2842
|
name: "WmFormCard",
|
|
2830
|
-
components: { AIAvatar:
|
|
2843
|
+
components: { AIAvatar: Q },
|
|
2831
2844
|
props: {
|
|
2832
2845
|
form: { type: Object, required: !0 },
|
|
2833
2846
|
readOnly: { type: Boolean, default: !1 },
|
|
@@ -2940,7 +2953,7 @@ function Lr(t, e, n, a, r, s) {
|
|
|
2940
2953
|
]),
|
|
2941
2954
|
i("form", {
|
|
2942
2955
|
class: "wm-form__body",
|
|
2943
|
-
onSubmit: e[0] || (e[0] =
|
|
2956
|
+
onSubmit: e[0] || (e[0] = X((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
|
|
2944
2957
|
}, [
|
|
2945
2958
|
(l(!0), d(M, null, j(s.normalizedFields, (c) => (l(), d("div", {
|
|
2946
2959
|
key: c.key,
|
|
@@ -2950,7 +2963,7 @@ function Lr(t, e, n, a, r, s) {
|
|
|
2950
2963
|
for: `wm-f-${r._uid}-${c.key}`,
|
|
2951
2964
|
class: "wm-form__label"
|
|
2952
2965
|
}, [
|
|
2953
|
-
|
|
2966
|
+
ie(b(c.label), 1),
|
|
2954
2967
|
c.required ? (l(), d("span", vr, "*")) : w("", !0)
|
|
2955
2968
|
], 8, _r),
|
|
2956
2969
|
c.type === "text" ? H((l(), d("input", {
|
|
@@ -3036,7 +3049,7 @@ function Lr(t, e, n, a, r, s) {
|
|
|
3036
3049
|
value: v.value,
|
|
3037
3050
|
checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(v.value),
|
|
3038
3051
|
disabled: n.readOnly || r.busy,
|
|
3039
|
-
onChange: (
|
|
3052
|
+
onChange: (k) => s.toggleMulti(c.key, v.value, k.target.checked)
|
|
3040
3053
|
}, null, 40, Tr),
|
|
3041
3054
|
i("span", null, b(v.label), 1)
|
|
3042
3055
|
]))), 128))
|
|
@@ -3509,8 +3522,8 @@ function wi(t, e) {
|
|
|
3509
3522
|
if (s == null || s === "") continue;
|
|
3510
3523
|
let o;
|
|
3511
3524
|
if (Array.isArray(s)) {
|
|
3512
|
-
if (o = s.map((c) =>
|
|
3513
|
-
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o =
|
|
3525
|
+
if (o = s.map((c) => re(r, String(c))).join(", "), !o) continue;
|
|
3526
|
+
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
|
|
3514
3527
|
a.push(`${r.label} :
|
|
3515
3528
|
${o}`);
|
|
3516
3529
|
}
|
|
@@ -3518,7 +3531,7 @@ ${o}`);
|
|
|
3518
3531
|
|
|
3519
3532
|
`);
|
|
3520
3533
|
}
|
|
3521
|
-
function
|
|
3534
|
+
function re(t, e) {
|
|
3522
3535
|
if (!Array.isArray(t == null ? void 0 : t.options)) return e;
|
|
3523
3536
|
const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
|
|
3524
3537
|
return (n == null ? void 0 : n.label) || e;
|
|
@@ -3531,8 +3544,8 @@ function bi(t, e) {
|
|
|
3531
3544
|
if (s == null || s === "") continue;
|
|
3532
3545
|
let o;
|
|
3533
3546
|
if (Array.isArray(s)) {
|
|
3534
|
-
if (o = s.map((v) =>
|
|
3535
|
-
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o =
|
|
3547
|
+
if (o = s.map((v) => re(r, String(v))).join(", "), !o) continue;
|
|
3548
|
+
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
|
|
3536
3549
|
const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
|
|
3537
3550
|
`));
|
|
3538
3551
|
n.push({ label: r.label, value: o, multiline: c });
|
|
@@ -3911,7 +3924,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
|
|
|
3911
3924
|
const e = (v = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : v.prepared_params;
|
|
3912
3925
|
if (!e || typeof e != "object") return "";
|
|
3913
3926
|
const n = Object.entries(e);
|
|
3914
|
-
return n.length ? n.slice(0, 2).map(([
|
|
3927
|
+
return n.length ? n.slice(0, 2).map(([k, y]) => `${k}: ${y}`).join(" · ") : "";
|
|
3915
3928
|
},
|
|
3916
3929
|
actionInFlight() {
|
|
3917
3930
|
var t, e;
|
|
@@ -4245,10 +4258,10 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
|
|
|
4245
4258
|
this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((y) => y !== v);
|
|
4246
4259
|
}, o);
|
|
4247
4260
|
this.revealTimers.push(v);
|
|
4248
|
-
const
|
|
4249
|
-
this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((y) => y !==
|
|
4261
|
+
const k = setTimeout(() => {
|
|
4262
|
+
this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((y) => y !== k);
|
|
4250
4263
|
}, o + 4e3);
|
|
4251
|
-
this.revealTimers.push(
|
|
4264
|
+
this.revealTimers.push(k);
|
|
4252
4265
|
},
|
|
4253
4266
|
async boot() {
|
|
4254
4267
|
if (!this.canBoot) {
|
|
@@ -4401,7 +4414,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
|
|
|
4401
4414
|
!t || !this.store || !(!(typeof window < "u" && typeof window.confirm == "function") || window.confirm("Effacer ce fil de votre côté ? Cette action ne supprime pas les messages côté agent.")) || ((n = this.s) != null && n.messagesByConv && (this.s.messagesByConv[t.id] = []), this.activeConvId = null, this.showOnboarding = !0);
|
|
4402
4415
|
},
|
|
4403
4416
|
exportCurrentConv() {
|
|
4404
|
-
var r, s, o, c, v,
|
|
4417
|
+
var r, s, o, c, v, k;
|
|
4405
4418
|
const t = this.currentConv;
|
|
4406
4419
|
if (!t) return;
|
|
4407
4420
|
const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
|
|
@@ -4411,7 +4424,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
|
|
|
4411
4424
|
];
|
|
4412
4425
|
for (const y of e) {
|
|
4413
4426
|
if (!y) continue;
|
|
4414
|
-
const S = ((o = y.author) == null ? void 0 : o.name) || (((c = y.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((v = y.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((
|
|
4427
|
+
const S = ((o = y.author) == null ? void 0 : o.name) || (((c = y.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((v = y.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = y.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), $ = y.created_at ? new Date(y.created_at).toLocaleString("fr-FR") : "", A = (y.text_md || "").trim();
|
|
4415
4428
|
A && (n.push(`[${$}] ${S} :`), n.push(A), n.push(""));
|
|
4416
4429
|
}
|
|
4417
4430
|
const a = new Blob([n.join(`
|
|
@@ -4517,7 +4530,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
|
|
|
4517
4530
|
class: "wm-attached"
|
|
4518
4531
|
}, ji = ["onClick"];
|
|
4519
4532
|
function Ui(t, e, n, a, r, s) {
|
|
4520
|
-
const o = O("Launcher"), c = O("Header"), v = O("Onboarding"),
|
|
4533
|
+
const o = O("Launcher"), c = O("Header"), v = O("Onboarding"), k = O("MessageList"), y = O("ApprovalCard"), S = O("FormCard"), $ = O("Feedback"), A = O("SuggestionChips"), D = O("Composer"), x = O("MoreMenu"), N = O("HistoryDrawer");
|
|
4521
4534
|
return l(), d("div", {
|
|
4522
4535
|
class: E(["wm-root", `wm-root--${n.displayMode}`])
|
|
4523
4536
|
}, [
|
|
@@ -4600,7 +4613,7 @@ function Ui(t, e, n, a, r, s) {
|
|
|
4600
4613
|
])
|
|
4601
4614
|
])
|
|
4602
4615
|
])) : s.currentConv ? (l(), d(M, { key: 2 }, [
|
|
4603
|
-
z(
|
|
4616
|
+
z(k, {
|
|
4604
4617
|
ref: "messageList",
|
|
4605
4618
|
messages: s.displayedMessages,
|
|
4606
4619
|
"streaming-active": s.streamingActive,
|
|
@@ -4640,7 +4653,7 @@ function Ui(t, e, n, a, r, s) {
|
|
|
4640
4653
|
"aria-hidden": "true"
|
|
4641
4654
|
}, null, -1)),
|
|
4642
4655
|
i("span", $i, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
|
|
4643
|
-
])) : (l(), R(
|
|
4656
|
+
])) : (l(), R(D, {
|
|
4644
4657
|
key: 2,
|
|
4645
4658
|
ref: "composer",
|
|
4646
4659
|
modelValue: r.draft,
|
|
@@ -4715,7 +4728,7 @@ function Ui(t, e, n, a, r, s) {
|
|
|
4715
4728
|
onSelect: s.onQuickLink,
|
|
4716
4729
|
onResume: s.onDrawerPick
|
|
4717
4730
|
}, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
4718
|
-
r.historyOpen ? (l(), R(
|
|
4731
|
+
r.historyOpen ? (l(), R(N, {
|
|
4719
4732
|
key: 3,
|
|
4720
4733
|
conversations: s.drawerConversations,
|
|
4721
4734
|
"active-id": s.currentConv ? s.currentConv.id : null,
|
|
@@ -4739,9 +4752,9 @@ function Ui(t, e, n, a, r, s) {
|
|
|
4739
4752
|
], 6)) : w("", !0)
|
|
4740
4753
|
], 2);
|
|
4741
4754
|
}
|
|
4742
|
-
const Pi = /* @__PURE__ */ B(Mi, [["render", Ui], ["__scopeId", "data-v-8264e504"]]), Hi = "0.2.
|
|
4755
|
+
const Pi = /* @__PURE__ */ B(Mi, [["render", Ui], ["__scopeId", "data-v-8264e504"]]), Hi = "0.2.20";
|
|
4743
4756
|
export {
|
|
4744
|
-
|
|
4757
|
+
Q as AIAvatar,
|
|
4745
4758
|
ce as AVATAR_COLORS,
|
|
4746
4759
|
Qt as ActionResult,
|
|
4747
4760
|
or as ApprovalCard,
|
|
@@ -4764,7 +4777,7 @@ export {
|
|
|
4764
4777
|
Pi as Messenger,
|
|
4765
4778
|
yi as MoreMenu,
|
|
4766
4779
|
Pt as Onboarding,
|
|
4767
|
-
|
|
4780
|
+
se as SCREEN_CAPTURE_SUPPORTED,
|
|
4768
4781
|
Xs as SuggestionChips,
|
|
4769
4782
|
ot as TeamAvatars,
|
|
4770
4783
|
os as Typing,
|
|
@@ -4772,7 +4785,7 @@ export {
|
|
|
4772
4785
|
ye as avatarColor,
|
|
4773
4786
|
we as avatarInitials,
|
|
4774
4787
|
Is as captureScreenshotFile,
|
|
4775
|
-
|
|
4788
|
+
U as colors,
|
|
4776
4789
|
De as createStore,
|
|
4777
4790
|
$e as createTransport,
|
|
4778
4791
|
Pi as default,
|