@pagelines/sdk 1.0.558 → 1.0.559

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