@8wave/ai-elements 0.126.0-beta.40 → 0.126.0-beta.42
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.
- package/dist/_chunks/{Agent-DZEyfr8D.js → Agent-DJ6TBi6l.js} +143 -138
- package/dist/_chunks/Agent-DJ6TBi6l.js.map +1 -0
- package/dist/_chunks/{PkFilePreview-BHqmp1EW.js → PkFilePreview-BrWWeK4E.js} +3 -3
- package/dist/_chunks/{PkFilePreview-BHqmp1EW.js.map → PkFilePreview-BrWWeK4E.js.map} +1 -1
- package/dist/_chunks/{PkFilePreviewDialog-BHAgVlKs.js → PkFilePreviewDialog-BRZH_LxY.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-BHAgVlKs.js.map → PkFilePreviewDialog-BRZH_LxY.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-BDwL39Du.js → PkImageEditorDialog-D21ggZkD.js} +6 -5
- package/dist/_chunks/{PkImageEditorDialog-BDwL39Du.js.map → PkImageEditorDialog-D21ggZkD.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-DLsZ8-gW.js → PkSelectionActions-BLfFobXb.js} +2 -2
- package/dist/_chunks/{PkSelectionActions-DLsZ8-gW.js.map → PkSelectionActions-BLfFobXb.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-14rJ_FK2.js → PkStreamingMarkdown-Bekhx_vG.js} +300 -213
- package/dist/_chunks/PkStreamingMarkdown-Bekhx_vG.js.map +1 -0
- package/dist/_chunks/{PkToolChatFile-62j1S0Pq.js → PkToolChatFile-BzN4fMaY.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-62j1S0Pq.js.map → PkToolChatFile-BzN4fMaY.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-B9EM_K6O.js → PkToolRequestGeolocation-Dj5OxEMP.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-B9EM_K6O.js.map → PkToolRequestGeolocation-Dj5OxEMP.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CfjfqCHX.js → PkToolRequestOAuthConnection-Cj_IYnrW.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CfjfqCHX.js.map → PkToolRequestOAuthConnection-Cj_IYnrW.js.map} +1 -1
- package/dist/_chunks/PkToolShowArtifact-BkGtejtb.js +110 -0
- package/dist/_chunks/PkToolShowArtifact-BkGtejtb.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-BeJ5GR6t.js → PkToolShowContactForm-BXsvfCKR.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-BeJ5GR6t.js.map → PkToolShowContactForm-BXsvfCKR.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-B9VDoS_W.js → PkToolShowForm-DeG_AzO9.js} +4 -4
- package/dist/_chunks/{PkToolShowForm-B9VDoS_W.js.map → PkToolShowForm-DeG_AzO9.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-DFuc5IJ1.js → PkToolShowImageGallery-Dri9KUNg.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-DFuc5IJ1.js.map → PkToolShowImageGallery-Dri9KUNg.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-C2EJKYOV.js → PkToolShowProductList-C-XQdsus.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-C2EJKYOV.js.map → PkToolShowProductList-C-XQdsus.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BL3DnfcN.js → PkToolShowSources-DMDML2kQ.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BL3DnfcN.js.map → PkToolShowSources-DMDML2kQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-DLgtjBJ1.js → PkToolShowSuggestedReply-BYoW-L6k.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-DLgtjBJ1.js.map → PkToolShowSuggestedReply-BYoW-L6k.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DcWXDcOZ.js → PkToolShowVideo-C_1ziurv.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DcWXDcOZ.js.map → PkToolShowVideo-C_1ziurv.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-CPqMC6qt.js → PkToolShowWebPages-yFdm0n0F.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-CPqMC6qt.js.map → PkToolShowWebPages-yFdm0n0F.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-DMt6O5iK.js → chatImagePolicy-Dqke0kDv.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-DMt6O5iK.js.map → chatImagePolicy-Dqke0kDv.js.map} +1 -1
- package/dist/_chunks/{markdown-nw5sXwU0.js → markdown-Z_eeOlvv.js} +16 -16
- package/dist/_chunks/{markdown-nw5sXwU0.js.map → markdown-Z_eeOlvv.js.map} +1 -1
- package/dist/_chunks/{utils-DE4cAz37.js → utils-C1JaUBI_.js} +2 -2
- package/dist/_chunks/{utils-DE4cAz37.js.map → utils-C1JaUBI_.js.map} +1 -1
- package/dist/ai-elements.es.js +3754 -3573
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-CBAd3F7k.js → Agent-DrnYCRFA.js} +2 -2
- package/dist-vue/_chunks/{Agent-CBAd3F7k.js.map → Agent-DrnYCRFA.js.map} +1 -1
- package/dist-vue/_chunks/{Document-B3w5H0R0.js → Document-CA7c3oZE.js} +11 -11
- package/dist-vue/_chunks/{Document-B3w5H0R0.js.map → Document-CA7c3oZE.js.map} +1 -1
- package/dist-vue/_chunks/{Media-0U2B_qCS.js → Media-BIlhY_h6.js} +31 -26
- package/dist-vue/_chunks/Media-BIlhY_h6.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-aCgj2DMu.js → PkChatbot-QjeNY0h6.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-aCgj2DMu.js.map → PkChatbot-QjeNY0h6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotAuth-C5agN8ht.js → PkChatbotAuth-C8ZjLNFY.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-C5agN8ht.js.map → PkChatbotAuth-C8ZjLNFY.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-CLfzcH_t.js → PkChatbotEmptyState-D6S0iYe3.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CLfzcH_t.js.map → PkChatbotEmptyState-D6S0iYe3.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotInput-CunAf5Rq.js +708 -0
- package/dist-vue/_chunks/PkChatbotInput-CunAf5Rq.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-CG3UZYcP.js → PkChatbotMessages-CzPsgCAN.js} +351 -326
- package/dist-vue/_chunks/PkChatbotMessages-CzPsgCAN.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-fyrbP7yS.js → PkChatbotStepPayload-BQDpTDgn.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-fyrbP7yS.js.map → PkChatbotStepPayload-BQDpTDgn.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Drhc6X-x.js → PkChatbotStepToolDetail-Dsf9t1B6.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-Drhc6X-x.js.map → PkChatbotStepToolDetail-Dsf9t1B6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DZwV7UVr.js → PkChatbotSteps-HACZ1RrB.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-DZwV7UVr.js.map → PkChatbotSteps-HACZ1RrB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-IU3HJpxG.js → PkChatbotViewChat-BpDCX_72.js} +107 -107
- package/dist-vue/_chunks/PkChatbotViewChat-BpDCX_72.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-4zGrp7Fo.js → PkChatbotViewConversations-B0nUFwuu.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-4zGrp7Fo.js.map → PkChatbotViewConversations-B0nUFwuu.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-PHdrHZOf.js → PkChatbotViewFiles-gGshDAPk.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-PHdrHZOf.js.map → PkChatbotViewFiles-gGshDAPk.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BrZ7oiUY.js → PkChatbotViewProfile-BuJtqq8F.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BrZ7oiUY.js.map → PkChatbotViewProfile-BuJtqq8F.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-WqS-s3vk.js → PkFilePreview-0p50S8Km.js} +4 -4
- package/dist-vue/_chunks/{PkFilePreview-WqS-s3vk.js.map → PkFilePreview-0p50S8Km.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-BIaTAK05.js → PkFilePreviewDialog-B1N4xDEu.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-BIaTAK05.js.map → PkFilePreviewDialog-B1N4xDEu.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-_-UkV0CO.js → PkImageEditorDialog-B-jW5yE8.js} +6 -5
- package/dist-vue/_chunks/{PkImageEditorDialog-_-UkV0CO.js.map → PkImageEditorDialog-B-jW5yE8.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-ha0V58V9.js → PkStreamingMarkdown-WIueQOg3.js} +530 -445
- package/dist-vue/_chunks/PkStreamingMarkdown-WIueQOg3.js.map +1 -0
- package/dist-vue/_chunks/{PkToolChatFile-OusYITiO.js → PkToolChatFile-W6OJP7HH.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-OusYITiO.js.map → PkToolChatFile-W6OJP7HH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-CyL_M1Rm.js → PkToolRequestGeolocation-BPZfJfR1.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-CyL_M1Rm.js.map → PkToolRequestGeolocation-BPZfJfR1.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DWkeVLpx.js → PkToolRequestOAuthConnection-BaMZkvU5.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DWkeVLpx.js.map → PkToolRequestOAuthConnection-BaMZkvU5.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowArtifact-CPBFsUrY.js +107 -0
- package/dist-vue/_chunks/PkToolShowArtifact-CPBFsUrY.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowChart-BSnYmoJJ.js → PkToolShowChart-BaUS47YU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowChart-BSnYmoJJ.js.map → PkToolShowChart-BaUS47YU.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-DFufPNnQ.js → PkToolShowContactForm-6OQ-hjCt.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-DFufPNnQ.js.map → PkToolShowContactForm-6OQ-hjCt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BR4fE_be.js → PkToolShowDiagram-D6hPQVoe.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BR4fE_be.js.map → PkToolShowDiagram-D6hPQVoe.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-yh0YAXcg.js → PkToolShowForm-CAadu_Pq.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-yh0YAXcg.js.map → PkToolShowForm-CAadu_Pq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-mmUY1Yfg.js → PkToolShowImageGallery-BlTyCF8h.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-mmUY1Yfg.js.map → PkToolShowImageGallery-BlTyCF8h.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-B-ya1TDt.js → PkToolShowProductList-CZFkf9UD.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-B-ya1TDt.js.map → PkToolShowProductList-CZFkf9UD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-DYkHkVdX.js → PkToolShowSources-Bci0Ab2u.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-DYkHkVdX.js.map → PkToolShowSources-Bci0Ab2u.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-wKgwHTRO.js → PkToolShowSuggestedReply-DCZbwFhR.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-wKgwHTRO.js.map → PkToolShowSuggestedReply-DCZbwFhR.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CRg2lAY8.js → PkToolShowVideo-BnSYdoTJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CRg2lAY8.js.map → PkToolShowVideo-BnSYdoTJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-C_pWag94.js → PkToolShowWebPages-CHrHuFZI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-C_pWag94.js.map → PkToolShowWebPages-CHrHuFZI.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DBKfGL6y.js → createChatbotApiClient-_gh3Y1rl.js} +3 -3
- package/dist-vue/_chunks/createChatbotApiClient-_gh3Y1rl.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-Hb5EjISl.js → useChatbotStore-CjFPM9Q5.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-Hb5EjISl.js.map → useChatbotStore-CjFPM9Q5.js.map} +1 -1
- package/dist-vue/_chunks/{utils-Df5n2cDc.js → utils-BYvQMZLG.js} +2 -2
- package/dist-vue/_chunks/{utils-Df5n2cDc.js.map → utils-BYvQMZLG.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +40 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +71 -71
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +10 -0
- package/dist-vue/packages/components/src/chat/PkChatbotInput.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkImageEditorDialog.d.ts +5 -0
- package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/richCopy.d.ts +33 -0
- package/dist-vue/packages/components/src/chat/screenshot.d.ts +38 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DZEyfr8D.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-14rJ_FK2.js.map +0 -1
- package/dist/_chunks/PkToolShowArtifact-I_QZS7Pf.js +0 -94
- package/dist/_chunks/PkToolShowArtifact-I_QZS7Pf.js.map +0 -1
- package/dist-vue/_chunks/Media-0U2B_qCS.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-C9l_1I3d.js +0 -584
- package/dist-vue/_chunks/PkChatbotInput-C9l_1I3d.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CG3UZYcP.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-IU3HJpxG.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-ha0V58V9.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowArtifact-x57Gri2a.js +0 -91
- package/dist-vue/_chunks/PkToolShowArtifact-x57Gri2a.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-DBKfGL6y.js.map +0 -1
package/dist-vue/_chunks/{PkStreamingMarkdown-ha0V58V9.js → PkStreamingMarkdown-WIueQOg3.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as e } from "./utils-
|
|
2
|
-
import { W as t } from "./Agent-
|
|
1
|
+
import { v as e } from "./utils-BYvQMZLG.js";
|
|
2
|
+
import { W as t } from "./Agent-DrnYCRFA.js";
|
|
3
3
|
import { a as n, o as r, s as i } from "./useLightbox-DrEFS3gx.js";
|
|
4
4
|
import "./src-nb8MU1sh.js";
|
|
5
5
|
import { i as a, n as o } from "./url-validation-CJV9pp4v.js";
|
|
@@ -167,7 +167,7 @@ var b = Object.defineProperty, ce = Object.defineProperties, le = Object.getOwnP
|
|
|
167
167
|
let n = E(e), r = t + t, i = 0;
|
|
168
168
|
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === S.PROSE ? (i += 1, t += 2) : t += 1;
|
|
169
169
|
return i;
|
|
170
|
-
}, je = /* @__PURE__ */ new Uint8Array(), Me = (e) => e === "inlineLatex" || e === "blockLatex", Ne = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Pe = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar",
|
|
170
|
+
}, je = /* @__PURE__ */ new Uint8Array(), Me = (e) => e === "inlineLatex" || e === "blockLatex", Ne = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Pe = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", k = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Fe = (e, t, n) => {
|
|
171
171
|
let r = e[t + 1];
|
|
172
172
|
if (e[t] === "\\") {
|
|
173
173
|
if (r === "$") return {
|
|
@@ -188,27 +188,27 @@ var b = Object.defineProperty, ce = Object.defineProperties, le = Object.getOwnP
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
return null;
|
|
191
|
-
},
|
|
191
|
+
}, Ie = (e) => {
|
|
192
192
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
193
193
|
for (; o < r;) {
|
|
194
194
|
i[o] = a === "none" ? 0 : 1;
|
|
195
|
-
let e = n[o] === S.PROSE ?
|
|
195
|
+
let e = n[o] === S.PROSE ? Fe(t, o, a) : null;
|
|
196
196
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
197
197
|
}
|
|
198
198
|
return i;
|
|
199
|
-
},
|
|
199
|
+
}, Le = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = k(e.text) ? Ie(e) : je), e.mathMask[t] === 1), Re = (e, t, n, r) => {
|
|
200
200
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
201
201
|
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === S.PROSE && (s = 1), o[e - t] = s;
|
|
202
202
|
let c = !1;
|
|
203
203
|
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === S.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
204
|
-
},
|
|
204
|
+
}, ze = (e) => {
|
|
205
205
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
206
206
|
for (; i < n;) {
|
|
207
207
|
let a = t.indexOf("\n", i);
|
|
208
|
-
a === -1 && (a = n),
|
|
208
|
+
a === -1 && (a = n), Re(e, i, a, r), i = a + 1;
|
|
209
209
|
}
|
|
210
210
|
return r;
|
|
211
|
-
},
|
|
211
|
+
}, Be = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? ze(e) : je), e.linkUrlMask[t] === 1), Ve = (e) => {
|
|
212
212
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
213
213
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
214
214
|
else if (i[e] = +!!a, n[e] === S.PROSE) {
|
|
@@ -219,56 +219,56 @@ var b = Object.defineProperty, ce = Object.defineProperties, le = Object.getOwnP
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
return i;
|
|
222
|
-
},
|
|
222
|
+
}, He = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Ve(e) : je), e.htmlTagMask[t] === 1), A = (e, t) => ke(E(e), t), j = (e, t) => Ae(E(e), t), Ue = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, We = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ue, (t, n, r, i) => A(e, i) ? t : `${n}\\>${r}`), M = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
223
223
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
224
224
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
225
|
-
},
|
|
225
|
+
}, Ge = {
|
|
226
226
|
delimiter: "*",
|
|
227
227
|
markerLength: 2,
|
|
228
228
|
regex: /(\*\*)([^*]*\*?)$/
|
|
229
|
-
},
|
|
229
|
+
}, Ke = {
|
|
230
230
|
delimiter: "_",
|
|
231
231
|
markerLength: 2,
|
|
232
232
|
regex: /(__)([^_]*?)$/
|
|
233
|
-
},
|
|
233
|
+
}, qe = {
|
|
234
234
|
delimiter: "*",
|
|
235
235
|
markerLength: 3,
|
|
236
236
|
regex: /(\*\*\*)([^*]*?)$/
|
|
237
|
-
},
|
|
237
|
+
}, Je = {
|
|
238
238
|
delimiter: "*",
|
|
239
239
|
markerLength: 1,
|
|
240
240
|
regex: /(\*)([^*]*?)$/
|
|
241
|
-
},
|
|
241
|
+
}, Ye = {
|
|
242
242
|
delimiter: "_",
|
|
243
243
|
markerLength: 1,
|
|
244
244
|
regex: /(_)([^_]*?)$/
|
|
245
|
-
},
|
|
245
|
+
}, Xe = {
|
|
246
246
|
delimiter: "~",
|
|
247
247
|
markerLength: 2,
|
|
248
248
|
regex: /(~~)([^~]*?)$/
|
|
249
|
-
},
|
|
249
|
+
}, Ze = {
|
|
250
250
|
delimiter: "_",
|
|
251
251
|
markerLength: 2,
|
|
252
252
|
regex: /(__)([^_]+)_$/
|
|
253
|
-
},
|
|
253
|
+
}, Qe = {
|
|
254
254
|
delimiter: "~",
|
|
255
255
|
markerLength: 2,
|
|
256
256
|
regex: /(~~)([^~]+)~$/
|
|
257
|
-
},
|
|
257
|
+
}, $e = /^[\s_~*`]*$/, et = /^[\s]*[-*+][\s]+$/, tt = /[\p{L}\p{N}_]/u, N = /^\*{4,}$/, P = (e) => {
|
|
258
258
|
if (!e) return !1;
|
|
259
259
|
let t = e.charCodeAt(0);
|
|
260
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
261
|
-
},
|
|
260
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || tt.test(e);
|
|
261
|
+
}, nt = (e, t) => {
|
|
262
262
|
let n = 1;
|
|
263
263
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
264
264
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
265
265
|
return -1;
|
|
266
|
-
},
|
|
266
|
+
}, rt = (e, t) => {
|
|
267
267
|
let n = 1;
|
|
268
268
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
269
269
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
270
270
|
return -1;
|
|
271
|
-
},
|
|
271
|
+
}, it = (e, t) => Le(E(e), t), at = (e, t, n) => {
|
|
272
272
|
let r = 0;
|
|
273
273
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
274
274
|
r = n + 1;
|
|
@@ -286,52 +286,52 @@ var b = Object.defineProperty, ce = Object.defineProperties, le = Object.getOwnP
|
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
return o >= 3 && !s;
|
|
289
|
-
},
|
|
290
|
-
let i =
|
|
289
|
+
}, ot = (e, t, n, r) => n === "\\" || Le(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), st = (e) => e === " " || e === " " || e === "\n", ct = (e, t) => !!(e && t && P(e) && P(t)), lt = (e, t, n, r) => {
|
|
290
|
+
let i = ct(e, t), a = !!t && !st(t), o = !!e && !st(e);
|
|
291
291
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
292
292
|
count: !0,
|
|
293
293
|
inWordAsteriskChain: i
|
|
294
294
|
} : { count: !1 };
|
|
295
|
-
},
|
|
295
|
+
}, ut = (e) => {
|
|
296
296
|
let t = E(e), n = 0, r = !1, i = e.length;
|
|
297
297
|
for (let a = 0; a < i; a += 1) {
|
|
298
298
|
if (e[a] !== "*" || t.regions[a] !== S.PROSE) {
|
|
299
|
-
|
|
299
|
+
P(e[a]) || (r = !1);
|
|
300
300
|
continue;
|
|
301
301
|
}
|
|
302
302
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
303
|
-
if (
|
|
304
|
-
let c =
|
|
303
|
+
if (ot(t, a, o, s)) continue;
|
|
304
|
+
let c = lt(o, s, n, r);
|
|
305
305
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
306
306
|
}
|
|
307
307
|
return n;
|
|
308
|
-
},
|
|
308
|
+
}, dt = (e, t, n, r) => !!(n === "\\" || Le(e, t) || Be(e, t) || He(e, t) || n === "_" || r === "_" || n && r && P(n) && P(r)), F = (e) => {
|
|
309
309
|
let t = E(e), n = 0, r = e.length;
|
|
310
310
|
for (let i = 0; i < r; i += 1) {
|
|
311
311
|
if (e[i] !== "_" || t.regions[i] !== S.PROSE) continue;
|
|
312
312
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
313
|
-
|
|
313
|
+
dt(t, i, a, o) || (n += 1);
|
|
314
314
|
}
|
|
315
315
|
return n;
|
|
316
|
-
},
|
|
316
|
+
}, ft = (e) => {
|
|
317
317
|
let t = E(e), n = 0, r = 0;
|
|
318
318
|
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === S.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
319
319
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
320
|
-
},
|
|
321
|
-
if (!(
|
|
320
|
+
}, pt = (e) => O(e, "*"), mt = (e) => e === "" || e === " " || e === " " || e === "\n", ht = (e, t, n, r, i) => {
|
|
321
|
+
if (!(mt(n) && mt(r))) return !1;
|
|
322
322
|
if (t > i.lineEnd) {
|
|
323
323
|
let n = e.indexOf("\n", t);
|
|
324
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
324
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = at(e, t, "_");
|
|
325
325
|
}
|
|
326
326
|
return i.result;
|
|
327
|
-
},
|
|
327
|
+
}, gt = (e, t, n, r) => {
|
|
328
328
|
let i = e.text, a = t, o = !1;
|
|
329
329
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
330
330
|
let s = n - a;
|
|
331
331
|
if (s < 2) return !1;
|
|
332
332
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
333
|
-
return
|
|
334
|
-
},
|
|
333
|
+
return P(l) && P(u) || ht(i, a, l, u, r) || Le(e, a) || Be(e, a) || He(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
334
|
+
}, _t = (e) => {
|
|
335
335
|
let t = E(e), n = e.length, r = {
|
|
336
336
|
lineEnd: -1,
|
|
337
337
|
result: !1
|
|
@@ -343,127 +343,127 @@ var b = Object.defineProperty, ce = Object.defineProperties, le = Object.getOwnP
|
|
|
343
343
|
}
|
|
344
344
|
let o = a, s = a + 1;
|
|
345
345
|
for (; s < n && e[s] === "_" && t.regions[s] === S.PROSE;) s += 1;
|
|
346
|
-
a = s,
|
|
346
|
+
a = s, gt(t, o, s, r) && (i = !i);
|
|
347
347
|
}
|
|
348
348
|
return i;
|
|
349
|
-
},
|
|
350
|
-
if (!t ||
|
|
349
|
+
}, vt = (e, t, n) => {
|
|
350
|
+
if (!t || $e.test(t)) return !0;
|
|
351
351
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
352
|
-
return
|
|
353
|
-
},
|
|
354
|
-
let t =
|
|
352
|
+
return et.test(a) && t.includes("\n") ? !0 : at(e, n, "*");
|
|
353
|
+
}, yt = (e) => {
|
|
354
|
+
let t = M(e, Ge);
|
|
355
355
|
if (!t) return e;
|
|
356
356
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
357
|
-
return
|
|
358
|
-
},
|
|
359
|
-
if (!t ||
|
|
357
|
+
return A(e, r) || j(e, r) || vt(e, n, r) ? e : pt(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
358
|
+
}, bt = (e, t, n) => {
|
|
359
|
+
if (!t || $e.test(t)) return !0;
|
|
360
360
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
361
|
-
return
|
|
362
|
-
},
|
|
363
|
-
let t =
|
|
361
|
+
return et.test(a) && t.includes("\n") ? !0 : at(e, n, "_");
|
|
362
|
+
}, xt = (e) => {
|
|
363
|
+
let t = M(e, Ke);
|
|
364
364
|
if (!t) {
|
|
365
|
-
let t =
|
|
365
|
+
let t = M(e, Ze);
|
|
366
366
|
if (t) {
|
|
367
367
|
let n = e.lastIndexOf(t[1]);
|
|
368
|
-
if (!(
|
|
368
|
+
if (!(A(e, n) || j(e, n)) && _t(e)) return `${e}_`;
|
|
369
369
|
}
|
|
370
370
|
return e;
|
|
371
371
|
}
|
|
372
372
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
373
|
-
return
|
|
374
|
-
},
|
|
373
|
+
return A(e, r) || j(e, r) || bt(e, n, r) ? e : _t(e) ? `${e}__` : e;
|
|
374
|
+
}, St = (e, t) => {
|
|
375
375
|
let { text: n } = e;
|
|
376
|
-
return n[t] === "*" && e.regions[t] === S.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !
|
|
377
|
-
},
|
|
376
|
+
return n[t] === "*" && e.regions[t] === S.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Le(e, t);
|
|
377
|
+
}, Ct = (e) => {
|
|
378
378
|
let t = E(e);
|
|
379
379
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
380
|
-
if (!
|
|
381
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
382
|
-
if (!(a && o) && !(r && i &&
|
|
380
|
+
if (!St(t, n)) continue;
|
|
381
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || st(r), o = !i || st(i);
|
|
382
|
+
if (!(a && o) && !(r && i && P(r) && P(i)) && !o) return n;
|
|
383
383
|
}
|
|
384
384
|
return -1;
|
|
385
|
-
},
|
|
386
|
-
if (!
|
|
387
|
-
let t =
|
|
388
|
-
if (t === -1 ||
|
|
385
|
+
}, wt = (e) => {
|
|
386
|
+
if (!M(e, Je)) return e;
|
|
387
|
+
let t = Ct(e);
|
|
388
|
+
if (t === -1 || A(e, t) || j(e, t)) return e;
|
|
389
389
|
let n = e.substring(t + 1);
|
|
390
|
-
return !n ||
|
|
391
|
-
},
|
|
390
|
+
return !n || $e.test(n) ? e : ut(e) % 2 == 1 ? `${e}*` : e;
|
|
391
|
+
}, Tt = (e) => {
|
|
392
392
|
let t = E(e);
|
|
393
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === S.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !
|
|
393
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === S.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Le(t, n) && !Be(t, n)) {
|
|
394
394
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
395
|
-
if (t && r &&
|
|
395
|
+
if (t && r && P(t) && P(r)) continue;
|
|
396
396
|
return n;
|
|
397
397
|
}
|
|
398
398
|
return -1;
|
|
399
|
-
},
|
|
399
|
+
}, Et = (e) => {
|
|
400
400
|
let t = e.length;
|
|
401
401
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
402
402
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
403
|
-
},
|
|
403
|
+
}, Dt = (e) => {
|
|
404
404
|
if (!e.endsWith("**")) return null;
|
|
405
405
|
let t = e.slice(0, -2);
|
|
406
|
-
if (
|
|
407
|
-
let n = t.indexOf("**"), r =
|
|
406
|
+
if (pt(t) % 2 != 1) return null;
|
|
407
|
+
let n = t.indexOf("**"), r = Tt(t);
|
|
408
408
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
409
|
-
},
|
|
410
|
-
if (!
|
|
411
|
-
let t =
|
|
409
|
+
}, Ot = (e) => {
|
|
410
|
+
if (!M(e, Ye)) return e;
|
|
411
|
+
let t = Tt(e);
|
|
412
412
|
if (t === -1) return e;
|
|
413
413
|
let n = e.substring(t + 1);
|
|
414
|
-
if (!n ||
|
|
415
|
-
if (
|
|
416
|
-
let t =
|
|
417
|
-
return t === null ?
|
|
414
|
+
if (!n || $e.test(n) || A(e, t) || j(e, t)) return e;
|
|
415
|
+
if (F(e) % 2 == 1) {
|
|
416
|
+
let t = Dt(e);
|
|
417
|
+
return t === null ? Et(e) : t;
|
|
418
418
|
}
|
|
419
419
|
return e;
|
|
420
|
-
},
|
|
421
|
-
let t =
|
|
420
|
+
}, kt = (e) => {
|
|
421
|
+
let t = pt(e), n = ut(e);
|
|
422
422
|
return t % 2 == 0 && n % 2 == 0;
|
|
423
|
-
},
|
|
424
|
-
if (
|
|
425
|
-
let t =
|
|
423
|
+
}, At = (e, t, n) => !t || $e.test(t) || A(e, n) || j(e, n) ? !0 : at(e, n, "*"), jt = (e) => {
|
|
424
|
+
if (N.test(e)) return e;
|
|
425
|
+
let t = M(e, qe);
|
|
426
426
|
if (!t) return e;
|
|
427
427
|
let n = t[2];
|
|
428
|
-
return
|
|
429
|
-
},
|
|
428
|
+
return At(e, n, e.lastIndexOf(t[1])) ? e : ft(e) % 2 == 1 ? kt(e) ? e : `${e}***` : e;
|
|
429
|
+
}, Mt = /<[a-zA-Z/][^>]*$/, Nt = /[a-zA-Z/]/, Pt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ft = (e, t) => {
|
|
430
430
|
let n = e[t + 1];
|
|
431
|
-
return n !== void 0 &&
|
|
432
|
-
},
|
|
433
|
-
let t = e.match(
|
|
431
|
+
return n !== void 0 && Nt.test(n);
|
|
432
|
+
}, It = (e) => {
|
|
433
|
+
let t = e.match(Mt);
|
|
434
434
|
if (!t || t.index === void 0) return e;
|
|
435
|
-
let n =
|
|
436
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
435
|
+
let n = Pt(e);
|
|
436
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && Ft(e, r) && !A(e, r) && !(n && it(e, r))) return e.substring(0, r).trimEnd();
|
|
437
437
|
return e;
|
|
438
|
-
},
|
|
438
|
+
}, Lt = (e) => {
|
|
439
439
|
let t = E(e);
|
|
440
440
|
if (t.openFence) return e;
|
|
441
441
|
let n = t.openSpan;
|
|
442
442
|
if (!n) return e;
|
|
443
443
|
let r = e.slice(n.start + n.runLength);
|
|
444
|
-
if (!r ||
|
|
444
|
+
if (!r || $e.test(r)) return e;
|
|
445
445
|
let i = 0, a = e.length - 1;
|
|
446
446
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
447
447
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
448
|
-
},
|
|
448
|
+
}, Rt = (e) => O(e, "$"), zt = (e) => {
|
|
449
449
|
let t = E(e), n = 0;
|
|
450
450
|
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === S.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
451
451
|
return n;
|
|
452
|
-
},
|
|
452
|
+
}, Bt = (e) => {
|
|
453
453
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
454
454
|
let t = e.indexOf("$$");
|
|
455
455
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
456
456
|
$$` : `${e}$$`;
|
|
457
|
-
},
|
|
457
|
+
}, Vt = (e) => Rt(e) % 2 == 0 ? e : Bt(e), Ht = (e) => zt(e) % 2 == 1 ? `${e}$` : e, I = "streamdown:incomplete-image", Ut = (e, t, n) => {
|
|
458
458
|
if (e.substring(t + 2).includes(")")) return null;
|
|
459
|
-
let r =
|
|
460
|
-
if (r === -1 ||
|
|
459
|
+
let r = nt(e, t);
|
|
460
|
+
if (r === -1 || A(e, r)) return null;
|
|
461
461
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
462
|
-
return i ? `${o} if (e[n] === "[" && !
|
|
462
|
+
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
463
|
+
}, L = (e, t) => {
|
|
464
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !A(e, n)) {
|
|
465
465
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
466
|
-
let t =
|
|
466
|
+
let t = rt(e, n);
|
|
467
467
|
if (t === -1) return n;
|
|
468
468
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
469
469
|
let r = e.indexOf(")", t + 2);
|
|
@@ -471,69 +471,69 @@ $$` : `${e}$$`;
|
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
return t;
|
|
474
|
-
},
|
|
474
|
+
}, Wt = (e, t, n) => {
|
|
475
475
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
476
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
476
|
+
if (!e.substring(t + 1).includes("]") || rt(e, t) === -1) {
|
|
477
477
|
let a = e.substring(0, i);
|
|
478
|
-
if (r) return `${a} return `${a}`;
|
|
479
479
|
if (n === "text-only") {
|
|
480
|
-
let n =
|
|
480
|
+
let n = L(e, t);
|
|
481
481
|
return e.substring(0, n) + e.substring(n + 1);
|
|
482
482
|
}
|
|
483
483
|
return `${e}](streamdown:incomplete-link)`;
|
|
484
484
|
}
|
|
485
485
|
return null;
|
|
486
|
-
},
|
|
486
|
+
}, Gt = (e, t) => {
|
|
487
487
|
let n = e.lastIndexOf("](");
|
|
488
|
-
if (n !== -1 && !
|
|
489
|
-
let r =
|
|
488
|
+
if (n !== -1 && !A(e, n)) {
|
|
489
|
+
let r = Ut(e, n, t);
|
|
490
490
|
if (r !== null) return r;
|
|
491
491
|
}
|
|
492
|
-
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!
|
|
493
|
-
let r =
|
|
492
|
+
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!A(e, n)) {
|
|
493
|
+
let r = Wt(e, n, t);
|
|
494
494
|
if (r !== null) return r;
|
|
495
495
|
}
|
|
496
496
|
return e;
|
|
497
|
-
},
|
|
497
|
+
}, Kt = 32, qt = (e, t = "protocol") => {
|
|
498
498
|
let n = e;
|
|
499
|
-
for (let e = 0; e <
|
|
500
|
-
let e =
|
|
499
|
+
for (let e = 0; e < Kt; e += 1) {
|
|
500
|
+
let e = Gt(n, t);
|
|
501
501
|
if (e.length >= n.length) return e;
|
|
502
502
|
n = e;
|
|
503
503
|
}
|
|
504
504
|
return n;
|
|
505
|
-
},
|
|
505
|
+
}, Jt = /^-{1,2}$/, Yt = /^[\s]*-{1,2}[\s]+$/, Xt = /^={1,2}$/, Zt = /^[\s]*={1,2}[\s]+$/, Qt = (e) => {
|
|
506
506
|
if (!e || typeof e != "string") return e;
|
|
507
507
|
let t = e.lastIndexOf("\n");
|
|
508
508
|
if (t === -1) return e;
|
|
509
509
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
510
|
-
if (
|
|
510
|
+
if (Jt.test(i) && !n.match(Yt)) {
|
|
511
511
|
let t = r.split("\n").at(-1);
|
|
512
512
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
513
513
|
}
|
|
514
|
-
if (
|
|
514
|
+
if (Xt.test(i) && !n.match(Zt)) {
|
|
515
515
|
let t = r.split("\n").at(-1);
|
|
516
516
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
517
517
|
}
|
|
518
518
|
return e;
|
|
519
|
-
},
|
|
520
|
-
let t =
|
|
519
|
+
}, $t = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, en = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace($t, (t, n, r) => A(e, r + n.length) ? t : `${n}\\~`), tn = (e) => O(e, "~"), nn = (e) => {
|
|
520
|
+
let t = M(e, Xe);
|
|
521
521
|
if (t) {
|
|
522
522
|
let n = t[2];
|
|
523
|
-
if (!n ||
|
|
523
|
+
if (!n || $e.test(n)) return e;
|
|
524
524
|
let r = e.lastIndexOf(t[1]);
|
|
525
|
-
if (
|
|
526
|
-
if (
|
|
525
|
+
if (A(e, r) || j(e, r)) return e;
|
|
526
|
+
if (tn(e) % 2 == 1) return `${e}~~`;
|
|
527
527
|
} else {
|
|
528
|
-
let t =
|
|
528
|
+
let t = M(e, Qe);
|
|
529
529
|
if (t) {
|
|
530
530
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
531
|
-
if (
|
|
532
|
-
if (
|
|
531
|
+
if (A(e, n) || j(e, n)) return e;
|
|
532
|
+
if (tn(e) % 2 == 1) return `${e}~`;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
return e;
|
|
536
|
-
},
|
|
536
|
+
}, rn = (e) => e !== !1, an = (e) => e === !0, R = {
|
|
537
537
|
SINGLE_TILDE: 0,
|
|
538
538
|
COMPARISON_OPERATORS: 5,
|
|
539
539
|
HTML_TAGS: 10,
|
|
@@ -549,44 +549,44 @@ $$` : `${e}$$`;
|
|
|
549
549
|
KATEX: 70,
|
|
550
550
|
INLINE_KATEX: 75,
|
|
551
551
|
DEFAULT: 100
|
|
552
|
-
},
|
|
552
|
+
}, on = [
|
|
553
553
|
{
|
|
554
554
|
handler: {
|
|
555
555
|
name: "singleTilde",
|
|
556
|
-
handle:
|
|
557
|
-
priority:
|
|
556
|
+
handle: en,
|
|
557
|
+
priority: R.SINGLE_TILDE
|
|
558
558
|
},
|
|
559
559
|
optionKey: "singleTilde"
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
562
|
handler: {
|
|
563
563
|
name: "comparisonOperators",
|
|
564
|
-
handle:
|
|
565
|
-
priority:
|
|
564
|
+
handle: We,
|
|
565
|
+
priority: R.COMPARISON_OPERATORS
|
|
566
566
|
},
|
|
567
567
|
optionKey: "comparisonOperators"
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
570
|
handler: {
|
|
571
571
|
name: "htmlTags",
|
|
572
|
-
handle:
|
|
573
|
-
priority:
|
|
572
|
+
handle: It,
|
|
573
|
+
priority: R.HTML_TAGS
|
|
574
574
|
},
|
|
575
575
|
optionKey: "htmlTags"
|
|
576
576
|
},
|
|
577
577
|
{
|
|
578
578
|
handler: {
|
|
579
579
|
name: "setextHeadings",
|
|
580
|
-
handle:
|
|
581
|
-
priority:
|
|
580
|
+
handle: Qt,
|
|
581
|
+
priority: R.SETEXT_HEADINGS
|
|
582
582
|
},
|
|
583
583
|
optionKey: "setextHeadings"
|
|
584
584
|
},
|
|
585
585
|
{
|
|
586
586
|
handler: {
|
|
587
587
|
name: "links",
|
|
588
|
-
handle:
|
|
589
|
-
priority:
|
|
588
|
+
handle: qt,
|
|
589
|
+
priority: R.LINKS
|
|
590
590
|
},
|
|
591
591
|
optionKey: "links",
|
|
592
592
|
earlyReturn: (e) => e.endsWith("](streamdown:incomplete-link)") || e.endsWith("](streamdown:incomplete-image)")
|
|
@@ -594,88 +594,88 @@ $$` : `${e}$$`;
|
|
|
594
594
|
{
|
|
595
595
|
handler: {
|
|
596
596
|
name: "boldItalic",
|
|
597
|
-
handle:
|
|
598
|
-
priority:
|
|
597
|
+
handle: jt,
|
|
598
|
+
priority: R.BOLD_ITALIC
|
|
599
599
|
},
|
|
600
600
|
optionKey: "boldItalic"
|
|
601
601
|
},
|
|
602
602
|
{
|
|
603
603
|
handler: {
|
|
604
604
|
name: "bold",
|
|
605
|
-
handle:
|
|
606
|
-
priority:
|
|
605
|
+
handle: yt,
|
|
606
|
+
priority: R.BOLD
|
|
607
607
|
},
|
|
608
608
|
optionKey: "bold"
|
|
609
609
|
},
|
|
610
610
|
{
|
|
611
611
|
handler: {
|
|
612
612
|
name: "italicDoubleUnderscore",
|
|
613
|
-
handle:
|
|
614
|
-
priority:
|
|
613
|
+
handle: xt,
|
|
614
|
+
priority: R.ITALIC_DOUBLE_UNDERSCORE
|
|
615
615
|
},
|
|
616
616
|
optionKey: "italic"
|
|
617
617
|
},
|
|
618
618
|
{
|
|
619
619
|
handler: {
|
|
620
620
|
name: "italicSingleAsterisk",
|
|
621
|
-
handle:
|
|
622
|
-
priority:
|
|
621
|
+
handle: wt,
|
|
622
|
+
priority: R.ITALIC_SINGLE_ASTERISK
|
|
623
623
|
},
|
|
624
624
|
optionKey: "italic"
|
|
625
625
|
},
|
|
626
626
|
{
|
|
627
627
|
handler: {
|
|
628
628
|
name: "italicSingleUnderscore",
|
|
629
|
-
handle:
|
|
630
|
-
priority:
|
|
629
|
+
handle: Ot,
|
|
630
|
+
priority: R.ITALIC_SINGLE_UNDERSCORE
|
|
631
631
|
},
|
|
632
632
|
optionKey: "italic"
|
|
633
633
|
},
|
|
634
634
|
{
|
|
635
635
|
handler: {
|
|
636
636
|
name: "inlineCode",
|
|
637
|
-
handle:
|
|
638
|
-
priority:
|
|
637
|
+
handle: Lt,
|
|
638
|
+
priority: R.INLINE_CODE
|
|
639
639
|
},
|
|
640
640
|
optionKey: "inlineCode"
|
|
641
641
|
},
|
|
642
642
|
{
|
|
643
643
|
handler: {
|
|
644
644
|
name: "strikethrough",
|
|
645
|
-
handle:
|
|
646
|
-
priority:
|
|
645
|
+
handle: nn,
|
|
646
|
+
priority: R.STRIKETHROUGH
|
|
647
647
|
},
|
|
648
648
|
optionKey: "strikethrough"
|
|
649
649
|
},
|
|
650
650
|
{
|
|
651
651
|
handler: {
|
|
652
652
|
name: "katex",
|
|
653
|
-
handle:
|
|
654
|
-
priority:
|
|
653
|
+
handle: Vt,
|
|
654
|
+
priority: R.KATEX
|
|
655
655
|
},
|
|
656
656
|
optionKey: "katex"
|
|
657
657
|
},
|
|
658
658
|
{
|
|
659
659
|
handler: {
|
|
660
660
|
name: "inlineKatex",
|
|
661
|
-
handle:
|
|
662
|
-
priority:
|
|
661
|
+
handle: Ht,
|
|
662
|
+
priority: R.INLINE_KATEX
|
|
663
663
|
},
|
|
664
664
|
optionKey: "inlineKatex"
|
|
665
665
|
}
|
|
666
|
-
],
|
|
666
|
+
], sn = (e) => {
|
|
667
667
|
let t = e?.linkMode ?? "protocol";
|
|
668
|
-
return
|
|
669
|
-
handler: me(pe({}, e), { handle: (e) =>
|
|
668
|
+
return on.filter(({ handler: t, optionKey: n }) => t.name === "links" ? rn(e?.links) || rn(e?.images) : t.name === "inlineKatex" ? an(e?.inlineKatex) : rn(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
669
|
+
handler: me(pe({}, e), { handle: (e) => qt(e, t) }),
|
|
670
670
|
earlyReturn: t === "protocol" ? n : void 0
|
|
671
671
|
} : {
|
|
672
672
|
handler: e,
|
|
673
673
|
earlyReturn: n
|
|
674
674
|
});
|
|
675
|
-
},
|
|
675
|
+
}, cn = (e, t) => {
|
|
676
676
|
if (!e || typeof e != "string") return e;
|
|
677
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
678
|
-
handler: me(pe({}, e), { priority: e.priority ??
|
|
677
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = sn(t), i = (t?.handlers ?? []).map((e) => ({
|
|
678
|
+
handler: me(pe({}, e), { priority: e.priority ?? R.DEFAULT }),
|
|
679
679
|
earlyReturn: void 0
|
|
680
680
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
681
681
|
try {
|
|
@@ -686,7 +686,7 @@ $$` : `${e}$$`;
|
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
688
|
// ../../node_modules/.pnpm/marked@18.2.0/node_modules/marked/lib/marked.esm.js
|
|
689
|
-
function
|
|
689
|
+
function ln() {
|
|
690
690
|
return {
|
|
691
691
|
async: !1,
|
|
692
692
|
breaks: !1,
|
|
@@ -700,35 +700,35 @@ function un() {
|
|
|
700
700
|
walkTokens: null
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
|
-
var
|
|
704
|
-
function
|
|
705
|
-
|
|
703
|
+
var un = ln();
|
|
704
|
+
function dn(e) {
|
|
705
|
+
un = e;
|
|
706
706
|
}
|
|
707
|
-
var
|
|
708
|
-
function
|
|
707
|
+
var fn = { exec: () => null };
|
|
708
|
+
function pn(e) {
|
|
709
709
|
let t = [];
|
|
710
710
|
return (n) => {
|
|
711
711
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
712
712
|
return i || (i = e(r), t[r] = i), i;
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function z(e, t = "") {
|
|
716
716
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
717
717
|
replace: (e, t) => {
|
|
718
718
|
let i = typeof t == "string" ? t : t.source;
|
|
719
|
-
return i = i.replace(
|
|
719
|
+
return i = i.replace(B.caret, "$1"), n = n.replace(e, i), r;
|
|
720
720
|
},
|
|
721
721
|
getRegex: () => new RegExp(n, t)
|
|
722
722
|
};
|
|
723
723
|
return r;
|
|
724
724
|
}
|
|
725
|
-
var
|
|
725
|
+
var mn = ((e = "") => {
|
|
726
726
|
try {
|
|
727
727
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
728
728
|
} catch {
|
|
729
729
|
return !1;
|
|
730
730
|
}
|
|
731
|
-
})(),
|
|
731
|
+
})(), B = {
|
|
732
732
|
codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
|
|
733
733
|
listInterruptsParagraph: /^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,
|
|
734
734
|
outputLinkReplace: /\\([\[\]])/g,
|
|
@@ -785,89 +785,89 @@ var hn = ((e = "") => {
|
|
|
785
785
|
notSpaceStart: /^\S*/,
|
|
786
786
|
endingNewline: /\n$/,
|
|
787
787
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
788
|
-
nextBulletRegex:
|
|
789
|
-
hrRegex:
|
|
790
|
-
fencesBeginRegex:
|
|
791
|
-
headingBeginRegex:
|
|
792
|
-
pedanticHeadingBeginRegex:
|
|
793
|
-
htmlBeginRegex:
|
|
794
|
-
blockquoteBeginRegex:
|
|
788
|
+
nextBulletRegex: pn((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
789
|
+
hrRegex: pn((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
790
|
+
fencesBeginRegex: pn((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
791
|
+
headingBeginRegex: pn((e) => RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),
|
|
792
|
+
pedanticHeadingBeginRegex: pn((e) => RegExp(`^ {0,${e}}#`)),
|
|
793
|
+
htmlBeginRegex: pn((e) => RegExp(`^ {0,${e}}(?:</?(?:${kn})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
|
|
794
|
+
blockquoteBeginRegex: pn((e) => RegExp(`^ {0,${e}}>`)),
|
|
795
795
|
nestedContainerMarkers: /^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/
|
|
796
|
-
},
|
|
797
|
-
blockquote:
|
|
798
|
-
code:
|
|
799
|
-
def:
|
|
800
|
-
fences:
|
|
801
|
-
heading:
|
|
802
|
-
hr:
|
|
803
|
-
html:
|
|
796
|
+
}, hn = /^(?:[ \t]*(?:\n|$))+/, gn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _n = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/, vn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, yn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, xn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/, Sn = z(xn).replace(/bull/g, bn).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(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Cn = z(xn).replace(/bull/g, bn).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(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), wn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Tn = /^[^\n]+/, En = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/, Dn = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", En).replace("title", /(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(), On = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, bn).getRegex(), kn = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", An = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, jn = z("^ {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)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", An).replace("tag", kn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Mn = (e) => z(wn).replace("hr", vn).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", kn).getRegex(), Nn = Mn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Pn = Mn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Fn = {
|
|
797
|
+
blockquote: z(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph", Pn).getRegex(),
|
|
798
|
+
code: gn,
|
|
799
|
+
def: Dn,
|
|
800
|
+
fences: _n,
|
|
801
|
+
heading: yn,
|
|
802
|
+
hr: vn,
|
|
803
|
+
html: jn,
|
|
804
|
+
lheading: Sn,
|
|
805
|
+
list: On,
|
|
806
|
+
newline: hn,
|
|
807
|
+
paragraph: Nn,
|
|
808
|
+
table: fn,
|
|
809
|
+
text: Tn
|
|
810
|
+
}, In = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", vn).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", kn).getRegex(), Ln = {
|
|
811
|
+
...Fn,
|
|
804
812
|
lheading: Cn,
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
}, Ln = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", yn).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", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", An).getRegex(), Rn = {
|
|
811
|
-
...In,
|
|
812
|
-
lheading: wn,
|
|
813
|
-
table: Ln,
|
|
814
|
-
paragraph: R(Tn).replace("hr", yn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ln).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", An).getRegex()
|
|
815
|
-
}, zn = {
|
|
816
|
-
...In,
|
|
817
|
-
html: R("^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))").replace("comment", jn).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(),
|
|
813
|
+
table: In,
|
|
814
|
+
paragraph: z(wn).replace("hr", vn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", In).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", kn).getRegex()
|
|
815
|
+
}, Rn = {
|
|
816
|
+
...Fn,
|
|
817
|
+
html: z("^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))").replace("comment", An).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
818
818
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
819
819
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
820
|
-
fences:
|
|
820
|
+
fences: fn,
|
|
821
821
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
822
|
-
paragraph:
|
|
823
|
-
},
|
|
824
|
-
_backpedal:
|
|
822
|
+
paragraph: z(wn).replace("hr", vn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Sn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
823
|
+
}, zn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Bn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Vn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Hn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Un = /[\p{P}\p{S}]/u, Wn = /[\s\p{P}\p{S}]/u, Gn = /[^\s\p{P}\p{S}]/u, Kn = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Wn).getRegex(), qn = /[\p{Pi}\p{Ps}"']/u, Jn = /(?!~)[\p{P}\p{S}]/u, Yn = /(?!~)[\s\p{P}\p{S}]/u, Xn = /(?:[^\s\p{P}\p{S}]|~)/u, Zn = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", mn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Qn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $n = z(Qn, "u").replace(/punct/g, Un).getRegex(), er = z(Qn, "u").replace(/punct/g, Jn).getRegex(), tr = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, qn).replace(/punct/g, Un).getRegex(), nr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", rr = z(nr, "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, Wn).replace(/punct/g, Un).getRegex(), ir = z(nr, "gu").replace(/notPunctSpace/g, Xn).replace(/punctSpace/g, Yn).replace(/punct/g, Jn).getRegex(), ar = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, Wn).replace(/punct/g, Un).getRegex(), or = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, Wn).replace(/punct/g, Un).getRegex(), sr = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, Wn).replace(/punct/g, Un).getRegex(), cr = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Un).getRegex(), lr = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Gn).replace(/punctSpace/g, Wn).replace(/punct/g, Un).getRegex(), ur = z(/\\(punct)/, "gu").replace(/punct/g, Un).getRegex(), dr = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, Un).getRegex(), fr = z(/^<(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(), pr = z(An).replace("(?:-->|$)", "-->").getRegex(), mr = z("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", pr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), hr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, gr = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", hr).getRegex(), _r = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", gr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(), vr = z(/^!?\[(label)\]\[(ref)\]/).replace("label", gr).replace("ref", En).getRegex(), yr = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", En).getRegex(), br = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, xr = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", hr).getRegex(), Sr = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", xr).replace("ref", br).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", br).getRegex()).getRegex(), Cr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, wr = z(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), Tr = {
|
|
824
|
+
_backpedal: fn,
|
|
825
825
|
anyPunctuation: ur,
|
|
826
826
|
anyPunctuationOutsideCode: dr,
|
|
827
827
|
autolink: fr,
|
|
828
828
|
blockSkip: Zn,
|
|
829
|
-
br:
|
|
830
|
-
code:
|
|
831
|
-
del:
|
|
832
|
-
delLDelim:
|
|
833
|
-
delRDelim:
|
|
829
|
+
br: Vn,
|
|
830
|
+
code: Bn,
|
|
831
|
+
del: fn,
|
|
832
|
+
delLDelim: fn,
|
|
833
|
+
delRDelim: fn,
|
|
834
834
|
emStrongLDelim: $n,
|
|
835
835
|
emStrongRDelimAst: rr,
|
|
836
836
|
emStrongRDelimUnd: or,
|
|
837
|
-
escape:
|
|
837
|
+
escape: zn,
|
|
838
838
|
link: _r,
|
|
839
839
|
nolink: yr,
|
|
840
840
|
punctuation: Kn,
|
|
841
841
|
reflink: vr,
|
|
842
842
|
reflinkSearch: Sr,
|
|
843
843
|
tag: mr,
|
|
844
|
-
text:
|
|
845
|
-
url:
|
|
844
|
+
text: Hn,
|
|
845
|
+
url: fn
|
|
846
846
|
}, Er = {
|
|
847
847
|
...Tr,
|
|
848
848
|
emStrongLDelim: tr,
|
|
849
849
|
emStrongRDelimAst: ar,
|
|
850
850
|
emStrongRDelimUnd: sr,
|
|
851
|
-
link:
|
|
852
|
-
reflink:
|
|
851
|
+
link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", gr).getRegex(),
|
|
852
|
+
reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", gr).getRegex()
|
|
853
853
|
}, Dr = {
|
|
854
854
|
...Tr,
|
|
855
855
|
emStrongRDelimAst: ir,
|
|
856
856
|
emStrongLDelim: er,
|
|
857
857
|
delLDelim: cr,
|
|
858
858
|
delRDelim: lr,
|
|
859
|
-
url:
|
|
859
|
+
url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", wr).replace("protocol", Cr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
860
860
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
861
861
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
862
|
-
text:
|
|
862
|
+
text: z(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Cr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).replace("wwwStart", mn ? "(?<![^\\s*_~(])www\\." : "www\\.").getRegex()
|
|
863
863
|
}, Or = {
|
|
864
864
|
...Dr,
|
|
865
|
-
br:
|
|
866
|
-
text:
|
|
865
|
+
br: z(Vn).replace("{2,}", "*").getRegex(),
|
|
866
|
+
text: z(Dr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
867
867
|
}, kr = {
|
|
868
|
-
normal:
|
|
869
|
-
gfm:
|
|
870
|
-
pedantic:
|
|
868
|
+
normal: Fn,
|
|
869
|
+
gfm: Ln,
|
|
870
|
+
pedantic: Rn
|
|
871
871
|
}, Ar = {
|
|
872
872
|
normal: Tr,
|
|
873
873
|
gfm: Dr,
|
|
@@ -882,12 +882,12 @@ var hn = ((e = "") => {
|
|
|
882
882
|
}, Mr = (e) => jr[e];
|
|
883
883
|
function V(e, t) {
|
|
884
884
|
if (t) {
|
|
885
|
-
if (
|
|
886
|
-
} else if (
|
|
885
|
+
if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Mr);
|
|
886
|
+
} else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Mr);
|
|
887
887
|
return e;
|
|
888
888
|
}
|
|
889
889
|
function Nr(e) {
|
|
890
|
-
return
|
|
890
|
+
return B.numericCharacterReference.test(e) ? e.replace(B.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
891
891
|
if (t === void 0 && n === void 0) return "&";
|
|
892
892
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
893
893
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&" : String.fromCodePoint(r);
|
|
@@ -895,23 +895,23 @@ function Nr(e) {
|
|
|
895
895
|
}
|
|
896
896
|
function Pr(e) {
|
|
897
897
|
try {
|
|
898
|
-
e = encodeURI(e).replace(
|
|
898
|
+
e = encodeURI(e).replace(B.percentDecode, "%");
|
|
899
899
|
} catch {
|
|
900
900
|
return null;
|
|
901
901
|
}
|
|
902
902
|
return e;
|
|
903
903
|
}
|
|
904
904
|
function Fr(e, t) {
|
|
905
|
-
let n = e.replace(
|
|
905
|
+
let n = e.replace(B.findPipe, (e, t, n) => {
|
|
906
906
|
let r = !1, i = t;
|
|
907
907
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
908
908
|
return r ? "|" : " |";
|
|
909
|
-
}).split(
|
|
909
|
+
}).split(B.splitPipe), r = 0;
|
|
910
910
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
911
911
|
if (n.length > t) n.splice(t);
|
|
912
912
|
else for (; n.length < t;) n.push("");
|
|
913
913
|
}
|
|
914
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
914
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(B.slashPipe, "|");
|
|
915
915
|
return n;
|
|
916
916
|
}
|
|
917
917
|
function Ir(e, t, n) {
|
|
@@ -928,11 +928,11 @@ function Ir(e, t, n) {
|
|
|
928
928
|
}
|
|
929
929
|
function Lr(e) {
|
|
930
930
|
let t = e.split("\n"), n = t.length - 1;
|
|
931
|
-
for (; n >= 0 &&
|
|
931
|
+
for (; n >= 0 && B.blankLine.test(t[n]);) n--;
|
|
932
932
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
933
933
|
}
|
|
934
934
|
function Rr(e) {
|
|
935
|
-
return e.trim().replace(
|
|
935
|
+
return e.trim().replace(B.multipleSpaceGlobal, " ").toLowerCase().toUpperCase().toLowerCase();
|
|
936
936
|
}
|
|
937
937
|
function zr(e, t) {
|
|
938
938
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
@@ -1044,7 +1044,7 @@ var Xr = class {
|
|
|
1044
1044
|
rules;
|
|
1045
1045
|
lexer;
|
|
1046
1046
|
constructor(e) {
|
|
1047
|
-
this.options = e ||
|
|
1047
|
+
this.options = e || un;
|
|
1048
1048
|
}
|
|
1049
1049
|
space(e) {
|
|
1050
1050
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1550,7 +1550,7 @@ ${p}`) ? ` ${u.replace(/^ {0,3}/, "")}` : p;
|
|
|
1550
1550
|
inlineQueue;
|
|
1551
1551
|
tokenizer;
|
|
1552
1552
|
constructor(e) {
|
|
1553
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1553
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || un, this.options.tokenizer = this.options.tokenizer || new Xr(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1554
1554
|
inLink: !1,
|
|
1555
1555
|
inRawBlock: !1,
|
|
1556
1556
|
linkEmitted: !1,
|
|
@@ -1558,7 +1558,7 @@ ${p}`) ? ` ${u.replace(/^ {0,3}/, "")}` : p;
|
|
|
1558
1558
|
top: !0
|
|
1559
1559
|
};
|
|
1560
1560
|
let t = {
|
|
1561
|
-
other:
|
|
1561
|
+
other: B,
|
|
1562
1562
|
block: kr.normal,
|
|
1563
1563
|
inline: Ar.normal
|
|
1564
1564
|
};
|
|
@@ -1577,7 +1577,7 @@ ${p}`) ? ` ${u.replace(/^ {0,3}/, "")}` : p;
|
|
|
1577
1577
|
return new e(n).inlineTokens(t);
|
|
1578
1578
|
}
|
|
1579
1579
|
lex(e) {
|
|
1580
|
-
e = e.replace(
|
|
1580
|
+
e = e.replace(B.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
1581
1581
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1582
1582
|
let t = this.inlineQueue[e];
|
|
1583
1583
|
this.state.inRawBlock = !1, this.inlineTokens(t.src, t.tokens);
|
|
@@ -1587,7 +1587,7 @@ ${p}`) ? ` ${u.replace(/^ {0,3}/, "")}` : p;
|
|
|
1587
1587
|
blockTokens(e, t = [], n = !1) {
|
|
1588
1588
|
this.tokenizer.lexer = this;
|
|
1589
1589
|
let r = this.state.lastToken;
|
|
1590
|
-
this.options.pedantic && (e = e.replace(
|
|
1590
|
+
this.options.pedantic && (e = e.replace(B.tabCharGlobal, " ").replace(B.spaceLine, ""));
|
|
1591
1591
|
let i = 1 / 0;
|
|
1592
1592
|
for (; e;) {
|
|
1593
1593
|
if (e.length < i) i = e.length;
|
|
@@ -1767,13 +1767,13 @@ ${p}`) ? ` ${u.replace(/^ {0,3}/, "")}` : p;
|
|
|
1767
1767
|
options;
|
|
1768
1768
|
parser;
|
|
1769
1769
|
constructor(e) {
|
|
1770
|
-
this.options = e ||
|
|
1770
|
+
this.options = e || un;
|
|
1771
1771
|
}
|
|
1772
1772
|
space(e) {
|
|
1773
1773
|
return "";
|
|
1774
1774
|
}
|
|
1775
1775
|
code({ text: e, lang: t, escaped: n }) {
|
|
1776
|
-
let r = (t || "").match(
|
|
1776
|
+
let r = (t || "").match(B.notSpaceStart)?.[0], i = e ? e.replace(B.endingNewline, "") + "\n" : "";
|
|
1777
1777
|
return r ? "<pre><code class=\"language-" + V(r) + "\">" + (n ? i : V(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : V(i, !0)) + "</code></pre>\n";
|
|
1778
1778
|
}
|
|
1779
1779
|
blockquote({ tokens: e }) {
|
|
@@ -1907,7 +1907,7 @@ ${e}</tr>
|
|
|
1907
1907
|
renderer;
|
|
1908
1908
|
textRenderer;
|
|
1909
1909
|
constructor(e) {
|
|
1910
|
-
this.options = e ||
|
|
1910
|
+
this.options = e || un, this.options.renderer = this.options.renderer || new Zr(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Qr(), this.textRenderer.parser = this;
|
|
1911
1911
|
}
|
|
1912
1912
|
static parse(t, n) {
|
|
1913
1913
|
return new e(n).parse(t);
|
|
@@ -2059,7 +2059,7 @@ ${e}</tr>
|
|
|
2059
2059
|
options;
|
|
2060
2060
|
block;
|
|
2061
2061
|
constructor(e) {
|
|
2062
|
-
this.options = e ||
|
|
2062
|
+
this.options = e || un;
|
|
2063
2063
|
}
|
|
2064
2064
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2065
2065
|
"preprocess",
|
|
@@ -2096,7 +2096,7 @@ function ei(e, t) {
|
|
|
2096
2096
|
else e.push(t);
|
|
2097
2097
|
}
|
|
2098
2098
|
var ti = new class {
|
|
2099
|
-
defaults =
|
|
2099
|
+
defaults = ln();
|
|
2100
2100
|
options = this.setOptions;
|
|
2101
2101
|
parse = this.parseMarkdown(!0);
|
|
2102
2102
|
parseInline = this.parseMarkdown(!1);
|
|
@@ -2275,10 +2275,10 @@ function W(e, t) {
|
|
|
2275
2275
|
return ti.parse(e, t);
|
|
2276
2276
|
}
|
|
2277
2277
|
W.options = W.setOptions = function(e) {
|
|
2278
|
-
return ti.setOptions(e), W.defaults = ti.defaults,
|
|
2279
|
-
}, W.getDefaults =
|
|
2278
|
+
return ti.setOptions(e), W.defaults = ti.defaults, dn(W.defaults), W;
|
|
2279
|
+
}, W.getDefaults = ln, W.defaults = un;
|
|
2280
2280
|
function ni(...e) {
|
|
2281
|
-
return ti.use(...e), W.defaults = ti.defaults,
|
|
2281
|
+
return ti.use(...e), W.defaults = ti.defaults, dn(W.defaults), W;
|
|
2282
2282
|
}
|
|
2283
2283
|
W.use = ni, W.walkTokens = function(e, t) {
|
|
2284
2284
|
return ti.walkTokens(e, t);
|
|
@@ -2690,14 +2690,14 @@ function wa() {
|
|
|
2690
2690
|
enumerable: !0,
|
|
2691
2691
|
value: null
|
|
2692
2692
|
}
|
|
2693
|
-
})), je = !0, Me = !0, Ne = !1, Pe = !0,
|
|
2693
|
+
})), je = !0, Me = !0, Ne = !1, Pe = !0, k = !1, Fe = !0, Ie = !1, Le = !1, Re = null, ze = null, Be = !1, Ve = !1, He = !1, A = !1, j = !0, Ue = !1, We = "user-content-", M = !0, Ge = !1, Ke = null, qe = {}, Je = null, Ye = X({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Xe = null, Ze = X({}, [
|
|
2694
2694
|
"audio",
|
|
2695
2695
|
"video",
|
|
2696
2696
|
"img",
|
|
2697
2697
|
"source",
|
|
2698
2698
|
"image",
|
|
2699
2699
|
"track"
|
|
2700
|
-
]),
|
|
2700
|
+
]), Qe = null, $e = X({}, [
|
|
2701
2701
|
"alt",
|
|
2702
2702
|
"class",
|
|
2703
2703
|
"for",
|
|
@@ -2712,36 +2712,36 @@ function wa() {
|
|
|
2712
2712
|
"value",
|
|
2713
2713
|
"style",
|
|
2714
2714
|
"xmlns"
|
|
2715
|
-
]),
|
|
2715
|
+
]), et = "http://www.w3.org/1998/Math/MathML", tt = "http://www.w3.org/2000/svg", N = "http://www.w3.org/1999/xhtml", P = N, nt = !1, rt = null, it = X({}, [
|
|
2716
|
+
et,
|
|
2716
2717
|
tt,
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
], ji), ot = G([
|
|
2718
|
+
N
|
|
2719
|
+
], ji), at = G([
|
|
2720
2720
|
"mi",
|
|
2721
2721
|
"mo",
|
|
2722
2722
|
"mn",
|
|
2723
2723
|
"ms",
|
|
2724
2724
|
"mtext"
|
|
2725
|
-
]),
|
|
2725
|
+
]), ot = X({}, at), st = G(["annotation-xml"]), ct = X({}, st), lt = X({}, [
|
|
2726
2726
|
"title",
|
|
2727
2727
|
"style",
|
|
2728
2728
|
"font",
|
|
2729
2729
|
"a",
|
|
2730
2730
|
"script"
|
|
2731
|
-
]),
|
|
2731
|
+
]), ut = null, dt = ["application/xhtml+xml", "text/html"], F = null, ft = null, pt = n.createElement("form"), mt = function(e) {
|
|
2732
2732
|
return e instanceof RegExp || e instanceof Function;
|
|
2733
|
-
},
|
|
2733
|
+
}, ht = function() {
|
|
2734
2734
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2735
|
-
if (
|
|
2736
|
-
e && typeof e == "object" || (e = {}), e = Z(e),
|
|
2737
|
-
transform:
|
|
2738
|
-
base:
|
|
2739
|
-
}),
|
|
2740
|
-
transform:
|
|
2741
|
-
base:
|
|
2742
|
-
}),
|
|
2735
|
+
if (ft && ft === e) return;
|
|
2736
|
+
e && typeof e == "object" || (e = {}), e = Z(e), ut = dt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, F = ut === "application/xhtml+xml" ? ji : Ai, w = Sa(e, "ALLOWED_TAGS", Oe, { transform: F }), T = Sa(e, "ALLOWED_ATTR", E, { transform: F }), rt = Sa(e, "ALLOWED_NAMESPACES", it, { transform: ji }), Qe = Sa(e, "ADD_URI_SAFE_ATTR", $e, {
|
|
2737
|
+
transform: F,
|
|
2738
|
+
base: $e
|
|
2739
|
+
}), Xe = Sa(e, "ADD_DATA_URI_TAGS", Ze, {
|
|
2740
|
+
transform: F,
|
|
2741
|
+
base: Ze
|
|
2742
|
+
}), Je = Sa(e, "FORBID_CONTENTS", Ye, { transform: F }), ke = Sa(e, "FORBID_TAGS", Z({}), { transform: F }), Ae = Sa(e, "FORBID_ATTR", Z({}), { transform: F }), qe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, je = e.ALLOW_ARIA_ATTR !== !1, Me = e.ALLOW_DATA_ATTR !== !1, Ne = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Pe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, k = e.SAFE_FOR_TEMPLATES || !1, Fe = e.SAFE_FOR_XML !== !1, Ie = e.WHOLE_DOCUMENT || !1, Ve = e.RETURN_DOM || !1, He = e.RETURN_DOM_FRAGMENT || !1, A = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, j = e.SANITIZE_DOM !== !1, Ue = e.SANITIZE_NAMED_PROPS || !1, M = e.KEEP_CONTENT !== !1, Ge = e.IN_PLACE || !1, De = Ki(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : la, P = typeof e.NAMESPACE == "string" ? e.NAMESPACE : N, ot = Ca(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, at)), ct = Ca(e, "HTML_INTEGRATION_POINTS", () => X({}, st));
|
|
2743
2743
|
let t = Ca(e, "CUSTOM_ELEMENT_HANDLING", () => gi(null));
|
|
2744
|
-
if (D = gi(null), q(t, "tagNameCheck") &&
|
|
2744
|
+
if (D = gi(null), q(t, "tagNameCheck") && mt(t.tagNameCheck) && (D.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && mt(t.attributeNameCheck) && (D.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (D.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(D), k && (Me = !1), He && (Ve = !0), qe && (w = X({}, $i), T = gi(null), qe.html === !0 && (X(w, qi), X(T, ea)), qe.svg === !0 && (X(w, Ji), X(T, ta), X(T, ra)), qe.svgFilters === !0 && (X(w, Yi), X(T, ta), X(T, ra)), qe.mathMl === !0 && (X(w, Zi), X(T, na), X(T, ra))), O.tagCheck = null, O.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? O.tagCheck = e.ADD_TAGS : Ei(e.ADD_TAGS) && (w === Oe && (w = Z(w)), X(w, e.ADD_TAGS, F))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? O.attributeCheck = e.ADD_ATTR : Ei(e.ADD_ATTR) && (T === E && (T = Z(T)), X(T, e.ADD_ATTR, F))), q(e, "ADD_FORBID_CONTENTS") && Ei(e.ADD_FORBID_CONTENTS) && (Je === Ye && (Je = Z(Je)), X(Je, e.ADD_FORBID_CONTENTS, F)), M && (w["#text"] = !0), Ie && X(w, [
|
|
2745
2745
|
"html",
|
|
2746
2746
|
"head",
|
|
2747
2747
|
"body"
|
|
@@ -2756,28 +2756,28 @@ function wa() {
|
|
|
2756
2756
|
throw y = t, e;
|
|
2757
2757
|
}
|
|
2758
2758
|
} else e.TRUSTED_TYPES_POLICY === null ? (y = void 0, b = "") : (y === void 0 && (y = pe()), y && typeof b == "string" && (b = de("")));
|
|
2759
|
-
G && G(e),
|
|
2760
|
-
},
|
|
2759
|
+
G && G(e), ft = e;
|
|
2760
|
+
}, gt = X({}, [
|
|
2761
2761
|
...Ji,
|
|
2762
2762
|
...Yi,
|
|
2763
2763
|
...Xi
|
|
2764
|
-
]),
|
|
2765
|
-
return t.namespaceURI ===
|
|
2764
|
+
]), _t = X({}, [...Zi, ...Qi]), vt = function(e, t, n) {
|
|
2765
|
+
return t.namespaceURI === N ? e === "svg" : t.namespaceURI === et ? e === "svg" && (n === "annotation-xml" || ot[n]) : !!gt[e];
|
|
2766
|
+
}, yt = function(e, t, n) {
|
|
2767
|
+
return t.namespaceURI === N ? e === "math" : t.namespaceURI === tt ? e === "math" && ct[n] : !!_t[e];
|
|
2766
2768
|
}, bt = function(e, t, n) {
|
|
2767
|
-
return t.namespaceURI ===
|
|
2768
|
-
}, xt = function(e
|
|
2769
|
-
return t.namespaceURI === nt && !lt[n] || t.namespaceURI === tt && !st[n] ? !1 : !vt[e] && (ut[e] || !_t[e]);
|
|
2770
|
-
}, St = function(e) {
|
|
2769
|
+
return t.namespaceURI === tt && !ct[n] || t.namespaceURI === et && !ot[n] ? !1 : !_t[e] && (lt[e] || !gt[e]);
|
|
2770
|
+
}, xt = function(e) {
|
|
2771
2771
|
let t = se(e), n = Ai(ae(e)), r = g(e), i, a;
|
|
2772
|
-
return r && v(r) === $.element ? (i = { namespaceURI: se(r) }, a = Ai(ae(r))) : (i = { namespaceURI:
|
|
2773
|
-
},
|
|
2772
|
+
return r && v(r) === $.element ? (i = { namespaceURI: se(r) }, a = Ai(ae(r))) : (i = { namespaceURI: P }, a = "template"), rt[t] ? t === tt ? vt(n, i, a) : t === et ? yt(n, i, a) : t === N ? bt(n, i, a) : !!(ut === "application/xhtml+xml" && rt[t]) : !1;
|
|
2773
|
+
}, St = function(e) {
|
|
2774
2774
|
Ci(t.removed, { element: e });
|
|
2775
2775
|
try {
|
|
2776
2776
|
g(e).removeChild(e);
|
|
2777
2777
|
} catch {
|
|
2778
2778
|
if (p(e), !g(e)) throw Vi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2779
2779
|
}
|
|
2780
|
-
},
|
|
2780
|
+
}, Ct = function(e, t, n) {
|
|
2781
2781
|
try {
|
|
2782
2782
|
ee(e, t);
|
|
2783
2783
|
} catch {
|
|
@@ -2785,8 +2785,8 @@ function wa() {
|
|
|
2785
2785
|
e.removeAttribute(n);
|
|
2786
2786
|
} catch {}
|
|
2787
2787
|
}
|
|
2788
|
-
},
|
|
2789
|
-
|
|
2788
|
+
}, wt = function(e) {
|
|
2789
|
+
Ot(e);
|
|
2790
2790
|
let t = h(e);
|
|
2791
2791
|
t && bi(wi(t), (e) => {
|
|
2792
2792
|
try {
|
|
@@ -2796,9 +2796,9 @@ function wa() {
|
|
|
2796
2796
|
let n = v(e) === $.element ? ne(e) : null;
|
|
2797
2797
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2798
2798
|
let r = n[t], i = r && r.name;
|
|
2799
|
-
typeof i == "string" &&
|
|
2799
|
+
typeof i == "string" && Ct(e, r, i);
|
|
2800
2800
|
}
|
|
2801
|
-
},
|
|
2801
|
+
}, Tt = function(e, n, r) {
|
|
2802
2802
|
if (!r) try {
|
|
2803
2803
|
r = n.getAttributeNode(e);
|
|
2804
2804
|
} catch {
|
|
@@ -2816,75 +2816,75 @@ function wa() {
|
|
|
2816
2816
|
} catch {}
|
|
2817
2817
|
}
|
|
2818
2818
|
if (e === "is") {
|
|
2819
|
-
if (
|
|
2820
|
-
|
|
2819
|
+
if (Ve || He) try {
|
|
2820
|
+
St(n);
|
|
2821
2821
|
} catch {}
|
|
2822
2822
|
else try {
|
|
2823
2823
|
n.setAttribute(e, "");
|
|
2824
2824
|
} catch {}
|
|
2825
2825
|
}
|
|
2826
|
-
},
|
|
2826
|
+
}, Et = function(e) {
|
|
2827
2827
|
let t = ne(e);
|
|
2828
2828
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2829
2829
|
let r = t[n], i = r && r.name;
|
|
2830
|
-
typeof i != "string" || T[
|
|
2830
|
+
typeof i != "string" || T[F(i)] || Ct(e, r, i);
|
|
2831
2831
|
}
|
|
2832
|
-
},
|
|
2832
|
+
}, Dt = function(e, t) {
|
|
2833
2833
|
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
2834
2834
|
for (; r.length > 0;) {
|
|
2835
2835
|
let e = r.pop();
|
|
2836
2836
|
if (t(e) === !1) continue;
|
|
2837
2837
|
if (n && v(e) === $.element) {
|
|
2838
2838
|
let t = te(e);
|
|
2839
|
-
|
|
2839
|
+
I(t) && r.push(t);
|
|
2840
2840
|
}
|
|
2841
2841
|
let i = h(e);
|
|
2842
2842
|
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
2843
2843
|
}
|
|
2844
|
-
},
|
|
2845
|
-
|
|
2846
|
-
v(e) === $.element &&
|
|
2844
|
+
}, Ot = function(e) {
|
|
2845
|
+
Dt(e, (e) => {
|
|
2846
|
+
v(e) === $.element && Et(e);
|
|
2847
2847
|
});
|
|
2848
|
-
},
|
|
2848
|
+
}, kt = function(e) {
|
|
2849
2849
|
let t = [];
|
|
2850
|
-
return
|
|
2850
|
+
return Dt(e, (e) => {
|
|
2851
2851
|
t.push(e);
|
|
2852
2852
|
}, !0), t;
|
|
2853
|
-
},
|
|
2853
|
+
}, At = function(e, t) {
|
|
2854
2854
|
let n = Di();
|
|
2855
|
-
bi(
|
|
2855
|
+
bi(kt(e), (e) => {
|
|
2856
2856
|
v(e) === $.element && Oi(n, e);
|
|
2857
2857
|
}), bi(t, (e) => {
|
|
2858
|
-
v(e) === $.element && !ki(n, e) &&
|
|
2858
|
+
v(e) === $.element && !ki(n, e) && Et(e);
|
|
2859
2859
|
});
|
|
2860
|
-
},
|
|
2860
|
+
}, jt = function(e, n) {
|
|
2861
2861
|
let r = !1;
|
|
2862
2862
|
return bi(t.removed, (t) => {
|
|
2863
|
-
t.element && (r ||= t.element === e,
|
|
2864
|
-
}),
|
|
2865
|
-
},
|
|
2866
|
-
let n =
|
|
2863
|
+
t.element && (r ||= t.element === e, Ot(t.element));
|
|
2864
|
+
}), At(e, n), r;
|
|
2865
|
+
}, Mt = function(e, t) {
|
|
2866
|
+
let n = Ke, r = null, i = () => (r || (r = Di(), bi(t, (e) => {
|
|
2867
2867
|
Oi(r, e);
|
|
2868
2868
|
})), r);
|
|
2869
2869
|
for (let t = 0;; t++) {
|
|
2870
|
-
let r =
|
|
2870
|
+
let r = kt(e), a = [e], o = !1;
|
|
2871
2871
|
if (bi(r, (e) => {
|
|
2872
2872
|
v(e) === $.documentFragment ? Ci(a, e) : !o && !ki(n, e) && (o = ki(i(), e));
|
|
2873
2873
|
}), !o) return;
|
|
2874
2874
|
if (t >= 8) throw Vi("the tree kept changing during in-place sanitization; refusing to return it");
|
|
2875
2875
|
bi(a, (t, n) => {
|
|
2876
|
-
|
|
2876
|
+
Nt(t, n > 0, e, i());
|
|
2877
2877
|
});
|
|
2878
2878
|
}
|
|
2879
|
-
},
|
|
2880
|
-
let i =
|
|
2881
|
-
for (; a = i.nextNode();) ki(r, a) && !ki(
|
|
2882
|
-
},
|
|
2883
|
-
|
|
2884
|
-
},
|
|
2885
|
-
return
|
|
2886
|
-
},
|
|
2887
|
-
|
|
2879
|
+
}, Nt = function(e, t, n, r) {
|
|
2880
|
+
let i = Rt(e), a;
|
|
2881
|
+
for (; a = i.nextNode();) ki(r, a) && !ki(Ke, a) && (t && L(C.uponSanitizeShadowNode, a, null), Yt(a, n), nn(a, n), I(a.content) && rn(a.content));
|
|
2882
|
+
}, Pt = function(e) {
|
|
2883
|
+
Ke && Oi(Ke, e);
|
|
2884
|
+
}, Ft = function(e, t) {
|
|
2885
|
+
return Fe ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
2886
|
+
}, It = function(e) {
|
|
2887
|
+
Fe && Dt(e, (e) => {
|
|
2888
2888
|
let t = v(e);
|
|
2889
2889
|
if (t === $.processingInstruction || t === $.comment && J(ha, e.data)) {
|
|
2890
2890
|
try {
|
|
@@ -2893,59 +2893,59 @@ function wa() {
|
|
|
2893
2893
|
return !1;
|
|
2894
2894
|
}
|
|
2895
2895
|
if (t === $.element) {
|
|
2896
|
-
let t = e, n =
|
|
2896
|
+
let t = e, n = F(ae(e));
|
|
2897
2897
|
try {
|
|
2898
|
-
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") &&
|
|
2898
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Ft("for", n) && t.removeAttribute("for");
|
|
2899
2899
|
} catch {}
|
|
2900
2900
|
}
|
|
2901
2901
|
return !0;
|
|
2902
2902
|
});
|
|
2903
|
-
},
|
|
2903
|
+
}, Lt = function(e) {
|
|
2904
2904
|
let t = null, r = null;
|
|
2905
|
-
if (
|
|
2905
|
+
if (Be) e = "<remove></remove>" + e;
|
|
2906
2906
|
else {
|
|
2907
2907
|
let t = Mi(e, /^[\r\n\t ]+/);
|
|
2908
2908
|
r = t && t[0];
|
|
2909
2909
|
}
|
|
2910
|
-
|
|
2910
|
+
ut === "application/xhtml+xml" && P === N && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
2911
2911
|
let i = y ? de(e) : e;
|
|
2912
|
-
if (
|
|
2913
|
-
t = new l().parseFromString(i,
|
|
2912
|
+
if (P === N) try {
|
|
2913
|
+
t = new l().parseFromString(i, ut);
|
|
2914
2914
|
} catch {}
|
|
2915
2915
|
if (!t || !t.documentElement) {
|
|
2916
|
-
t = S.createDocument(
|
|
2916
|
+
t = S.createDocument(P, "template", null);
|
|
2917
2917
|
try {
|
|
2918
|
-
t.documentElement.innerHTML =
|
|
2918
|
+
t.documentElement.innerHTML = nt ? b : i;
|
|
2919
2919
|
} catch {}
|
|
2920
2920
|
}
|
|
2921
2921
|
let a = t.body || t.documentElement;
|
|
2922
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
2923
|
-
},
|
|
2922
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), P === N ? _e.call(t, Ie ? "html" : "body")[0] : Ie ? t.documentElement : a;
|
|
2923
|
+
}, Rt = function(e) {
|
|
2924
2924
|
let t = ie ? ie(e) : e.ownerDocument;
|
|
2925
2925
|
return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
2926
|
-
},
|
|
2926
|
+
}, zt = function(e) {
|
|
2927
2927
|
return e = Ni(e, ye, " "), e = Ni(e, be, " "), e = Ni(e, xe, " "), e;
|
|
2928
|
-
},
|
|
2929
|
-
|
|
2928
|
+
}, Bt = function(e) {
|
|
2929
|
+
Vt(e);
|
|
2930
2930
|
let t = e.querySelectorAll?.call(e, "template");
|
|
2931
2931
|
t && bi(t, (e) => {
|
|
2932
|
-
|
|
2932
|
+
I(e.content) && Bt(e.content);
|
|
2933
2933
|
});
|
|
2934
|
-
},
|
|
2934
|
+
}, Vt = function(e) {
|
|
2935
2935
|
e.normalize();
|
|
2936
2936
|
let t = ie ? ie(e) : e.ownerDocument, n = he.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
2937
|
-
for (; r;) r.data =
|
|
2938
|
-
},
|
|
2937
|
+
for (; r;) r.data = zt(r.data), r = n.nextNode();
|
|
2938
|
+
}, Ht = function(e) {
|
|
2939
2939
|
let t = _ ? _(e) : null;
|
|
2940
|
-
return typeof t != "string" ||
|
|
2941
|
-
},
|
|
2940
|
+
return typeof t != "string" || F(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ne(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== re(e) || e.childNodes !== h(e);
|
|
2941
|
+
}, I = function(e) {
|
|
2942
2942
|
if (!re || typeof e != "object" || !e) return !1;
|
|
2943
2943
|
try {
|
|
2944
2944
|
return re(e) === $.documentFragment;
|
|
2945
2945
|
} catch {
|
|
2946
2946
|
return !1;
|
|
2947
2947
|
}
|
|
2948
|
-
},
|
|
2948
|
+
}, Ut = function(e) {
|
|
2949
2949
|
if (!re || typeof e != "object" || !e) return !1;
|
|
2950
2950
|
try {
|
|
2951
2951
|
return typeof re(e) == "number";
|
|
@@ -2953,18 +2953,18 @@ function wa() {
|
|
|
2953
2953
|
return !1;
|
|
2954
2954
|
}
|
|
2955
2955
|
};
|
|
2956
|
-
function
|
|
2956
|
+
function L(e, n, r) {
|
|
2957
2957
|
e.length !== 0 && bi(e, (e) => {
|
|
2958
|
-
e.call(t, n, r,
|
|
2958
|
+
e.call(t, n, r, ft);
|
|
2959
2959
|
});
|
|
2960
2960
|
}
|
|
2961
|
-
let
|
|
2962
|
-
return !!(
|
|
2963
|
-
},
|
|
2961
|
+
let Wt = function(e, t) {
|
|
2962
|
+
return !!(Fe && e.hasChildNodes() && !Ut(e.firstElementChild) && J(ma, e.textContent) && J(ma, e.innerHTML) || Fe && va[t] && v(e) === $.element && se(e) === N && (Ut(e.firstElementChild) || typeof e.textContent == "string" && J(ma, e.textContent)) || e.nodeType === $.processingInstruction || Fe && e.nodeType === $.comment && J(ha, e.data));
|
|
2963
|
+
}, Gt = function(e, t) {
|
|
2964
2964
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
2965
|
-
},
|
|
2966
|
-
if (!ke[t] &&
|
|
2967
|
-
if (
|
|
2965
|
+
}, Kt = function(e, t, n) {
|
|
2966
|
+
if (!ke[t] && Qt(t) && Gt(D.tagNameCheck, t)) return !1;
|
|
2967
|
+
if (M && !Je[t] && !Je[Ai(t)]) {
|
|
2968
2968
|
let t = g(e), r = h(e);
|
|
2969
2969
|
if (r && t) {
|
|
2970
2970
|
let i = r.length;
|
|
@@ -2974,35 +2974,35 @@ function wa() {
|
|
|
2974
2974
|
}
|
|
2975
2975
|
}
|
|
2976
2976
|
}
|
|
2977
|
-
return
|
|
2978
|
-
},
|
|
2977
|
+
return St(e), !0;
|
|
2978
|
+
}, qt = function(e, t, n, r) {
|
|
2979
2979
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
2980
|
-
},
|
|
2981
|
-
return e === t || g(e) !== null ? !1 : (
|
|
2982
|
-
},
|
|
2983
|
-
if (
|
|
2984
|
-
if (
|
|
2985
|
-
let r =
|
|
2986
|
-
if (w =
|
|
2980
|
+
}, Jt = function(e, t) {
|
|
2981
|
+
return e === t || g(e) !== null ? !1 : (Ge && Ot(e), !0);
|
|
2982
|
+
}, Yt = function(e, n) {
|
|
2983
|
+
if (Pt(e), L(C.beforeSanitizeElements, e, null), Jt(e, n)) return !0;
|
|
2984
|
+
if (Ht(e)) return St(e), !0;
|
|
2985
|
+
let r = F(ae(e));
|
|
2986
|
+
if (w = qt(C.uponSanitizeElement, w, Oe, Re), L(C.uponSanitizeElement, e, {
|
|
2987
2987
|
tagName: r,
|
|
2988
2988
|
allowedTags: w
|
|
2989
|
-
}),
|
|
2990
|
-
if (
|
|
2989
|
+
}), Jt(e, n)) return !0;
|
|
2990
|
+
if (Wt(e, r)) return St(e), !0;
|
|
2991
2991
|
if (ke[r] || !(O.tagCheck instanceof Function && O.tagCheck(r)) && !w[r]) {
|
|
2992
|
-
let t =
|
|
2993
|
-
return t === !1 && (
|
|
2992
|
+
let t = Kt(e, r, n);
|
|
2993
|
+
return t === !1 && (L(C.afterSanitizeElements, e, null), Jt(e, n)) ? !0 : t;
|
|
2994
2994
|
}
|
|
2995
|
-
if (v(e) === $.element && !
|
|
2996
|
-
if (
|
|
2997
|
-
let n =
|
|
2995
|
+
if (v(e) === $.element && !xt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(ga, e.innerHTML)) return St(e), !0;
|
|
2996
|
+
if (k && e.nodeType === $.text) {
|
|
2997
|
+
let n = zt(e.textContent);
|
|
2998
2998
|
e.textContent !== n && (Ci(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
2999
2999
|
}
|
|
3000
|
-
return
|
|
3001
|
-
},
|
|
3002
|
-
if (Ae[t] ||
|
|
3000
|
+
return L(C.afterSanitizeElements, e, null), Jt(e, n);
|
|
3001
|
+
}, Xt = function(e, t, r) {
|
|
3002
|
+
if (Ae[t] || Ft(t, e) || j && (t === "id" || t === "name") && (r in n || r in pt)) return !1;
|
|
3003
3003
|
let i = T[t] || O.attributeCheck instanceof Function && O.attributeCheck(t, e);
|
|
3004
|
-
return Me && J(Se, t) || je && J(Ce, t) ? !0 : i ?
|
|
3005
|
-
},
|
|
3004
|
+
return Me && J(Se, t) || je && J(Ce, t) ? !0 : i ? Qe[t] || J(De, Ni(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Pi(r, "data:") === 0 && Xe[e] || Ne && !J(we, Ni(r, Te, "")) ? !0 : !r : Qt(e) && Gt(D.tagNameCheck, e) && Gt(D.attributeNameCheck, t, e) || t === "is" && D.allowCustomizedBuiltInElements && Gt(D.tagNameCheck, r);
|
|
3005
|
+
}, Zt = X({}, [
|
|
3006
3006
|
"annotation-xml",
|
|
3007
3007
|
"color-profile",
|
|
3008
3008
|
"font-face",
|
|
@@ -3011,47 +3011,47 @@ function wa() {
|
|
|
3011
3011
|
"font-face-src",
|
|
3012
3012
|
"font-face-uri",
|
|
3013
3013
|
"missing-glyph"
|
|
3014
|
-
]),
|
|
3015
|
-
return !
|
|
3016
|
-
},
|
|
3014
|
+
]), Qt = function(e) {
|
|
3015
|
+
return !Zt[Ai(e)] && J(Ee, e);
|
|
3016
|
+
}, $t = function(e, t, n, r) {
|
|
3017
3017
|
if (y && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3018
3018
|
case "TrustedHTML": return de(r);
|
|
3019
3019
|
case "TrustedScriptURL": return fe(r);
|
|
3020
3020
|
}
|
|
3021
3021
|
return r;
|
|
3022
|
-
},
|
|
3022
|
+
}, en = function(e, t, n, r) {
|
|
3023
3023
|
try {
|
|
3024
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
3024
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Ht(e) || (St(e), !1);
|
|
3025
3025
|
} catch {
|
|
3026
|
-
return
|
|
3026
|
+
return Tt(t, e), !1;
|
|
3027
3027
|
}
|
|
3028
|
-
},
|
|
3029
|
-
return
|
|
3030
|
-
},
|
|
3031
|
-
if (
|
|
3028
|
+
}, tn = function(e, t) {
|
|
3029
|
+
return Fe && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : Ai(e) === "attributename" && Mi(t, "href") !== null;
|
|
3030
|
+
}, nn = function(e, n) {
|
|
3031
|
+
if (L(C.beforeSanitizeAttributes, e, null), Jt(e, n)) return;
|
|
3032
3032
|
let r = e.attributes;
|
|
3033
|
-
if (!r ||
|
|
3034
|
-
T =
|
|
3033
|
+
if (!r || Ht(e)) return;
|
|
3034
|
+
T = qt(C.uponSanitizeAttribute, T, E, ze);
|
|
3035
3035
|
let i = {
|
|
3036
3036
|
attrName: "",
|
|
3037
3037
|
attrValue: "",
|
|
3038
3038
|
keepAttr: !0,
|
|
3039
3039
|
allowedAttributes: T,
|
|
3040
3040
|
forceKeepAttr: void 0
|
|
3041
|
-
}, a = r.length, o =
|
|
3041
|
+
}, a = r.length, o = F(e.nodeName);
|
|
3042
3042
|
for (; a--;) {
|
|
3043
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
3044
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0,
|
|
3043
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = F(s), d = l, f = s === "value" ? d : Fi(d), p = !1;
|
|
3044
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, L(C.uponSanitizeAttribute, e, i), f = i.attrValue, Ue && (u === "id" || u === "name") && Pi(f, We) !== 0 && (Tt(s, e, n), f = We + f, p = !0), tn(s, f) ? Tt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Pe && J(_a, f) ? Tt(s, e, n) : (k && (f = zt(f)), Xt(o, u, f) ? (f = $t(o, u, c, f), f !== d && en(e, s, c, f) && p && Si(t.removed)) : Tt(s, e, n)) : Tt(s, e, n));
|
|
3045
3045
|
}
|
|
3046
|
-
|
|
3047
|
-
},
|
|
3048
|
-
let t = null, n =
|
|
3049
|
-
for (
|
|
3046
|
+
L(C.afterSanitizeAttributes, e, null), Jt(e, n);
|
|
3047
|
+
}, rn = function(e) {
|
|
3048
|
+
let t = null, n = Rt(e);
|
|
3049
|
+
for (L(C.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (L(C.uponSanitizeShadowNode, t, null), Yt(t, e), nn(t, e), I(t.content) && rn(t.content), v(t) === $.element) {
|
|
3050
3050
|
let e = te(t);
|
|
3051
|
-
|
|
3051
|
+
I(e) && (an(e), rn(e));
|
|
3052
3052
|
}
|
|
3053
|
-
|
|
3054
|
-
},
|
|
3053
|
+
k && Vt(e), L(C.afterSanitizeShadowDOM, e, null);
|
|
3054
|
+
}, an = function(e) {
|
|
3055
3055
|
let t = [{
|
|
3056
3056
|
node: e,
|
|
3057
3057
|
shadow: null
|
|
@@ -3059,7 +3059,7 @@ function wa() {
|
|
|
3059
3059
|
for (; t.length > 0;) {
|
|
3060
3060
|
let e = t.pop();
|
|
3061
3061
|
if (e.shadow) {
|
|
3062
|
-
|
|
3062
|
+
rn(e.shadow);
|
|
3063
3063
|
continue;
|
|
3064
3064
|
}
|
|
3065
3065
|
let n = e.node, r = v(n) === $.element, i = h(n);
|
|
@@ -3069,9 +3069,9 @@ function wa() {
|
|
|
3069
3069
|
});
|
|
3070
3070
|
if (r) {
|
|
3071
3071
|
let e = _ ? _(n) : null;
|
|
3072
|
-
if (typeof e == "string" &&
|
|
3072
|
+
if (typeof e == "string" && F(e) === "template") {
|
|
3073
3073
|
let e = n.content;
|
|
3074
|
-
|
|
3074
|
+
I(e) && t.push({
|
|
3075
3075
|
node: e,
|
|
3076
3076
|
shadow: null
|
|
3077
3077
|
});
|
|
@@ -3079,7 +3079,7 @@ function wa() {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
if (r) {
|
|
3081
3081
|
let e = te(n);
|
|
3082
|
-
|
|
3082
|
+
I(e) && t.push({
|
|
3083
3083
|
node: null,
|
|
3084
3084
|
shadow: e
|
|
3085
3085
|
}, {
|
|
@@ -3091,56 +3091,56 @@ function wa() {
|
|
|
3091
3091
|
};
|
|
3092
3092
|
return t.sanitize = function(e) {
|
|
3093
3093
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3094
|
-
if (
|
|
3094
|
+
if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Ut(e) && (e = Wi(e), typeof e != "string")) throw Vi("dirty is not a string, aborting");
|
|
3095
3095
|
if (!t.isSupported) return e;
|
|
3096
|
-
|
|
3097
|
-
let c =
|
|
3096
|
+
Le ? (w = Re, T = ze) : ht(n), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (w = Z(w)), C.uponSanitizeAttribute.length > 0 && (T = Z(T)), t.removed = [];
|
|
3097
|
+
let c = Ge && typeof e != "string" && Ut(e), l = [], u = Ke;
|
|
3098
3098
|
if (c) {
|
|
3099
|
-
|
|
3099
|
+
It(e);
|
|
3100
3100
|
let t = ae(e);
|
|
3101
3101
|
if (typeof t == "string") {
|
|
3102
|
-
let n =
|
|
3103
|
-
if (!w[n] || ke[n]) throw
|
|
3102
|
+
let n = F(t);
|
|
3103
|
+
if (!w[n] || ke[n]) throw wt(e), Vi("root node is forbidden and cannot be sanitized in-place");
|
|
3104
3104
|
}
|
|
3105
|
-
if (
|
|
3106
|
-
l =
|
|
3107
|
-
} else if (
|
|
3105
|
+
if (Ht(e)) throw wt(e), Vi("root node is clobbered and cannot be sanitized in-place");
|
|
3106
|
+
l = kt(e), Ke = Di();
|
|
3107
|
+
} else if (Ut(e)) i = Lt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), an(i);
|
|
3108
3108
|
else {
|
|
3109
|
-
if (!
|
|
3110
|
-
if (i =
|
|
3109
|
+
if (!Ve && !k && !Ie && e.indexOf("<") === -1) return y && A ? de(e) : e;
|
|
3110
|
+
if (i = Lt(e), !i) return Ve ? null : A ? b : "";
|
|
3111
3111
|
}
|
|
3112
|
-
i &&
|
|
3112
|
+
i && Be && St(i.firstChild);
|
|
3113
3113
|
let d = c ? e : i;
|
|
3114
3114
|
try {
|
|
3115
|
-
c &&
|
|
3116
|
-
let t =
|
|
3117
|
-
for (; o = t.nextNode();)
|
|
3118
|
-
c &&
|
|
3115
|
+
c && an(e);
|
|
3116
|
+
let t = Rt(d);
|
|
3117
|
+
for (; o = t.nextNode();) Yt(o, d), nn(o, d), I(o.content) && rn(o.content);
|
|
3118
|
+
c && Mt(e, l);
|
|
3119
3119
|
} catch (t) {
|
|
3120
|
-
throw c && (
|
|
3120
|
+
throw c && (wt(e), jt(e, l)), t;
|
|
3121
3121
|
} finally {
|
|
3122
|
-
|
|
3122
|
+
Ke = u;
|
|
3123
3123
|
}
|
|
3124
3124
|
if (c) {
|
|
3125
|
-
if (
|
|
3126
|
-
return
|
|
3125
|
+
if (jt(e, l)) throw Vi("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3126
|
+
return k && Bt(e), e;
|
|
3127
3127
|
}
|
|
3128
|
-
if (
|
|
3129
|
-
if (
|
|
3128
|
+
if (Ve) {
|
|
3129
|
+
if (k && Bt(i), He) for (s = ge.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3130
3130
|
else s = i;
|
|
3131
3131
|
return (T.shadowroot || T.shadowrootmode) && (s = ve.call(r, s, !0)), s;
|
|
3132
3132
|
}
|
|
3133
|
-
let f =
|
|
3134
|
-
return
|
|
3133
|
+
let f = Ie ? i.outerHTML : i.innerHTML;
|
|
3134
|
+
return Ie && w["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(fa, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), k && (f = zt(f)), y && A ? de(f) : f;
|
|
3135
3135
|
}, t.setConfig = function() {
|
|
3136
3136
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3137
|
-
|
|
3137
|
+
ht(e), Le = !0, Re = w, ze = T;
|
|
3138
3138
|
}, t.clearConfig = function() {
|
|
3139
|
-
|
|
3139
|
+
ft = null, Le = !1, Re = null, ze = null, y = ce, b = "";
|
|
3140
3140
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3141
|
-
|
|
3142
|
-
let r =
|
|
3143
|
-
return typeof n == "string" && (
|
|
3141
|
+
ft || ht({});
|
|
3142
|
+
let r = F(e), i = F(t);
|
|
3143
|
+
return typeof n == "string" && (tn(t, n) || !Pe && J(_a, n)) ? !1 : Xt(r, i, n);
|
|
3144
3144
|
}, t.addHook = function(e, t) {
|
|
3145
3145
|
typeof t == "function" && q(C, e) && Ci(C[e], t);
|
|
3146
3146
|
}, t.removeHook = function(e, t) {
|
|
@@ -3247,8 +3247,75 @@ function Ia() {
|
|
|
3247
3247
|
hostOf: (e) => Na(i(e), r())
|
|
3248
3248
|
};
|
|
3249
3249
|
}
|
|
3250
|
-
// ../../packages/components/src/chat/
|
|
3251
|
-
var La =
|
|
3250
|
+
// ../../packages/components/src/chat/richCopy.ts
|
|
3251
|
+
var La = "font-family:Aptos,Calibri,Arial,sans-serif;font-size:11pt", Ra = "font-family:Consolas,Menlo,monospace;font-size:10pt", za = "border:1px solid #bfbfbf;padding:4px 8px;text-align:left;vertical-align:top", Ba = {
|
|
3252
|
+
table: "border-collapse:collapse;margin:8px 0",
|
|
3253
|
+
th: `${za};background:#f2f2f2;font-weight:bold`,
|
|
3254
|
+
td: za,
|
|
3255
|
+
pre: `${Ra};background:#f5f5f5;padding:8px;white-space:pre-wrap`,
|
|
3256
|
+
blockquote: "border-left:3px solid #c8c8c8;margin:0;padding-left:12px"
|
|
3257
|
+
}, Va = "button, .pk-markdown-table-actions, [data-held-src]", Ha = (e) => {
|
|
3258
|
+
for (let t of Array.from(e.querySelectorAll("[data-katex]"))) try {
|
|
3259
|
+
t.replaceWith(decodeURIComponent(t.dataset.katex ?? ""));
|
|
3260
|
+
} catch {
|
|
3261
|
+
t.remove();
|
|
3262
|
+
}
|
|
3263
|
+
}, Ua = /* @__PURE__ */ new Set([
|
|
3264
|
+
"left",
|
|
3265
|
+
"right",
|
|
3266
|
+
"center",
|
|
3267
|
+
"justify"
|
|
3268
|
+
]), Wa = (e) => {
|
|
3269
|
+
e instanceof HTMLAnchorElement && e.hasAttribute("href") && e.setAttribute("href", e.href), e instanceof HTMLImageElement && e.hasAttribute("src") && e.setAttribute("src", e.src);
|
|
3270
|
+
for (let t of e.getAttributeNames()) (t === "class" || t === "role" || t.startsWith("data-") || t.startsWith("aria-")) && e.removeAttribute(t);
|
|
3271
|
+
let t = e.tagName.toLowerCase(), n = Ba[t] ?? (t === "code" && e.parentElement?.tagName !== "PRE" ? `${Ra};background:#f5f5f5` : void 0);
|
|
3272
|
+
if (n) {
|
|
3273
|
+
let t = e.getAttribute("align")?.toLowerCase();
|
|
3274
|
+
e.setAttribute("style", t && Ua.has(t) ? `${n};text-align:${t}` : n);
|
|
3275
|
+
}
|
|
3276
|
+
}, Ga = (e) => {
|
|
3277
|
+
let t = e.cloneNode(!0);
|
|
3278
|
+
Ha(t);
|
|
3279
|
+
for (let e of Array.from(t.querySelectorAll(Va))) e.remove();
|
|
3280
|
+
return t;
|
|
3281
|
+
};
|
|
3282
|
+
function Ka(e) {
|
|
3283
|
+
let t = document.createElement("div");
|
|
3284
|
+
t.setAttribute("style", La);
|
|
3285
|
+
for (let n of e) {
|
|
3286
|
+
let e = Ga(n);
|
|
3287
|
+
Wa(e);
|
|
3288
|
+
for (let t of Array.from(e.querySelectorAll("*"))) Wa(t);
|
|
3289
|
+
t.append(e);
|
|
3290
|
+
}
|
|
3291
|
+
return `<meta charset="utf-8">${t.outerHTML}`;
|
|
3292
|
+
}
|
|
3293
|
+
function qa(e) {
|
|
3294
|
+
let t = Ga(e);
|
|
3295
|
+
return Array.from(t.rows).map((e) => Array.from(e.cells).map((e) => (e.textContent ?? "").replace(/\s+/g, " ").trim()).join(" ")).join("\n");
|
|
3296
|
+
}
|
|
3297
|
+
async function Ja({ html: e, text: t }) {
|
|
3298
|
+
if (typeof ClipboardItem < "u" && typeof navigator.clipboard?.write == "function") try {
|
|
3299
|
+
return await navigator.clipboard.write([new ClipboardItem({
|
|
3300
|
+
"text/html": new Blob([e], { type: "text/html" }),
|
|
3301
|
+
"text/plain": new Blob([t], { type: "text/plain" })
|
|
3302
|
+
})]), !0;
|
|
3303
|
+
} catch {}
|
|
3304
|
+
return Ya(e, t);
|
|
3305
|
+
}
|
|
3306
|
+
var Ya = (e, t) => {
|
|
3307
|
+
let n = (n) => {
|
|
3308
|
+
n.preventDefault(), n.clipboardData?.setData("text/html", e), n.clipboardData?.setData("text/plain", t);
|
|
3309
|
+
};
|
|
3310
|
+
document.addEventListener("copy", n, { once: !0 });
|
|
3311
|
+
try {
|
|
3312
|
+
return document.execCommand("copy");
|
|
3313
|
+
} catch {
|
|
3314
|
+
return !1;
|
|
3315
|
+
} finally {
|
|
3316
|
+
document.removeEventListener("copy", n);
|
|
3317
|
+
}
|
|
3318
|
+
}, Xa = ["data-pswp-images", "innerHTML"], Za = 100, Qa = /* @__PURE__ */ u({
|
|
3252
3319
|
__name: "PkStreamingMarkdown",
|
|
3253
3320
|
props: {
|
|
3254
3321
|
markdown: { default: "" },
|
|
@@ -3262,7 +3329,11 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3262
3329
|
type: Boolean,
|
|
3263
3330
|
default: !1
|
|
3264
3331
|
},
|
|
3265
|
-
tailLength: { default: void 0 }
|
|
3332
|
+
tailLength: { default: void 0 },
|
|
3333
|
+
copyTables: {
|
|
3334
|
+
type: Boolean,
|
|
3335
|
+
default: !1
|
|
3336
|
+
}
|
|
3266
3337
|
},
|
|
3267
3338
|
setup(t) {
|
|
3268
3339
|
let a = t, { t: u } = ie({ useScope: "global" }), d = null;
|
|
@@ -3339,8 +3410,8 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3339
3410
|
let t = e.header.map((e) => ce(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3340
3411
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3341
3412
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3342
|
-
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3343
|
-
return `<div class="table-wrapper u-table-scroll"><table class="${
|
|
3413
|
+
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "", i = e.header.length >= 3 && e.rows.length ? "u-table u-table--stack" : "u-table", o = a.copyTables && !a.loading && e.rows.length ? `<div class="pk-markdown-table-actions"><button type="button" class="vv-button vv-button--action-quiet-small" data-copy-table>${Ea(u("action.copyTable"))}</button></div>` : "";
|
|
3414
|
+
return `<div class="table-wrapper u-table-scroll"><table class="${i}" role="table"><thead role="rowgroup">${n(e.header)}</thead>${r}</table></div>${o}\n`;
|
|
3344
3415
|
} finally {
|
|
3345
3416
|
x = !1;
|
|
3346
3417
|
}
|
|
@@ -3365,9 +3436,9 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3365
3436
|
let me = [
|
|
3366
3437
|
y,
|
|
3367
3438
|
pe,
|
|
3368
|
-
|
|
3439
|
+
cn,
|
|
3369
3440
|
fe
|
|
3370
|
-
], S = re("container"), he = v(te(a, "markdown"),
|
|
3441
|
+
], S = re("container"), he = v(te(a, "markdown"), Za), ge = c(() => a.tailLength ? e(he.value, a.tailLength) : he.value), { resolveText: _e } = s(), ve = _e(ge), C = Ia(), ye = n(), be = c(() => {
|
|
3371
3442
|
let e = me.reduce((e, t) => t(e), ve.value);
|
|
3372
3443
|
return Aa(W.parse(e, {
|
|
3373
3444
|
async: !1,
|
|
@@ -3380,10 +3451,24 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3380
3451
|
} : void 0);
|
|
3381
3452
|
});
|
|
3382
3453
|
function xe(e) {
|
|
3383
|
-
let t =
|
|
3384
|
-
|
|
3454
|
+
let t = e.target?.closest?.("[data-copy-table]");
|
|
3455
|
+
if (t) {
|
|
3456
|
+
Se(t);
|
|
3457
|
+
return;
|
|
3458
|
+
}
|
|
3459
|
+
let n = (e.target?.closest?.(`[${ka}]`))?.getAttribute(ka);
|
|
3460
|
+
n && (e.preventDefault(), e.stopPropagation(), C.release(n));
|
|
3461
|
+
}
|
|
3462
|
+
async function Se(e) {
|
|
3463
|
+
let t = e.closest(".pk-markdown-table-actions")?.previousElementSibling?.querySelector("table");
|
|
3464
|
+
t && await Ja({
|
|
3465
|
+
html: Ka([t]),
|
|
3466
|
+
text: qa(t)
|
|
3467
|
+
}) && (e.textContent = u("action.copied"), setTimeout(() => {
|
|
3468
|
+
e.textContent = u("action.copyTable");
|
|
3469
|
+
}, 2e3));
|
|
3385
3470
|
}
|
|
3386
|
-
async function
|
|
3471
|
+
async function Ce() {
|
|
3387
3472
|
if (a.loading) return;
|
|
3388
3473
|
await f();
|
|
3389
3474
|
let e = S.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
@@ -3398,14 +3483,14 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3398
3483
|
} catch {}
|
|
3399
3484
|
}
|
|
3400
3485
|
}
|
|
3401
|
-
async function
|
|
3486
|
+
async function we() {
|
|
3402
3487
|
await f();
|
|
3403
3488
|
let e = S.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3404
3489
|
if (!e?.length) return;
|
|
3405
3490
|
let t = (await import("highlight.js/lib/common")).default;
|
|
3406
3491
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3407
3492
|
}
|
|
3408
|
-
async function
|
|
3493
|
+
async function Te() {
|
|
3409
3494
|
await f();
|
|
3410
3495
|
let e = S.value?.querySelectorAll(".katex-pending");
|
|
3411
3496
|
if (!e?.length) return;
|
|
@@ -3424,7 +3509,7 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3424
3509
|
} catch {}
|
|
3425
3510
|
}
|
|
3426
3511
|
}
|
|
3427
|
-
async function
|
|
3512
|
+
async function Ee() {
|
|
3428
3513
|
await f();
|
|
3429
3514
|
let e = S.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3430
3515
|
if (!e?.length) return;
|
|
@@ -3437,7 +3522,7 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3437
3522
|
} catch {}
|
|
3438
3523
|
}
|
|
3439
3524
|
}
|
|
3440
|
-
function
|
|
3525
|
+
function De(e) {
|
|
3441
3526
|
let t = e.target;
|
|
3442
3527
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3443
3528
|
t.dataset.broken = "true";
|
|
@@ -3445,68 +3530,68 @@ var La = ["data-pswp-images", "innerHTML"], Ra = 100, za = /* @__PURE__ */ u({
|
|
|
3445
3530
|
n.className = "markdown-broken-image", n.textContent = t.alt || u("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3446
3531
|
}
|
|
3447
3532
|
ee(() => {
|
|
3448
|
-
S.value?.addEventListener("error",
|
|
3533
|
+
S.value?.addEventListener("error", De, !0);
|
|
3449
3534
|
}), p(() => {
|
|
3450
|
-
S.value?.removeEventListener("error",
|
|
3451
|
-
}), _([be, () => a.loading],
|
|
3535
|
+
S.value?.removeEventListener("error", De, !0);
|
|
3536
|
+
}), _([be, () => a.loading], Ce, { immediate: !0 }), _(() => a.isDark, Ee), _(be, we, { immediate: !0 }), _(be, Te, { immediate: !0 }), ye && _(be, (e) => {
|
|
3452
3537
|
e.includes("<img") && ye.join();
|
|
3453
3538
|
}, { immediate: !0 });
|
|
3454
|
-
let
|
|
3539
|
+
let w = 0, Oe = {
|
|
3455
3540
|
fadeIn: "pk-streaming-markdown-fade-in",
|
|
3456
3541
|
blurIn: "pk-streaming-markdown-blur-in",
|
|
3457
3542
|
dropIn: "pk-streaming-markdown-drop-in",
|
|
3458
3543
|
slideUp: "pk-streaming-markdown-slide-up",
|
|
3459
3544
|
fadeAndScale: "pk-streaming-markdown-fade-and-scale"
|
|
3460
3545
|
};
|
|
3461
|
-
function
|
|
3462
|
-
let n = document.createElement("span"), r = a.animation ?
|
|
3546
|
+
function T(e, t) {
|
|
3547
|
+
let n = document.createElement("span"), r = a.animation ? Oe[a.animation] : "none";
|
|
3463
3548
|
return n.style.cssText = `animation:${r} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3464
3549
|
let t = n.parentNode;
|
|
3465
3550
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3466
3551
|
}, { once: !0 }), n;
|
|
3467
3552
|
}
|
|
3468
|
-
function
|
|
3553
|
+
function E(e, t, n, r) {
|
|
3469
3554
|
let i = r, a = e.split(/(\s+)/);
|
|
3470
|
-
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(
|
|
3555
|
+
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(T(e, i * 30), n), i++));
|
|
3471
3556
|
return i;
|
|
3472
3557
|
}
|
|
3473
|
-
function
|
|
3558
|
+
function D(e) {
|
|
3474
3559
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3475
3560
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3476
3561
|
} }), n = [];
|
|
3477
3562
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3478
3563
|
return n;
|
|
3479
3564
|
}
|
|
3480
|
-
function
|
|
3565
|
+
function ke() {
|
|
3481
3566
|
if (!S.value || !a.loading || !a.animation) return;
|
|
3482
|
-
let e =
|
|
3567
|
+
let e = D(S.value), t = 0, n = 0;
|
|
3483
3568
|
for (let r of e) {
|
|
3484
3569
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3485
|
-
if (t = a, a <=
|
|
3570
|
+
if (t = a, a <= w) continue;
|
|
3486
3571
|
let o = r.parentNode;
|
|
3487
3572
|
if (!o) continue;
|
|
3488
|
-
if (i >=
|
|
3573
|
+
if (i >= w) {
|
|
3489
3574
|
let t = r.nextSibling;
|
|
3490
|
-
o.removeChild(r), n =
|
|
3575
|
+
o.removeChild(r), n = E(e, o, t, n);
|
|
3491
3576
|
continue;
|
|
3492
3577
|
}
|
|
3493
|
-
let s =
|
|
3494
|
-
o.removeChild(c), n =
|
|
3578
|
+
let s = w - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3579
|
+
o.removeChild(c), n = E(l, o, u, n);
|
|
3495
3580
|
}
|
|
3496
|
-
|
|
3581
|
+
w = t;
|
|
3497
3582
|
}
|
|
3498
3583
|
return _(be, async () => {
|
|
3499
|
-
await f(),
|
|
3584
|
+
await f(), ke();
|
|
3500
3585
|
}, { immediate: !0 }), _(() => a.markdown, (e, t) => {
|
|
3501
|
-
(!e || t && e.length < t.length) && (
|
|
3586
|
+
(!e || t && e.length < t.length) && (w = 0);
|
|
3502
3587
|
}), (e, t) => (m(), l("div", {
|
|
3503
3588
|
ref: "container",
|
|
3504
3589
|
"data-pswp-images": ne(ye) ? "" : void 0,
|
|
3505
3590
|
onClick: xe,
|
|
3506
3591
|
innerHTML: be.value
|
|
3507
|
-
}, null, 8,
|
|
3592
|
+
}, null, 8, Xa));
|
|
3508
3593
|
}
|
|
3509
3594
|
});
|
|
3510
|
-
export { Ma as n,
|
|
3595
|
+
export { Ia as a, Ma as i, Ja as n, Ka as r, Qa as t };
|
|
3511
3596
|
|
|
3512
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3597
|
+
//# sourceMappingURL=PkStreamingMarkdown-WIueQOg3.js.map
|