@8wave/ai-elements 0.99.0-beta.2 → 0.100.0-beta.1

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.
Files changed (100) hide show
  1. package/dist/_chunks/PkLazyImg-BhLarH2R.js +34 -0
  2. package/dist/_chunks/PkLazyImg-BhLarH2R.js.map +1 -0
  3. package/{dist-vue/_chunks/PkStreamingMarkdown-CjBMQ18U.js → dist/_chunks/PkStreamingMarkdown-CHhH4FdH.js} +407 -385
  4. package/dist/_chunks/PkStreamingMarkdown-CHhH4FdH.js.map +1 -0
  5. package/dist/_chunks/{PkToolShowArtifact-bYYaMGxq.js → PkToolShowArtifact-BRYd-YSp.js} +2 -2
  6. package/dist/_chunks/{PkToolShowArtifact-bYYaMGxq.js.map → PkToolShowArtifact-BRYd-YSp.js.map} +1 -1
  7. package/dist/_chunks/{PkToolShowContactForm-DtjVW-n6.js → PkToolShowContactForm-vZTYDdfX.js} +2 -2
  8. package/dist/_chunks/{PkToolShowContactForm-DtjVW-n6.js.map → PkToolShowContactForm-vZTYDdfX.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowForm-BP8asXtz.js → PkToolShowForm-DMmZ34is.js} +2 -2
  10. package/dist/_chunks/{PkToolShowForm-BP8asXtz.js.map → PkToolShowForm-DMmZ34is.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowImageGallery-WQL3T4Hr.js → PkToolShowImageGallery-B7dClMBr.js} +28 -27
  12. package/dist/_chunks/PkToolShowImageGallery-B7dClMBr.js.map +1 -0
  13. package/dist/_chunks/{PkToolShowProductList-BbY4ni7Y.js → PkToolShowProductList-BGqOPGVe.js} +10 -8
  14. package/dist/_chunks/PkToolShowProductList-BGqOPGVe.js.map +1 -0
  15. package/dist/_chunks/{PkToolShowSources-D2tBcx7n.js → PkToolShowSources-DwhjDoSn.js} +2 -2
  16. package/dist/_chunks/{PkToolShowSources-D2tBcx7n.js.map → PkToolShowSources-DwhjDoSn.js.map} +1 -1
  17. package/dist/_chunks/PkToolShowWebPages-Co1LHj17.js +78 -0
  18. package/dist/_chunks/PkToolShowWebPages-Co1LHj17.js.map +1 -0
  19. package/dist/_chunks/useImageFallback-CaxDKce2.js +19 -0
  20. package/dist/_chunks/useImageFallback-CaxDKce2.js.map +1 -0
  21. package/dist/ai-elements.es.js +3049 -3015
  22. package/dist/ai-elements.es.js.map +1 -1
  23. package/dist-vue/PkChatbot.js +1 -1
  24. package/dist-vue/PkChatbotAuth.js +1 -1
  25. package/dist-vue/PkChatbotEmptyState.js +1 -1
  26. package/dist-vue/PkChatbotInput.js +1 -1
  27. package/dist-vue/PkChatbotMessages.js +1 -1
  28. package/dist-vue/PkChatbotSteps.js +1 -1
  29. package/dist-vue/PkChatbotViewChat.js +1 -1
  30. package/dist-vue/PkChatbotViewFiles.js +1 -1
  31. package/dist-vue/PkChatbotViewProfile.js +1 -1
  32. package/dist-vue/_chunks/PkAvatar-paEJByEA.js +42 -0
  33. package/dist-vue/_chunks/PkAvatar-paEJByEA.js.map +1 -0
  34. package/dist-vue/_chunks/{PkChatbot-Bf5uY3cO.js → PkChatbot-Cs3GOau6.js} +6 -6
  35. package/dist-vue/_chunks/{PkChatbot-Bf5uY3cO.js.map → PkChatbot-Cs3GOau6.js.map} +1 -1
  36. package/dist-vue/_chunks/PkChatbotAuth-DV83Fen2.js +349 -0
  37. package/dist-vue/_chunks/PkChatbotAuth-DV83Fen2.js.map +1 -0
  38. package/dist-vue/_chunks/{PkChatbotEmptyState-CPqLqXek.js → PkChatbotEmptyState-Cxv79prz.js} +3 -3
  39. package/dist-vue/_chunks/{PkChatbotEmptyState-CPqLqXek.js.map → PkChatbotEmptyState-Cxv79prz.js.map} +1 -1
  40. package/dist-vue/_chunks/PkChatbotFilePreview-DyrszALJ.js.map +1 -1
  41. package/dist-vue/_chunks/{PkChatbotInput-jvb0vuak.js → PkChatbotInput-BSm3BI7D.js} +2 -2
  42. package/dist-vue/_chunks/{PkChatbotInput-jvb0vuak.js.map → PkChatbotInput-BSm3BI7D.js.map} +1 -1
  43. package/dist-vue/_chunks/{PkChatbotMessages-B3G12zah.js → PkChatbotMessages-BDRnBwzT.js} +11 -11
  44. package/dist-vue/_chunks/{PkChatbotMessages-B3G12zah.js.map → PkChatbotMessages-BDRnBwzT.js.map} +1 -1
  45. package/dist-vue/_chunks/{PkChatbotSteps-BdU6YC_N.js → PkChatbotSteps-BdycCDRx.js} +2 -2
  46. package/dist-vue/_chunks/{PkChatbotSteps-BdU6YC_N.js.map → PkChatbotSteps-BdycCDRx.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkChatbotViewChat-c0Ecpzoc.js → PkChatbotViewChat-DwfZGp9d.js} +6 -6
  48. package/dist-vue/_chunks/{PkChatbotViewChat-c0Ecpzoc.js.map → PkChatbotViewChat-DwfZGp9d.js.map} +1 -1
  49. package/dist-vue/_chunks/{PkChatbotViewFiles-BipRoidH.js → PkChatbotViewFiles-DwrKKSjU.js} +26 -25
  50. package/dist-vue/_chunks/PkChatbotViewFiles-DwrKKSjU.js.map +1 -0
  51. package/dist-vue/_chunks/{PkChatbotViewProfile-DuLwYpGZ.js → PkChatbotViewProfile-B7yqkE-h.js} +2 -2
  52. package/dist-vue/_chunks/{PkChatbotViewProfile-DuLwYpGZ.js.map → PkChatbotViewProfile-B7yqkE-h.js.map} +1 -1
  53. package/dist-vue/_chunks/PkLazyImg-CDxX9xnq.js +34 -0
  54. package/dist-vue/_chunks/PkLazyImg-CDxX9xnq.js.map +1 -0
  55. package/{dist/_chunks/PkStreamingMarkdown-6Xx9n1ue.js → dist-vue/_chunks/PkStreamingMarkdown-B3OallmC.js} +331 -329
  56. package/dist-vue/_chunks/PkStreamingMarkdown-B3OallmC.js.map +1 -0
  57. package/dist-vue/_chunks/{PkToolShowArtifact-COwSXmF4.js → PkToolShowArtifact-N7we3fbM.js} +2 -2
  58. package/dist-vue/_chunks/{PkToolShowArtifact-COwSXmF4.js.map → PkToolShowArtifact-N7we3fbM.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkToolShowContactForm-DRRtCCxB.js → PkToolShowContactForm-DgVlnLkC.js} +2 -2
  60. package/dist-vue/_chunks/{PkToolShowContactForm-DRRtCCxB.js.map → PkToolShowContactForm-DgVlnLkC.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkToolShowForm-j7Ha-0X3.js → PkToolShowForm-dp0-LYl1.js} +2 -2
  62. package/dist-vue/_chunks/{PkToolShowForm-j7Ha-0X3.js.map → PkToolShowForm-dp0-LYl1.js.map} +1 -1
  63. package/dist-vue/_chunks/PkToolShowImageGallery-CoC46nGb.js +75 -0
  64. package/dist-vue/_chunks/PkToolShowImageGallery-CoC46nGb.js.map +1 -0
  65. package/dist-vue/_chunks/{PkToolShowProductList-DXMN2UuE.js → PkToolShowProductList-C6YoC3sD.js} +25 -23
  66. package/dist-vue/_chunks/PkToolShowProductList-C6YoC3sD.js.map +1 -0
  67. package/dist-vue/_chunks/{PkToolShowSources-BVLw4W5l.js → PkToolShowSources-DJwpImlN.js} +2 -2
  68. package/dist-vue/_chunks/{PkToolShowSources-BVLw4W5l.js.map → PkToolShowSources-DJwpImlN.js.map} +1 -1
  69. package/dist-vue/_chunks/PkToolShowWebPages-B9UeUWfJ.js +79 -0
  70. package/dist-vue/_chunks/PkToolShowWebPages-B9UeUWfJ.js.map +1 -0
  71. package/dist-vue/_chunks/useImageFallback-5vQIO0pC.js +18 -0
  72. package/dist-vue/_chunks/useImageFallback-5vQIO0pC.js.map +1 -0
  73. package/dist-vue/index.js +3951 -3965
  74. package/dist-vue/index.js.map +1 -1
  75. package/dist-vue/locales.js +2 -2
  76. package/dist-vue/packages/components/src/PkLazyImg.d.ts +6 -1
  77. package/dist-vue/packages/components/src/chat/PkAvatar.d.ts +8 -1
  78. package/dist-vue/packages/components/src/chat/PkChatSidebarConversationItem.d.ts +2 -2
  79. package/dist-vue/packages/composable/src/index.d.ts +1 -0
  80. package/dist-vue/packages/composable/src/useImageFallback.d.ts +19 -0
  81. package/dist-vue/packages/models/src/schema/UserOverview.d.ts +96 -0
  82. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  83. package/dist-vue/style.css +1 -1
  84. package/package.json +1 -1
  85. package/dist/_chunks/PkStreamingMarkdown-6Xx9n1ue.js.map +0 -1
  86. package/dist/_chunks/PkToolShowImageGallery-WQL3T4Hr.js.map +0 -1
  87. package/dist/_chunks/PkToolShowProductList-BbY4ni7Y.js.map +0 -1
  88. package/dist/_chunks/PkToolShowWebPages-DkMJrWmT.js +0 -76
  89. package/dist/_chunks/PkToolShowWebPages-DkMJrWmT.js.map +0 -1
  90. package/dist-vue/_chunks/PkAvatar-CyIgsndA.js +0 -31
  91. package/dist-vue/_chunks/PkAvatar-CyIgsndA.js.map +0 -1
  92. package/dist-vue/_chunks/PkChatbotAuth-BGn2MDYD.js +0 -347
  93. package/dist-vue/_chunks/PkChatbotAuth-BGn2MDYD.js.map +0 -1
  94. package/dist-vue/_chunks/PkChatbotViewFiles-BipRoidH.js.map +0 -1
  95. package/dist-vue/_chunks/PkStreamingMarkdown-CjBMQ18U.js.map +0 -1
  96. package/dist-vue/_chunks/PkToolShowImageGallery-Bj7YlqbP.js +0 -74
  97. package/dist-vue/_chunks/PkToolShowImageGallery-Bj7YlqbP.js.map +0 -1
  98. package/dist-vue/_chunks/PkToolShowProductList-DXMN2UuE.js.map +0 -1
  99. package/dist-vue/_chunks/PkToolShowWebPages-CsACREOH.js +0 -77
  100. package/dist-vue/_chunks/PkToolShowWebPages-CsACREOH.js.map +0 -1
