@_solaris/messenger-widget 0.2.32 → 0.3.1
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 +30 -30
- package/dist/messenger.js +1077 -860
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
const
|
|
1
|
+
import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as g, normalizeStyle as G, normalizeClass as B, Fragment as T, renderList as D, resolveComponent as I, createBlock as $, createTextVNode as de, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as J, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as he, markRaw as fe } from "vue";
|
|
2
|
+
const Ee = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
5
5
|
"message_stream",
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
],
|
|
10
|
-
function
|
|
9
|
+
], _e = "/client", $e = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
|
|
10
|
+
function Fe(t) {
|
|
11
11
|
const e = {
|
|
12
|
-
baseUrl:
|
|
12
|
+
baseUrl: De(t.baseUrl || ""),
|
|
13
13
|
widgetId: t.widgetId || "",
|
|
14
14
|
userId: t.userId || "",
|
|
15
15
|
userHash: t.userHash || "",
|
|
@@ -55,20 +55,20 @@ function Re(t) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
async function o(h, f, p) {
|
|
58
|
-
const C = await fetch(`${e.baseUrl}${f}`, {
|
|
58
|
+
const C = await fetch(`${e.baseUrl}${_e}${f}`, {
|
|
59
59
|
method: h,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
61
61
|
body: p !== void 0 ? JSON.stringify(p) : void 0
|
|
62
62
|
});
|
|
63
63
|
if (!C.ok) {
|
|
64
|
-
const O = await
|
|
64
|
+
const O = await d(C), M = new Error(
|
|
65
65
|
`HTTP ${C.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || C.statusText}`
|
|
66
66
|
);
|
|
67
|
-
throw
|
|
67
|
+
throw M.status = C.status, M.body = O, M;
|
|
68
68
|
}
|
|
69
69
|
return C.status === 204 ? null : C.json();
|
|
70
70
|
}
|
|
71
|
-
async function
|
|
71
|
+
async function d(h) {
|
|
72
72
|
try {
|
|
73
73
|
return await h.json();
|
|
74
74
|
} catch {
|
|
@@ -80,7 +80,7 @@ function Re(t) {
|
|
|
80
80
|
// Public — no HMAC required.
|
|
81
81
|
fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
|
|
82
82
|
if (!p.ok) {
|
|
83
|
-
const C = await
|
|
83
|
+
const C = await d(p);
|
|
84
84
|
throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
|
|
85
85
|
}
|
|
86
86
|
return p.json();
|
|
@@ -114,7 +114,7 @@ function Re(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 U(h, f) {
|
|
118
118
|
return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
|
|
119
119
|
}
|
|
120
120
|
async function x(h, f = {}) {
|
|
@@ -126,8 +126,8 @@ function Re(t) {
|
|
|
126
126
|
`/conversations/${encodeURIComponent(h)}/messages${C}`
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
async function
|
|
130
|
-
|
|
129
|
+
async function j(h, f) {
|
|
130
|
+
V();
|
|
131
131
|
const p = {
|
|
132
132
|
client_msg_id: f.client_msg_id,
|
|
133
133
|
type: "content",
|
|
@@ -141,14 +141,14 @@ function Re(t) {
|
|
|
141
141
|
p
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
|
-
async function
|
|
145
|
-
return
|
|
144
|
+
async function P(h, f, p) {
|
|
145
|
+
return V(), o(
|
|
146
146
|
"POST",
|
|
147
147
|
`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
|
|
148
148
|
p ? { inputs: p } : {}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
async function
|
|
151
|
+
async function F(h) {
|
|
152
152
|
const f = (
|
|
153
153
|
/** @type {File} */
|
|
154
154
|
h.name || "attachment"
|
|
@@ -159,21 +159,21 @@ function Re(t) {
|
|
|
159
159
|
size_bytes: C,
|
|
160
160
|
name: f
|
|
161
161
|
})
|
|
162
|
-
),
|
|
162
|
+
), M = await fetch(O.upload_url, {
|
|
163
163
|
method: "PUT",
|
|
164
164
|
headers: { "Content-Type": p },
|
|
165
165
|
body: h
|
|
166
166
|
});
|
|
167
|
-
if (!
|
|
168
|
-
throw new Error(`HTTP ${
|
|
167
|
+
if (!M.ok)
|
|
168
|
+
throw new Error(`HTTP ${M.status} PUT signed upload`);
|
|
169
169
|
return {
|
|
170
|
-
type:
|
|
170
|
+
type: Ne(p),
|
|
171
171
|
path: O.path,
|
|
172
172
|
mime_type: p,
|
|
173
173
|
size_bytes: C
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
async function
|
|
176
|
+
async function H(h) {
|
|
177
177
|
return o(
|
|
178
178
|
"GET",
|
|
179
179
|
`/attachments/sign?path=${encodeURIComponent(h)}`
|
|
@@ -185,20 +185,20 @@ function Re(t) {
|
|
|
185
185
|
userHash: e.userHash,
|
|
186
186
|
widgetId: e.widgetId
|
|
187
187
|
}).toString();
|
|
188
|
-
return `${e.baseUrl}/stream?${h}`;
|
|
188
|
+
return `${e.baseUrl}${_e}/stream?${h}`;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function z() {
|
|
191
191
|
if (!e.eventSource && !(typeof document < "u" && document.hidden))
|
|
192
192
|
try {
|
|
193
193
|
const h = new EventSource(Y());
|
|
194
|
-
for (const f of
|
|
195
|
-
h.addEventListener(f, (p) =>
|
|
194
|
+
for (const f of Ee)
|
|
195
|
+
h.addEventListener(f, (p) => Q(f, p.data));
|
|
196
196
|
h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
|
|
197
197
|
} catch (h) {
|
|
198
198
|
console.error("[transport] SSE open failed", h), a("error", h);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Q(h, f) {
|
|
202
202
|
try {
|
|
203
203
|
const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
|
|
204
204
|
a(h, C);
|
|
@@ -206,30 +206,30 @@ function Re(t) {
|
|
|
206
206
|
console.error("[transport] bad SSE payload", h, p);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function W() {
|
|
210
210
|
e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
clearTimeout(e.burstTimer),
|
|
214
|
-
e.panelOpen ||
|
|
212
|
+
function V() {
|
|
213
|
+
clearTimeout(e.burstTimer), z(), e.panelOpen || (e.burstTimer = setTimeout(() => {
|
|
214
|
+
e.panelOpen || W();
|
|
215
215
|
}, Le));
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer),
|
|
217
|
+
function Z(h) {
|
|
218
|
+
e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), z()) : V();
|
|
219
219
|
}
|
|
220
|
-
async function
|
|
220
|
+
async function ce() {
|
|
221
221
|
try {
|
|
222
222
|
const h = await S(), f = h.reduce((C, O) => {
|
|
223
|
-
const
|
|
224
|
-
return
|
|
223
|
+
const M = O == null ? void 0 : O.last_message_at;
|
|
224
|
+
return M && (!C || M > C) ? M : C;
|
|
225
225
|
}, null);
|
|
226
|
-
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }),
|
|
226
|
+
f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), V());
|
|
227
227
|
} catch (h) {
|
|
228
228
|
console.error("[transport] poll failed", h);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
function ne() {
|
|
232
|
-
u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(
|
|
232
|
+
u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(ce, $e));
|
|
233
233
|
}
|
|
234
234
|
function u() {
|
|
235
235
|
e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
|
|
@@ -237,14 +237,14 @@ function Re(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(),
|
|
241
|
-
},
|
|
240
|
+
e.hiddenGraceTimer = null, document.hidden && (u(), W(), r("paused"));
|
|
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"), ne(), e.panelOpen &&
|
|
247
|
+
r("idle"), ne(), e.panelOpen && z();
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
async function _() {
|
|
@@ -264,13 +264,13 @@ function Re(t) {
|
|
|
264
264
|
return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
|
|
265
265
|
}
|
|
266
266
|
function y() {
|
|
267
|
-
u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null,
|
|
267
|
+
u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, W(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
|
|
268
268
|
}
|
|
269
269
|
return {
|
|
270
270
|
on: n,
|
|
271
271
|
start: _,
|
|
272
272
|
stop: y,
|
|
273
|
-
setPanelOpen:
|
|
273
|
+
setPanelOpen: Z,
|
|
274
274
|
// REST
|
|
275
275
|
bootstrap: v,
|
|
276
276
|
getCustomer: k,
|
|
@@ -278,25 +278,25 @@ function Re(t) {
|
|
|
278
278
|
listConversations: S,
|
|
279
279
|
createConversation: R,
|
|
280
280
|
getConversation: A,
|
|
281
|
-
patchConversation:
|
|
281
|
+
patchConversation: U,
|
|
282
282
|
listMessages: x,
|
|
283
|
-
postMessage:
|
|
284
|
-
postCallback:
|
|
285
|
-
uploadAttachment:
|
|
286
|
-
signAttachment:
|
|
283
|
+
postMessage: j,
|
|
284
|
+
postCallback: P,
|
|
285
|
+
uploadAttachment: F,
|
|
286
|
+
signAttachment: H,
|
|
287
287
|
// Read-only state
|
|
288
288
|
get connection() {
|
|
289
289
|
return e.connection;
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function De(t) {
|
|
294
294
|
return t.endsWith("/") ? t.slice(0, -1) : t;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Ne(t) {
|
|
297
297
|
return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function je() {
|
|
300
300
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
301
301
|
return crypto.randomUUID();
|
|
302
302
|
const t = new Uint8Array(16);
|
|
@@ -309,7 +309,7 @@ function De() {
|
|
|
309
309
|
return e.slice(0, 4).join("") + "-" + e.slice(4, 6).join("") + "-" + e.slice(6, 8).join("") + "-" + e.slice(8, 10).join("") + "-" + e.slice(10, 16).join("");
|
|
310
310
|
}
|
|
311
311
|
function Ue(t) {
|
|
312
|
-
const e =
|
|
312
|
+
const e = Se({
|
|
313
313
|
ready: !1,
|
|
314
314
|
error: null,
|
|
315
315
|
config: null,
|
|
@@ -344,7 +344,7 @@ function Ue(t) {
|
|
|
344
344
|
e.connection = u;
|
|
345
345
|
})), n.push(t.on("message", (u) => {
|
|
346
346
|
const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
|
|
347
|
-
!m || !(_ != null && _.id) || (
|
|
347
|
+
!m || !(_ != null && _.id) || (z(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], V(m, _.created_at));
|
|
348
348
|
})), n.push(t.on("message_stream", (u) => {
|
|
349
349
|
const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
|
|
350
350
|
!m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
|
|
@@ -382,7 +382,7 @@ function Ue(t) {
|
|
|
382
382
|
t.stop();
|
|
383
383
|
}
|
|
384
384
|
async function s(u) {
|
|
385
|
-
const m =
|
|
385
|
+
const m = ce(u);
|
|
386
386
|
if (!m) return e.customer;
|
|
387
387
|
try {
|
|
388
388
|
const _ = await t.patchCustomer(m);
|
|
@@ -396,10 +396,10 @@ function Ue(t) {
|
|
|
396
396
|
const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
|
|
397
397
|
return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
|
|
398
398
|
}
|
|
399
|
-
const
|
|
399
|
+
const d = 50;
|
|
400
400
|
async function v(u) {
|
|
401
401
|
if (e.messagesByConv[u]) return;
|
|
402
|
-
const m = await t.listMessages(u, { limit:
|
|
402
|
+
const m = await t.listMessages(u, { limit: d });
|
|
403
403
|
e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], w(u, {
|
|
404
404
|
nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
|
|
405
405
|
loading: !1,
|
|
@@ -415,12 +415,12 @@ function Ue(t) {
|
|
|
415
415
|
for (; p < 6 && h; p++) {
|
|
416
416
|
const L = await t.listMessages(u, {
|
|
417
417
|
before: h,
|
|
418
|
-
limit:
|
|
418
|
+
limit: d
|
|
419
419
|
}), se = (L == null ? void 0 : L.messages) ?? [];
|
|
420
420
|
if (f = [...se, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !se.length || f.length >= 60) break;
|
|
421
421
|
}
|
|
422
|
-
const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))),
|
|
423
|
-
e.messagesByConv[u] =
|
|
422
|
+
const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))), M = [...f.filter((L) => !O.has(String(L == null ? void 0 : L.id))), ...C];
|
|
423
|
+
e.messagesByConv[u] = M, w(u, {
|
|
424
424
|
nextCursor: h,
|
|
425
425
|
loading: !1,
|
|
426
426
|
loaded: !0
|
|
@@ -438,10 +438,10 @@ function Ue(t) {
|
|
|
438
438
|
y !== -1 && (e.conversations[y] = _);
|
|
439
439
|
}
|
|
440
440
|
async function R(u, m, { attachments: _, metadata: y } = {}) {
|
|
441
|
-
var
|
|
441
|
+
var M;
|
|
442
442
|
const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
|
|
443
443
|
if (!u || !h && !f) return;
|
|
444
|
-
const p =
|
|
444
|
+
const p = je(), C = ne(u), O = {
|
|
445
445
|
id: p,
|
|
446
446
|
client_msg_id: p,
|
|
447
447
|
conversation_id: u,
|
|
@@ -449,7 +449,7 @@ function Ue(t) {
|
|
|
449
449
|
text_md: h,
|
|
450
450
|
author: {
|
|
451
451
|
type: "user",
|
|
452
|
-
id: ((
|
|
452
|
+
id: ((M = e.customer) == null ? void 0 : M.external_id) || null
|
|
453
453
|
},
|
|
454
454
|
created_at: C,
|
|
455
455
|
// Local-only flag — UI may render dimmed until the SSE echo lands.
|
|
@@ -457,7 +457,7 @@ function Ue(t) {
|
|
|
457
457
|
...f ? { payload: { type: "content", attachments: _ } } : {},
|
|
458
458
|
...y && typeof y == "object" ? { metadata: y } : {}
|
|
459
459
|
};
|
|
460
|
-
|
|
460
|
+
z(u, O);
|
|
461
461
|
try {
|
|
462
462
|
await t.postMessage(u, {
|
|
463
463
|
client_msg_id: p,
|
|
@@ -467,7 +467,7 @@ function Ue(t) {
|
|
|
467
467
|
...y && typeof y == "object" ? { metadata: y } : {}
|
|
468
468
|
});
|
|
469
469
|
} catch (L) {
|
|
470
|
-
console.error("[store] send failed", L),
|
|
470
|
+
console.error("[store] send failed", L), W(u, p, { _failed: !0, _pending: !1 });
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
async function A(u, m, _) {
|
|
@@ -478,10 +478,10 @@ function Ue(t) {
|
|
|
478
478
|
console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
const
|
|
481
|
+
const U = /* @__PURE__ */ new Map();
|
|
482
482
|
async function x(u) {
|
|
483
483
|
if (!u) return null;
|
|
484
|
-
const m =
|
|
484
|
+
const m = U.get(u);
|
|
485
485
|
if (m != null && m.url) {
|
|
486
486
|
const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
487
487
|
if (!_ || _ - Date.now() > 6e4) return m.url;
|
|
@@ -489,13 +489,13 @@ function Ue(t) {
|
|
|
489
489
|
try {
|
|
490
490
|
const _ = await t.signAttachment(u);
|
|
491
491
|
if (_ != null && _.signed_url)
|
|
492
|
-
return
|
|
492
|
+
return U.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
|
|
493
493
|
} catch (_) {
|
|
494
494
|
console.error("[store] sign attachment failed", _);
|
|
495
495
|
}
|
|
496
496
|
return null;
|
|
497
497
|
}
|
|
498
|
-
async function
|
|
498
|
+
async function j(u, { rating: m, comment: _ } = {}) {
|
|
499
499
|
const y = e.conversations.find((p) => p.id === u), f = {
|
|
500
500
|
...(y == null ? void 0 : y.metadata) || {},
|
|
501
501
|
feedback: {
|
|
@@ -506,7 +506,7 @@ function Ue(t) {
|
|
|
506
506
|
};
|
|
507
507
|
await S(u, { metadata: f });
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function P(u) {
|
|
510
510
|
var _, y;
|
|
511
511
|
const m = e.messagesByConv[u] || [];
|
|
512
512
|
for (let h = m.length - 1; h >= 0; h--) {
|
|
@@ -516,7 +516,7 @@ function Ue(t) {
|
|
|
516
516
|
}
|
|
517
517
|
return null;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function F(u) {
|
|
520
520
|
var _, y, h;
|
|
521
521
|
const m = e.messagesByConv[u] || [];
|
|
522
522
|
for (let f = m.length - 1; f >= 0; f--) {
|
|
@@ -528,7 +528,7 @@ function Ue(t) {
|
|
|
528
528
|
}
|
|
529
529
|
return null;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function H(u) {
|
|
532
532
|
const m = e.runningActionsByConv[u];
|
|
533
533
|
if (!m) return null;
|
|
534
534
|
const _ = Object.keys(m);
|
|
@@ -545,15 +545,15 @@ function Ue(t) {
|
|
|
545
545
|
if ((C == null ? void 0 : C.type) === "action" && ((y = C == null ? void 0 : C.payload) == null ? void 0 : y.state) === "pending") return [];
|
|
546
546
|
if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
|
|
547
547
|
const O = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
|
|
548
|
-
return Array.isArray(O) && O.length ? O.map((
|
|
549
|
-
if (typeof
|
|
550
|
-
const L =
|
|
548
|
+
return Array.isArray(O) && O.length ? O.map((M) => {
|
|
549
|
+
if (typeof M == "string") {
|
|
550
|
+
const L = M.trim();
|
|
551
551
|
return L ? { label: L, kind: null } : null;
|
|
552
552
|
}
|
|
553
|
-
if (
|
|
554
|
-
const L =
|
|
553
|
+
if (M && typeof M == "object" && typeof M.label == "string") {
|
|
554
|
+
const L = M.label.trim();
|
|
555
555
|
if (!L) return null;
|
|
556
|
-
const se =
|
|
556
|
+
const se = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
|
|
557
557
|
return { label: L, kind: se };
|
|
558
558
|
}
|
|
559
559
|
return null;
|
|
@@ -561,20 +561,20 @@ function Ue(t) {
|
|
|
561
561
|
}
|
|
562
562
|
return [];
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function z(u, m) {
|
|
565
565
|
var f;
|
|
566
566
|
const _ = e.messagesByConv[u] || [];
|
|
567
567
|
let y = -1;
|
|
568
568
|
m != null && m.client_msg_id && (y = _.findIndex(
|
|
569
569
|
(p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
|
|
570
|
-
)), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) =>
|
|
570
|
+
)), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
|
|
571
571
|
let h;
|
|
572
|
-
y === -1 ? h = [..._, m].sort(
|
|
572
|
+
y === -1 ? h = [..._, m].sort(Z) : (h = _.slice(), h[y] = { ..._[y], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function Q(u, m) {
|
|
575
575
|
return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function W(u, m, _) {
|
|
578
578
|
const y = e.messagesByConv[u];
|
|
579
579
|
if (!y) return;
|
|
580
580
|
const h = y.findIndex((p) => p.id === m);
|
|
@@ -582,7 +582,7 @@ function Ue(t) {
|
|
|
582
582
|
const f = y.slice();
|
|
583
583
|
f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function V(u, m) {
|
|
586
586
|
const _ = e.conversations.findIndex((h) => h.id === u);
|
|
587
587
|
if (_ === -1) return;
|
|
588
588
|
const y = e.conversations[_];
|
|
@@ -593,10 +593,10 @@ function Ue(t) {
|
|
|
593
593
|
), e.conversations = h;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
function
|
|
596
|
+
function Z(u, m) {
|
|
597
597
|
return (u.created_at || "").localeCompare(m.created_at || "");
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function ce(u) {
|
|
600
600
|
if (!u || typeof u != "object") return null;
|
|
601
601
|
const m = {}, _ = {};
|
|
602
602
|
for (const [y, h] of Object.entries(u))
|
|
@@ -623,16 +623,16 @@ function Ue(t) {
|
|
|
623
623
|
send: R,
|
|
624
624
|
clickCallback: A,
|
|
625
625
|
signAttachment: x,
|
|
626
|
-
submitFeedback:
|
|
627
|
-
getPendingApproval:
|
|
628
|
-
getActionInFlight:
|
|
626
|
+
submitFeedback: j,
|
|
627
|
+
getPendingApproval: P,
|
|
628
|
+
getActionInFlight: H,
|
|
629
629
|
getLatestSuggestions: Y,
|
|
630
|
-
getLatestForm:
|
|
630
|
+
getLatestForm: F,
|
|
631
631
|
// Pass-through for panel open/close (controls SSE burst).
|
|
632
632
|
setPanelOpen: t.setPanelOpen
|
|
633
633
|
};
|
|
634
634
|
}
|
|
635
|
-
const
|
|
635
|
+
const N = {
|
|
636
636
|
w: "#ffffff",
|
|
637
637
|
g50: "#F9F9F7",
|
|
638
638
|
g100: "#F2F1EE",
|
|
@@ -648,37 +648,37 @@ const D = {
|
|
|
648
648
|
green: "#22C55E",
|
|
649
649
|
red: "#B91C1C",
|
|
650
650
|
redBg: "#FDECEC"
|
|
651
|
-
},
|
|
652
|
-
function ge(t = "") {
|
|
653
|
-
return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
|
|
654
|
-
}
|
|
651
|
+
}, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
|
|
655
652
|
function we(t = "") {
|
|
653
|
+
return t ? ue[t.charCodeAt(0) % ue.length] : ue[0];
|
|
654
|
+
}
|
|
655
|
+
function be(t = "") {
|
|
656
656
|
return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function ke(t = /* @__PURE__ */ new Date()) {
|
|
659
659
|
return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
660
660
|
}
|
|
661
|
-
const
|
|
661
|
+
const Pe = `
|
|
662
662
|
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
|
663
663
|
|
|
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: ${N.w};
|
|
668
|
+
--wm-g50: ${N.g50};
|
|
669
|
+
--wm-g100: ${N.g100};
|
|
670
|
+
--wm-g150: ${N.g150};
|
|
671
|
+
--wm-g200: ${N.g200};
|
|
672
|
+
--wm-g300: ${N.g300};
|
|
673
|
+
--wm-g400: ${N.g400};
|
|
674
|
+
--wm-g500: ${N.g500};
|
|
675
|
+
--wm-g700: ${N.g700};
|
|
676
|
+
--wm-g900: ${N.g900};
|
|
677
|
+
--wm-a: ${N.accent};
|
|
678
|
+
--wm-al: ${N.accentLight};
|
|
679
|
+
--wm-green: ${N.green};
|
|
680
|
+
--wm-red: ${N.red};
|
|
681
|
+
--wm-redBg: ${N.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);
|
|
@@ -704,12 +704,12 @@ const Ne = `
|
|
|
704
704
|
0% { transform: translateX(110%); opacity: 0; }
|
|
705
705
|
100% { transform: translateX(0); opacity: 1; }
|
|
706
706
|
}
|
|
707
|
-
`,
|
|
707
|
+
`, He = "https://api.messenger.victorc.fr", E = (t, e) => {
|
|
708
708
|
const n = t.__vccOpts || t;
|
|
709
709
|
for (const [a, r] of e)
|
|
710
710
|
n[a] = r;
|
|
711
711
|
return n;
|
|
712
|
-
},
|
|
712
|
+
}, ze = {
|
|
713
713
|
name: "WmLauncher",
|
|
714
714
|
props: {
|
|
715
715
|
// Nombre de conversations non lues — pilote la pastille.
|
|
@@ -719,12 +719,12 @@ const Ne = `
|
|
|
719
719
|
peek: { type: String, default: "" }
|
|
720
720
|
},
|
|
721
721
|
emits: ["open", "dismiss"]
|
|
722
|
-
},
|
|
723
|
-
function
|
|
724
|
-
return l(),
|
|
725
|
-
K(
|
|
726
|
-
default:
|
|
727
|
-
n.peek ? (l(),
|
|
722
|
+
}, Ve = { class: "wm-launcherWrap" }, qe = { class: "wm-peek__text" }, We = ["aria-label"];
|
|
723
|
+
function Ke(t, e, n, a, r, s) {
|
|
724
|
+
return l(), c("div", Ve, [
|
|
725
|
+
K(xe, { name: "wm-peek" }, {
|
|
726
|
+
default: Te(() => [
|
|
727
|
+
n.peek ? (l(), c("div", {
|
|
728
728
|
key: 0,
|
|
729
729
|
class: "wm-peek",
|
|
730
730
|
role: "button",
|
|
@@ -732,16 +732,16 @@ 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] =
|
|
736
|
-
e[3] || (e[3] =
|
|
735
|
+
e[2] || (e[2] = ae(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
|
|
736
|
+
e[3] || (e[3] = ae(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
|
|
737
737
|
]
|
|
738
738
|
}, [
|
|
739
|
-
i("p",
|
|
739
|
+
i("p", qe, b(n.peek), 1),
|
|
740
740
|
i("button", {
|
|
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",
|
|
@@ -780,15 +780,15 @@ function We(t, e, n, a, r, s) {
|
|
|
780
780
|
}, [
|
|
781
781
|
i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
782
782
|
], -1)),
|
|
783
|
-
n.unreadCount > 0 ? (l(),
|
|
783
|
+
n.unreadCount > 0 ? (l(), c("span", {
|
|
784
784
|
key: 0,
|
|
785
785
|
class: "wm-launcher__badge",
|
|
786
786
|
"aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
|
|
787
|
-
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9,
|
|
787
|
+
}, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : g("", !0)
|
|
788
788
|
])
|
|
789
789
|
]);
|
|
790
790
|
}
|
|
791
|
-
const
|
|
791
|
+
const Ge = /* @__PURE__ */ E(ze, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Ye = {
|
|
792
792
|
name: "WmAIAvatar",
|
|
793
793
|
props: {
|
|
794
794
|
size: { type: Number, default: 26 },
|
|
@@ -800,20 +800,20 @@ const Ke = /* @__PURE__ */ E(He, [["render", We], ["__scopeId", "data-v-fabef371
|
|
|
800
800
|
// pour garder l'avatar pleinement arrondi.
|
|
801
801
|
tail: { type: Boolean, default: !1 }
|
|
802
802
|
}
|
|
803
|
-
},
|
|
803
|
+
}, Je = {
|
|
804
804
|
key: 0,
|
|
805
805
|
class: "wm-aiav__pulse"
|
|
806
|
-
},
|
|
807
|
-
function
|
|
808
|
-
return l(),
|
|
806
|
+
}, Xe = ["width", "height"];
|
|
807
|
+
function Qe(t, e, n, a, r, s) {
|
|
808
|
+
return l(), c("div", {
|
|
809
809
|
class: B(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
810
810
|
style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
|
|
811
811
|
}, [
|
|
812
|
-
n.pulse ? (l(),
|
|
812
|
+
n.pulse ? (l(), c("div", Je)) : g("", !0),
|
|
813
813
|
i("div", {
|
|
814
814
|
class: B(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
|
|
815
815
|
}, [
|
|
816
|
-
(l(),
|
|
816
|
+
(l(), c("svg", {
|
|
817
817
|
width: n.size * 0.5,
|
|
818
818
|
height: n.size * 0.5,
|
|
819
819
|
viewBox: "0 0 24 24",
|
|
@@ -839,11 +839,11 @@ function Xe(t, e, n, a, r, s) {
|
|
|
839
839
|
fill: "white",
|
|
840
840
|
opacity: "0.38"
|
|
841
841
|
}, null, -1)
|
|
842
|
-
])], 8,
|
|
842
|
+
])], 8, Xe))
|
|
843
843
|
], 2)
|
|
844
844
|
], 6);
|
|
845
845
|
}
|
|
846
|
-
const te = /* @__PURE__ */ E(
|
|
846
|
+
const te = /* @__PURE__ */ E(Ye, [["render", Qe], ["__scopeId", "data-v-8c924688"]]), Ze = {
|
|
847
847
|
name: "WmHumanAvatar",
|
|
848
848
|
props: {
|
|
849
849
|
name: { type: String, default: "" },
|
|
@@ -852,15 +852,15 @@ const te = /* @__PURE__ */ E(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688
|
|
|
852
852
|
},
|
|
853
853
|
computed: {
|
|
854
854
|
bg() {
|
|
855
|
-
return this.avatarUrl ? "transparent" :
|
|
855
|
+
return this.avatarUrl ? "transparent" : we(this.name);
|
|
856
856
|
},
|
|
857
857
|
initials() {
|
|
858
|
-
return
|
|
858
|
+
return be(this.name);
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
|
-
},
|
|
862
|
-
function
|
|
863
|
-
return l(),
|
|
861
|
+
}, et = ["src", "alt"];
|
|
862
|
+
function tt(t, e, n, a, r, s) {
|
|
863
|
+
return l(), c("div", {
|
|
864
864
|
class: "wm-huav",
|
|
865
865
|
style: G({
|
|
866
866
|
width: n.size + "px",
|
|
@@ -869,17 +869,17 @@ function et(t, e, n, a, r, s) {
|
|
|
869
869
|
background: s.bg
|
|
870
870
|
})
|
|
871
871
|
}, [
|
|
872
|
-
n.avatarUrl ? (l(),
|
|
872
|
+
n.avatarUrl ? (l(), c("img", {
|
|
873
873
|
key: 0,
|
|
874
874
|
src: n.avatarUrl,
|
|
875
875
|
alt: n.name || ""
|
|
876
|
-
}, null, 8,
|
|
876
|
+
}, null, 8, et)) : (l(), c("span", {
|
|
877
877
|
key: 1,
|
|
878
878
|
style: G({ fontSize: n.size * 0.36 + "px" })
|
|
879
879
|
}, b(s.initials), 5))
|
|
880
880
|
], 4);
|
|
881
881
|
}
|
|
882
|
-
const
|
|
882
|
+
const Ce = /* @__PURE__ */ E(Ze, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
|
|
883
883
|
name: "WmTeamAvatars",
|
|
884
884
|
props: {
|
|
885
885
|
members: { type: Array, default: () => [] },
|
|
@@ -895,43 +895,43 @@ const ke = /* @__PURE__ */ E(Qe, [["render", et], ["__scopeId", "data-v-a772b179
|
|
|
895
895
|
},
|
|
896
896
|
methods: {
|
|
897
897
|
colorFor(t) {
|
|
898
|
-
return t.avatar_url ? "transparent" :
|
|
898
|
+
return t.avatar_url ? "transparent" : we(t.name || "");
|
|
899
899
|
},
|
|
900
900
|
initialsFor(t) {
|
|
901
|
-
return
|
|
901
|
+
return be(t.name || "");
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
},
|
|
904
|
+
}, st = {
|
|
905
905
|
key: 0,
|
|
906
906
|
class: "wm-team"
|
|
907
|
-
},
|
|
907
|
+
}, rt = ["src", "alt"], it = { key: 1 }, at = {
|
|
908
908
|
key: 0,
|
|
909
909
|
class: "wm-team__label"
|
|
910
910
|
};
|
|
911
|
-
function
|
|
912
|
-
return s.visible ? (l(),
|
|
911
|
+
function ot(t, e, n, a, r, s) {
|
|
912
|
+
return s.visible ? (l(), c("div", st, [
|
|
913
913
|
i("div", {
|
|
914
914
|
class: "wm-team__stack",
|
|
915
915
|
style: G({ width: s.stackWidth + "px" })
|
|
916
916
|
}, [
|
|
917
|
-
(l(!0),
|
|
918
|
-
key:
|
|
917
|
+
(l(!0), c(T, null, D(n.members.slice(0, 3), (o, d) => (l(), c("div", {
|
|
918
|
+
key: d,
|
|
919
919
|
class: "wm-team__pill",
|
|
920
|
-
style: G({ left:
|
|
920
|
+
style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
|
|
921
921
|
}, [
|
|
922
|
-
o.avatar_url ? (l(),
|
|
922
|
+
o.avatar_url ? (l(), c("img", {
|
|
923
923
|
key: 0,
|
|
924
924
|
src: o.avatar_url,
|
|
925
925
|
alt: o.name || ""
|
|
926
|
-
}, null, 8,
|
|
926
|
+
}, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(o)), 1))
|
|
927
927
|
], 4))), 128))
|
|
928
928
|
], 4),
|
|
929
|
-
n.responseLabel ? (l(),
|
|
929
|
+
n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : g("", !0)
|
|
930
930
|
])) : g("", !0);
|
|
931
931
|
}
|
|
932
|
-
const
|
|
932
|
+
const lt = /* @__PURE__ */ E(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), dt = {
|
|
933
933
|
name: "WmHeader",
|
|
934
|
-
components: { AIAvatar: te, HumanAvatar:
|
|
934
|
+
components: { AIAvatar: te, HumanAvatar: Ce, TeamAvatars: lt },
|
|
935
935
|
props: {
|
|
936
936
|
title: { type: String, default: "Nouvelle conversation" },
|
|
937
937
|
escalated: { type: Boolean, default: !1 },
|
|
@@ -962,20 +962,20 @@ const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
|
|
|
962
962
|
return this.escalated && this.agentName ? this.agentName : "En ligne";
|
|
963
963
|
}
|
|
964
964
|
}
|
|
965
|
-
}, ct = { class: "wm-header" },
|
|
965
|
+
}, ct = { class: "wm-header" }, ut = {
|
|
966
966
|
key: 1,
|
|
967
967
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
968
|
-
},
|
|
968
|
+
}, ht = { class: "wm-header__avatar" }, mt = { class: "wm-header__main" }, ft = { class: "wm-header__title" }, _t = {
|
|
969
969
|
key: 0,
|
|
970
970
|
class: "wm-header__sub"
|
|
971
|
-
},
|
|
971
|
+
}, pt = { class: "wm-header__status" }, vt = {
|
|
972
972
|
key: 3,
|
|
973
973
|
class: "wm-header__fill"
|
|
974
|
-
},
|
|
974
|
+
}, gt = { class: "wm-header__actions" };
|
|
975
975
|
function yt(t, e, n, a, r, s) {
|
|
976
|
-
const o = I("HumanAvatar"),
|
|
977
|
-
return l(),
|
|
978
|
-
n.showBack ? (l(),
|
|
976
|
+
const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
|
|
977
|
+
return l(), c("div", ct, [
|
|
978
|
+
n.showBack ? (l(), c("button", {
|
|
979
979
|
key: 0,
|
|
980
980
|
type: "button",
|
|
981
981
|
class: "wm-header__icon",
|
|
@@ -995,36 +995,36 @@ function yt(t, e, n, a, r, s) {
|
|
|
995
995
|
}, [
|
|
996
996
|
i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
997
997
|
], -1)
|
|
998
|
-
])])) : (l(),
|
|
999
|
-
n.showIdentity ? (l(),
|
|
1000
|
-
i("div",
|
|
998
|
+
])])) : (l(), c("div", ut)),
|
|
999
|
+
n.showIdentity ? (l(), c(T, { key: 2 }, [
|
|
1000
|
+
i("div", ht, [
|
|
1001
1001
|
n.escalated ? (l(), $(o, {
|
|
1002
1002
|
key: 0,
|
|
1003
1003
|
name: n.agentName,
|
|
1004
1004
|
"avatar-url": n.agentAvatarUrl,
|
|
1005
1005
|
size: 34
|
|
1006
|
-
}, null, 8, ["name", "avatar-url"])) : (l(), $(
|
|
1006
|
+
}, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
|
|
1007
1007
|
key: 1,
|
|
1008
1008
|
size: 34
|
|
1009
1009
|
}))
|
|
1010
1010
|
]),
|
|
1011
|
-
i("div",
|
|
1012
|
-
i("div",
|
|
1013
|
-
s.showPresence ? (l(),
|
|
1011
|
+
i("div", mt, [
|
|
1012
|
+
i("div", ft, b(n.title), 1),
|
|
1013
|
+
s.showPresence ? (l(), c("div", _t, [
|
|
1014
1014
|
s.hasTeam ? (l(), $(v, {
|
|
1015
1015
|
key: 0,
|
|
1016
1016
|
members: n.teamMembers,
|
|
1017
1017
|
"response-label": n.responseLabel
|
|
1018
1018
|
}, null, 8, ["members", "response-label"])) : g("", !0),
|
|
1019
|
-
i("span",
|
|
1019
|
+
i("span", pt, [
|
|
1020
1020
|
e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
|
|
1021
|
-
|
|
1021
|
+
de(" " + b(s.statusText), 1)
|
|
1022
1022
|
])
|
|
1023
1023
|
])) : g("", !0)
|
|
1024
1024
|
])
|
|
1025
|
-
], 64)) : (l(),
|
|
1026
|
-
i("div",
|
|
1027
|
-
n.showMore ? (l(),
|
|
1025
|
+
], 64)) : (l(), c("div", vt)),
|
|
1026
|
+
i("div", gt, [
|
|
1027
|
+
n.showMore ? (l(), c("button", {
|
|
1028
1028
|
key: 0,
|
|
1029
1029
|
type: "button",
|
|
1030
1030
|
class: B(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
|
|
@@ -1056,7 +1056,7 @@ function yt(t, e, n, a, r, s) {
|
|
|
1056
1056
|
})
|
|
1057
1057
|
], -1)
|
|
1058
1058
|
])], 2)) : g("", !0),
|
|
1059
|
-
n.showClose ? (l(),
|
|
1059
|
+
n.showClose ? (l(), c("button", {
|
|
1060
1060
|
key: 1,
|
|
1061
1061
|
type: "button",
|
|
1062
1062
|
class: "wm-header__icon",
|
|
@@ -1081,20 +1081,20 @@ function yt(t, e, n, a, r, s) {
|
|
|
1081
1081
|
])
|
|
1082
1082
|
]);
|
|
1083
1083
|
}
|
|
1084
|
-
const
|
|
1084
|
+
const wt = /* @__PURE__ */ E(dt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), pe = {
|
|
1085
1085
|
book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
|
|
1086
1086
|
changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
|
|
1087
1087
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
1088
1088
|
chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
|
|
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
|
+
}, bt = {
|
|
1091
1091
|
name: "WmOnboarding",
|
|
1092
1092
|
components: { AIAvatar: te },
|
|
1093
1093
|
props: {
|
|
1094
1094
|
welcomeMessage: { type: String, default: "" },
|
|
1095
1095
|
agentName: { type: String, default: "" },
|
|
1096
1096
|
quickLinks: { type: Array, default: () => [] },
|
|
1097
|
-
|
|
1097
|
+
openThreads: { type: Array, default: () => [] },
|
|
1098
1098
|
busy: { type: Boolean, default: !1 }
|
|
1099
1099
|
},
|
|
1100
1100
|
emits: ["start", "select", "resume"],
|
|
@@ -1109,16 +1109,20 @@ Je réponds en quelques secondes.`;
|
|
|
1109
1109
|
},
|
|
1110
1110
|
methods: {
|
|
1111
1111
|
iconPath(t) {
|
|
1112
|
-
return
|
|
1112
|
+
return pe[t] || pe.link;
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
|
-
},
|
|
1115
|
+
}, kt = { class: "wm-onb" }, Ct = { class: "wm-onb__hero" }, At = { class: "wm-onb__title" }, St = { class: "wm-onb__sub" }, xt = {
|
|
1116
1116
|
key: 0,
|
|
1117
1117
|
class: "wm-onb__section"
|
|
1118
|
-
},
|
|
1118
|
+
}, Tt = { class: "wm-onb__links" }, Mt = ["onClick"], Ot = {
|
|
1119
|
+
key: 0,
|
|
1120
|
+
class: "wm-onb__resume-dot",
|
|
1121
|
+
"aria-label": "Non lu"
|
|
1122
|
+
}, It = { class: "wm-onb__resume-body" }, Bt = { class: "wm-onb__resume-title" }, Et = { class: "wm-onb__resume-preview" }, $t = {
|
|
1119
1123
|
key: 1,
|
|
1120
1124
|
class: "wm-onb__section"
|
|
1121
|
-
},
|
|
1125
|
+
}, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], Ft = { class: "wm-onb__link-icon" }, Dt = {
|
|
1122
1126
|
width: "14",
|
|
1123
1127
|
height: "14",
|
|
1124
1128
|
viewBox: "0 0 24 24",
|
|
@@ -1128,29 +1132,31 @@ Je réponds en quelques secondes.`;
|
|
|
1128
1132
|
"stroke-linecap": "round",
|
|
1129
1133
|
"stroke-linejoin": "round",
|
|
1130
1134
|
"aria-hidden": "true"
|
|
1131
|
-
},
|
|
1132
|
-
function
|
|
1135
|
+
}, Nt = ["d"], jt = { class: "wm-onb__link-label" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
|
|
1136
|
+
function Ht(t, e, n, a, r, s) {
|
|
1133
1137
|
const o = I("AIAvatar");
|
|
1134
|
-
return l(),
|
|
1135
|
-
i("div",
|
|
1138
|
+
return l(), c("div", kt, [
|
|
1139
|
+
i("div", Ct, [
|
|
1136
1140
|
K(o, {
|
|
1137
1141
|
size: 56,
|
|
1138
1142
|
pulse: !0
|
|
1139
1143
|
}),
|
|
1140
|
-
i("div",
|
|
1141
|
-
i("div",
|
|
1144
|
+
i("div", At, b(s.heroTitle), 1),
|
|
1145
|
+
i("div", St, b(s.heroSub), 1)
|
|
1142
1146
|
]),
|
|
1143
|
-
n.
|
|
1144
|
-
e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "
|
|
1145
|
-
i("div",
|
|
1146
|
-
(l(!0),
|
|
1147
|
-
key:
|
|
1147
|
+
n.openThreads.length ? (l(), c("div", xt, [
|
|
1148
|
+
e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Vos conversations", -1)),
|
|
1149
|
+
i("div", Tt, [
|
|
1150
|
+
(l(!0), c(T, null, D(n.openThreads, (d) => (l(), c("button", {
|
|
1151
|
+
key: d.id,
|
|
1148
1152
|
type: "button",
|
|
1149
1153
|
class: "wm-onb__link wm-onb__resume",
|
|
1150
|
-
onClick: (v) => t.$emit("resume",
|
|
1154
|
+
onClick: (v) => t.$emit("resume", d)
|
|
1151
1155
|
}, [
|
|
1152
|
-
|
|
1153
|
-
|
|
1156
|
+
i("span", {
|
|
1157
|
+
class: B(["wm-onb__link-icon", { "wm-onb__resume-icon": d.unread }])
|
|
1158
|
+
}, [
|
|
1159
|
+
e[1] || (e[1] = i("svg", {
|
|
1154
1160
|
width: "14",
|
|
1155
1161
|
height: "14",
|
|
1156
1162
|
viewBox: "0 0 24 24",
|
|
@@ -1162,15 +1168,12 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1162
1168
|
"aria-hidden": "true"
|
|
1163
1169
|
}, [
|
|
1164
1170
|
i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
1165
|
-
]),
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
i("span", Tt, [
|
|
1172
|
-
i("span", Ot, b(c.title), 1),
|
|
1173
|
-
i("span", It, b(c.preview), 1)
|
|
1171
|
+
], -1)),
|
|
1172
|
+
d.unread ? (l(), c("span", Ot)) : g("", !0)
|
|
1173
|
+
], 2),
|
|
1174
|
+
i("span", It, [
|
|
1175
|
+
i("span", Bt, b(d.title), 1),
|
|
1176
|
+
i("span", Et, b(d.preview), 1)
|
|
1174
1177
|
]),
|
|
1175
1178
|
e[2] || (e[2] = i("svg", {
|
|
1176
1179
|
width: "13",
|
|
@@ -1189,23 +1192,23 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1189
1192
|
], 8, Mt))), 128))
|
|
1190
1193
|
])
|
|
1191
1194
|
])) : g("", !0),
|
|
1192
|
-
n.quickLinks.length ? (l(),
|
|
1195
|
+
n.quickLinks.length ? (l(), c("div", $t, [
|
|
1193
1196
|
e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
|
|
1194
|
-
i("div",
|
|
1195
|
-
(l(!0),
|
|
1197
|
+
i("div", Lt, [
|
|
1198
|
+
(l(!0), c(T, null, D(n.quickLinks, (d, v) => (l(), c("button", {
|
|
1196
1199
|
key: v,
|
|
1197
1200
|
type: "button",
|
|
1198
1201
|
class: "wm-onb__link",
|
|
1199
|
-
onClick: (k) => t.$emit("select",
|
|
1202
|
+
onClick: (k) => t.$emit("select", d)
|
|
1200
1203
|
}, [
|
|
1201
|
-
i("span",
|
|
1202
|
-
(l(),
|
|
1204
|
+
i("span", Ft, [
|
|
1205
|
+
(l(), c("svg", Dt, [
|
|
1203
1206
|
i("path", {
|
|
1204
|
-
d: s.iconPath(
|
|
1205
|
-
}, null, 8,
|
|
1207
|
+
d: s.iconPath(d.icon)
|
|
1208
|
+
}, null, 8, Nt)
|
|
1206
1209
|
]))
|
|
1207
1210
|
]),
|
|
1208
|
-
i("span", jt, b(
|
|
1211
|
+
i("span", jt, b(d.label), 1),
|
|
1209
1212
|
e[4] || (e[4] = i("svg", {
|
|
1210
1213
|
width: "13",
|
|
1211
1214
|
height: "13",
|
|
@@ -1220,24 +1223,24 @@ function Nt(t, e, n, a, r, s) {
|
|
|
1220
1223
|
}, [
|
|
1221
1224
|
i("path", { d: "M9 18l6-6-6-6" })
|
|
1222
1225
|
], -1))
|
|
1223
|
-
], 8,
|
|
1226
|
+
], 8, Rt))), 128))
|
|
1224
1227
|
])
|
|
1225
1228
|
])) : g("", !0),
|
|
1226
|
-
i("div",
|
|
1229
|
+
i("div", Ut, [
|
|
1227
1230
|
i("button", {
|
|
1228
1231
|
type: "button",
|
|
1229
1232
|
class: "wm-onb__startBtn",
|
|
1230
1233
|
disabled: n.busy,
|
|
1231
|
-
onClick: e[0] || (e[0] = (
|
|
1232
|
-
}, b(n.busy ? "…" : "Commencer une conversation"), 9,
|
|
1234
|
+
onClick: e[0] || (e[0] = (d) => t.$emit("start"))
|
|
1235
|
+
}, b(n.busy ? "…" : "Commencer une conversation"), 9, Pt)
|
|
1233
1236
|
])
|
|
1234
1237
|
]);
|
|
1235
1238
|
}
|
|
1236
|
-
const
|
|
1237
|
-
function
|
|
1239
|
+
const zt = /* @__PURE__ */ E(bt, [["render", Ht], ["__scopeId", "data-v-7ce03b72"]]);
|
|
1240
|
+
function Vt(t) {
|
|
1238
1241
|
return typeof t != "string" ? "" : t.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
|
|
1239
1242
|
}
|
|
1240
|
-
const
|
|
1243
|
+
const qt = {
|
|
1241
1244
|
name: "WmActionResult",
|
|
1242
1245
|
props: {
|
|
1243
1246
|
state: { type: String, default: "success" },
|
|
@@ -1247,13 +1250,13 @@ const zt = {
|
|
|
1247
1250
|
},
|
|
1248
1251
|
computed: {
|
|
1249
1252
|
detailText() {
|
|
1250
|
-
return
|
|
1253
|
+
return Vt(this.detail);
|
|
1251
1254
|
}
|
|
1252
1255
|
}
|
|
1253
|
-
},
|
|
1256
|
+
}, Wt = {
|
|
1254
1257
|
class: "wm-result__icon",
|
|
1255
1258
|
"aria-hidden": "true"
|
|
1256
|
-
},
|
|
1259
|
+
}, Kt = {
|
|
1257
1260
|
key: 0,
|
|
1258
1261
|
width: "11",
|
|
1259
1262
|
height: "11",
|
|
@@ -1263,7 +1266,7 @@ const zt = {
|
|
|
1263
1266
|
"stroke-width": "2.8",
|
|
1264
1267
|
"stroke-linecap": "round",
|
|
1265
1268
|
"stroke-linejoin": "round"
|
|
1266
|
-
},
|
|
1269
|
+
}, Gt = {
|
|
1267
1270
|
key: 1,
|
|
1268
1271
|
width: "11",
|
|
1269
1272
|
height: "11",
|
|
@@ -1273,7 +1276,7 @@ const zt = {
|
|
|
1273
1276
|
"stroke-width": "2.6",
|
|
1274
1277
|
"stroke-linecap": "round",
|
|
1275
1278
|
"stroke-linejoin": "round"
|
|
1276
|
-
},
|
|
1279
|
+
}, Yt = {
|
|
1277
1280
|
key: 2,
|
|
1278
1281
|
width: "11",
|
|
1279
1282
|
height: "11",
|
|
@@ -1283,7 +1286,7 @@ const zt = {
|
|
|
1283
1286
|
"stroke-width": "2.4",
|
|
1284
1287
|
"stroke-linecap": "round",
|
|
1285
1288
|
"stroke-linejoin": "round"
|
|
1286
|
-
},
|
|
1289
|
+
}, Jt = {
|
|
1287
1290
|
key: 3,
|
|
1288
1291
|
width: "12",
|
|
1289
1292
|
height: "12",
|
|
@@ -1293,24 +1296,24 @@ const zt = {
|
|
|
1293
1296
|
"stroke-width": "2.2",
|
|
1294
1297
|
"stroke-linecap": "round",
|
|
1295
1298
|
"stroke-linejoin": "round"
|
|
1296
|
-
},
|
|
1297
|
-
function
|
|
1298
|
-
return l(),
|
|
1299
|
+
}, Xt = { class: "wm-result__body" }, Qt = { class: "wm-result__label" }, Zt = { class: "wm-result__detail" };
|
|
1300
|
+
function en(t, e, n, a, r, s) {
|
|
1301
|
+
return l(), c("div", {
|
|
1299
1302
|
class: B(["wm-result", `wm-result--${n.state}`])
|
|
1300
1303
|
}, [
|
|
1301
|
-
i("span",
|
|
1302
|
-
n.state === "success" ? (l(),
|
|
1304
|
+
i("span", Wt, [
|
|
1305
|
+
n.state === "success" ? (l(), c("svg", Kt, [...e[0] || (e[0] = [
|
|
1303
1306
|
i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
1304
|
-
])])) : n.state === "rejected" ? (l(),
|
|
1307
|
+
])])) : n.state === "rejected" ? (l(), c("svg", Gt, [...e[1] || (e[1] = [
|
|
1305
1308
|
i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
1306
|
-
])])) : n.state === "awaiting" ? (l(),
|
|
1309
|
+
])])) : n.state === "awaiting" ? (l(), c("svg", Yt, [...e[2] || (e[2] = [
|
|
1307
1310
|
i("circle", {
|
|
1308
1311
|
cx: "12",
|
|
1309
1312
|
cy: "12",
|
|
1310
1313
|
r: "10"
|
|
1311
1314
|
}, null, -1),
|
|
1312
1315
|
i("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
1313
|
-
])])) : (l(),
|
|
1316
|
+
])])) : (l(), c("svg", Jt, [...e[3] || (e[3] = [
|
|
1314
1317
|
i("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
|
|
1315
1318
|
i("line", {
|
|
1316
1319
|
x1: "12",
|
|
@@ -1326,19 +1329,19 @@ function Qt(t, e, n, a, r, s) {
|
|
|
1326
1329
|
}, null, -1)
|
|
1327
1330
|
])]))
|
|
1328
1331
|
]),
|
|
1329
|
-
i("span",
|
|
1330
|
-
i("span",
|
|
1331
|
-
s.detailText ? (l(),
|
|
1332
|
+
i("span", Xt, [
|
|
1333
|
+
i("span", Qt, b(n.label), 1),
|
|
1334
|
+
s.detailText ? (l(), c(T, { key: 0 }, [
|
|
1332
1335
|
e[4] || (e[4] = i("span", {
|
|
1333
1336
|
class: "wm-result__sep",
|
|
1334
1337
|
"aria-hidden": "true"
|
|
1335
1338
|
}, " · ", -1)),
|
|
1336
|
-
i("span",
|
|
1339
|
+
i("span", Zt, b(s.detailText), 1)
|
|
1337
1340
|
], 64)) : g("", !0)
|
|
1338
1341
|
])
|
|
1339
1342
|
], 2);
|
|
1340
1343
|
}
|
|
1341
|
-
const
|
|
1344
|
+
const tn = /* @__PURE__ */ E(qt, [["render", en], ["__scopeId", "data-v-64a83fb8"]]), nn = {
|
|
1342
1345
|
name: "WmArtifactFormResponse",
|
|
1343
1346
|
props: {
|
|
1344
1347
|
data: { type: Object, required: !0 }
|
|
@@ -1349,11 +1352,11 @@ const Zt = /* @__PURE__ */ E(zt, [["render", Qt], ["__scopeId", "data-v-64a83fb8
|
|
|
1349
1352
|
return Array.isArray((t = this.data) == null ? void 0 : t.fields) ? this.data.fields : [];
|
|
1350
1353
|
}
|
|
1351
1354
|
}
|
|
1352
|
-
},
|
|
1353
|
-
function
|
|
1354
|
-
return l(),
|
|
1355
|
-
i("div",
|
|
1356
|
-
i("div",
|
|
1355
|
+
}, sn = { class: "wm-art wm-art--formResponse" }, rn = { class: "wm-art__head" }, an = { class: "wm-art__title" }, on = { class: "wm-art__body" }, ln = { class: "wm-art__fieldLabel" };
|
|
1356
|
+
function dn(t, e, n, a, r, s) {
|
|
1357
|
+
return l(), c("div", sn, [
|
|
1358
|
+
i("div", rn, [
|
|
1359
|
+
i("div", an, b(n.data.title || "Formulaire"), 1),
|
|
1357
1360
|
e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
|
|
1358
1361
|
i("svg", {
|
|
1359
1362
|
width: "11",
|
|
@@ -1368,15 +1371,15 @@ function on(t, e, n, a, r, s) {
|
|
|
1368
1371
|
}, [
|
|
1369
1372
|
i("polyline", { points: "20 6 9 17 4 12" })
|
|
1370
1373
|
]),
|
|
1371
|
-
|
|
1374
|
+
de(" Envoyé ")
|
|
1372
1375
|
], -1))
|
|
1373
1376
|
]),
|
|
1374
|
-
i("div",
|
|
1375
|
-
(l(!0),
|
|
1376
|
-
key:
|
|
1377
|
+
i("div", on, [
|
|
1378
|
+
(l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
|
|
1379
|
+
key: d,
|
|
1377
1380
|
class: "wm-art__field"
|
|
1378
1381
|
}, [
|
|
1379
|
-
i("div",
|
|
1382
|
+
i("div", ln, b(o.label), 1),
|
|
1380
1383
|
i("div", {
|
|
1381
1384
|
class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1382
1385
|
}, b(o.value), 3)
|
|
@@ -1384,7 +1387,7 @@ function on(t, e, n, a, r, s) {
|
|
|
1384
1387
|
])
|
|
1385
1388
|
]);
|
|
1386
1389
|
}
|
|
1387
|
-
const
|
|
1390
|
+
const cn = /* @__PURE__ */ E(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9"]]), un = {
|
|
1388
1391
|
name: "WmArtifactInfoCard",
|
|
1389
1392
|
props: {
|
|
1390
1393
|
data: { type: Object, required: !0 }
|
|
@@ -1399,45 +1402,45 @@ const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9
|
|
|
1399
1402
|
return !!((t = this.data) != null && t.body) || this.fields.length > 0;
|
|
1400
1403
|
}
|
|
1401
1404
|
}
|
|
1402
|
-
},
|
|
1405
|
+
}, hn = { class: "wm-art wm-art--infoCard" }, mn = {
|
|
1403
1406
|
key: 0,
|
|
1404
1407
|
class: "wm-art__image"
|
|
1405
|
-
},
|
|
1408
|
+
}, fn = ["src", "alt"], _n = { class: "wm-art__head" }, pn = { class: "wm-art__headMain" }, vn = { class: "wm-art__title" }, gn = {
|
|
1406
1409
|
key: 0,
|
|
1407
1410
|
class: "wm-art__subtitle"
|
|
1408
|
-
},
|
|
1411
|
+
}, yn = {
|
|
1409
1412
|
key: 1,
|
|
1410
1413
|
class: "wm-art__body"
|
|
1411
|
-
},
|
|
1414
|
+
}, wn = {
|
|
1412
1415
|
key: 0,
|
|
1413
1416
|
class: "wm-art__text"
|
|
1414
|
-
},
|
|
1415
|
-
function
|
|
1416
|
-
return l(),
|
|
1417
|
-
n.data.image_url ? (l(),
|
|
1417
|
+
}, bn = { class: "wm-art__fieldLabel" };
|
|
1418
|
+
function kn(t, e, n, a, r, s) {
|
|
1419
|
+
return l(), c("div", hn, [
|
|
1420
|
+
n.data.image_url ? (l(), c("figure", mn, [
|
|
1418
1421
|
i("img", {
|
|
1419
1422
|
src: n.data.image_url,
|
|
1420
1423
|
alt: n.data.title || "",
|
|
1421
1424
|
loading: "lazy"
|
|
1422
|
-
}, null, 8,
|
|
1425
|
+
}, null, 8, fn)
|
|
1423
1426
|
])) : g("", !0),
|
|
1424
|
-
i("div",
|
|
1425
|
-
i("div",
|
|
1426
|
-
i("div",
|
|
1427
|
-
n.data.subtitle ? (l(),
|
|
1427
|
+
i("div", _n, [
|
|
1428
|
+
i("div", pn, [
|
|
1429
|
+
i("div", vn, b(n.data.title), 1),
|
|
1430
|
+
n.data.subtitle ? (l(), c("div", gn, b(n.data.subtitle), 1)) : g("", !0)
|
|
1428
1431
|
]),
|
|
1429
|
-
n.data.badge && n.data.badge.label ? (l(),
|
|
1432
|
+
n.data.badge && n.data.badge.label ? (l(), c("span", {
|
|
1430
1433
|
key: 0,
|
|
1431
1434
|
class: B(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
|
|
1432
1435
|
}, b(n.data.badge.label), 3)) : g("", !0)
|
|
1433
1436
|
]),
|
|
1434
|
-
s.hasBody ? (l(),
|
|
1435
|
-
n.data.body ? (l(),
|
|
1436
|
-
s.fields.length ? (l(!0),
|
|
1437
|
-
key:
|
|
1437
|
+
s.hasBody ? (l(), c("div", yn, [
|
|
1438
|
+
n.data.body ? (l(), c("div", wn, b(n.data.body), 1)) : g("", !0),
|
|
1439
|
+
s.fields.length ? (l(!0), c(T, { key: 1 }, D(s.fields, (o, d) => (l(), c("div", {
|
|
1440
|
+
key: d,
|
|
1438
1441
|
class: "wm-art__field"
|
|
1439
1442
|
}, [
|
|
1440
|
-
i("div",
|
|
1443
|
+
i("div", bn, b(o.label), 1),
|
|
1441
1444
|
i("div", {
|
|
1442
1445
|
class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1443
1446
|
}, b(o.value), 3)
|
|
@@ -1445,15 +1448,15 @@ function wn(t, e, n, a, r, s) {
|
|
|
1445
1448
|
])) : g("", !0)
|
|
1446
1449
|
]);
|
|
1447
1450
|
}
|
|
1448
|
-
const
|
|
1449
|
-
function
|
|
1451
|
+
const Cn = /* @__PURE__ */ E(un, [["render", kn], ["__scopeId", "data-v-d7369333"]]);
|
|
1452
|
+
function An(t) {
|
|
1450
1453
|
if (!t) return "";
|
|
1451
1454
|
const e = new Date(t);
|
|
1452
1455
|
if (Number.isNaN(e.getTime())) return t;
|
|
1453
1456
|
const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), a = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
|
|
1454
1457
|
return `${n} à ${a}`;
|
|
1455
1458
|
}
|
|
1456
|
-
const
|
|
1459
|
+
const Sn = {
|
|
1457
1460
|
name: "WmArtifactTicket",
|
|
1458
1461
|
props: {
|
|
1459
1462
|
data: { type: Object, required: !0 }
|
|
@@ -1465,7 +1468,7 @@ const Cn = {
|
|
|
1465
1468
|
},
|
|
1466
1469
|
formattedDate() {
|
|
1467
1470
|
var t;
|
|
1468
|
-
return
|
|
1471
|
+
return An((t = this.data) == null ? void 0 : t.created_at);
|
|
1469
1472
|
}
|
|
1470
1473
|
},
|
|
1471
1474
|
methods: {
|
|
@@ -1487,13 +1490,13 @@ const Cn = {
|
|
|
1487
1490
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
|
|
1488
1491
|
}
|
|
1489
1492
|
}
|
|
1490
|
-
},
|
|
1493
|
+
}, xn = { class: "wm-art wm-art--ticket" }, Tn = { class: "wm-art__head wm-tk__head" }, Mn = { class: "wm-art__title wm-tk__title" }, On = { class: "wm-tk__sub" }, In = { class: "wm-tk__ref" }, Bn = {
|
|
1491
1494
|
key: 0,
|
|
1492
1495
|
class: "wm-tk__text"
|
|
1493
|
-
},
|
|
1496
|
+
}, En = {
|
|
1494
1497
|
key: 0,
|
|
1495
1498
|
class: "wm-art__body"
|
|
1496
|
-
},
|
|
1499
|
+
}, $n = { class: "wm-art__fieldLabel" }, Ln = ["data-level"], Rn = {
|
|
1497
1500
|
key: 1,
|
|
1498
1501
|
class: "wm-tk__date",
|
|
1499
1502
|
width: "12",
|
|
@@ -1505,16 +1508,16 @@ const Cn = {
|
|
|
1505
1508
|
"stroke-linecap": "round",
|
|
1506
1509
|
"stroke-linejoin": "round",
|
|
1507
1510
|
"aria-hidden": "true"
|
|
1508
|
-
},
|
|
1511
|
+
}, Fn = {
|
|
1509
1512
|
key: 1,
|
|
1510
1513
|
class: "wm-art__footer wm-tk__footer"
|
|
1511
1514
|
};
|
|
1512
|
-
function
|
|
1513
|
-
return l(),
|
|
1514
|
-
i("div",
|
|
1515
|
-
i("div",
|
|
1516
|
-
i("div",
|
|
1517
|
-
i("div",
|
|
1515
|
+
function Dn(t, e, n, a, r, s) {
|
|
1516
|
+
return l(), c("div", xn, [
|
|
1517
|
+
i("div", Tn, [
|
|
1518
|
+
i("div", Mn, b(n.data.title), 1),
|
|
1519
|
+
i("div", On, [
|
|
1520
|
+
i("div", In, [
|
|
1518
1521
|
e[0] || (e[0] = i("svg", {
|
|
1519
1522
|
width: "11",
|
|
1520
1523
|
height: "11",
|
|
@@ -1538,21 +1541,21 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1538
1541
|
class: "wm-tk__dot",
|
|
1539
1542
|
"aria-hidden": "true"
|
|
1540
1543
|
}, null, -1)),
|
|
1541
|
-
|
|
1544
|
+
de(" " + b(n.data.status.label), 1)
|
|
1542
1545
|
], 2)
|
|
1543
1546
|
]),
|
|
1544
|
-
n.data.body ? (l(),
|
|
1547
|
+
n.data.body ? (l(), c("div", Bn, b(n.data.body), 1)) : g("", !0)
|
|
1545
1548
|
]),
|
|
1546
|
-
s.fields.length ? (l(),
|
|
1547
|
-
(l(!0),
|
|
1548
|
-
key:
|
|
1549
|
+
s.fields.length ? (l(), c("div", En, [
|
|
1550
|
+
(l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
|
|
1551
|
+
key: d,
|
|
1549
1552
|
class: "wm-art__field"
|
|
1550
1553
|
}, [
|
|
1551
|
-
i("div",
|
|
1554
|
+
i("div", $n, b(o.label), 1),
|
|
1552
1555
|
i("div", {
|
|
1553
1556
|
class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
|
|
1554
1557
|
}, [
|
|
1555
|
-
s.isPriority(o.label) ? (l(),
|
|
1558
|
+
s.isPriority(o.label) ? (l(), c("svg", {
|
|
1556
1559
|
key: 0,
|
|
1557
1560
|
class: "wm-tk__prio",
|
|
1558
1561
|
"data-level": s.priorityLevel(o.value),
|
|
@@ -1582,7 +1585,7 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1582
1585
|
height: "9",
|
|
1583
1586
|
rx: "0.5"
|
|
1584
1587
|
}, null, -1)
|
|
1585
|
-
])], 8,
|
|
1588
|
+
])], 8, Ln)) : s.isDate(o.label) ? (l(), c("svg", Rn, [...e[3] || (e[3] = [
|
|
1586
1589
|
i("rect", {
|
|
1587
1590
|
x: "3",
|
|
1588
1591
|
y: "4",
|
|
@@ -1596,7 +1599,7 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1596
1599
|
], 2)
|
|
1597
1600
|
]))), 128))
|
|
1598
1601
|
])) : g("", !0),
|
|
1599
|
-
n.data.created_at ? (l(),
|
|
1602
|
+
n.data.created_at ? (l(), c("div", Fn, [
|
|
1600
1603
|
e[4] || (e[4] = i("svg", {
|
|
1601
1604
|
width: "11",
|
|
1602
1605
|
height: "11",
|
|
@@ -1621,11 +1624,11 @@ function Rn(t, e, n, a, r, s) {
|
|
|
1621
1624
|
])) : g("", !0)
|
|
1622
1625
|
]);
|
|
1623
1626
|
}
|
|
1624
|
-
const
|
|
1625
|
-
form_response:
|
|
1626
|
-
info_card:
|
|
1627
|
-
ticket:
|
|
1628
|
-
},
|
|
1627
|
+
const Nn = /* @__PURE__ */ E(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
|
|
1628
|
+
form_response: cn,
|
|
1629
|
+
info_card: Cn,
|
|
1630
|
+
ticket: Nn
|
|
1631
|
+
}, Un = {
|
|
1629
1632
|
name: "WmArtifactRenderer",
|
|
1630
1633
|
props: {
|
|
1631
1634
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -1640,13 +1643,13 @@ const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7
|
|
|
1640
1643
|
}
|
|
1641
1644
|
}
|
|
1642
1645
|
};
|
|
1643
|
-
function
|
|
1646
|
+
function Pn(t, e, n, a, r, s) {
|
|
1644
1647
|
return s.component ? (l(), $(Me(s.component), {
|
|
1645
1648
|
key: 0,
|
|
1646
1649
|
data: n.artifact.data
|
|
1647
1650
|
}, null, 8, ["data"])) : g("", !0);
|
|
1648
1651
|
}
|
|
1649
|
-
const
|
|
1652
|
+
const Hn = /* @__PURE__ */ E(Un, [["render", Pn]]), zn = {
|
|
1650
1653
|
name: "WmAttachmentPreview",
|
|
1651
1654
|
inject: {
|
|
1652
1655
|
signAttachmentFn: { default: null }
|
|
@@ -1700,19 +1703,19 @@ const Nn = /* @__PURE__ */ E(Dn, [["render", Un]]), Pn = {
|
|
|
1700
1703
|
this.url || t.preventDefault();
|
|
1701
1704
|
}
|
|
1702
1705
|
}
|
|
1703
|
-
},
|
|
1706
|
+
}, Vn = ["href"], qn = ["src", "alt"], Wn = ["src"], Kn = ["src"], Gn = ["href", "download"], Yn = { class: "wm-att__main" }, Jn = { class: "wm-att__name" }, Xn = {
|
|
1704
1707
|
key: 0,
|
|
1705
1708
|
class: "wm-att__meta"
|
|
1706
|
-
},
|
|
1709
|
+
}, Qn = {
|
|
1707
1710
|
key: 0,
|
|
1708
1711
|
class: "wm-att__spin",
|
|
1709
1712
|
"aria-hidden": "true"
|
|
1710
1713
|
};
|
|
1711
|
-
function
|
|
1712
|
-
return l(),
|
|
1714
|
+
function Zn(t, e, n, a, r, s) {
|
|
1715
|
+
return l(), c("div", {
|
|
1713
1716
|
class: B(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
1714
1717
|
}, [
|
|
1715
|
-
s.kind === "image" && r.url ? (l(),
|
|
1718
|
+
s.kind === "image" && r.url ? (l(), c("a", {
|
|
1716
1719
|
key: 0,
|
|
1717
1720
|
href: r.url,
|
|
1718
1721
|
target: "_blank",
|
|
@@ -1723,18 +1726,18 @@ function Xn(t, e, n, a, r, s) {
|
|
|
1723
1726
|
src: r.url,
|
|
1724
1727
|
alt: s.displayName,
|
|
1725
1728
|
loading: "lazy"
|
|
1726
|
-
}, null, 8,
|
|
1727
|
-
], 8,
|
|
1729
|
+
}, null, 8, qn)
|
|
1730
|
+
], 8, Vn)) : s.kind === "audio" && r.url ? (l(), c("audio", {
|
|
1728
1731
|
key: 1,
|
|
1729
1732
|
src: r.url,
|
|
1730
1733
|
controls: "",
|
|
1731
1734
|
preload: "metadata"
|
|
1732
|
-
}, null, 8,
|
|
1735
|
+
}, null, 8, Wn)) : s.kind === "video" && r.url ? (l(), c("video", {
|
|
1733
1736
|
key: 2,
|
|
1734
1737
|
src: r.url,
|
|
1735
1738
|
controls: "",
|
|
1736
1739
|
preload: "metadata"
|
|
1737
|
-
}, null, 8,
|
|
1740
|
+
}, null, 8, Kn)) : (l(), c("a", {
|
|
1738
1741
|
key: 3,
|
|
1739
1742
|
class: "wm-att__file",
|
|
1740
1743
|
href: r.url || "#",
|
|
@@ -1759,33 +1762,33 @@ function Xn(t, e, n, a, r, s) {
|
|
|
1759
1762
|
i("path", { d: "M14 2v6h6" })
|
|
1760
1763
|
])
|
|
1761
1764
|
], -1)),
|
|
1762
|
-
i("span",
|
|
1763
|
-
i("span",
|
|
1764
|
-
s.sizeLabel ? (l(),
|
|
1765
|
+
i("span", Yn, [
|
|
1766
|
+
i("span", Jn, b(s.displayName), 1),
|
|
1767
|
+
s.sizeLabel ? (l(), c("span", Xn, b(s.sizeLabel), 1)) : g("", !0)
|
|
1765
1768
|
]),
|
|
1766
|
-
r.loading ? (l(),
|
|
1767
|
-
], 8,
|
|
1769
|
+
r.loading ? (l(), c("span", Qn)) : g("", !0)
|
|
1770
|
+
], 8, Gn))
|
|
1768
1771
|
], 2);
|
|
1769
1772
|
}
|
|
1770
|
-
const
|
|
1771
|
-
function
|
|
1773
|
+
const es = /* @__PURE__ */ E(zn, [["render", Zn], ["__scopeId", "data-v-1cd1267b"]]);
|
|
1774
|
+
function ts(t) {
|
|
1772
1775
|
return String(t).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1773
1776
|
}
|
|
1774
|
-
function
|
|
1777
|
+
function ns(t) {
|
|
1775
1778
|
return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
|
|
1776
1779
|
}
|
|
1777
|
-
const
|
|
1780
|
+
const ve = "";
|
|
1778
1781
|
function re(t) {
|
|
1779
1782
|
let e = t;
|
|
1780
1783
|
const n = [];
|
|
1781
1784
|
return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
|
|
1782
1785
|
const s = n.length;
|
|
1783
|
-
return n.push(r), `${
|
|
1784
|
-
}), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) =>
|
|
1786
|
+
return n.push(r), `${ve}CODE${s}${ve}`;
|
|
1787
|
+
}), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => ns(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (a, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
|
|
1785
1788
|
}
|
|
1786
|
-
function
|
|
1789
|
+
function ss(t) {
|
|
1787
1790
|
if (!t) return "";
|
|
1788
|
-
const e =
|
|
1791
|
+
const e = ts(t).split(`
|
|
1789
1792
|
`), n = [];
|
|
1790
1793
|
let a = 0;
|
|
1791
1794
|
for (; a < e.length; ) {
|
|
@@ -1813,9 +1816,9 @@ function ts(t) {
|
|
|
1813
1816
|
n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
|
|
1814
1817
|
continue;
|
|
1815
1818
|
}
|
|
1816
|
-
const
|
|
1817
|
-
if (
|
|
1818
|
-
const k = parseInt(
|
|
1819
|
+
const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
1820
|
+
if (d) {
|
|
1821
|
+
const k = parseInt(d[1], 10), w = [d[2]];
|
|
1819
1822
|
for (a++; a < e.length; ) {
|
|
1820
1823
|
const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
|
|
1821
1824
|
if (!A) break;
|
|
@@ -1840,13 +1843,13 @@ function ts(t) {
|
|
|
1840
1843
|
for (let s = 0; s < n.length; s++) {
|
|
1841
1844
|
const o = n[s];
|
|
1842
1845
|
r += o.html;
|
|
1843
|
-
const
|
|
1844
|
-
|
|
1846
|
+
const d = n[s + 1];
|
|
1847
|
+
d && o.type !== "block" && d.type !== "block" && (r += `
|
|
1845
1848
|
`);
|
|
1846
1849
|
}
|
|
1847
1850
|
return r;
|
|
1848
1851
|
}
|
|
1849
|
-
const
|
|
1852
|
+
const rs = {
|
|
1850
1853
|
name: "WmBubble",
|
|
1851
1854
|
props: {
|
|
1852
1855
|
role: { type: String, default: "ai" },
|
|
@@ -1855,41 +1858,41 @@ const ns = {
|
|
|
1855
1858
|
},
|
|
1856
1859
|
computed: {
|
|
1857
1860
|
rendered() {
|
|
1858
|
-
return
|
|
1861
|
+
return ss(this.text);
|
|
1859
1862
|
}
|
|
1860
1863
|
}
|
|
1861
|
-
},
|
|
1862
|
-
function
|
|
1863
|
-
return l(),
|
|
1864
|
+
}, is = ["innerHTML"];
|
|
1865
|
+
function as(t, e, n, a, r, s) {
|
|
1866
|
+
return l(), c("div", {
|
|
1864
1867
|
class: B(["wm-bubble", "wm-bubble--" + n.role])
|
|
1865
1868
|
}, [
|
|
1866
|
-
|
|
1867
|
-
i("span", { innerHTML: s.rendered }, null, 8,
|
|
1869
|
+
Oe(t.$slots, "default", {}, () => [
|
|
1870
|
+
i("span", { innerHTML: s.rendered }, null, 8, is)
|
|
1868
1871
|
], !0)
|
|
1869
1872
|
], 2);
|
|
1870
1873
|
}
|
|
1871
|
-
const
|
|
1872
|
-
function
|
|
1873
|
-
return l(),
|
|
1874
|
+
const os = /* @__PURE__ */ E(rs, [["render", as], ["__scopeId", "data-v-5c9e9f2b"]]), ls = { name: "WmTyping" }, ds = { class: "wm-typing" };
|
|
1875
|
+
function cs(t, e, n, a, r, s) {
|
|
1876
|
+
return l(), c("div", ds, [...e[0] || (e[0] = [
|
|
1874
1877
|
i("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
1875
1878
|
i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
1876
1879
|
i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
1877
1880
|
])]);
|
|
1878
1881
|
}
|
|
1879
|
-
const
|
|
1880
|
-
function
|
|
1882
|
+
const us = /* @__PURE__ */ E(ls, [["render", cs], ["__scopeId", "data-v-df2447fd"]]);
|
|
1883
|
+
function ee(t) {
|
|
1881
1884
|
return t ? t.client_msg_id || t.id : "";
|
|
1882
1885
|
}
|
|
1883
|
-
const
|
|
1886
|
+
const hs = {
|
|
1884
1887
|
transferred_to_human: "Conversation transférée à un humain",
|
|
1885
1888
|
assigned: "{name} a rejoint la conversation",
|
|
1886
1889
|
unassigned: "L'agent a quitté la conversation",
|
|
1887
1890
|
resolved: "Conversation résolue",
|
|
1888
1891
|
reopened: "Conversation rouverte",
|
|
1889
1892
|
idle: "Conversation en pause"
|
|
1890
|
-
},
|
|
1893
|
+
}, ms = 80, fs = 200, _s = {
|
|
1891
1894
|
name: "WmMessageList",
|
|
1892
|
-
components: { AIAvatar: te, HumanAvatar:
|
|
1895
|
+
components: { AIAvatar: te, HumanAvatar: Ce, Bubble: os, Typing: us, ActionResult: tn, AttachmentPreview: es, ArtifactRenderer: Hn },
|
|
1893
1896
|
props: {
|
|
1894
1897
|
messages: { type: Array, default: () => [] },
|
|
1895
1898
|
streamingActive: { type: Boolean, default: !1 },
|
|
@@ -1942,7 +1945,7 @@ const ds = {
|
|
|
1942
1945
|
if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
|
|
1943
1946
|
const k = t[t.length - 1];
|
|
1944
1947
|
k && k.role === "ai" ? k.messages.push(s) : t.push({
|
|
1945
|
-
key: `g-${
|
|
1948
|
+
key: `g-${ee(s)}`,
|
|
1946
1949
|
role: "ai",
|
|
1947
1950
|
agentName: "",
|
|
1948
1951
|
agentAvatarUrl: null,
|
|
@@ -1952,7 +1955,7 @@ const ds = {
|
|
|
1952
1955
|
continue;
|
|
1953
1956
|
}
|
|
1954
1957
|
t.push({
|
|
1955
|
-
key: `sys-${
|
|
1958
|
+
key: `sys-${ee(s)}`,
|
|
1956
1959
|
role: o,
|
|
1957
1960
|
messages: [s],
|
|
1958
1961
|
items: [],
|
|
@@ -1960,9 +1963,9 @@ const ds = {
|
|
|
1960
1963
|
});
|
|
1961
1964
|
continue;
|
|
1962
1965
|
}
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1965
|
-
key: `g-${
|
|
1966
|
+
const d = t[t.length - 1];
|
|
1967
|
+
d && d.role === o && (o === "ai" || d.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? d.messages.push(s) : t.push({
|
|
1968
|
+
key: `g-${ee(s)}`,
|
|
1966
1969
|
role: o,
|
|
1967
1970
|
agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
|
|
1968
1971
|
agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
|
|
@@ -1973,8 +1976,8 @@ const ds = {
|
|
|
1973
1976
|
for (const s of t) {
|
|
1974
1977
|
if (s.role === "system") continue;
|
|
1975
1978
|
const o = [];
|
|
1976
|
-
for (const
|
|
1977
|
-
for (const v of this.itemsOf(
|
|
1979
|
+
for (const d of s.messages)
|
|
1980
|
+
for (const v of this.itemsOf(d)) o.push(v);
|
|
1978
1981
|
s.items = o;
|
|
1979
1982
|
}
|
|
1980
1983
|
return t;
|
|
@@ -2013,13 +2016,13 @@ const ds = {
|
|
|
2013
2016
|
this.scheduleMeasure();
|
|
2014
2017
|
},
|
|
2015
2018
|
methods: {
|
|
2016
|
-
messageKey:
|
|
2019
|
+
messageKey: ee,
|
|
2017
2020
|
isAtBottom(t) {
|
|
2018
|
-
return t.scrollHeight - t.scrollTop - t.clientHeight <=
|
|
2021
|
+
return t.scrollHeight - t.scrollTop - t.clientHeight <= ms;
|
|
2019
2022
|
},
|
|
2020
2023
|
onScroll() {
|
|
2021
2024
|
const t = this.$refs.scrollEl;
|
|
2022
|
-
t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <=
|
|
2025
|
+
t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= fs && (this._pendingLoadMore = !0, this.$emit("load-more")));
|
|
2023
2026
|
},
|
|
2024
2027
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
2025
2028
|
//
|
|
@@ -2194,10 +2197,10 @@ const ds = {
|
|
|
2194
2197
|
// adjacent à une `bubble`) : mon coin déborde le voisin et
|
|
2195
2198
|
// doit garder son arrondi.
|
|
2196
2199
|
cornersFor(t, e) {
|
|
2197
|
-
var Y,
|
|
2198
|
-
const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (
|
|
2199
|
-
let
|
|
2200
|
-
return o ? (k && (
|
|
2200
|
+
var Y, z, Q;
|
|
2201
|
+
const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Q = n[e + 1]) == null ? void 0 : Q.kind, o = t.role === "user", d = 14, v = 4, k = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], R = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, Z) => W != null && S != null ? W + U >= S : V === Z || V === "card" && Z === "bubble";
|
|
2202
|
+
let j = d, P = d, F = d, H = d;
|
|
2203
|
+
return o ? (k && (P = v), (w || !s) && (F = v), k && x(R, k, a == null ? void 0 : a.top) && (j = v), w && x(A, w, a == null ? void 0 : a.bottom) && (H = v)) : (k && (j = v), (w || !s) && (H = v), k && x(R, k, a == null ? void 0 : a.top) && (P = v), w && x(A, w, a == null ? void 0 : a.bottom) && (F = v)), { tl: j, tr: P, br: F, bl: H };
|
|
2201
2204
|
},
|
|
2202
2205
|
// Inline style emitting the four corner CSS variables. Set on
|
|
2203
2206
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -2218,7 +2221,7 @@ const ds = {
|
|
|
2218
2221
|
rowKeyOf(t, e) {
|
|
2219
2222
|
var a;
|
|
2220
2223
|
const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
|
|
2221
|
-
return n ? `${
|
|
2224
|
+
return n ? `${ee(n.message)}-${n.partKey}` : "";
|
|
2222
2225
|
},
|
|
2223
2226
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
2224
2227
|
// typing, scroll), un seul flush layout par frame suffit.
|
|
@@ -2238,9 +2241,9 @@ const ds = {
|
|
|
2238
2241
|
for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
|
|
2239
2242
|
const o = s.dataset.rowKey;
|
|
2240
2243
|
if (!o) continue;
|
|
2241
|
-
const
|
|
2242
|
-
if (!
|
|
2243
|
-
const v =
|
|
2244
|
+
const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
|
|
2245
|
+
if (!d) continue;
|
|
2246
|
+
const v = d.getBoundingClientRect().width;
|
|
2244
2247
|
v > 0 && (e[o] = v);
|
|
2245
2248
|
}
|
|
2246
2249
|
const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
|
|
@@ -2259,7 +2262,7 @@ const ds = {
|
|
|
2259
2262
|
const e = t.items[t.items.length - 1], n = (e == null ? void 0 : e.message) || t.messages[t.messages.length - 1];
|
|
2260
2263
|
if (!(n != null && n.created_at)) return "";
|
|
2261
2264
|
try {
|
|
2262
|
-
return
|
|
2265
|
+
return ke(new Date(n.created_at));
|
|
2263
2266
|
} catch {
|
|
2264
2267
|
return "";
|
|
2265
2268
|
}
|
|
@@ -2292,9 +2295,9 @@ const ds = {
|
|
|
2292
2295
|
return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
|
|
2293
2296
|
},
|
|
2294
2297
|
actionDetail(t) {
|
|
2295
|
-
var n, a, r, s, o,
|
|
2298
|
+
var n, a, r, s, o, d;
|
|
2296
2299
|
const e = t == null ? void 0 : t.payload;
|
|
2297
|
-
return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((
|
|
2300
|
+
return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
|
|
2298
2301
|
},
|
|
2299
2302
|
actionArtifact(t) {
|
|
2300
2303
|
var n, a;
|
|
@@ -2303,7 +2306,7 @@ const ds = {
|
|
|
2303
2306
|
},
|
|
2304
2307
|
systemLabel(t) {
|
|
2305
2308
|
var r, s, o;
|
|
2306
|
-
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n =
|
|
2309
|
+
const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = hs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
|
|
2307
2310
|
return n.replace("{name}", a || "Un agent");
|
|
2308
2311
|
},
|
|
2309
2312
|
scrollToBottom() {
|
|
@@ -2311,85 +2314,85 @@ const ds = {
|
|
|
2311
2314
|
t && (t.scrollTop = t.scrollHeight);
|
|
2312
2315
|
}
|
|
2313
2316
|
}
|
|
2314
|
-
},
|
|
2317
|
+
}, ps = {
|
|
2315
2318
|
key: 0,
|
|
2316
2319
|
class: "wm-list__loadMore",
|
|
2317
2320
|
role: "status",
|
|
2318
2321
|
"aria-live": "polite"
|
|
2319
|
-
},
|
|
2322
|
+
}, vs = {
|
|
2320
2323
|
key: 1,
|
|
2321
2324
|
class: "wm-list__historyEnd"
|
|
2322
|
-
},
|
|
2325
|
+
}, gs = {
|
|
2323
2326
|
key: 2,
|
|
2324
2327
|
class: "wm-list__sep"
|
|
2325
|
-
},
|
|
2328
|
+
}, ys = { class: "wm-list__sep-label" }, ws = {
|
|
2326
2329
|
key: 0,
|
|
2327
2330
|
class: "wm-list__sep wm-list__sep--unread"
|
|
2328
|
-
},
|
|
2331
|
+
}, bs = {
|
|
2329
2332
|
key: 0,
|
|
2330
2333
|
class: "wm-list__sysep"
|
|
2331
|
-
},
|
|
2334
|
+
}, ks = { class: "wm-list__sysep-label" }, Cs = ["data-row-key"], As = {
|
|
2332
2335
|
key: 0,
|
|
2333
2336
|
class: "wm-list__avatarSlot"
|
|
2334
|
-
},
|
|
2337
|
+
}, Ss = {
|
|
2335
2338
|
key: 5,
|
|
2336
2339
|
class: "wm-list__body"
|
|
2337
|
-
},
|
|
2340
|
+
}, xs = { key: 0 }, Ts = {
|
|
2338
2341
|
key: 1,
|
|
2339
2342
|
"aria-hidden": "true"
|
|
2340
|
-
},
|
|
2343
|
+
}, Ms = { key: 2 }, Os = {
|
|
2341
2344
|
key: 3,
|
|
2342
2345
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
2343
|
-
},
|
|
2344
|
-
function
|
|
2345
|
-
const o = I("AIAvatar"),
|
|
2346
|
-
return l(),
|
|
2346
|
+
}, Is = { class: "wm-list__avatarSlot" };
|
|
2347
|
+
function Bs(t, e, n, a, r, s) {
|
|
2348
|
+
const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
|
|
2349
|
+
return l(), c("div", {
|
|
2347
2350
|
ref: "scrollEl",
|
|
2348
2351
|
class: B(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
2349
2352
|
onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
|
|
2350
2353
|
}, [
|
|
2351
|
-
n.loadingMore ? (l(),
|
|
2354
|
+
n.loadingMore ? (l(), c("div", ps, [...e[1] || (e[1] = [
|
|
2352
2355
|
i("span", {
|
|
2353
2356
|
class: "wm-list__loadMore-spinner",
|
|
2354
2357
|
"aria-hidden": "true"
|
|
2355
2358
|
}, null, -1),
|
|
2356
2359
|
i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
|
|
2357
|
-
])])) : s.historyExhausted ? (l(),
|
|
2358
|
-
n.dateLabel ? (l(),
|
|
2360
|
+
])])) : s.historyExhausted ? (l(), c("div", vs, "Début de la conversation")) : g("", !0),
|
|
2361
|
+
n.dateLabel ? (l(), c("div", gs, [
|
|
2359
2362
|
e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
|
|
2360
|
-
i("span",
|
|
2363
|
+
i("span", ys, b(n.dateLabel), 1),
|
|
2361
2364
|
e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
|
|
2362
2365
|
])) : g("", !0),
|
|
2363
|
-
(l(!0),
|
|
2366
|
+
(l(!0), c(T, null, D(s.groups, (A, U) => (l(), c(T, {
|
|
2364
2367
|
key: A.key
|
|
2365
2368
|
}, [
|
|
2366
|
-
A.key === s.unreadGroupKey ? (l(),
|
|
2369
|
+
A.key === s.unreadGroupKey ? (l(), c("div", ws, [...e[4] || (e[4] = [
|
|
2367
2370
|
i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
|
|
2368
2371
|
i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
|
|
2369
2372
|
i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
|
|
2370
2373
|
])])) : g("", !0),
|
|
2371
|
-
A.role === "system" || A.items.length ? (l(),
|
|
2374
|
+
A.role === "system" || A.items.length ? (l(), c("div", {
|
|
2372
2375
|
key: 1,
|
|
2373
2376
|
class: B(["wm-list__group", "wm-list__group--" + A.role])
|
|
2374
2377
|
}, [
|
|
2375
|
-
A.role === "system" ? (l(),
|
|
2378
|
+
A.role === "system" ? (l(), c("div", bs, [
|
|
2376
2379
|
e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
2377
|
-
i("span",
|
|
2380
|
+
i("span", ks, b(A.systemLabel), 1),
|
|
2378
2381
|
e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
2379
|
-
])) : (l(),
|
|
2380
|
-
(l(!0),
|
|
2382
|
+
])) : (l(), c(T, { key: 1 }, [
|
|
2383
|
+
(l(!0), c(T, null, D(A.items, (x, j) => (l(), c("div", {
|
|
2381
2384
|
key: `${s.messageKey(x.message)}-${x.partKey}`,
|
|
2382
2385
|
"data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
|
|
2383
2386
|
class: B(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
|
|
2384
|
-
style: G(s.cornersStyle(A,
|
|
2387
|
+
style: G(s.cornersStyle(A, j))
|
|
2385
2388
|
}, [
|
|
2386
|
-
A.role !== "user" ? (l(),
|
|
2387
|
-
|
|
2389
|
+
A.role !== "user" ? (l(), c("div", As, [
|
|
2390
|
+
j === A.items.length - 1 ? (l(), c(T, { key: 0 }, [
|
|
2388
2391
|
A.role === "ai" ? (l(), $(o, {
|
|
2389
2392
|
key: 0,
|
|
2390
2393
|
size: 26,
|
|
2391
2394
|
tail: !0
|
|
2392
|
-
})) : (l(), $(
|
|
2395
|
+
})) : (l(), $(d, {
|
|
2393
2396
|
key: 1,
|
|
2394
2397
|
name: A.agentName,
|
|
2395
2398
|
"avatar-url": A.agentAvatarUrl,
|
|
@@ -2413,36 +2416,36 @@ function Os(t, e, n, a, r, s) {
|
|
|
2413
2416
|
}, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
|
|
2414
2417
|
key: 4,
|
|
2415
2418
|
artifact: s.artifactOf(x.message)
|
|
2416
|
-
}, null, 8, ["artifact"])) : (l(),
|
|
2419
|
+
}, null, 8, ["artifact"])) : (l(), c("div", Ss, [
|
|
2417
2420
|
x.message.text_md ? (l(), $(w, {
|
|
2418
2421
|
key: 0,
|
|
2419
2422
|
role: A.role,
|
|
2420
2423
|
text: x.message.text_md
|
|
2421
2424
|
}, null, 8, ["role", "text"])) : g("", !0),
|
|
2422
|
-
s.attachmentsOf(x.message).length ? (l(),
|
|
2425
|
+
s.attachmentsOf(x.message).length ? (l(), c("div", {
|
|
2423
2426
|
key: 1,
|
|
2424
2427
|
class: B(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
|
|
2425
2428
|
}, [
|
|
2426
|
-
(l(!0),
|
|
2427
|
-
key: `${s.messageKey(x.message)}-att-${
|
|
2428
|
-
attachment:
|
|
2429
|
+
(l(!0), c(T, null, D(s.attachmentsOf(x.message), (P, F) => (l(), $(S, {
|
|
2430
|
+
key: `${s.messageKey(x.message)}-att-${F}`,
|
|
2431
|
+
attachment: P
|
|
2429
2432
|
}, null, 8, ["attachment"]))), 128))
|
|
2430
2433
|
], 2)) : g("", !0)
|
|
2431
2434
|
]))
|
|
2432
|
-
], 14,
|
|
2433
|
-
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(),
|
|
2435
|
+
], 14, Cs))), 128)),
|
|
2436
|
+
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(), c("div", {
|
|
2434
2437
|
key: 0,
|
|
2435
2438
|
class: B(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
2436
2439
|
}, [
|
|
2437
|
-
A.role !== "user" ? (l(),
|
|
2438
|
-
A.role !== "user" && s.lastTimeOf(A) ? (l(),
|
|
2439
|
-
s.lastTimeOf(A) ? (l(),
|
|
2440
|
+
A.role !== "user" ? (l(), c("span", xs, b(s.roleLabel(A)), 1)) : g("", !0),
|
|
2441
|
+
A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : g("", !0),
|
|
2442
|
+
s.lastTimeOf(A) ? (l(), c("span", Ms, b(s.lastTimeOf(A)), 1)) : g("", !0)
|
|
2440
2443
|
], 2)) : g("", !0)
|
|
2441
2444
|
], 64))
|
|
2442
2445
|
], 2)) : g("", !0)
|
|
2443
2446
|
], 64))), 128)),
|
|
2444
|
-
n.streamingActive ? (l(),
|
|
2445
|
-
i("div",
|
|
2447
|
+
n.streamingActive ? (l(), c("div", Os, [
|
|
2448
|
+
i("div", Is, [
|
|
2446
2449
|
K(o, {
|
|
2447
2450
|
size: 26,
|
|
2448
2451
|
tail: !0
|
|
@@ -2452,9 +2455,9 @@ function Os(t, e, n, a, r, s) {
|
|
|
2452
2455
|
])) : g("", !0)
|
|
2453
2456
|
], 34);
|
|
2454
2457
|
}
|
|
2455
|
-
const
|
|
2456
|
-
function
|
|
2457
|
-
return
|
|
2458
|
+
const Es = /* @__PURE__ */ E(_s, [["render", Bs], ["__scopeId", "data-v-6bd35fa5"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
2459
|
+
function $s() {
|
|
2460
|
+
return me && [
|
|
2458
2461
|
"video/webm;codecs=vp9,opus",
|
|
2459
2462
|
"video/webm;codecs=vp8,opus",
|
|
2460
2463
|
"video/webm",
|
|
@@ -2464,7 +2467,7 @@ function Bs() {
|
|
|
2464
2467
|
return (a = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : a.call(n, e);
|
|
2465
2468
|
}) || "";
|
|
2466
2469
|
}
|
|
2467
|
-
function
|
|
2470
|
+
function Ae({ audio: t }) {
|
|
2468
2471
|
return {
|
|
2469
2472
|
video: !0,
|
|
2470
2473
|
audio: !!t,
|
|
@@ -2473,19 +2476,19 @@ function Ce({ audio: t }) {
|
|
|
2473
2476
|
systemAudio: t ? "include" : "exclude"
|
|
2474
2477
|
};
|
|
2475
2478
|
}
|
|
2476
|
-
function
|
|
2479
|
+
function na(t) {
|
|
2477
2480
|
return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
|
|
2478
2481
|
}
|
|
2479
|
-
async function
|
|
2480
|
-
if (!
|
|
2482
|
+
async function Ls() {
|
|
2483
|
+
if (!oe) return null;
|
|
2481
2484
|
let t;
|
|
2482
2485
|
try {
|
|
2483
|
-
t = await navigator.mediaDevices.getDisplayMedia(
|
|
2486
|
+
t = await navigator.mediaDevices.getDisplayMedia(Ae({ audio: !1 }));
|
|
2484
2487
|
} catch (e) {
|
|
2485
2488
|
return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
|
|
2486
2489
|
}
|
|
2487
2490
|
try {
|
|
2488
|
-
return await
|
|
2491
|
+
return await Rs(t);
|
|
2489
2492
|
} catch (e) {
|
|
2490
2493
|
return console.error("[media] screenshot capture", e), null;
|
|
2491
2494
|
} finally {
|
|
@@ -2494,26 +2497,26 @@ async function Es() {
|
|
|
2494
2497
|
});
|
|
2495
2498
|
}
|
|
2496
2499
|
}
|
|
2497
|
-
async function
|
|
2500
|
+
async function Rs(t) {
|
|
2498
2501
|
const e = document.createElement("video");
|
|
2499
|
-
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((
|
|
2502
|
+
e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
|
|
2500
2503
|
const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
|
|
2501
2504
|
r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
|
|
2502
|
-
const s = await new Promise((
|
|
2503
|
-
r.toBlob((k) => k ?
|
|
2505
|
+
const s = await new Promise((d, v) => {
|
|
2506
|
+
r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
|
|
2504
2507
|
}), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
2505
2508
|
return new File([s], `capture-${o}.png`, { type: "image/png" });
|
|
2506
2509
|
}
|
|
2507
|
-
async function
|
|
2510
|
+
async function Fs(t = {}) {
|
|
2508
2511
|
var k;
|
|
2509
|
-
if (!
|
|
2512
|
+
if (!oe || !me) return null;
|
|
2510
2513
|
let e;
|
|
2511
2514
|
try {
|
|
2512
|
-
e = await navigator.mediaDevices.getDisplayMedia(
|
|
2515
|
+
e = await navigator.mediaDevices.getDisplayMedia(Ae({ audio: !0 }));
|
|
2513
2516
|
} catch (w) {
|
|
2514
2517
|
return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
|
|
2515
2518
|
}
|
|
2516
|
-
const n =
|
|
2519
|
+
const n = $s();
|
|
2517
2520
|
let a;
|
|
2518
2521
|
try {
|
|
2519
2522
|
a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
|
|
@@ -2531,14 +2534,14 @@ async function $s(t = {}) {
|
|
|
2531
2534
|
if (s && clearInterval(s), e.getTracks().forEach((R) => {
|
|
2532
2535
|
R.stop();
|
|
2533
2536
|
}), r.length) {
|
|
2534
|
-
const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }),
|
|
2535
|
-
(w = t.onfinalize) == null || w.call(t,
|
|
2537
|
+
const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }), U = /mp4/.test(R) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), j = new File([A], `ecran-${x}.${U}`, { type: R });
|
|
2538
|
+
(w = t.onfinalize) == null || w.call(t, j);
|
|
2536
2539
|
} else
|
|
2537
2540
|
(S = t.oncancel) == null || S.call(t);
|
|
2538
2541
|
}), e.getVideoTracks().forEach((w) => {
|
|
2539
|
-
w.addEventListener("ended", () =>
|
|
2542
|
+
w.addEventListener("ended", () => d(), { once: !0 });
|
|
2540
2543
|
});
|
|
2541
|
-
function
|
|
2544
|
+
function d() {
|
|
2542
2545
|
if (!o && (o = !0, a.state !== "inactive"))
|
|
2543
2546
|
try {
|
|
2544
2547
|
a.stop();
|
|
@@ -2559,13 +2562,13 @@ async function $s(t = {}) {
|
|
|
2559
2562
|
var w;
|
|
2560
2563
|
(w = t.ontick) == null || w.call(t, Date.now() - v);
|
|
2561
2564
|
}, 500), {
|
|
2562
|
-
stop:
|
|
2565
|
+
stop: d,
|
|
2563
2566
|
get state() {
|
|
2564
2567
|
return a.state;
|
|
2565
2568
|
}
|
|
2566
2569
|
};
|
|
2567
2570
|
}
|
|
2568
|
-
const
|
|
2571
|
+
const Ds = [
|
|
2569
2572
|
{
|
|
2570
2573
|
action: "file",
|
|
2571
2574
|
label: "Joindre un fichier",
|
|
@@ -2581,7 +2584,7 @@ const Rs = [
|
|
|
2581
2584
|
label: "Enregistrer l'écran",
|
|
2582
2585
|
path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
|
|
2583
2586
|
}
|
|
2584
|
-
],
|
|
2587
|
+
], Ns = {
|
|
2585
2588
|
name: "WmComposer",
|
|
2586
2589
|
props: {
|
|
2587
2590
|
modelValue: { type: String, default: "" },
|
|
@@ -2604,9 +2607,9 @@ const Rs = [
|
|
|
2604
2607
|
return !this.disabled && !!this.local.trim();
|
|
2605
2608
|
},
|
|
2606
2609
|
attachItems() {
|
|
2607
|
-
return
|
|
2610
|
+
return Ds.map((t) => ({
|
|
2608
2611
|
...t,
|
|
2609
|
-
disabled: t.action === "screenshot" && !
|
|
2612
|
+
disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !me)
|
|
2610
2613
|
}));
|
|
2611
2614
|
},
|
|
2612
2615
|
recordingElapsedLabel() {
|
|
@@ -2676,13 +2679,13 @@ const Rs = [
|
|
|
2676
2679
|
},
|
|
2677
2680
|
async captureScreenshot() {
|
|
2678
2681
|
if (this.disabled) return;
|
|
2679
|
-
const t = await
|
|
2682
|
+
const t = await Ls();
|
|
2680
2683
|
t && this.$emit("attach", t);
|
|
2681
2684
|
},
|
|
2682
2685
|
async startRecording() {
|
|
2683
2686
|
if (this.recording || this.disabled) return;
|
|
2684
2687
|
this.recordingElapsed = 0;
|
|
2685
|
-
const t = await
|
|
2688
|
+
const t = await Fs({
|
|
2686
2689
|
onstart: () => {
|
|
2687
2690
|
this.recording = !0;
|
|
2688
2691
|
},
|
|
@@ -2707,27 +2710,27 @@ const Rs = [
|
|
|
2707
2710
|
}
|
|
2708
2711
|
}
|
|
2709
2712
|
}
|
|
2710
|
-
}, js = { class: "wm-compose-wrap" },
|
|
2713
|
+
}, js = { class: "wm-compose-wrap" }, Us = {
|
|
2711
2714
|
key: 0,
|
|
2712
2715
|
class: "wm-rec"
|
|
2713
|
-
},
|
|
2716
|
+
}, Ps = { class: "wm-rec__lbl" }, Hs = {
|
|
2714
2717
|
key: 1,
|
|
2715
2718
|
class: "wm-compose__menu",
|
|
2716
2719
|
role: "menu"
|
|
2717
|
-
},
|
|
2720
|
+
}, zs = ["disabled", "onClick"], Vs = { class: "wm-compose__menuIcon" }, qs = {
|
|
2718
2721
|
viewBox: "0 0 24 24",
|
|
2719
2722
|
width: "14",
|
|
2720
2723
|
height: "14",
|
|
2721
2724
|
"aria-hidden": "true"
|
|
2722
|
-
},
|
|
2723
|
-
function
|
|
2724
|
-
return l(),
|
|
2725
|
-
r.recording ? (l(),
|
|
2725
|
+
}, Ws = ["d"], Ks = ["placeholder", "disabled"], Gs = { class: "wm-compose__actions" }, Ys = ["title", "aria-label", "disabled"], Js = ["disabled"];
|
|
2726
|
+
function Xs(t, e, n, a, r, s) {
|
|
2727
|
+
return l(), c("div", js, [
|
|
2728
|
+
r.recording ? (l(), c("div", Us, [
|
|
2726
2729
|
e[8] || (e[8] = i("span", {
|
|
2727
2730
|
class: "wm-rec__dot",
|
|
2728
2731
|
"aria-hidden": "true"
|
|
2729
2732
|
}, null, -1)),
|
|
2730
|
-
i("span",
|
|
2733
|
+
i("span", Ps, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
|
|
2731
2734
|
i("button", {
|
|
2732
2735
|
type: "button",
|
|
2733
2736
|
class: "wm-rec__stop",
|
|
@@ -2736,7 +2739,7 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2736
2739
|
])) : g("", !0),
|
|
2737
2740
|
i("form", {
|
|
2738
2741
|
class: B(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
2739
|
-
onSubmit: e[7] || (e[7] =
|
|
2742
|
+
onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
|
|
2740
2743
|
}, [
|
|
2741
2744
|
i("input", {
|
|
2742
2745
|
ref: "fileEl",
|
|
@@ -2745,21 +2748,21 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2745
2748
|
multiple: "",
|
|
2746
2749
|
onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
|
|
2747
2750
|
}, null, 544),
|
|
2748
|
-
r.attachOpen ? (l(),
|
|
2751
|
+
r.attachOpen ? (l(), c("div", {
|
|
2749
2752
|
key: 0,
|
|
2750
2753
|
class: "wm-compose__overlay",
|
|
2751
2754
|
onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
|
|
2752
2755
|
})) : g("", !0),
|
|
2753
|
-
r.attachOpen ? (l(),
|
|
2754
|
-
(l(!0),
|
|
2756
|
+
r.attachOpen ? (l(), c("div", Hs, [
|
|
2757
|
+
(l(!0), c(T, null, D(s.attachItems, (o) => (l(), c("button", {
|
|
2755
2758
|
key: o.action,
|
|
2756
2759
|
type: "button",
|
|
2757
2760
|
class: "wm-compose__menuItem",
|
|
2758
2761
|
disabled: o.disabled,
|
|
2759
|
-
onClick: (
|
|
2762
|
+
onClick: (d) => s.onAttachAction(o.action)
|
|
2760
2763
|
}, [
|
|
2761
|
-
i("span",
|
|
2762
|
-
(l(),
|
|
2764
|
+
i("span", Vs, [
|
|
2765
|
+
(l(), c("svg", qs, [
|
|
2763
2766
|
i("path", {
|
|
2764
2767
|
d: o.path,
|
|
2765
2768
|
stroke: "currentColor",
|
|
@@ -2767,13 +2770,13 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2767
2770
|
"stroke-linecap": "round",
|
|
2768
2771
|
"stroke-linejoin": "round",
|
|
2769
2772
|
fill: "none"
|
|
2770
|
-
}, null, 8,
|
|
2773
|
+
}, null, 8, Ws)
|
|
2771
2774
|
]))
|
|
2772
2775
|
]),
|
|
2773
2776
|
i("span", null, b(o.label), 1)
|
|
2774
|
-
], 8,
|
|
2777
|
+
], 8, zs))), 128))
|
|
2775
2778
|
])) : g("", !0),
|
|
2776
|
-
|
|
2779
|
+
q(i("textarea", {
|
|
2777
2780
|
ref: "inputEl",
|
|
2778
2781
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
|
|
2779
2782
|
class: "wm-compose__input",
|
|
@@ -2782,10 +2785,10 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2782
2785
|
disabled: n.disabled,
|
|
2783
2786
|
onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
|
|
2784
2787
|
onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
|
|
2785
|
-
}, null, 40,
|
|
2786
|
-
[
|
|
2788
|
+
}, null, 40, Ks), [
|
|
2789
|
+
[J, r.local]
|
|
2787
2790
|
]),
|
|
2788
|
-
i("div",
|
|
2791
|
+
i("div", Gs, [
|
|
2789
2792
|
i("button", {
|
|
2790
2793
|
type: "button",
|
|
2791
2794
|
class: B(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
@@ -2807,7 +2810,7 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2807
2810
|
}, [
|
|
2808
2811
|
i("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
|
|
2809
2812
|
], -1)
|
|
2810
|
-
])], 10,
|
|
2813
|
+
])], 10, Ys),
|
|
2811
2814
|
i("button", {
|
|
2812
2815
|
type: "submit",
|
|
2813
2816
|
class: B(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
@@ -2827,12 +2830,12 @@ function Ys(t, e, n, a, r, s) {
|
|
|
2827
2830
|
}, [
|
|
2828
2831
|
i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
2829
2832
|
], -1)
|
|
2830
|
-
])], 10,
|
|
2833
|
+
])], 10, Js)
|
|
2831
2834
|
])
|
|
2832
2835
|
], 34)
|
|
2833
2836
|
]);
|
|
2834
2837
|
}
|
|
2835
|
-
const
|
|
2838
|
+
const Qs = /* @__PURE__ */ E(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0"]]), Zs = {
|
|
2836
2839
|
name: "WmSuggestionChips",
|
|
2837
2840
|
props: {
|
|
2838
2841
|
items: { type: Array, default: () => [] },
|
|
@@ -2849,22 +2852,22 @@ const Js = /* @__PURE__ */ E(Fs, [["render", Ys], ["__scopeId", "data-v-14fa9ec0
|
|
|
2849
2852
|
return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
|
|
2850
2853
|
}
|
|
2851
2854
|
}
|
|
2852
|
-
},
|
|
2853
|
-
function
|
|
2854
|
-
return n.items.length ? (l(),
|
|
2855
|
+
}, er = ["onClick"];
|
|
2856
|
+
function tr(t, e, n, a, r, s) {
|
|
2857
|
+
return n.items.length ? (l(), c("div", {
|
|
2855
2858
|
key: s.batchKey,
|
|
2856
2859
|
class: "wm-chips"
|
|
2857
2860
|
}, [
|
|
2858
|
-
(l(!0),
|
|
2859
|
-
key:
|
|
2861
|
+
(l(!0), c(T, null, D(n.items, (o, d) => (l(), c("button", {
|
|
2862
|
+
key: d,
|
|
2860
2863
|
type: "button",
|
|
2861
2864
|
class: "wm-chip",
|
|
2862
|
-
style: G({ animationDelay: n.baseDelay +
|
|
2865
|
+
style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
|
|
2863
2866
|
onClick: (v) => t.$emit("select", o)
|
|
2864
|
-
}, b(o.label), 13,
|
|
2867
|
+
}, b(o.label), 13, er))), 128))
|
|
2865
2868
|
])) : g("", !0);
|
|
2866
2869
|
}
|
|
2867
|
-
const
|
|
2870
|
+
const nr = /* @__PURE__ */ E(Zs, [["render", tr], ["__scopeId", "data-v-55aa529d"]]), sr = {
|
|
2868
2871
|
name: "WmApprovalCard",
|
|
2869
2872
|
components: { AIAvatar: te },
|
|
2870
2873
|
props: {
|
|
@@ -2897,41 +2900,41 @@ const er = /* @__PURE__ */ E(Xs, [["render", Zs], ["__scopeId", "data-v-55aa529d
|
|
|
2897
2900
|
return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
|
|
2898
2901
|
}
|
|
2899
2902
|
}
|
|
2900
|
-
},
|
|
2903
|
+
}, rr = { class: "wm-approval" }, ir = { class: "wm-approval__head" }, ar = { class: "wm-approval__icon" }, or = { class: "wm-approval__main" }, lr = { class: "wm-approval__title" }, dr = {
|
|
2901
2904
|
key: 0,
|
|
2902
2905
|
class: "wm-approval__detail"
|
|
2903
|
-
},
|
|
2904
|
-
function
|
|
2906
|
+
}, cr = { class: "wm-approval__actions" };
|
|
2907
|
+
function ur(t, e, n, a, r, s) {
|
|
2905
2908
|
const o = I("AIAvatar");
|
|
2906
|
-
return l(),
|
|
2907
|
-
i("div",
|
|
2908
|
-
i("div",
|
|
2909
|
+
return l(), c("div", rr, [
|
|
2910
|
+
i("div", ir, [
|
|
2911
|
+
i("div", ar, [
|
|
2909
2912
|
K(o, { size: 24 })
|
|
2910
2913
|
]),
|
|
2911
|
-
i("div",
|
|
2912
|
-
i("div",
|
|
2913
|
-
n.detail ? (l(),
|
|
2914
|
+
i("div", or, [
|
|
2915
|
+
i("div", lr, b(n.action), 1),
|
|
2916
|
+
n.detail ? (l(), c("div", dr, b(n.detail), 1)) : g("", !0)
|
|
2914
2917
|
])
|
|
2915
2918
|
]),
|
|
2916
|
-
i("div",
|
|
2917
|
-
s.rejectId ? (l(),
|
|
2919
|
+
i("div", cr, [
|
|
2920
|
+
s.rejectId ? (l(), c("button", {
|
|
2918
2921
|
key: 0,
|
|
2919
2922
|
type: "button",
|
|
2920
2923
|
class: "wm-approval__btn wm-approval__btn--neutral",
|
|
2921
|
-
onClick: e[0] || (e[0] = (
|
|
2924
|
+
onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
|
|
2922
2925
|
}, b(s.rejectLabel), 1)) : g("", !0),
|
|
2923
|
-
s.approveId ? (l(),
|
|
2926
|
+
s.approveId ? (l(), c("button", {
|
|
2924
2927
|
key: 1,
|
|
2925
2928
|
type: "button",
|
|
2926
2929
|
class: "wm-approval__btn wm-approval__btn--primary",
|
|
2927
|
-
onClick: e[1] || (e[1] = (
|
|
2930
|
+
onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
|
|
2928
2931
|
}, b(s.approveLabel), 1)) : g("", !0)
|
|
2929
2932
|
])
|
|
2930
2933
|
]);
|
|
2931
2934
|
}
|
|
2932
|
-
const
|
|
2933
|
-
let
|
|
2934
|
-
const
|
|
2935
|
+
const hr = /* @__PURE__ */ E(sr, [["render", ur], ["__scopeId", "data-v-b1be139c"]]);
|
|
2936
|
+
let ge = 0;
|
|
2937
|
+
const mr = /* @__PURE__ */ new Set([
|
|
2935
2938
|
"text",
|
|
2936
2939
|
"textarea",
|
|
2937
2940
|
"number",
|
|
@@ -2939,7 +2942,7 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
2939
2942
|
"select",
|
|
2940
2943
|
"multiselect",
|
|
2941
2944
|
"date"
|
|
2942
|
-
]),
|
|
2945
|
+
]), fr = {
|
|
2943
2946
|
name: "WmFormCard",
|
|
2944
2947
|
components: { AIAvatar: te },
|
|
2945
2948
|
props: {
|
|
@@ -2949,8 +2952,8 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
2949
2952
|
},
|
|
2950
2953
|
emits: ["submit"],
|
|
2951
2954
|
data() {
|
|
2952
|
-
return
|
|
2953
|
-
_uid:
|
|
2955
|
+
return ge += 1, {
|
|
2956
|
+
_uid: ge,
|
|
2954
2957
|
values: {},
|
|
2955
2958
|
busy: !1,
|
|
2956
2959
|
error: ""
|
|
@@ -2962,7 +2965,7 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
2962
2965
|
// douteux.
|
|
2963
2966
|
normalizedFields() {
|
|
2964
2967
|
var e;
|
|
2965
|
-
return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
2968
|
+
return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !mr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
2966
2969
|
}
|
|
2967
2970
|
},
|
|
2968
2971
|
created() {
|
|
@@ -3013,163 +3016,163 @@ const ur = /* @__PURE__ */ new Set([
|
|
|
3013
3016
|
}
|
|
3014
3017
|
}
|
|
3015
3018
|
}
|
|
3016
|
-
},
|
|
3019
|
+
}, _r = { class: "wm-form" }, pr = { class: "wm-form__head" }, vr = { class: "wm-form__icon" }, gr = { class: "wm-form__main" }, yr = { class: "wm-form__title" }, wr = {
|
|
3017
3020
|
key: 0,
|
|
3018
3021
|
class: "wm-form__detail"
|
|
3019
|
-
},
|
|
3022
|
+
}, br = ["for"], kr = {
|
|
3020
3023
|
key: 0,
|
|
3021
3024
|
class: "wm-form__req",
|
|
3022
3025
|
"aria-hidden": "true"
|
|
3023
|
-
},
|
|
3026
|
+
}, Cr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ar = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Sr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], xr = ["id", "onUpdate:modelValue", "required", "disabled"], Tr = {
|
|
3024
3027
|
key: 4,
|
|
3025
3028
|
class: "wm-form__bool"
|
|
3026
|
-
},
|
|
3029
|
+
}, Mr = ["id", "onUpdate:modelValue", "disabled"], Or = ["id", "onUpdate:modelValue", "required", "disabled"], Ir = {
|
|
3027
3030
|
value: "",
|
|
3028
3031
|
disabled: ""
|
|
3029
|
-
},
|
|
3032
|
+
}, Br = ["value"], Er = {
|
|
3030
3033
|
key: 6,
|
|
3031
3034
|
class: "wm-form__multi"
|
|
3032
|
-
},
|
|
3035
|
+
}, $r = ["value", "checked", "disabled", "onChange"], Lr = {
|
|
3033
3036
|
key: 0,
|
|
3034
3037
|
class: "wm-form__err"
|
|
3035
|
-
},
|
|
3038
|
+
}, Rr = ["disabled"], Fr = {
|
|
3036
3039
|
key: 0,
|
|
3037
3040
|
class: "wm-form__spinner",
|
|
3038
3041
|
"aria-hidden": "true"
|
|
3039
|
-
},
|
|
3042
|
+
}, Dr = {
|
|
3040
3043
|
key: 2,
|
|
3041
3044
|
class: "wm-form__doneLbl"
|
|
3042
3045
|
};
|
|
3043
|
-
function
|
|
3046
|
+
function Nr(t, e, n, a, r, s) {
|
|
3044
3047
|
const o = I("AIAvatar");
|
|
3045
|
-
return l(),
|
|
3046
|
-
i("div",
|
|
3047
|
-
i("div",
|
|
3048
|
+
return l(), c("div", _r, [
|
|
3049
|
+
i("div", pr, [
|
|
3050
|
+
i("div", vr, [
|
|
3048
3051
|
K(o, { size: 24 })
|
|
3049
3052
|
]),
|
|
3050
|
-
i("div",
|
|
3051
|
-
i("div",
|
|
3052
|
-
n.form.description ? (l(),
|
|
3053
|
+
i("div", gr, [
|
|
3054
|
+
i("div", yr, b(n.form.title || "Formulaire"), 1),
|
|
3055
|
+
n.form.description ? (l(), c("div", wr, b(n.form.description), 1)) : g("", !0)
|
|
3053
3056
|
])
|
|
3054
3057
|
]),
|
|
3055
3058
|
i("form", {
|
|
3056
3059
|
class: "wm-form__body",
|
|
3057
|
-
onSubmit: e[0] || (e[0] =
|
|
3060
|
+
onSubmit: e[0] || (e[0] = X((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
|
|
3058
3061
|
}, [
|
|
3059
|
-
(l(!0),
|
|
3060
|
-
key:
|
|
3062
|
+
(l(!0), c(T, null, D(s.normalizedFields, (d) => (l(), c("div", {
|
|
3063
|
+
key: d.key,
|
|
3061
3064
|
class: "wm-form__field"
|
|
3062
3065
|
}, [
|
|
3063
3066
|
i("label", {
|
|
3064
|
-
for: `wm-f-${r._uid}-${
|
|
3067
|
+
for: `wm-f-${r._uid}-${d.key}`,
|
|
3065
3068
|
class: "wm-form__label"
|
|
3066
3069
|
}, [
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
], 8,
|
|
3070
|
-
|
|
3070
|
+
de(b(d.label), 1),
|
|
3071
|
+
d.required ? (l(), c("span", kr, "*")) : g("", !0)
|
|
3072
|
+
], 8, br),
|
|
3073
|
+
d.type === "text" ? q((l(), c("input", {
|
|
3071
3074
|
key: 0,
|
|
3072
|
-
id: `wm-f-${r._uid}-${
|
|
3073
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3075
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3076
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3074
3077
|
type: "text",
|
|
3075
3078
|
class: "wm-form__input",
|
|
3076
|
-
placeholder:
|
|
3077
|
-
required:
|
|
3079
|
+
placeholder: d.placeholder || "",
|
|
3080
|
+
required: d.required,
|
|
3078
3081
|
disabled: n.readOnly || r.busy
|
|
3079
|
-
}, null, 8,
|
|
3080
|
-
[
|
|
3081
|
-
]) :
|
|
3082
|
+
}, null, 8, Cr)), [
|
|
3083
|
+
[J, r.values[d.key]]
|
|
3084
|
+
]) : d.type === "textarea" ? q((l(), c("textarea", {
|
|
3082
3085
|
key: 1,
|
|
3083
|
-
id: `wm-f-${r._uid}-${
|
|
3084
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3086
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3087
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3085
3088
|
class: "wm-form__textarea",
|
|
3086
3089
|
rows: "3",
|
|
3087
|
-
placeholder:
|
|
3088
|
-
required:
|
|
3090
|
+
placeholder: d.placeholder || "",
|
|
3091
|
+
required: d.required,
|
|
3089
3092
|
disabled: n.readOnly || r.busy
|
|
3090
|
-
}, null, 8,
|
|
3091
|
-
[
|
|
3092
|
-
]) :
|
|
3093
|
+
}, null, 8, Ar)), [
|
|
3094
|
+
[J, r.values[d.key]]
|
|
3095
|
+
]) : d.type === "number" ? q((l(), c("input", {
|
|
3093
3096
|
key: 2,
|
|
3094
|
-
id: `wm-f-${r._uid}-${
|
|
3095
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3097
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3098
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3096
3099
|
type: "number",
|
|
3097
3100
|
class: "wm-form__input",
|
|
3098
|
-
placeholder:
|
|
3099
|
-
required:
|
|
3101
|
+
placeholder: d.placeholder || "",
|
|
3102
|
+
required: d.required,
|
|
3100
3103
|
disabled: n.readOnly || r.busy
|
|
3101
|
-
}, null, 8,
|
|
3104
|
+
}, null, 8, Sr)), [
|
|
3102
3105
|
[
|
|
3103
|
-
|
|
3104
|
-
r.values[
|
|
3106
|
+
J,
|
|
3107
|
+
r.values[d.key],
|
|
3105
3108
|
void 0,
|
|
3106
3109
|
{ number: !0 }
|
|
3107
3110
|
]
|
|
3108
|
-
]) :
|
|
3111
|
+
]) : d.type === "date" ? q((l(), c("input", {
|
|
3109
3112
|
key: 3,
|
|
3110
|
-
id: `wm-f-${r._uid}-${
|
|
3111
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3113
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3114
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3112
3115
|
type: "date",
|
|
3113
3116
|
class: "wm-form__input",
|
|
3114
|
-
required:
|
|
3117
|
+
required: d.required,
|
|
3115
3118
|
disabled: n.readOnly || r.busy
|
|
3116
|
-
}, null, 8,
|
|
3117
|
-
[
|
|
3118
|
-
]) :
|
|
3119
|
-
|
|
3120
|
-
id: `wm-f-${r._uid}-${
|
|
3121
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3119
|
+
}, null, 8, xr)), [
|
|
3120
|
+
[J, r.values[d.key]]
|
|
3121
|
+
]) : d.type === "boolean" ? (l(), c("label", Tr, [
|
|
3122
|
+
q(i("input", {
|
|
3123
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3124
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3122
3125
|
type: "checkbox",
|
|
3123
3126
|
disabled: n.readOnly || r.busy
|
|
3124
|
-
}, null, 8,
|
|
3125
|
-
[
|
|
3127
|
+
}, null, 8, Mr), [
|
|
3128
|
+
[Ie, r.values[d.key]]
|
|
3126
3129
|
]),
|
|
3127
|
-
i("span", null, b(
|
|
3128
|
-
])) :
|
|
3130
|
+
i("span", null, b(d.placeholder || "Oui"), 1)
|
|
3131
|
+
])) : d.type === "select" ? q((l(), c("select", {
|
|
3129
3132
|
key: 5,
|
|
3130
|
-
id: `wm-f-${r._uid}-${
|
|
3131
|
-
"onUpdate:modelValue": (v) => r.values[
|
|
3133
|
+
id: `wm-f-${r._uid}-${d.key}`,
|
|
3134
|
+
"onUpdate:modelValue": (v) => r.values[d.key] = v,
|
|
3132
3135
|
class: "wm-form__select",
|
|
3133
|
-
required:
|
|
3136
|
+
required: d.required,
|
|
3134
3137
|
disabled: n.readOnly || r.busy
|
|
3135
3138
|
}, [
|
|
3136
|
-
i("option",
|
|
3137
|
-
(l(!0),
|
|
3139
|
+
i("option", Ir, b(d.placeholder || "Choisir…"), 1),
|
|
3140
|
+
(l(!0), c(T, null, D(d.options, (v) => (l(), c("option", {
|
|
3138
3141
|
key: v.value,
|
|
3139
3142
|
value: v.value
|
|
3140
|
-
}, b(v.label), 9,
|
|
3141
|
-
], 8,
|
|
3142
|
-
[
|
|
3143
|
-
]) :
|
|
3144
|
-
(l(!0),
|
|
3143
|
+
}, b(v.label), 9, Br))), 128))
|
|
3144
|
+
], 8, Or)), [
|
|
3145
|
+
[Be, r.values[d.key]]
|
|
3146
|
+
]) : d.type === "multiselect" ? (l(), c("div", Er, [
|
|
3147
|
+
(l(!0), c(T, null, D(d.options, (v) => (l(), c("label", {
|
|
3145
3148
|
key: v.value,
|
|
3146
3149
|
class: "wm-form__multiItem"
|
|
3147
3150
|
}, [
|
|
3148
3151
|
i("input", {
|
|
3149
3152
|
type: "checkbox",
|
|
3150
3153
|
value: v.value,
|
|
3151
|
-
checked: Array.isArray(r.values[
|
|
3154
|
+
checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
|
|
3152
3155
|
disabled: n.readOnly || r.busy,
|
|
3153
|
-
onChange: (k) => s.toggleMulti(
|
|
3154
|
-
}, null, 40,
|
|
3156
|
+
onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
|
|
3157
|
+
}, null, 40, $r),
|
|
3155
3158
|
i("span", null, b(v.label), 1)
|
|
3156
3159
|
]))), 128))
|
|
3157
3160
|
])) : g("", !0)
|
|
3158
3161
|
]))), 128)),
|
|
3159
|
-
r.error ? (l(),
|
|
3160
|
-
n.readOnly ? (l(),
|
|
3162
|
+
r.error ? (l(), c("div", Lr, b(r.error), 1)) : g("", !0),
|
|
3163
|
+
n.readOnly ? (l(), c("div", Dr, "Réponse envoyée")) : (l(), c("button", {
|
|
3161
3164
|
key: 1,
|
|
3162
3165
|
type: "submit",
|
|
3163
3166
|
class: "wm-form__submit",
|
|
3164
3167
|
disabled: r.busy
|
|
3165
3168
|
}, [
|
|
3166
|
-
r.busy ? (l(),
|
|
3169
|
+
r.busy ? (l(), c("span", Fr)) : g("", !0),
|
|
3167
3170
|
i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
|
|
3168
|
-
], 8,
|
|
3171
|
+
], 8, Rr))
|
|
3169
3172
|
], 32)
|
|
3170
3173
|
]);
|
|
3171
3174
|
}
|
|
3172
|
-
const jr = /* @__PURE__ */ E(
|
|
3175
|
+
const jr = /* @__PURE__ */ E(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76"]]), Ur = {
|
|
3173
3176
|
name: "WmFeedback",
|
|
3174
3177
|
props: {
|
|
3175
3178
|
busy: { type: Boolean, default: !1 },
|
|
@@ -3193,43 +3196,43 @@ const jr = /* @__PURE__ */ E(hr, [["render", Fr], ["__scopeId", "data-v-64b40f76
|
|
|
3193
3196
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
3194
3197
|
}
|
|
3195
3198
|
}
|
|
3196
|
-
},
|
|
3199
|
+
}, Pr = { class: "wm-fb" }, Hr = { class: "wm-fb__row" }, zr = ["onClick"], Vr = { class: "wm-fb__emoji" }, qr = { class: "wm-fb__label" }, Wr = ["disabled"], Kr = {
|
|
3197
3200
|
key: 1,
|
|
3198
3201
|
class: "wm-fb__done"
|
|
3199
3202
|
};
|
|
3200
|
-
function
|
|
3201
|
-
return l(),
|
|
3202
|
-
n.done ? (l(),
|
|
3203
|
-
|
|
3204
|
-
])])) : (l(),
|
|
3203
|
+
function Gr(t, e, n, a, r, s) {
|
|
3204
|
+
return l(), c("div", Pr, [
|
|
3205
|
+
n.done ? (l(), c("div", Kr, [...e[3] || (e[3] = [
|
|
3206
|
+
he('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
|
|
3207
|
+
])])) : (l(), c(T, { key: 0 }, [
|
|
3205
3208
|
e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
|
|
3206
3209
|
e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
|
|
3207
|
-
i("div",
|
|
3208
|
-
(l(!0),
|
|
3210
|
+
i("div", Hr, [
|
|
3211
|
+
(l(!0), c(T, null, D(r.options, (o) => (l(), c("button", {
|
|
3209
3212
|
key: o.v,
|
|
3210
3213
|
type: "button",
|
|
3211
3214
|
class: B(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
|
|
3212
|
-
onClick: (
|
|
3215
|
+
onClick: (d) => r.sel = o.v
|
|
3213
3216
|
}, [
|
|
3214
|
-
i("span",
|
|
3215
|
-
i("span",
|
|
3216
|
-
], 10,
|
|
3217
|
+
i("span", Vr, b(o.e), 1),
|
|
3218
|
+
i("span", qr, b(o.l), 1)
|
|
3219
|
+
], 10, zr))), 128))
|
|
3217
3220
|
]),
|
|
3218
3221
|
i("button", {
|
|
3219
3222
|
type: "button",
|
|
3220
3223
|
class: "wm-fb__send",
|
|
3221
3224
|
disabled: !r.sel || n.busy,
|
|
3222
3225
|
onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
|
|
3223
|
-
}, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9,
|
|
3226
|
+
}, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Wr)
|
|
3224
3227
|
], 64))
|
|
3225
3228
|
]);
|
|
3226
3229
|
}
|
|
3227
|
-
const
|
|
3228
|
-
function
|
|
3230
|
+
const Yr = /* @__PURE__ */ E(Ur, [["render", Gr], ["__scopeId", "data-v-6f45ff3b"]]);
|
|
3231
|
+
function Jr(t) {
|
|
3229
3232
|
const e = new Date(t);
|
|
3230
3233
|
return e.setHours(0, 0, 0, 0), e;
|
|
3231
3234
|
}
|
|
3232
|
-
const
|
|
3235
|
+
const Xr = {
|
|
3233
3236
|
name: "WmHistoryDrawer",
|
|
3234
3237
|
props: {
|
|
3235
3238
|
conversations: { type: Array, default: () => [] },
|
|
@@ -3263,7 +3266,7 @@ const Yr = {
|
|
|
3263
3266
|
) : this.normalized;
|
|
3264
3267
|
},
|
|
3265
3268
|
groups() {
|
|
3266
|
-
const e =
|
|
3269
|
+
const e = Jr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
|
|
3267
3270
|
for (const o of this.filtered) {
|
|
3268
3271
|
if (!o.stamp) {
|
|
3269
3272
|
s.push(o);
|
|
@@ -3281,29 +3284,29 @@ const Yr = {
|
|
|
3281
3284
|
return this.filtered.length > 0;
|
|
3282
3285
|
}
|
|
3283
3286
|
}
|
|
3284
|
-
},
|
|
3287
|
+
}, Qr = { class: "wm-hd" }, Zr = {
|
|
3285
3288
|
class: "wm-hd__panel",
|
|
3286
3289
|
role: "dialog",
|
|
3287
3290
|
"aria-label": "Vos discussions"
|
|
3288
|
-
},
|
|
3291
|
+
}, ei = { class: "wm-hd__head" }, ti = { class: "wm-hd__top" }, ni = { class: "wm-hd__search" }, si = { class: "wm-hd__list" }, ri = {
|
|
3289
3292
|
key: 0,
|
|
3290
3293
|
class: "wm-hd__group"
|
|
3291
|
-
},
|
|
3294
|
+
}, ii = { class: "wm-hd__groupLabel" }, ai = { class: "wm-hd__rows" }, oi = ["onClick"], li = { class: "wm-hd__rowIcon" }, di = {
|
|
3292
3295
|
key: 0,
|
|
3293
3296
|
class: "wm-hd__rowDot",
|
|
3294
3297
|
"aria-label": "Message non lu"
|
|
3295
|
-
},
|
|
3298
|
+
}, ci = { class: "wm-hd__rowBody" }, ui = { class: "wm-hd__rowTop" }, hi = { class: "wm-hd__rowTitle" }, mi = { class: "wm-hd__rowPreview" }, fi = {
|
|
3296
3299
|
key: 0,
|
|
3297
3300
|
class: "wm-hd__empty"
|
|
3298
3301
|
};
|
|
3299
|
-
function
|
|
3300
|
-
return l(),
|
|
3302
|
+
function _i(t, e, n, a, r, s) {
|
|
3303
|
+
return l(), c("div", Qr, [
|
|
3301
3304
|
i("div", {
|
|
3302
3305
|
class: "wm-hd__scrim",
|
|
3303
3306
|
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3304
3307
|
}),
|
|
3305
|
-
i("aside",
|
|
3306
|
-
i("div",
|
|
3308
|
+
i("aside", Zr, [
|
|
3309
|
+
i("div", ei, [
|
|
3307
3310
|
e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
|
|
3308
3311
|
i("div", { class: "wm-hd__title" }, "Vos discussions"),
|
|
3309
3312
|
i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
|
|
@@ -3329,7 +3332,7 @@ function mi(t, e, n, a, r, s) {
|
|
|
3329
3332
|
], -1)
|
|
3330
3333
|
])])
|
|
3331
3334
|
]),
|
|
3332
|
-
i("div",
|
|
3335
|
+
i("div", ti, [
|
|
3333
3336
|
i("button", {
|
|
3334
3337
|
type: "button",
|
|
3335
3338
|
class: "wm-hd__new",
|
|
@@ -3352,7 +3355,7 @@ function mi(t, e, n, a, r, s) {
|
|
|
3352
3355
|
], -1),
|
|
3353
3356
|
i("span", null, "Démarrer un nouveau fil", -1)
|
|
3354
3357
|
])]),
|
|
3355
|
-
i("div",
|
|
3358
|
+
i("div", ni, [
|
|
3356
3359
|
e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
|
|
3357
3360
|
i("svg", {
|
|
3358
3361
|
width: "12",
|
|
@@ -3368,33 +3371,33 @@ function mi(t, e, n, a, r, s) {
|
|
|
3368
3371
|
i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
|
|
3369
3372
|
])
|
|
3370
3373
|
], -1)),
|
|
3371
|
-
|
|
3374
|
+
q(i("input", {
|
|
3372
3375
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
|
|
3373
3376
|
type: "text",
|
|
3374
3377
|
placeholder: "Rechercher dans vos messages",
|
|
3375
3378
|
"aria-label": "Rechercher dans vos messages"
|
|
3376
3379
|
}, null, 512), [
|
|
3377
|
-
[
|
|
3380
|
+
[J, r.query]
|
|
3378
3381
|
])
|
|
3379
3382
|
])
|
|
3380
3383
|
]),
|
|
3381
|
-
i("div",
|
|
3382
|
-
(l(!0),
|
|
3384
|
+
i("div", si, [
|
|
3385
|
+
(l(!0), c(T, null, D(s.groups, (o) => (l(), c(T, {
|
|
3383
3386
|
key: o.key
|
|
3384
3387
|
}, [
|
|
3385
|
-
o.items.length ? (l(),
|
|
3386
|
-
i("div",
|
|
3387
|
-
i("div",
|
|
3388
|
-
(l(!0),
|
|
3389
|
-
key:
|
|
3388
|
+
o.items.length ? (l(), c("div", ri, [
|
|
3389
|
+
i("div", ii, b(o.label), 1),
|
|
3390
|
+
i("div", ai, [
|
|
3391
|
+
(l(!0), c(T, null, D(o.items, (d) => (l(), c("button", {
|
|
3392
|
+
key: d.id,
|
|
3390
3393
|
type: "button",
|
|
3391
3394
|
class: B(["wm-hd__row", {
|
|
3392
|
-
"wm-hd__row--active":
|
|
3393
|
-
"wm-hd__row--unread":
|
|
3395
|
+
"wm-hd__row--active": d.id === n.activeId,
|
|
3396
|
+
"wm-hd__row--unread": d.unread
|
|
3394
3397
|
}]),
|
|
3395
|
-
onClick: (v) => t.$emit("pick",
|
|
3398
|
+
onClick: (v) => t.$emit("pick", d)
|
|
3396
3399
|
}, [
|
|
3397
|
-
i("div",
|
|
3400
|
+
i("div", li, [
|
|
3398
3401
|
e[8] || (e[8] = i("svg", {
|
|
3399
3402
|
width: "11",
|
|
3400
3403
|
height: "11",
|
|
@@ -3408,28 +3411,27 @@ function mi(t, e, n, a, r, s) {
|
|
|
3408
3411
|
opacity: "0.92"
|
|
3409
3412
|
})
|
|
3410
3413
|
], -1)),
|
|
3411
|
-
|
|
3414
|
+
d.unread ? (l(), c("span", di)) : g("", !0)
|
|
3412
3415
|
]),
|
|
3413
|
-
i("div",
|
|
3414
|
-
i("div",
|
|
3415
|
-
i("span",
|
|
3416
|
+
i("div", ci, [
|
|
3417
|
+
i("div", ui, [
|
|
3418
|
+
i("span", hi, b(d.title), 1)
|
|
3416
3419
|
]),
|
|
3417
|
-
i("div",
|
|
3420
|
+
i("div", mi, b(d.preview || "Aucun message"), 1)
|
|
3418
3421
|
])
|
|
3419
|
-
], 10,
|
|
3422
|
+
], 10, oi))), 128))
|
|
3420
3423
|
])
|
|
3421
3424
|
])) : g("", !0)
|
|
3422
3425
|
], 64))), 128)),
|
|
3423
|
-
s.hasAny ? g("", !0) : (l(),
|
|
3426
|
+
s.hasAny ? g("", !0) : (l(), c("div", fi, " Aucun fil pour le moment. "))
|
|
3424
3427
|
])
|
|
3425
3428
|
])
|
|
3426
3429
|
]);
|
|
3427
3430
|
}
|
|
3428
|
-
const
|
|
3431
|
+
const pi = /* @__PURE__ */ E(Xr, [["render", _i], ["__scopeId", "data-v-1259e822"]]), vi = {
|
|
3429
3432
|
name: "WmMoreMenu",
|
|
3430
3433
|
props: {
|
|
3431
3434
|
canRename: { type: Boolean, default: !0 },
|
|
3432
|
-
canClear: { type: Boolean, default: !0 },
|
|
3433
3435
|
canExport: { type: Boolean, default: !0 },
|
|
3434
3436
|
notifEnabled: { type: Boolean, default: !0 },
|
|
3435
3437
|
statusUrl: { type: String, default: "" },
|
|
@@ -3452,23 +3454,23 @@ const fi = /* @__PURE__ */ E(Yr, [["render", mi], ["__scopeId", "data-v-1259e822
|
|
|
3452
3454
|
this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
|
|
3453
3455
|
}
|
|
3454
3456
|
}
|
|
3455
|
-
},
|
|
3457
|
+
}, gi = { class: "wm-mm" }, yi = {
|
|
3456
3458
|
class: "wm-mm__pop",
|
|
3457
3459
|
role: "menu"
|
|
3458
|
-
},
|
|
3459
|
-
function
|
|
3460
|
-
return l(),
|
|
3460
|
+
}, wi = { class: "wm-mm__section" }, bi = { class: "wm-mm__section" }, ki = { class: "wm-mm__section" };
|
|
3461
|
+
function Ci(t, e, n, a, r, s) {
|
|
3462
|
+
return l(), c("div", gi, [
|
|
3461
3463
|
i("div", {
|
|
3462
3464
|
class: "wm-mm__scrim",
|
|
3463
3465
|
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3464
3466
|
}),
|
|
3465
|
-
i("div",
|
|
3466
|
-
i("div",
|
|
3467
|
+
i("div", yi, [
|
|
3468
|
+
i("div", wi, [
|
|
3467
3469
|
i("button", {
|
|
3468
3470
|
type: "button",
|
|
3469
3471
|
class: "wm-mm__item",
|
|
3470
3472
|
onClick: e[1] || (e[1] = (o) => s.emit("history"))
|
|
3471
|
-
}, [...e[
|
|
3473
|
+
}, [...e[7] || (e[7] = [
|
|
3472
3474
|
i("span", { class: "wm-mm__icon" }, [
|
|
3473
3475
|
i("svg", {
|
|
3474
3476
|
width: "12",
|
|
@@ -3486,54 +3488,31 @@ function bi(t, e, n, a, r, s) {
|
|
|
3486
3488
|
], -1),
|
|
3487
3489
|
i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
|
|
3488
3490
|
])]),
|
|
3489
|
-
n.canRename ? (l(),
|
|
3491
|
+
n.canRename ? (l(), c("button", {
|
|
3490
3492
|
key: 0,
|
|
3491
3493
|
type: "button",
|
|
3492
3494
|
class: "wm-mm__item",
|
|
3493
3495
|
onClick: e[2] || (e[2] = (o) => s.emit("rename"))
|
|
3494
|
-
}, [...e[
|
|
3495
|
-
|
|
3496
|
+
}, [...e[8] || (e[8] = [
|
|
3497
|
+
he('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M12 20h9" data-v-3181ad1b></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Modifier le titre</span>', 2)
|
|
3496
3498
|
])])) : g("", !0),
|
|
3497
|
-
n.
|
|
3499
|
+
n.canExport ? (l(), c("button", {
|
|
3498
3500
|
key: 1,
|
|
3499
3501
|
type: "button",
|
|
3500
3502
|
class: "wm-mm__item",
|
|
3501
|
-
onClick: e[3] || (e[3] = (o) => s.emit("
|
|
3502
|
-
}, [...e[
|
|
3503
|
-
|
|
3504
|
-
i("svg", {
|
|
3505
|
-
width: "12",
|
|
3506
|
-
height: "12",
|
|
3507
|
-
viewBox: "0 0 24 24",
|
|
3508
|
-
fill: "none",
|
|
3509
|
-
stroke: "currentColor",
|
|
3510
|
-
"stroke-width": "1.8",
|
|
3511
|
-
"stroke-linecap": "round",
|
|
3512
|
-
"stroke-linejoin": "round",
|
|
3513
|
-
"aria-hidden": "true"
|
|
3514
|
-
}, [
|
|
3515
|
-
i("path", { d: "M4 7h16M10 11v6M14 11v6M5 7l1 13a2 2 0 002 2h8a2 2 0 002-2l1-13M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3" })
|
|
3516
|
-
])
|
|
3517
|
-
], -1),
|
|
3518
|
-
i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
|
|
3519
|
-
])])) : g("", !0),
|
|
3520
|
-
n.canExport ? (l(), d("button", {
|
|
3521
|
-
key: 2,
|
|
3522
|
-
type: "button",
|
|
3523
|
-
class: "wm-mm__item",
|
|
3524
|
-
onClick: e[4] || (e[4] = (o) => s.emit("export"))
|
|
3525
|
-
}, [...e[11] || (e[11] = [
|
|
3526
|
-
ue('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
|
|
3503
|
+
onClick: e[3] || (e[3] = (o) => s.emit("export"))
|
|
3504
|
+
}, [...e[9] || (e[9] = [
|
|
3505
|
+
he('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3181ad1b>.txt</span>', 3)
|
|
3527
3506
|
])])) : g("", !0)
|
|
3528
3507
|
]),
|
|
3529
|
-
e[
|
|
3530
|
-
i("div",
|
|
3508
|
+
e[15] || (e[15] = i("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3509
|
+
i("div", bi, [
|
|
3531
3510
|
i("button", {
|
|
3532
3511
|
type: "button",
|
|
3533
3512
|
class: "wm-mm__item",
|
|
3534
|
-
onClick: e[
|
|
3513
|
+
onClick: e[4] || (e[4] = (...o) => s.toggleNotif && s.toggleNotif(...o))
|
|
3535
3514
|
}, [
|
|
3536
|
-
e[
|
|
3515
|
+
e[11] || (e[11] = i("span", { class: "wm-mm__icon" }, [
|
|
3537
3516
|
i("svg", {
|
|
3538
3517
|
width: "12",
|
|
3539
3518
|
height: "12",
|
|
@@ -3548,22 +3527,22 @@ function bi(t, e, n, a, r, s) {
|
|
|
3548
3527
|
i("path", { d: "M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0" })
|
|
3549
3528
|
])
|
|
3550
3529
|
], -1)),
|
|
3551
|
-
e[
|
|
3530
|
+
e[12] || (e[12] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
|
|
3552
3531
|
i("span", {
|
|
3553
3532
|
class: B(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
|
|
3554
|
-
}, [...e[
|
|
3533
|
+
}, [...e[10] || (e[10] = [
|
|
3555
3534
|
i("span", { class: "wm-mm__knob" }, null, -1)
|
|
3556
3535
|
])], 2)
|
|
3557
3536
|
])
|
|
3558
3537
|
]),
|
|
3559
|
-
e[
|
|
3560
|
-
i("div",
|
|
3561
|
-
n.statusUrl ? (l(),
|
|
3538
|
+
e[16] || (e[16] = i("div", { class: "wm-mm__sep" }, null, -1)),
|
|
3539
|
+
i("div", ki, [
|
|
3540
|
+
n.statusUrl ? (l(), c("button", {
|
|
3562
3541
|
key: 0,
|
|
3563
3542
|
type: "button",
|
|
3564
3543
|
class: "wm-mm__item",
|
|
3565
|
-
onClick: e[
|
|
3566
|
-
}, [...e[
|
|
3544
|
+
onClick: e[5] || (e[5] = (o) => s.emit("status"))
|
|
3545
|
+
}, [...e[13] || (e[13] = [
|
|
3567
3546
|
i("span", { class: "wm-mm__icon" }, [
|
|
3568
3547
|
i("svg", {
|
|
3569
3548
|
width: "12",
|
|
@@ -3581,12 +3560,12 @@ function bi(t, e, n, a, r, s) {
|
|
|
3581
3560
|
], -1),
|
|
3582
3561
|
i("span", { class: "wm-mm__label" }, "Statut des services", -1)
|
|
3583
3562
|
])])) : g("", !0),
|
|
3584
|
-
n.helpUrl ? (l(),
|
|
3563
|
+
n.helpUrl ? (l(), c("button", {
|
|
3585
3564
|
key: 1,
|
|
3586
3565
|
type: "button",
|
|
3587
3566
|
class: "wm-mm__item",
|
|
3588
|
-
onClick: e[
|
|
3589
|
-
}, [...e[
|
|
3567
|
+
onClick: e[6] || (e[6] = (o) => s.emit("help"))
|
|
3568
|
+
}, [...e[14] || (e[14] = [
|
|
3590
3569
|
i("span", { class: "wm-mm__icon" }, [
|
|
3591
3570
|
i("svg", {
|
|
3592
3571
|
width: "12",
|
|
@@ -3608,13 +3587,114 @@ function bi(t, e, n, a, r, s) {
|
|
|
3608
3587
|
])
|
|
3609
3588
|
]);
|
|
3610
3589
|
}
|
|
3611
|
-
const
|
|
3612
|
-
|
|
3590
|
+
const Ai = /* @__PURE__ */ E(vi, [["render", Ci], ["__scopeId", "data-v-3181ad1b"]]), Si = {
|
|
3591
|
+
name: "WmRenameDialog",
|
|
3592
|
+
props: {
|
|
3593
|
+
title: { type: String, default: "Modifier le titre" },
|
|
3594
|
+
initialValue: { type: String, default: "" },
|
|
3595
|
+
placeholder: { type: String, default: "Titre de la conversation" }
|
|
3596
|
+
},
|
|
3597
|
+
emits: ["close", "submit"],
|
|
3598
|
+
data() {
|
|
3599
|
+
return { value: this.initialValue || "" };
|
|
3600
|
+
},
|
|
3601
|
+
computed: {
|
|
3602
|
+
canSubmit() {
|
|
3603
|
+
const t = (this.value || "").trim();
|
|
3604
|
+
return !!t && t !== (this.initialValue || "").trim();
|
|
3605
|
+
}
|
|
3606
|
+
},
|
|
3607
|
+
mounted() {
|
|
3608
|
+
this.$nextTick(() => {
|
|
3609
|
+
const t = this.$refs.input;
|
|
3610
|
+
if (t) {
|
|
3611
|
+
t.focus();
|
|
3612
|
+
try {
|
|
3613
|
+
t.select();
|
|
3614
|
+
} catch {
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
});
|
|
3618
|
+
},
|
|
3619
|
+
methods: {
|
|
3620
|
+
onSubmit() {
|
|
3621
|
+
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
}, xi = { class: "wm-dialog" }, Ti = {
|
|
3625
|
+
class: "wm-dialog__card",
|
|
3626
|
+
role: "dialog",
|
|
3627
|
+
"aria-modal": "true"
|
|
3628
|
+
}, Mi = { class: "wm-dialog__head" }, Oi = { class: "wm-dialog__title" }, Ii = { class: "wm-dialog__body" }, Bi = ["placeholder"], Ei = { class: "wm-dialog__actions" }, $i = ["disabled"];
|
|
3629
|
+
function Li(t, e, n, a, r, s) {
|
|
3630
|
+
return l(), c("div", xi, [
|
|
3631
|
+
i("div", {
|
|
3632
|
+
class: "wm-dialog__scrim",
|
|
3633
|
+
onClick: e[0] || (e[0] = (o) => t.$emit("close"))
|
|
3634
|
+
}),
|
|
3635
|
+
i("div", Ti, [
|
|
3636
|
+
i("div", Mi, [
|
|
3637
|
+
i("div", Oi, b(n.title), 1),
|
|
3638
|
+
i("button", {
|
|
3639
|
+
type: "button",
|
|
3640
|
+
class: "wm-dialog__close",
|
|
3641
|
+
"aria-label": "Fermer",
|
|
3642
|
+
onClick: e[1] || (e[1] = (o) => t.$emit("close"))
|
|
3643
|
+
}, [...e[7] || (e[7] = [
|
|
3644
|
+
i("svg", {
|
|
3645
|
+
width: "12",
|
|
3646
|
+
height: "12",
|
|
3647
|
+
viewBox: "0 0 24 24",
|
|
3648
|
+
fill: "none",
|
|
3649
|
+
stroke: "currentColor",
|
|
3650
|
+
"stroke-width": "2",
|
|
3651
|
+
"stroke-linecap": "round",
|
|
3652
|
+
"stroke-linejoin": "round",
|
|
3653
|
+
"aria-hidden": "true"
|
|
3654
|
+
}, [
|
|
3655
|
+
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
3656
|
+
], -1)
|
|
3657
|
+
])])
|
|
3658
|
+
]),
|
|
3659
|
+
i("div", Ii, [
|
|
3660
|
+
q(i("input", {
|
|
3661
|
+
ref: "input",
|
|
3662
|
+
"onUpdate:modelValue": e[2] || (e[2] = (o) => r.value = o),
|
|
3663
|
+
type: "text",
|
|
3664
|
+
class: "wm-dialog__input",
|
|
3665
|
+
placeholder: n.placeholder,
|
|
3666
|
+
maxlength: 120,
|
|
3667
|
+
onKeydown: [
|
|
3668
|
+
e[3] || (e[3] = ae(X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]), ["enter"])),
|
|
3669
|
+
e[4] || (e[4] = ae(X((o) => t.$emit("close"), ["prevent"]), ["esc"]))
|
|
3670
|
+
]
|
|
3671
|
+
}, null, 40, Bi), [
|
|
3672
|
+
[J, r.value]
|
|
3673
|
+
])
|
|
3674
|
+
]),
|
|
3675
|
+
i("div", Ei, [
|
|
3676
|
+
i("button", {
|
|
3677
|
+
type: "button",
|
|
3678
|
+
class: "wm-dialog__btn",
|
|
3679
|
+
onClick: e[5] || (e[5] = (o) => t.$emit("close"))
|
|
3680
|
+
}, "Annuler"),
|
|
3681
|
+
i("button", {
|
|
3682
|
+
type: "button",
|
|
3683
|
+
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
3684
|
+
disabled: !s.canSubmit,
|
|
3685
|
+
onClick: e[6] || (e[6] = (...o) => s.onSubmit && s.onSubmit(...o))
|
|
3686
|
+
}, "Enregistrer", 8, $i)
|
|
3687
|
+
])
|
|
3688
|
+
])
|
|
3689
|
+
]);
|
|
3690
|
+
}
|
|
3691
|
+
const Ri = /* @__PURE__ */ E(Si, [["render", Li], ["__scopeId", "data-v-4f4b37c9"]]), ye = "ww-messenger-tokens";
|
|
3692
|
+
function ie(t) {
|
|
3613
3693
|
var n;
|
|
3614
3694
|
const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
|
|
3615
3695
|
return e === "agent_ia" || e === "agent_human";
|
|
3616
3696
|
}
|
|
3617
|
-
function
|
|
3697
|
+
function Fi(t, e) {
|
|
3618
3698
|
if (!t || !e) return "";
|
|
3619
3699
|
const n = Array.isArray(t.fields) ? t.fields : [], a = [];
|
|
3620
3700
|
for (const r of n) {
|
|
@@ -3623,8 +3703,8 @@ function Ci(t, e) {
|
|
|
3623
3703
|
if (s == null || s === "") continue;
|
|
3624
3704
|
let o;
|
|
3625
3705
|
if (Array.isArray(s)) {
|
|
3626
|
-
if (o = s.map((
|
|
3627
|
-
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o =
|
|
3706
|
+
if (o = s.map((d) => le(r, String(d))).join(", "), !o) continue;
|
|
3707
|
+
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
|
|
3628
3708
|
a.push(`${r.label} :
|
|
3629
3709
|
${o}`);
|
|
3630
3710
|
}
|
|
@@ -3632,12 +3712,12 @@ ${o}`);
|
|
|
3632
3712
|
|
|
3633
3713
|
`);
|
|
3634
3714
|
}
|
|
3635
|
-
function
|
|
3715
|
+
function le(t, e) {
|
|
3636
3716
|
if (!Array.isArray(t == null ? void 0 : t.options)) return e;
|
|
3637
3717
|
const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
|
|
3638
3718
|
return (n == null ? void 0 : n.label) || e;
|
|
3639
3719
|
}
|
|
3640
|
-
function
|
|
3720
|
+
function Di(t, e) {
|
|
3641
3721
|
const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
|
|
3642
3722
|
for (const r of a) {
|
|
3643
3723
|
if (!(r != null && r.key) || !(r != null && r.label)) continue;
|
|
@@ -3645,11 +3725,11 @@ function Ai(t, e) {
|
|
|
3645
3725
|
if (s == null || s === "") continue;
|
|
3646
3726
|
let o;
|
|
3647
3727
|
if (Array.isArray(s)) {
|
|
3648
|
-
if (o = s.map((v) =>
|
|
3649
|
-
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o =
|
|
3650
|
-
const
|
|
3728
|
+
if (o = s.map((v) => le(r, String(v))).join(", "), !o) continue;
|
|
3729
|
+
} else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
|
|
3730
|
+
const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
|
|
3651
3731
|
`));
|
|
3652
|
-
n.push({ label: r.label, value: o, multiline:
|
|
3732
|
+
n.push({ label: r.label, value: o, multiline: d });
|
|
3653
3733
|
}
|
|
3654
3734
|
return {
|
|
3655
3735
|
kind: "form_response",
|
|
@@ -3659,20 +3739,21 @@ function Ai(t, e) {
|
|
|
3659
3739
|
}
|
|
3660
3740
|
};
|
|
3661
3741
|
}
|
|
3662
|
-
const
|
|
3742
|
+
const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
|
|
3663
3743
|
name: "Messenger",
|
|
3664
3744
|
components: {
|
|
3665
|
-
Launcher:
|
|
3666
|
-
Header:
|
|
3667
|
-
Onboarding:
|
|
3668
|
-
MessageList:
|
|
3669
|
-
Composer:
|
|
3670
|
-
SuggestionChips:
|
|
3671
|
-
ApprovalCard:
|
|
3745
|
+
Launcher: Ge,
|
|
3746
|
+
Header: wt,
|
|
3747
|
+
Onboarding: zt,
|
|
3748
|
+
MessageList: Es,
|
|
3749
|
+
Composer: Qs,
|
|
3750
|
+
SuggestionChips: nr,
|
|
3751
|
+
ApprovalCard: hr,
|
|
3672
3752
|
FormCard: jr,
|
|
3673
|
-
Feedback:
|
|
3674
|
-
HistoryDrawer:
|
|
3675
|
-
MoreMenu:
|
|
3753
|
+
Feedback: Yr,
|
|
3754
|
+
HistoryDrawer: pi,
|
|
3755
|
+
MoreMenu: Ai,
|
|
3756
|
+
RenameDialog: Ri
|
|
3676
3757
|
},
|
|
3677
3758
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
3678
3759
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -3688,7 +3769,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3688
3769
|
},
|
|
3689
3770
|
props: {
|
|
3690
3771
|
// Hardcoded server default (overridable for staging/dev).
|
|
3691
|
-
baseUrl: { type: String, default:
|
|
3772
|
+
baseUrl: { type: String, default: He },
|
|
3692
3773
|
widgetId: { type: String, default: "" },
|
|
3693
3774
|
userId: { type: String, default: "" },
|
|
3694
3775
|
userHash: { type: String, default: "" },
|
|
@@ -3730,6 +3811,26 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3730
3811
|
// Overlays anchored to the header. Only one open at a time.
|
|
3731
3812
|
historyOpen: !1,
|
|
3732
3813
|
moreOpen: !1,
|
|
3814
|
+
// In-app rename dialog. Replaces the previous `window.prompt`
|
|
3815
|
+
// call so the rename flow stays inside the widget (and works
|
|
3816
|
+
// on platforms where prompts are blocked).
|
|
3817
|
+
renameDialogOpen: !1,
|
|
3818
|
+
// Draft conversation : composer ouvert sans création server-side.
|
|
3819
|
+
// La conversation réelle n'est créée qu'au premier envoi (texte,
|
|
3820
|
+
// PJ, formulaire, quick-link sans URL). Évite de polluer la liste
|
|
3821
|
+
// côté serveur avec des fils vides abandonnés.
|
|
3822
|
+
draftConv: null,
|
|
3823
|
+
// Permission API pour les notifications navigateur. Tracke l'état
|
|
3824
|
+
// courant ('default'|'granted'|'denied') pour décider quand
|
|
3825
|
+
// déclencher une demande explicite.
|
|
3826
|
+
notifPermission: typeof Notification < "u" ? Notification.permission : "denied",
|
|
3827
|
+
// Unsubscribe handle for the transport's `message` event (used
|
|
3828
|
+
// to drive sound + browser notifications). Set during boot.
|
|
3829
|
+
_notifUnsub: null,
|
|
3830
|
+
// Cached AudioContext for the ping sound. Lazily created on the
|
|
3831
|
+
// first notification; reused across plays to avoid the per-call
|
|
3832
|
+
// construction cost (and the autoplay-policy warning on Safari).
|
|
3833
|
+
_audioCtx: null,
|
|
3733
3834
|
// When set, takes precedence over the latest-conversation
|
|
3734
3835
|
// selection so the user can browse another thread from the
|
|
3735
3836
|
// history drawer without losing live updates on the others.
|
|
@@ -3833,7 +3934,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3833
3934
|
var n;
|
|
3834
3935
|
const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
|
|
3835
3936
|
return this.allConversations.map((a) => {
|
|
3836
|
-
const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "",
|
|
3937
|
+
const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", d = this.lastMessageAuthorType(r), v = !!s && d !== "user" && (!o || s > o);
|
|
3837
3938
|
return { ...a, _preview: this.convPreview(a, r), _unread: v };
|
|
3838
3939
|
});
|
|
3839
3940
|
},
|
|
@@ -3842,17 +3943,20 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3842
3943
|
unreadCount() {
|
|
3843
3944
|
return this.drawerConversations.filter((t) => t._unread).length;
|
|
3844
3945
|
},
|
|
3845
|
-
//
|
|
3846
|
-
// the onboarding/home screen so the user can jump straight
|
|
3847
|
-
|
|
3946
|
+
// Open (non-resolved) threads, freshest first, trimmed to a handful —
|
|
3947
|
+
// surfaced on the onboarding/home screen so the user can jump straight
|
|
3948
|
+
// back into anything in flight. The `unread` flag lets the home screen
|
|
3949
|
+
// badge the ones with unseen agent/human activity.
|
|
3950
|
+
openThreads() {
|
|
3848
3951
|
var e;
|
|
3849
3952
|
const t = ((e = this.s) == null ? void 0 : e.messagesByConv) || {};
|
|
3850
|
-
return this.drawerConversations.filter((n) => n.
|
|
3953
|
+
return this.drawerConversations.filter((n) => n.status !== "resolved").map((n) => ({
|
|
3851
3954
|
id: n.id,
|
|
3852
3955
|
title: n.name || "Nouvelle conversation",
|
|
3853
3956
|
preview: n._preview || "Nouveau message",
|
|
3957
|
+
unread: !!n._unread,
|
|
3854
3958
|
_ts: this.convLastActivity(n, t[n.id] || [])
|
|
3855
|
-
})).sort((n, a) => n._ts < a._ts ? 1 : n._ts > a._ts ? -1 : 0).slice(0,
|
|
3959
|
+
})).sort((n, a) => n._ts < a._ts ? 1 : n._ts > a._ts ? -1 : 0).slice(0, 5);
|
|
3856
3960
|
},
|
|
3857
3961
|
// The unread thread with the freshest activity — what the étiquette
|
|
3858
3962
|
// previews. `{ convId, preview, ts }` or null when nothing's unread.
|
|
@@ -3883,6 +3987,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3883
3987
|
return (this.isOpen || this.isEmbedded) && !this.historyOpen && !!this.currentConv;
|
|
3884
3988
|
},
|
|
3885
3989
|
currentConv() {
|
|
3990
|
+
if (this.draftConv) return this.draftConv;
|
|
3886
3991
|
if (this.showOnboarding) return null;
|
|
3887
3992
|
const t = this.allConversations;
|
|
3888
3993
|
if (!t.length) return null;
|
|
@@ -3977,13 +4082,13 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3977
4082
|
const t = this.currentConv;
|
|
3978
4083
|
if (!t) return [];
|
|
3979
4084
|
const e = (r) => {
|
|
3980
|
-
var s, o,
|
|
3981
|
-
return (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.type) === "system" || Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length || (
|
|
4085
|
+
var s, o, d, v;
|
|
4086
|
+
return (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.type) === "system" || Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length || (d = r == null ? void 0 : r.metadata) != null && d.artifact || (v = r == null ? void 0 : r.metadata) != null && v.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
3982
4087
|
}, n = (r) => {
|
|
3983
4088
|
var s;
|
|
3984
4089
|
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
|
|
3985
4090
|
}, a = this.revealedAt;
|
|
3986
|
-
return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) =>
|
|
4091
|
+
return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => ie(r) ? a[r.id] > 0 : !0).filter(e);
|
|
3987
4092
|
},
|
|
3988
4093
|
// True whenever we should show the "typing" indicator at the bottom
|
|
3989
4094
|
// of the list: either the LLM is actively streaming tokens, or one
|
|
@@ -3992,7 +4097,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
3992
4097
|
streamingActive() {
|
|
3993
4098
|
var n, a, r;
|
|
3994
4099
|
const t = this.currentConv;
|
|
3995
|
-
return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) =>
|
|
4100
|
+
return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => ie(s) && !(this.revealedAt[s.id] > 0)) : !1;
|
|
3996
4101
|
},
|
|
3997
4102
|
// Internal: the raw persisted list for the current conversation. We
|
|
3998
4103
|
// watch this to detect new agent messages that need to be paced.
|
|
@@ -4024,11 +4129,11 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4024
4129
|
return ((e = (t = this.pendingApproval) == null ? void 0 : t.payload) == null ? void 0 : e.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
|
|
4025
4130
|
},
|
|
4026
4131
|
approvalDetail() {
|
|
4027
|
-
var a, r, s, o,
|
|
4132
|
+
var a, r, s, o, d, v;
|
|
4028
4133
|
const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
4029
4134
|
if (typeof t == "string" && t.trim())
|
|
4030
4135
|
return t.trim();
|
|
4031
|
-
const e = (v = (
|
|
4136
|
+
const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
|
|
4032
4137
|
if (!e || typeof e != "object") return "";
|
|
4033
4138
|
const n = Object.entries(e);
|
|
4034
4139
|
return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
|
|
@@ -4067,13 +4172,13 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4067
4172
|
const t = this.currentConv;
|
|
4068
4173
|
let e = /* @__PURE__ */ new Date();
|
|
4069
4174
|
if (t) {
|
|
4070
|
-
const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((
|
|
4175
|
+
const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
|
|
4071
4176
|
if (o) {
|
|
4072
|
-
const
|
|
4073
|
-
Number.isNaN(
|
|
4177
|
+
const d = new Date(o);
|
|
4178
|
+
Number.isNaN(d.getTime()) || (e = d);
|
|
4074
4179
|
}
|
|
4075
4180
|
}
|
|
4076
|
-
return `Aujourd'hui · ${
|
|
4181
|
+
return `Aujourd'hui · ${ke(e)}`;
|
|
4077
4182
|
},
|
|
4078
4183
|
// Pagination state for the active conversation. Drives the
|
|
4079
4184
|
// MessageList's scroll-up history loader. Defaults are safe (no
|
|
@@ -4108,7 +4213,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4108
4213
|
// we're about to load count as history and bypass pacing.
|
|
4109
4214
|
"currentConv.id": {
|
|
4110
4215
|
handler(t) {
|
|
4111
|
-
this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "", this.unreadBoundaryTs = t ? (/* @__PURE__ */ new Date()).toISOString() : "");
|
|
4216
|
+
this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.renameDialogOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "", this.unreadBoundaryTs = t ? (/* @__PURE__ */ new Date()).toISOString() : "");
|
|
4112
4217
|
},
|
|
4113
4218
|
immediate: !0
|
|
4114
4219
|
},
|
|
@@ -4174,7 +4279,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4174
4279
|
const e = Date.now(), n = { ...this.revealedAt };
|
|
4175
4280
|
for (const r of t) {
|
|
4176
4281
|
if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
|
|
4177
|
-
if (!
|
|
4282
|
+
if (!ie(r)) {
|
|
4178
4283
|
n[r.id] = e;
|
|
4179
4284
|
continue;
|
|
4180
4285
|
}
|
|
@@ -4183,8 +4288,8 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4183
4288
|
n[r.id] = e;
|
|
4184
4289
|
continue;
|
|
4185
4290
|
}
|
|
4186
|
-
const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0,
|
|
4187
|
-
if (!o && !
|
|
4291
|
+
const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
|
|
4292
|
+
if (!o && !d) {
|
|
4188
4293
|
n[r.id] = e;
|
|
4189
4294
|
continue;
|
|
4190
4295
|
}
|
|
@@ -4203,12 +4308,12 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4203
4308
|
hasUserHash: !!this.userHash
|
|
4204
4309
|
}), typeof document < "u" && !document.getElementById(ye)) {
|
|
4205
4310
|
const t = document.createElement("style");
|
|
4206
|
-
t.id = ye, t.textContent =
|
|
4311
|
+
t.id = ye, t.textContent = Pe, document.head.appendChild(t);
|
|
4207
4312
|
}
|
|
4208
4313
|
this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4209
4314
|
},
|
|
4210
4315
|
beforeUnmount() {
|
|
4211
|
-
this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.store && this.store.destroy();
|
|
4316
|
+
this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.teardownNotifications(), this.store && this.store.destroy();
|
|
4212
4317
|
},
|
|
4213
4318
|
methods: {
|
|
4214
4319
|
syncFloatObserver(t) {
|
|
@@ -4269,9 +4374,9 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4269
4374
|
for (let s = e.length - 1; s >= 0; s--) {
|
|
4270
4375
|
const o = e[s];
|
|
4271
4376
|
if (!o) continue;
|
|
4272
|
-
const
|
|
4273
|
-
if (
|
|
4274
|
-
return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") +
|
|
4377
|
+
const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
|
|
4378
|
+
if (d)
|
|
4379
|
+
return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
|
|
4275
4380
|
const v = (a = o.payload) == null ? void 0 : a.attachments;
|
|
4276
4381
|
if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
|
|
4277
4382
|
}
|
|
@@ -4303,7 +4408,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4303
4408
|
// actively-viewed thread receives new messages.
|
|
4304
4409
|
markConvRead(t) {
|
|
4305
4410
|
var a, r;
|
|
4306
|
-
if (!(t != null && t.id)) return;
|
|
4411
|
+
if (!(t != null && t.id) || t._draft) return;
|
|
4307
4412
|
const e = ((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || [], n = this.convLastActivity(t, e);
|
|
4308
4413
|
n && this.readState[t.id] !== n && (this.readState = { ...this.readState, [t.id]: n }, this.persistReadState());
|
|
4309
4414
|
},
|
|
@@ -4354,19 +4459,19 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4354
4459
|
// bounded by MIN/MAX_BETWEEN_MS.
|
|
4355
4460
|
scheduleReveal(t) {
|
|
4356
4461
|
const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
|
|
4357
|
-
|
|
4358
|
-
Math.max(
|
|
4462
|
+
Pi,
|
|
4463
|
+
Math.max(Ui, n * ji)
|
|
4359
4464
|
), s = Math.max(
|
|
4360
|
-
e +
|
|
4361
|
-
this.nextRevealAt +
|
|
4465
|
+
e + Ni,
|
|
4466
|
+
this.nextRevealAt + Hi
|
|
4362
4467
|
) + a;
|
|
4363
4468
|
this.nextRevealAt = s;
|
|
4364
|
-
const o = Math.max(0, s - e),
|
|
4365
|
-
this.revealedAt = { ...this.revealedAt, [
|
|
4469
|
+
const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
|
|
4470
|
+
this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
|
|
4366
4471
|
}, o);
|
|
4367
4472
|
this.revealTimers.push(v);
|
|
4368
4473
|
const k = setTimeout(() => {
|
|
4369
|
-
this.revealedAt[
|
|
4474
|
+
this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== k);
|
|
4370
4475
|
}, o + 4e3);
|
|
4371
4476
|
this.revealTimers.push(k);
|
|
4372
4477
|
},
|
|
@@ -4385,12 +4490,12 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4385
4490
|
baseUrl: this.baseUrl,
|
|
4386
4491
|
widgetId: this.widgetId,
|
|
4387
4492
|
userId: this.userId
|
|
4388
|
-
}), this.transport = fe(
|
|
4493
|
+
}), this.transport = fe(Fe({
|
|
4389
4494
|
baseUrl: this.baseUrl,
|
|
4390
4495
|
widgetId: this.widgetId,
|
|
4391
4496
|
userId: this.userId,
|
|
4392
4497
|
userHash: this.userHash
|
|
4393
|
-
})), this.store = fe(Ue(this.transport)), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
|
|
4498
|
+
})), this.store = fe(Ue(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
|
|
4394
4499
|
ready: this.store.state.ready,
|
|
4395
4500
|
error: this.store.state.error
|
|
4396
4501
|
});
|
|
@@ -4399,39 +4504,59 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4399
4504
|
}
|
|
4400
4505
|
},
|
|
4401
4506
|
async refresh() {
|
|
4402
|
-
this.store && this.store.destroy(), this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4507
|
+
this.store && this.store.destroy(), this.cancelReveals(), this.teardownNotifications(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.renameDialogOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
4403
4508
|
},
|
|
4404
4509
|
// Opening straight from the étiquette: land on the unread thread it
|
|
4405
4510
|
// was previewing rather than whatever was last active.
|
|
4406
4511
|
async openFromPeek() {
|
|
4407
4512
|
var e, n;
|
|
4408
4513
|
const t = (e = this.latestUnread) == null ? void 0 : e.convId;
|
|
4409
|
-
t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.activeConvId = t, this.showOnboarding = !1), await this.open();
|
|
4514
|
+
t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1), await this.open();
|
|
4410
4515
|
},
|
|
4411
4516
|
async open() {
|
|
4412
|
-
|
|
4517
|
+
this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
4518
|
+
const t = this.currentConv;
|
|
4519
|
+
if (t && !t._draft) {
|
|
4413
4520
|
try {
|
|
4414
|
-
await this.store.openConversation(
|
|
4415
|
-
} catch (
|
|
4416
|
-
console.error("[ww-messenger] load messages failed",
|
|
4521
|
+
await this.store.openConversation(t.id);
|
|
4522
|
+
} catch (e) {
|
|
4523
|
+
console.error("[ww-messenger] load messages failed", e);
|
|
4417
4524
|
}
|
|
4418
|
-
this.markConvRead(
|
|
4525
|
+
this.markConvRead(t);
|
|
4419
4526
|
}
|
|
4420
4527
|
},
|
|
4421
4528
|
close() {
|
|
4422
4529
|
this.isOpen = !1, this.store && this.store.setPanelOpen(!1);
|
|
4423
4530
|
},
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4531
|
+
// Enter "draft" mode : the composer is rendered immediately but no
|
|
4532
|
+
// server-side conversation is created yet. `ensureRealConv` runs
|
|
4533
|
+
// lazily on the first outbound action (text / attachment / form /
|
|
4534
|
+
// quick-link without URL), so users who open the chat and walk away
|
|
4535
|
+
// don't leave empty threads behind.
|
|
4536
|
+
startConv() {
|
|
4537
|
+
this.draftConv = {
|
|
4538
|
+
id: "__draft__",
|
|
4539
|
+
_draft: !0,
|
|
4540
|
+
name: "",
|
|
4541
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4542
|
+
}, this.activeConvId = null, this.showOnboarding = !1, this.focusComposer();
|
|
4543
|
+
},
|
|
4544
|
+
// Materialize the draft into a real server-side conversation. Returns
|
|
4545
|
+
// the freshly-created conv (so callers can `send` against its id) or
|
|
4546
|
+
// `null` if the creation failed.
|
|
4547
|
+
async ensureRealConv() {
|
|
4548
|
+
const t = this.currentConv;
|
|
4549
|
+
if (!t) return null;
|
|
4550
|
+
if (!t._draft) return t;
|
|
4551
|
+
if (this.busy) return null;
|
|
4552
|
+
this.busy = !0;
|
|
4553
|
+
try {
|
|
4554
|
+
const e = await this.store.createConversation({});
|
|
4555
|
+
return this.draftConv = null, this.activeConvId = e.id, await this.store.openConversation(e.id), this.markConvRead(e), e;
|
|
4556
|
+
} catch (e) {
|
|
4557
|
+
return console.error("[ww-messenger] create conv failed", e), this.bootError = (e == null ? void 0 : e.message) || String(e), null;
|
|
4558
|
+
} finally {
|
|
4559
|
+
this.busy = !1;
|
|
4435
4560
|
}
|
|
4436
4561
|
},
|
|
4437
4562
|
// After a fresh conversation renders, drop the caret straight into
|
|
@@ -4448,11 +4573,11 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4448
4573
|
this.historyOpen = !1, this.moreOpen = !this.moreOpen;
|
|
4449
4574
|
},
|
|
4450
4575
|
goHome() {
|
|
4451
|
-
this.historyOpen = !1, this.moreOpen = !1, this.activeConvId = null, this.showOnboarding = !0;
|
|
4576
|
+
this.historyOpen = !1, this.moreOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !0;
|
|
4452
4577
|
},
|
|
4453
4578
|
async onDrawerPick(t) {
|
|
4454
4579
|
if (!(t != null && t.id) || !this.store) return;
|
|
4455
|
-
this.historyOpen = !1, this.activeConvId = t.id, this.showOnboarding = !1;
|
|
4580
|
+
this.historyOpen = !1, this.draftConv = null, this.activeConvId = t.id, this.showOnboarding = !1;
|
|
4456
4581
|
try {
|
|
4457
4582
|
await this.store.openConversation(t.id);
|
|
4458
4583
|
} catch (n) {
|
|
@@ -4464,8 +4589,106 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4464
4589
|
async onDrawerNew() {
|
|
4465
4590
|
this.historyOpen = !1, await this.startConv();
|
|
4466
4591
|
},
|
|
4467
|
-
onNotifToggle(t) {
|
|
4468
|
-
this.notifEnabled = !!t
|
|
4592
|
+
async onNotifToggle(t) {
|
|
4593
|
+
if (this.notifEnabled = !!t, this.persistNotifPref(), this.notifEnabled && typeof Notification < "u" && Notification.permission === "default")
|
|
4594
|
+
try {
|
|
4595
|
+
const e = await Notification.requestPermission();
|
|
4596
|
+
this.notifPermission = e;
|
|
4597
|
+
} catch (e) {
|
|
4598
|
+
console.warn("[ww-messenger] notif permission request failed", e);
|
|
4599
|
+
}
|
|
4600
|
+
},
|
|
4601
|
+
// ── Notifications (sound + browser push) ──────────────────────────
|
|
4602
|
+
setupNotifications() {
|
|
4603
|
+
this.transport && (this.teardownNotifications(), this._notifUnsub = this.transport.on("message", this.onIncomingNotification));
|
|
4604
|
+
},
|
|
4605
|
+
teardownNotifications() {
|
|
4606
|
+
var t, e;
|
|
4607
|
+
if (this._notifUnsub) {
|
|
4608
|
+
try {
|
|
4609
|
+
this._notifUnsub();
|
|
4610
|
+
} catch {
|
|
4611
|
+
}
|
|
4612
|
+
this._notifUnsub = null;
|
|
4613
|
+
}
|
|
4614
|
+
if (this._audioCtx) {
|
|
4615
|
+
try {
|
|
4616
|
+
(e = (t = this._audioCtx).close) == null || e.call(t);
|
|
4617
|
+
} catch {
|
|
4618
|
+
}
|
|
4619
|
+
this._audioCtx = null;
|
|
4620
|
+
}
|
|
4621
|
+
},
|
|
4622
|
+
notifStorageKey() {
|
|
4623
|
+
return `wm:notif:${this.widgetId || ""}:${this.userId || ""}`;
|
|
4624
|
+
},
|
|
4625
|
+
hydrateNotifPref() {
|
|
4626
|
+
try {
|
|
4627
|
+
if (typeof localStorage > "u") return;
|
|
4628
|
+
const t = localStorage.getItem(this.notifStorageKey());
|
|
4629
|
+
t === "0" ? this.notifEnabled = !1 : t === "1" && (this.notifEnabled = !0);
|
|
4630
|
+
} catch {
|
|
4631
|
+
}
|
|
4632
|
+
},
|
|
4633
|
+
persistNotifPref() {
|
|
4634
|
+
try {
|
|
4635
|
+
if (typeof localStorage > "u") return;
|
|
4636
|
+
localStorage.setItem(this.notifStorageKey(), this.notifEnabled ? "1" : "0");
|
|
4637
|
+
} catch {
|
|
4638
|
+
}
|
|
4639
|
+
},
|
|
4640
|
+
onIncomingNotification(t) {
|
|
4641
|
+
var o;
|
|
4642
|
+
if (!this.notifEnabled) return;
|
|
4643
|
+
const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
|
|
4644
|
+
if (!e || !n || !ie(n)) return;
|
|
4645
|
+
const a = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
|
|
4646
|
+
if (Number.isFinite(a) && a < this.convOpenedAt - 1e3) return;
|
|
4647
|
+
const r = typeof document < "u" && document.hidden;
|
|
4648
|
+
this.isOpen && !r && ((o = this.currentConv) == null ? void 0 : o.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
|
|
4649
|
+
},
|
|
4650
|
+
playNotificationSound() {
|
|
4651
|
+
if (typeof window > "u") return;
|
|
4652
|
+
const t = window.AudioContext || window.webkitAudioContext;
|
|
4653
|
+
if (t)
|
|
4654
|
+
try {
|
|
4655
|
+
this._audioCtx || (this._audioCtx = new t());
|
|
4656
|
+
const e = this._audioCtx;
|
|
4657
|
+
if (e.state === "suspended")
|
|
4658
|
+
try {
|
|
4659
|
+
e.resume();
|
|
4660
|
+
} catch {
|
|
4661
|
+
}
|
|
4662
|
+
const n = e.currentTime, a = e.createOscillator(), r = e.createGain();
|
|
4663
|
+
a.connect(r), r.connect(e.destination), a.type = "sine", a.frequency.setValueAtTime(880, n), a.frequency.exponentialRampToValueAtTime(1320, n + 0.08), r.gain.setValueAtTime(0, n), r.gain.linearRampToValueAtTime(0.12, n + 0.02), r.gain.exponentialRampToValueAtTime(1e-4, n + 0.28), a.start(n), a.stop(n + 0.32);
|
|
4664
|
+
} catch {
|
|
4665
|
+
}
|
|
4666
|
+
},
|
|
4667
|
+
showBrowserNotification(t, e) {
|
|
4668
|
+
var o;
|
|
4669
|
+
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
4670
|
+
const n = this.allConversations.find((d) => d.id === t), a = (n == null ? void 0 : n.name) || ((o = this.widget) == null ? void 0 : o.name) || "Nouveau message", r = typeof (e == null ? void 0 : e.text_md) == "string" ? e.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
|
|
4671
|
+
try {
|
|
4672
|
+
const d = new Notification(a, {
|
|
4673
|
+
body: s,
|
|
4674
|
+
tag: `wm-${t}`,
|
|
4675
|
+
renotify: !1,
|
|
4676
|
+
silent: !0
|
|
4677
|
+
});
|
|
4678
|
+
d.onclick = () => {
|
|
4679
|
+
try {
|
|
4680
|
+
window.focus();
|
|
4681
|
+
} catch {
|
|
4682
|
+
}
|
|
4683
|
+
this.draftConv = null, this.showOnboarding = !1, this.activeConvId = t, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
4684
|
+
try {
|
|
4685
|
+
d.close();
|
|
4686
|
+
} catch {
|
|
4687
|
+
}
|
|
4688
|
+
};
|
|
4689
|
+
} catch (d) {
|
|
4690
|
+
console.warn("[ww-messenger] notification failed", d);
|
|
4691
|
+
}
|
|
4469
4692
|
},
|
|
4470
4693
|
async onMoreAction(t) {
|
|
4471
4694
|
switch (this.moreOpen = !1, t) {
|
|
@@ -4473,10 +4696,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4473
4696
|
this.historyOpen = !0;
|
|
4474
4697
|
break;
|
|
4475
4698
|
case "rename":
|
|
4476
|
-
|
|
4477
|
-
break;
|
|
4478
|
-
case "clear":
|
|
4479
|
-
await this.clearCurrentConv();
|
|
4699
|
+
this.openRenameDialog();
|
|
4480
4700
|
break;
|
|
4481
4701
|
case "export":
|
|
4482
4702
|
this.exportCurrentConv();
|
|
@@ -4497,31 +4717,23 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4497
4717
|
break;
|
|
4498
4718
|
}
|
|
4499
4719
|
},
|
|
4500
|
-
|
|
4720
|
+
openRenameDialog() {
|
|
4501
4721
|
const t = this.currentConv;
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
if (e == null) return;
|
|
4510
|
-
const n = e.trim();
|
|
4511
|
-
if (!(!n || n === t.name))
|
|
4722
|
+
!t || t._draft || (this.renameDialogOpen = !0);
|
|
4723
|
+
},
|
|
4724
|
+
async onRenameSubmit(t) {
|
|
4725
|
+
const e = this.currentConv;
|
|
4726
|
+
if (this.renameDialogOpen = !1, !e || e._draft || !this.store) return;
|
|
4727
|
+
const n = (t || "").trim();
|
|
4728
|
+
if (!(!n || n === e.name))
|
|
4512
4729
|
try {
|
|
4513
|
-
await this.store.patchConversation(
|
|
4730
|
+
await this.store.patchConversation(e.id, { name: n });
|
|
4514
4731
|
} catch (a) {
|
|
4515
4732
|
console.error("[ww-messenger] rename failed", a);
|
|
4516
4733
|
}
|
|
4517
4734
|
},
|
|
4518
|
-
async clearCurrentConv() {
|
|
4519
|
-
var n;
|
|
4520
|
-
const t = this.currentConv;
|
|
4521
|
-
!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);
|
|
4522
|
-
},
|
|
4523
4735
|
exportCurrentConv() {
|
|
4524
|
-
var r, s, o,
|
|
4736
|
+
var r, s, o, d, v, k;
|
|
4525
4737
|
const t = this.currentConv;
|
|
4526
4738
|
if (!t) return;
|
|
4527
4739
|
const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
|
|
@@ -4531,7 +4743,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4531
4743
|
];
|
|
4532
4744
|
for (const w of e) {
|
|
4533
4745
|
if (!w) continue;
|
|
4534
|
-
const S = ((o = w.author) == null ? void 0 : o.name) || (((
|
|
4746
|
+
const S = ((o = w.author) == null ? void 0 : o.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((v = w.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = w.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), R = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
|
|
4535
4747
|
A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
|
|
4536
4748
|
}
|
|
4537
4749
|
const a = new Blob([n.join(`
|
|
@@ -4544,10 +4756,10 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4544
4756
|
}
|
|
4545
4757
|
},
|
|
4546
4758
|
async onSend(t) {
|
|
4547
|
-
|
|
4548
|
-
if (!e && (
|
|
4759
|
+
let e = this.currentConv;
|
|
4760
|
+
if (!e && (this.startConv(), e = this.currentConv, !e) || e._draft && (e = await this.ensureRealConv(), !e))
|
|
4549
4761
|
return;
|
|
4550
|
-
const n =
|
|
4762
|
+
const n = e.id, a = this.pendingAttachments.slice();
|
|
4551
4763
|
this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments: a.length ? a : void 0 });
|
|
4552
4764
|
},
|
|
4553
4765
|
async onSuggestion(t) {
|
|
@@ -4566,14 +4778,14 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4566
4778
|
async onFormSubmit({ values: t }) {
|
|
4567
4779
|
const e = this.pendingForm;
|
|
4568
4780
|
if (!(e != null && e.form)) return;
|
|
4569
|
-
const n =
|
|
4781
|
+
const n = Fi(e.form, t);
|
|
4570
4782
|
if (!n) return;
|
|
4571
|
-
|
|
4572
|
-
a && await this.store.send(a.id, n, {
|
|
4783
|
+
let a = this.currentConv;
|
|
4784
|
+
a && (a._draft && (a = await this.ensureRealConv(), !a) || await this.store.send(a.id, n, {
|
|
4573
4785
|
metadata: {
|
|
4574
|
-
artifact:
|
|
4786
|
+
artifact: Di(e.form, t)
|
|
4575
4787
|
}
|
|
4576
|
-
});
|
|
4788
|
+
}));
|
|
4577
4789
|
},
|
|
4578
4790
|
async onAttach(t) {
|
|
4579
4791
|
if (!(!t || !this.transport))
|
|
@@ -4599,7 +4811,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4599
4811
|
}
|
|
4600
4812
|
return;
|
|
4601
4813
|
}
|
|
4602
|
-
|
|
4814
|
+
this.currentConv || this.startConv(), await this.onSend(t.label);
|
|
4603
4815
|
}
|
|
4604
4816
|
},
|
|
4605
4817
|
async onFeedback({ rating: t, comment: e }) {
|
|
@@ -4615,30 +4827,30 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
|
|
|
4615
4827
|
}
|
|
4616
4828
|
}
|
|
4617
4829
|
}
|
|
4618
|
-
},
|
|
4830
|
+
}, Vi = {
|
|
4619
4831
|
key: 0,
|
|
4620
4832
|
class: "wm-loading",
|
|
4621
4833
|
"aria-busy": "true",
|
|
4622
4834
|
"aria-live": "polite"
|
|
4623
|
-
},
|
|
4835
|
+
}, qi = {
|
|
4624
4836
|
key: 0,
|
|
4625
4837
|
class: "wm-state"
|
|
4626
|
-
},
|
|
4838
|
+
}, Wi = { class: "wm-state__err" }, Ki = { class: "wm-state__errSub" }, Gi = { class: "wm-bottom" }, Yi = {
|
|
4627
4839
|
key: 0,
|
|
4628
4840
|
ref: "floatEl",
|
|
4629
4841
|
class: "wm-float"
|
|
4630
|
-
},
|
|
4842
|
+
}, Ji = {
|
|
4631
4843
|
key: 1,
|
|
4632
4844
|
class: "wm-actionWait",
|
|
4633
4845
|
role: "status",
|
|
4634
4846
|
"aria-live": "polite"
|
|
4635
|
-
},
|
|
4636
|
-
key:
|
|
4847
|
+
}, Xi = { class: "wm-actionWait__lbl" }, Qi = {
|
|
4848
|
+
key: 2,
|
|
4637
4849
|
class: "wm-attached"
|
|
4638
|
-
},
|
|
4639
|
-
function
|
|
4640
|
-
const o = I("Launcher"),
|
|
4641
|
-
return l(),
|
|
4850
|
+
}, Zi = ["onClick"];
|
|
4851
|
+
function ea(t, e, n, a, r, s) {
|
|
4852
|
+
const o = I("Launcher"), d = I("Header"), v = I("Onboarding"), k = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), R = I("Feedback"), A = I("SuggestionChips"), U = I("Composer"), x = I("MoreMenu"), j = I("RenameDialog"), P = I("HistoryDrawer");
|
|
4853
|
+
return l(), c("div", {
|
|
4642
4854
|
class: B(["wm-root", `wm-root--${n.displayMode}`])
|
|
4643
4855
|
}, [
|
|
4644
4856
|
!r.isOpen && !s.isEmbedded ? (l(), $(o, {
|
|
@@ -4648,21 +4860,21 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4648
4860
|
onOpen: s.openFromPeek,
|
|
4649
4861
|
onDismiss: e[0] || (e[0] = (F) => r.labelDismissed = !0)
|
|
4650
4862
|
}, null, 8, ["unread-count", "peek", "onOpen"])) : g("", !0),
|
|
4651
|
-
r.isOpen || s.isEmbedded ? (l(),
|
|
4863
|
+
r.isOpen || s.isEmbedded ? (l(), c("section", {
|
|
4652
4864
|
key: 1,
|
|
4653
4865
|
class: B(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
4654
4866
|
style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
4655
4867
|
role: "dialog",
|
|
4656
4868
|
"aria-label": "Messenger"
|
|
4657
4869
|
}, [
|
|
4658
|
-
!s.ready && !s.error ? (l(),
|
|
4659
|
-
s.isEmbedded ? g("", !0) : (l(),
|
|
4870
|
+
!s.ready && !s.error ? (l(), c("div", Vi, [
|
|
4871
|
+
s.isEmbedded ? g("", !0) : (l(), c("button", {
|
|
4660
4872
|
key: 0,
|
|
4661
4873
|
type: "button",
|
|
4662
4874
|
class: "wm-loading__close",
|
|
4663
4875
|
"aria-label": "Réduire",
|
|
4664
4876
|
onClick: e[1] || (e[1] = (...F) => s.close && s.close(...F))
|
|
4665
|
-
}, [...e[
|
|
4877
|
+
}, [...e[7] || (e[7] = [
|
|
4666
4878
|
i("svg", {
|
|
4667
4879
|
width: "13",
|
|
4668
4880
|
height: "13",
|
|
@@ -4677,12 +4889,12 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4677
4889
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4678
4890
|
], -1)
|
|
4679
4891
|
])])),
|
|
4680
|
-
e[
|
|
4892
|
+
e[8] || (e[8] = i("div", {
|
|
4681
4893
|
class: "wm-loading__spinner",
|
|
4682
4894
|
"aria-hidden": "true"
|
|
4683
4895
|
}, null, -1))
|
|
4684
|
-
])) : (l(),
|
|
4685
|
-
K(
|
|
4896
|
+
])) : (l(), c(T, { key: 1 }, [
|
|
4897
|
+
K(d, {
|
|
4686
4898
|
title: s.headerTitle,
|
|
4687
4899
|
escalated: s.isEscalated,
|
|
4688
4900
|
"agent-name": s.humanAgentName,
|
|
@@ -4697,9 +4909,9 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4697
4909
|
onMore: s.toggleMore,
|
|
4698
4910
|
onClose: s.close
|
|
4699
4911
|
}, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
|
|
4700
|
-
s.error ? (l(),
|
|
4701
|
-
i("div",
|
|
4702
|
-
e[
|
|
4912
|
+
s.error ? (l(), c("div", qi, [
|
|
4913
|
+
i("div", Wi, [
|
|
4914
|
+
e[10] || (e[10] = i("div", { class: "wm-state__errIcon" }, [
|
|
4703
4915
|
i("svg", {
|
|
4704
4916
|
width: "14",
|
|
4705
4917
|
height: "14",
|
|
@@ -4715,11 +4927,11 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4715
4927
|
])
|
|
4716
4928
|
], -1)),
|
|
4717
4929
|
i("div", null, [
|
|
4718
|
-
e[
|
|
4719
|
-
i("div",
|
|
4930
|
+
e[9] || (e[9] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
|
|
4931
|
+
i("div", Ki, b(s.error), 1)
|
|
4720
4932
|
])
|
|
4721
4933
|
])
|
|
4722
|
-
])) : s.currentConv ? (l(),
|
|
4934
|
+
])) : s.currentConv ? (l(), c(T, { key: 2 }, [
|
|
4723
4935
|
K(k, {
|
|
4724
4936
|
ref: "messageList",
|
|
4725
4937
|
messages: s.displayedMessages,
|
|
@@ -4732,8 +4944,8 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4732
4944
|
"unread-boundary-ts": r.unreadBoundaryTs,
|
|
4733
4945
|
onLoadMore: s.onLoadMore
|
|
4734
4946
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "unread-boundary-ts", "onLoadMore"]),
|
|
4735
|
-
i("div",
|
|
4736
|
-
s.floatVisible ? (l(),
|
|
4947
|
+
i("div", Gi, [
|
|
4948
|
+
s.floatVisible ? (l(), c("div", Yi, [
|
|
4737
4949
|
s.approvalReady ? (l(), $(w, {
|
|
4738
4950
|
key: 0,
|
|
4739
4951
|
action: s.approvalTitle,
|
|
@@ -4755,13 +4967,13 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4755
4967
|
onSelect: s.onSuggestion
|
|
4756
4968
|
}, null, 8, ["items", "onSelect"]))
|
|
4757
4969
|
], 512)) : g("", !0),
|
|
4758
|
-
s.actionInFlight ? (l(),
|
|
4759
|
-
e[
|
|
4970
|
+
s.actionInFlight ? (l(), c("div", Ji, [
|
|
4971
|
+
e[11] || (e[11] = i("span", {
|
|
4760
4972
|
class: "wm-actionWait__spinner",
|
|
4761
4973
|
"aria-hidden": "true"
|
|
4762
4974
|
}, null, -1)),
|
|
4763
|
-
i("span",
|
|
4764
|
-
])) : (l(), $(
|
|
4975
|
+
i("span", Xi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
|
|
4976
|
+
])) : (l(), $(U, {
|
|
4765
4977
|
key: 2,
|
|
4766
4978
|
ref: "composer",
|
|
4767
4979
|
modelValue: r.draft,
|
|
@@ -4775,22 +4987,28 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4775
4987
|
]),
|
|
4776
4988
|
r.moreOpen ? (l(), $(x, {
|
|
4777
4989
|
key: 0,
|
|
4778
|
-
"can-rename": !!s.currentConv,
|
|
4779
|
-
"can-
|
|
4780
|
-
"can-export": !!s.currentConv,
|
|
4990
|
+
"can-rename": !!s.currentConv && !s.currentConv._draft,
|
|
4991
|
+
"can-export": !!s.currentConv && !s.currentConv._draft,
|
|
4781
4992
|
"notif-enabled": r.notifEnabled,
|
|
4782
4993
|
"status-url": s.statusUrl,
|
|
4783
4994
|
"help-url": s.helpUrl,
|
|
4784
4995
|
onClose: e[3] || (e[3] = (F) => r.moreOpen = !1),
|
|
4785
4996
|
onNotifToggle: s.onNotifToggle,
|
|
4786
4997
|
onAction: s.onMoreAction
|
|
4787
|
-
}, null, 8, ["can-rename", "can-
|
|
4788
|
-
r.
|
|
4789
|
-
|
|
4790
|
-
|
|
4998
|
+
}, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0),
|
|
4999
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), $(j, {
|
|
5000
|
+
key: 1,
|
|
5001
|
+
"initial-value": s.currentConv.name || "",
|
|
5002
|
+
title: "Modifier le titre de la conversation",
|
|
5003
|
+
onClose: e[4] || (e[4] = (F) => r.renameDialogOpen = !1),
|
|
5004
|
+
onSubmit: s.onRenameSubmit
|
|
5005
|
+
}, null, 8, ["initial-value", "onSubmit"])) : g("", !0),
|
|
5006
|
+
r.pendingAttachments.length ? (l(), c("div", Qi, [
|
|
5007
|
+
(l(!0), c(T, null, D(r.pendingAttachments, (F, H) => (l(), c("div", {
|
|
5008
|
+
key: H,
|
|
4791
5009
|
class: "wm-attached__chip"
|
|
4792
5010
|
}, [
|
|
4793
|
-
e[
|
|
5011
|
+
e[13] || (e[13] = i("svg", {
|
|
4794
5012
|
width: "11",
|
|
4795
5013
|
height: "11",
|
|
4796
5014
|
viewBox: "0 0 24 24",
|
|
@@ -4807,8 +5025,8 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4807
5025
|
i("button", {
|
|
4808
5026
|
type: "button",
|
|
4809
5027
|
"aria-label": "Retirer",
|
|
4810
|
-
onClick: (
|
|
4811
|
-
}, [...e[
|
|
5028
|
+
onClick: (Y) => r.pendingAttachments.splice(H, 1)
|
|
5029
|
+
}, [...e[12] || (e[12] = [
|
|
4812
5030
|
i("svg", {
|
|
4813
5031
|
width: "10",
|
|
4814
5032
|
height: "10",
|
|
@@ -4822,7 +5040,7 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4822
5040
|
}, [
|
|
4823
5041
|
i("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4824
5042
|
], -1)
|
|
4825
|
-
])], 8,
|
|
5043
|
+
])], 8, Zi)
|
|
4826
5044
|
]))), 128))
|
|
4827
5045
|
])) : g("", !0)
|
|
4828
5046
|
], 64)) : (l(), $(v, {
|
|
@@ -4830,29 +5048,28 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4830
5048
|
"welcome-message": s.widgetWelcomeMessage,
|
|
4831
5049
|
"agent-name": s.agentName,
|
|
4832
5050
|
"quick-links": s.quickLinks,
|
|
4833
|
-
"
|
|
5051
|
+
"open-threads": s.openThreads,
|
|
4834
5052
|
busy: r.busy,
|
|
4835
5053
|
onStart: s.startConv,
|
|
4836
5054
|
onSelect: s.onQuickLink,
|
|
4837
5055
|
onResume: s.onDrawerPick
|
|
4838
|
-
}, null, 8, ["welcome-message", "agent-name", "quick-links", "
|
|
4839
|
-
r.historyOpen ? (l(), $(
|
|
5056
|
+
}, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5057
|
+
r.historyOpen ? (l(), $(P, {
|
|
4840
5058
|
key: 3,
|
|
4841
5059
|
conversations: s.drawerConversations,
|
|
4842
5060
|
"active-id": s.currentConv ? s.currentConv.id : null,
|
|
4843
|
-
onClose: e[
|
|
5061
|
+
onClose: e[5] || (e[5] = (F) => r.historyOpen = !1),
|
|
4844
5062
|
onNew: s.onDrawerNew,
|
|
4845
5063
|
onPick: s.onDrawerPick
|
|
4846
5064
|
}, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : g("", !0),
|
|
4847
5065
|
r.moreOpen && !s.currentConv ? (l(), $(x, {
|
|
4848
5066
|
key: 4,
|
|
4849
5067
|
"can-rename": !1,
|
|
4850
|
-
"can-clear": !1,
|
|
4851
5068
|
"can-export": !1,
|
|
4852
5069
|
"notif-enabled": r.notifEnabled,
|
|
4853
5070
|
"status-url": s.statusUrl,
|
|
4854
5071
|
"help-url": s.helpUrl,
|
|
4855
|
-
onClose: e[
|
|
5072
|
+
onClose: e[6] || (e[6] = (F) => r.moreOpen = !1),
|
|
4856
5073
|
onNotifToggle: s.onNotifToggle,
|
|
4857
5074
|
onAction: s.onMoreAction
|
|
4858
5075
|
}, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0)
|
|
@@ -4860,49 +5077,49 @@ function Pi(t, e, n, a, r, s) {
|
|
|
4860
5077
|
], 6)) : g("", !0)
|
|
4861
5078
|
], 2);
|
|
4862
5079
|
}
|
|
4863
|
-
const
|
|
5080
|
+
const sa = /* @__PURE__ */ E(zi, [["render", ea], ["__scopeId", "data-v-a988e756"]]), ra = "0.3.1";
|
|
4864
5081
|
export {
|
|
4865
5082
|
te as AIAvatar,
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
5083
|
+
ue as AVATAR_COLORS,
|
|
5084
|
+
tn as ActionResult,
|
|
5085
|
+
hr as ApprovalCard,
|
|
5086
|
+
cn as ArtifactFormResponse,
|
|
5087
|
+
Cn as ArtifactInfoCard,
|
|
5088
|
+
Hn as ArtifactRenderer,
|
|
5089
|
+
Nn as ArtifactTicket,
|
|
5090
|
+
es as AttachmentPreview,
|
|
5091
|
+
os as Bubble,
|
|
5092
|
+
Qs as Composer,
|
|
5093
|
+
He as DEFAULT_BASE_URL,
|
|
5094
|
+
Yr as Feedback,
|
|
4878
5095
|
jr as FormCard,
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
5096
|
+
wt as Header,
|
|
5097
|
+
pi as HistoryDrawer,
|
|
5098
|
+
Ce as HumanAvatar,
|
|
5099
|
+
Ge as Launcher,
|
|
5100
|
+
me as MEDIA_RECORDER_SUPPORTED,
|
|
5101
|
+
Es as MessageList,
|
|
5102
|
+
sa as Messenger,
|
|
5103
|
+
Ai as MoreMenu,
|
|
5104
|
+
zt as Onboarding,
|
|
5105
|
+
oe as SCREEN_CAPTURE_SUPPORTED,
|
|
5106
|
+
nr as SuggestionChips,
|
|
5107
|
+
lt as TeamAvatars,
|
|
5108
|
+
us as Typing,
|
|
5109
|
+
ra as VERSION,
|
|
5110
|
+
we as avatarColor,
|
|
5111
|
+
be as avatarInitials,
|
|
5112
|
+
Ls as captureScreenshotFile,
|
|
5113
|
+
N as colors,
|
|
4897
5114
|
Ue as createStore,
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
5115
|
+
Fe as createTransport,
|
|
5116
|
+
sa as default,
|
|
5117
|
+
ke as formatTime,
|
|
5118
|
+
na as guessAttachmentKind,
|
|
5119
|
+
$s as pickRecorderMime,
|
|
5120
|
+
ss as renderMarkdown,
|
|
5121
|
+
Fs as startScreenRecording,
|
|
5122
|
+
Pe as tokensCss,
|
|
5123
|
+
je as uuid,
|
|
5124
|
+
je as v4
|
|
4908
5125
|
};
|