@_solaris/messenger-widget 0.2.31 → 0.3.0

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 Ae, openBlock as l, createElementBlock as d, createVNode as K, Transition as Se, withCtx as xe, withKeys as me, withModifiers as ee, createElementVNode as i, toDisplayString as b, createCommentVNode as g, normalizeStyle as G, normalizeClass as B, Fragment as M, renderList as j, resolveComponent as I, createBlock as $, createTextVNode as oe, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as W, vModelText as Q, vModelCheckbox as Oe, vModelSelect as Ie, createStaticVNode as ue, markRaw as fe } from "vue";
1
+ import { reactive as Ae, openBlock as l, createElementBlock as c, createVNode as K, Transition as Se, withCtx as xe, withKeys as ae, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as y, normalizeStyle as G, normalizeClass as B, Fragment as T, renderList as D, resolveComponent as I, createBlock as $, createTextVNode as de, resolveDynamicComponent as Te, renderSlot as Me, withDirectives as q, vModelText as J, vModelCheckbox as Oe, vModelSelect as Ie, createStaticVNode as he, markRaw as fe } from "vue";
2
2
  const Be = [
3
3
  "connected",
4
4
  "message",
@@ -6,7 +6,7 @@ const Be = [
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], Ee = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, $e = 5 * 60 * 1e3;
9
+ ], Ee = 5 * 60 * 1e3, $e = 10 * 60 * 1e3, Le = 5 * 60 * 1e3;
10
10
  function Re(t) {
11
11
  const e = {
12
12
  baseUrl: Fe(t.baseUrl || ""),
@@ -61,14 +61,14 @@ function Re(t) {
61
61
  body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
63
  if (!C.ok) {
64
- const O = await c(C), T = new Error(
64
+ const O = await d(C), M = new Error(
65
65
  `HTTP ${C.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || C.statusText}`
66
66
  );
67
- throw T.status = C.status, T.body = O, T;
67
+ throw M.status = C.status, M.body = O, M;
68
68
  }
69
69
  return C.status === 204 ? null : C.json();
70
70
  }
71
- async function c(h) {
71
+ async function d(h) {
72
72
  try {
73
73
  return await h.json();
74
74
  } catch {
@@ -80,7 +80,7 @@ function Re(t) {
80
80
  // Public — no HMAC required.
81
81
  fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
82
  if (!p.ok) {
83
- const C = await c(p);
83
+ const C = await d(p);
84
84
  throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
85
85
  }
86
86
  return p.json();
@@ -114,7 +114,7 @@ function Re(t) {
114
114
  async function A(h) {
115
115
  return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
- async function P(h, f) {
117
+ async function U(h, f) {
118
118
  return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
120
  async function x(h, f = {}) {
@@ -126,8 +126,8 @@ function Re(t) {
126
126
  `/conversations/${encodeURIComponent(h)}/messages${C}`
127
127
  );
128
128
  }
129
- async function U(h, f) {
130
- z();
129
+ async function j(h, f) {
130
+ V();
131
131
  const p = {
132
132
  client_msg_id: f.client_msg_id,
133
133
  type: "content",
@@ -141,14 +141,14 @@ function Re(t) {
141
141
  p
142
142
  );
143
143
  }
144
- async function F(h, f, p) {
145
- return z(), o(
144
+ async function P(h, f, p) {
145
+ return V(), o(
146
146
  "POST",
147
147
  `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
148
  p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function N(h) {
151
+ async function F(h) {
152
152
  const f = (
153
153
  /** @type {File} */
154
154
  h.name || "attachment"
@@ -159,21 +159,21 @@ function Re(t) {
159
159
  size_bytes: C,
160
160
  name: f
161
161
  })
162
- ), T = await fetch(O.upload_url, {
162
+ ), M = await fetch(O.upload_url, {
163
163
  method: "PUT",
164
164
  headers: { "Content-Type": p },
165
165
  body: h
166
166
  });
167
- if (!T.ok)
168
- throw new Error(`HTTP ${T.status} PUT signed upload`);
167
+ if (!M.ok)
168
+ throw new Error(`HTTP ${M.status} PUT signed upload`);
169
169
  return {
170
- type: je(p),
170
+ type: De(p),
171
171
  path: O.path,
172
172
  mime_type: p,
173
173
  size_bytes: C
174
174
  };
175
175
  }
176
- async function V(h) {
176
+ async function H(h) {
177
177
  return o(
178
178
  "GET",
179
179
  `/attachments/sign?path=${encodeURIComponent(h)}`
@@ -187,18 +187,18 @@ function Re(t) {
187
187
  }).toString();
188
188
  return `${e.baseUrl}/stream?${h}`;
189
189
  }
190
- function H() {
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 Be)
195
- h.addEventListener(f, (p) => J(f, p.data));
195
+ h.addEventListener(f, (p) => Q(f, p.data));
196
196
  h.addEventListener("error", () => a("error", new Error("SSE error"))), e.eventSource = h, r("open");
197
197
  } catch (h) {
198
198
  console.error("[transport] SSE open failed", h), a("error", h);
199
199
  }
200
200
  }
201
- function J(h, f) {
201
+ function Q(h, f) {
202
202
  try {
203
203
  const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
204
204
  a(h, C);
@@ -206,30 +206,30 @@ function Re(t) {
206
206
  console.error("[transport] bad SSE payload", h, p);
207
207
  }
208
208
  }
209
- function q() {
209
+ function W() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
- function z() {
213
- clearTimeout(e.burstTimer), H(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
- e.panelOpen || q();
215
- }, Le));
212
+ function V() {
213
+ clearTimeout(e.burstTimer), z(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
+ e.panelOpen || W();
215
+ }, $e));
216
216
  }
217
- function X(h) {
218
- e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), H()) : z();
217
+ function Z(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), z()) : V();
219
219
  }
220
- async function le() {
220
+ async function ce() {
221
221
  try {
222
222
  const h = await S(), f = h.reduce((C, O) => {
223
- const T = O == null ? void 0 : O.last_message_at;
224
- return T && (!C || T > C) ? T : C;
223
+ const M = O == null ? void 0 : O.last_message_at;
224
+ return M && (!C || M > C) ? M : C;
225
225
  }, null);
226
- f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), z());
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), V());
227
227
  } catch (h) {
228
228
  console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
231
  function ne() {
232
- u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(le, Ee));
232
+ u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(ce, Ee));
233
233
  }
234
234
  function u() {
235
235
  e.pollTimer && (clearInterval(e.pollTimer), e.pollTimer = null);
@@ -237,14 +237,14 @@ function Re(t) {
237
237
  function m() {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
- e.hiddenGraceTimer = null, document.hidden && (u(), q(), r("paused"));
241
- }, $e);
240
+ e.hiddenGraceTimer = null, document.hidden && (u(), W(), r("paused"));
241
+ }, Le);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), ne(), e.panelOpen && H();
247
+ r("idle"), ne(), e.panelOpen && z();
248
248
  }
249
249
  }
250
250
  async function _() {
@@ -263,14 +263,14 @@ function Re(t) {
263
263
  }
264
264
  return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
265
265
  }
266
- function y() {
267
- u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, q(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
266
+ function g() {
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: X,
272
+ stop: g,
273
+ setPanelOpen: Z,
274
274
  // REST
275
275
  bootstrap: v,
276
276
  getCustomer: k,
@@ -278,12 +278,12 @@ function Re(t) {
278
278
  listConversations: S,
279
279
  createConversation: R,
280
280
  getConversation: A,
281
- patchConversation: P,
281
+ patchConversation: U,
282
282
  listMessages: x,
283
- postMessage: U,
284
- postCallback: F,
285
- uploadAttachment: N,
286
- signAttachment: V,
283
+ postMessage: j,
284
+ postCallback: P,
285
+ uploadAttachment: F,
286
+ signAttachment: H,
287
287
  // Read-only state
288
288
  get connection() {
289
289
  return e.connection;
@@ -293,10 +293,10 @@ function Re(t) {
293
293
  function Fe(t) {
294
294
  return t.endsWith("/") ? t.slice(0, -1) : t;
295
295
  }
296
- function je(t) {
296
+ function De(t) {
297
297
  return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : "file";
298
298
  }
299
- function De() {
299
+ function Ne() {
300
300
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
301
301
  return crypto.randomUUID();
302
302
  const t = new Uint8Array(16);
@@ -308,7 +308,7 @@ function De() {
308
308
  const e = [...t].map((n) => n.toString(16).padStart(2, "0"));
309
309
  return e.slice(0, 4).join("") + "-" + e.slice(4, 6).join("") + "-" + e.slice(6, 8).join("") + "-" + e.slice(8, 10).join("") + "-" + e.slice(10, 16).join("");
310
310
  }
311
- function Ue(t) {
311
+ function je(t) {
312
312
  const e = Ae({
313
313
  ready: !1,
314
314
  error: null,
@@ -344,29 +344,29 @@ function Ue(t) {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
346
  const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.message;
347
- !m || !(_ != null && _.id) || (H(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], z(m, _.created_at));
347
+ !m || !(_ != null && _.id) || (z(m, _), _.client_msg_id && delete e.streamingByMsgId[_.client_msg_id], V(m, _.created_at));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
349
  const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
350
350
  !m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
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
366
  async function a() {
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 = le(u);
385
+ const m = ce(u);
386
386
  if (!m) return e.customer;
387
387
  try {
388
388
  const _ = await t.patchCustomer(m);
@@ -393,13 +393,13 @@ function Ue(t) {
393
393
  return e.customer;
394
394
  }
395
395
  async function o(u = {}) {
396
- const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
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
- const c = 50;
399
+ const d = 50;
400
400
  async function v(u) {
401
401
  if (e.messagesByConv[u]) return;
402
- const m = await t.listMessages(u, { limit: c });
402
+ const m = await t.listMessages(u, { limit: d });
403
403
  e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], w(u, {
404
404
  nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
405
405
  loading: !1,
@@ -415,12 +415,12 @@ function Ue(t) {
415
415
  for (; p < 6 && h; p++) {
416
416
  const L = await t.listMessages(u, {
417
417
  before: h,
418
- limit: c
418
+ limit: d
419
419
  }), se = (L == null ? void 0 : L.messages) ?? [];
420
420
  if (f = [...se, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !se.length || f.length >= 60) break;
421
421
  }
422
- const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))), T = [...f.filter((L) => !O.has(String(L == null ? void 0 : L.id))), ...C];
423
- e.messagesByConv[u] = T, w(u, {
422
+ const C = e.messagesByConv[u] || [], O = new Set(C.map((L) => String(L == null ? void 0 : L.id))), M = [...f.filter((L) => !O.has(String(L == null ? void 0 : L.id))), ...C];
423
+ e.messagesByConv[u] = M, w(u, {
424
424
  nextCursor: h,
425
425
  loading: !1,
426
426
  loaded: !0
@@ -434,14 +434,14 @@ function Ue(t) {
434
434
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
435
435
  }
436
436
  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] = _);
437
+ const _ = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
438
+ g !== -1 && (e.conversations[g] = _);
439
439
  }
440
- async function R(u, m, { attachments: _, metadata: y } = {}) {
441
- var T;
440
+ async function R(u, m, { attachments: _, metadata: g } = {}) {
441
+ var M;
442
442
  const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
443
  if (!u || !h && !f) return;
444
- const p = De(), C = ne(u), O = {
444
+ const p = Ne(), C = ne(u), O = {
445
445
  id: p,
446
446
  client_msg_id: p,
447
447
  conversation_id: u,
@@ -449,39 +449,39 @@ function Ue(t) {
449
449
  text_md: h,
450
450
  author: {
451
451
  type: "user",
452
- id: ((T = e.customer) == null ? void 0 : T.external_id) || null
452
+ id: ((M = e.customer) == null ? void 0 : M.external_id) || null
453
453
  },
454
454
  created_at: C,
455
455
  // Local-only flag — UI may render dimmed until the SSE echo lands.
456
456
  _pending: !0,
457
457
  ...f ? { payload: { type: "content", attachments: _ } } : {},
458
- ...y && typeof y == "object" ? { metadata: y } : {}
458
+ ...g && typeof g == "object" ? { metadata: g } : {}
459
459
  };
460
- H(u, O);
460
+ z(u, O);
461
461
  try {
462
462
  await t.postMessage(u, {
463
463
  client_msg_id: p,
464
464
  text_md: h,
465
465
  created_at: C,
466
466
  ...f ? { attachments: _ } : {},
467
- ...y && typeof y == "object" ? { metadata: y } : {}
467
+ ...g && typeof g == "object" ? { metadata: g } : {}
468
468
  });
469
469
  } catch (L) {
470
- console.error("[store] send failed", L), q(u, p, { _failed: !0, _pending: !1 });
470
+ console.error("[store] send failed", L), W(u, p, { _failed: !0, _pending: !1 });
471
471
  }
472
472
  }
473
473
  async function A(u, m, _) {
474
474
  u != null && (e.awaitingCallback[u] = !0);
475
475
  try {
476
476
  await t.postCallback(u, m, _);
477
- } catch (y) {
478
- console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
477
+ } catch (g) {
478
+ console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
479
479
  }
480
480
  }
481
- const P = /* @__PURE__ */ new Map();
481
+ const U = /* @__PURE__ */ new Map();
482
482
  async function x(u) {
483
483
  if (!u) return null;
484
- const m = P.get(u);
484
+ const m = U.get(u);
485
485
  if (m != null && m.url) {
486
486
  const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
487
487
  if (!_ || _ - Date.now() > 6e4) return m.url;
@@ -489,15 +489,15 @@ function Ue(t) {
489
489
  try {
490
490
  const _ = await t.signAttachment(u);
491
491
  if (_ != null && _.signed_url)
492
- return P.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
492
+ return U.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
493
493
  } catch (_) {
494
494
  console.error("[store] sign attachment failed", _);
495
495
  }
496
496
  return null;
497
497
  }
498
- async function U(u, { rating: m, comment: _ } = {}) {
499
- const y = e.conversations.find((p) => p.id === u), f = {
500
- ...(y == null ? void 0 : y.metadata) || {},
498
+ async function j(u, { rating: m, comment: _ } = {}) {
499
+ const g = e.conversations.find((p) => p.id === u), f = {
500
+ ...(g == null ? void 0 : g.metadata) || {},
501
501
  feedback: {
502
502
  rating: m,
503
503
  comment: _ || null,
@@ -506,54 +506,54 @@ function Ue(t) {
506
506
  };
507
507
  await S(u, { metadata: f });
508
508
  }
509
- function F(u) {
510
- var _, y;
509
+ function P(u) {
510
+ var _, g;
511
511
  const m = e.messagesByConv[u] || [];
512
512
  for (let h = m.length - 1; h >= 0; h--) {
513
513
  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])
514
+ 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
515
  return f;
516
516
  }
517
517
  return null;
518
518
  }
519
- function N(u) {
520
- var _, y, h;
519
+ function F(u) {
520
+ var _, g, h;
521
521
  const m = e.messagesByConv[u] || [];
522
522
  for (let f = m.length - 1; f >= 0; f--) {
523
523
  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;
524
+ 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;
525
525
  const C = (h = p == null ? void 0 : p.metadata) == null ? void 0 : h.form;
526
526
  if (C && Array.isArray(C.fields) && C.fields.length > 0)
527
527
  return { message: p, form: C };
528
528
  }
529
529
  return null;
530
530
  }
531
- function V(u) {
531
+ function H(u) {
532
532
  const m = e.runningActionsByConv[u];
533
533
  if (!m) return null;
534
534
  const _ = Object.keys(m);
535
535
  if (_.length === 0) return null;
536
- const y = _[0];
537
- return { id: y, payload: { name: m[y] } };
536
+ const g = _[0];
537
+ return { id: g, payload: { name: m[g] } };
538
538
  }
539
539
  function Y(u) {
540
- var _, y, h, f;
540
+ var _, g, h, f;
541
541
  const m = e.messagesByConv[u] || [];
542
542
  for (let p = m.length - 1; p >= 0; p--) {
543
543
  const C = m[p];
544
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 [];
545
+ if ((C == null ? void 0 : C.type) === "action" && ((g = C == null ? void 0 : C.payload) == null ? void 0 : g.state) === "pending") return [];
546
546
  if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
547
  const O = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
548
- return Array.isArray(O) && O.length ? O.map((T) => {
549
- if (typeof T == "string") {
550
- const L = T.trim();
548
+ return Array.isArray(O) && O.length ? O.map((M) => {
549
+ if (typeof M == "string") {
550
+ const L = M.trim();
551
551
  return L ? { label: L, kind: null } : null;
552
552
  }
553
- if (T && typeof T == "object" && typeof T.label == "string") {
554
- const L = T.label.trim();
553
+ if (M && typeof M == "object" && typeof M.label == "string") {
554
+ const L = M.label.trim();
555
555
  if (!L) return null;
556
- const se = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
556
+ const se = M.kind === "cta" || M.kind === "choice" || M.kind === "followup" ? M.kind : null;
557
557
  return { label: L, kind: se };
558
558
  }
559
559
  return null;
@@ -561,46 +561,46 @@ function Ue(t) {
561
561
  }
562
562
  return [];
563
563
  }
564
- function H(u, m) {
564
+ function z(u, m) {
565
565
  var f;
566
566
  const _ = e.messagesByConv[u] || [];
567
- let y = -1;
568
- m != null && m.client_msg_id && (y = _.findIndex(
567
+ let g = -1;
568
+ m != null && m.client_msg_id && (g = _.findIndex(
569
569
  (p) => (p == null ? void 0 : p.client_msg_id) && p.client_msg_id === m.client_msg_id
570
- )), y === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (y = _.findIndex((p) => J(p == null ? void 0 : p.id, m.id)));
570
+ )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = _.findIndex((p) => Q(p == null ? void 0 : p.id, m.id)));
571
571
  let h;
572
- y === -1 ? h = [..._, m].sort(X) : (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];
572
+ g === -1 ? h = [..._, m].sort(Z) : (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
573
  }
574
- function J(u, m) {
574
+ function Q(u, m) {
575
575
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
576
576
  }
577
- function q(u, m, _) {
578
- const y = e.messagesByConv[u];
579
- if (!y) return;
580
- const h = y.findIndex((p) => p.id === m);
577
+ function W(u, m, _) {
578
+ const g = e.messagesByConv[u];
579
+ if (!g) return;
580
+ const h = g.findIndex((p) => p.id === m);
581
581
  if (h === -1) return;
582
- const f = y.slice();
583
- f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
582
+ const f = g.slice();
583
+ f[h] = { ...g[h], ..._ }, e.messagesByConv[u] = f;
584
584
  }
585
- function z(u, m) {
585
+ function V(u, m) {
586
586
  const _ = e.conversations.findIndex((h) => h.id === u);
587
587
  if (_ === -1) return;
588
- const y = e.conversations[_];
589
- if (m && (!y.last_message_at || m > y.last_message_at)) {
588
+ const g = e.conversations[_];
589
+ if (m && (!g.last_message_at || m > g.last_message_at)) {
590
590
  const h = e.conversations.slice();
591
- h[_] = { ...y, last_message_at: m }, h.sort(
591
+ h[_] = { ...g, last_message_at: m }, h.sort(
592
592
  (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
593
  ), e.conversations = h;
594
594
  }
595
595
  }
596
- function X(u, m) {
596
+ function Z(u, m) {
597
597
  return (u.created_at || "").localeCompare(m.created_at || "");
598
598
  }
599
- function le(u) {
599
+ function ce(u) {
600
600
  if (!u || typeof u != "object") return null;
601
601
  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);
602
+ for (const [g, h] of Object.entries(u))
603
+ h !== void 0 && (g === "name" || g === "email" ? h != null && String(h).trim() !== "" && (m[g] = h) : (g === "values" || g === "metadata") && h && typeof h == "object" ? Object.assign(_, h) : _[g] = h);
604
604
  return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
605
605
  }
606
606
  function ne(u) {
@@ -608,8 +608,8 @@ function Ue(t) {
608
608
  let _ = "";
609
609
  for (const f of m)
610
610
  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();
611
+ const g = (/* @__PURE__ */ new Date()).toISOString();
612
+ return !_ || g > _ ? g : new Date(Date.parse(_) + 1).toISOString();
613
613
  }
614
614
  return {
615
615
  state: e,
@@ -623,16 +623,16 @@ function Ue(t) {
623
623
  send: R,
624
624
  clickCallback: A,
625
625
  signAttachment: x,
626
- submitFeedback: U,
627
- getPendingApproval: F,
628
- getActionInFlight: V,
626
+ submitFeedback: j,
627
+ getPendingApproval: P,
628
+ getActionInFlight: H,
629
629
  getLatestSuggestions: Y,
630
- getLatestForm: N,
630
+ getLatestForm: F,
631
631
  // Pass-through for panel open/close (controls SSE burst).
632
632
  setPanelOpen: t.setPanelOpen
633
633
  };
634
634
  }
635
- const D = {
635
+ const N = {
636
636
  w: "#ffffff",
637
637
  g50: "#F9F9F7",
638
638
  g100: "#F2F1EE",
@@ -648,9 +648,9 @@ const D = {
648
648
  green: "#22C55E",
649
649
  red: "#B91C1C",
650
650
  redBg: "#FDECEC"
651
- }, ce = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
- function ge(t = "") {
653
- return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
651
+ }, ue = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
+ function ye(t = "") {
653
+ return t ? ue[t.charCodeAt(0) % ue.length] : ue[0];
654
654
  }
655
655
  function we(t = "") {
656
656
  return t.split(" ").map((e) => e[0] || "").join("").toUpperCase().slice(0, 2);
@@ -658,27 +658,27 @@ function we(t = "") {
658
658
  function be(t = /* @__PURE__ */ new Date()) {
659
659
  return t.toLocaleTimeString("fr-FR", { hour: "2-digit", minute: "2-digit" });
660
660
  }
661
- const Ne = `
661
+ const Ue = `
662
662
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
663
663
 
664
664
  .wm-root {
665
665
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
666
666
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
667
- --wm-w: ${D.w};
668
- --wm-g50: ${D.g50};
669
- --wm-g100: ${D.g100};
670
- --wm-g150: ${D.g150};
671
- --wm-g200: ${D.g200};
672
- --wm-g300: ${D.g300};
673
- --wm-g400: ${D.g400};
674
- --wm-g500: ${D.g500};
675
- --wm-g700: ${D.g700};
676
- --wm-g900: ${D.g900};
677
- --wm-a: ${D.accent};
678
- --wm-al: ${D.accentLight};
679
- --wm-green: ${D.green};
680
- --wm-red: ${D.red};
681
- --wm-redBg: ${D.redBg};
667
+ --wm-w: ${N.w};
668
+ --wm-g50: ${N.g50};
669
+ --wm-g100: ${N.g100};
670
+ --wm-g150: ${N.g150};
671
+ --wm-g200: ${N.g200};
672
+ --wm-g300: ${N.g300};
673
+ --wm-g400: ${N.g400};
674
+ --wm-g500: ${N.g500};
675
+ --wm-g700: ${N.g700};
676
+ --wm-g900: ${N.g900};
677
+ --wm-a: ${N.accent};
678
+ --wm-al: ${N.accentLight};
679
+ --wm-green: ${N.green};
680
+ --wm-red: ${N.red};
681
+ --wm-redBg: ${N.redBg};
682
682
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
683
683
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
684
684
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -721,10 +721,10 @@ const Ne = `
721
721
  emits: ["open", "dismiss"]
722
722
  }, ze = { class: "wm-launcherWrap" }, Ve = { class: "wm-peek__text" }, qe = ["aria-label"];
723
723
  function We(t, e, n, a, r, s) {
724
- return l(), d("div", ze, [
724
+ return l(), c("div", ze, [
725
725
  K(Se, { name: "wm-peek" }, {
726
726
  default: xe(() => [
727
- n.peek ? (l(), d("div", {
727
+ n.peek ? (l(), c("div", {
728
728
  key: 0,
729
729
  class: "wm-peek",
730
730
  role: "button",
@@ -732,8 +732,8 @@ function We(t, e, n, a, r, s) {
732
732
  "aria-label": "Ouvrir le messenger sur le dernier message",
733
733
  onClick: e[1] || (e[1] = (o) => t.$emit("open")),
734
734
  onKeydown: [
735
- e[2] || (e[2] = me(ee((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
- e[3] || (e[3] = me(ee((o) => t.$emit("open"), ["prevent"]), ["space"]))
735
+ e[2] || (e[2] = ae(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
+ e[3] || (e[3] = ae(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
737
737
  ]
738
738
  }, [
739
739
  i("p", Ve, b(n.peek), 1),
@@ -741,7 +741,7 @@ function We(t, e, n, a, r, s) {
741
741
  type: "button",
742
742
  class: "wm-peek__close",
743
743
  "aria-label": "Ignorer",
744
- onClick: e[0] || (e[0] = ee((o) => t.$emit("dismiss"), ["stop"]))
744
+ onClick: e[0] || (e[0] = X((o) => t.$emit("dismiss"), ["stop"]))
745
745
  }, [...e[5] || (e[5] = [
746
746
  i("svg", {
747
747
  width: "11",
@@ -757,7 +757,7 @@ function We(t, e, n, a, r, s) {
757
757
  i("path", { d: "M18 6L6 18M6 6l12 12" })
758
758
  ], -1)
759
759
  ])])
760
- ], 32)) : g("", !0)
760
+ ], 32)) : y("", !0)
761
761
  ]),
762
762
  _: 1
763
763
  }),
@@ -780,11 +780,11 @@ function We(t, e, n, a, r, s) {
780
780
  }, [
781
781
  i("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
782
782
  ], -1)),
783
- n.unreadCount > 0 ? (l(), d("span", {
783
+ n.unreadCount > 0 ? (l(), c("span", {
784
784
  key: 0,
785
785
  class: "wm-launcher__badge",
786
786
  "aria-label": `${n.unreadCount} conversation${n.unreadCount > 1 ? "s" : ""} non lue${n.unreadCount > 1 ? "s" : ""}`
787
- }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, qe)) : g("", !0)
787
+ }, b(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, qe)) : y("", !0)
788
788
  ])
789
789
  ]);
790
790
  }
@@ -805,15 +805,15 @@ const Ke = /* @__PURE__ */ E(He, [["render", We], ["__scopeId", "data-v-fabef371
805
805
  class: "wm-aiav__pulse"
806
806
  }, Je = ["width", "height"];
807
807
  function Xe(t, e, n, a, r, s) {
808
- return l(), d("div", {
808
+ return l(), c("div", {
809
809
  class: B(["wm-aiav", { "wm-aiav--tail": n.tail }]),
810
810
  style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
811
811
  }, [
812
- n.pulse ? (l(), d("div", Ye)) : g("", !0),
812
+ n.pulse ? (l(), c("div", Ye)) : y("", !0),
813
813
  i("div", {
814
814
  class: B(["wm-aiav__inner", { "wm-aiav__inner--glow": n.pulse }])
815
815
  }, [
816
- (l(), d("svg", {
816
+ (l(), c("svg", {
817
817
  width: n.size * 0.5,
818
818
  height: n.size * 0.5,
819
819
  viewBox: "0 0 24 24",
@@ -852,7 +852,7 @@ const te = /* @__PURE__ */ E(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688
852
852
  },
853
853
  computed: {
854
854
  bg() {
855
- return this.avatarUrl ? "transparent" : ge(this.name);
855
+ return this.avatarUrl ? "transparent" : ye(this.name);
856
856
  },
857
857
  initials() {
858
858
  return we(this.name);
@@ -860,7 +860,7 @@ const te = /* @__PURE__ */ E(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688
860
860
  }
861
861
  }, Ze = ["src", "alt"];
862
862
  function et(t, e, n, a, r, s) {
863
- return l(), d("div", {
863
+ return l(), c("div", {
864
864
  class: "wm-huav",
865
865
  style: G({
866
866
  width: n.size + "px",
@@ -869,11 +869,11 @@ function et(t, e, n, a, r, s) {
869
869
  background: s.bg
870
870
  })
871
871
  }, [
872
- n.avatarUrl ? (l(), d("img", {
872
+ n.avatarUrl ? (l(), c("img", {
873
873
  key: 0,
874
874
  src: n.avatarUrl,
875
875
  alt: n.name || ""
876
- }, null, 8, Ze)) : (l(), d("span", {
876
+ }, null, 8, Ze)) : (l(), c("span", {
877
877
  key: 1,
878
878
  style: G({ fontSize: n.size * 0.36 + "px" })
879
879
  }, b(s.initials), 5))
@@ -895,7 +895,7 @@ const ke = /* @__PURE__ */ E(Qe, [["render", et], ["__scopeId", "data-v-a772b179
895
895
  },
896
896
  methods: {
897
897
  colorFor(t) {
898
- return t.avatar_url ? "transparent" : ge(t.name || "");
898
+ return t.avatar_url ? "transparent" : ye(t.name || "");
899
899
  },
900
900
  initialsFor(t) {
901
901
  return we(t.name || "");
@@ -909,25 +909,25 @@ const ke = /* @__PURE__ */ E(Qe, [["render", et], ["__scopeId", "data-v-a772b179
909
909
  class: "wm-team__label"
910
910
  };
911
911
  function at(t, e, n, a, r, s) {
912
- return s.visible ? (l(), d("div", nt, [
912
+ return s.visible ? (l(), c("div", nt, [
913
913
  i("div", {
914
914
  class: "wm-team__stack",
915
915
  style: G({ width: s.stackWidth + "px" })
916
916
  }, [
917
- (l(!0), d(M, null, j(n.members.slice(0, 3), (o, c) => (l(), d("div", {
918
- key: c,
917
+ (l(!0), c(T, null, D(n.members.slice(0, 3), (o, d) => (l(), c("div", {
918
+ key: d,
919
919
  class: "wm-team__pill",
920
- style: G({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
920
+ style: G({ left: d * 13 + "px", zIndex: 3 - d, background: s.colorFor(o) })
921
921
  }, [
922
- o.avatar_url ? (l(), d("img", {
922
+ o.avatar_url ? (l(), c("img", {
923
923
  key: 0,
924
924
  src: o.avatar_url,
925
925
  alt: o.name || ""
926
- }, null, 8, st)) : (l(), d("span", rt, b(s.initialsFor(o)), 1))
926
+ }, null, 8, st)) : (l(), c("span", rt, b(s.initialsFor(o)), 1))
927
927
  ], 4))), 128))
928
928
  ], 4),
929
- n.responseLabel ? (l(), d("span", it, b(n.responseLabel), 1)) : g("", !0)
930
- ])) : g("", !0);
929
+ n.responseLabel ? (l(), c("span", it, b(n.responseLabel), 1)) : y("", !0)
930
+ ])) : y("", !0);
931
931
  }
932
932
  const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1"]]), lt = {
933
933
  name: "WmHeader",
@@ -962,7 +962,7 @@ const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
962
962
  return this.escalated && this.agentName ? this.agentName : "En ligne";
963
963
  }
964
964
  }
965
- }, ct = { class: "wm-header" }, dt = {
965
+ }, dt = { class: "wm-header" }, ct = {
966
966
  key: 1,
967
967
  style: { width: "30px", height: "30px", "flex-shrink": "0" }
968
968
  }, ut = { class: "wm-header__avatar" }, ht = { class: "wm-header__main" }, mt = { class: "wm-header__title" }, ft = {
@@ -972,10 +972,10 @@ const ot = /* @__PURE__ */ E(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
972
972
  key: 3,
973
973
  class: "wm-header__fill"
974
974
  }, vt = { class: "wm-header__actions" };
975
- function yt(t, e, n, a, r, s) {
976
- const o = I("HumanAvatar"), c = I("AIAvatar"), v = I("TeamAvatars");
977
- return l(), d("div", ct, [
978
- n.showBack ? (l(), d("button", {
975
+ function gt(t, e, n, a, r, s) {
976
+ const o = I("HumanAvatar"), d = I("AIAvatar"), v = I("TeamAvatars");
977
+ return l(), c("div", dt, [
978
+ n.showBack ? (l(), c("button", {
979
979
  key: 0,
980
980
  type: "button",
981
981
  class: "wm-header__icon",
@@ -995,36 +995,36 @@ function yt(t, e, n, a, r, s) {
995
995
  }, [
996
996
  i("path", { d: "M19 12H5M12 5l-7 7 7 7" })
997
997
  ], -1)
998
- ])])) : (l(), d("div", dt)),
999
- n.showIdentity ? (l(), d(M, { key: 2 }, [
998
+ ])])) : (l(), c("div", ct)),
999
+ n.showIdentity ? (l(), c(T, { key: 2 }, [
1000
1000
  i("div", ut, [
1001
1001
  n.escalated ? (l(), $(o, {
1002
1002
  key: 0,
1003
1003
  name: n.agentName,
1004
1004
  "avatar-url": n.agentAvatarUrl,
1005
1005
  size: 34
1006
- }, null, 8, ["name", "avatar-url"])) : (l(), $(c, {
1006
+ }, null, 8, ["name", "avatar-url"])) : (l(), $(d, {
1007
1007
  key: 1,
1008
1008
  size: 34
1009
1009
  }))
1010
1010
  ]),
1011
1011
  i("div", ht, [
1012
1012
  i("div", mt, b(n.title), 1),
1013
- s.showPresence ? (l(), d("div", ft, [
1013
+ s.showPresence ? (l(), c("div", ft, [
1014
1014
  s.hasTeam ? (l(), $(v, {
1015
1015
  key: 0,
1016
1016
  members: n.teamMembers,
1017
1017
  "response-label": n.responseLabel
1018
- }, null, 8, ["members", "response-label"])) : g("", !0),
1018
+ }, null, 8, ["members", "response-label"])) : y("", !0),
1019
1019
  i("span", _t, [
1020
1020
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1021
- oe(" " + b(s.statusText), 1)
1021
+ de(" " + b(s.statusText), 1)
1022
1022
  ])
1023
- ])) : g("", !0)
1023
+ ])) : y("", !0)
1024
1024
  ])
1025
- ], 64)) : (l(), d("div", pt)),
1025
+ ], 64)) : (l(), c("div", pt)),
1026
1026
  i("div", vt, [
1027
- n.showMore ? (l(), d("button", {
1027
+ n.showMore ? (l(), c("button", {
1028
1028
  key: 0,
1029
1029
  type: "button",
1030
1030
  class: B(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
@@ -1055,8 +1055,8 @@ function yt(t, e, n, a, r, s) {
1055
1055
  r: "1.6"
1056
1056
  })
1057
1057
  ], -1)
1058
- ])], 2)) : g("", !0),
1059
- n.showClose ? (l(), d("button", {
1058
+ ])], 2)) : y("", !0),
1059
+ n.showClose ? (l(), c("button", {
1060
1060
  key: 1,
1061
1061
  type: "button",
1062
1062
  class: "wm-header__icon",
@@ -1077,11 +1077,11 @@ function yt(t, e, n, a, r, s) {
1077
1077
  }, [
1078
1078
  i("path", { d: "M18 6L6 18M6 6l12 12" })
1079
1079
  ], -1)
1080
- ])])) : g("", !0)
1080
+ ])])) : y("", !0)
1081
1081
  ])
1082
1082
  ]);
1083
1083
  }
1084
- const gt = /* @__PURE__ */ E(lt, [["render", yt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1084
+ const yt = /* @__PURE__ */ E(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9"]]), _e = {
1085
1085
  book: "M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",
1086
1086
  changelog: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",
1087
1087
  status: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
@@ -1115,10 +1115,10 @@ Je réponds en quelques secondes.`;
1115
1115
  }, bt = { class: "wm-onb" }, kt = { class: "wm-onb__hero" }, Ct = { class: "wm-onb__title" }, At = { class: "wm-onb__sub" }, St = {
1116
1116
  key: 0,
1117
1117
  class: "wm-onb__section"
1118
- }, xt = { class: "wm-onb__links" }, Mt = ["onClick"], Tt = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, It = { class: "wm-onb__resume-preview" }, Bt = {
1118
+ }, xt = { class: "wm-onb__links" }, Tt = ["onClick"], Mt = { class: "wm-onb__resume-body" }, Ot = { class: "wm-onb__resume-title" }, It = { class: "wm-onb__resume-preview" }, Bt = {
1119
1119
  key: 1,
1120
1120
  class: "wm-onb__section"
1121
- }, Et = { class: "wm-onb__links" }, Lt = ["onClick"], $t = { class: "wm-onb__link-icon" }, Rt = {
1121
+ }, Et = { class: "wm-onb__links" }, $t = ["onClick"], Lt = { class: "wm-onb__link-icon" }, Rt = {
1122
1122
  width: "14",
1123
1123
  height: "14",
1124
1124
  viewBox: "0 0 24 24",
@@ -1128,10 +1128,10 @@ Je réponds en quelques secondes.`;
1128
1128
  "stroke-linecap": "round",
1129
1129
  "stroke-linejoin": "round",
1130
1130
  "aria-hidden": "true"
1131
- }, Ft = ["d"], jt = { class: "wm-onb__link-label" }, Dt = { class: "wm-onb__cta" }, Ut = ["disabled"];
1132
- function Nt(t, e, n, a, r, s) {
1131
+ }, Ft = ["d"], Dt = { class: "wm-onb__link-label" }, Nt = { class: "wm-onb__cta" }, jt = ["disabled"];
1132
+ function Ut(t, e, n, a, r, s) {
1133
1133
  const o = I("AIAvatar");
1134
- return l(), d("div", bt, [
1134
+ return l(), c("div", bt, [
1135
1135
  i("div", kt, [
1136
1136
  K(o, {
1137
1137
  size: 56,
@@ -1140,14 +1140,14 @@ function Nt(t, e, n, a, r, s) {
1140
1140
  i("div", Ct, b(s.heroTitle), 1),
1141
1141
  i("div", At, b(s.heroSub), 1)
1142
1142
  ]),
1143
- n.unreadThreads.length ? (l(), d("div", St, [
1143
+ n.unreadThreads.length ? (l(), c("div", St, [
1144
1144
  e[3] || (e[3] = i("div", { class: "wm-onb__section-title" }, "Messages non lus", -1)),
1145
1145
  i("div", xt, [
1146
- (l(!0), d(M, null, j(n.unreadThreads, (c) => (l(), d("button", {
1147
- key: c.id,
1146
+ (l(!0), c(T, null, D(n.unreadThreads, (d) => (l(), c("button", {
1147
+ key: d.id,
1148
1148
  type: "button",
1149
1149
  class: "wm-onb__link wm-onb__resume",
1150
- onClick: (v) => t.$emit("resume", c)
1150
+ onClick: (v) => t.$emit("resume", d)
1151
1151
  }, [
1152
1152
  e[1] || (e[1] = i("span", { class: "wm-onb__link-icon wm-onb__resume-icon" }, [
1153
1153
  i("svg", {
@@ -1168,9 +1168,9 @@ function Nt(t, e, n, a, r, s) {
1168
1168
  "aria-label": "Non lu"
1169
1169
  })
1170
1170
  ], -1)),
1171
- i("span", Tt, [
1172
- i("span", Ot, b(c.title), 1),
1173
- i("span", It, b(c.preview), 1)
1171
+ i("span", Mt, [
1172
+ i("span", Ot, b(d.title), 1),
1173
+ i("span", It, b(d.preview), 1)
1174
1174
  ]),
1175
1175
  e[2] || (e[2] = i("svg", {
1176
1176
  width: "13",
@@ -1186,26 +1186,26 @@ function Nt(t, e, n, a, r, s) {
1186
1186
  }, [
1187
1187
  i("path", { d: "M9 18l6-6-6-6" })
1188
1188
  ], -1))
1189
- ], 8, Mt))), 128))
1189
+ ], 8, Tt))), 128))
1190
1190
  ])
1191
- ])) : g("", !0),
1192
- n.quickLinks.length ? (l(), d("div", Bt, [
1191
+ ])) : y("", !0),
1192
+ n.quickLinks.length ? (l(), c("div", Bt, [
1193
1193
  e[5] || (e[5] = i("div", { class: "wm-onb__section-title" }, "Accès rapide", -1)),
1194
1194
  i("div", Et, [
1195
- (l(!0), d(M, null, j(n.quickLinks, (c, v) => (l(), d("button", {
1195
+ (l(!0), c(T, null, D(n.quickLinks, (d, v) => (l(), c("button", {
1196
1196
  key: v,
1197
1197
  type: "button",
1198
1198
  class: "wm-onb__link",
1199
- onClick: (k) => t.$emit("select", c)
1199
+ onClick: (k) => t.$emit("select", d)
1200
1200
  }, [
1201
- i("span", $t, [
1202
- (l(), d("svg", Rt, [
1201
+ i("span", Lt, [
1202
+ (l(), c("svg", Rt, [
1203
1203
  i("path", {
1204
- d: s.iconPath(c.icon)
1204
+ d: s.iconPath(d.icon)
1205
1205
  }, null, 8, Ft)
1206
1206
  ]))
1207
1207
  ]),
1208
- i("span", jt, b(c.label), 1),
1208
+ i("span", Dt, b(d.label), 1),
1209
1209
  e[4] || (e[4] = i("svg", {
1210
1210
  width: "13",
1211
1211
  height: "13",
@@ -1220,20 +1220,20 @@ function Nt(t, e, n, a, r, s) {
1220
1220
  }, [
1221
1221
  i("path", { d: "M9 18l6-6-6-6" })
1222
1222
  ], -1))
1223
- ], 8, Lt))), 128))
1223
+ ], 8, $t))), 128))
1224
1224
  ])
1225
- ])) : g("", !0),
1226
- i("div", Dt, [
1225
+ ])) : y("", !0),
1226
+ i("div", Nt, [
1227
1227
  i("button", {
1228
1228
  type: "button",
1229
1229
  class: "wm-onb__startBtn",
1230
1230
  disabled: n.busy,
1231
- onClick: e[0] || (e[0] = (c) => t.$emit("start"))
1232
- }, b(n.busy ? "…" : "Commencer une conversation"), 9, Ut)
1231
+ onClick: e[0] || (e[0] = (d) => t.$emit("start"))
1232
+ }, b(n.busy ? "…" : "Commencer une conversation"), 9, jt)
1233
1233
  ])
1234
1234
  ]);
1235
1235
  }
1236
- const Pt = /* @__PURE__ */ E(wt, [["render", Nt], ["__scopeId", "data-v-bd89bc8f"]]);
1236
+ const Pt = /* @__PURE__ */ E(wt, [["render", Ut], ["__scopeId", "data-v-bd89bc8f"]]);
1237
1237
  function Ht(t) {
1238
1238
  return typeof t != "string" ? "" : t.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "$1").replace(/__([^_]+)__/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\s+/g, " ").trim();
1239
1239
  }
@@ -1295,22 +1295,22 @@ const zt = {
1295
1295
  "stroke-linejoin": "round"
1296
1296
  }, Yt = { class: "wm-result__body" }, Jt = { class: "wm-result__label" }, Xt = { class: "wm-result__detail" };
1297
1297
  function Qt(t, e, n, a, r, s) {
1298
- return l(), d("div", {
1298
+ return l(), c("div", {
1299
1299
  class: B(["wm-result", `wm-result--${n.state}`])
1300
1300
  }, [
1301
1301
  i("span", Vt, [
1302
- n.state === "success" ? (l(), d("svg", qt, [...e[0] || (e[0] = [
1302
+ n.state === "success" ? (l(), c("svg", qt, [...e[0] || (e[0] = [
1303
1303
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1304
- ])])) : n.state === "rejected" ? (l(), d("svg", Wt, [...e[1] || (e[1] = [
1304
+ ])])) : n.state === "rejected" ? (l(), c("svg", Wt, [...e[1] || (e[1] = [
1305
1305
  i("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
1306
- ])])) : n.state === "awaiting" ? (l(), d("svg", Kt, [...e[2] || (e[2] = [
1306
+ ])])) : n.state === "awaiting" ? (l(), c("svg", Kt, [...e[2] || (e[2] = [
1307
1307
  i("circle", {
1308
1308
  cx: "12",
1309
1309
  cy: "12",
1310
1310
  r: "10"
1311
1311
  }, null, -1),
1312
1312
  i("polyline", { points: "12 7 12 12 15 14" }, null, -1)
1313
- ])])) : (l(), d("svg", Gt, [...e[3] || (e[3] = [
1313
+ ])])) : (l(), c("svg", Gt, [...e[3] || (e[3] = [
1314
1314
  i("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }, null, -1),
1315
1315
  i("line", {
1316
1316
  x1: "12",
@@ -1328,13 +1328,13 @@ function Qt(t, e, n, a, r, s) {
1328
1328
  ]),
1329
1329
  i("span", Yt, [
1330
1330
  i("span", Jt, b(n.label), 1),
1331
- s.detailText ? (l(), d(M, { key: 0 }, [
1331
+ s.detailText ? (l(), c(T, { key: 0 }, [
1332
1332
  e[4] || (e[4] = i("span", {
1333
1333
  class: "wm-result__sep",
1334
1334
  "aria-hidden": "true"
1335
1335
  }, " · ", -1)),
1336
1336
  i("span", Xt, b(s.detailText), 1)
1337
- ], 64)) : g("", !0)
1337
+ ], 64)) : y("", !0)
1338
1338
  ])
1339
1339
  ], 2);
1340
1340
  }
@@ -1351,7 +1351,7 @@ const Zt = /* @__PURE__ */ E(zt, [["render", Qt], ["__scopeId", "data-v-64a83fb8
1351
1351
  }
1352
1352
  }, tn = { class: "wm-art wm-art--formResponse" }, nn = { class: "wm-art__head" }, sn = { class: "wm-art__title" }, rn = { class: "wm-art__body" }, an = { class: "wm-art__fieldLabel" };
1353
1353
  function on(t, e, n, a, r, s) {
1354
- return l(), d("div", tn, [
1354
+ return l(), c("div", tn, [
1355
1355
  i("div", nn, [
1356
1356
  i("div", sn, b(n.data.title || "Formulaire"), 1),
1357
1357
  e[0] || (e[0] = i("span", { class: "wm-art__badge wm-art__badge--success" }, [
@@ -1368,12 +1368,12 @@ function on(t, e, n, a, r, s) {
1368
1368
  }, [
1369
1369
  i("polyline", { points: "20 6 9 17 4 12" })
1370
1370
  ]),
1371
- oe(" Envoyé ")
1371
+ de(" Envoyé ")
1372
1372
  ], -1))
1373
1373
  ]),
1374
1374
  i("div", rn, [
1375
- (l(!0), d(M, null, j(s.fields, (o, c) => (l(), d("div", {
1376
- key: c,
1375
+ (l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
1376
+ key: d,
1377
1377
  class: "wm-art__field"
1378
1378
  }, [
1379
1379
  i("div", an, b(o.label), 1),
@@ -1384,7 +1384,7 @@ function on(t, e, n, a, r, s) {
1384
1384
  ])
1385
1385
  ]);
1386
1386
  }
1387
- const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9"]]), cn = {
1387
+ const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9"]]), dn = {
1388
1388
  name: "WmArtifactInfoCard",
1389
1389
  props: {
1390
1390
  data: { type: Object, required: !0 }
@@ -1399,7 +1399,7 @@ const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9
1399
1399
  return !!((t = this.data) != null && t.body) || this.fields.length > 0;
1400
1400
  }
1401
1401
  }
1402
- }, dn = { class: "wm-art wm-art--infoCard" }, un = {
1402
+ }, cn = { class: "wm-art wm-art--infoCard" }, un = {
1403
1403
  key: 0,
1404
1404
  class: "wm-art__image"
1405
1405
  }, hn = ["src", "alt"], mn = { class: "wm-art__head" }, fn = { class: "wm-art__headMain" }, _n = { class: "wm-art__title" }, pn = {
@@ -1408,44 +1408,44 @@ const ln = /* @__PURE__ */ E(en, [["render", on], ["__scopeId", "data-v-ca24a9c9
1408
1408
  }, vn = {
1409
1409
  key: 1,
1410
1410
  class: "wm-art__body"
1411
- }, yn = {
1411
+ }, gn = {
1412
1412
  key: 0,
1413
1413
  class: "wm-art__text"
1414
- }, gn = { class: "wm-art__fieldLabel" };
1414
+ }, yn = { class: "wm-art__fieldLabel" };
1415
1415
  function wn(t, e, n, a, r, s) {
1416
- return l(), d("div", dn, [
1417
- n.data.image_url ? (l(), d("figure", un, [
1416
+ return l(), c("div", cn, [
1417
+ n.data.image_url ? (l(), c("figure", un, [
1418
1418
  i("img", {
1419
1419
  src: n.data.image_url,
1420
1420
  alt: n.data.title || "",
1421
1421
  loading: "lazy"
1422
1422
  }, null, 8, hn)
1423
- ])) : g("", !0),
1423
+ ])) : y("", !0),
1424
1424
  i("div", mn, [
1425
1425
  i("div", fn, [
1426
1426
  i("div", _n, b(n.data.title), 1),
1427
- n.data.subtitle ? (l(), d("div", pn, b(n.data.subtitle), 1)) : g("", !0)
1427
+ n.data.subtitle ? (l(), c("div", pn, b(n.data.subtitle), 1)) : y("", !0)
1428
1428
  ]),
1429
- n.data.badge && n.data.badge.label ? (l(), d("span", {
1429
+ n.data.badge && n.data.badge.label ? (l(), c("span", {
1430
1430
  key: 0,
1431
1431
  class: B(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1432
- }, b(n.data.badge.label), 3)) : g("", !0)
1432
+ }, b(n.data.badge.label), 3)) : y("", !0)
1433
1433
  ]),
1434
- s.hasBody ? (l(), d("div", vn, [
1435
- n.data.body ? (l(), d("div", yn, b(n.data.body), 1)) : g("", !0),
1436
- s.fields.length ? (l(!0), d(M, { key: 1 }, j(s.fields, (o, c) => (l(), d("div", {
1437
- key: c,
1434
+ s.hasBody ? (l(), c("div", vn, [
1435
+ n.data.body ? (l(), c("div", gn, b(n.data.body), 1)) : y("", !0),
1436
+ s.fields.length ? (l(!0), c(T, { key: 1 }, D(s.fields, (o, d) => (l(), c("div", {
1437
+ key: d,
1438
1438
  class: "wm-art__field"
1439
1439
  }, [
1440
- i("div", gn, b(o.label), 1),
1440
+ i("div", yn, b(o.label), 1),
1441
1441
  i("div", {
1442
1442
  class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1443
1443
  }, b(o.value), 3)
1444
- ]))), 128)) : g("", !0)
1445
- ])) : g("", !0)
1444
+ ]))), 128)) : y("", !0)
1445
+ ])) : y("", !0)
1446
1446
  ]);
1447
1447
  }
1448
- const bn = /* @__PURE__ */ E(cn, [["render", wn], ["__scopeId", "data-v-d7369333"]]);
1448
+ const bn = /* @__PURE__ */ E(dn, [["render", wn], ["__scopeId", "data-v-d7369333"]]);
1449
1449
  function kn(t) {
1450
1450
  if (!t) return "";
1451
1451
  const e = new Date(t);
@@ -1487,13 +1487,13 @@ const Cn = {
1487
1487
  return /high|haute|élev|elev|critic|critiq|urgent/.test(e) ? 3 : /low|basse|faible|minor/.test(e) ? 1 : 2;
1488
1488
  }
1489
1489
  }
1490
- }, An = { class: "wm-art wm-art--ticket" }, Sn = { class: "wm-art__head wm-tk__head" }, xn = { class: "wm-art__title wm-tk__title" }, Mn = { class: "wm-tk__sub" }, Tn = { class: "wm-tk__ref" }, On = {
1490
+ }, An = { class: "wm-art wm-art--ticket" }, Sn = { class: "wm-art__head wm-tk__head" }, xn = { class: "wm-art__title wm-tk__title" }, Tn = { class: "wm-tk__sub" }, Mn = { class: "wm-tk__ref" }, On = {
1491
1491
  key: 0,
1492
1492
  class: "wm-tk__text"
1493
1493
  }, In = {
1494
1494
  key: 0,
1495
1495
  class: "wm-art__body"
1496
- }, Bn = { class: "wm-art__fieldLabel" }, En = ["data-level"], Ln = {
1496
+ }, Bn = { class: "wm-art__fieldLabel" }, En = ["data-level"], $n = {
1497
1497
  key: 1,
1498
1498
  class: "wm-tk__date",
1499
1499
  width: "12",
@@ -1505,16 +1505,16 @@ const Cn = {
1505
1505
  "stroke-linecap": "round",
1506
1506
  "stroke-linejoin": "round",
1507
1507
  "aria-hidden": "true"
1508
- }, $n = {
1508
+ }, Ln = {
1509
1509
  key: 1,
1510
1510
  class: "wm-art__footer wm-tk__footer"
1511
1511
  };
1512
1512
  function Rn(t, e, n, a, r, s) {
1513
- return l(), d("div", An, [
1513
+ return l(), c("div", An, [
1514
1514
  i("div", Sn, [
1515
1515
  i("div", xn, b(n.data.title), 1),
1516
- i("div", Mn, [
1517
- i("div", Tn, [
1516
+ i("div", Tn, [
1517
+ i("div", Mn, [
1518
1518
  e[0] || (e[0] = i("svg", {
1519
1519
  width: "11",
1520
1520
  height: "11",
@@ -1538,21 +1538,21 @@ function Rn(t, e, n, a, r, s) {
1538
1538
  class: "wm-tk__dot",
1539
1539
  "aria-hidden": "true"
1540
1540
  }, null, -1)),
1541
- oe(" " + b(n.data.status.label), 1)
1541
+ de(" " + b(n.data.status.label), 1)
1542
1542
  ], 2)
1543
1543
  ]),
1544
- n.data.body ? (l(), d("div", On, b(n.data.body), 1)) : g("", !0)
1544
+ n.data.body ? (l(), c("div", On, b(n.data.body), 1)) : y("", !0)
1545
1545
  ]),
1546
- s.fields.length ? (l(), d("div", In, [
1547
- (l(!0), d(M, null, j(s.fields, (o, c) => (l(), d("div", {
1548
- key: c,
1546
+ s.fields.length ? (l(), c("div", In, [
1547
+ (l(!0), c(T, null, D(s.fields, (o, d) => (l(), c("div", {
1548
+ key: d,
1549
1549
  class: "wm-art__field"
1550
1550
  }, [
1551
1551
  i("div", Bn, b(o.label), 1),
1552
1552
  i("div", {
1553
1553
  class: B(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1554
1554
  }, [
1555
- s.isPriority(o.label) ? (l(), d("svg", {
1555
+ s.isPriority(o.label) ? (l(), c("svg", {
1556
1556
  key: 0,
1557
1557
  class: "wm-tk__prio",
1558
1558
  "data-level": s.priorityLevel(o.value),
@@ -1582,7 +1582,7 @@ function Rn(t, e, n, a, r, s) {
1582
1582
  height: "9",
1583
1583
  rx: "0.5"
1584
1584
  }, null, -1)
1585
- ])], 8, En)) : s.isDate(o.label) ? (l(), d("svg", Ln, [...e[3] || (e[3] = [
1585
+ ])], 8, En)) : s.isDate(o.label) ? (l(), c("svg", $n, [...e[3] || (e[3] = [
1586
1586
  i("rect", {
1587
1587
  x: "3",
1588
1588
  y: "4",
@@ -1591,12 +1591,12 @@ function Rn(t, e, n, a, r, s) {
1591
1591
  rx: "2"
1592
1592
  }, null, -1),
1593
1593
  i("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
1594
- ])])) : g("", !0),
1594
+ ])])) : y("", !0),
1595
1595
  i("span", null, b(o.value), 1)
1596
1596
  ], 2)
1597
1597
  ]))), 128))
1598
- ])) : g("", !0),
1599
- n.data.created_at ? (l(), d("div", $n, [
1598
+ ])) : y("", !0),
1599
+ n.data.created_at ? (l(), c("div", Ln, [
1600
1600
  e[4] || (e[4] = i("svg", {
1601
1601
  width: "11",
1602
1602
  height: "11",
@@ -1618,14 +1618,14 @@ function Rn(t, e, n, a, r, s) {
1618
1618
  i("path", { d: "M16 2v4M8 2v4M3 10h18" })
1619
1619
  ], -1)),
1620
1620
  i("span", null, b(s.formattedDate), 1)
1621
- ])) : g("", !0)
1621
+ ])) : y("", !0)
1622
1622
  ]);
1623
1623
  }
1624
- const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7"]]), jn = {
1624
+ const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7"]]), Dn = {
1625
1625
  form_response: ln,
1626
1626
  info_card: bn,
1627
1627
  ticket: Fn
1628
- }, Dn = {
1628
+ }, Nn = {
1629
1629
  name: "WmArtifactRenderer",
1630
1630
  props: {
1631
1631
  // Forme : { kind: string, data: any } (le `data` est validé
@@ -1636,17 +1636,17 @@ const Fn = /* @__PURE__ */ E(Cn, [["render", Rn], ["__scopeId", "data-v-8b274eb7
1636
1636
  component() {
1637
1637
  var e;
1638
1638
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1639
- return t && jn[t] || null;
1639
+ return t && Dn[t] || null;
1640
1640
  }
1641
1641
  }
1642
1642
  };
1643
- function Un(t, e, n, a, r, s) {
1644
- return s.component ? (l(), $(Me(s.component), {
1643
+ function jn(t, e, n, a, r, s) {
1644
+ return s.component ? (l(), $(Te(s.component), {
1645
1645
  key: 0,
1646
1646
  data: n.artifact.data
1647
- }, null, 8, ["data"])) : g("", !0);
1647
+ }, null, 8, ["data"])) : y("", !0);
1648
1648
  }
1649
- const Nn = /* @__PURE__ */ E(Dn, [["render", Un]]), Pn = {
1649
+ const Un = /* @__PURE__ */ E(Nn, [["render", jn]]), Pn = {
1650
1650
  name: "WmAttachmentPreview",
1651
1651
  inject: {
1652
1652
  signAttachmentFn: { default: null }
@@ -1709,10 +1709,10 @@ const Nn = /* @__PURE__ */ E(Dn, [["render", Un]]), Pn = {
1709
1709
  "aria-hidden": "true"
1710
1710
  };
1711
1711
  function Xn(t, e, n, a, r, s) {
1712
- return l(), d("div", {
1712
+ return l(), c("div", {
1713
1713
  class: B(["wm-att", ["wm-att--" + (s.kind || "file")]])
1714
1714
  }, [
1715
- s.kind === "image" && r.url ? (l(), d("a", {
1715
+ s.kind === "image" && r.url ? (l(), c("a", {
1716
1716
  key: 0,
1717
1717
  href: r.url,
1718
1718
  target: "_blank",
@@ -1724,17 +1724,17 @@ function Xn(t, e, n, a, r, s) {
1724
1724
  alt: s.displayName,
1725
1725
  loading: "lazy"
1726
1726
  }, null, 8, zn)
1727
- ], 8, Hn)) : s.kind === "audio" && r.url ? (l(), d("audio", {
1727
+ ], 8, Hn)) : s.kind === "audio" && r.url ? (l(), c("audio", {
1728
1728
  key: 1,
1729
1729
  src: r.url,
1730
1730
  controls: "",
1731
1731
  preload: "metadata"
1732
- }, null, 8, Vn)) : s.kind === "video" && r.url ? (l(), d("video", {
1732
+ }, null, 8, Vn)) : s.kind === "video" && r.url ? (l(), c("video", {
1733
1733
  key: 2,
1734
1734
  src: r.url,
1735
1735
  controls: "",
1736
1736
  preload: "metadata"
1737
- }, null, 8, qn)) : (l(), d("a", {
1737
+ }, null, 8, qn)) : (l(), c("a", {
1738
1738
  key: 3,
1739
1739
  class: "wm-att__file",
1740
1740
  href: r.url || "#",
@@ -1761,9 +1761,9 @@ function Xn(t, e, n, a, r, s) {
1761
1761
  ], -1)),
1762
1762
  i("span", Kn, [
1763
1763
  i("span", Gn, b(s.displayName), 1),
1764
- s.sizeLabel ? (l(), d("span", Yn, b(s.sizeLabel), 1)) : g("", !0)
1764
+ s.sizeLabel ? (l(), c("span", Yn, b(s.sizeLabel), 1)) : y("", !0)
1765
1765
  ]),
1766
- r.loading ? (l(), d("span", Jn)) : g("", !0)
1766
+ r.loading ? (l(), c("span", Jn)) : y("", !0)
1767
1767
  ], 8, Wn))
1768
1768
  ], 2);
1769
1769
  }
@@ -1813,9 +1813,9 @@ function ts(t) {
1813
1813
  n.push({ type: "block", html: `<ul class="wm-md-ul">${w}</ul>` });
1814
1814
  continue;
1815
1815
  }
1816
- const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1817
- if (c) {
1818
- const k = parseInt(c[1], 10), w = [c[2]];
1816
+ const d = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1817
+ if (d) {
1818
+ const k = parseInt(d[1], 10), w = [d[2]];
1819
1819
  for (a++; a < e.length; ) {
1820
1820
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1821
1821
  if (!A) break;
@@ -1840,8 +1840,8 @@ function ts(t) {
1840
1840
  for (let s = 0; s < n.length; s++) {
1841
1841
  const o = n[s];
1842
1842
  r += o.html;
1843
- const c = n[s + 1];
1844
- c && o.type !== "block" && c.type !== "block" && (r += `
1843
+ const d = n[s + 1];
1844
+ d && o.type !== "block" && d.type !== "block" && (r += `
1845
1845
  `);
1846
1846
  }
1847
1847
  return r;
@@ -1860,27 +1860,27 @@ const ns = {
1860
1860
  }
1861
1861
  }, ss = ["innerHTML"];
1862
1862
  function rs(t, e, n, a, r, s) {
1863
- return l(), d("div", {
1863
+ return l(), c("div", {
1864
1864
  class: B(["wm-bubble", "wm-bubble--" + n.role])
1865
1865
  }, [
1866
- Te(t.$slots, "default", {}, () => [
1866
+ Me(t.$slots, "default", {}, () => [
1867
1867
  i("span", { innerHTML: s.rendered }, null, 8, ss)
1868
1868
  ], !0)
1869
1869
  ], 2);
1870
1870
  }
1871
1871
  const is = /* @__PURE__ */ E(ns, [["render", rs], ["__scopeId", "data-v-5c9e9f2b"]]), as = { name: "WmTyping" }, os = { class: "wm-typing" };
1872
1872
  function ls(t, e, n, a, r, s) {
1873
- return l(), d("div", os, [...e[0] || (e[0] = [
1873
+ return l(), c("div", os, [...e[0] || (e[0] = [
1874
1874
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1875
1875
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1876
1876
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1877
1877
  ])]);
1878
1878
  }
1879
- const cs = /* @__PURE__ */ E(as, [["render", ls], ["__scopeId", "data-v-df2447fd"]]);
1880
- function Z(t) {
1879
+ const ds = /* @__PURE__ */ E(as, [["render", ls], ["__scopeId", "data-v-df2447fd"]]);
1880
+ function ee(t) {
1881
1881
  return t ? t.client_msg_id || t.id : "";
1882
1882
  }
1883
- const ds = {
1883
+ const cs = {
1884
1884
  transferred_to_human: "Conversation transférée à un humain",
1885
1885
  assigned: "{name} a rejoint la conversation",
1886
1886
  unassigned: "L'agent a quitté la conversation",
@@ -1889,7 +1889,7 @@ const ds = {
1889
1889
  idle: "Conversation en pause"
1890
1890
  }, us = 80, hs = 200, ms = {
1891
1891
  name: "WmMessageList",
1892
- components: { AIAvatar: te, HumanAvatar: ke, Bubble: is, Typing: cs, ActionResult: Zt, AttachmentPreview: Qn, ArtifactRenderer: Nn },
1892
+ components: { AIAvatar: te, HumanAvatar: ke, Bubble: is, Typing: ds, ActionResult: Zt, AttachmentPreview: Qn, ArtifactRenderer: Un },
1893
1893
  props: {
1894
1894
  messages: { type: Array, default: () => [] },
1895
1895
  streamingActive: { type: Boolean, default: !1 },
@@ -1942,7 +1942,7 @@ const ds = {
1942
1942
  if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
1943
1943
  const k = t[t.length - 1];
1944
1944
  k && k.role === "ai" ? k.messages.push(s) : t.push({
1945
- key: `g-${Z(s)}`,
1945
+ key: `g-${ee(s)}`,
1946
1946
  role: "ai",
1947
1947
  agentName: "",
1948
1948
  agentAvatarUrl: null,
@@ -1952,7 +1952,7 @@ const ds = {
1952
1952
  continue;
1953
1953
  }
1954
1954
  t.push({
1955
- key: `sys-${Z(s)}`,
1955
+ key: `sys-${ee(s)}`,
1956
1956
  role: o,
1957
1957
  messages: [s],
1958
1958
  items: [],
@@ -1960,9 +1960,9 @@ const ds = {
1960
1960
  });
1961
1961
  continue;
1962
1962
  }
1963
- const c = t[t.length - 1];
1964
- c && c.role === o && (o === "ai" || c.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? c.messages.push(s) : t.push({
1965
- key: `g-${Z(s)}`,
1963
+ const d = t[t.length - 1];
1964
+ 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({
1965
+ key: `g-${ee(s)}`,
1966
1966
  role: o,
1967
1967
  agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
1968
1968
  agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
@@ -1973,8 +1973,8 @@ const ds = {
1973
1973
  for (const s of t) {
1974
1974
  if (s.role === "system") continue;
1975
1975
  const o = [];
1976
- for (const c of s.messages)
1977
- for (const v of this.itemsOf(c)) o.push(v);
1976
+ for (const d of s.messages)
1977
+ for (const v of this.itemsOf(d)) o.push(v);
1978
1978
  s.items = o;
1979
1979
  }
1980
1980
  return t;
@@ -2013,7 +2013,7 @@ const ds = {
2013
2013
  this.scheduleMeasure();
2014
2014
  },
2015
2015
  methods: {
2016
- messageKey: Z,
2016
+ messageKey: ee,
2017
2017
  isAtBottom(t) {
2018
2018
  return t.scrollHeight - t.scrollTop - t.clientHeight <= us;
2019
2019
  },
@@ -2194,10 +2194,10 @@ const ds = {
2194
2194
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2195
2195
  // doit garder son arrondi.
2196
2196
  cornersFor(t, e) {
2197
- var Y, H, J;
2198
- const n = t.items, a = (Y = n[e]) == null ? void 0 : Y.kind, r = (H = n[e - 1]) == null ? void 0 : H.kind, s = (J = n[e + 1]) == null ? void 0 : J.kind, o = t.role === "user", c = 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)], P = 0.5, x = (q, z, X) => q != null && S != null ? q + P >= S : z === X || z === "card" && X === "bubble";
2199
- let U = c, F = c, N = c, V = c;
2200
- return o ? (k && (F = v), (w || !s) && (N = v), k && x(R, k, a == null ? void 0 : a.top) && (U = v), w && x(A, w, a == null ? void 0 : a.bottom) && (V = v)) : (k && (U = v), (w || !s) && (V = v), k && x(R, k, a == null ? void 0 : a.top) && (F = v), w && x(A, w, a == null ? void 0 : a.bottom) && (N = v)), { tl: U, tr: F, br: N, bl: V };
2197
+ var Y, z, Q;
2198
+ 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";
2199
+ let j = d, P = d, F = d, H = d;
2200
+ return o ? (k && (P = v), (w || !s) && (F = v), k && x(R, k, a == null ? void 0 : a.top) && (j = v), w && x(A, w, a == null ? void 0 : a.bottom) && (H = v)) : (k && (j = v), (w || !s) && (H = v), k && x(R, k, a == null ? void 0 : a.top) && (P = v), w && x(A, w, a == null ? void 0 : a.bottom) && (F = v)), { tl: j, tr: P, br: F, bl: H };
2201
2201
  },
2202
2202
  // Inline style emitting the four corner CSS variables. Set on
2203
2203
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2218,7 +2218,7 @@ const ds = {
2218
2218
  rowKeyOf(t, e) {
2219
2219
  var a;
2220
2220
  const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
2221
- return n ? `${Z(n.message)}-${n.partKey}` : "";
2221
+ return n ? `${ee(n.message)}-${n.partKey}` : "";
2222
2222
  },
2223
2223
  // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
2224
2224
  // typing, scroll), un seul flush layout par frame suffit.
@@ -2238,9 +2238,9 @@ const ds = {
2238
2238
  for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
2239
2239
  const o = s.dataset.rowKey;
2240
2240
  if (!o) continue;
2241
- const c = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2242
- if (!c) continue;
2243
- const v = c.getBoundingClientRect().width;
2241
+ const d = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2242
+ if (!d) continue;
2243
+ const v = d.getBoundingClientRect().width;
2244
2244
  v > 0 && (e[o] = v);
2245
2245
  }
2246
2246
  const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
@@ -2256,14 +2256,23 @@ const ds = {
2256
2256
  this.widthByKey = Object.freeze(e);
2257
2257
  },
2258
2258
  lastTimeOf(t) {
2259
- const e = t.messages[t.messages.length - 1];
2260
- if (!(e != null && e.created_at)) return "";
2259
+ const e = t.items[t.items.length - 1], n = (e == null ? void 0 : e.message) || t.messages[t.messages.length - 1];
2260
+ if (!(n != null && n.created_at)) return "";
2261
2261
  try {
2262
- return be(new Date(e.created_at));
2262
+ return be(new Date(n.created_at));
2263
2263
  } catch {
2264
2264
  return "";
2265
2265
  }
2266
2266
  },
2267
+ // True quand le DERNIER message du groupe vit uniquement via un
2268
+ // overlay (form-only). On supprime alors la meta-row pour que la
2269
+ // bulle précédente flow visuellement vers l'overlay au lieu d'être
2270
+ // séparée par une estampille rôle + heure.
2271
+ hasTrailingOverlay(t) {
2272
+ if (!t.messages.length) return !1;
2273
+ const e = t.messages[t.messages.length - 1], n = t.items[t.items.length - 1];
2274
+ return !!e && (n == null ? void 0 : n.message) !== e;
2275
+ },
2267
2276
  attachmentsOf(t) {
2268
2277
  var n;
2269
2278
  const e = (n = t == null ? void 0 : t.payload) == null ? void 0 : n.attachments;
@@ -2283,9 +2292,9 @@ const ds = {
2283
2292
  return ((e = t == null ? void 0 : t.payload) == null ? void 0 : e.name) || (t == null ? void 0 : t.text_md) || "Action";
2284
2293
  },
2285
2294
  actionDetail(t) {
2286
- var n, a, r, s, o, c;
2295
+ var n, a, r, s, o, d;
2287
2296
  const e = t == null ? void 0 : t.payload;
2288
- 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) || ((c = e.failure) == null ? void 0 : c.error)) || "" : "";
2297
+ return e ? e.state === "success" ? ((n = e.success) == null ? void 0 : n.summary) || ((r = (a = e.success) == null ? void 0 : a.metadata) == null ? void 0 : r.description) || "" : e.state === "rejected" ? ((s = e.rejected) == null ? void 0 : s.reason) || "Action annulée par l'utilisateur." : e.state === "failure" && (((o = e.failure) == null ? void 0 : o.summary) || ((d = e.failure) == null ? void 0 : d.error)) || "" : "";
2289
2298
  },
2290
2299
  actionArtifact(t) {
2291
2300
  var n, a;
@@ -2294,7 +2303,7 @@ const ds = {
2294
2303
  },
2295
2304
  systemLabel(t) {
2296
2305
  var r, s, o;
2297
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = ds[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) || "";
2306
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = cs[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) || "";
2298
2307
  return n.replace("{name}", a || "Un agent");
2299
2308
  },
2300
2309
  scrollToBottom() {
@@ -2313,10 +2322,10 @@ const ds = {
2313
2322
  }, ps = {
2314
2323
  key: 2,
2315
2324
  class: "wm-list__sep"
2316
- }, vs = { class: "wm-list__sep-label" }, ys = {
2325
+ }, vs = { class: "wm-list__sep-label" }, gs = {
2317
2326
  key: 0,
2318
2327
  class: "wm-list__sep wm-list__sep--unread"
2319
- }, gs = {
2328
+ }, ys = {
2320
2329
  key: 0,
2321
2330
  class: "wm-list__sysep"
2322
2331
  }, ws = { class: "wm-list__sysep-label" }, bs = ["data-row-key"], ks = {
@@ -2328,66 +2337,66 @@ const ds = {
2328
2337
  }, As = { key: 0 }, Ss = {
2329
2338
  key: 1,
2330
2339
  "aria-hidden": "true"
2331
- }, xs = { key: 2 }, Ms = {
2340
+ }, xs = { key: 2 }, Ts = {
2332
2341
  key: 3,
2333
2342
  class: "wm-list__row wm-list__row--ai fade-up"
2334
- }, Ts = { class: "wm-list__avatarSlot" };
2343
+ }, Ms = { class: "wm-list__avatarSlot" };
2335
2344
  function Os(t, e, n, a, r, s) {
2336
- const o = I("AIAvatar"), c = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
2337
- return l(), d("div", {
2345
+ const o = I("AIAvatar"), d = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), w = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
2346
+ return l(), c("div", {
2338
2347
  ref: "scrollEl",
2339
2348
  class: B(["wm-list", { "wm-list--silent": r.silentFades }]),
2340
2349
  onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2341
2350
  }, [
2342
- n.loadingMore ? (l(), d("div", fs, [...e[1] || (e[1] = [
2351
+ n.loadingMore ? (l(), c("div", fs, [...e[1] || (e[1] = [
2343
2352
  i("span", {
2344
2353
  class: "wm-list__loadMore-spinner",
2345
2354
  "aria-hidden": "true"
2346
2355
  }, null, -1),
2347
2356
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2348
- ])])) : s.historyExhausted ? (l(), d("div", _s, "Début de la conversation")) : g("", !0),
2349
- n.dateLabel ? (l(), d("div", ps, [
2357
+ ])])) : s.historyExhausted ? (l(), c("div", _s, "Début de la conversation")) : y("", !0),
2358
+ n.dateLabel ? (l(), c("div", ps, [
2350
2359
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2351
2360
  i("span", vs, b(n.dateLabel), 1),
2352
2361
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2353
- ])) : g("", !0),
2354
- (l(!0), d(M, null, j(s.groups, (A, P) => (l(), d(M, {
2362
+ ])) : y("", !0),
2363
+ (l(!0), c(T, null, D(s.groups, (A, U) => (l(), c(T, {
2355
2364
  key: A.key
2356
2365
  }, [
2357
- A.key === s.unreadGroupKey ? (l(), d("div", ys, [...e[4] || (e[4] = [
2366
+ A.key === s.unreadGroupKey ? (l(), c("div", gs, [...e[4] || (e[4] = [
2358
2367
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2359
2368
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2360
2369
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
2361
- ])])) : g("", !0),
2362
- A.role === "system" || A.items.length ? (l(), d("div", {
2370
+ ])])) : y("", !0),
2371
+ A.role === "system" || A.items.length ? (l(), c("div", {
2363
2372
  key: 1,
2364
2373
  class: B(["wm-list__group", "wm-list__group--" + A.role])
2365
2374
  }, [
2366
- A.role === "system" ? (l(), d("div", gs, [
2375
+ A.role === "system" ? (l(), c("div", ys, [
2367
2376
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2368
2377
  i("span", ws, b(A.systemLabel), 1),
2369
2378
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2370
- ])) : (l(), d(M, { key: 1 }, [
2371
- (l(!0), d(M, null, j(A.items, (x, U) => (l(), d("div", {
2379
+ ])) : (l(), c(T, { key: 1 }, [
2380
+ (l(!0), c(T, null, D(A.items, (x, j) => (l(), c("div", {
2372
2381
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2373
2382
  "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2374
2383
  class: B(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2375
- style: G(s.cornersStyle(A, U))
2384
+ style: G(s.cornersStyle(A, j))
2376
2385
  }, [
2377
- A.role !== "user" ? (l(), d("div", ks, [
2378
- U === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2386
+ A.role !== "user" ? (l(), c("div", ks, [
2387
+ j === A.items.length - 1 ? (l(), c(T, { key: 0 }, [
2379
2388
  A.role === "ai" ? (l(), $(o, {
2380
2389
  key: 0,
2381
2390
  size: 26,
2382
2391
  tail: !0
2383
- })) : (l(), $(c, {
2392
+ })) : (l(), $(d, {
2384
2393
  key: 1,
2385
2394
  name: A.agentName,
2386
2395
  "avatar-url": A.agentAvatarUrl,
2387
2396
  size: 26
2388
2397
  }, null, 8, ["name", "avatar-url"]))
2389
- ], 64)) : g("", !0)
2390
- ])) : g("", !0),
2398
+ ], 64)) : y("", !0)
2399
+ ])) : y("", !0),
2391
2400
  x.renderAs === "action" ? (l(), $(v, {
2392
2401
  key: 1,
2393
2402
  state: x.message.payload.state,
@@ -2404,48 +2413,48 @@ function Os(t, e, n, a, r, s) {
2404
2413
  }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
2405
2414
  key: 4,
2406
2415
  artifact: s.artifactOf(x.message)
2407
- }, null, 8, ["artifact"])) : (l(), d("div", Cs, [
2416
+ }, null, 8, ["artifact"])) : (l(), c("div", Cs, [
2408
2417
  x.message.text_md ? (l(), $(w, {
2409
2418
  key: 0,
2410
2419
  role: A.role,
2411
2420
  text: x.message.text_md
2412
- }, null, 8, ["role", "text"])) : g("", !0),
2413
- s.attachmentsOf(x.message).length ? (l(), d("div", {
2421
+ }, null, 8, ["role", "text"])) : y("", !0),
2422
+ s.attachmentsOf(x.message).length ? (l(), c("div", {
2414
2423
  key: 1,
2415
2424
  class: B(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2416
2425
  }, [
2417
- (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, N) => (l(), $(S, {
2418
- key: `${s.messageKey(x.message)}-att-${N}`,
2419
- attachment: F
2426
+ (l(!0), c(T, null, D(s.attachmentsOf(x.message), (P, F) => (l(), $(S, {
2427
+ key: `${s.messageKey(x.message)}-att-${F}`,
2428
+ attachment: P
2420
2429
  }, null, 8, ["attachment"]))), 128))
2421
- ], 2)) : g("", !0)
2430
+ ], 2)) : y("", !0)
2422
2431
  ]))
2423
2432
  ], 14, bs))), 128)),
2424
- A.role !== "user" || s.lastTimeOf(A) ? (l(), d("div", {
2433
+ (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (l(), c("div", {
2425
2434
  key: 0,
2426
2435
  class: B(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2427
2436
  }, [
2428
- A.role !== "user" ? (l(), d("span", As, b(s.roleLabel(A)), 1)) : g("", !0),
2429
- A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", Ss, "·")) : g("", !0),
2430
- s.lastTimeOf(A) ? (l(), d("span", xs, b(s.lastTimeOf(A)), 1)) : g("", !0)
2431
- ], 2)) : g("", !0)
2437
+ A.role !== "user" ? (l(), c("span", As, b(s.roleLabel(A)), 1)) : y("", !0),
2438
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), c("span", Ss, "·")) : y("", !0),
2439
+ s.lastTimeOf(A) ? (l(), c("span", xs, b(s.lastTimeOf(A)), 1)) : y("", !0)
2440
+ ], 2)) : y("", !0)
2432
2441
  ], 64))
2433
- ], 2)) : g("", !0)
2442
+ ], 2)) : y("", !0)
2434
2443
  ], 64))), 128)),
2435
- n.streamingActive ? (l(), d("div", Ms, [
2436
- i("div", Ts, [
2444
+ n.streamingActive ? (l(), c("div", Ts, [
2445
+ i("div", Ms, [
2437
2446
  K(o, {
2438
2447
  size: 26,
2439
2448
  tail: !0
2440
2449
  })
2441
2450
  ]),
2442
2451
  K(R)
2443
- ])) : g("", !0)
2452
+ ])) : y("", !0)
2444
2453
  ], 34);
2445
2454
  }
2446
- const Is = /* @__PURE__ */ E(ms, [["render", Os], ["__scopeId", "data-v-1a58c545"]]), ie = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2455
+ const Is = /* @__PURE__ */ E(ms, [["render", Os], ["__scopeId", "data-v-6bd35fa5"]]), oe = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", me = typeof window < "u" && typeof window.MediaRecorder < "u";
2447
2456
  function Bs() {
2448
- return he && [
2457
+ return me && [
2449
2458
  "video/webm;codecs=vp9,opus",
2450
2459
  "video/webm;codecs=vp8,opus",
2451
2460
  "video/webm",
@@ -2464,11 +2473,11 @@ function Ce({ audio: t }) {
2464
2473
  systemAudio: t ? "include" : "exclude"
2465
2474
  };
2466
2475
  }
2467
- function zi(t) {
2476
+ function ea(t) {
2468
2477
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2469
2478
  }
2470
2479
  async function Es() {
2471
- if (!ie) return null;
2480
+ if (!oe) return null;
2472
2481
  let t;
2473
2482
  try {
2474
2483
  t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
@@ -2476,7 +2485,7 @@ async function Es() {
2476
2485
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2477
2486
  }
2478
2487
  try {
2479
- return await Ls(t);
2488
+ return await $s(t);
2480
2489
  } catch (e) {
2481
2490
  return console.error("[media] screenshot capture", e), null;
2482
2491
  } finally {
@@ -2485,19 +2494,19 @@ async function Es() {
2485
2494
  });
2486
2495
  }
2487
2496
  }
2488
- async function Ls(t) {
2497
+ async function $s(t) {
2489
2498
  const e = document.createElement("video");
2490
- e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((c) => requestAnimationFrame(c));
2499
+ e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((d) => requestAnimationFrame(d));
2491
2500
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
2492
2501
  r.width = n, r.height = a, r.getContext("2d").drawImage(e, 0, 0, n, a);
2493
- const s = await new Promise((c, v) => {
2494
- r.toBlob((k) => k ? c(k) : v(new Error("toBlob failed")), "image/png");
2502
+ const s = await new Promise((d, v) => {
2503
+ r.toBlob((k) => k ? d(k) : v(new Error("toBlob failed")), "image/png");
2495
2504
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2496
2505
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2497
2506
  }
2498
- async function $s(t = {}) {
2507
+ async function Ls(t = {}) {
2499
2508
  var k;
2500
- if (!ie || !he) return null;
2509
+ if (!oe || !me) return null;
2501
2510
  let e;
2502
2511
  try {
2503
2512
  e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
@@ -2522,14 +2531,14 @@ async function $s(t = {}) {
2522
2531
  if (s && clearInterval(s), e.getTracks().forEach((R) => {
2523
2532
  R.stop();
2524
2533
  }), r.length) {
2525
- const R = a.mimeType || n || "video/webm", A = new Blob(r, { type: R }), P = /mp4/.test(R) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${x}.${P}`, { type: R });
2526
- (w = t.onfinalize) == null || w.call(t, U);
2534
+ 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 });
2535
+ (w = t.onfinalize) == null || w.call(t, j);
2527
2536
  } else
2528
2537
  (S = t.oncancel) == null || S.call(t);
2529
2538
  }), e.getVideoTracks().forEach((w) => {
2530
- w.addEventListener("ended", () => c(), { once: !0 });
2539
+ w.addEventListener("ended", () => d(), { once: !0 });
2531
2540
  });
2532
- function c() {
2541
+ function d() {
2533
2542
  if (!o && (o = !0, a.state !== "inactive"))
2534
2543
  try {
2535
2544
  a.stop();
@@ -2550,7 +2559,7 @@ async function $s(t = {}) {
2550
2559
  var w;
2551
2560
  (w = t.ontick) == null || w.call(t, Date.now() - v);
2552
2561
  }, 500), {
2553
- stop: c,
2562
+ stop: d,
2554
2563
  get state() {
2555
2564
  return a.state;
2556
2565
  }
@@ -2597,7 +2606,7 @@ const Rs = [
2597
2606
  attachItems() {
2598
2607
  return Rs.map((t) => ({
2599
2608
  ...t,
2600
- disabled: t.action === "screenshot" && !ie || t.action === "record" && (!ie || !he)
2609
+ disabled: t.action === "screenshot" && !oe || t.action === "record" && (!oe || !me)
2601
2610
  }));
2602
2611
  },
2603
2612
  recordingElapsedLabel() {
@@ -2673,7 +2682,7 @@ const Rs = [
2673
2682
  async startRecording() {
2674
2683
  if (this.recording || this.disabled) return;
2675
2684
  this.recordingElapsed = 0;
2676
- const t = await $s({
2685
+ const t = await Ls({
2677
2686
  onstart: () => {
2678
2687
  this.recording = !0;
2679
2688
  },
@@ -2698,10 +2707,10 @@ const Rs = [
2698
2707
  }
2699
2708
  }
2700
2709
  }
2701
- }, js = { class: "wm-compose-wrap" }, Ds = {
2710
+ }, Ds = { class: "wm-compose-wrap" }, Ns = {
2702
2711
  key: 0,
2703
2712
  class: "wm-rec"
2704
- }, Us = { class: "wm-rec__lbl" }, Ns = {
2713
+ }, js = { class: "wm-rec__lbl" }, Us = {
2705
2714
  key: 1,
2706
2715
  class: "wm-compose__menu",
2707
2716
  role: "menu"
@@ -2712,22 +2721,22 @@ const Rs = [
2712
2721
  "aria-hidden": "true"
2713
2722
  }, Vs = ["d"], qs = ["placeholder", "disabled"], Ws = { class: "wm-compose__actions" }, Ks = ["title", "aria-label", "disabled"], Gs = ["disabled"];
2714
2723
  function Ys(t, e, n, a, r, s) {
2715
- return l(), d("div", js, [
2716
- r.recording ? (l(), d("div", Ds, [
2724
+ return l(), c("div", Ds, [
2725
+ r.recording ? (l(), c("div", Ns, [
2717
2726
  e[8] || (e[8] = i("span", {
2718
2727
  class: "wm-rec__dot",
2719
2728
  "aria-hidden": "true"
2720
2729
  }, null, -1)),
2721
- i("span", Us, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2730
+ i("span", js, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2722
2731
  i("button", {
2723
2732
  type: "button",
2724
2733
  class: "wm-rec__stop",
2725
2734
  onClick: e[0] || (e[0] = (...o) => s.stopRecording && s.stopRecording(...o))
2726
2735
  }, "Arrêter")
2727
- ])) : g("", !0),
2736
+ ])) : y("", !0),
2728
2737
  i("form", {
2729
2738
  class: B(["wm-compose", { "has-attach": r.attachOpen }]),
2730
- onSubmit: e[7] || (e[7] = ee((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2739
+ onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2731
2740
  }, [
2732
2741
  i("input", {
2733
2742
  ref: "fileEl",
@@ -2736,21 +2745,21 @@ function Ys(t, e, n, a, r, s) {
2736
2745
  multiple: "",
2737
2746
  onChange: e[1] || (e[1] = (...o) => s.onFile && s.onFile(...o))
2738
2747
  }, null, 544),
2739
- r.attachOpen ? (l(), d("div", {
2748
+ r.attachOpen ? (l(), c("div", {
2740
2749
  key: 0,
2741
2750
  class: "wm-compose__overlay",
2742
2751
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2743
- })) : g("", !0),
2744
- r.attachOpen ? (l(), d("div", Ns, [
2745
- (l(!0), d(M, null, j(s.attachItems, (o) => (l(), d("button", {
2752
+ })) : y("", !0),
2753
+ r.attachOpen ? (l(), c("div", Us, [
2754
+ (l(!0), c(T, null, D(s.attachItems, (o) => (l(), c("button", {
2746
2755
  key: o.action,
2747
2756
  type: "button",
2748
2757
  class: "wm-compose__menuItem",
2749
2758
  disabled: o.disabled,
2750
- onClick: (c) => s.onAttachAction(o.action)
2759
+ onClick: (d) => s.onAttachAction(o.action)
2751
2760
  }, [
2752
2761
  i("span", Hs, [
2753
- (l(), d("svg", zs, [
2762
+ (l(), c("svg", zs, [
2754
2763
  i("path", {
2755
2764
  d: o.path,
2756
2765
  stroke: "currentColor",
@@ -2763,8 +2772,8 @@ function Ys(t, e, n, a, r, s) {
2763
2772
  ]),
2764
2773
  i("span", null, b(o.label), 1)
2765
2774
  ], 8, Ps))), 128))
2766
- ])) : g("", !0),
2767
- W(i("textarea", {
2775
+ ])) : y("", !0),
2776
+ q(i("textarea", {
2768
2777
  ref: "inputEl",
2769
2778
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2770
2779
  class: "wm-compose__input",
@@ -2774,7 +2783,7 @@ function Ys(t, e, n, a, r, s) {
2774
2783
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2775
2784
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2776
2785
  }, null, 40, qs), [
2777
- [Q, r.local]
2786
+ [J, r.local]
2778
2787
  ]),
2779
2788
  i("div", Ws, [
2780
2789
  i("button", {
@@ -2842,18 +2851,18 @@ const Js = /* @__PURE__ */ E(Fs, [["render", Ys], ["__scopeId", "data-v-14fa9ec0
2842
2851
  }
2843
2852
  }, Qs = ["onClick"];
2844
2853
  function Zs(t, e, n, a, r, s) {
2845
- return n.items.length ? (l(), d("div", {
2854
+ return n.items.length ? (l(), c("div", {
2846
2855
  key: s.batchKey,
2847
2856
  class: "wm-chips"
2848
2857
  }, [
2849
- (l(!0), d(M, null, j(n.items, (o, c) => (l(), d("button", {
2850
- key: c,
2858
+ (l(!0), c(T, null, D(n.items, (o, d) => (l(), c("button", {
2859
+ key: d,
2851
2860
  type: "button",
2852
2861
  class: "wm-chip",
2853
- style: G({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2862
+ style: G({ animationDelay: n.baseDelay + d * n.stepDelay + "ms" }),
2854
2863
  onClick: (v) => t.$emit("select", o)
2855
2864
  }, b(o.label), 13, Qs))), 128))
2856
- ])) : g("", !0);
2865
+ ])) : y("", !0);
2857
2866
  }
2858
2867
  const er = /* @__PURE__ */ E(Xs, [["render", Zs], ["__scopeId", "data-v-55aa529d"]]), tr = {
2859
2868
  name: "WmApprovalCard",
@@ -2892,35 +2901,35 @@ const er = /* @__PURE__ */ E(Xs, [["render", Zs], ["__scopeId", "data-v-55aa529d
2892
2901
  key: 0,
2893
2902
  class: "wm-approval__detail"
2894
2903
  }, lr = { class: "wm-approval__actions" };
2895
- function cr(t, e, n, a, r, s) {
2904
+ function dr(t, e, n, a, r, s) {
2896
2905
  const o = I("AIAvatar");
2897
- return l(), d("div", nr, [
2906
+ return l(), c("div", nr, [
2898
2907
  i("div", sr, [
2899
2908
  i("div", rr, [
2900
2909
  K(o, { size: 24 })
2901
2910
  ]),
2902
2911
  i("div", ir, [
2903
2912
  i("div", ar, b(n.action), 1),
2904
- n.detail ? (l(), d("div", or, b(n.detail), 1)) : g("", !0)
2913
+ n.detail ? (l(), c("div", or, b(n.detail), 1)) : y("", !0)
2905
2914
  ])
2906
2915
  ]),
2907
2916
  i("div", lr, [
2908
- s.rejectId ? (l(), d("button", {
2917
+ s.rejectId ? (l(), c("button", {
2909
2918
  key: 0,
2910
2919
  type: "button",
2911
2920
  class: "wm-approval__btn wm-approval__btn--neutral",
2912
- onClick: e[0] || (e[0] = (c) => t.$emit("callback", s.rejectId))
2913
- }, b(s.rejectLabel), 1)) : g("", !0),
2914
- s.approveId ? (l(), d("button", {
2921
+ onClick: e[0] || (e[0] = (d) => t.$emit("callback", s.rejectId))
2922
+ }, b(s.rejectLabel), 1)) : y("", !0),
2923
+ s.approveId ? (l(), c("button", {
2915
2924
  key: 1,
2916
2925
  type: "button",
2917
2926
  class: "wm-approval__btn wm-approval__btn--primary",
2918
- onClick: e[1] || (e[1] = (c) => t.$emit("callback", s.approveId))
2919
- }, b(s.approveLabel), 1)) : g("", !0)
2927
+ onClick: e[1] || (e[1] = (d) => t.$emit("callback", s.approveId))
2928
+ }, b(s.approveLabel), 1)) : y("", !0)
2920
2929
  ])
2921
2930
  ]);
2922
2931
  }
2923
- const dr = /* @__PURE__ */ E(tr, [["render", cr], ["__scopeId", "data-v-b1be139c"]]);
2932
+ const cr = /* @__PURE__ */ E(tr, [["render", dr], ["__scopeId", "data-v-b1be139c"]]);
2924
2933
  let ve = 0;
2925
2934
  const ur = /* @__PURE__ */ new Set([
2926
2935
  "text",
@@ -3004,17 +3013,17 @@ const ur = /* @__PURE__ */ new Set([
3004
3013
  }
3005
3014
  }
3006
3015
  }
3007
- }, mr = { class: "wm-form" }, fr = { class: "wm-form__head" }, _r = { class: "wm-form__icon" }, pr = { class: "wm-form__main" }, vr = { class: "wm-form__title" }, yr = {
3016
+ }, mr = { class: "wm-form" }, fr = { class: "wm-form__head" }, _r = { class: "wm-form__icon" }, pr = { class: "wm-form__main" }, vr = { class: "wm-form__title" }, gr = {
3008
3017
  key: 0,
3009
3018
  class: "wm-form__detail"
3010
- }, gr = ["for"], wr = {
3019
+ }, yr = ["for"], wr = {
3011
3020
  key: 0,
3012
3021
  class: "wm-form__req",
3013
3022
  "aria-hidden": "true"
3014
3023
  }, br = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], kr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Cr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Ar = ["id", "onUpdate:modelValue", "required", "disabled"], Sr = {
3015
3024
  key: 4,
3016
3025
  class: "wm-form__bool"
3017
- }, xr = ["id", "onUpdate:modelValue", "disabled"], Mr = ["id", "onUpdate:modelValue", "required", "disabled"], Tr = {
3026
+ }, xr = ["id", "onUpdate:modelValue", "disabled"], Tr = ["id", "onUpdate:modelValue", "required", "disabled"], Mr = {
3018
3027
  value: "",
3019
3028
  disabled: ""
3020
3029
  }, Or = ["value"], Ir = {
@@ -3023,7 +3032,7 @@ const ur = /* @__PURE__ */ new Set([
3023
3032
  }, Br = ["value", "checked", "disabled", "onChange"], Er = {
3024
3033
  key: 0,
3025
3034
  class: "wm-form__err"
3026
- }, Lr = ["disabled"], $r = {
3035
+ }, $r = ["disabled"], Lr = {
3027
3036
  key: 0,
3028
3037
  class: "wm-form__spinner",
3029
3038
  "aria-hidden": "true"
@@ -3033,134 +3042,134 @@ const ur = /* @__PURE__ */ new Set([
3033
3042
  };
3034
3043
  function Fr(t, e, n, a, r, s) {
3035
3044
  const o = I("AIAvatar");
3036
- return l(), d("div", mr, [
3045
+ return l(), c("div", mr, [
3037
3046
  i("div", fr, [
3038
3047
  i("div", _r, [
3039
3048
  K(o, { size: 24 })
3040
3049
  ]),
3041
3050
  i("div", pr, [
3042
3051
  i("div", vr, b(n.form.title || "Formulaire"), 1),
3043
- n.form.description ? (l(), d("div", yr, b(n.form.description), 1)) : g("", !0)
3052
+ n.form.description ? (l(), c("div", gr, b(n.form.description), 1)) : y("", !0)
3044
3053
  ])
3045
3054
  ]),
3046
3055
  i("form", {
3047
3056
  class: "wm-form__body",
3048
- onSubmit: e[0] || (e[0] = ee((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
3057
+ onSubmit: e[0] || (e[0] = X((...d) => s.onSubmit && s.onSubmit(...d), ["prevent"]))
3049
3058
  }, [
3050
- (l(!0), d(M, null, j(s.normalizedFields, (c) => (l(), d("div", {
3051
- key: c.key,
3059
+ (l(!0), c(T, null, D(s.normalizedFields, (d) => (l(), c("div", {
3060
+ key: d.key,
3052
3061
  class: "wm-form__field"
3053
3062
  }, [
3054
3063
  i("label", {
3055
- for: `wm-f-${r._uid}-${c.key}`,
3064
+ for: `wm-f-${r._uid}-${d.key}`,
3056
3065
  class: "wm-form__label"
3057
3066
  }, [
3058
- oe(b(c.label), 1),
3059
- c.required ? (l(), d("span", wr, "*")) : g("", !0)
3060
- ], 8, gr),
3061
- c.type === "text" ? W((l(), d("input", {
3067
+ de(b(d.label), 1),
3068
+ d.required ? (l(), c("span", wr, "*")) : y("", !0)
3069
+ ], 8, yr),
3070
+ d.type === "text" ? q((l(), c("input", {
3062
3071
  key: 0,
3063
- id: `wm-f-${r._uid}-${c.key}`,
3064
- "onUpdate:modelValue": (v) => r.values[c.key] = v,
3072
+ id: `wm-f-${r._uid}-${d.key}`,
3073
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
3065
3074
  type: "text",
3066
3075
  class: "wm-form__input",
3067
- placeholder: c.placeholder || "",
3068
- required: c.required,
3076
+ placeholder: d.placeholder || "",
3077
+ required: d.required,
3069
3078
  disabled: n.readOnly || r.busy
3070
3079
  }, null, 8, br)), [
3071
- [Q, r.values[c.key]]
3072
- ]) : c.type === "textarea" ? W((l(), d("textarea", {
3080
+ [J, r.values[d.key]]
3081
+ ]) : d.type === "textarea" ? q((l(), c("textarea", {
3073
3082
  key: 1,
3074
- id: `wm-f-${r._uid}-${c.key}`,
3075
- "onUpdate:modelValue": (v) => r.values[c.key] = v,
3083
+ id: `wm-f-${r._uid}-${d.key}`,
3084
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
3076
3085
  class: "wm-form__textarea",
3077
3086
  rows: "3",
3078
- placeholder: c.placeholder || "",
3079
- required: c.required,
3087
+ placeholder: d.placeholder || "",
3088
+ required: d.required,
3080
3089
  disabled: n.readOnly || r.busy
3081
3090
  }, null, 8, kr)), [
3082
- [Q, r.values[c.key]]
3083
- ]) : c.type === "number" ? W((l(), d("input", {
3091
+ [J, r.values[d.key]]
3092
+ ]) : d.type === "number" ? q((l(), c("input", {
3084
3093
  key: 2,
3085
- id: `wm-f-${r._uid}-${c.key}`,
3086
- "onUpdate:modelValue": (v) => r.values[c.key] = v,
3094
+ id: `wm-f-${r._uid}-${d.key}`,
3095
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
3087
3096
  type: "number",
3088
3097
  class: "wm-form__input",
3089
- placeholder: c.placeholder || "",
3090
- required: c.required,
3098
+ placeholder: d.placeholder || "",
3099
+ required: d.required,
3091
3100
  disabled: n.readOnly || r.busy
3092
3101
  }, null, 8, Cr)), [
3093
3102
  [
3094
- Q,
3095
- r.values[c.key],
3103
+ J,
3104
+ r.values[d.key],
3096
3105
  void 0,
3097
3106
  { number: !0 }
3098
3107
  ]
3099
- ]) : c.type === "date" ? W((l(), d("input", {
3108
+ ]) : d.type === "date" ? q((l(), c("input", {
3100
3109
  key: 3,
3101
- id: `wm-f-${r._uid}-${c.key}`,
3102
- "onUpdate:modelValue": (v) => r.values[c.key] = v,
3110
+ id: `wm-f-${r._uid}-${d.key}`,
3111
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
3103
3112
  type: "date",
3104
3113
  class: "wm-form__input",
3105
- required: c.required,
3114
+ required: d.required,
3106
3115
  disabled: n.readOnly || r.busy
3107
3116
  }, null, 8, Ar)), [
3108
- [Q, r.values[c.key]]
3109
- ]) : c.type === "boolean" ? (l(), d("label", Sr, [
3110
- W(i("input", {
3111
- id: `wm-f-${r._uid}-${c.key}`,
3112
- "onUpdate:modelValue": (v) => r.values[c.key] = v,
3117
+ [J, r.values[d.key]]
3118
+ ]) : d.type === "boolean" ? (l(), c("label", Sr, [
3119
+ q(i("input", {
3120
+ id: `wm-f-${r._uid}-${d.key}`,
3121
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
3113
3122
  type: "checkbox",
3114
3123
  disabled: n.readOnly || r.busy
3115
3124
  }, null, 8, xr), [
3116
- [Oe, r.values[c.key]]
3125
+ [Oe, r.values[d.key]]
3117
3126
  ]),
3118
- i("span", null, b(c.placeholder || "Oui"), 1)
3119
- ])) : c.type === "select" ? W((l(), d("select", {
3127
+ i("span", null, b(d.placeholder || "Oui"), 1)
3128
+ ])) : d.type === "select" ? q((l(), c("select", {
3120
3129
  key: 5,
3121
- id: `wm-f-${r._uid}-${c.key}`,
3122
- "onUpdate:modelValue": (v) => r.values[c.key] = v,
3130
+ id: `wm-f-${r._uid}-${d.key}`,
3131
+ "onUpdate:modelValue": (v) => r.values[d.key] = v,
3123
3132
  class: "wm-form__select",
3124
- required: c.required,
3133
+ required: d.required,
3125
3134
  disabled: n.readOnly || r.busy
3126
3135
  }, [
3127
- i("option", Tr, b(c.placeholder || "Choisir…"), 1),
3128
- (l(!0), d(M, null, j(c.options, (v) => (l(), d("option", {
3136
+ i("option", Mr, b(d.placeholder || "Choisir…"), 1),
3137
+ (l(!0), c(T, null, D(d.options, (v) => (l(), c("option", {
3129
3138
  key: v.value,
3130
3139
  value: v.value
3131
3140
  }, b(v.label), 9, Or))), 128))
3132
- ], 8, Mr)), [
3133
- [Ie, r.values[c.key]]
3134
- ]) : c.type === "multiselect" ? (l(), d("div", Ir, [
3135
- (l(!0), d(M, null, j(c.options, (v) => (l(), d("label", {
3141
+ ], 8, Tr)), [
3142
+ [Ie, r.values[d.key]]
3143
+ ]) : d.type === "multiselect" ? (l(), c("div", Ir, [
3144
+ (l(!0), c(T, null, D(d.options, (v) => (l(), c("label", {
3136
3145
  key: v.value,
3137
3146
  class: "wm-form__multiItem"
3138
3147
  }, [
3139
3148
  i("input", {
3140
3149
  type: "checkbox",
3141
3150
  value: v.value,
3142
- checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(v.value),
3151
+ checked: Array.isArray(r.values[d.key]) && r.values[d.key].includes(v.value),
3143
3152
  disabled: n.readOnly || r.busy,
3144
- onChange: (k) => s.toggleMulti(c.key, v.value, k.target.checked)
3153
+ onChange: (k) => s.toggleMulti(d.key, v.value, k.target.checked)
3145
3154
  }, null, 40, Br),
3146
3155
  i("span", null, b(v.label), 1)
3147
3156
  ]))), 128))
3148
- ])) : g("", !0)
3157
+ ])) : y("", !0)
3149
3158
  ]))), 128)),
3150
- r.error ? (l(), d("div", Er, b(r.error), 1)) : g("", !0),
3151
- n.readOnly ? (l(), d("div", Rr, "Réponse envoyée")) : (l(), d("button", {
3159
+ r.error ? (l(), c("div", Er, b(r.error), 1)) : y("", !0),
3160
+ n.readOnly ? (l(), c("div", Rr, "Réponse envoyée")) : (l(), c("button", {
3152
3161
  key: 1,
3153
3162
  type: "submit",
3154
3163
  class: "wm-form__submit",
3155
3164
  disabled: r.busy
3156
3165
  }, [
3157
- r.busy ? (l(), d("span", $r)) : g("", !0),
3166
+ r.busy ? (l(), c("span", Lr)) : y("", !0),
3158
3167
  i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3159
- ], 8, Lr))
3168
+ ], 8, $r))
3160
3169
  ], 32)
3161
3170
  ]);
3162
3171
  }
3163
- const jr = /* @__PURE__ */ E(hr, [["render", Fr], ["__scopeId", "data-v-64b40f76"]]), Dr = {
3172
+ const Dr = /* @__PURE__ */ E(hr, [["render", Fr], ["__scopeId", "data-v-64b40f76"]]), Nr = {
3164
3173
  name: "WmFeedback",
3165
3174
  props: {
3166
3175
  busy: { type: Boolean, default: !1 },
@@ -3184,23 +3193,23 @@ const jr = /* @__PURE__ */ E(hr, [["render", Fr], ["__scopeId", "data-v-64b40f76
3184
3193
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
3185
3194
  }
3186
3195
  }
3187
- }, Ur = { class: "wm-fb" }, Nr = { class: "wm-fb__row" }, Pr = ["onClick"], Hr = { class: "wm-fb__emoji" }, zr = { class: "wm-fb__label" }, Vr = ["disabled"], qr = {
3196
+ }, jr = { class: "wm-fb" }, Ur = { class: "wm-fb__row" }, Pr = ["onClick"], Hr = { class: "wm-fb__emoji" }, zr = { class: "wm-fb__label" }, Vr = ["disabled"], qr = {
3188
3197
  key: 1,
3189
3198
  class: "wm-fb__done"
3190
3199
  };
3191
3200
  function Wr(t, e, n, a, r, s) {
3192
- return l(), d("div", Ur, [
3193
- n.done ? (l(), d("div", qr, [...e[3] || (e[3] = [
3194
- 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)
3195
- ])])) : (l(), d(M, { key: 0 }, [
3201
+ return l(), c("div", jr, [
3202
+ n.done ? (l(), c("div", qr, [...e[3] || (e[3] = [
3203
+ 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)
3204
+ ])])) : (l(), c(T, { key: 0 }, [
3196
3205
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3197
3206
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3198
- i("div", Nr, [
3199
- (l(!0), d(M, null, j(r.options, (o) => (l(), d("button", {
3207
+ i("div", Ur, [
3208
+ (l(!0), c(T, null, D(r.options, (o) => (l(), c("button", {
3200
3209
  key: o.v,
3201
3210
  type: "button",
3202
3211
  class: B(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
3203
- onClick: (c) => r.sel = o.v
3212
+ onClick: (d) => r.sel = o.v
3204
3213
  }, [
3205
3214
  i("span", Hr, b(o.e), 1),
3206
3215
  i("span", zr, b(o.l), 1)
@@ -3215,7 +3224,7 @@ function Wr(t, e, n, a, r, s) {
3215
3224
  ], 64))
3216
3225
  ]);
3217
3226
  }
3218
- const Kr = /* @__PURE__ */ E(Dr, [["render", Wr], ["__scopeId", "data-v-6f45ff3b"]]);
3227
+ const Kr = /* @__PURE__ */ E(Nr, [["render", Wr], ["__scopeId", "data-v-6f45ff3b"]]);
3219
3228
  function Gr(t) {
3220
3229
  const e = new Date(t);
3221
3230
  return e.setHours(0, 0, 0, 0), e;
@@ -3283,12 +3292,12 @@ const Yr = {
3283
3292
  key: 0,
3284
3293
  class: "wm-hd__rowDot",
3285
3294
  "aria-label": "Message non lu"
3286
- }, li = { class: "wm-hd__rowBody" }, ci = { class: "wm-hd__rowTop" }, di = { class: "wm-hd__rowTitle" }, ui = { class: "wm-hd__rowPreview" }, hi = {
3295
+ }, li = { class: "wm-hd__rowBody" }, di = { class: "wm-hd__rowTop" }, ci = { class: "wm-hd__rowTitle" }, ui = { class: "wm-hd__rowPreview" }, hi = {
3287
3296
  key: 0,
3288
3297
  class: "wm-hd__empty"
3289
3298
  };
3290
3299
  function mi(t, e, n, a, r, s) {
3291
- return l(), d("div", Jr, [
3300
+ return l(), c("div", Jr, [
3292
3301
  i("div", {
3293
3302
  class: "wm-hd__scrim",
3294
3303
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
@@ -3359,31 +3368,31 @@ function mi(t, e, n, a, r, s) {
3359
3368
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3360
3369
  ])
3361
3370
  ], -1)),
3362
- W(i("input", {
3371
+ q(i("input", {
3363
3372
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3364
3373
  type: "text",
3365
3374
  placeholder: "Rechercher dans vos messages",
3366
3375
  "aria-label": "Rechercher dans vos messages"
3367
3376
  }, null, 512), [
3368
- [Q, r.query]
3377
+ [J, r.query]
3369
3378
  ])
3370
3379
  ])
3371
3380
  ]),
3372
3381
  i("div", ti, [
3373
- (l(!0), d(M, null, j(s.groups, (o) => (l(), d(M, {
3382
+ (l(!0), c(T, null, D(s.groups, (o) => (l(), c(T, {
3374
3383
  key: o.key
3375
3384
  }, [
3376
- o.items.length ? (l(), d("div", ni, [
3385
+ o.items.length ? (l(), c("div", ni, [
3377
3386
  i("div", si, b(o.label), 1),
3378
3387
  i("div", ri, [
3379
- (l(!0), d(M, null, j(o.items, (c) => (l(), d("button", {
3380
- key: c.id,
3388
+ (l(!0), c(T, null, D(o.items, (d) => (l(), c("button", {
3389
+ key: d.id,
3381
3390
  type: "button",
3382
3391
  class: B(["wm-hd__row", {
3383
- "wm-hd__row--active": c.id === n.activeId,
3384
- "wm-hd__row--unread": c.unread
3392
+ "wm-hd__row--active": d.id === n.activeId,
3393
+ "wm-hd__row--unread": d.unread
3385
3394
  }]),
3386
- onClick: (v) => t.$emit("pick", c)
3395
+ onClick: (v) => t.$emit("pick", d)
3387
3396
  }, [
3388
3397
  i("div", ai, [
3389
3398
  e[8] || (e[8] = i("svg", {
@@ -3399,19 +3408,19 @@ function mi(t, e, n, a, r, s) {
3399
3408
  opacity: "0.92"
3400
3409
  })
3401
3410
  ], -1)),
3402
- c.unread ? (l(), d("span", oi)) : g("", !0)
3411
+ d.unread ? (l(), c("span", oi)) : y("", !0)
3403
3412
  ]),
3404
3413
  i("div", li, [
3405
- i("div", ci, [
3406
- i("span", di, b(c.title), 1)
3414
+ i("div", di, [
3415
+ i("span", ci, b(d.title), 1)
3407
3416
  ]),
3408
- i("div", ui, b(c.preview || "Aucun message"), 1)
3417
+ i("div", ui, b(d.preview || "Aucun message"), 1)
3409
3418
  ])
3410
3419
  ], 10, ii))), 128))
3411
3420
  ])
3412
- ])) : g("", !0)
3421
+ ])) : y("", !0)
3413
3422
  ], 64))), 128)),
3414
- s.hasAny ? g("", !0) : (l(), d("div", hi, " Aucun fil pour le moment. "))
3423
+ s.hasAny ? y("", !0) : (l(), c("div", hi, " Aucun fil pour le moment. "))
3415
3424
  ])
3416
3425
  ])
3417
3426
  ]);
@@ -3420,7 +3429,6 @@ const fi = /* @__PURE__ */ E(Yr, [["render", mi], ["__scopeId", "data-v-1259e822
3420
3429
  name: "WmMoreMenu",
3421
3430
  props: {
3422
3431
  canRename: { type: Boolean, default: !0 },
3423
- canClear: { type: Boolean, default: !0 },
3424
3432
  canExport: { type: Boolean, default: !0 },
3425
3433
  notifEnabled: { type: Boolean, default: !0 },
3426
3434
  statusUrl: { type: String, default: "" },
@@ -3446,20 +3454,20 @@ const fi = /* @__PURE__ */ E(Yr, [["render", mi], ["__scopeId", "data-v-1259e822
3446
3454
  }, pi = { class: "wm-mm" }, vi = {
3447
3455
  class: "wm-mm__pop",
3448
3456
  role: "menu"
3449
- }, yi = { class: "wm-mm__section" }, gi = { class: "wm-mm__section" }, wi = { class: "wm-mm__section" };
3457
+ }, gi = { class: "wm-mm__section" }, yi = { class: "wm-mm__section" }, wi = { class: "wm-mm__section" };
3450
3458
  function bi(t, e, n, a, r, s) {
3451
- return l(), d("div", pi, [
3459
+ return l(), c("div", pi, [
3452
3460
  i("div", {
3453
3461
  class: "wm-mm__scrim",
3454
3462
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3455
3463
  }),
3456
3464
  i("div", vi, [
3457
- i("div", yi, [
3465
+ i("div", gi, [
3458
3466
  i("button", {
3459
3467
  type: "button",
3460
3468
  class: "wm-mm__item",
3461
3469
  onClick: e[1] || (e[1] = (o) => s.emit("history"))
3462
- }, [...e[8] || (e[8] = [
3470
+ }, [...e[7] || (e[7] = [
3463
3471
  i("span", { class: "wm-mm__icon" }, [
3464
3472
  i("svg", {
3465
3473
  width: "12",
@@ -3477,54 +3485,31 @@ function bi(t, e, n, a, r, s) {
3477
3485
  ], -1),
3478
3486
  i("span", { class: "wm-mm__label" }, "Historique des discussions", -1)
3479
3487
  ])]),
3480
- n.canRename ? (l(), d("button", {
3488
+ n.canRename ? (l(), c("button", {
3481
3489
  key: 0,
3482
3490
  type: "button",
3483
3491
  class: "wm-mm__item",
3484
3492
  onClick: e[2] || (e[2] = (o) => s.emit("rename"))
3485
- }, [...e[9] || (e[9] = [
3486
- ue('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M12 20h9" data-v-c1bb81d2></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-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Renommer le fil</span>', 2)
3487
- ])])) : g("", !0),
3488
- n.canClear ? (l(), d("button", {
3493
+ }, [...e[8] || (e[8] = [
3494
+ 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)
3495
+ ])])) : y("", !0),
3496
+ n.canExport ? (l(), c("button", {
3489
3497
  key: 1,
3490
3498
  type: "button",
3491
3499
  class: "wm-mm__item",
3492
- onClick: e[3] || (e[3] = (o) => s.emit("clear"))
3493
- }, [...e[10] || (e[10] = [
3494
- i("span", { class: "wm-mm__icon" }, [
3495
- i("svg", {
3496
- width: "12",
3497
- height: "12",
3498
- viewBox: "0 0 24 24",
3499
- fill: "none",
3500
- stroke: "currentColor",
3501
- "stroke-width": "1.8",
3502
- "stroke-linecap": "round",
3503
- "stroke-linejoin": "round",
3504
- "aria-hidden": "true"
3505
- }, [
3506
- i("path", { d: "M4 7h16M10 11v6M14 11v6M5 7l1 13a2 2 0 002 2h8a2 2 0 002-2l1-13M9 7V4a1 1 0 011-1h4a1 1 0 011 1v3" })
3507
- ])
3508
- ], -1),
3509
- i("span", { class: "wm-mm__label" }, "Effacer ce fil", -1)
3510
- ])])) : g("", !0),
3511
- n.canExport ? (l(), d("button", {
3512
- key: 2,
3513
- type: "button",
3514
- class: "wm-mm__item",
3515
- onClick: e[4] || (e[4] = (o) => s.emit("export"))
3516
- }, [...e[11] || (e[11] = [
3517
- ue('<span class="wm-mm__icon" data-v-c1bb81d2><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-c1bb81d2><path d="M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" data-v-c1bb81d2></path></svg></span><span class="wm-mm__label" data-v-c1bb81d2>Exporter la transcription</span><span class="wm-mm__hint" data-v-c1bb81d2>.txt</span>', 3)
3518
- ])])) : g("", !0)
3500
+ onClick: e[3] || (e[3] = (o) => s.emit("export"))
3501
+ }, [...e[9] || (e[9] = [
3502
+ 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)
3503
+ ])])) : y("", !0)
3519
3504
  ]),
3520
- e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3521
- i("div", gi, [
3505
+ e[15] || (e[15] = i("div", { class: "wm-mm__sep" }, null, -1)),
3506
+ i("div", yi, [
3522
3507
  i("button", {
3523
3508
  type: "button",
3524
3509
  class: "wm-mm__item",
3525
- onClick: e[5] || (e[5] = (...o) => s.toggleNotif && s.toggleNotif(...o))
3510
+ onClick: e[4] || (e[4] = (...o) => s.toggleNotif && s.toggleNotif(...o))
3526
3511
  }, [
3527
- e[13] || (e[13] = i("span", { class: "wm-mm__icon" }, [
3512
+ e[11] || (e[11] = i("span", { class: "wm-mm__icon" }, [
3528
3513
  i("svg", {
3529
3514
  width: "12",
3530
3515
  height: "12",
@@ -3539,22 +3524,22 @@ function bi(t, e, n, a, r, s) {
3539
3524
  i("path", { d: "M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0" })
3540
3525
  ])
3541
3526
  ], -1)),
3542
- e[14] || (e[14] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
3527
+ e[12] || (e[12] = i("span", { class: "wm-mm__label" }, "Notifications", -1)),
3543
3528
  i("span", {
3544
3529
  class: B(["wm-mm__toggle", { "wm-mm__toggle--on": r.notifOn }])
3545
- }, [...e[12] || (e[12] = [
3530
+ }, [...e[10] || (e[10] = [
3546
3531
  i("span", { class: "wm-mm__knob" }, null, -1)
3547
3532
  ])], 2)
3548
3533
  ])
3549
3534
  ]),
3550
- e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3535
+ e[16] || (e[16] = i("div", { class: "wm-mm__sep" }, null, -1)),
3551
3536
  i("div", wi, [
3552
- n.statusUrl ? (l(), d("button", {
3537
+ n.statusUrl ? (l(), c("button", {
3553
3538
  key: 0,
3554
3539
  type: "button",
3555
3540
  class: "wm-mm__item",
3556
- onClick: e[6] || (e[6] = (o) => s.emit("status"))
3557
- }, [...e[15] || (e[15] = [
3541
+ onClick: e[5] || (e[5] = (o) => s.emit("status"))
3542
+ }, [...e[13] || (e[13] = [
3558
3543
  i("span", { class: "wm-mm__icon" }, [
3559
3544
  i("svg", {
3560
3545
  width: "12",
@@ -3571,13 +3556,13 @@ function bi(t, e, n, a, r, s) {
3571
3556
  ])
3572
3557
  ], -1),
3573
3558
  i("span", { class: "wm-mm__label" }, "Statut des services", -1)
3574
- ])])) : g("", !0),
3575
- n.helpUrl ? (l(), d("button", {
3559
+ ])])) : y("", !0),
3560
+ n.helpUrl ? (l(), c("button", {
3576
3561
  key: 1,
3577
3562
  type: "button",
3578
3563
  class: "wm-mm__item",
3579
- onClick: e[7] || (e[7] = (o) => s.emit("help"))
3580
- }, [...e[16] || (e[16] = [
3564
+ onClick: e[6] || (e[6] = (o) => s.emit("help"))
3565
+ }, [...e[14] || (e[14] = [
3581
3566
  i("span", { class: "wm-mm__icon" }, [
3582
3567
  i("svg", {
3583
3568
  width: "12",
@@ -3594,18 +3579,119 @@ function bi(t, e, n, a, r, s) {
3594
3579
  ])
3595
3580
  ], -1),
3596
3581
  i("span", { class: "wm-mm__label" }, "Centre d'aide", -1)
3597
- ])])) : g("", !0)
3582
+ ])])) : y("", !0)
3598
3583
  ])
3599
3584
  ])
3600
3585
  ]);
3601
3586
  }
3602
- const ki = /* @__PURE__ */ E(_i, [["render", bi], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
3603
- function de(t) {
3587
+ const ki = /* @__PURE__ */ E(_i, [["render", bi], ["__scopeId", "data-v-3181ad1b"]]), Ci = {
3588
+ name: "WmRenameDialog",
3589
+ props: {
3590
+ title: { type: String, default: "Modifier le titre" },
3591
+ initialValue: { type: String, default: "" },
3592
+ placeholder: { type: String, default: "Titre de la conversation" }
3593
+ },
3594
+ emits: ["close", "submit"],
3595
+ data() {
3596
+ return { value: this.initialValue || "" };
3597
+ },
3598
+ computed: {
3599
+ canSubmit() {
3600
+ const t = (this.value || "").trim();
3601
+ return !!t && t !== (this.initialValue || "").trim();
3602
+ }
3603
+ },
3604
+ mounted() {
3605
+ this.$nextTick(() => {
3606
+ const t = this.$refs.input;
3607
+ if (t) {
3608
+ t.focus();
3609
+ try {
3610
+ t.select();
3611
+ } catch {
3612
+ }
3613
+ }
3614
+ });
3615
+ },
3616
+ methods: {
3617
+ onSubmit() {
3618
+ this.canSubmit && this.$emit("submit", this.value.trim());
3619
+ }
3620
+ }
3621
+ }, Ai = { class: "wm-dialog" }, Si = {
3622
+ class: "wm-dialog__card",
3623
+ role: "dialog",
3624
+ "aria-modal": "true"
3625
+ }, xi = { class: "wm-dialog__head" }, Ti = { class: "wm-dialog__title" }, Mi = { class: "wm-dialog__body" }, Oi = ["placeholder"], Ii = { class: "wm-dialog__actions" }, Bi = ["disabled"];
3626
+ function Ei(t, e, n, a, r, s) {
3627
+ return l(), c("div", Ai, [
3628
+ i("div", {
3629
+ class: "wm-dialog__scrim",
3630
+ onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3631
+ }),
3632
+ i("div", Si, [
3633
+ i("div", xi, [
3634
+ i("div", Ti, b(n.title), 1),
3635
+ i("button", {
3636
+ type: "button",
3637
+ class: "wm-dialog__close",
3638
+ "aria-label": "Fermer",
3639
+ onClick: e[1] || (e[1] = (o) => t.$emit("close"))
3640
+ }, [...e[7] || (e[7] = [
3641
+ i("svg", {
3642
+ width: "12",
3643
+ height: "12",
3644
+ viewBox: "0 0 24 24",
3645
+ fill: "none",
3646
+ stroke: "currentColor",
3647
+ "stroke-width": "2",
3648
+ "stroke-linecap": "round",
3649
+ "stroke-linejoin": "round",
3650
+ "aria-hidden": "true"
3651
+ }, [
3652
+ i("path", { d: "M18 6L6 18M6 6l12 12" })
3653
+ ], -1)
3654
+ ])])
3655
+ ]),
3656
+ i("div", Mi, [
3657
+ q(i("input", {
3658
+ ref: "input",
3659
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => r.value = o),
3660
+ type: "text",
3661
+ class: "wm-dialog__input",
3662
+ placeholder: n.placeholder,
3663
+ maxlength: 120,
3664
+ onKeydown: [
3665
+ e[3] || (e[3] = ae(X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]), ["enter"])),
3666
+ e[4] || (e[4] = ae(X((o) => t.$emit("close"), ["prevent"]), ["esc"]))
3667
+ ]
3668
+ }, null, 40, Oi), [
3669
+ [J, r.value]
3670
+ ])
3671
+ ]),
3672
+ i("div", Ii, [
3673
+ i("button", {
3674
+ type: "button",
3675
+ class: "wm-dialog__btn",
3676
+ onClick: e[5] || (e[5] = (o) => t.$emit("close"))
3677
+ }, "Annuler"),
3678
+ i("button", {
3679
+ type: "button",
3680
+ class: "wm-dialog__btn wm-dialog__btn--primary",
3681
+ disabled: !s.canSubmit,
3682
+ onClick: e[6] || (e[6] = (...o) => s.onSubmit && s.onSubmit(...o))
3683
+ }, "Enregistrer", 8, Bi)
3684
+ ])
3685
+ ])
3686
+ ]);
3687
+ }
3688
+ const $i = /* @__PURE__ */ E(Ci, [["render", Ei], ["__scopeId", "data-v-4f4b37c9"]]), ge = "ww-messenger-tokens";
3689
+ function ie(t) {
3604
3690
  var n;
3605
3691
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3606
3692
  return e === "agent_ia" || e === "agent_human";
3607
3693
  }
3608
- function Ci(t, e) {
3694
+ function Li(t, e) {
3609
3695
  if (!t || !e) return "";
3610
3696
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3611
3697
  for (const r of n) {
@@ -3614,8 +3700,8 @@ function Ci(t, e) {
3614
3700
  if (s == null || s === "") continue;
3615
3701
  let o;
3616
3702
  if (Array.isArray(s)) {
3617
- if (o = s.map((c) => ae(r, String(c))).join(", "), !o) continue;
3618
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3703
+ if (o = s.map((d) => le(r, String(d))).join(", "), !o) continue;
3704
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
3619
3705
  a.push(`${r.label} :
3620
3706
  ${o}`);
3621
3707
  }
@@ -3623,12 +3709,12 @@ ${o}`);
3623
3709
 
3624
3710
  `);
3625
3711
  }
3626
- function ae(t, e) {
3712
+ function le(t, e) {
3627
3713
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
3628
3714
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3629
3715
  return (n == null ? void 0 : n.label) || e;
3630
3716
  }
3631
- function Ai(t, e) {
3717
+ function Ri(t, e) {
3632
3718
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3633
3719
  for (const r of a) {
3634
3720
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3636,11 +3722,11 @@ function Ai(t, e) {
3636
3722
  if (s == null || s === "") continue;
3637
3723
  let o;
3638
3724
  if (Array.isArray(s)) {
3639
- if (o = s.map((v) => ae(r, String(v))).join(", "), !o) continue;
3640
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3641
- const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3725
+ if (o = s.map((v) => le(r, String(v))).join(", "), !o) continue;
3726
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = le(r, String(s));
3727
+ const d = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3642
3728
  `));
3643
- n.push({ label: r.label, value: o, multiline: c });
3729
+ n.push({ label: r.label, value: o, multiline: d });
3644
3730
  }
3645
3731
  return {
3646
3732
  kind: "form_response",
@@ -3650,20 +3736,21 @@ function Ai(t, e) {
3650
3736
  }
3651
3737
  };
3652
3738
  }
3653
- const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
3739
+ const Fi = 450, Di = 50, Ni = 900, ji = 12e3, Ui = 300, Pi = {
3654
3740
  name: "Messenger",
3655
3741
  components: {
3656
3742
  Launcher: Ke,
3657
- Header: gt,
3743
+ Header: yt,
3658
3744
  Onboarding: Pt,
3659
3745
  MessageList: Is,
3660
3746
  Composer: Js,
3661
3747
  SuggestionChips: er,
3662
- ApprovalCard: dr,
3663
- FormCard: jr,
3748
+ ApprovalCard: cr,
3749
+ FormCard: Dr,
3664
3750
  Feedback: Kr,
3665
3751
  HistoryDrawer: fi,
3666
- MoreMenu: ki
3752
+ MoreMenu: ki,
3753
+ RenameDialog: $i
3667
3754
  },
3668
3755
  // Make signAttachment available to deep children (AttachmentPreview)
3669
3756
  // without prop drilling. The store may not exist yet at provide-time
@@ -3721,6 +3808,26 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
3721
3808
  // Overlays anchored to the header. Only one open at a time.
3722
3809
  historyOpen: !1,
3723
3810
  moreOpen: !1,
3811
+ // In-app rename dialog. Replaces the previous `window.prompt`
3812
+ // call so the rename flow stays inside the widget (and works
3813
+ // on platforms where prompts are blocked).
3814
+ renameDialogOpen: !1,
3815
+ // Draft conversation : composer ouvert sans création server-side.
3816
+ // La conversation réelle n'est créée qu'au premier envoi (texte,
3817
+ // PJ, formulaire, quick-link sans URL). Évite de polluer la liste
3818
+ // côté serveur avec des fils vides abandonnés.
3819
+ draftConv: null,
3820
+ // Permission API pour les notifications navigateur. Tracke l'état
3821
+ // courant ('default'|'granted'|'denied') pour décider quand
3822
+ // déclencher une demande explicite.
3823
+ notifPermission: typeof Notification < "u" ? Notification.permission : "denied",
3824
+ // Unsubscribe handle for the transport's `message` event (used
3825
+ // to drive sound + browser notifications). Set during boot.
3826
+ _notifUnsub: null,
3827
+ // Cached AudioContext for the ping sound. Lazily created on the
3828
+ // first notification; reused across plays to avoid the per-call
3829
+ // construction cost (and the autoplay-policy warning on Safari).
3830
+ _audioCtx: null,
3724
3831
  // When set, takes precedence over the latest-conversation
3725
3832
  // selection so the user can browse another thread from the
3726
3833
  // history drawer without losing live updates on the others.
@@ -3824,7 +3931,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
3824
3931
  var n;
3825
3932
  const t = this.readState, e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {};
3826
3933
  return this.allConversations.map((a) => {
3827
- const r = e[a.id] || [], s = this.convLastActivity(a, r), o = t[a.id] || "", c = this.lastMessageAuthorType(r), v = !!s && c !== "user" && (!o || s > o);
3934
+ 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);
3828
3935
  return { ...a, _preview: this.convPreview(a, r), _unread: v };
3829
3936
  });
3830
3937
  },
@@ -3874,6 +3981,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
3874
3981
  return (this.isOpen || this.isEmbedded) && !this.historyOpen && !!this.currentConv;
3875
3982
  },
3876
3983
  currentConv() {
3984
+ if (this.draftConv) return this.draftConv;
3877
3985
  if (this.showOnboarding) return null;
3878
3986
  const t = this.allConversations;
3879
3987
  if (!t.length) return null;
@@ -3968,13 +4076,13 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
3968
4076
  const t = this.currentConv;
3969
4077
  if (!t) return [];
3970
4078
  const e = (r) => {
3971
- var s, o, c, v;
3972
- 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 || (c = r == null ? void 0 : r.metadata) != null && c.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;
4079
+ var s, o, d, v;
4080
+ 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;
3973
4081
  }, n = (r) => {
3974
4082
  var s;
3975
4083
  return (r == null ? void 0 : r.type) === "action" && ((s = r == null ? void 0 : r.payload) == null ? void 0 : s.state) === "pending";
3976
4084
  }, a = this.revealedAt;
3977
- return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => de(r) ? a[r.id] > 0 : !0).filter(e);
4085
+ return (this.s.messagesByConv[t.id] || []).filter((r) => !n(r)).filter((r) => ie(r) ? a[r.id] > 0 : !0).filter(e);
3978
4086
  },
3979
4087
  // True whenever we should show the "typing" indicator at the bottom
3980
4088
  // of the list: either the LLM is actively streaming tokens, or one
@@ -3983,7 +4091,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
3983
4091
  streamingActive() {
3984
4092
  var n, a, r;
3985
4093
  const t = this.currentConv;
3986
- 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) => de(s) && !(this.revealedAt[s.id] > 0)) : !1;
4094
+ 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;
3987
4095
  },
3988
4096
  // Internal: the raw persisted list for the current conversation. We
3989
4097
  // watch this to detect new agent messages that need to be paced.
@@ -4015,11 +4123,11 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4015
4123
  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";
4016
4124
  },
4017
4125
  approvalDetail() {
4018
- var a, r, s, o, c, v;
4126
+ var a, r, s, o, d, v;
4019
4127
  const t = (s = (r = (a = this.pendingApproval) == null ? void 0 : a.payload) == null ? void 0 : r.pending) == null ? void 0 : s.user_explanation;
4020
4128
  if (typeof t == "string" && t.trim())
4021
4129
  return t.trim();
4022
- const e = (v = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : v.prepared_params;
4130
+ const e = (v = (d = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : d.pending) == null ? void 0 : v.prepared_params;
4023
4131
  if (!e || typeof e != "object") return "";
4024
4132
  const n = Object.entries(e);
4025
4133
  return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
@@ -4058,10 +4166,10 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4058
4166
  const t = this.currentConv;
4059
4167
  let e = /* @__PURE__ */ new Date();
4060
4168
  if (t) {
4061
- const o = ((r = (((a = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : a[t.id]) || []).find((c) => c == null ? void 0 : c.created_at)) == null ? void 0 : r.created_at) || t.created_at;
4169
+ 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;
4062
4170
  if (o) {
4063
- const c = new Date(o);
4064
- Number.isNaN(c.getTime()) || (e = c);
4171
+ const d = new Date(o);
4172
+ Number.isNaN(d.getTime()) || (e = d);
4065
4173
  }
4066
4174
  }
4067
4175
  return `Aujourd'hui · ${be(e)}`;
@@ -4099,7 +4207,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4099
4207
  // we're about to load count as history and bypass pacing.
4100
4208
  "currentConv.id": {
4101
4209
  handler(t) {
4102
- this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "", this.unreadBoundaryTs = t ? (/* @__PURE__ */ new Date()).toISOString() : "");
4210
+ this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = Date.now(), this.moreOpen = !1, this.renameDialogOpen = !1, this.resetApprovalPacing(), this.isViewingThread && (this.unreadAnchorTs = t && this.readState[t] || "", this.unreadBoundaryTs = t ? (/* @__PURE__ */ new Date()).toISOString() : "");
4103
4211
  },
4104
4212
  immediate: !0
4105
4213
  },
@@ -4165,7 +4273,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4165
4273
  const e = Date.now(), n = { ...this.revealedAt };
4166
4274
  for (const r of t) {
4167
4275
  if ((r == null ? void 0 : r.id) == null || n[r.id] !== void 0) continue;
4168
- if (!de(r)) {
4276
+ if (!ie(r)) {
4169
4277
  n[r.id] = e;
4170
4278
  continue;
4171
4279
  }
@@ -4174,8 +4282,8 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4174
4282
  n[r.id] = e;
4175
4283
  continue;
4176
4284
  }
4177
- const o = typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0, c = Array.isArray((a = r == null ? void 0 : r.payload) == null ? void 0 : a.attachments) && r.payload.attachments.length > 0;
4178
- if (!o && !c) {
4285
+ 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;
4286
+ if (!o && !d) {
4179
4287
  n[r.id] = e;
4180
4288
  continue;
4181
4289
  }
@@ -4192,14 +4300,14 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4192
4300
  hasWidgetId: !!this.widgetId,
4193
4301
  hasUserId: !!this.userId,
4194
4302
  hasUserHash: !!this.userHash
4195
- }), typeof document < "u" && !document.getElementById(ye)) {
4303
+ }), typeof document < "u" && !document.getElementById(ge)) {
4196
4304
  const t = document.createElement("style");
4197
- t.id = ye, t.textContent = Ne, document.head.appendChild(t);
4305
+ t.id = ge, t.textContent = Ue, document.head.appendChild(t);
4198
4306
  }
4199
4307
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4200
4308
  },
4201
4309
  beforeUnmount() {
4202
- this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.store && this.store.destroy();
4310
+ this.cancelReveals(), this.disconnectFloatRO(), this.resetApprovalPacing(), this.teardownNotifications(), this.store && this.store.destroy();
4203
4311
  },
4204
4312
  methods: {
4205
4313
  syncFloatObserver(t) {
@@ -4260,9 +4368,9 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4260
4368
  for (let s = e.length - 1; s >= 0; s--) {
4261
4369
  const o = e[s];
4262
4370
  if (!o) continue;
4263
- const c = typeof o.text_md == "string" ? o.text_md.trim() : "";
4264
- if (c)
4265
- return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + c.replace(/\s+/g, " ");
4371
+ const d = typeof o.text_md == "string" ? o.text_md.trim() : "";
4372
+ if (d)
4373
+ return (((n = o.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + d.replace(/\s+/g, " ");
4266
4374
  const v = (a = o.payload) == null ? void 0 : a.attachments;
4267
4375
  if (Array.isArray(v) && v.length) return "📎 Pièce jointe";
4268
4376
  }
@@ -4294,7 +4402,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4294
4402
  // actively-viewed thread receives new messages.
4295
4403
  markConvRead(t) {
4296
4404
  var a, r;
4297
- if (!(t != null && t.id)) return;
4405
+ if (!(t != null && t.id) || t._draft) return;
4298
4406
  const e = ((r = (a = this.s) == null ? void 0 : a.messagesByConv) == null ? void 0 : r[t.id]) || [], n = this.convLastActivity(t, e);
4299
4407
  n && this.readState[t.id] !== n && (this.readState = { ...this.readState, [t.id]: n }, this.persistReadState());
4300
4408
  },
@@ -4345,19 +4453,19 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4345
4453
  // bounded by MIN/MAX_BETWEEN_MS.
4346
4454
  scheduleReveal(t) {
4347
4455
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4348
- Ti,
4349
- Math.max(Mi, n * xi)
4456
+ ji,
4457
+ Math.max(Ni, n * Di)
4350
4458
  ), s = Math.max(
4351
- e + Si,
4352
- this.nextRevealAt + Oi
4459
+ e + Fi,
4460
+ this.nextRevealAt + Ui
4353
4461
  ) + a;
4354
4462
  this.nextRevealAt = s;
4355
- const o = Math.max(0, s - e), c = t.id, v = setTimeout(() => {
4356
- this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
4463
+ const o = Math.max(0, s - e), d = t.id, v = setTimeout(() => {
4464
+ this.revealedAt = { ...this.revealedAt, [d]: Date.now() }, this.revealTimers = this.revealTimers.filter((w) => w !== v);
4357
4465
  }, o);
4358
4466
  this.revealTimers.push(v);
4359
4467
  const k = setTimeout(() => {
4360
- this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== k);
4468
+ this.revealedAt[d] > 0 || (this.revealedAt = { ...this.revealedAt, [d]: Date.now() }), this.revealTimers = this.revealTimers.filter((w) => w !== k);
4361
4469
  }, o + 4e3);
4362
4470
  this.revealTimers.push(k);
4363
4471
  },
@@ -4381,7 +4489,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4381
4489
  widgetId: this.widgetId,
4382
4490
  userId: this.userId,
4383
4491
  userHash: this.userHash
4384
- })), this.store = fe(Ue(this.transport)), await this.store.start(), this.customer && typeof this.customer == "object" && await this.store.applyCustomer(this.customer), console.log("[ww-messenger] boot done", {
4492
+ })), this.store = fe(je(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", {
4385
4493
  ready: this.store.state.ready,
4386
4494
  error: this.store.state.error
4387
4495
  });
@@ -4390,39 +4498,59 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4390
4498
  }
4391
4499
  },
4392
4500
  async refresh() {
4393
- this.store && this.store.destroy(), this.cancelReveals(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
4501
+ this.store && this.store.destroy(), this.cancelReveals(), this.teardownNotifications(), this.revealedAt = {}, this.nextRevealAt = 0, this.convOpenedAt = 0, this.transport = null, this.store = null, this.isOpen = !1, this.draft = "", this.busy = !1, this.bootError = null, this.pendingAttachments = [], this.feedbackBusy = !1, this.feedbackDone = !1, this.historyOpen = !1, this.moreOpen = !1, this.renameDialogOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !1, await this.boot(), this.isEmbedded && this.store && await this.open();
4394
4502
  },
4395
4503
  // Opening straight from the étiquette: land on the unread thread it
4396
4504
  // was previewing rather than whatever was last active.
4397
4505
  async openFromPeek() {
4398
4506
  var e, n;
4399
4507
  const t = (e = this.latestUnread) == null ? void 0 : e.convId;
4400
- t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.activeConvId = t, this.showOnboarding = !1), await this.open();
4508
+ t && t !== ((n = this.currentConv) == null ? void 0 : n.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1), await this.open();
4401
4509
  },
4402
4510
  async open() {
4403
- if (this.isOpen = !0, this.store && this.store.setPanelOpen(!0), this.currentConv) {
4511
+ this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
4512
+ const t = this.currentConv;
4513
+ if (t && !t._draft) {
4404
4514
  try {
4405
- await this.store.openConversation(this.currentConv.id);
4406
- } catch (t) {
4407
- console.error("[ww-messenger] load messages failed", t);
4515
+ await this.store.openConversation(t.id);
4516
+ } catch (e) {
4517
+ console.error("[ww-messenger] load messages failed", e);
4408
4518
  }
4409
- this.markConvRead(this.currentConv);
4519
+ this.markConvRead(t);
4410
4520
  }
4411
4521
  },
4412
4522
  close() {
4413
4523
  this.isOpen = !1, this.store && this.store.setPanelOpen(!1);
4414
4524
  },
4415
- async startConv() {
4416
- if (!this.busy) {
4417
- this.busy = !0;
4418
- try {
4419
- const t = await this.store.createConversation({});
4420
- this.activeConvId = t.id, this.showOnboarding = !1, await this.store.openConversation(t.id), this.markConvRead(t), this.focusComposer();
4421
- } catch (t) {
4422
- console.error("[ww-messenger] create conv failed", t), this.bootError = (t == null ? void 0 : t.message) || String(t);
4423
- } finally {
4424
- this.busy = !1;
4425
- }
4525
+ // Enter "draft" mode : the composer is rendered immediately but no
4526
+ // server-side conversation is created yet. `ensureRealConv` runs
4527
+ // lazily on the first outbound action (text / attachment / form /
4528
+ // quick-link without URL), so users who open the chat and walk away
4529
+ // don't leave empty threads behind.
4530
+ startConv() {
4531
+ this.draftConv = {
4532
+ id: "__draft__",
4533
+ _draft: !0,
4534
+ name: "",
4535
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
4536
+ }, this.activeConvId = null, this.showOnboarding = !1, this.focusComposer();
4537
+ },
4538
+ // Materialize the draft into a real server-side conversation. Returns
4539
+ // the freshly-created conv (so callers can `send` against its id) or
4540
+ // `null` if the creation failed.
4541
+ async ensureRealConv() {
4542
+ const t = this.currentConv;
4543
+ if (!t) return null;
4544
+ if (!t._draft) return t;
4545
+ if (this.busy) return null;
4546
+ this.busy = !0;
4547
+ try {
4548
+ const e = await this.store.createConversation({});
4549
+ return this.draftConv = null, this.activeConvId = e.id, await this.store.openConversation(e.id), this.markConvRead(e), e;
4550
+ } catch (e) {
4551
+ return console.error("[ww-messenger] create conv failed", e), this.bootError = (e == null ? void 0 : e.message) || String(e), null;
4552
+ } finally {
4553
+ this.busy = !1;
4426
4554
  }
4427
4555
  },
4428
4556
  // After a fresh conversation renders, drop the caret straight into
@@ -4439,11 +4567,11 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4439
4567
  this.historyOpen = !1, this.moreOpen = !this.moreOpen;
4440
4568
  },
4441
4569
  goHome() {
4442
- this.historyOpen = !1, this.moreOpen = !1, this.activeConvId = null, this.showOnboarding = !0;
4570
+ this.historyOpen = !1, this.moreOpen = !1, this.draftConv = null, this.activeConvId = null, this.showOnboarding = !0;
4443
4571
  },
4444
4572
  async onDrawerPick(t) {
4445
4573
  if (!(t != null && t.id) || !this.store) return;
4446
- this.historyOpen = !1, this.activeConvId = t.id, this.showOnboarding = !1;
4574
+ this.historyOpen = !1, this.draftConv = null, this.activeConvId = t.id, this.showOnboarding = !1;
4447
4575
  try {
4448
4576
  await this.store.openConversation(t.id);
4449
4577
  } catch (n) {
@@ -4455,8 +4583,106 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4455
4583
  async onDrawerNew() {
4456
4584
  this.historyOpen = !1, await this.startConv();
4457
4585
  },
4458
- onNotifToggle(t) {
4459
- this.notifEnabled = !!t;
4586
+ async onNotifToggle(t) {
4587
+ if (this.notifEnabled = !!t, this.persistNotifPref(), this.notifEnabled && typeof Notification < "u" && Notification.permission === "default")
4588
+ try {
4589
+ const e = await Notification.requestPermission();
4590
+ this.notifPermission = e;
4591
+ } catch (e) {
4592
+ console.warn("[ww-messenger] notif permission request failed", e);
4593
+ }
4594
+ },
4595
+ // ── Notifications (sound + browser push) ──────────────────────────
4596
+ setupNotifications() {
4597
+ this.transport && (this.teardownNotifications(), this._notifUnsub = this.transport.on("message", this.onIncomingNotification));
4598
+ },
4599
+ teardownNotifications() {
4600
+ var t, e;
4601
+ if (this._notifUnsub) {
4602
+ try {
4603
+ this._notifUnsub();
4604
+ } catch {
4605
+ }
4606
+ this._notifUnsub = null;
4607
+ }
4608
+ if (this._audioCtx) {
4609
+ try {
4610
+ (e = (t = this._audioCtx).close) == null || e.call(t);
4611
+ } catch {
4612
+ }
4613
+ this._audioCtx = null;
4614
+ }
4615
+ },
4616
+ notifStorageKey() {
4617
+ return `wm:notif:${this.widgetId || ""}:${this.userId || ""}`;
4618
+ },
4619
+ hydrateNotifPref() {
4620
+ try {
4621
+ if (typeof localStorage > "u") return;
4622
+ const t = localStorage.getItem(this.notifStorageKey());
4623
+ t === "0" ? this.notifEnabled = !1 : t === "1" && (this.notifEnabled = !0);
4624
+ } catch {
4625
+ }
4626
+ },
4627
+ persistNotifPref() {
4628
+ try {
4629
+ if (typeof localStorage > "u") return;
4630
+ localStorage.setItem(this.notifStorageKey(), this.notifEnabled ? "1" : "0");
4631
+ } catch {
4632
+ }
4633
+ },
4634
+ onIncomingNotification(t) {
4635
+ var o;
4636
+ if (!this.notifEnabled) return;
4637
+ const e = t == null ? void 0 : t.conversation_id, n = t == null ? void 0 : t.message;
4638
+ if (!e || !n || !ie(n)) return;
4639
+ const a = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
4640
+ if (Number.isFinite(a) && a < this.convOpenedAt - 1e3) return;
4641
+ const r = typeof document < "u" && document.hidden;
4642
+ this.isOpen && !r && ((o = this.currentConv) == null ? void 0 : o.id) === e || (this.playNotificationSound(), this.showBrowserNotification(e, n));
4643
+ },
4644
+ playNotificationSound() {
4645
+ if (typeof window > "u") return;
4646
+ const t = window.AudioContext || window.webkitAudioContext;
4647
+ if (t)
4648
+ try {
4649
+ this._audioCtx || (this._audioCtx = new t());
4650
+ const e = this._audioCtx;
4651
+ if (e.state === "suspended")
4652
+ try {
4653
+ e.resume();
4654
+ } catch {
4655
+ }
4656
+ const n = e.currentTime, a = e.createOscillator(), r = e.createGain();
4657
+ 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);
4658
+ } catch {
4659
+ }
4660
+ },
4661
+ showBrowserNotification(t, e) {
4662
+ var o;
4663
+ if (typeof Notification > "u" || Notification.permission !== "granted") return;
4664
+ 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";
4665
+ try {
4666
+ const d = new Notification(a, {
4667
+ body: s,
4668
+ tag: `wm-${t}`,
4669
+ renotify: !1,
4670
+ silent: !0
4671
+ });
4672
+ d.onclick = () => {
4673
+ try {
4674
+ window.focus();
4675
+ } catch {
4676
+ }
4677
+ this.draftConv = null, this.showOnboarding = !1, this.activeConvId = t, this.isOpen = !0, this.store && this.store.setPanelOpen(!0);
4678
+ try {
4679
+ d.close();
4680
+ } catch {
4681
+ }
4682
+ };
4683
+ } catch (d) {
4684
+ console.warn("[ww-messenger] notification failed", d);
4685
+ }
4460
4686
  },
4461
4687
  async onMoreAction(t) {
4462
4688
  switch (this.moreOpen = !1, t) {
@@ -4464,10 +4690,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4464
4690
  this.historyOpen = !0;
4465
4691
  break;
4466
4692
  case "rename":
4467
- await this.renameCurrentConv();
4468
- break;
4469
- case "clear":
4470
- await this.clearCurrentConv();
4693
+ this.openRenameDialog();
4471
4694
  break;
4472
4695
  case "export":
4473
4696
  this.exportCurrentConv();
@@ -4488,31 +4711,23 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4488
4711
  break;
4489
4712
  }
4490
4713
  },
4491
- async renameCurrentConv() {
4714
+ openRenameDialog() {
4492
4715
  const t = this.currentConv;
4493
- if (!t || !this.store) return;
4494
- let e;
4495
- try {
4496
- e = typeof window < "u" && typeof window.prompt == "function" ? window.prompt("Nouveau nom du fil", t.name || "") : null;
4497
- } catch {
4498
- e = null;
4499
- }
4500
- if (e == null) return;
4501
- const n = e.trim();
4502
- if (!(!n || n === t.name))
4716
+ !t || t._draft || (this.renameDialogOpen = !0);
4717
+ },
4718
+ async onRenameSubmit(t) {
4719
+ const e = this.currentConv;
4720
+ if (this.renameDialogOpen = !1, !e || e._draft || !this.store) return;
4721
+ const n = (t || "").trim();
4722
+ if (!(!n || n === e.name))
4503
4723
  try {
4504
- await this.store.patchConversation(t.id, { name: n });
4724
+ await this.store.patchConversation(e.id, { name: n });
4505
4725
  } catch (a) {
4506
4726
  console.error("[ww-messenger] rename failed", a);
4507
4727
  }
4508
4728
  },
4509
- async clearCurrentConv() {
4510
- var n;
4511
- const t = this.currentConv;
4512
- !t || !this.store || !(!(typeof window < "u" && typeof window.confirm == "function") || window.confirm("Effacer ce fil de votre côté ? Cette action ne supprime pas les messages côté agent.")) || ((n = this.s) != null && n.messagesByConv && (this.s.messagesByConv[t.id] = []), this.activeConvId = null, this.showOnboarding = !0);
4513
- },
4514
4729
  exportCurrentConv() {
4515
- var r, s, o, c, v, k;
4730
+ var r, s, o, d, v, k;
4516
4731
  const t = this.currentConv;
4517
4732
  if (!t) return;
4518
4733
  const e = (((s = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : s[t.id]) || []).slice(), n = [
@@ -4522,7 +4737,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4522
4737
  ];
4523
4738
  for (const w of e) {
4524
4739
  if (!w) continue;
4525
- const S = ((o = w.author) == null ? void 0 : o.name) || (((c = w.author) == null ? void 0 : c.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();
4740
+ 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();
4526
4741
  A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
4527
4742
  }
4528
4743
  const a = new Blob([n.join(`
@@ -4535,10 +4750,10 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4535
4750
  }
4536
4751
  },
4537
4752
  async onSend(t) {
4538
- const e = this.currentConv;
4539
- if (!e && (await this.startConv(), !this.currentConv))
4753
+ let e = this.currentConv;
4754
+ if (!e && (this.startConv(), e = this.currentConv, !e) || e._draft && (e = await this.ensureRealConv(), !e))
4540
4755
  return;
4541
- const n = (this.currentConv || e).id, a = this.pendingAttachments.slice();
4756
+ const n = e.id, a = this.pendingAttachments.slice();
4542
4757
  this.pendingAttachments = [], this.unreadAnchorTs = "", this.unreadBoundaryTs = "", await this.store.send(n, t, { attachments: a.length ? a : void 0 });
4543
4758
  },
4544
4759
  async onSuggestion(t) {
@@ -4557,14 +4772,14 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4557
4772
  async onFormSubmit({ values: t }) {
4558
4773
  const e = this.pendingForm;
4559
4774
  if (!(e != null && e.form)) return;
4560
- const n = Ci(e.form, t);
4775
+ const n = Li(e.form, t);
4561
4776
  if (!n) return;
4562
- const a = this.currentConv;
4563
- a && await this.store.send(a.id, n, {
4777
+ let a = this.currentConv;
4778
+ a && (a._draft && (a = await this.ensureRealConv(), !a) || await this.store.send(a.id, n, {
4564
4779
  metadata: {
4565
- artifact: Ai(e.form, t)
4780
+ artifact: Ri(e.form, t)
4566
4781
  }
4567
- });
4782
+ }));
4568
4783
  },
4569
4784
  async onAttach(t) {
4570
4785
  if (!(!t || !this.transport))
@@ -4590,7 +4805,7 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4590
4805
  }
4591
4806
  return;
4592
4807
  }
4593
- await this.startConv(), this.currentConv && await this.store.send(this.currentConv.id, t.label);
4808
+ this.currentConv || this.startConv(), await this.onSend(t.label);
4594
4809
  }
4595
4810
  },
4596
4811
  async onFeedback({ rating: t, comment: e }) {
@@ -4606,30 +4821,30 @@ const Si = 450, xi = 50, Mi = 900, Ti = 12e3, Oi = 300, Ii = {
4606
4821
  }
4607
4822
  }
4608
4823
  }
4609
- }, Bi = {
4824
+ }, Hi = {
4610
4825
  key: 0,
4611
4826
  class: "wm-loading",
4612
4827
  "aria-busy": "true",
4613
4828
  "aria-live": "polite"
4614
- }, Ei = {
4829
+ }, zi = {
4615
4830
  key: 0,
4616
4831
  class: "wm-state"
4617
- }, Li = { class: "wm-state__err" }, $i = { class: "wm-state__errSub" }, Ri = { class: "wm-bottom" }, Fi = {
4832
+ }, Vi = { class: "wm-state__err" }, qi = { class: "wm-state__errSub" }, Wi = { class: "wm-bottom" }, Ki = {
4618
4833
  key: 0,
4619
4834
  ref: "floatEl",
4620
4835
  class: "wm-float"
4621
- }, ji = {
4836
+ }, Gi = {
4622
4837
  key: 1,
4623
4838
  class: "wm-actionWait",
4624
4839
  role: "status",
4625
4840
  "aria-live": "polite"
4626
- }, Di = { class: "wm-actionWait__lbl" }, Ui = {
4627
- key: 1,
4841
+ }, Yi = { class: "wm-actionWait__lbl" }, Ji = {
4842
+ key: 2,
4628
4843
  class: "wm-attached"
4629
- }, Ni = ["onClick"];
4630
- function Pi(t, e, n, a, r, s) {
4631
- const o = I("Launcher"), c = I("Header"), v = I("Onboarding"), k = I("MessageList"), w = I("ApprovalCard"), S = I("FormCard"), R = I("Feedback"), A = I("SuggestionChips"), P = I("Composer"), x = I("MoreMenu"), U = I("HistoryDrawer");
4632
- return l(), d("div", {
4844
+ }, Xi = ["onClick"];
4845
+ function Qi(t, e, n, a, r, s) {
4846
+ 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");
4847
+ return l(), c("div", {
4633
4848
  class: B(["wm-root", `wm-root--${n.displayMode}`])
4634
4849
  }, [
4635
4850
  !r.isOpen && !s.isEmbedded ? (l(), $(o, {
@@ -4638,22 +4853,22 @@ function Pi(t, e, n, a, r, s) {
4638
4853
  peek: s.launcherPeek,
4639
4854
  onOpen: s.openFromPeek,
4640
4855
  onDismiss: e[0] || (e[0] = (F) => r.labelDismissed = !0)
4641
- }, null, 8, ["unread-count", "peek", "onOpen"])) : g("", !0),
4642
- r.isOpen || s.isEmbedded ? (l(), d("section", {
4856
+ }, null, 8, ["unread-count", "peek", "onOpen"])) : y("", !0),
4857
+ r.isOpen || s.isEmbedded ? (l(), c("section", {
4643
4858
  key: 1,
4644
4859
  class: B(["wm-panel", `wm-panel--${n.displayMode}`]),
4645
4860
  style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4646
4861
  role: "dialog",
4647
4862
  "aria-label": "Messenger"
4648
4863
  }, [
4649
- !s.ready && !s.error ? (l(), d("div", Bi, [
4650
- s.isEmbedded ? g("", !0) : (l(), d("button", {
4864
+ !s.ready && !s.error ? (l(), c("div", Hi, [
4865
+ s.isEmbedded ? y("", !0) : (l(), c("button", {
4651
4866
  key: 0,
4652
4867
  type: "button",
4653
4868
  class: "wm-loading__close",
4654
4869
  "aria-label": "Réduire",
4655
4870
  onClick: e[1] || (e[1] = (...F) => s.close && s.close(...F))
4656
- }, [...e[6] || (e[6] = [
4871
+ }, [...e[7] || (e[7] = [
4657
4872
  i("svg", {
4658
4873
  width: "13",
4659
4874
  height: "13",
@@ -4668,12 +4883,12 @@ function Pi(t, e, n, a, r, s) {
4668
4883
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4669
4884
  ], -1)
4670
4885
  ])])),
4671
- e[7] || (e[7] = i("div", {
4886
+ e[8] || (e[8] = i("div", {
4672
4887
  class: "wm-loading__spinner",
4673
4888
  "aria-hidden": "true"
4674
4889
  }, null, -1))
4675
- ])) : (l(), d(M, { key: 1 }, [
4676
- K(c, {
4890
+ ])) : (l(), c(T, { key: 1 }, [
4891
+ K(d, {
4677
4892
  title: s.headerTitle,
4678
4893
  escalated: s.isEscalated,
4679
4894
  "agent-name": s.humanAgentName,
@@ -4688,9 +4903,9 @@ function Pi(t, e, n, a, r, s) {
4688
4903
  onMore: s.toggleMore,
4689
4904
  onClose: s.close
4690
4905
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4691
- s.error ? (l(), d("div", Ei, [
4692
- i("div", Li, [
4693
- e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4906
+ s.error ? (l(), c("div", zi, [
4907
+ i("div", Vi, [
4908
+ e[10] || (e[10] = i("div", { class: "wm-state__errIcon" }, [
4694
4909
  i("svg", {
4695
4910
  width: "14",
4696
4911
  height: "14",
@@ -4706,11 +4921,11 @@ function Pi(t, e, n, a, r, s) {
4706
4921
  ])
4707
4922
  ], -1)),
4708
4923
  i("div", null, [
4709
- e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4710
- i("div", $i, b(s.error), 1)
4924
+ e[9] || (e[9] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4925
+ i("div", qi, b(s.error), 1)
4711
4926
  ])
4712
4927
  ])
4713
- ])) : s.currentConv ? (l(), d(M, { key: 2 }, [
4928
+ ])) : s.currentConv ? (l(), c(T, { key: 2 }, [
4714
4929
  K(k, {
4715
4930
  ref: "messageList",
4716
4931
  messages: s.displayedMessages,
@@ -4723,8 +4938,8 @@ function Pi(t, e, n, a, r, s) {
4723
4938
  "unread-boundary-ts": r.unreadBoundaryTs,
4724
4939
  onLoadMore: s.onLoadMore
4725
4940
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "unread-boundary-ts", "onLoadMore"]),
4726
- i("div", Ri, [
4727
- s.floatVisible ? (l(), d("div", Fi, [
4941
+ i("div", Wi, [
4942
+ s.floatVisible ? (l(), c("div", Ki, [
4728
4943
  s.approvalReady ? (l(), $(w, {
4729
4944
  key: 0,
4730
4945
  action: s.approvalTitle,
@@ -4745,14 +4960,14 @@ function Pi(t, e, n, a, r, s) {
4745
4960
  items: s.suggestions,
4746
4961
  onSelect: s.onSuggestion
4747
4962
  }, null, 8, ["items", "onSelect"]))
4748
- ], 512)) : g("", !0),
4749
- s.actionInFlight ? (l(), d("div", ji, [
4750
- e[10] || (e[10] = i("span", {
4963
+ ], 512)) : y("", !0),
4964
+ s.actionInFlight ? (l(), c("div", Gi, [
4965
+ e[11] || (e[11] = i("span", {
4751
4966
  class: "wm-actionWait__spinner",
4752
4967
  "aria-hidden": "true"
4753
4968
  }, null, -1)),
4754
- i("span", Di, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4755
- ])) : (l(), $(P, {
4969
+ i("span", Yi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4970
+ ])) : (l(), $(U, {
4756
4971
  key: 2,
4757
4972
  ref: "composer",
4758
4973
  modelValue: r.draft,
@@ -4766,22 +4981,28 @@ function Pi(t, e, n, a, r, s) {
4766
4981
  ]),
4767
4982
  r.moreOpen ? (l(), $(x, {
4768
4983
  key: 0,
4769
- "can-rename": !!s.currentConv,
4770
- "can-clear": !!s.currentConv,
4771
- "can-export": !!s.currentConv,
4984
+ "can-rename": !!s.currentConv && !s.currentConv._draft,
4985
+ "can-export": !!s.currentConv && !s.currentConv._draft,
4772
4986
  "notif-enabled": r.notifEnabled,
4773
4987
  "status-url": s.statusUrl,
4774
4988
  "help-url": s.helpUrl,
4775
4989
  onClose: e[3] || (e[3] = (F) => r.moreOpen = !1),
4776
4990
  onNotifToggle: s.onNotifToggle,
4777
4991
  onAction: s.onMoreAction
4778
- }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0),
4779
- r.pendingAttachments.length ? (l(), d("div", Ui, [
4780
- (l(!0), d(M, null, j(r.pendingAttachments, (F, N) => (l(), d("div", {
4781
- key: N,
4992
+ }, null, 8, ["can-rename", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0),
4993
+ r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (l(), $(j, {
4994
+ key: 1,
4995
+ "initial-value": s.currentConv.name || "",
4996
+ title: "Modifier le titre de la conversation",
4997
+ onClose: e[4] || (e[4] = (F) => r.renameDialogOpen = !1),
4998
+ onSubmit: s.onRenameSubmit
4999
+ }, null, 8, ["initial-value", "onSubmit"])) : y("", !0),
5000
+ r.pendingAttachments.length ? (l(), c("div", Ji, [
5001
+ (l(!0), c(T, null, D(r.pendingAttachments, (F, H) => (l(), c("div", {
5002
+ key: H,
4782
5003
  class: "wm-attached__chip"
4783
5004
  }, [
4784
- e[12] || (e[12] = i("svg", {
5005
+ e[13] || (e[13] = i("svg", {
4785
5006
  width: "11",
4786
5007
  height: "11",
4787
5008
  viewBox: "0 0 24 24",
@@ -4798,8 +5019,8 @@ function Pi(t, e, n, a, r, s) {
4798
5019
  i("button", {
4799
5020
  type: "button",
4800
5021
  "aria-label": "Retirer",
4801
- onClick: (V) => r.pendingAttachments.splice(N, 1)
4802
- }, [...e[11] || (e[11] = [
5022
+ onClick: (Y) => r.pendingAttachments.splice(H, 1)
5023
+ }, [...e[12] || (e[12] = [
4803
5024
  i("svg", {
4804
5025
  width: "10",
4805
5026
  height: "10",
@@ -4813,9 +5034,9 @@ function Pi(t, e, n, a, r, s) {
4813
5034
  }, [
4814
5035
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4815
5036
  ], -1)
4816
- ])], 8, Ni)
5037
+ ])], 8, Xi)
4817
5038
  ]))), 128))
4818
- ])) : g("", !0)
5039
+ ])) : y("", !0)
4819
5040
  ], 64)) : (l(), $(v, {
4820
5041
  key: 1,
4821
5042
  "welcome-message": s.widgetWelcomeMessage,
@@ -4827,73 +5048,72 @@ function Pi(t, e, n, a, r, s) {
4827
5048
  onSelect: s.onQuickLink,
4828
5049
  onResume: s.onDrawerPick
4829
5050
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
4830
- r.historyOpen ? (l(), $(U, {
5051
+ r.historyOpen ? (l(), $(P, {
4831
5052
  key: 3,
4832
5053
  conversations: s.drawerConversations,
4833
5054
  "active-id": s.currentConv ? s.currentConv.id : null,
4834
- onClose: e[4] || (e[4] = (F) => r.historyOpen = !1),
5055
+ onClose: e[5] || (e[5] = (F) => r.historyOpen = !1),
4835
5056
  onNew: s.onDrawerNew,
4836
5057
  onPick: s.onDrawerPick
4837
- }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : g("", !0),
5058
+ }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : y("", !0),
4838
5059
  r.moreOpen && !s.currentConv ? (l(), $(x, {
4839
5060
  key: 4,
4840
5061
  "can-rename": !1,
4841
- "can-clear": !1,
4842
5062
  "can-export": !1,
4843
5063
  "notif-enabled": r.notifEnabled,
4844
5064
  "status-url": s.statusUrl,
4845
5065
  "help-url": s.helpUrl,
4846
- onClose: e[5] || (e[5] = (F) => r.moreOpen = !1),
5066
+ onClose: e[6] || (e[6] = (F) => r.moreOpen = !1),
4847
5067
  onNotifToggle: s.onNotifToggle,
4848
5068
  onAction: s.onMoreAction
4849
- }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : g("", !0)
5069
+ }, null, 8, ["notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : y("", !0)
4850
5070
  ], 64))
4851
- ], 6)) : g("", !0)
5071
+ ], 6)) : y("", !0)
4852
5072
  ], 2);
4853
5073
  }
4854
- const Vi = /* @__PURE__ */ E(Ii, [["render", Pi], ["__scopeId", "data-v-29568eac"]]), qi = "0.2.31";
5074
+ const ta = /* @__PURE__ */ E(Pi, [["render", Qi], ["__scopeId", "data-v-1d79cc79"]]), na = "0.3.0";
4855
5075
  export {
4856
5076
  te as AIAvatar,
4857
- ce as AVATAR_COLORS,
5077
+ ue as AVATAR_COLORS,
4858
5078
  Zt as ActionResult,
4859
- dr as ApprovalCard,
5079
+ cr as ApprovalCard,
4860
5080
  ln as ArtifactFormResponse,
4861
5081
  bn as ArtifactInfoCard,
4862
- Nn as ArtifactRenderer,
5082
+ Un as ArtifactRenderer,
4863
5083
  Fn as ArtifactTicket,
4864
5084
  Qn as AttachmentPreview,
4865
5085
  is as Bubble,
4866
5086
  Js as Composer,
4867
5087
  Pe as DEFAULT_BASE_URL,
4868
5088
  Kr as Feedback,
4869
- jr as FormCard,
4870
- gt as Header,
5089
+ Dr as FormCard,
5090
+ yt as Header,
4871
5091
  fi as HistoryDrawer,
4872
5092
  ke as HumanAvatar,
4873
5093
  Ke as Launcher,
4874
- he as MEDIA_RECORDER_SUPPORTED,
5094
+ me as MEDIA_RECORDER_SUPPORTED,
4875
5095
  Is as MessageList,
4876
- Vi as Messenger,
5096
+ ta as Messenger,
4877
5097
  ki as MoreMenu,
4878
5098
  Pt as Onboarding,
4879
- ie as SCREEN_CAPTURE_SUPPORTED,
5099
+ oe as SCREEN_CAPTURE_SUPPORTED,
4880
5100
  er as SuggestionChips,
4881
5101
  ot as TeamAvatars,
4882
- cs as Typing,
4883
- qi as VERSION,
4884
- ge as avatarColor,
5102
+ ds as Typing,
5103
+ na as VERSION,
5104
+ ye as avatarColor,
4885
5105
  we as avatarInitials,
4886
5106
  Es as captureScreenshotFile,
4887
- D as colors,
4888
- Ue as createStore,
5107
+ N as colors,
5108
+ je as createStore,
4889
5109
  Re as createTransport,
4890
- Vi as default,
5110
+ ta as default,
4891
5111
  be as formatTime,
4892
- zi as guessAttachmentKind,
5112
+ ea as guessAttachmentKind,
4893
5113
  Bs as pickRecorderMime,
4894
5114
  ts as renderMarkdown,
4895
- $s as startScreenRecording,
4896
- Ne as tokensCss,
4897
- De as uuid,
4898
- De as v4
5115
+ Ls as startScreenRecording,
5116
+ Ue as tokensCss,
5117
+ Ne as uuid,
5118
+ Ne as v4
4899
5119
  };