@pagelines/sdk 1.0.511 → 1.0.513

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,24 +1,24 @@
1
- var Mn = Object.defineProperty;
2
- var Is = (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 });
4
- var I = (a, t, e) => Is(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as ke, openBlock as y, createElementBlock as T, createElementVNode as v, normalizeClass as E, ref as Y, watch as Ze, computed as U, createCommentVNode as B, renderSlot as tn, onMounted as Et, Fragment as ye, renderList as ot, withDirectives as ss, vModelText as rs, unref as Kt, toDisplayString as ne, shallowRef as is, onBeforeUnmount as as, nextTick as Ds, createVNode as Fe, withCtx as Ms, createTextVNode as nt, withModifiers as Ls } from "vue";
6
- import { SettingsObject as Os, Agent as yt, getDefaultAvatarUrl as ls, createLogger as zs } from "@pagelines/core";
1
+ var Ln = Object.defineProperty;
2
+ var Ds = (a, t, e) => t in a ? Ln(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var p = (a, t) => Ln(a, "name", { value: t, configurable: !0 });
4
+ var D = (a, t, e) => Ds(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as we, openBlock as T, createElementBlock as S, createElementVNode as A, normalizeClass as _, ref as Q, watch as Ze, computed as U, createCommentVNode as B, renderSlot as sn, onMounted as _t, Fragment as Se, renderList as ot, withDirectives as is, vModelText as rs, unref as Jt, toDisplayString as le, shallowRef as as, onBeforeUnmount as ls, nextTick as Ms, createVNode as Le, withCtx as Ls, withModifiers as kt, createTextVNode as On } from "vue";
6
+ import { SettingsObject as Os, Agent as Tt, getDefaultAvatarUrl as os, createLogger as zs } from "@pagelines/core";
7
7
  import { P as Ps } from "./sdkClient.js";
8
8
  const Ns = { class: "spinner max-w-sm" }, $s = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, Ln = /* @__PURE__ */ ke({
11
+ }, zn = /* @__PURE__ */ we({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
17
  setup(a) {
18
- return (t, e) => (y(), T("div", Ns, [
19
- (y(), T("svg", $s, [
20
- v("circle", {
21
- class: E([a.colorMode, "ring-path"]),
18
+ return (t, e) => (T(), S("div", Ns, [
19
+ (T(), S("svg", $s, [
20
+ A("circle", {
21
+ class: _([a.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -33,24 +33,24 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
33
33
  }), Us = [
34
34
  { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
35
35
  { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
36
- ], Bs = 9e4, os = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...os, "EMPTY_STREAM", "RATE_LIMIT"]), pn = class pn extends Os {
36
+ ], Bs = 9e4, cs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...cs, "EMPTY_STREAM", "RATE_LIMIT"]), fn = class fn extends Os {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
- I(this, "isTextMode", !1);
40
- I(this, "lastMessage", { hash: "", time: 0 });
41
- I(this, "isConnecting", !1);
39
+ D(this, "isTextMode", !1);
40
+ D(this, "lastMessage", { hash: "", time: 0 });
41
+ D(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
- I(this, "conversationId");
44
- I(this, "textState", Y({
43
+ D(this, "conversationId");
44
+ D(this, "textState", Q({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- I(this, "agentMode", Y("self"));
51
- I(this, "sharedMessages", Y([]));
52
- I(this, "_agent");
53
- this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
50
+ D(this, "agentMode", Q("self"));
51
+ D(this, "sharedMessages", Q([]));
52
+ D(this, "_agent");
53
+ this._agent = e.agent instanceof Tt ? e.agent : new Tt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  return this._agent.chatAvailable.value;
@@ -72,13 +72,13 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
72
72
  return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
73
73
  }
74
74
  isDuplicateMessage(e, n) {
75
- const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
76
- return l || (this.lastMessage = { hash: r, time: s }), l;
75
+ const i = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = i === this.lastMessage.hash && s - this.lastMessage.time < 500;
76
+ return l || (this.lastMessage = { hash: i, time: s }), l;
77
77
  }
78
- addMessage(e, n, r, s) {
78
+ addMessage(e, n, i, s) {
79
79
  this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
80
80
  ...this.sharedMessages.value,
81
- { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: r, ...s ? { issue: s } : {} }
81
+ { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: i, ...s ? { issue: s } : {} }
82
82
  ]);
83
83
  }
84
84
  /**
@@ -96,13 +96,13 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
96
96
  getDynamicSettings() {
97
97
  const { sdk: e } = this.settings;
98
98
  if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
99
- const n = e.activeUser.value, r = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
99
+ const n = e.activeUser.value, i = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
100
100
 
101
101
  Current User:
102
- - Name: ${r?.name || "Anonymous"}
102
+ - Name: ${i?.name || "Anonymous"}
103
103
  - Email: ${n.email}
104
- - Title: ${r?.title || ""}
105
- - About: ${r?.summary || ""}
104
+ - Title: ${i?.title || ""}
105
+ - About: ${i?.summary || ""}
106
106
  ` : "";
107
107
  return {
108
108
  context: `${this.settings.context || ""}${s}`.trim(),
@@ -154,9 +154,9 @@ Current User:
154
154
  * agent/client.ts survive into the console line).
155
155
  */
156
156
  handleError(e, n) {
157
- const r = e.message;
158
- this.logger.error("Conversation error:", { message: r, raw: n, error: e }), this.addMessage(r, "system"), this.resetState(), this.updateState(this.textState, {
159
- error: r,
157
+ const i = e.message;
158
+ this.logger.error("Conversation error:", { message: i, raw: n, error: e }), this.addMessage(i, "system"), this.resetState(), this.updateState(this.textState, {
159
+ error: i,
160
160
  connectionStatus: "error"
161
161
  });
162
162
  }
@@ -214,88 +214,104 @@ Current User:
214
214
  async sendChatMessage(e, n) {
215
215
  if (!this.isTextMode)
216
216
  return;
217
- const { chatStreamFn: r } = this.settings;
217
+ const { chatStreamFn: i } = this.settings;
218
218
  if (!this.chatEnabled) {
219
219
  this.addMessage("Agent is currently offline.", "system");
220
220
  return;
221
221
  }
222
222
  const { sdk: s } = this.settings;
223
- if (!r && !this._agent.handle.value) {
223
+ if (!i && !this._agent.handle.value) {
224
224
  this.handleError(new Error("Agent handle required for chat"));
225
225
  return;
226
226
  }
227
227
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
228
228
  const l = `stream-${Date.now()}`;
229
- let o = !1;
230
- const d = /* @__PURE__ */ p((g, x = "assistant") => {
229
+ let o = !1, d = !1;
230
+ const c = /* @__PURE__ */ p((f, y = "assistant") => {
231
231
  o || (o = !0, this.sharedMessages.value = [
232
232
  ...this.sharedMessages.value,
233
- { id: l, text: "", sender: x === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
233
+ { id: l, text: "", sender: y === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
234
234
  ]);
235
- const k = this.sharedMessages.value, _ = k[k.length - 1];
236
- _?.id === l && (_.text += g, this.sharedMessages.value = [...k]);
237
- }, "onDelta"), c = /* @__PURE__ */ p((g) => {
238
- if (!o) {
239
- m("empty_stream assistant returned no content");
235
+ const C = this.sharedMessages.value, z = C[C.length - 1];
236
+ z?.id === l && (z.text += f, this.sharedMessages.value = [...C]);
237
+ }, "onDelta"), g = /* @__PURE__ */ p((f) => {
238
+ d = !0, o = !0;
239
+ const y = this.sharedMessages.value, C = y.findIndex((z) => z.id === f.id);
240
+ if (C >= 0)
241
+ this.sharedMessages.value = [
242
+ ...y.slice(0, C),
243
+ f,
244
+ ...y.slice(C + 1)
245
+ ];
246
+ else {
247
+ const z = y[y.length - 1];
248
+ this.sharedMessages.value = z?.id === l ? [...y.slice(0, -1), f] : [...y, f];
249
+ }
250
+ f.sender === "system" && f.issue?.bucket === "account" && this.updateState(this.textState, { accountGated: !0 });
251
+ }, "onMessage"), u = /* @__PURE__ */ p((f) => {
252
+ if (!o && !d) {
253
+ w("empty_stream — assistant returned no content");
240
254
  return;
241
255
  }
242
- const x = this.sharedMessages.value, k = x[x.length - 1];
243
- if (k?.id === l && k.sender === "agent" && k.text) {
244
- let _ = k.text;
245
- for (const z of Us)
246
- z.pattern.test(_) && (console.debug(`[chat] filtered directive: ${z.label}`), _ = _.replace(z.pattern, "").trim(), z.pattern.lastIndex = 0);
247
- _ ? _ !== k.text && (k.text = _, this.sharedMessages.value = [...x]) : this.sharedMessages.value = x.slice(0, -1);
248
- }
249
- g && (this.conversationId = g), this.updateState(this.textState, { isThinking: !1 });
250
- }, "onDone"), m = /* @__PURE__ */ p((g) => {
251
- const x = this.sharedMessages.value, k = x[x.length - 1];
252
- if (k?.id === l && !k.text && (this.sharedMessages.value = x.slice(0, -1)), typeof g == "object" && g.code && g.error) {
253
- const { bucket: te, actionUrl: oe, actionLabel: se, help: O } = g;
254
- if (te !== void 0 || Fs.has(g.code)) {
255
- const re = te ?? (os.has(g.code) ? "account" : "error"), ie = {
256
- code: g.code,
257
- bucket: re,
258
- ...se ? { actionLabel: se } : {},
259
- ...oe ? { actionUrl: oe } : {},
260
- ...O ? { help: O } : {}
256
+ const y = this.sharedMessages.value, C = y[y.length - 1];
257
+ if (C?.id === l && C.sender === "agent" && C.text) {
258
+ let z = C.text;
259
+ for (const Z of Us)
260
+ Z.pattern.test(z) && (console.debug(`[chat] filtered directive: ${Z.label}`), z = z.replace(Z.pattern, "").trim(), Z.pattern.lastIndex = 0);
261
+ z ? z !== C.text && (C.text = z, this.sharedMessages.value = [...y]) : this.sharedMessages.value = y.slice(0, -1);
262
+ }
263
+ f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
264
+ }, "onDone"), w = /* @__PURE__ */ p((f) => {
265
+ const y = this.sharedMessages.value, C = y[y.length - 1];
266
+ if (C?.id === l && !C.text && (this.sharedMessages.value = y.slice(0, -1)), typeof f == "object" && f.code && f.error) {
267
+ const { bucket: ie, actionUrl: N, actionLabel: W, help: te } = f;
268
+ if (ie !== void 0 || Fs.has(f.code)) {
269
+ const Re = ie ?? (cs.has(f.code) ? "account" : "error"), ke = {
270
+ code: f.code,
271
+ bucket: Re,
272
+ ...W ? { actionLabel: W } : {},
273
+ ...N ? { actionUrl: N } : {},
274
+ ...te ? { help: te } : {}
261
275
  };
262
- this.addMessage(g.error, "system", void 0, ie), re === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
276
+ this.addMessage(f.error, "system", void 0, ke), Re === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
263
277
  } else
264
- this.handleError(new Error(g.error));
278
+ this.handleError(new Error(f.error));
265
279
  return;
266
280
  }
267
- const _ = typeof g == "string" ? g : g.error, z = this.mapChatError(_);
268
- this.isTransientError(_) ? (this.logger.warn("Chat turn failed (transient):", { raw: _, friendly: z }), this.addMessage(z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(z), _);
269
- }, "onError"), u = /* @__PURE__ */ p((g) => {
270
- this.addMessage(g, "system");
281
+ const z = typeof f == "string" ? f : f.error, Z = this.mapChatError(z);
282
+ this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: Z }), this.addMessage(Z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(Z), z);
283
+ }, "onError"), v = /* @__PURE__ */ p((f) => {
284
+ this.addMessage(f, "system");
271
285
  }, "onStatus");
272
286
  try {
273
- const g = r ? r({
287
+ const f = i ? i({
274
288
  message: e,
275
289
  attachments: n,
276
290
  conversationId: this.conversationId,
277
291
  history: this.buildHistory(),
278
- onDelta: d,
279
- onDone: c,
280
- onError: m,
281
- onStatus: u
292
+ onDelta: c,
293
+ onMessage: g,
294
+ onDone: u,
295
+ onError: w,
296
+ onStatus: v
282
297
  }) : s.chat.chatStreamPublic({
283
298
  handle: this._agent.handle.value,
284
299
  message: e,
285
300
  attachments: n,
286
301
  anonymousId: s.user.generateAnonId(),
287
302
  context: this.getDynamicSettings().context || void 0,
288
- onDelta: d,
289
- onDone: c,
290
- onError: m,
291
- onStatus: u
303
+ onDelta: c,
304
+ onMessage: g,
305
+ onDone: u,
306
+ onError: w,
307
+ onStatus: v
292
308
  });
293
309
  await Promise.race([
294
- g,
295
- new Promise((x, k) => setTimeout(() => k(new Error("timed out")), Bs))
310
+ f,
311
+ new Promise((y, C) => setTimeout(() => C(new Error("timed out")), Bs))
296
312
  ]);
297
- } catch (g) {
298
- m(g.message || "Something went wrong");
313
+ } catch (f) {
314
+ w(f.message || "Something went wrong");
299
315
  }
300
316
  }
301
317
  buildHistory() {
@@ -319,30 +335,30 @@ Current User:
319
335
  await this.endConversation();
320
336
  }
321
337
  };
322
- p(pn, "AgentChatController");
323
- let On = pn;
324
- function zn(a) {
338
+ p(fn, "AgentChatController");
339
+ let Pn = fn;
340
+ function Nn(a) {
325
341
  return a ? typeof a == "string" ? a : a.src || "" : "";
326
342
  }
327
- p(zn, "getImageSrc");
328
- function Ki(a) {
329
- return zn(a.cover) || zn(a.avatar) || ls(a.name);
343
+ p(Nn, "getImageSrc");
344
+ function Kr(a) {
345
+ return Nn(a.cover) || Nn(a.avatar) || os(a.name);
330
346
  }
331
- p(Ki, "getAgentAvatarUrl");
332
- function Pn(a) {
347
+ p(Kr, "getAgentAvatarUrl");
348
+ function $n(a) {
333
349
  const t = a.target;
334
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = ls());
350
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = os());
335
351
  }
336
- p(Pn, "handleImageError");
337
- function Qi(a) {
352
+ p($n, "handleImageError");
353
+ function Qr(a) {
338
354
  const { template: t, agent: e } = a;
339
355
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
340
356
  }
341
- p(Qi, "parseButtonTemplate");
357
+ p(Qr, "parseButtonTemplate");
342
358
  const Hs = {
343
359
  key: 0,
344
360
  class: "absolute inset-0 flex items-center justify-center"
345
- }, Ji = /* @__PURE__ */ ke({
361
+ }, Jr = /* @__PURE__ */ we({
346
362
  __name: "ElAgentButton",
347
363
  props: {
348
364
  theme: { default: "primary" },
@@ -366,28 +382,28 @@ const Hs = {
366
382
  md: "size-4",
367
383
  lg: "size-5"
368
384
  })[a.size]);
369
- return (r, s) => (y(), T("button", {
370
- class: E(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
385
+ return (i, s) => (T(), S("button", {
386
+ class: _(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
371
387
  }, [
372
- a.loading ? (y(), T("div", Hs, [...s[0] || (s[0] = [
373
- v("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
388
+ a.loading ? (T(), S("div", Hs, [...s[0] || (s[0] = [
389
+ A("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
374
390
  ])])) : B("", !0),
375
- v("span", {
376
- class: E(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
391
+ A("span", {
392
+ class: _(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
377
393
  }, [
378
- a.icon ? (y(), T("i", {
394
+ a.icon ? (T(), S("i", {
379
395
  key: 0,
380
- class: E([a.icon, n.value])
396
+ class: _([a.icon, n.value])
381
397
  }, null, 2)) : B("", !0),
382
- tn(r.$slots, "default"),
383
- a.iconAfter ? (y(), T("i", {
398
+ sn(i.$slots, "default"),
399
+ a.iconAfter ? (T(), S("i", {
384
400
  key: 1,
385
- class: E([a.iconAfter, n.value])
401
+ class: _([a.iconAfter, n.value])
386
402
  }, null, 2)) : B("", !0)
387
403
  ], 2)
388
404
  ], 2));
389
405
  }
390
- }), Gs = ["value"], ea = /* @__PURE__ */ ke({
406
+ }), Gs = ["value"], ea = /* @__PURE__ */ we({
391
407
  __name: "AgentInputEmail",
392
408
  props: {
393
409
  modelValue: { default: "" }
@@ -395,17 +411,17 @@ const Hs = {
395
411
  emits: ["update:modelValue"],
396
412
  setup(a, { emit: t }) {
397
413
  const e = t;
398
- return (n, r) => (y(), T("input", {
414
+ return (n, i) => (T(), S("input", {
399
415
  type: "email",
400
416
  autocomplete: "email",
401
417
  placeholder: "Enter your email",
402
418
  value: a.modelValue,
403
419
  class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
404
420
  style: { "font-size": "16px" },
405
- onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
421
+ onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
406
422
  }, null, 40, Gs));
407
423
  }
408
- }), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ta = /* @__PURE__ */ ke({
424
+ }), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], ta = /* @__PURE__ */ we({
409
425
  __name: "AgentInputOneTimeCode",
410
426
  props: {
411
427
  modelValue: {},
@@ -414,73 +430,73 @@ const Hs = {
414
430
  },
415
431
  emits: ["update:modelValue", "autoSubmit"],
416
432
  setup(a, { emit: t }) {
417
- const e = a, n = t, r = Y([]), s = Y(Array.from({ length: e.length }).fill("")), l = Y(!1);
418
- Et(() => {
419
- e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
433
+ const e = a, n = t, i = Q([]), s = Q(Array.from({ length: e.length }).fill("")), l = Q(!1);
434
+ _t(() => {
435
+ e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && i.value[0]?.focus();
420
436
  }), Ze(() => e.modelValue, (u) => {
421
437
  s.value = u ? u.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
422
438
  }), Ze(s, () => {
423
439
  const u = s.value.filter(Boolean).join("");
424
440
  n("update:modelValue", u), u.length === e.length && n("autoSubmit", u);
425
441
  }, { deep: !0 });
426
- function o(u, g) {
427
- g.preventDefault(), l.value = !0;
428
- const x = (g.clipboardData?.getData("text") || "").replace(/\D/g, "");
429
- if (x.length === e.length)
430
- s.value = x.split(""), setTimeout(() => {
431
- r.value[e.length - 1]?.focus(), l.value = !1;
442
+ function o(u, w) {
443
+ w.preventDefault(), l.value = !0;
444
+ const v = (w.clipboardData?.getData("text") || "").replace(/\D/g, "");
445
+ if (v.length === e.length)
446
+ s.value = v.split(""), setTimeout(() => {
447
+ i.value[e.length - 1]?.focus(), l.value = !1;
432
448
  }, 10);
433
449
  else {
434
- const k = [...s.value];
435
- x.split("").slice(0, e.length - u).forEach((z, te) => {
436
- k[u + te] = z;
437
- }), s.value = k;
438
- const _ = Math.min(u + x.length, e.length - 1);
450
+ const f = [...s.value];
451
+ v.split("").slice(0, e.length - u).forEach((C, z) => {
452
+ f[u + z] = C;
453
+ }), s.value = f;
454
+ const y = Math.min(u + v.length, e.length - 1);
439
455
  setTimeout(() => {
440
- r.value[_]?.focus(), l.value = !1;
456
+ i.value[y]?.focus(), l.value = !1;
441
457
  }, 10);
442
458
  }
443
459
  }
444
460
  p(o, "onPaste");
445
- function d(u, g) {
446
- const x = g.target.value.slice(-1).replace(/\D/g, "");
447
- s.value[u] = x, x && u < e.length - 1 && r.value[u + 1]?.focus();
461
+ function d(u, w) {
462
+ const v = w.target.value.slice(-1).replace(/\D/g, "");
463
+ s.value[u] = v, v && u < e.length - 1 && i.value[u + 1]?.focus();
448
464
  }
449
465
  p(d, "onInput");
450
- function c(u, g) {
451
- g.key === "Backspace" ? (g.preventDefault(), s.value[u] = "", u > 0 && r.value[u - 1]?.focus()) : g.key === "ArrowLeft" && u > 0 ? r.value[u - 1]?.focus() : g.key === "ArrowRight" && u < e.length - 1 && r.value[u + 1]?.focus();
466
+ function c(u, w) {
467
+ w.key === "Backspace" ? (w.preventDefault(), s.value[u] = "", u > 0 && i.value[u - 1]?.focus()) : w.key === "ArrowLeft" && u > 0 ? i.value[u - 1]?.focus() : w.key === "ArrowRight" && u < e.length - 1 && i.value[u + 1]?.focus();
452
468
  }
453
469
  p(c, "onKeydown");
454
- function m(u) {
455
- if (r.value[u]?.select(), !l.value && s.value[u])
456
- for (let g = u; g < e.length; g++)
457
- s.value[g] = "";
458
- }
459
- return p(m, "onFocus"), (u, g) => (y(), T("div", js, [
460
- (y(!0), T(ye, null, ot(a.length, (x) => ss((y(), T("input", {
461
- key: x,
470
+ function g(u) {
471
+ if (i.value[u]?.select(), !l.value && s.value[u])
472
+ for (let w = u; w < e.length; w++)
473
+ s.value[w] = "";
474
+ }
475
+ return p(g, "onFocus"), (u, w) => (T(), S("div", js, [
476
+ (T(!0), S(Se, null, ot(a.length, (v) => is((T(), S("input", {
477
+ key: v,
462
478
  ref_for: !0,
463
- ref: /* @__PURE__ */ p((k) => r.value[x - 1] = k, "ref"),
464
- "onUpdate:modelValue": /* @__PURE__ */ p((k) => s.value[x - 1] = k, "onUpdate:modelValue"),
479
+ ref: /* @__PURE__ */ p((f) => i.value[v - 1] = f, "ref"),
480
+ "onUpdate:modelValue": /* @__PURE__ */ p((f) => s.value[v - 1] = f, "onUpdate:modelValue"),
465
481
  type: "text",
466
482
  inputmode: "numeric",
467
483
  autocomplete: "one-time-code",
468
484
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
469
485
  style: { "font-size": "16px" },
470
486
  maxlength: "1",
471
- onInput: /* @__PURE__ */ p((k) => d(x - 1, k), "onInput"),
472
- onKeydown: /* @__PURE__ */ p((k) => c(x - 1, k), "onKeydown"),
473
- onPaste: /* @__PURE__ */ p((k) => o(x - 1, k), "onPaste"),
474
- onFocus: /* @__PURE__ */ p((k) => m(x - 1), "onFocus")
487
+ onInput: /* @__PURE__ */ p((f) => d(v - 1, f), "onInput"),
488
+ onKeydown: /* @__PURE__ */ p((f) => c(v - 1, f), "onKeydown"),
489
+ onPaste: /* @__PURE__ */ p((f) => o(v - 1, f), "onPaste"),
490
+ onFocus: /* @__PURE__ */ p((f) => g(v - 1), "onFocus")
475
491
  }, null, 40, Ws)), [
476
- [rs, s.value[x - 1]]
492
+ [rs, s.value[v - 1]]
477
493
  ])), 128))
478
494
  ]));
479
495
  }
480
496
  }), qs = { class: "relative flex-shrink-0" }, Vs = ["src", "alt"], Ys = { class: "absolute top-1 right-1" }, Zs = {
481
497
  key: 1,
482
498
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
483
- }, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */ ke({
499
+ }, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */ we({
484
500
  __name: "ElModeHeader",
485
501
  props: {
486
502
  agent: {},
@@ -489,161 +505,161 @@ const Hs = {
489
505
  layout: { default: "centered" }
490
506
  },
491
507
  setup(a) {
492
- return (t, e) => (y(), T("div", {
493
- class: E(["flex gap-4", [
508
+ return (t, e) => (T(), S("div", {
509
+ class: _(["flex gap-4", [
494
510
  a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
495
511
  ]])
496
512
  }, [
497
- v("div", qs, [
498
- v("div", {
499
- class: E(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
513
+ A("div", qs, [
514
+ A("div", {
515
+ class: _(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
500
516
  }, [
501
- v("img", {
517
+ A("img", {
502
518
  src: a.agent.avatarUrl.value,
503
519
  alt: a.agent.displayName.value,
504
520
  class: "w-full h-full object-cover",
505
521
  onError: e[0] || (e[0] = //@ts-ignore
506
- (...n) => Kt(Pn) && Kt(Pn)(...n))
522
+ (...n) => Jt($n) && Jt($n)(...n))
507
523
  }, null, 40, Vs)
508
524
  ], 2),
509
- v("div", Ys, [
510
- a.isOnline ? (y(), T(ye, { key: 0 }, [
511
- e[1] || (e[1] = v("div", {
525
+ A("div", Ys, [
526
+ a.isOnline ? (T(), S(Se, { key: 0 }, [
527
+ e[1] || (e[1] = A("div", {
512
528
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
513
529
  style: { "animation-duration": "3s" }
514
530
  }, null, -1)),
515
- e[2] || (e[2] = v("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
516
- ], 64)) : (y(), T("div", Zs))
531
+ e[2] || (e[2] = A("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
532
+ ], 64)) : (T(), S("div", Zs))
517
533
  ])
518
534
  ]),
519
- v("div", Xs, [
520
- v("h1", {
521
- class: E(["font-light text-white mb-1 truncate", [
535
+ A("div", Xs, [
536
+ A("h1", {
537
+ class: _(["font-light text-white mb-1 truncate", [
522
538
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
523
539
  a.layout === "horizontal" ? "text-white/95" : ""
524
540
  ]])
525
- }, ne(a.agent.displayName.value), 3),
526
- v("p", {
527
- class: E(["font-light line-clamp-1", [
541
+ }, le(a.agent.displayName.value), 3),
542
+ A("p", {
543
+ class: _(["font-light line-clamp-1", [
528
544
  a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
529
545
  a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
530
546
  ]])
531
- }, ne(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
547
+ }, le(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
532
548
  ])
533
549
  ], 2));
534
550
  }
535
551
  });
536
552
  const {
537
- entries: cs,
538
- setPrototypeOf: Nn,
553
+ entries: us,
554
+ setPrototypeOf: Un,
539
555
  isFrozen: Qs,
540
556
  getPrototypeOf: Js,
541
- getOwnPropertyDescriptor: er
557
+ getOwnPropertyDescriptor: ei
542
558
  } = Object;
543
559
  let {
544
- freeze: Q,
545
- seal: le,
560
+ freeze: se,
561
+ seal: ce,
546
562
  create: Ge
547
563
  } = Object, {
548
- apply: Qt,
549
- construct: Jt
564
+ apply: en,
565
+ construct: tn
550
566
  } = typeof Reflect < "u" && Reflect;
551
- Q || (Q = /* @__PURE__ */ p(function(t) {
567
+ se || (se = /* @__PURE__ */ p(function(t) {
552
568
  return t;
553
569
  }, "freeze"));
554
- le || (le = /* @__PURE__ */ p(function(t) {
570
+ ce || (ce = /* @__PURE__ */ p(function(t) {
555
571
  return t;
556
572
  }, "seal"));
557
- Qt || (Qt = /* @__PURE__ */ p(function(t, e) {
558
- for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
559
- r[s - 2] = arguments[s];
560
- return t.apply(e, r);
573
+ en || (en = /* @__PURE__ */ p(function(t, e) {
574
+ for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
575
+ i[s - 2] = arguments[s];
576
+ return t.apply(e, i);
561
577
  }, "apply"));
562
- Jt || (Jt = /* @__PURE__ */ p(function(t) {
563
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
564
- n[r - 1] = arguments[r];
578
+ tn || (tn = /* @__PURE__ */ p(function(t) {
579
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
580
+ n[i - 1] = arguments[i];
565
581
  return new t(...n);
566
582
  }, "construct"));
567
- const st = j(Array.prototype.forEach), tr = j(Array.prototype.lastIndexOf), $n = j(Array.prototype.pop), rt = j(Array.prototype.push), nr = j(Array.prototype.splice), K = Array.isArray, ct = j(String.prototype.toLowerCase), qt = j(String.prototype.toString), Un = j(String.prototype.match), He = j(String.prototype.replace), Bn = j(String.prototype.indexOf), sr = j(String.prototype.trim), rr = j(Number.prototype.toString), ir = j(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), $ = j(Object.prototype.hasOwnProperty), it = j(Object.prototype.toString), V = j(RegExp.prototype.test), kt = ar(TypeError);
583
+ const st = j(Array.prototype.forEach), ti = j(Array.prototype.lastIndexOf), Bn = j(Array.prototype.pop), it = j(Array.prototype.push), ni = j(Array.prototype.splice), ne = Array.isArray, ct = j(String.prototype.toLowerCase), Vt = j(String.prototype.toString), Fn = j(String.prototype.match), He = j(String.prototype.replace), Hn = j(String.prototype.indexOf), si = j(String.prototype.trim), ii = j(Number.prototype.toString), ri = j(Boolean.prototype.toString), Gn = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), jn = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), $ = j(Object.prototype.hasOwnProperty), rt = j(Object.prototype.toString), K = j(RegExp.prototype.test), vt = ai(TypeError);
568
584
  function j(a) {
569
585
  return function(t) {
570
586
  t instanceof RegExp && (t.lastIndex = 0);
571
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
572
- n[r - 1] = arguments[r];
573
- return Qt(a, t, n);
587
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
588
+ n[i - 1] = arguments[i];
589
+ return en(a, t, n);
574
590
  };
575
591
  }
576
592
  p(j, "unapply");
577
- function ar(a) {
593
+ function ai(a) {
578
594
  return function() {
579
595
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
580
596
  e[n] = arguments[n];
581
- return Jt(a, e);
597
+ return tn(a, e);
582
598
  };
583
599
  }
584
- p(ar, "unconstruct");
600
+ p(ai, "unconstruct");
585
601
  function R(a, t) {
586
602
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct;
587
- if (Nn && Nn(a, null), !K(t))
603
+ if (Un && Un(a, null), !ne(t))
588
604
  return a;
589
605
  let n = t.length;
590
606
  for (; n--; ) {
591
- let r = t[n];
592
- if (typeof r == "string") {
593
- const s = e(r);
594
- s !== r && (Qs(t) || (t[n] = s), r = s);
607
+ let i = t[n];
608
+ if (typeof i == "string") {
609
+ const s = e(i);
610
+ s !== i && (Qs(t) || (t[n] = s), i = s);
595
611
  }
596
- a[r] = !0;
612
+ a[i] = !0;
597
613
  }
598
614
  return a;
599
615
  }
600
616
  p(R, "addToSet");
601
- function lr(a) {
617
+ function li(a) {
602
618
  for (let t = 0; t < a.length; t++)
603
619
  $(a, t) || (a[t] = null);
604
620
  return a;
605
621
  }
606
- p(lr, "cleanArray");
607
- function ee(a) {
622
+ p(li, "cleanArray");
623
+ function ae(a) {
608
624
  const t = Ge(null);
609
- for (const [e, n] of cs(a))
610
- $(a, e) && (K(n) ? t[e] = lr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ee(n) : t[e] = n);
625
+ for (const [e, n] of us(a))
626
+ $(a, e) && (ne(n) ? t[e] = li(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ae(n) : t[e] = n);
611
627
  return t;
612
628
  }
613
- p(ee, "clone");
614
- function or(a) {
629
+ p(ae, "clone");
630
+ function oi(a) {
615
631
  switch (typeof a) {
616
632
  case "string":
617
633
  return a;
618
634
  case "number":
619
- return rr(a);
635
+ return ii(a);
620
636
  case "boolean":
621
- return ir(a);
637
+ return ri(a);
622
638
  case "bigint":
623
- return Fn ? Fn(a) : "0";
639
+ return Gn ? Gn(a) : "0";
624
640
  case "symbol":
625
- return Hn ? Hn(a) : "Symbol()";
641
+ return jn ? jn(a) : "Symbol()";
626
642
  case "undefined":
627
- return it(a);
643
+ return rt(a);
628
644
  case "function":
629
645
  case "object": {
630
646
  if (a === null)
631
- return it(a);
647
+ return rt(a);
632
648
  const t = a, e = je(t, "toString");
633
649
  if (typeof e == "function") {
634
650
  const n = e(t);
635
- return typeof n == "string" ? n : it(n);
651
+ return typeof n == "string" ? n : rt(n);
636
652
  }
637
- return it(a);
653
+ return rt(a);
638
654
  }
639
655
  default:
640
- return it(a);
656
+ return rt(a);
641
657
  }
642
658
  }
643
- p(or, "stringifyValue");
659
+ p(oi, "stringifyValue");
644
660
  function je(a, t) {
645
661
  for (; a !== null; ) {
646
- const n = er(a, t);
662
+ const n = ei(a, t);
647
663
  if (n) {
648
664
  if (n.get)
649
665
  return j(n.get);
@@ -658,33 +674,33 @@ function je(a, t) {
658
674
  return p(e, "fallbackValue"), e;
659
675
  }
660
676
  p(je, "lookupGetter");
661
- function cr(a) {
677
+ function ci(a) {
662
678
  try {
663
- return V(a, ""), !0;
679
+ return K(a, ""), !0;
664
680
  } catch {
665
681
  return !1;
666
682
  }
667
683
  }
668
- p(cr, "isRegex");
669
- const Gn = Q(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Vt = Q(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Yt = Q(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ur = Q(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Zt = Q(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), hr = Q(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = Q(["#text"]), Wn = Q(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Xt = Q(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = Q(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), wt = Q(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pr = le(/\{\{[\w\W]*|[\w\W]*\}\}/gm), dr = le(/<%[\w\W]*|[\w\W]*%>/gm), fr = le(/\$\{[\w\W]*/gm), gr = le(/^data-[\-\w.\u00B7-\uFFFF]+$/), mr = le(/^aria-[\-\w]+$/), us = le(
684
+ p(ci, "isRegex");
685
+ const Wn = se(["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 = se(["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 = se(["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"]), ui = se(["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 = se(["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"]), hi = se(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), qn = se(["#text"]), Vn = se(["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 = se(["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"]), Yn = se(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), wt = se(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pi = ce(/\{\{[\w\W]*|[\w\W]*\}\}/gm), di = ce(/<%[\w\W]*|[\w\W]*%>/gm), fi = ce(/\$\{[\w\W]*/gm), gi = ce(/^data-[\-\w.\u00B7-\uFFFF]+$/), mi = ce(/^aria-[\-\w]+$/), hs = ce(
670
686
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
671
687
  // eslint-disable-line no-useless-escape
672
- ), xr = le(/^(?:\w+script|data):/i), br = le(
688
+ ), xi = ce(/^(?:\w+script|data):/i), bi = ce(
673
689
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
674
690
  // eslint-disable-line no-control-regex
675
- ), hs = le(/^html$/i), kr = le(/^[a-z][.\w]*(-[.\w]+)+$/i);
676
- var Vn = /* @__PURE__ */ Object.freeze({
691
+ ), ps = ce(/^html$/i), ki = ce(/^[a-z][.\w]*(-[.\w]+)+$/i);
692
+ var Zn = /* @__PURE__ */ Object.freeze({
677
693
  __proto__: null,
678
- ARIA_ATTR: mr,
679
- ATTR_WHITESPACE: br,
680
- CUSTOM_ELEMENT: kr,
681
- DATA_ATTR: gr,
682
- DOCTYPE_NAME: hs,
683
- ERB_EXPR: dr,
684
- IS_ALLOWED_URI: us,
685
- IS_SCRIPT_OR_DATA: xr,
686
- MUSTACHE_EXPR: pr,
687
- TMPLIT_EXPR: fr
694
+ ARIA_ATTR: mi,
695
+ ATTR_WHITESPACE: bi,
696
+ CUSTOM_ELEMENT: ki,
697
+ DATA_ATTR: gi,
698
+ DOCTYPE_NAME: ps,
699
+ ERB_EXPR: di,
700
+ IS_ALLOWED_URI: hs,
701
+ IS_SCRIPT_OR_DATA: xi,
702
+ MUSTACHE_EXPR: pi,
703
+ TMPLIT_EXPR: fi
688
704
  });
689
705
  const at = {
690
706
  element: 1,
@@ -693,14 +709,14 @@ const at = {
693
709
  progressingInstruction: 7,
694
710
  comment: 8,
695
711
  document: 9
696
- }, wr = /* @__PURE__ */ p(function() {
712
+ }, vi = /* @__PURE__ */ p(function() {
697
713
  return typeof window > "u" ? null : window;
698
- }, "getGlobal"), vr = /* @__PURE__ */ p(function(t, e) {
714
+ }, "getGlobal"), wi = /* @__PURE__ */ p(function(t, e) {
699
715
  if (typeof t != "object" || typeof t.createPolicy != "function")
700
716
  return null;
701
717
  let n = null;
702
- const r = "data-tt-policy-suffix";
703
- e && e.hasAttribute(r) && (n = e.getAttribute(r));
718
+ const i = "data-tt-policy-suffix";
719
+ e && e.hasAttribute(i) && (n = e.getAttribute(i));
704
720
  const s = "dompurify" + (n ? "#" + n : "");
705
721
  try {
706
722
  return t.createPolicy(s, {
@@ -714,7 +730,7 @@ const at = {
714
730
  } catch {
715
731
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
716
732
  }
717
- }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ p(function() {
733
+ }, "_createTrustedTypesPolicy"), Xn = /* @__PURE__ */ p(function() {
718
734
  return {
719
735
  afterSanitizeAttributes: [],
720
736
  afterSanitizeElements: [],
@@ -727,57 +743,57 @@ const at = {
727
743
  uponSanitizeShadowNode: []
728
744
  };
729
745
  }, "_createHooksMap");
730
- function ps() {
731
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wr();
732
- const t = /* @__PURE__ */ p((S) => ps(S), "DOMPurify");
746
+ function ds() {
747
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : vi();
748
+ const t = /* @__PURE__ */ p((E) => ds(E), "DOMPurify");
733
749
  if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== at.document || !a.Element)
734
750
  return t.isSupported = !1, t;
735
751
  let {
736
752
  document: e
737
753
  } = a;
738
- const n = e, r = n.currentScript, {
754
+ const n = e, i = n.currentScript, {
739
755
  DocumentFragment: s,
740
756
  HTMLTemplateElement: l,
741
757
  Node: o,
742
758
  Element: d,
743
759
  NodeFilter: c,
744
- NamedNodeMap: m = a.NamedNodeMap || a.MozNamedAttrMap,
760
+ NamedNodeMap: g = a.NamedNodeMap || a.MozNamedAttrMap,
745
761
  HTMLFormElement: u,
746
- DOMParser: g,
747
- trustedTypes: x
748
- } = a, k = d.prototype, _ = je(k, "cloneNode"), z = je(k, "remove"), te = je(k, "nextSibling"), oe = je(k, "childNodes"), se = je(k, "parentNode");
762
+ DOMParser: w,
763
+ trustedTypes: v
764
+ } = a, f = d.prototype, y = je(f, "cloneNode"), C = je(f, "remove"), z = je(f, "nextSibling"), Z = je(f, "childNodes"), ie = je(f, "parentNode");
749
765
  if (typeof l == "function") {
750
- const S = e.createElement("template");
751
- S.content && S.content.ownerDocument && (e = S.content.ownerDocument);
766
+ const E = e.createElement("template");
767
+ E.content && E.content.ownerDocument && (e = E.content.ownerDocument);
752
768
  }
753
- let O, ce = "";
769
+ let N, W = "";
754
770
  const {
755
- implementation: re,
756
- createNodeIterator: ie,
757
- createDocumentFragment: Ee,
758
- getElementsByTagName: Ct
771
+ implementation: te,
772
+ createNodeIterator: fe,
773
+ createDocumentFragment: Re,
774
+ getElementsByTagName: ke
759
775
  } = e, {
760
- importNode: pt
776
+ importNode: It
761
777
  } = n;
762
- let A = Yn();
763
- t.isSupported = typeof cs == "function" && typeof se == "function" && re && re.createHTMLDocument !== void 0;
778
+ let V = Xn();
779
+ t.isSupported = typeof us == "function" && typeof ie == "function" && te && te.createHTMLDocument !== void 0;
764
780
  const {
765
- MUSTACHE_EXPR: _e,
766
- ERB_EXPR: we,
767
- TMPLIT_EXPR: Oe,
768
- DATA_ATTR: Ke,
769
- ARIA_ATTR: It,
770
- IS_SCRIPT_OR_DATA: Dt,
771
- ATTR_WHITESPACE: dt,
772
- CUSTOM_ELEMENT: Mt
773
- } = Vn;
781
+ MUSTACHE_EXPR: I,
782
+ ERB_EXPR: Ce,
783
+ TMPLIT_EXPR: ye,
784
+ DATA_ATTR: Dt,
785
+ ARIA_ATTR: Ke,
786
+ IS_SCRIPT_OR_DATA: Mt,
787
+ ATTR_WHITESPACE: pt,
788
+ CUSTOM_ELEMENT: Lt
789
+ } = Zn;
774
790
  let {
775
- IS_ALLOWED_URI: ft
776
- } = Vn, F = null;
777
- const Qe = R({}, [...Gn, ...Vt, ...Yt, ...Zt, ...jn]);
791
+ IS_ALLOWED_URI: dt
792
+ } = Zn, F = null;
793
+ const ft = R({}, [...Wn, ...Yt, ...Zt, ...Xt, ...qn]);
778
794
  let H = null;
779
- const C = R({}, [...Wn, ...Xt, ...qn, ...wt]);
780
- let f = Object.seal(Ge(null, {
795
+ const Qe = R({}, [...Vn, ...Kt, ...Yn, ...wt]);
796
+ let k = Object.seal(Ge(null, {
781
797
  tagNameCheck: {
782
798
  writable: !0,
783
799
  configurable: !1,
@@ -796,8 +812,8 @@ function ps() {
796
812
  enumerable: !0,
797
813
  value: !1
798
814
  }
799
- })), w = null, M = null;
800
- const N = Object.seal(Ge(null, {
815
+ })), m = null, x = null;
816
+ const M = Object.seal(Ge(null, {
801
817
  tagCheck: {
802
818
  writable: !0,
803
819
  configurable: !1,
@@ -811,171 +827,171 @@ function ps() {
811
827
  value: null
812
828
  }
813
829
  }));
814
- let xe = !0, ze = !0, Pe = !1, dn = !0, Re = !1, Je = !0, Ce = !1, Lt = !1, Ot = !1, Ne = !1, gt = !1, mt = !1, fn = !0, gn = !1;
815
- const mn = "user-content-";
816
- let zt = !0, et = !1, $e = {}, fe = null;
817
- const Pt = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
818
- let xn = null;
819
- const bn = R({}, ["audio", "video", "img", "source", "image", "track"]);
820
- let Nt = null;
821
- const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), xt = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", ge = "http://www.w3.org/1999/xhtml";
822
- let Ue = ge, $t = !1, Ut = null;
823
- const Ts = R({}, [xt, bt, ge], qt);
824
- let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = R({}, ["annotation-xml"]);
825
- const Ss = R({}, ["title", "style", "font", "a", "script"]);
826
- let tt = null;
827
- const As = ["application/xhtml+xml", "text/html"], Es = "text/html";
828
- let W = null, Be = null;
829
- const _s = e.createElement("form"), wn = /* @__PURE__ */ p(function(i) {
830
- return i instanceof RegExp || i instanceof Function;
831
- }, "isRegexOrFunction"), Ht = /* @__PURE__ */ p(function() {
832
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
833
- if (Be && Be === i)
830
+ let X = !0, ge = !0, Je = !1, Ne = !0, Ie = !1, et = !0, De = !1, Ot = !1, zt = !1, $e = !1, gt = !1, mt = !1, gn = !0, mn = !1;
831
+ const xn = "user-content-";
832
+ let Pt = !0, tt = !1, Ue = {}, me = null;
833
+ const Nt = 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"]);
834
+ let bn = null;
835
+ const kn = R({}, ["audio", "video", "img", "source", "image", "track"]);
836
+ let $t = null;
837
+ const vn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), xt = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml";
838
+ let Be = xe, Ut = !1, Bt = null;
839
+ const Ss = R({}, [xt, bt, xe], Vt);
840
+ let Ft = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ht = R({}, ["annotation-xml"]);
841
+ const As = R({}, ["title", "style", "font", "a", "script"]);
842
+ let nt = null;
843
+ const Es = ["application/xhtml+xml", "text/html"], _s = "text/html";
844
+ let q = null, Fe = null;
845
+ const Rs = e.createElement("form"), wn = /* @__PURE__ */ p(function(r) {
846
+ return r instanceof RegExp || r instanceof Function;
847
+ }, "isRegexOrFunction"), Gt = /* @__PURE__ */ p(function() {
848
+ let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
849
+ if (Fe && Fe === r)
834
850
  return;
835
- (!i || typeof i != "object") && (i = {}), i = ee(i), tt = // eslint-disable-next-line unicorn/prefer-includes
836
- As.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Es : i.PARSER_MEDIA_TYPE, W = tt === "application/xhtml+xml" ? qt : ct, F = $(i, "ALLOWED_TAGS") && K(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, W) : Qe, H = $(i, "ALLOWED_ATTR") && K(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, W) : C, Ut = $(i, "ALLOWED_NAMESPACES") && K(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : Ts, Nt = $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) ? R(ee(kn), i.ADD_URI_SAFE_ATTR, W) : kn, xn = $(i, "ADD_DATA_URI_TAGS") && K(i.ADD_DATA_URI_TAGS) ? R(ee(bn), i.ADD_DATA_URI_TAGS, W) : bn, fe = $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, W) : Pt, w = $(i, "FORBID_TAGS") && K(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, W) : ee({}), M = $(i, "FORBID_ATTR") && K(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, W) : ee({}), $e = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? ee(i.USE_PROFILES) : i.USE_PROFILES : !1, xe = i.ALLOW_ARIA_ATTR !== !1, ze = i.ALLOW_DATA_ATTR !== !1, Pe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Re = i.SAFE_FOR_TEMPLATES || !1, Je = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, Ne = i.RETURN_DOM || !1, gt = i.RETURN_DOM_FRAGMENT || !1, mt = i.RETURN_TRUSTED_TYPE || !1, Ot = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, zt = i.KEEP_CONTENT !== !1, et = i.IN_PLACE || !1, ft = cr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : us, Ue = typeof i.NAMESPACE == "string" ? i.NAMESPACE : ge, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ee(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ft = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? ee(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
837
- const h = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? ee(i.CUSTOM_ELEMENT_HANDLING) : Ge(null);
838
- if (f = Ge(null), $(h, "tagNameCheck") && wn(h.tagNameCheck) && (f.tagNameCheck = h.tagNameCheck), $(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (f.attributeNameCheck = h.attributeNameCheck), $(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Re && (ze = !1), gt && (Ne = !0), $e && (F = R({}, jn), H = Ge(null), $e.html === !0 && (R(F, Gn), R(H, Wn)), $e.svg === !0 && (R(F, Vt), R(H, Xt), R(H, wt)), $e.svgFilters === !0 && (R(F, Yt), R(H, Xt), R(H, wt)), $e.mathMl === !0 && (R(F, Zt), R(H, qn), R(H, wt))), N.tagCheck = null, N.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? N.tagCheck = i.ADD_TAGS : K(i.ADD_TAGS) && (F === Qe && (F = ee(F)), R(F, i.ADD_TAGS, W))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? N.attributeCheck = i.ADD_ATTR : K(i.ADD_ATTR) && (H === C && (H = ee(H)), R(H, i.ADD_ATTR, W))), $(i, "ADD_URI_SAFE_ATTR") && K(i.ADD_URI_SAFE_ATTR) && R(Nt, i.ADD_URI_SAFE_ATTR, W), $(i, "FORBID_CONTENTS") && K(i.FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.FORBID_CONTENTS, W)), $(i, "ADD_FORBID_CONTENTS") && K(i.ADD_FORBID_CONTENTS) && (fe === Pt && (fe = ee(fe)), R(fe, i.ADD_FORBID_CONTENTS, W)), zt && (F["#text"] = !0), Ce && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete w.tbody), i.TRUSTED_TYPES_POLICY) {
839
- if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
840
- throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
841
- if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
842
- throw kt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
843
- O = i.TRUSTED_TYPES_POLICY, ce = O.createHTML("");
851
+ (!r || typeof r != "object") && (r = {}), r = ae(r), nt = // eslint-disable-next-line unicorn/prefer-includes
852
+ Es.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? _s : r.PARSER_MEDIA_TYPE, q = nt === "application/xhtml+xml" ? Vt : ct, F = $(r, "ALLOWED_TAGS") && ne(r.ALLOWED_TAGS) ? R({}, r.ALLOWED_TAGS, q) : ft, H = $(r, "ALLOWED_ATTR") && ne(r.ALLOWED_ATTR) ? R({}, r.ALLOWED_ATTR, q) : Qe, Bt = $(r, "ALLOWED_NAMESPACES") && ne(r.ALLOWED_NAMESPACES) ? R({}, r.ALLOWED_NAMESPACES, Vt) : Ss, $t = $(r, "ADD_URI_SAFE_ATTR") && ne(r.ADD_URI_SAFE_ATTR) ? R(ae(vn), r.ADD_URI_SAFE_ATTR, q) : vn, bn = $(r, "ADD_DATA_URI_TAGS") && ne(r.ADD_DATA_URI_TAGS) ? R(ae(kn), r.ADD_DATA_URI_TAGS, q) : kn, me = $(r, "FORBID_CONTENTS") && ne(r.FORBID_CONTENTS) ? R({}, r.FORBID_CONTENTS, q) : Nt, m = $(r, "FORBID_TAGS") && ne(r.FORBID_TAGS) ? R({}, r.FORBID_TAGS, q) : ae({}), x = $(r, "FORBID_ATTR") && ne(r.FORBID_ATTR) ? R({}, r.FORBID_ATTR, q) : ae({}), Ue = $(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? ae(r.USE_PROFILES) : r.USE_PROFILES : !1, X = r.ALLOW_ARIA_ATTR !== !1, ge = r.ALLOW_DATA_ATTR !== !1, Je = r.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ie = r.SAFE_FOR_TEMPLATES || !1, et = r.SAFE_FOR_XML !== !1, De = r.WHOLE_DOCUMENT || !1, $e = r.RETURN_DOM || !1, gt = r.RETURN_DOM_FRAGMENT || !1, mt = r.RETURN_TRUSTED_TYPE || !1, zt = r.FORCE_BODY || !1, gn = r.SANITIZE_DOM !== !1, mn = r.SANITIZE_NAMED_PROPS || !1, Pt = r.KEEP_CONTENT !== !1, tt = r.IN_PLACE || !1, dt = ci(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : hs, Be = typeof r.NAMESPACE == "string" ? r.NAMESPACE : xe, Ft = $(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ae(r.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ht = $(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? ae(r.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
853
+ const h = $(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? ae(r.CUSTOM_ELEMENT_HANDLING) : Ge(null);
854
+ if (k = Ge(null), $(h, "tagNameCheck") && wn(h.tagNameCheck) && (k.tagNameCheck = h.tagNameCheck), $(h, "attributeNameCheck") && wn(h.attributeNameCheck) && (k.attributeNameCheck = h.attributeNameCheck), $(h, "allowCustomizedBuiltInElements") && typeof h.allowCustomizedBuiltInElements == "boolean" && (k.allowCustomizedBuiltInElements = h.allowCustomizedBuiltInElements), Ie && (ge = !1), gt && ($e = !0), Ue && (F = R({}, qn), H = Ge(null), Ue.html === !0 && (R(F, Wn), R(H, Vn)), Ue.svg === !0 && (R(F, Yt), R(H, Kt), R(H, wt)), Ue.svgFilters === !0 && (R(F, Zt), R(H, Kt), R(H, wt)), Ue.mathMl === !0 && (R(F, Xt), R(H, Yn), R(H, wt))), M.tagCheck = null, M.attributeCheck = null, $(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? M.tagCheck = r.ADD_TAGS : ne(r.ADD_TAGS) && (F === ft && (F = ae(F)), R(F, r.ADD_TAGS, q))), $(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? M.attributeCheck = r.ADD_ATTR : ne(r.ADD_ATTR) && (H === Qe && (H = ae(H)), R(H, r.ADD_ATTR, q))), $(r, "ADD_URI_SAFE_ATTR") && ne(r.ADD_URI_SAFE_ATTR) && R($t, r.ADD_URI_SAFE_ATTR, q), $(r, "FORBID_CONTENTS") && ne(r.FORBID_CONTENTS) && (me === Nt && (me = ae(me)), R(me, r.FORBID_CONTENTS, q)), $(r, "ADD_FORBID_CONTENTS") && ne(r.ADD_FORBID_CONTENTS) && (me === Nt && (me = ae(me)), R(me, r.ADD_FORBID_CONTENTS, q)), Pt && (F["#text"] = !0), De && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete m.tbody), r.TRUSTED_TYPES_POLICY) {
855
+ if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
856
+ throw vt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
857
+ if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
858
+ throw vt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
859
+ N = r.TRUSTED_TYPES_POLICY, W = N.createHTML("");
844
860
  } else
845
- O === void 0 && (O = vr(x, r)), O !== null && typeof ce == "string" && (ce = O.createHTML(""));
846
- Q && Q(i), Be = i;
847
- }, "_parseConfig"), vn = R({}, [...Vt, ...Yt, ...ur]), yn = R({}, [...Zt, ...hr]), Rs = /* @__PURE__ */ p(function(i) {
848
- let h = se(i);
861
+ N === void 0 && (N = wi(v, i)), N !== null && typeof W == "string" && (W = N.createHTML(""));
862
+ se && se(r), Fe = r;
863
+ }, "_parseConfig"), yn = R({}, [...Yt, ...Zt, ...ui]), Tn = R({}, [...Xt, ...hi]), Cs = /* @__PURE__ */ p(function(r) {
864
+ let h = ie(r);
849
865
  (!h || !h.tagName) && (h = {
850
- namespaceURI: Ue,
866
+ namespaceURI: Be,
851
867
  tagName: "template"
852
868
  });
853
- const b = ct(i.tagName), P = ct(h.tagName);
854
- return Ut[i.namespaceURI] ? i.namespaceURI === bt ? h.namespaceURI === ge ? b === "svg" : h.namespaceURI === xt ? b === "svg" && (P === "annotation-xml" || Bt[P]) : !!vn[b] : i.namespaceURI === xt ? h.namespaceURI === ge ? b === "math" : h.namespaceURI === bt ? b === "math" && Ft[P] : !!yn[b] : i.namespaceURI === ge ? h.namespaceURI === bt && !Ft[P] || h.namespaceURI === xt && !Bt[P] ? !1 : !yn[b] && (Ss[b] || !vn[b]) : !!(tt === "application/xhtml+xml" && Ut[i.namespaceURI]) : !1;
855
- }, "_checkValidNamespace"), ue = /* @__PURE__ */ p(function(i) {
856
- rt(t.removed, {
857
- element: i
869
+ const b = ct(r.tagName), P = ct(h.tagName);
870
+ return Bt[r.namespaceURI] ? r.namespaceURI === bt ? h.namespaceURI === xe ? b === "svg" : h.namespaceURI === xt ? b === "svg" && (P === "annotation-xml" || Ft[P]) : !!yn[b] : r.namespaceURI === xt ? h.namespaceURI === xe ? b === "math" : h.namespaceURI === bt ? b === "math" && Ht[P] : !!Tn[b] : r.namespaceURI === xe ? h.namespaceURI === bt && !Ht[P] || h.namespaceURI === xt && !Ft[P] ? !1 : !Tn[b] && (As[b] || !yn[b]) : !!(nt === "application/xhtml+xml" && Bt[r.namespaceURI]) : !1;
871
+ }, "_checkValidNamespace"), ue = /* @__PURE__ */ p(function(r) {
872
+ it(t.removed, {
873
+ element: r
858
874
  });
859
875
  try {
860
- se(i).removeChild(i);
876
+ ie(r).removeChild(r);
861
877
  } catch {
862
- z(i);
878
+ C(r);
863
879
  }
864
- }, "_forceRemove"), Ie = /* @__PURE__ */ p(function(i, h) {
880
+ }, "_forceRemove"), Me = /* @__PURE__ */ p(function(r, h) {
865
881
  try {
866
- rt(t.removed, {
867
- attribute: h.getAttributeNode(i),
882
+ it(t.removed, {
883
+ attribute: h.getAttributeNode(r),
868
884
  from: h
869
885
  });
870
886
  } catch {
871
- rt(t.removed, {
887
+ it(t.removed, {
872
888
  attribute: null,
873
889
  from: h
874
890
  });
875
891
  }
876
- if (h.removeAttribute(i), i === "is")
877
- if (Ne || gt)
892
+ if (h.removeAttribute(r), r === "is")
893
+ if ($e || gt)
878
894
  try {
879
895
  ue(h);
880
896
  } catch {
881
897
  }
882
898
  else
883
899
  try {
884
- h.setAttribute(i, "");
900
+ h.setAttribute(r, "");
885
901
  } catch {
886
902
  }
887
- }, "_removeAttribute"), Tn = /* @__PURE__ */ p(function(i) {
903
+ }, "_removeAttribute"), Sn = /* @__PURE__ */ p(function(r) {
888
904
  let h = null, b = null;
889
- if (Ot)
890
- i = "<remove></remove>" + i;
905
+ if (zt)
906
+ r = "<remove></remove>" + r;
891
907
  else {
892
- const G = Un(i, /^[\r\n\t ]+/);
908
+ const G = Fn(r, /^[\r\n\t ]+/);
893
909
  b = G && G[0];
894
910
  }
895
- tt === "application/xhtml+xml" && Ue === ge && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
896
- const P = O ? O.createHTML(i) : i;
897
- if (Ue === ge)
911
+ nt === "application/xhtml+xml" && Be === xe && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
912
+ const P = N ? N.createHTML(r) : r;
913
+ if (Be === xe)
898
914
  try {
899
- h = new g().parseFromString(P, tt);
915
+ h = new w().parseFromString(P, nt);
900
916
  } catch {
901
917
  }
902
918
  if (!h || !h.documentElement) {
903
- h = re.createDocument(Ue, "template", null);
919
+ h = te.createDocument(Be, "template", null);
904
920
  try {
905
- h.documentElement.innerHTML = $t ? ce : P;
921
+ h.documentElement.innerHTML = Ut ? W : P;
906
922
  } catch {
907
923
  }
908
924
  }
909
- const Z = h.body || h.documentElement;
910
- return i && b && Z.insertBefore(e.createTextNode(b), Z.childNodes[0] || null), Ue === ge ? Ct.call(h, Ce ? "html" : "body")[0] : Ce ? h.documentElement : Z;
911
- }, "_initDocument"), Sn = /* @__PURE__ */ p(function(i) {
912
- return ie.call(
913
- i.ownerDocument || i,
914
- i,
925
+ const J = h.body || h.documentElement;
926
+ return r && b && J.insertBefore(e.createTextNode(b), J.childNodes[0] || null), Be === xe ? ke.call(h, De ? "html" : "body")[0] : De ? h.documentElement : J;
927
+ }, "_initDocument"), An = /* @__PURE__ */ p(function(r) {
928
+ return fe.call(
929
+ r.ownerDocument || r,
930
+ r,
915
931
  // eslint-disable-next-line no-bitwise
916
932
  c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
917
933
  null
918
934
  );
919
- }, "_createNodeIterator"), Gt = /* @__PURE__ */ p(function(i) {
920
- return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof m) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
921
- }, "_isClobbered"), jt = /* @__PURE__ */ p(function(i) {
922
- return typeof o == "function" && i instanceof o;
935
+ }, "_createNodeIterator"), jt = /* @__PURE__ */ p(function(r) {
936
+ return r instanceof u && (typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || !(r.attributes instanceof g) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function");
937
+ }, "_isClobbered"), Wt = /* @__PURE__ */ p(function(r) {
938
+ return typeof o == "function" && r instanceof o;
923
939
  }, "_isNode");
924
- function be(S, i, h) {
925
- st(S, (b) => {
926
- b.call(t, i, h, Be);
940
+ function ve(E, r, h) {
941
+ st(E, (b) => {
942
+ b.call(t, r, h, Fe);
927
943
  });
928
944
  }
929
- p(be, "_executeHooks");
930
- const An = /* @__PURE__ */ p(function(i) {
945
+ p(ve, "_executeHooks");
946
+ const En = /* @__PURE__ */ p(function(r) {
931
947
  let h = null;
932
- if (be(A.beforeSanitizeElements, i, null), Gt(i))
933
- return ue(i), !0;
934
- const b = W(i.nodeName);
935
- if (be(A.uponSanitizeElement, i, {
948
+ if (ve(V.beforeSanitizeElements, r, null), jt(r))
949
+ return ue(r), !0;
950
+ const b = q(r.nodeName);
951
+ if (ve(V.uponSanitizeElement, r, {
936
952
  tagName: b,
937
953
  allowedTags: F
938
- }), Je && i.hasChildNodes() && !jt(i.firstElementChild) && V(/<[/\w!]/g, i.innerHTML) && V(/<[/\w!]/g, i.textContent) || Je && i.namespaceURI === ge && b === "style" && jt(i.firstElementChild) || i.nodeType === at.progressingInstruction || Je && i.nodeType === at.comment && V(/<[/\w]/g, i.data))
939
- return ue(i), !0;
940
- if (w[b] || !(N.tagCheck instanceof Function && N.tagCheck(b)) && !F[b]) {
941
- if (!w[b] && _n(b) && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, b) || f.tagNameCheck instanceof Function && f.tagNameCheck(b)))
954
+ }), et && r.hasChildNodes() && !Wt(r.firstElementChild) && K(/<[/\w!]/g, r.innerHTML) && K(/<[/\w!]/g, r.textContent) || et && r.namespaceURI === xe && b === "style" && Wt(r.firstElementChild) || r.nodeType === at.progressingInstruction || et && r.nodeType === at.comment && K(/<[/\w]/g, r.data))
955
+ return ue(r), !0;
956
+ if (m[b] || !(M.tagCheck instanceof Function && M.tagCheck(b)) && !F[b]) {
957
+ if (!m[b] && Rn(b) && (k.tagNameCheck instanceof RegExp && K(k.tagNameCheck, b) || k.tagNameCheck instanceof Function && k.tagNameCheck(b)))
942
958
  return !1;
943
- if (zt && !fe[b]) {
944
- const P = se(i) || i.parentNode, Z = oe(i) || i.childNodes;
945
- if (Z && P) {
946
- const G = Z.length;
947
- for (let J = G - 1; J >= 0; --J) {
948
- const ae = _(Z[J], !0);
949
- P.insertBefore(ae, te(i));
959
+ if (Pt && !me[b]) {
960
+ const P = ie(r) || r.parentNode, J = Z(r) || r.childNodes;
961
+ if (J && P) {
962
+ const G = J.length;
963
+ for (let re = G - 1; re >= 0; --re) {
964
+ const oe = y(J[re], !0);
965
+ P.insertBefore(oe, z(r));
950
966
  }
951
967
  }
952
968
  }
953
- return ue(i), !0;
969
+ return ue(r), !0;
954
970
  }
955
- return i instanceof d && !Rs(i) || (b === "noscript" || b === "noembed" || b === "noframes") && V(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ue(i), !0) : (Re && i.nodeType === at.text && (h = i.textContent, st([_e, we, Oe], (P) => {
971
+ return r instanceof d && !Cs(r) || (b === "noscript" || b === "noembed" || b === "noframes") && K(/<\/no(script|embed|frames)/i, r.innerHTML) ? (ue(r), !0) : (Ie && r.nodeType === at.text && (h = r.textContent, st([I, Ce, ye], (P) => {
956
972
  h = He(h, P, " ");
957
- }), i.textContent !== h && (rt(t.removed, {
958
- element: i.cloneNode()
959
- }), i.textContent = h)), be(A.afterSanitizeElements, i, null), !1);
960
- }, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, h, b) {
961
- if (M[h] || fn && (h === "id" || h === "name") && (b in e || b in _s))
973
+ }), r.textContent !== h && (it(t.removed, {
974
+ element: r.cloneNode()
975
+ }), r.textContent = h)), ve(V.afterSanitizeElements, r, null), !1);
976
+ }, "_sanitizeElements"), _n = /* @__PURE__ */ p(function(r, h, b) {
977
+ if (x[h] || gn && (h === "id" || h === "name") && (b in e || b in Rs))
962
978
  return !1;
963
- if (!(ze && !M[h] && V(Ke, h))) {
964
- if (!(xe && V(It, h))) {
965
- if (!(N.attributeCheck instanceof Function && N.attributeCheck(h, i))) {
966
- if (!H[h] || M[h]) {
979
+ if (!(ge && !x[h] && K(Dt, h))) {
980
+ if (!(X && K(Ke, h))) {
981
+ if (!(M.attributeCheck instanceof Function && M.attributeCheck(h, r))) {
982
+ if (!H[h] || x[h]) {
967
983
  if (
968
984
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
969
985
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
970
986
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
971
- !(_n(i) && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, i) || f.tagNameCheck instanceof Function && f.tagNameCheck(i)) && (f.attributeNameCheck instanceof RegExp && V(f.attributeNameCheck, h) || f.attributeNameCheck instanceof Function && f.attributeNameCheck(h, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
987
+ !(Rn(r) && (k.tagNameCheck instanceof RegExp && K(k.tagNameCheck, r) || k.tagNameCheck instanceof Function && k.tagNameCheck(r)) && (k.attributeNameCheck instanceof RegExp && K(k.attributeNameCheck, h) || k.attributeNameCheck instanceof Function && k.attributeNameCheck(h, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
972
988
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
973
- h === "is" && f.allowCustomizedBuiltInElements && (f.tagNameCheck instanceof RegExp && V(f.tagNameCheck, b) || f.tagNameCheck instanceof Function && f.tagNameCheck(b)))
989
+ h === "is" && k.allowCustomizedBuiltInElements && (k.tagNameCheck instanceof RegExp && K(k.tagNameCheck, b) || k.tagNameCheck instanceof Function && k.tagNameCheck(b)))
974
990
  ) return !1;
975
- } else if (!Nt[h]) {
976
- if (!V(ft, He(b, dt, ""))) {
977
- if (!((h === "src" || h === "xlink:href" || h === "href") && i !== "script" && Bn(b, "data:") === 0 && xn[i])) {
978
- if (!(Pe && !V(Dt, He(b, dt, "")))) {
991
+ } else if (!$t[h]) {
992
+ if (!K(dt, He(b, pt, ""))) {
993
+ if (!((h === "src" || h === "xlink:href" || h === "href") && r !== "script" && Hn(b, "data:") === 0 && bn[r])) {
994
+ if (!(Je && !K(Mt, He(b, pt, "")))) {
979
995
  if (b)
980
996
  return !1;
981
997
  }
@@ -986,14 +1002,14 @@ function ps() {
986
1002
  }
987
1003
  }
988
1004
  return !0;
989
- }, "_isValidAttribute"), Cs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ p(function(i) {
990
- return !Cs[ct(i)] && V(Mt, i);
991
- }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ p(function(i) {
992
- be(A.beforeSanitizeAttributes, i, null);
1005
+ }, "_isValidAttribute"), Is = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Rn = /* @__PURE__ */ p(function(r) {
1006
+ return !Is[ct(r)] && K(Lt, r);
1007
+ }, "_isBasicCustomElement"), Cn = /* @__PURE__ */ p(function(r) {
1008
+ ve(V.beforeSanitizeAttributes, r, null);
993
1009
  const {
994
1010
  attributes: h
995
- } = i;
996
- if (!h || Gt(i))
1011
+ } = r;
1012
+ if (!h || jt(r))
997
1013
  return;
998
1014
  const b = {
999
1015
  attrName: "",
@@ -1004,209 +1020,209 @@ function ps() {
1004
1020
  };
1005
1021
  let P = h.length;
1006
1022
  for (; P--; ) {
1007
- const Z = h[P], {
1023
+ const J = h[P], {
1008
1024
  name: G,
1009
- namespaceURI: J,
1010
- value: ae
1011
- } = Z, he = W(G), Wt = ae;
1012
- let q = G === "value" ? Wt : sr(Wt);
1013
- if (b.attrName = he, b.attrValue = q, b.keepAttr = !0, b.forceKeepAttr = void 0, be(A.uponSanitizeAttribute, i, b), q = b.attrValue, gn && (he === "id" || he === "name") && Bn(q, mn) !== 0 && (Ie(G, i), q = mn + q), Je && V(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, q)) {
1014
- Ie(G, i);
1025
+ namespaceURI: re,
1026
+ value: oe
1027
+ } = J, he = q(G), qt = oe;
1028
+ let Y = G === "value" ? qt : si(qt);
1029
+ if (b.attrName = he, b.attrValue = Y, b.keepAttr = !0, b.forceKeepAttr = void 0, ve(V.uponSanitizeAttribute, r, b), Y = b.attrValue, mn && (he === "id" || he === "name") && Hn(Y, xn) !== 0 && (Me(G, r), Y = xn + Y), et && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, Y)) {
1030
+ Me(G, r);
1015
1031
  continue;
1016
1032
  }
1017
- if (he === "attributename" && Un(q, "href")) {
1018
- Ie(G, i);
1033
+ if (he === "attributename" && Fn(Y, "href")) {
1034
+ Me(G, r);
1019
1035
  continue;
1020
1036
  }
1021
1037
  if (b.forceKeepAttr)
1022
1038
  continue;
1023
1039
  if (!b.keepAttr) {
1024
- Ie(G, i);
1040
+ Me(G, r);
1025
1041
  continue;
1026
1042
  }
1027
- if (!dn && V(/\/>/i, q)) {
1028
- Ie(G, i);
1043
+ if (!Ne && K(/\/>/i, Y)) {
1044
+ Me(G, r);
1029
1045
  continue;
1030
1046
  }
1031
- Re && st([_e, we, Oe], (Dn) => {
1032
- q = He(q, Dn, " ");
1047
+ Ie && st([I, Ce, ye], (Mn) => {
1048
+ Y = He(Y, Mn, " ");
1033
1049
  });
1034
- const In = W(i.nodeName);
1035
- if (!En(In, he, q)) {
1036
- Ie(G, i);
1050
+ const Dn = q(r.nodeName);
1051
+ if (!_n(Dn, he, Y)) {
1052
+ Me(G, r);
1037
1053
  continue;
1038
1054
  }
1039
- if (O && typeof x == "object" && typeof x.getAttributeType == "function" && !J)
1040
- switch (x.getAttributeType(In, he)) {
1055
+ if (N && typeof v == "object" && typeof v.getAttributeType == "function" && !re)
1056
+ switch (v.getAttributeType(Dn, he)) {
1041
1057
  case "TrustedHTML": {
1042
- q = O.createHTML(q);
1058
+ Y = N.createHTML(Y);
1043
1059
  break;
1044
1060
  }
1045
1061
  case "TrustedScriptURL": {
1046
- q = O.createScriptURL(q);
1062
+ Y = N.createScriptURL(Y);
1047
1063
  break;
1048
1064
  }
1049
1065
  }
1050
- if (q !== Wt)
1066
+ if (Y !== qt)
1051
1067
  try {
1052
- J ? i.setAttributeNS(J, G, q) : i.setAttribute(G, q), Gt(i) ? ue(i) : $n(t.removed);
1068
+ re ? r.setAttributeNS(re, G, Y) : r.setAttribute(G, Y), jt(r) ? ue(r) : Bn(t.removed);
1053
1069
  } catch {
1054
- Ie(G, i);
1070
+ Me(G, r);
1055
1071
  }
1056
1072
  }
1057
- be(A.afterSanitizeAttributes, i, null);
1058
- }, "_sanitizeAttributes"), Cn = /* @__PURE__ */ p(function(i) {
1073
+ ve(V.afterSanitizeAttributes, r, null);
1074
+ }, "_sanitizeAttributes"), In = /* @__PURE__ */ p(function(r) {
1059
1075
  let h = null;
1060
- const b = Sn(i);
1061
- for (be(A.beforeSanitizeShadowDOM, i, null); h = b.nextNode(); )
1062
- be(A.uponSanitizeShadowNode, h, null), An(h), Rn(h), h.content instanceof s && Cn(h.content);
1063
- be(A.afterSanitizeShadowDOM, i, null);
1076
+ const b = An(r);
1077
+ for (ve(V.beforeSanitizeShadowDOM, r, null); h = b.nextNode(); )
1078
+ ve(V.uponSanitizeShadowNode, h, null), En(h), Cn(h), h.content instanceof s && In(h.content);
1079
+ ve(V.afterSanitizeShadowDOM, r, null);
1064
1080
  }, "_sanitizeShadowDOM");
1065
- return t.sanitize = function(S) {
1066
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, b = null, P = null, Z = null;
1067
- if ($t = !S, $t && (S = "<!-->"), typeof S != "string" && !jt(S) && (S = or(S), typeof S != "string"))
1068
- throw kt("dirty is not a string, aborting");
1081
+ return t.sanitize = function(E) {
1082
+ let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = null, b = null, P = null, J = null;
1083
+ if (Ut = !E, Ut && (E = "<!-->"), typeof E != "string" && !Wt(E) && (E = oi(E), typeof E != "string"))
1084
+ throw vt("dirty is not a string, aborting");
1069
1085
  if (!t.isSupported)
1070
- return S;
1071
- if (Lt || Ht(i), t.removed = [], typeof S == "string" && (et = !1), et) {
1072
- const ae = S.nodeName;
1073
- if (typeof ae == "string") {
1074
- const he = W(ae);
1075
- if (!F[he] || w[he])
1076
- throw kt("root node is forbidden and cannot be sanitized in-place");
1077
- }
1078
- } else if (S instanceof o)
1079
- h = Tn("<!---->"), b = h.ownerDocument.importNode(S, !0), b.nodeType === at.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? h = b : h.appendChild(b);
1086
+ return E;
1087
+ if (Ot || Gt(r), t.removed = [], typeof E == "string" && (tt = !1), tt) {
1088
+ const oe = E.nodeName;
1089
+ if (typeof oe == "string") {
1090
+ const he = q(oe);
1091
+ if (!F[he] || m[he])
1092
+ throw vt("root node is forbidden and cannot be sanitized in-place");
1093
+ }
1094
+ } else if (E instanceof o)
1095
+ h = Sn("<!---->"), b = h.ownerDocument.importNode(E, !0), b.nodeType === at.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? h = b : h.appendChild(b);
1080
1096
  else {
1081
- if (!Ne && !Re && !Ce && // eslint-disable-next-line unicorn/prefer-includes
1082
- S.indexOf("<") === -1)
1083
- return O && mt ? O.createHTML(S) : S;
1084
- if (h = Tn(S), !h)
1085
- return Ne ? null : mt ? ce : "";
1086
- }
1087
- h && Ot && ue(h.firstChild);
1088
- const G = Sn(et ? S : h);
1097
+ if (!$e && !Ie && !De && // eslint-disable-next-line unicorn/prefer-includes
1098
+ E.indexOf("<") === -1)
1099
+ return N && mt ? N.createHTML(E) : E;
1100
+ if (h = Sn(E), !h)
1101
+ return $e ? null : mt ? W : "";
1102
+ }
1103
+ h && zt && ue(h.firstChild);
1104
+ const G = An(tt ? E : h);
1089
1105
  for (; P = G.nextNode(); )
1090
- An(P), Rn(P), P.content instanceof s && Cn(P.content);
1091
- if (et)
1092
- return S;
1093
- if (Ne) {
1094
- if (Re) {
1106
+ En(P), Cn(P), P.content instanceof s && In(P.content);
1107
+ if (tt)
1108
+ return E;
1109
+ if ($e) {
1110
+ if (Ie) {
1095
1111
  h.normalize();
1096
- let ae = h.innerHTML;
1097
- st([_e, we, Oe], (he) => {
1098
- ae = He(ae, he, " ");
1099
- }), h.innerHTML = ae;
1112
+ let oe = h.innerHTML;
1113
+ st([I, Ce, ye], (he) => {
1114
+ oe = He(oe, he, " ");
1115
+ }), h.innerHTML = oe;
1100
1116
  }
1101
1117
  if (gt)
1102
- for (Z = Ee.call(h.ownerDocument); h.firstChild; )
1103
- Z.appendChild(h.firstChild);
1118
+ for (J = Re.call(h.ownerDocument); h.firstChild; )
1119
+ J.appendChild(h.firstChild);
1104
1120
  else
1105
- Z = h;
1106
- return (H.shadowroot || H.shadowrootmode) && (Z = pt.call(n, Z, !0)), Z;
1107
- }
1108
- let J = Ce ? h.outerHTML : h.innerHTML;
1109
- return Ce && F["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && V(hs, h.ownerDocument.doctype.name) && (J = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
1110
- ` + J), Re && st([_e, we, Oe], (ae) => {
1111
- J = He(J, ae, " ");
1112
- }), O && mt ? O.createHTML(J) : J;
1121
+ J = h;
1122
+ return (H.shadowroot || H.shadowrootmode) && (J = It.call(n, J, !0)), J;
1123
+ }
1124
+ let re = De ? h.outerHTML : h.innerHTML;
1125
+ return De && F["!doctype"] && h.ownerDocument && h.ownerDocument.doctype && h.ownerDocument.doctype.name && K(ps, h.ownerDocument.doctype.name) && (re = "<!DOCTYPE " + h.ownerDocument.doctype.name + `>
1126
+ ` + re), Ie && st([I, Ce, ye], (oe) => {
1127
+ re = He(re, oe, " ");
1128
+ }), N && mt ? N.createHTML(re) : re;
1113
1129
  }, t.setConfig = function() {
1114
- let S = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1115
- Ht(S), Lt = !0;
1130
+ let E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1131
+ Gt(E), Ot = !0;
1116
1132
  }, t.clearConfig = function() {
1117
- Be = null, Lt = !1;
1118
- }, t.isValidAttribute = function(S, i, h) {
1119
- Be || Ht({});
1120
- const b = W(S), P = W(i);
1121
- return En(b, P, h);
1122
- }, t.addHook = function(S, i) {
1123
- typeof i == "function" && rt(A[S], i);
1124
- }, t.removeHook = function(S, i) {
1125
- if (i !== void 0) {
1126
- const h = tr(A[S], i);
1127
- return h === -1 ? void 0 : nr(A[S], h, 1)[0];
1128
- }
1129
- return $n(A[S]);
1130
- }, t.removeHooks = function(S) {
1131
- A[S] = [];
1133
+ Fe = null, Ot = !1;
1134
+ }, t.isValidAttribute = function(E, r, h) {
1135
+ Fe || Gt({});
1136
+ const b = q(E), P = q(r);
1137
+ return _n(b, P, h);
1138
+ }, t.addHook = function(E, r) {
1139
+ typeof r == "function" && it(V[E], r);
1140
+ }, t.removeHook = function(E, r) {
1141
+ if (r !== void 0) {
1142
+ const h = ti(V[E], r);
1143
+ return h === -1 ? void 0 : ni(V[E], h, 1)[0];
1144
+ }
1145
+ return Bn(V[E]);
1146
+ }, t.removeHooks = function(E) {
1147
+ V[E] = [];
1132
1148
  }, t.removeAllHooks = function() {
1133
- A = Yn();
1149
+ V = Xn();
1134
1150
  }, t;
1135
1151
  }
1136
- p(ps, "createDOMPurify");
1137
- var yr = ps();
1138
- function nn() {
1152
+ p(ds, "createDOMPurify");
1153
+ var yi = ds();
1154
+ function rn() {
1139
1155
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1140
1156
  }
1141
- p(nn, "z");
1142
- var Le = nn();
1143
- function ds(a) {
1144
- Le = a;
1157
+ p(rn, "z");
1158
+ var Pe = rn();
1159
+ function fs(a) {
1160
+ Pe = a;
1145
1161
  }
1146
- p(ds, "G");
1147
- var De = { exec: /* @__PURE__ */ p(() => null, "exec") };
1148
- function D(a, t = "") {
1149
- let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((r, s) => {
1162
+ p(fs, "G");
1163
+ var Oe = { exec: /* @__PURE__ */ p(() => null, "exec") };
1164
+ function L(a, t = "") {
1165
+ let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((i, s) => {
1150
1166
  let l = typeof s == "string" ? s : s.source;
1151
- return l = l.replace(X.caret, "$1"), e = e.replace(r, l), n;
1167
+ return l = l.replace(ee.caret, "$1"), e = e.replace(i, l), n;
1152
1168
  }, "replace"), getRegex: /* @__PURE__ */ p(() => new RegExp(e, t), "getRegex") };
1153
1169
  return n;
1154
1170
  }
1155
- p(D, "k");
1156
- var Tr = ((a = "") => {
1171
+ p(L, "k");
1172
+ var Ti = ((a = "") => {
1157
1173
  try {
1158
1174
  return !!new RegExp("(?<=1)(?<!1)" + a);
1159
1175
  } catch {
1160
1176
  return !1;
1161
1177
  }
1162
- })(), X = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Sr = /^(?:[ \t]*(?:\n|$))+/, Ar = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Er = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _r = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, fs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, gs = D(fs).replace(/bull/g, sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Rr = D(fs).replace(/bull/g, sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), rn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Cr = /^[^\n]+/, an = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ir = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", an).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Dr = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, sn).getRegex(), _t = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ln = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Mr = D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ln).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ms = D(rn).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex(), Lr = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ms).getRegex(), on = { blockquote: Lr, code: Ar, def: Ir, fences: Er, heading: _r, hr: ht, html: Mr, lheading: gs, list: Dr, newline: Sr, paragraph: ms, table: De, text: Cr }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex(), Or = { ...on, lheading: Rr, table: Zn, paragraph: D(rn).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex() }, zr = { ...on, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ln).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: De, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(rn).replace("hr", ht).replace("heading", ` *#{1,6} *[^
1163
- ]`).replace("lheading", gs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Pr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Nr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, xs = /^( {2,}|\\)\n(?!\s*$)/, $r = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xe = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, cn = /[^\s\p{P}\p{S}]/u, Ur = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), bs = /(?!~)[\p{P}\p{S}]/u, Br = /(?!~)[\s\p{P}\p{S}]/u, Fr = /(?:[^\s\p{P}\p{S}]|~)/u, Hr = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Tr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ks = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Gr = D(ks, "u").replace(/punct/g, Xe).getRegex(), jr = D(ks, "u").replace(/punct/g, bs).getRegex(), ws = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Wr = D(ws, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Rt).replace(/punct/g, Xe).getRegex(), qr = D(ws, "gu").replace(/notPunctSpace/g, Fr).replace(/punctSpace/g, Br).replace(/punct/g, bs).getRegex(), Vr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Rt).replace(/punct/g, Xe).getRegex(), Yr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Xe).getRegex(), Zr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Xr = D(Zr, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Rt).replace(/punct/g, Xe).getRegex(), Kr = D(/\\(punct)/, "gu").replace(/punct/g, Xe).getRegex(), Qr = D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Jr = D(ln).replace("(?:-->|$)", "-->").getRegex(), ei = D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Jr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Tt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ti = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Tt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), vs = D(/^!?\[(label)\]\[(ref)\]/).replace("label", Tt).replace("ref", an).getRegex(), ys = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", an).getRegex(), ni = D("reflink|nolink(?!\\()", "g").replace("reflink", vs).replace("nolink", ys).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, un = { _backpedal: De, anyPunctuation: Kr, autolink: Qr, blockSkip: Hr, br: xs, code: Nr, del: De, delLDelim: De, delRDelim: De, emStrongLDelim: Gr, emStrongRDelimAst: Wr, emStrongRDelimUnd: Vr, escape: Pr, link: ti, nolink: ys, punctuation: Ur, reflink: vs, reflinkSearch: ni, tag: ei, text: $r, url: De }, si = { ...un, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", Tt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Tt).getRegex() }, en = { ...un, emStrongRDelimAst: qr, emStrongLDelim: jr, delLDelim: Yr, delRDelim: Xr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, ri = { ...en, br: D(xs).replace("{2,}", "*").getRegex(), text: D(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: on, gfm: Or, pedantic: zr }, lt = { normal: un, gfm: en, breaks: ri, pedantic: si }, ii = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ p((a) => ii[a], "de");
1164
- function me(a, t) {
1178
+ })(), ee = { 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") }, Si = /^(?:[ \t]*(?:\n|$))+/, Ai = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ei = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _i = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, an = / {0,3}(?:[*+-]|\d{1,9}[.)])/, gs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ms = L(gs).replace(/bull/g, an).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(), Ri = L(gs).replace(/bull/g, an).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(), ln = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ci = /^[^\n]+/, on = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ii = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", on).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Di = L(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, an).getRegex(), Rt = "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", cn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Mi = L("^ {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", cn).replace("tag", Rt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), xs = L(ln).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Rt).getRegex(), Li = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xs).getRegex(), un = { blockquote: Li, code: Ai, def: Ii, fences: Ei, heading: _i, hr: ht, html: Mi, lheading: ms, list: Di, newline: Si, paragraph: xs, table: Oe, text: Ci }, Kn = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Rt).getRegex(), Oi = { ...un, lheading: Ri, table: Kn, paragraph: L(ln).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Kn).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", Rt).getRegex() }, zi = { ...un, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", cn).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: Oe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(ln).replace("hr", ht).replace("heading", ` *#{1,6} *[^
1179
+ ]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Pi = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ni = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, bs = /^( {2,}|\\)\n(?!\s*$)/, $i = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xe = /[\p{P}\p{S}]/u, Ct = /[\s\p{P}\p{S}]/u, hn = /[^\s\p{P}\p{S}]/u, Ui = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Ct).getRegex(), ks = /(?!~)[\p{P}\p{S}]/u, Bi = /(?!~)[\s\p{P}\p{S}]/u, Fi = /(?:[^\s\p{P}\p{S}]|~)/u, Hi = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ti ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), vs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Gi = L(vs, "u").replace(/punct/g, Xe).getRegex(), ji = L(vs, "u").replace(/punct/g, ks).getRegex(), ws = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Wi = L(ws, "gu").replace(/notPunctSpace/g, hn).replace(/punctSpace/g, Ct).replace(/punct/g, Xe).getRegex(), qi = L(ws, "gu").replace(/notPunctSpace/g, Fi).replace(/punctSpace/g, Bi).replace(/punct/g, ks).getRegex(), Vi = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, hn).replace(/punctSpace/g, Ct).replace(/punct/g, Xe).getRegex(), Yi = L(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Xe).getRegex(), Zi = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Xi = L(Zi, "gu").replace(/notPunctSpace/g, hn).replace(/punctSpace/g, Ct).replace(/punct/g, Xe).getRegex(), Ki = L(/\\(punct)/, "gu").replace(/punct/g, Xe).getRegex(), Qi = L(/^<(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(), Ji = L(cn).replace("(?:-->|$)", "-->").getRegex(), er = L("^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", Ji).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), St = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, tr = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", St).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ys = L(/^!?\[(label)\]\[(ref)\]/).replace("label", St).replace("ref", on).getRegex(), Ts = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", on).getRegex(), nr = L("reflink|nolink(?!\\()", "g").replace("reflink", ys).replace("nolink", Ts).getRegex(), Qn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, pn = { _backpedal: Oe, anyPunctuation: Ki, autolink: Qi, blockSkip: Hi, br: bs, code: Ni, del: Oe, delLDelim: Oe, delRDelim: Oe, emStrongLDelim: Gi, emStrongRDelimAst: Wi, emStrongRDelimUnd: Vi, escape: Pi, link: tr, nolink: Ts, punctuation: Ui, reflink: ys, reflinkSearch: nr, tag: er, text: $i, url: Oe }, sr = { ...pn, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", St).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", St).getRegex() }, nn = { ...pn, emStrongRDelimAst: qi, emStrongLDelim: ji, delLDelim: Yi, delRDelim: Xi, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Qn).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: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Qn).getRegex() }, ir = { ...nn, br: L(bs).replace("{2,}", "*").getRegex(), text: L(nn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, yt = { normal: un, gfm: Oi, pedantic: zi }, lt = { normal: pn, gfm: nn, breaks: ir, pedantic: sr }, rr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Jn = /* @__PURE__ */ p((a) => rr[a], "de");
1180
+ function be(a, t) {
1165
1181
  if (t) {
1166
- if (X.escapeTest.test(a)) return a.replace(X.escapeReplace, Kn);
1167
- } else if (X.escapeTestNoEncode.test(a)) return a.replace(X.escapeReplaceNoEncode, Kn);
1182
+ if (ee.escapeTest.test(a)) return a.replace(ee.escapeReplace, Jn);
1183
+ } else if (ee.escapeTestNoEncode.test(a)) return a.replace(ee.escapeReplaceNoEncode, Jn);
1168
1184
  return a;
1169
1185
  }
1170
- p(me, "O");
1171
- function Qn(a) {
1186
+ p(be, "O");
1187
+ function es(a) {
1172
1188
  try {
1173
- a = encodeURI(a).replace(X.percentDecode, "%");
1189
+ a = encodeURI(a).replace(ee.percentDecode, "%");
1174
1190
  } catch {
1175
1191
  return null;
1176
1192
  }
1177
1193
  return a;
1178
1194
  }
1179
- p(Qn, "J");
1180
- function Jn(a, t) {
1181
- let e = a.replace(X.findPipe, (s, l, o) => {
1195
+ p(es, "J");
1196
+ function ts(a, t) {
1197
+ let e = a.replace(ee.findPipe, (s, l, o) => {
1182
1198
  let d = !1, c = l;
1183
1199
  for (; --c >= 0 && o[c] === "\\"; ) d = !d;
1184
1200
  return d ? "|" : " |";
1185
- }), n = e.split(X.splitPipe), r = 0;
1201
+ }), n = e.split(ee.splitPipe), i = 0;
1186
1202
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1187
1203
  else for (; n.length < t; ) n.push("");
1188
- for (; r < n.length; r++) n[r] = n[r].trim().replace(X.slashPipe, "|");
1204
+ for (; i < n.length; i++) n[i] = n[i].trim().replace(ee.slashPipe, "|");
1189
1205
  return n;
1190
1206
  }
1191
- p(Jn, "V");
1192
- function ve(a, t, e) {
1207
+ p(ts, "V");
1208
+ function Te(a, t, e) {
1193
1209
  let n = a.length;
1194
1210
  if (n === 0) return "";
1195
- let r = 0;
1196
- for (; r < n && a.charAt(n - r - 1) === t; )
1197
- r++;
1198
- return a.slice(0, n - r);
1211
+ let i = 0;
1212
+ for (; i < n && a.charAt(n - i - 1) === t; )
1213
+ i++;
1214
+ return a.slice(0, n - i);
1199
1215
  }
1200
- p(ve, "$");
1201
- function es(a) {
1216
+ p(Te, "$");
1217
+ function ns(a) {
1202
1218
  let t = a.split(`
1203
1219
  `), e = t.length - 1;
1204
- for (; e >= 0 && X.blankLine.test(t[e]); ) e--;
1220
+ for (; e >= 0 && ee.blankLine.test(t[e]); ) e--;
1205
1221
  return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1206
1222
  `);
1207
1223
  }
1208
- p(es, "Y");
1209
- function ai(a, t) {
1224
+ p(ns, "Y");
1225
+ function ar(a, t) {
1210
1226
  if (a.indexOf(t[1]) === -1) return -1;
1211
1227
  let e = 0;
1212
1228
  for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
@@ -1214,43 +1230,43 @@ function ai(a, t) {
1214
1230
  else if (a[n] === t[1] && (e--, e < 0)) return n;
1215
1231
  return e > 0 ? -2 : -1;
1216
1232
  }
1217
- p(ai, "ge");
1218
- function li(a, t = 0) {
1233
+ p(ar, "ge");
1234
+ function lr(a, t = 0) {
1219
1235
  let e = t, n = "";
1220
- for (let r of a) if (r === " ") {
1236
+ for (let i of a) if (i === " ") {
1221
1237
  let s = 4 - e % 4;
1222
1238
  n += " ".repeat(s), e += s;
1223
- } else n += r, e++;
1239
+ } else n += i, e++;
1224
1240
  return n;
1225
1241
  }
1226
- p(li, "fe");
1227
- function ts(a, t, e, n, r) {
1228
- let s = t.href, l = t.title || null, o = a[1].replace(r.other.outputLinkReplace, "$1");
1242
+ p(lr, "fe");
1243
+ function ss(a, t, e, n, i) {
1244
+ let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
1229
1245
  n.state.inLink = !0;
1230
1246
  let d = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1231
1247
  return n.state.inLink = !1, d;
1232
1248
  }
1233
- p(ts, "me");
1234
- function oi(a, t, e) {
1249
+ p(ss, "me");
1250
+ function or(a, t, e) {
1235
1251
  let n = a.match(e.other.indentCodeCompensation);
1236
1252
  if (n === null) return t;
1237
- let r = n[1];
1253
+ let i = n[1];
1238
1254
  return t.split(`
1239
1255
  `).map((s) => {
1240
1256
  let l = s.match(e.other.beginningSpace);
1241
1257
  if (l === null) return s;
1242
1258
  let [o] = l;
1243
- return o.length >= r.length ? s.slice(r.length) : s;
1259
+ return o.length >= i.length ? s.slice(i.length) : s;
1244
1260
  }).join(`
1245
1261
  `);
1246
1262
  }
1247
- p(oi, "rt");
1248
- var We, St = (We = class {
1263
+ p(or, "rt");
1264
+ var We, At = (We = class {
1249
1265
  constructor(t) {
1250
- I(this, "options");
1251
- I(this, "rules");
1252
- I(this, "lexer");
1253
- this.options = t || Le;
1266
+ D(this, "options");
1267
+ D(this, "rules");
1268
+ D(this, "lexer");
1269
+ this.options = t || Pe;
1254
1270
  }
1255
1271
  space(t) {
1256
1272
  let e = this.rules.block.newline.exec(t);
@@ -1259,15 +1275,15 @@ var We, St = (We = class {
1259
1275
  code(t) {
1260
1276
  let e = this.rules.block.code.exec(t);
1261
1277
  if (e) {
1262
- let n = this.options.pedantic ? e[0] : es(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
1263
- return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
1278
+ let n = this.options.pedantic ? e[0] : ns(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
1279
+ return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
1264
1280
  }
1265
1281
  }
1266
1282
  fences(t) {
1267
1283
  let e = this.rules.block.fences.exec(t);
1268
1284
  if (e) {
1269
- let n = e[0], r = oi(n, e[3] || "", this.rules);
1270
- return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1285
+ let n = e[0], i = or(n, e[3] || "", this.rules);
1286
+ return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
1271
1287
  }
1272
1288
  }
1273
1289
  heading(t) {
@@ -1275,90 +1291,90 @@ var We, St = (We = class {
1275
1291
  if (e) {
1276
1292
  let n = e[2].trim();
1277
1293
  if (this.rules.other.endingHash.test(n)) {
1278
- let r = ve(n, "#");
1279
- (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1294
+ let i = Te(n, "#");
1295
+ (this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (n = i.trim());
1280
1296
  }
1281
- return { type: "heading", raw: ve(e[0], `
1297
+ return { type: "heading", raw: Te(e[0], `
1282
1298
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1283
1299
  }
1284
1300
  }
1285
1301
  hr(t) {
1286
1302
  let e = this.rules.block.hr.exec(t);
1287
- if (e) return { type: "hr", raw: ve(e[0], `
1303
+ if (e) return { type: "hr", raw: Te(e[0], `
1288
1304
  `) };
1289
1305
  }
1290
1306
  blockquote(t) {
1291
1307
  let e = this.rules.block.blockquote.exec(t);
1292
1308
  if (e) {
1293
- let n = ve(e[0], `
1309
+ let n = Te(e[0], `
1294
1310
  `).split(`
1295
- `), r = "", s = "", l = [];
1311
+ `), i = "", s = "", l = [];
1296
1312
  for (; n.length > 0; ) {
1297
1313
  let o = !1, d = [], c;
1298
1314
  for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) d.push(n[c]), o = !0;
1299
1315
  else if (!o) d.push(n[c]);
1300
1316
  else break;
1301
1317
  n = n.slice(c);
1302
- let m = d.join(`
1303
- `), u = m.replace(this.rules.other.blockquoteSetextReplace, `
1318
+ let g = d.join(`
1319
+ `), u = g.replace(this.rules.other.blockquoteSetextReplace, `
1304
1320
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1305
- r = r ? `${r}
1306
- ${m}` : m, s = s ? `${s}
1321
+ i = i ? `${i}
1322
+ ${g}` : g, s = s ? `${s}
1307
1323
  ${u}` : u;
1308
- let g = this.lexer.state.top;
1309
- if (this.lexer.state.top = !0, this.lexer.blockTokens(u, l, !0), this.lexer.state.top = g, n.length === 0) break;
1310
- let x = l.at(-1);
1311
- if (x?.type === "code") break;
1312
- if (x?.type === "blockquote") {
1313
- let k = x, _ = k.raw + `
1324
+ let w = this.lexer.state.top;
1325
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(u, l, !0), this.lexer.state.top = w, n.length === 0) break;
1326
+ let v = l.at(-1);
1327
+ if (v?.type === "code") break;
1328
+ if (v?.type === "blockquote") {
1329
+ let f = v, y = f.raw + `
1314
1330
  ` + n.join(`
1315
- `), z = this.blockquote(_);
1316
- l[l.length - 1] = z, r = r.substring(0, r.length - k.raw.length) + z.raw, s = s.substring(0, s.length - k.text.length) + z.text;
1331
+ `), C = this.blockquote(y);
1332
+ l[l.length - 1] = C, i = i.substring(0, i.length - f.raw.length) + C.raw, s = s.substring(0, s.length - f.text.length) + C.text;
1317
1333
  break;
1318
- } else if (x?.type === "list") {
1319
- let k = x, _ = k.raw + `
1334
+ } else if (v?.type === "list") {
1335
+ let f = v, y = f.raw + `
1320
1336
  ` + n.join(`
1321
- `), z = this.list(_);
1322
- l[l.length - 1] = z, r = r.substring(0, r.length - x.raw.length) + z.raw, s = s.substring(0, s.length - k.raw.length) + z.raw, n = _.substring(l.at(-1).raw.length).split(`
1337
+ `), C = this.list(y);
1338
+ l[l.length - 1] = C, i = i.substring(0, i.length - v.raw.length) + C.raw, s = s.substring(0, s.length - f.raw.length) + C.raw, n = y.substring(l.at(-1).raw.length).split(`
1323
1339
  `);
1324
1340
  continue;
1325
1341
  }
1326
1342
  }
1327
- return { type: "blockquote", raw: r, tokens: l, text: s };
1343
+ return { type: "blockquote", raw: i, tokens: l, text: s };
1328
1344
  }
1329
1345
  }
1330
1346
  list(t) {
1331
1347
  let e = this.rules.block.list.exec(t);
1332
1348
  if (e) {
1333
- let n = e[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
1334
- n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1349
+ let n = e[1].trim(), i = n.length > 1, s = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] };
1350
+ n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
1335
1351
  let l = this.rules.other.listItemRegex(n), o = !1;
1336
1352
  for (; t; ) {
1337
- let c = !1, m = "", u = "";
1353
+ let c = !1, g = "", u = "";
1338
1354
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1339
- m = e[0], t = t.substring(m.length);
1340
- let g = li(e[2].split(`
1341
- `, 1)[0], e[1].length), x = t.split(`
1342
- `, 1)[0], k = !g.trim(), _ = 0;
1343
- if (this.options.pedantic ? (_ = 2, u = g.trimStart()) : k ? _ = e[1].length + 1 : (_ = g.search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, u = g.slice(_), _ += e[1].length), k && this.rules.other.blankLine.test(x) && (m += x + `
1344
- `, t = t.substring(x.length + 1), c = !0), !c) {
1345
- let z = this.rules.other.nextBulletRegex(_), te = this.rules.other.hrRegex(_), oe = this.rules.other.fencesBeginRegex(_), se = this.rules.other.headingBeginRegex(_), O = this.rules.other.htmlBeginRegex(_), ce = this.rules.other.blockquoteBeginRegex(_);
1355
+ g = e[0], t = t.substring(g.length);
1356
+ let w = lr(e[2].split(`
1357
+ `, 1)[0], e[1].length), v = t.split(`
1358
+ `, 1)[0], f = !w.trim(), y = 0;
1359
+ if (this.options.pedantic ? (y = 2, u = w.trimStart()) : f ? y = e[1].length + 1 : (y = w.search(this.rules.other.nonSpaceChar), y = y > 4 ? 1 : y, u = w.slice(y), y += e[1].length), f && this.rules.other.blankLine.test(v) && (g += v + `
1360
+ `, t = t.substring(v.length + 1), c = !0), !c) {
1361
+ let C = this.rules.other.nextBulletRegex(y), z = this.rules.other.hrRegex(y), Z = this.rules.other.fencesBeginRegex(y), ie = this.rules.other.headingBeginRegex(y), N = this.rules.other.htmlBeginRegex(y), W = this.rules.other.blockquoteBeginRegex(y);
1346
1362
  for (; t; ) {
1347
- let re = t.split(`
1348
- `, 1)[0], ie;
1349
- if (x = re, this.options.pedantic ? (x = x.replace(this.rules.other.listReplaceNesting, " "), ie = x) : ie = x.replace(this.rules.other.tabCharGlobal, " "), oe.test(x) || se.test(x) || O.test(x) || ce.test(x) || z.test(x) || te.test(x)) break;
1350
- if (ie.search(this.rules.other.nonSpaceChar) >= _ || !x.trim()) u += `
1351
- ` + ie.slice(_);
1363
+ let te = t.split(`
1364
+ `, 1)[0], fe;
1365
+ if (v = te, this.options.pedantic ? (v = v.replace(this.rules.other.listReplaceNesting, " "), fe = v) : fe = v.replace(this.rules.other.tabCharGlobal, " "), Z.test(v) || ie.test(v) || N.test(v) || W.test(v) || C.test(v) || z.test(v)) break;
1366
+ if (fe.search(this.rules.other.nonSpaceChar) >= y || !v.trim()) u += `
1367
+ ` + fe.slice(y);
1352
1368
  else {
1353
- if (k || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || oe.test(g) || se.test(g) || te.test(g)) break;
1369
+ if (f || w.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Z.test(w) || ie.test(w) || z.test(w)) break;
1354
1370
  u += `
1355
- ` + x;
1371
+ ` + v;
1356
1372
  }
1357
- k = !x.trim(), m += re + `
1358
- `, t = t.substring(re.length + 1), g = ie.slice(_);
1373
+ f = !v.trim(), g += te + `
1374
+ `, t = t.substring(te.length + 1), w = fe.slice(y);
1359
1375
  }
1360
1376
  }
1361
- s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(m) && (o = !0)), s.items.push({ type: "list_item", raw: m, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), s.raw += m;
1377
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (o = !0)), s.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), s.raw += g;
1362
1378
  }
1363
1379
  let d = s.items.at(-1);
1364
1380
  if (d) d.raw = d.raw.trimEnd(), d.text = d.text.trimEnd();
@@ -1373,20 +1389,20 @@ ${u}` : u;
1373
1389
  break;
1374
1390
  }
1375
1391
  }
1376
- let m = this.rules.other.listTaskCheckbox.exec(c.raw);
1377
- if (m) {
1378
- let u = { type: "checkbox", raw: m[0] + " ", checked: m[0] !== "[ ]" };
1392
+ let g = this.rules.other.listTaskCheckbox.exec(c.raw);
1393
+ if (g) {
1394
+ let u = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
1379
1395
  c.checked = u.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = u.raw + c.tokens[0].raw, c.tokens[0].text = u.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(u)) : c.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : c.tokens.unshift(u);
1380
1396
  }
1381
1397
  }
1382
1398
  if (!s.loose) {
1383
- let m = c.tokens.filter((g) => g.type === "space"), u = m.length > 0 && m.some((g) => this.rules.other.anyLine.test(g.raw));
1399
+ let g = c.tokens.filter((w) => w.type === "space"), u = g.length > 0 && g.some((w) => this.rules.other.anyLine.test(w.raw));
1384
1400
  s.loose = u;
1385
1401
  }
1386
1402
  }
1387
1403
  if (s.loose) for (let c of s.items) {
1388
1404
  c.loose = !0;
1389
- for (let m of c.tokens) m.type === "text" && (m.type = "paragraph");
1405
+ for (let g of c.tokens) g.type === "text" && (g.type = "paragraph");
1390
1406
  }
1391
1407
  return s;
1392
1408
  }
@@ -1394,28 +1410,28 @@ ${u}` : u;
1394
1410
  html(t) {
1395
1411
  let e = this.rules.block.html.exec(t);
1396
1412
  if (e) {
1397
- let n = es(e[0]);
1413
+ let n = ns(e[0]);
1398
1414
  return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
1399
1415
  }
1400
1416
  }
1401
1417
  def(t) {
1402
1418
  let e = this.rules.block.def.exec(t);
1403
1419
  if (e) {
1404
- let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
1405
- return { type: "def", tag: n, raw: ve(e[0], `
1406
- `), href: r, title: s };
1420
+ let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), i = 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];
1421
+ return { type: "def", tag: n, raw: Te(e[0], `
1422
+ `), href: i, title: s };
1407
1423
  }
1408
1424
  }
1409
1425
  table(t) {
1410
1426
  let e = this.rules.block.table.exec(t);
1411
1427
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1412
- let n = Jn(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1413
- `) : [], l = { type: "table", raw: ve(e[0], `
1428
+ let n = ts(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1429
+ `) : [], l = { type: "table", raw: Te(e[0], `
1414
1430
  `), header: [], align: [], rows: [] };
1415
- if (n.length === r.length) {
1416
- for (let o of r) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
1431
+ if (n.length === i.length) {
1432
+ for (let o of i) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
1417
1433
  for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
1418
- for (let o of s) l.rows.push(Jn(o, l.header.length).map((d, c) => ({ text: d, tokens: this.lexer.inline(d), header: !1, align: l.align[c] })));
1434
+ for (let o of s) l.rows.push(ts(o, l.header.length).map((d, c) => ({ text: d, tokens: this.lexer.inline(d), header: !1, align: l.align[c] })));
1419
1435
  return l;
1420
1436
  }
1421
1437
  }
@@ -1423,7 +1439,7 @@ ${u}` : u;
1423
1439
  let e = this.rules.block.lheading.exec(t);
1424
1440
  if (e) {
1425
1441
  let n = e[1].trim();
1426
- return { type: "heading", raw: ve(e[0], `
1442
+ return { type: "heading", raw: Te(e[0], `
1427
1443
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1428
1444
  }
1429
1445
  }
@@ -1453,65 +1469,65 @@ ${u}` : u;
1453
1469
  let n = e[2].trim();
1454
1470
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1455
1471
  if (!this.rules.other.endAngleBracket.test(n)) return;
1456
- let l = ve(n.slice(0, -1), "\\");
1472
+ let l = Te(n.slice(0, -1), "\\");
1457
1473
  if ((n.length - l.length) % 2 === 0) return;
1458
1474
  } else {
1459
- let l = ai(e[2], "()");
1475
+ let l = ar(e[2], "()");
1460
1476
  if (l === -2) return;
1461
1477
  if (l > -1) {
1462
1478
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
1463
1479
  e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
1464
1480
  }
1465
1481
  }
1466
- let r = e[2], s = "";
1482
+ let i = e[2], s = "";
1467
1483
  if (this.options.pedantic) {
1468
- let l = this.rules.other.pedanticHrefTitle.exec(r);
1469
- l && (r = l[1], s = l[3]);
1484
+ let l = this.rules.other.pedanticHrefTitle.exec(i);
1485
+ l && (i = l[1], s = l[3]);
1470
1486
  } else s = e[3] ? e[3].slice(1, -1) : "";
1471
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ts(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1487
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), ss(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1472
1488
  }
1473
1489
  }
1474
1490
  reflink(t, e) {
1475
1491
  let n;
1476
1492
  if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
1477
- let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
1493
+ let i = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[i.toLowerCase()];
1478
1494
  if (!s) {
1479
1495
  let l = n[0].charAt(0);
1480
1496
  return { type: "text", raw: l, text: l };
1481
1497
  }
1482
- return ts(n, s, n[0], this.lexer, this.rules);
1498
+ return ss(n, s, n[0], this.lexer, this.rules);
1483
1499
  }
1484
1500
  }
1485
1501
  emStrong(t, e, n = "") {
1486
- let r = this.rules.inline.emStrongLDelim.exec(t);
1487
- if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1488
- let s = [...r[0]].length - 1, l, o, d = s, c = 0, m = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1489
- for (m.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = m.exec(e)) !== null; ) {
1490
- if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
1491
- if (o = [...l].length, r[3] || r[4]) {
1502
+ let i = this.rules.inline.emStrongLDelim.exec(t);
1503
+ if (!(!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(i[1] || i[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1504
+ let s = [...i[0]].length - 1, l, o, d = s, c = 0, g = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1505
+ for (g.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = g.exec(e)) !== null; ) {
1506
+ if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
1507
+ if (o = [...l].length, i[3] || i[4]) {
1492
1508
  d += o;
1493
1509
  continue;
1494
- } else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
1510
+ } else if ((i[5] || i[6]) && s % 3 && !((s + o) % 3)) {
1495
1511
  c += o;
1496
1512
  continue;
1497
1513
  }
1498
1514
  if (d -= o, d > 0) continue;
1499
1515
  o = Math.min(o, o + d + c);
1500
- let u = [...r[0]][0].length, g = t.slice(0, s + r.index + u + o);
1516
+ let u = [...i[0]][0].length, w = t.slice(0, s + i.index + u + o);
1501
1517
  if (Math.min(s, o) % 2) {
1502
- let k = g.slice(1, -1);
1503
- return { type: "em", raw: g, text: k, tokens: this.lexer.inlineTokens(k) };
1518
+ let f = w.slice(1, -1);
1519
+ return { type: "em", raw: w, text: f, tokens: this.lexer.inlineTokens(f) };
1504
1520
  }
1505
- let x = g.slice(2, -2);
1506
- return { type: "strong", raw: g, text: x, tokens: this.lexer.inlineTokens(x) };
1521
+ let v = w.slice(2, -2);
1522
+ return { type: "strong", raw: w, text: v, tokens: this.lexer.inlineTokens(v) };
1507
1523
  }
1508
1524
  }
1509
1525
  }
1510
1526
  codespan(t) {
1511
1527
  let e = this.rules.inline.code.exec(t);
1512
1528
  if (e) {
1513
- let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
1514
- return r && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1529
+ let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
1530
+ return i && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1515
1531
  }
1516
1532
  }
1517
1533
  br(t) {
@@ -1519,42 +1535,42 @@ ${u}` : u;
1519
1535
  if (e) return { type: "br", raw: e[0] };
1520
1536
  }
1521
1537
  del(t, e, n = "") {
1522
- let r = this.rules.inline.delLDelim.exec(t);
1523
- if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1524
- let s = [...r[0]].length - 1, l, o, d = s, c = this.rules.inline.delRDelim;
1525
- for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
1526
- if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l || (o = [...l].length, o !== s)) continue;
1527
- if (r[3] || r[4]) {
1538
+ let i = this.rules.inline.delLDelim.exec(t);
1539
+ if (i && (!i[1] || !n || this.rules.inline.punctuation.exec(n))) {
1540
+ let s = [...i[0]].length - 1, l, o, d = s, c = this.rules.inline.delRDelim;
1541
+ for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = c.exec(e)) !== null; ) {
1542
+ if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l || (o = [...l].length, o !== s)) continue;
1543
+ if (i[3] || i[4]) {
1528
1544
  d += o;
1529
1545
  continue;
1530
1546
  }
1531
1547
  if (d -= o, d > 0) continue;
1532
1548
  o = Math.min(o, o + d);
1533
- let m = [...r[0]][0].length, u = t.slice(0, s + r.index + m + o), g = u.slice(s, -s);
1534
- return { type: "del", raw: u, text: g, tokens: this.lexer.inlineTokens(g) };
1549
+ let g = [...i[0]][0].length, u = t.slice(0, s + i.index + g + o), w = u.slice(s, -s);
1550
+ return { type: "del", raw: u, text: w, tokens: this.lexer.inlineTokens(w) };
1535
1551
  }
1536
1552
  }
1537
1553
  }
1538
1554
  autolink(t) {
1539
1555
  let e = this.rules.inline.autolink.exec(t);
1540
1556
  if (e) {
1541
- let n, r;
1542
- return e[2] === "@" ? (n = e[1], r = "mailto:" + n) : (n = e[1], r = n), { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1557
+ let n, i;
1558
+ return e[2] === "@" ? (n = e[1], i = "mailto:" + n) : (n = e[1], i = n), { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
1543
1559
  }
1544
1560
  }
1545
1561
  url(t) {
1546
1562
  let e;
1547
1563
  if (e = this.rules.inline.url.exec(t)) {
1548
- let n, r;
1549
- if (e[2] === "@") n = e[0], r = "mailto:" + n;
1564
+ let n, i;
1565
+ if (e[2] === "@") n = e[0], i = "mailto:" + n;
1550
1566
  else {
1551
1567
  let s;
1552
1568
  do
1553
1569
  s = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
1554
1570
  while (s !== e[0]);
1555
- n = e[0], e[1] === "www." ? r = "http://" + e[0] : r = e[0];
1571
+ n = e[0], e[1] === "www." ? i = "http://" + e[0] : i = e[0];
1556
1572
  }
1557
- return { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1573
+ return { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
1558
1574
  }
1559
1575
  }
1560
1576
  inlineText(t) {
@@ -1564,28 +1580,28 @@ ${u}` : u;
1564
1580
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1565
1581
  }
1566
1582
  }
1567
- }, p(We, "w"), We), Se, pe = (Se = class {
1583
+ }, p(We, "w"), We), Ee, pe = (Ee = class {
1568
1584
  constructor(t) {
1569
- I(this, "tokens");
1570
- I(this, "options");
1571
- I(this, "state");
1572
- I(this, "inlineQueue");
1573
- I(this, "tokenizer");
1574
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new St(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1575
- let e = { other: X, block: vt.normal, inline: lt.normal };
1576
- this.options.pedantic ? (e.block = vt.pedantic, e.inline = lt.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = lt.breaks : e.inline = lt.gfm), this.tokenizer.rules = e;
1585
+ D(this, "tokens");
1586
+ D(this, "options");
1587
+ D(this, "state");
1588
+ D(this, "inlineQueue");
1589
+ D(this, "tokenizer");
1590
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Pe, 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 };
1591
+ let e = { other: ee, block: yt.normal, inline: lt.normal };
1592
+ this.options.pedantic ? (e.block = yt.pedantic, e.inline = lt.pedantic) : this.options.gfm && (e.block = yt.gfm, this.options.breaks ? e.inline = lt.breaks : e.inline = lt.gfm), this.tokenizer.rules = e;
1577
1593
  }
1578
1594
  static get rules() {
1579
- return { block: vt, inline: lt };
1595
+ return { block: yt, inline: lt };
1580
1596
  }
1581
1597
  static lex(t, e) {
1582
- return new Se(e).lex(t);
1598
+ return new Ee(e).lex(t);
1583
1599
  }
1584
1600
  static lexInline(t, e) {
1585
- return new Se(e).inlineTokens(t);
1601
+ return new Ee(e).inlineTokens(t);
1586
1602
  }
1587
1603
  lex(t) {
1588
- t = t.replace(X.carriageReturn, `
1604
+ t = t.replace(ee.carriageReturn, `
1589
1605
  `), this.blockTokens(t, this.tokens);
1590
1606
  for (let e = 0; e < this.inlineQueue.length; e++) {
1591
1607
  let n = this.inlineQueue[e];
@@ -1594,10 +1610,10 @@ ${u}` : u;
1594
1610
  return this.inlineQueue = [], this.tokens;
1595
1611
  }
1596
1612
  blockTokens(t, e = [], n = !1) {
1597
- this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(X.tabCharGlobal, " ").replace(X.spaceLine, ""));
1598
- let r = 1 / 0;
1613
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(ee.tabCharGlobal, " ").replace(ee.spaceLine, ""));
1614
+ let i = 1 / 0;
1599
1615
  for (; t; ) {
1600
- if (t.length < r) r = t.length;
1616
+ if (t.length < i) i = t.length;
1601
1617
  else {
1602
1618
  this.infiniteLoopError(t.charCodeAt(0));
1603
1619
  break;
@@ -1664,8 +1680,8 @@ ${u}` : u;
1664
1680
  let l = t;
1665
1681
  if (this.options.extensions?.startBlock) {
1666
1682
  let o = 1 / 0, d = t.slice(1), c;
1667
- this.options.extensions.startBlock.forEach((m) => {
1668
- c = m.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1683
+ this.options.extensions.startBlock.forEach((g) => {
1684
+ c = g.call({ lexer: this }, d), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1669
1685
  }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
1670
1686
  }
1671
1687
  if (this.state.top && (s = this.tokenizer.paragraph(l))) {
@@ -1697,14 +1713,14 @@ ${u}` : u;
1697
1713
  }
1698
1714
  inlineTokens(t, e = []) {
1699
1715
  this.tokenizer.lexer = this;
1700
- let n = t, r = null;
1716
+ let n = t, i = null;
1701
1717
  if (this.tokens.links) {
1702
1718
  let c = Object.keys(this.tokens.links);
1703
- if (c.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1719
+ if (c.length > 0) for (; (i = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1704
1720
  }
1705
- for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1721
+ for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, i.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1706
1722
  let s;
1707
- 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);
1723
+ for (; (i = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = i[2] ? i[2].length : 0, n = n.slice(0, i.index + s) + "[" + "a".repeat(i[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1708
1724
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1709
1725
  let l = !1, o = "", d = 1 / 0;
1710
1726
  for (; t; ) {
@@ -1758,14 +1774,14 @@ ${u}` : u;
1758
1774
  t = t.substring(c.raw.length), e.push(c);
1759
1775
  continue;
1760
1776
  }
1761
- let m = t;
1777
+ let g = t;
1762
1778
  if (this.options.extensions?.startInline) {
1763
- let u = 1 / 0, g = t.slice(1), x;
1764
- this.options.extensions.startInline.forEach((k) => {
1765
- x = k.call({ lexer: this }, g), typeof x == "number" && x >= 0 && (u = Math.min(u, x));
1766
- }), u < 1 / 0 && u >= 0 && (m = t.substring(0, u + 1));
1779
+ let u = 1 / 0, w = t.slice(1), v;
1780
+ this.options.extensions.startInline.forEach((f) => {
1781
+ v = f.call({ lexer: this }, w), typeof v == "number" && v >= 0 && (u = Math.min(u, v));
1782
+ }), u < 1 / 0 && u >= 0 && (g = t.substring(0, u + 1));
1767
1783
  }
1768
- if (c = this.tokenizer.inlineText(m)) {
1784
+ if (c = this.tokenizer.inlineText(g)) {
1769
1785
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1770
1786
  let u = e.at(-1);
1771
1787
  u?.type === "text" ? (u.raw += c.raw, u.text += c.text) : e.push(c);
@@ -1783,20 +1799,20 @@ ${u}` : u;
1783
1799
  if (this.options.silent) console.error(e);
1784
1800
  else throw new Error(e);
1785
1801
  }
1786
- }, p(Se, "l"), Se), qe, At = (qe = class {
1802
+ }, p(Ee, "l"), Ee), qe, Et = (qe = class {
1787
1803
  constructor(t) {
1788
- I(this, "options");
1789
- I(this, "parser");
1790
- this.options = t || Le;
1804
+ D(this, "options");
1805
+ D(this, "parser");
1806
+ this.options = t || Pe;
1791
1807
  }
1792
1808
  space(t) {
1793
1809
  return "";
1794
1810
  }
1795
1811
  code({ text: t, lang: e, escaped: n }) {
1796
- let r = (e || "").match(X.notSpaceStart)?.[0], s = t.replace(X.endingNewline, "") + `
1812
+ let i = (e || "").match(ee.notSpaceStart)?.[0], s = t.replace(ee.endingNewline, "") + `
1797
1813
  `;
1798
- return r ? '<pre><code class="language-' + me(r) + '">' + (n ? s : me(s, !0)) + `</code></pre>
1799
- ` : "<pre><code>" + (n ? s : me(s, !0)) + `</code></pre>
1814
+ return i ? '<pre><code class="language-' + be(i) + '">' + (n ? s : be(s, !0)) + `</code></pre>
1815
+ ` : "<pre><code>" + (n ? s : be(s, !0)) + `</code></pre>
1800
1816
  `;
1801
1817
  }
1802
1818
  blockquote({ tokens: t }) {
@@ -1819,14 +1835,14 @@ ${this.parser.parse(t)}</blockquote>
1819
1835
  `;
1820
1836
  }
1821
1837
  list(t) {
1822
- let e = t.ordered, n = t.start, r = "";
1838
+ let e = t.ordered, n = t.start, i = "";
1823
1839
  for (let o = 0; o < t.items.length; o++) {
1824
1840
  let d = t.items[o];
1825
- r += this.listitem(d);
1841
+ i += this.listitem(d);
1826
1842
  }
1827
1843
  let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
1828
1844
  return "<" + s + l + `>
1829
- ` + r + "</" + s + `>
1845
+ ` + i + "</" + s + `>
1830
1846
  `;
1831
1847
  }
1832
1848
  listitem(t) {
@@ -1844,17 +1860,17 @@ ${this.parser.parse(t)}</blockquote>
1844
1860
  let e = "", n = "";
1845
1861
  for (let s = 0; s < t.header.length; s++) n += this.tablecell(t.header[s]);
1846
1862
  e += this.tablerow({ text: n });
1847
- let r = "";
1863
+ let i = "";
1848
1864
  for (let s = 0; s < t.rows.length; s++) {
1849
1865
  let l = t.rows[s];
1850
1866
  n = "";
1851
1867
  for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
1852
- r += this.tablerow({ text: n });
1868
+ i += this.tablerow({ text: n });
1853
1869
  }
1854
- return r && (r = `<tbody>${r}</tbody>`), `<table>
1870
+ return i && (i = `<tbody>${i}</tbody>`), `<table>
1855
1871
  <thead>
1856
1872
  ` + e + `</thead>
1857
- ` + r + `</table>
1873
+ ` + i + `</table>
1858
1874
  `;
1859
1875
  }
1860
1876
  tablerow({ text: t }) {
@@ -1874,7 +1890,7 @@ ${t}</tr>
1874
1890
  return `<em>${this.parser.parseInline(t)}</em>`;
1875
1891
  }
1876
1892
  codespan({ text: t }) {
1877
- return `<code>${me(t, !0)}</code>`;
1893
+ return `<code>${be(t, !0)}</code>`;
1878
1894
  }
1879
1895
  br(t) {
1880
1896
  return "<br>";
@@ -1883,24 +1899,24 @@ ${t}</tr>
1883
1899
  return `<del>${this.parser.parseInline(t)}</del>`;
1884
1900
  }
1885
1901
  link({ href: t, title: e, tokens: n }) {
1886
- let r = this.parser.parseInline(n), s = Qn(t);
1887
- if (s === null) return r;
1902
+ let i = this.parser.parseInline(n), s = es(t);
1903
+ if (s === null) return i;
1888
1904
  t = s;
1889
1905
  let l = '<a href="' + t + '"';
1890
- return e && (l += ' title="' + me(e) + '"'), l += ">" + r + "</a>", l;
1906
+ return e && (l += ' title="' + be(e) + '"'), l += ">" + i + "</a>", l;
1891
1907
  }
1892
- image({ href: t, title: e, text: n, tokens: r }) {
1893
- r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1894
- let s = Qn(t);
1895
- if (s === null) return me(n);
1908
+ image({ href: t, title: e, text: n, tokens: i }) {
1909
+ i && (n = this.parser.parseInline(i, this.parser.textRenderer));
1910
+ let s = es(t);
1911
+ if (s === null) return be(n);
1896
1912
  t = s;
1897
- let l = `<img src="${t}" alt="${me(n)}"`;
1898
- return e && (l += ` title="${me(e)}"`), l += ">", l;
1913
+ let l = `<img src="${t}" alt="${be(n)}"`;
1914
+ return e && (l += ` title="${be(e)}"`), l += ">", l;
1899
1915
  }
1900
1916
  text(t) {
1901
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : me(t.text);
1917
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : be(t.text);
1902
1918
  }
1903
- }, p(qe, "y"), qe), Ve, hn = (Ve = class {
1919
+ }, p(qe, "y"), qe), Ve, dn = (Ve = class {
1904
1920
  strong({ text: t }) {
1905
1921
  return t;
1906
1922
  }
@@ -1931,32 +1947,32 @@ ${t}</tr>
1931
1947
  checkbox({ raw: t }) {
1932
1948
  return t;
1933
1949
  }
1934
- }, p(Ve, "L"), Ve), Ae, de = (Ae = class {
1950
+ }, p(Ve, "L"), Ve), _e, de = (_e = class {
1935
1951
  constructor(t) {
1936
- I(this, "options");
1937
- I(this, "renderer");
1938
- I(this, "textRenderer");
1939
- this.options = t || Le, this.options.renderer = this.options.renderer || new At(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new hn();
1952
+ D(this, "options");
1953
+ D(this, "renderer");
1954
+ D(this, "textRenderer");
1955
+ this.options = t || Pe, 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 dn();
1940
1956
  }
1941
1957
  static parse(t, e) {
1942
- return new Ae(e).parse(t);
1958
+ return new _e(e).parse(t);
1943
1959
  }
1944
1960
  static parseInline(t, e) {
1945
- return new Ae(e).parseInline(t);
1961
+ return new _e(e).parseInline(t);
1946
1962
  }
1947
1963
  parse(t) {
1948
1964
  this.renderer.parser = this;
1949
1965
  let e = "";
1950
1966
  for (let n = 0; n < t.length; n++) {
1951
- let r = t[n];
1952
- if (this.options.extensions?.renderers?.[r.type]) {
1953
- let l = r, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1967
+ let i = t[n];
1968
+ if (this.options.extensions?.renderers?.[i.type]) {
1969
+ let l = i, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1954
1970
  if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
1955
1971
  e += o || "";
1956
1972
  continue;
1957
1973
  }
1958
1974
  }
1959
- let s = r;
1975
+ let s = i;
1960
1976
  switch (s.type) {
1961
1977
  case "space": {
1962
1978
  e += this.renderer.space(s);
@@ -2018,8 +2034,8 @@ ${t}</tr>
2018
2034
  parseInline(t, e = this.renderer) {
2019
2035
  this.renderer.parser = this;
2020
2036
  let n = "";
2021
- for (let r = 0; r < t.length; r++) {
2022
- let s = t[r];
2037
+ for (let i = 0; i < t.length; i++) {
2038
+ let s = t[i];
2023
2039
  if (this.options.extensions?.renderers?.[s.type]) {
2024
2040
  let o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
2025
2041
  if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
@@ -2082,11 +2098,11 @@ ${t}</tr>
2082
2098
  }
2083
2099
  return n;
2084
2100
  }
2085
- }, p(Ae, "l"), Ae), Te, ut = (Te = class {
2101
+ }, p(_e, "l"), _e), Ae, ut = (Ae = class {
2086
2102
  constructor(t) {
2087
- I(this, "options");
2088
- I(this, "block");
2089
- this.options = t || Le;
2103
+ D(this, "options");
2104
+ D(this, "block");
2105
+ this.options = t || Pe;
2090
2106
  }
2091
2107
  preprocess(t) {
2092
2108
  return t;
@@ -2106,36 +2122,36 @@ ${t}</tr>
2106
2122
  provideParser(t = this.block) {
2107
2123
  return t ? de.parse : de.parseInline;
2108
2124
  }
2109
- }, p(Te, "P"), I(Te, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Te, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Te), Ye, ci = (Ye = class {
2125
+ }, p(Ae, "P"), D(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), Ye, cr = (Ye = class {
2110
2126
  constructor(...t) {
2111
- I(this, "defaults", nn());
2112
- I(this, "options", this.setOptions);
2113
- I(this, "parse", this.parseMarkdown(!0));
2114
- I(this, "parseInline", this.parseMarkdown(!1));
2115
- I(this, "Parser", de);
2116
- I(this, "Renderer", At);
2117
- I(this, "TextRenderer", hn);
2118
- I(this, "Lexer", pe);
2119
- I(this, "Tokenizer", St);
2120
- I(this, "Hooks", ut);
2127
+ D(this, "defaults", rn());
2128
+ D(this, "options", this.setOptions);
2129
+ D(this, "parse", this.parseMarkdown(!0));
2130
+ D(this, "parseInline", this.parseMarkdown(!1));
2131
+ D(this, "Parser", de);
2132
+ D(this, "Renderer", Et);
2133
+ D(this, "TextRenderer", dn);
2134
+ D(this, "Lexer", pe);
2135
+ D(this, "Tokenizer", At);
2136
+ D(this, "Hooks", ut);
2121
2137
  this.use(...t);
2122
2138
  }
2123
2139
  walkTokens(t, e) {
2124
2140
  let n = [];
2125
- for (let r of t) switch (n = n.concat(e.call(this, r)), r.type) {
2141
+ for (let i of t) switch (n = n.concat(e.call(this, i)), i.type) {
2126
2142
  case "table": {
2127
- let s = r;
2143
+ let s = i;
2128
2144
  for (let l of s.header) n = n.concat(this.walkTokens(l.tokens, e));
2129
2145
  for (let l of s.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
2130
2146
  break;
2131
2147
  }
2132
2148
  case "list": {
2133
- let s = r;
2149
+ let s = i;
2134
2150
  n = n.concat(this.walkTokens(s.items, e));
2135
2151
  break;
2136
2152
  }
2137
2153
  default: {
2138
- let s = r;
2154
+ let s = i;
2139
2155
  this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((l) => {
2140
2156
  let o = s[l].flat(1 / 0);
2141
2157
  n = n.concat(this.walkTokens(o, e));
@@ -2147,8 +2163,8 @@ ${t}</tr>
2147
2163
  use(...t) {
2148
2164
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
2149
2165
  return t.forEach((n) => {
2150
- let r = { ...n };
2151
- if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
2166
+ let i = { ...n };
2167
+ if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((s) => {
2152
2168
  if (!s.name) throw new Error("extension name required");
2153
2169
  if ("renderer" in s) {
2154
2170
  let l = e.renderers[s.name];
@@ -2163,31 +2179,31 @@ ${t}</tr>
2163
2179
  l ? l.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
2164
2180
  }
2165
2181
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2166
- }), r.extensions = e), n.renderer) {
2167
- let s = this.defaults.renderer || new At(this.defaults);
2182
+ }), i.extensions = e), n.renderer) {
2183
+ let s = this.defaults.renderer || new Et(this.defaults);
2168
2184
  for (let l in n.renderer) {
2169
2185
  if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
2170
2186
  if (["options", "parser"].includes(l)) continue;
2171
2187
  let o = l, d = n.renderer[o], c = s[o];
2172
- s[o] = (...m) => {
2173
- let u = d.apply(s, m);
2174
- return u === !1 && (u = c.apply(s, m)), u || "";
2188
+ s[o] = (...g) => {
2189
+ let u = d.apply(s, g);
2190
+ return u === !1 && (u = c.apply(s, g)), u || "";
2175
2191
  };
2176
2192
  }
2177
- r.renderer = s;
2193
+ i.renderer = s;
2178
2194
  }
2179
2195
  if (n.tokenizer) {
2180
- let s = this.defaults.tokenizer || new St(this.defaults);
2196
+ let s = this.defaults.tokenizer || new At(this.defaults);
2181
2197
  for (let l in n.tokenizer) {
2182
2198
  if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
2183
2199
  if (["options", "rules", "lexer"].includes(l)) continue;
2184
2200
  let o = l, d = n.tokenizer[o], c = s[o];
2185
- s[o] = (...m) => {
2186
- let u = d.apply(s, m);
2187
- return u === !1 && (u = c.apply(s, m)), u;
2201
+ s[o] = (...g) => {
2202
+ let u = d.apply(s, g);
2203
+ return u === !1 && (u = c.apply(s, g)), u;
2188
2204
  };
2189
2205
  }
2190
- r.tokenizer = s;
2206
+ i.tokenizer = s;
2191
2207
  }
2192
2208
  if (n.hooks) {
2193
2209
  let s = this.defaults.hooks || new ut();
@@ -2195,32 +2211,32 @@ ${t}</tr>
2195
2211
  if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
2196
2212
  if (["options", "block"].includes(l)) continue;
2197
2213
  let o = l, d = n.hooks[o], c = s[o];
2198
- ut.passThroughHooks.has(l) ? s[o] = (m) => {
2214
+ ut.passThroughHooks.has(l) ? s[o] = (g) => {
2199
2215
  if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
2200
- let g = await d.call(s, m);
2201
- return c.call(s, g);
2216
+ let w = await d.call(s, g);
2217
+ return c.call(s, w);
2202
2218
  })();
2203
- let u = d.call(s, m);
2219
+ let u = d.call(s, g);
2204
2220
  return c.call(s, u);
2205
- } : s[o] = (...m) => {
2221
+ } : s[o] = (...g) => {
2206
2222
  if (this.defaults.async) return (async () => {
2207
- let g = await d.apply(s, m);
2208
- return g === !1 && (g = await c.apply(s, m)), g;
2223
+ let w = await d.apply(s, g);
2224
+ return w === !1 && (w = await c.apply(s, g)), w;
2209
2225
  })();
2210
- let u = d.apply(s, m);
2211
- return u === !1 && (u = c.apply(s, m)), u;
2226
+ let u = d.apply(s, g);
2227
+ return u === !1 && (u = c.apply(s, g)), u;
2212
2228
  };
2213
2229
  }
2214
- r.hooks = s;
2230
+ i.hooks = s;
2215
2231
  }
2216
2232
  if (n.walkTokens) {
2217
2233
  let s = this.defaults.walkTokens, l = n.walkTokens;
2218
- r.walkTokens = function(o) {
2234
+ i.walkTokens = function(o) {
2219
2235
  let d = [];
2220
2236
  return d.push(l.call(this, o)), s && (d = d.concat(s.call(this, o))), d;
2221
2237
  };
2222
2238
  }
2223
- this.defaults = { ...this.defaults, ...r };
2239
+ this.defaults = { ...this.defaults, ...i };
2224
2240
  }), this;
2225
2241
  }
2226
2242
  setOptions(t) {
@@ -2234,15 +2250,15 @@ ${t}</tr>
2234
2250
  }
2235
2251
  parseMarkdown(t) {
2236
2252
  return (e, n) => {
2237
- let r = { ...n }, s = { ...this.defaults, ...r }, l = this.onError(!!s.silent, !!s.async);
2238
- if (this.defaults.async === !0 && r.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2253
+ let i = { ...n }, s = { ...this.defaults, ...i }, l = this.onError(!!s.silent, !!s.async);
2254
+ if (this.defaults.async === !0 && i.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2239
2255
  if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2240
2256
  if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2241
2257
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2242
2258
  let o = s.hooks ? await s.hooks.preprocess(e) : e, d = await (s.hooks ? await s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(d) : d;
2243
2259
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2244
- let m = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
2245
- return s.hooks ? await s.hooks.postprocess(m) : m;
2260
+ let g = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
2261
+ return s.hooks ? await s.hooks.postprocess(g) : g;
2246
2262
  })().catch(l);
2247
2263
  try {
2248
2264
  s.hooks && (e = s.hooks.preprocess(e));
@@ -2259,47 +2275,47 @@ ${t}</tr>
2259
2275
  return (n) => {
2260
2276
  if (n.message += `
2261
2277
  Please report this to https://github.com/markedjs/marked.`, t) {
2262
- let r = "<p>An error occurred:</p><pre>" + me(n.message + "", !0) + "</pre>";
2263
- return e ? Promise.resolve(r) : r;
2278
+ let i = "<p>An error occurred:</p><pre>" + be(n.message + "", !0) + "</pre>";
2279
+ return e ? Promise.resolve(i) : i;
2264
2280
  }
2265
2281
  if (e) return Promise.reject(n);
2266
2282
  throw n;
2267
2283
  };
2268
2284
  }
2269
- }, p(Ye, "D"), Ye), Me = new ci();
2270
- function L(a, t) {
2271
- return Me.parse(a, t);
2285
+ }, p(Ye, "D"), Ye), ze = new cr();
2286
+ function O(a, t) {
2287
+ return ze.parse(a, t);
2272
2288
  }
2273
- p(L, "g");
2274
- L.options = L.setOptions = function(a) {
2275
- return Me.setOptions(a), L.defaults = Me.defaults, ds(L.defaults), L;
2289
+ p(O, "g");
2290
+ O.options = O.setOptions = function(a) {
2291
+ return ze.setOptions(a), O.defaults = ze.defaults, fs(O.defaults), O;
2276
2292
  };
2277
- L.getDefaults = nn;
2278
- L.defaults = Le;
2279
- L.use = function(...a) {
2280
- return Me.use(...a), L.defaults = Me.defaults, ds(L.defaults), L;
2293
+ O.getDefaults = rn;
2294
+ O.defaults = Pe;
2295
+ O.use = function(...a) {
2296
+ return ze.use(...a), O.defaults = ze.defaults, fs(O.defaults), O;
2281
2297
  };
2282
- L.walkTokens = function(a, t) {
2283
- return Me.walkTokens(a, t);
2298
+ O.walkTokens = function(a, t) {
2299
+ return ze.walkTokens(a, t);
2284
2300
  };
2285
- L.parseInline = Me.parseInline;
2286
- L.Parser = de;
2287
- L.parser = de.parse;
2288
- L.Renderer = At;
2289
- L.TextRenderer = hn;
2290
- L.Lexer = pe;
2291
- L.lexer = pe.lex;
2292
- L.Tokenizer = St;
2293
- L.Hooks = ut;
2294
- L.parse = L;
2295
- L.options;
2296
- L.setOptions;
2297
- L.use;
2298
- L.walkTokens;
2299
- L.parseInline;
2301
+ O.parseInline = ze.parseInline;
2302
+ O.Parser = de;
2303
+ O.parser = de.parse;
2304
+ O.Renderer = Et;
2305
+ O.TextRenderer = dn;
2306
+ O.Lexer = pe;
2307
+ O.lexer = pe.lex;
2308
+ O.Tokenizer = At;
2309
+ O.Hooks = ut;
2310
+ O.parse = O;
2311
+ O.options;
2312
+ O.setOptions;
2313
+ O.use;
2314
+ O.walkTokens;
2315
+ O.parseInline;
2300
2316
  de.parse;
2301
2317
  pe.lex;
2302
- const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2318
+ const ur = ["innerHTML"], Qt = /* @__PURE__ */ we({
2303
2319
  __name: "ChatRichText",
2304
2320
  props: {
2305
2321
  text: {},
@@ -2307,7 +2323,7 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2307
2323
  streaming: { type: Boolean }
2308
2324
  },
2309
2325
  setup(a) {
2310
- const t = a, e = is(t.text);
2326
+ const t = a, e = as(t.text);
2311
2327
  let n;
2312
2328
  Ze(
2313
2329
  [() => t.text, () => t.streaming],
@@ -2320,11 +2336,11 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2320
2336
  n = void 0, e.value = t.text;
2321
2337
  }));
2322
2338
  }
2323
- ), as(() => {
2339
+ ), ls(() => {
2324
2340
  n !== void 0 && cancelAnimationFrame(n);
2325
2341
  });
2326
- const r = new L.Renderer();
2327
- r.link = ({ href: l, text: o }) => {
2342
+ const i = new O.Renderer();
2343
+ i.link = ({ href: l, text: o }) => {
2328
2344
  let d = !1;
2329
2345
  if (typeof window < "u")
2330
2346
  try {
@@ -2333,23 +2349,23 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2333
2349
  d = !1;
2334
2350
  }
2335
2351
  return d ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
2336
- }, L.setOptions({ breaks: !0, gfm: !0, renderer: r });
2352
+ }, O.setOptions({ breaks: !0, gfm: !0, renderer: i });
2337
2353
  const s = U(() => {
2338
2354
  const l = e.value;
2339
2355
  if (!l) return "";
2340
- const o = L.parse(l, { async: !1 });
2341
- return yr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2356
+ const o = O.parse(l, { async: !1 });
2357
+ return yi.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2342
2358
  });
2343
- return (l, o) => (y(), T("div", {
2344
- class: E(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
2359
+ return (l, o) => (T(), S("div", {
2360
+ class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
2345
2361
  innerHTML: s.value
2346
- }, null, 10, ui));
2362
+ }, null, 10, ur));
2347
2363
  }
2348
- }), hi = 80, pi = /* @__PURE__ */ ke({
2364
+ }), hr = 80, pr = /* @__PURE__ */ we({
2349
2365
  __name: "ChatScroller",
2350
2366
  setup(a, { expose: t }) {
2351
- const e = Y(), n = Y();
2352
- let r = !0, s;
2367
+ const e = Q(), n = Q();
2368
+ let i = !0, s;
2353
2369
  function l() {
2354
2370
  const c = e.value;
2355
2371
  c && (c.scrollTop = c.scrollHeight);
@@ -2357,69 +2373,69 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2357
2373
  p(l, "scrollToBottom");
2358
2374
  function o() {
2359
2375
  const c = e.value;
2360
- c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= hi);
2376
+ c && (i = c.scrollHeight - c.scrollTop - c.clientHeight <= hr);
2361
2377
  }
2362
2378
  p(o, "onScroll");
2363
2379
  function d() {
2364
- r = !0, l();
2380
+ i = !0, l();
2365
2381
  }
2366
- return p(d, "pin"), t({ pin: d }), Et(() => {
2382
+ return p(d, "pin"), t({ pin: d }), _t(() => {
2367
2383
  requestAnimationFrame(() => {
2368
2384
  l(), requestAnimationFrame(l);
2369
2385
  }), n.value && (s = new ResizeObserver(() => {
2370
- r && l();
2386
+ i && l();
2371
2387
  }), s.observe(n.value));
2372
- }), as(() => {
2388
+ }), ls(() => {
2373
2389
  s?.disconnect();
2374
- }), (c, m) => (y(), T("div", {
2390
+ }), (c, g) => (T(), S("div", {
2375
2391
  ref_key: "viewport",
2376
2392
  ref: e,
2377
2393
  class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
2378
2394
  onScrollPassive: o
2379
2395
  }, [
2380
- v("div", {
2396
+ A("div", {
2381
2397
  ref_key: "content",
2382
2398
  ref: n
2383
2399
  }, [
2384
- tn(c.$slots, "default")
2400
+ sn(c.$slots, "default")
2385
2401
  ], 512)
2386
2402
  ], 544));
2387
2403
  }
2388
- }), di = { class: "@container/chat flex flex-col h-full relative" }, fi = {
2404
+ }), dr = { class: "@container/chat flex flex-col h-full relative" }, fr = {
2389
2405
  key: 0,
2390
2406
  class: "pb-4"
2391
- }, gi = { class: "pt-4 pb-[120px] px-3 space-y-1" }, mi = {
2407
+ }, gr = { class: "pt-4 pb-[120px] px-3 space-y-1" }, mr = {
2392
2408
  key: 0,
2393
2409
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2394
- }, xi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, bi = ["src", "alt"], ki = {
2410
+ }, xr = { class: "relative mb-4 size-20 @sm/chat:size-24" }, br = ["src", "alt"], kr = {
2395
2411
  key: 0,
2396
2412
  class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
2397
- }, wi = ["onClick"], vi = ["title"], yi = {
2413
+ }, vr = ["onClick"], wr = ["title"], yr = {
2398
2414
  key: 1,
2399
2415
  class: "flex justify-end px-2 pb-2"
2400
- }, Ti = {
2416
+ }, Tr = {
2401
2417
  key: 0,
2402
2418
  class: "flex items-center gap-3 py-3 px-2"
2403
- }, Si = ["data-issue-code", "data-issue-bucket"], Ai = { class: "flex flex-col gap-1 min-w-0 system-msg-content" }, Ei = ["href"], _i = ["data-test"], Ri = {
2419
+ }, Sr = ["data-issue-code", "data-issue-bucket"], Ar = { class: "max-w-[85%] min-w-0" }, Er = ["href"], _r = ["data-test"], Rr = {
2404
2420
  key: 0,
2405
2421
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2406
- }, Ci = ["src", "alt"], Ii = ["src", "alt"], Di = ["src"], Mi = ["href"], Li = {
2422
+ }, Cr = ["src", "alt"], Ir = ["src", "alt"], Dr = ["src"], Mr = ["href"], Lr = {
2407
2423
  key: 2,
2408
2424
  "data-test": "messaging-thinking-indicator",
2409
2425
  class: "flex gap-2 justify-start items-center mb-4"
2410
- }, Oi = ["src", "alt"], zi = {
2426
+ }, Or = ["src", "alt"], zr = {
2411
2427
  key: 0,
2412
2428
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
2413
- }, Pi = ["src", "alt"], Ni = { class: "max-w-20 truncate" }, $i = ["onClick"], Ui = {
2429
+ }, Pr = ["src", "alt"], Nr = { class: "max-w-20 truncate" }, $r = ["onClick"], Ur = {
2414
2430
  key: 0,
2415
2431
  class: "shrink-0 flex items-center justify-center size-14"
2416
- }, Bi = ["disabled"], Fi = {
2432
+ }, Br = ["disabled"], Fr = {
2417
2433
  key: 0,
2418
2434
  class: "i-svg-spinners-ring-resize size-4"
2419
- }, Hi = {
2435
+ }, Hr = {
2420
2436
  key: 1,
2421
2437
  class: "i-tabler-paperclip size-5"
2422
- }, Gi = ["placeholder", "disabled"], ji = ["disabled"], na = /* @__PURE__ */ ke({
2438
+ }, Gr = ["placeholder", "disabled"], jr = ["disabled"], na = /* @__PURE__ */ we({
2423
2439
  __name: "ElAgentChat",
2424
2440
  props: {
2425
2441
  chatController: {},
@@ -2443,304 +2459,329 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2443
2459
  "What's on my plate this week"
2444
2460
  ], n = U(
2445
2461
  () => a.starterPrompts ?? e
2446
- ), r = U(() => {
2447
- const C = { ...t[a.scope] };
2448
- return a.scope === "org" && a.scopeName && (C.label = a.scopeName, C.tooltip = `Visible to ${a.scopeName} members`), C;
2449
- }), s = Y(""), l = Y(!1), o = Y(), d = Y(), c = Y(), m = Y([]), u = Y(!1);
2450
- function g(C) {
2451
- return C ? /\[[^\]]+\]\([^)]+\)/.test(C) : !1;
2452
- }
2453
- p(g, "containsMarkdownLink");
2454
- function x(C, f) {
2455
- const w = C[f], M = C[f + 1];
2456
- return !M || M.sender !== w.sender;
2457
- }
2458
- p(x, "shouldShowAvatar");
2459
- const k = U(() => a.chatController?.textState.value), _ = U(() => k.value?.isConnected ?? !1), z = U(() => k.value?.isThinking ?? !1), te = U(() => k.value?.connectionStatus === "disconnected" && !!k.value?.error), oe = U(() => k.value?.connectionStatus !== "connected" && !k.value?.error), se = U(() => k.value?.error), O = U(() => a.chatController?.sharedMessages.value ?? []), ce = U(() => {
2462
+ ), i = U(() => {
2463
+ const k = { ...t[a.scope] };
2464
+ return a.scope === "org" && a.scopeName && (k.label = a.scopeName, k.tooltip = `Visible to ${a.scopeName} members`), k;
2465
+ }), s = Q(""), l = Q(!1), o = Q(), d = Q(), c = Q(), g = Q([]), u = Q(!1);
2466
+ function w(k) {
2467
+ return k ? /\[[^\]]+\]\([^)]+\)/.test(k) : !1;
2468
+ }
2469
+ p(w, "containsMarkdownLink");
2470
+ function v(k) {
2471
+ return k.sender === "system" && (!!k.issue || k.id === te.value);
2472
+ }
2473
+ p(v, "isSystemExplainerMessage");
2474
+ function f(k, m) {
2475
+ const x = k[m], M = k[m + 1];
2476
+ return !M || M.sender !== x.sender;
2477
+ }
2478
+ p(f, "shouldShowAvatar");
2479
+ const y = U(() => a.chatController?.textState.value), C = U(() => y.value?.isConnected ?? !1), z = U(() => y.value?.isThinking ?? !1), Z = U(() => y.value?.connectionStatus === "disconnected" && !!y.value?.error), ie = U(() => y.value?.connectionStatus !== "connected" && !y.value?.error), N = U(() => y.value?.error), W = U(() => a.chatController?.sharedMessages.value ?? []), te = U(() => {
2460
2480
  if (!z.value) return;
2461
- const C = O.value, f = C[C.length - 1];
2462
- return f?.sender === "agent" ? f.id : void 0;
2463
- }), re = U(() => z.value ? ce.value === void 0 : !1), ie = U(() => k.value?.accountGated ?? !1), Ee = U(() => !_.value || ie.value), Ct = U(() => te.value ? "Agent is offline" : oe.value ? "Connecting..." : ie.value ? "Resolve the billing issue above to continue" : "Message"), pt = U(() => (s.value.trim() || m.value.length > 0) && !Ee.value && !u.value), A = U(() => a.variant === "light"), _e = U(
2464
- () => A.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2465
- ), we = U(() => A.value ? "text-theme-300" : "text-white/30");
2466
- Et(async () => {
2467
- a.chatController && !_.value && await a.chatController.startTextConversation();
2481
+ const k = W.value, m = k[k.length - 1];
2482
+ return m?.sender === "agent" || m?.sender === "system" ? m.id : void 0;
2483
+ }), fe = U(() => z.value ? te.value === void 0 : !1), Re = U(() => y.value?.accountGated ?? !1), ke = U(() => !C.value || Re.value), It = U(() => Z.value ? "Agent is offline" : ie.value ? "Connecting..." : Re.value ? "Resolve the billing issue above to continue" : "Message"), V = U(() => (s.value.trim() || g.value.length > 0) && !ke.value && !u.value), I = U(() => a.variant === "light"), Ce = U(
2484
+ () => I.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2485
+ ), ye = U(() => I.value ? "text-theme-300" : "text-white/30");
2486
+ _t(async () => {
2487
+ a.chatController && !C.value && await a.chatController.startTextConversation();
2468
2488
  });
2469
- function Oe() {
2489
+ function Dt() {
2470
2490
  a.chatController?.newConversation();
2471
2491
  }
2472
- p(Oe, "startNewConversation");
2492
+ p(Dt, "startNewConversation");
2473
2493
  async function Ke() {
2474
- const C = s.value.trim(), f = m.value.length > 0;
2475
- if (!C && !f || !a.chatController || !_.value || u.value)
2494
+ const k = s.value.trim(), m = g.value.length > 0;
2495
+ if (!k && !m || !a.chatController || !C.value || u.value)
2476
2496
  return;
2477
- const w = s.value, M = f ? [...m.value] : void 0;
2478
- s.value = "", m.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(w, M);
2497
+ const x = s.value, M = m ? [...g.value] : void 0;
2498
+ s.value = "", g.value = [], d.value && (d.value.style.height = "auto", d.value.focus()), o.value?.pin(), await a.chatController.sendChatMessage(x, M);
2479
2499
  }
2480
2500
  p(Ke, "sendMessage");
2481
- async function It(C) {
2482
- Ee.value || (s.value = C, await Ke());
2501
+ async function Mt(k) {
2502
+ ke.value || (s.value = k, await Ke());
2483
2503
  }
2484
- p(It, "sendStarterPrompt");
2485
- async function Dt(C) {
2486
- C.key === "Enter" && !C.shiftKey && (C.preventDefault(), await Ke());
2504
+ p(Mt, "sendStarterPrompt");
2505
+ async function pt(k) {
2506
+ k.key === "Enter" && !k.shiftKey && (k.preventDefault(), await Ke());
2487
2507
  }
2488
- p(Dt, "handleKeydown");
2489
- function dt() {
2508
+ p(pt, "handleKeydown");
2509
+ function Lt() {
2490
2510
  d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
2491
2511
  }
2492
- p(dt, "adjustTextareaHeight"), Ze(s, () => Ds(() => dt()));
2493
- function Mt() {
2512
+ p(Lt, "adjustTextareaHeight"), Ze(s, () => Ms(() => Lt()));
2513
+ function dt() {
2494
2514
  c.value?.click();
2495
2515
  }
2496
- p(Mt, "triggerFileInput");
2497
- async function ft(C) {
2498
- const f = C.target, w = f.files?.[0];
2499
- if (!(!w || !a.uploadFn)) {
2516
+ p(dt, "triggerFileInput");
2517
+ async function F(k) {
2518
+ const m = k.target, x = m.files?.[0];
2519
+ if (!(!x || !a.uploadFn)) {
2500
2520
  u.value = !0;
2501
2521
  try {
2502
- const M = await a.uploadFn(w);
2503
- m.value = [...m.value, M];
2522
+ const M = await a.uploadFn(x);
2523
+ g.value = [...g.value, M];
2504
2524
  } catch (M) {
2505
- const N = M instanceof Error ? M.message : "Couldn't attach that file.";
2506
- a.chatController?.notify(`Upload failed — ${N}`);
2525
+ const X = M instanceof Error ? M.message : "Couldn't attach that file.";
2526
+ a.chatController?.notify(`Upload failed — ${X}`);
2507
2527
  } finally {
2508
- u.value = !1, f.value = "";
2528
+ u.value = !1, m.value = "";
2509
2529
  }
2510
2530
  }
2511
2531
  }
2512
- p(ft, "handleFileSelect");
2513
- function F(C) {
2514
- m.value = m.value.filter((f, w) => w !== C);
2532
+ p(F, "handleFileSelect");
2533
+ function ft(k) {
2534
+ g.value = g.value.filter((m, x) => x !== k);
2515
2535
  }
2516
- p(F, "removeAttachment");
2517
- function Qe(C, f) {
2518
- if (f === 0) {
2519
- const Pe = C[f];
2520
- return Pe?.timestamp ? H(new Date(Pe.timestamp)) : null;
2536
+ p(ft, "removeAttachment");
2537
+ function H(k, m) {
2538
+ if (m === 0) {
2539
+ const Ne = k[m];
2540
+ return Ne?.timestamp ? Qe(new Date(Ne.timestamp)) : null;
2521
2541
  }
2522
- const w = C[f - 1], M = C[f];
2523
- if (!w?.timestamp || !M?.timestamp) return null;
2524
- const N = new Date(w.timestamp).getTime();
2525
- return new Date(M.timestamp).getTime() - N > 36e5 ? H(new Date(M.timestamp)) : null;
2542
+ const x = k[m - 1], M = k[m];
2543
+ if (!x?.timestamp || !M?.timestamp) return null;
2544
+ const X = new Date(x.timestamp).getTime();
2545
+ return new Date(M.timestamp).getTime() - X > 36e5 ? Qe(new Date(M.timestamp)) : null;
2526
2546
  }
2527
- p(Qe, "shouldShowTimeDivider");
2528
- function H(C) {
2529
- const f = /* @__PURE__ */ new Date(), w = C.toDateString() === f.toDateString(), M = new Date(f);
2547
+ p(H, "shouldShowTimeDivider");
2548
+ function Qe(k) {
2549
+ const m = /* @__PURE__ */ new Date(), x = k.toDateString() === m.toDateString(), M = new Date(m);
2530
2550
  M.setDate(M.getDate() - 1);
2531
- const N = C.toDateString() === M.toDateString(), xe = C.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2532
- if (w) return xe;
2533
- if (N) return `Yesterday, ${xe}`;
2534
- const ze = C.getFullYear() === f.getFullYear();
2535
- return `${C.toLocaleDateString("en-US", {
2551
+ const X = k.toDateString() === M.toDateString(), ge = k.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2552
+ if (x) return ge;
2553
+ if (X) return `Yesterday, ${ge}`;
2554
+ const Je = k.getFullYear() === m.getFullYear();
2555
+ return `${k.toLocaleDateString("en-US", {
2536
2556
  weekday: "long",
2537
2557
  month: "short",
2538
2558
  day: "numeric",
2539
- ...ze ? {} : { year: "numeric" }
2540
- })}, ${xe}`;
2559
+ ...Je ? {} : { year: "numeric" }
2560
+ })}, ${ge}`;
2541
2561
  }
2542
- return p(H, "formatTimeDivider"), (C, f) => (y(), T("div", di, [
2543
- A.value ? B("", !0) : (y(), T("div", fi, [
2544
- Fe(Ks, {
2562
+ return p(Qe, "formatTimeDivider"), (k, m) => (T(), S("div", dr, [
2563
+ I.value ? B("", !0) : (T(), S("div", fr, [
2564
+ Le(Ks, {
2545
2565
  agent: a.agent,
2546
- "is-online": _.value
2566
+ "is-online": C.value
2547
2567
  }, null, 8, ["agent", "is-online"])
2548
2568
  ])),
2549
- te.value ? (y(), T("div", {
2569
+ Z.value ? (T(), S("div", {
2550
2570
  key: 1,
2551
- class: E(["py-16 flex flex-col items-center justify-center gap-3 text-sm", A.value ? "text-theme-400" : "text-white/60"])
2571
+ class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", I.value ? "text-theme-400" : "text-white/60"])
2552
2572
  }, [
2553
- v("i", {
2554
- class: E(["i-heroicons-cloud-arrow-down size-8", A.value ? "text-theme-300" : "text-white/40"])
2573
+ A("i", {
2574
+ class: _(["i-heroicons-cloud-arrow-down size-8", I.value ? "text-theme-300" : "text-white/40"])
2555
2575
  }, null, 2),
2556
- v("span", null, ne(se.value), 1)
2557
- ], 2)) : oe.value ? (y(), T("div", {
2576
+ A("span", null, le(N.value), 1)
2577
+ ], 2)) : ie.value ? (T(), S("div", {
2558
2578
  key: 2,
2559
- class: E(["py-16 flex flex-col items-center justify-center gap-2 text-sm", A.value ? "text-theme-400" : "text-theme-600"])
2579
+ class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", I.value ? "text-theme-400" : "text-theme-600"])
2560
2580
  }, [
2561
- Fe(Ln, { class: "size-4" })
2562
- ], 2)) : a.setupHint ? (y(), T("div", {
2581
+ Le(zn, { class: "size-4" })
2582
+ ], 2)) : a.setupHint ? (T(), S("div", {
2563
2583
  key: 3,
2564
- class: E(["flex items-center justify-center gap-1.5 py-2 text-[11px]", we.value])
2584
+ class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ye.value])
2565
2585
  }, [
2566
- f[6] || (f[6] = v("i", { class: "i-tabler-tool size-3" }, null, -1)),
2567
- v("span", null, ne(a.setupHint), 1)
2586
+ m[9] || (m[9] = A("i", { class: "i-tabler-tool size-3" }, null, -1)),
2587
+ A("span", null, le(a.setupHint), 1)
2568
2588
  ], 2)) : B("", !0),
2569
- Fe(pi, {
2589
+ Le(pr, {
2570
2590
  ref_key: "chatScroller",
2571
2591
  ref: o,
2572
2592
  class: "flex-1"
2573
2593
  }, {
2574
- default: Ms(() => [
2575
- v("div", gi, [
2576
- O.value.length === 0 && !oe.value && !te.value ? (y(), T("div", mi, [
2577
- v("div", xi, [
2578
- v("img", {
2594
+ default: Ls(() => [
2595
+ A("div", gr, [
2596
+ W.value.length === 0 && !ie.value && !Z.value ? (T(), S("div", mr, [
2597
+ A("div", xr, [
2598
+ A("img", {
2579
2599
  src: a.agent.avatarUrl.value,
2580
2600
  alt: a.agent.displayName.value,
2581
- class: E(["size-full rounded-full object-cover ring-1", A.value ? "ring-black/5" : "ring-white/10"])
2582
- }, null, 10, bi),
2583
- _.value ? (y(), T("span", {
2601
+ class: _(["size-full rounded-full object-cover ring-1", I.value ? "ring-black/5" : "ring-white/10"])
2602
+ }, null, 10, br),
2603
+ C.value ? (T(), S("span", {
2584
2604
  key: 0,
2585
- class: E(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", A.value ? "bg-white" : "bg-theme-900"])
2586
- }, [...f[7] || (f[7] = [
2587
- v("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2605
+ class: _(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", I.value ? "bg-white" : "bg-theme-900"])
2606
+ }, [...m[10] || (m[10] = [
2607
+ A("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2588
2608
  ])], 2)) : B("", !0)
2589
2609
  ]),
2590
- v("div", {
2591
- class: E(["text-base @sm/chat:text-lg font-semibold", A.value ? "text-theme-900" : "text-white"])
2592
- }, ne(a.agent.displayName.value), 3),
2593
- v("p", {
2594
- class: E(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
2595
- }, ne(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2596
- n.value.length > 0 && !Ee.value ? (y(), T("div", ki, [
2597
- (y(!0), T(ye, null, ot(n.value, (w) => (y(), T("button", {
2598
- key: w,
2610
+ A("div", {
2611
+ class: _(["text-base @sm/chat:text-lg font-semibold", I.value ? "text-theme-900" : "text-white"])
2612
+ }, le(a.agent.displayName.value), 3),
2613
+ A("p", {
2614
+ class: _(["mt-1 text-center text-xs @sm/chat:text-sm", ye.value])
2615
+ }, le(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2616
+ n.value.length > 0 && !ke.value ? (T(), S("div", kr, [
2617
+ (T(!0), S(Se, null, ot(n.value, (x) => (T(), S("button", {
2618
+ key: x,
2599
2619
  type: "button",
2600
2620
  "data-test": "chat-starter-prompt",
2601
- class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", A.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
2602
- onClick: /* @__PURE__ */ p((M) => It(w), "onClick")
2603
- }, ne(w), 11, wi))), 128))
2621
+ class: _(["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"]),
2622
+ onClick: /* @__PURE__ */ p((M) => Mt(x), "onClick")
2623
+ }, le(x), 11, vr))), 128))
2604
2624
  ])) : B("", !0),
2605
- v("div", {
2606
- class: E(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", A.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2607
- title: r.value.tooltip
2625
+ A("div", {
2626
+ class: _(["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"]),
2627
+ title: i.value.tooltip
2608
2628
  }, [
2609
- v("i", {
2610
- class: E([r.value.icon, "size-3"])
2629
+ A("i", {
2630
+ class: _([i.value.icon, "size-3"])
2611
2631
  }, null, 2),
2612
- v("span", null, ne(r.value.label), 1)
2613
- ], 10, vi)
2632
+ A("span", null, le(i.value.label), 1)
2633
+ ], 10, wr)
2614
2634
  ])) : B("", !0),
2615
- O.value.length > 0 ? (y(), T("div", yi, [
2616
- v("button", {
2635
+ W.value.length > 0 ? (T(), S("div", yr, [
2636
+ A("button", {
2617
2637
  type: "button",
2618
2638
  "data-test": "chat-new-session",
2619
- class: E(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", A.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2620
- onClick: Oe
2621
- }, [...f[8] || (f[8] = [
2622
- v("i", { class: "i-tabler-refresh size-3" }, null, -1),
2623
- v("span", null, "New chat", -1)
2639
+ class: _(["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"]),
2640
+ onClick: Dt
2641
+ }, [...m[11] || (m[11] = [
2642
+ A("i", { class: "i-tabler-refresh size-3" }, null, -1),
2643
+ A("span", null, "New chat", -1)
2624
2644
  ])], 2)
2625
2645
  ])) : B("", !0),
2626
- (y(!0), T(ye, null, ot(O.value, (w, M) => (y(), T(ye, {
2627
- key: w.id
2646
+ (T(!0), S(Se, null, ot(W.value, (x, M) => (T(), S(Se, {
2647
+ key: x.id
2628
2648
  }, [
2629
- Qe(O.value, M) ? (y(), T("div", Ti, [
2630
- v("div", {
2631
- class: E(["flex-1 h-px", _e.value])
2649
+ H(W.value, M) ? (T(), S("div", Tr, [
2650
+ A("div", {
2651
+ class: _(["flex-1 h-px", Ce.value])
2632
2652
  }, null, 2),
2633
- v("span", {
2634
- class: E(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
2635
- }, ne(Qe(O.value, M)), 3),
2636
- v("div", {
2637
- class: E(["flex-1 h-px", _e.value])
2653
+ A("span", {
2654
+ class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ye.value])
2655
+ }, le(H(W.value, M)), 3),
2656
+ A("div", {
2657
+ class: _(["flex-1 h-px", Ce.value])
2638
2658
  }, null, 2)
2639
2659
  ])) : B("", !0),
2640
- w.sender === "system" ? (y(), T("div", {
2660
+ v(x) ? (T(), S("div", {
2641
2661
  key: 1,
2642
2662
  "data-test": "messaging-system-msg",
2643
- "data-issue-code": w.issue?.code,
2644
- "data-issue-bucket": w.issue?.bucket,
2645
- class: E(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", A.value ? "text-theme-500" : "text-white/70"])
2663
+ "data-issue-code": x.issue?.code,
2664
+ "data-issue-bucket": x.issue?.bucket,
2665
+ class: "flex gap-2 items-end justify-start mb-4"
2646
2666
  }, [
2647
- v("i", {
2648
- class: E(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", w.issue?.bucket === "account" ? A.value ? "text-amber-500" : "text-amber-300" : A.value ? "text-red-500" : "text-red-300"])
2649
- }, null, 2),
2650
- v("div", Ai, [
2651
- Fe(ns, {
2652
- text: w.text,
2653
- inverted: !A.value
2654
- }, null, 8, ["text", "inverted"]),
2655
- w.issue?.help ? (y(), T("span", {
2656
- key: 0,
2657
- class: E(["text-[12px]", A.value ? "text-theme-400" : "text-white/55"])
2658
- }, ne(w.issue.help), 3)) : B("", !0),
2659
- w.issue?.actionUrl && !g(w.text) ? (y(), T("a", {
2660
- key: 1,
2661
- href: w.issue.actionUrl,
2662
- "data-test": "messaging-system-msg-action",
2663
- class: E(["text-[12px] font-medium inline-flex items-center gap-1", A.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2667
+ A("div", Ar, [
2668
+ A("div", {
2669
+ class: _(["mb-1 pl-1 text-[11px] font-medium", I.value ? "text-theme-500" : "text-white/45"])
2670
+ }, " System Message ", 2),
2671
+ A("div", {
2672
+ class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content italic", I.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
2664
2673
  }, [
2665
- nt(ne(w.issue.actionLabel) + " ", 1),
2666
- f[9] || (f[9] = v("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2667
- ], 10, Ei)) : B("", !0)
2674
+ Le(Qt, {
2675
+ text: x.text,
2676
+ inverted: !I.value,
2677
+ streaming: x.id === te.value,
2678
+ onClick: m[0] || (m[0] = kt(() => {
2679
+ }, ["stop"]))
2680
+ }, null, 8, ["text", "inverted", "streaming"]),
2681
+ x.issue?.help ? (T(), S("span", {
2682
+ key: 0,
2683
+ class: _(["mt-1.5 block text-[12px]", I.value ? "text-theme-500" : "text-white/55"])
2684
+ }, le(x.issue.help), 3)) : B("", !0),
2685
+ x.issue?.actionUrl && !w(x.text) ? (T(), S("a", {
2686
+ key: 1,
2687
+ href: x.issue.actionUrl,
2688
+ "data-test": "messaging-system-msg-action",
2689
+ class: _(["mt-2 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"]),
2690
+ onClick: m[1] || (m[1] = kt(() => {
2691
+ }, ["stop"]))
2692
+ }, [
2693
+ On(le(x.issue.actionLabel) + " ", 1),
2694
+ m[12] || (m[12] = A("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2695
+ ], 10, Er)) : B("", !0)
2696
+ ], 2)
2668
2697
  ])
2669
- ], 10, Si)) : (y(), T("div", {
2698
+ ], 8, Sr)) : x.sender === "system" ? (T(), S("div", {
2670
2699
  key: 2,
2671
- "data-test": w.sender === "agent" ? "messaging-assistant-msg" : w.sender === "user" ? "messaging-user-msg" : void 0,
2672
- class: E(["flex gap-2 items-end", {
2673
- "justify-end": w.sender === "user",
2674
- "justify-start": w.sender === "agent",
2675
- "mb-4": x(O.value, M)
2700
+ "data-test": "messaging-system-status-msg",
2701
+ class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", I.value ? "text-theme-500" : "text-white/60"])
2702
+ }, [
2703
+ m[13] || (m[13] = A("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
2704
+ Le(Qt, {
2705
+ text: x.text,
2706
+ inverted: !I.value,
2707
+ onClick: m[2] || (m[2] = kt(() => {
2708
+ }, ["stop"]))
2709
+ }, null, 8, ["text", "inverted"])
2710
+ ], 2)) : (T(), S("div", {
2711
+ key: 3,
2712
+ "data-test": x.sender === "agent" ? "messaging-assistant-msg" : x.sender === "user" ? "messaging-user-msg" : void 0,
2713
+ class: _(["flex gap-2 items-end", {
2714
+ "justify-end": x.sender === "user",
2715
+ "justify-start": x.sender === "agent",
2716
+ "mb-4": f(W.value, M)
2676
2717
  }])
2677
2718
  }, [
2678
- w.sender === "agent" ? (y(), T("div", Ri, [
2679
- x(O.value, M) ? (y(), T("img", {
2719
+ x.sender === "agent" ? (T(), S("div", Rr, [
2720
+ f(W.value, M) ? (T(), S("img", {
2680
2721
  key: 0,
2681
2722
  src: a.agent.avatarUrl.value,
2682
2723
  alt: a.agent.displayName.value,
2683
- class: E(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", A.value ? "ring-1 ring-black/5" : ""])
2684
- }, null, 10, Ci)) : B("", !0)
2724
+ class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2725
+ }, null, 10, Cr)) : B("", !0)
2685
2726
  ])) : B("", !0),
2686
- v("div", {
2687
- class: E(w.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2727
+ A("div", {
2728
+ class: _(x.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2688
2729
  }, [
2689
- w.attachments?.length ? (y(), T("div", {
2730
+ x.attachments?.length ? (T(), S("div", {
2690
2731
  key: 0,
2691
- class: E(["mb-1 space-y-1", w.sender === "user" ? "flex flex-col items-end" : ""])
2732
+ class: _(["mb-1 space-y-1", x.sender === "user" ? "flex flex-col items-end" : ""])
2692
2733
  }, [
2693
- (y(!0), T(ye, null, ot(w.attachments, (N, xe) => (y(), T(ye, { key: xe }, [
2694
- N.type === "image" ? (y(), T("img", {
2734
+ (T(!0), S(Se, null, ot(x.attachments, (X, ge) => (T(), S(Se, { key: ge }, [
2735
+ X.type === "image" ? (T(), S("img", {
2695
2736
  key: 0,
2696
- src: N.url,
2697
- alt: N.name,
2737
+ src: X.url,
2738
+ alt: X.name,
2698
2739
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2699
- }, null, 8, Ii)) : N.type === "audio" ? (y(), T("audio", {
2740
+ }, null, 8, Ir)) : X.type === "audio" ? (T(), S("audio", {
2700
2741
  key: 1,
2701
- src: N.url,
2742
+ src: X.url,
2702
2743
  controls: "",
2703
2744
  class: "max-w-full"
2704
- }, null, 8, Di)) : (y(), T("a", {
2745
+ }, null, 8, Dr)) : (T(), S("a", {
2705
2746
  key: 2,
2706
- href: N.url,
2747
+ href: X.url,
2707
2748
  target: "_blank",
2708
2749
  rel: "noopener",
2709
- class: E(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", A.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2750
+ class: _(["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"])
2710
2751
  }, [
2711
- f[10] || (f[10] = v("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2712
- nt(" " + ne(N.name), 1)
2713
- ], 10, Mi))
2752
+ m[14] || (m[14] = A("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2753
+ On(" " + le(X.name), 1)
2754
+ ], 10, Mr))
2714
2755
  ], 64))), 128))
2715
2756
  ], 2)) : B("", !0),
2716
- w.text ? (y(), T("div", {
2757
+ x.text ? (T(), S("div", {
2717
2758
  key: 1,
2718
- class: E(["rounded-2xl px-3.5 py-2", [
2719
- w.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : A.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2759
+ class: _(["rounded-2xl px-3.5 py-2", [
2760
+ 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]"
2720
2761
  ]])
2721
2762
  }, [
2722
- Fe(ns, {
2723
- text: w.text,
2724
- inverted: w.sender === "user" || !A.value,
2725
- streaming: w.id === ce.value,
2726
- onClick: f[0] || (f[0] = Ls(() => {
2763
+ Le(Qt, {
2764
+ text: x.text,
2765
+ inverted: x.sender === "user" || !I.value,
2766
+ streaming: x.id === te.value,
2767
+ onClick: m[3] || (m[3] = kt(() => {
2727
2768
  }, ["stop"]))
2728
2769
  }, null, 8, ["text", "inverted", "streaming"])
2729
2770
  ], 2)) : B("", !0)
2730
2771
  ], 2)
2731
- ], 10, _i))
2772
+ ], 10, _r))
2732
2773
  ], 64))), 128)),
2733
- re.value ? (y(), T("div", Li, [
2734
- v("img", {
2774
+ fe.value ? (T(), S("div", Lr, [
2775
+ A("img", {
2735
2776
  src: a.agent.avatarUrl.value,
2736
2777
  alt: a.agent.displayName.value,
2737
- class: E(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", A.value ? "ring-1 ring-black/5" : ""])
2738
- }, null, 10, Oi),
2739
- v("div", {
2740
- class: E(["rounded-2xl px-3.5 py-2.5 flex items-center", A.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2778
+ class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2779
+ }, null, 10, Or),
2780
+ A("div", {
2781
+ class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", I.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2741
2782
  }, [
2742
- v("i", {
2743
- class: E(["i-svg-spinners-3-dots-bounce size-7", A.value ? "text-theme-400" : "text-white/50"])
2783
+ A("i", {
2784
+ class: _(["i-svg-spinners-3-dots-bounce size-7", I.value ? "text-theme-400" : "text-white/50"])
2744
2785
  }, null, 2)
2745
2786
  ], 2)
2746
2787
  ])) : B("", !0)
@@ -2748,106 +2789,93 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2748
2789
  ]),
2749
2790
  _: 1
2750
2791
  }, 512),
2751
- v("div", {
2752
- class: E(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", A.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2792
+ A("div", {
2793
+ class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", I.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2753
2794
  }, [
2754
- m.value.length > 0 ? (y(), T("div", zi, [
2755
- (y(!0), T(ye, null, ot(m.value, (w, M) => (y(), T("div", {
2795
+ g.value.length > 0 ? (T(), S("div", zr, [
2796
+ (T(!0), S(Se, null, ot(g.value, (x, M) => (T(), S("div", {
2756
2797
  key: M,
2757
2798
  class: "relative shrink-0 group"
2758
2799
  }, [
2759
- w.type === "image" ? (y(), T("img", {
2800
+ x.type === "image" ? (T(), S("img", {
2760
2801
  key: 0,
2761
- src: w.url,
2762
- alt: w.name,
2763
- class: E(["size-14 rounded-xl object-cover border", A.value ? "border-black/10" : "border-white/20"])
2764
- }, null, 10, Pi)) : (y(), T("div", {
2802
+ src: x.url,
2803
+ alt: x.name,
2804
+ class: _(["size-14 rounded-xl object-cover border", I.value ? "border-black/10" : "border-white/20"])
2805
+ }, null, 10, Pr)) : (T(), S("div", {
2765
2806
  key: 1,
2766
- class: E(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", A.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2807
+ class: _(["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"])
2767
2808
  }, [
2768
- f[11] || (f[11] = v("i", { class: "i-tabler-file size-4" }, null, -1)),
2769
- v("span", Ni, ne(w.name), 1)
2809
+ m[15] || (m[15] = A("i", { class: "i-tabler-file size-4" }, null, -1)),
2810
+ A("span", Nr, le(x.name), 1)
2770
2811
  ], 2)),
2771
- v("button", {
2812
+ A("button", {
2772
2813
  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",
2773
- onClick: /* @__PURE__ */ p((N) => F(M), "onClick")
2774
- }, [...f[12] || (f[12] = [
2775
- v("i", { class: "i-tabler-x size-3" }, null, -1)
2776
- ])], 8, $i)
2814
+ onClick: /* @__PURE__ */ p((X) => ft(M), "onClick")
2815
+ }, [...m[16] || (m[16] = [
2816
+ A("i", { class: "i-tabler-x size-3" }, null, -1)
2817
+ ])], 8, $r)
2777
2818
  ]))), 128)),
2778
- u.value ? (y(), T("div", Ui, [
2779
- Fe(Ln, { class: "size-5" })
2819
+ u.value ? (T(), S("div", Ur, [
2820
+ Le(zn, { class: "size-5" })
2780
2821
  ])) : B("", !0)
2781
2822
  ])) : B("", !0),
2782
- a.uploadFn ? (y(), T("input", {
2823
+ a.uploadFn ? (T(), S("input", {
2783
2824
  key: 1,
2784
2825
  ref_key: "fileInput",
2785
2826
  ref: c,
2786
2827
  type: "file",
2787
2828
  accept: "image/*,audio/*,video/*",
2788
2829
  class: "hidden",
2789
- onChange: ft
2830
+ onChange: F
2790
2831
  }, null, 544)) : B("", !0),
2791
- v("div", {
2792
- class: E(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", A.value ? l.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : l.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2832
+ A("div", {
2833
+ class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", I.value ? l.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : l.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2793
2834
  }, [
2794
- v("button", {
2795
- class: E(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2835
+ A("button", {
2836
+ class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2796
2837
  a.uploadFn ? "cursor-pointer" : "cursor-default",
2797
- A.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2838
+ I.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2798
2839
  u.value ? "opacity-50 pointer-events-none" : ""
2799
2840
  ]]),
2800
- disabled: Ee.value || u.value || !a.uploadFn,
2801
- onClick: f[1] || (f[1] = (w) => a.uploadFn && Mt())
2841
+ disabled: ke.value || u.value || !a.uploadFn,
2842
+ onClick: m[4] || (m[4] = (x) => a.uploadFn && dt())
2802
2843
  }, [
2803
- u.value ? (y(), T("i", Fi)) : (y(), T("i", Hi))
2804
- ], 10, Bi),
2805
- ss(v("textarea", {
2844
+ u.value ? (T(), S("i", Fr)) : (T(), S("i", Hr))
2845
+ ], 10, Br),
2846
+ is(A("textarea", {
2806
2847
  ref_key: "textarea",
2807
2848
  ref: d,
2808
- "onUpdate:modelValue": f[2] || (f[2] = (w) => s.value = w),
2849
+ "onUpdate:modelValue": m[5] || (m[5] = (x) => s.value = x),
2809
2850
  "data-test": "messaging-input",
2810
2851
  rows: "1",
2811
2852
  enterkeyhint: "send",
2812
- placeholder: Ct.value,
2813
- disabled: Ee.value,
2853
+ placeholder: It.value,
2854
+ disabled: ke.value,
2814
2855
  style: { fontSize: "16px", resize: "none" },
2815
- class: E(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", A.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2816
- onKeydown: Dt,
2817
- onFocus: f[3] || (f[3] = (w) => l.value = !0),
2818
- onBlur: f[4] || (f[4] = (w) => l.value = !1)
2819
- }, null, 42, Gi), [
2856
+ class: _(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", I.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2857
+ onKeydown: pt,
2858
+ onFocus: m[6] || (m[6] = (x) => l.value = !0),
2859
+ onBlur: m[7] || (m[7] = (x) => l.value = !1)
2860
+ }, null, 42, Gr), [
2820
2861
  [rs, s.value]
2821
2862
  ]),
2822
- v("button", {
2863
+ A("button", {
2823
2864
  "data-test": "messaging-send-btn",
2824
- class: E(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", pt.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : A.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2825
- disabled: !pt.value,
2826
- onClick: f[5] || (f[5] = (w) => Ke())
2827
- }, [...f[13] || (f[13] = [
2828
- v("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2829
- ])], 10, ji)
2830
- ], 2),
2831
- v("div", {
2832
- class: E(["text-[10px] text-center mt-2.5 select-none opacity-70", A.value ? "text-theme-400" : "text-white/50"])
2833
- }, [
2834
- f[14] || (f[14] = nt(" Press ", -1)),
2835
- v("kbd", {
2836
- class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", A.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2837
- }, "Enter", 2),
2838
- f[15] || (f[15] = nt(" to send, ", -1)),
2839
- v("kbd", {
2840
- class: E(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", A.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2841
- }, "Shift+Enter", 2),
2842
- f[16] || (f[16] = nt(" for new line ", -1))
2865
+ class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", V.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2866
+ disabled: !V.value,
2867
+ onClick: m[8] || (m[8] = (x) => Ke())
2868
+ }, [...m[17] || (m[17] = [
2869
+ A("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2870
+ ])], 10, jr)
2843
2871
  ], 2)
2844
2872
  ], 2)
2845
2873
  ]));
2846
2874
  }
2847
- }), Wi = { class: "agent-wrap" }, qi = {
2875
+ }), Wr = { class: "agent-wrap" }, qr = {
2848
2876
  key: 0,
2849
2877
  class: "flex items-center justify-center h-full"
2850
- }, sa = /* @__PURE__ */ ke({
2878
+ }, sa = /* @__PURE__ */ we({
2851
2879
  __name: "AgentWrap",
2852
2880
  props: {
2853
2881
  sdk: {},
@@ -2864,13 +2892,13 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2864
2892
  const t = zs("AgentWrap"), e = a, n = e.sdk || Ps.getInstance({
2865
2893
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2866
2894
  ...e.apiBase && { apiBase: e.apiBase }
2867
- }), r = Y(!e.agent), s = is(e.agent ? new yt({ config: e.agent }) : void 0), l = Y();
2868
- return Et(async () => {
2895
+ }), i = Q(!e.agent), s = as(e.agent ? new Tt({ config: e.agent }) : void 0), l = Q();
2896
+ return _t(async () => {
2869
2897
  if (e.agent) {
2870
2898
  t.debug("Agent provided via props, skipping fetch", {
2871
2899
  agentId: e.agent.agentId,
2872
2900
  handle: e.agent.handle
2873
- }), r.value = !1;
2901
+ }), i.value = !1;
2874
2902
  return;
2875
2903
  }
2876
2904
  if (!e.handle) {
@@ -2885,13 +2913,13 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2885
2913
  isDev: n.isDev,
2886
2914
  apiBase: n.apiBase
2887
2915
  }
2888
- }), r.value = !1;
2916
+ }), i.value = !1;
2889
2917
  return;
2890
2918
  }
2891
2919
  try {
2892
- r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2920
+ i.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2893
2921
  const o = await n.user.getPublicAgent({ handle: e.handle });
2894
- o ? (s.value = new yt({ config: o }), t.debug("Successfully fetched public agent", {
2922
+ o ? (s.value = new Tt({ config: o }), t.debug("Successfully fetched public agent", {
2895
2923
  agentId: o.agentId,
2896
2924
  handle: o.handle
2897
2925
  }), o.agentId && n.user.track({
@@ -2923,9 +2951,9 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2923
2951
  }
2924
2952
  });
2925
2953
  } finally {
2926
- r.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
2954
+ i.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
2927
2955
  state: {
2928
- loading: r.value,
2956
+ loading: i.value,
2929
2957
  hasAgent: !!s.value,
2930
2958
  error: l.value
2931
2959
  },
@@ -2941,33 +2969,33 @@ const ui = ["innerHTML"], ns = /* @__PURE__ */ ke({
2941
2969
  }
2942
2970
  });
2943
2971
  }
2944
- }), (o, d) => (y(), T("div", Wi, [
2945
- r.value ? (y(), T("div", qi, [...d[0] || (d[0] = [
2946
- v("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2947
- ])])) : s.value ? tn(o.$slots, "default", {
2972
+ }), (o, d) => (T(), S("div", Wr, [
2973
+ i.value ? (T(), S("div", qr, [...d[0] || (d[0] = [
2974
+ A("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2975
+ ])])) : s.value ? sn(o.$slots, "default", {
2948
2976
  key: 1,
2949
- sdk: Kt(n),
2977
+ sdk: Jt(n),
2950
2978
  agent: s.value,
2951
2979
  context: a.context,
2952
2980
  firstMessage: a.firstMessage,
2953
2981
  buttonText: a.buttonText,
2954
2982
  buttonIcon: a.buttonIcon,
2955
- loading: r.value
2983
+ loading: i.value
2956
2984
  }) : B("", !0)
2957
2985
  ]));
2958
2986
  }
2959
2987
  });
2960
2988
  export {
2961
- On as A,
2989
+ Pn as A,
2962
2990
  sa as _,
2963
2991
  na as a,
2964
2992
  ea as b,
2965
- Ji as c,
2993
+ Jr as c,
2966
2994
  ta as d,
2967
- Ln as e,
2995
+ zn as e,
2968
2996
  Ks as f,
2969
- Ki as g,
2970
- Pn as h,
2971
- Qi as p
2997
+ Kr as g,
2998
+ $n as h,
2999
+ Qr as p
2972
3000
  };
2973
3001
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map