@pagelines/sdk 1.0.654 → 1.0.655

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.
@@ -1,14 +1,14 @@
1
- var cs = Object.defineProperty;
2
- var fa = (a, t, e) => t in a ? cs(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var u = (a, t) => cs(a, "name", { value: t, configurable: !0 });
4
- var z = (a, t, e) => fa(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as Me, openBlock as h, createElementBlock as f, createElementVNode as b, normalizeClass as R, ref as ge, computed as T, shallowRef as It, watch as Kt, createCommentVNode as W, renderSlot as fn, onMounted as Yt, unref as on, Fragment as se, toDisplayString as j, reactive as ma, onUnmounted as zs, createBlock as ut, Teleport as ga, createVNode as Qe, Transition as Ns, withCtx as $n, withDirectives as Ps, normalizeStyle as K, createTextVNode as nt, vShow as va, nextTick as Bs, renderList as ve, onBeforeUnmount as Fs, withModifiers as Oe, vModelText as xa, withKeys as Ft } from "vue";
6
- import { SettingsObject as Us, Agent as cn, CHAT_ISSUE_COPY as ba, getDefaultAvatarUrl as Pn, parseChatVisualFencePayload as ya, createLogger as ka } from "@pagelines/core";
1
+ var os = Object.defineProperty;
2
+ var pa = (a, t, e) => t in a ? os(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var u = (a, t) => os(a, "name", { value: t, configurable: !0 });
4
+ var P = (a, t, e) => pa(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as Me, openBlock as h, createElementBlock as f, createElementVNode as y, normalizeClass as _, ref as ge, computed as T, shallowRef as It, watch as Kt, createCommentVNode as G, renderSlot as fn, onMounted as Yt, unref as on, Fragment as se, toDisplayString as W, reactive as fa, onUnmounted as Os, createBlock as mt, Teleport as ma, createVNode as Je, Transition as ga, withCtx as zs, withDirectives as Ns, normalizeStyle as K, createTextVNode as nt, vShow as va, nextTick as Ps, renderList as ve, onBeforeUnmount as Fs, withModifiers as Oe, vModelText as xa, withKeys as Bt } from "vue";
6
+ import { SettingsObject as Bs, Agent as cn, CHAT_ISSUE_COPY as ba, getDefaultAvatarUrl as Nn, parseChatVisualFencePayload as ya, createLogger as ka } from "@pagelines/core";
7
7
  import { P as wa } from "./sdkClient.js";
8
8
  const Ta = { class: "spinner max-w-sm" }, Sa = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, us = /* @__PURE__ */ Me({
11
+ }, cs = /* @__PURE__ */ Me({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
@@ -17,8 +17,8 @@ const Ta = { class: "spinner max-w-sm" }, Sa = {
17
17
  setup(a) {
18
18
  return (t, e) => (h(), f("div", Ta, [
19
19
  (h(), f("svg", Sa, [
20
- b("circle", {
21
- class: R([a.colorMode, "ring-path"]),
20
+ y("circle", {
21
+ class: _([a.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -44,22 +44,22 @@ function _a() {
44
44
  return typeof MediaRecorder > "u" ? "" : ["audio/webm;codecs=opus", "audio/mp4", "audio/webm"].find((t) => MediaRecorder.isTypeSupported?.(t)) || "";
45
45
  }
46
46
  u(_a, "recorderMimeType");
47
- const Kn = class Kn extends Us {
47
+ const qn = class qn extends Bs {
48
48
  constructor(e) {
49
49
  super("VoiceRecorderController", e);
50
- z(this, "state", ge({ phase: "idle", elapsedMs: 0 }));
51
- z(this, "isActive", T(() => this.state.value.phase !== "idle"));
52
- z(this, "isBusy", T(() => this.state.value.phase !== "idle"));
53
- z(this, "elapsedLabel", T(() => Aa({ ms: this.state.value.elapsedMs })));
54
- z(this, "statusText", T(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send"));
55
- z(this, "recorder");
56
- z(this, "stream");
57
- z(this, "chunks", []);
58
- z(this, "timer");
59
- z(this, "startedAt", 0);
60
- z(this, "cancelOnStop", !1);
61
- z(this, "stopAfterStart", !1);
62
- z(this, "startToken", 0);
50
+ P(this, "state", ge({ phase: "idle", elapsedMs: 0 }));
51
+ P(this, "isActive", T(() => this.state.value.phase !== "idle"));
52
+ P(this, "isBusy", T(() => this.state.value.phase !== "idle"));
53
+ P(this, "elapsedLabel", T(() => Aa({ ms: this.state.value.elapsedMs })));
54
+ P(this, "statusText", T(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send"));
55
+ P(this, "recorder");
56
+ P(this, "stream");
57
+ P(this, "chunks", []);
58
+ P(this, "timer");
59
+ P(this, "startedAt", 0);
60
+ P(this, "cancelOnStop", !1);
61
+ P(this, "stopAfterStart", !1);
62
+ P(this, "startToken", 0);
63
63
  }
64
64
  get canUseBrowserRecording() {
65
65
  return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
@@ -155,20 +155,21 @@ const Kn = class Kn extends Us {
155
155
  (this.settings.clearInterval ?? clearInterval)(e);
156
156
  }
157
157
  };
158
- u(Kn, "VoiceRecorderController");
159
- let Dn = Kn;
158
+ u(qn, "VoiceRecorderController");
159
+ let $n = qn;
160
160
  function Ra(a) {
161
161
  return a.turnOutcome === "failed" ? "failed" : a.turnOutcome === "stopped" ? "stopped" : a.sender === "system" ? "failed" : "completed";
162
162
  }
163
163
  u(Ra, "durableJournalOutcome");
164
- const Tt = {
164
+ const pt = {
165
165
  waiting: "Waiting for results",
166
+ finishing: "Finishing up",
166
167
  completed: "Work complete",
167
168
  failed: "Couldn’t finish",
168
169
  stopped: "Stopped",
169
170
  notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
170
- leaveHint: "You can leave this chat while I work."
171
- }, Hs = 15e3, Ca = 6e4, Sn = 3;
171
+ leaveHint: "Taking longer than usual. You can leave this chat while I work."
172
+ }, Us = 15e3, Ca = 6e4, Sn = 3;
172
173
  function un(a) {
173
174
  if (!a)
174
175
  return;
@@ -180,15 +181,15 @@ function $t(a) {
180
181
  return un(a.endedAt) ?? un(a.startedAt) ?? 0;
181
182
  }
182
183
  u($t, "eventMs");
183
- function Ln(a, t) {
184
+ function Dn(a, t) {
184
185
  return $t(a) - $t(t);
185
186
  }
186
- u(Ln, "byEvent");
187
+ u(Dn, "byEvent");
187
188
  function nn(a, t) {
188
- const e = a.filter((i) => i.status === "completed" || i.status === "failed" && !!i.note).filter((i) => !t.has(i.activityId)).slice().sort(Ln), n = [];
189
+ const e = a.filter((i) => i.status === "completed" || i.status === "failed" && !!i.note).filter((i) => !t.has(i.activityId)).slice().sort(Dn), n = [];
189
190
  for (const i of e) {
190
191
  const s = i.status === "completed" ? "done" : "failed", l = n[n.length - 1];
191
- if (s === "done" && l?.tone === "done" && l.label === i.label && $t(i) - l.lastMs <= Hs) {
192
+ if (s === "done" && l?.tone === "done" && l.label === i.label && $t(i) - l.lastMs <= Us) {
192
193
  l.count += 1, l.lastMs = $t(i);
193
194
  continue;
194
195
  }
@@ -209,74 +210,77 @@ function An(a) {
209
210
  };
210
211
  }
211
212
  u(An, "splitRows");
212
- function ds(a) {
213
- const { activities: t, outcome: e, nowMs: n, canNotifyOnCompletion: i, streamingText: s = !1 } = a;
213
+ function us(a) {
214
+ const { activities: t, outcome: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s, includeFailureNote: l = !0 } = a;
214
215
  if (e === "completed")
215
216
  return {
216
217
  outcome: e,
217
218
  visibleRows: [],
218
219
  hiddenRows: nn(t, /* @__PURE__ */ new Set()),
219
- terminal: { id: "work-complete", tone: "completed", label: Tt.completed }
220
+ terminal: { id: "work-complete", tone: "completed", label: pt.completed }
220
221
  };
221
222
  if (e === "failed") {
222
- const S = t.filter((H) => H.status === "failed").sort(Ln).pop(), B = /* @__PURE__ */ new Set();
223
- S && B.add(S.activityId);
224
- const { visibleRows: N, hiddenRows: U } = An(nn(t, B));
223
+ const N = t.filter((j) => j.status === "failed").sort(Dn).pop(), z = /* @__PURE__ */ new Set();
224
+ N && z.add(N.activityId);
225
+ const { visibleRows: F, hiddenRows: H } = An(nn(t, z));
225
226
  return {
226
227
  outcome: e,
227
- visibleRows: N,
228
- hiddenRows: U,
228
+ visibleRows: F,
229
+ hiddenRows: H,
229
230
  terminal: {
230
231
  id: "work-failed",
231
232
  tone: "failed",
232
- label: Tt.failed,
233
- ...S?.note ? { note: S.note } : {}
233
+ label: pt.failed,
234
+ ...l && N?.note ? { note: N.note } : {}
234
235
  }
235
236
  };
236
237
  }
237
238
  if (e === "stopped") {
238
- const { visibleRows: S, hiddenRows: B } = An(nn(t, /* @__PURE__ */ new Set()));
239
+ const { visibleRows: N, hiddenRows: z } = An(nn(t, /* @__PURE__ */ new Set()));
239
240
  return {
240
241
  outcome: e,
241
- visibleRows: S,
242
- hiddenRows: B,
243
- terminal: { id: "work-stopped", tone: "stopped", label: Tt.stopped }
242
+ visibleRows: N,
243
+ hiddenRows: z,
244
+ terminal: { id: "work-stopped", tone: "stopped", label: pt.stopped }
244
245
  };
245
246
  }
246
- const { visibleRows: l, hiddenRows: o } = An(nn(t, /* @__PURE__ */ new Set())), p = t.filter((S) => S.status === "started").sort(Ln).pop(), d = t.reduce((S, B) => Math.max(S, $t(B)), Number.NEGATIVE_INFINITY), k = Number.isFinite(d) ? d : n, E = t.reduce((S, B) => {
247
- const N = un(B.startedAt) ?? un(B.endedAt);
248
- return N === void 0 ? S : Math.min(S, N);
249
- }, Number.POSITIVE_INFINITY), x = k + Hs, w = (Number.isFinite(E) ? E : k) + Ca, M = !s && n >= x, _ = p || M ? {
250
- id: p?.activityId ?? "work-active",
247
+ const { visibleRows: o, hiddenRows: p } = An(nn(t, /* @__PURE__ */ new Set())), d = t.filter((N) => N.status === "started").sort(Dn).pop(), k = t.reduce(
248
+ (N, z) => Math.max(N, $t(z)),
249
+ s ?? Number.NEGATIVE_INFINITY
250
+ ), A = Number.isFinite(k) ? k : n, x = t.reduce((N, z) => {
251
+ const F = un(z.startedAt) ?? un(z.endedAt);
252
+ return F === void 0 ? N : Math.min(N, F);
253
+ }, Number.POSITIVE_INFINITY), w = A + Us, C = (Number.isFinite(x) ? x : A) + Ca, E = n >= w, $ = d || E ? {
254
+ id: d?.activityId ?? "work-active",
251
255
  tone: "active",
252
- label: M ? Tt.waiting : p.label
253
- } : void 0, D = M && n >= w ? i ? Tt.notifyHint : Tt.leaveHint : void 0, J = [x, w].filter((S) => S > n).sort((S, B) => S - B)[0];
256
+ label: E ? d ? pt.waiting : pt.finishing : d.label
257
+ } : void 0, Q = E && n >= C ? i ? pt.notifyHint : pt.leaveHint : void 0, D = [w, C].filter((N) => N > n).sort((N, z) => N - z)[0];
254
258
  return {
255
259
  outcome: e,
256
- visibleRows: l,
257
- hiddenRows: o,
258
- ..._ ? { terminal: _ } : {},
259
- ...D ? { hint: D } : {},
260
- ...J !== void 0 ? { nextBoundaryAtMs: J } : {}
260
+ visibleRows: o,
261
+ hiddenRows: p,
262
+ ...$ ? { terminal: $ } : {},
263
+ ...Q ? { hint: Q } : {},
264
+ ...D !== void 0 ? { nextBoundaryAtMs: D } : {}
261
265
  };
262
266
  }
263
- u(ds, "buildWorkJournalModel");
267
+ u(us, "buildWorkJournalModel");
264
268
  const Ma = [
265
269
  { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
266
270
  { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
267
- ], js = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ia = /* @__PURE__ */ new Set([...js, "EMPTY_STREAM", "RATE_LIMIT"]), Ws = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), $a = {
271
+ ], Hs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ia = /* @__PURE__ */ new Set([...Hs, "EMPTY_STREAM", "RATE_LIMIT"]), js = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), $a = {
268
272
  CREDIT_LIMIT: "billing_budget_reached",
269
273
  OVERAGE_CAP: "billing_runaway_cap"
270
274
  };
271
275
  function Da(a) {
272
276
  if (!(a.bucket !== void 0 || Ia.has(a.code)))
273
277
  return { surface: "hard" };
274
- const e = a.bucket ?? (js.has(a.code) ? "account" : "error"), n = {
278
+ const e = a.bucket ?? (Hs.has(a.code) ? "account" : "error"), n = {
275
279
  ...a.actionLabel ? { actionLabel: a.actionLabel } : {},
276
280
  ...a.actionUrl ? { actionUrl: a.actionUrl } : {},
277
281
  ...a.help ? { help: a.help } : {}
278
282
  };
279
- return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : Ws.has(a.code) ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "agent_deleted" } : { surface: "transient", issue: { code: a.code, message: a.error, ...n } };
283
+ return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : js.has(a.code) ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "agent_deleted" } : { surface: "transient", issue: { code: a.code, message: a.error, ...n } };
280
284
  }
281
285
  u(Da, "presentChatStreamError");
282
286
  function La(a) {
@@ -284,35 +288,31 @@ function La(a) {
284
288
  return t ? ba[t].oneLine : a.error;
285
289
  }
286
290
  u(La, "transcriptMessageForChatStreamError");
287
- const Yn = class Yn extends Us {
291
+ const Kn = class Kn extends Bs {
288
292
  constructor(e) {
289
293
  super("AgentChatController", e);
290
- z(this, "isTextMode", !1);
291
- z(this, "lastMessage", { hash: "", time: 0 });
292
- z(this, "isConnecting", !1);
293
- z(this, "activeTurnGeneration", 0);
294
+ P(this, "isTextMode", !1);
295
+ P(this, "lastMessage", { hash: "", time: 0 });
296
+ P(this, "isConnecting", !1);
297
+ P(this, "activeTurnGeneration", 0);
294
298
  // One projection clock, advanced only when a scheduled boundary fires — never
295
299
  // a ticking counter. buildWorkJournalModel reads this to decide the slow/long
296
300
  // transitions; it never creates a row (plans/bots/bot-tool-calling.md).
297
- z(this, "boundaryTimer");
298
- z(this, "nowMs", It(Date.now()));
299
- z(this, "toolActivityTiming", It({}));
300
- // The assistant reply is streaming under the live journal. Deltas are progress
301
- // (plans/bots/bot-tool-calling.md § "deltas are progress"): while this is true
302
- // the journal suppresses its wait tip. Flips false when a new tool starts after
303
- // text began, and resets at each turn boundary.
304
- z(this, "isStreamingText", It(!1));
301
+ P(this, "boundaryTimer");
302
+ P(this, "nowMs", It(Date.now()));
303
+ P(this, "toolActivityTiming", It({}));
304
+ P(this, "lastVisibleProgressAtMs", It());
305
305
  // Chat conversation tracking (server-managed persistence)
306
- z(this, "conversationId");
307
- z(this, "textState", ge({
306
+ P(this, "conversationId");
307
+ P(this, "textState", ge({
308
308
  isActive: !1,
309
309
  isConnected: !1,
310
310
  isThinking: !1,
311
311
  connectionStatus: "disconnected"
312
312
  }));
313
- z(this, "agentMode", ge("self"));
314
- z(this, "sharedMessages", ge([]));
315
- z(this, "composerState", ge({
313
+ P(this, "agentMode", ge("self"));
314
+ P(this, "sharedMessages", ge([]));
315
+ P(this, "composerState", ge({
316
316
  text: "",
317
317
  pendingAttachments: [],
318
318
  isUploading: !1
@@ -323,24 +323,24 @@ const Yn = class Yn extends Us {
323
323
  * the two are mutually exclusive). Transient live work is always `running`;
324
324
  * Task 7 owns `stopped`.
325
325
  */
326
- z(this, "workJournal", T(() => {
326
+ P(this, "workJournal", T(() => {
327
327
  const e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
328
328
  if (!e)
329
329
  return;
330
330
  const n = this.textState.value.toolActivities;
331
331
  if (n?.length)
332
- return ds({
332
+ return us({
333
333
  activities: n,
334
334
  outcome: e,
335
335
  nowMs: this.nowMs.value,
336
336
  canNotifyOnCompletion: !1,
337
- streamingText: this.isStreamingText.value
337
+ lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
338
338
  });
339
339
  }));
340
- z(this, "canUseComposer", T(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking));
341
- z(this, "canAttachFile", T(() => !!this.settings.uploadFileFn));
342
- z(this, "canRecordAudio", T(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0));
343
- z(this, "voiceRecorder", new Dn({
340
+ P(this, "canUseComposer", T(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking));
341
+ P(this, "canAttachFile", T(() => !!this.settings.uploadFileFn));
342
+ P(this, "canRecordAudio", T(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0));
343
+ P(this, "voiceRecorder", new $n({
344
344
  getCanRecord: /* @__PURE__ */ u(() => this.canRecordAudio.value, "getCanRecord"),
345
345
  getUploadFn: /* @__PURE__ */ u(() => {
346
346
  const e = this.settings.uploadFileFn;
@@ -348,10 +348,10 @@ const Yn = class Yn extends Us {
348
348
  }, "getUploadFn"),
349
349
  getChatController: /* @__PURE__ */ u(() => this, "getChatController")
350
350
  }));
351
- z(this, "canSend", T(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value));
352
- z(this, "canStop", T(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value));
353
- z(this, "composerAction", T(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle"));
354
- z(this, "_agent");
351
+ P(this, "canSend", T(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value));
352
+ P(this, "canStop", T(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value));
353
+ P(this, "composerAction", T(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle"));
354
+ P(this, "_agent");
355
355
  this._agent = e.agent instanceof cn ? e.agent : new cn({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
356
356
  }
357
357
  get chatEnabled() {
@@ -458,11 +458,11 @@ Current User:
458
458
  updateState(e, n) {
459
459
  e.value = { ...e.value, ...n };
460
460
  }
461
- resetToolActivityTiming() {
462
- this.toolActivityTiming.value = {}, this.clearBoundaryTimer();
461
+ resetWorkJournalTiming() {
462
+ this.toolActivityTiming.value = {}, this.lastVisibleProgressAtMs.value = void 0, this.clearBoundaryTimer();
463
463
  }
464
464
  resetState() {
465
- this.resetToolActivityTiming(), this.isStreamingText.value = !1, this.updateState(this.textState, {
465
+ this.resetWorkJournalTiming(), this.updateState(this.textState, {
466
466
  isActive: !1,
467
467
  isConnected: !1,
468
468
  isThinking: !1,
@@ -541,11 +541,12 @@ Current User:
541
541
  */
542
542
  workJournalFor(e) {
543
543
  if (e.activities?.length)
544
- return ds({
544
+ return us({
545
545
  activities: e.activities,
546
546
  outcome: e.outcome,
547
547
  nowMs: this.nowMs.value,
548
- canNotifyOnCompletion: !1
548
+ canNotifyOnCompletion: !1,
549
+ includeFailureNote: e.includeFailureNote
549
550
  });
550
551
  }
551
552
  setupModeWatcher() {
@@ -637,60 +638,66 @@ Current User:
637
638
  this.handleError(new Error("Agent handle required for chat"));
638
639
  return;
639
640
  }
640
- this.addMessage(e, "user", n), this.resetToolActivityTiming(), this.isStreamingText.value = !1, this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0, turnOutcome: void 0 });
641
+ this.addMessage(e, "user", n), this.resetWorkJournalTiming(), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0, turnOutcome: void 0 });
641
642
  const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
642
643
  let p = !1, d = !1;
643
- const k = /* @__PURE__ */ u(() => l === this.activeTurnGeneration, "isCurrentTurn"), E = /* @__PURE__ */ u((S, B = "assistant") => {
644
+ const k = /* @__PURE__ */ u(() => l === this.activeTurnGeneration, "isCurrentTurn"), A = /* @__PURE__ */ u((D, N = "assistant") => {
644
645
  if (!k())
645
646
  return;
646
- this.updateState(this.textState, { workingDescription: void 0 }), B === "assistant" && (this.isStreamingText.value = !0), p || (p = !0, this.sharedMessages.value = [
647
+ this.updateState(this.textState, { workingDescription: void 0 }), N === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.sharedMessages.value = [
647
648
  ...this.sharedMessages.value,
648
- { id: o, text: "", sender: B === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
649
+ { id: o, text: "", sender: N === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
649
650
  ]);
650
- const N = this.sharedMessages.value, U = N[N.length - 1];
651
- U?.id === o && (U.text += S, this.sharedMessages.value = [...N]);
652
- }, "onDelta"), x = /* @__PURE__ */ u((S) => {
651
+ const z = this.sharedMessages.value, F = z[z.length - 1];
652
+ F?.id === o && (F.text += D, this.sharedMessages.value = [...z]);
653
+ }, "onDelta"), x = /* @__PURE__ */ u((D) => {
653
654
  if (!k())
654
655
  return;
655
- d = !0, p = !0, this.updateState(this.textState, { workingDescription: void 0 });
656
- const B = S.sender === "system" || S.turnOutcome === "failed" ? "failed" : "completed";
657
- this.finishToolActivities(B), B === "failed" && this.updateState(this.textState, { turnOutcome: "failed" });
658
- const N = this.sharedMessages.value, U = N.findIndex((H) => H.id === S.id);
659
- if (U >= 0)
656
+ d = !0, p = !0;
657
+ const N = D.sender === "system" || D.turnOutcome === "failed" ? "failed" : "completed";
658
+ this.finishToolActivities(N);
659
+ const z = this.textState.value.toolActivities, F = D.toolActivities?.length || !z?.length ? D : { ...D, toolActivities: z };
660
+ this.updateState(this.textState, {
661
+ workingDescription: void 0,
662
+ toolActivities: [],
663
+ turnOutcome: void 0
664
+ });
665
+ const H = this.sharedMessages.value, j = H.findIndex((re) => re.id === F.id);
666
+ if (j >= 0)
660
667
  this.sharedMessages.value = [
661
- ...N.slice(0, U),
662
- S,
663
- ...N.slice(U + 1)
668
+ ...H.slice(0, j),
669
+ F,
670
+ ...H.slice(j + 1)
664
671
  ];
665
672
  else {
666
- const H = N[N.length - 1];
667
- this.sharedMessages.value = H?.id === o ? [...N.slice(0, -1), S] : [...N, S];
673
+ const re = H[H.length - 1];
674
+ this.sharedMessages.value = re?.id === o ? [...H.slice(0, -1), F] : [...H, F];
668
675
  }
669
- S.sender === "system" && S.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : S.sender === "system" && S.issue?.code && Ws.has(S.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
670
- }, "onMessage"), w = /* @__PURE__ */ u((S) => {
676
+ F.sender === "system" && F.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : F.sender === "system" && F.issue?.code && js.has(F.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
677
+ }, "onMessage"), w = /* @__PURE__ */ u((D) => {
671
678
  if (!k())
672
679
  return;
673
680
  if (!p && !d) {
674
- M("empty_stream — assistant returned no content");
681
+ C("empty_stream — assistant returned no content");
675
682
  return;
676
683
  }
677
684
  this.finishToolActivities("completed");
678
- const B = this.sharedMessages.value, N = B[B.length - 1];
679
- if (N?.id === o && N.sender === "agent" && N.text) {
680
- let U = N.text;
685
+ const N = this.sharedMessages.value, z = N[N.length - 1];
686
+ if (z?.id === o && z.sender === "agent" && z.text) {
687
+ let F = z.text;
681
688
  for (const H of Ma)
682
- H.pattern.test(U) && (console.debug(`[chat] filtered directive: ${H.label}`), U = U.replace(H.pattern, "").trim(), H.pattern.lastIndex = 0);
683
- U ? U !== N.text && (N.text = U, this.sharedMessages.value = [...B]) : this.sharedMessages.value = B.slice(0, -1);
689
+ H.pattern.test(F) && (console.debug(`[chat] filtered directive: ${H.label}`), F = F.replace(H.pattern, "").trim(), H.pattern.lastIndex = 0);
690
+ F ? F !== z.text && (z.text = F, this.sharedMessages.value = [...N]) : this.sharedMessages.value = N.slice(0, -1);
684
691
  }
685
- S && (this.conversationId = S), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
686
- }, "onDone"), M = /* @__PURE__ */ u((S) => {
692
+ D && (this.conversationId = D), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
693
+ }, "onDone"), C = /* @__PURE__ */ u((D) => {
687
694
  if (!k())
688
695
  return;
689
- if (typeof S == "object" && S.code === "TURN_ACTIVE") {
690
- const V = this.sharedMessages.value;
691
- for (let he = V.length - 1; he >= 0; he--)
692
- if (V[he].sender === "user" && V[he].text === e) {
693
- this.sharedMessages.value = [...V.slice(0, he), ...V.slice(he + 1)];
696
+ if (typeof D == "object" && D.code === "TURN_ACTIVE") {
697
+ const j = this.sharedMessages.value;
698
+ for (let re = j.length - 1; re >= 0; re--)
699
+ if (j[re].sender === "user" && j[re].text === e) {
700
+ this.sharedMessages.value = [...j.slice(0, re), ...j.slice(re + 1)];
694
701
  break;
695
702
  }
696
703
  this.composerState.value.text || (this.composerState.value = {
@@ -699,30 +706,30 @@ Current User:
699
706
  pendingAttachments: n ?? []
700
707
  }), this.updateState(this.textState, {
701
708
  isThinking: !1,
702
- transientIssue: { code: S.code, message: S.error }
709
+ transientIssue: { code: D.code, message: D.error }
703
710
  });
704
711
  return;
705
712
  }
706
713
  this.updateState(this.textState, { workingDescription: void 0, turnOutcome: "failed" }), this.finishToolActivities("failed");
707
- const B = this.sharedMessages.value, N = B[B.length - 1];
708
- if (N?.id === o && !N.text && (this.sharedMessages.value = B.slice(0, -1)), typeof S == "object" && S.code && S.error) {
709
- const V = Da(S);
710
- V.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: V.issue }) : V.surface === "transcript" ? (this.addMessage(La(S), "system", void 0, V.issue), this.updateState(this.textState, {
714
+ const N = this.sharedMessages.value, z = N[N.length - 1];
715
+ if (z?.id === o && !z.text && (this.sharedMessages.value = N.slice(0, -1)), typeof D == "object" && D.code && D.error) {
716
+ const j = Da(D);
717
+ j.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: j.issue }) : j.surface === "transcript" ? (this.addMessage(La(D), "system", void 0, j.issue), this.updateState(this.textState, {
711
718
  isThinking: !1,
712
- ...V.sendBlockedReason ? { sendBlockedReason: V.sendBlockedReason } : {}
713
- })) : this.handleError(new Error(S.error));
719
+ ...j.sendBlockedReason ? { sendBlockedReason: j.sendBlockedReason } : {}
720
+ })) : this.handleError(new Error(D.error));
714
721
  return;
715
722
  }
716
- const U = typeof S == "string" ? S : S.error, H = this.mapChatError(U);
717
- this.isTransientError(U) ? (this.logger.warn("Chat turn failed (transient):", { raw: U, friendly: H }), this.addMessage(H, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(H), U);
718
- }, "onError"), _ = /* @__PURE__ */ u((S) => {
723
+ const F = typeof D == "string" ? D : D.error, H = this.mapChatError(F);
724
+ this.isTransientError(F) ? (this.logger.warn("Chat turn failed (transient):", { raw: F, friendly: H }), this.addMessage(H, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(H), F);
725
+ }, "onError"), E = /* @__PURE__ */ u((D) => {
719
726
  if (!k())
720
727
  return;
721
- const B = S.trim();
722
- this.updateState(this.textState, { workingDescription: B || void 0 });
723
- }, "onStatus"), D = /* @__PURE__ */ u((S) => {
724
- k() && (S.status === "started" && (this.isStreamingText.value = !1), this.updateToolActivity(S));
725
- }, "onToolActivity"), J = /* @__PURE__ */ u(() => {
728
+ const N = D.trim();
729
+ this.updateState(this.textState, { workingDescription: N || void 0 });
730
+ }, "onStatus"), $ = /* @__PURE__ */ u((D) => {
731
+ k() && (this.lastVisibleProgressAtMs.value = Date.now(), this.updateToolActivity(D));
732
+ }, "onToolActivity"), Q = /* @__PURE__ */ u(() => {
726
733
  k() && this.updateState(this.textState, { workingDescription: void 0 });
727
734
  }, "onWorkingEnd");
728
735
  try {
@@ -731,29 +738,29 @@ Current User:
731
738
  attachments: n,
732
739
  conversationId: this.conversationId,
733
740
  history: this.buildHistory(),
734
- onDelta: E,
741
+ onDelta: A,
735
742
  onMessage: x,
736
743
  onDone: w,
737
- onError: M,
738
- onStatus: _,
739
- onToolActivity: D,
740
- onWorkingEnd: J
744
+ onError: C,
745
+ onStatus: E,
746
+ onToolActivity: $,
747
+ onWorkingEnd: Q
741
748
  }) : s.chat.chatStreamPublic({
742
749
  handle: this._agent.handle.value,
743
750
  message: e,
744
751
  attachments: n,
745
752
  anonymousId: s.user.generateAnonId(),
746
753
  context: this.getDynamicSettings().context || void 0,
747
- onDelta: E,
754
+ onDelta: A,
748
755
  onMessage: x,
749
756
  onDone: w,
750
- onError: M,
751
- onStatus: _,
752
- onToolActivity: D,
753
- onWorkingEnd: J
757
+ onError: C,
758
+ onStatus: E,
759
+ onToolActivity: $,
760
+ onWorkingEnd: Q
754
761
  }));
755
- } catch (S) {
756
- M(S.message || "Something went wrong");
762
+ } catch (D) {
763
+ C(D.message || "Something went wrong");
757
764
  }
758
765
  }
759
766
  async stopChatTurn() {
@@ -796,8 +803,8 @@ Current User:
796
803
  this.clearBoundaryTimer(), this.voiceRecorder.teardown(), await this.endConversation();
797
804
  }
798
805
  };
799
- u(Yn, "AgentChatController");
800
- let hs = Yn;
806
+ u(Kn, "AgentChatController");
807
+ let ds = Kn;
801
808
  function sn(a) {
802
809
  if (!a)
803
810
  return;
@@ -805,19 +812,19 @@ function sn(a) {
805
812
  return Number.isFinite(t) ? t : void 0;
806
813
  }
807
814
  u(sn, "parseToolActivityMs");
808
- function ps(a) {
815
+ function hs(a) {
809
816
  return a ? typeof a == "string" ? a : a.src || "" : "";
810
817
  }
811
- u(ps, "getImageSrc");
818
+ u(hs, "getImageSrc");
812
819
  function ho(a) {
813
- return ps(a.cover) || ps(a.avatar) || Pn(a.name);
820
+ return hs(a.cover) || hs(a.avatar) || Nn(a.name);
814
821
  }
815
822
  u(ho, "getAgentAvatarUrl");
816
- function fs(a) {
823
+ function ps(a) {
817
824
  const t = a.target;
818
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Pn());
825
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Nn());
819
826
  }
820
- u(fs, "handleImageError");
827
+ u(ps, "handleImageError");
821
828
  function po(a) {
822
829
  const { template: t, agent: e } = a;
823
830
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
@@ -851,23 +858,23 @@ const Oa = {
851
858
  lg: "size-5"
852
859
  })[a.size]);
853
860
  return (i, s) => (h(), f("button", {
854
- class: R(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
861
+ class: _(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
855
862
  }, [
856
863
  a.loading ? (h(), f("div", Oa, [...s[0] || (s[0] = [
857
- b("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
858
- ])])) : W("", !0),
859
- b("span", {
860
- class: R(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
864
+ y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
865
+ ])])) : G("", !0),
866
+ y("span", {
867
+ class: _(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
861
868
  }, [
862
869
  a.icon ? (h(), f("i", {
863
870
  key: 0,
864
- class: R([a.icon, n.value])
865
- }, null, 2)) : W("", !0),
871
+ class: _([a.icon, n.value])
872
+ }, null, 2)) : G("", !0),
866
873
  fn(i.$slots, "default"),
867
874
  a.iconAfter ? (h(), f("i", {
868
875
  key: 1,
869
- class: R([a.iconAfter, n.value])
870
- }, null, 2)) : W("", !0)
876
+ class: _([a.iconAfter, n.value])
877
+ }, null, 2)) : G("", !0)
871
878
  ], 2)
872
879
  ], 2));
873
880
  }
@@ -929,7 +936,7 @@ const Oa = {
929
936
  onInput: l
930
937
  }, null, 40, Na));
931
938
  }
932
- }), Pa = { class: "relative flex-shrink-0" }, Ba = ["src", "alt"], Fa = { class: "absolute top-1 right-1" }, Ua = {
939
+ }), Pa = { class: "relative flex-shrink-0" }, Fa = ["src", "alt"], Ba = { class: "absolute top-1 right-1" }, Ua = {
933
940
  key: 1,
934
941
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
935
942
  }, Ha = { class: "min-w-0" }, ja = /* @__PURE__ */ Me({
@@ -942,45 +949,45 @@ const Oa = {
942
949
  },
943
950
  setup(a) {
944
951
  return (t, e) => (h(), f("div", {
945
- class: R(["flex gap-4", [
952
+ class: _(["flex gap-4", [
946
953
  a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
947
954
  ]])
948
955
  }, [
949
- b("div", Pa, [
950
- b("div", {
951
- class: R(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
956
+ y("div", Pa, [
957
+ y("div", {
958
+ class: _(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
952
959
  }, [
953
- b("img", {
960
+ y("img", {
954
961
  src: a.agent.avatarUrl.value,
955
962
  alt: a.agent.displayName.value,
956
963
  class: "w-full h-full object-cover",
957
964
  onError: e[0] || (e[0] = //@ts-ignore
958
- (...n) => on(fs) && on(fs)(...n))
959
- }, null, 40, Ba)
965
+ (...n) => on(ps) && on(ps)(...n))
966
+ }, null, 40, Fa)
960
967
  ], 2),
961
- b("div", Fa, [
968
+ y("div", Ba, [
962
969
  a.isOnline ? (h(), f(se, { key: 0 }, [
963
- e[1] || (e[1] = b("div", {
970
+ e[1] || (e[1] = y("div", {
964
971
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
965
972
  style: { "animation-duration": "3s" }
966
973
  }, null, -1)),
967
- e[2] || (e[2] = b("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
974
+ e[2] || (e[2] = y("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
968
975
  ], 64)) : (h(), f("div", Ua))
969
976
  ])
970
977
  ]),
971
- b("div", Ha, [
972
- b("h1", {
973
- class: R(["font-light text-white mb-1 truncate", [
978
+ y("div", Ha, [
979
+ y("h1", {
980
+ class: _(["font-light text-white mb-1 truncate", [
974
981
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
975
982
  a.layout === "horizontal" ? "text-white/95" : ""
976
983
  ]])
977
- }, j(a.agent.displayName.value), 3),
978
- b("p", {
979
- class: R(["font-light line-clamp-1", [
984
+ }, W(a.agent.displayName.value), 3),
985
+ y("p", {
986
+ class: _(["font-light line-clamp-1", [
980
987
  a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
981
988
  a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
982
989
  ]])
983
- }, j(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
990
+ }, W(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
984
991
  ])
985
992
  ], 2));
986
993
  }
@@ -1000,7 +1007,7 @@ const Oa = {
1000
1007
  direction: { default: "top" }
1001
1008
  },
1002
1009
  setup(a) {
1003
- const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l = ma({
1010
+ const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l = fa({
1004
1011
  left: "0px",
1005
1012
  top: "0px",
1006
1013
  maxWidth: `${a.maxWidth}px`
@@ -1008,27 +1015,27 @@ const Oa = {
1008
1015
  function p() {
1009
1016
  if (!t.value || !e.value)
1010
1017
  return;
1011
- const _ = t.value.getBoundingClientRect(), D = e.value.getBoundingClientRect(), J = 8;
1012
- let S, B;
1018
+ const E = t.value.getBoundingClientRect(), $ = e.value.getBoundingClientRect(), Q = 8;
1019
+ let D, N;
1013
1020
  switch (a.direction) {
1014
1021
  case "bottom":
1015
- S = _.left + window.scrollX + _.width / 2 - D.width / 2, B = _.bottom + window.scrollY + J;
1022
+ D = E.left + window.scrollX + E.width / 2 - $.width / 2, N = E.bottom + window.scrollY + Q;
1016
1023
  break;
1017
1024
  case "top":
1018
- S = _.left + window.scrollX + _.width / 2 - D.width / 2, B = _.top + window.scrollY - D.height - J;
1025
+ D = E.left + window.scrollX + E.width / 2 - $.width / 2, N = E.top + window.scrollY - $.height - Q;
1019
1026
  break;
1020
1027
  case "left":
1021
- S = _.left + window.scrollX - D.width - J, B = _.top + window.scrollY + _.height / 2 - D.height / 2;
1028
+ D = E.left + window.scrollX - $.width - Q, N = E.top + window.scrollY + E.height / 2 - $.height / 2;
1022
1029
  break;
1023
1030
  default:
1024
- S = _.right + window.scrollX + J, B = _.top + window.scrollY + _.height / 2 - D.height / 2;
1031
+ D = E.right + window.scrollX + Q, N = E.top + window.scrollY + E.height / 2 - $.height / 2;
1025
1032
  }
1026
- const N = 8;
1027
- S = Math.max(N, Math.min(S, window.innerWidth - D.width - N)), B = Math.max(N, Math.min(B, window.innerHeight - D.height - N)), l.left = `${S}px`, l.top = `${B}px`;
1033
+ const z = 8;
1034
+ D = Math.max(z, Math.min(D, window.innerWidth - $.width - z)), N = Math.max(z, Math.min(N, window.innerHeight - $.height - z)), l.left = `${D}px`, l.top = `${N}px`;
1028
1035
  }
1029
1036
  u(p, "updatePosition");
1030
1037
  function d() {
1031
- a.disabled || (o.value = a.content || t.value?.getAttribute("title") || "", t.value?.hasAttribute("title") && (t.value.dataset.originalTitle = t.value.getAttribute("title") || "", t.value.removeAttribute("title")), o.value && (n.value = !0, Bs(p), a.timeout > 0 && (s.value = setTimeout(() => {
1038
+ a.disabled || (o.value = a.content || t.value?.getAttribute("title") || "", t.value?.hasAttribute("title") && (t.value.dataset.originalTitle = t.value.getAttribute("title") || "", t.value.removeAttribute("title")), o.value && (n.value = !0, Ps(p), a.timeout > 0 && (s.value = setTimeout(() => {
1032
1039
  n.value = !1;
1033
1040
  }, a.timeout))));
1034
1041
  }
@@ -1037,39 +1044,39 @@ const Oa = {
1037
1044
  a.disabled || (s.value && (clearTimeout(s.value), s.value = null), i.value = setTimeout(d, a.delay));
1038
1045
  }
1039
1046
  u(k, "onMouseEnter");
1040
- function E() {
1047
+ function A() {
1041
1048
  i.value && (clearTimeout(i.value), i.value = null), s.value && (clearTimeout(s.value), s.value = null), t.value?.dataset.originalTitle && (t.value.setAttribute("title", t.value.dataset.originalTitle), delete t.value.dataset.originalTitle), n.value = !1;
1042
1049
  }
1043
- u(E, "onMouseLeave");
1050
+ u(A, "onMouseLeave");
1044
1051
  function x() {
1045
1052
  a.disabled || (i.value && (clearTimeout(i.value), i.value = null), d());
1046
1053
  }
1047
1054
  u(x, "onFocusIn");
1048
1055
  function w() {
1049
- E();
1056
+ A();
1050
1057
  }
1051
1058
  u(w, "onFocusOut"), Yt(() => {
1052
1059
  window.addEventListener("resize", p), window.addEventListener("scroll", p, !0);
1053
- }), zs(() => {
1060
+ }), Os(() => {
1054
1061
  window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0), i.value && clearTimeout(i.value), s.value && clearTimeout(s.value);
1055
1062
  });
1056
- const M = T(() => `absolute size-2 rotate-45 bg-theme-900 dark:bg-theme-600 ${{
1063
+ const C = T(() => `absolute size-2 rotate-45 bg-theme-900 dark:bg-theme-600 ${{
1057
1064
  bottom: "left-1/2 -translate-x-1/2 -top-1",
1058
1065
  top: "left-1/2 -translate-x-1/2 -bottom-1",
1059
1066
  left: "right-[-4px] top-1/2 -translate-y-1/2",
1060
1067
  right: "left-[-4px] top-1/2 -translate-y-1/2"
1061
1068
  }[a.direction]}`);
1062
- return (_, D) => (h(), f("div", {
1069
+ return (E, $) => (h(), f("div", {
1063
1070
  ref_key: "triggerRef",
1064
1071
  ref: t,
1065
1072
  onMouseenter: k,
1066
- onMouseleave: E,
1073
+ onMouseleave: A,
1067
1074
  onFocusin: x,
1068
1075
  onFocusout: w
1069
1076
  }, [
1070
- fn(_.$slots, "default"),
1071
- (h(), ut(ga, { to: "body" }, [
1072
- Qe(Ns, {
1077
+ fn(E.$slots, "default"),
1078
+ (h(), mt(ma, { to: "body" }, [
1079
+ Je(ga, {
1073
1080
  "enter-active-class": "transition ease-out duration-200",
1074
1081
  "enter-from-class": "opacity-0 scale-95",
1075
1082
  "enter-to-class": "opacity-100 scale-100",
@@ -1077,16 +1084,16 @@ const Oa = {
1077
1084
  "leave-from-class": "opacity-100 scale-100",
1078
1085
  "leave-to-class": "opacity-0 scale-95"
1079
1086
  }, {
1080
- default: $n(() => [
1081
- Ps(b("div", {
1087
+ default: zs(() => [
1088
+ Ns(y("div", {
1082
1089
  ref_key: "tooltipRef",
1083
1090
  ref: e,
1084
1091
  class: "fixed z-50 px-2 py-1.5 text-xs font-mono text-white bg-theme-900 dark:bg-theme-600 rounded-md shadow-lg",
1085
1092
  style: K(l)
1086
1093
  }, [
1087
- nt(j(o.value) + " ", 1),
1088
- b("div", {
1089
- class: R(M.value)
1094
+ nt(W(o.value) + " ", 1),
1095
+ y("div", {
1096
+ class: _(C.value)
1090
1097
  }, null, 2)
1091
1098
  ], 4), [
1092
1099
  [va, n.value && !a.disabled]
@@ -1114,25 +1121,25 @@ const Oa = {
1114
1121
  height: "clamp(7px, 14%, 14px)"
1115
1122
  }, n = T(() => a.position.startsWith("top") ? "bottom" : "top");
1116
1123
  return (i, s) => (h(), f(se, null, [
1117
- a.tooltip ? (h(), ut(Ga, {
1124
+ a.tooltip ? (h(), mt(Ga, {
1118
1125
  key: 0,
1119
1126
  content: a.tooltip,
1120
1127
  direction: n.value,
1121
1128
  "max-width": 240,
1122
- class: R(["absolute rounded-full ring-2 ring-white z-10", a.dotClass]),
1129
+ class: _(["absolute rounded-full ring-2 ring-white z-10", a.dotClass]),
1123
1130
  style: K({ ...e, ...t.value }),
1124
1131
  role: "status",
1125
1132
  "aria-label": a.tooltip
1126
1133
  }, null, 8, ["content", "direction", "class", "style", "aria-label"])) : (h(), f("span", {
1127
1134
  key: 1,
1128
- class: R(["absolute rounded-full ring-2 ring-white z-10", a.dotClass]),
1135
+ class: _(["absolute rounded-full ring-2 ring-white z-10", a.dotClass]),
1129
1136
  style: K({ ...e, ...t.value })
1130
1137
  }, null, 6)),
1131
1138
  a.showPing ? (h(), f("span", {
1132
1139
  key: 2,
1133
- class: R(["absolute rounded-full animate-ping [animation-duration:3s] opacity-50 pointer-events-none", a.dotClass]),
1140
+ class: _(["absolute rounded-full animate-ping [animation-duration:3s] opacity-50 pointer-events-none", a.dotClass]),
1134
1141
  style: K({ ...e, ...t.value })
1135
- }, null, 6)) : W("", !0)
1142
+ }, null, 6)) : G("", !0)
1136
1143
  ], 64));
1137
1144
  }
1138
1145
  }), qa = ["src", "alt"], Ka = ["src"], Ya = /* @__PURE__ */ Me({
@@ -1152,36 +1159,36 @@ const Oa = {
1152
1159
  setup(a) {
1153
1160
  const t = T(() => `rounded-${a.rounded}`);
1154
1161
  return (e, n) => (h(), f("div", {
1155
- class: R(["shrink-0 relative", [t.value, a.editable ? "cursor-pointer group/avatar" : ""]])
1162
+ class: _(["shrink-0 relative", [t.value, a.editable ? "cursor-pointer group/avatar" : ""]])
1156
1163
  }, [
1157
- b("div", {
1158
- class: R(["size-full overflow-hidden ring-1 ring-black/5", t.value])
1164
+ y("div", {
1165
+ class: _(["size-full overflow-hidden ring-1 ring-black/5", t.value])
1159
1166
  }, [
1160
- b("img", {
1167
+ y("img", {
1161
1168
  src: a.src,
1162
1169
  alt: a.alt,
1163
1170
  class: "size-full object-cover"
1164
1171
  }, null, 8, qa),
1165
1172
  a.editable ? (h(), f("div", {
1166
1173
  key: 0,
1167
- class: R(["absolute inset-0 flex items-center justify-center opacity-0 group-hover/avatar:opacity-100 transition-opacity bg-black/40", t.value])
1174
+ class: _(["absolute inset-0 flex items-center justify-center opacity-0 group-hover/avatar:opacity-100 transition-opacity bg-black/40", t.value])
1168
1175
  }, [...n[0] || (n[0] = [
1169
- b("i", { class: "i-tabler-camera text-xl text-white" }, null, -1)
1170
- ])], 2)) : W("", !0)
1176
+ y("i", { class: "i-tabler-camera text-xl text-white" }, null, -1)
1177
+ ])], 2)) : G("", !0)
1171
1178
  ], 2),
1172
1179
  a.subSrc ? (h(), f("img", {
1173
1180
  key: 0,
1174
1181
  src: a.subSrc,
1175
1182
  alt: "",
1176
1183
  class: "absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2 ring-white"
1177
- }, null, 8, Ka)) : W("", !0),
1178
- a.dotClass ? (h(), ut(Va, {
1184
+ }, null, 8, Ka)) : G("", !0),
1185
+ a.dotClass ? (h(), mt(Va, {
1179
1186
  key: 1,
1180
1187
  "dot-class": a.dotClass,
1181
1188
  tooltip: a.dotTooltip,
1182
1189
  "show-ping": a.showPing,
1183
1190
  position: a.dotPosition
1184
- }, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) : W("", !0)
1191
+ }, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) : G("", !0)
1185
1192
  ], 2));
1186
1193
  }
1187
1194
  }), Xa = /* @__PURE__ */ Me({
@@ -1196,10 +1203,10 @@ const Oa = {
1196
1203
  subAvatarSrc: {}
1197
1204
  },
1198
1205
  setup(a) {
1199
- const t = T(() => a.agent.avatarUrl.value || Pn(a.agent.name.value)), e = T(() => a.agent.state.value), n = T(
1206
+ const t = T(() => a.agent.avatarUrl.value || Nn(a.agent.name.value)), e = T(() => a.agent.state.value), n = T(
1200
1207
  () => a.showStatus && e.value.lifecycle !== "unknown" ? Wa[e.value.color] : null
1201
1208
  );
1202
- return (i, s) => (h(), ut(Ya, {
1209
+ return (i, s) => (h(), mt(Ya, {
1203
1210
  src: t.value,
1204
1211
  alt: a.agent.name.value || "Agent",
1205
1212
  rounded: a.rounded,
@@ -1216,7 +1223,7 @@ const Oa = {
1216
1223
  class: "sr-only",
1217
1224
  role: "status",
1218
1225
  "aria-live": "polite"
1219
- }, Qa = ["aria-expanded", "disabled"], Ja = ["aria-expanded"], ei = {
1226
+ }, Ja = ["aria-expanded", "disabled"], Qa = ["aria-expanded"], ei = {
1220
1227
  class: "flex w-5 shrink-0 justify-center self-stretch",
1221
1228
  "aria-hidden": "true"
1222
1229
  }, ti = ["data-journal-row"], ni = {
@@ -1226,7 +1233,7 @@ const Oa = {
1226
1233
  key: 1,
1227
1234
  "data-journal-station": "failed",
1228
1235
  class: "i-tabler-alert-circle size-3.5 text-red-600"
1229
- }, ms = /* @__PURE__ */ Me({
1236
+ }, fs = /* @__PURE__ */ Me({
1230
1237
  __name: "AgentToolActivityGroup",
1231
1238
  props: {
1232
1239
  model: {},
@@ -1265,10 +1272,10 @@ const Oa = {
1265
1272
  function d(k) {
1266
1273
  return k === "active" ? t.isLight ? "text-[13px] font-medium text-theme-900" : "text-[13px] font-medium text-white" : k === "failed" ? "text-[12.5px] font-medium text-red-600" : k === "stopped" ? t.isLight ? "text-[13px] font-medium text-theme-600" : "text-[13px] font-medium text-white/70" : t.isLight ? "text-[12.5px] text-theme-500" : "text-[12.5px] text-white/55";
1267
1274
  }
1268
- return u(d, "labelClass"), (k, E) => (h(), f("div", {
1269
- class: R(["w-full py-0.5", p.value.muted])
1275
+ return u(d, "labelClass"), (k, A) => (h(), f("div", {
1276
+ class: _(["w-full py-0.5", p.value.muted])
1270
1277
  }, [
1271
- l.value ? (h(), f("span", Za, j(l.value), 1)) : W("", !0),
1278
+ l.value ? (h(), f("span", Za, W(l.value), 1)) : G("", !0),
1272
1279
  i.value ? (h(), f("button", {
1273
1280
  key: 1,
1274
1281
  type: "button",
@@ -1276,107 +1283,107 @@ const Oa = {
1276
1283
  "data-journal-disclosure": "",
1277
1284
  "aria-expanded": e.value,
1278
1285
  disabled: s.value === 0,
1279
- class: R(["grid min-h-11 w-full grid-cols-[1.25rem_minmax(0,1fr)_auto] items-center gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", p.value.ring]),
1286
+ class: _(["grid min-h-11 w-full grid-cols-[1.25rem_minmax(0,1fr)_auto] items-center gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", p.value.ring]),
1280
1287
  onClick: n
1281
1288
  }, [
1282
- E[0] || (E[0] = b("span", {
1289
+ A[0] || (A[0] = y("span", {
1283
1290
  class: "grid size-5 shrink-0 place-items-center",
1284
1291
  "data-journal-station": "completed",
1285
1292
  "aria-hidden": "true"
1286
1293
  }, [
1287
- b("i", { class: "i-tabler-circle-check-filled size-3.5 text-green-600" })
1294
+ y("i", { class: "i-tabler-circle-check-filled size-3.5 text-green-600" })
1288
1295
  ], -1)),
1289
- b("span", {
1290
- class: R(["min-w-0 truncate text-[12.5px] font-medium leading-none", p.value.muted])
1291
- }, j(a.model.terminal?.label), 3),
1296
+ y("span", {
1297
+ class: _(["min-w-0 truncate text-[12.5px] font-medium leading-none", p.value.muted])
1298
+ }, W(a.model.terminal?.label), 3),
1292
1299
  s.value ? (h(), f("span", {
1293
1300
  key: 0,
1294
- class: R(["flex shrink-0 items-center gap-0.5 whitespace-nowrap text-[12px] font-medium leading-none", p.value.muted])
1301
+ class: _(["flex shrink-0 items-center gap-0.5 whitespace-nowrap text-[12px] font-medium leading-none", p.value.muted])
1295
1302
  }, [
1296
- nt(j(s.value) + " earlier updates ", 1),
1297
- b("i", {
1298
- class: R(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1303
+ nt(W(s.value) + " earlier updates ", 1),
1304
+ y("i", {
1305
+ class: _(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1299
1306
  "aria-hidden": "true"
1300
1307
  }, null, 2)
1301
- ], 2)) : W("", !0)
1302
- ], 10, Qa)) : s.value ? (h(), f("button", {
1308
+ ], 2)) : G("", !0)
1309
+ ], 10, Ja)) : s.value ? (h(), f("button", {
1303
1310
  key: 2,
1304
1311
  type: "button",
1305
1312
  "data-test": "messaging-tool-activity-summary",
1306
1313
  "data-journal-disclosure": "",
1307
1314
  "aria-expanded": e.value,
1308
- class: R(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", p.value.ring]),
1315
+ class: _(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", p.value.ring]),
1309
1316
  onClick: n
1310
1317
  }, [
1311
- b("span", ei, [
1312
- b("span", {
1318
+ y("span", ei, [
1319
+ y("span", {
1313
1320
  "data-journal-spine": "dashed",
1314
- class: R(["w-0 border-l border-dashed", p.value.dashed])
1321
+ class: _(["w-0 border-l border-dashed", p.value.dashed])
1315
1322
  }, null, 2)
1316
1323
  ]),
1317
- b("span", {
1318
- class: R(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", p.value.muted])
1324
+ y("span", {
1325
+ class: _(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", p.value.muted])
1319
1326
  }, [
1320
- nt(j(s.value) + " earlier updates ", 1),
1321
- b("i", {
1322
- class: R(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1327
+ nt(W(s.value) + " earlier updates ", 1),
1328
+ y("i", {
1329
+ class: _(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1323
1330
  "aria-hidden": "true"
1324
1331
  }, null, 2)
1325
1332
  ], 2)
1326
- ], 10, Ja)) : W("", !0),
1333
+ ], 10, Qa)) : G("", !0),
1327
1334
  (h(!0), f(se, null, ve(o.value, (x, w) => (h(), f("div", {
1328
1335
  key: x.id,
1329
1336
  "data-test": "messaging-tool-activity-row",
1330
1337
  "data-journal-row": x.tone,
1331
- class: R([i.value ? "pl-[30px]" : "", "flex gap-x-2.5"])
1338
+ class: _([i.value ? "pl-[30px]" : "", "flex gap-x-2.5"])
1332
1339
  }, [
1333
- b("div", ni, [
1334
- b("span", si, [
1340
+ y("div", ni, [
1341
+ y("span", si, [
1335
1342
  x.tone === "active" ? (h(), f("span", {
1336
1343
  key: 0,
1337
1344
  "data-journal-station": "active",
1338
- class: R(["size-3.5 animate-spin rounded-full border-[1.5px] motion-reduce:animate-none", p.value.activeSpinner])
1345
+ class: _(["size-3.5 animate-spin rounded-full border-[1.5px] motion-reduce:animate-none", p.value.activeSpinner])
1339
1346
  }, null, 2)) : x.tone === "failed" ? (h(), f("i", ai)) : x.tone === "stopped" ? (h(), f("span", {
1340
1347
  key: 2,
1341
1348
  "data-journal-station": "stopped",
1342
- class: R(["size-[9px] rounded-[2px]", p.value.stoppedSquare])
1349
+ class: _(["size-[9px] rounded-[2px]", p.value.stoppedSquare])
1343
1350
  }, null, 2)) : (h(), f("span", {
1344
1351
  key: 3,
1345
1352
  "data-journal-station": "done",
1346
- class: R(["size-[7px] rounded-full", p.value.doneDot])
1353
+ class: _(["size-[7px] rounded-full", p.value.doneDot])
1347
1354
  }, null, 2))
1348
1355
  ]),
1349
1356
  w !== o.value.length - 1 ? (h(), f("span", {
1350
1357
  key: 0,
1351
- class: R(["w-px flex-1", p.value.spine])
1352
- }, null, 2)) : W("", !0)
1358
+ class: _(["w-px flex-1", p.value.spine])
1359
+ }, null, 2)) : G("", !0)
1353
1360
  ]),
1354
- b("div", {
1355
- class: R(["min-w-0 flex-1", w === o.value.length - 1 ? "" : "pb-2"])
1361
+ y("div", {
1362
+ class: _(["min-w-0 flex-1", w === o.value.length - 1 ? "" : "pb-2"])
1356
1363
  }, [
1357
- b("span", {
1358
- class: R(["block leading-snug", d(x.tone)])
1359
- }, j(x.label), 3),
1364
+ y("span", {
1365
+ class: _(["block leading-snug", d(x.tone)])
1366
+ }, W(x.label), 3),
1360
1367
  x.note ? (h(), f("p", {
1361
1368
  key: 0,
1362
- class: R(["pt-0.5 text-[11.5px] leading-snug", p.value.muted])
1363
- }, j(x.note), 3)) : W("", !0)
1369
+ class: _(["pt-0.5 text-[11.5px] leading-snug", p.value.muted])
1370
+ }, W(x.note), 3)) : G("", !0)
1364
1371
  ], 2)
1365
1372
  ], 10, ti))), 128)),
1366
1373
  !i.value && a.model.hint ? (h(), f("p", {
1367
1374
  key: 3,
1368
1375
  "data-test": "messaging-tool-activity-hint",
1369
- class: R(["pl-[30px] pt-2.5 text-[12px] leading-snug", p.value.muted])
1370
- }, j(a.model.hint), 3)) : W("", !0)
1376
+ class: _(["pl-[30px] pt-2.5 text-[12px] leading-snug", p.value.muted])
1377
+ }, W(a.model.hint), 3)) : G("", !0)
1371
1378
  ], 2));
1372
1379
  }
1373
1380
  });
1374
- function gs(a, t) {
1381
+ function ms(a, t) {
1375
1382
  (t == null || t > a.length) && (t = a.length);
1376
1383
  for (var e = 0, n = Array(t); e < t; e++) n[e] = a[e];
1377
1384
  return n;
1378
1385
  }
1379
- u(gs, "_arrayLikeToArray");
1386
+ u(ms, "_arrayLikeToArray");
1380
1387
  function ii(a) {
1381
1388
  if (Array.isArray(a)) return a;
1382
1389
  }
@@ -1411,37 +1418,37 @@ function oi(a, t) {
1411
1418
  u(oi, "_slicedToArray");
1412
1419
  function ci(a, t) {
1413
1420
  if (a) {
1414
- if (typeof a == "string") return gs(a, t);
1421
+ if (typeof a == "string") return ms(a, t);
1415
1422
  var e = {}.toString.call(a).slice(8, -1);
1416
- return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? gs(a, t) : void 0;
1423
+ return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? ms(a, t) : void 0;
1417
1424
  }
1418
1425
  }
1419
1426
  u(ci, "_unsupportedIterableToArray");
1420
- const Gs = Object.entries, vs = Object.setPrototypeOf, ui = Object.isFrozen, di = Object.getPrototypeOf, hi = Object.getOwnPropertyDescriptor;
1421
- let Ce = Object.freeze, Ne = Object.seal, Mt = Object.create, Vs = typeof Reflect < "u" && Reflect, On = Vs.apply, zn = Vs.construct;
1427
+ const Ws = Object.entries, gs = Object.setPrototypeOf, ui = Object.isFrozen, di = Object.getPrototypeOf, hi = Object.getOwnPropertyDescriptor;
1428
+ let Ce = Object.freeze, Ne = Object.seal, Mt = Object.create, Gs = typeof Reflect < "u" && Reflect, Ln = Gs.apply, On = Gs.construct;
1422
1429
  Ce || (Ce = /* @__PURE__ */ u(function(t) {
1423
1430
  return t;
1424
1431
  }, "freeze"));
1425
1432
  Ne || (Ne = /* @__PURE__ */ u(function(t) {
1426
1433
  return t;
1427
1434
  }, "seal"));
1428
- On || (On = /* @__PURE__ */ u(function(t, e) {
1435
+ Ln || (Ln = /* @__PURE__ */ u(function(t, e) {
1429
1436
  for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
1430
1437
  i[s - 2] = arguments[s];
1431
1438
  return t.apply(e, i);
1432
1439
  }, "apply"));
1433
- zn || (zn = /* @__PURE__ */ u(function(t) {
1440
+ On || (On = /* @__PURE__ */ u(function(t) {
1434
1441
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
1435
1442
  n[i - 1] = arguments[i];
1436
1443
  return new t(...n);
1437
1444
  }, "construct"));
1438
- const St = xe(Array.prototype.forEach), pi = xe(Array.prototype.lastIndexOf), xs = xe(Array.prototype.pop), At = xe(Array.prototype.push), fi = xe(Array.prototype.splice), Re = Array.isArray, Vt = xe(String.prototype.toLowerCase), En = xe(String.prototype.toString), bs = xe(String.prototype.match), Et = xe(String.prototype.replace), ys = xe(String.prototype.indexOf), mi = xe(String.prototype.trim), gi = xe(Number.prototype.toString), vi = xe(Boolean.prototype.toString), ks = typeof BigInt > "u" ? null : xe(BigInt.prototype.toString), ws = typeof Symbol > "u" ? null : xe(Symbol.prototype.toString), de = xe(Object.prototype.hasOwnProperty), Ut = xe(Object.prototype.toString), we = xe(RegExp.prototype.test), Ht = xi(TypeError);
1445
+ const St = xe(Array.prototype.forEach), pi = xe(Array.prototype.lastIndexOf), vs = xe(Array.prototype.pop), At = xe(Array.prototype.push), fi = xe(Array.prototype.splice), Re = Array.isArray, Vt = xe(String.prototype.toLowerCase), En = xe(String.prototype.toString), xs = xe(String.prototype.match), Et = xe(String.prototype.replace), bs = xe(String.prototype.indexOf), mi = xe(String.prototype.trim), gi = xe(Number.prototype.toString), vi = xe(Boolean.prototype.toString), ys = typeof BigInt > "u" ? null : xe(BigInt.prototype.toString), ks = typeof Symbol > "u" ? null : xe(Symbol.prototype.toString), he = xe(Object.prototype.hasOwnProperty), Ut = xe(Object.prototype.toString), we = xe(RegExp.prototype.test), Ht = xi(TypeError);
1439
1446
  function xe(a) {
1440
1447
  return function(t) {
1441
1448
  t instanceof RegExp && (t.lastIndex = 0);
1442
1449
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
1443
1450
  n[i - 1] = arguments[i];
1444
- return On(a, t, n);
1451
+ return Ln(a, t, n);
1445
1452
  };
1446
1453
  }
1447
1454
  u(xe, "unapply");
@@ -1449,13 +1456,13 @@ function xi(a) {
1449
1456
  return function() {
1450
1457
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
1451
1458
  e[n] = arguments[n];
1452
- return zn(a, e);
1459
+ return On(a, e);
1453
1460
  };
1454
1461
  }
1455
1462
  u(xi, "unconstruct");
1456
1463
  function q(a, t) {
1457
1464
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Vt;
1458
- if (vs && vs(a, null), !Re(t))
1465
+ if (gs && gs(a, null), !Re(t))
1459
1466
  return a;
1460
1467
  let n = t.length;
1461
1468
  for (; n--; ) {
@@ -1471,16 +1478,16 @@ function q(a, t) {
1471
1478
  u(q, "addToSet");
1472
1479
  function bi(a) {
1473
1480
  for (let t = 0; t < a.length; t++)
1474
- de(a, t) || (a[t] = null);
1481
+ he(a, t) || (a[t] = null);
1475
1482
  return a;
1476
1483
  }
1477
1484
  u(bi, "cleanArray");
1478
1485
  function Se(a) {
1479
1486
  const t = Mt(null);
1480
- for (const n of Gs(a)) {
1487
+ for (const n of Ws(a)) {
1481
1488
  var e = oi(n, 2);
1482
1489
  const i = e[0], s = e[1];
1483
- de(a, i) && (Re(s) ? t[i] = bi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = Se(s) : t[i] = s);
1490
+ he(a, i) && (Re(s) ? t[i] = bi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = Se(s) : t[i] = s);
1484
1491
  }
1485
1492
  return t;
1486
1493
  }
@@ -1494,16 +1501,16 @@ function yi(a) {
1494
1501
  case "boolean":
1495
1502
  return vi(a);
1496
1503
  case "bigint":
1497
- return ks ? ks(a) : "0";
1504
+ return ys ? ys(a) : "0";
1498
1505
  case "symbol":
1499
- return ws ? ws(a) : "Symbol()";
1506
+ return ks ? ks(a) : "Symbol()";
1500
1507
  case "undefined":
1501
1508
  return Ut(a);
1502
1509
  case "function":
1503
1510
  case "object": {
1504
1511
  if (a === null)
1505
1512
  return Ut(a);
1506
- const t = a, e = Je(t, "toString");
1513
+ const t = a, e = Qe(t, "toString");
1507
1514
  if (typeof e == "function") {
1508
1515
  const n = e(t);
1509
1516
  return typeof n == "string" ? n : Ut(n);
@@ -1515,7 +1522,7 @@ function yi(a) {
1515
1522
  }
1516
1523
  }
1517
1524
  u(yi, "stringifyValue");
1518
- function Je(a, t) {
1525
+ function Qe(a, t) {
1519
1526
  for (; a !== null; ) {
1520
1527
  const n = hi(a, t);
1521
1528
  if (n) {
@@ -1531,7 +1538,7 @@ function Je(a, t) {
1531
1538
  }
1532
1539
  return u(e, "fallbackValue"), e;
1533
1540
  }
1534
- u(Je, "lookupGetter");
1541
+ u(Qe, "lookupGetter");
1535
1542
  function ki(a) {
1536
1543
  try {
1537
1544
  return we(a, ""), !0;
@@ -1540,7 +1547,7 @@ function ki(a) {
1540
1547
  }
1541
1548
  }
1542
1549
  u(ki, "isRegex");
1543
- const Ts = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), _n = Ce(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Rn = Ce(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), wi = Ce(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Cn = Ce(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ti = Ce(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ss = Ce(["#text"]), As = Ce(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Mn = Ce(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Es = Ce(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), an = Ce(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Si = Ne(/{{[\w\W]*|^[\w\W]*}}/g), Ai = Ne(/<%[\w\W]*|^[\w\W]*%>/g), Ei = Ne(/\${[\w\W]*/g), _i = Ne(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ri = Ne(/^aria-[\-\w]+$/), _s = Ne(
1550
+ const ws = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), _n = Ce(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Rn = Ce(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), wi = Ce(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Cn = Ce(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ti = Ce(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ts = Ce(["#text"]), Ss = Ce(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Mn = Ce(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), As = Ce(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), an = Ce(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Si = Ne(/{{[\w\W]*|^[\w\W]*}}/g), Ai = Ne(/<%[\w\W]*|^[\w\W]*%>/g), Ei = Ne(/\${[\w\W]*/g), _i = Ne(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ri = Ne(/^aria-[\-\w]+$/), Es = Ne(
1544
1551
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
1545
1552
  // eslint-disable-line no-useless-escape
1546
1553
  ), Ci = Ne(/^(?:\w+script|data):/i), Mi = Ne(
@@ -1583,7 +1590,7 @@ const Ts = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
1583
1590
  } catch {
1584
1591
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
1585
1592
  }
1586
- }, "_createTrustedTypesPolicy"), Rs = /* @__PURE__ */ u(function() {
1593
+ }, "_createTrustedTypesPolicy"), _s = /* @__PURE__ */ u(function() {
1587
1594
  return {
1588
1595
  afterSanitizeAttributes: [],
1589
1596
  afterSanitizeElements: [],
@@ -1596,9 +1603,9 @@ const Ts = Ce(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
1596
1603
  uponSanitizeShadowNode: []
1597
1604
  };
1598
1605
  }, "_createHooksMap");
1599
- function qs() {
1606
+ function Vs() {
1600
1607
  let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Di();
1601
- const t = /* @__PURE__ */ u((P) => qs(P), "DOMPurify");
1608
+ const t = /* @__PURE__ */ u((B) => Vs(B), "DOMPurify");
1602
1609
  if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !== Ze.document || !a.Element)
1603
1610
  return t.isSupported = !1, t;
1604
1611
  let e = a.document;
@@ -1606,20 +1613,20 @@ function qs() {
1606
1613
  a.DocumentFragment;
1607
1614
  const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, p = a.NodeFilter, d = a.NamedNodeMap;
1608
1615
  d === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
1609
- const k = a.DOMParser, E = a.trustedTypes, x = o.prototype, w = Je(x, "cloneNode"), M = Je(x, "remove"), _ = Je(x, "nextSibling"), D = Je(x, "childNodes"), J = Je(x, "parentNode"), S = Je(x, "shadowRoot"), B = Je(x, "attributes"), N = l && l.prototype ? Je(l.prototype, "nodeType") : null, U = l && l.prototype ? Je(l.prototype, "nodeName") : null;
1616
+ const k = a.DOMParser, A = a.trustedTypes, x = o.prototype, w = Qe(x, "cloneNode"), C = Qe(x, "remove"), E = Qe(x, "nextSibling"), $ = Qe(x, "childNodes"), Q = Qe(x, "parentNode"), D = Qe(x, "shadowRoot"), N = Qe(x, "attributes"), z = l && l.prototype ? Qe(l.prototype, "nodeType") : null, F = l && l.prototype ? Qe(l.prototype, "nodeName") : null;
1610
1617
  if (typeof s == "function") {
1611
- const P = e.createElement("template");
1612
- P.content && P.content.ownerDocument && (e = P.content.ownerDocument);
1613
- }
1614
- let H, V = "";
1615
- const he = e, Ie = he.implementation, ce = he.createNodeIterator, $e = he.createDocumentFragment, vt = he.getElementsByTagName, st = n.importNode;
1616
- let oe = Rs();
1617
- t.isSupported = typeof Gs == "function" && typeof J == "function" && Ie && Ie.createHTMLDocument !== void 0;
1618
- const at = Si, be = Ai, je = Ei, xt = _i, Ee = Ri, Le = Ci, We = Mi, ke = $i;
1619
- let Ge = _s, X = null;
1620
- const it = q({}, [...Ts, ..._n, ...Rn, ...Cn, ...Ss]);
1618
+ const B = e.createElement("template");
1619
+ B.content && B.content.ownerDocument && (e = B.content.ownerDocument);
1620
+ }
1621
+ let H, j = "";
1622
+ const re = e, Ie = re.implementation, ue = re.createNodeIterator, $e = re.createDocumentFragment, xt = re.getElementsByTagName, st = n.importNode;
1623
+ let ce = _s();
1624
+ t.isSupported = typeof Ws == "function" && typeof Q == "function" && Ie && Ie.createHTMLDocument !== void 0;
1625
+ const at = Si, be = Ai, je = Ei, bt = _i, Ee = Ri, Le = Ci, We = Mi, ke = $i;
1626
+ let Ge = Es, X = null;
1627
+ const it = q({}, [...ws, ..._n, ...Rn, ...Cn, ...Ts]);
1621
1628
  let ie = null;
1622
- const rt = q({}, [...As, ...Mn, ...Es, ...an]);
1629
+ const rt = q({}, [...Ss, ...Mn, ...As, ...an]);
1623
1630
  let te = Object.seal(Mt(null, {
1624
1631
  tagNameCheck: {
1625
1632
  writable: !0,
@@ -1640,7 +1647,7 @@ function qs() {
1640
1647
  value: !1
1641
1648
  }
1642
1649
  })), Ve = null, g = null;
1643
- const A = Object.seal(Mt(null, {
1650
+ const S = Object.seal(Mt(null, {
1644
1651
  tagCheck: {
1645
1652
  writable: !0,
1646
1653
  configurable: !1,
@@ -1654,57 +1661,57 @@ function qs() {
1654
1661
  value: null
1655
1662
  }
1656
1663
  }));
1657
- let c = !0, I = !0, L = !1, O = !0, G = !1, re = !0, pe = !1, ue = !1, fe = !1, Te = !1, De = !1, _e = !1, qe = !0, Pe = !1;
1658
- const C = "user-content-";
1659
- let v = !0, y = !1, Z = {}, F = null;
1664
+ let c = !0, M = !0, L = !1, O = !0, V = !1, le = !0, pe = !1, de = !1, fe = !1, Te = !1, De = !1, _e = !1, qe = !0, Pe = !1;
1665
+ const R = "user-content-";
1666
+ let v = !0, b = !1, Z = {}, U = null;
1660
1667
  const ae = q({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
1661
1668
  let Ke = null;
1662
- const bt = q({}, ["audio", "video", "img", "source", "image", "track"]);
1669
+ const yt = q({}, ["audio", "video", "img", "source", "image", "track"]);
1663
1670
  let vn = null;
1664
- const Xn = q({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Zt = "http://www.w3.org/1998/Math/MathML", Qt = "http://www.w3.org/2000/svg", Ye = "http://www.w3.org/1999/xhtml";
1665
- let yt = Ye, xn = !1, bn = null;
1666
- const la = q({}, [Zt, Qt, Ye], En);
1671
+ const Yn = q({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Zt = "http://www.w3.org/1998/Math/MathML", Jt = "http://www.w3.org/2000/svg", Ye = "http://www.w3.org/1999/xhtml";
1672
+ let kt = Ye, xn = !1, bn = null;
1673
+ const ra = q({}, [Zt, Jt, Ye], En);
1667
1674
  let yn = q({}, ["mi", "mo", "mn", "ms", "mtext"]), kn = q({}, ["annotation-xml"]);
1668
- const oa = q({}, ["title", "style", "font", "a", "script"]);
1675
+ const la = q({}, ["title", "style", "font", "a", "script"]);
1669
1676
  let Pt = null;
1670
- const ca = ["application/xhtml+xml", "text/html"], ua = "text/html";
1671
- let me = null, kt = null;
1672
- const da = e.createElement("form"), Zn = /* @__PURE__ */ u(function(r) {
1677
+ const oa = ["application/xhtml+xml", "text/html"], ca = "text/html";
1678
+ let me = null, wt = null;
1679
+ const ua = e.createElement("form"), Xn = /* @__PURE__ */ u(function(r) {
1673
1680
  return r instanceof RegExp || r instanceof Function;
1674
1681
  }, "isRegexOrFunction"), wn = /* @__PURE__ */ u(function() {
1675
1682
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1676
- if (kt && kt === r)
1683
+ if (wt && wt === r)
1677
1684
  return;
1678
1685
  (!r || typeof r != "object") && (r = {}), r = Se(r), Pt = // eslint-disable-next-line unicorn/prefer-includes
1679
- ca.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? ua : r.PARSER_MEDIA_TYPE, me = Pt === "application/xhtml+xml" ? En : Vt, X = de(r, "ALLOWED_TAGS") && Re(r.ALLOWED_TAGS) ? q({}, r.ALLOWED_TAGS, me) : it, ie = de(r, "ALLOWED_ATTR") && Re(r.ALLOWED_ATTR) ? q({}, r.ALLOWED_ATTR, me) : rt, bn = de(r, "ALLOWED_NAMESPACES") && Re(r.ALLOWED_NAMESPACES) ? q({}, r.ALLOWED_NAMESPACES, En) : la, vn = de(r, "ADD_URI_SAFE_ATTR") && Re(r.ADD_URI_SAFE_ATTR) ? q(Se(Xn), r.ADD_URI_SAFE_ATTR, me) : Xn, Ke = de(r, "ADD_DATA_URI_TAGS") && Re(r.ADD_DATA_URI_TAGS) ? q(Se(bt), r.ADD_DATA_URI_TAGS, me) : bt, F = de(r, "FORBID_CONTENTS") && Re(r.FORBID_CONTENTS) ? q({}, r.FORBID_CONTENTS, me) : ae, Ve = de(r, "FORBID_TAGS") && Re(r.FORBID_TAGS) ? q({}, r.FORBID_TAGS, me) : Se({}), g = de(r, "FORBID_ATTR") && Re(r.FORBID_ATTR) ? q({}, r.FORBID_ATTR, me) : Se({}), Z = de(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? Se(r.USE_PROFILES) : r.USE_PROFILES : !1, c = r.ALLOW_ARIA_ATTR !== !1, I = r.ALLOW_DATA_ATTR !== !1, L = r.ALLOW_UNKNOWN_PROTOCOLS || !1, O = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, G = r.SAFE_FOR_TEMPLATES || !1, re = r.SAFE_FOR_XML !== !1, pe = r.WHOLE_DOCUMENT || !1, Te = r.RETURN_DOM || !1, De = r.RETURN_DOM_FRAGMENT || !1, _e = r.RETURN_TRUSTED_TYPE || !1, fe = r.FORCE_BODY || !1, qe = r.SANITIZE_DOM !== !1, Pe = r.SANITIZE_NAMED_PROPS || !1, v = r.KEEP_CONTENT !== !1, y = r.IN_PLACE || !1, Ge = ki(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : _s, yt = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Ye, yn = de(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Se(r.MATHML_TEXT_INTEGRATION_POINTS) : q({}, ["mi", "mo", "mn", "ms", "mtext"]), kn = de(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? Se(r.HTML_INTEGRATION_POINTS) : q({}, ["annotation-xml"]);
1680
- const m = de(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? Se(r.CUSTOM_ELEMENT_HANDLING) : Mt(null);
1681
- if (te = Mt(null), de(m, "tagNameCheck") && Zn(m.tagNameCheck) && (te.tagNameCheck = m.tagNameCheck), de(m, "attributeNameCheck") && Zn(m.attributeNameCheck) && (te.attributeNameCheck = m.attributeNameCheck), de(m, "allowCustomizedBuiltInElements") && typeof m.allowCustomizedBuiltInElements == "boolean" && (te.allowCustomizedBuiltInElements = m.allowCustomizedBuiltInElements), G && (I = !1), De && (Te = !0), Z && (X = q({}, Ss), ie = Mt(null), Z.html === !0 && (q(X, Ts), q(ie, As)), Z.svg === !0 && (q(X, _n), q(ie, Mn), q(ie, an)), Z.svgFilters === !0 && (q(X, Rn), q(ie, Mn), q(ie, an)), Z.mathMl === !0 && (q(X, Cn), q(ie, Es), q(ie, an))), A.tagCheck = null, A.attributeCheck = null, de(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? A.tagCheck = r.ADD_TAGS : Re(r.ADD_TAGS) && (X === it && (X = Se(X)), q(X, r.ADD_TAGS, me))), de(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? A.attributeCheck = r.ADD_ATTR : Re(r.ADD_ATTR) && (ie === rt && (ie = Se(ie)), q(ie, r.ADD_ATTR, me))), de(r, "ADD_URI_SAFE_ATTR") && Re(r.ADD_URI_SAFE_ATTR) && q(vn, r.ADD_URI_SAFE_ATTR, me), de(r, "FORBID_CONTENTS") && Re(r.FORBID_CONTENTS) && (F === ae && (F = Se(F)), q(F, r.FORBID_CONTENTS, me)), de(r, "ADD_FORBID_CONTENTS") && Re(r.ADD_FORBID_CONTENTS) && (F === ae && (F = Se(F)), q(F, r.ADD_FORBID_CONTENTS, me)), v && (X["#text"] = !0), pe && q(X, ["html", "head", "body"]), X.table && (q(X, ["tbody"]), delete Ve.tbody), r.TRUSTED_TYPES_POLICY) {
1686
+ oa.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? ca : r.PARSER_MEDIA_TYPE, me = Pt === "application/xhtml+xml" ? En : Vt, X = he(r, "ALLOWED_TAGS") && Re(r.ALLOWED_TAGS) ? q({}, r.ALLOWED_TAGS, me) : it, ie = he(r, "ALLOWED_ATTR") && Re(r.ALLOWED_ATTR) ? q({}, r.ALLOWED_ATTR, me) : rt, bn = he(r, "ALLOWED_NAMESPACES") && Re(r.ALLOWED_NAMESPACES) ? q({}, r.ALLOWED_NAMESPACES, En) : ra, vn = he(r, "ADD_URI_SAFE_ATTR") && Re(r.ADD_URI_SAFE_ATTR) ? q(Se(Yn), r.ADD_URI_SAFE_ATTR, me) : Yn, Ke = he(r, "ADD_DATA_URI_TAGS") && Re(r.ADD_DATA_URI_TAGS) ? q(Se(yt), r.ADD_DATA_URI_TAGS, me) : yt, U = he(r, "FORBID_CONTENTS") && Re(r.FORBID_CONTENTS) ? q({}, r.FORBID_CONTENTS, me) : ae, Ve = he(r, "FORBID_TAGS") && Re(r.FORBID_TAGS) ? q({}, r.FORBID_TAGS, me) : Se({}), g = he(r, "FORBID_ATTR") && Re(r.FORBID_ATTR) ? q({}, r.FORBID_ATTR, me) : Se({}), Z = he(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? Se(r.USE_PROFILES) : r.USE_PROFILES : !1, c = r.ALLOW_ARIA_ATTR !== !1, M = r.ALLOW_DATA_ATTR !== !1, L = r.ALLOW_UNKNOWN_PROTOCOLS || !1, O = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, V = r.SAFE_FOR_TEMPLATES || !1, le = r.SAFE_FOR_XML !== !1, pe = r.WHOLE_DOCUMENT || !1, Te = r.RETURN_DOM || !1, De = r.RETURN_DOM_FRAGMENT || !1, _e = r.RETURN_TRUSTED_TYPE || !1, fe = r.FORCE_BODY || !1, qe = r.SANITIZE_DOM !== !1, Pe = r.SANITIZE_NAMED_PROPS || !1, v = r.KEEP_CONTENT !== !1, b = r.IN_PLACE || !1, Ge = ki(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : Es, kt = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Ye, yn = he(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Se(r.MATHML_TEXT_INTEGRATION_POINTS) : q({}, ["mi", "mo", "mn", "ms", "mtext"]), kn = he(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? Se(r.HTML_INTEGRATION_POINTS) : q({}, ["annotation-xml"]);
1687
+ const m = he(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? Se(r.CUSTOM_ELEMENT_HANDLING) : Mt(null);
1688
+ if (te = Mt(null), he(m, "tagNameCheck") && Xn(m.tagNameCheck) && (te.tagNameCheck = m.tagNameCheck), he(m, "attributeNameCheck") && Xn(m.attributeNameCheck) && (te.attributeNameCheck = m.attributeNameCheck), he(m, "allowCustomizedBuiltInElements") && typeof m.allowCustomizedBuiltInElements == "boolean" && (te.allowCustomizedBuiltInElements = m.allowCustomizedBuiltInElements), V && (M = !1), De && (Te = !0), Z && (X = q({}, Ts), ie = Mt(null), Z.html === !0 && (q(X, ws), q(ie, Ss)), Z.svg === !0 && (q(X, _n), q(ie, Mn), q(ie, an)), Z.svgFilters === !0 && (q(X, Rn), q(ie, Mn), q(ie, an)), Z.mathMl === !0 && (q(X, Cn), q(ie, As), q(ie, an))), S.tagCheck = null, S.attributeCheck = null, he(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? S.tagCheck = r.ADD_TAGS : Re(r.ADD_TAGS) && (X === it && (X = Se(X)), q(X, r.ADD_TAGS, me))), he(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? S.attributeCheck = r.ADD_ATTR : Re(r.ADD_ATTR) && (ie === rt && (ie = Se(ie)), q(ie, r.ADD_ATTR, me))), he(r, "ADD_URI_SAFE_ATTR") && Re(r.ADD_URI_SAFE_ATTR) && q(vn, r.ADD_URI_SAFE_ATTR, me), he(r, "FORBID_CONTENTS") && Re(r.FORBID_CONTENTS) && (U === ae && (U = Se(U)), q(U, r.FORBID_CONTENTS, me)), he(r, "ADD_FORBID_CONTENTS") && Re(r.ADD_FORBID_CONTENTS) && (U === ae && (U = Se(U)), q(U, r.ADD_FORBID_CONTENTS, me)), v && (X["#text"] = !0), pe && q(X, ["html", "head", "body"]), X.table && (q(X, ["tbody"]), delete Ve.tbody), r.TRUSTED_TYPES_POLICY) {
1682
1689
  if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
1683
1690
  throw Ht('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
1684
1691
  if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
1685
1692
  throw Ht('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
1686
- H = r.TRUSTED_TYPES_POLICY, V = H.createHTML("");
1693
+ H = r.TRUSTED_TYPES_POLICY, j = H.createHTML("");
1687
1694
  } else
1688
- H === void 0 && (H = Li(E, i)), H !== null && typeof V == "string" && (V = H.createHTML(""));
1689
- (oe.uponSanitizeElement.length > 0 || oe.uponSanitizeAttribute.length > 0) && X === it && (X = Se(X)), oe.uponSanitizeAttribute.length > 0 && ie === rt && (ie = Se(ie)), Ce && Ce(r), kt = r;
1690
- }, "_parseConfig"), Qn = q({}, [..._n, ...Rn, ...wi]), Jn = q({}, [...Cn, ...Ti]), ha = /* @__PURE__ */ u(function(r) {
1691
- let m = J(r);
1695
+ H === void 0 && (H = Li(A, i)), H !== null && typeof j == "string" && (j = H.createHTML(""));
1696
+ (ce.uponSanitizeElement.length > 0 || ce.uponSanitizeAttribute.length > 0) && X === it && (X = Se(X)), ce.uponSanitizeAttribute.length > 0 && ie === rt && (ie = Se(ie)), Ce && Ce(r), wt = r;
1697
+ }, "_parseConfig"), Zn = q({}, [..._n, ...Rn, ...wi]), Jn = q({}, [...Cn, ...Ti]), da = /* @__PURE__ */ u(function(r) {
1698
+ let m = Q(r);
1692
1699
  (!m || !m.tagName) && (m = {
1693
- namespaceURI: yt,
1700
+ namespaceURI: kt,
1694
1701
  tagName: "template"
1695
1702
  });
1696
- const $ = Vt(r.tagName), ne = Vt(m.tagName);
1697
- return bn[r.namespaceURI] ? r.namespaceURI === Qt ? m.namespaceURI === Ye ? $ === "svg" : m.namespaceURI === Zt ? $ === "svg" && (ne === "annotation-xml" || yn[ne]) : !!Qn[$] : r.namespaceURI === Zt ? m.namespaceURI === Ye ? $ === "math" : m.namespaceURI === Qt ? $ === "math" && kn[ne] : !!Jn[$] : r.namespaceURI === Ye ? m.namespaceURI === Qt && !kn[ne] || m.namespaceURI === Zt && !yn[ne] ? !1 : !Jn[$] && (oa[$] || !Qn[$]) : !!(Pt === "application/xhtml+xml" && bn[r.namespaceURI]) : !1;
1698
- }, "_checkValidNamespace"), Be = /* @__PURE__ */ u(function(r) {
1703
+ const I = Vt(r.tagName), ne = Vt(m.tagName);
1704
+ return bn[r.namespaceURI] ? r.namespaceURI === Jt ? m.namespaceURI === Ye ? I === "svg" : m.namespaceURI === Zt ? I === "svg" && (ne === "annotation-xml" || yn[ne]) : !!Zn[I] : r.namespaceURI === Zt ? m.namespaceURI === Ye ? I === "math" : m.namespaceURI === Jt ? I === "math" && kn[ne] : !!Jn[I] : r.namespaceURI === Ye ? m.namespaceURI === Jt && !kn[ne] || m.namespaceURI === Zt && !yn[ne] ? !1 : !Jn[I] && (la[I] || !Zn[I]) : !!(Pt === "application/xhtml+xml" && bn[r.namespaceURI]) : !1;
1705
+ }, "_checkValidNamespace"), Fe = /* @__PURE__ */ u(function(r) {
1699
1706
  At(t.removed, {
1700
1707
  element: r
1701
1708
  });
1702
1709
  try {
1703
- J(r).removeChild(r);
1710
+ Q(r).removeChild(r);
1704
1711
  } catch {
1705
- M(r);
1712
+ C(r);
1706
1713
  }
1707
- }, "_forceRemove"), pt = /* @__PURE__ */ u(function(r, m) {
1714
+ }, "_forceRemove"), ht = /* @__PURE__ */ u(function(r, m) {
1708
1715
  try {
1709
1716
  At(t.removed, {
1710
1717
  attribute: m.getAttributeNode(r),
@@ -1719,7 +1726,7 @@ function qs() {
1719
1726
  if (m.removeAttribute(r), r === "is")
1720
1727
  if (Te || De)
1721
1728
  try {
1722
- Be(m);
1729
+ Fe(m);
1723
1730
  } catch {
1724
1731
  }
1725
1732
  else
@@ -1727,69 +1734,69 @@ function qs() {
1727
1734
  m.setAttribute(r, "");
1728
1735
  } catch {
1729
1736
  }
1730
- }, "_removeAttribute"), es = /* @__PURE__ */ u(function(r) {
1731
- let m = null, $ = null;
1737
+ }, "_removeAttribute"), Qn = /* @__PURE__ */ u(function(r) {
1738
+ let m = null, I = null;
1732
1739
  if (fe)
1733
1740
  r = "<remove></remove>" + r;
1734
1741
  else {
1735
- const le = bs(r, /^[\r\n\t ]+/);
1736
- $ = le && le[0];
1742
+ const oe = xs(r, /^[\r\n\t ]+/);
1743
+ I = oe && oe[0];
1737
1744
  }
1738
- Pt === "application/xhtml+xml" && yt === Ye && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
1745
+ Pt === "application/xhtml+xml" && kt === Ye && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
1739
1746
  const ne = H ? H.createHTML(r) : r;
1740
- if (yt === Ye)
1747
+ if (kt === Ye)
1741
1748
  try {
1742
1749
  m = new k().parseFromString(ne, Pt);
1743
1750
  } catch {
1744
1751
  }
1745
1752
  if (!m || !m.documentElement) {
1746
- m = Ie.createDocument(yt, "template", null);
1753
+ m = Ie.createDocument(kt, "template", null);
1747
1754
  try {
1748
- m.documentElement.innerHTML = xn ? V : ne;
1755
+ m.documentElement.innerHTML = xn ? j : ne;
1749
1756
  } catch {
1750
1757
  }
1751
1758
  }
1752
1759
  const Y = m.body || m.documentElement;
1753
- return r && $ && Y.insertBefore(e.createTextNode($), Y.childNodes[0] || null), yt === Ye ? vt.call(m, pe ? "html" : "body")[0] : pe ? m.documentElement : Y;
1754
- }, "_initDocument"), ts = /* @__PURE__ */ u(function(r) {
1755
- return ce.call(
1760
+ return r && I && Y.insertBefore(e.createTextNode(I), Y.childNodes[0] || null), kt === Ye ? xt.call(m, pe ? "html" : "body")[0] : pe ? m.documentElement : Y;
1761
+ }, "_initDocument"), es = /* @__PURE__ */ u(function(r) {
1762
+ return ue.call(
1756
1763
  r.ownerDocument || r,
1757
1764
  r,
1758
1765
  // eslint-disable-next-line no-bitwise
1759
1766
  p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
1760
1767
  null
1761
1768
  );
1762
- }, "_createNodeIterator"), ns = /* @__PURE__ */ u(function(r) {
1769
+ }, "_createNodeIterator"), ts = /* @__PURE__ */ u(function(r) {
1763
1770
  r.normalize();
1764
- const m = ce.call(
1771
+ const m = ue.call(
1765
1772
  r.ownerDocument || r,
1766
1773
  r,
1767
1774
  // eslint-disable-next-line no-bitwise
1768
1775
  p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION,
1769
1776
  null
1770
1777
  );
1771
- let $ = m.nextNode();
1772
- for (; $; ) {
1773
- let ne = $.data;
1778
+ let I = m.nextNode();
1779
+ for (; I; ) {
1780
+ let ne = I.data;
1774
1781
  St([at, be, je], (Y) => {
1775
1782
  ne = Et(ne, Y, " ");
1776
- }), $.data = ne, $ = m.nextNode();
1783
+ }), I.data = ne, I = m.nextNode();
1777
1784
  }
1778
- }, "_scrubTemplateExpressions"), Jt = /* @__PURE__ */ u(function(r) {
1779
- const m = U ? U(r) : null;
1785
+ }, "_scrubTemplateExpressions"), Qt = /* @__PURE__ */ u(function(r) {
1786
+ const m = F ? F(r) : null;
1780
1787
  return typeof m != "string" || me(m) !== "form" ? !1 : typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
1781
1788
  // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
1782
1789
  // makes the direct read diverge from the cached read; a clean form
1783
1790
  // (same-realm OR foreign-realm) has both reads pointing at the same
1784
1791
  // canonical NamedNodeMap.
1785
- r.attributes !== B(r) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
1792
+ r.attributes !== N(r) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
1786
1793
  // returns the integer 1 for any Element regardless of realm; direct
1787
1794
  // read on a clobbered form (e.g. <input name="nodeType">) returns
1788
1795
  // the named child element. Cheap addition — nodeType is read from
1789
1796
  // an internal slot, no serialization cost — and removes a residual
1790
1797
  // clobbering surface used by several mXSS / PI / comment branches
1791
1798
  // in _sanitizeElements that compare currentNode.nodeType directly.
1792
- r.nodeType !== N(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
1799
+ r.nodeType !== z(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
1793
1800
  // "childNodes" shadows the prototype getter. Direct reads of
1794
1801
  // form.childNodes from a clobbered form return the named child
1795
1802
  // instead of the real NodeList, so any walk that reads it directly
@@ -1800,80 +1807,80 @@ function qs() {
1800
1807
  // select, etc.) regardless of whether the named child happens to
1801
1808
  // carry a numeric .length, which a typeof-based probe would miss
1802
1809
  // (e.g. HTMLSelectElement.length is a defined unsigned-long).
1803
- r.childNodes !== D(r);
1804
- }, "_isClobbered"), Bt = /* @__PURE__ */ u(function(r) {
1805
- if (!N || typeof r != "object" || r === null)
1810
+ r.childNodes !== $(r);
1811
+ }, "_isClobbered"), Ft = /* @__PURE__ */ u(function(r) {
1812
+ if (!z || typeof r != "object" || r === null)
1806
1813
  return !1;
1807
1814
  try {
1808
- return N(r) === Ze.documentFragment;
1815
+ return z(r) === Ze.documentFragment;
1809
1816
  } catch {
1810
1817
  return !1;
1811
1818
  }
1812
1819
  }, "_isDocumentFragment"), en = /* @__PURE__ */ u(function(r) {
1813
- if (!N || typeof r != "object" || r === null)
1820
+ if (!z || typeof r != "object" || r === null)
1814
1821
  return !1;
1815
1822
  try {
1816
- return typeof N(r) == "number";
1823
+ return typeof z(r) == "number";
1817
1824
  } catch {
1818
1825
  return !1;
1819
1826
  }
1820
1827
  }, "_isNode");
1821
- function tt(P, r, m) {
1822
- St(P, ($) => {
1823
- $.call(t, r, m, kt);
1828
+ function tt(B, r, m) {
1829
+ St(B, (I) => {
1830
+ I.call(t, r, m, wt);
1824
1831
  });
1825
1832
  }
1826
1833
  u(tt, "_executeHooks");
1827
- const ss = /* @__PURE__ */ u(function(r) {
1834
+ const ns = /* @__PURE__ */ u(function(r) {
1828
1835
  let m = null;
1829
- if (tt(oe.beforeSanitizeElements, r, null), Jt(r))
1830
- return Be(r), !0;
1831
- const $ = me(r.nodeName);
1832
- if (tt(oe.uponSanitizeElement, r, {
1833
- tagName: $,
1836
+ if (tt(ce.beforeSanitizeElements, r, null), Qt(r))
1837
+ return Fe(r), !0;
1838
+ const I = me(r.nodeName);
1839
+ if (tt(ce.uponSanitizeElement, r, {
1840
+ tagName: I,
1834
1841
  allowedTags: X
1835
- }), re && r.hasChildNodes() && !en(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || re && r.namespaceURI === Ye && $ === "style" && en(r.firstElementChild) || r.nodeType === Ze.progressingInstruction || re && r.nodeType === Ze.comment && we(/<[/\w]/g, r.data))
1836
- return Be(r), !0;
1837
- if (Ve[$] || !(A.tagCheck instanceof Function && A.tagCheck($)) && !X[$]) {
1838
- if (!Ve[$] && is($) && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, $) || te.tagNameCheck instanceof Function && te.tagNameCheck($)))
1842
+ }), le && r.hasChildNodes() && !en(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || le && r.namespaceURI === Ye && I === "style" && en(r.firstElementChild) || r.nodeType === Ze.progressingInstruction || le && r.nodeType === Ze.comment && we(/<[/\w]/g, r.data))
1843
+ return Fe(r), !0;
1844
+ if (Ve[I] || !(S.tagCheck instanceof Function && S.tagCheck(I)) && !X[I]) {
1845
+ if (!Ve[I] && as(I) && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, I) || te.tagNameCheck instanceof Function && te.tagNameCheck(I)))
1839
1846
  return !1;
1840
- if (v && !F[$]) {
1841
- const Y = J(r), le = D(r);
1842
- if (le && Y) {
1843
- const ze = le.length;
1847
+ if (v && !U[I]) {
1848
+ const Y = Q(r), oe = $(r);
1849
+ if (oe && Y) {
1850
+ const ze = oe.length;
1844
1851
  for (let Xe = ze - 1; Xe >= 0; --Xe) {
1845
- const Fe = w(le[Xe], !0);
1846
- Y.insertBefore(Fe, _(r));
1852
+ const Be = w(oe[Xe], !0);
1853
+ Y.insertBefore(Be, E(r));
1847
1854
  }
1848
1855
  }
1849
1856
  }
1850
- return Be(r), !0;
1857
+ return Fe(r), !0;
1851
1858
  }
1852
- return (N ? N(r) : r.nodeType) === Ze.element && !ha(r) || ($ === "noscript" || $ === "noembed" || $ === "noframes") && we(/<\/no(script|embed|frames)/i, r.innerHTML) ? (Be(r), !0) : (G && r.nodeType === Ze.text && (m = r.textContent, St([at, be, je], (Y) => {
1859
+ return (z ? z(r) : r.nodeType) === Ze.element && !da(r) || (I === "noscript" || I === "noembed" || I === "noframes") && we(/<\/no(script|embed|frames)/i, r.innerHTML) ? (Fe(r), !0) : (V && r.nodeType === Ze.text && (m = r.textContent, St([at, be, je], (Y) => {
1853
1860
  m = Et(m, Y, " ");
1854
1861
  }), r.textContent !== m && (At(t.removed, {
1855
1862
  element: r.cloneNode()
1856
- }), r.textContent = m)), tt(oe.afterSanitizeElements, r, null), !1);
1857
- }, "_sanitizeElements"), as = /* @__PURE__ */ u(function(r, m, $) {
1858
- if (g[m] || qe && (m === "id" || m === "name") && ($ in e || $ in da))
1863
+ }), r.textContent = m)), tt(ce.afterSanitizeElements, r, null), !1);
1864
+ }, "_sanitizeElements"), ss = /* @__PURE__ */ u(function(r, m, I) {
1865
+ if (g[m] || qe && (m === "id" || m === "name") && (I in e || I in ua))
1859
1866
  return !1;
1860
- const ne = ie[m] || A.attributeCheck instanceof Function && A.attributeCheck(m, r);
1861
- if (!(I && !g[m] && we(xt, m))) {
1867
+ const ne = ie[m] || S.attributeCheck instanceof Function && S.attributeCheck(m, r);
1868
+ if (!(M && !g[m] && we(bt, m))) {
1862
1869
  if (!(c && we(Ee, m))) {
1863
1870
  if (!ne || g[m]) {
1864
1871
  if (
1865
1872
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1866
1873
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1867
1874
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1868
- !(is(r) && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, r) || te.tagNameCheck instanceof Function && te.tagNameCheck(r)) && (te.attributeNameCheck instanceof RegExp && we(te.attributeNameCheck, m) || te.attributeNameCheck instanceof Function && te.attributeNameCheck(m, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1875
+ !(as(r) && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, r) || te.tagNameCheck instanceof Function && te.tagNameCheck(r)) && (te.attributeNameCheck instanceof RegExp && we(te.attributeNameCheck, m) || te.attributeNameCheck instanceof Function && te.attributeNameCheck(m, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1869
1876
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1870
- m === "is" && te.allowCustomizedBuiltInElements && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, $) || te.tagNameCheck instanceof Function && te.tagNameCheck($)))
1877
+ m === "is" && te.allowCustomizedBuiltInElements && (te.tagNameCheck instanceof RegExp && we(te.tagNameCheck, I) || te.tagNameCheck instanceof Function && te.tagNameCheck(I)))
1871
1878
  ) return !1;
1872
1879
  } else if (!vn[m]) {
1873
- if (!we(Ge, Et($, We, ""))) {
1874
- if (!((m === "src" || m === "xlink:href" || m === "href") && r !== "script" && ys($, "data:") === 0 && Ke[r])) {
1875
- if (!(L && !we(Le, Et($, We, "")))) {
1876
- if ($)
1880
+ if (!we(Ge, Et(I, We, ""))) {
1881
+ if (!((m === "src" || m === "xlink:href" || m === "href") && r !== "script" && bs(I, "data:") === 0 && Ke[r])) {
1882
+ if (!(L && !we(Le, Et(I, We, "")))) {
1883
+ if (I)
1877
1884
  return !1;
1878
1885
  }
1879
1886
  }
@@ -1882,14 +1889,14 @@ function qs() {
1882
1889
  }
1883
1890
  }
1884
1891
  return !0;
1885
- }, "_isValidAttribute"), pa = q({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), is = /* @__PURE__ */ u(function(r) {
1886
- return !pa[Vt(r)] && we(ke, r);
1887
- }, "_isBasicCustomElement"), rs = /* @__PURE__ */ u(function(r) {
1888
- tt(oe.beforeSanitizeAttributes, r, null);
1892
+ }, "_isValidAttribute"), ha = q({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), as = /* @__PURE__ */ u(function(r) {
1893
+ return !ha[Vt(r)] && we(ke, r);
1894
+ }, "_isBasicCustomElement"), is = /* @__PURE__ */ u(function(r) {
1895
+ tt(ce.beforeSanitizeAttributes, r, null);
1889
1896
  const m = r.attributes;
1890
- if (!m || Jt(r))
1897
+ if (!m || Qt(r))
1891
1898
  return;
1892
- const $ = {
1899
+ const I = {
1893
1900
  attrName: "",
1894
1901
  attrValue: "",
1895
1902
  keepAttr: !0,
@@ -1898,36 +1905,36 @@ function qs() {
1898
1905
  };
1899
1906
  let ne = m.length;
1900
1907
  for (; ne--; ) {
1901
- const Y = m[ne], le = Y.name, ze = Y.namespaceURI, Xe = Y.value, Fe = me(le), Tn = Xe;
1902
- let ye = le === "value" ? Tn : mi(Tn);
1903
- if ($.attrName = Fe, $.attrValue = ye, $.keepAttr = !0, $.forceKeepAttr = void 0, tt(oe.uponSanitizeAttribute, r, $), ye = $.attrValue, Pe && (Fe === "id" || Fe === "name") && ys(ye, C) !== 0 && (pt(le, r), ye = C + ye), re && we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ye)) {
1904
- pt(le, r);
1908
+ const Y = m[ne], oe = Y.name, ze = Y.namespaceURI, Xe = Y.value, Be = me(oe), Tn = Xe;
1909
+ let ye = oe === "value" ? Tn : mi(Tn);
1910
+ if (I.attrName = Be, I.attrValue = ye, I.keepAttr = !0, I.forceKeepAttr = void 0, tt(ce.uponSanitizeAttribute, r, I), ye = I.attrValue, Pe && (Be === "id" || Be === "name") && bs(ye, R) !== 0 && (ht(oe, r), ye = R + ye), le && we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, ye)) {
1911
+ ht(oe, r);
1905
1912
  continue;
1906
1913
  }
1907
- if (Fe === "attributename" && bs(ye, "href")) {
1908
- pt(le, r);
1914
+ if (Be === "attributename" && xs(ye, "href")) {
1915
+ ht(oe, r);
1909
1916
  continue;
1910
1917
  }
1911
- if ($.forceKeepAttr)
1918
+ if (I.forceKeepAttr)
1912
1919
  continue;
1913
- if (!$.keepAttr) {
1914
- pt(le, r);
1920
+ if (!I.keepAttr) {
1921
+ ht(oe, r);
1915
1922
  continue;
1916
1923
  }
1917
1924
  if (!O && we(/\/>/i, ye)) {
1918
- pt(le, r);
1925
+ ht(oe, r);
1919
1926
  continue;
1920
1927
  }
1921
- G && St([at, be, je], (os) => {
1922
- ye = Et(ye, os, " ");
1928
+ V && St([at, be, je], (ls) => {
1929
+ ye = Et(ye, ls, " ");
1923
1930
  });
1924
- const ls = me(r.nodeName);
1925
- if (!as(ls, Fe, ye)) {
1926
- pt(le, r);
1931
+ const rs = me(r.nodeName);
1932
+ if (!ss(rs, Be, ye)) {
1933
+ ht(oe, r);
1927
1934
  continue;
1928
1935
  }
1929
- if (H && typeof E == "object" && typeof E.getAttributeType == "function" && !ze)
1930
- switch (E.getAttributeType(ls, Fe)) {
1936
+ if (H && typeof A == "object" && typeof A.getAttributeType == "function" && !ze)
1937
+ switch (A.getAttributeType(rs, Be)) {
1931
1938
  case "TrustedHTML": {
1932
1939
  ye = H.createHTML(ye);
1933
1940
  break;
@@ -1939,77 +1946,77 @@ function qs() {
1939
1946
  }
1940
1947
  if (ye !== Tn)
1941
1948
  try {
1942
- ze ? r.setAttributeNS(ze, le, ye) : r.setAttribute(le, ye), Jt(r) ? Be(r) : xs(t.removed);
1949
+ ze ? r.setAttributeNS(ze, oe, ye) : r.setAttribute(oe, ye), Qt(r) ? Fe(r) : vs(t.removed);
1943
1950
  } catch {
1944
- pt(le, r);
1951
+ ht(oe, r);
1945
1952
  }
1946
1953
  }
1947
- tt(oe.afterSanitizeAttributes, r, null);
1954
+ tt(ce.afterSanitizeAttributes, r, null);
1948
1955
  }, "_sanitizeAttributes"), tn = /* @__PURE__ */ u(function(r) {
1949
1956
  let m = null;
1950
- const $ = ts(r);
1951
- for (tt(oe.beforeSanitizeShadowDOM, r, null); m = $.nextNode(); )
1952
- if (tt(oe.uponSanitizeShadowNode, m, null), ss(m), rs(m), Bt(m.content) && tn(m.content), (N ? N(m) : m.nodeType) === Ze.element) {
1953
- const Y = S ? S(m) : m.shadowRoot;
1954
- Bt(Y) && (wt(Y), tn(Y));
1957
+ const I = es(r);
1958
+ for (tt(ce.beforeSanitizeShadowDOM, r, null); m = I.nextNode(); )
1959
+ if (tt(ce.uponSanitizeShadowNode, m, null), ns(m), is(m), Ft(m.content) && tn(m.content), (z ? z(m) : m.nodeType) === Ze.element) {
1960
+ const Y = D ? D(m) : m.shadowRoot;
1961
+ Ft(Y) && (Tt(Y), tn(Y));
1955
1962
  }
1956
- tt(oe.afterSanitizeShadowDOM, r, null);
1957
- }, "_sanitizeShadowDOM"), wt = /* @__PURE__ */ u(function(r) {
1958
- const m = N ? N(r) : r.nodeType;
1963
+ tt(ce.afterSanitizeShadowDOM, r, null);
1964
+ }, "_sanitizeShadowDOM"), Tt = /* @__PURE__ */ u(function(r) {
1965
+ const m = z ? z(r) : r.nodeType;
1959
1966
  if (m === Ze.element) {
1960
- const Y = S ? S(r) : r.shadowRoot;
1961
- Bt(Y) && (wt(Y), tn(Y));
1967
+ const Y = D ? D(r) : r.shadowRoot;
1968
+ Ft(Y) && (Tt(Y), tn(Y));
1962
1969
  }
1963
- const $ = D ? D(r) : r.childNodes;
1964
- if (!$)
1970
+ const I = $ ? $(r) : r.childNodes;
1971
+ if (!I)
1965
1972
  return;
1966
1973
  const ne = [];
1967
- St($, (Y) => {
1974
+ St(I, (Y) => {
1968
1975
  At(ne, Y);
1969
1976
  });
1970
1977
  for (const Y of ne)
1971
- wt(Y);
1978
+ Tt(Y);
1972
1979
  if (m === Ze.element) {
1973
- const Y = U ? U(r) : null;
1980
+ const Y = F ? F(r) : null;
1974
1981
  if (typeof Y == "string" && me(Y) === "template") {
1975
- const le = r.content;
1976
- Bt(le) && wt(le);
1982
+ const oe = r.content;
1983
+ Ft(oe) && Tt(oe);
1977
1984
  }
1978
1985
  }
1979
1986
  }, "_sanitizeAttachedShadowRoots");
1980
- return t.sanitize = function(P) {
1981
- let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = null, $ = null, ne = null, Y = null;
1982
- if (xn = !P, xn && (P = "<!-->"), typeof P != "string" && !en(P) && (P = yi(P), typeof P != "string"))
1987
+ return t.sanitize = function(B) {
1988
+ let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = null, I = null, ne = null, Y = null;
1989
+ if (xn = !B, xn && (B = "<!-->"), typeof B != "string" && !en(B) && (B = yi(B), typeof B != "string"))
1983
1990
  throw Ht("dirty is not a string, aborting");
1984
1991
  if (!t.isSupported)
1985
- return P;
1986
- if (ue || wn(r), t.removed = [], typeof P == "string" && (y = !1), y) {
1987
- const Xe = U ? U(P) : P.nodeName;
1992
+ return B;
1993
+ if (de || wn(r), t.removed = [], typeof B == "string" && (b = !1), b) {
1994
+ const Xe = F ? F(B) : B.nodeName;
1988
1995
  if (typeof Xe == "string") {
1989
- const Fe = me(Xe);
1990
- if (!X[Fe] || Ve[Fe])
1996
+ const Be = me(Xe);
1997
+ if (!X[Be] || Ve[Be])
1991
1998
  throw Ht("root node is forbidden and cannot be sanitized in-place");
1992
1999
  }
1993
- if (Jt(P))
2000
+ if (Qt(B))
1994
2001
  throw Ht("root node is clobbered and cannot be sanitized in-place");
1995
- wt(P);
1996
- } else if (en(P))
1997
- m = es("<!---->"), $ = m.ownerDocument.importNode(P, !0), $.nodeType === Ze.element && $.nodeName === "BODY" || $.nodeName === "HTML" ? m = $ : m.appendChild($), wt($);
2002
+ Tt(B);
2003
+ } else if (en(B))
2004
+ m = Qn("<!---->"), I = m.ownerDocument.importNode(B, !0), I.nodeType === Ze.element && I.nodeName === "BODY" || I.nodeName === "HTML" ? m = I : m.appendChild(I), Tt(I);
1998
2005
  else {
1999
- if (!Te && !G && !pe && // eslint-disable-next-line unicorn/prefer-includes
2000
- P.indexOf("<") === -1)
2001
- return H && _e ? H.createHTML(P) : P;
2002
- if (m = es(P), !m)
2003
- return Te ? null : _e ? V : "";
2006
+ if (!Te && !V && !pe && // eslint-disable-next-line unicorn/prefer-includes
2007
+ B.indexOf("<") === -1)
2008
+ return H && _e ? H.createHTML(B) : B;
2009
+ if (m = Qn(B), !m)
2010
+ return Te ? null : _e ? j : "";
2004
2011
  }
2005
- m && fe && Be(m.firstChild);
2006
- const le = ts(y ? P : m);
2007
- for (; ne = le.nextNode(); )
2008
- ss(ne), rs(ne), Bt(ne.content) && tn(ne.content);
2009
- if (y)
2010
- return G && ns(P), P;
2012
+ m && fe && Fe(m.firstChild);
2013
+ const oe = es(b ? B : m);
2014
+ for (; ne = oe.nextNode(); )
2015
+ ns(ne), is(ne), Ft(ne.content) && tn(ne.content);
2016
+ if (b)
2017
+ return V && ts(B), B;
2011
2018
  if (Te) {
2012
- if (G && ns(m), De)
2019
+ if (V && ts(m), De)
2013
2020
  for (Y = $e.call(m.ownerDocument); m.firstChild; )
2014
2021
  Y.appendChild(m.firstChild);
2015
2022
  else
@@ -2018,43 +2025,43 @@ function qs() {
2018
2025
  }
2019
2026
  let ze = pe ? m.outerHTML : m.innerHTML;
2020
2027
  return pe && X["!doctype"] && m.ownerDocument && m.ownerDocument.doctype && m.ownerDocument.doctype.name && we(Ii, m.ownerDocument.doctype.name) && (ze = "<!DOCTYPE " + m.ownerDocument.doctype.name + `>
2021
- ` + ze), G && St([at, be, je], (Xe) => {
2028
+ ` + ze), V && St([at, be, je], (Xe) => {
2022
2029
  ze = Et(ze, Xe, " ");
2023
2030
  }), H && _e ? H.createHTML(ze) : ze;
2024
2031
  }, t.setConfig = function() {
2025
- let P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2026
- wn(P), ue = !0;
2032
+ let B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2033
+ wn(B), de = !0;
2027
2034
  }, t.clearConfig = function() {
2028
- kt = null, ue = !1;
2029
- }, t.isValidAttribute = function(P, r, m) {
2030
- kt || wn({});
2031
- const $ = me(P), ne = me(r);
2032
- return as($, ne, m);
2033
- }, t.addHook = function(P, r) {
2034
- typeof r == "function" && At(oe[P], r);
2035
- }, t.removeHook = function(P, r) {
2035
+ wt = null, de = !1;
2036
+ }, t.isValidAttribute = function(B, r, m) {
2037
+ wt || wn({});
2038
+ const I = me(B), ne = me(r);
2039
+ return ss(I, ne, m);
2040
+ }, t.addHook = function(B, r) {
2041
+ typeof r == "function" && At(ce[B], r);
2042
+ }, t.removeHook = function(B, r) {
2036
2043
  if (r !== void 0) {
2037
- const m = pi(oe[P], r);
2038
- return m === -1 ? void 0 : fi(oe[P], m, 1)[0];
2044
+ const m = pi(ce[B], r);
2045
+ return m === -1 ? void 0 : fi(ce[B], m, 1)[0];
2039
2046
  }
2040
- return xs(oe[P]);
2041
- }, t.removeHooks = function(P) {
2042
- oe[P] = [];
2047
+ return vs(ce[B]);
2048
+ }, t.removeHooks = function(B) {
2049
+ ce[B] = [];
2043
2050
  }, t.removeAllHooks = function() {
2044
- oe = Rs();
2051
+ ce = _s();
2045
2052
  }, t;
2046
2053
  }
2047
- u(qs, "createDOMPurify");
2048
- var Oi = qs();
2049
- function Bn() {
2054
+ u(Vs, "createDOMPurify");
2055
+ var Oi = Vs();
2056
+ function Pn() {
2050
2057
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
2051
2058
  }
2052
- u(Bn, "M");
2053
- var gt = Bn();
2054
- function Ks(a) {
2055
- gt = a;
2059
+ u(Pn, "M");
2060
+ var vt = Pn();
2061
+ function qs(a) {
2062
+ vt = a;
2056
2063
  }
2057
- u(Ks, "N");
2064
+ u(qs, "N");
2058
2065
  var ft = { exec: /* @__PURE__ */ u(() => null, "exec") };
2059
2066
  function _t(a) {
2060
2067
  let t = [];
@@ -2064,30 +2071,30 @@ function _t(a) {
2064
2071
  };
2065
2072
  }
2066
2073
  u(_t, "E");
2067
- function Q(a, t = "") {
2074
+ function J(a, t = "") {
2068
2075
  let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ u((i, s) => {
2069
2076
  let l = typeof s == "string" ? s : s.source;
2070
2077
  return l = l.replace(Ae.caret, "$1"), e = e.replace(i, l), n;
2071
2078
  }, "replace"), getRegex: /* @__PURE__ */ u(() => new RegExp(e, t), "getRegex") };
2072
2079
  return n;
2073
2080
  }
2074
- u(Q, "d");
2081
+ u(J, "d");
2075
2082
  var zi = ((a = "") => {
2076
2083
  try {
2077
2084
  return !!new RegExp("(?<=1)(?<!1)" + a);
2078
2085
  } catch {
2079
2086
  return !1;
2080
2087
  }
2081
- })(), Ae = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ u((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: _t((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: _t((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: _t((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: _t((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: _t((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: _t((a) => new RegExp(`^ {0,${a}}>`)) }, Ni = /^(?:[ \t]*(?:\n|$))+/, Pi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Bi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Xt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Fi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Fn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ys = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Xs = Q(Ys).replace(/bull/g, Fn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ui = Q(Ys).replace(/bull/g, Fn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Un = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Hi = /^[^\n]+/, Hn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ji = Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Hn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Wi = Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Fn).getRegex(), mn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", jn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Gi = Q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", jn).replace("tag", mn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Zs = Q(Un).replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", mn).getRegex(), Vi = Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Zs).getRegex(), Wn = { blockquote: Vi, code: Pi, def: ji, fences: Bi, heading: Fi, hr: Xt, html: Gi, lheading: Xs, list: Wi, newline: Ni, paragraph: Zs, table: ft, text: Hi }, Cs = Q("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", mn).getRegex(), qi = { ...Wn, lheading: Ui, table: Cs, paragraph: Q(Un).replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Cs).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", mn).getRegex() }, Ki = { ...Wn, html: Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", jn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: ft, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: Q(Un).replace("hr", Xt).replace("heading", ` *#{1,6} *[^
2082
- ]`).replace("lheading", Xs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Yi = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Xi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Qs = /^( {2,}|\\)\n(?!\s*$)/, Zi = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Nt = /[\p{P}\p{S}]/u, gn = /[\s\p{P}\p{S}]/u, Gn = /[^\s\p{P}\p{S}]/u, Qi = Q(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, gn).getRegex(), Js = /(?!~)[\p{P}\p{S}]/u, Ji = /(?!~)[\s\p{P}\p{S}]/u, er = /(?:[^\s\p{P}\p{S}]|~)/u, tr = Q(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", zi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ea = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, nr = Q(ea, "u").replace(/punct/g, Nt).getRegex(), sr = Q(ea, "u").replace(/punct/g, Js).getRegex(), ta = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ar = Q(ta, "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), ir = Q(ta, "gu").replace(/notPunctSpace/g, er).replace(/punctSpace/g, Ji).replace(/punct/g, Js).getRegex(), rr = Q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), lr = Q(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Nt).getRegex(), or = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", cr = Q(or, "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), ur = Q(/\\(punct)/, "gu").replace(/punct/g, Nt).getRegex(), dr = Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), hr = Q(jn).replace("(?:-->|$)", "-->").getRegex(), pr = Q("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", hr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), dn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, fr = Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", dn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), na = Q(/^!?\[(label)\]\[(ref)\]/).replace("label", dn).replace("ref", Hn).getRegex(), sa = Q(/^!?\[(ref)\](?:\[\])?/).replace("ref", Hn).getRegex(), mr = Q("reflink|nolink(?!\\()", "g").replace("reflink", na).replace("nolink", sa).getRegex(), Ms = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Vn = { _backpedal: ft, anyPunctuation: ur, autolink: dr, blockSkip: tr, br: Qs, code: Xi, del: ft, delLDelim: ft, delRDelim: ft, emStrongLDelim: nr, emStrongRDelimAst: ar, emStrongRDelimUnd: rr, escape: Yi, link: fr, nolink: sa, punctuation: Qi, reflink: na, reflinkSearch: mr, tag: pr, text: Zi, url: ft }, gr = { ...Vn, link: Q(/^!?\[(label)\]\((.*?)\)/).replace("label", dn).getRegex(), reflink: Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", dn).getRegex() }, Nn = { ...Vn, emStrongRDelimAst: ir, emStrongLDelim: sr, delLDelim: lr, delRDelim: cr, url: Q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Ms).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: Q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Ms).getRegex() }, vr = { ...Nn, br: Q(Qs).replace("{2,}", "*").getRegex(), text: Q(Nn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, rn = { normal: Wn, gfm: qi, pedantic: Ki }, jt = { normal: Vn, gfm: Nn, breaks: vr, pedantic: gr }, xr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Is = /* @__PURE__ */ u((a) => xr[a], "ge");
2088
+ })(), Ae = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ u((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: _t((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: _t((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: _t((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: _t((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: _t((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: _t((a) => new RegExp(`^ {0,${a}}>`)) }, Ni = /^(?:[ \t]*(?:\n|$))+/, Pi = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Fi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Xt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Bi = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Fn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ks = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ys = J(Ks).replace(/bull/g, Fn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ui = J(Ks).replace(/bull/g, Fn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Bn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Hi = /^[^\n]+/, Un = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ji = J(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Un).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Wi = J(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Fn).getRegex(), mn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Hn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Gi = J("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Hn).replace("tag", mn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Xs = J(Bn).replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", mn).getRegex(), Vi = J(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Xs).getRegex(), jn = { blockquote: Vi, code: Pi, def: ji, fences: Fi, heading: Bi, hr: Xt, html: Gi, lheading: Ys, list: Wi, newline: Ni, paragraph: Xs, table: ft, text: Hi }, Rs = J("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", mn).getRegex(), qi = { ...jn, lheading: Ui, table: Rs, paragraph: J(Bn).replace("hr", Xt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Rs).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", mn).getRegex() }, Ki = { ...jn, html: J(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Hn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: ft, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: J(Bn).replace("hr", Xt).replace("heading", ` *#{1,6} *[^
2089
+ ]`).replace("lheading", Ys).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Yi = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Xi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Zs = /^( {2,}|\\)\n(?!\s*$)/, Zi = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Nt = /[\p{P}\p{S}]/u, gn = /[\s\p{P}\p{S}]/u, Wn = /[^\s\p{P}\p{S}]/u, Ji = J(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, gn).getRegex(), Js = /(?!~)[\p{P}\p{S}]/u, Qi = /(?!~)[\s\p{P}\p{S}]/u, er = /(?:[^\s\p{P}\p{S}]|~)/u, tr = J(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", zi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Qs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, nr = J(Qs, "u").replace(/punct/g, Nt).getRegex(), sr = J(Qs, "u").replace(/punct/g, Js).getRegex(), ea = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ar = J(ea, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), ir = J(ea, "gu").replace(/notPunctSpace/g, er).replace(/punctSpace/g, Qi).replace(/punct/g, Js).getRegex(), rr = J("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), lr = J(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Nt).getRegex(), or = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", cr = J(or, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, gn).replace(/punct/g, Nt).getRegex(), ur = J(/\\(punct)/, "gu").replace(/punct/g, Nt).getRegex(), dr = J(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), hr = J(Hn).replace("(?:-->|$)", "-->").getRegex(), pr = J("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", hr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), dn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, fr = J(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", dn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ta = J(/^!?\[(label)\]\[(ref)\]/).replace("label", dn).replace("ref", Un).getRegex(), na = J(/^!?\[(ref)\](?:\[\])?/).replace("ref", Un).getRegex(), mr = J("reflink|nolink(?!\\()", "g").replace("reflink", ta).replace("nolink", na).getRegex(), Cs = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Gn = { _backpedal: ft, anyPunctuation: ur, autolink: dr, blockSkip: tr, br: Zs, code: Xi, del: ft, delLDelim: ft, delRDelim: ft, emStrongLDelim: nr, emStrongRDelimAst: ar, emStrongRDelimUnd: rr, escape: Yi, link: fr, nolink: na, punctuation: Ji, reflink: ta, reflinkSearch: mr, tag: pr, text: Zi, url: ft }, gr = { ...Gn, link: J(/^!?\[(label)\]\((.*?)\)/).replace("label", dn).getRegex(), reflink: J(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", dn).getRegex() }, zn = { ...Gn, emStrongRDelimAst: ir, emStrongLDelim: sr, delLDelim: lr, delRDelim: cr, url: J(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Cs).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: J(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Cs).getRegex() }, vr = { ...zn, br: J(Zs).replace("{2,}", "*").getRegex(), text: J(zn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, rn = { normal: jn, gfm: qi, pedantic: Ki }, jt = { normal: Gn, gfm: zn, breaks: vr, pedantic: gr }, xr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Ms = /* @__PURE__ */ u((a) => xr[a], "ge");
2083
2090
  function et(a, t) {
2084
2091
  if (t) {
2085
- if (Ae.escapeTest.test(a)) return a.replace(Ae.escapeReplace, Is);
2086
- } else if (Ae.escapeTestNoEncode.test(a)) return a.replace(Ae.escapeReplaceNoEncode, Is);
2092
+ if (Ae.escapeTest.test(a)) return a.replace(Ae.escapeReplace, Ms);
2093
+ } else if (Ae.escapeTestNoEncode.test(a)) return a.replace(Ae.escapeReplaceNoEncode, Ms);
2087
2094
  return a;
2088
2095
  }
2089
2096
  u(et, "O");
2090
- function $s(a) {
2097
+ function Is(a) {
2091
2098
  try {
2092
2099
  a = encodeURI(a).replace(Ae.percentDecode, "%");
2093
2100
  } catch {
@@ -2095,8 +2102,8 @@ function $s(a) {
2095
2102
  }
2096
2103
  return a;
2097
2104
  }
2098
- u($s, "V");
2099
- function Ds(a, t) {
2105
+ u(Is, "V");
2106
+ function $s(a, t) {
2100
2107
  let e = a.replace(Ae.findPipe, (s, l, o) => {
2101
2108
  let p = !1, d = l;
2102
2109
  for (; --d >= 0 && o[d] === "\\"; ) p = !p;
@@ -2107,7 +2114,7 @@ function Ds(a, t) {
2107
2114
  for (; i < n.length; i++) n[i] = n[i].trim().replace(Ae.slashPipe, "|");
2108
2115
  return n;
2109
2116
  }
2110
- u(Ds, "Y");
2117
+ u($s, "Y");
2111
2118
  function lt(a, t, e) {
2112
2119
  let n = a.length;
2113
2120
  if (n === 0) return "";
@@ -2117,14 +2124,14 @@ function lt(a, t, e) {
2117
2124
  return a.slice(0, n - i);
2118
2125
  }
2119
2126
  u(lt, "$");
2120
- function Ls(a) {
2127
+ function Ds(a) {
2121
2128
  let t = a.split(`
2122
2129
  `), e = t.length - 1;
2123
2130
  for (; e >= 0 && Ae.blankLine.test(t[e]); ) e--;
2124
2131
  return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
2125
2132
  `);
2126
2133
  }
2127
- u(Ls, "ee");
2134
+ u(Ds, "ee");
2128
2135
  function br(a, t) {
2129
2136
  if (a.indexOf(t[1]) === -1) return -1;
2130
2137
  let e = 0;
@@ -2143,13 +2150,13 @@ function yr(a, t = 0) {
2143
2150
  return n;
2144
2151
  }
2145
2152
  u(yr, "me");
2146
- function Os(a, t, e, n, i) {
2153
+ function Ls(a, t, e, n, i) {
2147
2154
  let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
2148
2155
  n.state.inLink = !0;
2149
2156
  let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
2150
2157
  return n.state.inLink = !1, p;
2151
2158
  }
2152
- u(Os, "xe");
2159
+ u(Ls, "xe");
2153
2160
  function kr(a, t, e) {
2154
2161
  let n = a.match(e.other.indentCodeCompensation);
2155
2162
  if (n === null) return t;
@@ -2166,10 +2173,10 @@ function kr(a, t, e) {
2166
2173
  u(kr, "st");
2167
2174
  var Dt, hn = (Dt = class {
2168
2175
  constructor(t) {
2169
- z(this, "options");
2170
- z(this, "rules");
2171
- z(this, "lexer");
2172
- this.options = t || gt;
2176
+ P(this, "options");
2177
+ P(this, "rules");
2178
+ P(this, "lexer");
2179
+ this.options = t || vt;
2173
2180
  }
2174
2181
  space(t) {
2175
2182
  let e = this.rules.block.newline.exec(t);
@@ -2178,7 +2185,7 @@ var Dt, hn = (Dt = class {
2178
2185
  code(t) {
2179
2186
  let e = this.rules.block.code.exec(t);
2180
2187
  if (e) {
2181
- let n = this.options.pedantic ? e[0] : Ls(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
2188
+ let n = this.options.pedantic ? e[0] : Ds(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
2182
2189
  return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
2183
2190
  }
2184
2191
  }
@@ -2219,26 +2226,26 @@ var Dt, hn = (Dt = class {
2219
2226
  else break;
2220
2227
  n = n.slice(d);
2221
2228
  let k = p.join(`
2222
- `), E = k.replace(this.rules.other.blockquoteSetextReplace, `
2229
+ `), A = k.replace(this.rules.other.blockquoteSetextReplace, `
2223
2230
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
2224
2231
  i = i ? `${i}
2225
2232
  ${k}` : k, s = s ? `${s}
2226
- ${E}` : E;
2233
+ ${A}` : A;
2227
2234
  let x = this.lexer.state.top;
2228
- if (this.lexer.state.top = !0, this.lexer.blockTokens(E, l, !0), this.lexer.state.top = x, n.length === 0) break;
2235
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(A, l, !0), this.lexer.state.top = x, n.length === 0) break;
2229
2236
  let w = l.at(-1);
2230
2237
  if (w?.type === "code") break;
2231
2238
  if (w?.type === "blockquote") {
2232
- let M = w, _ = M.raw + `
2239
+ let C = w, E = C.raw + `
2233
2240
  ` + n.join(`
2234
- `), D = this.blockquote(_);
2235
- l[l.length - 1] = D, i = i.substring(0, i.length - M.raw.length) + D.raw, s = s.substring(0, s.length - M.text.length) + D.text;
2241
+ `), $ = this.blockquote(E);
2242
+ l[l.length - 1] = $, i = i.substring(0, i.length - C.raw.length) + $.raw, s = s.substring(0, s.length - C.text.length) + $.text;
2236
2243
  break;
2237
2244
  } else if (w?.type === "list") {
2238
- let M = w, _ = M.raw + `
2245
+ let C = w, E = C.raw + `
2239
2246
  ` + n.join(`
2240
- `), D = this.list(_);
2241
- l[l.length - 1] = D, i = i.substring(0, i.length - w.raw.length) + D.raw, s = s.substring(0, s.length - M.raw.length) + D.raw, n = _.substring(l.at(-1).raw.length).split(`
2247
+ `), $ = this.list(E);
2248
+ l[l.length - 1] = $, i = i.substring(0, i.length - w.raw.length) + $.raw, s = s.substring(0, s.length - C.raw.length) + $.raw, n = E.substring(l.at(-1).raw.length).split(`
2242
2249
  `);
2243
2250
  continue;
2244
2251
  }
@@ -2253,31 +2260,31 @@ ${E}` : E;
2253
2260
  n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
2254
2261
  let l = this.rules.other.listItemRegex(n), o = !1;
2255
2262
  for (; t; ) {
2256
- let d = !1, k = "", E = "";
2263
+ let d = !1, k = "", A = "";
2257
2264
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
2258
2265
  k = e[0], t = t.substring(k.length);
2259
2266
  let x = yr(e[2].split(`
2260
2267
  `, 1)[0], e[1].length), w = t.split(`
2261
- `, 1)[0], M = !x.trim(), _ = 0;
2262
- if (this.options.pedantic ? (_ = 2, E = x.trimStart()) : M ? _ = e[1].length + 1 : (_ = x.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, E = x.slice(_), _ += e[1].length), M && this.rules.other.blankLine.test(w) && (k += w + `
2268
+ `, 1)[0], C = !x.trim(), E = 0;
2269
+ if (this.options.pedantic ? (E = 2, A = x.trimStart()) : C ? E = e[1].length + 1 : (E = x.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, A = x.slice(E), E += e[1].length), C && this.rules.other.blankLine.test(w) && (k += w + `
2263
2270
  `, t = t.substring(w.length + 1), d = !0), !d) {
2264
- let D = this.rules.other.nextBulletRegex(_), J = this.rules.other.hrRegex(_), S = this.rules.other.fencesBeginRegex(_), B = this.rules.other.headingBeginRegex(_), N = this.rules.other.htmlBeginRegex(_), U = this.rules.other.blockquoteBeginRegex(_);
2271
+ let $ = this.rules.other.nextBulletRegex(E), Q = this.rules.other.hrRegex(E), D = this.rules.other.fencesBeginRegex(E), N = this.rules.other.headingBeginRegex(E), z = this.rules.other.htmlBeginRegex(E), F = this.rules.other.blockquoteBeginRegex(E);
2265
2272
  for (; t; ) {
2266
2273
  let H = t.split(`
2267
- `, 1)[0], V;
2268
- if (w = H, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "), V = w) : V = w.replace(this.rules.other.tabCharGlobal, " "), S.test(w) || B.test(w) || N.test(w) || U.test(w) || D.test(w) || J.test(w)) break;
2269
- if (V.search(this.rules.other.nonSpaceChar) >= _ || !w.trim()) E += `
2270
- ` + V.slice(_);
2274
+ `, 1)[0], j;
2275
+ if (w = H, this.options.pedantic ? (w = w.replace(this.rules.other.listReplaceNesting, " "), j = w) : j = w.replace(this.rules.other.tabCharGlobal, " "), D.test(w) || N.test(w) || z.test(w) || F.test(w) || $.test(w) || Q.test(w)) break;
2276
+ if (j.search(this.rules.other.nonSpaceChar) >= E || !w.trim()) A += `
2277
+ ` + j.slice(E);
2271
2278
  else {
2272
- if (M || x.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || S.test(x) || B.test(x) || J.test(x)) break;
2273
- E += `
2279
+ if (C || x.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || D.test(x) || N.test(x) || Q.test(x)) break;
2280
+ A += `
2274
2281
  ` + w;
2275
2282
  }
2276
- M = !w.trim(), k += H + `
2277
- `, t = t.substring(H.length + 1), x = V.slice(_);
2283
+ C = !w.trim(), k += H + `
2284
+ `, t = t.substring(H.length + 1), x = j.slice(E);
2278
2285
  }
2279
2286
  }
2280
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(k) && (o = !0)), s.items.push({ type: "list_item", raw: k, task: !!this.options.gfm && this.rules.other.listIsTask.test(E), loose: !1, text: E, tokens: [] }), s.raw += k;
2287
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(k) && (o = !0)), s.items.push({ type: "list_item", raw: k, task: !!this.options.gfm && this.rules.other.listIsTask.test(A), loose: !1, text: A, tokens: [] }), s.raw += k;
2281
2288
  }
2282
2289
  let p = s.items.at(-1);
2283
2290
  if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
@@ -2292,14 +2299,14 @@ ${E}` : E;
2292
2299
  this.lexer.inlineQueue[x].src = this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask, "");
2293
2300
  break;
2294
2301
  }
2295
- let E = this.rules.other.listTaskCheckbox.exec(d.raw);
2296
- if (E) {
2297
- let x = { type: "checkbox", raw: E[0] + " ", checked: E[0] !== "[ ]" };
2302
+ let A = this.rules.other.listTaskCheckbox.exec(d.raw);
2303
+ if (A) {
2304
+ let x = { type: "checkbox", raw: A[0] + " ", checked: A[0] !== "[ ]" };
2298
2305
  d.checked = x.checked, s.loose ? d.tokens[0] && ["paragraph", "text"].includes(d.tokens[0].type) && "tokens" in d.tokens[0] && d.tokens[0].tokens ? (d.tokens[0].raw = x.raw + d.tokens[0].raw, d.tokens[0].text = x.raw + d.tokens[0].text, d.tokens[0].tokens.unshift(x)) : d.tokens.unshift({ type: "paragraph", raw: x.raw, text: x.raw, tokens: [x] }) : d.tokens.unshift(x);
2299
2306
  }
2300
2307
  } else d.task && (d.task = !1);
2301
2308
  if (!s.loose) {
2302
- let E = d.tokens.filter((w) => w.type === "space"), x = E.length > 0 && E.some((w) => this.rules.other.anyLine.test(w.raw));
2309
+ let A = d.tokens.filter((w) => w.type === "space"), x = A.length > 0 && A.some((w) => this.rules.other.anyLine.test(w.raw));
2303
2310
  s.loose = x;
2304
2311
  }
2305
2312
  }
@@ -2313,7 +2320,7 @@ ${E}` : E;
2313
2320
  html(t) {
2314
2321
  let e = this.rules.block.html.exec(t);
2315
2322
  if (e) {
2316
- let n = Ls(e[0]);
2323
+ let n = Ds(e[0]);
2317
2324
  return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
2318
2325
  }
2319
2326
  }
@@ -2328,13 +2335,13 @@ ${E}` : E;
2328
2335
  table(t) {
2329
2336
  let e = this.rules.block.table.exec(t);
2330
2337
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
2331
- let n = Ds(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
2338
+ let n = $s(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
2332
2339
  `) : [], l = { type: "table", raw: lt(e[0], `
2333
2340
  `), header: [], align: [], rows: [] };
2334
2341
  if (n.length === i.length) {
2335
2342
  for (let o of i) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
2336
2343
  for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
2337
- for (let o of s) l.rows.push(Ds(o, l.header.length).map((p, d) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[d] })));
2344
+ for (let o of s) l.rows.push($s(o, l.header.length).map((p, d) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[d] })));
2338
2345
  return l;
2339
2346
  }
2340
2347
  }
@@ -2387,7 +2394,7 @@ ${E}` : E;
2387
2394
  let l = this.rules.other.pedanticHrefTitle.exec(i);
2388
2395
  l && (i = l[1], s = l[3]);
2389
2396
  } else s = e[3] ? e[3].slice(1, -1) : "";
2390
- return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), Os(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
2397
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), Ls(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
2391
2398
  }
2392
2399
  }
2393
2400
  reflink(t, e) {
@@ -2398,7 +2405,7 @@ ${E}` : E;
2398
2405
  let l = n[0].charAt(0);
2399
2406
  return { type: "text", raw: l, text: l };
2400
2407
  }
2401
- return Os(n, s, n[0], this.lexer, this.rules);
2408
+ return Ls(n, s, n[0], this.lexer, this.rules);
2402
2409
  }
2403
2410
  }
2404
2411
  emStrong(t, e, n = "") {
@@ -2416,10 +2423,10 @@ ${E}` : E;
2416
2423
  }
2417
2424
  if (p -= o, p > 0) continue;
2418
2425
  o = Math.min(o, o + p + d);
2419
- let E = [...i[0]][0].length, x = t.slice(0, s + i.index + E + o);
2426
+ let A = [...i[0]][0].length, x = t.slice(0, s + i.index + A + o);
2420
2427
  if (Math.min(s, o) % 2) {
2421
- let M = x.slice(1, -1);
2422
- return { type: "em", raw: x, text: M, tokens: this.lexer.inlineTokens(M) };
2428
+ let C = x.slice(1, -1);
2429
+ return { type: "em", raw: x, text: C, tokens: this.lexer.inlineTokens(C) };
2423
2430
  }
2424
2431
  let w = x.slice(2, -2);
2425
2432
  return { type: "strong", raw: x, text: w, tokens: this.lexer.inlineTokens(w) };
@@ -2449,8 +2456,8 @@ ${E}` : E;
2449
2456
  }
2450
2457
  if (p -= o, p > 0) continue;
2451
2458
  o = Math.min(o, o + p);
2452
- let k = [...i[0]][0].length, E = t.slice(0, s + i.index + k + o), x = E.slice(s, -s);
2453
- return { type: "del", raw: E, text: x, tokens: this.lexer.inlineTokens(x) };
2459
+ let k = [...i[0]][0].length, A = t.slice(0, s + i.index + k + o), x = A.slice(s, -s);
2460
+ return { type: "del", raw: A, text: x, tokens: this.lexer.inlineTokens(x) };
2454
2461
  }
2455
2462
  }
2456
2463
  }
@@ -2483,14 +2490,14 @@ ${E}` : E;
2483
2490
  return { type: "text", raw: e[0], text: e[0], escaped: n };
2484
2491
  }
2485
2492
  }
2486
- }, u(Dt, "w"), Dt), dt, Ue = (dt = class {
2493
+ }, u(Dt, "w"), Dt), ut, Ue = (ut = class {
2487
2494
  constructor(t) {
2488
- z(this, "tokens");
2489
- z(this, "options");
2490
- z(this, "state");
2491
- z(this, "inlineQueue");
2492
- z(this, "tokenizer");
2493
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || gt, this.options.tokenizer = this.options.tokenizer || new hn(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
2495
+ P(this, "tokens");
2496
+ P(this, "options");
2497
+ P(this, "state");
2498
+ P(this, "inlineQueue");
2499
+ P(this, "tokenizer");
2500
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || vt, this.options.tokenizer = this.options.tokenizer || new hn(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
2494
2501
  let e = { other: Ae, block: rn.normal, inline: jt.normal };
2495
2502
  this.options.pedantic ? (e.block = rn.pedantic, e.inline = jt.pedantic) : this.options.gfm && (e.block = rn.gfm, this.options.breaks ? e.inline = jt.breaks : e.inline = jt.gfm), this.tokenizer.rules = e;
2496
2503
  }
@@ -2498,10 +2505,10 @@ ${E}` : E;
2498
2505
  return { block: rn, inline: jt };
2499
2506
  }
2500
2507
  static lex(t, e) {
2501
- return new dt(e).lex(t);
2508
+ return new ut(e).lex(t);
2502
2509
  }
2503
2510
  static lexInline(t, e) {
2504
- return new dt(e).inlineTokens(t);
2511
+ return new ut(e).inlineTokens(t);
2505
2512
  }
2506
2513
  lex(t) {
2507
2514
  t = t.replace(Ae.carriageReturn, `
@@ -2634,7 +2641,7 @@ ${E}` : E;
2634
2641
  }
2635
2642
  l || (o = ""), l = !1;
2636
2643
  let d;
2637
- if (this.options.extensions?.inline?.some((E) => (d = E.call({ lexer: this }, t, e)) ? (t = t.substring(d.raw.length), e.push(d), !0) : !1)) continue;
2644
+ if (this.options.extensions?.inline?.some((A) => (d = A.call({ lexer: this }, t, e)) ? (t = t.substring(d.raw.length), e.push(d), !0) : !1)) continue;
2638
2645
  if (d = this.tokenizer.escape(t)) {
2639
2646
  t = t.substring(d.raw.length), e.push(d);
2640
2647
  continue;
@@ -2649,8 +2656,8 @@ ${E}` : E;
2649
2656
  }
2650
2657
  if (d = this.tokenizer.reflink(t, this.tokens.links)) {
2651
2658
  t = t.substring(d.raw.length);
2652
- let E = e.at(-1);
2653
- d.type === "text" && E?.type === "text" ? (E.raw += d.raw, E.text += d.text) : e.push(d);
2659
+ let A = e.at(-1);
2660
+ d.type === "text" && A?.type === "text" ? (A.raw += d.raw, A.text += d.text) : e.push(d);
2654
2661
  continue;
2655
2662
  }
2656
2663
  if (d = this.tokenizer.emStrong(t, n, o)) {
@@ -2679,15 +2686,15 @@ ${E}` : E;
2679
2686
  }
2680
2687
  let k = t;
2681
2688
  if (this.options.extensions?.startInline) {
2682
- let E = 1 / 0, x = t.slice(1), w;
2683
- this.options.extensions.startInline.forEach((M) => {
2684
- w = M.call({ lexer: this }, x), typeof w == "number" && w >= 0 && (E = Math.min(E, w));
2685
- }), E < 1 / 0 && E >= 0 && (k = t.substring(0, E + 1));
2689
+ let A = 1 / 0, x = t.slice(1), w;
2690
+ this.options.extensions.startInline.forEach((C) => {
2691
+ w = C.call({ lexer: this }, x), typeof w == "number" && w >= 0 && (A = Math.min(A, w));
2692
+ }), A < 1 / 0 && A >= 0 && (k = t.substring(0, A + 1));
2686
2693
  }
2687
2694
  if (d = this.tokenizer.inlineText(k)) {
2688
2695
  t = t.substring(d.raw.length), d.raw.slice(-1) !== "_" && (o = d.raw.slice(-1)), l = !0;
2689
- let E = e.at(-1);
2690
- E?.type === "text" ? (E.raw += d.raw, E.text += d.text) : e.push(d);
2696
+ let A = e.at(-1);
2697
+ A?.type === "text" ? (A.raw += d.raw, A.text += d.text) : e.push(d);
2691
2698
  continue;
2692
2699
  }
2693
2700
  if (t) {
@@ -2702,11 +2709,11 @@ ${E}` : E;
2702
2709
  if (this.options.silent) console.error(e);
2703
2710
  else throw new Error(e);
2704
2711
  }
2705
- }, u(dt, "l"), dt), Lt, pn = (Lt = class {
2712
+ }, u(ut, "l"), ut), Lt, pn = (Lt = class {
2706
2713
  constructor(t) {
2707
- z(this, "options");
2708
- z(this, "parser");
2709
- this.options = t || gt;
2714
+ P(this, "options");
2715
+ P(this, "parser");
2716
+ this.options = t || vt;
2710
2717
  }
2711
2718
  space(t) {
2712
2719
  return "";
@@ -2802,7 +2809,7 @@ ${t}</tr>
2802
2809
  return `<del>${this.parser.parseInline(t)}</del>`;
2803
2810
  }
2804
2811
  link({ href: t, title: e, tokens: n }) {
2805
- let i = this.parser.parseInline(n), s = $s(t);
2812
+ let i = this.parser.parseInline(n), s = Is(t);
2806
2813
  if (s === null) return i;
2807
2814
  t = s;
2808
2815
  let l = '<a href="' + t + '"';
@@ -2810,7 +2817,7 @@ ${t}</tr>
2810
2817
  }
2811
2818
  image({ href: t, title: e, text: n, tokens: i }) {
2812
2819
  i && (n = this.parser.parseInline(i, this.parser.textRenderer));
2813
- let s = $s(t);
2820
+ let s = Is(t);
2814
2821
  if (s === null) return et(n);
2815
2822
  t = s;
2816
2823
  let l = `<img src="${t}" alt="${et(n)}"`;
@@ -2819,7 +2826,7 @@ ${t}</tr>
2819
2826
  text(t) {
2820
2827
  return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : et(t.text);
2821
2828
  }
2822
- }, u(Lt, "y"), Lt), Ot, qn = (Ot = class {
2829
+ }, u(Lt, "y"), Lt), Ot, Vn = (Ot = class {
2823
2830
  strong({ text: t }) {
2824
2831
  return t;
2825
2832
  }
@@ -2850,18 +2857,18 @@ ${t}</tr>
2850
2857
  checkbox({ raw: t }) {
2851
2858
  return t;
2852
2859
  }
2853
- }, u(Ot, "L"), Ot), ht, He = (ht = class {
2860
+ }, u(Ot, "L"), Ot), dt, He = (dt = class {
2854
2861
  constructor(t) {
2855
- z(this, "options");
2856
- z(this, "renderer");
2857
- z(this, "textRenderer");
2858
- this.options = t || gt, this.options.renderer = this.options.renderer || new pn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new qn();
2862
+ P(this, "options");
2863
+ P(this, "renderer");
2864
+ P(this, "textRenderer");
2865
+ this.options = t || vt, this.options.renderer = this.options.renderer || new pn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Vn();
2859
2866
  }
2860
2867
  static parse(t, e) {
2861
- return new ht(e).parse(t);
2868
+ return new dt(e).parse(t);
2862
2869
  }
2863
2870
  static parseInline(t, e) {
2864
- return new ht(e).parseInline(t);
2871
+ return new dt(e).parseInline(t);
2865
2872
  }
2866
2873
  parse(t) {
2867
2874
  this.renderer.parser = this;
@@ -3001,11 +3008,11 @@ ${t}</tr>
3001
3008
  }
3002
3009
  return n;
3003
3010
  }
3004
- }, u(ht, "l"), ht), ct, qt = (ct = class {
3011
+ }, u(dt, "l"), dt), ct, qt = (ct = class {
3005
3012
  constructor(t) {
3006
- z(this, "options");
3007
- z(this, "block");
3008
- this.options = t || gt;
3013
+ P(this, "options");
3014
+ P(this, "block");
3015
+ this.options = t || vt;
3009
3016
  }
3010
3017
  preprocess(t) {
3011
3018
  return t;
@@ -3025,18 +3032,18 @@ ${t}</tr>
3025
3032
  provideParser(t = this.block) {
3026
3033
  return t ? He.parse : He.parseInline;
3027
3034
  }
3028
- }, u(ct, "P"), z(ct, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), z(ct, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ct), zt, wr = (zt = class {
3035
+ }, u(ct, "P"), P(ct, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), P(ct, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ct), zt, wr = (zt = class {
3029
3036
  constructor(...t) {
3030
- z(this, "defaults", Bn());
3031
- z(this, "options", this.setOptions);
3032
- z(this, "parse", this.parseMarkdown(!0));
3033
- z(this, "parseInline", this.parseMarkdown(!1));
3034
- z(this, "Parser", He);
3035
- z(this, "Renderer", pn);
3036
- z(this, "TextRenderer", qn);
3037
- z(this, "Lexer", Ue);
3038
- z(this, "Tokenizer", hn);
3039
- z(this, "Hooks", qt);
3037
+ P(this, "defaults", Pn());
3038
+ P(this, "options", this.setOptions);
3039
+ P(this, "parse", this.parseMarkdown(!0));
3040
+ P(this, "parseInline", this.parseMarkdown(!1));
3041
+ P(this, "Parser", He);
3042
+ P(this, "Renderer", pn);
3043
+ P(this, "TextRenderer", Vn);
3044
+ P(this, "Lexer", Ue);
3045
+ P(this, "Tokenizer", hn);
3046
+ P(this, "Hooks", qt);
3040
3047
  this.use(...t);
3041
3048
  }
3042
3049
  walkTokens(t, e) {
@@ -3089,8 +3096,8 @@ ${t}</tr>
3089
3096
  if (["options", "parser"].includes(l)) continue;
3090
3097
  let o = l, p = n.renderer[o], d = s[o];
3091
3098
  s[o] = (...k) => {
3092
- let E = p.apply(s, k);
3093
- return E === !1 && (E = d.apply(s, k)), E || "";
3099
+ let A = p.apply(s, k);
3100
+ return A === !1 && (A = d.apply(s, k)), A || "";
3094
3101
  };
3095
3102
  }
3096
3103
  i.renderer = s;
@@ -3102,8 +3109,8 @@ ${t}</tr>
3102
3109
  if (["options", "rules", "lexer"].includes(l)) continue;
3103
3110
  let o = l, p = n.tokenizer[o], d = s[o];
3104
3111
  s[o] = (...k) => {
3105
- let E = p.apply(s, k);
3106
- return E === !1 && (E = d.apply(s, k)), E;
3112
+ let A = p.apply(s, k);
3113
+ return A === !1 && (A = d.apply(s, k)), A;
3107
3114
  };
3108
3115
  }
3109
3116
  i.tokenizer = s;
@@ -3119,15 +3126,15 @@ ${t}</tr>
3119
3126
  let x = await p.call(s, k);
3120
3127
  return d.call(s, x);
3121
3128
  })();
3122
- let E = p.call(s, k);
3123
- return d.call(s, E);
3129
+ let A = p.call(s, k);
3130
+ return d.call(s, A);
3124
3131
  } : s[o] = (...k) => {
3125
3132
  if (this.defaults.async) return (async () => {
3126
3133
  let x = await p.apply(s, k);
3127
3134
  return x === !1 && (x = await d.apply(s, k)), x;
3128
3135
  })();
3129
- let E = p.apply(s, k);
3130
- return E === !1 && (E = d.apply(s, k)), E;
3136
+ let A = p.apply(s, k);
3137
+ return A === !1 && (A = d.apply(s, k)), A;
3131
3138
  };
3132
3139
  }
3133
3140
  i.hooks = s;
@@ -3185,27 +3192,27 @@ Please report this to https://github.com/markedjs/marked.`, t) {
3185
3192
  throw n;
3186
3193
  };
3187
3194
  }
3188
- }, u(zt, "q"), zt), mt = new wr();
3195
+ }, u(zt, "q"), zt), gt = new wr();
3189
3196
  function ee(a, t) {
3190
- return mt.parse(a, t);
3197
+ return gt.parse(a, t);
3191
3198
  }
3192
3199
  u(ee, "g");
3193
3200
  ee.options = ee.setOptions = function(a) {
3194
- return mt.setOptions(a), ee.defaults = mt.defaults, Ks(ee.defaults), ee;
3201
+ return gt.setOptions(a), ee.defaults = gt.defaults, qs(ee.defaults), ee;
3195
3202
  };
3196
- ee.getDefaults = Bn;
3197
- ee.defaults = gt;
3203
+ ee.getDefaults = Pn;
3204
+ ee.defaults = vt;
3198
3205
  ee.use = function(...a) {
3199
- return mt.use(...a), ee.defaults = mt.defaults, Ks(ee.defaults), ee;
3206
+ return gt.use(...a), ee.defaults = gt.defaults, qs(ee.defaults), ee;
3200
3207
  };
3201
3208
  ee.walkTokens = function(a, t) {
3202
- return mt.walkTokens(a, t);
3209
+ return gt.walkTokens(a, t);
3203
3210
  };
3204
- ee.parseInline = mt.parseInline;
3211
+ ee.parseInline = gt.parseInline;
3205
3212
  ee.Parser = He;
3206
3213
  ee.parser = He.parse;
3207
3214
  ee.Renderer = pn;
3208
- ee.TextRenderer = qn;
3215
+ ee.TextRenderer = Vn;
3209
3216
  ee.Lexer = Ue;
3210
3217
  ee.lexer = Ue.lex;
3211
3218
  ee.Tokenizer = hn;
@@ -3255,48 +3262,48 @@ function Ar(a) {
3255
3262
  }
3256
3263
  const i = [...n.entries()].sort(([x], [w]) => x - w), s = Math.max(1, ...i.map(([, x]) => x.length)), l = Math.max(1, i.length), o = t === "horizontal" ? ot * 2 + l * Rt + (l - 1) * Wt : ot * 2 + s * Rt + (s - 1) * Wt, p = t === "horizontal" ? ot * 2 + s * Ct + (s - 1) * Gt : ot * 2 + l * Ct + (l - 1) * Gt, d = [];
3257
3264
  for (const [x, [, w]] of i.entries()) {
3258
- const M = (s - w.length) * (t === "horizontal" ? Ct + Gt : Rt + Wt) / 2;
3259
- for (const [_, D] of w.entries()) {
3260
- const J = t === "horizontal" ? ot + x * (Rt + Wt) : ot + M + _ * (Rt + Wt), S = t === "horizontal" ? ot + M + _ * (Ct + Gt) : ot + x * (Ct + Gt);
3265
+ const C = (s - w.length) * (t === "horizontal" ? Ct + Gt : Rt + Wt) / 2;
3266
+ for (const [E, $] of w.entries()) {
3267
+ const Q = t === "horizontal" ? ot + x * (Rt + Wt) : ot + C + E * (Rt + Wt), D = t === "horizontal" ? ot + C + E * (Ct + Gt) : ot + x * (Ct + Gt);
3261
3268
  d.push({
3262
- id: D.id,
3263
- label: D.label,
3264
- ...D.detail ? { detail: D.detail } : {},
3265
- ...D.kind ? { kind: D.kind } : {},
3266
- x: J,
3267
- y: S,
3269
+ id: $.id,
3270
+ label: $.label,
3271
+ ...$.detail ? { detail: $.detail } : {},
3272
+ ...$.kind ? { kind: $.kind } : {},
3273
+ x: Q,
3274
+ y: D,
3268
3275
  width: Rt,
3269
3276
  height: Ct
3270
3277
  });
3271
3278
  }
3272
3279
  }
3273
- const k = new Map(d.map((x) => [x.id, x])), E = a.edges.flatMap((x, w) => {
3274
- const M = k.get(x.from), _ = k.get(x.to);
3275
- if (!M || !_)
3280
+ const k = new Map(d.map((x) => [x.id, x])), A = a.edges.flatMap((x, w) => {
3281
+ const C = k.get(x.from), E = k.get(x.to);
3282
+ if (!C || !E)
3276
3283
  return [];
3277
- const D = t === "horizontal" ? M.x + M.width : M.x + M.width / 2, J = t === "horizontal" ? M.y + M.height / 2 : M.y + M.height, S = t === "horizontal" ? _.x : _.x + _.width / 2, B = t === "horizontal" ? _.y + _.height / 2 : _.y;
3284
+ const $ = t === "horizontal" ? C.x + C.width : C.x + C.width / 2, Q = t === "horizontal" ? C.y + C.height / 2 : C.y + C.height, D = t === "horizontal" ? E.x : E.x + E.width / 2, N = t === "horizontal" ? E.y + E.height / 2 : E.y;
3278
3285
  return [{
3279
3286
  key: `${x.from}-${x.to}-${w}`,
3280
3287
  from: x.from,
3281
3288
  to: x.to,
3282
3289
  ...x.label ? { label: x.label } : {},
3283
- x1: D,
3284
- y1: J,
3285
- x2: S,
3286
- y2: B,
3287
- labelX: (D + S) / 2,
3288
- labelY: (J + B) / 2
3290
+ x1: $,
3291
+ y1: Q,
3292
+ x2: D,
3293
+ y2: N,
3294
+ labelX: ($ + D) / 2,
3295
+ labelY: (Q + N) / 2
3289
3296
  }];
3290
3297
  });
3291
- return { width: o, height: p, orientation: t, nodes: d, edges: E };
3298
+ return { width: o, height: p, orientation: t, nodes: d, edges: A };
3292
3299
  }
3293
3300
  u(Ar, "layoutChatDiagram");
3294
- function aa(a) {
3301
+ function sa(a) {
3295
3302
  const { value: t } = a, e = Math.abs(t);
3296
3303
  return e >= 1e6 ? `${(t / 1e6).toFixed(1).replace(/\.0$/, "")}M` : e >= 1e3 ? `${(t / 1e3).toFixed(1).replace(/\.0$/, "")}k` : Number.isInteger(t) ? `${t}` : t.toFixed(1);
3297
3304
  }
3298
- u(aa, "formatChatVisualValue");
3299
- function ia(a) {
3305
+ u(sa, "formatChatVisualValue");
3306
+ function aa(a) {
3300
3307
  const { seconds: t } = a, e = Math.round(Math.abs(t)), n = t < 0 ? "-" : "";
3301
3308
  if (e < 60)
3302
3309
  return `${n}${e}s`;
@@ -3307,29 +3314,29 @@ function ia(a) {
3307
3314
  const i = Math.floor(e / 3600), s = Math.floor(e % 3600 / 60);
3308
3315
  return s ? `${n}${i}h ${s}m` : `${n}${i}h`;
3309
3316
  }
3310
- u(ia, "formatChatVisualDuration");
3311
- function ra(a) {
3317
+ u(aa, "formatChatVisualDuration");
3318
+ function ia(a) {
3312
3319
  return {
3313
3320
  prefix: a?.valuePrefix ?? (a?.valueFormat === "currency" ? "$" : ""),
3314
3321
  suffix: a?.valueSuffix ?? (a?.valueFormat === "percent" ? "%" : "")
3315
3322
  };
3316
3323
  }
3317
- u(ra, "affixes");
3324
+ u(ia, "affixes");
3318
3325
  function In(a) {
3319
- const { value: t, series: e } = a, { prefix: n, suffix: i } = ra(e);
3326
+ const { value: t, series: e } = a, { prefix: n, suffix: i } = ia(e);
3320
3327
  let s;
3321
3328
  switch (e?.valueFormat) {
3322
3329
  case "integer":
3323
3330
  s = `${Math.round(t)}`;
3324
3331
  break;
3325
3332
  case "duration":
3326
- s = ia({ seconds: t });
3333
+ s = aa({ seconds: t });
3327
3334
  break;
3328
3335
  case "raw":
3329
3336
  s = Number.isInteger(t) ? `${t}` : t.toFixed(1);
3330
3337
  break;
3331
3338
  default:
3332
- s = aa({ value: t });
3339
+ s = sa({ value: t });
3333
3340
  }
3334
3341
  return `${n}${s}${i}`;
3335
3342
  }
@@ -3344,22 +3351,22 @@ u(Er, "resolveSharedSeriesFormat");
3344
3351
  function _r(a) {
3345
3352
  const { value: t, shared: e } = a;
3346
3353
  if (e?.valueFormat === "duration")
3347
- return ia({ seconds: t });
3348
- const { prefix: n, suffix: i } = ra(e);
3349
- return `${n}${aa({ value: t })}${i}`;
3354
+ return aa({ seconds: t });
3355
+ const { prefix: n, suffix: i } = ia(e);
3356
+ return `${n}${sa({ value: t })}${i}`;
3350
3357
  }
3351
3358
  u(_r, "formatChatVisualTick");
3352
3359
  const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagram-type", "aria-label"], Cr = { class: "mb-2.5" }, Mr = ["aria-label"], Ir = {
3353
3360
  key: 0,
3354
3361
  "data-test": "chat-visual-horizontal-bars",
3355
3362
  class: "grid gap-3"
3356
- }, $r = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Dr = ["viewBox"], Lr = ["x1", "x2", "y1", "y2"], Or = ["x", "y"], zr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Nr = ["data-trend-key", "d"], Pr = ["d"], Br = ["cx", "cy"], Fr = ["cx", "cy"], Ur = ["x", "y", "text-anchor"], Hr = {
3363
+ }, $r = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Dr = ["viewBox"], Lr = ["x1", "x2", "y1", "y2"], Or = ["x", "y"], zr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Nr = ["data-trend-key", "d"], Pr = ["d"], Fr = ["cx", "cy"], Br = ["cx", "cy"], Ur = ["x", "y", "text-anchor"], Hr = {
3357
3364
  key: 2,
3358
3365
  class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
3359
3366
  }, jr = {
3360
3367
  key: 1,
3361
3368
  class: "grid gap-3"
3362
- }, Wr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Gr = { class: "shrink-0 tabular-nums" }, Vr = { key: 2 }, qr = ["viewBox", "aria-label"], Kr = ["data-from", "data-to", "x1", "y1", "x2", "y2"], Yr = ["cx", "cy"], Xr = ["x", "y"], Zr = ["data-node-id", "data-node-kind", "transform"], Qr = ["points"], Jr = ["width", "height"], el = ["width", "height"], tl = {
3369
+ }, Wr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Gr = { class: "shrink-0 tabular-nums" }, Vr = { key: 2 }, qr = ["viewBox", "aria-label"], Kr = ["data-from", "data-to", "x1", "y1", "x2", "y2"], Yr = ["cx", "cy"], Xr = ["x", "y"], Zr = ["data-node-id", "data-node-kind", "transform"], Jr = ["points"], Qr = ["width", "height"], el = ["width", "height"], tl = {
3363
3370
  xmlns: "http://www.w3.org/1999/xhtml",
3364
3371
  class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
3365
3372
  }, nl = /* @__PURE__ */ Me({
@@ -3378,146 +3385,146 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3378
3385
  return g?.chartType === "pie";
3379
3386
  }
3380
3387
  u(l, "isPieChart");
3381
- const o = T(() => n.value?.data ?? []), p = T(() => s(n.value) ? n.value : null), d = T(() => p.value?.series ?? []), k = T(() => l(n.value) ? n.value : null), E = T(() => p.value?.chartType === "bar" && p.value.stacking === "stacked");
3388
+ const o = T(() => n.value?.data ?? []), p = T(() => s(n.value) ? n.value : null), d = T(() => p.value?.series ?? []), k = T(() => l(n.value) ? n.value : null), A = T(() => p.value?.chartType === "bar" && p.value.stacking === "stacked");
3382
3389
  function x(g) {
3383
3390
  return typeof g == "number" && Number.isFinite(g) ? g : null;
3384
3391
  }
3385
3392
  u(x, "numericValue");
3386
- function w(g, A) {
3387
- return String(g[A] ?? "").trim();
3393
+ function w(g, S) {
3394
+ return String(g[S] ?? "").trim();
3388
3395
  }
3389
3396
  u(w, "categoryLabel");
3390
- function M(g, A) {
3391
- const c = g.map((O) => w(O, A)).filter(Boolean);
3397
+ function C(g, S) {
3398
+ const c = g.map((O) => w(O, S)).filter(Boolean);
3392
3399
  if (!c.length)
3393
3400
  return !1;
3394
- const I = Math.max(...c.map((O) => O.length)), L = c.reduce((O, G) => O + G.length, 0) / c.length;
3395
- return I >= 16 || c.length > 5 && L >= 10;
3401
+ const M = Math.max(...c.map((O) => O.length)), L = c.reduce((O, V) => O + V.length, 0) / c.length;
3402
+ return M >= 16 || c.length > 5 && L >= 10;
3396
3403
  }
3397
- u(M, "hasLongCategoryLabels");
3398
- function _(g, A) {
3399
- return g.data.map((c, I) => {
3400
- const L = x(c[A]);
3401
- return L === null ? null : { index: I, value: L };
3404
+ u(C, "hasLongCategoryLabels");
3405
+ function E(g, S) {
3406
+ return g.data.map((c, M) => {
3407
+ const L = x(c[S]);
3408
+ return L === null ? null : { index: M, value: L };
3402
3409
  }).filter((c) => c !== null);
3403
3410
  }
3404
- u(_, "trendLinePoints");
3405
- function D(g) {
3411
+ u(E, "trendLinePoints");
3412
+ function $(g) {
3406
3413
  if (g.length < 2) return null;
3407
- const A = g.length, c = g.reduce((ue, fe) => ue + fe.index, 0), I = g.reduce((ue, fe) => ue + fe.value, 0), L = g.reduce((ue, fe) => ue + fe.index * fe.index, 0), O = g.reduce((ue, fe) => ue + fe.index * fe.value, 0), G = A * L - c * c;
3408
- if (G === 0) return null;
3409
- const re = (A * O - c * I) / G, pe = (I - re * c) / A;
3410
- return { slope: re, intercept: pe };
3414
+ const S = g.length, c = g.reduce((de, fe) => de + fe.index, 0), M = g.reduce((de, fe) => de + fe.value, 0), L = g.reduce((de, fe) => de + fe.index * fe.index, 0), O = g.reduce((de, fe) => de + fe.index * fe.value, 0), V = S * L - c * c;
3415
+ if (V === 0) return null;
3416
+ const le = (S * O - c * M) / V, pe = (M - le * c) / S;
3417
+ return { slope: le, intercept: pe };
3411
3418
  }
3412
- u(D, "linearTrend");
3413
- const J = T(() => {
3414
- const g = [], A = p.value;
3415
- if (!A) return g;
3416
- if (A.chartType === "bar" && A.stacking === "stacked")
3417
- for (const c of A.data) {
3418
- let I = 0, L = 0;
3419
- for (const O of A.series) {
3420
- const G = x(c[O.dataKey]);
3421
- G !== null && (G >= 0 ? I += G : L += G);
3419
+ u($, "linearTrend");
3420
+ const Q = T(() => {
3421
+ const g = [], S = p.value;
3422
+ if (!S) return g;
3423
+ if (S.chartType === "bar" && S.stacking === "stacked")
3424
+ for (const c of S.data) {
3425
+ let M = 0, L = 0;
3426
+ for (const O of S.series) {
3427
+ const V = x(c[O.dataKey]);
3428
+ V !== null && (V >= 0 ? M += V : L += V);
3422
3429
  }
3423
- g.push(I, L);
3430
+ g.push(M, L);
3424
3431
  }
3425
3432
  else
3426
- for (const c of A.data)
3427
- for (const I of A.series) {
3428
- const L = x(c[I.dataKey]);
3433
+ for (const c of S.data)
3434
+ for (const M of S.series) {
3435
+ const L = x(c[M.dataKey]);
3429
3436
  L !== null && g.push(L);
3430
3437
  }
3431
- if (A.trendLine && (A.chartType === "line" || A.chartType === "scatter")) {
3432
- const c = _(A, A.trendLine.dataKey);
3438
+ if (S.trendLine && (S.chartType === "line" || S.chartType === "scatter")) {
3439
+ const c = E(S, S.trendLine.dataKey);
3433
3440
  g.push(...c.map((L) => L.value));
3434
- const I = D(c);
3435
- if (I && c.length) {
3441
+ const M = $(c);
3442
+ if (M && c.length) {
3436
3443
  const L = c[0].index, O = c[c.length - 1].index;
3437
- g.push(I.intercept + I.slope * L, I.intercept + I.slope * O);
3444
+ g.push(M.intercept + M.slope * L, M.intercept + M.slope * O);
3438
3445
  }
3439
3446
  }
3440
3447
  return g;
3441
3448
  });
3442
- function S(g, A) {
3443
- const c = g > 0 ? g : 1, I = Math.floor(Math.log10(c)), L = c / 10 ** I;
3449
+ function D(g, S) {
3450
+ const c = g > 0 ? g : 1, M = Math.floor(Math.log10(c)), L = c / 10 ** M;
3444
3451
  let O;
3445
- return A ? O = L < 1.5 ? 1 : L < 3 ? 2 : L < 7 ? 5 : 10 : O = L <= 1 ? 1 : L <= 2 ? 2 : L <= 5 ? 5 : 10, O * 10 ** I;
3452
+ return S ? O = L < 1.5 ? 1 : L < 3 ? 2 : L < 7 ? 5 : 10 : O = L <= 1 ? 1 : L <= 2 ? 2 : L <= 5 ? 5 : 10, O * 10 ** M;
3446
3453
  }
3447
- u(S, "niceNum");
3448
- const B = T(() => {
3449
- const g = J.value, A = g.length ? Math.max(0, ...g) : 1, c = g.length ? Math.min(0, ...g) : 0;
3450
- if (c === A)
3451
- return { min: 0, max: A || 1, ticks: [0, A || 1] };
3452
- const I = 4, L = S(A - c, !1), O = S(L / (I - 1), !0), G = Math.floor(c / O) * O, re = Math.ceil(A / O) * O, pe = [];
3453
- for (let ue = G; ue <= re + O * 0.5; ue += O)
3454
- pe.push(Number(ue.toFixed(6)));
3455
- return { min: G, max: re, ticks: pe };
3456
- }), N = T(() => Er({ series: d.value })), U = T(() => {
3457
- const g = N.value?.valueFormat, A = !!(N.value && (g === "currency" || g === "percent" || N.value.valuePrefix || N.value.valueSuffix));
3458
- return { width: 360, height: 168, left: g === "duration" ? 46 : A ? 38 : 30, right: 12, top: 10, bottom: 24 };
3454
+ u(D, "niceNum");
3455
+ const N = T(() => {
3456
+ const g = Q.value, S = g.length ? Math.max(0, ...g) : 1, c = g.length ? Math.min(0, ...g) : 0;
3457
+ if (c === S)
3458
+ return { min: 0, max: S || 1, ticks: [0, S || 1] };
3459
+ const M = 4, L = D(S - c, !1), O = D(L / (M - 1), !0), V = Math.floor(c / O) * O, le = Math.ceil(S / O) * O, pe = [];
3460
+ for (let de = V; de <= le + O * 0.5; de += O)
3461
+ pe.push(Number(de.toFixed(6)));
3462
+ return { min: V, max: le, ticks: pe };
3463
+ }), z = T(() => Er({ series: d.value })), F = T(() => {
3464
+ const g = z.value?.valueFormat, S = !!(z.value && (g === "currency" || g === "percent" || z.value.valuePrefix || z.value.valueSuffix));
3465
+ return { width: 360, height: 168, left: g === "duration" ? 46 : S ? 38 : 30, right: 12, top: 10, bottom: 24 };
3459
3466
  });
3460
- function H(g, A) {
3461
- const c = U.value, I = c.width - c.left - c.right;
3462
- return A <= 1 ? c.left + I / 2 : c.left + I * g / (A - 1);
3467
+ function H(g, S) {
3468
+ const c = F.value, M = c.width - c.left - c.right;
3469
+ return S <= 1 ? c.left + M / 2 : c.left + M * g / (S - 1);
3463
3470
  }
3464
3471
  u(H, "xForIndex");
3465
- function V(g) {
3466
- const { min: A, max: c } = B.value, I = U.value, L = I.height - I.top - I.bottom;
3467
- return I.top + (c - g) / (c - A || 1) * L;
3472
+ function j(g) {
3473
+ const { min: S, max: c } = N.value, M = F.value, L = M.height - M.top - M.bottom;
3474
+ return M.top + (c - g) / (c - S || 1) * L;
3468
3475
  }
3469
- u(V, "yForValue");
3470
- function he(g) {
3471
- const A = p.value;
3472
- return A ? A.data.map((c, I) => {
3476
+ u(j, "yForValue");
3477
+ function re(g) {
3478
+ const S = p.value;
3479
+ return S ? S.data.map((c, M) => {
3473
3480
  const L = x(c[g]) ?? 0;
3474
- return `${I === 0 ? "M" : "L"} ${H(I, A.data.length).toFixed(1)} ${V(L).toFixed(1)}`;
3481
+ return `${M === 0 ? "M" : "L"} ${H(M, S.data.length).toFixed(1)} ${j(L).toFixed(1)}`;
3475
3482
  }).join(" ") : "";
3476
3483
  }
3477
- u(he, "pathForSeries");
3484
+ u(re, "pathForSeries");
3478
3485
  const Ie = T(() => {
3479
3486
  const g = p.value;
3480
3487
  if (!g?.trendLine || g.chartType !== "line" && g.chartType !== "scatter") return null;
3481
- const A = _(g, g.trendLine.dataKey), c = D(A);
3482
- if (!c || !A.length) return null;
3483
- const I = A[0].index, L = A[A.length - 1].index, O = c.intercept + c.slope * I, G = c.intercept + c.slope * L, re = Math.max(0, g.series.findIndex((pe) => pe.dataKey === g.trendLine?.dataKey));
3488
+ const S = E(g, g.trendLine.dataKey), c = $(S);
3489
+ if (!c || !S.length) return null;
3490
+ const M = S[0].index, L = S[S.length - 1].index, O = c.intercept + c.slope * M, V = c.intercept + c.slope * L, le = Math.max(0, g.series.findIndex((pe) => pe.dataKey === g.trendLine?.dataKey));
3484
3491
  return {
3485
- path: `M ${H(I, g.data.length).toFixed(1)} ${V(O).toFixed(1)} L ${H(L, g.data.length).toFixed(1)} ${V(G).toFixed(1)}`,
3492
+ path: `M ${H(M, g.data.length).toFixed(1)} ${j(O).toFixed(1)} L ${H(L, g.data.length).toFixed(1)} ${j(V).toFixed(1)}`,
3486
3493
  dataKey: g.trendLine.dataKey,
3487
- seriesIndex: re
3494
+ seriesIndex: le
3488
3495
  };
3489
- }), ce = T(() => {
3496
+ }), ue = T(() => {
3490
3497
  const g = p.value;
3491
3498
  if (!g || g.chartType !== "bar") return [];
3492
- const A = U.value, I = (A.width - A.left - A.right) / Math.max(g.data.length, 1), L = V(0);
3493
- if (E.value) {
3494
- const ue = Math.max(4, Math.min(24, I * 0.42));
3499
+ const S = F.value, M = (S.width - S.left - S.right) / Math.max(g.data.length, 1), L = j(0);
3500
+ if (A.value) {
3501
+ const de = Math.max(4, Math.min(24, M * 0.42));
3495
3502
  return g.data.flatMap((fe, Te) => {
3496
3503
  let De = 0, _e = 0;
3497
- const qe = A.left + Te * I + (I - ue) / 2;
3498
- return g.series.map((Pe, C) => {
3499
- const v = x(fe[Pe.dataKey]) ?? 0, y = v >= 0 ? De : _e, Z = y + v, F = V(y), ae = V(Z);
3504
+ const qe = S.left + Te * M + (M - de) / 2;
3505
+ return g.series.map((Pe, R) => {
3506
+ const v = x(fe[Pe.dataKey]) ?? 0, b = v >= 0 ? De : _e, Z = b + v, U = j(b), ae = j(Z);
3500
3507
  return v >= 0 ? De = Z : _e = Z, {
3501
3508
  key: `${Te}-${Pe.dataKey}`,
3502
3509
  x: qe,
3503
- y: Math.min(F, ae),
3504
- width: ue,
3505
- height: Math.max(1.5, Math.abs(F - ae)),
3506
- seriesIndex: C,
3510
+ y: Math.min(U, ae),
3511
+ width: de,
3512
+ height: Math.max(1.5, Math.abs(U - ae)),
3513
+ seriesIndex: R,
3507
3514
  rowIndex: Te,
3508
3515
  dataKey: Pe.dataKey
3509
3516
  };
3510
3517
  });
3511
3518
  });
3512
3519
  }
3513
- const O = Math.max(g.series.length, 1), G = O > 1 ? 2 : 0, re = Math.max(3, Math.min(20, (I * 0.62 - G * (O - 1)) / O)), pe = re * O + G * (O - 1);
3514
- return g.data.flatMap((ue, fe) => g.series.map((Te, De) => {
3515
- const _e = x(ue[Te.dataKey]) ?? 0, qe = V(_e), Pe = A.left + fe * I + (I - pe) / 2 + De * (re + G);
3520
+ const O = Math.max(g.series.length, 1), V = O > 1 ? 2 : 0, le = Math.max(3, Math.min(20, (M * 0.62 - V * (O - 1)) / O)), pe = le * O + V * (O - 1);
3521
+ return g.data.flatMap((de, fe) => g.series.map((Te, De) => {
3522
+ const _e = x(de[Te.dataKey]) ?? 0, qe = j(_e), Pe = S.left + fe * M + (M - pe) / 2 + De * (le + V);
3516
3523
  return {
3517
3524
  key: `${fe}-${Te.dataKey}`,
3518
3525
  x: Pe,
3519
3526
  y: Math.min(qe, L),
3520
- width: re,
3527
+ width: le,
3521
3528
  height: Math.max(1.5, Math.abs(L - qe)),
3522
3529
  seriesIndex: De,
3523
3530
  rowIndex: fe,
@@ -3527,83 +3534,83 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3527
3534
  }), $e = T(() => {
3528
3535
  const g = p.value;
3529
3536
  if (!g) return [];
3530
- const A = g.data;
3531
- if (!A.length) return [];
3532
- const c = g.xKey, I = A.length - 1, L = I <= 6 ? 1 : Math.ceil(I / 4), O = /* @__PURE__ */ new Set([0, I]);
3533
- for (let G = 0; G <= I; G += L)
3534
- O.add(G);
3535
- return [...O].sort((G, re) => G - re).map((G) => ({
3536
- key: `${G}`,
3537
- label: String(A[G]?.[c] ?? ""),
3538
- x: H(G, A.length),
3539
- anchor: G === 0 ? "start" : G === I ? "end" : "middle"
3540
- })).filter((G) => G.label);
3541
- }), vt = T(() => {
3537
+ const S = g.data;
3538
+ if (!S.length) return [];
3539
+ const c = g.xKey, M = S.length - 1, L = M <= 6 ? 1 : Math.ceil(M / 4), O = /* @__PURE__ */ new Set([0, M]);
3540
+ for (let V = 0; V <= M; V += L)
3541
+ O.add(V);
3542
+ return [...O].sort((V, le) => V - le).map((V) => ({
3543
+ key: `${V}`,
3544
+ label: String(S[V]?.[c] ?? ""),
3545
+ x: H(V, S.length),
3546
+ anchor: V === 0 ? "start" : V === M ? "end" : "middle"
3547
+ })).filter((V) => V.label);
3548
+ }), xt = T(() => {
3542
3549
  const g = p.value;
3543
- if (!g || g.chartType !== "bar" || g.series.length !== 1 || E.value)
3550
+ if (!g || g.chartType !== "bar" || g.series.length !== 1 || A.value)
3544
3551
  return [];
3545
- const A = g.series[0], c = g.data.map((O, G) => {
3546
- const re = w(O, g.xKey), pe = x(O[A.dataKey]);
3547
- return !re || pe === null ? null : { key: `${G}-${re}`, label: re, rawValue: pe };
3552
+ const S = g.series[0], c = g.data.map((O, V) => {
3553
+ const le = w(O, g.xKey), pe = x(O[S.dataKey]);
3554
+ return !le || pe === null ? null : { key: `${V}-${le}`, label: le, rawValue: pe };
3548
3555
  }).filter((O) => O !== null);
3549
3556
  if (!c.length || c.some((O) => O.rawValue < 0))
3550
3557
  return [];
3551
- if (!(g.layout === "horizontal" || M(g.data, g.xKey)))
3558
+ if (!(g.layout === "horizontal" || C(g.data, g.xKey)))
3552
3559
  return [];
3553
3560
  const L = Math.max(...c.map((O) => O.rawValue), 1);
3554
3561
  return c.map((O) => ({
3555
3562
  key: O.key,
3556
3563
  label: O.label,
3557
- value: In({ value: O.rawValue, series: A }),
3564
+ value: In({ value: O.rawValue, series: S }),
3558
3565
  width: O.rawValue <= 0 ? 0 : Math.max(2, O.rawValue / L * 100),
3559
3566
  seriesIndex: 0
3560
3567
  }));
3561
3568
  }), st = T(() => {
3562
3569
  const g = p.value;
3563
3570
  if (!g?.data.length) return [];
3564
- const A = g.data[g.data.length - 1];
3565
- return g.series.map((c, I) => {
3566
- const L = x(A?.[c.dataKey]);
3571
+ const S = g.data[g.data.length - 1];
3572
+ return g.series.map((c, M) => {
3573
+ const L = x(S?.[c.dataKey]);
3567
3574
  return {
3568
3575
  key: c.dataKey,
3569
3576
  label: c.label || c.dataKey,
3570
3577
  value: L === null ? "—" : In({ value: L, series: c }),
3571
- seriesIndex: I
3578
+ seriesIndex: M
3572
3579
  };
3573
3580
  });
3574
- }), oe = T(() => {
3581
+ }), ce = T(() => {
3575
3582
  const g = p.value;
3576
3583
  if (!g?.data.length || g.chartType !== "line") return [];
3577
- const A = g.data.length - 1, c = g.data[A];
3578
- return g.series.map((I, L) => {
3579
- const O = x(c?.[I.dataKey]);
3580
- return O === null ? null : { key: I.dataKey, cx: H(A, g.data.length), cy: V(O), seriesIndex: L };
3581
- }).filter((I) => I !== null);
3584
+ const S = g.data.length - 1, c = g.data[S];
3585
+ return g.series.map((M, L) => {
3586
+ const O = x(c?.[M.dataKey]);
3587
+ return O === null ? null : { key: M.dataKey, cx: H(S, g.data.length), cy: j(O), seriesIndex: L };
3588
+ }).filter((M) => M !== null);
3582
3589
  }), at = T(() => {
3583
3590
  const g = k.value;
3584
3591
  if (!g) return [];
3585
- const A = g.data.map((L) => ({
3592
+ const S = g.data.map((L) => ({
3586
3593
  name: String(L[g.nameKey] ?? ""),
3587
3594
  value: x(L[g.valueKey]) ?? 0
3588
- })).filter((L) => L.name && L.value >= 0).sort((L, O) => O.value - L.value), c = A.reduce((L, O) => L + O.value, 0) || 1, I = g.series?.[0];
3589
- return A.map((L, O) => ({
3595
+ })).filter((L) => L.name && L.value >= 0).sort((L, O) => O.value - L.value), c = S.reduce((L, O) => L + O.value, 0) || 1, M = g.series?.[0];
3596
+ return S.map((L, O) => ({
3590
3597
  ...L,
3591
3598
  key: `${O}-${L.name}`,
3592
3599
  percent: L.value / c,
3593
- display: In({ value: L.value, series: I })
3600
+ display: In({ value: L.value, series: M })
3594
3601
  }));
3595
3602
  }), be = T(() => i.value ? Ar(i.value) : null), je = [
3596
3603
  "var(--color-theme-900)",
3597
3604
  "var(--color-primary-500)",
3598
3605
  "color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
3599
- ], xt = [
3606
+ ], bt = [
3600
3607
  "rgba(255, 255, 255, 0.92)",
3601
3608
  "color-mix(in oklch, white 30%, var(--color-primary-500))",
3602
3609
  "rgba(255, 255, 255, 0.55)"
3603
3610
  ];
3604
3611
  function Ee(g) {
3605
- const A = t.inverted ? xt : je;
3606
- return A[g % A.length];
3612
+ const S = t.inverted ? bt : je;
3613
+ return S[g % S.length];
3607
3614
  }
3608
3615
  u(Ee, "seriesColor");
3609
3616
  function Le(g) {
@@ -3615,54 +3622,54 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3615
3622
  }
3616
3623
  u(We, "diagramNodeStroke");
3617
3624
  const ke = T(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), Ge = T(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), X = T(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), it = T(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), ie = T(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), rt = T(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), te = T(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Ve = T(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
3618
- return (g, A) => e.value ? (h(), f("section", {
3625
+ return (g, S) => e.value ? (h(), f("section", {
3619
3626
  key: 0,
3620
3627
  "data-test": "chat-visual",
3621
3628
  "data-visual-type": e.value.visualType,
3622
3629
  "data-chart-type": n.value?.chartType,
3623
- "data-stacking": E.value ? "stacked" : void 0,
3630
+ "data-stacking": A.value ? "stacked" : void 0,
3624
3631
  "data-diagram-type": i.value?.diagramType,
3625
3632
  class: "my-6 w-full border-y py-5",
3626
3633
  style: K({ borderColor: rt.value }),
3627
3634
  "aria-label": e.value.meta.title
3628
3635
  }, [
3629
- b("header", Cr, [
3630
- b("h4", {
3636
+ y("header", Cr, [
3637
+ y("h4", {
3631
3638
  class: "text-[13px] font-semibold leading-tight",
3632
3639
  style: K({ color: ke.value })
3633
- }, j(e.value.meta.title), 5),
3640
+ }, W(e.value.meta.title), 5),
3634
3641
  e.value.meta.description ? (h(), f("p", {
3635
3642
  key: 0,
3636
3643
  class: "mt-0.5 text-[12px] leading-snug",
3637
3644
  style: K({ color: Ge.value })
3638
- }, j(e.value.meta.description), 5)) : W("", !0)
3645
+ }, W(e.value.meta.description), 5)) : G("", !0)
3639
3646
  ]),
3640
3647
  p.value ? (h(), f("div", {
3641
3648
  key: 0,
3642
3649
  role: "img",
3643
3650
  "aria-label": e.value.meta.title
3644
3651
  }, [
3645
- vt.value.length ? (h(), f("div", Ir, [
3646
- (h(!0), f(se, null, ve(vt.value, (c) => (h(), f("div", {
3652
+ xt.value.length ? (h(), f("div", Ir, [
3653
+ (h(!0), f(se, null, ve(xt.value, (c) => (h(), f("div", {
3647
3654
  key: c.key,
3648
3655
  "data-test": "chat-visual-horizontal-bar",
3649
3656
  class: "min-w-0"
3650
3657
  }, [
3651
- b("div", $r, [
3652
- b("span", {
3658
+ y("div", $r, [
3659
+ y("span", {
3653
3660
  class: "line-clamp-2 min-w-0 font-medium leading-snug",
3654
3661
  style: K({ color: ke.value })
3655
- }, j(c.label), 5),
3656
- b("span", {
3662
+ }, W(c.label), 5),
3663
+ y("span", {
3657
3664
  class: "shrink-0 font-semibold tabular-nums",
3658
3665
  style: K({ color: ke.value })
3659
- }, j(c.value), 5)
3666
+ }, W(c.value), 5)
3660
3667
  ]),
3661
- b("div", {
3668
+ y("div", {
3662
3669
  class: "h-2 w-full overflow-hidden rounded-full",
3663
3670
  style: K({ background: Ve.value })
3664
3671
  }, [
3665
- b("div", {
3672
+ y("div", {
3666
3673
  class: "h-full rounded-full",
3667
3674
  style: K({ width: `${c.width}%`, background: Ee(c.seriesIndex) })
3668
3675
  }, null, 4)
@@ -3671,32 +3678,32 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3671
3678
  ])) : (h(), f("svg", {
3672
3679
  key: 1,
3673
3680
  class: "block h-auto w-full overflow-visible",
3674
- viewBox: `0 0 ${U.value.width} ${U.value.height}`,
3675
- style: K({ aspectRatio: `${U.value.width} / ${U.value.height}` }),
3681
+ viewBox: `0 0 ${F.value.width} ${F.value.height}`,
3682
+ style: K({ aspectRatio: `${F.value.width} / ${F.value.height}` }),
3676
3683
  preserveAspectRatio: "xMidYMid meet",
3677
3684
  "aria-hidden": "true"
3678
3685
  }, [
3679
- (h(!0), f(se, null, ve(B.value.ticks, (c) => (h(), f("line", {
3686
+ (h(!0), f(se, null, ve(N.value.ticks, (c) => (h(), f("line", {
3680
3687
  key: `grid-${c}`,
3681
- x1: U.value.left,
3682
- x2: U.value.width - U.value.right,
3683
- y1: V(c),
3684
- y2: V(c),
3688
+ x1: F.value.left,
3689
+ x2: F.value.width - F.value.right,
3690
+ y1: j(c),
3691
+ y2: j(c),
3685
3692
  "stroke-width": "1",
3686
3693
  "vector-effect": "non-scaling-stroke",
3687
3694
  style: K({ stroke: c === 0 ? ie.value : it.value })
3688
3695
  }, null, 12, Lr))), 128)),
3689
- b("g", null, [
3690
- (h(!0), f(se, null, ve(B.value.ticks, (c) => (h(), f("text", {
3696
+ y("g", null, [
3697
+ (h(!0), f(se, null, ve(N.value.ticks, (c) => (h(), f("text", {
3691
3698
  key: `y-${c}`,
3692
- x: U.value.left - 7,
3693
- y: V(c) + 3,
3699
+ x: F.value.left - 7,
3700
+ y: j(c) + 3,
3694
3701
  "text-anchor": "end",
3695
3702
  "font-size": "9.5",
3696
3703
  style: K({ fill: X.value })
3697
- }, j(on(_r)({ value: c, shared: N.value })), 13, Or))), 128))
3704
+ }, W(on(_r)({ value: c, shared: z.value })), 13, Or))), 128))
3698
3705
  ]),
3699
- p.value.chartType === "bar" ? (h(!0), f(se, { key: 0 }, ve(ce.value, (c) => (h(), f("rect", {
3706
+ p.value.chartType === "bar" ? (h(!0), f(se, { key: 0 }, ve(ue.value, (c) => (h(), f("rect", {
3700
3707
  key: c.key,
3701
3708
  "data-test": "chat-visual-bar",
3702
3709
  "data-row-index": c.rowIndex,
@@ -3721,94 +3728,94 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3721
3728
  "stroke-dasharray": "4 3",
3722
3729
  "vector-effect": "non-scaling-stroke",
3723
3730
  style: K({ stroke: Ee(Ie.value.seriesIndex) })
3724
- }, null, 12, Nr)) : W("", !0),
3725
- (h(!0), f(se, null, ve(d.value, (c, I) => (h(), f("g", {
3731
+ }, null, 12, Nr)) : G("", !0),
3732
+ (h(!0), f(se, null, ve(d.value, (c, M) => (h(), f("g", {
3726
3733
  key: c.dataKey
3727
3734
  }, [
3728
3735
  p.value.chartType === "line" ? (h(), f("path", {
3729
3736
  key: 0,
3730
- d: he(c.dataKey),
3737
+ d: re(c.dataKey),
3731
3738
  fill: "none",
3732
3739
  "stroke-width": "2",
3733
3740
  "stroke-linecap": "round",
3734
3741
  "stroke-linejoin": "round",
3735
3742
  "vector-effect": "non-scaling-stroke",
3736
- style: K({ stroke: Ee(I) })
3737
- }, null, 12, Pr)) : W("", !0),
3743
+ style: K({ stroke: Ee(M) })
3744
+ }, null, 12, Pr)) : G("", !0),
3738
3745
  (h(!0), f(se, null, ve(o.value, (L, O) => (h(), f(se, {
3739
3746
  key: `${c.dataKey}-${O}`
3740
3747
  }, [
3741
3748
  p.value.chartType === "scatter" ? (h(), f("circle", {
3742
3749
  key: 0,
3743
3750
  cx: H(O, o.value.length),
3744
- cy: V(x(L[c.dataKey]) ?? 0),
3751
+ cy: j(x(L[c.dataKey]) ?? 0),
3745
3752
  r: "2.6",
3746
- style: K({ fill: Ee(I) })
3747
- }, null, 12, Br)) : W("", !0)
3753
+ style: K({ fill: Ee(M) })
3754
+ }, null, 12, Fr)) : G("", !0)
3748
3755
  ], 64))), 128))
3749
3756
  ]))), 128)),
3750
- (h(!0), f(se, null, ve(oe.value, (c) => (h(), f("circle", {
3757
+ (h(!0), f(se, null, ve(ce.value, (c) => (h(), f("circle", {
3751
3758
  key: `marker-${c.key}`,
3752
3759
  cx: c.cx,
3753
3760
  cy: c.cy,
3754
3761
  r: "3",
3755
3762
  style: K({ fill: Ee(c.seriesIndex) })
3756
- }, null, 12, Fr))), 128))
3763
+ }, null, 12, Br))), 128))
3757
3764
  ], 64)),
3758
3765
  (h(!0), f(se, null, ve($e.value, (c) => (h(), f("text", {
3759
3766
  key: c.key,
3760
3767
  x: c.x,
3761
- y: U.value.height - 6,
3768
+ y: F.value.height - 6,
3762
3769
  "text-anchor": c.anchor,
3763
3770
  "font-size": "9.5",
3764
3771
  style: K({ fill: X.value })
3765
- }, j(c.label), 13, Ur))), 128))
3772
+ }, W(c.label), 13, Ur))), 128))
3766
3773
  ], 12, Dr)),
3767
3774
  st.value.length > 1 || p.value.chartType !== "bar" ? (h(), f("div", Hr, [
3768
3775
  (h(!0), f(se, null, ve(st.value, (c) => (h(), f("div", {
3769
3776
  key: c.key,
3770
3777
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
3771
3778
  }, [
3772
- b("span", {
3779
+ y("span", {
3773
3780
  class: "size-2.5 shrink-0 rounded-full",
3774
3781
  style: K({ background: Ee(c.seriesIndex) })
3775
3782
  }, null, 4),
3776
- b("span", {
3783
+ y("span", {
3777
3784
  style: K({ color: Ge.value })
3778
- }, j(c.label), 5),
3779
- b("span", {
3785
+ }, W(c.label), 5),
3786
+ y("span", {
3780
3787
  class: "font-semibold tabular-nums",
3781
3788
  style: K({ color: ke.value })
3782
- }, j(c.value), 5)
3789
+ }, W(c.value), 5)
3783
3790
  ]))), 128))
3784
- ])) : W("", !0)
3791
+ ])) : G("", !0)
3785
3792
  ], 8, Mr)) : k.value ? (h(), f("div", jr, [
3786
- (h(!0), f(se, null, ve(at.value, (c, I) => (h(), f("div", {
3793
+ (h(!0), f(se, null, ve(at.value, (c, M) => (h(), f("div", {
3787
3794
  key: c.key
3788
3795
  }, [
3789
- b("div", Wr, [
3790
- b("span", {
3796
+ y("div", Wr, [
3797
+ y("span", {
3791
3798
  class: "truncate font-medium",
3792
3799
  style: K({ color: ke.value })
3793
- }, j(c.name), 5),
3794
- b("span", Gr, [
3795
- b("span", {
3800
+ }, W(c.name), 5),
3801
+ y("span", Gr, [
3802
+ y("span", {
3796
3803
  class: "font-semibold",
3797
3804
  style: K({ color: ke.value })
3798
- }, j(c.display), 5),
3799
- b("span", {
3805
+ }, W(c.display), 5),
3806
+ y("span", {
3800
3807
  class: "ml-1.5",
3801
3808
  style: K({ color: Ge.value })
3802
- }, j(Math.round(c.percent * 100)) + "%", 5)
3809
+ }, W(Math.round(c.percent * 100)) + "%", 5)
3803
3810
  ])
3804
3811
  ]),
3805
- b("div", {
3812
+ y("div", {
3806
3813
  class: "h-1.5 w-full overflow-hidden rounded-full",
3807
3814
  style: K({ background: Ve.value })
3808
3815
  }, [
3809
- b("div", {
3816
+ y("div", {
3810
3817
  class: "h-full rounded-full",
3811
- style: K({ width: `${Math.max(2, c.percent * 100)}%`, background: Ee(I) })
3818
+ style: K({ width: `${Math.max(2, c.percent * 100)}%`, background: Ee(M) })
3812
3819
  }, null, 4)
3813
3820
  ], 4)
3814
3821
  ]))), 128))
@@ -3849,11 +3856,11 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3849
3856
  width: "86",
3850
3857
  height: "22"
3851
3858
  }, [
3852
- b("div", {
3859
+ y("div", {
3853
3860
  xmlns: "http://www.w3.org/1999/xhtml",
3854
3861
  class: "flex h-full items-center justify-center px-1 text-center text-[8.5px] font-medium leading-none",
3855
3862
  style: K({ color: Ge.value, background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)" })
3856
- }, j(c.label), 5)
3863
+ }, W(c.label), 5)
3857
3864
  ], 8, Xr))), 128)),
3858
3865
  (h(!0), f(se, null, ve(be.value.nodes, (c) => (h(), f("g", {
3859
3866
  key: c.id,
@@ -3868,7 +3875,7 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3868
3875
  "stroke-width": "1",
3869
3876
  "vector-effect": "non-scaling-stroke",
3870
3877
  style: K({ fill: Le(c.kind), stroke: We(c.kind) })
3871
- }, null, 12, Qr)) : (h(), f("rect", {
3878
+ }, null, 12, Jr)) : (h(), f("rect", {
3872
3879
  key: 1,
3873
3880
  width: c.width,
3874
3881
  height: c.height,
@@ -3876,34 +3883,34 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3876
3883
  "stroke-width": "1",
3877
3884
  "vector-effect": "non-scaling-stroke",
3878
3885
  style: K({ fill: Le(c.kind), stroke: We(c.kind) })
3879
- }, null, 12, Jr)),
3886
+ }, null, 12, Qr)),
3880
3887
  (h(), f("foreignObject", {
3881
3888
  x: "8",
3882
3889
  y: "5",
3883
3890
  width: c.width - 16,
3884
3891
  height: c.height - 10
3885
3892
  }, [
3886
- b("div", tl, [
3887
- b("div", {
3893
+ y("div", tl, [
3894
+ y("div", {
3888
3895
  class: "line-clamp-2 text-[10.5px] font-semibold leading-tight",
3889
3896
  style: K({ color: ke.value })
3890
- }, j(c.label), 5),
3897
+ }, W(c.label), 5),
3891
3898
  c.detail ? (h(), f("div", {
3892
3899
  key: 0,
3893
3900
  class: "mt-0.5 line-clamp-1 text-[8.5px] leading-none",
3894
3901
  style: K({ color: Ge.value })
3895
- }, j(c.detail), 5)) : W("", !0)
3902
+ }, W(c.detail), 5)) : G("", !0)
3896
3903
  ])
3897
3904
  ], 8, el))
3898
3905
  ], 8, Zr))), 128))
3899
3906
  ], 12, qr))
3900
- ])) : W("", !0),
3907
+ ])) : G("", !0),
3901
3908
  e.value.meta.footer ? (h(), f("footer", {
3902
3909
  key: 3,
3903
3910
  class: "mt-3 text-[11px] leading-snug",
3904
3911
  style: K({ color: X.value })
3905
- }, j(e.value.meta.footer), 5)) : W("", !0)
3906
- ], 12, Rr)) : W("", !0);
3912
+ }, W(e.value.meta.footer), 5)) : G("", !0)
3913
+ ], 12, Rr)) : G("", !0);
3907
3914
  }
3908
3915
  }), sl = ["innerHTML"], ln = /* @__PURE__ */ Me({
3909
3916
  __name: "ChatRichText",
@@ -3917,8 +3924,8 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3917
3924
  let n;
3918
3925
  Kt(
3919
3926
  [() => t.text, () => t.streaming],
3920
- ([w, M]) => {
3921
- if (!M) {
3927
+ ([w, C]) => {
3928
+ if (!C) {
3922
3929
  n !== void 0 && (cancelAnimationFrame(n), n = void 0), e.value = w;
3923
3930
  return;
3924
3931
  }
@@ -3930,43 +3937,43 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3930
3937
  n !== void 0 && cancelAnimationFrame(n);
3931
3938
  });
3932
3939
  const i = new ee.Renderer();
3933
- i.link = ({ href: w, text: M }) => {
3934
- const _ = w.trim();
3935
- if (!_ || _ === "#")
3936
- return M;
3937
- let D = !1;
3940
+ i.link = ({ href: w, text: C }) => {
3941
+ const E = w.trim();
3942
+ if (!E || E === "#")
3943
+ return C;
3944
+ let $ = !1;
3938
3945
  if (typeof window < "u")
3939
3946
  try {
3940
- D = new URL(w, window.location.href).origin === window.location.origin;
3947
+ $ = new URL(w, window.location.href).origin === window.location.origin;
3941
3948
  } catch {
3942
- D = !1;
3949
+ $ = !1;
3943
3950
  }
3944
- return D ? `<a href="${w}">${M}</a>` : `<a href="${w}" target="_blank" rel="noopener noreferrer">${M}</a>`;
3951
+ return $ ? `<a href="${w}">${C}</a>` : `<a href="${w}" target="_blank" rel="noopener noreferrer">${C}</a>`;
3945
3952
  }, ee.setOptions({ breaks: !0, gfm: !0, renderer: i });
3946
3953
  function s(w) {
3947
3954
  if (!w) return "";
3948
- const M = ee.parse(w, { async: !1 });
3949
- return Oi.sanitize(M, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
3955
+ const C = ee.parse(w, { async: !1 });
3956
+ return Oi.sanitize(C, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
3950
3957
  }
3951
3958
  u(s, "renderMarkdown");
3952
3959
  function l(w) {
3953
3960
  if (typeof w != "string") return null;
3954
- const M = w.trim();
3955
- return M ? M.slice(0, 80) : null;
3961
+ const C = w.trim();
3962
+ return C ? C.slice(0, 80) : null;
3956
3963
  }
3957
3964
  u(l, "safePayloadString");
3958
3965
  function o(w) {
3959
3966
  try {
3960
- const M = JSON.parse(w);
3961
- if (!M || typeof M != "object" || Array.isArray(M))
3967
+ const C = JSON.parse(w);
3968
+ if (!C || typeof C != "object" || Array.isArray(C))
3962
3969
  return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
3963
- const _ = M;
3970
+ const E = C;
3964
3971
  return {
3965
- topLevelKeys: Object.keys(_).sort().slice(0, 24),
3966
- declaredVisualType: l(_.visualType),
3967
- declaredChartType: l(_.chartType),
3968
- declaredDiagramType: l(_.diagramType),
3969
- inputType: l(_.type)
3972
+ topLevelKeys: Object.keys(E).sort().slice(0, 24),
3973
+ declaredVisualType: l(E.visualType),
3974
+ declaredChartType: l(E.chartType),
3975
+ declaredDiagramType: l(E.diagramType),
3976
+ inputType: l(E.type)
3970
3977
  };
3971
3978
  } catch {
3972
3979
  return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
@@ -3992,55 +3999,55 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3992
3999
  }
3993
4000
  u(d, "onRichTextAssetError");
3994
4001
  const k = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
3995
- function E(w) {
3996
- const { text: M, streaming: _ } = w, D = [], J = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
3997
- let S = 0, B = 0, N = J.exec(M);
3998
- for (; N !== null; ) {
3999
- const he = M.slice(S, N.index), Ie = s(he);
4000
- Ie && D.push({ kind: "markdown", key: `md-${B}`, html: Ie });
4001
- const ce = ya(N[1].trim());
4002
- if (ce.ok)
4003
- D.push({ kind: "visual", key: `visual-${B}`, result: ce });
4002
+ function A(w) {
4003
+ const { text: C, streaming: E } = w, $ = [], Q = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
4004
+ let D = 0, N = 0, z = Q.exec(C);
4005
+ for (; z !== null; ) {
4006
+ const re = C.slice(D, z.index), Ie = s(re);
4007
+ Ie && $.push({ kind: "markdown", key: `md-${N}`, html: Ie });
4008
+ const ue = ya(z[1].trim());
4009
+ if (ue.ok)
4010
+ $.push({ kind: "visual", key: `visual-${N}`, result: ue });
4004
4011
  else {
4005
4012
  typeof console < "u" && console.warn("[pl-visual] parse_failed", {
4006
- reason: ce.reason,
4007
- message: ce.message,
4008
- hasFallbackMarkdown: !!ce.fallbackMarkdown,
4009
- payloadChars: N[1].trim().length,
4010
- ...o(N[1].trim())
4013
+ reason: ue.reason,
4014
+ message: ue.message,
4015
+ hasFallbackMarkdown: !!ue.fallbackMarkdown,
4016
+ payloadChars: z[1].trim().length,
4017
+ ...o(z[1].trim())
4011
4018
  });
4012
- const $e = ce.fallbackMarkdown ? s(ce.fallbackMarkdown) : "";
4013
- $e && D.push({ kind: "markdown", key: `visual-${B}`, html: $e });
4019
+ const $e = ue.fallbackMarkdown ? s(ue.fallbackMarkdown) : "";
4020
+ $e && $.push({ kind: "markdown", key: `visual-${N}`, html: $e });
4014
4021
  }
4015
- S = N.index + N[0].length, B += 1, N = J.exec(M);
4022
+ D = z.index + z[0].length, N += 1, z = Q.exec(C);
4016
4023
  }
4017
- const U = M.slice(S), H = _ ? k.exec(U) : null;
4024
+ const F = C.slice(D), H = E ? k.exec(F) : null;
4018
4025
  if (H) {
4019
- const he = s(U.slice(0, H.index));
4020
- return he && D.push({ kind: "markdown", key: `md-${B}`, html: he }), D.push({ kind: "pending-visual", key: `pending-${B}` }), D;
4026
+ const re = s(F.slice(0, H.index));
4027
+ return re && $.push({ kind: "markdown", key: `md-${N}`, html: re }), $.push({ kind: "pending-visual", key: `pending-${N}` }), $;
4021
4028
  }
4022
- const V = s(U);
4023
- return V && D.push({ kind: "markdown", key: `md-${B}`, html: V }), D;
4029
+ const j = s(F);
4030
+ return j && $.push({ kind: "markdown", key: `md-${N}`, html: j }), $;
4024
4031
  }
4025
- u(E, "richTextSegments");
4032
+ u(A, "richTextSegments");
4026
4033
  const x = T(() => {
4027
4034
  const w = e.value;
4028
- return w ? E({ text: w, streaming: !!t.streaming }) : [];
4035
+ return w ? A({ text: w, streaming: !!t.streaming }) : [];
4029
4036
  });
4030
- return (w, M) => (h(), f("div", {
4037
+ return (w, C) => (h(), f("div", {
4031
4038
  class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed",
4032
4039
  onErrorCapture: d
4033
4040
  }, [
4034
- (h(!0), f(se, null, ve(x.value, (_) => (h(), f(se, {
4035
- key: _.key
4041
+ (h(!0), f(se, null, ve(x.value, (E) => (h(), f(se, {
4042
+ key: E.key
4036
4043
  }, [
4037
- _.kind === "markdown" ? (h(), f("div", {
4044
+ E.kind === "markdown" ? (h(), f("div", {
4038
4045
  key: 0,
4039
- class: R(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
4040
- innerHTML: _.html
4041
- }, null, 10, sl)) : _.kind === "visual" ? (h(), ut(nl, {
4046
+ class: _(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
4047
+ innerHTML: E.html
4048
+ }, null, 10, sl)) : E.kind === "visual" ? (h(), mt(nl, {
4042
4049
  key: 1,
4043
- result: _.result,
4050
+ result: E.result,
4044
4051
  inverted: a.inverted
4045
4052
  }, null, 8, ["result", "inverted"])) : (h(), f("div", {
4046
4053
  key: 2,
@@ -4051,8 +4058,8 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4051
4058
  borderColor: a.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)",
4052
4059
  color: a.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
4053
4060
  })
4054
- }, [...M[0] || (M[0] = [
4055
- b("span", {
4061
+ }, [...C[0] || (C[0] = [
4062
+ y("span", {
4056
4063
  class: "size-2 shrink-0 animate-pulse rounded-full",
4057
4064
  style: { background: "currentcolor" }
4058
4065
  }, null, -1),
@@ -4090,10 +4097,10 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4090
4097
  }), (d, k) => (h(), f("div", {
4091
4098
  ref_key: "viewport",
4092
4099
  ref: e,
4093
- class: R(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
4100
+ class: _(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
4094
4101
  onScrollPassive: o
4095
4102
  }, [
4096
- b("div", {
4103
+ y("div", {
4097
4104
  ref_key: "content",
4098
4105
  ref: n,
4099
4106
  class: "flex-1 flex flex-col"
@@ -4119,17 +4126,17 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4119
4126
  }, ml = { class: "relative mb-4 size-20 @sm/chat:size-24" }, gl = ["src", "alt"], vl = ["title"], xl = {
4120
4127
  key: 0,
4121
4128
  class: "flex items-center gap-3 py-3 px-2"
4122
- }, bl = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-issue-action-label", "data-issue-action-url", "data-streaming"], yl = { class: "max-w-[85%] min-w-0" }, kl = ["href"], wl = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], Tl = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Sl = {
4129
+ }, bl = ["data-journal-outcome"], yl = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-issue-action-label", "data-issue-action-url", "data-streaming"], kl = { class: "max-w-[85%] min-w-0" }, wl = ["href"], Tl = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], Sl = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Al = {
4123
4130
  key: 0,
4124
4131
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
4125
- }, Al = ["src", "alt"], El = ["data-journal-outcome"], _l = ["src", "alt"], Rl = ["src"], Cl = ["href"], Ml = {
4132
+ }, El = ["src", "alt"], _l = ["src", "alt"], Rl = ["src"], Cl = ["href"], Ml = {
4126
4133
  key: 0,
4127
4134
  "data-test": "messaging-message-text-part"
4128
- }, Il = ["src", "alt", "data-attachment-placement"], $l = ["src", "data-attachment-placement"], Dl = ["href", "data-attachment-placement"], Ll = ["data-journal-outcome"], Ol = ["data-working-description"], zl = { class: "truncate" }, Nl = ["data-issue-code"], Pl = ["href"], Bl = {
4135
+ }, Il = ["src", "alt", "data-attachment-placement"], $l = ["src", "data-attachment-placement"], Dl = ["href", "data-attachment-placement"], Ll = ["data-journal-outcome"], Ol = ["data-working-description"], zl = { class: "truncate" }, Nl = ["data-issue-code"], Pl = ["href"], Fl = {
4129
4136
  key: 3,
4130
4137
  "data-test": "messaging-thinking-indicator",
4131
4138
  class: "flex gap-2 justify-start items-center mb-4"
4132
- }, Fl = ["src", "alt"], Ul = {
4139
+ }, Bl = ["src", "alt"], Ul = {
4133
4140
  key: 0,
4134
4141
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
4135
4142
  }, Hl = ["src", "alt"], jl = { class: "max-w-20 truncate" }, Wl = ["onClick"], Gl = {
@@ -4141,7 +4148,7 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4141
4148
  }, Yl = {
4142
4149
  key: 1,
4143
4150
  class: "i-tabler-paperclip size-5"
4144
- }, Xl = { class: "sr-only" }, Zl = ["placeholder", "disabled"], Ql = { class: "font-mono text-sm tabular-nums" }, Jl = ["aria-label", "title"], eo = { class: "sr-only" }, to = ["data-composer-action", "disabled", "aria-label", "title"], no = {
4151
+ }, Xl = { class: "sr-only" }, Zl = ["placeholder", "disabled"], Jl = { class: "font-mono text-sm tabular-nums" }, Ql = ["aria-label", "title"], eo = { class: "sr-only" }, to = ["data-composer-action", "disabled", "aria-label", "title"], no = {
4145
4152
  key: 0,
4146
4153
  class: "i-tabler-player-stop-filled size-4"
4147
4154
  }, so = {
@@ -4166,553 +4173,544 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4166
4173
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
4167
4174
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
4168
4175
  }, e = T(() => {
4169
- const C = { ...t[a.scope] };
4170
- return a.scope === "org" && a.scopeName && (C.label = a.scopeName, C.tooltip = `Visible to ${a.scopeName} members`), C;
4176
+ const R = { ...t[a.scope] };
4177
+ return a.scope === "org" && a.scopeName && (R.label = a.scopeName, R.tooltip = `Visible to ${a.scopeName} members`), R;
4171
4178
  }), n = ge(!1), i = ge(), s = ge(), l = ge();
4172
- function o(C) {
4173
- return C ? /\[[^\]]+\]\([^)]+\)/.test(C) : !1;
4179
+ function o(R) {
4180
+ return R ? /\[[^\]]+\]\([^)]+\)/.test(R) : !1;
4174
4181
  }
4175
4182
  u(o, "containsMarkdownLink");
4176
- function p(C) {
4177
- return C.sender === "system" && (!!C.issue || C.id === $e.value);
4183
+ function p(R) {
4184
+ return R.sender === "system" && (!!R.issue || R.id === $e.value);
4178
4185
  }
4179
4186
  u(p, "isSystemExplainerMessage");
4180
- function d(C, v) {
4181
- const y = C[v], Z = C[v + 1];
4182
- return !Z || Z.sender !== y.sender;
4187
+ function d(R, v) {
4188
+ const b = R[v], Z = R[v + 1];
4189
+ return !Z || Z.sender !== b.sender;
4183
4190
  }
4184
4191
  u(d, "shouldShowAvatar");
4185
- const k = T(() => a.chatController?.textState.value), E = T(() => k.value?.isConnected ?? !1), x = T(() => k.value?.isThinking ?? !1), w = T(() => k.value?.connectionStatus === "disconnected" && !!k.value?.error), M = T(() => k.value?.connectionStatus !== "connected" && !k.value?.error), _ = T(() => k.value?.error), D = T(() => a.chatController?.sharedMessages.value ?? []), J = T(() => a.chatController?.workJournal?.value ? void 0 : k.value?.workingDescription?.trim() || void 0), S = T(() => a.chatController?.workJournal?.value), B = T(() => {
4186
- if (!S.value)
4192
+ const k = T(() => a.chatController?.textState.value), A = T(() => k.value?.isConnected ?? !1), x = T(() => k.value?.isThinking ?? !1), w = T(() => k.value?.connectionStatus === "disconnected" && !!k.value?.error), C = T(() => k.value?.connectionStatus !== "connected" && !k.value?.error), E = T(() => k.value?.error), $ = T(() => a.chatController?.sharedMessages.value ?? []), Q = T(() => a.chatController?.workJournal?.value ? void 0 : k.value?.workingDescription?.trim() || void 0), D = T(() => a.chatController?.workJournal?.value), N = T(() => {
4193
+ if (!D.value)
4187
4194
  return;
4188
- const C = D.value, v = C[C.length - 1];
4195
+ const R = $.value, v = R[R.length - 1];
4189
4196
  if (v)
4190
- return v.sender === "agent" || v.sender === "system" ? C.length >= 2 ? C[C.length - 2].id : void 0 : v.id;
4191
- }), N = T(() => {
4192
- const C = {};
4193
- for (const v of D.value) {
4194
- if (!v.toolActivities?.length)
4197
+ return v.sender === "agent" || v.sender === "system" ? R.length >= 2 ? R[R.length - 2].id : void 0 : v.id;
4198
+ }), z = T(() => {
4199
+ const R = {};
4200
+ for (const v of $.value) {
4201
+ if (v.sender === "user" || !v.toolActivities?.length)
4195
4202
  continue;
4196
- const y = a.chatController?.workJournalFor?.({
4203
+ const b = a.chatController?.workJournalFor?.({
4197
4204
  activities: v.toolActivities,
4198
- outcome: Ra(v)
4205
+ outcome: Ra(v),
4206
+ includeFailureNote: v.sender !== "system"
4199
4207
  });
4200
- y && (C[v.id] = y);
4208
+ b && (R[v.id] = b);
4201
4209
  }
4202
- return C;
4210
+ return R;
4203
4211
  });
4204
- function U(C) {
4205
- return N.value[C.id];
4212
+ function F(R) {
4213
+ return z.value[R.id];
4206
4214
  }
4207
- u(U, "messageWorkJournal");
4208
- function H(C, v) {
4209
- return C.placement?.kind !== "inline" || !Number.isFinite(C.placement.offset) ? null : Math.max(0, Math.min(v.length, Math.trunc(C.placement.offset)));
4215
+ u(F, "messageWorkJournal");
4216
+ function H(R, v) {
4217
+ return R.placement?.kind !== "inline" || !Number.isFinite(R.placement.offset) ? null : Math.max(0, Math.min(v.length, Math.trunc(R.placement.offset)));
4210
4218
  }
4211
4219
  u(H, "inlineOffset");
4212
- function V(C, v) {
4213
- return C.mediaId || `${C.src}:${v}`;
4220
+ function j(R, v) {
4221
+ return R.mediaId || `${R.src}:${v}`;
4214
4222
  }
4215
- u(V, "attachmentKey");
4216
- function he(C) {
4217
- return (C.attachments ?? []).map((v, y) => ({ attachment: v, index: y })).filter(({ attachment: v }) => H(v, C.text) === null);
4223
+ u(j, "attachmentKey");
4224
+ function re(R) {
4225
+ return (R.attachments ?? []).map((v, b) => ({ attachment: v, index: b })).filter(({ attachment: v }) => H(v, R.text) === null);
4218
4226
  }
4219
- u(he, "blockAttachmentsForMessage");
4220
- function Ie(C) {
4221
- const v = C.text ?? "";
4222
- if (C.sender !== "agent")
4223
- return v ? [{ kind: "text", key: `${C.id}:text`, text: v }] : [];
4224
- const y = (C.attachments ?? []).map((ae, Ke) => ({ attachment: ae, index: Ke, offset: H(ae, v) })).filter((ae) => ae.offset !== null).sort((ae, Ke) => ae.offset - Ke.offset || ae.index - Ke.index);
4225
- if (y.length === 0)
4226
- return v ? [{ kind: "text", key: `${C.id}:text`, text: v }] : [];
4227
+ u(re, "blockAttachmentsForMessage");
4228
+ function Ie(R) {
4229
+ const v = R.text ?? "";
4230
+ if (R.sender !== "agent")
4231
+ return v ? [{ kind: "text", key: `${R.id}:text`, text: v }] : [];
4232
+ const b = (R.attachments ?? []).map((ae, Ke) => ({ attachment: ae, index: Ke, offset: H(ae, v) })).filter((ae) => ae.offset !== null).sort((ae, Ke) => ae.offset - Ke.offset || ae.index - Ke.index);
4233
+ if (b.length === 0)
4234
+ return v ? [{ kind: "text", key: `${R.id}:text`, text: v }] : [];
4227
4235
  const Z = [];
4228
- let F = 0;
4229
- for (const ae of y)
4230
- ae.offset > F && Z.push({
4236
+ let U = 0;
4237
+ for (const ae of b)
4238
+ ae.offset > U && Z.push({
4231
4239
  kind: "text",
4232
- key: `${C.id}:text:${F}`,
4233
- text: v.slice(F, ae.offset)
4240
+ key: `${R.id}:text:${U}`,
4241
+ text: v.slice(U, ae.offset)
4234
4242
  }), Z.push({
4235
4243
  kind: "attachment",
4236
- key: `${C.id}:attachment:${V(ae.attachment, ae.index)}`,
4244
+ key: `${R.id}:attachment:${j(ae.attachment, ae.index)}`,
4237
4245
  attachment: ae.attachment,
4238
4246
  placement: "inline"
4239
- }), F = ae.offset;
4240
- return F < v.length && Z.push({
4247
+ }), U = ae.offset;
4248
+ return U < v.length && Z.push({
4241
4249
  kind: "text",
4242
- key: `${C.id}:text:${F}`,
4243
- text: v.slice(F)
4250
+ key: `${R.id}:text:${U}`,
4251
+ text: v.slice(U)
4244
4252
  }), Z;
4245
4253
  }
4246
4254
  u(Ie, "messageRenderParts");
4247
- const ce = T(() => k.value?.transientIssue), $e = T(() => {
4255
+ const ue = T(() => k.value?.transientIssue), $e = T(() => {
4248
4256
  if (!x.value) return;
4249
- const C = D.value, v = C[C.length - 1];
4257
+ const R = $.value, v = R[R.length - 1];
4250
4258
  return v?.sender === "agent" || v?.sender === "system" ? v.id : void 0;
4251
- }), vt = T(() => !x.value || J.value || S.value ? !1 : $e.value === void 0), st = T(() => k.value?.sendBlockedReason), oe = T(() => !E.value || st.value !== void 0), at = T(() => w.value ? "Agent is offline" : M.value ? "Connecting..." : st.value === "agent_deleted" ? "This assistant was deleted" : st.value === "account" ? "Open billing to keep chatting" : "Message"), be = T(() => a.chatController?.composerState?.value ?? {
4259
+ }), xt = T(() => !x.value || Q.value || D.value ? !1 : $e.value === void 0), st = T(() => k.value?.sendBlockedReason), ce = T(() => !A.value || st.value !== void 0), at = T(() => w.value ? "Agent is offline" : C.value ? "Connecting..." : st.value === "agent_deleted" ? "This assistant was deleted" : st.value === "account" ? "Open billing to keep chatting" : "Message"), be = T(() => a.chatController?.composerState?.value ?? {
4252
4260
  text: "",
4253
4261
  pendingAttachments: [],
4254
4262
  isUploading: !1
4255
4263
  }), je = T({
4256
4264
  get: /* @__PURE__ */ u(() => be.value.text, "get"),
4257
- set: /* @__PURE__ */ u((C) => a.chatController?.setComposerText?.({ text: C }), "set")
4258
- }), xt = T(() => be.value.pendingAttachments), Ee = T(() => be.value.isUploading), Le = T(() => a.chatController?.voiceRecorder), We = T(() => Le.value?.isBusy.value ?? !1), ke = T(() => a.chatController?.canAttachFile?.value ?? !1), Ge = T(() => a.chatController?.canRecordAudio?.value ?? !1), X = T(() => a.chatController?.composerAction?.value ?? "idle"), it = T(() => X.value !== "idle"), ie = T(() => X.value === "stop" ? "Stop reply" : "Send message"), rt = T(() => X.value === "idle" && Ge.value && !We.value && !!Le.value?.canUseBrowserRecording), te = T(() => Le.value?.isActive.value ?? !1), Ve = T(() => Le.value?.elapsedLabel.value ?? "0:00"), g = T(() => Le.value?.statusText.value ?? "Release to send"), A = T(() => Le.value?.state.value.phase === "sending" ? "Sending voice message" : te.value ? "Release to send voice message" : "Hold to record voice message"), c = T(() => a.variant === "light"), I = T(
4265
+ set: /* @__PURE__ */ u((R) => a.chatController?.setComposerText?.({ text: R }), "set")
4266
+ }), bt = T(() => be.value.pendingAttachments), Ee = T(() => be.value.isUploading), Le = T(() => a.chatController?.voiceRecorder), We = T(() => Le.value?.isBusy.value ?? !1), ke = T(() => a.chatController?.canAttachFile?.value ?? !1), Ge = T(() => a.chatController?.canRecordAudio?.value ?? !1), X = T(() => a.chatController?.composerAction?.value ?? "idle"), it = T(() => X.value !== "idle"), ie = T(() => X.value === "stop" ? "Stop reply" : "Send message"), rt = T(() => X.value === "idle" && Ge.value && !We.value && !!Le.value?.canUseBrowserRecording), te = T(() => Le.value?.isActive.value ?? !1), Ve = T(() => Le.value?.elapsedLabel.value ?? "0:00"), g = T(() => Le.value?.statusText.value ?? "Release to send"), S = T(() => Le.value?.state.value.phase === "sending" ? "Sending voice message" : te.value ? "Release to send voice message" : "Hold to record voice message"), c = T(() => a.variant === "light"), M = T(
4259
4267
  () => c.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
4260
4268
  ), L = T(() => c.value ? "text-theme-300" : "text-white/30");
4261
4269
  Yt(async () => {
4262
- a.chatController && !E.value && await a.chatController.startTextConversation();
4263
- }), zs(() => {
4270
+ a.chatController && !A.value && await a.chatController.startTextConversation();
4271
+ }), Os(() => {
4264
4272
  a.chatController?.voiceRecorder?.teardown();
4265
4273
  });
4266
4274
  async function O() {
4267
4275
  !a.chatController || X.value !== "send" || (s.value && (s.value.style.height = "auto", s.value.focus()), i.value?.pin(), await a.chatController.sendComposerMessage());
4268
4276
  }
4269
4277
  u(O, "sendMessage");
4270
- async function G() {
4278
+ async function V() {
4271
4279
  a.chatController && (X.value === "send" && i.value?.pin(), await a.chatController.handleComposerAction());
4272
4280
  }
4273
- u(G, "handleComposerAction");
4274
- async function re(C) {
4275
- C.key === "Enter" && !C.shiftKey && (C.preventDefault(), await O());
4281
+ u(V, "handleComposerAction");
4282
+ async function le(R) {
4283
+ R.key === "Enter" && !R.shiftKey && (R.preventDefault(), await O());
4276
4284
  }
4277
- u(re, "handleKeydown");
4285
+ u(le, "handleKeydown");
4278
4286
  function pe() {
4279
4287
  s.value && (s.value.style.height = "auto", s.value.style.height = `${Math.min(s.value.scrollHeight, 150)}px`);
4280
4288
  }
4281
- u(pe, "adjustTextareaHeight"), Kt(je, () => Bs(() => pe()));
4282
- function ue() {
4289
+ u(pe, "adjustTextareaHeight"), Kt(je, () => Ps(() => pe()));
4290
+ function de() {
4283
4291
  l.value?.click();
4284
4292
  }
4285
- u(ue, "triggerFileInput");
4286
- async function fe(C) {
4287
- const v = C.target, y = v.files?.[0];
4288
- !y || !a.chatController || We.value || (await a.chatController.attachFile({ file: y }), v.value = "");
4293
+ u(de, "triggerFileInput");
4294
+ async function fe(R) {
4295
+ const v = R.target, b = v.files?.[0];
4296
+ !b || !a.chatController || We.value || (await a.chatController.attachFile({ file: b }), v.value = "");
4289
4297
  }
4290
4298
  u(fe, "handleFileSelect");
4291
- function Te(C) {
4292
- a.chatController?.removeAttachment({ index: C });
4299
+ function Te(R) {
4300
+ a.chatController?.removeAttachment({ index: R });
4293
4301
  }
4294
4302
  u(Te, "removeAttachment");
4295
4303
  function De() {
4296
4304
  Le.value?.start();
4297
4305
  }
4298
4306
  u(De, "startRecording");
4299
- function _e(C) {
4300
- Le.value?.finish(C);
4307
+ function _e(R) {
4308
+ Le.value?.finish(R);
4301
4309
  }
4302
4310
  u(_e, "finishRecording");
4303
- function qe(C, v) {
4311
+ function qe(R, v) {
4304
4312
  if (v === 0) {
4305
- const bt = C[v];
4306
- return bt?.timestamp ? Pe(new Date(bt.timestamp)) : null;
4313
+ const yt = R[v];
4314
+ return yt?.timestamp ? Pe(new Date(yt.timestamp)) : null;
4307
4315
  }
4308
- const y = C[v - 1], Z = C[v];
4309
- if (!y?.timestamp || !Z?.timestamp) return null;
4310
- const F = new Date(y.timestamp).getTime();
4311
- return new Date(Z.timestamp).getTime() - F > 36e5 ? Pe(new Date(Z.timestamp)) : null;
4316
+ const b = R[v - 1], Z = R[v];
4317
+ if (!b?.timestamp || !Z?.timestamp) return null;
4318
+ const U = new Date(b.timestamp).getTime();
4319
+ return new Date(Z.timestamp).getTime() - U > 36e5 ? Pe(new Date(Z.timestamp)) : null;
4312
4320
  }
4313
4321
  u(qe, "shouldShowTimeDivider");
4314
- function Pe(C) {
4315
- const v = /* @__PURE__ */ new Date(), y = C.toDateString() === v.toDateString(), Z = new Date(v);
4322
+ function Pe(R) {
4323
+ const v = /* @__PURE__ */ new Date(), b = R.toDateString() === v.toDateString(), Z = new Date(v);
4316
4324
  Z.setDate(Z.getDate() - 1);
4317
- const F = C.toDateString() === Z.toDateString(), ae = C.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
4318
- if (y) return ae;
4319
- if (F) return `Yesterday, ${ae}`;
4320
- const Ke = C.getFullYear() === v.getFullYear();
4321
- return `${C.toLocaleDateString("en-US", {
4325
+ const U = R.toDateString() === Z.toDateString(), ae = R.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
4326
+ if (b) return ae;
4327
+ if (U) return `Yesterday, ${ae}`;
4328
+ const Ke = R.getFullYear() === v.getFullYear();
4329
+ return `${R.toLocaleDateString("en-US", {
4322
4330
  weekday: "long",
4323
4331
  month: "short",
4324
4332
  day: "numeric",
4325
4333
  ...Ke ? {} : { year: "numeric" }
4326
4334
  })}, ${ae}`;
4327
4335
  }
4328
- return u(Pe, "formatTimeDivider"), (C, v) => (h(), f("div", rl, [
4336
+ return u(Pe, "formatTimeDivider"), (R, v) => (h(), f("div", rl, [
4329
4337
  c.value ? a.showHeader ? (h(), f("div", ol, [
4330
- b("div", cl, [
4331
- Qe(Xa, {
4338
+ y("div", cl, [
4339
+ Je(Xa, {
4332
4340
  agent: a.agent,
4333
4341
  "show-status": !0,
4334
4342
  rounded: "full",
4335
4343
  class: "size-10"
4336
4344
  }, null, 8, ["agent"]),
4337
- b("div", ul, [
4338
- b("div", dl, j(a.agent.displayName.value), 1),
4339
- b("div", hl, j(a.agent.title.value || "Assistant"), 1)
4345
+ y("div", ul, [
4346
+ y("div", dl, W(a.agent.displayName.value), 1),
4347
+ y("div", hl, W(a.agent.title.value || "Assistant"), 1)
4340
4348
  ]),
4341
- a.headerMeta ? (h(), f("span", pl, j(a.headerMeta), 1)) : W("", !0)
4349
+ a.headerMeta ? (h(), f("span", pl, W(a.headerMeta), 1)) : G("", !0)
4342
4350
  ])
4343
- ])) : W("", !0) : (h(), f("div", ll, [
4344
- Qe(ja, {
4351
+ ])) : G("", !0) : (h(), f("div", ll, [
4352
+ Je(ja, {
4345
4353
  agent: a.agent,
4346
- "is-online": E.value
4354
+ "is-online": A.value
4347
4355
  }, null, 8, ["agent", "is-online"])
4348
4356
  ])),
4349
4357
  w.value ? (h(), f("div", {
4350
4358
  key: 2,
4351
- class: R(["py-16 flex flex-col items-center justify-center gap-3 text-sm", c.value ? "text-theme-400" : "text-white/60"])
4359
+ class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", c.value ? "text-theme-400" : "text-white/60"])
4352
4360
  }, [
4353
- b("i", {
4354
- class: R(["i-heroicons-cloud-arrow-down size-8", c.value ? "text-theme-300" : "text-white/40"])
4361
+ y("i", {
4362
+ class: _(["i-heroicons-cloud-arrow-down size-8", c.value ? "text-theme-300" : "text-white/40"])
4355
4363
  }, null, 2),
4356
- b("span", null, j(_.value), 1)
4357
- ], 2)) : M.value ? (h(), f("div", {
4364
+ y("span", null, W(E.value), 1)
4365
+ ], 2)) : C.value ? (h(), f("div", {
4358
4366
  key: 3,
4359
- class: R(["py-16 flex flex-col items-center justify-center gap-2 text-sm", c.value ? "text-theme-400" : "text-theme-600"])
4367
+ class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", c.value ? "text-theme-400" : "text-theme-600"])
4360
4368
  }, [
4361
- Qe(us, { class: "size-4" })
4369
+ Je(cs, { class: "size-4" })
4362
4370
  ], 2)) : a.setupHint ? (h(), f("div", {
4363
4371
  key: 4,
4364
- class: R(["flex items-center justify-center gap-1.5 py-2 text-[11px]", L.value])
4372
+ class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", L.value])
4365
4373
  }, [
4366
- v[18] || (v[18] = b("i", { class: "i-tabler-tool size-3" }, null, -1)),
4367
- b("span", null, j(a.setupHint), 1)
4368
- ], 2)) : W("", !0),
4369
- Qe(il, {
4374
+ v[18] || (v[18] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
4375
+ y("span", null, W(a.setupHint), 1)
4376
+ ], 2)) : G("", !0),
4377
+ Je(il, {
4370
4378
  ref_key: "chatScroller",
4371
4379
  ref: i,
4372
4380
  class: "flex-1"
4373
4381
  }, {
4374
- default: $n(() => [
4375
- b("div", {
4376
- class: R(D.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3 pb-[112px]" : "pt-4 pb-[120px] px-3 space-y-2")
4382
+ default: zs(() => [
4383
+ y("div", {
4384
+ class: _($.value.length === 0 ? "flex-1 flex flex-col items-center justify-center px-3 pb-[112px]" : "pt-4 pb-[120px] px-3 space-y-2")
4377
4385
  }, [
4378
- D.value.length === 0 && !M.value && !w.value ? (h(), f("div", fl, [
4379
- b("div", ml, [
4380
- b("img", {
4386
+ $.value.length === 0 && !C.value && !w.value ? (h(), f("div", fl, [
4387
+ y("div", ml, [
4388
+ y("img", {
4381
4389
  src: a.agent.avatarUrl.value,
4382
4390
  alt: a.agent.displayName.value,
4383
- class: R(["size-full rounded-full object-cover ring-1", c.value ? "ring-black/5" : "ring-white/10"])
4391
+ class: _(["size-full rounded-full object-cover ring-1", c.value ? "ring-black/5" : "ring-white/10"])
4384
4392
  }, null, 10, gl),
4385
- E.value ? (h(), f("span", {
4393
+ A.value ? (h(), f("span", {
4386
4394
  key: 0,
4387
- class: R(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", c.value ? "bg-white" : "bg-theme-900"])
4395
+ class: _(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", c.value ? "bg-white" : "bg-theme-900"])
4388
4396
  }, [...v[19] || (v[19] = [
4389
- b("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
4390
- ])], 2)) : W("", !0)
4397
+ y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
4398
+ ])], 2)) : G("", !0)
4391
4399
  ]),
4392
- b("div", {
4393
- class: R(["text-base @sm/chat:text-lg font-semibold", c.value ? "text-theme-900" : "text-white"])
4394
- }, j(a.agent.displayName.value), 3),
4395
- b("p", {
4396
- class: R(["mt-1 text-center text-xs @sm/chat:text-sm", L.value])
4397
- }, j(a.emptyStateMessage || "Type your message to get started."), 3),
4398
- b("div", {
4399
- class: R(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", c.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4400
+ y("div", {
4401
+ class: _(["text-base @sm/chat:text-lg font-semibold", c.value ? "text-theme-900" : "text-white"])
4402
+ }, W(a.agent.displayName.value), 3),
4403
+ y("p", {
4404
+ class: _(["mt-1 text-center text-xs @sm/chat:text-sm", L.value])
4405
+ }, W(a.emptyStateMessage || "Type your message to get started."), 3),
4406
+ y("div", {
4407
+ class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", c.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4400
4408
  title: e.value.tooltip
4401
4409
  }, [
4402
- b("i", {
4403
- class: R([e.value.icon, "size-3"])
4410
+ y("i", {
4411
+ class: _([e.value.icon, "size-3"])
4404
4412
  }, null, 2),
4405
- b("span", null, j(e.value.label), 1)
4413
+ y("span", null, W(e.value.label), 1)
4406
4414
  ], 10, vl)
4407
- ])) : W("", !0),
4408
- (h(!0), f(se, null, ve(D.value, (y, Z) => (h(), f(se, {
4409
- key: y.id
4415
+ ])) : G("", !0),
4416
+ (h(!0), f(se, null, ve($.value, (b, Z) => (h(), f(se, {
4417
+ key: b.id
4410
4418
  }, [
4411
- qe(D.value, Z) ? (h(), f("div", xl, [
4412
- b("div", {
4413
- class: R(["flex-1 h-px", I.value])
4419
+ qe($.value, Z) ? (h(), f("div", xl, [
4420
+ y("div", {
4421
+ class: _(["flex-1 h-px", M.value])
4414
4422
  }, null, 2),
4415
- b("span", {
4416
- class: R(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", L.value])
4417
- }, j(qe(D.value, Z)), 3),
4418
- b("div", {
4419
- class: R(["flex-1 h-px", I.value])
4423
+ y("span", {
4424
+ class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", L.value])
4425
+ }, W(qe($.value, Z)), 3),
4426
+ y("div", {
4427
+ class: _(["flex-1 h-px", M.value])
4420
4428
  }, null, 2)
4421
- ])) : W("", !0),
4422
- p(y) ? (h(), f("div", {
4429
+ ])) : G("", !0),
4430
+ F(b) ? (h(), f("div", {
4423
4431
  key: 1,
4432
+ "data-test": "messaging-message-tool-activity",
4433
+ "data-journal-outcome": F(b)?.outcome,
4434
+ class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4435
+ }, [
4436
+ Je(fs, {
4437
+ model: F(b),
4438
+ "is-light": c.value
4439
+ }, null, 8, ["model", "is-light"])
4440
+ ], 8, bl)) : G("", !0),
4441
+ p(b) ? (h(), f("div", {
4442
+ key: 2,
4424
4443
  "data-test": "messaging-system-msg",
4425
- "data-message-id": y.id,
4426
- "data-message-sender": y.sender,
4427
- "data-conversation-id": y.conversationId,
4428
- "data-message-sequence": y.sequence,
4429
- "data-system-kind": y.systemKind,
4430
- "data-issue-code": y.issue?.code,
4431
- "data-issue-bucket": y.issue?.bucket,
4432
- "data-issue-action-label": y.issue?.actionLabel,
4433
- "data-issue-action-url": y.issue?.actionUrl,
4434
- "data-streaming": y.id === $e.value ? "true" : void 0,
4444
+ "data-message-id": b.id,
4445
+ "data-message-sender": b.sender,
4446
+ "data-conversation-id": b.conversationId,
4447
+ "data-message-sequence": b.sequence,
4448
+ "data-system-kind": b.systemKind,
4449
+ "data-issue-code": b.issue?.code,
4450
+ "data-issue-bucket": b.issue?.bucket,
4451
+ "data-issue-action-label": b.issue?.actionLabel,
4452
+ "data-issue-action-url": b.issue?.actionUrl,
4453
+ "data-streaming": b.id === $e.value ? "true" : void 0,
4435
4454
  class: "flex gap-2 items-end justify-start mb-4"
4436
4455
  }, [
4437
- b("div", yl, [
4438
- b("div", {
4439
- class: R(["mb-1 pl-1 text-[11px] font-medium", c.value ? "text-theme-500" : "text-white/45"])
4456
+ y("div", kl, [
4457
+ y("div", {
4458
+ class: _(["mb-1 pl-1 text-[11px] font-medium", c.value ? "text-theme-500" : "text-white/45"])
4440
4459
  }, " System Message ", 2),
4441
- b("div", {
4442
- class: R(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", c.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
4460
+ y("div", {
4461
+ class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", c.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
4443
4462
  }, [
4444
- y.text ? (h(), ut(ln, {
4463
+ b.text ? (h(), mt(ln, {
4445
4464
  key: 0,
4446
- text: y.text,
4465
+ text: b.text,
4447
4466
  inverted: !c.value,
4448
- streaming: y.id === $e.value,
4467
+ streaming: b.id === $e.value,
4449
4468
  onClick: v[0] || (v[0] = Oe(() => {
4450
4469
  }, ["stop"]))
4451
- }, null, 8, ["text", "inverted", "streaming"])) : y.issue?.help ? (h(), ut(ln, {
4470
+ }, null, 8, ["text", "inverted", "streaming"])) : b.issue?.help ? (h(), mt(ln, {
4452
4471
  key: 1,
4453
- text: y.issue.help,
4472
+ text: b.issue.help,
4454
4473
  inverted: !c.value
4455
- }, null, 8, ["text", "inverted"])) : W("", !0),
4456
- y.issue?.actionUrl && !o(y.text) ? (h(), f("a", {
4474
+ }, null, 8, ["text", "inverted"])) : G("", !0),
4475
+ b.issue?.actionUrl && !o(b.text) ? (h(), f("a", {
4457
4476
  key: 2,
4458
- href: y.issue.actionUrl,
4477
+ href: b.issue.actionUrl,
4459
4478
  "data-test": "messaging-system-msg-action",
4460
- class: R(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", c.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
4479
+ class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", c.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
4461
4480
  onClick: v[1] || (v[1] = Oe(() => {
4462
4481
  }, ["stop"]))
4463
4482
  }, [
4464
- nt(j(y.issue.actionLabel) + " ", 1),
4465
- v[20] || (v[20] = b("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
4466
- ], 10, kl)) : W("", !0)
4483
+ nt(W(b.issue.actionLabel) + " ", 1),
4484
+ v[20] || (v[20] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
4485
+ ], 10, wl)) : G("", !0)
4467
4486
  ], 2)
4468
4487
  ])
4469
- ], 8, bl)) : y.sender === "system" ? (h(), f("div", {
4470
- key: 2,
4488
+ ], 8, yl)) : b.sender === "system" ? (h(), f("div", {
4489
+ key: 3,
4471
4490
  "data-test": "messaging-system-status-msg",
4472
- "data-message-id": y.id,
4473
- "data-message-sender": y.sender,
4474
- "data-conversation-id": y.conversationId,
4475
- "data-message-sequence": y.sequence,
4476
- "data-system-kind": y.systemKind,
4477
- "data-issue-code": y.issue?.code,
4478
- "data-issue-bucket": y.issue?.bucket,
4479
- "data-streaming": y.id === $e.value ? "true" : void 0,
4480
- class: R(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", c.value ? "text-theme-500" : "text-white/60"])
4491
+ "data-message-id": b.id,
4492
+ "data-message-sender": b.sender,
4493
+ "data-conversation-id": b.conversationId,
4494
+ "data-message-sequence": b.sequence,
4495
+ "data-system-kind": b.systemKind,
4496
+ "data-issue-code": b.issue?.code,
4497
+ "data-issue-bucket": b.issue?.bucket,
4498
+ "data-streaming": b.id === $e.value ? "true" : void 0,
4499
+ class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", c.value ? "text-theme-500" : "text-white/60"])
4481
4500
  }, [
4482
- v[21] || (v[21] = b("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
4483
- Qe(ln, {
4484
- text: y.text,
4501
+ v[21] || (v[21] = y("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
4502
+ Je(ln, {
4503
+ text: b.text,
4485
4504
  inverted: !c.value,
4486
4505
  onClick: v[2] || (v[2] = Oe(() => {
4487
4506
  }, ["stop"]))
4488
4507
  }, null, 8, ["text", "inverted"])
4489
- ], 10, wl)) : (h(), f("div", {
4490
- key: 3,
4491
- "data-test": y.sender === "agent" ? "messaging-assistant-msg" : y.sender === "user" ? "messaging-user-msg" : void 0,
4492
- "data-message-id": y.id,
4493
- "data-message-sender": y.sender,
4494
- "data-conversation-id": y.conversationId,
4495
- "data-message-sequence": y.sequence,
4496
- "data-system-kind": y.systemKind,
4497
- "data-streaming": y.id === $e.value ? "true" : void 0,
4498
- class: R(["flex gap-2 items-end", {
4499
- "justify-end": y.sender === "user",
4500
- "justify-start": y.sender === "agent",
4508
+ ], 10, Tl)) : (h(), f("div", {
4509
+ key: 4,
4510
+ "data-test": b.sender === "agent" ? "messaging-assistant-msg" : b.sender === "user" ? "messaging-user-msg" : void 0,
4511
+ "data-message-id": b.id,
4512
+ "data-message-sender": b.sender,
4513
+ "data-conversation-id": b.conversationId,
4514
+ "data-message-sequence": b.sequence,
4515
+ "data-system-kind": b.systemKind,
4516
+ "data-streaming": b.id === $e.value ? "true" : void 0,
4517
+ class: _(["flex gap-2 items-end", {
4518
+ "justify-end": b.sender === "user",
4519
+ "justify-start": b.sender === "agent",
4501
4520
  // Group-aware rhythm: tight (space-y) within a speaker's turn,
4502
4521
  // generous at the boundary between speakers (end of a group).
4503
- "mb-6": d(D.value, Z)
4522
+ "mb-6": d($.value, Z)
4504
4523
  }])
4505
4524
  }, [
4506
- y.sender === "agent" ? (h(), f("div", Sl, [
4507
- d(D.value, Z) ? (h(), f("img", {
4525
+ b.sender === "agent" ? (h(), f("div", Al, [
4526
+ d($.value, Z) ? (h(), f("img", {
4508
4527
  key: 0,
4509
4528
  src: a.agent.avatarUrl.value,
4510
4529
  alt: a.agent.displayName.value,
4511
- class: R(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", c.value ? "ring-1 ring-black/5" : ""])
4512
- }, null, 10, Al)) : W("", !0)
4513
- ])) : W("", !0),
4514
- b("div", {
4530
+ class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", c.value ? "ring-1 ring-black/5" : ""])
4531
+ }, null, 10, El)) : G("", !0)
4532
+ ])) : G("", !0),
4533
+ y("div", {
4515
4534
  "data-test": "messaging-message-body",
4516
- class: R(y.sender === "user" ? "max-w-[min(75%,22rem)]" : "max-w-[min(82%,68ch)]")
4535
+ class: _(b.sender === "user" ? "max-w-[min(75%,22rem)]" : "max-w-[min(82%,68ch)]")
4517
4536
  }, [
4518
- U(y) ? (h(), f("div", {
4537
+ re(b).length ? (h(), f("div", {
4519
4538
  key: 0,
4520
- "data-test": "messaging-message-tool-activity",
4521
- "data-journal-outcome": U(y)?.outcome,
4522
- class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4539
+ class: _(["mb-1 space-y-1", b.sender === "user" ? "flex flex-col items-end" : ""])
4523
4540
  }, [
4524
- Qe(ms, {
4525
- model: U(y),
4526
- "is-light": c.value
4527
- }, null, 8, ["model", "is-light"])
4528
- ], 8, El)) : W("", !0),
4529
- he(y).length ? (h(), f("div", {
4530
- key: 1,
4531
- class: R(["mb-1 space-y-1", y.sender === "user" ? "flex flex-col items-end" : ""])
4532
- }, [
4533
- (h(!0), f(se, null, ve(he(y), ({ attachment: F, index: ae }) => (h(), f(se, {
4534
- key: V(F, ae)
4541
+ (h(!0), f(se, null, ve(re(b), ({ attachment: U, index: ae }) => (h(), f(se, {
4542
+ key: j(U, ae)
4535
4543
  }, [
4536
- F.type === "image" ? (h(), f("img", {
4544
+ U.type === "image" ? (h(), f("img", {
4537
4545
  key: 0,
4538
- src: F.src,
4539
- alt: F.filename,
4546
+ src: U.src,
4547
+ alt: U.filename,
4540
4548
  "data-test": "messaging-attachment",
4541
4549
  "data-attachment-placement": "block",
4542
4550
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
4543
- }, null, 8, _l)) : F.type === "audio" ? (h(), f("audio", {
4551
+ }, null, 8, _l)) : U.type === "audio" ? (h(), f("audio", {
4544
4552
  key: 1,
4545
- src: F.src,
4553
+ src: U.src,
4546
4554
  controls: "",
4547
4555
  "data-test": "messaging-attachment",
4548
4556
  "data-attachment-placement": "block",
4549
4557
  class: "max-w-full"
4550
4558
  }, null, 8, Rl)) : (h(), f("a", {
4551
4559
  key: 2,
4552
- href: F.src,
4560
+ href: U.src,
4553
4561
  target: "_blank",
4554
4562
  rel: "noopener",
4555
4563
  "data-test": "messaging-attachment",
4556
4564
  "data-attachment-placement": "block",
4557
- class: R(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", c.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4565
+ class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", c.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4558
4566
  }, [
4559
- v[22] || (v[22] = b("i", { class: "i-tabler-file size-3.5" }, null, -1)),
4560
- nt(" " + j(F.filename), 1)
4567
+ v[22] || (v[22] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
4568
+ nt(" " + W(U.filename), 1)
4561
4569
  ], 10, Cl))
4562
4570
  ], 64))), 128))
4563
- ], 2)) : W("", !0),
4564
- Ie(y).length ? (h(), f("div", {
4565
- key: 2,
4571
+ ], 2)) : G("", !0),
4572
+ Ie(b).length ? (h(), f("div", {
4573
+ key: 1,
4566
4574
  "data-test": "messaging-message-content",
4567
- class: R(
4568
- y.sender === "user" ? c.value ? "rounded-2xl px-3.5 py-2 bg-theme-900 text-theme-0" : "rounded-2xl px-3.5 py-2 bg-theme-0 text-theme-950" : c.value ? "text-theme-800" : "text-white/95"
4575
+ class: _(
4576
+ b.sender === "user" ? c.value ? "rounded-2xl px-3.5 py-2 bg-theme-900 text-theme-0" : "rounded-2xl px-3.5 py-2 bg-theme-0 text-theme-950" : c.value ? "text-theme-800" : "text-white/95"
4569
4577
  )
4570
4578
  }, [
4571
- (h(!0), f(se, null, ve(Ie(y), (F) => (h(), f(se, {
4572
- key: F.key
4579
+ (h(!0), f(se, null, ve(Ie(b), (U) => (h(), f(se, {
4580
+ key: U.key
4573
4581
  }, [
4574
- F.kind === "text" && F.text ? (h(), f("div", Ml, [
4575
- Qe(ln, {
4576
- text: F.text,
4577
- inverted: y.sender === "user" || !c.value,
4578
- streaming: y.id === $e.value,
4582
+ U.kind === "text" && U.text ? (h(), f("div", Ml, [
4583
+ Je(ln, {
4584
+ text: U.text,
4585
+ inverted: b.sender === "user" || !c.value,
4586
+ streaming: b.id === $e.value,
4579
4587
  onClick: v[3] || (v[3] = Oe(() => {
4580
4588
  }, ["stop"]))
4581
4589
  }, null, 8, ["text", "inverted", "streaming"])
4582
- ])) : F.kind === "attachment" && F.attachment.type === "image" ? (h(), f("img", {
4590
+ ])) : U.kind === "attachment" && U.attachment.type === "image" ? (h(), f("img", {
4583
4591
  key: 1,
4584
- src: F.attachment.src,
4585
- alt: F.attachment.filename,
4592
+ src: U.attachment.src,
4593
+ alt: U.attachment.filename,
4586
4594
  "data-test": "messaging-attachment",
4587
- "data-attachment-placement": F.placement,
4595
+ "data-attachment-placement": U.placement,
4588
4596
  class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
4589
- }, null, 8, Il)) : F.kind === "attachment" && F.attachment.type === "audio" ? (h(), f("audio", {
4597
+ }, null, 8, Il)) : U.kind === "attachment" && U.attachment.type === "audio" ? (h(), f("audio", {
4590
4598
  key: 2,
4591
- src: F.attachment.src,
4599
+ src: U.attachment.src,
4592
4600
  controls: "",
4593
4601
  "data-test": "messaging-attachment",
4594
- "data-attachment-placement": F.placement,
4602
+ "data-attachment-placement": U.placement,
4595
4603
  class: "my-2 max-w-full"
4596
- }, null, 8, $l)) : F.kind === "attachment" ? (h(), f("a", {
4604
+ }, null, 8, $l)) : U.kind === "attachment" ? (h(), f("a", {
4597
4605
  key: 3,
4598
- href: F.attachment.src,
4606
+ href: U.attachment.src,
4599
4607
  target: "_blank",
4600
4608
  rel: "noopener",
4601
4609
  "data-test": "messaging-attachment",
4602
- "data-attachment-placement": F.placement,
4603
- class: R(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", c.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4610
+ "data-attachment-placement": U.placement,
4611
+ class: _(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", c.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4604
4612
  }, [
4605
- v[23] || (v[23] = b("i", { class: "i-tabler-file size-3.5" }, null, -1)),
4606
- nt(" " + j(F.attachment.filename), 1)
4607
- ], 10, Dl)) : W("", !0)
4613
+ v[23] || (v[23] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
4614
+ nt(" " + W(U.attachment.filename), 1)
4615
+ ], 10, Dl)) : G("", !0)
4608
4616
  ], 64))), 128))
4609
- ], 2)) : W("", !0)
4617
+ ], 2)) : G("", !0)
4610
4618
  ], 2)
4611
- ], 10, Tl)),
4612
- S.value && y.id === B.value ? (h(), ut(Ns, {
4613
- key: 4,
4614
- appear: "",
4615
- "enter-active-class": "motion-safe:transition motion-safe:duration-200 motion-safe:ease-out",
4616
- "enter-from-class": "motion-safe:opacity-0 motion-safe:translate-y-1",
4617
- "enter-to-class": "motion-safe:opacity-100 motion-safe:translate-y-0"
4618
- }, {
4619
- default: $n(() => [
4620
- b("div", {
4621
- "data-test": "messaging-tool-activity",
4622
- "data-journal-outcome": S.value?.outcome,
4623
- class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4624
- }, [
4625
- Qe(ms, {
4626
- model: S.value,
4627
- "is-light": c.value
4628
- }, null, 8, ["model", "is-light"])
4629
- ], 8, Ll)
4630
- ]),
4631
- _: 1
4632
- })) : W("", !0)
4619
+ ], 10, Sl)),
4620
+ D.value && b.id === N.value ? (h(), f("div", {
4621
+ key: 5,
4622
+ "data-test": "messaging-tool-activity",
4623
+ "data-journal-outcome": D.value.outcome,
4624
+ class: "mb-3 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4625
+ }, [
4626
+ Je(fs, {
4627
+ model: D.value,
4628
+ "is-light": c.value
4629
+ }, null, 8, ["model", "is-light"])
4630
+ ], 8, Ll)) : G("", !0)
4633
4631
  ], 64))), 128)),
4634
- J.value ? (h(), f("div", {
4632
+ Q.value ? (h(), f("div", {
4635
4633
  key: 1,
4636
4634
  "data-test": "messaging-working-state",
4637
- "data-working-description": J.value,
4638
- class: R(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", c.value ? "text-theme-500" : "text-white/45"])
4635
+ "data-working-description": Q.value,
4636
+ class: _(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", c.value ? "text-theme-500" : "text-white/45"])
4639
4637
  }, [
4640
- v[24] || (v[24] = b("i", {
4638
+ v[24] || (v[24] = y("i", {
4641
4639
  class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
4642
4640
  "aria-hidden": "true"
4643
4641
  }, null, -1)),
4644
- b("span", zl, j(J.value), 1)
4645
- ], 10, Ol)) : W("", !0),
4646
- ce.value ? (h(), f("div", {
4642
+ y("span", zl, W(Q.value), 1)
4643
+ ], 10, Ol)) : G("", !0),
4644
+ ue.value ? (h(), f("div", {
4647
4645
  key: 2,
4648
4646
  "data-test": "messaging-transient-issue",
4649
- "data-issue-code": ce.value.code,
4650
- class: R(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", c.value ? "text-theme-600" : "text-white/60"])
4647
+ "data-issue-code": ue.value.code,
4648
+ class: _(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", c.value ? "text-theme-600" : "text-white/60"])
4651
4649
  }, [
4652
- v[25] || (v[25] = b("i", {
4650
+ v[25] || (v[25] = y("i", {
4653
4651
  class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
4654
4652
  "aria-hidden": "true"
4655
4653
  }, null, -1)),
4656
- b("span", null, [
4657
- nt(j(ce.value.message), 1),
4658
- ce.value.help ? (h(), f(se, { key: 0 }, [
4659
- nt(j(ce.value.help), 1)
4660
- ], 64)) : W("", !0)
4654
+ y("span", null, [
4655
+ nt(W(ue.value.message), 1),
4656
+ ue.value.help ? (h(), f(se, { key: 0 }, [
4657
+ nt(W(ue.value.help), 1)
4658
+ ], 64)) : G("", !0)
4661
4659
  ]),
4662
- ce.value.actionUrl && ce.value.actionLabel ? (h(), f("a", {
4660
+ ue.value.actionUrl && ue.value.actionLabel ? (h(), f("a", {
4663
4661
  key: 0,
4664
- href: ce.value.actionUrl,
4662
+ href: ue.value.actionUrl,
4665
4663
  class: "shrink-0 underline underline-offset-2",
4666
4664
  onClick: v[4] || (v[4] = Oe(() => {
4667
4665
  }, ["stop"]))
4668
- }, j(ce.value.actionLabel), 9, Pl)) : W("", !0)
4669
- ], 10, Nl)) : W("", !0),
4670
- vt.value ? (h(), f("div", Bl, [
4671
- b("img", {
4666
+ }, W(ue.value.actionLabel), 9, Pl)) : G("", !0)
4667
+ ], 10, Nl)) : G("", !0),
4668
+ xt.value ? (h(), f("div", Fl, [
4669
+ y("img", {
4672
4670
  src: a.agent.avatarUrl.value,
4673
4671
  alt: a.agent.displayName.value,
4674
- class: R(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", c.value ? "ring-1 ring-black/5" : ""])
4675
- }, null, 10, Fl),
4676
- b("i", {
4677
- class: R(["i-svg-spinners-3-dots-bounce size-7", c.value ? "text-theme-400" : "text-white/50"]),
4672
+ class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", c.value ? "ring-1 ring-black/5" : ""])
4673
+ }, null, 10, Bl),
4674
+ y("i", {
4675
+ class: _(["i-svg-spinners-3-dots-bounce size-7", c.value ? "text-theme-400" : "text-white/50"]),
4678
4676
  "aria-hidden": "true"
4679
4677
  }, null, 2)
4680
- ])) : W("", !0)
4678
+ ])) : G("", !0)
4681
4679
  ], 2)
4682
4680
  ]),
4683
4681
  _: 1
4684
4682
  }, 512),
4685
- b("div", {
4686
- class: R(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", c.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
4683
+ y("div", {
4684
+ class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", c.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
4687
4685
  }, [
4688
- xt.value.length > 0 ? (h(), f("div", Ul, [
4689
- (h(!0), f(se, null, ve(xt.value, (y, Z) => (h(), f("div", {
4686
+ bt.value.length > 0 ? (h(), f("div", Ul, [
4687
+ (h(!0), f(se, null, ve(bt.value, (b, Z) => (h(), f("div", {
4690
4688
  key: Z,
4691
4689
  class: "relative shrink-0 group"
4692
4690
  }, [
4693
- y.type === "image" ? (h(), f("img", {
4691
+ b.type === "image" ? (h(), f("img", {
4694
4692
  key: 0,
4695
- src: y.src,
4696
- alt: y.filename,
4697
- class: R(["size-14 rounded-xl object-cover border", c.value ? "border-black/10" : "border-white/20"])
4693
+ src: b.src,
4694
+ alt: b.filename,
4695
+ class: _(["size-14 rounded-xl object-cover border", c.value ? "border-black/10" : "border-white/20"])
4698
4696
  }, null, 10, Hl)) : (h(), f("div", {
4699
4697
  key: 1,
4700
- class: R(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", c.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
4698
+ class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", c.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
4701
4699
  }, [
4702
- v[26] || (v[26] = b("i", { class: "i-tabler-file size-4" }, null, -1)),
4703
- b("span", jl, j(y.filename), 1)
4700
+ v[26] || (v[26] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
4701
+ y("span", jl, W(b.filename), 1)
4704
4702
  ], 2)),
4705
- b("button", {
4703
+ y("button", {
4706
4704
  class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
4707
- onClick: /* @__PURE__ */ u((F) => Te(Z), "onClick")
4705
+ onClick: /* @__PURE__ */ u((U) => Te(Z), "onClick")
4708
4706
  }, [...v[27] || (v[27] = [
4709
- b("i", { class: "i-tabler-x size-3" }, null, -1)
4707
+ y("i", { class: "i-tabler-x size-3" }, null, -1)
4710
4708
  ])], 8, Wl)
4711
4709
  ]))), 128)),
4712
4710
  Ee.value ? (h(), f("div", Gl, [
4713
- Qe(us, { class: "size-5" })
4714
- ])) : W("", !0)
4715
- ])) : W("", !0),
4711
+ Je(cs, { class: "size-5" })
4712
+ ])) : G("", !0)
4713
+ ])) : G("", !0),
4716
4714
  ke.value ? (h(), f("input", {
4717
4715
  key: 1,
4718
4716
  ref_key: "fileInput",
@@ -4721,89 +4719,89 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4721
4719
  accept: "image/*,audio/*,video/*",
4722
4720
  class: "hidden",
4723
4721
  onChange: fe
4724
- }, null, 544)) : W("", !0),
4725
- b("div", {
4722
+ }, null, 544)) : G("", !0),
4723
+ y("div", {
4726
4724
  "data-test": "messaging-composer",
4727
4725
  "data-composer-action": X.value,
4728
- class: R(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", c.value ? n.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : n.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
4726
+ class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", c.value ? n.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : n.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
4729
4727
  }, [
4730
- b("button", {
4731
- class: R(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
4728
+ y("button", {
4729
+ class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
4732
4730
  ke.value ? "cursor-pointer" : "cursor-default",
4733
4731
  c.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
4734
4732
  Ee.value || We.value ? "opacity-50 pointer-events-none" : ""
4735
4733
  ]]),
4736
- disabled: oe.value || Ee.value || We.value || !ke.value,
4734
+ disabled: ce.value || Ee.value || We.value || !ke.value,
4737
4735
  "aria-label": ke.value ? "Attach file" : "File attachments unavailable",
4738
4736
  title: ke.value ? "Attach file" : "File attachments unavailable",
4739
- onClick: v[5] || (v[5] = (y) => ke.value && ue())
4737
+ onClick: v[5] || (v[5] = (b) => ke.value && de())
4740
4738
  }, [
4741
4739
  Ee.value ? (h(), f("i", Kl)) : (h(), f("i", Yl)),
4742
- b("span", Xl, j(ke.value ? "Attach file" : "File attachments unavailable"), 1)
4740
+ y("span", Xl, W(ke.value ? "Attach file" : "File attachments unavailable"), 1)
4743
4741
  ], 10, ql),
4744
4742
  te.value ? (h(), f("div", {
4745
4743
  key: 1,
4746
4744
  "data-test": "messaging-recording-state",
4747
- class: R(["flex min-w-0 flex-1 items-center gap-2 px-1 py-2", c.value ? "text-theme-700" : "text-white/80"])
4745
+ class: _(["flex min-w-0 flex-1 items-center gap-2 px-1 py-2", c.value ? "text-theme-700" : "text-white/80"])
4748
4746
  }, [
4749
- v[28] || (v[28] = b("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
4750
- b("span", Ql, j(Ve.value), 1),
4751
- b("span", {
4752
- class: R(["min-w-0 truncate text-sm", c.value ? "text-theme-400" : "text-white/45"])
4753
- }, j(g.value), 3)
4754
- ], 2)) : Ps((h(), f("textarea", {
4747
+ v[28] || (v[28] = y("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
4748
+ y("span", Jl, W(Ve.value), 1),
4749
+ y("span", {
4750
+ class: _(["min-w-0 truncate text-sm", c.value ? "text-theme-400" : "text-white/45"])
4751
+ }, W(g.value), 3)
4752
+ ], 2)) : Ns((h(), f("textarea", {
4755
4753
  key: 0,
4756
4754
  ref_key: "textarea",
4757
4755
  ref: s,
4758
- "onUpdate:modelValue": v[6] || (v[6] = (y) => je.value = y),
4756
+ "onUpdate:modelValue": v[6] || (v[6] = (b) => je.value = b),
4759
4757
  "data-test": "messaging-input",
4760
4758
  rows: "1",
4761
4759
  enterkeyhint: "send",
4762
4760
  placeholder: at.value,
4763
- disabled: oe.value,
4761
+ disabled: ce.value,
4764
4762
  style: { fontSize: "16px", resize: "none" },
4765
- class: R(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", c.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
4766
- onKeydown: re,
4767
- onFocus: v[7] || (v[7] = (y) => n.value = !0),
4768
- onBlur: v[8] || (v[8] = (y) => n.value = !1)
4763
+ class: _(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", c.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
4764
+ onKeydown: le,
4765
+ onFocus: v[7] || (v[7] = (b) => n.value = !0),
4766
+ onBlur: v[8] || (v[8] = (b) => n.value = !1)
4769
4767
  }, null, 42, Zl)), [
4770
4768
  [xa, je.value]
4771
4769
  ]),
4772
4770
  rt.value || te.value ? (h(), f("button", {
4773
4771
  key: 2,
4774
4772
  "data-test": "messaging-record-audio-btn",
4775
- class: R(["mb-0.5 mr-0.5 flex size-9 shrink-0 items-center justify-center rounded-full transition-transform duration-200 @sm/chat:size-10", te.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : c.value ? "text-theme-500 hover:bg-black/5 hover:text-theme-700 cursor-pointer" : "text-white/60 hover:bg-white/10 hover:text-white cursor-pointer"]),
4776
- "aria-label": A.value,
4777
- title: A.value,
4778
- onPointerdown: v[9] || (v[9] = Oe((y) => De(), ["prevent"])),
4779
- onPointerup: v[10] || (v[10] = Oe((y) => _e({ cancelled: !1 }), ["prevent"])),
4780
- onPointercancel: v[11] || (v[11] = Oe((y) => _e({ cancelled: !0 }), ["prevent"])),
4773
+ class: _(["mb-0.5 mr-0.5 flex size-9 shrink-0 items-center justify-center rounded-full transition-transform duration-200 @sm/chat:size-10", te.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : c.value ? "text-theme-500 hover:bg-black/5 hover:text-theme-700 cursor-pointer" : "text-white/60 hover:bg-white/10 hover:text-white cursor-pointer"]),
4774
+ "aria-label": S.value,
4775
+ title: S.value,
4776
+ onPointerdown: v[9] || (v[9] = Oe((b) => De(), ["prevent"])),
4777
+ onPointerup: v[10] || (v[10] = Oe((b) => _e({ cancelled: !1 }), ["prevent"])),
4778
+ onPointercancel: v[11] || (v[11] = Oe((b) => _e({ cancelled: !0 }), ["prevent"])),
4781
4779
  onKeydown: [
4782
- v[12] || (v[12] = Ft(Oe((y) => De(), ["prevent"]), ["enter"])),
4783
- v[14] || (v[14] = Ft(Oe((y) => De(), ["prevent"]), ["space"])),
4784
- v[16] || (v[16] = Ft(Oe((y) => _e({ cancelled: !0 }), ["prevent"]), ["escape"]))
4780
+ v[12] || (v[12] = Bt(Oe((b) => De(), ["prevent"]), ["enter"])),
4781
+ v[14] || (v[14] = Bt(Oe((b) => De(), ["prevent"]), ["space"])),
4782
+ v[16] || (v[16] = Bt(Oe((b) => _e({ cancelled: !0 }), ["prevent"]), ["escape"]))
4785
4783
  ],
4786
4784
  onKeyup: [
4787
- v[13] || (v[13] = Ft(Oe((y) => _e({ cancelled: !1 }), ["prevent"]), ["enter"])),
4788
- v[15] || (v[15] = Ft(Oe((y) => _e({ cancelled: !1 }), ["prevent"]), ["space"]))
4785
+ v[13] || (v[13] = Bt(Oe((b) => _e({ cancelled: !1 }), ["prevent"]), ["enter"])),
4786
+ v[15] || (v[15] = Bt(Oe((b) => _e({ cancelled: !1 }), ["prevent"]), ["space"]))
4789
4787
  ]
4790
4788
  }, [
4791
- b("i", {
4792
- class: R([te.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
4789
+ y("i", {
4790
+ class: _([te.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
4793
4791
  }, null, 2),
4794
- b("span", eo, j(A.value), 1)
4795
- ], 42, Jl)) : (h(), f("button", {
4792
+ y("span", eo, W(S.value), 1)
4793
+ ], 42, Ql)) : (h(), f("button", {
4796
4794
  key: 3,
4797
4795
  "data-test": "messaging-send-btn",
4798
4796
  "data-composer-action": X.value,
4799
- class: R(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", it.value ? c.value ? "bg-theme-900 text-theme-0 hover:scale-105 active:scale-95 cursor-pointer" : "bg-theme-0 text-theme-950 hover:scale-105 active:scale-95 cursor-pointer" : c.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
4797
+ class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", it.value ? c.value ? "bg-theme-900 text-theme-0 hover:scale-105 active:scale-95 cursor-pointer" : "bg-theme-0 text-theme-950 hover:scale-105 active:scale-95 cursor-pointer" : c.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
4800
4798
  disabled: !it.value,
4801
4799
  "aria-label": ie.value,
4802
4800
  title: ie.value,
4803
- onClick: v[17] || (v[17] = (y) => G())
4801
+ onClick: v[17] || (v[17] = (b) => V())
4804
4802
  }, [
4805
4803
  X.value === "stop" ? (h(), f("i", no)) : (h(), f("i", so)),
4806
- b("span", ao, j(ie.value), 1)
4804
+ y("span", ao, W(ie.value), 1)
4807
4805
  ], 10, to))
4808
4806
  ], 10, Vl)
4809
4807
  ], 2)
@@ -4908,7 +4906,7 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4908
4906
  }
4909
4907
  }), (o, p) => (h(), f("div", io, [
4910
4908
  i.value ? (h(), f("div", ro, [...p[0] || (p[0] = [
4911
- b("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
4909
+ y("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
4912
4910
  ])])) : s.value ? fn(o.$slots, "default", {
4913
4911
  key: 1,
4914
4912
  sdk: on(n),
@@ -4918,22 +4916,22 @@ const Rr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4918
4916
  buttonText: a.buttonText,
4919
4917
  buttonIcon: a.buttonIcon,
4920
4918
  loading: i.value
4921
- }) : W("", !0)
4919
+ }) : G("", !0)
4922
4920
  ]));
4923
4921
  }
4924
4922
  });
4925
4923
  export {
4926
- hs as A,
4924
+ ds as A,
4927
4925
  xo as _,
4928
4926
  ln as a,
4929
4927
  vo as b,
4930
4928
  mo as c,
4931
4929
  fo as d,
4932
4930
  go as e,
4933
- us as f,
4931
+ cs as f,
4934
4932
  ho as g,
4935
4933
  ja as h,
4936
- fs as i,
4934
+ ps as i,
4937
4935
  po as p
4938
4936
  };
4939
4937
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map