@_solaris/messenger-widget 0.2.20 → 0.2.22

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 z, Transition as Se, withCtx as xe, withKeys as me, withModifiers as X, createElementVNode as i, toDisplayString as b, createCommentVNode as w, normalizeStyle as V, normalizeClass as E, Fragment as M, renderList as j, resolveComponent as O, createBlock as R, createTextVNode as ie, resolveDynamicComponent as Me, renderSlot as Te, withDirectives as H, vModelText as K, vModelCheckbox as Ie, vModelSelect as Oe, createStaticVNode as ue, markRaw as fe } from "vue";
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 w, normalizeStyle as G, normalizeClass as E, 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";
2
2
  const Ee = [
3
3
  "connected",
4
4
  "message",
@@ -6,8 +6,8 @@ const Ee = [
6
6
  "conversation_updated",
7
7
  "config_updated",
8
8
  "action_status"
9
- ], Be = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, Re = 5 * 60 * 1e3;
10
- function $e(t) {
9
+ ], Be = 5 * 60 * 1e3, Le = 10 * 60 * 1e3, $e = 5 * 60 * 1e3;
10
+ function Re(t) {
11
11
  const e = {
12
12
  baseUrl: Fe(t.baseUrl || ""),
13
13
  widgetId: t.widgetId || "",
@@ -35,12 +35,12 @@ function $e(t) {
35
35
  return e.listeners.has(h) || e.listeners.set(h, /* @__PURE__ */ new Set()), e.listeners.get(h).add(f), () => e.listeners.get(h).delete(f);
36
36
  }
37
37
  function a(h, f) {
38
- const _ = e.listeners.get(h);
39
- _ && _.forEach((C) => {
38
+ const p = e.listeners.get(h);
39
+ p && p.forEach((C) => {
40
40
  try {
41
41
  C(f);
42
- } catch (I) {
43
- console.error("[transport] listener", h, I);
42
+ } catch (O) {
43
+ console.error("[transport] listener", h, O);
44
44
  }
45
45
  });
46
46
  }
@@ -54,17 +54,17 @@ function $e(t) {
54
54
  "X-Widget-Id": e.widgetId
55
55
  };
56
56
  }
57
- async function o(h, f, _) {
57
+ async function o(h, f, p) {
58
58
  const C = await fetch(`${e.baseUrl}${f}`, {
59
59
  method: h,
60
60
  headers: { "Content-Type": "application/json", ...s() },
61
- body: _ !== void 0 ? JSON.stringify(_) : void 0
61
+ body: p !== void 0 ? JSON.stringify(p) : void 0
62
62
  });
63
63
  if (!C.ok) {
64
- const I = await c(C), T = new Error(
65
- `HTTP ${C.status} ${h} ${f} :: ${(I == null ? void 0 : I.error) || C.statusText}`
64
+ const O = await c(C), T = new Error(
65
+ `HTTP ${C.status} ${h} ${f} :: ${(O == null ? void 0 : O.error) || C.statusText}`
66
66
  );
67
- throw T.status = C.status, T.body = I, T;
67
+ throw T.status = C.status, T.body = O, T;
68
68
  }
69
69
  return C.status === 204 ? null : C.json();
70
70
  }
@@ -78,12 +78,12 @@ function $e(t) {
78
78
  async function v() {
79
79
  const [h, f] = await Promise.all([
80
80
  // Public — no HMAC required.
81
- fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (_) => {
82
- if (!_.ok) {
83
- const C = await c(_);
84
- throw new Error(`HTTP ${_.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || _.statusText}`);
81
+ fetch(`${e.baseUrl}/widgets/${encodeURIComponent(e.widgetId)}/config`).then(async (p) => {
82
+ if (!p.ok) {
83
+ const C = await c(p);
84
+ throw new Error(`HTTP ${p.status} GET /widgets/:id/config :: ${(C == null ? void 0 : C.error) || p.statusText}`);
85
85
  }
86
- return _.json();
86
+ return p.json();
87
87
  }),
88
88
  // HMAC-protected.
89
89
  o("GET", "/customers/me")
@@ -100,7 +100,7 @@ function $e(t) {
100
100
  const h = await o("GET", "/customers/me");
101
101
  return (h == null ? void 0 : h.customer) ?? null;
102
102
  }
103
- async function y(h) {
103
+ async function g(h) {
104
104
  const f = await o("PATCH", "/customers/me", h);
105
105
  return (f == null ? void 0 : f.customer) ?? null;
106
106
  }
@@ -108,72 +108,72 @@ function $e(t) {
108
108
  const h = await o("GET", "/conversations");
109
109
  return (h == null ? void 0 : h.conversations) ?? [];
110
110
  }
111
- async function $(h = {}) {
111
+ async function R(h = {}) {
112
112
  return (await o("POST", "/conversations", h)).conversation;
113
113
  }
114
114
  async function A(h) {
115
115
  return (await o("GET", `/conversations/${encodeURIComponent(h)}`)).conversation;
116
116
  }
117
- async function D(h, f) {
117
+ async function P(h, f) {
118
118
  return (await o("PATCH", `/conversations/${encodeURIComponent(h)}`, f)).conversation;
119
119
  }
120
120
  async function x(h, f = {}) {
121
- const _ = new URLSearchParams();
122
- f.before && _.set("before", f.before), f.since && _.set("since", f.since), f.limit && _.set("limit", String(f.limit));
123
- const C = _.toString() ? `?${_.toString()}` : "";
121
+ const p = new URLSearchParams();
122
+ f.before && p.set("before", f.before), f.since && p.set("since", f.since), f.limit && p.set("limit", String(f.limit));
123
+ const C = p.toString() ? `?${p.toString()}` : "";
124
124
  return o(
125
125
  "GET",
126
126
  `/conversations/${encodeURIComponent(h)}/messages${C}`
127
127
  );
128
128
  }
129
- async function N(h, f) {
130
- G();
131
- const _ = {
129
+ async function D(h, f) {
130
+ z();
131
+ const p = {
132
132
  client_msg_id: f.client_msg_id,
133
133
  type: "content",
134
134
  text_md: f.text_md,
135
135
  author: { id: e.userId, type: "user" },
136
136
  created_at: f.created_at || (/* @__PURE__ */ new Date()).toISOString()
137
137
  };
138
- return Array.isArray(f.attachments) && f.attachments.length && (_.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (_.metadata = f.metadata), o(
138
+ return Array.isArray(f.attachments) && f.attachments.length && (p.payload = { type: "content", attachments: f.attachments }), f.metadata && typeof f.metadata == "object" && (p.metadata = f.metadata), o(
139
139
  "POST",
140
140
  `/conversations/${encodeURIComponent(h)}/messages`,
141
- _
141
+ p
142
142
  );
143
143
  }
144
- async function F(h, f, _) {
145
- return G(), o(
144
+ async function F(h, f, p) {
145
+ return z(), o(
146
146
  "POST",
147
147
  `/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(f)}`,
148
- _ ? { inputs: _ } : {}
148
+ p ? { inputs: p } : {}
149
149
  );
150
150
  }
151
- async function P(h) {
151
+ async function N(h) {
152
152
  const f = (
153
153
  /** @type {File} */
154
154
  h.name || "attachment"
155
- ), _ = h.type || "application/octet-stream", C = h.size || 0, I = (
155
+ ), p = h.type || "application/octet-stream", C = h.size || 0, O = (
156
156
  /** @type {import('./types.js').AttachmentUploadTicket} */
157
157
  await o("POST", "/attachments", {
158
- mime_type: _,
158
+ mime_type: p,
159
159
  size_bytes: C,
160
160
  name: f
161
161
  })
162
- ), T = await fetch(I.upload_url, {
162
+ ), T = await fetch(O.upload_url, {
163
163
  method: "PUT",
164
- headers: { "Content-Type": _ },
164
+ headers: { "Content-Type": p },
165
165
  body: h
166
166
  });
167
167
  if (!T.ok)
168
168
  throw new Error(`HTTP ${T.status} PUT signed upload`);
169
169
  return {
170
- type: je(_),
171
- path: I.path,
172
- mime_type: _,
170
+ type: je(p),
171
+ path: O.path,
172
+ mime_type: p,
173
173
  size_bytes: C
174
174
  };
175
175
  }
176
- async function q(h) {
176
+ async function V(h) {
177
177
  return o(
178
178
  "GET",
179
179
  `/attachments/sign?path=${encodeURIComponent(h)}`
@@ -187,48 +187,48 @@ function $e(t) {
187
187
  }).toString();
188
188
  return `${e.baseUrl}/stream?${h}`;
189
189
  }
190
- function W() {
190
+ function H() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
193
  const h = new EventSource(Y());
194
194
  for (const f of Ee)
195
- h.addEventListener(f, (_) => ae(f, _.data));
195
+ h.addEventListener(f, (p) => J(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 ae(h, f) {
201
+ function J(h, f) {
202
202
  try {
203
- const _ = JSON.parse(f), C = _ && typeof _ == "object" && "data" in _ ? _.data : _;
203
+ const p = JSON.parse(f), C = p && typeof p == "object" && "data" in p ? p.data : p;
204
204
  a(h, C);
205
- } catch (_) {
206
- console.error("[transport] bad SSE payload", h, _);
205
+ } catch (p) {
206
+ console.error("[transport] bad SSE payload", h, p);
207
207
  }
208
208
  }
209
- function J() {
209
+ function q() {
210
210
  e.eventSource && (e.eventSource.close(), e.eventSource = null), e.connection !== "paused" && r("idle");
211
211
  }
212
- function G() {
213
- clearTimeout(e.burstTimer), W(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
- e.panelOpen || J();
212
+ function z() {
213
+ clearTimeout(e.burstTimer), H(), e.panelOpen || (e.burstTimer = setTimeout(() => {
214
+ e.panelOpen || q();
215
215
  }, Le));
216
216
  }
217
- function oe(h) {
218
- e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), W()) : G();
217
+ function X(h) {
218
+ e.panelOpen = !!h, e.panelOpen ? (clearTimeout(e.burstTimer), H()) : z();
219
219
  }
220
220
  async function le() {
221
221
  try {
222
- const h = await S(), f = h.reduce((C, I) => {
223
- const T = I == null ? void 0 : I.last_message_at;
222
+ const h = await S(), f = h.reduce((C, O) => {
223
+ const T = O == null ? void 0 : O.last_message_at;
224
224
  return T && (!C || T > C) ? T : C;
225
225
  }, null);
226
- f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), G());
226
+ f && (!e.lastActivityAt || f > e.lastActivityAt) && (e.lastActivityAt = f, a("activity", { conversations: h, latestAt: f }), z());
227
227
  } catch (h) {
228
228
  console.error("[transport] poll failed", h);
229
229
  }
230
230
  }
231
- function Z() {
231
+ function ne() {
232
232
  u(), !(typeof document < "u" && document.hidden) && (e.pollTimer = setInterval(le, Be));
233
233
  }
234
234
  function u() {
@@ -237,53 +237,53 @@ function $e(t) {
237
237
  function m() {
238
238
  if (document.hidden)
239
239
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = setTimeout(() => {
240
- e.hiddenGraceTimer = null, document.hidden && (u(), J(), r("paused"));
241
- }, Re);
240
+ e.hiddenGraceTimer = null, document.hidden && (u(), q(), r("paused"));
241
+ }, $e);
242
242
  else {
243
243
  if (e.hiddenGraceTimer) {
244
244
  clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null;
245
245
  return;
246
246
  }
247
- r("idle"), Z(), e.panelOpen && W();
247
+ r("idle"), ne(), e.panelOpen && H();
248
248
  }
249
249
  }
250
- async function p() {
250
+ async function _() {
251
251
  if (e.started) return e.lastBootstrap;
252
252
  e.started = !0;
253
253
  const h = await v();
254
254
  e.lastBootstrap = h;
255
255
  try {
256
256
  const f = await S();
257
- e.lastActivityAt = f.reduce((_, C) => {
258
- const I = C == null ? void 0 : C.last_message_at;
259
- return I && (!_ || I > _) ? I : _;
257
+ e.lastActivityAt = f.reduce((p, C) => {
258
+ const O = C == null ? void 0 : C.last_message_at;
259
+ return O && (!p || O > p) ? O : p;
260
260
  }, null);
261
261
  } catch (f) {
262
262
  console.error("[transport] initial /conversations failed", f);
263
263
  }
264
- return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), Z(), h;
264
+ return typeof document < "u" && (e.visibilityHandler = m, document.addEventListener("visibilitychange", e.visibilityHandler)), ne(), h;
265
265
  }
266
- function g() {
267
- u(), clearTimeout(e.burstTimer), clearTimeout(e.hiddenGraceTimer), e.hiddenGraceTimer = null, J(), e.visibilityHandler && (document.removeEventListener("visibilitychange", e.visibilityHandler), e.visibilityHandler = null), e.started = !1;
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;
268
268
  }
269
269
  return {
270
270
  on: n,
271
- start: p,
272
- stop: g,
273
- setPanelOpen: oe,
271
+ start: _,
272
+ stop: y,
273
+ setPanelOpen: X,
274
274
  // REST
275
275
  bootstrap: v,
276
276
  getCustomer: k,
277
- patchCustomer: y,
277
+ patchCustomer: g,
278
278
  listConversations: S,
279
- createConversation: $,
279
+ createConversation: R,
280
280
  getConversation: A,
281
- patchConversation: D,
281
+ patchConversation: P,
282
282
  listMessages: x,
283
- postMessage: N,
283
+ postMessage: D,
284
284
  postCallback: F,
285
- uploadAttachment: P,
286
- signAttachment: q,
285
+ uploadAttachment: N,
286
+ signAttachment: V,
287
287
  // Read-only state
288
288
  get connection() {
289
289
  return e.connection;
@@ -343,30 +343,30 @@ function De(t) {
343
343
  n.push(t.on("connection", (u) => {
344
344
  e.connection = u;
345
345
  })), n.push(t.on("message", (u) => {
346
- const m = u == null ? void 0 : u.conversation_id, p = u == null ? void 0 : u.message;
347
- !m || !(p != null && p.id) || (W(m, p), p.client_msg_id && delete e.streamingByMsgId[p.client_msg_id], G(m, p.created_at));
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));
348
348
  })), n.push(t.on("message_stream", (u) => {
349
- const m = u == null ? void 0 : u.message_id, p = u == null ? void 0 : u.token;
350
- !m || typeof p != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + p);
349
+ const m = u == null ? void 0 : u.message_id, _ = u == null ? void 0 : u.token;
350
+ !m || typeof _ != "string" || (e.streamingByMsgId[m] = (e.streamingByMsgId[m] || "") + _);
351
351
  })), n.push(t.on("conversation_updated", (u) => {
352
- const m = u == null ? void 0 : u.conversation_id, p = u == null ? void 0 : u.changes;
353
- if (!m || !p) return;
354
- const g = e.conversations.findIndex((h) => h.id === m);
355
- g !== -1 && (e.conversations[g] = { ...e.conversations[g], ...p });
352
+ const m = u == null ? void 0 : u.conversation_id, _ = u == null ? void 0 : u.changes;
353
+ if (!m || !_) return;
354
+ const y = e.conversations.findIndex((h) => h.id === m);
355
+ y !== -1 && (e.conversations[y] = { ...e.conversations[y], ..._ });
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, p = u == null ? void 0 : u.action_id, g = u == null ? void 0 : u.action_name;
360
- if (!m || !p) return;
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;
360
+ if (!m || !_) return;
361
361
  const h = e.runningActionsByConv[m] || {};
362
- u.state === "running" ? (h[p] = g || p, e.runningActionsByConv[m] = { ...h }) : u.state === "done" && (delete h[p], e.runningActionsByConv[m] = { ...h });
362
+ u.state === "running" ? (h[_] = y || _, 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
- (p, g) => setTimeout(() => g(new Error("bootstrap timeout (15s) — check baseUrl, CORS, and network")), 15e3)
369
+ (_, y) => setTimeout(() => y(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) {
@@ -385,22 +385,22 @@ function De(t) {
385
385
  const m = le(u);
386
386
  if (!m) return e.customer;
387
387
  try {
388
- const p = await t.patchCustomer(m);
389
- p && (e.customer = p);
390
- } catch (p) {
391
- console.error("[store] applyCustomer failed", p);
388
+ const _ = await t.patchCustomer(m);
389
+ _ && (e.customer = _);
390
+ } catch (_) {
391
+ console.error("[store] applyCustomer failed", _);
392
392
  }
393
393
  return e.customer;
394
394
  }
395
395
  async function o(u = {}) {
396
- const m = await t.createConversation(u), p = e.conversations.findIndex((g) => g.id === m.id);
397
- return p === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[p] = m, m;
396
+ const m = await t.createConversation(u), _ = e.conversations.findIndex((y) => y.id === m.id);
397
+ return _ === -1 ? e.conversations = [m, ...e.conversations] : e.conversations[_] = m, m;
398
398
  }
399
399
  const c = 50;
400
400
  async function v(u) {
401
401
  if (e.messagesByConv[u]) return;
402
402
  const m = await t.listMessages(u, { limit: c });
403
- e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], y(u, {
403
+ e.messagesByConv[u] = (m == null ? void 0 : m.messages) ?? [], g(u, {
404
404
  nextCursor: (m == null ? void 0 : m.next_cursor) ?? null,
405
405
  loading: !1,
406
406
  loaded: !0
@@ -409,41 +409,41 @@ function De(t) {
409
409
  async function k(u) {
410
410
  const m = e.paginationByConv[u];
411
411
  if (!(!m || m.loading || !m.nextCursor)) {
412
- y(u, { ...m, loading: !0 });
412
+ g(u, { ...m, loading: !0 });
413
413
  try {
414
- let h = m.nextCursor, f = [], _ = 0;
415
- for (; _ < 6 && h; _++) {
414
+ let h = m.nextCursor, f = [], p = 0;
415
+ for (; p < 6 && h; p++) {
416
416
  const L = await t.listMessages(u, {
417
417
  before: h,
418
418
  limit: c
419
- }), ee = (L == null ? void 0 : L.messages) ?? [];
420
- if (f = [...ee, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !ee.length || f.length >= 60) break;
419
+ }), se = (L == null ? void 0 : L.messages) ?? [];
420
+ if (f = [...se, ...f], h = (L == null ? void 0 : L.next_cursor) ?? null, !se.length || f.length >= 60) break;
421
421
  }
422
- const C = e.messagesByConv[u] || [], I = new Set(C.map((L) => String(L == null ? void 0 : L.id))), T = [...f.filter((L) => !I.has(String(L == null ? void 0 : L.id))), ...C];
423
- e.messagesByConv[u] = T, y(u, {
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, g(u, {
424
424
  nextCursor: h,
425
425
  loading: !1,
426
426
  loaded: !0
427
427
  });
428
- } catch (p) {
429
- console.error("[store] loadMore failed", p), y(u, { ...m, loading: !1 });
428
+ } catch (_) {
429
+ console.error("[store] loadMore failed", _), g(u, { ...m, loading: !1 });
430
430
  }
431
431
  }
432
432
  }
433
- function y(u, m) {
433
+ function g(u, m) {
434
434
  e.paginationByConv = { ...e.paginationByConv, [u]: m };
435
435
  }
436
436
  async function S(u, m) {
437
- const p = await t.patchConversation(u, m), g = e.conversations.findIndex((h) => h.id === u);
438
- g !== -1 && (e.conversations[g] = p);
437
+ const _ = await t.patchConversation(u, m), y = e.conversations.findIndex((h) => h.id === u);
438
+ y !== -1 && (e.conversations[y] = _);
439
439
  }
440
- async function $(u, m, { attachments: p, metadata: g } = {}) {
440
+ async function R(u, m, { attachments: _, metadata: y } = {}) {
441
441
  var T;
442
- const h = (m || "").trim(), f = Array.isArray(p) && p.length > 0;
442
+ const h = (m || "").trim(), f = Array.isArray(_) && _.length > 0;
443
443
  if (!u || !h && !f) return;
444
- const _ = Ue(), C = Z(u), I = {
445
- id: _,
446
- client_msg_id: _,
444
+ const p = Ue(), C = ne(u), O = {
445
+ id: p,
446
+ client_msg_id: p,
447
447
  conversation_id: u,
448
448
  type: "content",
449
449
  text_md: h,
@@ -454,98 +454,98 @@ function De(t) {
454
454
  created_at: C,
455
455
  // Local-only flag — UI may render dimmed until the SSE echo lands.
456
456
  _pending: !0,
457
- ...f ? { payload: { type: "content", attachments: p } } : {},
458
- ...g && typeof g == "object" ? { metadata: g } : {}
457
+ ...f ? { payload: { type: "content", attachments: _ } } : {},
458
+ ...y && typeof y == "object" ? { metadata: y } : {}
459
459
  };
460
- W(u, I);
460
+ H(u, O);
461
461
  try {
462
462
  await t.postMessage(u, {
463
- client_msg_id: _,
463
+ client_msg_id: p,
464
464
  text_md: h,
465
465
  created_at: C,
466
- ...f ? { attachments: p } : {},
467
- ...g && typeof g == "object" ? { metadata: g } : {}
466
+ ...f ? { attachments: _ } : {},
467
+ ...y && typeof y == "object" ? { metadata: y } : {}
468
468
  });
469
469
  } catch (L) {
470
- console.error("[store] send failed", L), J(u, _, { _failed: !0, _pending: !1 });
470
+ console.error("[store] send failed", L), q(u, p, { _failed: !0, _pending: !1 });
471
471
  }
472
472
  }
473
- async function A(u, m, p) {
473
+ async function A(u, m, _) {
474
474
  u != null && (e.awaitingCallback[u] = !0);
475
475
  try {
476
- await t.postCallback(u, m, p);
477
- } catch (g) {
478
- console.error("[store] callback failed", g), u != null && delete e.awaitingCallback[u];
476
+ await t.postCallback(u, m, _);
477
+ } catch (y) {
478
+ console.error("[store] callback failed", y), u != null && delete e.awaitingCallback[u];
479
479
  }
480
480
  }
481
- const D = /* @__PURE__ */ new Map();
481
+ const P = /* @__PURE__ */ new Map();
482
482
  async function x(u) {
483
483
  if (!u) return null;
484
- const m = D.get(u);
484
+ const m = P.get(u);
485
485
  if (m != null && m.url) {
486
- const p = m.expires_at ? Date.parse(m.expires_at) : 0;
487
- if (!p || p - Date.now() > 6e4) return m.url;
486
+ const _ = m.expires_at ? Date.parse(m.expires_at) : 0;
487
+ if (!_ || _ - Date.now() > 6e4) return m.url;
488
488
  }
489
489
  try {
490
- const p = await t.signAttachment(u);
491
- if (p != null && p.signed_url)
492
- return D.set(u, { url: p.signed_url, expires_at: p.expires_at }), p.signed_url;
493
- } catch (p) {
494
- console.error("[store] sign attachment failed", p);
490
+ const _ = await t.signAttachment(u);
491
+ if (_ != null && _.signed_url)
492
+ return P.set(u, { url: _.signed_url, expires_at: _.expires_at }), _.signed_url;
493
+ } catch (_) {
494
+ console.error("[store] sign attachment failed", _);
495
495
  }
496
496
  return null;
497
497
  }
498
- async function N(u, { rating: m, comment: p } = {}) {
499
- const g = e.conversations.find((_) => _.id === u), f = {
500
- ...(g == null ? void 0 : g.metadata) || {},
498
+ async function D(u, { rating: m, comment: _ } = {}) {
499
+ const y = e.conversations.find((p) => p.id === u), f = {
500
+ ...(y == null ? void 0 : y.metadata) || {},
501
501
  feedback: {
502
502
  rating: m,
503
- comment: p || null,
503
+ comment: _ || null,
504
504
  submitted_at: (/* @__PURE__ */ new Date()).toISOString()
505
505
  }
506
506
  };
507
507
  await S(u, { metadata: f });
508
508
  }
509
509
  function F(u) {
510
- var p, g;
510
+ var _, y;
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" && ((p = f == null ? void 0 : f.payload) == null ? void 0 : p.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])
514
+ if ((f == null ? void 0 : f.type) === "action" && ((_ = f == null ? void 0 : f.payload) == null ? void 0 : _.type) === "action" && ((y = f == null ? void 0 : f.payload) == null ? void 0 : y.state) === "pending" && Array.isArray(f == null ? void 0 : f.callbacks) && f.callbacks.length > 0 && !e.awaitingCallback[f.id])
515
515
  return f;
516
516
  }
517
517
  return null;
518
518
  }
519
- function P(u) {
520
- var p, g, h;
519
+ function N(u) {
520
+ var _, y, h;
521
521
  const m = e.messagesByConv[u] || [];
522
522
  for (let f = m.length - 1; f >= 0; f--) {
523
- const _ = m[f];
524
- if (((p = _ == null ? void 0 : _.author) == null ? void 0 : p.type) === "user" || (_ == null ? void 0 : _.type) === "action" && ((g = _ == null ? void 0 : _.payload) == null ? void 0 : g.state) === "pending") return null;
525
- const C = (h = _ == null ? void 0 : _.metadata) == null ? void 0 : h.form;
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;
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
- return { message: _, form: C };
527
+ return { message: p, form: C };
528
528
  }
529
529
  return null;
530
530
  }
531
- function q(u) {
531
+ function V(u) {
532
532
  const m = e.runningActionsByConv[u];
533
533
  if (!m) return null;
534
- const p = Object.keys(m);
535
- if (p.length === 0) return null;
536
- const g = p[0];
537
- return { id: g, payload: { name: m[g] } };
534
+ const _ = Object.keys(m);
535
+ if (_.length === 0) return null;
536
+ const y = _[0];
537
+ return { id: y, payload: { name: m[y] } };
538
538
  }
539
539
  function Y(u) {
540
- var p, g, h, f;
540
+ var _, y, h, f;
541
541
  const m = e.messagesByConv[u] || [];
542
- for (let _ = m.length - 1; _ >= 0; _--) {
543
- const C = m[_];
544
- if (((p = C == null ? void 0 : C.author) == null ? void 0 : p.type) === "user") return [];
545
- if ((C == null ? void 0 : C.type) === "action" && ((g = C == null ? void 0 : C.payload) == null ? void 0 : g.state) === "pending") return [];
542
+ for (let p = m.length - 1; p >= 0; p--) {
543
+ const C = m[p];
544
+ if (((_ = C == null ? void 0 : C.author) == null ? void 0 : _.type) === "user") return [];
545
+ if ((C == null ? void 0 : C.type) === "action" && ((y = C == null ? void 0 : C.payload) == null ? void 0 : y.state) === "pending") return [];
546
546
  if (((h = C == null ? void 0 : C.author) == null ? void 0 : h.type) !== "agent_ia") continue;
547
- const I = (f = C == null ? void 0 : C.metadata) == null ? void 0 : f.suggested_replies;
548
- return Array.isArray(I) && I.length ? I.map((T) => {
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
549
  if (typeof T == "string") {
550
550
  const L = T.trim();
551
551
  return L ? { label: L, kind: null } : null;
@@ -553,63 +553,63 @@ function De(t) {
553
553
  if (T && typeof T == "object" && typeof T.label == "string") {
554
554
  const L = T.label.trim();
555
555
  if (!L) return null;
556
- const ee = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
557
- return { label: L, kind: ee };
556
+ const se = T.kind === "cta" || T.kind === "choice" || T.kind === "followup" ? T.kind : null;
557
+ return { label: L, kind: se };
558
558
  }
559
559
  return null;
560
560
  }).filter(Boolean).slice(0, 4) : [];
561
561
  }
562
562
  return [];
563
563
  }
564
- function W(u, m) {
564
+ function H(u, m) {
565
565
  var f;
566
- const p = e.messagesByConv[u] || [];
567
- let g = -1;
568
- m != null && m.client_msg_id && (g = p.findIndex(
569
- (_) => (_ == null ? void 0 : _.client_msg_id) && _.client_msg_id === m.client_msg_id
570
- )), g === -1 && (m == null ? void 0 : m.id) !== void 0 && (m == null ? void 0 : m.id) !== null && (g = p.findIndex((_) => ae(_ == null ? void 0 : _.id, m.id)));
566
+ const _ = e.messagesByConv[u] || [];
567
+ let y = -1;
568
+ m != null && m.client_msg_id && (y = _.findIndex(
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)));
571
571
  let h;
572
- g === -1 ? h = [...p, m].sort(oe) : (h = p.slice(), h[g] = { ...p[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];
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];
573
573
  }
574
- function ae(u, m) {
574
+ function J(u, m) {
575
575
  return u === m ? !0 : u == null || m == null ? !1 : String(u) === String(m);
576
576
  }
577
- function J(u, m, p) {
578
- const g = e.messagesByConv[u];
579
- if (!g) return;
580
- const h = g.findIndex((_) => _.id === m);
577
+ function q(u, m, _) {
578
+ const y = e.messagesByConv[u];
579
+ if (!y) return;
580
+ const h = y.findIndex((p) => p.id === m);
581
581
  if (h === -1) return;
582
- const f = g.slice();
583
- f[h] = { ...g[h], ...p }, e.messagesByConv[u] = f;
582
+ const f = y.slice();
583
+ f[h] = { ...y[h], ..._ }, e.messagesByConv[u] = f;
584
584
  }
585
- function G(u, m) {
586
- const p = e.conversations.findIndex((h) => h.id === u);
587
- if (p === -1) return;
588
- const g = e.conversations[p];
589
- if (m && (!g.last_message_at || m > g.last_message_at)) {
585
+ function z(u, m) {
586
+ const _ = e.conversations.findIndex((h) => h.id === u);
587
+ if (_ === -1) return;
588
+ const y = e.conversations[_];
589
+ if (m && (!y.last_message_at || m > y.last_message_at)) {
590
590
  const h = e.conversations.slice();
591
- h[p] = { ...g, last_message_at: m }, h.sort(
592
- (f, _) => (_.last_message_at || "").localeCompare(f.last_message_at || "")
591
+ h[_] = { ...y, last_message_at: m }, h.sort(
592
+ (f, p) => (p.last_message_at || "").localeCompare(f.last_message_at || "")
593
593
  ), e.conversations = h;
594
594
  }
595
595
  }
596
- function oe(u, m) {
596
+ function X(u, m) {
597
597
  return (u.created_at || "").localeCompare(m.created_at || "");
598
598
  }
599
599
  function le(u) {
600
600
  if (!u || typeof u != "object") return null;
601
- const m = {}, p = {};
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(p, h) : p[g] = h);
604
- return Object.keys(p).length && (m.values = p), Object.keys(m).length ? m : null;
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);
604
+ return Object.keys(_).length && (m.values = _), Object.keys(m).length ? m : null;
605
605
  }
606
- function Z(u) {
606
+ function ne(u) {
607
607
  const m = e.messagesByConv[u] || [];
608
- let p = "";
608
+ let _ = "";
609
609
  for (const f of m)
610
- f != null && f.created_at && f.created_at > p && (p = f.created_at);
611
- const g = (/* @__PURE__ */ new Date()).toISOString();
612
- return !p || g > p ? g : new Date(Date.parse(p) + 1).toISOString();
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();
613
613
  }
614
614
  return {
615
615
  state: e,
@@ -620,14 +620,14 @@ function De(t) {
620
620
  openConversation: v,
621
621
  loadMore: k,
622
622
  patchConversation: S,
623
- send: $,
623
+ send: R,
624
624
  clickCallback: A,
625
625
  signAttachment: x,
626
- submitFeedback: N,
626
+ submitFeedback: D,
627
627
  getPendingApproval: F,
628
- getActionInFlight: q,
628
+ getActionInFlight: V,
629
629
  getLatestSuggestions: Y,
630
- getLatestForm: P,
630
+ getLatestForm: N,
631
631
  // Pass-through for panel open/close (controls SSE burst).
632
632
  setPanelOpen: t.setPanelOpen
633
633
  };
@@ -649,7 +649,7 @@ const U = {
649
649
  red: "#B91C1C",
650
650
  redBg: "#FDECEC"
651
651
  }, ce = ["#5B5FEF", "#7C3AED", "#DB2777", "#0891B2", "#D97706", "#059669"];
652
- function ye(t = "") {
652
+ function ge(t = "") {
653
653
  return t ? ce[t.charCodeAt(0) % ce.length] : ce[0];
654
654
  }
655
655
  function we(t = "") {
@@ -722,7 +722,7 @@ const Ne = `
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
724
  return l(), d("div", ze, [
725
- z(Se, { name: "wm-peek" }, {
725
+ K(Se, { name: "wm-peek" }, {
726
726
  default: xe(() => [
727
727
  n.peek ? (l(), d("div", {
728
728
  key: 0,
@@ -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(X((o) => t.$emit("open"), ["prevent"]), ["enter"])),
736
- e[3] || (e[3] = me(X((o) => t.$emit("open"), ["prevent"]), ["space"]))
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"]))
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] = X((o) => t.$emit("dismiss"), ["stop"]))
744
+ onClick: e[0] || (e[0] = ee((o) => t.$emit("dismiss"), ["stop"]))
745
745
  }, [...e[5] || (e[5] = [
746
746
  i("svg", {
747
747
  width: "11",
@@ -788,7 +788,7 @@ function We(t, e, n, a, r, s) {
788
788
  ])
789
789
  ]);
790
790
  }
791
- const Ge = /* @__PURE__ */ B(He, [["render", We], ["__scopeId", "data-v-fabef371"]]), Ke = {
791
+ const Ke = /* @__PURE__ */ B(He, [["render", We], ["__scopeId", "data-v-fabef371"]]), Ge = {
792
792
  name: "WmAIAvatar",
793
793
  props: {
794
794
  size: { type: Number, default: 26 },
@@ -807,7 +807,7 @@ const Ge = /* @__PURE__ */ B(He, [["render", We], ["__scopeId", "data-v-fabef371
807
807
  function Xe(t, e, n, a, r, s) {
808
808
  return l(), d("div", {
809
809
  class: E(["wm-aiav", { "wm-aiav--tail": n.tail }]),
810
- style: V({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
810
+ style: G({ width: n.size + "px", height: n.size + "px", "--wm-avr": n.size * 0.32 + "px" })
811
811
  }, [
812
812
  n.pulse ? (l(), d("div", Ye)) : w("", !0),
813
813
  i("div", {
@@ -843,7 +843,7 @@ function Xe(t, e, n, a, r, s) {
843
843
  ], 2)
844
844
  ], 6);
845
845
  }
846
- const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"]]), Qe = {
846
+ const te = /* @__PURE__ */ B(Ge, [["render", Xe], ["__scopeId", "data-v-8c924688"]]), Qe = {
847
847
  name: "WmHumanAvatar",
848
848
  props: {
849
849
  name: { type: String, default: "" },
@@ -852,7 +852,7 @@ const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"
852
852
  },
853
853
  computed: {
854
854
  bg() {
855
- return this.avatarUrl ? "transparent" : ye(this.name);
855
+ return this.avatarUrl ? "transparent" : ge(this.name);
856
856
  },
857
857
  initials() {
858
858
  return we(this.name);
@@ -862,7 +862,7 @@ const Q = /* @__PURE__ */ B(Ke, [["render", Xe], ["__scopeId", "data-v-8c924688"
862
862
  function et(t, e, n, a, r, s) {
863
863
  return l(), d("div", {
864
864
  class: "wm-huav",
865
- style: V({
865
+ style: G({
866
866
  width: n.size + "px",
867
867
  height: n.size + "px",
868
868
  "--wm-avr": Math.round(n.size * 0.32) + "px",
@@ -875,7 +875,7 @@ function et(t, e, n, a, r, s) {
875
875
  alt: n.name || ""
876
876
  }, null, 8, Ze)) : (l(), d("span", {
877
877
  key: 1,
878
- style: V({ fontSize: n.size * 0.36 + "px" })
878
+ style: G({ fontSize: n.size * 0.36 + "px" })
879
879
  }, b(s.initials), 5))
880
880
  ], 4);
881
881
  }
@@ -895,7 +895,7 @@ const ke = /* @__PURE__ */ B(Qe, [["render", et], ["__scopeId", "data-v-a772b179
895
895
  },
896
896
  methods: {
897
897
  colorFor(t) {
898
- return t.avatar_url ? "transparent" : ye(t.name || "");
898
+ return t.avatar_url ? "transparent" : ge(t.name || "");
899
899
  },
900
900
  initialsFor(t) {
901
901
  return we(t.name || "");
@@ -912,12 +912,12 @@ function at(t, e, n, a, r, s) {
912
912
  return s.visible ? (l(), d("div", nt, [
913
913
  i("div", {
914
914
  class: "wm-team__stack",
915
- style: V({ width: s.stackWidth + "px" })
915
+ style: G({ width: s.stackWidth + "px" })
916
916
  }, [
917
917
  (l(!0), d(M, null, j(n.members.slice(0, 3), (o, c) => (l(), d("div", {
918
918
  key: c,
919
919
  class: "wm-team__pill",
920
- style: V({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
920
+ style: G({ left: c * 13 + "px", zIndex: 3 - c, background: s.colorFor(o) })
921
921
  }, [
922
922
  o.avatar_url ? (l(), d("img", {
923
923
  key: 0,
@@ -931,7 +931,7 @@ function at(t, e, n, a, r, s) {
931
931
  }
932
932
  const ot = /* @__PURE__ */ B(tt, [["render", at], ["__scopeId", "data-v-3659b9c1"]]), lt = {
933
933
  name: "WmHeader",
934
- components: { AIAvatar: Q, HumanAvatar: ke, TeamAvatars: ot },
934
+ components: { AIAvatar: te, HumanAvatar: ke, TeamAvatars: ot },
935
935
  props: {
936
936
  title: { type: String, default: "Nouvelle conversation" },
937
937
  escalated: { type: Boolean, default: !1 },
@@ -968,12 +968,12 @@ const ot = /* @__PURE__ */ B(tt, [["render", at], ["__scopeId", "data-v-3659b9c1
968
968
  }, ut = { class: "wm-header__avatar" }, ht = { class: "wm-header__main" }, mt = { class: "wm-header__title" }, ft = {
969
969
  key: 0,
970
970
  class: "wm-header__sub"
971
- }, pt = { class: "wm-header__status" }, _t = {
971
+ }, _t = { class: "wm-header__status" }, pt = {
972
972
  key: 3,
973
973
  class: "wm-header__fill"
974
974
  }, vt = { class: "wm-header__actions" };
975
- function gt(t, e, n, a, r, s) {
976
- const o = O("HumanAvatar"), c = O("AIAvatar"), v = O("TeamAvatars");
975
+ function yt(t, e, n, a, r, s) {
976
+ const o = I("HumanAvatar"), c = I("AIAvatar"), v = I("TeamAvatars");
977
977
  return l(), d("div", ct, [
978
978
  n.showBack ? (l(), d("button", {
979
979
  key: 0,
@@ -998,12 +998,12 @@ function gt(t, e, n, a, r, s) {
998
998
  ])])) : (l(), d("div", dt)),
999
999
  n.showIdentity ? (l(), d(M, { key: 2 }, [
1000
1000
  i("div", ut, [
1001
- n.escalated ? (l(), R(o, {
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(), R(c, {
1006
+ }, null, 8, ["name", "avatar-url"])) : (l(), $(c, {
1007
1007
  key: 1,
1008
1008
  size: 34
1009
1009
  }))
@@ -1011,18 +1011,18 @@ function gt(t, e, n, a, r, s) {
1011
1011
  i("div", ht, [
1012
1012
  i("div", mt, b(n.title), 1),
1013
1013
  s.showPresence ? (l(), d("div", ft, [
1014
- s.hasTeam ? (l(), R(v, {
1014
+ s.hasTeam ? (l(), $(v, {
1015
1015
  key: 0,
1016
1016
  members: n.teamMembers,
1017
1017
  "response-label": n.responseLabel
1018
1018
  }, null, 8, ["members", "response-label"])) : w("", !0),
1019
- i("span", pt, [
1019
+ i("span", _t, [
1020
1020
  e[4] || (e[4] = i("span", { class: "wm-header__dot" }, null, -1)),
1021
- ie(" " + b(s.statusText), 1)
1021
+ oe(" " + b(s.statusText), 1)
1022
1022
  ])
1023
1023
  ])) : w("", !0)
1024
1024
  ])
1025
- ], 64)) : (l(), d("div", _t)),
1025
+ ], 64)) : (l(), d("div", pt)),
1026
1026
  i("div", vt, [
1027
1027
  n.showMore ? (l(), d("button", {
1028
1028
  key: 0,
@@ -1081,7 +1081,7 @@ function gt(t, e, n, a, r, s) {
1081
1081
  ])
1082
1082
  ]);
1083
1083
  }
1084
- const yt = /* @__PURE__ */ B(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9"]]), pe = {
1084
+ const gt = /* @__PURE__ */ B(lt, [["render", yt], ["__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",
@@ -1089,7 +1089,7 @@ const yt = /* @__PURE__ */ B(lt, [["render", gt], ["__scopeId", "data-v-b5f5f6a9
1089
1089
  link: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"
1090
1090
  }, wt = {
1091
1091
  name: "WmOnboarding",
1092
- components: { AIAvatar: Q },
1092
+ components: { AIAvatar: te },
1093
1093
  props: {
1094
1094
  welcomeMessage: { type: String, default: "" },
1095
1095
  agentName: { type: String, default: "" },
@@ -1109,16 +1109,16 @@ Je réponds en quelques secondes.`;
1109
1109
  },
1110
1110
  methods: {
1111
1111
  iconPath(t) {
1112
- return pe[t] || pe.link;
1112
+ return _e[t] || _e.link;
1113
1113
  }
1114
1114
  }
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" }, It = { class: "wm-onb__resume-title" }, Ot = { class: "wm-onb__resume-preview" }, Et = {
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" }, Et = {
1119
1119
  key: 1,
1120
1120
  class: "wm-onb__section"
1121
- }, Bt = { class: "wm-onb__links" }, Lt = ["onClick"], Rt = { class: "wm-onb__link-icon" }, $t = {
1121
+ }, Bt = { class: "wm-onb__links" }, Lt = ["onClick"], $t = { class: "wm-onb__link-icon" }, Rt = {
1122
1122
  width: "14",
1123
1123
  height: "14",
1124
1124
  viewBox: "0 0 24 24",
@@ -1130,10 +1130,10 @@ Je réponds en quelques secondes.`;
1130
1130
  "aria-hidden": "true"
1131
1131
  }, Ft = ["d"], jt = { class: "wm-onb__link-label" }, Ut = { class: "wm-onb__cta" }, Dt = ["disabled"];
1132
1132
  function Nt(t, e, n, a, r, s) {
1133
- const o = O("AIAvatar");
1133
+ const o = I("AIAvatar");
1134
1134
  return l(), d("div", bt, [
1135
1135
  i("div", kt, [
1136
- z(o, {
1136
+ K(o, {
1137
1137
  size: 56,
1138
1138
  pulse: !0
1139
1139
  }),
@@ -1169,8 +1169,8 @@ function Nt(t, e, n, a, r, s) {
1169
1169
  })
1170
1170
  ], -1)),
1171
1171
  i("span", Tt, [
1172
- i("span", It, b(c.title), 1),
1173
- i("span", Ot, b(c.preview), 1)
1172
+ i("span", Ot, b(c.title), 1),
1173
+ i("span", It, b(c.preview), 1)
1174
1174
  ]),
1175
1175
  e[2] || (e[2] = i("svg", {
1176
1176
  width: "13",
@@ -1198,8 +1198,8 @@ function Nt(t, e, n, a, r, s) {
1198
1198
  class: "wm-onb__link",
1199
1199
  onClick: (k) => t.$emit("select", c)
1200
1200
  }, [
1201
- i("span", Rt, [
1202
- (l(), d("svg", $t, [
1201
+ i("span", $t, [
1202
+ (l(), d("svg", Rt, [
1203
1203
  i("path", {
1204
1204
  d: s.iconPath(c.icon)
1205
1205
  }, null, 8, Ft)
@@ -1273,7 +1273,7 @@ const zt = {
1273
1273
  "stroke-width": "2.6",
1274
1274
  "stroke-linecap": "round",
1275
1275
  "stroke-linejoin": "round"
1276
- }, Gt = {
1276
+ }, Kt = {
1277
1277
  key: 2,
1278
1278
  width: "11",
1279
1279
  height: "11",
@@ -1283,7 +1283,7 @@ const zt = {
1283
1283
  "stroke-width": "2.4",
1284
1284
  "stroke-linecap": "round",
1285
1285
  "stroke-linejoin": "round"
1286
- }, Kt = {
1286
+ }, Gt = {
1287
1287
  key: 3,
1288
1288
  width: "12",
1289
1289
  height: "12",
@@ -1303,14 +1303,14 @@ function Xt(t, e, n, a, r, s) {
1303
1303
  i("path", { d: "M20 6L9 17l-5-5" }, null, -1)
1304
1304
  ])])) : n.state === "rejected" ? (l(), d("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", Gt, [...e[2] || (e[2] = [
1306
+ ])])) : n.state === "awaiting" ? (l(), d("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", Kt, [...e[3] || (e[3] = [
1313
+ ])])) : (l(), d("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",
@@ -1366,7 +1366,7 @@ function an(t, e, n, a, r, s) {
1366
1366
  }, [
1367
1367
  i("polyline", { points: "20 6 9 17 4 12" })
1368
1368
  ]),
1369
- ie(" Envoyé ")
1369
+ oe(" Envoyé ")
1370
1370
  ], -1))
1371
1371
  ]),
1372
1372
  i("div", sn, [
@@ -1400,17 +1400,17 @@ const on = /* @__PURE__ */ B(Zt, [["render", an], ["__scopeId", "data-v-812bda8b
1400
1400
  }, cn = { class: "wm-art wm-art--infoCard" }, dn = {
1401
1401
  key: 0,
1402
1402
  class: "wm-art__image"
1403
- }, un = ["src", "alt"], hn = { class: "wm-art__head" }, mn = { class: "wm-art__headMain" }, fn = { class: "wm-art__title" }, pn = {
1403
+ }, un = ["src", "alt"], hn = { class: "wm-art__head" }, mn = { class: "wm-art__headMain" }, fn = { class: "wm-art__title" }, _n = {
1404
1404
  key: 0,
1405
1405
  class: "wm-art__subtitle"
1406
- }, _n = {
1406
+ }, pn = {
1407
1407
  key: 1,
1408
1408
  class: "wm-art__body"
1409
1409
  }, vn = {
1410
1410
  key: 0,
1411
1411
  class: "wm-art__text"
1412
- }, gn = { class: "wm-art__fieldLabel" };
1413
- function yn(t, e, n, a, r, s) {
1412
+ }, yn = { class: "wm-art__fieldLabel" };
1413
+ function gn(t, e, n, a, r, s) {
1414
1414
  return l(), d("div", cn, [
1415
1415
  n.data.image_url ? (l(), d("figure", dn, [
1416
1416
  i("img", {
@@ -1422,20 +1422,20 @@ function yn(t, e, n, a, r, s) {
1422
1422
  i("div", hn, [
1423
1423
  i("div", mn, [
1424
1424
  i("div", fn, b(n.data.title), 1),
1425
- n.data.subtitle ? (l(), d("div", pn, b(n.data.subtitle), 1)) : w("", !0)
1425
+ n.data.subtitle ? (l(), d("div", _n, b(n.data.subtitle), 1)) : w("", !0)
1426
1426
  ]),
1427
1427
  n.data.badge && n.data.badge.label ? (l(), d("span", {
1428
1428
  key: 0,
1429
1429
  class: E(["wm-art__badge", `wm-art__badge--${n.data.badge.tone || "neutral"}`])
1430
1430
  }, b(n.data.badge.label), 3)) : w("", !0)
1431
1431
  ]),
1432
- s.hasBody ? (l(), d("div", _n, [
1432
+ s.hasBody ? (l(), d("div", pn, [
1433
1433
  n.data.body ? (l(), d("div", vn, b(n.data.body), 1)) : w("", !0),
1434
1434
  s.fields.length ? (l(!0), d(M, { key: 1 }, j(s.fields, (o, c) => (l(), d("div", {
1435
1435
  key: c,
1436
1436
  class: "wm-art__field"
1437
1437
  }, [
1438
- i("div", gn, b(o.label), 1),
1438
+ i("div", yn, b(o.label), 1),
1439
1439
  i("div", {
1440
1440
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1441
1441
  }, b(o.value), 3)
@@ -1443,7 +1443,7 @@ function yn(t, e, n, a, r, s) {
1443
1443
  ])) : w("", !0)
1444
1444
  ]);
1445
1445
  }
1446
- const wn = /* @__PURE__ */ B(ln, [["render", yn], ["__scopeId", "data-v-d7369333"]]);
1446
+ const wn = /* @__PURE__ */ B(ln, [["render", gn], ["__scopeId", "data-v-d7369333"]]);
1447
1447
  function bn(t) {
1448
1448
  if (!t) return "";
1449
1449
  const e = new Date(t);
@@ -1483,10 +1483,10 @@ const kn = {
1483
1483
  }, Cn = { class: "wm-art wm-art--ticket" }, An = { class: "wm-art__head wm-tk__head" }, Sn = { class: "wm-art__title wm-tk__title" }, xn = { class: "wm-tk__sub" }, Mn = { class: "wm-tk__ref" }, Tn = {
1484
1484
  key: 0,
1485
1485
  class: "wm-tk__text"
1486
- }, In = {
1486
+ }, On = {
1487
1487
  key: 0,
1488
1488
  class: "wm-art__body"
1489
- }, On = { class: "wm-art__fieldLabel" }, En = ["data-level"], Bn = {
1489
+ }, In = { class: "wm-art__fieldLabel" }, En = ["data-level"], Bn = {
1490
1490
  key: 1,
1491
1491
  class: "wm-art__footer wm-tk__footer"
1492
1492
  };
@@ -1519,17 +1519,17 @@ function Ln(t, e, n, a, r, s) {
1519
1519
  class: "wm-tk__dot",
1520
1520
  "aria-hidden": "true"
1521
1521
  }, null, -1)),
1522
- ie(" " + b(n.data.status.label), 1)
1522
+ oe(" " + b(n.data.status.label), 1)
1523
1523
  ], 2)
1524
1524
  ]),
1525
1525
  n.data.body ? (l(), d("div", Tn, b(n.data.body), 1)) : w("", !0)
1526
1526
  ]),
1527
- s.fields.length ? (l(), d("div", In, [
1527
+ s.fields.length ? (l(), d("div", On, [
1528
1528
  (l(!0), d(M, null, j(s.fields, (o, c) => (l(), d("div", {
1529
1529
  key: c,
1530
1530
  class: "wm-art__field"
1531
1531
  }, [
1532
- i("div", On, b(o.label), 1),
1532
+ i("div", In, b(o.label), 1),
1533
1533
  i("div", {
1534
1534
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1535
1535
  }, [
@@ -1593,10 +1593,10 @@ function Ln(t, e, n, a, r, s) {
1593
1593
  ])) : w("", !0)
1594
1594
  ]);
1595
1595
  }
1596
- const Rn = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0"]]), $n = {
1596
+ const $n = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0"]]), Rn = {
1597
1597
  form_response: on,
1598
1598
  info_card: wn,
1599
- ticket: Rn
1599
+ ticket: $n
1600
1600
  }, Fn = {
1601
1601
  name: "WmArtifactRenderer",
1602
1602
  props: {
@@ -1608,12 +1608,12 @@ const Rn = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0
1608
1608
  component() {
1609
1609
  var e;
1610
1610
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1611
- return t && $n[t] || null;
1611
+ return t && Rn[t] || null;
1612
1612
  }
1613
1613
  }
1614
1614
  };
1615
1615
  function jn(t, e, n, a, r, s) {
1616
- return s.component ? (l(), R(Me(s.component), {
1616
+ return s.component ? (l(), $(Me(s.component), {
1617
1617
  key: 0,
1618
1618
  data: n.artifact.data
1619
1619
  }, null, 8, ["data"])) : w("", !0);
@@ -1672,10 +1672,10 @@ const Un = /* @__PURE__ */ B(Fn, [["render", jn]]), Dn = {
1672
1672
  this.url || t.preventDefault();
1673
1673
  }
1674
1674
  }
1675
- }, Nn = ["href"], Pn = ["src", "alt"], Hn = ["src"], zn = ["src"], Vn = ["href", "download"], qn = { class: "wm-att__main" }, Wn = { class: "wm-att__name" }, Gn = {
1675
+ }, Nn = ["href"], Pn = ["src", "alt"], Hn = ["src"], zn = ["src"], Vn = ["href", "download"], qn = { class: "wm-att__main" }, Wn = { class: "wm-att__name" }, Kn = {
1676
1676
  key: 0,
1677
1677
  class: "wm-att__meta"
1678
- }, Kn = {
1678
+ }, Gn = {
1679
1679
  key: 0,
1680
1680
  class: "wm-att__spin",
1681
1681
  "aria-hidden": "true"
@@ -1733,9 +1733,9 @@ function Yn(t, e, n, a, r, s) {
1733
1733
  ], -1)),
1734
1734
  i("span", qn, [
1735
1735
  i("span", Wn, b(s.displayName), 1),
1736
- s.sizeLabel ? (l(), d("span", Gn, b(s.sizeLabel), 1)) : w("", !0)
1736
+ s.sizeLabel ? (l(), d("span", Kn, b(s.sizeLabel), 1)) : w("", !0)
1737
1737
  ]),
1738
- r.loading ? (l(), d("span", Kn)) : w("", !0)
1738
+ r.loading ? (l(), d("span", Gn)) : w("", !0)
1739
1739
  ], 8, Vn))
1740
1740
  ], 2);
1741
1741
  }
@@ -1746,13 +1746,13 @@ function Xn(t) {
1746
1746
  function Qn(t) {
1747
1747
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1748
1748
  }
1749
- const _e = "";
1750
- function te(t) {
1749
+ const pe = "";
1750
+ function re(t) {
1751
1751
  let e = t;
1752
1752
  const n = [];
1753
1753
  return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1754
1754
  const s = n.length;
1755
- return n.push(r), `${_e}CODE${s}${_e}`;
1755
+ return n.push(r), `${pe}CODE${s}${pe}`;
1756
1756
  }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Qn(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>` : r), e = e.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), e = e.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), e = e.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), e = e.replace(/CODE(\d+)/g, (a, r) => `<code class="wm-md-code">${n[+r]}</code>`), e;
1757
1757
  }
1758
1758
  function Zn(t) {
@@ -1781,20 +1781,20 @@ function Zn(t) {
1781
1781
  if (!S) break;
1782
1782
  k.push(S[1]), a++;
1783
1783
  }
1784
- const y = k.map((S) => `<li>${te(S)}</li>`).join("");
1785
- n.push({ type: "block", html: `<ul class="wm-md-ul">${y}</ul>` });
1784
+ const g = k.map((S) => `<li>${re(S)}</li>`).join("");
1785
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${g}</ul>` });
1786
1786
  continue;
1787
1787
  }
1788
1788
  const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1789
1789
  if (c) {
1790
- const k = parseInt(c[1], 10), y = [c[2]];
1790
+ const k = parseInt(c[1], 10), g = [c[2]];
1791
1791
  for (a++; a < e.length; ) {
1792
1792
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1793
1793
  if (!A) break;
1794
- y.push(A[1]), a++;
1794
+ g.push(A[1]), a++;
1795
1795
  }
1796
- const S = y.map((A) => `<li>${te(A)}</li>`).join(""), $ = k !== 1 ? ` start="${k}"` : "";
1797
- n.push({ type: "block", html: `<ol class="wm-md-ol"${$}>${S}</ol>` });
1796
+ const S = g.map((A) => `<li>${re(A)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
1797
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${S}</ol>` });
1798
1798
  continue;
1799
1799
  }
1800
1800
  const v = /^(#{1,6})\s+(.*)$/.exec(s);
@@ -1802,11 +1802,11 @@ function Zn(t) {
1802
1802
  const k = v[1].length;
1803
1803
  n.push({
1804
1804
  type: "block",
1805
- html: `<h${k} class="wm-md-h wm-md-h${k}">${te(v[2])}</h${k}>`
1805
+ html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
1806
1806
  }), a++;
1807
1807
  continue;
1808
1808
  }
1809
- n.push({ type: "text", html: te(s) }), a++;
1809
+ n.push({ type: "text", html: re(s) }), a++;
1810
1810
  }
1811
1811
  let r = "";
1812
1812
  for (let s = 0; s < n.length; s++) {
@@ -1849,7 +1849,7 @@ function as(t, e, n, a, r, s) {
1849
1849
  ])]);
1850
1850
  }
1851
1851
  const os = /* @__PURE__ */ B(rs, [["render", as], ["__scopeId", "data-v-df2447fd"]]);
1852
- function ne(t) {
1852
+ function Z(t) {
1853
1853
  return t ? t.client_msg_id || t.id : "";
1854
1854
  }
1855
1855
  const ls = {
@@ -1861,7 +1861,7 @@ const ls = {
1861
1861
  idle: "Conversation en pause"
1862
1862
  }, cs = 80, ds = 200, us = {
1863
1863
  name: "WmMessageList",
1864
- components: { AIAvatar: Q, HumanAvatar: ke, Bubble: ss, Typing: os, ActionResult: Qt, AttachmentPreview: Jn, ArtifactRenderer: Un },
1864
+ components: { AIAvatar: te, HumanAvatar: ke, Bubble: ss, Typing: os, ActionResult: Qt, AttachmentPreview: Jn, ArtifactRenderer: Un },
1865
1865
  props: {
1866
1866
  messages: { type: Array, default: () => [] },
1867
1867
  streamingActive: { type: Boolean, default: !1 },
@@ -1886,7 +1886,14 @@ const ls = {
1886
1886
  // window after, suppressing the per-row fade-up animation so
1887
1887
  // a freshly prepended history page doesn't visibly flicker
1888
1888
  // in 50-at-once.
1889
- silentFades: !1
1889
+ silentFades: !1,
1890
+ // Largeur rendue (px) de la moitié visible de chaque item
1891
+ // d'un cluster, indexée par `${messageKey}-${partKey}`.
1892
+ // Alimentée post-render par `measureRows()` et consommée
1893
+ // par `cornersFor()` pour décider du rétractement des coins
1894
+ // intérieurs. Avant la première mesure, `cornersFor` retombe
1895
+ // sur la convention kind-based (`card` > `bubble`).
1896
+ widthByKey: Object.freeze({})
1890
1897
  };
1891
1898
  },
1892
1899
  computed: {
@@ -1902,7 +1909,7 @@ const ls = {
1902
1909
  if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
1903
1910
  const k = t[t.length - 1];
1904
1911
  k && k.role === "ai" ? k.messages.push(s) : t.push({
1905
- key: `g-${ne(s)}`,
1912
+ key: `g-${Z(s)}`,
1906
1913
  role: "ai",
1907
1914
  agentName: "",
1908
1915
  agentAvatarUrl: null,
@@ -1912,7 +1919,7 @@ const ls = {
1912
1919
  continue;
1913
1920
  }
1914
1921
  t.push({
1915
- key: `sys-${ne(s)}`,
1922
+ key: `sys-${Z(s)}`,
1916
1923
  role: o,
1917
1924
  messages: [s],
1918
1925
  items: [],
@@ -1922,7 +1929,7 @@ const ls = {
1922
1929
  }
1923
1930
  const c = t[t.length - 1];
1924
1931
  c && c.role === o && (o === "ai" || c.agentName === (((n = s == null ? void 0 : s.author) == null ? void 0 : n.name) || "")) ? c.messages.push(s) : t.push({
1925
- key: `g-${ne(s)}`,
1932
+ key: `g-${Z(s)}`,
1926
1933
  role: o,
1927
1934
  agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
1928
1935
  agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
@@ -1963,10 +1970,17 @@ const ls = {
1963
1970
  streamingActive: "snapshotAndRestore"
1964
1971
  },
1965
1972
  mounted() {
1966
- this._lastSeenConvId = this.conversationId, this.scrollToBottom();
1973
+ this._lastSeenConvId = this.conversationId, this.scrollToBottom(), this._measureFrame = null, this._ro = new ResizeObserver(() => this.scheduleMeasure()), this.$refs.scrollEl && this._ro.observe(this.$refs.scrollEl), this.$nextTick(() => this.measureRows());
1974
+ },
1975
+ beforeUnmount() {
1976
+ var t;
1977
+ (t = this._ro) == null || t.disconnect(), this._measureFrame && cancelAnimationFrame(this._measureFrame), clearTimeout(this._silenceTimer);
1978
+ },
1979
+ updated() {
1980
+ this.scheduleMeasure();
1967
1981
  },
1968
1982
  methods: {
1969
- messageKey: ne,
1983
+ messageKey: Z,
1970
1984
  isAtBottom(t) {
1971
1985
  return t.scrollHeight - t.scrollTop - t.clientHeight <= cs;
1972
1986
  },
@@ -2131,25 +2145,26 @@ const ls = {
2131
2145
  // toujours SM ; seul le coin haut extérieur du premier item
2132
2146
  // reste LG.
2133
2147
  //
2134
- // Côté INTÉRIEUR (opposé avatar) — width-based, asymétrique :
2135
- // · coin haut SM si `prev.bottom` est strictement plus large
2148
+ // Côté INTÉRIEUR (opposé avatar) — width-based :
2149
+ // · coin haut SM si `prev.bottom` est *au moins aussi large*
2136
2150
  // que `me.top` ;
2137
- // · coin bas SM si `next.top` est strictement plus large
2138
- // que `me.bottom`.
2151
+ // · coin bas SM si `next.top` est *au moins aussi large* que
2152
+ // `me.bottom`.
2139
2153
  // On compare *moitiés* : ma moitié haute (`me.top`) vs ce que
2140
2154
  // le voisin du dessus me présente (`prev.bottom`), et
2141
- // symétriquement en bas. La comparaison de largeur est
2142
- // `card > bubble`, asymétrique : à un joint `card↔bubble`,
2143
- // seule la bubble voit son coin intérieur rétracté (un coin
2144
- // rond rentré sous un voisin plus large semblerait flotter).
2145
- // Aux joints même-kind (bubble↔bubble, card↔card), aucun coin
2146
- // intérieur n'est rétracté : on n'extrapole pas la largeur
2147
- // réelle, qui est content-driven.
2155
+ // symétriquement en bas. Convention de largeur : `card` >
2156
+ // `bubble`. L'égalité (bubble↔bubble, card↔card) compte comme
2157
+ // "au moins aussi large" et déclenche le SM sinon deux coins
2158
+ // intérieurs ronds se feraient face et paraîtraient flotter.
2159
+ // Le seul cas le coin intérieur reste LG, c'est quand je
2160
+ // suis strictement plus large que mon voisin (un `card`
2161
+ // adjacent à une `bubble`) : mon coin déborde le voisin et
2162
+ // doit garder son arrondi.
2148
2163
  cornersFor(t, e) {
2149
- var N, F, P;
2150
- const n = t.items, a = (N = n[e]) == null ? void 0 : N.kind, r = (F = n[e - 1]) == null ? void 0 : F.kind, s = (P = n[e + 1]) == null ? void 0 : P.kind, o = t.role === "user", c = 14, v = 4, k = r == null ? void 0 : r.bottom, y = s == null ? void 0 : s.top, S = (q, Y) => q === "card" && Y === "bubble";
2151
- let $ = c, A = c, D = c, x = c;
2152
- return o ? (k && (A = v), (y || !s) && (D = v), k && S(k, a == null ? void 0 : a.top) && ($ = v), y && S(y, a == null ? void 0 : a.bottom) && (x = v)) : (k && ($ = v), (y || !s) && (x = v), k && S(k, a == null ? void 0 : a.top) && (A = v), y && S(y, a == null ? void 0 : a.bottom) && (D = v)), { tl: $, tr: A, br: D, bl: x };
2164
+ var Y, H, J;
2165
+ 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, g = 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";
2166
+ let D = c, F = c, N = c, V = c;
2167
+ return o ? (k && (F = v), (g || !s) && (N = v), k && x(R, k, a == null ? void 0 : a.top) && (D = v), g && x(A, g, a == null ? void 0 : a.bottom) && (V = v)) : (k && (D = v), (g || !s) && (V = v), k && x(R, k, a == null ? void 0 : a.top) && (F = v), g && x(A, g, a == null ? void 0 : a.bottom) && (N = v)), { tl: D, tr: F, br: N, bl: V };
2153
2168
  },
2154
2169
  // Inline style emitting the four corner CSS variables. Set on
2155
2170
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2165,6 +2180,48 @@ const ls = {
2165
2180
  "--wm-r-bl": `${n.bl}px`
2166
2181
  };
2167
2182
  },
2183
+ // Clé unique par item de cluster, alignée avec `:key` /
2184
+ // `data-row-key` du template. Sert d'index dans `widthByKey`.
2185
+ rowKeyOf(t, e) {
2186
+ var a;
2187
+ const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
2188
+ return n ? `${Z(n.message)}-${n.partKey}` : "";
2189
+ },
2190
+ // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
2191
+ // typing, scroll), un seul flush layout par frame suffit.
2192
+ scheduleMeasure() {
2193
+ this._measureFrame || (this._measureFrame = requestAnimationFrame(() => {
2194
+ this._measureFrame = null, this.measureRows();
2195
+ }));
2196
+ },
2197
+ // Mesure la largeur RENDUE de la moitié visible de chaque row,
2198
+ // l'écrit dans `widthByKey`. Vue ré-évalue alors `cornersFor`
2199
+ // sur les rows impactées. Shallow-diff strict (tolérance 0.5px
2200
+ // sub-pixel) pour ne pas relancer `updated()` à vide.
2201
+ measureRows() {
2202
+ const t = this.$refs.scrollEl;
2203
+ if (!t) return;
2204
+ const e = {};
2205
+ for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
2206
+ const o = s.dataset.rowKey;
2207
+ if (!o) continue;
2208
+ const c = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2209
+ if (!c) continue;
2210
+ const v = c.getBoundingClientRect().width;
2211
+ v > 0 && (e[o] = v);
2212
+ }
2213
+ const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
2214
+ if (a.length === r.length) {
2215
+ let s = !0;
2216
+ for (const o of r)
2217
+ if (Math.abs((n[o] ?? 0) - e[o]) > 0.5) {
2218
+ s = !1;
2219
+ break;
2220
+ }
2221
+ if (s) return;
2222
+ }
2223
+ this.widthByKey = Object.freeze(e);
2224
+ },
2168
2225
  lastTimeOf(t) {
2169
2226
  const e = t.messages[t.messages.length - 1];
2170
2227
  if (!(e != null && e.created_at)) return "";
@@ -2223,27 +2280,27 @@ const ls = {
2223
2280
  }, fs = {
2224
2281
  key: 2,
2225
2282
  class: "wm-list__sep"
2226
- }, ps = { class: "wm-list__sep-label" }, _s = {
2283
+ }, _s = { class: "wm-list__sep-label" }, ps = {
2227
2284
  key: 0,
2228
2285
  class: "wm-list__sep wm-list__sep--unread"
2229
2286
  }, vs = {
2230
2287
  key: 0,
2231
2288
  class: "wm-list__sysep"
2232
- }, gs = { class: "wm-list__sysep-label" }, ys = {
2289
+ }, ys = { class: "wm-list__sysep-label" }, gs = ["data-row-key"], ws = {
2233
2290
  key: 0,
2234
2291
  class: "wm-list__avatarSlot"
2235
- }, ws = {
2292
+ }, bs = {
2236
2293
  key: 5,
2237
2294
  class: "wm-list__body"
2238
- }, bs = { key: 0 }, ks = {
2295
+ }, ks = { key: 0 }, Cs = {
2239
2296
  key: 1,
2240
2297
  "aria-hidden": "true"
2241
- }, Cs = { key: 2 }, As = {
2298
+ }, As = { key: 2 }, Ss = {
2242
2299
  key: 3,
2243
2300
  class: "wm-list__row wm-list__row--ai fade-up"
2244
- }, Ss = { class: "wm-list__avatarSlot" };
2245
- function xs(t, e, n, a, r, s) {
2246
- const o = O("AIAvatar"), c = O("HumanAvatar"), v = O("ActionResult"), k = O("ArtifactRenderer"), y = O("Bubble"), S = O("AttachmentPreview"), $ = O("Typing");
2301
+ }, xs = { class: "wm-list__avatarSlot" };
2302
+ function Ms(t, e, n, a, r, s) {
2303
+ const o = I("AIAvatar"), c = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), g = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
2247
2304
  return l(), d("div", {
2248
2305
  ref: "scrollEl",
2249
2306
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
@@ -2258,13 +2315,13 @@ function xs(t, e, n, a, r, s) {
2258
2315
  ])])) : s.historyExhausted ? (l(), d("div", ms, "Début de la conversation")) : w("", !0),
2259
2316
  n.dateLabel ? (l(), d("div", fs, [
2260
2317
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2261
- i("span", ps, b(n.dateLabel), 1),
2318
+ i("span", _s, b(n.dateLabel), 1),
2262
2319
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2263
2320
  ])) : w("", !0),
2264
- (l(!0), d(M, null, j(s.groups, (A, D) => (l(), d(M, {
2321
+ (l(!0), d(M, null, j(s.groups, (A, P) => (l(), d(M, {
2265
2322
  key: A.key
2266
2323
  }, [
2267
- A.key === s.unreadGroupKey ? (l(), d("div", _s, [...e[4] || (e[4] = [
2324
+ A.key === s.unreadGroupKey ? (l(), d("div", ps, [...e[4] || (e[4] = [
2268
2325
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2269
2326
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2270
2327
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
@@ -2274,21 +2331,22 @@ function xs(t, e, n, a, r, s) {
2274
2331
  }, [
2275
2332
  A.role === "system" ? (l(), d("div", vs, [
2276
2333
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2277
- i("span", gs, b(A.systemLabel), 1),
2334
+ i("span", ys, b(A.systemLabel), 1),
2278
2335
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2279
2336
  ])) : (l(), d(M, { key: 1 }, [
2280
- (l(!0), d(M, null, j(A.items, (x, N) => (l(), d("div", {
2337
+ (l(!0), d(M, null, j(A.items, (x, D) => (l(), d("div", {
2281
2338
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2339
+ "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2282
2340
  class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2283
- style: V(s.cornersStyle(A, N))
2341
+ style: G(s.cornersStyle(A, D))
2284
2342
  }, [
2285
- A.role !== "user" ? (l(), d("div", ys, [
2286
- N === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2287
- A.role === "ai" ? (l(), R(o, {
2343
+ A.role !== "user" ? (l(), d("div", ws, [
2344
+ D === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2345
+ A.role === "ai" ? (l(), $(o, {
2288
2346
  key: 0,
2289
2347
  size: 26,
2290
2348
  tail: !0
2291
- })) : (l(), R(c, {
2349
+ })) : (l(), $(c, {
2292
2350
  key: 1,
2293
2351
  name: A.agentName,
2294
2352
  "avatar-url": A.agentAvatarUrl,
@@ -2296,24 +2354,24 @@ function xs(t, e, n, a, r, s) {
2296
2354
  }, null, 8, ["name", "avatar-url"]))
2297
2355
  ], 64)) : w("", !0)
2298
2356
  ])) : w("", !0),
2299
- x.renderAs === "action" ? (l(), R(v, {
2357
+ x.renderAs === "action" ? (l(), $(v, {
2300
2358
  key: 1,
2301
2359
  state: x.message.payload.state,
2302
2360
  label: s.actionLabel(x.message),
2303
2361
  detail: s.actionDetail(x.message)
2304
- }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), R(v, {
2362
+ }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), $(v, {
2305
2363
  key: 2,
2306
2364
  state: "awaiting",
2307
2365
  label: "Demande d'approbation envoyée",
2308
2366
  detail: x.message.text_md || ""
2309
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), R(k, {
2367
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), $(k, {
2310
2368
  key: 3,
2311
2369
  artifact: s.actionArtifact(x.message)
2312
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), R(k, {
2370
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
2313
2371
  key: 4,
2314
2372
  artifact: s.artifactOf(x.message)
2315
- }, null, 8, ["artifact"])) : (l(), d("div", ws, [
2316
- x.message.text_md ? (l(), R(y, {
2373
+ }, null, 8, ["artifact"])) : (l(), d("div", bs, [
2374
+ x.message.text_md ? (l(), $(g, {
2317
2375
  key: 0,
2318
2376
  role: A.role,
2319
2377
  text: x.message.text_md
@@ -2322,37 +2380,37 @@ function xs(t, e, n, a, r, s) {
2322
2380
  key: 1,
2323
2381
  class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2324
2382
  }, [
2325
- (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, P) => (l(), R(S, {
2326
- key: `${s.messageKey(x.message)}-att-${P}`,
2383
+ (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, N) => (l(), $(S, {
2384
+ key: `${s.messageKey(x.message)}-att-${N}`,
2327
2385
  attachment: F
2328
2386
  }, null, 8, ["attachment"]))), 128))
2329
2387
  ], 2)) : w("", !0)
2330
2388
  ]))
2331
- ], 6))), 128)),
2389
+ ], 14, gs))), 128)),
2332
2390
  A.role !== "user" || s.lastTimeOf(A) ? (l(), d("div", {
2333
2391
  key: 0,
2334
2392
  class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2335
2393
  }, [
2336
- A.role !== "user" ? (l(), d("span", bs, b(s.roleLabel(A)), 1)) : w("", !0),
2337
- A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", ks, "·")) : w("", !0),
2338
- s.lastTimeOf(A) ? (l(), d("span", Cs, b(s.lastTimeOf(A)), 1)) : w("", !0)
2394
+ A.role !== "user" ? (l(), d("span", ks, b(s.roleLabel(A)), 1)) : w("", !0),
2395
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", Cs, "·")) : w("", !0),
2396
+ s.lastTimeOf(A) ? (l(), d("span", As, b(s.lastTimeOf(A)), 1)) : w("", !0)
2339
2397
  ], 2)) : w("", !0)
2340
2398
  ], 64))
2341
2399
  ], 2)
2342
2400
  ], 64))), 128)),
2343
- n.streamingActive ? (l(), d("div", As, [
2344
- i("div", Ss, [
2345
- z(o, {
2401
+ n.streamingActive ? (l(), d("div", Ss, [
2402
+ i("div", xs, [
2403
+ K(o, {
2346
2404
  size: 26,
2347
2405
  tail: !0
2348
2406
  })
2349
2407
  ]),
2350
- z($)
2408
+ K(R)
2351
2409
  ])) : w("", !0)
2352
2410
  ], 34);
2353
2411
  }
2354
- const Ms = /* @__PURE__ */ B(us, [["render", xs], ["__scopeId", "data-v-0e60114e"]]), se = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2355
- function Ts() {
2412
+ const Ts = /* @__PURE__ */ B(us, [["render", Ms], ["__scopeId", "data-v-3955655c"]]), ie = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2413
+ function Os() {
2356
2414
  return he && [
2357
2415
  "video/webm;codecs=vp9,opus",
2358
2416
  "video/webm;codecs=vp8,opus",
@@ -2372,11 +2430,11 @@ function Ce({ audio: t }) {
2372
2430
  systemAudio: t ? "include" : "exclude"
2373
2431
  };
2374
2432
  }
2375
- function Ni(t) {
2433
+ function Pi(t) {
2376
2434
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2377
2435
  }
2378
2436
  async function Is() {
2379
- if (!se) return null;
2437
+ if (!ie) return null;
2380
2438
  let t;
2381
2439
  try {
2382
2440
  t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
@@ -2384,7 +2442,7 @@ async function Is() {
2384
2442
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2385
2443
  }
2386
2444
  try {
2387
- return await Os(t);
2445
+ return await Es(t);
2388
2446
  } catch (e) {
2389
2447
  return console.error("[media] screenshot capture", e), null;
2390
2448
  } finally {
@@ -2393,7 +2451,7 @@ async function Is() {
2393
2451
  });
2394
2452
  }
2395
2453
  }
2396
- async function Os(t) {
2454
+ async function Es(t) {
2397
2455
  const e = document.createElement("video");
2398
2456
  e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((c) => requestAnimationFrame(c));
2399
2457
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
@@ -2403,60 +2461,60 @@ async function Os(t) {
2403
2461
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2404
2462
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2405
2463
  }
2406
- async function Es(t = {}) {
2464
+ async function Bs(t = {}) {
2407
2465
  var k;
2408
- if (!se || !he) return null;
2466
+ if (!ie || !he) return null;
2409
2467
  let e;
2410
2468
  try {
2411
2469
  e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2412
- } catch (y) {
2413
- return (y == null ? void 0 : y.name) !== "NotAllowedError" && console.error("[media] record picker", y), null;
2470
+ } catch (g) {
2471
+ return (g == null ? void 0 : g.name) !== "NotAllowedError" && console.error("[media] record picker", g), null;
2414
2472
  }
2415
- const n = Ts();
2473
+ const n = Os();
2416
2474
  let a;
2417
2475
  try {
2418
2476
  a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2419
- } catch (y) {
2420
- return console.error("[media] recorder init", y), e.getTracks().forEach((S) => {
2477
+ } catch (g) {
2478
+ return console.error("[media] recorder init", g), e.getTracks().forEach((S) => {
2421
2479
  S.stop();
2422
2480
  }), null;
2423
2481
  }
2424
2482
  const r = [];
2425
2483
  let s = null, o = !1;
2426
- a.addEventListener("dataavailable", (y) => {
2427
- y.data && y.data.size > 0 && r.push(y.data);
2484
+ a.addEventListener("dataavailable", (g) => {
2485
+ g.data && g.data.size > 0 && r.push(g.data);
2428
2486
  }), a.addEventListener("stop", () => {
2429
- var y, S;
2430
- if (s && clearInterval(s), e.getTracks().forEach(($) => {
2431
- $.stop();
2487
+ var g, S;
2488
+ if (s && clearInterval(s), e.getTracks().forEach((R) => {
2489
+ R.stop();
2432
2490
  }), r.length) {
2433
- const $ = a.mimeType || n || "video/webm", A = new Blob(r, { type: $ }), D = /mp4/.test($) ? "mp4" : "webm", x = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${x}.${D}`, { type: $ });
2434
- (y = t.onfinalize) == null || y.call(t, N);
2491
+ 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), D = new File([A], `ecran-${x}.${P}`, { type: R });
2492
+ (g = t.onfinalize) == null || g.call(t, D);
2435
2493
  } else
2436
2494
  (S = t.oncancel) == null || S.call(t);
2437
- }), e.getVideoTracks().forEach((y) => {
2438
- y.addEventListener("ended", () => c(), { once: !0 });
2495
+ }), e.getVideoTracks().forEach((g) => {
2496
+ g.addEventListener("ended", () => c(), { once: !0 });
2439
2497
  });
2440
2498
  function c() {
2441
2499
  if (!o && (o = !0, a.state !== "inactive"))
2442
2500
  try {
2443
2501
  a.stop();
2444
- } catch (y) {
2445
- console.error("[media] recorder stop", y);
2502
+ } catch (g) {
2503
+ console.error("[media] recorder stop", g);
2446
2504
  }
2447
2505
  }
2448
2506
  try {
2449
2507
  a.start(1e3);
2450
- } catch (y) {
2451
- return console.error("[media] recorder start", y), e.getTracks().forEach((S) => {
2508
+ } catch (g) {
2509
+ return console.error("[media] recorder start", g), e.getTracks().forEach((S) => {
2452
2510
  S.stop();
2453
2511
  }), null;
2454
2512
  }
2455
2513
  (k = t.onstart) == null || k.call(t);
2456
2514
  const v = Date.now();
2457
2515
  return s = setInterval(() => {
2458
- var y;
2459
- (y = t.ontick) == null || y.call(t, Date.now() - v);
2516
+ var g;
2517
+ (g = t.ontick) == null || g.call(t, Date.now() - v);
2460
2518
  }, 500), {
2461
2519
  stop: c,
2462
2520
  get state() {
@@ -2464,7 +2522,7 @@ async function Es(t = {}) {
2464
2522
  }
2465
2523
  };
2466
2524
  }
2467
- const Bs = [
2525
+ const Ls = [
2468
2526
  {
2469
2527
  action: "file",
2470
2528
  label: "Joindre un fichier",
@@ -2480,7 +2538,7 @@ const Bs = [
2480
2538
  label: "Enregistrer l'écran",
2481
2539
  path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
2482
2540
  }
2483
- ], Ls = {
2541
+ ], $s = {
2484
2542
  name: "WmComposer",
2485
2543
  props: {
2486
2544
  modelValue: { type: String, default: "" },
@@ -2503,9 +2561,9 @@ const Bs = [
2503
2561
  return !this.disabled && !!this.local.trim();
2504
2562
  },
2505
2563
  attachItems() {
2506
- return Bs.map((t) => ({
2564
+ return Ls.map((t) => ({
2507
2565
  ...t,
2508
- disabled: t.action === "screenshot" && !se || t.action === "record" && (!se || !he)
2566
+ disabled: t.action === "screenshot" && !ie || t.action === "record" && (!ie || !he)
2509
2567
  }));
2510
2568
  },
2511
2569
  recordingElapsedLabel() {
@@ -2581,7 +2639,7 @@ const Bs = [
2581
2639
  async startRecording() {
2582
2640
  if (this.recording || this.disabled) return;
2583
2641
  this.recordingElapsed = 0;
2584
- const t = await Es({
2642
+ const t = await Bs({
2585
2643
  onstart: () => {
2586
2644
  this.recording = !0;
2587
2645
  },
@@ -2606,27 +2664,27 @@ const Bs = [
2606
2664
  }
2607
2665
  }
2608
2666
  }
2609
- }, Rs = { class: "wm-compose-wrap" }, $s = {
2667
+ }, Rs = { class: "wm-compose-wrap" }, Fs = {
2610
2668
  key: 0,
2611
2669
  class: "wm-rec"
2612
- }, Fs = { class: "wm-rec__lbl" }, js = {
2670
+ }, js = { class: "wm-rec__lbl" }, Us = {
2613
2671
  key: 1,
2614
2672
  class: "wm-compose__menu",
2615
2673
  role: "menu"
2616
- }, Us = ["disabled", "onClick"], Ds = { class: "wm-compose__menuIcon" }, Ns = {
2674
+ }, Ds = ["disabled", "onClick"], Ns = { class: "wm-compose__menuIcon" }, Ps = {
2617
2675
  viewBox: "0 0 24 24",
2618
2676
  width: "14",
2619
2677
  height: "14",
2620
2678
  "aria-hidden": "true"
2621
- }, Ps = ["d"], Hs = ["placeholder", "disabled"], zs = { class: "wm-compose__actions" }, Vs = ["title", "aria-label", "disabled"], qs = ["disabled"];
2622
- function Ws(t, e, n, a, r, s) {
2679
+ }, Hs = ["d"], zs = ["placeholder", "disabled"], Vs = { class: "wm-compose__actions" }, qs = ["title", "aria-label", "disabled"], Ws = ["disabled"];
2680
+ function Ks(t, e, n, a, r, s) {
2623
2681
  return l(), d("div", Rs, [
2624
- r.recording ? (l(), d("div", $s, [
2682
+ r.recording ? (l(), d("div", Fs, [
2625
2683
  e[8] || (e[8] = i("span", {
2626
2684
  class: "wm-rec__dot",
2627
2685
  "aria-hidden": "true"
2628
2686
  }, null, -1)),
2629
- i("span", Fs, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2687
+ i("span", js, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2630
2688
  i("button", {
2631
2689
  type: "button",
2632
2690
  class: "wm-rec__stop",
@@ -2635,7 +2693,7 @@ function Ws(t, e, n, a, r, s) {
2635
2693
  ])) : w("", !0),
2636
2694
  i("form", {
2637
2695
  class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2638
- onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2696
+ onSubmit: e[7] || (e[7] = ee((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2639
2697
  }, [
2640
2698
  i("input", {
2641
2699
  ref: "fileEl",
@@ -2649,7 +2707,7 @@ function Ws(t, e, n, a, r, s) {
2649
2707
  class: "wm-compose__overlay",
2650
2708
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2651
2709
  })) : w("", !0),
2652
- r.attachOpen ? (l(), d("div", js, [
2710
+ r.attachOpen ? (l(), d("div", Us, [
2653
2711
  (l(!0), d(M, null, j(s.attachItems, (o) => (l(), d("button", {
2654
2712
  key: o.action,
2655
2713
  type: "button",
@@ -2657,8 +2715,8 @@ function Ws(t, e, n, a, r, s) {
2657
2715
  disabled: o.disabled,
2658
2716
  onClick: (c) => s.onAttachAction(o.action)
2659
2717
  }, [
2660
- i("span", Ds, [
2661
- (l(), d("svg", Ns, [
2718
+ i("span", Ns, [
2719
+ (l(), d("svg", Ps, [
2662
2720
  i("path", {
2663
2721
  d: o.path,
2664
2722
  stroke: "currentColor",
@@ -2666,13 +2724,13 @@ function Ws(t, e, n, a, r, s) {
2666
2724
  "stroke-linecap": "round",
2667
2725
  "stroke-linejoin": "round",
2668
2726
  fill: "none"
2669
- }, null, 8, Ps)
2727
+ }, null, 8, Hs)
2670
2728
  ]))
2671
2729
  ]),
2672
2730
  i("span", null, b(o.label), 1)
2673
- ], 8, Us))), 128))
2731
+ ], 8, Ds))), 128))
2674
2732
  ])) : w("", !0),
2675
- H(i("textarea", {
2733
+ W(i("textarea", {
2676
2734
  ref: "inputEl",
2677
2735
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2678
2736
  class: "wm-compose__input",
@@ -2681,10 +2739,10 @@ function Ws(t, e, n, a, r, s) {
2681
2739
  disabled: n.disabled,
2682
2740
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2683
2741
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2684
- }, null, 40, Hs), [
2685
- [K, r.local]
2742
+ }, null, 40, zs), [
2743
+ [Q, r.local]
2686
2744
  ]),
2687
- i("div", zs, [
2745
+ i("div", Vs, [
2688
2746
  i("button", {
2689
2747
  type: "button",
2690
2748
  class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
@@ -2706,7 +2764,7 @@ function Ws(t, e, n, a, r, s) {
2706
2764
  }, [
2707
2765
  i("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" })
2708
2766
  ], -1)
2709
- ])], 10, Vs),
2767
+ ])], 10, qs),
2710
2768
  i("button", {
2711
2769
  type: "submit",
2712
2770
  class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
@@ -2726,12 +2784,12 @@ function Ws(t, e, n, a, r, s) {
2726
2784
  }, [
2727
2785
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2728
2786
  ], -1)
2729
- ])], 10, qs)
2787
+ ])], 10, Ws)
2730
2788
  ])
2731
2789
  ], 34)
2732
2790
  ]);
2733
2791
  }
2734
- const Gs = /* @__PURE__ */ B(Ls, [["render", Ws], ["__scopeId", "data-v-14fa9ec0"]]), Ks = {
2792
+ const Gs = /* @__PURE__ */ B($s, [["render", Ks], ["__scopeId", "data-v-14fa9ec0"]]), Ys = {
2735
2793
  name: "WmSuggestionChips",
2736
2794
  props: {
2737
2795
  items: { type: Array, default: () => [] },
@@ -2748,8 +2806,8 @@ const Gs = /* @__PURE__ */ B(Ls, [["render", Ws], ["__scopeId", "data-v-14fa9ec0
2748
2806
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2749
2807
  }
2750
2808
  }
2751
- }, Ys = ["onClick"];
2752
- function Js(t, e, n, a, r, s) {
2809
+ }, Js = ["onClick"];
2810
+ function Xs(t, e, n, a, r, s) {
2753
2811
  return n.items.length ? (l(), d("div", {
2754
2812
  key: s.batchKey,
2755
2813
  class: "wm-chips"
@@ -2758,14 +2816,14 @@ function Js(t, e, n, a, r, s) {
2758
2816
  key: c,
2759
2817
  type: "button",
2760
2818
  class: "wm-chip",
2761
- style: V({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2819
+ style: G({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2762
2820
  onClick: (v) => t.$emit("select", o)
2763
- }, b(o.label), 13, Ys))), 128))
2821
+ }, b(o.label), 13, Js))), 128))
2764
2822
  ])) : w("", !0);
2765
2823
  }
2766
- const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d"]]), Qs = {
2824
+ const Qs = /* @__PURE__ */ B(Ys, [["render", Xs], ["__scopeId", "data-v-55aa529d"]]), Zs = {
2767
2825
  name: "WmApprovalCard",
2768
- components: { AIAvatar: Q },
2826
+ components: { AIAvatar: te },
2769
2827
  props: {
2770
2828
  action: { type: String, required: !0 },
2771
2829
  detail: { type: String, default: "" },
@@ -2796,23 +2854,23 @@ const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d
2796
2854
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2797
2855
  }
2798
2856
  }
2799
- }, Zs = { class: "wm-approval" }, er = { class: "wm-approval__head" }, tr = { class: "wm-approval__icon" }, nr = { class: "wm-approval__main" }, sr = { class: "wm-approval__title" }, rr = {
2857
+ }, er = { class: "wm-approval" }, tr = { class: "wm-approval__head" }, nr = { class: "wm-approval__icon" }, sr = { class: "wm-approval__main" }, rr = { class: "wm-approval__title" }, ir = {
2800
2858
  key: 0,
2801
2859
  class: "wm-approval__detail"
2802
- }, ir = { class: "wm-approval__actions" };
2803
- function ar(t, e, n, a, r, s) {
2804
- const o = O("AIAvatar");
2805
- return l(), d("div", Zs, [
2806
- i("div", er, [
2807
- i("div", tr, [
2808
- z(o, { size: 24 })
2809
- ]),
2860
+ }, ar = { class: "wm-approval__actions" };
2861
+ function or(t, e, n, a, r, s) {
2862
+ const o = I("AIAvatar");
2863
+ return l(), d("div", er, [
2864
+ i("div", tr, [
2810
2865
  i("div", nr, [
2811
- i("div", sr, b(n.action), 1),
2812
- n.detail ? (l(), d("div", rr, b(n.detail), 1)) : w("", !0)
2866
+ K(o, { size: 24 })
2867
+ ]),
2868
+ i("div", sr, [
2869
+ i("div", rr, b(n.action), 1),
2870
+ n.detail ? (l(), d("div", ir, b(n.detail), 1)) : w("", !0)
2813
2871
  ])
2814
2872
  ]),
2815
- i("div", ir, [
2873
+ i("div", ar, [
2816
2874
  s.rejectId ? (l(), d("button", {
2817
2875
  key: 0,
2818
2876
  type: "button",
@@ -2828,9 +2886,9 @@ function ar(t, e, n, a, r, s) {
2828
2886
  ])
2829
2887
  ]);
2830
2888
  }
2831
- const or = /* @__PURE__ */ B(Qs, [["render", ar], ["__scopeId", "data-v-b1be139c"]]);
2889
+ const lr = /* @__PURE__ */ B(Zs, [["render", or], ["__scopeId", "data-v-b1be139c"]]);
2832
2890
  let ve = 0;
2833
- const lr = /* @__PURE__ */ new Set([
2891
+ const cr = /* @__PURE__ */ new Set([
2834
2892
  "text",
2835
2893
  "textarea",
2836
2894
  "number",
@@ -2838,9 +2896,9 @@ const lr = /* @__PURE__ */ new Set([
2838
2896
  "select",
2839
2897
  "multiselect",
2840
2898
  "date"
2841
- ]), cr = {
2899
+ ]), dr = {
2842
2900
  name: "WmFormCard",
2843
- components: { AIAvatar: Q },
2901
+ components: { AIAvatar: te },
2844
2902
  props: {
2845
2903
  form: { type: Object, required: !0 },
2846
2904
  readOnly: { type: Boolean, default: !1 },
@@ -2861,7 +2919,7 @@ const lr = /* @__PURE__ */ new Set([
2861
2919
  // douteux.
2862
2920
  normalizedFields() {
2863
2921
  var e;
2864
- return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !lr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2922
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !cr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2865
2923
  }
2866
2924
  },
2867
2925
  created() {
@@ -2912,48 +2970,48 @@ const lr = /* @__PURE__ */ new Set([
2912
2970
  }
2913
2971
  }
2914
2972
  }
2915
- }, dr = { class: "wm-form" }, ur = { class: "wm-form__head" }, hr = { class: "wm-form__icon" }, mr = { class: "wm-form__main" }, fr = { class: "wm-form__title" }, pr = {
2973
+ }, ur = { class: "wm-form" }, hr = { class: "wm-form__head" }, mr = { class: "wm-form__icon" }, fr = { class: "wm-form__main" }, _r = { class: "wm-form__title" }, pr = {
2916
2974
  key: 0,
2917
2975
  class: "wm-form__detail"
2918
- }, _r = ["for"], vr = {
2976
+ }, vr = ["for"], yr = {
2919
2977
  key: 0,
2920
2978
  class: "wm-form__req",
2921
2979
  "aria-hidden": "true"
2922
- }, gr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], yr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], wr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], br = ["id", "onUpdate:modelValue", "required", "disabled"], kr = {
2980
+ }, gr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], wr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], br = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], kr = ["id", "onUpdate:modelValue", "required", "disabled"], Cr = {
2923
2981
  key: 4,
2924
2982
  class: "wm-form__bool"
2925
- }, Cr = ["id", "onUpdate:modelValue", "disabled"], Ar = ["id", "onUpdate:modelValue", "required", "disabled"], Sr = {
2983
+ }, Ar = ["id", "onUpdate:modelValue", "disabled"], Sr = ["id", "onUpdate:modelValue", "required", "disabled"], xr = {
2926
2984
  value: "",
2927
2985
  disabled: ""
2928
- }, xr = ["value"], Mr = {
2986
+ }, Mr = ["value"], Tr = {
2929
2987
  key: 6,
2930
2988
  class: "wm-form__multi"
2931
- }, Tr = ["value", "checked", "disabled", "onChange"], Ir = {
2989
+ }, Or = ["value", "checked", "disabled", "onChange"], Ir = {
2932
2990
  key: 0,
2933
2991
  class: "wm-form__err"
2934
- }, Or = ["disabled"], Er = {
2992
+ }, Er = ["disabled"], Br = {
2935
2993
  key: 0,
2936
2994
  class: "wm-form__spinner",
2937
2995
  "aria-hidden": "true"
2938
- }, Br = {
2996
+ }, Lr = {
2939
2997
  key: 2,
2940
2998
  class: "wm-form__doneLbl"
2941
2999
  };
2942
- function Lr(t, e, n, a, r, s) {
2943
- const o = O("AIAvatar");
2944
- return l(), d("div", dr, [
2945
- i("div", ur, [
2946
- i("div", hr, [
2947
- z(o, { size: 24 })
2948
- ]),
3000
+ function $r(t, e, n, a, r, s) {
3001
+ const o = I("AIAvatar");
3002
+ return l(), d("div", ur, [
3003
+ i("div", hr, [
2949
3004
  i("div", mr, [
2950
- i("div", fr, b(n.form.title || "Formulaire"), 1),
3005
+ K(o, { size: 24 })
3006
+ ]),
3007
+ i("div", fr, [
3008
+ i("div", _r, b(n.form.title || "Formulaire"), 1),
2951
3009
  n.form.description ? (l(), d("div", pr, b(n.form.description), 1)) : w("", !0)
2952
3010
  ])
2953
3011
  ]),
2954
3012
  i("form", {
2955
3013
  class: "wm-form__body",
2956
- onSubmit: e[0] || (e[0] = X((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
3014
+ onSubmit: e[0] || (e[0] = ee((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
2957
3015
  }, [
2958
3016
  (l(!0), d(M, null, j(s.normalizedFields, (c) => (l(), d("div", {
2959
3017
  key: c.key,
@@ -2963,10 +3021,10 @@ function Lr(t, e, n, a, r, s) {
2963
3021
  for: `wm-f-${r._uid}-${c.key}`,
2964
3022
  class: "wm-form__label"
2965
3023
  }, [
2966
- ie(b(c.label), 1),
2967
- c.required ? (l(), d("span", vr, "*")) : w("", !0)
2968
- ], 8, _r),
2969
- c.type === "text" ? H((l(), d("input", {
3024
+ oe(b(c.label), 1),
3025
+ c.required ? (l(), d("span", yr, "*")) : w("", !0)
3026
+ ], 8, vr),
3027
+ c.type === "text" ? W((l(), d("input", {
2970
3028
  key: 0,
2971
3029
  id: `wm-f-${r._uid}-${c.key}`,
2972
3030
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2976,8 +3034,8 @@ function Lr(t, e, n, a, r, s) {
2976
3034
  required: c.required,
2977
3035
  disabled: n.readOnly || r.busy
2978
3036
  }, null, 8, gr)), [
2979
- [K, r.values[c.key]]
2980
- ]) : c.type === "textarea" ? H((l(), d("textarea", {
3037
+ [Q, r.values[c.key]]
3038
+ ]) : c.type === "textarea" ? W((l(), d("textarea", {
2981
3039
  key: 1,
2982
3040
  id: `wm-f-${r._uid}-${c.key}`,
2983
3041
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2986,9 +3044,9 @@ function Lr(t, e, n, a, r, s) {
2986
3044
  placeholder: c.placeholder || "",
2987
3045
  required: c.required,
2988
3046
  disabled: n.readOnly || r.busy
2989
- }, null, 8, yr)), [
2990
- [K, r.values[c.key]]
2991
- ]) : c.type === "number" ? H((l(), d("input", {
3047
+ }, null, 8, wr)), [
3048
+ [Q, r.values[c.key]]
3049
+ ]) : c.type === "number" ? W((l(), d("input", {
2992
3050
  key: 2,
2993
3051
  id: `wm-f-${r._uid}-${c.key}`,
2994
3052
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2997,14 +3055,14 @@ function Lr(t, e, n, a, r, s) {
2997
3055
  placeholder: c.placeholder || "",
2998
3056
  required: c.required,
2999
3057
  disabled: n.readOnly || r.busy
3000
- }, null, 8, wr)), [
3058
+ }, null, 8, br)), [
3001
3059
  [
3002
- K,
3060
+ Q,
3003
3061
  r.values[c.key],
3004
3062
  void 0,
3005
3063
  { number: !0 }
3006
3064
  ]
3007
- ]) : c.type === "date" ? H((l(), d("input", {
3065
+ ]) : c.type === "date" ? W((l(), d("input", {
3008
3066
  key: 3,
3009
3067
  id: `wm-f-${r._uid}-${c.key}`,
3010
3068
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -3012,19 +3070,19 @@ function Lr(t, e, n, a, r, s) {
3012
3070
  class: "wm-form__input",
3013
3071
  required: c.required,
3014
3072
  disabled: n.readOnly || r.busy
3015
- }, null, 8, br)), [
3016
- [K, r.values[c.key]]
3017
- ]) : c.type === "boolean" ? (l(), d("label", kr, [
3018
- H(i("input", {
3073
+ }, null, 8, kr)), [
3074
+ [Q, r.values[c.key]]
3075
+ ]) : c.type === "boolean" ? (l(), d("label", Cr, [
3076
+ W(i("input", {
3019
3077
  id: `wm-f-${r._uid}-${c.key}`,
3020
3078
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
3021
3079
  type: "checkbox",
3022
3080
  disabled: n.readOnly || r.busy
3023
- }, null, 8, Cr), [
3024
- [Ie, r.values[c.key]]
3081
+ }, null, 8, Ar), [
3082
+ [Oe, r.values[c.key]]
3025
3083
  ]),
3026
3084
  i("span", null, b(c.placeholder || "Oui"), 1)
3027
- ])) : c.type === "select" ? H((l(), d("select", {
3085
+ ])) : c.type === "select" ? W((l(), d("select", {
3028
3086
  key: 5,
3029
3087
  id: `wm-f-${r._uid}-${c.key}`,
3030
3088
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -3032,14 +3090,14 @@ function Lr(t, e, n, a, r, s) {
3032
3090
  required: c.required,
3033
3091
  disabled: n.readOnly || r.busy
3034
3092
  }, [
3035
- i("option", Sr, b(c.placeholder || "Choisir…"), 1),
3093
+ i("option", xr, b(c.placeholder || "Choisir…"), 1),
3036
3094
  (l(!0), d(M, null, j(c.options, (v) => (l(), d("option", {
3037
3095
  key: v.value,
3038
3096
  value: v.value
3039
- }, b(v.label), 9, xr))), 128))
3040
- ], 8, Ar)), [
3041
- [Oe, r.values[c.key]]
3042
- ]) : c.type === "multiselect" ? (l(), d("div", Mr, [
3097
+ }, b(v.label), 9, Mr))), 128))
3098
+ ], 8, Sr)), [
3099
+ [Ie, r.values[c.key]]
3100
+ ]) : c.type === "multiselect" ? (l(), d("div", Tr, [
3043
3101
  (l(!0), d(M, null, j(c.options, (v) => (l(), d("label", {
3044
3102
  key: v.value,
3045
3103
  class: "wm-form__multiItem"
@@ -3050,25 +3108,25 @@ function Lr(t, e, n, a, r, s) {
3050
3108
  checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(v.value),
3051
3109
  disabled: n.readOnly || r.busy,
3052
3110
  onChange: (k) => s.toggleMulti(c.key, v.value, k.target.checked)
3053
- }, null, 40, Tr),
3111
+ }, null, 40, Or),
3054
3112
  i("span", null, b(v.label), 1)
3055
3113
  ]))), 128))
3056
3114
  ])) : w("", !0)
3057
3115
  ]))), 128)),
3058
3116
  r.error ? (l(), d("div", Ir, b(r.error), 1)) : w("", !0),
3059
- n.readOnly ? (l(), d("div", Br, "Réponse envoyée")) : (l(), d("button", {
3117
+ n.readOnly ? (l(), d("div", Lr, "Réponse envoyée")) : (l(), d("button", {
3060
3118
  key: 1,
3061
3119
  type: "submit",
3062
3120
  class: "wm-form__submit",
3063
3121
  disabled: r.busy
3064
3122
  }, [
3065
- r.busy ? (l(), d("span", Er)) : w("", !0),
3123
+ r.busy ? (l(), d("span", Br)) : w("", !0),
3066
3124
  i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3067
- ], 8, Or))
3125
+ ], 8, Er))
3068
3126
  ], 32)
3069
3127
  ]);
3070
3128
  }
3071
- const Rr = /* @__PURE__ */ B(cr, [["render", Lr], ["__scopeId", "data-v-64b40f76"]]), $r = {
3129
+ const Rr = /* @__PURE__ */ B(dr, [["render", $r], ["__scopeId", "data-v-64b40f76"]]), Fr = {
3072
3130
  name: "WmFeedback",
3073
3131
  props: {
3074
3132
  busy: { type: Boolean, default: !1 },
@@ -3092,43 +3150,43 @@ const Rr = /* @__PURE__ */ B(cr, [["render", Lr], ["__scopeId", "data-v-64b40f76
3092
3150
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
3093
3151
  }
3094
3152
  }
3095
- }, Fr = { class: "wm-fb" }, jr = { class: "wm-fb__row" }, Ur = ["onClick"], Dr = { class: "wm-fb__emoji" }, Nr = { class: "wm-fb__label" }, Pr = ["disabled"], Hr = {
3153
+ }, jr = { class: "wm-fb" }, Ur = { class: "wm-fb__row" }, Dr = ["onClick"], Nr = { class: "wm-fb__emoji" }, Pr = { class: "wm-fb__label" }, Hr = ["disabled"], zr = {
3096
3154
  key: 1,
3097
3155
  class: "wm-fb__done"
3098
3156
  };
3099
- function zr(t, e, n, a, r, s) {
3100
- return l(), d("div", Fr, [
3101
- n.done ? (l(), d("div", Hr, [...e[3] || (e[3] = [
3157
+ function Vr(t, e, n, a, r, s) {
3158
+ return l(), d("div", jr, [
3159
+ n.done ? (l(), d("div", zr, [...e[3] || (e[3] = [
3102
3160
  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)
3103
3161
  ])])) : (l(), d(M, { key: 0 }, [
3104
3162
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3105
3163
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3106
- i("div", jr, [
3164
+ i("div", Ur, [
3107
3165
  (l(!0), d(M, null, j(r.options, (o) => (l(), d("button", {
3108
3166
  key: o.v,
3109
3167
  type: "button",
3110
3168
  class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
3111
3169
  onClick: (c) => r.sel = o.v
3112
3170
  }, [
3113
- i("span", Dr, b(o.e), 1),
3114
- i("span", Nr, b(o.l), 1)
3115
- ], 10, Ur))), 128))
3171
+ i("span", Nr, b(o.e), 1),
3172
+ i("span", Pr, b(o.l), 1)
3173
+ ], 10, Dr))), 128))
3116
3174
  ]),
3117
3175
  i("button", {
3118
3176
  type: "button",
3119
3177
  class: "wm-fb__send",
3120
3178
  disabled: !r.sel || n.busy,
3121
3179
  onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
3122
- }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Pr)
3180
+ }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Hr)
3123
3181
  ], 64))
3124
3182
  ]);
3125
3183
  }
3126
- const Vr = /* @__PURE__ */ B($r, [["render", zr], ["__scopeId", "data-v-6f45ff3b"]]);
3127
- function qr(t) {
3184
+ const qr = /* @__PURE__ */ B(Fr, [["render", Vr], ["__scopeId", "data-v-6f45ff3b"]]);
3185
+ function Wr(t) {
3128
3186
  const e = new Date(t);
3129
3187
  return e.setHours(0, 0, 0, 0), e;
3130
3188
  }
3131
- const Wr = {
3189
+ const Kr = {
3132
3190
  name: "WmHistoryDrawer",
3133
3191
  props: {
3134
3192
  conversations: { type: Array, default: () => [] },
@@ -3162,7 +3220,7 @@ const Wr = {
3162
3220
  ) : this.normalized;
3163
3221
  },
3164
3222
  groups() {
3165
- const e = qr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3223
+ const e = Wr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3166
3224
  for (const o of this.filtered) {
3167
3225
  if (!o.stamp) {
3168
3226
  s.push(o);
@@ -3180,29 +3238,29 @@ const Wr = {
3180
3238
  return this.filtered.length > 0;
3181
3239
  }
3182
3240
  }
3183
- }, Gr = { class: "wm-hd" }, Kr = {
3241
+ }, Gr = { class: "wm-hd" }, Yr = {
3184
3242
  class: "wm-hd__panel",
3185
3243
  role: "dialog",
3186
3244
  "aria-label": "Vos discussions"
3187
- }, Yr = { class: "wm-hd__head" }, Jr = { class: "wm-hd__top" }, Xr = { class: "wm-hd__search" }, Qr = { class: "wm-hd__list" }, Zr = {
3245
+ }, Jr = { class: "wm-hd__head" }, Xr = { class: "wm-hd__top" }, Qr = { class: "wm-hd__search" }, Zr = { class: "wm-hd__list" }, ei = {
3188
3246
  key: 0,
3189
3247
  class: "wm-hd__group"
3190
- }, ei = { class: "wm-hd__groupLabel" }, ti = { class: "wm-hd__rows" }, ni = ["onClick"], si = { class: "wm-hd__rowIcon" }, ri = {
3248
+ }, ti = { class: "wm-hd__groupLabel" }, ni = { class: "wm-hd__rows" }, si = ["onClick"], ri = { class: "wm-hd__rowIcon" }, ii = {
3191
3249
  key: 0,
3192
3250
  class: "wm-hd__rowDot",
3193
3251
  "aria-label": "Message non lu"
3194
- }, ii = { class: "wm-hd__rowBody" }, ai = { class: "wm-hd__rowTop" }, oi = { class: "wm-hd__rowTitle" }, li = { class: "wm-hd__rowPreview" }, ci = {
3252
+ }, ai = { class: "wm-hd__rowBody" }, oi = { class: "wm-hd__rowTop" }, li = { class: "wm-hd__rowTitle" }, ci = { class: "wm-hd__rowPreview" }, di = {
3195
3253
  key: 0,
3196
3254
  class: "wm-hd__empty"
3197
3255
  };
3198
- function di(t, e, n, a, r, s) {
3256
+ function ui(t, e, n, a, r, s) {
3199
3257
  return l(), d("div", Gr, [
3200
3258
  i("div", {
3201
3259
  class: "wm-hd__scrim",
3202
3260
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3203
3261
  }),
3204
- i("aside", Kr, [
3205
- i("div", Yr, [
3262
+ i("aside", Yr, [
3263
+ i("div", Jr, [
3206
3264
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3207
3265
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3208
3266
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3228,7 +3286,7 @@ function di(t, e, n, a, r, s) {
3228
3286
  ], -1)
3229
3287
  ])])
3230
3288
  ]),
3231
- i("div", Jr, [
3289
+ i("div", Xr, [
3232
3290
  i("button", {
3233
3291
  type: "button",
3234
3292
  class: "wm-hd__new",
@@ -3251,7 +3309,7 @@ function di(t, e, n, a, r, s) {
3251
3309
  ], -1),
3252
3310
  i("span", null, "Démarrer un nouveau fil", -1)
3253
3311
  ])]),
3254
- i("div", Xr, [
3312
+ i("div", Qr, [
3255
3313
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3256
3314
  i("svg", {
3257
3315
  width: "12",
@@ -3267,23 +3325,23 @@ function di(t, e, n, a, r, s) {
3267
3325
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3268
3326
  ])
3269
3327
  ], -1)),
3270
- H(i("input", {
3328
+ W(i("input", {
3271
3329
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3272
3330
  type: "text",
3273
3331
  placeholder: "Rechercher dans vos messages",
3274
3332
  "aria-label": "Rechercher dans vos messages"
3275
3333
  }, null, 512), [
3276
- [K, r.query]
3334
+ [Q, r.query]
3277
3335
  ])
3278
3336
  ])
3279
3337
  ]),
3280
- i("div", Qr, [
3338
+ i("div", Zr, [
3281
3339
  (l(!0), d(M, null, j(s.groups, (o) => (l(), d(M, {
3282
3340
  key: o.key
3283
3341
  }, [
3284
- o.items.length ? (l(), d("div", Zr, [
3285
- i("div", ei, b(o.label), 1),
3286
- i("div", ti, [
3342
+ o.items.length ? (l(), d("div", ei, [
3343
+ i("div", ti, b(o.label), 1),
3344
+ i("div", ni, [
3287
3345
  (l(!0), d(M, null, j(o.items, (c) => (l(), d("button", {
3288
3346
  key: c.id,
3289
3347
  type: "button",
@@ -3293,7 +3351,7 @@ function di(t, e, n, a, r, s) {
3293
3351
  }]),
3294
3352
  onClick: (v) => t.$emit("pick", c)
3295
3353
  }, [
3296
- i("div", si, [
3354
+ i("div", ri, [
3297
3355
  e[8] || (e[8] = i("svg", {
3298
3356
  width: "11",
3299
3357
  height: "11",
@@ -3307,24 +3365,24 @@ function di(t, e, n, a, r, s) {
3307
3365
  opacity: "0.92"
3308
3366
  })
3309
3367
  ], -1)),
3310
- c.unread ? (l(), d("span", ri)) : w("", !0)
3368
+ c.unread ? (l(), d("span", ii)) : w("", !0)
3311
3369
  ]),
3312
- i("div", ii, [
3313
- i("div", ai, [
3314
- i("span", oi, b(c.title), 1)
3370
+ i("div", ai, [
3371
+ i("div", oi, [
3372
+ i("span", li, b(c.title), 1)
3315
3373
  ]),
3316
- i("div", li, b(c.preview || "Aucun message"), 1)
3374
+ i("div", ci, b(c.preview || "Aucun message"), 1)
3317
3375
  ])
3318
- ], 10, ni))), 128))
3376
+ ], 10, si))), 128))
3319
3377
  ])
3320
3378
  ])) : w("", !0)
3321
3379
  ], 64))), 128)),
3322
- s.hasAny ? w("", !0) : (l(), d("div", ci, " Aucun fil pour le moment. "))
3380
+ s.hasAny ? w("", !0) : (l(), d("div", di, " Aucun fil pour le moment. "))
3323
3381
  ])
3324
3382
  ])
3325
3383
  ]);
3326
3384
  }
3327
- const ui = /* @__PURE__ */ B(Wr, [["render", di], ["__scopeId", "data-v-1259e822"]]), hi = {
3385
+ const hi = /* @__PURE__ */ B(Kr, [["render", ui], ["__scopeId", "data-v-1259e822"]]), mi = {
3328
3386
  name: "WmMoreMenu",
3329
3387
  props: {
3330
3388
  canRename: { type: Boolean, default: !0 },
@@ -3351,17 +3409,17 @@ const ui = /* @__PURE__ */ B(Wr, [["render", di], ["__scopeId", "data-v-1259e822
3351
3409
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3352
3410
  }
3353
3411
  }
3354
- }, mi = { class: "wm-mm" }, fi = {
3412
+ }, fi = { class: "wm-mm" }, _i = {
3355
3413
  class: "wm-mm__pop",
3356
3414
  role: "menu"
3357
- }, pi = { class: "wm-mm__section" }, _i = { class: "wm-mm__section" }, vi = { class: "wm-mm__section" };
3415
+ }, pi = { class: "wm-mm__section" }, vi = { class: "wm-mm__section" }, yi = { class: "wm-mm__section" };
3358
3416
  function gi(t, e, n, a, r, s) {
3359
- return l(), d("div", mi, [
3417
+ return l(), d("div", fi, [
3360
3418
  i("div", {
3361
3419
  class: "wm-mm__scrim",
3362
3420
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3363
3421
  }),
3364
- i("div", fi, [
3422
+ i("div", _i, [
3365
3423
  i("div", pi, [
3366
3424
  i("button", {
3367
3425
  type: "button",
@@ -3426,7 +3484,7 @@ function gi(t, e, n, a, r, s) {
3426
3484
  ])])) : w("", !0)
3427
3485
  ]),
3428
3486
  e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3429
- i("div", _i, [
3487
+ i("div", vi, [
3430
3488
  i("button", {
3431
3489
  type: "button",
3432
3490
  class: "wm-mm__item",
@@ -3456,7 +3514,7 @@ function gi(t, e, n, a, r, s) {
3456
3514
  ])
3457
3515
  ]),
3458
3516
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3459
- i("div", vi, [
3517
+ i("div", yi, [
3460
3518
  n.statusUrl ? (l(), d("button", {
3461
3519
  key: 0,
3462
3520
  type: "button",
@@ -3507,13 +3565,13 @@ function gi(t, e, n, a, r, s) {
3507
3565
  ])
3508
3566
  ]);
3509
3567
  }
3510
- const yi = /* @__PURE__ */ B(hi, [["render", gi], ["__scopeId", "data-v-c1bb81d2"]]), ge = "ww-messenger-tokens";
3568
+ const wi = /* @__PURE__ */ B(mi, [["render", gi], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
3511
3569
  function de(t) {
3512
3570
  var n;
3513
3571
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3514
3572
  return e === "agent_ia" || e === "agent_human";
3515
3573
  }
3516
- function wi(t, e) {
3574
+ function bi(t, e) {
3517
3575
  if (!t || !e) return "";
3518
3576
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3519
3577
  for (const r of n) {
@@ -3522,8 +3580,8 @@ function wi(t, e) {
3522
3580
  if (s == null || s === "") continue;
3523
3581
  let o;
3524
3582
  if (Array.isArray(s)) {
3525
- if (o = s.map((c) => re(r, String(c))).join(", "), !o) continue;
3526
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
3583
+ if (o = s.map((c) => ae(r, String(c))).join(", "), !o) continue;
3584
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3527
3585
  a.push(`${r.label} :
3528
3586
  ${o}`);
3529
3587
  }
@@ -3531,12 +3589,12 @@ ${o}`);
3531
3589
 
3532
3590
  `);
3533
3591
  }
3534
- function re(t, e) {
3592
+ function ae(t, e) {
3535
3593
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
3536
3594
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3537
3595
  return (n == null ? void 0 : n.label) || e;
3538
3596
  }
3539
- function bi(t, e) {
3597
+ function ki(t, e) {
3540
3598
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3541
3599
  for (const r of a) {
3542
3600
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3544,8 +3602,8 @@ function bi(t, e) {
3544
3602
  if (s == null || s === "") continue;
3545
3603
  let o;
3546
3604
  if (Array.isArray(s)) {
3547
- if (o = s.map((v) => re(r, String(v))).join(", "), !o) continue;
3548
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
3605
+ if (o = s.map((v) => ae(r, String(v))).join(", "), !o) continue;
3606
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3549
3607
  const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3550
3608
  `));
3551
3609
  n.push({ label: r.label, value: o, multiline: c });
@@ -3558,20 +3616,20 @@ function bi(t, e) {
3558
3616
  }
3559
3617
  };
3560
3618
  }
3561
- const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
3619
+ const Ci = 450, Ai = 50, Si = 900, xi = 12e3, Mi = 300, Ti = {
3562
3620
  name: "Messenger",
3563
3621
  components: {
3564
- Launcher: Ge,
3565
- Header: yt,
3622
+ Launcher: Ke,
3623
+ Header: gt,
3566
3624
  Onboarding: Pt,
3567
- MessageList: Ms,
3625
+ MessageList: Ts,
3568
3626
  Composer: Gs,
3569
- SuggestionChips: Xs,
3570
- ApprovalCard: or,
3627
+ SuggestionChips: Qs,
3628
+ ApprovalCard: lr,
3571
3629
  FormCard: Rr,
3572
- Feedback: Vr,
3573
- HistoryDrawer: ui,
3574
- MoreMenu: yi
3630
+ Feedback: qr,
3631
+ HistoryDrawer: hi,
3632
+ MoreMenu: wi
3575
3633
  },
3576
3634
  // Make signAttachment available to deep children (AttachmentPreview)
3577
3635
  // without prop drilling. The store may not exist yet at provide-time
@@ -3924,7 +3982,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
3924
3982
  const e = (v = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : v.prepared_params;
3925
3983
  if (!e || typeof e != "object") return "";
3926
3984
  const n = Object.entries(e);
3927
- return n.length ? n.slice(0, 2).map(([k, y]) => `${k}: ${y}`).join(" · ") : "";
3985
+ return n.length ? n.slice(0, 2).map(([k, g]) => `${k}: ${g}`).join(" · ") : "";
3928
3986
  },
3929
3987
  actionInFlight() {
3930
3988
  var t, e;
@@ -4094,9 +4152,9 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4094
4152
  hasWidgetId: !!this.widgetId,
4095
4153
  hasUserId: !!this.userId,
4096
4154
  hasUserHash: !!this.userHash
4097
- }), typeof document < "u" && !document.getElementById(ge)) {
4155
+ }), typeof document < "u" && !document.getElementById(ye)) {
4098
4156
  const t = document.createElement("style");
4099
- t.id = ge, t.textContent = Ne, document.head.appendChild(t);
4157
+ t.id = ye, t.textContent = Ne, document.head.appendChild(t);
4100
4158
  }
4101
4159
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4102
4160
  },
@@ -4247,19 +4305,19 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4247
4305
  // bounded by MIN/MAX_BETWEEN_MS.
4248
4306
  scheduleReveal(t) {
4249
4307
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4250
- Si,
4251
- Math.max(Ai, n * Ci)
4308
+ xi,
4309
+ Math.max(Si, n * Ai)
4252
4310
  ), s = Math.max(
4253
- e + ki,
4254
- this.nextRevealAt + xi
4311
+ e + Ci,
4312
+ this.nextRevealAt + Mi
4255
4313
  ) + a;
4256
4314
  this.nextRevealAt = s;
4257
4315
  const o = Math.max(0, s - e), c = t.id, v = setTimeout(() => {
4258
- this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((y) => y !== v);
4316
+ this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((g) => g !== v);
4259
4317
  }, o);
4260
4318
  this.revealTimers.push(v);
4261
4319
  const k = setTimeout(() => {
4262
- this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((y) => y !== k);
4320
+ this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((g) => g !== k);
4263
4321
  }, o + 4e3);
4264
4322
  this.revealTimers.push(k);
4265
4323
  },
@@ -4278,7 +4336,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4278
4336
  baseUrl: this.baseUrl,
4279
4337
  widgetId: this.widgetId,
4280
4338
  userId: this.userId
4281
- }), this.transport = fe($e({
4339
+ }), this.transport = fe(Re({
4282
4340
  baseUrl: this.baseUrl,
4283
4341
  widgetId: this.widgetId,
4284
4342
  userId: this.userId,
@@ -4422,18 +4480,18 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4422
4480
  t.created_at ? `Créée le : ${t.created_at}` : "",
4423
4481
  ""
4424
4482
  ];
4425
- for (const y of e) {
4426
- if (!y) continue;
4427
- const S = ((o = y.author) == null ? void 0 : o.name) || (((c = y.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((v = y.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = y.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), $ = y.created_at ? new Date(y.created_at).toLocaleString("fr-FR") : "", A = (y.text_md || "").trim();
4428
- A && (n.push(`[${$}] ${S} :`), n.push(A), n.push(""));
4483
+ for (const g of e) {
4484
+ if (!g) continue;
4485
+ const S = ((o = g.author) == null ? void 0 : o.name) || (((c = g.author) == null ? void 0 : c.type) === "user" ? "Vous" : ((v = g.author) == null ? void 0 : v.type) === "agent_human" ? "Agent" : ((k = g.author) == null ? void 0 : k.type) === "agent_ia" ? "Assistant IA" : "Système"), R = g.created_at ? new Date(g.created_at).toLocaleString("fr-FR") : "", A = (g.text_md || "").trim();
4486
+ A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
4429
4487
  }
4430
4488
  const a = new Blob([n.join(`
4431
4489
  `)], { type: "text/plain;charset=utf-8" });
4432
4490
  try {
4433
- const y = URL.createObjectURL(a), S = document.createElement("a");
4434
- S.href = y, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(y), 1e3);
4435
- } catch (y) {
4436
- console.error("[ww-messenger] export failed", y);
4491
+ const g = URL.createObjectURL(a), S = document.createElement("a");
4492
+ S.href = g, S.download = `${(t.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(S), S.click(), document.body.removeChild(S), setTimeout(() => URL.revokeObjectURL(g), 1e3);
4493
+ } catch (g) {
4494
+ console.error("[ww-messenger] export failed", g);
4437
4495
  }
4438
4496
  },
4439
4497
  async onSend(t) {
@@ -4459,12 +4517,12 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4459
4517
  async onFormSubmit({ values: t }) {
4460
4518
  const e = this.pendingForm;
4461
4519
  if (!(e != null && e.form)) return;
4462
- const n = wi(e.form, t);
4520
+ const n = bi(e.form, t);
4463
4521
  if (!n) return;
4464
4522
  const a = this.currentConv;
4465
4523
  a && await this.store.send(a.id, n, {
4466
4524
  metadata: {
4467
- artifact: bi(e.form, t)
4525
+ artifact: ki(e.form, t)
4468
4526
  }
4469
4527
  });
4470
4528
  },
@@ -4508,7 +4566,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4508
4566
  }
4509
4567
  }
4510
4568
  }
4511
- }, Ti = {
4569
+ }, Oi = {
4512
4570
  key: 0,
4513
4571
  class: "wm-loading",
4514
4572
  "aria-busy": "true",
@@ -4516,7 +4574,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4516
4574
  }, Ii = {
4517
4575
  key: 0,
4518
4576
  class: "wm-state"
4519
- }, Oi = { class: "wm-state__err" }, Ei = { class: "wm-state__errSub" }, Bi = { class: "wm-bottom" }, Li = {
4577
+ }, Ei = { class: "wm-state__err" }, Bi = { class: "wm-state__errSub" }, Li = { class: "wm-bottom" }, $i = {
4520
4578
  key: 0,
4521
4579
  ref: "floatEl",
4522
4580
  class: "wm-float"
@@ -4525,16 +4583,16 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4525
4583
  class: "wm-actionWait",
4526
4584
  role: "status",
4527
4585
  "aria-live": "polite"
4528
- }, $i = { class: "wm-actionWait__lbl" }, Fi = {
4586
+ }, Fi = { class: "wm-actionWait__lbl" }, ji = {
4529
4587
  key: 1,
4530
4588
  class: "wm-attached"
4531
- }, ji = ["onClick"];
4532
- function Ui(t, e, n, a, r, s) {
4533
- const o = O("Launcher"), c = O("Header"), v = O("Onboarding"), k = O("MessageList"), y = O("ApprovalCard"), S = O("FormCard"), $ = O("Feedback"), A = O("SuggestionChips"), D = O("Composer"), x = O("MoreMenu"), N = O("HistoryDrawer");
4589
+ }, Ui = ["onClick"];
4590
+ function Di(t, e, n, a, r, s) {
4591
+ const o = I("Launcher"), c = I("Header"), v = I("Onboarding"), k = I("MessageList"), g = I("ApprovalCard"), S = I("FormCard"), R = I("Feedback"), A = I("SuggestionChips"), P = I("Composer"), x = I("MoreMenu"), D = I("HistoryDrawer");
4534
4592
  return l(), d("div", {
4535
4593
  class: E(["wm-root", `wm-root--${n.displayMode}`])
4536
4594
  }, [
4537
- !r.isOpen && !s.isEmbedded ? (l(), R(o, {
4595
+ !r.isOpen && !s.isEmbedded ? (l(), $(o, {
4538
4596
  key: 0,
4539
4597
  "unread-count": s.unreadCount,
4540
4598
  peek: s.launcherPeek,
@@ -4544,11 +4602,11 @@ function Ui(t, e, n, a, r, s) {
4544
4602
  r.isOpen || s.isEmbedded ? (l(), d("section", {
4545
4603
  key: 1,
4546
4604
  class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4547
- style: V(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4605
+ style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4548
4606
  role: "dialog",
4549
4607
  "aria-label": "Messenger"
4550
4608
  }, [
4551
- !s.ready && !s.error ? (l(), d("div", Ti, [
4609
+ !s.ready && !s.error ? (l(), d("div", Oi, [
4552
4610
  s.isEmbedded ? w("", !0) : (l(), d("button", {
4553
4611
  key: 0,
4554
4612
  type: "button",
@@ -4575,7 +4633,7 @@ function Ui(t, e, n, a, r, s) {
4575
4633
  "aria-hidden": "true"
4576
4634
  }, null, -1))
4577
4635
  ])) : (l(), d(M, { key: 1 }, [
4578
- z(c, {
4636
+ K(c, {
4579
4637
  title: s.headerTitle,
4580
4638
  escalated: s.isEscalated,
4581
4639
  "agent-name": s.humanAgentName,
@@ -4591,7 +4649,7 @@ function Ui(t, e, n, a, r, s) {
4591
4649
  onClose: s.close
4592
4650
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4593
4651
  s.error ? (l(), d("div", Ii, [
4594
- i("div", Oi, [
4652
+ i("div", Ei, [
4595
4653
  e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4596
4654
  i("svg", {
4597
4655
  width: "14",
@@ -4609,11 +4667,11 @@ function Ui(t, e, n, a, r, s) {
4609
4667
  ], -1)),
4610
4668
  i("div", null, [
4611
4669
  e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4612
- i("div", Ei, b(s.error), 1)
4670
+ i("div", Bi, b(s.error), 1)
4613
4671
  ])
4614
4672
  ])
4615
4673
  ])) : s.currentConv ? (l(), d(M, { key: 2 }, [
4616
- z(k, {
4674
+ K(k, {
4617
4675
  ref: "messageList",
4618
4676
  messages: s.displayedMessages,
4619
4677
  "streaming-active": s.streamingActive,
@@ -4624,24 +4682,24 @@ function Ui(t, e, n, a, r, s) {
4624
4682
  "unread-anchor-ts": r.unreadAnchorTs,
4625
4683
  onLoadMore: s.onLoadMore
4626
4684
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "onLoadMore"]),
4627
- i("div", Bi, [
4628
- s.floatVisible ? (l(), d("div", Li, [
4629
- s.approvalReady ? (l(), R(y, {
4685
+ i("div", Li, [
4686
+ s.floatVisible ? (l(), d("div", $i, [
4687
+ s.approvalReady ? (l(), $(g, {
4630
4688
  key: 0,
4631
4689
  action: s.approvalTitle,
4632
4690
  detail: s.approvalDetail,
4633
4691
  callbacks: s.pendingApproval.callbacks,
4634
4692
  onCallback: s.onApprovalCallback
4635
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), R(S, {
4693
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
4636
4694
  key: s.pendingForm.message && s.pendingForm.message.id,
4637
4695
  form: s.pendingForm.form,
4638
4696
  onSubmit: s.onFormSubmit
4639
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), R($, {
4697
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(R, {
4640
4698
  key: 2,
4641
4699
  busy: r.feedbackBusy,
4642
4700
  done: r.feedbackDone,
4643
4701
  onSubmit: s.onFeedback
4644
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), R(A, {
4702
+ }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
4645
4703
  key: 3,
4646
4704
  items: s.suggestions,
4647
4705
  onSelect: s.onSuggestion
@@ -4652,8 +4710,8 @@ function Ui(t, e, n, a, r, s) {
4652
4710
  class: "wm-actionWait__spinner",
4653
4711
  "aria-hidden": "true"
4654
4712
  }, null, -1)),
4655
- i("span", $i, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4656
- ])) : (l(), R(D, {
4713
+ i("span", Fi, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4714
+ ])) : (l(), $(P, {
4657
4715
  key: 2,
4658
4716
  ref: "composer",
4659
4717
  modelValue: r.draft,
@@ -4665,7 +4723,7 @@ function Ui(t, e, n, a, r, s) {
4665
4723
  onAttach: s.onAttach
4666
4724
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
4667
4725
  ]),
4668
- r.moreOpen ? (l(), R(x, {
4726
+ r.moreOpen ? (l(), $(x, {
4669
4727
  key: 0,
4670
4728
  "can-rename": !!s.currentConv,
4671
4729
  "can-clear": !!s.currentConv,
@@ -4677,9 +4735,9 @@ function Ui(t, e, n, a, r, s) {
4677
4735
  onNotifToggle: s.onNotifToggle,
4678
4736
  onAction: s.onMoreAction
4679
4737
  }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : w("", !0),
4680
- r.pendingAttachments.length ? (l(), d("div", Fi, [
4681
- (l(!0), d(M, null, j(r.pendingAttachments, (F, P) => (l(), d("div", {
4682
- key: P,
4738
+ r.pendingAttachments.length ? (l(), d("div", ji, [
4739
+ (l(!0), d(M, null, j(r.pendingAttachments, (F, N) => (l(), d("div", {
4740
+ key: N,
4683
4741
  class: "wm-attached__chip"
4684
4742
  }, [
4685
4743
  e[12] || (e[12] = i("svg", {
@@ -4699,7 +4757,7 @@ function Ui(t, e, n, a, r, s) {
4699
4757
  i("button", {
4700
4758
  type: "button",
4701
4759
  "aria-label": "Retirer",
4702
- onClick: (q) => r.pendingAttachments.splice(P, 1)
4760
+ onClick: (V) => r.pendingAttachments.splice(N, 1)
4703
4761
  }, [...e[11] || (e[11] = [
4704
4762
  i("svg", {
4705
4763
  width: "10",
@@ -4714,10 +4772,10 @@ function Ui(t, e, n, a, r, s) {
4714
4772
  }, [
4715
4773
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4716
4774
  ], -1)
4717
- ])], 8, ji)
4775
+ ])], 8, Ui)
4718
4776
  ]))), 128))
4719
4777
  ])) : w("", !0)
4720
- ], 64)) : (l(), R(v, {
4778
+ ], 64)) : (l(), $(v, {
4721
4779
  key: 1,
4722
4780
  "welcome-message": s.widgetWelcomeMessage,
4723
4781
  "agent-name": s.agentName,
@@ -4728,7 +4786,7 @@ function Ui(t, e, n, a, r, s) {
4728
4786
  onSelect: s.onQuickLink,
4729
4787
  onResume: s.onDrawerPick
4730
4788
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
4731
- r.historyOpen ? (l(), R(N, {
4789
+ r.historyOpen ? (l(), $(D, {
4732
4790
  key: 3,
4733
4791
  conversations: s.drawerConversations,
4734
4792
  "active-id": s.currentConv ? s.currentConv.id : null,
@@ -4736,7 +4794,7 @@ function Ui(t, e, n, a, r, s) {
4736
4794
  onNew: s.onDrawerNew,
4737
4795
  onPick: s.onDrawerPick
4738
4796
  }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : w("", !0),
4739
- r.moreOpen && !s.currentConv ? (l(), R(x, {
4797
+ r.moreOpen && !s.currentConv ? (l(), $(x, {
4740
4798
  key: 4,
4741
4799
  "can-rename": !1,
4742
4800
  "can-clear": !1,
@@ -4752,48 +4810,48 @@ function Ui(t, e, n, a, r, s) {
4752
4810
  ], 6)) : w("", !0)
4753
4811
  ], 2);
4754
4812
  }
4755
- const Pi = /* @__PURE__ */ B(Mi, [["render", Ui], ["__scopeId", "data-v-8264e504"]]), Hi = "0.2.20";
4813
+ const Hi = /* @__PURE__ */ B(Ti, [["render", Di], ["__scopeId", "data-v-8264e504"]]), zi = "0.2.22";
4756
4814
  export {
4757
- Q as AIAvatar,
4815
+ te as AIAvatar,
4758
4816
  ce as AVATAR_COLORS,
4759
4817
  Qt as ActionResult,
4760
- or as ApprovalCard,
4818
+ lr as ApprovalCard,
4761
4819
  on as ArtifactFormResponse,
4762
4820
  wn as ArtifactInfoCard,
4763
4821
  Un as ArtifactRenderer,
4764
- Rn as ArtifactTicket,
4822
+ $n as ArtifactTicket,
4765
4823
  Jn as AttachmentPreview,
4766
4824
  ss as Bubble,
4767
4825
  Gs as Composer,
4768
4826
  Pe as DEFAULT_BASE_URL,
4769
- Vr as Feedback,
4827
+ qr as Feedback,
4770
4828
  Rr as FormCard,
4771
- yt as Header,
4772
- ui as HistoryDrawer,
4829
+ gt as Header,
4830
+ hi as HistoryDrawer,
4773
4831
  ke as HumanAvatar,
4774
- Ge as Launcher,
4832
+ Ke as Launcher,
4775
4833
  he as MEDIA_RECORDER_SUPPORTED,
4776
- Ms as MessageList,
4777
- Pi as Messenger,
4778
- yi as MoreMenu,
4834
+ Ts as MessageList,
4835
+ Hi as Messenger,
4836
+ wi as MoreMenu,
4779
4837
  Pt as Onboarding,
4780
- se as SCREEN_CAPTURE_SUPPORTED,
4781
- Xs as SuggestionChips,
4838
+ ie as SCREEN_CAPTURE_SUPPORTED,
4839
+ Qs as SuggestionChips,
4782
4840
  ot as TeamAvatars,
4783
4841
  os as Typing,
4784
- Hi as VERSION,
4785
- ye as avatarColor,
4842
+ zi as VERSION,
4843
+ ge as avatarColor,
4786
4844
  we as avatarInitials,
4787
4845
  Is as captureScreenshotFile,
4788
4846
  U as colors,
4789
4847
  De as createStore,
4790
- $e as createTransport,
4791
- Pi as default,
4848
+ Re as createTransport,
4849
+ Hi as default,
4792
4850
  be as formatTime,
4793
- Ni as guessAttachmentKind,
4794
- Ts as pickRecorderMime,
4851
+ Pi as guessAttachmentKind,
4852
+ Os as pickRecorderMime,
4795
4853
  Zn as renderMarkdown,
4796
- Es as startScreenRecording,
4854
+ Bs as startScreenRecording,
4797
4855
  Ne as tokensCss,
4798
4856
  Ue as uuid,
4799
4857
  Ue as v4