@_solaris/messenger-widget 0.2.21 → 0.2.23

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 Y, 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,78 +108,78 @@ 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
- K();
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 K(), 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)}`
180
180
  );
181
181
  }
182
- function W() {
182
+ function Y() {
183
183
  const h = new URLSearchParams({
184
184
  userId: e.userId,
185
185
  userHash: e.userHash,
@@ -187,48 +187,48 @@ function $e(t) {
187
187
  }).toString();
188
188
  return `${e.baseUrl}/stream?${h}`;
189
189
  }
190
- function G() {
190
+ function H() {
191
191
  if (!e.eventSource && !(typeof document < "u" && document.hidden))
192
192
  try {
193
- const h = new EventSource(W());
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 K() {
213
- clearTimeout(e.burstTimer), G(), 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), G()) : K();
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 }), K());
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 && G();
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) || (G(m, p), p.client_msg_id && delete e.streamingByMsgId[p.client_msg_id], K(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
- G(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
- function W(u) {
540
- var p, g, h, f;
539
+ function Y(u) {
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 G(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 K(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,
629
- getLatestSuggestions: W,
630
- getLatestForm: P,
628
+ getActionInFlight: V,
629
+ getLatestSuggestions: Y,
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);
@@ -1472,6 +1472,11 @@ const kn = {
1472
1472
  isPriority(t) {
1473
1473
  return /priorit|^prio$/i.test(String(t || "").trim());
1474
1474
  },
1475
+ // Idem pour les libellés évoquant une date / échéance : déclenche
1476
+ // l'icône calendrier (date, échéance, deadline, due, créé/créée le…).
1477
+ isDate(t) {
1478
+ return /date|échéanc|echeanc|deadline|due|créé|cree/i.test(String(t || "").trim());
1479
+ },
1475
1480
  // 3 niveaux dérivés librement de la valeur ("Moyenne (Medium)",
1476
1481
  // "Élevée", "Critical"…). Défaut : niveau moyen — non-reconnu vaut
1477
1482
  // mieux que muet.
@@ -1483,14 +1488,26 @@ const kn = {
1483
1488
  }, 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
1489
  key: 0,
1485
1490
  class: "wm-tk__text"
1486
- }, In = {
1491
+ }, On = {
1487
1492
  key: 0,
1488
1493
  class: "wm-art__body"
1489
- }, On = { class: "wm-art__fieldLabel" }, En = ["data-level"], Bn = {
1494
+ }, In = { class: "wm-art__fieldLabel" }, En = ["data-level"], Bn = {
1495
+ key: 1,
1496
+ class: "wm-tk__date",
1497
+ width: "12",
1498
+ height: "12",
1499
+ viewBox: "0 0 24 24",
1500
+ fill: "none",
1501
+ stroke: "currentColor",
1502
+ "stroke-width": "2",
1503
+ "stroke-linecap": "round",
1504
+ "stroke-linejoin": "round",
1505
+ "aria-hidden": "true"
1506
+ }, Ln = {
1490
1507
  key: 1,
1491
1508
  class: "wm-art__footer wm-tk__footer"
1492
1509
  };
1493
- function Ln(t, e, n, a, r, s) {
1510
+ function $n(t, e, n, a, r, s) {
1494
1511
  return l(), d("div", Cn, [
1495
1512
  i("div", An, [
1496
1513
  i("div", Sn, b(n.data.title), 1),
@@ -1519,17 +1536,17 @@ function Ln(t, e, n, a, r, s) {
1519
1536
  class: "wm-tk__dot",
1520
1537
  "aria-hidden": "true"
1521
1538
  }, null, -1)),
1522
- ie(" " + b(n.data.status.label), 1)
1539
+ oe(" " + b(n.data.status.label), 1)
1523
1540
  ], 2)
1524
1541
  ]),
1525
1542
  n.data.body ? (l(), d("div", Tn, b(n.data.body), 1)) : w("", !0)
1526
1543
  ]),
1527
- s.fields.length ? (l(), d("div", In, [
1544
+ s.fields.length ? (l(), d("div", On, [
1528
1545
  (l(!0), d(M, null, j(s.fields, (o, c) => (l(), d("div", {
1529
1546
  key: c,
1530
1547
  class: "wm-art__field"
1531
1548
  }, [
1532
- i("div", On, b(o.label), 1),
1549
+ i("div", In, b(o.label), 1),
1533
1550
  i("div", {
1534
1551
  class: E(["wm-art__fieldValue", { "wm-art__fieldValue--multi": o.multiline }])
1535
1552
  }, [
@@ -1563,13 +1580,22 @@ function Ln(t, e, n, a, r, s) {
1563
1580
  height: "9",
1564
1581
  rx: "0.5"
1565
1582
  }, null, -1)
1566
- ])], 8, En)) : w("", !0),
1583
+ ])], 8, En)) : s.isDate(o.label) ? (l(), d("svg", Bn, [...e[3] || (e[3] = [
1584
+ i("rect", {
1585
+ x: "3",
1586
+ y: "4",
1587
+ width: "18",
1588
+ height: "18",
1589
+ rx: "2"
1590
+ }, null, -1),
1591
+ i("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
1592
+ ])])) : w("", !0),
1567
1593
  i("span", null, b(o.value), 1)
1568
1594
  ], 2)
1569
1595
  ]))), 128))
1570
1596
  ])) : w("", !0),
1571
- n.data.created_at ? (l(), d("div", Bn, [
1572
- e[3] || (e[3] = i("svg", {
1597
+ n.data.created_at ? (l(), d("div", Ln, [
1598
+ e[4] || (e[4] = i("svg", {
1573
1599
  width: "11",
1574
1600
  height: "11",
1575
1601
  viewBox: "0 0 24 24",
@@ -1593,11 +1619,11 @@ function Ln(t, e, n, a, r, s) {
1593
1619
  ])) : w("", !0)
1594
1620
  ]);
1595
1621
  }
1596
- const Rn = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0"]]), $n = {
1622
+ const Rn = /* @__PURE__ */ B(kn, [["render", $n], ["__scopeId", "data-v-c82d1f53"]]), Fn = {
1597
1623
  form_response: on,
1598
1624
  info_card: wn,
1599
1625
  ticket: Rn
1600
- }, Fn = {
1626
+ }, jn = {
1601
1627
  name: "WmArtifactRenderer",
1602
1628
  props: {
1603
1629
  // Forme : { kind: string, data: any } (le `data` est validé
@@ -1608,17 +1634,17 @@ const Rn = /* @__PURE__ */ B(kn, [["render", Ln], ["__scopeId", "data-v-97001af0
1608
1634
  component() {
1609
1635
  var e;
1610
1636
  const t = (e = this.artifact) == null ? void 0 : e.kind;
1611
- return t && $n[t] || null;
1637
+ return t && Fn[t] || null;
1612
1638
  }
1613
1639
  }
1614
1640
  };
1615
- function jn(t, e, n, a, r, s) {
1616
- return s.component ? (l(), R(Me(s.component), {
1641
+ function Un(t, e, n, a, r, s) {
1642
+ return s.component ? (l(), $(Me(s.component), {
1617
1643
  key: 0,
1618
1644
  data: n.artifact.data
1619
1645
  }, null, 8, ["data"])) : w("", !0);
1620
1646
  }
1621
- const Un = /* @__PURE__ */ B(Fn, [["render", jn]]), Dn = {
1647
+ const Dn = /* @__PURE__ */ B(jn, [["render", Un]]), Nn = {
1622
1648
  name: "WmAttachmentPreview",
1623
1649
  inject: {
1624
1650
  signAttachmentFn: { default: null }
@@ -1672,15 +1698,15 @@ const Un = /* @__PURE__ */ B(Fn, [["render", jn]]), Dn = {
1672
1698
  this.url || t.preventDefault();
1673
1699
  }
1674
1700
  }
1675
- }, Nn = ["href"], Pn = ["src", "alt"], Hn = ["src"], zn = ["src"], Vn = ["href", "download"], qn = { class: "wm-att__main" }, Wn = { class: "wm-att__name" }, Gn = {
1701
+ }, Pn = ["href"], Hn = ["src", "alt"], zn = ["src"], Vn = ["src"], qn = ["href", "download"], Wn = { class: "wm-att__main" }, Kn = { class: "wm-att__name" }, Gn = {
1676
1702
  key: 0,
1677
1703
  class: "wm-att__meta"
1678
- }, Kn = {
1704
+ }, Yn = {
1679
1705
  key: 0,
1680
1706
  class: "wm-att__spin",
1681
1707
  "aria-hidden": "true"
1682
1708
  };
1683
- function Yn(t, e, n, a, r, s) {
1709
+ function Jn(t, e, n, a, r, s) {
1684
1710
  return l(), d("div", {
1685
1711
  class: E(["wm-att", ["wm-att--" + (s.kind || "file")]])
1686
1712
  }, [
@@ -1695,18 +1721,18 @@ function Yn(t, e, n, a, r, s) {
1695
1721
  src: r.url,
1696
1722
  alt: s.displayName,
1697
1723
  loading: "lazy"
1698
- }, null, 8, Pn)
1699
- ], 8, Nn)) : s.kind === "audio" && r.url ? (l(), d("audio", {
1724
+ }, null, 8, Hn)
1725
+ ], 8, Pn)) : s.kind === "audio" && r.url ? (l(), d("audio", {
1700
1726
  key: 1,
1701
1727
  src: r.url,
1702
1728
  controls: "",
1703
1729
  preload: "metadata"
1704
- }, null, 8, Hn)) : s.kind === "video" && r.url ? (l(), d("video", {
1730
+ }, null, 8, zn)) : s.kind === "video" && r.url ? (l(), d("video", {
1705
1731
  key: 2,
1706
1732
  src: r.url,
1707
1733
  controls: "",
1708
1734
  preload: "metadata"
1709
- }, null, 8, zn)) : (l(), d("a", {
1735
+ }, null, 8, Vn)) : (l(), d("a", {
1710
1736
  key: 3,
1711
1737
  class: "wm-att__file",
1712
1738
  href: r.url || "#",
@@ -1731,33 +1757,33 @@ function Yn(t, e, n, a, r, s) {
1731
1757
  i("path", { d: "M14 2v6h6" })
1732
1758
  ])
1733
1759
  ], -1)),
1734
- i("span", qn, [
1735
- i("span", Wn, b(s.displayName), 1),
1760
+ i("span", Wn, [
1761
+ i("span", Kn, b(s.displayName), 1),
1736
1762
  s.sizeLabel ? (l(), d("span", Gn, b(s.sizeLabel), 1)) : w("", !0)
1737
1763
  ]),
1738
- r.loading ? (l(), d("span", Kn)) : w("", !0)
1739
- ], 8, Vn))
1764
+ r.loading ? (l(), d("span", Yn)) : w("", !0)
1765
+ ], 8, qn))
1740
1766
  ], 2);
1741
1767
  }
1742
- const Jn = /* @__PURE__ */ B(Dn, [["render", Yn], ["__scopeId", "data-v-1cd1267b"]]);
1743
- function Xn(t) {
1768
+ const Xn = /* @__PURE__ */ B(Nn, [["render", Jn], ["__scopeId", "data-v-1cd1267b"]]);
1769
+ function Qn(t) {
1744
1770
  return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
1745
1771
  }
1746
- function Qn(t) {
1772
+ function Zn(t) {
1747
1773
  return /^(https?:\/\/|mailto:|tel:)/i.test(String(t).trim());
1748
1774
  }
1749
- const _e = "";
1750
- function te(t) {
1775
+ const pe = "";
1776
+ function re(t) {
1751
1777
  let e = t;
1752
1778
  const n = [];
1753
1779
  return e = e.replace(/`([^`\n]+)`/g, (a, r) => {
1754
1780
  const s = n.length;
1755
- return n.push(r), `${_e}CODE${s}${_e}`;
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;
1781
+ return n.push(r), `${pe}CODE${s}${pe}`;
1782
+ }), e = e.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (a, r, s) => Zn(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
1783
  }
1758
- function Zn(t) {
1784
+ function es(t) {
1759
1785
  if (!t) return "";
1760
- const e = Xn(t).split(`
1786
+ const e = Qn(t).split(`
1761
1787
  `), n = [];
1762
1788
  let a = 0;
1763
1789
  for (; a < e.length; ) {
@@ -1781,20 +1807,20 @@ function Zn(t) {
1781
1807
  if (!S) break;
1782
1808
  k.push(S[1]), a++;
1783
1809
  }
1784
- const y = k.map((S) => `<li>${te(S)}</li>`).join("");
1785
- n.push({ type: "block", html: `<ul class="wm-md-ul">${y}</ul>` });
1810
+ const g = k.map((S) => `<li>${re(S)}</li>`).join("");
1811
+ n.push({ type: "block", html: `<ul class="wm-md-ul">${g}</ul>` });
1786
1812
  continue;
1787
1813
  }
1788
1814
  const c = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1789
1815
  if (c) {
1790
- const k = parseInt(c[1], 10), y = [c[2]];
1816
+ const k = parseInt(c[1], 10), g = [c[2]];
1791
1817
  for (a++; a < e.length; ) {
1792
1818
  const A = /^\s*\d+\.\s+(.*)$/.exec(e[a]);
1793
1819
  if (!A) break;
1794
- y.push(A[1]), a++;
1820
+ g.push(A[1]), a++;
1795
1821
  }
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>` });
1822
+ const S = g.map((A) => `<li>${re(A)}</li>`).join(""), R = k !== 1 ? ` start="${k}"` : "";
1823
+ n.push({ type: "block", html: `<ol class="wm-md-ol"${R}>${S}</ol>` });
1798
1824
  continue;
1799
1825
  }
1800
1826
  const v = /^(#{1,6})\s+(.*)$/.exec(s);
@@ -1802,11 +1828,11 @@ function Zn(t) {
1802
1828
  const k = v[1].length;
1803
1829
  n.push({
1804
1830
  type: "block",
1805
- html: `<h${k} class="wm-md-h wm-md-h${k}">${te(v[2])}</h${k}>`
1831
+ html: `<h${k} class="wm-md-h wm-md-h${k}">${re(v[2])}</h${k}>`
1806
1832
  }), a++;
1807
1833
  continue;
1808
1834
  }
1809
- n.push({ type: "text", html: te(s) }), a++;
1835
+ n.push({ type: "text", html: re(s) }), a++;
1810
1836
  }
1811
1837
  let r = "";
1812
1838
  for (let s = 0; s < n.length; s++) {
@@ -1818,7 +1844,7 @@ function Zn(t) {
1818
1844
  }
1819
1845
  return r;
1820
1846
  }
1821
- const es = {
1847
+ const ts = {
1822
1848
  name: "WmBubble",
1823
1849
  props: {
1824
1850
  role: { type: String, default: "ai" },
@@ -1827,41 +1853,41 @@ const es = {
1827
1853
  },
1828
1854
  computed: {
1829
1855
  rendered() {
1830
- return Zn(this.text);
1856
+ return es(this.text);
1831
1857
  }
1832
1858
  }
1833
- }, ts = ["innerHTML"];
1834
- function ns(t, e, n, a, r, s) {
1859
+ }, ns = ["innerHTML"];
1860
+ function ss(t, e, n, a, r, s) {
1835
1861
  return l(), d("div", {
1836
1862
  class: E(["wm-bubble", "wm-bubble--" + n.role])
1837
1863
  }, [
1838
1864
  Te(t.$slots, "default", {}, () => [
1839
- i("span", { innerHTML: s.rendered }, null, 8, ts)
1865
+ i("span", { innerHTML: s.rendered }, null, 8, ns)
1840
1866
  ], !0)
1841
1867
  ], 2);
1842
1868
  }
1843
- const ss = /* @__PURE__ */ B(es, [["render", ns], ["__scopeId", "data-v-5c9e9f2b"]]), rs = { name: "WmTyping" }, is = { class: "wm-typing" };
1844
- function as(t, e, n, a, r, s) {
1845
- return l(), d("div", is, [...e[0] || (e[0] = [
1869
+ const rs = /* @__PURE__ */ B(ts, [["render", ss], ["__scopeId", "data-v-5c9e9f2b"]]), is = { name: "WmTyping" }, as = { class: "wm-typing" };
1870
+ function os(t, e, n, a, r, s) {
1871
+ return l(), d("div", as, [...e[0] || (e[0] = [
1846
1872
  i("span", { style: { "animation-delay": "0s" } }, null, -1),
1847
1873
  i("span", { style: { "animation-delay": "0.2s" } }, null, -1),
1848
1874
  i("span", { style: { "animation-delay": "0.4s" } }, null, -1)
1849
1875
  ])]);
1850
1876
  }
1851
- const os = /* @__PURE__ */ B(rs, [["render", as], ["__scopeId", "data-v-df2447fd"]]);
1852
- function ne(t) {
1877
+ const ls = /* @__PURE__ */ B(is, [["render", os], ["__scopeId", "data-v-df2447fd"]]);
1878
+ function Z(t) {
1853
1879
  return t ? t.client_msg_id || t.id : "";
1854
1880
  }
1855
- const ls = {
1881
+ const cs = {
1856
1882
  transferred_to_human: "Conversation transférée à un humain",
1857
1883
  assigned: "{name} a rejoint la conversation",
1858
1884
  unassigned: "L'agent a quitté la conversation",
1859
1885
  resolved: "Conversation résolue",
1860
1886
  reopened: "Conversation rouverte",
1861
1887
  idle: "Conversation en pause"
1862
- }, cs = 80, ds = 200, us = {
1888
+ }, ds = 80, us = 200, hs = {
1863
1889
  name: "WmMessageList",
1864
- components: { AIAvatar: Q, HumanAvatar: ke, Bubble: ss, Typing: os, ActionResult: Qt, AttachmentPreview: Jn, ArtifactRenderer: Un },
1890
+ components: { AIAvatar: te, HumanAvatar: ke, Bubble: rs, Typing: ls, ActionResult: Qt, AttachmentPreview: Xn, ArtifactRenderer: Dn },
1865
1891
  props: {
1866
1892
  messages: { type: Array, default: () => [] },
1867
1893
  streamingActive: { type: Boolean, default: !1 },
@@ -1886,7 +1912,14 @@ const ls = {
1886
1912
  // window after, suppressing the per-row fade-up animation so
1887
1913
  // a freshly prepended history page doesn't visibly flicker
1888
1914
  // in 50-at-once.
1889
- silentFades: !1
1915
+ silentFades: !1,
1916
+ // Largeur rendue (px) de la moitié visible de chaque item
1917
+ // d'un cluster, indexée par `${messageKey}-${partKey}`.
1918
+ // Alimentée post-render par `measureRows()` et consommée
1919
+ // par `cornersFor()` pour décider du rétractement des coins
1920
+ // intérieurs. Avant la première mesure, `cornersFor` retombe
1921
+ // sur la convention kind-based (`card` > `bubble`).
1922
+ widthByKey: Object.freeze({})
1890
1923
  };
1891
1924
  },
1892
1925
  computed: {
@@ -1902,7 +1935,7 @@ const ls = {
1902
1935
  if (((e = s == null ? void 0 : s.payload) == null ? void 0 : e.event) === "action_admin_pending") {
1903
1936
  const k = t[t.length - 1];
1904
1937
  k && k.role === "ai" ? k.messages.push(s) : t.push({
1905
- key: `g-${ne(s)}`,
1938
+ key: `g-${Z(s)}`,
1906
1939
  role: "ai",
1907
1940
  agentName: "",
1908
1941
  agentAvatarUrl: null,
@@ -1912,7 +1945,7 @@ const ls = {
1912
1945
  continue;
1913
1946
  }
1914
1947
  t.push({
1915
- key: `sys-${ne(s)}`,
1948
+ key: `sys-${Z(s)}`,
1916
1949
  role: o,
1917
1950
  messages: [s],
1918
1951
  items: [],
@@ -1922,7 +1955,7 @@ const ls = {
1922
1955
  }
1923
1956
  const c = t[t.length - 1];
1924
1957
  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)}`,
1958
+ key: `g-${Z(s)}`,
1926
1959
  role: o,
1927
1960
  agentName: ((a = s == null ? void 0 : s.author) == null ? void 0 : a.name) || "",
1928
1961
  agentAvatarUrl: ((r = s == null ? void 0 : s.author) == null ? void 0 : r.avatar_url) || null,
@@ -1963,16 +1996,23 @@ const ls = {
1963
1996
  streamingActive: "snapshotAndRestore"
1964
1997
  },
1965
1998
  mounted() {
1966
- this._lastSeenConvId = this.conversationId, this.scrollToBottom();
1999
+ 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());
2000
+ },
2001
+ beforeUnmount() {
2002
+ var t;
2003
+ (t = this._ro) == null || t.disconnect(), this._measureFrame && cancelAnimationFrame(this._measureFrame), clearTimeout(this._silenceTimer);
2004
+ },
2005
+ updated() {
2006
+ this.scheduleMeasure();
1967
2007
  },
1968
2008
  methods: {
1969
- messageKey: ne,
2009
+ messageKey: Z,
1970
2010
  isAtBottom(t) {
1971
- return t.scrollHeight - t.scrollTop - t.clientHeight <= cs;
2011
+ return t.scrollHeight - t.scrollTop - t.clientHeight <= ds;
1972
2012
  },
1973
2013
  onScroll() {
1974
2014
  const t = this.$refs.scrollEl;
1975
- t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= ds && (this._pendingLoadMore = !0, this.$emit("load-more")));
2015
+ t && (this.loadingMore || !this.hasMore || this._pendingLoadMore || t.scrollTop <= us && (this._pendingLoadMore = !0, this.$emit("load-more")));
1976
2016
  },
1977
2017
  // Capture pre-patch scroll state and restore it on the next tick.
1978
2018
  //
@@ -2147,10 +2187,10 @@ const ls = {
2147
2187
  // adjacent à une `bubble`) : mon coin déborde le voisin et
2148
2188
  // doit garder son arrondi.
2149
2189
  cornersFor(t, e) {
2150
- var N, F, P;
2151
- 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, W) => q === W || q === "card" && W === "bubble";
2152
- let $ = c, A = c, D = c, x = c;
2153
- 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 };
2190
+ var Y, H, J;
2191
+ 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";
2192
+ let D = c, F = c, N = c, V = c;
2193
+ 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 };
2154
2194
  },
2155
2195
  // Inline style emitting the four corner CSS variables. Set on
2156
2196
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -2166,6 +2206,48 @@ const ls = {
2166
2206
  "--wm-r-bl": `${n.bl}px`
2167
2207
  };
2168
2208
  },
2209
+ // Clé unique par item de cluster, alignée avec `:key` /
2210
+ // `data-row-key` du template. Sert d'index dans `widthByKey`.
2211
+ rowKeyOf(t, e) {
2212
+ var a;
2213
+ const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a[e];
2214
+ return n ? `${Z(n.message)}-${n.partKey}` : "";
2215
+ },
2216
+ // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
2217
+ // typing, scroll), un seul flush layout par frame suffit.
2218
+ scheduleMeasure() {
2219
+ this._measureFrame || (this._measureFrame = requestAnimationFrame(() => {
2220
+ this._measureFrame = null, this.measureRows();
2221
+ }));
2222
+ },
2223
+ // Mesure la largeur RENDUE de la moitié visible de chaque row,
2224
+ // l'écrit dans `widthByKey`. Vue ré-évalue alors `cornersFor`
2225
+ // sur les rows impactées. Shallow-diff strict (tolérance 0.5px
2226
+ // sub-pixel) pour ne pas relancer `updated()` à vide.
2227
+ measureRows() {
2228
+ const t = this.$refs.scrollEl;
2229
+ if (!t) return;
2230
+ const e = {};
2231
+ for (const s of t.querySelectorAll(".wm-list__row[data-row-key]")) {
2232
+ const o = s.dataset.rowKey;
2233
+ if (!o) continue;
2234
+ const c = s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");
2235
+ if (!c) continue;
2236
+ const v = c.getBoundingClientRect().width;
2237
+ v > 0 && (e[o] = v);
2238
+ }
2239
+ const n = this.widthByKey, a = Object.keys(n), r = Object.keys(e);
2240
+ if (a.length === r.length) {
2241
+ let s = !0;
2242
+ for (const o of r)
2243
+ if (Math.abs((n[o] ?? 0) - e[o]) > 0.5) {
2244
+ s = !1;
2245
+ break;
2246
+ }
2247
+ if (s) return;
2248
+ }
2249
+ this.widthByKey = Object.freeze(e);
2250
+ },
2169
2251
  lastTimeOf(t) {
2170
2252
  const e = t.messages[t.messages.length - 1];
2171
2253
  if (!(e != null && e.created_at)) return "";
@@ -2205,7 +2287,7 @@ const ls = {
2205
2287
  },
2206
2288
  systemLabel(t) {
2207
2289
  var r, s, o;
2208
- const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = ls[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2290
+ const e = (r = t == null ? void 0 : t.payload) == null ? void 0 : r.event, n = cs[e] || (t == null ? void 0 : t.text_md) || "Mise à jour de la conversation", a = ((s = t == null ? void 0 : t.metadata) == null ? void 0 : s.agent_name) || ((o = t == null ? void 0 : t.author) == null ? void 0 : o.name) || "";
2209
2291
  return n.replace("{name}", a || "Un agent");
2210
2292
  },
2211
2293
  scrollToBottom() {
@@ -2213,59 +2295,59 @@ const ls = {
2213
2295
  t && (t.scrollTop = t.scrollHeight);
2214
2296
  }
2215
2297
  }
2216
- }, hs = {
2298
+ }, ms = {
2217
2299
  key: 0,
2218
2300
  class: "wm-list__loadMore",
2219
2301
  role: "status",
2220
2302
  "aria-live": "polite"
2221
- }, ms = {
2303
+ }, fs = {
2222
2304
  key: 1,
2223
2305
  class: "wm-list__historyEnd"
2224
- }, fs = {
2306
+ }, _s = {
2225
2307
  key: 2,
2226
2308
  class: "wm-list__sep"
2227
- }, ps = { class: "wm-list__sep-label" }, _s = {
2309
+ }, ps = { class: "wm-list__sep-label" }, vs = {
2228
2310
  key: 0,
2229
2311
  class: "wm-list__sep wm-list__sep--unread"
2230
- }, vs = {
2312
+ }, ys = {
2231
2313
  key: 0,
2232
2314
  class: "wm-list__sysep"
2233
- }, gs = { class: "wm-list__sysep-label" }, ys = {
2315
+ }, gs = { class: "wm-list__sysep-label" }, ws = ["data-row-key"], bs = {
2234
2316
  key: 0,
2235
2317
  class: "wm-list__avatarSlot"
2236
- }, ws = {
2318
+ }, ks = {
2237
2319
  key: 5,
2238
2320
  class: "wm-list__body"
2239
- }, bs = { key: 0 }, ks = {
2321
+ }, Cs = { key: 0 }, As = {
2240
2322
  key: 1,
2241
2323
  "aria-hidden": "true"
2242
- }, Cs = { key: 2 }, As = {
2324
+ }, Ss = { key: 2 }, xs = {
2243
2325
  key: 3,
2244
2326
  class: "wm-list__row wm-list__row--ai fade-up"
2245
- }, Ss = { class: "wm-list__avatarSlot" };
2246
- function xs(t, e, n, a, r, s) {
2247
- const o = O("AIAvatar"), c = O("HumanAvatar"), v = O("ActionResult"), k = O("ArtifactRenderer"), y = O("Bubble"), S = O("AttachmentPreview"), $ = O("Typing");
2327
+ }, Ms = { class: "wm-list__avatarSlot" };
2328
+ function Ts(t, e, n, a, r, s) {
2329
+ const o = I("AIAvatar"), c = I("HumanAvatar"), v = I("ActionResult"), k = I("ArtifactRenderer"), g = I("Bubble"), S = I("AttachmentPreview"), R = I("Typing");
2248
2330
  return l(), d("div", {
2249
2331
  ref: "scrollEl",
2250
2332
  class: E(["wm-list", { "wm-list--silent": r.silentFades }]),
2251
2333
  onScrollPassive: e[0] || (e[0] = (...A) => s.onScroll && s.onScroll(...A))
2252
2334
  }, [
2253
- n.loadingMore ? (l(), d("div", hs, [...e[1] || (e[1] = [
2335
+ n.loadingMore ? (l(), d("div", ms, [...e[1] || (e[1] = [
2254
2336
  i("span", {
2255
2337
  class: "wm-list__loadMore-spinner",
2256
2338
  "aria-hidden": "true"
2257
2339
  }, null, -1),
2258
2340
  i("span", { class: "wm-list__loadMore-lbl" }, "Chargement de l'historique…", -1)
2259
- ])])) : s.historyExhausted ? (l(), d("div", ms, "Début de la conversation")) : w("", !0),
2260
- n.dateLabel ? (l(), d("div", fs, [
2341
+ ])])) : s.historyExhausted ? (l(), d("div", fs, "Début de la conversation")) : w("", !0),
2342
+ n.dateLabel ? (l(), d("div", _s, [
2261
2343
  e[2] || (e[2] = i("div", { class: "wm-list__line" }, null, -1)),
2262
2344
  i("span", ps, b(n.dateLabel), 1),
2263
2345
  e[3] || (e[3] = i("div", { class: "wm-list__line" }, null, -1))
2264
2346
  ])) : w("", !0),
2265
- (l(!0), d(M, null, j(s.groups, (A, D) => (l(), d(M, {
2347
+ (l(!0), d(M, null, j(s.groups, (A, P) => (l(), d(M, {
2266
2348
  key: A.key
2267
2349
  }, [
2268
- A.key === s.unreadGroupKey ? (l(), d("div", _s, [...e[4] || (e[4] = [
2350
+ A.key === s.unreadGroupKey ? (l(), d("div", vs, [...e[4] || (e[4] = [
2269
2351
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1),
2270
2352
  i("span", { class: "wm-list__sep-label wm-list__sep-label--unread" }, "Non lus", -1),
2271
2353
  i("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)
@@ -2273,23 +2355,24 @@ function xs(t, e, n, a, r, s) {
2273
2355
  i("div", {
2274
2356
  class: E(["wm-list__group", "wm-list__group--" + A.role])
2275
2357
  }, [
2276
- A.role === "system" ? (l(), d("div", vs, [
2358
+ A.role === "system" ? (l(), d("div", ys, [
2277
2359
  e[5] || (e[5] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1)),
2278
2360
  i("span", gs, b(A.systemLabel), 1),
2279
2361
  e[6] || (e[6] = i("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
2280
2362
  ])) : (l(), d(M, { key: 1 }, [
2281
- (l(!0), d(M, null, j(A.items, (x, N) => (l(), d("div", {
2363
+ (l(!0), d(M, null, j(A.items, (x, D) => (l(), d("div", {
2282
2364
  key: `${s.messageKey(x.message)}-${x.partKey}`,
2365
+ "data-row-key": `${s.messageKey(x.message)}-${x.partKey}`,
2283
2366
  class: E(["wm-list__row fade-up", ["wm-list__row--" + A.role, { "is-pending": x.message._pending, "is-failed": x.message._failed }]]),
2284
- style: V(s.cornersStyle(A, N))
2367
+ style: G(s.cornersStyle(A, D))
2285
2368
  }, [
2286
- A.role !== "user" ? (l(), d("div", ys, [
2287
- N === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2288
- A.role === "ai" ? (l(), R(o, {
2369
+ A.role !== "user" ? (l(), d("div", bs, [
2370
+ D === A.items.length - 1 ? (l(), d(M, { key: 0 }, [
2371
+ A.role === "ai" ? (l(), $(o, {
2289
2372
  key: 0,
2290
2373
  size: 26,
2291
2374
  tail: !0
2292
- })) : (l(), R(c, {
2375
+ })) : (l(), $(c, {
2293
2376
  key: 1,
2294
2377
  name: A.agentName,
2295
2378
  "avatar-url": A.agentAvatarUrl,
@@ -2297,24 +2380,24 @@ function xs(t, e, n, a, r, s) {
2297
2380
  }, null, 8, ["name", "avatar-url"]))
2298
2381
  ], 64)) : w("", !0)
2299
2382
  ])) : w("", !0),
2300
- x.renderAs === "action" ? (l(), R(v, {
2383
+ x.renderAs === "action" ? (l(), $(v, {
2301
2384
  key: 1,
2302
2385
  state: x.message.payload.state,
2303
2386
  label: s.actionLabel(x.message),
2304
2387
  detail: s.actionDetail(x.message)
2305
- }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), R(v, {
2388
+ }, null, 8, ["state", "label", "detail"])) : x.renderAs === "admin-pending" ? (l(), $(v, {
2306
2389
  key: 2,
2307
2390
  state: "awaiting",
2308
2391
  label: "Demande d'approbation envoyée",
2309
2392
  detail: x.message.text_md || ""
2310
- }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), R(k, {
2393
+ }, null, 8, ["detail"])) : x.renderAs === "artifact-of-action" ? (l(), $(k, {
2311
2394
  key: 3,
2312
2395
  artifact: s.actionArtifact(x.message)
2313
- }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), R(k, {
2396
+ }, null, 8, ["artifact"])) : x.renderAs === "artifact" ? (l(), $(k, {
2314
2397
  key: 4,
2315
2398
  artifact: s.artifactOf(x.message)
2316
- }, null, 8, ["artifact"])) : (l(), d("div", ws, [
2317
- x.message.text_md ? (l(), R(y, {
2399
+ }, null, 8, ["artifact"])) : (l(), d("div", ks, [
2400
+ x.message.text_md ? (l(), $(g, {
2318
2401
  key: 0,
2319
2402
  role: A.role,
2320
2403
  text: x.message.text_md
@@ -2323,37 +2406,37 @@ function xs(t, e, n, a, r, s) {
2323
2406
  key: 1,
2324
2407
  class: E(["wm-list__atts", { "wm-list__atts--align-end": A.role === "user" }])
2325
2408
  }, [
2326
- (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, P) => (l(), R(S, {
2327
- key: `${s.messageKey(x.message)}-att-${P}`,
2409
+ (l(!0), d(M, null, j(s.attachmentsOf(x.message), (F, N) => (l(), $(S, {
2410
+ key: `${s.messageKey(x.message)}-att-${N}`,
2328
2411
  attachment: F
2329
2412
  }, null, 8, ["attachment"]))), 128))
2330
2413
  ], 2)) : w("", !0)
2331
2414
  ]))
2332
- ], 6))), 128)),
2415
+ ], 14, ws))), 128)),
2333
2416
  A.role !== "user" || s.lastTimeOf(A) ? (l(), d("div", {
2334
2417
  key: 0,
2335
2418
  class: E(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
2336
2419
  }, [
2337
- A.role !== "user" ? (l(), d("span", bs, b(s.roleLabel(A)), 1)) : w("", !0),
2338
- A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", ks, "·")) : w("", !0),
2339
- s.lastTimeOf(A) ? (l(), d("span", Cs, b(s.lastTimeOf(A)), 1)) : w("", !0)
2420
+ A.role !== "user" ? (l(), d("span", Cs, b(s.roleLabel(A)), 1)) : w("", !0),
2421
+ A.role !== "user" && s.lastTimeOf(A) ? (l(), d("span", As, "·")) : w("", !0),
2422
+ s.lastTimeOf(A) ? (l(), d("span", Ss, b(s.lastTimeOf(A)), 1)) : w("", !0)
2340
2423
  ], 2)) : w("", !0)
2341
2424
  ], 64))
2342
2425
  ], 2)
2343
2426
  ], 64))), 128)),
2344
- n.streamingActive ? (l(), d("div", As, [
2345
- i("div", Ss, [
2346
- z(o, {
2427
+ n.streamingActive ? (l(), d("div", xs, [
2428
+ i("div", Ms, [
2429
+ K(o, {
2347
2430
  size: 26,
2348
2431
  tail: !0
2349
2432
  })
2350
2433
  ]),
2351
- z($)
2434
+ K(R)
2352
2435
  ])) : w("", !0)
2353
2436
  ], 34);
2354
2437
  }
2355
- const Ms = /* @__PURE__ */ B(us, [["render", xs], ["__scopeId", "data-v-0e691378"]]), se = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2356
- function Ts() {
2438
+ const Os = /* @__PURE__ */ B(hs, [["render", Ts], ["__scopeId", "data-v-3955655c"]]), ie = typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function", he = typeof window < "u" && typeof window.MediaRecorder < "u";
2439
+ function Is() {
2357
2440
  return he && [
2358
2441
  "video/webm;codecs=vp9,opus",
2359
2442
  "video/webm;codecs=vp8,opus",
@@ -2373,11 +2456,11 @@ function Ce({ audio: t }) {
2373
2456
  systemAudio: t ? "include" : "exclude"
2374
2457
  };
2375
2458
  }
2376
- function Ni(t) {
2459
+ function Hi(t) {
2377
2460
  return t ? t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : "file" : "file";
2378
2461
  }
2379
- async function Is() {
2380
- if (!se) return null;
2462
+ async function Es() {
2463
+ if (!ie) return null;
2381
2464
  let t;
2382
2465
  try {
2383
2466
  t = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !1 }));
@@ -2385,7 +2468,7 @@ async function Is() {
2385
2468
  return (e == null ? void 0 : e.name) !== "NotAllowedError" && console.error("[media] screenshot picker", e), null;
2386
2469
  }
2387
2470
  try {
2388
- return await Os(t);
2471
+ return await Bs(t);
2389
2472
  } catch (e) {
2390
2473
  return console.error("[media] screenshot capture", e), null;
2391
2474
  } finally {
@@ -2394,7 +2477,7 @@ async function Is() {
2394
2477
  });
2395
2478
  }
2396
2479
  }
2397
- async function Os(t) {
2480
+ async function Bs(t) {
2398
2481
  const e = document.createElement("video");
2399
2482
  e.muted = !0, e.playsInline = !0, e.srcObject = t, await e.play(), await new Promise((c) => requestAnimationFrame(c));
2400
2483
  const n = e.videoWidth || 1280, a = e.videoHeight || 720, r = document.createElement("canvas");
@@ -2404,60 +2487,60 @@ async function Os(t) {
2404
2487
  }), o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
2405
2488
  return new File([s], `capture-${o}.png`, { type: "image/png" });
2406
2489
  }
2407
- async function Es(t = {}) {
2490
+ async function Ls(t = {}) {
2408
2491
  var k;
2409
- if (!se || !he) return null;
2492
+ if (!ie || !he) return null;
2410
2493
  let e;
2411
2494
  try {
2412
2495
  e = await navigator.mediaDevices.getDisplayMedia(Ce({ audio: !0 }));
2413
- } catch (y) {
2414
- return (y == null ? void 0 : y.name) !== "NotAllowedError" && console.error("[media] record picker", y), null;
2496
+ } catch (g) {
2497
+ return (g == null ? void 0 : g.name) !== "NotAllowedError" && console.error("[media] record picker", g), null;
2415
2498
  }
2416
- const n = Ts();
2499
+ const n = Is();
2417
2500
  let a;
2418
2501
  try {
2419
2502
  a = n ? new window.MediaRecorder(e, { mimeType: n }) : new window.MediaRecorder(e);
2420
- } catch (y) {
2421
- return console.error("[media] recorder init", y), e.getTracks().forEach((S) => {
2503
+ } catch (g) {
2504
+ return console.error("[media] recorder init", g), e.getTracks().forEach((S) => {
2422
2505
  S.stop();
2423
2506
  }), null;
2424
2507
  }
2425
2508
  const r = [];
2426
2509
  let s = null, o = !1;
2427
- a.addEventListener("dataavailable", (y) => {
2428
- y.data && y.data.size > 0 && r.push(y.data);
2510
+ a.addEventListener("dataavailable", (g) => {
2511
+ g.data && g.data.size > 0 && r.push(g.data);
2429
2512
  }), a.addEventListener("stop", () => {
2430
- var y, S;
2431
- if (s && clearInterval(s), e.getTracks().forEach(($) => {
2432
- $.stop();
2513
+ var g, S;
2514
+ if (s && clearInterval(s), e.getTracks().forEach((R) => {
2515
+ R.stop();
2433
2516
  }), r.length) {
2434
- 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: $ });
2435
- (y = t.onfinalize) == null || y.call(t, N);
2517
+ 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 });
2518
+ (g = t.onfinalize) == null || g.call(t, D);
2436
2519
  } else
2437
2520
  (S = t.oncancel) == null || S.call(t);
2438
- }), e.getVideoTracks().forEach((y) => {
2439
- y.addEventListener("ended", () => c(), { once: !0 });
2521
+ }), e.getVideoTracks().forEach((g) => {
2522
+ g.addEventListener("ended", () => c(), { once: !0 });
2440
2523
  });
2441
2524
  function c() {
2442
2525
  if (!o && (o = !0, a.state !== "inactive"))
2443
2526
  try {
2444
2527
  a.stop();
2445
- } catch (y) {
2446
- console.error("[media] recorder stop", y);
2528
+ } catch (g) {
2529
+ console.error("[media] recorder stop", g);
2447
2530
  }
2448
2531
  }
2449
2532
  try {
2450
2533
  a.start(1e3);
2451
- } catch (y) {
2452
- return console.error("[media] recorder start", y), e.getTracks().forEach((S) => {
2534
+ } catch (g) {
2535
+ return console.error("[media] recorder start", g), e.getTracks().forEach((S) => {
2453
2536
  S.stop();
2454
2537
  }), null;
2455
2538
  }
2456
2539
  (k = t.onstart) == null || k.call(t);
2457
2540
  const v = Date.now();
2458
2541
  return s = setInterval(() => {
2459
- var y;
2460
- (y = t.ontick) == null || y.call(t, Date.now() - v);
2542
+ var g;
2543
+ (g = t.ontick) == null || g.call(t, Date.now() - v);
2461
2544
  }, 500), {
2462
2545
  stop: c,
2463
2546
  get state() {
@@ -2465,7 +2548,7 @@ async function Es(t = {}) {
2465
2548
  }
2466
2549
  };
2467
2550
  }
2468
- const Bs = [
2551
+ const $s = [
2469
2552
  {
2470
2553
  action: "file",
2471
2554
  label: "Joindre un fichier",
@@ -2481,7 +2564,7 @@ const Bs = [
2481
2564
  label: "Enregistrer l'écran",
2482
2565
  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"
2483
2566
  }
2484
- ], Ls = {
2567
+ ], Rs = {
2485
2568
  name: "WmComposer",
2486
2569
  props: {
2487
2570
  modelValue: { type: String, default: "" },
@@ -2504,9 +2587,9 @@ const Bs = [
2504
2587
  return !this.disabled && !!this.local.trim();
2505
2588
  },
2506
2589
  attachItems() {
2507
- return Bs.map((t) => ({
2590
+ return $s.map((t) => ({
2508
2591
  ...t,
2509
- disabled: t.action === "screenshot" && !se || t.action === "record" && (!se || !he)
2592
+ disabled: t.action === "screenshot" && !ie || t.action === "record" && (!ie || !he)
2510
2593
  }));
2511
2594
  },
2512
2595
  recordingElapsedLabel() {
@@ -2576,13 +2659,13 @@ const Bs = [
2576
2659
  },
2577
2660
  async captureScreenshot() {
2578
2661
  if (this.disabled) return;
2579
- const t = await Is();
2662
+ const t = await Es();
2580
2663
  t && this.$emit("attach", t);
2581
2664
  },
2582
2665
  async startRecording() {
2583
2666
  if (this.recording || this.disabled) return;
2584
2667
  this.recordingElapsed = 0;
2585
- const t = await Es({
2668
+ const t = await Ls({
2586
2669
  onstart: () => {
2587
2670
  this.recording = !0;
2588
2671
  },
@@ -2607,27 +2690,27 @@ const Bs = [
2607
2690
  }
2608
2691
  }
2609
2692
  }
2610
- }, Rs = { class: "wm-compose-wrap" }, $s = {
2693
+ }, Fs = { class: "wm-compose-wrap" }, js = {
2611
2694
  key: 0,
2612
2695
  class: "wm-rec"
2613
- }, Fs = { class: "wm-rec__lbl" }, js = {
2696
+ }, Us = { class: "wm-rec__lbl" }, Ds = {
2614
2697
  key: 1,
2615
2698
  class: "wm-compose__menu",
2616
2699
  role: "menu"
2617
- }, Us = ["disabled", "onClick"], Ds = { class: "wm-compose__menuIcon" }, Ns = {
2700
+ }, Ns = ["disabled", "onClick"], Ps = { class: "wm-compose__menuIcon" }, Hs = {
2618
2701
  viewBox: "0 0 24 24",
2619
2702
  width: "14",
2620
2703
  height: "14",
2621
2704
  "aria-hidden": "true"
2622
- }, Ps = ["d"], Hs = ["placeholder", "disabled"], zs = { class: "wm-compose__actions" }, Vs = ["title", "aria-label", "disabled"], qs = ["disabled"];
2623
- function Ws(t, e, n, a, r, s) {
2624
- return l(), d("div", Rs, [
2625
- r.recording ? (l(), d("div", $s, [
2705
+ }, zs = ["d"], Vs = ["placeholder", "disabled"], qs = { class: "wm-compose__actions" }, Ws = ["title", "aria-label", "disabled"], Ks = ["disabled"];
2706
+ function Gs(t, e, n, a, r, s) {
2707
+ return l(), d("div", Fs, [
2708
+ r.recording ? (l(), d("div", js, [
2626
2709
  e[8] || (e[8] = i("span", {
2627
2710
  class: "wm-rec__dot",
2628
2711
  "aria-hidden": "true"
2629
2712
  }, null, -1)),
2630
- i("span", Fs, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2713
+ i("span", Us, "Enregistrement · " + b(s.recordingElapsedLabel), 1),
2631
2714
  i("button", {
2632
2715
  type: "button",
2633
2716
  class: "wm-rec__stop",
@@ -2636,7 +2719,7 @@ function Ws(t, e, n, a, r, s) {
2636
2719
  ])) : w("", !0),
2637
2720
  i("form", {
2638
2721
  class: E(["wm-compose", { "has-attach": r.attachOpen }]),
2639
- onSubmit: e[7] || (e[7] = X((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2722
+ onSubmit: e[7] || (e[7] = ee((...o) => s.onSubmit && s.onSubmit(...o), ["prevent"]))
2640
2723
  }, [
2641
2724
  i("input", {
2642
2725
  ref: "fileEl",
@@ -2650,7 +2733,7 @@ function Ws(t, e, n, a, r, s) {
2650
2733
  class: "wm-compose__overlay",
2651
2734
  onClick: e[2] || (e[2] = (o) => r.attachOpen = !1)
2652
2735
  })) : w("", !0),
2653
- r.attachOpen ? (l(), d("div", js, [
2736
+ r.attachOpen ? (l(), d("div", Ds, [
2654
2737
  (l(!0), d(M, null, j(s.attachItems, (o) => (l(), d("button", {
2655
2738
  key: o.action,
2656
2739
  type: "button",
@@ -2658,8 +2741,8 @@ function Ws(t, e, n, a, r, s) {
2658
2741
  disabled: o.disabled,
2659
2742
  onClick: (c) => s.onAttachAction(o.action)
2660
2743
  }, [
2661
- i("span", Ds, [
2662
- (l(), d("svg", Ns, [
2744
+ i("span", Ps, [
2745
+ (l(), d("svg", Hs, [
2663
2746
  i("path", {
2664
2747
  d: o.path,
2665
2748
  stroke: "currentColor",
@@ -2667,13 +2750,13 @@ function Ws(t, e, n, a, r, s) {
2667
2750
  "stroke-linecap": "round",
2668
2751
  "stroke-linejoin": "round",
2669
2752
  fill: "none"
2670
- }, null, 8, Ps)
2753
+ }, null, 8, zs)
2671
2754
  ]))
2672
2755
  ]),
2673
2756
  i("span", null, b(o.label), 1)
2674
- ], 8, Us))), 128))
2757
+ ], 8, Ns))), 128))
2675
2758
  ])) : w("", !0),
2676
- H(i("textarea", {
2759
+ W(i("textarea", {
2677
2760
  ref: "inputEl",
2678
2761
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.local = o),
2679
2762
  class: "wm-compose__input",
@@ -2682,10 +2765,10 @@ function Ws(t, e, n, a, r, s) {
2682
2765
  disabled: n.disabled,
2683
2766
  onKeydown: e[4] || (e[4] = (...o) => s.onKeydown && s.onKeydown(...o)),
2684
2767
  onInput: e[5] || (e[5] = (...o) => s.autosize && s.autosize(...o))
2685
- }, null, 40, Hs), [
2686
- [Y, r.local]
2768
+ }, null, 40, Vs), [
2769
+ [Q, r.local]
2687
2770
  ]),
2688
- i("div", zs, [
2771
+ i("div", qs, [
2689
2772
  i("button", {
2690
2773
  type: "button",
2691
2774
  class: E(["wm-compose__icon", { "is-open": r.attachOpen }]),
@@ -2707,7 +2790,7 @@ function Ws(t, e, n, a, r, s) {
2707
2790
  }, [
2708
2791
  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" })
2709
2792
  ], -1)
2710
- ])], 10, Vs),
2793
+ ])], 10, Ws),
2711
2794
  i("button", {
2712
2795
  type: "submit",
2713
2796
  class: E(["wm-compose__send", { "is-empty": !s.canSend }]),
@@ -2727,12 +2810,12 @@ function Ws(t, e, n, a, r, s) {
2727
2810
  }, [
2728
2811
  i("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
2729
2812
  ], -1)
2730
- ])], 10, qs)
2813
+ ])], 10, Ks)
2731
2814
  ])
2732
2815
  ], 34)
2733
2816
  ]);
2734
2817
  }
2735
- const Gs = /* @__PURE__ */ B(Ls, [["render", Ws], ["__scopeId", "data-v-14fa9ec0"]]), Ks = {
2818
+ const Ys = /* @__PURE__ */ B(Rs, [["render", Gs], ["__scopeId", "data-v-14fa9ec0"]]), Js = {
2736
2819
  name: "WmSuggestionChips",
2737
2820
  props: {
2738
2821
  items: { type: Array, default: () => [] },
@@ -2749,8 +2832,8 @@ const Gs = /* @__PURE__ */ B(Ls, [["render", Ws], ["__scopeId", "data-v-14fa9ec0
2749
2832
  return this.items.map((t) => (t == null ? void 0 : t.label) || (t == null ? void 0 : t.text) || "").join("§");
2750
2833
  }
2751
2834
  }
2752
- }, Ys = ["onClick"];
2753
- function Js(t, e, n, a, r, s) {
2835
+ }, Xs = ["onClick"];
2836
+ function Qs(t, e, n, a, r, s) {
2754
2837
  return n.items.length ? (l(), d("div", {
2755
2838
  key: s.batchKey,
2756
2839
  class: "wm-chips"
@@ -2759,14 +2842,14 @@ function Js(t, e, n, a, r, s) {
2759
2842
  key: c,
2760
2843
  type: "button",
2761
2844
  class: "wm-chip",
2762
- style: V({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2845
+ style: G({ animationDelay: n.baseDelay + c * n.stepDelay + "ms" }),
2763
2846
  onClick: (v) => t.$emit("select", o)
2764
- }, b(o.label), 13, Ys))), 128))
2847
+ }, b(o.label), 13, Xs))), 128))
2765
2848
  ])) : w("", !0);
2766
2849
  }
2767
- const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d"]]), Qs = {
2850
+ const Zs = /* @__PURE__ */ B(Js, [["render", Qs], ["__scopeId", "data-v-55aa529d"]]), er = {
2768
2851
  name: "WmApprovalCard",
2769
- components: { AIAvatar: Q },
2852
+ components: { AIAvatar: te },
2770
2853
  props: {
2771
2854
  action: { type: String, required: !0 },
2772
2855
  detail: { type: String, default: "" },
@@ -2797,23 +2880,23 @@ const Xs = /* @__PURE__ */ B(Ks, [["render", Js], ["__scopeId", "data-v-55aa529d
2797
2880
  return ((t = this.rejectCallback) == null ? void 0 : t.label) || "Refuser";
2798
2881
  }
2799
2882
  }
2800
- }, 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 = {
2883
+ }, tr = { class: "wm-approval" }, nr = { class: "wm-approval__head" }, sr = { class: "wm-approval__icon" }, rr = { class: "wm-approval__main" }, ir = { class: "wm-approval__title" }, ar = {
2801
2884
  key: 0,
2802
2885
  class: "wm-approval__detail"
2803
- }, ir = { class: "wm-approval__actions" };
2804
- function ar(t, e, n, a, r, s) {
2805
- const o = O("AIAvatar");
2806
- return l(), d("div", Zs, [
2807
- i("div", er, [
2808
- i("div", tr, [
2809
- z(o, { size: 24 })
2886
+ }, or = { class: "wm-approval__actions" };
2887
+ function lr(t, e, n, a, r, s) {
2888
+ const o = I("AIAvatar");
2889
+ return l(), d("div", tr, [
2890
+ i("div", nr, [
2891
+ i("div", sr, [
2892
+ K(o, { size: 24 })
2810
2893
  ]),
2811
- i("div", nr, [
2812
- i("div", sr, b(n.action), 1),
2813
- n.detail ? (l(), d("div", rr, b(n.detail), 1)) : w("", !0)
2894
+ i("div", rr, [
2895
+ i("div", ir, b(n.action), 1),
2896
+ n.detail ? (l(), d("div", ar, b(n.detail), 1)) : w("", !0)
2814
2897
  ])
2815
2898
  ]),
2816
- i("div", ir, [
2899
+ i("div", or, [
2817
2900
  s.rejectId ? (l(), d("button", {
2818
2901
  key: 0,
2819
2902
  type: "button",
@@ -2829,9 +2912,9 @@ function ar(t, e, n, a, r, s) {
2829
2912
  ])
2830
2913
  ]);
2831
2914
  }
2832
- const or = /* @__PURE__ */ B(Qs, [["render", ar], ["__scopeId", "data-v-b1be139c"]]);
2915
+ const cr = /* @__PURE__ */ B(er, [["render", lr], ["__scopeId", "data-v-b1be139c"]]);
2833
2916
  let ve = 0;
2834
- const lr = /* @__PURE__ */ new Set([
2917
+ const dr = /* @__PURE__ */ new Set([
2835
2918
  "text",
2836
2919
  "textarea",
2837
2920
  "number",
@@ -2839,9 +2922,9 @@ const lr = /* @__PURE__ */ new Set([
2839
2922
  "select",
2840
2923
  "multiselect",
2841
2924
  "date"
2842
- ]), cr = {
2925
+ ]), ur = {
2843
2926
  name: "WmFormCard",
2844
- components: { AIAvatar: Q },
2927
+ components: { AIAvatar: te },
2845
2928
  props: {
2846
2929
  form: { type: Object, required: !0 },
2847
2930
  readOnly: { type: Boolean, default: !1 },
@@ -2862,7 +2945,7 @@ const lr = /* @__PURE__ */ new Set([
2862
2945
  // douteux.
2863
2946
  normalizedFields() {
2864
2947
  var e;
2865
- 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)));
2948
+ return (Array.isArray((e = this.form) == null ? void 0 : e.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !dr.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
2866
2949
  }
2867
2950
  },
2868
2951
  created() {
@@ -2913,48 +2996,48 @@ const lr = /* @__PURE__ */ new Set([
2913
2996
  }
2914
2997
  }
2915
2998
  }
2916
- }, 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 = {
2999
+ }, hr = { class: "wm-form" }, mr = { class: "wm-form__head" }, fr = { class: "wm-form__icon" }, _r = { class: "wm-form__main" }, pr = { class: "wm-form__title" }, vr = {
2917
3000
  key: 0,
2918
3001
  class: "wm-form__detail"
2919
- }, _r = ["for"], vr = {
3002
+ }, yr = ["for"], gr = {
2920
3003
  key: 0,
2921
3004
  class: "wm-form__req",
2922
3005
  "aria-hidden": "true"
2923
- }, 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 = {
3006
+ }, wr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], br = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], kr = ["id", "onUpdate:modelValue", "placeholder", "required", "disabled"], Cr = ["id", "onUpdate:modelValue", "required", "disabled"], Ar = {
2924
3007
  key: 4,
2925
3008
  class: "wm-form__bool"
2926
- }, Cr = ["id", "onUpdate:modelValue", "disabled"], Ar = ["id", "onUpdate:modelValue", "required", "disabled"], Sr = {
3009
+ }, Sr = ["id", "onUpdate:modelValue", "disabled"], xr = ["id", "onUpdate:modelValue", "required", "disabled"], Mr = {
2927
3010
  value: "",
2928
3011
  disabled: ""
2929
- }, xr = ["value"], Mr = {
3012
+ }, Tr = ["value"], Or = {
2930
3013
  key: 6,
2931
3014
  class: "wm-form__multi"
2932
- }, Tr = ["value", "checked", "disabled", "onChange"], Ir = {
3015
+ }, Ir = ["value", "checked", "disabled", "onChange"], Er = {
2933
3016
  key: 0,
2934
3017
  class: "wm-form__err"
2935
- }, Or = ["disabled"], Er = {
3018
+ }, Br = ["disabled"], Lr = {
2936
3019
  key: 0,
2937
3020
  class: "wm-form__spinner",
2938
3021
  "aria-hidden": "true"
2939
- }, Br = {
3022
+ }, $r = {
2940
3023
  key: 2,
2941
3024
  class: "wm-form__doneLbl"
2942
3025
  };
2943
- function Lr(t, e, n, a, r, s) {
2944
- const o = O("AIAvatar");
2945
- return l(), d("div", dr, [
2946
- i("div", ur, [
2947
- i("div", hr, [
2948
- z(o, { size: 24 })
3026
+ function Rr(t, e, n, a, r, s) {
3027
+ const o = I("AIAvatar");
3028
+ return l(), d("div", hr, [
3029
+ i("div", mr, [
3030
+ i("div", fr, [
3031
+ K(o, { size: 24 })
2949
3032
  ]),
2950
- i("div", mr, [
2951
- i("div", fr, b(n.form.title || "Formulaire"), 1),
2952
- n.form.description ? (l(), d("div", pr, b(n.form.description), 1)) : w("", !0)
3033
+ i("div", _r, [
3034
+ i("div", pr, b(n.form.title || "Formulaire"), 1),
3035
+ n.form.description ? (l(), d("div", vr, b(n.form.description), 1)) : w("", !0)
2953
3036
  ])
2954
3037
  ]),
2955
3038
  i("form", {
2956
3039
  class: "wm-form__body",
2957
- onSubmit: e[0] || (e[0] = X((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
3040
+ onSubmit: e[0] || (e[0] = ee((...c) => s.onSubmit && s.onSubmit(...c), ["prevent"]))
2958
3041
  }, [
2959
3042
  (l(!0), d(M, null, j(s.normalizedFields, (c) => (l(), d("div", {
2960
3043
  key: c.key,
@@ -2964,10 +3047,10 @@ function Lr(t, e, n, a, r, s) {
2964
3047
  for: `wm-f-${r._uid}-${c.key}`,
2965
3048
  class: "wm-form__label"
2966
3049
  }, [
2967
- ie(b(c.label), 1),
2968
- c.required ? (l(), d("span", vr, "*")) : w("", !0)
2969
- ], 8, _r),
2970
- c.type === "text" ? H((l(), d("input", {
3050
+ oe(b(c.label), 1),
3051
+ c.required ? (l(), d("span", gr, "*")) : w("", !0)
3052
+ ], 8, yr),
3053
+ c.type === "text" ? W((l(), d("input", {
2971
3054
  key: 0,
2972
3055
  id: `wm-f-${r._uid}-${c.key}`,
2973
3056
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2976,9 +3059,9 @@ function Lr(t, e, n, a, r, s) {
2976
3059
  placeholder: c.placeholder || "",
2977
3060
  required: c.required,
2978
3061
  disabled: n.readOnly || r.busy
2979
- }, null, 8, gr)), [
2980
- [Y, r.values[c.key]]
2981
- ]) : c.type === "textarea" ? H((l(), d("textarea", {
3062
+ }, null, 8, wr)), [
3063
+ [Q, r.values[c.key]]
3064
+ ]) : c.type === "textarea" ? W((l(), d("textarea", {
2982
3065
  key: 1,
2983
3066
  id: `wm-f-${r._uid}-${c.key}`,
2984
3067
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2987,9 +3070,9 @@ function Lr(t, e, n, a, r, s) {
2987
3070
  placeholder: c.placeholder || "",
2988
3071
  required: c.required,
2989
3072
  disabled: n.readOnly || r.busy
2990
- }, null, 8, yr)), [
2991
- [Y, r.values[c.key]]
2992
- ]) : c.type === "number" ? H((l(), d("input", {
3073
+ }, null, 8, br)), [
3074
+ [Q, r.values[c.key]]
3075
+ ]) : c.type === "number" ? W((l(), d("input", {
2993
3076
  key: 2,
2994
3077
  id: `wm-f-${r._uid}-${c.key}`,
2995
3078
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -2998,14 +3081,14 @@ function Lr(t, e, n, a, r, s) {
2998
3081
  placeholder: c.placeholder || "",
2999
3082
  required: c.required,
3000
3083
  disabled: n.readOnly || r.busy
3001
- }, null, 8, wr)), [
3084
+ }, null, 8, kr)), [
3002
3085
  [
3003
- Y,
3086
+ Q,
3004
3087
  r.values[c.key],
3005
3088
  void 0,
3006
3089
  { number: !0 }
3007
3090
  ]
3008
- ]) : c.type === "date" ? H((l(), d("input", {
3091
+ ]) : c.type === "date" ? W((l(), d("input", {
3009
3092
  key: 3,
3010
3093
  id: `wm-f-${r._uid}-${c.key}`,
3011
3094
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -3013,19 +3096,19 @@ function Lr(t, e, n, a, r, s) {
3013
3096
  class: "wm-form__input",
3014
3097
  required: c.required,
3015
3098
  disabled: n.readOnly || r.busy
3016
- }, null, 8, br)), [
3017
- [Y, r.values[c.key]]
3018
- ]) : c.type === "boolean" ? (l(), d("label", kr, [
3019
- H(i("input", {
3099
+ }, null, 8, Cr)), [
3100
+ [Q, r.values[c.key]]
3101
+ ]) : c.type === "boolean" ? (l(), d("label", Ar, [
3102
+ W(i("input", {
3020
3103
  id: `wm-f-${r._uid}-${c.key}`,
3021
3104
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
3022
3105
  type: "checkbox",
3023
3106
  disabled: n.readOnly || r.busy
3024
- }, null, 8, Cr), [
3025
- [Ie, r.values[c.key]]
3107
+ }, null, 8, Sr), [
3108
+ [Oe, r.values[c.key]]
3026
3109
  ]),
3027
3110
  i("span", null, b(c.placeholder || "Oui"), 1)
3028
- ])) : c.type === "select" ? H((l(), d("select", {
3111
+ ])) : c.type === "select" ? W((l(), d("select", {
3029
3112
  key: 5,
3030
3113
  id: `wm-f-${r._uid}-${c.key}`,
3031
3114
  "onUpdate:modelValue": (v) => r.values[c.key] = v,
@@ -3033,14 +3116,14 @@ function Lr(t, e, n, a, r, s) {
3033
3116
  required: c.required,
3034
3117
  disabled: n.readOnly || r.busy
3035
3118
  }, [
3036
- i("option", Sr, b(c.placeholder || "Choisir…"), 1),
3119
+ i("option", Mr, b(c.placeholder || "Choisir…"), 1),
3037
3120
  (l(!0), d(M, null, j(c.options, (v) => (l(), d("option", {
3038
3121
  key: v.value,
3039
3122
  value: v.value
3040
- }, b(v.label), 9, xr))), 128))
3041
- ], 8, Ar)), [
3042
- [Oe, r.values[c.key]]
3043
- ]) : c.type === "multiselect" ? (l(), d("div", Mr, [
3123
+ }, b(v.label), 9, Tr))), 128))
3124
+ ], 8, xr)), [
3125
+ [Ie, r.values[c.key]]
3126
+ ]) : c.type === "multiselect" ? (l(), d("div", Or, [
3044
3127
  (l(!0), d(M, null, j(c.options, (v) => (l(), d("label", {
3045
3128
  key: v.value,
3046
3129
  class: "wm-form__multiItem"
@@ -3051,25 +3134,25 @@ function Lr(t, e, n, a, r, s) {
3051
3134
  checked: Array.isArray(r.values[c.key]) && r.values[c.key].includes(v.value),
3052
3135
  disabled: n.readOnly || r.busy,
3053
3136
  onChange: (k) => s.toggleMulti(c.key, v.value, k.target.checked)
3054
- }, null, 40, Tr),
3137
+ }, null, 40, Ir),
3055
3138
  i("span", null, b(v.label), 1)
3056
3139
  ]))), 128))
3057
3140
  ])) : w("", !0)
3058
3141
  ]))), 128)),
3059
- r.error ? (l(), d("div", Ir, b(r.error), 1)) : w("", !0),
3060
- n.readOnly ? (l(), d("div", Br, "Réponse envoyée")) : (l(), d("button", {
3142
+ r.error ? (l(), d("div", Er, b(r.error), 1)) : w("", !0),
3143
+ n.readOnly ? (l(), d("div", $r, "Réponse envoyée")) : (l(), d("button", {
3061
3144
  key: 1,
3062
3145
  type: "submit",
3063
3146
  class: "wm-form__submit",
3064
3147
  disabled: r.busy
3065
3148
  }, [
3066
- r.busy ? (l(), d("span", Er)) : w("", !0),
3149
+ r.busy ? (l(), d("span", Lr)) : w("", !0),
3067
3150
  i("span", null, b(r.busy ? "Envoi…" : n.form.submit_label || "Envoyer"), 1)
3068
- ], 8, Or))
3151
+ ], 8, Br))
3069
3152
  ], 32)
3070
3153
  ]);
3071
3154
  }
3072
- const Rr = /* @__PURE__ */ B(cr, [["render", Lr], ["__scopeId", "data-v-64b40f76"]]), $r = {
3155
+ const Fr = /* @__PURE__ */ B(ur, [["render", Rr], ["__scopeId", "data-v-64b40f76"]]), jr = {
3073
3156
  name: "WmFeedback",
3074
3157
  props: {
3075
3158
  busy: { type: Boolean, default: !1 },
@@ -3093,43 +3176,43 @@ const Rr = /* @__PURE__ */ B(cr, [["render", Lr], ["__scopeId", "data-v-64b40f76
3093
3176
  !this.sel || this.busy || this.$emit("submit", { rating: this.sel });
3094
3177
  }
3095
3178
  }
3096
- }, Fr = { class: "wm-fb" }, jr = { class: "wm-fb__row" }, Ur = ["onClick"], Dr = { class: "wm-fb__emoji" }, Nr = { class: "wm-fb__label" }, Pr = ["disabled"], Hr = {
3179
+ }, Ur = { class: "wm-fb" }, Dr = { class: "wm-fb__row" }, Nr = ["onClick"], Pr = { class: "wm-fb__emoji" }, Hr = { class: "wm-fb__label" }, zr = ["disabled"], Vr = {
3097
3180
  key: 1,
3098
3181
  class: "wm-fb__done"
3099
3182
  };
3100
- function zr(t, e, n, a, r, s) {
3101
- return l(), d("div", Fr, [
3102
- n.done ? (l(), d("div", Hr, [...e[3] || (e[3] = [
3183
+ function qr(t, e, n, a, r, s) {
3184
+ return l(), d("div", Ur, [
3185
+ n.done ? (l(), d("div", Vr, [...e[3] || (e[3] = [
3103
3186
  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)
3104
3187
  ])])) : (l(), d(M, { key: 0 }, [
3105
3188
  e[1] || (e[1] = i("div", { class: "wm-fb__title" }, "Comment s'est passée cette conversation ?", -1)),
3106
3189
  e[2] || (e[2] = i("div", { class: "wm-fb__sub" }, "Votre avis nous aide à améliorer l'assistant.", -1)),
3107
- i("div", jr, [
3190
+ i("div", Dr, [
3108
3191
  (l(!0), d(M, null, j(r.options, (o) => (l(), d("button", {
3109
3192
  key: o.v,
3110
3193
  type: "button",
3111
3194
  class: E(["wm-fb__opt", { "is-selected": r.sel === o.v }]),
3112
3195
  onClick: (c) => r.sel = o.v
3113
3196
  }, [
3114
- i("span", Dr, b(o.e), 1),
3115
- i("span", Nr, b(o.l), 1)
3116
- ], 10, Ur))), 128))
3197
+ i("span", Pr, b(o.e), 1),
3198
+ i("span", Hr, b(o.l), 1)
3199
+ ], 10, Nr))), 128))
3117
3200
  ]),
3118
3201
  i("button", {
3119
3202
  type: "button",
3120
3203
  class: "wm-fb__send",
3121
3204
  disabled: !r.sel || n.busy,
3122
3205
  onClick: e[0] || (e[0] = (...o) => s.onSend && s.onSend(...o))
3123
- }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, Pr)
3206
+ }, b(n.busy ? "Envoi…" : "Envoyer mon avis"), 9, zr)
3124
3207
  ], 64))
3125
3208
  ]);
3126
3209
  }
3127
- const Vr = /* @__PURE__ */ B($r, [["render", zr], ["__scopeId", "data-v-6f45ff3b"]]);
3128
- function qr(t) {
3210
+ const Wr = /* @__PURE__ */ B(jr, [["render", qr], ["__scopeId", "data-v-6f45ff3b"]]);
3211
+ function Kr(t) {
3129
3212
  const e = new Date(t);
3130
3213
  return e.setHours(0, 0, 0, 0), e;
3131
3214
  }
3132
- const Wr = {
3215
+ const Gr = {
3133
3216
  name: "WmHistoryDrawer",
3134
3217
  props: {
3135
3218
  conversations: { type: Array, default: () => [] },
@@ -3163,7 +3246,7 @@ const Wr = {
3163
3246
  ) : this.normalized;
3164
3247
  },
3165
3248
  groups() {
3166
- const e = qr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3249
+ const e = Kr(/* @__PURE__ */ new Date()).getTime(), n = e - 6 * 864e5, a = [], r = [], s = [];
3167
3250
  for (const o of this.filtered) {
3168
3251
  if (!o.stamp) {
3169
3252
  s.push(o);
@@ -3181,29 +3264,29 @@ const Wr = {
3181
3264
  return this.filtered.length > 0;
3182
3265
  }
3183
3266
  }
3184
- }, Gr = { class: "wm-hd" }, Kr = {
3267
+ }, Yr = { class: "wm-hd" }, Jr = {
3185
3268
  class: "wm-hd__panel",
3186
3269
  role: "dialog",
3187
3270
  "aria-label": "Vos discussions"
3188
- }, Yr = { class: "wm-hd__head" }, Jr = { class: "wm-hd__top" }, Xr = { class: "wm-hd__search" }, Qr = { class: "wm-hd__list" }, Zr = {
3271
+ }, Xr = { class: "wm-hd__head" }, Qr = { class: "wm-hd__top" }, Zr = { class: "wm-hd__search" }, ei = { class: "wm-hd__list" }, ti = {
3189
3272
  key: 0,
3190
3273
  class: "wm-hd__group"
3191
- }, ei = { class: "wm-hd__groupLabel" }, ti = { class: "wm-hd__rows" }, ni = ["onClick"], si = { class: "wm-hd__rowIcon" }, ri = {
3274
+ }, ni = { class: "wm-hd__groupLabel" }, si = { class: "wm-hd__rows" }, ri = ["onClick"], ii = { class: "wm-hd__rowIcon" }, ai = {
3192
3275
  key: 0,
3193
3276
  class: "wm-hd__rowDot",
3194
3277
  "aria-label": "Message non lu"
3195
- }, ii = { class: "wm-hd__rowBody" }, ai = { class: "wm-hd__rowTop" }, oi = { class: "wm-hd__rowTitle" }, li = { class: "wm-hd__rowPreview" }, ci = {
3278
+ }, oi = { class: "wm-hd__rowBody" }, li = { class: "wm-hd__rowTop" }, ci = { class: "wm-hd__rowTitle" }, di = { class: "wm-hd__rowPreview" }, ui = {
3196
3279
  key: 0,
3197
3280
  class: "wm-hd__empty"
3198
3281
  };
3199
- function di(t, e, n, a, r, s) {
3200
- return l(), d("div", Gr, [
3282
+ function hi(t, e, n, a, r, s) {
3283
+ return l(), d("div", Yr, [
3201
3284
  i("div", {
3202
3285
  class: "wm-hd__scrim",
3203
3286
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3204
3287
  }),
3205
- i("aside", Kr, [
3206
- i("div", Yr, [
3288
+ i("aside", Jr, [
3289
+ i("div", Xr, [
3207
3290
  e[5] || (e[5] = i("div", { class: "wm-hd__heading" }, [
3208
3291
  i("div", { class: "wm-hd__title" }, "Vos discussions"),
3209
3292
  i("div", { class: "wm-hd__sub" }, "Reprenez là où vous en étiez.")
@@ -3229,7 +3312,7 @@ function di(t, e, n, a, r, s) {
3229
3312
  ], -1)
3230
3313
  ])])
3231
3314
  ]),
3232
- i("div", Jr, [
3315
+ i("div", Qr, [
3233
3316
  i("button", {
3234
3317
  type: "button",
3235
3318
  class: "wm-hd__new",
@@ -3252,7 +3335,7 @@ function di(t, e, n, a, r, s) {
3252
3335
  ], -1),
3253
3336
  i("span", null, "Démarrer un nouveau fil", -1)
3254
3337
  ])]),
3255
- i("div", Xr, [
3338
+ i("div", Zr, [
3256
3339
  e[7] || (e[7] = i("span", { class: "wm-hd__searchIcon" }, [
3257
3340
  i("svg", {
3258
3341
  width: "12",
@@ -3268,23 +3351,23 @@ function di(t, e, n, a, r, s) {
3268
3351
  i("path", { d: "M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z" })
3269
3352
  ])
3270
3353
  ], -1)),
3271
- H(i("input", {
3354
+ W(i("input", {
3272
3355
  "onUpdate:modelValue": e[3] || (e[3] = (o) => r.query = o),
3273
3356
  type: "text",
3274
3357
  placeholder: "Rechercher dans vos messages",
3275
3358
  "aria-label": "Rechercher dans vos messages"
3276
3359
  }, null, 512), [
3277
- [Y, r.query]
3360
+ [Q, r.query]
3278
3361
  ])
3279
3362
  ])
3280
3363
  ]),
3281
- i("div", Qr, [
3364
+ i("div", ei, [
3282
3365
  (l(!0), d(M, null, j(s.groups, (o) => (l(), d(M, {
3283
3366
  key: o.key
3284
3367
  }, [
3285
- o.items.length ? (l(), d("div", Zr, [
3286
- i("div", ei, b(o.label), 1),
3287
- i("div", ti, [
3368
+ o.items.length ? (l(), d("div", ti, [
3369
+ i("div", ni, b(o.label), 1),
3370
+ i("div", si, [
3288
3371
  (l(!0), d(M, null, j(o.items, (c) => (l(), d("button", {
3289
3372
  key: c.id,
3290
3373
  type: "button",
@@ -3294,7 +3377,7 @@ function di(t, e, n, a, r, s) {
3294
3377
  }]),
3295
3378
  onClick: (v) => t.$emit("pick", c)
3296
3379
  }, [
3297
- i("div", si, [
3380
+ i("div", ii, [
3298
3381
  e[8] || (e[8] = i("svg", {
3299
3382
  width: "11",
3300
3383
  height: "11",
@@ -3308,24 +3391,24 @@ function di(t, e, n, a, r, s) {
3308
3391
  opacity: "0.92"
3309
3392
  })
3310
3393
  ], -1)),
3311
- c.unread ? (l(), d("span", ri)) : w("", !0)
3394
+ c.unread ? (l(), d("span", ai)) : w("", !0)
3312
3395
  ]),
3313
- i("div", ii, [
3314
- i("div", ai, [
3315
- i("span", oi, b(c.title), 1)
3396
+ i("div", oi, [
3397
+ i("div", li, [
3398
+ i("span", ci, b(c.title), 1)
3316
3399
  ]),
3317
- i("div", li, b(c.preview || "Aucun message"), 1)
3400
+ i("div", di, b(c.preview || "Aucun message"), 1)
3318
3401
  ])
3319
- ], 10, ni))), 128))
3402
+ ], 10, ri))), 128))
3320
3403
  ])
3321
3404
  ])) : w("", !0)
3322
3405
  ], 64))), 128)),
3323
- s.hasAny ? w("", !0) : (l(), d("div", ci, " Aucun fil pour le moment. "))
3406
+ s.hasAny ? w("", !0) : (l(), d("div", ui, " Aucun fil pour le moment. "))
3324
3407
  ])
3325
3408
  ])
3326
3409
  ]);
3327
3410
  }
3328
- const ui = /* @__PURE__ */ B(Wr, [["render", di], ["__scopeId", "data-v-1259e822"]]), hi = {
3411
+ const mi = /* @__PURE__ */ B(Gr, [["render", hi], ["__scopeId", "data-v-1259e822"]]), fi = {
3329
3412
  name: "WmMoreMenu",
3330
3413
  props: {
3331
3414
  canRename: { type: Boolean, default: !0 },
@@ -3352,18 +3435,18 @@ const ui = /* @__PURE__ */ B(Wr, [["render", di], ["__scopeId", "data-v-1259e822
3352
3435
  this.notifOn = !this.notifOn, this.$emit("notif-toggle", this.notifOn);
3353
3436
  }
3354
3437
  }
3355
- }, mi = { class: "wm-mm" }, fi = {
3438
+ }, _i = { class: "wm-mm" }, pi = {
3356
3439
  class: "wm-mm__pop",
3357
3440
  role: "menu"
3358
- }, pi = { class: "wm-mm__section" }, _i = { class: "wm-mm__section" }, vi = { class: "wm-mm__section" };
3359
- function gi(t, e, n, a, r, s) {
3360
- return l(), d("div", mi, [
3441
+ }, vi = { class: "wm-mm__section" }, yi = { class: "wm-mm__section" }, gi = { class: "wm-mm__section" };
3442
+ function wi(t, e, n, a, r, s) {
3443
+ return l(), d("div", _i, [
3361
3444
  i("div", {
3362
3445
  class: "wm-mm__scrim",
3363
3446
  onClick: e[0] || (e[0] = (o) => t.$emit("close"))
3364
3447
  }),
3365
- i("div", fi, [
3366
- i("div", pi, [
3448
+ i("div", pi, [
3449
+ i("div", vi, [
3367
3450
  i("button", {
3368
3451
  type: "button",
3369
3452
  class: "wm-mm__item",
@@ -3427,7 +3510,7 @@ function gi(t, e, n, a, r, s) {
3427
3510
  ])])) : w("", !0)
3428
3511
  ]),
3429
3512
  e[17] || (e[17] = i("div", { class: "wm-mm__sep" }, null, -1)),
3430
- i("div", _i, [
3513
+ i("div", yi, [
3431
3514
  i("button", {
3432
3515
  type: "button",
3433
3516
  class: "wm-mm__item",
@@ -3457,7 +3540,7 @@ function gi(t, e, n, a, r, s) {
3457
3540
  ])
3458
3541
  ]),
3459
3542
  e[18] || (e[18] = i("div", { class: "wm-mm__sep" }, null, -1)),
3460
- i("div", vi, [
3543
+ i("div", gi, [
3461
3544
  n.statusUrl ? (l(), d("button", {
3462
3545
  key: 0,
3463
3546
  type: "button",
@@ -3508,13 +3591,13 @@ function gi(t, e, n, a, r, s) {
3508
3591
  ])
3509
3592
  ]);
3510
3593
  }
3511
- const yi = /* @__PURE__ */ B(hi, [["render", gi], ["__scopeId", "data-v-c1bb81d2"]]), ge = "ww-messenger-tokens";
3594
+ const bi = /* @__PURE__ */ B(fi, [["render", wi], ["__scopeId", "data-v-c1bb81d2"]]), ye = "ww-messenger-tokens";
3512
3595
  function de(t) {
3513
3596
  var n;
3514
3597
  const e = (n = t == null ? void 0 : t.author) == null ? void 0 : n.type;
3515
3598
  return e === "agent_ia" || e === "agent_human";
3516
3599
  }
3517
- function wi(t, e) {
3600
+ function ki(t, e) {
3518
3601
  if (!t || !e) return "";
3519
3602
  const n = Array.isArray(t.fields) ? t.fields : [], a = [];
3520
3603
  for (const r of n) {
@@ -3523,8 +3606,8 @@ function wi(t, e) {
3523
3606
  if (s == null || s === "") continue;
3524
3607
  let o;
3525
3608
  if (Array.isArray(s)) {
3526
- if (o = s.map((c) => re(r, String(c))).join(", "), !o) continue;
3527
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
3609
+ if (o = s.map((c) => ae(r, String(c))).join(", "), !o) continue;
3610
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3528
3611
  a.push(`${r.label} :
3529
3612
  ${o}`);
3530
3613
  }
@@ -3532,12 +3615,12 @@ ${o}`);
3532
3615
 
3533
3616
  `);
3534
3617
  }
3535
- function re(t, e) {
3618
+ function ae(t, e) {
3536
3619
  if (!Array.isArray(t == null ? void 0 : t.options)) return e;
3537
3620
  const n = t.options.find((a) => (a == null ? void 0 : a.value) === e);
3538
3621
  return (n == null ? void 0 : n.label) || e;
3539
3622
  }
3540
- function bi(t, e) {
3623
+ function Ci(t, e) {
3541
3624
  const n = [], a = Array.isArray(t == null ? void 0 : t.fields) ? t.fields : [];
3542
3625
  for (const r of a) {
3543
3626
  if (!(r != null && r.key) || !(r != null && r.label)) continue;
@@ -3545,8 +3628,8 @@ function bi(t, e) {
3545
3628
  if (s == null || s === "") continue;
3546
3629
  let o;
3547
3630
  if (Array.isArray(s)) {
3548
- if (o = s.map((v) => re(r, String(v))).join(", "), !o) continue;
3549
- } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = re(r, String(s));
3631
+ if (o = s.map((v) => ae(r, String(v))).join(", "), !o) continue;
3632
+ } else typeof s == "boolean" ? o = s ? "Oui" : "Non" : o = ae(r, String(s));
3550
3633
  const c = r.type === "textarea" || typeof o == "string" && (o.length > 60 || o.includes(`
3551
3634
  `));
3552
3635
  n.push({ label: r.label, value: o, multiline: c });
@@ -3559,20 +3642,20 @@ function bi(t, e) {
3559
3642
  }
3560
3643
  };
3561
3644
  }
3562
- const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
3645
+ const Ai = 450, Si = 50, xi = 900, Mi = 12e3, Ti = 300, Oi = {
3563
3646
  name: "Messenger",
3564
3647
  components: {
3565
- Launcher: Ge,
3566
- Header: yt,
3648
+ Launcher: Ke,
3649
+ Header: gt,
3567
3650
  Onboarding: Pt,
3568
- MessageList: Ms,
3569
- Composer: Gs,
3570
- SuggestionChips: Xs,
3571
- ApprovalCard: or,
3572
- FormCard: Rr,
3573
- Feedback: Vr,
3574
- HistoryDrawer: ui,
3575
- MoreMenu: yi
3651
+ MessageList: Os,
3652
+ Composer: Ys,
3653
+ SuggestionChips: Zs,
3654
+ ApprovalCard: cr,
3655
+ FormCard: Fr,
3656
+ Feedback: Wr,
3657
+ HistoryDrawer: mi,
3658
+ MoreMenu: bi
3576
3659
  },
3577
3660
  // Make signAttachment available to deep children (AttachmentPreview)
3578
3661
  // without prop drilling. The store may not exist yet at provide-time
@@ -3925,7 +4008,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
3925
4008
  const e = (v = (c = (o = this.pendingApproval) == null ? void 0 : o.payload) == null ? void 0 : c.pending) == null ? void 0 : v.prepared_params;
3926
4009
  if (!e || typeof e != "object") return "";
3927
4010
  const n = Object.entries(e);
3928
- return n.length ? n.slice(0, 2).map(([k, y]) => `${k}: ${y}`).join(" · ") : "";
4011
+ return n.length ? n.slice(0, 2).map(([k, g]) => `${k}: ${g}`).join(" · ") : "";
3929
4012
  },
3930
4013
  actionInFlight() {
3931
4014
  var t, e;
@@ -4095,9 +4178,9 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4095
4178
  hasWidgetId: !!this.widgetId,
4096
4179
  hasUserId: !!this.userId,
4097
4180
  hasUserHash: !!this.userHash
4098
- }), typeof document < "u" && !document.getElementById(ge)) {
4181
+ }), typeof document < "u" && !document.getElementById(ye)) {
4099
4182
  const t = document.createElement("style");
4100
- t.id = ge, t.textContent = Ne, document.head.appendChild(t);
4183
+ t.id = ye, t.textContent = Ne, document.head.appendChild(t);
4101
4184
  }
4102
4185
  this.hydrateReadState(), await this.boot(), this.isEmbedded && this.store && await this.open();
4103
4186
  },
@@ -4248,19 +4331,19 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4248
4331
  // bounded by MIN/MAX_BETWEEN_MS.
4249
4332
  scheduleReveal(t) {
4250
4333
  const e = Date.now(), n = ((t == null ? void 0 : t.text_md) || "").length, a = Math.min(
4251
- Si,
4252
- Math.max(Ai, n * Ci)
4334
+ Mi,
4335
+ Math.max(xi, n * Si)
4253
4336
  ), s = Math.max(
4254
- e + ki,
4255
- this.nextRevealAt + xi
4337
+ e + Ai,
4338
+ this.nextRevealAt + Ti
4256
4339
  ) + a;
4257
4340
  this.nextRevealAt = s;
4258
4341
  const o = Math.max(0, s - e), c = t.id, v = setTimeout(() => {
4259
- this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((y) => y !== v);
4342
+ this.revealedAt = { ...this.revealedAt, [c]: Date.now() }, this.revealTimers = this.revealTimers.filter((g) => g !== v);
4260
4343
  }, o);
4261
4344
  this.revealTimers.push(v);
4262
4345
  const k = setTimeout(() => {
4263
- this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((y) => y !== k);
4346
+ this.revealedAt[c] > 0 || (this.revealedAt = { ...this.revealedAt, [c]: Date.now() }), this.revealTimers = this.revealTimers.filter((g) => g !== k);
4264
4347
  }, o + 4e3);
4265
4348
  this.revealTimers.push(k);
4266
4349
  },
@@ -4279,7 +4362,7 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4279
4362
  baseUrl: this.baseUrl,
4280
4363
  widgetId: this.widgetId,
4281
4364
  userId: this.userId
4282
- }), this.transport = fe($e({
4365
+ }), this.transport = fe(Re({
4283
4366
  baseUrl: this.baseUrl,
4284
4367
  widgetId: this.widgetId,
4285
4368
  userId: this.userId,
@@ -4423,18 +4506,18 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4423
4506
  t.created_at ? `Créée le : ${t.created_at}` : "",
4424
4507
  ""
4425
4508
  ];
4426
- for (const y of e) {
4427
- if (!y) continue;
4428
- 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();
4429
- A && (n.push(`[${$}] ${S} :`), n.push(A), n.push(""));
4509
+ for (const g of e) {
4510
+ if (!g) continue;
4511
+ 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();
4512
+ A && (n.push(`[${R}] ${S} :`), n.push(A), n.push(""));
4430
4513
  }
4431
4514
  const a = new Blob([n.join(`
4432
4515
  `)], { type: "text/plain;charset=utf-8" });
4433
4516
  try {
4434
- const y = URL.createObjectURL(a), S = document.createElement("a");
4435
- 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);
4436
- } catch (y) {
4437
- console.error("[ww-messenger] export failed", y);
4517
+ const g = URL.createObjectURL(a), S = document.createElement("a");
4518
+ 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);
4519
+ } catch (g) {
4520
+ console.error("[ww-messenger] export failed", g);
4438
4521
  }
4439
4522
  },
4440
4523
  async onSend(t) {
@@ -4460,12 +4543,12 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4460
4543
  async onFormSubmit({ values: t }) {
4461
4544
  const e = this.pendingForm;
4462
4545
  if (!(e != null && e.form)) return;
4463
- const n = wi(e.form, t);
4546
+ const n = ki(e.form, t);
4464
4547
  if (!n) return;
4465
4548
  const a = this.currentConv;
4466
4549
  a && await this.store.send(a.id, n, {
4467
4550
  metadata: {
4468
- artifact: bi(e.form, t)
4551
+ artifact: Ci(e.form, t)
4469
4552
  }
4470
4553
  });
4471
4554
  },
@@ -4509,33 +4592,33 @@ const ki = 450, Ci = 50, Ai = 900, Si = 12e3, xi = 300, Mi = {
4509
4592
  }
4510
4593
  }
4511
4594
  }
4512
- }, Ti = {
4595
+ }, Ii = {
4513
4596
  key: 0,
4514
4597
  class: "wm-loading",
4515
4598
  "aria-busy": "true",
4516
4599
  "aria-live": "polite"
4517
- }, Ii = {
4600
+ }, Ei = {
4518
4601
  key: 0,
4519
4602
  class: "wm-state"
4520
- }, Oi = { class: "wm-state__err" }, Ei = { class: "wm-state__errSub" }, Bi = { class: "wm-bottom" }, Li = {
4603
+ }, Bi = { class: "wm-state__err" }, Li = { class: "wm-state__errSub" }, $i = { class: "wm-bottom" }, Ri = {
4521
4604
  key: 0,
4522
4605
  ref: "floatEl",
4523
4606
  class: "wm-float"
4524
- }, Ri = {
4607
+ }, Fi = {
4525
4608
  key: 1,
4526
4609
  class: "wm-actionWait",
4527
4610
  role: "status",
4528
4611
  "aria-live": "polite"
4529
- }, $i = { class: "wm-actionWait__lbl" }, Fi = {
4612
+ }, ji = { class: "wm-actionWait__lbl" }, Ui = {
4530
4613
  key: 1,
4531
4614
  class: "wm-attached"
4532
- }, ji = ["onClick"];
4533
- function Ui(t, e, n, a, r, s) {
4534
- 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");
4615
+ }, Di = ["onClick"];
4616
+ function Ni(t, e, n, a, r, s) {
4617
+ 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");
4535
4618
  return l(), d("div", {
4536
4619
  class: E(["wm-root", `wm-root--${n.displayMode}`])
4537
4620
  }, [
4538
- !r.isOpen && !s.isEmbedded ? (l(), R(o, {
4621
+ !r.isOpen && !s.isEmbedded ? (l(), $(o, {
4539
4622
  key: 0,
4540
4623
  "unread-count": s.unreadCount,
4541
4624
  peek: s.launcherPeek,
@@ -4545,11 +4628,11 @@ function Ui(t, e, n, a, r, s) {
4545
4628
  r.isOpen || s.isEmbedded ? (l(), d("section", {
4546
4629
  key: 1,
4547
4630
  class: E(["wm-panel", `wm-panel--${n.displayMode}`]),
4548
- style: V(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4631
+ style: G(r.floatHeight ? { "--wm-float-h": r.floatHeight + "px" } : null),
4549
4632
  role: "dialog",
4550
4633
  "aria-label": "Messenger"
4551
4634
  }, [
4552
- !s.ready && !s.error ? (l(), d("div", Ti, [
4635
+ !s.ready && !s.error ? (l(), d("div", Ii, [
4553
4636
  s.isEmbedded ? w("", !0) : (l(), d("button", {
4554
4637
  key: 0,
4555
4638
  type: "button",
@@ -4576,7 +4659,7 @@ function Ui(t, e, n, a, r, s) {
4576
4659
  "aria-hidden": "true"
4577
4660
  }, null, -1))
4578
4661
  ])) : (l(), d(M, { key: 1 }, [
4579
- z(c, {
4662
+ K(c, {
4580
4663
  title: s.headerTitle,
4581
4664
  escalated: s.isEscalated,
4582
4665
  "agent-name": s.humanAgentName,
@@ -4591,8 +4674,8 @@ function Ui(t, e, n, a, r, s) {
4591
4674
  onMore: s.toggleMore,
4592
4675
  onClose: s.close
4593
4676
  }, null, 8, ["title", "escalated", "agent-name", "agent-avatar-url", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "onBack", "onMore", "onClose"]),
4594
- s.error ? (l(), d("div", Ii, [
4595
- i("div", Oi, [
4677
+ s.error ? (l(), d("div", Ei, [
4678
+ i("div", Bi, [
4596
4679
  e[9] || (e[9] = i("div", { class: "wm-state__errIcon" }, [
4597
4680
  i("svg", {
4598
4681
  width: "14",
@@ -4610,11 +4693,11 @@ function Ui(t, e, n, a, r, s) {
4610
4693
  ], -1)),
4611
4694
  i("div", null, [
4612
4695
  e[8] || (e[8] = i("div", { class: "wm-state__errTitle" }, "Connexion impossible", -1)),
4613
- i("div", Ei, b(s.error), 1)
4696
+ i("div", Li, b(s.error), 1)
4614
4697
  ])
4615
4698
  ])
4616
4699
  ])) : s.currentConv ? (l(), d(M, { key: 2 }, [
4617
- z(k, {
4700
+ K(k, {
4618
4701
  ref: "messageList",
4619
4702
  messages: s.displayedMessages,
4620
4703
  "streaming-active": s.streamingActive,
@@ -4625,36 +4708,36 @@ function Ui(t, e, n, a, r, s) {
4625
4708
  "unread-anchor-ts": r.unreadAnchorTs,
4626
4709
  onLoadMore: s.onLoadMore
4627
4710
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-ts", "onLoadMore"]),
4628
- i("div", Bi, [
4629
- s.floatVisible ? (l(), d("div", Li, [
4630
- s.approvalReady ? (l(), R(y, {
4711
+ i("div", $i, [
4712
+ s.floatVisible ? (l(), d("div", Ri, [
4713
+ s.approvalReady ? (l(), $(g, {
4631
4714
  key: 0,
4632
4715
  action: s.approvalTitle,
4633
4716
  detail: s.approvalDetail,
4634
4717
  callbacks: s.pendingApproval.callbacks,
4635
4718
  onCallback: s.onApprovalCallback
4636
- }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), R(S, {
4719
+ }, null, 8, ["action", "detail", "callbacks", "onCallback"])) : s.pendingForm ? (l(), $(S, {
4637
4720
  key: s.pendingForm.message && s.pendingForm.message.id,
4638
4721
  form: s.pendingForm.form,
4639
4722
  onSubmit: s.onFormSubmit
4640
- }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), R($, {
4723
+ }, null, 8, ["form", "onSubmit"])) : s.showFeedback ? (l(), $(R, {
4641
4724
  key: 2,
4642
4725
  busy: r.feedbackBusy,
4643
4726
  done: r.feedbackDone,
4644
4727
  onSubmit: s.onFeedback
4645
- }, null, 8, ["busy", "done", "onSubmit"])) : (l(), R(A, {
4728
+ }, null, 8, ["busy", "done", "onSubmit"])) : (l(), $(A, {
4646
4729
  key: 3,
4647
4730
  items: s.suggestions,
4648
4731
  onSelect: s.onSuggestion
4649
4732
  }, null, 8, ["items", "onSelect"]))
4650
4733
  ], 512)) : w("", !0),
4651
- s.actionInFlight ? (l(), d("div", Ri, [
4734
+ s.actionInFlight ? (l(), d("div", Fi, [
4652
4735
  e[10] || (e[10] = i("span", {
4653
4736
  class: "wm-actionWait__spinner",
4654
4737
  "aria-hidden": "true"
4655
4738
  }, null, -1)),
4656
- i("span", $i, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4657
- ])) : (l(), R(D, {
4739
+ i("span", ji, b(s.actionInFlightName) + " en cours, veuillez patienter…", 1)
4740
+ ])) : (l(), $(P, {
4658
4741
  key: 2,
4659
4742
  ref: "composer",
4660
4743
  modelValue: r.draft,
@@ -4666,7 +4749,7 @@ function Ui(t, e, n, a, r, s) {
4666
4749
  onAttach: s.onAttach
4667
4750
  }, null, 8, ["modelValue", "placeholder", "disabled", "onSend", "onAttach"]))
4668
4751
  ]),
4669
- r.moreOpen ? (l(), R(x, {
4752
+ r.moreOpen ? (l(), $(x, {
4670
4753
  key: 0,
4671
4754
  "can-rename": !!s.currentConv,
4672
4755
  "can-clear": !!s.currentConv,
@@ -4678,9 +4761,9 @@ function Ui(t, e, n, a, r, s) {
4678
4761
  onNotifToggle: s.onNotifToggle,
4679
4762
  onAction: s.onMoreAction
4680
4763
  }, null, 8, ["can-rename", "can-clear", "can-export", "notif-enabled", "status-url", "help-url", "onNotifToggle", "onAction"])) : w("", !0),
4681
- r.pendingAttachments.length ? (l(), d("div", Fi, [
4682
- (l(!0), d(M, null, j(r.pendingAttachments, (F, P) => (l(), d("div", {
4683
- key: P,
4764
+ r.pendingAttachments.length ? (l(), d("div", Ui, [
4765
+ (l(!0), d(M, null, j(r.pendingAttachments, (F, N) => (l(), d("div", {
4766
+ key: N,
4684
4767
  class: "wm-attached__chip"
4685
4768
  }, [
4686
4769
  e[12] || (e[12] = i("svg", {
@@ -4700,7 +4783,7 @@ function Ui(t, e, n, a, r, s) {
4700
4783
  i("button", {
4701
4784
  type: "button",
4702
4785
  "aria-label": "Retirer",
4703
- onClick: (q) => r.pendingAttachments.splice(P, 1)
4786
+ onClick: (V) => r.pendingAttachments.splice(N, 1)
4704
4787
  }, [...e[11] || (e[11] = [
4705
4788
  i("svg", {
4706
4789
  width: "10",
@@ -4715,10 +4798,10 @@ function Ui(t, e, n, a, r, s) {
4715
4798
  }, [
4716
4799
  i("path", { d: "M18 6L6 18M6 6l12 12" })
4717
4800
  ], -1)
4718
- ])], 8, ji)
4801
+ ])], 8, Di)
4719
4802
  ]))), 128))
4720
4803
  ])) : w("", !0)
4721
- ], 64)) : (l(), R(v, {
4804
+ ], 64)) : (l(), $(v, {
4722
4805
  key: 1,
4723
4806
  "welcome-message": s.widgetWelcomeMessage,
4724
4807
  "agent-name": s.agentName,
@@ -4729,7 +4812,7 @@ function Ui(t, e, n, a, r, s) {
4729
4812
  onSelect: s.onQuickLink,
4730
4813
  onResume: s.onDrawerPick
4731
4814
  }, null, 8, ["welcome-message", "agent-name", "quick-links", "unread-threads", "busy", "onStart", "onSelect", "onResume"])),
4732
- r.historyOpen ? (l(), R(N, {
4815
+ r.historyOpen ? (l(), $(D, {
4733
4816
  key: 3,
4734
4817
  conversations: s.drawerConversations,
4735
4818
  "active-id": s.currentConv ? s.currentConv.id : null,
@@ -4737,7 +4820,7 @@ function Ui(t, e, n, a, r, s) {
4737
4820
  onNew: s.onDrawerNew,
4738
4821
  onPick: s.onDrawerPick
4739
4822
  }, null, 8, ["conversations", "active-id", "onNew", "onPick"])) : w("", !0),
4740
- r.moreOpen && !s.currentConv ? (l(), R(x, {
4823
+ r.moreOpen && !s.currentConv ? (l(), $(x, {
4741
4824
  key: 4,
4742
4825
  "can-rename": !1,
4743
4826
  "can-clear": !1,
@@ -4753,48 +4836,48 @@ function Ui(t, e, n, a, r, s) {
4753
4836
  ], 6)) : w("", !0)
4754
4837
  ], 2);
4755
4838
  }
4756
- const Pi = /* @__PURE__ */ B(Mi, [["render", Ui], ["__scopeId", "data-v-8264e504"]]), Hi = "0.2.21";
4839
+ const zi = /* @__PURE__ */ B(Oi, [["render", Ni], ["__scopeId", "data-v-8264e504"]]), Vi = "0.2.23";
4757
4840
  export {
4758
- Q as AIAvatar,
4841
+ te as AIAvatar,
4759
4842
  ce as AVATAR_COLORS,
4760
4843
  Qt as ActionResult,
4761
- or as ApprovalCard,
4844
+ cr as ApprovalCard,
4762
4845
  on as ArtifactFormResponse,
4763
4846
  wn as ArtifactInfoCard,
4764
- Un as ArtifactRenderer,
4847
+ Dn as ArtifactRenderer,
4765
4848
  Rn as ArtifactTicket,
4766
- Jn as AttachmentPreview,
4767
- ss as Bubble,
4768
- Gs as Composer,
4849
+ Xn as AttachmentPreview,
4850
+ rs as Bubble,
4851
+ Ys as Composer,
4769
4852
  Pe as DEFAULT_BASE_URL,
4770
- Vr as Feedback,
4771
- Rr as FormCard,
4772
- yt as Header,
4773
- ui as HistoryDrawer,
4853
+ Wr as Feedback,
4854
+ Fr as FormCard,
4855
+ gt as Header,
4856
+ mi as HistoryDrawer,
4774
4857
  ke as HumanAvatar,
4775
- Ge as Launcher,
4858
+ Ke as Launcher,
4776
4859
  he as MEDIA_RECORDER_SUPPORTED,
4777
- Ms as MessageList,
4778
- Pi as Messenger,
4779
- yi as MoreMenu,
4860
+ Os as MessageList,
4861
+ zi as Messenger,
4862
+ bi as MoreMenu,
4780
4863
  Pt as Onboarding,
4781
- se as SCREEN_CAPTURE_SUPPORTED,
4782
- Xs as SuggestionChips,
4864
+ ie as SCREEN_CAPTURE_SUPPORTED,
4865
+ Zs as SuggestionChips,
4783
4866
  ot as TeamAvatars,
4784
- os as Typing,
4785
- Hi as VERSION,
4786
- ye as avatarColor,
4867
+ ls as Typing,
4868
+ Vi as VERSION,
4869
+ ge as avatarColor,
4787
4870
  we as avatarInitials,
4788
- Is as captureScreenshotFile,
4871
+ Es as captureScreenshotFile,
4789
4872
  U as colors,
4790
4873
  De as createStore,
4791
- $e as createTransport,
4792
- Pi as default,
4874
+ Re as createTransport,
4875
+ zi as default,
4793
4876
  be as formatTime,
4794
- Ni as guessAttachmentKind,
4795
- Ts as pickRecorderMime,
4796
- Zn as renderMarkdown,
4797
- Es as startScreenRecording,
4877
+ Hi as guessAttachmentKind,
4878
+ Is as pickRecorderMime,
4879
+ es as renderMarkdown,
4880
+ Ls as startScreenRecording,
4798
4881
  Ne as tokensCss,
4799
4882
  Ue as uuid,
4800
4883
  Ue as v4