@pagelines/sdk 1.0.502 → 1.0.504

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  var Mn = Object.defineProperty;
2
2
  var _s = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var p = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
3
+ var h = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
4
4
  var C = (a, t, e) => _s(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as Oe, openBlock as T, createElementBlock as S, createElementVNode as y, normalizeClass as A, ref as te, watch as ct, computed as G, createCommentVNode as B, renderSlot as ns, onMounted as nn, Fragment as Se, renderList as at, withDirectives as ss, vModelText as rs, unref as Qt, toDisplayString as ie, nextTick as Wt, createVNode as qt, createTextVNode as et, withModifiers as Rs, shallowRef as Is } from "vue";
6
- import { SettingsObject as Cs, Agent as Tt, getDefaultAvatarUrl as is, createLogger as Ds } from "@pagelines/core";
5
+ import { defineComponent as Me, openBlock as T, createElementBlock as S, createElementVNode as w, normalizeClass as A, ref as ee, watch as ot, computed as W, createCommentVNode as B, renderSlot as ns, onMounted as tn, Fragment as Te, renderList as it, withDirectives as ss, vModelText as rs, unref as Kt, toDisplayString as ie, nextTick as jt, createVNode as Wt, createTextVNode as Je, withModifiers as Rs, shallowRef as Is } from "vue";
6
+ import { SettingsObject as Cs, Agent as yt, getDefaultAvatarUrl as is, createLogger as Ds } from "@pagelines/core";
7
7
  import { P as Ms } from "./sdkClient.js";
