@pagelines/sdk 1.0.686 → 1.0.688

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/AgentWrap.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import "./rolldown-runtime.js";
2
2
  import { s as e, t } from "./sdkClient.js";
3
- import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, getDefaultAvatarUrl as s, isAssistantSilenceControl as c, parseChatVisualFencePayload as u } from "@pagelines/core";
4
- import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as _, createElementVNode as v, createTextVNode as te, createVNode as b, defineComponent as x, nextTick as ne, normalizeClass as S, normalizeStyle as C, onBeforeUnmount as re, onMounted as ie, onUnmounted as ae, openBlock as T, ref as k, renderList as A, renderSlot as oe, resolveDynamicComponent as j, shallowRef as se, toDisplayString as P, unref as ce, vModelText as ue, watch as de, withCtx as F, withDirectives as pe, withKeys as he, withModifiers as I } from "vue";
3
+ import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatVisualFencePayload as c } from "@pagelines/core";
4
+ import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as A, renderList as j, renderSlot as ie, resolveDynamicComponent as ae, shallowRef as oe, toDisplayString as P, unref as se, vModelText as F, watch as ce, withCtx as ue, withDirectives as I, withKeys as de, withModifiers as R } from "vue";
5
5
  //#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
6
- var _e = { class: "spinner max-w-sm" }, R = {
6
+ var pe = { class: "spinner max-w-sm" }, he = {
7
7
  class: "ring-circular h-full w-full origin-center",
8
8
  viewBox: "25 25 50 50"
9
- }, ve = /* @__PURE__ */ x({
9
+ }, _e = /* @__PURE__ */ x({
10
10
  __name: "FSpinner",
11
11
  props: {
12
12
  width: {
@@ -19,8 +19,8 @@ var _e = { class: "spinner max-w-sm" }, R = {
19
19
  }
20
20
  },
21
21
  setup(e) {
22
- return (t, n) => (T(), _("div", _e, [(T(), _("svg", R, [v("circle", {
23
- class: S([e.colorMode, "ring-path"]),
22
+ return (t, n) => (k(), h("div", pe, [(k(), h("svg", he, [_("circle", {
23
+ class: C([e.colorMode, "ring-path"]),
24
24
  cx: "50",
25
25
  cy: "50",
26
26
  r: "20",
@@ -30,7 +30,7 @@ var _e = { class: "spinner max-w-sm" }, R = {
30
30
  "stroke-miterlimit": "30"
31
31
  }, null, 2)]))]));
32
32
  }
33
- }), ye = [
33
+ }), ve = [
34
34
  {
35
35
  mode: "self",
36
36
  label: "Overview",
@@ -70,10 +70,10 @@ function recorderMimeType() {
70
70
  }
71
71
  var VoiceRecorderController = class extends i {
72
72
  constructor(t) {
73
- super("VoiceRecorderController", t), e(this, "state", k({
73
+ super("VoiceRecorderController", t), e(this, "state", A({
74
74
  phase: "idle",
75
75
  elapsedMs: 0
76
- })), e(this, "isActive", p(() => this.state.value.phase !== "idle")), e(this, "isBusy", p(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", p(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", p(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
76
+ })), e(this, "isActive", f(() => this.state.value.phase !== "idle")), e(this, "isBusy", f(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", f(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", f(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
77
77
  }
78
78
  get canUseBrowserRecording() {
79
79
  return !!this.settings.getUserMedia || typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia && typeof MediaRecorder < "u";
@@ -185,7 +185,7 @@ var VoiceRecorderController = class extends i {
185
185
  function durableJournalOutcome(e) {
186
186
  return e.turnOutcome === "failed" ? "failed" : e.turnOutcome === "stopped" ? "stopped" : e.sender === "system" ? "failed" : "completed";
187
187
  }
188
- var z = {
188
+ var ye = {
189
189
  waiting: "Waiting for results",
190
190
  finishing: "Finishing up",
191
191
  completed: "Work complete",
@@ -193,7 +193,7 @@ var z = {
193
193
  stopped: "Stopped",
194
194
  notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.",
195
195
  leaveHint: "Taking longer than usual. You can leave this chat while I work."
196
- }, be = 15e3, B = 6e4, Se = 3;
196
+ }, z = 15e3, be = 6e4, B = 3;
197
197
  function toMs(e) {
198
198
  if (!e) return;
199
199
  let t = Date.parse(e);
@@ -209,7 +209,7 @@ function milestoneRows(e, t) {
209
209
  let n = e.filter((e) => e.status === "completed" || e.status === "failed" && !!e.note).filter((e) => !t.has(e.activityId)).slice().sort(byEvent), r = [];
210
210
  for (let e of n) {
211
211
  let t = e.status === "completed" ? "done" : "failed", n = r[r.length - 1];
212
- if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= be) {
212
+ if (t === "done" && n?.tone === "done" && n.label === e.label && eventMs(e) - n.lastMs <= z) {
213
213
  n.count += 1, n.lastMs = eventMs(e);
214
214
  continue;
215
215
  }
@@ -230,12 +230,12 @@ function milestoneRows(e, t) {
230
230
  }));
231
231
  }
232
232
  function splitRows(e) {
233
- return e.length <= Se ? {
233
+ return e.length <= B ? {
234
234
  visibleRows: e,
235
235
  hiddenRows: []
236
236
  } : {
237
- visibleRows: e.slice(e.length - Se),
238
- hiddenRows: e.slice(0, e.length - Se)
237
+ visibleRows: e.slice(e.length - B),
238
+ hiddenRows: e.slice(0, e.length - B)
239
239
  };
240
240
  }
241
241
  function buildWorkJournalModel(e) {
@@ -247,7 +247,7 @@ function buildWorkJournalModel(e) {
247
247
  terminal: {
248
248
  id: "work-complete",
249
249
  tone: "completed",
250
- label: z.completed
250
+ label: ye.completed
251
251
  }
252
252
  };
253
253
  if (n === "failed") {
@@ -261,7 +261,7 @@ function buildWorkJournalModel(e) {
261
261
  terminal: {
262
262
  id: "work-failed",
263
263
  tone: "failed",
264
- label: z.failed,
264
+ label: ye.failed,
265
265
  ...o && e?.note ? { note: e.note } : {}
266
266
  }
267
267
  };
@@ -275,25 +275,25 @@ function buildWorkJournalModel(e) {
275
275
  terminal: {
276
276
  id: "work-stopped",
277
277
  tone: "stopped",
278
- label: z.stopped
278
+ label: ye.stopped
279
279
  }
280
280
  };
281
281
  }
282
282
  let { visibleRows: s, hiddenRows: c } = splitRows(milestoneRows(t, /* @__PURE__ */ new Set())), u = t.filter((e) => e.status === "started").sort(byEvent).pop(), f = t.reduce((e, t) => Math.max(e, eventMs(t)), a ?? -Infinity), p = Number.isFinite(f) ? f : r, m = t.reduce((e, t) => {
283
283
  let n = toMs(t.startedAt) ?? toMs(t.endedAt);
284
284
  return n === void 0 ? e : Math.min(e, n);
285
- }, Infinity), h = p + be, _ = (Number.isFinite(m) ? m : p) + B, v = r >= h, te = u || v ? {
285
+ }, Infinity), h = p + z, _ = (Number.isFinite(m) ? m : p) + be, v = r >= h, b = u || v ? {
286
286
  id: u?.activityId ?? "work-active",
287
287
  tone: "active",
288
- label: v ? u ? z.waiting : z.finishing : u.label
289
- } : void 0, b = v && r >= _ ? i ? z.notifyHint : z.leaveHint : void 0, x = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
288
+ label: v ? u ? ye.waiting : ye.finishing : u.label
289
+ } : void 0, x = v && r >= _ ? i ? ye.notifyHint : ye.leaveHint : void 0, S = [h, _].filter((e) => e > r).sort((e, t) => e - t)[0];
290
290
  return {
291
291
  outcome: n,
292
292
  visibleRows: s,
293
293
  hiddenRows: c,
294
- ...te ? { terminal: te } : {},
295
- ...b ? { hint: b } : {},
296
- ...x === void 0 ? {} : { nextBoundaryAtMs: x }
294
+ ...b ? { terminal: b } : {},
295
+ ...x ? { hint: x } : {},
296
+ ...S === void 0 ? {} : { nextBoundaryAtMs: S }
297
297
  };
298
298
  }
299
299
  function buildLiveTurnBlocks(e) {
@@ -352,17 +352,17 @@ function buildLiveTurnBlocks(e) {
352
352
  }
353
353
  //#endregion
354
354
  //#region agent/AgentController.ts
355
- var H = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Ce = /* @__PURE__ */ new Set([
356
- ...H,
355
+ var Se = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), H = /* @__PURE__ */ new Set([
356
+ ...Se,
357
357
  "EMPTY_STREAM",
358
358
  "RATE_LIMIT"
359
- ]), U = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), we = {
359
+ ]), Ce = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), U = {
360
360
  CREDIT_LIMIT: "billing_budget_reached",
361
361
  OVERAGE_CAP: "billing_runaway_cap"
362
362
  };
363
363
  function presentChatStreamError(e) {
364
- if (!(e.bucket !== void 0 || Ce.has(e.code))) return { surface: "hard" };
365
- let t = e.bucket ?? (H.has(e.code) ? "account" : "error"), n = {
364
+ if (!(e.bucket !== void 0 || H.has(e.code))) return { surface: "hard" };
365
+ let t = e.bucket ?? (Se.has(e.code) ? "account" : "error"), n = {
366
366
  ...e.actionLabel ? { actionLabel: e.actionLabel } : {},
367
367
  ...e.actionUrl ? { actionUrl: e.actionUrl } : {},
368
368
  ...e.help ? { help: e.help } : {}
@@ -375,7 +375,7 @@ function presentChatStreamError(e) {
375
375
  ...n
376
376
  },
377
377
  sendBlockedReason: "account"
378
- } : U.has(e.code) ? {
378
+ } : Ce.has(e.code) ? {
379
379
  surface: "transcript",
380
380
  issue: {
381
381
  code: e.code,
@@ -393,7 +393,7 @@ function presentChatStreamError(e) {
393
393
  };
394
394
  }
395
395
  function transcriptMessageForChatStreamError(e) {
396
- let t = we[e.code];
396
+ let t = U[e.code];
397
397
  return t ? r[t].oneLine : e.error;
398
398
  }
399
399
  var AgentChatController = class extends i {
@@ -401,16 +401,16 @@ var AgentChatController = class extends i {
401
401
  super("AgentChatController", t), e(this, "isTextMode", !1), e(this, "lastMessage", {
402
402
  hash: "",
403
403
  time: 0
404
- }), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", se(Date.now())), e(this, "toolActivityTiming", se({})), e(this, "lastVisibleProgressAtMs", se()), e(this, "liveSegments", se([])), e(this, "liveStreamMessageId", se(void 0)), e(this, "conversationId", void 0), e(this, "textState", k({
404
+ }), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", oe(Date.now())), e(this, "toolActivityTiming", oe({})), e(this, "lastVisibleProgressAtMs", oe()), e(this, "liveSegments", oe([])), e(this, "liveStreamMessageId", oe(void 0)), e(this, "conversationId", void 0), e(this, "textState", A({
405
405
  isActive: !1,
406
406
  isConnected: !1,
407
407
  isThinking: !1,
408
408
  connectionStatus: "disconnected"
409
- })), e(this, "agentMode", k("self")), e(this, "sharedMessages", k([])), e(this, "composerState", k({
409
+ })), e(this, "agentMode", A("self")), e(this, "sharedMessages", A([])), e(this, "composerState", A({
410
410
  text: "",
411
411
  pendingAttachments: [],
412
412
  isUploading: !1
413
- })), e(this, "workJournal", p(() => {
413
+ })), e(this, "workJournal", f(() => {
414
414
  let e = this.textState.value.isThinking ? "running" : this.textState.value.turnOutcome;
415
415
  if (!e) return;
416
416
  let t = this.textState.value.toolActivities;
@@ -421,7 +421,7 @@ var AgentChatController = class extends i {
421
421
  canNotifyOnCompletion: !1,
422
422
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
423
423
  });
424
- })), e(this, "liveTurnBlocks", p(() => {
424
+ })), e(this, "liveTurnBlocks", f(() => {
425
425
  if (!this.textState.value.isThinking) return [];
426
426
  let e = this.textState.value.toolActivities ?? [], t = this.liveSegments.value;
427
427
  return !t.length && !e.length ? [] : buildLiveTurnBlocks({
@@ -431,14 +431,14 @@ var AgentChatController = class extends i {
431
431
  canNotifyOnCompletion: !1,
432
432
  lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
433
433
  });
434
- })), e(this, "canUseComposer", p(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking)), e(this, "canAttachFile", p(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", p(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
434
+ })), e(this, "canUseComposer", f(() => this.textState.value.isConnected && !this.textState.value.sendBlockedReason && !this.composerState.value.isUploading && !this.textState.value.isThinking)), e(this, "canAttachFile", f(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", f(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
435
435
  getCanRecord: () => this.canRecordAudio.value,
436
436
  getUploadFn: () => {
437
437
  let e = this.settings.uploadFileFn;
438
438
  return e ? (t) => e({ file: t }) : void 0;
439
439
  },
440
440
  getChatController: () => this
441
- })), e(this, "canSend", p(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", p(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", p(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle")), e(this, "_agent", void 0), this._agent = t.agent instanceof n ? t.agent : new n({ config: t.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
441
+ })), e(this, "canSend", f(() => (this.composerState.value.text.trim().length > 0 || this.composerState.value.pendingAttachments.length > 0) && this.canUseComposer.value && !this.voiceRecorder.isBusy.value)), e(this, "canStop", f(() => this.textState.value.isThinking && !this.composerState.value.isUploading && !this.voiceRecorder.isBusy.value)), e(this, "composerAction", f(() => this.canStop.value ? "stop" : this.canSend.value ? "send" : "idle")), e(this, "_agent", void 0), this._agent = t.agent instanceof n ? t.agent : new n({ config: t.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher(), this.setupBoundaryWatcher();
442
442
  }
443
443
  get chatEnabled() {
444
444
  let e = this._agent.state.value.lifecycle;
@@ -569,7 +569,7 @@ Current User:
569
569
  });
570
570
  }
571
571
  setupBoundaryWatcher() {
572
- de(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
572
+ ce(() => this.workJournal.value?.nextBoundaryAtMs, (e) => {
573
573
  this.scheduleBoundary(e);
574
574
  });
575
575
  }
@@ -631,12 +631,12 @@ Current User:
631
631
  });
632
632
  }
633
633
  setupModeWatcher() {
634
- de(this.agentMode, async (e, t) => {
634
+ ce(this.agentMode, async (e, t) => {
635
635
  this.logger.info(`Mode changed from ${t} to ${e}`), this.isTextMode && (t === "talk" || t === "chat") && await this.endConversation();
636
636
  });
637
637
  }
638
638
  setupAvailabilityWatcher() {
639
- de(() => this.chatEnabled, (e) => {
639
+ ce(() => this.chatEnabled, (e) => {
640
640
  if (!(!this.isTextMode || this.isConnecting)) {
641
641
  if (e) {
642
642
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -725,7 +725,7 @@ Current User:
725
725
  transientIssue: void 0,
726
726
  turnOutcome: void 0
727
727
  });
728
- let i = ++this.activeTurnGeneration, a = `stream-${Date.now()}`, o = !1, s = !1, isCurrentTurn = () => i === this.activeTurnGeneration, onDelta = (e, t = "assistant") => {
728
+ let i = ++this.activeTurnGeneration, a = `stream-${Date.now()}`, o = !1, c = !1, isCurrentTurn = () => i === this.activeTurnGeneration, onDelta = (e, t = "assistant") => {
729
729
  if (!isCurrentTurn()) return;
730
730
  this.updateState(this.textState, { workingDescription: void 0 }), t === "assistant" && (this.lastVisibleProgressAtMs.value = Date.now()), o || (o = !0, this.liveStreamMessageId.value = a, this.sharedMessages.value = [...this.sharedMessages.value, {
731
731
  id: a,
@@ -745,7 +745,7 @@ Current User:
745
745
  s?.id === a && (s.text += e, this.sharedMessages.value = [...i]);
746
746
  }, onMessage = (e) => {
747
747
  if (!isCurrentTurn()) return;
748
- if (s = !0, e.sender === "agent" && c(e.text)) {
748
+ if (c = !0, e.sender === "agent" && s(e.text)) {
749
749
  this.liveSegments.value = [], this.liveStreamMessageId.value = void 0, this.sharedMessages.value = this.sharedMessages.value.filter((e) => e.id !== a);
750
750
  return;
751
751
  }
@@ -771,16 +771,16 @@ Current User:
771
771
  let e = i[i.length - 1];
772
772
  this.sharedMessages.value = e?.id === a ? [...i.slice(0, -1), r] : [...i, r];
773
773
  }
774
- r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && U.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
774
+ r.sender === "system" && r.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : r.sender === "system" && r.issue?.code && Ce.has(r.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
775
775
  }, onDone = (e) => {
776
776
  if (!isCurrentTurn()) return;
777
- if (!o && !s) {
777
+ if (!o && !c) {
778
778
  onError("empty_stream — assistant returned no content");
779
779
  return;
780
780
  }
781
781
  this.finishToolActivities("completed");
782
782
  let t = this.sharedMessages.value, n = t[t.length - 1];
783
- n?.id === a && n.sender === "agent" && c(n.text) && (this.sharedMessages.value = t.slice(0, -1)), e && (this.conversationId = e), this.updateState(this.textState, {
783
+ n?.id === a && n.sender === "agent" && s(n.text) && (this.sharedMessages.value = t.slice(0, -1)), e && (this.conversationId = e), this.updateState(this.textState, {
784
784
  isThinking: !1,
785
785
  workingDescription: void 0,
786
786
  transientIssue: void 0
@@ -906,7 +906,7 @@ Current User:
906
906
  }
907
907
  loadMessages(e) {
908
908
  this.conversationId = e.conversationId;
909
- let t = this.sharedMessages.value, n = e.messages.filter((e) => e.sender !== "agent" || !c(e.text));
909
+ let t = this.sharedMessages.value, n = e.messages.filter((e) => e.sender !== "agent" || !s(e.text));
910
910
  this.sharedMessages.value = [...n, ...t], e.activeToolActivities?.length && (e.activeToolActivities.forEach((e) => this.rememberToolActivity(e)), this.updateState(this.textState, {
911
911
  isThinking: !0,
912
912
  workingDescription: void 0,
@@ -929,11 +929,11 @@ function getImageSrc(e) {
929
929
  return e ? typeof e == "string" ? e : e.src || "" : "";
930
930
  }
931
931
  function getAgentAvatarUrl(e) {
932
- return getImageSrc(e.cover) || getImageSrc(e.avatar) || s(e.name);
932
+ return getImageSrc(e.cover) || getImageSrc(e.avatar) || o(e.name);
933
933
  }
934
934
  function handleImageError(e) {
935
935
  let t = e.target;
936
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = s());
936
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = o());
937
937
  }
938
938
  function parseButtonTemplate(e) {
939
939
  let { template: t, agent: n } = e;
@@ -941,10 +941,10 @@ function parseButtonTemplate(e) {
941
941
  }
942
942
  //#endregion
943
943
  //#region agent/ui/ElAgentButton.vue?vue&type=script&setup=true&lang.ts
944
- var Te = {
944
+ var we = {
945
945
  key: 0,
946
946
  class: "absolute inset-0 flex items-center justify-center"
947
- }, Ee = /* @__PURE__ */ x({
947
+ }, Te = /* @__PURE__ */ x({
948
948
  __name: "ElAgentButton",
949
949
  props: {
950
950
  theme: { default: "primary" },
@@ -957,40 +957,40 @@ var Te = {
957
957
  iconAfter: {}
958
958
  },
959
959
  setup(e) {
960
- let t = p(() => ({
960
+ let t = f(() => ({
961
961
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
962
962
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
963
963
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
964
964
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20",
965
965
  dark: "bg-theme-900 border-transparent hover:bg-theme-800"
966
- })[e.theme]), n = p(() => ({
966
+ })[e.theme]), n = f(() => ({
967
967
  sm: "px-4 py-2 text-sm",
968
968
  md: "px-6 py-3 text-base",
969
969
  lg: "px-8 py-4 text-base"
970
- })[e.size]), r = p(() => ({
970
+ })[e.size]), r = f(() => ({
971
971
  sm: "size-4",
972
972
  md: "size-4",
973
973
  lg: "size-5"
974
974
  })[e.size]);
975
- return (i, a) => (T(), _("button", { class: S(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, n.value]]) }, [e.loading ? (T(), _("div", Te, [...a[0] || (a[0] = [v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : h("", !0), v("span", { class: S(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
976
- e.icon ? (T(), _("i", {
975
+ return (i, a) => (k(), h("button", { class: C(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, n.value]]) }, [e.loading ? (k(), h("div", we, [...a[0] || (a[0] = [_("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)])])) : m("", !0), _("span", { class: C(["flex items-center gap-2 transition-opacity duration-200", e.loading ? "opacity-0" : "opacity-100"]) }, [
976
+ e.icon ? (k(), h("i", {
977
977
  key: 0,
978
- class: S([e.icon, r.value])
979
- }, null, 2)) : h("", !0),
980
- oe(i.$slots, "default"),
981
- e.iconAfter ? (T(), _("i", {
978
+ class: C([e.icon, r.value])
979
+ }, null, 2)) : m("", !0),
980
+ ie(i.$slots, "default"),
981
+ e.iconAfter ? (k(), h("i", {
982
982
  key: 1,
983
- class: S([e.iconAfter, r.value])
984
- }, null, 2)) : h("", !0)
983
+ class: C([e.iconAfter, r.value])
984
+ }, null, 2)) : m("", !0)
985
985
  ], 2)], 2));
986
986
  }
987
- }), De = ["value"], Oe = /* @__PURE__ */ x({
987
+ }), Ee = ["value"], De = /* @__PURE__ */ x({
988
988
  __name: "AgentInputEmail",
989
989
  props: { modelValue: { default: "" } },
990
990
  emits: ["update:modelValue"],
991
991
  setup(e, { emit: t }) {
992
992
  let n = t;
993
- return (t, r) => (T(), _("input", {
993
+ return (t, r) => (k(), h("input", {
994
994
  name: "username",
995
995
  type: "email",
996
996
  inputmode: "email",
@@ -1003,9 +1003,9 @@ var Te = {
1003
1003
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
1004
1004
  style: { "font-size": "16px" },
1005
1005
  onInput: r[0] || (r[0] = (e) => n("update:modelValue", e.target.value))
1006
- }, null, 40, De));
1006
+ }, null, 40, Ee));
1007
1007
  }
1008
- }), ke = ["placeholder", "value"], Ae = /* @__PURE__ */ x({
1008
+ }), Oe = ["placeholder", "value"], ke = /* @__PURE__ */ x({
1009
1009
  __name: "AgentInputOneTimeCode",
1010
1010
  props: {
1011
1011
  modelValue: {},
@@ -1014,15 +1014,15 @@ var Te = {
1014
1014
  },
1015
1015
  emits: ["update:modelValue", "autoSubmit"],
1016
1016
  setup(e, { emit: t }) {
1017
- let n = e, r = t, i = k(null), a = p(() => "0".repeat(n.length));
1018
- ie(() => {
1017
+ let n = e, r = t, i = A(null), a = f(() => "0".repeat(n.length));
1018
+ ne(() => {
1019
1019
  n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
1020
1020
  });
1021
1021
  function onInput(e) {
1022
1022
  let t = e.target.value.replace(/\D/g, "").slice(0, n.length);
1023
1023
  r("update:modelValue", t), t.length === n.length && r("autoSubmit", t);
1024
1024
  }
1025
- return (t, n) => (T(), _("input", {
1025
+ return (t, n) => (k(), h("input", {
1026
1026
  ref_key: "input",
1027
1027
  ref: i,
1028
1028
  name: "one-time-code",
@@ -1038,12 +1038,12 @@ var Te = {
1038
1038
  class: "w-full px-6 py-3 text-center font-mono tracking-[0.35em] text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-colors",
1039
1039
  style: { "font-size": "16px" },
1040
1040
  onInput
1041
- }, null, 40, ke));
1041
+ }, null, 40, Oe));
1042
1042
  }
1043
- }), W = { class: "relative flex-shrink-0" }, je = ["src", "alt"], Me = { class: "absolute top-1 right-1" }, Ne = {
1043
+ }), Ae = { class: "relative flex-shrink-0" }, je = ["src", "alt"], W = { class: "absolute top-1 right-1" }, Me = {
1044
1044
  key: 1,
1045
1045
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
1046
- }, Pe = { class: "min-w-0" }, Fe = /* @__PURE__ */ x({
1046
+ }, Ne = { class: "min-w-0" }, Pe = /* @__PURE__ */ x({
1047
1047
  __name: "ElModeHeader",
1048
1048
  props: {
1049
1049
  agent: {},
@@ -1055,49 +1055,104 @@ var Te = {
1055
1055
  layout: { default: "centered" }
1056
1056
  },
1057
1057
  setup(e) {
1058
- return (t, n) => (T(), _("div", { class: S(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [v("div", W, [v("div", { class: S(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [v("img", {
1058
+ return (t, n) => (k(), h("div", { class: C(["flex gap-4", [e.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"]]) }, [_("div", Ae, [_("div", { class: C(["rounded-full overflow-hidden border-white", e.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"]) }, [_("img", {
1059
1059
  src: e.agent.avatarUrl.value,
1060
1060
  alt: e.agent.displayName.value,
1061
1061
  class: "w-full h-full object-cover",
1062
- onError: n[0] || (n[0] = (...e) => ce(handleImageError) && ce(handleImageError)(...e))
1063
- }, null, 40, je)], 2), v("div", Me, [e.isOnline ? (T(), _(f, { key: 0 }, [n[1] || (n[1] = v("div", {
1062
+ onError: n[0] || (n[0] = (...e) => se(handleImageError) && se(handleImageError)(...e))
1063
+ }, null, 40, je)], 2), _("div", W, [e.isOnline ? (k(), h(u, { key: 0 }, [n[1] || (n[1] = _("div", {
1064
1064
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
1065
1065
  style: { "animation-duration": "3s" }
1066
- }, null, -1)), n[2] || (n[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (T(), _("div", Ne))])]), v("div", Pe, [v("h1", { class: S(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, P(e.agent.displayName.value), 3), v("p", { class: S(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, P(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
1066
+ }, null, -1)), n[2] || (n[2] = _("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))], 64)) : (k(), h("div", Me))])]), _("div", Ne, [_("h1", { class: C(["font-light text-white mb-1 truncate", [e.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight", e.layout === "horizontal" ? "text-white/95" : ""]]) }, P(e.agent.displayName.value), 3), _("p", { class: C(["font-light line-clamp-1", [e.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base", e.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"]]) }, P(e.layout === "horizontal" ? e.agent.title.value || "Assistant" : e.agent.title.value), 3)])], 2));
1067
1067
  }
1068
- }), Ie = {
1068
+ }), Fe = { class: "relative shrink-0 rounded-full" }, Ie = ["src", "alt"], Le = ["src", "alt"], Re = ["aria-label"], ze = /* @__PURE__ */ x({
1069
+ __name: "AgentAvatar",
1070
+ props: {
1071
+ agent: {},
1072
+ showStatus: {
1073
+ type: Boolean,
1074
+ default: !0
1075
+ },
1076
+ isLight: {
1077
+ type: Boolean,
1078
+ default: !0
1079
+ }
1080
+ },
1081
+ setup(e) {
1082
+ let t = {
1083
+ green: "bg-green-500",
1084
+ amber: "bg-amber-500",
1085
+ red: "bg-red-500",
1086
+ grey: "bg-theme-300"
1087
+ }, n = f(() => {
1088
+ let n = e.agent.state.value;
1089
+ return e.showStatus && n.lifecycle !== "unknown" ? t[n.color] : null;
1090
+ }), r = {
1091
+ width: "clamp(7px, 14%, 14px)",
1092
+ height: "clamp(7px, 14%, 14px)",
1093
+ top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
1094
+ right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
1095
+ }, i = f(() => e.isLight ? "ring-white" : "ring-theme-900");
1096
+ return (t, a) => (k(), h("div", Fe, [
1097
+ _("img", {
1098
+ src: e.agent.avatarUrl.value,
1099
+ alt: e.agent.displayName.value,
1100
+ class: C(["size-full rounded-full object-cover ring-1", e.isLight ? "ring-black/5" : "ring-white/10"])
1101
+ }, null, 10, Ie),
1102
+ e.agent.ownerMarkUrl.value ? (k(), h("img", {
1103
+ key: 0,
1104
+ src: e.agent.ownerMarkUrl.value,
1105
+ alt: e.agent.owner.value?.fullName ? `Owned by ${e.agent.owner.value.fullName}` : "Owner",
1106
+ class: C(["absolute z-10 size-[36%] -bottom-[3%] -left-[3%] rounded-full object-cover ring-2", i.value])
1107
+ }, null, 10, Le)) : m("", !0),
1108
+ n.value ? (k(), h("span", {
1109
+ key: 1,
1110
+ role: "status",
1111
+ "aria-label": e.agent.state.value.tooltip,
1112
+ class: C(["absolute z-10 rounded-full ring-2", [n.value, i.value]]),
1113
+ style: r
1114
+ }, null, 10, Re)) : m("", !0),
1115
+ n.value && e.agent.state.value.lifecycle === "running" ? (k(), h("span", {
1116
+ key: 2,
1117
+ "aria-hidden": "true",
1118
+ class: C(["pointer-events-none absolute rounded-full animate-ping opacity-50 [animation-duration:3s]", n.value]),
1119
+ style: r
1120
+ }, null, 2)) : m("", !0)
1121
+ ]));
1122
+ }
1123
+ }), Be = {
1069
1124
  key: 0,
1070
1125
  class: "sr-only",
1071
1126
  role: "status",
1072
1127
  "aria-live": "polite"
1073
- }, Le = ["aria-expanded", "disabled"], Re = ["aria-expanded"], ze = {
1128
+ }, Ve = ["aria-expanded", "disabled"], He = ["aria-expanded"], Ue = {
1074
1129
  class: "flex w-5 shrink-0 justify-center self-stretch",
1075
1130
  "aria-hidden": "true"
1076
- }, Be = ["data-journal-row"], G = {
1131
+ }, We = ["data-journal-row"], G = {
1077
1132
  class: "flex w-5 shrink-0 flex-col items-center self-stretch",
1078
1133
  "aria-hidden": "true"
1079
- }, Ve = { class: "flex h-[17px] shrink-0 items-center" }, He = {
1134
+ }, Ge = { class: "flex h-[17px] shrink-0 items-center" }, Ke = {
1080
1135
  key: 0,
1081
1136
  class: "sr-only"
1082
- }, Ue = /* @__PURE__ */ x({
1137
+ }, qe = /* @__PURE__ */ x({
1083
1138
  __name: "AgentToolActivityGroup",
1084
1139
  props: {
1085
1140
  model: {},
1086
1141
  isLight: { type: Boolean }
1087
1142
  },
1088
1143
  setup(e) {
1089
- let t = e, n = se(!1);
1144
+ let t = e, n = oe(!1);
1090
1145
  function toggle() {
1091
1146
  n.value = !n.value;
1092
1147
  }
1093
- let r = p(() => t.model.outcome === "completed"), i = p(() => t.model.hiddenRows.length), a = p(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = p(() => {
1148
+ let r = f(() => t.model.outcome === "completed"), i = f(() => t.model.hiddenRows.length), a = f(() => t.model.hint ?? (t.model.terminal?.tone === "active" ? t.model.terminal.label : void 0)), o = f(() => {
1094
1149
  let e = t.model;
1095
1150
  return r.value ? n.value ? e.hiddenRows : [] : [
1096
1151
  ...n.value ? e.hiddenRows : [],
1097
1152
  ...e.visibleRows,
1098
1153
  ...e.terminal ? [e.terminal] : []
1099
1154
  ];
1100
- }), s = p(() => t.isLight ? {
1155
+ }), s = f(() => t.isLight ? {
1101
1156
  spine: "bg-theme-200",
1102
1157
  dashed: "border-theme-300",
1103
1158
  doneMark: "text-theme-400",
@@ -1113,7 +1168,7 @@ var Te = {
1113
1168
  stoppedSquare: "bg-white/55",
1114
1169
  muted: "text-white/55",
1115
1170
  ring: "focus-visible:ring-white"
1116
- }), c = p(() => {
1171
+ }), c = f(() => {
1117
1172
  let e = t.isLight;
1118
1173
  return {
1119
1174
  done: {
@@ -1156,64 +1211,64 @@ var Te = {
1156
1211
  }
1157
1212
  };
1158
1213
  });
1159
- return (t, u) => (T(), _("div", { class: S(["w-full py-0.5", s.value.muted]) }, [
1160
- a.value ? (T(), _("span", Ie, P(a.value), 1)) : h("", !0),
1161
- r.value ? (T(), _("button", {
1214
+ return (t, f) => (k(), h("div", { class: C(["w-full py-0.5", s.value.muted]) }, [
1215
+ a.value ? (k(), h("span", Be, P(a.value), 1)) : m("", !0),
1216
+ r.value ? (k(), h("button", {
1162
1217
  key: 1,
1163
1218
  type: "button",
1164
1219
  "data-test": "messaging-tool-activity-summary",
1165
1220
  "data-journal-disclosure": "",
1166
1221
  "aria-expanded": n.value,
1167
1222
  disabled: i.value === 0,
1168
- class: S(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
1223
+ class: C(["flex min-h-11 items-center gap-x-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-default", s.value.ring]),
1169
1224
  onClick: toggle
1170
1225
  }, [
1171
- u[0] || (u[0] = v("i", {
1226
+ f[0] || (f[0] = _("i", {
1172
1227
  "data-journal-station": "completed",
1173
1228
  class: "i-tabler-circle-check size-3.5 shrink-0 text-green-600",
1174
1229
  "aria-hidden": "true"
1175
1230
  }, null, -1)),
1176
- v("span", { class: S(["text-[12.5px] font-medium leading-none", s.value.muted]) }, P(e.model.terminal?.label), 3),
1177
- i.value ? (T(), _("i", {
1231
+ _("span", { class: C(["text-[12.5px] font-medium leading-none", s.value.muted]) }, P(e.model.terminal?.label), 3),
1232
+ i.value ? (k(), h("i", {
1178
1233
  key: 0,
1179
- class: S(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1234
+ class: C(["size-[13px] shrink-0", [n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right", s.value.muted]]),
1180
1235
  "aria-hidden": "true"
1181
- }, null, 2)) : h("", !0)
1182
- ], 10, Le)) : i.value ? (T(), _("button", {
1236
+ }, null, 2)) : m("", !0)
1237
+ ], 10, Ve)) : i.value ? (k(), h("button", {
1183
1238
  key: 2,
1184
1239
  type: "button",
1185
1240
  "data-test": "messaging-tool-activity-summary",
1186
1241
  "data-journal-disclosure": "",
1187
1242
  "aria-expanded": n.value,
1188
- class: S(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", s.value.ring]),
1243
+ class: C(["flex min-h-11 w-full gap-x-2.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", s.value.ring]),
1189
1244
  onClick: toggle
1190
- }, [v("span", ze, [v("span", {
1245
+ }, [_("span", Ue, [_("span", {
1191
1246
  "data-journal-spine": "dashed",
1192
- class: S(["w-0 border-l border-dashed", s.value.dashed])
1193
- }, null, 2)]), v("span", { class: S(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [te(P(i.value) + " earlier updates ", 1), v("i", {
1194
- class: S(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1247
+ class: C(["w-0 border-l border-dashed", s.value.dashed])
1248
+ }, null, 2)]), _("span", { class: C(["flex min-h-[20px] items-center gap-0.5 pb-2 text-[12px] leading-none", s.value.muted]) }, [v(P(i.value) + " earlier updates ", 1), _("i", {
1249
+ class: C(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1195
1250
  "aria-hidden": "true"
1196
- }, null, 2)], 2)], 10, Re)) : h("", !0),
1197
- (T(!0), _(f, null, A(o.value, (e, t) => (T(), _("div", {
1251
+ }, null, 2)], 2)], 10, He)) : m("", !0),
1252
+ (k(!0), h(u, null, j(o.value, (e, t) => (k(), h("div", {
1198
1253
  key: e.id,
1199
1254
  "data-test": "messaging-tool-activity-row",
1200
1255
  "data-journal-row": e.tone,
1201
- class: S([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1202
- }, [v("div", G, [v("span", Ve, [(T(), m(j(c.value[e.tone].station.tag), {
1256
+ class: C([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1257
+ }, [_("div", G, [_("span", Ge, [(k(), p(ae(c.value[e.tone].station.tag), {
1203
1258
  "data-journal-station": e.tone,
1204
- class: S(c.value[e.tone].station.class)
1205
- }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? h("", !0) : (T(), _("span", {
1259
+ class: C(c.value[e.tone].station.class)
1260
+ }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? m("", !0) : (k(), h("span", {
1206
1261
  key: 0,
1207
- class: S(["w-px flex-1", s.value.spine])
1208
- }, null, 2))]), v("div", { class: S(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [v("span", { class: S(["relative block leading-snug", c.value[e.tone].label]) }, [te(P(e.label), 1), c.value[e.tone].statusWord ? (T(), _("span", He, ", " + P(c.value[e.tone].statusWord), 1)) : h("", !0)], 2), e.note ? (T(), _("p", {
1262
+ class: C(["w-px flex-1", s.value.spine])
1263
+ }, null, 2))]), _("div", { class: C(["min-w-0 flex-1", t === o.value.length - 1 ? "" : "pb-2"]) }, [_("span", { class: C(["relative block leading-snug", c.value[e.tone].label]) }, [v(P(e.label), 1), c.value[e.tone].statusWord ? (k(), h("span", Ke, ", " + P(c.value[e.tone].statusWord), 1)) : m("", !0)], 2), e.note ? (k(), h("p", {
1209
1264
  key: 0,
1210
- class: S(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
1211
- }, P(e.note), 3)) : h("", !0)], 2)], 10, Be))), 128)),
1212
- !r.value && e.model.hint ? (T(), _("p", {
1265
+ class: C(["pt-0.5 text-[11.5px] leading-snug", s.value.muted])
1266
+ }, P(e.note), 3)) : m("", !0)], 2)], 10, We))), 128)),
1267
+ !r.value && e.model.hint ? (k(), h("p", {
1213
1268
  key: 3,
1214
1269
  "data-test": "messaging-tool-activity-hint",
1215
- class: S(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1216
- }, P(e.model.hint), 3)) : h("", !0)
1270
+ class: C(["pl-[30px] pt-2.5 text-[12px] leading-snug", s.value.muted])
1271
+ }, P(e.model.hint), 3)) : m("", !0)
1217
1272
  ], 2));
1218
1273
  }
1219
1274
  });
@@ -1258,39 +1313,39 @@ function _unsupportedIterableToArray(e, t) {
1258
1313
  return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
1259
1314
  }
1260
1315
  }
1261
- var We = Object.entries, Ge = Object.setPrototypeOf, Ke = Object.isFrozen, qe = Object.getPrototypeOf, Je = Object.getOwnPropertyDescriptor, K = Object.freeze, q = Object.seal, Ye = Object.create, Xe = typeof Reflect < "u" && Reflect, Ze = Xe.apply, Qe = Xe.construct;
1316
+ var Je = Object.entries, Ye = Object.setPrototypeOf, Xe = Object.isFrozen, Ze = Object.getPrototypeOf, Qe = Object.getOwnPropertyDescriptor, K = Object.freeze, q = Object.seal, $e = Object.create, et = typeof Reflect < "u" && Reflect, tt = et.apply, nt = et.construct;
1262
1317
  K || (K = function freeze(e) {
1263
1318
  return e;
1264
1319
  }), q || (q = function seal(e) {
1265
1320
  return e;
1266
- }), Ze || (Ze = function apply(e, t) {
1321
+ }), tt || (tt = function apply(e, t) {
1267
1322
  var n = [...arguments].slice(2);
1268
1323
  return e.apply(t, n);
1269
- }), Qe || (Qe = function construct(e) {
1324
+ }), nt || (nt = function construct(e) {
1270
1325
  return new e(...[...arguments].slice(1));
1271
1326
  });
1272
- var $e = unapply(Array.prototype.forEach), et = unapply(Array.prototype.lastIndexOf), tt = unapply(Array.prototype.pop), nt = unapply(Array.prototype.push), rt = unapply(Array.prototype.splice), it = Array.isArray, at = unapply(String.prototype.toLowerCase), st = unapply(String.prototype.toString), ct = unapply(String.prototype.match), lt = unapply(String.prototype.replace), ut = unapply(String.prototype.indexOf), dt = unapply(String.prototype.trim), ft = unapply(Number.prototype.toString), pt = unapply(Boolean.prototype.toString), mt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), ht = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), J = unapply(Object.prototype.hasOwnProperty), gt = unapply(Object.prototype.toString), X = unapply(RegExp.prototype.test), _t = unconstruct(TypeError);
1327
+ var rt = unapply(Array.prototype.forEach), it = unapply(Array.prototype.lastIndexOf), at = unapply(Array.prototype.pop), st = unapply(Array.prototype.push), ct = unapply(Array.prototype.splice), lt = Array.isArray, ut = unapply(String.prototype.toLowerCase), dt = unapply(String.prototype.toString), ft = unapply(String.prototype.match), pt = unapply(String.prototype.replace), mt = unapply(String.prototype.indexOf), ht = unapply(String.prototype.trim), gt = unapply(Number.prototype.toString), _t = unapply(Boolean.prototype.toString), vt = typeof BigInt > "u" ? null : unapply(BigInt.prototype.toString), yt = typeof Symbol > "u" ? null : unapply(Symbol.prototype.toString), J = unapply(Object.prototype.hasOwnProperty), bt = unapply(Object.prototype.toString), X = unapply(RegExp.prototype.test), xt = unconstruct(TypeError);
1273
1328
  function unapply(e) {
1274
1329
  return function(t) {
1275
1330
  t instanceof RegExp && (t.lastIndex = 0);
1276
1331
  var n = [...arguments].slice(1);
1277
- return Ze(e, t, n);
1332
+ return tt(e, t, n);
1278
1333
  };
1279
1334
  }
1280
1335
  function unconstruct(e) {
1281
1336
  return function() {
1282
- return Qe(e, [...arguments]);
1337
+ return nt(e, [...arguments]);
1283
1338
  };
1284
1339
  }
1285
1340
  function addToSet(e, t) {
1286
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : at;
1287
- if (Ge && Ge(e, null), !it(t)) return e;
1341
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ut;
1342
+ if (Ye && Ye(e, null), !lt(t)) return e;
1288
1343
  let r = t.length;
1289
1344
  for (; r--;) {
1290
1345
  let i = t[r];
1291
1346
  if (typeof i == "string") {
1292
1347
  let e = n(i);
1293
- e !== i && (Ke(t) || (t[r] = e), i = e);
1348
+ e !== i && (Xe(t) || (t[r] = e), i = e);
1294
1349
  }
1295
1350
  e[i] = !0;
1296
1351
  }
@@ -1301,43 +1356,43 @@ function cleanArray(e) {
1301
1356
  return e;
1302
1357
  }
1303
1358
  function clone(e) {
1304
- let t = Ye(null);
1305
- for (let r of We(e)) {
1359
+ let t = $e(null);
1360
+ for (let r of Je(e)) {
1306
1361
  var n = _slicedToArray(r, 2);
1307
1362
  let i = n[0], a = n[1];
1308
- J(e, i) && (it(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
1363
+ J(e, i) && (lt(a) ? t[i] = cleanArray(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = clone(a) : t[i] = a);
1309
1364
  }
1310
1365
  return t;
1311
1366
  }
1312
1367
  function stringifyValue(e) {
1313
1368
  switch (typeof e) {
1314
1369
  case "string": return e;
1315
- case "number": return ft(e);
1316
- case "boolean": return pt(e);
1317
- case "bigint": return mt ? mt(e) : "0";
1318
- case "symbol": return ht ? ht(e) : "Symbol()";
1319
- case "undefined": return gt(e);
1370
+ case "number": return gt(e);
1371
+ case "boolean": return _t(e);
1372
+ case "bigint": return vt ? vt(e) : "0";
1373
+ case "symbol": return yt ? yt(e) : "Symbol()";
1374
+ case "undefined": return bt(e);
1320
1375
  case "function":
1321
1376
  case "object": {
1322
- if (e === null) return gt(e);
1377
+ if (e === null) return bt(e);
1323
1378
  let t = e, n = lookupGetter(t, "toString");
1324
1379
  if (typeof n == "function") {
1325
1380
  let e = n(t);
1326
- return typeof e == "string" ? e : gt(e);
1381
+ return typeof e == "string" ? e : bt(e);
1327
1382
  }
1328
- return gt(e);
1383
+ return bt(e);
1329
1384
  }
1330
- default: return gt(e);
1385
+ default: return bt(e);
1331
1386
  }
1332
1387
  }
1333
1388
  function lookupGetter(e, t) {
1334
1389
  for (; e !== null;) {
1335
- let n = Je(e, t);
1390
+ let n = Qe(e, t);
1336
1391
  if (n) {
1337
1392
  if (n.get) return unapply(n.get);
1338
1393
  if (typeof n.value == "function") return unapply(n.value);
1339
1394
  }
1340
- e = qe(e);
1395
+ e = Ze(e);
1341
1396
  }
1342
1397
  function fallbackValue() {
1343
1398
  return null;
@@ -1351,7 +1406,7 @@ function isRegex(e) {
1351
1406
  return !1;
1352
1407
  }
1353
1408
  }
1354
- var vt = K(/* @__PURE__ */ "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".split(".")), yt = K(/* @__PURE__ */ "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".split(".")), bt = K([
1409
+ var St = K(/* @__PURE__ */ "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".split(".")), Ct = K(/* @__PURE__ */ "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".split(".")), wt = K([
1355
1410
  "feBlend",
1356
1411
  "feColorMatrix",
1357
1412
  "feComponentTransfer",
@@ -1377,7 +1432,7 @@ var vt = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1377
1432
  "feSpotLight",
1378
1433
  "feTile",
1379
1434
  "feTurbulence"
1380
- ]), xt = K([
1435
+ ]), Tt = K([
1381
1436
  "animate",
1382
1437
  "color-profile",
1383
1438
  "cursor",
@@ -1400,7 +1455,7 @@ var vt = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1400
1455
  "solidcolor",
1401
1456
  "unknown",
1402
1457
  "use"
1403
- ]), St = K(/* @__PURE__ */ "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".split(".")), Ct = K([
1458
+ ]), Et = K(/* @__PURE__ */ "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".split(".")), Dt = K([
1404
1459
  "maction",
1405
1460
  "maligngroup",
1406
1461
  "malignmark",
@@ -1416,13 +1471,13 @@ var vt = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1416
1471
  "annotation-xml",
1417
1472
  "mprescripts",
1418
1473
  "none"
1419
- ]), wt = K(["#text"]), Tt = K(/* @__PURE__ */ "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".split(".")), Et = K(/* @__PURE__ */ "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.dominant-baseline.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-orientation.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".split(".")), Dt = K(/* @__PURE__ */ "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".split(".")), Ot = K([
1474
+ ]), Ot = K(["#text"]), kt = K(/* @__PURE__ */ "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".split(".")), At = K(/* @__PURE__ */ "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.dominant-baseline.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-orientation.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".split(".")), jt = K(/* @__PURE__ */ "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".split(".")), Mt = K([
1420
1475
  "xlink:href",
1421
1476
  "xml:id",
1422
1477
  "xlink:title",
1423
1478
  "xml:space",
1424
1479
  "xmlns:xlink"
1425
- ]), kt = q(/{{[\w\W]*|^[\w\W]*}}/g), At = q(/<%[\w\W]*|^[\w\W]*%>/g), jt = q(/\${[\w\W]*/g), Mt = q(/^data-[\-\w.\u00B7-\uFFFF]+$/), Nt = q(/^aria-[\-\w]+$/), Pt = q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ft = q(/^(?:\w+script|data):/i), It = q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Lt = q(/^html$/i), Rt = q(/^[a-z][.\w]*(-[.\w]+)+$/i), zt = q(/<[/\w!]/g), Bt = q(/<[/\w]/g), Vt = q(/<\/no(script|embed|frames)/i), Ht = q(/\/>/i), Ut = {
1480
+ ]), Nt = q(/{{[\w\W]*|^[\w\W]*}}/g), Pt = q(/<%[\w\W]*|^[\w\W]*%>/g), Ft = q(/\${[\w\W]*/g), It = q(/^data-[\-\w.\u00B7-\uFFFF]+$/), Lt = q(/^aria-[\-\w]+$/), Rt = q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), zt = q(/^(?:\w+script|data):/i), Bt = q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Vt = q(/^html$/i), Ht = q(/^[a-z][.\w]*(-[.\w]+)+$/i), Ut = q(/<[/\w!]/g), Wt = q(/<[/\w]/g), Gt = q(/<\/no(script|embed|frames)/i), Kt = q(/\/>/i), qt = {
1426
1481
  element: 1,
1427
1482
  attribute: 2,
1428
1483
  text: 3,
@@ -1435,9 +1490,9 @@ var vt = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1435
1490
  documentType: 10,
1436
1491
  documentFragment: 11,
1437
1492
  notation: 12
1438
- }, Wt = function getGlobal() {
1493
+ }, Jt = function getGlobal() {
1439
1494
  return typeof window > "u" ? null : window;
1440
- }, Gt = function _createTrustedTypesPolicy(e, t) {
1495
+ }, Yt = function _createTrustedTypesPolicy(e, t) {
1441
1496
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
1442
1497
  let n = null, r = "data-tt-policy-suffix";
1443
1498
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -1454,7 +1509,7 @@ var vt = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1454
1509
  } catch {
1455
1510
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
1456
1511
  }
1457
- }, Kt = function _createHooksMap() {
1512
+ }, Xt = function _createHooksMap() {
1458
1513
  return {
1459
1514
  afterSanitizeAttributes: [],
1460
1515
  afterSanitizeElements: [],
@@ -1466,53 +1521,53 @@ var vt = K(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
1466
1521
  uponSanitizeElement: [],
1467
1522
  uponSanitizeShadowNode: []
1468
1523
  };
1469
- }, qt = function _resolveSetOption(e, t, n, r) {
1470
- return J(e, t) && it(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1524
+ }, Zt = function _resolveSetOption(e, t, n, r) {
1525
+ return J(e, t) && lt(e[t]) ? addToSet(r.base ? clone(r.base) : {}, e[t], r.transform) : n;
1471
1526
  };
1472
1527
  function createDOMPurify() {
1473
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Wt(), DOMPurify = (e) => createDOMPurify(e);
1474
- if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== Ut.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
1528
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Jt(), DOMPurify = (e) => createDOMPurify(e);
1529
+ if (DOMPurify.version = "3.4.12", DOMPurify.removed = [], !e || !e.document || e.document.nodeType !== qt.document || !e.Element) return DOMPurify.isSupported = !1, DOMPurify;
1475
1530
  let t = e.document, n = t, r = n.currentScript;
1476
1531
  e.DocumentFragment;
1477
1532
  let i = e.HTMLTemplateElement, a = e.Node, o = e.Element, s = e.NodeFilter;
1478
1533
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
1479
- let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), te = lookupGetter(f, "shadowRoot"), b = lookupGetter(f, "attributes"), x = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, ne = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
1534
+ let c = e.DOMParser, u = e.trustedTypes, f = o.prototype, p = lookupGetter(f, "cloneNode"), m = lookupGetter(f, "remove"), h = lookupGetter(f, "nextSibling"), _ = lookupGetter(f, "childNodes"), v = lookupGetter(f, "parentNode"), b = lookupGetter(f, "shadowRoot"), x = lookupGetter(f, "attributes"), S = a && a.prototype ? lookupGetter(a.prototype, "nodeType") : null, C = a && a.prototype ? lookupGetter(a.prototype, "nodeName") : null;
1480
1535
  if (typeof i == "function") {
1481
1536
  let e = t.createElement("template");
1482
1537
  e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
1483
1538
  }
1484
- let S, C = "", re, ie = !1, ae = 0, T = function _assertNotInTrustedTypesPolicy() {
1485
- if (ae > 0) throw _t("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1486
- }, k = function _createTrustedHTML(e) {
1487
- T(), ae++;
1539
+ let T, te = "", ne, re = !1, k = 0, A = function _assertNotInTrustedTypesPolicy() {
1540
+ if (k > 0) throw xt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1541
+ }, j = function _createTrustedHTML(e) {
1542
+ A(), k++;
1488
1543
  try {
1489
- return S.createHTML(e);
1544
+ return T.createHTML(e);
1490
1545
  } finally {
1491
- ae--;
1546
+ k--;
1492
1547
  }
1493
- }, A = function _createTrustedScriptURL(e) {
1494
- T(), ae++;
1548
+ }, ie = function _createTrustedScriptURL(e) {
1549
+ A(), k++;
1495
1550
  try {
1496
- return S.createScriptURL(e);
1551
+ return T.createScriptURL(e);
1497
1552
  } finally {
1498
- ae--;
1499
- }
1500
- }, oe = function _getDefaultTrustedTypesPolicy() {
1501
- return ie || (re = Gt(u, r), ie = !0), re;
1502
- }, j = t, se = j.implementation, P = j.createNodeIterator, ce = j.createDocumentFragment, ue = j.getElementsByTagName, de = n.importNode, F = Kt();
1503
- DOMPurify.isSupported = typeof We == "function" && typeof v == "function" && se && se.createHTMLDocument !== void 0;
1504
- let pe = kt, he = At, I = jt, _e = Mt, R = Nt, ve = Ft, ye = It, z = Rt, be = Pt, B = null, Se = addToSet({}, [
1505
- ...vt,
1506
- ...yt,
1507
- ...bt,
1553
+ k--;
1554
+ }
1555
+ }, ae = function _getDefaultTrustedTypesPolicy() {
1556
+ return re || (ne = Yt(u, r), re = !0), ne;
1557
+ }, oe = t, P = oe.implementation, se = oe.createNodeIterator, F = oe.createDocumentFragment, ce = oe.getElementsByTagName, ue = n.importNode, I = Xt();
1558
+ DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && P && P.createHTMLDocument !== void 0;
1559
+ let de = Nt, R = Pt, pe = Ft, he = It, _e = Lt, ve = zt, ye = Bt, z = Ht, be = Rt, B = null, Se = addToSet({}, [
1508
1560
  ...St,
1509
- ...wt
1510
- ]), H = null, Ce = addToSet({}, [
1511
- ...Tt,
1561
+ ...Ct,
1562
+ ...wt,
1512
1563
  ...Et,
1513
- ...Dt,
1514
1564
  ...Ot
1515
- ]), U = Object.seal(Ye(null, {
1565
+ ]), H = null, Ce = addToSet({}, [
1566
+ ...kt,
1567
+ ...At,
1568
+ ...jt,
1569
+ ...Mt
1570
+ ]), U = Object.seal($e(null, {
1516
1571
  tagNameCheck: {
1517
1572
  writable: !0,
1518
1573
  configurable: !1,
@@ -1531,7 +1586,7 @@ function createDOMPurify() {
1531
1586
  enumerable: !0,
1532
1587
  value: !1
1533
1588
  }
1534
- })), we = null, Te = null, Ee = Object.seal(Ye(null, {
1589
+ })), we = null, Te = null, Ee = Object.seal($e(null, {
1535
1590
  tagCheck: {
1536
1591
  writable: !0,
1537
1592
  configurable: !1,
@@ -1544,14 +1599,14 @@ function createDOMPurify() {
1544
1599
  enumerable: !0,
1545
1600
  value: null
1546
1601
  }
1547
- })), De = !0, Oe = !0, ke = !1, Ae = !0, W = !1, je = !0, Me = !1, Ne = !1, Pe = null, Fe = null, Ie = !1, Le = !1, Re = !1, ze = !1, Be = !0, G = !1, Ve = "user-content-", He = !0, Ue = !1, Ge = {}, Ke = null, qe = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Je = null, Xe = addToSet({}, [
1602
+ })), De = !0, Oe = !0, ke = !1, Ae = !0, je = !1, W = !0, Me = !1, Ne = !1, Pe = null, Fe = null, Ie = !1, Le = !1, Re = !1, ze = !1, Be = !0, Ve = !1, He = "user-content-", Ue = !0, We = !1, G = {}, Ge = null, Ke = addToSet({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), qe = null, Ye = addToSet({}, [
1548
1603
  "audio",
1549
1604
  "video",
1550
1605
  "img",
1551
1606
  "source",
1552
1607
  "image",
1553
1608
  "track"
1554
- ]), Ze = null, Qe = addToSet({}, [
1609
+ ]), Xe = null, Ze = addToSet({}, [
1555
1610
  "alt",
1556
1611
  "class",
1557
1612
  "for",
@@ -1566,90 +1621,90 @@ function createDOMPurify() {
1566
1621
  "value",
1567
1622
  "style",
1568
1623
  "xmlns"
1569
- ]), ft = "http://www.w3.org/1998/Math/MathML", pt = "http://www.w3.org/2000/svg", mt = "http://www.w3.org/1999/xhtml", ht = mt, gt = !1, Jt = null, Yt = addToSet({}, [
1570
- ft,
1571
- pt,
1572
- mt
1573
- ], st), Xt = K([
1624
+ ]), Qe = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", tt = "http://www.w3.org/1999/xhtml", nt = tt, gt = !1, _t = null, vt = addToSet({}, [
1625
+ Qe,
1626
+ et,
1627
+ tt
1628
+ ], dt), yt = K([
1574
1629
  "mi",
1575
1630
  "mo",
1576
1631
  "mn",
1577
1632
  "ms",
1578
1633
  "mtext"
1579
- ]), Zt = addToSet({}, Xt), Z = K(["annotation-xml"]), Qt = addToSet({}, Z), $t = addToSet({}, [
1634
+ ]), bt = addToSet({}, yt), Qt = K(["annotation-xml"]), $t = addToSet({}, Qt), en = addToSet({}, [
1580
1635
  "title",
1581
1636
  "style",
1582
1637
  "font",
1583
1638
  "a",
1584
1639
  "script"
1585
- ]), en = null, tn = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
1640
+ ]), tn = null, Z = ["application/xhtml+xml", "text/html"], Q = null, nn = null, rn = t.createElement("form"), an = function isRegexOrFunction(e) {
1586
1641
  return e instanceof RegExp || e instanceof Function;
1587
1642
  }, on = function _parseConfig() {
1588
1643
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1589
1644
  if (nn && nn === e) return;
1590
- (!e || typeof e != "object") && (e = {}), e = clone(e), en = tn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = en === "application/xhtml+xml" ? st : at, B = qt(e, "ALLOWED_TAGS", Se, { transform: Q }), H = qt(e, "ALLOWED_ATTR", Ce, { transform: Q }), Jt = qt(e, "ALLOWED_NAMESPACES", Yt, { transform: st }), Ze = qt(e, "ADD_URI_SAFE_ATTR", Qe, {
1645
+ (!e || typeof e != "object") && (e = {}), e = clone(e), tn = Z.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Q = tn === "application/xhtml+xml" ? dt : ut, B = Zt(e, "ALLOWED_TAGS", Se, { transform: Q }), H = Zt(e, "ALLOWED_ATTR", Ce, { transform: Q }), _t = Zt(e, "ALLOWED_NAMESPACES", vt, { transform: dt }), Xe = Zt(e, "ADD_URI_SAFE_ATTR", Ze, {
1591
1646
  transform: Q,
1592
- base: Qe
1593
- }), Je = qt(e, "ADD_DATA_URI_TAGS", Xe, {
1647
+ base: Ze
1648
+ }), qe = Zt(e, "ADD_DATA_URI_TAGS", Ye, {
1594
1649
  transform: Q,
1595
- base: Xe
1596
- }), Ke = qt(e, "FORBID_CONTENTS", qe, { transform: Q }), we = qt(e, "FORBID_TAGS", clone({}), { transform: Q }), Te = qt(e, "FORBID_ATTR", clone({}), { transform: Q }), Ge = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, De = e.ALLOW_ARIA_ATTR !== !1, Oe = e.ALLOW_DATA_ATTR !== !1, ke = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, W = e.SAFE_FOR_TEMPLATES || !1, je = e.SAFE_FOR_XML !== !1, Me = e.WHOLE_DOCUMENT || !1, Le = e.RETURN_DOM || !1, Re = e.RETURN_DOM_FRAGMENT || !1, ze = e.RETURN_TRUSTED_TYPE || !1, Ie = e.FORCE_BODY || !1, Be = e.SANITIZE_DOM !== !1, G = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, be = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Pt, ht = typeof e.NAMESPACE == "string" ? e.NAMESPACE : mt, Zt = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, Xt), Qt = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, Z);
1597
- let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : Ye(null);
1598
- if (U = Ye(null), J(t, "tagNameCheck") && an(t.tagNameCheck) && (U.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && an(t.attributeNameCheck) && (U.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (U.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), q(U), W && (Oe = !1), Re && (Le = !0), Ge && (B = addToSet({}, wt), H = Ye(null), Ge.html === !0 && (addToSet(B, vt), addToSet(H, Tt)), Ge.svg === !0 && (addToSet(B, yt), addToSet(H, Et), addToSet(H, Ot)), Ge.svgFilters === !0 && (addToSet(B, bt), addToSet(H, Et), addToSet(H, Ot)), Ge.mathMl === !0 && (addToSet(B, St), addToSet(H, Dt), addToSet(H, Ot))), Ee.tagCheck = null, Ee.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Ee.tagCheck = e.ADD_TAGS : it(e.ADD_TAGS) && (B === Se && (B = clone(B)), addToSet(B, e.ADD_TAGS, Q))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Ee.attributeCheck = e.ADD_ATTR : it(e.ADD_ATTR) && (H === Ce && (H = clone(H)), addToSet(H, e.ADD_ATTR, Q))), J(e, "ADD_URI_SAFE_ATTR") && it(e.ADD_URI_SAFE_ATTR) && addToSet(Ze, e.ADD_URI_SAFE_ATTR, Q), J(e, "FORBID_CONTENTS") && it(e.FORBID_CONTENTS) && (Ke === qe && (Ke = clone(Ke)), addToSet(Ke, e.FORBID_CONTENTS, Q)), J(e, "ADD_FORBID_CONTENTS") && it(e.ADD_FORBID_CONTENTS) && (Ke === qe && (Ke = clone(Ke)), addToSet(Ke, e.ADD_FORBID_CONTENTS, Q)), He && (B["#text"] = !0), Me && addToSet(B, [
1650
+ base: Ye
1651
+ }), Ge = Zt(e, "FORBID_CONTENTS", Ke, { transform: Q }), we = Zt(e, "FORBID_TAGS", clone({}), { transform: Q }), Te = Zt(e, "FORBID_ATTR", clone({}), { transform: Q }), G = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? clone(e.USE_PROFILES) : e.USE_PROFILES : !1, De = e.ALLOW_ARIA_ATTR !== !1, Oe = e.ALLOW_DATA_ATTR !== !1, ke = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ae = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, je = e.SAFE_FOR_TEMPLATES || !1, W = e.SAFE_FOR_XML !== !1, Me = e.WHOLE_DOCUMENT || !1, Le = e.RETURN_DOM || !1, Re = e.RETURN_DOM_FRAGMENT || !1, ze = e.RETURN_TRUSTED_TYPE || !1, Ie = e.FORCE_BODY || !1, Be = e.SANITIZE_DOM !== !1, Ve = e.SANITIZE_NAMED_PROPS || !1, Ue = e.KEEP_CONTENT !== !1, We = e.IN_PLACE || !1, be = isRegex(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Rt, nt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : tt, bt = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? clone(e.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, yt), $t = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? clone(e.HTML_INTEGRATION_POINTS) : addToSet({}, Qt);
1652
+ let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? clone(e.CUSTOM_ELEMENT_HANDLING) : $e(null);
1653
+ if (U = $e(null), J(t, "tagNameCheck") && an(t.tagNameCheck) && (U.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && an(t.attributeNameCheck) && (U.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (U.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), q(U), je && (Oe = !1), Re && (Le = !0), G && (B = addToSet({}, Ot), H = $e(null), G.html === !0 && (addToSet(B, St), addToSet(H, kt)), G.svg === !0 && (addToSet(B, Ct), addToSet(H, At), addToSet(H, Mt)), G.svgFilters === !0 && (addToSet(B, wt), addToSet(H, At), addToSet(H, Mt)), G.mathMl === !0 && (addToSet(B, Et), addToSet(H, jt), addToSet(H, Mt))), Ee.tagCheck = null, Ee.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Ee.tagCheck = e.ADD_TAGS : lt(e.ADD_TAGS) && (B === Se && (B = clone(B)), addToSet(B, e.ADD_TAGS, Q))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Ee.attributeCheck = e.ADD_ATTR : lt(e.ADD_ATTR) && (H === Ce && (H = clone(H)), addToSet(H, e.ADD_ATTR, Q))), J(e, "ADD_URI_SAFE_ATTR") && lt(e.ADD_URI_SAFE_ATTR) && addToSet(Xe, e.ADD_URI_SAFE_ATTR, Q), J(e, "FORBID_CONTENTS") && lt(e.FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.FORBID_CONTENTS, Q)), J(e, "ADD_FORBID_CONTENTS") && lt(e.ADD_FORBID_CONTENTS) && (Ge === Ke && (Ge = clone(Ge)), addToSet(Ge, e.ADD_FORBID_CONTENTS, Q)), Ue && (B["#text"] = !0), Me && addToSet(B, [
1599
1654
  "html",
1600
1655
  "head",
1601
1656
  "body"
1602
1657
  ]), B.table && (addToSet(B, ["tbody"]), delete we.tbody), e.TRUSTED_TYPES_POLICY) {
1603
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw _t("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1604
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw _t("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1605
- let t = S;
1606
- S = e.TRUSTED_TYPES_POLICY;
1658
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
1659
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw xt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
1660
+ let t = T;
1661
+ T = e.TRUSTED_TYPES_POLICY;
1607
1662
  try {
1608
- C = k("");
1663
+ te = j("");
1609
1664
  } catch (e) {
1610
- throw S = t, e;
1665
+ throw T = t, e;
1611
1666
  }
1612
- } else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = oe()), S && typeof C == "string" && (C = k("")));
1667
+ } else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, te = "") : (T === void 0 && (T = ae()), T && typeof te == "string" && (te = j("")));
1613
1668
  K && K(e), nn = e;
1614
1669
  }, sn = addToSet({}, [
1615
- ...yt,
1616
- ...bt,
1617
- ...xt
1618
- ]), cn = addToSet({}, [...St, ...Ct]), ln = function _checkSvgNamespace(e, t, n) {
1619
- return t.namespaceURI === mt ? e === "svg" : t.namespaceURI === ft ? e === "svg" && (n === "annotation-xml" || Zt[n]) : !!sn[e];
1670
+ ...Ct,
1671
+ ...wt,
1672
+ ...Tt
1673
+ ]), cn = addToSet({}, [...Et, ...Dt]), ln = function _checkSvgNamespace(e, t, n) {
1674
+ return t.namespaceURI === tt ? e === "svg" : t.namespaceURI === Qe ? e === "svg" && (n === "annotation-xml" || bt[n]) : !!sn[e];
1620
1675
  }, un = function _checkMathMlNamespace(e, t, n) {
1621
- return t.namespaceURI === mt ? e === "math" : t.namespaceURI === pt ? e === "math" && Qt[n] : !!cn[e];
1676
+ return t.namespaceURI === tt ? e === "math" : t.namespaceURI === et ? e === "math" && $t[n] : !!cn[e];
1622
1677
  }, dn = function _checkHtmlNamespace(e, t, n) {
1623
- return t.namespaceURI === pt && !Qt[n] || t.namespaceURI === ft && !Zt[n] ? !1 : !cn[e] && ($t[e] || !sn[e]);
1678
+ return t.namespaceURI === et && !$t[n] || t.namespaceURI === Qe && !bt[n] ? !1 : !cn[e] && (en[e] || !sn[e]);
1624
1679
  }, fn = function _checkValidNamespace(e) {
1625
1680
  let t = v(e);
1626
1681
  (!t || !t.tagName) && (t = {
1627
- namespaceURI: ht,
1682
+ namespaceURI: nt,
1628
1683
  tagName: "template"
1629
1684
  });
1630
- let n = at(e.tagName), r = at(t.tagName);
1631
- return Jt[e.namespaceURI] ? e.namespaceURI === pt ? ln(n, t, r) : e.namespaceURI === ft ? un(n, t, r) : e.namespaceURI === mt ? dn(n, t, r) : !!(en === "application/xhtml+xml" && Jt[e.namespaceURI]) : !1;
1685
+ let n = ut(e.tagName), r = ut(t.tagName);
1686
+ return _t[e.namespaceURI] ? e.namespaceURI === et ? ln(n, t, r) : e.namespaceURI === Qe ? un(n, t, r) : e.namespaceURI === tt ? dn(n, t, r) : !!(tn === "application/xhtml+xml" && _t[e.namespaceURI]) : !1;
1632
1687
  }, pn = function _forceRemove(e) {
1633
- nt(DOMPurify.removed, { element: e });
1688
+ st(DOMPurify.removed, { element: e });
1634
1689
  try {
1635
1690
  v(e).removeChild(e);
1636
1691
  } catch {
1637
- if (m(e), !v(e)) throw _t("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1692
+ if (m(e), !v(e)) throw xt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
1638
1693
  }
1639
1694
  }, mn = function _neutralizeRoot(e) {
1640
1695
  _n(e);
1641
1696
  let t = _(e);
1642
1697
  if (t) {
1643
1698
  let e = [];
1644
- $e(t, (t) => {
1645
- nt(e, t);
1646
- }), $e(e, (e) => {
1699
+ rt(t, (t) => {
1700
+ st(e, t);
1701
+ }), rt(e, (e) => {
1647
1702
  try {
1648
1703
  m(e);
1649
1704
  } catch {}
1650
1705
  });
1651
1706
  }
1652
- let n = b(e);
1707
+ let n = x(e);
1653
1708
  if (n) for (let t = n.length - 1; t >= 0; --t) {
1654
1709
  let r = n[t], i = r && r.name;
1655
1710
  if (typeof i == "string") try {
@@ -1658,12 +1713,12 @@ function createDOMPurify() {
1658
1713
  }
1659
1714
  }, hn = function _removeAttribute(e, t) {
1660
1715
  try {
1661
- nt(DOMPurify.removed, {
1716
+ st(DOMPurify.removed, {
1662
1717
  attribute: t.getAttributeNode(e),
1663
1718
  from: t
1664
1719
  });
1665
1720
  } catch {
1666
- nt(DOMPurify.removed, {
1721
+ st(DOMPurify.removed, {
1667
1722
  attribute: null,
1668
1723
  from: t
1669
1724
  });
@@ -1675,7 +1730,7 @@ function createDOMPurify() {
1675
1730
  t.setAttribute(e, "");
1676
1731
  } catch {}
1677
1732
  }, gn = function _stripDisallowedAttributes(e) {
1678
- let t = b(e);
1733
+ let t = x(e);
1679
1734
  if (t) for (let n = t.length - 1; n >= 0; --n) {
1680
1735
  let r = t[n], i = r && r.name;
1681
1736
  if (!(typeof i != "string" || H[Q(i)])) try {
@@ -1686,23 +1741,23 @@ function createDOMPurify() {
1686
1741
  let t = [e];
1687
1742
  for (; t.length > 0;) {
1688
1743
  let e = t.pop();
1689
- (x ? x(e) : e.nodeType) === Ut.element && gn(e);
1744
+ (S ? S(e) : e.nodeType) === qt.element && gn(e);
1690
1745
  let n = _(e);
1691
1746
  if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
1692
1747
  }
1693
1748
  }, vn = function _neutralizePatchLinkage(e) {
1694
- if (!je) return;
1749
+ if (!W) return;
1695
1750
  let t = [e];
1696
1751
  for (; t.length > 0;) {
1697
- let e = t.pop(), n = x ? x(e) : e.nodeType;
1698
- if (n === Ut.processingInstruction || n === Ut.comment && X(Bt, e.data)) {
1752
+ let e = t.pop(), n = S ? S(e) : e.nodeType;
1753
+ if (n === qt.processingInstruction || n === qt.comment && X(Wt, e.data)) {
1699
1754
  try {
1700
1755
  m(e);
1701
1756
  } catch {}
1702
1757
  continue;
1703
1758
  }
1704
- if (n === Ut.element) {
1705
- let t = e, n = Q(ne ? ne(e) : e.nodeName);
1759
+ if (n === qt.element) {
1760
+ let t = e, n = Q(C ? C(e) : e.nodeName);
1706
1761
  try {
1707
1762
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
1708
1763
  } catch {}
@@ -1714,98 +1769,98 @@ function createDOMPurify() {
1714
1769
  let n = null, r = null;
1715
1770
  if (Ie) e = "<remove></remove>" + e;
1716
1771
  else {
1717
- let t = ct(e, /^[\r\n\t ]+/);
1772
+ let t = ft(e, /^[\r\n\t ]+/);
1718
1773
  r = t && t[0];
1719
1774
  }
1720
- en === "application/xhtml+xml" && ht === mt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1721
- let i = S ? k(e) : e;
1722
- if (ht === mt) try {
1723
- n = new c().parseFromString(i, en);
1775
+ tn === "application/xhtml+xml" && nt === tt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1776
+ let i = T ? j(e) : e;
1777
+ if (nt === tt) try {
1778
+ n = new c().parseFromString(i, tn);
1724
1779
  } catch {}
1725
1780
  if (!n || !n.documentElement) {
1726
- n = se.createDocument(ht, "template", null);
1781
+ n = P.createDocument(nt, "template", null);
1727
1782
  try {
1728
- n.documentElement.innerHTML = gt ? C : i;
1783
+ n.documentElement.innerHTML = gt ? te : i;
1729
1784
  } catch {}
1730
1785
  }
1731
1786
  let a = n.body || n.documentElement;
1732
- return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), ht === mt ? ue.call(n, Me ? "html" : "body")[0] : Me ? n.documentElement : a;
1787
+ return e && r && a.insertBefore(t.createTextNode(r), a.childNodes[0] || null), nt === tt ? ce.call(n, Me ? "html" : "body")[0] : Me ? n.documentElement : a;
1733
1788
  }, bn = function _createNodeIterator(e) {
1734
- return P.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1789
+ return se.call(e.ownerDocument || e, e, s.SHOW_ELEMENT | s.SHOW_COMMENT | s.SHOW_TEXT | s.SHOW_PROCESSING_INSTRUCTION | s.SHOW_CDATA_SECTION, null);
1735
1790
  }, xn = function _stripTemplateExpressions(e) {
1736
- return e = lt(e, pe, " "), e = lt(e, he, " "), e = lt(e, I, " "), e;
1791
+ return e = pt(e, de, " "), e = pt(e, R, " "), e = pt(e, pe, " "), e;
1737
1792
  }, Sn = function _scrubTemplateExpressions(e) {
1738
1793
  e.normalize();
1739
- let t = P.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1794
+ let t = se.call(e.ownerDocument || e, e, s.SHOW_TEXT | s.SHOW_COMMENT | s.SHOW_CDATA_SECTION | s.SHOW_PROCESSING_INSTRUCTION, null), n = t.nextNode();
1740
1795
  for (; n;) n.data = xn(n.data), n = t.nextNode();
1741
1796
  let r = e.querySelectorAll?.call(e, "template");
1742
- r && $e(r, (e) => {
1797
+ r && rt(r, (e) => {
1743
1798
  wn(e.content) && Sn(e.content);
1744
1799
  });
1745
1800
  }, Cn = function _isClobbered(e) {
1746
- let t = ne ? ne(e) : null;
1747
- return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== b(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== x(e) || e.childNodes !== _(e);
1801
+ let t = C ? C(e) : null;
1802
+ return typeof t != "string" || Q(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== x(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== S(e) || e.childNodes !== _(e);
1748
1803
  }, wn = function _isDocumentFragment(e) {
1749
- if (!x || typeof e != "object" || !e) return !1;
1804
+ if (!S || typeof e != "object" || !e) return !1;
1750
1805
  try {
1751
- return x(e) === Ut.documentFragment;
1806
+ return S(e) === qt.documentFragment;
1752
1807
  } catch {
1753
1808
  return !1;
1754
1809
  }
1755
1810
  }, Tn = function _isNode(e) {
1756
- if (!x || typeof e != "object" || !e) return !1;
1811
+ if (!S || typeof e != "object" || !e) return !1;
1757
1812
  try {
1758
- return typeof x(e) == "number";
1813
+ return typeof S(e) == "number";
1759
1814
  } catch {
1760
1815
  return !1;
1761
1816
  }
1762
1817
  };
1763
1818
  function _executeHooks(e, t, n) {
1764
- e.length !== 0 && $e(e, (e) => {
1819
+ e.length !== 0 && rt(e, (e) => {
1765
1820
  e.call(DOMPurify, t, n, nn);
1766
1821
  });
1767
1822
  }
1768
1823
  let En = function _isUnsafeNode(e, t) {
1769
- return !!(je && e.hasChildNodes() && !Tn(e.firstElementChild) && X(zt, e.textContent) && X(zt, e.innerHTML) || je && e.namespaceURI === mt && t === "style" && Tn(e.firstElementChild) || e.nodeType === Ut.processingInstruction || je && e.nodeType === Ut.comment && X(Bt, e.data));
1824
+ return !!(W && e.hasChildNodes() && !Tn(e.firstElementChild) && X(Ut, e.textContent) && X(Ut, e.innerHTML) || W && e.namespaceURI === tt && t === "style" && Tn(e.firstElementChild) || e.nodeType === qt.processingInstruction || W && e.nodeType === qt.comment && X(Wt, e.data));
1770
1825
  }, Dn = function _sanitizeDisallowedNode(e, t) {
1771
1826
  if (!we[t] && jn(t) && (U.tagNameCheck instanceof RegExp && X(U.tagNameCheck, t) || U.tagNameCheck instanceof Function && U.tagNameCheck(t))) return !1;
1772
- if (He && !Ke[t]) {
1827
+ if (Ue && !Ge[t]) {
1773
1828
  let t = v(e), n = _(e);
1774
1829
  if (n && t) {
1775
1830
  let r = n.length;
1776
1831
  for (let i = r - 1; i >= 0; --i) {
1777
- let r = Ue ? n[i] : p(n[i], !0);
1832
+ let r = We ? n[i] : p(n[i], !0);
1778
1833
  t.insertBefore(r, h(e));
1779
1834
  }
1780
1835
  }
1781
1836
  }
1782
1837
  return pn(e), !0;
1783
1838
  }, On = function _sanitizeElements(e, t) {
1784
- if (_executeHooks(F.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1839
+ if (_executeHooks(I.beforeSanitizeElements, e, null), e !== t && v(e) === null) return !0;
1785
1840
  if (Cn(e)) return pn(e), !0;
1786
- let n = Q(ne ? ne(e) : e.nodeName);
1787
- if (_executeHooks(F.uponSanitizeElement, e, {
1841
+ let n = Q(C ? C(e) : e.nodeName);
1842
+ if (_executeHooks(I.uponSanitizeElement, e, {
1788
1843
  tagName: n,
1789
1844
  allowedTags: B
1790
1845
  }), e !== t && v(e) === null) return !0;
1791
1846
  if (En(e, n)) return pn(e), !0;
1792
1847
  if (we[n] || !(Ee.tagCheck instanceof Function && Ee.tagCheck(n)) && !B[n]) {
1793
1848
  let t = Dn(e, n);
1794
- return t === !1 && _executeHooks(F.afterSanitizeElements, e, null), t;
1849
+ return t === !1 && _executeHooks(I.afterSanitizeElements, e, null), t;
1795
1850
  }
1796
- if ((x ? x(e) : e.nodeType) === Ut.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && X(Vt, e.innerHTML)) return pn(e), !0;
1797
- if (W && e.nodeType === Ut.text) {
1851
+ if ((S ? S(e) : e.nodeType) === qt.element && !fn(e) || (n === "noscript" || n === "noembed" || n === "noframes") && X(Gt, e.innerHTML)) return pn(e), !0;
1852
+ if (je && e.nodeType === qt.text) {
1798
1853
  let t = xn(e.textContent);
1799
- e.textContent !== t && (nt(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1854
+ e.textContent !== t && (st(DOMPurify.removed, { element: e.cloneNode() }), e.textContent = t);
1800
1855
  }
1801
- return _executeHooks(F.afterSanitizeElements, e, null), !1;
1856
+ return _executeHooks(I.afterSanitizeElements, e, null), !1;
1802
1857
  }, kn = function _isValidAttribute(e, n, r) {
1803
- if (Te[n] || je && n === "patchsrc" || je && n === "for" && e !== "label" && e !== "output" || Be && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
1858
+ if (Te[n] || W && n === "patchsrc" || W && n === "for" && e !== "label" && e !== "output" || Be && (n === "id" || n === "name") && (r in t || r in rn)) return !1;
1804
1859
  let i = H[n] || Ee.attributeCheck instanceof Function && Ee.attributeCheck(n, e);
1805
- if (!(Oe && X(_e, n)) && !(De && X(R, n))) {
1860
+ if (!(Oe && X(he, n)) && !(De && X(_e, n))) {
1806
1861
  if (!i) {
1807
1862
  if (!(jn(e) && (U.tagNameCheck instanceof RegExp && X(U.tagNameCheck, e) || U.tagNameCheck instanceof Function && U.tagNameCheck(e)) && (U.attributeNameCheck instanceof RegExp && X(U.attributeNameCheck, n) || U.attributeNameCheck instanceof Function && U.attributeNameCheck(n, e)) || n === "is" && U.allowCustomizedBuiltInElements && (U.tagNameCheck instanceof RegExp && X(U.tagNameCheck, r) || U.tagNameCheck instanceof Function && U.tagNameCheck(r)))) return !1;
1808
- } else if (!Ze[n] && !X(be, lt(r, ye, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && ut(r, "data:") === 0 && Je[e]) && !(ke && !X(ve, lt(r, ye, ""))) && r) return !1;
1863
+ } else if (!Xe[n] && !X(be, pt(r, ye, "")) && !((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && mt(r, "data:") === 0 && qe[e]) && !(ke && !X(ve, pt(r, ye, ""))) && r) return !1;
1809
1864
  }
1810
1865
  return !0;
1811
1866
  }, An = addToSet({}, [
@@ -1818,21 +1873,21 @@ function createDOMPurify() {
1818
1873
  "font-face-uri",
1819
1874
  "missing-glyph"
1820
1875
  ]), jn = function _isBasicCustomElement(e) {
1821
- return !An[at(e)] && X(z, e);
1876
+ return !An[ut(e)] && X(z, e);
1822
1877
  }, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
1823
- if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1824
- case "TrustedHTML": return k(r);
1825
- case "TrustedScriptURL": return A(r);
1878
+ if (T && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1879
+ case "TrustedHTML": return j(r);
1880
+ case "TrustedScriptURL": return ie(r);
1826
1881
  }
1827
1882
  return r;
1828
1883
  }, Nn = function _setAttributeValue(e, t, n, r) {
1829
1884
  try {
1830
- n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Cn(e) ? pn(e) : tt(DOMPurify.removed);
1885
+ n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), Cn(e) ? pn(e) : at(DOMPurify.removed);
1831
1886
  } catch {
1832
1887
  hn(t, e);
1833
1888
  }
1834
1889
  }, Pn = function _sanitizeAttributes(e) {
1835
- _executeHooks(F.beforeSanitizeAttributes, e, null);
1890
+ _executeHooks(I.beforeSanitizeAttributes, e, null);
1836
1891
  let t = e.attributes;
1837
1892
  if (!t || Cn(e)) return;
1838
1893
  let n = {
@@ -1843,12 +1898,12 @@ function createDOMPurify() {
1843
1898
  forceKeepAttr: void 0
1844
1899
  }, r = t.length, i = Q(e.nodeName);
1845
1900
  for (; r--;) {
1846
- let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : dt(f);
1847
- if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(F.uponSanitizeAttribute, e, n), p = n.attrValue, G && (u === "id" || u === "name") && ut(p, Ve) !== 0 && (hn(o, e), p = Ve + p), je && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1901
+ let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, u = Q(o), f = c, p = o === "value" ? f : ht(f);
1902
+ if (n.attrName = u, n.attrValue = p, n.keepAttr = !0, n.forceKeepAttr = void 0, _executeHooks(I.uponSanitizeAttribute, e, n), p = n.attrValue, Ve && (u === "id" || u === "name") && mt(p, He) !== 0 && (hn(o, e), p = He + p), W && X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, p)) {
1848
1903
  hn(o, e);
1849
1904
  continue;
1850
1905
  }
1851
- if (u === "attributename" && ct(p, "href")) {
1906
+ if (u === "attributename" && ft(p, "href")) {
1852
1907
  hn(o, e);
1853
1908
  continue;
1854
1909
  }
@@ -1857,25 +1912,25 @@ function createDOMPurify() {
1857
1912
  hn(o, e);
1858
1913
  continue;
1859
1914
  }
1860
- if (!Ae && X(Ht, p)) {
1915
+ if (!Ae && X(Kt, p)) {
1861
1916
  hn(o, e);
1862
1917
  continue;
1863
1918
  }
1864
- if (W && (p = xn(p)), !kn(i, u, p)) {
1919
+ if (je && (p = xn(p)), !kn(i, u, p)) {
1865
1920
  hn(o, e);
1866
1921
  continue;
1867
1922
  }
1868
1923
  p = Mn(i, u, s, p), p !== f && Nn(e, o, s, p);
1869
1924
  }
1870
1925
  }
1871
- _executeHooks(F.afterSanitizeAttributes, e, null);
1926
+ _executeHooks(I.afterSanitizeAttributes, e, null);
1872
1927
  }, Fn = function _sanitizeShadowDOM(e) {
1873
1928
  let t = null, n = bn(e);
1874
- for (_executeHooks(F.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(F.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (x ? x(t) : t.nodeType) === Ut.element) {
1875
- let e = te(t);
1929
+ for (_executeHooks(I.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (_executeHooks(I.uponSanitizeShadowNode, t, null), On(t, e), Pn(t), wn(t.content) && Fn(t.content), (S ? S(t) : t.nodeType) === qt.element) {
1930
+ let e = b(t);
1876
1931
  wn(e) && (In(e), Fn(e));
1877
1932
  }
1878
- _executeHooks(F.afterSanitizeShadowDOM, e, null);
1933
+ _executeHooks(I.afterSanitizeShadowDOM, e, null);
1879
1934
  }, In = function _sanitizeAttachedShadowRoots(e) {
1880
1935
  let t = [{
1881
1936
  node: e,
@@ -1887,13 +1942,13 @@ function createDOMPurify() {
1887
1942
  Fn(e.shadow);
1888
1943
  continue;
1889
1944
  }
1890
- let n = e.node, r = (x ? x(n) : n.nodeType) === Ut.element, i = _(n);
1945
+ let n = e.node, r = (S ? S(n) : n.nodeType) === qt.element, i = _(n);
1891
1946
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
1892
1947
  node: i[e],
1893
1948
  shadow: null
1894
1949
  });
1895
1950
  if (r) {
1896
- let e = ne ? ne(n) : null;
1951
+ let e = C ? C(n) : null;
1897
1952
  if (typeof e == "string" && Q(e) === "template") {
1898
1953
  let e = n.content;
1899
1954
  wn(e) && t.push({
@@ -1903,7 +1958,7 @@ function createDOMPurify() {
1903
1958
  }
1904
1959
  }
1905
1960
  if (r) {
1906
- let e = te(n);
1961
+ let e = b(n);
1907
1962
  wn(e) && t.push({
1908
1963
  node: null,
1909
1964
  shadow: e
@@ -1916,73 +1971,73 @@ function createDOMPurify() {
1916
1971
  };
1917
1972
  return DOMPurify.sanitize = function(e) {
1918
1973
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, i = null, a = null, o = null;
1919
- if (gt = !e, gt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw _t("dirty is not a string, aborting");
1974
+ if (gt = !e, gt && (e = "<!-->"), typeof e != "string" && !Tn(e) && (e = stringifyValue(e), typeof e != "string")) throw xt("dirty is not a string, aborting");
1920
1975
  if (!DOMPurify.isSupported) return e;
1921
- Ne ? (B = Pe, H = Fe) : on(t), (F.uponSanitizeElement.length > 0 || F.uponSanitizeAttribute.length > 0) && (B = clone(B)), F.uponSanitizeAttribute.length > 0 && (H = clone(H)), DOMPurify.removed = [];
1922
- let s = Ue && typeof e != "string" && Tn(e);
1976
+ Ne ? (B = Pe, H = Fe) : on(t), (I.uponSanitizeElement.length > 0 || I.uponSanitizeAttribute.length > 0) && (B = clone(B)), I.uponSanitizeAttribute.length > 0 && (H = clone(H)), DOMPurify.removed = [];
1977
+ let s = We && typeof e != "string" && Tn(e);
1923
1978
  if (s) {
1924
1979
  vn(e);
1925
- let t = ne ? ne(e) : e.nodeName;
1980
+ let t = C ? C(e) : e.nodeName;
1926
1981
  if (typeof t == "string") {
1927
1982
  let n = Q(t);
1928
- if (!B[n] || we[n]) throw mn(e), _t("root node is forbidden and cannot be sanitized in-place");
1983
+ if (!B[n] || we[n]) throw mn(e), xt("root node is forbidden and cannot be sanitized in-place");
1929
1984
  }
1930
- if (Cn(e)) throw mn(e), _t("root node is clobbered and cannot be sanitized in-place");
1985
+ if (Cn(e)) throw mn(e), xt("root node is clobbered and cannot be sanitized in-place");
1931
1986
  try {
1932
1987
  In(e);
1933
1988
  } catch (t) {
1934
1989
  throw mn(e), t;
1935
1990
  }
1936
- } else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === Ut.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
1991
+ } else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === qt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
1937
1992
  else {
1938
- if (!Le && !W && !Me && e.indexOf("<") === -1) return S && ze ? k(e) : e;
1939
- if (r = yn(e), !r) return Le ? null : ze ? C : "";
1993
+ if (!Le && !je && !Me && e.indexOf("<") === -1) return T && ze ? j(e) : e;
1994
+ if (r = yn(e), !r) return Le ? null : ze ? te : "";
1940
1995
  }
1941
1996
  r && Ie && pn(r.firstChild);
1942
1997
  let c = s ? e : r, u = bn(c);
1943
1998
  try {
1944
1999
  for (; a = u.nextNode();) On(a, c), Pn(a), wn(a.content) && Fn(a.content);
1945
2000
  } catch (t) {
1946
- throw s && (mn(e), $e(DOMPurify.removed, (e) => {
2001
+ throw s && (mn(e), rt(DOMPurify.removed, (e) => {
1947
2002
  e.element && _n(e.element);
1948
2003
  })), t;
1949
2004
  }
1950
- if (s) return $e(DOMPurify.removed, (e) => {
2005
+ if (s) return rt(DOMPurify.removed, (e) => {
1951
2006
  e.element && _n(e.element);
1952
- }), W && Sn(e), e;
2007
+ }), je && Sn(e), e;
1953
2008
  if (Le) {
1954
- if (W && Sn(r), Re) for (o = ce.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
2009
+ if (je && Sn(r), Re) for (o = F.call(r.ownerDocument); r.firstChild;) o.appendChild(r.firstChild);
1955
2010
  else o = r;
1956
- return (H.shadowroot || H.shadowrootmode) && (o = de.call(n, o, !0)), o;
2011
+ return (H.shadowroot || H.shadowrootmode) && (o = ue.call(n, o, !0)), o;
1957
2012
  }
1958
2013
  let f = Me ? r.outerHTML : r.innerHTML;
1959
- return Me && B["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && X(Lt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), W && (f = xn(f)), S && ze ? k(f) : f;
2014
+ return Me && B["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && X(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), je && (f = xn(f)), T && ze ? j(f) : f;
1960
2015
  }, DOMPurify.setConfig = function() {
1961
2016
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1962
2017
  on(e), Ne = !0, Pe = B, Fe = H;
1963
2018
  }, DOMPurify.clearConfig = function() {
1964
- nn = null, Ne = !1, Pe = null, Fe = null, S = re, C = "";
2019
+ nn = null, Ne = !1, Pe = null, Fe = null, T = ne, te = "";
1965
2020
  }, DOMPurify.isValidAttribute = function(e, t, n) {
1966
2021
  nn || on({});
1967
2022
  let r = Q(e), i = Q(t);
1968
2023
  return kn(r, i, n);
1969
2024
  }, DOMPurify.addHook = function(e, t) {
1970
- typeof t == "function" && J(F, e) && nt(F[e], t);
2025
+ typeof t == "function" && J(I, e) && st(I[e], t);
1971
2026
  }, DOMPurify.removeHook = function(e, t) {
1972
- if (J(F, e)) {
2027
+ if (J(I, e)) {
1973
2028
  if (t !== void 0) {
1974
- let n = et(F[e], t);
1975
- return n === -1 ? void 0 : rt(F[e], n, 1)[0];
2029
+ let n = it(I[e], t);
2030
+ return n === -1 ? void 0 : ct(I[e], n, 1)[0];
1976
2031
  }
1977
- return tt(F[e]);
2032
+ return at(I[e]);
1978
2033
  }
1979
2034
  }, DOMPurify.removeHooks = function(e) {
1980
- J(F, e) && (F[e] = []);
2035
+ J(I, e) && (I[e] = []);
1981
2036
  }, DOMPurify.removeAllHooks = function() {
1982
- F = Kt();
2037
+ I = Xt();
1983
2038
  }, DOMPurify;
1984
2039
  }
1985
- var Jt = createDOMPurify(), _Class;
2040
+ var Qt = createDOMPurify(), _Class;
1986
2041
  function M() {
1987
2042
  return {
1988
2043
  async: !1,
@@ -1997,11 +2052,11 @@ function M() {
1997
2052
  walkTokens: null
1998
2053
  };
1999
2054
  }
2000
- var Yt = M();
2055
+ var $t = M();
2001
2056
  function N(e) {
2002
- Yt = e;
2057
+ $t = e;
2003
2058
  }
2004
- var Xt = { exec: () => null };
2059
+ var en = { exec: () => null };
2005
2060
  function E(e) {
2006
2061
  let t = [];
2007
2062
  return (n) => {
@@ -2019,7 +2074,7 @@ function d(e, t = "") {
2019
2074
  };
2020
2075
  return r;
2021
2076
  }
2022
- var Zt = ((e = "") => {
2077
+ var tn = ((e = "") => {
2023
2078
  try {
2024
2079
  return !!RegExp("(?<=1)(?<!1)" + e);
2025
2080
  } catch {
@@ -2082,89 +2137,89 @@ var Zt = ((e = "") => {
2082
2137
  headingBeginRegex: E((e) => RegExp(`^ {0,${e}}#`)),
2083
2138
  htmlBeginRegex: E((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
2084
2139
  blockquoteBeginRegex: E((e) => RegExp(`^ {0,${e}}>`))
2085
- }, Qt = /^(?:[ \t]*(?:\n|$))+/, $t = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, en = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, tn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Q = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, nn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, rn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, an = d(rn).replace(/bull/g, nn).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(), on = d(rn).replace(/bull/g, nn).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(), sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, cn = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, un = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), dn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, nn).getRegex(), fn = "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", pn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, mn = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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", pn).replace("tag", fn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(sn).replace("hr", tn).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", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", fn).getRegex(), hn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), gn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), _n = {
2086
- blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", gn).getRegex(),
2087
- code: $t,
2088
- def: un,
2089
- fences: en,
2090
- heading: Q,
2091
- hr: tn,
2092
- html: mn,
2093
- lheading: an,
2094
- list: dn,
2095
- newline: Qt,
2096
- paragraph: hn,
2097
- table: Xt,
2098
- text: cn
2099
- }, vn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", tn).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", fn).getRegex(), yn = {
2100
- ..._n,
2101
- lheading: on,
2102
- table: vn,
2103
- paragraph: d(sn).replace("hr", tn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", vn).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", fn).getRegex()
2104
- }, bn = {
2105
- ..._n,
2106
- html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", pn).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(),
2140
+ }, Q = /^(?:[ \t]*(?:\n|$))+/, nn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, rn = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, an = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, on = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, cn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ln = d(cn).replace(/bull/g, sn).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(), un = d(cn).replace(/bull/g, sn).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(), dn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, fn = /^[^\n]+/, pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, mn = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), hn = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, sn).getRegex(), gn = "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", _n = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, vn = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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", _n).replace("tag", gn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = (e) => d(dn).replace("hr", an).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", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", gn).getRegex(), yn = le(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), bn = le(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/), xn = {
2141
+ blockquote: d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", bn).getRegex(),
2142
+ code: nn,
2143
+ def: mn,
2144
+ fences: rn,
2145
+ heading: on,
2146
+ hr: an,
2147
+ html: vn,
2148
+ lheading: ln,
2149
+ list: hn,
2150
+ newline: Q,
2151
+ paragraph: yn,
2152
+ table: en,
2153
+ text: fn
2154
+ }, Sn = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", an).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", gn).getRegex(), Cn = {
2155
+ ...xn,
2156
+ lheading: un,
2157
+ table: Sn,
2158
+ paragraph: d(dn).replace("hr", an).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Sn).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", gn).getRegex()
2159
+ }, wn = {
2160
+ ...xn,
2161
+ html: d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", _n).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(),
2107
2162
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
2108
2163
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
2109
- fences: Xt,
2164
+ fences: en,
2110
2165
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
2111
- paragraph: d(sn).replace("hr", tn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", an).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2112
- }, xn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Sn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Cn = /^( {2,}|\\)\n(?!\s*$)/, wn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Tn = /[\p{P}\p{S}]/u, En = /[\s\p{P}\p{S}]/u, Dn = /[^\s\p{P}\p{S}]/u, On = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, En).getRegex(), kn = /(?!~)[\p{P}\p{S}]/u, An = /(?!~)[\s\p{P}\p{S}]/u, jn = /(?:[^\s\p{P}\p{S}]|~)/u, Mn = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Zt ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Nn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Pn = d(Nn, "u").replace(/punct/g, Tn).getRegex(), Fn = d(Nn, "u").replace(/punct/g, kn).getRegex(), In = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ln = d(In, "gu").replace(/notPunctSpace/g, Dn).replace(/punctSpace/g, En).replace(/punct/g, Tn).getRegex(), Rn = d(In, "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), zn = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Dn).replace(/punctSpace/g, En).replace(/punct/g, Tn).getRegex(), Bn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Tn).getRegex(), Vn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Dn).replace(/punctSpace/g, En).replace(/punct/g, Tn).getRegex(), Hn = d(/\\(punct)/, "gu").replace(/punct/g, Tn).getRegex(), Un = d(/^<(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(), Wn = d(pn).replace("(?:-->|$)", "-->").getRegex(), Gn = d("^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", Wn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Kn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, qn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Kn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Jn = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Kn).replace("ref", ln).getRegex(), Yn = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), Xn = d("reflink|nolink(?!\\()", "g").replace("reflink", Jn).replace("nolink", Yn).getRegex(), Zn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Qn = {
2113
- _backpedal: Xt,
2114
- anyPunctuation: Hn,
2115
- autolink: Un,
2116
- blockSkip: Mn,
2117
- br: Cn,
2118
- code: Sn,
2119
- del: Xt,
2120
- delLDelim: Xt,
2121
- delRDelim: Xt,
2122
- emStrongLDelim: Pn,
2123
- emStrongRDelimAst: Ln,
2124
- emStrongRDelimUnd: zn,
2125
- escape: xn,
2126
- link: qn,
2127
- nolink: Yn,
2128
- punctuation: On,
2129
- reflink: Jn,
2130
- reflinkSearch: Xn,
2131
- tag: Gn,
2132
- text: wn,
2133
- url: Xt
2134
- }, $n = {
2135
- ...Qn,
2136
- link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Kn).getRegex(),
2137
- reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Kn).getRegex()
2138
- }, er = {
2139
- ...Qn,
2140
- emStrongRDelimAst: Rn,
2141
- emStrongLDelim: Fn,
2142
- delLDelim: Bn,
2143
- delRDelim: Vn,
2144
- url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Zn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2145
- _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2146
- del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2147
- text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Zn).getRegex()
2148
- }, tr = {
2149
- ...er,
2150
- br: d(Cn).replace("{2,}", "*").getRegex(),
2151
- text: d(er.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2152
- }, nr = {
2153
- normal: _n,
2154
- gfm: yn,
2155
- pedantic: bn
2166
+ paragraph: d(dn).replace("hr", an).replace("heading", " *#{1,6} *[^\n]").replace("lheading", ln).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
2167
+ }, Tn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, En = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Dn = /^( {2,}|\\)\n(?!\s*$)/, On = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, kn = /[\p{P}\p{S}]/u, An = /[\s\p{P}\p{S}]/u, jn = /[^\s\p{P}\p{S}]/u, Mn = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, An).getRegex(), Nn = /(?!~)[\p{P}\p{S}]/u, Pn = /(?!~)[\s\p{P}\p{S}]/u, Fn = /(?:[^\s\p{P}\p{S}]|~)/u, In = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", tn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Ln = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Rn = d(Ln, "u").replace(/punct/g, kn).getRegex(), zn = d(Ln, "u").replace(/punct/g, Nn).getRegex(), Bn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Vn = d(Bn, "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Hn = d(Bn, "gu").replace(/notPunctSpace/g, Fn).replace(/punctSpace/g, Pn).replace(/punct/g, Nn).getRegex(), Un = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Wn = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, kn).getRegex(), Gn = d("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, An).replace(/punct/g, kn).getRegex(), Kn = d(/\\(punct)/, "gu").replace(/punct/g, kn).getRegex(), qn = d(/^<(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(), Jn = d(_n).replace("(?:-->|$)", "-->").getRegex(), Yn = d("^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", Jn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Xn = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Zn = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Xn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Qn = d(/^!?\[(label)\]\[(ref)\]/).replace("label", Xn).replace("ref", pn).getRegex(), $n = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), er = d("reflink|nolink(?!\\()", "g").replace("reflink", Qn).replace("nolink", $n).getRegex(), tr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, nr = {
2168
+ _backpedal: en,
2169
+ anyPunctuation: Kn,
2170
+ autolink: qn,
2171
+ blockSkip: In,
2172
+ br: Dn,
2173
+ code: En,
2174
+ del: en,
2175
+ delLDelim: en,
2176
+ delRDelim: en,
2177
+ emStrongLDelim: Rn,
2178
+ emStrongRDelimAst: Vn,
2179
+ emStrongRDelimUnd: Un,
2180
+ escape: Tn,
2181
+ link: Zn,
2182
+ nolink: $n,
2183
+ punctuation: Mn,
2184
+ reflink: Qn,
2185
+ reflinkSearch: er,
2186
+ tag: Yn,
2187
+ text: On,
2188
+ url: en
2156
2189
  }, rr = {
2157
- normal: Qn,
2158
- gfm: er,
2159
- breaks: tr,
2160
- pedantic: $n
2190
+ ...nr,
2191
+ link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", Xn).getRegex(),
2192
+ reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Xn).getRegex()
2161
2193
  }, ir = {
2194
+ ...nr,
2195
+ emStrongRDelimAst: Hn,
2196
+ emStrongLDelim: zn,
2197
+ delLDelim: Wn,
2198
+ delRDelim: Gn,
2199
+ url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", tr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
2200
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
2201
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
2202
+ text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", tr).getRegex()
2203
+ }, ar = {
2204
+ ...ir,
2205
+ br: d(Dn).replace("{2,}", "*").getRegex(),
2206
+ text: d(ir.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
2207
+ }, or = {
2208
+ normal: xn,
2209
+ gfm: Cn,
2210
+ pedantic: wn
2211
+ }, sr = {
2212
+ normal: nr,
2213
+ gfm: ir,
2214
+ breaks: ar,
2215
+ pedantic: rr
2216
+ }, cr = {
2162
2217
  "&": "&amp;",
2163
2218
  "<": "&lt;",
2164
2219
  ">": "&gt;",
2165
2220
  "\"": "&quot;",
2166
2221
  "'": "&#39;"
2167
- }, ge = (e) => ir[e];
2222
+ }, ge = (e) => cr[e];
2168
2223
  function O(e, t) {
2169
2224
  if (t) {
2170
2225
  if (Z.escapeTest.test(e)) return e.replace(Z.escapeReplace, ge);
@@ -2249,7 +2304,7 @@ function ot(e, t, n) {
2249
2304
  }
2250
2305
  var w = class {
2251
2306
  constructor(t) {
2252
- e(this, "options", void 0), e(this, "rules", void 0), e(this, "lexer", void 0), this.options = t || Yt;
2307
+ e(this, "options", void 0), e(this, "rules", void 0), e(this, "lexer", void 0), this.options = t || $t;
2253
2308
  }
2254
2309
  space(e) {
2255
2310
  let t = this.rules.block.newline.exec(e);
@@ -2699,24 +2754,24 @@ ${c}` : c;
2699
2754
  };
2700
2755
  }
2701
2756
  }
2702
- }, ar = class l {
2757
+ }, lr = class l {
2703
2758
  constructor(t) {
2704
- e(this, "tokens", void 0), e(this, "options", void 0), e(this, "state", void 0), e(this, "inlineQueue", void 0), e(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = t || Yt, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2759
+ e(this, "tokens", void 0), e(this, "options", void 0), e(this, "state", void 0), e(this, "inlineQueue", void 0), e(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = t || $t, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
2705
2760
  inLink: !1,
2706
2761
  inRawBlock: !1,
2707
2762
  top: !0
2708
2763
  };
2709
2764
  let n = {
2710
2765
  other: Z,
2711
- block: nr.normal,
2712
- inline: rr.normal
2766
+ block: or.normal,
2767
+ inline: sr.normal
2713
2768
  };
2714
- this.options.pedantic ? (n.block = nr.pedantic, n.inline = rr.pedantic) : this.options.gfm && (n.block = nr.gfm, this.options.breaks ? n.inline = rr.breaks : n.inline = rr.gfm), this.tokenizer.rules = n;
2769
+ this.options.pedantic ? (n.block = or.pedantic, n.inline = sr.pedantic) : this.options.gfm && (n.block = or.gfm, this.options.breaks ? n.inline = sr.breaks : n.inline = sr.gfm), this.tokenizer.rules = n;
2715
2770
  }
2716
2771
  static get rules() {
2717
2772
  return {
2718
- block: nr,
2719
- inline: rr
2773
+ block: or,
2774
+ inline: sr
2720
2775
  };
2721
2776
  }
2722
2777
  static lex(e, t) {
@@ -2918,7 +2973,7 @@ ${c}` : c;
2918
2973
  }
2919
2974
  }, y = class {
2920
2975
  constructor(t) {
2921
- e(this, "options", void 0), e(this, "parser", void 0), this.options = t || Yt;
2976
+ e(this, "options", void 0), e(this, "parser", void 0), this.options = t || $t;
2922
2977
  }
2923
2978
  space(e) {
2924
2979
  return "";
@@ -3052,9 +3107,9 @@ ${e}</tr>
3052
3107
  checkbox({ raw: e }) {
3053
3108
  return e;
3054
3109
  }
3055
- }, or = class l {
3110
+ }, ur = class l {
3056
3111
  constructor(t) {
3057
- e(this, "options", void 0), e(this, "renderer", void 0), e(this, "textRenderer", void 0), this.options = t || Yt, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
3112
+ e(this, "options", void 0), e(this, "renderer", void 0), e(this, "textRenderer", void 0), this.options = t || $t, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
3058
3113
  }
3059
3114
  static parse(e, t) {
3060
3115
  return new l(t).parse(e);
@@ -3200,9 +3255,9 @@ ${e}</tr>
3200
3255
  }
3201
3256
  return n;
3202
3257
  }
3203
- }, sr = (_Class = class {
3258
+ }, dr = (_Class = class {
3204
3259
  constructor(t) {
3205
- e(this, "options", void 0), e(this, "block", void 0), this.options = t || Yt;
3260
+ e(this, "options", void 0), e(this, "block", void 0), this.options = t || $t;
3206
3261
  }
3207
3262
  preprocess(e) {
3208
3263
  return e;
@@ -3217,10 +3272,10 @@ ${e}</tr>
3217
3272
  return e;
3218
3273
  }
3219
3274
  provideLexer(e = this.block) {
3220
- return e ? ar.lex : ar.lexInline;
3275
+ return e ? lr.lex : lr.lexInline;
3221
3276
  }
3222
3277
  provideParser(e = this.block) {
3223
- return e ? or.parse : or.parseInline;
3278
+ return e ? ur.parse : ur.parseInline;
3224
3279
  }
3225
3280
  }, e(_Class, "passThroughHooks", /* @__PURE__ */ new Set([
3226
3281
  "preprocess",
@@ -3233,7 +3288,7 @@ ${e}</tr>
3233
3288
  "processAllTokens"
3234
3289
  ])), _Class), D = class {
3235
3290
  constructor(...t) {
3236
- e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser", or), e(this, "Renderer", y), e(this, "TextRenderer", L), e(this, "Lexer", ar), e(this, "Tokenizer", w), e(this, "Hooks", sr), this.use(...t);
3291
+ e(this, "defaults", M()), e(this, "options", this.setOptions), e(this, "parse", this.parseMarkdown(!0)), e(this, "parseInline", this.parseMarkdown(!1)), e(this, "Parser", ur), e(this, "Renderer", y), e(this, "TextRenderer", L), e(this, "Lexer", lr), e(this, "Tokenizer", w), e(this, "Hooks", dr), this.use(...t);
3237
3292
  }
3238
3293
  walkTokens(e, t) {
3239
3294
  let n = [];
@@ -3312,13 +3367,13 @@ ${e}</tr>
3312
3367
  n.tokenizer = t;
3313
3368
  }
3314
3369
  if (e.hooks) {
3315
- let t = this.defaults.hooks || new sr();
3370
+ let t = this.defaults.hooks || new dr();
3316
3371
  for (let n in e.hooks) {
3317
3372
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
3318
3373
  if (["options", "block"].includes(n)) continue;
3319
3374
  let r = n, i = e.hooks[r], a = t[r];
3320
- sr.passThroughHooks.has(n) ? t[r] = (e) => {
3321
- if (this.defaults.async && sr.passThroughHooksRespectAsync.has(n)) return (async () => {
3375
+ dr.passThroughHooks.has(n) ? t[r] = (e) => {
3376
+ if (this.defaults.async && dr.passThroughHooksRespectAsync.has(n)) return (async () => {
3322
3377
  let n = await i.call(t, e);
3323
3378
  return a.call(t, n);
3324
3379
  })();
@@ -3355,10 +3410,10 @@ ${e}</tr>
3355
3410
  }, this;
3356
3411
  }
3357
3412
  lexer(e, t) {
3358
- return ar.lex(e, t ?? this.defaults);
3413
+ return lr.lex(e, t ?? this.defaults);
3359
3414
  }
3360
3415
  parser(e, t) {
3361
- return or.parse(e, t ?? this.defaults);
3416
+ return ur.parse(e, t ?? this.defaults);
3362
3417
  }
3363
3418
  parseMarkdown(e) {
3364
3419
  return (t, n) => {
@@ -3370,16 +3425,16 @@ ${e}</tr>
3370
3425
  if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
3371
3426
  if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
3372
3427
  if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
3373
- let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? ar.lex : ar.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3428
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? lr.lex : lr.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
3374
3429
  i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
3375
- let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? or.parse : or.parseInline)(a, i);
3430
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? ur.parse : ur.parseInline)(a, i);
3376
3431
  return i.hooks ? await i.hooks.postprocess(o) : o;
3377
3432
  })().catch(a);
3378
3433
  try {
3379
3434
  i.hooks && (t = i.hooks.preprocess(t));
3380
- let n = (i.hooks ? i.hooks.provideLexer(e) : e ? ar.lex : ar.lexInline)(t, i);
3435
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? lr.lex : lr.lexInline)(t, i);
3381
3436
  i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
3382
- let r = (i.hooks ? i.hooks.provideParser(e) : e ? or.parse : or.parseInline)(n, i);
3437
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? ur.parse : ur.parseInline)(n, i);
3383
3438
  return i.hooks && (r = i.hooks.postprocess(r)), r;
3384
3439
  } catch (e) {
3385
3440
  return a(e);
@@ -3396,25 +3451,25 @@ ${e}</tr>
3396
3451
  throw n;
3397
3452
  };
3398
3453
  }
3399
- }, cr = new D();
3454
+ }, fr = new D();
3400
3455
  function g(e, t) {
3401
- return cr.parse(e, t);
3456
+ return fr.parse(e, t);
3402
3457
  }
3403
3458
  g.options = g.setOptions = function(e) {
3404
- return cr.setOptions(e), g.defaults = cr.defaults, N(g.defaults), g;
3405
- }, g.getDefaults = M, g.defaults = Yt, g.use = function(...e) {
3406
- return cr.use(...e), g.defaults = cr.defaults, N(g.defaults), g;
3459
+ return fr.setOptions(e), g.defaults = fr.defaults, N(g.defaults), g;
3460
+ }, g.getDefaults = M, g.defaults = $t, g.use = function(...e) {
3461
+ return fr.use(...e), g.defaults = fr.defaults, N(g.defaults), g;
3407
3462
  }, g.walkTokens = function(e, t) {
3408
- return cr.walkTokens(e, t);
3409
- }, g.parseInline = cr.parseInline, g.Parser = or, g.parser = or.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = ar, g.lexer = ar.lex, g.Tokenizer = w, g.Hooks = sr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, or.parse, ar.lex;
3463
+ return fr.walkTokens(e, t);
3464
+ }, g.parseInline = fr.parseInline, g.Parser = ur, g.parser = ur.parse, g.Renderer = y, g.TextRenderer = L, g.Lexer = lr, g.lexer = lr.lex, g.Tokenizer = w, g.Hooks = dr, g.parse = g, g.options, g.setOptions, g.use, g.walkTokens, g.parseInline, ur.parse, lr.lex;
3410
3465
  //#endregion
3411
3466
  //#region agent/ui/chat-diagram-layout.ts
3412
- var lr = 112, ur = 52, dr = 14, fr = 54, pr = 34, mr = 260;
3467
+ var pr = 112, mr = 52, hr = 14, gr = 54, _r = 34, vr = 260;
3413
3468
  function nodeWidthFor(e) {
3414
3469
  let { orientation: t, maxRows: n, maxWidth: r } = e;
3415
- if (t === "horizontal" || !r) return lr;
3416
- let i = r - dr * 2 - (n - 1) * fr;
3417
- return Math.min(mr, Math.max(lr, Math.floor(i / n)));
3470
+ if (t === "horizontal" || !r) return pr;
3471
+ let i = r - hr * 2 - (n - 1) * gr;
3472
+ return Math.min(vr, Math.max(pr, Math.floor(i / n)));
3418
3473
  }
3419
3474
  function orientationFor(e) {
3420
3475
  return e.layout === "left-to-right" || e.layout === "radial" ? "horizontal" : e.layout === "top-to-bottom" ? "vertical" : e.diagramType === "sequence" ? "horizontal" : "vertical";
@@ -3451,11 +3506,11 @@ function buildLayout(e, t, n) {
3451
3506
  orientation: t,
3452
3507
  maxRows: o,
3453
3508
  ...n === void 0 ? {} : { maxWidth: n }
3454
- }), u = t === "horizontal" ? dr * 2 + s * c + (s - 1) * fr : dr * 2 + o * c + (o - 1) * fr, f = t === "horizontal" ? dr * 2 + o * ur + (o - 1) * pr : dr * 2 + s * ur + (s - 1) * pr, p = [];
3509
+ }), u = t === "horizontal" ? hr * 2 + s * c + (s - 1) * gr : hr * 2 + o * c + (o - 1) * gr, f = t === "horizontal" ? hr * 2 + o * mr + (o - 1) * _r : hr * 2 + s * mr + (s - 1) * _r, p = [];
3455
3510
  for (let [e, [, n]] of a.entries()) {
3456
- let r = (o - n.length) * (t === "horizontal" ? 86 : c + fr) / 2;
3511
+ let r = (o - n.length) * (t === "horizontal" ? 86 : c + gr) / 2;
3457
3512
  for (let [i, a] of n.entries()) {
3458
- let n = t === "horizontal" ? dr + e * (c + fr) : dr + r + i * (c + fr), o = t === "horizontal" ? dr + r + i * 86 : dr + e * 86;
3513
+ let n = t === "horizontal" ? hr + e * (c + gr) : hr + r + i * (c + gr), o = t === "horizontal" ? hr + r + i * 86 : hr + e * 86;
3459
3514
  p.push({
3460
3515
  id: a.id,
3461
3516
  label: a.label,
@@ -3464,7 +3519,7 @@ function buildLayout(e, t, n) {
3464
3519
  x: n,
3465
3520
  y: o,
3466
3521
  width: c,
3467
- height: ur
3522
+ height: mr
3468
3523
  });
3469
3524
  }
3470
3525
  }
@@ -3541,14 +3596,14 @@ function formatChatVisualTick(e) {
3541
3596
  let { prefix: r, suffix: i } = affixes(n);
3542
3597
  return `${r}${formatChatVisualValue({ value: t })}${i}`;
3543
3598
  }
3544
- var hr = 5.4, gr = 10, _r = 15, vr = 16;
3599
+ var yr = 5.4, br = 10, xr = 15, Sr = 16;
3545
3600
  function planChatVisualXLabels(e) {
3546
3601
  let { labels: t, plotWidth: n } = e;
3547
3602
  if (!t.length || n <= 0) return {
3548
3603
  mode: "horizontal",
3549
3604
  entries: []
3550
3605
  };
3551
- let r = t.map((e) => e.length > vr ? `${e.slice(0, vr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
3606
+ let r = t.map((e) => e.length > Sr ? `${e.slice(0, Sr - 1).trimEnd()}\u2026` : e), i = t.length - 1;
3552
3607
  if (i === 0) return {
3553
3608
  mode: "horizontal",
3554
3609
  entries: [{
@@ -3556,14 +3611,14 @@ function planChatVisualXLabels(e) {
3556
3611
  text: r[0]
3557
3612
  }]
3558
3613
  };
3559
- if ((Math.max(...r.map((e) => e.length * hr)) + gr) * t.length <= n) return {
3614
+ if ((Math.max(...r.map((e) => e.length * yr)) + br) * t.length <= n) return {
3560
3615
  mode: "horizontal",
3561
3616
  entries: r.map((e, t) => ({
3562
3617
  index: t,
3563
3618
  text: e
3564
3619
  }))
3565
3620
  };
3566
- let a = Math.max(2, Math.floor(n / _r));
3621
+ let a = Math.max(2, Math.floor(n / xr));
3567
3622
  if (t.length <= a) return {
3568
3623
  mode: "angled",
3569
3624
  entries: r.map((e, t) => ({
@@ -3583,22 +3638,22 @@ function planChatVisualXLabels(e) {
3583
3638
  }
3584
3639
  //#endregion
3585
3640
  //#region agent/ui/ChatVisualBlock.vue?vue&type=script&setup=true&lang.ts
3586
- var yr = [
3641
+ var Cr = [
3587
3642
  "data-visual-type",
3588
3643
  "data-chart-type",
3589
3644
  "data-stacking",
3590
3645
  "data-diagram-type",
3591
3646
  "aria-label"
3592
- ], br = { class: "mb-2.5" }, xr = ["aria-label"], Sr = {
3647
+ ], wr = { class: "mb-2.5" }, Tr = ["aria-label"], Er = {
3593
3648
  key: 0,
3594
3649
  "data-test": "chat-visual-horizontal-bars",
3595
3650
  class: "grid gap-3"
3596
- }, Cr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, wr = ["viewBox"], Tr = [
3651
+ }, Dr = { class: "mb-1 flex items-start justify-between gap-3 text-[12px]" }, Or = ["viewBox"], kr = [
3597
3652
  "x1",
3598
3653
  "x2",
3599
3654
  "y1",
3600
3655
  "y2"
3601
- ], Er = ["x", "y"], Dr = [
3656
+ ], Ar = ["x", "y"], jr = [
3602
3657
  "data-row-index",
3603
3658
  "data-series-index",
3604
3659
  "data-data-key",
@@ -3606,56 +3661,56 @@ var yr = [
3606
3661
  "y",
3607
3662
  "width",
3608
3663
  "height"
3609
- ], Or = ["data-trend-key", "d"], kr = ["d"], Ar = ["cx", "cy"], jr = ["cx", "cy"], Mr = [
3664
+ ], Mr = ["data-trend-key", "d"], Nr = ["d"], Pr = ["cx", "cy"], Fr = ["cx", "cy"], Ir = [
3610
3665
  "x",
3611
3666
  "y",
3612
3667
  "text-anchor",
3613
3668
  "transform"
3614
- ], Nr = {
3669
+ ], Lr = {
3615
3670
  key: 2,
3616
3671
  class: "mt-2.5 flex flex-wrap items-center gap-x-4 gap-y-1.5"
3617
- }, Pr = {
3672
+ }, Rr = {
3618
3673
  key: 1,
3619
3674
  class: "grid gap-3"
3620
- }, Fr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Ir = { class: "shrink-0 tabular-nums" }, Lr = {
3675
+ }, zr = { class: "mb-1 flex items-baseline justify-between gap-3 text-[12px]" }, Br = { class: "shrink-0 tabular-nums" }, Vr = {
3621
3676
  key: 2,
3622
3677
  class: "overflow-x-auto"
3623
- }, Rr = ["viewBox", "aria-label"], zr = [
3678
+ }, Hr = ["viewBox", "aria-label"], Ur = [
3624
3679
  "data-from",
3625
3680
  "data-to",
3626
3681
  "x1",
3627
3682
  "y1",
3628
3683
  "x2",
3629
3684
  "y2"
3630
- ], Br = ["cx", "cy"], Vr = ["x", "y"], Hr = [
3685
+ ], Wr = ["cx", "cy"], Gr = ["x", "y"], Kr = [
3631
3686
  "data-node-id",
3632
3687
  "data-node-kind",
3633
3688
  "transform"
3634
- ], Ur = ["points"], Wr = ["width", "height"], Gr = ["width", "height"], Kr = {
3689
+ ], qr = ["points"], Jr = ["width", "height"], Yr = ["width", "height"], Xr = {
3635
3690
  xmlns: "http://www.w3.org/1999/xhtml",
3636
3691
  class: "flex h-full min-w-0 flex-col items-center justify-center text-center"
3637
- }, qr = /* @__PURE__ */ x({
3692
+ }, Zr = /* @__PURE__ */ x({
3638
3693
  __name: "ChatVisualBlock",
3639
3694
  props: {
3640
3695
  result: {},
3641
3696
  inverted: { type: Boolean }
3642
3697
  },
3643
3698
  setup(e) {
3644
- let t = e, n = k(), r = se(360), i;
3645
- ie(() => {
3699
+ let t = e, n = A(), r = oe(360), i;
3700
+ ne(() => {
3646
3701
  typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
3647
3702
  let t = e[0]?.contentRect.width;
3648
3703
  t && (r.value = Math.round(t));
3649
3704
  }), i.observe(n.value));
3650
- }), re(() => i?.disconnect());
3651
- let a = p(() => Math.min(720, Math.max(280, r.value))), o = p(() => t.result.ok ? t.result.spec : null), s = p(() => o.value?.visualType === "chart" ? o.value : null), c = p(() => o.value?.visualType === "diagram" ? o.value : null);
3705
+ }), te(() => i?.disconnect());
3706
+ let a = f(() => Math.min(720, Math.max(280, r.value))), o = f(() => t.result.ok ? t.result.spec : null), s = f(() => o.value?.visualType === "chart" ? o.value : null), c = f(() => o.value?.visualType === "diagram" ? o.value : null);
3652
3707
  function isCartesianChart(e) {
3653
3708
  return e?.chartType === "bar" || e?.chartType === "line" || e?.chartType === "scatter";
3654
3709
  }
3655
3710
  function isPieChart(e) {
3656
3711
  return e?.chartType === "pie";
3657
3712
  }
3658
- let u = p(() => s.value?.data ?? []), m = p(() => isCartesianChart(s.value) ? s.value : null), te = p(() => m.value?.series ?? []), b = p(() => isPieChart(s.value) ? s.value : null), x = p(() => m.value?.chartType === "bar" && m.value.stacking === "stacked");
3713
+ let p = f(() => s.value?.data ?? []), v = f(() => isCartesianChart(s.value) ? s.value : null), b = f(() => v.value?.series ?? []), x = f(() => isPieChart(s.value) ? s.value : null), S = f(() => v.value?.chartType === "bar" && v.value.stacking === "stacked");
3659
3714
  function numericValue(e) {
3660
3715
  return typeof e == "number" && Number.isFinite(e) ? e : null;
3661
3716
  }
@@ -3687,8 +3742,8 @@ var yr = [
3687
3742
  intercept: (r - s * n) / t
3688
3743
  };
3689
3744
  }
3690
- let ne = p(() => {
3691
- let e = [], t = m.value;
3745
+ let C = f(() => {
3746
+ let e = [], t = v.value;
3692
3747
  if (!t) return e;
3693
3748
  if (t.chartType === "bar" && t.stacking === "stacked") for (let n of t.data) {
3694
3749
  let r = 0, i = 0;
@@ -3717,8 +3772,8 @@ var yr = [
3717
3772
  let n = e > 0 ? e : 1, r = Math.floor(Math.log10(n)), i = n / 10 ** r, a;
3718
3773
  return a = t ? i < 1.5 ? 1 : i < 3 ? 2 : i < 7 ? 5 : 10 : i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10, a * 10 ** r;
3719
3774
  }
3720
- let S = p(() => {
3721
- let e = ne.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3775
+ let re = f(() => {
3776
+ let e = C.value, t = e.length ? Math.max(0, ...e) : 1, n = e.length ? Math.min(0, ...e) : 0;
3722
3777
  if (n === t) return {
3723
3778
  min: 0,
3724
3779
  max: t || 1,
@@ -3731,8 +3786,8 @@ var yr = [
3731
3786
  max: a,
3732
3787
  ticks: o
3733
3788
  };
3734
- }), ae = p(() => resolveSharedSeriesFormat({ series: te.value })), oe = p(() => {
3735
- let e = m.value;
3789
+ }), ie = f(() => resolveSharedSeriesFormat({ series: b.value })), ae = f(() => {
3790
+ let e = v.value;
3736
3791
  if (!e) return {
3737
3792
  mode: "horizontal",
3738
3793
  entries: []
@@ -3742,8 +3797,8 @@ var yr = [
3742
3797
  labels: e.data.map((e) => String(e?.[t] ?? "")),
3743
3798
  plotWidth: Math.max(200, a.value - 42)
3744
3799
  });
3745
- }), j = p(() => {
3746
- let e = ae.value?.valueFormat, t = !!(ae.value && (e === "currency" || e === "percent" || ae.value.valuePrefix || ae.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = oe.value.mode === "angled";
3800
+ }), F = f(() => {
3801
+ let e = ie.value?.valueFormat, t = !!(ie.value && (e === "currency" || e === "percent" || ie.value.valuePrefix || ie.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = ae.value.mode === "angled";
3747
3802
  return {
3748
3803
  width: a.value,
3749
3804
  height: 168 + (r ? 36 : 0),
@@ -3754,7 +3809,7 @@ var yr = [
3754
3809
  };
3755
3810
  });
3756
3811
  function labelCenterX(e, t) {
3757
- let n = m.value, r = j.value;
3812
+ let n = v.value, r = F.value;
3758
3813
  if (n?.chartType === "bar") {
3759
3814
  let n = r.width - r.left - r.right;
3760
3815
  return r.left + (e + .5) * (n / Math.max(t, 1));
@@ -3762,22 +3817,22 @@ var yr = [
3762
3817
  return xForIndex(e, t);
3763
3818
  }
3764
3819
  function xForIndex(e, t) {
3765
- let n = j.value, r = n.width - n.left - n.right;
3820
+ let n = F.value, r = n.width - n.left - n.right;
3766
3821
  return t <= 1 ? n.left + r / 2 : n.left + r * e / (t - 1);
3767
3822
  }
3768
3823
  function yForValue(e) {
3769
- let { min: t, max: n } = S.value, r = j.value, i = r.height - r.top - r.bottom;
3824
+ let { min: t, max: n } = re.value, r = F.value, i = r.height - r.top - r.bottom;
3770
3825
  return r.top + (n - e) / (n - t || 1) * i;
3771
3826
  }
3772
3827
  function pathForSeries(e) {
3773
- let t = m.value;
3828
+ let t = v.value;
3774
3829
  return t ? t.data.map((n, r) => {
3775
3830
  let i = numericValue(n[e]) ?? 0;
3776
3831
  return `${r === 0 ? "M" : "L"} ${xForIndex(r, t.data.length).toFixed(1)} ${yForValue(i).toFixed(1)}`;
3777
3832
  }).join(" ") : "";
3778
3833
  }
3779
- let ue = p(() => {
3780
- let e = m.value;
3834
+ let ce = f(() => {
3835
+ let e = v.value;
3781
3836
  if (!e?.trendLine || e.chartType !== "line" && e.chartType !== "scatter") return null;
3782
3837
  let t = trendLinePoints(e, e.trendLine.dataKey), n = linearTrend(t);
3783
3838
  if (!n || !t.length) return null;
@@ -3787,11 +3842,11 @@ var yr = [
3787
3842
  dataKey: e.trendLine.dataKey,
3788
3843
  seriesIndex: s
3789
3844
  };
3790
- }), de = p(() => {
3791
- let e = m.value;
3845
+ }), ue = f(() => {
3846
+ let e = v.value;
3792
3847
  if (!e || e.chartType !== "bar") return [];
3793
- let t = j.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3794
- if (x.value) {
3848
+ let t = F.value, n = (t.width - t.left - t.right) / Math.max(e.data.length, 1), r = yForValue(0);
3849
+ if (S.value) {
3795
3850
  let r = Math.max(4, Math.min(24, n * .42));
3796
3851
  return e.data.flatMap((i, a) => {
3797
3852
  let o = 0, s = 0, c = t.left + a * n + (n - r) / 2;
@@ -3824,12 +3879,12 @@ var yr = [
3824
3879
  dataKey: e.dataKey
3825
3880
  };
3826
3881
  }));
3827
- }), F = p(() => {
3828
- let e = m.value;
3882
+ }), I = f(() => {
3883
+ let e = v.value;
3829
3884
  if (!e) return [];
3830
3885
  let t = e.data;
3831
3886
  if (!t.length) return [];
3832
- let n = t.length - 1, r = oe.value, i = r.mode === "angled";
3887
+ let n = t.length - 1, r = ae.value, i = r.mode === "angled";
3833
3888
  return r.entries.map(({ index: e, text: r }) => ({
3834
3889
  key: `${e}`,
3835
3890
  label: r,
@@ -3837,9 +3892,9 @@ var yr = [
3837
3892
  anchor: i ? "end" : e === 0 ? "start" : e === n ? "end" : "middle",
3838
3893
  angled: i
3839
3894
  })).filter((e) => e.label);
3840
- }), pe = p(() => {
3841
- let e = m.value;
3842
- if (!e || e.chartType !== "bar" || e.series.length !== 1 || x.value) return [];
3895
+ }), de = f(() => {
3896
+ let e = v.value;
3897
+ if (!e || e.chartType !== "bar" || e.series.length !== 1 || S.value) return [];
3843
3898
  let t = e.series[0], n = e.data.map((n, r) => {
3844
3899
  let i = categoryLabel(n, e.xKey), a = numericValue(n[t.dataKey]);
3845
3900
  return !i || a === null ? null : {
@@ -3860,8 +3915,8 @@ var yr = [
3860
3915
  width: e.rawValue <= 0 ? 0 : Math.max(2, e.rawValue / r * 100),
3861
3916
  seriesIndex: 0
3862
3917
  }));
3863
- }), he = p(() => {
3864
- let e = m.value;
3918
+ }), R = f(() => {
3919
+ let e = v.value;
3865
3920
  if (!e?.data.length) return [];
3866
3921
  let t = e.data[e.data.length - 1];
3867
3922
  return e.series.map((e, n) => {
@@ -3876,8 +3931,8 @@ var yr = [
3876
3931
  seriesIndex: n
3877
3932
  };
3878
3933
  });
3879
- }), I = p(() => {
3880
- let e = m.value;
3934
+ }), pe = f(() => {
3935
+ let e = v.value;
3881
3936
  if (!e?.data.length || e.chartType !== "line") return [];
3882
3937
  let t = e.data.length - 1, n = e.data[t];
3883
3938
  return e.series.map((r, i) => {
@@ -3889,8 +3944,8 @@ var yr = [
3889
3944
  seriesIndex: i
3890
3945
  };
3891
3946
  }).filter((e) => e !== null);
3892
- }), _e = p(() => {
3893
- let e = b.value;
3947
+ }), he = f(() => {
3948
+ let e = x.value;
3894
3949
  if (!e) return [];
3895
3950
  let t = e.data.map((t) => ({
3896
3951
  name: String(t[e.nameKey] ?? ""),
@@ -3905,7 +3960,7 @@ var yr = [
3905
3960
  series: r
3906
3961
  })
3907
3962
  }));
3908
- }), R = p(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), ve = [
3963
+ }), _e = f(() => c.value ? layoutChatDiagram(c.value, { maxWidth: r.value }) : null), ve = [
3909
3964
  "var(--color-theme-900)",
3910
3965
  "var(--color-primary-500)",
3911
3966
  "color-mix(in oklch, var(--color-primary-500) 55%, var(--color-theme-500))"
@@ -3924,82 +3979,82 @@ var yr = [
3924
3979
  function diagramNodeStroke(e) {
3925
3980
  return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Ce.value;
3926
3981
  }
3927
- let z = p(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), be = p(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), B = p(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), Se = p(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), H = p(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Ce = p(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), U = p(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), we = p(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Te = p(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
3928
- return (e, r) => o.value ? (T(), _("section", {
3982
+ let z = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), B = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Ce = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), we = f(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), Te = f(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
3983
+ return (e, r) => o.value ? (k(), h("section", {
3929
3984
  key: 0,
3930
3985
  "data-test": "chat-visual",
3931
3986
  "data-visual-type": o.value.visualType,
3932
3987
  "data-chart-type": s.value?.chartType,
3933
- "data-stacking": x.value ? "stacked" : void 0,
3988
+ "data-stacking": S.value ? "stacked" : void 0,
3934
3989
  "data-diagram-type": c.value?.diagramType,
3935
3990
  class: "my-6 w-full rounded-[20px] px-4 pb-3.5 pt-4",
3936
- style: C({ boxShadow: `inset 0 0 0 1px ${U.value}` }),
3991
+ style: T({ boxShadow: `inset 0 0 0 1px ${U.value}` }),
3937
3992
  "aria-label": o.value.meta.title
3938
3993
  }, [
3939
- v("header", br, [v("h4", {
3994
+ _("header", wr, [_("h4", {
3940
3995
  class: "text-[13px] font-semibold leading-tight",
3941
- style: C({ color: z.value })
3942
- }, P(o.value.meta.title), 5), o.value.meta.description ? (T(), _("p", {
3996
+ style: T({ color: z.value })
3997
+ }, P(o.value.meta.title), 5), o.value.meta.description ? (k(), h("p", {
3943
3998
  key: 0,
3944
3999
  class: "mt-0.5 text-[12px] leading-snug",
3945
- style: C({ color: be.value })
3946
- }, P(o.value.meta.description), 5)) : h("", !0)]),
3947
- v("div", {
4000
+ style: T({ color: be.value })
4001
+ }, P(o.value.meta.description), 5)) : m("", !0)]),
4002
+ _("div", {
3948
4003
  ref_key: "bodyEl",
3949
4004
  ref: n
3950
- }, [m.value ? (T(), _("div", {
4005
+ }, [v.value ? (k(), h("div", {
3951
4006
  key: 0,
3952
4007
  role: "img",
3953
4008
  "aria-label": o.value.meta.title
3954
- }, [pe.value.length ? (T(), _("div", Sr, [(T(!0), _(f, null, A(pe.value, (e) => (T(), _("div", {
4009
+ }, [de.value.length ? (k(), h("div", Er, [(k(!0), h(u, null, j(de.value, (e) => (k(), h("div", {
3955
4010
  key: e.key,
3956
4011
  "data-test": "chat-visual-horizontal-bar",
3957
4012
  class: "min-w-0"
3958
- }, [v("div", Cr, [v("span", {
4013
+ }, [_("div", Dr, [_("span", {
3959
4014
  class: "line-clamp-2 min-w-0 font-medium leading-snug",
3960
- style: C({ color: z.value })
3961
- }, P(e.label), 5), v("span", {
4015
+ style: T({ color: z.value })
4016
+ }, P(e.label), 5), _("span", {
3962
4017
  class: "shrink-0 font-semibold tabular-nums",
3963
- style: C({ color: z.value })
3964
- }, P(e.value), 5)]), v("div", {
4018
+ style: T({ color: z.value })
4019
+ }, P(e.value), 5)]), _("div", {
3965
4020
  class: "h-2 w-full overflow-hidden rounded-full",
3966
- style: C({ background: Te.value })
3967
- }, [v("div", {
4021
+ style: T({ background: Te.value })
4022
+ }, [_("div", {
3968
4023
  class: "h-full rounded-full",
3969
- style: C({
4024
+ style: T({
3970
4025
  width: `${e.width}%`,
3971
4026
  background: seriesColor(e.seriesIndex)
3972
4027
  })
3973
- }, null, 4)], 4)]))), 128))])) : (T(), _("svg", {
4028
+ }, null, 4)], 4)]))), 128))])) : (k(), h("svg", {
3974
4029
  key: 1,
3975
4030
  class: "block h-auto w-full overflow-visible",
3976
- viewBox: `0 0 ${j.value.width} ${j.value.height}`,
3977
- style: C({ aspectRatio: `${j.value.width} / ${j.value.height}` }),
4031
+ viewBox: `0 0 ${F.value.width} ${F.value.height}`,
4032
+ style: T({ aspectRatio: `${F.value.width} / ${F.value.height}` }),
3978
4033
  preserveAspectRatio: "xMidYMid meet",
3979
4034
  "aria-hidden": "true"
3980
4035
  }, [
3981
- (T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("line", {
4036
+ (k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("line", {
3982
4037
  key: `grid-${e}`,
3983
- x1: j.value.left,
3984
- x2: j.value.width - j.value.right,
4038
+ x1: F.value.left,
4039
+ x2: F.value.width - F.value.right,
3985
4040
  y1: yForValue(e),
3986
4041
  y2: yForValue(e),
3987
4042
  "stroke-width": "1",
3988
4043
  "vector-effect": "non-scaling-stroke",
3989
- style: C({ stroke: e === 0 ? H.value : Se.value })
3990
- }, null, 12, Tr))), 128)),
3991
- v("g", null, [(T(!0), _(f, null, A(S.value.ticks, (e) => (T(), _("text", {
4044
+ style: T({ stroke: e === 0 ? H.value : Se.value })
4045
+ }, null, 12, kr))), 128)),
4046
+ _("g", null, [(k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("text", {
3992
4047
  key: `y-${e}`,
3993
- x: j.value.left - 7,
4048
+ x: F.value.left - 7,
3994
4049
  y: yForValue(e) + 3,
3995
4050
  "text-anchor": "end",
3996
4051
  "font-size": "9.5",
3997
- style: C({ fill: B.value })
3998
- }, P(ce(formatChatVisualTick)({
4052
+ style: T({ fill: B.value })
4053
+ }, P(se(formatChatVisualTick)({
3999
4054
  value: e,
4000
- shared: ae.value
4001
- })), 13, Er))), 128))]),
4002
- m.value.chartType === "bar" ? (T(!0), _(f, { key: 0 }, A(de.value, (e) => (T(), _("rect", {
4055
+ shared: ie.value
4056
+ })), 13, Ar))), 128))]),
4057
+ v.value.chartType === "bar" ? (k(!0), h(u, { key: 0 }, j(ue.value, (e) => (k(), h("rect", {
4003
4058
  key: e.key,
4004
4059
  "data-test": "chat-visual-bar",
4005
4060
  "data-row-index": e.rowIndex,
@@ -4010,22 +4065,22 @@ var yr = [
4010
4065
  width: e.width,
4011
4066
  height: e.height,
4012
4067
  rx: "2.5",
4013
- style: C({ fill: seriesColor(e.seriesIndex) })
4014
- }, null, 12, Dr))), 128)) : (T(), _(f, { key: 1 }, [
4015
- ue.value ? (T(), _("path", {
4068
+ style: T({ fill: seriesColor(e.seriesIndex) })
4069
+ }, null, 12, jr))), 128)) : (k(), h(u, { key: 1 }, [
4070
+ ce.value ? (k(), h("path", {
4016
4071
  key: 0,
4017
4072
  "data-test": "chat-visual-trend-line",
4018
- "data-trend-key": ue.value.dataKey,
4019
- d: ue.value.path,
4073
+ "data-trend-key": ce.value.dataKey,
4074
+ d: ce.value.path,
4020
4075
  fill: "none",
4021
4076
  "stroke-width": "1.4",
4022
4077
  "stroke-linecap": "round",
4023
4078
  "stroke-linejoin": "round",
4024
4079
  "stroke-dasharray": "4 3",
4025
4080
  "vector-effect": "non-scaling-stroke",
4026
- style: C({ stroke: seriesColor(ue.value.seriesIndex) })
4027
- }, null, 12, Or)) : h("", !0),
4028
- (T(!0), _(f, null, A(te.value, (e, t) => (T(), _("g", { key: e.dataKey }, [m.value.chartType === "line" ? (T(), _("path", {
4081
+ style: T({ stroke: seriesColor(ce.value.seriesIndex) })
4082
+ }, null, 12, Mr)) : m("", !0),
4083
+ (k(!0), h(u, null, j(b.value, (e, t) => (k(), h("g", { key: e.dataKey }, [v.value.chartType === "line" ? (k(), h("path", {
4029
4084
  key: 0,
4030
4085
  d: pathForSeries(e.dataKey),
4031
4086
  fill: "none",
@@ -4033,74 +4088,74 @@ var yr = [
4033
4088
  "stroke-linecap": "round",
4034
4089
  "stroke-linejoin": "round",
4035
4090
  "vector-effect": "non-scaling-stroke",
4036
- style: C({ stroke: seriesColor(t) })
4037
- }, null, 12, kr)) : h("", !0), (T(!0), _(f, null, A(u.value, (n, r) => (T(), _(f, { key: `${e.dataKey}-${r}` }, [m.value.chartType === "scatter" ? (T(), _("circle", {
4091
+ style: T({ stroke: seriesColor(t) })
4092
+ }, null, 12, Nr)) : m("", !0), (k(!0), h(u, null, j(p.value, (n, r) => (k(), h(u, { key: `${e.dataKey}-${r}` }, [v.value.chartType === "scatter" ? (k(), h("circle", {
4038
4093
  key: 0,
4039
- cx: xForIndex(r, u.value.length),
4094
+ cx: xForIndex(r, p.value.length),
4040
4095
  cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
4041
4096
  r: "2.6",
4042
- style: C({ fill: seriesColor(t) })
4043
- }, null, 12, Ar)) : h("", !0)], 64))), 128))]))), 128)),
4044
- (T(!0), _(f, null, A(I.value, (e) => (T(), _("circle", {
4097
+ style: T({ fill: seriesColor(t) })
4098
+ }, null, 12, Pr)) : m("", !0)], 64))), 128))]))), 128)),
4099
+ (k(!0), h(u, null, j(pe.value, (e) => (k(), h("circle", {
4045
4100
  key: `marker-${e.key}`,
4046
4101
  cx: e.cx,
4047
4102
  cy: e.cy,
4048
4103
  r: "3",
4049
- style: C({ fill: seriesColor(e.seriesIndex) })
4050
- }, null, 12, jr))), 128))
4104
+ style: T({ fill: seriesColor(e.seriesIndex) })
4105
+ }, null, 12, Fr))), 128))
4051
4106
  ], 64)),
4052
- (T(!0), _(f, null, A(F.value, (e) => (T(), _("text", {
4107
+ (k(!0), h(u, null, j(I.value, (e) => (k(), h("text", {
4053
4108
  key: e.key,
4054
4109
  x: e.x,
4055
- y: e.angled ? j.value.height - j.value.bottom + 12 : j.value.height - 6,
4110
+ y: e.angled ? F.value.height - F.value.bottom + 12 : F.value.height - 6,
4056
4111
  "text-anchor": e.anchor,
4057
4112
  "font-size": "9.5",
4058
- transform: e.angled ? `rotate(${ce(-40)} ${e.x} ${j.value.height - j.value.bottom + 12})` : void 0,
4059
- style: C({ fill: B.value })
4060
- }, P(e.label), 13, Mr))), 128))
4061
- ], 12, wr)), he.value.length > 1 || m.value.chartType !== "bar" ? (T(), _("div", Nr, [(T(!0), _(f, null, A(he.value, (e) => (T(), _("div", {
4113
+ transform: e.angled ? `rotate(${se(-40)} ${e.x} ${F.value.height - F.value.bottom + 12})` : void 0,
4114
+ style: T({ fill: B.value })
4115
+ }, P(e.label), 13, Ir))), 128))
4116
+ ], 12, Or)), R.value.length > 1 || v.value.chartType !== "bar" ? (k(), h("div", Lr, [(k(!0), h(u, null, j(R.value, (e) => (k(), h("div", {
4062
4117
  key: e.key,
4063
4118
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
4064
4119
  }, [
4065
- v("span", {
4120
+ _("span", {
4066
4121
  class: "size-2.5 shrink-0 rounded-full",
4067
- style: C({ background: seriesColor(e.seriesIndex) })
4122
+ style: T({ background: seriesColor(e.seriesIndex) })
4068
4123
  }, null, 4),
4069
- v("span", { style: C({ color: be.value }) }, P(e.label), 5),
4070
- v("span", {
4124
+ _("span", { style: T({ color: be.value }) }, P(e.label), 5),
4125
+ _("span", {
4071
4126
  class: "font-semibold tabular-nums",
4072
- style: C({ color: z.value })
4127
+ style: T({ color: z.value })
4073
4128
  }, P(e.value), 5)
4074
- ]))), 128))])) : h("", !0)], 8, xr)) : b.value ? (T(), _("div", Pr, [(T(!0), _(f, null, A(_e.value, (e, t) => (T(), _("div", { key: e.key }, [v("div", Fr, [v("span", {
4129
+ ]))), 128))])) : m("", !0)], 8, Tr)) : x.value ? (k(), h("div", Rr, [(k(!0), h(u, null, j(he.value, (e, t) => (k(), h("div", { key: e.key }, [_("div", zr, [_("span", {
4075
4130
  class: "truncate font-medium",
4076
- style: C({ color: z.value })
4077
- }, P(e.name), 5), v("span", Ir, [v("span", {
4131
+ style: T({ color: z.value })
4132
+ }, P(e.name), 5), _("span", Br, [_("span", {
4078
4133
  class: "font-semibold",
4079
- style: C({ color: z.value })
4080
- }, P(e.display), 5), v("span", {
4134
+ style: T({ color: z.value })
4135
+ }, P(e.display), 5), _("span", {
4081
4136
  class: "ml-1.5",
4082
- style: C({ color: be.value })
4083
- }, P(Math.round(e.percent * 100)) + "%", 5)])]), v("div", {
4137
+ style: T({ color: be.value })
4138
+ }, P(Math.round(e.percent * 100)) + "%", 5)])]), _("div", {
4084
4139
  class: "h-1.5 w-full overflow-hidden rounded-full",
4085
- style: C({ background: Te.value })
4086
- }, [v("div", {
4140
+ style: T({ background: Te.value })
4141
+ }, [_("div", {
4087
4142
  class: "h-full rounded-full",
4088
- style: C({
4143
+ style: T({
4089
4144
  width: `${Math.max(2, e.percent * 100)}%`,
4090
4145
  background: seriesColor(t)
4091
4146
  })
4092
- }, null, 4)], 4)]))), 128))])) : c.value && R.value ? (T(), _("div", Lr, [(T(), _("svg", {
4147
+ }, null, 4)], 4)]))), 128))])) : c.value && _e.value ? (k(), h("div", Vr, [(k(), h("svg", {
4093
4148
  "data-test": "chat-visual-diagram-svg",
4094
4149
  class: "block h-auto overflow-visible",
4095
- viewBox: `0 0 ${R.value.width} ${R.value.height}`,
4096
- style: C({
4097
- width: `${R.value.width}px`,
4098
- aspectRatio: `${R.value.width} / ${R.value.height}`
4150
+ viewBox: `0 0 ${_e.value.width} ${_e.value.height}`,
4151
+ style: T({
4152
+ width: `${_e.value.width}px`,
4153
+ aspectRatio: `${_e.value.width} / ${_e.value.height}`
4099
4154
  }),
4100
4155
  role: "img",
4101
4156
  "aria-label": o.value.meta.title
4102
4157
  }, [
4103
- (T(!0), _(f, null, A(R.value.edges, (e) => (T(), _("line", {
4158
+ (k(!0), h(u, null, j(_e.value.edges, (e) => (k(), h("line", {
4104
4159
  key: e.key,
4105
4160
  "data-test": "chat-visual-diagram-edge",
4106
4161
  "data-from": e.from,
@@ -4112,77 +4167,77 @@ var yr = [
4112
4167
  "stroke-width": "1.4",
4113
4168
  "stroke-linecap": "round",
4114
4169
  "vector-effect": "non-scaling-stroke",
4115
- style: C({ stroke: we.value })
4116
- }, null, 12, zr))), 128)),
4117
- (T(!0), _(f, null, A(R.value.edges, (e) => (T(), _("circle", {
4170
+ style: T({ stroke: we.value })
4171
+ }, null, 12, Ur))), 128)),
4172
+ (k(!0), h(u, null, j(_e.value.edges, (e) => (k(), h("circle", {
4118
4173
  key: `${e.key}-dot`,
4119
4174
  cx: e.x2,
4120
4175
  cy: e.y2,
4121
4176
  r: "2.4",
4122
- style: C({ fill: we.value })
4123
- }, null, 12, Br))), 128)),
4124
- (T(!0), _(f, null, A(R.value.edges.filter((e) => e.label), (e) => (T(), _("foreignObject", {
4177
+ style: T({ fill: we.value })
4178
+ }, null, 12, Wr))), 128)),
4179
+ (k(!0), h(u, null, j(_e.value.edges.filter((e) => e.label), (e) => (k(), h("foreignObject", {
4125
4180
  key: `${e.key}-label`,
4126
4181
  x: e.labelX - 55,
4127
4182
  y: e.labelY - 12,
4128
4183
  width: "110",
4129
4184
  height: "24"
4130
- }, [v("div", {
4185
+ }, [_("div", {
4131
4186
  xmlns: "http://www.w3.org/1999/xhtml",
4132
4187
  class: "flex h-full items-center justify-center px-1 text-center text-[10.5px] font-medium leading-none",
4133
- style: C({
4188
+ style: T({
4134
4189
  color: be.value,
4135
4190
  background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
4136
4191
  })
4137
- }, P(e.label), 5)], 8, Vr))), 128)),
4138
- (T(!0), _(f, null, A(R.value.nodes, (e) => (T(), _("g", {
4192
+ }, P(e.label), 5)], 8, Gr))), 128)),
4193
+ (k(!0), h(u, null, j(_e.value.nodes, (e) => (k(), h("g", {
4139
4194
  key: e.id,
4140
4195
  "data-test": "chat-visual-diagram-node",
4141
4196
  "data-node-id": e.id,
4142
4197
  "data-node-kind": e.kind,
4143
4198
  transform: `translate(${e.x} ${e.y})`
4144
- }, [e.kind === "decision" ? (T(), _("polygon", {
4199
+ }, [e.kind === "decision" ? (k(), h("polygon", {
4145
4200
  key: 0,
4146
4201
  points: `${e.width / 2},0 ${e.width},${e.height / 2} ${e.width / 2},${e.height} 0,${e.height / 2}`,
4147
4202
  "stroke-width": "1",
4148
4203
  "vector-effect": "non-scaling-stroke",
4149
- style: C({
4204
+ style: T({
4150
4205
  fill: diagramNodeFill(e.kind),
4151
4206
  stroke: diagramNodeStroke(e.kind)
4152
4207
  })
4153
- }, null, 12, Ur)) : (T(), _("rect", {
4208
+ }, null, 12, qr)) : (k(), h("rect", {
4154
4209
  key: 1,
4155
4210
  width: e.width,
4156
4211
  height: e.height,
4157
4212
  rx: "12",
4158
4213
  "stroke-width": "1",
4159
4214
  "vector-effect": "non-scaling-stroke",
4160
- style: C({
4215
+ style: T({
4161
4216
  fill: diagramNodeFill(e.kind),
4162
4217
  stroke: diagramNodeStroke(e.kind)
4163
4218
  })
4164
- }, null, 12, Wr)), (T(), _("foreignObject", {
4219
+ }, null, 12, Jr)), (k(), h("foreignObject", {
4165
4220
  x: "8",
4166
4221
  y: "5",
4167
4222
  width: e.width - 16,
4168
4223
  height: e.height - 10
4169
- }, [v("div", Kr, [v("div", {
4224
+ }, [_("div", Xr, [_("div", {
4170
4225
  class: "line-clamp-2 text-[13px] font-semibold leading-tight",
4171
- style: C({ color: z.value })
4172
- }, P(e.label), 5), e.detail ? (T(), _("div", {
4226
+ style: T({ color: z.value })
4227
+ }, P(e.label), 5), e.detail ? (k(), h("div", {
4173
4228
  key: 0,
4174
4229
  class: "mt-0.5 line-clamp-1 text-[10.5px] leading-none",
4175
- style: C({ color: be.value })
4176
- }, P(e.detail), 5)) : h("", !0)])], 8, Gr))], 8, Hr))), 128))
4177
- ], 12, Rr))])) : h("", !0)], 512),
4178
- o.value.meta.footer ? (T(), _("footer", {
4230
+ style: T({ color: be.value })
4231
+ }, P(e.detail), 5)) : m("", !0)])], 8, Yr))], 8, Kr))), 128))
4232
+ ], 12, Hr))])) : m("", !0)], 512),
4233
+ o.value.meta.footer ? (k(), h("footer", {
4179
4234
  key: 0,
4180
4235
  class: "mt-3 text-[11px] leading-snug",
4181
- style: C({ color: B.value })
4182
- }, P(o.value.meta.footer), 5)) : h("", !0)
4183
- ], 12, yr)) : h("", !0);
4236
+ style: T({ color: B.value })
4237
+ }, P(o.value.meta.footer), 5)) : m("", !0)
4238
+ ], 12, Cr)) : m("", !0);
4184
4239
  }
4185
- }), Jr = ["innerHTML"], Yr = /* @__PURE__ */ x({
4240
+ }), Qr = ["innerHTML"], $r = /* @__PURE__ */ x({
4186
4241
  __name: "ChatRichText",
4187
4242
  props: {
4188
4243
  text: {},
@@ -4190,8 +4245,8 @@ var yr = [
4190
4245
  streaming: { type: Boolean }
4191
4246
  },
4192
4247
  setup(e) {
4193
- let t = e, n = se(t.text), r;
4194
- de([() => t.text, () => t.streaming], ([e, i]) => {
4248
+ let t = e, n = oe(t.text), r;
4249
+ ce([() => t.text, () => t.streaming], ([e, i]) => {
4195
4250
  if (!i) {
4196
4251
  r !== void 0 && (cancelAnimationFrame(r), r = void 0), n.value = e;
4197
4252
  return;
@@ -4199,7 +4254,7 @@ var yr = [
4199
4254
  r === void 0 && (r = requestAnimationFrame(() => {
4200
4255
  r = void 0, n.value = t.text;
4201
4256
  }));
4202
- }), re(() => {
4257
+ }), te(() => {
4203
4258
  r !== void 0 && cancelAnimationFrame(r);
4204
4259
  });
4205
4260
  let i = new g.Renderer();
@@ -4221,7 +4276,7 @@ var yr = [
4221
4276
  function renderMarkdown(e) {
4222
4277
  if (!e) return "";
4223
4278
  let t = g.parse(e, { async: !1 });
4224
- return Jt.sanitize(t, {
4279
+ return Qt.sanitize(t, {
4225
4280
  ADD_ATTR: ["target"],
4226
4281
  ADD_DATA_URI_TAGS: ["img"]
4227
4282
  });
@@ -4277,15 +4332,15 @@ var yr = [
4277
4332
  }
4278
4333
  let a = /```(?:pl-visual|pl-platform-visual)[ \t]*(?:\r?\n|$)/;
4279
4334
  function richTextSegments(e) {
4280
- let { text: t, streaming: n } = e, r = [], i = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g, o = 0, s = 0, c = i.exec(t);
4281
- for (; c !== null;) {
4282
- let e = renderMarkdown(t.slice(o, c.index));
4335
+ let { text: t, streaming: n } = e, r = [], i = /```(?:pl-visual|pl-platform-visual)[ \t]*\r?\n([\s\S]*?)```/g, o = 0, s = 0, u = i.exec(t);
4336
+ for (; u !== null;) {
4337
+ let e = renderMarkdown(t.slice(o, u.index));
4283
4338
  e && r.push({
4284
4339
  kind: "markdown",
4285
4340
  key: `md-${s}`,
4286
4341
  html: e
4287
4342
  });
4288
- let n = u(c[1].trim());
4343
+ let n = c(u[1].trim());
4289
4344
  if (n.ok) r.push({
4290
4345
  kind: "visual",
4291
4346
  key: `visual-${s}`,
@@ -4296,8 +4351,8 @@ var yr = [
4296
4351
  reason: n.reason,
4297
4352
  message: n.message,
4298
4353
  hasFallbackMarkdown: !!n.fallbackMarkdown,
4299
- payloadChars: c[1].trim().length,
4300
- ...visualPayloadShape(c[1].trim())
4354
+ payloadChars: u[1].trim().length,
4355
+ ...visualPayloadShape(u[1].trim())
4301
4356
  });
4302
4357
  let e = n.fallbackMarkdown ? renderMarkdown(n.fallbackMarkdown) : "";
4303
4358
  e && r.push({
@@ -4306,7 +4361,7 @@ var yr = [
4306
4361
  html: e
4307
4362
  });
4308
4363
  }
4309
- o = c.index + c[0].length, s += 1, c = i.exec(t);
4364
+ o = u.index + u[0].length, s += 1, u = i.exec(t);
4310
4365
  }
4311
4366
  let f = t.slice(o), p = n ? a.exec(f) : null;
4312
4367
  if (p) {
@@ -4327,90 +4382,94 @@ var yr = [
4327
4382
  html: m
4328
4383
  }), r;
4329
4384
  }
4330
- let o = p(() => {
4385
+ let o = f(() => {
4331
4386
  let e = n.value;
4332
4387
  return e ? richTextSegments({
4333
4388
  text: e,
4334
4389
  streaming: !!t.streaming
4335
4390
  }) : [];
4336
4391
  });
4337
- return (t, n) => (T(), _("div", {
4338
- class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed",
4392
+ return (t, n) => (k(), h("div", {
4393
+ class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[16px] @sm/chat:leading-relaxed",
4339
4394
  onErrorCapture: onRichTextAssetError
4340
- }, [(T(!0), _(f, null, A(o.value, (t) => (T(), _(f, { key: t.key }, [t.kind === "markdown" ? (T(), _("div", {
4395
+ }, [(k(!0), h(u, null, j(o.value, (t) => (k(), h(u, { key: t.key }, [t.kind === "markdown" ? (k(), h("div", {
4341
4396
  key: 0,
4342
- class: S(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4397
+ class: C(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4343
4398
  innerHTML: t.html
4344
- }, null, 10, Jr)) : t.kind === "visual" ? (T(), m(qr, {
4399
+ }, null, 10, Qr)) : t.kind === "visual" ? (k(), p(Zr, {
4345
4400
  key: 1,
4346
4401
  result: t.result,
4347
4402
  inverted: e.inverted
4348
- }, null, 8, ["result", "inverted"])) : (T(), _("div", {
4403
+ }, null, 8, ["result", "inverted"])) : (k(), h("div", {
4349
4404
  key: 2,
4350
4405
  "data-test": "chat-visual-pending",
4351
4406
  role: "status",
4352
4407
  class: "my-6 flex items-center gap-2.5 rounded-[20px] px-4 py-5 text-[12px] font-medium",
4353
- style: C({
4408
+ style: T({
4354
4409
  boxShadow: `inset 0 0 0 1px ${e.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"}`,
4355
4410
  color: e.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"
4356
4411
  })
4357
- }, [...n[0] || (n[0] = [v("span", {
4412
+ }, [...n[0] || (n[0] = [_("span", {
4358
4413
  class: "size-2 shrink-0 animate-pulse rounded-full",
4359
4414
  style: { background: "currentcolor" }
4360
- }, null, -1), te(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4415
+ }, null, -1), v(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
4361
4416
  }
4362
- }), Xr = 80, Zr = /* @__PURE__ */ x({
4417
+ }), ei = 80, ti = /* @__PURE__ */ x({
4363
4418
  __name: "ChatScroller",
4364
4419
  setup(e, { expose: t }) {
4365
- let n = k(), r = k(), i = k(!0), a;
4420
+ let n = A(), r = A(), i = A(!0), a;
4366
4421
  function scrollToBottom() {
4367
4422
  let e = n.value;
4368
4423
  e && (e.scrollTop = e.scrollHeight);
4369
4424
  }
4370
4425
  function onScroll() {
4371
4426
  let e = n.value;
4372
- e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= Xr);
4427
+ e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= ei);
4373
4428
  }
4374
4429
  function pin() {
4375
4430
  i.value = !0, scrollToBottom();
4376
4431
  }
4377
- return t({ pin }), ie(() => {
4432
+ return t({ pin }), ne(() => {
4378
4433
  requestAnimationFrame(() => {
4379
4434
  scrollToBottom(), requestAnimationFrame(scrollToBottom);
4380
4435
  }), r.value && (a = new ResizeObserver(() => {
4381
4436
  i.value && scrollToBottom();
4382
4437
  }), a.observe(r.value));
4383
- }), re(() => {
4438
+ }), te(() => {
4384
4439
  a?.disconnect();
4385
- }), (e, t) => (T(), _("div", {
4440
+ }), (e, t) => (k(), h("div", {
4386
4441
  ref_key: "viewport",
4387
4442
  ref: n,
4388
- class: S(["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]" : ""]),
4443
+ 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]" : ""]),
4389
4444
  onScrollPassive: onScroll
4390
- }, [v("div", {
4445
+ }, [_("div", {
4391
4446
  ref_key: "content",
4392
4447
  ref: r,
4393
4448
  class: "flex-1 flex flex-col"
4394
- }, [oe(e.$slots, "default")], 512)], 34));
4449
+ }, [ie(e.$slots, "default")], 512)], 34));
4395
4450
  }
4396
- }), Qr = { class: "@container/chat flex flex-col h-full relative" }, $r = {
4451
+ }), ni = {
4397
4452
  key: 0,
4398
4453
  class: "pb-4"
4399
- }, ei = {
4454
+ }, ri = {
4400
4455
  key: 1,
4401
4456
  "data-test": "messaging-sdk-header",
4402
4457
  class: "shrink-0 border-b border-theme-100 px-4 py-3"
4403
- }, ti = { class: "relative size-10 shrink-0" }, ni = ["src", "alt"], ri = ["aria-label"], ii = { class: "min-w-0 flex-1" }, ai = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, oi = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, si = {
4458
+ }, ii = { class: "min-w-0 flex-1" }, ai = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, oi = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, si = {
4404
4459
  key: 0,
4405
4460
  class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
4406
4461
  }, ci = {
4462
+ key: 2,
4463
+ class: "flex flex-col items-center justify-center px-6 py-16 text-center",
4464
+ "data-test": "chat-offline"
4465
+ }, li = {
4407
4466
  key: 0,
4408
4467
  "data-test": "messaging-empty-state",
4409
4468
  class: "flex flex-col items-center justify-center px-4"
4410
- }, li = { class: "relative mb-4 size-20 @sm/chat:size-24" }, ui = ["src", "alt"], di = ["title"], fi = {
4469
+ }, ui = ["title"], di = {
4411
4470
  key: 0,
4412
4471
  class: "flex items-center gap-3 py-3 px-2"
4413
- }, pi = ["data-journal-outcome"], mi = [
4472
+ }, fi = ["data-journal-outcome"], pi = [
4414
4473
  "data-message-id",
4415
4474
  "data-message-sender",
4416
4475
  "data-conversation-id",
@@ -4421,7 +4480,7 @@ var yr = [
4421
4480
  "data-issue-action-label",
4422
4481
  "data-issue-action-url",
4423
4482
  "data-streaming"
4424
- ], hi = { class: "max-w-[85%] min-w-0" }, gi = ["href"], _i = [
4483
+ ], mi = { class: "max-w-[85%] min-w-0" }, hi = ["href"], gi = [
4425
4484
  "data-message-id",
4426
4485
  "data-message-sender",
4427
4486
  "data-conversation-id",
@@ -4430,7 +4489,7 @@ var yr = [
4430
4489
  "data-issue-code",
4431
4490
  "data-issue-bucket",
4432
4491
  "data-streaming"
4433
- ], vi = [
4492
+ ], _i = [
4434
4493
  "data-test",
4435
4494
  "data-message-id",
4436
4495
  "data-message-sender",
@@ -4438,47 +4497,51 @@ var yr = [
4438
4497
  "data-message-sequence",
4439
4498
  "data-system-kind",
4440
4499
  "data-streaming"
4441
- ], yi = ["src", "alt"], bi = ["src"], xi = ["href"], Si = {
4500
+ ], vi = ["src", "alt"], yi = ["src"], bi = ["href"], xi = {
4442
4501
  key: 0,
4443
4502
  "data-test": "messaging-message-text-part"
4444
- }, Ci = [
4503
+ }, Si = [
4445
4504
  "src",
4446
4505
  "alt",
4447
4506
  "data-attachment-placement"
4448
- ], wi = ["src", "data-attachment-placement"], Ti = ["href", "data-attachment-placement"], Ei = ["data-journal-outcome"], Di = {
4507
+ ], Ci = ["src", "data-attachment-placement"], wi = ["href", "data-attachment-placement"], Ti = ["data-journal-outcome"], Ei = {
4449
4508
  key: 2,
4450
4509
  "data-test": "messaging-tool-activity-tail",
4451
4510
  "aria-label": "Assistant is still working",
4452
4511
  class: "mb-4 grid h-[17px] w-5 place-items-center"
4453
- }, Oi = ["data-journal-outcome"], ki = ["data-working-description"], Ai = { class: "truncate" }, ji = ["data-issue-code"], Mi = ["href"], Ni = {
4512
+ }, Di = ["data-journal-outcome"], Oi = ["data-working-description"], ki = { class: "truncate" }, Ai = ["data-issue-code"], ji = ["href"], Mi = {
4454
4513
  key: 3,
4455
4514
  "data-test": "messaging-thinking-indicator",
4456
4515
  class: "flex gap-2 justify-start items-center mb-4"
4457
- }, Pi = ["src", "alt"], Fi = { class: "max-w-20 truncate" }, Ii = ["onClick"], Li = {
4516
+ }, Ni = ["src", "alt"], Pi = { class: "max-w-20 truncate" }, Fi = ["onClick"], Ii = {
4458
4517
  key: 0,
4459
4518
  class: "shrink-0 flex items-center justify-center size-14"
4460
- }, Ri = ["data-composer-action"], zi = ["placeholder", "disabled"], Bi = { class: "font-mono text-sm tabular-nums" }, Vi = { class: "mt-2.5 flex items-center" }, Hi = [
4519
+ }, Li = ["data-composer-action"], Ri = ["placeholder", "disabled"], zi = { class: "font-mono text-sm tabular-nums" }, Bi = { class: "mt-2.5 flex items-center" }, Vi = [
4461
4520
  "disabled",
4462
4521
  "aria-label",
4463
4522
  "title"
4464
- ], Ui = {
4523
+ ], Hi = {
4465
4524
  key: 0,
4466
4525
  class: "i-svg-spinners-ring-resize size-5"
4467
- }, Wi = {
4526
+ }, Ui = {
4468
4527
  key: 1,
4469
4528
  class: "i-tabler-plus size-5"
4470
- }, Gi = { class: "sr-only" }, Ki = { class: "flex items-center gap-2" }, qi = ["aria-label", "title"], Ji = { class: "sr-only" }, Yi = [
4529
+ }, Wi = { class: "sr-only" }, Gi = { class: "flex items-center gap-2" }, Ki = ["aria-label", "title"], qi = { class: "sr-only" }, Ji = [
4471
4530
  "data-composer-action",
4472
4531
  "disabled",
4473
4532
  "aria-label",
4474
4533
  "title"
4475
- ], Xi = {
4534
+ ], Yi = {
4476
4535
  key: 0,
4477
4536
  class: "i-tabler-player-stop-filled size-3.5"
4478
- }, Zi = {
4537
+ }, Xi = {
4479
4538
  key: 1,
4480
4539
  class: "i-tabler-arrow-up size-[17px]"
4481
- }, Qi = { class: "sr-only" }, $i = /* @__PURE__ */ x({
4540
+ }, Zi = { class: "sr-only" }, Qi = {
4541
+ key: 2,
4542
+ "data-test": "messaging-suggested-prompts",
4543
+ class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
4544
+ }, $i = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, ea = ["disabled", "onClick"], ta = 2500, na = /* @__PURE__ */ x({
4482
4545
  __name: "ElAgentChat",
4483
4546
  props: {
4484
4547
  chatController: {},
@@ -4496,7 +4559,8 @@ var yr = [
4496
4559
  centered: {
4497
4560
  type: Boolean,
4498
4561
  default: !1
4499
- }
4562
+ },
4563
+ suggestedPrompts: { default: () => [] }
4500
4564
  },
4501
4565
  setup(e) {
4502
4566
  let t = {
@@ -4515,37 +4579,51 @@ var yr = [
4515
4579
  label: "Public",
4516
4580
  tooltip: "Anyone with the link can see this"
4517
4581
  }
4518
- }, n = p(() => {
4582
+ }, n = f(() => {
4519
4583
  let n = { ...t[e.scope] };
4520
4584
  return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
4521
- }), r = k(!1), i = k(), a = k(), s = k();
4585
+ }), r = A(!1), i = A(), a = A(), o = A();
4522
4586
  function containsMarkdownLink(e) {
4523
4587
  return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
4524
4588
  }
4525
4589
  function isSystemExplainerMessage(e) {
4526
- return e.sender === "system" && (!!e.issue || e.id === Se.value);
4590
+ return e.sender === "system" && (!!e.issue || e.id === U.value);
4527
4591
  }
4528
4592
  function isGroupEnd(e, t) {
4529
4593
  let n = e[t], r = e[t + 1];
4530
4594
  return !r || r.sender !== n.sender;
4531
4595
  }
4532
- let c = p(() => e.chatController?.textState.value), u = p(() => c.value?.isConnected ?? !1), x = p(() => c.value?.isThinking ?? !1), C = p(() => c.value?.connectionStatus === "disconnected" && !!c.value?.error), re = p(() => c.value?.connectionStatus !== "connected" && !c.value?.error), oe = p(() => c.value?.error), j = p(() => e.chatController?.liveTurnBlocks?.value ?? []), se = p(() => {
4533
- for (let e = j.value.length - 1; e >= 0; e--) {
4534
- let t = j.value[e];
4596
+ let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), ae = A(!1), oe;
4597
+ ce(T, (e) => {
4598
+ if (clearTimeout(oe), !e) {
4599
+ ae.value = !1;
4600
+ return;
4601
+ }
4602
+ oe = setTimeout(() => {
4603
+ ae.value = !0;
4604
+ }, ta);
4605
+ }, { immediate: !0 }), re(() => clearTimeout(oe));
4606
+ let se = f(() => T.value && ae.value), pe = f(() => te.value || T.value && !ae.value);
4607
+ async function retryConnection() {
4608
+ await e.chatController?.startTextConversation();
4609
+ }
4610
+ let he = f(() => e.chatController?.liveTurnBlocks?.value ?? []), ve = f(() => {
4611
+ for (let e = he.value.length - 1; e >= 0; e--) {
4612
+ let t = he.value[e];
4535
4613
  if (t?.kind === "text") return t.id;
4536
4614
  }
4537
- }), ce = p(() => e.chatController?.liveStreamMessageId?.value), _e = p(() => {
4615
+ }), ye = f(() => e.chatController?.liveStreamMessageId?.value), z = f(() => {
4538
4616
  let t = e.chatController?.sharedMessages.value ?? [];
4539
- return j.value.length && ce.value ? t.filter((e) => e.id !== ce.value) : t;
4540
- }), R = p(() => {
4541
- if (!e.chatController?.workJournal?.value) return c.value?.workingDescription?.trim() || void 0;
4542
- }), ye = p(() => e.chatController?.workJournal?.value), z = p(() => {
4543
- if (!ye.value && !j.value.length) return;
4544
- let e = _e.value, t = e[e.length - 1];
4617
+ return he.value.length && ye.value ? t.filter((e) => e.id !== ye.value) : t;
4618
+ }), be = f(() => {
4619
+ if (!e.chatController?.workJournal?.value) return s.value?.workingDescription?.trim() || void 0;
4620
+ }), B = f(() => e.chatController?.workJournal?.value), Se = f(() => {
4621
+ if (!B.value && !he.value.length) return;
4622
+ let e = z.value, t = e[e.length - 1];
4545
4623
  if (t) return t.sender === "agent" || t.sender === "system" ? e.length >= 2 ? e[e.length - 2].id : void 0 : t.id;
4546
- }), be = p(() => {
4624
+ }), H = f(() => {
4547
4625
  let t = {};
4548
- for (let n of _e.value) {
4626
+ for (let n of z.value) {
4549
4627
  if (n.sender === "user" || !n.toolActivities?.length) continue;
4550
4628
  let r = e.chatController?.workJournalFor?.({
4551
4629
  activities: n.toolActivities,
@@ -4557,7 +4635,7 @@ var yr = [
4557
4635
  return t;
4558
4636
  });
4559
4637
  function messageWorkJournal(e) {
4560
- return be.value[e.id];
4638
+ return H.value[e.id];
4561
4639
  }
4562
4640
  function inlineOffset(e, t) {
4563
4641
  return e.placement?.kind !== "inline" || !Number.isFinite(e.placement.offset) ? null : Math.max(0, Math.min(t.length, Math.trunc(e.placement.offset)));
@@ -4605,62 +4683,57 @@ var yr = [
4605
4683
  text: t.slice(i)
4606
4684
  }), r;
4607
4685
  }
4608
- let B = p(() => c.value?.transientIssue), Se = p(() => {
4686
+ let Ce = f(() => s.value?.transientIssue), U = f(() => {
4609
4687
  if (!x.value) return;
4610
- let e = _e.value, t = e[e.length - 1];
4688
+ let e = z.value, t = e[e.length - 1];
4611
4689
  return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
4612
- }), H = p(() => !x.value || R.value || ye.value || j.value.length ? !1 : Se.value === void 0), Ce = p(() => c.value?.sendBlockedReason), U = p(() => !u.value || Ce.value !== void 0), we = p(() => C.value ? "Agent is offline" : re.value ? "Connecting..." : Ce.value === "agent_deleted" ? "This assistant was deleted" : Ce.value === "account" ? "Open billing to keep chatting" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), Te = p(() => e.chatController?.composerState?.value ?? {
4690
+ }), we = f(() => !x.value || be.value || B.value || he.value.length ? !1 : U.value === void 0), Te = f(() => s.value?.sendBlockedReason), Ee = f(() => !c.value || Te.value !== void 0), De = f(() => T.value ? "Agent is offline" : te.value ? "Connecting..." : Te.value === "agent_deleted" ? "This assistant was deleted" : Te.value === "account" ? "Open billing to keep chatting" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), Oe = f(() => e.chatController?.composerState?.value ?? {
4613
4691
  text: "",
4614
4692
  pendingAttachments: [],
4615
4693
  isUploading: !1
4616
- }), Ee = p({
4617
- get: () => Te.value.text,
4694
+ }), ke = f({
4695
+ get: () => Oe.value.text,
4618
4696
  set: (t) => e.chatController?.setComposerText?.({ text: t })
4619
- }), De = p(() => Te.value.pendingAttachments), Oe = p(() => Te.value.isUploading), ke = p(() => e.chatController?.voiceRecorder), Ae = p(() => ke.value?.isBusy.value ?? !1), W = p(() => e.chatController?.canAttachFile?.value ?? !1), je = p(() => e.chatController?.canRecordAudio?.value ?? !1), Me = p(() => e.chatController?.composerAction?.value ?? "idle"), Ne = p(() => Me.value !== "idle"), Pe = p(() => Me.value === "stop" ? "Stop reply" : "Send message"), Ie = p(() => je.value && !Ae.value && !!ke.value?.canUseBrowserRecording), Le = p(() => ke.value?.isActive.value ?? !1), Re = p(() => ke.value?.elapsedLabel.value ?? "0:00"), ze = p(() => ke.value?.statusText.value ?? "Release to send"), Be = p(() => ke.value?.state.value.phase === "sending" ? "Sending voice message" : Le.value ? "Release to send voice message" : "Hold to record voice message"), G = p(() => e.variant === "light"), Ve = p(() => G.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), He = p(() => G.value ? "text-theme-300" : "text-white/30"), We = p(() => e.agent.avatarUrl.value || o(e.agent.name.value)), Ge = {
4620
- green: "bg-green-500",
4621
- amber: "bg-amber-500",
4622
- red: "bg-red-500",
4623
- grey: "bg-theme-300"
4624
- }, Ke = p(() => {
4625
- let t = e.agent.state.value;
4626
- return t.lifecycle === "unknown" ? null : Ge[t.color];
4627
- });
4628
- ie(async () => {
4629
- e.chatController && !u.value && await e.chatController.startTextConversation();
4630
- }), ae(() => {
4697
+ }), Ae = f(() => Oe.value.pendingAttachments), je = f(() => Oe.value.isUploading), W = f(() => e.chatController?.voiceRecorder), Me = f(() => W.value?.isBusy.value ?? !1), Ne = f(() => e.chatController?.canAttachFile?.value ?? !1), Fe = f(() => e.chatController?.canRecordAudio?.value ?? !1), Ie = f(() => e.chatController?.composerAction?.value ?? "idle"), Le = f(() => Ie.value !== "idle"), Re = f(() => Ie.value === "stop" ? "Stop reply" : "Send message"), Be = f(() => Fe.value && !Me.value && !!W.value?.canUseBrowserRecording), Ve = f(() => W.value?.isActive.value ?? !1), He = f(() => W.value?.elapsedLabel.value ?? "0:00"), Ue = f(() => W.value?.statusText.value ?? "Release to send"), We = f(() => W.value?.state.value.phase === "sending" ? "Sending voice message" : Ve.value ? "Release to send voice message" : "Hold to record voice message"), G = f(() => e.variant === "light"), Ge = f(() => G.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"), Ke = f(() => G.value ? "text-theme-300" : "text-white/30");
4698
+ ne(async () => {
4699
+ e.chatController && !c.value && await e.chatController.startTextConversation();
4700
+ }), re(() => {
4631
4701
  e.chatController?.voiceRecorder?.teardown();
4632
4702
  });
4633
4703
  async function sendMessage() {
4634
- !e.chatController || Me.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
4704
+ !e.chatController || Ie.value !== "send" || (a.value && (a.value.style.height = "auto", a.value.focus()), i.value?.pin(), await e.chatController.sendComposerMessage());
4705
+ }
4706
+ async function sendSuggestedPrompt(t) {
4707
+ !e.chatController || Ee.value || (i.value?.pin(), await e.chatController.sendChatMessage(t.prompt));
4635
4708
  }
4636
4709
  async function handleComposerAction() {
4637
- e.chatController && (Me.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
4710
+ e.chatController && (Ie.value === "send" && i.value?.pin(), await e.chatController.handleComposerAction());
4638
4711
  }
4639
4712
  async function handleKeydown(e) {
4640
4713
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), await sendMessage());
4641
4714
  }
4642
4715
  function focusComposer(e) {
4643
- Le.value || U.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
4716
+ Ve.value || Ee.value || e.target instanceof Element && e.target.closest("button, a, textarea") || a.value?.focus();
4644
4717
  }
4645
4718
  function adjustTextareaHeight() {
4646
4719
  a.value && (a.value.style.height = "auto", a.value.style.height = `${Math.min(a.value.scrollHeight, 150)}px`);
4647
4720
  }
4648
- de(Ee, () => ne(() => adjustTextareaHeight()));
4721
+ ce(ke, () => S(() => adjustTextareaHeight()));
4649
4722
  function triggerFileInput() {
4650
- s.value?.click();
4723
+ o.value?.click();
4651
4724
  }
4652
4725
  async function handleFileSelect(t) {
4653
4726
  let n = t.target, r = n.files?.[0];
4654
- !r || !e.chatController || Ae.value || (await e.chatController.attachFile({ file: r }), n.value = "");
4727
+ !r || !e.chatController || Me.value || (await e.chatController.attachFile({ file: r }), n.value = "");
4655
4728
  }
4656
4729
  function removeAttachment(t) {
4657
4730
  e.chatController?.removeAttachment({ index: t });
4658
4731
  }
4659
4732
  function startRecording() {
4660
- ke.value?.start();
4733
+ W.value?.start();
4661
4734
  }
4662
4735
  function finishRecording(e) {
4663
- ke.value?.finish(e);
4736
+ W.value?.finish(e);
4664
4737
  }
4665
4738
  function shouldShowTimeDivider(e, t) {
4666
4739
  if (t === 0) {
@@ -4689,92 +4762,68 @@ var yr = [
4689
4762
  ...o ? {} : { year: "numeric" }
4690
4763
  })}, ${a}`;
4691
4764
  }
4692
- return (t, o) => (T(), _("div", Qr, [
4693
- e.showHeader && !G.value ? (T(), _("div", $r, [b(Fe, {
4765
+ return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col", z.value.length === 0 ? "justify-center" : ""]) }, [
4766
+ e.showHeader && !G.value ? (k(), h("div", ni, [b(Pe, {
4694
4767
  agent: e.agent,
4695
- "is-online": u.value
4696
- }, null, 8, ["agent", "is-online"])])) : e.showHeader ? (T(), _("div", ei, [v("div", { class: S(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
4697
- v("div", ti, [
4698
- v("img", {
4699
- src: We.value,
4700
- alt: e.agent.displayName.value || "Agent",
4701
- class: "size-10 rounded-full object-cover"
4702
- }, null, 8, ni),
4703
- Ke.value ? (T(), _("span", {
4704
- key: 0,
4705
- role: "status",
4706
- "aria-label": e.agent.state.value.tooltip,
4707
- class: S(["absolute rounded-full ring-2 ring-white z-10", Ke.value]),
4708
- style: {
4709
- width: "clamp(7px, 14%, 14px)",
4710
- height: "clamp(7px, 14%, 14px)",
4711
- top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
4712
- right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
4713
- }
4714
- }, null, 10, ri)) : h("", !0),
4715
- Ke.value && e.agent.state.value.lifecycle === "running" ? (T(), _("span", {
4716
- key: 1,
4717
- "aria-hidden": "true",
4718
- class: S(["absolute rounded-full animate-ping [animation-duration:3s] opacity-50 pointer-events-none", Ke.value]),
4719
- style: {
4720
- width: "clamp(7px, 14%, 14px)",
4721
- height: "clamp(7px, 14%, 14px)",
4722
- top: "calc(14.6% - clamp(3.5px, 7%, 7px))",
4723
- right: "calc(14.6% - clamp(3.5px, 7%, 7px))"
4724
- }
4725
- }, null, 2)) : h("", !0)
4726
- ]),
4727
- v("div", ii, [v("div", ai, P(e.agent.displayName.value), 1), v("div", oi, P(e.agent.title.value || "Assistant"), 1)]),
4728
- e.headerMeta ? (T(), _("span", si, P(e.headerMeta), 1)) : h("", !0)
4729
- ], 2)])) : h("", !0),
4730
- C.value ? (T(), _("div", {
4731
- key: 2,
4732
- class: S(["py-16 flex flex-col items-center justify-center gap-3 text-sm", G.value ? "text-theme-400" : "text-white/60"])
4733
- }, [v("i", { class: S(["i-heroicons-cloud-arrow-down size-8", G.value ? "text-theme-300" : "text-white/40"]) }, null, 2), v("span", null, P(oe.value), 1)], 2)) : re.value ? (T(), _("div", {
4768
+ "is-online": c.value
4769
+ }, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div", ri, [_("div", { class: C(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
4770
+ b(ze, {
4771
+ agent: e.agent,
4772
+ "is-light": G.value,
4773
+ class: "size-10"
4774
+ }, null, 8, ["agent", "is-light"]),
4775
+ _("div", ii, [_("div", ai, P(e.agent.displayName.value), 1), _("div", oi, P(e.agent.title.value || "Assistant"), 1)]),
4776
+ e.headerMeta ? (k(), h("span", si, P(e.headerMeta), 1)) : m("", !0)
4777
+ ], 2)])) : m("", !0),
4778
+ se.value ? (k(), h("div", ci, [
4779
+ _("p", { class: C(["text-[15px] font-semibold", G.value ? "text-theme-900" : "text-white"]) }, " Can't reach " + P(e.agent?.displayName.value || "your assistant") + " right now ", 3),
4780
+ _("p", { class: C(["mt-1.5 max-w-[340px] text-pretty text-[13.5px] leading-relaxed", G.value ? "text-theme-500" : "text-white/60"]) }, " Your messages are safe. This usually clears on its own. ", 2),
4781
+ _("button", {
4782
+ type: "button",
4783
+ "data-test": "chat-offline-retry",
4784
+ class: C(["mt-5 cursor-pointer rounded-full px-4 py-2 text-[13.5px] font-semibold transition-colors", G.value ? "text-theme-900 ring-1 ring-theme-200 hover:bg-theme-50" : "text-white ring-1 ring-white/20 hover:bg-white/10"]),
4785
+ onClick: s[0] || (s[0] = (e) => retryConnection())
4786
+ }, " Try again ", 2)
4787
+ ])) : pe.value ? (k(), h("div", {
4734
4788
  key: 3,
4735
- class: S(["py-16 flex flex-col items-center justify-center gap-2 text-sm", G.value ? "text-theme-400" : "text-theme-600"])
4736
- }, [b(ve, { class: "size-4" })], 2)) : e.setupHint ? (T(), _("div", {
4789
+ class: C(["py-16 flex flex-col items-center justify-center gap-2 text-sm", G.value ? "text-theme-400" : "text-theme-600"])
4790
+ }, [b(_e, { class: "size-4" })], 2)) : e.setupHint ? (k(), h("div", {
4737
4791
  key: 4,
4738
- class: S(["flex items-center justify-center gap-1.5 py-2 text-[11px]", He.value])
4739
- }, [o[19] || (o[19] = v("i", { class: "i-tabler-tool size-3" }, null, -1)), v("span", null, P(e.setupHint), 1)], 2)) : h("", !0),
4740
- b(Zr, {
4792
+ class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Ke.value])
4793
+ }, [s[20] || (s[20] = _("i", { class: "i-tabler-tool size-3" }, null, -1)), _("span", null, P(e.setupHint), 1)], 2)) : m("", !0),
4794
+ b(ti, {
4741
4795
  ref_key: "chatScroller",
4742
4796
  ref: i,
4743
- class: "flex-1"
4797
+ class: C(z.value.length === 0 ? "flex-none" : "flex-1")
4744
4798
  }, {
4745
- default: F(() => [v("div", { class: S([_e.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", e.centered ? "max-w-[720px] mx-auto w-full" : ""]) }, [
4746
- _e.value.length === 0 && !re.value && !C.value ? (T(), _("div", ci, [
4747
- v("div", li, [v("img", {
4748
- src: e.agent.avatarUrl.value,
4749
- alt: e.agent.displayName.value,
4750
- class: S(["size-full rounded-full object-cover ring-1", G.value ? "ring-black/5" : "ring-white/10"])
4751
- }, null, 10, ui), u.value ? (T(), _("span", {
4752
- key: 0,
4753
- class: S(["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", G.value ? "bg-white" : "bg-theme-900"])
4754
- }, [...o[20] || (o[20] = [v("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)])], 2)) : h("", !0)]),
4755
- v("div", { class: S(["text-base @sm/chat:text-lg font-semibold", G.value ? "text-theme-900" : "text-white"]) }, P(e.agent.displayName.value), 3),
4756
- v("p", { class: S(["mt-1 text-center text-xs @sm/chat:text-sm", He.value]) }, P(e.emptyStateMessage || "Type your message to get started."), 3),
4757
- v("div", {
4758
- class: S(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", G.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4759
- title: n.value.tooltip
4760
- }, [v("i", { class: S([n.value.icon, "size-3"]) }, null, 2), v("span", null, P(n.value.label), 1)], 10, di)
4761
- ])) : h("", !0),
4762
- (T(!0), _(f, null, A(_e.value, (e, t) => (T(), _(f, { key: e.id }, [
4763
- shouldShowTimeDivider(_e.value, t) ? (T(), _("div", fi, [
4764
- v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2),
4765
- v("span", { class: S(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", He.value]) }, P(shouldShowTimeDivider(_e.value, t)), 3),
4766
- v("div", { class: S(["flex-1 h-px", Ve.value]) }, null, 2)
4767
- ])) : h("", !0),
4768
- messageWorkJournal(e) ? (T(), _("div", {
4799
+ default: ue(() => [_("div", { class: C([z.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? "max-w-[720px] mx-auto w-full" : ""]) }, [
4800
+ z.value.length === 0 && !pe.value && !se.value ? (k(), h("div", li, [ie(t.$slots, "empty-heading", {
4801
+ agent: e.agent,
4802
+ isLight: G.value
4803
+ }, () => [b(ze, {
4804
+ agent: e.agent,
4805
+ "is-light": G.value,
4806
+ class: "mb-4 size-20 @sm/chat:size-24"
4807
+ }, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold", G.value ? "text-theme-900" : "text-white"]) }, P(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? m("", !0) : (k(), h(u, { key: 0 }, [_("p", { class: C(["mt-1 text-center text-xs @sm/chat:text-sm", Ke.value]) }, P(e.emptyStateMessage || "Type your message to get started."), 3), _("div", {
4808
+ class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", G.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4809
+ title: n.value.tooltip
4810
+ }, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, P(n.value.label), 1)], 10, ui)], 64))])) : m("", !0),
4811
+ (k(!0), h(u, null, j(z.value, (e, t) => (k(), h(u, { key: e.id }, [
4812
+ shouldShowTimeDivider(z.value, t) ? (k(), h("div", di, [
4813
+ _("div", { class: C(["flex-1 h-px", Ge.value]) }, null, 2),
4814
+ _("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Ke.value]) }, P(shouldShowTimeDivider(z.value, t)), 3),
4815
+ _("div", { class: C(["flex-1 h-px", Ge.value]) }, null, 2)
4816
+ ])) : m("", !0),
4817
+ messageWorkJournal(e) ? (k(), h("div", {
4769
4818
  key: 1,
4770
4819
  "data-test": "messaging-message-tool-activity",
4771
4820
  "data-journal-outcome": messageWorkJournal(e)?.outcome,
4772
4821
  class: "mb-4 w-full"
4773
- }, [b(Ue, {
4822
+ }, [b(qe, {
4774
4823
  model: messageWorkJournal(e),
4775
4824
  "is-light": G.value
4776
- }, null, 8, ["model", "is-light"])], 8, pi)) : h("", !0),
4777
- isSystemExplainerMessage(e) ? (T(), _("div", {
4825
+ }, null, 8, ["model", "is-light"])], 8, fi)) : m("", !0),
4826
+ isSystemExplainerMessage(e) ? (k(), h("div", {
4778
4827
  key: 2,
4779
4828
  "data-test": "messaging-system-msg",
4780
4829
  "data-message-id": e.id,
@@ -4786,29 +4835,29 @@ var yr = [
4786
4835
  "data-issue-bucket": e.issue?.bucket,
4787
4836
  "data-issue-action-label": e.issue?.actionLabel,
4788
4837
  "data-issue-action-url": e.issue?.actionUrl,
4789
- "data-streaming": e.id === Se.value ? "true" : void 0,
4838
+ "data-streaming": e.id === U.value ? "true" : void 0,
4790
4839
  class: "flex gap-2 items-end justify-start mb-4"
4791
- }, [v("div", hi, [v("div", { class: S(["mb-1 pl-1 text-[11px] font-medium", G.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), v("div", { class: S(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", G.value ? "bg-theme-25 border-theme-100 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (T(), m(Yr, {
4840
+ }, [_("div", mi, [_("div", { class: C(["mb-1 pl-1 text-[11px] font-medium", G.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), _("div", { class: C(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", G.value ? "bg-theme-25 border-theme-100 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (k(), p($r, {
4792
4841
  key: 0,
4793
4842
  text: e.text,
4794
4843
  inverted: !G.value,
4795
- streaming: e.id === Se.value,
4796
- onClick: o[0] || (o[0] = I(() => {}, ["stop"]))
4844
+ streaming: e.id === U.value,
4845
+ onClick: s[1] || (s[1] = R(() => {}, ["stop"]))
4797
4846
  }, null, 8, [
4798
4847
  "text",
4799
4848
  "inverted",
4800
4849
  "streaming"
4801
- ])) : e.issue?.help ? (T(), m(Yr, {
4850
+ ])) : e.issue?.help ? (k(), p($r, {
4802
4851
  key: 1,
4803
4852
  text: e.issue.help,
4804
4853
  inverted: !G.value
4805
- }, null, 8, ["text", "inverted"])) : h("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (T(), _("a", {
4854
+ }, null, 8, ["text", "inverted"])) : m("", !0), e.issue?.actionUrl && !containsMarkdownLink(e.text) ? (k(), h("a", {
4806
4855
  key: 2,
4807
4856
  href: e.issue.actionUrl,
4808
4857
  "data-test": "messaging-system-msg-action",
4809
- class: S(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", G.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
4810
- onClick: o[1] || (o[1] = I(() => {}, ["stop"]))
4811
- }, [te(P(e.issue.actionLabel) + " ", 1), o[21] || (o[21] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, gi)) : h("", !0)], 2)])], 8, mi)) : e.sender === "system" ? (T(), _("div", {
4858
+ class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", G.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
4859
+ onClick: s[2] || (s[2] = R(() => {}, ["stop"]))
4860
+ }, [v(P(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, hi)) : m("", !0)], 2)])], 8, pi)) : e.sender === "system" ? (k(), h("div", {
4812
4861
  key: 3,
4813
4862
  "data-test": "messaging-system-status-msg",
4814
4863
  "data-message-id": e.id,
@@ -4818,13 +4867,13 @@ var yr = [
4818
4867
  "data-system-kind": e.systemKind,
4819
4868
  "data-issue-code": e.issue?.code,
4820
4869
  "data-issue-bucket": e.issue?.bucket,
4821
- "data-streaming": e.id === Se.value ? "true" : void 0,
4822
- class: S(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", G.value ? "text-theme-500" : "text-white/60"])
4823
- }, [o[22] || (o[22] = v("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b(Yr, {
4870
+ "data-streaming": e.id === U.value ? "true" : void 0,
4871
+ class: C(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", G.value ? "text-theme-500" : "text-white/60"])
4872
+ }, [s[22] || (s[22] = _("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)), b($r, {
4824
4873
  text: e.text,
4825
4874
  inverted: !G.value,
4826
- onClick: o[2] || (o[2] = I(() => {}, ["stop"]))
4827
- }, null, 8, ["text", "inverted"])], 10, _i)) : (T(), _("div", {
4875
+ onClick: s[3] || (s[3] = R(() => {}, ["stop"]))
4876
+ }, null, 8, ["text", "inverted"])], 10, gi)) : (k(), h("div", {
4828
4877
  key: 4,
4829
4878
  "data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
4830
4879
  "data-message-id": e.id,
@@ -4832,264 +4881,275 @@ var yr = [
4832
4881
  "data-conversation-id": e.conversationId,
4833
4882
  "data-message-sequence": e.sequence,
4834
4883
  "data-system-kind": e.systemKind,
4835
- "data-streaming": e.id === Se.value ? "true" : void 0,
4836
- class: S(["flex gap-2 items-end", {
4884
+ "data-streaming": e.id === U.value ? "true" : void 0,
4885
+ class: C(["flex gap-2 items-end", {
4837
4886
  "justify-end": e.sender === "user",
4838
4887
  "justify-start": e.sender === "agent",
4839
- "mb-6": isGroupEnd(_e.value, t)
4888
+ "mb-6": isGroupEnd(z.value, t)
4840
4889
  }])
4841
- }, [v("div", {
4890
+ }, [_("div", {
4842
4891
  "data-test": "messaging-message-body",
4843
- class: S(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0")
4844
- }, [blockAttachmentsForMessage(e).length ? (T(), _("div", {
4892
+ class: C(e.sender === "user" ? "max-w-[min(78%,30rem)]" : "w-full min-w-0 @sm/chat:pr-[1em]")
4893
+ }, [blockAttachmentsForMessage(e).length ? (k(), h("div", {
4845
4894
  key: 0,
4846
- class: S(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
4847
- }, [(T(!0), _(f, null, A(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (T(), _(f, { key: attachmentKey(e, t) }, [e.type === "image" ? (T(), _("img", {
4895
+ class: C(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
4896
+ }, [(k(!0), h(u, null, j(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (k(), h(u, { key: attachmentKey(e, t) }, [e.type === "image" ? (k(), h("img", {
4848
4897
  key: 0,
4849
4898
  src: e.src,
4850
4899
  alt: e.filename,
4851
4900
  "data-test": "messaging-attachment",
4852
4901
  "data-attachment-placement": "block",
4853
4902
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
4854
- }, null, 8, yi)) : e.type === "audio" ? (T(), _("audio", {
4903
+ }, null, 8, vi)) : e.type === "audio" ? (k(), h("audio", {
4855
4904
  key: 1,
4856
4905
  src: e.src,
4857
4906
  controls: "",
4858
4907
  "data-test": "messaging-attachment",
4859
4908
  "data-attachment-placement": "block",
4860
4909
  class: "max-w-full"
4861
- }, null, 8, bi)) : (T(), _("a", {
4910
+ }, null, 8, yi)) : (k(), h("a", {
4862
4911
  key: 2,
4863
4912
  href: e.src,
4864
4913
  target: "_blank",
4865
4914
  rel: "noopener",
4866
4915
  "data-test": "messaging-attachment",
4867
4916
  "data-attachment-placement": "block",
4868
- class: S(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4869
- }, [o[23] || (o[23] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(e.filename), 1)], 10, xi))], 64))), 128))], 2)) : h("", !0), messageRenderParts(e).length ? (T(), _("div", {
4917
+ class: C(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4918
+ }, [s[23] || (s[23] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + P(e.filename), 1)], 10, bi))], 64))), 128))], 2)) : m("", !0), messageRenderParts(e).length ? (k(), h("div", {
4870
4919
  key: 1,
4871
4920
  "data-test": "messaging-message-content",
4872
- class: S(e.sender === "user" ? G.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : G.value ? "text-theme-800" : "text-white/95")
4873
- }, [(T(!0), _(f, null, A(messageRenderParts(e), (t) => (T(), _(f, { key: t.key }, [t.kind === "text" && t.text ? (T(), _("div", Si, [b(Yr, {
4921
+ class: C(e.sender === "user" ? G.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : G.value ? "text-theme-800" : "text-white/95")
4922
+ }, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div", xi, [b($r, {
4874
4923
  text: t.text,
4875
4924
  inverted: e.sender === "user" || !G.value,
4876
- streaming: e.id === Se.value,
4877
- onClick: o[3] || (o[3] = I(() => {}, ["stop"]))
4925
+ streaming: e.id === U.value,
4926
+ onClick: s[4] || (s[4] = R(() => {}, ["stop"]))
4878
4927
  }, null, 8, [
4879
4928
  "text",
4880
4929
  "inverted",
4881
4930
  "streaming"
4882
- ])])) : t.kind === "attachment" && t.attachment.type === "image" ? (T(), _("img", {
4931
+ ])])) : t.kind === "attachment" && t.attachment.type === "image" ? (k(), h("img", {
4883
4932
  key: 1,
4884
4933
  src: t.attachment.src,
4885
4934
  alt: t.attachment.filename,
4886
4935
  "data-test": "messaging-attachment",
4887
4936
  "data-attachment-placement": t.placement,
4888
4937
  class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
4889
- }, null, 8, Ci)) : t.kind === "attachment" && t.attachment.type === "audio" ? (T(), _("audio", {
4938
+ }, null, 8, Si)) : t.kind === "attachment" && t.attachment.type === "audio" ? (k(), h("audio", {
4890
4939
  key: 2,
4891
4940
  src: t.attachment.src,
4892
4941
  controls: "",
4893
4942
  "data-test": "messaging-attachment",
4894
4943
  "data-attachment-placement": t.placement,
4895
4944
  class: "my-2 max-w-full"
4896
- }, null, 8, wi)) : t.kind === "attachment" ? (T(), _("a", {
4945
+ }, null, 8, Ci)) : t.kind === "attachment" ? (k(), h("a", {
4897
4946
  key: 3,
4898
4947
  href: t.attachment.src,
4899
4948
  target: "_blank",
4900
4949
  rel: "noopener",
4901
4950
  "data-test": "messaging-attachment",
4902
4951
  "data-attachment-placement": t.placement,
4903
- class: S(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4904
- }, [o[24] || (o[24] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)), te(" " + P(t.attachment.filename), 1)], 10, Ti)) : h("", !0)], 64))), 128))], 2)) : h("", !0)], 2)], 10, vi)),
4905
- e.id === z.value ? (T(), _(f, { key: 5 }, [j.value.length ? (T(!0), _(f, { key: 0 }, A(j.value, (e) => (T(), _(f, { key: e.id }, [e.kind === "work" ? (T(), _("div", {
4952
+ class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4953
+ }, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + P(t.attachment.filename), 1)], 10, wi)) : m("", !0)], 64))), 128))], 2)) : m("", !0)], 2)], 10, _i)),
4954
+ e.id === Se.value ? (k(), h(u, { key: 5 }, [he.value.length ? (k(!0), h(u, { key: 0 }, j(he.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
4906
4955
  key: 0,
4907
4956
  "data-test": "messaging-tool-activity",
4908
4957
  "data-journal-outcome": e.journal.outcome,
4909
4958
  class: "mb-4 w-full"
4910
- }, [b(Ue, {
4959
+ }, [b(qe, {
4911
4960
  model: e.journal,
4912
4961
  "is-light": G.value
4913
- }, null, 8, ["model", "is-light"])], 8, Ei)) : e.kind === "text" && e.content ? (T(), _("div", {
4962
+ }, null, 8, ["model", "is-light"])], 8, Ti)) : e.kind === "text" && e.content ? (k(), h("div", {
4914
4963
  key: 1,
4915
4964
  "data-test": "messaging-live-text-block",
4916
- class: S(["mb-4", G.value ? "text-theme-800" : "text-white/95"])
4917
- }, [b(Yr, {
4965
+ class: C(["mb-4 @sm/chat:pr-[1em]", G.value ? "text-theme-800" : "text-white/95"])
4966
+ }, [b($r, {
4918
4967
  text: e.content,
4919
4968
  inverted: !G.value,
4920
- streaming: e.id === se.value,
4921
- onClick: o[4] || (o[4] = I(() => {}, ["stop"]))
4969
+ streaming: e.id === ve.value,
4970
+ onClick: s[5] || (s[5] = R(() => {}, ["stop"]))
4922
4971
  }, null, 8, [
4923
4972
  "text",
4924
4973
  "inverted",
4925
4974
  "streaming"
4926
- ])], 2)) : (T(), _("div", Di, [b(ve, { class: S(["size-3.5", G.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : ye.value ? (T(), _("div", {
4975
+ ])], 2)) : (k(), h("div", Ei, [b(_e, { class: C(["size-3.5", G.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : B.value ? (k(), h("div", {
4927
4976
  key: 1,
4928
4977
  "data-test": "messaging-tool-activity",
4929
- "data-journal-outcome": ye.value.outcome,
4978
+ "data-journal-outcome": B.value.outcome,
4930
4979
  class: "mb-4 w-full"
4931
- }, [b(Ue, {
4932
- model: ye.value,
4980
+ }, [b(qe, {
4981
+ model: B.value,
4933
4982
  "is-light": G.value
4934
- }, null, 8, ["model", "is-light"])], 8, Oi)) : h("", !0)], 64)) : h("", !0)
4983
+ }, null, 8, ["model", "is-light"])], 8, Di)) : m("", !0)], 64)) : m("", !0)
4935
4984
  ], 64))), 128)),
4936
- R.value ? (T(), _("div", {
4985
+ be.value ? (k(), h("div", {
4937
4986
  key: 1,
4938
4987
  "data-test": "messaging-working-state",
4939
- "data-working-description": R.value,
4940
- class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", G.value ? "text-theme-500" : "text-white/45"])
4941
- }, [o[25] || (o[25] = v("i", {
4988
+ "data-working-description": be.value,
4989
+ class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-none", G.value ? "text-theme-500" : "text-white/45"])
4990
+ }, [s[25] || (s[25] = _("i", {
4942
4991
  class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
4943
4992
  "aria-hidden": "true"
4944
- }, null, -1)), v("span", Ai, P(R.value), 1)], 10, ki)) : h("", !0),
4945
- B.value ? (T(), _("div", {
4993
+ }, null, -1)), _("span", ki, P(be.value), 1)], 10, Oi)) : m("", !0),
4994
+ Ce.value ? (k(), h("div", {
4946
4995
  key: 2,
4947
4996
  "data-test": "messaging-transient-issue",
4948
- "data-issue-code": B.value.code,
4949
- class: S(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", G.value ? "text-theme-600" : "text-white/60"])
4997
+ "data-issue-code": Ce.value.code,
4998
+ class: C(["flex items-center gap-1.5 pl-2 pr-3 pb-1 mb-3 text-[12px] leading-snug", G.value ? "text-theme-600" : "text-white/60"])
4950
4999
  }, [
4951
- o[26] || (o[26] = v("i", {
5000
+ s[26] || (s[26] = _("i", {
4952
5001
  class: "i-tabler-alert-circle size-3.5 shrink-0 text-red-500",
4953
5002
  "aria-hidden": "true"
4954
5003
  }, null, -1)),
4955
- v("span", null, [te(P(B.value.message), 1), B.value.help ? (T(), _(f, { key: 0 }, [te(P(B.value.help), 1)], 64)) : h("", !0)]),
4956
- B.value.actionUrl && B.value.actionLabel ? (T(), _("a", {
5004
+ _("span", null, [v(P(Ce.value.message), 1), Ce.value.help ? (k(), h(u, { key: 0 }, [v(P(Ce.value.help), 1)], 64)) : m("", !0)]),
5005
+ Ce.value.actionUrl && Ce.value.actionLabel ? (k(), h("a", {
4957
5006
  key: 0,
4958
- href: B.value.actionUrl,
5007
+ href: Ce.value.actionUrl,
4959
5008
  class: "shrink-0 underline underline-offset-2",
4960
- onClick: o[5] || (o[5] = I(() => {}, ["stop"]))
4961
- }, P(B.value.actionLabel), 9, Mi)) : h("", !0)
4962
- ], 10, ji)) : h("", !0),
4963
- H.value ? (T(), _("div", Ni, [v("i", {
4964
- class: S(["i-svg-spinners-3-dots-bounce size-7", G.value ? "text-theme-400" : "text-white/50"]),
5009
+ onClick: s[6] || (s[6] = R(() => {}, ["stop"]))
5010
+ }, P(Ce.value.actionLabel), 9, ji)) : m("", !0)
5011
+ ], 10, Ai)) : m("", !0),
5012
+ we.value ? (k(), h("div", Mi, [_("i", {
5013
+ class: C(["i-svg-spinners-3-dots-bounce size-7", G.value ? "text-theme-400" : "text-white/50"]),
4965
5014
  "aria-hidden": "true"
4966
- }, null, 2)])) : h("", !0)
5015
+ }, null, 2)])) : m("", !0)
4967
5016
  ], 2)]),
4968
- _: 1
4969
- }, 512),
4970
- v("div", { class: S(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", G.value ? "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"]) }, [
4971
- De.value.length > 0 ? (T(), _("div", {
5017
+ _: 3
5018
+ }, 8, ["class"]),
5019
+ _("div", { class: C(["left-0 right-0 z-30 px-5 pb-4 pt-3", [z.value.length === 0 ? "relative shrink-0" : "absolute bottom-0", G.value ? "bg-gradient-to-t from-theme-0/90 via-theme-0/55 to-transparent" : "bg-gradient-to-t from-black/90 via-black/60 to-transparent"]]) }, [
5020
+ Ae.value.length > 0 ? (k(), h("div", {
4972
5021
  key: 0,
4973
- class: S(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
4974
- }, [(T(!0), _(f, null, A(De.value, (e, t) => (T(), _("div", {
5022
+ class: C(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
5023
+ }, [(k(!0), h(u, null, j(Ae.value, (e, t) => (k(), h("div", {
4975
5024
  key: t,
4976
5025
  class: "relative shrink-0 group"
4977
- }, [e.type === "image" ? (T(), _("img", {
5026
+ }, [e.type === "image" ? (k(), h("img", {
4978
5027
  key: 0,
4979
5028
  src: e.src,
4980
5029
  alt: e.filename,
4981
- class: S(["size-14 rounded-xl object-cover border", G.value ? "border-black/10" : "border-white/20"])
4982
- }, null, 10, Pi)) : (T(), _("div", {
5030
+ class: C(["size-14 rounded-xl object-cover border", G.value ? "border-black/10" : "border-white/20"])
5031
+ }, null, 10, Ni)) : (k(), h("div", {
4983
5032
  key: 1,
4984
- class: S(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", G.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
4985
- }, [o[27] || (o[27] = v("i", { class: "i-tabler-file size-4" }, null, -1)), v("span", Fi, P(e.filename), 1)], 2)), v("button", {
5033
+ class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", G.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
5034
+ }, [s[27] || (s[27] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span", Pi, P(e.filename), 1)], 2)), _("button", {
4986
5035
  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",
4987
5036
  onClick: (e) => removeAttachment(t)
4988
- }, [...o[28] || (o[28] = [v("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Ii)]))), 128)), Oe.value ? (T(), _("div", Li, [b(ve, { class: "size-5" })])) : h("", !0)], 2)) : h("", !0),
4989
- W.value ? (T(), _("input", {
5037
+ }, [...s[28] || (s[28] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Fi)]))), 128)), je.value ? (k(), h("div", Ii, [b(_e, { class: "size-5" })])) : m("", !0)], 2)) : m("", !0),
5038
+ Ne.value ? (k(), h("input", {
4990
5039
  key: 1,
4991
5040
  ref_key: "fileInput",
4992
- ref: s,
5041
+ ref: o,
4993
5042
  type: "file",
4994
5043
  accept: "image/*,audio/*,video/*",
4995
5044
  class: "hidden",
4996
5045
  onChange: handleFileSelect
4997
- }, null, 544)) : h("", !0),
4998
- v("div", {
5046
+ }, null, 544)) : m("", !0),
5047
+ _("div", {
4999
5048
  "data-test": "messaging-composer",
5000
- "data-composer-action": Me.value,
5001
- class: S(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", G.value ? r.value ? "bg-white shadow-[0_2px_16px_rgba(15,23,42,0.10)] ring-1 ring-theme-300" : "bg-white shadow-[0_2px_16px_rgba(15,23,42,0.10)] ring-1 ring-black/[0.06] hover:ring-theme-300" : r.value ? "bg-white/15 backdrop-blur-xl ring-1 ring-white/25" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25"]]),
5049
+ "data-composer-action": Ie.value,
5050
+ class: C(["w-full cursor-text rounded-2xl px-4 pb-2.5 pt-3 transition-colors duration-200", [e.centered ? "max-w-[720px] mx-auto" : "", G.value ? r.value ? "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-300" : "bg-white shadow-[0_1px_2px_rgba(15,23,42,0.05),0_8px_24px_rgba(15,23,42,0.05)] ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 backdrop-blur-xl ring-1 ring-white/25" : "bg-white/10 backdrop-blur-xl ring-1 ring-white/15 hover:ring-white/25"]]),
5002
5051
  onClick: focusComposer
5003
- }, [Le.value ? (T(), _("div", {
5052
+ }, [Ve.value ? (k(), h("div", {
5004
5053
  key: 1,
5005
5054
  "data-test": "messaging-recording-state",
5006
- class: S(["flex min-w-0 items-center gap-2 py-1", G.value ? "text-theme-700" : "text-white/80"])
5055
+ class: C(["flex min-w-0 items-center gap-2 py-1", G.value ? "text-theme-700" : "text-white/80"])
5007
5056
  }, [
5008
- o[29] || (o[29] = v("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5009
- v("span", Bi, P(Re.value), 1),
5010
- v("span", { class: S(["min-w-0 truncate text-sm", G.value ? "text-theme-400" : "text-white/45"]) }, P(ze.value), 3)
5011
- ], 2)) : pe((T(), _("textarea", {
5057
+ s[29] || (s[29] = _("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
5058
+ _("span", zi, P(He.value), 1),
5059
+ _("span", { class: C(["min-w-0 truncate text-sm", G.value ? "text-theme-400" : "text-white/45"]) }, P(Ue.value), 3)
5060
+ ], 2)) : I((k(), h("textarea", {
5012
5061
  key: 0,
5013
5062
  ref_key: "textarea",
5014
5063
  ref: a,
5015
- "onUpdate:modelValue": o[6] || (o[6] = (e) => Ee.value = e),
5064
+ "onUpdate:modelValue": s[7] || (s[7] = (e) => ke.value = e),
5016
5065
  "data-test": "messaging-input",
5017
5066
  rows: "1",
5018
5067
  enterkeyhint: "send",
5019
- placeholder: we.value,
5020
- disabled: U.value,
5068
+ placeholder: De.value,
5069
+ disabled: Ee.value,
5021
5070
  style: {
5022
5071
  fontSize: "16px",
5023
5072
  resize: "none"
5024
5073
  },
5025
- class: S(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", G.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5074
+ class: C(["block w-full bg-transparent leading-snug focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", G.value ? "text-theme-900 placeholder-theme-400" : "text-white placeholder-white/50"]),
5026
5075
  onKeydown: handleKeydown,
5027
- onFocus: o[7] || (o[7] = (e) => r.value = !0),
5028
- onBlur: o[8] || (o[8] = (e) => r.value = !1)
5029
- }, null, 42, zi)), [[ue, Ee.value]]), v("div", Vi, [
5030
- v("button", {
5031
- class: S(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
5032
- W.value ? "cursor-pointer" : "cursor-default",
5076
+ onFocus: s[8] || (s[8] = (e) => r.value = !0),
5077
+ onBlur: s[9] || (s[9] = (e) => r.value = !1)
5078
+ }, null, 42, Ri)), [[F, ke.value]]), _("div", Bi, [
5079
+ _("button", {
5080
+ class: C(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
5081
+ Ne.value ? "cursor-pointer" : "cursor-default",
5033
5082
  G.value ? "text-theme-500" : "text-white/50",
5034
- Oe.value || Ae.value ? "opacity-50 pointer-events-none" : ""
5083
+ je.value || Me.value ? "opacity-50 pointer-events-none" : ""
5035
5084
  ]]),
5036
- disabled: U.value || Oe.value || Ae.value || !W.value,
5037
- "aria-label": W.value ? "Attach file" : "File attachments unavailable",
5038
- title: W.value ? "Attach file" : "File attachments unavailable",
5039
- onClick: o[9] || (o[9] = (e) => W.value && triggerFileInput())
5040
- }, [Oe.value ? (T(), _("i", Ui)) : (T(), _("i", Wi)), v("span", Gi, P(W.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Hi),
5041
- o[30] || (o[30] = v("div", { class: "flex-1" }, null, -1)),
5042
- v("div", Ki, [Ie.value || Le.value ? (T(), _("button", {
5085
+ disabled: Ee.value || je.value || Me.value || !Ne.value,
5086
+ "aria-label": Ne.value ? "Attach file" : "File attachments unavailable",
5087
+ title: Ne.value ? "Attach file" : "File attachments unavailable",
5088
+ onClick: s[10] || (s[10] = (e) => Ne.value && triggerFileInput())
5089
+ }, [je.value ? (k(), h("i", Hi)) : (k(), h("i", Ui)), _("span", Wi, P(Ne.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Vi),
5090
+ s[30] || (s[30] = _("div", { class: "flex-1" }, null, -1)),
5091
+ _("div", Gi, [Be.value || Ve.value ? (k(), h("button", {
5043
5092
  key: 0,
5044
5093
  "data-test": "messaging-record-audio-btn",
5045
- class: S(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Le.value ? G.value ? "text-theme-900 scale-110" : "text-white scale-110" : G.value ? "text-theme-500" : "text-white/60"]),
5046
- "aria-label": Be.value,
5047
- title: Be.value,
5048
- onPointerdown: o[10] || (o[10] = I((e) => startRecording(), ["prevent"])),
5049
- onPointerup: o[11] || (o[11] = I((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
5050
- onPointercancel: o[12] || (o[12] = I((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
5094
+ class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Ve.value ? G.value ? "text-theme-900 scale-110" : "text-white scale-110" : G.value ? "text-theme-500" : "text-white/60"]),
5095
+ "aria-label": We.value,
5096
+ title: We.value,
5097
+ onPointerdown: s[11] || (s[11] = R((e) => startRecording(), ["prevent"])),
5098
+ onPointerup: s[12] || (s[12] = R((e) => finishRecording({ cancelled: !1 }), ["prevent"])),
5099
+ onPointercancel: s[13] || (s[13] = R((e) => finishRecording({ cancelled: !0 }), ["prevent"])),
5051
5100
  onKeydown: [
5052
- o[13] || (o[13] = he(I((e) => startRecording(), ["prevent"]), ["enter"])),
5053
- o[15] || (o[15] = he(I((e) => startRecording(), ["prevent"]), ["space"])),
5054
- o[17] || (o[17] = he(I((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5101
+ s[14] || (s[14] = de(R((e) => startRecording(), ["prevent"]), ["enter"])),
5102
+ s[16] || (s[16] = de(R((e) => startRecording(), ["prevent"]), ["space"])),
5103
+ s[18] || (s[18] = de(R((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
5055
5104
  ],
5056
- onKeyup: [o[14] || (o[14] = he(I((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), o[16] || (o[16] = he(I((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
5057
- }, [v("i", { class: S([Le.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), v("span", Ji, P(Be.value), 1)], 42, qi)) : h("", !0), Le.value ? h("", !0) : (T(), _("button", {
5105
+ onKeyup: [s[15] || (s[15] = de(R((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[17] || (s[17] = de(R((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
5106
+ }, [_("i", { class: C([Ve.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span", qi, P(We.value), 1)], 42, Ki)) : m("", !0), Ve.value ? m("", !0) : (k(), h("button", {
5058
5107
  key: 1,
5059
5108
  "data-test": "messaging-send-btn",
5060
- "data-composer-action": Me.value,
5061
- class: S(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Ne.value ? G.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : G.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5062
- disabled: !Ne.value,
5063
- "aria-label": Pe.value,
5064
- title: Pe.value,
5065
- onClick: o[18] || (o[18] = (e) => handleComposerAction())
5066
- }, [Me.value === "stop" ? (T(), _("i", Xi)) : (T(), _("i", Zi)), v("span", Qi, P(Pe.value), 1)], 10, Yi))])
5067
- ])], 10, Ri)
5109
+ "data-composer-action": Ie.value,
5110
+ class: C(["flex size-8 items-center justify-center rounded-full transition-colors duration-150", Le.value ? G.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : G.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
5111
+ disabled: !Le.value,
5112
+ "aria-label": Re.value,
5113
+ title: Re.value,
5114
+ onClick: s[19] || (s[19] = (e) => handleComposerAction())
5115
+ }, [Ie.value === "stop" ? (k(), h("i", Yi)) : (k(), h("i", Xi)), _("span", Zi, P(Re.value), 1)], 10, Ji))])
5116
+ ])], 10, Li),
5117
+ z.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", Qi, [_("div", $i, [(k(!0), h(u, null, j(e.suggestedPrompts, (e) => (k(), h("button", {
5118
+ key: e.id,
5119
+ type: "button",
5120
+ disabled: Ee.value,
5121
+ "data-test": "messaging-suggested-prompt",
5122
+ class: C(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", Ee.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900"]),
5123
+ onClick: (t) => sendSuggestedPrompt(e)
5124
+ }, P(e.label), 11, ea))), 128))])])) : m("", !0)
5068
5125
  ], 2)
5069
- ]));
5126
+ ], 2));
5070
5127
  }
5071
- }), ea = { class: "agent-wrap" }, ta = {
5128
+ }), ra = { class: "agent-wrap" }, ia = {
5072
5129
  key: 0,
5073
5130
  class: "flex items-center justify-center h-full"
5074
- }, na = /* @__PURE__ */ x({
5131
+ }, aa = /* @__PURE__ */ x({
5075
5132
  __name: "AgentWrap",
5076
5133
  props: {
5077
5134
  sdk: {},
5078
5135
  agent: {},
5079
5136
  handle: {},
5080
5137
  context: {},
5138
+ clientContext: {},
5081
5139
  firstMessage: {},
5082
5140
  buttonText: {},
5083
5141
  buttonIcon: {},
5084
5142
  hasClose: { type: Boolean },
5143
+ chatOnly: { type: Boolean },
5144
+ bare: { type: Boolean },
5085
5145
  apiBase: {}
5086
5146
  },
5087
5147
  setup(e) {
5088
5148
  let r = a("AgentWrap"), i = e, o = i.sdk || t.getInstance({
5089
5149
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
5090
5150
  ...i.apiBase && { apiBase: i.apiBase }
5091
- }), s = k(!i.agent), c = se(i.agent ? new n({ config: i.agent }) : void 0), u = k();
5092
- return ie(async () => {
5151
+ }), s = A(!i.agent), c = oe(i.agent ? new n({ config: i.agent }) : void 0), u = A();
5152
+ return ne(async () => {
5093
5153
  if (i.agent) {
5094
5154
  r.debug("Agent provided via props, skipping fetch", {
5095
5155
  agentId: i.agent.agentId,
@@ -5102,7 +5162,7 @@ var yr = [
5102
5162
  propsReceived: {
5103
5163
  handle: i.handle,
5104
5164
  agent: i.agent,
5105
- context: i.context,
5165
+ context: i.clientContext ?? i.context,
5106
5166
  apiBase: i.apiBase
5107
5167
  },
5108
5168
  sdkState: {
@@ -5153,7 +5213,7 @@ var yr = [
5153
5213
  },
5154
5214
  props: {
5155
5215
  handle: i.handle,
5156
- context: i.context,
5216
+ context: i.clientContext ?? i.context,
5157
5217
  apiBase: i.apiBase
5158
5218
  },
5159
5219
  sdkState: {
@@ -5163,18 +5223,18 @@ var yr = [
5163
5223
  }
5164
5224
  });
5165
5225
  }
5166
- }), (t, n) => (T(), _("div", ea, [s.value ? (T(), _("div", ta, [...n[0] || (n[0] = [v("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)])])) : c.value ? oe(t.$slots, "default", {
5167
- sdk: ce(o),
5226
+ }), (t, n) => (k(), h("div", ra, [s.value ? (k(), h("div", ia, [_("div", { class: C(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ie(t.$slots, "default", {
5227
+ sdk: se(o),
5168
5228
  agent: c.value,
5169
- context: e.context,
5229
+ context: e.clientContext ?? e.context,
5170
5230
  firstMessage: e.firstMessage,
5171
5231
  buttonText: e.buttonText,
5172
5232
  buttonIcon: e.buttonIcon,
5173
5233
  loading: s.value
5174
- }, void 0, void 0, 1) : h("", !0)]));
5234
+ }, void 0, void 0, 1) : m("", !0)]));
5175
5235
  }
5176
5236
  });
5177
5237
  //#endregion
5178
- export { Ae as a, getAgentAvatarUrl as c, AgentChatController as d, ye as f, Fe as i, handleImageError as l, ve as m, $i as n, Oe as o, n as p, Yr as r, Ee as s, na as t, parseButtonTemplate as u };
5238
+ export { ke as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, na as n, De as o, n as p, $r as r, Te as s, aa as t, parseButtonTemplate as u };
5179
5239
 
5180
5240
  //# sourceMappingURL=AgentWrap.js.map