@_solaris/messenger-widget 0.5.72 → 0.5.74

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 $e, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as B, createVNode as $, Transition as Ne, withCtx as Fe, Fragment as I, renderList as F, withKeys as ge, withModifiers as J, createElementVNode as o, createCommentVNode as b, createBlock as U, resolveDynamicComponent as Ae, mergeProps as je, withDirectives as G, vModelText as te, createTextVNode as Se, renderSlot as Ke, vModelCheckbox as We, vModelSelect as Ge, markRaw as Re } from "vue";
1
+ import { reactive as $e, openBlock as c, createElementBlock as d, normalizeStyle as z, normalizeClass as R, toDisplayString as v, resolveComponent as B, createVNode as $, Transition as Ne, withCtx as Fe, Fragment as I, renderList as F, withKeys as ge, withModifiers as J, createElementVNode as o, createCommentVNode as b, createBlock as D, resolveDynamicComponent as Ae, mergeProps as je, withDirectives as G, vModelText as te, createTextVNode as Se, renderSlot as Ke, vModelCheckbox as We, vModelSelect as Ge, markRaw as Re } from "vue";
2
2
  const Ye = [
3
3
  "connected",
4
4
  "message",
@@ -35,10 +35,10 @@ function Ze(e) {
35
35
  };
36
36
  if (!t.baseUrl || !t.widgetId)
37
37
  throw new Error("[transport] baseUrl and widgetId are required");
38
- function n(u, g) {
38
+ function s(u, g) {
39
39
  return t.listeners.has(u) || t.listeners.set(u, /* @__PURE__ */ new Set()), t.listeners.get(u).add(g), () => t.listeners.get(u).delete(g);
40
40
  }
41
- function r(u, g) {
41
+ function i(u, g) {
42
42
  const p = t.listeners.get(u);
43
43
  p && p.forEach((S) => {
44
44
  try {
@@ -49,9 +49,9 @@ function Ze(e) {
49
49
  });
50
50
  }
51
51
  function a(u) {
52
- t.connection !== u && (t.connection = u, r("connection", u));
52
+ t.connection !== u && (t.connection = u, i("connection", u));
53
53
  }
54
- function s() {
54
+ function n() {
55
55
  return {
56
56
  "Content-Type": "application/json",
57
57
  "X-Widget-Id": t.widgetId,
@@ -64,11 +64,11 @@ function Ze(e) {
64
64
  ...t.origin ? { "X-Parent-Origin": t.origin } : {}
65
65
  };
66
66
  }
67
- async function i(u, g, p) {
67
+ async function r(u, g, p) {
68
68
  const S = await fetch(`${t.baseUrl}${we}${g}`, {
69
69
  method: u,
70
70
  credentials: "include",
71
- headers: s(),
71
+ headers: n(),
72
72
  body: p !== void 0 ? JSON.stringify(p) : void 0
73
73
  });
74
74
  if (!S.ok) {
@@ -96,7 +96,7 @@ function Ze(e) {
96
96
  {
97
97
  method: "POST",
98
98
  credentials: "include",
99
- headers: s(),
99
+ headers: n(),
100
100
  body: JSON.stringify({
101
101
  origin: t.origin,
102
102
  ...t.token ? { token: t.token } : {},
@@ -132,7 +132,7 @@ function Ze(e) {
132
132
  }
133
133
  return V.json();
134
134
  }),
135
- i("GET", "/customers/me")
135
+ r("GET", "/customers/me")
136
136
  ]), x = { config: S, customer: (O == null ? void 0 : O.customer) ?? null };
137
137
  return t.lastBootstrap = x, await k(), typeof document < "u" && (t.visibilityHandler = m, document.addEventListener(
138
138
  "visibilitychange",
@@ -151,35 +151,35 @@ function Ze(e) {
151
151
  }
152
152
  }
153
153
  async function w() {
154
- const u = await i("GET", "/customers/me");
154
+ const u = await r("GET", "/customers/me");
155
155
  return (u == null ? void 0 : u.customer) ?? null;
156
156
  }
157
157
  async function T(u) {
158
- const g = await i("PATCH", "/customers/me", u);
158
+ const g = await r("PATCH", "/customers/me", u);
159
159
  return (g == null ? void 0 : g.customer) ?? null;
160
160
  }
161
161
  async function E() {
162
- const u = await i("GET", "/conversations");
162
+ const u = await r("GET", "/conversations");
163
163
  return (u == null ? void 0 : u.conversations) ?? [];
164
164
  }
165
165
  async function A(u = {}) {
166
- return (await i("POST", "/conversations", u)).conversation;
166
+ return (await r("POST", "/conversations", u)).conversation;
167
167
  }
168
168
  async function q(u) {
169
- return (await i(
169
+ return (await r(
170
170
  "GET",
171
171
  `/conversations/${encodeURIComponent(u)}`
172
172
  )).conversation;
173
173
  }
174
174
  async function M(u, g) {
175
- return (await i(
175
+ return (await r(
176
176
  "PATCH",
177
177
  `/conversations/${encodeURIComponent(u)}`,
178
178
  g
179
179
  )).conversation;
180
180
  }
181
- async function D(u, g) {
182
- return i(
181
+ async function U(u, g) {
182
+ return r(
183
183
  "PATCH",
184
184
  `/conversations/${encodeURIComponent(u)}/read`,
185
185
  { message_id: g }
@@ -189,7 +189,7 @@ function Ze(e) {
189
189
  const p = new URLSearchParams();
190
190
  g.before && p.set("before", g.before), g.since && p.set("since", g.since), g.limit && p.set("limit", String(g.limit));
191
191
  const S = p.toString() ? `?${p.toString()}` : "";
192
- return i(
192
+ return r(
193
193
  "GET",
194
194
  `/conversations/${encodeURIComponent(u)}/messages${S}`
195
195
  );
@@ -203,21 +203,21 @@ function Ze(e) {
203
203
  author: { id: t.userId, type: "user" },
204
204
  created_at: g.created_at || (/* @__PURE__ */ new Date()).toISOString()
205
205
  };
206
- return Array.isArray(g.attachments) && g.attachments.length && (p.payload = { type: "content", attachments: g.attachments }), g.metadata && typeof g.metadata == "object" && (p.metadata = g.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), i(
206
+ return Array.isArray(g.attachments) && g.attachments.length && (p.payload = { type: "content", attachments: g.attachments }), g.metadata && typeof g.metadata == "object" && (p.metadata = g.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), r(
207
207
  "POST",
208
208
  `/conversations/${encodeURIComponent(u)}/messages`,
209
209
  p
210
210
  );
211
211
  }
212
212
  async function K(u, g, p) {
213
- return ae(), i(
213
+ return ae(), r(
214
214
  "POST",
215
215
  `/messages/${encodeURIComponent(u)}/callbacks/${encodeURIComponent(g)}`,
216
216
  p ? { inputs: p } : {}
217
217
  );
218
218
  }
219
219
  async function Q(u) {
220
- const g = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await i("POST", "/attachments", {
220
+ const g = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await r("POST", "/attachments", {
221
221
  mime_type: p,
222
222
  size_bytes: S,
223
223
  name: g
@@ -236,7 +236,7 @@ function Ze(e) {
236
236
  };
237
237
  }
238
238
  async function se(u) {
239
- return i(
239
+ return r(
240
240
  "GET",
241
241
  `/attachments/sign?path=${encodeURIComponent(u)}`
242
242
  );
@@ -253,16 +253,16 @@ function Ze(e) {
253
253
  u.addEventListener(g, (p) => ie(g, p.data));
254
254
  u.addEventListener(
255
255
  "error",
256
- () => r("error", new Error("SSE error"))
256
+ () => i("error", new Error("SSE error"))
257
257
  ), t.eventSource = u, a("open");
258
258
  } catch (u) {
259
- console.error("[transport] SSE open failed", u), r("error", u);
259
+ console.error("[transport] SSE open failed", u), i("error", u);
260
260
  }
261
261
  }
262
262
  function ie(u, g) {
263
263
  try {
264
264
  const p = JSON.parse(g), S = p && typeof p == "object" && "data" in p ? p.data : p;
265
- r(u, S);
265
+ i(u, S);
266
266
  } catch (p) {
267
267
  console.error("[transport] bad SSE payload", u, p);
268
268
  }
@@ -284,7 +284,7 @@ function Ze(e) {
284
284
  const x = O == null ? void 0 : O.last_message_at;
285
285
  return x && (!S || x > S) ? x : S;
286
286
  }, null);
287
- g && (!t.lastActivityAt || g > t.lastActivityAt) && (t.lastActivityAt = g, r("activity", { conversations: u, latestAt: g }), ae());
287
+ g && (!t.lastActivityAt || g > t.lastActivityAt) && (t.lastActivityAt = g, i("activity", { conversations: u, latestAt: g }), ae());
288
288
  } catch (u) {
289
289
  console.error("[transport] poll failed", u);
290
290
  }
@@ -315,7 +315,7 @@ function Ze(e) {
315
315
  ), t.visibilityHandler = null), t.started = !1;
316
316
  }
317
317
  async function y(u) {
318
- return !u || typeof u != "object" ? null : i("POST", "/update", u);
318
+ return !u || typeof u != "object" ? null : r("POST", "/update", u);
319
319
  }
320
320
  function C(u) {
321
321
  if (!(!u || typeof u != "object"))
@@ -328,7 +328,7 @@ function Ze(e) {
328
328
  }
329
329
  }
330
330
  return {
331
- on: n,
331
+ on: s,
332
332
  start: _,
333
333
  stop: f,
334
334
  setPanelOpen: me,
@@ -341,7 +341,7 @@ function Ze(e) {
341
341
  createConversation: A,
342
342
  getConversation: q,
343
343
  patchConversation: M,
344
- markConversationRead: D,
344
+ markConversationRead: U,
345
345
  listMessages: N,
346
346
  postMessage: L,
347
347
  postCallback: K,
@@ -366,9 +366,9 @@ function nt() {
366
366
  if (typeof crypto < "u" && crypto.getRandomValues)
367
367
  crypto.getRandomValues(e);
368
368
  else
369
- for (let n = 0; n < 16; n++) e[n] = Math.floor(Math.random() * 256);
369
+ for (let s = 0; s < 16; s++) e[s] = Math.floor(Math.random() * 256);
370
370
  e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
371
- const t = [...e].map((n) => n.toString(16).padStart(2, "0"));
371
+ const t = [...e].map((s) => s.toString(16).padStart(2, "0"));
372
372
  return t.slice(0, 4).join("") + "-" + t.slice(4, 6).join("") + "-" + t.slice(6, 8).join("") + "-" + t.slice(8, 10).join("") + "-" + t.slice(10, 16).join("");
373
373
  }
374
374
  function st(e) {
@@ -402,22 +402,22 @@ function st(e) {
402
402
  // l'indicateur de frappe quand une action s'exécute.
403
403
  runningActionsByConv: {},
404
404
  connection: "idle"
405
- }), n = [];
406
- n.push(
405
+ }), s = [];
406
+ s.push(
407
407
  e.on("connection", (h) => {
408
408
  t.connection = h;
409
409
  })
410
- ), n.push(
410
+ ), s.push(
411
411
  e.on("message", (h) => {
412
412
  const m = h == null ? void 0 : h.conversation_id, f = h == null ? void 0 : h.message;
413
413
  !m || !(f != null && f.id) || (W(m, f), f.client_msg_id && delete t.streamingByMsgId[f.client_msg_id], ae(m, f.created_at));
414
414
  })
415
- ), n.push(
415
+ ), s.push(
416
416
  e.on("message_stream", (h) => {
417
417
  const m = h == null ? void 0 : h.message_id, f = h == null ? void 0 : h.token;
418
418
  !m || typeof f != "string" || (t.streamingByMsgId[m] = (t.streamingByMsgId[m] || "") + f);
419
419
  })
420
- ), n.push(
420
+ ), s.push(
421
421
  e.on("conversation_updated", (h) => {
422
422
  const m = h == null ? void 0 : h.conversation_id, f = h == null ? void 0 : h.changes;
423
423
  if (!m || !f) return;
@@ -427,23 +427,23 @@ function st(e) {
427
427
  ...f
428
428
  });
429
429
  })
430
- ), n.push(
430
+ ), s.push(
431
431
  e.on("config_updated", (h) => {
432
432
  h != null && h.config && (t.config = h.config);
433
433
  })
434
- ), n.push(
434
+ ), s.push(
435
435
  e.on("action_status", (h) => {
436
436
  const m = h == null ? void 0 : h.conversation_id, f = h == null ? void 0 : h.action_id, y = h == null ? void 0 : h.action_name;
437
437
  if (!m || !f) return;
438
438
  const C = t.runningActionsByConv[m] || {};
439
439
  h.state === "running" ? (C[f] = y || f, t.runningActionsByConv[m] = { ...C }) : h.state === "done" && (delete C[f], t.runningActionsByConv[m] = { ...C });
440
440
  })
441
- ), n.push(
441
+ ), s.push(
442
442
  e.on("activity", (h) => {
443
443
  Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
444
444
  })
445
445
  );
446
- async function r(h) {
446
+ async function i(h) {
447
447
  try {
448
448
  const m = new Promise(
449
449
  (y, C) => setTimeout(
@@ -467,14 +467,14 @@ function st(e) {
467
467
  }
468
468
  }
469
469
  function a() {
470
- for (const h of n)
470
+ for (const h of s)
471
471
  try {
472
472
  h();
473
473
  } catch {
474
474
  }
475
475
  e.stop();
476
476
  }
477
- async function s(h) {
477
+ async function n(h) {
478
478
  const m = ye(h);
479
479
  if (!m) return t.customer;
480
480
  try {
@@ -485,7 +485,7 @@ function st(e) {
485
485
  }
486
486
  return t.customer;
487
487
  }
488
- async function i(h = {}) {
488
+ async function r(h = {}) {
489
489
  const m = await e.createConversation(h), f = t.conversations.findIndex((y) => y.id === m.id);
490
490
  return f === -1 ? t.conversations = [m, ...t.conversations] : t.conversations[f] = m, m;
491
491
  }
@@ -630,10 +630,10 @@ function st(e) {
630
630
  console.error("[store] callback failed", y), h != null && delete t.awaitingCallback[h];
631
631
  }
632
632
  }
633
- const D = /* @__PURE__ */ new Map();
633
+ const U = /* @__PURE__ */ new Map();
634
634
  async function N(h) {
635
635
  if (!h) return null;
636
- const m = D.get(h);
636
+ const m = U.get(h);
637
637
  if (m != null && m.url) {
638
638
  const f = m.expires_at ? Date.parse(m.expires_at) : 0;
639
639
  if (!f || f - Date.now() > 6e4) return m.url;
@@ -641,7 +641,7 @@ function st(e) {
641
641
  try {
642
642
  const f = await e.signAttachment(h);
643
643
  if (f != null && f.signed_url)
644
- return D.set(h, {
644
+ return U.set(h, {
645
645
  url: f.signed_url,
646
646
  expires_at: f.expires_at
647
647
  }), f.signed_url;
@@ -775,10 +775,10 @@ function st(e) {
775
775
  }
776
776
  return {
777
777
  state: t,
778
- start: r,
778
+ start: i,
779
779
  destroy: a,
780
- applyCustomer: s,
781
- createConversation: i,
780
+ applyCustomer: n,
781
+ createConversation: r,
782
782
  openConversation: _,
783
783
  loadMore: k,
784
784
  fetchSinceLast: E,
@@ -1151,55 +1151,55 @@ function ne(e) {
1151
1151
  return Le[xe(e)] || Le[ue];
1152
1152
  }
1153
1153
  function j(e) {
1154
- const t = xe(e), n = ke[t] || ke[ue], r = ke[ue];
1155
- return function(s, i) {
1156
- let l = n[s];
1157
- return l == null && (l = r[s]), l == null ? s : (i && (l = l.replace(
1154
+ const t = xe(e), s = ke[t] || ke[ue], i = ke[ue];
1155
+ return function(n, r) {
1156
+ let l = s[n];
1157
+ return l == null && (l = i[n]), l == null ? n : (r && (l = l.replace(
1158
1158
  /\{(\w+)\}/g,
1159
- (_, k) => i[k] != null ? String(i[k]) : _
1159
+ (_, k) => r[k] != null ? String(r[k]) : _
1160
1160
  )), l);
1161
1161
  };
1162
1162
  }
1163
1163
  function Ie(e, t) {
1164
1164
  if (!Array.isArray(e == null ? void 0 : e.options)) return t;
1165
- const n = e.options.find((r) => (r == null ? void 0 : r.value) === t);
1166
- return (n == null ? void 0 : n.label) || t;
1165
+ const s = e.options.find((i) => (i == null ? void 0 : i.value) === t);
1166
+ return (s == null ? void 0 : s.label) || t;
1167
1167
  }
1168
- function He(e, t, n) {
1169
- return Array.isArray(t) ? t.map((r) => Ie(e, String(r))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ie(e, String(t));
1168
+ function He(e, t, s) {
1169
+ return Array.isArray(t) ? t.map((i) => Ie(e, String(i))).join(", ") : typeof t == "boolean" ? s(t ? "common.yes" : "common.no") : Ie(e, String(t));
1170
1170
  }
1171
- function ht(e, t, n = j()) {
1171
+ function ht(e, t, s = j()) {
1172
1172
  if (!e || !t) return "";
1173
- const r = Array.isArray(e.fields) ? e.fields : [], a = [];
1174
- for (const s of r) {
1175
- if (!(s != null && s.key) || !(s != null && s.label)) continue;
1176
- const i = t[s.key];
1177
- if (i == null || i === "") continue;
1178
- const l = He(s, i, n);
1179
- l && a.push(`${s.label} :
1173
+ const i = Array.isArray(e.fields) ? e.fields : [], a = [];
1174
+ for (const n of i) {
1175
+ if (!(n != null && n.key) || !(n != null && n.label)) continue;
1176
+ const r = t[n.key];
1177
+ if (r == null || r === "") continue;
1178
+ const l = He(n, r, s);
1179
+ l && a.push(`${n.label} :
1180
1180
  ${l}`);
1181
1181
  }
1182
1182
  return a.join(`
1183
1183
 
1184
1184
  `);
1185
1185
  }
1186
- function mt(e, t, n = j()) {
1187
- const r = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
1188
- for (const s of a) {
1189
- if (!(s != null && s.key) || !(s != null && s.label)) continue;
1190
- const i = t == null ? void 0 : t[s.key];
1191
- if (i == null || i === "") continue;
1192
- const l = He(s, i, n);
1186
+ function mt(e, t, s = j()) {
1187
+ const i = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
1188
+ for (const n of a) {
1189
+ if (!(n != null && n.key) || !(n != null && n.label)) continue;
1190
+ const r = t == null ? void 0 : t[n.key];
1191
+ if (r == null || r === "") continue;
1192
+ const l = He(n, r, s);
1193
1193
  if (!l) continue;
1194
- const _ = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
1194
+ const _ = n.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
1195
1195
  `));
1196
- r.push({ label: s.label, value: l, multiline: _ });
1196
+ i.push({ label: n.label, value: l, multiline: _ });
1197
1197
  }
1198
1198
  return {
1199
1199
  kind: "form_response",
1200
1200
  data: {
1201
- title: (e == null ? void 0 : e.title) || n("form.title"),
1202
- fields: r
1201
+ title: (e == null ? void 0 : e.title) || s("form.title"),
1202
+ fields: i
1203
1203
  }
1204
1204
  };
1205
1205
  }
@@ -1212,11 +1212,11 @@ function _e(e) {
1212
1212
  const Ee = "";
1213
1213
  function de(e) {
1214
1214
  let t = e;
1215
- const n = [];
1216
- return t = t.replace(/`([^`\n]+)`/g, (r, a) => {
1217
- const s = n.length;
1218
- return n.push(a), `${Ee}CODE${s}${Ee}`;
1219
- }), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (r, a, s) => _e(s) ? `<a href="${s}" target="_blank" rel="noopener noreferrer">${a}</a>` : a), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (r, a) => `<code class="wm-md-code">${n[+a]}</code>`), t;
1215
+ const s = [];
1216
+ return t = t.replace(/`([^`\n]+)`/g, (i, a) => {
1217
+ const n = s.length;
1218
+ return s.push(a), `${Ee}CODE${n}${Ee}`;
1219
+ }), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, a, n) => _e(n) ? `<a href="${n}" target="_blank" rel="noopener noreferrer">${a}</a>` : a), t = t.replace(/\*\*([^\n*][^\n]*?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__([^\n_][^\n]*?)__/g, "<u>$1</u>"), t = t.replace(/~~([^\n~][^\n]*?)~~/g, "<s>$1</s>"), t = t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g, "$1<em>$2</em>"), t = t.replace(/CODE(\d+)/g, (i, a) => `<code class="wm-md-code">${s[+a]}</code>`), t;
1220
1220
  }
1221
1221
  function qe(e) {
1222
1222
  if (!e) return "";
@@ -1226,75 +1226,75 @@ function qe(e) {
1226
1226
  function ft(e) {
1227
1227
  if (!e) return "";
1228
1228
  const t = ze(e).split(`
1229
- `), n = [];
1230
- let r = 0;
1231
- for (; r < t.length; ) {
1232
- const s = t[r];
1233
- if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1234
- r++;
1229
+ `), s = [];
1230
+ let i = 0;
1231
+ for (; i < t.length; ) {
1232
+ const n = t[i];
1233
+ if (/^\s*```([\w-]*)\s*$/.exec(n)) {
1234
+ i++;
1235
1235
  const k = [];
1236
- for (; r < t.length && !/^\s*```\s*$/.test(t[r]); )
1237
- k.push(t[r]), r++;
1238
- r < t.length && r++, n.push({
1236
+ for (; i < t.length && !/^\s*```\s*$/.test(t[i]); )
1237
+ k.push(t[i]), i++;
1238
+ i < t.length && i++, s.push({
1239
1239
  type: "block",
1240
1240
  html: `<pre class="wm-md-pre"><code>${k.join(`
1241
1241
  `)}</code></pre>`
1242
1242
  });
1243
1243
  continue;
1244
1244
  }
1245
- if (/^\s*[-*]\s+/.test(s)) {
1245
+ if (/^\s*[-*]\s+/.test(n)) {
1246
1246
  const k = [];
1247
- for (; r < t.length; ) {
1248
- const T = /^\s*[-*]\s+(.*)$/.exec(t[r]);
1247
+ for (; i < t.length; ) {
1248
+ const T = /^\s*[-*]\s+(.*)$/.exec(t[i]);
1249
1249
  if (!T) break;
1250
- k.push(T[1]), r++;
1250
+ k.push(T[1]), i++;
1251
1251
  }
1252
1252
  const w = k.map((T) => `<li>${de(T)}</li>`).join("");
1253
- n.push({
1253
+ s.push({
1254
1254
  type: "block",
1255
1255
  html: `<ul class="wm-md-ul">${w}</ul>`
1256
1256
  });
1257
1257
  continue;
1258
1258
  }
1259
- const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1259
+ const l = /^\s*(\d+)\.\s+(.*)$/.exec(n);
1260
1260
  if (l) {
1261
1261
  const k = parseInt(l[1], 10), w = [l[2]];
1262
- for (r++; r < t.length; ) {
1263
- const A = /^\s*\d+\.\s+(.*)$/.exec(t[r]);
1262
+ for (i++; i < t.length; ) {
1263
+ const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
1264
1264
  if (!A) break;
1265
- w.push(A[1]), r++;
1265
+ w.push(A[1]), i++;
1266
1266
  }
1267
1267
  const T = w.map((A) => `<li>${de(A)}</li>`).join(""), E = k !== 1 ? ` start="${k}"` : "";
1268
- n.push({
1268
+ s.push({
1269
1269
  type: "block",
1270
1270
  html: `<ol class="wm-md-ol"${E}>${T}</ol>`
1271
1271
  });
1272
1272
  continue;
1273
1273
  }
1274
- const _ = /^(#{1,6})\s+(.*)$/.exec(s);
1274
+ const _ = /^(#{1,6})\s+(.*)$/.exec(n);
1275
1275
  if (_) {
1276
1276
  const k = _[1].length;
1277
- n.push({
1277
+ s.push({
1278
1278
  type: "block",
1279
1279
  html: `<h${k} class="wm-md-h wm-md-h${k}">${de(_[2])}</h${k}>`
1280
- }), r++;
1280
+ }), i++;
1281
1281
  continue;
1282
1282
  }
1283
- n.push({ type: "text", html: de(s) }), r++;
1283
+ s.push({ type: "text", html: de(n) }), i++;
1284
1284
  }
1285
1285
  let a = "";
1286
- for (let s = 0; s < n.length; s++) {
1287
- const i = n[s];
1288
- a += i.html;
1289
- const l = n[s + 1];
1290
- l && i.type !== "block" && l.type !== "block" && (a += `
1286
+ for (let n = 0; n < s.length; n++) {
1287
+ const r = s[n];
1288
+ a += r.html;
1289
+ const l = s[n + 1];
1290
+ l && r.type !== "block" && l.type !== "block" && (a += `
1291
1291
  `);
1292
1292
  }
1293
1293
  return a;
1294
1294
  }
1295
1295
  function he(e) {
1296
- var n;
1297
- const t = (n = e == null ? void 0 : e.author) == null ? void 0 : n.type;
1296
+ var s;
1297
+ const t = (s = e == null ? void 0 : e.author) == null ? void 0 : s.type;
1298
1298
  return t === "agent_ia" || t === "agent_human";
1299
1299
  }
1300
1300
  function Y(e) {
@@ -1303,20 +1303,20 @@ function Y(e) {
1303
1303
  return Number.isFinite(t) ? t : null;
1304
1304
  }
1305
1305
  function Be(e, t) {
1306
- let n = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
1307
- for (const r of t)
1308
- r != null && r.created_at && r.created_at > n && (n = r.created_at);
1309
- return n;
1306
+ let s = (e == null ? void 0 : e.last_message_at) || (e == null ? void 0 : e.updated_at) || (e == null ? void 0 : e.created_at) || "";
1307
+ for (const i of t)
1308
+ i != null && i.created_at && i.created_at > s && (s = i.created_at);
1309
+ return s;
1310
1310
  }
1311
1311
  function _t(e, t) {
1312
- var n, r, a;
1313
- for (let s = t.length - 1; s >= 0; s--) {
1314
- const i = t[s];
1315
- if (!i) continue;
1316
- const l = typeof i.text_md == "string" ? i.text_md.trim() : "";
1312
+ var s, i, a;
1313
+ for (let n = t.length - 1; n >= 0; n--) {
1314
+ const r = t[n];
1315
+ if (!r) continue;
1316
+ const l = typeof r.text_md == "string" ? r.text_md.trim() : "";
1317
1317
  if (l)
1318
- return (((n = i.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
1319
- const _ = (r = i.payload) == null ? void 0 : r.attachments;
1318
+ return (((s = r.author) == null ? void 0 : s.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
1319
+ const _ = (i = r.payload) == null ? void 0 : i.attachments;
1320
1320
  if (Array.isArray(_) && _.length) return "📎 Pièce jointe";
1321
1321
  }
1322
1322
  return (e == null ? void 0 : e.last_message_preview) || (e == null ? void 0 : e.preview) || ((a = e == null ? void 0 : e.metadata) == null ? void 0 : a.last_preview) || "";
@@ -1324,32 +1324,32 @@ function _t(e, t) {
1324
1324
  function gt(e, t) {
1325
1325
  return (e == null ? void 0 : e.name) || ((e == null ? void 0 : e.type) === "user" ? t("common.you") : (e == null ? void 0 : e.type) === "agent_human" ? t("common.agent") : (e == null ? void 0 : e.type) === "agent_ia" ? t("common.aiAssistant") : t("common.system"));
1326
1326
  }
1327
- function pt(e, t, n, r) {
1327
+ function pt(e, t, s, i) {
1328
1328
  const a = [
1329
- `# ${e.name || n("common.conversation")}`,
1330
- e.created_at ? n("export.createdOn", {
1331
- date: new Date(e.created_at).toLocaleString(r)
1329
+ `# ${e.name || s("common.conversation")}`,
1330
+ e.created_at ? s("export.createdOn", {
1331
+ date: new Date(e.created_at).toLocaleString(i)
1332
1332
  }) : "",
1333
1333
  ""
1334
1334
  ];
1335
- for (const s of t) {
1336
- if (!s) continue;
1337
- const i = (s.text_md || "").trim();
1338
- if (!i) continue;
1339
- const l = gt(s.author, n), _ = s.created_at ? new Date(s.created_at).toLocaleString(r) : "";
1340
- a.push(`[${_}] ${l} :`), a.push(i), a.push("");
1335
+ for (const n of t) {
1336
+ if (!n) continue;
1337
+ const r = (n.text_md || "").trim();
1338
+ if (!r) continue;
1339
+ const l = gt(n.author, s), _ = n.created_at ? new Date(n.created_at).toLocaleString(i) : "";
1340
+ a.push(`[${_}] ${l} :`), a.push(r), a.push("");
1341
1341
  }
1342
1342
  return a.join(`
1343
1343
  `);
1344
1344
  }
1345
- function vt(e, t, n = j(), r) {
1345
+ function vt(e, t, s = j(), i) {
1346
1346
  if (!e) return;
1347
- const a = pt(e, t || [], n, ne(r)), s = new Blob([a], { type: "text/plain;charset=utf-8" });
1347
+ const a = pt(e, t || [], s, ne(i)), n = new Blob([a], { type: "text/plain;charset=utf-8" });
1348
1348
  try {
1349
- const i = URL.createObjectURL(s), l = document.createElement("a");
1350
- l.href = i, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(i), 1e3);
1351
- } catch (i) {
1352
- console.error("[ww-messenger] export failed", i);
1349
+ const r = URL.createObjectURL(n), l = document.createElement("a");
1350
+ l.href = r, l.download = `${(e.name || "conversation").replace(/[^a-z0-9-_]+/gi, "_")}.txt`, document.body.appendChild(l), l.click(), document.body.removeChild(l), setTimeout(() => URL.revokeObjectURL(r), 1e3);
1351
+ } catch (r) {
1352
+ console.error("[ww-messenger] export failed", r);
1353
1353
  }
1354
1354
  }
1355
1355
  const yt = {
@@ -1442,10 +1442,10 @@ const yt = {
1442
1442
  if (t === "default") {
1443
1443
  try {
1444
1444
  t = await Notification.requestPermission();
1445
- } catch (n) {
1445
+ } catch (s) {
1446
1446
  console.warn(
1447
1447
  "[ww-messenger] notif permission request failed",
1448
- n
1448
+ s
1449
1449
  ), t = "denied";
1450
1450
  }
1451
1451
  this.notifPermission = t;
@@ -1464,8 +1464,8 @@ const yt = {
1464
1464
  onMessageRevealed(e, t) {
1465
1465
  var a;
1466
1466
  if (!this.soundEnabled && !this.browserNotifEnabled || !t || !e || !he(e)) return;
1467
- const n = typeof document < "u" && document.hidden;
1468
- this.isOpen && !n && ((a = this.currentConv) == null ? void 0 : a.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
1467
+ const s = typeof document < "u" && document.hidden;
1468
+ this.isOpen && !s && ((a = this.currentConv) == null ? void 0 : a.id) === t || (this.soundEnabled && this.playNotificationSound(), this.browserNotifEnabled && this.showBrowserNotification(t, e));
1469
1469
  },
1470
1470
  playNotificationSound() {
1471
1471
  if (typeof window > "u") return;
@@ -1479,16 +1479,16 @@ const yt = {
1479
1479
  t.resume();
1480
1480
  } catch {
1481
1481
  }
1482
- const n = t.currentTime, r = t.createOscillator(), a = t.createGain();
1483
- r.connect(a), a.connect(t.destination), r.type = "sine", r.frequency.setValueAtTime(880, n), r.frequency.exponentialRampToValueAtTime(1320, n + 0.08), a.gain.setValueAtTime(0, n), a.gain.linearRampToValueAtTime(0.12, n + 0.02), a.gain.exponentialRampToValueAtTime(1e-4, n + 0.28), r.start(n), r.stop(n + 0.32);
1482
+ const s = t.currentTime, i = t.createOscillator(), a = t.createGain();
1483
+ i.connect(a), a.connect(t.destination), i.type = "sine", i.frequency.setValueAtTime(880, s), i.frequency.exponentialRampToValueAtTime(1320, s + 0.08), a.gain.setValueAtTime(0, s), a.gain.linearRampToValueAtTime(0.12, s + 0.02), a.gain.exponentialRampToValueAtTime(1e-4, s + 0.28), i.start(s), i.stop(s + 0.32);
1484
1484
  } catch {
1485
1485
  }
1486
1486
  },
1487
1487
  showBrowserNotification(e, t) {
1488
1488
  if (typeof Notification > "u" || Notification.permission !== "granted") return;
1489
- const n = t == null ? void 0 : t.author, r = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.name) || (r ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), i = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = i ? i.slice(0, 140) : this.t("notification.youHaveNewMessage");
1489
+ const s = t == null ? void 0 : t.author, i = !s || s.type === "agent_ia", n = ((s == null ? void 0 : s.name) || (i ? this.agentName : "") || this.t("launcher.theAgent")) + this.t("launcher.repliedToYou"), r = typeof (t == null ? void 0 : t.text_md) == "string" ? t.text_md.trim() : "", l = r ? r.slice(0, 140) : this.t("notification.youHaveNewMessage");
1490
1490
  try {
1491
- const _ = new Notification(s, {
1491
+ const _ = new Notification(n, {
1492
1492
  body: l,
1493
1493
  tag: `wm-${e}`,
1494
1494
  renotify: !1,
@@ -1559,7 +1559,15 @@ const yt = {
1559
1559
  // used by the activity-driven background fetch. Reset by
1560
1560
  // teardownLiveReveal.
1561
1561
  _liveRevealOff: null,
1562
- _liveRevealConvSnapshot: null
1562
+ _liveRevealConvSnapshot: null,
1563
+ // Per-conv high-water mark: the server `created_at` of the newest
1564
+ // message we've already accounted for. Used by paceLiveMessage to
1565
+ // tell a realtime arrival (created_at > mark → ring) from replayed
1566
+ // history / activity-delta catch-up (<= mark → reveal silently).
1567
+ // Distinct from `_liveRevealConvSnapshot`, which handleLiveActivity
1568
+ // advances eagerly and so can't serve as the notification gate.
1569
+ // Advanced ONLY in paceLiveMessage; persists across conv switches.
1570
+ _liveHwm: {}
1563
1571
  };
1564
1572
  },
1565
1573
  methods: {
@@ -1580,21 +1588,26 @@ const yt = {
1580
1588
  // the activity isn't replayed via SSE, so we fetch it explicitly and
1581
1589
  // run it through pacing.
1582
1590
  setupLiveReveal() {
1583
- var n;
1591
+ var s, i;
1584
1592
  if (!this.transport) return;
1585
1593
  this.teardownLiveReveal();
1586
- const e = this.transport.on("message", (r) => {
1587
- const a = r == null ? void 0 : r.conversation_id, s = r == null ? void 0 : r.message;
1588
- a && s && this.paceLiveMessage(s, a);
1594
+ const e = this.transport.on("message", (a) => {
1595
+ const n = a == null ? void 0 : a.conversation_id, r = a == null ? void 0 : a.message;
1596
+ n && r && this.paceLiveMessage(r, n);
1589
1597
  });
1590
1598
  this._liveRevealConvSnapshot = new Map(
1591
- (((n = this.s) == null ? void 0 : n.conversations) || []).map((r) => [
1592
- r.id,
1593
- (r == null ? void 0 : r.last_message_at) || ""
1599
+ (((s = this.s) == null ? void 0 : s.conversations) || []).map((a) => [
1600
+ a.id,
1601
+ (a == null ? void 0 : a.last_message_at) || ""
1602
+ ])
1603
+ ), this._liveHwm = Object.fromEntries(
1604
+ (((i = this.s) == null ? void 0 : i.conversations) || []).map((a) => [
1605
+ a.id,
1606
+ (a == null ? void 0 : a.last_message_at) || ""
1594
1607
  ])
1595
1608
  );
1596
- const t = this.transport.on("activity", (r) => {
1597
- this.handleLiveActivity(r);
1609
+ const t = this.transport.on("activity", (a) => {
1610
+ this.handleLiveActivity(a);
1598
1611
  });
1599
1612
  this._liveRevealOff = () => {
1600
1613
  try {
@@ -1615,7 +1628,7 @@ const yt = {
1615
1628
  }
1616
1629
  this._liveRevealOff = null;
1617
1630
  }
1618
- this._liveRevealConvSnapshot = null;
1631
+ this._liveRevealConvSnapshot = null, this._liveHwm = {};
1619
1632
  },
1620
1633
  // Compare the activity payload against the snapshot taken at the
1621
1634
  // previous tick (or at setup time). For each conv whose
@@ -1624,25 +1637,25 @@ const yt = {
1624
1637
  // on background convs when SSE wasn't open at the moment they
1625
1638
  // arrived.
1626
1639
  async handleLiveActivity(e) {
1627
- var a, s;
1640
+ var a, n;
1628
1641
  const t = e == null ? void 0 : e.conversations;
1629
1642
  if (!Array.isArray(t) || !this.store) return;
1630
- const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), r = [];
1631
- for (const i of t) {
1632
- if (!(i != null && i.id)) continue;
1633
- const l = i.last_message_at || "";
1643
+ const s = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), i = [];
1644
+ for (const r of t) {
1645
+ if (!(r != null && r.id)) continue;
1646
+ const l = r.last_message_at || "";
1634
1647
  if (!l) continue;
1635
- const _ = n.get(i.id) || "";
1636
- l > _ && r.push(i.id);
1648
+ const _ = s.get(r.id) || "";
1649
+ l > _ && i.push(r.id);
1637
1650
  }
1638
1651
  this._liveRevealConvSnapshot = new Map(
1639
- t.map((i) => [i.id, (i == null ? void 0 : i.last_message_at) || ""])
1652
+ t.map((r) => [r.id, (r == null ? void 0 : r.last_message_at) || ""])
1640
1653
  );
1641
- for (const i of r)
1654
+ for (const r of i)
1642
1655
  try {
1643
- const l = await ((s = (a = this.store).fetchSinceLast) == null ? void 0 : s.call(a, i));
1656
+ const l = await ((n = (a = this.store).fetchSinceLast) == null ? void 0 : n.call(a, r));
1644
1657
  if (!Array.isArray(l)) continue;
1645
- for (const _ of l) this.paceLiveMessage(_, i);
1658
+ for (const _ of l) this.paceLiveMessage(_, r);
1646
1659
  } catch (l) {
1647
1660
  console.error(
1648
1661
  "[ww-messenger] activity delta fetch failed",
@@ -1656,15 +1669,15 @@ const yt = {
1656
1669
  // - inter-bubble gap scales with message length (reading time),
1657
1670
  // bounded by MIN/MAX_TYPING_MS.
1658
1671
  scheduleReveal(e, t) {
1659
- const n = this.revealPacing, r = Date.now(), a = ((e == null ? void 0 : e.text_md) || "").length, s = Math.min(
1660
- n.maxTypingMs,
1661
- Math.max(n.minTypingMs, a * n.msPerChar)
1672
+ const s = this.revealPacing, i = Date.now(), a = ((e == null ? void 0 : e.text_md) || "").length, n = Math.min(
1673
+ s.maxTypingMs,
1674
+ Math.max(s.minTypingMs, a * s.msPerChar)
1662
1675
  ), l = Math.max(
1663
- r + n.firstRevealDelayMs,
1664
- this.nextRevealAt + n.pauseBetweenMs
1665
- ) + s;
1676
+ i + s.firstRevealDelayMs,
1677
+ this.nextRevealAt + s.pauseBetweenMs
1678
+ ) + n;
1666
1679
  this.nextRevealAt = l;
1667
- const _ = Math.max(0, l - r), k = e.id, w = setTimeout(() => {
1680
+ const _ = Math.max(0, l - i), k = e.id, w = setTimeout(() => {
1668
1681
  this.revealedAt = { ...this.revealedAt, [k]: Date.now() }, this.revealTimers = this.revealTimers.filter((T) => T !== w), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
1669
1682
  }, _);
1670
1683
  this.revealTimers.push(w);
@@ -1677,26 +1690,26 @@ const yt = {
1677
1690
  paceMessages(e, t) {
1678
1691
  var a;
1679
1692
  if (!Array.isArray(e) || !e.length) return;
1680
- const n = Date.now(), r = { ...this.revealedAt };
1681
- for (const s of e) {
1682
- if ((s == null ? void 0 : s.id) == null || r[s.id] !== void 0) continue;
1683
- if (!he(s)) {
1684
- r[s.id] = n;
1693
+ const s = Date.now(), i = { ...this.revealedAt };
1694
+ for (const n of e) {
1695
+ if ((n == null ? void 0 : n.id) == null || i[n.id] !== void 0) continue;
1696
+ if (!he(n)) {
1697
+ i[n.id] = s;
1685
1698
  continue;
1686
1699
  }
1687
- const i = s != null && s.created_at ? Date.parse(s.created_at) : NaN;
1688
- if (!Number.isFinite(i) || i < this.convOpenedAt) {
1689
- r[s.id] = n;
1700
+ const r = n != null && n.created_at ? Date.parse(n.created_at) : NaN;
1701
+ if (!Number.isFinite(r) || r < this.convOpenedAt) {
1702
+ i[n.id] = s;
1690
1703
  continue;
1691
1704
  }
1692
- const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, _ = Array.isArray((a = s == null ? void 0 : s.payload) == null ? void 0 : a.attachments) && s.payload.attachments.length > 0;
1705
+ const l = typeof (n == null ? void 0 : n.text_md) == "string" && n.text_md.trim().length > 0, _ = Array.isArray((a = n == null ? void 0 : n.payload) == null ? void 0 : a.attachments) && n.payload.attachments.length > 0;
1693
1706
  if (!l && !_) {
1694
- r[s.id] = n;
1707
+ i[n.id] = s;
1695
1708
  continue;
1696
1709
  }
1697
- r[s.id] = 0, this.scheduleReveal(s, t);
1710
+ i[n.id] = 0, this.scheduleReveal(n, t);
1698
1711
  }
1699
- this.revealedAt = r;
1712
+ this.revealedAt = i;
1700
1713
  },
1701
1714
  // Pace a single live message from any conversation. Called from the
1702
1715
  // transport 'message' subscription (live SSE arrival) and from the
@@ -1705,18 +1718,28 @@ const yt = {
1705
1718
  // the watcher path and the live path can both fire for the same
1706
1719
  // message without double-scheduling.
1707
1720
  //
1708
- // No `convOpenedAt` freshness gate: a transport-emitted message is
1709
- // by definition live, even on convs the user never viewed this
1710
- // session.
1721
+ // Realtime gate on a per-conv high-water mark of server `created_at`
1722
+ // (see `_liveHwm`). A transport `message` burst can be replayed and an
1723
+ // activity-delta `fetchSinceLast` returns history the user already saw
1724
+ // — most visibly on reopening the panel. We ring ONLY for a message
1725
+ // strictly newer than the latest one already accounted for in its
1726
+ // conversation; anything at/before the mark reveals instantly and
1727
+ // silently. Both sides of the comparison are server timestamps, so
1728
+ // this is immune to client clock skew.
1711
1729
  paceLiveMessage(e, t) {
1712
- var a;
1730
+ var l;
1713
1731
  if (!(e != null && e.id) || this.revealedAt[e.id] !== void 0) return;
1714
1732
  if (!he(e)) {
1715
1733
  this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1716
1734
  return;
1717
1735
  }
1718
- const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, r = Array.isArray((a = e == null ? void 0 : e.payload) == null ? void 0 : a.attachments) && e.payload.attachments.length > 0;
1719
- if (!n && !r) {
1736
+ const s = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, i = Array.isArray((l = e == null ? void 0 : e.payload) == null ? void 0 : l.attachments) && e.payload.attachments.length > 0;
1737
+ if (!s && !i) {
1738
+ this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1739
+ return;
1740
+ }
1741
+ const a = this._liveHwm[t], n = (e == null ? void 0 : e.created_at) || "";
1742
+ if (n && (a === void 0 || n > a) && (this._liveHwm = { ...this._liveHwm, [t]: n }), !(a !== void 0 && n && n > a)) {
1720
1743
  this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1721
1744
  return;
1722
1745
  }
@@ -1782,12 +1805,12 @@ const yt = {
1782
1805
  // messages, or when the pointer is already at/ahead of the
1783
1806
  // candidate id.
1784
1807
  markConvRead(e) {
1785
- var s, i;
1808
+ var n, r;
1786
1809
  if (!(e != null && e.id) || e._draft || !this.store) return;
1787
- const t = ((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e.id]) || [], n = At(t);
1788
- if (n == null) return;
1789
- const r = Y(e.last_read_message_id), a = Y(n);
1790
- a != null && (r != null && a <= r || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
1810
+ const t = ((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e.id]) || [], s = At(t);
1811
+ if (s == null) return;
1812
+ const i = Y(e.last_read_message_id), a = Y(s);
1813
+ a != null && (i != null && a <= i || (this._readMarkerPending = { convId: e.id, messageId: s }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
1791
1814
  const l = this._readMarkerPending;
1792
1815
  this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
1793
1816
  l.convId,
@@ -1799,17 +1822,17 @@ const yt = {
1799
1822
  };
1800
1823
  function At(e) {
1801
1824
  for (let t = e.length - 1; t >= 0; t--) {
1802
- const n = e[t];
1803
- if (!(!n || n._pending) && Y(n.id) != null)
1804
- return n.id;
1825
+ const s = e[t];
1826
+ if (!(!s || s._pending) && Y(s.id) != null)
1827
+ return s.id;
1805
1828
  }
1806
1829
  return null;
1807
1830
  }
1808
1831
  const P = (e, t) => {
1809
- const n = e.__vccOpts || e;
1810
- for (const [r, a] of t)
1811
- n[r] = a;
1812
- return n;
1832
+ const s = e.__vccOpts || e;
1833
+ for (const [i, a] of t)
1834
+ s[i] = a;
1835
+ return s;
1813
1836
  }, St = {
1814
1837
  name: "WmHumanAvatar",
1815
1838
  props: {
@@ -1831,24 +1854,24 @@ const P = (e, t) => {
1831
1854
  }
1832
1855
  }
1833
1856
  }, Mt = ["src", "alt"];
1834
- function Tt(e, t, n, r, a, s) {
1857
+ function Tt(e, t, s, i, a, n) {
1835
1858
  return c(), d("div", {
1836
- class: R(["wm-huav", { "wm-huav--tail": n.tail }]),
1859
+ class: R(["wm-huav", { "wm-huav--tail": s.tail }]),
1837
1860
  style: z({
1838
- width: n.size + "px",
1839
- height: n.size + "px",
1840
- "--wm-avr": Math.round(n.size * 0.32) + "px",
1841
- background: s.bg
1861
+ width: s.size + "px",
1862
+ height: s.size + "px",
1863
+ "--wm-avr": Math.round(s.size * 0.32) + "px",
1864
+ background: n.bg
1842
1865
  })
1843
1866
  }, [
1844
- n.avatarUrl ? (c(), d("img", {
1867
+ s.avatarUrl ? (c(), d("img", {
1845
1868
  key: 0,
1846
- src: n.avatarUrl,
1847
- alt: n.name || ""
1869
+ src: s.avatarUrl,
1870
+ alt: s.name || ""
1848
1871
  }, null, 8, Mt)) : (c(), d("span", {
1849
1872
  key: 1,
1850
- style: z({ fontSize: n.size * 0.36 + "px" })
1851
- }, v(s.initials), 5))
1873
+ style: z({ fontSize: s.size * 0.36 + "px" })
1874
+ }, v(n.initials), 5))
1852
1875
  ], 6);
1853
1876
  }
1854
1877
  const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d"]]), xt = 3, Ot = {
@@ -1877,9 +1900,9 @@ const ve = /* @__PURE__ */ P(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
1877
1900
  return this.peeks.slice(0, xt).reverse();
1878
1901
  }
1879
1902
  }
1880
- }, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Ut = { class: "wm-peek__name" }, Dt = { class: "wm-peek__action" }, Nt = { class: "wm-peek__text" }, Ft = ["onClick"], jt = ["aria-label"], Ht = ["aria-label"];
1881
- function zt(e, t, n, r, a, s) {
1882
- const i = B("HumanAvatar");
1903
+ }, Rt = ["aria-label", "onClick", "onKeydown"], Lt = ["aria-label", "onClick"], It = { class: "wm-peek__avatar" }, Et = ["aria-label"], Bt = { class: "wm-peek__body" }, Pt = { class: "wm-peek__head" }, Dt = { class: "wm-peek__name" }, Ut = { class: "wm-peek__action" }, Nt = { class: "wm-peek__text" }, Ft = ["onClick"], jt = ["aria-label"], Ht = ["aria-label"];
1904
+ function zt(e, t, s, i, a, n) {
1905
+ const r = B("HumanAvatar");
1883
1906
  return c(), d("div", {
1884
1907
  class: "wm-launcherWrap",
1885
1908
  onMouseenter: t[1] || (t[1] = (l) => e.$emit("hover", !0)),
@@ -1889,21 +1912,21 @@ function zt(e, t, n, r, a, s) {
1889
1912
  }, [
1890
1913
  $(Ne, { name: "wm-peek" }, {
1891
1914
  default: Fe(() => [
1892
- s.visiblePeeks.length ? (c(), d("div", {
1915
+ n.visiblePeeks.length ? (c(), d("div", {
1893
1916
  key: 0,
1894
- class: R(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
1917
+ class: R(["wm-peekStack", { "wm-peekStack--multi": n.visiblePeeks.length > 1 }])
1895
1918
  }, [
1896
- (c(!0), d(I, null, F(s.visiblePeeks, (l, _) => (c(), d("div", {
1919
+ (c(!0), d(I, null, F(n.visiblePeeks, (l, _) => (c(), d("div", {
1897
1920
  key: l.convId,
1898
1921
  class: "wm-peek",
1899
1922
  style: z({
1900
- "--depth": s.visiblePeeks.length - 1 - _,
1923
+ "--depth": n.visiblePeeks.length - 1 - _,
1901
1924
  zIndex: _ + 1
1902
1925
  }),
1903
1926
  role: "button",
1904
1927
  tabindex: "0",
1905
- "aria-label": s.t("launcher.openConversationWith", {
1906
- name: l.senderName || s.t("launcher.theAgent")
1928
+ "aria-label": n.t("launcher.openConversationWith", {
1929
+ name: l.senderName || n.t("launcher.theAgent")
1907
1930
  }),
1908
1931
  onClick: (k) => e.$emit("open", l.convId),
1909
1932
  onKeydown: [
@@ -1914,7 +1937,7 @@ function zt(e, t, n, r, a, s) {
1914
1937
  o("button", {
1915
1938
  type: "button",
1916
1939
  class: "wm-peek__close",
1917
- "aria-label": s.t("launcher.dismiss"),
1940
+ "aria-label": n.t("launcher.dismiss"),
1918
1941
  onClick: J((k) => e.$emit("dismiss", l.convId), ["stop"])
1919
1942
  }, [...t[5] || (t[5] = [
1920
1943
  o("svg", {
@@ -1932,7 +1955,7 @@ function zt(e, t, n, r, a, s) {
1932
1955
  ], -1)
1933
1956
  ])], 8, Lt),
1934
1957
  o("div", It, [
1935
- $(i, {
1958
+ $(r, {
1936
1959
  name: l.senderName,
1937
1960
  "avatar-url": l.senderAvatarUrl,
1938
1961
  size: 34
@@ -1940,13 +1963,13 @@ function zt(e, t, n, r, a, s) {
1940
1963
  l.count > 1 ? (c(), d("span", {
1941
1964
  key: 0,
1942
1965
  class: "wm-peek__avatarBadge",
1943
- "aria-label": s.t("launcher.unreadMessages", { count: l.count })
1966
+ "aria-label": n.t("launcher.unreadMessages", { count: l.count })
1944
1967
  }, v(l.count > 9 ? "9+" : l.count), 9, Et)) : b("", !0)
1945
1968
  ]),
1946
1969
  o("div", Bt, [
1947
1970
  o("div", Pt, [
1948
- o("span", Ut, v(l.senderName || s.t("common.agent")), 1),
1949
- o("span", Dt, v(s.t("launcher.repliedToYou")), 1)
1971
+ o("span", Dt, v(l.senderName || n.t("common.agent")), 1),
1972
+ o("span", Ut, v(n.t("launcher.repliedToYou")), 1)
1950
1973
  ]),
1951
1974
  o("p", Nt, v(l.preview), 1)
1952
1975
  ]),
@@ -1954,7 +1977,7 @@ function zt(e, t, n, r, a, s) {
1954
1977
  type: "button",
1955
1978
  class: "wm-peek__open",
1956
1979
  onClick: J((k) => e.$emit("open", l.convId), ["stop"])
1957
- }, v(s.t("common.open")), 9, Ft)
1980
+ }, v(n.t("common.open")), 9, Ft)
1958
1981
  ], 44, Rt))), 128))
1959
1982
  ], 2)) : b("", !0)
1960
1983
  ]),
@@ -1963,7 +1986,7 @@ function zt(e, t, n, r, a, s) {
1963
1986
  o("button", {
1964
1987
  type: "button",
1965
1988
  class: "wm-launcher",
1966
- "aria-label": s.t("launcher.open"),
1989
+ "aria-label": n.t("launcher.open"),
1967
1990
  onClick: t[0] || (t[0] = (l) => e.$emit("open"))
1968
1991
  }, [
1969
1992
  t[6] || (t[6] = o("svg", {
@@ -1979,15 +2002,15 @@ function zt(e, t, n, r, a, s) {
1979
2002
  }, [
1980
2003
  o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
1981
2004
  ], -1)),
1982
- n.unreadCount > 0 ? (c(), d("span", {
2005
+ s.unreadCount > 0 ? (c(), d("span", {
1983
2006
  key: 0,
1984
2007
  class: "wm-launcher__badge",
1985
- "aria-label": n.unreadCount > 1 ? s.t("launcher.unreadConversationsMany", {
1986
- count: n.unreadCount
1987
- }) : s.t("launcher.unreadConversationsOne", {
1988
- count: n.unreadCount
2008
+ "aria-label": s.unreadCount > 1 ? n.t("launcher.unreadConversationsMany", {
2009
+ count: s.unreadCount
2010
+ }) : n.t("launcher.unreadConversationsOne", {
2011
+ count: s.unreadCount
1989
2012
  })
1990
- }, v(n.unreadCount > 9 ? "9+" : n.unreadCount), 9, Ht)) : b("", !0)
2013
+ }, v(s.unreadCount > 9 ? "9+" : s.unreadCount), 9, Ht)) : b("", !0)
1991
2014
  ], 8, jt)
1992
2015
  ], 32);
1993
2016
  }
@@ -2024,37 +2047,37 @@ const qt = /* @__PURE__ */ P(Ot, [["render", zt], ["__scopeId", "data-v-d81459bc
2024
2047
  key: 0,
2025
2048
  class: "wm-aiav__pulse"
2026
2049
  }, Kt = ["src", "alt"], Wt = ["width", "height"];
2027
- function Gt(e, t, n, r, a, s) {
2050
+ function Gt(e, t, s, i, a, n) {
2028
2051
  return c(), d("div", {
2029
- class: R(["wm-aiav", { "wm-aiav--tail": n.tail }]),
2052
+ class: R(["wm-aiav", { "wm-aiav--tail": s.tail }]),
2030
2053
  style: z({
2031
- width: n.size + "px",
2032
- height: n.size + "px",
2033
- "--wm-avr": n.size * 0.32 + "px"
2054
+ width: s.size + "px",
2055
+ height: s.size + "px",
2056
+ "--wm-avr": s.size * 0.32 + "px"
2034
2057
  })
2035
2058
  }, [
2036
- n.pulse ? (c(), d("div", $t)) : b("", !0),
2059
+ s.pulse ? (c(), d("div", $t)) : b("", !0),
2037
2060
  o("div", {
2038
2061
  class: R(["wm-aiav__inner", {
2039
- "wm-aiav__inner--glow": n.pulse,
2040
- "wm-aiav__inner--img": !!n.imageUrl,
2041
- "wm-aiav__inner--initials": !n.imageUrl && !!s.initials
2062
+ "wm-aiav__inner--glow": s.pulse,
2063
+ "wm-aiav__inner--img": !!s.imageUrl,
2064
+ "wm-aiav__inner--initials": !s.imageUrl && !!n.initials
2042
2065
  }]),
2043
2066
  style: z(
2044
- !n.imageUrl && s.initials ? { background: s.bgColor } : null
2067
+ !s.imageUrl && n.initials ? { background: n.bgColor } : null
2045
2068
  )
2046
2069
  }, [
2047
- n.imageUrl ? (c(), d("img", {
2070
+ s.imageUrl ? (c(), d("img", {
2048
2071
  key: 0,
2049
- src: n.imageUrl,
2050
- alt: n.name || ""
2051
- }, null, 8, Kt)) : s.initials ? (c(), d("span", {
2072
+ src: s.imageUrl,
2073
+ alt: s.name || ""
2074
+ }, null, 8, Kt)) : n.initials ? (c(), d("span", {
2052
2075
  key: 1,
2053
- style: z({ fontSize: n.size * 0.36 + "px" })
2054
- }, v(s.initials), 5)) : (c(), d("svg", {
2076
+ style: z({ fontSize: s.size * 0.36 + "px" })
2077
+ }, v(n.initials), 5)) : (c(), d("svg", {
2055
2078
  key: 2,
2056
- width: n.size * 0.5,
2057
- height: n.size * 0.5,
2079
+ width: s.size * 0.5,
2080
+ height: s.size * 0.5,
2058
2081
  viewBox: "0 0 24 24",
2059
2082
  fill: "none",
2060
2083
  "aria-hidden": "true"
@@ -2111,29 +2134,29 @@ const oe = /* @__PURE__ */ P(Vt, [["render", Gt], ["__scopeId", "data-v-6f7f685d
2111
2134
  key: 0,
2112
2135
  class: "wm-team__label"
2113
2136
  };
2114
- function en(e, t, n, r, a, s) {
2115
- return s.visible ? (c(), d("div", Jt, [
2137
+ function en(e, t, s, i, a, n) {
2138
+ return n.visible ? (c(), d("div", Jt, [
2116
2139
  o("div", {
2117
2140
  class: "wm-team__stack",
2118
- style: z({ width: s.stackWidth + "px" })
2141
+ style: z({ width: n.stackWidth + "px" })
2119
2142
  }, [
2120
- (c(!0), d(I, null, F(n.members.slice(0, 3), (i, l) => (c(), d("div", {
2143
+ (c(!0), d(I, null, F(s.members.slice(0, 3), (r, l) => (c(), d("div", {
2121
2144
  key: l,
2122
2145
  class: "wm-team__pill",
2123
2146
  style: z({
2124
2147
  left: l * 13 + "px",
2125
2148
  zIndex: 3 - l,
2126
- background: s.colorFor(i)
2149
+ background: n.colorFor(r)
2127
2150
  })
2128
2151
  }, [
2129
- i.avatar_url ? (c(), d("img", {
2152
+ r.avatar_url ? (c(), d("img", {
2130
2153
  key: 0,
2131
- src: i.avatar_url,
2132
- alt: i.name || ""
2133
- }, null, 8, Xt)) : (c(), d("span", Qt, v(s.initialsFor(i)), 1))
2154
+ src: r.avatar_url,
2155
+ alt: r.name || ""
2156
+ }, null, 8, Xt)) : (c(), d("span", Qt, v(n.initialsFor(r)), 1))
2134
2157
  ], 4))), 128))
2135
2158
  ], 4),
2136
- n.responseLabel ? (c(), d("span", Zt, v(n.responseLabel), 1)) : b("", !0)
2159
+ s.responseLabel ? (c(), d("span", Zt, v(s.responseLabel), 1)) : b("", !0)
2137
2160
  ])) : b("", !0);
2138
2161
  }
2139
2162
  const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063"]]), nn = {
@@ -2169,10 +2192,10 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
2169
2192
  displayedTeamMembers() {
2170
2193
  const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
2171
2194
  if (e.length <= 3) return e;
2172
- const t = (/* @__PURE__ */ new Date()).getHours() % e.length, n = [];
2173
- for (let r = 0; r < 3; r++)
2174
- n.push(e[(t + r) % e.length]);
2175
- return n;
2195
+ const t = (/* @__PURE__ */ new Date()).getHours() % e.length, s = [];
2196
+ for (let i = 0; i < 3; i++)
2197
+ s.push(e[(t + i) % e.length]);
2198
+ return s;
2176
2199
  }
2177
2200
  }
2178
2201
  }, sn = { class: "wm-header" }, rn = ["aria-label"], an = {
@@ -2182,14 +2205,14 @@ const tn = /* @__PURE__ */ P(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
2182
2205
  key: 3,
2183
2206
  class: "wm-header__fill"
2184
2207
  }, un = { class: "wm-header__actions" }, hn = ["aria-label", "title"], mn = ["aria-label", "title"];
2185
- function fn(e, t, n, r, a, s) {
2186
- const i = B("AIAvatar"), l = B("TeamAvatars");
2208
+ function fn(e, t, s, i, a, n) {
2209
+ const r = B("AIAvatar"), l = B("TeamAvatars");
2187
2210
  return c(), d("div", sn, [
2188
- n.showBack ? (c(), d("button", {
2211
+ s.showBack ? (c(), d("button", {
2189
2212
  key: 0,
2190
2213
  type: "button",
2191
2214
  class: "wm-header__icon",
2192
- "aria-label": s.t("header.backToHome"),
2215
+ "aria-label": n.t("header.backToHome"),
2193
2216
  onClick: t[0] || (t[0] = (_) => e.$emit("back"))
2194
2217
  }, [...t[3] || (t[3] = [
2195
2218
  o("svg", {
@@ -2206,30 +2229,30 @@ function fn(e, t, n, r, a, s) {
2206
2229
  o("path", { d: "M19 12H5M12 5l-7 7 7 7" })
2207
2230
  ], -1)
2208
2231
  ])], 8, rn)) : (c(), d("div", an)),
2209
- n.showIdentity ? (c(), d(I, { key: 2 }, [
2232
+ s.showIdentity ? (c(), d(I, { key: 2 }, [
2210
2233
  o("div", on, [
2211
- $(i, {
2234
+ $(r, {
2212
2235
  size: 30,
2213
- name: n.agentName,
2214
- "image-url": n.agentAvatarUrl
2236
+ name: s.agentName,
2237
+ "image-url": s.agentAvatarUrl
2215
2238
  }, null, 8, ["name", "image-url"])
2216
2239
  ]),
2217
2240
  o("div", ln, [
2218
- o("div", cn, v(n.title), 1)
2241
+ o("div", cn, v(s.title), 1)
2219
2242
  ]),
2220
- s.hasTeam ? (c(), U(l, {
2243
+ n.hasTeam ? (c(), D(l, {
2221
2244
  key: 0,
2222
- members: s.displayedTeamMembers,
2245
+ members: n.displayedTeamMembers,
2223
2246
  "response-label": ""
2224
2247
  }, null, 8, ["members"])) : b("", !0)
2225
2248
  ], 64)) : (c(), d("div", dn)),
2226
2249
  o("div", un, [
2227
- n.showMore ? (c(), d("button", {
2250
+ s.showMore ? (c(), d("button", {
2228
2251
  key: 0,
2229
2252
  type: "button",
2230
- class: R(["wm-header__icon", { "wm-header__icon--active": n.moreActive }]),
2231
- "aria-label": s.t("header.moreOptions"),
2232
- title: s.t("header.moreOptions"),
2253
+ class: R(["wm-header__icon", { "wm-header__icon--active": s.moreActive }]),
2254
+ "aria-label": n.t("header.moreOptions"),
2255
+ title: n.t("header.moreOptions"),
2233
2256
  onClick: t[1] || (t[1] = (_) => e.$emit("more"))
2234
2257
  }, [...t[4] || (t[4] = [
2235
2258
  o("svg", {
@@ -2256,12 +2279,12 @@ function fn(e, t, n, r, a, s) {
2256
2279
  })
2257
2280
  ], -1)
2258
2281
  ])], 10, hn)) : b("", !0),
2259
- n.showClose ? (c(), d("button", {
2282
+ s.showClose ? (c(), d("button", {
2260
2283
  key: 1,
2261
2284
  type: "button",
2262
2285
  class: "wm-header__icon",
2263
- "aria-label": s.t("header.closeWidget"),
2264
- title: s.t("header.closeWidget"),
2286
+ "aria-label": n.t("header.closeWidget"),
2287
+ title: n.t("header.closeWidget"),
2265
2288
  onClick: t[2] || (t[2] = (_) => e.$emit("close"))
2266
2289
  }, [...t[5] || (t[5] = [
2267
2290
  o("svg", {
@@ -2387,17 +2410,17 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
2387
2410
  if (!e) return "";
2388
2411
  const t = new Date(e);
2389
2412
  if (Number.isNaN(t.getTime())) return "";
2390
- const n = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
2391
- if (t.toDateString() === r.toDateString())
2392
- return t.toLocaleTimeString(n, {
2413
+ const s = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
2414
+ if (t.toDateString() === i.toDateString())
2415
+ return t.toLocaleTimeString(s, {
2393
2416
  hour: "2-digit",
2394
2417
  minute: "2-digit"
2395
2418
  });
2396
- if (r.getTime() - t.getTime() < 7 * 864e5) {
2397
- const i = t.toLocaleDateString(n, { weekday: "short" });
2398
- return i.charAt(0).toUpperCase() + i.slice(1);
2419
+ if (i.getTime() - t.getTime() < 7 * 864e5) {
2420
+ const r = t.toLocaleDateString(s, { weekday: "short" });
2421
+ return r.charAt(0).toUpperCase() + r.slice(1);
2399
2422
  }
2400
- return t.toLocaleDateString(n, {
2423
+ return t.toLocaleDateString(s, {
2401
2424
  day: "2-digit",
2402
2425
  month: "2-digit"
2403
2426
  });
@@ -2415,7 +2438,7 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
2415
2438
  }, Rn = ["innerHTML"], Ln = { class: "wm-onb__alert-meta" }, In = {
2416
2439
  key: 0,
2417
2440
  class: "wm-onb__alert-time"
2418
- }, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Un = { class: "wm-onb__btn-label" }, Dn = ["onClick"], Nn = { class: "wm-onb__btn-icon" }, Fn = ["aria-label"], jn = {
2441
+ }, En = { class: "wm-onb__alert-resume" }, Bn = { class: "wm-onb__actions" }, Pn = ["disabled"], Dn = { class: "wm-onb__btn-label" }, Un = ["onClick"], Nn = { class: "wm-onb__btn-icon" }, Fn = ["aria-label"], jn = {
2419
2442
  key: 1,
2420
2443
  width: "18",
2421
2444
  height: "18",
@@ -2449,8 +2472,8 @@ const _n = /* @__PURE__ */ P(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
2449
2472
  "stroke-linejoin": "round",
2450
2473
  "aria-hidden": "true"
2451
2474
  }, Kn = ["d"], Wn = { class: "wm-onb__btn-label" }, Gn = { class: "wm-onb__btn-count" };
2452
- function Yn(e, t, n, r, a, s) {
2453
- const i = B("AIAvatar");
2475
+ function Yn(e, t, s, i, a, n) {
2476
+ const r = B("AIAvatar");
2454
2477
  return c(), d("div", pn, [
2455
2478
  o("div", vn, [
2456
2479
  t[2] || (t[2] = o("svg", {
@@ -2487,26 +2510,26 @@ function Yn(e, t, n, r, a, s) {
2487
2510
  opacity: "0.65"
2488
2511
  })
2489
2512
  ], -1)),
2490
- $(i, {
2513
+ $(r, {
2491
2514
  size: 52,
2492
- "image-url": n.defaultIconUrl
2515
+ "image-url": s.defaultIconUrl
2493
2516
  }, null, 8, ["image-url"]),
2494
2517
  o("div", yn, [
2495
- o("div", wn, v(s.heroTitle), 1),
2496
- o("div", bn, v(s.heroSub), 1)
2518
+ o("div", wn, v(n.heroTitle), 1),
2519
+ o("div", bn, v(n.heroSub), 1)
2497
2520
  ])
2498
2521
  ]),
2499
- s.unreadThreads.length ? (c(), d("div", kn, [
2500
- (c(!0), d(I, null, F(s.unreadThreads, (l) => (c(), d("button", {
2522
+ n.unreadThreads.length ? (c(), d("div", kn, [
2523
+ (c(!0), d(I, null, F(n.unreadThreads, (l) => (c(), d("button", {
2501
2524
  key: l.id,
2502
2525
  type: "button",
2503
2526
  class: "wm-onb__alert",
2504
2527
  onClick: (_) => e.$emit("resume", l)
2505
2528
  }, [
2506
2529
  o("span", {
2507
- class: R(["wm-onb__alert-avatar", s.avatarWrapperClass(l)])
2530
+ class: R(["wm-onb__alert-avatar", n.avatarWrapperClass(l)])
2508
2531
  }, [
2509
- s.isDefaultAvatar(l) ? (c(), d("span", An, [...t[3] || (t[3] = [
2532
+ n.isDefaultAvatar(l) ? (c(), d("span", An, [...t[3] || (t[3] = [
2510
2533
  o("svg", {
2511
2534
  width: "20",
2512
2535
  height: "20",
@@ -2520,27 +2543,27 @@ function Yn(e, t, n, r, a, s) {
2520
2543
  }, [
2521
2544
  o("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
2522
2545
  ], -1)
2523
- ])])) : (c(), U(Ae(s.avatarComponent(l)), je({
2546
+ ])])) : (c(), D(Ae(n.avatarComponent(l)), je({
2524
2547
  key: 1,
2525
2548
  ref_for: !0
2526
- }, s.avatarProps(l)), null, 16)),
2549
+ }, n.avatarProps(l)), null, 16)),
2527
2550
  o("span", {
2528
2551
  class: "wm-onb__alert-dot",
2529
- "aria-label": s.t("onboarding.unread")
2552
+ "aria-label": n.t("onboarding.unread")
2530
2553
  }, null, 8, Sn)
2531
2554
  ], 2),
2532
2555
  o("span", Mn, [
2533
2556
  o("span", Tn, v(l.title), 1),
2534
2557
  o("span", xn, [
2535
- s.senderLabel(l) ? (c(), d("span", On, v(s.senderLabel(l)) + " · ", 1)) : b("", !0),
2558
+ n.senderLabel(l) ? (c(), d("span", On, v(n.senderLabel(l)) + " · ", 1)) : b("", !0),
2536
2559
  o("span", {
2537
- innerHTML: s.renderPreview(l.preview)
2560
+ innerHTML: n.renderPreview(l.preview)
2538
2561
  }, null, 8, Rn)
2539
2562
  ])
2540
2563
  ]),
2541
2564
  o("span", Ln, [
2542
- s.formatTs(l._ts) ? (c(), d("span", In, v(s.formatTs(l._ts)), 1)) : b("", !0),
2543
- o("span", En, v(s.t("onboarding.resume")), 1)
2565
+ n.formatTs(l._ts) ? (c(), d("span", In, v(n.formatTs(l._ts)), 1)) : b("", !0),
2566
+ o("span", En, v(n.t("onboarding.resume")), 1)
2544
2567
  ])
2545
2568
  ], 8, Cn))), 128))
2546
2569
  ])) : b("", !0),
@@ -2548,7 +2571,7 @@ function Yn(e, t, n, r, a, s) {
2548
2571
  o("button", {
2549
2572
  type: "button",
2550
2573
  class: "wm-onb__btn wm-onb__btn--start",
2551
- disabled: n.busy,
2574
+ disabled: s.busy,
2552
2575
  onClick: t[0] || (t[0] = (l) => e.$emit("start"))
2553
2576
  }, [
2554
2577
  t[4] || (t[4] = o("span", { class: "wm-onb__btn-icon" }, [
@@ -2566,33 +2589,33 @@ function Yn(e, t, n, r, a, s) {
2566
2589
  o("path", { d: "M12 5v14M5 12h14" })
2567
2590
  ])
2568
2591
  ], -1)),
2569
- o("span", Un, v(n.busy ? "…" : s.t("onboarding.start")), 1)
2592
+ o("span", Dn, v(s.busy ? "…" : n.t("onboarding.start")), 1)
2570
2593
  ], 8, Pn),
2571
- (c(!0), d(I, null, F(n.quickLinks, (l, _) => (c(), d("button", {
2594
+ (c(!0), d(I, null, F(s.quickLinks, (l, _) => (c(), d("button", {
2572
2595
  key: "ql-" + _,
2573
2596
  type: "button",
2574
2597
  class: "wm-onb__btn",
2575
2598
  onClick: (k) => e.$emit("select", l)
2576
2599
  }, [
2577
2600
  o("span", Nn, [
2578
- s.safeIconUrl(l) ? (c(), d("span", {
2601
+ n.safeIconUrl(l) ? (c(), d("span", {
2579
2602
  key: 0,
2580
2603
  class: "wm-onb__btn-iconImg",
2581
- style: z(s.iconUrlStyle(l)),
2604
+ style: z(n.iconUrlStyle(l)),
2582
2605
  role: "img",
2583
2606
  "aria-label": l.label || ""
2584
2607
  }, null, 12, Fn)) : (c(), d("svg", jn, [
2585
2608
  o("path", {
2586
- d: s.iconPath(l.icon)
2609
+ d: n.iconPath(l.icon)
2587
2610
  }, null, 8, Hn)
2588
2611
  ]))
2589
2612
  ]),
2590
2613
  o("span", zn, v(l.label), 1),
2591
- s.isExternalLink(l) ? (c(), d("svg", qn, [...t[5] || (t[5] = [
2614
+ n.isExternalLink(l) ? (c(), d("svg", qn, [...t[5] || (t[5] = [
2592
2615
  o("path", { d: "M7 17L17 7M9 7h8v8" }, null, -1)
2593
2616
  ])])) : b("", !0)
2594
- ], 8, Dn))), 128)),
2595
- n.openThreads.length ? (c(), d("button", {
2617
+ ], 8, Un))), 128)),
2618
+ s.openThreads.length ? (c(), d("button", {
2596
2619
  key: 0,
2597
2620
  type: "button",
2598
2621
  class: "wm-onb__btn",
@@ -2601,12 +2624,12 @@ function Yn(e, t, n, r, a, s) {
2601
2624
  o("span", Vn, [
2602
2625
  (c(), d("svg", $n, [
2603
2626
  o("path", {
2604
- d: s.iconPath("chat")
2627
+ d: n.iconPath("chat")
2605
2628
  }, null, 8, Kn)
2606
2629
  ]))
2607
2630
  ]),
2608
- o("span", Wn, v(s.t("onboarding.allConversations")), 1),
2609
- o("span", Gn, v(n.openThreads.length), 1),
2631
+ o("span", Wn, v(n.t("onboarding.allConversations")), 1),
2632
+ o("span", Gn, v(s.openThreads.length), 1),
2610
2633
  t[6] || (t[6] = o("svg", {
2611
2634
  class: "wm-onb__btn-trail",
2612
2635
  width: "13",
@@ -2678,17 +2701,17 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
2678
2701
  if (!e) return "";
2679
2702
  const t = new Date(e);
2680
2703
  if (Number.isNaN(t.getTime())) return "";
2681
- const n = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
2682
- if (t.toDateString() === r.toDateString())
2683
- return t.toLocaleTimeString(n, {
2704
+ const s = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
2705
+ if (t.toDateString() === i.toDateString())
2706
+ return t.toLocaleTimeString(s, {
2684
2707
  hour: "2-digit",
2685
2708
  minute: "2-digit"
2686
2709
  });
2687
- if (r.getTime() - t.getTime() < 7 * 864e5) {
2688
- const i = t.toLocaleDateString(n, { weekday: "short" });
2689
- return i.charAt(0).toUpperCase() + i.slice(1);
2710
+ if (i.getTime() - t.getTime() < 7 * 864e5) {
2711
+ const r = t.toLocaleDateString(s, { weekday: "short" });
2712
+ return r.charAt(0).toUpperCase() + r.slice(1);
2690
2713
  }
2691
- return t.toLocaleDateString(n, {
2714
+ return t.toLocaleDateString(s, {
2692
2715
  day: "2-digit",
2693
2716
  month: "2-digit"
2694
2717
  });
@@ -2704,7 +2727,7 @@ const Jn = /* @__PURE__ */ P(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
2704
2727
  key: 0,
2705
2728
  class: "wm-hist__empty"
2706
2729
  };
2707
- function us(e, t, n, r, a, s) {
2730
+ function us(e, t, s, i, a, n) {
2708
2731
  return c(), d("div", Qn, [
2709
2732
  o("div", Zn, [
2710
2733
  t[1] || (t[1] = o("span", { class: "wm-hist__searchIcon" }, [
@@ -2723,25 +2746,25 @@ function us(e, t, n, r, a, s) {
2723
2746
  ])
2724
2747
  ], -1)),
2725
2748
  G(o("input", {
2726
- "onUpdate:modelValue": t[0] || (t[0] = (i) => a.query = i),
2749
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => a.query = r),
2727
2750
  type: "text",
2728
- placeholder: s.t("onboarding.search"),
2729
- "aria-label": s.t("onboarding.search")
2751
+ placeholder: n.t("onboarding.search"),
2752
+ "aria-label": n.t("onboarding.search")
2730
2753
  }, null, 8, es), [
2731
2754
  [te, a.query]
2732
2755
  ])
2733
2756
  ]),
2734
2757
  o("div", ts, [
2735
- (c(!0), d(I, null, F(s.filteredThreads, (i) => (c(), d("button", {
2736
- key: i.id,
2758
+ (c(!0), d(I, null, F(n.filteredThreads, (r) => (c(), d("button", {
2759
+ key: r.id,
2737
2760
  type: "button",
2738
- class: R(["wm-hist__thread", { "wm-hist__thread--unread": i.unread }]),
2739
- onClick: (l) => e.$emit("resume", i)
2761
+ class: R(["wm-hist__thread", { "wm-hist__thread--unread": r.unread }]),
2762
+ onClick: (l) => e.$emit("resume", r)
2740
2763
  }, [
2741
2764
  o("span", {
2742
- class: R(["wm-hist__thread-avatar", s.avatarWrapperClass(i)])
2765
+ class: R(["wm-hist__thread-avatar", n.avatarWrapperClass(r)])
2743
2766
  }, [
2744
- s.isDefaultAvatar(i) ? (c(), d("span", ss, [...t[2] || (t[2] = [
2767
+ n.isDefaultAvatar(r) ? (c(), d("span", ss, [...t[2] || (t[2] = [
2745
2768
  o("svg", {
2746
2769
  width: "18",
2747
2770
  height: "18",
@@ -2755,25 +2778,25 @@ function us(e, t, n, r, a, s) {
2755
2778
  }, [
2756
2779
  o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })
2757
2780
  ], -1)
2758
- ])])) : (c(), U(Ae(s.avatarComponent(i)), je({
2781
+ ])])) : (c(), D(Ae(n.avatarComponent(r)), je({
2759
2782
  key: 1,
2760
2783
  ref_for: !0
2761
- }, s.avatarProps(i)), null, 16)),
2762
- i.unread ? (c(), d("span", {
2784
+ }, n.avatarProps(r)), null, 16)),
2785
+ r.unread ? (c(), d("span", {
2763
2786
  key: 2,
2764
2787
  class: "wm-hist__thread-dot",
2765
- "aria-label": s.t("onboarding.unread")
2788
+ "aria-label": n.t("onboarding.unread")
2766
2789
  }, null, 8, rs)) : b("", !0)
2767
2790
  ], 2),
2768
2791
  o("span", is, [
2769
- o("span", as, v(i.title), 1),
2792
+ o("span", as, v(r.title), 1),
2770
2793
  o("span", {
2771
2794
  class: "wm-hist__thread-preview",
2772
- innerHTML: s.renderPreview(i.preview)
2795
+ innerHTML: n.renderPreview(r.preview)
2773
2796
  }, null, 8, os)
2774
2797
  ]),
2775
2798
  o("span", ls, [
2776
- s.formatTs(i._ts) ? (c(), d("span", cs, v(s.formatTs(i._ts)), 1)) : b("", !0),
2799
+ n.formatTs(r._ts) ? (c(), d("span", cs, v(n.formatTs(r._ts)), 1)) : b("", !0),
2777
2800
  t[3] || (t[3] = o("svg", {
2778
2801
  width: "14",
2779
2802
  height: "14",
@@ -2790,7 +2813,7 @@ function us(e, t, n, r, a, s) {
2790
2813
  ], -1))
2791
2814
  ])
2792
2815
  ], 10, ns))), 128)),
2793
- s.filteredThreads.length ? b("", !0) : (c(), d("div", ds, v(a.query ? s.t("onboarding.noResults", { query: a.query }) : s.t("onboarding.noConversations")), 1))
2816
+ n.filteredThreads.length ? b("", !0) : (c(), d("div", ds, v(a.query ? n.t("onboarding.noResults", { query: a.query }) : n.t("onboarding.noConversations")), 1))
2794
2817
  ])
2795
2818
  ]);
2796
2819
  }
@@ -2855,16 +2878,16 @@ const fs = {
2855
2878
  "stroke-linecap": "round",
2856
2879
  "stroke-linejoin": "round"
2857
2880
  }, ws = { class: "wm-result__body" }, bs = { class: "wm-result__label" }, ks = { class: "wm-result__detail" };
2858
- function Cs(e, t, n, r, a, s) {
2881
+ function Cs(e, t, s, i, a, n) {
2859
2882
  return c(), d("div", {
2860
- class: R(["wm-result", `wm-result--${n.state}`])
2883
+ class: R(["wm-result", `wm-result--${s.state}`])
2861
2884
  }, [
2862
2885
  o("span", _s, [
2863
- n.state === "success" ? (c(), d("svg", gs, [...t[0] || (t[0] = [
2886
+ s.state === "success" ? (c(), d("svg", gs, [...t[0] || (t[0] = [
2864
2887
  o("path", { d: "M20 6L9 17l-5-5" }, null, -1)
2865
- ])])) : n.state === "rejected" ? (c(), d("svg", ps, [...t[1] || (t[1] = [
2888
+ ])])) : s.state === "rejected" ? (c(), d("svg", ps, [...t[1] || (t[1] = [
2866
2889
  o("path", { d: "M18 6L6 18M6 6l12 12" }, null, -1)
2867
- ])])) : n.state === "awaiting" ? (c(), d("svg", vs, [...t[2] || (t[2] = [
2890
+ ])])) : s.state === "awaiting" ? (c(), d("svg", vs, [...t[2] || (t[2] = [
2868
2891
  o("circle", {
2869
2892
  cx: "12",
2870
2893
  cy: "12",
@@ -2888,13 +2911,13 @@ function Cs(e, t, n, r, a, s) {
2888
2911
  ])]))
2889
2912
  ]),
2890
2913
  o("span", ws, [
2891
- o("span", bs, v(n.label), 1),
2892
- s.detailText ? (c(), d(I, { key: 0 }, [
2914
+ o("span", bs, v(s.label), 1),
2915
+ n.detailText ? (c(), d(I, { key: 0 }, [
2893
2916
  t[4] || (t[4] = o("span", {
2894
2917
  class: "wm-result__sep",
2895
2918
  "aria-hidden": "true"
2896
2919
  }, " · ", -1)),
2897
- o("span", ks, v(s.detailText), 1)
2920
+ o("span", ks, v(n.detailText), 1)
2898
2921
  ], 64)) : b("", !0)
2899
2922
  ])
2900
2923
  ], 2);
@@ -2916,10 +2939,10 @@ const As = /* @__PURE__ */ P(fs, [["render", Cs], ["__scopeId", "data-v-7284acd0
2916
2939
  }
2917
2940
  }
2918
2941
  }, Ms = { class: "wm-art wm-art--formResponse" }, Ts = { class: "wm-art__head" }, xs = { class: "wm-art__title" }, Os = { class: "wm-art__badge wm-art__badge--success" }, Rs = { class: "wm-art__body" }, Ls = { class: "wm-art__fieldLabel" };
2919
- function Is(e, t, n, r, a, s) {
2942
+ function Is(e, t, s, i, a, n) {
2920
2943
  return c(), d("div", Ms, [
2921
2944
  o("div", Ts, [
2922
- o("div", xs, v(n.data.title || s.t("form.title")), 1),
2945
+ o("div", xs, v(s.data.title || n.t("form.title")), 1),
2923
2946
  o("span", Os, [
2924
2947
  t[0] || (t[0] = o("svg", {
2925
2948
  width: "11",
@@ -2934,21 +2957,21 @@ function Is(e, t, n, r, a, s) {
2934
2957
  }, [
2935
2958
  o("polyline", { points: "20 6 9 17 4 12" })
2936
2959
  ], -1)),
2937
- Se(" " + v(s.t("form.sent")), 1)
2960
+ Se(" " + v(n.t("form.sent")), 1)
2938
2961
  ])
2939
2962
  ]),
2940
2963
  o("div", Rs, [
2941
- (c(!0), d(I, null, F(s.fields, (i, l) => (c(), d("div", {
2964
+ (c(!0), d(I, null, F(n.fields, (r, l) => (c(), d("div", {
2942
2965
  key: l,
2943
2966
  class: "wm-art__field"
2944
2967
  }, [
2945
- o("div", Ls, v(i.label), 1),
2968
+ o("div", Ls, v(r.label), 1),
2946
2969
  o("div", {
2947
2970
  class: R([
2948
2971
  "wm-art__fieldValue",
2949
- { "wm-art__fieldValue--multi": i.multiline }
2972
+ { "wm-art__fieldValue--multi": r.multiline }
2950
2973
  ])
2951
- }, v(i.value), 3)
2974
+ }, v(r.value), 3)
2952
2975
  ]))), 128))
2953
2976
  ])
2954
2977
  ]);
@@ -2968,10 +2991,10 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
2968
2991
  return !!((e = this.data) != null && e.body) || this.fields.length > 0;
2969
2992
  }
2970
2993
  }
2971
- }, Ps = { class: "wm-art wm-art--infoCard" }, Us = {
2994
+ }, Ps = { class: "wm-art wm-art--infoCard" }, Ds = {
2972
2995
  key: 0,
2973
2996
  class: "wm-art__image"
2974
- }, Ds = ["src", "alt"], Ns = { class: "wm-art__head" }, Fs = { class: "wm-art__headMain" }, js = { class: "wm-art__title" }, Hs = {
2997
+ }, Us = ["src", "alt"], Ns = { class: "wm-art__head" }, Fs = { class: "wm-art__headMain" }, js = { class: "wm-art__title" }, Hs = {
2975
2998
  key: 0,
2976
2999
  class: "wm-art__subtitle"
2977
3000
  }, zs = {
@@ -2981,59 +3004,59 @@ const Es = /* @__PURE__ */ P(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
2981
3004
  key: 0,
2982
3005
  class: "wm-art__text"
2983
3006
  }, Vs = { class: "wm-art__fieldLabel" };
2984
- function $s(e, t, n, r, a, s) {
3007
+ function $s(e, t, s, i, a, n) {
2985
3008
  return c(), d("div", Ps, [
2986
- n.data.image_url ? (c(), d("figure", Us, [
3009
+ s.data.image_url ? (c(), d("figure", Ds, [
2987
3010
  o("img", {
2988
- src: n.data.image_url,
2989
- alt: n.data.title || "",
3011
+ src: s.data.image_url,
3012
+ alt: s.data.title || "",
2990
3013
  loading: "lazy"
2991
- }, null, 8, Ds)
3014
+ }, null, 8, Us)
2992
3015
  ])) : b("", !0),
2993
3016
  o("div", Ns, [
2994
3017
  o("div", Fs, [
2995
- o("div", js, v(n.data.title), 1),
2996
- n.data.subtitle ? (c(), d("div", Hs, v(n.data.subtitle), 1)) : b("", !0)
3018
+ o("div", js, v(s.data.title), 1),
3019
+ s.data.subtitle ? (c(), d("div", Hs, v(s.data.subtitle), 1)) : b("", !0)
2997
3020
  ]),
2998
- n.data.badge && n.data.badge.label ? (c(), d("span", {
3021
+ s.data.badge && s.data.badge.label ? (c(), d("span", {
2999
3022
  key: 0,
3000
3023
  class: R([
3001
3024
  "wm-art__badge",
3002
- `wm-art__badge--${n.data.badge.tone || "neutral"}`
3025
+ `wm-art__badge--${s.data.badge.tone || "neutral"}`
3003
3026
  ])
3004
- }, v(n.data.badge.label), 3)) : b("", !0)
3027
+ }, v(s.data.badge.label), 3)) : b("", !0)
3005
3028
  ]),
3006
- s.hasBody ? (c(), d("div", zs, [
3007
- n.data.body ? (c(), d("div", qs, v(n.data.body), 1)) : b("", !0),
3008
- s.fields.length ? (c(!0), d(I, { key: 1 }, F(s.fields, (i, l) => (c(), d("div", {
3029
+ n.hasBody ? (c(), d("div", zs, [
3030
+ s.data.body ? (c(), d("div", qs, v(s.data.body), 1)) : b("", !0),
3031
+ n.fields.length ? (c(!0), d(I, { key: 1 }, F(n.fields, (r, l) => (c(), d("div", {
3009
3032
  key: l,
3010
3033
  class: "wm-art__field"
3011
3034
  }, [
3012
- o("div", Vs, v(i.label), 1),
3035
+ o("div", Vs, v(r.label), 1),
3013
3036
  o("div", {
3014
3037
  class: R([
3015
3038
  "wm-art__fieldValue",
3016
- { "wm-art__fieldValue--multi": i.multiline }
3039
+ { "wm-art__fieldValue--multi": r.multiline }
3017
3040
  ])
3018
- }, v(i.value), 3)
3041
+ }, v(r.value), 3)
3019
3042
  ]))), 128)) : b("", !0)
3020
3043
  ])) : b("", !0)
3021
3044
  ]);
3022
3045
  }
3023
3046
  const Ks = /* @__PURE__ */ P(Bs, [["render", $s], ["__scopeId", "data-v-7eae0e4a"]]);
3024
- function Ws(e, t, n) {
3047
+ function Ws(e, t, s) {
3025
3048
  if (!e) return "";
3026
- const r = new Date(e);
3027
- if (Number.isNaN(r.getTime())) return e;
3028
- const a = r.toLocaleDateString(t, {
3049
+ const i = new Date(e);
3050
+ if (Number.isNaN(i.getTime())) return e;
3051
+ const a = i.toLocaleDateString(t, {
3029
3052
  day: "numeric",
3030
3053
  month: "long",
3031
3054
  year: "numeric"
3032
- }), s = r.toLocaleTimeString(t, {
3055
+ }), n = i.toLocaleTimeString(t, {
3033
3056
  hour: "2-digit",
3034
3057
  minute: "2-digit"
3035
3058
  });
3036
- return `${a}${n}${s}`;
3059
+ return `${a}${s}${n}`;
3037
3060
  }
3038
3061
  const Gs = {
3039
3062
  name: "WmArtifactTicket",
@@ -3103,10 +3126,10 @@ const Gs = {
3103
3126
  key: 1,
3104
3127
  class: "wm-art__footer wm-tk__footer"
3105
3128
  };
3106
- function ar(e, t, n, r, a, s) {
3129
+ function ar(e, t, s, i, a, n) {
3107
3130
  return c(), d("div", Ys, [
3108
3131
  o("div", Js, [
3109
- o("div", Xs, v(n.data.title), 1),
3132
+ o("div", Xs, v(s.data.title), 1),
3110
3133
  o("div", Qs, [
3111
3134
  o("div", Zs, [
3112
3135
  t[0] || (t[0] = o("svg", {
@@ -3123,40 +3146,40 @@ function ar(e, t, n, r, a, s) {
3123
3146
  o("path", { d: "M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z" }),
3124
3147
  o("path", { d: "M13 5v2M13 17v2M13 11v2" })
3125
3148
  ], -1)),
3126
- o("span", null, v(n.data.reference), 1)
3149
+ o("span", null, v(s.data.reference), 1)
3127
3150
  ]),
3128
3151
  o("span", {
3129
3152
  class: R([
3130
3153
  "wm-art__badge",
3131
3154
  "wm-tk__badge",
3132
- `wm-art__badge--${n.data.status.tone || "neutral"}`
3155
+ `wm-art__badge--${s.data.status.tone || "neutral"}`
3133
3156
  ])
3134
3157
  }, [
3135
3158
  t[1] || (t[1] = o("span", {
3136
3159
  class: "wm-tk__dot",
3137
3160
  "aria-hidden": "true"
3138
3161
  }, null, -1)),
3139
- Se(" " + v(n.data.status.label), 1)
3162
+ Se(" " + v(s.data.status.label), 1)
3140
3163
  ], 2)
3141
3164
  ]),
3142
- n.data.body ? (c(), d("div", er, v(n.data.body), 1)) : b("", !0)
3165
+ s.data.body ? (c(), d("div", er, v(s.data.body), 1)) : b("", !0)
3143
3166
  ]),
3144
- s.fields.length ? (c(), d("div", tr, [
3145
- (c(!0), d(I, null, F(s.fields, (i, l) => (c(), d("div", {
3167
+ n.fields.length ? (c(), d("div", tr, [
3168
+ (c(!0), d(I, null, F(n.fields, (r, l) => (c(), d("div", {
3146
3169
  key: l,
3147
3170
  class: "wm-art__field"
3148
3171
  }, [
3149
- o("div", nr, v(i.label), 1),
3172
+ o("div", nr, v(r.label), 1),
3150
3173
  o("div", {
3151
3174
  class: R([
3152
3175
  "wm-art__fieldValue",
3153
- { "wm-art__fieldValue--multi": i.multiline }
3176
+ { "wm-art__fieldValue--multi": r.multiline }
3154
3177
  ])
3155
3178
  }, [
3156
- s.isPriority(i.label) ? (c(), d("svg", {
3179
+ n.isPriority(r.label) ? (c(), d("svg", {
3157
3180
  key: 0,
3158
3181
  class: "wm-tk__prio",
3159
- "data-level": s.priorityLevel(i.value),
3182
+ "data-level": n.priorityLevel(r.value),
3160
3183
  width: "12",
3161
3184
  height: "12",
3162
3185
  viewBox: "0 0 12 12",
@@ -3183,7 +3206,7 @@ function ar(e, t, n, r, a, s) {
3183
3206
  height: "9",
3184
3207
  rx: "0.5"
3185
3208
  }, null, -1)
3186
- ])], 8, sr)) : s.isDate(i.label) ? (c(), d("svg", rr, [...t[3] || (t[3] = [
3209
+ ])], 8, sr)) : n.isDate(r.label) ? (c(), d("svg", rr, [...t[3] || (t[3] = [
3187
3210
  o("rect", {
3188
3211
  x: "3",
3189
3212
  y: "4",
@@ -3193,11 +3216,11 @@ function ar(e, t, n, r, a, s) {
3193
3216
  }, null, -1),
3194
3217
  o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
3195
3218
  ])])) : b("", !0),
3196
- o("span", null, v(i.value), 1)
3219
+ o("span", null, v(r.value), 1)
3197
3220
  ], 2)
3198
3221
  ]))), 128))
3199
3222
  ])) : b("", !0),
3200
- n.data.created_at ? (c(), d("div", ir, [
3223
+ s.data.created_at ? (c(), d("div", ir, [
3201
3224
  t[4] || (t[4] = o("svg", {
3202
3225
  width: "11",
3203
3226
  height: "11",
@@ -3218,7 +3241,7 @@ function ar(e, t, n, r, a, s) {
3218
3241
  }),
3219
3242
  o("path", { d: "M16 2v4M8 2v4M3 10h18" })
3220
3243
  ], -1)),
3221
- o("span", null, v(s.formattedDate), 1)
3244
+ o("span", null, v(n.formattedDate), 1)
3222
3245
  ])) : b("", !0)
3223
3246
  ]);
3224
3247
  }
@@ -3241,10 +3264,10 @@ const or = /* @__PURE__ */ P(Gs, [["render", ar], ["__scopeId", "data-v-5f30c914
3241
3264
  }
3242
3265
  }
3243
3266
  };
3244
- function dr(e, t, n, r, a, s) {
3245
- return s.component ? (c(), U(Ae(s.component), {
3267
+ function dr(e, t, s, i, a, n) {
3268
+ return n.component ? (c(), D(Ae(n.component), {
3246
3269
  key: 0,
3247
- data: n.artifact.data
3270
+ data: s.artifact.data
3248
3271
  }, null, 8, ["data"])) : b("", !0);
3249
3272
  }
3250
3273
  const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
@@ -3263,15 +3286,15 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
3263
3286
  },
3264
3287
  computed: {
3265
3288
  kind() {
3266
- var n, r;
3267
- const e = (n = this.attachment) == null ? void 0 : n.type;
3289
+ var s, i;
3290
+ const e = (s = this.attachment) == null ? void 0 : s.type;
3268
3291
  if (e) return e;
3269
- const t = (((r = this.attachment) == null ? void 0 : r.mime_type) || "").toLowerCase();
3292
+ const t = (((i = this.attachment) == null ? void 0 : i.mime_type) || "").toLowerCase();
3270
3293
  return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
3271
3294
  },
3272
3295
  displayName() {
3273
- var e, t, n;
3274
- return ((t = (e = this.attachment) == null ? void 0 : e.metadata) == null ? void 0 : t.name) || ((n = this.attachment) == null ? void 0 : n.name) || this.guessNameFromPath() || this.t("attachment.fallbackName");
3296
+ var e, t, s;
3297
+ return ((t = (e = this.attachment) == null ? void 0 : e.metadata) == null ? void 0 : t.name) || ((s = this.attachment) == null ? void 0 : s.name) || this.guessNameFromPath() || this.t("attachment.fallbackName");
3275
3298
  },
3276
3299
  safeHref() {
3277
3300
  const e = String(this.url || "").trim();
@@ -3297,8 +3320,8 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
3297
3320
  },
3298
3321
  methods: {
3299
3322
  guessNameFromPath() {
3300
- var n;
3301
- return ((((n = this.attachment) == null ? void 0 : n.path) || "").split("/").pop() || "").replace(/^[0-9a-f-]{8,}-/, "");
3323
+ var s;
3324
+ return ((((s = this.attachment) == null ? void 0 : s.path) || "").split("/").pop() || "").replace(/^[0-9a-f-]{8,}-/, "");
3302
3325
  },
3303
3326
  async refresh() {
3304
3327
  var e;
@@ -3323,28 +3346,28 @@ const ur = /* @__PURE__ */ P(cr, [["render", dr]]), hr = {
3323
3346
  class: "wm-att__spin",
3324
3347
  "aria-hidden": "true"
3325
3348
  };
3326
- function kr(e, t, n, r, a, s) {
3349
+ function kr(e, t, s, i, a, n) {
3327
3350
  return c(), d("div", {
3328
- class: R(["wm-att", ["wm-att--" + (s.kind || "file")]])
3351
+ class: R(["wm-att", ["wm-att--" + (n.kind || "file")]])
3329
3352
  }, [
3330
- s.kind === "image" && a.url ? (c(), d("a", {
3353
+ n.kind === "image" && a.url ? (c(), d("a", {
3331
3354
  key: 0,
3332
- href: s.safeHref,
3355
+ href: n.safeHref,
3333
3356
  target: "_blank",
3334
3357
  rel: "noopener",
3335
3358
  class: "wm-att__imgWrap"
3336
3359
  }, [
3337
3360
  o("img", {
3338
3361
  src: a.url,
3339
- alt: s.displayName,
3362
+ alt: n.displayName,
3340
3363
  loading: "lazy"
3341
3364
  }, null, 8, fr)
3342
- ], 8, mr)) : s.kind === "audio" && a.url ? (c(), d("audio", {
3365
+ ], 8, mr)) : n.kind === "audio" && a.url ? (c(), d("audio", {
3343
3366
  key: 1,
3344
3367
  src: a.url,
3345
3368
  controls: "",
3346
3369
  preload: "metadata"
3347
- }, null, 8, _r)) : s.kind === "video" && a.url ? (c(), d("video", {
3370
+ }, null, 8, _r)) : n.kind === "video" && a.url ? (c(), d("video", {
3348
3371
  key: 2,
3349
3372
  src: a.url,
3350
3373
  controls: "",
@@ -3353,11 +3376,11 @@ function kr(e, t, n, r, a, s) {
3353
3376
  }, null, 8, gr)) : (c(), d("a", {
3354
3377
  key: 3,
3355
3378
  class: "wm-att__file",
3356
- href: s.safeHref,
3357
- download: s.displayName,
3379
+ href: n.safeHref,
3380
+ download: n.displayName,
3358
3381
  target: "_blank",
3359
3382
  rel: "noopener",
3360
- onClick: t[0] || (t[0] = (...i) => s.onFileClick && s.onFileClick(...i))
3383
+ onClick: t[0] || (t[0] = (...r) => n.onFileClick && n.onFileClick(...r))
3361
3384
  }, [
3362
3385
  t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
3363
3386
  o("svg", {
@@ -3376,8 +3399,8 @@ function kr(e, t, n, r, a, s) {
3376
3399
  ])
3377
3400
  ], -1)),
3378
3401
  o("span", vr, [
3379
- o("span", yr, v(s.displayName), 1),
3380
- s.sizeLabel ? (c(), d("span", wr, v(s.sizeLabel), 1)) : b("", !0)
3402
+ o("span", yr, v(n.displayName), 1),
3403
+ n.sizeLabel ? (c(), d("span", wr, v(n.sizeLabel), 1)) : b("", !0)
3381
3404
  ]),
3382
3405
  a.loading ? (c(), d("span", br)) : b("", !0)
3383
3406
  ], 8, pr))
@@ -3396,17 +3419,17 @@ const Cr = /* @__PURE__ */ P(hr, [["render", kr], ["__scopeId", "data-v-b207a8bd
3396
3419
  }
3397
3420
  }
3398
3421
  }, Sr = ["innerHTML"];
3399
- function Mr(e, t, n, r, a, s) {
3422
+ function Mr(e, t, s, i, a, n) {
3400
3423
  return c(), d("div", {
3401
- class: R(["wm-bubble", "wm-bubble--" + n.role])
3424
+ class: R(["wm-bubble", "wm-bubble--" + s.role])
3402
3425
  }, [
3403
3426
  Ke(e.$slots, "default", {}, () => [
3404
- o("span", { innerHTML: s.rendered }, null, 8, Sr)
3427
+ o("span", { innerHTML: n.rendered }, null, 8, Sr)
3405
3428
  ], !0)
3406
3429
  ], 2);
3407
3430
  }
3408
3431
  const Tr = /* @__PURE__ */ P(Ar, [["render", Mr], ["__scopeId", "data-v-7ab13147"]]), xr = { name: "WmTyping" }, Or = { class: "wm-typing" };
3409
- function Rr(e, t, n, r, a, s) {
3432
+ function Rr(e, t, s, i, a, n) {
3410
3433
  return c(), d("div", Or, [...t[0] || (t[0] = [
3411
3434
  o("span", { style: { "animation-delay": "0s" } }, null, -1),
3412
3435
  o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
@@ -3502,61 +3525,61 @@ const Ir = {
3502
3525
  return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
3503
3526
  },
3504
3527
  groups() {
3505
- var n, r, a, s;
3528
+ var s, i, a, n;
3506
3529
  const e = [];
3507
- for (const i of this.messages) {
3508
- const l = this.roleOf(i);
3530
+ for (const r of this.messages) {
3531
+ const l = this.roleOf(r);
3509
3532
  if (l === "system") {
3510
- if (((n = i == null ? void 0 : i.payload) == null ? void 0 : n.event) === "action_admin_pending") {
3533
+ if (((s = r == null ? void 0 : r.payload) == null ? void 0 : s.event) === "action_admin_pending") {
3511
3534
  const w = e[e.length - 1];
3512
- w && w.role === "ai" ? w.messages.push(i) : e.push({
3513
- key: `g-${ee(i)}`,
3535
+ w && w.role === "ai" ? w.messages.push(r) : e.push({
3536
+ key: `g-${ee(r)}`,
3514
3537
  role: "ai",
3515
3538
  agentName: "",
3516
3539
  agentAvatarUrl: null,
3517
- messages: [i],
3540
+ messages: [r],
3518
3541
  items: []
3519
3542
  });
3520
3543
  continue;
3521
3544
  }
3522
3545
  e.push({
3523
- key: `sys-${ee(i)}`,
3546
+ key: `sys-${ee(r)}`,
3524
3547
  role: l,
3525
- messages: [i],
3548
+ messages: [r],
3526
3549
  items: [],
3527
- systemLabel: this.systemLabel(i)
3550
+ systemLabel: this.systemLabel(r)
3528
3551
  });
3529
3552
  continue;
3530
3553
  }
3531
3554
  const _ = e[e.length - 1];
3532
- _ && _.role === l && (l === "ai" || _.agentName === (((r = i == null ? void 0 : i.author) == null ? void 0 : r.name) || "")) ? _.messages.push(i) : e.push({
3533
- key: `g-${ee(i)}`,
3555
+ _ && _.role === l && (l === "ai" || _.agentName === (((i = r == null ? void 0 : r.author) == null ? void 0 : i.name) || "")) ? _.messages.push(r) : e.push({
3556
+ key: `g-${ee(r)}`,
3534
3557
  role: l,
3535
- agentName: ((a = i == null ? void 0 : i.author) == null ? void 0 : a.name) || "",
3536
- agentAvatarUrl: ((s = i == null ? void 0 : i.author) == null ? void 0 : s.avatar_url) || null,
3537
- messages: [i],
3558
+ agentName: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.name) || "",
3559
+ agentAvatarUrl: ((n = r == null ? void 0 : r.author) == null ? void 0 : n.avatar_url) || null,
3560
+ messages: [r],
3538
3561
  items: []
3539
3562
  });
3540
3563
  }
3541
- for (const i of e) {
3542
- if (i.role === "system") continue;
3564
+ for (const r of e) {
3565
+ if (r.role === "system") continue;
3543
3566
  const l = [];
3544
- for (const _ of i.messages)
3567
+ for (const _ of r.messages)
3545
3568
  for (const k of this.itemsOf(_)) l.push(k);
3546
- i.items = l;
3569
+ r.items = l;
3547
3570
  }
3548
3571
  const t = [];
3549
- for (const i of e) {
3550
- if (i.role !== "system" && !i.items.length) continue;
3572
+ for (const r of e) {
3573
+ if (r.role !== "system" && !r.items.length) continue;
3551
3574
  const l = t[t.length - 1];
3552
- if (l && l.role !== "system" && l.role === i.role && (i.role === "ai" || l.agentName === i.agentName)) {
3553
- l.messages.push(...i.messages), l.items.push(...i.items);
3575
+ if (l && l.role !== "system" && l.role === r.role && (r.role === "ai" || l.agentName === r.agentName)) {
3576
+ l.messages.push(...r.messages), l.items.push(...r.items);
3554
3577
  continue;
3555
3578
  }
3556
- t.push(i);
3579
+ t.push(r);
3557
3580
  }
3558
- for (const i of t)
3559
- i.role !== "system" && (i.key = this.stableGroupKey(i.messages));
3581
+ for (const r of t)
3582
+ r.role !== "system" && (r.key = this.stableGroupKey(r.messages));
3560
3583
  return t;
3561
3584
  },
3562
3585
  // Key of the first non-user group that starts after the unread
@@ -3565,13 +3588,13 @@ const Ir = {
3565
3588
  unreadGroupKey() {
3566
3589
  if (this.unreadAnchorId == null) return null;
3567
3590
  const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
3568
- for (const n of this.groups) {
3569
- if (n.role === "user" || n.role === "system" || !n.items.length) continue;
3570
- const r = n.messages[0];
3571
- if (!r) continue;
3572
- const a = Y(r.id);
3573
- if (a != null && !(a <= e) && !(t && r.created_at && r.created_at > t))
3574
- return n.key;
3591
+ for (const s of this.groups) {
3592
+ if (s.role === "user" || s.role === "system" || !s.items.length) continue;
3593
+ const i = s.messages[0];
3594
+ if (!i) continue;
3595
+ const a = Y(i.id);
3596
+ if (a != null && !(a <= e) && !(t && i.created_at && i.created_at > t))
3597
+ return s.key;
3575
3598
  }
3576
3599
  return null;
3577
3600
  }
@@ -3607,20 +3630,20 @@ const Ir = {
3607
3630
  stableGroupKey(e) {
3608
3631
  this._groupIdByMsgKey || (this._groupIdByMsgKey = /* @__PURE__ */ new Map(), this._groupIdCounter = 0);
3609
3632
  const t = this._groupIdByMsgKey;
3610
- let n = null;
3611
- for (const r of e) {
3612
- const a = ee(r);
3633
+ let s = null;
3634
+ for (const i of e) {
3635
+ const a = ee(i);
3613
3636
  if (a && t.has(a)) {
3614
- n = t.get(a);
3637
+ s = t.get(a);
3615
3638
  break;
3616
3639
  }
3617
3640
  }
3618
- n == null && (n = ++this._groupIdCounter);
3619
- for (const r of e) {
3620
- const a = ee(r);
3621
- a && t.set(a, n);
3641
+ s == null && (s = ++this._groupIdCounter);
3642
+ for (const i of e) {
3643
+ const a = ee(i);
3644
+ a && t.set(a, s);
3622
3645
  }
3623
- return `g-${n}`;
3646
+ return `g-${s}`;
3624
3647
  },
3625
3648
  isAtBottom(e) {
3626
3649
  return e.scrollHeight - e.scrollTop - e.clientHeight <= Er;
@@ -3655,36 +3678,36 @@ const Ir = {
3655
3678
  if (!e || this._scrollSnap) return;
3656
3679
  const t = this._lastSeenConvId !== this.conversationId;
3657
3680
  this._lastSeenConvId = this.conversationId;
3658
- const n = this.isAtBottom(e);
3659
- let r = null;
3660
- if (!t && !n) {
3661
- const s = this.pickAnchor(e);
3662
- if (s != null && s.rowKey) {
3663
- const i = this.findRowByKey(e, s.rowKey);
3664
- if (i) {
3681
+ const s = this.isAtBottom(e);
3682
+ let i = null;
3683
+ if (!t && !s) {
3684
+ const n = this.pickAnchor(e);
3685
+ if (n != null && n.rowKey) {
3686
+ const r = this.findRowByKey(e, n.rowKey);
3687
+ if (r) {
3665
3688
  const l = e.getBoundingClientRect().top;
3666
- r = {
3667
- rowKey: s.rowKey,
3668
- relY: i.getBoundingClientRect().top - l
3689
+ i = {
3690
+ rowKey: n.rowKey,
3691
+ relY: r.getBoundingClientRect().top - l
3669
3692
  };
3670
3693
  }
3671
3694
  }
3672
3695
  }
3673
- const a = { forceBottom: t, wasPinned: n, anchor: r };
3696
+ const a = { forceBottom: t, wasPinned: s, anchor: i };
3674
3697
  this._scrollSnap = a, this.$nextTick(() => {
3675
3698
  if (this._scrollSnap = null, a.forceBottom || a.wasPinned) {
3676
3699
  e.scrollTop = e.scrollHeight;
3677
3700
  return;
3678
3701
  }
3679
3702
  if (!a.anchor) return;
3680
- const s = () => {
3681
- const i = a.anchor, l = this.findRowByKey(e, i.rowKey);
3703
+ const n = () => {
3704
+ const r = a.anchor, l = this.findRowByKey(e, r.rowKey);
3682
3705
  if (!l) return;
3683
- const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - i.relY;
3706
+ const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - r.relY;
3684
3707
  Math.abs(k) > 0.5 && (e.scrollTop += k);
3685
3708
  };
3686
- s(), requestAnimationFrame(() => {
3687
- s(), requestAnimationFrame(s);
3709
+ n(), requestAnimationFrame(() => {
3710
+ n(), requestAnimationFrame(n);
3688
3711
  });
3689
3712
  });
3690
3713
  },
@@ -3711,25 +3734,25 @@ const Ir = {
3711
3734
  // `scrollTop`) when nothing matches handles the
3712
3735
  // very-top-of-scroll edge case the same way the old logic did.
3713
3736
  pickAnchor(e) {
3714
- const t = e.getBoundingClientRect().top, n = e.querySelectorAll(".wm-list__row[data-row-key]");
3715
- let r = null;
3716
- for (const a of n)
3717
- if (r || (r = a), a.getBoundingClientRect().bottom >= t)
3737
+ const t = e.getBoundingClientRect().top, s = e.querySelectorAll(".wm-list__row[data-row-key]");
3738
+ let i = null;
3739
+ for (const a of s)
3740
+ if (i || (i = a), a.getBoundingClientRect().bottom >= t)
3718
3741
  return { rowKey: a.dataset.rowKey };
3719
- return r ? { rowKey: r.dataset.rowKey } : null;
3742
+ return i ? { rowKey: i.dataset.rowKey } : null;
3720
3743
  },
3721
3744
  findRowByKey(e, t) {
3722
3745
  if (!t) return null;
3723
- const n = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/["\\]/g, "\\$&");
3746
+ const s = typeof CSS < "u" && CSS.escape ? CSS.escape(t) : t.replace(/["\\]/g, "\\$&");
3724
3747
  return e.querySelector(
3725
- `.wm-list__row[data-row-key="${n}"]`
3748
+ `.wm-list__row[data-row-key="${s}"]`
3726
3749
  );
3727
3750
  },
3728
3751
  roleOf(e) {
3729
- var n, r;
3730
- if ((e == null ? void 0 : e.type) === "system" || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.type) === "system")
3752
+ var s, i;
3753
+ if ((e == null ? void 0 : e.type) === "system" || ((s = e == null ? void 0 : e.payload) == null ? void 0 : s.type) === "system")
3731
3754
  return "system";
3732
- const t = (r = e == null ? void 0 : e.author) == null ? void 0 : r.type;
3755
+ const t = (i = e == null ? void 0 : e.author) == null ? void 0 : i.type;
3733
3756
  return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
3734
3757
  },
3735
3758
  roleLabel(e) {
@@ -3766,7 +3789,7 @@ const Ir = {
3766
3789
  }
3767
3790
  ];
3768
3791
  if (e.type === "action" && e.payload && e.payload.state !== "pending") {
3769
- const n = [
3792
+ const s = [
3770
3793
  {
3771
3794
  message: e,
3772
3795
  partKey: "main",
@@ -3774,12 +3797,12 @@ const Ir = {
3774
3797
  kind: { top: "bubble", bottom: "bubble" }
3775
3798
  }
3776
3799
  ];
3777
- return this.actionArtifact(e) && n.push({
3800
+ return this.actionArtifact(e) && s.push({
3778
3801
  message: e,
3779
3802
  partKey: "artifact",
3780
3803
  renderAs: "artifact-of-action",
3781
3804
  kind: { top: "card", bottom: "card" }
3782
- }), n;
3805
+ }), s;
3783
3806
  }
3784
3807
  return this.artifactOf(e) ? [
3785
3808
  {
@@ -3828,9 +3851,9 @@ const Ir = {
3828
3851
  // doit garder son arrondi.
3829
3852
  cornersFor(e, t) {
3830
3853
  var Q, se, re;
3831
- const n = e.items, r = (Q = n[t]) == null ? void 0 : Q.kind, a = (se = n[t - 1]) == null ? void 0 : se.kind, s = (re = n[t + 1]) == null ? void 0 : re.kind, i = e.role === "user", l = 14, _ = 4, k = a == null ? void 0 : a.bottom, w = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], q = 0.5, M = (W, ie, X) => W != null && T != null ? W + q >= T : ie === X || ie === "card" && X === "bubble";
3832
- let D = l, N = l, L = l, K = l;
3833
- return i ? (k && (N = _), (w || !s) && (L = _), k && M(E, k, r == null ? void 0 : r.top) && (D = _), w && M(A, w, r == null ? void 0 : r.bottom) && (K = _)) : (k && (D = _), (w || !s) && (K = _), k && M(E, k, r == null ? void 0 : r.top) && (N = _), w && M(A, w, r == null ? void 0 : r.bottom) && (L = _)), { tl: D, tr: N, br: L, bl: K };
3854
+ const s = e.items, i = (Q = s[t]) == null ? void 0 : Q.kind, a = (se = s[t - 1]) == null ? void 0 : se.kind, n = (re = s[t + 1]) == null ? void 0 : re.kind, r = e.role === "user", l = 14, _ = 4, k = a == null ? void 0 : a.bottom, w = n == null ? void 0 : n.top, T = this.widthByKey[this.rowKeyOf(e, t)], E = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], q = 0.5, M = (W, ie, X) => W != null && T != null ? W + q >= T : ie === X || ie === "card" && X === "bubble";
3855
+ let U = l, N = l, L = l, K = l;
3856
+ return r ? (k && (N = _), (w || !n) && (L = _), k && M(E, k, i == null ? void 0 : i.top) && (U = _), w && M(A, w, i == null ? void 0 : i.bottom) && (K = _)) : (k && (U = _), (w || !n) && (K = _), k && M(E, k, i == null ? void 0 : i.top) && (N = _), w && M(A, w, i == null ? void 0 : i.bottom) && (L = _)), { tl: U, tr: N, br: L, bl: K };
3834
3857
  },
3835
3858
  // Inline column-count for the mosaic grid, capped at 4. Single
3836
3859
  // attachment falls back to the vertical-list layout (null). Two
@@ -3851,10 +3874,10 @@ const Ir = {
3851
3874
  // sits above the mosaic — in that case the top edge of the
3852
3875
  // grid is connected to the bubble's flat bottom, so the top
3853
3876
  // corners of every top-row cell flatten too.
3854
- mosaicCornerStyle(e, t, n) {
3877
+ mosaicCornerStyle(e, t, s) {
3855
3878
  if (!t || t < 2) return null;
3856
- const r = Math.min(t, 4), a = Math.floor(e / r), s = e % r, i = s > 0, l = s < r - 1 && e + 1 < t, _ = a > 0, k = e + r < t, w = "4px", T = {};
3857
- return (i || _) && (T["--wm-r-tl"] = w), (l || _) && (T["--wm-r-tr"] = w), (i || k) && (T["--wm-r-bl"] = w), (l || k) && (T["--wm-r-br"] = w), n && (T["--wm-r-tl"] = w, T["--wm-r-tr"] = w), Object.keys(T).length ? T : null;
3879
+ const i = Math.min(t, 4), a = Math.floor(e / i), n = e % i, r = n > 0, l = n < i - 1 && e + 1 < t, _ = a > 0, k = e + i < t, w = "4px", T = {};
3880
+ return (r || _) && (T["--wm-r-tl"] = w), (l || _) && (T["--wm-r-tr"] = w), (r || k) && (T["--wm-r-bl"] = w), (l || k) && (T["--wm-r-br"] = w), s && (T["--wm-r-tl"] = w, T["--wm-r-tr"] = w), Object.keys(T).length ? T : null;
3858
3881
  },
3859
3882
  // Inline style emitting the four corner CSS variables. Set on
3860
3883
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -3862,20 +3885,20 @@ const Ir = {
3862
3885
  // those components fall back to their native border-radius.
3863
3886
  cornersStyle(e, t) {
3864
3887
  if (e.items.length < 2) return null;
3865
- const n = this.cornersFor(e, t);
3888
+ const s = this.cornersFor(e, t);
3866
3889
  return {
3867
- "--wm-r-tl": `${n.tl}px`,
3868
- "--wm-r-tr": `${n.tr}px`,
3869
- "--wm-r-br": `${n.br}px`,
3870
- "--wm-r-bl": `${n.bl}px`
3890
+ "--wm-r-tl": `${s.tl}px`,
3891
+ "--wm-r-tr": `${s.tr}px`,
3892
+ "--wm-r-br": `${s.br}px`,
3893
+ "--wm-r-bl": `${s.bl}px`
3871
3894
  };
3872
3895
  },
3873
3896
  // Clé unique par item de cluster, alignée avec `:key` /
3874
3897
  // `data-row-key` du template. Sert d'index dans `widthByKey`.
3875
3898
  rowKeyOf(e, t) {
3876
- var r;
3877
- const n = (r = e == null ? void 0 : e.items) == null ? void 0 : r[t];
3878
- return n ? `${ee(n.message)}-${n.partKey}` : "";
3899
+ var i;
3900
+ const s = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
3901
+ return s ? `${ee(s.message)}-${s.partKey}` : "";
3879
3902
  },
3880
3903
  // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
3881
3904
  // typing, scroll), un seul flush layout par frame suffit.
@@ -3892,27 +3915,27 @@ const Ir = {
3892
3915
  const e = this.$refs.scrollEl;
3893
3916
  if (!e) return;
3894
3917
  const t = {};
3895
- for (const s of e.querySelectorAll(
3918
+ for (const n of e.querySelectorAll(
3896
3919
  ".wm-list__row[data-row-key]"
3897
3920
  )) {
3898
- const i = s.dataset.rowKey;
3899
- if (!i) continue;
3900
- const l = s.querySelector(
3921
+ const r = n.dataset.rowKey;
3922
+ if (!r) continue;
3923
+ const l = n.querySelector(
3901
3924
  ".wm-bubble, .wm-result, .wm-art, .wm-list__body"
3902
3925
  );
3903
3926
  if (!l) continue;
3904
3927
  const _ = l.getBoundingClientRect().width;
3905
- _ > 0 && (t[i] = _);
3928
+ _ > 0 && (t[r] = _);
3906
3929
  }
3907
- const n = this.widthByKey, r = Object.keys(n), a = Object.keys(t);
3908
- if (r.length === a.length) {
3909
- let s = !0;
3910
- for (const i of a)
3911
- if (Math.abs((n[i] ?? 0) - t[i]) > 0.5) {
3912
- s = !1;
3930
+ const s = this.widthByKey, i = Object.keys(s), a = Object.keys(t);
3931
+ if (i.length === a.length) {
3932
+ let n = !0;
3933
+ for (const r of a)
3934
+ if (Math.abs((s[r] ?? 0) - t[r]) > 0.5) {
3935
+ n = !1;
3913
3936
  break;
3914
3937
  }
3915
- if (s) return;
3938
+ if (n) return;
3916
3939
  }
3917
3940
  this.widthByKey = Object.freeze(t);
3918
3941
  },
@@ -3939,11 +3962,11 @@ const Ir = {
3939
3962
  }
3940
3963
  },
3941
3964
  lastTimeOf(e) {
3942
- const t = e.items[e.items.length - 1], n = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
3943
- if (!(n != null && n.created_at)) return "";
3965
+ const t = e.items[e.items.length - 1], s = (t == null ? void 0 : t.message) || e.messages[e.messages.length - 1];
3966
+ if (!(s != null && s.created_at)) return "";
3944
3967
  try {
3945
3968
  return Ce(
3946
- new Date(n.created_at),
3969
+ new Date(s.created_at),
3947
3970
  ne(this.wmLocale())
3948
3971
  );
3949
3972
  } catch {
@@ -3956,12 +3979,12 @@ const Ir = {
3956
3979
  // séparée par une estampille rôle + heure.
3957
3980
  hasTrailingOverlay(e) {
3958
3981
  if (!e.messages.length) return !1;
3959
- const t = e.messages[e.messages.length - 1], n = e.items[e.items.length - 1];
3960
- return !!t && (n == null ? void 0 : n.message) !== t;
3982
+ const t = e.messages[e.messages.length - 1], s = e.items[e.items.length - 1];
3983
+ return !!t && (s == null ? void 0 : s.message) !== t;
3961
3984
  },
3962
3985
  attachmentsOf(e) {
3963
- var n;
3964
- const t = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.attachments;
3986
+ var s;
3987
+ const t = (s = e == null ? void 0 : e.payload) == null ? void 0 : s.attachments;
3965
3988
  return Array.isArray(t) ? t : [];
3966
3989
  },
3967
3990
  // Returns the artifact descriptor `{ kind, data }` if this message
@@ -3969,8 +3992,8 @@ const Ir = {
3969
3992
  // bubble for a dedicated card via `ArtifactRenderer`. Le registry
3970
3993
  // côté ArtifactRenderer décide quoi afficher pour chaque `kind`.
3971
3994
  artifactOf(e) {
3972
- var n;
3973
- const t = (n = e == null ? void 0 : e.metadata) == null ? void 0 : n.artifact;
3995
+ var s;
3996
+ const t = (s = e == null ? void 0 : e.metadata) == null ? void 0 : s.artifact;
3974
3997
  return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
3975
3998
  },
3976
3999
  actionLabel(e) {
@@ -3978,19 +4001,19 @@ const Ir = {
3978
4001
  return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
3979
4002
  },
3980
4003
  actionDetail(e) {
3981
- var n, r, a, s, i, l;
4004
+ var s, i, a, n, r, l;
3982
4005
  const t = e == null ? void 0 : e.payload;
3983
- return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((a = (r = t.success) == null ? void 0 : r.metadata) == null ? void 0 : a.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((i = t.failure) == null ? void 0 : i.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
4006
+ return t ? t.state === "success" ? ((s = t.success) == null ? void 0 : s.summary) || ((a = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : a.description) || "" : t.state === "rejected" ? ((n = t.rejected) == null ? void 0 : n.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((r = t.failure) == null ? void 0 : r.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
3984
4007
  },
3985
4008
  actionArtifact(e) {
3986
- var n, r;
3987
- const t = (r = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : r.artifact;
4009
+ var s, i;
4010
+ const t = (i = (s = e == null ? void 0 : e.payload) == null ? void 0 : s.success) == null ? void 0 : i.artifact;
3988
4011
  return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
3989
4012
  },
3990
4013
  systemLabel(e) {
3991
- var a, s, i;
3992
- const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, n = Ir[t], r = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((i = e == null ? void 0 : e.author) == null ? void 0 : i.name) || this.t("messageList.anAgent");
3993
- return n ? this.t(n, { name: r }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
4014
+ var a, n, r;
4015
+ const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, s = Ir[t], i = ((n = e == null ? void 0 : e.metadata) == null ? void 0 : n.agent_name) || ((r = e == null ? void 0 : e.author) == null ? void 0 : r.name) || this.t("messageList.anAgent");
4016
+ return s ? this.t(s, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
3994
4017
  },
3995
4018
  scrollToBottom() {
3996
4019
  const e = this.$refs.scrollEl;
@@ -4004,7 +4027,7 @@ const Ir = {
4004
4027
  e && (typeof e.scrollTo == "function" ? e.scrollTo({ top: e.scrollHeight, behavior: "smooth" }) : e.scrollTop = e.scrollHeight, this.showScrollDown = !1);
4005
4028
  }
4006
4029
  }
4007
- }, Ur = { class: "wm-list__wrap" }, Dr = {
4030
+ }, Dr = { class: "wm-list__wrap" }, Ur = {
4008
4031
  key: 0,
4009
4032
  class: "wm-list__loadMore",
4010
4033
  role: "status",
@@ -4034,32 +4057,32 @@ const Ir = {
4034
4057
  key: 3,
4035
4058
  class: "wm-list__row wm-list__row--ai fade-up"
4036
4059
  }, ti = { class: "wm-list__avatarSlot" }, ni = ["aria-label", "title"];
4037
- function si(e, t, n, r, a, s) {
4038
- const i = B("AIAvatar"), l = B("HumanAvatar"), _ = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), T = B("AttachmentPreview"), E = B("Typing");
4039
- return c(), d("div", Ur, [
4060
+ function si(e, t, s, i, a, n) {
4061
+ const r = B("AIAvatar"), l = B("HumanAvatar"), _ = B("ActionResult"), k = B("ArtifactRenderer"), w = B("Bubble"), T = B("AttachmentPreview"), E = B("Typing");
4062
+ return c(), d("div", Dr, [
4040
4063
  o("div", {
4041
4064
  ref: "scrollEl",
4042
4065
  class: R(["wm-list", { "wm-list--silent": a.silentFades }]),
4043
- onScrollPassive: t[4] || (t[4] = (...A) => s.onScroll && s.onScroll(...A))
4066
+ onScrollPassive: t[4] || (t[4] = (...A) => n.onScroll && n.onScroll(...A))
4044
4067
  }, [
4045
- n.loadingMore ? (c(), d("div", Dr, [
4068
+ s.loadingMore ? (c(), d("div", Ur, [
4046
4069
  t[6] || (t[6] = o("span", {
4047
4070
  class: "wm-list__loadMore-spinner",
4048
4071
  "aria-hidden": "true"
4049
4072
  }, null, -1)),
4050
- o("span", Nr, v(s.t("messageList.loadingHistory")), 1)
4051
- ])) : s.historyExhausted ? (c(), d("div", Fr, v(s.t("messageList.conversationStart")), 1)) : b("", !0),
4052
- n.dateLabel ? (c(), d("div", jr, [
4073
+ o("span", Nr, v(n.t("messageList.loadingHistory")), 1)
4074
+ ])) : n.historyExhausted ? (c(), d("div", Fr, v(n.t("messageList.conversationStart")), 1)) : b("", !0),
4075
+ s.dateLabel ? (c(), d("div", jr, [
4053
4076
  t[7] || (t[7] = o("div", { class: "wm-list__line" }, null, -1)),
4054
- o("span", Hr, v(n.dateLabel), 1),
4077
+ o("span", Hr, v(s.dateLabel), 1),
4055
4078
  t[8] || (t[8] = o("div", { class: "wm-list__line" }, null, -1))
4056
4079
  ])) : b("", !0),
4057
- (c(!0), d(I, null, F(s.groups, (A, q) => (c(), d(I, {
4080
+ (c(!0), d(I, null, F(n.groups, (A, q) => (c(), d(I, {
4058
4081
  key: A.key
4059
4082
  }, [
4060
- A.key === s.unreadGroupKey ? (c(), d("div", zr, [
4083
+ A.key === n.unreadGroupKey ? (c(), d("div", zr, [
4061
4084
  t[9] || (t[9] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1)),
4062
- o("span", qr, v(s.t("messageList.unread")), 1),
4085
+ o("span", qr, v(n.t("messageList.unread")), 1),
4063
4086
  t[10] || (t[10] = o("div", { class: "wm-list__line wm-list__line--unread" }, null, -1))
4064
4087
  ])) : b("", !0),
4065
4088
  A.role === "system" || A.items.length ? (c(), d("div", {
@@ -4071,11 +4094,11 @@ function si(e, t, n, r, a, s) {
4071
4094
  o("span", $r, v(A.systemLabel), 1),
4072
4095
  t[12] || (t[12] = o("div", { class: "wm-list__line wm-list__line--strong" }, null, -1))
4073
4096
  ])) : (c(), d(I, { key: 1 }, [
4074
- (c(!0), d(I, null, F(A.items, (M, D) => (c(), d(I, {
4075
- key: `${s.messageKey(M.message)}-${M.partKey}`
4097
+ (c(!0), d(I, null, F(A.items, (M, U) => (c(), d(I, {
4098
+ key: `${n.messageKey(M.message)}-${M.partKey}`
4076
4099
  }, [
4077
4100
  o("div", {
4078
- "data-row-key": `${s.messageKey(M.message)}-${M.partKey}`,
4101
+ "data-row-key": `${n.messageKey(M.message)}-${M.partKey}`,
4079
4102
  class: R(["wm-list__row fade-up", [
4080
4103
  "wm-list__row--" + A.role,
4081
4104
  {
@@ -4083,23 +4106,23 @@ function si(e, t, n, r, a, s) {
4083
4106
  "is-failed": M.message._failed
4084
4107
  }
4085
4108
  ]]),
4086
- style: z(s.cornersStyle(A, D)),
4087
- onPointerdown: (N) => s.onPressStart(`${s.messageKey(M.message)}-${M.partKey}`),
4088
- onPointerup: t[0] || (t[0] = (N) => s.onPressEnd()),
4089
- onPointercancel: t[1] || (t[1] = (N) => s.onPressEnd()),
4090
- onPointerleave: t[2] || (t[2] = (N) => s.onPressEnd()),
4109
+ style: z(n.cornersStyle(A, U)),
4110
+ onPointerdown: (N) => n.onPressStart(`${n.messageKey(M.message)}-${M.partKey}`),
4111
+ onPointerup: t[0] || (t[0] = (N) => n.onPressEnd()),
4112
+ onPointercancel: t[1] || (t[1] = (N) => n.onPressEnd()),
4113
+ onPointerleave: t[2] || (t[2] = (N) => n.onPressEnd()),
4091
4114
  onContextmenu: t[3] || (t[3] = J(() => {
4092
4115
  }, ["prevent"]))
4093
4116
  }, [
4094
4117
  A.role !== "user" ? (c(), d("div", Wr, [
4095
- D === A.items.length - 1 ? (c(), d(I, { key: 0 }, [
4096
- A.role === "ai" ? (c(), U(i, {
4118
+ U === A.items.length - 1 ? (c(), d(I, { key: 0 }, [
4119
+ A.role === "ai" ? (c(), D(r, {
4097
4120
  key: 0,
4098
4121
  size: 26,
4099
4122
  tail: !0,
4100
- name: n.aiAgentName,
4101
- "image-url": n.aiAgentAvatarUrl
4102
- }, null, 8, ["name", "image-url"])) : (c(), U(l, {
4123
+ name: s.aiAgentName,
4124
+ "image-url": s.aiAgentAvatarUrl
4125
+ }, null, 8, ["name", "image-url"])) : (c(), D(l, {
4103
4126
  key: 1,
4104
4127
  name: A.agentName,
4105
4128
  "avatar-url": A.agentAvatarUrl,
@@ -4108,54 +4131,54 @@ function si(e, t, n, r, a, s) {
4108
4131
  }, null, 8, ["name", "avatar-url"]))
4109
4132
  ], 64)) : b("", !0)
4110
4133
  ])) : b("", !0),
4111
- M.renderAs === "action" ? (c(), U(_, {
4134
+ M.renderAs === "action" ? (c(), D(_, {
4112
4135
  key: 1,
4113
4136
  state: M.message.payload.state,
4114
- label: s.actionLabel(M.message),
4115
- detail: s.actionDetail(M.message)
4116
- }, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), U(_, {
4137
+ label: n.actionLabel(M.message),
4138
+ detail: n.actionDetail(M.message)
4139
+ }, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), D(_, {
4117
4140
  key: 2,
4118
4141
  state: "awaiting",
4119
- label: s.t("messageList.approvalRequestSent"),
4142
+ label: n.t("messageList.approvalRequestSent"),
4120
4143
  detail: M.message.text_md || ""
4121
- }, null, 8, ["label", "detail"])) : M.renderAs === "artifact-of-action" ? (c(), U(k, {
4144
+ }, null, 8, ["label", "detail"])) : M.renderAs === "artifact-of-action" ? (c(), D(k, {
4122
4145
  key: 3,
4123
- artifact: s.actionArtifact(M.message)
4124
- }, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), U(k, {
4146
+ artifact: n.actionArtifact(M.message)
4147
+ }, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), D(k, {
4125
4148
  key: 4,
4126
- artifact: s.artifactOf(M.message)
4149
+ artifact: n.artifactOf(M.message)
4127
4150
  }, null, 8, ["artifact"])) : (c(), d("div", {
4128
4151
  key: 5,
4129
4152
  class: R(["wm-list__body", {
4130
- "wm-list__body--mixed": !!M.message.text_md && s.attachmentsOf(M.message).length > 0
4153
+ "wm-list__body--mixed": !!M.message.text_md && n.attachmentsOf(M.message).length > 0
4131
4154
  }])
4132
4155
  }, [
4133
- M.message.text_md ? (c(), U(w, {
4156
+ M.message.text_md ? (c(), D(w, {
4134
4157
  key: 0,
4135
4158
  role: A.role,
4136
4159
  text: M.message.text_md
4137
4160
  }, null, 8, ["role", "text"])) : b("", !0),
4138
- s.attachmentsOf(M.message).length ? (c(), d("div", {
4161
+ n.attachmentsOf(M.message).length ? (c(), d("div", {
4139
4162
  key: 1,
4140
4163
  class: R(["wm-list__atts", {
4141
4164
  "wm-list__atts--align-end": A.role === "user",
4142
- "wm-list__atts--mosaic": s.attachmentsOf(M.message).length >= 2
4165
+ "wm-list__atts--mosaic": n.attachmentsOf(M.message).length >= 2
4143
4166
  }]),
4144
4167
  style: z(
4145
- s.mosaicGridStyle(
4146
- s.attachmentsOf(M.message).length
4168
+ n.mosaicGridStyle(
4169
+ n.attachmentsOf(M.message).length
4147
4170
  )
4148
4171
  )
4149
4172
  }, [
4150
- (c(!0), d(I, null, F(s.attachmentsOf(
4173
+ (c(!0), d(I, null, F(n.attachmentsOf(
4151
4174
  M.message
4152
- ), (N, L) => (c(), U(T, {
4153
- key: `${s.messageKey(M.message)}-att-${L}`,
4175
+ ), (N, L) => (c(), D(T, {
4176
+ key: `${n.messageKey(M.message)}-att-${L}`,
4154
4177
  attachment: N,
4155
4178
  style: z(
4156
- s.mosaicCornerStyle(
4179
+ n.mosaicCornerStyle(
4157
4180
  L,
4158
- s.attachmentsOf(M.message).length,
4181
+ n.attachmentsOf(M.message).length,
4159
4182
  !!M.message.text_md
4160
4183
  )
4161
4184
  )
@@ -4163,33 +4186,33 @@ function si(e, t, n, r, a, s) {
4163
4186
  ], 6)) : b("", !0)
4164
4187
  ], 2))
4165
4188
  ], 46, Kr),
4166
- D < A.items.length - 1 && a.pressedItemKey === `${s.messageKey(M.message)}-${M.partKey}` && (A.role !== "user" || s.timeOf(M.message)) ? (c(), d("div", {
4189
+ U < A.items.length - 1 && a.pressedItemKey === `${n.messageKey(M.message)}-${M.partKey}` && (A.role !== "user" || n.timeOf(M.message)) ? (c(), d("div", {
4167
4190
  key: 0,
4168
4191
  class: R(["wm-list__meta wm-list__meta--press", { "wm-list__meta--right": A.role === "user" }])
4169
4192
  }, [
4170
- A.role !== "user" ? (c(), d("span", Gr, v(s.roleLabel(A)), 1)) : b("", !0),
4171
- A.role !== "user" && s.timeOf(M.message) ? (c(), d("span", Yr, "•")) : b("", !0),
4172
- s.timeOf(M.message) ? (c(), d("span", Jr, v(s.timeOf(M.message)), 1)) : b("", !0)
4193
+ A.role !== "user" ? (c(), d("span", Gr, v(n.roleLabel(A)), 1)) : b("", !0),
4194
+ A.role !== "user" && n.timeOf(M.message) ? (c(), d("span", Yr, "•")) : b("", !0),
4195
+ n.timeOf(M.message) ? (c(), d("span", Jr, v(n.timeOf(M.message)), 1)) : b("", !0)
4173
4196
  ], 2)) : b("", !0)
4174
4197
  ], 64))), 128)),
4175
- (A.role !== "user" || s.lastTimeOf(A)) && !s.hasTrailingOverlay(A) ? (c(), d("div", {
4198
+ (A.role !== "user" || n.lastTimeOf(A)) && !n.hasTrailingOverlay(A) ? (c(), d("div", {
4176
4199
  key: 0,
4177
4200
  class: R(["wm-list__meta", { "wm-list__meta--right": A.role === "user" }])
4178
4201
  }, [
4179
- A.role !== "user" ? (c(), d("span", Xr, v(s.roleLabel(A)), 1)) : b("", !0),
4180
- A.role !== "user" && s.lastTimeOf(A) ? (c(), d("span", Qr, "•")) : b("", !0),
4181
- s.lastTimeOf(A) ? (c(), d("span", Zr, v(s.lastTimeOf(A)), 1)) : b("", !0)
4202
+ A.role !== "user" ? (c(), d("span", Xr, v(n.roleLabel(A)), 1)) : b("", !0),
4203
+ A.role !== "user" && n.lastTimeOf(A) ? (c(), d("span", Qr, "•")) : b("", !0),
4204
+ n.lastTimeOf(A) ? (c(), d("span", Zr, v(n.lastTimeOf(A)), 1)) : b("", !0)
4182
4205
  ], 2)) : b("", !0)
4183
4206
  ], 64))
4184
4207
  ], 2)) : b("", !0)
4185
4208
  ], 64))), 128)),
4186
- n.streamingActive ? (c(), d("div", ei, [
4209
+ s.streamingActive ? (c(), d("div", ei, [
4187
4210
  o("div", ti, [
4188
- $(i, {
4211
+ $(r, {
4189
4212
  size: 26,
4190
4213
  tail: !0,
4191
- name: n.aiAgentName,
4192
- "image-url": n.aiAgentAvatarUrl
4214
+ name: s.aiAgentName,
4215
+ "image-url": s.aiAgentAvatarUrl
4193
4216
  }, null, 8, ["name", "image-url"])
4194
4217
  ]),
4195
4218
  $(E)
@@ -4201,9 +4224,9 @@ function si(e, t, n, r, a, s) {
4201
4224
  key: 0,
4202
4225
  type: "button",
4203
4226
  class: "wm-list__scrollDown",
4204
- "aria-label": s.t("messageList.scrollToBottom"),
4205
- title: s.t("messageList.scrollToBottom"),
4206
- onClick: t[5] || (t[5] = (...A) => s.scrollToBottomSmooth && s.scrollToBottomSmooth(...A))
4227
+ "aria-label": n.t("messageList.scrollToBottom"),
4228
+ title: n.t("messageList.scrollToBottom"),
4229
+ onClick: t[5] || (t[5] = (...A) => n.scrollToBottomSmooth && n.scrollToBottomSmooth(...A))
4207
4230
  }, [...t[13] || (t[13] = [
4208
4231
  o("svg", {
4209
4232
  width: "14",
@@ -4232,8 +4255,8 @@ function ii() {
4232
4255
  "video/webm",
4233
4256
  "video/mp4"
4234
4257
  ].find((t) => {
4235
- var n, r;
4236
- return (r = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : r.call(n, t);
4258
+ var s, i;
4259
+ return (i = (s = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(s, t);
4237
4260
  }) || "";
4238
4261
  }
4239
4262
  function Ve({ audio: e }) {
@@ -4271,15 +4294,15 @@ async function ai() {
4271
4294
  async function oi(e) {
4272
4295
  const t = document.createElement("video");
4273
4296
  t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
4274
- const n = t.videoWidth || 1280, r = t.videoHeight || 720, a = document.createElement("canvas");
4275
- a.width = n, a.height = r, a.getContext("2d").drawImage(t, 0, 0, n, r);
4276
- const s = await new Promise((l, _) => {
4297
+ const s = t.videoWidth || 1280, i = t.videoHeight || 720, a = document.createElement("canvas");
4298
+ a.width = s, a.height = i, a.getContext("2d").drawImage(t, 0, 0, s, i);
4299
+ const n = await new Promise((l, _) => {
4277
4300
  a.toBlob(
4278
4301
  (k) => k ? l(k) : _(new Error("toBlob failed")),
4279
4302
  "image/png"
4280
4303
  );
4281
- }), i = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
4282
- return new File([s], `capture-${i}.png`, { type: "image/png" });
4304
+ }), r = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
4305
+ return new File([n], `capture-${r}.png`, { type: "image/png" });
4283
4306
  }
4284
4307
  async function li(e = {}) {
4285
4308
  var k;
@@ -4292,43 +4315,43 @@ async function li(e = {}) {
4292
4315
  } catch (w) {
4293
4316
  return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
4294
4317
  }
4295
- const n = ii();
4296
- let r;
4318
+ const s = ii();
4319
+ let i;
4297
4320
  try {
4298
- r = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
4321
+ i = s ? new window.MediaRecorder(t, { mimeType: s }) : new window.MediaRecorder(t);
4299
4322
  } catch (w) {
4300
4323
  return console.error("[media] recorder init", w), t.getTracks().forEach((T) => {
4301
4324
  T.stop();
4302
4325
  }), null;
4303
4326
  }
4304
4327
  const a = [];
4305
- let s = null, i = !1;
4306
- r.addEventListener("dataavailable", (w) => {
4328
+ let n = null, r = !1;
4329
+ i.addEventListener("dataavailable", (w) => {
4307
4330
  w.data && w.data.size > 0 && a.push(w.data);
4308
- }), r.addEventListener("stop", () => {
4331
+ }), i.addEventListener("stop", () => {
4309
4332
  var w, T;
4310
- if (s && clearInterval(s), t.getTracks().forEach((E) => {
4333
+ if (n && clearInterval(n), t.getTracks().forEach((E) => {
4311
4334
  E.stop();
4312
4335
  }), a.length) {
4313
- const E = r.mimeType || n || "video/webm", A = new Blob(a, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), D = new File([A], `ecran-${M}.${q}`, {
4336
+ const E = i.mimeType || s || "video/webm", A = new Blob(a, { type: E }), q = /mp4/.test(E) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), U = new File([A], `ecran-${M}.${q}`, {
4314
4337
  type: E
4315
4338
  });
4316
- (w = e.onfinalize) == null || w.call(e, D);
4339
+ (w = e.onfinalize) == null || w.call(e, U);
4317
4340
  } else
4318
4341
  (T = e.oncancel) == null || T.call(e);
4319
4342
  }), t.getVideoTracks().forEach((w) => {
4320
4343
  w.addEventListener("ended", () => l(), { once: !0 });
4321
4344
  });
4322
4345
  function l() {
4323
- if (!i && (i = !0, r.state !== "inactive"))
4346
+ if (!r && (r = !0, i.state !== "inactive"))
4324
4347
  try {
4325
- r.stop();
4348
+ i.stop();
4326
4349
  } catch (w) {
4327
4350
  console.error("[media] recorder stop", w);
4328
4351
  }
4329
4352
  }
4330
4353
  try {
4331
- r.start(1e3);
4354
+ i.start(1e3);
4332
4355
  } catch (w) {
4333
4356
  return console.error("[media] recorder start", w), t.getTracks().forEach((T) => {
4334
4357
  T.stop();
@@ -4336,13 +4359,13 @@ async function li(e = {}) {
4336
4359
  }
4337
4360
  (k = e.onstart) == null || k.call(e);
4338
4361
  const _ = Date.now();
4339
- return s = setInterval(() => {
4362
+ return n = setInterval(() => {
4340
4363
  var w;
4341
4364
  (w = e.ontick) == null || w.call(e, Date.now() - _);
4342
4365
  }, 500), {
4343
4366
  stop: l,
4344
4367
  get state() {
4345
- return r.state;
4368
+ return i.state;
4346
4369
  }
4347
4370
  };
4348
4371
  }
@@ -4403,8 +4426,8 @@ const ci = [
4403
4426
  }));
4404
4427
  },
4405
4428
  recordingElapsedLabel() {
4406
- const e = Math.floor(this.recordingElapsed / 1e3), t = Math.floor(e / 60), n = e % 60;
4407
- return `${t}:${n.toString().padStart(2, "0")}`;
4429
+ const e = Math.floor(this.recordingElapsed / 1e3), t = Math.floor(e / 60), s = e % 60;
4430
+ return `${t}:${s.toString().padStart(2, "0")}`;
4408
4431
  }
4409
4432
  },
4410
4433
  watch: {
@@ -4458,7 +4481,7 @@ const ci = [
4458
4481
  },
4459
4482
  onFile(e) {
4460
4483
  const t = Array.from(e.target.files || []);
4461
- for (const n of t) this.$emit("attach", n);
4484
+ for (const s of t) this.$emit("attach", s);
4462
4485
  e.target.value = "";
4463
4486
  },
4464
4487
  onAttachAction(e) {
@@ -4531,9 +4554,9 @@ const ci = [
4531
4554
  height: "14",
4532
4555
  "aria-hidden": "true"
4533
4556
  }, pi = ["d"], vi = ["placeholder", "disabled"], yi = { class: "wm-compose__actions" }, wi = ["title", "aria-label", "disabled"], bi = ["disabled", "aria-label"];
4534
- function ki(e, t, n, r, a, s) {
4557
+ function ki(e, t, s, i, a, n) {
4535
4558
  return c(), d("div", {
4536
- class: R(["wm-compose-wrap", { "wm-compose-wrap--sheet": n.displayMode === "sheet" }]),
4559
+ class: R(["wm-compose-wrap", { "wm-compose-wrap--sheet": s.displayMode === "sheet" }]),
4537
4560
  style: z(a.kbOffset ? { transform: `translateY(-${a.kbOffset}px)` } : null)
4538
4561
  }, [
4539
4562
  a.recording ? (c(), d("div", ui, [
@@ -4541,41 +4564,41 @@ function ki(e, t, n, r, a, s) {
4541
4564
  class: "wm-rec__dot",
4542
4565
  "aria-hidden": "true"
4543
4566
  }, null, -1)),
4544
- o("span", hi, v(s.t("composer.recording", { time: s.recordingElapsedLabel })), 1),
4567
+ o("span", hi, v(n.t("composer.recording", { time: n.recordingElapsedLabel })), 1),
4545
4568
  o("button", {
4546
4569
  type: "button",
4547
4570
  class: "wm-rec__stop",
4548
- onClick: t[0] || (t[0] = (...i) => s.stopRecording && s.stopRecording(...i))
4549
- }, v(s.t("composer.stop")), 1)
4571
+ onClick: t[0] || (t[0] = (...r) => n.stopRecording && n.stopRecording(...r))
4572
+ }, v(n.t("composer.stop")), 1)
4550
4573
  ])) : b("", !0),
4551
4574
  o("form", {
4552
4575
  class: R(["wm-compose", { "has-attach": a.attachOpen }]),
4553
- onSubmit: t[7] || (t[7] = J((...i) => s.onSubmit && s.onSubmit(...i), ["prevent"]))
4576
+ onSubmit: t[7] || (t[7] = J((...r) => n.onSubmit && n.onSubmit(...r), ["prevent"]))
4554
4577
  }, [
4555
4578
  o("input", {
4556
4579
  ref: "fileEl",
4557
4580
  type: "file",
4558
4581
  hidden: "",
4559
4582
  multiple: "",
4560
- onChange: t[1] || (t[1] = (...i) => s.onFile && s.onFile(...i))
4583
+ onChange: t[1] || (t[1] = (...r) => n.onFile && n.onFile(...r))
4561
4584
  }, null, 544),
4562
4585
  a.attachOpen ? (c(), d("div", {
4563
4586
  key: 0,
4564
4587
  class: "wm-compose__overlay",
4565
- onClick: t[2] || (t[2] = (i) => a.attachOpen = !1)
4588
+ onClick: t[2] || (t[2] = (r) => a.attachOpen = !1)
4566
4589
  })) : b("", !0),
4567
4590
  a.attachOpen ? (c(), d("div", mi, [
4568
- (c(!0), d(I, null, F(s.attachItems, (i) => (c(), d("button", {
4569
- key: i.action,
4591
+ (c(!0), d(I, null, F(n.attachItems, (r) => (c(), d("button", {
4592
+ key: r.action,
4570
4593
  type: "button",
4571
4594
  class: "wm-compose__menuItem",
4572
- disabled: i.disabled,
4573
- onClick: (l) => s.onAttachAction(i.action)
4595
+ disabled: r.disabled,
4596
+ onClick: (l) => n.onAttachAction(r.action)
4574
4597
  }, [
4575
4598
  o("span", _i, [
4576
4599
  (c(), d("svg", gi, [
4577
4600
  o("path", {
4578
- d: i.path,
4601
+ d: r.path,
4579
4602
  stroke: "currentColor",
4580
4603
  "stroke-width": "1.8",
4581
4604
  "stroke-linecap": "round",
@@ -4584,18 +4607,18 @@ function ki(e, t, n, r, a, s) {
4584
4607
  }, null, 8, pi)
4585
4608
  ]))
4586
4609
  ]),
4587
- o("span", null, v(i.label), 1)
4610
+ o("span", null, v(r.label), 1)
4588
4611
  ], 8, fi))), 128))
4589
4612
  ])) : b("", !0),
4590
4613
  G(o("textarea", {
4591
4614
  ref: "inputEl",
4592
- "onUpdate:modelValue": t[3] || (t[3] = (i) => a.local = i),
4615
+ "onUpdate:modelValue": t[3] || (t[3] = (r) => a.local = r),
4593
4616
  class: "wm-compose__input",
4594
4617
  rows: "3",
4595
- placeholder: n.placeholder,
4596
- disabled: n.disabled,
4597
- onKeydown: t[4] || (t[4] = (...i) => s.onKeydown && s.onKeydown(...i)),
4598
- onInput: t[5] || (t[5] = (...i) => s.autosize && s.autosize(...i))
4618
+ placeholder: s.placeholder,
4619
+ disabled: s.disabled,
4620
+ onKeydown: t[4] || (t[4] = (...r) => n.onKeydown && n.onKeydown(...r)),
4621
+ onInput: t[5] || (t[5] = (...r) => n.autosize && n.autosize(...r))
4599
4622
  }, null, 40, vi), [
4600
4623
  [te, a.local]
4601
4624
  ]),
@@ -4603,10 +4626,10 @@ function ki(e, t, n, r, a, s) {
4603
4626
  o("button", {
4604
4627
  type: "button",
4605
4628
  class: R(["wm-compose__icon", { "is-open": a.attachOpen }]),
4606
- title: n.attachLabel,
4607
- "aria-label": n.attachLabel,
4629
+ title: s.attachLabel,
4630
+ "aria-label": s.attachLabel,
4608
4631
  disabled: a.recording,
4609
- onClick: t[6] || (t[6] = (i) => a.attachOpen = !a.attachOpen)
4632
+ onClick: t[6] || (t[6] = (r) => a.attachOpen = !a.attachOpen)
4610
4633
  }, [...t[9] || (t[9] = [
4611
4634
  o("svg", {
4612
4635
  width: "13",
@@ -4624,9 +4647,9 @@ function ki(e, t, n, r, a, s) {
4624
4647
  ])], 10, wi),
4625
4648
  o("button", {
4626
4649
  type: "submit",
4627
- class: R(["wm-compose__send", { "is-empty": !s.canSend }]),
4628
- disabled: !s.canSend,
4629
- "aria-label": s.t("composer.send")
4650
+ class: R(["wm-compose__send", { "is-empty": !n.canSend }]),
4651
+ disabled: !n.canSend,
4652
+ "aria-label": n.t("composer.send")
4630
4653
  }, [...t[10] || (t[10] = [
4631
4654
  o("svg", {
4632
4655
  width: "13",
@@ -4664,18 +4687,18 @@ const Ci = /* @__PURE__ */ P(di, [["render", ki], ["__scopeId", "data-v-01e81a27
4664
4687
  }
4665
4688
  }
4666
4689
  }, Si = ["onClick"];
4667
- function Mi(e, t, n, r, a, s) {
4668
- return n.items.length ? (c(), d("div", {
4669
- key: s.batchKey,
4690
+ function Mi(e, t, s, i, a, n) {
4691
+ return s.items.length ? (c(), d("div", {
4692
+ key: n.batchKey,
4670
4693
  class: "wm-chips"
4671
4694
  }, [
4672
- (c(!0), d(I, null, F(n.items, (i, l) => (c(), d("button", {
4695
+ (c(!0), d(I, null, F(s.items, (r, l) => (c(), d("button", {
4673
4696
  key: l,
4674
4697
  type: "button",
4675
4698
  class: "wm-chip",
4676
- style: z({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
4677
- onClick: (_) => e.$emit("select", i)
4678
- }, v(i.label), 13, Si))), 128))
4699
+ style: z({ animationDelay: s.baseDelay + l * s.stepDelay + "ms" }),
4700
+ onClick: (_) => e.$emit("select", r)
4701
+ }, v(r.label), 13, Si))), 128))
4679
4702
  ])) : b("", !0);
4680
4703
  }
4681
4704
  const Ti = /* @__PURE__ */ P(Ai, [["render", Mi], ["__scopeId", "data-v-47ad8085"]]), xi = {
@@ -4726,40 +4749,40 @@ const Ti = /* @__PURE__ */ P(Ai, [["render", Mi], ["__scopeId", "data-v-47ad8085
4726
4749
  key: 0,
4727
4750
  class: "wm-approval__detail"
4728
4751
  }, Pi = { class: "wm-approval__actions" };
4729
- function Ui(e, t, n, r, a, s) {
4730
- const i = B("AIAvatar");
4752
+ function Di(e, t, s, i, a, n) {
4753
+ const r = B("AIAvatar");
4731
4754
  return c(), d("div", Oi, [
4732
4755
  o("div", Ri, [
4733
4756
  o("div", Li, [
4734
- $(i, {
4757
+ $(r, {
4735
4758
  size: 24,
4736
- name: n.agentName,
4737
- "image-url": n.agentAvatarUrl
4759
+ name: s.agentName,
4760
+ "image-url": s.agentAvatarUrl
4738
4761
  }, null, 8, ["name", "image-url"])
4739
4762
  ]),
4740
4763
  o("div", Ii, [
4741
- o("div", Ei, v(n.action), 1),
4742
- n.detail ? (c(), d("div", Bi, v(n.detail), 1)) : b("", !0)
4764
+ o("div", Ei, v(s.action), 1),
4765
+ s.detail ? (c(), d("div", Bi, v(s.detail), 1)) : b("", !0)
4743
4766
  ])
4744
4767
  ]),
4745
4768
  o("div", Pi, [
4746
- s.rejectId ? (c(), d("button", {
4769
+ n.rejectId ? (c(), d("button", {
4747
4770
  key: 0,
4748
4771
  type: "button",
4749
4772
  class: "wm-approval__btn wm-approval__btn--neutral",
4750
- onClick: t[0] || (t[0] = (l) => e.$emit("callback", s.rejectId))
4751
- }, v(s.rejectLabel), 1)) : b("", !0),
4752
- s.approveId ? (c(), d("button", {
4773
+ onClick: t[0] || (t[0] = (l) => e.$emit("callback", n.rejectId))
4774
+ }, v(n.rejectLabel), 1)) : b("", !0),
4775
+ n.approveId ? (c(), d("button", {
4753
4776
  key: 1,
4754
4777
  type: "button",
4755
4778
  class: "wm-approval__btn wm-approval__btn--primary",
4756
- onClick: t[1] || (t[1] = (l) => e.$emit("callback", s.approveId))
4757
- }, v(s.approveLabel), 1)) : b("", !0)
4779
+ onClick: t[1] || (t[1] = (l) => e.$emit("callback", n.approveId))
4780
+ }, v(n.approveLabel), 1)) : b("", !0)
4758
4781
  ])
4759
4782
  ]);
4760
4783
  }
4761
- const Di = /* @__PURE__ */ P(xi, [["render", Ui], ["__scopeId", "data-v-a2bed37e"]]);
4762
- let Ue = 0;
4784
+ const Ui = /* @__PURE__ */ P(xi, [["render", Di], ["__scopeId", "data-v-a2bed37e"]]);
4785
+ let De = 0;
4763
4786
  const Ni = /* @__PURE__ */ new Set([
4764
4787
  "text",
4765
4788
  "textarea",
@@ -4785,8 +4808,8 @@ const Ni = /* @__PURE__ */ new Set([
4785
4808
  },
4786
4809
  emits: ["submit"],
4787
4810
  data() {
4788
- return Ue += 1, {
4789
- _uid: Ue,
4811
+ return De += 1, {
4812
+ _uid: De,
4790
4813
  values: {},
4791
4814
  busy: !1,
4792
4815
  error: ""
@@ -4798,7 +4821,7 @@ const Ni = /* @__PURE__ */ new Set([
4798
4821
  // douteux.
4799
4822
  normalizedFields() {
4800
4823
  var t;
4801
- return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((n) => !(!(n != null && n.key) || !(n != null && n.label) || !Ni.has(n == null ? void 0 : n.type) || (n.type === "select" || n.type === "multiselect") && (!Array.isArray(n.options) || n.options.length === 0)));
4824
+ return (Array.isArray((t = this.form) == null ? void 0 : t.fields) ? this.form.fields : []).filter((s) => !(!(s != null && s.key) || !(s != null && s.label) || !Ni.has(s == null ? void 0 : s.type) || (s.type === "select" || s.type === "multiselect") && (!Array.isArray(s.options) || s.options.length === 0)));
4802
4825
  }
4803
4826
  },
4804
4827
  created() {
@@ -4807,18 +4830,18 @@ const Ni = /* @__PURE__ */ new Set([
4807
4830
  methods: {
4808
4831
  resetValues() {
4809
4832
  const e = this.initialValues && typeof this.initialValues == "object" ? this.initialValues : {}, t = {};
4810
- for (const n of this.normalizedFields) {
4811
- if (e[n.key] !== void 0) {
4812
- t[n.key] = e[n.key];
4833
+ for (const s of this.normalizedFields) {
4834
+ if (e[s.key] !== void 0) {
4835
+ t[s.key] = e[s.key];
4813
4836
  continue;
4814
4837
  }
4815
- n.type === "boolean" ? t[n.key] = !1 : n.type === "multiselect" ? t[n.key] = [] : t[n.key] = "";
4838
+ s.type === "boolean" ? t[s.key] = !1 : s.type === "multiselect" ? t[s.key] = [] : t[s.key] = "";
4816
4839
  }
4817
4840
  this.values = t, this.error = "";
4818
4841
  },
4819
- toggleMulti(e, t, n) {
4820
- const r = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = r.indexOf(t);
4821
- n && a === -1 ? r.push(t) : !n && a !== -1 && r.splice(a, 1), this.values = { ...this.values, [e]: r };
4842
+ toggleMulti(e, t, s) {
4843
+ const i = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = i.indexOf(t);
4844
+ s && a === -1 ? i.push(t) : !s && a !== -1 && i.splice(a, 1), this.values = { ...this.values, [e]: i };
4822
4845
  },
4823
4846
  validate() {
4824
4847
  for (const e of this.normalizedFields) {
@@ -4878,27 +4901,27 @@ const Ni = /* @__PURE__ */ new Set([
4878
4901
  key: 2,
4879
4902
  class: "wm-form__doneLbl"
4880
4903
  };
4881
- function ca(e, t, n, r, a, s) {
4882
- const i = B("AIAvatar");
4904
+ function ca(e, t, s, i, a, n) {
4905
+ const r = B("AIAvatar");
4883
4906
  return c(), d("div", ji, [
4884
4907
  o("div", Hi, [
4885
4908
  o("div", zi, [
4886
- $(i, {
4909
+ $(r, {
4887
4910
  size: 24,
4888
- name: n.agentName,
4889
- "image-url": n.agentAvatarUrl
4911
+ name: s.agentName,
4912
+ "image-url": s.agentAvatarUrl
4890
4913
  }, null, 8, ["name", "image-url"])
4891
4914
  ]),
4892
4915
  o("div", qi, [
4893
- o("div", Vi, v(n.form.title || s.t("form.title")), 1),
4894
- n.form.description ? (c(), d("div", $i, v(n.form.description), 1)) : b("", !0)
4916
+ o("div", Vi, v(s.form.title || n.t("form.title")), 1),
4917
+ s.form.description ? (c(), d("div", $i, v(s.form.description), 1)) : b("", !0)
4895
4918
  ])
4896
4919
  ]),
4897
4920
  o("form", {
4898
4921
  class: "wm-form__body",
4899
- onSubmit: t[0] || (t[0] = J((...l) => s.onSubmit && s.onSubmit(...l), ["prevent"]))
4922
+ onSubmit: t[0] || (t[0] = J((...l) => n.onSubmit && n.onSubmit(...l), ["prevent"]))
4900
4923
  }, [
4901
- (c(!0), d(I, null, F(s.normalizedFields, (l) => (c(), d("div", {
4924
+ (c(!0), d(I, null, F(n.normalizedFields, (l) => (c(), d("div", {
4902
4925
  key: l.key,
4903
4926
  class: "wm-form__field"
4904
4927
  }, [
@@ -4917,7 +4940,7 @@ function ca(e, t, n, r, a, s) {
4917
4940
  class: "wm-form__input",
4918
4941
  placeholder: l.placeholder || "",
4919
4942
  required: l.required,
4920
- disabled: n.readOnly || a.busy
4943
+ disabled: s.readOnly || a.busy
4921
4944
  }, null, 8, Gi)), [
4922
4945
  [te, a.values[l.key]]
4923
4946
  ]) : l.type === "textarea" ? G((c(), d("textarea", {
@@ -4928,7 +4951,7 @@ function ca(e, t, n, r, a, s) {
4928
4951
  rows: "3",
4929
4952
  placeholder: l.placeholder || "",
4930
4953
  required: l.required,
4931
- disabled: n.readOnly || a.busy
4954
+ disabled: s.readOnly || a.busy
4932
4955
  }, null, 8, Yi)), [
4933
4956
  [te, a.values[l.key]]
4934
4957
  ]) : l.type === "number" ? G((c(), d("input", {
@@ -4939,7 +4962,7 @@ function ca(e, t, n, r, a, s) {
4939
4962
  class: "wm-form__input",
4940
4963
  placeholder: l.placeholder || "",
4941
4964
  required: l.required,
4942
- disabled: n.readOnly || a.busy
4965
+ disabled: s.readOnly || a.busy
4943
4966
  }, null, 8, Ji)), [
4944
4967
  [
4945
4968
  te,
@@ -4954,7 +4977,7 @@ function ca(e, t, n, r, a, s) {
4954
4977
  type: "date",
4955
4978
  class: "wm-form__input",
4956
4979
  required: l.required,
4957
- disabled: n.readOnly || a.busy
4980
+ disabled: s.readOnly || a.busy
4958
4981
  }, null, 8, Xi)), [
4959
4982
  [te, a.values[l.key]]
4960
4983
  ]) : l.type === "boolean" ? (c(), d("label", Qi, [
@@ -4962,20 +4985,20 @@ function ca(e, t, n, r, a, s) {
4962
4985
  id: `wm-f-${a._uid}-${l.key}`,
4963
4986
  "onUpdate:modelValue": (_) => a.values[l.key] = _,
4964
4987
  type: "checkbox",
4965
- disabled: n.readOnly || a.busy
4988
+ disabled: s.readOnly || a.busy
4966
4989
  }, null, 8, Zi), [
4967
4990
  [We, a.values[l.key]]
4968
4991
  ]),
4969
- o("span", null, v(l.placeholder || s.t("common.yes")), 1)
4992
+ o("span", null, v(l.placeholder || n.t("common.yes")), 1)
4970
4993
  ])) : l.type === "select" ? G((c(), d("select", {
4971
4994
  key: 5,
4972
4995
  id: `wm-f-${a._uid}-${l.key}`,
4973
4996
  "onUpdate:modelValue": (_) => a.values[l.key] = _,
4974
4997
  class: "wm-form__select",
4975
4998
  required: l.required,
4976
- disabled: n.readOnly || a.busy
4999
+ disabled: s.readOnly || a.busy
4977
5000
  }, [
4978
- o("option", ta, v(l.placeholder || s.t("form.choose")), 1),
5001
+ o("option", ta, v(l.placeholder || n.t("form.choose")), 1),
4979
5002
  (c(!0), d(I, null, F(l.options, (_) => (c(), d("option", {
4980
5003
  key: _.value,
4981
5004
  value: _.value
@@ -4991,8 +5014,8 @@ function ca(e, t, n, r, a, s) {
4991
5014
  type: "checkbox",
4992
5015
  value: _.value,
4993
5016
  checked: Array.isArray(a.values[l.key]) && a.values[l.key].includes(_.value),
4994
- disabled: n.readOnly || a.busy,
4995
- onChange: (k) => s.toggleMulti(
5017
+ disabled: s.readOnly || a.busy,
5018
+ onChange: (k) => n.toggleMulti(
4996
5019
  l.key,
4997
5020
  _.value,
4998
5021
  k.target.checked
@@ -5003,14 +5026,14 @@ function ca(e, t, n, r, a, s) {
5003
5026
  ])) : b("", !0)
5004
5027
  ]))), 128)),
5005
5028
  a.error ? (c(), d("div", ia, v(a.error), 1)) : b("", !0),
5006
- n.readOnly ? (c(), d("div", la, v(s.t("form.responseSent")), 1)) : (c(), d("button", {
5029
+ s.readOnly ? (c(), d("div", la, v(n.t("form.responseSent")), 1)) : (c(), d("button", {
5007
5030
  key: 1,
5008
5031
  type: "submit",
5009
5032
  class: "wm-form__submit",
5010
5033
  disabled: a.busy
5011
5034
  }, [
5012
5035
  a.busy ? (c(), d("span", oa)) : b("", !0),
5013
- o("span", null, v(a.busy ? s.t("common.sending") : n.form.submit_label || s.t("common.send")), 1)
5036
+ o("span", null, v(a.busy ? n.t("common.sending") : s.form.submit_label || n.t("common.send")), 1)
5014
5037
  ], 8, aa))
5015
5038
  ], 32)
5016
5039
  ]);
@@ -5053,9 +5076,9 @@ const da = /* @__PURE__ */ P(Fi, [["render", ca], ["__scopeId", "data-v-fe65cc56
5053
5076
  key: 1,
5054
5077
  class: "wm-fb__done"
5055
5078
  }, ba = { class: "wm-fb__doneTitle" }, ka = { class: "wm-fb__doneSub" };
5056
- function Ca(e, t, n, r, a, s) {
5079
+ function Ca(e, t, s, i, a, n) {
5057
5080
  return c(), d("div", ha, [
5058
- n.done ? (c(), d("div", wa, [
5081
+ s.done ? (c(), d("div", wa, [
5059
5082
  t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
5060
5083
  o("svg", {
5061
5084
  width: "16",
@@ -5071,28 +5094,28 @@ function Ca(e, t, n, r, a, s) {
5071
5094
  o("path", { d: "M20 6L9 17l-5-5" })
5072
5095
  ])
5073
5096
  ], -1)),
5074
- o("div", ba, v(s.t("feedback.doneTitle")), 1),
5075
- o("div", ka, v(s.t("feedback.doneSubtitle")), 1)
5097
+ o("div", ba, v(n.t("feedback.doneTitle")), 1),
5098
+ o("div", ka, v(n.t("feedback.doneSubtitle")), 1)
5076
5099
  ])) : (c(), d(I, { key: 0 }, [
5077
- o("div", ma, v(s.t("feedback.question")), 1),
5078
- o("div", fa, v(s.t("feedback.subtitle")), 1),
5100
+ o("div", ma, v(n.t("feedback.question")), 1),
5101
+ o("div", fa, v(n.t("feedback.subtitle")), 1),
5079
5102
  o("div", _a, [
5080
- (c(!0), d(I, null, F(s.options, (i) => (c(), d("button", {
5081
- key: i.v,
5103
+ (c(!0), d(I, null, F(n.options, (r) => (c(), d("button", {
5104
+ key: r.v,
5082
5105
  type: "button",
5083
- class: R(["wm-fb__opt", { "is-selected": a.sel === i.v }]),
5084
- onClick: (l) => a.sel = i.v
5106
+ class: R(["wm-fb__opt", { "is-selected": a.sel === r.v }]),
5107
+ onClick: (l) => a.sel = r.v
5085
5108
  }, [
5086
- o("span", pa, v(i.e), 1),
5087
- o("span", va, v(i.l), 1)
5109
+ o("span", pa, v(r.e), 1),
5110
+ o("span", va, v(r.l), 1)
5088
5111
  ], 10, ga))), 128))
5089
5112
  ]),
5090
5113
  o("button", {
5091
5114
  type: "button",
5092
5115
  class: "wm-fb__send",
5093
- disabled: !a.sel || n.busy,
5094
- onClick: t[0] || (t[0] = (...i) => s.onSend && s.onSend(...i))
5095
- }, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, ya)
5116
+ disabled: !a.sel || s.busy,
5117
+ onClick: t[0] || (t[0] = (...r) => n.onSend && n.onSend(...r))
5118
+ }, v(s.busy ? n.t("common.sending") : n.t("feedback.submit")), 9, ya)
5096
5119
  ], 64))
5097
5120
  ]);
5098
5121
  }
@@ -5140,20 +5163,20 @@ const Aa = /* @__PURE__ */ P(ua, [["render", Ca], ["__scopeId", "data-v-9b630564
5140
5163
  }, Oa = { class: "wm-mm__label" }, Ra = { class: "wm-mm__label" }, La = {
5141
5164
  key: 1,
5142
5165
  class: "wm-mm__sep"
5143
- }, Ia = { class: "wm-mm__section" }, Ea = { class: "wm-mm__label" }, Ba = { class: "wm-mm__section" }, Pa = { class: "wm-mm__label" }, Ua = { class: "wm-mm__label" };
5144
- function Da(e, t, n, r, a, s) {
5166
+ }, Ia = { class: "wm-mm__section" }, Ea = { class: "wm-mm__label" }, Ba = { class: "wm-mm__section" }, Pa = { class: "wm-mm__label" }, Da = { class: "wm-mm__label" };
5167
+ function Ua(e, t, s, i, a, n) {
5145
5168
  return c(), d("div", Ma, [
5146
5169
  o("div", {
5147
5170
  class: "wm-mm__scrim",
5148
- onClick: t[0] || (t[0] = (i) => e.$emit("close"))
5171
+ onClick: t[0] || (t[0] = (r) => e.$emit("close"))
5149
5172
  }),
5150
5173
  o("div", Ta, [
5151
- n.canRename || n.canExport ? (c(), d("div", xa, [
5152
- n.canRename ? (c(), d("button", {
5174
+ s.canRename || s.canExport ? (c(), d("div", xa, [
5175
+ s.canRename ? (c(), d("button", {
5153
5176
  key: 0,
5154
5177
  type: "button",
5155
5178
  class: "wm-mm__item",
5156
- onClick: t[1] || (t[1] = (i) => s.emit("rename"))
5179
+ onClick: t[1] || (t[1] = (r) => n.emit("rename"))
5157
5180
  }, [
5158
5181
  t[6] || (t[6] = o("span", { class: "wm-mm__icon" }, [
5159
5182
  o("svg", {
@@ -5171,13 +5194,13 @@ function Da(e, t, n, r, a, s) {
5171
5194
  o("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z" })
5172
5195
  ])
5173
5196
  ], -1)),
5174
- o("span", Oa, v(s.t("moreMenu.editTitle")), 1)
5197
+ o("span", Oa, v(n.t("moreMenu.editTitle")), 1)
5175
5198
  ])) : b("", !0),
5176
- n.canExport ? (c(), d("button", {
5199
+ s.canExport ? (c(), d("button", {
5177
5200
  key: 1,
5178
5201
  type: "button",
5179
5202
  class: "wm-mm__item",
5180
- onClick: t[2] || (t[2] = (i) => s.emit("export"))
5203
+ onClick: t[2] || (t[2] = (r) => n.emit("export"))
5181
5204
  }, [
5182
5205
  t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
5183
5206
  o("svg", {
@@ -5194,16 +5217,16 @@ function Da(e, t, n, r, a, s) {
5194
5217
  o("path", { d: "M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13" })
5195
5218
  ])
5196
5219
  ], -1)),
5197
- o("span", Ra, v(s.t("moreMenu.exportTranscript")), 1),
5220
+ o("span", Ra, v(n.t("moreMenu.exportTranscript")), 1),
5198
5221
  t[8] || (t[8] = o("span", { class: "wm-mm__hint" }, ".txt", -1))
5199
5222
  ])) : b("", !0)
5200
5223
  ])) : b("", !0),
5201
- n.canRename || n.canExport ? (c(), d("div", La)) : b("", !0),
5224
+ s.canRename || s.canExport ? (c(), d("div", La)) : b("", !0),
5202
5225
  o("div", Ia, [
5203
5226
  o("button", {
5204
5227
  type: "button",
5205
5228
  class: "wm-mm__item",
5206
- onClick: t[3] || (t[3] = (...i) => s.toggleSound && s.toggleSound(...i))
5229
+ onClick: t[3] || (t[3] = (...r) => n.toggleSound && n.toggleSound(...r))
5207
5230
  }, [
5208
5231
  t[10] || (t[10] = o("span", { class: "wm-mm__icon" }, [
5209
5232
  o("svg", {
@@ -5221,7 +5244,7 @@ function Da(e, t, n, r, a, s) {
5221
5244
  o("path", { d: "M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14" })
5222
5245
  ])
5223
5246
  ], -1)),
5224
- o("span", Ea, v(s.t("moreMenu.sound")), 1),
5247
+ o("span", Ea, v(n.t("moreMenu.sound")), 1),
5225
5248
  o("span", {
5226
5249
  class: R(["wm-mm__toggle", { "wm-mm__toggle--on": a.soundOn }])
5227
5250
  }, [...t[9] || (t[9] = [
@@ -5231,11 +5254,11 @@ function Da(e, t, n, r, a, s) {
5231
5254
  ]),
5232
5255
  t[13] || (t[13] = o("div", { class: "wm-mm__sep" }, null, -1)),
5233
5256
  o("div", Ba, [
5234
- n.statusUrl ? (c(), d("button", {
5257
+ s.statusUrl ? (c(), d("button", {
5235
5258
  key: 0,
5236
5259
  type: "button",
5237
5260
  class: "wm-mm__item",
5238
- onClick: t[4] || (t[4] = (i) => s.emit("status"))
5261
+ onClick: t[4] || (t[4] = (r) => n.emit("status"))
5239
5262
  }, [
5240
5263
  t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
5241
5264
  o("svg", {
@@ -5252,13 +5275,13 @@ function Da(e, t, n, r, a, s) {
5252
5275
  o("path", { d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2" })
5253
5276
  ])
5254
5277
  ], -1)),
5255
- o("span", Pa, v(s.t("moreMenu.serviceStatus")), 1)
5278
+ o("span", Pa, v(n.t("moreMenu.serviceStatus")), 1)
5256
5279
  ])) : b("", !0),
5257
- n.helpUrl ? (c(), d("button", {
5280
+ s.helpUrl ? (c(), d("button", {
5258
5281
  key: 1,
5259
5282
  type: "button",
5260
5283
  class: "wm-mm__item",
5261
- onClick: t[5] || (t[5] = (i) => s.emit("help"))
5284
+ onClick: t[5] || (t[5] = (r) => n.emit("help"))
5262
5285
  }, [
5263
5286
  t[12] || (t[12] = o("span", { class: "wm-mm__icon" }, [
5264
5287
  o("svg", {
@@ -5275,13 +5298,13 @@ function Da(e, t, n, r, a, s) {
5275
5298
  o("path", { d: "M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z" })
5276
5299
  ])
5277
5300
  ], -1)),
5278
- o("span", Ua, v(s.t("moreMenu.helpCenter")), 1)
5301
+ o("span", Da, v(n.t("moreMenu.helpCenter")), 1)
5279
5302
  ])) : b("", !0)
5280
5303
  ])
5281
5304
  ])
5282
5305
  ]);
5283
5306
  }
5284
- const Na = /* @__PURE__ */ P(Sa, [["render", Da], ["__scopeId", "data-v-4cf6d578"]]), Fa = {
5307
+ const Na = /* @__PURE__ */ P(Sa, [["render", Ua], ["__scopeId", "data-v-4cf6d578"]]), Fa = {
5285
5308
  name: "WmRenameDialog",
5286
5309
  inject: {
5287
5310
  // Translator shared by the Messenger shell; French fallback when
@@ -5328,20 +5351,20 @@ const Na = /* @__PURE__ */ P(Sa, [["render", Da], ["__scopeId", "data-v-4cf6d578
5328
5351
  role: "dialog",
5329
5352
  "aria-modal": "true"
5330
5353
  }, za = { class: "wm-dialog__head" }, qa = { class: "wm-dialog__title" }, Va = ["aria-label"], $a = { class: "wm-dialog__body" }, Ka = ["placeholder"], Wa = { class: "wm-dialog__actions" }, Ga = ["disabled"];
5331
- function Ya(e, t, n, r, a, s) {
5354
+ function Ya(e, t, s, i, a, n) {
5332
5355
  return c(), d("div", ja, [
5333
5356
  o("div", {
5334
5357
  class: "wm-dialog__scrim",
5335
- onClick: t[0] || (t[0] = (i) => e.$emit("close"))
5358
+ onClick: t[0] || (t[0] = (r) => e.$emit("close"))
5336
5359
  }),
5337
5360
  o("div", Ha, [
5338
5361
  o("div", za, [
5339
- o("div", qa, v(n.title || s.t("rename.title")), 1),
5362
+ o("div", qa, v(s.title || n.t("rename.title")), 1),
5340
5363
  o("button", {
5341
5364
  type: "button",
5342
5365
  class: "wm-dialog__close",
5343
- "aria-label": s.t("common.close"),
5344
- onClick: t[1] || (t[1] = (i) => e.$emit("close"))
5366
+ "aria-label": n.t("common.close"),
5367
+ onClick: t[1] || (t[1] = (r) => e.$emit("close"))
5345
5368
  }, [...t[7] || (t[7] = [
5346
5369
  o("svg", {
5347
5370
  width: "12",
@@ -5361,14 +5384,14 @@ function Ya(e, t, n, r, a, s) {
5361
5384
  o("div", $a, [
5362
5385
  G(o("input", {
5363
5386
  ref: "input",
5364
- "onUpdate:modelValue": t[2] || (t[2] = (i) => a.value = i),
5387
+ "onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
5365
5388
  type: "text",
5366
5389
  class: "wm-dialog__input",
5367
- placeholder: n.placeholder || s.t("rename.placeholder"),
5390
+ placeholder: s.placeholder || n.t("rename.placeholder"),
5368
5391
  maxlength: 120,
5369
5392
  onKeydown: [
5370
- t[3] || (t[3] = ge(J((...i) => s.onSubmit && s.onSubmit(...i), ["prevent"]), ["enter"])),
5371
- t[4] || (t[4] = ge(J((i) => e.$emit("close"), ["prevent"]), ["esc"]))
5393
+ t[3] || (t[3] = ge(J((...r) => n.onSubmit && n.onSubmit(...r), ["prevent"]), ["enter"])),
5394
+ t[4] || (t[4] = ge(J((r) => e.$emit("close"), ["prevent"]), ["esc"]))
5372
5395
  ]
5373
5396
  }, null, 40, Ka), [
5374
5397
  [te, a.value]
@@ -5378,19 +5401,19 @@ function Ya(e, t, n, r, a, s) {
5378
5401
  o("button", {
5379
5402
  type: "button",
5380
5403
  class: "wm-dialog__btn",
5381
- onClick: t[5] || (t[5] = (i) => e.$emit("close"))
5382
- }, v(s.t("common.cancel")), 1),
5404
+ onClick: t[5] || (t[5] = (r) => e.$emit("close"))
5405
+ }, v(n.t("common.cancel")), 1),
5383
5406
  o("button", {
5384
5407
  type: "button",
5385
5408
  class: "wm-dialog__btn wm-dialog__btn--primary",
5386
- disabled: !s.canSubmit,
5387
- onClick: t[6] || (t[6] = (...i) => s.onSubmit && s.onSubmit(...i))
5388
- }, v(s.t("common.save")), 9, Ga)
5409
+ disabled: !n.canSubmit,
5410
+ onClick: t[6] || (t[6] = (...r) => n.onSubmit && n.onSubmit(...r))
5411
+ }, v(n.t("common.save")), 9, Ga)
5389
5412
  ])
5390
5413
  ])
5391
5414
  ]);
5392
5415
  }
5393
- const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]), De = "ww-messenger-tokens", Xa = {
5416
+ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8"]]), Ue = "ww-messenger-tokens", Xa = {
5394
5417
  name: "Messenger",
5395
5418
  components: {
5396
5419
  Launcher: qt,
@@ -5400,7 +5423,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5400
5423
  MessageList: ri,
5401
5424
  Composer: Ci,
5402
5425
  SuggestionChips: Ti,
5403
- ApprovalCard: Di,
5426
+ ApprovalCard: Ui,
5404
5427
  FormCard: da,
5405
5428
  Feedback: Aa,
5406
5429
  MoreMenu: Na,
@@ -5419,8 +5442,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5419
5442
  provide() {
5420
5443
  return {
5421
5444
  signAttachmentFn: (e) => {
5422
- var t, n;
5423
- return ((n = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : n.call(t, e)) || null;
5445
+ var t, s;
5446
+ return ((s = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : s.call(t, e)) || null;
5424
5447
  },
5425
5448
  // Translator + resolved language, shared with every descendant
5426
5449
  // via inject. Both go through a closure over `this` so they stay
@@ -5562,9 +5585,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5562
5585
  // so the choice applies immediately, before the boot round-trip
5563
5586
  // that materializes `state.customer` has completed.
5564
5587
  customerLanguage() {
5565
- var n, r, a, s;
5566
- const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((r = e.values) == null ? void 0 : r.language));
5567
- return t || ((s = (a = this.context) == null ? void 0 : a.customer) == null ? void 0 : s.language) || "";
5588
+ var s, i, a, n;
5589
+ const e = (s = this.s) == null ? void 0 : s.customer, t = e && (e.language || ((i = e.values) == null ? void 0 : i.language));
5590
+ return t || ((n = (a = this.context) == null ? void 0 : a.customer) == null ? void 0 : n.language) || "";
5568
5591
  },
5569
5592
  // Resolved UI language, by priority:
5570
5593
  // 1. explicit `language` prop (consumer override)
@@ -5609,34 +5632,34 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5609
5632
  // the cached messages. The server exposes no preview field, so
5610
5633
  // that one stays client-derived.
5611
5634
  drawerConversations() {
5612
- var n;
5613
- const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = this.revealedAt;
5614
- return this.allConversations.map((r) => {
5635
+ var s;
5636
+ const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = this.revealedAt;
5637
+ return this.allConversations.map((i) => {
5615
5638
  var k;
5616
- const a = e[r.id] || [], s = Y(r.last_read_message_id);
5617
- let i = 0, l = null;
5639
+ const a = e[i.id] || [], n = Y(i.last_read_message_id);
5640
+ let r = 0, l = null;
5618
5641
  for (let w = a.length - 1; w >= 0; w--) {
5619
5642
  const T = a[w];
5620
5643
  if (!T) continue;
5621
5644
  if (((k = T.author) == null ? void 0 : k.type) === "user") break;
5622
5645
  const E = Y(T.id);
5623
5646
  if (E != null) {
5624
- if (s != null && E <= s) break;
5625
- t[T.id] !== 0 && (!l && T.author && (l = T.author), i++);
5647
+ if (n != null && E <= n) break;
5648
+ t[T.id] !== 0 && (!l && T.author && (l = T.author), r++);
5626
5649
  }
5627
5650
  }
5628
5651
  if (!a.length) {
5629
- const w = Y(r.last_message_id);
5630
- w != null && (s == null || w > s) && (i = 1, l = r.last_message_author || null);
5652
+ const w = Y(i.last_message_id);
5653
+ w != null && (n == null || w > n) && (r = 1, l = i.last_message_author || null);
5631
5654
  }
5632
5655
  const _ = a.filter(
5633
5656
  (w) => !((w == null ? void 0 : w.id) != null && t[w.id] === 0)
5634
5657
  );
5635
5658
  return {
5636
- ...r,
5637
- _preview: _t(r, _),
5638
- _unread: i > 0,
5639
- _unreadCount: i,
5659
+ ...i,
5660
+ _preview: _t(i, _),
5661
+ _unread: r > 0,
5662
+ _unreadCount: r,
5640
5663
  _lastAuthor: l
5641
5664
  };
5642
5665
  });
@@ -5652,35 +5675,35 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5652
5675
  openThreads() {
5653
5676
  var t;
5654
5677
  const e = ((t = this.s) == null ? void 0 : t.messagesByConv) || {};
5655
- return this.drawerConversations.filter((n) => n.status !== "resolved").map((n) => ({
5656
- id: n.id,
5657
- title: n.name || this.t("common.newConversation"),
5658
- preview: n._preview || this.t("onboarding.newMessage"),
5659
- unread: !!n._unread,
5660
- author: n._lastAuthor || null,
5661
- _ts: Be(n, e[n.id] || [])
5662
- })).sort((n, r) => n._ts < r._ts ? 1 : n._ts > r._ts ? -1 : 0);
5678
+ return this.drawerConversations.filter((s) => s.status !== "resolved").map((s) => ({
5679
+ id: s.id,
5680
+ title: s.name || this.t("common.newConversation"),
5681
+ preview: s._preview || this.t("onboarding.newMessage"),
5682
+ unread: !!s._unread,
5683
+ author: s._lastAuthor || null,
5684
+ _ts: Be(s, e[s.id] || [])
5685
+ })).sort((s, i) => s._ts < i._ts ? 1 : s._ts > i._ts ? -1 : 0);
5663
5686
  },
5664
5687
  // Unread threads (one entry per conv with unseen agent/human
5665
5688
  // activity), freshest first. Each entry carries everything the
5666
5689
  // closed-launcher notification card needs: sender identity,
5667
5690
  // preview, and the count of unseen messages in that thread.
5668
5691
  latestUnreads() {
5669
- var n;
5670
- const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
5671
- for (const r of this.drawerConversations) {
5672
- if (!r._unread) continue;
5673
- const a = Be(r, e[r.id] || []), s = r._lastAuthor, i = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (i ? this.agentName : "") || "", _ = (s == null ? void 0 : s.avatar_url) || (i ? this.agentAvatarUrl : null);
5692
+ var s;
5693
+ const e = ((s = this.s) == null ? void 0 : s.messagesByConv) || {}, t = [];
5694
+ for (const i of this.drawerConversations) {
5695
+ if (!i._unread) continue;
5696
+ const a = Be(i, e[i.id] || []), n = i._lastAuthor, r = !n || n.type === "agent_ia", l = (n == null ? void 0 : n.name) || (r ? this.agentName : "") || "", _ = (n == null ? void 0 : n.avatar_url) || (r ? this.agentAvatarUrl : null);
5674
5697
  t.push({
5675
- convId: r.id,
5676
- preview: r._preview || this.t("notification.youHaveNewMessage"),
5698
+ convId: i.id,
5699
+ preview: i._preview || this.t("notification.youHaveNewMessage"),
5677
5700
  ts: a,
5678
- count: r._unreadCount || 1,
5701
+ count: i._unreadCount || 1,
5679
5702
  senderName: l,
5680
5703
  senderAvatarUrl: _
5681
5704
  });
5682
5705
  }
5683
- return t.sort((r, a) => r.ts < a.ts ? 1 : r.ts > a.ts ? -1 : 0), t;
5706
+ return t.sort((i, a) => i.ts < a.ts ? 1 : i.ts > a.ts ? -1 : 0), t;
5684
5707
  },
5685
5708
  // Notification cards shown in the closed-launcher stack: the unread
5686
5709
  // threads above, minus any the user has dismissed (×) for their
@@ -5704,7 +5727,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5704
5727
  const e = this.allConversations;
5705
5728
  if (!e.length) return null;
5706
5729
  if (this.activeConvId != null) {
5707
- const t = e.find((n) => n.id === this.activeConvId);
5730
+ const t = e.find((s) => s.id === this.activeConvId);
5708
5731
  if (t) return t;
5709
5732
  }
5710
5733
  return e[0] || null;
@@ -5713,18 +5736,18 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5713
5736
  return !!this.currentConv || this.showHistory;
5714
5737
  },
5715
5738
  statusUrl() {
5716
- var n;
5717
- const e = (n = this.widget) == null ? void 0 : n.quick_links;
5739
+ var s;
5740
+ const e = (s = this.widget) == null ? void 0 : s.quick_links;
5718
5741
  if (!Array.isArray(e)) return "";
5719
- const t = e.find((r) => r.icon === "status" && r.url);
5742
+ const t = e.find((i) => i.icon === "status" && i.url);
5720
5743
  return (t == null ? void 0 : t.url) || "";
5721
5744
  },
5722
5745
  helpUrl() {
5723
- var n;
5724
- const e = (n = this.widget) == null ? void 0 : n.quick_links;
5746
+ var s;
5747
+ const e = (s = this.widget) == null ? void 0 : s.quick_links;
5725
5748
  if (!Array.isArray(e)) return "";
5726
5749
  const t = e.find(
5727
- (r) => (r.icon === "chat" || r.icon === "help") && r.url
5750
+ (i) => (i.icon === "chat" || i.icon === "help") && i.url
5728
5751
  );
5729
5752
  return (t == null ? void 0 : t.url) || "";
5730
5753
  },
@@ -5767,12 +5790,12 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5767
5790
  return ((e = this.widget) == null ? void 0 : e.default_icon_url) || null;
5768
5791
  },
5769
5792
  agentName() {
5770
- var e, t, n;
5771
- return ((n = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : n.name) || "";
5793
+ var e, t, s;
5794
+ return ((s = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : s.name) || "";
5772
5795
  },
5773
5796
  agentAvatarUrl() {
5774
- var e, t, n;
5775
- return ((n = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : n.avatar_url) || null;
5797
+ var e, t, s;
5798
+ return ((s = (t = (e = this.s) == null ? void 0 : e.config) == null ? void 0 : t.agent) == null ? void 0 : s.avatar_url) || null;
5776
5799
  },
5777
5800
  quickLinks() {
5778
5801
  var t;
@@ -5791,11 +5814,11 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5791
5814
  // Last message from a human agent in the current conversation —
5792
5815
  // used to surface the human agent's name + avatar in the header.
5793
5816
  humanMessageAuthor() {
5794
- var t, n, r;
5817
+ var t, s, i;
5795
5818
  if (!this.currentConv) return null;
5796
5819
  const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
5797
5820
  for (let a = e.length - 1; a >= 0; a--)
5798
- if (((r = (n = e[a]) == null ? void 0 : n.author) == null ? void 0 : r.type) === "agent_human")
5821
+ if (((i = (s = e[a]) == null ? void 0 : s.author) == null ? void 0 : i.type) === "agent_human")
5799
5822
  return e[a].author;
5800
5823
  return null;
5801
5824
  },
@@ -5828,37 +5851,37 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5828
5851
  }) : this.isWaitingHuman ? this.t("composer.agentTakingOver") : this.t("composer.placeholder");
5829
5852
  },
5830
5853
  displayedMessages() {
5831
- var a, s;
5854
+ var a, n;
5832
5855
  const e = this.currentConv;
5833
5856
  if (!e) return [];
5834
5857
  const t = this.welcomeRevealedAt[e.id] > 0 ? this.buildWelcomePrefix(e) : [];
5835
5858
  if (!e._draft) {
5836
- const i = (s = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : s[e.id];
5837
- if (!(i != null && i.loaded)) return t;
5859
+ const r = (n = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : n[e.id];
5860
+ if (!(r != null && r.loaded)) return t;
5838
5861
  }
5839
- const n = this.revealedAt, r = (this.s.messagesByConv[e.id] || []).filter((i) => {
5862
+ const s = this.revealedAt, i = (this.s.messagesByConv[e.id] || []).filter((r) => {
5840
5863
  var l, _, k, w, T;
5841
- return (i == null ? void 0 : i.type) === "action" && ((l = i == null ? void 0 : i.payload) == null ? void 0 : l.state) === "pending" || he(i) && !(n[i.id] > 0) ? !1 : (i == null ? void 0 : i.type) === "action" || (i == null ? void 0 : i.type) === "system" || ((_ = i == null ? void 0 : i.payload) == null ? void 0 : _.type) === "system" || Array.isArray((k = i == null ? void 0 : i.payload) == null ? void 0 : k.attachments) && i.payload.attachments.length || (w = i == null ? void 0 : i.metadata) != null && w.artifact || (T = i == null ? void 0 : i.metadata) != null && T.form ? !0 : typeof (i == null ? void 0 : i.text_md) == "string" && i.text_md.trim().length > 0;
5864
+ return (r == null ? void 0 : r.type) === "action" && ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.state) === "pending" || he(r) && !(s[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((_ = r == null ? void 0 : r.payload) == null ? void 0 : _.type) === "system" || Array.isArray((k = r == null ? void 0 : r.payload) == null ? void 0 : k.attachments) && r.payload.attachments.length || (w = r == null ? void 0 : r.metadata) != null && w.artifact || (T = r == null ? void 0 : r.metadata) != null && T.form ? !0 : typeof (r == null ? void 0 : r.text_md) == "string" && r.text_md.trim().length > 0;
5842
5865
  });
5843
- return t.length ? [...t, ...r] : r;
5866
+ return t.length ? [...t, ...i] : i;
5844
5867
  },
5845
5868
  // True whenever we should show the "typing" indicator at the bottom
5846
5869
  // of the list: either the LLM is actively streaming tokens, or one
5847
5870
  // or more agent messages are queued and waiting for their reveal
5848
5871
  // slot to fire.
5849
5872
  streamingActive() {
5850
- var n, r, a;
5873
+ var s, i, a;
5851
5874
  const e = this.currentConv;
5852
- return e ? Object.keys(((n = this.s) == null ? void 0 : n.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : this.widgetWelcomeMessage && this.welcomeRevealedAt[e.id] === 0 ? !0 : (((a = (r = this.s) == null ? void 0 : r.messagesByConv) == null ? void 0 : a[e.id]) || []).some(
5853
- (s) => he(s) && !(this.revealedAt[s.id] > 0)
5875
+ return e ? Object.keys(((s = this.s) == null ? void 0 : s.streamingByMsgId) || {}).length > 0 ? !0 : this.actionInFlight ? !1 : this.widgetWelcomeMessage && this.welcomeRevealedAt[e.id] === 0 ? !0 : (((a = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : a[e.id]) || []).some(
5876
+ (n) => he(n) && !(this.revealedAt[n.id] > 0)
5854
5877
  ) : !1;
5855
5878
  },
5856
5879
  // Internal: the raw persisted list for the current conversation. We
5857
5880
  // watch this to detect new agent messages that need to be paced.
5858
5881
  currentConvMessages() {
5859
- var t, n, r;
5882
+ var t, s, i;
5860
5883
  const e = (t = this.currentConv) == null ? void 0 : t.id;
5861
- return e ? ((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e]) || [] : [];
5884
+ return e ? ((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e]) || [] : [];
5862
5885
  },
5863
5886
  pendingApproval() {
5864
5887
  return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
@@ -5871,18 +5894,18 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5871
5894
  return this.pendingApproval ? this.pendingApproval.id === this.approvalLatchId ? !0 : !(this.streamingActive || !this.approvalSettled) : !1;
5872
5895
  },
5873
5896
  approvalTitle() {
5874
- var e, t, n;
5875
- return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((n = this.pendingApproval) == null ? void 0 : n.text_md) || this.t("action.title");
5897
+ var e, t, s;
5898
+ return ((t = (e = this.pendingApproval) == null ? void 0 : e.payload) == null ? void 0 : t.name) || ((s = this.pendingApproval) == null ? void 0 : s.text_md) || this.t("action.title");
5876
5899
  },
5877
5900
  approvalDetail() {
5878
- var r, a, s, i, l, _;
5879
- const e = (s = (a = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : a.pending) == null ? void 0 : s.user_explanation;
5901
+ var i, a, n, r, l, _;
5902
+ const e = (n = (a = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : a.pending) == null ? void 0 : n.user_explanation;
5880
5903
  if (typeof e == "string" && e.trim())
5881
5904
  return e.trim();
5882
- const t = (_ = (l = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : l.pending) == null ? void 0 : _.prepared_params;
5905
+ const t = (_ = (l = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : l.pending) == null ? void 0 : _.prepared_params;
5883
5906
  if (!t || typeof t != "object") return "";
5884
- const n = Object.entries(t);
5885
- return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
5907
+ const s = Object.entries(t);
5908
+ return s.length ? s.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
5886
5909
  },
5887
5910
  actionInFlight() {
5888
5911
  var e, t;
@@ -5902,9 +5925,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5902
5925
  // welcome bubble is client-side only and intentionally not
5903
5926
  // counted here.
5904
5927
  conversationIsEmpty() {
5905
- var n, r;
5928
+ var s, i;
5906
5929
  const e = this.currentConv;
5907
- return e ? e._draft ? !0 : (((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e.id]) || []).length === 0 : !1;
5930
+ return e ? e._draft ? !0 : (((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e.id]) || []).length === 0 : !1;
5908
5931
  },
5909
5932
  // Maps `widget.starter_prompts` ({ title, message }) into the
5910
5933
  // SuggestionChips shape so they render alongside / in place of
@@ -5913,18 +5936,18 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5913
5936
  // the user-visible `title` used as a defensive fallback when
5914
5937
  // a malformed entry is missing `message`.
5915
5938
  starterPrompts() {
5916
- var n;
5917
- const e = (n = this.widget) == null ? void 0 : n.starter_prompts;
5939
+ var s;
5940
+ const e = (s = this.widget) == null ? void 0 : s.starter_prompts;
5918
5941
  if (!Array.isArray(e)) return [];
5919
5942
  const t = [];
5920
- for (const r of e) {
5921
- if (!r || typeof r != "object") continue;
5922
- const a = typeof r.title == "string" ? r.title.trim() : "";
5943
+ for (const i of e) {
5944
+ if (!i || typeof i != "object") continue;
5945
+ const a = typeof i.title == "string" ? i.title.trim() : "";
5923
5946
  if (!a) continue;
5924
- const s = typeof r.message == "string" ? r.message.trim() : "";
5947
+ const n = typeof i.message == "string" ? i.message.trim() : "";
5925
5948
  t.push({
5926
5949
  label: a,
5927
- text: s || a,
5950
+ text: n || a,
5928
5951
  kind: "starter"
5929
5952
  });
5930
5953
  }
@@ -5948,13 +5971,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5948
5971
  return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
5949
5972
  },
5950
5973
  dateLabel() {
5951
- var n, r, a;
5974
+ var s, i, a;
5952
5975
  const e = this.currentConv;
5953
5976
  let t = /* @__PURE__ */ new Date();
5954
5977
  if (e) {
5955
- const i = ((a = (((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : a.created_at) || e.created_at;
5956
- if (i) {
5957
- const l = new Date(i);
5978
+ const r = ((a = (((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e.id]) || []).find((l) => l == null ? void 0 : l.created_at)) == null ? void 0 : a.created_at) || e.created_at;
5979
+ if (r) {
5980
+ const l = new Date(r);
5958
5981
  Number.isNaN(l.getTime()) || (t = l);
5959
5982
  }
5960
5983
  }
@@ -5967,8 +5990,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5967
5990
  // history available, nothing loading) so the loader stays inert
5968
5991
  // until `openConversation` has populated the entry.
5969
5992
  paginationState() {
5970
- var n, r, a;
5971
- const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (a = (r = this.s) == null ? void 0 : r.paginationByConv) == null ? void 0 : a[e] : null;
5993
+ var s, i, a;
5994
+ const e = (s = this.currentConv) == null ? void 0 : s.id, t = e ? (a = (i = this.s) == null ? void 0 : i.paginationByConv) == null ? void 0 : a[e] : null;
5972
5995
  return {
5973
5996
  loading: !!(t != null && t.loading),
5974
5997
  hasMore: !!(t != null && t.nextCursor)
@@ -5983,13 +6006,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
5983
6006
  // ts comparison in `launcherPeeks`.
5984
6007
  latestUnreads: {
5985
6008
  handler(e) {
5986
- const t = new Set(e.map((i) => i.convId)), n = this.dismissedPeeks || {}, r = Object.keys(n);
5987
- if (!r.length) return;
6009
+ const t = new Set(e.map((r) => r.convId)), s = this.dismissedPeeks || {}, i = Object.keys(s);
6010
+ if (!i.length) return;
5988
6011
  const a = {};
5989
- let s = !1;
5990
- for (const i of r)
5991
- t.has(i) ? a[i] = n[i] : s = !0;
5992
- s && (this.dismissedPeeks = a);
6012
+ let n = !1;
6013
+ for (const r of i)
6014
+ t.has(r) ? a[r] = s[r] : n = !0;
6015
+ n && (this.dismissedPeeks = a);
5993
6016
  },
5994
6017
  deep: !0
5995
6018
  },
@@ -6010,9 +6033,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6010
6033
  // markConvRead will immediately push it forward as the messages
6011
6034
  // render.
6012
6035
  isViewingThread(e, t) {
6013
- var n;
6036
+ var s;
6014
6037
  e && !t ? (this.unreadAnchorId = Y(
6015
- (n = this.currentConv) == null ? void 0 : n.last_read_message_id
6038
+ (s = this.currentConv) == null ? void 0 : s.last_read_message_id
6016
6039
  ), this.unreadBoundaryTs = (/* @__PURE__ */ new Date()).toISOString()) : e || (this.unreadAnchorId = null, this.unreadBoundaryTs = "");
6017
6040
  },
6018
6041
  // Fresh `pendingApproval` arrival : kick off the settle debounce so
@@ -6023,8 +6046,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6023
6046
  pendingApproval: {
6024
6047
  handler(e, t) {
6025
6048
  if (e && !t) {
6026
- const n = e != null && e.created_at ? Date.parse(e.created_at) : NaN;
6027
- if (!(Number.isFinite(n) && n >= this.convOpenedAt)) {
6049
+ const s = e != null && e.created_at ? Date.parse(e.created_at) : NaN;
6050
+ if (!(Number.isFinite(s) && s >= this.convOpenedAt)) {
6028
6051
  this.resetApprovalPacing();
6029
6052
  return;
6030
6053
  }
@@ -6064,9 +6087,9 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6064
6087
  }
6065
6088
  },
6066
6089
  async mounted() {
6067
- if (typeof document < "u" && !document.getElementById(De)) {
6090
+ if (typeof document < "u" && !document.getElementById(Ue)) {
6068
6091
  const e = document.createElement("style");
6069
- e.id = De, e.textContent = rt, document.head.appendChild(e);
6092
+ e.id = Ue, e.textContent = rt, document.head.appendChild(e);
6070
6093
  }
6071
6094
  this._parentMessageHandler = this.onParentMessage.bind(this), window.addEventListener("message", this._parentMessageHandler), window.parent && window.parent !== window && window.parent.postMessage({ type: "READY" }, "*"), this.isEmbedded ? (await this.boot(), this.store && await this.open()) : (await this.$nextTick(), this.sendCurrentLauncherSize(), this.observeLauncherSize());
6072
6095
  },
@@ -6098,12 +6121,12 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6098
6121
  // par le browser via `event.origin`, non-spoofable), le token linked
6099
6122
  // optionnel, et relaie les pushes `UPDATE` / `CONTEXT` post-init.
6100
6123
  onParentMessage(e) {
6101
- var n;
6124
+ var s;
6102
6125
  const t = e == null ? void 0 : e.data;
6103
6126
  if (!(!t || typeof t != "object")) {
6104
6127
  if (t.type === "UPDATE") {
6105
- this.transport && t.payload && this.transport.update(t.payload).catch((r) => {
6106
- console.warn("[messenger] update failed", r);
6128
+ this.transport && t.payload && this.transport.update(t.payload).catch((i) => {
6129
+ console.warn("[messenger] update failed", i);
6107
6130
  });
6108
6131
  return;
6109
6132
  }
@@ -6111,8 +6134,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6111
6134
  this.transport && t.payload && this.transport.context(t.payload);
6112
6135
  return;
6113
6136
  }
6114
- t.type === "INIT" && (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentVariables = t.variables && typeof t.variables == "object" ? t.variables : t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (n = this.parentInitDeferred) != null && n._resolve && this.parentInitDeferred._resolve(), !this.isEmbedded && !this.isOpen && !this.parentAllowUnauthenticated && this.parentToken && this.hasValidSessionMarker() && this.boot().catch((r) => {
6115
- console.warn("[messenger] eager boot failed", r);
6137
+ t.type === "INIT" && (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentVariables = t.variables && typeof t.variables == "object" ? t.variables : t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (s = this.parentInitDeferred) != null && s._resolve && this.parentInitDeferred._resolve(), !this.isEmbedded && !this.isOpen && !this.parentAllowUnauthenticated && this.parentToken && this.hasValidSessionMarker() && this.boot().catch((i) => {
6138
+ console.warn("[messenger] eager boot failed", i);
6116
6139
  }));
6117
6140
  }
6118
6141
  },
@@ -6123,8 +6146,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6123
6146
  if (typeof document > "u") return !1;
6124
6147
  const t = (document.cookie || "").match(/(?:^|; )messenger_session_marker=([^;]+)/);
6125
6148
  if (!t) return !1;
6126
- const n = parseInt(t[1], 10);
6127
- return Number.isFinite(n) ? n > Date.now() : !1;
6149
+ const s = parseInt(t[1], 10);
6150
+ return Number.isFinite(s) ? s > Date.now() : !1;
6128
6151
  },
6129
6152
  async boot() {
6130
6153
  if (!this.canBoot) {
@@ -6146,8 +6169,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6146
6169
  variables: e && typeof e == "object" ? e : void 0
6147
6170
  }), e && typeof e == "object") {
6148
6171
  const t = {};
6149
- for (const [n, r] of Object.entries(e))
6150
- n !== "customer" && r && typeof r == "object" && !Array.isArray(r) && (t[n] = r);
6172
+ for (const [s, i] of Object.entries(e))
6173
+ s !== "customer" && i && typeof i == "object" && !Array.isArray(i) && (t[s] = i);
6151
6174
  Object.keys(t).length > 0 && this.transport.context(t);
6152
6175
  }
6153
6176
  this.setupLiveReveal();
@@ -6172,13 +6195,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6172
6195
  );
6173
6196
  return;
6174
6197
  }
6175
- this.floatRO = new ResizeObserver((n) => {
6176
- const r = n[0];
6177
- if (!r) return;
6178
- const a = Math.ceil(r.contentRect.height + 8);
6198
+ this.floatRO = new ResizeObserver((s) => {
6199
+ const i = s[0];
6200
+ if (!i) return;
6201
+ const a = Math.ceil(i.contentRect.height + 8);
6179
6202
  a !== this.floatHeight && (this.floatHeight = a, this.$nextTick(() => {
6180
- var s, i;
6181
- (i = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || i.call(s);
6203
+ var n, r;
6204
+ (r = (n = this.$refs.messageList) == null ? void 0 : n.scrollToBottom) == null || r.call(n);
6182
6205
  }));
6183
6206
  }), this.floatRO.observe(t);
6184
6207
  }
@@ -6221,8 +6244,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6221
6244
  },
6222
6245
  "*"
6223
6246
  );
6224
- } catch (n) {
6225
- console.warn("[ww-messenger] notifyParentResize failed", n);
6247
+ } catch (s) {
6248
+ console.warn("[ww-messenger] notifyParentResize failed", s);
6226
6249
  }
6227
6250
  },
6228
6251
  // Mesure la taille rendue du wm-launcherWrap (launcher + peeks éventuels)
@@ -6232,13 +6255,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6232
6255
  this.launcherHovered = e, this.sendCurrentLauncherSize();
6233
6256
  },
6234
6257
  sendCurrentLauncherSize() {
6235
- var w, T, E, A, q, M, D;
6258
+ var w, T, E, A, q, M, U;
6236
6259
  if (this.isOpen) return;
6237
6260
  const e = (T = (w = this.$el) == null ? void 0 : w.querySelector) == null ? void 0 : T.call(w, ".wm-launcherWrap");
6238
6261
  if (!e) return;
6239
6262
  const t = e.getBoundingClientRect();
6240
6263
  if (!t.width || !t.height) return;
6241
- const n = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, r = 16, a = Math.ceil(t.width), s = Math.ceil(t.height), i = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (D = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : D.call(M, ".wm-peek"), _ = l && l.length ? l[l.length - 1] : null;
6264
+ const s = (((E = this.launcherPeeks) == null ? void 0 : E.length) ?? 0) > 0, i = 16, a = Math.ceil(t.width), n = Math.ceil(t.height), r = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (U = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : U.call(M, ".wm-peek"), _ = l && l.length ? l[l.length - 1] : null;
6242
6265
  let k = null;
6243
6266
  if (_) {
6244
6267
  const N = _.getBoundingClientRect();
@@ -6250,19 +6273,19 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6250
6273
  };
6251
6274
  }
6252
6275
  this.notifyParentResize("closed", {
6253
- width: a + r,
6254
- height: s + r,
6255
- launcherWidth: (i == null ? void 0 : i.offsetWidth) || null,
6256
- launcherHeight: (i == null ? void 0 : i.offsetHeight) || null,
6276
+ width: a + i,
6277
+ height: n + i,
6278
+ launcherWidth: (r == null ? void 0 : r.offsetWidth) || null,
6279
+ launcherHeight: (r == null ? void 0 : r.offsetHeight) || null,
6257
6280
  launcherHovered: this.launcherHovered,
6258
6281
  peek: k,
6259
- peekHovered: this.launcherHovered && n
6282
+ peekHovered: this.launcherHovered && s
6260
6283
  });
6261
6284
  },
6262
6285
  observeLauncherSize() {
6263
- var n, r;
6286
+ var s, i;
6264
6287
  if (typeof ResizeObserver > "u") return;
6265
- const e = (r = (n = this.$el) == null ? void 0 : n.querySelector) == null ? void 0 : r.call(n, ".wm-launcherWrap");
6288
+ const e = (i = (s = this.$el) == null ? void 0 : s.querySelector) == null ? void 0 : i.call(s, ".wm-launcherWrap");
6266
6289
  if (!e) return;
6267
6290
  this._launcherRo && this._launcherRo.disconnect();
6268
6291
  const t = new ResizeObserver(() => {
@@ -6273,14 +6296,14 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6273
6296
  // Opening straight from a notification card: land on that card's
6274
6297
  // thread rather than whatever was last active.
6275
6298
  async openFromPeek(e) {
6276
- var n, r;
6277
- const t = e || ((n = this.latestUnreads[0]) == null ? void 0 : n.convId);
6278
- t && t !== ((r = this.currentConv) == null ? void 0 : r.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = !1), await this.open();
6299
+ var s, i;
6300
+ const t = e || ((s = this.latestUnreads[0]) == null ? void 0 : s.convId);
6301
+ t && t !== ((i = this.currentConv) == null ? void 0 : i.id) && (this.draftConv = null, this.activeConvId = t, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = !1), await this.open();
6279
6302
  },
6280
6303
  // Stamp the dismissed batch ts for a single conv so its card
6281
6304
  // disappears from the stack until a fresher message arrives.
6282
6305
  dismissPeek(e) {
6283
- const t = this.latestUnreads.find((n) => n.convId === e);
6306
+ const t = this.latestUnreads.find((s) => s.convId === e);
6284
6307
  t && (this.dismissedPeeks = { ...this.dismissedPeeks, [e]: t.ts });
6285
6308
  },
6286
6309
  // Enter "draft" mode : the composer is rendered immediately but no
@@ -6306,10 +6329,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6306
6329
  if (this.busy) return null;
6307
6330
  this.busy = !0;
6308
6331
  try {
6309
- const t = await this.store.createConversation({}), n = this.welcomeRevealedAt.__draft__;
6310
- return n !== void 0 && (this.welcomeRevealedAt = {
6332
+ const t = await this.store.createConversation({}), s = this.welcomeRevealedAt.__draft__;
6333
+ return s !== void 0 && (this.welcomeRevealedAt = {
6311
6334
  ...this.welcomeRevealedAt,
6312
- [t.id]: n > 0 ? n : Date.now()
6335
+ [t.id]: s > 0 ? s : Date.now()
6313
6336
  }), this.draftConv = null, this.activeConvId = t.id, await this.store.openConversation(t.id), this.markConvRead(t), t;
6314
6337
  } catch (t) {
6315
6338
  return console.error("[ww-messenger] create conv failed", t), this.bootError = (t == null ? void 0 : t.message) || String(t), null;
@@ -6363,8 +6386,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6363
6386
  if (!e) return;
6364
6387
  const t = this.widgetWelcomeMessage;
6365
6388
  if (!t || typeof t != "string" || !t.trim() || this.welcomeRevealedAt[e] !== void 0) return;
6366
- const n = this.currentConv;
6367
- if (!((n == null ? void 0 : n._draft) || !(n != null && n.last_message_id))) {
6389
+ const s = this.currentConv;
6390
+ if (!((s == null ? void 0 : s._draft) || !(s != null && s.last_message_id))) {
6368
6391
  this.welcomeRevealedAt = {
6369
6392
  ...this.welcomeRevealedAt,
6370
6393
  [e]: Date.now()
@@ -6375,10 +6398,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6375
6398
  ...this.welcomeRevealedAt,
6376
6399
  [e]: 0
6377
6400
  };
6378
- const a = this.revealPacing, s = t.trim().length, i = Math.min(
6401
+ const a = this.revealPacing, n = t.trim().length, r = Math.min(
6379
6402
  a.maxTypingMs,
6380
- Math.max(a.minTypingMs, s * a.msPerChar)
6381
- ), l = a.firstRevealDelayMs + i, _ = setTimeout(() => {
6403
+ Math.max(a.minTypingMs, n * a.msPerChar)
6404
+ ), l = a.firstRevealDelayMs + r, _ = setTimeout(() => {
6382
6405
  this.welcomeRevealedAt = {
6383
6406
  ...this.welcomeRevealedAt,
6384
6407
  [e]: Date.now()
@@ -6415,14 +6438,14 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6415
6438
  this.draftConv = null, this.activeConvId = e.id, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = t;
6416
6439
  try {
6417
6440
  await this.store.openConversation(e.id);
6418
- } catch (r) {
6419
- console.error("[ww-messenger] open conv failed", r);
6441
+ } catch (i) {
6442
+ console.error("[ww-messenger] open conv failed", i);
6420
6443
  }
6421
- const n = this.allConversations.find((r) => r.id === e.id);
6422
- n && this.markConvRead(n);
6444
+ const s = this.allConversations.find((i) => i.id === e.id);
6445
+ s && this.markConvRead(s);
6423
6446
  },
6424
6447
  async onMoreAction(e) {
6425
- var t, n;
6448
+ var t, s;
6426
6449
  switch (this.moreOpen = !1, e) {
6427
6450
  case "rename":
6428
6451
  this.openRenameDialog();
@@ -6430,7 +6453,7 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6430
6453
  case "export":
6431
6454
  vt(
6432
6455
  this.currentConv,
6433
- this.currentConv ? (n = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : n[this.currentConv.id] : [],
6456
+ this.currentConv ? (s = (t = this.s) == null ? void 0 : t.messagesByConv) == null ? void 0 : s[this.currentConv.id] : [],
6434
6457
  this.translator,
6435
6458
  this.locale
6436
6459
  );
@@ -6458,12 +6481,12 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6458
6481
  async onRenameSubmit(e) {
6459
6482
  const t = this.currentConv;
6460
6483
  if (this.renameDialogOpen = !1, !t || t._draft || !this.store) return;
6461
- const n = (e || "").trim();
6462
- if (!(!n || n === t.name))
6484
+ const s = (e || "").trim();
6485
+ if (!(!s || s === t.name))
6463
6486
  try {
6464
- await this.store.patchConversation(t.id, { name: n });
6465
- } catch (r) {
6466
- console.error("[ww-messenger] rename failed", r);
6487
+ await this.store.patchConversation(t.id, { name: s });
6488
+ } catch (i) {
6489
+ console.error("[ww-messenger] rename failed", i);
6467
6490
  }
6468
6491
  },
6469
6492
  // ── Send / suggestion / form / attach / feedback ────────────────
@@ -6471,13 +6494,13 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6471
6494
  let t = this.currentConv;
6472
6495
  if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
6473
6496
  return;
6474
- const n = t.id, r = this.pendingAttachments.slice();
6497
+ const s = t.id, i = this.pendingAttachments.slice();
6475
6498
  this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "";
6476
- const a = r.map((s) => {
6477
- const { previewUrl: i, ...l } = s;
6499
+ const a = i.map((n) => {
6500
+ const { previewUrl: r, ...l } = n;
6478
6501
  return l;
6479
6502
  });
6480
- await this.store.send(n, e, {
6503
+ await this.store.send(s, e, {
6481
6504
  attachments: a.length ? a : void 0
6482
6505
  });
6483
6506
  },
@@ -6497,10 +6520,10 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6497
6520
  async onFormSubmit({ values: e }) {
6498
6521
  const t = this.pendingForm;
6499
6522
  if (!(t != null && t.form)) return;
6500
- const n = ht(t.form, e, this.translator);
6501
- if (!n) return;
6502
- let r = this.currentConv;
6503
- r && (r._draft && (r = await this.ensureRealConv(), !r) || await this.store.send(r.id, n, {
6523
+ const s = ht(t.form, e, this.translator);
6524
+ if (!s) return;
6525
+ let i = this.currentConv;
6526
+ i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, s, {
6504
6527
  metadata: {
6505
6528
  artifact: mt(
6506
6529
  t.form,
@@ -6525,26 +6548,26 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6525
6548
  this.pendingAttachments.splice(e, 1);
6526
6549
  },
6527
6550
  async onAttach(e) {
6528
- var t, n;
6551
+ var t, s;
6529
6552
  if (!(!e || !this.transport))
6530
6553
  try {
6531
- const r = await this.transport.uploadAttachment(e), a = (r == null ? void 0 : r.type) === "image" || (e.type || "").toLowerCase().startsWith("image/") || ((r == null ? void 0 : r.mime_type) || "").toLowerCase().startsWith("image/");
6532
- let s = null;
6554
+ const i = await this.transport.uploadAttachment(e), a = (i == null ? void 0 : i.type) === "image" || (e.type || "").toLowerCase().startsWith("image/") || ((i == null ? void 0 : i.mime_type) || "").toLowerCase().startsWith("image/");
6555
+ let n = null;
6533
6556
  if (a)
6534
6557
  try {
6535
- s = await ((n = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : n.call(t, r.path)) || null;
6558
+ n = await ((s = (t = this.store) == null ? void 0 : t.signAttachment) == null ? void 0 : s.call(t, i.path)) || null;
6536
6559
  } catch {
6537
6560
  }
6538
6561
  this.pendingAttachments.push({
6539
- type: r.type || "file",
6540
- path: r.path,
6562
+ type: i.type || "file",
6563
+ path: i.path,
6541
6564
  name: e.name || this.t("attachment.fileFallbackName"),
6542
6565
  mime_type: e.type,
6543
6566
  size_bytes: e.size,
6544
- previewUrl: s
6567
+ previewUrl: n
6545
6568
  });
6546
- } catch (r) {
6547
- console.error("[ww-messenger] attachment upload failed", r);
6569
+ } catch (i) {
6570
+ console.error("[ww-messenger] attachment upload failed", i);
6548
6571
  }
6549
6572
  },
6550
6573
  // Délégation des clics sur les liens `<a href="#...">` rendus dans le
@@ -6566,8 +6589,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6566
6589
  if (t === "new" || t === "new-conversation")
6567
6590
  return this.isOpen || await this.open(), this.startConv(), !0;
6568
6591
  if (t.startsWith("conversation/")) {
6569
- const n = t.slice(13);
6570
- return n && await this.openFromPeek(n), !0;
6592
+ const s = t.slice(13);
6593
+ return s && await this.openFromPeek(s), !0;
6571
6594
  }
6572
6595
  return console.warn("[messenger] unknown internal url", e), !0;
6573
6596
  },
@@ -6599,8 +6622,8 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6599
6622
  rating: e,
6600
6623
  comment: t
6601
6624
  }), this.feedbackDone = !0;
6602
- } catch (n) {
6603
- console.error("[ww-messenger] feedback failed", n);
6625
+ } catch (s) {
6626
+ console.error("[ww-messenger] feedback failed", s);
6604
6627
  } finally {
6605
6628
  this.feedbackBusy = !1;
6606
6629
  }
@@ -6634,39 +6657,39 @@ const Ja = /* @__PURE__ */ P(Fa, [["render", Ya], ["__scopeId", "data-v-6d5f94a8
6634
6657
  key: 0,
6635
6658
  class: "wm-attached__fileSize"
6636
6659
  }, _o = ["aria-label", "onClick"];
6637
- function go(e, t, n, r, a, s) {
6638
- const i = B("Launcher"), l = B("Header"), _ = B("History"), k = B("Onboarding"), w = B("MessageList"), T = B("ApprovalCard"), E = B("FormCard"), A = B("Feedback"), q = B("SuggestionChips"), M = B("Composer"), D = B("MoreMenu"), N = B("RenameDialog");
6660
+ function go(e, t, s, i, a, n) {
6661
+ const r = B("Launcher"), l = B("Header"), _ = B("History"), k = B("Onboarding"), w = B("MessageList"), T = B("ApprovalCard"), E = B("FormCard"), A = B("Feedback"), q = B("SuggestionChips"), M = B("Composer"), U = B("MoreMenu"), N = B("RenameDialog");
6639
6662
  return c(), d("div", {
6640
- class: R(["wm-root", `wm-root--${n.displayMode}`]),
6641
- style: z(s.rootStyle)
6663
+ class: R(["wm-root", `wm-root--${s.displayMode}`]),
6664
+ style: z(n.rootStyle)
6642
6665
  }, [
6643
- !a.isOpen && !s.isEmbedded ? (c(), U(i, {
6666
+ !a.isOpen && !n.isEmbedded ? (c(), D(r, {
6644
6667
  key: 0,
6645
- "unread-count": s.unreadCount,
6646
- peeks: s.launcherPeeks,
6647
- onOpen: s.openFromPeek,
6648
- onDismiss: s.dismissPeek,
6649
- onHover: s.onLauncherHover
6668
+ "unread-count": n.unreadCount,
6669
+ peeks: n.launcherPeeks,
6670
+ onOpen: n.openFromPeek,
6671
+ onDismiss: n.dismissPeek,
6672
+ onHover: n.onLauncherHover
6650
6673
  }, null, 8, ["unread-count", "peeks", "onOpen", "onDismiss", "onHover"])) : b("", !0),
6651
- a.isOpen || s.isEmbedded ? (c(), d("section", {
6674
+ a.isOpen || n.isEmbedded ? (c(), d("section", {
6652
6675
  key: 1,
6653
6676
  class: R([
6654
6677
  "wm-panel",
6655
- `wm-panel--${n.displayMode}`,
6656
- { "wm-panel--welcome": s.ready && !s.error && !s.currentConv }
6678
+ `wm-panel--${s.displayMode}`,
6679
+ { "wm-panel--welcome": n.ready && !n.error && !n.currentConv }
6657
6680
  ]),
6658
6681
  style: z(a.floatHeight ? { "--wm-float-h": a.floatHeight + "px" } : null),
6659
6682
  role: "dialog",
6660
6683
  "aria-label": "Messenger",
6661
- onClick: t[6] || (t[6] = (...L) => s.onPanelClick && s.onPanelClick(...L))
6684
+ onClick: t[6] || (t[6] = (...L) => n.onPanelClick && n.onPanelClick(...L))
6662
6685
  }, [
6663
- !s.ready && !s.error ? (c(), d("div", Qa, [
6664
- s.isEmbedded ? b("", !0) : (c(), d("button", {
6686
+ !n.ready && !n.error ? (c(), d("div", Qa, [
6687
+ n.isEmbedded ? b("", !0) : (c(), d("button", {
6665
6688
  key: 0,
6666
6689
  type: "button",
6667
6690
  class: "wm-loading__close",
6668
- "aria-label": s.t("loading.minimize"),
6669
- onClick: t[0] || (t[0] = (...L) => s.close && s.close(...L))
6691
+ "aria-label": n.t("loading.minimize"),
6692
+ onClick: t[0] || (t[0] = (...L) => n.close && n.close(...L))
6670
6693
  }, [...t[7] || (t[7] = [
6671
6694
  o("svg", {
6672
6695
  width: "13",
@@ -6688,20 +6711,20 @@ function go(e, t, n, r, a, s) {
6688
6711
  }, null, -1))
6689
6712
  ])) : (c(), d(I, { key: 1 }, [
6690
6713
  $(l, {
6691
- title: s.headerTitle,
6692
- "team-members": s.teamMembers,
6693
- "response-label": s.responseLabel,
6694
- "show-identity": !!s.currentConv,
6695
- "show-back": s.canBack,
6696
- "show-close": !s.isEmbedded,
6714
+ title: n.headerTitle,
6715
+ "team-members": n.teamMembers,
6716
+ "response-label": n.responseLabel,
6717
+ "show-identity": !!n.currentConv,
6718
+ "show-back": n.canBack,
6719
+ "show-close": !n.isEmbedded,
6697
6720
  "more-active": a.moreOpen,
6698
- "agent-name": s.agentName,
6699
- "agent-avatar-url": s.agentAvatarUrl,
6700
- onBack: s.goHome,
6701
- onMore: s.toggleMore,
6702
- onClose: s.close
6721
+ "agent-name": n.agentName,
6722
+ "agent-avatar-url": n.agentAvatarUrl,
6723
+ onBack: n.goHome,
6724
+ onMore: n.toggleMore,
6725
+ onClose: n.close
6703
6726
  }, null, 8, ["title", "team-members", "response-label", "show-identity", "show-back", "show-close", "more-active", "agent-name", "agent-avatar-url", "onBack", "onMore", "onClose"]),
6704
- s.error ? (c(), d("div", eo, [
6727
+ n.error ? (c(), d("div", eo, [
6705
6728
  o("div", to, [
6706
6729
  t[9] || (t[9] = o("div", { class: "wm-state__errIcon" }, [
6707
6730
  o("svg", {
@@ -6719,63 +6742,63 @@ function go(e, t, n, r, a, s) {
6719
6742
  ])
6720
6743
  ], -1)),
6721
6744
  o("div", null, [
6722
- o("div", no, v(s.t("error.connectionFailed")), 1),
6723
- o("div", so, v(s.error), 1)
6745
+ o("div", no, v(n.t("error.connectionFailed")), 1),
6746
+ o("div", so, v(n.error), 1)
6724
6747
  ])
6725
6748
  ])
6726
- ])) : !s.currentConv && a.showHistory ? (c(), U(_, {
6749
+ ])) : !n.currentConv && a.showHistory ? (c(), D(_, {
6727
6750
  key: 1,
6728
- threads: s.openThreads,
6729
- onResume: s.onDrawerPick
6730
- }, null, 8, ["threads", "onResume"])) : s.currentConv ? (c(), d(I, { key: 3 }, [
6751
+ threads: n.openThreads,
6752
+ onResume: n.onDrawerPick
6753
+ }, null, 8, ["threads", "onResume"])) : n.currentConv ? (c(), d(I, { key: 3 }, [
6731
6754
  $(w, {
6732
6755
  ref: "messageList",
6733
- messages: s.displayedMessages,
6734
- "streaming-active": s.streamingActive,
6735
- "date-label": s.dateLabel,
6736
- "conversation-id": s.currentConv ? s.currentConv.id : null,
6737
- "loading-more": s.paginationState.loading,
6738
- "has-more": s.paginationState.hasMore,
6756
+ messages: n.displayedMessages,
6757
+ "streaming-active": n.streamingActive,
6758
+ "date-label": n.dateLabel,
6759
+ "conversation-id": n.currentConv ? n.currentConv.id : null,
6760
+ "loading-more": n.paginationState.loading,
6761
+ "has-more": n.paginationState.hasMore,
6739
6762
  "unread-anchor-id": e.unreadAnchorId,
6740
6763
  "unread-boundary-ts": e.unreadBoundaryTs,
6741
- "ai-agent-name": s.agentName,
6742
- "ai-agent-avatar-url": s.agentAvatarUrl,
6743
- onLoadMore: s.onLoadMore
6764
+ "ai-agent-name": n.agentName,
6765
+ "ai-agent-avatar-url": n.agentAvatarUrl,
6766
+ onLoadMore: n.onLoadMore
6744
6767
  }, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"]),
6745
6768
  o("div", ro, [
6746
- s.floatVisible ? (c(), d("div", io, [
6747
- s.approvalReady ? (c(), U(T, {
6769
+ n.floatVisible ? (c(), d("div", io, [
6770
+ n.approvalReady ? (c(), D(T, {
6748
6771
  key: 0,
6749
- action: s.approvalTitle,
6750
- detail: s.approvalDetail,
6751
- callbacks: s.pendingApproval.callbacks,
6752
- "agent-name": s.agentName,
6753
- "agent-avatar-url": s.agentAvatarUrl,
6754
- onCallback: s.onApprovalCallback
6755
- }, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) : s.pendingForm ? (c(), U(E, {
6756
- key: s.pendingForm.message && s.pendingForm.message.id,
6757
- form: s.pendingForm.form,
6758
- "agent-name": s.agentName,
6759
- "agent-avatar-url": s.agentAvatarUrl,
6760
- onSubmit: s.onFormSubmit
6761
- }, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(), U(A, {
6772
+ action: n.approvalTitle,
6773
+ detail: n.approvalDetail,
6774
+ callbacks: n.pendingApproval.callbacks,
6775
+ "agent-name": n.agentName,
6776
+ "agent-avatar-url": n.agentAvatarUrl,
6777
+ onCallback: n.onApprovalCallback
6778
+ }, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) : n.pendingForm ? (c(), D(E, {
6779
+ key: n.pendingForm.message && n.pendingForm.message.id,
6780
+ form: n.pendingForm.form,
6781
+ "agent-name": n.agentName,
6782
+ "agent-avatar-url": n.agentAvatarUrl,
6783
+ onSubmit: n.onFormSubmit
6784
+ }, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : n.showFeedback ? (c(), D(A, {
6762
6785
  key: 2,
6763
6786
  busy: a.feedbackBusy,
6764
6787
  done: a.feedbackDone,
6765
- onSubmit: s.onFeedback
6766
- }, null, 8, ["busy", "done", "onSubmit"])) : (c(), U(q, {
6788
+ onSubmit: n.onFeedback
6789
+ }, null, 8, ["busy", "done", "onSubmit"])) : (c(), D(q, {
6767
6790
  key: 3,
6768
- items: s.suggestions,
6769
- onSelect: s.onSuggestion
6791
+ items: n.suggestions,
6792
+ onSelect: n.onSuggestion
6770
6793
  }, null, 8, ["items", "onSelect"]))
6771
6794
  ], 512)) : b("", !0),
6772
- s.actionInFlight ? (c(), d("div", ao, [
6795
+ n.actionInFlight ? (c(), d("div", ao, [
6773
6796
  t[10] || (t[10] = o("span", {
6774
6797
  class: "wm-actionWait__spinner",
6775
6798
  "aria-hidden": "true"
6776
6799
  }, null, -1)),
6777
- o("span", oo, v(s.t("action.inProgress", {
6778
- name: s.actionInFlightName
6800
+ o("span", oo, v(n.t("action.inProgress", {
6801
+ name: n.actionInFlightName
6779
6802
  })), 1)
6780
6803
  ])) : b("", !0),
6781
6804
  a.pendingAttachments.length ? (c(), d("div", lo, [
@@ -6807,7 +6830,7 @@ function go(e, t, n, r, a, s) {
6807
6830
  ], -1)),
6808
6831
  o("span", ho, [
6809
6832
  o("span", mo, v(L.name), 1),
6810
- s.formatAttachmentSize(L.size_bytes) ? (c(), d("span", fo, v(s.formatAttachmentSize(
6833
+ n.formatAttachmentSize(L.size_bytes) ? (c(), d("span", fo, v(n.formatAttachmentSize(
6811
6834
  L.size_bytes
6812
6835
  )), 1)) : b("", !0)
6813
6836
  ])
@@ -6815,8 +6838,8 @@ function go(e, t, n, r, a, s) {
6815
6838
  o("button", {
6816
6839
  type: "button",
6817
6840
  class: "wm-attached__remove",
6818
- "aria-label": s.t("attachment.remove"),
6819
- onClick: (Q) => s.removePendingAttachment(K)
6841
+ "aria-label": n.t("attachment.remove"),
6842
+ onClick: (Q) => n.removePendingAttachment(K)
6820
6843
  }, [...t[12] || (t[12] = [
6821
6844
  o("svg", {
6822
6845
  width: "10",
@@ -6834,72 +6857,72 @@ function go(e, t, n, r, a, s) {
6834
6857
  ])], 8, _o)
6835
6858
  ]))), 128))
6836
6859
  ])) : b("", !0),
6837
- s.actionInFlight ? b("", !0) : (c(), U(M, {
6860
+ n.actionInFlight ? b("", !0) : (c(), D(M, {
6838
6861
  key: 3,
6839
6862
  ref: "composer",
6840
6863
  modelValue: a.draft,
6841
6864
  "onUpdate:modelValue": t[2] || (t[2] = (L) => a.draft = L),
6842
- placeholder: s.composerPlaceholder,
6843
- disabled: !!s.pendingApproval,
6844
- "attach-label": s.t("composer.attachFile"),
6845
- "display-mode": n.displayMode,
6846
- onSend: s.onSend,
6847
- onAttach: s.onAttach
6865
+ placeholder: n.composerPlaceholder,
6866
+ disabled: !!n.pendingApproval,
6867
+ "attach-label": n.t("composer.attachFile"),
6868
+ "display-mode": s.displayMode,
6869
+ onSend: n.onSend,
6870
+ onAttach: n.onAttach
6848
6871
  }, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "display-mode", "onSend", "onAttach"]))
6849
6872
  ]),
6850
- a.moreOpen ? (c(), U(D, {
6873
+ a.moreOpen ? (c(), D(U, {
6851
6874
  key: 0,
6852
- "can-rename": !!s.currentConv && !s.currentConv._draft,
6853
- "can-export": !!s.currentConv && !s.currentConv._draft,
6875
+ "can-rename": !!n.currentConv && !n.currentConv._draft,
6876
+ "can-export": !!n.currentConv && !n.currentConv._draft,
6854
6877
  "sound-enabled": e.soundEnabled,
6855
- "status-url": s.statusUrl,
6856
- "help-url": s.helpUrl,
6878
+ "status-url": n.statusUrl,
6879
+ "help-url": n.helpUrl,
6857
6880
  onClose: t[3] || (t[3] = (L) => a.moreOpen = !1),
6858
6881
  onSoundToggle: e.onSoundToggle,
6859
- onAction: s.onMoreAction
6882
+ onAction: n.onMoreAction
6860
6883
  }, null, 8, ["can-rename", "can-export", "sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0),
6861
- a.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), U(N, {
6884
+ a.renameDialogOpen && n.currentConv && !n.currentConv._draft ? (c(), D(N, {
6862
6885
  key: 1,
6863
- "initial-value": s.currentConv.name || "",
6864
- title: s.t("rename.dialogTitle"),
6886
+ "initial-value": n.currentConv.name || "",
6887
+ title: n.t("rename.dialogTitle"),
6865
6888
  onClose: t[4] || (t[4] = (L) => a.renameDialogOpen = !1),
6866
- onSubmit: s.onRenameSubmit
6889
+ onSubmit: n.onRenameSubmit
6867
6890
  }, null, 8, ["initial-value", "title", "onSubmit"])) : b("", !0)
6868
- ], 64)) : (c(), U(k, {
6891
+ ], 64)) : (c(), D(k, {
6869
6892
  key: 2,
6870
- title: s.widgetTitle,
6871
- subtitle: s.widgetSubtitle,
6872
- "agent-name": s.agentName,
6873
- "default-icon-url": s.defaultIconUrl,
6874
- "quick-links": s.quickLinks,
6875
- "open-threads": s.openThreads,
6893
+ title: n.widgetTitle,
6894
+ subtitle: n.widgetSubtitle,
6895
+ "agent-name": n.agentName,
6896
+ "default-icon-url": n.defaultIconUrl,
6897
+ "quick-links": n.quickLinks,
6898
+ "open-threads": n.openThreads,
6876
6899
  busy: a.busy,
6877
- onStart: s.startConv,
6878
- onSelect: s.onQuickLink,
6879
- onResume: s.onDrawerPick,
6900
+ onStart: n.startConv,
6901
+ onSelect: n.onQuickLink,
6902
+ onResume: n.onDrawerPick,
6880
6903
  onViewHistory: t[1] || (t[1] = (L) => a.showHistory = !0)
6881
6904
  }, null, 8, ["title", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
6882
- a.moreOpen && !s.currentConv ? (c(), U(D, {
6905
+ a.moreOpen && !n.currentConv ? (c(), D(U, {
6883
6906
  key: 4,
6884
6907
  "can-rename": !1,
6885
6908
  "can-export": !1,
6886
6909
  "sound-enabled": e.soundEnabled,
6887
- "status-url": s.statusUrl,
6888
- "help-url": s.helpUrl,
6910
+ "status-url": n.statusUrl,
6911
+ "help-url": n.helpUrl,
6889
6912
  onClose: t[5] || (t[5] = (L) => a.moreOpen = !1),
6890
6913
  onSoundToggle: e.onSoundToggle,
6891
- onAction: s.onMoreAction
6914
+ onAction: n.onMoreAction
6892
6915
  }, null, 8, ["sound-enabled", "status-url", "help-url", "onSoundToggle", "onAction"])) : b("", !0)
6893
6916
  ], 64))
6894
6917
  ], 6)) : b("", !0)
6895
6918
  ], 6);
6896
6919
  }
6897
- const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.72";
6920
+ const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-fa8045f9"]]), wo = "0.5.74";
6898
6921
  export {
6899
6922
  oe as AIAvatar,
6900
6923
  be as AVATAR_COLORS,
6901
6924
  As as ActionResult,
6902
- Di as ApprovalCard,
6925
+ Ui as ApprovalCard,
6903
6926
  Es as ArtifactFormResponse,
6904
6927
  Ks as ArtifactInfoCard,
6905
6928
  ur as ArtifactRenderer,