@_solaris/messenger-widget 0.3.1 → 0.3.3

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as g, normalizeStyle as G, normalizeClass as B, Fragment as T, renderList as D, resolveComponent as I, createBlock as $, createTextVNode as de, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as J, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as he, markRaw as fe } from "vue";
1
+ import { reactive as Se, openBlock as l, createElementBlock as c, createVNode as K, Transition as xe, withCtx as Te, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as G, normalizeClass as E, Fragment as M, renderList as N, resolveComponent as B, createBlock as L, createTextVNode as te, resolveDynamicComponent as Me, renderSlot as Oe, withDirectives as q, vModelText as J, vModelCheckbox as Ie, vModelSelect as Be, createStaticVNode as ue, markRaw as me } from "vue";
2
2
  const Ee = [
3
3
  "connected",
4
4
  "message",
@@ -6,10 +6,10 @@ const Ee = [
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], _e = "/client", $e = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
9
+ ], fe = "/client", $e = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
10
10
  function Fe(t) {
11
11
  const e = {
12
- baseUrl: De(t.baseUrl || ""),
12
+ baseUrl: Ne(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
14
14
  userId: t.userId || "",
15
15
  userHash: t.userHash || "",
@@ -34,18 +34,18 @@ function Fe(t) {
34
34
  function n(h, f) {
35
35
  return e.listeners.has(h) || e.listeners.set(h, /* @__PURE__ */ new Set()), e.listeners.get(h).add(f), () => e.listeners.get(h).delete(f);
36
36
  }
37
- function a(h, f) {
37
+ function o(h, f) {
38
38
  const p = e.listeners.get(h);
39
- p && p.forEach((C) => {
39
+ p && p.forEach((k) => {
40
40
  try {
41
- C(f);
42
- } catch (O) {
43
- console.error("[transport] listener", h, O);
41
+ k(f);
42
+ } catch (T) {
43
+ console.error("[transport] listener", h, T);
44
44
  }
45
45
  });
46
46
  }
47
47
  function r(h) {
48
- e.connection !== h && (e.connection = h, a("connection", h));
48
+ e.connection !== h && (e.connection = h, o("connection", h));
49
49
  }
50
50
  function s() {
51
51
  return {
@@ -54,19 +54,19 @@ function Fe(t) {
54
54
  "X-Widget-Id": e.widgetId
55
55
  };
56
56
  }
57
- async function o(h, f, p) {
58
- const C = await fetch(`${e.baseUrl}${_e}${f}`, {
57
+ async function a(h, f, p) {
58
+ const k = await fetch(`${e.baseUrl}${fe}${f}`, {
59
59
  method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
61
  body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
- if (!C.ok) {
64
- const O = await d(C), M = new Error(
65
- `HTTP ${C.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || C.statusText}`
63
+ if (!k.ok) {
64
+ const T = await d(k), O = new Error(
65
+ `HTTP ${k.status} ${h} ${f} :: ${(T == null ? void 0 : T.error) || k.statusText}`
66
66
  );
67
- throw M.status = C.status, M.body = O, M;
67
+ throw O.status = k.status, O.body = T, O;
68
68
  }
69
- return C.status === 204 ? null : C.json();
69
+ return k.status === 204 ? null : k.json();
70
70
  }
71
71
  async function d(h) {
72
72
  try {
@@ -80,13 +80,13 @@ function Fe(t) {
80
80
  // Public — no HMAC required.
81
81
  fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
82
  if (!p.ok) {
83
- const C = await d(p);
84
- throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
83
+ const k = await d(p);
84
+ throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(k == null ? void 0 : k.error) || p.statusText}`);
85
85
  }
86
86
  return p.json();
87
87
  }),
88
88
  // HMAC-protected.
89
- o("GET", "/customers/me")
89
+ a("GET", "/customers/me")
90
90
  ]);
91
91
  return {
92
92
  config: (
@@ -96,34 +96,34 @@ function Fe(t) {
96
96
  customer: (f == null ? void 0 : f.customer) ?? null
97
97
  };
98
98
  }
99
- async function k() {
100
- const h = await o("GET", "/customers/me");
99
+ async function C() {
100
+ const h = await a("GET", "/customers/me");
101
101
  return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
103
103
  async function w(h) {
104
- const f = await o("PATCH", "/customers/me", h);
104
+ const f = await a("PATCH", "/customers/me", h);
105
105
  return (f == null ? void 0 : f.customer) ?? null;
106
106
  }
107
107
  async function S() {
108
- const h = await o("GET", "/conversations");
108
+ const h = await a("GET", "/conversations");
109
109
  return (h == null ? void 0 : h.conversations) ?? [];
110
110
  }
111
- async function R(h = {}) {
112
- return (await o("POST", "/conversations", h)).conversation;
111
+ async function F(h = {}) {
112
+ return (await a("POST", "/conversations", h)).conversation;
113
113
  }
114
114
  async function A(h) {
115
- return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
115
+ return (await a("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
117
  async function U(h, f) {
118
- return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
118
+ return (await a("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
120
  async function x(h, f = {}) {
121
121
  const p = new URLSearchParams();
122
122
  f.before && p.set("before", f.before), f.since && p.set("since", f.since), f.limit && p.set("limit", String(f.limit));
123
- const C = p.toString() ? `?${p.toString()}` : "";
124
- return o(
123
+ const k = p.toString() ? `?${p.toString()}` : "";
124
+ return a(
125
125
  "GET",
126
- `/conversations/${encodeURIComponent(h)}/messages${C}`
126
+ `/conversations/${encodeURIComponent(h)}/messages${k}`
127
127
  );
128
128
  }
129
129
  async function j(h, f) {
@@ -135,46 +135,46 @@ function Fe(t) {
135
135
  author: { id: e.userId, type: "user" },
136
136
  created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
137
137
  };
138
- return Array.isArray(f.attachments) && f.attachments.length && (p.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (p.metadata = f.metadata), o(
138
+ return Array.isArray(f.attachments) && f.attachments.length && (p.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (p.metadata = f.metadata), a(
139
139
  "POST",
140
140
  `/conversations/${encodeURIComponent(h)}/messages`,
141
141
  p
142
142
  );
143
143
  }
144
144
  async function P(h, f, p) {
145
- return V(), o(
145
+ return V(), a(
146
146
  "POST",
147
147
  `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
148
  p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function F(h) {
151
+ async function R(h) {
152
152
  const f = (
153
153
  /** @type {File} */
154
154
  h.name || "attachment"
155
- ), p = h.type || "application/octet-stream", C = h.size || 0, O = (
155
+ ), p = h.type || "application/octet-stream", k = h.size || 0, T = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
- await o("POST", "/attachments", {
157
+ await a("POST", "/attachments", {
158
158
  mime_type: p,
159
- size_bytes: C,
159
+ size_bytes: k,
160
160
  name: f
161
161
  })
162
- ), M = await fetch(O.upload_url, {
162
+ ), O = await fetch(T.upload_url, {
163
163
  method: "PUT",
164
164
  headers: { "Content-Type": p },
165
165
  body: h
166
166
  });
167
- if (!M.ok)
168
- throw new Error(`HTTP ${M.status} PUT signed upload`);
167
+ if (!O.ok)
168
+ throw new Error(`HTTP ${O.status} PUT signed upload`);
169
169
  return {
170
- type: Ne(p),
171
- path: O.path,
170
+ type: De(p),
171
+ path: T.path,
172
172
  mime_type: p,
173
- size_bytes: C
173
+ size_bytes: k
174
174
  };
175
175
  }
176
176
  async function H(h) {
177
- return o(
177
+ return a(
178
178
  "GET",
179
179
  `/attachments/sign?path=${encodeURIComponent(h)}`
180
180
  );
@@ -185,23 +185,23 @@ function Fe(t) {
185
185
  userHash: e.userHash,
186
186
  widgetId: e.widgetId
187
187
  }).toString();
188
- return `${e.baseUrl}${_e}/stream?${h}`;
188
+ return `${e.baseUrl}${fe}/stream?${h}`;
189
189
  }
190
190
  function z() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
193
  const h = new EventSource(Y());
194
194
  for (const f of Ee)
195
- h.addEventListener(f, (p) => Q(f, p.data));
196
- h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
195
+ h.addEventListener(f, (p) => Z(f, p.data));
196
+ h.addEventListener("error", () => o("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
197
  } catch (h) {
198
- console.error("[transport] SSE open failed", h), a("error", h);
198
+ console.error("[transport] SSE open failed", h), o("error", h);
199
199
  }
200
200
  }
201
- function Q(h, f) {
201
+ function Z(h, f) {
202
202
  try {
203
- const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
204
- a(h, C);
203
+ const p = JSON.parse(f), k = p && typeof p == "object" && "data" in p ? p.data : p;
204
+ o(h, k);
205
205
  } catch (p) {
206
206
  console.error("[transport] bad SSE payload", h, p);
207
207
  }
@@ -214,22 +214,22 @@ function Fe(t) {
214
214
  e.panelOpen || W();
215
215
  }, Le));
216
216
  }
217
- function Z(h) {
217
+ function Q(h) {
218
218
  e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), z()) : V();
219
219
  }
220
- async function ce() {
220
+ async function de() {
221
221
  try {
222
- const h = await S(), f = h.reduce((C, O) => {
223
- const M = O == null ? void 0 : O.last_message_at;
224
- return M && (!C || M > C) ? M : C;
222
+ const h = await S(), f = h.reduce((k, T) => {
223
+ const O = T == null ? void 0 : T.last_message_at;
224
+ return O && (!k || O > k) ? O : k;
225
225
  }, null);
226
- f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), V());
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, o("activity", { conversations: h, latestAt: f }), V());
227
227
  } catch (h) {
228
228
  console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
- function ne() {
232
- u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(ce, $e));
231
+ function se() {
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(de, $e));
233
233
  }
234
234
  function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
@@ -244,7 +244,7 @@ function Fe(t) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), ne(), e.panelOpen && z();
247
+ r("idle"), se(), e.panelOpen && z();
248
248
  }
249
249
  }
250
250
  async function _() {
@@ -254,35 +254,35 @@ function Fe(t) {
254
254
  e.lastBootstrap = h;
255
255
  try {
256
256
  const f = await S();
257
- e.lastActivityAt = f.reduce((p, C) => {
258
- const O = C == null ? void 0 : C.last_message_at;
259
- return O && (!p || O > p) ? O : p;
257
+ e.lastActivityAt = f.reduce((p, k) => {
258
+ const T = k == null ? void 0 : k.last_message_at;
259
+ return T && (!p || T > p) ? T : p;
260
260
  }, null);
261
261
  } catch (f) {
262
262
  console.error("[transport] initial /conversations failed", f);
263
263
  }
264
- return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
264
+ return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), se(), h;
265
265
  }
266
- function y() {
266
+ function g() {
267
267
  u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, W(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
268
268
  }
269
269
  return {
270
270
  on: n,
271
271
  start: _,
272
- stop: y,
273
- setPanelOpen: Z,
272
+ stop: g,
273
+ setPanelOpen: Q,
274
274
  // REST
275
275
  bootstrap: v,
276
- getCustomer: k,
276
+ getCustomer: C,
277
277
  patchCustomer: w,
278
278
  listConversations: S,
279
- createConversation: R,
279
+ createConversation: F,
280
280
  getConversation: A,
281
281
  patchConversation: U,
282
282
  listMessages: x,
283
283
  postMessage: j,
284
284
  postCallback: P,
285
- uploadAttachment: F,
285
+ uploadAttachment: R,
286
286
  signAttachment: H,
287
287
  // Read-only state
288
288
  get connection() {
@@ -290,10 +290,10 @@ function Fe(t) {
290
290
  }
291
291
  };
292
292
  }
293
- function De(t) {
293
+ function Ne(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function Ne(t) {
296
+ function De(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
299
  function je() {
@@ -351,22 +351,22 @@ function Ue(t) {
351
351
  })), n.push(t.on("conversation_updated", (u) => {
352
352
  const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
353
353
  if (!m || !_) return;
354
- const y = e.conversations.findIndex((h) => h.id === m);
355
- y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
354
+ const g = e.conversations.findIndex((h) => h.id === m);
355
+ g !== -1 && (e.conversations[g] = { ...e.conversations[g], ..._ });
356
356
  })), n.push(t.on("config_updated", (u) => {
357
357
  u != null && u.config && (e.config = u.config);
358
358
  })), n.push(t.on("action_status", (u) => {
359
- const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, y = u == null ? void 0 : u.action_name;
359
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.action_id, g = u == null ? void 0 : u.action_name;
360
360
  if (!m || !_) return;
361
361
  const h = e.runningActionsByConv[m] || {};
362
- u.state === "running" ? (h[_] = y || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
362
+ u.state === "running" ? (h[_] = g || _, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[_], e.runningActionsByConv[m] = { ...h });
363
363
  })), n.push(t.on("activity", (u) => {
364
364
  Array.isArray(u == null ? void 0 : u.conversations) && (e.conversations = u.conversations);
365
365
  }));
366
- async function a() {
366
+ async function o() {
367
367
  try {
368
368
  const u = new Promise(
369
- (_, y) => setTimeout(() => y(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
369
+ (_, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
370
370
  ), m = await Promise.race([t.start(), u]);
371
371
  e.config = m.config, e.customer = m.customer, e.conversations = await Promise.race([t.listConversations(), u]), e.ready = !0;
372
372
  } catch (u) {
@@ -382,7 +382,7 @@ function Ue(t) {
382
382
  t.stop();
383
383
  }
384
384
  async function s(u) {
385
- const m = ce(u);
385
+ const m = de(u);
386
386
  if (!m) return e.customer;
387
387
  try {
388
388
  const _ = await t.patchCustomer(m);
@@ -392,8 +392,8 @@ function Ue(t) {
392
392
  }
393
393
  return e.customer;
394
394
  }
395
- async function o(u = {}) {
396
- const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
395
+ async function a(u = {}) {
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((g) => g.id === m.id);
397
397
  return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
398
  }
399
399
  const d = 50;
@@ -406,27 +406,28 @@ function Ue(t) {
406
406
  loaded: !0
407
407
  });
408
408
  }
409
- async function k(u) {
409
+ async function C(u) {
410
+ var h;
410
411
  const m = e.paginationByConv[u];
411
- if (!(!m || m.loading || !m.nextCursor)) {
412
+ if (!m || m.loading || !m.nextCursor) return;
413
+ const g = (h = (e.messagesByConv[u] || []).find((f) => f == null ? void 0 : f.created_at)) == null ? void 0 : h.created_at;
414
+ if (g) {
412
415
  w(u, { ...m, loading: !0 });
413
416
  try {
414
- let h = m.nextCursor, f = [], p = 0;
415
- for (; p < 6 && h; p++) {
416
- const L = await t.listMessages(u, {
417
- before: h,
418
- limit: d
419
- }), se = (L == null ? void 0 : L.messages) ?? [];
420
- if (f = [...se, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !se.length || f.length >= 60) break;
421
- }
422
- const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))), M = [...f.filter((L) => !O.has(String(L == null ? void 0 : L.id))), ...C];
423
- e.messagesByConv[u] = M, w(u, {
424
- nextCursor: h,
417
+ const f = await t.listMessages(u, {
418
+ before: g,
419
+ limit: d
420
+ }), p = (f == null ? void 0 : f.messages) ?? [], k = e.messagesByConv[u] || [], T = /* @__PURE__ */ new Set();
421
+ for (const I of k)
422
+ (I == null ? void 0 : I.id) != null && T.add(`id:${String(I.id)}`), I != null && I.client_msg_id && T.add(`c:${I.client_msg_id}`);
423
+ const O = p.filter((I) => !((I == null ? void 0 : I.id) != null && T.has(`id:${String(I.id)}`) || I != null && I.client_msg_id && T.has(`c:${I.client_msg_id}`)));
424
+ e.messagesByConv[u] = [...O, ...k], w(u, {
425
+ nextCursor: (f == null ? void 0 : f.next_cursor) ?? null,
425
426
  loading: !1,
426
427
  loaded: !0
427
428
  });
428
- } catch (_) {
429
- console.error("[store] loadMore failed", _), w(u, { ...m, loading: !1 });
429
+ } catch (f) {
430
+ console.error("[store] loadMore failed", f), w(u, { ...m, loading: !1 });
430
431
  }
431
432
  }
432
433
  }
@@ -434,14 +435,14 @@ function Ue(t) {
434
435
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
435
436
  }
436
437
  async function S(u, m) {
437
- const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
438
- y !== -1 && (e.conversations[y] = _);
438
+ const _ = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
439
+ g !== -1 && (e.conversations[g] = _);
439
440
  }
440
- async function R(u, m, { attachments: _, metadata: y } = {}) {
441
- var M;
441
+ async function F(u, m, { attachments: _, metadata: g } = {}) {
442
+ var O;
442
443
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
444
  if (!u || !h && !f) return;
444
- const p = je(), C = ne(u), O = {
445
+ const p = je(), k = se(u), T = {
445
446
  id: p,
446
447
  client_msg_id: p,
447
448
  conversation_id: u,
@@ -449,33 +450,33 @@ function Ue(t) {
449
450
  text_md: h,
450
451
  author: {
451
452
  type: "user",
452
- id: ((M = e.customer) == null ? void 0 : M.external_id) || null
453
+ id: ((O = e.customer) == null ? void 0 : O.external_id) || null
453
454
  },
454
- created_at: C,
455
+ created_at: k,
455
456
  // Local-only flag — UI may render dimmed until the SSE echo lands.
456
457
  _pending: !0,
457
458
  ...f ? { payload: { type: "content", attachments: _ } } : {},
458
- ...y && typeof y == "object" ? { metadata: y } : {}
459
+ ...g && typeof g == "object" ? { metadata: g } : {}
459
460
  };
460
- z(u, O);
461
+ z(u, T);
461
462
  try {
462
463
  await t.postMessage(u, {
463
464
  client_msg_id: p,
464
465
  text_md: h,
465
- created_at: C,
466
+ created_at: k,
466
467
  ...f ? { attachments: _ } : {},
467
- ...y && typeof y == "object" ? { metadata: y } : {}
468
+ ...g && typeof g == "object" ? { metadata: g } : {}
468
469
  });
469
- } catch (L) {
470
- console.error("[store] send failed", L), W(u, p, { _failed: !0, _pending: !1 });
470
+ } catch (I) {
471
+ console.error("[store] send failed", I), W(u, p, { _failed: !0, _pending: !1 });
471
472
  }
472
473
  }
473
474
  async function A(u, m, _) {
474
475
  u != null && (e.awaitingCallback[u] = !0);
475
476
  try {
476
477
  await t.postCallback(u, m, _);
477
- } catch (y) {
478
- console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
478
+ } catch (g) {
479
+ console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
479
480
  }
480
481
  }
481
482
  const U = /* @__PURE__ */ new Map();
@@ -496,8 +497,8 @@ function Ue(t) {
496
497
  return null;
497
498
  }
498
499
  async function j(u, { rating: m, comment: _ } = {}) {
499
- const y = e.conversations.find((p) => p.id === u), f = {
500
- ...(y == null ? void 0 : y.metadata) || {},
500
+ const g = e.conversations.find((p) => p.id === u), f = {
501
+ ...(g == null ? void 0 : g.metadata) || {},
501
502
  feedback: {
502
503
  rating: m,
503
504
  comment: _ || null,
@@ -507,24 +508,24 @@ function Ue(t) {
507
508
  await S(u, { metadata: f });
508
509
  }
509
510
  function P(u) {
510
- var _, y;
511
+ var _, g;
511
512
  const m = e.messagesByConv[u] || [];
512
513
  for (let h = m.length - 1; h >= 0; h--) {
513
514
  const f = m[h];
514
- if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((y = f == null ? void 0 : f.payload) == null ? void 0 : y.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
515
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((g = f == null ? void 0 : f.payload) == null ? void 0 : g.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
515
516
  return f;
516
517
  }
517
518
  return null;
518
519
  }
519
- function F(u) {
520
- var _, y, h;
520
+ function R(u) {
521
+ var _, g, h;
521
522
  const m = e.messagesByConv[u] || [];
522
523
  for (let f = m.length - 1; f >= 0; f--) {
523
524
  const p = m[f];
524
- if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((y = p == null ? void 0 : p.payload) == null ? void 0 : y.state) === "pending") return null;
525
- const C = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
526
- if (C && Array.isArray(C.fields) && C.fields.length > 0)
527
- return { message: p, form: C };
525
+ if (((_ = p == null ? void 0 : p.author) == null ? void 0 : _.type) === "user" || (p == null ? void 0 : p.type) === "action" && ((g = p == null ? void 0 : p.payload) == null ? void 0 : g.state) === "pending") return null;
526
+ const k = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
527
+ if (k && Array.isArray(k.fields) && k.fields.length > 0)
528
+ return { message: p, form: k };
528
529
  }
529
530
  return null;
530
531
  }
@@ -533,28 +534,28 @@ function Ue(t) {
533
534
  if (!m) return null;
534
535
  const _ = Object.keys(m);
535
536
  if (_.length === 0) return null;
536
- const y = _[0];
537
- return { id: y, payload: { name: m[y] } };
537
+ const g = _[0];
538
+ return { id: g, payload: { name: m[g] } };
538
539
  }
539
540
  function Y(u) {
540
- var _, y, h, f;
541
+ var _, g, h, f;
541
542
  const m = e.messagesByConv[u] || [];
542
543
  for (let p = m.length - 1; p >= 0; p--) {
543
- const C = m[p];
544
- if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user") return [];
545
- if ((C == null ? void 0 : C.type) === "action" && ((y = C == null ? void 0 : C.payload) == null ? void 0 : y.state) === "pending") return [];
546
- if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
- const O = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
548
- return Array.isArray(O) && O.length ? O.map((M) => {
549
- if (typeof M == "string") {
550
- const L = M.trim();
551
- return L ? { label: L, kind: null } : null;
544
+ const k = m[p];
545
+ if (((_ = k == null ? void 0 : k.author) == null ? void 0 : _.type) === "user") return [];
546
+ if ((k == null ? void 0 : k.type) === "action" && ((g = k == null ? void 0 : k.payload) == null ? void 0 : g.state) === "pending") return [];
547
+ if (((h = k == null ? void 0 : k.author) == null ? void 0 : h.type) !== "agent_ia") continue;
548
+ const T = (f = k == null ? void 0 : k.metadata) == null ? void 0 : f.suggested_replies;
549
+ return Array.isArray(T) && T.length ? T.map((O) => {
550
+ if (typeof O == "string") {
551
+ const I = O.trim();
552
+ return I ? { label: I, kind: null } : null;
552
553
  }
553
- if (M && typeof M == "object" && typeof M.label == "string") {
554
- const L = M.label.trim();
555
- if (!L) return null;
556
- const se = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
557
- return { label: L, kind: se };
554
+ if (O && typeof O == "object" && typeof O.label == "string") {
555
+ const I = O.label.trim();
556
+ if (!I) return null;
557
+ const Ae = O.kind === "cta" || O.kind === "choice" || O.kind === "followup" ? O.kind : null;
558
+ return { label: I, kind: Ae };
558
559
  }
559
560
  return null;
560
561
  }).filter(Boolean).slice(0, 4) : [];
@@ -564,75 +565,75 @@ function Ue(t) {
564
565
  function z(u, m) {
565
566
  var f;
566
567
  const _ = e.messagesByConv[u] || [];
567
- let y = -1;
568
- m != null && m.client_msg_id && (y = _.findIndex(
568
+ let g = -1;
569
+ m != null && m.client_msg_id && (g = _.findIndex(
569
570
  (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
570
- )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
571
+ )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = _.findIndex((p) => Z(p == null ? void 0 : p.id, m.id)));
571
572
  let h;
572
- y === -1 ? h = [..._, m].sort(Z) : (h = _.slice(), h[y] = { ..._[y], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
573
+ g === -1 ? h = [..._, m].sort(Q) : (h = _.slice(), h[g] = { ..._[g], ...m, _pending: !1, _failed: !1 }), e.messagesByConv[u] = h, (m == null ? void 0 : m.type) === "action" && ((f = m == null ? void 0 : m.payload) != null && f.state) && m.payload.state !== "pending" && (m == null ? void 0 : m.id) != null && e.awaitingCallback[m.id] && delete e.awaitingCallback[m.id];
573
574
  }
574
- function Q(u, m) {
575
+ function Z(u, m) {
575
576
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
576
577
  }
577
578
  function W(u, m, _) {
578
- const y = e.messagesByConv[u];
579
- if (!y) return;
580
- const h = y.findIndex((p) => p.id === m);
579
+ const g = e.messagesByConv[u];
580
+ if (!g) return;
581
+ const h = g.findIndex((p) => p.id === m);
581
582
  if (h === -1) return;
582
- const f = y.slice();
583
- f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
583
+ const f = g.slice();
584
+ f[h] = { ...g[h], ..._ }, e.messagesByConv[u] = f;
584
585
  }
585
586
  function V(u, m) {
586
587
  const _ = e.conversations.findIndex((h) => h.id === u);
587
588
  if (_ === -1) return;
588
- const y = e.conversations[_];
589
- if (m && (!y.last_message_at || m > y.last_message_at)) {
589
+ const g = e.conversations[_];
590
+ if (m && (!g.last_message_at || m > g.last_message_at)) {
590
591
  const h = e.conversations.slice();
591
- h[_] = { ...y, last_message_at: m }, h.sort(
592
+ h[_] = { ...g, last_message_at: m }, h.sort(
592
593
  (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
594
  ), e.conversations = h;
594
595
  }
595
596
  }
596
- function Z(u, m) {
597
+ function Q(u, m) {
597
598
  return (u.created_at || "").localeCompare(m.created_at || "");
598
599
  }
599
- function ce(u) {
600
+ function de(u) {
600
601
  if (!u || typeof u != "object") return null;
601
602
  const m = {}, _ = {};
602
- for (const [y, h] of Object.entries(u))
603
- h !== void 0 && (y === "name" || y === "email" ? h != null && String(h).trim() !== "" && (m[y] = h) : (y === "values" || y === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[y] = h);
603
+ for (const [g, h] of Object.entries(u))
604
+ h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[g] = h);
604
605
  return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
605
606
  }
606
- function ne(u) {
607
+ function se(u) {
607
608
  const m = e.messagesByConv[u] || [];
608
609
  let _ = "";
609
610
  for (const f of m)
610
611
  f != null && f.created_at && f.created_at > _ && (_ = f.created_at);
611
- const y = (/* @__PURE__ */ new Date()).toISOString();
612
- return !_ || y > _ ? y : new Date(Date.parse(_) + 1).toISOString();
612
+ const g = (/* @__PURE__ */ new Date()).toISOString();
613
+ return !_ || g > _ ? g : new Date(Date.parse(_) + 1).toISOString();
613
614
  }
614
615
  return {
615
616
  state: e,
616
- start: a,
617
+ start: o,
617
618
  destroy: r,
618
619
  applyCustomer: s,
619
- createConversation: o,
620
+ createConversation: a,
620
621
  openConversation: v,
621
- loadMore: k,
622
+ loadMore: C,
622
623
  patchConversation: S,
623
- send: R,
624
+ send: F,
624
625
  clickCallback: A,
625
626
  signAttachment: x,
626
627
  submitFeedback: j,
627
628
  getPendingApproval: P,
628
629
  getActionInFlight: H,
629
630
  getLatestSuggestions: Y,
630
- getLatestForm: F,
631
+ getLatestForm: R,
631
632
  // Pass-through for panel open/close (controls SSE burst).
632
633
  setPanelOpen: t.setPanelOpen
633
634
  };
634
635
  }
635
- const N = {
636
+ const D = {
636
637
  w: "#ffffff",
637
638
  g50: "#F9F9F7",
638
639
  g100: "#F2F1EE",
@@ -648,14 +649,14 @@ const N = {
648
649
  green: "#22C55E",
649
650
  red: "#B91C1C",
650
651
  redBg: "#FDECEC"
651
- }, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
- function we(t = "") {
653
- return t ? ue[t.charCodeAt(0) % ue.length] : ue[0];
652
+ }, ce = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
653
+ function ye(t = "") {
654
+ return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
654
655
  }
655
- function be(t = "") {
656
+ function we(t = "") {
656
657
  return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
657
658
  }
658
- function ke(t = /* @__PURE__ */ new Date()) {
659
+ function be(t = /* @__PURE__ */ new Date()) {
659
660
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
660
661
  }
661
662
  const Pe = `
@@ -664,21 +665,21 @@ const Pe = `
664
665
  .wm-root {
665
666
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
666
667
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
667
- --wm-w: ${N.w};
668
- --wm-g50: ${N.g50};
669
- --wm-g100: ${N.g100};
670
- --wm-g150: ${N.g150};
671
- --wm-g200: ${N.g200};
672
- --wm-g300: ${N.g300};
673
- --wm-g400: ${N.g400};
674
- --wm-g500: ${N.g500};
675
- --wm-g700: ${N.g700};
676
- --wm-g900: ${N.g900};
677
- --wm-a: ${N.accent};
678
- --wm-al: ${N.accentLight};
679
- --wm-green: ${N.green};
680
- --wm-red: ${N.red};
681
- --wm-redBg: ${N.redBg};
668
+ --wm-w: ${D.w};
669
+ --wm-g50: ${D.g50};
670
+ --wm-g100: ${D.g100};
671
+ --wm-g150: ${D.g150};
672
+ --wm-g200: ${D.g200};
673
+ --wm-g300: ${D.g300};
674
+ --wm-g400: ${D.g400};
675
+ --wm-g500: ${D.g500};
676
+ --wm-g700: ${D.g700};
677
+ --wm-g900: ${D.g900};
678
+ --wm-a: ${D.accent};
679
+ --wm-al: ${D.accentLight};
680
+ --wm-green: ${D.green};
681
+ --wm-red: ${D.red};
682
+ --wm-redBg: ${D.redBg};
682
683
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
683
684
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
684
685
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -704,10 +705,10 @@ const Pe = `
704
705
  0% { transform: translateX(110%); opacity: 0; }
705
706
  100% { transform: translateX(0); opacity: 1; }
706
707
  }
707
- `, He = "https://api.messenger.victorc.fr", E = (t, e) => {
708
+ `, He = "https://api.messenger.victorc.fr", $ = (t, e) => {
708
709
  const n = t.__vccOpts || t;
709
- for (const [a, r] of e)
710
- n[a] = r;
710
+ for (const [o, r] of e)
711
+ n[o] = r;
711
712
  return n;
712
713
  }, ze = {
713
714
  name: "WmLauncher",
@@ -720,7 +721,7 @@ const Pe = `
720
721
  },
721
722
  emits: ["open", "dismiss"]
722
723
  }, Ve = { class: "wm-launcherWrap" }, qe = { class: "wm-peek__text" }, We = ["aria-label"];
723
- function Ke(t, e, n, a, r, s) {
724
+ function Ke(t, e, n, o, r, s) {
724
725
  return l(), c("div", Ve, [
725
726
  K(xe, { name: "wm-peek" }, {
726
727
  default: Te(() => [
@@ -730,10 +731,10 @@ function Ke(t, e, n, a, r, s) {
730
731
  role: "button",
731
732
  tabindex: "0",
732
733
  "aria-label": "Ouvrir le messenger sur le dernier message",
733
- onClick: e[1] || (e[1] = (o) => t.$emit("open")),
734
+ onClick: e[1] || (e[1] = (a) => t.$emit("open")),
734
735
  onKeydown: [
735
- e[2] || (e[2] = ae(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
- e[3] || (e[3] = ae(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
736
+ e[2] || (e[2] = ae(X((a) => t.$emit("open"), ["prevent"]), ["enter"])),
737
+ e[3] || (e[3] = ae(X((a) => t.$emit("open"), ["prevent"]), ["space"]))
737
738
  ]
738
739
  }, [
739
740
  i("p", qe, b(n.peek), 1),
@@ -741,7 +742,7 @@ function Ke(t, e, n, a, r, s) {
741
742
  type: "button",
742
743
  class: "wm-peek__close",
743
744
  "aria-label": "Ignorer",
744
- onClick: e[0] || (e[0] = X((o) => t.$emit("dismiss"), ["stop"]))
745
+ onClick: e[0] || (e[0] = X((a) => t.$emit("dismiss"), ["stop"]))
745
746
  }, [...e[5] || (e[5] = [
746
747
  i("svg", {
747
748
  width: "11",
@@ -757,7 +758,7 @@ function Ke(t, e, n, a, r, s) {
757
758
  i("path", { d: "M18 6L6 18M6 6l12 12" })
758
759
  ], -1)
759
760
  ])])
760
- ], 32)) : g("", !0)
761
+ ], 32)) : y("", !0)
761
762
  ]),
762
763
  _: 1
763
764
  }),
@@ -765,7 +766,7 @@ function Ke(t, e, n, a, r, s) {
765
766
  type: "button",
766
767
  class: "wm-launcher",
767
768
  "aria-label": "Ouvrir le messenger",
768
- onClick: e[4] || (e[4] = (o) => t.$emit("open"))
769
+ onClick: e[4] || (e[4] = (a) => t.$emit("open"))
769
770
  }, [
770
771
  e[6] || (e[6] = i("svg", {
771
772
  width: "20",
@@ -784,11 +785,11 @@ function Ke(t, e, n, a, r, s) {
784
785
  key: 0,
785
786
  class: "wm-launcher__badge",
786
787
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
787
- }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : g("", !0)
788
+ }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, We)) : y("", !0)
788
789
  ])
789
790
  ]);
790
791
  }
791
- const Ge = /* @__PURE__ */ E(ze, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Ye = {
792
+ const Ge = /* @__PURE__ */ $(ze, [["render", Ke], ["__scopeId", "data-v-fabef371"]]), Ye = {
792
793
  name: "WmAIAvatar",
793
794
  props: {
794
795
  size: { type: Number, default: 26 },
@@ -804,14 +805,14 @@ const Ge = /* @__PURE__ */ E(ze, [["render", Ke], ["__scopeId", "data-v-fabef371
804
805
  key: 0,
805
806
  class: "wm-aiav__pulse"
806
807
  }, Xe = ["width", "height"];
807
- function Qe(t, e, n, a, r, s) {
808
+ function Ze(t, e, n, o, r, s) {
808
809
  return l(), c("div", {
809
- class: B(["wm-aiav", { "wm-aiav--tail": n.tail }]),
810
+ class: E(["wm-aiav", { "wm-aiav--tail": n.tail }]),
810
811
  style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
811
812
  }, [
812
- n.pulse ? (l(), c("div", Je)) : g("", !0),
813
+ n.pulse ? (l(), c("div", Je)) : y("", !0),
813
814
  i("div", {
814
- class: B(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
815
+ class: E(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
815
816
  }, [
816
817
  (l(), c("svg", {
817
818
  width: n.size * 0.5,
@@ -843,7 +844,7 @@ function Qe(t, e, n, a, r, s) {
843
844
  ], 2)
844
845
  ], 6);
845
846
  }
846
- const te = /* @__PURE__ */ E(Ye, [["render", Qe], ["__scopeId", "data-v-8c924688"]]), Ze = {
847
+ const ne = /* @__PURE__ */ $(Ye, [["render", Ze], ["__scopeId", "data-v-8c924688"]]), Qe = {
847
848
  name: "WmHumanAvatar",
848
849
  props: {
849
850
  name: { type: String, default: "" },
@@ -852,14 +853,14 @@ const te = /* @__PURE__ */ E(Ye, [["render", Qe], ["__scopeId", "data-v-8c924688
852
853
  },
853
854
  computed: {
854
855
  bg() {
855
- return this.avatarUrl ? "transparent" : we(this.name);
856
+ return this.avatarUrl ? "transparent" : ye(this.name);
856
857
  },
857
858
  initials() {
858
- return be(this.name);
859
+ return we(this.name);
859
860
  }
860
861
  }
861
862
  }, et = ["src", "alt"];
862
- function tt(t, e, n, a, r, s) {
863
+ function tt(t, e, n, o, r, s) {
863
864
  return l(), c("div", {
864
865
  class: "wm-huav",
865
866
  style: G({
@@ -879,7 +880,7 @@ function tt(t, e, n, a, r, s) {
879
880
  }, b(s.initials), 5))
880
881
  ], 4);
881
882
  }
882
- const Ce = /* @__PURE__ */ E(Ze, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
883
+ const ke = /* @__PURE__ */ $(Qe, [["render", tt], ["__scopeId", "data-v-a772b179"]]), nt = {
883
884
  name: "WmTeamAvatars",
884
885
  props: {
885
886
  members: { type: Array, default: () => [] },
@@ -895,10 +896,10 @@ const Ce = /* @__PURE__ */ E(Ze, [["render", tt], ["__scopeId", "data-v-a772b179
895
896
  },
896
897
  methods: {
897
898
  colorFor(t) {
898
- return t.avatar_url ? "transparent" : we(t.name || "");
899
+ return t.avatar_url ? "transparent" : ye(t.name || "");
899
900
  },
900
901
  initialsFor(t) {
901
- return be(t.name || "");
902
+ return we(t.name || "");
902
903
  }
903
904
  }
904
905
  }, st = {
@@ -908,30 +909,30 @@ const Ce = /* @__PURE__ */ E(Ze, [["render", tt], ["__scopeId", "data-v-a772b179
908
909
  key: 0,
909
910
  class: "wm-team__label"
910
911
  };
911
- function ot(t, e, n, a, r, s) {
912
+ function ot(t, e, n, o, r, s) {
912
913
  return s.visible ? (l(), c("div", st, [
913
914
  i("div", {
914
915
  class: "wm-team__stack",
915
916
  style: G({ width: s.stackWidth + "px" })
916
917
  }, [
917
- (l(!0), c(T, null, D(n.members.slice(0, 3), (o, d) => (l(), c("div", {
918
+ (l(!0), c(M, null, N(n.members.slice(0, 3), (a, d) => (l(), c("div", {
918
919
  key: d,
919
920
  class: "wm-team__pill",
920
- style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
921
+ style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(a) })
921
922
  }, [
922
- o.avatar_url ? (l(), c("img", {
923
+ a.avatar_url ? (l(), c("img", {
923
924
  key: 0,
924
- src: o.avatar_url,
925
- alt: o.name || ""
926
- }, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(o)), 1))
925
+ src: a.avatar_url,
926
+ alt: a.name || ""
927
+ }, null, 8, rt)) : (l(), c("span", it, b(s.initialsFor(a)), 1))
927
928
  ], 4))), 128))
928
929
  ], 4),
929
- n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : g("", !0)
930
- ])) : g("", !0);
930
+ n.responseLabel ? (l(), c("span", at, b(n.responseLabel), 1)) : y("", !0)
931
+ ])) : y("", !0);
931
932
  }
932
- const lt = /* @__PURE__ */ E(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), dt = {
933
+ const lt = /* @__PURE__ */ $(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1"]]), dt = {
933
934
  name: "WmHeader",
934
- components: { AIAvatar: te, HumanAvatar: Ce, TeamAvatars: lt },
935
+ components: { AIAvatar: ne, HumanAvatar: ke, TeamAvatars: lt },
935
936
  props: {
936
937
  title: { type: String, default: "Nouvelle conversation" },
937
938
  escalated: { type: Boolean, default: !1 },
@@ -972,15 +973,15 @@ const lt = /* @__PURE__ */ E(nt, [["render", ot], ["__scopeId", "data-v-3659b9c1
972
973
  key: 3,
973
974
  class: "wm-header__fill"
974
975
  }, gt = { class: "wm-header__actions" };
975
- function yt(t, e, n, a, r, s) {
976
- const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
976
+ function yt(t, e, n, o, r, s) {
977
+ const a = B("HumanAvatar"), d = B("AIAvatar"), v = B("TeamAvatars");
977
978
  return l(), c("div", ct, [
978
979
  n.showBack ? (l(), c("button", {
979
980
  key: 0,
980
981
  type: "button",
981
982
  class: "wm-header__icon",
982
983
  "aria-label": "Retour à l'accueil",
983
- onClick: e[0] || (e[0] = (k) => t.$emit("back"))
984
+ onClick: e[0] || (e[0] = (C) => t.$emit("back"))
984
985
  }, [...e[3] || (e[3] = [
985
986
  i("svg", {
986
987
  width: "13",
@@ -996,14 +997,14 @@ function yt(t, e, n, a, r, s) {
996
997
  i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
997
998
  ], -1)
998
999
  ])])) : (l(), c("div", ut)),
999
- n.showIdentity ? (l(), c(T, { key: 2 }, [
1000
+ n.showIdentity ? (l(), c(M, { key: 2 }, [
1000
1001
  i("div", ht, [
1001
- n.escalated ? (l(), $(o, {
1002
+ n.escalated ? (l(), L(a, {
1002
1003
  key: 0,
1003
1004
  name: n.agentName,
1004
1005
  "avatar-url": n.agentAvatarUrl,
1005
1006
  size: 34
1006
- }, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
1007
+ }, null, 8, ["name", "avatar-url"])) : (l(), L(d, {
1007
1008
  key: 1,
1008
1009
  size: 34
1009
1010
  }))
@@ -1011,26 +1012,26 @@ function yt(t, e, n, a, r, s) {
1011
1012
  i("div", mt, [
1012
1013
  i("div", ft, b(n.title), 1),
1013
1014
  s.showPresence ? (l(), c("div", _t, [
1014
- s.hasTeam ? (l(), $(v, {
1015
+ s.hasTeam ? (l(), L(v, {
1015
1016
  key: 0,
1016
1017
  members: n.teamMembers,
1017
1018
  "response-label": n.responseLabel
1018
- }, null, 8, ["members", "response-label"])) : g("", !0),
1019
+ }, null, 8, ["members", "response-label"])) : y("", !0),
1019
1020
  i("span", pt, [
1020
1021
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1021
- de(" " + b(s.statusText), 1)
1022
+ te(" " + b(s.statusText), 1)
1022
1023
  ])
1023
- ])) : g("", !0)
1024
+ ])) : y("", !0)
1024
1025
  ])
1025
1026
  ], 64)) : (l(), c("div", vt)),
1026
1027
  i("div", gt, [
1027
1028
  n.showMore ? (l(), c("button", {
1028
1029
  key: 0,
1029
1030
  type: "button",
1030
- class: B(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1031
+ class: E(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
1031
1032
  "aria-label": "Plus d'options",
1032
1033
  title: "Plus d'options",
1033
- onClick: e[1] || (e[1] = (k) => t.$emit("more"))
1034
+ onClick: e[1] || (e[1] = (C) => t.$emit("more"))
1034
1035
  }, [...e[5] || (e[5] = [
1035
1036
  i("svg", {
1036
1037
  width: "13",
@@ -1055,14 +1056,14 @@ function yt(t, e, n, a, r, s) {
1055
1056
  r: "1.6"
1056
1057
  })
1057
1058
  ], -1)
1058
- ])], 2)) : g("", !0),
1059
+ ])], 2)) : y("", !0),
1059
1060
  n.showClose ? (l(), c("button", {
1060
1061
  key: 1,
1061
1062
  type: "button",
1062
1063
  class: "wm-header__icon",
1063
1064
  "aria-label": "Fermer le widget",
1064
1065
  title: "Fermer le widget",
1065
- onClick: e[2] || (e[2] = (k) => t.$emit("close"))
1066
+ onClick: e[2] || (e[2] = (C) => t.$emit("close"))
1066
1067
  }, [...e[6] || (e[6] = [
1067
1068
  i("svg", {
1068
1069
  width: "13",
@@ -1077,11 +1078,11 @@ function yt(t, e, n, a, r, s) {
1077
1078
  }, [
1078
1079
  i("path", { d: "M18 6L6 18M6 6l12 12" })
1079
1080
  ], -1)
1080
- ])])) : g("", !0)
1081
+ ])])) : y("", !0)
1081
1082
  ])
1082
1083
  ]);
1083
1084
  }
1084
- const wt = /* @__PURE__ */ E(dt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), pe = {
1085
+ const wt = /* @__PURE__ */ $(dt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1085
1086
  book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
1086
1087
  changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
1087
1088
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
@@ -1089,7 +1090,7 @@ const wt = /* @__PURE__ */ E(dt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9
1089
1090
  link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
1090
1091
  }, bt = {
1091
1092
  name: "WmOnboarding",
1092
- components: { AIAvatar: te },
1093
+ components: { AIAvatar: ne },
1093
1094
  props: {
1094
1095
  welcomeMessage: { type: String, default: "" },
1095
1096
  agentName: { type: String, default: "" },
@@ -1097,7 +1098,7 @@ const wt = /* @__PURE__ */ E(dt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9
1097
1098
  openThreads: { type: Array, default: () => [] },
1098
1099
  busy: { type: Boolean, default: !1 }
1099
1100
  },
1100
- emits: ["start", "select", "resume"],
1101
+ emits: ["start", "select", "resume", "view-all"],
1101
1102
  computed: {
1102
1103
  heroTitle() {
1103
1104
  return this.welcomeMessage ? this.welcomeMessage : this.agentName ? `Bonjour, je suis ${this.agentName}` : "Bonjour, je suis votre assistant";
@@ -1109,20 +1110,13 @@ Je réponds en quelques secondes.`;
1109
1110
  },
1110
1111
  methods: {
1111
1112
  iconPath(t) {
1112
- return pe[t] || pe.link;
1113
+ return _e[t] || _e.link;
1113
1114
  }
1114
1115
  }
1115
1116
  }, kt = { class: "wm-onb" }, Ct = { class: "wm-onb__hero" }, At = { class: "wm-onb__title" }, St = { class: "wm-onb__sub" }, xt = {
1116
1117
  key: 0,
1117
1118
  class: "wm-onb__section"
1118
- }, Tt = { class: "wm-onb__links" }, Mt = ["onClick"], Ot = {
1119
- key: 0,
1120
- class: "wm-onb__resume-dot",
1121
- "aria-label": "Non lu"
1122
- }, It = { class: "wm-onb__resume-body" }, Bt = { class: "wm-onb__resume-title" }, Et = { class: "wm-onb__resume-preview" }, $t = {
1123
- key: 1,
1124
- class: "wm-onb__section"
1125
- }, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], Ft = { class: "wm-onb__link-icon" }, Dt = {
1119
+ }, Tt = { class: "wm-onb__links" }, Mt = ["onClick"], Ot = { class: "wm-onb__link-icon" }, It = {
1126
1120
  width: "14",
1127
1121
  height: "14",
1128
1122
  viewBox: "0 0 24 24",
@@ -1132,31 +1126,72 @@ Je réponds en quelques secondes.`;
1132
1126
  "stroke-linecap": "round",
1133
1127
  "stroke-linejoin": "round",
1134
1128
  "aria-hidden": "true"
1135
- }, Nt = ["d"], jt = { class: "wm-onb__link-label" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
1136
- function Ht(t, e, n, a, r, s) {
1137
- const o = I("AIAvatar");
1129
+ }, Bt = ["d"], Et = { class: "wm-onb__link-label" }, $t = {
1130
+ key: 1,
1131
+ class: "wm-onb__section"
1132
+ }, Lt = { class: "wm-onb__links" }, Rt = ["onClick"], Ft = {
1133
+ key: 0,
1134
+ class: "wm-onb__resume-dot",
1135
+ "aria-label": "Non lu"
1136
+ }, Nt = { class: "wm-onb__resume-body" }, Dt = { class: "wm-onb__resume-title" }, jt = { class: "wm-onb__resume-preview" }, Ut = { class: "wm-onb__cta" }, Pt = ["disabled"];
1137
+ function Ht(t, e, n, o, r, s) {
1138
+ const a = B("AIAvatar");
1138
1139
  return l(), c("div", kt, [
1139
1140
  i("div", Ct, [
1140
- K(o, {
1141
+ K(a, {
1141
1142
  size: 56,
1142
1143
  pulse: !0
1143
1144
  }),
1144
1145
  i("div", At, b(s.heroTitle), 1),
1145
1146
  i("div", St, b(s.heroSub), 1)
1146
1147
  ]),
1147
- n.openThreads.length ? (l(), c("div", xt, [
1148
- e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Vos conversations", -1)),
1148
+ n.quickLinks.length ? (l(), c("div", xt, [
1149
+ e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1149
1150
  i("div", Tt, [
1150
- (l(!0), c(T, null, D(n.openThreads, (d) => (l(), c("button", {
1151
+ (l(!0), c(M, null, N(n.quickLinks, (d, v) => (l(), c("button", {
1152
+ key: v,
1153
+ type: "button",
1154
+ class: "wm-onb__link",
1155
+ onClick: (C) => t.$emit("select", d)
1156
+ }, [
1157
+ i("span", Ot, [
1158
+ (l(), c("svg", It, [
1159
+ i("path", {
1160
+ d: s.iconPath(d.icon)
1161
+ }, null, 8, Bt)
1162
+ ]))
1163
+ ]),
1164
+ i("span", Et, b(d.label), 1),
1165
+ e[2] || (e[2] = i("svg", {
1166
+ width: "13",
1167
+ height: "13",
1168
+ viewBox: "0 0 24 24",
1169
+ fill: "none",
1170
+ stroke: "currentColor",
1171
+ "stroke-width": "1.8",
1172
+ "stroke-linecap": "round",
1173
+ "stroke-linejoin": "round",
1174
+ class: "wm-onb__link-chev",
1175
+ "aria-hidden": "true"
1176
+ }, [
1177
+ i("path", { d: "M9 18l6-6-6-6" })
1178
+ ], -1))
1179
+ ], 8, Mt))), 128))
1180
+ ])
1181
+ ])) : y("", !0),
1182
+ n.openThreads.length ? (l(), c("div", $t, [
1183
+ e[7] || (e[7] = i("div", { class: "wm-onb__section-title" }, "Vos conversations", -1)),
1184
+ i("div", Lt, [
1185
+ (l(!0), c(M, null, N(n.openThreads, (d) => (l(), c("button", {
1151
1186
  key: d.id,
1152
1187
  type: "button",
1153
1188
  class: "wm-onb__link wm-onb__resume",
1154
1189
  onClick: (v) => t.$emit("resume", d)
1155
1190
  }, [
1156
1191
  i("span", {
1157
- class: B(["wm-onb__link-icon", { "wm-onb__resume-icon": d.unread }])
1192
+ class: E(["wm-onb__link-icon", { "wm-onb__resume-icon": d.unread }])
1158
1193
  }, [
1159
- e[1] || (e[1] = i("svg", {
1194
+ e[4] || (e[4] = i("svg", {
1160
1195
  width: "14",
1161
1196
  height: "14",
1162
1197
  viewBox: "0 0 24 24",
@@ -1169,13 +1204,13 @@ function Ht(t, e, n, a, r, s) {
1169
1204
  }, [
1170
1205
  i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1171
1206
  ], -1)),
1172
- d.unread ? (l(), c("span", Ot)) : g("", !0)
1207
+ d.unread ? (l(), c("span", Ft)) : y("", !0)
1173
1208
  ], 2),
1174
- i("span", It, [
1175
- i("span", Bt, b(d.title), 1),
1176
- i("span", Et, b(d.preview), 1)
1209
+ i("span", Nt, [
1210
+ i("span", Dt, b(d.title), 1),
1211
+ i("span", jt, b(d.preview), 1)
1177
1212
  ]),
1178
- e[2] || (e[2] = i("svg", {
1213
+ e[5] || (e[5] = i("svg", {
1179
1214
  width: "13",
1180
1215
  height: "13",
1181
1216
  viewBox: "0 0 24 24",
@@ -1189,54 +1224,40 @@ function Ht(t, e, n, a, r, s) {
1189
1224
  }, [
1190
1225
  i("path", { d: "M9 18l6-6-6-6" })
1191
1226
  ], -1))
1192
- ], 8, Mt))), 128))
1193
- ])
1194
- ])) : g("", !0),
1195
- n.quickLinks.length ? (l(), c("div", $t, [
1196
- e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1197
- i("div", Lt, [
1198
- (l(!0), c(T, null, D(n.quickLinks, (d, v) => (l(), c("button", {
1199
- key: v,
1227
+ ], 8, Rt))), 128)),
1228
+ i("button", {
1200
1229
  type: "button",
1201
- class: "wm-onb__link",
1202
- onClick: (k) => t.$emit("select", d)
1203
- }, [
1204
- i("span", Ft, [
1205
- (l(), c("svg", Dt, [
1206
- i("path", {
1207
- d: s.iconPath(d.icon)
1208
- }, null, 8, Nt)
1209
- ]))
1210
- ]),
1211
- i("span", jt, b(d.label), 1),
1212
- e[4] || (e[4] = i("svg", {
1213
- width: "13",
1214
- height: "13",
1230
+ class: "wm-onb__viewAll",
1231
+ onClick: e[0] || (e[0] = (d) => t.$emit("view-all"))
1232
+ }, [...e[6] || (e[6] = [
1233
+ te(" Voir toutes les conversations ", -1),
1234
+ i("svg", {
1235
+ width: "12",
1236
+ height: "12",
1215
1237
  viewBox: "0 0 24 24",
1216
1238
  fill: "none",
1217
1239
  stroke: "currentColor",
1218
1240
  "stroke-width": "1.8",
1219
1241
  "stroke-linecap": "round",
1220
1242
  "stroke-linejoin": "round",
1221
- class: "wm-onb__link-chev",
1222
1243
  "aria-hidden": "true"
1223
1244
  }, [
1224
1245
  i("path", { d: "M9 18l6-6-6-6" })
1225
- ], -1))
1226
- ], 8, Rt))), 128))
1246
+ ], -1)
1247
+ ])])
1227
1248
  ])
1228
- ])) : g("", !0),
1249
+ ])) : y("", !0),
1229
1250
  i("div", Ut, [
1230
1251
  i("button", {
1231
1252
  type: "button",
1232
1253
  class: "wm-onb__startBtn",
1233
1254
  disabled: n.busy,
1234
- onClick: e[0] || (e[0] = (d) => t.$emit("start"))
1255
+ onClick: e[1] || (e[1] = (d) => t.$emit("start"))
1235
1256
  }, b(n.busy ? "…" : "Commencer une conversation"), 9, Pt)
1236
1257
  ])
1237
1258
  ]);
1238
1259
  }
1239
- const zt = /* @__PURE__ */ E(bt, [["render", Ht], ["__scopeId", "data-v-7ce03b72"]]);
1260
+ const zt = /* @__PURE__ */ $(bt, [["render", Ht], ["__scopeId", "data-v-13584fe8"]]);
1240
1261
  function Vt(t) {
1241
1262
  return typeof t != "string" ? "" : t.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
1242
1263
  }
@@ -1296,10 +1317,10 @@ const qt = {
1296
1317
  "stroke-width": "2.2",
1297
1318
  "stroke-linecap": "round",
1298
1319
  "stroke-linejoin": "round"
1299
- }, Xt = { class: "wm-result__body" }, Qt = { class: "wm-result__label" }, Zt = { class: "wm-result__detail" };
1300
- function en(t, e, n, a, r, s) {
1320
+ }, Xt = { class: "wm-result__body" }, Zt = { class: "wm-result__label" }, Qt = { class: "wm-result__detail" };
1321
+ function en(t, e, n, o, r, s) {
1301
1322
  return l(), c("div", {
1302
- class: B(["wm-result", `wm-result--${n.state}`])
1323
+ class: E(["wm-result", `wm-result--${n.state}`])
1303
1324
  }, [
1304
1325
  i("span", Wt, [
1305
1326
  n.state === "success" ? (l(), c("svg", Kt, [...e[0] || (e[0] = [
@@ -1330,18 +1351,18 @@ function en(t, e, n, a, r, s) {
1330
1351
  ])]))
1331
1352
  ]),
1332
1353
  i("span", Xt, [
1333
- i("span", Qt, b(n.label), 1),
1334
- s.detailText ? (l(), c(T, { key: 0 }, [
1354
+ i("span", Zt, b(n.label), 1),
1355
+ s.detailText ? (l(), c(M, { key: 0 }, [
1335
1356
  e[4] || (e[4] = i("span", {
1336
1357
  class: "wm-result__sep",
1337
1358
  "aria-hidden": "true"
1338
1359
  }, " · ", -1)),
1339
- i("span", Zt, b(s.detailText), 1)
1340
- ], 64)) : g("", !0)
1360
+ i("span", Qt, b(s.detailText), 1)
1361
+ ], 64)) : y("", !0)
1341
1362
  ])
1342
1363
  ], 2);
1343
1364
  }
1344
- const tn = /* @__PURE__ */ E(qt, [["render", en], ["__scopeId", "data-v-64a83fb8"]]), nn = {
1365
+ const tn = /* @__PURE__ */ $(qt, [["render", en], ["__scopeId", "data-v-64a83fb8"]]), nn = {
1345
1366
  name: "WmArtifactFormResponse",
1346
1367
  props: {
1347
1368
  data: { type: Object, required: !0 }
@@ -1353,7 +1374,7 @@ const tn = /* @__PURE__ */ E(qt, [["render", en], ["__scopeId", "data-v-64a83fb8
1353
1374
  }
1354
1375
  }
1355
1376
  }, sn = { class: "wm-art wm-art--formResponse" }, rn = { class: "wm-art__head" }, an = { class: "wm-art__title" }, on = { class: "wm-art__body" }, ln = { class: "wm-art__fieldLabel" };
1356
- function dn(t, e, n, a, r, s) {
1377
+ function dn(t, e, n, o, r, s) {
1357
1378
  return l(), c("div", sn, [
1358
1379
  i("div", rn, [
1359
1380
  i("div", an, b(n.data.title || "Formulaire"), 1),
@@ -1371,23 +1392,23 @@ function dn(t, e, n, a, r, s) {
1371
1392
  }, [
1372
1393
  i("polyline", { points: "20 6 9 17 4 12" })
1373
1394
  ]),
1374
- de(" Envoyé ")
1395
+ te(" Envoyé ")
1375
1396
  ], -1))
1376
1397
  ]),
1377
1398
  i("div", on, [
1378
- (l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
1399
+ (l(!0), c(M, null, N(s.fields, (a, d) => (l(), c("div", {
1379
1400
  key: d,
1380
1401
  class: "wm-art__field"
1381
1402
  }, [
1382
- i("div", ln, b(o.label), 1),
1403
+ i("div", ln, b(a.label), 1),
1383
1404
  i("div", {
1384
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1385
- }, b(o.value), 3)
1405
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1406
+ }, b(a.value), 3)
1386
1407
  ]))), 128))
1387
1408
  ])
1388
1409
  ]);
1389
1410
  }
1390
- const cn = /* @__PURE__ */ E(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9"]]), un = {
1411
+ const cn = /* @__PURE__ */ $(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9"]]), un = {
1391
1412
  name: "WmArtifactInfoCard",
1392
1413
  props: {
1393
1414
  data: { type: Object, required: !0 }
@@ -1415,7 +1436,7 @@ const cn = /* @__PURE__ */ E(nn, [["render", dn], ["__scopeId", "data-v-ca24a9c9
1415
1436
  key: 0,
1416
1437
  class: "wm-art__text"
1417
1438
  }, bn = { class: "wm-art__fieldLabel" };
1418
- function kn(t, e, n, a, r, s) {
1439
+ function kn(t, e, n, o, r, s) {
1419
1440
  return l(), c("div", hn, [
1420
1441
  n.data.image_url ? (l(), c("figure", mn, [
1421
1442
  i("img", {
@@ -1423,38 +1444,38 @@ function kn(t, e, n, a, r, s) {
1423
1444
  alt: n.data.title || "",
1424
1445
  loading: "lazy"
1425
1446
  }, null, 8, fn)
1426
- ])) : g("", !0),
1447
+ ])) : y("", !0),
1427
1448
  i("div", _n, [
1428
1449
  i("div", pn, [
1429
1450
  i("div", vn, b(n.data.title), 1),
1430
- n.data.subtitle ? (l(), c("div", gn, b(n.data.subtitle), 1)) : g("", !0)
1451
+ n.data.subtitle ? (l(), c("div", gn, b(n.data.subtitle), 1)) : y("", !0)
1431
1452
  ]),
1432
1453
  n.data.badge && n.data.badge.label ? (l(), c("span", {
1433
1454
  key: 0,
1434
- class: B(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1435
- }, b(n.data.badge.label), 3)) : g("", !0)
1455
+ class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1456
+ }, b(n.data.badge.label), 3)) : y("", !0)
1436
1457
  ]),
1437
1458
  s.hasBody ? (l(), c("div", yn, [
1438
- n.data.body ? (l(), c("div", wn, b(n.data.body), 1)) : g("", !0),
1439
- s.fields.length ? (l(!0), c(T, { key: 1 }, D(s.fields, (o, d) => (l(), c("div", {
1459
+ n.data.body ? (l(), c("div", wn, b(n.data.body), 1)) : y("", !0),
1460
+ s.fields.length ? (l(!0), c(M, { key: 1 }, N(s.fields, (a, d) => (l(), c("div", {
1440
1461
  key: d,
1441
1462
  class: "wm-art__field"
1442
1463
  }, [
1443
- i("div", bn, b(o.label), 1),
1464
+ i("div", bn, b(a.label), 1),
1444
1465
  i("div", {
1445
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1446
- }, b(o.value), 3)
1447
- ]))), 128)) : g("", !0)
1448
- ])) : g("", !0)
1466
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1467
+ }, b(a.value), 3)
1468
+ ]))), 128)) : y("", !0)
1469
+ ])) : y("", !0)
1449
1470
  ]);
1450
1471
  }
1451
- const Cn = /* @__PURE__ */ E(un, [["render", kn], ["__scopeId", "data-v-d7369333"]]);
1472
+ const Cn = /* @__PURE__ */ $(un, [["render", kn], ["__scopeId", "data-v-d7369333"]]);
1452
1473
  function An(t) {
1453
1474
  if (!t) return "";
1454
1475
  const e = new Date(t);
1455
1476
  if (Number.isNaN(e.getTime())) return t;
1456
- const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), a = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
1457
- return `${n} à ${a}`;
1477
+ const n = e.toLocaleDateString("fr-FR", { day: "numeric", month: "long", year: "numeric" }), o = e.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
1478
+ return `${n} à ${o}`;
1458
1479
  }
1459
1480
  const Sn = {
1460
1481
  name: "WmArtifactTicket",
@@ -1512,7 +1533,7 @@ const Sn = {
1512
1533
  key: 1,
1513
1534
  class: "wm-art__footer wm-tk__footer"
1514
1535
  };
1515
- function Dn(t, e, n, a, r, s) {
1536
+ function Nn(t, e, n, o, r, s) {
1516
1537
  return l(), c("div", xn, [
1517
1538
  i("div", Tn, [
1518
1539
  i("div", Mn, b(n.data.title), 1),
@@ -1535,30 +1556,30 @@ function Dn(t, e, n, a, r, s) {
1535
1556
  i("span", null, b(n.data.reference), 1)
1536
1557
  ]),
1537
1558
  i("span", {
1538
- class: B(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
1559
+ class: E(["wm-art__badge", "wm-tk__badge", `wm-art__badge--${n.data.status.tone || "neutral"}`])
1539
1560
  }, [
1540
1561
  e[1] || (e[1] = i("span", {
1541
1562
  class: "wm-tk__dot",
1542
1563
  "aria-hidden": "true"
1543
1564
  }, null, -1)),
1544
- de(" " + b(n.data.status.label), 1)
1565
+ te(" " + b(n.data.status.label), 1)
1545
1566
  ], 2)
1546
1567
  ]),
1547
- n.data.body ? (l(), c("div", Bn, b(n.data.body), 1)) : g("", !0)
1568
+ n.data.body ? (l(), c("div", Bn, b(n.data.body), 1)) : y("", !0)
1548
1569
  ]),
1549
1570
  s.fields.length ? (l(), c("div", En, [
1550
- (l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
1571
+ (l(!0), c(M, null, N(s.fields, (a, d) => (l(), c("div", {
1551
1572
  key: d,
1552
1573
  class: "wm-art__field"
1553
1574
  }, [
1554
- i("div", $n, b(o.label), 1),
1575
+ i("div", $n, b(a.label), 1),
1555
1576
  i("div", {
1556
- class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1577
+ class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": a.multiline }])
1557
1578
  }, [
1558
- s.isPriority(o.label) ? (l(), c("svg", {
1579
+ s.isPriority(a.label) ? (l(), c("svg", {
1559
1580
  key: 0,
1560
1581
  class: "wm-tk__prio",
1561
- "data-level": s.priorityLevel(o.value),
1582
+ "data-level": s.priorityLevel(a.value),
1562
1583
  width: "12",
1563
1584
  height: "12",
1564
1585
  viewBox: "0 0 12 12",
@@ -1585,7 +1606,7 @@ function Dn(t, e, n, a, r, s) {
1585
1606
  height: "9",
1586
1607
  rx: "0.5"
1587
1608
  }, null, -1)
1588
- ])], 8, Ln)) : s.isDate(o.label) ? (l(), c("svg", Rn, [...e[3] || (e[3] = [
1609
+ ])], 8, Ln)) : s.isDate(a.label) ? (l(), c("svg", Rn, [...e[3] || (e[3] = [
1589
1610
  i("rect", {
1590
1611
  x: "3",
1591
1612
  y: "4",
@@ -1594,11 +1615,11 @@ function Dn(t, e, n, a, r, s) {
1594
1615
  rx: "2"
1595
1616
  }, null, -1),
1596
1617
  i("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
1597
- ])])) : g("", !0),
1598
- i("span", null, b(o.value), 1)
1618
+ ])])) : y("", !0),
1619
+ i("span", null, b(a.value), 1)
1599
1620
  ], 2)
1600
1621
  ]))), 128))
1601
- ])) : g("", !0),
1622
+ ])) : y("", !0),
1602
1623
  n.data.created_at ? (l(), c("div", Fn, [
1603
1624
  e[4] || (e[4] = i("svg", {
1604
1625
  width: "11",
@@ -1621,13 +1642,13 @@ function Dn(t, e, n, a, r, s) {
1621
1642
  i("path", { d: "M16 2v4M8 2v4M3 10h18" })
1622
1643
  ], -1)),
1623
1644
  i("span", null, b(s.formattedDate), 1)
1624
- ])) : g("", !0)
1645
+ ])) : y("", !0)
1625
1646
  ]);
1626
1647
  }
1627
- const Nn = /* @__PURE__ */ E(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
1648
+ const Dn = /* @__PURE__ */ $(Sn, [["render", Nn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
1628
1649
  form_response: cn,
1629
1650
  info_card: Cn,
1630
- ticket: Nn
1651
+ ticket: Dn
1631
1652
  }, Un = {
1632
1653
  name: "WmArtifactRenderer",
1633
1654
  props: {
@@ -1643,13 +1664,13 @@ const Nn = /* @__PURE__ */ E(Sn, [["render", Dn], ["__scopeId", "data-v-8b274eb7
1643
1664
  }
1644
1665
  }
1645
1666
  };
1646
- function Pn(t, e, n, a, r, s) {
1647
- return s.component ? (l(), $(Me(s.component), {
1667
+ function Pn(t, e, n, o, r, s) {
1668
+ return s.component ? (l(), L(Me(s.component), {
1648
1669
  key: 0,
1649
1670
  data: n.artifact.data
1650
- }, null, 8, ["data"])) : g("", !0);
1671
+ }, null, 8, ["data"])) : y("", !0);
1651
1672
  }
1652
- const Hn = /* @__PURE__ */ E(Un, [["render", Pn]]), zn = {
1673
+ const Hn = /* @__PURE__ */ $(Un, [["render", Pn]]), zn = {
1653
1674
  name: "WmAttachmentPreview",
1654
1675
  inject: {
1655
1676
  signAttachmentFn: { default: null }
@@ -1662,10 +1683,10 @@ const Hn = /* @__PURE__ */ E(Un, [["render", Pn]]), zn = {
1662
1683
  },
1663
1684
  computed: {
1664
1685
  kind() {
1665
- var n, a;
1686
+ var n, o;
1666
1687
  const t = (n = this.attachment) == null ? void 0 : n.type;
1667
1688
  if (t) return t;
1668
- const e = (((a = this.attachment) == null ? void 0 : a.mime_type) || "").toLowerCase();
1689
+ const e = (((o = this.attachment) == null ? void 0 : o.mime_type) || "").toLowerCase();
1669
1690
  return e.startsWith("image/") ? "image" : e.startsWith("audio/") ? "audio" : e.startsWith("video/") ? "video" : "file";
1670
1691
  },
1671
1692
  displayName() {
@@ -1706,14 +1727,14 @@ const Hn = /* @__PURE__ */ E(Un, [["render", Pn]]), zn = {
1706
1727
  }, Vn = ["href"], qn = ["src", "alt"], Wn = ["src"], Kn = ["src"], Gn = ["href", "download"], Yn = { class: "wm-att__main" }, Jn = { class: "wm-att__name" }, Xn = {
1707
1728
  key: 0,
1708
1729
  class: "wm-att__meta"
1709
- }, Qn = {
1730
+ }, Zn = {
1710
1731
  key: 0,
1711
1732
  class: "wm-att__spin",
1712
1733
  "aria-hidden": "true"
1713
1734
  };
1714
- function Zn(t, e, n, a, r, s) {
1735
+ function Qn(t, e, n, o, r, s) {
1715
1736
  return l(), c("div", {
1716
- class: B(["wm-att", ["wm-att--" + (s.kind || "file")]])
1737
+ class: E(["wm-att", ["wm-att--" + (s.kind || "file")]])
1717
1738
  }, [
1718
1739
  s.kind === "image" && r.url ? (l(), c("a", {
1719
1740
  key: 0,
@@ -1744,7 +1765,7 @@ function Zn(t, e, n, a, r, s) {
1744
1765
  download: s.displayName,
1745
1766
  target: "_blank",
1746
1767
  rel: "noopener",
1747
- onClick: e[0] || (e[0] = (...o) => s.onFileClick && s.onFileClick(...o))
1768
+ onClick: e[0] || (e[0] = (...a) => s.onFileClick && s.onFileClick(...a))
1748
1769
  }, [
1749
1770
  e[1] || (e[1] = i("span", { class: "wm-att__icon" }, [
1750
1771
  i("svg", {
@@ -1764,87 +1785,87 @@ function Zn(t, e, n, a, r, s) {
1764
1785
  ], -1)),
1765
1786
  i("span", Yn, [
1766
1787
  i("span", Jn, b(s.displayName), 1),
1767
- s.sizeLabel ? (l(), c("span", Xn, b(s.sizeLabel), 1)) : g("", !0)
1788
+ s.sizeLabel ? (l(), c("span", Xn, b(s.sizeLabel), 1)) : y("", !0)
1768
1789
  ]),
1769
- r.loading ? (l(), c("span", Qn)) : g("", !0)
1790
+ r.loading ? (l(), c("span", Zn)) : y("", !0)
1770
1791
  ], 8, Gn))
1771
1792
  ], 2);
1772
1793
  }
1773
- const es = /* @__PURE__ */ E(zn, [["render", Zn], ["__scopeId", "data-v-1cd1267b"]]);
1794
+ const es = /* @__PURE__ */ $(zn, [["render", Qn], ["__scopeId", "data-v-1cd1267b"]]);
1774
1795
  function ts(t) {
1775
1796
  return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1776
1797
  }
1777
1798
  function ns(t) {
1778
1799
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1779
1800
  }
1780
- const ve = "";
1801
+ const pe = "";
1781
1802
  function re(t) {
1782
1803
  let e = t;
1783
1804
  const n = [];
1784
- return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1805
+ return e = e.replace(/`([^`\n]+)`/g, (o, r) => {
1785
1806
  const s = n.length;
1786
- return n.push(r), `${ve}CODE${s}${ve}`;
1787
- }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => ns(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (a, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1807
+ return n.push(r), `${pe}CODE${s}${pe}`;
1808
+ }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (o, r, s) => ns(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (o, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1788
1809
  }
1789
1810
  function ss(t) {
1790
1811
  if (!t) return "";
1791
1812
  const e = ts(t).split(`
1792
1813
  `), n = [];
1793
- let a = 0;
1794
- for (; a < e.length; ) {
1795
- const s = e[a];
1814
+ let o = 0;
1815
+ for (; o < e.length; ) {
1816
+ const s = e[o];
1796
1817
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1797
- a++;
1798
- const k = [];
1799
- for (; a < e.length && !/^\s*```\s*$/.test(e[a]); )
1800
- k.push(e[a]), a++;
1801
- a < e.length && a++, n.push({
1818
+ o++;
1819
+ const C = [];
1820
+ for (; o < e.length && !/^\s*```\s*$/.test(e[o]); )
1821
+ C.push(e[o]), o++;
1822
+ o < e.length && o++, n.push({
1802
1823
  type: "block",
1803
- html: `<pre class="wm-md-pre"><code>${k.join(`
1824
+ html: `<pre class="wm-md-pre"><code>${C.join(`
1804
1825
  `)}</code></pre>`
1805
1826
  });
1806
1827
  continue;
1807
1828
  }
1808
1829
  if (/^\s*[-*]\s+/.test(s)) {
1809
- const k = [];
1810
- for (; a < e.length; ) {
1811
- const S = /^\s*[-*]\s+(.*)$/.exec(e[a]);
1830
+ const C = [];
1831
+ for (; o < e.length; ) {
1832
+ const S = /^\s*[-*]\s+(.*)$/.exec(e[o]);
1812
1833
  if (!S) break;
1813
- k.push(S[1]), a++;
1834
+ C.push(S[1]), o++;
1814
1835
  }
1815
- const w = k.map((S) => `<li>${re(S)}</li>`).join("");
1836
+ const w = C.map((S) => `<li>${re(S)}</li>`).join("");
1816
1837
  n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1817
1838
  continue;
1818
1839
  }
1819
1840
  const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1820
1841
  if (d) {
1821
- const k = parseInt(d[1], 10), w = [d[2]];
1822
- for (a++; a < e.length; ) {
1823
- const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1842
+ const C = parseInt(d[1], 10), w = [d[2]];
1843
+ for (o++; o < e.length; ) {
1844
+ const A = /^\s*\d+\.\s+(.*)$/.exec(e[o]);
1824
1845
  if (!A) break;
1825
- w.push(A[1]), a++;
1846
+ w.push(A[1]), o++;
1826
1847
  }
1827
- const S = w.map((A) => `<li>${re(A)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
1828
- n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${S}</ol>` });
1848
+ const S = w.map((A) => `<li>${re(A)}</li>`).join(""), F = C !== 1 ? ` start="${C}"` : "";
1849
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${F}>${S}</ol>` });
1829
1850
  continue;
1830
1851
  }
1831
1852
  const v = /^(#{1,6})\s+(.*)$/.exec(s);
1832
1853
  if (v) {
1833
- const k = v[1].length;
1854
+ const C = v[1].length;
1834
1855
  n.push({
1835
1856
  type: "block",
1836
- html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
1837
- }), a++;
1857
+ html: `<h${C} class="wm-md-h wm-md-h${C}">${re(v[2])}</h${C}>`
1858
+ }), o++;
1838
1859
  continue;
1839
1860
  }
1840
- n.push({ type: "text", html: re(s) }), a++;
1861
+ n.push({ type: "text", html: re(s) }), o++;
1841
1862
  }
1842
1863
  let r = "";
1843
1864
  for (let s = 0; s < n.length; s++) {
1844
- const o = n[s];
1845
- r += o.html;
1865
+ const a = n[s];
1866
+ r += a.html;
1846
1867
  const d = n[s + 1];
1847
- d && o.type !== "block" && d.type !== "block" && (r += `
1868
+ d && a.type !== "block" && d.type !== "block" && (r += `
1848
1869
  `);
1849
1870
  }
1850
1871
  return r;
@@ -1862,24 +1883,24 @@ const rs = {
1862
1883
  }
1863
1884
  }
1864
1885
  }, is = ["innerHTML"];
1865
- function as(t, e, n, a, r, s) {
1886
+ function as(t, e, n, o, r, s) {
1866
1887
  return l(), c("div", {
1867
- class: B(["wm-bubble", "wm-bubble--" + n.role])
1888
+ class: E(["wm-bubble", "wm-bubble--" + n.role])
1868
1889
  }, [
1869
1890
  Oe(t.$slots, "default", {}, () => [
1870
1891
  i("span", { innerHTML: s.rendered }, null, 8, is)
1871
1892
  ], !0)
1872
1893
  ], 2);
1873
1894
  }
1874
- const os = /* @__PURE__ */ E(rs, [["render", as], ["__scopeId", "data-v-5c9e9f2b"]]), ls = { name: "WmTyping" }, ds = { class: "wm-typing" };
1875
- function cs(t, e, n, a, r, s) {
1895
+ const os = /* @__PURE__ */ $(rs, [["render", as], ["__scopeId", "data-v-5c9e9f2b"]]), ls = { name: "WmTyping" }, ds = { class: "wm-typing" };
1896
+ function cs(t, e, n, o, r, s) {
1876
1897
  return l(), c("div", ds, [...e[0] || (e[0] = [
1877
1898
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1878
1899
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1879
1900
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1880
1901
  ])]);
1881
1902
  }
1882
- const us = /* @__PURE__ */ E(ls, [["render", cs], ["__scopeId", "data-v-df2447fd"]]);
1903
+ const us = /* @__PURE__ */ $(ls, [["render", cs], ["__scopeId", "data-v-df2447fd"]]);
1883
1904
  function ee(t) {
1884
1905
  return t ? t.client_msg_id || t.id : "";
1885
1906
  }
@@ -1892,7 +1913,7 @@ const hs = {
1892
1913
  idle: "Conversation en pause"
1893
1914
  }, ms = 80, fs = 200, _s = {
1894
1915
  name: "WmMessageList",
1895
- components: { AIAvatar: te, HumanAvatar: Ce, Bubble: os, Typing: us, ActionResult: tn, AttachmentPreview: es, ArtifactRenderer: Hn },
1916
+ components: { AIAvatar: ne, HumanAvatar: ke, Bubble: os, Typing: us, ActionResult: tn, AttachmentPreview: es, ArtifactRenderer: Hn },
1896
1917
  props: {
1897
1918
  messages: { type: Array, default: () => [] },
1898
1919
  streamingActive: { type: Boolean, default: !1 },
@@ -1937,50 +1958,60 @@ const hs = {
1937
1958
  return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
1938
1959
  },
1939
1960
  groups() {
1940
- var e, n, a, r;
1961
+ var n, o, r, s;
1941
1962
  const t = [];
1942
- for (const s of this.messages) {
1943
- const o = this.roleOf(s);
1944
- if (o === "system") {
1945
- if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
1946
- const k = t[t.length - 1];
1947
- k && k.role === "ai" ? k.messages.push(s) : t.push({
1948
- key: `g-${ee(s)}`,
1963
+ for (const a of this.messages) {
1964
+ const d = this.roleOf(a);
1965
+ if (d === "system") {
1966
+ if (((n = a == null ? void 0 : a.payload) == null ? void 0 : n.event) === "action_admin_pending") {
1967
+ const w = t[t.length - 1];
1968
+ w && w.role === "ai" ? w.messages.push(a) : t.push({
1969
+ key: `g-${ee(a)}`,
1949
1970
  role: "ai",
1950
1971
  agentName: "",
1951
1972
  agentAvatarUrl: null,
1952
- messages: [s],
1973
+ messages: [a],
1953
1974
  items: []
1954
1975
  });
1955
1976
  continue;
1956
1977
  }
1957
1978
  t.push({
1958
- key: `sys-${ee(s)}`,
1959
- role: o,
1960
- messages: [s],
1979
+ key: `sys-${ee(a)}`,
1980
+ role: d,
1981
+ messages: [a],
1961
1982
  items: [],
1962
- systemLabel: this.systemLabel(s)
1983
+ systemLabel: this.systemLabel(a)
1963
1984
  });
1964
1985
  continue;
1965
1986
  }
1966
- const d = t[t.length - 1];
1967
- d && d.role === o && (o === "ai" || d.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? d.messages.push(s) : t.push({
1968
- key: `g-${ee(s)}`,
1969
- role: o,
1970
- agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
1971
- agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
1972
- messages: [s],
1987
+ const v = t[t.length - 1];
1988
+ v && v.role === d && (d === "ai" || v.agentName === (((o = a == null ? void 0 : a.author) == null ? void 0 : o.name) || "")) ? v.messages.push(a) : t.push({
1989
+ key: `g-${ee(a)}`,
1990
+ role: d,
1991
+ agentName: ((r = a == null ? void 0 : a.author) == null ? void 0 : r.name) || "",
1992
+ agentAvatarUrl: ((s = a == null ? void 0 : a.author) == null ? void 0 : s.avatar_url) || null,
1993
+ messages: [a],
1973
1994
  items: []
1974
1995
  });
1975
1996
  }
1976
- for (const s of t) {
1977
- if (s.role === "system") continue;
1978
- const o = [];
1979
- for (const d of s.messages)
1980
- for (const v of this.itemsOf(d)) o.push(v);
1981
- s.items = o;
1997
+ for (const a of t) {
1998
+ if (a.role === "system") continue;
1999
+ const d = [];
2000
+ for (const v of a.messages)
2001
+ for (const C of this.itemsOf(v)) d.push(C);
2002
+ a.items = d;
2003
+ }
2004
+ const e = [];
2005
+ for (const a of t) {
2006
+ if (a.role !== "system" && !a.items.length) continue;
2007
+ const d = e[e.length - 1];
2008
+ if (d && d.role !== "system" && d.role === a.role && (a.role === "ai" || d.agentName === a.agentName)) {
2009
+ d.messages.push(...a.messages), d.items.push(...a.items);
2010
+ continue;
2011
+ }
2012
+ e.push(a);
1982
2013
  }
1983
- return t;
2014
+ return e;
1984
2015
  },
1985
2016
  // Key of the first non-user group that starts after the unread anchor.
1986
2017
  // ISO 8601 timestamps sort lexicographically, so a string `>` compare
@@ -2051,18 +2082,18 @@ const hs = {
2051
2082
  const e = this._lastSeenConvId !== this.conversationId;
2052
2083
  this._lastSeenConvId = this.conversationId;
2053
2084
  const n = this.isAtBottom(t);
2054
- let a = null;
2085
+ let o = null;
2055
2086
  if (!e && !n) {
2056
2087
  const s = this.pickAnchor(t);
2057
2088
  if (s != null && s.el) {
2058
- const o = t.getBoundingClientRect().top;
2059
- a = {
2089
+ const a = t.getBoundingClientRect().top;
2090
+ o = {
2060
2091
  el: s.el,
2061
- relY: s.el.getBoundingClientRect().top - o
2092
+ relY: s.el.getBoundingClientRect().top - a
2062
2093
  };
2063
2094
  }
2064
2095
  }
2065
- const r = { forceBottom: e, wasPinned: n, anchor: a };
2096
+ const r = { forceBottom: e, wasPinned: n, anchor: o };
2066
2097
  this._scrollSnap = r, this.$nextTick(() => {
2067
2098
  if (this._scrollSnap = null, r.forceBottom || r.wasPinned) {
2068
2099
  t.scrollTop = t.scrollHeight;
@@ -2070,10 +2101,10 @@ const hs = {
2070
2101
  }
2071
2102
  if (!r.anchor) return;
2072
2103
  const s = () => {
2073
- var k;
2074
- const o = r.anchor;
2075
- if (!((k = o.el) != null && k.isConnected)) return;
2076
- const v = o.el.getBoundingClientRect().top - t.getBoundingClientRect().top - o.relY;
2104
+ var C;
2105
+ const a = r.anchor;
2106
+ if (!((C = a.el) != null && C.isConnected)) return;
2107
+ const v = a.el.getBoundingClientRect().top - t.getBoundingClientRect().top - a.relY;
2077
2108
  Math.abs(v) > 0.5 && (t.scrollTop += v);
2078
2109
  };
2079
2110
  s(), requestAnimationFrame(() => {
@@ -2102,15 +2133,15 @@ const hs = {
2102
2133
  pickAnchor(t) {
2103
2134
  const e = t.scrollTop;
2104
2135
  let n = null;
2105
- for (const a of t.children)
2106
- if (a.classList.contains("wm-list__group") && (n || (n = a), a.offsetTop + a.offsetHeight >= e))
2107
- return { el: a, offsetTop: a.offsetTop };
2136
+ for (const o of t.children)
2137
+ if (o.classList.contains("wm-list__group") && (n || (n = o), o.offsetTop + o.offsetHeight >= e))
2138
+ return { el: o, offsetTop: o.offsetTop };
2108
2139
  return n ? { el: n, offsetTop: n.offsetTop } : null;
2109
2140
  },
2110
2141
  roleOf(t) {
2111
- var n, a;
2142
+ var n, o;
2112
2143
  if ((t == null ? void 0 : t.type) === "system" || ((n = t == null ? void 0 : t.payload) == null ? void 0 : n.type) === "system") return "system";
2113
- const e = (a = t == null ? void 0 : t.author) == null ? void 0 : a.type;
2144
+ const e = (o = t == null ? void 0 : t.author) == null ? void 0 : o.type;
2114
2145
  return e === "user" ? "user" : e === "agent_human" ? "human" : "ai";
2115
2146
  },
2116
2147
  roleLabel(t) {
@@ -2197,10 +2228,10 @@ const hs = {
2197
2228
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2198
2229
  // doit garder son arrondi.
2199
2230
  cornersFor(t, e) {
2200
- var Y, z, Q;
2201
- const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Q = n[e + 1]) == null ? void 0 : Q.kind, o = t.role === "user", d = 14, v = 4, k = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], R = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, Z) => W != null && S != null ? W + U >= S : V === Z || V === "card" && Z === "bubble";
2202
- let j = d, P = d, F = d, H = d;
2203
- return o ? (k && (P = v), (w || !s) && (F = v), k && x(R, k, a == null ? void 0 : a.top) && (j = v), w && x(A, w, a == null ? void 0 : a.bottom) && (H = v)) : (k && (j = v), (w || !s) && (H = v), k && x(R, k, a == null ? void 0 : a.top) && (P = v), w && x(A, w, a == null ? void 0 : a.bottom) && (F = v)), { tl: j, tr: P, br: F, bl: H };
2231
+ var Y, z, Z;
2232
+ const n = t.items, o = (Y = n[e]) == null ? void 0 : Y.kind, r = (z = n[e - 1]) == null ? void 0 : z.kind, s = (Z = n[e + 1]) == null ? void 0 : Z.kind, a = t.role === "user", d = 14, v = 4, C = r == null ? void 0 : r.bottom, w = s == null ? void 0 : s.top, S = this.widthByKey[this.rowKeyOf(t, e)], F = this.widthByKey[this.rowKeyOf(t, e - 1)], A = this.widthByKey[this.rowKeyOf(t, e + 1)], U = 0.5, x = (W, V, Q) => W != null && S != null ? W + U >= S : V === Q || V === "card" && Q === "bubble";
2233
+ let j = d, P = d, R = d, H = d;
2234
+ return a ? (C && (P = v), (w || !s) && (R = v), C && x(F, C, o == null ? void 0 : o.top) && (j = v), w && x(A, w, o == null ? void 0 : o.bottom) && (H = v)) : (C && (j = v), (w || !s) && (H = v), C && x(F, C, o == null ? void 0 : o.top) && (P = v), w && x(A, w, o == null ? void 0 : o.bottom) && (R = v)), { tl: j, tr: P, br: R, bl: H };
2204
2235
  },
2205
2236
  // Inline style emitting the four corner CSS variables. Set on
2206
2237
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2219,8 +2250,8 @@ const hs = {
2219
2250
  // Clé unique par item de cluster, alignée avec `:key` /
2220
2251
  // `data-row-key` du template. Sert d'index dans `widthByKey`.
2221
2252
  rowKeyOf(t, e) {
2222
- var a;
2223
- const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
2253
+ var o;
2254
+ const n = (o = t == null ? void 0 : t.items) == null ? void 0 : o[e];
2224
2255
  return n ? `${ee(n.message)}-${n.partKey}` : "";
2225
2256
  },
2226
2257
  // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
@@ -2239,18 +2270,18 @@ const hs = {
2239
2270
  if (!t) return;
2240
2271
  const e = {};
2241
2272
  for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
2242
- const o = s.dataset.rowKey;
2243
- if (!o) continue;
2273
+ const a = s.dataset.rowKey;
2274
+ if (!a) continue;
2244
2275
  const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2245
2276
  if (!d) continue;
2246
2277
  const v = d.getBoundingClientRect().width;
2247
- v > 0 && (e[o] = v);
2278
+ v > 0 && (e[a] = v);
2248
2279
  }
2249
- const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
2250
- if (a.length === r.length) {
2280
+ const n = this.widthByKey, o = Object.keys(n), r = Object.keys(e);
2281
+ if (o.length === r.length) {
2251
2282
  let s = !0;
2252
- for (const o of r)
2253
- if (Math.abs((n[o] ?? 0) - e[o]) > 0.5) {
2283
+ for (const a of r)
2284
+ if (Math.abs((n[a] ?? 0) - e[a]) > 0.5) {
2254
2285
  s = !1;
2255
2286
  break;
2256
2287
  }
@@ -2262,7 +2293,7 @@ const hs = {
2262
2293
  const e = t.items[t.items.length - 1], n = (e == null ? void 0 : e.message) || t.messages[t.messages.length - 1];
2263
2294
  if (!(n != null && n.created_at)) return "";
2264
2295
  try {
2265
- return ke(new Date(n.created_at));
2296
+ return be(new Date(n.created_at));
2266
2297
  } catch {
2267
2298
  return "";
2268
2299
  }
@@ -2295,19 +2326,19 @@ const hs = {
2295
2326
  return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
2296
2327
  },
2297
2328
  actionDetail(t) {
2298
- var n, a, r, s, o, d;
2329
+ var n, o, r, s, a, d;
2299
2330
  const e = t == null ? void 0 : t.payload;
2300
- return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
2331
+ return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (o = e.success) == null ? void 0 : o.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((a = e.failure) == null ? void 0 : a.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
2301
2332
  },
2302
2333
  actionArtifact(t) {
2303
- var n, a;
2304
- const e = (a = (n = t == null ? void 0 : t.payload) == null ? void 0 : n.success) == null ? void 0 : a.artifact;
2334
+ var n, o;
2335
+ const e = (o = (n = t == null ? void 0 : t.payload) == null ? void 0 : n.success) == null ? void 0 : o.artifact;
2305
2336
  return !e || typeof e != "object" || typeof e.kind != "string" ? null : e;
2306
2337
  },
2307
2338
  systemLabel(t) {
2308
- var r, s, o;
2309
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = hs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2310
- return n.replace("{name}", a || "Un agent");
2339
+ var r, s, a;
2340
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = hs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", o = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((a = t == null ? void 0 : t.author) == null ? void 0 : a.name) || "";
2341
+ return n.replace("{name}", o || "Un agent");
2311
2342
  },
2312
2343
  scrollToBottom() {
2313
2344
  const t = this.$refs.scrollEl;
@@ -2344,11 +2375,11 @@ const hs = {
2344
2375
  key: 3,
2345
2376
  class: "wm-list__row wm-list__row--ai fade-up"
2346
2377
  }, Is = { class: "wm-list__avatarSlot" };
2347
- function Bs(t, e, n, a, r, s) {
2348
- const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
2378
+ function Bs(t, e, n, o, r, s) {
2379
+ const a = B("AIAvatar"), d = B("HumanAvatar"), v = B("ActionResult"), C = B("ArtifactRenderer"), w = B("Bubble"), S = B("AttachmentPreview"), F = B("Typing");
2349
2380
  return l(), c("div", {
2350
2381
  ref: "scrollEl",
2351
- class: B(["wm-list", { "wm-list--silent": r.silentFades }]),
2382
+ class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
2352
2383
  onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2353
2384
  }, [
2354
2385
  n.loadingMore ? (l(), c("div", ps, [...e[1] || (e[1] = [
@@ -2357,117 +2388,117 @@ function Bs(t, e, n, a, r, s) {
2357
2388
  "aria-hidden": "true"
2358
2389
  }, null, -1),
2359
2390
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2360
- ])])) : s.historyExhausted ? (l(), c("div", vs, "Début de la conversation")) : g("", !0),
2391
+ ])])) : s.historyExhausted ? (l(), c("div", vs, "Début de la conversation")) : y("", !0),
2361
2392
  n.dateLabel ? (l(), c("div", gs, [
2362
2393
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2363
2394
  i("span", ys, b(n.dateLabel), 1),
2364
2395
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2365
- ])) : g("", !0),
2366
- (l(!0), c(T, null, D(s.groups, (A, U) => (l(), c(T, {
2396
+ ])) : y("", !0),
2397
+ (l(!0), c(M, null, N(s.groups, (A, U) => (l(), c(M, {
2367
2398
  key: A.key
2368
2399
  }, [
2369
2400
  A.key === s.unreadGroupKey ? (l(), c("div", ws, [...e[4] || (e[4] = [
2370
2401
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2371
2402
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2372
2403
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
2373
- ])])) : g("", !0),
2404
+ ])])) : y("", !0),
2374
2405
  A.role === "system" || A.items.length ? (l(), c("div", {
2375
2406
  key: 1,
2376
- class: B(["wm-list__group", "wm-list__group--" + A.role])
2407
+ class: E(["wm-list__group", "wm-list__group--" + A.role])
2377
2408
  }, [
2378
2409
  A.role === "system" ? (l(), c("div", bs, [
2379
2410
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2380
2411
  i("span", ks, b(A.systemLabel), 1),
2381
2412
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2382
- ])) : (l(), c(T, { key: 1 }, [
2383
- (l(!0), c(T, null, D(A.items, (x, j) => (l(), c("div", {
2413
+ ])) : (l(), c(M, { key: 1 }, [
2414
+ (l(!0), c(M, null, N(A.items, (x, j) => (l(), c("div", {
2384
2415
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2385
2416
  "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2386
- class: B(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2417
+ class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2387
2418
  style: G(s.cornersStyle(A, j))
2388
2419
  }, [
2389
2420
  A.role !== "user" ? (l(), c("div", As, [
2390
- j === A.items.length - 1 ? (l(), c(T, { key: 0 }, [
2391
- A.role === "ai" ? (l(), $(o, {
2421
+ j === A.items.length - 1 ? (l(), c(M, { key: 0 }, [
2422
+ A.role === "ai" ? (l(), L(a, {
2392
2423
  key: 0,
2393
2424
  size: 26,
2394
2425
  tail: !0
2395
- })) : (l(), $(d, {
2426
+ })) : (l(), L(d, {
2396
2427
  key: 1,
2397
2428
  name: A.agentName,
2398
2429
  "avatar-url": A.agentAvatarUrl,
2399
2430
  size: 26
2400
2431
  }, null, 8, ["name", "avatar-url"]))
2401
- ], 64)) : g("", !0)
2402
- ])) : g("", !0),
2403
- x.renderAs === "action" ? (l(), $(v, {
2432
+ ], 64)) : y("", !0)
2433
+ ])) : y("", !0),
2434
+ x.renderAs === "action" ? (l(), L(v, {
2404
2435
  key: 1,
2405
2436
  state: x.message.payload.state,
2406
2437
  label: s.actionLabel(x.message),
2407
2438
  detail: s.actionDetail(x.message)
2408
- }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), $(v, {
2439
+ }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), L(v, {
2409
2440
  key: 2,
2410
2441
  state: "awaiting",
2411
2442
  label: "Demande d'approbation envoyée",
2412
2443
  detail: x.message.text_md || ""
2413
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), $(k, {
2444
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), L(C, {
2414
2445
  key: 3,
2415
2446
  artifact: s.actionArtifact(x.message)
2416
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
2447
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), L(C, {
2417
2448
  key: 4,
2418
2449
  artifact: s.artifactOf(x.message)
2419
2450
  }, null, 8, ["artifact"])) : (l(), c("div", Ss, [
2420
- x.message.text_md ? (l(), $(w, {
2451
+ x.message.text_md ? (l(), L(w, {
2421
2452
  key: 0,
2422
2453
  role: A.role,
2423
2454
  text: x.message.text_md
2424
- }, null, 8, ["role", "text"])) : g("", !0),
2455
+ }, null, 8, ["role", "text"])) : y("", !0),
2425
2456
  s.attachmentsOf(x.message).length ? (l(), c("div", {
2426
2457
  key: 1,
2427
- class: B(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2458
+ class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2428
2459
  }, [
2429
- (l(!0), c(T, null, D(s.attachmentsOf(x.message), (P, F) => (l(), $(S, {
2430
- key: `${s.messageKey(x.message)}-att-${F}`,
2460
+ (l(!0), c(M, null, N(s.attachmentsOf(x.message), (P, R) => (l(), L(S, {
2461
+ key: `${s.messageKey(x.message)}-att-${R}`,
2431
2462
  attachment: P
2432
2463
  }, null, 8, ["attachment"]))), 128))
2433
- ], 2)) : g("", !0)
2464
+ ], 2)) : y("", !0)
2434
2465
  ]))
2435
2466
  ], 14, Cs))), 128)),
2436
2467
  (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(), c("div", {
2437
2468
  key: 0,
2438
- class: B(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2469
+ class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2439
2470
  }, [
2440
- A.role !== "user" ? (l(), c("span", xs, b(s.roleLabel(A)), 1)) : g("", !0),
2441
- A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : g("", !0),
2442
- s.lastTimeOf(A) ? (l(), c("span", Ms, b(s.lastTimeOf(A)), 1)) : g("", !0)
2443
- ], 2)) : g("", !0)
2471
+ A.role !== "user" ? (l(), c("span", xs, b(s.roleLabel(A)), 1)) : y("", !0),
2472
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ts, "·")) : y("", !0),
2473
+ s.lastTimeOf(A) ? (l(), c("span", Ms, b(s.lastTimeOf(A)), 1)) : y("", !0)
2474
+ ], 2)) : y("", !0)
2444
2475
  ], 64))
2445
- ], 2)) : g("", !0)
2476
+ ], 2)) : y("", !0)
2446
2477
  ], 64))), 128)),
2447
2478
  n.streamingActive ? (l(), c("div", Os, [
2448
2479
  i("div", Is, [
2449
- K(o, {
2480
+ K(a, {
2450
2481
  size: 26,
2451
2482
  tail: !0
2452
2483
  })
2453
2484
  ]),
2454
- K(R)
2455
- ])) : g("", !0)
2485
+ K(F)
2486
+ ])) : y("", !0)
2456
2487
  ], 34);
2457
2488
  }
2458
- const Es = /* @__PURE__ */ E(_s, [["render", Bs], ["__scopeId", "data-v-6bd35fa5"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
2489
+ const Es = /* @__PURE__ */ $(_s, [["render", Bs], ["__scopeId", "data-v-54959b73"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2459
2490
  function $s() {
2460
- return me && [
2491
+ return he && [
2461
2492
  "video/webm;codecs=vp9,opus",
2462
2493
  "video/webm;codecs=vp8,opus",
2463
2494
  "video/webm",
2464
2495
  "video/mp4"
2465
2496
  ].find((e) => {
2466
- var n, a;
2467
- return (a = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : a.call(n, e);
2497
+ var n, o;
2498
+ return (o = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : o.call(n, e);
2468
2499
  }) || "";
2469
2500
  }
2470
- function Ae({ audio: t }) {
2501
+ function Ce({ audio: t }) {
2471
2502
  return {
2472
2503
  video: !0,
2473
2504
  audio: !!t,
@@ -2483,7 +2514,7 @@ async function Ls() {
2483
2514
  if (!oe) return null;
2484
2515
  let t;
2485
2516
  try {
2486
- t = await navigator.mediaDevices.getDisplayMedia(Ae({ audio: !1 }));
2517
+ t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
2487
2518
  } catch (e) {
2488
2519
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2489
2520
  }
@@ -2500,41 +2531,41 @@ async function Ls() {
2500
2531
  async function Rs(t) {
2501
2532
  const e = document.createElement("video");
2502
2533
  e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2503
- const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
2504
- r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
2534
+ const n = e.videoWidth || 1280, o = e.videoHeight || 720, r = document.createElement("canvas");
2535
+ r.width = n, r.height = o, r.getContext("2d").drawImage(e, 0, 0, n, o);
2505
2536
  const s = await new Promise((d, v) => {
2506
- r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
2507
- }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2508
- return new File([s], `capture-${o}.png`, { type: "image/png" });
2537
+ r.toBlob((C) => C ? d(C) : v(new Error("toBlob failed")), "image/png");
2538
+ }), a = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2539
+ return new File([s], `capture-${a}.png`, { type: "image/png" });
2509
2540
  }
2510
2541
  async function Fs(t = {}) {
2511
- var k;
2512
- if (!oe || !me) return null;
2542
+ var C;
2543
+ if (!oe || !he) return null;
2513
2544
  let e;
2514
2545
  try {
2515
- e = await navigator.mediaDevices.getDisplayMedia(Ae({ audio: !0 }));
2546
+ e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2516
2547
  } catch (w) {
2517
2548
  return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
2518
2549
  }
2519
2550
  const n = $s();
2520
- let a;
2551
+ let o;
2521
2552
  try {
2522
- a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2553
+ o = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2523
2554
  } catch (w) {
2524
2555
  return console.error("[media] recorder init", w), e.getTracks().forEach((S) => {
2525
2556
  S.stop();
2526
2557
  }), null;
2527
2558
  }
2528
2559
  const r = [];
2529
- let s = null, o = !1;
2530
- a.addEventListener("dataavailable", (w) => {
2560
+ let s = null, a = !1;
2561
+ o.addEventListener("dataavailable", (w) => {
2531
2562
  w.data && w.data.size > 0 && r.push(w.data);
2532
- }), a.addEventListener("stop", () => {
2563
+ }), o.addEventListener("stop", () => {
2533
2564
  var w, S;
2534
- if (s && clearInterval(s), e.getTracks().forEach((R) => {
2535
- R.stop();
2565
+ if (s && clearInterval(s), e.getTracks().forEach((F) => {
2566
+ F.stop();
2536
2567
  }), r.length) {
2537
- const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }), U = /mp4/.test(R) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), j = new File([A], `ecran-${x}.${U}`, { type: R });
2568
+ const F = o.mimeType || n || "video/webm", A = new Blob(r, { type: F }), U = /mp4/.test(F) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), j = new File([A], `ecran-${x}.${U}`, { type: F });
2538
2569
  (w = t.onfinalize) == null || w.call(t, j);
2539
2570
  } else
2540
2571
  (S = t.oncancel) == null || S.call(t);
@@ -2542,21 +2573,21 @@ async function Fs(t = {}) {
2542
2573
  w.addEventListener("ended", () => d(), { once: !0 });
2543
2574
  });
2544
2575
  function d() {
2545
- if (!o && (o = !0, a.state !== "inactive"))
2576
+ if (!a && (a = !0, o.state !== "inactive"))
2546
2577
  try {
2547
- a.stop();
2578
+ o.stop();
2548
2579
  } catch (w) {
2549
2580
  console.error("[media] recorder stop", w);
2550
2581
  }
2551
2582
  }
2552
2583
  try {
2553
- a.start(1e3);
2584
+ o.start(1e3);
2554
2585
  } catch (w) {
2555
2586
  return console.error("[media] recorder start", w), e.getTracks().forEach((S) => {
2556
2587
  S.stop();
2557
2588
  }), null;
2558
2589
  }
2559
- (k = t.onstart) == null || k.call(t);
2590
+ (C = t.onstart) == null || C.call(t);
2560
2591
  const v = Date.now();
2561
2592
  return s = setInterval(() => {
2562
2593
  var w;
@@ -2564,11 +2595,11 @@ async function Fs(t = {}) {
2564
2595
  }, 500), {
2565
2596
  stop: d,
2566
2597
  get state() {
2567
- return a.state;
2598
+ return o.state;
2568
2599
  }
2569
2600
  };
2570
2601
  }
2571
- const Ds = [
2602
+ const Ns = [
2572
2603
  {
2573
2604
  action: "file",
2574
2605
  label: "Joindre un fichier",
@@ -2584,7 +2615,7 @@ const Ds = [
2584
2615
  label: "Enregistrer l'écran",
2585
2616
  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"
2586
2617
  }
2587
- ], Ns = {
2618
+ ], Ds = {
2588
2619
  name: "WmComposer",
2589
2620
  props: {
2590
2621
  modelValue: { type: String, default: "" },
@@ -2607,9 +2638,9 @@ const Ds = [
2607
2638
  return !this.disabled && !!this.local.trim();
2608
2639
  },
2609
2640
  attachItems() {
2610
- return Ds.map((t) => ({
2641
+ return Ns.map((t) => ({
2611
2642
  ...t,
2612
- disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !me)
2643
+ disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !he)
2613
2644
  }));
2614
2645
  },
2615
2646
  recordingElapsedLabel() {
@@ -2723,7 +2754,7 @@ const Ds = [
2723
2754
  height: "14",
2724
2755
  "aria-hidden": "true"
2725
2756
  }, Ws = ["d"], Ks = ["placeholder", "disabled"], Gs = { class: "wm-compose__actions" }, Ys = ["title", "aria-label", "disabled"], Js = ["disabled"];
2726
- function Xs(t, e, n, a, r, s) {
2757
+ function Xs(t, e, n, o, r, s) {
2727
2758
  return l(), c("div", js, [
2728
2759
  r.recording ? (l(), c("div", Us, [
2729
2760
  e[8] || (e[8] = i("span", {
@@ -2734,37 +2765,37 @@ function Xs(t, e, n, a, r, s) {
2734
2765
  i("button", {
2735
2766
  type: "button",
2736
2767
  class: "wm-rec__stop",
2737
- onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
2768
+ onClick: e[0] || (e[0] = (...a) => s.stopRecording && s.stopRecording(...a))
2738
2769
  }, "Arrêter")
2739
- ])) : g("", !0),
2770
+ ])) : y("", !0),
2740
2771
  i("form", {
2741
- class: B(["wm-compose", { "has-attach": r.attachOpen }]),
2742
- onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2772
+ class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2773
+ onSubmit: e[7] || (e[7] = X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]))
2743
2774
  }, [
2744
2775
  i("input", {
2745
2776
  ref: "fileEl",
2746
2777
  type: "file",
2747
2778
  hidden: "",
2748
2779
  multiple: "",
2749
- onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
2780
+ onChange: e[1] || (e[1] = (...a) => s.onFile && s.onFile(...a))
2750
2781
  }, null, 544),
2751
2782
  r.attachOpen ? (l(), c("div", {
2752
2783
  key: 0,
2753
2784
  class: "wm-compose__overlay",
2754
- onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2755
- })) : g("", !0),
2785
+ onClick: e[2] || (e[2] = (a) => r.attachOpen = !1)
2786
+ })) : y("", !0),
2756
2787
  r.attachOpen ? (l(), c("div", Hs, [
2757
- (l(!0), c(T, null, D(s.attachItems, (o) => (l(), c("button", {
2758
- key: o.action,
2788
+ (l(!0), c(M, null, N(s.attachItems, (a) => (l(), c("button", {
2789
+ key: a.action,
2759
2790
  type: "button",
2760
2791
  class: "wm-compose__menuItem",
2761
- disabled: o.disabled,
2762
- onClick: (d) => s.onAttachAction(o.action)
2792
+ disabled: a.disabled,
2793
+ onClick: (d) => s.onAttachAction(a.action)
2763
2794
  }, [
2764
2795
  i("span", Vs, [
2765
2796
  (l(), c("svg", qs, [
2766
2797
  i("path", {
2767
- d: o.path,
2798
+ d: a.path,
2768
2799
  stroke: "currentColor",
2769
2800
  "stroke-width": "1.8",
2770
2801
  "stroke-linecap": "round",
@@ -2773,29 +2804,29 @@ function Xs(t, e, n, a, r, s) {
2773
2804
  }, null, 8, Ws)
2774
2805
  ]))
2775
2806
  ]),
2776
- i("span", null, b(o.label), 1)
2807
+ i("span", null, b(a.label), 1)
2777
2808
  ], 8, zs))), 128))
2778
- ])) : g("", !0),
2809
+ ])) : y("", !0),
2779
2810
  q(i("textarea", {
2780
2811
  ref: "inputEl",
2781
- "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2812
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => r.local = a),
2782
2813
  class: "wm-compose__input",
2783
2814
  rows: "3",
2784
2815
  placeholder: n.placeholder,
2785
2816
  disabled: n.disabled,
2786
- onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2787
- onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2817
+ onKeydown: e[4] || (e[4] = (...a) => s.onKeydown && s.onKeydown(...a)),
2818
+ onInput: e[5] || (e[5] = (...a) => s.autosize && s.autosize(...a))
2788
2819
  }, null, 40, Ks), [
2789
2820
  [J, r.local]
2790
2821
  ]),
2791
2822
  i("div", Gs, [
2792
2823
  i("button", {
2793
2824
  type: "button",
2794
- class: B(["wm-compose__icon", { "is-open": r.attachOpen }]),
2825
+ class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
2795
2826
  title: n.attachLabel,
2796
2827
  "aria-label": n.attachLabel,
2797
2828
  disabled: r.recording,
2798
- onClick: e[6] || (e[6] = (o) => r.attachOpen = !r.attachOpen)
2829
+ onClick: e[6] || (e[6] = (a) => r.attachOpen = !r.attachOpen)
2799
2830
  }, [...e[9] || (e[9] = [
2800
2831
  i("svg", {
2801
2832
  width: "13",
@@ -2813,7 +2844,7 @@ function Xs(t, e, n, a, r, s) {
2813
2844
  ])], 10, Ys),
2814
2845
  i("button", {
2815
2846
  type: "submit",
2816
- class: B(["wm-compose__send", { "is-empty": !s.canSend }]),
2847
+ class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
2817
2848
  disabled: !s.canSend,
2818
2849
  "aria-label": "Envoyer"
2819
2850
  }, [...e[10] || (e[10] = [
@@ -2835,7 +2866,7 @@ function Xs(t, e, n, a, r, s) {
2835
2866
  ], 34)
2836
2867
  ]);
2837
2868
  }
2838
- const Qs = /* @__PURE__ */ E(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0"]]), Zs = {
2869
+ const Zs = /* @__PURE__ */ $(Ds, [["render", Xs], ["__scopeId", "data-v-14fa9ec0"]]), Qs = {
2839
2870
  name: "WmSuggestionChips",
2840
2871
  props: {
2841
2872
  items: { type: Array, default: () => [] },
@@ -2853,23 +2884,23 @@ const Qs = /* @__PURE__ */ E(Ns, [["render", Xs], ["__scopeId", "data-v-14fa9ec0
2853
2884
  }
2854
2885
  }
2855
2886
  }, er = ["onClick"];
2856
- function tr(t, e, n, a, r, s) {
2887
+ function tr(t, e, n, o, r, s) {
2857
2888
  return n.items.length ? (l(), c("div", {
2858
2889
  key: s.batchKey,
2859
2890
  class: "wm-chips"
2860
2891
  }, [
2861
- (l(!0), c(T, null, D(n.items, (o, d) => (l(), c("button", {
2892
+ (l(!0), c(M, null, N(n.items, (a, d) => (l(), c("button", {
2862
2893
  key: d,
2863
2894
  type: "button",
2864
2895
  class: "wm-chip",
2865
2896
  style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2866
- onClick: (v) => t.$emit("select", o)
2867
- }, b(o.label), 13, er))), 128))
2868
- ])) : g("", !0);
2897
+ onClick: (v) => t.$emit("select", a)
2898
+ }, b(a.label), 13, er))), 128))
2899
+ ])) : y("", !0);
2869
2900
  }
2870
- const nr = /* @__PURE__ */ E(Zs, [["render", tr], ["__scopeId", "data-v-55aa529d"]]), sr = {
2901
+ const nr = /* @__PURE__ */ $(Qs, [["render", tr], ["__scopeId", "data-v-55aa529d"]]), sr = {
2871
2902
  name: "WmApprovalCard",
2872
- components: { AIAvatar: te },
2903
+ components: { AIAvatar: ne },
2873
2904
  props: {
2874
2905
  action: { type: String, required: !0 },
2875
2906
  detail: { type: String, default: "" },
@@ -2904,16 +2935,16 @@ const nr = /* @__PURE__ */ E(Zs, [["render", tr], ["__scopeId", "data-v-55aa529d
2904
2935
  key: 0,
2905
2936
  class: "wm-approval__detail"
2906
2937
  }, cr = { class: "wm-approval__actions" };
2907
- function ur(t, e, n, a, r, s) {
2908
- const o = I("AIAvatar");
2938
+ function ur(t, e, n, o, r, s) {
2939
+ const a = B("AIAvatar");
2909
2940
  return l(), c("div", rr, [
2910
2941
  i("div", ir, [
2911
2942
  i("div", ar, [
2912
- K(o, { size: 24 })
2943
+ K(a, { size: 24 })
2913
2944
  ]),
2914
2945
  i("div", or, [
2915
2946
  i("div", lr, b(n.action), 1),
2916
- n.detail ? (l(), c("div", dr, b(n.detail), 1)) : g("", !0)
2947
+ n.detail ? (l(), c("div", dr, b(n.detail), 1)) : y("", !0)
2917
2948
  ])
2918
2949
  ]),
2919
2950
  i("div", cr, [
@@ -2922,18 +2953,18 @@ function ur(t, e, n, a, r, s) {
2922
2953
  type: "button",
2923
2954
  class: "wm-approval__btn wm-approval__btn--neutral",
2924
2955
  onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
2925
- }, b(s.rejectLabel), 1)) : g("", !0),
2956
+ }, b(s.rejectLabel), 1)) : y("", !0),
2926
2957
  s.approveId ? (l(), c("button", {
2927
2958
  key: 1,
2928
2959
  type: "button",
2929
2960
  class: "wm-approval__btn wm-approval__btn--primary",
2930
2961
  onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
2931
- }, b(s.approveLabel), 1)) : g("", !0)
2962
+ }, b(s.approveLabel), 1)) : y("", !0)
2932
2963
  ])
2933
2964
  ]);
2934
2965
  }
2935
- const hr = /* @__PURE__ */ E(sr, [["render", ur], ["__scopeId", "data-v-b1be139c"]]);
2936
- let ge = 0;
2966
+ const hr = /* @__PURE__ */ $(sr, [["render", ur], ["__scopeId", "data-v-b1be139c"]]);
2967
+ let ve = 0;
2937
2968
  const mr = /* @__PURE__ */ new Set([
2938
2969
  "text",
2939
2970
  "textarea",
@@ -2944,7 +2975,7 @@ const mr = /* @__PURE__ */ new Set([
2944
2975
  "date"
2945
2976
  ]), fr = {
2946
2977
  name: "WmFormCard",
2947
- components: { AIAvatar: te },
2978
+ components: { AIAvatar: ne },
2948
2979
  props: {
2949
2980
  form: { type: Object, required: !0 },
2950
2981
  readOnly: { type: Boolean, default: !1 },
@@ -2952,8 +2983,8 @@ const mr = /* @__PURE__ */ new Set([
2952
2983
  },
2953
2984
  emits: ["submit"],
2954
2985
  data() {
2955
- return ge += 1, {
2956
- _uid: ge,
2986
+ return ve += 1, {
2987
+ _uid: ve,
2957
2988
  values: {},
2958
2989
  busy: !1,
2959
2990
  error: ""
@@ -2984,8 +3015,8 @@ const mr = /* @__PURE__ */ new Set([
2984
3015
  this.values = e, this.error = "";
2985
3016
  },
2986
3017
  toggleMulti(t, e, n) {
2987
- const a = Array.isArray(this.values[t]) ? this.values[t].slice() : [], r = a.indexOf(e);
2988
- n && r === -1 ? a.push(e) : !n && r !== -1 && a.splice(r, 1), this.values = { ...this.values, [t]: a };
3018
+ const o = Array.isArray(this.values[t]) ? this.values[t].slice() : [], r = o.indexOf(e);
3019
+ n && r === -1 ? o.push(e) : !n && r !== -1 && o.splice(r, 1), this.values = { ...this.values, [t]: o };
2989
3020
  },
2990
3021
  validate() {
2991
3022
  for (const t of this.normalizedFields) {
@@ -3039,27 +3070,27 @@ const mr = /* @__PURE__ */ new Set([
3039
3070
  key: 0,
3040
3071
  class: "wm-form__spinner",
3041
3072
  "aria-hidden": "true"
3042
- }, Dr = {
3073
+ }, Nr = {
3043
3074
  key: 2,
3044
3075
  class: "wm-form__doneLbl"
3045
3076
  };
3046
- function Nr(t, e, n, a, r, s) {
3047
- const o = I("AIAvatar");
3077
+ function Dr(t, e, n, o, r, s) {
3078
+ const a = B("AIAvatar");
3048
3079
  return l(), c("div", _r, [
3049
3080
  i("div", pr, [
3050
3081
  i("div", vr, [
3051
- K(o, { size: 24 })
3082
+ K(a, { size: 24 })
3052
3083
  ]),
3053
3084
  i("div", gr, [
3054
3085
  i("div", yr, b(n.form.title || "Formulaire"), 1),
3055
- n.form.description ? (l(), c("div", wr, b(n.form.description), 1)) : g("", !0)
3086
+ n.form.description ? (l(), c("div", wr, b(n.form.description), 1)) : y("", !0)
3056
3087
  ])
3057
3088
  ]),
3058
3089
  i("form", {
3059
3090
  class: "wm-form__body",
3060
3091
  onSubmit: e[0] || (e[0] = X((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
3061
3092
  }, [
3062
- (l(!0), c(T, null, D(s.normalizedFields, (d) => (l(), c("div", {
3093
+ (l(!0), c(M, null, N(s.normalizedFields, (d) => (l(), c("div", {
3063
3094
  key: d.key,
3064
3095
  class: "wm-form__field"
3065
3096
  }, [
@@ -3067,8 +3098,8 @@ function Nr(t, e, n, a, r, s) {
3067
3098
  for: `wm-f-${r._uid}-${d.key}`,
3068
3099
  class: "wm-form__label"
3069
3100
  }, [
3070
- de(b(d.label), 1),
3071
- d.required ? (l(), c("span", kr, "*")) : g("", !0)
3101
+ te(b(d.label), 1),
3102
+ d.required ? (l(), c("span", kr, "*")) : y("", !0)
3072
3103
  ], 8, br),
3073
3104
  d.type === "text" ? q((l(), c("input", {
3074
3105
  key: 0,
@@ -3137,14 +3168,14 @@ function Nr(t, e, n, a, r, s) {
3137
3168
  disabled: n.readOnly || r.busy
3138
3169
  }, [
3139
3170
  i("option", Ir, b(d.placeholder || "Choisir…"), 1),
3140
- (l(!0), c(T, null, D(d.options, (v) => (l(), c("option", {
3171
+ (l(!0), c(M, null, N(d.options, (v) => (l(), c("option", {
3141
3172
  key: v.value,
3142
3173
  value: v.value
3143
3174
  }, b(v.label), 9, Br))), 128))
3144
3175
  ], 8, Or)), [
3145
3176
  [Be, r.values[d.key]]
3146
3177
  ]) : d.type === "multiselect" ? (l(), c("div", Er, [
3147
- (l(!0), c(T, null, D(d.options, (v) => (l(), c("label", {
3178
+ (l(!0), c(M, null, N(d.options, (v) => (l(), c("label", {
3148
3179
  key: v.value,
3149
3180
  class: "wm-form__multiItem"
3150
3181
  }, [
@@ -3153,26 +3184,26 @@ function Nr(t, e, n, a, r, s) {
3153
3184
  value: v.value,
3154
3185
  checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
3155
3186
  disabled: n.readOnly || r.busy,
3156
- onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
3187
+ onChange: (C) => s.toggleMulti(d.key, v.value, C.target.checked)
3157
3188
  }, null, 40, $r),
3158
3189
  i("span", null, b(v.label), 1)
3159
3190
  ]))), 128))
3160
- ])) : g("", !0)
3191
+ ])) : y("", !0)
3161
3192
  ]))), 128)),
3162
- r.error ? (l(), c("div", Lr, b(r.error), 1)) : g("", !0),
3163
- n.readOnly ? (l(), c("div", Dr, "Réponse envoyée")) : (l(), c("button", {
3193
+ r.error ? (l(), c("div", Lr, b(r.error), 1)) : y("", !0),
3194
+ n.readOnly ? (l(), c("div", Nr, "Réponse envoyée")) : (l(), c("button", {
3164
3195
  key: 1,
3165
3196
  type: "submit",
3166
3197
  class: "wm-form__submit",
3167
3198
  disabled: r.busy
3168
3199
  }, [
3169
- r.busy ? (l(), c("span", Fr)) : g("", !0),
3200
+ r.busy ? (l(), c("span", Fr)) : y("", !0),
3170
3201
  i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3171
3202
  ], 8, Rr))
3172
3203
  ], 32)
3173
3204
  ]);
3174
3205
  }
3175
- const jr = /* @__PURE__ */ E(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76"]]), Ur = {
3206
+ const jr = /* @__PURE__ */ $(fr, [["render", Dr], ["__scopeId", "data-v-64b40f76"]]), Ur = {
3176
3207
  name: "WmFeedback",
3177
3208
  props: {
3178
3209
  busy: { type: Boolean, default: !1 },
@@ -3200,34 +3231,34 @@ const jr = /* @__PURE__ */ E(fr, [["render", Nr], ["__scopeId", "data-v-64b40f76
3200
3231
  key: 1,
3201
3232
  class: "wm-fb__done"
3202
3233
  };
3203
- function Gr(t, e, n, a, r, s) {
3234
+ function Gr(t, e, n, o, r, s) {
3204
3235
  return l(), c("div", Pr, [
3205
3236
  n.done ? (l(), c("div", Kr, [...e[3] || (e[3] = [
3206
- he('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
3207
- ])])) : (l(), c(T, { key: 0 }, [
3237
+ ue('<div class="wm-fb__check" data-v-6f45ff3b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-6f45ff3b><path d="M20 6L9 17l-5-5" data-v-6f45ff3b></path></svg></div><div class="wm-fb__doneTitle" data-v-6f45ff3b>Merci pour votre retour !</div><div class="wm-fb__doneSub" data-v-6f45ff3b>Votre avis a bien été pris en compte.</div>', 3)
3238
+ ])])) : (l(), c(M, { key: 0 }, [
3208
3239
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3209
3240
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3210
3241
  i("div", Hr, [
3211
- (l(!0), c(T, null, D(r.options, (o) => (l(), c("button", {
3212
- key: o.v,
3242
+ (l(!0), c(M, null, N(r.options, (a) => (l(), c("button", {
3243
+ key: a.v,
3213
3244
  type: "button",
3214
- class: B(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
3215
- onClick: (d) => r.sel = o.v
3245
+ class: E(["wm-fb__opt", { "is-selected": r.sel === a.v }]),
3246
+ onClick: (d) => r.sel = a.v
3216
3247
  }, [
3217
- i("span", Vr, b(o.e), 1),
3218
- i("span", qr, b(o.l), 1)
3248
+ i("span", Vr, b(a.e), 1),
3249
+ i("span", qr, b(a.l), 1)
3219
3250
  ], 10, zr))), 128))
3220
3251
  ]),
3221
3252
  i("button", {
3222
3253
  type: "button",
3223
3254
  class: "wm-fb__send",
3224
3255
  disabled: !r.sel || n.busy,
3225
- onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
3256
+ onClick: e[0] || (e[0] = (...a) => s.onSend && s.onSend(...a))
3226
3257
  }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Wr)
3227
3258
  ], 64))
3228
3259
  ]);
3229
3260
  }
3230
- const Yr = /* @__PURE__ */ E(Ur, [["render", Gr], ["__scopeId", "data-v-6f45ff3b"]]);
3261
+ const Yr = /* @__PURE__ */ $(Ur, [["render", Gr], ["__scopeId", "data-v-6f45ff3b"]]);
3231
3262
  function Jr(t) {
3232
3263
  const e = new Date(t);
3233
3264
  return e.setHours(0, 0, 0, 0), e;
@@ -3246,7 +3277,7 @@ const Xr = {
3246
3277
  normalized() {
3247
3278
  return (Array.isArray(this.conversations) ? this.conversations.slice() : []).map((e) => {
3248
3279
  var r;
3249
- const n = e.last_message_at || e.updated_at || e.created_at || null, a = n ? Date.parse(n) : 0;
3280
+ const n = e.last_message_at || e.updated_at || e.created_at || null, o = n ? Date.parse(n) : 0;
3250
3281
  return {
3251
3282
  id: e.id,
3252
3283
  raw: e,
@@ -3255,7 +3286,7 @@ const Xr = {
3255
3286
  // from the cached messages + local read state.
3256
3287
  preview: e._preview || e.last_message_preview || e.preview || ((r = e.metadata) == null ? void 0 : r.last_preview) || "",
3257
3288
  unread: !!e._unread,
3258
- stamp: a
3289
+ stamp: o
3259
3290
  };
3260
3291
  }).sort((e, n) => n.stamp - e.stamp);
3261
3292
  },
@@ -3266,16 +3297,16 @@ const Xr = {
3266
3297
  ) : this.normalized;
3267
3298
  },
3268
3299
  groups() {
3269
- const e = Jr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3270
- for (const o of this.filtered) {
3271
- if (!o.stamp) {
3272
- s.push(o);
3300
+ const e = Jr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, o = [], r = [], s = [];
3301
+ for (const a of this.filtered) {
3302
+ if (!a.stamp) {
3303
+ s.push(a);
3273
3304
  continue;
3274
3305
  }
3275
- o.stamp >= e ? a.push(o) : o.stamp >= n ? r.push(o) : s.push(o);
3306
+ a.stamp >= e ? o.push(a) : a.stamp >= n ? r.push(a) : s.push(a);
3276
3307
  }
3277
3308
  return [
3278
- { key: "today", label: "Aujourd'hui", items: a },
3309
+ { key: "today", label: "Aujourd'hui", items: o },
3279
3310
  { key: "week", label: "Cette semaine", items: r },
3280
3311
  { key: "older", label: "Plus ancien", items: s }
3281
3312
  ];
@@ -3284,7 +3315,7 @@ const Xr = {
3284
3315
  return this.filtered.length > 0;
3285
3316
  }
3286
3317
  }
3287
- }, Qr = { class: "wm-hd" }, Zr = {
3318
+ }, Zr = { class: "wm-hd" }, Qr = {
3288
3319
  class: "wm-hd__panel",
3289
3320
  role: "dialog",
3290
3321
  "aria-label": "Vos discussions"
@@ -3299,13 +3330,13 @@ const Xr = {
3299
3330
  key: 0,
3300
3331
  class: "wm-hd__empty"
3301
3332
  };
3302
- function _i(t, e, n, a, r, s) {
3303
- return l(), c("div", Qr, [
3333
+ function _i(t, e, n, o, r, s) {
3334
+ return l(), c("div", Zr, [
3304
3335
  i("div", {
3305
3336
  class: "wm-hd__scrim",
3306
- onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3337
+ onClick: e[0] || (e[0] = (a) => t.$emit("close"))
3307
3338
  }),
3308
- i("aside", Zr, [
3339
+ i("aside", Qr, [
3309
3340
  i("div", ei, [
3310
3341
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3311
3342
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
@@ -3315,7 +3346,7 @@ function _i(t, e, n, a, r, s) {
3315
3346
  type: "button",
3316
3347
  class: "wm-hd__close",
3317
3348
  "aria-label": "Fermer",
3318
- onClick: e[1] || (e[1] = (o) => t.$emit("close"))
3349
+ onClick: e[1] || (e[1] = (a) => t.$emit("close"))
3319
3350
  }, [...e[4] || (e[4] = [
3320
3351
  i("svg", {
3321
3352
  width: "12",
@@ -3336,7 +3367,7 @@ function _i(t, e, n, a, r, s) {
3336
3367
  i("button", {
3337
3368
  type: "button",
3338
3369
  class: "wm-hd__new",
3339
- onClick: e[2] || (e[2] = (o) => t.$emit("new"))
3370
+ onClick: e[2] || (e[2] = (a) => t.$emit("new"))
3340
3371
  }, [...e[6] || (e[6] = [
3341
3372
  i("span", { class: "wm-hd__newIcon" }, [
3342
3373
  i("svg", {
@@ -3372,7 +3403,7 @@ function _i(t, e, n, a, r, s) {
3372
3403
  ])
3373
3404
  ], -1)),
3374
3405
  q(i("input", {
3375
- "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3406
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => r.query = a),
3376
3407
  type: "text",
3377
3408
  placeholder: "Rechercher dans vos messages",
3378
3409
  "aria-label": "Rechercher dans vos messages"
@@ -3382,16 +3413,16 @@ function _i(t, e, n, a, r, s) {
3382
3413
  ])
3383
3414
  ]),
3384
3415
  i("div", si, [
3385
- (l(!0), c(T, null, D(s.groups, (o) => (l(), c(T, {
3386
- key: o.key
3416
+ (l(!0), c(M, null, N(s.groups, (a) => (l(), c(M, {
3417
+ key: a.key
3387
3418
  }, [
3388
- o.items.length ? (l(), c("div", ri, [
3389
- i("div", ii, b(o.label), 1),
3419
+ a.items.length ? (l(), c("div", ri, [
3420
+ i("div", ii, b(a.label), 1),
3390
3421
  i("div", ai, [
3391
- (l(!0), c(T, null, D(o.items, (d) => (l(), c("button", {
3422
+ (l(!0), c(M, null, N(a.items, (d) => (l(), c("button", {
3392
3423
  key: d.id,
3393
3424
  type: "button",
3394
- class: B(["wm-hd__row", {
3425
+ class: E(["wm-hd__row", {
3395
3426
  "wm-hd__row--active": d.id === n.activeId,
3396
3427
  "wm-hd__row--unread": d.unread
3397
3428
  }]),
@@ -3411,7 +3442,7 @@ function _i(t, e, n, a, r, s) {
3411
3442
  opacity: "0.92"
3412
3443
  })
3413
3444
  ], -1)),
3414
- d.unread ? (l(), c("span", di)) : g("", !0)
3445
+ d.unread ? (l(), c("span", di)) : y("", !0)
3415
3446
  ]),
3416
3447
  i("div", ci, [
3417
3448
  i("div", ui, [
@@ -3421,14 +3452,14 @@ function _i(t, e, n, a, r, s) {
3421
3452
  ])
3422
3453
  ], 10, oi))), 128))
3423
3454
  ])
3424
- ])) : g("", !0)
3455
+ ])) : y("", !0)
3425
3456
  ], 64))), 128)),
3426
- s.hasAny ? g("", !0) : (l(), c("div", fi, " Aucun fil pour le moment. "))
3457
+ s.hasAny ? y("", !0) : (l(), c("div", fi, " Aucun fil pour le moment. "))
3427
3458
  ])
3428
3459
  ])
3429
3460
  ]);
3430
3461
  }
3431
- const pi = /* @__PURE__ */ E(Xr, [["render", _i], ["__scopeId", "data-v-1259e822"]]), vi = {
3462
+ const pi = /* @__PURE__ */ $(Xr, [["render", _i], ["__scopeId", "data-v-1259e822"]]), vi = {
3432
3463
  name: "WmMoreMenu",
3433
3464
  props: {
3434
3465
  canRename: { type: Boolean, default: !0 },
@@ -3458,18 +3489,18 @@ const pi = /* @__PURE__ */ E(Xr, [["render", _i], ["__scopeId", "data-v-1259e822
3458
3489
  class: "wm-mm__pop",
3459
3490
  role: "menu"
3460
3491
  }, wi = { class: "wm-mm__section" }, bi = { class: "wm-mm__section" }, ki = { class: "wm-mm__section" };
3461
- function Ci(t, e, n, a, r, s) {
3492
+ function Ci(t, e, n, o, r, s) {
3462
3493
  return l(), c("div", gi, [
3463
3494
  i("div", {
3464
3495
  class: "wm-mm__scrim",
3465
- onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3496
+ onClick: e[0] || (e[0] = (a) => t.$emit("close"))
3466
3497
  }),
3467
3498
  i("div", yi, [
3468
3499
  i("div", wi, [
3469
3500
  i("button", {
3470
3501
  type: "button",
3471
3502
  class: "wm-mm__item",
3472
- onClick: e[1] || (e[1] = (o) => s.emit("history"))
3503
+ onClick: e[1] || (e[1] = (a) => s.emit("history"))
3473
3504
  }, [...e[7] || (e[7] = [
3474
3505
  i("span", { class: "wm-mm__icon" }, [
3475
3506
  i("svg", {
@@ -3492,25 +3523,25 @@ function Ci(t, e, n, a, r, s) {
3492
3523
  key: 0,
3493
3524
  type: "button",
3494
3525
  class: "wm-mm__item",
3495
- onClick: e[2] || (e[2] = (o) => s.emit("rename"))
3526
+ onClick: e[2] || (e[2] = (a) => s.emit("rename"))
3496
3527
  }, [...e[8] || (e[8] = [
3497
- he('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M12 20h9" data-v-3181ad1b></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Modifier le titre</span>', 2)
3498
- ])])) : g("", !0),
3528
+ ue('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M12 20h9" data-v-3181ad1b></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Modifier le titre</span>', 2)
3529
+ ])])) : y("", !0),
3499
3530
  n.canExport ? (l(), c("button", {
3500
3531
  key: 1,
3501
3532
  type: "button",
3502
3533
  class: "wm-mm__item",
3503
- onClick: e[3] || (e[3] = (o) => s.emit("export"))
3534
+ onClick: e[3] || (e[3] = (a) => s.emit("export"))
3504
3535
  }, [...e[9] || (e[9] = [
3505
- he('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3181ad1b>.txt</span>', 3)
3506
- ])])) : g("", !0)
3536
+ ue('<span class="wm-mm__icon" data-v-3181ad1b><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-3181ad1b><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-3181ad1b></path></svg></span><span class="wm-mm__label" data-v-3181ad1b>Exporter la transcription</span><span class="wm-mm__hint" data-v-3181ad1b>.txt</span>', 3)
3537
+ ])])) : y("", !0)
3507
3538
  ]),
3508
3539
  e[15] || (e[15] = i("div", { class: "wm-mm__sep" }, null, -1)),
3509
3540
  i("div", bi, [
3510
3541
  i("button", {
3511
3542
  type: "button",
3512
3543
  class: "wm-mm__item",
3513
- onClick: e[4] || (e[4] = (...o) => s.toggleNotif && s.toggleNotif(...o))
3544
+ onClick: e[4] || (e[4] = (...a) => s.toggleNotif && s.toggleNotif(...a))
3514
3545
  }, [
3515
3546
  e[11] || (e[11] = i("span", { class: "wm-mm__icon" }, [
3516
3547
  i("svg", {
@@ -3529,7 +3560,7 @@ function Ci(t, e, n, a, r, s) {
3529
3560
  ], -1)),
3530
3561
  e[12] || (e[12] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
3531
3562
  i("span", {
3532
- class: B(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3563
+ class: E(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3533
3564
  }, [...e[10] || (e[10] = [
3534
3565
  i("span", { class: "wm-mm__knob" }, null, -1)
3535
3566
  ])], 2)
@@ -3541,7 +3572,7 @@ function Ci(t, e, n, a, r, s) {
3541
3572
  key: 0,
3542
3573
  type: "button",
3543
3574
  class: "wm-mm__item",
3544
- onClick: e[5] || (e[5] = (o) => s.emit("status"))
3575
+ onClick: e[5] || (e[5] = (a) => s.emit("status"))
3545
3576
  }, [...e[13] || (e[13] = [
3546
3577
  i("span", { class: "wm-mm__icon" }, [
3547
3578
  i("svg", {
@@ -3559,12 +3590,12 @@ function Ci(t, e, n, a, r, s) {
3559
3590
  ])
3560
3591
  ], -1),
3561
3592
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3562
- ])])) : g("", !0),
3593
+ ])])) : y("", !0),
3563
3594
  n.helpUrl ? (l(), c("button", {
3564
3595
  key: 1,
3565
3596
  type: "button",
3566
3597
  class: "wm-mm__item",
3567
- onClick: e[6] || (e[6] = (o) => s.emit("help"))
3598
+ onClick: e[6] || (e[6] = (a) => s.emit("help"))
3568
3599
  }, [...e[14] || (e[14] = [
3569
3600
  i("span", { class: "wm-mm__icon" }, [
3570
3601
  i("svg", {
@@ -3582,12 +3613,12 @@ function Ci(t, e, n, a, r, s) {
3582
3613
  ])
3583
3614
  ], -1),
3584
3615
  i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
3585
- ])])) : g("", !0)
3616
+ ])])) : y("", !0)
3586
3617
  ])
3587
3618
  ])
3588
3619
  ]);
3589
3620
  }
3590
- const Ai = /* @__PURE__ */ E(vi, [["render", Ci], ["__scopeId", "data-v-3181ad1b"]]), Si = {
3621
+ const Ai = /* @__PURE__ */ $(vi, [["render", Ci], ["__scopeId", "data-v-3181ad1b"]]), Si = {
3591
3622
  name: "WmRenameDialog",
3592
3623
  props: {
3593
3624
  title: { type: String, default: "Modifier le titre" },
@@ -3626,11 +3657,11 @@ const Ai = /* @__PURE__ */ E(vi, [["render", Ci], ["__scopeId", "data-v-3181ad1b
3626
3657
  role: "dialog",
3627
3658
  "aria-modal": "true"
3628
3659
  }, Mi = { class: "wm-dialog__head" }, Oi = { class: "wm-dialog__title" }, Ii = { class: "wm-dialog__body" }, Bi = ["placeholder"], Ei = { class: "wm-dialog__actions" }, $i = ["disabled"];
3629
- function Li(t, e, n, a, r, s) {
3660
+ function Li(t, e, n, o, r, s) {
3630
3661
  return l(), c("div", xi, [
3631
3662
  i("div", {
3632
3663
  class: "wm-dialog__scrim",
3633
- onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3664
+ onClick: e[0] || (e[0] = (a) => t.$emit("close"))
3634
3665
  }),
3635
3666
  i("div", Ti, [
3636
3667
  i("div", Mi, [
@@ -3639,7 +3670,7 @@ function Li(t, e, n, a, r, s) {
3639
3670
  type: "button",
3640
3671
  class: "wm-dialog__close",
3641
3672
  "aria-label": "Fermer",
3642
- onClick: e[1] || (e[1] = (o) => t.$emit("close"))
3673
+ onClick: e[1] || (e[1] = (a) => t.$emit("close"))
3643
3674
  }, [...e[7] || (e[7] = [
3644
3675
  i("svg", {
3645
3676
  width: "12",
@@ -3659,14 +3690,14 @@ function Li(t, e, n, a, r, s) {
3659
3690
  i("div", Ii, [
3660
3691
  q(i("input", {
3661
3692
  ref: "input",
3662
- "onUpdate:modelValue": e[2] || (e[2] = (o) => r.value = o),
3693
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => r.value = a),
3663
3694
  type: "text",
3664
3695
  class: "wm-dialog__input",
3665
3696
  placeholder: n.placeholder,
3666
3697
  maxlength: 120,
3667
3698
  onKeydown: [
3668
- e[3] || (e[3] = ae(X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]), ["enter"])),
3669
- e[4] || (e[4] = ae(X((o) => t.$emit("close"), ["prevent"]), ["esc"]))
3699
+ e[3] || (e[3] = ae(X((...a) => s.onSubmit && s.onSubmit(...a), ["prevent"]), ["enter"])),
3700
+ e[4] || (e[4] = ae(X((a) => t.$emit("close"), ["prevent"]), ["esc"]))
3670
3701
  ]
3671
3702
  }, null, 40, Bi), [
3672
3703
  [J, r.value]
@@ -3676,19 +3707,19 @@ function Li(t, e, n, a, r, s) {
3676
3707
  i("button", {
3677
3708
  type: "button",
3678
3709
  class: "wm-dialog__btn",
3679
- onClick: e[5] || (e[5] = (o) => t.$emit("close"))
3710
+ onClick: e[5] || (e[5] = (a) => t.$emit("close"))
3680
3711
  }, "Annuler"),
3681
3712
  i("button", {
3682
3713
  type: "button",
3683
3714
  class: "wm-dialog__btn wm-dialog__btn--primary",
3684
3715
  disabled: !s.canSubmit,
3685
- onClick: e[6] || (e[6] = (...o) => s.onSubmit && s.onSubmit(...o))
3716
+ onClick: e[6] || (e[6] = (...a) => s.onSubmit && s.onSubmit(...a))
3686
3717
  }, "Enregistrer", 8, $i)
3687
3718
  ])
3688
3719
  ])
3689
3720
  ]);
3690
3721
  }
3691
- const Ri = /* @__PURE__ */ E(Si, [["render", Li], ["__scopeId", "data-v-4f4b37c9"]]), ye = "ww-messenger-tokens";
3722
+ const Ri = /* @__PURE__ */ $(Si, [["render", Li], ["__scopeId", "data-v-4f4b37c9"]]), ge = "ww-messenger-tokens";
3692
3723
  function ie(t) {
3693
3724
  var n;
3694
3725
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
@@ -3696,40 +3727,40 @@ function ie(t) {
3696
3727
  }
3697
3728
  function Fi(t, e) {
3698
3729
  if (!t || !e) return "";
3699
- const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3730
+ const n = Array.isArray(t.fields) ? t.fields : [], o = [];
3700
3731
  for (const r of n) {
3701
3732
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
3702
3733
  const s = e[r.key];
3703
3734
  if (s == null || s === "") continue;
3704
- let o;
3735
+ let a;
3705
3736
  if (Array.isArray(s)) {
3706
- if (o = s.map((d) => le(r, String(d))).join(", "), !o) continue;
3707
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
3708
- a.push(`${r.label} :
3709
- ${o}`);
3737
+ if (a = s.map((d) => le(r, String(d))).join(", "), !a) continue;
3738
+ } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
3739
+ o.push(`${r.label} :
3740
+ ${a}`);
3710
3741
  }
3711
- return a.join(`
3742
+ return o.join(`
3712
3743
 
3713
3744
  `);
3714
3745
  }
3715
3746
  function le(t, e) {
3716
3747
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
3717
- const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3748
+ const n = t.options.find((o) => (o == null ? void 0 : o.value) === e);
3718
3749
  return (n == null ? void 0 : n.label) || e;
3719
3750
  }
3720
- function Di(t, e) {
3721
- const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3722
- for (const r of a) {
3751
+ function Ni(t, e) {
3752
+ const n = [], o = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3753
+ for (const r of o) {
3723
3754
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
3724
3755
  const s = e == null ? void 0 : e[r.key];
3725
3756
  if (s == null || s === "") continue;
3726
- let o;
3757
+ let a;
3727
3758
  if (Array.isArray(s)) {
3728
- if (o = s.map((v) => le(r, String(v))).join(", "), !o) continue;
3729
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
3730
- const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3759
+ if (a = s.map((v) => le(r, String(v))).join(", "), !a) continue;
3760
+ } else typeof s == "boolean" ? a = s ? "Oui" : "Non" : a = le(r, String(s));
3761
+ const d = r.type === "textarea" || typeof a == "string" && (a.length > 60 || a.includes(`
3731
3762
  `));
3732
- n.push({ label: r.label, value: o, multiline: d });
3763
+ n.push({ label: r.label, value: a, multiline: d });
3733
3764
  }
3734
3765
  return {
3735
3766
  kind: "form_response",
@@ -3739,14 +3770,14 @@ function Di(t, e) {
3739
3770
  }
3740
3771
  };
3741
3772
  }
3742
- const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3773
+ const Di = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3743
3774
  name: "Messenger",
3744
3775
  components: {
3745
3776
  Launcher: Ge,
3746
3777
  Header: wt,
3747
3778
  Onboarding: zt,
3748
3779
  MessageList: Es,
3749
- Composer: Qs,
3780
+ Composer: Zs,
3750
3781
  SuggestionChips: nr,
3751
3782
  ApprovalCard: hr,
3752
3783
  FormCard: jr,
@@ -3933,9 +3964,9 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3933
3964
  drawerConversations() {
3934
3965
  var n;
3935
3966
  const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
3936
- return this.allConversations.map((a) => {
3937
- const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", d = this.lastMessageAuthorType(r), v = !!s && d !== "user" && (!o || s > o);
3938
- return { ...a, _preview: this.convPreview(a, r), _unread: v };
3967
+ return this.allConversations.map((o) => {
3968
+ const r = e[o.id] || [], s = this.convLastActivity(o, r), a = t[o.id] || "", d = this.lastMessageAuthorType(r), v = !!s && d !== "user" && (!a || s > a);
3969
+ return { ...o, _preview: this.convPreview(o, r), _unread: v };
3939
3970
  });
3940
3971
  },
3941
3972
  // How many threads have an unseen agent/human message. Drives the
@@ -3956,7 +3987,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3956
3987
  preview: n._preview || "Nouveau message",
3957
3988
  unread: !!n._unread,
3958
3989
  _ts: this.convLastActivity(n, t[n.id] || [])
3959
- })).sort((n, a) => n._ts < a._ts ? 1 : n._ts > a._ts ? -1 : 0).slice(0, 5);
3990
+ })).sort((n, o) => n._ts < o._ts ? 1 : n._ts > o._ts ? -1 : 0).slice(0, 5);
3960
3991
  },
3961
3992
  // The unread thread with the freshest activity — what the étiquette
3962
3993
  // previews. `{ convId, preview, ts }` or null when nothing's unread.
@@ -3964,10 +3995,10 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
3964
3995
  var n;
3965
3996
  const t = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
3966
3997
  let e = null;
3967
- for (const a of this.drawerConversations) {
3968
- if (!a._unread) continue;
3969
- const r = this.convLastActivity(a, t[a.id] || []);
3970
- (!e || r > e.ts) && (e = { convId: a.id, preview: a._preview, ts: r });
3998
+ for (const o of this.drawerConversations) {
3999
+ if (!o._unread) continue;
4000
+ const r = this.convLastActivity(o, t[o.id] || []);
4001
+ (!e || r > e.ts) && (e = { convId: o.id, preview: o._preview, ts: r });
3971
4002
  }
3972
4003
  return e;
3973
4004
  },
@@ -4004,14 +4035,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4004
4035
  var n;
4005
4036
  const t = (n = this.widget) == null ? void 0 : n.quick_links;
4006
4037
  if (!Array.isArray(t)) return "";
4007
- const e = t.find((a) => a.icon === "status" && a.url);
4038
+ const e = t.find((o) => o.icon === "status" && o.url);
4008
4039
  return (e == null ? void 0 : e.url) || "";
4009
4040
  },
4010
4041
  helpUrl() {
4011
4042
  var n;
4012
4043
  const t = (n = this.widget) == null ? void 0 : n.quick_links;
4013
4044
  if (!Array.isArray(t)) return "";
4014
- const e = t.find((a) => (a.icon === "chat" || a.icon === "help") && a.url);
4045
+ const e = t.find((o) => (o.icon === "chat" || o.icon === "help") && o.url);
4015
4046
  return (e == null ? void 0 : e.url) || "";
4016
4047
  },
4017
4048
  widget() {
@@ -4045,11 +4076,11 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4045
4076
  return ((t = this.widget) == null ? void 0 : t.response_time_label) || "";
4046
4077
  },
4047
4078
  humanMessageAuthor() {
4048
- var e, n, a;
4079
+ var e, n, o;
4049
4080
  if (!this.currentConv) return null;
4050
4081
  const t = ((e = this.s.messagesByConv) == null ? void 0 : e[this.currentConv.id]) || [];
4051
4082
  for (let r = t.length - 1; r >= 0; r--)
4052
- if (((a = (n = t[r]) == null ? void 0 : n.author) == null ? void 0 : a.type) === "agent_human") return t[r].author;
4083
+ if (((o = (n = t[r]) == null ? void 0 : n.author) == null ? void 0 : o.type) === "agent_human") return t[r].author;
4053
4084
  return null;
4054
4085
  },
4055
4086
  humanAgentName() {
@@ -4081,30 +4112,27 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4081
4112
  displayedMessages() {
4082
4113
  const t = this.currentConv;
4083
4114
  if (!t) return [];
4084
- const e = (r) => {
4085
- var s, o, d, v;
4086
- return (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.type) === "system" || Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length || (d = r == null ? void 0 : r.metadata) != null && d.artifact || (v = r == null ? void 0 : r.metadata) != null && v.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
4087
- }, n = (r) => {
4088
- var s;
4089
- return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
4090
- }, a = this.revealedAt;
4091
- return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => ie(r) ? a[r.id] > 0 : !0).filter(e);
4115
+ const e = this.revealedAt;
4116
+ return (this.s.messagesByConv[t.id] || []).filter((n) => {
4117
+ var o, r, s, a, d;
4118
+ return (n == null ? void 0 : n.type) === "action" && ((o = n == null ? void 0 : n.payload) == null ? void 0 : o.state) === "pending" || ie(n) && !(e[n.id] > 0) ? !1 : (n == null ? void 0 : n.type) === "action" || (n == null ? void 0 : n.type) === "system" || ((r = n == null ? void 0 : n.payload) == null ? void 0 : r.type) === "system" || Array.isArray((s = n == null ? void 0 : n.payload) == null ? void 0 : s.attachments) && n.payload.attachments.length || (a = n == null ? void 0 : n.metadata) != null && a.artifact || (d = n == null ? void 0 : n.metadata) != null && d.form ? !0 : typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0;
4119
+ });
4092
4120
  },
4093
4121
  // True whenever we should show the "typing" indicator at the bottom
4094
4122
  // of the list: either the LLM is actively streaming tokens, or one
4095
4123
  // or more agent messages are queued and waiting for their reveal
4096
4124
  // slot to fire.
4097
4125
  streamingActive() {
4098
- var n, a, r;
4126
+ var n, o, r;
4099
4127
  const t = this.currentConv;
4100
- return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => ie(s) && !(this.revealedAt[s.id] > 0)) : !1;
4128
+ return t ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : (((r = (o = this.s) == null ? void 0 : o.messagesByConv) == null ? void 0 : r[t.id]) || []).some((s) => ie(s) && !(this.revealedAt[s.id] > 0)) : !1;
4101
4129
  },
4102
4130
  // Internal: the raw persisted list for the current conversation. We
4103
4131
  // watch this to detect new agent messages that need to be paced.
4104
4132
  currentConvMessages() {
4105
- var e, n, a;
4133
+ var e, n, o;
4106
4134
  const t = (e = this.currentConv) == null ? void 0 : e.id;
4107
- return t ? ((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t]) || [] : [];
4135
+ return t ? ((o = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : o[t]) || [] : [];
4108
4136
  },
4109
4137
  pendingApproval() {
4110
4138
  return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
@@ -4129,14 +4157,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4129
4157
  return ((e = (t = this.pendingApproval) == null ? void 0 : t.payload) == null ? void 0 : e.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || "Confirmer l'action";
4130
4158
  },
4131
4159
  approvalDetail() {
4132
- var a, r, s, o, d, v;
4133
- const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
4160
+ var o, r, s, a, d, v;
4161
+ const t = (s = (r = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
4134
4162
  if (typeof t == "string" && t.trim())
4135
4163
  return t.trim();
4136
- const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
4164
+ const e = (v = (d = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
4137
4165
  if (!e || typeof e != "object") return "";
4138
4166
  const n = Object.entries(e);
4139
- return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
4167
+ return n.length ? n.slice(0, 2).map(([C, w]) => `${C}: ${w}`).join(" · ") : "";
4140
4168
  },
4141
4169
  actionInFlight() {
4142
4170
  var t, e;
@@ -4168,25 +4196,25 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4168
4196
  return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
4169
4197
  },
4170
4198
  dateLabel() {
4171
- var n, a, r;
4199
+ var n, o, r;
4172
4200
  const t = this.currentConv;
4173
4201
  let e = /* @__PURE__ */ new Date();
4174
4202
  if (t) {
4175
- const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
4176
- if (o) {
4177
- const d = new Date(o);
4203
+ const a = ((r = (((o = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : o[t.id]) || []).find((d) => d == null ? void 0 : d.created_at)) == null ? void 0 : r.created_at) || t.created_at;
4204
+ if (a) {
4205
+ const d = new Date(a);
4178
4206
  Number.isNaN(d.getTime()) || (e = d);
4179
4207
  }
4180
4208
  }
4181
- return `Aujourd'hui · ${ke(e)}`;
4209
+ return `Aujourd'hui · ${be(e)}`;
4182
4210
  },
4183
4211
  // Pagination state for the active conversation. Drives the
4184
4212
  // MessageList's scroll-up history loader. Defaults are safe (no
4185
4213
  // history available, nothing loading) so the loader stays inert
4186
4214
  // until `openConversation` has populated the entry.
4187
4215
  paginationState() {
4188
- var n, a, r;
4189
- const t = (n = this.currentConv) == null ? void 0 : n.id, e = t ? (r = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : r[t] : null;
4216
+ var n, o, r;
4217
+ const t = (n = this.currentConv) == null ? void 0 : n.id, e = t ? (r = (o = this.s) == null ? void 0 : o.paginationByConv) == null ? void 0 : r[t] : null;
4190
4218
  return {
4191
4219
  loading: !!(e != null && e.loading),
4192
4220
  hasMore: !!(e != null && e.nextCursor)
@@ -4224,8 +4252,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4224
4252
  isViewingThread(t, e) {
4225
4253
  var n;
4226
4254
  if (t && !e) {
4227
- const a = (n = this.currentConv) == null ? void 0 : n.id;
4228
- this.unreadAnchorTs = a && this.readState[a] || "", this.unreadBoundaryTs = a ? (/* @__PURE__ */ new Date()).toISOString() : "";
4255
+ const o = (n = this.currentConv) == null ? void 0 : n.id;
4256
+ this.unreadAnchorTs = o && this.readState[o] || "", this.unreadBoundaryTs = o ? (/* @__PURE__ */ new Date()).toISOString() : "";
4229
4257
  } else t || (this.unreadAnchorTs = "", this.unreadBoundaryTs = "");
4230
4258
  },
4231
4259
  // Fresh `pendingApproval` arrival : kick off the settle debounce so
@@ -4274,7 +4302,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4274
4302
  immediate: !0
4275
4303
  },
4276
4304
  currentConvMessages(t) {
4277
- var a;
4305
+ var o;
4278
4306
  if (!Array.isArray(t) || !t.length) return;
4279
4307
  const e = Date.now(), n = { ...this.revealedAt };
4280
4308
  for (const r of t) {
@@ -4288,8 +4316,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4288
4316
  n[r.id] = e;
4289
4317
  continue;
4290
4318
  }
4291
- const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
4292
- if (!o && !d) {
4319
+ const a = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, d = Array.isArray((o = r == null ? void 0 : r.payload) == null ? void 0 : o.attachments) && r.payload.attachments.length > 0;
4320
+ if (!a && !d) {
4293
4321
  n[r.id] = e;
4294
4322
  continue;
4295
4323
  }
@@ -4306,9 +4334,9 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4306
4334
  hasWidgetId: !!this.widgetId,
4307
4335
  hasUserId: !!this.userId,
4308
4336
  hasUserHash: !!this.userHash
4309
- }), typeof document < "u" && !document.getElementById(ye)) {
4337
+ }), typeof document < "u" && !document.getElementById(ge)) {
4310
4338
  const t = document.createElement("style");
4311
- t.id = ye, t.textContent = Pe, document.head.appendChild(t);
4339
+ t.id = ge, t.textContent = Pe, document.head.appendChild(t);
4312
4340
  }
4313
4341
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4314
4342
  },
@@ -4328,12 +4356,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4328
4356
  return;
4329
4357
  }
4330
4358
  this.floatRO = new ResizeObserver((n) => {
4331
- const a = n[0];
4332
- if (!a) return;
4333
- const r = Math.ceil(a.contentRect.height + 8);
4359
+ const o = n[0];
4360
+ if (!o) return;
4361
+ const r = Math.ceil(o.contentRect.height + 8);
4334
4362
  r !== this.floatHeight && (this.floatHeight = r, this.$nextTick(() => {
4335
- var s, o;
4336
- (o = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || o.call(s);
4363
+ var s, a;
4364
+ (a = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || a.call(s);
4337
4365
  }));
4338
4366
  }), this.floatRO.observe(e);
4339
4367
  }
@@ -4354,14 +4382,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4354
4382
  // create/update stamps as a floor.
4355
4383
  convLastActivity(t, e) {
4356
4384
  let n = (t == null ? void 0 : t.last_message_at) || (t == null ? void 0 : t.updated_at) || (t == null ? void 0 : t.created_at) || "";
4357
- for (const a of e)
4358
- a != null && a.created_at && a.created_at > n && (n = a.created_at);
4385
+ for (const o of e)
4386
+ o != null && o.created_at && o.created_at > n && (n = o.created_at);
4359
4387
  return n;
4360
4388
  },
4361
4389
  lastMessageAuthorType(t) {
4362
4390
  var e, n;
4363
- for (let a = t.length - 1; a >= 0; a--) {
4364
- const r = (n = (e = t[a]) == null ? void 0 : e.author) == null ? void 0 : n.type;
4391
+ for (let o = t.length - 1; o >= 0; o--) {
4392
+ const r = (n = (e = t[o]) == null ? void 0 : e.author) == null ? void 0 : n.type;
4365
4393
  if (r) return r;
4366
4394
  }
4367
4395
  return "";
@@ -4370,14 +4398,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4370
4398
  // back to whatever preview the server happened to attach when the
4371
4399
  // thread's messages aren't cached yet (never opened this session).
4372
4400
  convPreview(t, e) {
4373
- var n, a, r;
4401
+ var n, o, r;
4374
4402
  for (let s = e.length - 1; s >= 0; s--) {
4375
- const o = e[s];
4376
- if (!o) continue;
4377
- const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
4403
+ const a = e[s];
4404
+ if (!a) continue;
4405
+ const d = typeof a.text_md == "string" ? a.text_md.trim() : "";
4378
4406
  if (d)
4379
- return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
4380
- const v = (a = o.payload) == null ? void 0 : a.attachments;
4407
+ return (((n = a.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
4408
+ const v = (o = a.payload) == null ? void 0 : o.attachments;
4381
4409
  if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
4382
4410
  }
4383
4411
  return (t == null ? void 0 : t.last_message_preview) || (t == null ? void 0 : t.preview) || ((r = t == null ? void 0 : t.metadata) == null ? void 0 : r.last_preview) || "";
@@ -4407,17 +4435,13 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4407
4435
  // Called when the user opens/starts a thread and whenever the
4408
4436
  // actively-viewed thread receives new messages.
4409
4437
  markConvRead(t) {
4410
- var a, r;
4438
+ var o, r;
4411
4439
  if (!(t != null && t.id) || t._draft) return;
4412
- const e = ((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || [], n = this.convLastActivity(t, e);
4440
+ const e = ((r = (o = this.s) == null ? void 0 : o.messagesByConv) == null ? void 0 : r[t.id]) || [], n = this.convLastActivity(t, e);
4413
4441
  n && this.readState[t.id] !== n && (this.readState = { ...this.readState, [t.id]: n }, this.persistReadState());
4414
4442
  },
4415
4443
  cancelReveals() {
4416
- for (const t of this.revealTimers)
4417
- try {
4418
- clearTimeout(t);
4419
- } catch {
4420
- }
4444
+ for (const t of this.revealTimers) clearTimeout(t);
4421
4445
  this.revealTimers = [];
4422
4446
  },
4423
4447
  // Clears any in-flight settle timer and returns the approval pacing
@@ -4426,14 +4450,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4426
4450
  // switch, on `pendingApproval` cleared (approve/reject/expire), and
4427
4451
  // on unmount.
4428
4452
  resetApprovalPacing() {
4429
- if (this.approvalSettleTimer) {
4430
- try {
4431
- clearTimeout(this.approvalSettleTimer);
4432
- } catch {
4433
- }
4434
- this.approvalSettleTimer = null;
4435
- }
4436
- this.approvalSettled = !0, this.approvalLatchId = null;
4453
+ this.approvalSettleTimer && (clearTimeout(this.approvalSettleTimer), this.approvalSettleTimer = null), this.approvalSettled = !0, this.approvalLatchId = null;
4437
4454
  },
4438
4455
  // Pause the approval card for one settle period. A follow-on bubble
4439
4456
  // from the same SSE burst should land (and start streaming, which
@@ -4443,12 +4460,7 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4443
4460
  // Each call resets the timer; the card reveals only after a full
4444
4461
  // quiet period.
4445
4462
  bumpApprovalSettle(t = 800) {
4446
- if (this.approvalSettled = !1, this.approvalSettleTimer)
4447
- try {
4448
- clearTimeout(this.approvalSettleTimer);
4449
- } catch {
4450
- }
4451
- this.approvalSettleTimer = setTimeout(() => {
4463
+ this.approvalSettled = !1, this.approvalSettleTimer && clearTimeout(this.approvalSettleTimer), this.approvalSettleTimer = setTimeout(() => {
4452
4464
  this.approvalSettled = !0, this.approvalSettleTimer = null;
4453
4465
  }, t);
4454
4466
  },
@@ -4458,22 +4470,18 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4458
4470
  // - inter-bubble gap scales with message length (reading time),
4459
4471
  // bounded by MIN/MAX_BETWEEN_MS.
4460
4472
  scheduleReveal(t) {
4461
- const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4473
+ const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, o = Math.min(
4462
4474
  Pi,
4463
4475
  Math.max(Ui, n * ji)
4464
4476
  ), s = Math.max(
4465
- e + Ni,
4477
+ e + Di,
4466
4478
  this.nextRevealAt + Hi
4467
- ) + a;
4479
+ ) + o;
4468
4480
  this.nextRevealAt = s;
4469
- const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4470
- this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
4471
- }, o);
4481
+ const a = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4482
+ this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((C) => C !== v);
4483
+ }, a);
4472
4484
  this.revealTimers.push(v);
4473
- const k = setTimeout(() => {
4474
- this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== k);
4475
- }, o + 4e3);
4476
- this.revealTimers.push(k);
4477
4485
  },
4478
4486
  async boot() {
4479
4487
  if (!this.canBoot) {
@@ -4490,12 +4498,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4490
4498
  baseUrl: this.baseUrl,
4491
4499
  widgetId: this.widgetId,
4492
4500
  userId: this.userId
4493
- }), this.transport = fe(Fe({
4501
+ }), this.transport = me(Fe({
4494
4502
  baseUrl: this.baseUrl,
4495
4503
  widgetId: this.widgetId,
4496
4504
  userId: this.userId,
4497
4505
  userHash: this.userHash
4498
- })), this.store = fe(Ue(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4506
+ })), this.store = me(Ue(this.transport)), this.hydrateNotifPref(), this.setupNotifications(), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4499
4507
  ready: this.store.state.ready,
4500
4508
  error: this.store.state.error
4501
4509
  });
@@ -4638,14 +4646,14 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4638
4646
  }
4639
4647
  },
4640
4648
  onIncomingNotification(t) {
4641
- var o;
4649
+ var a;
4642
4650
  if (!this.notifEnabled) return;
4643
4651
  const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
4644
4652
  if (!e || !n || !ie(n)) return;
4645
- const a = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
4646
- if (Number.isFinite(a) && a < this.convOpenedAt - 1e3) return;
4653
+ const o = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
4654
+ if (Number.isFinite(o) && o < this.convOpenedAt - 1e3) return;
4647
4655
  const r = typeof document < "u" && document.hidden;
4648
- this.isOpen && !r && ((o = this.currentConv) == null ? void 0 : o.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
4656
+ this.isOpen && !r && ((a = this.currentConv) == null ? void 0 : a.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
4649
4657
  },
4650
4658
  playNotificationSound() {
4651
4659
  if (typeof window > "u") return;
@@ -4659,17 +4667,17 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4659
4667
  e.resume();
4660
4668
  } catch {
4661
4669
  }
4662
- const n = e.currentTime, a = e.createOscillator(), r = e.createGain();
4663
- a.connect(r), r.connect(e.destination), a.type = "sine", a.frequency.setValueAtTime(880, n), a.frequency.exponentialRampToValueAtTime(1320, n + 0.08), r.gain.setValueAtTime(0, n), r.gain.linearRampToValueAtTime(0.12, n + 0.02), r.gain.exponentialRampToValueAtTime(1e-4, n + 0.28), a.start(n), a.stop(n + 0.32);
4670
+ const n = e.currentTime, o = e.createOscillator(), r = e.createGain();
4671
+ o.connect(r), r.connect(e.destination), o.type = "sine", o.frequency.setValueAtTime(880, n), o.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), o.start(n), o.stop(n + 0.32);
4664
4672
  } catch {
4665
4673
  }
4666
4674
  },
4667
4675
  showBrowserNotification(t, e) {
4668
- var o;
4676
+ var a;
4669
4677
  if (typeof Notification > "u" || Notification.permission !== "granted") return;
4670
- const n = this.allConversations.find((d) => d.id === t), a = (n == null ? void 0 : n.name) || ((o = this.widget) == null ? void 0 : o.name) || "Nouveau message", r = typeof (e == null ? void 0 : e.text_md) == "string" ? e.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
4678
+ const n = this.allConversations.find((d) => d.id === t), o = (n == null ? void 0 : n.name) || ((a = this.widget) == null ? void 0 : a.name) || "Nouveau message", r = typeof (e == null ? void 0 : e.text_md) == "string" ? e.text_md.trim() : "", s = r ? r.slice(0, 140) : "Vous avez un nouveau message";
4671
4679
  try {
4672
- const d = new Notification(a, {
4680
+ const d = new Notification(o, {
4673
4681
  body: s,
4674
4682
  tag: `wm-${t}`,
4675
4683
  renotify: !1,
@@ -4728,12 +4736,12 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4728
4736
  if (!(!n || n === e.name))
4729
4737
  try {
4730
4738
  await this.store.patchConversation(e.id, { name: n });
4731
- } catch (a) {
4732
- console.error("[ww-messenger] rename failed", a);
4739
+ } catch (o) {
4740
+ console.error("[ww-messenger] rename failed", o);
4733
4741
  }
4734
4742
  },
4735
4743
  exportCurrentConv() {
4736
- var r, s, o, d, v, k;
4744
+ var r, s, a, d, v, C;
4737
4745
  const t = this.currentConv;
4738
4746
  if (!t) return;
4739
4747
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4743,13 +4751,13 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4743
4751
  ];
4744
4752
  for (const w of e) {
4745
4753
  if (!w) continue;
4746
- const S = ((o = w.author) == null ? void 0 : o.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((v = w.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = w.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), R = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4747
- A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
4754
+ const S = ((a = w.author) == null ? void 0 : a.name) || (((d = w.author) == null ? void 0 : d.type) === "user" ? "Vous" : ((v = w.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((C = w.author) == null ? void 0 : C.type) === "agent_ia" ? "Assistant IA" : "Système"), F = w.created_at ? new Date(w.created_at).toLocaleString("fr-FR") : "", A = (w.text_md || "").trim();
4755
+ A && (n.push(`[${F}] ${S} :`), n.push(A), n.push(""));
4748
4756
  }
4749
- const a = new Blob([n.join(`
4757
+ const o = new Blob([n.join(`
4750
4758
  `)], { type: "text/plain;charset=utf-8" });
4751
4759
  try {
4752
- const w = URL.createObjectURL(a), S = document.createElement("a");
4760
+ const w = URL.createObjectURL(o), S = document.createElement("a");
4753
4761
  S.href = w, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(w), 1e3);
4754
4762
  } catch (w) {
4755
4763
  console.error("[ww-messenger] export failed", w);
@@ -4759,8 +4767,8 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4759
4767
  let e = this.currentConv;
4760
4768
  if (!e && (this.startConv(), e = this.currentConv, !e) || e._draft && (e = await this.ensureRealConv(), !e))
4761
4769
  return;
4762
- const n = e.id, a = this.pendingAttachments.slice();
4763
- this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments: a.length ? a : void 0 });
4770
+ const n = e.id, o = this.pendingAttachments.slice();
4771
+ this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments: o.length ? o : void 0 });
4764
4772
  },
4765
4773
  async onSuggestion(t) {
4766
4774
  const e = t == null ? void 0 : t.label;
@@ -4780,10 +4788,10 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4780
4788
  if (!(e != null && e.form)) return;
4781
4789
  const n = Fi(e.form, t);
4782
4790
  if (!n) return;
4783
- let a = this.currentConv;
4784
- a && (a._draft && (a = await this.ensureRealConv(), !a) || await this.store.send(a.id, n, {
4791
+ let o = this.currentConv;
4792
+ o && (o._draft && (o = await this.ensureRealConv(), !o) || await this.store.send(o.id, n, {
4785
4793
  metadata: {
4786
- artifact: Di(e.form, t)
4794
+ artifact: Ni(e.form, t)
4787
4795
  }
4788
4796
  }));
4789
4797
  },
@@ -4844,37 +4852,37 @@ const Ni = 450, ji = 50, Ui = 900, Pi = 12e3, Hi = 300, zi = {
4844
4852
  class: "wm-actionWait",
4845
4853
  role: "status",
4846
4854
  "aria-live": "polite"
4847
- }, Xi = { class: "wm-actionWait__lbl" }, Qi = {
4855
+ }, Xi = { class: "wm-actionWait__lbl" }, Zi = {
4848
4856
  key: 2,
4849
4857
  class: "wm-attached"
4850
- }, Zi = ["onClick"];
4851
- function ea(t, e, n, a, r, s) {
4852
- const o = I("Launcher"), d = I("Header"), v = I("Onboarding"), k = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), R = I("Feedback"), A = I("SuggestionChips"), U = I("Composer"), x = I("MoreMenu"), j = I("RenameDialog"), P = I("HistoryDrawer");
4858
+ }, Qi = ["onClick"];
4859
+ function ea(t, e, n, o, r, s) {
4860
+ const a = B("Launcher"), d = B("Header"), v = B("Onboarding"), C = B("MessageList"), w = B("ApprovalCard"), S = B("FormCard"), F = B("Feedback"), A = B("SuggestionChips"), U = B("Composer"), x = B("MoreMenu"), j = B("RenameDialog"), P = B("HistoryDrawer");
4853
4861
  return l(), c("div", {
4854
- class: B(["wm-root", `wm-root--${n.displayMode}`])
4862
+ class: E(["wm-root", `wm-root--${n.displayMode}`])
4855
4863
  }, [
4856
- !r.isOpen && !s.isEmbedded ? (l(), $(o, {
4864
+ !r.isOpen && !s.isEmbedded ? (l(), L(a, {
4857
4865
  key: 0,
4858
4866
  "unread-count": s.unreadCount,
4859
4867
  peek: s.launcherPeek,
4860
4868
  onOpen: s.openFromPeek,
4861
- onDismiss: e[0] || (e[0] = (F) => r.labelDismissed = !0)
4862
- }, null, 8, ["unread-count", "peek", "onOpen"])) : g("", !0),
4869
+ onDismiss: e[0] || (e[0] = (R) => r.labelDismissed = !0)
4870
+ }, null, 8, ["unread-count", "peek", "onOpen"])) : y("", !0),
4863
4871
  r.isOpen || s.isEmbedded ? (l(), c("section", {
4864
4872
  key: 1,
4865
- class: B(["wm-panel", `wm-panel--${n.displayMode}`]),
4873
+ class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4866
4874
  style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4867
4875
  role: "dialog",
4868
4876
  "aria-label": "Messenger"
4869
4877
  }, [
4870
4878
  !s.ready && !s.error ? (l(), c("div", Vi, [
4871
- s.isEmbedded ? g("", !0) : (l(), c("button", {
4879
+ s.isEmbedded ? y("", !0) : (l(), c("button", {
4872
4880
  key: 0,
4873
4881
  type: "button",
4874
4882
  class: "wm-loading__close",
4875
4883
  "aria-label": "Réduire",
4876
- onClick: e[1] || (e[1] = (...F) => s.close && s.close(...F))
4877
- }, [...e[7] || (e[7] = [
4884
+ onClick: e[1] || (e[1] = (...R) => s.close && s.close(...R))
4885
+ }, [...e[8] || (e[8] = [
4878
4886
  i("svg", {
4879
4887
  width: "13",
4880
4888
  height: "13",
@@ -4889,11 +4897,11 @@ function ea(t, e, n, a, r, s) {
4889
4897
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4890
4898
  ], -1)
4891
4899
  ])])),
4892
- e[8] || (e[8] = i("div", {
4900
+ e[9] || (e[9] = i("div", {
4893
4901
  class: "wm-loading__spinner",
4894
4902
  "aria-hidden": "true"
4895
4903
  }, null, -1))
4896
- ])) : (l(), c(T, { key: 1 }, [
4904
+ ])) : (l(), c(M, { key: 1 }, [
4897
4905
  K(d, {
4898
4906
  title: s.headerTitle,
4899
4907
  escalated: s.isEscalated,
@@ -4911,7 +4919,7 @@ function ea(t, e, n, a, r, s) {
4911
4919
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4912
4920
  s.error ? (l(), c("div", qi, [
4913
4921
  i("div", Wi, [
4914
- e[10] || (e[10] = i("div", { class: "wm-state__errIcon" }, [
4922
+ e[11] || (e[11] = i("div", { class: "wm-state__errIcon" }, [
4915
4923
  i("svg", {
4916
4924
  width: "14",
4917
4925
  height: "14",
@@ -4927,12 +4935,12 @@ function ea(t, e, n, a, r, s) {
4927
4935
  ])
4928
4936
  ], -1)),
4929
4937
  i("div", null, [
4930
- e[9] || (e[9] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4938
+ e[10] || (e[10] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4931
4939
  i("div", Ki, b(s.error), 1)
4932
4940
  ])
4933
4941
  ])
4934
- ])) : s.currentConv ? (l(), c(T, { key: 2 }, [
4935
- K(k, {
4942
+ ])) : s.currentConv ? (l(), c(M, { key: 2 }, [
4943
+ K(C, {
4936
4944
  ref: "messageList",
4937
4945
  messages: s.displayedMessages,
4938
4946
  "streaming-active": s.streamingActive,
@@ -4946,38 +4954,38 @@ function ea(t, e, n, a, r, s) {
4946
4954
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "unread-boundary-ts", "onLoadMore"]),
4947
4955
  i("div", Gi, [
4948
4956
  s.floatVisible ? (l(), c("div", Yi, [
4949
- s.approvalReady ? (l(), $(w, {
4957
+ s.approvalReady ? (l(), L(w, {
4950
4958
  key: 0,
4951
4959
  action: s.approvalTitle,
4952
4960
  detail: s.approvalDetail,
4953
4961
  callbacks: s.pendingApproval.callbacks,
4954
4962
  onCallback: s.onApprovalCallback
4955
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
4963
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), L(S, {
4956
4964
  key: s.pendingForm.message && s.pendingForm.message.id,
4957
4965
  form: s.pendingForm.form,
4958
4966
  onSubmit: s.onFormSubmit
4959
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(R, {
4967
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), L(F, {
4960
4968
  key: 2,
4961
4969
  busy: r.feedbackBusy,
4962
4970
  done: r.feedbackDone,
4963
4971
  onSubmit: s.onFeedback
4964
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
4972
+ }, null, 8, ["busy", "done", "onSubmit"])) : (l(), L(A, {
4965
4973
  key: 3,
4966
4974
  items: s.suggestions,
4967
4975
  onSelect: s.onSuggestion
4968
4976
  }, null, 8, ["items", "onSelect"]))
4969
- ], 512)) : g("", !0),
4977
+ ], 512)) : y("", !0),
4970
4978
  s.actionInFlight ? (l(), c("div", Ji, [
4971
- e[11] || (e[11] = i("span", {
4979
+ e[12] || (e[12] = i("span", {
4972
4980
  class: "wm-actionWait__spinner",
4973
4981
  "aria-hidden": "true"
4974
4982
  }, null, -1)),
4975
4983
  i("span", Xi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4976
- ])) : (l(), $(U, {
4984
+ ])) : (l(), L(U, {
4977
4985
  key: 2,
4978
4986
  ref: "composer",
4979
4987
  modelValue: r.draft,
4980
- "onUpdate:modelValue": e[2] || (e[2] = (F) => r.draft = F),
4988
+ "onUpdate:modelValue": e[3] || (e[3] = (R) => r.draft = R),
4981
4989
  placeholder: s.composerPlaceholder,
4982
4990
  disabled: !!s.pendingApproval,
4983
4991
  "attach-label": "Joindre un fichier",
@@ -4985,30 +4993,30 @@ function ea(t, e, n, a, r, s) {
4985
4993
  onAttach: s.onAttach
4986
4994
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
4987
4995
  ]),
4988
- r.moreOpen ? (l(), $(x, {
4996
+ r.moreOpen ? (l(), L(x, {
4989
4997
  key: 0,
4990
4998
  "can-rename": !!s.currentConv && !s.currentConv._draft,
4991
4999
  "can-export": !!s.currentConv && !s.currentConv._draft,
4992
5000
  "notif-enabled": r.notifEnabled,
4993
5001
  "status-url": s.statusUrl,
4994
5002
  "help-url": s.helpUrl,
4995
- onClose: e[3] || (e[3] = (F) => r.moreOpen = !1),
5003
+ onClose: e[4] || (e[4] = (R) => r.moreOpen = !1),
4996
5004
  onNotifToggle: s.onNotifToggle,
4997
5005
  onAction: s.onMoreAction
4998
- }, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0),
4999
- r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), $(j, {
5006
+ }, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0),
5007
+ r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), L(j, {
5000
5008
  key: 1,
5001
5009
  "initial-value": s.currentConv.name || "",
5002
5010
  title: "Modifier le titre de la conversation",
5003
- onClose: e[4] || (e[4] = (F) => r.renameDialogOpen = !1),
5011
+ onClose: e[5] || (e[5] = (R) => r.renameDialogOpen = !1),
5004
5012
  onSubmit: s.onRenameSubmit
5005
- }, null, 8, ["initial-value", "onSubmit"])) : g("", !0),
5006
- r.pendingAttachments.length ? (l(), c("div", Qi, [
5007
- (l(!0), c(T, null, D(r.pendingAttachments, (F, H) => (l(), c("div", {
5013
+ }, null, 8, ["initial-value", "onSubmit"])) : y("", !0),
5014
+ r.pendingAttachments.length ? (l(), c("div", Zi, [
5015
+ (l(!0), c(M, null, N(r.pendingAttachments, (R, H) => (l(), c("div", {
5008
5016
  key: H,
5009
5017
  class: "wm-attached__chip"
5010
5018
  }, [
5011
- e[13] || (e[13] = i("svg", {
5019
+ e[14] || (e[14] = i("svg", {
5012
5020
  width: "11",
5013
5021
  height: "11",
5014
5022
  viewBox: "0 0 24 24",
@@ -5021,12 +5029,12 @@ function ea(t, e, n, a, r, s) {
5021
5029
  }, [
5022
5030
  i("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
5023
5031
  ], -1)),
5024
- i("span", null, b(F.name), 1),
5032
+ i("span", null, b(R.name), 1),
5025
5033
  i("button", {
5026
5034
  type: "button",
5027
5035
  "aria-label": "Retirer",
5028
5036
  onClick: (Y) => r.pendingAttachments.splice(H, 1)
5029
- }, [...e[12] || (e[12] = [
5037
+ }, [...e[13] || (e[13] = [
5030
5038
  i("svg", {
5031
5039
  width: "10",
5032
5040
  height: "10",
@@ -5040,10 +5048,10 @@ function ea(t, e, n, a, r, s) {
5040
5048
  }, [
5041
5049
  i("path", { d: "M18 6L6 18M6 6l12 12" })
5042
5050
  ], -1)
5043
- ])], 8, Zi)
5051
+ ])], 8, Qi)
5044
5052
  ]))), 128))
5045
- ])) : g("", !0)
5046
- ], 64)) : (l(), $(v, {
5053
+ ])) : y("", !0)
5054
+ ], 64)) : (l(), L(v, {
5047
5055
  key: 1,
5048
5056
  "welcome-message": s.widgetWelcomeMessage,
5049
5057
  "agent-name": s.agentName,
@@ -5052,52 +5060,53 @@ function ea(t, e, n, a, r, s) {
5052
5060
  busy: r.busy,
5053
5061
  onStart: s.startConv,
5054
5062
  onSelect: s.onQuickLink,
5055
- onResume: s.onDrawerPick
5063
+ onResume: s.onDrawerPick,
5064
+ onViewAll: e[2] || (e[2] = (R) => r.historyOpen = !0)
5056
5065
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
5057
- r.historyOpen ? (l(), $(P, {
5066
+ r.historyOpen ? (l(), L(P, {
5058
5067
  key: 3,
5059
5068
  conversations: s.drawerConversations,
5060
5069
  "active-id": s.currentConv ? s.currentConv.id : null,
5061
- onClose: e[5] || (e[5] = (F) => r.historyOpen = !1),
5070
+ onClose: e[6] || (e[6] = (R) => r.historyOpen = !1),
5062
5071
  onNew: s.onDrawerNew,
5063
5072
  onPick: s.onDrawerPick
5064
- }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : g("", !0),
5065
- r.moreOpen && !s.currentConv ? (l(), $(x, {
5073
+ }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : y("", !0),
5074
+ r.moreOpen && !s.currentConv ? (l(), L(x, {
5066
5075
  key: 4,
5067
5076
  "can-rename": !1,
5068
5077
  "can-export": !1,
5069
5078
  "notif-enabled": r.notifEnabled,
5070
5079
  "status-url": s.statusUrl,
5071
5080
  "help-url": s.helpUrl,
5072
- onClose: e[6] || (e[6] = (F) => r.moreOpen = !1),
5081
+ onClose: e[7] || (e[7] = (R) => r.moreOpen = !1),
5073
5082
  onNotifToggle: s.onNotifToggle,
5074
5083
  onAction: s.onMoreAction
5075
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0)
5084
+ }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0)
5076
5085
  ], 64))
5077
- ], 6)) : g("", !0)
5086
+ ], 6)) : y("", !0)
5078
5087
  ], 2);
5079
5088
  }
5080
- const sa = /* @__PURE__ */ E(zi, [["render", ea], ["__scopeId", "data-v-a988e756"]]), ra = "0.3.1";
5089
+ const sa = /* @__PURE__ */ $(zi, [["render", ea], ["__scopeId", "data-v-5889aa58"]]), ra = "0.3.3";
5081
5090
  export {
5082
- te as AIAvatar,
5083
- ue as AVATAR_COLORS,
5091
+ ne as AIAvatar,
5092
+ ce as AVATAR_COLORS,
5084
5093
  tn as ActionResult,
5085
5094
  hr as ApprovalCard,
5086
5095
  cn as ArtifactFormResponse,
5087
5096
  Cn as ArtifactInfoCard,
5088
5097
  Hn as ArtifactRenderer,
5089
- Nn as ArtifactTicket,
5098
+ Dn as ArtifactTicket,
5090
5099
  es as AttachmentPreview,
5091
5100
  os as Bubble,
5092
- Qs as Composer,
5101
+ Zs as Composer,
5093
5102
  He as DEFAULT_BASE_URL,
5094
5103
  Yr as Feedback,
5095
5104
  jr as FormCard,
5096
5105
  wt as Header,
5097
5106
  pi as HistoryDrawer,
5098
- Ce as HumanAvatar,
5107
+ ke as HumanAvatar,
5099
5108
  Ge as Launcher,
5100
- me as MEDIA_RECORDER_SUPPORTED,
5109
+ he as MEDIA_RECORDER_SUPPORTED,
5101
5110
  Es as MessageList,
5102
5111
  sa as Messenger,
5103
5112
  Ai as MoreMenu,
@@ -5107,14 +5116,14 @@ export {
5107
5116
  lt as TeamAvatars,
5108
5117
  us as Typing,
5109
5118
  ra as VERSION,
5110
- we as avatarColor,
5111
- be as avatarInitials,
5119
+ ye as avatarColor,
5120
+ we as avatarInitials,
5112
5121
  Ls as captureScreenshotFile,
5113
- N as colors,
5122
+ D as colors,
5114
5123
  Ue as createStore,
5115
5124
  Fe as createTransport,
5116
5125
  sa as default,
5117
- ke as formatTime,
5126
+ be as formatTime,
5118
5127
  na as guessAttachmentKind,
5119
5128
  $s as pickRecorderMime,
5120
5129
  ss as renderMarkdown,