@_solaris/messenger-widget 0.4.0 → 0.4.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 +14 -14
- package/dist/messenger.js +1173 -1157
- package/dist/style.css +1 -1
- package/dist/types/core/markdown.d.ts +14 -0
- package/dist/types/index.d.ts +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 Fe, openBlock as c, createElementBlock as u, normalizeStyle as W, normalizeClass as x, toDisplayString as v, resolveComponent as I, createVNode as z, Transition as je, withCtx as Pe, Fragment as L, renderList as j, withKeys as ue, withModifiers as X, createElementVNode as o, createCommentVNode as b, createBlock as R, withDirectives as V, vModelText as Z, createTextVNode as pe, resolveDynamicComponent as De, renderSlot as Ue, vModelCheckbox as $e, vModelSelect as He, markRaw as ye } from "vue";
|
|
2
|
+
const ze = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
5
5
|
"message_stream",
|
|
6
6
|
"conversation_updated",
|
|
7
7
|
"config_updated",
|
|
8
8
|
"action_status"
|
|
9
|
-
], be = "/client",
|
|
10
|
-
function
|
|
9
|
+
], be = "/client", qe = 5 * 60 * 1e3, Ve = 10 * 60 * 1e3, We = 5 * 60 * 1e3;
|
|
10
|
+
function Ke(e) {
|
|
11
11
|
const t = {
|
|
12
|
-
baseUrl:
|
|
12
|
+
baseUrl: Ge(e.baseUrl || ""),
|
|
13
13
|
widgetId: e.widgetId || "",
|
|
14
14
|
userId: e.userId || "",
|
|
15
15
|
userHash: e.userHash || "",
|
|
@@ -34,7 +34,7 @@ function We(e) {
|
|
|
34
34
|
function n(d, f) {
|
|
35
35
|
return t.listeners.has(d) || t.listeners.set(d, /* @__PURE__ */ new Set()), t.listeners.get(d).add(f), () => t.listeners.get(d).delete(f);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function i(d, f) {
|
|
38
38
|
const _ = t.listeners.get(d);
|
|
39
39
|
_ && _.forEach((y) => {
|
|
40
40
|
try {
|
|
@@ -44,8 +44,8 @@ function We(e) {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
t.connection !== d && (t.connection = d,
|
|
47
|
+
function r(d) {
|
|
48
|
+
t.connection !== d && (t.connection = d, i("connection", d));
|
|
49
49
|
}
|
|
50
50
|
function s() {
|
|
51
51
|
return {
|
|
@@ -54,7 +54,7 @@ function We(e) {
|
|
|
54
54
|
"X-Widget-Id": t.widgetId
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
async function
|
|
57
|
+
async function a(d, f, _) {
|
|
58
58
|
const y = await fetch(`${t.baseUrl}${be}${f}`, {
|
|
59
59
|
method: d,
|
|
60
60
|
headers: { "Content-Type": "application/json", ...s() },
|
|
@@ -90,7 +90,7 @@ function We(e) {
|
|
|
90
90
|
return _.json();
|
|
91
91
|
}),
|
|
92
92
|
// HMAC-protected.
|
|
93
|
-
|
|
93
|
+
a("GET", "/customers/me")
|
|
94
94
|
]);
|
|
95
95
|
return {
|
|
96
96
|
config: (
|
|
@@ -101,45 +101,45 @@ function We(e) {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
async function C() {
|
|
104
|
-
const d = await
|
|
104
|
+
const d = await a("GET", "/customers/me");
|
|
105
105
|
return (d == null ? void 0 : d.customer) ?? null;
|
|
106
106
|
}
|
|
107
107
|
async function k(d) {
|
|
108
|
-
const f = await
|
|
108
|
+
const f = await a("PATCH", "/customers/me", d);
|
|
109
109
|
return (f == null ? void 0 : f.customer) ?? null;
|
|
110
110
|
}
|
|
111
111
|
async function T() {
|
|
112
|
-
const d = await
|
|
112
|
+
const d = await a("GET", "/conversations");
|
|
113
113
|
return (d == null ? void 0 : d.conversations) ?? [];
|
|
114
114
|
}
|
|
115
115
|
async function B(d = {}) {
|
|
116
|
-
return (await
|
|
116
|
+
return (await a("POST", "/conversations", d)).conversation;
|
|
117
117
|
}
|
|
118
118
|
async function A(d) {
|
|
119
|
-
return (await
|
|
119
|
+
return (await a(
|
|
120
120
|
"GET",
|
|
121
121
|
`/conversations/${encodeURIComponent(d)}`
|
|
122
122
|
)).conversation;
|
|
123
123
|
}
|
|
124
124
|
async function H(d, f) {
|
|
125
|
-
return (await
|
|
125
|
+
return (await a(
|
|
126
126
|
"PATCH",
|
|
127
127
|
`/conversations/${encodeURIComponent(d)}`,
|
|
128
128
|
f
|
|
129
129
|
)).conversation;
|
|
130
130
|
}
|
|
131
131
|
async function M(d, f) {
|
|
132
|
-
return
|
|
132
|
+
return a(
|
|
133
133
|
"PATCH",
|
|
134
134
|
`/conversations/${encodeURIComponent(d)}/read`,
|
|
135
135
|
{ message_id: f }
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
async function
|
|
138
|
+
async function D(d, f = {}) {
|
|
139
139
|
const _ = new URLSearchParams();
|
|
140
140
|
f.before && _.set("before", f.before), f.since && _.set("since", f.since), f.limit && _.set("limit", String(f.limit));
|
|
141
141
|
const y = _.toString() ? `?${_.toString()}` : "";
|
|
142
|
-
return
|
|
142
|
+
return a(
|
|
143
143
|
"GET",
|
|
144
144
|
`/conversations/${encodeURIComponent(d)}/messages${y}`
|
|
145
145
|
);
|
|
@@ -153,14 +153,14 @@ function We(e) {
|
|
|
153
153
|
author: { id: t.userId, type: "user" },
|
|
154
154
|
created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
155
155
|
};
|
|
156
|
-
return Array.isArray(f.attachments) && f.attachments.length && (_.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (_.metadata = f.metadata),
|
|
156
|
+
return Array.isArray(f.attachments) && f.attachments.length && (_.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (_.metadata = f.metadata), a(
|
|
157
157
|
"POST",
|
|
158
158
|
`/conversations/${encodeURIComponent(d)}/messages`,
|
|
159
159
|
_
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
async function $(d, f, _) {
|
|
163
|
-
return q(),
|
|
163
|
+
return q(), a(
|
|
164
164
|
"POST",
|
|
165
165
|
`/messages/${encodeURIComponent(d)}/callbacks/${encodeURIComponent(f)}`,
|
|
166
166
|
_ ? { inputs: _ } : {}
|
|
@@ -172,7 +172,7 @@ function We(e) {
|
|
|
172
172
|
d.name || "attachment"
|
|
173
173
|
), _ = d.type || "application/octet-stream", y = d.size || 0, w = (
|
|
174
174
|
/** @type {import('./types.js').AttachmentUploadTicket} */
|
|
175
|
-
await
|
|
175
|
+
await a("POST", "/attachments", {
|
|
176
176
|
mime_type: _,
|
|
177
177
|
size_bytes: y,
|
|
178
178
|
name: f
|
|
@@ -185,14 +185,14 @@ function We(e) {
|
|
|
185
185
|
if (!S.ok)
|
|
186
186
|
throw new Error(`HTTP ${S.status} PUT signed upload`);
|
|
187
187
|
return {
|
|
188
|
-
type:
|
|
188
|
+
type: Ye(_),
|
|
189
189
|
path: w.path,
|
|
190
190
|
mime_type: _,
|
|
191
191
|
size_bytes: y
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
194
|
async function ee(d) {
|
|
195
|
-
return
|
|
195
|
+
return a(
|
|
196
196
|
"GET",
|
|
197
197
|
`/attachments/sign?path=${encodeURIComponent(d)}`
|
|
198
198
|
);
|
|
@@ -209,66 +209,66 @@ function We(e) {
|
|
|
209
209
|
if (!t.eventSource && !(typeof document < "u" && document.hidden))
|
|
210
210
|
try {
|
|
211
211
|
const d = new EventSource(te());
|
|
212
|
-
for (const f of
|
|
212
|
+
for (const f of ze)
|
|
213
213
|
d.addEventListener(f, (_) => Y(f, _.data));
|
|
214
214
|
d.addEventListener(
|
|
215
215
|
"error",
|
|
216
|
-
() =>
|
|
217
|
-
), t.eventSource = d,
|
|
216
|
+
() => i("error", new Error("SSE error"))
|
|
217
|
+
), t.eventSource = d, r("open");
|
|
218
218
|
} catch (d) {
|
|
219
|
-
console.error("[transport] SSE open failed", d),
|
|
219
|
+
console.error("[transport] SSE open failed", d), i("error", d);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
function Y(d, f) {
|
|
223
223
|
try {
|
|
224
224
|
const _ = JSON.parse(f), y = _ && typeof _ == "object" && "data" in _ ? _.data : _;
|
|
225
|
-
|
|
225
|
+
i(d, y);
|
|
226
226
|
} catch (_) {
|
|
227
227
|
console.error("[transport] bad SSE payload", d, _);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
function Q() {
|
|
231
|
-
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" &&
|
|
231
|
+
t.eventSource && (t.eventSource.close(), t.eventSource = null), t.connection !== "paused" && r("idle");
|
|
232
232
|
}
|
|
233
233
|
function q() {
|
|
234
234
|
clearTimeout(t.burstTimer), G(), t.panelOpen || (t.burstTimer = setTimeout(() => {
|
|
235
235
|
t.panelOpen || Q();
|
|
236
|
-
},
|
|
236
|
+
}, Ve));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function me(d) {
|
|
239
239
|
t.panelOpen = !!d, t.panelOpen ? (clearTimeout(t.burstTimer), G()) : q();
|
|
240
240
|
}
|
|
241
|
-
async function
|
|
241
|
+
async function ce() {
|
|
242
242
|
try {
|
|
243
243
|
const d = await T(), f = d.reduce((y, w) => {
|
|
244
244
|
const S = w == null ? void 0 : w.last_message_at;
|
|
245
245
|
return S && (!y || S > y) ? S : y;
|
|
246
246
|
}, null);
|
|
247
|
-
f && (!t.lastActivityAt || f > t.lastActivityAt) && (t.lastActivityAt = f,
|
|
247
|
+
f && (!t.lastActivityAt || f > t.lastActivityAt) && (t.lastActivityAt = f, i("activity", { conversations: d, latestAt: f }), q());
|
|
248
248
|
} catch (d) {
|
|
249
249
|
console.error("[transport] poll failed", d);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
ne(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(
|
|
252
|
+
function de() {
|
|
253
|
+
ne(), !(typeof document < "u" && document.hidden) && (t.pollTimer = setInterval(ce, qe));
|
|
254
254
|
}
|
|
255
255
|
function ne() {
|
|
256
256
|
t.pollTimer && (clearInterval(t.pollTimer), t.pollTimer = null);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function h() {
|
|
259
259
|
if (document.hidden)
|
|
260
260
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = setTimeout(() => {
|
|
261
|
-
t.hiddenGraceTimer = null, document.hidden && (ne(), Q(),
|
|
262
|
-
},
|
|
261
|
+
t.hiddenGraceTimer = null, document.hidden && (ne(), Q(), r("paused"));
|
|
262
|
+
}, We);
|
|
263
263
|
else {
|
|
264
264
|
if (t.hiddenGraceTimer) {
|
|
265
265
|
clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null;
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
|
-
|
|
268
|
+
r("idle"), de(), t.panelOpen && G();
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
async function
|
|
271
|
+
async function m() {
|
|
272
272
|
if (t.started) return t.lastBootstrap;
|
|
273
273
|
t.started = !0;
|
|
274
274
|
const d = await g();
|
|
@@ -282,10 +282,10 @@ function We(e) {
|
|
|
282
282
|
} catch (f) {
|
|
283
283
|
console.error("[transport] initial /conversations failed", f);
|
|
284
284
|
}
|
|
285
|
-
return typeof document < "u" && (t.visibilityHandler =
|
|
285
|
+
return typeof document < "u" && (t.visibilityHandler = h, document.addEventListener(
|
|
286
286
|
"visibilitychange",
|
|
287
287
|
t.visibilityHandler
|
|
288
|
-
)),
|
|
288
|
+
)), de(), d;
|
|
289
289
|
}
|
|
290
290
|
function p() {
|
|
291
291
|
ne(), clearTimeout(t.burstTimer), clearTimeout(t.hiddenGraceTimer), t.hiddenGraceTimer = null, Q(), t.visibilityHandler && (document.removeEventListener(
|
|
@@ -295,9 +295,9 @@ function We(e) {
|
|
|
295
295
|
}
|
|
296
296
|
return {
|
|
297
297
|
on: n,
|
|
298
|
-
start:
|
|
298
|
+
start: m,
|
|
299
299
|
stop: p,
|
|
300
|
-
setPanelOpen:
|
|
300
|
+
setPanelOpen: me,
|
|
301
301
|
// REST
|
|
302
302
|
bootstrap: g,
|
|
303
303
|
getCustomer: C,
|
|
@@ -307,7 +307,7 @@ function We(e) {
|
|
|
307
307
|
getConversation: A,
|
|
308
308
|
patchConversation: H,
|
|
309
309
|
markConversationRead: M,
|
|
310
|
-
listMessages:
|
|
310
|
+
listMessages: D,
|
|
311
311
|
postMessage: N,
|
|
312
312
|
postCallback: $,
|
|
313
313
|
uploadAttachment: K,
|
|
@@ -318,13 +318,13 @@ function We(e) {
|
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ge(e) {
|
|
322
322
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ye(e) {
|
|
325
325
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Qe() {
|
|
328
328
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
329
329
|
return crypto.randomUUID();
|
|
330
330
|
const e = new Uint8Array(16);
|
|
@@ -336,8 +336,8 @@ function Ye() {
|
|
|
336
336
|
const t = [...e].map((n) => n.toString(16).padStart(2, "0"));
|
|
337
337
|
return t.slice(0, 4).join("") + "-" + t.slice(4, 6).join("") + "-" + t.slice(6, 8).join("") + "-" + t.slice(8, 10).join("") + "-" + t.slice(10, 16).join("");
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
const t =
|
|
339
|
+
function Xe(e) {
|
|
340
|
+
const t = Fe({
|
|
341
341
|
ready: !1,
|
|
342
342
|
error: null,
|
|
343
343
|
config: null,
|
|
@@ -369,48 +369,48 @@ function Qe(e) {
|
|
|
369
369
|
connection: "idle"
|
|
370
370
|
}), n = [];
|
|
371
371
|
n.push(
|
|
372
|
-
e.on("connection", (
|
|
373
|
-
t.connection =
|
|
372
|
+
e.on("connection", (h) => {
|
|
373
|
+
t.connection = h;
|
|
374
374
|
})
|
|
375
375
|
), n.push(
|
|
376
|
-
e.on("message", (
|
|
377
|
-
const
|
|
378
|
-
!
|
|
376
|
+
e.on("message", (h) => {
|
|
377
|
+
const m = h == null ? void 0 : h.conversation_id, p = h == null ? void 0 : h.message;
|
|
378
|
+
!m || !(p != null && p.id) || (Y(m, p), p.client_msg_id && delete t.streamingByMsgId[p.client_msg_id], me(m, p.created_at));
|
|
379
379
|
})
|
|
380
380
|
), n.push(
|
|
381
|
-
e.on("message_stream", (
|
|
382
|
-
const
|
|
383
|
-
!
|
|
381
|
+
e.on("message_stream", (h) => {
|
|
382
|
+
const m = h == null ? void 0 : h.message_id, p = h == null ? void 0 : h.token;
|
|
383
|
+
!m || typeof p != "string" || (t.streamingByMsgId[m] = (t.streamingByMsgId[m] || "") + p);
|
|
384
384
|
})
|
|
385
385
|
), n.push(
|
|
386
|
-
e.on("conversation_updated", (
|
|
387
|
-
const
|
|
388
|
-
if (!
|
|
389
|
-
const d = t.conversations.findIndex((f) => f.id ===
|
|
386
|
+
e.on("conversation_updated", (h) => {
|
|
387
|
+
const m = h == null ? void 0 : h.conversation_id, p = h == null ? void 0 : h.changes;
|
|
388
|
+
if (!m || !p) return;
|
|
389
|
+
const d = t.conversations.findIndex((f) => f.id === m);
|
|
390
390
|
d !== -1 && (t.conversations[d] = {
|
|
391
391
|
...t.conversations[d],
|
|
392
392
|
...p
|
|
393
393
|
});
|
|
394
394
|
})
|
|
395
395
|
), n.push(
|
|
396
|
-
e.on("config_updated", (
|
|
397
|
-
|
|
396
|
+
e.on("config_updated", (h) => {
|
|
397
|
+
h != null && h.config && (t.config = h.config);
|
|
398
398
|
})
|
|
399
399
|
), n.push(
|
|
400
|
-
e.on("action_status", (
|
|
401
|
-
const
|
|
402
|
-
if (!
|
|
403
|
-
const f = t.runningActionsByConv[
|
|
404
|
-
|
|
400
|
+
e.on("action_status", (h) => {
|
|
401
|
+
const m = h == null ? void 0 : h.conversation_id, p = h == null ? void 0 : h.action_id, d = h == null ? void 0 : h.action_name;
|
|
402
|
+
if (!m || !p) return;
|
|
403
|
+
const f = t.runningActionsByConv[m] || {};
|
|
404
|
+
h.state === "running" ? (f[p] = d || p, t.runningActionsByConv[m] = { ...f }) : h.state === "done" && (delete f[p], t.runningActionsByConv[m] = { ...f });
|
|
405
405
|
})
|
|
406
406
|
), n.push(
|
|
407
|
-
e.on("activity", (
|
|
408
|
-
Array.isArray(
|
|
407
|
+
e.on("activity", (h) => {
|
|
408
|
+
Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
|
|
409
409
|
})
|
|
410
410
|
);
|
|
411
|
-
async function
|
|
411
|
+
async function i() {
|
|
412
412
|
try {
|
|
413
|
-
const
|
|
413
|
+
const h = new Promise(
|
|
414
414
|
(p, d) => setTimeout(
|
|
415
415
|
() => d(
|
|
416
416
|
new Error(
|
|
@@ -419,59 +419,59 @@ function Qe(e) {
|
|
|
419
419
|
),
|
|
420
420
|
15e3
|
|
421
421
|
)
|
|
422
|
-
),
|
|
423
|
-
t.config =
|
|
422
|
+
), m = await Promise.race([e.start(), h]);
|
|
423
|
+
t.config = m.config, t.customer = m.customer, t.conversations = await Promise.race([
|
|
424
424
|
e.listConversations(),
|
|
425
|
-
|
|
425
|
+
h
|
|
426
426
|
]), t.ready = !0;
|
|
427
|
-
} catch (
|
|
428
|
-
console.error("[store] start failed",
|
|
427
|
+
} catch (h) {
|
|
428
|
+
console.error("[store] start failed", h), t.error = (h == null ? void 0 : h.message) || String(h);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
for (const
|
|
431
|
+
function r() {
|
|
432
|
+
for (const h of n)
|
|
433
433
|
try {
|
|
434
|
-
|
|
434
|
+
h();
|
|
435
435
|
} catch {
|
|
436
436
|
}
|
|
437
437
|
e.stop();
|
|
438
438
|
}
|
|
439
|
-
async function s(
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
439
|
+
async function s(h) {
|
|
440
|
+
const m = de(h);
|
|
441
|
+
if (!m) return t.customer;
|
|
442
442
|
try {
|
|
443
|
-
const p = await e.patchCustomer(
|
|
443
|
+
const p = await e.patchCustomer(m);
|
|
444
444
|
p && (t.customer = p);
|
|
445
445
|
} catch (p) {
|
|
446
446
|
console.error("[store] applyCustomer failed", p);
|
|
447
447
|
}
|
|
448
448
|
return t.customer;
|
|
449
449
|
}
|
|
450
|
-
async function
|
|
451
|
-
const
|
|
452
|
-
return p === -1 ? t.conversations = [
|
|
450
|
+
async function a(h = {}) {
|
|
451
|
+
const m = await e.createConversation(h), p = t.conversations.findIndex((d) => d.id === m.id);
|
|
452
|
+
return p === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[p] = m, m;
|
|
453
453
|
}
|
|
454
454
|
const l = 50;
|
|
455
|
-
async function g(
|
|
456
|
-
const
|
|
457
|
-
if (!(
|
|
458
|
-
k(
|
|
455
|
+
async function g(h) {
|
|
456
|
+
const m = t.paginationByConv[h];
|
|
457
|
+
if (!(m != null && m.loaded || m != null && m.loading)) {
|
|
458
|
+
k(h, { nextCursor: null, loading: !0, loaded: !1 });
|
|
459
459
|
try {
|
|
460
|
-
const p = await e.listMessages(
|
|
460
|
+
const p = await e.listMessages(h, {
|
|
461
461
|
limit: l
|
|
462
|
-
}), d = (p == null ? void 0 : p.messages) ?? [], f = t.messagesByConv[
|
|
462
|
+
}), d = (p == null ? void 0 : p.messages) ?? [], f = t.messagesByConv[h] || [], _ = /* @__PURE__ */ new Set();
|
|
463
463
|
for (const w of d)
|
|
464
464
|
(w == null ? void 0 : w.id) != null && _.add(`id:${String(w.id)}`), w != null && w.client_msg_id && _.add(`c:${w.client_msg_id}`);
|
|
465
465
|
const y = f.filter((w) => !((w == null ? void 0 : w.id) != null && _.has(`id:${String(w.id)}`) || w != null && w.client_msg_id && _.has(`c:${w.client_msg_id}`)));
|
|
466
|
-
t.messagesByConv[
|
|
467
|
-
|
|
468
|
-
), k(
|
|
466
|
+
t.messagesByConv[h] = [...d, ...y].sort(
|
|
467
|
+
ce
|
|
468
|
+
), k(h, {
|
|
469
469
|
nextCursor: (p == null ? void 0 : p.next_cursor) ?? null,
|
|
470
470
|
loading: !1,
|
|
471
471
|
loaded: !0
|
|
472
472
|
});
|
|
473
473
|
} catch (p) {
|
|
474
|
-
console.error("[store] openConversation failed", p), k(
|
|
474
|
+
console.error("[store] openConversation failed", p), k(h, {
|
|
475
475
|
nextCursor: null,
|
|
476
476
|
loading: !1,
|
|
477
477
|
loaded: !1
|
|
@@ -479,67 +479,67 @@ function Qe(e) {
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
async function C(
|
|
482
|
+
async function C(h) {
|
|
483
483
|
var f;
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
const d = (f = (t.messagesByConv[
|
|
484
|
+
const m = t.paginationByConv[h];
|
|
485
|
+
if (!m || m.loading || !m.nextCursor) return;
|
|
486
|
+
const d = (f = (t.messagesByConv[h] || []).find((_) => _ == null ? void 0 : _.created_at)) == null ? void 0 : f.created_at;
|
|
487
487
|
if (d) {
|
|
488
|
-
k(
|
|
488
|
+
k(h, { ...m, loading: !0 });
|
|
489
489
|
try {
|
|
490
|
-
const _ = await e.listMessages(
|
|
490
|
+
const _ = await e.listMessages(h, {
|
|
491
491
|
before: d,
|
|
492
492
|
limit: l
|
|
493
|
-
}), y = (_ == null ? void 0 : _.messages) ?? [], w = t.messagesByConv[
|
|
493
|
+
}), y = (_ == null ? void 0 : _.messages) ?? [], w = t.messagesByConv[h] || [], S = /* @__PURE__ */ new Set();
|
|
494
494
|
for (const O of w)
|
|
495
495
|
(O == null ? void 0 : O.id) != null && S.add(`id:${String(O.id)}`), O != null && O.client_msg_id && S.add(`c:${O.client_msg_id}`);
|
|
496
496
|
const F = y.filter((O) => !((O == null ? void 0 : O.id) != null && S.has(`id:${String(O.id)}`) || O != null && O.client_msg_id && S.has(`c:${O.client_msg_id}`)));
|
|
497
|
-
t.messagesByConv[
|
|
497
|
+
t.messagesByConv[h] = [...F, ...w], k(h, {
|
|
498
498
|
nextCursor: (_ == null ? void 0 : _.next_cursor) ?? null,
|
|
499
499
|
loading: !1,
|
|
500
500
|
loaded: !0
|
|
501
501
|
});
|
|
502
502
|
} catch (_) {
|
|
503
|
-
console.error("[store] loadMore failed", _), k(
|
|
503
|
+
console.error("[store] loadMore failed", _), k(h, { ...m, loading: !1 });
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
function k(
|
|
508
|
-
t.paginationByConv = { ...t.paginationByConv, [
|
|
507
|
+
function k(h, m) {
|
|
508
|
+
t.paginationByConv = { ...t.paginationByConv, [h]: m };
|
|
509
509
|
}
|
|
510
|
-
async function T(
|
|
511
|
-
const p = await e.patchConversation(
|
|
510
|
+
async function T(h, m) {
|
|
511
|
+
const p = await e.patchConversation(h, m), d = t.conversations.findIndex((f) => f.id === h);
|
|
512
512
|
d !== -1 && (t.conversations[d] = p);
|
|
513
513
|
}
|
|
514
|
-
async function B(
|
|
515
|
-
if (!
|
|
516
|
-
const
|
|
514
|
+
async function B(h) {
|
|
515
|
+
if (!h) return [];
|
|
516
|
+
const m = t.messagesByConv[h] || [];
|
|
517
517
|
let p = "";
|
|
518
|
-
for (const d of
|
|
518
|
+
for (const d of m)
|
|
519
519
|
d != null && d.created_at && d.created_at > p && (p = d.created_at);
|
|
520
520
|
try {
|
|
521
521
|
const d = await e.listMessages(
|
|
522
|
-
|
|
522
|
+
h,
|
|
523
523
|
p ? { since: p } : {}
|
|
524
524
|
), f = (d == null ? void 0 : d.messages) || [];
|
|
525
525
|
if (!f.length) return [];
|
|
526
526
|
const _ = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
|
|
527
|
-
for (const S of
|
|
527
|
+
for (const S of m)
|
|
528
528
|
(S == null ? void 0 : S.id) != null && _.add(String(S.id)), S != null && S.client_msg_id && y.add(S.client_msg_id);
|
|
529
529
|
const w = [];
|
|
530
530
|
for (const S of f) {
|
|
531
531
|
const F = (S == null ? void 0 : S.id) != null && _.has(String(S.id)) || (S == null ? void 0 : S.client_msg_id) && y.has(S.client_msg_id);
|
|
532
|
-
Y(
|
|
532
|
+
Y(h, S), F || w.push(S);
|
|
533
533
|
}
|
|
534
534
|
return w;
|
|
535
535
|
} catch (d) {
|
|
536
536
|
return console.error("[store] fetchSinceLast failed", d), [];
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
async function A(
|
|
540
|
-
if (!(!
|
|
539
|
+
async function A(h, m) {
|
|
540
|
+
if (!(!h || m == null))
|
|
541
541
|
try {
|
|
542
|
-
const p = await e.markConversationRead(
|
|
542
|
+
const p = await e.markConversationRead(h, m), d = (p == null ? void 0 : p.last_read_message_id) ?? m, f = t.conversations.findIndex((_) => (_ == null ? void 0 : _.id) === h);
|
|
543
543
|
f !== -1 && (t.conversations[f] = {
|
|
544
544
|
...t.conversations[f],
|
|
545
545
|
last_read_message_id: d
|
|
@@ -548,14 +548,14 @@ function Qe(e) {
|
|
|
548
548
|
console.error("[store] markConversationRead failed", p);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
async function H(
|
|
551
|
+
async function H(h, m, { attachments: p, metadata: d } = {}) {
|
|
552
552
|
var F;
|
|
553
|
-
const f = (
|
|
554
|
-
if (!
|
|
555
|
-
const y =
|
|
553
|
+
const f = (m || "").trim(), _ = Array.isArray(p) && p.length > 0;
|
|
554
|
+
if (!h || !f && !_) return;
|
|
555
|
+
const y = Qe(), w = ne(h), S = {
|
|
556
556
|
id: y,
|
|
557
557
|
client_msg_id: y,
|
|
558
|
-
conversation_id:
|
|
558
|
+
conversation_id: h,
|
|
559
559
|
type: "content",
|
|
560
560
|
text_md: f,
|
|
561
561
|
author: {
|
|
@@ -568,9 +568,9 @@ function Qe(e) {
|
|
|
568
568
|
..._ ? { payload: { type: "content", attachments: p } } : {},
|
|
569
569
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
570
570
|
};
|
|
571
|
-
Y(
|
|
571
|
+
Y(h, S);
|
|
572
572
|
try {
|
|
573
|
-
await e.postMessage(
|
|
573
|
+
await e.postMessage(h, {
|
|
574
574
|
client_msg_id: y,
|
|
575
575
|
text_md: f,
|
|
576
576
|
created_at: w,
|
|
@@ -578,32 +578,32 @@ function Qe(e) {
|
|
|
578
578
|
...d && typeof d == "object" ? { metadata: d } : {}
|
|
579
579
|
});
|
|
580
580
|
} catch (O) {
|
|
581
|
-
console.error("[store] send failed", O), q(
|
|
581
|
+
console.error("[store] send failed", O), q(h, y, {
|
|
582
582
|
_failed: !0,
|
|
583
583
|
_pending: !1
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
async function M(
|
|
588
|
-
|
|
587
|
+
async function M(h, m, p) {
|
|
588
|
+
h != null && (t.awaitingCallback[h] = !0);
|
|
589
589
|
try {
|
|
590
|
-
await e.postCallback(
|
|
590
|
+
await e.postCallback(h, m, p);
|
|
591
591
|
} catch (d) {
|
|
592
|
-
console.error("[store] callback failed", d),
|
|
592
|
+
console.error("[store] callback failed", d), h != null && delete t.awaitingCallback[h];
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
const
|
|
596
|
-
async function N(
|
|
597
|
-
if (!
|
|
598
|
-
const
|
|
599
|
-
if (
|
|
600
|
-
const p =
|
|
601
|
-
if (!p || p - Date.now() > 6e4) return
|
|
595
|
+
const D = /* @__PURE__ */ new Map();
|
|
596
|
+
async function N(h) {
|
|
597
|
+
if (!h) return null;
|
|
598
|
+
const m = D.get(h);
|
|
599
|
+
if (m != null && m.url) {
|
|
600
|
+
const p = m.expires_at ? Date.parse(m.expires_at) : 0;
|
|
601
|
+
if (!p || p - Date.now() > 6e4) return m.url;
|
|
602
602
|
}
|
|
603
603
|
try {
|
|
604
|
-
const p = await e.signAttachment(
|
|
604
|
+
const p = await e.signAttachment(h);
|
|
605
605
|
if (p != null && p.signed_url)
|
|
606
|
-
return
|
|
606
|
+
return D.set(h, {
|
|
607
607
|
url: p.signed_url,
|
|
608
608
|
expires_at: p.expires_at
|
|
609
609
|
}), p.signed_url;
|
|
@@ -612,32 +612,32 @@ function Qe(e) {
|
|
|
612
612
|
}
|
|
613
613
|
return null;
|
|
614
614
|
}
|
|
615
|
-
async function $(
|
|
616
|
-
const d = t.conversations.find((y) => y.id ===
|
|
615
|
+
async function $(h, { rating: m, comment: p } = {}) {
|
|
616
|
+
const d = t.conversations.find((y) => y.id === h), _ = {
|
|
617
617
|
...(d == null ? void 0 : d.metadata) || {},
|
|
618
618
|
feedback: {
|
|
619
|
-
rating:
|
|
619
|
+
rating: m,
|
|
620
620
|
comment: p || null,
|
|
621
621
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
|
-
await T(
|
|
624
|
+
await T(h, { metadata: _ });
|
|
625
625
|
}
|
|
626
|
-
function K(
|
|
626
|
+
function K(h) {
|
|
627
627
|
var p, d;
|
|
628
|
-
const
|
|
629
|
-
for (let f =
|
|
630
|
-
const _ =
|
|
628
|
+
const m = t.messagesByConv[h] || [];
|
|
629
|
+
for (let f = m.length - 1; f >= 0; f--) {
|
|
630
|
+
const _ = m[f];
|
|
631
631
|
if ((_ == null ? void 0 : _.type) === "action" && ((p = _ == null ? void 0 : _.payload) == null ? void 0 : p.type) === "action" && ((d = _ == null ? void 0 : _.payload) == null ? void 0 : d.state) === "pending" && Array.isArray(_ == null ? void 0 : _.callbacks) && _.callbacks.length > 0 && !t.awaitingCallback[_.id])
|
|
632
632
|
return _;
|
|
633
633
|
}
|
|
634
634
|
return null;
|
|
635
635
|
}
|
|
636
|
-
function ee(
|
|
636
|
+
function ee(h) {
|
|
637
637
|
var p, d, f;
|
|
638
|
-
const
|
|
639
|
-
for (let _ =
|
|
640
|
-
const y =
|
|
638
|
+
const m = t.messagesByConv[h] || [];
|
|
639
|
+
for (let _ = m.length - 1; _ >= 0; _--) {
|
|
640
|
+
const y = m[_];
|
|
641
641
|
if (((p = y == null ? void 0 : y.author) == null ? void 0 : p.type) === "user" || (y == null ? void 0 : y.type) === "action" && ((d = y == null ? void 0 : y.payload) == null ? void 0 : d.state) === "pending")
|
|
642
642
|
return null;
|
|
643
643
|
const w = (f = y == null ? void 0 : y.metadata) == null ? void 0 : f.form;
|
|
@@ -646,19 +646,19 @@ function Qe(e) {
|
|
|
646
646
|
}
|
|
647
647
|
return null;
|
|
648
648
|
}
|
|
649
|
-
function te(
|
|
650
|
-
const
|
|
651
|
-
if (!
|
|
652
|
-
const p = Object.keys(
|
|
649
|
+
function te(h) {
|
|
650
|
+
const m = t.runningActionsByConv[h];
|
|
651
|
+
if (!m) return null;
|
|
652
|
+
const p = Object.keys(m);
|
|
653
653
|
if (p.length === 0) return null;
|
|
654
654
|
const d = p[0];
|
|
655
|
-
return { id: d, payload: { name:
|
|
655
|
+
return { id: d, payload: { name: m[d] } };
|
|
656
656
|
}
|
|
657
|
-
function G(
|
|
657
|
+
function G(h) {
|
|
658
658
|
var p, d, f, _;
|
|
659
|
-
const
|
|
660
|
-
for (let y =
|
|
661
|
-
const w =
|
|
659
|
+
const m = t.messagesByConv[h] || [];
|
|
660
|
+
for (let y = m.length - 1; y >= 0; y--) {
|
|
661
|
+
const w = m[y];
|
|
662
662
|
if (((p = w == null ? void 0 : w.author) == null ? void 0 : p.type) === "user") return [];
|
|
663
663
|
if ((w == null ? void 0 : w.type) === "action" && ((d = w == null ? void 0 : w.payload) == null ? void 0 : d.state) === "pending")
|
|
664
664
|
return [];
|
|
@@ -672,75 +672,75 @@ function Qe(e) {
|
|
|
672
672
|
if (F && typeof F == "object" && typeof F.label == "string") {
|
|
673
673
|
const O = F.label.trim();
|
|
674
674
|
if (!O) return null;
|
|
675
|
-
const
|
|
676
|
-
return { label: O, kind:
|
|
675
|
+
const Ne = F.kind === "cta" || F.kind === "choice" || F.kind === "followup" ? F.kind : null;
|
|
676
|
+
return { label: O, kind: Ne };
|
|
677
677
|
}
|
|
678
678
|
return null;
|
|
679
679
|
}).filter(Boolean).slice(0, 4) : [];
|
|
680
680
|
}
|
|
681
681
|
return [];
|
|
682
682
|
}
|
|
683
|
-
function Y(
|
|
683
|
+
function Y(h, m) {
|
|
684
684
|
var _;
|
|
685
|
-
const p = t.messagesByConv[
|
|
685
|
+
const p = t.messagesByConv[h] || [];
|
|
686
686
|
let d = -1;
|
|
687
|
-
|
|
688
|
-
(y) => (y == null ? void 0 : y.client_msg_id) && y.client_msg_id ===
|
|
689
|
-
)), d === -1 && (
|
|
687
|
+
m != null && m.client_msg_id && (d = p.findIndex(
|
|
688
|
+
(y) => (y == null ? void 0 : y.client_msg_id) && y.client_msg_id === m.client_msg_id
|
|
689
|
+
)), d === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (d = p.findIndex((y) => Q(y == null ? void 0 : y.id, m.id)));
|
|
690
690
|
let f;
|
|
691
|
-
d === -1 ? f = [...p,
|
|
691
|
+
d === -1 ? f = [...p, m].sort(ce) : (f = p.slice(), f[d] = {
|
|
692
692
|
...p[d],
|
|
693
|
-
...
|
|
693
|
+
...m,
|
|
694
694
|
_pending: !1,
|
|
695
695
|
_failed: !1
|
|
696
|
-
}), t.messagesByConv[
|
|
696
|
+
}), t.messagesByConv[h] = f, (m == null ? void 0 : m.type) === "action" && ((_ = m == null ? void 0 : m.payload) != null && _.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && t.awaitingCallback[m.id] && delete t.awaitingCallback[m.id];
|
|
697
697
|
}
|
|
698
|
-
function Q(
|
|
699
|
-
return
|
|
698
|
+
function Q(h, m) {
|
|
699
|
+
return h === m ? !0 : h == null || m == null ? !1 : String(h) === String(m);
|
|
700
700
|
}
|
|
701
|
-
function q(
|
|
702
|
-
const d = t.messagesByConv[
|
|
701
|
+
function q(h, m, p) {
|
|
702
|
+
const d = t.messagesByConv[h];
|
|
703
703
|
if (!d) return;
|
|
704
|
-
const f = d.findIndex((y) => y.id ===
|
|
704
|
+
const f = d.findIndex((y) => y.id === m);
|
|
705
705
|
if (f === -1) return;
|
|
706
706
|
const _ = d.slice();
|
|
707
|
-
_[f] = { ...d[f], ...p }, t.messagesByConv[
|
|
707
|
+
_[f] = { ...d[f], ...p }, t.messagesByConv[h] = _;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
const p = t.conversations.findIndex((f) => f.id ===
|
|
709
|
+
function me(h, m) {
|
|
710
|
+
const p = t.conversations.findIndex((f) => f.id === h);
|
|
711
711
|
if (p === -1) return;
|
|
712
712
|
const d = t.conversations[p];
|
|
713
|
-
if (
|
|
713
|
+
if (m && (!d.last_message_at || m > d.last_message_at)) {
|
|
714
714
|
const f = t.conversations.slice();
|
|
715
|
-
f[p] = { ...d, last_message_at:
|
|
715
|
+
f[p] = { ...d, last_message_at: m }, f.sort(
|
|
716
716
|
(_, y) => (y.last_message_at || "").localeCompare(_.last_message_at || "")
|
|
717
717
|
), t.conversations = f;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
return (
|
|
720
|
+
function ce(h, m) {
|
|
721
|
+
return (h.created_at || "").localeCompare(m.created_at || "");
|
|
722
722
|
}
|
|
723
|
-
function
|
|
724
|
-
if (!
|
|
725
|
-
const
|
|
726
|
-
for (const [d, f] of Object.entries(
|
|
727
|
-
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (
|
|
728
|
-
return Object.keys(p).length && (
|
|
723
|
+
function de(h) {
|
|
724
|
+
if (!h || typeof h != "object") return null;
|
|
725
|
+
const m = {}, p = {};
|
|
726
|
+
for (const [d, f] of Object.entries(h))
|
|
727
|
+
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (m[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(p, f) : p[d] = f);
|
|
728
|
+
return Object.keys(p).length && (m.values = p), Object.keys(m).length ? m : null;
|
|
729
729
|
}
|
|
730
|
-
function ne(
|
|
731
|
-
const
|
|
730
|
+
function ne(h) {
|
|
731
|
+
const m = t.messagesByConv[h] || [];
|
|
732
732
|
let p = "";
|
|
733
|
-
for (const _ of
|
|
733
|
+
for (const _ of m)
|
|
734
734
|
_ != null && _.created_at && _.created_at > p && (p = _.created_at);
|
|
735
735
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
736
736
|
return !p || d > p ? d : new Date(Date.parse(p) + 1).toISOString();
|
|
737
737
|
}
|
|
738
738
|
return {
|
|
739
739
|
state: t,
|
|
740
|
-
start:
|
|
741
|
-
destroy:
|
|
740
|
+
start: i,
|
|
741
|
+
destroy: r,
|
|
742
742
|
applyCustomer: s,
|
|
743
|
-
createConversation:
|
|
743
|
+
createConversation: a,
|
|
744
744
|
openConversation: g,
|
|
745
745
|
loadMore: C,
|
|
746
746
|
fetchSinceLast: B,
|
|
@@ -791,7 +791,7 @@ function Oe(e = "") {
|
|
|
791
791
|
function Le(e = /* @__PURE__ */ new Date(), t = "fr-FR") {
|
|
792
792
|
return e.toLocaleTimeString(t, { hour: "2-digit", minute: "2-digit" });
|
|
793
793
|
}
|
|
794
|
-
const
|
|
794
|
+
const Je = `
|
|
795
795
|
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
|
|
796
796
|
|
|
797
797
|
.wm-root {
|
|
@@ -837,7 +837,7 @@ const Xe = `
|
|
|
837
837
|
0% { transform: translateX(110%); opacity: 0; }
|
|
838
838
|
100% { transform: translateX(0); opacity: 1; }
|
|
839
839
|
}
|
|
840
|
-
`,
|
|
840
|
+
`, Ze = "https://api.messenger.victorc.fr", ie = "fr", et = ["fr", "en"], we = { fr: "fr-FR", en: "en-US" }, _e = {
|
|
841
841
|
fr: {
|
|
842
842
|
// ── Common ───────────────────────────────────────────────────────
|
|
843
843
|
"common.newConversation": "Nouvelle conversation",
|
|
@@ -1080,67 +1080,67 @@ I reply within seconds.`,
|
|
|
1080
1080
|
}
|
|
1081
1081
|
};
|
|
1082
1082
|
function ge(e) {
|
|
1083
|
-
if (typeof e != "string") return
|
|
1083
|
+
if (typeof e != "string") return ie;
|
|
1084
1084
|
const t = e.trim().toLowerCase().slice(0, 2);
|
|
1085
|
-
return
|
|
1085
|
+
return et.includes(t) ? t : ie;
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return we[ge(e)] || we[
|
|
1087
|
+
function oe(e) {
|
|
1088
|
+
return we[ge(e)] || we[ie];
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const t = ge(e), n = _e[t] || _e[
|
|
1092
|
-
return function(s,
|
|
1090
|
+
function P(e) {
|
|
1091
|
+
const t = ge(e), n = _e[t] || _e[ie], i = _e[ie];
|
|
1092
|
+
return function(s, a) {
|
|
1093
1093
|
let l = n[s];
|
|
1094
|
-
return l == null && (l =
|
|
1094
|
+
return l == null && (l = i[s]), l == null ? s : (a && (l = l.replace(
|
|
1095
1095
|
/\{(\w+)\}/g,
|
|
1096
|
-
(g, C) =>
|
|
1096
|
+
(g, C) => a[C] != null ? String(a[C]) : g
|
|
1097
1097
|
)), l);
|
|
1098
1098
|
};
|
|
1099
1099
|
}
|
|
1100
1100
|
function ke(e, t) {
|
|
1101
1101
|
if (!Array.isArray(e == null ? void 0 : e.options)) return t;
|
|
1102
|
-
const n = e.options.find((
|
|
1102
|
+
const n = e.options.find((i) => (i == null ? void 0 : i.value) === t);
|
|
1103
1103
|
return (n == null ? void 0 : n.label) || t;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1106
|
-
return Array.isArray(t) ? t.map((
|
|
1105
|
+
function Ie(e, t, n) {
|
|
1106
|
+
return Array.isArray(t) ? t.map((i) => ke(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : ke(e, String(t));
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function tt(e, t, n = P()) {
|
|
1109
1109
|
if (!e || !t) return "";
|
|
1110
|
-
const
|
|
1111
|
-
for (const s of
|
|
1110
|
+
const i = Array.isArray(e.fields) ? e.fields : [], r = [];
|
|
1111
|
+
for (const s of i) {
|
|
1112
1112
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1113
|
-
const
|
|
1114
|
-
if (
|
|
1115
|
-
const l =
|
|
1116
|
-
l &&
|
|
1113
|
+
const a = t[s.key];
|
|
1114
|
+
if (a == null || a === "") continue;
|
|
1115
|
+
const l = Ie(s, a, n);
|
|
1116
|
+
l && r.push(`${s.label} :
|
|
1117
1117
|
${l}`);
|
|
1118
1118
|
}
|
|
1119
|
-
return
|
|
1119
|
+
return r.join(`
|
|
1120
1120
|
|
|
1121
1121
|
`);
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1124
|
-
const
|
|
1125
|
-
for (const s of
|
|
1123
|
+
function nt(e, t, n = P()) {
|
|
1124
|
+
const i = [], r = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
|
|
1125
|
+
for (const s of r) {
|
|
1126
1126
|
if (!(s != null && s.key) || !(s != null && s.label)) continue;
|
|
1127
|
-
const
|
|
1128
|
-
if (
|
|
1129
|
-
const l =
|
|
1127
|
+
const a = t == null ? void 0 : t[s.key];
|
|
1128
|
+
if (a == null || a === "") continue;
|
|
1129
|
+
const l = Ie(s, a, n);
|
|
1130
1130
|
if (!l) continue;
|
|
1131
1131
|
const g = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
|
|
1132
1132
|
`));
|
|
1133
|
-
|
|
1133
|
+
i.push({ label: s.label, value: l, multiline: g });
|
|
1134
1134
|
}
|
|
1135
1135
|
return {
|
|
1136
1136
|
kind: "form_response",
|
|
1137
1137
|
data: {
|
|
1138
1138
|
title: (e == null ? void 0 : e.title) || n("form.title"),
|
|
1139
|
-
fields:
|
|
1139
|
+
fields: i
|
|
1140
1140
|
}
|
|
1141
1141
|
};
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function ae(e) {
|
|
1144
1144
|
var n;
|
|
1145
1145
|
const t = (n = e == null ? void 0 : e.author) == null ? void 0 : n.type;
|
|
1146
1146
|
return t === "agent_ia" || t === "agent_human";
|
|
@@ -1152,53 +1152,55 @@ function J(e) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
function Ce(e, t) {
|
|
1154
1154
|
let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
|
|
1155
|
-
for (const
|
|
1156
|
-
|
|
1155
|
+
for (const i of t)
|
|
1156
|
+
i != null && i.created_at && i.created_at > n && (n = i.created_at);
|
|
1157
1157
|
return n;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1160
|
-
var n,
|
|
1159
|
+
function st(e, t) {
|
|
1160
|
+
var n, i, r;
|
|
1161
1161
|
for (let s = t.length - 1; s >= 0; s--) {
|
|
1162
|
-
const
|
|
1163
|
-
if (!
|
|
1164
|
-
const l = typeof
|
|
1162
|
+
const a = t[s];
|
|
1163
|
+
if (!a) continue;
|
|
1164
|
+
const l = typeof a.text_md == "string" ? a.text_md.trim() : "";
|
|
1165
1165
|
if (l)
|
|
1166
|
-
return (((n =
|
|
1167
|
-
const g = (
|
|
1166
|
+
return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
|
|
1167
|
+
const g = (i = a.payload) == null ? void 0 : i.attachments;
|
|
1168
1168
|
if (Array.isArray(g) && g.length) return "📎 Pièce jointe";
|
|
1169
1169
|
}
|
|
1170
|
-
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((
|
|
1170
|
+
return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((r = e == null ? void 0 : e.metadata) == null ? void 0 : r.last_preview) || "";
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function rt(e, t) {
|
|
1173
1173
|
return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? t("common.you") : (e == null ? void 0 : e.type) === "agent_human" ? t("common.agent") : (e == null ? void 0 : e.type) === "agent_ia" ? t("common.aiAssistant") : t("common.system"));
|
|
1174
1174
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const
|
|
1175
|
+
function it(e, t, n, i) {
|
|
1176
|
+
const r = [
|
|
1177
1177
|
`# ${e.name || n("common.conversation")}`,
|
|
1178
|
-
e.created_at ? n("export.createdOn", {
|
|
1178
|
+
e.created_at ? n("export.createdOn", {
|
|
1179
|
+
date: new Date(e.created_at).toLocaleString(i)
|
|
1180
|
+
}) : "",
|
|
1179
1181
|
""
|
|
1180
1182
|
];
|
|
1181
1183
|
for (const s of t) {
|
|
1182
1184
|
if (!s) continue;
|
|
1183
|
-
const
|
|
1184
|
-
if (!
|
|
1185
|
-
const l =
|
|
1186
|
-
|
|
1185
|
+
const a = (s.text_md || "").trim();
|
|
1186
|
+
if (!a) continue;
|
|
1187
|
+
const l = rt(s.author, n), g = s.created_at ? new Date(s.created_at).toLocaleString(i) : "";
|
|
1188
|
+
r.push(`[${g}] ${l} :`), r.push(a), r.push("");
|
|
1187
1189
|
}
|
|
1188
|
-
return
|
|
1190
|
+
return r.join(`
|
|
1189
1191
|
`);
|
|
1190
1192
|
}
|
|
1191
|
-
function
|
|
1193
|
+
function at(e, t, n = P(), i) {
|
|
1192
1194
|
if (!e) return;
|
|
1193
|
-
const
|
|
1195
|
+
const r = it(e, t || [], n, oe(i)), s = new Blob([r], { type: "text/plain;charset=utf-8" });
|
|
1194
1196
|
try {
|
|
1195
|
-
const
|
|
1196
|
-
l.href =
|
|
1197
|
-
} catch (
|
|
1198
|
-
console.error("[ww-messenger] export failed",
|
|
1197
|
+
const a = URL.createObjectURL(s), l = document.createElement("a");
|
|
1198
|
+
l.href = a, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(a), 1e3);
|
|
1199
|
+
} catch (a) {
|
|
1200
|
+
console.error("[ww-messenger] export failed", a);
|
|
1199
1201
|
}
|
|
1200
1202
|
}
|
|
1201
|
-
const
|
|
1203
|
+
const ot = {
|
|
1202
1204
|
data() {
|
|
1203
1205
|
const e = typeof Notification < "u";
|
|
1204
1206
|
return {
|
|
@@ -1308,10 +1310,10 @@ const at = {
|
|
|
1308
1310
|
// at message-arrival time because the user may have closed the
|
|
1309
1311
|
// panel or switched threads during the typing dwell.
|
|
1310
1312
|
onMessageRevealed(e, t) {
|
|
1311
|
-
var
|
|
1312
|
-
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !
|
|
1313
|
+
var r;
|
|
1314
|
+
if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !ae(e)) return;
|
|
1313
1315
|
const n = typeof document < "u" && document.hidden;
|
|
1314
|
-
this.isOpen && !n && ((
|
|
1316
|
+
this.isOpen && !n && ((r = this.currentConv) == null ? void 0 : r.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
|
|
1315
1317
|
},
|
|
1316
1318
|
playNotificationSound() {
|
|
1317
1319
|
if (typeof window > "u") return;
|
|
@@ -1325,41 +1327,38 @@ const at = {
|
|
|
1325
1327
|
t.resume();
|
|
1326
1328
|
} catch {
|
|
1327
1329
|
}
|
|
1328
|
-
const n = t.currentTime,
|
|
1329
|
-
|
|
1330
|
+
const n = t.currentTime, i = t.createOscillator(), r = t.createGain();
|
|
1331
|
+
i.connect(r), r.connect(t.destination), i.type = "sine", i.frequency.setValueAtTime(880, n), i.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), i.start(n), i.stop(n + 0.32);
|
|
1330
1332
|
} catch {
|
|
1331
1333
|
}
|
|
1332
1334
|
},
|
|
1333
1335
|
showBrowserNotification(e, t) {
|
|
1334
|
-
var i;
|
|
1335
1336
|
if (typeof Notification > "u" || Notification.permission !== "granted") return;
|
|
1336
|
-
const n = this.
|
|
1337
|
-
(l) => (l == null ? void 0 : l.id) === e
|
|
1338
|
-
), r = (n == null ? void 0 : n.name) || ((i = this.widget) == null ? void 0 : i.name) || this.t("notification.newMessage"), a = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", s = a ? a.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1337
|
+
const n = t == null ? void 0 : t.author, i = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), a = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = a ? a.slice(0, 140) : this.t("notification.youHaveNewMessage");
|
|
1339
1338
|
try {
|
|
1340
|
-
const
|
|
1341
|
-
body:
|
|
1339
|
+
const g = new Notification(s, {
|
|
1340
|
+
body: l,
|
|
1342
1341
|
tag: `wm-${e}`,
|
|
1343
1342
|
renotify: !1,
|
|
1344
1343
|
silent: !0
|
|
1345
1344
|
});
|
|
1346
|
-
|
|
1345
|
+
g.onclick = () => {
|
|
1347
1346
|
try {
|
|
1348
1347
|
window.focus();
|
|
1349
1348
|
} catch {
|
|
1350
1349
|
}
|
|
1351
1350
|
this.draftConv = null, this.showOnboarding = !1, this.activeConvId = e, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
|
|
1352
1351
|
try {
|
|
1353
|
-
|
|
1352
|
+
g.close();
|
|
1354
1353
|
} catch {
|
|
1355
1354
|
}
|
|
1356
1355
|
};
|
|
1357
|
-
} catch (
|
|
1358
|
-
console.warn("[ww-messenger] notification failed",
|
|
1356
|
+
} catch (g) {
|
|
1357
|
+
console.warn("[ww-messenger] notification failed", g);
|
|
1359
1358
|
}
|
|
1360
1359
|
}
|
|
1361
1360
|
}
|
|
1362
|
-
},
|
|
1361
|
+
}, lt = 450, ct = 50, dt = 900, ut = 12e3, ht = 300, mt = {
|
|
1363
1362
|
data() {
|
|
1364
1363
|
return {
|
|
1365
1364
|
// Map: messageId → ms timestamp once shown.
|
|
@@ -1394,18 +1393,18 @@ const at = {
|
|
|
1394
1393
|
var n;
|
|
1395
1394
|
if (!this.transport) return;
|
|
1396
1395
|
this.teardownLiveReveal();
|
|
1397
|
-
const e = this.transport.on("message", (
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1396
|
+
const e = this.transport.on("message", (i) => {
|
|
1397
|
+
const r = i == null ? void 0 : i.conversation_id, s = i == null ? void 0 : i.message;
|
|
1398
|
+
r && s && this.paceLiveMessage(s, r);
|
|
1400
1399
|
});
|
|
1401
1400
|
this._liveRevealConvSnapshot = new Map(
|
|
1402
|
-
(((n = this.s) == null ? void 0 : n.conversations) || []).map((
|
|
1403
|
-
|
|
1404
|
-
(
|
|
1401
|
+
(((n = this.s) == null ? void 0 : n.conversations) || []).map((i) => [
|
|
1402
|
+
i.id,
|
|
1403
|
+
(i == null ? void 0 : i.last_message_at) || ""
|
|
1405
1404
|
])
|
|
1406
1405
|
);
|
|
1407
|
-
const t = this.transport.on("activity", (
|
|
1408
|
-
this.handleLiveActivity(
|
|
1406
|
+
const t = this.transport.on("activity", (i) => {
|
|
1407
|
+
this.handleLiveActivity(i);
|
|
1409
1408
|
});
|
|
1410
1409
|
this._liveRevealOff = () => {
|
|
1411
1410
|
try {
|
|
@@ -1435,25 +1434,25 @@ const at = {
|
|
|
1435
1434
|
// on background convs when SSE wasn't open at the moment they
|
|
1436
1435
|
// arrived.
|
|
1437
1436
|
async handleLiveActivity(e) {
|
|
1438
|
-
var
|
|
1437
|
+
var r, s;
|
|
1439
1438
|
const t = e == null ? void 0 : e.conversations;
|
|
1440
1439
|
if (!Array.isArray(t) || !this.store) return;
|
|
1441
|
-
const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(),
|
|
1442
|
-
for (const
|
|
1443
|
-
if (!(
|
|
1444
|
-
const l =
|
|
1440
|
+
const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), i = [];
|
|
1441
|
+
for (const a of t) {
|
|
1442
|
+
if (!(a != null && a.id)) continue;
|
|
1443
|
+
const l = a.last_message_at || "";
|
|
1445
1444
|
if (!l) continue;
|
|
1446
|
-
const g = n.get(
|
|
1447
|
-
l > g &&
|
|
1445
|
+
const g = n.get(a.id) || "";
|
|
1446
|
+
l > g && i.push(a.id);
|
|
1448
1447
|
}
|
|
1449
1448
|
this._liveRevealConvSnapshot = new Map(
|
|
1450
|
-
t.map((
|
|
1449
|
+
t.map((a) => [a.id, (a == null ? void 0 : a.last_message_at) || ""])
|
|
1451
1450
|
);
|
|
1452
|
-
for (const
|
|
1451
|
+
for (const a of i)
|
|
1453
1452
|
try {
|
|
1454
|
-
const l = await ((s = (
|
|
1453
|
+
const l = await ((s = (r = this.store).fetchSinceLast) == null ? void 0 : s.call(r, a));
|
|
1455
1454
|
if (!Array.isArray(l)) continue;
|
|
1456
|
-
for (const g of l) this.paceLiveMessage(g,
|
|
1455
|
+
for (const g of l) this.paceLiveMessage(g, a);
|
|
1457
1456
|
} catch (l) {
|
|
1458
1457
|
console.error(
|
|
1459
1458
|
"[ww-messenger] activity delta fetch failed",
|
|
@@ -1467,15 +1466,15 @@ const at = {
|
|
|
1467
1466
|
// - inter-bubble gap scales with message length (reading time),
|
|
1468
1467
|
// bounded by MIN/MAX_TYPING_MS.
|
|
1469
1468
|
scheduleReveal(e, t) {
|
|
1470
|
-
const n = Date.now(),
|
|
1471
|
-
|
|
1472
|
-
Math.max(
|
|
1473
|
-
),
|
|
1474
|
-
n +
|
|
1475
|
-
this.nextRevealAt +
|
|
1476
|
-
) +
|
|
1477
|
-
this.nextRevealAt =
|
|
1478
|
-
const l = Math.max(0,
|
|
1469
|
+
const n = Date.now(), i = ((e == null ? void 0 : e.text_md) || "").length, r = Math.min(
|
|
1470
|
+
ut,
|
|
1471
|
+
Math.max(dt, i * ct)
|
|
1472
|
+
), a = Math.max(
|
|
1473
|
+
n + lt,
|
|
1474
|
+
this.nextRevealAt + ht
|
|
1475
|
+
) + r;
|
|
1476
|
+
this.nextRevealAt = a;
|
|
1477
|
+
const l = Math.max(0, a - n), g = e.id, C = setTimeout(() => {
|
|
1479
1478
|
this.revealedAt = { ...this.revealedAt, [g]: Date.now() }, this.revealTimers = this.revealTimers.filter((k) => k !== C), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
|
|
1480
1479
|
}, l);
|
|
1481
1480
|
this.revealTimers.push(C);
|
|
@@ -1486,28 +1485,28 @@ const at = {
|
|
|
1486
1485
|
// history (instant) and any live message that the transport
|
|
1487
1486
|
// subscription already paced (idempotent on msg.id).
|
|
1488
1487
|
paceMessages(e, t) {
|
|
1489
|
-
var
|
|
1488
|
+
var r;
|
|
1490
1489
|
if (!Array.isArray(e) || !e.length) return;
|
|
1491
|
-
const n = Date.now(),
|
|
1490
|
+
const n = Date.now(), i = { ...this.revealedAt };
|
|
1492
1491
|
for (const s of e) {
|
|
1493
|
-
if ((s == null ? void 0 : s.id) == null ||
|
|
1494
|
-
if (!
|
|
1495
|
-
|
|
1492
|
+
if ((s == null ? void 0 : s.id) == null || i[s.id] !== void 0) continue;
|
|
1493
|
+
if (!ae(s)) {
|
|
1494
|
+
i[s.id] = n;
|
|
1496
1495
|
continue;
|
|
1497
1496
|
}
|
|
1498
|
-
const
|
|
1499
|
-
if (!Number.isFinite(
|
|
1500
|
-
|
|
1497
|
+
const a = s != null && s.created_at ? Date.parse(s.created_at) : NaN;
|
|
1498
|
+
if (!Number.isFinite(a) || a < this.convOpenedAt) {
|
|
1499
|
+
i[s.id] = n;
|
|
1501
1500
|
continue;
|
|
1502
1501
|
}
|
|
1503
|
-
const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((
|
|
1502
|
+
const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((r = s == null ? void 0 : s.payload) == null ? void 0 : r.attachments) && s.payload.attachments.length > 0;
|
|
1504
1503
|
if (!l && !g) {
|
|
1505
|
-
|
|
1504
|
+
i[s.id] = n;
|
|
1506
1505
|
continue;
|
|
1507
1506
|
}
|
|
1508
|
-
|
|
1507
|
+
i[s.id] = 0, this.scheduleReveal(s, t);
|
|
1509
1508
|
}
|
|
1510
|
-
this.revealedAt =
|
|
1509
|
+
this.revealedAt = i;
|
|
1511
1510
|
},
|
|
1512
1511
|
// Pace a single live message from any conversation. Called from the
|
|
1513
1512
|
// transport 'message' subscription (live SSE arrival) and from the
|
|
@@ -1520,21 +1519,21 @@ const at = {
|
|
|
1520
1519
|
// by definition live, even on convs the user never viewed this
|
|
1521
1520
|
// session.
|
|
1522
1521
|
paceLiveMessage(e, t) {
|
|
1523
|
-
var
|
|
1522
|
+
var r;
|
|
1524
1523
|
if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
|
|
1525
|
-
if (!
|
|
1524
|
+
if (!ae(e)) {
|
|
1526
1525
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1527
1526
|
return;
|
|
1528
1527
|
}
|
|
1529
|
-
const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0,
|
|
1530
|
-
if (!n && !
|
|
1528
|
+
const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, i = Array.isArray((r = e == null ? void 0 : e.payload) == null ? void 0 : r.attachments) && e.payload.attachments.length > 0;
|
|
1529
|
+
if (!n && !i) {
|
|
1531
1530
|
this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
|
|
1532
1531
|
return;
|
|
1533
1532
|
}
|
|
1534
1533
|
this.revealedAt = { ...this.revealedAt, [e.id]: 0 }, this.scheduleReveal(e, t);
|
|
1535
1534
|
}
|
|
1536
1535
|
}
|
|
1537
|
-
},
|
|
1536
|
+
}, ft = {
|
|
1538
1537
|
data() {
|
|
1539
1538
|
return {
|
|
1540
1539
|
approvalSettled: !0,
|
|
@@ -1564,7 +1563,7 @@ const at = {
|
|
|
1564
1563
|
}, e);
|
|
1565
1564
|
}
|
|
1566
1565
|
}
|
|
1567
|
-
},
|
|
1566
|
+
}, _t = 300, pt = {
|
|
1568
1567
|
data() {
|
|
1569
1568
|
return {
|
|
1570
1569
|
// Numeric message id snapshot frozen the moment the user
|
|
@@ -1593,22 +1592,22 @@ const at = {
|
|
|
1593
1592
|
// messages, or when the pointer is already at/ahead of the
|
|
1594
1593
|
// candidate id.
|
|
1595
1594
|
markConvRead(e) {
|
|
1596
|
-
var s,
|
|
1595
|
+
var s, a;
|
|
1597
1596
|
if (!(e != null && e.id) || e._draft || !this.store) return;
|
|
1598
|
-
const t = ((
|
|
1597
|
+
const t = ((a = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : a[e.id]) || [], n = gt(t);
|
|
1599
1598
|
if (n == null) return;
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1599
|
+
const i = J(e.last_read_message_id), r = J(n);
|
|
1600
|
+
r != null && (i != null && r <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
|
|
1602
1601
|
const l = this._readMarkerPending;
|
|
1603
1602
|
this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
|
|
1604
1603
|
l.convId,
|
|
1605
1604
|
l.messageId
|
|
1606
1605
|
);
|
|
1607
|
-
},
|
|
1606
|
+
}, _t))));
|
|
1608
1607
|
}
|
|
1609
1608
|
}
|
|
1610
1609
|
};
|
|
1611
|
-
function
|
|
1610
|
+
function gt(e) {
|
|
1612
1611
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1613
1612
|
const n = e[t];
|
|
1614
1613
|
if (!(!n || n._pending) && J(n.id) != null)
|
|
@@ -1616,12 +1615,12 @@ function pt(e) {
|
|
|
1616
1615
|
}
|
|
1617
1616
|
return null;
|
|
1618
1617
|
}
|
|
1619
|
-
const
|
|
1618
|
+
const E = (e, t) => {
|
|
1620
1619
|
const n = e.__vccOpts || e;
|
|
1621
|
-
for (const [
|
|
1622
|
-
n[
|
|
1620
|
+
for (const [i, r] of t)
|
|
1621
|
+
n[i] = r;
|
|
1623
1622
|
return n;
|
|
1624
|
-
},
|
|
1623
|
+
}, vt = {
|
|
1625
1624
|
name: "WmHumanAvatar",
|
|
1626
1625
|
props: {
|
|
1627
1626
|
name: { type: String, default: "" },
|
|
@@ -1641,8 +1640,8 @@ const I = (e, t) => {
|
|
|
1641
1640
|
return Oe(this.name);
|
|
1642
1641
|
}
|
|
1643
1642
|
}
|
|
1644
|
-
},
|
|
1645
|
-
function
|
|
1643
|
+
}, yt = ["src", "alt"];
|
|
1644
|
+
function bt(e, t, n, i, r, s) {
|
|
1646
1645
|
return c(), u("div", {
|
|
1647
1646
|
class: x(["wm-huav", { "wm-huav--tail": n.tail }]),
|
|
1648
1647
|
style: W({
|
|
@@ -1656,19 +1655,19 @@ function yt(e, t, n, r, a, s) {
|
|
|
1656
1655
|
key: 0,
|
|
1657
1656
|
src: n.avatarUrl,
|
|
1658
1657
|
alt: n.name || ""
|
|
1659
|
-
}, null, 8,
|
|
1658
|
+
}, null, 8, yt)) : (c(), u("span", {
|
|
1660
1659
|
key: 1,
|
|
1661
1660
|
style: W({ fontSize: n.size * 0.36 + "px" })
|
|
1662
1661
|
}, v(s.initials), 5))
|
|
1663
1662
|
], 6);
|
|
1664
1663
|
}
|
|
1665
|
-
const
|
|
1664
|
+
const Ee = /* @__PURE__ */ E(vt, [["render", bt], ["__scopeId", "data-v-14e10c0d"]]), wt = 3, kt = {
|
|
1666
1665
|
name: "WmLauncher",
|
|
1667
|
-
components: { HumanAvatar:
|
|
1666
|
+
components: { HumanAvatar: Ee },
|
|
1668
1667
|
inject: {
|
|
1669
1668
|
// Translator shared by the Messenger shell; French fallback when
|
|
1670
1669
|
// the component is used standalone.
|
|
1671
|
-
t: { default: () =>
|
|
1670
|
+
t: { default: () => P() }
|
|
1672
1671
|
},
|
|
1673
1672
|
props: {
|
|
1674
1673
|
// Nombre de conversations non lues — pilote la pastille.
|
|
@@ -1685,15 +1684,15 @@ const Ie = /* @__PURE__ */ I(gt, [["render", yt], ["__scopeId", "data-v-14e10c0d
|
|
|
1685
1684
|
// élément en ordre DOM avec un flex column normal). Les plus
|
|
1686
1685
|
// anciens remontent dans la pile.
|
|
1687
1686
|
visiblePeeks() {
|
|
1688
|
-
return this.peeks.slice(0,
|
|
1687
|
+
return this.peeks.slice(0, wt).reverse();
|
|
1689
1688
|
}
|
|
1690
1689
|
}
|
|
1691
|
-
},
|
|
1692
|
-
function
|
|
1693
|
-
const
|
|
1694
|
-
return c(), u("div",
|
|
1695
|
-
z(
|
|
1696
|
-
default:
|
|
1690
|
+
}, Ct = { class: "wm-launcherWrap" }, At = ["aria-label", "onClick", "onKeydown"], St = ["aria-label", "onClick"], Mt = { class: "wm-peek__avatar" }, Tt = ["aria-label"], xt = { class: "wm-peek__body" }, Ot = { class: "wm-peek__head" }, Lt = { class: "wm-peek__name" }, It = { class: "wm-peek__action" }, Et = { class: "wm-peek__text" }, Bt = ["onClick"], Rt = ["aria-label"], Nt = ["aria-label"];
|
|
1691
|
+
function Ft(e, t, n, i, r, s) {
|
|
1692
|
+
const a = I("HumanAvatar");
|
|
1693
|
+
return c(), u("div", Ct, [
|
|
1694
|
+
z(je, { name: "wm-peek" }, {
|
|
1695
|
+
default: Pe(() => [
|
|
1697
1696
|
s.visiblePeeks.length ? (c(), u("div", {
|
|
1698
1697
|
key: 0,
|
|
1699
1698
|
class: x(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
@@ -1735,9 +1734,9 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1735
1734
|
}, [
|
|
1736
1735
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
1737
1736
|
], -1)
|
|
1738
|
-
])], 8,
|
|
1739
|
-
o("div",
|
|
1740
|
-
z(
|
|
1737
|
+
])], 8, St),
|
|
1738
|
+
o("div", Mt, [
|
|
1739
|
+
z(a, {
|
|
1741
1740
|
name: l.senderName,
|
|
1742
1741
|
"avatar-url": l.senderAvatarUrl,
|
|
1743
1742
|
size: 34
|
|
@@ -1746,12 +1745,12 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1746
1745
|
key: 0,
|
|
1747
1746
|
class: "wm-peek__avatarBadge",
|
|
1748
1747
|
"aria-label": s.t("launcher.unreadMessages", { count: l.count })
|
|
1749
|
-
}, v(l.count > 9 ? "9+" : l.count), 9,
|
|
1748
|
+
}, v(l.count > 9 ? "9+" : l.count), 9, Tt)) : b("", !0)
|
|
1750
1749
|
]),
|
|
1751
|
-
o("div",
|
|
1752
|
-
o("div",
|
|
1753
|
-
o("span",
|
|
1754
|
-
o("span",
|
|
1750
|
+
o("div", xt, [
|
|
1751
|
+
o("div", Ot, [
|
|
1752
|
+
o("span", Lt, v(l.senderName || s.t("common.agent")), 1),
|
|
1753
|
+
o("span", It, v(s.t("launcher.repliedToYou")), 1)
|
|
1755
1754
|
]),
|
|
1756
1755
|
o("p", Et, v(l.preview), 1)
|
|
1757
1756
|
]),
|
|
@@ -1759,8 +1758,8 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1759
1758
|
type: "button",
|
|
1760
1759
|
class: "wm-peek__open",
|
|
1761
1760
|
onClick: X((C) => e.$emit("open", l.convId), ["stop"])
|
|
1762
|
-
}, v(s.t("common.open")), 9,
|
|
1763
|
-
], 44,
|
|
1761
|
+
}, v(s.t("common.open")), 9, Bt)
|
|
1762
|
+
], 44, At))), 128))
|
|
1764
1763
|
], 2)) : b("", !0)
|
|
1765
1764
|
]),
|
|
1766
1765
|
_: 1
|
|
@@ -1792,11 +1791,11 @@ function Nt(e, t, n, r, a, s) {
|
|
|
1792
1791
|
}) : s.t("launcher.unreadConversationsOne", {
|
|
1793
1792
|
count: n.unreadCount
|
|
1794
1793
|
})
|
|
1795
|
-
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9,
|
|
1796
|
-
], 8,
|
|
1794
|
+
}, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Nt)) : b("", !0)
|
|
1795
|
+
], 8, Rt)
|
|
1797
1796
|
]);
|
|
1798
1797
|
}
|
|
1799
|
-
const
|
|
1798
|
+
const jt = /* @__PURE__ */ E(kt, [["render", Ft], ["__scopeId", "data-v-5193a529"]]), Pt = {
|
|
1800
1799
|
name: "WmAIAvatar",
|
|
1801
1800
|
props: {
|
|
1802
1801
|
size: { type: Number, default: 26 },
|
|
@@ -1811,8 +1810,8 @@ const Ft = /* @__PURE__ */ I(wt, [["render", Nt], ["__scopeId", "data-v-5193a529
|
|
|
1811
1810
|
}, Dt = {
|
|
1812
1811
|
key: 0,
|
|
1813
1812
|
class: "wm-aiav__pulse"
|
|
1814
|
-
},
|
|
1815
|
-
function
|
|
1813
|
+
}, Ut = ["width", "height"];
|
|
1814
|
+
function $t(e, t, n, i, r, s) {
|
|
1816
1815
|
return c(), u("div", {
|
|
1817
1816
|
class: x(["wm-aiav", { "wm-aiav--tail": n.tail }]),
|
|
1818
1817
|
style: W({
|
|
@@ -1851,11 +1850,11 @@ function Ut(e, t, n, r, a, s) {
|
|
|
1851
1850
|
fill: "white",
|
|
1852
1851
|
opacity: "0.38"
|
|
1853
1852
|
}, null, -1)
|
|
1854
|
-
])], 8,
|
|
1853
|
+
])], 8, Ut))
|
|
1855
1854
|
], 2)
|
|
1856
1855
|
], 6);
|
|
1857
1856
|
}
|
|
1858
|
-
const
|
|
1857
|
+
const le = /* @__PURE__ */ E(Pt, [["render", $t], ["__scopeId", "data-v-d621a129"]]), Ht = {
|
|
1859
1858
|
name: "WmTeamAvatars",
|
|
1860
1859
|
props: {
|
|
1861
1860
|
members: { type: Array, default: () => [] },
|
|
@@ -1877,45 +1876,45 @@ const oe = /* @__PURE__ */ I(jt, [["render", Ut], ["__scopeId", "data-v-d621a129
|
|
|
1877
1876
|
return Oe(e.name || "");
|
|
1878
1877
|
}
|
|
1879
1878
|
}
|
|
1880
|
-
},
|
|
1879
|
+
}, zt = {
|
|
1881
1880
|
key: 0,
|
|
1882
1881
|
class: "wm-team"
|
|
1883
|
-
},
|
|
1882
|
+
}, qt = ["src", "alt"], Vt = { key: 1 }, Wt = {
|
|
1884
1883
|
key: 0,
|
|
1885
1884
|
class: "wm-team__label"
|
|
1886
1885
|
};
|
|
1887
|
-
function
|
|
1888
|
-
return s.visible ? (c(), u("div",
|
|
1886
|
+
function Kt(e, t, n, i, r, s) {
|
|
1887
|
+
return s.visible ? (c(), u("div", zt, [
|
|
1889
1888
|
o("div", {
|
|
1890
1889
|
class: "wm-team__stack",
|
|
1891
1890
|
style: W({ width: s.stackWidth + "px" })
|
|
1892
1891
|
}, [
|
|
1893
|
-
(c(!0), u(L, null, j(n.members.slice(0, 3), (
|
|
1892
|
+
(c(!0), u(L, null, j(n.members.slice(0, 3), (a, l) => (c(), u("div", {
|
|
1894
1893
|
key: l,
|
|
1895
1894
|
class: "wm-team__pill",
|
|
1896
1895
|
style: W({
|
|
1897
1896
|
left: l * 13 + "px",
|
|
1898
1897
|
zIndex: 3 - l,
|
|
1899
|
-
background: s.colorFor(
|
|
1898
|
+
background: s.colorFor(a)
|
|
1900
1899
|
})
|
|
1901
1900
|
}, [
|
|
1902
|
-
|
|
1901
|
+
a.avatar_url ? (c(), u("img", {
|
|
1903
1902
|
key: 0,
|
|
1904
|
-
src:
|
|
1905
|
-
alt:
|
|
1906
|
-
}, null, 8,
|
|
1903
|
+
src: a.avatar_url,
|
|
1904
|
+
alt: a.name || ""
|
|
1905
|
+
}, null, 8, qt)) : (c(), u("span", Vt, v(s.initialsFor(a)), 1))
|
|
1907
1906
|
], 4))), 128))
|
|
1908
1907
|
], 4),
|
|
1909
|
-
n.responseLabel ? (c(), u("span",
|
|
1908
|
+
n.responseLabel ? (c(), u("span", Wt, v(n.responseLabel), 1)) : b("", !0)
|
|
1910
1909
|
])) : b("", !0);
|
|
1911
1910
|
}
|
|
1912
|
-
const
|
|
1911
|
+
const Gt = /* @__PURE__ */ E(Ht, [["render", Kt], ["__scopeId", "data-v-e49a9063"]]), Yt = {
|
|
1913
1912
|
name: "WmHeader",
|
|
1914
|
-
components: { AIAvatar:
|
|
1913
|
+
components: { AIAvatar: le, TeamAvatars: Gt },
|
|
1915
1914
|
inject: {
|
|
1916
1915
|
// Translator shared by the Messenger shell. Falls back to a French
|
|
1917
1916
|
// translator when the component is used standalone (no provider).
|
|
1918
|
-
t: { default: () =>
|
|
1917
|
+
t: { default: () => P() }
|
|
1919
1918
|
},
|
|
1920
1919
|
props: {
|
|
1921
1920
|
title: { type: String, default: "Nouvelle conversation" },
|
|
@@ -1941,21 +1940,21 @@ const Kt = /* @__PURE__ */ I($t, [["render", Wt], ["__scopeId", "data-v-e49a9063
|
|
|
1941
1940
|
const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
|
|
1942
1941
|
if (e.length <= 3) return e;
|
|
1943
1942
|
const t = (/* @__PURE__ */ new Date()).getHours() % e.length, n = [];
|
|
1944
|
-
for (let
|
|
1945
|
-
n.push(e[(t +
|
|
1943
|
+
for (let i = 0; i < 3; i++)
|
|
1944
|
+
n.push(e[(t + i) % e.length]);
|
|
1946
1945
|
return n;
|
|
1947
1946
|
}
|
|
1948
1947
|
}
|
|
1949
|
-
},
|
|
1948
|
+
}, Qt = { class: "wm-header" }, Xt = ["aria-label"], Jt = {
|
|
1950
1949
|
key: 1,
|
|
1951
1950
|
style: { width: "30px", height: "30px", "flex-shrink": "0" }
|
|
1952
|
-
},
|
|
1951
|
+
}, Zt = { class: "wm-header__avatar" }, en = { class: "wm-header__main" }, tn = { class: "wm-header__title" }, nn = {
|
|
1953
1952
|
key: 3,
|
|
1954
1953
|
class: "wm-header__fill"
|
|
1955
|
-
},
|
|
1956
|
-
function
|
|
1957
|
-
const
|
|
1958
|
-
return c(), u("div",
|
|
1954
|
+
}, sn = { class: "wm-header__actions" }, rn = ["aria-label", "title"], an = ["aria-label", "title"];
|
|
1955
|
+
function on(e, t, n, i, r, s) {
|
|
1956
|
+
const a = I("AIAvatar"), l = I("TeamAvatars");
|
|
1957
|
+
return c(), u("div", Qt, [
|
|
1959
1958
|
n.showBack ? (c(), u("button", {
|
|
1960
1959
|
key: 0,
|
|
1961
1960
|
type: "button",
|
|
@@ -1976,21 +1975,21 @@ function an(e, t, n, r, a, s) {
|
|
|
1976
1975
|
}, [
|
|
1977
1976
|
o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
|
|
1978
1977
|
], -1)
|
|
1979
|
-
])], 8,
|
|
1978
|
+
])], 8, Xt)) : (c(), u("div", Jt)),
|
|
1980
1979
|
n.showIdentity ? (c(), u(L, { key: 2 }, [
|
|
1981
|
-
o("div", Jt, [
|
|
1982
|
-
z(i, { size: 30 })
|
|
1983
|
-
]),
|
|
1984
1980
|
o("div", Zt, [
|
|
1985
|
-
|
|
1981
|
+
z(a, { size: 30 })
|
|
1982
|
+
]),
|
|
1983
|
+
o("div", en, [
|
|
1984
|
+
o("div", tn, v(n.title), 1)
|
|
1986
1985
|
]),
|
|
1987
1986
|
s.hasTeam ? (c(), R(l, {
|
|
1988
1987
|
key: 0,
|
|
1989
1988
|
members: s.displayedTeamMembers,
|
|
1990
1989
|
"response-label": ""
|
|
1991
1990
|
}, null, 8, ["members"])) : b("", !0)
|
|
1992
|
-
], 64)) : (c(), u("div",
|
|
1993
|
-
o("div",
|
|
1991
|
+
], 64)) : (c(), u("div", nn)),
|
|
1992
|
+
o("div", sn, [
|
|
1994
1993
|
n.showMore ? (c(), u("button", {
|
|
1995
1994
|
key: 0,
|
|
1996
1995
|
type: "button",
|
|
@@ -2022,7 +2021,7 @@ function an(e, t, n, r, a, s) {
|
|
|
2022
2021
|
r: "1.6"
|
|
2023
2022
|
})
|
|
2024
2023
|
], -1)
|
|
2025
|
-
])], 10,
|
|
2024
|
+
])], 10, rn)) : b("", !0),
|
|
2026
2025
|
n.showClose ? (c(), u("button", {
|
|
2027
2026
|
key: 1,
|
|
2028
2027
|
type: "button",
|
|
@@ -2044,23 +2043,113 @@ function an(e, t, n, r, a, s) {
|
|
|
2044
2043
|
}, [
|
|
2045
2044
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
2046
2045
|
], -1)
|
|
2047
|
-
])], 8,
|
|
2046
|
+
])], 8, an)) : b("", !0)
|
|
2048
2047
|
])
|
|
2049
2048
|
]);
|
|
2050
2049
|
}
|
|
2051
|
-
const
|
|
2050
|
+
const ln = /* @__PURE__ */ E(Yt, [["render", on], ["__scopeId", "data-v-e5ed4931"]]);
|
|
2051
|
+
function Be(e) {
|
|
2052
|
+
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2053
|
+
}
|
|
2054
|
+
function cn(e) {
|
|
2055
|
+
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2056
|
+
}
|
|
2057
|
+
const Ae = "";
|
|
2058
|
+
function re(e) {
|
|
2059
|
+
let t = e;
|
|
2060
|
+
const n = [];
|
|
2061
|
+
return t = t.replace(/`([^`\n]+)`/g, (i, r) => {
|
|
2062
|
+
const s = n.length;
|
|
2063
|
+
return n.push(r), `${Ae}CODE${s}${Ae}`;
|
|
2064
|
+
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, r, s) => cn(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (i, r) => `<code class="wm-md-code">${n[+r]}</code>`), t;
|
|
2065
|
+
}
|
|
2066
|
+
function dn(e) {
|
|
2067
|
+
if (!e) return "";
|
|
2068
|
+
const t = String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g, "$1");
|
|
2069
|
+
return re(Be(t));
|
|
2070
|
+
}
|
|
2071
|
+
function un(e) {
|
|
2072
|
+
if (!e) return "";
|
|
2073
|
+
const t = Be(e).split(`
|
|
2074
|
+
`), n = [];
|
|
2075
|
+
let i = 0;
|
|
2076
|
+
for (; i < t.length; ) {
|
|
2077
|
+
const s = t[i];
|
|
2078
|
+
if (/^\s*```([\w-]*)\s*$/.exec(s)) {
|
|
2079
|
+
i++;
|
|
2080
|
+
const C = [];
|
|
2081
|
+
for (; i < t.length && !/^\s*```\s*$/.test(t[i]); )
|
|
2082
|
+
C.push(t[i]), i++;
|
|
2083
|
+
i < t.length && i++, n.push({
|
|
2084
|
+
type: "block",
|
|
2085
|
+
html: `<pre class="wm-md-pre"><code>${C.join(`
|
|
2086
|
+
`)}</code></pre>`
|
|
2087
|
+
});
|
|
2088
|
+
continue;
|
|
2089
|
+
}
|
|
2090
|
+
if (/^\s*[-*]\s+/.test(s)) {
|
|
2091
|
+
const C = [];
|
|
2092
|
+
for (; i < t.length; ) {
|
|
2093
|
+
const T = /^\s*[-*]\s+(.*)$/.exec(t[i]);
|
|
2094
|
+
if (!T) break;
|
|
2095
|
+
C.push(T[1]), i++;
|
|
2096
|
+
}
|
|
2097
|
+
const k = C.map((T) => `<li>${re(T)}</li>`).join("");
|
|
2098
|
+
n.push({
|
|
2099
|
+
type: "block",
|
|
2100
|
+
html: `<ul class="wm-md-ul">${k}</ul>`
|
|
2101
|
+
});
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
2105
|
+
if (l) {
|
|
2106
|
+
const C = parseInt(l[1], 10), k = [l[2]];
|
|
2107
|
+
for (i++; i < t.length; ) {
|
|
2108
|
+
const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
|
|
2109
|
+
if (!A) break;
|
|
2110
|
+
k.push(A[1]), i++;
|
|
2111
|
+
}
|
|
2112
|
+
const T = k.map((A) => `<li>${re(A)}</li>`).join(""), B = C !== 1 ? ` start="${C}"` : "";
|
|
2113
|
+
n.push({
|
|
2114
|
+
type: "block",
|
|
2115
|
+
html: `<ol class="wm-md-ol"${B}>${T}</ol>`
|
|
2116
|
+
});
|
|
2117
|
+
continue;
|
|
2118
|
+
}
|
|
2119
|
+
const g = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
2120
|
+
if (g) {
|
|
2121
|
+
const C = g[1].length;
|
|
2122
|
+
n.push({
|
|
2123
|
+
type: "block",
|
|
2124
|
+
html: `<h${C} class="wm-md-h wm-md-h${C}">${re(g[2])}</h${C}>`
|
|
2125
|
+
}), i++;
|
|
2126
|
+
continue;
|
|
2127
|
+
}
|
|
2128
|
+
n.push({ type: "text", html: re(s) }), i++;
|
|
2129
|
+
}
|
|
2130
|
+
let r = "";
|
|
2131
|
+
for (let s = 0; s < n.length; s++) {
|
|
2132
|
+
const a = n[s];
|
|
2133
|
+
r += a.html;
|
|
2134
|
+
const l = n[s + 1];
|
|
2135
|
+
l && a.type !== "block" && l.type !== "block" && (r += `
|
|
2136
|
+
`);
|
|
2137
|
+
}
|
|
2138
|
+
return r;
|
|
2139
|
+
}
|
|
2140
|
+
const Se = {
|
|
2052
2141
|
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",
|
|
2053
2142
|
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",
|
|
2054
2143
|
status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
2055
2144
|
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",
|
|
2056
2145
|
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"
|
|
2057
|
-
},
|
|
2146
|
+
}, hn = {
|
|
2058
2147
|
name: "WmOnboarding",
|
|
2059
|
-
components: { AIAvatar:
|
|
2148
|
+
components: { AIAvatar: le },
|
|
2060
2149
|
inject: {
|
|
2061
2150
|
// Translator + resolved-language getter shared by the Messenger
|
|
2062
2151
|
// shell. Fall back to French wording when used standalone.
|
|
2063
|
-
t: { default: () =>
|
|
2152
|
+
t: { default: () => P() },
|
|
2064
2153
|
wmLocale: { default: () => () => "fr" }
|
|
2065
2154
|
},
|
|
2066
2155
|
props: {
|
|
@@ -2096,21 +2185,24 @@ const on = /* @__PURE__ */ I(Gt, [["render", an], ["__scopeId", "data-v-e5ed4931
|
|
|
2096
2185
|
},
|
|
2097
2186
|
methods: {
|
|
2098
2187
|
iconPath(e) {
|
|
2099
|
-
return
|
|
2188
|
+
return Se[e] || Se.link;
|
|
2189
|
+
},
|
|
2190
|
+
renderPreview(e) {
|
|
2191
|
+
return dn(e);
|
|
2100
2192
|
},
|
|
2101
2193
|
formatTs(e) {
|
|
2102
2194
|
if (!e) return "";
|
|
2103
2195
|
const t = new Date(e);
|
|
2104
2196
|
if (Number.isNaN(t.getTime())) return "";
|
|
2105
|
-
const n =
|
|
2106
|
-
if (t.toDateString() ===
|
|
2197
|
+
const n = oe(this.wmLocale()), i = /* @__PURE__ */ new Date();
|
|
2198
|
+
if (t.toDateString() === i.toDateString())
|
|
2107
2199
|
return t.toLocaleTimeString(n, {
|
|
2108
2200
|
hour: "2-digit",
|
|
2109
2201
|
minute: "2-digit"
|
|
2110
2202
|
});
|
|
2111
|
-
if (
|
|
2112
|
-
const
|
|
2113
|
-
return
|
|
2203
|
+
if (i.getTime() - t.getTime() < 7 * 864e5) {
|
|
2204
|
+
const a = t.toLocaleDateString(n, { weekday: "short" });
|
|
2205
|
+
return a.charAt(0).toUpperCase() + a.slice(1);
|
|
2114
2206
|
}
|
|
2115
2207
|
return t.toLocaleDateString(n, {
|
|
2116
2208
|
day: "2-digit",
|
|
@@ -2118,10 +2210,10 @@ const on = /* @__PURE__ */ I(Gt, [["render", an], ["__scopeId", "data-v-e5ed4931
|
|
|
2118
2210
|
});
|
|
2119
2211
|
}
|
|
2120
2212
|
}
|
|
2121
|
-
},
|
|
2213
|
+
}, mn = { class: "wm-onb" }, fn = { class: "wm-onb__hero" }, _n = { class: "wm-onb__title" }, pn = { class: "wm-onb__sub" }, gn = { class: "wm-onb__cta" }, vn = ["disabled"], yn = {
|
|
2122
2214
|
key: 0,
|
|
2123
2215
|
class: "wm-onb__section"
|
|
2124
|
-
},
|
|
2216
|
+
}, bn = { class: "wm-onb__section-title" }, wn = ["onClick"], kn = { class: "wm-onb__card-icon" }, Cn = {
|
|
2125
2217
|
width: "16",
|
|
2126
2218
|
height: "16",
|
|
2127
2219
|
viewBox: "0 0 24 24",
|
|
@@ -2131,31 +2223,31 @@ const on = /* @__PURE__ */ I(Gt, [["render", an], ["__scopeId", "data-v-e5ed4931
|
|
|
2131
2223
|
"stroke-linecap": "round",
|
|
2132
2224
|
"stroke-linejoin": "round",
|
|
2133
2225
|
"aria-hidden": "true"
|
|
2134
|
-
},
|
|
2226
|
+
}, An = ["d"], Sn = { class: "wm-onb__card-body" }, Mn = { class: "wm-onb__card-title" }, Tn = {
|
|
2135
2227
|
key: 0,
|
|
2136
2228
|
class: "wm-onb__card-sub"
|
|
2137
|
-
},
|
|
2229
|
+
}, xn = {
|
|
2138
2230
|
key: 1,
|
|
2139
2231
|
class: "wm-onb__section"
|
|
2140
|
-
},
|
|
2232
|
+
}, On = { class: "wm-onb__section-title" }, Ln = { class: "wm-onb__search" }, In = ["placeholder", "aria-label"], En = { class: "wm-onb__list" }, Bn = ["onClick"], Rn = ["aria-label"], Nn = { class: "wm-onb__thread-body" }, Fn = { class: "wm-onb__thread-title" }, jn = ["innerHTML"], Pn = { class: "wm-onb__thread-meta" }, Dn = {
|
|
2141
2233
|
key: 0,
|
|
2142
2234
|
class: "wm-onb__thread-time"
|
|
2143
|
-
},
|
|
2235
|
+
}, Un = {
|
|
2144
2236
|
key: 0,
|
|
2145
2237
|
class: "wm-onb__empty"
|
|
2146
2238
|
};
|
|
2147
|
-
function
|
|
2148
|
-
const
|
|
2149
|
-
return c(), u("div",
|
|
2150
|
-
o("div",
|
|
2151
|
-
z(
|
|
2239
|
+
function $n(e, t, n, i, r, s) {
|
|
2240
|
+
const a = I("AIAvatar");
|
|
2241
|
+
return c(), u("div", mn, [
|
|
2242
|
+
o("div", fn, [
|
|
2243
|
+
z(a, {
|
|
2152
2244
|
size: 56,
|
|
2153
2245
|
pulse: !0
|
|
2154
2246
|
}),
|
|
2155
|
-
o("div",
|
|
2156
|
-
o("div",
|
|
2247
|
+
o("div", _n, v(s.heroTitle), 1),
|
|
2248
|
+
o("div", pn, v(s.heroSub), 1)
|
|
2157
2249
|
]),
|
|
2158
|
-
o("div",
|
|
2250
|
+
o("div", gn, [
|
|
2159
2251
|
o("button", {
|
|
2160
2252
|
type: "button",
|
|
2161
2253
|
class: "wm-onb__startBtn",
|
|
@@ -2178,10 +2270,10 @@ function jn(e, t, n, r, a, s) {
|
|
|
2178
2270
|
])
|
|
2179
2271
|
], -1)),
|
|
2180
2272
|
o("span", null, v(n.busy ? "…" : s.t("onboarding.start")), 1)
|
|
2181
|
-
], 8,
|
|
2273
|
+
], 8, vn)
|
|
2182
2274
|
]),
|
|
2183
|
-
n.quickLinks.length ? (c(), u("div",
|
|
2184
|
-
o("div",
|
|
2275
|
+
n.quickLinks.length ? (c(), u("div", yn, [
|
|
2276
|
+
o("div", bn, v(s.t("onboarding.quickAccess")), 1),
|
|
2185
2277
|
o("div", {
|
|
2186
2278
|
class: x(s.quickLinksLayout)
|
|
2187
2279
|
}, [
|
|
@@ -2191,23 +2283,23 @@ function jn(e, t, n, r, a, s) {
|
|
|
2191
2283
|
class: x(["wm-onb__card", { "wm-onb__card--row": s.isOddQuickLinks }]),
|
|
2192
2284
|
onClick: (C) => e.$emit("select", l)
|
|
2193
2285
|
}, [
|
|
2194
|
-
o("span",
|
|
2195
|
-
(c(), u("svg",
|
|
2286
|
+
o("span", kn, [
|
|
2287
|
+
(c(), u("svg", Cn, [
|
|
2196
2288
|
o("path", {
|
|
2197
2289
|
d: s.iconPath(l.icon)
|
|
2198
|
-
}, null, 8,
|
|
2290
|
+
}, null, 8, An)
|
|
2199
2291
|
]))
|
|
2200
2292
|
]),
|
|
2201
|
-
o("span",
|
|
2202
|
-
o("span",
|
|
2203
|
-
l.description ? (c(), u("span",
|
|
2293
|
+
o("span", Sn, [
|
|
2294
|
+
o("span", Mn, v(l.label), 1),
|
|
2295
|
+
l.description ? (c(), u("span", Tn, v(l.description), 1)) : b("", !0)
|
|
2204
2296
|
])
|
|
2205
|
-
], 10,
|
|
2297
|
+
], 10, wn))), 128))
|
|
2206
2298
|
], 2)
|
|
2207
2299
|
])) : b("", !0),
|
|
2208
|
-
n.openThreads.length ? (c(), u("div",
|
|
2209
|
-
o("div",
|
|
2210
|
-
o("div",
|
|
2300
|
+
n.openThreads.length ? (c(), u("div", xn, [
|
|
2301
|
+
o("div", On, v(s.t("onboarding.recentConversations")), 1),
|
|
2302
|
+
o("div", Ln, [
|
|
2211
2303
|
t[3] || (t[3] = o("span", { class: "wm-onb__searchIcon" }, [
|
|
2212
2304
|
o("svg", {
|
|
2213
2305
|
width: "12",
|
|
@@ -2224,15 +2316,15 @@ function jn(e, t, n, r, a, s) {
|
|
|
2224
2316
|
])
|
|
2225
2317
|
], -1)),
|
|
2226
2318
|
V(o("input", {
|
|
2227
|
-
"onUpdate:modelValue": t[1] || (t[1] = (l) =>
|
|
2319
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => r.query = l),
|
|
2228
2320
|
type: "text",
|
|
2229
2321
|
placeholder: s.t("onboarding.search"),
|
|
2230
2322
|
"aria-label": s.t("onboarding.search")
|
|
2231
|
-
}, null, 8,
|
|
2232
|
-
[Z,
|
|
2323
|
+
}, null, 8, In), [
|
|
2324
|
+
[Z, r.query]
|
|
2233
2325
|
])
|
|
2234
2326
|
]),
|
|
2235
|
-
o("div",
|
|
2327
|
+
o("div", En, [
|
|
2236
2328
|
(c(!0), u(L, null, j(s.filteredThreads, (l) => (c(), u("button", {
|
|
2237
2329
|
key: l.id,
|
|
2238
2330
|
type: "button",
|
|
@@ -2259,14 +2351,17 @@ function jn(e, t, n, r, a, s) {
|
|
|
2259
2351
|
key: 0,
|
|
2260
2352
|
class: "wm-onb__thread-dot",
|
|
2261
2353
|
"aria-label": s.t("onboarding.unread")
|
|
2262
|
-
}, null, 8,
|
|
2354
|
+
}, null, 8, Rn)) : b("", !0)
|
|
2263
2355
|
], 2),
|
|
2264
|
-
o("span",
|
|
2265
|
-
o("span",
|
|
2266
|
-
o("span",
|
|
2356
|
+
o("span", Nn, [
|
|
2357
|
+
o("span", Fn, v(l.title), 1),
|
|
2358
|
+
o("span", {
|
|
2359
|
+
class: "wm-onb__thread-preview",
|
|
2360
|
+
innerHTML: s.renderPreview(l.preview)
|
|
2361
|
+
}, null, 8, jn)
|
|
2267
2362
|
]),
|
|
2268
|
-
o("span",
|
|
2269
|
-
s.formatTs(l._ts) ? (c(), u("span",
|
|
2363
|
+
o("span", Pn, [
|
|
2364
|
+
s.formatTs(l._ts) ? (c(), u("span", Dn, v(s.formatTs(l._ts)), 1)) : b("", !0),
|
|
2270
2365
|
t[5] || (t[5] = o("svg", {
|
|
2271
2366
|
width: "14",
|
|
2272
2367
|
height: "14",
|
|
@@ -2282,17 +2377,17 @@ function jn(e, t, n, r, a, s) {
|
|
|
2282
2377
|
o("path", { d: "M5 12h14M13 5l7 7-7 7" })
|
|
2283
2378
|
], -1))
|
|
2284
2379
|
])
|
|
2285
|
-
], 8,
|
|
2286
|
-
s.filteredThreads.length ? b("", !0) : (c(), u("div",
|
|
2380
|
+
], 8, Bn))), 128)),
|
|
2381
|
+
s.filteredThreads.length ? b("", !0) : (c(), u("div", Un, v(s.t("onboarding.noResults", { query: r.query })), 1))
|
|
2287
2382
|
])
|
|
2288
2383
|
])) : b("", !0)
|
|
2289
2384
|
]);
|
|
2290
2385
|
}
|
|
2291
|
-
const
|
|
2292
|
-
function
|
|
2386
|
+
const Hn = /* @__PURE__ */ E(hn, [["render", $n], ["__scopeId", "data-v-d0d5f5b1"]]);
|
|
2387
|
+
function zn(e) {
|
|
2293
2388
|
return typeof e != "string" ? "" : e.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
|
|
2294
2389
|
}
|
|
2295
|
-
const
|
|
2390
|
+
const qn = {
|
|
2296
2391
|
name: "WmActionResult",
|
|
2297
2392
|
props: {
|
|
2298
2393
|
state: { type: String, default: "success" },
|
|
@@ -2302,13 +2397,13 @@ const Un = {
|
|
|
2302
2397
|
},
|
|
2303
2398
|
computed: {
|
|
2304
2399
|
detailText() {
|
|
2305
|
-
return
|
|
2400
|
+
return zn(this.detail);
|
|
2306
2401
|
}
|
|
2307
2402
|
}
|
|
2308
|
-
},
|
|
2403
|
+
}, Vn = {
|
|
2309
2404
|
class: "wm-result__icon",
|
|
2310
2405
|
"aria-hidden": "true"
|
|
2311
|
-
},
|
|
2406
|
+
}, Wn = {
|
|
2312
2407
|
key: 0,
|
|
2313
2408
|
width: "11",
|
|
2314
2409
|
height: "11",
|
|
@@ -2318,7 +2413,7 @@ const Un = {
|
|
|
2318
2413
|
"stroke-width": "2.8",
|
|
2319
2414
|
"stroke-linecap": "round",
|
|
2320
2415
|
"stroke-linejoin": "round"
|
|
2321
|
-
},
|
|
2416
|
+
}, Kn = {
|
|
2322
2417
|
key: 1,
|
|
2323
2418
|
width: "11",
|
|
2324
2419
|
height: "11",
|
|
@@ -2328,7 +2423,7 @@ const Un = {
|
|
|
2328
2423
|
"stroke-width": "2.6",
|
|
2329
2424
|
"stroke-linecap": "round",
|
|
2330
2425
|
"stroke-linejoin": "round"
|
|
2331
|
-
},
|
|
2426
|
+
}, Gn = {
|
|
2332
2427
|
key: 2,
|
|
2333
2428
|
width: "11",
|
|
2334
2429
|
height: "11",
|
|
@@ -2338,7 +2433,7 @@ const Un = {
|
|
|
2338
2433
|
"stroke-width": "2.4",
|
|
2339
2434
|
"stroke-linecap": "round",
|
|
2340
2435
|
"stroke-linejoin": "round"
|
|
2341
|
-
},
|
|
2436
|
+
}, Yn = {
|
|
2342
2437
|
key: 3,
|
|
2343
2438
|
width: "12",
|
|
2344
2439
|
height: "12",
|
|
@@ -2348,24 +2443,24 @@ const Un = {
|
|
|
2348
2443
|
"stroke-width": "2.2",
|
|
2349
2444
|
"stroke-linecap": "round",
|
|
2350
2445
|
"stroke-linejoin": "round"
|
|
2351
|
-
},
|
|
2352
|
-
function
|
|
2446
|
+
}, Qn = { class: "wm-result__body" }, Xn = { class: "wm-result__label" }, Jn = { class: "wm-result__detail" };
|
|
2447
|
+
function Zn(e, t, n, i, r, s) {
|
|
2353
2448
|
return c(), u("div", {
|
|
2354
2449
|
class: x(["wm-result", `wm-result--${n.state}`])
|
|
2355
2450
|
}, [
|
|
2356
|
-
o("span",
|
|
2357
|
-
n.state === "success" ? (c(), u("svg",
|
|
2451
|
+
o("span", Vn, [
|
|
2452
|
+
n.state === "success" ? (c(), u("svg", Wn, [...t[0] || (t[0] = [
|
|
2358
2453
|
o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
|
|
2359
|
-
])])) : n.state === "rejected" ? (c(), u("svg",
|
|
2454
|
+
])])) : n.state === "rejected" ? (c(), u("svg", Kn, [...t[1] || (t[1] = [
|
|
2360
2455
|
o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
|
|
2361
|
-
])])) : n.state === "awaiting" ? (c(), u("svg",
|
|
2456
|
+
])])) : n.state === "awaiting" ? (c(), u("svg", Gn, [...t[2] || (t[2] = [
|
|
2362
2457
|
o("circle", {
|
|
2363
2458
|
cx: "12",
|
|
2364
2459
|
cy: "12",
|
|
2365
2460
|
r: "10"
|
|
2366
2461
|
}, null, -1),
|
|
2367
2462
|
o("polyline", { points: "12 7 12 12 15 14" }, null, -1)
|
|
2368
|
-
])])) : (c(), u("svg",
|
|
2463
|
+
])])) : (c(), u("svg", Yn, [...t[3] || (t[3] = [
|
|
2369
2464
|
o("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),
|
|
2370
2465
|
o("line", {
|
|
2371
2466
|
x1: "12",
|
|
@@ -2381,24 +2476,24 @@ function Yn(e, t, n, r, a, s) {
|
|
|
2381
2476
|
}, null, -1)
|
|
2382
2477
|
])]))
|
|
2383
2478
|
]),
|
|
2384
|
-
o("span",
|
|
2385
|
-
o("span",
|
|
2479
|
+
o("span", Qn, [
|
|
2480
|
+
o("span", Xn, v(n.label), 1),
|
|
2386
2481
|
s.detailText ? (c(), u(L, { key: 0 }, [
|
|
2387
2482
|
t[4] || (t[4] = o("span", {
|
|
2388
2483
|
class: "wm-result__sep",
|
|
2389
2484
|
"aria-hidden": "true"
|
|
2390
2485
|
}, " · ", -1)),
|
|
2391
|
-
o("span",
|
|
2486
|
+
o("span", Jn, v(s.detailText), 1)
|
|
2392
2487
|
], 64)) : b("", !0)
|
|
2393
2488
|
])
|
|
2394
2489
|
], 2);
|
|
2395
2490
|
}
|
|
2396
|
-
const
|
|
2491
|
+
const es = /* @__PURE__ */ E(qn, [["render", Zn], ["__scopeId", "data-v-7284acd0"]]), ts = {
|
|
2397
2492
|
name: "WmArtifactFormResponse",
|
|
2398
2493
|
inject: {
|
|
2399
2494
|
// Translator shared by the Messenger shell; French fallback when
|
|
2400
2495
|
// the component is used standalone.
|
|
2401
|
-
t: { default: () =>
|
|
2496
|
+
t: { default: () => P() }
|
|
2402
2497
|
},
|
|
2403
2498
|
props: {
|
|
2404
2499
|
data: { type: Object, required: !0 }
|
|
@@ -2409,12 +2504,12 @@ const Qn = /* @__PURE__ */ I(Un, [["render", Yn], ["__scopeId", "data-v-7284acd0
|
|
|
2409
2504
|
return Array.isArray((e = this.data) == null ? void 0 : e.fields) ? this.data.fields : [];
|
|
2410
2505
|
}
|
|
2411
2506
|
}
|
|
2412
|
-
},
|
|
2413
|
-
function
|
|
2414
|
-
return c(), u("div",
|
|
2415
|
-
o("div",
|
|
2416
|
-
o("div",
|
|
2417
|
-
o("span",
|
|
2507
|
+
}, ns = { class: "wm-art wm-art--formResponse" }, ss = { class: "wm-art__head" }, rs = { class: "wm-art__title" }, is = { class: "wm-art__badge wm-art__badge--success" }, as = { class: "wm-art__body" }, os = { class: "wm-art__fieldLabel" };
|
|
2508
|
+
function ls(e, t, n, i, r, s) {
|
|
2509
|
+
return c(), u("div", ns, [
|
|
2510
|
+
o("div", ss, [
|
|
2511
|
+
o("div", rs, v(n.data.title || s.t("form.title")), 1),
|
|
2512
|
+
o("span", is, [
|
|
2418
2513
|
t[0] || (t[0] = o("svg", {
|
|
2419
2514
|
width: "11",
|
|
2420
2515
|
height: "11",
|
|
@@ -2431,23 +2526,23 @@ function rs(e, t, n, r, a, s) {
|
|
|
2431
2526
|
pe(" " + v(s.t("form.sent")), 1)
|
|
2432
2527
|
])
|
|
2433
2528
|
]),
|
|
2434
|
-
o("div",
|
|
2435
|
-
(c(!0), u(L, null, j(s.fields, (
|
|
2529
|
+
o("div", as, [
|
|
2530
|
+
(c(!0), u(L, null, j(s.fields, (a, l) => (c(), u("div", {
|
|
2436
2531
|
key: l,
|
|
2437
2532
|
class: "wm-art__field"
|
|
2438
2533
|
}, [
|
|
2439
|
-
o("div",
|
|
2534
|
+
o("div", os, v(a.label), 1),
|
|
2440
2535
|
o("div", {
|
|
2441
2536
|
class: x([
|
|
2442
2537
|
"wm-art__fieldValue",
|
|
2443
|
-
{ "wm-art__fieldValue--multi":
|
|
2538
|
+
{ "wm-art__fieldValue--multi": a.multiline }
|
|
2444
2539
|
])
|
|
2445
|
-
}, v(
|
|
2540
|
+
}, v(a.value), 3)
|
|
2446
2541
|
]))), 128))
|
|
2447
2542
|
])
|
|
2448
2543
|
]);
|
|
2449
2544
|
}
|
|
2450
|
-
const
|
|
2545
|
+
const cs = /* @__PURE__ */ E(ts, [["render", ls], ["__scopeId", "data-v-713aecf1"]]), ds = {
|
|
2451
2546
|
name: "WmArtifactInfoCard",
|
|
2452
2547
|
props: {
|
|
2453
2548
|
data: { type: Object, required: !0 }
|
|
@@ -2462,32 +2557,32 @@ const is = /* @__PURE__ */ I(Xn, [["render", rs], ["__scopeId", "data-v-713aecf1
|
|
|
2462
2557
|
return !!((e = this.data) != null && e.body) || this.fields.length > 0;
|
|
2463
2558
|
}
|
|
2464
2559
|
}
|
|
2465
|
-
},
|
|
2560
|
+
}, us = { class: "wm-art wm-art--infoCard" }, hs = {
|
|
2466
2561
|
key: 0,
|
|
2467
2562
|
class: "wm-art__image"
|
|
2468
|
-
},
|
|
2563
|
+
}, ms = ["src", "alt"], fs = { class: "wm-art__head" }, _s = { class: "wm-art__headMain" }, ps = { class: "wm-art__title" }, gs = {
|
|
2469
2564
|
key: 0,
|
|
2470
2565
|
class: "wm-art__subtitle"
|
|
2471
|
-
},
|
|
2566
|
+
}, vs = {
|
|
2472
2567
|
key: 1,
|
|
2473
2568
|
class: "wm-art__body"
|
|
2474
|
-
},
|
|
2569
|
+
}, ys = {
|
|
2475
2570
|
key: 0,
|
|
2476
2571
|
class: "wm-art__text"
|
|
2477
|
-
},
|
|
2478
|
-
function
|
|
2479
|
-
return c(), u("div",
|
|
2480
|
-
n.data.image_url ? (c(), u("figure",
|
|
2572
|
+
}, bs = { class: "wm-art__fieldLabel" };
|
|
2573
|
+
function ws(e, t, n, i, r, s) {
|
|
2574
|
+
return c(), u("div", us, [
|
|
2575
|
+
n.data.image_url ? (c(), u("figure", hs, [
|
|
2481
2576
|
o("img", {
|
|
2482
2577
|
src: n.data.image_url,
|
|
2483
2578
|
alt: n.data.title || "",
|
|
2484
2579
|
loading: "lazy"
|
|
2485
|
-
}, null, 8,
|
|
2580
|
+
}, null, 8, ms)
|
|
2486
2581
|
])) : b("", !0),
|
|
2487
|
-
o("div",
|
|
2488
|
-
o("div",
|
|
2489
|
-
o("div",
|
|
2490
|
-
n.data.subtitle ? (c(), u("div",
|
|
2582
|
+
o("div", fs, [
|
|
2583
|
+
o("div", _s, [
|
|
2584
|
+
o("div", ps, v(n.data.title), 1),
|
|
2585
|
+
n.data.subtitle ? (c(), u("div", gs, v(n.data.subtitle), 1)) : b("", !0)
|
|
2491
2586
|
]),
|
|
2492
2587
|
n.data.badge && n.data.badge.label ? (c(), u("span", {
|
|
2493
2588
|
key: 0,
|
|
@@ -2497,44 +2592,44 @@ function gs(e, t, n, r, a, s) {
|
|
|
2497
2592
|
])
|
|
2498
2593
|
}, v(n.data.badge.label), 3)) : b("", !0)
|
|
2499
2594
|
]),
|
|
2500
|
-
s.hasBody ? (c(), u("div",
|
|
2501
|
-
n.data.body ? (c(), u("div",
|
|
2502
|
-
s.fields.length ? (c(!0), u(L, { key: 1 }, j(s.fields, (
|
|
2595
|
+
s.hasBody ? (c(), u("div", vs, [
|
|
2596
|
+
n.data.body ? (c(), u("div", ys, v(n.data.body), 1)) : b("", !0),
|
|
2597
|
+
s.fields.length ? (c(!0), u(L, { key: 1 }, j(s.fields, (a, l) => (c(), u("div", {
|
|
2503
2598
|
key: l,
|
|
2504
2599
|
class: "wm-art__field"
|
|
2505
2600
|
}, [
|
|
2506
|
-
o("div",
|
|
2601
|
+
o("div", bs, v(a.label), 1),
|
|
2507
2602
|
o("div", {
|
|
2508
2603
|
class: x([
|
|
2509
2604
|
"wm-art__fieldValue",
|
|
2510
|
-
{ "wm-art__fieldValue--multi":
|
|
2605
|
+
{ "wm-art__fieldValue--multi": a.multiline }
|
|
2511
2606
|
])
|
|
2512
|
-
}, v(
|
|
2607
|
+
}, v(a.value), 3)
|
|
2513
2608
|
]))), 128)) : b("", !0)
|
|
2514
2609
|
])) : b("", !0)
|
|
2515
2610
|
]);
|
|
2516
2611
|
}
|
|
2517
|
-
const
|
|
2518
|
-
function
|
|
2612
|
+
const ks = /* @__PURE__ */ E(ds, [["render", ws], ["__scopeId", "data-v-7eae0e4a"]]);
|
|
2613
|
+
function Cs(e, t, n) {
|
|
2519
2614
|
if (!e) return "";
|
|
2520
|
-
const
|
|
2521
|
-
if (Number.isNaN(
|
|
2522
|
-
const
|
|
2615
|
+
const i = new Date(e);
|
|
2616
|
+
if (Number.isNaN(i.getTime())) return e;
|
|
2617
|
+
const r = i.toLocaleDateString(t, {
|
|
2523
2618
|
day: "numeric",
|
|
2524
2619
|
month: "long",
|
|
2525
2620
|
year: "numeric"
|
|
2526
|
-
}), s =
|
|
2621
|
+
}), s = i.toLocaleTimeString(t, {
|
|
2527
2622
|
hour: "2-digit",
|
|
2528
2623
|
minute: "2-digit"
|
|
2529
2624
|
});
|
|
2530
|
-
return `${
|
|
2625
|
+
return `${r}${n}${s}`;
|
|
2531
2626
|
}
|
|
2532
|
-
const
|
|
2627
|
+
const As = {
|
|
2533
2628
|
name: "WmArtifactTicket",
|
|
2534
2629
|
inject: {
|
|
2535
2630
|
// Translator + resolved-language getter shared by the Messenger
|
|
2536
2631
|
// shell. Fall back to French wording when used standalone.
|
|
2537
|
-
t: { default: () =>
|
|
2632
|
+
t: { default: () => P() },
|
|
2538
2633
|
wmLocale: { default: () => () => "fr" }
|
|
2539
2634
|
},
|
|
2540
2635
|
props: {
|
|
@@ -2547,9 +2642,9 @@ const bs = {
|
|
|
2547
2642
|
},
|
|
2548
2643
|
formattedDate() {
|
|
2549
2644
|
var e;
|
|
2550
|
-
return
|
|
2645
|
+
return Cs(
|
|
2551
2646
|
(e = this.data) == null ? void 0 : e.created_at,
|
|
2552
|
-
|
|
2647
|
+
oe(this.wmLocale()),
|
|
2553
2648
|
this.t("ticket.dateAt")
|
|
2554
2649
|
);
|
|
2555
2650
|
}
|
|
@@ -2575,13 +2670,13 @@ const bs = {
|
|
|
2575
2670
|
return /high|haute|élev|elev|critic|critiq|urgent/.test(t) ? 3 : /low|basse|faible|minor/.test(t) ? 1 : 2;
|
|
2576
2671
|
}
|
|
2577
2672
|
}
|
|
2578
|
-
},
|
|
2673
|
+
}, Ss = { class: "wm-art wm-art--ticket" }, Ms = { class: "wm-art__head wm-tk__head" }, Ts = { class: "wm-art__title wm-tk__title" }, xs = { class: "wm-tk__sub" }, Os = { class: "wm-tk__ref" }, Ls = {
|
|
2579
2674
|
key: 0,
|
|
2580
2675
|
class: "wm-tk__text"
|
|
2581
|
-
},
|
|
2676
|
+
}, Is = {
|
|
2582
2677
|
key: 0,
|
|
2583
2678
|
class: "wm-art__body"
|
|
2584
|
-
},
|
|
2679
|
+
}, Es = { class: "wm-art__fieldLabel" }, Bs = ["data-level"], Rs = {
|
|
2585
2680
|
key: 1,
|
|
2586
2681
|
class: "wm-tk__date",
|
|
2587
2682
|
width: "12",
|
|
@@ -2593,16 +2688,16 @@ const bs = {
|
|
|
2593
2688
|
"stroke-linecap": "round",
|
|
2594
2689
|
"stroke-linejoin": "round",
|
|
2595
2690
|
"aria-hidden": "true"
|
|
2596
|
-
},
|
|
2691
|
+
}, Ns = {
|
|
2597
2692
|
key: 1,
|
|
2598
2693
|
class: "wm-art__footer wm-tk__footer"
|
|
2599
2694
|
};
|
|
2600
|
-
function
|
|
2601
|
-
return c(), u("div",
|
|
2602
|
-
o("div",
|
|
2603
|
-
o("div",
|
|
2604
|
-
o("div",
|
|
2605
|
-
o("div",
|
|
2695
|
+
function Fs(e, t, n, i, r, s) {
|
|
2696
|
+
return c(), u("div", Ss, [
|
|
2697
|
+
o("div", Ms, [
|
|
2698
|
+
o("div", Ts, v(n.data.title), 1),
|
|
2699
|
+
o("div", xs, [
|
|
2700
|
+
o("div", Os, [
|
|
2606
2701
|
t[0] || (t[0] = o("svg", {
|
|
2607
2702
|
width: "11",
|
|
2608
2703
|
height: "11",
|
|
@@ -2633,24 +2728,24 @@ function Is(e, t, n, r, a, s) {
|
|
|
2633
2728
|
pe(" " + v(n.data.status.label), 1)
|
|
2634
2729
|
], 2)
|
|
2635
2730
|
]),
|
|
2636
|
-
n.data.body ? (c(), u("div",
|
|
2731
|
+
n.data.body ? (c(), u("div", Ls, v(n.data.body), 1)) : b("", !0)
|
|
2637
2732
|
]),
|
|
2638
|
-
s.fields.length ? (c(), u("div",
|
|
2639
|
-
(c(!0), u(L, null, j(s.fields, (
|
|
2733
|
+
s.fields.length ? (c(), u("div", Is, [
|
|
2734
|
+
(c(!0), u(L, null, j(s.fields, (a, l) => (c(), u("div", {
|
|
2640
2735
|
key: l,
|
|
2641
2736
|
class: "wm-art__field"
|
|
2642
2737
|
}, [
|
|
2643
|
-
o("div",
|
|
2738
|
+
o("div", Es, v(a.label), 1),
|
|
2644
2739
|
o("div", {
|
|
2645
2740
|
class: x([
|
|
2646
2741
|
"wm-art__fieldValue",
|
|
2647
|
-
{ "wm-art__fieldValue--multi":
|
|
2742
|
+
{ "wm-art__fieldValue--multi": a.multiline }
|
|
2648
2743
|
])
|
|
2649
2744
|
}, [
|
|
2650
|
-
s.isPriority(
|
|
2745
|
+
s.isPriority(a.label) ? (c(), u("svg", {
|
|
2651
2746
|
key: 0,
|
|
2652
2747
|
class: "wm-tk__prio",
|
|
2653
|
-
"data-level": s.priorityLevel(
|
|
2748
|
+
"data-level": s.priorityLevel(a.value),
|
|
2654
2749
|
width: "12",
|
|
2655
2750
|
height: "12",
|
|
2656
2751
|
viewBox: "0 0 12 12",
|
|
@@ -2677,7 +2772,7 @@ function Is(e, t, n, r, a, s) {
|
|
|
2677
2772
|
height: "9",
|
|
2678
2773
|
rx: "0.5"
|
|
2679
2774
|
}, null, -1)
|
|
2680
|
-
])], 8,
|
|
2775
|
+
])], 8, Bs)) : s.isDate(a.label) ? (c(), u("svg", Rs, [...t[3] || (t[3] = [
|
|
2681
2776
|
o("rect", {
|
|
2682
2777
|
x: "3",
|
|
2683
2778
|
y: "4",
|
|
@@ -2687,11 +2782,11 @@ function Is(e, t, n, r, a, s) {
|
|
|
2687
2782
|
}, null, -1),
|
|
2688
2783
|
o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
|
|
2689
2784
|
])])) : b("", !0),
|
|
2690
|
-
o("span", null, v(
|
|
2785
|
+
o("span", null, v(a.value), 1)
|
|
2691
2786
|
], 2)
|
|
2692
2787
|
]))), 128))
|
|
2693
2788
|
])) : b("", !0),
|
|
2694
|
-
n.data.created_at ? (c(), u("div",
|
|
2789
|
+
n.data.created_at ? (c(), u("div", Ns, [
|
|
2695
2790
|
t[4] || (t[4] = o("svg", {
|
|
2696
2791
|
width: "11",
|
|
2697
2792
|
height: "11",
|
|
@@ -2716,11 +2811,11 @@ function Is(e, t, n, r, a, s) {
|
|
|
2716
2811
|
])) : b("", !0)
|
|
2717
2812
|
]);
|
|
2718
2813
|
}
|
|
2719
|
-
const
|
|
2720
|
-
form_response:
|
|
2721
|
-
info_card:
|
|
2722
|
-
ticket:
|
|
2723
|
-
},
|
|
2814
|
+
const js = /* @__PURE__ */ E(As, [["render", Fs], ["__scopeId", "data-v-5f30c914"]]), Ps = {
|
|
2815
|
+
form_response: cs,
|
|
2816
|
+
info_card: ks,
|
|
2817
|
+
ticket: js
|
|
2818
|
+
}, Ds = {
|
|
2724
2819
|
name: "WmArtifactRenderer",
|
|
2725
2820
|
props: {
|
|
2726
2821
|
// Forme : { kind: string, data: any } (le `data` est validé
|
|
@@ -2731,23 +2826,23 @@ const Bs = /* @__PURE__ */ I(bs, [["render", Is], ["__scopeId", "data-v-5f30c914
|
|
|
2731
2826
|
component() {
|
|
2732
2827
|
var t;
|
|
2733
2828
|
const e = (t = this.artifact) == null ? void 0 : t.kind;
|
|
2734
|
-
return e &&
|
|
2829
|
+
return e && Ps[e] || null;
|
|
2735
2830
|
}
|
|
2736
2831
|
}
|
|
2737
2832
|
};
|
|
2738
|
-
function
|
|
2833
|
+
function Us(e, t, n, i, r, s) {
|
|
2739
2834
|
return s.component ? (c(), R(De(s.component), {
|
|
2740
2835
|
key: 0,
|
|
2741
2836
|
data: n.artifact.data
|
|
2742
2837
|
}, null, 8, ["data"])) : b("", !0);
|
|
2743
2838
|
}
|
|
2744
|
-
const
|
|
2839
|
+
const $s = /* @__PURE__ */ E(Ds, [["render", Us]]), Hs = {
|
|
2745
2840
|
name: "WmAttachmentPreview",
|
|
2746
2841
|
inject: {
|
|
2747
2842
|
signAttachmentFn: { default: null },
|
|
2748
2843
|
// Translator shared by the Messenger shell; French fallback when
|
|
2749
2844
|
// the component is used standalone.
|
|
2750
|
-
t: { default: () =>
|
|
2845
|
+
t: { default: () => P() }
|
|
2751
2846
|
},
|
|
2752
2847
|
props: {
|
|
2753
2848
|
attachment: { type: Object, required: !0 }
|
|
@@ -2757,10 +2852,10 @@ const js = /* @__PURE__ */ I(Ns, [["render", Fs]]), Ds = {
|
|
|
2757
2852
|
},
|
|
2758
2853
|
computed: {
|
|
2759
2854
|
kind() {
|
|
2760
|
-
var n,
|
|
2855
|
+
var n, i;
|
|
2761
2856
|
const e = (n = this.attachment) == null ? void 0 : n.type;
|
|
2762
2857
|
if (e) return e;
|
|
2763
|
-
const t = (((
|
|
2858
|
+
const t = (((i = this.attachment) == null ? void 0 : i.mime_type) || "").toLowerCase();
|
|
2764
2859
|
return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
|
|
2765
2860
|
},
|
|
2766
2861
|
displayName() {
|
|
@@ -2805,48 +2900,48 @@ const js = /* @__PURE__ */ I(Ns, [["render", Fs]]), Ds = {
|
|
|
2805
2900
|
this.url || e.preventDefault();
|
|
2806
2901
|
}
|
|
2807
2902
|
}
|
|
2808
|
-
},
|
|
2903
|
+
}, zs = ["href"], qs = ["src", "alt"], Vs = ["src"], Ws = ["src"], Ks = ["href", "download"], Gs = { class: "wm-att__main" }, Ys = { class: "wm-att__name" }, Qs = {
|
|
2809
2904
|
key: 0,
|
|
2810
2905
|
class: "wm-att__meta"
|
|
2811
|
-
},
|
|
2906
|
+
}, Xs = {
|
|
2812
2907
|
key: 0,
|
|
2813
2908
|
class: "wm-att__spin",
|
|
2814
2909
|
"aria-hidden": "true"
|
|
2815
2910
|
};
|
|
2816
|
-
function
|
|
2911
|
+
function Js(e, t, n, i, r, s) {
|
|
2817
2912
|
return c(), u("div", {
|
|
2818
2913
|
class: x(["wm-att", ["wm-att--" + (s.kind || "file")]])
|
|
2819
2914
|
}, [
|
|
2820
|
-
s.kind === "image" &&
|
|
2915
|
+
s.kind === "image" && r.url ? (c(), u("a", {
|
|
2821
2916
|
key: 0,
|
|
2822
|
-
href:
|
|
2917
|
+
href: r.url,
|
|
2823
2918
|
target: "_blank",
|
|
2824
2919
|
rel: "noopener",
|
|
2825
2920
|
class: "wm-att__imgWrap"
|
|
2826
2921
|
}, [
|
|
2827
2922
|
o("img", {
|
|
2828
|
-
src:
|
|
2923
|
+
src: r.url,
|
|
2829
2924
|
alt: s.displayName,
|
|
2830
2925
|
loading: "lazy"
|
|
2831
|
-
}, null, 8,
|
|
2832
|
-
], 8,
|
|
2926
|
+
}, null, 8, qs)
|
|
2927
|
+
], 8, zs)) : s.kind === "audio" && r.url ? (c(), u("audio", {
|
|
2833
2928
|
key: 1,
|
|
2834
|
-
src:
|
|
2929
|
+
src: r.url,
|
|
2835
2930
|
controls: "",
|
|
2836
2931
|
preload: "metadata"
|
|
2837
|
-
}, null, 8,
|
|
2932
|
+
}, null, 8, Vs)) : s.kind === "video" && r.url ? (c(), u("video", {
|
|
2838
2933
|
key: 2,
|
|
2839
|
-
src:
|
|
2934
|
+
src: r.url,
|
|
2840
2935
|
controls: "",
|
|
2841
2936
|
preload: "metadata"
|
|
2842
|
-
}, null, 8,
|
|
2937
|
+
}, null, 8, Ws)) : (c(), u("a", {
|
|
2843
2938
|
key: 3,
|
|
2844
2939
|
class: "wm-att__file",
|
|
2845
|
-
href:
|
|
2940
|
+
href: r.url || "#",
|
|
2846
2941
|
download: s.displayName,
|
|
2847
2942
|
target: "_blank",
|
|
2848
2943
|
rel: "noopener",
|
|
2849
|
-
onClick: t[0] || (t[0] = (...
|
|
2944
|
+
onClick: t[0] || (t[0] = (...a) => s.onFileClick && s.onFileClick(...a))
|
|
2850
2945
|
}, [
|
|
2851
2946
|
t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
|
|
2852
2947
|
o("svg", {
|
|
@@ -2864,100 +2959,15 @@ function Gs(e, t, n, r, a, s) {
|
|
|
2864
2959
|
o("path", { d: "M14 2v6h6" })
|
|
2865
2960
|
])
|
|
2866
2961
|
], -1)),
|
|
2867
|
-
o("span",
|
|
2868
|
-
o("span",
|
|
2869
|
-
s.sizeLabel ? (c(), u("span",
|
|
2962
|
+
o("span", Gs, [
|
|
2963
|
+
o("span", Ys, v(s.displayName), 1),
|
|
2964
|
+
s.sizeLabel ? (c(), u("span", Qs, v(s.sizeLabel), 1)) : b("", !0)
|
|
2870
2965
|
]),
|
|
2871
|
-
|
|
2872
|
-
], 8,
|
|
2966
|
+
r.loading ? (c(), u("span", Xs)) : b("", !0)
|
|
2967
|
+
], 8, Ks))
|
|
2873
2968
|
], 2);
|
|
2874
2969
|
}
|
|
2875
|
-
const
|
|
2876
|
-
function Qs(e) {
|
|
2877
|
-
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2878
|
-
}
|
|
2879
|
-
function Xs(e) {
|
|
2880
|
-
return /^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim());
|
|
2881
|
-
}
|
|
2882
|
-
const Se = "";
|
|
2883
|
-
function de(e) {
|
|
2884
|
-
let t = e;
|
|
2885
|
-
const n = [];
|
|
2886
|
-
return t = t.replace(/`([^`\n]+)`/g, (r, a) => {
|
|
2887
|
-
const s = n.length;
|
|
2888
|
-
return n.push(a), `${Se}CODE${s}${Se}`;
|
|
2889
|
-
}), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (r, a, s) => Xs(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${a}</a>` : a), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (r, a) => `<code class="wm-md-code">${n[+a]}</code>`), t;
|
|
2890
|
-
}
|
|
2891
|
-
function Js(e) {
|
|
2892
|
-
if (!e) return "";
|
|
2893
|
-
const t = Qs(e).split(`
|
|
2894
|
-
`), n = [];
|
|
2895
|
-
let r = 0;
|
|
2896
|
-
for (; r < t.length; ) {
|
|
2897
|
-
const s = t[r];
|
|
2898
|
-
if (/^\s*```([\w-]*)\s*$/.exec(s)) {
|
|
2899
|
-
r++;
|
|
2900
|
-
const C = [];
|
|
2901
|
-
for (; r < t.length && !/^\s*```\s*$/.test(t[r]); )
|
|
2902
|
-
C.push(t[r]), r++;
|
|
2903
|
-
r < t.length && r++, n.push({
|
|
2904
|
-
type: "block",
|
|
2905
|
-
html: `<pre class="wm-md-pre"><code>${C.join(`
|
|
2906
|
-
`)}</code></pre>`
|
|
2907
|
-
});
|
|
2908
|
-
continue;
|
|
2909
|
-
}
|
|
2910
|
-
if (/^\s*[-*]\s+/.test(s)) {
|
|
2911
|
-
const C = [];
|
|
2912
|
-
for (; r < t.length; ) {
|
|
2913
|
-
const T = /^\s*[-*]\s+(.*)$/.exec(t[r]);
|
|
2914
|
-
if (!T) break;
|
|
2915
|
-
C.push(T[1]), r++;
|
|
2916
|
-
}
|
|
2917
|
-
const k = C.map((T) => `<li>${de(T)}</li>`).join("");
|
|
2918
|
-
n.push({
|
|
2919
|
-
type: "block",
|
|
2920
|
-
html: `<ul class="wm-md-ul">${k}</ul>`
|
|
2921
|
-
});
|
|
2922
|
-
continue;
|
|
2923
|
-
}
|
|
2924
|
-
const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
|
|
2925
|
-
if (l) {
|
|
2926
|
-
const C = parseInt(l[1], 10), k = [l[2]];
|
|
2927
|
-
for (r++; r < t.length; ) {
|
|
2928
|
-
const A = /^\s*\d+\.\s+(.*)$/.exec(t[r]);
|
|
2929
|
-
if (!A) break;
|
|
2930
|
-
k.push(A[1]), r++;
|
|
2931
|
-
}
|
|
2932
|
-
const T = k.map((A) => `<li>${de(A)}</li>`).join(""), B = C !== 1 ? ` start="${C}"` : "";
|
|
2933
|
-
n.push({
|
|
2934
|
-
type: "block",
|
|
2935
|
-
html: `<ol class="wm-md-ol"${B}>${T}</ol>`
|
|
2936
|
-
});
|
|
2937
|
-
continue;
|
|
2938
|
-
}
|
|
2939
|
-
const g = /^(#{1,6})\s+(.*)$/.exec(s);
|
|
2940
|
-
if (g) {
|
|
2941
|
-
const C = g[1].length;
|
|
2942
|
-
n.push({
|
|
2943
|
-
type: "block",
|
|
2944
|
-
html: `<h${C} class="wm-md-h wm-md-h${C}">${de(g[2])}</h${C}>`
|
|
2945
|
-
}), r++;
|
|
2946
|
-
continue;
|
|
2947
|
-
}
|
|
2948
|
-
n.push({ type: "text", html: de(s) }), r++;
|
|
2949
|
-
}
|
|
2950
|
-
let a = "";
|
|
2951
|
-
for (let s = 0; s < n.length; s++) {
|
|
2952
|
-
const i = n[s];
|
|
2953
|
-
a += i.html;
|
|
2954
|
-
const l = n[s + 1];
|
|
2955
|
-
l && i.type !== "block" && l.type !== "block" && (a += `
|
|
2956
|
-
`);
|
|
2957
|
-
}
|
|
2958
|
-
return a;
|
|
2959
|
-
}
|
|
2960
|
-
const Zs = {
|
|
2970
|
+
const Zs = /* @__PURE__ */ E(Hs, [["render", Js], ["__scopeId", "data-v-afc7b0d3"]]), er = {
|
|
2961
2971
|
name: "WmBubble",
|
|
2962
2972
|
props: {
|
|
2963
2973
|
role: { type: String, default: "ai" },
|
|
@@ -2966,53 +2976,53 @@ const Zs = {
|
|
|
2966
2976
|
},
|
|
2967
2977
|
computed: {
|
|
2968
2978
|
rendered() {
|
|
2969
|
-
return
|
|
2979
|
+
return un(this.text);
|
|
2970
2980
|
}
|
|
2971
2981
|
}
|
|
2972
|
-
},
|
|
2973
|
-
function
|
|
2982
|
+
}, tr = ["innerHTML"];
|
|
2983
|
+
function nr(e, t, n, i, r, s) {
|
|
2974
2984
|
return c(), u("div", {
|
|
2975
2985
|
class: x(["wm-bubble", "wm-bubble--" + n.role])
|
|
2976
2986
|
}, [
|
|
2977
|
-
|
|
2978
|
-
o("span", { innerHTML: s.rendered }, null, 8,
|
|
2987
|
+
Ue(e.$slots, "default", {}, () => [
|
|
2988
|
+
o("span", { innerHTML: s.rendered }, null, 8, tr)
|
|
2979
2989
|
], !0)
|
|
2980
2990
|
], 2);
|
|
2981
2991
|
}
|
|
2982
|
-
const
|
|
2983
|
-
function
|
|
2984
|
-
return c(), u("div",
|
|
2992
|
+
const sr = /* @__PURE__ */ E(er, [["render", nr], ["__scopeId", "data-v-7ab13147"]]), rr = { name: "WmTyping" }, ir = { class: "wm-typing" };
|
|
2993
|
+
function ar(e, t, n, i, r, s) {
|
|
2994
|
+
return c(), u("div", ir, [...t[0] || (t[0] = [
|
|
2985
2995
|
o("span", { style: { "animation-delay": "0s" } }, null, -1),
|
|
2986
2996
|
o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
|
|
2987
2997
|
o("span", { style: { "animation-delay": "0.4s" } }, null, -1)
|
|
2988
2998
|
])]);
|
|
2989
2999
|
}
|
|
2990
|
-
const
|
|
3000
|
+
const or = /* @__PURE__ */ E(rr, [["render", ar], ["__scopeId", "data-v-df2447fd"]]);
|
|
2991
3001
|
function se(e) {
|
|
2992
3002
|
return e ? e.client_msg_id || e.id : "";
|
|
2993
3003
|
}
|
|
2994
|
-
const
|
|
3004
|
+
const lr = {
|
|
2995
3005
|
transferred_to_human: "system.transferredToHuman",
|
|
2996
3006
|
assigned: "system.assigned",
|
|
2997
3007
|
unassigned: "system.unassigned",
|
|
2998
3008
|
resolved: "system.resolved",
|
|
2999
3009
|
reopened: "system.reopened",
|
|
3000
3010
|
idle: "system.idle"
|
|
3001
|
-
},
|
|
3011
|
+
}, cr = 80, dr = 200, ur = {
|
|
3002
3012
|
name: "WmMessageList",
|
|
3003
3013
|
components: {
|
|
3004
|
-
AIAvatar:
|
|
3005
|
-
HumanAvatar:
|
|
3006
|
-
Bubble:
|
|
3007
|
-
Typing:
|
|
3008
|
-
ActionResult:
|
|
3009
|
-
AttachmentPreview:
|
|
3010
|
-
ArtifactRenderer:
|
|
3014
|
+
AIAvatar: le,
|
|
3015
|
+
HumanAvatar: Ee,
|
|
3016
|
+
Bubble: sr,
|
|
3017
|
+
Typing: or,
|
|
3018
|
+
ActionResult: es,
|
|
3019
|
+
AttachmentPreview: Zs,
|
|
3020
|
+
ArtifactRenderer: $s
|
|
3011
3021
|
},
|
|
3012
3022
|
inject: {
|
|
3013
3023
|
// Translator + resolved-language getter shared by the Messenger
|
|
3014
3024
|
// shell. Fall back to French wording when used standalone.
|
|
3015
|
-
t: { default: () =>
|
|
3025
|
+
t: { default: () => P() },
|
|
3016
3026
|
wmLocale: { default: () => () => "fr" }
|
|
3017
3027
|
},
|
|
3018
3028
|
props: {
|
|
@@ -3061,58 +3071,58 @@ const or = {
|
|
|
3061
3071
|
return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
|
|
3062
3072
|
},
|
|
3063
3073
|
groups() {
|
|
3064
|
-
var n,
|
|
3074
|
+
var n, i, r, s;
|
|
3065
3075
|
const e = [];
|
|
3066
|
-
for (const
|
|
3067
|
-
const l = this.roleOf(
|
|
3076
|
+
for (const a of this.messages) {
|
|
3077
|
+
const l = this.roleOf(a);
|
|
3068
3078
|
if (l === "system") {
|
|
3069
|
-
if (((n =
|
|
3079
|
+
if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
|
|
3070
3080
|
const k = e[e.length - 1];
|
|
3071
|
-
k && k.role === "ai" ? k.messages.push(
|
|
3072
|
-
key: `g-${se(
|
|
3081
|
+
k && k.role === "ai" ? k.messages.push(a) : e.push({
|
|
3082
|
+
key: `g-${se(a)}`,
|
|
3073
3083
|
role: "ai",
|
|
3074
3084
|
agentName: "",
|
|
3075
3085
|
agentAvatarUrl: null,
|
|
3076
|
-
messages: [
|
|
3086
|
+
messages: [a],
|
|
3077
3087
|
items: []
|
|
3078
3088
|
});
|
|
3079
3089
|
continue;
|
|
3080
3090
|
}
|
|
3081
3091
|
e.push({
|
|
3082
|
-
key: `sys-${se(
|
|
3092
|
+
key: `sys-${se(a)}`,
|
|
3083
3093
|
role: l,
|
|
3084
|
-
messages: [
|
|
3094
|
+
messages: [a],
|
|
3085
3095
|
items: [],
|
|
3086
|
-
systemLabel: this.systemLabel(
|
|
3096
|
+
systemLabel: this.systemLabel(a)
|
|
3087
3097
|
});
|
|
3088
3098
|
continue;
|
|
3089
3099
|
}
|
|
3090
3100
|
const g = e[e.length - 1];
|
|
3091
|
-
g && g.role === l && (l === "ai" || g.agentName === (((
|
|
3092
|
-
key: `g-${se(
|
|
3101
|
+
g && g.role === l && (l === "ai" || g.agentName === (((i = a == null ? void 0 : a.author) == null ? void 0 : i.name) || "")) ? g.messages.push(a) : e.push({
|
|
3102
|
+
key: `g-${se(a)}`,
|
|
3093
3103
|
role: l,
|
|
3094
|
-
agentName: ((
|
|
3095
|
-
agentAvatarUrl: ((s =
|
|
3096
|
-
messages: [
|
|
3104
|
+
agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
|
|
3105
|
+
agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
|
|
3106
|
+
messages: [a],
|
|
3097
3107
|
items: []
|
|
3098
3108
|
});
|
|
3099
3109
|
}
|
|
3100
|
-
for (const
|
|
3101
|
-
if (
|
|
3110
|
+
for (const a of e) {
|
|
3111
|
+
if (a.role === "system") continue;
|
|
3102
3112
|
const l = [];
|
|
3103
|
-
for (const g of
|
|
3113
|
+
for (const g of a.messages)
|
|
3104
3114
|
for (const C of this.itemsOf(g)) l.push(C);
|
|
3105
|
-
|
|
3115
|
+
a.items = l;
|
|
3106
3116
|
}
|
|
3107
3117
|
const t = [];
|
|
3108
|
-
for (const
|
|
3109
|
-
if (
|
|
3118
|
+
for (const a of e) {
|
|
3119
|
+
if (a.role !== "system" && !a.items.length) continue;
|
|
3110
3120
|
const l = t[t.length - 1];
|
|
3111
|
-
if (l && l.role !== "system" && l.role ===
|
|
3112
|
-
l.messages.push(...
|
|
3121
|
+
if (l && l.role !== "system" && l.role === a.role && (a.role === "ai" || l.agentName === a.agentName)) {
|
|
3122
|
+
l.messages.push(...a.messages), l.items.push(...a.items);
|
|
3113
3123
|
continue;
|
|
3114
3124
|
}
|
|
3115
|
-
t.push(
|
|
3125
|
+
t.push(a);
|
|
3116
3126
|
}
|
|
3117
3127
|
return t;
|
|
3118
3128
|
},
|
|
@@ -3124,10 +3134,10 @@ const or = {
|
|
|
3124
3134
|
const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
|
|
3125
3135
|
for (const n of this.groups) {
|
|
3126
3136
|
if (n.role === "user" || n.role === "system" || !n.items.length) continue;
|
|
3127
|
-
const
|
|
3128
|
-
if (!
|
|
3129
|
-
const
|
|
3130
|
-
if (
|
|
3137
|
+
const i = n.messages[0];
|
|
3138
|
+
if (!i) continue;
|
|
3139
|
+
const r = J(i.id);
|
|
3140
|
+
if (r != null && !(r <= e) && !(t && i.created_at && i.created_at > t))
|
|
3131
3141
|
return n.key;
|
|
3132
3142
|
}
|
|
3133
3143
|
return null;
|
|
@@ -3155,11 +3165,11 @@ const or = {
|
|
|
3155
3165
|
methods: {
|
|
3156
3166
|
messageKey: se,
|
|
3157
3167
|
isAtBottom(e) {
|
|
3158
|
-
return e.scrollHeight - e.scrollTop - e.clientHeight <=
|
|
3168
|
+
return e.scrollHeight - e.scrollTop - e.clientHeight <= cr;
|
|
3159
3169
|
},
|
|
3160
3170
|
onScroll() {
|
|
3161
3171
|
const e = this.$refs.scrollEl;
|
|
3162
|
-
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <=
|
|
3172
|
+
e && (this.loadingMore || !this.hasMore || this._pendingLoadMore || e.scrollTop <= dr && (this._pendingLoadMore = !0, this.$emit("load-more")));
|
|
3163
3173
|
},
|
|
3164
3174
|
// Capture pre-patch scroll state and restore it on the next tick.
|
|
3165
3175
|
//
|
|
@@ -3188,29 +3198,29 @@ const or = {
|
|
|
3188
3198
|
const t = this._lastSeenConvId !== this.conversationId;
|
|
3189
3199
|
this._lastSeenConvId = this.conversationId;
|
|
3190
3200
|
const n = this.isAtBottom(e);
|
|
3191
|
-
let
|
|
3201
|
+
let i = null;
|
|
3192
3202
|
if (!t && !n) {
|
|
3193
3203
|
const s = this.pickAnchor(e);
|
|
3194
3204
|
if (s != null && s.el) {
|
|
3195
|
-
const
|
|
3196
|
-
|
|
3205
|
+
const a = e.getBoundingClientRect().top;
|
|
3206
|
+
i = {
|
|
3197
3207
|
el: s.el,
|
|
3198
|
-
relY: s.el.getBoundingClientRect().top -
|
|
3208
|
+
relY: s.el.getBoundingClientRect().top - a
|
|
3199
3209
|
};
|
|
3200
3210
|
}
|
|
3201
3211
|
}
|
|
3202
|
-
const
|
|
3203
|
-
this._scrollSnap =
|
|
3204
|
-
if (this._scrollSnap = null,
|
|
3212
|
+
const r = { forceBottom: t, wasPinned: n, anchor: i };
|
|
3213
|
+
this._scrollSnap = r, this.$nextTick(() => {
|
|
3214
|
+
if (this._scrollSnap = null, r.forceBottom || r.wasPinned) {
|
|
3205
3215
|
e.scrollTop = e.scrollHeight;
|
|
3206
3216
|
return;
|
|
3207
3217
|
}
|
|
3208
|
-
if (!
|
|
3218
|
+
if (!r.anchor) return;
|
|
3209
3219
|
const s = () => {
|
|
3210
3220
|
var C;
|
|
3211
|
-
const
|
|
3212
|
-
if (!((C =
|
|
3213
|
-
const g =
|
|
3221
|
+
const a = r.anchor;
|
|
3222
|
+
if (!((C = a.el) != null && C.isConnected)) return;
|
|
3223
|
+
const g = a.el.getBoundingClientRect().top - e.getBoundingClientRect().top - a.relY;
|
|
3214
3224
|
Math.abs(g) > 0.5 && (e.scrollTop += g);
|
|
3215
3225
|
};
|
|
3216
3226
|
s(), requestAnimationFrame(() => {
|
|
@@ -3239,16 +3249,16 @@ const or = {
|
|
|
3239
3249
|
pickAnchor(e) {
|
|
3240
3250
|
const t = e.scrollTop;
|
|
3241
3251
|
let n = null;
|
|
3242
|
-
for (const
|
|
3243
|
-
if (
|
|
3244
|
-
return { el:
|
|
3252
|
+
for (const i of e.children)
|
|
3253
|
+
if (i.classList.contains("wm-list__group") && (n || (n = i), i.offsetTop + i.offsetHeight >= t))
|
|
3254
|
+
return { el: i, offsetTop: i.offsetTop };
|
|
3245
3255
|
return n ? { el: n, offsetTop: n.offsetTop } : null;
|
|
3246
3256
|
},
|
|
3247
3257
|
roleOf(e) {
|
|
3248
|
-
var n,
|
|
3258
|
+
var n, i;
|
|
3249
3259
|
if ((e == null ? void 0 : e.type) === "system" || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.type) === "system")
|
|
3250
3260
|
return "system";
|
|
3251
|
-
const t = (
|
|
3261
|
+
const t = (i = e == null ? void 0 : e.author) == null ? void 0 : i.type;
|
|
3252
3262
|
return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
|
|
3253
3263
|
},
|
|
3254
3264
|
roleLabel(e) {
|
|
@@ -3344,9 +3354,9 @@ const or = {
|
|
|
3344
3354
|
// doit garder son arrondi.
|
|
3345
3355
|
cornersFor(e, t) {
|
|
3346
3356
|
var ee, te, G;
|
|
3347
|
-
const n = e.items,
|
|
3348
|
-
let
|
|
3349
|
-
return
|
|
3357
|
+
const n = e.items, i = (ee = n[t]) == null ? void 0 : ee.kind, r = (te = n[t - 1]) == null ? void 0 : te.kind, s = (G = n[t + 1]) == null ? void 0 : G.kind, a = e.role === "user", l = 14, g = 4, C = r == null ? void 0 : r.bottom, k = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], B = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], H = 0.5, M = (Y, Q, q) => Y != null && T != null ? Y + H >= T : Q === q || Q === "card" && q === "bubble";
|
|
3358
|
+
let D = l, N = l, $ = l, K = l;
|
|
3359
|
+
return a ? (C && (N = g), (k || !s) && ($ = g), C && M(B, C, i == null ? void 0 : i.top) && (D = g), k && M(A, k, i == null ? void 0 : i.bottom) && (K = g)) : (C && (D = g), (k || !s) && (K = g), C && M(B, C, i == null ? void 0 : i.top) && (N = g), k && M(A, k, i == null ? void 0 : i.bottom) && ($ = g)), { tl: D, tr: N, br: $, bl: K };
|
|
3350
3360
|
},
|
|
3351
3361
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3352
3362
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3365,8 +3375,8 @@ const or = {
|
|
|
3365
3375
|
// Clé unique par item de cluster, alignée avec `:key` /
|
|
3366
3376
|
// `data-row-key` du template. Sert d'index dans `widthByKey`.
|
|
3367
3377
|
rowKeyOf(e, t) {
|
|
3368
|
-
var
|
|
3369
|
-
const n = (
|
|
3378
|
+
var i;
|
|
3379
|
+
const n = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
|
|
3370
3380
|
return n ? `${se(n.message)}-${n.partKey}` : "";
|
|
3371
3381
|
},
|
|
3372
3382
|
// rAF-debouncé : `updated()` peut être appelé en rafale (stream,
|
|
@@ -3387,20 +3397,20 @@ const or = {
|
|
|
3387
3397
|
for (const s of e.querySelectorAll(
|
|
3388
3398
|
".wm-list__row[data-row-key]"
|
|
3389
3399
|
)) {
|
|
3390
|
-
const
|
|
3391
|
-
if (!
|
|
3400
|
+
const a = s.dataset.rowKey;
|
|
3401
|
+
if (!a) continue;
|
|
3392
3402
|
const l = s.querySelector(
|
|
3393
3403
|
".wm-bubble, .wm-result, .wm-art, .wm-list__body"
|
|
3394
3404
|
);
|
|
3395
3405
|
if (!l) continue;
|
|
3396
3406
|
const g = l.getBoundingClientRect().width;
|
|
3397
|
-
g > 0 && (t[
|
|
3407
|
+
g > 0 && (t[a] = g);
|
|
3398
3408
|
}
|
|
3399
|
-
const n = this.widthByKey,
|
|
3400
|
-
if (
|
|
3409
|
+
const n = this.widthByKey, i = Object.keys(n), r = Object.keys(t);
|
|
3410
|
+
if (i.length === r.length) {
|
|
3401
3411
|
let s = !0;
|
|
3402
|
-
for (const
|
|
3403
|
-
if (Math.abs((n[
|
|
3412
|
+
for (const a of r)
|
|
3413
|
+
if (Math.abs((n[a] ?? 0) - t[a]) > 0.5) {
|
|
3404
3414
|
s = !1;
|
|
3405
3415
|
break;
|
|
3406
3416
|
}
|
|
@@ -3414,7 +3424,7 @@ const or = {
|
|
|
3414
3424
|
try {
|
|
3415
3425
|
return Le(
|
|
3416
3426
|
new Date(n.created_at),
|
|
3417
|
-
|
|
3427
|
+
oe(this.wmLocale())
|
|
3418
3428
|
);
|
|
3419
3429
|
} catch {
|
|
3420
3430
|
return "";
|
|
@@ -3448,92 +3458,92 @@ const or = {
|
|
|
3448
3458
|
return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
|
|
3449
3459
|
},
|
|
3450
3460
|
actionDetail(e) {
|
|
3451
|
-
var n,
|
|
3461
|
+
var n, i, r, s, a, l;
|
|
3452
3462
|
const t = e == null ? void 0 : e.payload;
|
|
3453
|
-
return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((
|
|
3463
|
+
return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((r = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : r.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((a = t.failure) == null ? void 0 : a.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
|
|
3454
3464
|
},
|
|
3455
3465
|
actionArtifact(e) {
|
|
3456
|
-
var n,
|
|
3457
|
-
const t = (
|
|
3466
|
+
var n, i;
|
|
3467
|
+
const t = (i = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : i.artifact;
|
|
3458
3468
|
return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
|
|
3459
3469
|
},
|
|
3460
3470
|
systemLabel(e) {
|
|
3461
|
-
var
|
|
3462
|
-
const t = (
|
|
3463
|
-
return n ? this.t(n, { name:
|
|
3471
|
+
var r, s, a;
|
|
3472
|
+
const t = (r = e == null ? void 0 : e.payload) == null ? void 0 : r.event, n = lr[t], i = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((a = e == null ? void 0 : e.author) == null ? void 0 : a.name) || this.t("messageList.anAgent");
|
|
3473
|
+
return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
|
|
3464
3474
|
},
|
|
3465
3475
|
scrollToBottom() {
|
|
3466
3476
|
const e = this.$refs.scrollEl;
|
|
3467
3477
|
e && (e.scrollTop = e.scrollHeight);
|
|
3468
3478
|
}
|
|
3469
3479
|
}
|
|
3470
|
-
},
|
|
3480
|
+
}, hr = {
|
|
3471
3481
|
key: 0,
|
|
3472
3482
|
class: "wm-list__loadMore",
|
|
3473
3483
|
role: "status",
|
|
3474
3484
|
"aria-live": "polite"
|
|
3475
|
-
}, mr = { class: "wm-list__loadMore-lbl" },
|
|
3485
|
+
}, mr = { class: "wm-list__loadMore-lbl" }, fr = {
|
|
3476
3486
|
key: 1,
|
|
3477
3487
|
class: "wm-list__historyEnd"
|
|
3478
|
-
},
|
|
3488
|
+
}, _r = {
|
|
3479
3489
|
key: 2,
|
|
3480
3490
|
class: "wm-list__sep"
|
|
3481
|
-
},
|
|
3491
|
+
}, pr = { class: "wm-list__sep-label" }, gr = {
|
|
3482
3492
|
key: 0,
|
|
3483
3493
|
class: "wm-list__sep wm-list__sep--unread"
|
|
3484
|
-
},
|
|
3494
|
+
}, vr = { class: "wm-list__sep-label wm-list__sep-label--unread" }, yr = {
|
|
3485
3495
|
key: 0,
|
|
3486
3496
|
class: "wm-list__sysep"
|
|
3487
|
-
},
|
|
3497
|
+
}, br = { class: "wm-list__sysep-label" }, wr = ["data-row-key"], kr = {
|
|
3488
3498
|
key: 0,
|
|
3489
3499
|
class: "wm-list__avatarSlot"
|
|
3490
|
-
},
|
|
3500
|
+
}, Cr = {
|
|
3491
3501
|
key: 5,
|
|
3492
3502
|
class: "wm-list__body"
|
|
3493
|
-
},
|
|
3503
|
+
}, Ar = { key: 0 }, Sr = {
|
|
3494
3504
|
key: 1,
|
|
3495
3505
|
"aria-hidden": "true"
|
|
3496
|
-
},
|
|
3506
|
+
}, Mr = { key: 2 }, Tr = {
|
|
3497
3507
|
key: 3,
|
|
3498
3508
|
class: "wm-list__row wm-list__row--ai fade-up"
|
|
3499
|
-
},
|
|
3500
|
-
function
|
|
3501
|
-
const
|
|
3509
|
+
}, xr = { class: "wm-list__avatarSlot" };
|
|
3510
|
+
function Or(e, t, n, i, r, s) {
|
|
3511
|
+
const a = I("AIAvatar"), l = I("HumanAvatar"), g = I("ActionResult"), C = I("ArtifactRenderer"), k = I("Bubble"), T = I("AttachmentPreview"), B = I("Typing");
|
|
3502
3512
|
return c(), u("div", {
|
|
3503
3513
|
ref: "scrollEl",
|
|
3504
|
-
class: x(["wm-list", { "wm-list--silent":
|
|
3514
|
+
class: x(["wm-list", { "wm-list--silent": r.silentFades }]),
|
|
3505
3515
|
onScrollPassive: t[0] || (t[0] = (...A) => s.onScroll && s.onScroll(...A))
|
|
3506
3516
|
}, [
|
|
3507
|
-
n.loadingMore ? (c(), u("div",
|
|
3517
|
+
n.loadingMore ? (c(), u("div", hr, [
|
|
3508
3518
|
t[1] || (t[1] = o("span", {
|
|
3509
3519
|
class: "wm-list__loadMore-spinner",
|
|
3510
3520
|
"aria-hidden": "true"
|
|
3511
3521
|
}, null, -1)),
|
|
3512
3522
|
o("span", mr, v(s.t("messageList.loadingHistory")), 1)
|
|
3513
|
-
])) : s.historyExhausted ? (c(), u("div",
|
|
3514
|
-
n.dateLabel ? (c(), u("div",
|
|
3523
|
+
])) : s.historyExhausted ? (c(), u("div", fr, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
|
|
3524
|
+
n.dateLabel ? (c(), u("div", _r, [
|
|
3515
3525
|
t[2] || (t[2] = o("div", { class: "wm-list__line" }, null, -1)),
|
|
3516
|
-
o("span",
|
|
3526
|
+
o("span", pr, v(n.dateLabel), 1),
|
|
3517
3527
|
t[3] || (t[3] = o("div", { class: "wm-list__line" }, null, -1))
|
|
3518
3528
|
])) : b("", !0),
|
|
3519
3529
|
(c(!0), u(L, null, j(s.groups, (A, H) => (c(), u(L, {
|
|
3520
3530
|
key: A.key
|
|
3521
3531
|
}, [
|
|
3522
|
-
A.key === s.unreadGroupKey ? (c(), u("div",
|
|
3532
|
+
A.key === s.unreadGroupKey ? (c(), u("div", gr, [
|
|
3523
3533
|
t[4] || (t[4] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
|
|
3524
|
-
o("span",
|
|
3534
|
+
o("span", vr, v(s.t("messageList.unread")), 1),
|
|
3525
3535
|
t[5] || (t[5] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
|
|
3526
3536
|
])) : b("", !0),
|
|
3527
3537
|
A.role === "system" || A.items.length ? (c(), u("div", {
|
|
3528
3538
|
key: 1,
|
|
3529
3539
|
class: x(["wm-list__group", "wm-list__group--" + A.role])
|
|
3530
3540
|
}, [
|
|
3531
|
-
A.role === "system" ? (c(), u("div",
|
|
3541
|
+
A.role === "system" ? (c(), u("div", yr, [
|
|
3532
3542
|
t[6] || (t[6] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
|
|
3533
|
-
o("span",
|
|
3543
|
+
o("span", br, v(A.systemLabel), 1),
|
|
3534
3544
|
t[7] || (t[7] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
|
|
3535
3545
|
])) : (c(), u(L, { key: 1 }, [
|
|
3536
|
-
(c(!0), u(L, null, j(A.items, (M,
|
|
3546
|
+
(c(!0), u(L, null, j(A.items, (M, D) => (c(), u("div", {
|
|
3537
3547
|
key: `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3538
3548
|
"data-row-key": `${s.messageKey(M.message)}-${M.partKey}`,
|
|
3539
3549
|
class: x(["wm-list__row fade-up", [
|
|
@@ -3543,11 +3553,11 @@ function xr(e, t, n, r, a, s) {
|
|
|
3543
3553
|
"is-failed": M.message._failed
|
|
3544
3554
|
}
|
|
3545
3555
|
]]),
|
|
3546
|
-
style: W(s.cornersStyle(A,
|
|
3556
|
+
style: W(s.cornersStyle(A, D))
|
|
3547
3557
|
}, [
|
|
3548
|
-
A.role !== "user" ? (c(), u("div",
|
|
3549
|
-
|
|
3550
|
-
A.role === "ai" ? (c(), R(
|
|
3558
|
+
A.role !== "user" ? (c(), u("div", kr, [
|
|
3559
|
+
D === A.items.length - 1 ? (c(), u(L, { key: 0 }, [
|
|
3560
|
+
A.role === "ai" ? (c(), R(a, {
|
|
3551
3561
|
key: 0,
|
|
3552
3562
|
size: 26,
|
|
3553
3563
|
tail: !0
|
|
@@ -3576,7 +3586,7 @@ function xr(e, t, n, r, a, s) {
|
|
|
3576
3586
|
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), R(C, {
|
|
3577
3587
|
key: 4,
|
|
3578
3588
|
artifact: s.artifactOf(M.message)
|
|
3579
|
-
}, null, 8, ["artifact"])) : (c(), u("div",
|
|
3589
|
+
}, null, 8, ["artifact"])) : (c(), u("div", Cr, [
|
|
3580
3590
|
M.message.text_md ? (c(), R(k, {
|
|
3581
3591
|
key: 0,
|
|
3582
3592
|
role: A.role,
|
|
@@ -3596,21 +3606,21 @@ function xr(e, t, n, r, a, s) {
|
|
|
3596
3606
|
}, null, 8, ["attachment"]))), 128))
|
|
3597
3607
|
], 2)) : b("", !0)
|
|
3598
3608
|
]))
|
|
3599
|
-
], 14,
|
|
3609
|
+
], 14, wr))), 128)),
|
|
3600
3610
|
(A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), u("div", {
|
|
3601
3611
|
key: 0,
|
|
3602
3612
|
class: x(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
|
|
3603
3613
|
}, [
|
|
3604
|
-
A.role !== "user" ? (c(), u("span",
|
|
3605
|
-
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span",
|
|
3606
|
-
s.lastTimeOf(A) ? (c(), u("span",
|
|
3614
|
+
A.role !== "user" ? (c(), u("span", Ar, v(s.roleLabel(A)), 1)) : b("", !0),
|
|
3615
|
+
A.role !== "user" && s.lastTimeOf(A) ? (c(), u("span", Sr, "·")) : b("", !0),
|
|
3616
|
+
s.lastTimeOf(A) ? (c(), u("span", Mr, v(s.lastTimeOf(A)), 1)) : b("", !0)
|
|
3607
3617
|
], 2)) : b("", !0)
|
|
3608
3618
|
], 64))
|
|
3609
3619
|
], 2)) : b("", !0)
|
|
3610
3620
|
], 64))), 128)),
|
|
3611
|
-
n.streamingActive ? (c(), u("div",
|
|
3612
|
-
o("div",
|
|
3613
|
-
z(
|
|
3621
|
+
n.streamingActive ? (c(), u("div", Tr, [
|
|
3622
|
+
o("div", xr, [
|
|
3623
|
+
z(a, {
|
|
3614
3624
|
size: 26,
|
|
3615
3625
|
tail: !0
|
|
3616
3626
|
})
|
|
@@ -3619,19 +3629,19 @@ function xr(e, t, n, r, a, s) {
|
|
|
3619
3629
|
])) : b("", !0)
|
|
3620
3630
|
], 34);
|
|
3621
3631
|
}
|
|
3622
|
-
const
|
|
3623
|
-
function
|
|
3632
|
+
const Lr = /* @__PURE__ */ E(ur, [["render", Or], ["__scopeId", "data-v-ced149e1"]]), he = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", ve = typeof window < "u" && typeof window.MediaRecorder < "u";
|
|
3633
|
+
function Ir() {
|
|
3624
3634
|
return ve && [
|
|
3625
3635
|
"video/webm;codecs=vp9,opus",
|
|
3626
3636
|
"video/webm;codecs=vp8,opus",
|
|
3627
3637
|
"video/webm",
|
|
3628
3638
|
"video/mp4"
|
|
3629
3639
|
].find((t) => {
|
|
3630
|
-
var n,
|
|
3631
|
-
return (
|
|
3640
|
+
var n, i;
|
|
3641
|
+
return (i = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(n, t);
|
|
3632
3642
|
}) || "";
|
|
3633
3643
|
}
|
|
3634
|
-
function
|
|
3644
|
+
function Re({ audio: e }) {
|
|
3635
3645
|
return {
|
|
3636
3646
|
video: !0,
|
|
3637
3647
|
audio: !!e,
|
|
@@ -3640,21 +3650,21 @@ function Be({ audio: e }) {
|
|
|
3640
3650
|
systemAudio: e ? "include" : "exclude"
|
|
3641
3651
|
};
|
|
3642
3652
|
}
|
|
3643
|
-
function
|
|
3653
|
+
function Ua(e) {
|
|
3644
3654
|
return e ? e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : "file" : "file";
|
|
3645
3655
|
}
|
|
3646
3656
|
async function Er() {
|
|
3647
|
-
if (!
|
|
3657
|
+
if (!he) return null;
|
|
3648
3658
|
let e;
|
|
3649
3659
|
try {
|
|
3650
3660
|
e = await navigator.mediaDevices.getDisplayMedia(
|
|
3651
|
-
|
|
3661
|
+
Re({ audio: !1 })
|
|
3652
3662
|
);
|
|
3653
3663
|
} catch (t) {
|
|
3654
3664
|
return (t == null ? void 0 : t.name) !== "NotAllowedError" && console.error("[media] screenshot picker", t), null;
|
|
3655
3665
|
}
|
|
3656
3666
|
try {
|
|
3657
|
-
return await
|
|
3667
|
+
return await Br(e);
|
|
3658
3668
|
} catch (t) {
|
|
3659
3669
|
return console.error("[media] screenshot capture", t), null;
|
|
3660
3670
|
} finally {
|
|
@@ -3663,67 +3673,67 @@ async function Er() {
|
|
|
3663
3673
|
});
|
|
3664
3674
|
}
|
|
3665
3675
|
}
|
|
3666
|
-
async function
|
|
3676
|
+
async function Br(e) {
|
|
3667
3677
|
const t = document.createElement("video");
|
|
3668
3678
|
t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
|
|
3669
|
-
const n = t.videoWidth || 1280,
|
|
3670
|
-
|
|
3679
|
+
const n = t.videoWidth || 1280, i = t.videoHeight || 720, r = document.createElement("canvas");
|
|
3680
|
+
r.width = n, r.height = i, r.getContext("2d").drawImage(t, 0, 0, n, i);
|
|
3671
3681
|
const s = await new Promise((l, g) => {
|
|
3672
|
-
|
|
3682
|
+
r.toBlob(
|
|
3673
3683
|
(C) => C ? l(C) : g(new Error("toBlob failed")),
|
|
3674
3684
|
"image/png"
|
|
3675
3685
|
);
|
|
3676
|
-
}),
|
|
3677
|
-
return new File([s], `capture-${
|
|
3686
|
+
}), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
3687
|
+
return new File([s], `capture-${a}.png`, { type: "image/png" });
|
|
3678
3688
|
}
|
|
3679
|
-
async function
|
|
3689
|
+
async function Rr(e = {}) {
|
|
3680
3690
|
var C;
|
|
3681
|
-
if (!
|
|
3691
|
+
if (!he || !ve) return null;
|
|
3682
3692
|
let t;
|
|
3683
3693
|
try {
|
|
3684
3694
|
t = await navigator.mediaDevices.getDisplayMedia(
|
|
3685
|
-
|
|
3695
|
+
Re({ audio: !0 })
|
|
3686
3696
|
);
|
|
3687
3697
|
} catch (k) {
|
|
3688
3698
|
return (k == null ? void 0 : k.name) !== "NotAllowedError" && console.error("[media] record picker", k), null;
|
|
3689
3699
|
}
|
|
3690
|
-
const n =
|
|
3691
|
-
let
|
|
3700
|
+
const n = Ir();
|
|
3701
|
+
let i;
|
|
3692
3702
|
try {
|
|
3693
|
-
|
|
3703
|
+
i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
|
|
3694
3704
|
} catch (k) {
|
|
3695
3705
|
return console.error("[media] recorder init", k), t.getTracks().forEach((T) => {
|
|
3696
3706
|
T.stop();
|
|
3697
3707
|
}), null;
|
|
3698
3708
|
}
|
|
3699
|
-
const
|
|
3700
|
-
let s = null,
|
|
3701
|
-
|
|
3702
|
-
k.data && k.data.size > 0 &&
|
|
3703
|
-
}),
|
|
3709
|
+
const r = [];
|
|
3710
|
+
let s = null, a = !1;
|
|
3711
|
+
i.addEventListener("dataavailable", (k) => {
|
|
3712
|
+
k.data && k.data.size > 0 && r.push(k.data);
|
|
3713
|
+
}), i.addEventListener("stop", () => {
|
|
3704
3714
|
var k, T;
|
|
3705
3715
|
if (s && clearInterval(s), t.getTracks().forEach((B) => {
|
|
3706
3716
|
B.stop();
|
|
3707
|
-
}),
|
|
3708
|
-
const B =
|
|
3717
|
+
}), r.length) {
|
|
3718
|
+
const B = i.mimeType || n || "video/webm", A = new Blob(r, { type: B }), H = /mp4/.test(B) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), D = new File([A], `ecran-${M}.${H}`, {
|
|
3709
3719
|
type: B
|
|
3710
3720
|
});
|
|
3711
|
-
(k = e.onfinalize) == null || k.call(e,
|
|
3721
|
+
(k = e.onfinalize) == null || k.call(e, D);
|
|
3712
3722
|
} else
|
|
3713
3723
|
(T = e.oncancel) == null || T.call(e);
|
|
3714
3724
|
}), t.getVideoTracks().forEach((k) => {
|
|
3715
3725
|
k.addEventListener("ended", () => l(), { once: !0 });
|
|
3716
3726
|
});
|
|
3717
3727
|
function l() {
|
|
3718
|
-
if (!
|
|
3728
|
+
if (!a && (a = !0, i.state !== "inactive"))
|
|
3719
3729
|
try {
|
|
3720
|
-
|
|
3730
|
+
i.stop();
|
|
3721
3731
|
} catch (k) {
|
|
3722
3732
|
console.error("[media] recorder stop", k);
|
|
3723
3733
|
}
|
|
3724
3734
|
}
|
|
3725
3735
|
try {
|
|
3726
|
-
|
|
3736
|
+
i.start(1e3);
|
|
3727
3737
|
} catch (k) {
|
|
3728
3738
|
return console.error("[media] recorder start", k), t.getTracks().forEach((T) => {
|
|
3729
3739
|
T.stop();
|
|
@@ -3737,11 +3747,11 @@ async function Br(e = {}) {
|
|
|
3737
3747
|
}, 500), {
|
|
3738
3748
|
stop: l,
|
|
3739
3749
|
get state() {
|
|
3740
|
-
return
|
|
3750
|
+
return i.state;
|
|
3741
3751
|
}
|
|
3742
3752
|
};
|
|
3743
3753
|
}
|
|
3744
|
-
const
|
|
3754
|
+
const Nr = [
|
|
3745
3755
|
{
|
|
3746
3756
|
action: "file",
|
|
3747
3757
|
labelKey: "composer.attachFile",
|
|
@@ -3757,12 +3767,12 @@ const Rr = [
|
|
|
3757
3767
|
labelKey: "composer.recordScreen",
|
|
3758
3768
|
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"
|
|
3759
3769
|
}
|
|
3760
|
-
],
|
|
3770
|
+
], Fr = {
|
|
3761
3771
|
name: "WmComposer",
|
|
3762
3772
|
inject: {
|
|
3763
3773
|
// Translator shared by the Messenger shell; French fallback when
|
|
3764
3774
|
// the component is used standalone.
|
|
3765
|
-
t: { default: () =>
|
|
3775
|
+
t: { default: () => P() }
|
|
3766
3776
|
},
|
|
3767
3777
|
props: {
|
|
3768
3778
|
modelValue: { type: String, default: "" },
|
|
@@ -3785,10 +3795,10 @@ const Rr = [
|
|
|
3785
3795
|
return !this.disabled && !!this.local.trim();
|
|
3786
3796
|
},
|
|
3787
3797
|
attachItems() {
|
|
3788
|
-
return
|
|
3798
|
+
return Nr.map((e) => ({
|
|
3789
3799
|
...e,
|
|
3790
3800
|
label: this.t(e.labelKey),
|
|
3791
|
-
disabled: e.action === "screenshot" && !
|
|
3801
|
+
disabled: e.action === "screenshot" && !he || e.action === "record" && (!he || !ve)
|
|
3792
3802
|
}));
|
|
3793
3803
|
},
|
|
3794
3804
|
recordingElapsedLabel() {
|
|
@@ -3864,7 +3874,7 @@ const Rr = [
|
|
|
3864
3874
|
async startRecording() {
|
|
3865
3875
|
if (this.recording || this.disabled) return;
|
|
3866
3876
|
this.recordingElapsed = 0;
|
|
3867
|
-
const e = await
|
|
3877
|
+
const e = await Rr({
|
|
3868
3878
|
onstart: () => {
|
|
3869
3879
|
this.recording = !0;
|
|
3870
3880
|
},
|
|
@@ -3889,22 +3899,22 @@ const Rr = [
|
|
|
3889
3899
|
}
|
|
3890
3900
|
}
|
|
3891
3901
|
}
|
|
3892
|
-
},
|
|
3902
|
+
}, jr = { class: "wm-compose-wrap" }, Pr = {
|
|
3893
3903
|
key: 0,
|
|
3894
3904
|
class: "wm-rec"
|
|
3895
|
-
}, Dr = { class: "wm-rec__lbl" },
|
|
3905
|
+
}, Dr = { class: "wm-rec__lbl" }, Ur = {
|
|
3896
3906
|
key: 1,
|
|
3897
3907
|
class: "wm-compose__menu",
|
|
3898
3908
|
role: "menu"
|
|
3899
|
-
},
|
|
3909
|
+
}, $r = ["disabled", "onClick"], Hr = { class: "wm-compose__menuIcon" }, zr = {
|
|
3900
3910
|
viewBox: "0 0 24 24",
|
|
3901
3911
|
width: "14",
|
|
3902
3912
|
height: "14",
|
|
3903
3913
|
"aria-hidden": "true"
|
|
3904
|
-
},
|
|
3905
|
-
function
|
|
3906
|
-
return c(), u("div",
|
|
3907
|
-
|
|
3914
|
+
}, qr = ["d"], Vr = ["placeholder", "disabled"], Wr = { class: "wm-compose__actions" }, Kr = ["title", "aria-label", "disabled"], Gr = ["disabled", "aria-label"];
|
|
3915
|
+
function Yr(e, t, n, i, r, s) {
|
|
3916
|
+
return c(), u("div", jr, [
|
|
3917
|
+
r.recording ? (c(), u("div", Pr, [
|
|
3908
3918
|
t[8] || (t[8] = o("span", {
|
|
3909
3919
|
class: "wm-rec__dot",
|
|
3910
3920
|
"aria-hidden": "true"
|
|
@@ -3913,68 +3923,68 @@ function Gr(e, t, n, r, a, s) {
|
|
|
3913
3923
|
o("button", {
|
|
3914
3924
|
type: "button",
|
|
3915
3925
|
class: "wm-rec__stop",
|
|
3916
|
-
onClick: t[0] || (t[0] = (...
|
|
3926
|
+
onClick: t[0] || (t[0] = (...a) => s.stopRecording && s.stopRecording(...a))
|
|
3917
3927
|
}, v(s.t("composer.stop")), 1)
|
|
3918
3928
|
])) : b("", !0),
|
|
3919
3929
|
o("form", {
|
|
3920
|
-
class: x(["wm-compose", { "has-attach":
|
|
3921
|
-
onSubmit: t[7] || (t[7] = X((...
|
|
3930
|
+
class: x(["wm-compose", { "has-attach": r.attachOpen }]),
|
|
3931
|
+
onSubmit: t[7] || (t[7] = X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
|
|
3922
3932
|
}, [
|
|
3923
3933
|
o("input", {
|
|
3924
3934
|
ref: "fileEl",
|
|
3925
3935
|
type: "file",
|
|
3926
3936
|
hidden: "",
|
|
3927
3937
|
multiple: "",
|
|
3928
|
-
onChange: t[1] || (t[1] = (...
|
|
3938
|
+
onChange: t[1] || (t[1] = (...a) => s.onFile && s.onFile(...a))
|
|
3929
3939
|
}, null, 544),
|
|
3930
|
-
|
|
3940
|
+
r.attachOpen ? (c(), u("div", {
|
|
3931
3941
|
key: 0,
|
|
3932
3942
|
class: "wm-compose__overlay",
|
|
3933
|
-
onClick: t[2] || (t[2] = (
|
|
3943
|
+
onClick: t[2] || (t[2] = (a) => r.attachOpen = !1)
|
|
3934
3944
|
})) : b("", !0),
|
|
3935
|
-
|
|
3936
|
-
(c(!0), u(L, null, j(s.attachItems, (
|
|
3937
|
-
key:
|
|
3945
|
+
r.attachOpen ? (c(), u("div", Ur, [
|
|
3946
|
+
(c(!0), u(L, null, j(s.attachItems, (a) => (c(), u("button", {
|
|
3947
|
+
key: a.action,
|
|
3938
3948
|
type: "button",
|
|
3939
3949
|
class: "wm-compose__menuItem",
|
|
3940
|
-
disabled:
|
|
3941
|
-
onClick: (l) => s.onAttachAction(
|
|
3950
|
+
disabled: a.disabled,
|
|
3951
|
+
onClick: (l) => s.onAttachAction(a.action)
|
|
3942
3952
|
}, [
|
|
3943
|
-
o("span",
|
|
3944
|
-
(c(), u("svg",
|
|
3953
|
+
o("span", Hr, [
|
|
3954
|
+
(c(), u("svg", zr, [
|
|
3945
3955
|
o("path", {
|
|
3946
|
-
d:
|
|
3956
|
+
d: a.path,
|
|
3947
3957
|
stroke: "currentColor",
|
|
3948
3958
|
"stroke-width": "1.8",
|
|
3949
3959
|
"stroke-linecap": "round",
|
|
3950
3960
|
"stroke-linejoin": "round",
|
|
3951
3961
|
fill: "none"
|
|
3952
|
-
}, null, 8,
|
|
3962
|
+
}, null, 8, qr)
|
|
3953
3963
|
]))
|
|
3954
3964
|
]),
|
|
3955
|
-
o("span", null, v(
|
|
3956
|
-
], 8,
|
|
3965
|
+
o("span", null, v(a.label), 1)
|
|
3966
|
+
], 8, $r))), 128))
|
|
3957
3967
|
])) : b("", !0),
|
|
3958
3968
|
V(o("textarea", {
|
|
3959
3969
|
ref: "inputEl",
|
|
3960
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
3970
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => r.local = a),
|
|
3961
3971
|
class: "wm-compose__input",
|
|
3962
3972
|
rows: "3",
|
|
3963
3973
|
placeholder: n.placeholder,
|
|
3964
3974
|
disabled: n.disabled,
|
|
3965
|
-
onKeydown: t[4] || (t[4] = (...
|
|
3966
|
-
onInput: t[5] || (t[5] = (...
|
|
3967
|
-
}, null, 40,
|
|
3968
|
-
[Z,
|
|
3975
|
+
onKeydown: t[4] || (t[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
|
|
3976
|
+
onInput: t[5] || (t[5] = (...a) => s.autosize && s.autosize(...a))
|
|
3977
|
+
}, null, 40, Vr), [
|
|
3978
|
+
[Z, r.local]
|
|
3969
3979
|
]),
|
|
3970
|
-
o("div",
|
|
3980
|
+
o("div", Wr, [
|
|
3971
3981
|
o("button", {
|
|
3972
3982
|
type: "button",
|
|
3973
|
-
class: x(["wm-compose__icon", { "is-open":
|
|
3983
|
+
class: x(["wm-compose__icon", { "is-open": r.attachOpen }]),
|
|
3974
3984
|
title: n.attachLabel,
|
|
3975
3985
|
"aria-label": n.attachLabel,
|
|
3976
|
-
disabled:
|
|
3977
|
-
onClick: t[6] || (t[6] = (
|
|
3986
|
+
disabled: r.recording,
|
|
3987
|
+
onClick: t[6] || (t[6] = (a) => r.attachOpen = !r.attachOpen)
|
|
3978
3988
|
}, [...t[9] || (t[9] = [
|
|
3979
3989
|
o("svg", {
|
|
3980
3990
|
width: "13",
|
|
@@ -3989,7 +3999,7 @@ function Gr(e, t, n, r, a, s) {
|
|
|
3989
3999
|
}, [
|
|
3990
4000
|
o("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" })
|
|
3991
4001
|
], -1)
|
|
3992
|
-
])], 10,
|
|
4002
|
+
])], 10, Kr),
|
|
3993
4003
|
o("button", {
|
|
3994
4004
|
type: "submit",
|
|
3995
4005
|
class: x(["wm-compose__send", { "is-empty": !s.canSend }]),
|
|
@@ -4009,12 +4019,12 @@ function Gr(e, t, n, r, a, s) {
|
|
|
4009
4019
|
}, [
|
|
4010
4020
|
o("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
4011
4021
|
], -1)
|
|
4012
|
-
])], 10,
|
|
4022
|
+
])], 10, Gr)
|
|
4013
4023
|
])
|
|
4014
4024
|
], 34)
|
|
4015
4025
|
]);
|
|
4016
4026
|
}
|
|
4017
|
-
const
|
|
4027
|
+
const Qr = /* @__PURE__ */ E(Fr, [["render", Yr], ["__scopeId", "data-v-aa81dbb8"]]), Xr = {
|
|
4018
4028
|
name: "WmSuggestionChips",
|
|
4019
4029
|
props: {
|
|
4020
4030
|
items: { type: Array, default: () => [] },
|
|
@@ -4031,28 +4041,28 @@ const Yr = /* @__PURE__ */ I(Nr, [["render", Gr], ["__scopeId", "data-v-aa81dbb8
|
|
|
4031
4041
|
return this.items.map((e) => (e == null ? void 0 : e.label) || (e == null ? void 0 : e.text) || "").join("§");
|
|
4032
4042
|
}
|
|
4033
4043
|
}
|
|
4034
|
-
},
|
|
4035
|
-
function
|
|
4044
|
+
}, Jr = ["onClick"];
|
|
4045
|
+
function Zr(e, t, n, i, r, s) {
|
|
4036
4046
|
return n.items.length ? (c(), u("div", {
|
|
4037
4047
|
key: s.batchKey,
|
|
4038
4048
|
class: "wm-chips"
|
|
4039
4049
|
}, [
|
|
4040
|
-
(c(!0), u(L, null, j(n.items, (
|
|
4050
|
+
(c(!0), u(L, null, j(n.items, (a, l) => (c(), u("button", {
|
|
4041
4051
|
key: l,
|
|
4042
4052
|
type: "button",
|
|
4043
4053
|
class: "wm-chip",
|
|
4044
4054
|
style: W({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
|
|
4045
|
-
onClick: (g) => e.$emit("select",
|
|
4046
|
-
}, v(
|
|
4055
|
+
onClick: (g) => e.$emit("select", a)
|
|
4056
|
+
}, v(a.label), 13, Jr))), 128))
|
|
4047
4057
|
])) : b("", !0);
|
|
4048
4058
|
}
|
|
4049
|
-
const
|
|
4059
|
+
const ei = /* @__PURE__ */ E(Xr, [["render", Zr], ["__scopeId", "data-v-47ad8085"]]), ti = {
|
|
4050
4060
|
name: "WmApprovalCard",
|
|
4051
|
-
components: { AIAvatar:
|
|
4061
|
+
components: { AIAvatar: le },
|
|
4052
4062
|
inject: {
|
|
4053
4063
|
// Translator shared by the Messenger shell; French fallback when
|
|
4054
4064
|
// the component is used standalone.
|
|
4055
|
-
t: { default: () =>
|
|
4065
|
+
t: { default: () => P() }
|
|
4056
4066
|
},
|
|
4057
4067
|
props: {
|
|
4058
4068
|
action: { type: String, required: !0 },
|
|
@@ -4088,23 +4098,23 @@ const Zr = /* @__PURE__ */ I(Qr, [["render", Jr], ["__scopeId", "data-v-47ad8085
|
|
|
4088
4098
|
return ((e = this.rejectCallback) == null ? void 0 : e.label) || this.t("approval.reject");
|
|
4089
4099
|
}
|
|
4090
4100
|
}
|
|
4091
|
-
},
|
|
4101
|
+
}, ni = { class: "wm-approval" }, si = { class: "wm-approval__head" }, ri = { class: "wm-approval__icon" }, ii = { class: "wm-approval__main" }, ai = { class: "wm-approval__title" }, oi = {
|
|
4092
4102
|
key: 0,
|
|
4093
4103
|
class: "wm-approval__detail"
|
|
4094
|
-
},
|
|
4095
|
-
function
|
|
4096
|
-
const
|
|
4097
|
-
return c(), u("div",
|
|
4098
|
-
o("div",
|
|
4099
|
-
o("div", si, [
|
|
4100
|
-
z(i, { size: 24 })
|
|
4101
|
-
]),
|
|
4104
|
+
}, li = { class: "wm-approval__actions" };
|
|
4105
|
+
function ci(e, t, n, i, r, s) {
|
|
4106
|
+
const a = I("AIAvatar");
|
|
4107
|
+
return c(), u("div", ni, [
|
|
4108
|
+
o("div", si, [
|
|
4102
4109
|
o("div", ri, [
|
|
4103
|
-
|
|
4104
|
-
|
|
4110
|
+
z(a, { size: 24 })
|
|
4111
|
+
]),
|
|
4112
|
+
o("div", ii, [
|
|
4113
|
+
o("div", ai, v(n.action), 1),
|
|
4114
|
+
n.detail ? (c(), u("div", oi, v(n.detail), 1)) : b("", !0)
|
|
4105
4115
|
])
|
|
4106
4116
|
]),
|
|
4107
|
-
o("div",
|
|
4117
|
+
o("div", li, [
|
|
4108
4118
|
s.rejectId ? (c(), u("button", {
|
|
4109
4119
|
key: 0,
|
|
4110
4120
|
type: "button",
|
|
@@ -4120,9 +4130,9 @@ function li(e, t, n, r, a, s) {
|
|
|
4120
4130
|
])
|
|
4121
4131
|
]);
|
|
4122
4132
|
}
|
|
4123
|
-
const
|
|
4133
|
+
const di = /* @__PURE__ */ E(ti, [["render", ci], ["__scopeId", "data-v-53ddf2b2"]]);
|
|
4124
4134
|
let Me = 0;
|
|
4125
|
-
const
|
|
4135
|
+
const ui = /* @__PURE__ */ new Set([
|
|
4126
4136
|
"text",
|
|
4127
4137
|
"textarea",
|
|
4128
4138
|
"number",
|
|
@@ -4130,13 +4140,13 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4130
4140
|
"select",
|
|
4131
4141
|
"multiselect",
|
|
4132
4142
|
"date"
|
|
4133
|
-
]),
|
|
4143
|
+
]), hi = {
|
|
4134
4144
|
name: "WmFormCard",
|
|
4135
|
-
components: { AIAvatar:
|
|
4145
|
+
components: { AIAvatar: le },
|
|
4136
4146
|
inject: {
|
|
4137
4147
|
// Translator shared by the Messenger shell; French fallback when
|
|
4138
4148
|
// the component is used standalone.
|
|
4139
|
-
t: { default: () =>
|
|
4149
|
+
t: { default: () => P() }
|
|
4140
4150
|
},
|
|
4141
4151
|
props: {
|
|
4142
4152
|
form: { type: Object, required: !0 },
|
|
@@ -4158,7 +4168,7 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4158
4168
|
// douteux.
|
|
4159
4169
|
normalizedFields() {
|
|
4160
4170
|
var t;
|
|
4161
|
-
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !
|
|
4171
|
+
return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !ui.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
|
|
4162
4172
|
}
|
|
4163
4173
|
},
|
|
4164
4174
|
created() {
|
|
@@ -4177,8 +4187,8 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4177
4187
|
this.values = t, this.error = "";
|
|
4178
4188
|
},
|
|
4179
4189
|
toggleMulti(e, t, n) {
|
|
4180
|
-
const
|
|
4181
|
-
n &&
|
|
4190
|
+
const i = Array.isArray(this.values[e]) ? this.values[e].slice() : [], r = i.indexOf(t);
|
|
4191
|
+
n && r === -1 ? i.push(t) : !n && r !== -1 && i.splice(r, 1), this.values = { ...this.values, [e]: i };
|
|
4182
4192
|
},
|
|
4183
4193
|
validate() {
|
|
4184
4194
|
for (const e of this.normalizedFields) {
|
|
@@ -4211,43 +4221,43 @@ const di = /* @__PURE__ */ new Set([
|
|
|
4211
4221
|
}
|
|
4212
4222
|
}
|
|
4213
4223
|
}
|
|
4214
|
-
}, mi = { class: "wm-form" },
|
|
4224
|
+
}, mi = { class: "wm-form" }, fi = { class: "wm-form__head" }, _i = { class: "wm-form__icon" }, pi = { class: "wm-form__main" }, gi = { class: "wm-form__title" }, vi = {
|
|
4215
4225
|
key: 0,
|
|
4216
4226
|
class: "wm-form__detail"
|
|
4217
|
-
},
|
|
4227
|
+
}, yi = ["for"], bi = {
|
|
4218
4228
|
key: 0,
|
|
4219
4229
|
class: "wm-form__req",
|
|
4220
4230
|
"aria-hidden": "true"
|
|
4221
|
-
},
|
|
4231
|
+
}, wi = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], ki = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ci = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ai = ["id", "onUpdate:modelValue", "required", "disabled"], Si = {
|
|
4222
4232
|
key: 4,
|
|
4223
4233
|
class: "wm-form__bool"
|
|
4224
|
-
},
|
|
4234
|
+
}, Mi = ["id", "onUpdate:modelValue", "disabled"], Ti = ["id", "onUpdate:modelValue", "required", "disabled"], xi = {
|
|
4225
4235
|
value: "",
|
|
4226
4236
|
disabled: ""
|
|
4227
|
-
},
|
|
4237
|
+
}, Oi = ["value"], Li = {
|
|
4228
4238
|
key: 6,
|
|
4229
4239
|
class: "wm-form__multi"
|
|
4230
|
-
},
|
|
4240
|
+
}, Ii = ["value", "checked", "disabled", "onChange"], Ei = {
|
|
4231
4241
|
key: 0,
|
|
4232
4242
|
class: "wm-form__err"
|
|
4233
|
-
},
|
|
4243
|
+
}, Bi = ["disabled"], Ri = {
|
|
4234
4244
|
key: 0,
|
|
4235
4245
|
class: "wm-form__spinner",
|
|
4236
4246
|
"aria-hidden": "true"
|
|
4237
|
-
},
|
|
4247
|
+
}, Ni = {
|
|
4238
4248
|
key: 2,
|
|
4239
4249
|
class: "wm-form__doneLbl"
|
|
4240
4250
|
};
|
|
4241
|
-
function
|
|
4242
|
-
const
|
|
4251
|
+
function Fi(e, t, n, i, r, s) {
|
|
4252
|
+
const a = I("AIAvatar");
|
|
4243
4253
|
return c(), u("div", mi, [
|
|
4244
|
-
o("div",
|
|
4245
|
-
o("div", fi, [
|
|
4246
|
-
z(i, { size: 24 })
|
|
4247
|
-
]),
|
|
4254
|
+
o("div", fi, [
|
|
4248
4255
|
o("div", _i, [
|
|
4249
|
-
|
|
4250
|
-
|
|
4256
|
+
z(a, { size: 24 })
|
|
4257
|
+
]),
|
|
4258
|
+
o("div", pi, [
|
|
4259
|
+
o("div", gi, v(n.form.title || s.t("form.title")), 1),
|
|
4260
|
+
n.form.description ? (c(), u("div", vi, v(n.form.description), 1)) : b("", !0)
|
|
4251
4261
|
])
|
|
4252
4262
|
]),
|
|
4253
4263
|
o("form", {
|
|
@@ -4259,86 +4269,86 @@ function Ni(e, t, n, r, a, s) {
|
|
|
4259
4269
|
class: "wm-form__field"
|
|
4260
4270
|
}, [
|
|
4261
4271
|
o("label", {
|
|
4262
|
-
for: `wm-f-${
|
|
4272
|
+
for: `wm-f-${r._uid}-${l.key}`,
|
|
4263
4273
|
class: "wm-form__label"
|
|
4264
4274
|
}, [
|
|
4265
4275
|
pe(v(l.label), 1),
|
|
4266
|
-
l.required ? (c(), u("span",
|
|
4267
|
-
], 8,
|
|
4276
|
+
l.required ? (c(), u("span", bi, "*")) : b("", !0)
|
|
4277
|
+
], 8, yi),
|
|
4268
4278
|
l.type === "text" ? V((c(), u("input", {
|
|
4269
4279
|
key: 0,
|
|
4270
|
-
id: `wm-f-${
|
|
4271
|
-
"onUpdate:modelValue": (g) =>
|
|
4280
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4281
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4272
4282
|
type: "text",
|
|
4273
4283
|
class: "wm-form__input",
|
|
4274
4284
|
placeholder: l.placeholder || "",
|
|
4275
4285
|
required: l.required,
|
|
4276
|
-
disabled: n.readOnly ||
|
|
4277
|
-
}, null, 8,
|
|
4278
|
-
[Z,
|
|
4286
|
+
disabled: n.readOnly || r.busy
|
|
4287
|
+
}, null, 8, wi)), [
|
|
4288
|
+
[Z, r.values[l.key]]
|
|
4279
4289
|
]) : l.type === "textarea" ? V((c(), u("textarea", {
|
|
4280
4290
|
key: 1,
|
|
4281
|
-
id: `wm-f-${
|
|
4282
|
-
"onUpdate:modelValue": (g) =>
|
|
4291
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4292
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4283
4293
|
class: "wm-form__textarea",
|
|
4284
4294
|
rows: "3",
|
|
4285
4295
|
placeholder: l.placeholder || "",
|
|
4286
4296
|
required: l.required,
|
|
4287
|
-
disabled: n.readOnly ||
|
|
4288
|
-
}, null, 8,
|
|
4289
|
-
[Z,
|
|
4297
|
+
disabled: n.readOnly || r.busy
|
|
4298
|
+
}, null, 8, ki)), [
|
|
4299
|
+
[Z, r.values[l.key]]
|
|
4290
4300
|
]) : l.type === "number" ? V((c(), u("input", {
|
|
4291
4301
|
key: 2,
|
|
4292
|
-
id: `wm-f-${
|
|
4293
|
-
"onUpdate:modelValue": (g) =>
|
|
4302
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4303
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4294
4304
|
type: "number",
|
|
4295
4305
|
class: "wm-form__input",
|
|
4296
4306
|
placeholder: l.placeholder || "",
|
|
4297
4307
|
required: l.required,
|
|
4298
|
-
disabled: n.readOnly ||
|
|
4299
|
-
}, null, 8,
|
|
4308
|
+
disabled: n.readOnly || r.busy
|
|
4309
|
+
}, null, 8, Ci)), [
|
|
4300
4310
|
[
|
|
4301
4311
|
Z,
|
|
4302
|
-
|
|
4312
|
+
r.values[l.key],
|
|
4303
4313
|
void 0,
|
|
4304
4314
|
{ number: !0 }
|
|
4305
4315
|
]
|
|
4306
4316
|
]) : l.type === "date" ? V((c(), u("input", {
|
|
4307
4317
|
key: 3,
|
|
4308
|
-
id: `wm-f-${
|
|
4309
|
-
"onUpdate:modelValue": (g) =>
|
|
4318
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4319
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4310
4320
|
type: "date",
|
|
4311
4321
|
class: "wm-form__input",
|
|
4312
4322
|
required: l.required,
|
|
4313
|
-
disabled: n.readOnly ||
|
|
4314
|
-
}, null, 8,
|
|
4315
|
-
[Z,
|
|
4316
|
-
]) : l.type === "boolean" ? (c(), u("label",
|
|
4323
|
+
disabled: n.readOnly || r.busy
|
|
4324
|
+
}, null, 8, Ai)), [
|
|
4325
|
+
[Z, r.values[l.key]]
|
|
4326
|
+
]) : l.type === "boolean" ? (c(), u("label", Si, [
|
|
4317
4327
|
V(o("input", {
|
|
4318
|
-
id: `wm-f-${
|
|
4319
|
-
"onUpdate:modelValue": (g) =>
|
|
4328
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4329
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4320
4330
|
type: "checkbox",
|
|
4321
|
-
disabled: n.readOnly ||
|
|
4322
|
-
}, null, 8,
|
|
4323
|
-
[
|
|
4331
|
+
disabled: n.readOnly || r.busy
|
|
4332
|
+
}, null, 8, Mi), [
|
|
4333
|
+
[$e, r.values[l.key]]
|
|
4324
4334
|
]),
|
|
4325
4335
|
o("span", null, v(l.placeholder || s.t("common.yes")), 1)
|
|
4326
4336
|
])) : l.type === "select" ? V((c(), u("select", {
|
|
4327
4337
|
key: 5,
|
|
4328
|
-
id: `wm-f-${
|
|
4329
|
-
"onUpdate:modelValue": (g) =>
|
|
4338
|
+
id: `wm-f-${r._uid}-${l.key}`,
|
|
4339
|
+
"onUpdate:modelValue": (g) => r.values[l.key] = g,
|
|
4330
4340
|
class: "wm-form__select",
|
|
4331
4341
|
required: l.required,
|
|
4332
|
-
disabled: n.readOnly ||
|
|
4342
|
+
disabled: n.readOnly || r.busy
|
|
4333
4343
|
}, [
|
|
4334
|
-
o("option",
|
|
4344
|
+
o("option", xi, v(l.placeholder || s.t("form.choose")), 1),
|
|
4335
4345
|
(c(!0), u(L, null, j(l.options, (g) => (c(), u("option", {
|
|
4336
4346
|
key: g.value,
|
|
4337
4347
|
value: g.value
|
|
4338
|
-
}, v(g.label), 9,
|
|
4339
|
-
], 8,
|
|
4340
|
-
[
|
|
4341
|
-
]) : l.type === "multiselect" ? (c(), u("div",
|
|
4348
|
+
}, v(g.label), 9, Oi))), 128))
|
|
4349
|
+
], 8, Ti)), [
|
|
4350
|
+
[He, r.values[l.key]]
|
|
4351
|
+
]) : l.type === "multiselect" ? (c(), u("div", Li, [
|
|
4342
4352
|
(c(!0), u(L, null, j(l.options, (g) => (c(), u("label", {
|
|
4343
4353
|
key: g.value,
|
|
4344
4354
|
class: "wm-form__multiItem"
|
|
@@ -4346,37 +4356,37 @@ function Ni(e, t, n, r, a, s) {
|
|
|
4346
4356
|
o("input", {
|
|
4347
4357
|
type: "checkbox",
|
|
4348
4358
|
value: g.value,
|
|
4349
|
-
checked: Array.isArray(
|
|
4350
|
-
disabled: n.readOnly ||
|
|
4359
|
+
checked: Array.isArray(r.values[l.key]) && r.values[l.key].includes(g.value),
|
|
4360
|
+
disabled: n.readOnly || r.busy,
|
|
4351
4361
|
onChange: (C) => s.toggleMulti(
|
|
4352
4362
|
l.key,
|
|
4353
4363
|
g.value,
|
|
4354
4364
|
C.target.checked
|
|
4355
4365
|
)
|
|
4356
|
-
}, null, 40,
|
|
4366
|
+
}, null, 40, Ii),
|
|
4357
4367
|
o("span", null, v(g.label), 1)
|
|
4358
4368
|
]))), 128))
|
|
4359
4369
|
])) : b("", !0)
|
|
4360
4370
|
]))), 128)),
|
|
4361
|
-
|
|
4362
|
-
n.readOnly ? (c(), u("div",
|
|
4371
|
+
r.error ? (c(), u("div", Ei, v(r.error), 1)) : b("", !0),
|
|
4372
|
+
n.readOnly ? (c(), u("div", Ni, v(s.t("form.responseSent")), 1)) : (c(), u("button", {
|
|
4363
4373
|
key: 1,
|
|
4364
4374
|
type: "submit",
|
|
4365
4375
|
class: "wm-form__submit",
|
|
4366
|
-
disabled:
|
|
4376
|
+
disabled: r.busy
|
|
4367
4377
|
}, [
|
|
4368
|
-
|
|
4369
|
-
o("span", null, v(
|
|
4370
|
-
], 8,
|
|
4378
|
+
r.busy ? (c(), u("span", Ri)) : b("", !0),
|
|
4379
|
+
o("span", null, v(r.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
|
|
4380
|
+
], 8, Bi))
|
|
4371
4381
|
], 32)
|
|
4372
4382
|
]);
|
|
4373
4383
|
}
|
|
4374
|
-
const
|
|
4384
|
+
const ji = /* @__PURE__ */ E(hi, [["render", Fi], ["__scopeId", "data-v-75332dad"]]), Pi = {
|
|
4375
4385
|
name: "WmFeedback",
|
|
4376
4386
|
inject: {
|
|
4377
4387
|
// Translator shared by the Messenger shell; French fallback when
|
|
4378
4388
|
// the component is used standalone.
|
|
4379
|
-
t: { default: () =>
|
|
4389
|
+
t: { default: () => P() }
|
|
4380
4390
|
},
|
|
4381
4391
|
props: {
|
|
4382
4392
|
busy: { type: Boolean, default: !1 },
|
|
@@ -4405,13 +4415,13 @@ const Fi = /* @__PURE__ */ I(ui, [["render", Ni], ["__scopeId", "data-v-75332dad
|
|
|
4405
4415
|
!this.sel || this.busy || this.$emit("submit", { rating: this.sel });
|
|
4406
4416
|
}
|
|
4407
4417
|
}
|
|
4408
|
-
}, Di = { class: "wm-fb" },
|
|
4418
|
+
}, Di = { class: "wm-fb" }, Ui = { class: "wm-fb__title" }, $i = { class: "wm-fb__sub" }, Hi = { class: "wm-fb__row" }, zi = ["onClick"], qi = { class: "wm-fb__emoji" }, Vi = { class: "wm-fb__label" }, Wi = ["disabled"], Ki = {
|
|
4409
4419
|
key: 1,
|
|
4410
4420
|
class: "wm-fb__done"
|
|
4411
|
-
},
|
|
4412
|
-
function
|
|
4421
|
+
}, Gi = { class: "wm-fb__doneTitle" }, Yi = { class: "wm-fb__doneSub" };
|
|
4422
|
+
function Qi(e, t, n, i, r, s) {
|
|
4413
4423
|
return c(), u("div", Di, [
|
|
4414
|
-
n.done ? (c(), u("div",
|
|
4424
|
+
n.done ? (c(), u("div", Ki, [
|
|
4415
4425
|
t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
|
|
4416
4426
|
o("svg", {
|
|
4417
4427
|
width: "16",
|
|
@@ -4427,37 +4437,37 @@ function Yi(e, t, n, r, a, s) {
|
|
|
4427
4437
|
o("path", { d: "M20 6L9 17l-5-5" })
|
|
4428
4438
|
])
|
|
4429
4439
|
], -1)),
|
|
4430
|
-
o("div",
|
|
4431
|
-
o("div",
|
|
4440
|
+
o("div", Gi, v(s.t("feedback.doneTitle")), 1),
|
|
4441
|
+
o("div", Yi, v(s.t("feedback.doneSubtitle")), 1)
|
|
4432
4442
|
])) : (c(), u(L, { key: 0 }, [
|
|
4433
|
-
o("div",
|
|
4434
|
-
o("div",
|
|
4435
|
-
o("div",
|
|
4436
|
-
(c(!0), u(L, null, j(s.options, (
|
|
4437
|
-
key:
|
|
4443
|
+
o("div", Ui, v(s.t("feedback.question")), 1),
|
|
4444
|
+
o("div", $i, v(s.t("feedback.subtitle")), 1),
|
|
4445
|
+
o("div", Hi, [
|
|
4446
|
+
(c(!0), u(L, null, j(s.options, (a) => (c(), u("button", {
|
|
4447
|
+
key: a.v,
|
|
4438
4448
|
type: "button",
|
|
4439
|
-
class: x(["wm-fb__opt", { "is-selected":
|
|
4440
|
-
onClick: (l) =>
|
|
4449
|
+
class: x(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
|
|
4450
|
+
onClick: (l) => r.sel = a.v
|
|
4441
4451
|
}, [
|
|
4442
|
-
o("span",
|
|
4443
|
-
o("span",
|
|
4444
|
-
], 10,
|
|
4452
|
+
o("span", qi, v(a.e), 1),
|
|
4453
|
+
o("span", Vi, v(a.l), 1)
|
|
4454
|
+
], 10, zi))), 128))
|
|
4445
4455
|
]),
|
|
4446
4456
|
o("button", {
|
|
4447
4457
|
type: "button",
|
|
4448
4458
|
class: "wm-fb__send",
|
|
4449
|
-
disabled: !
|
|
4450
|
-
onClick: t[0] || (t[0] = (...
|
|
4451
|
-
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9,
|
|
4459
|
+
disabled: !r.sel || n.busy,
|
|
4460
|
+
onClick: t[0] || (t[0] = (...a) => s.onSend && s.onSend(...a))
|
|
4461
|
+
}, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, Wi)
|
|
4452
4462
|
], 64))
|
|
4453
4463
|
]);
|
|
4454
4464
|
}
|
|
4455
|
-
const
|
|
4465
|
+
const Xi = /* @__PURE__ */ E(Pi, [["render", Qi], ["__scopeId", "data-v-9b630564"]]), Ji = {
|
|
4456
4466
|
name: "WmMoreMenu",
|
|
4457
4467
|
inject: {
|
|
4458
4468
|
// Translator shared by the Messenger shell; French fallback when
|
|
4459
4469
|
// the component is used standalone.
|
|
4460
|
-
t: { default: () =>
|
|
4470
|
+
t: { default: () => P() }
|
|
4461
4471
|
},
|
|
4462
4472
|
props: {
|
|
4463
4473
|
canRename: { type: Boolean, default: !0 },
|
|
@@ -4495,29 +4505,29 @@ const Qi = /* @__PURE__ */ I(ji, [["render", Yi], ["__scopeId", "data-v-9b630564
|
|
|
4495
4505
|
this.browserNotifOn = !this.browserNotifOn, this.$emit("browser-notif-toggle", this.browserNotifOn);
|
|
4496
4506
|
}
|
|
4497
4507
|
}
|
|
4498
|
-
},
|
|
4508
|
+
}, Zi = { class: "wm-mm" }, ea = {
|
|
4499
4509
|
class: "wm-mm__pop",
|
|
4500
4510
|
role: "menu"
|
|
4501
|
-
},
|
|
4511
|
+
}, ta = {
|
|
4502
4512
|
key: 0,
|
|
4503
4513
|
class: "wm-mm__section"
|
|
4504
|
-
},
|
|
4514
|
+
}, na = { class: "wm-mm__label" }, sa = { class: "wm-mm__label" }, ra = {
|
|
4505
4515
|
key: 1,
|
|
4506
4516
|
class: "wm-mm__sep"
|
|
4507
|
-
},
|
|
4508
|
-
function
|
|
4509
|
-
return c(), u("div",
|
|
4517
|
+
}, ia = { class: "wm-mm__section" }, aa = { class: "wm-mm__label" }, oa = { class: "wm-mm__label" }, la = { class: "wm-mm__section" }, ca = { class: "wm-mm__label" }, da = { class: "wm-mm__label" };
|
|
4518
|
+
function ua(e, t, n, i, r, s) {
|
|
4519
|
+
return c(), u("div", Zi, [
|
|
4510
4520
|
o("div", {
|
|
4511
4521
|
class: "wm-mm__scrim",
|
|
4512
|
-
onClick: t[0] || (t[0] = (
|
|
4522
|
+
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4513
4523
|
}),
|
|
4514
|
-
o("div",
|
|
4515
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4524
|
+
o("div", ea, [
|
|
4525
|
+
n.canRename || n.canExport ? (c(), u("div", ta, [
|
|
4516
4526
|
n.canRename ? (c(), u("button", {
|
|
4517
4527
|
key: 0,
|
|
4518
4528
|
type: "button",
|
|
4519
4529
|
class: "wm-mm__item",
|
|
4520
|
-
onClick: t[1] || (t[1] = (
|
|
4530
|
+
onClick: t[1] || (t[1] = (a) => s.emit("rename"))
|
|
4521
4531
|
}, [
|
|
4522
4532
|
t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
|
|
4523
4533
|
o("svg", {
|
|
@@ -4535,13 +4545,13 @@ function da(e, t, n, r, a, s) {
|
|
|
4535
4545
|
o("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" })
|
|
4536
4546
|
])
|
|
4537
4547
|
], -1)),
|
|
4538
|
-
o("span",
|
|
4548
|
+
o("span", na, v(s.t("moreMenu.editTitle")), 1)
|
|
4539
4549
|
])) : b("", !0),
|
|
4540
4550
|
n.canExport ? (c(), u("button", {
|
|
4541
4551
|
key: 1,
|
|
4542
4552
|
type: "button",
|
|
4543
4553
|
class: "wm-mm__item",
|
|
4544
|
-
onClick: t[2] || (t[2] = (
|
|
4554
|
+
onClick: t[2] || (t[2] = (a) => s.emit("export"))
|
|
4545
4555
|
}, [
|
|
4546
4556
|
t[8] || (t[8] = o("span", { class: "wm-mm__icon" }, [
|
|
4547
4557
|
o("svg", {
|
|
@@ -4558,16 +4568,16 @@ function da(e, t, n, r, a, s) {
|
|
|
4558
4568
|
o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
|
|
4559
4569
|
])
|
|
4560
4570
|
], -1)),
|
|
4561
|
-
o("span",
|
|
4571
|
+
o("span", sa, v(s.t("moreMenu.exportTranscript")), 1),
|
|
4562
4572
|
t[9] || (t[9] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
|
|
4563
4573
|
])) : b("", !0)
|
|
4564
4574
|
])) : b("", !0),
|
|
4565
|
-
n.canRename || n.canExport ? (c(), u("div",
|
|
4566
|
-
o("div",
|
|
4575
|
+
n.canRename || n.canExport ? (c(), u("div", ra)) : b("", !0),
|
|
4576
|
+
o("div", ia, [
|
|
4567
4577
|
o("button", {
|
|
4568
4578
|
type: "button",
|
|
4569
4579
|
class: "wm-mm__item",
|
|
4570
|
-
onClick: t[3] || (t[3] = (...
|
|
4580
|
+
onClick: t[3] || (t[3] = (...a) => s.toggleSound && s.toggleSound(...a))
|
|
4571
4581
|
}, [
|
|
4572
4582
|
t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
|
|
4573
4583
|
o("svg", {
|
|
@@ -4585,9 +4595,9 @@ function da(e, t, n, r, a, s) {
|
|
|
4585
4595
|
o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
|
|
4586
4596
|
])
|
|
4587
4597
|
], -1)),
|
|
4588
|
-
o("span",
|
|
4598
|
+
o("span", aa, v(s.t("moreMenu.sound")), 1),
|
|
4589
4599
|
o("span", {
|
|
4590
|
-
class: x(["wm-mm__toggle", { "wm-mm__toggle--on":
|
|
4600
|
+
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.soundOn }])
|
|
4591
4601
|
}, [...t[10] || (t[10] = [
|
|
4592
4602
|
o("span", { class: "wm-mm__knob" }, null, -1)
|
|
4593
4603
|
])], 2)
|
|
@@ -4595,7 +4605,7 @@ function da(e, t, n, r, a, s) {
|
|
|
4595
4605
|
o("button", {
|
|
4596
4606
|
type: "button",
|
|
4597
4607
|
class: "wm-mm__item",
|
|
4598
|
-
onClick: t[4] || (t[4] = (...
|
|
4608
|
+
onClick: t[4] || (t[4] = (...a) => s.toggleBrowserNotif && s.toggleBrowserNotif(...a))
|
|
4599
4609
|
}, [
|
|
4600
4610
|
t[13] || (t[13] = o("span", { class: "wm-mm__icon" }, [
|
|
4601
4611
|
o("svg", {
|
|
@@ -4612,21 +4622,21 @@ function da(e, t, n, r, a, s) {
|
|
|
4612
4622
|
o("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" })
|
|
4613
4623
|
])
|
|
4614
4624
|
], -1)),
|
|
4615
|
-
o("span",
|
|
4625
|
+
o("span", oa, v(s.t("moreMenu.browserNotifications")), 1),
|
|
4616
4626
|
o("span", {
|
|
4617
|
-
class: x(["wm-mm__toggle", { "wm-mm__toggle--on":
|
|
4627
|
+
class: x(["wm-mm__toggle", { "wm-mm__toggle--on": r.browserNotifOn }])
|
|
4618
4628
|
}, [...t[12] || (t[12] = [
|
|
4619
4629
|
o("span", { class: "wm-mm__knob" }, null, -1)
|
|
4620
4630
|
])], 2)
|
|
4621
4631
|
])
|
|
4622
4632
|
]),
|
|
4623
4633
|
t[16] || (t[16] = o("div", { class: "wm-mm__sep" }, null, -1)),
|
|
4624
|
-
o("div",
|
|
4634
|
+
o("div", la, [
|
|
4625
4635
|
n.statusUrl ? (c(), u("button", {
|
|
4626
4636
|
key: 0,
|
|
4627
4637
|
type: "button",
|
|
4628
4638
|
class: "wm-mm__item",
|
|
4629
|
-
onClick: t[5] || (t[5] = (
|
|
4639
|
+
onClick: t[5] || (t[5] = (a) => s.emit("status"))
|
|
4630
4640
|
}, [
|
|
4631
4641
|
t[14] || (t[14] = o("span", { class: "wm-mm__icon" }, [
|
|
4632
4642
|
o("svg", {
|
|
@@ -4643,13 +4653,13 @@ function da(e, t, n, r, a, s) {
|
|
|
4643
4653
|
o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
|
|
4644
4654
|
])
|
|
4645
4655
|
], -1)),
|
|
4646
|
-
o("span",
|
|
4656
|
+
o("span", ca, v(s.t("moreMenu.serviceStatus")), 1)
|
|
4647
4657
|
])) : b("", !0),
|
|
4648
4658
|
n.helpUrl ? (c(), u("button", {
|
|
4649
4659
|
key: 1,
|
|
4650
4660
|
type: "button",
|
|
4651
4661
|
class: "wm-mm__item",
|
|
4652
|
-
onClick: t[6] || (t[6] = (
|
|
4662
|
+
onClick: t[6] || (t[6] = (a) => s.emit("help"))
|
|
4653
4663
|
}, [
|
|
4654
4664
|
t[15] || (t[15] = o("span", { class: "wm-mm__icon" }, [
|
|
4655
4665
|
o("svg", {
|
|
@@ -4666,18 +4676,18 @@ function da(e, t, n, r, a, s) {
|
|
|
4666
4676
|
o("path", { d: "M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z" })
|
|
4667
4677
|
])
|
|
4668
4678
|
], -1)),
|
|
4669
|
-
o("span",
|
|
4679
|
+
o("span", da, v(s.t("moreMenu.helpCenter")), 1)
|
|
4670
4680
|
])) : b("", !0)
|
|
4671
4681
|
])
|
|
4672
4682
|
])
|
|
4673
4683
|
]);
|
|
4674
4684
|
}
|
|
4675
|
-
const
|
|
4685
|
+
const ha = /* @__PURE__ */ E(Ji, [["render", ua], ["__scopeId", "data-v-76281e95"]]), ma = {
|
|
4676
4686
|
name: "WmRenameDialog",
|
|
4677
4687
|
inject: {
|
|
4678
4688
|
// Translator shared by the Messenger shell; French fallback when
|
|
4679
4689
|
// the component is used standalone.
|
|
4680
|
-
t: { default: () =>
|
|
4690
|
+
t: { default: () => P() }
|
|
4681
4691
|
},
|
|
4682
4692
|
props: {
|
|
4683
4693
|
// Empty defaults: the resolved fallback comes from the translator
|
|
@@ -4714,25 +4724,25 @@ const ua = /* @__PURE__ */ I(Xi, [["render", da], ["__scopeId", "data-v-76281e95
|
|
|
4714
4724
|
this.canSubmit && this.$emit("submit", this.value.trim());
|
|
4715
4725
|
}
|
|
4716
4726
|
}
|
|
4717
|
-
},
|
|
4727
|
+
}, fa = { class: "wm-dialog" }, _a = {
|
|
4718
4728
|
class: "wm-dialog__card",
|
|
4719
4729
|
role: "dialog",
|
|
4720
4730
|
"aria-modal": "true"
|
|
4721
|
-
},
|
|
4722
|
-
function
|
|
4723
|
-
return c(), u("div",
|
|
4731
|
+
}, pa = { class: "wm-dialog__head" }, ga = { class: "wm-dialog__title" }, va = ["aria-label"], ya = { class: "wm-dialog__body" }, ba = ["placeholder"], wa = { class: "wm-dialog__actions" }, ka = ["disabled"];
|
|
4732
|
+
function Ca(e, t, n, i, r, s) {
|
|
4733
|
+
return c(), u("div", fa, [
|
|
4724
4734
|
o("div", {
|
|
4725
4735
|
class: "wm-dialog__scrim",
|
|
4726
|
-
onClick: t[0] || (t[0] = (
|
|
4736
|
+
onClick: t[0] || (t[0] = (a) => e.$emit("close"))
|
|
4727
4737
|
}),
|
|
4728
|
-
o("div",
|
|
4729
|
-
o("div",
|
|
4730
|
-
o("div",
|
|
4738
|
+
o("div", _a, [
|
|
4739
|
+
o("div", pa, [
|
|
4740
|
+
o("div", ga, v(n.title || s.t("rename.title")), 1),
|
|
4731
4741
|
o("button", {
|
|
4732
4742
|
type: "button",
|
|
4733
4743
|
class: "wm-dialog__close",
|
|
4734
4744
|
"aria-label": s.t("common.close"),
|
|
4735
|
-
onClick: t[1] || (t[1] = (
|
|
4745
|
+
onClick: t[1] || (t[1] = (a) => e.$emit("close"))
|
|
4736
4746
|
}, [...t[7] || (t[7] = [
|
|
4737
4747
|
o("svg", {
|
|
4738
4748
|
width: "12",
|
|
@@ -4747,60 +4757,60 @@ function ka(e, t, n, r, a, s) {
|
|
|
4747
4757
|
}, [
|
|
4748
4758
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
4749
4759
|
], -1)
|
|
4750
|
-
])], 8,
|
|
4760
|
+
])], 8, va)
|
|
4751
4761
|
]),
|
|
4752
|
-
o("div",
|
|
4762
|
+
o("div", ya, [
|
|
4753
4763
|
V(o("input", {
|
|
4754
4764
|
ref: "input",
|
|
4755
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
4765
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => r.value = a),
|
|
4756
4766
|
type: "text",
|
|
4757
4767
|
class: "wm-dialog__input",
|
|
4758
4768
|
placeholder: n.placeholder || s.t("rename.placeholder"),
|
|
4759
4769
|
maxlength: 120,
|
|
4760
4770
|
onKeydown: [
|
|
4761
|
-
t[3] || (t[3] = ue(X((...
|
|
4762
|
-
t[4] || (t[4] = ue(X((
|
|
4771
|
+
t[3] || (t[3] = ue(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
|
|
4772
|
+
t[4] || (t[4] = ue(X((a) => e.$emit("close"), ["prevent"]), ["esc"]))
|
|
4763
4773
|
]
|
|
4764
|
-
}, null, 40,
|
|
4765
|
-
[Z,
|
|
4774
|
+
}, null, 40, ba), [
|
|
4775
|
+
[Z, r.value]
|
|
4766
4776
|
])
|
|
4767
4777
|
]),
|
|
4768
|
-
o("div",
|
|
4778
|
+
o("div", wa, [
|
|
4769
4779
|
o("button", {
|
|
4770
4780
|
type: "button",
|
|
4771
4781
|
class: "wm-dialog__btn",
|
|
4772
|
-
onClick: t[5] || (t[5] = (
|
|
4782
|
+
onClick: t[5] || (t[5] = (a) => e.$emit("close"))
|
|
4773
4783
|
}, v(s.t("common.cancel")), 1),
|
|
4774
4784
|
o("button", {
|
|
4775
4785
|
type: "button",
|
|
4776
4786
|
class: "wm-dialog__btn wm-dialog__btn--primary",
|
|
4777
4787
|
disabled: !s.canSubmit,
|
|
4778
|
-
onClick: t[6] || (t[6] = (...
|
|
4779
|
-
}, v(s.t("common.save")), 9,
|
|
4788
|
+
onClick: t[6] || (t[6] = (...a) => s.onSubmit && s.onSubmit(...a))
|
|
4789
|
+
}, v(s.t("common.save")), 9, ka)
|
|
4780
4790
|
])
|
|
4781
4791
|
])
|
|
4782
4792
|
]);
|
|
4783
4793
|
}
|
|
4784
|
-
const
|
|
4794
|
+
const Aa = /* @__PURE__ */ E(ma, [["render", Ca], ["__scopeId", "data-v-6d5f94a8"]]), Te = "ww-messenger-tokens", Sa = {
|
|
4785
4795
|
name: "Messenger",
|
|
4786
4796
|
components: {
|
|
4787
|
-
Launcher:
|
|
4788
|
-
Header:
|
|
4789
|
-
Onboarding:
|
|
4790
|
-
MessageList:
|
|
4791
|
-
Composer:
|
|
4792
|
-
SuggestionChips:
|
|
4793
|
-
ApprovalCard:
|
|
4794
|
-
FormCard:
|
|
4795
|
-
Feedback:
|
|
4796
|
-
MoreMenu:
|
|
4797
|
-
RenameDialog:
|
|
4797
|
+
Launcher: jt,
|
|
4798
|
+
Header: ln,
|
|
4799
|
+
Onboarding: Hn,
|
|
4800
|
+
MessageList: Lr,
|
|
4801
|
+
Composer: Qr,
|
|
4802
|
+
SuggestionChips: ei,
|
|
4803
|
+
ApprovalCard: di,
|
|
4804
|
+
FormCard: ji,
|
|
4805
|
+
Feedback: Xi,
|
|
4806
|
+
MoreMenu: ha,
|
|
4807
|
+
RenameDialog: Aa
|
|
4798
4808
|
},
|
|
4799
4809
|
mixins: [
|
|
4800
|
-
|
|
4810
|
+
ot,
|
|
4801
4811
|
mt,
|
|
4802
|
-
|
|
4803
|
-
|
|
4812
|
+
ft,
|
|
4813
|
+
pt
|
|
4804
4814
|
],
|
|
4805
4815
|
// Make signAttachment available to deep children (AttachmentPreview)
|
|
4806
4816
|
// without prop drilling. The store may not exist yet at provide-time
|
|
@@ -4822,7 +4832,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4822
4832
|
},
|
|
4823
4833
|
props: {
|
|
4824
4834
|
// Hardcoded server default (overridable for staging/dev).
|
|
4825
|
-
baseUrl: { type: String, default:
|
|
4835
|
+
baseUrl: { type: String, default: Ze },
|
|
4826
4836
|
widgetId: { type: String, default: "" },
|
|
4827
4837
|
userId: { type: String, default: "" },
|
|
4828
4838
|
userHash: { type: String, default: "" },
|
|
@@ -4904,9 +4914,9 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4904
4914
|
// so the choice applies immediately, before the boot round-trip
|
|
4905
4915
|
// that materializes `state.customer` has completed.
|
|
4906
4916
|
customerLanguage() {
|
|
4907
|
-
var n,
|
|
4908
|
-
const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((
|
|
4909
|
-
return t || ((s = (
|
|
4917
|
+
var n, i, r, s;
|
|
4918
|
+
const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((i = e.values) == null ? void 0 : i.language));
|
|
4919
|
+
return t || ((s = (r = this.context) == null ? void 0 : r.customer) == null ? void 0 : s.language) || "";
|
|
4910
4920
|
},
|
|
4911
4921
|
// Resolved UI language, by priority:
|
|
4912
4922
|
// 1. explicit `language` prop (consumer override)
|
|
@@ -4923,7 +4933,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4923
4933
|
// `locale` changes. `t()` below (and the provided closure) delegate
|
|
4924
4934
|
// to it so every string resolves against the current language.
|
|
4925
4935
|
translator() {
|
|
4926
|
-
return
|
|
4936
|
+
return P(this.locale);
|
|
4927
4937
|
},
|
|
4928
4938
|
error() {
|
|
4929
4939
|
var e;
|
|
@@ -4953,28 +4963,28 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4953
4963
|
drawerConversations() {
|
|
4954
4964
|
var n;
|
|
4955
4965
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = this.revealedAt;
|
|
4956
|
-
return this.allConversations.map((
|
|
4966
|
+
return this.allConversations.map((i) => {
|
|
4957
4967
|
var C;
|
|
4958
|
-
const
|
|
4959
|
-
let
|
|
4960
|
-
for (let k =
|
|
4961
|
-
const T =
|
|
4968
|
+
const r = e[i.id] || [], s = J(i.last_read_message_id);
|
|
4969
|
+
let a = 0, l = null;
|
|
4970
|
+
for (let k = r.length - 1; k >= 0; k--) {
|
|
4971
|
+
const T = r[k];
|
|
4962
4972
|
if (!T) continue;
|
|
4963
4973
|
if (((C = T.author) == null ? void 0 : C.type) === "user") break;
|
|
4964
4974
|
const B = J(T.id);
|
|
4965
4975
|
if (B != null) {
|
|
4966
4976
|
if (s != null && B <= s) break;
|
|
4967
|
-
t[T.id] !== 0 && (!l && T.author && (l = T.author),
|
|
4977
|
+
t[T.id] !== 0 && (!l && T.author && (l = T.author), a++);
|
|
4968
4978
|
}
|
|
4969
4979
|
}
|
|
4970
|
-
const g =
|
|
4980
|
+
const g = r.filter(
|
|
4971
4981
|
(k) => !((k == null ? void 0 : k.id) != null && t[k.id] === 0)
|
|
4972
4982
|
);
|
|
4973
4983
|
return {
|
|
4974
|
-
...
|
|
4975
|
-
_preview:
|
|
4976
|
-
_unread:
|
|
4977
|
-
_unreadCount:
|
|
4984
|
+
...i,
|
|
4985
|
+
_preview: st(i, g),
|
|
4986
|
+
_unread: a > 0,
|
|
4987
|
+
_unreadCount: a,
|
|
4978
4988
|
_lastAuthor: l
|
|
4979
4989
|
};
|
|
4980
4990
|
});
|
|
@@ -4996,7 +5006,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
4996
5006
|
preview: n._preview || this.t("onboarding.newMessage"),
|
|
4997
5007
|
unread: !!n._unread,
|
|
4998
5008
|
_ts: Ce(n, e[n.id] || [])
|
|
4999
|
-
})).sort((n,
|
|
5009
|
+
})).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
|
|
5000
5010
|
},
|
|
5001
5011
|
// Unread threads (one entry per conv with unseen agent/human
|
|
5002
5012
|
// activity), freshest first. Each entry carries everything the
|
|
@@ -5005,19 +5015,19 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5005
5015
|
latestUnreads() {
|
|
5006
5016
|
var n;
|
|
5007
5017
|
const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
|
|
5008
|
-
for (const
|
|
5009
|
-
if (!
|
|
5010
|
-
const
|
|
5018
|
+
for (const i of this.drawerConversations) {
|
|
5019
|
+
if (!i._unread) continue;
|
|
5020
|
+
const r = Ce(i, e[i.id] || []), s = i._lastAuthor, a = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (a ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (a ? this.agentAvatarUrl : null);
|
|
5011
5021
|
t.push({
|
|
5012
|
-
convId:
|
|
5013
|
-
preview:
|
|
5014
|
-
ts:
|
|
5015
|
-
count:
|
|
5022
|
+
convId: i.id,
|
|
5023
|
+
preview: i._preview || this.t("notification.youHaveNewMessage"),
|
|
5024
|
+
ts: r,
|
|
5025
|
+
count: i._unreadCount || 1,
|
|
5016
5026
|
senderName: l,
|
|
5017
5027
|
senderAvatarUrl: g
|
|
5018
5028
|
});
|
|
5019
5029
|
}
|
|
5020
|
-
return t.sort((
|
|
5030
|
+
return t.sort((i, r) => i.ts < r.ts ? 1 : i.ts > r.ts ? -1 : 0), t;
|
|
5021
5031
|
},
|
|
5022
5032
|
// Notification cards shown in the closed-launcher stack: the unread
|
|
5023
5033
|
// threads above, minus any the user has dismissed (×) for their
|
|
@@ -5053,7 +5063,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5053
5063
|
var n;
|
|
5054
5064
|
const e = (n = this.widget) == null ? void 0 : n.quick_links;
|
|
5055
5065
|
if (!Array.isArray(e)) return "";
|
|
5056
|
-
const t = e.find((
|
|
5066
|
+
const t = e.find((i) => i.icon === "status" && i.url);
|
|
5057
5067
|
return (t == null ? void 0 : t.url) || "";
|
|
5058
5068
|
},
|
|
5059
5069
|
helpUrl() {
|
|
@@ -5061,7 +5071,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5061
5071
|
const e = (n = this.widget) == null ? void 0 : n.quick_links;
|
|
5062
5072
|
if (!Array.isArray(e)) return "";
|
|
5063
5073
|
const t = e.find(
|
|
5064
|
-
(
|
|
5074
|
+
(i) => (i.icon === "chat" || i.icon === "help") && i.url
|
|
5065
5075
|
);
|
|
5066
5076
|
return (t == null ? void 0 : t.url) || "";
|
|
5067
5077
|
},
|
|
@@ -5098,12 +5108,12 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5098
5108
|
// Last message from a human agent in the current conversation —
|
|
5099
5109
|
// used to surface the human agent's name + avatar in the header.
|
|
5100
5110
|
humanMessageAuthor() {
|
|
5101
|
-
var t, n,
|
|
5111
|
+
var t, n, i;
|
|
5102
5112
|
if (!this.currentConv) return null;
|
|
5103
5113
|
const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
|
|
5104
|
-
for (let
|
|
5105
|
-
if (((
|
|
5106
|
-
return e[
|
|
5114
|
+
for (let r = e.length - 1; r >= 0; r--)
|
|
5115
|
+
if (((i = (n = e[r]) == null ? void 0 : n.author) == null ? void 0 : i.type) === "agent_human")
|
|
5116
|
+
return e[r].author;
|
|
5107
5117
|
return null;
|
|
5108
5118
|
},
|
|
5109
5119
|
humanAgentName() {
|
|
@@ -5135,12 +5145,17 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5135
5145
|
}) : this.isWaitingHuman ? this.t("composer.agentTakingOver") : this.t("composer.placeholder");
|
|
5136
5146
|
},
|
|
5137
5147
|
displayedMessages() {
|
|
5148
|
+
var n, i;
|
|
5138
5149
|
const e = this.currentConv;
|
|
5139
5150
|
if (!e) return [];
|
|
5151
|
+
if (!e._draft) {
|
|
5152
|
+
const r = (i = (n = this.s) == null ? void 0 : n.paginationByConv) == null ? void 0 : i[e.id];
|
|
5153
|
+
if (!(r != null && r.loaded)) return [];
|
|
5154
|
+
}
|
|
5140
5155
|
const t = this.revealedAt;
|
|
5141
|
-
return (this.s.messagesByConv[e.id] || []).filter((
|
|
5142
|
-
var
|
|
5143
|
-
return (
|
|
5156
|
+
return (this.s.messagesByConv[e.id] || []).filter((r) => {
|
|
5157
|
+
var s, a, l, g, C;
|
|
5158
|
+
return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending" || ae(r) && !(t[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((a = r == null ? void 0 : r.payload) == null ? void 0 : a.type) === "system" || Array.isArray((l = r == null ? void 0 : r.payload) == null ? void 0 : l.attachments) && r.payload.attachments.length || (g = r == null ? void 0 : r.metadata) != null && g.artifact || (C = r == null ? void 0 : r.metadata) != null && C.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
|
|
5144
5159
|
});
|
|
5145
5160
|
},
|
|
5146
5161
|
// True whenever we should show the "typing" indicator at the bottom
|
|
@@ -5148,18 +5163,18 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5148
5163
|
// or more agent messages are queued and waiting for their reveal
|
|
5149
5164
|
// slot to fire.
|
|
5150
5165
|
streamingActive() {
|
|
5151
|
-
var n,
|
|
5166
|
+
var n, i, r;
|
|
5152
5167
|
const e = this.currentConv;
|
|
5153
|
-
return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((
|
|
5154
|
-
(s) =>
|
|
5168
|
+
return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : r[e.id]) || []).some(
|
|
5169
|
+
(s) => ae(s) && !(this.revealedAt[s.id] > 0)
|
|
5155
5170
|
) : !1;
|
|
5156
5171
|
},
|
|
5157
5172
|
// Internal: the raw persisted list for the current conversation. We
|
|
5158
5173
|
// watch this to detect new agent messages that need to be paced.
|
|
5159
5174
|
currentConvMessages() {
|
|
5160
|
-
var t, n,
|
|
5175
|
+
var t, n, i;
|
|
5161
5176
|
const e = (t = this.currentConv) == null ? void 0 : t.id;
|
|
5162
|
-
return e ? ((
|
|
5177
|
+
return e ? ((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e]) || [] : [];
|
|
5163
5178
|
},
|
|
5164
5179
|
pendingApproval() {
|
|
5165
5180
|
return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
|
|
@@ -5176,11 +5191,11 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5176
5191
|
return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || this.t("action.title");
|
|
5177
5192
|
},
|
|
5178
5193
|
approvalDetail() {
|
|
5179
|
-
var
|
|
5180
|
-
const e = (s = (
|
|
5194
|
+
var i, r, s, a, l, g;
|
|
5195
|
+
const e = (s = (r = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
|
|
5181
5196
|
if (typeof e == "string" && e.trim())
|
|
5182
5197
|
return e.trim();
|
|
5183
|
-
const t = (g = (l = (
|
|
5198
|
+
const t = (g = (l = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
|
|
5184
5199
|
if (!t || typeof t != "object") return "";
|
|
5185
5200
|
const n = Object.entries(t);
|
|
5186
5201
|
return n.length ? n.slice(0, 2).map(([C, k]) => `${C}: ${k}`).join(" · ") : "";
|
|
@@ -5215,18 +5230,18 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5215
5230
|
return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
|
|
5216
5231
|
},
|
|
5217
5232
|
dateLabel() {
|
|
5218
|
-
var n,
|
|
5233
|
+
var n, i, r;
|
|
5219
5234
|
const e = this.currentConv;
|
|
5220
5235
|
let t = /* @__PURE__ */ new Date();
|
|
5221
5236
|
if (e) {
|
|
5222
|
-
const
|
|
5223
|
-
if (
|
|
5224
|
-
const l = new Date(
|
|
5237
|
+
const a = ((r = (((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : r.created_at) || e.created_at;
|
|
5238
|
+
if (a) {
|
|
5239
|
+
const l = new Date(a);
|
|
5225
5240
|
Number.isNaN(l.getTime()) || (t = l);
|
|
5226
5241
|
}
|
|
5227
5242
|
}
|
|
5228
5243
|
return this.t("messageList.today", {
|
|
5229
|
-
time: Le(t,
|
|
5244
|
+
time: Le(t, oe(this.locale))
|
|
5230
5245
|
});
|
|
5231
5246
|
},
|
|
5232
5247
|
// Pagination state for the active conversation. Drives the
|
|
@@ -5234,8 +5249,8 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5234
5249
|
// history available, nothing loading) so the loader stays inert
|
|
5235
5250
|
// until `openConversation` has populated the entry.
|
|
5236
5251
|
paginationState() {
|
|
5237
|
-
var n,
|
|
5238
|
-
const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (
|
|
5252
|
+
var n, i, r;
|
|
5253
|
+
const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (r = (i = this.s) == null ? void 0 : i.paginationByConv) == null ? void 0 : r[e] : null;
|
|
5239
5254
|
return {
|
|
5240
5255
|
loading: !!(t != null && t.loading),
|
|
5241
5256
|
hasMore: !!(t != null && t.nextCursor)
|
|
@@ -5250,13 +5265,13 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5250
5265
|
// ts comparison in `launcherPeeks`.
|
|
5251
5266
|
latestUnreads: {
|
|
5252
5267
|
handler(e) {
|
|
5253
|
-
const t = new Set(e.map((
|
|
5254
|
-
if (!
|
|
5255
|
-
const
|
|
5268
|
+
const t = new Set(e.map((a) => a.convId)), n = this.dismissedPeeks || {}, i = Object.keys(n);
|
|
5269
|
+
if (!i.length) return;
|
|
5270
|
+
const r = {};
|
|
5256
5271
|
let s = !1;
|
|
5257
|
-
for (const
|
|
5258
|
-
t.has(
|
|
5259
|
-
s && (this.dismissedPeeks =
|
|
5272
|
+
for (const a of i)
|
|
5273
|
+
t.has(a) ? r[a] = n[a] : s = !0;
|
|
5274
|
+
s && (this.dismissedPeeks = r);
|
|
5260
5275
|
},
|
|
5261
5276
|
deep: !0
|
|
5262
5277
|
},
|
|
@@ -5333,7 +5348,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5333
5348
|
async mounted() {
|
|
5334
5349
|
if (typeof document < "u" && !document.getElementById(Te)) {
|
|
5335
5350
|
const e = document.createElement("style");
|
|
5336
|
-
e.id = Te, e.textContent =
|
|
5351
|
+
e.id = Te, e.textContent = Je, document.head.appendChild(e);
|
|
5337
5352
|
}
|
|
5338
5353
|
await this.boot(), this.isEmbedded && this.store && await this.open();
|
|
5339
5354
|
},
|
|
@@ -5356,13 +5371,13 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5356
5371
|
}
|
|
5357
5372
|
try {
|
|
5358
5373
|
this.transport = ye(
|
|
5359
|
-
|
|
5374
|
+
Ke({
|
|
5360
5375
|
baseUrl: this.baseUrl,
|
|
5361
5376
|
widgetId: this.widgetId,
|
|
5362
5377
|
userId: this.userId,
|
|
5363
5378
|
userHash: this.userHash
|
|
5364
5379
|
})
|
|
5365
|
-
), this.store = ye(
|
|
5380
|
+
), this.store = ye(Xe(this.transport)), this.hydrateNotifPref(), await this.store.start(), this.setupLiveReveal();
|
|
5366
5381
|
const t = (e = this.context) == null ? void 0 : e.customer;
|
|
5367
5382
|
t && typeof t == "object" && await this.store.applyCustomer(t);
|
|
5368
5383
|
} catch (t) {
|
|
@@ -5387,12 +5402,12 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5387
5402
|
return;
|
|
5388
5403
|
}
|
|
5389
5404
|
this.floatRO = new ResizeObserver((n) => {
|
|
5390
|
-
const
|
|
5391
|
-
if (!
|
|
5392
|
-
const
|
|
5393
|
-
|
|
5394
|
-
var s,
|
|
5395
|
-
(
|
|
5405
|
+
const i = n[0];
|
|
5406
|
+
if (!i) return;
|
|
5407
|
+
const r = Math.ceil(i.contentRect.height + 8);
|
|
5408
|
+
r !== this.floatHeight && (this.floatHeight = r, this.$nextTick(() => {
|
|
5409
|
+
var s, a;
|
|
5410
|
+
(a = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || a.call(s);
|
|
5396
5411
|
}));
|
|
5397
5412
|
}), this.floatRO.observe(t);
|
|
5398
5413
|
}
|
|
@@ -5426,9 +5441,9 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5426
5441
|
// Opening straight from a notification card: land on that card's
|
|
5427
5442
|
// thread rather than whatever was last active.
|
|
5428
5443
|
async openFromPeek(e) {
|
|
5429
|
-
var n,
|
|
5444
|
+
var n, i;
|
|
5430
5445
|
const t = e || ((n = this.latestUnreads[0]) == null ? void 0 : n.convId);
|
|
5431
|
-
t && t !== ((
|
|
5446
|
+
t && t !== ((i = this.currentConv) == null ? void 0 : i.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1), await this.open();
|
|
5432
5447
|
},
|
|
5433
5448
|
// Stamp the dismissed batch ts for a single conv so its card
|
|
5434
5449
|
// disappears from the stack until a fresher message arrives.
|
|
@@ -5502,7 +5517,7 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5502
5517
|
this.openRenameDialog();
|
|
5503
5518
|
break;
|
|
5504
5519
|
case "export":
|
|
5505
|
-
|
|
5520
|
+
at(
|
|
5506
5521
|
this.currentConv,
|
|
5507
5522
|
this.currentConv ? (n = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : n[this.currentConv.id] : [],
|
|
5508
5523
|
this.translator,
|
|
@@ -5536,8 +5551,8 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5536
5551
|
if (!(!n || n === t.name))
|
|
5537
5552
|
try {
|
|
5538
5553
|
await this.store.patchConversation(t.id, { name: n });
|
|
5539
|
-
} catch (
|
|
5540
|
-
console.error("[ww-messenger] rename failed",
|
|
5554
|
+
} catch (i) {
|
|
5555
|
+
console.error("[ww-messenger] rename failed", i);
|
|
5541
5556
|
}
|
|
5542
5557
|
},
|
|
5543
5558
|
// ── Send / suggestion / form / attach / feedback ────────────────
|
|
@@ -5545,9 +5560,9 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5545
5560
|
let t = this.currentConv;
|
|
5546
5561
|
if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
|
|
5547
5562
|
return;
|
|
5548
|
-
const n = t.id,
|
|
5563
|
+
const n = t.id, i = this.pendingAttachments.slice();
|
|
5549
5564
|
this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "", await this.store.send(n, e, {
|
|
5550
|
-
attachments:
|
|
5565
|
+
attachments: i.length ? i : void 0
|
|
5551
5566
|
});
|
|
5552
5567
|
},
|
|
5553
5568
|
async onSuggestion(e) {
|
|
@@ -5566,12 +5581,12 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5566
5581
|
async onFormSubmit({ values: e }) {
|
|
5567
5582
|
const t = this.pendingForm;
|
|
5568
5583
|
if (!(t != null && t.form)) return;
|
|
5569
|
-
const n =
|
|
5584
|
+
const n = tt(t.form, e, this.translator);
|
|
5570
5585
|
if (!n) return;
|
|
5571
|
-
let
|
|
5572
|
-
|
|
5586
|
+
let i = this.currentConv;
|
|
5587
|
+
i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, n, {
|
|
5573
5588
|
metadata: {
|
|
5574
|
-
artifact:
|
|
5589
|
+
artifact: nt(
|
|
5575
5590
|
t.form,
|
|
5576
5591
|
e,
|
|
5577
5592
|
this.translator
|
|
@@ -5622,47 +5637,47 @@ const Ca = /* @__PURE__ */ I(ma, [["render", ka], ["__scopeId", "data-v-6d5f94a8
|
|
|
5622
5637
|
}
|
|
5623
5638
|
}
|
|
5624
5639
|
}
|
|
5625
|
-
},
|
|
5640
|
+
}, Ma = {
|
|
5626
5641
|
key: 0,
|
|
5627
5642
|
class: "wm-loading",
|
|
5628
5643
|
"aria-busy": "true",
|
|
5629
5644
|
"aria-live": "polite"
|
|
5630
|
-
},
|
|
5645
|
+
}, Ta = ["aria-label"], xa = {
|
|
5631
5646
|
key: 0,
|
|
5632
5647
|
class: "wm-state"
|
|
5633
|
-
},
|
|
5648
|
+
}, Oa = { class: "wm-state__err" }, La = { class: "wm-state__errTitle" }, Ia = { class: "wm-state__errSub" }, Ea = { class: "wm-bottom" }, Ba = {
|
|
5634
5649
|
key: 0,
|
|
5635
5650
|
ref: "floatEl",
|
|
5636
5651
|
class: "wm-float"
|
|
5637
|
-
},
|
|
5652
|
+
}, Ra = {
|
|
5638
5653
|
key: 1,
|
|
5639
5654
|
class: "wm-actionWait",
|
|
5640
5655
|
role: "status",
|
|
5641
5656
|
"aria-live": "polite"
|
|
5642
|
-
},
|
|
5657
|
+
}, Na = { class: "wm-actionWait__lbl" }, Fa = {
|
|
5643
5658
|
key: 2,
|
|
5644
5659
|
class: "wm-attached"
|
|
5645
|
-
},
|
|
5646
|
-
function
|
|
5647
|
-
const
|
|
5660
|
+
}, ja = ["aria-label", "onClick"];
|
|
5661
|
+
function Pa(e, t, n, i, r, s) {
|
|
5662
|
+
const a = I("Launcher"), l = I("Header"), g = I("Onboarding"), C = I("MessageList"), k = I("ApprovalCard"), T = I("FormCard"), B = I("Feedback"), A = I("SuggestionChips"), H = I("Composer"), M = I("MoreMenu"), D = I("RenameDialog");
|
|
5648
5663
|
return c(), u("div", {
|
|
5649
5664
|
class: x(["wm-root", `wm-root--${n.displayMode}`])
|
|
5650
5665
|
}, [
|
|
5651
|
-
!
|
|
5666
|
+
!r.isOpen && !s.isEmbedded ? (c(), R(a, {
|
|
5652
5667
|
key: 0,
|
|
5653
5668
|
"unread-count": s.unreadCount,
|
|
5654
5669
|
peeks: s.launcherPeeks,
|
|
5655
5670
|
onOpen: s.openFromPeek,
|
|
5656
5671
|
onDismiss: s.dismissPeek
|
|
5657
5672
|
}, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss"])) : b("", !0),
|
|
5658
|
-
|
|
5673
|
+
r.isOpen || s.isEmbedded ? (c(), u("section", {
|
|
5659
5674
|
key: 1,
|
|
5660
5675
|
class: x(["wm-panel", `wm-panel--${n.displayMode}`]),
|
|
5661
|
-
style: W(
|
|
5676
|
+
style: W(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
|
|
5662
5677
|
role: "dialog",
|
|
5663
5678
|
"aria-label": "Messenger"
|
|
5664
5679
|
}, [
|
|
5665
|
-
!s.ready && !s.error ? (c(), u("div",
|
|
5680
|
+
!s.ready && !s.error ? (c(), u("div", Ma, [
|
|
5666
5681
|
s.isEmbedded ? b("", !0) : (c(), u("button", {
|
|
5667
5682
|
key: 0,
|
|
5668
5683
|
type: "button",
|
|
@@ -5683,7 +5698,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5683
5698
|
}, [
|
|
5684
5699
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5685
5700
|
], -1)
|
|
5686
|
-
])], 8,
|
|
5701
|
+
])], 8, Ta)),
|
|
5687
5702
|
t[6] || (t[6] = o("div", {
|
|
5688
5703
|
class: "wm-loading__spinner",
|
|
5689
5704
|
"aria-hidden": "true"
|
|
@@ -5696,13 +5711,13 @@ function ja(e, t, n, r, a, s) {
|
|
|
5696
5711
|
"show-identity": !!s.currentConv,
|
|
5697
5712
|
"show-back": s.canBack,
|
|
5698
5713
|
"show-close": !s.isEmbedded,
|
|
5699
|
-
"more-active":
|
|
5714
|
+
"more-active": r.moreOpen,
|
|
5700
5715
|
onBack: s.goHome,
|
|
5701
5716
|
onMore: s.toggleMore,
|
|
5702
5717
|
onClose: s.close
|
|
5703
5718
|
}, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
|
|
5704
|
-
s.error ? (c(), u("div",
|
|
5705
|
-
o("div",
|
|
5719
|
+
s.error ? (c(), u("div", xa, [
|
|
5720
|
+
o("div", Oa, [
|
|
5706
5721
|
t[7] || (t[7] = o("div", { class: "wm-state__errIcon" }, [
|
|
5707
5722
|
o("svg", {
|
|
5708
5723
|
width: "14",
|
|
@@ -5719,8 +5734,8 @@ function ja(e, t, n, r, a, s) {
|
|
|
5719
5734
|
])
|
|
5720
5735
|
], -1)),
|
|
5721
5736
|
o("div", null, [
|
|
5722
|
-
o("div",
|
|
5723
|
-
o("div",
|
|
5737
|
+
o("div", La, v(s.t("error.connectionFailed")), 1),
|
|
5738
|
+
o("div", Ia, v(s.error), 1)
|
|
5724
5739
|
])
|
|
5725
5740
|
])
|
|
5726
5741
|
])) : s.currentConv ? (c(), u(L, { key: 2 }, [
|
|
@@ -5737,7 +5752,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5737
5752
|
onLoadMore: s.onLoadMore
|
|
5738
5753
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "onLoadMore"]),
|
|
5739
5754
|
o("div", Ea, [
|
|
5740
|
-
s.floatVisible ? (c(), u("div",
|
|
5755
|
+
s.floatVisible ? (c(), u("div", Ba, [
|
|
5741
5756
|
s.approvalReady ? (c(), R(k, {
|
|
5742
5757
|
key: 0,
|
|
5743
5758
|
action: s.approvalTitle,
|
|
@@ -5750,8 +5765,8 @@ function ja(e, t, n, r, a, s) {
|
|
|
5750
5765
|
onSubmit: s.onFormSubmit
|
|
5751
5766
|
}, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (c(), R(B, {
|
|
5752
5767
|
key: 2,
|
|
5753
|
-
busy:
|
|
5754
|
-
done:
|
|
5768
|
+
busy: r.feedbackBusy,
|
|
5769
|
+
done: r.feedbackDone,
|
|
5755
5770
|
onSubmit: s.onFeedback
|
|
5756
5771
|
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), R(A, {
|
|
5757
5772
|
key: 3,
|
|
@@ -5759,19 +5774,19 @@ function ja(e, t, n, r, a, s) {
|
|
|
5759
5774
|
onSelect: s.onSuggestion
|
|
5760
5775
|
}, null, 8, ["items", "onSelect"]))
|
|
5761
5776
|
], 512)) : b("", !0),
|
|
5762
|
-
s.actionInFlight ? (c(), u("div",
|
|
5777
|
+
s.actionInFlight ? (c(), u("div", Ra, [
|
|
5763
5778
|
t[8] || (t[8] = o("span", {
|
|
5764
5779
|
class: "wm-actionWait__spinner",
|
|
5765
5780
|
"aria-hidden": "true"
|
|
5766
5781
|
}, null, -1)),
|
|
5767
|
-
o("span",
|
|
5782
|
+
o("span", Na, v(s.t("action.inProgress", {
|
|
5768
5783
|
name: s.actionInFlightName
|
|
5769
5784
|
})), 1)
|
|
5770
5785
|
])) : (c(), R(H, {
|
|
5771
5786
|
key: 2,
|
|
5772
5787
|
ref: "composer",
|
|
5773
|
-
modelValue:
|
|
5774
|
-
"onUpdate:modelValue": t[1] || (t[1] = (N) =>
|
|
5788
|
+
modelValue: r.draft,
|
|
5789
|
+
"onUpdate:modelValue": t[1] || (t[1] = (N) => r.draft = N),
|
|
5775
5790
|
placeholder: s.composerPlaceholder,
|
|
5776
5791
|
disabled: !!s.pendingApproval,
|
|
5777
5792
|
"attach-label": s.t("composer.attachFile"),
|
|
@@ -5779,7 +5794,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5779
5794
|
onAttach: s.onAttach
|
|
5780
5795
|
}, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "onSend", "onAttach"]))
|
|
5781
5796
|
]),
|
|
5782
|
-
|
|
5797
|
+
r.moreOpen ? (c(), R(M, {
|
|
5783
5798
|
key: 0,
|
|
5784
5799
|
"can-rename": !!s.currentConv && !s.currentConv._draft,
|
|
5785
5800
|
"can-export": !!s.currentConv && !s.currentConv._draft,
|
|
@@ -5787,20 +5802,20 @@ function ja(e, t, n, r, a, s) {
|
|
|
5787
5802
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
5788
5803
|
"status-url": s.statusUrl,
|
|
5789
5804
|
"help-url": s.helpUrl,
|
|
5790
|
-
onClose: t[2] || (t[2] = (N) =>
|
|
5805
|
+
onClose: t[2] || (t[2] = (N) => r.moreOpen = !1),
|
|
5791
5806
|
onSoundToggle: e.onSoundToggle,
|
|
5792
5807
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5793
5808
|
onAction: s.onMoreAction
|
|
5794
5809
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : b("", !0),
|
|
5795
|
-
|
|
5810
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), R(D, {
|
|
5796
5811
|
key: 1,
|
|
5797
5812
|
"initial-value": s.currentConv.name || "",
|
|
5798
5813
|
title: s.t("rename.dialogTitle"),
|
|
5799
|
-
onClose: t[3] || (t[3] = (N) =>
|
|
5814
|
+
onClose: t[3] || (t[3] = (N) => r.renameDialogOpen = !1),
|
|
5800
5815
|
onSubmit: s.onRenameSubmit
|
|
5801
5816
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0),
|
|
5802
|
-
|
|
5803
|
-
(c(!0), u(L, null, j(
|
|
5817
|
+
r.pendingAttachments.length ? (c(), u("div", Fa, [
|
|
5818
|
+
(c(!0), u(L, null, j(r.pendingAttachments, (N, $) => (c(), u("div", {
|
|
5804
5819
|
key: $,
|
|
5805
5820
|
class: "wm-attached__chip"
|
|
5806
5821
|
}, [
|
|
@@ -5821,7 +5836,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5821
5836
|
o("button", {
|
|
5822
5837
|
type: "button",
|
|
5823
5838
|
"aria-label": s.t("attachment.remove"),
|
|
5824
|
-
onClick: (K) =>
|
|
5839
|
+
onClick: (K) => r.pendingAttachments.splice($, 1)
|
|
5825
5840
|
}, [...t[9] || (t[9] = [
|
|
5826
5841
|
o("svg", {
|
|
5827
5842
|
width: "10",
|
|
@@ -5836,7 +5851,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5836
5851
|
}, [
|
|
5837
5852
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
5838
5853
|
], -1)
|
|
5839
|
-
])], 8,
|
|
5854
|
+
])], 8, ja)
|
|
5840
5855
|
]))), 128))
|
|
5841
5856
|
])) : b("", !0)
|
|
5842
5857
|
], 64)) : (c(), R(g, {
|
|
@@ -5845,12 +5860,12 @@ function ja(e, t, n, r, a, s) {
|
|
|
5845
5860
|
"agent-name": s.agentName,
|
|
5846
5861
|
"quick-links": s.quickLinks,
|
|
5847
5862
|
"open-threads": s.openThreads,
|
|
5848
|
-
busy:
|
|
5863
|
+
busy: r.busy,
|
|
5849
5864
|
onStart: s.startConv,
|
|
5850
5865
|
onSelect: s.onQuickLink,
|
|
5851
5866
|
onResume: s.onDrawerPick
|
|
5852
5867
|
}, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
5853
|
-
|
|
5868
|
+
r.moreOpen && !s.currentConv ? (c(), R(M, {
|
|
5854
5869
|
key: 3,
|
|
5855
5870
|
"can-rename": !1,
|
|
5856
5871
|
"can-export": !1,
|
|
@@ -5858,7 +5873,7 @@ function ja(e, t, n, r, a, s) {
|
|
|
5858
5873
|
"browser-notif-enabled": e.browserNotifEnabled,
|
|
5859
5874
|
"status-url": s.statusUrl,
|
|
5860
5875
|
"help-url": s.helpUrl,
|
|
5861
|
-
onClose: t[4] || (t[4] = (N) =>
|
|
5876
|
+
onClose: t[4] || (t[4] = (N) => r.moreOpen = !1),
|
|
5862
5877
|
onSoundToggle: e.onSoundToggle,
|
|
5863
5878
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
5864
5879
|
onAction: s.onMoreAction
|
|
@@ -5867,53 +5882,54 @@ function ja(e, t, n, r, a, s) {
|
|
|
5867
5882
|
], 6)) : b("", !0)
|
|
5868
5883
|
], 2);
|
|
5869
5884
|
}
|
|
5870
|
-
const
|
|
5885
|
+
const $a = /* @__PURE__ */ E(Sa, [["render", Pa], ["__scopeId", "data-v-d9dce1ad"]]), Ha = "0.4.1";
|
|
5871
5886
|
export {
|
|
5872
|
-
|
|
5887
|
+
le as AIAvatar,
|
|
5873
5888
|
fe as AVATAR_COLORS,
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5889
|
+
es as ActionResult,
|
|
5890
|
+
di as ApprovalCard,
|
|
5891
|
+
cs as ArtifactFormResponse,
|
|
5892
|
+
ks as ArtifactInfoCard,
|
|
5893
|
+
$s as ArtifactRenderer,
|
|
5894
|
+
js as ArtifactTicket,
|
|
5895
|
+
Zs as AttachmentPreview,
|
|
5896
|
+
sr as Bubble,
|
|
5897
|
+
Qr as Composer,
|
|
5898
|
+
Ze as DEFAULT_BASE_URL,
|
|
5899
|
+
ie as DEFAULT_LANGUAGE,
|
|
5900
|
+
Xi as Feedback,
|
|
5901
|
+
ji as FormCard,
|
|
5902
|
+
ln as Header,
|
|
5903
|
+
Ee as HumanAvatar,
|
|
5904
|
+
jt as Launcher,
|
|
5890
5905
|
ve as MEDIA_RECORDER_SUPPORTED,
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5906
|
+
Lr as MessageList,
|
|
5907
|
+
$a as Messenger,
|
|
5908
|
+
ha as MoreMenu,
|
|
5909
|
+
Hn as Onboarding,
|
|
5910
|
+
he as SCREEN_CAPTURE_SUPPORTED,
|
|
5911
|
+
et as SUPPORTED_LANGUAGES,
|
|
5912
|
+
ei as SuggestionChips,
|
|
5913
|
+
Gt as TeamAvatars,
|
|
5914
|
+
or as Typing,
|
|
5915
|
+
Ha as VERSION,
|
|
5901
5916
|
xe as avatarColor,
|
|
5902
5917
|
Oe as avatarInitials,
|
|
5903
5918
|
Er as captureScreenshotFile,
|
|
5904
5919
|
U as colors,
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5920
|
+
Xe as createStore,
|
|
5921
|
+
P as createTranslator,
|
|
5922
|
+
Ke as createTransport,
|
|
5923
|
+
oe as dateLocale,
|
|
5924
|
+
$a as default,
|
|
5910
5925
|
Le as formatTime,
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5926
|
+
Ua as guessAttachmentKind,
|
|
5927
|
+
Ir as pickRecorderMime,
|
|
5928
|
+
dn as renderInlineMarkdown,
|
|
5929
|
+
un as renderMarkdown,
|
|
5914
5930
|
ge as resolveLanguage,
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5931
|
+
Rr as startScreenRecording,
|
|
5932
|
+
Je as tokensCss,
|
|
5933
|
+
Qe as uuid,
|
|
5934
|
+
Qe as v4
|
|
5919
5935
|
};
|