@_solaris/messenger-widget 0.5.57 → 0.5.59

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
@@ -38,7 +38,7 @@ function Ze(e) {
38
38
  function n(u, _) {
39
39
  return t.listeners.has(u) || t.listeners.set(u, /* @__PURE__ */ new Set()), t.listeners.get(u).add(_), () => t.listeners.get(u).delete(_);
40
40
  }
41
- function i(u, _) {
41
+ function r(u, _) {
42
42
  const p = t.listeners.get(u);
43
43
  p && p.forEach((S) => {
44
44
  try {
@@ -49,7 +49,7 @@ function Ze(e) {
49
49
  });
50
50
  }
51
51
  function a(u) {
52
- t.connection !== u && (t.connection = u, i("connection", u));
52
+ t.connection !== u && (t.connection = u, r("connection", u));
53
53
  }
54
54
  function s() {
55
55
  return {
@@ -64,7 +64,7 @@ function Ze(e) {
64
64
  ...t.origin ? { "X-Parent-Origin": t.origin } : {}
65
65
  };
66
66
  }
67
- async function r(u, _, p) {
67
+ async function i(u, _, p) {
68
68
  const S = await fetch(`${t.baseUrl}${we}${_}`, {
69
69
  method: u,
70
70
  credentials: "include",
@@ -132,7 +132,7 @@ function Ze(e) {
132
132
  }
133
133
  return $.json();
134
134
  }),
135
- r("GET", "/customers/me")
135
+ i("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 r("GET", "/customers/me");
154
+ const u = await i("GET", "/customers/me");
155
155
  return (u == null ? void 0 : u.customer) ?? null;
156
156
  }
157
157
  async function T(u) {
158
- const _ = await r("PATCH", "/customers/me", u);
158
+ const _ = await i("PATCH", "/customers/me", u);
159
159
  return (_ == null ? void 0 : _.customer) ?? null;
160
160
  }
161
161
  async function I() {
162
- const u = await r("GET", "/conversations");
162
+ const u = await i("GET", "/conversations");
163
163
  return (u == null ? void 0 : u.conversations) ?? [];
164
164
  }
165
165
  async function A(u = {}) {
166
- return (await r("POST", "/conversations", u)).conversation;
166
+ return (await i("POST", "/conversations", u)).conversation;
167
167
  }
168
168
  async function q(u) {
169
- return (await r(
169
+ return (await i(
170
170
  "GET",
171
171
  `/conversations/${encodeURIComponent(u)}`
172
172
  )).conversation;
173
173
  }
174
174
  async function M(u, _) {
175
- return (await r(
175
+ return (await i(
176
176
  "PATCH",
177
177
  `/conversations/${encodeURIComponent(u)}`,
178
178
  _
179
179
  )).conversation;
180
180
  }
181
181
  async function N(u, _) {
182
- return r(
182
+ return i(
183
183
  "PATCH",
184
184
  `/conversations/${encodeURIComponent(u)}/read`,
185
185
  { message_id: _ }
@@ -189,7 +189,7 @@ function Ze(e) {
189
189
  const p = new URLSearchParams();
190
190
  _.before && p.set("before", _.before), _.since && p.set("since", _.since), _.limit && p.set("limit", String(_.limit));
191
191
  const S = p.toString() ? `?${p.toString()}` : "";
192
- return r(
192
+ return i(
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: _.created_at || (/* @__PURE__ */ new Date()).toISOString()
205
205
  };
206
- return Array.isArray(_.attachments) && _.attachments.length && (p.payload = { type: "content", attachments: _.attachments }), _.metadata && typeof _.metadata == "object" && (p.metadata = _.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), r(
206
+ return Array.isArray(_.attachments) && _.attachments.length && (p.payload = { type: "content", attachments: _.attachments }), _.metadata && typeof _.metadata == "object" && (p.metadata = _.metadata), t.currentContext && Object.keys(t.currentContext).length > 0 && (p.context = t.currentContext), i(
207
207
  "POST",
208
208
  `/conversations/${encodeURIComponent(u)}/messages`,
209
209
  p
210
210
  );
211
211
  }
212
212
  async function K(u, _, p) {
213
- return ae(), r(
213
+ return ae(), i(
214
214
  "POST",
215
215
  `/messages/${encodeURIComponent(u)}/callbacks/${encodeURIComponent(_)}`,
216
216
  p ? { inputs: p } : {}
217
217
  );
218
218
  }
219
219
  async function Q(u) {
220
- const _ = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await r("POST", "/attachments", {
220
+ const _ = u.name || "attachment", p = u.type || "application/octet-stream", S = u.size || 0, O = await i("POST", "/attachments", {
221
221
  mime_type: p,
222
222
  size_bytes: S,
223
223
  name: _
@@ -236,7 +236,7 @@ function Ze(e) {
236
236
  };
237
237
  }
238
238
  async function se(u) {
239
- return r(
239
+ return i(
240
240
  "GET",
241
241
  `/attachments/sign?path=${encodeURIComponent(u)}`
242
242
  );
@@ -253,16 +253,16 @@ function Ze(e) {
253
253
  u.addEventListener(_, (p) => ie(_, p.data));
254
254
  u.addEventListener(
255
255
  "error",
256
- () => i("error", new Error("SSE error"))
256
+ () => r("error", new Error("SSE error"))
257
257
  ), t.eventSource = u, a("open");
258
258
  } catch (u) {
259
- console.error("[transport] SSE open failed", u), i("error", u);
259
+ console.error("[transport] SSE open failed", u), r("error", u);
260
260
  }
261
261
  }
262
262
  function ie(u, _) {
263
263
  try {
264
264
  const p = JSON.parse(_), S = p && typeof p == "object" && "data" in p ? p.data : p;
265
- i(u, S);
265
+ r(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
- _ && (!t.lastActivityAt || _ > t.lastActivityAt) && (t.lastActivityAt = _, i("activity", { conversations: u, latestAt: _ }), ae());
287
+ _ && (!t.lastActivityAt || _ > t.lastActivityAt) && (t.lastActivityAt = _, r("activity", { conversations: u, latestAt: _ }), 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 : r("POST", "/update", u);
318
+ return !u || typeof u != "object" ? null : i("POST", "/update", u);
319
319
  }
320
320
  function C(u) {
321
321
  if (!(!u || typeof u != "object"))
@@ -443,7 +443,7 @@ function st(e) {
443
443
  Array.isArray(h == null ? void 0 : h.conversations) && (t.conversations = h.conversations);
444
444
  })
445
445
  );
446
- async function i(h) {
446
+ async function r(h) {
447
447
  try {
448
448
  const m = new Promise(
449
449
  (y, C) => setTimeout(
@@ -485,7 +485,7 @@ function st(e) {
485
485
  }
486
486
  return t.customer;
487
487
  }
488
- async function r(h = {}) {
488
+ async function i(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
  }
@@ -775,10 +775,10 @@ function st(e) {
775
775
  }
776
776
  return {
777
777
  state: t,
778
- start: i,
778
+ start: r,
779
779
  destroy: a,
780
780
  applyCustomer: s,
781
- createConversation: r,
781
+ createConversation: i,
782
782
  openConversation: g,
783
783
  loadMore: k,
784
784
  fetchSinceLast: I,
@@ -1151,31 +1151,31 @@ function ne(e) {
1151
1151
  return Le[xe(e)] || Le[ue];
1152
1152
  }
1153
1153
  function F(e) {
1154
- const t = xe(e), n = ke[t] || ke[ue], i = ke[ue];
1155
- return function(s, r) {
1154
+ const t = xe(e), n = ke[t] || ke[ue], r = ke[ue];
1155
+ return function(s, i) {
1156
1156
  let l = n[s];
1157
- return l == null && (l = i[s]), l == null ? s : (r && (l = l.replace(
1157
+ return l == null && (l = r[s]), l == null ? s : (i && (l = l.replace(
1158
1158
  /\{(\w+)\}/g,
1159
- (g, k) => r[k] != null ? String(r[k]) : g
1159
+ (g, k) => i[k] != null ? String(i[k]) : g
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((i) => (i == null ? void 0 : i.value) === t);
1165
+ const n = e.options.find((r) => (r == null ? void 0 : r.value) === t);
1166
1166
  return (n == null ? void 0 : n.label) || t;
1167
1167
  }
1168
1168
  function He(e, t, n) {
1169
- return Array.isArray(t) ? t.map((i) => Ie(e, String(i))).join(", ") : typeof t == "boolean" ? n(t ? "common.yes" : "common.no") : Ie(e, String(t));
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));
1170
1170
  }
1171
1171
  function ht(e, t, n = F()) {
1172
1172
  if (!e || !t) return "";
1173
- const i = Array.isArray(e.fields) ? e.fields : [], a = [];
1174
- for (const s of i) {
1173
+ const r = Array.isArray(e.fields) ? e.fields : [], a = [];
1174
+ for (const s of r) {
1175
1175
  if (!(s != null && s.key) || !(s != null && s.label)) continue;
1176
- const r = t[s.key];
1177
- if (r == null || r === "") continue;
1178
- const l = He(s, r, n);
1176
+ const i = t[s.key];
1177
+ if (i == null || i === "") continue;
1178
+ const l = He(s, i, n);
1179
1179
  l && a.push(`${s.label} :
1180
1180
  ${l}`);
1181
1181
  }
@@ -1184,22 +1184,22 @@ ${l}`);
1184
1184
  `);
1185
1185
  }
1186
1186
  function mt(e, t, n = F()) {
1187
- const i = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
1187
+ const r = [], a = Array.isArray(e == null ? void 0 : e.fields) ? e.fields : [];
1188
1188
  for (const s of a) {
1189
1189
  if (!(s != null && s.key) || !(s != null && s.label)) continue;
1190
- const r = t == null ? void 0 : t[s.key];
1191
- if (r == null || r === "") continue;
1192
- const l = He(s, r, n);
1190
+ const i = t == null ? void 0 : t[s.key];
1191
+ if (i == null || i === "") continue;
1192
+ const l = He(s, i, n);
1193
1193
  if (!l) continue;
1194
1194
  const g = s.type === "textarea" || typeof l == "string" && (l.length > 60 || l.includes(`
1195
1195
  `));
1196
- i.push({ label: s.label, value: l, multiline: g });
1196
+ r.push({ label: s.label, value: l, multiline: g });
1197
1197
  }
1198
1198
  return {
1199
1199
  kind: "form_response",
1200
1200
  data: {
1201
1201
  title: (e == null ? void 0 : e.title) || n("form.title"),
1202
- fields: i
1202
+ fields: r
1203
1203
  }
1204
1204
  };
1205
1205
  }
@@ -1213,10 +1213,10 @@ const Ee = "";
1213
1213
  function de(e) {
1214
1214
  let t = e;
1215
1215
  const n = [];
1216
- return t = t.replace(/`([^`\n]+)`/g, (i, a) => {
1216
+ return t = t.replace(/`([^`\n]+)`/g, (r, a) => {
1217
1217
  const s = n.length;
1218
1218
  return n.push(a), `${Ee}CODE${s}${Ee}`;
1219
- }), t = t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, (i, 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, (i, a) => `<code class="wm-md-code">${n[+a]}</code>`), t;
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;
1220
1220
  }
1221
1221
  function qe(e) {
1222
1222
  if (!e) return "";
@@ -1227,15 +1227,15 @@ function ft(e) {
1227
1227
  if (!e) return "";
1228
1228
  const t = ze(e).split(`
1229
1229
  `), n = [];
1230
- let i = 0;
1231
- for (; i < t.length; ) {
1232
- const s = t[i];
1230
+ let r = 0;
1231
+ for (; r < t.length; ) {
1232
+ const s = t[r];
1233
1233
  if (/^\s*```([\w-]*)\s*$/.exec(s)) {
1234
- i++;
1234
+ r++;
1235
1235
  const k = [];
1236
- for (; i < t.length && !/^\s*```\s*$/.test(t[i]); )
1237
- k.push(t[i]), i++;
1238
- i < t.length && i++, n.push({
1236
+ for (; r < t.length && !/^\s*```\s*$/.test(t[r]); )
1237
+ k.push(t[r]), r++;
1238
+ r < t.length && r++, n.push({
1239
1239
  type: "block",
1240
1240
  html: `<pre class="wm-md-pre"><code>${k.join(`
1241
1241
  `)}</code></pre>`
@@ -1244,10 +1244,10 @@ function ft(e) {
1244
1244
  }
1245
1245
  if (/^\s*[-*]\s+/.test(s)) {
1246
1246
  const k = [];
1247
- for (; i < t.length; ) {
1248
- const T = /^\s*[-*]\s+(.*)$/.exec(t[i]);
1247
+ for (; r < t.length; ) {
1248
+ const T = /^\s*[-*]\s+(.*)$/.exec(t[r]);
1249
1249
  if (!T) break;
1250
- k.push(T[1]), i++;
1250
+ k.push(T[1]), r++;
1251
1251
  }
1252
1252
  const w = k.map((T) => `<li>${de(T)}</li>`).join("");
1253
1253
  n.push({
@@ -1259,10 +1259,10 @@ function ft(e) {
1259
1259
  const l = /^\s*(\d+)\.\s+(.*)$/.exec(s);
1260
1260
  if (l) {
1261
1261
  const k = parseInt(l[1], 10), w = [l[2]];
1262
- for (i++; i < t.length; ) {
1263
- const A = /^\s*\d+\.\s+(.*)$/.exec(t[i]);
1262
+ for (r++; r < t.length; ) {
1263
+ const A = /^\s*\d+\.\s+(.*)$/.exec(t[r]);
1264
1264
  if (!A) break;
1265
- w.push(A[1]), i++;
1265
+ w.push(A[1]), r++;
1266
1266
  }
1267
1267
  const T = w.map((A) => `<li>${de(A)}</li>`).join(""), I = k !== 1 ? ` start="${k}"` : "";
1268
1268
  n.push({
@@ -1277,17 +1277,17 @@ function ft(e) {
1277
1277
  n.push({
1278
1278
  type: "block",
1279
1279
  html: `<h${k} class="wm-md-h wm-md-h${k}">${de(g[2])}</h${k}>`
1280
- }), i++;
1280
+ }), r++;
1281
1281
  continue;
1282
1282
  }
1283
- n.push({ type: "text", html: de(s) }), i++;
1283
+ n.push({ type: "text", html: de(s) }), r++;
1284
1284
  }
1285
1285
  let a = "";
1286
1286
  for (let s = 0; s < n.length; s++) {
1287
- const r = n[s];
1288
- a += r.html;
1287
+ const i = n[s];
1288
+ a += i.html;
1289
1289
  const l = n[s + 1];
1290
- l && r.type !== "block" && l.type !== "block" && (a += `
1290
+ l && i.type !== "block" && l.type !== "block" && (a += `
1291
1291
  `);
1292
1292
  }
1293
1293
  return a;
@@ -1304,19 +1304,19 @@ function Y(e) {
1304
1304
  }
1305
1305
  function Be(e, t) {
1306
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 i of t)
1308
- i != null && i.created_at && i.created_at > n && (n = i.created_at);
1307
+ for (const r of t)
1308
+ r != null && r.created_at && r.created_at > n && (n = r.created_at);
1309
1309
  return n;
1310
1310
  }
1311
1311
  function _t(e, t) {
1312
- var n, i, a;
1312
+ var n, r, a;
1313
1313
  for (let s = t.length - 1; s >= 0; s--) {
1314
- const r = t[s];
1315
- if (!r) continue;
1316
- const l = typeof r.text_md == "string" ? r.text_md.trim() : "";
1314
+ const i = t[s];
1315
+ if (!i) continue;
1316
+ const l = typeof i.text_md == "string" ? i.text_md.trim() : "";
1317
1317
  if (l)
1318
- return (((n = r.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
1319
- const g = (i = r.payload) == null ? void 0 : i.attachments;
1318
+ return (((n = i.author) == null ? void 0 : n.type) === "user" ? "Vous : " : "") + l.replace(/\s+/g, " ");
1319
+ const g = (r = i.payload) == null ? void 0 : r.attachments;
1320
1320
  if (Array.isArray(g) && g.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, i) {
1327
+ function pt(e, t, n, r) {
1328
1328
  const a = [
1329
1329
  `# ${e.name || n("common.conversation")}`,
1330
1330
  e.created_at ? n("export.createdOn", {
1331
- date: new Date(e.created_at).toLocaleString(i)
1331
+ date: new Date(e.created_at).toLocaleString(r)
1332
1332
  }) : "",
1333
1333
  ""
1334
1334
  ];
1335
1335
  for (const s of t) {
1336
1336
  if (!s) continue;
1337
- const r = (s.text_md || "").trim();
1338
- if (!r) continue;
1339
- const l = gt(s.author, n), g = s.created_at ? new Date(s.created_at).toLocaleString(i) : "";
1340
- a.push(`[${g}] ${l} :`), a.push(r), a.push("");
1337
+ const i = (s.text_md || "").trim();
1338
+ if (!i) continue;
1339
+ const l = gt(s.author, n), g = s.created_at ? new Date(s.created_at).toLocaleString(r) : "";
1340
+ a.push(`[${g}] ${l} :`), a.push(i), a.push("");
1341
1341
  }
1342
1342
  return a.join(`
1343
1343
  `);
1344
1344
  }
1345
- function vt(e, t, n = F(), i) {
1345
+ function vt(e, t, n = F(), r) {
1346
1346
  if (!e) return;
1347
- const a = pt(e, t || [], n, ne(i)), s = new Blob([a], { type: "text/plain;charset=utf-8" });
1347
+ const a = pt(e, t || [], n, ne(r)), s = new Blob([a], { type: "text/plain;charset=utf-8" });
1348
1348
  try {
1349
- const r = URL.createObjectURL(s), 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);
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);
1353
1353
  }
1354
1354
  }
1355
1355
  const yt = {
@@ -1479,14 +1479,14 @@ const yt = {
1479
1479
  t.resume();
1480
1480
  } catch {
1481
1481
  }
1482
- const n = t.currentTime, i = t.createOscillator(), a = t.createGain();
1483
- i.connect(a), a.connect(t.destination), i.type = "sine", i.frequency.setValueAtTime(880, n), i.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), i.start(n), i.stop(n + 0.32);
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);
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, i = !n || n.type === "agent_ia", s = ((n == null ? void 0 : n.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");
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");
1490
1490
  try {
1491
1491
  const g = new Notification(s, {
1492
1492
  body: l,
@@ -1583,18 +1583,18 @@ const yt = {
1583
1583
  var n;
1584
1584
  if (!this.transport) return;
1585
1585
  this.teardownLiveReveal();
1586
- const e = this.transport.on("message", (i) => {
1587
- const a = i == null ? void 0 : i.conversation_id, s = i == null ? void 0 : i.message;
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
1588
  a && s && this.paceLiveMessage(s, a);
1589
1589
  });
1590
1590
  this._liveRevealConvSnapshot = new Map(
1591
- (((n = this.s) == null ? void 0 : n.conversations) || []).map((i) => [
1592
- i.id,
1593
- (i == null ? void 0 : i.last_message_at) || ""
1591
+ (((n = this.s) == null ? void 0 : n.conversations) || []).map((r) => [
1592
+ r.id,
1593
+ (r == null ? void 0 : r.last_message_at) || ""
1594
1594
  ])
1595
1595
  );
1596
- const t = this.transport.on("activity", (i) => {
1597
- this.handleLiveActivity(i);
1596
+ const t = this.transport.on("activity", (r) => {
1597
+ this.handleLiveActivity(r);
1598
1598
  });
1599
1599
  this._liveRevealOff = () => {
1600
1600
  try {
@@ -1627,22 +1627,22 @@ const yt = {
1627
1627
  var a, s;
1628
1628
  const t = e == null ? void 0 : e.conversations;
1629
1629
  if (!Array.isArray(t) || !this.store) return;
1630
- const n = this._liveRevealConvSnapshot || /* @__PURE__ */ new Map(), i = [];
1631
- for (const r of t) {
1632
- if (!(r != null && r.id)) continue;
1633
- const l = r.last_message_at || "";
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 || "";
1634
1634
  if (!l) continue;
1635
- const g = n.get(r.id) || "";
1636
- l > g && i.push(r.id);
1635
+ const g = n.get(i.id) || "";
1636
+ l > g && r.push(i.id);
1637
1637
  }
1638
1638
  this._liveRevealConvSnapshot = new Map(
1639
- t.map((r) => [r.id, (r == null ? void 0 : r.last_message_at) || ""])
1639
+ t.map((i) => [i.id, (i == null ? void 0 : i.last_message_at) || ""])
1640
1640
  );
1641
- for (const r of i)
1641
+ for (const i of r)
1642
1642
  try {
1643
- const l = await ((s = (a = this.store).fetchSinceLast) == null ? void 0 : s.call(a, r));
1643
+ const l = await ((s = (a = this.store).fetchSinceLast) == null ? void 0 : s.call(a, i));
1644
1644
  if (!Array.isArray(l)) continue;
1645
- for (const g of l) this.paceLiveMessage(g, r);
1645
+ for (const g of l) this.paceLiveMessage(g, i);
1646
1646
  } catch (l) {
1647
1647
  console.error(
1648
1648
  "[ww-messenger] activity delta fetch failed",
@@ -1656,15 +1656,15 @@ const yt = {
1656
1656
  // - inter-bubble gap scales with message length (reading time),
1657
1657
  // bounded by MIN/MAX_TYPING_MS.
1658
1658
  scheduleReveal(e, t) {
1659
- const n = this.revealPacing, i = Date.now(), a = ((e == null ? void 0 : e.text_md) || "").length, s = Math.min(
1659
+ const n = this.revealPacing, r = Date.now(), a = ((e == null ? void 0 : e.text_md) || "").length, s = Math.min(
1660
1660
  n.maxTypingMs,
1661
1661
  Math.max(n.minTypingMs, a * n.msPerChar)
1662
1662
  ), l = Math.max(
1663
- i + n.firstRevealDelayMs,
1663
+ r + n.firstRevealDelayMs,
1664
1664
  this.nextRevealAt + n.pauseBetweenMs
1665
1665
  ) + s;
1666
1666
  this.nextRevealAt = l;
1667
- const g = Math.max(0, l - i), k = e.id, w = setTimeout(() => {
1667
+ const g = Math.max(0, l - r), k = e.id, w = setTimeout(() => {
1668
1668
  this.revealedAt = { ...this.revealedAt, [k]: Date.now() }, this.revealTimers = this.revealTimers.filter((T) => T !== w), typeof this.onMessageRevealed == "function" && this.onMessageRevealed(e, t);
1669
1669
  }, g);
1670
1670
  this.revealTimers.push(w);
@@ -1677,26 +1677,26 @@ const yt = {
1677
1677
  paceMessages(e, t) {
1678
1678
  var a;
1679
1679
  if (!Array.isArray(e) || !e.length) return;
1680
- const n = Date.now(), i = { ...this.revealedAt };
1680
+ const n = Date.now(), r = { ...this.revealedAt };
1681
1681
  for (const s of e) {
1682
- if ((s == null ? void 0 : s.id) == null || i[s.id] !== void 0) continue;
1682
+ if ((s == null ? void 0 : s.id) == null || r[s.id] !== void 0) continue;
1683
1683
  if (!he(s)) {
1684
- i[s.id] = n;
1684
+ r[s.id] = n;
1685
1685
  continue;
1686
1686
  }
1687
- const r = s != null && s.created_at ? Date.parse(s.created_at) : NaN;
1688
- if (!Number.isFinite(r) || r < this.convOpenedAt) {
1689
- i[s.id] = n;
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;
1690
1690
  continue;
1691
1691
  }
1692
1692
  const l = typeof (s == null ? void 0 : s.text_md) == "string" && s.text_md.trim().length > 0, g = Array.isArray((a = s == null ? void 0 : s.payload) == null ? void 0 : a.attachments) && s.payload.attachments.length > 0;
1693
1693
  if (!l && !g) {
1694
- i[s.id] = n;
1694
+ r[s.id] = n;
1695
1695
  continue;
1696
1696
  }
1697
- i[s.id] = 0, this.scheduleReveal(s, t);
1697
+ r[s.id] = 0, this.scheduleReveal(s, t);
1698
1698
  }
1699
- this.revealedAt = i;
1699
+ this.revealedAt = r;
1700
1700
  },
1701
1701
  // Pace a single live message from any conversation. Called from the
1702
1702
  // transport 'message' subscription (live SSE arrival) and from the
@@ -1715,8 +1715,8 @@ const yt = {
1715
1715
  this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1716
1716
  return;
1717
1717
  }
1718
- const n = typeof (e == null ? void 0 : e.text_md) == "string" && e.text_md.trim().length > 0, i = Array.isArray((a = e == null ? void 0 : e.payload) == null ? void 0 : a.attachments) && e.payload.attachments.length > 0;
1719
- if (!n && !i) {
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) {
1720
1720
  this.revealedAt = { ...this.revealedAt, [e.id]: Date.now() };
1721
1721
  return;
1722
1722
  }
@@ -1782,12 +1782,12 @@ const yt = {
1782
1782
  // messages, or when the pointer is already at/ahead of the
1783
1783
  // candidate id.
1784
1784
  markConvRead(e) {
1785
- var s, r;
1785
+ var s, i;
1786
1786
  if (!(e != null && e.id) || e._draft || !this.store) return;
1787
- const t = ((r = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : r[e.id]) || [], n = At(t);
1787
+ const t = ((i = (s = this.s) == null ? void 0 : s.messagesByConv) == null ? void 0 : i[e.id]) || [], n = At(t);
1788
1788
  if (n == null) return;
1789
- const i = Y(e.last_read_message_id), a = Y(n);
1790
- a != null && (i != null && a <= i || (this._readMarkerPending = { convId: e.id, messageId: n }, !this._readMarkerTimer && (this._readMarkerTimer = setTimeout(() => {
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(() => {
1791
1791
  const l = this._readMarkerPending;
1792
1792
  this._readMarkerPending = null, this._readMarkerTimer = null, l && this.store && this.store.markConversationRead(
1793
1793
  l.convId,
@@ -1807,8 +1807,8 @@ function At(e) {
1807
1807
  }
1808
1808
  const B = (e, t) => {
1809
1809
  const n = e.__vccOpts || e;
1810
- for (const [i, a] of t)
1811
- n[i] = a;
1810
+ for (const [r, a] of t)
1811
+ n[r] = a;
1812
1812
  return n;
1813
1813
  }, St = {
1814
1814
  name: "WmHumanAvatar",
@@ -1831,7 +1831,7 @@ const B = (e, t) => {
1831
1831
  }
1832
1832
  }
1833
1833
  }, Mt = ["src", "alt"];
1834
- function Tt(e, t, n, i, a, s) {
1834
+ function Tt(e, t, n, r, a, s) {
1835
1835
  return c(), d("div", {
1836
1836
  class: R(["wm-huav", { "wm-huav--tail": n.tail }]),
1837
1837
  style: z({
@@ -1878,8 +1878,8 @@ const ve = /* @__PURE__ */ B(St, [["render", Tt], ["__scopeId", "data-v-14e10c0d
1878
1878
  }
1879
1879
  }
1880
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" }, Dt = { class: "wm-peek__name" }, Nt = { class: "wm-peek__action" }, Ut = { class: "wm-peek__text" }, jt = ["onClick"], Ft = ["aria-label"], Ht = ["aria-label"];
1881
- function zt(e, t, n, i, a, s) {
1882
- const r = E("HumanAvatar");
1881
+ function zt(e, t, n, r, a, s) {
1882
+ const i = E("HumanAvatar");
1883
1883
  return c(), d("div", {
1884
1884
  class: "wm-launcherWrap",
1885
1885
  onMouseenter: t[1] || (t[1] = (l) => e.$emit("hover", !0)),
@@ -1932,7 +1932,7 @@ function zt(e, t, n, i, a, s) {
1932
1932
  ], -1)
1933
1933
  ])], 8, Lt),
1934
1934
  o("div", It, [
1935
- V(r, {
1935
+ V(i, {
1936
1936
  name: l.senderName,
1937
1937
  "avatar-url": l.senderAvatarUrl,
1938
1938
  size: 34
@@ -2024,7 +2024,7 @@ const qt = /* @__PURE__ */ B(Ot, [["render", zt], ["__scopeId", "data-v-44ddf1a1
2024
2024
  key: 0,
2025
2025
  class: "wm-aiav__pulse"
2026
2026
  }, Kt = ["src", "alt"], Wt = ["width", "height"];
2027
- function Gt(e, t, n, i, a, s) {
2027
+ function Gt(e, t, n, r, a, s) {
2028
2028
  return c(), d("div", {
2029
2029
  class: R(["wm-aiav", { "wm-aiav--tail": n.tail }]),
2030
2030
  style: z({
@@ -2111,26 +2111,26 @@ const oe = /* @__PURE__ */ B($t, [["render", Gt], ["__scopeId", "data-v-6f7f685d
2111
2111
  key: 0,
2112
2112
  class: "wm-team__label"
2113
2113
  };
2114
- function en(e, t, n, i, a, s) {
2114
+ function en(e, t, n, r, a, s) {
2115
2115
  return s.visible ? (c(), d("div", Jt, [
2116
2116
  o("div", {
2117
2117
  class: "wm-team__stack",
2118
2118
  style: z({ width: s.stackWidth + "px" })
2119
2119
  }, [
2120
- (c(!0), d(L, null, j(n.members.slice(0, 3), (r, l) => (c(), d("div", {
2120
+ (c(!0), d(L, null, j(n.members.slice(0, 3), (i, l) => (c(), d("div", {
2121
2121
  key: l,
2122
2122
  class: "wm-team__pill",
2123
2123
  style: z({
2124
2124
  left: l * 13 + "px",
2125
2125
  zIndex: 3 - l,
2126
- background: s.colorFor(r)
2126
+ background: s.colorFor(i)
2127
2127
  })
2128
2128
  }, [
2129
- r.avatar_url ? (c(), d("img", {
2129
+ i.avatar_url ? (c(), d("img", {
2130
2130
  key: 0,
2131
- src: r.avatar_url,
2132
- alt: r.name || ""
2133
- }, null, 8, Xt)) : (c(), d("span", Qt, v(s.initialsFor(r)), 1))
2131
+ src: i.avatar_url,
2132
+ alt: i.name || ""
2133
+ }, null, 8, Xt)) : (c(), d("span", Qt, v(s.initialsFor(i)), 1))
2134
2134
  ], 4))), 128))
2135
2135
  ], 4),
2136
2136
  n.responseLabel ? (c(), d("span", Zt, v(n.responseLabel), 1)) : b("", !0)
@@ -2170,8 +2170,8 @@ const tn = /* @__PURE__ */ B(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
2170
2170
  const e = Array.isArray(this.teamMembers) ? this.teamMembers : [];
2171
2171
  if (e.length <= 3) return e;
2172
2172
  const t = (/* @__PURE__ */ new Date()).getHours() % e.length, n = [];
2173
- for (let i = 0; i < 3; i++)
2174
- n.push(e[(t + i) % e.length]);
2173
+ for (let r = 0; r < 3; r++)
2174
+ n.push(e[(t + r) % e.length]);
2175
2175
  return n;
2176
2176
  }
2177
2177
  }
@@ -2182,8 +2182,8 @@ const tn = /* @__PURE__ */ B(Yt, [["render", en], ["__scopeId", "data-v-e49a9063
2182
2182
  key: 3,
2183
2183
  class: "wm-header__fill"
2184
2184
  }, un = { class: "wm-header__actions" }, hn = ["aria-label", "title"], mn = ["aria-label", "title"];
2185
- function fn(e, t, n, i, a, s) {
2186
- const r = E("AIAvatar"), l = E("TeamAvatars");
2185
+ function fn(e, t, n, r, a, s) {
2186
+ const i = E("AIAvatar"), l = E("TeamAvatars");
2187
2187
  return c(), d("div", sn, [
2188
2188
  n.showBack ? (c(), d("button", {
2189
2189
  key: 0,
@@ -2208,7 +2208,7 @@ function fn(e, t, n, i, a, s) {
2208
2208
  ])], 8, rn)) : (c(), d("div", an)),
2209
2209
  n.showIdentity ? (c(), d(L, { key: 2 }, [
2210
2210
  o("div", on, [
2211
- V(r, {
2211
+ V(i, {
2212
2212
  size: 30,
2213
2213
  name: n.agentName,
2214
2214
  "image-url": n.agentAvatarUrl
@@ -2387,15 +2387,15 @@ const _n = /* @__PURE__ */ B(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
2387
2387
  if (!e) return "";
2388
2388
  const t = new Date(e);
2389
2389
  if (Number.isNaN(t.getTime())) return "";
2390
- const n = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
2391
- if (t.toDateString() === i.toDateString())
2390
+ const n = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
2391
+ if (t.toDateString() === r.toDateString())
2392
2392
  return t.toLocaleTimeString(n, {
2393
2393
  hour: "2-digit",
2394
2394
  minute: "2-digit"
2395
2395
  });
2396
- if (i.getTime() - t.getTime() < 7 * 864e5) {
2397
- const r = t.toLocaleDateString(n, { weekday: "short" });
2398
- return r.charAt(0).toUpperCase() + r.slice(1);
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);
2399
2399
  }
2400
2400
  return t.toLocaleDateString(n, {
2401
2401
  day: "2-digit",
@@ -2449,8 +2449,8 @@ const _n = /* @__PURE__ */ B(nn, [["render", fn], ["__scopeId", "data-v-7af4c118
2449
2449
  "stroke-linejoin": "round",
2450
2450
  "aria-hidden": "true"
2451
2451
  }, Kn = ["d"], Wn = { class: "wm-onb__btn-label" }, Gn = { class: "wm-onb__btn-count" };
2452
- function Yn(e, t, n, i, a, s) {
2453
- const r = E("AIAvatar");
2452
+ function Yn(e, t, n, r, a, s) {
2453
+ const i = E("AIAvatar");
2454
2454
  return c(), d("div", pn, [
2455
2455
  o("div", vn, [
2456
2456
  t[2] || (t[2] = o("svg", {
@@ -2487,7 +2487,7 @@ function Yn(e, t, n, i, a, s) {
2487
2487
  opacity: "0.65"
2488
2488
  })
2489
2489
  ], -1)),
2490
- V(r, {
2490
+ V(i, {
2491
2491
  size: 52,
2492
2492
  "image-url": n.defaultIconUrl
2493
2493
  }, null, 8, ["image-url"]),
@@ -2678,15 +2678,15 @@ const Jn = /* @__PURE__ */ B(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
2678
2678
  if (!e) return "";
2679
2679
  const t = new Date(e);
2680
2680
  if (Number.isNaN(t.getTime())) return "";
2681
- const n = ne(this.wmLocale()), i = /* @__PURE__ */ new Date();
2682
- if (t.toDateString() === i.toDateString())
2681
+ const n = ne(this.wmLocale()), r = /* @__PURE__ */ new Date();
2682
+ if (t.toDateString() === r.toDateString())
2683
2683
  return t.toLocaleTimeString(n, {
2684
2684
  hour: "2-digit",
2685
2685
  minute: "2-digit"
2686
2686
  });
2687
- if (i.getTime() - t.getTime() < 7 * 864e5) {
2688
- const r = t.toLocaleDateString(n, { weekday: "short" });
2689
- return r.charAt(0).toUpperCase() + r.slice(1);
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);
2690
2690
  }
2691
2691
  return t.toLocaleDateString(n, {
2692
2692
  day: "2-digit",
@@ -2704,7 +2704,7 @@ const Jn = /* @__PURE__ */ B(gn, [["render", Yn], ["__scopeId", "data-v-136c3afe
2704
2704
  key: 0,
2705
2705
  class: "wm-hist__empty"
2706
2706
  };
2707
- function us(e, t, n, i, a, s) {
2707
+ function us(e, t, n, r, a, s) {
2708
2708
  return c(), d("div", Qn, [
2709
2709
  o("div", Zn, [
2710
2710
  t[1] || (t[1] = o("span", { class: "wm-hist__searchIcon" }, [
@@ -2723,7 +2723,7 @@ function us(e, t, n, i, a, s) {
2723
2723
  ])
2724
2724
  ], -1)),
2725
2725
  G(o("input", {
2726
- "onUpdate:modelValue": t[0] || (t[0] = (r) => a.query = r),
2726
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => a.query = i),
2727
2727
  type: "text",
2728
2728
  placeholder: s.t("onboarding.search"),
2729
2729
  "aria-label": s.t("onboarding.search")
@@ -2732,16 +2732,16 @@ function us(e, t, n, i, a, s) {
2732
2732
  ])
2733
2733
  ]),
2734
2734
  o("div", ts, [
2735
- (c(!0), d(L, null, j(s.filteredThreads, (r) => (c(), d("button", {
2736
- key: r.id,
2735
+ (c(!0), d(L, null, j(s.filteredThreads, (i) => (c(), d("button", {
2736
+ key: i.id,
2737
2737
  type: "button",
2738
- class: R(["wm-hist__thread", { "wm-hist__thread--unread": r.unread }]),
2739
- onClick: (l) => e.$emit("resume", r)
2738
+ class: R(["wm-hist__thread", { "wm-hist__thread--unread": i.unread }]),
2739
+ onClick: (l) => e.$emit("resume", i)
2740
2740
  }, [
2741
2741
  o("span", {
2742
- class: R(["wm-hist__thread-avatar", s.avatarWrapperClass(r)])
2742
+ class: R(["wm-hist__thread-avatar", s.avatarWrapperClass(i)])
2743
2743
  }, [
2744
- s.isDefaultAvatar(r) ? (c(), d("span", ss, [...t[2] || (t[2] = [
2744
+ s.isDefaultAvatar(i) ? (c(), d("span", ss, [...t[2] || (t[2] = [
2745
2745
  o("svg", {
2746
2746
  width: "18",
2747
2747
  height: "18",
@@ -2755,25 +2755,25 @@ function us(e, t, n, i, a, s) {
2755
2755
  }, [
2756
2756
  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
2757
  ], -1)
2758
- ])])) : (c(), P(Ae(s.avatarComponent(r)), Fe({
2758
+ ])])) : (c(), P(Ae(s.avatarComponent(i)), Fe({
2759
2759
  key: 1,
2760
2760
  ref_for: !0
2761
- }, s.avatarProps(r)), null, 16)),
2762
- r.unread ? (c(), d("span", {
2761
+ }, s.avatarProps(i)), null, 16)),
2762
+ i.unread ? (c(), d("span", {
2763
2763
  key: 2,
2764
2764
  class: "wm-hist__thread-dot",
2765
2765
  "aria-label": s.t("onboarding.unread")
2766
2766
  }, null, 8, rs)) : b("", !0)
2767
2767
  ], 2),
2768
2768
  o("span", is, [
2769
- o("span", as, v(r.title), 1),
2769
+ o("span", as, v(i.title), 1),
2770
2770
  o("span", {
2771
2771
  class: "wm-hist__thread-preview",
2772
- innerHTML: s.renderPreview(r.preview)
2772
+ innerHTML: s.renderPreview(i.preview)
2773
2773
  }, null, 8, os)
2774
2774
  ]),
2775
2775
  o("span", ls, [
2776
- s.formatTs(r._ts) ? (c(), d("span", cs, v(s.formatTs(r._ts)), 1)) : b("", !0),
2776
+ s.formatTs(i._ts) ? (c(), d("span", cs, v(s.formatTs(i._ts)), 1)) : b("", !0),
2777
2777
  t[3] || (t[3] = o("svg", {
2778
2778
  width: "14",
2779
2779
  height: "14",
@@ -2855,7 +2855,7 @@ const fs = {
2855
2855
  "stroke-linecap": "round",
2856
2856
  "stroke-linejoin": "round"
2857
2857
  }, ws = { class: "wm-result__body" }, bs = { class: "wm-result__label" }, ks = { class: "wm-result__detail" };
2858
- function Cs(e, t, n, i, a, s) {
2858
+ function Cs(e, t, n, r, a, s) {
2859
2859
  return c(), d("div", {
2860
2860
  class: R(["wm-result", `wm-result--${n.state}`])
2861
2861
  }, [
@@ -2916,7 +2916,7 @@ const As = /* @__PURE__ */ B(fs, [["render", Cs], ["__scopeId", "data-v-7284acd0
2916
2916
  }
2917
2917
  }
2918
2918
  }, 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, i, a, s) {
2919
+ function Is(e, t, n, r, a, s) {
2920
2920
  return c(), d("div", Ms, [
2921
2921
  o("div", Ts, [
2922
2922
  o("div", xs, v(n.data.title || s.t("form.title")), 1),
@@ -2938,17 +2938,17 @@ function Is(e, t, n, i, a, s) {
2938
2938
  ])
2939
2939
  ]),
2940
2940
  o("div", Rs, [
2941
- (c(!0), d(L, null, j(s.fields, (r, l) => (c(), d("div", {
2941
+ (c(!0), d(L, null, j(s.fields, (i, l) => (c(), d("div", {
2942
2942
  key: l,
2943
2943
  class: "wm-art__field"
2944
2944
  }, [
2945
- o("div", Ls, v(r.label), 1),
2945
+ o("div", Ls, v(i.label), 1),
2946
2946
  o("div", {
2947
2947
  class: R([
2948
2948
  "wm-art__fieldValue",
2949
- { "wm-art__fieldValue--multi": r.multiline }
2949
+ { "wm-art__fieldValue--multi": i.multiline }
2950
2950
  ])
2951
- }, v(r.value), 3)
2951
+ }, v(i.value), 3)
2952
2952
  ]))), 128))
2953
2953
  ])
2954
2954
  ]);
@@ -2981,7 +2981,7 @@ const Es = /* @__PURE__ */ B(Ss, [["render", Is], ["__scopeId", "data-v-713aecf1
2981
2981
  key: 0,
2982
2982
  class: "wm-art__text"
2983
2983
  }, $s = { class: "wm-art__fieldLabel" };
2984
- function Vs(e, t, n, i, a, s) {
2984
+ function Vs(e, t, n, r, a, s) {
2985
2985
  return c(), d("div", Ps, [
2986
2986
  n.data.image_url ? (c(), d("figure", Ds, [
2987
2987
  o("img", {
@@ -3005,17 +3005,17 @@ function Vs(e, t, n, i, a, s) {
3005
3005
  ]),
3006
3006
  s.hasBody ? (c(), d("div", zs, [
3007
3007
  n.data.body ? (c(), d("div", qs, v(n.data.body), 1)) : b("", !0),
3008
- s.fields.length ? (c(!0), d(L, { key: 1 }, j(s.fields, (r, l) => (c(), d("div", {
3008
+ s.fields.length ? (c(!0), d(L, { key: 1 }, j(s.fields, (i, l) => (c(), d("div", {
3009
3009
  key: l,
3010
3010
  class: "wm-art__field"
3011
3011
  }, [
3012
- o("div", $s, v(r.label), 1),
3012
+ o("div", $s, v(i.label), 1),
3013
3013
  o("div", {
3014
3014
  class: R([
3015
3015
  "wm-art__fieldValue",
3016
- { "wm-art__fieldValue--multi": r.multiline }
3016
+ { "wm-art__fieldValue--multi": i.multiline }
3017
3017
  ])
3018
- }, v(r.value), 3)
3018
+ }, v(i.value), 3)
3019
3019
  ]))), 128)) : b("", !0)
3020
3020
  ])) : b("", !0)
3021
3021
  ]);
@@ -3023,13 +3023,13 @@ function Vs(e, t, n, i, a, s) {
3023
3023
  const Ks = /* @__PURE__ */ B(Bs, [["render", Vs], ["__scopeId", "data-v-7eae0e4a"]]);
3024
3024
  function Ws(e, t, n) {
3025
3025
  if (!e) return "";
3026
- const i = new Date(e);
3027
- if (Number.isNaN(i.getTime())) return e;
3028
- const a = i.toLocaleDateString(t, {
3026
+ const r = new Date(e);
3027
+ if (Number.isNaN(r.getTime())) return e;
3028
+ const a = r.toLocaleDateString(t, {
3029
3029
  day: "numeric",
3030
3030
  month: "long",
3031
3031
  year: "numeric"
3032
- }), s = i.toLocaleTimeString(t, {
3032
+ }), s = r.toLocaleTimeString(t, {
3033
3033
  hour: "2-digit",
3034
3034
  minute: "2-digit"
3035
3035
  });
@@ -3103,7 +3103,7 @@ const Gs = {
3103
3103
  key: 1,
3104
3104
  class: "wm-art__footer wm-tk__footer"
3105
3105
  };
3106
- function ar(e, t, n, i, a, s) {
3106
+ function ar(e, t, n, r, a, s) {
3107
3107
  return c(), d("div", Ys, [
3108
3108
  o("div", Js, [
3109
3109
  o("div", Xs, v(n.data.title), 1),
@@ -3142,21 +3142,21 @@ function ar(e, t, n, i, a, s) {
3142
3142
  n.data.body ? (c(), d("div", er, v(n.data.body), 1)) : b("", !0)
3143
3143
  ]),
3144
3144
  s.fields.length ? (c(), d("div", tr, [
3145
- (c(!0), d(L, null, j(s.fields, (r, l) => (c(), d("div", {
3145
+ (c(!0), d(L, null, j(s.fields, (i, l) => (c(), d("div", {
3146
3146
  key: l,
3147
3147
  class: "wm-art__field"
3148
3148
  }, [
3149
- o("div", nr, v(r.label), 1),
3149
+ o("div", nr, v(i.label), 1),
3150
3150
  o("div", {
3151
3151
  class: R([
3152
3152
  "wm-art__fieldValue",
3153
- { "wm-art__fieldValue--multi": r.multiline }
3153
+ { "wm-art__fieldValue--multi": i.multiline }
3154
3154
  ])
3155
3155
  }, [
3156
- s.isPriority(r.label) ? (c(), d("svg", {
3156
+ s.isPriority(i.label) ? (c(), d("svg", {
3157
3157
  key: 0,
3158
3158
  class: "wm-tk__prio",
3159
- "data-level": s.priorityLevel(r.value),
3159
+ "data-level": s.priorityLevel(i.value),
3160
3160
  width: "12",
3161
3161
  height: "12",
3162
3162
  viewBox: "0 0 12 12",
@@ -3183,7 +3183,7 @@ function ar(e, t, n, i, a, s) {
3183
3183
  height: "9",
3184
3184
  rx: "0.5"
3185
3185
  }, null, -1)
3186
- ])], 8, sr)) : s.isDate(r.label) ? (c(), d("svg", rr, [...t[3] || (t[3] = [
3186
+ ])], 8, sr)) : s.isDate(i.label) ? (c(), d("svg", rr, [...t[3] || (t[3] = [
3187
3187
  o("rect", {
3188
3188
  x: "3",
3189
3189
  y: "4",
@@ -3193,7 +3193,7 @@ function ar(e, t, n, i, a, s) {
3193
3193
  }, null, -1),
3194
3194
  o("path", { d: "M16 2v4M8 2v4M3 10h18" }, null, -1)
3195
3195
  ])])) : b("", !0),
3196
- o("span", null, v(r.value), 1)
3196
+ o("span", null, v(i.value), 1)
3197
3197
  ], 2)
3198
3198
  ]))), 128))
3199
3199
  ])) : b("", !0),
@@ -3241,7 +3241,7 @@ const or = /* @__PURE__ */ B(Gs, [["render", ar], ["__scopeId", "data-v-5f30c914
3241
3241
  }
3242
3242
  }
3243
3243
  };
3244
- function dr(e, t, n, i, a, s) {
3244
+ function dr(e, t, n, r, a, s) {
3245
3245
  return s.component ? (c(), P(Ae(s.component), {
3246
3246
  key: 0,
3247
3247
  data: n.artifact.data
@@ -3263,10 +3263,10 @@ const ur = /* @__PURE__ */ B(cr, [["render", dr]]), hr = {
3263
3263
  },
3264
3264
  computed: {
3265
3265
  kind() {
3266
- var n, i;
3266
+ var n, r;
3267
3267
  const e = (n = this.attachment) == null ? void 0 : n.type;
3268
3268
  if (e) return e;
3269
- const t = (((i = this.attachment) == null ? void 0 : i.mime_type) || "").toLowerCase();
3269
+ const t = (((r = this.attachment) == null ? void 0 : r.mime_type) || "").toLowerCase();
3270
3270
  return t.startsWith("image/") ? "image" : t.startsWith("audio/") ? "audio" : t.startsWith("video/") ? "video" : "file";
3271
3271
  },
3272
3272
  displayName() {
@@ -3323,7 +3323,7 @@ const ur = /* @__PURE__ */ B(cr, [["render", dr]]), hr = {
3323
3323
  class: "wm-att__spin",
3324
3324
  "aria-hidden": "true"
3325
3325
  };
3326
- function kr(e, t, n, i, a, s) {
3326
+ function kr(e, t, n, r, a, s) {
3327
3327
  return c(), d("div", {
3328
3328
  class: R(["wm-att", ["wm-att--" + (s.kind || "file")]])
3329
3329
  }, [
@@ -3356,7 +3356,7 @@ function kr(e, t, n, i, a, s) {
3356
3356
  download: s.displayName,
3357
3357
  target: "_blank",
3358
3358
  rel: "noopener",
3359
- onClick: t[0] || (t[0] = (...r) => s.onFileClick && s.onFileClick(...r))
3359
+ onClick: t[0] || (t[0] = (...i) => s.onFileClick && s.onFileClick(...i))
3360
3360
  }, [
3361
3361
  t[1] || (t[1] = o("span", { class: "wm-att__icon" }, [
3362
3362
  o("svg", {
@@ -3395,7 +3395,7 @@ const Cr = /* @__PURE__ */ B(hr, [["render", kr], ["__scopeId", "data-v-0c877a62
3395
3395
  }
3396
3396
  }
3397
3397
  }, Sr = ["innerHTML"];
3398
- function Mr(e, t, n, i, a, s) {
3398
+ function Mr(e, t, n, r, a, s) {
3399
3399
  return c(), d("div", {
3400
3400
  class: R(["wm-bubble", "wm-bubble--" + n.role])
3401
3401
  }, [
@@ -3405,7 +3405,7 @@ function Mr(e, t, n, i, a, s) {
3405
3405
  ], 2);
3406
3406
  }
3407
3407
  const Tr = /* @__PURE__ */ B(Ar, [["render", Mr], ["__scopeId", "data-v-7ab13147"]]), xr = { name: "WmTyping" }, Or = { class: "wm-typing" };
3408
- function Rr(e, t, n, i, a, s) {
3408
+ function Rr(e, t, n, r, a, s) {
3409
3409
  return c(), d("div", Or, [...t[0] || (t[0] = [
3410
3410
  o("span", { style: { "animation-delay": "0s" } }, null, -1),
3411
3411
  o("span", { style: { "animation-delay": "0.2s" } }, null, -1),
@@ -3501,61 +3501,61 @@ const Ir = {
3501
3501
  return !this.hasMore && !this.loadingMore && this.messages.length >= 20;
3502
3502
  },
3503
3503
  groups() {
3504
- var n, i, a, s;
3504
+ var n, r, a, s;
3505
3505
  const e = [];
3506
- for (const r of this.messages) {
3507
- const l = this.roleOf(r);
3506
+ for (const i of this.messages) {
3507
+ const l = this.roleOf(i);
3508
3508
  if (l === "system") {
3509
- if (((n = r == null ? void 0 : r.payload) == null ? void 0 : n.event) === "action_admin_pending") {
3509
+ if (((n = i == null ? void 0 : i.payload) == null ? void 0 : n.event) === "action_admin_pending") {
3510
3510
  const w = e[e.length - 1];
3511
- w && w.role === "ai" ? w.messages.push(r) : e.push({
3512
- key: `g-${ee(r)}`,
3511
+ w && w.role === "ai" ? w.messages.push(i) : e.push({
3512
+ key: `g-${ee(i)}`,
3513
3513
  role: "ai",
3514
3514
  agentName: "",
3515
3515
  agentAvatarUrl: null,
3516
- messages: [r],
3516
+ messages: [i],
3517
3517
  items: []
3518
3518
  });
3519
3519
  continue;
3520
3520
  }
3521
3521
  e.push({
3522
- key: `sys-${ee(r)}`,
3522
+ key: `sys-${ee(i)}`,
3523
3523
  role: l,
3524
- messages: [r],
3524
+ messages: [i],
3525
3525
  items: [],
3526
- systemLabel: this.systemLabel(r)
3526
+ systemLabel: this.systemLabel(i)
3527
3527
  });
3528
3528
  continue;
3529
3529
  }
3530
3530
  const g = e[e.length - 1];
3531
- g && g.role === l && (l === "ai" || g.agentName === (((i = r == null ? void 0 : r.author) == null ? void 0 : i.name) || "")) ? g.messages.push(r) : e.push({
3532
- key: `g-${ee(r)}`,
3531
+ g && g.role === l && (l === "ai" || g.agentName === (((r = i == null ? void 0 : i.author) == null ? void 0 : r.name) || "")) ? g.messages.push(i) : e.push({
3532
+ key: `g-${ee(i)}`,
3533
3533
  role: l,
3534
- agentName: ((a = r == null ? void 0 : r.author) == null ? void 0 : a.name) || "",
3535
- agentAvatarUrl: ((s = r == null ? void 0 : r.author) == null ? void 0 : s.avatar_url) || null,
3536
- messages: [r],
3534
+ agentName: ((a = i == null ? void 0 : i.author) == null ? void 0 : a.name) || "",
3535
+ agentAvatarUrl: ((s = i == null ? void 0 : i.author) == null ? void 0 : s.avatar_url) || null,
3536
+ messages: [i],
3537
3537
  items: []
3538
3538
  });
3539
3539
  }
3540
- for (const r of e) {
3541
- if (r.role === "system") continue;
3540
+ for (const i of e) {
3541
+ if (i.role === "system") continue;
3542
3542
  const l = [];
3543
- for (const g of r.messages)
3543
+ for (const g of i.messages)
3544
3544
  for (const k of this.itemsOf(g)) l.push(k);
3545
- r.items = l;
3545
+ i.items = l;
3546
3546
  }
3547
3547
  const t = [];
3548
- for (const r of e) {
3549
- if (r.role !== "system" && !r.items.length) continue;
3548
+ for (const i of e) {
3549
+ if (i.role !== "system" && !i.items.length) continue;
3550
3550
  const l = t[t.length - 1];
3551
- if (l && l.role !== "system" && l.role === r.role && (r.role === "ai" || l.agentName === r.agentName)) {
3552
- l.messages.push(...r.messages), l.items.push(...r.items);
3551
+ if (l && l.role !== "system" && l.role === i.role && (i.role === "ai" || l.agentName === i.agentName)) {
3552
+ l.messages.push(...i.messages), l.items.push(...i.items);
3553
3553
  continue;
3554
3554
  }
3555
- t.push(r);
3555
+ t.push(i);
3556
3556
  }
3557
- for (const r of t)
3558
- r.role !== "system" && (r.key = this.stableGroupKey(r.messages));
3557
+ for (const i of t)
3558
+ i.role !== "system" && (i.key = this.stableGroupKey(i.messages));
3559
3559
  return t;
3560
3560
  },
3561
3561
  // Key of the first non-user group that starts after the unread
@@ -3566,10 +3566,10 @@ const Ir = {
3566
3566
  const e = this.unreadAnchorId, t = this.unreadBoundaryTs;
3567
3567
  for (const n of this.groups) {
3568
3568
  if (n.role === "user" || n.role === "system" || !n.items.length) continue;
3569
- const i = n.messages[0];
3570
- if (!i) continue;
3571
- const a = Y(i.id);
3572
- if (a != null && !(a <= e) && !(t && i.created_at && i.created_at > t))
3569
+ const r = n.messages[0];
3570
+ if (!r) continue;
3571
+ const a = Y(r.id);
3572
+ if (a != null && !(a <= e) && !(t && r.created_at && r.created_at > t))
3573
3573
  return n.key;
3574
3574
  }
3575
3575
  return null;
@@ -3607,16 +3607,16 @@ const Ir = {
3607
3607
  this._groupIdByMsgKey || (this._groupIdByMsgKey = /* @__PURE__ */ new Map(), this._groupIdCounter = 0);
3608
3608
  const t = this._groupIdByMsgKey;
3609
3609
  let n = null;
3610
- for (const i of e) {
3611
- const a = ee(i);
3610
+ for (const r of e) {
3611
+ const a = ee(r);
3612
3612
  if (a && t.has(a)) {
3613
3613
  n = t.get(a);
3614
3614
  break;
3615
3615
  }
3616
3616
  }
3617
3617
  n == null && (n = ++this._groupIdCounter);
3618
- for (const i of e) {
3619
- const a = ee(i);
3618
+ for (const r of e) {
3619
+ const a = ee(r);
3620
3620
  a && t.set(a, n);
3621
3621
  }
3622
3622
  return `g-${n}`;
@@ -3655,21 +3655,21 @@ const Ir = {
3655
3655
  const t = this._lastSeenConvId !== this.conversationId;
3656
3656
  this._lastSeenConvId = this.conversationId;
3657
3657
  const n = this.isAtBottom(e);
3658
- let i = null;
3658
+ let r = null;
3659
3659
  if (!t && !n) {
3660
3660
  const s = this.pickAnchor(e);
3661
3661
  if (s != null && s.rowKey) {
3662
- const r = this.findRowByKey(e, s.rowKey);
3663
- if (r) {
3662
+ const i = this.findRowByKey(e, s.rowKey);
3663
+ if (i) {
3664
3664
  const l = e.getBoundingClientRect().top;
3665
- i = {
3665
+ r = {
3666
3666
  rowKey: s.rowKey,
3667
- relY: r.getBoundingClientRect().top - l
3667
+ relY: i.getBoundingClientRect().top - l
3668
3668
  };
3669
3669
  }
3670
3670
  }
3671
3671
  }
3672
- const a = { forceBottom: t, wasPinned: n, anchor: i };
3672
+ const a = { forceBottom: t, wasPinned: n, anchor: r };
3673
3673
  this._scrollSnap = a, this.$nextTick(() => {
3674
3674
  if (this._scrollSnap = null, a.forceBottom || a.wasPinned) {
3675
3675
  e.scrollTop = e.scrollHeight;
@@ -3677,9 +3677,9 @@ const Ir = {
3677
3677
  }
3678
3678
  if (!a.anchor) return;
3679
3679
  const s = () => {
3680
- const r = a.anchor, l = this.findRowByKey(e, r.rowKey);
3680
+ const i = a.anchor, l = this.findRowByKey(e, i.rowKey);
3681
3681
  if (!l) return;
3682
- const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - r.relY;
3682
+ const k = l.getBoundingClientRect().top - e.getBoundingClientRect().top - i.relY;
3683
3683
  Math.abs(k) > 0.5 && (e.scrollTop += k);
3684
3684
  };
3685
3685
  s(), requestAnimationFrame(() => {
@@ -3711,11 +3711,11 @@ const Ir = {
3711
3711
  // very-top-of-scroll edge case the same way the old logic did.
3712
3712
  pickAnchor(e) {
3713
3713
  const t = e.getBoundingClientRect().top, n = e.querySelectorAll(".wm-list__row[data-row-key]");
3714
- let i = null;
3714
+ let r = null;
3715
3715
  for (const a of n)
3716
- if (i || (i = a), a.getBoundingClientRect().bottom >= t)
3716
+ if (r || (r = a), a.getBoundingClientRect().bottom >= t)
3717
3717
  return { rowKey: a.dataset.rowKey };
3718
- return i ? { rowKey: i.dataset.rowKey } : null;
3718
+ return r ? { rowKey: r.dataset.rowKey } : null;
3719
3719
  },
3720
3720
  findRowByKey(e, t) {
3721
3721
  if (!t) return null;
@@ -3725,10 +3725,10 @@ const Ir = {
3725
3725
  );
3726
3726
  },
3727
3727
  roleOf(e) {
3728
- var n, i;
3728
+ var n, r;
3729
3729
  if ((e == null ? void 0 : e.type) === "system" || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.type) === "system")
3730
3730
  return "system";
3731
- const t = (i = e == null ? void 0 : e.author) == null ? void 0 : i.type;
3731
+ const t = (r = e == null ? void 0 : e.author) == null ? void 0 : r.type;
3732
3732
  return t === "user" ? "user" : t === "agent_human" ? "human" : "ai";
3733
3733
  },
3734
3734
  roleLabel(e) {
@@ -3827,9 +3827,9 @@ const Ir = {
3827
3827
  // doit garder son arrondi.
3828
3828
  cornersFor(e, t) {
3829
3829
  var Q, se, re;
3830
- const n = e.items, i = (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, r = e.role === "user", l = 14, g = 4, k = a == null ? void 0 : a.bottom, w = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], I = 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";
3830
+ 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, g = 4, k = a == null ? void 0 : a.bottom, w = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], I = 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";
3831
3831
  let N = l, U = l, D = l, K = l;
3832
- return r ? (k && (U = g), (w || !s) && (D = g), k && M(I, k, i == null ? void 0 : i.top) && (N = g), w && M(A, w, i == null ? void 0 : i.bottom) && (K = g)) : (k && (N = g), (w || !s) && (K = g), k && M(I, k, i == null ? void 0 : i.top) && (U = g), w && M(A, w, i == null ? void 0 : i.bottom) && (D = g)), { tl: N, tr: U, br: D, bl: K };
3832
+ return i ? (k && (U = g), (w || !s) && (D = g), k && M(I, k, r == null ? void 0 : r.top) && (N = g), w && M(A, w, r == null ? void 0 : r.bottom) && (K = g)) : (k && (N = g), (w || !s) && (K = g), k && M(I, k, r == null ? void 0 : r.top) && (U = g), w && M(A, w, r == null ? void 0 : r.bottom) && (D = g)), { tl: N, tr: U, br: D, bl: K };
3833
3833
  },
3834
3834
  // Inline style emitting the four corner CSS variables. Set on
3835
3835
  // `.wm-list__row` so they cascade to Bubble/ActionResult/
@@ -3848,8 +3848,8 @@ const Ir = {
3848
3848
  // Clé unique par item de cluster, alignée avec `:key` /
3849
3849
  // `data-row-key` du template. Sert d'index dans `widthByKey`.
3850
3850
  rowKeyOf(e, t) {
3851
- var i;
3852
- const n = (i = e == null ? void 0 : e.items) == null ? void 0 : i[t];
3851
+ var r;
3852
+ const n = (r = e == null ? void 0 : e.items) == null ? void 0 : r[t];
3853
3853
  return n ? `${ee(n.message)}-${n.partKey}` : "";
3854
3854
  },
3855
3855
  // rAF-debouncé : `updated()` peut être appelé en rafale (stream,
@@ -3870,20 +3870,20 @@ const Ir = {
3870
3870
  for (const s of e.querySelectorAll(
3871
3871
  ".wm-list__row[data-row-key]"
3872
3872
  )) {
3873
- const r = s.dataset.rowKey;
3874
- if (!r) continue;
3873
+ const i = s.dataset.rowKey;
3874
+ if (!i) continue;
3875
3875
  const l = s.querySelector(
3876
3876
  ".wm-bubble, .wm-result, .wm-art, .wm-list__body"
3877
3877
  );
3878
3878
  if (!l) continue;
3879
3879
  const g = l.getBoundingClientRect().width;
3880
- g > 0 && (t[r] = g);
3880
+ g > 0 && (t[i] = g);
3881
3881
  }
3882
- const n = this.widthByKey, i = Object.keys(n), a = Object.keys(t);
3883
- if (i.length === a.length) {
3882
+ const n = this.widthByKey, r = Object.keys(n), a = Object.keys(t);
3883
+ if (r.length === a.length) {
3884
3884
  let s = !0;
3885
- for (const r of a)
3886
- if (Math.abs((n[r] ?? 0) - t[r]) > 0.5) {
3885
+ for (const i of a)
3886
+ if (Math.abs((n[i] ?? 0) - t[i]) > 0.5) {
3887
3887
  s = !1;
3888
3888
  break;
3889
3889
  }
@@ -3953,19 +3953,19 @@ const Ir = {
3953
3953
  return ((t = e == null ? void 0 : e.payload) == null ? void 0 : t.name) || (e == null ? void 0 : e.text_md) || this.t("common.action");
3954
3954
  },
3955
3955
  actionDetail(e) {
3956
- var n, i, a, s, r, l;
3956
+ var n, r, a, s, i, l;
3957
3957
  const t = e == null ? void 0 : e.payload;
3958
- return t ? t.state === "success" ? ((n = t.success) == null ? void 0 : n.summary) || ((a = (i = t.success) == null ? void 0 : i.metadata) == null ? void 0 : a.description) || "" : t.state === "rejected" ? ((s = t.rejected) == null ? void 0 : s.reason) || this.t("action.rejectedByUser") : t.state === "failure" && (((r = t.failure) == null ? void 0 : r.summary) || ((l = t.failure) == null ? void 0 : l.error)) || "" : "";
3958
+ 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)) || "" : "";
3959
3959
  },
3960
3960
  actionArtifact(e) {
3961
- var n, i;
3962
- const t = (i = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : i.artifact;
3961
+ var n, r;
3962
+ const t = (r = (n = e == null ? void 0 : e.payload) == null ? void 0 : n.success) == null ? void 0 : r.artifact;
3963
3963
  return !t || typeof t != "object" || typeof t.kind != "string" ? null : t;
3964
3964
  },
3965
3965
  systemLabel(e) {
3966
- var a, s, r;
3967
- const t = (a = e == null ? void 0 : e.payload) == null ? void 0 : a.event, n = Ir[t], i = ((s = e == null ? void 0 : e.metadata) == null ? void 0 : s.agent_name) || ((r = e == null ? void 0 : e.author) == null ? void 0 : r.name) || this.t("messageList.anAgent");
3968
- return n ? this.t(n, { name: i }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
3966
+ var a, s, i;
3967
+ 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");
3968
+ return n ? this.t(n, { name: r }) : (e == null ? void 0 : e.text_md) || this.t("messageList.conversationUpdate");
3969
3969
  },
3970
3970
  scrollToBottom() {
3971
3971
  const e = this.$refs.scrollEl;
@@ -4012,8 +4012,8 @@ const Ir = {
4012
4012
  key: 3,
4013
4013
  class: "wm-list__row wm-list__row--ai fade-up"
4014
4014
  }, ni = { class: "wm-list__avatarSlot" }, si = ["aria-label", "title"];
4015
- function ri(e, t, n, i, a, s) {
4016
- const r = E("AIAvatar"), l = E("HumanAvatar"), g = E("ActionResult"), k = E("ArtifactRenderer"), w = E("Bubble"), T = E("AttachmentPreview"), I = E("Typing");
4015
+ function ri(e, t, n, r, a, s) {
4016
+ const i = E("AIAvatar"), l = E("HumanAvatar"), g = E("ActionResult"), k = E("ArtifactRenderer"), w = E("Bubble"), T = E("AttachmentPreview"), I = E("Typing");
4017
4017
  return c(), d("div", Dr, [
4018
4018
  o("div", {
4019
4019
  ref: "scrollEl",
@@ -4071,7 +4071,7 @@ function ri(e, t, n, i, a, s) {
4071
4071
  }, [
4072
4072
  A.role !== "user" ? (c(), d("div", Wr, [
4073
4073
  N === A.items.length - 1 ? (c(), d(L, { key: 0 }, [
4074
- A.role === "ai" ? (c(), P(r, {
4074
+ A.role === "ai" ? (c(), P(i, {
4075
4075
  key: 0,
4076
4076
  size: 26,
4077
4077
  tail: !0,
@@ -4145,7 +4145,7 @@ function ri(e, t, n, i, a, s) {
4145
4145
  ], 64))), 128)),
4146
4146
  n.streamingActive ? (c(), d("div", ti, [
4147
4147
  o("div", ni, [
4148
- V(r, {
4148
+ V(i, {
4149
4149
  size: 26,
4150
4150
  tail: !0,
4151
4151
  name: n.aiAgentName,
@@ -4192,8 +4192,8 @@ function ai() {
4192
4192
  "video/webm",
4193
4193
  "video/mp4"
4194
4194
  ].find((t) => {
4195
- var n, i;
4196
- return (i = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : i.call(n, t);
4195
+ var n, r;
4196
+ return (r = (n = window.MediaRecorder).isTypeSupported) == null ? void 0 : r.call(n, t);
4197
4197
  }) || "";
4198
4198
  }
4199
4199
  function $e({ audio: e }) {
@@ -4231,15 +4231,15 @@ async function oi() {
4231
4231
  async function li(e) {
4232
4232
  const t = document.createElement("video");
4233
4233
  t.muted = !0, t.playsInline = !0, t.srcObject = e, await t.play(), await new Promise((l) => requestAnimationFrame(l));
4234
- const n = t.videoWidth || 1280, i = t.videoHeight || 720, a = document.createElement("canvas");
4235
- a.width = n, a.height = i, a.getContext("2d").drawImage(t, 0, 0, n, i);
4234
+ const n = t.videoWidth || 1280, r = t.videoHeight || 720, a = document.createElement("canvas");
4235
+ a.width = n, a.height = r, a.getContext("2d").drawImage(t, 0, 0, n, r);
4236
4236
  const s = await new Promise((l, g) => {
4237
4237
  a.toBlob(
4238
4238
  (k) => k ? l(k) : g(new Error("toBlob failed")),
4239
4239
  "image/png"
4240
4240
  );
4241
- }), r = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
4242
- return new File([s], `capture-${r}.png`, { type: "image/png" });
4241
+ }), i = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
4242
+ return new File([s], `capture-${i}.png`, { type: "image/png" });
4243
4243
  }
4244
4244
  async function ci(e = {}) {
4245
4245
  var k;
@@ -4253,24 +4253,24 @@ async function ci(e = {}) {
4253
4253
  return (w == null ? void 0 : w.name) !== "NotAllowedError" && console.error("[media] record picker", w), null;
4254
4254
  }
4255
4255
  const n = ai();
4256
- let i;
4256
+ let r;
4257
4257
  try {
4258
- i = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
4258
+ r = n ? new window.MediaRecorder(t, { mimeType: n }) : new window.MediaRecorder(t);
4259
4259
  } catch (w) {
4260
4260
  return console.error("[media] recorder init", w), t.getTracks().forEach((T) => {
4261
4261
  T.stop();
4262
4262
  }), null;
4263
4263
  }
4264
4264
  const a = [];
4265
- let s = null, r = !1;
4266
- i.addEventListener("dataavailable", (w) => {
4265
+ let s = null, i = !1;
4266
+ r.addEventListener("dataavailable", (w) => {
4267
4267
  w.data && w.data.size > 0 && a.push(w.data);
4268
- }), i.addEventListener("stop", () => {
4268
+ }), r.addEventListener("stop", () => {
4269
4269
  var w, T;
4270
4270
  if (s && clearInterval(s), t.getTracks().forEach((I) => {
4271
4271
  I.stop();
4272
4272
  }), a.length) {
4273
- const I = i.mimeType || n || "video/webm", A = new Blob(a, { type: I }), q = /mp4/.test(I) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${M}.${q}`, {
4273
+ const I = r.mimeType || n || "video/webm", A = new Blob(a, { type: I }), q = /mp4/.test(I) ? "mp4" : "webm", M = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19), N = new File([A], `ecran-${M}.${q}`, {
4274
4274
  type: I
4275
4275
  });
4276
4276
  (w = e.onfinalize) == null || w.call(e, N);
@@ -4280,15 +4280,15 @@ async function ci(e = {}) {
4280
4280
  w.addEventListener("ended", () => l(), { once: !0 });
4281
4281
  });
4282
4282
  function l() {
4283
- if (!r && (r = !0, i.state !== "inactive"))
4283
+ if (!i && (i = !0, r.state !== "inactive"))
4284
4284
  try {
4285
- i.stop();
4285
+ r.stop();
4286
4286
  } catch (w) {
4287
4287
  console.error("[media] recorder stop", w);
4288
4288
  }
4289
4289
  }
4290
4290
  try {
4291
- i.start(1e3);
4291
+ r.start(1e3);
4292
4292
  } catch (w) {
4293
4293
  return console.error("[media] recorder start", w), t.getTracks().forEach((T) => {
4294
4294
  T.stop();
@@ -4302,7 +4302,7 @@ async function ci(e = {}) {
4302
4302
  }, 500), {
4303
4303
  stop: l,
4304
4304
  get state() {
4305
- return i.state;
4305
+ return r.state;
4306
4306
  }
4307
4307
  };
4308
4308
  }
@@ -4491,7 +4491,7 @@ const di = [
4491
4491
  height: "14",
4492
4492
  "aria-hidden": "true"
4493
4493
  }, vi = ["d"], yi = ["placeholder", "disabled"], wi = { class: "wm-compose__actions" }, bi = ["title", "aria-label", "disabled"], ki = ["disabled", "aria-label"];
4494
- function Ci(e, t, n, i, a, s) {
4494
+ function Ci(e, t, n, r, a, s) {
4495
4495
  return c(), d("div", {
4496
4496
  class: R(["wm-compose-wrap", { "wm-compose-wrap--sheet": n.displayMode === "sheet" }]),
4497
4497
  style: z(a.kbOffset ? { transform: `translateY(-${a.kbOffset}px)` } : null)
@@ -4505,37 +4505,37 @@ function Ci(e, t, n, i, a, s) {
4505
4505
  o("button", {
4506
4506
  type: "button",
4507
4507
  class: "wm-rec__stop",
4508
- onClick: t[0] || (t[0] = (...r) => s.stopRecording && s.stopRecording(...r))
4508
+ onClick: t[0] || (t[0] = (...i) => s.stopRecording && s.stopRecording(...i))
4509
4509
  }, v(s.t("composer.stop")), 1)
4510
4510
  ])) : b("", !0),
4511
4511
  o("form", {
4512
4512
  class: R(["wm-compose", { "has-attach": a.attachOpen }]),
4513
- onSubmit: t[7] || (t[7] = J((...r) => s.onSubmit && s.onSubmit(...r), ["prevent"]))
4513
+ onSubmit: t[7] || (t[7] = J((...i) => s.onSubmit && s.onSubmit(...i), ["prevent"]))
4514
4514
  }, [
4515
4515
  o("input", {
4516
4516
  ref: "fileEl",
4517
4517
  type: "file",
4518
4518
  hidden: "",
4519
4519
  multiple: "",
4520
- onChange: t[1] || (t[1] = (...r) => s.onFile && s.onFile(...r))
4520
+ onChange: t[1] || (t[1] = (...i) => s.onFile && s.onFile(...i))
4521
4521
  }, null, 544),
4522
4522
  a.attachOpen ? (c(), d("div", {
4523
4523
  key: 0,
4524
4524
  class: "wm-compose__overlay",
4525
- onClick: t[2] || (t[2] = (r) => a.attachOpen = !1)
4525
+ onClick: t[2] || (t[2] = (i) => a.attachOpen = !1)
4526
4526
  })) : b("", !0),
4527
4527
  a.attachOpen ? (c(), d("div", fi, [
4528
- (c(!0), d(L, null, j(s.attachItems, (r) => (c(), d("button", {
4529
- key: r.action,
4528
+ (c(!0), d(L, null, j(s.attachItems, (i) => (c(), d("button", {
4529
+ key: i.action,
4530
4530
  type: "button",
4531
4531
  class: "wm-compose__menuItem",
4532
- disabled: r.disabled,
4533
- onClick: (l) => s.onAttachAction(r.action)
4532
+ disabled: i.disabled,
4533
+ onClick: (l) => s.onAttachAction(i.action)
4534
4534
  }, [
4535
4535
  o("span", gi, [
4536
4536
  (c(), d("svg", pi, [
4537
4537
  o("path", {
4538
- d: r.path,
4538
+ d: i.path,
4539
4539
  stroke: "currentColor",
4540
4540
  "stroke-width": "1.8",
4541
4541
  "stroke-linecap": "round",
@@ -4544,18 +4544,18 @@ function Ci(e, t, n, i, a, s) {
4544
4544
  }, null, 8, vi)
4545
4545
  ]))
4546
4546
  ]),
4547
- o("span", null, v(r.label), 1)
4547
+ o("span", null, v(i.label), 1)
4548
4548
  ], 8, _i))), 128))
4549
4549
  ])) : b("", !0),
4550
4550
  G(o("textarea", {
4551
4551
  ref: "inputEl",
4552
- "onUpdate:modelValue": t[3] || (t[3] = (r) => a.local = r),
4552
+ "onUpdate:modelValue": t[3] || (t[3] = (i) => a.local = i),
4553
4553
  class: "wm-compose__input",
4554
4554
  rows: "3",
4555
4555
  placeholder: n.placeholder,
4556
4556
  disabled: n.disabled,
4557
- onKeydown: t[4] || (t[4] = (...r) => s.onKeydown && s.onKeydown(...r)),
4558
- onInput: t[5] || (t[5] = (...r) => s.autosize && s.autosize(...r))
4557
+ onKeydown: t[4] || (t[4] = (...i) => s.onKeydown && s.onKeydown(...i)),
4558
+ onInput: t[5] || (t[5] = (...i) => s.autosize && s.autosize(...i))
4559
4559
  }, null, 40, yi), [
4560
4560
  [te, a.local]
4561
4561
  ]),
@@ -4566,7 +4566,7 @@ function Ci(e, t, n, i, a, s) {
4566
4566
  title: n.attachLabel,
4567
4567
  "aria-label": n.attachLabel,
4568
4568
  disabled: a.recording,
4569
- onClick: t[6] || (t[6] = (r) => a.attachOpen = !a.attachOpen)
4569
+ onClick: t[6] || (t[6] = (i) => a.attachOpen = !a.attachOpen)
4570
4570
  }, [...t[9] || (t[9] = [
4571
4571
  o("svg", {
4572
4572
  width: "13",
@@ -4624,18 +4624,18 @@ const Ai = /* @__PURE__ */ B(ui, [["render", Ci], ["__scopeId", "data-v-01e81a27
4624
4624
  }
4625
4625
  }
4626
4626
  }, Mi = ["onClick"];
4627
- function Ti(e, t, n, i, a, s) {
4627
+ function Ti(e, t, n, r, a, s) {
4628
4628
  return n.items.length ? (c(), d("div", {
4629
4629
  key: s.batchKey,
4630
4630
  class: "wm-chips"
4631
4631
  }, [
4632
- (c(!0), d(L, null, j(n.items, (r, l) => (c(), d("button", {
4632
+ (c(!0), d(L, null, j(n.items, (i, l) => (c(), d("button", {
4633
4633
  key: l,
4634
4634
  type: "button",
4635
4635
  class: "wm-chip",
4636
4636
  style: z({ animationDelay: n.baseDelay + l * n.stepDelay + "ms" }),
4637
- onClick: (g) => e.$emit("select", r)
4638
- }, v(r.label), 13, Mi))), 128))
4637
+ onClick: (g) => e.$emit("select", i)
4638
+ }, v(i.label), 13, Mi))), 128))
4639
4639
  ])) : b("", !0);
4640
4640
  }
4641
4641
  const xi = /* @__PURE__ */ B(Si, [["render", Ti], ["__scopeId", "data-v-47ad8085"]]), Oi = {
@@ -4686,12 +4686,12 @@ const xi = /* @__PURE__ */ B(Si, [["render", Ti], ["__scopeId", "data-v-47ad8085
4686
4686
  key: 0,
4687
4687
  class: "wm-approval__detail"
4688
4688
  }, Di = { class: "wm-approval__actions" };
4689
- function Ni(e, t, n, i, a, s) {
4690
- const r = E("AIAvatar");
4689
+ function Ni(e, t, n, r, a, s) {
4690
+ const i = E("AIAvatar");
4691
4691
  return c(), d("div", Ri, [
4692
4692
  o("div", Li, [
4693
4693
  o("div", Ii, [
4694
- V(r, {
4694
+ V(i, {
4695
4695
  size: 24,
4696
4696
  name: n.agentName,
4697
4697
  "image-url": n.agentAvatarUrl
@@ -4777,8 +4777,8 @@ const ji = /* @__PURE__ */ new Set([
4777
4777
  this.values = t, this.error = "";
4778
4778
  },
4779
4779
  toggleMulti(e, t, n) {
4780
- const i = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = i.indexOf(t);
4781
- n && a === -1 ? i.push(t) : !n && a !== -1 && i.splice(a, 1), this.values = { ...this.values, [e]: i };
4780
+ const r = Array.isArray(this.values[e]) ? this.values[e].slice() : [], a = r.indexOf(t);
4781
+ n && a === -1 ? r.push(t) : !n && a !== -1 && r.splice(a, 1), this.values = { ...this.values, [e]: r };
4782
4782
  },
4783
4783
  validate() {
4784
4784
  for (const e of this.normalizedFields) {
@@ -4838,12 +4838,12 @@ const ji = /* @__PURE__ */ new Set([
4838
4838
  key: 2,
4839
4839
  class: "wm-form__doneLbl"
4840
4840
  };
4841
- function da(e, t, n, i, a, s) {
4842
- const r = E("AIAvatar");
4841
+ function da(e, t, n, r, a, s) {
4842
+ const i = E("AIAvatar");
4843
4843
  return c(), d("div", Hi, [
4844
4844
  o("div", zi, [
4845
4845
  o("div", qi, [
4846
- V(r, {
4846
+ V(i, {
4847
4847
  size: 24,
4848
4848
  name: n.agentName,
4849
4849
  "image-url": n.agentAvatarUrl
@@ -5013,7 +5013,7 @@ const ua = /* @__PURE__ */ B(Fi, [["render", da], ["__scopeId", "data-v-fe65cc56
5013
5013
  key: 1,
5014
5014
  class: "wm-fb__done"
5015
5015
  }, ka = { class: "wm-fb__doneTitle" }, Ca = { class: "wm-fb__doneSub" };
5016
- function Aa(e, t, n, i, a, s) {
5016
+ function Aa(e, t, n, r, a, s) {
5017
5017
  return c(), d("div", ma, [
5018
5018
  n.done ? (c(), d("div", ba, [
5019
5019
  t[1] || (t[1] = o("div", { class: "wm-fb__check" }, [
@@ -5037,21 +5037,21 @@ function Aa(e, t, n, i, a, s) {
5037
5037
  o("div", fa, v(s.t("feedback.question")), 1),
5038
5038
  o("div", _a, v(s.t("feedback.subtitle")), 1),
5039
5039
  o("div", ga, [
5040
- (c(!0), d(L, null, j(s.options, (r) => (c(), d("button", {
5041
- key: r.v,
5040
+ (c(!0), d(L, null, j(s.options, (i) => (c(), d("button", {
5041
+ key: i.v,
5042
5042
  type: "button",
5043
- class: R(["wm-fb__opt", { "is-selected": a.sel === r.v }]),
5044
- onClick: (l) => a.sel = r.v
5043
+ class: R(["wm-fb__opt", { "is-selected": a.sel === i.v }]),
5044
+ onClick: (l) => a.sel = i.v
5045
5045
  }, [
5046
- o("span", va, v(r.e), 1),
5047
- o("span", ya, v(r.l), 1)
5046
+ o("span", va, v(i.e), 1),
5047
+ o("span", ya, v(i.l), 1)
5048
5048
  ], 10, pa))), 128))
5049
5049
  ]),
5050
5050
  o("button", {
5051
5051
  type: "button",
5052
5052
  class: "wm-fb__send",
5053
5053
  disabled: !a.sel || n.busy,
5054
- onClick: t[0] || (t[0] = (...r) => s.onSend && s.onSend(...r))
5054
+ onClick: t[0] || (t[0] = (...i) => s.onSend && s.onSend(...i))
5055
5055
  }, v(n.busy ? s.t("common.sending") : s.t("feedback.submit")), 9, wa)
5056
5056
  ], 64))
5057
5057
  ]);
@@ -5101,11 +5101,11 @@ const Sa = /* @__PURE__ */ B(ha, [["render", Aa], ["__scopeId", "data-v-9b630564
5101
5101
  key: 1,
5102
5102
  class: "wm-mm__sep"
5103
5103
  }, Ea = { class: "wm-mm__section" }, Ba = { class: "wm-mm__label" }, Pa = { class: "wm-mm__section" }, Da = { class: "wm-mm__label" }, Na = { class: "wm-mm__label" };
5104
- function Ua(e, t, n, i, a, s) {
5104
+ function Ua(e, t, n, r, a, s) {
5105
5105
  return c(), d("div", Ta, [
5106
5106
  o("div", {
5107
5107
  class: "wm-mm__scrim",
5108
- onClick: t[0] || (t[0] = (r) => e.$emit("close"))
5108
+ onClick: t[0] || (t[0] = (i) => e.$emit("close"))
5109
5109
  }),
5110
5110
  o("div", xa, [
5111
5111
  n.canRename || n.canExport ? (c(), d("div", Oa, [
@@ -5113,7 +5113,7 @@ function Ua(e, t, n, i, a, s) {
5113
5113
  key: 0,
5114
5114
  type: "button",
5115
5115
  class: "wm-mm__item",
5116
- onClick: t[1] || (t[1] = (r) => s.emit("rename"))
5116
+ onClick: t[1] || (t[1] = (i) => s.emit("rename"))
5117
5117
  }, [
5118
5118
  t[6] || (t[6] = o("span", { class: "wm-mm__icon" }, [
5119
5119
  o("svg", {
@@ -5137,7 +5137,7 @@ function Ua(e, t, n, i, a, s) {
5137
5137
  key: 1,
5138
5138
  type: "button",
5139
5139
  class: "wm-mm__item",
5140
- onClick: t[2] || (t[2] = (r) => s.emit("export"))
5140
+ onClick: t[2] || (t[2] = (i) => s.emit("export"))
5141
5141
  }, [
5142
5142
  t[7] || (t[7] = o("span", { class: "wm-mm__icon" }, [
5143
5143
  o("svg", {
@@ -5163,7 +5163,7 @@ function Ua(e, t, n, i, a, s) {
5163
5163
  o("button", {
5164
5164
  type: "button",
5165
5165
  class: "wm-mm__item",
5166
- onClick: t[3] || (t[3] = (...r) => s.toggleSound && s.toggleSound(...r))
5166
+ onClick: t[3] || (t[3] = (...i) => s.toggleSound && s.toggleSound(...i))
5167
5167
  }, [
5168
5168
  t[10] || (t[10] = o("span", { class: "wm-mm__icon" }, [
5169
5169
  o("svg", {
@@ -5195,7 +5195,7 @@ function Ua(e, t, n, i, a, s) {
5195
5195
  key: 0,
5196
5196
  type: "button",
5197
5197
  class: "wm-mm__item",
5198
- onClick: t[4] || (t[4] = (r) => s.emit("status"))
5198
+ onClick: t[4] || (t[4] = (i) => s.emit("status"))
5199
5199
  }, [
5200
5200
  t[11] || (t[11] = o("span", { class: "wm-mm__icon" }, [
5201
5201
  o("svg", {
@@ -5218,7 +5218,7 @@ function Ua(e, t, n, i, a, s) {
5218
5218
  key: 1,
5219
5219
  type: "button",
5220
5220
  class: "wm-mm__item",
5221
- onClick: t[5] || (t[5] = (r) => s.emit("help"))
5221
+ onClick: t[5] || (t[5] = (i) => s.emit("help"))
5222
5222
  }, [
5223
5223
  t[12] || (t[12] = o("span", { class: "wm-mm__icon" }, [
5224
5224
  o("svg", {
@@ -5288,11 +5288,11 @@ const ja = /* @__PURE__ */ B(Ma, [["render", Ua], ["__scopeId", "data-v-4cf6d578
5288
5288
  role: "dialog",
5289
5289
  "aria-modal": "true"
5290
5290
  }, qa = { class: "wm-dialog__head" }, $a = { class: "wm-dialog__title" }, Va = ["aria-label"], Ka = { class: "wm-dialog__body" }, Wa = ["placeholder"], Ga = { class: "wm-dialog__actions" }, Ya = ["disabled"];
5291
- function Ja(e, t, n, i, a, s) {
5291
+ function Ja(e, t, n, r, a, s) {
5292
5292
  return c(), d("div", Ha, [
5293
5293
  o("div", {
5294
5294
  class: "wm-dialog__scrim",
5295
- onClick: t[0] || (t[0] = (r) => e.$emit("close"))
5295
+ onClick: t[0] || (t[0] = (i) => e.$emit("close"))
5296
5296
  }),
5297
5297
  o("div", za, [
5298
5298
  o("div", qa, [
@@ -5301,7 +5301,7 @@ function Ja(e, t, n, i, a, s) {
5301
5301
  type: "button",
5302
5302
  class: "wm-dialog__close",
5303
5303
  "aria-label": s.t("common.close"),
5304
- onClick: t[1] || (t[1] = (r) => e.$emit("close"))
5304
+ onClick: t[1] || (t[1] = (i) => e.$emit("close"))
5305
5305
  }, [...t[7] || (t[7] = [
5306
5306
  o("svg", {
5307
5307
  width: "12",
@@ -5321,14 +5321,14 @@ function Ja(e, t, n, i, a, s) {
5321
5321
  o("div", Ka, [
5322
5322
  G(o("input", {
5323
5323
  ref: "input",
5324
- "onUpdate:modelValue": t[2] || (t[2] = (r) => a.value = r),
5324
+ "onUpdate:modelValue": t[2] || (t[2] = (i) => a.value = i),
5325
5325
  type: "text",
5326
5326
  class: "wm-dialog__input",
5327
5327
  placeholder: n.placeholder || s.t("rename.placeholder"),
5328
5328
  maxlength: 120,
5329
5329
  onKeydown: [
5330
- t[3] || (t[3] = ge(J((...r) => s.onSubmit && s.onSubmit(...r), ["prevent"]), ["enter"])),
5331
- t[4] || (t[4] = ge(J((r) => e.$emit("close"), ["prevent"]), ["esc"]))
5330
+ t[3] || (t[3] = ge(J((...i) => s.onSubmit && s.onSubmit(...i), ["prevent"]), ["enter"])),
5331
+ t[4] || (t[4] = ge(J((i) => e.$emit("close"), ["prevent"]), ["esc"]))
5332
5332
  ]
5333
5333
  }, null, 40, Wa), [
5334
5334
  [te, a.value]
@@ -5338,13 +5338,13 @@ function Ja(e, t, n, i, a, s) {
5338
5338
  o("button", {
5339
5339
  type: "button",
5340
5340
  class: "wm-dialog__btn",
5341
- onClick: t[5] || (t[5] = (r) => e.$emit("close"))
5341
+ onClick: t[5] || (t[5] = (i) => e.$emit("close"))
5342
5342
  }, v(s.t("common.cancel")), 1),
5343
5343
  o("button", {
5344
5344
  type: "button",
5345
5345
  class: "wm-dialog__btn wm-dialog__btn--primary",
5346
5346
  disabled: !s.canSubmit,
5347
- onClick: t[6] || (t[6] = (...r) => s.onSubmit && s.onSubmit(...r))
5347
+ onClick: t[6] || (t[6] = (...i) => s.onSubmit && s.onSubmit(...i))
5348
5348
  }, v(s.t("common.save")), 9, Ya)
5349
5349
  ])
5350
5350
  ])
@@ -5522,8 +5522,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5522
5522
  // so the choice applies immediately, before the boot round-trip
5523
5523
  // that materializes `state.customer` has completed.
5524
5524
  customerLanguage() {
5525
- var n, i, a, s;
5526
- const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((i = e.values) == null ? void 0 : i.language));
5525
+ var n, r, a, s;
5526
+ const e = (n = this.s) == null ? void 0 : n.customer, t = e && (e.language || ((r = e.values) == null ? void 0 : r.language));
5527
5527
  return t || ((s = (a = this.context) == null ? void 0 : a.customer) == null ? void 0 : s.language) || "";
5528
5528
  },
5529
5529
  // Resolved UI language, by priority:
@@ -5571,10 +5571,10 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5571
5571
  drawerConversations() {
5572
5572
  var n;
5573
5573
  const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = this.revealedAt;
5574
- return this.allConversations.map((i) => {
5574
+ return this.allConversations.map((r) => {
5575
5575
  var k;
5576
- const a = e[i.id] || [], s = Y(i.last_read_message_id);
5577
- let r = 0, l = null;
5576
+ const a = e[r.id] || [], s = Y(r.last_read_message_id);
5577
+ let i = 0, l = null;
5578
5578
  for (let w = a.length - 1; w >= 0; w--) {
5579
5579
  const T = a[w];
5580
5580
  if (!T) continue;
@@ -5582,21 +5582,21 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5582
5582
  const I = Y(T.id);
5583
5583
  if (I != null) {
5584
5584
  if (s != null && I <= s) break;
5585
- t[T.id] !== 0 && (!l && T.author && (l = T.author), r++);
5585
+ t[T.id] !== 0 && (!l && T.author && (l = T.author), i++);
5586
5586
  }
5587
5587
  }
5588
5588
  if (!a.length) {
5589
- const w = Y(i.last_message_id);
5590
- w != null && (s == null || w > s) && (r = 1, l = i.last_message_author || null);
5589
+ const w = Y(r.last_message_id);
5590
+ w != null && (s == null || w > s) && (i = 1, l = r.last_message_author || null);
5591
5591
  }
5592
5592
  const g = a.filter(
5593
5593
  (w) => !((w == null ? void 0 : w.id) != null && t[w.id] === 0)
5594
5594
  );
5595
5595
  return {
5596
- ...i,
5597
- _preview: _t(i, g),
5598
- _unread: r > 0,
5599
- _unreadCount: r,
5596
+ ...r,
5597
+ _preview: _t(r, g),
5598
+ _unread: i > 0,
5599
+ _unreadCount: i,
5600
5600
  _lastAuthor: l
5601
5601
  };
5602
5602
  });
@@ -5619,7 +5619,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5619
5619
  unread: !!n._unread,
5620
5620
  author: n._lastAuthor || null,
5621
5621
  _ts: Be(n, e[n.id] || [])
5622
- })).sort((n, i) => n._ts < i._ts ? 1 : n._ts > i._ts ? -1 : 0);
5622
+ })).sort((n, r) => n._ts < r._ts ? 1 : n._ts > r._ts ? -1 : 0);
5623
5623
  },
5624
5624
  // Unread threads (one entry per conv with unseen agent/human
5625
5625
  // activity), freshest first. Each entry carries everything the
@@ -5628,19 +5628,19 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5628
5628
  latestUnreads() {
5629
5629
  var n;
5630
5630
  const e = ((n = this.s) == null ? void 0 : n.messagesByConv) || {}, t = [];
5631
- for (const i of this.drawerConversations) {
5632
- if (!i._unread) continue;
5633
- const a = Be(i, e[i.id] || []), s = i._lastAuthor, r = !s || s.type === "agent_ia", l = (s == null ? void 0 : s.name) || (r ? this.agentName : "") || "", g = (s == null ? void 0 : s.avatar_url) || (r ? this.agentAvatarUrl : null);
5631
+ for (const r of this.drawerConversations) {
5632
+ if (!r._unread) continue;
5633
+ 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 : "") || "", g = (s == null ? void 0 : s.avatar_url) || (i ? this.agentAvatarUrl : null);
5634
5634
  t.push({
5635
- convId: i.id,
5636
- preview: i._preview || this.t("notification.youHaveNewMessage"),
5635
+ convId: r.id,
5636
+ preview: r._preview || this.t("notification.youHaveNewMessage"),
5637
5637
  ts: a,
5638
- count: i._unreadCount || 1,
5638
+ count: r._unreadCount || 1,
5639
5639
  senderName: l,
5640
5640
  senderAvatarUrl: g
5641
5641
  });
5642
5642
  }
5643
- return t.sort((i, a) => i.ts < a.ts ? 1 : i.ts > a.ts ? -1 : 0), t;
5643
+ return t.sort((r, a) => r.ts < a.ts ? 1 : r.ts > a.ts ? -1 : 0), t;
5644
5644
  },
5645
5645
  // Notification cards shown in the closed-launcher stack: the unread
5646
5646
  // threads above, minus any the user has dismissed (×) for their
@@ -5676,7 +5676,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5676
5676
  var n;
5677
5677
  const e = (n = this.widget) == null ? void 0 : n.quick_links;
5678
5678
  if (!Array.isArray(e)) return "";
5679
- const t = e.find((i) => i.icon === "status" && i.url);
5679
+ const t = e.find((r) => r.icon === "status" && r.url);
5680
5680
  return (t == null ? void 0 : t.url) || "";
5681
5681
  },
5682
5682
  helpUrl() {
@@ -5684,7 +5684,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5684
5684
  const e = (n = this.widget) == null ? void 0 : n.quick_links;
5685
5685
  if (!Array.isArray(e)) return "";
5686
5686
  const t = e.find(
5687
- (i) => (i.icon === "chat" || i.icon === "help") && i.url
5687
+ (r) => (r.icon === "chat" || r.icon === "help") && r.url
5688
5688
  );
5689
5689
  return (t == null ? void 0 : t.url) || "";
5690
5690
  },
@@ -5751,11 +5751,11 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5751
5751
  // Last message from a human agent in the current conversation —
5752
5752
  // used to surface the human agent's name + avatar in the header.
5753
5753
  humanMessageAuthor() {
5754
- var t, n, i;
5754
+ var t, n, r;
5755
5755
  if (!this.currentConv) return null;
5756
5756
  const e = ((t = this.s.messagesByConv) == null ? void 0 : t[this.currentConv.id]) || [];
5757
5757
  for (let a = e.length - 1; a >= 0; a--)
5758
- if (((i = (n = e[a]) == null ? void 0 : n.author) == null ? void 0 : i.type) === "agent_human")
5758
+ if (((r = (n = e[a]) == null ? void 0 : n.author) == null ? void 0 : r.type) === "agent_human")
5759
5759
  return e[a].author;
5760
5760
  return null;
5761
5761
  },
@@ -5793,32 +5793,32 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5793
5793
  if (!e) return [];
5794
5794
  const t = this.welcomeRevealedAt[e.id] > 0 ? this.buildWelcomePrefix(e) : [];
5795
5795
  if (!e._draft) {
5796
- const r = (s = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : s[e.id];
5797
- if (!(r != null && r.loaded)) return t;
5796
+ const i = (s = (a = this.s) == null ? void 0 : a.paginationByConv) == null ? void 0 : s[e.id];
5797
+ if (!(i != null && i.loaded)) return t;
5798
5798
  }
5799
- const n = this.revealedAt, i = (this.s.messagesByConv[e.id] || []).filter((r) => {
5799
+ const n = this.revealedAt, r = (this.s.messagesByConv[e.id] || []).filter((i) => {
5800
5800
  var l, g, k, w, T;
5801
- return (r == null ? void 0 : r.type) === "action" && ((l = r == null ? void 0 : r.payload) == null ? void 0 : l.state) === "pending" || he(r) && !(n[r.id] > 0) ? !1 : (r == null ? void 0 : r.type) === "action" || (r == null ? void 0 : r.type) === "system" || ((g = r == null ? void 0 : r.payload) == null ? void 0 : g.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;
5801
+ 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" || ((g = i == null ? void 0 : i.payload) == null ? void 0 : g.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;
5802
5802
  });
5803
- return t.length ? [...t, ...i] : i;
5803
+ return t.length ? [...t, ...r] : r;
5804
5804
  },
5805
5805
  // True whenever we should show the "typing" indicator at the bottom
5806
5806
  // of the list: either the LLM is actively streaming tokens, or one
5807
5807
  // or more agent messages are queued and waiting for their reveal
5808
5808
  // slot to fire.
5809
5809
  streamingActive() {
5810
- var n, i, a;
5810
+ var n, r, a;
5811
5811
  const e = this.currentConv;
5812
- 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 = (i = this.s) == null ? void 0 : i.messagesByConv) == null ? void 0 : a[e.id]) || []).some(
5812
+ 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(
5813
5813
  (s) => he(s) && !(this.revealedAt[s.id] > 0)
5814
5814
  ) : !1;
5815
5815
  },
5816
5816
  // Internal: the raw persisted list for the current conversation. We
5817
5817
  // watch this to detect new agent messages that need to be paced.
5818
5818
  currentConvMessages() {
5819
- var t, n, i;
5819
+ var t, n, r;
5820
5820
  const e = (t = this.currentConv) == null ? void 0 : t.id;
5821
- return e ? ((i = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : i[e]) || [] : [];
5821
+ return e ? ((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e]) || [] : [];
5822
5822
  },
5823
5823
  pendingApproval() {
5824
5824
  return !this.currentConv || !this.store || this.actionInFlight ? null : this.store.getPendingApproval(this.currentConv.id);
@@ -5835,11 +5835,11 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5835
5835
  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");
5836
5836
  },
5837
5837
  approvalDetail() {
5838
- var i, a, s, r, l, g;
5839
- const e = (s = (a = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : a.pending) == null ? void 0 : s.user_explanation;
5838
+ var r, a, s, i, l, g;
5839
+ const e = (s = (a = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : a.pending) == null ? void 0 : s.user_explanation;
5840
5840
  if (typeof e == "string" && e.trim())
5841
5841
  return e.trim();
5842
- const t = (g = (l = (r = this.pendingApproval) == null ? void 0 : r.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
5842
+ const t = (g = (l = (i = this.pendingApproval) == null ? void 0 : i.payload) == null ? void 0 : l.pending) == null ? void 0 : g.prepared_params;
5843
5843
  if (!t || typeof t != "object") return "";
5844
5844
  const n = Object.entries(t);
5845
5845
  return n.length ? n.slice(0, 2).map(([k, w]) => `${k}: ${w}`).join(" · ") : "";
@@ -5854,7 +5854,41 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5854
5854
  return e ? ((t = e.payload) == null ? void 0 : t.name) || e.text_md || this.t("common.action") : "";
5855
5855
  },
5856
5856
  suggestions() {
5857
- return !this.currentConv || !this.store ? [] : this.streamingActive ? [] : this.pendingForm ? [] : this.store.getLatestSuggestions(this.currentConv.id);
5857
+ return this.currentConv ? this.streamingActive ? [] : this.pendingForm ? [] : this.conversationIsEmpty ? this.starterPrompts : this.store ? this.store.getLatestSuggestions(this.currentConv.id) : [] : [];
5858
+ },
5859
+ // True for drafts and for real conversations that the server
5860
+ // still holds no message for — i.e. the user hasn't sent
5861
+ // anything and the agent hasn't replied yet. The synthetic
5862
+ // welcome bubble is client-side only and intentionally not
5863
+ // counted here.
5864
+ conversationIsEmpty() {
5865
+ var n, r;
5866
+ const e = this.currentConv;
5867
+ return e ? e._draft ? !0 : (((r = (n = this.s) == null ? void 0 : n.messagesByConv) == null ? void 0 : r[e.id]) || []).length === 0 : !1;
5868
+ },
5869
+ // Maps `widget.starter_prompts` ({ title, message }) into the
5870
+ // SuggestionChips shape so they render alongside / in place of
5871
+ // the server-issued suggested_replies. `text` carries the
5872
+ // payload sent on click (the prompt's `message` field), with
5873
+ // the user-visible `title` used as a defensive fallback when
5874
+ // a malformed entry is missing `message`.
5875
+ starterPrompts() {
5876
+ var n;
5877
+ const e = (n = this.widget) == null ? void 0 : n.starter_prompts;
5878
+ if (!Array.isArray(e)) return [];
5879
+ const t = [];
5880
+ for (const r of e) {
5881
+ if (!r || typeof r != "object") continue;
5882
+ const a = typeof r.title == "string" ? r.title.trim() : "";
5883
+ if (!a) continue;
5884
+ const s = typeof r.message == "string" ? r.message.trim() : "";
5885
+ t.push({
5886
+ label: a,
5887
+ text: s || a,
5888
+ kind: "starter"
5889
+ });
5890
+ }
5891
+ return t;
5858
5892
  },
5859
5893
  // Dernier formulaire `request_form` actif sur la conv. Pilote la
5860
5894
  // FormCard. Même slot que l'ApprovalCard — priorité gérée dans
@@ -5874,13 +5908,13 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5874
5908
  return this.approvalReady || !!this.pendingForm || this.showFeedback || this.suggestions.length > 0;
5875
5909
  },
5876
5910
  dateLabel() {
5877
- var n, i, a;
5911
+ var n, r, a;
5878
5912
  const e = this.currentConv;
5879
5913
  let t = /* @__PURE__ */ new Date();
5880
5914
  if (e) {
5881
- const r = ((a = (((i = (n = this.s) == null ? void 0 : n.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;
5882
- if (r) {
5883
- const l = new Date(r);
5915
+ 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;
5916
+ if (i) {
5917
+ const l = new Date(i);
5884
5918
  Number.isNaN(l.getTime()) || (t = l);
5885
5919
  }
5886
5920
  }
@@ -5893,8 +5927,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5893
5927
  // history available, nothing loading) so the loader stays inert
5894
5928
  // until `openConversation` has populated the entry.
5895
5929
  paginationState() {
5896
- var n, i, a;
5897
- const e = (n = this.currentConv) == null ? void 0 : n.id, t = e ? (a = (i = this.s) == null ? void 0 : i.paginationByConv) == null ? void 0 : a[e] : null;
5930
+ var n, r, a;
5931
+ 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;
5898
5932
  return {
5899
5933
  loading: !!(t != null && t.loading),
5900
5934
  hasMore: !!(t != null && t.nextCursor)
@@ -5909,12 +5943,12 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
5909
5943
  // ts comparison in `launcherPeeks`.
5910
5944
  latestUnreads: {
5911
5945
  handler(e) {
5912
- const t = new Set(e.map((r) => r.convId)), n = this.dismissedPeeks || {}, i = Object.keys(n);
5913
- if (!i.length) return;
5946
+ const t = new Set(e.map((i) => i.convId)), n = this.dismissedPeeks || {}, r = Object.keys(n);
5947
+ if (!r.length) return;
5914
5948
  const a = {};
5915
5949
  let s = !1;
5916
- for (const r of i)
5917
- t.has(r) ? a[r] = n[r] : s = !0;
5950
+ for (const i of r)
5951
+ t.has(i) ? a[i] = n[i] : s = !0;
5918
5952
  s && (this.dismissedPeeks = a);
5919
5953
  },
5920
5954
  deep: !0
@@ -6028,8 +6062,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6028
6062
  const t = e == null ? void 0 : e.data;
6029
6063
  if (!(!t || typeof t != "object")) {
6030
6064
  if (t.type === "UPDATE") {
6031
- this.transport && t.payload && this.transport.update(t.payload).catch((i) => {
6032
- console.warn("[messenger] update failed", i);
6065
+ this.transport && t.payload && this.transport.update(t.payload).catch((r) => {
6066
+ console.warn("[messenger] update failed", r);
6033
6067
  });
6034
6068
  return;
6035
6069
  }
@@ -6037,8 +6071,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6037
6071
  this.transport && t.payload && this.transport.context(t.payload);
6038
6072
  return;
6039
6073
  }
6040
- 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((i) => {
6041
- console.warn("[messenger] eager boot failed", i);
6074
+ 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) => {
6075
+ console.warn("[messenger] eager boot failed", r);
6042
6076
  }));
6043
6077
  }
6044
6078
  },
@@ -6072,8 +6106,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6072
6106
  variables: e && typeof e == "object" ? e : void 0
6073
6107
  }), e && typeof e == "object") {
6074
6108
  const t = {};
6075
- for (const [n, i] of Object.entries(e))
6076
- n !== "customer" && i && typeof i == "object" && !Array.isArray(i) && (t[n] = i);
6109
+ for (const [n, r] of Object.entries(e))
6110
+ n !== "customer" && r && typeof r == "object" && !Array.isArray(r) && (t[n] = r);
6077
6111
  Object.keys(t).length > 0 && this.transport.context(t);
6078
6112
  }
6079
6113
  this.setupLiveReveal();
@@ -6099,12 +6133,12 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6099
6133
  return;
6100
6134
  }
6101
6135
  this.floatRO = new ResizeObserver((n) => {
6102
- const i = n[0];
6103
- if (!i) return;
6104
- const a = Math.ceil(i.contentRect.height + 8);
6136
+ const r = n[0];
6137
+ if (!r) return;
6138
+ const a = Math.ceil(r.contentRect.height + 8);
6105
6139
  a !== this.floatHeight && (this.floatHeight = a, this.$nextTick(() => {
6106
- var s, r;
6107
- (r = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || r.call(s);
6140
+ var s, i;
6141
+ (i = (s = this.$refs.messageList) == null ? void 0 : s.scrollToBottom) == null || i.call(s);
6108
6142
  }));
6109
6143
  }), this.floatRO.observe(t);
6110
6144
  }
@@ -6164,7 +6198,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6164
6198
  if (!e) return;
6165
6199
  const t = e.getBoundingClientRect();
6166
6200
  if (!t.width || !t.height) return;
6167
- const n = (((I = this.launcherPeeks) == null ? void 0 : I.length) ?? 0) > 0, i = 16, a = Math.ceil(t.width), s = Math.ceil(t.height), r = (q = (A = this.$el) == null ? void 0 : A.querySelector) == null ? void 0 : q.call(A, ".wm-launcher"), l = (N = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : N.call(M, ".wm-peek"), g = l && l.length ? l[l.length - 1] : null;
6201
+ const n = (((I = this.launcherPeeks) == null ? void 0 : I.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 = (N = (M = this.$el) == null ? void 0 : M.querySelectorAll) == null ? void 0 : N.call(M, ".wm-peek"), g = l && l.length ? l[l.length - 1] : null;
6168
6202
  let k = null;
6169
6203
  if (g) {
6170
6204
  const U = g.getBoundingClientRect();
@@ -6176,19 +6210,19 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6176
6210
  };
6177
6211
  }
6178
6212
  this.notifyParentResize("closed", {
6179
- width: a + i,
6180
- height: s + i,
6181
- launcherWidth: (r == null ? void 0 : r.offsetWidth) || null,
6182
- launcherHeight: (r == null ? void 0 : r.offsetHeight) || null,
6213
+ width: a + r,
6214
+ height: s + r,
6215
+ launcherWidth: (i == null ? void 0 : i.offsetWidth) || null,
6216
+ launcherHeight: (i == null ? void 0 : i.offsetHeight) || null,
6183
6217
  launcherHovered: this.launcherHovered,
6184
6218
  peek: k,
6185
6219
  peekHovered: this.launcherHovered && n
6186
6220
  });
6187
6221
  },
6188
6222
  observeLauncherSize() {
6189
- var n, i;
6223
+ var n, r;
6190
6224
  if (typeof ResizeObserver > "u") return;
6191
- const e = (i = (n = this.$el) == null ? void 0 : n.querySelector) == null ? void 0 : i.call(n, ".wm-launcherWrap");
6225
+ const e = (r = (n = this.$el) == null ? void 0 : n.querySelector) == null ? void 0 : r.call(n, ".wm-launcherWrap");
6192
6226
  if (!e) return;
6193
6227
  this._launcherRo && this._launcherRo.disconnect();
6194
6228
  const t = new ResizeObserver(() => {
@@ -6199,9 +6233,9 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6199
6233
  // Opening straight from a notification card: land on that card's
6200
6234
  // thread rather than whatever was last active.
6201
6235
  async openFromPeek(e) {
6202
- var n, i;
6236
+ var n, r;
6203
6237
  const t = e || ((n = this.latestUnreads[0]) == null ? void 0 : n.convId);
6204
- 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();
6238
+ 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();
6205
6239
  },
6206
6240
  // Stamp the dismissed batch ts for a single conv so its card
6207
6241
  // disappears from the stack until a fresher message arrives.
@@ -6293,10 +6327,10 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6293
6327
  ...this.welcomeRevealedAt,
6294
6328
  [e]: 0
6295
6329
  };
6296
- const n = this.revealPacing, i = t.trim().length, a = Math.min(
6330
+ const n = this.revealPacing, r = t.trim().length, a = Math.min(
6297
6331
  n.maxTypingMs,
6298
- Math.max(n.minTypingMs, i * n.msPerChar)
6299
- ), s = n.firstRevealDelayMs + a, r = setTimeout(() => {
6332
+ Math.max(n.minTypingMs, r * n.msPerChar)
6333
+ ), s = n.firstRevealDelayMs + a, i = setTimeout(() => {
6300
6334
  this.welcomeRevealedAt = {
6301
6335
  ...this.welcomeRevealedAt,
6302
6336
  [e]: Date.now()
@@ -6306,7 +6340,7 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6306
6340
  }, s);
6307
6341
  this.welcomeRevealTimers = {
6308
6342
  ...this.welcomeRevealTimers,
6309
- [e]: r
6343
+ [e]: i
6310
6344
  };
6311
6345
  },
6312
6346
  // Clear pending welcome timers (panel unmount, refresh). Doesn't
@@ -6333,10 +6367,10 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6333
6367
  this.draftConv = null, this.activeConvId = e.id, this.showOnboarding = !1, this.showHistory = !1, this.backToHistory = t;
6334
6368
  try {
6335
6369
  await this.store.openConversation(e.id);
6336
- } catch (i) {
6337
- console.error("[ww-messenger] open conv failed", i);
6370
+ } catch (r) {
6371
+ console.error("[ww-messenger] open conv failed", r);
6338
6372
  }
6339
- const n = this.allConversations.find((i) => i.id === e.id);
6373
+ const n = this.allConversations.find((r) => r.id === e.id);
6340
6374
  n && this.markConvRead(n);
6341
6375
  },
6342
6376
  async onMoreAction(e) {
@@ -6380,8 +6414,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6380
6414
  if (!(!n || n === t.name))
6381
6415
  try {
6382
6416
  await this.store.patchConversation(t.id, { name: n });
6383
- } catch (i) {
6384
- console.error("[ww-messenger] rename failed", i);
6417
+ } catch (r) {
6418
+ console.error("[ww-messenger] rename failed", r);
6385
6419
  }
6386
6420
  },
6387
6421
  // ── Send / suggestion / form / attach / feedback ────────────────
@@ -6389,13 +6423,13 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6389
6423
  let t = this.currentConv;
6390
6424
  if (!t && (this.startConv(), t = this.currentConv, !t) || t._draft && (t = await this.ensureRealConv(), !t))
6391
6425
  return;
6392
- const n = t.id, i = this.pendingAttachments.slice();
6426
+ const n = t.id, r = this.pendingAttachments.slice();
6393
6427
  this.pendingAttachments = [], this.unreadAnchorId = null, this.unreadBoundaryTs = "", await this.store.send(n, e, {
6394
- attachments: i.length ? i : void 0
6428
+ attachments: r.length ? r : void 0
6395
6429
  });
6396
6430
  },
6397
6431
  async onSuggestion(e) {
6398
- const t = e == null ? void 0 : e.label;
6432
+ const t = (e == null ? void 0 : e.text) || (e == null ? void 0 : e.label);
6399
6433
  t && await this.onSend(t);
6400
6434
  },
6401
6435
  async onLoadMore() {
@@ -6412,8 +6446,8 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6412
6446
  if (!(t != null && t.form)) return;
6413
6447
  const n = ht(t.form, e, this.translator);
6414
6448
  if (!n) return;
6415
- let i = this.currentConv;
6416
- i && (i._draft && (i = await this.ensureRealConv(), !i) || await this.store.send(i.id, n, {
6449
+ let r = this.currentConv;
6450
+ r && (r._draft && (r = await this.ensureRealConv(), !r) || await this.store.send(r.id, n, {
6417
6451
  metadata: {
6418
6452
  artifact: mt(
6419
6453
  t.form,
@@ -6519,13 +6553,13 @@ const Xa = /* @__PURE__ */ B(Fa, [["render", Ja], ["__scopeId", "data-v-6d5f94a8
6519
6553
  key: 2,
6520
6554
  class: "wm-attached"
6521
6555
  }, uo = ["aria-label", "onClick"];
6522
- function ho(e, t, n, i, a, s) {
6523
- const r = E("Launcher"), l = E("Header"), g = E("History"), k = E("Onboarding"), w = E("MessageList"), T = E("ApprovalCard"), I = E("FormCard"), A = E("Feedback"), q = E("SuggestionChips"), M = E("Composer"), N = E("MoreMenu"), U = E("RenameDialog");
6556
+ function ho(e, t, n, r, a, s) {
6557
+ const i = E("Launcher"), l = E("Header"), g = E("History"), k = E("Onboarding"), w = E("MessageList"), T = E("ApprovalCard"), I = E("FormCard"), A = E("Feedback"), q = E("SuggestionChips"), M = E("Composer"), N = E("MoreMenu"), U = E("RenameDialog");
6524
6558
  return c(), d("div", {
6525
6559
  class: R(["wm-root", `wm-root--${n.displayMode}`]),
6526
6560
  style: z(s.rootStyle)
6527
6561
  }, [
6528
- !a.isOpen && !s.isEmbedded ? (c(), P(r, {
6562
+ !a.isOpen && !s.isEmbedded ? (c(), P(i, {
6529
6563
  key: 0,
6530
6564
  "unread-count": s.unreadCount,
6531
6565
  peeks: s.launcherPeeks,
@@ -6762,7 +6796,7 @@ function ho(e, t, n, i, a, s) {
6762
6796
  ], 6)) : b("", !0)
6763
6797
  ], 6);
6764
6798
  }
6765
- const _o = /* @__PURE__ */ B(Qa, [["render", ho], ["__scopeId", "data-v-f5e554c2"]]), go = "0.5.57";
6799
+ const _o = /* @__PURE__ */ B(Qa, [["render", ho], ["__scopeId", "data-v-79d619be"]]), go = "0.5.59";
6766
6800
  export {
6767
6801
  oe as AIAvatar,
6768
6802
  be as AVATAR_COLORS,