8
8
  const Ls = { class: "spinner max-w-sm" }, Os = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, Ln = /* @__PURE__ */ Oe({
11
+ }, Ln = /* @__PURE__ */ Me({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
@@ -17,7 +17,7 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
17
17
  setup(a) {
18
18
  return (t, e) => (T(), S("div", Ls, [
19
19
  (T(), S("svg", Os, [
20
- y("circle", {
20
+ w("circle", {
21
21
  class: A([a.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
@@ -33,7 +33,7 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
33
33
  }), zs = [
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
- ], Ps = 9e4, dn = class dn extends Cs {
36
+ ], Ps = 9e4, pn = class pn extends Cs {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
39
  C(this, "isTextMode", !1);
@@ -41,16 +41,16 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
41
41
  C(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
43
  C(this, "conversationId");
44
- C(this, "textState", te({
44
+ C(this, "textState", ee({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- C(this, "agentMode", te("self"));
51
- C(this, "sharedMessages", te([]));
50
+ C(this, "agentMode", ee("self"));
51
+ C(this, "sharedMessages", ee([]));
52
52
  C(this, "_agent");
53
- this._agent = e.agent instanceof Tt ? e.agent : new Tt({ config: e.agent }), this.setupModeWatcher();
53
+ this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  return this._agent.chatAvailable.value;
@@ -81,6 +81,18 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
81
81
  { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: r, ...s ? { issue: s } : {} }
82
82
  ]);
83
83
  }
84
+ /**
85
+ * Surface a one-shot system bubble in the chat transcript.
86
+ *
87
+ * The single public entry for adjacent surfaces (file upload, voice, attach)
88
+ * to feed user-visible feedback into the same channel as send/stream errors.
89
+ * Without this, the chat surface had to fall back to `console.error` for
90
+ * upload failures — invisible to the user, the canonical "always give
91
+ * feedback" miss flagged in design.md → Action Feedback Contract.
92
+ */
93
+ notify(e) {
94
+ e && this.addMessage(e, "system");
95
+ }
84
96
  getDynamicSettings() {
85
97
  const { sdk: e } = this.settings;
86
98
  if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
@@ -110,7 +122,7 @@ Current User:
110
122
  });
111
123
  }
112
124
  setupModeWatcher() {
113
- ct(this.agentMode, async (e, n) => {
125
+ ot(this.agentMode, async (e, n) => {
114
126
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
115
127
  });
116
128
  }
@@ -196,40 +208,40 @@ Current User:
196
208
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
197
209
  const o = `stream-${Date.now()}`;
198
210
  let l = !1;
199
- const f = /* @__PURE__ */ p((d) => {
211
+ const m = /* @__PURE__ */ h((d) => {
200
212
  l || (l = !0, this.sharedMessages.value = [
201
213
  ...this.sharedMessages.value,
202
214
  { id: o, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
203
215
  ]);
204
- const g = this.sharedMessages.value, w = g[g.length - 1];
205
- w?.id === o && (w.text += d, this.sharedMessages.value = [...g]);
206
- }, "onDelta"), c = /* @__PURE__ */ p((d) => {
216
+ const g = this.sharedMessages.value, y = g[g.length - 1];
217
+ y?.id === o && (y.text += d, this.sharedMessages.value = [...g]);
218
+ }, "onDelta"), c = /* @__PURE__ */ h((d) => {
207
219
  if (!l) {
208
- x("empty_stream — assistant returned no content");
220
+ b("empty_stream — assistant returned no content");
209
221
  return;
210
222
  }
211
- const g = this.sharedMessages.value, w = g[g.length - 1];
212
- if (w?.id === o && w.text) {
213
- let E = w.text;
223
+ const g = this.sharedMessages.value, y = g[g.length - 1];
224
+ if (y?.id === o && y.text) {
225
+ let E = y.text;
214
226
  for (const O of zs)
215
227
  O.pattern.test(E) && (console.debug(`[chat] filtered directive: ${O.label}`), E = E.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
216
- E ? E !== w.text && (w.text = E, this.sharedMessages.value = [...g]) : this.sharedMessages.value = g.slice(0, -1);
228
+ E ? E !== y.text && (y.text = E, this.sharedMessages.value = [...g]) : this.sharedMessages.value = g.slice(0, -1);
217
229
  }
218
230
  d && (this.conversationId = d), this.updateState(this.textState, { isThinking: !1 });
219
- }, "onDone"), x = /* @__PURE__ */ p((d) => {
220
- const g = this.sharedMessages.value, w = g[g.length - 1];
221
- if (w?.id === o && !w.text && (this.sharedMessages.value = g.slice(0, -1)), typeof d == "object" && d.code && d.error) {
222
- const { bucket: U, actionUrl: ae, actionLabel: le, help: z } = d;
223
- if (U !== void 0 || (/* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP", "EMPTY_STREAM", "RATE_LIMIT"])).has(d.code)) {
224
- const V = U && ae && le ? { code: d.code, bucket: U, actionLabel: le, actionUrl: ae, ...z ? { help: z } : {} } : void 0;
225
- this.addMessage(d.error, "system", void 0, V), U === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
231
+ }, "onDone"), b = /* @__PURE__ */ h((d) => {
232
+ const g = this.sharedMessages.value, y = g[g.length - 1];
233
+ if (y?.id === o && !y.text && (this.sharedMessages.value = g.slice(0, -1)), typeof d == "object" && d.code && d.error) {
234
+ const { bucket: ae, actionUrl: ce, actionLabel: ne, help: N } = d;
235
+ if (ae !== void 0 || (/* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP", "EMPTY_STREAM", "RATE_LIMIT"])).has(d.code)) {
236
+ const Q = ae && ce && ne ? { code: d.code, bucket: ae, actionLabel: ne, actionUrl: ce, ...N ? { help: N } : {} } : void 0;
237
+ this.addMessage(d.error, "system", void 0, Q), ae === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
226
238
  } else
227
239
  this.handleError(new Error(d.error));
228
240
  return;
229
241
  }
230
242
  const E = typeof d == "string" ? d : d.error, O = this.mapChatError(E);
231
243
  this.isTransientError(E) ? (this.logger.warn("Chat turn failed (transient):", { raw: E, friendly: O }), this.addMessage(O, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(O), E);
232
- }, "onError"), h = /* @__PURE__ */ p((d) => {
244
+ }, "onError"), p = /* @__PURE__ */ h((d) => {
233
245
  this.addMessage(d, "system");
234
246
  }, "onStatus");
235
247
  try {
@@ -238,27 +250,27 @@ Current User:
238
250
  attachments: n,
239
251
  conversationId: this.conversationId,
240
252
  history: this.buildHistory(),
241
- onDelta: f,
253
+ onDelta: m,
242
254
  onDone: c,
243
- onError: x,
244
- onStatus: h
255
+ onError: b,
256
+ onStatus: p
245
257
  }) : s.chat.chatStreamPublic({
246
258
  handle: this._agent.handle.value,
247
259
  message: e,
248
260
  attachments: n,
249
261
  anonymousId: s.user.generateAnonId(),
250
262
  context: this.getDynamicSettings().context || void 0,
251
- onDelta: f,
263
+ onDelta: m,
252
264
  onDone: c,
253
- onError: x,
254
- onStatus: h
265
+ onError: b,
266
+ onStatus: p
255
267
  });
256
268
  await Promise.race([
257
269
  d,
258
- new Promise((g, w) => setTimeout(() => w(new Error("timed out")), Ps))
270
+ new Promise((g, y) => setTimeout(() => y(new Error("timed out")), Ps))
259
271
  ]);
260
272
  } catch (d) {
261
- x(d.message || "Something went wrong");
273
+ b(d.message || "Something went wrong");
262
274
  }
263
275
  }
264
276
  buildHistory() {
@@ -282,30 +294,30 @@ Current User:
282
294
  await this.endConversation();
283
295
  }
284
296
  };
285
- p(dn, "AgentChatController");
286
- let On = dn;
297
+ h(pn, "AgentChatController");
298
+ let On = pn;
287
299
  function zn(a) {
288
300
  return a ? typeof a == "string" ? a : a.src || "" : "";
289
301
  }
290
- p(zn, "getImageSrc");
302
+ h(zn, "getImageSrc");
291
303
  function Gi(a) {
292
304
  return zn(a.cover) || zn(a.avatar) || is(a.name);
293
305
  }
294
- p(Gi, "getAgentAvatarUrl");
306
+ h(Gi, "getAgentAvatarUrl");
295
307
  function Pn(a) {
296
308
  const t = a.target;
297
309
  t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = is());
298
310
  }
299
- p(Pn, "handleImageError");
311
+ h(Pn, "handleImageError");
300
312
  function ji(a) {
301
313
  const { template: t, agent: e } = a;
302
314
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
303
315
  }
304
- p(ji, "parseButtonTemplate");
316
+ h(ji, "parseButtonTemplate");
305
317
  const Ns = {
306
318
  key: 0,
307
319
  class: "absolute inset-0 flex items-center justify-center"
308
- }, Wi = /* @__PURE__ */ Oe({
320
+ }, Wi = /* @__PURE__ */ Me({
309
321
  __name: "ElAgentButton",
310
322
  props: {
311
323
  theme: { default: "primary" },
@@ -315,16 +327,16 @@ const Ns = {
315
327
  iconAfter: {}
316
328
  },
317
329
  setup(a) {
318
- const t = G(() => ({
330
+ const t = W(() => ({
319
331
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
320
332
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
321
333
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
322
334
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
323
- })[a.theme]), e = G(() => ({
335
+ })[a.theme]), e = W(() => ({
324
336
  sm: "px-4 py-2 text-sm",
325
337
  md: "px-6 py-3 text-base",
326
338
  lg: "px-8 py-4 text-base"
327
- })[a.size]), n = G(() => ({
339
+ })[a.size]), n = W(() => ({
328
340
  sm: "size-4",
329
341
  md: "size-4",
330
342
  lg: "size-5"
@@ -333,9 +345,9 @@ const Ns = {
333
345
  class: A(["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]])
334
346
  }, [
335
347
  a.loading ? (T(), S("div", Ns, [...s[0] || (s[0] = [
336
- y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
348
+ w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
337
349
  ])])) : B("", !0),
338
- y("span", {
350
+ w("span", {
339
351
  class: A(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
340
352
  }, [
341
353
  a.icon ? (T(), S("i", {
@@ -350,7 +362,7 @@ const Ns = {
350
362
  ], 2)
351
363
  ], 2));
352
364
  }
353
- }), $s = ["value"], qi = /* @__PURE__ */ Oe({
365
+ }), $s = ["value"], qi = /* @__PURE__ */ Me({
354
366
  __name: "AgentInputEmail",
355
367
  props: {
356
368
  modelValue: { default: "" }
@@ -368,7 +380,7 @@ const Ns = {
368
380
  onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
369
381
  }, null, 40, $s));
370
382
  }
371
- }), Bs = { class: "flex gap-1.5 justify-center" }, Us = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Vi = /* @__PURE__ */ Oe({
383
+ }), Bs = { class: "flex gap-1.5 justify-center" }, Us = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Vi = /* @__PURE__ */ Me({
372
384
  __name: "AgentInputOneTimeCode",
373
385
  props: {
374
386
  modelValue: {},
@@ -377,16 +389,16 @@ const Ns = {
377
389
  },
378
390
  emits: ["update:modelValue", "autoSubmit"],
379
391
  setup(a, { emit: t }) {
380
- const e = a, n = t, r = te([]), s = te(Array.from({ length: e.length }).fill("")), o = te(!1);
381
- nn(() => {
392
+ const e = a, n = t, r = ee([]), s = ee(Array.from({ length: e.length }).fill("")), o = ee(!1);
393
+ tn(() => {
382
394
  e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
383
- }), ct(() => e.modelValue, (h) => {
384
- s.value = h ? h.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
385
- }), ct(s, () => {
386
- const h = s.value.filter(Boolean).join("");
387
- n("update:modelValue", h), h.length === e.length && n("autoSubmit", h);
395
+ }), ot(() => e.modelValue, (p) => {
396
+ s.value = p ? p.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
397
+ }), ot(s, () => {
398
+ const p = s.value.filter(Boolean).join("");
399
+ n("update:modelValue", p), p.length === e.length && n("autoSubmit", p);
388
400
  }, { deep: !0 });
389
- function l(h, d) {
401
+ function l(p, d) {
390
402
  d.preventDefault(), o.value = !0;
391
403
  const g = (d.clipboardData?.getData("text") || "").replace(/\D/g, "");
392
404
  if (g.length === e.length)
@@ -394,47 +406,47 @@ const Ns = {
394
406
  r.value[e.length - 1]?.focus(), o.value = !1;
395
407
  }, 10);
396
408
  else {
397
- const w = [...s.value];
398
- g.split("").slice(0, e.length - h).forEach((O, U) => {
399
- w[h + U] = O;
400
- }), s.value = w;
401
- const E = Math.min(h + g.length, e.length - 1);
409
+ const y = [...s.value];
410
+ g.split("").slice(0, e.length - p).forEach((O, ae) => {
411
+ y[p + ae] = O;
412
+ }), s.value = y;
413
+ const E = Math.min(p + g.length, e.length - 1);
402
414
  setTimeout(() => {
403
415
  r.value[E]?.focus(), o.value = !1;
404
416
  }, 10);
405
417
  }
406
418
  }
407
- p(l, "onPaste");
408
- function f(h, d) {
419
+ h(l, "onPaste");
420
+ function m(p, d) {
409
421
  const g = d.target.value.slice(-1).replace(/\D/g, "");
410
- s.value[h] = g, g && h < e.length - 1 && r.value[h + 1]?.focus();
422
+ s.value[p] = g, g && p < e.length - 1 && r.value[p + 1]?.focus();
411
423
  }
412
- p(f, "onInput");
413
- function c(h, d) {
414
- d.key === "Backspace" ? (d.preventDefault(), s.value[h] = "", h > 0 && r.value[h - 1]?.focus()) : d.key === "ArrowLeft" && h > 0 ? r.value[h - 1]?.focus() : d.key === "ArrowRight" && h < e.length - 1 && r.value[h + 1]?.focus();
424
+ h(m, "onInput");
425
+ function c(p, d) {
426
+ d.key === "Backspace" ? (d.preventDefault(), s.value[p] = "", p > 0 && r.value[p - 1]?.focus()) : d.key === "ArrowLeft" && p > 0 ? r.value[p - 1]?.focus() : d.key === "ArrowRight" && p < e.length - 1 && r.value[p + 1]?.focus();
415
427
  }
416
- p(c, "onKeydown");
417
- function x(h) {
418
- if (r.value[h]?.select(), !o.value && s.value[h])
419
- for (let d = h; d < e.length; d++)
428
+ h(c, "onKeydown");
429
+ function b(p) {
430
+ if (r.value[p]?.select(), !o.value && s.value[p])
431
+ for (let d = p; d < e.length; d++)
420
432
  s.value[d] = "";
421
433
  }
422
- return p(x, "onFocus"), (h, d) => (T(), S("div", Bs, [
423
- (T(!0), S(Se, null, at(a.length, (g) => ss((T(), S("input", {
434
+ return h(b, "onFocus"), (p, d) => (T(), S("div", Bs, [
435
+ (T(!0), S(Te, null, it(a.length, (g) => ss((T(), S("input", {
424
436
  key: g,
425
437
  ref_for: !0,
426
- ref: /* @__PURE__ */ p((w) => r.value[g - 1] = w, "ref"),
427
- "onUpdate:modelValue": /* @__PURE__ */ p((w) => s.value[g - 1] = w, "onUpdate:modelValue"),
438
+ ref: /* @__PURE__ */ h((y) => r.value[g - 1] = y, "ref"),
439
+ "onUpdate:modelValue": /* @__PURE__ */ h((y) => s.value[g - 1] = y, "onUpdate:modelValue"),
428
440
  type: "text",
429
441
  inputmode: "numeric",
430
442
  autocomplete: "one-time-code",
431
443
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
432
444
  style: { "font-size": "16px" },
433
445
  maxlength: "1",
434
- onInput: /* @__PURE__ */ p((w) => f(g - 1, w), "onInput"),
435
- onKeydown: /* @__PURE__ */ p((w) => c(g - 1, w), "onKeydown"),
436
- onPaste: /* @__PURE__ */ p((w) => l(g - 1, w), "onPaste"),
437
- onFocus: /* @__PURE__ */ p((w) => x(g - 1), "onFocus")
446
+ onInput: /* @__PURE__ */ h((y) => m(g - 1, y), "onInput"),
447
+ onKeydown: /* @__PURE__ */ h((y) => c(g - 1, y), "onKeydown"),
448
+ onPaste: /* @__PURE__ */ h((y) => l(g - 1, y), "onPaste"),
449
+ onFocus: /* @__PURE__ */ h((y) => b(g - 1), "onFocus")
438
450
  }, null, 40, Us)), [
439
451
  [rs, s.value[g - 1]]
440
452
  ])), 128))
@@ -443,7 +455,7 @@ const Ns = {
443
455
  }), Fs = { class: "relative flex-shrink-0" }, Hs = ["src", "alt"], Gs = { class: "absolute top-1 right-1" }, js = {
444
456
  key: 1,
445
457
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
446
- }, Ws = { class: "min-w-0" }, qs = /* @__PURE__ */ Oe({
458
+ }, Ws = { class: "min-w-0" }, qs = /* @__PURE__ */ Me({
447
459
  __name: "ElModeHeader",
448
460
  props: {
449
461
  agent: {},
@@ -457,36 +469,36 @@ const Ns = {
457
469
  a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
458
470
  ]])
459
471
  }, [
460
- y("div", Fs, [
461
- y("div", {
472
+ w("div", Fs, [
473
+ w("div", {
462
474
  class: A(["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"])
463
475
  }, [
464
- y("img", {
476
+ w("img", {
465
477
  src: a.agent.avatarUrl.value,
466
478
  alt: a.agent.displayName.value,
467
479
  class: "w-full h-full object-cover",
468
480
  onError: e[0] || (e[0] = //@ts-ignore
469
- (...n) => Qt(Pn) && Qt(Pn)(...n))
481
+ (...n) => Kt(Pn) && Kt(Pn)(...n))
470
482
  }, null, 40, Hs)
471
483
  ], 2),
472
- y("div", Gs, [
473
- a.isOnline ? (T(), S(Se, { key: 0 }, [
474
- e[1] || (e[1] = y("div", {
484
+ w("div", Gs, [
485
+ a.isOnline ? (T(), S(Te, { key: 0 }, [
486
+ e[1] || (e[1] = w("div", {
475
487
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
476
488
  style: { "animation-duration": "3s" }
477
489
  }, null, -1)),
478
- e[2] || (e[2] = y("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
490
+ e[2] || (e[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
479
491
  ], 64)) : (T(), S("div", js))
480
492
  ])
481
493
  ]),
482
- y("div", Ws, [
483
- y("h1", {
494
+ w("div", Ws, [
495
+ w("h1", {
484
496
  class: A(["font-light text-white mb-1 truncate", [
485
497
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
486
498
  a.layout === "horizontal" ? "text-white/95" : ""
487
499
  ]])
488
500
  }, ie(a.agent.displayName.value), 3),
489
- y("p", {
501
+ w("p", {
490
502
  class: A(["font-light line-clamp-1", [
491
503
  a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
492
504
  a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
@@ -504,50 +516,50 @@ const {
504
516
  getOwnPropertyDescriptor: Zs
505
517
  } = Object;
506
518
  let {
507
- freeze: ne,
508
- seal: ue,
509
- create: Fe
519
+ freeze: te,
520
+ seal: oe,
521
+ create: He
510
522
  } = Object, {
511
- apply: Jt,
512
- construct: en
523
+ apply: Qt,
524
+ construct: Jt
513
525
  } = typeof Reflect < "u" && Reflect;
514
- ne || (ne = /* @__PURE__ */ p(function(t) {
526
+ te || (te = /* @__PURE__ */ h(function(t) {
515
527
  return t;
516
528
  }, "freeze"));
517
- ue || (ue = /* @__PURE__ */ p(function(t) {
529
+ oe || (oe = /* @__PURE__ */ h(function(t) {
518
530
  return t;
519
531
  }, "seal"));
520
- Jt || (Jt = /* @__PURE__ */ p(function(t, e) {
532
+ Qt || (Qt = /* @__PURE__ */ h(function(t, e) {
521
533
  for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
522
534
  r[s - 2] = arguments[s];
523
535
  return t.apply(e, r);
524
536
  }, "apply"));
525
- en || (en = /* @__PURE__ */ p(function(t) {
537
+ Jt || (Jt = /* @__PURE__ */ h(function(t) {
526
538
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
527
539
  n[r - 1] = arguments[r];
528
540
  return new t(...n);
529
541
  }, "construct"));
530
- const tt = j(Array.prototype.forEach), Xs = j(Array.prototype.lastIndexOf), $n = j(Array.prototype.pop), nt = j(Array.prototype.push), Ks = j(Array.prototype.splice), ee = Array.isArray, lt = j(String.prototype.toLowerCase), Vt = j(String.prototype.toString), Bn = j(String.prototype.match), Ue = j(String.prototype.replace), Un = j(String.prototype.indexOf), Qs = j(String.prototype.trim), Js = j(Number.prototype.toString), er = 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), st = j(Object.prototype.toString), K = j(RegExp.prototype.test), wt = tr(TypeError);
531
- function j(a) {
542
+ const et = G(Array.prototype.forEach), Xs = G(Array.prototype.lastIndexOf), $n = G(Array.prototype.pop), tt = G(Array.prototype.push), Ks = G(Array.prototype.splice), J = Array.isArray, at = G(String.prototype.toLowerCase), qt = G(String.prototype.toString), Bn = G(String.prototype.match), Fe = G(String.prototype.replace), Un = G(String.prototype.indexOf), Qs = G(String.prototype.trim), Js = G(Number.prototype.toString), er = G(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), $ = G(Object.prototype.hasOwnProperty), nt = G(Object.prototype.toString), Z = G(RegExp.prototype.test), xt = tr(TypeError);
543
+ function G(a) {
532
544
  return function(t) {
533
545
  t instanceof RegExp && (t.lastIndex = 0);
534
546
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
535
547
  n[r - 1] = arguments[r];
536
- return Jt(a, t, n);
548
+ return Qt(a, t, n);
537
549
  };
538
550
  }
539
- p(j, "unapply");
551
+ h(G, "unapply");
540
552
  function tr(a) {
541
553
  return function() {
542
554
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
543
555
  e[n] = arguments[n];
544
- return en(a, e);
556
+ return Jt(a, e);
545
557
  };
546
558
  }
547
- p(tr, "unconstruct");
559
+ h(tr, "unconstruct");
548
560
  function R(a, t) {
549
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lt;
550
- if (Nn && Nn(a, null), !ee(t))
561
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : at;
562
+ if (Nn && Nn(a, null), !J(t))
551
563
  return a;
552
564
  let n = t.length;
553
565
  for (; n--; ) {
@@ -560,20 +572,20 @@ function R(a, t) {
560
572
  }
561
573
  return a;
562
574
  }
563
- p(R, "addToSet");
575
+ h(R, "addToSet");
564
576
  function nr(a) {
565
577
  for (let t = 0; t < a.length; t++)
566
578
  $(a, t) || (a[t] = null);
567
579
  return a;
568
580
  }
569
- p(nr, "cleanArray");
581
+ h(nr, "cleanArray");
570
582
  function re(a) {
571
- const t = Fe(null);
583
+ const t = He(null);
572
584
  for (const [e, n] of as(a))
573
- $(a, e) && (ee(n) ? t[e] = nr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
585
+ $(a, e) && (J(n) ? t[e] = nr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
574
586
  return t;
575
587
  }
576
- p(re, "clone");
588
+ h(re, "clone");
577
589
  function sr(a) {
578
590
  switch (typeof a) {
579
591
  case "string":
@@ -587,55 +599,55 @@ function sr(a) {
587
599
  case "symbol":
588
600
  return Hn ? Hn(a) : "Symbol()";
589
601
  case "undefined":
590
- return st(a);
602
+ return nt(a);
591
603
  case "function":
592
604
  case "object": {
593
605
  if (a === null)
594
- return st(a);
595
- const t = a, e = He(t, "toString");
606
+ return nt(a);
607
+ const t = a, e = Ge(t, "toString");
596
608
  if (typeof e == "function") {
597
609
  const n = e(t);
598
- return typeof n == "string" ? n : st(n);
610
+ return typeof n == "string" ? n : nt(n);
599
611
  }
600
- return st(a);
612
+ return nt(a);
601
613
  }
602
614
  default:
603
- return st(a);
615
+ return nt(a);
604
616
  }
605
617
  }
606
- p(sr, "stringifyValue");
607
- function He(a, t) {
618
+ h(sr, "stringifyValue");
619
+ function Ge(a, t) {
608
620
  for (; a !== null; ) {
609
621
  const n = Zs(a, t);
610
622
  if (n) {
611
623
  if (n.get)
612
- return j(n.get);
624
+ return G(n.get);
613
625
  if (typeof n.value == "function")
614
- return j(n.value);
626
+ return G(n.value);
615
627
  }
616
628
  a = Ys(a);
617
629
  }
618
630
  function e() {
619
631
  return null;
620
632
  }
621
- return p(e, "fallbackValue"), e;
633
+ return h(e, "fallbackValue"), e;
622
634
  }
623
- p(He, "lookupGetter");
635
+ h(Ge, "lookupGetter");
624
636
  function rr(a) {
625
637
  try {
626
- return K(a, ""), !0;
638
+ return Z(a, ""), !0;
627
639
  } catch {
628
640
  return !1;
629
641
  }
630
642
  }
631
- p(rr, "isRegex");
632
- const Gn = ne(["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"]), Yt = ne(["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"]), Zt = ne(["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"]), ir = ne(["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"]), Xt = ne(["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"]), ar = ne(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = ne(["#text"]), Wn = ne(["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"]), Kt = ne(["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 = ne(["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"]), yt = ne(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), lr = ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm), or = ue(/<%[\w\W]*|[\w\W]*%>/gm), cr = ue(/\$\{[\w\W]*/gm), ur = ue(/^data-[\-\w.\u00B7-\uFFFF]+$/), hr = ue(/^aria-[\-\w]+$/), ls = ue(
643
+ h(rr, "isRegex");
644
+ 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"]), Vt = 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"]), Yt = 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"]), ir = 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"]), Zt = 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"]), ar = 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"]), Xt = 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"]), kt = te(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), lr = oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm), or = oe(/<%[\w\W]*|[\w\W]*%>/gm), cr = oe(/\$\{[\w\W]*/gm), ur = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), hr = oe(/^aria-[\-\w]+$/), ls = oe(
633
645
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
634
646
  // eslint-disable-line no-useless-escape
635
- ), pr = ue(/^(?:\w+script|data):/i), dr = ue(
647
+ ), pr = oe(/^(?:\w+script|data):/i), dr = oe(
636
648
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
637
649
  // eslint-disable-line no-control-regex
638
- ), os = ue(/^html$/i), fr = ue(/^[a-z][.\w]*(-[.\w]+)+$/i);
650
+ ), os = oe(/^html$/i), fr = oe(/^[a-z][.\w]*(-[.\w]+)+$/i);
639
651
  var Vn = /* @__PURE__ */ Object.freeze({
640
652
  __proto__: null,
641
653
  ARIA_ATTR: hr,
@@ -649,16 +661,16 @@ var Vn = /* @__PURE__ */ Object.freeze({
649
661
  MUSTACHE_EXPR: lr,
650
662
  TMPLIT_EXPR: cr
651
663
  });
652
- const rt = {
664
+ const st = {
653
665
  element: 1,
654
666
  text: 3,
655
667
  // Deprecated
656
668
  progressingInstruction: 7,
657
669
  comment: 8,
658
670
  document: 9
659
- }, gr = /* @__PURE__ */ p(function() {
671
+ }, gr = /* @__PURE__ */ h(function() {
660
672
  return typeof window > "u" ? null : window;
661
- }, "getGlobal"), mr = /* @__PURE__ */ p(function(t, e) {
673
+ }, "getGlobal"), mr = /* @__PURE__ */ h(function(t, e) {
662
674
  if (typeof t != "object" || typeof t.createPolicy != "function")
663
675
  return null;
664
676
  let n = null;
@@ -677,7 +689,7 @@ const rt = {
677
689
  } catch {
678
690
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
679
691
  }
680
- }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ p(function() {
692
+ }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ h(function() {
681
693
  return {
682
694
  afterSanitizeAttributes: [],
683
695
  afterSanitizeElements: [],
@@ -692,8 +704,8 @@ const rt = {
692
704
  }, "_createHooksMap");
693
705
  function cs() {
694
706
  let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : gr();
695
- const t = /* @__PURE__ */ p((v) => cs(v), "DOMPurify");
696
- if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== rt.document || !a.Element)
707
+ const t = /* @__PURE__ */ h((v) => cs(v), "DOMPurify");
708
+ if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== st.document || !a.Element)
697
709
  return t.isSupported = !1, t;
698
710
  let {
699
711
  document: e
@@ -702,45 +714,45 @@ function cs() {
702
714
  DocumentFragment: s,
703
715
  HTMLTemplateElement: o,
704
716
  Node: l,
705
- Element: f,
717
+ Element: m,
706
718
  NodeFilter: c,
707
- NamedNodeMap: x = a.NamedNodeMap || a.MozNamedAttrMap,
708
- HTMLFormElement: h,
719
+ NamedNodeMap: b = a.NamedNodeMap || a.MozNamedAttrMap,
720
+ HTMLFormElement: p,
709
721
  DOMParser: d,
710
722
  trustedTypes: g
711
- } = a, w = f.prototype, E = He(w, "cloneNode"), O = He(w, "remove"), U = He(w, "nextSibling"), ae = He(w, "childNodes"), le = He(w, "parentNode");
723
+ } = a, y = m.prototype, E = Ge(y, "cloneNode"), O = Ge(y, "remove"), ae = Ge(y, "nextSibling"), ce = Ge(y, "childNodes"), ne = Ge(y, "parentNode");
712
724
  if (typeof o == "function") {
713
725
  const v = e.createElement("template");
714
726
  v.content && v.content.ownerDocument && (e = v.content.ownerDocument);
715
727
  }
716
- let z, oe = "";
728
+ let N, Y = "";
717
729
  const {
718
- implementation: me,
719
- createNodeIterator: V,
720
- createDocumentFragment: ht,
721
- getElementsByTagName: Re
730
+ implementation: ue,
731
+ createNodeIterator: Q,
732
+ createDocumentFragment: _t,
733
+ getElementsByTagName: ut
722
734
  } = e, {
723
- importNode: It
735
+ importNode: I
724
736
  } = n;
725
- let Y = Yn();
726
- t.isSupported = typeof as == "function" && typeof le == "function" && me && me.createHTMLDocument !== void 0;
737
+ let q = Yn();
738
+ t.isSupported = typeof as == "function" && typeof ne == "function" && ue && ue.createHTMLDocument !== void 0;
727
739
  const {
728
- MUSTACHE_EXPR: I,
729
- ERB_EXPR: Ie,
730
- TMPLIT_EXPR: ve,
731
- DATA_ATTR: Ct,
732
- ARIA_ATTR: Ye,
733
- IS_SCRIPT_OR_DATA: Dt,
740
+ MUSTACHE_EXPR: we,
741
+ ERB_EXPR: Oe,
742
+ TMPLIT_EXPR: ye,
743
+ DATA_ATTR: Rt,
744
+ ARIA_ATTR: It,
745
+ IS_SCRIPT_OR_DATA: ht,
734
746
  ATTR_WHITESPACE: pt,
735
- CUSTOM_ELEMENT: dt
747
+ CUSTOM_ELEMENT: Ct
736
748
  } = Vn;
737
749
  let {
738
- IS_ALLOWED_URI: ft
739
- } = Vn, F = null;
740
- const gt = R({}, [...Gn, ...Yt, ...Zt, ...Xt, ...jn]);
741
- let W = null;
742
- const Ze = R({}, [...Wn, ...Kt, ...qn, ...yt]);
743
- let P = Object.seal(Fe(null, {
750
+ IS_ALLOWED_URI: dt
751
+ } = Vn, U = null;
752
+ const Ze = R({}, [...Gn, ...Vt, ...Yt, ...Zt, ...jn]);
753
+ let F = null;
754
+ const _ = R({}, [...Wn, ...Xt, ...qn, ...kt]);
755
+ let f = Object.seal(He(null, {
744
756
  tagNameCheck: {
745
757
  writable: !0,
746
758
  configurable: !1,
@@ -759,8 +771,8 @@ function cs() {
759
771
  enumerable: !0,
760
772
  value: !1
761
773
  }
762
- })), _ = null, b = null;
763
- const m = Object.seal(Fe(null, {
774
+ })), x = null, M = null;
775
+ const P = Object.seal(He(null, {
764
776
  tagCheck: {
765
777
  writable: !0,
766
778
  configurable: !1,
@@ -774,72 +786,72 @@ function cs() {
774
786
  value: null
775
787
  }
776
788
  }));
777
- let L = !0, Z = !0, we = !1, Xe = !0, he = !1, Ke = !0, Ce = !1, Mt = !1, Lt = !1, Pe = !1, mt = !1, bt = !1, fn = !0, gn = !1;
789
+ let xe = !0, ze = !0, Pe = !1, dn = !0, _e = !1, Xe = !0, Re = !1, Dt = !1, Mt = !1, Ne = !1, ft = !1, gt = !1, fn = !0, gn = !1;
778
790
  const mn = "user-content-";
779
- let Ot = !0, Qe = !1, Ne = {}, be = null;
780
- 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"]);
791
+ let Lt = !0, Ke = !1, $e = {}, ge = null;
792
+ const Ot = 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"]);
781
793
  let bn = null;
782
794
  const xn = R({}, ["audio", "video", "img", "source", "image", "track"]);
783
- let Pt = null;
784
- 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", kt = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml";
785
- let $e = xe, Nt = !1, $t = null;
786
- const ws = R({}, [xt, kt, xe], Vt);
787
- let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
795
+ let zt = null;
796
+ const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), mt = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", me = "http://www.w3.org/1999/xhtml";
797
+ let Be = me, Pt = !1, Nt = null;
798
+ const ws = R({}, [mt, bt, me], qt);
799
+ let $t = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Bt = R({}, ["annotation-xml"]);
788
800
  const ys = R({}, ["title", "style", "font", "a", "script"]);
789
- let Je = null;
801
+ let Qe = null;
790
802
  const vs = ["application/xhtml+xml", "text/html"], Ts = "text/html";
791
- let q = null, Be = null;
792
- const Ss = e.createElement("form"), wn = /* @__PURE__ */ p(function(i) {
803
+ let j = null, Ue = null;
804
+ const Ss = e.createElement("form"), wn = /* @__PURE__ */ h(function(i) {
793
805
  return i instanceof RegExp || i instanceof Function;
794
- }, "isRegexOrFunction"), Ft = /* @__PURE__ */ p(function() {
806
+ }, "isRegexOrFunction"), Ut = /* @__PURE__ */ h(function() {
795
807
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
796
- if (Be && Be === i)
808
+ if (Ue && Ue === i)
797
809
  return;
798
- (!i || typeof i != "object") && (i = {}), i = re(i), Je = // eslint-disable-next-line unicorn/prefer-includes
799
- vs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ts : i.PARSER_MEDIA_TYPE, q = Je === "application/xhtml+xml" ? Vt : lt, F = $(i, "ALLOWED_TAGS") && ee(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : gt, W = $(i, "ALLOWED_ATTR") && ee(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : Ze, $t = $(i, "ALLOWED_NAMESPACES") && ee(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Vt) : ws, Pt = $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, q) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && ee(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, q) : xn, be = $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : zt, _ = $(i, "FORBID_TAGS") && ee(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : re({}), b = $(i, "FORBID_ATTR") && ee(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : re({}), Ne = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, L = i.ALLOW_ARIA_ATTR !== !1, Z = i.ALLOW_DATA_ATTR !== !1, we = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Xe = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, he = i.SAFE_FOR_TEMPLATES || !1, Ke = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, Pe = i.RETURN_DOM || !1, mt = i.RETURN_DOM_FRAGMENT || !1, bt = 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, Qe = i.IN_PLACE || !1, ft = rr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : ls, $e = typeof i.NAMESPACE == "string" ? i.NAMESPACE : xe, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
800
- const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : Fe(null);
801
- if (P = Fe(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), he && (Z = !1), mt && (Pe = !0), Ne && (F = R({}, jn), W = Fe(null), Ne.html === !0 && (R(F, Gn), R(W, Wn)), Ne.svg === !0 && (R(F, Yt), R(W, Kt), R(W, yt)), Ne.svgFilters === !0 && (R(F, Zt), R(W, Kt), R(W, yt)), Ne.mathMl === !0 && (R(F, Xt), R(W, qn), R(W, yt))), m.tagCheck = null, m.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? m.tagCheck = i.ADD_TAGS : ee(i.ADD_TAGS) && (F === gt && (F = re(F)), R(F, i.ADD_TAGS, q))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? m.attributeCheck = i.ADD_ATTR : ee(i.ADD_ATTR) && (W === Ze && (W = re(W)), R(W, i.ADD_ATTR, q))), $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, q), $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.FORBID_CONTENTS, q)), $(i, "ADD_FORBID_CONTENTS") && ee(i.ADD_FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.ADD_FORBID_CONTENTS, q)), Ot && (F["#text"] = !0), Ce && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete _.tbody), i.TRUSTED_TYPES_POLICY) {
810
+ (!i || typeof i != "object") && (i = {}), i = re(i), Qe = // eslint-disable-next-line unicorn/prefer-includes
811
+ vs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ts : i.PARSER_MEDIA_TYPE, j = Qe === "application/xhtml+xml" ? qt : at, U = $(i, "ALLOWED_TAGS") && J(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, j) : Ze, F = $(i, "ALLOWED_ATTR") && J(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, j) : _, Nt = $(i, "ALLOWED_NAMESPACES") && J(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : ws, zt = $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, j) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && J(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, j) : xn, ge = $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, j) : Ot, x = $(i, "FORBID_TAGS") && J(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, j) : re({}), M = $(i, "FORBID_ATTR") && J(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, j) : re({}), $e = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(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, _e = i.SAFE_FOR_TEMPLATES || !1, Xe = i.SAFE_FOR_XML !== !1, Re = i.WHOLE_DOCUMENT || !1, Ne = i.RETURN_DOM || !1, ft = i.RETURN_DOM_FRAGMENT || !1, gt = i.RETURN_TRUSTED_TYPE || !1, Mt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Lt = i.KEEP_CONTENT !== !1, Ke = i.IN_PLACE || !1, dt = rr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : ls, Be = typeof i.NAMESPACE == "string" ? i.NAMESPACE : me, $t = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Bt = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
812
+ const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : He(null);
813
+ if (f = He(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (f.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (f.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), _e && (ze = !1), ft && (Ne = !0), $e && (U = R({}, jn), F = He(null), $e.html === !0 && (R(U, Gn), R(F, Wn)), $e.svg === !0 && (R(U, Vt), R(F, Xt), R(F, kt)), $e.svgFilters === !0 && (R(U, Yt), R(F, Xt), R(F, kt)), $e.mathMl === !0 && (R(U, Zt), R(F, qn), R(F, kt))), P.tagCheck = null, P.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? P.tagCheck = i.ADD_TAGS : J(i.ADD_TAGS) && (U === Ze && (U = re(U)), R(U, i.ADD_TAGS, j))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? P.attributeCheck = i.ADD_ATTR : J(i.ADD_ATTR) && (F === _ && (F = re(F)), R(F, i.ADD_ATTR, j))), $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) && R(zt, i.ADD_URI_SAFE_ATTR, j), $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) && (ge === Ot && (ge = re(ge)), R(ge, i.FORBID_CONTENTS, j)), $(i, "ADD_FORBID_CONTENTS") && J(i.ADD_FORBID_CONTENTS) && (ge === Ot && (ge = re(ge)), R(ge, i.ADD_FORBID_CONTENTS, j)), Lt && (U["#text"] = !0), Re && R(U, ["html", "head", "body"]), U.table && (R(U, ["tbody"]), delete x.tbody), i.TRUSTED_TYPES_POLICY) {
802
814
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
803
- throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
815
+ throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
804
816
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
805
- throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
806
- z = i.TRUSTED_TYPES_POLICY, oe = z.createHTML("");
817
+ throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
818
+ N = i.TRUSTED_TYPES_POLICY, Y = N.createHTML("");
807
819
  } else
808
- z === void 0 && (z = mr(g, r)), z !== null && typeof oe == "string" && (oe = z.createHTML(""));
809
- ne && ne(i), Be = i;
810
- }, "_parseConfig"), yn = R({}, [...Yt, ...Zt, ...ir]), vn = R({}, [...Xt, ...ar]), As = /* @__PURE__ */ p(function(i) {
811
- let u = le(i);
820
+ N === void 0 && (N = mr(g, r)), N !== null && typeof Y == "string" && (Y = N.createHTML(""));
821
+ te && te(i), Ue = i;
822
+ }, "_parseConfig"), yn = R({}, [...Vt, ...Yt, ...ir]), vn = R({}, [...Zt, ...ar]), As = /* @__PURE__ */ h(function(i) {
823
+ let u = ne(i);
812
824
  (!u || !u.tagName) && (u = {
813
- namespaceURI: $e,
825
+ namespaceURI: Be,
814
826
  tagName: "template"
815
827
  });
816
- const k = lt(i.tagName), N = lt(u.tagName);
817
- return $t[i.namespaceURI] ? i.namespaceURI === kt ? u.namespaceURI === xe ? k === "svg" : u.namespaceURI === xt ? k === "svg" && (N === "annotation-xml" || Bt[N]) : !!yn[k] : i.namespaceURI === xt ? u.namespaceURI === xe ? k === "math" : u.namespaceURI === kt ? k === "math" && Ut[N] : !!vn[k] : i.namespaceURI === xe ? u.namespaceURI === kt && !Ut[N] || u.namespaceURI === xt && !Bt[N] ? !1 : !vn[k] && (ys[k] || !yn[k]) : !!(Je === "application/xhtml+xml" && $t[i.namespaceURI]) : !1;
818
- }, "_checkValidNamespace"), pe = /* @__PURE__ */ p(function(i) {
819
- nt(t.removed, {
828
+ const k = at(i.tagName), z = at(u.tagName);
829
+ return Nt[i.namespaceURI] ? i.namespaceURI === bt ? u.namespaceURI === me ? k === "svg" : u.namespaceURI === mt ? k === "svg" && (z === "annotation-xml" || $t[z]) : !!yn[k] : i.namespaceURI === mt ? u.namespaceURI === me ? k === "math" : u.namespaceURI === bt ? k === "math" && Bt[z] : !!vn[k] : i.namespaceURI === me ? u.namespaceURI === bt && !Bt[z] || u.namespaceURI === mt && !$t[z] ? !1 : !vn[k] && (ys[k] || !yn[k]) : !!(Qe === "application/xhtml+xml" && Nt[i.namespaceURI]) : !1;
830
+ }, "_checkValidNamespace"), he = /* @__PURE__ */ h(function(i) {
831
+ tt(t.removed, {
820
832
  element: i
821
833
  });
822
834
  try {
823
- le(i).removeChild(i);
835
+ ne(i).removeChild(i);
824
836
  } catch {
825
837
  O(i);
826
838
  }
827
- }, "_forceRemove"), De = /* @__PURE__ */ p(function(i, u) {
839
+ }, "_forceRemove"), Ie = /* @__PURE__ */ h(function(i, u) {
828
840
  try {
829
- nt(t.removed, {
841
+ tt(t.removed, {
830
842
  attribute: u.getAttributeNode(i),
831
843
  from: u
832
844
  });
833
845
  } catch {
834
- nt(t.removed, {
846
+ tt(t.removed, {
835
847
  attribute: null,
836
848
  from: u
837
849
  });
838
850
  }
839
851
  if (u.removeAttribute(i), i === "is")
840
- if (Pe || mt)
852
+ if (Ne || ft)
841
853
  try {
842
- pe(u);
854
+ he(u);
843
855
  } catch {
844
856
  }
845
857
  else
@@ -847,98 +859,98 @@ function cs() {
847
859
  u.setAttribute(i, "");
848
860
  } catch {
849
861
  }
850
- }, "_removeAttribute"), Tn = /* @__PURE__ */ p(function(i) {
862
+ }, "_removeAttribute"), Tn = /* @__PURE__ */ h(function(i) {
851
863
  let u = null, k = null;
852
- if (Lt)
864
+ if (Mt)
853
865
  i = "<remove></remove>" + i;
854
866
  else {
855
867
  const H = Bn(i, /^[\r\n\t ]+/);
856
868
  k = H && H[0];
857
869
  }
858
- Je === "application/xhtml+xml" && $e === xe && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
859
- const N = z ? z.createHTML(i) : i;
860
- if ($e === xe)
870
+ Qe === "application/xhtml+xml" && Be === me && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
871
+ const z = N ? N.createHTML(i) : i;
872
+ if (Be === me)
861
873
  try {
862
- u = new d().parseFromString(N, Je);
874
+ u = new d().parseFromString(z, Qe);
863
875
  } catch {
864
876
  }
865
877
  if (!u || !u.documentElement) {
866
- u = me.createDocument($e, "template", null);
878
+ u = ue.createDocument(Be, "template", null);
867
879
  try {
868
- u.documentElement.innerHTML = Nt ? oe : N;
880
+ u.documentElement.innerHTML = Pt ? Y : z;
869
881
  } catch {
870
882
  }
871
883
  }
872
- const Q = u.body || u.documentElement;
873
- return i && k && Q.insertBefore(e.createTextNode(k), Q.childNodes[0] || null), $e === xe ? Re.call(u, Ce ? "html" : "body")[0] : Ce ? u.documentElement : Q;
874
- }, "_initDocument"), Sn = /* @__PURE__ */ p(function(i) {
875
- return V.call(
884
+ const X = u.body || u.documentElement;
885
+ return i && k && X.insertBefore(e.createTextNode(k), X.childNodes[0] || null), Be === me ? ut.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : X;
886
+ }, "_initDocument"), Sn = /* @__PURE__ */ h(function(i) {
887
+ return Q.call(
876
888
  i.ownerDocument || i,
877
889
  i,
878
890
  // eslint-disable-next-line no-bitwise
879
891
  c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
880
892
  null
881
893
  );
882
- }, "_createNodeIterator"), Ht = /* @__PURE__ */ p(function(i) {
883
- return i instanceof h && (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");
884
- }, "_isClobbered"), Gt = /* @__PURE__ */ p(function(i) {
894
+ }, "_createNodeIterator"), Ft = /* @__PURE__ */ h(function(i) {
895
+ return i instanceof p && (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");
896
+ }, "_isClobbered"), Ht = /* @__PURE__ */ h(function(i) {
885
897
  return typeof l == "function" && i instanceof l;
886
898
  }, "_isNode");
887
- function ye(v, i, u) {
888
- tt(v, (k) => {
889
- k.call(t, i, u, Be);
899
+ function ke(v, i, u) {
900
+ et(v, (k) => {
901
+ k.call(t, i, u, Ue);
890
902
  });
891
903
  }
892
- p(ye, "_executeHooks");
893
- const An = /* @__PURE__ */ p(function(i) {
904
+ h(ke, "_executeHooks");
905
+ const An = /* @__PURE__ */ h(function(i) {
894
906
  let u = null;
895
- if (ye(Y.beforeSanitizeElements, i, null), Ht(i))
896
- return pe(i), !0;
897
- const k = q(i.nodeName);
898
- if (ye(Y.uponSanitizeElement, i, {
907
+ if (ke(q.beforeSanitizeElements, i, null), Ft(i))
908
+ return he(i), !0;
909
+ const k = j(i.nodeName);
910
+ if (ke(q.uponSanitizeElement, i, {
899
911
  tagName: k,
900
- allowedTags: F
901
- }), Ke && i.hasChildNodes() && !Gt(i.firstElementChild) && K(/<[/\w!]/g, i.innerHTML) && K(/<[/\w!]/g, i.textContent) || Ke && i.namespaceURI === xe && k === "style" && Gt(i.firstElementChild) || i.nodeType === rt.progressingInstruction || Ke && i.nodeType === rt.comment && K(/<[/\w]/g, i.data))
902
- return pe(i), !0;
903
- if (_[k] || !(m.tagCheck instanceof Function && m.tagCheck(k)) && !F[k]) {
904
- if (!_[k] && _n(k) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, k) || P.tagNameCheck instanceof Function && P.tagNameCheck(k)))
912
+ allowedTags: U
913
+ }), Xe && i.hasChildNodes() && !Ht(i.firstElementChild) && Z(/<[/\w!]/g, i.innerHTML) && Z(/<[/\w!]/g, i.textContent) || Xe && i.namespaceURI === me && k === "style" && Ht(i.firstElementChild) || i.nodeType === st.progressingInstruction || Xe && i.nodeType === st.comment && Z(/<[/\w]/g, i.data))
914
+ return he(i), !0;
915
+ if (x[k] || !(P.tagCheck instanceof Function && P.tagCheck(k)) && !U[k]) {
916
+ if (!x[k] && _n(k) && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, k) || f.tagNameCheck instanceof Function && f.tagNameCheck(k)))
905
917
  return !1;
906
- if (Ot && !be[k]) {
907
- const N = le(i) || i.parentNode, Q = ae(i) || i.childNodes;
908
- if (Q && N) {
909
- const H = Q.length;
918
+ if (Lt && !ge[k]) {
919
+ const z = ne(i) || i.parentNode, X = ce(i) || i.childNodes;
920
+ if (X && z) {
921
+ const H = X.length;
910
922
  for (let se = H - 1; se >= 0; --se) {
911
- const ce = E(Q[se], !0);
912
- N.insertBefore(ce, U(i));
923
+ const le = E(X[se], !0);
924
+ z.insertBefore(le, ae(i));
913
925
  }
914
926
  }
915
927
  }
916
- return pe(i), !0;
928
+ return he(i), !0;
917
929
  }
918
- return i instanceof f && !As(i) || (k === "noscript" || k === "noembed" || k === "noframes") && K(/<\/no(script|embed|frames)/i, i.innerHTML) ? (pe(i), !0) : (he && i.nodeType === rt.text && (u = i.textContent, tt([I, Ie, ve], (N) => {
919
- u = Ue(u, N, " ");
920
- }), i.textContent !== u && (nt(t.removed, {
930
+ return i instanceof m && !As(i) || (k === "noscript" || k === "noembed" || k === "noframes") && Z(/<\/no(script|embed|frames)/i, i.innerHTML) ? (he(i), !0) : (_e && i.nodeType === st.text && (u = i.textContent, et([we, Oe, ye], (z) => {
931
+ u = Fe(u, z, " ");
932
+ }), i.textContent !== u && (tt(t.removed, {
921
933
  element: i.cloneNode()
922
- }), i.textContent = u)), ye(Y.afterSanitizeElements, i, null), !1);
923
- }, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, u, k) {
924
- if (b[u] || fn && (u === "id" || u === "name") && (k in e || k in Ss))
934
+ }), i.textContent = u)), ke(q.afterSanitizeElements, i, null), !1);
935
+ }, "_sanitizeElements"), En = /* @__PURE__ */ h(function(i, u, k) {
936
+ if (M[u] || fn && (u === "id" || u === "name") && (k in e || k in Ss))
925
937
  return !1;
926
- if (!(Z && !b[u] && K(Ct, u))) {
927
- if (!(L && K(Ye, u))) {
928
- if (!(m.attributeCheck instanceof Function && m.attributeCheck(u, i))) {
929
- if (!W[u] || b[u]) {
938
+ if (!(ze && !M[u] && Z(Rt, u))) {
939
+ if (!(xe && Z(It, u))) {
940
+ if (!(P.attributeCheck instanceof Function && P.attributeCheck(u, i))) {
941
+ if (!F[u] || M[u]) {
930
942
  if (
931
943
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
932
944
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
933
945
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
934
- !(_n(i) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, i) || P.tagNameCheck instanceof Function && P.tagNameCheck(i)) && (P.attributeNameCheck instanceof RegExp && K(P.attributeNameCheck, u) || P.attributeNameCheck instanceof Function && P.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
946
+ !(_n(i) && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)) && (f.attributeNameCheck instanceof RegExp && Z(f.attributeNameCheck, u) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
935
947
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
936
- u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, k) || P.tagNameCheck instanceof Function && P.tagNameCheck(k)))
948
+ u === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, k) || f.tagNameCheck instanceof Function && f.tagNameCheck(k)))
937
949
  ) return !1;
938
- } else if (!Pt[u]) {
939
- if (!K(ft, Ue(k, pt, ""))) {
950
+ } else if (!zt[u]) {
951
+ if (!Z(dt, Fe(k, pt, ""))) {
940
952
  if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Un(k, "data:") === 0 && bn[i])) {
941
- if (!(we && !K(Dt, Ue(k, pt, "")))) {
953
+ if (!(Pe && !Z(ht, Fe(k, pt, "")))) {
942
954
  if (k)
943
955
  return !1;
944
956
  }
@@ -949,210 +961,210 @@ function cs() {
949
961
  }
950
962
  }
951
963
  return !0;
952
- }, "_isValidAttribute"), Es = 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) {
953
- return !Es[lt(i)] && K(dt, i);
954
- }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ p(function(i) {
955
- ye(Y.beforeSanitizeAttributes, i, null);
964
+ }, "_isValidAttribute"), Es = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ h(function(i) {
965
+ return !Es[at(i)] && Z(Ct, i);
966
+ }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ h(function(i) {
967
+ ke(q.beforeSanitizeAttributes, i, null);
956
968
  const {
957
969
  attributes: u
958
970
  } = i;
959
- if (!u || Ht(i))
971
+ if (!u || Ft(i))
960
972
  return;
961
973
  const k = {
962
974
  attrName: "",
963
975
  attrValue: "",
964
976
  keepAttr: !0,
965
- allowedAttributes: W,
977
+ allowedAttributes: F,
966
978
  forceKeepAttr: void 0
967
979
  };
968
- let N = u.length;
969
- for (; N--; ) {
970
- const Q = u[N], {
980
+ let z = u.length;
981
+ for (; z--; ) {
982
+ const X = u[z], {
971
983
  name: H,
972
984
  namespaceURI: se,
973
- value: ce
974
- } = Q, de = q(H), jt = ce;
975
- let X = H === "value" ? jt : Qs(jt);
976
- if (k.attrName = de, k.attrValue = X, k.keepAttr = !0, k.forceKeepAttr = void 0, ye(Y.uponSanitizeAttribute, i, k), X = k.attrValue, gn && (de === "id" || de === "name") && Un(X, mn) !== 0 && (De(H, i), X = mn + X), Ke && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, X)) {
977
- De(H, i);
985
+ value: le
986
+ } = X, pe = j(H), Gt = le;
987
+ let V = H === "value" ? Gt : Qs(Gt);
988
+ if (k.attrName = pe, k.attrValue = V, k.keepAttr = !0, k.forceKeepAttr = void 0, ke(q.uponSanitizeAttribute, i, k), V = k.attrValue, gn && (pe === "id" || pe === "name") && Un(V, mn) !== 0 && (Ie(H, i), V = mn + V), Xe && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
989
+ Ie(H, i);
978
990
  continue;
979
991
  }
980
- if (de === "attributename" && Bn(X, "href")) {
981
- De(H, i);
992
+ if (pe === "attributename" && Bn(V, "href")) {
993
+ Ie(H, i);
982
994
  continue;
983
995
  }
984
996
  if (k.forceKeepAttr)
985
997
  continue;
986
998
  if (!k.keepAttr) {
987
- De(H, i);
999
+ Ie(H, i);
988
1000
  continue;
989
1001
  }
990
- if (!Xe && K(/\/>/i, X)) {
991
- De(H, i);
1002
+ if (!dn && Z(/\/>/i, V)) {
1003
+ Ie(H, i);
992
1004
  continue;
993
1005
  }
994
- he && tt([I, Ie, ve], (Dn) => {
995
- X = Ue(X, Dn, " ");
1006
+ _e && et([we, Oe, ye], (Dn) => {
1007
+ V = Fe(V, Dn, " ");
996
1008
  });
997
- const Cn = q(i.nodeName);
998
- if (!En(Cn, de, X)) {
999
- De(H, i);
1009
+ const Cn = j(i.nodeName);
1010
+ if (!En(Cn, pe, V)) {
1011
+ Ie(H, i);
1000
1012
  continue;
1001
1013
  }
1002
- if (z && typeof g == "object" && typeof g.getAttributeType == "function" && !se)
1003
- switch (g.getAttributeType(Cn, de)) {
1014
+ if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !se)
1015
+ switch (g.getAttributeType(Cn, pe)) {
1004
1016
  case "TrustedHTML": {
1005
- X = z.createHTML(X);
1017
+ V = N.createHTML(V);
1006
1018
  break;
1007
1019
  }
1008
1020
  case "TrustedScriptURL": {
1009
- X = z.createScriptURL(X);
1021
+ V = N.createScriptURL(V);
1010
1022
  break;
1011
1023
  }
1012
1024
  }
1013
- if (X !== jt)
1025
+ if (V !== Gt)
1014
1026
  try {
1015
- se ? i.setAttributeNS(se, H, X) : i.setAttribute(H, X), Ht(i) ? pe(i) : $n(t.removed);
1027
+ se ? i.setAttributeNS(se, H, V) : i.setAttribute(H, V), Ft(i) ? he(i) : $n(t.removed);
1016
1028
  } catch {
1017
- De(H, i);
1029
+ Ie(H, i);
1018
1030
  }
1019
1031
  }
1020
- ye(Y.afterSanitizeAttributes, i, null);
1021
- }, "_sanitizeAttributes"), In = /* @__PURE__ */ p(function(i) {
1032
+ ke(q.afterSanitizeAttributes, i, null);
1033
+ }, "_sanitizeAttributes"), In = /* @__PURE__ */ h(function(i) {
1022
1034
  let u = null;
1023
1035
  const k = Sn(i);
1024
- for (ye(Y.beforeSanitizeShadowDOM, i, null); u = k.nextNode(); )
1025
- ye(Y.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof s && In(u.content);
1026
- ye(Y.afterSanitizeShadowDOM, i, null);
1036
+ for (ke(q.beforeSanitizeShadowDOM, i, null); u = k.nextNode(); )
1037
+ ke(q.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof s && In(u.content);
1038
+ ke(q.afterSanitizeShadowDOM, i, null);
1027
1039
  }, "_sanitizeShadowDOM");
1028
1040
  return t.sanitize = function(v) {
1029
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, k = null, N = null, Q = null;
1030
- if (Nt = !v, Nt && (v = "<!-->"), typeof v != "string" && !Gt(v) && (v = sr(v), typeof v != "string"))
1031
- throw wt("dirty is not a string, aborting");
1041
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, k = null, z = null, X = null;
1042
+ if (Pt = !v, Pt && (v = "<!-->"), typeof v != "string" && !Ht(v) && (v = sr(v), typeof v != "string"))
1043
+ throw xt("dirty is not a string, aborting");
1032
1044
  if (!t.isSupported)
1033
1045
  return v;
1034
- if (Mt || Ft(i), t.removed = [], typeof v == "string" && (Qe = !1), Qe) {
1035
- const ce = v.nodeName;
1036
- if (typeof ce == "string") {
1037
- const de = q(ce);
1038
- if (!F[de] || _[de])
1039
- throw wt("root node is forbidden and cannot be sanitized in-place");
1046
+ if (Dt || Ut(i), t.removed = [], typeof v == "string" && (Ke = !1), Ke) {
1047
+ const le = v.nodeName;
1048
+ if (typeof le == "string") {
1049
+ const pe = j(le);
1050
+ if (!U[pe] || x[pe])
1051
+ throw xt("root node is forbidden and cannot be sanitized in-place");
1040
1052
  }
1041
1053
  } else if (v instanceof l)
1042
- u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === rt.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
1054
+ u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === st.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
1043
1055
  else {
1044
- if (!Pe && !he && !Ce && // eslint-disable-next-line unicorn/prefer-includes
1056
+ if (!Ne && !_e && !Re && // eslint-disable-next-line unicorn/prefer-includes
1045
1057
  v.indexOf("<") === -1)
1046
- return z && bt ? z.createHTML(v) : v;
1058
+ return N && gt ? N.createHTML(v) : v;
1047
1059
  if (u = Tn(v), !u)
1048
- return Pe ? null : bt ? oe : "";
1060
+ return Ne ? null : gt ? Y : "";
1049
1061
  }
1050
- u && Lt && pe(u.firstChild);
1051
- const H = Sn(Qe ? v : u);
1052
- for (; N = H.nextNode(); )
1053
- An(N), Rn(N), N.content instanceof s && In(N.content);
1054
- if (Qe)
1062
+ u && Mt && he(u.firstChild);
1063
+ const H = Sn(Ke ? v : u);
1064
+ for (; z = H.nextNode(); )
1065
+ An(z), Rn(z), z.content instanceof s && In(z.content);
1066
+ if (Ke)
1055
1067
  return v;
1056
- if (Pe) {
1057
- if (he) {
1068
+ if (Ne) {
1069
+ if (_e) {
1058
1070
  u.normalize();
1059
- let ce = u.innerHTML;
1060
- tt([I, Ie, ve], (de) => {
1061
- ce = Ue(ce, de, " ");
1062
- }), u.innerHTML = ce;
1063
- }
1064
- if (mt)
1065
- for (Q = ht.call(u.ownerDocument); u.firstChild; )
1066
- Q.appendChild(u.firstChild);
1071
+ let le = u.innerHTML;
1072
+ et([we, Oe, ye], (pe) => {
1073
+ le = Fe(le, pe, " ");
1074
+ }), u.innerHTML = le;
1075
+ }
1076
+ if (ft)
1077
+ for (X = _t.call(u.ownerDocument); u.firstChild; )
1078
+ X.appendChild(u.firstChild);
1067
1079
  else
1068
- Q = u;
1069
- return (W.shadowroot || W.shadowrootmode) && (Q = It.call(n, Q, !0)), Q;
1070
- }
1071
- let se = Ce ? u.outerHTML : u.innerHTML;
1072
- return Ce && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(os, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1073
- ` + se), he && tt([I, Ie, ve], (ce) => {
1074
- se = Ue(se, ce, " ");
1075
- }), z && bt ? z.createHTML(se) : se;
1080
+ X = u;
1081
+ return (F.shadowroot || F.shadowrootmode) && (X = I.call(n, X, !0)), X;
1082
+ }
1083
+ let se = Re ? u.outerHTML : u.innerHTML;
1084
+ return Re && U["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && Z(os, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1085
+ ` + se), _e && et([we, Oe, ye], (le) => {
1086
+ se = Fe(se, le, " ");
1087
+ }), N && gt ? N.createHTML(se) : se;
1076
1088
  }, t.setConfig = function() {
1077
1089
  let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1078
- Ft(v), Mt = !0;
1090
+ Ut(v), Dt = !0;
1079
1091
  }, t.clearConfig = function() {
1080
- Be = null, Mt = !1;
1092
+ Ue = null, Dt = !1;
1081
1093
  }, t.isValidAttribute = function(v, i, u) {
1082
- Be || Ft({});
1083
- const k = q(v), N = q(i);
1084
- return En(k, N, u);
1094
+ Ue || Ut({});
1095
+ const k = j(v), z = j(i);
1096
+ return En(k, z, u);
1085
1097
  }, t.addHook = function(v, i) {
1086
- typeof i == "function" && nt(Y[v], i);
1098
+ typeof i == "function" && tt(q[v], i);
1087
1099
  }, t.removeHook = function(v, i) {
1088
1100
  if (i !== void 0) {
1089
- const u = Xs(Y[v], i);
1090
- return u === -1 ? void 0 : Ks(Y[v], u, 1)[0];
1101
+ const u = Xs(q[v], i);
1102
+ return u === -1 ? void 0 : Ks(q[v], u, 1)[0];
1091
1103
  }
1092
- return $n(Y[v]);
1104
+ return $n(q[v]);
1093
1105
  }, t.removeHooks = function(v) {
1094
- Y[v] = [];
1106
+ q[v] = [];
1095
1107
  }, t.removeAllHooks = function() {
1096
- Y = Yn();
1108
+ q = Yn();
1097
1109
  }, t;
1098
1110
  }
1099
- p(cs, "createDOMPurify");
1111
+ h(cs, "createDOMPurify");
1100
1112
  var br = cs();
1101
- function sn() {
1113
+ function nn() {
1102
1114
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1103
1115
  }
1104
- p(sn, "z");
1105
- var ze = sn();
1116
+ h(nn, "z");
1117
+ var Le = nn();
1106
1118
  function us(a) {
1107
- ze = a;
1119
+ Le = a;
1108
1120
  }
1109
- p(us, "G");
1110
- var Me = { exec: /* @__PURE__ */ p(() => null, "exec") };
1121
+ h(us, "G");
1122
+ var Ce = { exec: /* @__PURE__ */ h(() => null, "exec") };
1111
1123
  function D(a, t = "") {
1112
- let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((r, s) => {
1124
+ let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((r, s) => {
1113
1125
  let o = typeof s == "string" ? s : s.source;
1114
- return o = o.replace(J.caret, "$1"), e = e.replace(r, o), n;
1115
- }, "replace"), getRegex: /* @__PURE__ */ p(() => new RegExp(e, t), "getRegex") };
1126
+ return o = o.replace(K.caret, "$1"), e = e.replace(r, o), n;
1127
+ }, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
1116
1128
  return n;
1117
1129
  }
1118
- p(D, "k");
1130
+ h(D, "k");
1119
1131
  var xr = ((a = "") => {
1120
1132
  try {
1121
1133
  return !!new RegExp("(?<=1)(?<!1)" + a);
1122
1134
  } catch {
1123
1135
  return !1;
1124
1136
  }
1125
- })(), J = { 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") }, kr = /^(?:[ \t]*(?:\n|$))+/, wr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, yr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ut = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, vr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, hs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ps = D(hs).replace(/bull/g, rn).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(), Tr = D(hs).replace(/bull/g, rn).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(), an = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Sr = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ar = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Er = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rn).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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _r = 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", on).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ds = D(an).replace("hr", ut).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(), Rr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ds).getRegex(), cn = { blockquote: Rr, code: wr, def: Ar, fences: yr, heading: vr, hr: ut, html: _r, lheading: ps, list: Er, newline: kr, paragraph: ds, table: Me, text: Sr }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ut).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(), Ir = { ...cn, lheading: Tr, table: Zn, paragraph: D(an).replace("hr", ut).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() }, Cr = { ...cn, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", on).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: Me, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(an).replace("hr", ut).replace("heading", ` *#{1,6} *[^
1126
- ]`).replace("lheading", ps).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Dr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, fs = /^( {2,}|\\)\n(?!\s*$)/, Lr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ve = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, un = /[^\s\p{P}\p{S}]/u, Or = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), gs = /(?!~)[\p{P}\p{S}]/u, zr = /(?!~)[\s\p{P}\p{S}]/u, Pr = /(?:[^\s\p{P}\p{S}]|~)/u, Nr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ms = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $r = D(ms, "u").replace(/punct/g, Ve).getRegex(), Br = D(ms, "u").replace(/punct/g, gs).getRegex(), bs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ur = D(bs, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), Fr = D(bs, "gu").replace(/notPunctSpace/g, Pr).replace(/punctSpace/g, zr).replace(/punct/g, gs).getRegex(), Hr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), Gr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ve).getRegex(), jr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Wr = D(jr, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), qr = D(/\\(punct)/, "gu").replace(/punct/g, Ve).getRegex(), Vr = 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(), Yr = D(on).replace("(?:-->|$)", "-->").getRegex(), Zr = 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", Yr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), St = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Xr = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", St).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), xs = D(/^!?\[(label)\]\[(ref)\]/).replace("label", St).replace("ref", ln).getRegex(), ks = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), Kr = D("reflink|nolink(?!\\()", "g").replace("reflink", xs).replace("nolink", ks).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, hn = { _backpedal: Me, anyPunctuation: qr, autolink: Vr, blockSkip: Nr, br: fs, code: Mr, del: Me, delLDelim: Me, delRDelim: Me, emStrongLDelim: $r, emStrongRDelimAst: Ur, emStrongRDelimUnd: Hr, escape: Dr, link: Xr, nolink: ks, punctuation: Or, reflink: xs, reflinkSearch: Kr, tag: Zr, text: Lr, url: Me }, Qr = { ...hn, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", St).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", St).getRegex() }, tn = { ...hn, emStrongRDelimAst: Fr, emStrongLDelim: Br, delLDelim: Gr, delRDelim: Wr, 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() }, Jr = { ...tn, br: D(fs).replace("{2,}", "*").getRegex(), text: D(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: cn, gfm: Ir, pedantic: Cr }, it = { normal: hn, gfm: tn, breaks: Jr, pedantic: Qr }, ei = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ p((a) => ei[a], "de");
1127
- function ke(a, t) {
1137
+ })(), 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__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, kr = /^(?:[ \t]*(?:\n|$))+/, wr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, yr = /^ {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+|$)/, vr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, hs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ps = D(hs).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(), Tr = D(hs).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]+)*)/, Sr = /^[^\n]+/, an = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ar = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", an).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Er = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, sn).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", ln = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _r = 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", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ds = D(rn).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(), Rr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ds).getRegex(), on = { blockquote: Rr, code: wr, def: Ar, fences: yr, heading: vr, hr: ct, html: _r, lheading: ps, list: Er, newline: kr, paragraph: ds, table: Ce, text: Sr }, 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(), Ir = { ...on, lheading: Tr, table: Zn, paragraph: D(rn).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() }, Cr = { ...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: Ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(rn).replace("hr", ct).replace("heading", ` *#{1,6} *[^
1138
+ ]`).replace("lheading", ps).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Dr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, fs = /^( {2,}|\\)\n(?!\s*$)/, Lr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ye = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, cn = /[^\s\p{P}\p{S}]/u, Or = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), gs = /(?!~)[\p{P}\p{S}]/u, zr = /(?!~)[\s\p{P}\p{S}]/u, Pr = /(?:[^\s\p{P}\p{S}]|~)/u, Nr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ms = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $r = D(ms, "u").replace(/punct/g, Ye).getRegex(), Br = D(ms, "u").replace(/punct/g, gs).getRegex(), bs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ur = D(bs, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ye).getRegex(), Fr = D(bs, "gu").replace(/notPunctSpace/g, Pr).replace(/punctSpace/g, zr).replace(/punct/g, gs).getRegex(), Hr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ye).getRegex(), Gr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ye).getRegex(), jr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Wr = D(jr, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ye).getRegex(), qr = D(/\\(punct)/, "gu").replace(/punct/g, Ye).getRegex(), Vr = 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(), Yr = D(ln).replace("(?:-->|$)", "-->").getRegex(), Zr = 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", Yr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Xr = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), xs = D(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", an).getRegex(), ks = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", an).getRegex(), Kr = D("reflink|nolink(?!\\()", "g").replace("reflink", xs).replace("nolink", ks).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, un = { _backpedal: Ce, anyPunctuation: qr, autolink: Vr, blockSkip: Nr, br: fs, code: Mr, del: Ce, delLDelim: Ce, delRDelim: Ce, emStrongLDelim: $r, emStrongRDelimAst: Ur, emStrongRDelimUnd: Hr, escape: Dr, link: Xr, nolink: ks, punctuation: Or, reflink: xs, reflinkSearch: Kr, tag: Zr, text: Lr, url: Ce }, Qr = { ...un, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, en = { ...un, emStrongRDelimAst: Fr, emStrongLDelim: Br, delLDelim: Gr, delRDelim: Wr, 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() }, Jr = { ...en, br: D(fs).replace("{2,}", "*").getRegex(), text: D(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, wt = { normal: on, gfm: Ir, pedantic: Cr }, rt = { normal: un, gfm: en, breaks: Jr, pedantic: Qr }, ei = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ h((a) => ei[a], "de");
1139
+ function be(a, t) {
1128
1140
  if (t) {
1129
- if (J.escapeTest.test(a)) return a.replace(J.escapeReplace, Kn);
1130
- } else if (J.escapeTestNoEncode.test(a)) return a.replace(J.escapeReplaceNoEncode, Kn);
1141
+ if (K.escapeTest.test(a)) return a.replace(K.escapeReplace, Kn);
1142
+ } else if (K.escapeTestNoEncode.test(a)) return a.replace(K.escapeReplaceNoEncode, Kn);
1131
1143
  return a;
1132
1144
  }
1133
- p(ke, "O");
1145
+ h(be, "O");
1134
1146
  function Qn(a) {
1135
1147
  try {
1136
- a = encodeURI(a).replace(J.percentDecode, "%");
1148
+ a = encodeURI(a).replace(K.percentDecode, "%");
1137
1149
  } catch {
1138
1150
  return null;
1139
1151
  }
1140
1152
  return a;
1141
1153
  }
1142
- p(Qn, "J");
1154
+ h(Qn, "J");
1143
1155
  function Jn(a, t) {
1144
- let e = a.replace(J.findPipe, (s, o, l) => {
1145
- let f = !1, c = o;
1146
- for (; --c >= 0 && l[c] === "\\"; ) f = !f;
1147
- return f ? "|" : " |";
1148
- }), n = e.split(J.splitPipe), r = 0;
1156
+ let e = a.replace(K.findPipe, (s, o, l) => {
1157
+ let m = !1, c = o;
1158
+ for (; --c >= 0 && l[c] === "\\"; ) m = !m;
1159
+ return m ? "|" : " |";
1160
+ }), n = e.split(K.splitPipe), r = 0;
1149
1161
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1150
1162
  else for (; n.length < t; ) n.push("");
1151
- for (; r < n.length; r++) n[r] = n[r].trim().replace(J.slashPipe, "|");
1163
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(K.slashPipe, "|");
1152
1164
  return n;
1153
1165
  }
1154
- p(Jn, "V");
1155
- function Te(a, t, e) {
1166
+ h(Jn, "V");
1167
+ function ve(a, t, e) {
1156
1168
  let n = a.length;
1157
1169
  if (n === 0) return "";
1158
1170
  let r = 0;
@@ -1160,15 +1172,15 @@ function Te(a, t, e) {
1160
1172
  r++;
1161
1173
  return a.slice(0, n - r);
1162
1174
  }
1163
- p(Te, "$");
1175
+ h(ve, "$");
1164
1176
  function es(a) {
1165
1177
  let t = a.split(`
1166
1178
  `), e = t.length - 1;
1167
- for (; e >= 0 && J.blankLine.test(t[e]); ) e--;
1179
+ for (; e >= 0 && K.blankLine.test(t[e]); ) e--;
1168
1180
  return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1169
1181
  `);
1170
1182
  }
1171
- p(es, "Y");
1183
+ h(es, "Y");
1172
1184
  function ti(a, t) {
1173
1185
  if (a.indexOf(t[1]) === -1) return -1;
1174
1186
  let e = 0;
@@ -1177,7 +1189,7 @@ function ti(a, t) {
1177
1189
  else if (a[n] === t[1] && (e--, e < 0)) return n;
1178
1190
  return e > 0 ? -2 : -1;
1179
1191
  }
1180
- p(ti, "ge");
1192
+ h(ti, "ge");
1181
1193
  function ni(a, t = 0) {
1182
1194
  let e = t, n = "";
1183
1195
  for (let r of a) if (r === " ") {
@@ -1186,14 +1198,14 @@ function ni(a, t = 0) {
1186
1198
  } else n += r, e++;
1187
1199
  return n;
1188
1200
  }
1189
- p(ni, "fe");
1201
+ h(ni, "fe");
1190
1202
  function ts(a, t, e, n, r) {
1191
1203
  let s = t.href, o = t.title || null, l = a[1].replace(r.other.outputLinkReplace, "$1");
1192
1204
  n.state.inLink = !0;
1193
- let f = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: o, text: l, tokens: n.inlineTokens(l) };
1194
- return n.state.inLink = !1, f;
1205
+ let m = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: o, text: l, tokens: n.inlineTokens(l) };
1206
+ return n.state.inLink = !1, m;
1195
1207
  }
1196
- p(ts, "me");
1208
+ h(ts, "me");
1197
1209
  function si(a, t, e) {
1198
1210
  let n = a.match(e.other.indentCodeCompensation);
1199
1211
  if (n === null) return t;
@@ -1207,13 +1219,13 @@ function si(a, t, e) {
1207
1219
  }).join(`
1208
1220
  `);
1209
1221
  }
1210
- p(si, "rt");
1211
- var Ge, At = (Ge = class {
1222
+ h(si, "rt");
1223
+ var je, Tt = (je = class {
1212
1224
  constructor(t) {
1213
1225
  C(this, "options");
1214
1226
  C(this, "rules");
1215
1227
  C(this, "lexer");
1216
- this.options = t || ze;
1228
+ this.options = t || Le;
1217
1229
  }
1218
1230
  space(t) {
1219
1231
  let e = this.rules.block.newline.exec(t);
@@ -1238,51 +1250,51 @@ var Ge, At = (Ge = class {
1238
1250
  if (e) {
1239
1251
  let n = e[2].trim();
1240
1252
  if (this.rules.other.endingHash.test(n)) {
1241
- let r = Te(n, "#");
1253
+ let r = ve(n, "#");
1242
1254
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1243
1255
  }
1244
- return { type: "heading", raw: Te(e[0], `
1256
+ return { type: "heading", raw: ve(e[0], `
1245
1257
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1246
1258
  }
1247
1259
  }
1248
1260
  hr(t) {
1249
1261
  let e = this.rules.block.hr.exec(t);
1250
- if (e) return { type: "hr", raw: Te(e[0], `
1262
+ if (e) return { type: "hr", raw: ve(e[0], `
1251
1263
  `) };
1252
1264
  }
1253
1265
  blockquote(t) {
1254
1266
  let e = this.rules.block.blockquote.exec(t);
1255
1267
  if (e) {
1256
- let n = Te(e[0], `
1268
+ let n = ve(e[0], `
1257
1269
  `).split(`
1258
1270
  `), r = "", s = "", o = [];
1259
1271
  for (; n.length > 0; ) {
1260
- let l = !1, f = [], c;
1261
- for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) f.push(n[c]), l = !0;
1262
- else if (!l) f.push(n[c]);
1272
+ let l = !1, m = [], c;
1273
+ for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) m.push(n[c]), l = !0;
1274
+ else if (!l) m.push(n[c]);
1263
1275
  else break;
1264
1276
  n = n.slice(c);
1265
- let x = f.join(`
1266
- `), h = x.replace(this.rules.other.blockquoteSetextReplace, `
1277
+ let b = m.join(`
1278
+ `), p = b.replace(this.rules.other.blockquoteSetextReplace, `
1267
1279
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1268
1280
  r = r ? `${r}
1269
- ${x}` : x, s = s ? `${s}
1270
- ${h}` : h;
1281
+ ${b}` : b, s = s ? `${s}
1282
+ ${p}` : p;
1271
1283
  let d = this.lexer.state.top;
1272
- if (this.lexer.state.top = !0, this.lexer.blockTokens(h, o, !0), this.lexer.state.top = d, n.length === 0) break;
1284
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(p, o, !0), this.lexer.state.top = d, n.length === 0) break;
1273
1285
  let g = o.at(-1);
1274
1286
  if (g?.type === "code") break;
1275
1287
  if (g?.type === "blockquote") {
1276
- let w = g, E = w.raw + `
1288
+ let y = g, E = y.raw + `
1277
1289
  ` + n.join(`
1278
1290
  `), O = this.blockquote(E);
1279
- o[o.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;
1291
+ o[o.length - 1] = O, r = r.substring(0, r.length - y.raw.length) + O.raw, s = s.substring(0, s.length - y.text.length) + O.text;
1280
1292
  break;
1281
1293
  } else if (g?.type === "list") {
1282
- let w = g, E = w.raw + `
1294
+ let y = g, E = y.raw + `
1283
1295
  ` + n.join(`
1284
1296
  `), O = this.list(E);
1285
- o[o.length - 1] = O, r = r.substring(0, r.length - g.raw.length) + O.raw, s = s.substring(0, s.length - w.raw.length) + O.raw, n = E.substring(o.at(-1).raw.length).split(`
1297
+ o[o.length - 1] = O, r = r.substring(0, r.length - g.raw.length) + O.raw, s = s.substring(0, s.length - y.raw.length) + O.raw, n = E.substring(o.at(-1).raw.length).split(`
1286
1298
  `);
1287
1299
  continue;
1288
1300
  }
@@ -1297,59 +1309,59 @@ ${h}` : h;
1297
1309
  n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1298
1310
  let o = this.rules.other.listItemRegex(n), l = !1;
1299
1311
  for (; t; ) {
1300
- let c = !1, x = "", h = "";
1312
+ let c = !1, b = "", p = "";
1301
1313
  if (!(e = o.exec(t)) || this.rules.block.hr.test(t)) break;
1302
- x = e[0], t = t.substring(x.length);
1314
+ b = e[0], t = t.substring(b.length);
1303
1315
  let d = ni(e[2].split(`
1304
1316
  `, 1)[0], e[1].length), g = t.split(`
1305
- `, 1)[0], w = !d.trim(), E = 0;
1306
- if (this.options.pedantic ? (E = 2, h = d.trimStart()) : w ? E = e[1].length + 1 : (E = d.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, h = d.slice(E), E += e[1].length), w && this.rules.other.blankLine.test(g) && (x += g + `
1317
+ `, 1)[0], y = !d.trim(), E = 0;
1318
+ if (this.options.pedantic ? (E = 2, p = d.trimStart()) : y ? E = e[1].length + 1 : (E = d.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, p = d.slice(E), E += e[1].length), y && this.rules.other.blankLine.test(g) && (b += g + `
1307
1319
  `, t = t.substring(g.length + 1), c = !0), !c) {
1308
- let O = this.rules.other.nextBulletRegex(E), U = this.rules.other.hrRegex(E), ae = this.rules.other.fencesBeginRegex(E), le = this.rules.other.headingBeginRegex(E), z = this.rules.other.htmlBeginRegex(E), oe = this.rules.other.blockquoteBeginRegex(E);
1320
+ let O = this.rules.other.nextBulletRegex(E), ae = this.rules.other.hrRegex(E), ce = this.rules.other.fencesBeginRegex(E), ne = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), Y = this.rules.other.blockquoteBeginRegex(E);
1309
1321
  for (; t; ) {
1310
- let me = t.split(`
1311
- `, 1)[0], V;
1312
- if (g = me, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), V = g) : V = g.replace(this.rules.other.tabCharGlobal, " "), ae.test(g) || le.test(g) || z.test(g) || oe.test(g) || O.test(g) || U.test(g)) break;
1313
- if (V.search(this.rules.other.nonSpaceChar) >= E || !g.trim()) h += `
1314
- ` + V.slice(E);
1322
+ let ue = t.split(`
1323
+ `, 1)[0], Q;
1324
+ if (g = ue, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), Q = g) : Q = g.replace(this.rules.other.tabCharGlobal, " "), ce.test(g) || ne.test(g) || N.test(g) || Y.test(g) || O.test(g) || ae.test(g)) break;
1325
+ if (Q.search(this.rules.other.nonSpaceChar) >= E || !g.trim()) p += `
1326
+ ` + Q.slice(E);
1315
1327
  else {
1316
- if (w || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ae.test(d) || le.test(d) || U.test(d)) break;
1317
- h += `
1328
+ if (y || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ce.test(d) || ne.test(d) || ae.test(d)) break;
1329
+ p += `
1318
1330
  ` + g;
1319
1331
  }
1320
- w = !g.trim(), x += me + `
1321
- `, t = t.substring(me.length + 1), d = V.slice(E);
1332
+ y = !g.trim(), b += ue + `
1333
+ `, t = t.substring(ue.length + 1), d = Q.slice(E);
1322
1334
  }
1323
1335
  }
1324
- s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(x) && (l = !0)), s.items.push({ type: "list_item", raw: x, task: !!this.options.gfm && this.rules.other.listIsTask.test(h), loose: !1, text: h, tokens: [] }), s.raw += x;
1336
+ s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (l = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: !1, text: p, tokens: [] }), s.raw += b;
1325
1337
  }
1326
- let f = s.items.at(-1);
1327
- if (f) f.raw = f.raw.trimEnd(), f.text = f.text.trimEnd();
1338
+ let m = s.items.at(-1);
1339
+ if (m) m.raw = m.raw.trimEnd(), m.text = m.text.trimEnd();
1328
1340
  else return;
1329
1341
  s.raw = s.raw.trimEnd();
1330
1342
  for (let c of s.items) {
1331
1343
  if (this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []), c.task) {
1332
1344
  if (c.text = c.text.replace(this.rules.other.listReplaceTask, ""), c.tokens[0]?.type === "text" || c.tokens[0]?.type === "paragraph") {
1333
1345
  c.tokens[0].raw = c.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), c.tokens[0].text = c.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1334
- for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
1335
- this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
1346
+ for (let p = this.lexer.inlineQueue.length - 1; p >= 0; p--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)) {
1347
+ this.lexer.inlineQueue[p].src = this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask, "");
1336
1348
  break;
1337
1349
  }
1338
1350
  }
1339
- let x = this.rules.other.listTaskCheckbox.exec(c.raw);
1340
- if (x) {
1341
- let h = { type: "checkbox", raw: x[0] + " ", checked: x[0] !== "[ ]" };
1342
- c.checked = h.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 = h.raw + c.tokens[0].raw, c.tokens[0].text = h.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(h)) : c.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [h] }) : c.tokens.unshift(h);
1351
+ let b = this.rules.other.listTaskCheckbox.exec(c.raw);
1352
+ if (b) {
1353
+ let p = { type: "checkbox", raw: b[0] + " ", checked: b[0] !== "[ ]" };
1354
+ c.checked = p.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 = p.raw + c.tokens[0].raw, c.tokens[0].text = p.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(p)) : c.tokens.unshift({ type: "paragraph", raw: p.raw, text: p.raw, tokens: [p] }) : c.tokens.unshift(p);
1343
1355
  }
1344
1356
  }
1345
1357
  if (!s.loose) {
1346
- let x = c.tokens.filter((d) => d.type === "space"), h = x.length > 0 && x.some((d) => this.rules.other.anyLine.test(d.raw));
1347
- s.loose = h;
1358
+ let b = c.tokens.filter((d) => d.type === "space"), p = b.length > 0 && b.some((d) => this.rules.other.anyLine.test(d.raw));
1359
+ s.loose = p;
1348
1360
  }
1349
1361
  }
1350
1362
  if (s.loose) for (let c of s.items) {
1351
1363
  c.loose = !0;
1352
- for (let x of c.tokens) x.type === "text" && (x.type = "paragraph");
1364
+ for (let b of c.tokens) b.type === "text" && (b.type = "paragraph");
1353
1365
  }
1354
1366
  return s;
1355
1367
  }
@@ -1365,7 +1377,7 @@ ${h}` : h;
1365
1377
  let e = this.rules.block.def.exec(t);
1366
1378
  if (e) {
1367
1379
  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];
1368
- return { type: "def", tag: n, raw: Te(e[0], `
1380
+ return { type: "def", tag: n, raw: ve(e[0], `
1369
1381
  `), href: r, title: s };
1370
1382
  }
1371
1383
  }
@@ -1373,12 +1385,12 @@ ${h}` : h;
1373
1385
  let e = this.rules.block.table.exec(t);
1374
1386
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1375
1387
  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(`
1376
- `) : [], o = { type: "table", raw: Te(e[0], `
1388
+ `) : [], o = { type: "table", raw: ve(e[0], `
1377
1389
  `), header: [], align: [], rows: [] };
1378
1390
  if (n.length === r.length) {
1379
1391
  for (let l of r) this.rules.other.tableAlignRight.test(l) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? o.align.push("left") : o.align.push(null);
1380
1392
  for (let l = 0; l < n.length; l++) o.header.push({ text: n[l], tokens: this.lexer.inline(n[l]), header: !0, align: o.align[l] });
1381
- for (let l of s) o.rows.push(Jn(l, o.header.length).map((f, c) => ({ text: f, tokens: this.lexer.inline(f), header: !1, align: o.align[c] })));
1393
+ for (let l of s) o.rows.push(Jn(l, o.header.length).map((m, c) => ({ text: m, tokens: this.lexer.inline(m), header: !1, align: o.align[c] })));
1382
1394
  return o;
1383
1395
  }
1384
1396
  }
@@ -1386,7 +1398,7 @@ ${h}` : h;
1386
1398
  let e = this.rules.block.lheading.exec(t);
1387
1399
  if (e) {
1388
1400
  let n = e[1].trim();
1389
- return { type: "heading", raw: Te(e[0], `
1401
+ return { type: "heading", raw: ve(e[0], `
1390
1402
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1391
1403
  }
1392
1404
  }
@@ -1416,7 +1428,7 @@ ${h}` : h;
1416
1428
  let n = e[2].trim();
1417
1429
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1418
1430
  if (!this.rules.other.endAngleBracket.test(n)) return;
1419
- let o = Te(n.slice(0, -1), "\\");
1431
+ let o = ve(n.slice(0, -1), "\\");
1420
1432
  if ((n.length - o.length) % 2 === 0) return;
1421
1433
  } else {
1422
1434
  let o = ti(e[2], "()");
@@ -1448,22 +1460,22 @@ ${h}` : h;
1448
1460
  emStrong(t, e, n = "") {
1449
1461
  let r = this.rules.inline.emStrongLDelim.exec(t);
1450
1462
  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))) {
1451
- let s = [...r[0]].length - 1, o, l, f = s, c = 0, x = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1452
- for (x.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = x.exec(e)) !== null; ) {
1463
+ let s = [...r[0]].length - 1, o, l, m = s, c = 0, b = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1464
+ for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = b.exec(e)) !== null; ) {
1453
1465
  if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
1454
1466
  if (l = [...o].length, r[3] || r[4]) {
1455
- f += l;
1467
+ m += l;
1456
1468
  continue;
1457
1469
  } else if ((r[5] || r[6]) && s % 3 && !((s + l) % 3)) {
1458
1470
  c += l;
1459
1471
  continue;
1460
1472
  }
1461
- if (f -= l, f > 0) continue;
1462
- l = Math.min(l, l + f + c);
1463
- let h = [...r[0]][0].length, d = t.slice(0, s + r.index + h + l);
1473
+ if (m -= l, m > 0) continue;
1474
+ l = Math.min(l, l + m + c);
1475
+ let p = [...r[0]][0].length, d = t.slice(0, s + r.index + p + l);
1464
1476
  if (Math.min(s, l) % 2) {
1465
- let w = d.slice(1, -1);
1466
- return { type: "em", raw: d, text: w, tokens: this.lexer.inlineTokens(w) };
1477
+ let y = d.slice(1, -1);
1478
+ return { type: "em", raw: d, text: y, tokens: this.lexer.inlineTokens(y) };
1467
1479
  }
1468
1480
  let g = d.slice(2, -2);
1469
1481
  return { type: "strong", raw: d, text: g, tokens: this.lexer.inlineTokens(g) };
@@ -1484,17 +1496,17 @@ ${h}` : h;
1484
1496
  del(t, e, n = "") {
1485
1497
  let r = this.rules.inline.delLDelim.exec(t);
1486
1498
  if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1487
- let s = [...r[0]].length - 1, o, l, f = s, c = this.rules.inline.delRDelim;
1499
+ let s = [...r[0]].length - 1, o, l, m = s, c = this.rules.inline.delRDelim;
1488
1500
  for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
1489
1501
  if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o || (l = [...o].length, l !== s)) continue;
1490
1502
  if (r[3] || r[4]) {
1491
- f += l;
1503
+ m += l;
1492
1504
  continue;
1493
1505
  }
1494
- if (f -= l, f > 0) continue;
1495
- l = Math.min(l, l + f);
1496
- let x = [...r[0]][0].length, h = t.slice(0, s + r.index + x + l), d = h.slice(s, -s);
1497
- return { type: "del", raw: h, text: d, tokens: this.lexer.inlineTokens(d) };
1506
+ if (m -= l, m > 0) continue;
1507
+ l = Math.min(l, l + m);
1508
+ let b = [...r[0]][0].length, p = t.slice(0, s + r.index + b + l), d = p.slice(s, -s);
1509
+ return { type: "del", raw: p, text: d, tokens: this.lexer.inlineTokens(d) };
1498
1510
  }
1499
1511
  }
1500
1512
  }
@@ -1527,28 +1539,28 @@ ${h}` : h;
1527
1539
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1528
1540
  }
1529
1541
  }
1530
- }, p(Ge, "w"), Ge), Ee, fe = (Ee = class {
1542
+ }, h(je, "w"), je), Ae, de = (Ae = class {
1531
1543
  constructor(t) {
1532
1544
  C(this, "tokens");
1533
1545
  C(this, "options");
1534
1546
  C(this, "state");
1535
1547
  C(this, "inlineQueue");
1536
1548
  C(this, "tokenizer");
1537
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ze, this.options.tokenizer = this.options.tokenizer || new At(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1538
- let e = { other: J, block: vt.normal, inline: it.normal };
1539
- this.options.pedantic ? (e.block = vt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
1549
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1550
+ let e = { other: K, block: wt.normal, inline: rt.normal };
1551
+ this.options.pedantic ? (e.block = wt.pedantic, e.inline = rt.pedantic) : this.options.gfm && (e.block = wt.gfm, this.options.breaks ? e.inline = rt.breaks : e.inline = rt.gfm), this.tokenizer.rules = e;
1540
1552
  }
1541
1553
  static get rules() {
1542
- return { block: vt, inline: it };
1554
+ return { block: wt, inline: rt };
1543
1555
  }
1544
1556
  static lex(t, e) {
1545
- return new Ee(e).lex(t);
1557
+ return new Ae(e).lex(t);
1546
1558
  }
1547
1559
  static lexInline(t, e) {
1548
- return new Ee(e).inlineTokens(t);
1560
+ return new Ae(e).inlineTokens(t);
1549
1561
  }
1550
1562
  lex(t) {
1551
- t = t.replace(J.carriageReturn, `
1563
+ t = t.replace(K.carriageReturn, `
1552
1564
  `), this.blockTokens(t, this.tokens);
1553
1565
  for (let e = 0; e < this.inlineQueue.length; e++) {
1554
1566
  let n = this.inlineQueue[e];
@@ -1557,7 +1569,7 @@ ${h}` : h;
1557
1569
  return this.inlineQueue = [], this.tokens;
1558
1570
  }
1559
1571
  blockTokens(t, e = [], n = !1) {
1560
- this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(J.tabCharGlobal, " ").replace(J.spaceLine, ""));
1572
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(K.tabCharGlobal, " ").replace(K.spaceLine, ""));
1561
1573
  let r = 1 / 0;
1562
1574
  for (; t; ) {
1563
1575
  if (t.length < r) r = t.length;
@@ -1626,9 +1638,9 @@ ${h}` : h;
1626
1638
  }
1627
1639
  let o = t;
1628
1640
  if (this.options.extensions?.startBlock) {
1629
- let l = 1 / 0, f = t.slice(1), c;
1630
- this.options.extensions.startBlock.forEach((x) => {
1631
- c = x.call({ lexer: this }, f), typeof c == "number" && c >= 0 && (l = Math.min(l, c));
1641
+ let l = 1 / 0, m = t.slice(1), c;
1642
+ this.options.extensions.startBlock.forEach((b) => {
1643
+ c = b.call({ lexer: this }, m), typeof c == "number" && c >= 0 && (l = Math.min(l, c));
1632
1644
  }), l < 1 / 0 && l >= 0 && (o = t.substring(0, l + 1));
1633
1645
  }
1634
1646
  if (this.state.top && (s = this.tokenizer.paragraph(o))) {
@@ -1669,16 +1681,16 @@ ${h}` : h;
1669
1681
  let s;
1670
1682
  for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = r[2] ? r[2].length : 0, n = n.slice(0, r.index + s) + "[" + "a".repeat(r[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1671
1683
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1672
- let o = !1, l = "", f = 1 / 0;
1684
+ let o = !1, l = "", m = 1 / 0;
1673
1685
  for (; t; ) {
1674
- if (t.length < f) f = t.length;
1686
+ if (t.length < m) m = t.length;
1675
1687
  else {
1676
1688
  this.infiniteLoopError(t.charCodeAt(0));
1677
1689
  break;
1678
1690
  }
1679
1691
  o || (l = ""), o = !1;
1680
1692
  let c;
1681
- if (this.options.extensions?.inline?.some((h) => (c = h.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1693
+ if (this.options.extensions?.inline?.some((p) => (c = p.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1682
1694
  if (c = this.tokenizer.escape(t)) {
1683
1695
  t = t.substring(c.raw.length), e.push(c);
1684
1696
  continue;
@@ -1693,8 +1705,8 @@ ${h}` : h;
1693
1705
  }
1694
1706
  if (c = this.tokenizer.reflink(t, this.tokens.links)) {
1695
1707
  t = t.substring(c.raw.length);
1696
- let h = e.at(-1);
1697
- c.type === "text" && h?.type === "text" ? (h.raw += c.raw, h.text += c.text) : e.push(c);
1708
+ let p = e.at(-1);
1709
+ c.type === "text" && p?.type === "text" ? (p.raw += c.raw, p.text += c.text) : e.push(c);
1698
1710
  continue;
1699
1711
  }
1700
1712
  if (c = this.tokenizer.emStrong(t, n, l)) {
@@ -1721,17 +1733,17 @@ ${h}` : h;
1721
1733
  t = t.substring(c.raw.length), e.push(c);
1722
1734
  continue;
1723
1735
  }
1724
- let x = t;
1736
+ let b = t;
1725
1737
  if (this.options.extensions?.startInline) {
1726
- let h = 1 / 0, d = t.slice(1), g;
1727
- this.options.extensions.startInline.forEach((w) => {
1728
- g = w.call({ lexer: this }, d), typeof g == "number" && g >= 0 && (h = Math.min(h, g));
1729
- }), h < 1 / 0 && h >= 0 && (x = t.substring(0, h + 1));
1738
+ let p = 1 / 0, d = t.slice(1), g;
1739
+ this.options.extensions.startInline.forEach((y) => {
1740
+ g = y.call({ lexer: this }, d), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
1741
+ }), p < 1 / 0 && p >= 0 && (b = t.substring(0, p + 1));
1730
1742
  }
1731
- if (c = this.tokenizer.inlineText(x)) {
1743
+ if (c = this.tokenizer.inlineText(b)) {
1732
1744
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (l = c.raw.slice(-1)), o = !0;
1733
- let h = e.at(-1);
1734
- h?.type === "text" ? (h.raw += c.raw, h.text += c.text) : e.push(c);
1745
+ let p = e.at(-1);
1746
+ p?.type === "text" ? (p.raw += c.raw, p.text += c.text) : e.push(c);
1735
1747
  continue;
1736
1748
  }
1737
1749
  if (t) {
@@ -1746,20 +1758,20 @@ ${h}` : h;
1746
1758
  if (this.options.silent) console.error(e);
1747
1759
  else throw new Error(e);
1748
1760
  }
1749
- }, p(Ee, "l"), Ee), je, Et = (je = class {
1761
+ }, h(Ae, "l"), Ae), We, St = (We = class {
1750
1762
  constructor(t) {
1751
1763
  C(this, "options");
1752
1764
  C(this, "parser");
1753
- this.options = t || ze;
1765
+ this.options = t || Le;
1754
1766
  }
1755
1767
  space(t) {
1756
1768
  return "";
1757
1769
  }
1758
1770
  code({ text: t, lang: e, escaped: n }) {
1759
- let r = (e || "").match(J.notSpaceStart)?.[0], s = t.replace(J.endingNewline, "") + `
1771
+ let r = (e || "").match(K.notSpaceStart)?.[0], s = t.replace(K.endingNewline, "") + `
1760
1772
  `;
1761
- return r ? '<pre><code class="language-' + ke(r) + '">' + (n ? s : ke(s, !0)) + `</code></pre>
1762
- ` : "<pre><code>" + (n ? s : ke(s, !0)) + `</code></pre>
1773
+ return r ? '<pre><code class="language-' + be(r) + '">' + (n ? s : be(s, !0)) + `</code></pre>
1774
+ ` : "<pre><code>" + (n ? s : be(s, !0)) + `</code></pre>
1763
1775
  `;
1764
1776
  }
1765
1777
  blockquote({ tokens: t }) {
@@ -1784,8 +1796,8 @@ ${this.parser.parse(t)}</blockquote>
1784
1796
  list(t) {
1785
1797
  let e = t.ordered, n = t.start, r = "";
1786
1798
  for (let l = 0; l < t.items.length; l++) {
1787
- let f = t.items[l];
1788
- r += this.listitem(f);
1799
+ let m = t.items[l];
1800
+ r += this.listitem(m);
1789
1801
  }
1790
1802
  let s = e ? "ol" : "ul", o = e && n !== 1 ? ' start="' + n + '"' : "";
1791
1803
  return "<" + s + o + `>
@@ -1837,7 +1849,7 @@ ${t}</tr>
1837
1849
  return `<em>${this.parser.parseInline(t)}</em>`;
1838
1850
  }
1839
1851
  codespan({ text: t }) {
1840
- return `<code>${ke(t, !0)}</code>`;
1852
+ return `<code>${be(t, !0)}</code>`;
1841
1853
  }
1842
1854
  br(t) {
1843
1855
  return "<br>";
@@ -1850,20 +1862,20 @@ ${t}</tr>
1850
1862
  if (s === null) return r;
1851
1863
  t = s;
1852
1864
  let o = '<a href="' + t + '"';
1853
- return e && (o += ' title="' + ke(e) + '"'), o += ">" + r + "</a>", o;
1865
+ return e && (o += ' title="' + be(e) + '"'), o += ">" + r + "</a>", o;
1854
1866
  }
1855
1867
  image({ href: t, title: e, text: n, tokens: r }) {
1856
1868
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1857
1869
  let s = Qn(t);
1858
- if (s === null) return ke(n);
1870
+ if (s === null) return be(n);
1859
1871
  t = s;
1860
- let o = `<img src="${t}" alt="${ke(n)}"`;
1861
- return e && (o += ` title="${ke(e)}"`), o += ">", o;
1872
+ let o = `<img src="${t}" alt="${be(n)}"`;
1873
+ return e && (o += ` title="${be(e)}"`), o += ">", o;
1862
1874
  }
1863
1875
  text(t) {
1864
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : ke(t.text);
1876
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : be(t.text);
1865
1877
  }
1866
- }, p(je, "y"), je), We, pn = (We = class {
1878
+ }, h(We, "y"), We), qe, hn = (qe = class {
1867
1879
  strong({ text: t }) {
1868
1880
  return t;
1869
1881
  }
@@ -1894,18 +1906,18 @@ ${t}</tr>
1894
1906
  checkbox({ raw: t }) {
1895
1907
  return t;
1896
1908
  }
1897
- }, p(We, "L"), We), _e, ge = (_e = class {
1909
+ }, h(qe, "L"), qe), Ee, fe = (Ee = class {
1898
1910
  constructor(t) {
1899
1911
  C(this, "options");
1900
1912
  C(this, "renderer");
1901
1913
  C(this, "textRenderer");
1902
- this.options = t || ze, this.options.renderer = this.options.renderer || new Et(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new pn();
1914
+ this.options = t || Le, this.options.renderer = this.options.renderer || new St(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new hn();
1903
1915
  }
1904
1916
  static parse(t, e) {
1905
- return new _e(e).parse(t);
1917
+ return new Ee(e).parse(t);
1906
1918
  }
1907
1919
  static parseInline(t, e) {
1908
- return new _e(e).parseInline(t);
1920
+ return new Ee(e).parseInline(t);
1909
1921
  }
1910
1922
  parse(t) {
1911
1923
  this.renderer.parser = this;
@@ -2045,11 +2057,11 @@ ${t}</tr>
2045
2057
  }
2046
2058
  return n;
2047
2059
  }
2048
- }, p(_e, "l"), _e), Ae, ot = (Ae = class {
2060
+ }, h(Ee, "l"), Ee), Se, lt = (Se = class {
2049
2061
  constructor(t) {
2050
2062
  C(this, "options");
2051
2063
  C(this, "block");
2052
- this.options = t || ze;
2064
+ this.options = t || Le;
2053
2065
  }
2054
2066
  preprocess(t) {
2055
2067
  return t;
@@ -2064,23 +2076,23 @@ ${t}</tr>
2064
2076
  return t;
2065
2077
  }
2066
2078
  provideLexer(t = this.block) {
2067
- return t ? fe.lex : fe.lexInline;
2079
+ return t ? de.lex : de.lexInline;
2068
2080
  }
2069
2081
  provideParser(t = this.block) {
2070
- return t ? ge.parse : ge.parseInline;
2082
+ return t ? fe.parse : fe.parseInline;
2071
2083
  }
2072
- }, p(Ae, "P"), C(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), qe, ri = (qe = class {
2084
+ }, h(Se, "P"), C(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), C(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), Ve, ri = (Ve = class {
2073
2085
  constructor(...t) {
2074
- C(this, "defaults", sn());
2086
+ C(this, "defaults", nn());
2075
2087
  C(this, "options", this.setOptions);
2076
2088
  C(this, "parse", this.parseMarkdown(!0));
2077
2089
  C(this, "parseInline", this.parseMarkdown(!1));
2078
- C(this, "Parser", ge);
2079
- C(this, "Renderer", Et);
2080
- C(this, "TextRenderer", pn);
2081
- C(this, "Lexer", fe);
2082
- C(this, "Tokenizer", At);
2083
- C(this, "Hooks", ot);
2090
+ C(this, "Parser", fe);
2091
+ C(this, "Renderer", St);
2092
+ C(this, "TextRenderer", hn);
2093
+ C(this, "Lexer", de);
2094
+ C(this, "Tokenizer", Tt);
2095
+ C(this, "Hooks", lt);
2084
2096
  this.use(...t);
2085
2097
  }
2086
2098
  walkTokens(t, e) {
@@ -2116,8 +2128,8 @@ ${t}</tr>
2116
2128
  if ("renderer" in s) {
2117
2129
  let o = e.renderers[s.name];
2118
2130
  o ? e.renderers[s.name] = function(...l) {
2119
- let f = s.renderer.apply(this, l);
2120
- return f === !1 && (f = o.apply(this, l)), f;
2131
+ let m = s.renderer.apply(this, l);
2132
+ return m === !1 && (m = o.apply(this, l)), m;
2121
2133
  } : e.renderers[s.name] = s.renderer;
2122
2134
  }
2123
2135
  if ("tokenizer" in s) {
@@ -2127,51 +2139,51 @@ ${t}</tr>
2127
2139
  }
2128
2140
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2129
2141
  }), r.extensions = e), n.renderer) {
2130
- let s = this.defaults.renderer || new Et(this.defaults);
2142
+ let s = this.defaults.renderer || new St(this.defaults);
2131
2143
  for (let o in n.renderer) {
2132
2144
  if (!(o in s)) throw new Error(`renderer '${o}' does not exist`);
2133
2145
  if (["options", "parser"].includes(o)) continue;
2134
- let l = o, f = n.renderer[l], c = s[l];
2135
- s[l] = (...x) => {
2136
- let h = f.apply(s, x);
2137
- return h === !1 && (h = c.apply(s, x)), h || "";
2146
+ let l = o, m = n.renderer[l], c = s[l];
2147
+ s[l] = (...b) => {
2148
+ let p = m.apply(s, b);
2149
+ return p === !1 && (p = c.apply(s, b)), p || "";
2138
2150
  };
2139
2151
  }
2140
2152
  r.renderer = s;
2141
2153
  }
2142
2154
  if (n.tokenizer) {
2143
- let s = this.defaults.tokenizer || new At(this.defaults);
2155
+ let s = this.defaults.tokenizer || new Tt(this.defaults);
2144
2156
  for (let o in n.tokenizer) {
2145
2157
  if (!(o in s)) throw new Error(`tokenizer '${o}' does not exist`);
2146
2158
  if (["options", "rules", "lexer"].includes(o)) continue;
2147
- let l = o, f = n.tokenizer[l], c = s[l];
2148
- s[l] = (...x) => {
2149
- let h = f.apply(s, x);
2150
- return h === !1 && (h = c.apply(s, x)), h;
2159
+ let l = o, m = n.tokenizer[l], c = s[l];
2160
+ s[l] = (...b) => {
2161
+ let p = m.apply(s, b);
2162
+ return p === !1 && (p = c.apply(s, b)), p;
2151
2163
  };
2152
2164
  }
2153
2165
  r.tokenizer = s;
2154
2166
  }
2155
2167
  if (n.hooks) {
2156
- let s = this.defaults.hooks || new ot();
2168
+ let s = this.defaults.hooks || new lt();
2157
2169
  for (let o in n.hooks) {
2158
2170
  if (!(o in s)) throw new Error(`hook '${o}' does not exist`);
2159
2171
  if (["options", "block"].includes(o)) continue;
2160
- let l = o, f = n.hooks[l], c = s[l];
2161
- ot.passThroughHooks.has(o) ? s[l] = (x) => {
2162
- if (this.defaults.async && ot.passThroughHooksRespectAsync.has(o)) return (async () => {
2163
- let d = await f.call(s, x);
2172
+ let l = o, m = n.hooks[l], c = s[l];
2173
+ lt.passThroughHooks.has(o) ? s[l] = (b) => {
2174
+ if (this.defaults.async && lt.passThroughHooksRespectAsync.has(o)) return (async () => {
2175
+ let d = await m.call(s, b);
2164
2176
  return c.call(s, d);
2165
2177
  })();
2166
- let h = f.call(s, x);
2167
- return c.call(s, h);
2168
- } : s[l] = (...x) => {
2178
+ let p = m.call(s, b);
2179
+ return c.call(s, p);
2180
+ } : s[l] = (...b) => {
2169
2181
  if (this.defaults.async) return (async () => {
2170
- let d = await f.apply(s, x);
2171
- return d === !1 && (d = await c.apply(s, x)), d;
2182
+ let d = await m.apply(s, b);
2183
+ return d === !1 && (d = await c.apply(s, b)), d;
2172
2184
  })();
2173
- let h = f.apply(s, x);
2174
- return h === !1 && (h = c.apply(s, x)), h;
2185
+ let p = m.apply(s, b);
2186
+ return p === !1 && (p = c.apply(s, b)), p;
2175
2187
  };
2176
2188
  }
2177
2189
  r.hooks = s;
@@ -2179,8 +2191,8 @@ ${t}</tr>
2179
2191
  if (n.walkTokens) {
2180
2192
  let s = this.defaults.walkTokens, o = n.walkTokens;
2181
2193
  r.walkTokens = function(l) {
2182
- let f = [];
2183
- return f.push(o.call(this, l)), s && (f = f.concat(s.call(this, l))), f;
2194
+ let m = [];
2195
+ return m.push(o.call(this, l)), s && (m = m.concat(s.call(this, l))), m;
2184
2196
  };
2185
2197
  }
2186
2198
  this.defaults = { ...this.defaults, ...r };
@@ -2190,10 +2202,10 @@ ${t}</tr>
2190
2202
  return this.defaults = { ...this.defaults, ...t }, this;
2191
2203
  }
2192
2204
  lexer(t, e) {
2193
- return fe.lex(t, e ?? this.defaults);
2205
+ return de.lex(t, e ?? this.defaults);
2194
2206
  }
2195
2207
  parser(t, e) {
2196
- return ge.parse(t, e ?? this.defaults);
2208
+ return fe.parse(t, e ?? this.defaults);
2197
2209
  }
2198
2210
  parseMarkdown(t) {
2199
2211
  return (e, n) => {
@@ -2202,17 +2214,17 @@ ${t}</tr>
2202
2214
  if (typeof e > "u" || e === null) return o(new Error("marked(): input parameter is undefined or null"));
2203
2215
  if (typeof e != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2204
2216
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2205
- let l = s.hooks ? await s.hooks.preprocess(e) : e, f = await (s.hooks ? await s.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(l, s), c = s.hooks ? await s.hooks.processAllTokens(f) : f;
2217
+ let l = s.hooks ? await s.hooks.preprocess(e) : e, m = await (s.hooks ? await s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(l, s), c = s.hooks ? await s.hooks.processAllTokens(m) : m;
2206
2218
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2207
- let x = await (s.hooks ? await s.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(c, s);
2208
- return s.hooks ? await s.hooks.postprocess(x) : x;
2219
+ let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(c, s);
2220
+ return s.hooks ? await s.hooks.postprocess(b) : b;
2209
2221
  })().catch(o);
2210
2222
  try {
2211
2223
  s.hooks && (e = s.hooks.preprocess(e));
2212
- let l = (s.hooks ? s.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(e, s);
2224
+ let l = (s.hooks ? s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(e, s);
2213
2225
  s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
2214
- let f = (s.hooks ? s.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(l, s);
2215
- return s.hooks && (f = s.hooks.postprocess(f)), f;
2226
+ let m = (s.hooks ? s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(l, s);
2227
+ return s.hooks && (m = s.hooks.postprocess(m)), m;
2216
2228
  } catch (l) {
2217
2229
  return o(l);
2218
2230
  }
@@ -2222,46 +2234,46 @@ ${t}</tr>
2222
2234
  return (n) => {
2223
2235
  if (n.message += `
2224
2236
  Please report this to https://github.com/markedjs/marked.`, t) {
2225
- let r = "<p>An error occurred:</p><pre>" + ke(n.message + "", !0) + "</pre>";
2237
+ let r = "<p>An error occurred:</p><pre>" + be(n.message + "", !0) + "</pre>";
2226
2238
  return e ? Promise.resolve(r) : r;
2227
2239
  }
2228
2240
  if (e) return Promise.reject(n);
2229
2241
  throw n;
2230
2242
  };
2231
2243
  }
2232
- }, p(qe, "D"), qe), Le = new ri();
2233
- function M(a, t) {
2234
- return Le.parse(a, t);
2244
+ }, h(Ve, "D"), Ve), De = new ri();
2245
+ function L(a, t) {
2246
+ return De.parse(a, t);
2235
2247
  }
2236
- p(M, "g");
2237
- M.options = M.setOptions = function(a) {
2238
- return Le.setOptions(a), M.defaults = Le.defaults, us(M.defaults), M;
2248
+ h(L, "g");
2249
+ L.options = L.setOptions = function(a) {
2250
+ return De.setOptions(a), L.defaults = De.defaults, us(L.defaults), L;
2239
2251
  };
2240
- M.getDefaults = sn;
2241
- M.defaults = ze;
2242
- M.use = function(...a) {
2243
- return Le.use(...a), M.defaults = Le.defaults, us(M.defaults), M;
2252
+ L.getDefaults = nn;
2253
+ L.defaults = Le;
2254
+ L.use = function(...a) {
2255
+ return De.use(...a), L.defaults = De.defaults, us(L.defaults), L;
2244
2256
  };
2245
- M.walkTokens = function(a, t) {
2246
- return Le.walkTokens(a, t);
2257
+ L.walkTokens = function(a, t) {
2258
+ return De.walkTokens(a, t);
2247
2259
  };
2248
- M.parseInline = Le.parseInline;
2249
- M.Parser = ge;
2250
- M.parser = ge.parse;
2251
- M.Renderer = Et;
2252
- M.TextRenderer = pn;
2253
- M.Lexer = fe;
2254
- M.lexer = fe.lex;
2255
- M.Tokenizer = At;
2256
- M.Hooks = ot;
2257
- M.parse = M;
2258
- M.options;
2259
- M.setOptions;
2260
- M.use;
2261
- M.walkTokens;
2262
- M.parseInline;
2263
- ge.parse;
2264
- fe.lex;
2260
+ L.parseInline = De.parseInline;
2261
+ L.Parser = fe;
2262
+ L.parser = fe.parse;
2263
+ L.Renderer = St;
2264
+ L.TextRenderer = hn;
2265
+ L.Lexer = de;
2266
+ L.lexer = de.lex;
2267
+ L.Tokenizer = Tt;
2268
+ L.Hooks = lt;
2269
+ L.parse = L;
2270
+ L.options;
2271
+ L.setOptions;
2272
+ L.use;
2273
+ L.walkTokens;
2274
+ L.parseInline;
2275
+ fe.parse;
2276
+ de.lex;
2265
2277
  const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2266
2278
  key: 0,
2267
2279
  class: "pb-4"
@@ -2295,7 +2307,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2295
2307
  }, Oi = {
2296
2308
  key: 1,
2297
2309
  class: "i-tabler-paperclip size-5"
2298
- }, zi = ["placeholder", "disabled"], Pi = ["disabled"], Yi = /* @__PURE__ */ Oe({
2310
+ }, zi = ["placeholder", "disabled"], Pi = ["disabled"], Yi = /* @__PURE__ */ Me({
2299
2311
  __name: "ElAgentChat",
2300
2312
  props: {
2301
2313
  chatController: {},
@@ -2309,435 +2321,422 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2309
2321
  starterPrompts: {}
2310
2322
  },
2311
2323
  setup(a) {
2312
- const t = new M.Renderer();
2313
- t.link = ({ href: _, text: b }) => {
2314
- let m = !1;
2324
+ const t = new L.Renderer();
2325
+ t.link = ({ href: _, text: f }) => {
2326
+ let x = !1;
2315
2327
  if (typeof window < "u")
2316
2328
  try {
2317
- m = new URL(_, window.location.href).origin === window.location.origin;
2329
+ x = new URL(_, window.location.href).origin === window.location.origin;
2318
2330
  } catch {
2319
- m = !1;
2331
+ x = !1;
2320
2332
  }
2321
- return m ? `<a href="${_}">${b}</a>` : `<a href="${_}" target="_blank" rel="noopener noreferrer">${b}</a>`;
2322
- }, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
2333
+ return x ? `<a href="${_}">${f}</a>` : `<a href="${_}" target="_blank" rel="noopener noreferrer">${f}</a>`;
2334
+ }, L.setOptions({ breaks: !0, gfm: !0, renderer: t });
2323
2335
  function e(_) {
2324
2336
  if (!_)
2325
2337
  return "";
2326
- const b = M.parse(_, { async: !1 });
2327
- return br.sanitize(b, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2338
+ const f = L.parse(_, { async: !1 });
2339
+ return br.sanitize(f, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2328
2340
  }
2329
- p(e, "renderMarkdown");
2341
+ h(e, "renderMarkdown");
2330
2342
  const n = {
2331
- private: "",
2332
- org: "",
2333
- public: ""
2334
- }, r = {
2335
2343
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2336
2344
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2337
2345
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2338
- }, s = [
2346
+ }, r = [
2339
2347
  "Brief me on tomorrow",
2340
2348
  "Triage my inbox",
2341
2349
  "What's on my plate this week"
2342
- ], o = G(
2343
- () => a.starterPrompts ?? s
2344
- ), l = G(() => a.setupHint ?? n[a.scope]), f = G(() => {
2345
- const _ = { ...r[a.scope] };
2350
+ ], s = W(
2351
+ () => a.starterPrompts ?? r
2352
+ ), o = W(() => {
2353
+ const _ = { ...n[a.scope] };
2346
2354
  return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
2347
- }), c = te(""), x = te(!1), h = te(), d = te(), g = te(), w = te([]), E = te(!1);
2348
- function O(_, b) {
2349
- const m = _[b], L = _[b + 1];
2350
- return !L || L.sender !== m.sender;
2355
+ }), l = ee(""), m = ee(!1), c = ee(), b = ee(), p = ee(), d = ee([]), g = ee(!1);
2356
+ function y(_, f) {
2357
+ const x = _[f], M = _[f + 1];
2358
+ return !M || M.sender !== x.sender;
2351
2359
  }
2352
- p(O, "shouldShowAvatar");
2353
- const U = G(() => a.chatController?.textState.value), ae = G(() => U.value?.isConnected ?? !1), le = G(() => U.value?.isThinking ?? !1), z = G(() => U.value?.connectionStatus === "disconnected" && !!U.value?.error), oe = G(() => U.value?.connectionStatus !== "connected" && !U.value?.error), me = G(() => U.value?.error), V = G(() => a.chatController?.sharedMessages.value ?? []), ht = G(() => U.value?.accountGated ?? !1), Re = G(() => !ae.value || ht.value), It = G(() => z.value ? "Agent is offline" : oe.value ? "Connecting..." : ht.value ? "Resolve the billing issue above to continue" : "Message"), Y = G(() => (c.value.trim() || w.value.length > 0) && !Re.value && !E.value), I = G(() => a.variant === "light"), Ie = G(
2360
+ h(y, "shouldShowAvatar");
2361
+ const E = W(() => a.chatController?.textState.value), O = W(() => E.value?.isConnected ?? !1), ae = W(() => E.value?.isThinking ?? !1), ce = W(() => E.value?.connectionStatus === "disconnected" && !!E.value?.error), ne = W(() => E.value?.connectionStatus !== "connected" && !E.value?.error), N = W(() => E.value?.error), Y = W(() => a.chatController?.sharedMessages.value ?? []), ue = W(() => E.value?.accountGated ?? !1), Q = W(() => !O.value || ue.value), _t = W(() => ce.value ? "Agent is offline" : ne.value ? "Connecting..." : ue.value ? "Resolve the billing issue above to continue" : "Message"), ut = W(() => (l.value.trim() || d.value.length > 0) && !Q.value && !g.value), I = W(() => a.variant === "light"), q = W(
2354
2362
  () => I.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2355
- ), ve = G(() => I.value ? "text-theme-300" : "text-white/30");
2356
- nn(async () => {
2357
- if (a.chatController && !ae.value)
2358
- try {
2359
- await a.chatController.startTextConversation();
2360
- } catch (_) {
2361
- console.error("Failed to start text conversation:", _);
2362
- }
2363
+ ), we = W(() => I.value ? "text-theme-300" : "text-white/30");
2364
+ tn(async () => {
2365
+ a.chatController && !O.value && await a.chatController.startTextConversation();
2363
2366
  });
2364
- function Ct() {
2367
+ function Oe() {
2365
2368
  a.chatController?.newConversation();
2366
2369
  }
2367
- p(Ct, "startNewConversation");
2368
- async function Ye() {
2369
- const _ = c.value.trim(), b = w.value.length > 0;
2370
- if (!_ && !b || !a.chatController || !ae.value || E.value)
2370
+ h(Oe, "startNewConversation");
2371
+ async function ye() {
2372
+ const _ = l.value.trim(), f = d.value.length > 0;
2373
+ if (!_ && !f || !a.chatController || !O.value || g.value)
2371
2374
  return;
2372
- const m = c.value, L = b ? [...w.value] : void 0;
2373
- c.value = "", w.value = [], d.value && (d.value.style.height = "auto", d.value.focus());
2374
- try {
2375
- await a.chatController.sendChatMessage(m, L), dt();
2376
- } catch (Z) {
2377
- console.error("Error sending message:", Z);
2378
- }
2375
+ const x = l.value, M = f ? [...d.value] : void 0;
2376
+ l.value = "", d.value = [], b.value && (b.value.style.height = "auto", b.value.focus()), await a.chatController.sendChatMessage(x, M), ht();
2379
2377
  }
2380
- p(Ye, "sendMessage");
2381
- async function Dt(_) {
2382
- Re.value || (c.value = _, await Ye());
2378
+ h(ye, "sendMessage");
2379
+ async function Rt(_) {
2380
+ Q.value || (l.value = _, await ye());
2383
2381
  }
2384
- p(Dt, "sendStarterPrompt");
2385
- async function pt(_) {
2386
- _.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Ye());
2382
+ h(Rt, "sendStarterPrompt");
2383
+ async function It(_) {
2384
+ _.key === "Enter" && !_.shiftKey && (_.preventDefault(), await ye());
2387
2385
  }
2388
- p(pt, "handleKeydown");
2389
- function dt() {
2390
- h.value && Wt(() => {
2391
- h.value.scrollTop = h.value.scrollHeight;
2386
+ h(It, "handleKeydown");
2387
+ function ht() {
2388
+ c.value && jt(() => {
2389
+ c.value.scrollTop = c.value.scrollHeight;
2392
2390
  });
2393
2391
  }
2394
- p(dt, "scrollToBottom");
2395
- function ft() {
2396
- d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
2392
+ h(ht, "scrollToBottom");
2393
+ function pt() {
2394
+ b.value && (b.value.style.height = "auto", b.value.style.height = `${Math.min(b.value.scrollHeight, 150)}px`);
2397
2395
  }
2398
- p(ft, "adjustTextareaHeight"), ct(c, () => Wt(() => ft()));
2399
- function F() {
2400
- g.value?.click();
2396
+ h(pt, "adjustTextareaHeight"), ot(l, () => jt(() => pt()));
2397
+ function Ct() {
2398
+ p.value?.click();
2401
2399
  }
2402
- p(F, "triggerFileInput");
2403
- async function gt(_) {
2404
- const b = _.target, m = b.files?.[0];
2405
- if (!(!m || !a.uploadFn)) {
2406
- E.value = !0;
2400
+ h(Ct, "triggerFileInput");
2401
+ async function dt(_) {
2402
+ const f = _.target, x = f.files?.[0];
2403
+ if (!(!x || !a.uploadFn)) {
2404
+ g.value = !0;
2407
2405
  try {
2408
- const L = await a.uploadFn(m);
2409
- w.value = [...w.value, L];
2410
- } catch (L) {
2411
- console.error("Upload failed:", L);
2406
+ const M = await a.uploadFn(x);
2407
+ d.value = [...d.value, M];
2408
+ } catch (M) {
2409
+ const P = M instanceof Error ? M.message : "Couldn't attach that file.";
2410
+ a.chatController?.notify(`Upload failed — ${P}`);
2412
2411
  } finally {
2413
- E.value = !1, b.value = "";
2412
+ g.value = !1, f.value = "";
2414
2413
  }
2415
2414
  }
2416
2415
  }
2417
- p(gt, "handleFileSelect");
2418
- function W(_) {
2419
- w.value = w.value.filter((b, m) => m !== _);
2420
- }
2421
- p(W, "removeAttachment");
2422
- function Ze(_, b) {
2423
- if (b === 0) {
2424
- const he = _[b];
2425
- return he?.timestamp ? P(new Date(he.timestamp)) : null;
2426
- }
2427
- const m = _[b - 1], L = _[b];
2428
- if (!m?.timestamp || !L?.timestamp) return null;
2429
- const Z = new Date(m.timestamp).getTime();
2430
- return new Date(L.timestamp).getTime() - Z > 36e5 ? P(new Date(L.timestamp)) : null;
2431
- }
2432
- p(Ze, "shouldShowTimeDivider");
2433
- function P(_) {
2434
- const b = /* @__PURE__ */ new Date(), m = _.toDateString() === b.toDateString(), L = new Date(b);
2435
- L.setDate(L.getDate() - 1);
2436
- const Z = _.toDateString() === L.toDateString(), we = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2437
- if (m) return we;
2438
- if (Z) return `Yesterday, ${we}`;
2439
- const Xe = _.getFullYear() === b.getFullYear();
2416
+ h(dt, "handleFileSelect");
2417
+ function U(_) {
2418
+ d.value = d.value.filter((f, x) => x !== _);
2419
+ }
2420
+ h(U, "removeAttachment");
2421
+ function Ze(_, f) {
2422
+ if (f === 0) {
2423
+ const Pe = _[f];
2424
+ return Pe?.timestamp ? F(new Date(Pe.timestamp)) : null;
2425
+ }
2426
+ const x = _[f - 1], M = _[f];
2427
+ if (!x?.timestamp || !M?.timestamp) return null;
2428
+ const P = new Date(x.timestamp).getTime();
2429
+ return new Date(M.timestamp).getTime() - P > 36e5 ? F(new Date(M.timestamp)) : null;
2430
+ }
2431
+ h(Ze, "shouldShowTimeDivider");
2432
+ function F(_) {
2433
+ const f = /* @__PURE__ */ new Date(), x = _.toDateString() === f.toDateString(), M = new Date(f);
2434
+ M.setDate(M.getDate() - 1);
2435
+ const P = _.toDateString() === M.toDateString(), xe = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2436
+ if (x) return xe;
2437
+ if (P) return `Yesterday, ${xe}`;
2438
+ const ze = _.getFullYear() === f.getFullYear();
2440
2439
  return `${_.toLocaleDateString("en-US", {
2441
2440
  weekday: "long",
2442
2441
  month: "short",
2443
2442
  day: "numeric",
2444
- ...Xe ? {} : { year: "numeric" }
2445
- })}, ${we}`;
2443
+ ...ze ? {} : { year: "numeric" }
2444
+ })}, ${xe}`;
2446
2445
  }
2447
- return p(P, "formatTimeDivider"), ct(V, (_) => {
2448
- _.length > 0 && Wt(() => dt());
2449
- }, { immediate: !0, deep: !0 }), (_, b) => (T(), S("div", ii, [
2446
+ return h(F, "formatTimeDivider"), ot(Y, (_) => {
2447
+ _.length > 0 && jt(() => ht());
2448
+ }, { immediate: !0, deep: !0 }), (_, f) => (T(), S("div", ii, [
2450
2449
  I.value ? B("", !0) : (T(), S("div", ai, [
2451
- qt(qs, {
2450
+ Wt(qs, {
2452
2451
  agent: a.agent,
2453
- "is-online": ae.value
2452
+ "is-online": O.value
2454
2453
  }, null, 8, ["agent", "is-online"])
2455
2454
  ])),
2456
- z.value ? (T(), S("div", {
2455
+ ce.value ? (T(), S("div", {
2457
2456
  key: 1,
2458
2457
  class: A(["py-16 flex flex-col items-center justify-center gap-3 text-sm", I.value ? "text-theme-400" : "text-white/60"])
2459
2458
  }, [
2460
- y("i", {
2459
+ w("i", {
2461
2460
  class: A(["i-heroicons-cloud-arrow-down size-8", I.value ? "text-theme-300" : "text-white/40"])
2462
2461
  }, null, 2),
2463
- y("span", null, ie(me.value), 1)
2464
- ], 2)) : oe.value ? (T(), S("div", {
2462
+ w("span", null, ie(N.value), 1)
2463
+ ], 2)) : ne.value ? (T(), S("div", {
2465
2464
  key: 2,
2466
2465
  class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm", I.value ? "text-theme-400" : "text-theme-600"])
2467
2466
  }, [
2468
- qt(Ln, { class: "size-4" })
2469
- ], 2)) : l.value ? (T(), S("div", {
2467
+ Wt(Ln, { class: "size-4" })
2468
+ ], 2)) : a.setupHint ? (T(), S("div", {
2470
2469
  key: 3,
2471
- class: A(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ve.value])
2470
+ class: A(["flex items-center justify-center gap-1.5 py-2 text-[11px]", we.value])
2472
2471
  }, [
2473
- b[6] || (b[6] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
2474
- y("span", null, ie(l.value), 1)
2472
+ f[6] || (f[6] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
2473
+ w("span", null, ie(a.setupHint), 1)
2475
2474
  ], 2)) : B("", !0),
2476
- y("div", {
2475
+ w("div", {
2477
2476
  ref_key: "messagesContainer",
2478
- ref: h,
2477
+ ref: c,
2479
2478
  class: "flex-1 overflow-y-auto overflow-x-hidden pt-4 pb-[120px] px-3 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
2480
2479
  }, [
2481
- V.value.length === 0 && !oe.value && !z.value ? (T(), S("div", li, [
2482
- y("div", oi, [
2483
- y("img", {
2480
+ Y.value.length === 0 && !ne.value && !ce.value ? (T(), S("div", li, [
2481
+ w("div", oi, [
2482
+ w("img", {
2484
2483
  src: a.agent.avatarUrl.value,
2485
2484
  alt: a.agent.displayName.value,
2486
2485
  class: A(["size-full rounded-full object-cover ring-1", I.value ? "ring-black/5" : "ring-white/10"])
2487
2486
  }, null, 10, ci),
2488
- ae.value ? (T(), S("span", {
2487
+ O.value ? (T(), S("span", {
2489
2488
  key: 0,
2490
2489
  class: A(["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", I.value ? "bg-white" : "bg-theme-900"])
2491
- }, [...b[7] || (b[7] = [
2492
- y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2490
+ }, [...f[7] || (f[7] = [
2491
+ w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2493
2492
  ])], 2)) : B("", !0)
2494
2493
  ]),
2495
- y("div", {
2494
+ w("div", {
2496
2495
  class: A(["text-base @sm/chat:text-lg font-semibold", I.value ? "text-theme-900" : "text-white"])
2497
2496
  }, ie(a.agent.displayName.value), 3),
2498
- y("p", {
2499
- class: A(["mt-1 text-center text-xs @sm/chat:text-sm", ve.value])
2497
+ w("p", {
2498
+ class: A(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
2500
2499
  }, ie(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2501
- o.value.length > 0 && !Re.value ? (T(), S("div", ui, [
2502
- (T(!0), S(Se, null, at(o.value, (m) => (T(), S("button", {
2503
- key: m,
2500
+ s.value.length > 0 && !Q.value ? (T(), S("div", ui, [
2501
+ (T(!0), S(Te, null, it(s.value, (x) => (T(), S("button", {
2502
+ key: x,
2504
2503
  type: "button",
2505
2504
  "data-test": "chat-starter-prompt",
2506
2505
  class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", I.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"]),
2507
- onClick: /* @__PURE__ */ p((L) => Dt(m), "onClick")
2508
- }, ie(m), 11, hi))), 128))
2506
+ onClick: /* @__PURE__ */ h((M) => Rt(x), "onClick")
2507
+ }, ie(x), 11, hi))), 128))
2509
2508
  ])) : B("", !0),
2510
- y("div", {
2509
+ w("div", {
2511
2510
  class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", I.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2512
- title: f.value.tooltip
2511
+ title: o.value.tooltip
2513
2512
  }, [
2514
- y("i", {
2515
- class: A([f.value.icon, "size-3"])
2513
+ w("i", {
2514
+ class: A([o.value.icon, "size-3"])
2516
2515
  }, null, 2),
2517
- y("span", null, ie(f.value.label), 1)
2516
+ w("span", null, ie(o.value.label), 1)
2518
2517
  ], 10, pi)
2519
2518
  ])) : B("", !0),
2520
- V.value.length > 0 ? (T(), S("div", di, [
2521
- y("button", {
2519
+ Y.value.length > 0 ? (T(), S("div", di, [
2520
+ w("button", {
2522
2521
  type: "button",
2523
2522
  "data-test": "chat-new-session",
2524
2523
  class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", I.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2525
- onClick: Ct
2526
- }, [...b[8] || (b[8] = [
2527
- y("i", { class: "i-tabler-refresh size-3" }, null, -1),
2528
- y("span", null, "New chat", -1)
2524
+ onClick: Oe
2525
+ }, [...f[8] || (f[8] = [
2526
+ w("i", { class: "i-tabler-refresh size-3" }, null, -1),
2527
+ w("span", null, "New chat", -1)
2529
2528
  ])], 2)
2530
2529
  ])) : B("", !0),
2531
- (T(!0), S(Se, null, at(V.value, (m, L) => (T(), S(Se, {
2532
- key: m.id
2530
+ (T(!0), S(Te, null, it(Y.value, (x, M) => (T(), S(Te, {
2531
+ key: x.id
2533
2532
  }, [
2534
- Ze(V.value, L) ? (T(), S("div", fi, [
2535
- y("div", {
2536
- class: A(["flex-1 h-px", Ie.value])
2533
+ Ze(Y.value, M) ? (T(), S("div", fi, [
2534
+ w("div", {
2535
+ class: A(["flex-1 h-px", q.value])
2537
2536
  }, null, 2),
2538
- y("span", {
2539
- class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ve.value])
2540
- }, ie(Ze(V.value, L)), 3),
2541
- y("div", {
2542
- class: A(["flex-1 h-px", Ie.value])
2537
+ w("span", {
2538
+ class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
2539
+ }, ie(Ze(Y.value, M)), 3),
2540
+ w("div", {
2541
+ class: A(["flex-1 h-px", q.value])
2543
2542
  }, null, 2)
2544
2543
  ])) : B("", !0),
2545
- m.sender === "system" ? (T(), S("div", {
2544
+ x.sender === "system" ? (T(), S("div", {
2546
2545
  key: 1,
2547
2546
  "data-test": "messaging-system-msg",
2548
- "data-issue-code": m.issue?.code,
2549
- "data-issue-bucket": m.issue?.bucket,
2547
+ "data-issue-code": x.issue?.code,
2548
+ "data-issue-bucket": x.issue?.bucket,
2550
2549
  class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", I.value ? "text-theme-500" : "text-white/70"])
2551
2550
  }, [
2552
- y("i", {
2553
- class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", m.issue?.bucket === "account" ? I.value ? "text-amber-500" : "text-amber-300" : I.value ? "text-red-500" : "text-red-300"])
2551
+ w("i", {
2552
+ class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", x.issue?.bucket === "account" ? I.value ? "text-amber-500" : "text-amber-300" : I.value ? "text-red-500" : "text-red-300"])
2554
2553
  }, null, 2),
2555
- y("div", mi, [
2556
- y("span", null, ie(m.text), 1),
2557
- m.issue?.help ? (T(), S("span", {
2554
+ w("div", mi, [
2555
+ w("span", null, ie(x.text), 1),
2556
+ x.issue?.help ? (T(), S("span", {
2558
2557
  key: 0,
2559
2558
  class: A(["text-[12px]", I.value ? "text-theme-400" : "text-white/55"])
2560
- }, ie(m.issue.help), 3)) : B("", !0),
2561
- m.issue?.actionUrl ? (T(), S("a", {
2559
+ }, ie(x.issue.help), 3)) : B("", !0),
2560
+ x.issue?.actionUrl ? (T(), S("a", {
2562
2561
  key: 1,
2563
- href: m.issue.actionUrl,
2562
+ href: x.issue.actionUrl,
2564
2563
  "data-test": "messaging-system-msg-action",
2565
2564
  class: A(["text-[12px] font-medium inline-flex items-center gap-1", I.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2566
2565
  }, [
2567
- et(ie(m.issue.actionLabel) + " ", 1),
2568
- b[9] || (b[9] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2566
+ Je(ie(x.issue.actionLabel) + " ", 1),
2567
+ f[9] || (f[9] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2569
2568
  ], 10, bi)) : B("", !0)
2570
2569
  ])
2571
2570
  ], 10, gi)) : (T(), S("div", {
2572
2571
  key: 2,
2573
- "data-test": m.sender === "agent" ? "messaging-assistant-msg" : m.sender === "user" ? "messaging-user-msg" : void 0,
2572
+ "data-test": x.sender === "agent" ? "messaging-assistant-msg" : x.sender === "user" ? "messaging-user-msg" : void 0,
2574
2573
  class: A(["flex gap-2 items-end", {
2575
- "justify-end": m.sender === "user",
2576
- "justify-start": m.sender === "agent",
2577
- "mb-4": O(V.value, L)
2574
+ "justify-end": x.sender === "user",
2575
+ "justify-start": x.sender === "agent",
2576
+ "mb-4": y(Y.value, M)
2578
2577
  }])
2579
2578
  }, [
2580
- m.sender === "agent" ? (T(), S("div", ki, [
2581
- O(V.value, L) ? (T(), S("img", {
2579
+ x.sender === "agent" ? (T(), S("div", ki, [
2580
+ y(Y.value, M) ? (T(), S("img", {
2582
2581
  key: 0,
2583
2582
  src: a.agent.avatarUrl.value,
2584
2583
  alt: a.agent.displayName.value,
2585
2584
  class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2586
2585
  }, null, 10, wi)) : B("", !0)
2587
2586
  ])) : B("", !0),
2588
- y("div", {
2589
- class: A(m.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2587
+ w("div", {
2588
+ class: A(x.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2590
2589
  }, [
2591
- m.attachments?.length ? (T(), S("div", {
2590
+ x.attachments?.length ? (T(), S("div", {
2592
2591
  key: 0,
2593
- class: A(["mb-1 space-y-1", m.sender === "user" ? "flex flex-col items-end" : ""])
2592
+ class: A(["mb-1 space-y-1", x.sender === "user" ? "flex flex-col items-end" : ""])
2594
2593
  }, [
2595
- (T(!0), S(Se, null, at(m.attachments, (Z, we) => (T(), S(Se, { key: we }, [
2596
- Z.type === "image" ? (T(), S("img", {
2594
+ (T(!0), S(Te, null, it(x.attachments, (P, xe) => (T(), S(Te, { key: xe }, [
2595
+ P.type === "image" ? (T(), S("img", {
2597
2596
  key: 0,
2598
- src: Z.url,
2599
- alt: Z.name,
2597
+ src: P.url,
2598
+ alt: P.name,
2600
2599
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2601
- }, null, 8, yi)) : Z.type === "audio" ? (T(), S("audio", {
2600
+ }, null, 8, yi)) : P.type === "audio" ? (T(), S("audio", {
2602
2601
  key: 1,
2603
- src: Z.url,
2602
+ src: P.url,
2604
2603
  controls: "",
2605
2604
  class: "max-w-full"
2606
2605
  }, null, 8, vi)) : (T(), S("a", {
2607
2606
  key: 2,
2608
- href: Z.url,
2607
+ href: P.url,
2609
2608
  target: "_blank",
2610
2609
  rel: "noopener",
2611
2610
  class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", I.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2612
2611
  }, [
2613
- b[10] || (b[10] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2614
- et(" " + ie(Z.name), 1)
2612
+ f[10] || (f[10] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2613
+ Je(" " + ie(P.name), 1)
2615
2614
  ], 10, Ti))
2616
2615
  ], 64))), 128))
2617
2616
  ], 2)) : B("", !0),
2618
- m.text ? (T(), S("div", {
2617
+ x.text ? (T(), S("div", {
2619
2618
  key: 1,
2620
2619
  class: A(["rounded-2xl px-3.5 py-2", [
2621
- m.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : I.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]"
2620
+ x.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : I.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]"
2622
2621
  ]])
2623
2622
  }, [
2624
- y("div", {
2625
- class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", m.sender === "user" || !I.value ? "chat-msg-prose-invert" : ""]),
2626
- innerHTML: e(m.text),
2627
- onClick: b[0] || (b[0] = Rs(() => {
2623
+ w("div", {
2624
+ class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", x.sender === "user" || !I.value ? "chat-msg-prose-invert" : ""]),
2625
+ innerHTML: e(x.text),
2626
+ onClick: f[0] || (f[0] = Rs(() => {
2628
2627
  }, ["stop"]))
2629
2628
  }, null, 10, Si)
2630
2629
  ], 2)) : B("", !0)
2631
2630
  ], 2)
2632
2631
  ], 10, xi))
2633
2632
  ], 64))), 128)),
2634
- le.value ? (T(), S("div", Ai, [
2635
- y("img", {
2633
+ ae.value ? (T(), S("div", Ai, [
2634
+ w("img", {
2636
2635
  src: a.agent.avatarUrl.value,
2637
2636
  alt: a.agent.displayName.value,
2638
2637
  class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2639
2638
  }, null, 10, Ei),
2640
- y("div", {
2639
+ w("div", {
2641
2640
  class: A(["rounded-2xl px-3.5 py-2.5 flex items-center", I.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2642
2641
  }, [
2643
- y("i", {
2642
+ w("i", {
2644
2643
  class: A(["i-svg-spinners-3-dots-bounce size-7", I.value ? "text-theme-400" : "text-white/50"])
2645
2644
  }, null, 2)
2646
2645
  ], 2)
2647
2646
  ])) : B("", !0)
2648
2647
  ], 512),
2649
- y("div", {
2648
+ w("div", {
2650
2649
  class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", I.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"])
2651
2650
  }, [
2652
- w.value.length > 0 ? (T(), S("div", _i, [
2653
- (T(!0), S(Se, null, at(w.value, (m, L) => (T(), S("div", {
2654
- key: L,
2651
+ d.value.length > 0 ? (T(), S("div", _i, [
2652
+ (T(!0), S(Te, null, it(d.value, (x, M) => (T(), S("div", {
2653
+ key: M,
2655
2654
  class: "relative shrink-0 group"
2656
2655
  }, [
2657
- m.type === "image" ? (T(), S("img", {
2656
+ x.type === "image" ? (T(), S("img", {
2658
2657
  key: 0,
2659
- src: m.url,
2660
- alt: m.name,
2658
+ src: x.url,
2659
+ alt: x.name,
2661
2660
  class: A(["size-14 rounded-xl object-cover border", I.value ? "border-black/10" : "border-white/20"])
2662
2661
  }, null, 10, Ri)) : (T(), S("div", {
2663
2662
  key: 1,
2664
2663
  class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", I.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2665
2664
  }, [
2666
- b[11] || (b[11] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
2667
- y("span", Ii, ie(m.name), 1)
2665
+ f[11] || (f[11] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
2666
+ w("span", Ii, ie(x.name), 1)
2668
2667
  ], 2)),
2669
- y("button", {
2668
+ w("button", {
2670
2669
  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",
2671
- onClick: /* @__PURE__ */ p((Z) => W(L), "onClick")
2672
- }, [...b[12] || (b[12] = [
2673
- y("i", { class: "i-tabler-x size-3" }, null, -1)
2670
+ onClick: /* @__PURE__ */ h((P) => U(M), "onClick")
2671
+ }, [...f[12] || (f[12] = [
2672
+ w("i", { class: "i-tabler-x size-3" }, null, -1)
2674
2673
  ])], 8, Ci)
2675
2674
  ]))), 128)),
2676
- E.value ? (T(), S("div", Di, [
2677
- qt(Ln, { class: "size-5" })
2675
+ g.value ? (T(), S("div", Di, [
2676
+ Wt(Ln, { class: "size-5" })
2678
2677
  ])) : B("", !0)
2679
2678
  ])) : B("", !0),
2680
2679
  a.uploadFn ? (T(), S("input", {
2681
2680
  key: 1,
2682
2681
  ref_key: "fileInput",
2683
- ref: g,
2682
+ ref: p,
2684
2683
  type: "file",
2685
2684
  accept: "image/*,audio/*,video/*",
2686
2685
  class: "hidden",
2687
- onChange: gt
2686
+ onChange: dt
2688
2687
  }, null, 544)) : B("", !0),
2689
- y("div", {
2690
- class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", I.value ? x.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" : x.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2688
+ w("div", {
2689
+ class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", I.value ? m.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" : m.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2691
2690
  }, [
2692
- y("button", {
2691
+ w("button", {
2693
2692
  class: A(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2694
2693
  a.uploadFn ? "cursor-pointer" : "cursor-default",
2695
2694
  I.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2696
- E.value ? "opacity-50 pointer-events-none" : ""
2695
+ g.value ? "opacity-50 pointer-events-none" : ""
2697
2696
  ]]),
2698
- disabled: Re.value || E.value || !a.uploadFn,
2699
- onClick: b[1] || (b[1] = (m) => a.uploadFn && F())
2697
+ disabled: Q.value || g.value || !a.uploadFn,
2698
+ onClick: f[1] || (f[1] = (x) => a.uploadFn && Ct())
2700
2699
  }, [
2701
- E.value ? (T(), S("i", Li)) : (T(), S("i", Oi))
2700
+ g.value ? (T(), S("i", Li)) : (T(), S("i", Oi))
2702
2701
  ], 10, Mi),
2703
- ss(y("textarea", {
2702
+ ss(w("textarea", {
2704
2703
  ref_key: "textarea",
2705
- ref: d,
2706
- "onUpdate:modelValue": b[2] || (b[2] = (m) => c.value = m),
2704
+ ref: b,
2705
+ "onUpdate:modelValue": f[2] || (f[2] = (x) => l.value = x),
2707
2706
  "data-test": "messaging-input",
2708
2707
  rows: "1",
2709
2708
  enterkeyhint: "send",
2710
- placeholder: It.value,
2711
- disabled: Re.value,
2709
+ placeholder: _t.value,
2710
+ disabled: Q.value,
2712
2711
  style: { fontSize: "16px", resize: "none" },
2713
2712
  class: A(["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", I.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2714
- onKeydown: pt,
2715
- onFocus: b[3] || (b[3] = (m) => x.value = !0),
2716
- onBlur: b[4] || (b[4] = (m) => x.value = !1)
2713
+ onKeydown: It,
2714
+ onFocus: f[3] || (f[3] = (x) => m.value = !0),
2715
+ onBlur: f[4] || (f[4] = (x) => m.value = !1)
2717
2716
  }, null, 42, zi), [
2718
- [rs, c.value]
2717
+ [rs, l.value]
2719
2718
  ]),
2720
- y("button", {
2719
+ w("button", {
2721
2720
  "data-test": "messaging-send-btn",
2722
- class: A(["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", Y.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2723
- disabled: !Y.value,
2724
- onClick: b[5] || (b[5] = (m) => Ye())
2725
- }, [...b[13] || (b[13] = [
2726
- y("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2721
+ class: A(["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" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2722
+ disabled: !ut.value,
2723
+ onClick: f[5] || (f[5] = (x) => ye())
2724
+ }, [...f[13] || (f[13] = [
2725
+ w("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2727
2726
  ])], 10, Pi)
2728
2727
  ], 2),
2729
- y("div", {
2728
+ w("div", {
2730
2729
  class: A(["text-[10px] text-center mt-2.5 select-none opacity-70", I.value ? "text-theme-400" : "text-white/50"])
2731
2730
  }, [
2732
- b[14] || (b[14] = et(" Press ", -1)),
2733
- y("kbd", {
2731
+ f[14] || (f[14] = Je(" Press ", -1)),
2732
+ w("kbd", {
2734
2733
  class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2735
2734
  }, "Enter", 2),
2736
- b[15] || (b[15] = et(" to send, ", -1)),
2737
- y("kbd", {
2735
+ f[15] || (f[15] = Je(" to send, ", -1)),
2736
+ w("kbd", {
2738
2737
  class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2739
2738
  }, "Shift+Enter", 2),
2740
- b[16] || (b[16] = et(" for new line ", -1))
2739
+ f[16] || (f[16] = Je(" for new line ", -1))
2741
2740
  ], 2)
2742
2741
  ], 2)
2743
2742
  ]));
@@ -2745,7 +2744,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2745
2744
  }), Ni = { class: "agent-wrap" }, $i = {
2746
2745
  key: 0,
2747
2746
  class: "flex items-center justify-center h-full"
2748
- }, Zi = /* @__PURE__ */ Oe({
2747
+ }, Zi = /* @__PURE__ */ Me({
2749
2748
  __name: "AgentWrap",
2750
2749
  props: {
2751
2750
  sdk: {},
@@ -2762,8 +2761,8 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2762
2761
  const t = Ds("AgentWrap"), e = a, n = e.sdk || Ms.getInstance({
2763
2762
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2764
2763
  ...e.apiBase && { apiBase: e.apiBase }
2765
- }), r = te(!e.agent), s = Is(e.agent ? new Tt({ config: e.agent }) : void 0), o = te();
2766
- return nn(async () => {
2764
+ }), r = ee(!e.agent), s = Is(e.agent ? new yt({ config: e.agent }) : void 0), o = ee();
2765
+ return tn(async () => {
2767
2766
  if (e.agent) {
2768
2767
  t.debug("Agent provided via props, skipping fetch", {
2769
2768
  agentId: e.agent.agentId,
@@ -2789,7 +2788,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2789
2788
  try {
2790
2789
  r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2791
2790
  const l = await n.user.getPublicAgent({ handle: e.handle });
2792
- l ? (s.value = new Tt({ config: l }), t.debug("Successfully fetched public agent", {
2791
+ l ? (s.value = new yt({ config: l }), t.debug("Successfully fetched public agent", {
2793
2792
  agentId: l.agentId,
2794
2793
  handle: l.handle
2795
2794
  }), l.agentId && n.user.track({
@@ -2839,12 +2838,12 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2839
2838
  }
2840
2839
  });
2841
2840
  }
2842
- }), (l, f) => (T(), S("div", Ni, [
2843
- r.value ? (T(), S("div", $i, [...f[0] || (f[0] = [
2844
- y("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2841
+ }), (l, m) => (T(), S("div", Ni, [
2842
+ r.value ? (T(), S("div", $i, [...m[0] || (m[0] = [
2843
+ w("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2845
2844
  ])])) : s.value ? ns(l.$slots, "default", {
2846
2845
  key: 1,
2847
- sdk: Qt(n),
2846
+ sdk: Kt(n),
2848
2847
  agent: s.value,
2849
2848
  context: a.context,
2850
2849
  firstMessage: a.firstMessage,