@pagelines/sdk 1.0.660 → 1.0.662

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,11 +1,11 @@
1
- var ds = Object.defineProperty;
2
- var ma = (a, t, e) => t in a ? ds(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var d = (a, t) => ds(a, "name", { value: t, configurable: !0 });
4
- var P = (a, t, e) => ma(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as Re, openBlock as h, createElementBlock as f, createElementVNode as w, normalizeClass as C, ref as ge, computed as S, shallowRef as ht, watch as Qt, createCommentVNode as j, renderSlot as vn, onMounted as tn, unref as en, Fragment as Q, toDisplayString as W, reactive as ga, onUnmounted as Ns, createBlock as kt, Teleport as va, createVNode as Ne, Transition as xa, withCtx as Ps, withDirectives as Bs, normalizeStyle as q, createTextVNode as ot, vShow as ba, nextTick as Fs, renderList as me, onBeforeUnmount as Us, withModifiers as Le, vModelText as ya, withKeys as jt } from "vue";
6
- import { SettingsObject as Hs, Agent as hn, CHAT_ISSUE_COPY as ka, getDefaultAvatarUrl as Un, parseChatVisualFencePayload as wa, createLogger as Ta } from "@pagelines/core";
7
- import { P as Sa } from "./sdkClient.js";
8
- const Aa = { class: "spinner max-w-sm" }, Ea = {
1
+ var hs = Object.defineProperty;
2
+ var ga = (a, t, e) => t in a ? hs(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var d = (a, t) => hs(a, "name", { value: t, configurable: !0 });
4
+ var P = (a, t, e) => ga(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as Re, openBlock as h, createElementBlock as f, createElementVNode as w, normalizeClass as C, ref as ge, computed as S, shallowRef as ht, watch as Qt, createCommentVNode as H, renderSlot as vn, onMounted as tn, unref as en, Fragment as ee, toDisplayString as j, reactive as va, onUnmounted as Ps, createBlock as kt, Teleport as xa, createVNode as Ne, Transition as ya, withCtx as Bs, withDirectives as Fs, normalizeStyle as q, createTextVNode as ot, vShow as ba, nextTick as Us, renderList as me, onBeforeUnmount as Hs, withModifiers as Le, vModelText as ka, withKeys as jt } from "vue";
6
+ import { SettingsObject as js, Agent as hn, isAssistantSilenceControl as _n, CHAT_ISSUE_COPY as wa, getDefaultAvatarUrl as Hn, parseChatVisualFencePayload as Ta, createLogger as Sa } from "@pagelines/core";
7
+ import { P as Aa } from "./sdkClient.js";
8
+ const _a = { class: "spinner max-w-sm" }, Ea = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
11
  }, En = /* @__PURE__ */ Re({
@@ -15,7 +15,7 @@ const Aa = { class: "spinner max-w-sm" }, Ea = {
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
17
  setup(a) {
18
- return (t, e) => (h(), f("div", Aa, [
18
+ return (t, e) => (h(), f("div", _a, [
19
19
  (h(), f("svg", Ea, [
20
20
  w("circle", {
21
21
  class: C([a.colorMode, "ring-path"]),
@@ -31,26 +31,26 @@ const Aa = { class: "spinner max-w-sm" }, Ea = {
31
31
  ]));
32
32
  }
33
33
  });
34
- function _a(a) {
34
+ function Ra(a) {
35
35
  const t = Math.max(0, Math.floor(a.ms / 1e3)), e = Math.floor(t / 60), n = t % 60;
36
36
  return `${e}:${n.toString().padStart(2, "0")}`;
37
37
  }
38
- d(_a, "formatVoiceRecordingDuration");
39
- function Ra(a) {
38
+ d(Ra, "formatVoiceRecordingDuration");
39
+ function Ma(a) {
40
40
  return a.mimeType.includes("mp4") || a.mimeType.includes("m4a") ? "m4a" : a.mimeType.includes("ogg") ? "ogg" : a.mimeType.includes("wav") ? "wav" : "webm";
41
41
  }
42
- d(Ra, "audioExtension");
43
- function Ma() {
42
+ d(Ma, "audioExtension");
43
+ function Ca() {
44
44
  return typeof MediaRecorder > "u" ? "" : ["audio/webm;codecs=opus", "audio/mp4", "audio/webm"].find((t) => MediaRecorder.isTypeSupported?.(t)) || "";
45
45
  }
46
- d(Ma, "recorderMimeType");
47
- const Zn = class Zn extends Hs {
46
+ d(Ca, "recorderMimeType");
47
+ const Jn = class Jn extends js {
48
48
  constructor(e) {
49
49
  super("VoiceRecorderController", e);
50
50
  P(this, "state", ge({ phase: "idle", elapsedMs: 0 }));
51
51
  P(this, "isActive", S(() => this.state.value.phase !== "idle"));
52
52
  P(this, "isBusy", S(() => this.state.value.phase !== "idle"));
53
- P(this, "elapsedLabel", S(() => _a({ ms: this.state.value.elapsedMs })));
53
+ P(this, "elapsedLabel", S(() => Ra({ ms: this.state.value.elapsedMs })));
54
54
  P(this, "statusText", S(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send"));
55
55
  P(this, "recorder");
56
56
  P(this, "stream");
@@ -79,7 +79,7 @@ const Zn = class Zn extends Hs {
79
79
  n.getTracks().forEach((l) => l.stop());
80
80
  return;
81
81
  }
82
- const i = Ma(), s = this.createRecorder({ stream: n, mimeType: i });
82
+ const i = Ca(), s = this.createRecorder({ stream: n, mimeType: i });
83
83
  this.stream = n, this.recorder = s, this.chunks = [], s.addEventListener("dataavailable", (l) => {
84
84
  l.data.size > 0 && this.chunks.push(l.data);
85
85
  }), s.addEventListener("stop", async () => {
@@ -128,7 +128,7 @@ const Zn = class Zn extends Hs {
128
128
  return;
129
129
  const s = e.blob.type || "audio/webm", l = new File(
130
130
  [e.blob],
131
- `voice-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.${Ra({ mimeType: s })}`,
131
+ `voice-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.${Ma({ mimeType: s })}`,
132
132
  { type: s }
133
133
  );
134
134
  try {
@@ -155,13 +155,13 @@ const Zn = class Zn extends Hs {
155
155
  (this.settings.clearInterval ?? clearInterval)(e);
156
156
  }
157
157
  };
158
- d(Zn, "VoiceRecorderController");
159
- let On = Zn;
160
- function Ca(a) {
158
+ d(Jn, "VoiceRecorderController");
159
+ let zn = Jn;
160
+ function Ia(a) {
161
161
  return a.turnOutcome === "failed" ? "failed" : a.turnOutcome === "stopped" ? "stopped" : a.sender === "system" ? "failed" : "completed";
162
162
  }
163
- d(Ca, "durableJournalOutcome");
164
- const bt = {
163
+ d(Ia, "durableJournalOutcome");
164
+ const yt = {
165
165
  waiting: "Waiting for results",
166
166
  finishing: "Finishing up",
167
167
  completed: "Work complete",
@@ -169,7 +169,7 @@ const bt = {
169
169
  stopped: "Stopped",
170
170
  notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
171
171
  leaveHint: "Taking longer than usual. You can leave this chat while I work."
172
- }, js = 15e3, Ia = 6e4, _n = 3;
172
+ }, Ws = 15e3, $a = 6e4, Rn = 3;
173
173
  function pn(a) {
174
174
  if (!a)
175
175
  return;
@@ -181,15 +181,15 @@ function Ot(a) {
181
181
  return pn(a.endedAt) ?? pn(a.startedAt) ?? 0;
182
182
  }
183
183
  d(Ot, "eventMs");
184
- function zn(a, t) {
184
+ function Nn(a, t) {
185
185
  return Ot(a) - Ot(t);
186
186
  }
187
- d(zn, "byEvent");
187
+ d(Nn, "byEvent");
188
188
  function Xt(a, t) {
189
- const e = a.filter((i) => i.status === "completed" || i.status === "failed" && !!i.note).filter((i) => !t.has(i.activityId)).slice().sort(zn), n = [];
189
+ const e = a.filter((i) => i.status === "completed" || i.status === "failed" && !!i.note).filter((i) => !t.has(i.activityId)).slice().sort(Nn), n = [];
190
190
  for (const i of e) {
191
191
  const s = i.status === "completed" ? "done" : "failed", l = n[n.length - 1];
192
- if (s === "done" && l?.tone === "done" && l.label === i.label && Ot(i) - l.lastMs <= js) {
192
+ if (s === "done" && l?.tone === "done" && l.label === i.label && Ot(i) - l.lastMs <= Ws) {
193
193
  l.count += 1, l.lastMs = Ot(i);
194
194
  continue;
195
195
  }
@@ -204,91 +204,91 @@ function Xt(a, t) {
204
204
  }
205
205
  d(Xt, "milestoneRows");
206
206
  function dn(a) {
207
- return a.length <= _n ? { visibleRows: a, hiddenRows: [] } : {
208
- visibleRows: a.slice(a.length - _n),
209
- hiddenRows: a.slice(0, a.length - _n)
207
+ return a.length <= Rn ? { visibleRows: a, hiddenRows: [] } : {
208
+ visibleRows: a.slice(a.length - Rn),
209
+ hiddenRows: a.slice(0, a.length - Rn)
210
210
  };
211
211
  }
212
212
  d(dn, "splitRows");
213
- function Nn(a) {
213
+ function Pn(a) {
214
214
  const { activities: t, outcome: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s, includeFailureNote: l = !0 } = a;
215
215
  if (e === "completed")
216
216
  return {
217
217
  outcome: e,
218
218
  visibleRows: [],
219
219
  hiddenRows: Xt(t, /* @__PURE__ */ new Set()),
220
- terminal: { id: "work-complete", tone: "completed", label: bt.completed }
220
+ terminal: { id: "work-complete", tone: "completed", label: yt.completed }
221
221
  };
222
222
  if (e === "failed") {
223
- const I = t.filter((V) => V.status === "failed").sort(zn).pop(), O = /* @__PURE__ */ new Set();
224
- I && O.add(I.activityId);
225
- const { visibleRows: H, hiddenRows: B } = dn(Xt(t, O));
223
+ const $ = t.filter((V) => V.status === "failed").sort(Nn).pop(), N = /* @__PURE__ */ new Set();
224
+ $ && N.add($.activityId);
225
+ const { visibleRows: W, hiddenRows: B } = dn(Xt(t, N));
226
226
  return {
227
227
  outcome: e,
228
- visibleRows: H,
228
+ visibleRows: W,
229
229
  hiddenRows: B,
230
230
  terminal: {
231
231
  id: "work-failed",
232
232
  tone: "failed",
233
- label: bt.failed,
234
- ...l && I?.note ? { note: I.note } : {}
233
+ label: yt.failed,
234
+ ...l && $?.note ? { note: $.note } : {}
235
235
  }
236
236
  };
237
237
  }
238
238
  if (e === "stopped") {
239
- const { visibleRows: I, hiddenRows: O } = dn(Xt(t, /* @__PURE__ */ new Set()));
239
+ const { visibleRows: $, hiddenRows: N } = dn(Xt(t, /* @__PURE__ */ new Set()));
240
240
  return {
241
241
  outcome: e,
242
- visibleRows: I,
243
- hiddenRows: O,
244
- terminal: { id: "work-stopped", tone: "stopped", label: bt.stopped }
242
+ visibleRows: $,
243
+ hiddenRows: N,
244
+ terminal: { id: "work-stopped", tone: "stopped", label: yt.stopped }
245
245
  };
246
246
  }
247
- const { visibleRows: o, hiddenRows: p } = dn(Xt(t, /* @__PURE__ */ new Set())), c = t.filter((I) => I.status === "started").sort(zn).pop(), y = t.reduce(
248
- (I, O) => Math.max(I, Ot(O)),
247
+ const { visibleRows: o, hiddenRows: p } = dn(Xt(t, /* @__PURE__ */ new Set())), c = t.filter(($) => $.status === "started").sort(Nn).pop(), b = t.reduce(
248
+ ($, N) => Math.max($, Ot(N)),
249
249
  s ?? Number.NEGATIVE_INFINITY
250
- ), R = Number.isFinite(y) ? y : n, b = t.reduce((I, O) => {
251
- const H = pn(O.startedAt) ?? pn(O.endedAt);
252
- return H === void 0 ? I : Math.min(I, H);
253
- }, Number.POSITIVE_INFINITY), k = R + js, A = (Number.isFinite(b) ? b : R) + Ia, _ = n >= k, z = c || _ ? {
250
+ ), R = Number.isFinite(b) ? b : n, y = t.reduce(($, N) => {
251
+ const W = pn(N.startedAt) ?? pn(N.endedAt);
252
+ return W === void 0 ? $ : Math.min($, W);
253
+ }, Number.POSITIVE_INFINITY), k = R + Ws, A = (Number.isFinite(y) ? y : R) + $a, E = n >= k, O = c || E ? {
254
254
  id: c?.activityId ?? "work-active",
255
255
  tone: "active",
256
- label: _ ? c ? bt.waiting : bt.finishing : c.label
257
- } : void 0, Z = _ && n >= A ? i ? bt.notifyHint : bt.leaveHint : void 0, L = [k, A].filter((I) => I > n).sort((I, O) => I - O)[0];
256
+ label: E ? c ? yt.waiting : yt.finishing : c.label
257
+ } : void 0, Z = E && n >= A ? i ? yt.notifyHint : yt.leaveHint : void 0, I = [k, A].filter(($) => $ > n).sort(($, N) => $ - N)[0];
258
258
  return {
259
259
  outcome: e,
260
260
  visibleRows: o,
261
261
  hiddenRows: p,
262
- ...z ? { terminal: z } : {},
262
+ ...O ? { terminal: O } : {},
263
263
  ...Z ? { hint: Z } : {},
264
- ...L !== void 0 ? { nextBoundaryAtMs: L } : {}
264
+ ...I !== void 0 ? { nextBoundaryAtMs: I } : {}
265
265
  };
266
266
  }
267
- d(Nn, "buildWorkJournalModel");
268
- function $a(a) {
269
- const { segments: t, activities: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s } = a, l = new Map(e.map((A) => [A.activityId, A])), o = /* @__PURE__ */ d((A) => Nn({
267
+ d(Pn, "buildWorkJournalModel");
268
+ function La(a) {
269
+ const { segments: t, activities: e, nowMs: n, canNotifyOnCompletion: i, lastVisibleProgressAtMs: s } = a, l = new Map(e.map((A) => [A.activityId, A])), o = /* @__PURE__ */ d((A) => Pn({
270
270
  activities: A,
271
271
  outcome: "running",
272
272
  nowMs: n,
273
273
  canNotifyOnCompletion: i,
274
274
  ...s !== void 0 ? { lastVisibleProgressAtMs: s } : {}
275
275
  }), "liveModel"), p = /* @__PURE__ */ d((A) => {
276
- const { visibleRows: _, hiddenRows: z } = dn(Xt(A, /* @__PURE__ */ new Set()));
277
- if (!(_.length === 0 && z.length === 0))
278
- return { outcome: "running", visibleRows: _, hiddenRows: z };
279
- }, "staticJournal"), c = [], y = new Set(
276
+ const { visibleRows: E, hiddenRows: O } = dn(Xt(A, /* @__PURE__ */ new Set()));
277
+ if (!(E.length === 0 && O.length === 0))
278
+ return { outcome: "running", visibleRows: E, hiddenRows: O };
279
+ }, "staticJournal"), c = [], b = new Set(
280
280
  t.flatMap((A) => A.kind === "work" ? A.activityIds : [])
281
- ), R = e.filter((A) => !y.has(A.activityId)), b = p(R);
282
- b && c.push({ kind: "work", id: "work-unsegmented", journal: b }), t.forEach((A, _) => {
281
+ ), R = e.filter((A) => !b.has(A.activityId)), y = p(R);
282
+ y && c.push({ kind: "work", id: "work-unsegmented", journal: y }), t.forEach((A, E) => {
283
283
  if (A.kind === "text") {
284
- A.content && c.push({ kind: "text", id: `text-${_}`, content: A.content });
284
+ A.content && c.push({ kind: "text", id: `text-${E}`, content: A.content });
285
285
  return;
286
286
  }
287
- const z = A.activityIds.map((L) => l.get(L)).filter((L) => L !== void 0);
288
- if (z.length === 0)
287
+ const O = A.activityIds.map((I) => l.get(I)).filter((I) => I !== void 0);
288
+ if (O.length === 0)
289
289
  return;
290
- const Z = p(z);
291
- Z && c.push({ kind: "work", id: `work-${A.activityIds[0] ?? _}`, journal: Z });
290
+ const Z = p(O);
291
+ Z && c.push({ kind: "work", id: `work-${A.activityIds[0] ?? E}`, journal: Z });
292
292
  });
293
293
  const k = o(e);
294
294
  return k.terminal || k.hint ? c.push({
@@ -304,31 +304,28 @@ function $a(a) {
304
304
  }
305
305
  }) : c.push({ kind: "loading", id: "work-tail" }), c;
306
306
  }
307
- d($a, "buildLiveTurnBlocks");
308
- const La = [
309
- { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
310
- { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
311
- ], Ws = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Da = /* @__PURE__ */ new Set([...Ws, "EMPTY_STREAM", "RATE_LIMIT"]), Gs = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Oa = {
307
+ d(La, "buildLiveTurnBlocks");
308
+ const Gs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Da = /* @__PURE__ */ new Set([...Gs, "EMPTY_STREAM", "RATE_LIMIT"]), Vs = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), Oa = {
312
309
  CREDIT_LIMIT: "billing_budget_reached",
313
310
  OVERAGE_CAP: "billing_runaway_cap"
314
311
  };
315
312
  function za(a) {
316
313
  if (!(a.bucket !== void 0 || Da.has(a.code)))
317
314
  return { surface: "hard" };
318
- const e = a.bucket ?? (Ws.has(a.code) ? "account" : "error"), n = {
315
+ const e = a.bucket ?? (Gs.has(a.code) ? "account" : "error"), n = {
319
316
  ...a.actionLabel ? { actionLabel: a.actionLabel } : {},
320
317
  ...a.actionUrl ? { actionUrl: a.actionUrl } : {},
321
318
  ...a.help ? { help: a.help } : {}
322
319
  };
323
- return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : Gs.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 } };
320
+ return e === "account" ? { surface: "transcript", issue: { code: a.code, bucket: e, ...n }, sendBlockedReason: "account" } : Vs.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 } };
324
321
  }
325
322
  d(za, "presentChatStreamError");
326
323
  function Na(a) {
327
324
  const t = Oa[a.code];
328
- return t ? ka[t].oneLine : a.error;
325
+ return t ? wa[t].oneLine : a.error;
329
326
  }
330
327
  d(Na, "transcriptMessageForChatStreamError");
331
- const Jn = class Jn extends Hs {
328
+ const Qn = class Qn extends js {
332
329
  constructor(e) {
333
330
  super("AgentChatController", e);
334
331
  P(this, "isTextMode", !1);
@@ -374,7 +371,7 @@ const Jn = class Jn extends Hs {
374
371
  return;
375
372
  const n = this.textState.value.toolActivities;
376
373
  if (n?.length)
377
- return Nn({
374
+ return Pn({
378
375
  activities: n,
379
376
  outcome: e,
380
377
  nowMs: this.nowMs.value,
@@ -391,7 +388,7 @@ const Jn = class Jn extends Hs {
391
388
  if (!this.textState.value.isThinking)
392
389
  return [];
393
390
  const e = this.textState.value.toolActivities ?? [], n = this.liveSegments.value;
394
- return !n.length && !e.length ? [] : $a({
391
+ return !n.length && !e.length ? [] : La({
395
392
  segments: n,
396
393
  activities: e,
397
394
  nowMs: this.nowMs.value,
@@ -402,7 +399,7 @@ const Jn = class Jn extends Hs {
402
399
  P(this, "canUseComposer", S(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking));
403
400
  P(this, "canAttachFile", S(() => !!this.settings.uploadFileFn));
404
401
  P(this, "canRecordAudio", S(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0));
405
- P(this, "voiceRecorder", new On({
402
+ P(this, "voiceRecorder", new zn({
406
403
  getCanRecord: /* @__PURE__ */ d(() => this.canRecordAudio.value, "getCanRecord"),
407
404
  getUploadFn: /* @__PURE__ */ d(() => {
408
405
  const e = this.settings.uploadFileFn;
@@ -603,7 +600,7 @@ Current User:
603
600
  */
604
601
  workJournalFor(e) {
605
602
  if (e.activities?.length)
606
- return Nn({
603
+ return Pn({
607
604
  activities: e.activities,
608
605
  outcome: e.outcome,
609
606
  nowMs: this.nowMs.value,
@@ -703,65 +700,63 @@ Current User:
703
700
  this.addMessage(e, "user", n), this.resetWorkJournalTiming(), this.updateState(this.textState, { isThinking: !0, workingDescription: void 0, toolActivities: [], transientIssue: void 0, turnOutcome: void 0 });
704
701
  const l = ++this.activeTurnGeneration, o = `stream-${Date.now()}`;
705
702
  let p = !1, c = !1;
706
- const y = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"), R = /* @__PURE__ */ d((L, I = "assistant") => {
707
- if (!y())
703
+ const b = /* @__PURE__ */ d(() => l === this.activeTurnGeneration, "isCurrentTurn"), R = /* @__PURE__ */ d((I, $ = "assistant") => {
704
+ if (!b())
708
705
  return;
709
- this.updateState(this.textState, { workingDescription: void 0 }), I === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.liveStreamMessageId.value = o, this.sharedMessages.value = [
706
+ this.updateState(this.textState, { workingDescription: void 0 }), $ === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), p || (p = !0, this.liveStreamMessageId.value = o, this.sharedMessages.value = [
710
707
  ...this.sharedMessages.value,
711
- { id: o, text: "", sender: I === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
708
+ { id: o, text: "", sender: $ === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
712
709
  ]);
713
- const O = this.liveSegments.value, H = O[O.length - 1];
714
- this.liveSegments.value = H?.kind === "text" ? [...O.slice(0, -1), { kind: "text", content: H.content + L }] : [...O, { kind: "text", content: L }];
710
+ const N = this.liveSegments.value, W = N[N.length - 1];
711
+ this.liveSegments.value = W?.kind === "text" ? [...N.slice(0, -1), { kind: "text", content: W.content + I }] : [...N, { kind: "text", content: I }];
715
712
  const B = this.sharedMessages.value, V = B[B.length - 1];
716
- V?.id === o && (V.text += L, this.sharedMessages.value = [...B]);
717
- }, "onDelta"), b = /* @__PURE__ */ d((L) => {
718
- if (!y())
713
+ V?.id === o && (V.text += I, this.sharedMessages.value = [...B]);
714
+ }, "onDelta"), y = /* @__PURE__ */ d((I) => {
715
+ if (!b())
716
+ return;
717
+ if (c = !0, I.sender === "agent" && _n(I.text)) {
718
+ this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((J) => J.id !== o);
719
719
  return;
720
- c = !0, p = !0;
721
- const I = L.sender === "system" || L.turnOutcome === "failed" ? "failed" : "completed";
722
- this.finishToolActivities(I);
723
- const O = this.textState.value.toolActivities, H = L.toolActivities?.length || !O?.length ? L : { ...L, toolActivities: O };
720
+ }
721
+ p = !0;
722
+ const $ = I.sender === "system" || I.turnOutcome === "failed" ? "failed" : "completed";
723
+ this.finishToolActivities($);
724
+ const N = this.textState.value.toolActivities, W = I.toolActivities?.length || !N?.length ? I : { ...I, toolActivities: N };
724
725
  this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.updateState(this.textState, {
725
726
  workingDescription: void 0,
726
727
  toolActivities: [],
727
728
  turnOutcome: void 0
728
729
  });
729
- const B = this.sharedMessages.value, V = B.findIndex((ee) => ee.id === H.id);
730
+ const B = this.sharedMessages.value, V = B.findIndex((J) => J.id === W.id);
730
731
  if (V >= 0)
731
732
  this.sharedMessages.value = [
732
733
  ...B.slice(0, V),
733
- H,
734
+ W,
734
735
  ...B.slice(V + 1)
735
736
  ];
736
737
  else {
737
- const ee = B[B.length - 1];
738
- this.sharedMessages.value = ee?.id === o ? [...B.slice(0, -1), H] : [...B, H];
738
+ const J = B[B.length - 1];
739
+ this.sharedMessages.value = J?.id === o ? [...B.slice(0, -1), W] : [...B, W];
739
740
  }
740
- H.sender === "system" && H.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : H.sender === "system" && H.issue?.code && Gs.has(H.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
741
- }, "onMessage"), k = /* @__PURE__ */ d((L) => {
742
- if (!y())
741
+ W.sender === "system" && W.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : W.sender === "system" && W.issue?.code && Vs.has(W.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
742
+ }, "onMessage"), k = /* @__PURE__ */ d((I) => {
743
+ if (!b())
743
744
  return;
744
745
  if (!p && !c) {
745
746
  A("empty_stream — assistant returned no content");
746
747
  return;
747
748
  }
748
749
  this.finishToolActivities("completed");
749
- const I = this.sharedMessages.value, O = I[I.length - 1];
750
- if (O?.id === o && O.sender === "agent" && O.text) {
751
- let H = O.text;
752
- for (const B of La)
753
- B.pattern.test(H) && (console.debug(`[chat] filtered directive: ${B.label}`), H = H.replace(B.pattern, "").trim(), B.pattern.lastIndex = 0);
754
- H ? H !== O.text && (O.text = H, this.sharedMessages.value = [...I]) : this.sharedMessages.value = I.slice(0, -1);
755
- }
756
- L && (this.conversationId = L), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
757
- }, "onDone"), A = /* @__PURE__ */ d((L) => {
758
- if (!y())
750
+ const $ = this.sharedMessages.value, N = $[$.length - 1];
751
+ N?.id === o && N.sender === "agent" && _n(N.text) && (this.sharedMessages.value = $.slice(0, -1)), I && (this.conversationId = I), this.updateState(this.textState, { isThinking: !1, workingDescription: void 0, transientIssue: void 0 });
752
+ }, "onDone"), A = /* @__PURE__ */ d((I) => {
753
+ if (!b())
759
754
  return;
760
- if (typeof L == "object" && L.code === "TURN_ACTIVE") {
755
+ if (typeof I == "object" && I.code === "TURN_ACTIVE") {
761
756
  const V = this.sharedMessages.value;
762
- for (let ee = V.length - 1; ee >= 0; ee--)
763
- if (V[ee].sender === "user" && V[ee].text === e) {
764
- this.sharedMessages.value = [...V.slice(0, ee), ...V.slice(ee + 1)];
757
+ for (let J = V.length - 1; J >= 0; J--)
758
+ if (V[J].sender === "user" && V[J].text === e) {
759
+ this.sharedMessages.value = [...V.slice(0, J), ...V.slice(J + 1)];
765
760
  break;
766
761
  }
767
762
  this.composerState.value.text || (this.composerState.value = {
@@ -770,37 +765,37 @@ Current User:
770
765
  pendingAttachments: n ?? []
771
766
  }), this.updateState(this.textState, {
772
767
  isThinking: !1,
773
- transientIssue: { code: L.code, message: L.error }
768
+ transientIssue: { code: I.code, message: I.error }
774
769
  });
775
770
  return;
776
771
  }
777
772
  this.updateState(this.textState, { workingDescription: void 0, turnOutcome: "failed" }), this.finishToolActivities("failed");
778
- const I = this.sharedMessages.value, O = I[I.length - 1];
779
- if (O?.id === o && !O.text && (this.sharedMessages.value = I.slice(0, -1)), typeof L == "object" && L.code && L.error) {
780
- const V = za(L);
781
- V.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: V.issue }) : V.surface === "transcript" ? (this.addMessage(Na(L), "system", void 0, V.issue), this.updateState(this.textState, {
773
+ const $ = this.sharedMessages.value, N = $[$.length - 1];
774
+ if (N?.id === o && !N.text && (this.sharedMessages.value = $.slice(0, -1)), typeof I == "object" && I.code && I.error) {
775
+ const V = za(I);
776
+ V.surface === "transient" ? this.updateState(this.textState, { isThinking: !1, transientIssue: V.issue }) : V.surface === "transcript" ? (this.addMessage(Na(I), "system", void 0, V.issue), this.updateState(this.textState, {
782
777
  isThinking: !1,
783
778
  ...V.sendBlockedReason ? { sendBlockedReason: V.sendBlockedReason } : {}
784
- })) : this.handleError(new Error(L.error));
779
+ })) : this.handleError(new Error(I.error));
785
780
  return;
786
781
  }
787
- const H = typeof L == "string" ? L : L.error, B = this.mapChatError(H);
788
- this.isTransientError(H) ? (this.logger.warn("Chat turn failed (transient):", { raw: H, friendly: B }), this.addMessage(B, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(B), H);
789
- }, "onError"), _ = /* @__PURE__ */ d((L) => {
790
- if (!y())
782
+ const W = typeof I == "string" ? I : I.error, B = this.mapChatError(W);
783
+ this.isTransientError(W) ? (this.logger.warn("Chat turn failed (transient):", { raw: W, friendly: B }), this.addMessage(B, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(B), W);
784
+ }, "onError"), E = /* @__PURE__ */ d((I) => {
785
+ if (!b())
791
786
  return;
792
- const I = L.trim();
793
- this.updateState(this.textState, { workingDescription: I || void 0 });
794
- }, "onStatus"), z = /* @__PURE__ */ d((L) => {
795
- if (y()) {
796
- if (this.lastVisibleProgressAtMs.value = Date.now(), L.status === "started") {
797
- const I = this.liveSegments.value, O = I[I.length - 1];
798
- O?.kind !== "work" ? this.liveSegments.value = [...I, { kind: "work", activityIds: [L.activityId] }] : O.activityIds.includes(L.activityId) || (this.liveSegments.value = [...I.slice(0, -1), { kind: "work", activityIds: [...O.activityIds, L.activityId] }]);
787
+ const $ = I.trim();
788
+ this.updateState(this.textState, { workingDescription: $ || void 0 });
789
+ }, "onStatus"), O = /* @__PURE__ */ d((I) => {
790
+ if (b()) {
791
+ if (this.lastVisibleProgressAtMs.value = Date.now(), I.status === "started") {
792
+ const $ = this.liveSegments.value, N = $[$.length - 1];
793
+ N?.kind !== "work" ? this.liveSegments.value = [...$, { kind: "work", activityIds: [I.activityId] }] : N.activityIds.includes(I.activityId) || (this.liveSegments.value = [...$.slice(0, -1), { kind: "work", activityIds: [...N.activityIds, I.activityId] }]);
799
794
  }
800
- this.updateToolActivity(L);
795
+ this.updateToolActivity(I);
801
796
  }
802
797
  }, "onToolActivity"), Z = /* @__PURE__ */ d(() => {
803
- y() && this.updateState(this.textState, { workingDescription: void 0 });
798
+ b() && this.updateState(this.textState, { workingDescription: void 0 });
804
799
  }, "onWorkingEnd");
805
800
  try {
806
801
  await (i ? i({
@@ -809,11 +804,11 @@ Current User:
809
804
  conversationId: this.conversationId,
810
805
  history: this.buildHistory(),
811
806
  onDelta: R,
812
- onMessage: b,
807
+ onMessage: y,
813
808
  onDone: k,
814
809
  onError: A,
815
- onStatus: _,
816
- onToolActivity: z,
810
+ onStatus: E,
811
+ onToolActivity: O,
817
812
  onWorkingEnd: Z
818
813
  }) : s.chat.chatStreamPublic({
819
814
  handle: this._agent.handle.value,
@@ -822,15 +817,15 @@ Current User:
822
817
  anonymousId: s.user.generateAnonId(),
823
818
  context: this.getDynamicSettings().context || void 0,
824
819
  onDelta: R,
825
- onMessage: b,
820
+ onMessage: y,
826
821
  onDone: k,
827
822
  onError: A,
828
- onStatus: _,
829
- onToolActivity: z,
823
+ onStatus: E,
824
+ onToolActivity: O,
830
825
  onWorkingEnd: Z
831
826
  }));
832
- } catch (L) {
833
- A(L.message || "Something went wrong");
827
+ } catch (I) {
828
+ A(I.message || "Something went wrong");
834
829
  }
835
830
  }
836
831
  async stopChatTurn() {
@@ -861,8 +856,8 @@ Current User:
861
856
  /** Seed the controller with previously-loaded messages (e.g. from a server thread). */
862
857
  loadMessages(e) {
863
858
  this.conversationId = e.conversationId;
864
- const n = this.sharedMessages.value;
865
- this.sharedMessages.value = [...e.messages, ...n], e.activeToolActivities?.length && (e.activeToolActivities.forEach((i) => this.rememberToolActivity(i)), this.updateState(this.textState, {
859
+ const n = this.sharedMessages.value, i = e.messages.filter((s) => s.sender !== "agent" || !_n(s.text));
860
+ this.sharedMessages.value = [...i, ...n], e.activeToolActivities?.length && (e.activeToolActivities.forEach((s) => this.rememberToolActivity(s)), this.updateState(this.textState, {
866
861
  isThinking: !0,
867
862
  workingDescription: void 0,
868
863
  toolActivities: e.activeToolActivities,
@@ -873,8 +868,8 @@ Current User:
873
868
  this.clearBoundaryTimer(), this.voiceRecorder.teardown(), await this.endConversation();
874
869
  }
875
870
  };
876
- d(Jn, "AgentChatController");
877
- let hs = Jn;
871
+ d(Qn, "AgentChatController");
872
+ let ps = Qn;
878
873
  function on(a) {
879
874
  if (!a)
880
875
  return;
@@ -882,19 +877,19 @@ function on(a) {
882
877
  return Number.isFinite(t) ? t : void 0;
883
878
  }
884
879
  d(on, "parseToolActivityMs");
885
- function ps(a) {
880
+ function fs(a) {
886
881
  return a ? typeof a == "string" ? a : a.src || "" : "";
887
882
  }
888
- d(ps, "getImageSrc");
883
+ d(fs, "getImageSrc");
889
884
  function wo(a) {
890
- return ps(a.cover) || ps(a.avatar) || Un(a.name);
885
+ return fs(a.cover) || fs(a.avatar) || Hn(a.name);
891
886
  }
892
887
  d(wo, "getAgentAvatarUrl");
893
- function fs(a) {
888
+ function ms(a) {
894
889
  const t = a.target;
895
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Un());
890
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Hn());
896
891
  }
897
- d(fs, "handleImageError");
892
+ d(ms, "handleImageError");
898
893
  function To(a) {
899
894
  const { template: t, agent: e } = a;
900
895
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
@@ -932,19 +927,19 @@ const Pa = {
932
927
  }, [
933
928
  a.loading ? (h(), f("div", Pa, [...s[0] || (s[0] = [
934
929
  w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
935
- ])])) : j("", !0),
930
+ ])])) : H("", !0),
936
931
  w("span", {
937
932
  class: C(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
938
933
  }, [
939
934
  a.icon ? (h(), f("i", {
940
935
  key: 0,
941
936
  class: C([a.icon, n.value])
942
- }, null, 2)) : j("", !0),
937
+ }, null, 2)) : H("", !0),
943
938
  vn(i.$slots, "default"),
944
939
  a.iconAfter ? (h(), f("i", {
945
940
  key: 1,
946
941
  class: C([a.iconAfter, n.value])
947
- }, null, 2)) : j("", !0)
942
+ }, null, 2)) : H("", !0)
948
943
  ], 2)
949
944
  ], 2));
950
945
  }
@@ -971,7 +966,7 @@ const Pa = {
971
966
  onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
972
967
  }, null, 40, Ba));
973
968
  }
974
- }), Fa = ["placeholder", "value"], Eo = /* @__PURE__ */ Re({
969
+ }), Fa = ["placeholder", "value"], _o = /* @__PURE__ */ Re({
975
970
  __name: "AgentInputOneTimeCode",
976
971
  props: {
977
972
  modelValue: {},
@@ -1032,11 +1027,11 @@ const Pa = {
1032
1027
  alt: a.agent.displayName.value,
1033
1028
  class: "w-full h-full object-cover",
1034
1029
  onError: e[0] || (e[0] = //@ts-ignore
1035
- (...n) => en(fs) && en(fs)(...n))
1030
+ (...n) => en(ms) && en(ms)(...n))
1036
1031
  }, null, 40, Ha)
1037
1032
  ], 2),
1038
1033
  w("div", ja, [
1039
- a.isOnline ? (h(), f(Q, { key: 0 }, [
1034
+ a.isOnline ? (h(), f(ee, { key: 0 }, [
1040
1035
  e[1] || (e[1] = w("div", {
1041
1036
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
1042
1037
  style: { "animation-duration": "3s" }
@@ -1051,13 +1046,13 @@ const Pa = {
1051
1046
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
1052
1047
  a.layout === "horizontal" ? "text-white/95" : ""
1053
1048
  ]])
1054
- }, W(a.agent.displayName.value), 3),
1049
+ }, j(a.agent.displayName.value), 3),
1055
1050
  w("p", {
1056
1051
  class: C(["font-light line-clamp-1", [
1057
1052
  a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
1058
1053
  a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
1059
1054
  ]])
1060
- }, W(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
1055
+ }, j(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
1061
1056
  ])
1062
1057
  ], 2));
1063
1058
  }
@@ -1066,7 +1061,7 @@ const Pa = {
1066
1061
  amber: "bg-amber-500",
1067
1062
  red: "bg-red-500",
1068
1063
  grey: "bg-theme-300"
1069
- }, Ka = /* @__PURE__ */ Re({
1064
+ }, Ya = /* @__PURE__ */ Re({
1070
1065
  __name: "FTooltip",
1071
1066
  props: {
1072
1067
  content: { default: "" },
@@ -1077,7 +1072,7 @@ const Pa = {
1077
1072
  direction: { default: "top" }
1078
1073
  },
1079
1074
  setup(a) {
1080
- const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l = ga({
1075
+ const t = ge(null), e = ge(null), n = ge(!1), i = ge(null), s = ge(null), l = va({
1081
1076
  left: "0px",
1082
1077
  top: "0px",
1083
1078
  maxWidth: `${a.maxWidth}px`
@@ -1085,49 +1080,49 @@ const Pa = {
1085
1080
  function p() {
1086
1081
  if (!t.value || !e.value)
1087
1082
  return;
1088
- const _ = t.value.getBoundingClientRect(), z = e.value.getBoundingClientRect(), Z = 8;
1089
- let L, I;
1083
+ const E = t.value.getBoundingClientRect(), O = e.value.getBoundingClientRect(), Z = 8;
1084
+ let I, $;
1090
1085
  switch (a.direction) {
1091
1086
  case "bottom":
1092
- L = _.left + window.scrollX + _.width / 2 - z.width / 2, I = _.bottom + window.scrollY + Z;
1087
+ I = E.left + window.scrollX + E.width / 2 - O.width / 2, $ = E.bottom + window.scrollY + Z;
1093
1088
  break;
1094
1089
  case "top":
1095
- L = _.left + window.scrollX + _.width / 2 - z.width / 2, I = _.top + window.scrollY - z.height - Z;
1090
+ I = E.left + window.scrollX + E.width / 2 - O.width / 2, $ = E.top + window.scrollY - O.height - Z;
1096
1091
  break;
1097
1092
  case "left":
1098
- L = _.left + window.scrollX - z.width - Z, I = _.top + window.scrollY + _.height / 2 - z.height / 2;
1093
+ I = E.left + window.scrollX - O.width - Z, $ = E.top + window.scrollY + E.height / 2 - O.height / 2;
1099
1094
  break;
1100
1095
  default:
1101
- L = _.right + window.scrollX + Z, I = _.top + window.scrollY + _.height / 2 - z.height / 2;
1096
+ I = E.right + window.scrollX + Z, $ = E.top + window.scrollY + E.height / 2 - O.height / 2;
1102
1097
  }
1103
- const O = 8;
1104
- L = Math.max(O, Math.min(L, window.innerWidth - z.width - O)), I = Math.max(O, Math.min(I, window.innerHeight - z.height - O)), l.left = `${L}px`, l.top = `${I}px`;
1098
+ const N = 8;
1099
+ I = Math.max(N, Math.min(I, window.innerWidth - O.width - N)), $ = Math.max(N, Math.min($, window.innerHeight - O.height - N)), l.left = `${I}px`, l.top = `${$}px`;
1105
1100
  }
1106
1101
  d(p, "updatePosition");
1107
1102
  function c() {
1108
- 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, Fs(p), a.timeout > 0 && (s.value = setTimeout(() => {
1103
+ 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, Us(p), a.timeout > 0 && (s.value = setTimeout(() => {
1109
1104
  n.value = !1;
1110
1105
  }, a.timeout))));
1111
1106
  }
1112
1107
  d(c, "showTooltipWithDelay");
1113
- function y() {
1108
+ function b() {
1114
1109
  a.disabled || (s.value && (clearTimeout(s.value), s.value = null), i.value = setTimeout(c, a.delay));
1115
1110
  }
1116
- d(y, "onMouseEnter");
1111
+ d(b, "onMouseEnter");
1117
1112
  function R() {
1118
1113
  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;
1119
1114
  }
1120
1115
  d(R, "onMouseLeave");
1121
- function b() {
1116
+ function y() {
1122
1117
  a.disabled || (i.value && (clearTimeout(i.value), i.value = null), c());
1123
1118
  }
1124
- d(b, "onFocusIn");
1119
+ d(y, "onFocusIn");
1125
1120
  function k() {
1126
1121
  R();
1127
1122
  }
1128
1123
  d(k, "onFocusOut"), tn(() => {
1129
1124
  window.addEventListener("resize", p), window.addEventListener("scroll", p, !0);
1130
- }), Ns(() => {
1125
+ }), Ps(() => {
1131
1126
  window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0), i.value && clearTimeout(i.value), s.value && clearTimeout(s.value);
1132
1127
  });
1133
1128
  const A = S(() => `absolute size-2 rotate-45 bg-theme-900 dark:bg-theme-600 ${{
@@ -1136,17 +1131,17 @@ const Pa = {
1136
1131
  left: "right-[-4px] top-1/2 -translate-y-1/2",
1137
1132
  right: "left-[-4px] top-1/2 -translate-y-1/2"
1138
1133
  }[a.direction]}`);
1139
- return (_, z) => (h(), f("div", {
1134
+ return (E, O) => (h(), f("div", {
1140
1135
  ref_key: "triggerRef",
1141
1136
  ref: t,
1142
- onMouseenter: y,
1137
+ onMouseenter: b,
1143
1138
  onMouseleave: R,
1144
- onFocusin: b,
1139
+ onFocusin: y,
1145
1140
  onFocusout: k
1146
1141
  }, [
1147
- vn(_.$slots, "default"),
1148
- (h(), kt(va, { to: "body" }, [
1149
- Ne(xa, {
1142
+ vn(E.$slots, "default"),
1143
+ (h(), kt(xa, { to: "body" }, [
1144
+ Ne(ya, {
1150
1145
  "enter-active-class": "transition ease-out duration-200",
1151
1146
  "enter-from-class": "opacity-0 scale-95",
1152
1147
  "enter-to-class": "opacity-100 scale-100",
@@ -1154,14 +1149,14 @@ const Pa = {
1154
1149
  "leave-from-class": "opacity-100 scale-100",
1155
1150
  "leave-to-class": "opacity-0 scale-95"
1156
1151
  }, {
1157
- default: Ps(() => [
1158
- Bs(w("div", {
1152
+ default: Bs(() => [
1153
+ Fs(w("div", {
1159
1154
  ref_key: "tooltipRef",
1160
1155
  ref: e,
1161
1156
  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",
1162
1157
  style: q(l)
1163
1158
  }, [
1164
- ot(W(o.value) + " ", 1),
1159
+ ot(j(o.value) + " ", 1),
1165
1160
  w("div", {
1166
1161
  class: C(A.value)
1167
1162
  }, null, 2)
@@ -1174,7 +1169,7 @@ const Pa = {
1174
1169
  ]))
1175
1170
  ], 544));
1176
1171
  }
1177
- }), Ya = /* @__PURE__ */ Re({
1172
+ }), Ka = /* @__PURE__ */ Re({
1178
1173
  __name: "StatusDot",
1179
1174
  props: {
1180
1175
  dotClass: {},
@@ -1190,8 +1185,8 @@ const Pa = {
1190
1185
  width: "clamp(7px, 14%, 14px)",
1191
1186
  height: "clamp(7px, 14%, 14px)"
1192
1187
  }, n = S(() => a.position.startsWith("top") ? "bottom" : "top");
1193
- return (i, s) => (h(), f(Q, null, [
1194
- a.tooltip ? (h(), kt(Ka, {
1188
+ return (i, s) => (h(), f(ee, null, [
1189
+ a.tooltip ? (h(), kt(Ya, {
1195
1190
  key: 0,
1196
1191
  content: a.tooltip,
1197
1192
  direction: n.value,
@@ -1209,7 +1204,7 @@ const Pa = {
1209
1204
  key: 2,
1210
1205
  class: C(["absolute rounded-full animate-ping [animation-duration:3s] opacity-50 pointer-events-none", a.dotClass]),
1211
1206
  style: q({ ...e, ...t.value })
1212
- }, null, 6)) : j("", !0)
1207
+ }, null, 6)) : H("", !0)
1213
1208
  ], 64));
1214
1209
  }
1215
1210
  }), Xa = ["src", "alt"], Za = ["src"], Ja = /* @__PURE__ */ Re({
@@ -1244,21 +1239,21 @@ const Pa = {
1244
1239
  class: C(["absolute inset-0 flex items-center justify-center opacity-0 group-hover/avatar:opacity-100 transition-opacity bg-black/40", t.value])
1245
1240
  }, [...n[0] || (n[0] = [
1246
1241
  w("i", { class: "i-tabler-camera text-xl text-white" }, null, -1)
1247
- ])], 2)) : j("", !0)
1242
+ ])], 2)) : H("", !0)
1248
1243
  ], 2),
1249
1244
  a.subSrc ? (h(), f("img", {
1250
1245
  key: 0,
1251
1246
  src: a.subSrc,
1252
1247
  alt: "",
1253
1248
  class: "absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2 ring-white"
1254
- }, null, 8, Za)) : j("", !0),
1255
- a.dotClass ? (h(), kt(Ya, {
1249
+ }, null, 8, Za)) : H("", !0),
1250
+ a.dotClass ? (h(), kt(Ka, {
1256
1251
  key: 1,
1257
1252
  "dot-class": a.dotClass,
1258
1253
  tooltip: a.dotTooltip,
1259
1254
  "show-ping": a.showPing,
1260
1255
  position: a.dotPosition
1261
- }, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) : j("", !0)
1256
+ }, null, 8, ["dot-class", "tooltip", "show-ping", "position"])) : H("", !0)
1262
1257
  ], 2));
1263
1258
  }
1264
1259
  }), Qa = /* @__PURE__ */ Re({
@@ -1273,7 +1268,7 @@ const Pa = {
1273
1268
  subAvatarSrc: {}
1274
1269
  },
1275
1270
  setup(a) {
1276
- const t = S(() => a.agent.avatarUrl.value || Un(a.agent.name.value)), e = S(() => a.agent.state.value), n = S(
1271
+ const t = S(() => a.agent.avatarUrl.value || Hn(a.agent.name.value)), e = S(() => a.agent.state.value), n = S(
1277
1272
  () => a.showStatus && e.value.lifecycle !== "unknown" ? qa[e.value.color] : null
1278
1273
  );
1279
1274
  return (i, s) => (h(), kt(Ja, {
@@ -1303,7 +1298,7 @@ const Pa = {
1303
1298
  key: 1,
1304
1299
  "data-journal-station": "failed",
1305
1300
  class: "i-tabler-alert-circle size-3.5 text-red-600"
1306
- }, Rn = /* @__PURE__ */ Re({
1301
+ }, Mn = /* @__PURE__ */ Re({
1307
1302
  __name: "AgentToolActivityGroup",
1308
1303
  props: {
1309
1304
  model: {},
@@ -1316,11 +1311,11 @@ const Pa = {
1316
1311
  }
1317
1312
  d(n, "toggle");
1318
1313
  const i = S(() => t.model.outcome === "completed"), s = S(() => t.model.hiddenRows.length), l = S(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = S(() => {
1319
- const y = t.model;
1320
- return i.value ? e.value ? y.hiddenRows : [] : [
1321
- ...e.value ? y.hiddenRows : [],
1322
- ...y.visibleRows,
1323
- ...y.terminal ? [y.terminal] : []
1314
+ const b = t.model;
1315
+ return i.value ? e.value ? b.hiddenRows : [] : [
1316
+ ...e.value ? b.hiddenRows : [],
1317
+ ...b.visibleRows,
1318
+ ...b.terminal ? [b.terminal] : []
1324
1319
  ];
1325
1320
  }), p = S(() => t.isLight ? {
1326
1321
  spine: "bg-theme-200",
@@ -1339,13 +1334,13 @@ const Pa = {
1339
1334
  muted: "text-white/55",
1340
1335
  ring: "focus-visible:ring-white"
1341
1336
  });
1342
- function c(y) {
1343
- return y === "active" ? t.isLight ? "text-[13px] font-medium text-theme-900" : "text-[13px] font-medium text-white" : y === "failed" ? "text-[12.5px] font-medium text-red-600" : y === "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";
1337
+ function c(b) {
1338
+ return b === "active" ? t.isLight ? "text-[13px] font-medium text-theme-900" : "text-[13px] font-medium text-white" : b === "failed" ? "text-[12.5px] font-medium text-red-600" : b === "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";
1344
1339
  }
1345
- return d(c, "labelClass"), (y, R) => (h(), f("div", {
1340
+ return d(c, "labelClass"), (b, R) => (h(), f("div", {
1346
1341
  class: C(["w-full py-0.5", p.value.muted])
1347
1342
  }, [
1348
- l.value ? (h(), f("span", ei, W(l.value), 1)) : j("", !0),
1343
+ l.value ? (h(), f("span", ei, j(l.value), 1)) : H("", !0),
1349
1344
  i.value ? (h(), f("button", {
1350
1345
  key: 1,
1351
1346
  type: "button",
@@ -1365,17 +1360,17 @@ const Pa = {
1365
1360
  ], -1)),
1366
1361
  w("span", {
1367
1362
  class: C(["min-w-0 truncate text-[12.5px] font-medium leading-none", p.value.muted])
1368
- }, W(a.model.terminal?.label), 3),
1363
+ }, j(a.model.terminal?.label), 3),
1369
1364
  s.value ? (h(), f("span", {
1370
1365
  key: 0,
1371
1366
  class: C(["flex shrink-0 items-center gap-0.5 whitespace-nowrap text-[12px] font-medium leading-none", p.value.muted])
1372
1367
  }, [
1373
- ot(W(s.value) + " earlier updates ", 1),
1368
+ ot(j(s.value) + " earlier updates ", 1),
1374
1369
  w("i", {
1375
1370
  class: C(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1376
1371
  "aria-hidden": "true"
1377
1372
  }, null, 2)
1378
- ], 2)) : j("", !0)
1373
+ ], 2)) : H("", !0)
1379
1374
  ], 10, ti)) : s.value ? (h(), f("button", {
1380
1375
  key: 2,
1381
1376
  type: "button",
@@ -1394,26 +1389,26 @@ const Pa = {
1394
1389
  w("span", {
1395
1390
  class: C(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", p.value.muted])
1396
1391
  }, [
1397
- ot(W(s.value) + " earlier updates ", 1),
1392
+ ot(j(s.value) + " earlier updates ", 1),
1398
1393
  w("i", {
1399
1394
  class: C(["size-3 shrink-0", e.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1400
1395
  "aria-hidden": "true"
1401
1396
  }, null, 2)
1402
1397
  ], 2)
1403
- ], 10, ni)) : j("", !0),
1404
- (h(!0), f(Q, null, me(o.value, (b, k) => (h(), f("div", {
1405
- key: b.id,
1398
+ ], 10, ni)) : H("", !0),
1399
+ (h(!0), f(ee, null, me(o.value, (y, k) => (h(), f("div", {
1400
+ key: y.id,
1406
1401
  "data-test": "messaging-tool-activity-row",
1407
- "data-journal-row": b.tone,
1402
+ "data-journal-row": y.tone,
1408
1403
  class: C([i.value ? "pl-[30px]" : "", "flex gap-x-2.5"])
1409
1404
  }, [
1410
1405
  w("div", ii, [
1411
1406
  w("span", ri, [
1412
- b.tone === "active" ? (h(), f("span", {
1407
+ y.tone === "active" ? (h(), f("span", {
1413
1408
  key: 0,
1414
1409
  "data-journal-station": "active",
1415
1410
  class: C(["size-3.5 animate-spin rounded-full border-[1.5px] motion-reduce:animate-none", p.value.activeSpinner])
1416
- }, null, 2)) : b.tone === "failed" ? (h(), f("i", li)) : b.tone === "stopped" ? (h(), f("span", {
1411
+ }, null, 2)) : y.tone === "failed" ? (h(), f("i", li)) : y.tone === "stopped" ? (h(), f("span", {
1417
1412
  key: 2,
1418
1413
  "data-journal-station": "stopped",
1419
1414
  class: C(["size-[9px] rounded-[2px]", p.value.stoppedSquare])
@@ -1426,34 +1421,34 @@ const Pa = {
1426
1421
  k !== o.value.length - 1 ? (h(), f("span", {
1427
1422
  key: 0,
1428
1423
  class: C(["w-px flex-1", p.value.spine])
1429
- }, null, 2)) : j("", !0)
1424
+ }, null, 2)) : H("", !0)
1430
1425
  ]),
1431
1426
  w("div", {
1432
1427
  class: C(["min-w-0 flex-1", k === o.value.length - 1 ? "" : "pb-2"])
1433
1428
  }, [
1434
1429
  w("span", {
1435
- class: C(["block leading-snug", c(b.tone)])
1436
- }, W(b.label), 3),
1437
- b.note ? (h(), f("p", {
1430
+ class: C(["block leading-snug", c(y.tone)])
1431
+ }, j(y.label), 3),
1432
+ y.note ? (h(), f("p", {
1438
1433
  key: 0,
1439
1434
  class: C(["pt-0.5 text-[11.5px] leading-snug", p.value.muted])
1440
- }, W(b.note), 3)) : j("", !0)
1435
+ }, j(y.note), 3)) : H("", !0)
1441
1436
  ], 2)
1442
1437
  ], 10, ai))), 128)),
1443
1438
  !i.value && a.model.hint ? (h(), f("p", {
1444
1439
  key: 3,
1445
1440
  "data-test": "messaging-tool-activity-hint",
1446
1441
  class: C(["pl-[30px] pt-2.5 text-[12px] leading-snug", p.value.muted])
1447
- }, W(a.model.hint), 3)) : j("", !0)
1442
+ }, j(a.model.hint), 3)) : H("", !0)
1448
1443
  ], 2));
1449
1444
  }
1450
1445
  });
1451
- function ms(a, t) {
1446
+ function gs(a, t) {
1452
1447
  (t == null || t > a.length) && (t = a.length);
1453
1448
  for (var e = 0, n = Array(t); e < t; e++) n[e] = a[e];
1454
1449
  return n;
1455
1450
  }
1456
- d(ms, "_arrayLikeToArray");
1451
+ d(gs, "_arrayLikeToArray");
1457
1452
  function oi(a) {
1458
1453
  if (Array.isArray(a)) return a;
1459
1454
  }
@@ -1464,8 +1459,8 @@ function ci(a, t) {
1464
1459
  var n, i, s, l, o = [], p = !0, c = !1;
1465
1460
  try {
1466
1461
  if (s = (e = e.call(a)).next, t !== 0) for (; !(p = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); p = !0) ;
1467
- } catch (y) {
1468
- c = !0, i = y;
1462
+ } catch (b) {
1463
+ c = !0, i = b;
1469
1464
  } finally {
1470
1465
  try {
1471
1466
  if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
@@ -1488,37 +1483,37 @@ function di(a, t) {
1488
1483
  d(di, "_slicedToArray");
1489
1484
  function hi(a, t) {
1490
1485
  if (a) {
1491
- if (typeof a == "string") return ms(a, t);
1486
+ if (typeof a == "string") return gs(a, t);
1492
1487
  var e = {}.toString.call(a).slice(8, -1);
1493
- 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;
1488
+ 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;
1494
1489
  }
1495
1490
  }
1496
1491
  d(hi, "_unsupportedIterableToArray");
1497
- const Vs = Object.entries, gs = Object.setPrototypeOf, pi = Object.isFrozen, fi = Object.getPrototypeOf, mi = Object.getOwnPropertyDescriptor;
1498
- let _e = Object.freeze, He = Object.seal, Dt = Object.create, qs = typeof Reflect < "u" && Reflect, Pn = qs.apply, Bn = qs.construct;
1499
- _e || (_e = /* @__PURE__ */ d(function(t) {
1492
+ const qs = Object.entries, vs = Object.setPrototypeOf, pi = Object.isFrozen, fi = Object.getPrototypeOf, mi = Object.getOwnPropertyDescriptor;
1493
+ let Ee = Object.freeze, He = Object.seal, Dt = Object.create, Ys = typeof Reflect < "u" && Reflect, Bn = Ys.apply, Fn = Ys.construct;
1494
+ Ee || (Ee = /* @__PURE__ */ d(function(t) {
1500
1495
  return t;
1501
1496
  }, "freeze"));
1502
1497
  He || (He = /* @__PURE__ */ d(function(t) {
1503
1498
  return t;
1504
1499
  }, "seal"));
1505
- Pn || (Pn = /* @__PURE__ */ d(function(t, e) {
1500
+ Bn || (Bn = /* @__PURE__ */ d(function(t, e) {
1506
1501
  for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
1507
1502
  i[s - 2] = arguments[s];
1508
1503
  return t.apply(e, i);
1509
1504
  }, "apply"));
1510
- Bn || (Bn = /* @__PURE__ */ d(function(t) {
1505
+ Fn || (Fn = /* @__PURE__ */ d(function(t) {
1511
1506
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
1512
1507
  n[i - 1] = arguments[i];
1513
1508
  return new t(...n);
1514
1509
  }, "construct"));
1515
- const Rt = ve(Array.prototype.forEach), gi = ve(Array.prototype.lastIndexOf), vs = ve(Array.prototype.pop), Mt = ve(Array.prototype.push), vi = ve(Array.prototype.splice), Ee = Array.isArray, Zt = ve(String.prototype.toLowerCase), Mn = ve(String.prototype.toString), xs = ve(String.prototype.match), Ct = ve(String.prototype.replace), bs = ve(String.prototype.indexOf), xi = ve(String.prototype.trim), bi = ve(Number.prototype.toString), yi = ve(Boolean.prototype.toString), ys = typeof BigInt > "u" ? null : ve(BigInt.prototype.toString), ks = typeof Symbol > "u" ? null : ve(Symbol.prototype.toString), he = ve(Object.prototype.hasOwnProperty), Wt = ve(Object.prototype.toString), we = ve(RegExp.prototype.test), Gt = ki(TypeError);
1510
+ const Rt = ve(Array.prototype.forEach), gi = ve(Array.prototype.lastIndexOf), xs = ve(Array.prototype.pop), Mt = ve(Array.prototype.push), vi = ve(Array.prototype.splice), _e = Array.isArray, Zt = ve(String.prototype.toLowerCase), Cn = ve(String.prototype.toString), ys = ve(String.prototype.match), Ct = ve(String.prototype.replace), bs = ve(String.prototype.indexOf), xi = ve(String.prototype.trim), yi = ve(Number.prototype.toString), bi = ve(Boolean.prototype.toString), ks = typeof BigInt > "u" ? null : ve(BigInt.prototype.toString), ws = typeof Symbol > "u" ? null : ve(Symbol.prototype.toString), he = ve(Object.prototype.hasOwnProperty), Wt = ve(Object.prototype.toString), we = ve(RegExp.prototype.test), Gt = ki(TypeError);
1516
1511
  function ve(a) {
1517
1512
  return function(t) {
1518
1513
  t instanceof RegExp && (t.lastIndex = 0);
1519
1514
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
1520
1515
  n[i - 1] = arguments[i];
1521
- return Pn(a, t, n);
1516
+ return Bn(a, t, n);
1522
1517
  };
1523
1518
  }
1524
1519
  d(ve, "unapply");
@@ -1526,13 +1521,13 @@ function ki(a) {
1526
1521
  return function() {
1527
1522
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
1528
1523
  e[n] = arguments[n];
1529
- return Bn(a, e);
1524
+ return Fn(a, e);
1530
1525
  };
1531
1526
  }
1532
1527
  d(ki, "unconstruct");
1533
1528
  function G(a, t) {
1534
1529
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Zt;
1535
- if (gs && gs(a, null), !Ee(t))
1530
+ if (vs && vs(a, null), !_e(t))
1536
1531
  return a;
1537
1532
  let n = t.length;
1538
1533
  for (; n--; ) {
@@ -1554,10 +1549,10 @@ function wi(a) {
1554
1549
  d(wi, "cleanArray");
1555
1550
  function Te(a) {
1556
1551
  const t = Dt(null);
1557
- for (const n of Vs(a)) {
1552
+ for (const n of qs(a)) {
1558
1553
  var e = di(n, 2);
1559
1554
  const i = e[0], s = e[1];
1560
- he(a, i) && (Ee(s) ? t[i] = wi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = Te(s) : t[i] = s);
1555
+ he(a, i) && (_e(s) ? t[i] = wi(s) : s && typeof s == "object" && s.constructor === Object ? t[i] = Te(s) : t[i] = s);
1561
1556
  }
1562
1557
  return t;
1563
1558
  }
@@ -1567,13 +1562,13 @@ function Ti(a) {
1567
1562
  case "string":
1568
1563
  return a;
1569
1564
  case "number":
1570
- return bi(a);
1571
- case "boolean":
1572
1565
  return yi(a);
1566
+ case "boolean":
1567
+ return bi(a);
1573
1568
  case "bigint":
1574
- return ys ? ys(a) : "0";
1569
+ return ks ? ks(a) : "0";
1575
1570
  case "symbol":
1576
- return ks ? ks(a) : "Symbol()";
1571
+ return ws ? ws(a) : "Symbol()";
1577
1572
  case "undefined":
1578
1573
  return Wt(a);
1579
1574
  case "function":
@@ -1617,7 +1612,7 @@ function Si(a) {
1617
1612
  }
1618
1613
  }
1619
1614
  d(Si, "isRegex");
1620
- const ws = _e(["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"]), Cn = _e(["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"]), In = _e(["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"]), Ai = _e(["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"]), $n = _e(["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"]), Ei = _e(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ts = _e(["#text"]), Ss = _e(["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"]), Ln = _e(["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 = _e(["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"]), cn = _e(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), _i = He(/{{[\w\W]*|^[\w\W]*}}/g), Ri = He(/<%[\w\W]*|^[\w\W]*%>/g), Mi = He(/\${[\w\W]*/g), Ci = He(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ii = He(/^aria-[\-\w]+$/), Es = He(
1615
+ const Ts = Ee(["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"]), In = Ee(["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"]), $n = Ee(["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"]), Ai = Ee(["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"]), Ln = Ee(["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"]), _i = Ee(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ss = Ee(["#text"]), As = Ee(["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"]), Dn = Ee(["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"]), _s = Ee(["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"]), cn = Ee(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ei = He(/{{[\w\W]*|^[\w\W]*}}/g), Ri = He(/<%[\w\W]*|^[\w\W]*%>/g), Mi = He(/\${[\w\W]*/g), Ci = He(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ii = He(/^aria-[\-\w]+$/), Es = He(
1621
1616
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
1622
1617
  // eslint-disable-line no-useless-escape
1623
1618
  ), $i = He(/^(?:\w+script|data):/i), Li = He(
@@ -1660,7 +1655,7 @@ const ws = _e(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
1660
1655
  } catch {
1661
1656
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
1662
1657
  }
1663
- }, "_createTrustedTypesPolicy"), _s = /* @__PURE__ */ d(function() {
1658
+ }, "_createTrustedTypesPolicy"), Rs = /* @__PURE__ */ d(function() {
1664
1659
  return {
1665
1660
  afterSanitizeAttributes: [],
1666
1661
  afterSanitizeElements: [],
@@ -1683,20 +1678,20 @@ function Ks() {
1683
1678
  a.DocumentFragment;
1684
1679
  const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, p = a.NodeFilter, c = a.NamedNodeMap;
1685
1680
  c === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
1686
- const y = a.DOMParser, R = a.trustedTypes, b = o.prototype, k = tt(b, "cloneNode"), A = tt(b, "remove"), _ = tt(b, "nextSibling"), z = tt(b, "childNodes"), Z = tt(b, "parentNode"), L = tt(b, "shadowRoot"), I = tt(b, "attributes"), O = l && l.prototype ? tt(l.prototype, "nodeType") : null, H = l && l.prototype ? tt(l.prototype, "nodeName") : null;
1681
+ const b = a.DOMParser, R = a.trustedTypes, y = o.prototype, k = tt(y, "cloneNode"), A = tt(y, "remove"), E = tt(y, "nextSibling"), O = tt(y, "childNodes"), Z = tt(y, "parentNode"), I = tt(y, "shadowRoot"), $ = tt(y, "attributes"), N = l && l.prototype ? tt(l.prototype, "nodeType") : null, W = l && l.prototype ? tt(l.prototype, "nodeName") : null;
1687
1682
  if (typeof s == "function") {
1688
1683
  const F = e.createElement("template");
1689
1684
  F.content && F.content.ownerDocument && (e = F.content.ownerDocument);
1690
1685
  }
1691
1686
  let B, V = "";
1692
- const ee = e, ue = ee.implementation, Ae = ee.createNodeIterator, Pe = ee.createDocumentFragment, St = ee.getElementsByTagName, De = n.importNode;
1693
- let se = _s();
1694
- t.isSupported = typeof Vs == "function" && typeof Z == "function" && ue && ue.createHTMLDocument !== void 0;
1695
- const st = _i, Ke = Ri, at = Mi, Oe = Ci, gt = Ii, vt = $i, Me = Li, it = Oi;
1696
- let Ce = Es, Y = null;
1697
- const be = G({}, [...ws, ...Cn, ...In, ...$n, ...Ts]);
1687
+ const J = e, ue = J.implementation, Ae = J.createNodeIterator, Pe = J.createDocumentFragment, St = J.getElementsByTagName, De = n.importNode;
1688
+ let se = Rs();
1689
+ t.isSupported = typeof qs == "function" && typeof Z == "function" && ue && ue.createHTMLDocument !== void 0;
1690
+ const st = Ei, Ye = Ri, at = Mi, Oe = Ci, gt = Ii, vt = $i, Me = Li, it = Oi;
1691
+ let Ce = Es, K = null;
1692
+ const ye = G({}, [...Ts, ...In, ...$n, ...Ln, ...Ss]);
1698
1693
  let ie = null;
1699
- const Ie = G({}, [...Ss, ...Ln, ...As, ...cn]);
1694
+ const Ie = G({}, [...As, ...Dn, ..._s, ...cn]);
1700
1695
  let re = Object.seal(Dt(null, {
1701
1696
  tagNameCheck: {
1702
1697
  writable: !0,
@@ -1717,7 +1712,7 @@ function Ks() {
1717
1712
  value: !1
1718
1713
  }
1719
1714
  })), Be = null, rt = null;
1720
- const ye = Object.seal(Dt(null, {
1715
+ const be = Object.seal(Dt(null, {
1721
1716
  tagCheck: {
1722
1717
  writable: !0,
1723
1718
  configurable: !1,
@@ -1731,31 +1726,31 @@ function Ks() {
1731
1726
  value: null
1732
1727
  }
1733
1728
  }));
1734
- let g = !0, M = !0, u = !1, v = !0, $ = !1, D = !0, J = !1, pe = !1, ke = !1, le = !1, de = !1, $e = !1, Ye = !0, je = !1;
1729
+ let g = !0, M = !0, u = !1, v = !0, L = !1, D = !0, Q = !1, pe = !1, ke = !1, le = !1, de = !1, $e = !1, Ke = !0, je = !1;
1735
1730
  const ze = "user-content-";
1736
- let Fe = !0, Xe = !1, E = {}, m = null;
1731
+ let Fe = !0, Xe = !1, _ = {}, m = null;
1737
1732
  const T = G({}, ["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"]);
1738
1733
  let ae = null;
1739
1734
  const U = G({}, ["audio", "video", "img", "source", "image", "track"]);
1740
1735
  let oe = null;
1741
1736
  const Ze = G({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ct = "http://www.w3.org/1998/Math/MathML", sn = "http://www.w3.org/2000/svg", Je = "http://www.w3.org/1999/xhtml";
1742
- let At = Je, yn = !1, kn = null;
1743
- const oa = G({}, [ct, sn, Je], Mn);
1737
+ let At = Je, bn = !1, kn = null;
1738
+ const ca = G({}, [ct, sn, Je], Cn);
1744
1739
  let wn = G({}, ["mi", "mo", "mn", "ms", "mtext"]), Tn = G({}, ["annotation-xml"]);
1745
- const ca = G({}, ["title", "style", "font", "a", "script"]);
1740
+ const ua = G({}, ["title", "style", "font", "a", "script"]);
1746
1741
  let Ut = null;
1747
- const ua = ["application/xhtml+xml", "text/html"], da = "text/html";
1748
- let fe = null, Et = null;
1749
- const ha = e.createElement("form"), Qn = /* @__PURE__ */ d(function(r) {
1742
+ const da = ["application/xhtml+xml", "text/html"], ha = "text/html";
1743
+ let fe = null, _t = null;
1744
+ const pa = e.createElement("form"), es = /* @__PURE__ */ d(function(r) {
1750
1745
  return r instanceof RegExp || r instanceof Function;
1751
1746
  }, "isRegexOrFunction"), Sn = /* @__PURE__ */ d(function() {
1752
1747
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1753
- if (Et && Et === r)
1748
+ if (_t && _t === r)
1754
1749
  return;
1755
1750
  (!r || typeof r != "object") && (r = {}), r = Te(r), Ut = // eslint-disable-next-line unicorn/prefer-includes
1756
- ua.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? da : r.PARSER_MEDIA_TYPE, fe = Ut === "application/xhtml+xml" ? Mn : Zt, Y = he(r, "ALLOWED_TAGS") && Ee(r.ALLOWED_TAGS) ? G({}, r.ALLOWED_TAGS, fe) : be, ie = he(r, "ALLOWED_ATTR") && Ee(r.ALLOWED_ATTR) ? G({}, r.ALLOWED_ATTR, fe) : Ie, kn = he(r, "ALLOWED_NAMESPACES") && Ee(r.ALLOWED_NAMESPACES) ? G({}, r.ALLOWED_NAMESPACES, Mn) : oa, oe = he(r, "ADD_URI_SAFE_ATTR") && Ee(r.ADD_URI_SAFE_ATTR) ? G(Te(Ze), r.ADD_URI_SAFE_ATTR, fe) : Ze, ae = he(r, "ADD_DATA_URI_TAGS") && Ee(r.ADD_DATA_URI_TAGS) ? G(Te(U), r.ADD_DATA_URI_TAGS, fe) : U, m = he(r, "FORBID_CONTENTS") && Ee(r.FORBID_CONTENTS) ? G({}, r.FORBID_CONTENTS, fe) : T, Be = he(r, "FORBID_TAGS") && Ee(r.FORBID_TAGS) ? G({}, r.FORBID_TAGS, fe) : Te({}), rt = he(r, "FORBID_ATTR") && Ee(r.FORBID_ATTR) ? G({}, r.FORBID_ATTR, fe) : Te({}), E = he(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? Te(r.USE_PROFILES) : r.USE_PROFILES : !1, g = r.ALLOW_ARIA_ATTR !== !1, M = r.ALLOW_DATA_ATTR !== !1, u = r.ALLOW_UNKNOWN_PROTOCOLS || !1, v = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, $ = r.SAFE_FOR_TEMPLATES || !1, D = r.SAFE_FOR_XML !== !1, J = r.WHOLE_DOCUMENT || !1, le = r.RETURN_DOM || !1, de = r.RETURN_DOM_FRAGMENT || !1, $e = r.RETURN_TRUSTED_TYPE || !1, ke = r.FORCE_BODY || !1, Ye = r.SANITIZE_DOM !== !1, je = r.SANITIZE_NAMED_PROPS || !1, Fe = r.KEEP_CONTENT !== !1, Xe = r.IN_PLACE || !1, Ce = Si(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : Es, At = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Je, wn = he(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Te(r.MATHML_TEXT_INTEGRATION_POINTS) : G({}, ["mi", "mo", "mn", "ms", "mtext"]), Tn = he(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? Te(r.HTML_INTEGRATION_POINTS) : G({}, ["annotation-xml"]);
1751
+ da.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? ha : r.PARSER_MEDIA_TYPE, fe = Ut === "application/xhtml+xml" ? Cn : Zt, K = he(r, "ALLOWED_TAGS") && _e(r.ALLOWED_TAGS) ? G({}, r.ALLOWED_TAGS, fe) : ye, ie = he(r, "ALLOWED_ATTR") && _e(r.ALLOWED_ATTR) ? G({}, r.ALLOWED_ATTR, fe) : Ie, kn = he(r, "ALLOWED_NAMESPACES") && _e(r.ALLOWED_NAMESPACES) ? G({}, r.ALLOWED_NAMESPACES, Cn) : ca, oe = he(r, "ADD_URI_SAFE_ATTR") && _e(r.ADD_URI_SAFE_ATTR) ? G(Te(Ze), r.ADD_URI_SAFE_ATTR, fe) : Ze, ae = he(r, "ADD_DATA_URI_TAGS") && _e(r.ADD_DATA_URI_TAGS) ? G(Te(U), r.ADD_DATA_URI_TAGS, fe) : U, m = he(r, "FORBID_CONTENTS") && _e(r.FORBID_CONTENTS) ? G({}, r.FORBID_CONTENTS, fe) : T, Be = he(r, "FORBID_TAGS") && _e(r.FORBID_TAGS) ? G({}, r.FORBID_TAGS, fe) : Te({}), rt = he(r, "FORBID_ATTR") && _e(r.FORBID_ATTR) ? G({}, r.FORBID_ATTR, fe) : Te({}), _ = he(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? Te(r.USE_PROFILES) : r.USE_PROFILES : !1, g = r.ALLOW_ARIA_ATTR !== !1, M = r.ALLOW_DATA_ATTR !== !1, u = r.ALLOW_UNKNOWN_PROTOCOLS || !1, v = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, L = r.SAFE_FOR_TEMPLATES || !1, D = r.SAFE_FOR_XML !== !1, Q = r.WHOLE_DOCUMENT || !1, le = r.RETURN_DOM || !1, de = r.RETURN_DOM_FRAGMENT || !1, $e = r.RETURN_TRUSTED_TYPE || !1, ke = r.FORCE_BODY || !1, Ke = r.SANITIZE_DOM !== !1, je = r.SANITIZE_NAMED_PROPS || !1, Fe = r.KEEP_CONTENT !== !1, Xe = r.IN_PLACE || !1, Ce = Si(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : Es, At = typeof r.NAMESPACE == "string" ? r.NAMESPACE : Je, wn = he(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Te(r.MATHML_TEXT_INTEGRATION_POINTS) : G({}, ["mi", "mo", "mn", "ms", "mtext"]), Tn = he(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? Te(r.HTML_INTEGRATION_POINTS) : G({}, ["annotation-xml"]);
1757
1752
  const x = he(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? Te(r.CUSTOM_ELEMENT_HANDLING) : Dt(null);
1758
- if (re = Dt(null), he(x, "tagNameCheck") && Qn(x.tagNameCheck) && (re.tagNameCheck = x.tagNameCheck), he(x, "attributeNameCheck") && Qn(x.attributeNameCheck) && (re.attributeNameCheck = x.attributeNameCheck), he(x, "allowCustomizedBuiltInElements") && typeof x.allowCustomizedBuiltInElements == "boolean" && (re.allowCustomizedBuiltInElements = x.allowCustomizedBuiltInElements), $ && (M = !1), de && (le = !0), E && (Y = G({}, Ts), ie = Dt(null), E.html === !0 && (G(Y, ws), G(ie, Ss)), E.svg === !0 && (G(Y, Cn), G(ie, Ln), G(ie, cn)), E.svgFilters === !0 && (G(Y, In), G(ie, Ln), G(ie, cn)), E.mathMl === !0 && (G(Y, $n), G(ie, As), G(ie, cn))), ye.tagCheck = null, ye.attributeCheck = null, he(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? ye.tagCheck = r.ADD_TAGS : Ee(r.ADD_TAGS) && (Y === be && (Y = Te(Y)), G(Y, r.ADD_TAGS, fe))), he(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? ye.attributeCheck = r.ADD_ATTR : Ee(r.ADD_ATTR) && (ie === Ie && (ie = Te(ie)), G(ie, r.ADD_ATTR, fe))), he(r, "ADD_URI_SAFE_ATTR") && Ee(r.ADD_URI_SAFE_ATTR) && G(oe, r.ADD_URI_SAFE_ATTR, fe), he(r, "FORBID_CONTENTS") && Ee(r.FORBID_CONTENTS) && (m === T && (m = Te(m)), G(m, r.FORBID_CONTENTS, fe)), he(r, "ADD_FORBID_CONTENTS") && Ee(r.ADD_FORBID_CONTENTS) && (m === T && (m = Te(m)), G(m, r.ADD_FORBID_CONTENTS, fe)), Fe && (Y["#text"] = !0), J && G(Y, ["html", "head", "body"]), Y.table && (G(Y, ["tbody"]), delete Be.tbody), r.TRUSTED_TYPES_POLICY) {
1753
+ if (re = Dt(null), he(x, "tagNameCheck") && es(x.tagNameCheck) && (re.tagNameCheck = x.tagNameCheck), he(x, "attributeNameCheck") && es(x.attributeNameCheck) && (re.attributeNameCheck = x.attributeNameCheck), he(x, "allowCustomizedBuiltInElements") && typeof x.allowCustomizedBuiltInElements == "boolean" && (re.allowCustomizedBuiltInElements = x.allowCustomizedBuiltInElements), L && (M = !1), de && (le = !0), _ && (K = G({}, Ss), ie = Dt(null), _.html === !0 && (G(K, Ts), G(ie, As)), _.svg === !0 && (G(K, In), G(ie, Dn), G(ie, cn)), _.svgFilters === !0 && (G(K, $n), G(ie, Dn), G(ie, cn)), _.mathMl === !0 && (G(K, Ln), G(ie, _s), G(ie, cn))), be.tagCheck = null, be.attributeCheck = null, he(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? be.tagCheck = r.ADD_TAGS : _e(r.ADD_TAGS) && (K === ye && (K = Te(K)), G(K, r.ADD_TAGS, fe))), he(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? be.attributeCheck = r.ADD_ATTR : _e(r.ADD_ATTR) && (ie === Ie && (ie = Te(ie)), G(ie, r.ADD_ATTR, fe))), he(r, "ADD_URI_SAFE_ATTR") && _e(r.ADD_URI_SAFE_ATTR) && G(oe, r.ADD_URI_SAFE_ATTR, fe), he(r, "FORBID_CONTENTS") && _e(r.FORBID_CONTENTS) && (m === T && (m = Te(m)), G(m, r.FORBID_CONTENTS, fe)), he(r, "ADD_FORBID_CONTENTS") && _e(r.ADD_FORBID_CONTENTS) && (m === T && (m = Te(m)), G(m, r.ADD_FORBID_CONTENTS, fe)), Fe && (K["#text"] = !0), Q && G(K, ["html", "head", "body"]), K.table && (G(K, ["tbody"]), delete Be.tbody), r.TRUSTED_TYPES_POLICY) {
1759
1754
  if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
1760
1755
  throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
1761
1756
  if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
@@ -1763,15 +1758,15 @@ function Ks() {
1763
1758
  B = r.TRUSTED_TYPES_POLICY, V = B.createHTML("");
1764
1759
  } else
1765
1760
  B === void 0 && (B = Ni(R, i)), B !== null && typeof V == "string" && (V = B.createHTML(""));
1766
- (se.uponSanitizeElement.length > 0 || se.uponSanitizeAttribute.length > 0) && Y === be && (Y = Te(Y)), se.uponSanitizeAttribute.length > 0 && ie === Ie && (ie = Te(ie)), _e && _e(r), Et = r;
1767
- }, "_parseConfig"), es = G({}, [...Cn, ...In, ...Ai]), ts = G({}, [...$n, ...Ei]), pa = /* @__PURE__ */ d(function(r) {
1761
+ (se.uponSanitizeElement.length > 0 || se.uponSanitizeAttribute.length > 0) && K === ye && (K = Te(K)), se.uponSanitizeAttribute.length > 0 && ie === Ie && (ie = Te(ie)), Ee && Ee(r), _t = r;
1762
+ }, "_parseConfig"), ts = G({}, [...In, ...$n, ...Ai]), ns = G({}, [...Ln, ..._i]), fa = /* @__PURE__ */ d(function(r) {
1768
1763
  let x = Z(r);
1769
1764
  (!x || !x.tagName) && (x = {
1770
1765
  namespaceURI: At,
1771
1766
  tagName: "template"
1772
1767
  });
1773
- const N = Zt(r.tagName), ne = Zt(x.tagName);
1774
- return kn[r.namespaceURI] ? r.namespaceURI === sn ? x.namespaceURI === Je ? N === "svg" : x.namespaceURI === ct ? N === "svg" && (ne === "annotation-xml" || wn[ne]) : !!es[N] : r.namespaceURI === ct ? x.namespaceURI === Je ? N === "math" : x.namespaceURI === sn ? N === "math" && Tn[ne] : !!ts[N] : r.namespaceURI === Je ? x.namespaceURI === sn && !Tn[ne] || x.namespaceURI === ct && !wn[ne] ? !1 : !ts[N] && (ca[N] || !es[N]) : !!(Ut === "application/xhtml+xml" && kn[r.namespaceURI]) : !1;
1768
+ const z = Zt(r.tagName), ne = Zt(x.tagName);
1769
+ return kn[r.namespaceURI] ? r.namespaceURI === sn ? x.namespaceURI === Je ? z === "svg" : x.namespaceURI === ct ? z === "svg" && (ne === "annotation-xml" || wn[ne]) : !!ts[z] : r.namespaceURI === ct ? x.namespaceURI === Je ? z === "math" : x.namespaceURI === sn ? z === "math" && Tn[ne] : !!ns[z] : r.namespaceURI === Je ? x.namespaceURI === sn && !Tn[ne] || x.namespaceURI === ct && !wn[ne] ? !1 : !ns[z] && (ua[z] || !ts[z]) : !!(Ut === "application/xhtml+xml" && kn[r.namespaceURI]) : !1;
1775
1770
  }, "_checkValidNamespace"), We = /* @__PURE__ */ d(function(r) {
1776
1771
  Mt(t.removed, {
1777
1772
  element: r
@@ -1804,31 +1799,31 @@ function Ks() {
1804
1799
  x.setAttribute(r, "");
1805
1800
  } catch {
1806
1801
  }
1807
- }, "_removeAttribute"), ns = /* @__PURE__ */ d(function(r) {
1808
- let x = null, N = null;
1802
+ }, "_removeAttribute"), ss = /* @__PURE__ */ d(function(r) {
1803
+ let x = null, z = null;
1809
1804
  if (ke)
1810
1805
  r = "<remove></remove>" + r;
1811
1806
  else {
1812
- const ce = xs(r, /^[\r\n\t ]+/);
1813
- N = ce && ce[0];
1807
+ const ce = ys(r, /^[\r\n\t ]+/);
1808
+ z = ce && ce[0];
1814
1809
  }
1815
1810
  Ut === "application/xhtml+xml" && At === Je && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
1816
1811
  const ne = B ? B.createHTML(r) : r;
1817
1812
  if (At === Je)
1818
1813
  try {
1819
- x = new y().parseFromString(ne, Ut);
1814
+ x = new b().parseFromString(ne, Ut);
1820
1815
  } catch {
1821
1816
  }
1822
1817
  if (!x || !x.documentElement) {
1823
1818
  x = ue.createDocument(At, "template", null);
1824
1819
  try {
1825
- x.documentElement.innerHTML = yn ? V : ne;
1820
+ x.documentElement.innerHTML = bn ? V : ne;
1826
1821
  } catch {
1827
1822
  }
1828
1823
  }
1829
- const K = x.body || x.documentElement;
1830
- return r && N && K.insertBefore(e.createTextNode(N), K.childNodes[0] || null), At === Je ? St.call(x, J ? "html" : "body")[0] : J ? x.documentElement : K;
1831
- }, "_initDocument"), ss = /* @__PURE__ */ d(function(r) {
1824
+ const Y = x.body || x.documentElement;
1825
+ return r && z && Y.insertBefore(e.createTextNode(z), Y.childNodes[0] || null), At === Je ? St.call(x, Q ? "html" : "body")[0] : Q ? x.documentElement : Y;
1826
+ }, "_initDocument"), as = /* @__PURE__ */ d(function(r) {
1832
1827
  return Ae.call(
1833
1828
  r.ownerDocument || r,
1834
1829
  r,
@@ -1836,7 +1831,7 @@ function Ks() {
1836
1831
  p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
1837
1832
  null
1838
1833
  );
1839
- }, "_createNodeIterator"), as = /* @__PURE__ */ d(function(r) {
1834
+ }, "_createNodeIterator"), is = /* @__PURE__ */ d(function(r) {
1840
1835
  r.normalize();
1841
1836
  const x = Ae.call(
1842
1837
  r.ownerDocument || r,
@@ -1845,28 +1840,28 @@ function Ks() {
1845
1840
  p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION,
1846
1841
  null
1847
1842
  );
1848
- let N = x.nextNode();
1849
- for (; N; ) {
1850
- let ne = N.data;
1851
- Rt([st, Ke, at], (K) => {
1852
- ne = Ct(ne, K, " ");
1853
- }), N.data = ne, N = x.nextNode();
1843
+ let z = x.nextNode();
1844
+ for (; z; ) {
1845
+ let ne = z.data;
1846
+ Rt([st, Ye, at], (Y) => {
1847
+ ne = Ct(ne, Y, " ");
1848
+ }), z.data = ne, z = x.nextNode();
1854
1849
  }
1855
1850
  }, "_scrubTemplateExpressions"), an = /* @__PURE__ */ d(function(r) {
1856
- const x = H ? H(r) : null;
1851
+ const x = W ? W(r) : null;
1857
1852
  return typeof x != "string" || fe(x) !== "form" ? !1 : typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
1858
1853
  // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
1859
1854
  // makes the direct read diverge from the cached read; a clean form
1860
1855
  // (same-realm OR foreign-realm) has both reads pointing at the same
1861
1856
  // canonical NamedNodeMap.
1862
- r.attributes !== I(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
1857
+ r.attributes !== $(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
1863
1858
  // returns the integer 1 for any Element regardless of realm; direct
1864
1859
  // read on a clobbered form (e.g. <input name="nodeType">) returns
1865
1860
  // the named child element. Cheap addition — nodeType is read from
1866
1861
  // an internal slot, no serialization cost — and removes a residual
1867
1862
  // clobbering surface used by several mXSS / PI / comment branches
1868
1863
  // in _sanitizeElements that compare currentNode.nodeType directly.
1869
- r.nodeType !== O(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
1864
+ r.nodeType !== N(r) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
1870
1865
  // "childNodes" shadows the prototype getter. Direct reads of
1871
1866
  // form.childNodes from a clobbered form return the named child
1872
1867
  // instead of the real NodeList, so any walk that reads it directly
@@ -1877,64 +1872,64 @@ function Ks() {
1877
1872
  // select, etc.) regardless of whether the named child happens to
1878
1873
  // carry a numeric .length, which a typeof-based probe would miss
1879
1874
  // (e.g. HTMLSelectElement.length is a defined unsigned-long).
1880
- r.childNodes !== z(r);
1875
+ r.childNodes !== O(r);
1881
1876
  }, "_isClobbered"), Ht = /* @__PURE__ */ d(function(r) {
1882
- if (!O || typeof r != "object" || r === null)
1877
+ if (!N || typeof r != "object" || r === null)
1883
1878
  return !1;
1884
1879
  try {
1885
- return O(r) === et.documentFragment;
1880
+ return N(r) === et.documentFragment;
1886
1881
  } catch {
1887
1882
  return !1;
1888
1883
  }
1889
1884
  }, "_isDocumentFragment"), rn = /* @__PURE__ */ d(function(r) {
1890
- if (!O || typeof r != "object" || r === null)
1885
+ if (!N || typeof r != "object" || r === null)
1891
1886
  return !1;
1892
1887
  try {
1893
- return typeof O(r) == "number";
1888
+ return typeof N(r) == "number";
1894
1889
  } catch {
1895
1890
  return !1;
1896
1891
  }
1897
1892
  }, "_isNode");
1898
1893
  function lt(F, r, x) {
1899
- Rt(F, (N) => {
1900
- N.call(t, r, x, Et);
1894
+ Rt(F, (z) => {
1895
+ z.call(t, r, x, _t);
1901
1896
  });
1902
1897
  }
1903
1898
  d(lt, "_executeHooks");
1904
- const is = /* @__PURE__ */ d(function(r) {
1899
+ const rs = /* @__PURE__ */ d(function(r) {
1905
1900
  let x = null;
1906
1901
  if (lt(se.beforeSanitizeElements, r, null), an(r))
1907
1902
  return We(r), !0;
1908
- const N = fe(r.nodeName);
1903
+ const z = fe(r.nodeName);
1909
1904
  if (lt(se.uponSanitizeElement, r, {
1910
- tagName: N,
1911
- allowedTags: Y
1912
- }), D && r.hasChildNodes() && !rn(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || D && r.namespaceURI === Je && N === "style" && rn(r.firstElementChild) || r.nodeType === et.progressingInstruction || D && r.nodeType === et.comment && we(/<[/\w]/g, r.data))
1905
+ tagName: z,
1906
+ allowedTags: K
1907
+ }), D && r.hasChildNodes() && !rn(r.firstElementChild) && we(/<[/\w!]/g, r.innerHTML) && we(/<[/\w!]/g, r.textContent) || D && r.namespaceURI === Je && z === "style" && rn(r.firstElementChild) || r.nodeType === et.progressingInstruction || D && r.nodeType === et.comment && we(/<[/\w]/g, r.data))
1913
1908
  return We(r), !0;
1914
- if (Be[N] || !(ye.tagCheck instanceof Function && ye.tagCheck(N)) && !Y[N]) {
1915
- if (!Be[N] && ls(N) && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, N) || re.tagNameCheck instanceof Function && re.tagNameCheck(N)))
1909
+ if (Be[z] || !(be.tagCheck instanceof Function && be.tagCheck(z)) && !K[z]) {
1910
+ if (!Be[z] && os(z) && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, z) || re.tagNameCheck instanceof Function && re.tagNameCheck(z)))
1916
1911
  return !1;
1917
- if (Fe && !m[N]) {
1918
- const K = Z(r), ce = z(r);
1919
- if (ce && K) {
1912
+ if (Fe && !m[z]) {
1913
+ const Y = Z(r), ce = O(r);
1914
+ if (ce && Y) {
1920
1915
  const Ue = ce.length;
1921
1916
  for (let Qe = Ue - 1; Qe >= 0; --Qe) {
1922
1917
  const Ge = k(ce[Qe], !0);
1923
- K.insertBefore(Ge, _(r));
1918
+ Y.insertBefore(Ge, E(r));
1924
1919
  }
1925
1920
  }
1926
1921
  }
1927
1922
  return We(r), !0;
1928
1923
  }
1929
- return (O ? O(r) : r.nodeType) === et.element && !pa(r) || (N === "noscript" || N === "noembed" || N === "noframes") && we(/<\/no(script|embed|frames)/i, r.innerHTML) ? (We(r), !0) : ($ && r.nodeType === et.text && (x = r.textContent, Rt([st, Ke, at], (K) => {
1930
- x = Ct(x, K, " ");
1924
+ return (N ? N(r) : r.nodeType) === et.element && !fa(r) || (z === "noscript" || z === "noembed" || z === "noframes") && we(/<\/no(script|embed|frames)/i, r.innerHTML) ? (We(r), !0) : (L && r.nodeType === et.text && (x = r.textContent, Rt([st, Ye, at], (Y) => {
1925
+ x = Ct(x, Y, " ");
1931
1926
  }), r.textContent !== x && (Mt(t.removed, {
1932
1927
  element: r.cloneNode()
1933
1928
  }), r.textContent = x)), lt(se.afterSanitizeElements, r, null), !1);
1934
- }, "_sanitizeElements"), rs = /* @__PURE__ */ d(function(r, x, N) {
1935
- if (rt[x] || Ye && (x === "id" || x === "name") && (N in e || N in ha))
1929
+ }, "_sanitizeElements"), ls = /* @__PURE__ */ d(function(r, x, z) {
1930
+ if (rt[x] || Ke && (x === "id" || x === "name") && (z in e || z in pa))
1936
1931
  return !1;
1937
- const ne = ie[x] || ye.attributeCheck instanceof Function && ye.attributeCheck(x, r);
1932
+ const ne = ie[x] || be.attributeCheck instanceof Function && be.attributeCheck(x, r);
1938
1933
  if (!(M && !rt[x] && we(Oe, x))) {
1939
1934
  if (!(g && we(gt, x))) {
1940
1935
  if (!ne || rt[x]) {
@@ -1942,15 +1937,15 @@ function Ks() {
1942
1937
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
1943
1938
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1944
1939
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
1945
- !(ls(r) && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, r) || re.tagNameCheck instanceof Function && re.tagNameCheck(r)) && (re.attributeNameCheck instanceof RegExp && we(re.attributeNameCheck, x) || re.attributeNameCheck instanceof Function && re.attributeNameCheck(x, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1940
+ !(os(r) && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, r) || re.tagNameCheck instanceof Function && re.tagNameCheck(r)) && (re.attributeNameCheck instanceof RegExp && we(re.attributeNameCheck, x) || re.attributeNameCheck instanceof Function && re.attributeNameCheck(x, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1946
1941
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
1947
- x === "is" && re.allowCustomizedBuiltInElements && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, N) || re.tagNameCheck instanceof Function && re.tagNameCheck(N)))
1942
+ x === "is" && re.allowCustomizedBuiltInElements && (re.tagNameCheck instanceof RegExp && we(re.tagNameCheck, z) || re.tagNameCheck instanceof Function && re.tagNameCheck(z)))
1948
1943
  ) return !1;
1949
1944
  } else if (!oe[x]) {
1950
- if (!we(Ce, Ct(N, Me, ""))) {
1951
- if (!((x === "src" || x === "xlink:href" || x === "href") && r !== "script" && bs(N, "data:") === 0 && ae[r])) {
1952
- if (!(u && !we(vt, Ct(N, Me, "")))) {
1953
- if (N)
1945
+ if (!we(Ce, Ct(z, Me, ""))) {
1946
+ if (!((x === "src" || x === "xlink:href" || x === "href") && r !== "script" && bs(z, "data:") === 0 && ae[r])) {
1947
+ if (!(u && !we(vt, Ct(z, Me, "")))) {
1948
+ if (z)
1954
1949
  return !1;
1955
1950
  }
1956
1951
  }
@@ -1959,14 +1954,14 @@ function Ks() {
1959
1954
  }
1960
1955
  }
1961
1956
  return !0;
1962
- }, "_isValidAttribute"), fa = G({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), ls = /* @__PURE__ */ d(function(r) {
1963
- return !fa[Zt(r)] && we(it, r);
1964
- }, "_isBasicCustomElement"), os = /* @__PURE__ */ d(function(r) {
1957
+ }, "_isValidAttribute"), ma = G({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), os = /* @__PURE__ */ d(function(r) {
1958
+ return !ma[Zt(r)] && we(it, r);
1959
+ }, "_isBasicCustomElement"), cs = /* @__PURE__ */ d(function(r) {
1965
1960
  lt(se.beforeSanitizeAttributes, r, null);
1966
1961
  const x = r.attributes;
1967
1962
  if (!x || an(r))
1968
1963
  return;
1969
- const N = {
1964
+ const z = {
1970
1965
  attrName: "",
1971
1966
  attrValue: "",
1972
1967
  keepAttr: !0,
@@ -1975,19 +1970,19 @@ function Ks() {
1975
1970
  };
1976
1971
  let ne = x.length;
1977
1972
  for (; ne--; ) {
1978
- const K = x[ne], ce = K.name, Ue = K.namespaceURI, Qe = K.value, Ge = fe(ce), An = Qe;
1973
+ const Y = x[ne], ce = Y.name, Ue = Y.namespaceURI, Qe = Y.value, Ge = fe(ce), An = Qe;
1979
1974
  let xe = ce === "value" ? An : xi(An);
1980
- if (N.attrName = Ge, N.attrValue = xe, N.keepAttr = !0, N.forceKeepAttr = void 0, lt(se.uponSanitizeAttribute, r, N), xe = N.attrValue, je && (Ge === "id" || Ge === "name") && bs(xe, ze) !== 0 && (xt(ce, r), xe = ze + xe), D && we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, xe)) {
1975
+ if (z.attrName = Ge, z.attrValue = xe, z.keepAttr = !0, z.forceKeepAttr = void 0, lt(se.uponSanitizeAttribute, r, z), xe = z.attrValue, je && (Ge === "id" || Ge === "name") && bs(xe, ze) !== 0 && (xt(ce, r), xe = ze + xe), D && we(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, xe)) {
1981
1976
  xt(ce, r);
1982
1977
  continue;
1983
1978
  }
1984
- if (Ge === "attributename" && xs(xe, "href")) {
1979
+ if (Ge === "attributename" && ys(xe, "href")) {
1985
1980
  xt(ce, r);
1986
1981
  continue;
1987
1982
  }
1988
- if (N.forceKeepAttr)
1983
+ if (z.forceKeepAttr)
1989
1984
  continue;
1990
- if (!N.keepAttr) {
1985
+ if (!z.keepAttr) {
1991
1986
  xt(ce, r);
1992
1987
  continue;
1993
1988
  }
@@ -1995,16 +1990,16 @@ function Ks() {
1995
1990
  xt(ce, r);
1996
1991
  continue;
1997
1992
  }
1998
- $ && Rt([st, Ke, at], (us) => {
1999
- xe = Ct(xe, us, " ");
1993
+ L && Rt([st, Ye, at], (ds) => {
1994
+ xe = Ct(xe, ds, " ");
2000
1995
  });
2001
- const cs = fe(r.nodeName);
2002
- if (!rs(cs, Ge, xe)) {
1996
+ const us = fe(r.nodeName);
1997
+ if (!ls(us, Ge, xe)) {
2003
1998
  xt(ce, r);
2004
1999
  continue;
2005
2000
  }
2006
2001
  if (B && typeof R == "object" && typeof R.getAttributeType == "function" && !Ue)
2007
- switch (R.getAttributeType(cs, Ge)) {
2002
+ switch (R.getAttributeType(us, Ge)) {
2008
2003
  case "TrustedHTML": {
2009
2004
  xe = B.createHTML(xe);
2010
2005
  break;
@@ -2016,7 +2011,7 @@ function Ks() {
2016
2011
  }
2017
2012
  if (xe !== An)
2018
2013
  try {
2019
- Ue ? r.setAttributeNS(Ue, ce, xe) : r.setAttribute(ce, xe), an(r) ? We(r) : vs(t.removed);
2014
+ Ue ? r.setAttributeNS(Ue, ce, xe) : r.setAttribute(ce, xe), an(r) ? We(r) : xs(t.removed);
2020
2015
  } catch {
2021
2016
  xt(ce, r);
2022
2017
  }
@@ -2024,89 +2019,89 @@ function Ks() {
2024
2019
  lt(se.afterSanitizeAttributes, r, null);
2025
2020
  }, "_sanitizeAttributes"), ln = /* @__PURE__ */ d(function(r) {
2026
2021
  let x = null;
2027
- const N = ss(r);
2028
- for (lt(se.beforeSanitizeShadowDOM, r, null); x = N.nextNode(); )
2029
- if (lt(se.uponSanitizeShadowNode, x, null), is(x), os(x), Ht(x.content) && ln(x.content), (O ? O(x) : x.nodeType) === et.element) {
2030
- const K = L ? L(x) : x.shadowRoot;
2031
- Ht(K) && (_t(K), ln(K));
2022
+ const z = as(r);
2023
+ for (lt(se.beforeSanitizeShadowDOM, r, null); x = z.nextNode(); )
2024
+ if (lt(se.uponSanitizeShadowNode, x, null), rs(x), cs(x), Ht(x.content) && ln(x.content), (N ? N(x) : x.nodeType) === et.element) {
2025
+ const Y = I ? I(x) : x.shadowRoot;
2026
+ Ht(Y) && (Et(Y), ln(Y));
2032
2027
  }
2033
2028
  lt(se.afterSanitizeShadowDOM, r, null);
2034
- }, "_sanitizeShadowDOM"), _t = /* @__PURE__ */ d(function(r) {
2035
- const x = O ? O(r) : r.nodeType;
2029
+ }, "_sanitizeShadowDOM"), Et = /* @__PURE__ */ d(function(r) {
2030
+ const x = N ? N(r) : r.nodeType;
2036
2031
  if (x === et.element) {
2037
- const K = L ? L(r) : r.shadowRoot;
2038
- Ht(K) && (_t(K), ln(K));
2032
+ const Y = I ? I(r) : r.shadowRoot;
2033
+ Ht(Y) && (Et(Y), ln(Y));
2039
2034
  }
2040
- const N = z ? z(r) : r.childNodes;
2041
- if (!N)
2035
+ const z = O ? O(r) : r.childNodes;
2036
+ if (!z)
2042
2037
  return;
2043
2038
  const ne = [];
2044
- Rt(N, (K) => {
2045
- Mt(ne, K);
2039
+ Rt(z, (Y) => {
2040
+ Mt(ne, Y);
2046
2041
  });
2047
- for (const K of ne)
2048
- _t(K);
2042
+ for (const Y of ne)
2043
+ Et(Y);
2049
2044
  if (x === et.element) {
2050
- const K = H ? H(r) : null;
2051
- if (typeof K == "string" && fe(K) === "template") {
2045
+ const Y = W ? W(r) : null;
2046
+ if (typeof Y == "string" && fe(Y) === "template") {
2052
2047
  const ce = r.content;
2053
- Ht(ce) && _t(ce);
2048
+ Ht(ce) && Et(ce);
2054
2049
  }
2055
2050
  }
2056
2051
  }, "_sanitizeAttachedShadowRoots");
2057
2052
  return t.sanitize = function(F) {
2058
- let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = null, N = null, ne = null, K = null;
2059
- if (yn = !F, yn && (F = "<!-->"), typeof F != "string" && !rn(F) && (F = Ti(F), typeof F != "string"))
2053
+ let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = null, z = null, ne = null, Y = null;
2054
+ if (bn = !F, bn && (F = "<!-->"), typeof F != "string" && !rn(F) && (F = Ti(F), typeof F != "string"))
2060
2055
  throw Gt("dirty is not a string, aborting");
2061
2056
  if (!t.isSupported)
2062
2057
  return F;
2063
2058
  if (pe || Sn(r), t.removed = [], typeof F == "string" && (Xe = !1), Xe) {
2064
- const Qe = H ? H(F) : F.nodeName;
2059
+ const Qe = W ? W(F) : F.nodeName;
2065
2060
  if (typeof Qe == "string") {
2066
2061
  const Ge = fe(Qe);
2067
- if (!Y[Ge] || Be[Ge])
2062
+ if (!K[Ge] || Be[Ge])
2068
2063
  throw Gt("root node is forbidden and cannot be sanitized in-place");
2069
2064
  }
2070
2065
  if (an(F))
2071
2066
  throw Gt("root node is clobbered and cannot be sanitized in-place");
2072
- _t(F);
2067
+ Et(F);
2073
2068
  } else if (rn(F))
2074
- x = ns("<!---->"), N = x.ownerDocument.importNode(F, !0), N.nodeType === et.element && N.nodeName === "BODY" || N.nodeName === "HTML" ? x = N : x.appendChild(N), _t(N);
2069
+ x = ss("<!---->"), z = x.ownerDocument.importNode(F, !0), z.nodeType === et.element && z.nodeName === "BODY" || z.nodeName === "HTML" ? x = z : x.appendChild(z), Et(z);
2075
2070
  else {
2076
- if (!le && !$ && !J && // eslint-disable-next-line unicorn/prefer-includes
2071
+ if (!le && !L && !Q && // eslint-disable-next-line unicorn/prefer-includes
2077
2072
  F.indexOf("<") === -1)
2078
2073
  return B && $e ? B.createHTML(F) : F;
2079
- if (x = ns(F), !x)
2074
+ if (x = ss(F), !x)
2080
2075
  return le ? null : $e ? V : "";
2081
2076
  }
2082
2077
  x && ke && We(x.firstChild);
2083
- const ce = ss(Xe ? F : x);
2078
+ const ce = as(Xe ? F : x);
2084
2079
  for (; ne = ce.nextNode(); )
2085
- is(ne), os(ne), Ht(ne.content) && ln(ne.content);
2080
+ rs(ne), cs(ne), Ht(ne.content) && ln(ne.content);
2086
2081
  if (Xe)
2087
- return $ && as(F), F;
2082
+ return L && is(F), F;
2088
2083
  if (le) {
2089
- if ($ && as(x), de)
2090
- for (K = Pe.call(x.ownerDocument); x.firstChild; )
2091
- K.appendChild(x.firstChild);
2084
+ if (L && is(x), de)
2085
+ for (Y = Pe.call(x.ownerDocument); x.firstChild; )
2086
+ Y.appendChild(x.firstChild);
2092
2087
  else
2093
- K = x;
2094
- return (ie.shadowroot || ie.shadowrootmode) && (K = De.call(n, K, !0)), K;
2088
+ Y = x;
2089
+ return (ie.shadowroot || ie.shadowrootmode) && (Y = De.call(n, Y, !0)), Y;
2095
2090
  }
2096
- let Ue = J ? x.outerHTML : x.innerHTML;
2097
- return J && Y["!doctype"] && x.ownerDocument && x.ownerDocument.doctype && x.ownerDocument.doctype.name && we(Di, x.ownerDocument.doctype.name) && (Ue = "<!DOCTYPE " + x.ownerDocument.doctype.name + `>
2098
- ` + Ue), $ && Rt([st, Ke, at], (Qe) => {
2091
+ let Ue = Q ? x.outerHTML : x.innerHTML;
2092
+ return Q && K["!doctype"] && x.ownerDocument && x.ownerDocument.doctype && x.ownerDocument.doctype.name && we(Di, x.ownerDocument.doctype.name) && (Ue = "<!DOCTYPE " + x.ownerDocument.doctype.name + `>
2093
+ ` + Ue), L && Rt([st, Ye, at], (Qe) => {
2099
2094
  Ue = Ct(Ue, Qe, " ");
2100
2095
  }), B && $e ? B.createHTML(Ue) : Ue;
2101
2096
  }, t.setConfig = function() {
2102
2097
  let F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2103
2098
  Sn(F), pe = !0;
2104
2099
  }, t.clearConfig = function() {
2105
- Et = null, pe = !1;
2100
+ _t = null, pe = !1;
2106
2101
  }, t.isValidAttribute = function(F, r, x) {
2107
- Et || Sn({});
2108
- const N = fe(F), ne = fe(r);
2109
- return rs(N, ne, x);
2102
+ _t || Sn({});
2103
+ const z = fe(F), ne = fe(r);
2104
+ return ls(z, ne, x);
2110
2105
  }, t.addHook = function(F, r) {
2111
2106
  typeof r == "function" && Mt(se[F], r);
2112
2107
  }, t.removeHook = function(F, r) {
@@ -2114,25 +2109,25 @@ function Ks() {
2114
2109
  const x = gi(se[F], r);
2115
2110
  return x === -1 ? void 0 : vi(se[F], x, 1)[0];
2116
2111
  }
2117
- return vs(se[F]);
2112
+ return xs(se[F]);
2118
2113
  }, t.removeHooks = function(F) {
2119
2114
  se[F] = [];
2120
2115
  }, t.removeAllHooks = function() {
2121
- se = _s();
2116
+ se = Rs();
2122
2117
  }, t;
2123
2118
  }
2124
2119
  d(Ks, "createDOMPurify");
2125
2120
  var Pi = Ks();
2126
- function Hn() {
2121
+ function jn() {
2127
2122
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
2128
2123
  }
2129
- d(Hn, "M");
2130
- var Tt = Hn();
2131
- function Ys(a) {
2124
+ d(jn, "M");
2125
+ var Tt = jn();
2126
+ function Xs(a) {
2132
2127
  Tt = a;
2133
2128
  }
2134
- d(Ys, "N");
2135
- var yt = { exec: /* @__PURE__ */ d(() => null, "exec") };
2129
+ d(Xs, "N");
2130
+ var bt = { exec: /* @__PURE__ */ d(() => null, "exec") };
2136
2131
  function It(a) {
2137
2132
  let t = [];
2138
2133
  return (e) => {
@@ -2155,16 +2150,16 @@ var Bi = ((a = "") => {
2155
2150
  } catch {
2156
2151
  return !1;
2157
2152
  }
2158
- })(), Se = { 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__ */ d((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: It((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: It((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: It((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: It((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: It((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: It((a) => new RegExp(`^ {0,${a}}>`)) }, Fi = /^(?:[ \t]*(?:\n|$))+/, Ui = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Hi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, jn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Xs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Zs = X(Xs).replace(/bull/g, jn).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(), Wi = X(Xs).replace(/bull/g, jn).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(), Wn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Gi = /^[^\n]+/, Gn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Vi = X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Gn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qi = X(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, jn).getRegex(), xn = "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", Vn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ki = X("^ {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", Vn).replace("tag", xn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Js = X(Wn).replace("hr", nn).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", xn).getRegex(), Yi = X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Js).getRegex(), qn = { blockquote: Yi, code: Ui, def: Vi, fences: Hi, heading: ji, hr: nn, html: Ki, lheading: Zs, list: qi, newline: Fi, paragraph: Js, table: yt, text: Gi }, Rs = X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", nn).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", xn).getRegex(), Xi = { ...qn, lheading: Wi, table: Rs, paragraph: X(Wn).replace("hr", nn).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", xn).getRegex() }, Zi = { ...qn, html: X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Vn).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: yt, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: X(Wn).replace("hr", nn).replace("heading", ` *#{1,6} *[^
2159
- ]`).replace("lheading", Zs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ji = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Qs = /^( {2,}|\\)\n(?!\s*$)/, er = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ft = /[\p{P}\p{S}]/u, bn = /[\s\p{P}\p{S}]/u, Kn = /[^\s\p{P}\p{S}]/u, tr = X(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, bn).getRegex(), ea = /(?!~)[\p{P}\p{S}]/u, nr = /(?!~)[\s\p{P}\p{S}]/u, sr = /(?:[^\s\p{P}\p{S}]|~)/u, ar = X(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Bi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ta = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ir = X(ta, "u").replace(/punct/g, Ft).getRegex(), rr = X(ta, "u").replace(/punct/g, ea).getRegex(), na = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", lr = X(na, "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, bn).replace(/punct/g, Ft).getRegex(), or = X(na, "gu").replace(/notPunctSpace/g, sr).replace(/punctSpace/g, nr).replace(/punct/g, ea).getRegex(), cr = X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, bn).replace(/punct/g, Ft).getRegex(), ur = X(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ft).getRegex(), dr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hr = X(dr, "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, bn).replace(/punct/g, Ft).getRegex(), pr = X(/\\(punct)/, "gu").replace(/punct/g, Ft).getRegex(), fr = X(/^<(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(), mr = X(Vn).replace("(?:-->|$)", "-->").getRegex(), gr = X("^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", mr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), fn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, vr = X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", fn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), sa = X(/^!?\[(label)\]\[(ref)\]/).replace("label", fn).replace("ref", Gn).getRegex(), aa = X(/^!?\[(ref)\](?:\[\])?/).replace("ref", Gn).getRegex(), xr = X("reflink|nolink(?!\\()", "g").replace("reflink", sa).replace("nolink", aa).getRegex(), Ms = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Yn = { _backpedal: yt, anyPunctuation: pr, autolink: fr, blockSkip: ar, br: Qs, code: Qi, del: yt, delLDelim: yt, delRDelim: yt, emStrongLDelim: ir, emStrongRDelimAst: lr, emStrongRDelimUnd: cr, escape: Ji, link: vr, nolink: aa, punctuation: tr, reflink: sa, reflinkSearch: xr, tag: gr, text: er, url: yt }, br = { ...Yn, link: X(/^!?\[(label)\]\((.*?)\)/).replace("label", fn).getRegex(), reflink: X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fn).getRegex() }, Fn = { ...Yn, emStrongRDelimAst: or, emStrongLDelim: rr, delLDelim: ur, delRDelim: hr, url: X(/^((?: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: X(/^([`~]+|[^`~])(?:(?= {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() }, yr = { ...Fn, br: X(Qs).replace("{2,}", "*").getRegex(), text: X(Fn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, un = { normal: qn, gfm: Xi, pedantic: Zi }, Vt = { normal: Yn, gfm: Fn, breaks: yr, pedantic: br }, kr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Cs = /* @__PURE__ */ d((a) => kr[a], "ge");
2153
+ })(), Se = { 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__ */ d((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: It((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: It((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: It((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: It((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: It((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: It((a) => new RegExp(`^ {0,${a}}>`)) }, Fi = /^(?:[ \t]*(?:\n|$))+/, Ui = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Hi = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ji = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Wn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Zs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Js = X(Zs).replace(/bull/g, Wn).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(), Wi = X(Zs).replace(/bull/g, Wn).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(), Gn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Gi = /^[^\n]+/, Vn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Vi = X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Vn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qi = X(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Wn).getRegex(), xn = "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", qn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Yi = X("^ {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", qn).replace("tag", xn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Qs = X(Gn).replace("hr", nn).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", xn).getRegex(), Ki = X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Qs).getRegex(), Yn = { blockquote: Ki, code: Ui, def: Vi, fences: Hi, heading: ji, hr: nn, html: Yi, lheading: Js, list: qi, newline: Fi, paragraph: Qs, table: bt, text: Gi }, Ms = X("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", nn).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", xn).getRegex(), Xi = { ...Yn, lheading: Wi, table: Ms, paragraph: X(Gn).replace("hr", nn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ms).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", xn).getRegex() }, Zi = { ...Yn, html: X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", qn).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: bt, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: X(Gn).replace("hr", nn).replace("heading", ` *#{1,6} *[^
2154
+ ]`).replace("lheading", Js).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ji = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qi = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ea = /^( {2,}|\\)\n(?!\s*$)/, er = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ft = /[\p{P}\p{S}]/u, yn = /[\s\p{P}\p{S}]/u, Kn = /[^\s\p{P}\p{S}]/u, tr = X(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, yn).getRegex(), ta = /(?!~)[\p{P}\p{S}]/u, nr = /(?!~)[\s\p{P}\p{S}]/u, sr = /(?:[^\s\p{P}\p{S}]|~)/u, ar = X(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Bi ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), na = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ir = X(na, "u").replace(/punct/g, Ft).getRegex(), rr = X(na, "u").replace(/punct/g, ta).getRegex(), sa = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", lr = X(sa, "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, yn).replace(/punct/g, Ft).getRegex(), or = X(sa, "gu").replace(/notPunctSpace/g, sr).replace(/punctSpace/g, nr).replace(/punct/g, ta).getRegex(), cr = X("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, yn).replace(/punct/g, Ft).getRegex(), ur = X(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ft).getRegex(), dr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hr = X(dr, "gu").replace(/notPunctSpace/g, Kn).replace(/punctSpace/g, yn).replace(/punct/g, Ft).getRegex(), pr = X(/\\(punct)/, "gu").replace(/punct/g, Ft).getRegex(), fr = X(/^<(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(), mr = X(qn).replace("(?:-->|$)", "-->").getRegex(), gr = X("^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", mr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), fn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, vr = X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", fn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), aa = X(/^!?\[(label)\]\[(ref)\]/).replace("label", fn).replace("ref", Vn).getRegex(), ia = X(/^!?\[(ref)\](?:\[\])?/).replace("ref", Vn).getRegex(), xr = X("reflink|nolink(?!\\()", "g").replace("reflink", aa).replace("nolink", ia).getRegex(), Cs = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Xn = { _backpedal: bt, anyPunctuation: pr, autolink: fr, blockSkip: ar, br: ea, code: Qi, del: bt, delLDelim: bt, delRDelim: bt, emStrongLDelim: ir, emStrongRDelimAst: lr, emStrongRDelimUnd: cr, escape: Ji, link: vr, nolink: ia, punctuation: tr, reflink: aa, reflinkSearch: xr, tag: gr, text: er, url: bt }, yr = { ...Xn, link: X(/^!?\[(label)\]\((.*?)\)/).replace("label", fn).getRegex(), reflink: X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", fn).getRegex() }, Un = { ...Xn, emStrongRDelimAst: or, emStrongLDelim: rr, delLDelim: ur, delRDelim: hr, url: X(/^((?: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: X(/^([`~]+|[^`~])(?:(?= {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() }, br = { ...Un, br: X(ea).replace("{2,}", "*").getRegex(), text: X(Un.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, un = { normal: Yn, gfm: Xi, pedantic: Zi }, Vt = { normal: Xn, gfm: Un, breaks: br, pedantic: yr }, kr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Is = /* @__PURE__ */ d((a) => kr[a], "ge");
2160
2155
  function nt(a, t) {
2161
2156
  if (t) {
2162
- if (Se.escapeTest.test(a)) return a.replace(Se.escapeReplace, Cs);
2163
- } else if (Se.escapeTestNoEncode.test(a)) return a.replace(Se.escapeReplaceNoEncode, Cs);
2157
+ if (Se.escapeTest.test(a)) return a.replace(Se.escapeReplace, Is);
2158
+ } else if (Se.escapeTestNoEncode.test(a)) return a.replace(Se.escapeReplaceNoEncode, Is);
2164
2159
  return a;
2165
2160
  }
2166
2161
  d(nt, "O");
2167
- function Is(a) {
2162
+ function $s(a) {
2168
2163
  try {
2169
2164
  a = encodeURI(a).replace(Se.percentDecode, "%");
2170
2165
  } catch {
@@ -2172,8 +2167,8 @@ function Is(a) {
2172
2167
  }
2173
2168
  return a;
2174
2169
  }
2175
- d(Is, "V");
2176
- function $s(a, t) {
2170
+ d($s, "V");
2171
+ function Ls(a, t) {
2177
2172
  let e = a.replace(Se.findPipe, (s, l, o) => {
2178
2173
  let p = !1, c = l;
2179
2174
  for (; --c >= 0 && o[c] === "\\"; ) p = !p;
@@ -2184,7 +2179,7 @@ function $s(a, t) {
2184
2179
  for (; i < n.length; i++) n[i] = n[i].trim().replace(Se.slashPipe, "|");
2185
2180
  return n;
2186
2181
  }
2187
- d($s, "Y");
2182
+ d(Ls, "Y");
2188
2183
  function ut(a, t, e) {
2189
2184
  let n = a.length;
2190
2185
  if (n === 0) return "";
@@ -2194,14 +2189,14 @@ function ut(a, t, e) {
2194
2189
  return a.slice(0, n - i);
2195
2190
  }
2196
2191
  d(ut, "$");
2197
- function Ls(a) {
2192
+ function Ds(a) {
2198
2193
  let t = a.split(`
2199
2194
  `), e = t.length - 1;
2200
2195
  for (; e >= 0 && Se.blankLine.test(t[e]); ) e--;
2201
2196
  return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
2202
2197
  `);
2203
2198
  }
2204
- d(Ls, "ee");
2199
+ d(Ds, "ee");
2205
2200
  function wr(a, t) {
2206
2201
  if (a.indexOf(t[1]) === -1) return -1;
2207
2202
  let e = 0;
@@ -2220,13 +2215,13 @@ function Tr(a, t = 0) {
2220
2215
  return n;
2221
2216
  }
2222
2217
  d(Tr, "me");
2223
- function Ds(a, t, e, n, i) {
2218
+ function Os(a, t, e, n, i) {
2224
2219
  let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
2225
2220
  n.state.inLink = !0;
2226
2221
  let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
2227
2222
  return n.state.inLink = !1, p;
2228
2223
  }
2229
- d(Ds, "xe");
2224
+ d(Os, "xe");
2230
2225
  function Sr(a, t, e) {
2231
2226
  let n = a.match(e.other.indentCodeCompensation);
2232
2227
  if (n === null) return t;
@@ -2255,7 +2250,7 @@ var zt, mn = (zt = class {
2255
2250
  code(t) {
2256
2251
  let e = this.rules.block.code.exec(t);
2257
2252
  if (e) {
2258
- let n = this.options.pedantic ? e[0] : Ls(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
2253
+ let n = this.options.pedantic ? e[0] : Ds(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
2259
2254
  return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
2260
2255
  }
2261
2256
  }
@@ -2295,27 +2290,27 @@ var zt, mn = (zt = class {
2295
2290
  else if (!o) p.push(n[c]);
2296
2291
  else break;
2297
2292
  n = n.slice(c);
2298
- let y = p.join(`
2299
- `), R = y.replace(this.rules.other.blockquoteSetextReplace, `
2293
+ let b = p.join(`
2294
+ `), R = b.replace(this.rules.other.blockquoteSetextReplace, `
2300
2295
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
2301
2296
  i = i ? `${i}
2302
- ${y}` : y, s = s ? `${s}
2297
+ ${b}` : b, s = s ? `${s}
2303
2298
  ${R}` : R;
2304
- let b = this.lexer.state.top;
2305
- if (this.lexer.state.top = !0, this.lexer.blockTokens(R, l, !0), this.lexer.state.top = b, n.length === 0) break;
2299
+ let y = this.lexer.state.top;
2300
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(R, l, !0), this.lexer.state.top = y, n.length === 0) break;
2306
2301
  let k = l.at(-1);
2307
2302
  if (k?.type === "code") break;
2308
2303
  if (k?.type === "blockquote") {
2309
- let A = k, _ = A.raw + `
2304
+ let A = k, E = A.raw + `
2310
2305
  ` + n.join(`
2311
- `), z = this.blockquote(_);
2312
- l[l.length - 1] = z, i = i.substring(0, i.length - A.raw.length) + z.raw, s = s.substring(0, s.length - A.text.length) + z.text;
2306
+ `), O = this.blockquote(E);
2307
+ l[l.length - 1] = O, i = i.substring(0, i.length - A.raw.length) + O.raw, s = s.substring(0, s.length - A.text.length) + O.text;
2313
2308
  break;
2314
2309
  } else if (k?.type === "list") {
2315
- let A = k, _ = A.raw + `
2310
+ let A = k, E = A.raw + `
2316
2311
  ` + n.join(`
2317
- `), z = this.list(_);
2318
- l[l.length - 1] = z, i = i.substring(0, i.length - k.raw.length) + z.raw, s = s.substring(0, s.length - A.raw.length) + z.raw, n = _.substring(l.at(-1).raw.length).split(`
2312
+ `), O = this.list(E);
2313
+ l[l.length - 1] = O, i = i.substring(0, i.length - k.raw.length) + O.raw, s = s.substring(0, s.length - A.raw.length) + O.raw, n = E.substring(l.at(-1).raw.length).split(`
2319
2314
  `);
2320
2315
  continue;
2321
2316
  }
@@ -2330,31 +2325,31 @@ ${R}` : R;
2330
2325
  n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
2331
2326
  let l = this.rules.other.listItemRegex(n), o = !1;
2332
2327
  for (; t; ) {
2333
- let c = !1, y = "", R = "";
2328
+ let c = !1, b = "", R = "";
2334
2329
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
2335
- y = e[0], t = t.substring(y.length);
2336
- let b = Tr(e[2].split(`
2330
+ b = e[0], t = t.substring(b.length);
2331
+ let y = Tr(e[2].split(`
2337
2332
  `, 1)[0], e[1].length), k = t.split(`
2338
- `, 1)[0], A = !b.trim(), _ = 0;
2339
- if (this.options.pedantic ? (_ = 2, R = b.trimStart()) : A ? _ = e[1].length + 1 : (_ = b.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, R = b.slice(_), _ += e[1].length), A && this.rules.other.blankLine.test(k) && (y += k + `
2333
+ `, 1)[0], A = !y.trim(), E = 0;
2334
+ if (this.options.pedantic ? (E = 2, R = y.trimStart()) : A ? E = e[1].length + 1 : (E = y.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, R = y.slice(E), E += e[1].length), A && this.rules.other.blankLine.test(k) && (b += k + `
2340
2335
  `, t = t.substring(k.length + 1), c = !0), !c) {
2341
- let z = this.rules.other.nextBulletRegex(_), Z = this.rules.other.hrRegex(_), L = this.rules.other.fencesBeginRegex(_), I = this.rules.other.headingBeginRegex(_), O = this.rules.other.htmlBeginRegex(_), H = this.rules.other.blockquoteBeginRegex(_);
2336
+ let O = this.rules.other.nextBulletRegex(E), Z = this.rules.other.hrRegex(E), I = this.rules.other.fencesBeginRegex(E), $ = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), W = this.rules.other.blockquoteBeginRegex(E);
2342
2337
  for (; t; ) {
2343
2338
  let B = t.split(`
2344
2339
  `, 1)[0], V;
2345
- if (k = B, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), V = k) : V = k.replace(this.rules.other.tabCharGlobal, " "), L.test(k) || I.test(k) || O.test(k) || H.test(k) || z.test(k) || Z.test(k)) break;
2346
- if (V.search(this.rules.other.nonSpaceChar) >= _ || !k.trim()) R += `
2347
- ` + V.slice(_);
2340
+ if (k = B, this.options.pedantic ? (k = k.replace(this.rules.other.listReplaceNesting, " "), V = k) : V = k.replace(this.rules.other.tabCharGlobal, " "), I.test(k) || $.test(k) || N.test(k) || W.test(k) || O.test(k) || Z.test(k)) break;
2341
+ if (V.search(this.rules.other.nonSpaceChar) >= E || !k.trim()) R += `
2342
+ ` + V.slice(E);
2348
2343
  else {
2349
- if (A || b.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || L.test(b) || I.test(b) || Z.test(b)) break;
2344
+ if (A || y.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || I.test(y) || $.test(y) || Z.test(y)) break;
2350
2345
  R += `
2351
2346
  ` + k;
2352
2347
  }
2353
- A = !k.trim(), y += B + `
2354
- `, t = t.substring(B.length + 1), b = V.slice(_);
2348
+ A = !k.trim(), b += B + `
2349
+ `, t = t.substring(B.length + 1), y = V.slice(E);
2355
2350
  }
2356
2351
  }
2357
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(y) && (o = !0)), s.items.push({ type: "list_item", raw: y, task: !!this.options.gfm && this.rules.other.listIsTask.test(R), loose: !1, text: R, tokens: [] }), s.raw += y;
2352
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (o = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(R), loose: !1, text: R, tokens: [] }), s.raw += b;
2358
2353
  }
2359
2354
  let p = s.items.at(-1);
2360
2355
  if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
@@ -2362,27 +2357,27 @@ ${R}` : R;
2362
2357
  s.raw = s.raw.trimEnd();
2363
2358
  for (let c of s.items) {
2364
2359
  this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
2365
- let y = c.tokens[0];
2366
- if (c.task && (y?.type === "text" || y?.type === "paragraph")) {
2367
- c.text = c.text.replace(this.rules.other.listReplaceTask, ""), y.raw = y.raw.replace(this.rules.other.listReplaceTask, ""), y.text = y.text.replace(this.rules.other.listReplaceTask, "");
2368
- for (let b = this.lexer.inlineQueue.length - 1; b >= 0; b--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)) {
2369
- this.lexer.inlineQueue[b].src = this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask, "");
2360
+ let b = c.tokens[0];
2361
+ if (c.task && (b?.type === "text" || b?.type === "paragraph")) {
2362
+ c.text = c.text.replace(this.rules.other.listReplaceTask, ""), b.raw = b.raw.replace(this.rules.other.listReplaceTask, ""), b.text = b.text.replace(this.rules.other.listReplaceTask, "");
2363
+ for (let y = this.lexer.inlineQueue.length - 1; y >= 0; y--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)) {
2364
+ this.lexer.inlineQueue[y].src = this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask, "");
2370
2365
  break;
2371
2366
  }
2372
2367
  let R = this.rules.other.listTaskCheckbox.exec(c.raw);
2373
2368
  if (R) {
2374
- let b = { type: "checkbox", raw: R[0] + " ", checked: R[0] !== "[ ]" };
2375
- c.checked = b.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = b.raw + c.tokens[0].raw, c.tokens[0].text = b.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(b)) : c.tokens.unshift({ type: "paragraph", raw: b.raw, text: b.raw, tokens: [b] }) : c.tokens.unshift(b);
2369
+ let y = { type: "checkbox", raw: R[0] + " ", checked: R[0] !== "[ ]" };
2370
+ c.checked = y.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = y.raw + c.tokens[0].raw, c.tokens[0].text = y.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(y)) : c.tokens.unshift({ type: "paragraph", raw: y.raw, text: y.raw, tokens: [y] }) : c.tokens.unshift(y);
2376
2371
  }
2377
2372
  } else c.task && (c.task = !1);
2378
2373
  if (!s.loose) {
2379
- let R = c.tokens.filter((k) => k.type === "space"), b = R.length > 0 && R.some((k) => this.rules.other.anyLine.test(k.raw));
2380
- s.loose = b;
2374
+ let R = c.tokens.filter((k) => k.type === "space"), y = R.length > 0 && R.some((k) => this.rules.other.anyLine.test(k.raw));
2375
+ s.loose = y;
2381
2376
  }
2382
2377
  }
2383
2378
  if (s.loose) for (let c of s.items) {
2384
2379
  c.loose = !0;
2385
- for (let y of c.tokens) y.type === "text" && (y.type = "paragraph");
2380
+ for (let b of c.tokens) b.type === "text" && (b.type = "paragraph");
2386
2381
  }
2387
2382
  return s;
2388
2383
  }
@@ -2390,7 +2385,7 @@ ${R}` : R;
2390
2385
  html(t) {
2391
2386
  let e = this.rules.block.html.exec(t);
2392
2387
  if (e) {
2393
- let n = Ls(e[0]);
2388
+ let n = Ds(e[0]);
2394
2389
  return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
2395
2390
  }
2396
2391
  }
@@ -2405,13 +2400,13 @@ ${R}` : R;
2405
2400
  table(t) {
2406
2401
  let e = this.rules.block.table.exec(t);
2407
2402
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
2408
- 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(`
2403
+ let n = Ls(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
2409
2404
  `) : [], l = { type: "table", raw: ut(e[0], `
2410
2405
  `), header: [], align: [], rows: [] };
2411
2406
  if (n.length === i.length) {
2412
2407
  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);
2413
2408
  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] });
2414
- for (let o of s) l.rows.push($s(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
2409
+ for (let o of s) l.rows.push(Ls(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
2415
2410
  return l;
2416
2411
  }
2417
2412
  }
@@ -2464,7 +2459,7 @@ ${R}` : R;
2464
2459
  let l = this.rules.other.pedanticHrefTitle.exec(i);
2465
2460
  l && (i = l[1], s = l[3]);
2466
2461
  } else s = e[3] ? e[3].slice(1, -1) : "";
2467
- 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)), Ds(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);
2462
+ 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);
2468
2463
  }
2469
2464
  }
2470
2465
  reflink(t, e) {
@@ -2475,14 +2470,14 @@ ${R}` : R;
2475
2470
  let l = n[0].charAt(0);
2476
2471
  return { type: "text", raw: l, text: l };
2477
2472
  }
2478
- return Ds(n, s, n[0], this.lexer, this.rules);
2473
+ return Os(n, s, n[0], this.lexer, this.rules);
2479
2474
  }
2480
2475
  }
2481
2476
  emStrong(t, e, n = "") {
2482
2477
  let i = this.rules.inline.emStrongLDelim.exec(t);
2483
2478
  if (!(!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(i[1] || i[3]) || !n || this.rules.inline.punctuation.exec(n))) {
2484
- let s = [...i[0]].length - 1, l, o, p = s, c = 0, y = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
2485
- for (y.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = y.exec(e)) !== null; ) {
2479
+ let s = [...i[0]].length - 1, l, o, p = s, c = 0, b = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
2480
+ for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = b.exec(e)) !== null; ) {
2486
2481
  if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
2487
2482
  if (o = [...l].length, i[3] || i[4]) {
2488
2483
  p += o;
@@ -2493,13 +2488,13 @@ ${R}` : R;
2493
2488
  }
2494
2489
  if (p -= o, p > 0) continue;
2495
2490
  o = Math.min(o, o + p + c);
2496
- let R = [...i[0]][0].length, b = t.slice(0, s + i.index + R + o);
2491
+ let R = [...i[0]][0].length, y = t.slice(0, s + i.index + R + o);
2497
2492
  if (Math.min(s, o) % 2) {
2498
- let A = b.slice(1, -1);
2499
- return { type: "em", raw: b, text: A, tokens: this.lexer.inlineTokens(A) };
2493
+ let A = y.slice(1, -1);
2494
+ return { type: "em", raw: y, text: A, tokens: this.lexer.inlineTokens(A) };
2500
2495
  }
2501
- let k = b.slice(2, -2);
2502
- return { type: "strong", raw: b, text: k, tokens: this.lexer.inlineTokens(k) };
2496
+ let k = y.slice(2, -2);
2497
+ return { type: "strong", raw: y, text: k, tokens: this.lexer.inlineTokens(k) };
2503
2498
  }
2504
2499
  }
2505
2500
  }
@@ -2526,8 +2521,8 @@ ${R}` : R;
2526
2521
  }
2527
2522
  if (p -= o, p > 0) continue;
2528
2523
  o = Math.min(o, o + p);
2529
- let y = [...i[0]][0].length, R = t.slice(0, s + i.index + y + o), b = R.slice(s, -s);
2530
- return { type: "del", raw: R, text: b, tokens: this.lexer.inlineTokens(b) };
2524
+ let b = [...i[0]][0].length, R = t.slice(0, s + i.index + b + o), y = R.slice(s, -s);
2525
+ return { type: "del", raw: R, text: y, tokens: this.lexer.inlineTokens(y) };
2531
2526
  }
2532
2527
  }
2533
2528
  }
@@ -2660,8 +2655,8 @@ ${R}` : R;
2660
2655
  let l = t;
2661
2656
  if (this.options.extensions?.startBlock) {
2662
2657
  let o = 1 / 0, p = t.slice(1), c;
2663
- this.options.extensions.startBlock.forEach((y) => {
2664
- c = y.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
2658
+ this.options.extensions.startBlock.forEach((b) => {
2659
+ c = b.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
2665
2660
  }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
2666
2661
  }
2667
2662
  if (this.state.top && (s = this.tokenizer.paragraph(l))) {
@@ -2754,14 +2749,14 @@ ${R}` : R;
2754
2749
  t = t.substring(c.raw.length), e.push(c);
2755
2750
  continue;
2756
2751
  }
2757
- let y = t;
2752
+ let b = t;
2758
2753
  if (this.options.extensions?.startInline) {
2759
- let R = 1 / 0, b = t.slice(1), k;
2754
+ let R = 1 / 0, y = t.slice(1), k;
2760
2755
  this.options.extensions.startInline.forEach((A) => {
2761
- k = A.call({ lexer: this }, b), typeof k == "number" && k >= 0 && (R = Math.min(R, k));
2762
- }), R < 1 / 0 && R >= 0 && (y = t.substring(0, R + 1));
2756
+ k = A.call({ lexer: this }, y), typeof k == "number" && k >= 0 && (R = Math.min(R, k));
2757
+ }), R < 1 / 0 && R >= 0 && (b = t.substring(0, R + 1));
2763
2758
  }
2764
- if (c = this.tokenizer.inlineText(y)) {
2759
+ if (c = this.tokenizer.inlineText(b)) {
2765
2760
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
2766
2761
  let R = e.at(-1);
2767
2762
  R?.type === "text" ? (R.raw += c.raw, R.text += c.text) : e.push(c);
@@ -2879,7 +2874,7 @@ ${t}</tr>
2879
2874
  return `<del>${this.parser.parseInline(t)}</del>`;
2880
2875
  }
2881
2876
  link({ href: t, title: e, tokens: n }) {
2882
- let i = this.parser.parseInline(n), s = Is(t);
2877
+ let i = this.parser.parseInline(n), s = $s(t);
2883
2878
  if (s === null) return i;
2884
2879
  t = s;
2885
2880
  let l = '<a href="' + t + '"';
@@ -2887,7 +2882,7 @@ ${t}</tr>
2887
2882
  }
2888
2883
  image({ href: t, title: e, text: n, tokens: i }) {
2889
2884
  i && (n = this.parser.parseInline(i, this.parser.textRenderer));
2890
- let s = Is(t);
2885
+ let s = $s(t);
2891
2886
  if (s === null) return nt(n);
2892
2887
  t = s;
2893
2888
  let l = `<img src="${t}" alt="${nt(n)}"`;
@@ -2896,7 +2891,7 @@ ${t}</tr>
2896
2891
  text(t) {
2897
2892
  return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : nt(t.text);
2898
2893
  }
2899
- }, d(Nt, "y"), Nt), Pt, Xn = (Pt = class {
2894
+ }, d(Nt, "y"), Nt), Pt, Zn = (Pt = class {
2900
2895
  strong({ text: t }) {
2901
2896
  return t;
2902
2897
  }
@@ -2932,7 +2927,7 @@ ${t}</tr>
2932
2927
  P(this, "options");
2933
2928
  P(this, "renderer");
2934
2929
  P(this, "textRenderer");
2935
- this.options = t || Tt, this.options.renderer = this.options.renderer || new gn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Xn();
2930
+ this.options = t || Tt, this.options.renderer = this.options.renderer || new gn(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Zn();
2936
2931
  }
2937
2932
  static parse(t, e) {
2938
2933
  return new mt(e).parse(t);
@@ -3104,13 +3099,13 @@ ${t}</tr>
3104
3099
  }
3105
3100
  }, d(pt, "P"), P(pt, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), P(pt, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), pt), Bt, Ar = (Bt = class {
3106
3101
  constructor(...t) {
3107
- P(this, "defaults", Hn());
3102
+ P(this, "defaults", jn());
3108
3103
  P(this, "options", this.setOptions);
3109
3104
  P(this, "parse", this.parseMarkdown(!0));
3110
3105
  P(this, "parseInline", this.parseMarkdown(!1));
3111
3106
  P(this, "Parser", qe);
3112
3107
  P(this, "Renderer", gn);
3113
- P(this, "TextRenderer", Xn);
3108
+ P(this, "TextRenderer", Zn);
3114
3109
  P(this, "Lexer", Ve);
3115
3110
  P(this, "Tokenizer", mn);
3116
3111
  P(this, "Hooks", Jt);
@@ -3165,9 +3160,9 @@ ${t}</tr>
3165
3160
  if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
3166
3161
  if (["options", "parser"].includes(l)) continue;
3167
3162
  let o = l, p = n.renderer[o], c = s[o];
3168
- s[o] = (...y) => {
3169
- let R = p.apply(s, y);
3170
- return R === !1 && (R = c.apply(s, y)), R || "";
3163
+ s[o] = (...b) => {
3164
+ let R = p.apply(s, b);
3165
+ return R === !1 && (R = c.apply(s, b)), R || "";
3171
3166
  };
3172
3167
  }
3173
3168
  i.renderer = s;
@@ -3178,9 +3173,9 @@ ${t}</tr>
3178
3173
  if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
3179
3174
  if (["options", "rules", "lexer"].includes(l)) continue;
3180
3175
  let o = l, p = n.tokenizer[o], c = s[o];
3181
- s[o] = (...y) => {
3182
- let R = p.apply(s, y);
3183
- return R === !1 && (R = c.apply(s, y)), R;
3176
+ s[o] = (...b) => {
3177
+ let R = p.apply(s, b);
3178
+ return R === !1 && (R = c.apply(s, b)), R;
3184
3179
  };
3185
3180
  }
3186
3181
  i.tokenizer = s;
@@ -3191,20 +3186,20 @@ ${t}</tr>
3191
3186
  if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
3192
3187
  if (["options", "block"].includes(l)) continue;
3193
3188
  let o = l, p = n.hooks[o], c = s[o];
3194
- Jt.passThroughHooks.has(l) ? s[o] = (y) => {
3189
+ Jt.passThroughHooks.has(l) ? s[o] = (b) => {
3195
3190
  if (this.defaults.async && Jt.passThroughHooksRespectAsync.has(l)) return (async () => {
3196
- let b = await p.call(s, y);
3197
- return c.call(s, b);
3191
+ let y = await p.call(s, b);
3192
+ return c.call(s, y);
3198
3193
  })();
3199
- let R = p.call(s, y);
3194
+ let R = p.call(s, b);
3200
3195
  return c.call(s, R);
3201
- } : s[o] = (...y) => {
3196
+ } : s[o] = (...b) => {
3202
3197
  if (this.defaults.async) return (async () => {
3203
- let b = await p.apply(s, y);
3204
- return b === !1 && (b = await c.apply(s, y)), b;
3198
+ let y = await p.apply(s, b);
3199
+ return y === !1 && (y = await c.apply(s, b)), y;
3205
3200
  })();
3206
- let R = p.apply(s, y);
3207
- return R === !1 && (R = c.apply(s, y)), R;
3201
+ let R = p.apply(s, b);
3202
+ return R === !1 && (R = c.apply(s, b)), R;
3208
3203
  };
3209
3204
  }
3210
3205
  i.hooks = s;
@@ -3237,8 +3232,8 @@ ${t}</tr>
3237
3232
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
3238
3233
  let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? Ve.lex : Ve.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
3239
3234
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
3240
- let y = await (s.hooks ? await s.hooks.provideParser(t) : t ? qe.parse : qe.parseInline)(c, s);
3241
- return s.hooks ? await s.hooks.postprocess(y) : y;
3235
+ let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? qe.parse : qe.parseInline)(c, s);
3236
+ return s.hooks ? await s.hooks.postprocess(b) : b;
3242
3237
  })().catch(l);
3243
3238
  try {
3244
3239
  s.hooks && (e = s.hooks.preprocess(e));
@@ -3268,12 +3263,12 @@ function te(a, t) {
3268
3263
  }
3269
3264
  d(te, "g");
3270
3265
  te.options = te.setOptions = function(a) {
3271
- return wt.setOptions(a), te.defaults = wt.defaults, Ys(te.defaults), te;
3266
+ return wt.setOptions(a), te.defaults = wt.defaults, Xs(te.defaults), te;
3272
3267
  };
3273
- te.getDefaults = Hn;
3268
+ te.getDefaults = jn;
3274
3269
  te.defaults = Tt;
3275
3270
  te.use = function(...a) {
3276
- return wt.use(...a), te.defaults = wt.defaults, Ys(te.defaults), te;
3271
+ return wt.use(...a), te.defaults = wt.defaults, Xs(te.defaults), te;
3277
3272
  };
3278
3273
  te.walkTokens = function(a, t) {
3279
3274
  return wt.walkTokens(a, t);
@@ -3282,7 +3277,7 @@ te.parseInline = wt.parseInline;
3282
3277
  te.Parser = qe;
3283
3278
  te.parser = qe.parse;
3284
3279
  te.Renderer = gn;
3285
- te.TextRenderer = Xn;
3280
+ te.TextRenderer = Zn;
3286
3281
  te.Lexer = Ve;
3287
3282
  te.lexer = Ve.lex;
3288
3283
  te.Tokenizer = mn;
@@ -3295,12 +3290,12 @@ te.walkTokens;
3295
3290
  te.parseInline;
3296
3291
  qe.parse;
3297
3292
  Ve.lex;
3298
- const $t = 112, Lt = 46, dt = 14, qt = 54, Kt = 26;
3299
- function Er(a) {
3293
+ const $t = 112, Lt = 46, dt = 14, qt = 54, Yt = 26;
3294
+ function _r(a) {
3300
3295
  return a.layout === "left-to-right" || a.layout === "radial" ? "horizontal" : a.layout === "top-to-bottom" ? "vertical" : a.diagramType === "sequence" ? "horizontal" : "vertical";
3301
3296
  }
3302
- d(Er, "orientationFor");
3303
- function _r(a) {
3297
+ d(_r, "orientationFor");
3298
+ function Er(a) {
3304
3299
  const t = new Set(a.nodes.map((l) => l.id)), e = new Set(a.edges.map((l) => l.to)), n = a.nodes.map((l) => l.id).filter((l) => !e.has(l)), i = /* @__PURE__ */ new Map();
3305
3300
  for (const l of n.length ? n : a.nodes.slice(0, 1).map((o) => o.id))
3306
3301
  i.set(l, 0);
@@ -3312,8 +3307,8 @@ function _r(a) {
3312
3307
  const c = i.get(p.from);
3313
3308
  if (c === void 0)
3314
3309
  continue;
3315
- const y = c + 1;
3316
- (i.get(p.to) ?? -1) < y && (i.set(p.to, y), o = !0);
3310
+ const b = c + 1;
3311
+ (i.get(p.to) ?? -1) < b && (i.set(p.to, b), o = !0);
3317
3312
  }
3318
3313
  if (!o)
3319
3314
  break;
@@ -3323,57 +3318,57 @@ function _r(a) {
3323
3318
  i.has(l.id) || i.set(l.id, ++s);
3324
3319
  return i;
3325
3320
  }
3326
- d(_r, "levelsFor");
3321
+ d(Er, "levelsFor");
3327
3322
  function Rr(a) {
3328
- const t = Er(a), e = _r(a), n = /* @__PURE__ */ new Map();
3329
- for (const b of a.nodes) {
3330
- const k = e.get(b.id) ?? 0;
3331
- n.set(k, [...n.get(k) ?? [], b]);
3332
- }
3333
- const i = [...n.entries()].sort(([b], [k]) => b - k), s = Math.max(1, ...i.map(([, b]) => b.length)), l = Math.max(1, i.length), o = t === "horizontal" ? dt * 2 + l * $t + (l - 1) * qt : dt * 2 + s * $t + (s - 1) * qt, p = t === "horizontal" ? dt * 2 + s * Lt + (s - 1) * Kt : dt * 2 + l * Lt + (l - 1) * Kt, c = [];
3334
- for (const [b, [, k]] of i.entries()) {
3335
- const A = (s - k.length) * (t === "horizontal" ? Lt + Kt : $t + qt) / 2;
3336
- for (const [_, z] of k.entries()) {
3337
- const Z = t === "horizontal" ? dt + b * ($t + qt) : dt + A + _ * ($t + qt), L = t === "horizontal" ? dt + A + _ * (Lt + Kt) : dt + b * (Lt + Kt);
3323
+ const t = _r(a), e = Er(a), n = /* @__PURE__ */ new Map();
3324
+ for (const y of a.nodes) {
3325
+ const k = e.get(y.id) ?? 0;
3326
+ n.set(k, [...n.get(k) ?? [], y]);
3327
+ }
3328
+ const i = [...n.entries()].sort(([y], [k]) => y - k), s = Math.max(1, ...i.map(([, y]) => y.length)), l = Math.max(1, i.length), o = t === "horizontal" ? dt * 2 + l * $t + (l - 1) * qt : dt * 2 + s * $t + (s - 1) * qt, p = t === "horizontal" ? dt * 2 + s * Lt + (s - 1) * Yt : dt * 2 + l * Lt + (l - 1) * Yt, c = [];
3329
+ for (const [y, [, k]] of i.entries()) {
3330
+ const A = (s - k.length) * (t === "horizontal" ? Lt + Yt : $t + qt) / 2;
3331
+ for (const [E, O] of k.entries()) {
3332
+ const Z = t === "horizontal" ? dt + y * ($t + qt) : dt + A + E * ($t + qt), I = t === "horizontal" ? dt + A + E * (Lt + Yt) : dt + y * (Lt + Yt);
3338
3333
  c.push({
3339
- id: z.id,
3340
- label: z.label,
3341
- ...z.detail ? { detail: z.detail } : {},
3342
- ...z.kind ? { kind: z.kind } : {},
3334
+ id: O.id,
3335
+ label: O.label,
3336
+ ...O.detail ? { detail: O.detail } : {},
3337
+ ...O.kind ? { kind: O.kind } : {},
3343
3338
  x: Z,
3344
- y: L,
3339
+ y: I,
3345
3340
  width: $t,
3346
3341
  height: Lt
3347
3342
  });
3348
3343
  }
3349
3344
  }
3350
- const y = new Map(c.map((b) => [b.id, b])), R = a.edges.flatMap((b, k) => {
3351
- const A = y.get(b.from), _ = y.get(b.to);
3352
- if (!A || !_)
3345
+ const b = new Map(c.map((y) => [y.id, y])), R = a.edges.flatMap((y, k) => {
3346
+ const A = b.get(y.from), E = b.get(y.to);
3347
+ if (!A || !E)
3353
3348
  return [];
3354
- const z = t === "horizontal" ? A.x + A.width : A.x + A.width / 2, Z = t === "horizontal" ? A.y + A.height / 2 : A.y + A.height, L = t === "horizontal" ? _.x : _.x + _.width / 2, I = t === "horizontal" ? _.y + _.height / 2 : _.y;
3349
+ const O = t === "horizontal" ? A.x + A.width : A.x + A.width / 2, Z = t === "horizontal" ? A.y + A.height / 2 : A.y + A.height, I = t === "horizontal" ? E.x : E.x + E.width / 2, $ = t === "horizontal" ? E.y + E.height / 2 : E.y;
3355
3350
  return [{
3356
- key: `${b.from}-${b.to}-${k}`,
3357
- from: b.from,
3358
- to: b.to,
3359
- ...b.label ? { label: b.label } : {},
3360
- x1: z,
3351
+ key: `${y.from}-${y.to}-${k}`,
3352
+ from: y.from,
3353
+ to: y.to,
3354
+ ...y.label ? { label: y.label } : {},
3355
+ x1: O,
3361
3356
  y1: Z,
3362
- x2: L,
3363
- y2: I,
3364
- labelX: (z + L) / 2,
3365
- labelY: (Z + I) / 2
3357
+ x2: I,
3358
+ y2: $,
3359
+ labelX: (O + I) / 2,
3360
+ labelY: (Z + $) / 2
3366
3361
  }];
3367
3362
  });
3368
3363
  return { width: o, height: p, orientation: t, nodes: c, edges: R };
3369
3364
  }
3370
3365
  d(Rr, "layoutChatDiagram");
3371
- function ia(a) {
3366
+ function ra(a) {
3372
3367
  const { value: t } = a, e = Math.abs(t);
3373
3368
  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);
3374
3369
  }
3375
- d(ia, "formatChatVisualValue");
3376
- function ra(a) {
3370
+ d(ra, "formatChatVisualValue");
3371
+ function la(a) {
3377
3372
  const { seconds: t } = a, e = Math.round(Math.abs(t)), n = t < 0 ? "-" : "";
3378
3373
  if (e < 60)
3379
3374
  return `${n}${e}s`;
@@ -3384,33 +3379,33 @@ function ra(a) {
3384
3379
  const i = Math.floor(e / 3600), s = Math.floor(e % 3600 / 60);
3385
3380
  return s ? `${n}${i}h ${s}m` : `${n}${i}h`;
3386
3381
  }
3387
- d(ra, "formatChatVisualDuration");
3388
- function la(a) {
3382
+ d(la, "formatChatVisualDuration");
3383
+ function oa(a) {
3389
3384
  return {
3390
3385
  prefix: a?.valuePrefix ?? (a?.valueFormat === "currency" ? "$" : ""),
3391
3386
  suffix: a?.valueSuffix ?? (a?.valueFormat === "percent" ? "%" : "")
3392
3387
  };
3393
3388
  }
3394
- d(la, "affixes");
3395
- function Dn(a) {
3396
- const { value: t, series: e } = a, { prefix: n, suffix: i } = la(e);
3389
+ d(oa, "affixes");
3390
+ function On(a) {
3391
+ const { value: t, series: e } = a, { prefix: n, suffix: i } = oa(e);
3397
3392
  let s;
3398
3393
  switch (e?.valueFormat) {
3399
3394
  case "integer":
3400
3395
  s = `${Math.round(t)}`;
3401
3396
  break;
3402
3397
  case "duration":
3403
- s = ra({ seconds: t });
3398
+ s = la({ seconds: t });
3404
3399
  break;
3405
3400
  case "raw":
3406
3401
  s = Number.isInteger(t) ? `${t}` : t.toFixed(1);
3407
3402
  break;
3408
3403
  default:
3409
- s = ia({ value: t });
3404
+ s = ra({ value: t });
3410
3405
  }
3411
3406
  return `${n}${s}${i}`;
3412
3407
  }
3413
- d(Dn, "formatChatVisualSeriesValue");
3408
+ d(On, "formatChatVisualSeriesValue");
3414
3409
  function Mr(a) {
3415
3410
  const [t, ...e] = a.series;
3416
3411
  return t && e.every(
@@ -3421,30 +3416,30 @@ d(Mr, "resolveSharedSeriesFormat");
3421
3416
  function Cr(a) {
3422
3417
  const { value: t, shared: e } = a;
3423
3418
  if (e?.valueFormat === "duration")
3424
- return ra({ seconds: t });
3425
- const { prefix: n, suffix: i } = la(e);
3426
- return `${n}${ia({ value: t })}${i}`;
3419
+ return la({ seconds: t });
3420
+ const { prefix: n, suffix: i } = oa(e);
3421
+ return `${n}${ra({ value: t })}${i}`;
3427
3422
  }
3428
3423
  d(Cr, "formatChatVisualTick");
3429
- const Ir = 5.4, $r = 10, Lr = 15, Os = 16, Dr = -40, zs = 36;
3424
+ const Ir = 5.4, $r = 10, Lr = 15, zs = 16, Dr = -40, Ns = 36;
3430
3425
  function Or(a) {
3431
3426
  const { labels: t, plotWidth: e } = a;
3432
3427
  if (!t.length || e <= 0)
3433
3428
  return { mode: "horizontal", entries: [] };
3434
- const n = t.map((c) => c.length > Os ? `${c.slice(0, Os - 1).trimEnd()}…` : c), i = t.length - 1;
3429
+ const n = t.map((c) => c.length > zs ? `${c.slice(0, zs - 1).trimEnd()}…` : c), i = t.length - 1;
3435
3430
  if (i === 0)
3436
3431
  return { mode: "horizontal", entries: [{ index: 0, text: n[0] }] };
3437
3432
  if ((Math.max(...n.map((c) => c.length * Ir)) + $r) * t.length <= e)
3438
- return { mode: "horizontal", entries: n.map((c, y) => ({ index: y, text: c })) };
3433
+ return { mode: "horizontal", entries: n.map((c, b) => ({ index: b, text: c })) };
3439
3434
  const l = Math.max(2, Math.floor(e / Lr));
3440
3435
  if (t.length <= l)
3441
- return { mode: "angled", entries: n.map((c, y) => ({ index: y, text: c })) };
3436
+ return { mode: "angled", entries: n.map((c, b) => ({ index: b, text: c })) };
3442
3437
  const o = /* @__PURE__ */ new Set([0, i]), p = i / (l - 1);
3443
3438
  for (let c = 1; c < l - 1; c++)
3444
3439
  o.add(Math.round(c * p));
3445
3440
  return {
3446
3441
  mode: "angled",
3447
- entries: [...o].sort((c, y) => c - y).map((c) => ({ index: c, text: n[c] }))
3442
+ entries: [...o].sort((c, b) => c - b).map((c) => ({ index: c, text: n[c] }))
3448
3443
  };
3449
3444
  }
3450
3445
  d(Or, "planChatVisualXLabels");
@@ -3452,7 +3447,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3452
3447
  key: 0,
3453
3448
  "data-test": "chat-visual-horizontal-bars",
3454
3449
  class: "grid gap-3"
3455
- }, Fr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Ur = ["viewBox"], Hr = ["x1", "x2", "y1", "y2"], jr = ["x", "y"], Wr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Gr = ["data-trend-key", "d"], Vr = ["d"], qr = ["cx", "cy"], Kr = ["cx", "cy"], Yr = ["x", "y", "text-anchor", "transform"], Xr = {
3450
+ }, Fr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Ur = ["viewBox"], Hr = ["x1", "x2", "y1", "y2"], jr = ["x", "y"], Wr = ["data-row-index", "data-series-index", "data-data-key", "x", "y", "width", "height"], Gr = ["data-trend-key", "d"], Vr = ["d"], qr = ["cx", "cy"], Yr = ["cx", "cy"], Kr = ["x", "y", "text-anchor", "transform"], Xr = {
3456
3451
  key: 2,
3457
3452
  class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
3458
3453
  }, Zr = {
@@ -3477,11 +3472,11 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3477
3472
  return g?.chartType === "pie";
3478
3473
  }
3479
3474
  d(l, "isPieChart");
3480
- const o = S(() => n.value?.data ?? []), p = S(() => s(n.value) ? n.value : null), c = S(() => p.value?.series ?? []), y = S(() => l(n.value) ? n.value : null), R = S(() => p.value?.chartType === "bar" && p.value.stacking === "stacked");
3481
- function b(g) {
3475
+ const o = S(() => n.value?.data ?? []), p = S(() => s(n.value) ? n.value : null), c = S(() => p.value?.series ?? []), b = S(() => l(n.value) ? n.value : null), R = S(() => p.value?.chartType === "bar" && p.value.stacking === "stacked");
3476
+ function y(g) {
3482
3477
  return typeof g == "number" && Number.isFinite(g) ? g : null;
3483
3478
  }
3484
- d(b, "numericValue");
3479
+ d(y, "numericValue");
3485
3480
  function k(g, M) {
3486
3481
  return String(g[M] ?? "").trim();
3487
3482
  }
@@ -3490,69 +3485,69 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3490
3485
  const u = g.map((D) => k(D, M)).filter(Boolean);
3491
3486
  if (!u.length)
3492
3487
  return !1;
3493
- const v = Math.max(...u.map((D) => D.length)), $ = u.reduce((D, J) => D + J.length, 0) / u.length;
3494
- return v >= 16 || u.length > 5 && $ >= 10;
3488
+ const v = Math.max(...u.map((D) => D.length)), L = u.reduce((D, Q) => D + Q.length, 0) / u.length;
3489
+ return v >= 16 || u.length > 5 && L >= 10;
3495
3490
  }
3496
3491
  d(A, "hasLongCategoryLabels");
3497
- function _(g, M) {
3492
+ function E(g, M) {
3498
3493
  return g.data.map((u, v) => {
3499
- const $ = b(u[M]);
3500
- return $ === null ? null : { index: v, value: $ };
3494
+ const L = y(u[M]);
3495
+ return L === null ? null : { index: v, value: L };
3501
3496
  }).filter((u) => u !== null);
3502
3497
  }
3503
- d(_, "trendLinePoints");
3504
- function z(g) {
3498
+ d(E, "trendLinePoints");
3499
+ function O(g) {
3505
3500
  if (g.length < 2) return null;
3506
- const M = g.length, u = g.reduce((le, de) => le + de.index, 0), v = g.reduce((le, de) => le + de.value, 0), $ = g.reduce((le, de) => le + de.index * de.index, 0), D = g.reduce((le, de) => le + de.index * de.value, 0), J = M * $ - u * u;
3507
- if (J === 0) return null;
3508
- const pe = (M * D - u * v) / J, ke = (v - pe * u) / M;
3501
+ const M = g.length, u = g.reduce((le, de) => le + de.index, 0), v = g.reduce((le, de) => le + de.value, 0), L = g.reduce((le, de) => le + de.index * de.index, 0), D = g.reduce((le, de) => le + de.index * de.value, 0), Q = M * L - u * u;
3502
+ if (Q === 0) return null;
3503
+ const pe = (M * D - u * v) / Q, ke = (v - pe * u) / M;
3509
3504
  return { slope: pe, intercept: ke };
3510
3505
  }
3511
- d(z, "linearTrend");
3506
+ d(O, "linearTrend");
3512
3507
  const Z = S(() => {
3513
3508
  const g = [], M = p.value;
3514
3509
  if (!M) return g;
3515
3510
  if (M.chartType === "bar" && M.stacking === "stacked")
3516
3511
  for (const u of M.data) {
3517
- let v = 0, $ = 0;
3512
+ let v = 0, L = 0;
3518
3513
  for (const D of M.series) {
3519
- const J = b(u[D.dataKey]);
3520
- J !== null && (J >= 0 ? v += J : $ += J);
3514
+ const Q = y(u[D.dataKey]);
3515
+ Q !== null && (Q >= 0 ? v += Q : L += Q);
3521
3516
  }
3522
- g.push(v, $);
3517
+ g.push(v, L);
3523
3518
  }
3524
3519
  else
3525
3520
  for (const u of M.data)
3526
3521
  for (const v of M.series) {
3527
- const $ = b(u[v.dataKey]);
3528
- $ !== null && g.push($);
3522
+ const L = y(u[v.dataKey]);
3523
+ L !== null && g.push(L);
3529
3524
  }
3530
3525
  if (M.trendLine && (M.chartType === "line" || M.chartType === "scatter")) {
3531
- const u = _(M, M.trendLine.dataKey);
3532
- g.push(...u.map(($) => $.value));
3533
- const v = z(u);
3526
+ const u = E(M, M.trendLine.dataKey);
3527
+ g.push(...u.map((L) => L.value));
3528
+ const v = O(u);
3534
3529
  if (v && u.length) {
3535
- const $ = u[0].index, D = u[u.length - 1].index;
3536
- g.push(v.intercept + v.slope * $, v.intercept + v.slope * D);
3530
+ const L = u[0].index, D = u[u.length - 1].index;
3531
+ g.push(v.intercept + v.slope * L, v.intercept + v.slope * D);
3537
3532
  }
3538
3533
  }
3539
3534
  return g;
3540
3535
  });
3541
- function L(g, M) {
3542
- const u = g > 0 ? g : 1, v = Math.floor(Math.log10(u)), $ = u / 10 ** v;
3536
+ function I(g, M) {
3537
+ const u = g > 0 ? g : 1, v = Math.floor(Math.log10(u)), L = u / 10 ** v;
3543
3538
  let D;
3544
- return M ? D = $ < 1.5 ? 1 : $ < 3 ? 2 : $ < 7 ? 5 : 10 : D = $ <= 1 ? 1 : $ <= 2 ? 2 : $ <= 5 ? 5 : 10, D * 10 ** v;
3539
+ return M ? D = L < 1.5 ? 1 : L < 3 ? 2 : L < 7 ? 5 : 10 : D = L <= 1 ? 1 : L <= 2 ? 2 : L <= 5 ? 5 : 10, D * 10 ** v;
3545
3540
  }
3546
- d(L, "niceNum");
3547
- const I = S(() => {
3541
+ d(I, "niceNum");
3542
+ const $ = S(() => {
3548
3543
  const g = Z.value, M = g.length ? Math.max(0, ...g) : 1, u = g.length ? Math.min(0, ...g) : 0;
3549
3544
  if (u === M)
3550
3545
  return { min: 0, max: M || 1, ticks: [0, M || 1] };
3551
- const v = 4, $ = L(M - u, !1), D = L($ / (v - 1), !0), J = Math.floor(u / D) * D, pe = Math.ceil(M / D) * D, ke = [];
3552
- for (let le = J; le <= pe + D * 0.5; le += D)
3546
+ const v = 4, L = I(M - u, !1), D = I(L / (v - 1), !0), Q = Math.floor(u / D) * D, pe = Math.ceil(M / D) * D, ke = [];
3547
+ for (let le = Q; le <= pe + D * 0.5; le += D)
3553
3548
  ke.push(Number(le.toFixed(6)));
3554
- return { min: J, max: pe, ticks: ke };
3555
- }), O = S(() => Mr({ series: c.value })), H = S(() => {
3549
+ return { min: Q, max: pe, ticks: ke };
3550
+ }), N = S(() => Mr({ series: c.value })), W = S(() => {
3556
3551
  const g = p.value;
3557
3552
  if (!g)
3558
3553
  return { mode: "horizontal", entries: [] };
@@ -3565,66 +3560,66 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3565
3560
  plotWidth: 318
3566
3561
  });
3567
3562
  }), B = S(() => {
3568
- const g = O.value?.valueFormat, M = !!(O.value && (g === "currency" || g === "percent" || O.value.valuePrefix || O.value.valueSuffix)), u = g === "duration" ? 46 : M ? 38 : 30, v = H.value.mode === "angled";
3563
+ const g = N.value?.valueFormat, M = !!(N.value && (g === "currency" || g === "percent" || N.value.valuePrefix || N.value.valueSuffix)), u = g === "duration" ? 46 : M ? 38 : 30, v = W.value.mode === "angled";
3569
3564
  return {
3570
3565
  width: 360,
3571
- height: 168 + (v ? zs : 0),
3566
+ height: 168 + (v ? Ns : 0),
3572
3567
  left: u,
3573
3568
  right: 12,
3574
3569
  top: 10,
3575
- bottom: 24 + (v ? zs : 0)
3570
+ bottom: 24 + (v ? Ns : 0)
3576
3571
  };
3577
3572
  });
3578
3573
  function V(g, M) {
3579
3574
  const u = p.value, v = B.value;
3580
3575
  if (u?.chartType === "bar") {
3581
- const $ = v.width - v.left - v.right;
3582
- return v.left + (g + 0.5) * ($ / Math.max(M, 1));
3576
+ const L = v.width - v.left - v.right;
3577
+ return v.left + (g + 0.5) * (L / Math.max(M, 1));
3583
3578
  }
3584
- return ee(g, M);
3579
+ return J(g, M);
3585
3580
  }
3586
3581
  d(V, "labelCenterX");
3587
- function ee(g, M) {
3582
+ function J(g, M) {
3588
3583
  const u = B.value, v = u.width - u.left - u.right;
3589
3584
  return M <= 1 ? u.left + v / 2 : u.left + v * g / (M - 1);
3590
3585
  }
3591
- d(ee, "xForIndex");
3586
+ d(J, "xForIndex");
3592
3587
  function ue(g) {
3593
- const { min: M, max: u } = I.value, v = B.value, $ = v.height - v.top - v.bottom;
3594
- return v.top + (u - g) / (u - M || 1) * $;
3588
+ const { min: M, max: u } = $.value, v = B.value, L = v.height - v.top - v.bottom;
3589
+ return v.top + (u - g) / (u - M || 1) * L;
3595
3590
  }
3596
3591
  d(ue, "yForValue");
3597
3592
  function Ae(g) {
3598
3593
  const M = p.value;
3599
3594
  return M ? M.data.map((u, v) => {
3600
- const $ = b(u[g]) ?? 0;
3601
- return `${v === 0 ? "M" : "L"} ${ee(v, M.data.length).toFixed(1)} ${ue($).toFixed(1)}`;
3595
+ const L = y(u[g]) ?? 0;
3596
+ return `${v === 0 ? "M" : "L"} ${J(v, M.data.length).toFixed(1)} ${ue(L).toFixed(1)}`;
3602
3597
  }).join(" ") : "";
3603
3598
  }
3604
3599
  d(Ae, "pathForSeries");
3605
3600
  const Pe = S(() => {
3606
3601
  const g = p.value;
3607
3602
  if (!g?.trendLine || g.chartType !== "line" && g.chartType !== "scatter") return null;
3608
- const M = _(g, g.trendLine.dataKey), u = z(M);
3603
+ const M = E(g, g.trendLine.dataKey), u = O(M);
3609
3604
  if (!u || !M.length) return null;
3610
- const v = M[0].index, $ = M[M.length - 1].index, D = u.intercept + u.slope * v, J = u.intercept + u.slope * $, pe = Math.max(0, g.series.findIndex((ke) => ke.dataKey === g.trendLine?.dataKey));
3605
+ const v = M[0].index, L = M[M.length - 1].index, D = u.intercept + u.slope * v, Q = u.intercept + u.slope * L, pe = Math.max(0, g.series.findIndex((ke) => ke.dataKey === g.trendLine?.dataKey));
3611
3606
  return {
3612
- path: `M ${ee(v, g.data.length).toFixed(1)} ${ue(D).toFixed(1)} L ${ee($, g.data.length).toFixed(1)} ${ue(J).toFixed(1)}`,
3607
+ path: `M ${J(v, g.data.length).toFixed(1)} ${ue(D).toFixed(1)} L ${J(L, g.data.length).toFixed(1)} ${ue(Q).toFixed(1)}`,
3613
3608
  dataKey: g.trendLine.dataKey,
3614
3609
  seriesIndex: pe
3615
3610
  };
3616
3611
  }), St = S(() => {
3617
3612
  const g = p.value;
3618
3613
  if (!g || g.chartType !== "bar") return [];
3619
- const M = B.value, v = (M.width - M.left - M.right) / Math.max(g.data.length, 1), $ = ue(0);
3614
+ const M = B.value, v = (M.width - M.left - M.right) / Math.max(g.data.length, 1), L = ue(0);
3620
3615
  if (R.value) {
3621
3616
  const le = Math.max(4, Math.min(24, v * 0.42));
3622
3617
  return g.data.flatMap((de, $e) => {
3623
- let Ye = 0, je = 0;
3618
+ let Ke = 0, je = 0;
3624
3619
  const ze = M.left + $e * v + (v - le) / 2;
3625
3620
  return g.series.map((Fe, Xe) => {
3626
- const E = b(de[Fe.dataKey]) ?? 0, m = E >= 0 ? Ye : je, T = m + E, ae = ue(m), U = ue(T);
3627
- return E >= 0 ? Ye = T : je = T, {
3621
+ const _ = y(de[Fe.dataKey]) ?? 0, m = _ >= 0 ? Ke : je, T = m + _, ae = ue(m), U = ue(T);
3622
+ return _ >= 0 ? Ke = T : je = T, {
3628
3623
  key: `${$e}-${Fe.dataKey}`,
3629
3624
  x: ze,
3630
3625
  y: Math.min(ae, U),
@@ -3637,16 +3632,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3637
3632
  });
3638
3633
  });
3639
3634
  }
3640
- const D = Math.max(g.series.length, 1), J = D > 1 ? 2 : 0, pe = Math.max(3, Math.min(20, (v * 0.62 - J * (D - 1)) / D)), ke = pe * D + J * (D - 1);
3641
- return g.data.flatMap((le, de) => g.series.map(($e, Ye) => {
3642
- const je = b(le[$e.dataKey]) ?? 0, ze = ue(je), Fe = M.left + de * v + (v - ke) / 2 + Ye * (pe + J);
3635
+ const D = Math.max(g.series.length, 1), Q = D > 1 ? 2 : 0, pe = Math.max(3, Math.min(20, (v * 0.62 - Q * (D - 1)) / D)), ke = pe * D + Q * (D - 1);
3636
+ return g.data.flatMap((le, de) => g.series.map(($e, Ke) => {
3637
+ const je = y(le[$e.dataKey]) ?? 0, ze = ue(je), Fe = M.left + de * v + (v - ke) / 2 + Ke * (pe + Q);
3643
3638
  return {
3644
3639
  key: `${de}-${$e.dataKey}`,
3645
3640
  x: Fe,
3646
- y: Math.min(ze, $),
3641
+ y: Math.min(ze, L),
3647
3642
  width: pe,
3648
- height: Math.max(1.5, Math.abs($ - ze)),
3649
- seriesIndex: Ye,
3643
+ height: Math.max(1.5, Math.abs(L - ze)),
3644
+ seriesIndex: Ke,
3650
3645
  rowIndex: de,
3651
3646
  dataKey: $e.dataKey
3652
3647
  };
@@ -3656,32 +3651,32 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3656
3651
  if (!g) return [];
3657
3652
  const M = g.data;
3658
3653
  if (!M.length) return [];
3659
- const u = M.length - 1, v = H.value, $ = v.mode === "angled";
3660
- return v.entries.map(({ index: D, text: J }) => ({
3654
+ const u = M.length - 1, v = W.value, L = v.mode === "angled";
3655
+ return v.entries.map(({ index: D, text: Q }) => ({
3661
3656
  key: `${D}`,
3662
- label: J,
3657
+ label: Q,
3663
3658
  x: V(D, M.length),
3664
- anchor: $ ? "end" : D === 0 ? "start" : D === u ? "end" : "middle",
3665
- angled: $
3659
+ anchor: L ? "end" : D === 0 ? "start" : D === u ? "end" : "middle",
3660
+ angled: L
3666
3661
  })).filter((D) => D.label);
3667
3662
  }), se = S(() => {
3668
3663
  const g = p.value;
3669
3664
  if (!g || g.chartType !== "bar" || g.series.length !== 1 || R.value)
3670
3665
  return [];
3671
- const M = g.series[0], u = g.data.map((D, J) => {
3672
- const pe = k(D, g.xKey), ke = b(D[M.dataKey]);
3673
- return !pe || ke === null ? null : { key: `${J}-${pe}`, label: pe, rawValue: ke };
3666
+ const M = g.series[0], u = g.data.map((D, Q) => {
3667
+ const pe = k(D, g.xKey), ke = y(D[M.dataKey]);
3668
+ return !pe || ke === null ? null : { key: `${Q}-${pe}`, label: pe, rawValue: ke };
3674
3669
  }).filter((D) => D !== null);
3675
3670
  if (!u.length || u.some((D) => D.rawValue < 0))
3676
3671
  return [];
3677
3672
  if (!(g.layout === "horizontal" || A(g.data, g.xKey)))
3678
3673
  return [];
3679
- const $ = Math.max(...u.map((D) => D.rawValue), 1);
3674
+ const L = Math.max(...u.map((D) => D.rawValue), 1);
3680
3675
  return u.map((D) => ({
3681
3676
  key: D.key,
3682
3677
  label: D.label,
3683
- value: Dn({ value: D.rawValue, series: M }),
3684
- width: D.rawValue <= 0 ? 0 : Math.max(2, D.rawValue / $ * 100),
3678
+ value: On({ value: D.rawValue, series: M }),
3679
+ width: D.rawValue <= 0 ? 0 : Math.max(2, D.rawValue / L * 100),
3685
3680
  seriesIndex: 0
3686
3681
  }));
3687
3682
  }), st = S(() => {
@@ -3689,34 +3684,34 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3689
3684
  if (!g?.data.length) return [];
3690
3685
  const M = g.data[g.data.length - 1];
3691
3686
  return g.series.map((u, v) => {
3692
- const $ = b(M?.[u.dataKey]);
3687
+ const L = y(M?.[u.dataKey]);
3693
3688
  return {
3694
3689
  key: u.dataKey,
3695
3690
  label: u.label || u.dataKey,
3696
- value: $ === null ? "—" : Dn({ value: $, series: u }),
3691
+ value: L === null ? "—" : On({ value: L, series: u }),
3697
3692
  seriesIndex: v
3698
3693
  };
3699
3694
  });
3700
- }), Ke = S(() => {
3695
+ }), Ye = S(() => {
3701
3696
  const g = p.value;
3702
3697
  if (!g?.data.length || g.chartType !== "line") return [];
3703
3698
  const M = g.data.length - 1, u = g.data[M];
3704
- return g.series.map((v, $) => {
3705
- const D = b(u?.[v.dataKey]);
3706
- return D === null ? null : { key: v.dataKey, cx: ee(M, g.data.length), cy: ue(D), seriesIndex: $ };
3699
+ return g.series.map((v, L) => {
3700
+ const D = y(u?.[v.dataKey]);
3701
+ return D === null ? null : { key: v.dataKey, cx: J(M, g.data.length), cy: ue(D), seriesIndex: L };
3707
3702
  }).filter((v) => v !== null);
3708
3703
  }), at = S(() => {
3709
- const g = y.value;
3704
+ const g = b.value;
3710
3705
  if (!g) return [];
3711
- const M = g.data.map(($) => ({
3712
- name: String($[g.nameKey] ?? ""),
3713
- value: b($[g.valueKey]) ?? 0
3714
- })).filter(($) => $.name && $.value >= 0).sort(($, D) => D.value - $.value), u = M.reduce(($, D) => $ + D.value, 0) || 1, v = g.series?.[0];
3715
- return M.map(($, D) => ({
3716
- ...$,
3717
- key: `${D}-${$.name}`,
3718
- percent: $.value / u,
3719
- display: Dn({ value: $.value, series: v })
3706
+ const M = g.data.map((L) => ({
3707
+ name: String(L[g.nameKey] ?? ""),
3708
+ value: y(L[g.valueKey]) ?? 0
3709
+ })).filter((L) => L.name && L.value >= 0).sort((L, D) => D.value - L.value), u = M.reduce((L, D) => L + D.value, 0) || 1, v = g.series?.[0];
3710
+ return M.map((L, D) => ({
3711
+ ...L,
3712
+ key: `${D}-${L.name}`,
3713
+ percent: L.value / u,
3714
+ display: On({ value: L.value, series: v })
3720
3715
  }));
3721
3716
  }), Oe = S(() => i.value ? Rr(i.value) : null), gt = [
3722
3717
  "var(--color-theme-900)",
@@ -3740,7 +3735,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3740
3735
  return g === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Be.value;
3741
3736
  }
3742
3737
  d(Ce, "diagramNodeStroke");
3743
- const Y = S(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), be = S(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), ie = S(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), Ie = S(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), re = S(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Be = S(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), rt = S(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), ye = S(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
3738
+ const K = S(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = S(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), ie = S(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), Ie = S(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), re = S(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Be = S(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), rt = S(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), be = S(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
3744
3739
  return (g, M) => e.value ? (h(), f("section", {
3745
3740
  key: 0,
3746
3741
  "data-test": "chat-visual",
@@ -3755,13 +3750,13 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3755
3750
  w("header", Nr, [
3756
3751
  w("h4", {
3757
3752
  class: "text-[13px] font-semibold leading-tight",
3758
- style: q({ color: Y.value })
3759
- }, W(e.value.meta.title), 5),
3753
+ style: q({ color: K.value })
3754
+ }, j(e.value.meta.title), 5),
3760
3755
  e.value.meta.description ? (h(), f("p", {
3761
3756
  key: 0,
3762
3757
  class: "mt-0.5 text-[12px] leading-snug",
3763
- style: q({ color: be.value })
3764
- }, W(e.value.meta.description), 5)) : j("", !0)
3758
+ style: q({ color: ye.value })
3759
+ }, j(e.value.meta.description), 5)) : H("", !0)
3765
3760
  ]),
3766
3761
  p.value ? (h(), f("div", {
3767
3762
  key: 0,
@@ -3769,7 +3764,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3769
3764
  "aria-label": e.value.meta.title
3770
3765
  }, [
3771
3766
  se.value.length ? (h(), f("div", Br, [
3772
- (h(!0), f(Q, null, me(se.value, (u) => (h(), f("div", {
3767
+ (h(!0), f(ee, null, me(se.value, (u) => (h(), f("div", {
3773
3768
  key: u.key,
3774
3769
  "data-test": "chat-visual-horizontal-bar",
3775
3770
  class: "min-w-0"
@@ -3777,16 +3772,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3777
3772
  w("div", Fr, [
3778
3773
  w("span", {
3779
3774
  class: "line-clamp-2 min-w-0 font-medium leading-snug",
3780
- style: q({ color: Y.value })
3781
- }, W(u.label), 5),
3775
+ style: q({ color: K.value })
3776
+ }, j(u.label), 5),
3782
3777
  w("span", {
3783
3778
  class: "shrink-0 font-semibold tabular-nums",
3784
- style: q({ color: Y.value })
3785
- }, W(u.value), 5)
3779
+ style: q({ color: K.value })
3780
+ }, j(u.value), 5)
3786
3781
  ]),
3787
3782
  w("div", {
3788
3783
  class: "h-2 w-full overflow-hidden rounded-full",
3789
- style: q({ background: ye.value })
3784
+ style: q({ background: be.value })
3790
3785
  }, [
3791
3786
  w("div", {
3792
3787
  class: "h-full rounded-full",
@@ -3802,7 +3797,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3802
3797
  preserveAspectRatio: "xMidYMid meet",
3803
3798
  "aria-hidden": "true"
3804
3799
  }, [
3805
- (h(!0), f(Q, null, me(I.value.ticks, (u) => (h(), f("line", {
3800
+ (h(!0), f(ee, null, me($.value.ticks, (u) => (h(), f("line", {
3806
3801
  key: `grid-${u}`,
3807
3802
  x1: B.value.left,
3808
3803
  x2: B.value.width - B.value.right,
@@ -3813,16 +3808,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3813
3808
  style: q({ stroke: u === 0 ? re.value : Ie.value })
3814
3809
  }, null, 12, Hr))), 128)),
3815
3810
  w("g", null, [
3816
- (h(!0), f(Q, null, me(I.value.ticks, (u) => (h(), f("text", {
3811
+ (h(!0), f(ee, null, me($.value.ticks, (u) => (h(), f("text", {
3817
3812
  key: `y-${u}`,
3818
3813
  x: B.value.left - 7,
3819
3814
  y: ue(u) + 3,
3820
3815
  "text-anchor": "end",
3821
3816
  "font-size": "9.5",
3822
3817
  style: q({ fill: ie.value })
3823
- }, W(en(Cr)({ value: u, shared: O.value })), 13, jr))), 128))
3818
+ }, j(en(Cr)({ value: u, shared: N.value })), 13, jr))), 128))
3824
3819
  ]),
3825
- p.value.chartType === "bar" ? (h(!0), f(Q, { key: 0 }, me(St.value, (u) => (h(), f("rect", {
3820
+ p.value.chartType === "bar" ? (h(!0), f(ee, { key: 0 }, me(St.value, (u) => (h(), f("rect", {
3826
3821
  key: u.key,
3827
3822
  "data-test": "chat-visual-bar",
3828
3823
  "data-row-index": u.rowIndex,
@@ -3834,7 +3829,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3834
3829
  height: u.height,
3835
3830
  rx: "2.5",
3836
3831
  style: q({ fill: Me(u.seriesIndex) })
3837
- }, null, 12, Wr))), 128)) : (h(), f(Q, { key: 1 }, [
3832
+ }, null, 12, Wr))), 128)) : (h(), f(ee, { key: 1 }, [
3838
3833
  Pe.value ? (h(), f("path", {
3839
3834
  key: 0,
3840
3835
  "data-test": "chat-visual-trend-line",
@@ -3847,8 +3842,8 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3847
3842
  "stroke-dasharray": "4 3",
3848
3843
  "vector-effect": "non-scaling-stroke",
3849
3844
  style: q({ stroke: Me(Pe.value.seriesIndex) })
3850
- }, null, 12, Gr)) : j("", !0),
3851
- (h(!0), f(Q, null, me(c.value, (u, v) => (h(), f("g", {
3845
+ }, null, 12, Gr)) : H("", !0),
3846
+ (h(!0), f(ee, null, me(c.value, (u, v) => (h(), f("g", {
3852
3847
  key: u.dataKey
3853
3848
  }, [
3854
3849
  p.value.chartType === "line" ? (h(), f("path", {
@@ -3860,28 +3855,28 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3860
3855
  "stroke-linejoin": "round",
3861
3856
  "vector-effect": "non-scaling-stroke",
3862
3857
  style: q({ stroke: Me(v) })
3863
- }, null, 12, Vr)) : j("", !0),
3864
- (h(!0), f(Q, null, me(o.value, ($, D) => (h(), f(Q, {
3858
+ }, null, 12, Vr)) : H("", !0),
3859
+ (h(!0), f(ee, null, me(o.value, (L, D) => (h(), f(ee, {
3865
3860
  key: `${u.dataKey}-${D}`
3866
3861
  }, [
3867
3862
  p.value.chartType === "scatter" ? (h(), f("circle", {
3868
3863
  key: 0,
3869
- cx: ee(D, o.value.length),
3870
- cy: ue(b($[u.dataKey]) ?? 0),
3864
+ cx: J(D, o.value.length),
3865
+ cy: ue(y(L[u.dataKey]) ?? 0),
3871
3866
  r: "2.6",
3872
3867
  style: q({ fill: Me(v) })
3873
- }, null, 12, qr)) : j("", !0)
3868
+ }, null, 12, qr)) : H("", !0)
3874
3869
  ], 64))), 128))
3875
3870
  ]))), 128)),
3876
- (h(!0), f(Q, null, me(Ke.value, (u) => (h(), f("circle", {
3871
+ (h(!0), f(ee, null, me(Ye.value, (u) => (h(), f("circle", {
3877
3872
  key: `marker-${u.key}`,
3878
3873
  cx: u.cx,
3879
3874
  cy: u.cy,
3880
3875
  r: "3",
3881
3876
  style: q({ fill: Me(u.seriesIndex) })
3882
- }, null, 12, Kr))), 128))
3877
+ }, null, 12, Yr))), 128))
3883
3878
  ], 64)),
3884
- (h(!0), f(Q, null, me(De.value, (u) => (h(), f("text", {
3879
+ (h(!0), f(ee, null, me(De.value, (u) => (h(), f("text", {
3885
3880
  key: u.key,
3886
3881
  x: u.x,
3887
3882
  y: u.angled ? B.value.height - B.value.bottom + 12 : B.value.height - 6,
@@ -3889,10 +3884,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3889
3884
  "font-size": "9.5",
3890
3885
  transform: u.angled ? `rotate(${en(Dr)} ${u.x} ${B.value.height - B.value.bottom + 12})` : void 0,
3891
3886
  style: q({ fill: ie.value })
3892
- }, W(u.label), 13, Yr))), 128))
3887
+ }, j(u.label), 13, Kr))), 128))
3893
3888
  ], 12, Ur)),
3894
3889
  st.value.length > 1 || p.value.chartType !== "bar" ? (h(), f("div", Xr, [
3895
- (h(!0), f(Q, null, me(st.value, (u) => (h(), f("div", {
3890
+ (h(!0), f(ee, null, me(st.value, (u) => (h(), f("div", {
3896
3891
  key: u.key,
3897
3892
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
3898
3893
  }, [
@@ -3901,37 +3896,37 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3901
3896
  style: q({ background: Me(u.seriesIndex) })
3902
3897
  }, null, 4),
3903
3898
  w("span", {
3904
- style: q({ color: be.value })
3905
- }, W(u.label), 5),
3899
+ style: q({ color: ye.value })
3900
+ }, j(u.label), 5),
3906
3901
  w("span", {
3907
3902
  class: "font-semibold tabular-nums",
3908
- style: q({ color: Y.value })
3909
- }, W(u.value), 5)
3903
+ style: q({ color: K.value })
3904
+ }, j(u.value), 5)
3910
3905
  ]))), 128))
3911
- ])) : j("", !0)
3912
- ], 8, Pr)) : y.value ? (h(), f("div", Zr, [
3913
- (h(!0), f(Q, null, me(at.value, (u, v) => (h(), f("div", {
3906
+ ])) : H("", !0)
3907
+ ], 8, Pr)) : b.value ? (h(), f("div", Zr, [
3908
+ (h(!0), f(ee, null, me(at.value, (u, v) => (h(), f("div", {
3914
3909
  key: u.key
3915
3910
  }, [
3916
3911
  w("div", Jr, [
3917
3912
  w("span", {
3918
3913
  class: "truncate font-medium",
3919
- style: q({ color: Y.value })
3920
- }, W(u.name), 5),
3914
+ style: q({ color: K.value })
3915
+ }, j(u.name), 5),
3921
3916
  w("span", Qr, [
3922
3917
  w("span", {
3923
3918
  class: "font-semibold",
3924
- style: q({ color: Y.value })
3925
- }, W(u.display), 5),
3919
+ style: q({ color: K.value })
3920
+ }, j(u.display), 5),
3926
3921
  w("span", {
3927
3922
  class: "ml-1.5",
3928
- style: q({ color: be.value })
3929
- }, W(Math.round(u.percent * 100)) + "%", 5)
3923
+ style: q({ color: ye.value })
3924
+ }, j(Math.round(u.percent * 100)) + "%", 5)
3930
3925
  ])
3931
3926
  ]),
3932
3927
  w("div", {
3933
3928
  class: "h-1.5 w-full overflow-hidden rounded-full",
3934
- style: q({ background: ye.value })
3929
+ style: q({ background: be.value })
3935
3930
  }, [
3936
3931
  w("div", {
3937
3932
  class: "h-full rounded-full",
@@ -3948,7 +3943,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3948
3943
  role: "img",
3949
3944
  "aria-label": e.value.meta.title
3950
3945
  }, [
3951
- (h(!0), f(Q, null, me(Oe.value.edges, (u) => (h(), f("line", {
3946
+ (h(!0), f(ee, null, me(Oe.value.edges, (u) => (h(), f("line", {
3952
3947
  key: u.key,
3953
3948
  "data-test": "chat-visual-diagram-edge",
3954
3949
  "data-from": u.from,
@@ -3962,14 +3957,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3962
3957
  "vector-effect": "non-scaling-stroke",
3963
3958
  style: q({ stroke: rt.value })
3964
3959
  }, null, 12, nl))), 128)),
3965
- (h(!0), f(Q, null, me(Oe.value.edges, (u) => (h(), f("circle", {
3960
+ (h(!0), f(ee, null, me(Oe.value.edges, (u) => (h(), f("circle", {
3966
3961
  key: `${u.key}-dot`,
3967
3962
  cx: u.x2,
3968
3963
  cy: u.y2,
3969
3964
  r: "2.4",
3970
3965
  style: q({ fill: rt.value })
3971
3966
  }, null, 12, sl))), 128)),
3972
- (h(!0), f(Q, null, me(Oe.value.edges.filter((u) => u.label), (u) => (h(), f("foreignObject", {
3967
+ (h(!0), f(ee, null, me(Oe.value.edges.filter((u) => u.label), (u) => (h(), f("foreignObject", {
3973
3968
  key: `${u.key}-label`,
3974
3969
  x: u.labelX - 43,
3975
3970
  y: u.labelY - 11,
@@ -3979,10 +3974,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
3979
3974
  w("div", {
3980
3975
  xmlns: "http://www.w3.org/1999/xhtml",
3981
3976
  class: "flex h-full items-center justify-center px-1 text-center text-[8.5px] font-medium leading-none",
3982
- style: q({ color: be.value, background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)" })
3983
- }, W(u.label), 5)
3977
+ style: q({ color: ye.value, background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)" })
3978
+ }, j(u.label), 5)
3984
3979
  ], 8, al))), 128)),
3985
- (h(!0), f(Q, null, me(Oe.value.nodes, (u) => (h(), f("g", {
3980
+ (h(!0), f(ee, null, me(Oe.value.nodes, (u) => (h(), f("g", {
3986
3981
  key: u.id,
3987
3982
  "data-test": "chat-visual-diagram-node",
3988
3983
  "data-node-id": u.id,
@@ -4013,26 +4008,26 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4013
4008
  w("div", cl, [
4014
4009
  w("div", {
4015
4010
  class: "line-clamp-2 text-[10.5px] font-semibold leading-tight",
4016
- style: q({ color: Y.value })
4017
- }, W(u.label), 5),
4011
+ style: q({ color: K.value })
4012
+ }, j(u.label), 5),
4018
4013
  u.detail ? (h(), f("div", {
4019
4014
  key: 0,
4020
4015
  class: "mt-0.5 line-clamp-1 text-[8.5px] leading-none",
4021
- style: q({ color: be.value })
4022
- }, W(u.detail), 5)) : j("", !0)
4016
+ style: q({ color: ye.value })
4017
+ }, j(u.detail), 5)) : H("", !0)
4023
4018
  ])
4024
4019
  ], 8, ol))
4025
4020
  ], 8, il))), 128))
4026
4021
  ], 12, tl))
4027
- ])) : j("", !0),
4022
+ ])) : H("", !0),
4028
4023
  e.value.meta.footer ? (h(), f("footer", {
4029
4024
  key: 3,
4030
4025
  class: "mt-3 text-[11px] leading-snug",
4031
4026
  style: q({ color: ie.value })
4032
- }, W(e.value.meta.footer), 5)) : j("", !0)
4033
- ], 12, zr)) : j("", !0);
4027
+ }, j(e.value.meta.footer), 5)) : H("", !0)
4028
+ ], 12, zr)) : H("", !0);
4034
4029
  }
4035
- }), dl = ["innerHTML"], Yt = /* @__PURE__ */ Re({
4030
+ }), dl = ["innerHTML"], Kt = /* @__PURE__ */ Re({
4036
4031
  __name: "ChatRichText",
4037
4032
  props: {
4038
4033
  text: {},
@@ -4053,22 +4048,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4053
4048
  n = void 0, e.value = t.text;
4054
4049
  }));
4055
4050
  }
4056
- ), Us(() => {
4051
+ ), Hs(() => {
4057
4052
  n !== void 0 && cancelAnimationFrame(n);
4058
4053
  });
4059
4054
  const i = new te.Renderer();
4060
4055
  i.link = ({ href: k, text: A }) => {
4061
- const _ = k.trim();
4062
- if (!_ || _ === "#")
4056
+ const E = k.trim();
4057
+ if (!E || E === "#")
4063
4058
  return A;
4064
- let z = !1;
4059
+ let O = !1;
4065
4060
  if (typeof window < "u")
4066
4061
  try {
4067
- z = new URL(k, window.location.href).origin === window.location.origin;
4062
+ O = new URL(k, window.location.href).origin === window.location.origin;
4068
4063
  } catch {
4069
- z = !1;
4064
+ O = !1;
4070
4065
  }
4071
- return z ? `<a href="${k}">${A}</a>` : `<a href="${k}" target="_blank" rel="noopener noreferrer">${A}</a>`;
4066
+ return O ? `<a href="${k}">${A}</a>` : `<a href="${k}" target="_blank" rel="noopener noreferrer">${A}</a>`;
4072
4067
  }, te.setOptions({ breaks: !0, gfm: !0, renderer: i });
4073
4068
  function s(k) {
4074
4069
  if (!k) return "";
@@ -4087,13 +4082,13 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4087
4082
  const A = JSON.parse(k);
4088
4083
  if (!A || typeof A != "object" || Array.isArray(A))
4089
4084
  return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
4090
- const _ = A;
4085
+ const E = A;
4091
4086
  return {
4092
- topLevelKeys: Object.keys(_).sort().slice(0, 24),
4093
- declaredVisualType: l(_.visualType),
4094
- declaredChartType: l(_.chartType),
4095
- declaredDiagramType: l(_.diagramType),
4096
- inputType: l(_.type)
4087
+ topLevelKeys: Object.keys(E).sort().slice(0, 24),
4088
+ declaredVisualType: l(E.visualType),
4089
+ declaredChartType: l(E.chartType),
4090
+ declaredDiagramType: l(E.diagramType),
4091
+ inputType: l(E.type)
4097
4092
  };
4098
4093
  } catch {
4099
4094
  return { topLevelKeys: [], declaredVisualType: null, declaredChartType: null, declaredDiagramType: null, inputType: null };
@@ -4118,39 +4113,39 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4118
4113
  });
4119
4114
  }
4120
4115
  d(c, "onRichTextAssetError");
4121
- const y = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
4116
+ const b = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
4122
4117
  function R(k) {
4123
- const { text: A, streaming: _ } = k, z = [], Z = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
4124
- let L = 0, I = 0, O = Z.exec(A);
4125
- for (; O !== null; ) {
4126
- const ee = A.slice(L, O.index), ue = s(ee);
4127
- ue && z.push({ kind: "markdown", key: `md-${I}`, html: ue });
4128
- const Ae = wa(O[1].trim());
4118
+ const { text: A, streaming: E } = k, O = [], Z = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g;
4119
+ let I = 0, $ = 0, N = Z.exec(A);
4120
+ for (; N !== null; ) {
4121
+ const J = A.slice(I, N.index), ue = s(J);
4122
+ ue && O.push({ kind: "markdown", key: `md-${$}`, html: ue });
4123
+ const Ae = Ta(N[1].trim());
4129
4124
  if (Ae.ok)
4130
- z.push({ kind: "visual", key: `visual-${I}`, result: Ae });
4125
+ O.push({ kind: "visual", key: `visual-${$}`, result: Ae });
4131
4126
  else {
4132
4127
  typeof console < "u" && console.warn("[pl-visual] parse_failed", {
4133
4128
  reason: Ae.reason,
4134
4129
  message: Ae.message,
4135
4130
  hasFallbackMarkdown: !!Ae.fallbackMarkdown,
4136
- payloadChars: O[1].trim().length,
4137
- ...o(O[1].trim())
4131
+ payloadChars: N[1].trim().length,
4132
+ ...o(N[1].trim())
4138
4133
  });
4139
4134
  const Pe = Ae.fallbackMarkdown ? s(Ae.fallbackMarkdown) : "";
4140
- Pe && z.push({ kind: "markdown", key: `visual-${I}`, html: Pe });
4135
+ Pe && O.push({ kind: "markdown", key: `visual-${$}`, html: Pe });
4141
4136
  }
4142
- L = O.index + O[0].length, I += 1, O = Z.exec(A);
4137
+ I = N.index + N[0].length, $ += 1, N = Z.exec(A);
4143
4138
  }
4144
- const H = A.slice(L), B = _ ? y.exec(H) : null;
4139
+ const W = A.slice(I), B = E ? b.exec(W) : null;
4145
4140
  if (B) {
4146
- const ee = s(H.slice(0, B.index));
4147
- return ee && z.push({ kind: "markdown", key: `md-${I}`, html: ee }), z.push({ kind: "pending-visual", key: `pending-${I}` }), z;
4141
+ const J = s(W.slice(0, B.index));
4142
+ return J && O.push({ kind: "markdown", key: `md-${$}`, html: J }), O.push({ kind: "pending-visual", key: `pending-${$}` }), O;
4148
4143
  }
4149
- const V = s(H);
4150
- return V && z.push({ kind: "markdown", key: `md-${I}`, html: V }), z;
4144
+ const V = s(W);
4145
+ return V && O.push({ kind: "markdown", key: `md-${$}`, html: V }), O;
4151
4146
  }
4152
4147
  d(R, "richTextSegments");
4153
- const b = S(() => {
4148
+ const y = S(() => {
4154
4149
  const k = e.value;
4155
4150
  return k ? R({ text: k, streaming: !!t.streaming }) : [];
4156
4151
  });
@@ -4158,16 +4153,16 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4158
4153
  class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed",
4159
4154
  onErrorCapture: c
4160
4155
  }, [
4161
- (h(!0), f(Q, null, me(b.value, (_) => (h(), f(Q, {
4162
- key: _.key
4156
+ (h(!0), f(ee, null, me(y.value, (E) => (h(), f(ee, {
4157
+ key: E.key
4163
4158
  }, [
4164
- _.kind === "markdown" ? (h(), f("div", {
4159
+ E.kind === "markdown" ? (h(), f("div", {
4165
4160
  key: 0,
4166
4161
  class: C(["chat-msg-prose", a.inverted ? "chat-msg-prose-invert" : ""]),
4167
- innerHTML: _.html
4168
- }, null, 10, dl)) : _.kind === "visual" ? (h(), kt(ul, {
4162
+ innerHTML: E.html
4163
+ }, null, 10, dl)) : E.kind === "visual" ? (h(), kt(ul, {
4169
4164
  key: 1,
4170
- result: _.result,
4165
+ result: E.result,
4171
4166
  inverted: a.inverted
4172
4167
  }, null, 8, ["result", "inverted"])) : (h(), f("div", {
4173
4168
  key: 2,
@@ -4212,9 +4207,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4212
4207
  }), n.value && (s = new ResizeObserver(() => {
4213
4208
  i.value && l();
4214
4209
  }), s.observe(n.value));
4215
- }), Us(() => {
4210
+ }), Hs(() => {
4216
4211
  s?.disconnect();
4217
- }), (c, y) => (h(), f("div", {
4212
+ }), (c, b) => (h(), f("div", {
4218
4213
  ref_key: "viewport",
4219
4214
  ref: e,
4220
4215
  class: C(["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]" : ""]),
@@ -4236,17 +4231,17 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4236
4231
  key: 1,
4237
4232
  "data-test": "messaging-sdk-header",
4238
4233
  class: "shrink-0 border-b border-theme-100 px-4 py-3"
4239
- }, vl = { class: "flex items-center gap-3" }, xl = { class: "min-w-0 flex-1" }, bl = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, yl = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, kl = {
4234
+ }, vl = { class: "flex items-center gap-3" }, xl = { class: "min-w-0 flex-1" }, yl = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, bl = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, kl = {
4240
4235
  key: 0,
4241
4236
  class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
4242
4237
  }, wl = {
4243
4238
  key: 0,
4244
4239
  "data-test": "messaging-empty-state",
4245
4240
  class: "flex flex-col items-center justify-center px-4"
4246
- }, Tl = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Sl = ["src", "alt"], Al = ["title"], El = {
4241
+ }, Tl = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Sl = ["src", "alt"], Al = ["title"], _l = {
4247
4242
  key: 0,
4248
4243
  class: "flex items-center gap-3 py-3 px-2"
4249
- }, _l = ["data-journal-outcome"], Rl = ["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"], Ml = { class: "max-w-[85%] min-w-0" }, Cl = ["href"], Il = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], $l = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Ll = {
4244
+ }, El = ["data-journal-outcome"], Rl = ["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"], Ml = { class: "max-w-[85%] min-w-0" }, Cl = ["href"], Il = ["data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-issue-code", "data-issue-bucket", "data-streaming"], $l = ["data-test", "data-message-id", "data-message-sender", "data-conversation-id", "data-message-sequence", "data-system-kind", "data-streaming"], Ll = {
4250
4245
  key: 0,
4251
4246
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
4252
4247
  }, Dl = ["src", "alt"], Ol = ["src", "alt"], zl = ["src"], Nl = ["href"], Pl = {
@@ -4257,7 +4252,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4257
4252
  "data-test": "messaging-tool-activity-tail",
4258
4253
  "aria-label": "Assistant is still working",
4259
4254
  class: "mb-4 grid h-[17px] w-5 place-items-center"
4260
- }, Wl = ["data-journal-outcome"], Gl = ["data-working-description"], Vl = { class: "truncate" }, ql = ["data-issue-code"], Kl = ["href"], Yl = {
4255
+ }, Wl = ["data-journal-outcome"], Gl = ["data-working-description"], Vl = { class: "truncate" }, ql = ["data-issue-code"], Yl = ["href"], Kl = {
4261
4256
  key: 3,
4262
4257
  "data-test": "messaging-thinking-indicator",
4263
4258
  class: "flex gap-2 justify-start items-center mb-4"
@@ -4279,7 +4274,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4279
4274
  }, fo = {
4280
4275
  key: 1,
4281
4276
  class: "i-tabler-arrow-up size-5"
4282
- }, mo = { class: "sr-only" }, _o = /* @__PURE__ */ Re({
4277
+ }, mo = { class: "sr-only" }, Eo = /* @__PURE__ */ Re({
4283
4278
  __name: "ElAgentChat",
4284
4279
  props: {
4285
4280
  chatController: {},
@@ -4298,176 +4293,176 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4298
4293
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
4299
4294
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
4300
4295
  }, e = S(() => {
4301
- const E = { ...t[a.scope] };
4302
- return a.scope === "org" && a.scopeName && (E.label = a.scopeName, E.tooltip = `Visible to ${a.scopeName} members`), E;
4296
+ const _ = { ...t[a.scope] };
4297
+ return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
4303
4298
  }), n = ge(!1), i = ge(), s = ge(), l = ge();
4304
- function o(E) {
4305
- return E ? /\[[^\]]+\]\([^)]+\)/.test(E) : !1;
4299
+ function o(_) {
4300
+ return _ ? /\[[^\]]+\]\([^)]+\)/.test(_) : !1;
4306
4301
  }
4307
4302
  d(o, "containsMarkdownLink");
4308
- function p(E) {
4309
- return E.sender === "system" && (!!E.issue || E.id === se.value);
4303
+ function p(_) {
4304
+ return _.sender === "system" && (!!_.issue || _.id === se.value);
4310
4305
  }
4311
4306
  d(p, "isSystemExplainerMessage");
4312
- function c(E, m) {
4313
- const T = E[m], ae = E[m + 1];
4307
+ function c(_, m) {
4308
+ const T = _[m], ae = _[m + 1];
4314
4309
  return !ae || ae.sender !== T.sender;
4315
4310
  }
4316
4311
  d(c, "shouldShowAvatar");
4317
- const y = S(() => a.chatController?.textState.value), R = S(() => y.value?.isConnected ?? !1), b = S(() => y.value?.isThinking ?? !1), k = S(() => y.value?.connectionStatus === "disconnected" && !!y.value?.error), A = S(() => y.value?.connectionStatus !== "connected" && !y.value?.error), _ = S(() => y.value?.error), z = S(() => a.chatController?.liveTurnBlocks?.value ?? []), Z = S(() => {
4318
- for (let E = z.value.length - 1; E >= 0; E--) {
4319
- const m = z.value[E];
4312
+ const b = S(() => a.chatController?.textState.value), R = S(() => b.value?.isConnected ?? !1), y = S(() => b.value?.isThinking ?? !1), k = S(() => b.value?.connectionStatus === "disconnected" && !!b.value?.error), A = S(() => b.value?.connectionStatus !== "connected" && !b.value?.error), E = S(() => b.value?.error), O = S(() => a.chatController?.liveTurnBlocks?.value ?? []), Z = S(() => {
4313
+ for (let _ = O.value.length - 1; _ >= 0; _--) {
4314
+ const m = O.value[_];
4320
4315
  if (m?.kind === "text")
4321
4316
  return m.id;
4322
4317
  }
4323
- }), L = S(() => a.chatController?.liveStreamMessageId?.value), I = S(() => {
4324
- const E = a.chatController?.sharedMessages.value ?? [];
4325
- return z.value.length && L.value ? E.filter((m) => m.id !== L.value) : E;
4326
- }), O = S(() => a.chatController?.workJournal?.value ? void 0 : y.value?.workingDescription?.trim() || void 0), H = S(() => a.chatController?.workJournal?.value), B = S(() => {
4327
- if (!H.value && !z.value.length)
4318
+ }), I = S(() => a.chatController?.liveStreamMessageId?.value), $ = S(() => {
4319
+ const _ = a.chatController?.sharedMessages.value ?? [];
4320
+ return O.value.length && I.value ? _.filter((m) => m.id !== I.value) : _;
4321
+ }), N = S(() => a.chatController?.workJournal?.value ? void 0 : b.value?.workingDescription?.trim() || void 0), W = S(() => a.chatController?.workJournal?.value), B = S(() => {
4322
+ if (!W.value && !O.value.length)
4328
4323
  return;
4329
- const E = I.value, m = E[E.length - 1];
4324
+ const _ = $.value, m = _[_.length - 1];
4330
4325
  if (m)
4331
- return m.sender === "agent" || m.sender === "system" ? E.length >= 2 ? E[E.length - 2].id : void 0 : m.id;
4326
+ return m.sender === "agent" || m.sender === "system" ? _.length >= 2 ? _[_.length - 2].id : void 0 : m.id;
4332
4327
  }), V = S(() => {
4333
- const E = {};
4334
- for (const m of I.value) {
4328
+ const _ = {};
4329
+ for (const m of $.value) {
4335
4330
  if (m.sender === "user" || !m.toolActivities?.length)
4336
4331
  continue;
4337
4332
  const T = a.chatController?.workJournalFor?.({
4338
4333
  activities: m.toolActivities,
4339
- outcome: Ca(m),
4334
+ outcome: Ia(m),
4340
4335
  includeFailureNote: m.sender !== "system"
4341
4336
  });
4342
- T && (E[m.id] = T);
4337
+ T && (_[m.id] = T);
4343
4338
  }
4344
- return E;
4339
+ return _;
4345
4340
  });
4346
- function ee(E) {
4347
- return V.value[E.id];
4341
+ function J(_) {
4342
+ return V.value[_.id];
4348
4343
  }
4349
- d(ee, "messageWorkJournal");
4350
- function ue(E, m) {
4351
- return E.placement?.kind !== "inline" || !Number.isFinite(E.placement.offset) ? null : Math.max(0, Math.min(m.length, Math.trunc(E.placement.offset)));
4344
+ d(J, "messageWorkJournal");
4345
+ function ue(_, m) {
4346
+ return _.placement?.kind !== "inline" || !Number.isFinite(_.placement.offset) ? null : Math.max(0, Math.min(m.length, Math.trunc(_.placement.offset)));
4352
4347
  }
4353
4348
  d(ue, "inlineOffset");
4354
- function Ae(E, m) {
4355
- return E.mediaId || `${E.src}:${m}`;
4349
+ function Ae(_, m) {
4350
+ return _.mediaId || `${_.src}:${m}`;
4356
4351
  }
4357
4352
  d(Ae, "attachmentKey");
4358
- function Pe(E) {
4359
- return (E.attachments ?? []).map((m, T) => ({ attachment: m, index: T })).filter(({ attachment: m }) => ue(m, E.text) === null);
4353
+ function Pe(_) {
4354
+ return (_.attachments ?? []).map((m, T) => ({ attachment: m, index: T })).filter(({ attachment: m }) => ue(m, _.text) === null);
4360
4355
  }
4361
4356
  d(Pe, "blockAttachmentsForMessage");
4362
- function St(E) {
4363
- const m = E.text ?? "";
4364
- if (E.sender !== "agent")
4365
- return m ? [{ kind: "text", key: `${E.id}:text`, text: m }] : [];
4366
- const T = (E.attachments ?? []).map((oe, Ze) => ({ attachment: oe, index: Ze, offset: ue(oe, m) })).filter((oe) => oe.offset !== null).sort((oe, Ze) => oe.offset - Ze.offset || oe.index - Ze.index);
4357
+ function St(_) {
4358
+ const m = _.text ?? "";
4359
+ if (_.sender !== "agent")
4360
+ return m ? [{ kind: "text", key: `${_.id}:text`, text: m }] : [];
4361
+ const T = (_.attachments ?? []).map((oe, Ze) => ({ attachment: oe, index: Ze, offset: ue(oe, m) })).filter((oe) => oe.offset !== null).sort((oe, Ze) => oe.offset - Ze.offset || oe.index - Ze.index);
4367
4362
  if (T.length === 0)
4368
- return m ? [{ kind: "text", key: `${E.id}:text`, text: m }] : [];
4363
+ return m ? [{ kind: "text", key: `${_.id}:text`, text: m }] : [];
4369
4364
  const ae = [];
4370
4365
  let U = 0;
4371
4366
  for (const oe of T)
4372
4367
  oe.offset > U && ae.push({
4373
4368
  kind: "text",
4374
- key: `${E.id}:text:${U}`,
4369
+ key: `${_.id}:text:${U}`,
4375
4370
  text: m.slice(U, oe.offset)
4376
4371
  }), ae.push({
4377
4372
  kind: "attachment",
4378
- key: `${E.id}:attachment:${Ae(oe.attachment, oe.index)}`,
4373
+ key: `${_.id}:attachment:${Ae(oe.attachment, oe.index)}`,
4379
4374
  attachment: oe.attachment,
4380
4375
  placement: "inline"
4381
4376
  }), U = oe.offset;
4382
4377
  return U < m.length && ae.push({
4383
4378
  kind: "text",
4384
- key: `${E.id}:text:${U}`,
4379
+ key: `${_.id}:text:${U}`,
4385
4380
  text: m.slice(U)
4386
4381
  }), ae;
4387
4382
  }
4388
4383
  d(St, "messageRenderParts");
4389
- const De = S(() => y.value?.transientIssue), se = S(() => {
4390
- if (!b.value) return;
4391
- const E = I.value, m = E[E.length - 1];
4384
+ const De = S(() => b.value?.transientIssue), se = S(() => {
4385
+ if (!y.value) return;
4386
+ const _ = $.value, m = _[_.length - 1];
4392
4387
  return m?.sender === "agent" || m?.sender === "system" ? m.id : void 0;
4393
- }), st = S(() => !b.value || O.value || H.value || z.value.length ? !1 : se.value === void 0), Ke = S(() => y.value?.sendBlockedReason), at = S(() => !R.value || Ke.value !== void 0), Oe = S(() => k.value ? "Agent is offline" : A.value ? "Connecting..." : Ke.value === "agent_deleted" ? "This assistant was deleted" : Ke.value === "account" ? "Open billing to keep chatting" : "Message"), gt = S(() => a.chatController?.composerState?.value ?? {
4388
+ }), st = S(() => !y.value || N.value || W.value || O.value.length ? !1 : se.value === void 0), Ye = S(() => b.value?.sendBlockedReason), at = S(() => !R.value || Ye.value !== void 0), Oe = S(() => k.value ? "Agent is offline" : A.value ? "Connecting..." : Ye.value === "agent_deleted" ? "This assistant was deleted" : Ye.value === "account" ? "Open billing to keep chatting" : "Message"), gt = S(() => a.chatController?.composerState?.value ?? {
4394
4389
  text: "",
4395
4390
  pendingAttachments: [],
4396
4391
  isUploading: !1
4397
4392
  }), vt = S({
4398
4393
  get: /* @__PURE__ */ d(() => gt.value.text, "get"),
4399
- set: /* @__PURE__ */ d((E) => a.chatController?.setComposerText?.({ text: E }), "set")
4400
- }), Me = S(() => gt.value.pendingAttachments), it = S(() => gt.value.isUploading), Ce = S(() => a.chatController?.voiceRecorder), Y = S(() => Ce.value?.isBusy.value ?? !1), be = S(() => a.chatController?.canAttachFile?.value ?? !1), ie = S(() => a.chatController?.canRecordAudio?.value ?? !1), Ie = S(() => a.chatController?.composerAction?.value ?? "idle"), re = S(() => Ie.value !== "idle"), Be = S(() => Ie.value === "stop" ? "Stop reply" : "Send message"), rt = S(() => Ie.value === "idle" && ie.value && !Y.value && !!Ce.value?.canUseBrowserRecording), ye = S(() => Ce.value?.isActive.value ?? !1), g = S(() => Ce.value?.elapsedLabel.value ?? "0:00"), M = S(() => Ce.value?.statusText.value ?? "Release to send"), u = S(() => Ce.value?.state.value.phase === "sending" ? "Sending voice message" : ye.value ? "Release to send voice message" : "Hold to record voice message"), v = S(() => a.variant === "light"), $ = S(
4394
+ set: /* @__PURE__ */ d((_) => a.chatController?.setComposerText?.({ text: _ }), "set")
4395
+ }), Me = S(() => gt.value.pendingAttachments), it = S(() => gt.value.isUploading), Ce = S(() => a.chatController?.voiceRecorder), K = S(() => Ce.value?.isBusy.value ?? !1), ye = S(() => a.chatController?.canAttachFile?.value ?? !1), ie = S(() => a.chatController?.canRecordAudio?.value ?? !1), Ie = S(() => a.chatController?.composerAction?.value ?? "idle"), re = S(() => Ie.value !== "idle"), Be = S(() => Ie.value === "stop" ? "Stop reply" : "Send message"), rt = S(() => Ie.value === "idle" && ie.value && !K.value && !!Ce.value?.canUseBrowserRecording), be = S(() => Ce.value?.isActive.value ?? !1), g = S(() => Ce.value?.elapsedLabel.value ?? "0:00"), M = S(() => Ce.value?.statusText.value ?? "Release to send"), u = S(() => Ce.value?.state.value.phase === "sending" ? "Sending voice message" : be.value ? "Release to send voice message" : "Hold to record voice message"), v = S(() => a.variant === "light"), L = S(
4401
4396
  () => v.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
4402
4397
  ), D = S(() => v.value ? "text-theme-300" : "text-white/30");
4403
4398
  tn(async () => {
4404
4399
  a.chatController && !R.value && await a.chatController.startTextConversation();
4405
- }), Ns(() => {
4400
+ }), Ps(() => {
4406
4401
  a.chatController?.voiceRecorder?.teardown();
4407
4402
  });
4408
- async function J() {
4403
+ async function Q() {
4409
4404
  !a.chatController || Ie.value !== "send" || (s.value && (s.value.style.height = "auto", s.value.focus()), i.value?.pin(), await a.chatController.sendComposerMessage());
4410
4405
  }
4411
- d(J, "sendMessage");
4406
+ d(Q, "sendMessage");
4412
4407
  async function pe() {
4413
4408
  a.chatController && (Ie.value === "send" && i.value?.pin(), await a.chatController.handleComposerAction());
4414
4409
  }
4415
4410
  d(pe, "handleComposerAction");
4416
- async function ke(E) {
4417
- E.key === "Enter" && !E.shiftKey && (E.preventDefault(), await J());
4411
+ async function ke(_) {
4412
+ _.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Q());
4418
4413
  }
4419
4414
  d(ke, "handleKeydown");
4420
4415
  function le() {
4421
4416
  s.value && (s.value.style.height = "auto", s.value.style.height = `${Math.min(s.value.scrollHeight, 150)}px`);
4422
4417
  }
4423
- d(le, "adjustTextareaHeight"), Qt(vt, () => Fs(() => le()));
4418
+ d(le, "adjustTextareaHeight"), Qt(vt, () => Us(() => le()));
4424
4419
  function de() {
4425
4420
  l.value?.click();
4426
4421
  }
4427
4422
  d(de, "triggerFileInput");
4428
- async function $e(E) {
4429
- const m = E.target, T = m.files?.[0];
4430
- !T || !a.chatController || Y.value || (await a.chatController.attachFile({ file: T }), m.value = "");
4423
+ async function $e(_) {
4424
+ const m = _.target, T = m.files?.[0];
4425
+ !T || !a.chatController || K.value || (await a.chatController.attachFile({ file: T }), m.value = "");
4431
4426
  }
4432
4427
  d($e, "handleFileSelect");
4433
- function Ye(E) {
4434
- a.chatController?.removeAttachment({ index: E });
4428
+ function Ke(_) {
4429
+ a.chatController?.removeAttachment({ index: _ });
4435
4430
  }
4436
- d(Ye, "removeAttachment");
4431
+ d(Ke, "removeAttachment");
4437
4432
  function je() {
4438
4433
  Ce.value?.start();
4439
4434
  }
4440
4435
  d(je, "startRecording");
4441
- function ze(E) {
4442
- Ce.value?.finish(E);
4436
+ function ze(_) {
4437
+ Ce.value?.finish(_);
4443
4438
  }
4444
4439
  d(ze, "finishRecording");
4445
- function Fe(E, m) {
4440
+ function Fe(_, m) {
4446
4441
  if (m === 0) {
4447
- const ct = E[m];
4442
+ const ct = _[m];
4448
4443
  return ct?.timestamp ? Xe(new Date(ct.timestamp)) : null;
4449
4444
  }
4450
- const T = E[m - 1], ae = E[m];
4445
+ const T = _[m - 1], ae = _[m];
4451
4446
  if (!T?.timestamp || !ae?.timestamp) return null;
4452
4447
  const U = new Date(T.timestamp).getTime();
4453
4448
  return new Date(ae.timestamp).getTime() - U > 36e5 ? Xe(new Date(ae.timestamp)) : null;
4454
4449
  }
4455
4450
  d(Fe, "shouldShowTimeDivider");
4456
- function Xe(E) {
4457
- const m = /* @__PURE__ */ new Date(), T = E.toDateString() === m.toDateString(), ae = new Date(m);
4451
+ function Xe(_) {
4452
+ const m = /* @__PURE__ */ new Date(), T = _.toDateString() === m.toDateString(), ae = new Date(m);
4458
4453
  ae.setDate(ae.getDate() - 1);
4459
- const U = E.toDateString() === ae.toDateString(), oe = E.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
4454
+ const U = _.toDateString() === ae.toDateString(), oe = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
4460
4455
  if (T) return oe;
4461
4456
  if (U) return `Yesterday, ${oe}`;
4462
- const Ze = E.getFullYear() === m.getFullYear();
4463
- return `${E.toLocaleDateString("en-US", {
4457
+ const Ze = _.getFullYear() === m.getFullYear();
4458
+ return `${_.toLocaleDateString("en-US", {
4464
4459
  weekday: "long",
4465
4460
  month: "short",
4466
4461
  day: "numeric",
4467
4462
  ...Ze ? {} : { year: "numeric" }
4468
4463
  })}, ${oe}`;
4469
4464
  }
4470
- return d(Xe, "formatTimeDivider"), (E, m) => (h(), f("div", fl, [
4465
+ return d(Xe, "formatTimeDivider"), (_, m) => (h(), f("div", fl, [
4471
4466
  v.value ? a.showHeader ? (h(), f("div", gl, [
4472
4467
  w("div", vl, [
4473
4468
  Ne(Qa, {
@@ -4477,12 +4472,12 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4477
4472
  class: "size-10"
4478
4473
  }, null, 8, ["agent"]),
4479
4474
  w("div", xl, [
4480
- w("div", bl, W(a.agent.displayName.value), 1),
4481
- w("div", yl, W(a.agent.title.value || "Assistant"), 1)
4475
+ w("div", yl, j(a.agent.displayName.value), 1),
4476
+ w("div", bl, j(a.agent.title.value || "Assistant"), 1)
4482
4477
  ]),
4483
- a.headerMeta ? (h(), f("span", kl, W(a.headerMeta), 1)) : j("", !0)
4478
+ a.headerMeta ? (h(), f("span", kl, j(a.headerMeta), 1)) : H("", !0)
4484
4479
  ])
4485
- ])) : j("", !0) : (h(), f("div", ml, [
4480
+ ])) : H("", !0) : (h(), f("div", ml, [
4486
4481
  Ne(Va, {
4487
4482
  agent: a.agent,
4488
4483
  "is-online": R.value
@@ -4495,7 +4490,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4495
4490
  w("i", {
4496
4491
  class: C(["i-heroicons-cloud-arrow-down size-8", v.value ? "text-theme-300" : "text-white/40"])
4497
4492
  }, null, 2),
4498
- w("span", null, W(_.value), 1)
4493
+ w("span", null, j(E.value), 1)
4499
4494
  ], 2)) : A.value ? (h(), f("div", {
4500
4495
  key: 3,
4501
4496
  class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm", v.value ? "text-theme-400" : "text-theme-600"])
@@ -4506,18 +4501,18 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4506
4501
  class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", D.value])
4507
4502
  }, [
4508
4503
  m[19] || (m[19] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
4509
- w("span", null, W(a.setupHint), 1)
4510
- ], 2)) : j("", !0),
4504
+ w("span", null, j(a.setupHint), 1)
4505
+ ], 2)) : H("", !0),
4511
4506
  Ne(pl, {
4512
4507
  ref_key: "chatScroller",
4513
4508
  ref: i,
4514
4509
  class: "flex-1"
4515
4510
  }, {
4516
- default: Ps(() => [
4511
+ default: Bs(() => [
4517
4512
  w("div", {
4518
- class: C(I.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")
4513
+ class: C($.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")
4519
4514
  }, [
4520
- I.value.length === 0 && !A.value && !k.value ? (h(), f("div", wl, [
4515
+ $.value.length === 0 && !A.value && !k.value ? (h(), f("div", wl, [
4521
4516
  w("div", Tl, [
4522
4517
  w("img", {
4523
4518
  src: a.agent.avatarUrl.value,
@@ -4529,14 +4524,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4529
4524
  class: C(["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", v.value ? "bg-white" : "bg-theme-900"])
4530
4525
  }, [...m[20] || (m[20] = [
4531
4526
  w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
4532
- ])], 2)) : j("", !0)
4527
+ ])], 2)) : H("", !0)
4533
4528
  ]),
4534
4529
  w("div", {
4535
4530
  class: C(["text-base @sm/chat:text-lg font-semibold", v.value ? "text-theme-900" : "text-white"])
4536
- }, W(a.agent.displayName.value), 3),
4531
+ }, j(a.agent.displayName.value), 3),
4537
4532
  w("p", {
4538
4533
  class: C(["mt-1 text-center text-xs @sm/chat:text-sm", D.value])
4539
- }, W(a.emptyStateMessage || "Type your message to get started."), 3),
4534
+ }, j(a.emptyStateMessage || "Type your message to get started."), 3),
4540
4535
  w("div", {
4541
4536
  class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", v.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4542
4537
  title: e.value.tooltip
@@ -4544,34 +4539,34 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4544
4539
  w("i", {
4545
4540
  class: C([e.value.icon, "size-3"])
4546
4541
  }, null, 2),
4547
- w("span", null, W(e.value.label), 1)
4542
+ w("span", null, j(e.value.label), 1)
4548
4543
  ], 10, Al)
4549
- ])) : j("", !0),
4550
- (h(!0), f(Q, null, me(I.value, (T, ae) => (h(), f(Q, {
4544
+ ])) : H("", !0),
4545
+ (h(!0), f(ee, null, me($.value, (T, ae) => (h(), f(ee, {
4551
4546
  key: T.id
4552
4547
  }, [
4553
- Fe(I.value, ae) ? (h(), f("div", El, [
4548
+ Fe($.value, ae) ? (h(), f("div", _l, [
4554
4549
  w("div", {
4555
- class: C(["flex-1 h-px", $.value])
4550
+ class: C(["flex-1 h-px", L.value])
4556
4551
  }, null, 2),
4557
4552
  w("span", {
4558
4553
  class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", D.value])
4559
- }, W(Fe(I.value, ae)), 3),
4554
+ }, j(Fe($.value, ae)), 3),
4560
4555
  w("div", {
4561
- class: C(["flex-1 h-px", $.value])
4556
+ class: C(["flex-1 h-px", L.value])
4562
4557
  }, null, 2)
4563
- ])) : j("", !0),
4564
- ee(T) ? (h(), f("div", {
4558
+ ])) : H("", !0),
4559
+ J(T) ? (h(), f("div", {
4565
4560
  key: 1,
4566
4561
  "data-test": "messaging-message-tool-activity",
4567
- "data-journal-outcome": ee(T)?.outcome,
4562
+ "data-journal-outcome": J(T)?.outcome,
4568
4563
  class: "mb-4 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4569
4564
  }, [
4570
- Ne(Rn, {
4571
- model: ee(T),
4565
+ Ne(Mn, {
4566
+ model: J(T),
4572
4567
  "is-light": v.value
4573
4568
  }, null, 8, ["model", "is-light"])
4574
- ], 8, _l)) : j("", !0),
4569
+ ], 8, El)) : H("", !0),
4575
4570
  p(T) ? (h(), f("div", {
4576
4571
  key: 2,
4577
4572
  "data-test": "messaging-system-msg",
@@ -4594,18 +4589,18 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4594
4589
  w("div", {
4595
4590
  class: C(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", v.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
4596
4591
  }, [
4597
- T.text ? (h(), kt(Yt, {
4592
+ T.text ? (h(), kt(Kt, {
4598
4593
  key: 0,
4599
4594
  text: T.text,
4600
4595
  inverted: !v.value,
4601
4596
  streaming: T.id === se.value,
4602
4597
  onClick: m[0] || (m[0] = Le(() => {
4603
4598
  }, ["stop"]))
4604
- }, null, 8, ["text", "inverted", "streaming"])) : T.issue?.help ? (h(), kt(Yt, {
4599
+ }, null, 8, ["text", "inverted", "streaming"])) : T.issue?.help ? (h(), kt(Kt, {
4605
4600
  key: 1,
4606
4601
  text: T.issue.help,
4607
4602
  inverted: !v.value
4608
- }, null, 8, ["text", "inverted"])) : j("", !0),
4603
+ }, null, 8, ["text", "inverted"])) : H("", !0),
4609
4604
  T.issue?.actionUrl && !o(T.text) ? (h(), f("a", {
4610
4605
  key: 2,
4611
4606
  href: T.issue.actionUrl,
@@ -4614,9 +4609,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4614
4609
  onClick: m[1] || (m[1] = Le(() => {
4615
4610
  }, ["stop"]))
4616
4611
  }, [
4617
- ot(W(T.issue.actionLabel) + " ", 1),
4612
+ ot(j(T.issue.actionLabel) + " ", 1),
4618
4613
  m[21] || (m[21] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
4619
- ], 10, Cl)) : j("", !0)
4614
+ ], 10, Cl)) : H("", !0)
4620
4615
  ], 2)
4621
4616
  ])
4622
4617
  ], 8, Rl)) : T.sender === "system" ? (h(), f("div", {
@@ -4633,7 +4628,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4633
4628
  class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", v.value ? "text-theme-500" : "text-white/60"])
4634
4629
  }, [
4635
4630
  m[22] || (m[22] = w("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
4636
- Ne(Yt, {
4631
+ Ne(Kt, {
4637
4632
  text: T.text,
4638
4633
  inverted: !v.value,
4639
4634
  onClick: m[2] || (m[2] = Le(() => {
@@ -4653,17 +4648,17 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4653
4648
  "justify-start": T.sender === "agent",
4654
4649
  // Group-aware rhythm: tight (space-y) within a speaker's turn,
4655
4650
  // generous at the boundary between speakers (end of a group).
4656
- "mb-6": c(I.value, ae)
4651
+ "mb-6": c($.value, ae)
4657
4652
  }])
4658
4653
  }, [
4659
4654
  T.sender === "agent" ? (h(), f("div", Ll, [
4660
- c(I.value, ae) ? (h(), f("img", {
4655
+ c($.value, ae) ? (h(), f("img", {
4661
4656
  key: 0,
4662
4657
  src: a.agent.avatarUrl.value,
4663
4658
  alt: a.agent.displayName.value,
4664
4659
  class: C(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", v.value ? "ring-1 ring-black/5" : ""])
4665
- }, null, 10, Dl)) : j("", !0)
4666
- ])) : j("", !0),
4660
+ }, null, 10, Dl)) : H("", !0)
4661
+ ])) : H("", !0),
4667
4662
  w("div", {
4668
4663
  "data-test": "messaging-message-body",
4669
4664
  class: C(T.sender === "user" ? "max-w-[min(75%,22rem)]" : "max-w-[min(82%,68ch)]")
@@ -4672,7 +4667,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4672
4667
  key: 0,
4673
4668
  class: C(["mb-1 space-y-1", T.sender === "user" ? "flex flex-col items-end" : ""])
4674
4669
  }, [
4675
- (h(!0), f(Q, null, me(Pe(T), ({ attachment: U, index: oe }) => (h(), f(Q, {
4670
+ (h(!0), f(ee, null, me(Pe(T), ({ attachment: U, index: oe }) => (h(), f(ee, {
4676
4671
  key: Ae(U, oe)
4677
4672
  }, [
4678
4673
  U.type === "image" ? (h(), f("img", {
@@ -4699,10 +4694,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4699
4694
  class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", v.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4700
4695
  }, [
4701
4696
  m[23] || (m[23] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
4702
- ot(" " + W(U.filename), 1)
4697
+ ot(" " + j(U.filename), 1)
4703
4698
  ], 10, Nl))
4704
4699
  ], 64))), 128))
4705
- ], 2)) : j("", !0),
4700
+ ], 2)) : H("", !0),
4706
4701
  St(T).length ? (h(), f("div", {
4707
4702
  key: 1,
4708
4703
  "data-test": "messaging-message-content",
@@ -4710,11 +4705,11 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4710
4705
  T.sender === "user" ? v.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" : v.value ? "text-theme-800" : "text-white/95"
4711
4706
  )
4712
4707
  }, [
4713
- (h(!0), f(Q, null, me(St(T), (U) => (h(), f(Q, {
4708
+ (h(!0), f(ee, null, me(St(T), (U) => (h(), f(ee, {
4714
4709
  key: U.key
4715
4710
  }, [
4716
4711
  U.kind === "text" && U.text ? (h(), f("div", Pl, [
4717
- Ne(Yt, {
4712
+ Ne(Kt, {
4718
4713
  text: U.text,
4719
4714
  inverted: T.sender === "user" || !v.value,
4720
4715
  streaming: T.id === se.value,
@@ -4745,14 +4740,14 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4745
4740
  class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", v.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4746
4741
  }, [
4747
4742
  m[24] || (m[24] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
4748
- ot(" " + W(U.attachment.filename), 1)
4749
- ], 10, Ul)) : j("", !0)
4743
+ ot(" " + j(U.attachment.filename), 1)
4744
+ ], 10, Ul)) : H("", !0)
4750
4745
  ], 64))), 128))
4751
- ], 2)) : j("", !0)
4746
+ ], 2)) : H("", !0)
4752
4747
  ], 2)
4753
4748
  ], 10, $l)),
4754
- T.id === B.value ? (h(), f(Q, { key: 5 }, [
4755
- z.value.length ? (h(!0), f(Q, { key: 0 }, me(z.value, (U) => (h(), f(Q, {
4749
+ T.id === B.value ? (h(), f(ee, { key: 5 }, [
4750
+ O.value.length ? (h(!0), f(ee, { key: 0 }, me(O.value, (U) => (h(), f(ee, {
4756
4751
  key: U.id
4757
4752
  }, [
4758
4753
  U.kind === "work" ? (h(), f("div", {
@@ -4761,7 +4756,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4761
4756
  "data-journal-outcome": U.journal.outcome,
4762
4757
  class: "mb-4 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4763
4758
  }, [
4764
- Ne(Rn, {
4759
+ Ne(Mn, {
4765
4760
  model: U.journal,
4766
4761
  "is-light": v.value
4767
4762
  }, null, 8, ["model", "is-light"])
@@ -4770,7 +4765,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4770
4765
  "data-test": "messaging-live-text-block",
4771
4766
  class: C(["mb-4", v.value ? "text-theme-800" : "text-white/95"])
4772
4767
  }, [
4773
- Ne(Yt, {
4768
+ Ne(Kt, {
4774
4769
  text: U.content,
4775
4770
  inverted: !v.value,
4776
4771
  streaming: U.id === Z.value,
@@ -4782,31 +4777,31 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4782
4777
  class: C(["size-3.5", v.value ? "text-theme-500" : "text-white/70"])
4783
4778
  }, null, 8, ["class"])
4784
4779
  ]))
4785
- ], 64))), 128)) : H.value ? (h(), f("div", {
4780
+ ], 64))), 128)) : W.value ? (h(), f("div", {
4786
4781
  key: 1,
4787
4782
  "data-test": "messaging-tool-activity",
4788
- "data-journal-outcome": H.value.outcome,
4783
+ "data-journal-outcome": W.value.outcome,
4789
4784
  class: "mb-4 mr-4 w-[calc(100%-1rem)] max-w-[306px]"
4790
4785
  }, [
4791
- Ne(Rn, {
4792
- model: H.value,
4786
+ Ne(Mn, {
4787
+ model: W.value,
4793
4788
  "is-light": v.value
4794
4789
  }, null, 8, ["model", "is-light"])
4795
- ], 8, Wl)) : j("", !0)
4796
- ], 64)) : j("", !0)
4790
+ ], 8, Wl)) : H("", !0)
4791
+ ], 64)) : H("", !0)
4797
4792
  ], 64))), 128)),
4798
- O.value ? (h(), f("div", {
4793
+ N.value ? (h(), f("div", {
4799
4794
  key: 1,
4800
4795
  "data-test": "messaging-working-state",
4801
- "data-working-description": O.value,
4796
+ "data-working-description": N.value,
4802
4797
  class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", v.value ? "text-theme-500" : "text-white/45"])
4803
4798
  }, [
4804
4799
  m[25] || (m[25] = w("i", {
4805
4800
  class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
4806
4801
  "aria-hidden": "true"
4807
4802
  }, null, -1)),
4808
- w("span", Vl, W(O.value), 1)
4809
- ], 10, Gl)) : j("", !0),
4803
+ w("span", Vl, j(N.value), 1)
4804
+ ], 10, Gl)) : H("", !0),
4810
4805
  De.value ? (h(), f("div", {
4811
4806
  key: 2,
4812
4807
  "data-test": "messaging-transient-issue",
@@ -4818,10 +4813,10 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4818
4813
  "aria-hidden": "true"
4819
4814
  }, null, -1)),
4820
4815
  w("span", null, [
4821
- ot(W(De.value.message), 1),
4822
- De.value.help ? (h(), f(Q, { key: 0 }, [
4823
- ot(W(De.value.help), 1)
4824
- ], 64)) : j("", !0)
4816
+ ot(j(De.value.message), 1),
4817
+ De.value.help ? (h(), f(ee, { key: 0 }, [
4818
+ ot(j(De.value.help), 1)
4819
+ ], 64)) : H("", !0)
4825
4820
  ]),
4826
4821
  De.value.actionUrl && De.value.actionLabel ? (h(), f("a", {
4827
4822
  key: 0,
@@ -4829,9 +4824,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4829
4824
  class: "shrink-0 underline underline-offset-2",
4830
4825
  onClick: m[5] || (m[5] = Le(() => {
4831
4826
  }, ["stop"]))
4832
- }, W(De.value.actionLabel), 9, Kl)) : j("", !0)
4833
- ], 10, ql)) : j("", !0),
4834
- st.value ? (h(), f("div", Yl, [
4827
+ }, j(De.value.actionLabel), 9, Yl)) : H("", !0)
4828
+ ], 10, ql)) : H("", !0),
4829
+ st.value ? (h(), f("div", Kl, [
4835
4830
  w("img", {
4836
4831
  src: a.agent.avatarUrl.value,
4837
4832
  alt: a.agent.displayName.value,
@@ -4841,7 +4836,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4841
4836
  class: C(["i-svg-spinners-3-dots-bounce size-7", v.value ? "text-theme-400" : "text-white/50"]),
4842
4837
  "aria-hidden": "true"
4843
4838
  }, null, 2)
4844
- ])) : j("", !0)
4839
+ ])) : H("", !0)
4845
4840
  ], 2)
4846
4841
  ]),
4847
4842
  _: 1
@@ -4850,7 +4845,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4850
4845
  class: C(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", v.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"])
4851
4846
  }, [
4852
4847
  Me.value.length > 0 ? (h(), f("div", Zl, [
4853
- (h(!0), f(Q, null, me(Me.value, (T, ae) => (h(), f("div", {
4848
+ (h(!0), f(ee, null, me(Me.value, (T, ae) => (h(), f("div", {
4854
4849
  key: ae,
4855
4850
  class: "relative shrink-0 group"
4856
4851
  }, [
@@ -4864,20 +4859,20 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4864
4859
  class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", v.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
4865
4860
  }, [
4866
4861
  m[27] || (m[27] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
4867
- w("span", Ql, W(T.filename), 1)
4862
+ w("span", Ql, j(T.filename), 1)
4868
4863
  ], 2)),
4869
4864
  w("button", {
4870
4865
  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",
4871
- onClick: /* @__PURE__ */ d((U) => Ye(ae), "onClick")
4866
+ onClick: /* @__PURE__ */ d((U) => Ke(ae), "onClick")
4872
4867
  }, [...m[28] || (m[28] = [
4873
4868
  w("i", { class: "i-tabler-x size-3" }, null, -1)
4874
4869
  ])], 8, eo)
4875
4870
  ]))), 128)),
4876
4871
  it.value ? (h(), f("div", to, [
4877
4872
  Ne(En, { class: "size-5" })
4878
- ])) : j("", !0)
4879
- ])) : j("", !0),
4880
- be.value ? (h(), f("input", {
4873
+ ])) : H("", !0)
4874
+ ])) : H("", !0),
4875
+ ye.value ? (h(), f("input", {
4881
4876
  key: 1,
4882
4877
  ref_key: "fileInput",
4883
4878
  ref: l,
@@ -4885,7 +4880,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4885
4880
  accept: "image/*,audio/*,video/*",
4886
4881
  class: "hidden",
4887
4882
  onChange: $e
4888
- }, null, 544)) : j("", !0),
4883
+ }, null, 544)) : H("", !0),
4889
4884
  w("div", {
4890
4885
  "data-test": "messaging-composer",
4891
4886
  "data-composer-action": Ie.value,
@@ -4893,29 +4888,29 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4893
4888
  }, [
4894
4889
  w("button", {
4895
4890
  class: C(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
4896
- be.value ? "cursor-pointer" : "cursor-default",
4891
+ ye.value ? "cursor-pointer" : "cursor-default",
4897
4892
  v.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
4898
- it.value || Y.value ? "opacity-50 pointer-events-none" : ""
4893
+ it.value || K.value ? "opacity-50 pointer-events-none" : ""
4899
4894
  ]]),
4900
- disabled: at.value || it.value || Y.value || !be.value,
4901
- "aria-label": be.value ? "Attach file" : "File attachments unavailable",
4902
- title: be.value ? "Attach file" : "File attachments unavailable",
4903
- onClick: m[6] || (m[6] = (T) => be.value && de())
4895
+ disabled: at.value || it.value || K.value || !ye.value,
4896
+ "aria-label": ye.value ? "Attach file" : "File attachments unavailable",
4897
+ title: ye.value ? "Attach file" : "File attachments unavailable",
4898
+ onClick: m[6] || (m[6] = (T) => ye.value && de())
4904
4899
  }, [
4905
4900
  it.value ? (h(), f("i", ao)) : (h(), f("i", io)),
4906
- w("span", ro, W(be.value ? "Attach file" : "File attachments unavailable"), 1)
4901
+ w("span", ro, j(ye.value ? "Attach file" : "File attachments unavailable"), 1)
4907
4902
  ], 10, so),
4908
- ye.value ? (h(), f("div", {
4903
+ be.value ? (h(), f("div", {
4909
4904
  key: 1,
4910
4905
  "data-test": "messaging-recording-state",
4911
4906
  class: C(["flex min-w-0 flex-1 items-center gap-2 px-1 py-2", v.value ? "text-theme-700" : "text-white/80"])
4912
4907
  }, [
4913
4908
  m[29] || (m[29] = w("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
4914
- w("span", oo, W(g.value), 1),
4909
+ w("span", oo, j(g.value), 1),
4915
4910
  w("span", {
4916
4911
  class: C(["min-w-0 truncate text-sm", v.value ? "text-theme-400" : "text-white/45"])
4917
- }, W(M.value), 3)
4918
- ], 2)) : Bs((h(), f("textarea", {
4912
+ }, j(M.value), 3)
4913
+ ], 2)) : Fs((h(), f("textarea", {
4919
4914
  key: 0,
4920
4915
  ref_key: "textarea",
4921
4916
  ref: s,
@@ -4931,12 +4926,12 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4931
4926
  onFocus: m[8] || (m[8] = (T) => n.value = !0),
4932
4927
  onBlur: m[9] || (m[9] = (T) => n.value = !1)
4933
4928
  }, null, 42, lo)), [
4934
- [ya, vt.value]
4929
+ [ka, vt.value]
4935
4930
  ]),
4936
- rt.value || ye.value ? (h(), f("button", {
4931
+ rt.value || be.value ? (h(), f("button", {
4937
4932
  key: 2,
4938
4933
  "data-test": "messaging-record-audio-btn",
4939
- class: C(["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", ye.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : v.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"]),
4934
+ class: C(["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", be.value ? "bg-theme-900 text-theme-0 scale-105 cursor-pointer" : v.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"]),
4940
4935
  "aria-label": u.value,
4941
4936
  title: u.value,
4942
4937
  onPointerdown: m[10] || (m[10] = Le((T) => je(), ["prevent"])),
@@ -4953,9 +4948,9 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4953
4948
  ]
4954
4949
  }, [
4955
4950
  w("i", {
4956
- class: C([ye.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
4951
+ class: C([be.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-5"])
4957
4952
  }, null, 2),
4958
- w("span", uo, W(u.value), 1)
4953
+ w("span", uo, j(u.value), 1)
4959
4954
  ], 42, co)) : (h(), f("button", {
4960
4955
  key: 3,
4961
4956
  "data-test": "messaging-send-btn",
@@ -4967,7 +4962,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4967
4962
  onClick: m[18] || (m[18] = (T) => pe())
4968
4963
  }, [
4969
4964
  Ie.value === "stop" ? (h(), f("i", po)) : (h(), f("i", fo)),
4970
- w("span", mo, W(Be.value), 1)
4965
+ w("span", mo, j(Be.value), 1)
4971
4966
  ], 10, ho))
4972
4967
  ], 10, no)
4973
4968
  ], 2)
@@ -4990,7 +4985,7 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
4990
4985
  apiBase: {}
4991
4986
  },
4992
4987
  setup(a) {
4993
- const t = Ta("AgentWrap"), e = a, n = e.sdk || Sa.getInstance({
4988
+ const t = Sa("AgentWrap"), e = a, n = e.sdk || Aa.getInstance({
4994
4989
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
4995
4990
  ...e.apiBase && { apiBase: e.apiBase }
4996
4991
  }), i = ge(!e.agent), s = ht(e.agent ? new hn({ config: e.agent }) : void 0), l = ge();
@@ -5082,22 +5077,22 @@ const zr = ["data-visual-type", "data-chart-type", "data-stacking", "data-diagra
5082
5077
  buttonText: a.buttonText,
5083
5078
  buttonIcon: a.buttonIcon,
5084
5079
  loading: i.value
5085
- }) : j("", !0)
5080
+ }) : H("", !0)
5086
5081
  ]));
5087
5082
  }
5088
5083
  });
5089
5084
  export {
5090
- hs as A,
5085
+ ps as A,
5091
5086
  Ro as _,
5092
- Yt as a,
5093
- _o as b,
5087
+ Kt as a,
5088
+ Eo as b,
5094
5089
  Ao as c,
5095
5090
  So as d,
5096
- Eo as e,
5091
+ _o as e,
5097
5092
  En as f,
5098
5093
  wo as g,
5099
5094
  Va as h,
5100
- fs as i,
5095
+ ms as i,
5101
5096
  To as p
5102
5097
  };
5103
5098
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map