@@ -1,25 +1,27 @@
1
- import { n as e, t } from "./cdn-css-JUUNhyQ6.js";
2
- import "./src-8QXYVWIx.js";
3
- import { n } from "./url-validation-uLMZ5-AU.js";
4
- import { n as r } from "./useShortUrlResolver-DI8ycJiO.js";
5
- import { computed as i, createElementBlock as a, defineComponent as o, nextTick as s, openBlock as c, useTemplateRef as l, watch as u } from "vue";
1
+ import { A as e, F as t, I as n, L as r, Q as i, T as a, X as o, b as s, g as c, z as l } from "./vue.runtime.esm-bundler-DbhD_IvR.js";
2
+ import { r as u } from "./vue-i18n-kZs9Hfey.js";
3
+ import { n as d, t as ee } from "./cdn-css-JUUNhyQ6.js";
4
+ import "./src-BGqVtumX.js";
5
+ import { n as f } from "./url-validation-uLMZ5-AU.js";
6
+ import { n as p } from "./useShortUrlResolver-B3FkPQpo.js";
7
+ import { t as te } from "./_plugin-vue_export-helper-B3ysoDQm.js";
6
8
  //#region ../../packages/utils/src/citations.ts
7
- var d = /[ \t]*\uE200[^\uE201]*\uE201/g, f = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, p = /[\uE200-\uE20F]/g;
8
- function m(e) {
9
- return e && e.replace(d, "").replace(f, "").replace(p, "");
9
+ var ne = /[ \t]*\uE200[^\uE201]*\uE201/g, re = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, m = /[\uE200-\uE20F]/g;
10
+ function ie(e) {
11
+ return e && e.replace(ne, "").replace(re, "").replace(m, "");
10
12
  }
11
13
  //#endregion
12
14
  //#region ../../node_modules/.pnpm/remend@1.3.0/node_modules/remend/dist/index.js
13
- var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwnPropertyDescriptors, h = Object.getOwnPropertySymbols, re = Object.prototype.hasOwnProperty, ie = Object.prototype.propertyIsEnumerable, g = (e, t, n) => t in e ? ee(e, t, {
15
+ var ae = Object.defineProperty, oe = Object.defineProperties, se = Object.getOwnPropertyDescriptors, ce = Object.getOwnPropertySymbols, h = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable, _ = (e, t, n) => t in e ? ae(e, t, {
14
16
  enumerable: !0,
15
17
  configurable: !0,
16
18
  writable: !0,
17
19
  value: n
18
- }) : e[t] = n, ae = (e, t) => {
19
- for (var n in t ||= {}) re.call(t, n) && g(e, n, t[n]);
20
- if (h) for (var n of h(t)) ie.call(t, n) && g(e, n, t[n]);
20
+ }) : e[t] = n, le = (e, t) => {
21
+ for (var n in t ||= {}) h.call(t, n) && _(e, n, t[n]);
22
+ if (ce) for (var n of ce(t)) g.call(t, n) && _(e, n, t[n]);
21
23
  return e;
22
- }, oe = (e, t) => te(e, ne(t)), _ = (e, t) => {
24
+ }, ue = (e, t) => oe(e, se(t)), v = (e, t) => {
23
25
  let n = !1, r = !1;
24
26
  for (let i = 0; i < t; i += 1) {
25
27
  if (e[i] === "\\" && i + 1 < e.length && e[i + 1] === "`") {
@@ -33,20 +35,20 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
33
35
  !r && e[i] === "`" && (n = !n);
34
36
  }
35
37
  return n || r;
36
- }, se = (e, t) => {
38
+ }, y = (e, t) => {
37
39
  let n = e.substring(t, t + 3) === "```", r = t > 0 && e.substring(t - 1, t + 2) === "```", i = t > 1 && e.substring(t - 2, t + 1) === "```";
38
40
  return n || r || i;
39
- }, v = (e) => {
41
+ }, de = (e) => {
40
42
  let t = 0;
41
43
  for (let n = 0; n < e.length; n += 1) {
42
44
  if (e[n] === "\\" && n + 1 < e.length && e[n + 1] === "`") {
43
45
  n += 1;
44
46
  continue;
45
47
  }
46
- e[n] === "`" && !se(e, n) && (t += 1);
48
+ e[n] === "`" && !y(e, n) && (t += 1);
47
49
  }
48
50
  return t;
49
- }, y = (e, t) => {
51
+ }, b = (e, t) => {
50
52
  let n = !1, r = !1, i = -1;
51
53
  for (let a = 0; a < e.length; a += 1) {
52
54
  if (e[a] === "\\" && a + 1 < e.length && e[a + 1] === "`") {
@@ -63,21 +65,21 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
63
65
  } else n = !0, i = a;
64
66
  }
65
67
  return !1;
66
- }, ce = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, b = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(ce, (t, n, r, i) => _(e, i) ? t : `${n}\\>${r}`), le = /(\*\*)([^*]*\*?)$/, ue = /(__)([^_]*?)$/, de = /(\*\*\*)([^*]*?)$/, fe = /(\*)([^*]*?)$/, x = /(_)([^_]*?)$/, pe = /(`)([^`]*?)$/, me = /(~~)([^~]*?)$/, S = /^[\s_~*`]*$/, C = /^[\s]*[-*+][\s]+$/, he = /[\p{L}\p{N}_]/u, ge = /^```[^`\n]*```?$/, _e = /^\*{4,}$/, ve = /(__)([^_]+)_$/, ye = /(~~)([^~]+)~$/, be = /~~/g, w = (e) => {
68
+ }, x = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, fe = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(x, (t, n, r, i) => v(e, i) ? t : `${n}\\>${r}`), pe = /(\*\*)([^*]*\*?)$/, me = /(__)([^_]*?)$/, he = /(\*\*\*)([^*]*?)$/, S = /(\*)([^*]*?)$/, C = /(_)([^_]*?)$/, ge = /(`)([^`]*?)$/, w = /(~~)([^~]*?)$/, T = /^[\s_~*`]*$/, E = /^[\s]*[-*+][\s]+$/, _e = /[\p{L}\p{N}_]/u, ve = /^```[^`\n]*```?$/, ye = /^\*{4,}$/, be = /(__)([^_]+)_$/, xe = /(~~)([^~]+)~$/, Se = /~~/g, D = (e) => {
67
69
  if (!e) return !1;
68
70
  let t = e.charCodeAt(0);
69
- return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || he.test(e);
70
- }, xe = (e, t) => {
71
+ return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || _e.test(e);
72
+ }, Ce = (e, t) => {
71
73
  let n = 1;
72
74
  for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
73
75
  else if (e[r] === "[" && (--n, n === 0)) return r;
74
76
  return -1;
75
- }, Se = (e, t) => {
77
+ }, we = (e, t) => {
76
78
  let n = 1;
77
79
  for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
78
80
  else if (e[r] === "]" && (--n, n === 0)) return r;
79
81
  return -1;
80
- }, T = (e, t) => {
82
+ }, O = (e, t) => {
81
83
  let n = !1, r = !1;
82
84
  for (let i = 0; i < e.length && i < t; i += 1) {
83
85
  if (e[i] === "\\" && e[i + 1] === "$") {
@@ -87,20 +89,20 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
87
89
  e[i] === "$" && (e[i + 1] === "$" ? (r = !r, i += 1, n = !1) : r || (n = !n));
88
90
  }
89
91
  return n || r;
90
- }, Ce = (e, t) => {
92
+ }, Te = (e, t) => {
91
93
  for (let n = t; n < e.length; n += 1) {
92
94
  if (e[n] === ")") return !0;
93
95
  if (e[n] === "\n") return !1;
94
96
  }
95
97
  return !1;
96
- }, we = (e, t) => {
98
+ }, Ee = (e, t) => {
97
99
  for (let n = t - 1; n >= 0; --n) {
98
100
  if (e[n] === ")") return !1;
99
- if (e[n] === "(") return n > 0 && e[n - 1] === "]" && Ce(e, t);
101
+ if (e[n] === "(") return n > 0 && e[n - 1] === "]" && Te(e, t);
100
102
  if (e[n] === "\n") return !1;
101
103
  }
102
104
  return !1;
103
- }, Te = (e, t) => {
105
+ }, De = (e, t) => {
104
106
  for (let n = t - 1; n >= 0; --n) {
105
107
  if (e[n] === ">") return !1;
106
108
  if (e[n] === "<") {
@@ -110,7 +112,7 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
110
112
  if (e[n] === "\n") return !1;
111
113
  }
112
114
  return !1;
113
- }, E = (e, t, n) => {
115
+ }, Oe = (e, t, n) => {
114
116
  let r = 0;
115
117
  for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
116
118
  r = n + 1;
@@ -128,7 +130,7 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
128
130
  break;
129
131
  }
130
132
  return o >= 3 && !s;
131
- }, Ee = (e, t, n, r) => n === "\\" || e.includes("$") && T(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : !!(n === "*" || n && r && w(n) && w(r) || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n")), De = (e) => {
133
+ }, ke = (e, t, n, r) => n === "\\" || e.includes("$") && O(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : !!(n === "*" || n && r && D(n) && D(r) || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n")), Ae = (e) => {
132
134
  let t = 0, n = !1, r = e.length;
133
135
  for (let i = 0; i < r; i += 1) {
134
136
  if (e[i] === "`" && i + 2 < r && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -137,10 +139,10 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
137
139
  }
138
140
  if (n || e[i] !== "*") continue;
139
141
  let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
140
- Ee(e, i, a, o) || (t += 1);
142
+ ke(e, i, a, o) || (t += 1);
141
143
  }
142
144
  return t;
143
- }, Oe = (e, t, n, r) => !!(n === "\\" || e.includes("$") && T(e, t) || we(e, t) || Te(e, t) || n === "_" || r === "_" || n && r && w(n) && w(r)), ke = (e) => {
145
+ }, je = (e, t, n, r) => !!(n === "\\" || e.includes("$") && O(e, t) || Ee(e, t) || De(e, t) || n === "_" || r === "_" || n && r && D(n) && D(r)), Me = (e) => {
144
146
  let t = 0, n = !1, r = e.length;
145
147
  for (let i = 0; i < r; i += 1) {
146
148
  if (e[i] === "`" && i + 2 < r && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -149,10 +151,10 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
149
151
  }
150
152
  if (n || e[i] !== "_") continue;
151
153
  let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
152
- Oe(e, i, a, o) || (t += 1);
154
+ je(e, i, a, o) || (t += 1);
153
155
  }
154
156
  return t;
155
- }, Ae = (e) => {
157
+ }, Ne = (e) => {
156
158
  let t = 0, n = 0, r = !1;
157
159
  for (let i = 0; i < e.length; i += 1) {
158
160
  if (e[i] === "`" && i + 2 < e.length && e[i + 1] === "`" && e[i + 2] === "`") {
@@ -162,7 +164,7 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
162
164
  r || (e[i] === "*" ? n += 1 : (n >= 3 && (t += Math.floor(n / 3)), n = 0));
163
165
  }
164
166
  return n >= 3 && (t += Math.floor(n / 3)), t;
165
- }, D = (e) => {
167
+ }, Pe = (e) => {
166
168
  let t = 0, n = !1;
167
169
  for (let r = 0; r < e.length; r += 1) {
168
170
  if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
@@ -172,7 +174,7 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
172
174
  n || e[r] === "*" && r + 1 < e.length && e[r + 1] === "*" && (t += 1, r += 1);
173
175
  }
174
176
  return t;
175
- }, je = (e) => {
177
+ }, Fe = (e) => {
176
178
  let t = 0, n = !1;
177
179
  for (let r = 0; r < e.length; r += 1) {
178
180
  if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
@@ -182,143 +184,143 @@ var ee = Object.defineProperty, te = Object.defineProperties, ne = Object.getOwn
182
184
  n || e[r] === "_" && r + 1 < e.length && e[r + 1] === "_" && (t += 1, r += 1);
183
185
  }
184
186
  return t;
185
- }, Me = (e, t, n) => {
186
- if (!t || S.test(t)) return !0;
187
+ }, Ie = (e, t, n) => {
188
+ if (!t || T.test(t)) return !0;
187
189
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
188
- return C.test(a) && t.includes("\n") ? !0 : E(e, n, "*");
189
- }, Ne = (e) => {
190
- let t = e.match(le);
190
+ return E.test(a) && t.includes("\n") ? !0 : Oe(e, n, "*");
191
+ }, Le = (e) => {
192
+ let t = e.match(pe);
191
193
  if (!t) return e;
192
194
  let n = t[2], r = e.lastIndexOf(t[1]);
193
- return _(e, r) || y(e, r) || Me(e, n, r) ? e : D(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
194
- }, Pe = (e, t, n) => {
195
- if (!t || S.test(t)) return !0;
195
+ return v(e, r) || b(e, r) || Ie(e, n, r) ? e : Pe(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
196
+ }, Re = (e, t, n) => {
197
+ if (!t || T.test(t)) return !0;
196
198
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
197
- return C.test(a) && t.includes("\n") ? !0 : E(e, n, "_");
198
- }, Fe = (e) => {
199
- let t = e.match(ue);
199
+ return E.test(a) && t.includes("\n") ? !0 : Oe(e, n, "_");
200
+ }, ze = (e) => {
201
+ let t = e.match(me);
200
202
  if (!t) {
201
- let t = e.match(ve);
203
+ let t = e.match(be);
202
204
  if (t) {
203
205
  let n = e.lastIndexOf(t[1]);
204
- if (!(_(e, n) || y(e, n)) && je(e) % 2 == 1) return `${e}_`;
206
+ if (!(v(e, n) || b(e, n)) && Fe(e) % 2 == 1) return `${e}_`;
205
207
  }
206
208
  return e;
207
209
  }
208
210
  let n = t[2], r = e.lastIndexOf(t[1]);
209
- return _(e, r) || y(e, r) || Pe(e, n, r) ? e : je(e) % 2 == 1 ? `${e}__` : e;
210
- }, Ie = (e) => {
211
+ return v(e, r) || b(e, r) || Re(e, n, r) ? e : Fe(e) % 2 == 1 ? `${e}__` : e;
212
+ }, Be = (e) => {
211
213
  let t = !1;
212
214
  for (let n = 0; n < e.length; n += 1) {
213
215
  if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
214
216
  t = !t, n += 2;
215
217
  continue;
216
218
  }
217
- if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !T(e, n)) {
219
+ if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !O(e, n)) {
218
220
  let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
219
- if ((!t || t === " " || t === " " || t === "\n") && (!r || r === " " || r === " " || r === "\n") || t && r && w(t) && w(r)) continue;
221
+ if ((!t || t === " " || t === " " || t === "\n") && (!r || r === " " || r === " " || r === "\n") || t && r && D(t) && D(r)) continue;
220
222
  return n;
221
223
  }
222
224
  }
223
225
  return -1;
224
- }, Le = (e) => {
225
- if (!e.match(fe)) return e;
226
- let t = Ie(e);
227
- if (t === -1 || _(e, t) || y(e, t)) return e;
226
+ }, Ve = (e) => {
227
+ if (!e.match(S)) return e;
228
+ let t = Be(e);
229
+ if (t === -1 || v(e, t) || b(e, t)) return e;
228
230
  let n = e.substring(t + 1);
229
- return !n || S.test(n) ? e : De(e) % 2 == 1 ? `${e}*` : e;
230
- }, Re = (e) => {
231
+ return !n || T.test(n) ? e : Ae(e) % 2 == 1 ? `${e}*` : e;
232
+ }, He = (e) => {
231
233
  let t = !1;
232
234
  for (let n = 0; n < e.length; n += 1) {
233
235
  if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
234
236
  t = !t, n += 2;
235
237
  continue;
236
238
  }
237
- if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !T(e, n) && !we(e, n)) {
239
+ if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !O(e, n) && !Ee(e, n)) {
238
240
  let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
239
- if (t && r && w(t) && w(r)) continue;
241
+ if (t && r && D(t) && D(r)) continue;
240
242
  return n;
241
243
  }
242
244
  }
243
245
  return -1;
244
- }, ze = (e) => {
246
+ }, Ue = (e) => {
245
247
  let t = e.length;
246
248
  for (; t > 0 && e[t - 1] === "\n";) --t;
247
249
  return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
248
- }, Be = (e) => {
250
+ }, We = (e) => {
249
251
  if (!e.endsWith("**")) return null;
250
252
  let t = e.slice(0, -2);
251
- if (D(t) % 2 != 1) return null;
252
- let n = t.indexOf("**"), r = Re(t);
253
+ if (Pe(t) % 2 != 1) return null;
254
+ let n = t.indexOf("**"), r = He(t);
253
255
  return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
254
- }, Ve = (e) => {
255
- if (!e.match(x)) return e;
256
- let t = Re(e);
256
+ }, Ge = (e) => {
257
+ if (!e.match(C)) return e;
258
+ let t = He(e);
257
259
  if (t === -1) return e;
258
260
  let n = e.substring(t + 1);
259
- if (!n || S.test(n) || _(e, t) || y(e, t)) return e;
260
- if (ke(e) % 2 == 1) {
261
- let t = Be(e);
262
- return t === null ? ze(e) : t;
261
+ if (!n || T.test(n) || v(e, t) || b(e, t)) return e;
262
+ if (Me(e) % 2 == 1) {
263
+ let t = We(e);
264
+ return t === null ? Ue(e) : t;
263
265
  }
264
266
  return e;
265
- }, He = (e) => {
266
- let t = D(e), n = De(e);
267
+ }, Ke = (e) => {
268
+ let t = Pe(e), n = Ae(e);
267
269
  return t % 2 == 0 && n % 2 == 0;
268
- }, Ue = (e, t, n) => !t || S.test(t) || _(e, n) || y(e, n) ? !0 : E(e, n, "*"), We = (e) => {
269
- if (_e.test(e)) return e;
270
- let t = e.match(de);
270
+ }, qe = (e, t, n) => !t || T.test(t) || v(e, n) || b(e, n) ? !0 : Oe(e, n, "*"), Je = (e) => {
271
+ if (ye.test(e)) return e;
272
+ let t = e.match(he);
271
273
  if (!t) return e;
272
274
  let n = t[2];
273
- return Ue(e, n, e.lastIndexOf(t[1])) ? e : Ae(e) % 2 == 1 ? He(e) ? e : `${e}***` : e;
274
- }, Ge = /<[a-zA-Z/][^>]*$/, Ke = (e) => {
275
- let t = e.match(Ge);
276
- return !t || t.index === void 0 || _(e, t.index) ? e : e.substring(0, t.index).trimEnd();
277
- }, qe = (e) => !e.match(ge) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, Je = (e) => (e.match(/```/g) || []).length % 2 == 1, Ye = (e) => {
278
- let t = qe(e);
275
+ return qe(e, n, e.lastIndexOf(t[1])) ? e : Ne(e) % 2 == 1 ? Ke(e) ? e : `${e}***` : e;
276
+ }, Ye = /<[a-zA-Z/][^>]*$/, Xe = (e) => {
277
+ let t = e.match(Ye);
278
+ return !t || t.index === void 0 || v(e, t.index) ? e : e.substring(0, t.index).trimEnd();
279
+ }, Ze = (e) => !e.match(ve) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, Qe = (e) => (e.match(/```/g) || []).length % 2 == 1, $e = (e) => {
280
+ let t = Ze(e);
279
281
  if (t !== null) return t;
280
- let n = e.match(pe);
281
- if (n && !Je(e)) {
282
+ let n = e.match(ge);
283
+ if (n && !Qe(e)) {
282
284
  let t = n[2];
283
- if (!t || S.test(t)) return e;
284
- if (v(e) % 2 == 1) return `${e}\``;
285
+ if (!t || T.test(t)) return e;
286
+ if (de(e) % 2 == 1) return `${e}\``;
285
287
  }
286
288
  return e;
287
- }, Xe = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", Ze = (e) => {
289
+ }, et = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", tt = (e) => {
288
290
  let t = 0, n = !1;
289
- for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !Xe(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
291
+ for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !et(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
290
292
  return t;
291
- }, Qe = (e) => {
293
+ }, nt = (e) => {
292
294
  let t = 0, n = !1;
293
295
  for (let r = 0; r < e.length; r += 1) {
294
296
  if (e[r] === "\\") {
295
297
  r += 1;
296
298
  continue;
297
299
  }
298
- if (e[r] === "`" && !Xe(e, r)) {
300
+ if (e[r] === "`" && !et(e, r)) {
299
301
  n = !n;
300
302
  continue;
301
303
  }
302
304
  !n && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : t += 1);
303
305
  }
304
306
  return t;
305
- }, $e = (e) => {
307
+ }, rt = (e) => {
306
308
  if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
307
309
  let t = e.indexOf("$$");
308
310
  return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
309
311
  $$` : `${e}$$`;
310
- }, et = (e) => Ze(e) % 2 == 0 ? e : $e(e), tt = (e) => Qe(e) % 2 == 1 ? `${e}$` : e, nt = (e, t, n) => {
312
+ }, it = (e) => tt(e) % 2 == 0 ? e : rt(e), at = (e) => nt(e) % 2 == 1 ? `${e}$` : e, ot = (e, t, n) => {
311
313
  if (e.substring(t + 2).includes(")")) return null;
312
- let r = xe(e, t);
313
- if (r === -1 || _(e, r)) return null;
314
+ let r = Ce(e, t);
315
+ if (r === -1 || v(e, r)) return null;
314
316
  let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a);
315
317
  if (i) return o;
316
318
  let s = e.substring(r + 1, t);
317
319
  return n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
318
- }, rt = (e, t) => {
319
- for (let n = 0; n < t; n++) if (e[n] === "[" && !_(e, n)) {
320
+ }, st = (e, t) => {
321
+ for (let n = 0; n < t; n++) if (e[n] === "[" && !v(e, n)) {
320
322
  if (n > 0 && e[n - 1] === "!") continue;
321
- let t = Se(e, n);
323
+ let t = we(e, n);
322
324
  if (t === -1) return n;
323
325
  if (t + 1 < e.length && e[t + 1] === "(") {
324
326
  let r = e.indexOf(")", t + 2);
@@ -326,70 +328,70 @@ $$` : `${e}$$`;
326
328
  }
327
329
  }
328
330
  return t;
329
- }, it = (e, t, n) => {
331
+ }, ct = (e, t, n) => {
330
332
  let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
331
333
  if (!e.substring(t + 1).includes("]")) {
332
334
  let a = e.substring(0, i);
333
335
  if (r) return a;
334
336
  if (n === "text-only") {
335
- let n = rt(e, t);
337
+ let n = st(e, t);
336
338
  return e.substring(0, n) + e.substring(n + 1);
337
339
  }
338
340
  return `${e}](streamdown:incomplete-link)`;
339
341
  }
340
- if (Se(e, t) === -1) {
342
+ if (we(e, t) === -1) {
341
343
  let a = e.substring(0, i);
342
344
  if (r) return a;
343
345
  if (n === "text-only") {
344
- let n = rt(e, t);
346
+ let n = st(e, t);
345
347
  return e.substring(0, n) + e.substring(n + 1);
346
348
  }
347
349
  return `${e}](streamdown:incomplete-link)`;
348
350
  }
349
351
  return null;
350
- }, at = (e, t = "protocol") => {
352
+ }, lt = (e, t = "protocol") => {
351
353
  let n = e.lastIndexOf("](");
352
- if (n !== -1 && !_(e, n)) {
353
- let r = nt(e, n, t);
354
+ if (n !== -1 && !v(e, n)) {
355
+ let r = ot(e, n, t);
354
356
  if (r !== null) return r;
355
357
  }
356
- for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !_(e, n)) {
357
- let r = it(e, n, t);
358
+ for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !v(e, n)) {
359
+ let r = ct(e, n, t);
358
360
  if (r !== null) return r;
359
361
  }
360
362
  return e;
361
- }, ot = /^-{1,2}$/, st = /^[\s]*-{1,2}[\s]+$/, ct = /^={1,2}$/, lt = /^[\s]*={1,2}[\s]+$/, ut = (e) => {
363
+ }, ut = /^-{1,2}$/, dt = /^[\s]*-{1,2}[\s]+$/, ft = /^={1,2}$/, pt = /^[\s]*={1,2}[\s]+$/, mt = (e) => {
362
364
  if (!e || typeof e != "string") return e;
363
365
  let t = e.lastIndexOf("\n");
364
366
  if (t === -1) return e;
365
367
  let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
366
- if (ot.test(i) && !n.match(st)) {
368
+ if (ut.test(i) && !n.match(dt)) {
367
369
  let t = r.split("\n").at(-1);
368
370
  if (t && t.trim().length > 0) return `${e}\u200B`;
369
371
  }
370
- if (ct.test(i) && !n.match(lt)) {
372
+ if (ft.test(i) && !n.match(pt)) {
371
373
  let t = r.split("\n").at(-1);
372
374
  if (t && t.trim().length > 0) return `${e}\u200B`;
373
375
  }
374
376
  return e;
375
- }, dt = /* @__PURE__ */ RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])", "gu"), ft = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(dt, (t, n) => _(e, n) ? t : "\\~"), pt = (e) => {
376
- let t = e.match(me);
377
+ }, ht = /* @__PURE__ */ RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])", "gu"), gt = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(ht, (t, n) => v(e, n) ? t : "\\~"), _t = (e) => {
378
+ let t = e.match(w);
377
379
  if (t) {
378
380
  let n = t[2];
379
- if (!n || S.test(n)) return e;
381
+ if (!n || T.test(n)) return e;
380
382
  let r = e.lastIndexOf(t[1]);
381
- if (_(e, r) || y(e, r)) return e;
382
- if (e.match(be)?.length % 2 == 1) return `${e}~~`;
383
+ if (v(e, r) || b(e, r)) return e;
384
+ if (e.match(Se)?.length % 2 == 1) return `${e}~~`;
383
385
  } else {
384
- let t = e.match(ye);
386
+ let t = e.match(xe);
385
387
  if (t) {
386
388
  let n = e.lastIndexOf(t[0].slice(0, 2));
387
- if (_(e, n) || y(e, n)) return e;
388
- if (e.match(be)?.length % 2 == 1) return `${e}~`;
389
+ if (v(e, n) || b(e, n)) return e;
390
+ if (e.match(Se)?.length % 2 == 1) return `${e}~`;
389
391
  }
390
392
  }
391
393
  return e;
392
- }, mt = (e) => e !== !1, ht = (e) => e === !0, O = {
394
+ }, vt = (e) => e !== !1, yt = (e) => e === !0, k = {
393
395
  SINGLE_TILDE: 0,
394
396
  COMPARISON_OPERATORS: 5,
395
397
  HTML_TAGS: 10,
@@ -405,44 +407,44 @@ $$` : `${e}$$`;
405
407
  KATEX: 70,
406
408
  INLINE_KATEX: 75,
407
409
  DEFAULT: 100
408
- }, gt = [
410
+ }, bt = [
409
411
  {
410
412
  handler: {
411
413
  name: "singleTilde",
412
- handle: ft,
413
- priority: O.SINGLE_TILDE
414
+ handle: gt,
415
+ priority: k.SINGLE_TILDE
414
416
  },
415
417
  optionKey: "singleTilde"
416
418
  },
417
419
  {
418
420
  handler: {
419
421
  name: "comparisonOperators",
420
- handle: b,
421
- priority: O.COMPARISON_OPERATORS
422
+ handle: fe,
423
+ priority: k.COMPARISON_OPERATORS
422
424
  },
423
425
  optionKey: "comparisonOperators"
424
426
  },
425
427
  {
426
428
  handler: {
427
429
  name: "htmlTags",
428
- handle: Ke,
429
- priority: O.HTML_TAGS
430
+ handle: Xe,
431
+ priority: k.HTML_TAGS
430
432
  },
431
433
  optionKey: "htmlTags"
432
434
  },
433
435
  {
434
436
  handler: {
435
437
  name: "setextHeadings",
436
- handle: ut,
437
- priority: O.SETEXT_HEADINGS
438
+ handle: mt,
439
+ priority: k.SETEXT_HEADINGS
438
440
  },
439
441
  optionKey: "setextHeadings"
440
442
  },
441
443
  {
442
444
  handler: {
443
445
  name: "links",
444
- handle: at,
445
- priority: O.LINKS
446
+ handle: lt,
447
+ priority: k.LINKS
446
448
  },
447
449
  optionKey: "links",
448
450
  earlyReturn: (e) => e.endsWith("](streamdown:incomplete-link)")
@@ -450,88 +452,88 @@ $$` : `${e}$$`;
450
452
  {
451
453
  handler: {
452
454
  name: "boldItalic",
453
- handle: We,
454
- priority: O.BOLD_ITALIC
455
+ handle: Je,
456
+ priority: k.BOLD_ITALIC
455
457
  },
456
458
  optionKey: "boldItalic"
457
459
  },
458
460
  {
459
461
  handler: {
460
462
  name: "bold",
461
- handle: Ne,
462
- priority: O.BOLD
463
+ handle: Le,
464
+ priority: k.BOLD
463
465
  },
464
466
  optionKey: "bold"
465
467
  },
466
468
  {
467
469
  handler: {
468
470
  name: "italicDoubleUnderscore",
469
- handle: Fe,
470
- priority: O.ITALIC_DOUBLE_UNDERSCORE
471
+ handle: ze,
472
+ priority: k.ITALIC_DOUBLE_UNDERSCORE
471
473
  },
472
474
  optionKey: "italic"
473
475
  },
474
476
  {
475
477
  handler: {
476
478
  name: "italicSingleAsterisk",
477
- handle: Le,
478
- priority: O.ITALIC_SINGLE_ASTERISK
479
+ handle: Ve,
480
+ priority: k.ITALIC_SINGLE_ASTERISK
479
481
  },
480
482
  optionKey: "italic"
481
483
  },
482
484
  {
483
485
  handler: {
484
486
  name: "italicSingleUnderscore",
485
- handle: Ve,
486
- priority: O.ITALIC_SINGLE_UNDERSCORE
487
+ handle: Ge,
488
+ priority: k.ITALIC_SINGLE_UNDERSCORE
487
489
  },
488
490
  optionKey: "italic"
489
491
  },
490
492
  {
491
493
  handler: {
492
494
  name: "inlineCode",
493
- handle: Ye,
494
- priority: O.INLINE_CODE
495
+ handle: $e,
496
+ priority: k.INLINE_CODE
495
497
  },
496
498
  optionKey: "inlineCode"
497
499
  },
498
500
  {
499
501
  handler: {
500
502
  name: "strikethrough",
501
- handle: pt,
502
- priority: O.STRIKETHROUGH
503
+ handle: _t,
504
+ priority: k.STRIKETHROUGH
503
505
  },
504
506
  optionKey: "strikethrough"
505
507
  },
506
508
  {
507
509
  handler: {
508
510
  name: "katex",
509
- handle: et,
510
- priority: O.KATEX
511
+ handle: it,
512
+ priority: k.KATEX
511
513
  },
512
514
  optionKey: "katex"
513
515
  },
514
516
  {
515
517
  handler: {
516
518
  name: "inlineKatex",
517
- handle: tt,
518
- priority: O.INLINE_KATEX
519
+ handle: at,
520
+ priority: k.INLINE_KATEX
519
521
  },
520
522
  optionKey: "inlineKatex"
521
523
  }
522
- ], _t = (e) => {
524
+ ], xt = (e) => {
523
525
  let t = e?.linkMode ?? "protocol";
524
- return gt.filter(({ handler: t, optionKey: n }) => t.name === "links" ? mt(e?.links) || mt(e?.images) : t.name === "inlineKatex" ? ht(e?.inlineKatex) : mt(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
525
- handler: oe(ae({}, e), { handle: (e) => at(e, t) }),
526
+ return bt.filter(({ handler: t, optionKey: n }) => t.name === "links" ? vt(e?.links) || vt(e?.images) : t.name === "inlineKatex" ? yt(e?.inlineKatex) : vt(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
527
+ handler: ue(le({}, e), { handle: (e) => lt(e, t) }),
526
528
  earlyReturn: t === "protocol" ? n : void 0
527
529
  } : {
528
530
  handler: e,
529
531
  earlyReturn: n
530
532
  });
531
- }, vt = (e, t) => {
533
+ }, St = (e, t) => {
532
534
  if (!e || typeof e != "string") return e;
533
- let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = _t(t), i = (t?.handlers ?? []).map((e) => ({
534
- handler: oe(ae({}, e), { priority: e.priority ?? O.DEFAULT }),
535
+ let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = xt(t), i = (t?.handlers ?? []).map((e) => ({
536
+ handler: ue(le({}, e), { priority: e.priority ?? k.DEFAULT }),
535
537
  earlyReturn: void 0
536
538
  })), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
537
539
  for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
@@ -539,7 +541,7 @@ $$` : `${e}$$`;
539
541
  };
540
542
  //#endregion
541
543
  //#region ../../node_modules/.pnpm/marked@18.0.7/node_modules/marked/lib/marked.esm.js
542
- function yt() {
544
+ function Ct() {
543
545
  return {
544
546
  async: !1,
545
547
  breaks: !1,
@@ -553,35 +555,35 @@ function yt() {
553
555
  walkTokens: null
554
556
  };
555
557
  }
556
- var k = yt();
557
- function bt(e) {
558
- k = e;
558
+ var A = Ct();
559
+ function wt(e) {
560
+ A = e;
559
561
  }
560
- var A = { exec: () => null };
561
- function j(e) {
562
+ var j = { exec: () => null };
563
+ function M(e) {
562
564
  let t = [];
563
565
  return (n) => {
564
566
  let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
565
567
  return i || (i = e(r), t[r] = i), i;
566
568
  };
567
569
  }
568
- function M(e, t = "") {
570
+ function N(e, t = "") {
569
571
  let n = typeof e == "string" ? e : e.source, r = {
570
572
  replace: (e, t) => {
571
573
  let i = typeof t == "string" ? t : t.source;
572
- return i = i.replace(N.caret, "$1"), n = n.replace(e, i), r;
574
+ return i = i.replace(P.caret, "$1"), n = n.replace(e, i), r;
573
575
  },
574
576
  getRegex: () => new RegExp(n, t)
575
577
  };
576
578
  return r;
577
579
  }
578
- var xt = ((e = "") => {
580
+ var Tt = ((e = "") => {
579
581
  try {
580
582
  return !!RegExp("(?<=1)(?<!1)" + e);
581
583
  } catch {
582
584
  return !1;
583
585
  }
584
- })(), N = {
586
+ })(), P = {
585
587
  codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
586
588
  outputLinkReplace: /\\([\[\]])/g,
587
589
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -632,118 +634,118 @@ var xt = ((e = "") => {
632
634
  notSpaceStart: /^\S*/,
633
635
  endingNewline: /\n$/,
634
636
  listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
635
- nextBulletRegex: j((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
636
- hrRegex: j((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
637
- fencesBeginRegex: j((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
638
- headingBeginRegex: j((e) => RegExp(`^ {0,${e}}#`)),
639
- htmlBeginRegex: j((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
640
- blockquoteBeginRegex: j((e) => RegExp(`^ {0,${e}}>`))
641
- }, St = /^(?:[ \t]*(?:\n|$))+/, Ct = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Tt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Et = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Dt = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ot = M(Dt).replace(/bull/g, Et).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), kt = M(Dt).replace(/bull/g, Et).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), At = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, jt = /^[^\n]+/, Mt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Nt = M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Mt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pt = M(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Et).getRegex(), F = "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", Ft = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, It = M("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Ft).replace("tag", F).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Lt = (e) => M(At).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", F).getRegex(), Rt = Lt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), zt = Lt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), I = {
642
- blockquote: M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", zt).getRegex(),
643
- code: Ct,
644
- def: Nt,
645
- fences: wt,
646
- heading: Tt,
647
- hr: P,
648
- html: It,
649
- lheading: Ot,
650
- list: Pt,
651
- newline: St,
652
- paragraph: Rt,
653
- table: A,
654
- text: jt
655
- }, Bt = M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", F).getRegex(), Vt = {
656
- ...I,
657
- lheading: kt,
658
- table: Bt,
659
- paragraph: M(At).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Bt).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", F).getRegex()
660
- }, Ht = {
661
- ...I,
662
- html: M("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Ft).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(),
637
+ nextBulletRegex: M((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
638
+ hrRegex: M((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
639
+ fencesBeginRegex: M((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
640
+ headingBeginRegex: M((e) => RegExp(`^ {0,${e}}#`)),
641
+ htmlBeginRegex: M((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
642
+ blockquoteBeginRegex: M((e) => RegExp(`^ {0,${e}}>`))
643
+ }, Et = /^(?:[ \t]*(?:\n|$))+/, Dt = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ot = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, F = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, kt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, I = / {0,3}(?:[*+-]|\d{1,9}[.)])/, At = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, jt = N(At).replace(/bull/g, I).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Mt = N(At).replace(/bull/g, I).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}(?:\s|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), L = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Nt = /^[^\n]+/, R = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Pt = N(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", R).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ft = N(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, I).getRegex(), z = "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", It = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Lt = N("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", It).replace("tag", z).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Rt = (e) => N(L).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", z).getRegex(), zt = Rt(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Bt = Rt(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Vt = {
644
+ blockquote: N(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Bt).getRegex(),
645
+ code: Dt,
646
+ def: Pt,
647
+ fences: Ot,
648
+ heading: kt,
649
+ hr: F,
650
+ html: Lt,
651
+ lheading: jt,
652
+ list: Ft,
653
+ newline: Et,
654
+ paragraph: zt,
655
+ table: j,
656
+ text: Nt
657
+ }, Ht = N("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", z).getRegex(), Ut = {
658
+ ...Vt,
659
+ lheading: Mt,
660
+ table: Ht,
661
+ paragraph: N(L).replace("hr", F).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ht).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", z).getRegex()
662
+ }, Wt = {
663
+ ...Vt,
664
+ html: N("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", It).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(),
663
665
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
664
666
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
665
- fences: A,
667
+ fences: j,
666
668
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
667
- paragraph: M(At).replace("hr", P).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Ot).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
668
- }, Ut = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Wt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gt = /^( {2,}|\\)\n(?!\s*$)/, Kt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = /[\p{P}\p{S}]/u, R = /[\s\p{P}\p{S}]/u, z = /[^\s\p{P}\p{S}]/u, qt = M(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, R).getRegex(), Jt = /(?!~)[\p{P}\p{S}]/u, Yt = /(?!~)[\s\p{P}\p{S}]/u, Xt = /(?:[^\s\p{P}\p{S}]|~)/u, Zt = M(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xt ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Qt = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $t = M(Qt, "u").replace(/punct/g, L).getRegex(), en = M(Qt, "u").replace(/punct/g, Jt).getRegex(), tn = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", nn = M(tn, "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), rn = M(tn, "gu").replace(/notPunctSpace/g, Xt).replace(/punctSpace/g, Yt).replace(/punct/g, Jt).getRegex(), an = M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), on = M(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, L).getRegex(), sn = M("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, z).replace(/punctSpace/g, R).replace(/punct/g, L).getRegex(), cn = M(/\\(punct)/, "gu").replace(/punct/g, L).getRegex(), ln = M(/^<(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(), un = M(Ft).replace("(?:-->|$)", "-->").getRegex(), dn = M("^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", un).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), B = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, fn = M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", B).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), pn = M(/^!?\[(label)\]\[(ref)\]/).replace("label", B).replace("ref", Mt).getRegex(), mn = M(/^!?\[(ref)\](?:\[\])?/).replace("ref", Mt).getRegex(), hn = M("reflink|nolink(?!\\()", "g").replace("reflink", pn).replace("nolink", mn).getRegex(), gn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, V = {
669
- _backpedal: A,
670
- anyPunctuation: cn,
671
- autolink: ln,
672
- blockSkip: Zt,
673
- br: Gt,
674
- code: Wt,
675
- del: A,
676
- delLDelim: A,
677
- delRDelim: A,
678
- emStrongLDelim: $t,
679
- emStrongRDelimAst: nn,
680
- emStrongRDelimUnd: an,
681
- escape: Ut,
682
- link: fn,
683
- nolink: mn,
684
- punctuation: qt,
685
- reflink: pn,
686
- reflinkSearch: hn,
687
- tag: dn,
688
- text: Kt,
689
- url: A
690
- }, _n = {
691
- ...V,
692
- link: M(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(),
693
- reflink: M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex()
694
- }, H = {
695
- ...V,
696
- emStrongRDelimAst: rn,
697
- emStrongLDelim: en,
698
- delLDelim: on,
699
- delRDelim: sn,
700
- url: M(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", gn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
669
+ paragraph: N(L).replace("hr", F).replace("heading", " *#{1,6} *[^\n]").replace("lheading", jt).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
670
+ }, Gt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Kt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, qt = /^( {2,}|\\)\n(?!\s*$)/, Jt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, V = /[\s\p{P}\p{S}]/u, Yt = /[^\s\p{P}\p{S}]/u, Xt = N(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, V).getRegex(), Zt = /(?!~)[\p{P}\p{S}]/u, Qt = /(?!~)[\s\p{P}\p{S}]/u, $t = /(?:[^\s\p{P}\p{S}]|~)/u, en = N(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Tt ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), tn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, nn = N(tn, "u").replace(/punct/g, B).getRegex(), rn = N(tn, "u").replace(/punct/g, Zt).getRegex(), an = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", on = N(an, "gu").replace(/notPunctSpace/g, Yt).replace(/punctSpace/g, V).replace(/punct/g, B).getRegex(), sn = N(an, "gu").replace(/notPunctSpace/g, $t).replace(/punctSpace/g, Qt).replace(/punct/g, Zt).getRegex(), cn = N("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Yt).replace(/punctSpace/g, V).replace(/punct/g, B).getRegex(), ln = N(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), un = N("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yt).replace(/punctSpace/g, V).replace(/punct/g, B).getRegex(), dn = N(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), fn = N(/^<(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(), pn = N(It).replace("(?:-->|$)", "-->").getRegex(), mn = N("^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", pn).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), H = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, hn = N(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", H).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), gn = N(/^!?\[(label)\]\[(ref)\]/).replace("label", H).replace("ref", R).getRegex(), _n = N(/^!?\[(ref)\](?:\[\])?/).replace("ref", R).getRegex(), vn = N("reflink|nolink(?!\\()", "g").replace("reflink", gn).replace("nolink", _n).getRegex(), yn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, bn = {
671
+ _backpedal: j,
672
+ anyPunctuation: dn,
673
+ autolink: fn,
674
+ blockSkip: en,
675
+ br: qt,
676
+ code: Kt,
677
+ del: j,
678
+ delLDelim: j,
679
+ delRDelim: j,
680
+ emStrongLDelim: nn,
681
+ emStrongRDelimAst: on,
682
+ emStrongRDelimUnd: cn,
683
+ escape: Gt,
684
+ link: hn,
685
+ nolink: _n,
686
+ punctuation: Xt,
687
+ reflink: gn,
688
+ reflinkSearch: vn,
689
+ tag: mn,
690
+ text: Jt,
691
+ url: j
692
+ }, xn = {
693
+ ...bn,
694
+ link: N(/^!?\[(label)\]\((.*?)\)/).replace("label", H).getRegex(),
695
+ reflink: N(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", H).getRegex()
696
+ }, Sn = {
697
+ ...bn,
698
+ emStrongRDelimAst: sn,
699
+ emStrongLDelim: rn,
700
+ delLDelim: ln,
701
+ delRDelim: un,
702
+ url: N(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", yn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
701
703
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
702
704
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
703
- text: M(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", gn).getRegex()
704
- }, vn = {
705
- ...H,
706
- br: M(Gt).replace("{2,}", "*").getRegex(),
707
- text: M(H.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
705
+ text: N(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", yn).getRegex()
706
+ }, Cn = {
707
+ ...Sn,
708
+ br: N(qt).replace("{2,}", "*").getRegex(),
709
+ text: N(Sn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
708
710
  }, U = {
709
- normal: I,
710
- gfm: Vt,
711
- pedantic: Ht
711
+ normal: Vt,
712
+ gfm: Ut,
713
+ pedantic: Wt
712
714
  }, W = {
713
- normal: V,
714
- gfm: H,
715
- breaks: vn,
716
- pedantic: _n
717
- }, yn = {
715
+ normal: bn,
716
+ gfm: Sn,
717
+ breaks: Cn,
718
+ pedantic: xn
719
+ }, wn = {
718
720
  "&": "&amp;",
719
721
  "<": "&lt;",
720
722
  ">": "&gt;",
721
723
  "\"": "&quot;",
722
724
  "'": "&#39;"
723
- }, bn = (e) => yn[e];
725
+ }, Tn = (e) => wn[e];
724
726
  function G(e, t) {
725
727
  if (t) {
726
- if (N.escapeTest.test(e)) return e.replace(N.escapeReplace, bn);
727
- } else if (N.escapeTestNoEncode.test(e)) return e.replace(N.escapeReplaceNoEncode, bn);
728
+ if (P.escapeTest.test(e)) return e.replace(P.escapeReplace, Tn);
729
+ } else if (P.escapeTestNoEncode.test(e)) return e.replace(P.escapeReplaceNoEncode, Tn);
728
730
  return e;
729
731
  }
730
- function xn(e) {
732
+ function En(e) {
731
733
  try {
732
- e = encodeURI(e).replace(N.percentDecode, "%");
734
+ e = encodeURI(e).replace(P.percentDecode, "%");
733
735
  } catch {
734
736
  return null;
735
737
  }
736
738
  return e;
737
739
  }
738
- function Sn(e, t) {
739
- let n = e.replace(N.findPipe, (e, t, n) => {
740
+ function Dn(e, t) {
741
+ let n = e.replace(P.findPipe, (e, t, n) => {
740
742
  let r = !1, i = t;
741
743
  for (; --i >= 0 && n[i] === "\\";) r = !r;
742
744
  return r ? "|" : " |";
743
- }).split(N.splitPipe), r = 0;
745
+ }).split(P.splitPipe), r = 0;
744
746
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
745
747
  else for (; n.length < t;) n.push("");
746
- for (; r < n.length; r++) n[r] = n[r].trim().replace(N.slashPipe, "|");
748
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(P.slashPipe, "|");
747
749
  return n;
748
750
  }
749
751
  function K(e, t, n) {
@@ -758,12 +760,12 @@ function K(e, t, n) {
758
760
  }
759
761
  return e.slice(0, r - i);
760
762
  }
761
- function Cn(e) {
763
+ function On(e) {
762
764
  let t = e.split("\n"), n = t.length - 1;
763
- for (; n >= 0 && N.blankLine.test(t[n]);) n--;
765
+ for (; n >= 0 && P.blankLine.test(t[n]);) n--;
764
766
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
765
767
  }
766
- function wn(e, t) {
768
+ function kn(e, t) {
767
769
  if (e.indexOf(t[1]) === -1) return -1;
768
770
  let n = 0;
769
771
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -771,7 +773,7 @@ function wn(e, t) {
771
773
  else if (e[r] === t[1] && (n--, n < 0)) return r;
772
774
  return n > 0 ? -2 : -1;
773
775
  }
774
- function Tn(e, t = 0) {
776
+ function An(e, t = 0) {
775
777
  let n = t, r = "";
776
778
  for (let t of e) if (t === " ") {
777
779
  let e = 4 - n % 4;
@@ -779,7 +781,7 @@ function Tn(e, t = 0) {
779
781
  } else r += t, n++;
780
782
  return r;
781
783
  }
782
- function En(e, t, n, r, i) {
784
+ function jn(e, t, n, r, i) {
783
785
  let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
784
786
  r.state.inLink = !0;
785
787
  let c = {
@@ -792,7 +794,7 @@ function En(e, t, n, r, i) {
792
794
  };
793
795
  return r.state.inLink = !1, c;
794
796
  }
795
- function Dn(e, t, n) {
797
+ function Mn(e, t, n) {
796
798
  let r = e.match(n.other.indentCodeCompensation);
797
799
  if (r === null) return t;
798
800
  let i = r[1];
@@ -808,7 +810,7 @@ var q = class {
808
810
  rules;
809
811
  lexer;
810
812
  constructor(e) {
811
- this.options = e || k;
813
+ this.options = e || A;
812
814
  }
813
815
  space(e) {
814
816
  let t = this.rules.block.newline.exec(e);
@@ -820,7 +822,7 @@ var q = class {
820
822
  code(e) {
821
823
  let t = this.rules.block.code.exec(e);
822
824
  if (t) {
823
- let e = this.options.pedantic ? t[0] : Cn(t[0]);
825
+ let e = this.options.pedantic ? t[0] : On(t[0]);
824
826
  return {
825
827
  type: "code",
826
828
  raw: e,
@@ -832,7 +834,7 @@ var q = class {
832
834
  fences(e) {
833
835
  let t = this.rules.block.fences.exec(e);
834
836
  if (t) {
835
- let e = t[0], n = Dn(e, t[3] || "", this.rules);
837
+ let e = t[0], n = Mn(e, t[3] || "", this.rules);
836
838
  return {
837
839
  type: "code",
838
840
  raw: e,
@@ -918,18 +920,18 @@ ${c}` : c;
918
920
  let n = !1, r = "", s = "";
919
921
  if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
920
922
  r = t[0], e = e.substring(r.length);
921
- let c = Tn(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
923
+ let c = An(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
922
924
  if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
923
- let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
925
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), ee = this.rules.other.blockquoteBeginRegex(d);
924
926
  for (; e;) {
925
- let p = e.split("\n", 1)[0], m;
926
- if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
927
- if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
927
+ let f = e.split("\n", 1)[0], p;
928
+ if (l = f, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), p = l) : p = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || ee.test(l) || t.test(l) || n.test(l)) break;
929
+ if (p.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + p.slice(d);
928
930
  else {
929
931
  if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
930
932
  s += "\n" + l;
931
933
  }
932
- u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
934
+ u = !l.trim(), r += f + "\n", e = e.substring(f.length + 1), c = p.slice(d);
933
935
  }
934
936
  }
935
937
  i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
@@ -984,7 +986,7 @@ ${c}` : c;
984
986
  html(e) {
985
987
  let t = this.rules.block.html.exec(e);
986
988
  if (t) {
987
- let e = Cn(t[0]);
989
+ let e = On(t[0]);
988
990
  return {
989
991
  type: "html",
990
992
  block: !0,
@@ -1010,7 +1012,7 @@ ${c}` : c;
1010
1012
  table(e) {
1011
1013
  let t = this.rules.block.table.exec(e);
1012
1014
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1013
- let n = Sn(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1015
+ let n = Dn(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1014
1016
  type: "table",
1015
1017
  raw: K(t[0], "\n"),
1016
1018
  header: [],
@@ -1025,7 +1027,7 @@ ${c}` : c;
1025
1027
  header: !0,
1026
1028
  align: a.align[e]
1027
1029
  });
1028
- for (let e of i) a.rows.push(Sn(e, a.header.length).map((e, t) => ({
1030
+ for (let e of i) a.rows.push(Dn(e, a.header.length).map((e, t) => ({
1029
1031
  text: e,
1030
1032
  tokens: this.lexer.inline(e),
1031
1033
  header: !1,
@@ -1096,7 +1098,7 @@ ${c}` : c;
1096
1098
  let t = K(e.slice(0, -1), "\\");
1097
1099
  if ((e.length - t.length) % 2 == 0) return;
1098
1100
  } else {
1099
- let e = wn(t[2], "()");
1101
+ let e = kn(t[2], "()");
1100
1102
  if (e === -2) return;
1101
1103
  if (e > -1) {
1102
1104
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
@@ -1108,7 +1110,7 @@ ${c}` : c;
1108
1110
  let e = this.rules.other.pedanticHrefTitle.exec(n);
1109
1111
  e && (n = e[1], r = e[3]);
1110
1112
  } else r = t[3] ? t[3].slice(1, -1) : "";
1111
- return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), En(t, {
1113
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), jn(t, {
1112
1114
  href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
1113
1115
  title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
1114
1116
  }, t[0], this.lexer, this.rules);
@@ -1126,7 +1128,7 @@ ${c}` : c;
1126
1128
  text: e
1127
1129
  };
1128
1130
  }
1129
- return En(n, e, n[0], this.lexer, this.rules);
1131
+ return jn(n, e, n[0], this.lexer, this.rules);
1130
1132
  }
1131
1133
  }
1132
1134
  emStrong(e, t, n = "") {
@@ -1265,13 +1267,13 @@ ${c}` : c;
1265
1267
  inlineQueue;
1266
1268
  tokenizer;
1267
1269
  constructor(e) {
1268
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || k, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1270
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || A, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1269
1271
  inLink: !1,
1270
1272
  inRawBlock: !1,
1271
1273
  top: !0
1272
1274
  };
1273
1275
  let t = {
1274
- other: N,
1276
+ other: P,
1275
1277
  block: U.normal,
1276
1278
  inline: W.normal
1277
1279
  };
@@ -1290,7 +1292,7 @@ ${c}` : c;
1290
1292
  return new e(n).inlineTokens(t);
1291
1293
  }
1292
1294
  lex(e) {
1293
- e = e.replace(N.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1295
+ e = e.replace(P.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1294
1296
  for (let e = 0; e < this.inlineQueue.length; e++) {
1295
1297
  let t = this.inlineQueue[e];
1296
1298
  this.inlineTokens(t.src, t.tokens);
@@ -1298,7 +1300,7 @@ ${c}` : c;
1298
1300
  return this.inlineQueue = [], this.tokens;
1299
1301
  }
1300
1302
  blockTokens(e, t = [], n = !1) {
1301
- this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(N.tabCharGlobal, " ").replace(N.spaceLine, ""));
1303
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(P.tabCharGlobal, " ").replace(P.spaceLine, ""));
1302
1304
  let r = Infinity;
1303
1305
  for (; e;) {
1304
1306
  if (e.length < r) r = e.length;
@@ -1484,13 +1486,13 @@ ${c}` : c;
1484
1486
  options;
1485
1487
  parser;
1486
1488
  constructor(e) {
1487
- this.options = e || k;
1489
+ this.options = e || A;
1488
1490
  }
1489
1491
  space(e) {
1490
1492
  return "";
1491
1493
  }
1492
1494
  code({ text: e, lang: t, escaped: n }) {
1493
- let r = (t || "").match(N.notSpaceStart)?.[0], i = e.replace(N.endingNewline, "") + "\n";
1495
+ let r = (t || "").match(P.notSpaceStart)?.[0], i = e.replace(P.endingNewline, "") + "\n";
1494
1496
  return r ? "<pre><code class=\"language-" + G(r) + "\">" + (n ? i : G(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : G(i, !0)) + "</code></pre>\n";
1495
1497
  }
1496
1498
  blockquote({ tokens: e }) {
@@ -1570,7 +1572,7 @@ ${e}</tr>
1570
1572
  return `<del>${this.parser.parseInline(e)}</del>`;
1571
1573
  }
1572
1574
  link({ href: e, title: t, tokens: n }) {
1573
- let r = this.parser.parseInline(n), i = xn(e);
1575
+ let r = this.parser.parseInline(n), i = En(e);
1574
1576
  if (i === null) return r;
1575
1577
  e = i;
1576
1578
  let a = "<a href=\"" + e + "\"";
@@ -1578,7 +1580,7 @@ ${e}</tr>
1578
1580
  }
1579
1581
  image({ href: e, title: t, text: n, tokens: r }) {
1580
1582
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1581
- let i = xn(e);
1583
+ let i = En(e);
1582
1584
  if (i === null) return G(n);
1583
1585
  e = i;
1584
1586
  let a = `<img src="${e}" alt="${G(n)}"`;
@@ -1587,7 +1589,7 @@ ${e}</tr>
1587
1589
  text(e) {
1588
1590
  return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : G(e.text);
1589
1591
  }
1590
- }, On = class {
1592
+ }, Nn = class {
1591
1593
  strong({ text: e }) {
1592
1594
  return e;
1593
1595
  }
@@ -1623,7 +1625,7 @@ ${e}</tr>
1623
1625
  renderer;
1624
1626
  textRenderer;
1625
1627
  constructor(e) {
1626
- this.options = e || k, this.options.renderer = this.options.renderer || new Y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new On();
1628
+ this.options = e || A, this.options.renderer = this.options.renderer || new Y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Nn();
1627
1629
  }
1628
1630
  static parse(t, n) {
1629
1631
  return new e(n).parse(t);
@@ -1773,7 +1775,7 @@ ${e}</tr>
1773
1775
  options;
1774
1776
  block;
1775
1777
  constructor(e) {
1776
- this.options = e || k;
1778
+ this.options = e || A;
1777
1779
  }
1778
1780
  static passThroughHooks = /* @__PURE__ */ new Set([
1779
1781
  "preprocess",
@@ -1805,13 +1807,13 @@ ${e}</tr>
1805
1807
  return e ? X.parse : X.parseInline;
1806
1808
  }
1807
1809
  }, Q = new class {
1808
- defaults = yt();
1810
+ defaults = Ct();
1809
1811
  options = this.setOptions;
1810
1812
  parse = this.parseMarkdown(!0);
1811
1813
  parseInline = this.parseMarkdown(!1);
1812
1814
  Parser = X;
1813
1815
  Renderer = Y;
1814
- TextRenderer = On;
1816
+ TextRenderer = Nn;
1815
1817
  Lexer = J;
1816
1818
  Tokenizer = q;
1817
1819
  Hooks = Z;
@@ -1983,45 +1985,54 @@ ${e}</tr>
1983
1985
  function $(e, t) {
1984
1986
  return Q.parse(e, t);
1985
1987
  }
1988
+ //#endregion
1989
+ //#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
1986
1990
  $.options = $.setOptions = function(e) {
1987
- return Q.setOptions(e), $.defaults = Q.defaults, bt($.defaults), $;
1988
- }, $.getDefaults = yt, $.defaults = k, $.use = function(...e) {
1989
- return Q.use(...e), $.defaults = Q.defaults, bt($.defaults), $;
1991
+ return Q.setOptions(e), $.defaults = Q.defaults, wt($.defaults), $;
1992
+ }, $.getDefaults = Ct, $.defaults = A, $.use = function(...e) {
1993
+ return Q.use(...e), $.defaults = Q.defaults, wt($.defaults), $;
1990
1994
  }, $.walkTokens = function(e, t) {
1991
1995
  return Q.walkTokens(e, t);
1992
- }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = Y, $.TextRenderer = On, $.Lexer = J, $.lexer = J.lex, $.Tokenizer = q, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, X.parse, J.lex;
1993
- //#endregion
1994
- //#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
1995
- var kn = ["innerHTML"], An = /* @__PURE__ */ o({
1996
+ }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = Y, $.TextRenderer = Nn, $.Lexer = J, $.lexer = J.lex, $.Tokenizer = q, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, X.parse, J.lex, e();
1997
+ var Pn = ["innerHTML"], Fn = /*#__PURE__*/ te(/* @__PURE__ */ a({
1996
1998
  __name: "PkStreamingMarkdown",
1997
1999
  props: {
1998
- markdown: { default: "" },
2000
+ markdown: {
2001
+ default: "",
2002
+ type: String
2003
+ },
1999
2004
  loading: {
2000
2005
  type: Boolean,
2001
2006
  default: !1
2002
2007
  },
2003
- animation: { default: "fadeIn" },
2004
- animationDuration: { default: "0.3s" },
2008
+ animation: {
2009
+ default: "fadeIn",
2010
+ type: [String, null]
2011
+ },
2012
+ animationDuration: {
2013
+ default: "0.3s",
2014
+ type: String
2015
+ },
2005
2016
  isDark: {
2006
2017
  type: Boolean,
2007
2018
  default: !1
2008
2019
  }
2009
2020
  },
2010
- setup(o) {
2011
- let d = o, f = null;
2012
- function p() {
2013
- return f ||= import("beautiful-mermaid"), f;
2021
+ setup(e) {
2022
+ let a = e, { t: te } = u({ useScope: "global" }), ne = null;
2023
+ function re() {
2024
+ return ne ||= import("./dist-PvBCQXAy.js"), ne;
2014
2025
  }
2015
- let ee = null;
2016
- function te() {
2017
- return ee ||= import("katex").then((e) => e.default), ee;
2026
+ let m = null;
2027
+ function ae() {
2028
+ return m ||= import("https://cdn.jsdelivr.net/npm/katex@0.16/dist/katex.mjs").then((e) => e.default), m;
2018
2029
  }
2019
- let ne = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, h = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
2020
- function re(e) {
2030
+ let oe = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, se = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
2031
+ function ce(e) {
2021
2032
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2022
2033
  }
2023
- function ie(e, t) {
2024
- return `<span class="katex-pending" data-katex="${re(e)}" data-display="${t}"></span>`;
2034
+ function h(e, t) {
2035
+ return `<span class="katex-pending" data-katex="${ce(e)}" data-display="${t}"></span>`;
2025
2036
  }
2026
2037
  $.use({ extensions: [{
2027
2038
  name: "inlineKatex",
@@ -2031,7 +2042,7 @@ var kn = ["innerHTML"], An = /* @__PURE__ */ o({
2031
2042
  if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
2032
2043
  },
2033
2044
  tokenizer(e) {
2034
- let t = e.match(ne);
2045
+ let t = e.match(oe);
2035
2046
  if (t) return {
2036
2047
  type: "inlineKatex",
2037
2048
  raw: t[0],
@@ -2040,13 +2051,13 @@ var kn = ["innerHTML"], An = /* @__PURE__ */ o({
2040
2051
  };
2041
2052
  },
2042
2053
  renderer(e) {
2043
- return ie(e.text, e.displayMode);
2054
+ return h(e.text, e.displayMode);
2044
2055
  }
2045
2056
  }, {
2046
2057
  name: "blockKatex",
2047
2058
  level: "block",
2048
2059
  tokenizer(e) {
2049
- let t = e.match(h);
2060
+ let t = e.match(se);
2050
2061
  if (t) return {
2051
2062
  type: "blockKatex",
2052
2063
  raw: t[0],
@@ -2055,7 +2066,7 @@ var kn = ["innerHTML"], An = /* @__PURE__ */ o({
2055
2066
  };
2056
2067
  },
2057
2068
  renderer(e) {
2058
- return ie(e.text, e.displayMode) + "\n";
2069
+ return h(e.text, e.displayMode) + "\n";
2059
2070
  }
2060
2071
  }] }), $.use({ extensions: [{
2061
2072
  name: "thinking",
@@ -2077,18 +2088,18 @@ var kn = ["innerHTML"], An = /* @__PURE__ */ o({
2077
2088
  }
2078
2089
  }] });
2079
2090
  let g = new $.Renderer();
2080
- g.link = function({ href: e, title: t, tokens: r }) {
2081
- let i = this.parser.parseInline(r);
2082
- return `<a href="${e}"${t ? ` title="${t}"` : ""}${n(e ?? "") ? "" : " target=\"_blank\" rel=\"noopener noreferrer\""}>${i}</a>`;
2091
+ g.link = function({ href: e, title: t, tokens: n }) {
2092
+ let r = this.parser.parseInline(n);
2093
+ return `<a href="${e}"${t ? ` title="${t}"` : ""}${f(e ?? "") ? "" : " target=\"_blank\" rel=\"noopener noreferrer\""}>${r}</a>`;
2083
2094
  }, g.table = function(e) {
2084
2095
  return `<div class="table-wrapper">${$.Renderer.prototype.table.call(this, e)}</div>`;
2085
2096
  };
2086
- let ae = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
2087
- g.code = ({ text: e }) => ae.test(e) ? `<pre class="mermaid">${e}</pre>` : `<pre><code>${e}</code></pre>`;
2088
- function oe(e) {
2097
+ let _ = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
2098
+ g.code = ({ text: e }) => _.test(e) ? `<pre class="mermaid">${e}</pre>` : `<pre><code>${e}</code></pre>`;
2099
+ function le(e) {
2089
2100
  return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
2090
2101
  }
2091
- function _(e) {
2102
+ function ue(e) {
2092
2103
  let t = /* @__PURE__ */ new Set(), n = /^(`{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
2093
2104
  for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
2094
2105
  return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
@@ -2100,129 +2111,140 @@ var kn = ["innerHTML"], An = /* @__PURE__ */ o({
2100
2111
  }
2101
2112
  }).replace(/\n{3,}/g, "\n\n");
2102
2113
  }
2103
- let se = [
2104
- m,
2105
- _,
2106
- vt,
2107
- oe
2108
- ], v = l("container"), { resolveText: y } = r(), ce = y(() => d.markdown), b = i(() => {
2109
- let e = se.reduce((e, t) => t(e), ce.value);
2114
+ let v = [
2115
+ ie,
2116
+ ue,
2117
+ St,
2118
+ le
2119
+ ], y = o("container"), { resolveText: de } = p(), b = de(() => a.markdown), x = c(() => {
2120
+ let e = v.reduce((e, t) => t(e), b.value);
2110
2121
  return $.parse(e, {
2111
2122
  async: !1,
2112
2123
  breaks: !0,
2113
2124
  renderer: g
2114
2125
  });
2115
2126
  });
2116
- async function le() {
2117
- if (d.loading) return;
2118
- await s();
2119
- let e = v.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
2127
+ async function fe() {
2128
+ if (a.loading) return;
2129
+ await t();
2130
+ let e = y.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
2120
2131
  if (!e?.length) return;
2121
- let { renderMermaidSVG: t, THEMES: n } = await p(), r = d.isDark ? n["github-dark"] : n["github-light"];
2122
- for (let n of Array.from(e)) {
2123
- if (!n.isConnected) continue;
2124
- let e = n.textContent?.trim();
2132
+ let { renderMermaidSVG: n, THEMES: r } = await re(), i = a.isDark ? r["github-dark"] : r["github-light"];
2133
+ for (let t of Array.from(e)) {
2134
+ if (!t.isConnected) continue;
2135
+ let e = t.textContent?.trim();
2125
2136
  if (e) try {
2126
- let i = t(e, r);
2127
- n.isConnected && (n.dataset.code = e, n.innerHTML = i, n.setAttribute("data-rendered", "true"));
2137
+ let r = n(e, i);
2138
+ t.isConnected && (t.dataset.code = e, t.innerHTML = r, t.setAttribute("data-rendered", "true"));
2128
2139
  } catch {}
2129
2140
  }
2130
2141
  }
2131
- async function ue() {
2132
- await s();
2133
- let e = v.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
2142
+ async function pe() {
2143
+ await t();
2144
+ let e = y.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
2134
2145
  if (!e?.length) return;
2135
- let t = (await import("highlight.js/lib/common")).default;
2136
- for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
2137
- }
2138
- async function de() {
2139
- await s();
2140
- let n = v.value?.querySelectorAll(".katex-pending");
2141
- if (!n?.length) return;
2142
- let r = await te();
2143
- e("https://cdn.jsdelivr.net/npm/katex@0.16/dist/katex.min.css", t(v.value));
2144
- for (let e of Array.from(n)) {
2145
- if (!e.isConnected) continue;
2146
- let t = e.dataset.katex;
2147
- if (!t) continue;
2148
- let n = e.dataset.display === "true";
2146
+ let n = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
2147
+ for (let t of e) n.highlightElement(t), t.setAttribute("data-highlighted", "true");
2148
+ }
2149
+ async function me() {
2150
+ await t();
2151
+ let e = y.value?.querySelectorAll(".katex-pending");
2152
+ if (!e?.length) return;
2153
+ let n = await ae();
2154
+ d("https://cdn.jsdelivr.net/npm/katex@0.16/dist/katex.min.css", ee(y.value));
2155
+ for (let t of Array.from(e)) {
2156
+ if (!t.isConnected) continue;
2157
+ let e = t.dataset.katex;
2158
+ if (!e) continue;
2159
+ let r = t.dataset.display === "true";
2149
2160
  try {
2150
- e.innerHTML = r.renderToString(t, {
2161
+ t.innerHTML = n.renderToString(e, {
2151
2162
  throwOnError: !1,
2152
- displayMode: n
2153
- }), e.classList.remove("katex-pending");
2163
+ displayMode: r
2164
+ }), t.classList.remove("katex-pending");
2154
2165
  } catch {}
2155
2166
  }
2156
2167
  }
2157
- async function fe() {
2158
- await s();
2159
- let e = v.value?.querySelectorAll("pre.mermaid[data-rendered]");
2168
+ async function he() {
2169
+ await t();
2170
+ let e = y.value?.querySelectorAll("pre.mermaid[data-rendered]");
2160
2171
  if (!e?.length) return;
2161
- let { renderMermaidSVG: t, THEMES: n } = await p(), r = d.isDark ? n["github-dark"] : n["github-light"];
2162
- for (let n of Array.from(e)) {
2163
- if (!n.isConnected) continue;
2164
- let e = n.dataset.code;
2172
+ let { renderMermaidSVG: n, THEMES: r } = await re(), i = a.isDark ? r["github-dark"] : r["github-light"];
2173
+ for (let t of Array.from(e)) {
2174
+ if (!t.isConnected) continue;
2175
+ let e = t.dataset.code;
2165
2176
  if (e) try {
2166
- n.innerHTML = t(e, r);
2177
+ t.innerHTML = n(e, i);
2167
2178
  } catch {}
2168
2179
  }
2169
2180
  }
2170
- u([b, () => d.loading], le, { immediate: !0 }), u(() => d.isDark, fe), u(b, ue, { immediate: !0 }), u(b, de, { immediate: !0 });
2171
- let x = 0;
2172
- function pe(e, t) {
2181
+ function S(e) {
2182
+ let t = e.target;
2183
+ if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
2184
+ t.dataset.broken = "true";
2173
2185
  let n = document.createElement("span");
2174
- return n.style.cssText = `animation:ft-${d.animation} ${d.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
2186
+ n.className = "markdown-broken-image", n.textContent = t.alt || te("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
2187
+ }
2188
+ r(() => {
2189
+ y.value?.addEventListener("error", S, !0);
2190
+ }), n(() => {
2191
+ y.value?.removeEventListener("error", S, !0);
2192
+ }), i([x, () => a.loading], fe, { immediate: !0 }), i(() => a.isDark, he), i(x, pe, { immediate: !0 }), i(x, me, { immediate: !0 });
2193
+ let C = 0;
2194
+ function ge(e, t) {
2195
+ let n = document.createElement("span");
2196
+ return n.style.cssText = `animation:ft-${a.animation} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
2175
2197
  let t = n.parentNode;
2176
2198
  t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
2177
2199
  }, { once: !0 }), n;
2178
2200
  }
2179
- function me(e, t, n, r) {
2201
+ function w(e, t, n, r) {
2180
2202
  let i = r, a = e.split(/(\s+)/);
2181
2203
  for (let e of a) if (e) {
2182
2204
  if (/^\s+$/.test(e)) {
2183
2205
  t.insertBefore(document.createTextNode(e), n);
2184
2206
  continue;
2185
2207
  }
2186
- t.insertBefore(pe(e, i * 30), n), i++;
2208
+ t.insertBefore(ge(e, i * 30), n), i++;
2187
2209
  }
2188
2210
  return i;
2189
2211
  }
2190
- function S(e) {
2212
+ function T(e) {
2191
2213
  let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
2192
- return e.parentElement?.closest("pre, code, .katex-pending") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2214
+ return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2193
2215
  } }), n = [];
2194
2216
  for (; t.nextNode();) n.push(t.currentNode);
2195
2217
  return n;
2196
2218
  }
2197
- function C() {
2198
- if (!v.value || !d.loading || !d.animation) return;
2199
- let e = S(v.value), t = 0, n = 0;
2219
+ function E() {
2220
+ if (!y.value || !a.loading || !a.animation) return;
2221
+ let e = T(y.value), t = 0, n = 0;
2200
2222
  for (let r of e) {
2201
2223
  let e = r.textContent || "", i = t, a = t + e.length;
2202
- if (t = a, a <= x) continue;
2224
+ if (t = a, a <= C) continue;
2203
2225
  let o = r.parentNode;
2204
2226
  if (!o) continue;
2205
- if (i >= x) {
2227
+ if (i >= C) {
2206
2228
  let t = r.nextSibling;
2207
- o.removeChild(r), n = me(e, o, t, n);
2229
+ o.removeChild(r), n = w(e, o, t, n);
2208
2230
  continue;
2209
2231
  }
2210
- let s = x - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
2211
- o.removeChild(c), n = me(l, o, u, n);
2232
+ let s = C - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
2233
+ o.removeChild(c), n = w(l, o, u, n);
2212
2234
  }
2213
- x = t;
2235
+ C = t;
2214
2236
  }
2215
- return u(b, async () => {
2216
- await s(), C();
2217
- }, { immediate: !0 }), u(() => d.markdown, (e, t) => {
2218
- (!e || t && e.length < t.length) && (x = 0);
2219
- }), (e, t) => (c(), a("div", {
2237
+ return i(x, async () => {
2238
+ await t(), E();
2239
+ }, { immediate: !0 }), i(() => a.markdown, (e, t) => {
2240
+ (!e || t && e.length < t.length) && (C = 0);
2241
+ }), (e, t) => (l(), s("div", {
2220
2242
  ref: "container",
2221
- innerHTML: b.value
2222
- }, null, 8, kn));
2243
+ innerHTML: x.value
2244
+ }, null, 8, Pn));
2223
2245
  }
2224
- });
2246
+ }), [["styles", [".markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
2225
2247
  //#endregion
2226
- export { An as t };
2248
+ export { Fn as t };
2227
2249
 
2228
- //# sourceMappingURL=PkStreamingMarkdown-CjBMQ18U.js.map
2250
+ //# sourceMappingURL=PkStreamingMarkdown-CHhH4FdH.js.map