@pagelines/sdk 1.0.507 → 1.0.509

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  var Mn = Object.defineProperty;
2
- var Cs = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
2
+ var Is = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
3
  var p = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
4
- var I = (a, t, e) => Cs(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as ke, openBlock as y, createElementBlock as T, createElementVNode as v, normalizeClass as E, ref as Z, watch as qe, computed as $, createCommentVNode as B, renderSlot as en, onMounted as St, Fragment as Te, renderList as at, withDirectives as ns, vModelText as ss, unref as Xt, toDisplayString as re, shallowRef as rs, onBeforeUnmount as is, nextTick as Is, createVNode as Je, withCtx as Ds, createTextVNode as et, withModifiers as Ms } from "vue";
6
- import { SettingsObject as Ls, Agent as wt, getDefaultAvatarUrl as as, createLogger as Os } from "@pagelines/core";
7
- import { P as zs } from "./sdkClient.js";
8
- const Ps = { class: "spinner max-w-sm" }, Ns = {
4
+ var I = (a, t, e) => Is(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as ke, openBlock as y, createElementBlock as T, createElementVNode as v, normalizeClass as E, ref as Y, watch as Ze, computed as U, createCommentVNode as B, renderSlot as tn, onMounted as Et, Fragment as ye, renderList as ot, withDirectives as ss, vModelText as rs, unref as Kt, toDisplayString as ne, shallowRef as is, onBeforeUnmount as as, nextTick as Ds, createVNode as Fe, withCtx as Ms, createTextVNode as nt, withModifiers as Ls } from "vue";
6
+ import { SettingsObject as Os, Agent as yt, getDefaultAvatarUrl as ls, createLogger as zs } from "@pagelines/core";
7
+ import { P as Ps } from "./sdkClient.js";
8
+ const Ns = { class: "spinner max-w-sm" }, $s = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
11
  }, Ln = /* @__PURE__ */ ke({
@@ -15,8 +15,8 @@ const Ps = { class: "spinner max-w-sm" }, Ns = {
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
17
  setup(a) {
18
- return (t, e) => (y(), T("div", Ps, [
19
- (y(), T("svg", Ns, [
18
+ return (t, e) => (y(), T("div", Ns, [
19
+ (y(), T("svg", $s, [
20
20
  v("circle", {
21
21
  class: E([a.colorMode, "ring-path"]),
22
22
  cx: "50",
@@ -30,10 +30,10 @@ const Ps = { class: "spinner max-w-sm" }, Ns = {
30
30
  ]))
31
31
  ]));
32
32
  }
33
- }), $s = [
33
+ }), Us = [
34
34
  { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
35
35
  { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
36
- ], Us = 9e4, ls = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Bs = /* @__PURE__ */ new Set([...ls, "EMPTY_STREAM", "RATE_LIMIT"]), hn = class hn extends Ls {
36
+ ], Bs = 9e4, os = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...os, "EMPTY_STREAM", "RATE_LIMIT"]), pn = class pn extends Os {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
39
  I(this, "isTextMode", !1);
@@ -41,16 +41,16 @@ const Ps = { class: "spinner max-w-sm" }, Ns = {
41
41
  I(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
43
  I(this, "conversationId");
44
- I(this, "textState", Z({
44
+ I(this, "textState", Y({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- I(this, "agentMode", Z("self"));
51
- I(this, "sharedMessages", Z([]));
50
+ I(this, "agentMode", Y("self"));
51
+ I(this, "sharedMessages", Y([]));
52
52
  I(this, "_agent");
53
- this._agent = e.agent instanceof wt ? e.agent : new wt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
53
+ this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  return this._agent.chatAvailable.value;
@@ -122,12 +122,12 @@ Current User:
122
122
  });
123
123
  }
124
124
  setupModeWatcher() {
125
- qe(this.agentMode, async (e, n) => {
125
+ Ze(this.agentMode, async (e, n) => {
126
126
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
127
127
  });
128
128
  }
129
129
  setupAvailabilityWatcher() {
130
- qe(() => this._agent.chatAvailable.value, (e) => {
130
+ Ze(() => this._agent.chatAvailable.value, (e) => {
131
131
  if (!(!this.isTextMode || this.isConnecting)) {
132
132
  if (e) {
133
133
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -227,57 +227,57 @@ Current User:
227
227
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
228
228
  const l = `stream-${Date.now()}`;
229
229
  let o = !1;
230
- const d = /* @__PURE__ */ p((m) => {
230
+ const d = /* @__PURE__ */ p((g) => {
231
231
  o || (o = !0, this.sharedMessages.value = [
232
232
  ...this.sharedMessages.value,
233
233
  { id: l, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
234
234
  ]);
235
- const f = this.sharedMessages.value, w = f[f.length - 1];
236
- w?.id === l && (w.text += m, this.sharedMessages.value = [...f]);
237
- }, "onDelta"), c = /* @__PURE__ */ p((m) => {
235
+ const m = this.sharedMessages.value, w = m[m.length - 1];
236
+ w?.id === l && (w.text += g, this.sharedMessages.value = [...m]);
237
+ }, "onDelta"), c = /* @__PURE__ */ p((g) => {
238
238
  if (!o) {
239
- b("empty_stream — assistant returned no content");
239
+ x("empty_stream — assistant returned no content");
240
240
  return;
241
241
  }
242
- const f = this.sharedMessages.value, w = f[f.length - 1];
242
+ const m = this.sharedMessages.value, w = m[m.length - 1];
243
243
  if (w?.id === l && w.text) {
244
244
  let _ = w.text;
245
- for (const O of $s)
246
- O.pattern.test(_) && (console.debug(`[chat] filtered directive: ${O.label}`), _ = _.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
247
- _ ? _ !== w.text && (w.text = _, this.sharedMessages.value = [...f]) : this.sharedMessages.value = f.slice(0, -1);
248
- }
249
- m && (this.conversationId = m), this.updateState(this.textState, { isThinking: !1 });
250
- }, "onDone"), b = /* @__PURE__ */ p((m) => {
251
- const f = this.sharedMessages.value, w = f[f.length - 1];
252
- if (w?.id === l && !w.text && (this.sharedMessages.value = f.slice(0, -1)), typeof m == "object" && m.code && m.error) {
253
- const { bucket: ie, actionUrl: be, actionLabel: G, help: P } = m;
254
- if (ie !== void 0 || Bs.has(m.code)) {
255
- const ae = ie ?? (ls.has(m.code) ? "account" : "error"), Q = {
256
- code: m.code,
257
- bucket: ae,
258
- ...G ? { actionLabel: G } : {},
259
- ...be ? { actionUrl: be } : {},
260
- ...P ? { help: P } : {}
245
+ for (const z of Us)
246
+ z.pattern.test(_) && (console.debug(`[chat] filtered directive: ${z.label}`), _ = _.replace(z.pattern, "").trim(), z.pattern.lastIndex = 0);
247
+ _ ? _ !== w.text && (w.text = _, this.sharedMessages.value = [...m]) : this.sharedMessages.value = m.slice(0, -1);
248
+ }
249
+ g && (this.conversationId = g), this.updateState(this.textState, { isThinking: !1 });
250
+ }, "onDone"), x = /* @__PURE__ */ p((g) => {
251
+ const m = this.sharedMessages.value, w = m[m.length - 1];
252
+ if (w?.id === l && !w.text && (this.sharedMessages.value = m.slice(0, -1)), typeof g == "object" && g.code && g.error) {
253
+ const { bucket: te, actionUrl: oe, actionLabel: se, help: O } = g;
254
+ if (te !== void 0 || Fs.has(g.code)) {
255
+ const re = te ?? (os.has(g.code) ? "account" : "error"), ie = {
256
+ code: g.code,
257
+ bucket: re,
258
+ ...se ? { actionLabel: se } : {},
259
+ ...oe ? { actionUrl: oe } : {},
260
+ ...O ? { help: O } : {}
261
261
  };
262
- this.addMessage(m.error, "system", void 0, Q), ae === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
262
+ this.addMessage(g.error, "system", void 0, ie), re === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
263
263
  } else
264
- this.handleError(new Error(m.error));
264
+ this.handleError(new Error(g.error));
265
265
  return;
266
266
  }
267
- const _ = typeof m == "string" ? m : m.error, O = this.mapChatError(_);
268
- this.isTransientError(_) ? (this.logger.warn("Chat turn failed (transient):", { raw: _, friendly: O }), this.addMessage(O, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(O), _);
269
- }, "onError"), u = /* @__PURE__ */ p((m) => {
270
- this.addMessage(m, "system");
267
+ const _ = typeof g == "string" ? g : g.error, z = this.mapChatError(_);
268
+ this.isTransientError(_) ? (this.logger.warn("Chat turn failed (transient):", { raw: _, friendly: z }), this.addMessage(z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(z), _);
269
+ }, "onError"), u = /* @__PURE__ */ p((g) => {
270
+ this.addMessage(g, "system");
271
271
  }, "onStatus");
272
272
  try {
273
- const m = r ? r({
273
+ const g = r ? r({
274
274
  message: e,
275
275
  attachments: n,
276
276
  conversationId: this.conversationId,
277
277
  history: this.buildHistory(),
278
278
  onDelta: d,
279
279
  onDone: c,
280
- onError: b,
280
+ onError: x,
281
281
  onStatus: u
282
282
  }) : s.chat.chatStreamPublic({
283
283
  handle: this._agent.handle.value,
@@ -287,15 +287,15 @@ Current User:
287
287
  context: this.getDynamicSettings().context || void 0,
288
288
  onDelta: d,
289
289
  onDone: c,
290
- onError: b,
290
+ onError: x,
291
291
  onStatus: u
292
292
  });
293
293
  await Promise.race([
294
- m,
295
- new Promise((f, w) => setTimeout(() => w(new Error("timed out")), Us))
294
+ g,
295
+ new Promise((m, w) => setTimeout(() => w(new Error("timed out")), Bs))
296
296
  ]);
297
- } catch (m) {
298
- b(m.message || "Something went wrong");
297
+ } catch (g) {
298
+ x(g.message || "Something went wrong");
299
299
  }
300
300
  }
301
301
  buildHistory() {
@@ -319,19 +319,19 @@ Current User:
319
319
  await this.endConversation();
320
320
  }
321
321
  };
322
- p(hn, "AgentChatController");
323
- let On = hn;
322
+ p(pn, "AgentChatController");
323
+ let On = pn;
324
324
  function zn(a) {
325
325
  return a ? typeof a == "string" ? a : a.src || "" : "";
326
326
  }
327
327
  p(zn, "getImageSrc");
328
328
  function Ki(a) {
329
- return zn(a.cover) || zn(a.avatar) || as(a.name);
329
+ return zn(a.cover) || zn(a.avatar) || ls(a.name);
330
330
  }
331
331
  p(Ki, "getAgentAvatarUrl");
332
332
  function Pn(a) {
333
333
  const t = a.target;
334
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = as());
334
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = ls());
335
335
  }
336
336
  p(Pn, "handleImageError");
337
337
  function Qi(a) {
@@ -339,7 +339,7 @@ function Qi(a) {
339
339
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
340
340
  }
341
341
  p(Qi, "parseButtonTemplate");
342
- const Fs = {
342
+ const Hs = {
343
343
  key: 0,
344
344
  class: "absolute inset-0 flex items-center justify-center"
345
345
  }, Ji = /* @__PURE__ */ ke({
@@ -352,16 +352,16 @@ const Fs = {
352
352
  iconAfter: {}
353
353
  },
354
354
  setup(a) {
355
- const t = $(() => ({
355
+ const t = U(() => ({
356
356
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
357
357
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
358
358
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
359
359
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
360
- })[a.theme]), e = $(() => ({
360
+ })[a.theme]), e = U(() => ({
361
361
  sm: "px-4 py-2 text-sm",
362
362
  md: "px-6 py-3 text-base",
363
363
  lg: "px-8 py-4 text-base"
364
- })[a.size]), n = $(() => ({
364
+ })[a.size]), n = U(() => ({
365
365
  sm: "size-4",
366
366
  md: "size-4",
367
367
  lg: "size-5"
@@ -369,7 +369,7 @@ const Fs = {
369
369
  return (r, s) => (y(), T("button", {
370
370
  class: E(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
371
371
  }, [
372
- a.loading ? (y(), T("div", Fs, [...s[0] || (s[0] = [
372
+ a.loading ? (y(), T("div", Hs, [...s[0] || (s[0] = [
373
373
  v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
374
374
  ])])) : B("", !0),
375
375
  v("span", {
@@ -379,7 +379,7 @@ const Fs = {
379
379
  key: 0,
380
380
  class: E([a.icon, n.value])
381
381
  }, null, 2)) : B("", !0),
382
- en(r.$slots, "default"),
382
+ tn(r.$slots, "default"),
383
383
  a.iconAfter ? (y(), T("i", {
384
384
  key: 1,
385
385
  class: E([a.iconAfter, n.value])
@@ -387,7 +387,7 @@ const Fs = {
387
387
  ], 2)
388
388
  ], 2));
389
389
  }
390
- }), Hs = ["value"], ea = /* @__PURE__ */ ke({
390
+ }), Gs = ["value"], ea = /* @__PURE__ */ ke({
391
391
  __name: "AgentInputEmail",
392
392
  props: {
393
393
  modelValue: { default: "" }
@@ -403,9 +403,9 @@ const Fs = {
403
403
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
404
404
  style: { "font-size": "16px" },
405
405
  onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
406
- }, null, 40, Hs));
406
+ }, null, 40, Gs));
407
407
  }
408
- }), Gs = { class: "flex gap-1.5 justify-center" }, js = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ta = /* @__PURE__ */ ke({
408
+ }), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ta = /* @__PURE__ */ ke({
409
409
  __name: "AgentInputOneTimeCode",
410
410
  props: {
411
411
  modelValue: {},
@@ -414,73 +414,73 @@ const Fs = {
414
414
  },
415
415
  emits: ["update:modelValue", "autoSubmit"],
416
416
  setup(a, { emit: t }) {
417
- const e = a, n = t, r = Z([]), s = Z(Array.from({ length: e.length }).fill("")), l = Z(!1);
418
- St(() => {
417
+ const e = a, n = t, r = Y([]), s = Y(Array.from({ length: e.length }).fill("")), l = Y(!1);
418
+ Et(() => {
419
419
  e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
420
- }), qe(() => e.modelValue, (u) => {
420
+ }), Ze(() => e.modelValue, (u) => {
421
421
  s.value = u ? u.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
422
- }), qe(s, () => {
422
+ }), Ze(s, () => {
423
423
  const u = s.value.filter(Boolean).join("");
424
424
  n("update:modelValue", u), u.length === e.length && n("autoSubmit", u);
425
425
  }, { deep: !0 });
426
- function o(u, m) {
427
- m.preventDefault(), l.value = !0;
428
- const f = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
- if (f.length === e.length)
430
- s.value = f.split(""), setTimeout(() => {
426
+ function o(u, g) {
427
+ g.preventDefault(), l.value = !0;
428
+ const m = (g.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
+ if (m.length === e.length)
430
+ s.value = m.split(""), setTimeout(() => {
431
431
  r.value[e.length - 1]?.focus(), l.value = !1;
432
432
  }, 10);
433
433
  else {
434
434
  const w = [...s.value];
435
- f.split("").slice(0, e.length - u).forEach((O, ie) => {
436
- w[u + ie] = O;
435
+ m.split("").slice(0, e.length - u).forEach((z, te) => {
436
+ w[u + te] = z;
437
437
  }), s.value = w;
438
- const _ = Math.min(u + f.length, e.length - 1);
438
+ const _ = Math.min(u + m.length, e.length - 1);
439
439
  setTimeout(() => {
440
440
  r.value[_]?.focus(), l.value = !1;
441
441
  }, 10);
442
442
  }
443
443
  }
444
444
  p(o, "onPaste");
445
- function d(u, m) {
446
- const f = m.target.value.slice(-1).replace(/\D/g, "");
447
- s.value[u] = f, f && u < e.length - 1 && r.value[u + 1]?.focus();
445
+ function d(u, g) {
446
+ const m = g.target.value.slice(-1).replace(/\D/g, "");
447
+ s.value[u] = m, m && u < e.length - 1 && r.value[u + 1]?.focus();
448
448
  }
449
449
  p(d, "onInput");
450
- function c(u, m) {
451
- m.key === "Backspace" ? (m.preventDefault(), s.value[u] = "", u > 0 && r.value[u - 1]?.focus()) : m.key === "ArrowLeft" && u > 0 ? r.value[u - 1]?.focus() : m.key === "ArrowRight" && u < e.length - 1 && r.value[u + 1]?.focus();
450
+ function c(u, g) {
451
+ g.key === "Backspace" ? (g.preventDefault(), s.value[u] = "", u > 0 && r.value[u - 1]?.focus()) : g.key === "ArrowLeft" && u > 0 ? r.value[u - 1]?.focus() : g.key === "ArrowRight" && u < e.length - 1 && r.value[u + 1]?.focus();
452
452
  }
453
453
  p(c, "onKeydown");
454
- function b(u) {
454
+ function x(u) {
455
455
  if (r.value[u]?.select(), !l.value && s.value[u])
456
- for (let m = u; m < e.length; m++)
457
- s.value[m] = "";
456
+ for (let g = u; g < e.length; g++)
457
+ s.value[g] = "";
458
458
  }
459
- return p(b, "onFocus"), (u, m) => (y(), T("div", Gs, [
460
- (y(!0), T(Te, null, at(a.length, (f) => ns((y(), T("input", {
461
- key: f,
459
+ return p(x, "onFocus"), (u, g) => (y(), T("div", js, [
460
+ (y(!0), T(ye, null, ot(a.length, (m) => ss((y(), T("input", {
461
+ key: m,
462
462
  ref_for: !0,
463
- ref: /* @__PURE__ */ p((w) => r.value[f - 1] = w, "ref"),
464
- "onUpdate:modelValue": /* @__PURE__ */ p((w) => s.value[f - 1] = w, "onUpdate:modelValue"),
463
+ ref: /* @__PURE__ */ p((w) => r.value[m - 1] = w, "ref"),
464
+ "onUpdate:modelValue": /* @__PURE__ */ p((w) => s.value[m - 1] = w, "onUpdate:modelValue"),
465
465
  type: "text",
466
466
  inputmode: "numeric",
467
467
  autocomplete: "one-time-code",
468
468
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
469
469
  style: { "font-size": "16px" },
470
470
  maxlength: "1",
471
- onInput: /* @__PURE__ */ p((w) => d(f - 1, w), "onInput"),
472
- onKeydown: /* @__PURE__ */ p((w) => c(f - 1, w), "onKeydown"),
473
- onPaste: /* @__PURE__ */ p((w) => o(f - 1, w), "onPaste"),
474
- onFocus: /* @__PURE__ */ p((w) => b(f - 1), "onFocus")
475
- }, null, 40, js)), [
476
- [ss, s.value[f - 1]]
471
+ onInput: /* @__PURE__ */ p((w) => d(m - 1, w), "onInput"),
472
+ onKeydown: /* @__PURE__ */ p((w) => c(m - 1, w), "onKeydown"),
473
+ onPaste: /* @__PURE__ */ p((w) => o(m - 1, w), "onPaste"),
474
+ onFocus: /* @__PURE__ */ p((w) => x(m - 1), "onFocus")
475
+ }, null, 40, Ws)), [
476
+ [rs, s.value[m - 1]]
477
477
  ])), 128))
478
478
  ]));
479
479
  }
480
- }), Ws = { class: "relative flex-shrink-0" }, qs = ["src", "alt"], Vs = { class: "absolute top-1 right-1" }, Ys = {
480
+ }), qs = { class: "relative flex-shrink-0" }, Vs = ["src", "alt"], Ys = { class: "absolute top-1 right-1" }, Zs = {
481
481
  key: 1,
482
482
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
483
- }, Zs = { class: "min-w-0" }, Xs = /* @__PURE__ */ ke({
483
+ }, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */ ke({
484
484
  __name: "ElModeHeader",
485
485
  props: {
486
486
  agent: {},
@@ -494,7 +494,7 @@ const Fs = {
494
494
  a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
495
495
  ]])
496
496
  }, [
497
- v("div", Ws, [
497
+ v("div", qs, [
498
498
  v("div", {
499
499
  class: E(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
500
500
  }, [
@@ -503,199 +503,199 @@ const Fs = {
503
503
  alt: a.agent.displayName.value,
504
504
  class: "w-full h-full object-cover",
505
505
  onError: e[0] || (e[0] = //@ts-ignore
506
- (...n) => Xt(Pn) && Xt(Pn)(...n))
507
- }, null, 40, qs)
506
+ (...n) => Kt(Pn) && Kt(Pn)(...n))
507
+ }, null, 40, Vs)
508
508
  ], 2),
509
- v("div", Vs, [
510
- a.isOnline ? (y(), T(Te, { key: 0 }, [
509
+ v("div", Ys, [
510
+ a.isOnline ? (y(), T(ye, { key: 0 }, [
511
511
  e[1] || (e[1] = v("div", {
512
512
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
513
513
  style: { "animation-duration": "3s" }
514
514
  }, null, -1)),
515
515
  e[2] || (e[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
516
- ], 64)) : (y(), T("div", Ys))
516
+ ], 64)) : (y(), T("div", Zs))
517
517
  ])
518
518
  ]),
519
- v("div", Zs, [
519
+ v("div", Xs, [
520
520
  v("h1", {
521
521
  class: E(["font-light text-white mb-1 truncate", [
522
522
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
523
523
  a.layout === "horizontal" ? "text-white/95" : ""
524
524
  ]])
525
- }, re(a.agent.displayName.value), 3),
525
+ }, ne(a.agent.displayName.value), 3),
526
526
  v("p", {
527
527
  class: E(["font-light line-clamp-1", [
528
528
  a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
529
529
  a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
530
530
  ]])
531
- }, re(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
531
+ }, ne(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
532
532
  ])
533
533
  ], 2));
534
534
  }
535
535
  });
536
536
  const {
537
- entries: os,
537
+ entries: cs,
538
538
  setPrototypeOf: Nn,
539
- isFrozen: Ks,
540
- getPrototypeOf: Qs,
541
- getOwnPropertyDescriptor: Js
539
+ isFrozen: Qs,
540
+ getPrototypeOf: Js,
541
+ getOwnPropertyDescriptor: er
542
542
  } = Object;
543
543
  let {
544
- freeze: te,
545
- seal: oe,
546
- create: Be
544
+ freeze: Q,
545
+ seal: le,
546
+ create: Ge
547
547
  } = Object, {
548
- apply: Kt,
549
- construct: Qt
548
+ apply: Qt,
549
+ construct: Jt
550
550
  } = typeof Reflect < "u" && Reflect;
551
- te || (te = /* @__PURE__ */ p(function(t) {
551
+ Q || (Q = /* @__PURE__ */ p(function(t) {
552
552
  return t;
553
553
  }, "freeze"));
554
- oe || (oe = /* @__PURE__ */ p(function(t) {
554
+ le || (le = /* @__PURE__ */ p(function(t) {
555
555
  return t;
556
556
  }, "seal"));
557
- Kt || (Kt = /* @__PURE__ */ p(function(t, e) {
557
+ Qt || (Qt = /* @__PURE__ */ p(function(t, e) {
558
558
  for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
559
559
  r[s - 2] = arguments[s];
560
560
  return t.apply(e, r);
561
561
  }, "apply"));
562
- Qt || (Qt = /* @__PURE__ */ p(function(t) {
562
+ Jt || (Jt = /* @__PURE__ */ p(function(t) {
563
563
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
564
564
  n[r - 1] = arguments[r];
565
565
  return new t(...n);
566
566
  }, "construct"));
567
- const tt = H(Array.prototype.forEach), er = H(Array.prototype.lastIndexOf), $n = H(Array.prototype.pop), nt = H(Array.prototype.push), tr = H(Array.prototype.splice), ee = Array.isArray, lt = H(String.prototype.toLowerCase), Wt = H(String.prototype.toString), Un = H(String.prototype.match), Ue = H(String.prototype.replace), Bn = H(String.prototype.indexOf), nr = H(String.prototype.trim), sr = H(Number.prototype.toString), rr = H(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : H(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : H(Symbol.prototype.toString), N = H(Object.prototype.hasOwnProperty), st = H(Object.prototype.toString), Y = H(RegExp.prototype.test), bt = ir(TypeError);
568
- function H(a) {
567
+ const st = j(Array.prototype.forEach), tr = j(Array.prototype.lastIndexOf), $n = j(Array.prototype.pop), rt = j(Array.prototype.push), nr = j(Array.prototype.splice), K = Array.isArray, ct = j(String.prototype.toLowerCase), qt = j(String.prototype.toString), Un = j(String.prototype.match), He = j(String.prototype.replace), Bn = j(String.prototype.indexOf), sr = j(String.prototype.trim), rr = j(Number.prototype.toString), ir = j(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), $ = j(Object.prototype.hasOwnProperty), it = j(Object.prototype.toString), V = j(RegExp.prototype.test), kt = ar(TypeError);
568
+ function j(a) {
569
569
  return function(t) {
570
570
  t instanceof RegExp && (t.lastIndex = 0);
571
571
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
572
572
  n[r - 1] = arguments[r];
573
- return Kt(a, t, n);
573
+ return Qt(a, t, n);
574
574
  };
575
575
  }
576
- p(H, "unapply");
577
- function ir(a) {
576
+ p(j, "unapply");
577
+ function ar(a) {
578
578
  return function() {
579
579
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
580
580
  e[n] = arguments[n];
581
- return Qt(a, e);
581
+ return Jt(a, e);
582
582
  };
583
583
  }
584
- p(ir, "unconstruct");
584
+ p(ar, "unconstruct");
585
585
  function R(a, t) {
586
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lt;
587
- if (Nn && Nn(a, null), !ee(t))
586
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct;
587
+ if (Nn && Nn(a, null), !K(t))
588
588
  return a;
589
589
  let n = t.length;
590
590
  for (; n--; ) {
591
591
  let r = t[n];
592
592
  if (typeof r == "string") {
593
593
  const s = e(r);
594
- s !== r && (Ks(t) || (t[n] = s), r = s);
594
+ s !== r && (Qs(t) || (t[n] = s), r = s);
595
595
  }
596
596
  a[r] = !0;
597
597
  }
598
598
  return a;
599
599
  }
600
600
  p(R, "addToSet");
601
- function ar(a) {
601
+ function lr(a) {
602
602
  for (let t = 0; t < a.length; t++)
603
- N(a, t) || (a[t] = null);
603
+ $(a, t) || (a[t] = null);
604
604
  return a;
605
605
  }
606
- p(ar, "cleanArray");
607
- function se(a) {
608
- const t = Be(null);
609
- for (const [e, n] of os(a))
610
- N(a, e) && (ee(n) ? t[e] = ar(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = se(n) : t[e] = n);
606
+ p(lr, "cleanArray");
607
+ function ee(a) {
608
+ const t = Ge(null);
609
+ for (const [e, n] of cs(a))
610
+ $(a, e) && (K(n) ? t[e] = lr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ee(n) : t[e] = n);
611
611
  return t;
612
612
  }
613
- p(se, "clone");
614
- function lr(a) {
613
+ p(ee, "clone");
614
+ function or(a) {
615
615
  switch (typeof a) {
616
616
  case "string":
617
617
  return a;
618
618
  case "number":
619
- return sr(a);
620
- case "boolean":
621
619
  return rr(a);
620
+ case "boolean":
621
+ return ir(a);
622
622
  case "bigint":
623
623
  return Fn ? Fn(a) : "0";
624
624
  case "symbol":
625
625
  return Hn ? Hn(a) : "Symbol()";
626
626
  case "undefined":
627
- return st(a);
627
+ return it(a);
628
628
  case "function":
629
629
  case "object": {
630
630
  if (a === null)
631
- return st(a);
632
- const t = a, e = Fe(t, "toString");
631
+ return it(a);
632
+ const t = a, e = je(t, "toString");
633
633
  if (typeof e == "function") {
634
634
  const n = e(t);
635
- return typeof n == "string" ? n : st(n);
635
+ return typeof n == "string" ? n : it(n);
636
636
  }
637
- return st(a);
637
+ return it(a);
638
638
  }
639
639
  default:
640
- return st(a);
640
+ return it(a);
641
641
  }
642
642
  }
643
- p(lr, "stringifyValue");
644
- function Fe(a, t) {
643
+ p(or, "stringifyValue");
644
+ function je(a, t) {
645
645
  for (; a !== null; ) {
646
- const n = Js(a, t);
646
+ const n = er(a, t);
647
647
  if (n) {
648
648
  if (n.get)
649
- return H(n.get);
649
+ return j(n.get);
650
650
  if (typeof n.value == "function")
651
- return H(n.value);
651
+ return j(n.value);
652
652
  }
653
- a = Qs(a);
653
+ a = Js(a);
654
654
  }
655
655
  function e() {
656
656
  return null;
657
657
  }
658
658
  return p(e, "fallbackValue"), e;
659
659
  }
660
- p(Fe, "lookupGetter");
661
- function or(a) {
660
+ p(je, "lookupGetter");
661
+ function cr(a) {
662
662
  try {
663
- return Y(a, ""), !0;
663
+ return V(a, ""), !0;
664
664
  } catch {
665
665
  return !1;
666
666
  }
667
667
  }
668
- p(or, "isRegex");
669
- const Gn = te(["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"]), qt = te(["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"]), Vt = te(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), cr = te(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Yt = te(["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"]), ur = te(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = te(["#text"]), Wn = te(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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"]), Zt = te(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = te(["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"]), xt = te(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), hr = oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm), pr = oe(/<%[\w\W]*|[\w\W]*%>/gm), dr = oe(/\$\{[\w\W]*/gm), fr = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), gr = oe(/^aria-[\-\w]+$/), cs = oe(
668
+ p(cr, "isRegex");
669
+ const Gn = Q(["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"]), Vt = Q(["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"]), Yt = Q(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ur = Q(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Zt = Q(["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"]), hr = Q(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = Q(["#text"]), Wn = Q(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "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"]), Xt = Q(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = Q(["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"]), wt = Q(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pr = le(/\{\{[\w\W]*|[\w\W]*\}\}/gm), dr = le(/<%[\w\W]*|[\w\W]*%>/gm), fr = le(/\$\{[\w\W]*/gm), gr = le(/^data-[\-\w.\u00B7-\uFFFF]+$/), mr = le(/^aria-[\-\w]+$/), us = le(
670
670
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
671
671
  // eslint-disable-line no-useless-escape
672
- ), mr = oe(/^(?:\w+script|data):/i), br = oe(
672
+ ), xr = le(/^(?:\w+script|data):/i), br = le(
673
673
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
674
674
  // eslint-disable-line no-control-regex
675
- ), us = oe(/^html$/i), xr = oe(/^[a-z][.\w]*(-[.\w]+)+$/i);
675
+ ), hs = le(/^html$/i), kr = le(/^[a-z][.\w]*(-[.\w]+)+$/i);
676
676
  var Vn = /* @__PURE__ */ Object.freeze({
677
677
  __proto__: null,
678
- ARIA_ATTR: gr,
678
+ ARIA_ATTR: mr,
679
679
  ATTR_WHITESPACE: br,
680
- CUSTOM_ELEMENT: xr,
681
- DATA_ATTR: fr,
682
- DOCTYPE_NAME: us,
683
- ERB_EXPR: pr,
684
- IS_ALLOWED_URI: cs,
685
- IS_SCRIPT_OR_DATA: mr,
686
- MUSTACHE_EXPR: hr,
687
- TMPLIT_EXPR: dr
680
+ CUSTOM_ELEMENT: kr,
681
+ DATA_ATTR: gr,
682
+ DOCTYPE_NAME: hs,
683
+ ERB_EXPR: dr,
684
+ IS_ALLOWED_URI: us,
685
+ IS_SCRIPT_OR_DATA: xr,
686
+ MUSTACHE_EXPR: pr,
687
+ TMPLIT_EXPR: fr
688
688
  });
689
- const rt = {
689
+ const at = {
690
690
  element: 1,
691
691
  text: 3,
692
692
  // Deprecated
693
693
  progressingInstruction: 7,
694
694
  comment: 8,
695
695
  document: 9
696
- }, kr = /* @__PURE__ */ p(function() {
696
+ }, wr = /* @__PURE__ */ p(function() {
697
697
  return typeof window > "u" ? null : window;
698
- }, "getGlobal"), wr = /* @__PURE__ */ p(function(t, e) {
698
+ }, "getGlobal"), vr = /* @__PURE__ */ p(function(t, e) {
699
699
  if (typeof t != "object" || typeof t.createPolicy != "function")
700
700
  return null;
701
701
  let n = null;
@@ -727,10 +727,10 @@ const rt = {
727
727
  uponSanitizeShadowNode: []
728
728
  };
729
729
  }, "_createHooksMap");
730
- function hs() {
731
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : kr();
732
- const t = /* @__PURE__ */ p((S) => hs(S), "DOMPurify");
733
- if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== rt.document || !a.Element)
730
+ function ps() {
731
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wr();
732
+ const t = /* @__PURE__ */ p((S) => ps(S), "DOMPurify");
733
+ if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== at.document || !a.Element)
734
734
  return t.isSupported = !1, t;
735
735
  let {
736
736
  document: e
@@ -741,43 +741,43 @@ function hs() {
741
741
  Node: o,
742
742
  Element: d,
743
743
  NodeFilter: c,
744
- NamedNodeMap: b = a.NamedNodeMap || a.MozNamedAttrMap,
744
+ NamedNodeMap: x = a.NamedNodeMap || a.MozNamedAttrMap,
745
745
  HTMLFormElement: u,
746
- DOMParser: m,
747
- trustedTypes: f
748
- } = a, w = d.prototype, _ = Fe(w, "cloneNode"), O = Fe(w, "remove"), ie = Fe(w, "nextSibling"), be = Fe(w, "childNodes"), G = Fe(w, "parentNode");
746
+ DOMParser: g,
747
+ trustedTypes: m
748
+ } = a, w = d.prototype, _ = je(w, "cloneNode"), z = je(w, "remove"), te = je(w, "nextSibling"), oe = je(w, "childNodes"), se = je(w, "parentNode");
749
749
  if (typeof l == "function") {
750
750
  const S = e.createElement("template");
751
751
  S.content && S.content.ownerDocument && (e = S.content.ownerDocument);
752
752
  }
753
- let P, de = "";
753
+ let O, ce = "";
754
754
  const {
755
- implementation: ae,
756
- createNodeIterator: Q,
757
- createDocumentFragment: _t,
758
- getElementsByTagName: ut
755
+ implementation: re,
756
+ createNodeIterator: ie,
757
+ createDocumentFragment: Ee,
758
+ getElementsByTagName: Ct
759
759
  } = e, {
760
- importNode: C
760
+ importNode: pt
761
761
  } = n;
762
- let q = Yn();
763
- t.isSupported = typeof os == "function" && typeof G == "function" && ae && ae.createHTMLDocument !== void 0;
762
+ let A = Yn();
763
+ t.isSupported = typeof cs == "function" && typeof se == "function" && re && re.createHTMLDocument !== void 0;
764
764
  const {
765
- MUSTACHE_EXPR: we,
766
- ERB_EXPR: Oe,
767
- TMPLIT_EXPR: ve,
768
- DATA_ATTR: Rt,
769
- ARIA_ATTR: Ct,
770
- IS_SCRIPT_OR_DATA: It,
771
- ATTR_WHITESPACE: ht,
772
- CUSTOM_ELEMENT: Dt
765
+ MUSTACHE_EXPR: _e,
766
+ ERB_EXPR: we,
767
+ TMPLIT_EXPR: Oe,
768
+ DATA_ATTR: Ke,
769
+ ARIA_ATTR: It,
770
+ IS_SCRIPT_OR_DATA: Dt,
771
+ ATTR_WHITESPACE: dt,
772
+ CUSTOM_ELEMENT: Mt
773
773
  } = Vn;
774
774
  let {
775
- IS_ALLOWED_URI: pt
776
- } = Vn, U = null;
777
- const Ye = R({}, [...Gn, ...qt, ...Vt, ...Yt, ...jn]);
778
- let A = null;
779
- const k = R({}, [...Wn, ...Zt, ...qn, ...xt]);
780
- let g = Object.seal(Be(null, {
775
+ IS_ALLOWED_URI: ft
776
+ } = Vn, F = null;
777
+ const Qe = R({}, [...Gn, ...Vt, ...Yt, ...Zt, ...jn]);
778
+ let H = null;
779
+ const C = R({}, [...Wn, ...Xt, ...qn, ...wt]);
780
+ let f = Object.seal(Ge(null, {
781
781
  tagNameCheck: {
782
782
  writable: !0,
783
783
  configurable: !1,
@@ -796,8 +796,8 @@ function hs() {
796
796
  enumerable: !0,
797
797
  value: !1
798
798
  }
799
- })), M = null, j = null;
800
- const J = Object.seal(Be(null, {
799
+ })), k = null, M = null;
800
+ const N = Object.seal(Ge(null, {
801
801
  tagCheck: {
802
802
  writable: !0,
803
803
  configurable: !1,
@@ -811,72 +811,72 @@ function hs() {
811
811
  value: null
812
812
  }
813
813
  }));
814
- let Ze = !0, _e = !0, pn = !1, dn = !0, Re = !1, Xe = !0, Ce = !1, Mt = !1, Lt = !1, ze = !1, dt = !1, ft = !1, fn = !0, gn = !1;
814
+ let xe = !0, ze = !0, Pe = !1, dn = !0, Re = !1, Je = !0, Ce = !1, Lt = !1, Ot = !1, Ne = !1, gt = !1, mt = !1, fn = !0, gn = !1;
815
815
  const mn = "user-content-";
816
- let Ot = !0, Ke = !1, Pe = {}, fe = null;
817
- const zt = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
818
- let bn = null;
819
- const xn = R({}, ["audio", "video", "img", "source", "image", "track"]);
820
- let Pt = null;
821
- const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), gt = "http://www.w3.org/1998/Math/MathML", mt = "http://www.w3.org/2000/svg", ge = "http://www.w3.org/1999/xhtml";
822
- let Ne = ge, Nt = !1, $t = null;
823
- const ys = R({}, [gt, mt, ge], Wt);
824
- let Ut = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Bt = R({}, ["annotation-xml"]);
825
- const Ts = R({}, ["title", "style", "font", "a", "script"]);
826
- let Qe = null;
827
- const Ss = ["application/xhtml+xml", "text/html"], As = "text/html";
828
- let W = null, $e = null;
829
- const Es = e.createElement("form"), wn = /* @__PURE__ */ p(function(i) {
816
+ let zt = !0, et = !1, $e = {}, fe = null;
817
+ const Pt = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
818
+ let xn = null;
819
+ const bn = R({}, ["audio", "video", "img", "source", "image", "track"]);
820
+ let Nt = null;
821
+ const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), xt = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", ge = "http://www.w3.org/1999/xhtml";
822
+ let Ue = ge, $t = !1, Ut = null;
823
+ const Ts = R({}, [xt, bt, ge], qt);
824
+ let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = R({}, ["annotation-xml"]);
825
+ const Ss = R({}, ["title", "style", "font", "a", "script"]);
826
+ let tt = null;
827
+ const As = ["application/xhtml+xml", "text/html"], Es = "text/html";
828
+ let W = null, Be = null;
829
+ const _s = e.createElement("form"), wn = /* @__PURE__ */ p(function(i) {
830
830
  return i instanceof RegExp || i instanceof Function;
831
- }, "isRegexOrFunction"), Ft = /* @__PURE__ */ p(function() {
831
+ }, "isRegexOrFunction"), Ht = /* @__PURE__ */ p(function() {
832
832
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
833
- if ($e && $e === i)
833
+ if (Be && Be === i)
834
834
  return;
835
- (!i || typeof i != "object") && (i = {}), i = se(i), Qe = // eslint-disable-next-line unicorn/prefer-includes
836
- Ss.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? As : i.PARSER_MEDIA_TYPE, W = Qe === "application/xhtml+xml" ? Wt : lt, U = N(i, "ALLOWED_TAGS") && ee(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, W) : Ye, A = N(i, "ALLOWED_ATTR") && ee(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, W) : k, $t = N(i, "ALLOWED_NAMESPACES") && ee(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Wt) : ys, Pt = N(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) ? R(se(kn), i.ADD_URI_SAFE_ATTR, W) : kn, bn = N(i, "ADD_DATA_URI_TAGS") && ee(i.ADD_DATA_URI_TAGS) ? R(se(xn), i.ADD_DATA_URI_TAGS, W) : xn, fe = N(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, W) : zt, M = N(i, "FORBID_TAGS") && ee(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, W) : se({}), j = N(i, "FORBID_ATTR") && ee(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, W) : se({}), Pe = N(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? se(i.USE_PROFILES) : i.USE_PROFILES : !1, Ze = i.ALLOW_ARIA_ATTR !== !1, _e = i.ALLOW_DATA_ATTR !== !1, pn = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Re = i.SAFE_FOR_TEMPLATES || !1, Xe = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, ze = i.RETURN_DOM || !1, dt = i.RETURN_DOM_FRAGMENT || !1, ft = i.RETURN_TRUSTED_TYPE || !1, Lt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Ot = i.KEEP_CONTENT !== !1, Ke = i.IN_PLACE || !1, pt = or(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : cs, Ne = typeof i.NAMESPACE == "string" ? i.NAMESPACE : ge, Ut = N(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? se(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Bt = N(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? se(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
837
- const h = N(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? se(i.CUSTOM_ELEMENT_HANDLING) : Be(null);
838
- if (g = Be(null), N(h, "tagNameCheck") && wn(h.tagNameCheck) && (g.tagNameCheck = h.tagNameCheck), N(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (g.attributeNameCheck = h.attributeNameCheck), N(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (g.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Re && (_e = !1), dt && (ze = !0), Pe && (U = R({}, jn), A = Be(null), Pe.html === !0 && (R(U, Gn), R(A, Wn)), Pe.svg === !0 && (R(U, qt), R(A, Zt), R(A, xt)), Pe.svgFilters === !0 && (R(U, Vt), R(A, Zt), R(A, xt)), Pe.mathMl === !0 && (R(U, Yt), R(A, qn), R(A, xt))), J.tagCheck = null, J.attributeCheck = null, N(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? J.tagCheck = i.ADD_TAGS : ee(i.ADD_TAGS) && (U === Ye && (U = se(U)), R(U, i.ADD_TAGS, W))), N(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? J.attributeCheck = i.ADD_ATTR : ee(i.ADD_ATTR) && (A === k && (A = se(A)), R(A, i.ADD_ATTR, W))), N(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, W), N(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) && (fe === zt && (fe = se(fe)), R(fe, i.FORBID_CONTENTS, W)), N(i, "ADD_FORBID_CONTENTS") && ee(i.ADD_FORBID_CONTENTS) && (fe === zt && (fe = se(fe)), R(fe, i.ADD_FORBID_CONTENTS, W)), Ot && (U["#text"] = !0), Ce && R(U, ["html", "head", "body"]), U.table && (R(U, ["tbody"]), delete M.tbody), i.TRUSTED_TYPES_POLICY) {
835
+ (!i || typeof i != "object") && (i = {}), i = ee(i), tt = // eslint-disable-next-line unicorn/prefer-includes
836
+ As.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Es : i.PARSER_MEDIA_TYPE, W = tt === "application/xhtml+xml" ? qt : ct, F = $(i, "ALLOWED_TAGS") && K(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, W) : Qe, H = $(i, "ALLOWED_ATTR") && K(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, W) : C, Ut = $(i, "ALLOWED_NAMESPACES") && K(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : Ts, Nt = $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) ? R(ee(kn), i.ADD_URI_SAFE_ATTR, W) : kn, xn = $(i, "ADD_DATA_URI_TAGS") && K(i.ADD_DATA_URI_TAGS) ? R(ee(bn), i.ADD_DATA_URI_TAGS, W) : bn, fe = $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, W) : Pt, k = $(i, "FORBID_TAGS") && K(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, W) : ee({}), M = $(i, "FORBID_ATTR") && K(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, W) : ee({}), $e = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? ee(i.USE_PROFILES) : i.USE_PROFILES : !1, xe = i.ALLOW_ARIA_ATTR !== !1, ze = i.ALLOW_DATA_ATTR !== !1, Pe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Re = i.SAFE_FOR_TEMPLATES || !1, Je = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, Ne = i.RETURN_DOM || !1, gt = i.RETURN_DOM_FRAGMENT || !1, mt = i.RETURN_TRUSTED_TYPE || !1, Ot = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, zt = i.KEEP_CONTENT !== !1, et = i.IN_PLACE || !1, ft = cr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : us, Ue = typeof i.NAMESPACE == "string" ? i.NAMESPACE : ge, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ee(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? ee(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
837
+ const h = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? ee(i.CUSTOM_ELEMENT_HANDLING) : Ge(null);
838
+ if (f = Ge(null), $(h, "tagNameCheck") && wn(h.tagNameCheck) && (f.tagNameCheck = h.tagNameCheck), $(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (f.attributeNameCheck = h.attributeNameCheck), $(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Re && (ze = !1), gt && (Ne = !0), $e && (F = R({}, jn), H = Ge(null), $e.html === !0 && (R(F, Gn), R(H, Wn)), $e.svg === !0 && (R(F, Vt), R(H, Xt), R(H, wt)), $e.svgFilters === !0 && (R(F, Yt), R(H, Xt), R(H, wt)), $e.mathMl === !0 && (R(F, Zt), R(H, qn), R(H, wt))), N.tagCheck = null, N.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? N.tagCheck = i.ADD_TAGS : K(i.ADD_TAGS) && (F === Qe && (F = ee(F)), R(F, i.ADD_TAGS, W))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? N.attributeCheck = i.ADD_ATTR : K(i.ADD_ATTR) && (H === C && (H = ee(H)), R(H, i.ADD_ATTR, W))), $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) && R(Nt, i.ADD_URI_SAFE_ATTR, W), $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.FORBID_CONTENTS, W)), $(i, "ADD_FORBID_CONTENTS") && K(i.ADD_FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.ADD_FORBID_CONTENTS, W)), zt && (F["#text"] = !0), Ce && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete k.tbody), i.TRUSTED_TYPES_POLICY) {
839
839
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
840
- throw bt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
840
+ throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
841
841
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
842
- throw bt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
843
- P = i.TRUSTED_TYPES_POLICY, de = P.createHTML("");
842
+ throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
843
+ O = i.TRUSTED_TYPES_POLICY, ce = O.createHTML("");
844
844
  } else
845
- P === void 0 && (P = wr(f, r)), P !== null && typeof de == "string" && (de = P.createHTML(""));
846
- te && te(i), $e = i;
847
- }, "_parseConfig"), vn = R({}, [...qt, ...Vt, ...cr]), yn = R({}, [...Yt, ...ur]), _s = /* @__PURE__ */ p(function(i) {
848
- let h = G(i);
845
+ O === void 0 && (O = vr(m, r)), O !== null && typeof ce == "string" && (ce = O.createHTML(""));
846
+ Q && Q(i), Be = i;
847
+ }, "_parseConfig"), vn = R({}, [...Vt, ...Yt, ...ur]), yn = R({}, [...Zt, ...hr]), Rs = /* @__PURE__ */ p(function(i) {
848
+ let h = se(i);
849
849
  (!h || !h.tagName) && (h = {
850
- namespaceURI: Ne,
850
+ namespaceURI: Ue,
851
851
  tagName: "template"
852
852
  });
853
- const x = lt(i.tagName), z = lt(h.tagName);
854
- return $t[i.namespaceURI] ? i.namespaceURI === mt ? h.namespaceURI === ge ? x === "svg" : h.namespaceURI === gt ? x === "svg" && (z === "annotation-xml" || Ut[z]) : !!vn[x] : i.namespaceURI === gt ? h.namespaceURI === ge ? x === "math" : h.namespaceURI === mt ? x === "math" && Bt[z] : !!yn[x] : i.namespaceURI === ge ? h.namespaceURI === mt && !Bt[z] || h.namespaceURI === gt && !Ut[z] ? !1 : !yn[x] && (Ts[x] || !vn[x]) : !!(Qe === "application/xhtml+xml" && $t[i.namespaceURI]) : !1;
855
- }, "_checkValidNamespace"), ce = /* @__PURE__ */ p(function(i) {
856
- nt(t.removed, {
853
+ const b = ct(i.tagName), P = ct(h.tagName);
854
+ return Ut[i.namespaceURI] ? i.namespaceURI === bt ? h.namespaceURI === ge ? b === "svg" : h.namespaceURI === xt ? b === "svg" && (P === "annotation-xml" || Bt[P]) : !!vn[b] : i.namespaceURI === xt ? h.namespaceURI === ge ? b === "math" : h.namespaceURI === bt ? b === "math" && Ft[P] : !!yn[b] : i.namespaceURI === ge ? h.namespaceURI === bt && !Ft[P] || h.namespaceURI === xt && !Bt[P] ? !1 : !yn[b] && (Ss[b] || !vn[b]) : !!(tt === "application/xhtml+xml" && Ut[i.namespaceURI]) : !1;
855
+ }, "_checkValidNamespace"), ue = /* @__PURE__ */ p(function(i) {
856
+ rt(t.removed, {
857
857
  element: i
858
858
  });
859
859
  try {
860
- G(i).removeChild(i);
860
+ se(i).removeChild(i);
861
861
  } catch {
862
- O(i);
862
+ z(i);
863
863
  }
864
864
  }, "_forceRemove"), Ie = /* @__PURE__ */ p(function(i, h) {
865
865
  try {
866
- nt(t.removed, {
866
+ rt(t.removed, {
867
867
  attribute: h.getAttributeNode(i),
868
868
  from: h
869
869
  });
870
870
  } catch {
871
- nt(t.removed, {
871
+ rt(t.removed, {
872
872
  attribute: null,
873
873
  from: h
874
874
  });
875
875
  }
876
876
  if (h.removeAttribute(i), i === "is")
877
- if (ze || dt)
877
+ if (Ne || gt)
878
878
  try {
879
- ce(h);
879
+ ue(h);
880
880
  } catch {
881
881
  }
882
882
  else
@@ -885,98 +885,98 @@ function hs() {
885
885
  } catch {
886
886
  }
887
887
  }, "_removeAttribute"), Tn = /* @__PURE__ */ p(function(i) {
888
- let h = null, x = null;
889
- if (Lt)
888
+ let h = null, b = null;
889
+ if (Ot)
890
890
  i = "<remove></remove>" + i;
891
891
  else {
892
- const F = Un(i, /^[\r\n\t ]+/);
893
- x = F && F[0];
892
+ const G = Un(i, /^[\r\n\t ]+/);
893
+ b = G && G[0];
894
894
  }
895
- Qe === "application/xhtml+xml" && Ne === ge && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
896
- const z = P ? P.createHTML(i) : i;
897
- if (Ne === ge)
895
+ tt === "application/xhtml+xml" && Ue === ge && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
896
+ const P = O ? O.createHTML(i) : i;
897
+ if (Ue === ge)
898
898
  try {
899
- h = new m().parseFromString(z, Qe);
899
+ h = new g().parseFromString(P, tt);
900
900
  } catch {
901
901
  }
902
902
  if (!h || !h.documentElement) {
903
- h = ae.createDocument(Ne, "template", null);
903
+ h = re.createDocument(Ue, "template", null);
904
904
  try {
905
- h.documentElement.innerHTML = Nt ? de : z;
905
+ h.documentElement.innerHTML = $t ? ce : P;
906
906
  } catch {
907
907
  }
908
908
  }
909
- const X = h.body || h.documentElement;
910
- return i && x && X.insertBefore(e.createTextNode(x), X.childNodes[0] || null), Ne === ge ? ut.call(h, Ce ? "html" : "body")[0] : Ce ? h.documentElement : X;
909
+ const Z = h.body || h.documentElement;
910
+ return i && b && Z.insertBefore(e.createTextNode(b), Z.childNodes[0] || null), Ue === ge ? Ct.call(h, Ce ? "html" : "body")[0] : Ce ? h.documentElement : Z;
911
911
  }, "_initDocument"), Sn = /* @__PURE__ */ p(function(i) {
912
- return Q.call(
912
+ return ie.call(
913
913
  i.ownerDocument || i,
914
914
  i,
915
915
  // eslint-disable-next-line no-bitwise
916
916
  c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
917
917
  null
918
918
  );
919
- }, "_createNodeIterator"), Ht = /* @__PURE__ */ p(function(i) {
920
- return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof b) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
921
- }, "_isClobbered"), Gt = /* @__PURE__ */ p(function(i) {
919
+ }, "_createNodeIterator"), Gt = /* @__PURE__ */ p(function(i) {
920
+ return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof x) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
921
+ }, "_isClobbered"), jt = /* @__PURE__ */ p(function(i) {
922
922
  return typeof o == "function" && i instanceof o;
923
923
  }, "_isNode");
924
- function xe(S, i, h) {
925
- tt(S, (x) => {
926
- x.call(t, i, h, $e);
924
+ function be(S, i, h) {
925
+ st(S, (b) => {
926
+ b.call(t, i, h, Be);
927
927
  });
928
928
  }
929
- p(xe, "_executeHooks");
929
+ p(be, "_executeHooks");
930
930
  const An = /* @__PURE__ */ p(function(i) {
931
931
  let h = null;
932
- if (xe(q.beforeSanitizeElements, i, null), Ht(i))
933
- return ce(i), !0;
934
- const x = W(i.nodeName);
935
- if (xe(q.uponSanitizeElement, i, {
936
- tagName: x,
937
- allowedTags: U
938
- }), Xe && i.hasChildNodes() && !Gt(i.firstElementChild) && Y(/<[/\w!]/g, i.innerHTML) && Y(/<[/\w!]/g, i.textContent) || Xe && i.namespaceURI === ge && x === "style" && Gt(i.firstElementChild) || i.nodeType === rt.progressingInstruction || Xe && i.nodeType === rt.comment && Y(/<[/\w]/g, i.data))
939
- return ce(i), !0;
940
- if (M[x] || !(J.tagCheck instanceof Function && J.tagCheck(x)) && !U[x]) {
941
- if (!M[x] && _n(x) && (g.tagNameCheck instanceof RegExp && Y(g.tagNameCheck, x) || g.tagNameCheck instanceof Function && g.tagNameCheck(x)))
932
+ if (be(A.beforeSanitizeElements, i, null), Gt(i))
933
+ return ue(i), !0;
934
+ const b = W(i.nodeName);
935
+ if (be(A.uponSanitizeElement, i, {
936
+ tagName: b,
937
+ allowedTags: F
938
+ }), Je && i.hasChildNodes() && !jt(i.firstElementChild) && V(/<[/\w!]/g, i.innerHTML) && V(/<[/\w!]/g, i.textContent) || Je && i.namespaceURI === ge && b === "style" && jt(i.firstElementChild) || i.nodeType === at.progressingInstruction || Je && i.nodeType === at.comment && V(/<[/\w]/g, i.data))
939
+ return ue(i), !0;
940
+ if (k[b] || !(N.tagCheck instanceof Function && N.tagCheck(b)) && !F[b]) {
941
+ if (!k[b] && _n(b) && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, b) || f.tagNameCheck instanceof Function && f.tagNameCheck(b)))
942
942
  return !1;
943
- if (Ot && !fe[x]) {
944
- const z = G(i) || i.parentNode, X = be(i) || i.childNodes;
945
- if (X && z) {
946
- const F = X.length;
947
- for (let ne = F - 1; ne >= 0; --ne) {
948
- const le = _(X[ne], !0);
949
- z.insertBefore(le, ie(i));
943
+ if (zt && !fe[b]) {
944
+ const P = se(i) || i.parentNode, Z = oe(i) || i.childNodes;
945
+ if (Z && P) {
946
+ const G = Z.length;
947
+ for (let J = G - 1; J >= 0; --J) {
948
+ const ae = _(Z[J], !0);
949
+ P.insertBefore(ae, te(i));
950
950
  }
951
951
  }
952
952
  }
953
- return ce(i), !0;
953
+ return ue(i), !0;
954
954
  }
955
- return i instanceof d && !_s(i) || (x === "noscript" || x === "noembed" || x === "noframes") && Y(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ce(i), !0) : (Re && i.nodeType === rt.text && (h = i.textContent, tt([we, Oe, ve], (z) => {
956
- h = Ue(h, z, " ");
957
- }), i.textContent !== h && (nt(t.removed, {
955
+ return i instanceof d && !Rs(i) || (b === "noscript" || b === "noembed" || b === "noframes") && V(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ue(i), !0) : (Re && i.nodeType === at.text && (h = i.textContent, st([_e, we, Oe], (P) => {
956
+ h = He(h, P, " ");
957
+ }), i.textContent !== h && (rt(t.removed, {
958
958
  element: i.cloneNode()
959
- }), i.textContent = h)), xe(q.afterSanitizeElements, i, null), !1);
960
- }, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, h, x) {
961
- if (j[h] || fn && (h === "id" || h === "name") && (x in e || x in Es))
959
+ }), i.textContent = h)), be(A.afterSanitizeElements, i, null), !1);
960
+ }, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, h, b) {
961
+ if (M[h] || fn && (h === "id" || h === "name") && (b in e || b in _s))
962
962
  return !1;
963
- if (!(_e && !j[h] && Y(Rt, h))) {
964
- if (!(Ze && Y(Ct, h))) {
965
- if (!(J.attributeCheck instanceof Function && J.attributeCheck(h, i))) {
966
- if (!A[h] || j[h]) {
963
+ if (!(ze && !M[h] && V(Ke, h))) {
964
+ if (!(xe && V(It, h))) {
965
+ if (!(N.attributeCheck instanceof Function && N.attributeCheck(h, i))) {
966
+ if (!H[h] || M[h]) {
967
967
  if (
968
968
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
969
969
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
970
970
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
971
- !(_n(i) && (g.tagNameCheck instanceof RegExp && Y(g.tagNameCheck, i) || g.tagNameCheck instanceof Function && g.tagNameCheck(i)) && (g.attributeNameCheck instanceof RegExp && Y(g.attributeNameCheck, h) || g.attributeNameCheck instanceof Function && g.attributeNameCheck(h, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
971
+ !(_n(i) && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)) && (f.attributeNameCheck instanceof RegExp && V(f.attributeNameCheck, h) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(h, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
972
972
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
973
- h === "is" && g.allowCustomizedBuiltInElements && (g.tagNameCheck instanceof RegExp && Y(g.tagNameCheck, x) || g.tagNameCheck instanceof Function && g.tagNameCheck(x)))
973
+ h === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, b) || f.tagNameCheck instanceof Function && f.tagNameCheck(b)))
974
974
  ) return !1;
975
- } else if (!Pt[h]) {
976
- if (!Y(pt, Ue(x, ht, ""))) {
977
- if (!((h === "src" || h === "xlink:href" || h === "href") && i !== "script" && Bn(x, "data:") === 0 && bn[i])) {
978
- if (!(pn && !Y(It, Ue(x, ht, "")))) {
979
- if (x)
975
+ } else if (!Nt[h]) {
976
+ if (!V(ft, He(b, dt, ""))) {
977
+ if (!((h === "src" || h === "xlink:href" || h === "href") && i !== "script" && Bn(b, "data:") === 0 && xn[i])) {
978
+ if (!(Pe && !V(Dt, He(b, dt, "")))) {
979
+ if (b)
980
980
  return !1;
981
981
  }
982
982
  }
@@ -986,191 +986,191 @@ function hs() {
986
986
  }
987
987
  }
988
988
  return !0;
989
- }, "_isValidAttribute"), Rs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ p(function(i) {
990
- return !Rs[lt(i)] && Y(Dt, i);
989
+ }, "_isValidAttribute"), Cs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ p(function(i) {
990
+ return !Cs[ct(i)] && V(Mt, i);
991
991
  }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ p(function(i) {
992
- xe(q.beforeSanitizeAttributes, i, null);
992
+ be(A.beforeSanitizeAttributes, i, null);
993
993
  const {
994
994
  attributes: h
995
995
  } = i;
996
- if (!h || Ht(i))
996
+ if (!h || Gt(i))
997
997
  return;
998
- const x = {
998
+ const b = {
999
999
  attrName: "",
1000
1000
  attrValue: "",
1001
1001
  keepAttr: !0,
1002
- allowedAttributes: A,
1002
+ allowedAttributes: H,
1003
1003
  forceKeepAttr: void 0
1004
1004
  };
1005
- let z = h.length;
1006
- for (; z--; ) {
1007
- const X = h[z], {
1008
- name: F,
1009
- namespaceURI: ne,
1010
- value: le
1011
- } = X, ue = W(F), jt = le;
1012
- let V = F === "value" ? jt : nr(jt);
1013
- if (x.attrName = ue, x.attrValue = V, x.keepAttr = !0, x.forceKeepAttr = void 0, xe(q.uponSanitizeAttribute, i, x), V = x.attrValue, gn && (ue === "id" || ue === "name") && Bn(V, mn) !== 0 && (Ie(F, i), V = mn + V), Xe && Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
1014
- Ie(F, i);
1005
+ let P = h.length;
1006
+ for (; P--; ) {
1007
+ const Z = h[P], {
1008
+ name: G,
1009
+ namespaceURI: J,
1010
+ value: ae
1011
+ } = Z, he = W(G), Wt = ae;
1012
+ let q = G === "value" ? Wt : sr(Wt);
1013
+ if (b.attrName = he, b.attrValue = q, b.keepAttr = !0, b.forceKeepAttr = void 0, be(A.uponSanitizeAttribute, i, b), q = b.attrValue, gn && (he === "id" || he === "name") && Bn(q, mn) !== 0 && (Ie(G, i), q = mn + q), Je && V(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, q)) {
1014
+ Ie(G, i);
1015
1015
  continue;
1016
1016
  }
1017
- if (ue === "attributename" && Un(V, "href")) {
1018
- Ie(F, i);
1017
+ if (he === "attributename" && Un(q, "href")) {
1018
+ Ie(G, i);
1019
1019
  continue;
1020
1020
  }
1021
- if (x.forceKeepAttr)
1021
+ if (b.forceKeepAttr)
1022
1022
  continue;
1023
- if (!x.keepAttr) {
1024
- Ie(F, i);
1023
+ if (!b.keepAttr) {
1024
+ Ie(G, i);
1025
1025
  continue;
1026
1026
  }
1027
- if (!dn && Y(/\/>/i, V)) {
1028
- Ie(F, i);
1027
+ if (!dn && V(/\/>/i, q)) {
1028
+ Ie(G, i);
1029
1029
  continue;
1030
1030
  }
1031
- Re && tt([we, Oe, ve], (Dn) => {
1032
- V = Ue(V, Dn, " ");
1031
+ Re && st([_e, we, Oe], (Dn) => {
1032
+ q = He(q, Dn, " ");
1033
1033
  });
1034
1034
  const In = W(i.nodeName);
1035
- if (!En(In, ue, V)) {
1036
- Ie(F, i);
1035
+ if (!En(In, he, q)) {
1036
+ Ie(G, i);
1037
1037
  continue;
1038
1038
  }
1039
- if (P && typeof f == "object" && typeof f.getAttributeType == "function" && !ne)
1040
- switch (f.getAttributeType(In, ue)) {
1039
+ if (O && typeof m == "object" && typeof m.getAttributeType == "function" && !J)
1040
+ switch (m.getAttributeType(In, he)) {
1041
1041
  case "TrustedHTML": {
1042
- V = P.createHTML(V);
1042
+ q = O.createHTML(q);
1043
1043
  break;
1044
1044
  }
1045
1045
  case "TrustedScriptURL": {
1046
- V = P.createScriptURL(V);
1046
+ q = O.createScriptURL(q);
1047
1047
  break;
1048
1048
  }
1049
1049
  }
1050
- if (V !== jt)
1050
+ if (q !== Wt)
1051
1051
  try {
1052
- ne ? i.setAttributeNS(ne, F, V) : i.setAttribute(F, V), Ht(i) ? ce(i) : $n(t.removed);
1052
+ J ? i.setAttributeNS(J, G, q) : i.setAttribute(G, q), Gt(i) ? ue(i) : $n(t.removed);
1053
1053
  } catch {
1054
- Ie(F, i);
1054
+ Ie(G, i);
1055
1055
  }
1056
1056
  }
1057
- xe(q.afterSanitizeAttributes, i, null);
1057
+ be(A.afterSanitizeAttributes, i, null);
1058
1058
  }, "_sanitizeAttributes"), Cn = /* @__PURE__ */ p(function(i) {
1059
1059
  let h = null;
1060
- const x = Sn(i);
1061
- for (xe(q.beforeSanitizeShadowDOM, i, null); h = x.nextNode(); )
1062
- xe(q.uponSanitizeShadowNode, h, null), An(h), Rn(h), h.content instanceof s && Cn(h.content);
1063
- xe(q.afterSanitizeShadowDOM, i, null);
1060
+ const b = Sn(i);
1061
+ for (be(A.beforeSanitizeShadowDOM, i, null); h = b.nextNode(); )
1062
+ be(A.uponSanitizeShadowNode, h, null), An(h), Rn(h), h.content instanceof s && Cn(h.content);
1063
+ be(A.afterSanitizeShadowDOM, i, null);
1064
1064
  }, "_sanitizeShadowDOM");
1065
1065
  return t.sanitize = function(S) {
1066
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, x = null, z = null, X = null;
1067
- if (Nt = !S, Nt && (S = "<!-->"), typeof S != "string" && !Gt(S) && (S = lr(S), typeof S != "string"))
1068
- throw bt("dirty is not a string, aborting");
1066
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, b = null, P = null, Z = null;
1067
+ if ($t = !S, $t && (S = "<!-->"), typeof S != "string" && !jt(S) && (S = or(S), typeof S != "string"))
1068
+ throw kt("dirty is not a string, aborting");
1069
1069
  if (!t.isSupported)
1070
1070
  return S;
1071
- if (Mt || Ft(i), t.removed = [], typeof S == "string" && (Ke = !1), Ke) {
1072
- const le = S.nodeName;
1073
- if (typeof le == "string") {
1074
- const ue = W(le);
1075
- if (!U[ue] || M[ue])
1076
- throw bt("root node is forbidden and cannot be sanitized in-place");
1071
+ if (Lt || Ht(i), t.removed = [], typeof S == "string" && (et = !1), et) {
1072
+ const ae = S.nodeName;
1073
+ if (typeof ae == "string") {
1074
+ const he = W(ae);
1075
+ if (!F[he] || k[he])
1076
+ throw kt("root node is forbidden and cannot be sanitized in-place");
1077
1077
  }
1078
1078
  } else if (S instanceof o)
1079
- h = Tn("<!---->"), x = h.ownerDocument.importNode(S, !0), x.nodeType === rt.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? h = x : h.appendChild(x);
1079
+ h = Tn("<!---->"), b = h.ownerDocument.importNode(S, !0), b.nodeType === at.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? h = b : h.appendChild(b);
1080
1080
  else {
1081
- if (!ze && !Re && !Ce && // eslint-disable-next-line unicorn/prefer-includes
1081
+ if (!Ne && !Re && !Ce && // eslint-disable-next-line unicorn/prefer-includes
1082
1082
  S.indexOf("<") === -1)
1083
- return P && ft ? P.createHTML(S) : S;
1083
+ return O && mt ? O.createHTML(S) : S;
1084
1084
  if (h = Tn(S), !h)
1085
- return ze ? null : ft ? de : "";
1085
+ return Ne ? null : mt ? ce : "";
1086
1086
  }
1087
- h && Lt && ce(h.firstChild);
1088
- const F = Sn(Ke ? S : h);
1089
- for (; z = F.nextNode(); )
1090
- An(z), Rn(z), z.content instanceof s && Cn(z.content);
1091
- if (Ke)
1087
+ h && Ot && ue(h.firstChild);
1088
+ const G = Sn(et ? S : h);
1089
+ for (; P = G.nextNode(); )
1090
+ An(P), Rn(P), P.content instanceof s && Cn(P.content);
1091
+ if (et)
1092
1092
  return S;
1093
- if (ze) {
1093
+ if (Ne) {
1094
1094
  if (Re) {
1095
1095
  h.normalize();
1096
- let le = h.innerHTML;
1097
- tt([we, Oe, ve], (ue) => {
1098
- le = Ue(le, ue, " ");
1099
- }), h.innerHTML = le;
1100
- }
1101
- if (dt)
1102
- for (X = _t.call(h.ownerDocument); h.firstChild; )
1103
- X.appendChild(h.firstChild);
1096
+ let ae = h.innerHTML;
1097
+ st([_e, we, Oe], (he) => {
1098
+ ae = He(ae, he, " ");
1099
+ }), h.innerHTML = ae;
1100
+ }
1101
+ if (gt)
1102
+ for (Z = Ee.call(h.ownerDocument); h.firstChild; )
1103
+ Z.appendChild(h.firstChild);
1104
1104
  else
1105
- X = h;
1106
- return (A.shadowroot || A.shadowrootmode) && (X = C.call(n, X, !0)), X;
1107
- }
1108
- let ne = Ce ? h.outerHTML : h.innerHTML;
1109
- return Ce && U["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && Y(us, h.ownerDocument.doctype.name) && (ne = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
1110
- ` + ne), Re && tt([we, Oe, ve], (le) => {
1111
- ne = Ue(ne, le, " ");
1112
- }), P && ft ? P.createHTML(ne) : ne;
1105
+ Z = h;
1106
+ return (H.shadowroot || H.shadowrootmode) && (Z = pt.call(n, Z, !0)), Z;
1107
+ }
1108
+ let J = Ce ? h.outerHTML : h.innerHTML;
1109
+ return Ce && F["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && V(hs, h.ownerDocument.doctype.name) && (J = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
1110
+ ` + J), Re && st([_e, we, Oe], (ae) => {
1111
+ J = He(J, ae, " ");
1112
+ }), O && mt ? O.createHTML(J) : J;
1113
1113
  }, t.setConfig = function() {
1114
1114
  let S = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1115
- Ft(S), Mt = !0;
1115
+ Ht(S), Lt = !0;
1116
1116
  }, t.clearConfig = function() {
1117
- $e = null, Mt = !1;
1117
+ Be = null, Lt = !1;
1118
1118
  }, t.isValidAttribute = function(S, i, h) {
1119
- $e || Ft({});
1120
- const x = W(S), z = W(i);
1121
- return En(x, z, h);
1119
+ Be || Ht({});
1120
+ const b = W(S), P = W(i);
1121
+ return En(b, P, h);
1122
1122
  }, t.addHook = function(S, i) {
1123
- typeof i == "function" && nt(q[S], i);
1123
+ typeof i == "function" && rt(A[S], i);
1124
1124
  }, t.removeHook = function(S, i) {
1125
1125
  if (i !== void 0) {
1126
- const h = er(q[S], i);
1127
- return h === -1 ? void 0 : tr(q[S], h, 1)[0];
1126
+ const h = tr(A[S], i);
1127
+ return h === -1 ? void 0 : nr(A[S], h, 1)[0];
1128
1128
  }
1129
- return $n(q[S]);
1129
+ return $n(A[S]);
1130
1130
  }, t.removeHooks = function(S) {
1131
- q[S] = [];
1131
+ A[S] = [];
1132
1132
  }, t.removeAllHooks = function() {
1133
- q = Yn();
1133
+ A = Yn();
1134
1134
  }, t;
1135
1135
  }
1136
- p(hs, "createDOMPurify");
1137
- var vr = hs();
1138
- function tn() {
1136
+ p(ps, "createDOMPurify");
1137
+ var yr = ps();
1138
+ function nn() {
1139
1139
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1140
1140
  }
1141
- p(tn, "z");
1142
- var Le = tn();
1143
- function ps(a) {
1141
+ p(nn, "z");
1142
+ var Le = nn();
1143
+ function ds(a) {
1144
1144
  Le = a;
1145
1145
  }
1146
- p(ps, "G");
1146
+ p(ds, "G");
1147
1147
  var De = { exec: /* @__PURE__ */ p(() => null, "exec") };
1148
1148
  function D(a, t = "") {
1149
1149
  let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((r, s) => {
1150
1150
  let l = typeof s == "string" ? s : s.source;
1151
- return l = l.replace(K.caret, "$1"), e = e.replace(r, l), n;
1151
+ return l = l.replace(X.caret, "$1"), e = e.replace(r, l), n;
1152
1152
  }, "replace"), getRegex: /* @__PURE__ */ p(() => new RegExp(e, t), "getRegex") };
1153
1153
  return n;
1154
1154
  }
1155
1155
  p(D, "k");
1156
- var yr = ((a = "") => {
1156
+ var Tr = ((a = "") => {
1157
1157
  try {
1158
1158
  return !!new RegExp("(?<=1)(?<!1)" + a);
1159
1159
  } catch {
1160
1160
  return !1;
1161
1161
  }
1162
- })(), K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Tr = /^(?:[ \t]*(?:\n|$))+/, Sr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ar = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ct = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Er = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, nn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ds = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, fs = D(ds).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(), _r = D(ds).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]+)*)/, Rr = /^[^\n]+/, rn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Cr = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", rn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ir = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, nn).getRegex(), At = "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", an = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Dr = D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", an).replace("tag", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), gs = D(sn).replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), Mr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", gs).getRegex(), ln = { blockquote: Mr, code: Sr, def: Cr, fences: Ar, heading: Er, hr: ct, html: Dr, lheading: fs, list: Ir, newline: Tr, paragraph: gs, table: De, text: Rr }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ct).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", At).getRegex(), Lr = { ...ln, lheading: _r, table: Zn, paragraph: D(sn).replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").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", At).getRegex() }, Or = { ...ln, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", an).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: De, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(sn).replace("hr", ct).replace("heading", ` *#{1,6} *[^
1163
- ]`).replace("lheading", fs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, zr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ms = /^( {2,}|\\)\n(?!\s*$)/, Nr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ve = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, on = /[^\s\p{P}\p{S}]/u, $r = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), bs = /(?!~)[\p{P}\p{S}]/u, Ur = /(?!~)[\s\p{P}\p{S}]/u, Br = /(?:[^\s\p{P}\p{S}]|~)/u, Fr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", yr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), xs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Hr = D(xs, "u").replace(/punct/g, Ve).getRegex(), Gr = D(xs, "u").replace(/punct/g, bs).getRegex(), ks = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", jr = D(ks, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Ve).getRegex(), Wr = D(ks, "gu").replace(/notPunctSpace/g, Br).replace(/punctSpace/g, Ur).replace(/punct/g, bs).getRegex(), qr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Ve).getRegex(), Vr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ve).getRegex(), Yr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Zr = D(Yr, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Ve).getRegex(), Xr = D(/\\(punct)/, "gu").replace(/punct/g, Ve).getRegex(), Kr = 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(), Qr = D(an).replace("(?:-->|$)", "-->").getRegex(), Jr = 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", Qr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ei = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ws = D(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", rn).getRegex(), vs = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", rn).getRegex(), ti = D("reflink|nolink(?!\\()", "g").replace("reflink", ws).replace("nolink", vs).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, cn = { _backpedal: De, anyPunctuation: Xr, autolink: Kr, blockSkip: Fr, br: ms, code: Pr, del: De, delLDelim: De, delRDelim: De, emStrongLDelim: Hr, emStrongRDelimAst: jr, emStrongRDelimUnd: qr, escape: zr, link: ei, nolink: vs, punctuation: $r, reflink: ws, reflinkSearch: ti, tag: Jr, text: Nr, url: De }, ni = { ...cn, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, Jt = { ...cn, emStrongRDelimAst: Wr, emStrongLDelim: Gr, delLDelim: Vr, delRDelim: Zr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, si = { ...Jt, br: D(ms).replace("{2,}", "*").getRegex(), text: D(Jt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, kt = { normal: ln, gfm: Lr, pedantic: Or }, it = { normal: cn, gfm: Jt, breaks: si, pedantic: ni }, ri = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ p((a) => ri[a], "de");
1162
+ })(), X = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Sr = /^(?:[ \t]*(?:\n|$))+/, Ar = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Er = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _r = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, fs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, gs = D(fs).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(), Rr = D(fs).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(), rn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Cr = /^[^\n]+/, an = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ir = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", an).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Dr = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, sn).getRegex(), _t = "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", ln = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Mr = D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ln).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ms = D(rn).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex(), Lr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ms).getRegex(), on = { blockquote: Lr, code: Ar, def: Ir, fences: Er, heading: _r, hr: ht, html: Mr, lheading: gs, list: Dr, newline: Sr, paragraph: ms, table: De, text: Cr }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).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", _t).getRegex(), Or = { ...on, lheading: Rr, table: Zn, paragraph: D(rn).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").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", _t).getRegex() }, zr = { ...on, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ln).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: De, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(rn).replace("hr", ht).replace("heading", ` *#{1,6} *[^
1163
+ ]`).replace("lheading", gs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Pr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Nr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, xs = /^( {2,}|\\)\n(?!\s*$)/, $r = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xe = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, cn = /[^\s\p{P}\p{S}]/u, Ur = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), bs = /(?!~)[\p{P}\p{S}]/u, Br = /(?!~)[\s\p{P}\p{S}]/u, Fr = /(?:[^\s\p{P}\p{S}]|~)/u, Hr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Tr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ks = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Gr = D(ks, "u").replace(/punct/g, Xe).getRegex(), jr = D(ks, "u").replace(/punct/g, bs).getRegex(), ws = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Wr = D(ws, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Rt).replace(/punct/g, Xe).getRegex(), qr = D(ws, "gu").replace(/notPunctSpace/g, Fr).replace(/punctSpace/g, Br).replace(/punct/g, bs).getRegex(), Vr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Rt).replace(/punct/g, Xe).getRegex(), Yr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Xe).getRegex(), Zr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Xr = D(Zr, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Rt).replace(/punct/g, Xe).getRegex(), Kr = D(/\\(punct)/, "gu").replace(/punct/g, Xe).getRegex(), Qr = 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(), Jr = D(ln).replace("(?:-->|$)", "-->").getRegex(), ei = 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", Jr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Tt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ti = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Tt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), vs = D(/^!?\[(label)\]\[(ref)\]/).replace("label", Tt).replace("ref", an).getRegex(), ys = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", an).getRegex(), ni = D("reflink|nolink(?!\\()", "g").replace("reflink", vs).replace("nolink", ys).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, un = { _backpedal: De, anyPunctuation: Kr, autolink: Qr, blockSkip: Hr, br: xs, code: Nr, del: De, delLDelim: De, delRDelim: De, emStrongLDelim: Gr, emStrongRDelimAst: Wr, emStrongRDelimUnd: Vr, escape: Pr, link: ti, nolink: ys, punctuation: Ur, reflink: vs, reflinkSearch: ni, tag: ei, text: $r, url: De }, si = { ...un, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", Tt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Tt).getRegex() }, en = { ...un, emStrongRDelimAst: qr, emStrongLDelim: jr, delLDelim: Yr, delRDelim: Xr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, ri = { ...en, br: D(xs).replace("{2,}", "*").getRegex(), text: D(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: on, gfm: Or, pedantic: zr }, lt = { normal: un, gfm: en, breaks: ri, pedantic: si }, ii = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ p((a) => ii[a], "de");
1164
1164
  function me(a, t) {
1165
1165
  if (t) {
1166
- if (K.escapeTest.test(a)) return a.replace(K.escapeReplace, Kn);
1167
- } else if (K.escapeTestNoEncode.test(a)) return a.replace(K.escapeReplaceNoEncode, Kn);
1166
+ if (X.escapeTest.test(a)) return a.replace(X.escapeReplace, Kn);
1167
+ } else if (X.escapeTestNoEncode.test(a)) return a.replace(X.escapeReplaceNoEncode, Kn);
1168
1168
  return a;
1169
1169
  }
1170
1170
  p(me, "O");
1171
1171
  function Qn(a) {
1172
1172
  try {
1173
- a = encodeURI(a).replace(K.percentDecode, "%");
1173
+ a = encodeURI(a).replace(X.percentDecode, "%");
1174
1174
  } catch {
1175
1175
  return null;
1176
1176
  }
@@ -1178,18 +1178,18 @@ function Qn(a) {
1178
1178
  }
1179
1179
  p(Qn, "J");
1180
1180
  function Jn(a, t) {
1181
- let e = a.replace(K.findPipe, (s, l, o) => {
1181
+ let e = a.replace(X.findPipe, (s, l, o) => {
1182
1182
  let d = !1, c = l;
1183
1183
  for (; --c >= 0 && o[c] === "\\"; ) d = !d;
1184
1184
  return d ? "|" : " |";
1185
- }), n = e.split(K.splitPipe), r = 0;
1185
+ }), n = e.split(X.splitPipe), r = 0;
1186
1186
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1187
1187
  else for (; n.length < t; ) n.push("");
1188
- for (; r < n.length; r++) n[r] = n[r].trim().replace(K.slashPipe, "|");
1188
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(X.slashPipe, "|");
1189
1189
  return n;
1190
1190
  }
1191
1191
  p(Jn, "V");
1192
- function ye(a, t, e) {
1192
+ function ve(a, t, e) {
1193
1193
  let n = a.length;
1194
1194
  if (n === 0) return "";
1195
1195
  let r = 0;
@@ -1197,16 +1197,16 @@ function ye(a, t, e) {
1197
1197
  r++;
1198
1198
  return a.slice(0, n - r);
1199
1199
  }
1200
- p(ye, "$");
1200
+ p(ve, "$");
1201
1201
  function es(a) {
1202
1202
  let t = a.split(`
1203
1203
  `), e = t.length - 1;
1204
- for (; e >= 0 && K.blankLine.test(t[e]); ) e--;
1204
+ for (; e >= 0 && X.blankLine.test(t[e]); ) e--;
1205
1205
  return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1206
1206
  `);
1207
1207
  }
1208
1208
  p(es, "Y");
1209
- function ii(a, t) {
1209
+ function ai(a, t) {
1210
1210
  if (a.indexOf(t[1]) === -1) return -1;
1211
1211
  let e = 0;
1212
1212
  for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
@@ -1214,8 +1214,8 @@ function ii(a, t) {
1214
1214
  else if (a[n] === t[1] && (e--, e < 0)) return n;
1215
1215
  return e > 0 ? -2 : -1;
1216
1216
  }
1217
- p(ii, "ge");
1218
- function ai(a, t = 0) {
1217
+ p(ai, "ge");
1218
+ function li(a, t = 0) {
1219
1219
  let e = t, n = "";
1220
1220
  for (let r of a) if (r === " ") {
1221
1221
  let s = 4 - e % 4;
@@ -1223,7 +1223,7 @@ function ai(a, t = 0) {
1223
1223
  } else n += r, e++;
1224
1224
  return n;
1225
1225
  }
1226
- p(ai, "fe");
1226
+ p(li, "fe");
1227
1227
  function ts(a, t, e, n, r) {
1228
1228
  let s = t.href, l = t.title || null, o = a[1].replace(r.other.outputLinkReplace, "$1");
1229
1229
  n.state.inLink = !0;
@@ -1231,7 +1231,7 @@ function ts(a, t, e, n, r) {
1231
1231
  return n.state.inLink = !1, d;
1232
1232
  }
1233
1233
  p(ts, "me");
1234
- function li(a, t, e) {
1234
+ function oi(a, t, e) {
1235
1235
  let n = a.match(e.other.indentCodeCompensation);
1236
1236
  if (n === null) return t;
1237
1237
  let r = n[1];
@@ -1244,8 +1244,8 @@ function li(a, t, e) {
1244
1244
  }).join(`
1245
1245
  `);
1246
1246
  }
1247
- p(li, "rt");
1248
- var He, yt = (He = class {
1247
+ p(oi, "rt");
1248
+ var We, St = (We = class {
1249
1249
  constructor(t) {
1250
1250
  I(this, "options");
1251
1251
  I(this, "rules");
@@ -1266,7 +1266,7 @@ var He, yt = (He = class {
1266
1266
  fences(t) {
1267
1267
  let e = this.rules.block.fences.exec(t);
1268
1268
  if (e) {
1269
- let n = e[0], r = li(n, e[3] || "", this.rules);
1269
+ let n = e[0], r = oi(n, e[3] || "", this.rules);
1270
1270
  return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1271
1271
  }
1272
1272
  }
@@ -1275,22 +1275,22 @@ var He, yt = (He = class {
1275
1275
  if (e) {
1276
1276
  let n = e[2].trim();
1277
1277
  if (this.rules.other.endingHash.test(n)) {
1278
- let r = ye(n, "#");
1278
+ let r = ve(n, "#");
1279
1279
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1280
1280
  }
1281
- return { type: "heading", raw: ye(e[0], `
1281
+ return { type: "heading", raw: ve(e[0], `
1282
1282
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1283
1283
  }
1284
1284
  }
1285
1285
  hr(t) {
1286
1286
  let e = this.rules.block.hr.exec(t);
1287
- if (e) return { type: "hr", raw: ye(e[0], `
1287
+ if (e) return { type: "hr", raw: ve(e[0], `
1288
1288
  `) };
1289
1289
  }
1290
1290
  blockquote(t) {
1291
1291
  let e = this.rules.block.blockquote.exec(t);
1292
1292
  if (e) {
1293
- let n = ye(e[0], `
1293
+ let n = ve(e[0], `
1294
1294
  `).split(`
1295
1295
  `), r = "", s = "", l = [];
1296
1296
  for (; n.length > 0; ) {
@@ -1299,27 +1299,27 @@ var He, yt = (He = class {
1299
1299
  else if (!o) d.push(n[c]);
1300
1300
  else break;
1301
1301
  n = n.slice(c);
1302
- let b = d.join(`
1303
- `), u = b.replace(this.rules.other.blockquoteSetextReplace, `
1302
+ let x = d.join(`
1303
+ `), u = x.replace(this.rules.other.blockquoteSetextReplace, `
1304
1304
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1305
1305
  r = r ? `${r}
1306
- ${b}` : b, s = s ? `${s}
1306
+ ${x}` : x, s = s ? `${s}
1307
1307
  ${u}` : u;
1308
- let m = this.lexer.state.top;
1309
- if (this.lexer.state.top = !0, this.lexer.blockTokens(u, l, !0), this.lexer.state.top = m, n.length === 0) break;
1310
- let f = l.at(-1);
1311
- if (f?.type === "code") break;
1312
- if (f?.type === "blockquote") {
1313
- let w = f, _ = w.raw + `
1308
+ let g = this.lexer.state.top;
1309
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(u, l, !0), this.lexer.state.top = g, n.length === 0) break;
1310
+ let m = l.at(-1);
1311
+ if (m?.type === "code") break;
1312
+ if (m?.type === "blockquote") {
1313
+ let w = m, _ = w.raw + `
1314
1314
  ` + n.join(`
1315
- `), O = this.blockquote(_);
1316
- l[l.length - 1] = O, r = r.substring(0, r.length - w.raw.length) + O.raw, s = s.substring(0, s.length - w.text.length) + O.text;
1315
+ `), z = this.blockquote(_);
1316
+ l[l.length - 1] = z, r = r.substring(0, r.length - w.raw.length) + z.raw, s = s.substring(0, s.length - w.text.length) + z.text;
1317
1317
  break;
1318
- } else if (f?.type === "list") {
1319
- let w = f, _ = w.raw + `
1318
+ } else if (m?.type === "list") {
1319
+ let w = m, _ = w.raw + `
1320
1320
  ` + n.join(`
1321
- `), O = this.list(_);
1322
- l[l.length - 1] = O, r = r.substring(0, r.length - f.raw.length) + O.raw, s = s.substring(0, s.length - w.raw.length) + O.raw, n = _.substring(l.at(-1).raw.length).split(`
1321
+ `), z = this.list(_);
1322
+ l[l.length - 1] = z, r = r.substring(0, r.length - m.raw.length) + z.raw, s = s.substring(0, s.length - w.raw.length) + z.raw, n = _.substring(l.at(-1).raw.length).split(`
1323
1323
  `);
1324
1324
  continue;
1325
1325
  }
@@ -1334,31 +1334,31 @@ ${u}` : u;
1334
1334
  n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1335
1335
  let l = this.rules.other.listItemRegex(n), o = !1;
1336
1336
  for (; t; ) {
1337
- let c = !1, b = "", u = "";
1337
+ let c = !1, x = "", u = "";
1338
1338
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1339
- b = e[0], t = t.substring(b.length);
1340
- let m = ai(e[2].split(`
1341
- `, 1)[0], e[1].length), f = t.split(`
1342
- `, 1)[0], w = !m.trim(), _ = 0;
1343
- if (this.options.pedantic ? (_ = 2, u = m.trimStart()) : w ? _ = e[1].length + 1 : (_ = m.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, u = m.slice(_), _ += e[1].length), w && this.rules.other.blankLine.test(f) && (b += f + `
1344
- `, t = t.substring(f.length + 1), c = !0), !c) {
1345
- let O = this.rules.other.nextBulletRegex(_), ie = this.rules.other.hrRegex(_), be = this.rules.other.fencesBeginRegex(_), G = this.rules.other.headingBeginRegex(_), P = this.rules.other.htmlBeginRegex(_), de = this.rules.other.blockquoteBeginRegex(_);
1339
+ x = e[0], t = t.substring(x.length);
1340
+ let g = li(e[2].split(`
1341
+ `, 1)[0], e[1].length), m = t.split(`
1342
+ `, 1)[0], w = !g.trim(), _ = 0;
1343
+ if (this.options.pedantic ? (_ = 2, u = g.trimStart()) : w ? _ = e[1].length + 1 : (_ = g.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, u = g.slice(_), _ += e[1].length), w && this.rules.other.blankLine.test(m) && (x += m + `
1344
+ `, t = t.substring(m.length + 1), c = !0), !c) {
1345
+ let z = this.rules.other.nextBulletRegex(_), te = this.rules.other.hrRegex(_), oe = this.rules.other.fencesBeginRegex(_), se = this.rules.other.headingBeginRegex(_), O = this.rules.other.htmlBeginRegex(_), ce = this.rules.other.blockquoteBeginRegex(_);
1346
1346
  for (; t; ) {
1347
- let ae = t.split(`
1348
- `, 1)[0], Q;
1349
- if (f = ae, this.options.pedantic ? (f = f.replace(this.rules.other.listReplaceNesting, " "), Q = f) : Q = f.replace(this.rules.other.tabCharGlobal, " "), be.test(f) || G.test(f) || P.test(f) || de.test(f) || O.test(f) || ie.test(f)) break;
1350
- if (Q.search(this.rules.other.nonSpaceChar) >= _ || !f.trim()) u += `
1351
- ` + Q.slice(_);
1347
+ let re = t.split(`
1348
+ `, 1)[0], ie;
1349
+ if (m = re, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), ie = m) : ie = m.replace(this.rules.other.tabCharGlobal, " "), oe.test(m) || se.test(m) || O.test(m) || ce.test(m) || z.test(m) || te.test(m)) break;
1350
+ if (ie.search(this.rules.other.nonSpaceChar) >= _ || !m.trim()) u += `
1351
+ ` + ie.slice(_);
1352
1352
  else {
1353
- if (w || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || be.test(m) || G.test(m) || ie.test(m)) break;
1353
+ if (w || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || oe.test(g) || se.test(g) || te.test(g)) break;
1354
1354
  u += `
1355
- ` + f;
1355
+ ` + m;
1356
1356
  }
1357
- w = !f.trim(), b += ae + `
1358
- `, t = t.substring(ae.length + 1), m = Q.slice(_);
1357
+ w = !m.trim(), x += re + `
1358
+ `, t = t.substring(re.length + 1), g = ie.slice(_);
1359
1359
  }
1360
1360
  }
1361
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (o = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), s.raw += b;
1361
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(x) && (o = !0)), s.items.push({ type: "list_item", raw: x, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), s.raw += x;
1362
1362
  }
1363
1363
  let d = s.items.at(-1);
1364
1364
  if (d) d.raw = d.raw.trimEnd(), d.text = d.text.trimEnd();
@@ -1373,20 +1373,20 @@ ${u}` : u;
1373
1373
  break;
1374
1374
  }
1375
1375
  }
1376
- let b = this.rules.other.listTaskCheckbox.exec(c.raw);
1377
- if (b) {
1378
- let u = { type: "checkbox", raw: b[0] + " ", checked: b[0] !== "[ ]" };
1376
+ let x = this.rules.other.listTaskCheckbox.exec(c.raw);
1377
+ if (x) {
1378
+ let u = { type: "checkbox", raw: x[0] + " ", checked: x[0] !== "[ ]" };
1379
1379
  c.checked = u.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = u.raw + c.tokens[0].raw, c.tokens[0].text = u.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(u)) : c.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : c.tokens.unshift(u);
1380
1380
  }
1381
1381
  }
1382
1382
  if (!s.loose) {
1383
- let b = c.tokens.filter((m) => m.type === "space"), u = b.length > 0 && b.some((m) => this.rules.other.anyLine.test(m.raw));
1383
+ let x = c.tokens.filter((g) => g.type === "space"), u = x.length > 0 && x.some((g) => this.rules.other.anyLine.test(g.raw));
1384
1384
  s.loose = u;
1385
1385
  }
1386
1386
  }
1387
1387
  if (s.loose) for (let c of s.items) {
1388
1388
  c.loose = !0;
1389
- for (let b of c.tokens) b.type === "text" && (b.type = "paragraph");
1389
+ for (let x of c.tokens) x.type === "text" && (x.type = "paragraph");
1390
1390
  }
1391
1391
  return s;
1392
1392
  }
@@ -1402,7 +1402,7 @@ ${u}` : u;
1402
1402
  let e = this.rules.block.def.exec(t);
1403
1403
  if (e) {
1404
1404
  let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
1405
- return { type: "def", tag: n, raw: ye(e[0], `
1405
+ return { type: "def", tag: n, raw: ve(e[0], `
1406
1406
  `), href: r, title: s };
1407
1407
  }
1408
1408
  }
@@ -1410,7 +1410,7 @@ ${u}` : u;
1410
1410
  let e = this.rules.block.table.exec(t);
1411
1411
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1412
1412
  let n = Jn(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1413
- `) : [], l = { type: "table", raw: ye(e[0], `
1413
+ `) : [], l = { type: "table", raw: ve(e[0], `
1414
1414
  `), header: [], align: [], rows: [] };
1415
1415
  if (n.length === r.length) {
1416
1416
  for (let o of r) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
@@ -1423,7 +1423,7 @@ ${u}` : u;
1423
1423
  let e = this.rules.block.lheading.exec(t);
1424
1424
  if (e) {
1425
1425
  let n = e[1].trim();
1426
- return { type: "heading", raw: ye(e[0], `
1426
+ return { type: "heading", raw: ve(e[0], `
1427
1427
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1428
1428
  }
1429
1429
  }
@@ -1453,10 +1453,10 @@ ${u}` : u;
1453
1453
  let n = e[2].trim();
1454
1454
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1455
1455
  if (!this.rules.other.endAngleBracket.test(n)) return;
1456
- let l = ye(n.slice(0, -1), "\\");
1456
+ let l = ve(n.slice(0, -1), "\\");
1457
1457
  if ((n.length - l.length) % 2 === 0) return;
1458
1458
  } else {
1459
- let l = ii(e[2], "()");
1459
+ let l = ai(e[2], "()");
1460
1460
  if (l === -2) return;
1461
1461
  if (l > -1) {
1462
1462
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
@@ -1485,8 +1485,8 @@ ${u}` : u;
1485
1485
  emStrong(t, e, n = "") {
1486
1486
  let r = this.rules.inline.emStrongLDelim.exec(t);
1487
1487
  if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1488
- let s = [...r[0]].length - 1, l, o, d = s, c = 0, b = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1489
- for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = b.exec(e)) !== null; ) {
1488
+ let s = [...r[0]].length - 1, l, o, d = s, c = 0, x = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1489
+ for (x.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = x.exec(e)) !== null; ) {
1490
1490
  if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
1491
1491
  if (o = [...l].length, r[3] || r[4]) {
1492
1492
  d += o;
@@ -1497,13 +1497,13 @@ ${u}` : u;
1497
1497
  }
1498
1498
  if (d -= o, d > 0) continue;
1499
1499
  o = Math.min(o, o + d + c);
1500
- let u = [...r[0]][0].length, m = t.slice(0, s + r.index + u + o);
1500
+ let u = [...r[0]][0].length, g = t.slice(0, s + r.index + u + o);
1501
1501
  if (Math.min(s, o) % 2) {
1502
- let w = m.slice(1, -1);
1503
- return { type: "em", raw: m, text: w, tokens: this.lexer.inlineTokens(w) };
1502
+ let w = g.slice(1, -1);
1503
+ return { type: "em", raw: g, text: w, tokens: this.lexer.inlineTokens(w) };
1504
1504
  }
1505
- let f = m.slice(2, -2);
1506
- return { type: "strong", raw: m, text: f, tokens: this.lexer.inlineTokens(f) };
1505
+ let m = g.slice(2, -2);
1506
+ return { type: "strong", raw: g, text: m, tokens: this.lexer.inlineTokens(m) };
1507
1507
  }
1508
1508
  }
1509
1509
  }
@@ -1530,8 +1530,8 @@ ${u}` : u;
1530
1530
  }
1531
1531
  if (d -= o, d > 0) continue;
1532
1532
  o = Math.min(o, o + d);
1533
- let b = [...r[0]][0].length, u = t.slice(0, s + r.index + b + o), m = u.slice(s, -s);
1534
- return { type: "del", raw: u, text: m, tokens: this.lexer.inlineTokens(m) };
1533
+ let x = [...r[0]][0].length, u = t.slice(0, s + r.index + x + o), g = u.slice(s, -s);
1534
+ return { type: "del", raw: u, text: g, tokens: this.lexer.inlineTokens(g) };
1535
1535
  }
1536
1536
  }
1537
1537
  }
@@ -1564,28 +1564,28 @@ ${u}` : u;
1564
1564
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1565
1565
  }
1566
1566
  }
1567
- }, p(He, "w"), He), Ae, he = (Ae = class {
1567
+ }, p(We, "w"), We), Se, pe = (Se = class {
1568
1568
  constructor(t) {
1569
1569
  I(this, "tokens");
1570
1570
  I(this, "options");
1571
1571
  I(this, "state");
1572
1572
  I(this, "inlineQueue");
1573
1573
  I(this, "tokenizer");
1574
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new yt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1575
- let e = { other: K, block: kt.normal, inline: it.normal };
1576
- this.options.pedantic ? (e.block = kt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = kt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
1574
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new St(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1575
+ let e = { other: X, block: vt.normal, inline: lt.normal };
1576
+ this.options.pedantic ? (e.block = vt.pedantic, e.inline = lt.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = lt.breaks : e.inline = lt.gfm), this.tokenizer.rules = e;
1577
1577
  }
1578
1578
  static get rules() {
1579
- return { block: kt, inline: it };
1579
+ return { block: vt, inline: lt };
1580
1580
  }
1581
1581
  static lex(t, e) {
1582
- return new Ae(e).lex(t);
1582
+ return new Se(e).lex(t);
1583
1583
  }
1584
1584
  static lexInline(t, e) {
1585
- return new Ae(e).inlineTokens(t);
1585
+ return new Se(e).inlineTokens(t);
1586
1586
  }
1587
1587
  lex(t) {
1588
- t = t.replace(K.carriageReturn, `
1588
+ t = t.replace(X.carriageReturn, `
1589
1589
  `), this.blockTokens(t, this.tokens);
1590
1590
  for (let e = 0; e < this.inlineQueue.length; e++) {
1591
1591
  let n = this.inlineQueue[e];
@@ -1594,7 +1594,7 @@ ${u}` : u;
1594
1594
  return this.inlineQueue = [], this.tokens;
1595
1595
  }
1596
1596
  blockTokens(t, e = [], n = !1) {
1597
- this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(K.tabCharGlobal, " ").replace(K.spaceLine, ""));
1597
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(X.tabCharGlobal, " ").replace(X.spaceLine, ""));
1598
1598
  let r = 1 / 0;
1599
1599
  for (; t; ) {
1600
1600
  if (t.length < r) r = t.length;
@@ -1664,8 +1664,8 @@ ${u}` : u;
1664
1664
  let l = t;
1665
1665
  if (this.options.extensions?.startBlock) {
1666
1666
  let o = 1 / 0, d = t.slice(1), c;
1667
- this.options.extensions.startBlock.forEach((b) => {
1668
- c = b.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1667
+ this.options.extensions.startBlock.forEach((x) => {
1668
+ c = x.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1669
1669
  }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
1670
1670
  }
1671
1671
  if (this.state.top && (s = this.tokenizer.paragraph(l))) {
@@ -1758,14 +1758,14 @@ ${u}` : u;
1758
1758
  t = t.substring(c.raw.length), e.push(c);
1759
1759
  continue;
1760
1760
  }
1761
- let b = t;
1761
+ let x = t;
1762
1762
  if (this.options.extensions?.startInline) {
1763
- let u = 1 / 0, m = t.slice(1), f;
1763
+ let u = 1 / 0, g = t.slice(1), m;
1764
1764
  this.options.extensions.startInline.forEach((w) => {
1765
- f = w.call({ lexer: this }, m), typeof f == "number" && f >= 0 && (u = Math.min(u, f));
1766
- }), u < 1 / 0 && u >= 0 && (b = t.substring(0, u + 1));
1765
+ m = w.call({ lexer: this }, g), typeof m == "number" && m >= 0 && (u = Math.min(u, m));
1766
+ }), u < 1 / 0 && u >= 0 && (x = t.substring(0, u + 1));
1767
1767
  }
1768
- if (c = this.tokenizer.inlineText(b)) {
1768
+ if (c = this.tokenizer.inlineText(x)) {
1769
1769
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1770
1770
  let u = e.at(-1);
1771
1771
  u?.type === "text" ? (u.raw += c.raw, u.text += c.text) : e.push(c);
@@ -1783,7 +1783,7 @@ ${u}` : u;
1783
1783
  if (this.options.silent) console.error(e);
1784
1784
  else throw new Error(e);
1785
1785
  }
1786
- }, p(Ae, "l"), Ae), Ge, Tt = (Ge = class {
1786
+ }, p(Se, "l"), Se), qe, At = (qe = class {
1787
1787
  constructor(t) {
1788
1788
  I(this, "options");
1789
1789
  I(this, "parser");
@@ -1793,7 +1793,7 @@ ${u}` : u;
1793
1793
  return "";
1794
1794
  }
1795
1795
  code({ text: t, lang: e, escaped: n }) {
1796
- let r = (e || "").match(K.notSpaceStart)?.[0], s = t.replace(K.endingNewline, "") + `
1796
+ let r = (e || "").match(X.notSpaceStart)?.[0], s = t.replace(X.endingNewline, "") + `
1797
1797
  `;
1798
1798
  return r ? '<pre><code class="language-' + me(r) + '">' + (n ? s : me(s, !0)) + `</code></pre>
1799
1799
  ` : "<pre><code>" + (n ? s : me(s, !0)) + `</code></pre>
@@ -1900,7 +1900,7 @@ ${t}</tr>
1900
1900
  text(t) {
1901
1901
  return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : me(t.text);
1902
1902
  }
1903
- }, p(Ge, "y"), Ge), je, un = (je = class {
1903
+ }, p(qe, "y"), qe), Ve, hn = (Ve = class {
1904
1904
  strong({ text: t }) {
1905
1905
  return t;
1906
1906
  }
@@ -1931,18 +1931,18 @@ ${t}</tr>
1931
1931
  checkbox({ raw: t }) {
1932
1932
  return t;
1933
1933
  }
1934
- }, p(je, "L"), je), Ee, pe = (Ee = class {
1934
+ }, p(Ve, "L"), Ve), Ae, de = (Ae = class {
1935
1935
  constructor(t) {
1936
1936
  I(this, "options");
1937
1937
  I(this, "renderer");
1938
1938
  I(this, "textRenderer");
1939
- this.options = t || Le, this.options.renderer = this.options.renderer || new Tt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new un();
1939
+ this.options = t || Le, this.options.renderer = this.options.renderer || new At(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new hn();
1940
1940
  }
1941
1941
  static parse(t, e) {
1942
- return new Ee(e).parse(t);
1942
+ return new Ae(e).parse(t);
1943
1943
  }
1944
1944
  static parseInline(t, e) {
1945
- return new Ee(e).parseInline(t);
1945
+ return new Ae(e).parseInline(t);
1946
1946
  }
1947
1947
  parse(t) {
1948
1948
  this.renderer.parser = this;
@@ -2082,7 +2082,7 @@ ${t}</tr>
2082
2082
  }
2083
2083
  return n;
2084
2084
  }
2085
- }, p(Ee, "l"), Ee), Se, ot = (Se = class {
2085
+ }, p(Ae, "l"), Ae), Te, ut = (Te = class {
2086
2086
  constructor(t) {
2087
2087
  I(this, "options");
2088
2088
  I(this, "block");
@@ -2101,23 +2101,23 @@ ${t}</tr>
2101
2101
  return t;
2102
2102
  }
2103
2103
  provideLexer(t = this.block) {
2104
- return t ? he.lex : he.lexInline;
2104
+ return t ? pe.lex : pe.lexInline;
2105
2105
  }
2106
2106
  provideParser(t = this.block) {
2107
- return t ? pe.parse : pe.parseInline;
2107
+ return t ? de.parse : de.parseInline;
2108
2108
  }
2109
- }, p(Se, "P"), I(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), We, oi = (We = class {
2109
+ }, p(Te, "P"), I(Te, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Te, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Te), Ye, ci = (Ye = class {
2110
2110
  constructor(...t) {
2111
- I(this, "defaults", tn());
2111
+ I(this, "defaults", nn());
2112
2112
  I(this, "options", this.setOptions);
2113
2113
  I(this, "parse", this.parseMarkdown(!0));
2114
2114
  I(this, "parseInline", this.parseMarkdown(!1));
2115
- I(this, "Parser", pe);
2116
- I(this, "Renderer", Tt);
2117
- I(this, "TextRenderer", un);
2118
- I(this, "Lexer", he);
2119
- I(this, "Tokenizer", yt);
2120
- I(this, "Hooks", ot);
2115
+ I(this, "Parser", de);
2116
+ I(this, "Renderer", At);
2117
+ I(this, "TextRenderer", hn);
2118
+ I(this, "Lexer", pe);
2119
+ I(this, "Tokenizer", St);
2120
+ I(this, "Hooks", ut);
2121
2121
  this.use(...t);
2122
2122
  }
2123
2123
  walkTokens(t, e) {
@@ -2164,51 +2164,51 @@ ${t}</tr>
2164
2164
  }
2165
2165
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2166
2166
  }), r.extensions = e), n.renderer) {
2167
- let s = this.defaults.renderer || new Tt(this.defaults);
2167
+ let s = this.defaults.renderer || new At(this.defaults);
2168
2168
  for (let l in n.renderer) {
2169
2169
  if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
2170
2170
  if (["options", "parser"].includes(l)) continue;
2171
2171
  let o = l, d = n.renderer[o], c = s[o];
2172
- s[o] = (...b) => {
2173
- let u = d.apply(s, b);
2174
- return u === !1 && (u = c.apply(s, b)), u || "";
2172
+ s[o] = (...x) => {
2173
+ let u = d.apply(s, x);
2174
+ return u === !1 && (u = c.apply(s, x)), u || "";
2175
2175
  };
2176
2176
  }
2177
2177
  r.renderer = s;
2178
2178
  }
2179
2179
  if (n.tokenizer) {
2180
- let s = this.defaults.tokenizer || new yt(this.defaults);
2180
+ let s = this.defaults.tokenizer || new St(this.defaults);
2181
2181
  for (let l in n.tokenizer) {
2182
2182
  if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
2183
2183
  if (["options", "rules", "lexer"].includes(l)) continue;
2184
2184
  let o = l, d = n.tokenizer[o], c = s[o];
2185
- s[o] = (...b) => {
2186
- let u = d.apply(s, b);
2187
- return u === !1 && (u = c.apply(s, b)), u;
2185
+ s[o] = (...x) => {
2186
+ let u = d.apply(s, x);
2187
+ return u === !1 && (u = c.apply(s, x)), u;
2188
2188
  };
2189
2189
  }
2190
2190
  r.tokenizer = s;
2191
2191
  }
2192
2192
  if (n.hooks) {
2193
- let s = this.defaults.hooks || new ot();
2193
+ let s = this.defaults.hooks || new ut();
2194
2194
  for (let l in n.hooks) {
2195
2195
  if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
2196
2196
  if (["options", "block"].includes(l)) continue;
2197
2197
  let o = l, d = n.hooks[o], c = s[o];
2198
- ot.passThroughHooks.has(l) ? s[o] = (b) => {
2199
- if (this.defaults.async && ot.passThroughHooksRespectAsync.has(l)) return (async () => {
2200
- let m = await d.call(s, b);
2201
- return c.call(s, m);
2198
+ ut.passThroughHooks.has(l) ? s[o] = (x) => {
2199
+ if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
2200
+ let g = await d.call(s, x);
2201
+ return c.call(s, g);
2202
2202
  })();
2203
- let u = d.call(s, b);
2203
+ let u = d.call(s, x);
2204
2204
  return c.call(s, u);
2205
- } : s[o] = (...b) => {
2205
+ } : s[o] = (...x) => {
2206
2206
  if (this.defaults.async) return (async () => {
2207
- let m = await d.apply(s, b);
2208
- return m === !1 && (m = await c.apply(s, b)), m;
2207
+ let g = await d.apply(s, x);
2208
+ return g === !1 && (g = await c.apply(s, x)), g;
2209
2209
  })();
2210
- let u = d.apply(s, b);
2211
- return u === !1 && (u = c.apply(s, b)), u;
2210
+ let u = d.apply(s, x);
2211
+ return u === !1 && (u = c.apply(s, x)), u;
2212
2212
  };
2213
2213
  }
2214
2214
  r.hooks = s;
@@ -2227,10 +2227,10 @@ ${t}</tr>
2227
2227
  return this.defaults = { ...this.defaults, ...t }, this;
2228
2228
  }
2229
2229
  lexer(t, e) {
2230
- return he.lex(t, e ?? this.defaults);
2230
+ return pe.lex(t, e ?? this.defaults);
2231
2231
  }
2232
2232
  parser(t, e) {
2233
- return pe.parse(t, e ?? this.defaults);
2233
+ return de.parse(t, e ?? this.defaults);
2234
2234
  }
2235
2235
  parseMarkdown(t) {
2236
2236
  return (e, n) => {
@@ -2239,16 +2239,16 @@ ${t}</tr>
2239
2239
  if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2240
2240
  if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2241
2241
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2242
- let o = s.hooks ? await s.hooks.preprocess(e) : e, d = await (s.hooks ? await s.hooks.provideLexer(t) : t ? he.lex : he.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(d) : d;
2242
+ let o = s.hooks ? await s.hooks.preprocess(e) : e, d = await (s.hooks ? await s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(d) : d;
2243
2243
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2244
- let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? pe.parse : pe.parseInline)(c, s);
2245
- return s.hooks ? await s.hooks.postprocess(b) : b;
2244
+ let x = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
2245
+ return s.hooks ? await s.hooks.postprocess(x) : x;
2246
2246
  })().catch(l);
2247
2247
  try {
2248
2248
  s.hooks && (e = s.hooks.preprocess(e));
2249
- let o = (s.hooks ? s.hooks.provideLexer(t) : t ? he.lex : he.lexInline)(e, s);
2249
+ let o = (s.hooks ? s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(e, s);
2250
2250
  s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
2251
- let d = (s.hooks ? s.hooks.provideParser(t) : t ? pe.parse : pe.parseInline)(o, s);
2251
+ let d = (s.hooks ? s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(o, s);
2252
2252
  return s.hooks && (d = s.hooks.postprocess(d)), d;
2253
2253
  } catch (o) {
2254
2254
  return l(o);
@@ -2266,40 +2266,40 @@ Please report this to https://github.com/markedjs/marked.`, t) {
2266
2266
  throw n;
2267
2267
  };
2268
2268
  }
2269
- }, p(We, "D"), We), Me = new oi();
2269
+ }, p(Ye, "D"), Ye), Me = new ci();
2270
2270
  function L(a, t) {
2271
2271
  return Me.parse(a, t);
2272
2272
  }
2273
2273
  p(L, "g");
2274
2274
  L.options = L.setOptions = function(a) {
2275
- return Me.setOptions(a), L.defaults = Me.defaults, ps(L.defaults), L;
2275
+ return Me.setOptions(a), L.defaults = Me.defaults, ds(L.defaults), L;
2276
2276
  };
2277
- L.getDefaults = tn;
2277
+ L.getDefaults = nn;
2278
2278
  L.defaults = Le;
2279
2279
  L.use = function(...a) {
2280
- return Me.use(...a), L.defaults = Me.defaults, ps(L.defaults), L;
2280
+ return Me.use(...a), L.defaults = Me.defaults, ds(L.defaults), L;
2281
2281
  };
2282
2282
  L.walkTokens = function(a, t) {
2283
2283
  return Me.walkTokens(a, t);
2284
2284
  };
2285
2285
  L.parseInline = Me.parseInline;
2286
- L.Parser = pe;
2287
- L.parser = pe.parse;
2288
- L.Renderer = Tt;
2289
- L.TextRenderer = un;
2290
- L.Lexer = he;
2291
- L.lexer = he.lex;
2292
- L.Tokenizer = yt;
2293
- L.Hooks = ot;
2286
+ L.Parser = de;
2287
+ L.parser = de.parse;
2288
+ L.Renderer = At;
2289
+ L.TextRenderer = hn;
2290
+ L.Lexer = pe;
2291
+ L.lexer = pe.lex;
2292
+ L.Tokenizer = St;
2293
+ L.Hooks = ut;
2294
2294
  L.parse = L;
2295
2295
  L.options;
2296
2296
  L.setOptions;
2297
2297
  L.use;
2298
2298
  L.walkTokens;
2299
2299
  L.parseInline;
2300
- pe.parse;
2301
- he.lex;
2302
- const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2300
+ de.parse;
2301
+ pe.lex;
2302
+ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2303
2303
  __name: "ChatRichText",
2304
2304
  props: {
2305
2305
  text: {},
@@ -2307,9 +2307,9 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2307
2307
  streaming: { type: Boolean }
2308
2308
  },
2309
2309
  setup(a) {
2310
- const t = a, e = rs(t.text);
2310
+ const t = a, e = is(t.text);
2311
2311
  let n;
2312
- qe(
2312
+ Ze(
2313
2313
  [() => t.text, () => t.streaming],
2314
2314
  ([l, o]) => {
2315
2315
  if (!o) {
@@ -2320,7 +2320,7 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2320
2320
  n = void 0, e.value = t.text;
2321
2321
  }));
2322
2322
  }
2323
- ), is(() => {
2323
+ ), as(() => {
2324
2324
  n !== void 0 && cancelAnimationFrame(n);
2325
2325
  });
2326
2326
  const r = new L.Renderer();
@@ -2334,21 +2334,21 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2334
2334
  }
2335
2335
  return d ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
2336
2336
  }, L.setOptions({ breaks: !0, gfm: !0, renderer: r });
2337
- const s = $(() => {
2337
+ const s = U(() => {
2338
2338
  const l = e.value;
2339
2339
  if (!l) return "";
2340
2340
  const o = L.parse(l, { async: !1 });
2341
- return vr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2341
+ return yr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2342
2342
  });
2343
2343
  return (l, o) => (y(), T("div", {
2344
2344
  class: E(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
2345
2345
  innerHTML: s.value
2346
- }, null, 10, ci));
2346
+ }, null, 10, ui));
2347
2347
  }
2348
2348
  }), hi = 80, pi = /* @__PURE__ */ ke({
2349
2349
  __name: "ChatScroller",
2350
2350
  setup(a, { expose: t }) {
2351
- const e = Z(), n = Z();
2351
+ const e = Y(), n = Y();
2352
2352
  let r = !0, s;
2353
2353
  function l() {
2354
2354
  const c = e.value;
@@ -2363,15 +2363,15 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2363
2363
  function d() {
2364
2364
  r = !0, l();
2365
2365
  }
2366
- return p(d, "pin"), t({ pin: d }), St(() => {
2366
+ return p(d, "pin"), t({ pin: d }), Et(() => {
2367
2367
  requestAnimationFrame(() => {
2368
2368
  l(), requestAnimationFrame(l);
2369
2369
  }), n.value && (s = new ResizeObserver(() => {
2370
2370
  r && l();
2371
2371
  }), s.observe(n.value));
2372
- }), is(() => {
2372
+ }), as(() => {
2373
2373
  s?.disconnect();
2374
- }), (c, b) => (y(), T("div", {
2374
+ }), (c, x) => (y(), T("div", {
2375
2375
  ref_key: "viewport",
2376
2376
  ref: e,
2377
2377
  class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
@@ -2381,7 +2381,7 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2381
2381
  ref_key: "content",
2382
2382
  ref: n
2383
2383
  }, [
2384
- en(c.$slots, "default")
2384
+ tn(c.$slots, "default")
2385
2385
  ], 512)
2386
2386
  ], 544));
2387
2387
  }
@@ -2391,7 +2391,7 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2391
2391
  }, gi = { class: "pt-4 pb-[120px] px-3 space-y-1" }, mi = {
2392
2392
  key: 0,
2393
2393
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2394
- }, bi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, xi = ["src", "alt"], ki = {
2394
+ }, xi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, bi = ["src", "alt"], ki = {
2395
2395
  key: 0,
2396
2396
  class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
2397
2397
  }, wi = ["onClick"], vi = ["title"], yi = {
@@ -2400,7 +2400,7 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2400
2400
  }, Ti = {
2401
2401
  key: 0,
2402
2402
  class: "flex items-center gap-3 py-3 px-2"
2403
- }, Si = ["data-issue-code", "data-issue-bucket"], Ai = { class: "flex flex-col gap-1 min-w-0" }, Ei = ["href"], _i = ["data-test"], Ri = {
2403
+ }, Si = ["data-issue-code", "data-issue-bucket"], Ai = { class: "flex flex-col gap-1 min-w-0 system-msg-content" }, Ei = ["href"], _i = ["data-test"], Ri = {
2404
2404
  key: 0,
2405
2405
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2406
2406
  }, Ci = ["src", "alt"], Ii = ["src", "alt"], Di = ["src"], Mi = ["href"], Li = {
@@ -2441,299 +2441,306 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2441
2441
  "Brief me on tomorrow",
2442
2442
  "Triage my inbox",
2443
2443
  "What's on my plate this week"
2444
- ], n = $(
2444
+ ], n = U(
2445
2445
  () => a.starterPrompts ?? e
2446
- ), r = $(() => {
2447
- const A = { ...t[a.scope] };
2448
- return a.scope === "org" && a.scopeName && (A.label = a.scopeName, A.tooltip = `Visible to ${a.scopeName} members`), A;
2449
- }), s = Z(""), l = Z(!1), o = Z(), d = Z(), c = Z(), b = Z([]), u = Z(!1);
2450
- function m(A, k) {
2451
- const g = A[k], M = A[k + 1];
2452
- return !M || M.sender !== g.sender;
2446
+ ), r = U(() => {
2447
+ const C = { ...t[a.scope] };
2448
+ return a.scope === "org" && a.scopeName && (C.label = a.scopeName, C.tooltip = `Visible to ${a.scopeName} members`), C;
2449
+ }), s = Y(""), l = Y(!1), o = Y(), d = Y(), c = Y(), x = Y([]), u = Y(!1);
2450
+ function g(C) {
2451
+ return C ? /\[[^\]]+\]\([^)]+\)/.test(C) : !1;
2452
+ }
2453
+ p(g, "containsMarkdownLink");
2454
+ function m(C, f) {
2455
+ const k = C[f], M = C[f + 1];
2456
+ return !M || M.sender !== k.sender;
2453
2457
  }
2454
2458
  p(m, "shouldShowAvatar");
2455
- const f = $(() => a.chatController?.textState.value), w = $(() => f.value?.isConnected ?? !1), _ = $(() => f.value?.isThinking ?? !1), O = $(() => f.value?.connectionStatus === "disconnected" && !!f.value?.error), ie = $(() => f.value?.connectionStatus !== "connected" && !f.value?.error), be = $(() => f.value?.error), G = $(() => a.chatController?.sharedMessages.value ?? []), P = $(() => {
2456
- if (!_.value) return;
2457
- const A = G.value, k = A[A.length - 1];
2458
- return k?.sender === "agent" ? k.id : void 0;
2459
- }), de = $(() => _.value ? P.value === void 0 : !1), ae = $(() => f.value?.accountGated ?? !1), Q = $(() => !w.value || ae.value), _t = $(() => O.value ? "Agent is offline" : ie.value ? "Connecting..." : ae.value ? "Resolve the billing issue above to continue" : "Message"), ut = $(() => (s.value.trim() || b.value.length > 0) && !Q.value && !u.value), C = $(() => a.variant === "light"), q = $(
2460
- () => C.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2461
- ), we = $(() => C.value ? "text-theme-300" : "text-white/30");
2462
- St(async () => {
2463
- a.chatController && !w.value && await a.chatController.startTextConversation();
2459
+ const w = U(() => a.chatController?.textState.value), _ = U(() => w.value?.isConnected ?? !1), z = U(() => w.value?.isThinking ?? !1), te = U(() => w.value?.connectionStatus === "disconnected" && !!w.value?.error), oe = U(() => w.value?.connectionStatus !== "connected" && !w.value?.error), se = U(() => w.value?.error), O = U(() => a.chatController?.sharedMessages.value ?? []), ce = U(() => {
2460
+ if (!z.value) return;
2461
+ const C = O.value, f = C[C.length - 1];
2462
+ return f?.sender === "agent" ? f.id : void 0;
2463
+ }), re = U(() => z.value ? ce.value === void 0 : !1), ie = U(() => w.value?.accountGated ?? !1), Ee = U(() => !_.value || ie.value), Ct = U(() => te.value ? "Agent is offline" : oe.value ? "Connecting..." : ie.value ? "Resolve the billing issue above to continue" : "Message"), pt = U(() => (s.value.trim() || x.value.length > 0) && !Ee.value && !u.value), A = U(() => a.variant === "light"), _e = U(
2464
+ () => A.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2465
+ ), we = U(() => A.value ? "text-theme-300" : "text-white/30");
2466
+ Et(async () => {
2467
+ a.chatController && !_.value && await a.chatController.startTextConversation();
2464
2468
  });
2465
2469
  function Oe() {
2466
2470
  a.chatController?.newConversation();
2467
2471
  }
2468
2472
  p(Oe, "startNewConversation");
2469
- async function ve() {
2470
- const A = s.value.trim(), k = b.value.length > 0;
2471
- if (!A && !k || !a.chatController || !w.value || u.value)
2473
+ async function Ke() {
2474
+ const C = s.value.trim(), f = x.value.length > 0;
2475
+ if (!C && !f || !a.chatController || !_.value || u.value)
2472
2476
  return;
2473
- const g = s.value, M = k ? [...b.value] : void 0;
2474
- s.value = "", b.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(g, M);
2477
+ const k = s.value, M = f ? [...x.value] : void 0;
2478
+ s.value = "", x.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(k, M);
2475
2479
  }
2476
- p(ve, "sendMessage");
2477
- async function Rt(A) {
2478
- Q.value || (s.value = A, await ve());
2480
+ p(Ke, "sendMessage");
2481
+ async function It(C) {
2482
+ Ee.value || (s.value = C, await Ke());
2479
2483
  }
2480
- p(Rt, "sendStarterPrompt");
2481
- async function Ct(A) {
2482
- A.key === "Enter" && !A.shiftKey && (A.preventDefault(), await ve());
2484
+ p(It, "sendStarterPrompt");
2485
+ async function Dt(C) {
2486
+ C.key === "Enter" && !C.shiftKey && (C.preventDefault(), await Ke());
2483
2487
  }
2484
- p(Ct, "handleKeydown");
2485
- function It() {
2488
+ p(Dt, "handleKeydown");
2489
+ function dt() {
2486
2490
  d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
2487
2491
  }
2488
- p(It, "adjustTextareaHeight"), qe(s, () => Is(() => It()));
2489
- function ht() {
2492
+ p(dt, "adjustTextareaHeight"), Ze(s, () => Ds(() => dt()));
2493
+ function Mt() {
2490
2494
  c.value?.click();
2491
2495
  }
2492
- p(ht, "triggerFileInput");
2493
- async function Dt(A) {
2494
- const k = A.target, g = k.files?.[0];
2495
- if (!(!g || !a.uploadFn)) {
2496
+ p(Mt, "triggerFileInput");
2497
+ async function ft(C) {
2498
+ const f = C.target, k = f.files?.[0];
2499
+ if (!(!k || !a.uploadFn)) {
2496
2500
  u.value = !0;
2497
2501
  try {
2498
- const M = await a.uploadFn(g);
2499
- b.value = [...b.value, M];
2502
+ const M = await a.uploadFn(k);
2503
+ x.value = [...x.value, M];
2500
2504
  } catch (M) {
2501
- const j = M instanceof Error ? M.message : "Couldn't attach that file.";
2502
- a.chatController?.notify(`Upload failed — ${j}`);
2505
+ const N = M instanceof Error ? M.message : "Couldn't attach that file.";
2506
+ a.chatController?.notify(`Upload failed — ${N}`);
2503
2507
  } finally {
2504
- u.value = !1, k.value = "";
2508
+ u.value = !1, f.value = "";
2505
2509
  }
2506
2510
  }
2507
2511
  }
2508
- p(Dt, "handleFileSelect");
2509
- function pt(A) {
2510
- b.value = b.value.filter((k, g) => g !== A);
2512
+ p(ft, "handleFileSelect");
2513
+ function F(C) {
2514
+ x.value = x.value.filter((f, k) => k !== C);
2511
2515
  }
2512
- p(pt, "removeAttachment");
2513
- function U(A, k) {
2514
- if (k === 0) {
2515
- const _e = A[k];
2516
- return _e?.timestamp ? Ye(new Date(_e.timestamp)) : null;
2516
+ p(F, "removeAttachment");
2517
+ function Qe(C, f) {
2518
+ if (f === 0) {
2519
+ const Pe = C[f];
2520
+ return Pe?.timestamp ? H(new Date(Pe.timestamp)) : null;
2517
2521
  }
2518
- const g = A[k - 1], M = A[k];
2519
- if (!g?.timestamp || !M?.timestamp) return null;
2520
- const j = new Date(g.timestamp).getTime();
2521
- return new Date(M.timestamp).getTime() - j > 36e5 ? Ye(new Date(M.timestamp)) : null;
2522
+ const k = C[f - 1], M = C[f];
2523
+ if (!k?.timestamp || !M?.timestamp) return null;
2524
+ const N = new Date(k.timestamp).getTime();
2525
+ return new Date(M.timestamp).getTime() - N > 36e5 ? H(new Date(M.timestamp)) : null;
2522
2526
  }
2523
- p(U, "shouldShowTimeDivider");
2524
- function Ye(A) {
2525
- const k = /* @__PURE__ */ new Date(), g = A.toDateString() === k.toDateString(), M = new Date(k);
2527
+ p(Qe, "shouldShowTimeDivider");
2528
+ function H(C) {
2529
+ const f = /* @__PURE__ */ new Date(), k = C.toDateString() === f.toDateString(), M = new Date(f);
2526
2530
  M.setDate(M.getDate() - 1);
2527
- const j = A.toDateString() === M.toDateString(), J = A.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2528
- if (g) return J;
2529
- if (j) return `Yesterday, ${J}`;
2530
- const Ze = A.getFullYear() === k.getFullYear();
2531
- return `${A.toLocaleDateString("en-US", {
2531
+ const N = C.toDateString() === M.toDateString(), xe = C.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2532
+ if (k) return xe;
2533
+ if (N) return `Yesterday, ${xe}`;
2534
+ const ze = C.getFullYear() === f.getFullYear();
2535
+ return `${C.toLocaleDateString("en-US", {
2532
2536
  weekday: "long",
2533
2537
  month: "short",
2534
2538
  day: "numeric",
2535
- ...Ze ? {} : { year: "numeric" }
2536
- })}, ${J}`;
2539
+ ...ze ? {} : { year: "numeric" }
2540
+ })}, ${xe}`;
2537
2541
  }
2538
- return p(Ye, "formatTimeDivider"), (A, k) => (y(), T("div", di, [
2539
- C.value ? B("", !0) : (y(), T("div", fi, [
2540
- Je(Xs, {
2542
+ return p(H, "formatTimeDivider"), (C, f) => (y(), T("div", di, [
2543
+ A.value ? B("", !0) : (y(), T("div", fi, [
2544
+ Fe(Ks, {
2541
2545
  agent: a.agent,
2542
- "is-online": w.value
2546
+ "is-online": _.value
2543
2547
  }, null, 8, ["agent", "is-online"])
2544
2548
  ])),
2545
- O.value ? (y(), T("div", {
2549
+ te.value ? (y(), T("div", {
2546
2550
  key: 1,
2547
- class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", C.value ? "text-theme-400" : "text-white/60"])
2551
+ class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", A.value ? "text-theme-400" : "text-white/60"])
2548
2552
  }, [
2549
2553
  v("i", {
2550
- class: E(["i-heroicons-cloud-arrow-down size-8", C.value ? "text-theme-300" : "text-white/40"])
2554
+ class: E(["i-heroicons-cloud-arrow-down size-8", A.value ? "text-theme-300" : "text-white/40"])
2551
2555
  }, null, 2),
2552
- v("span", null, re(be.value), 1)
2553
- ], 2)) : ie.value ? (y(), T("div", {
2556
+ v("span", null, ne(se.value), 1)
2557
+ ], 2)) : oe.value ? (y(), T("div", {
2554
2558
  key: 2,
2555
- class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", C.value ? "text-theme-400" : "text-theme-600"])
2559
+ class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", A.value ? "text-theme-400" : "text-theme-600"])
2556
2560
  }, [
2557
- Je(Ln, { class: "size-4" })
2561
+ Fe(Ln, { class: "size-4" })
2558
2562
  ], 2)) : a.setupHint ? (y(), T("div", {
2559
2563
  key: 3,
2560
2564
  class: E(["flex items-center justify-center gap-1.5 py-2 text-[11px]", we.value])
2561
2565
  }, [
2562
- k[6] || (k[6] = v("i", { class: "i-tabler-tool size-3" }, null, -1)),
2563
- v("span", null, re(a.setupHint), 1)
2566
+ f[6] || (f[6] = v("i", { class: "i-tabler-tool size-3" }, null, -1)),
2567
+ v("span", null, ne(a.setupHint), 1)
2564
2568
  ], 2)) : B("", !0),
2565
- Je(pi, {
2569
+ Fe(pi, {
2566
2570
  ref_key: "chatScroller",
2567
2571
  ref: o,
2568
2572
  class: "flex-1"
2569
2573
  }, {
2570
- default: Ds(() => [
2574
+ default: Ms(() => [
2571
2575
  v("div", gi, [
2572
- G.value.length === 0 && !ie.value && !O.value ? (y(), T("div", mi, [
2573
- v("div", bi, [
2576
+ O.value.length === 0 && !oe.value && !te.value ? (y(), T("div", mi, [
2577
+ v("div", xi, [
2574
2578
  v("img", {
2575
2579
  src: a.agent.avatarUrl.value,
2576
2580
  alt: a.agent.displayName.value,
2577
- class: E(["size-full rounded-full object-cover ring-1", C.value ? "ring-black/5" : "ring-white/10"])
2578
- }, null, 10, xi),
2579
- w.value ? (y(), T("span", {
2581
+ class: E(["size-full rounded-full object-cover ring-1", A.value ? "ring-black/5" : "ring-white/10"])
2582
+ }, null, 10, bi),
2583
+ _.value ? (y(), T("span", {
2580
2584
  key: 0,
2581
- class: E(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", C.value ? "bg-white" : "bg-theme-900"])
2582
- }, [...k[7] || (k[7] = [
2585
+ class: E(["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", A.value ? "bg-white" : "bg-theme-900"])
2586
+ }, [...f[7] || (f[7] = [
2583
2587
  v("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2584
2588
  ])], 2)) : B("", !0)
2585
2589
  ]),
2586
2590
  v("div", {
2587
- class: E(["text-base @sm/chat:text-lg font-semibold", C.value ? "text-theme-900" : "text-white"])
2588
- }, re(a.agent.displayName.value), 3),
2591
+ class: E(["text-base @sm/chat:text-lg font-semibold", A.value ? "text-theme-900" : "text-white"])
2592
+ }, ne(a.agent.displayName.value), 3),
2589
2593
  v("p", {
2590
2594
  class: E(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
2591
- }, re(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2592
- n.value.length > 0 && !Q.value ? (y(), T("div", ki, [
2593
- (y(!0), T(Te, null, at(n.value, (g) => (y(), T("button", {
2594
- key: g,
2595
+ }, ne(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2596
+ n.value.length > 0 && !Ee.value ? (y(), T("div", ki, [
2597
+ (y(!0), T(ye, null, ot(n.value, (k) => (y(), T("button", {
2598
+ key: k,
2595
2599
  type: "button",
2596
2600
  "data-test": "chat-starter-prompt",
2597
- class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", C.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
2598
- onClick: /* @__PURE__ */ p((M) => Rt(g), "onClick")
2599
- }, re(g), 11, wi))), 128))
2601
+ class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", A.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
2602
+ onClick: /* @__PURE__ */ p((M) => It(k), "onClick")
2603
+ }, ne(k), 11, wi))), 128))
2600
2604
  ])) : B("", !0),
2601
2605
  v("div", {
2602
- class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", C.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2606
+ class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", A.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2603
2607
  title: r.value.tooltip
2604
2608
  }, [
2605
2609
  v("i", {
2606
2610
  class: E([r.value.icon, "size-3"])
2607
2611
  }, null, 2),
2608
- v("span", null, re(r.value.label), 1)
2612
+ v("span", null, ne(r.value.label), 1)
2609
2613
  ], 10, vi)
2610
2614
  ])) : B("", !0),
2611
- G.value.length > 0 ? (y(), T("div", yi, [
2615
+ O.value.length > 0 ? (y(), T("div", yi, [
2612
2616
  v("button", {
2613
2617
  type: "button",
2614
2618
  "data-test": "chat-new-session",
2615
- class: E(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", C.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2619
+ class: E(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", A.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2616
2620
  onClick: Oe
2617
- }, [...k[8] || (k[8] = [
2621
+ }, [...f[8] || (f[8] = [
2618
2622
  v("i", { class: "i-tabler-refresh size-3" }, null, -1),
2619
2623
  v("span", null, "New chat", -1)
2620
2624
  ])], 2)
2621
2625
  ])) : B("", !0),
2622
- (y(!0), T(Te, null, at(G.value, (g, M) => (y(), T(Te, {
2623
- key: g.id
2626
+ (y(!0), T(ye, null, ot(O.value, (k, M) => (y(), T(ye, {
2627
+ key: k.id
2624
2628
  }, [
2625
- U(G.value, M) ? (y(), T("div", Ti, [
2629
+ Qe(O.value, M) ? (y(), T("div", Ti, [
2626
2630
  v("div", {
2627
- class: E(["flex-1 h-px", q.value])
2631
+ class: E(["flex-1 h-px", _e.value])
2628
2632
  }, null, 2),
2629
2633
  v("span", {
2630
2634
  class: E(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
2631
- }, re(U(G.value, M)), 3),
2635
+ }, ne(Qe(O.value, M)), 3),
2632
2636
  v("div", {
2633
- class: E(["flex-1 h-px", q.value])
2637
+ class: E(["flex-1 h-px", _e.value])
2634
2638
  }, null, 2)
2635
2639
  ])) : B("", !0),
2636
- g.sender === "system" ? (y(), T("div", {
2640
+ k.sender === "system" ? (y(), T("div", {
2637
2641
  key: 1,
2638
2642
  "data-test": "messaging-system-msg",
2639
- "data-issue-code": g.issue?.code,
2640
- "data-issue-bucket": g.issue?.bucket,
2641
- class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", C.value ? "text-theme-500" : "text-white/70"])
2643
+ "data-issue-code": k.issue?.code,
2644
+ "data-issue-bucket": k.issue?.bucket,
2645
+ class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", A.value ? "text-theme-500" : "text-white/70"])
2642
2646
  }, [
2643
2647
  v("i", {
2644
- class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", g.issue?.bucket === "account" ? C.value ? "text-amber-500" : "text-amber-300" : C.value ? "text-red-500" : "text-red-300"])
2648
+ class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", k.issue?.bucket === "account" ? A.value ? "text-amber-500" : "text-amber-300" : A.value ? "text-red-500" : "text-red-300"])
2645
2649
  }, null, 2),
2646
2650
  v("div", Ai, [
2647
- v("span", null, re(g.text), 1),
2648
- g.issue?.help ? (y(), T("span", {
2651
+ Fe(ns, {
2652
+ text: k.text,
2653
+ inverted: !A.value
2654
+ }, null, 8, ["text", "inverted"]),
2655
+ k.issue?.help ? (y(), T("span", {
2649
2656
  key: 0,
2650
- class: E(["text-[12px]", C.value ? "text-theme-400" : "text-white/55"])
2651
- }, re(g.issue.help), 3)) : B("", !0),
2652
- g.issue?.actionUrl ? (y(), T("a", {
2657
+ class: E(["text-[12px]", A.value ? "text-theme-400" : "text-white/55"])
2658
+ }, ne(k.issue.help), 3)) : B("", !0),
2659
+ k.issue?.actionUrl && !g(k.text) ? (y(), T("a", {
2653
2660
  key: 1,
2654
- href: g.issue.actionUrl,
2661
+ href: k.issue.actionUrl,
2655
2662
  "data-test": "messaging-system-msg-action",
2656
- class: E(["text-[12px] font-medium inline-flex items-center gap-1", C.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2663
+ class: E(["text-[12px] font-medium inline-flex items-center gap-1", A.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2657
2664
  }, [
2658
- et(re(g.issue.actionLabel) + " ", 1),
2659
- k[9] || (k[9] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2665
+ nt(ne(k.issue.actionLabel) + " ", 1),
2666
+ f[9] || (f[9] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2660
2667
  ], 10, Ei)) : B("", !0)
2661
2668
  ])
2662
2669
  ], 10, Si)) : (y(), T("div", {
2663
2670
  key: 2,
2664
- "data-test": g.sender === "agent" ? "messaging-assistant-msg" : g.sender === "user" ? "messaging-user-msg" : void 0,
2671
+ "data-test": k.sender === "agent" ? "messaging-assistant-msg" : k.sender === "user" ? "messaging-user-msg" : void 0,
2665
2672
  class: E(["flex gap-2 items-end", {
2666
- "justify-end": g.sender === "user",
2667
- "justify-start": g.sender === "agent",
2668
- "mb-4": m(G.value, M)
2673
+ "justify-end": k.sender === "user",
2674
+ "justify-start": k.sender === "agent",
2675
+ "mb-4": m(O.value, M)
2669
2676
  }])
2670
2677
  }, [
2671
- g.sender === "agent" ? (y(), T("div", Ri, [
2672
- m(G.value, M) ? (y(), T("img", {
2678
+ k.sender === "agent" ? (y(), T("div", Ri, [
2679
+ m(O.value, M) ? (y(), T("img", {
2673
2680
  key: 0,
2674
2681
  src: a.agent.avatarUrl.value,
2675
2682
  alt: a.agent.displayName.value,
2676
- class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
2683
+ class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", A.value ? "ring-1 ring-black/5" : ""])
2677
2684
  }, null, 10, Ci)) : B("", !0)
2678
2685
  ])) : B("", !0),
2679
2686
  v("div", {
2680
- class: E(g.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2687
+ class: E(k.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2681
2688
  }, [
2682
- g.attachments?.length ? (y(), T("div", {
2689
+ k.attachments?.length ? (y(), T("div", {
2683
2690
  key: 0,
2684
- class: E(["mb-1 space-y-1", g.sender === "user" ? "flex flex-col items-end" : ""])
2691
+ class: E(["mb-1 space-y-1", k.sender === "user" ? "flex flex-col items-end" : ""])
2685
2692
  }, [
2686
- (y(!0), T(Te, null, at(g.attachments, (j, J) => (y(), T(Te, { key: J }, [
2687
- j.type === "image" ? (y(), T("img", {
2693
+ (y(!0), T(ye, null, ot(k.attachments, (N, xe) => (y(), T(ye, { key: xe }, [
2694
+ N.type === "image" ? (y(), T("img", {
2688
2695
  key: 0,
2689
- src: j.url,
2690
- alt: j.name,
2696
+ src: N.url,
2697
+ alt: N.name,
2691
2698
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2692
- }, null, 8, Ii)) : j.type === "audio" ? (y(), T("audio", {
2699
+ }, null, 8, Ii)) : N.type === "audio" ? (y(), T("audio", {
2693
2700
  key: 1,
2694
- src: j.url,
2701
+ src: N.url,
2695
2702
  controls: "",
2696
2703
  class: "max-w-full"
2697
2704
  }, null, 8, Di)) : (y(), T("a", {
2698
2705
  key: 2,
2699
- href: j.url,
2706
+ href: N.url,
2700
2707
  target: "_blank",
2701
2708
  rel: "noopener",
2702
- class: E(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", C.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2709
+ class: E(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", A.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2703
2710
  }, [
2704
- k[10] || (k[10] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2705
- et(" " + re(j.name), 1)
2711
+ f[10] || (f[10] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2712
+ nt(" " + ne(N.name), 1)
2706
2713
  ], 10, Mi))
2707
2714
  ], 64))), 128))
2708
2715
  ], 2)) : B("", !0),
2709
- g.text ? (y(), T("div", {
2716
+ k.text ? (y(), T("div", {
2710
2717
  key: 1,
2711
2718
  class: E(["rounded-2xl px-3.5 py-2", [
2712
- g.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : C.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2719
+ k.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : A.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2713
2720
  ]])
2714
2721
  }, [
2715
- Je(ui, {
2716
- text: g.text,
2717
- inverted: g.sender === "user" || !C.value,
2718
- streaming: g.id === P.value,
2719
- onClick: k[0] || (k[0] = Ms(() => {
2722
+ Fe(ns, {
2723
+ text: k.text,
2724
+ inverted: k.sender === "user" || !A.value,
2725
+ streaming: k.id === ce.value,
2726
+ onClick: f[0] || (f[0] = Ls(() => {
2720
2727
  }, ["stop"]))
2721
2728
  }, null, 8, ["text", "inverted", "streaming"])
2722
2729
  ], 2)) : B("", !0)
2723
2730
  ], 2)
2724
2731
  ], 10, _i))
2725
2732
  ], 64))), 128)),
2726
- de.value ? (y(), T("div", Li, [
2733
+ re.value ? (y(), T("div", Li, [
2727
2734
  v("img", {
2728
2735
  src: a.agent.avatarUrl.value,
2729
2736
  alt: a.agent.displayName.value,
2730
- class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
2737
+ class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", A.value ? "ring-1 ring-black/5" : ""])
2731
2738
  }, null, 10, Oi),
2732
2739
  v("div", {
2733
- class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", C.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2740
+ class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", A.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2734
2741
  }, [
2735
2742
  v("i", {
2736
- class: E(["i-svg-spinners-3-dots-bounce size-7", C.value ? "text-theme-400" : "text-white/50"])
2743
+ class: E(["i-svg-spinners-3-dots-bounce size-7", A.value ? "text-theme-400" : "text-white/50"])
2737
2744
  }, null, 2)
2738
2745
  ], 2)
2739
2746
  ])) : B("", !0)
@@ -2742,34 +2749,34 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2742
2749
  _: 1
2743
2750
  }, 512),
2744
2751
  v("div", {
2745
- class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", C.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2752
+ class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", A.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2746
2753
  }, [
2747
- b.value.length > 0 ? (y(), T("div", zi, [
2748
- (y(!0), T(Te, null, at(b.value, (g, M) => (y(), T("div", {
2754
+ x.value.length > 0 ? (y(), T("div", zi, [
2755
+ (y(!0), T(ye, null, ot(x.value, (k, M) => (y(), T("div", {
2749
2756
  key: M,
2750
2757
  class: "relative shrink-0 group"
2751
2758
  }, [
2752
- g.type === "image" ? (y(), T("img", {
2759
+ k.type === "image" ? (y(), T("img", {
2753
2760
  key: 0,
2754
- src: g.url,
2755
- alt: g.name,
2756
- class: E(["size-14 rounded-xl object-cover border", C.value ? "border-black/10" : "border-white/20"])
2761
+ src: k.url,
2762
+ alt: k.name,
2763
+ class: E(["size-14 rounded-xl object-cover border", A.value ? "border-black/10" : "border-white/20"])
2757
2764
  }, null, 10, Pi)) : (y(), T("div", {
2758
2765
  key: 1,
2759
- class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", C.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2766
+ class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", A.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2760
2767
  }, [
2761
- k[11] || (k[11] = v("i", { class: "i-tabler-file size-4" }, null, -1)),
2762
- v("span", Ni, re(g.name), 1)
2768
+ f[11] || (f[11] = v("i", { class: "i-tabler-file size-4" }, null, -1)),
2769
+ v("span", Ni, ne(k.name), 1)
2763
2770
  ], 2)),
2764
2771
  v("button", {
2765
2772
  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",
2766
- onClick: /* @__PURE__ */ p((j) => pt(M), "onClick")
2767
- }, [...k[12] || (k[12] = [
2773
+ onClick: /* @__PURE__ */ p((N) => F(M), "onClick")
2774
+ }, [...f[12] || (f[12] = [
2768
2775
  v("i", { class: "i-tabler-x size-3" }, null, -1)
2769
2776
  ])], 8, $i)
2770
2777
  ]))), 128)),
2771
2778
  u.value ? (y(), T("div", Ui, [
2772
- Je(Ln, { class: "size-5" })
2779
+ Fe(Ln, { class: "size-5" })
2773
2780
  ])) : B("", !0)
2774
2781
  ])) : B("", !0),
2775
2782
  a.uploadFn ? (y(), T("input", {
@@ -2779,60 +2786,60 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2779
2786
  type: "file",
2780
2787
  accept: "image/*,audio/*,video/*",
2781
2788
  class: "hidden",
2782
- onChange: Dt
2789
+ onChange: ft
2783
2790
  }, null, 544)) : B("", !0),
2784
2791
  v("div", {
2785
- class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", C.value ? l.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : l.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2792
+ class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", A.value ? l.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : l.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2786
2793
  }, [
2787
2794
  v("button", {
2788
2795
  class: E(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2789
2796
  a.uploadFn ? "cursor-pointer" : "cursor-default",
2790
- C.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2797
+ A.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2791
2798
  u.value ? "opacity-50 pointer-events-none" : ""
2792
2799
  ]]),
2793
- disabled: Q.value || u.value || !a.uploadFn,
2794
- onClick: k[1] || (k[1] = (g) => a.uploadFn && ht())
2800
+ disabled: Ee.value || u.value || !a.uploadFn,
2801
+ onClick: f[1] || (f[1] = (k) => a.uploadFn && Mt())
2795
2802
  }, [
2796
2803
  u.value ? (y(), T("i", Fi)) : (y(), T("i", Hi))
2797
2804
  ], 10, Bi),
2798
- ns(v("textarea", {
2805
+ ss(v("textarea", {
2799
2806
  ref_key: "textarea",
2800
2807
  ref: d,
2801
- "onUpdate:modelValue": k[2] || (k[2] = (g) => s.value = g),
2808
+ "onUpdate:modelValue": f[2] || (f[2] = (k) => s.value = k),
2802
2809
  "data-test": "messaging-input",
2803
2810
  rows: "1",
2804
2811
  enterkeyhint: "send",
2805
- placeholder: _t.value,
2806
- disabled: Q.value,
2812
+ placeholder: Ct.value,
2813
+ disabled: Ee.value,
2807
2814
  style: { fontSize: "16px", resize: "none" },
2808
- class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", C.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2809
- onKeydown: Ct,
2810
- onFocus: k[3] || (k[3] = (g) => l.value = !0),
2811
- onBlur: k[4] || (k[4] = (g) => l.value = !1)
2815
+ class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", A.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2816
+ onKeydown: Dt,
2817
+ onFocus: f[3] || (f[3] = (k) => l.value = !0),
2818
+ onBlur: f[4] || (f[4] = (k) => l.value = !1)
2812
2819
  }, null, 42, Gi), [
2813
- [ss, s.value]
2820
+ [rs, s.value]
2814
2821
  ]),
2815
2822
  v("button", {
2816
2823
  "data-test": "messaging-send-btn",
2817
- class: E(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ut.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : C.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2818
- disabled: !ut.value,
2819
- onClick: k[5] || (k[5] = (g) => ve())
2820
- }, [...k[13] || (k[13] = [
2824
+ class: E(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", pt.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : A.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2825
+ disabled: !pt.value,
2826
+ onClick: f[5] || (f[5] = (k) => Ke())
2827
+ }, [...f[13] || (f[13] = [
2821
2828
  v("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2822
2829
  ])], 10, ji)
2823
2830
  ], 2),
2824
2831
  v("div", {
2825
- class: E(["text-[10px] text-center mt-2.5 select-none opacity-70", C.value ? "text-theme-400" : "text-white/50"])
2832
+ class: E(["text-[10px] text-center mt-2.5 select-none opacity-70", A.value ? "text-theme-400" : "text-white/50"])
2826
2833
  }, [
2827
- k[14] || (k[14] = et(" Press ", -1)),
2834
+ f[14] || (f[14] = nt(" Press ", -1)),
2828
2835
  v("kbd", {
2829
- class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2836
+ class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", A.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2830
2837
  }, "Enter", 2),
2831
- k[15] || (k[15] = et(" to send, ", -1)),
2838
+ f[15] || (f[15] = nt(" to send, ", -1)),
2832
2839
  v("kbd", {
2833
- class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2840
+ class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", A.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2834
2841
  }, "Shift+Enter", 2),
2835
- k[16] || (k[16] = et(" for new line ", -1))
2842
+ f[16] || (f[16] = nt(" for new line ", -1))
2836
2843
  ], 2)
2837
2844
  ], 2)
2838
2845
  ]));
@@ -2854,11 +2861,11 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2854
2861
  apiBase: {}
2855
2862
  },
2856
2863
  setup(a) {
2857
- const t = Os("AgentWrap"), e = a, n = e.sdk || zs.getInstance({
2864
+ const t = zs("AgentWrap"), e = a, n = e.sdk || Ps.getInstance({
2858
2865
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2859
2866
  ...e.apiBase && { apiBase: e.apiBase }
2860
- }), r = Z(!e.agent), s = rs(e.agent ? new wt({ config: e.agent }) : void 0), l = Z();
2861
- return St(async () => {
2867
+ }), r = Y(!e.agent), s = is(e.agent ? new yt({ config: e.agent }) : void 0), l = Y();
2868
+ return Et(async () => {
2862
2869
  if (e.agent) {
2863
2870
  t.debug("Agent provided via props, skipping fetch", {
2864
2871
  agentId: e.agent.agentId,
@@ -2884,7 +2891,7 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2884
2891
  try {
2885
2892
  r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2886
2893
  const o = await n.user.getPublicAgent({ handle: e.handle });
2887
- o ? (s.value = new wt({ config: o }), t.debug("Successfully fetched public agent", {
2894
+ o ? (s.value = new yt({ config: o }), t.debug("Successfully fetched public agent", {
2888
2895
  agentId: o.agentId,
2889
2896
  handle: o.handle
2890
2897
  }), o.agentId && n.user.track({
@@ -2937,9 +2944,9 @@ const ci = ["innerHTML"], ui = /* @__PURE__ */ ke({
2937
2944
  }), (o, d) => (y(), T("div", Wi, [
2938
2945
  r.value ? (y(), T("div", qi, [...d[0] || (d[0] = [
2939
2946
  v("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2940
- ])])) : s.value ? en(o.$slots, "default", {
2947
+ ])])) : s.value ? tn(o.$slots, "default", {
2941
2948
  key: 1,
2942
- sdk: Xt(n),
2949
+ sdk: Kt(n),
2943
2950
  agent: s.value,
2944
2951
  context: a.context,
2945
2952
  firstMessage: a.firstMessage,
@@ -2958,7 +2965,7 @@ export {
2958
2965
  Ji as c,
2959
2966
  ta as d,
2960
2967
  Ln as e,
2961
- Xs as f,
2968
+ Ks as f,
2962
2969
  Ki as g,
2963
2970
  Pn as h,
2964
2971
  Qi as p