@8wave/ai-elements 0.121.0-beta.3 → 0.121.0-beta.30
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/README.md +125 -54
- package/dist/_chunks/{Agent-BYC51e6E.js → Agent-wvUJZjp3.js} +70 -61
- package/dist/_chunks/Agent-wvUJZjp3.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-CNoHyTuC.js → PkStreamingMarkdown-DeZn-hPo.js} +846 -841
- package/dist/_chunks/PkStreamingMarkdown-DeZn-hPo.js.map +1 -0
- package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js → PkToolEditSpreadsheet-BJEWc_nV.js} +2 -2
- package/dist/_chunks/{PkToolEditSpreadsheet-B8bO3vZa.js.map → PkToolEditSpreadsheet-BJEWc_nV.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js → PkToolRequestGeolocation-CPU3e3iJ.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DrvL0h9d.js.map → PkToolRequestGeolocation-CPU3e3iJ.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js → PkToolRequestOAuthConnection-C8nfpS3d.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-BXti5Vkt.js.map → PkToolRequestOAuthConnection-C8nfpS3d.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js → PkToolShowArtifact-Bt_qBvdI.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DR71LNck.js.map → PkToolShowArtifact-Bt_qBvdI.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js → PkToolShowContactForm-BwKW5txM.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-C4BshHSs.js.map → PkToolShowContactForm-BwKW5txM.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js → PkToolShowForm-DJhe2pV3.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-BLSTn0xE.js.map → PkToolShowForm-DJhe2pV3.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js → PkToolShowImageGallery-DPEIoeDc.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-CqOXbo0Y.js.map → PkToolShowImageGallery-DPEIoeDc.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-westY5bY.js → PkToolShowProductList-C5alYUrB.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-westY5bY.js.map → PkToolShowProductList-C5alYUrB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js → PkToolShowSources-CkwbyMdU.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Dy9VXRgv.js.map → PkToolShowSources-CkwbyMdU.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js → PkToolShowSuggestedReply-C-yCzH_d.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-BZ2U3ULB.js.map → PkToolShowSuggestedReply-C-yCzH_d.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js → PkToolShowVideo-DL554qVB.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-CrFaQbMp.js.map → PkToolShowVideo-DL554qVB.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js → PkToolShowWebPages-D35l7s9P.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-DXszshY9.js.map → PkToolShowWebPages-D35l7s9P.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-B5-QV037.js → chatImagePolicy-Caj4GsFN.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-B5-QV037.js.map → chatImagePolicy-Caj4GsFN.js.map} +1 -1
- package/dist/_chunks/{markdown-DO_FLvlJ.js → markdown-DzN3Q-au.js} +10 -10
- package/dist/_chunks/{markdown-DO_FLvlJ.js.map → markdown-DzN3Q-au.js.map} +1 -1
- package/dist/ai-elements.es.js +3912 -3048
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.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-2DVqpLwz.js → Agent-ywfLo1Hg.js} +71 -61
- package/dist-vue/_chunks/Agent-ywfLo1Hg.js.map +1 -0
- package/dist-vue/_chunks/{Document-ChfbOVVs.js → Document-DqkgJZNx.js} +10 -10
- package/dist-vue/_chunks/{Document-ChfbOVVs.js.map → Document-DqkgJZNx.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-DsZ8mAbt.js → PkChatbot-CLy8LgF8.js} +9 -9
- package/dist-vue/_chunks/PkChatbot-CLy8LgF8.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js → PkChatbotEmptyState-DLg5tLl5.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-DqzgF4vH.js.map → PkChatbotEmptyState-DLg5tLl5.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BRhIG8HR.js → PkChatbotInput-CjE0vZAK.js} +87 -80
- package/dist-vue/_chunks/PkChatbotInput-CjE0vZAK.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-WryjcyH7.js → PkChatbotMessages-Dzc0kzyo.js} +18 -18
- package/dist-vue/_chunks/PkChatbotMessages-Dzc0kzyo.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js → PkChatbotStepPayload-DjGNmloY.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-Bga_HEps.js.map → PkChatbotStepPayload-DjGNmloY.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js → PkChatbotStepToolDetail-CUIWz1nJ.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-YbUYP-Y3.js.map → PkChatbotStepToolDetail-CUIWz1nJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js → PkChatbotSteps-B4r68w6z.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotSteps-CVAkaIzk.js.map → PkChatbotSteps-B4r68w6z.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-B1gbdvs1.js → PkChatbotViewChat-B1iNTeQm.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-B1gbdvs1.js.map → PkChatbotViewChat-B1iNTeQm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js → PkChatbotViewConversations-D608ghH3.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-BHvHF0w7.js.map → PkChatbotViewConversations-D608ghH3.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js → PkChatbotViewFiles-CTg7R5HF.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-C-4__qj_.js.map → PkChatbotViewFiles-CTg7R5HF.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js → PkChatbotViewProfile-HBgg-zuj.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-_WMSVDlA.js.map → PkChatbotViewProfile-HBgg-zuj.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js → PkStreamingMarkdown-O7p8Vyju.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-6Y7qgbvS.js.map → PkStreamingMarkdown-O7p8Vyju.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js → PkToolEditSpreadsheet-B_Ge2pGx.js} +2 -2
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BTauPyXT.js.map → PkToolEditSpreadsheet-B_Ge2pGx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js → PkToolRequestGeolocation-D0FIRJk2.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DBzup6bn.js.map → PkToolRequestGeolocation-D0FIRJk2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js → PkToolRequestOAuthConnection-DFlZkvLP.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-yrRDpNqp.js.map → PkToolRequestOAuthConnection-DFlZkvLP.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js → PkToolShowArtifact-BTY19659.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-fp37O1om.js.map → PkToolShowArtifact-BTY19659.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js → PkToolShowContactForm-D82n3tZ4.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-iSx2ioyT.js.map → PkToolShowContactForm-D82n3tZ4.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js → PkToolShowDiagram-BlIarn5u.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BlKrh4gK.js.map → PkToolShowDiagram-BlIarn5u.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js → PkToolShowForm-b5m2ahty.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-CwlXH13N.js.map → PkToolShowForm-b5m2ahty.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js → PkToolShowImageGallery-CtIphioH.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-C4esYiM_.js.map → PkToolShowImageGallery-CtIphioH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js → PkToolShowProductList-Vq4zUoN5.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CdeYQ-mF.js.map → PkToolShowProductList-Vq4zUoN5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js → PkToolShowSources-B-r0dOgi.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-D8IF7g0d.js.map → PkToolShowSources-B-r0dOgi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js → PkToolShowSuggestedReply-Dl2VLfJk.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DXyO8ki2.js.map → PkToolShowSuggestedReply-Dl2VLfJk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js → PkToolShowVideo-CssORBGr.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CA7MNSp_.js.map → PkToolShowVideo-CssORBGr.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js → PkToolShowWebPages-Bhpc1HA2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CKWnAbp8.js.map → PkToolShowWebPages-Bhpc1HA2.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DecVahlB.js → createChatbotApiClient-DN6SHs1X.js} +29 -21
- package/dist-vue/_chunks/createChatbotApiClient-DN6SHs1X.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-BQTq8fq-.js → useChatbotStore-BlIWevWi.js} +1037 -920
- package/dist-vue/_chunks/useChatbotStore-BlIWevWi.js.map +1 -0
- package/dist-vue/_chunks/{utils-BLMOBcka.js → utils-FkhB6Tl2.js} +36 -41
- package/dist-vue/_chunks/utils-FkhB6Tl2.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +12 -4
- package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +4 -3
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +11 -5
- package/dist-vue/apps/web-component/src/composables/useChatbotProfileProvider.d.ts +3 -2
- package/dist-vue/apps/web-component/src/composables/useCopilotPageCss.d.ts +12 -4
- package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +19 -0
- package/dist-vue/apps/web-component/src/lib.d.ts +10 -3
- package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +33 -0
- package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +27 -0
- package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +18 -2
- package/dist-vue/apps/web-component/src/utils/emitWidgetEvent.d.ts +8 -0
- package/dist-vue/apps/web-component/src/utils/layout.d.ts +3 -3
- package/dist-vue/composables.js +213 -25
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4051 -4015
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +54 -20
- package/dist-vue/packages/auth/src/active-membership.d.ts +2 -0
- package/dist-vue/packages/components/src/PkSkeleton.d.ts +1 -1
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +8 -5
- package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/PkWebSearchSettings.d.ts +2 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +5 -0
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +7 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +123 -13
- package/dist-vue/packages/models/src/schema/Agent.d.ts +53 -25
- package/dist-vue/packages/models/src/schema/Chat.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Member.d.ts +13 -2
- package/dist-vue/packages/models/src/schema/Organization.d.ts +105 -0
- package/dist-vue/packages/models/src/schema/OrganizationDeletion.d.ts +197 -0
- package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +8 -2
- package/dist-vue/packages/models/src/schema/OrganizationIdentityProvider.d.ts +4 -1
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -3
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +5 -3
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-BYC51e6E.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-CNoHyTuC.js.map +0 -1
- package/dist-vue/_chunks/Agent-2DVqpLwz.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-DsZ8mAbt.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-BRhIG8HR.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-WryjcyH7.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-DecVahlB.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-BQTq8fq-.js.map +0 -1
- package/dist-vue/_chunks/utils-BLMOBcka.js.map +0 -1
- package/dist-vue/apps/web-component/src/composables/useCopilotPush.d.ts +0 -25
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { F as e, I as t, P as n, R as r, Y as i, Z as a, at as o, h as s, k as c, w as l, y as u, yt as d } from "./vue.runtime.esm-bundler-BkvITeKg.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BoTyYk8j.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import {
|
|
4
|
+
import { N as m, _ as h, f as te, g as ne, t as re, u as ie } from "./Agent-wvUJZjp3.js";
|
|
5
5
|
import "./src-Ra4oUpUU.js";
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { b as
|
|
6
|
+
import { n as g, t as _ } from "./text-BHCGblDQ.js";
|
|
7
|
+
import { n as v } from "./url-validation-9DstIfq2.js";
|
|
8
|
+
import { b as ae } from "./dist---RigjU4.js";
|
|
9
9
|
import { n as oe } from "./useShortUrlResolver-BGoPo6JO.js";
|
|
10
10
|
import { t as se } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
11
|
-
import { n as
|
|
11
|
+
import { n as y } from "./chatImagePolicy-Caj4GsFN.js";
|
|
12
12
|
//#region ../../packages/utils/src/citations.ts
|
|
13
|
-
var
|
|
13
|
+
var b = /[ \t]*\uE200[^\uE201]*\uE201/g, ce = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, le = /[\uE200-\uE20F]/g;
|
|
14
14
|
function ue(e) {
|
|
15
|
-
return e && e.replace(
|
|
15
|
+
return e && e.replace(b, "").replace(ce, "").replace(le, "");
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region ../../packages/utils/src/message.ts
|
|
19
|
-
function
|
|
19
|
+
function de(e) {
|
|
20
20
|
return e ? e.type === "text" : !1;
|
|
21
21
|
}
|
|
22
22
|
function x(e) {
|
|
23
23
|
return e ? e.type.startsWith("tool-") : !1;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function fe(e) {
|
|
26
26
|
return x(e) ? e.type.slice(5) : "";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function S(e) {
|
|
29
29
|
return e ? e.type === "file" : !1;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (!
|
|
31
|
+
function pe(e) {
|
|
32
|
+
if (!S(e)) return;
|
|
33
33
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
34
34
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
36
|
+
function me(e) {
|
|
37
|
+
if (!S(e)) return;
|
|
38
38
|
let t = e.providerMetadata?.["8bot"]?.transcript;
|
|
39
39
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function he(e, t) {
|
|
42
42
|
return e.map((e) => {
|
|
43
43
|
let n = t.filter((t) => t.messageId === e.id);
|
|
44
44
|
return n.length === 0 ? e : {
|
|
45
45
|
...e,
|
|
46
46
|
parts: e.parts.map((e) => {
|
|
47
|
-
let t = n.find(({ storedFileName: t }) => t ===
|
|
48
|
-
return t &&
|
|
47
|
+
let t = n.find(({ storedFileName: t }) => t === pe(e)?.storedFileName);
|
|
48
|
+
return t && S(e) ? {
|
|
49
49
|
...e,
|
|
50
50
|
providerMetadata: {
|
|
51
51
|
...e.providerMetadata,
|
|
@@ -59,53 +59,53 @@ function pe(e, t) {
|
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ge(e) {
|
|
63
63
|
return e ? e.type === "reasoning" : !1;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return e ? e.parts.some((e) =>
|
|
65
|
+
function _e(e) {
|
|
66
|
+
return e ? e.parts.some((e) => de(e)) : !1;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function ve(e) {
|
|
69
69
|
if (!e) return;
|
|
70
70
|
let t = e.parts;
|
|
71
|
-
if (Array.isArray(t)) return t.find((e) =>
|
|
71
|
+
if (Array.isArray(t)) return t.find((e) => de(e))?.text;
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region ../../packages/components/src/chat/utils.ts
|
|
75
|
-
function
|
|
75
|
+
function C(e) {
|
|
76
76
|
let t = [];
|
|
77
77
|
for (let n of e) {
|
|
78
|
-
if (!
|
|
78
|
+
if (!de(n)) {
|
|
79
79
|
t.push(n);
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
82
|
let e = t[t.length - 1];
|
|
83
|
-
e &&
|
|
83
|
+
e && de(e) ? t[t.length - 1] = {
|
|
84
84
|
...e,
|
|
85
85
|
text: e.text + n.text
|
|
86
86
|
} : t.push(n);
|
|
87
87
|
}
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
90
|
+
var ye = (e) => x(e) && h(fe(e));
|
|
91
|
+
function be(e) {
|
|
92
92
|
let t = /* @__PURE__ */ new Map();
|
|
93
|
-
for (let [n, r] of e.entries())
|
|
94
|
-
return e.filter((e, n) => !(
|
|
93
|
+
for (let [n, r] of e.entries()) ye(r) && r.state !== "output-error" && !Oe(r) && t.set(r.type, n);
|
|
94
|
+
return e.filter((e, n) => !(ye(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
95
95
|
}
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
let t = e.filter((e) =>
|
|
99
|
-
return t.length > 0 ? [...e.filter((e) => !
|
|
96
|
+
var xe = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
|
|
97
|
+
function Se(e) {
|
|
98
|
+
let t = e.filter((e) => xe.has(e.type));
|
|
99
|
+
return t.length > 0 ? [...e.filter((e) => !xe.has(e.type)), ...t] : e;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Ce(e, t) {
|
|
102
102
|
let n = e.toolCallId;
|
|
103
|
-
return
|
|
103
|
+
return xe.has(e.type) && n ? `file-${n}` : t;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function we(e) {
|
|
106
106
|
return m(e) ? e : void 0;
|
|
107
107
|
}
|
|
108
|
-
var
|
|
108
|
+
var Te = {
|
|
109
109
|
page_snapshot: {
|
|
110
110
|
icon: "ri:pages-line",
|
|
111
111
|
label: "messagePart.pageTool.snapshot"
|
|
@@ -126,21 +126,21 @@ var Ce = {
|
|
|
126
126
|
icon: "ri:arrow-up-down-line",
|
|
127
127
|
label: "messagePart.pageTool.scroll"
|
|
128
128
|
}
|
|
129
|
-
},
|
|
129
|
+
}, Ee = {
|
|
130
130
|
icon: "ri:survey-line",
|
|
131
131
|
label: "messagePart.pageTool.form"
|
|
132
|
-
},
|
|
133
|
-
function
|
|
134
|
-
return
|
|
132
|
+
}, De = (e) => e.toolMetadata?.provider === "page" ? Te[e.toolName] ?? (e.toolName.startsWith("form_") ? Ee : void 0) : void 0;
|
|
133
|
+
function w(e) {
|
|
134
|
+
return we(e)?.toolMetadata?.readOnly === !1;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Oe(e) {
|
|
137
137
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var T = 4e3, ke = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
140
|
+
function E(e, t) {
|
|
141
141
|
if (e.length <= t) return e;
|
|
142
142
|
let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
|
|
143
|
-
for (let t of e.matchAll(
|
|
143
|
+
for (let t of e.matchAll(ke)) {
|
|
144
144
|
if (t.index >= a) break;
|
|
145
145
|
let [, e, n] = t;
|
|
146
146
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -151,37 +151,47 @@ function Oe(e, t) {
|
|
|
151
151
|
}
|
|
152
152
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
153
153
|
}
|
|
154
|
-
var
|
|
154
|
+
var Ae = /* @__PURE__ */ new Set([
|
|
155
155
|
"approval-requested",
|
|
156
156
|
"approval-responded",
|
|
157
157
|
"output-denied"
|
|
158
158
|
]);
|
|
159
|
-
function ke(e) {
|
|
160
|
-
return x(e) ? D.has(e.state) ? !0 : e.approval != null : !1;
|
|
161
|
-
}
|
|
162
|
-
var Ae = "requestConfirm";
|
|
163
159
|
function je(e) {
|
|
160
|
+
return x(e) ? Ae.has(e.state) ? !0 : e.approval != null : !1;
|
|
161
|
+
}
|
|
162
|
+
var Me = "requestConfirm";
|
|
163
|
+
function Ne(e) {
|
|
164
164
|
return x(e) && e.type === "tool-requestConfirm";
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
return
|
|
166
|
+
function Pe(e) {
|
|
167
|
+
return je(e) || Ne(e);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Fe(e) {
|
|
170
170
|
if (x(e)) return e.approval?.id;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function Ie(e) {
|
|
173
173
|
if (e && "state" in e) return e.state;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function D(e = "000000") {
|
|
176
176
|
let t = e.replace("#", "");
|
|
177
177
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
178
178
|
let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
179
179
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
|
|
181
|
+
function Le(e) {
|
|
182
|
+
let t = e?.trim().replace("#", "") ?? "";
|
|
183
|
+
if (/^[0-9a-f]{3}$/i.test(t) && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-f]{6}$/i.test(t)) return !1;
|
|
184
|
+
let n = [
|
|
185
|
+
0,
|
|
186
|
+
2,
|
|
187
|
+
4
|
|
188
|
+
].map((e) => parseInt(t.substring(e, e + 2), 16));
|
|
189
|
+
return Math.max(...n) - Math.min(...n) < 32;
|
|
183
190
|
}
|
|
184
|
-
function
|
|
191
|
+
function Re(e, t) {
|
|
192
|
+
return e === "white" || e === "black" ? e : D(t);
|
|
193
|
+
}
|
|
194
|
+
function ze(e, t) {
|
|
185
195
|
if (e) return {
|
|
186
196
|
"--chatbot-main-color": e,
|
|
187
197
|
"--chatbot-contrast-color": t,
|
|
@@ -190,10 +200,10 @@ function Ie(e, t) {
|
|
|
190
200
|
"--input-focus-color": "var(--color-brand-graphic)"
|
|
191
201
|
};
|
|
192
202
|
}
|
|
193
|
-
function
|
|
203
|
+
function Be(e, t) {
|
|
194
204
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
195
205
|
}
|
|
196
|
-
function
|
|
206
|
+
function Ve(e) {
|
|
197
207
|
if (e !== void 0) {
|
|
198
208
|
if (typeof e == "string") return e.trim() || void 0;
|
|
199
209
|
try {
|
|
@@ -204,10 +214,10 @@ function Re(e) {
|
|
|
204
214
|
}
|
|
205
215
|
}
|
|
206
216
|
}
|
|
207
|
-
function
|
|
208
|
-
return
|
|
217
|
+
function He(e) {
|
|
218
|
+
return Ve(e) !== void 0;
|
|
209
219
|
}
|
|
210
|
-
function
|
|
220
|
+
function Ue(e, t) {
|
|
211
221
|
let n = e?.input;
|
|
212
222
|
if (typeof t == "string") {
|
|
213
223
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -219,14 +229,14 @@ function Be(e, t) {
|
|
|
219
229
|
return i ? `${i} ${n}` : n;
|
|
220
230
|
}).join(". ");
|
|
221
231
|
}
|
|
222
|
-
function
|
|
232
|
+
function We(e) {
|
|
223
233
|
return e?.options ? e.options.map((e) => ({
|
|
224
234
|
label: e.label,
|
|
225
235
|
value: e.label,
|
|
226
236
|
description: e.description
|
|
227
237
|
})) : [];
|
|
228
238
|
}
|
|
229
|
-
function
|
|
239
|
+
function Ge(e, t) {
|
|
230
240
|
let n = {};
|
|
231
241
|
if (t == null) return n;
|
|
232
242
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -242,12 +252,7 @@ function He(e, t) {
|
|
|
242
252
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
243
253
|
return n;
|
|
244
254
|
}
|
|
245
|
-
var
|
|
246
|
-
"tool-perplexity_search",
|
|
247
|
-
"tool-parallel_search",
|
|
248
|
-
"tool-web_search",
|
|
249
|
-
"tool-google_search"
|
|
250
|
-
], We = /* @__PURE__ */ new Set([
|
|
255
|
+
var Ke = ne.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
|
|
251
256
|
"tool-searchInKnowledgeBase",
|
|
252
257
|
"tool-retrieveRevisedAnswers",
|
|
253
258
|
"tool-expandChunkContext",
|
|
@@ -256,60 +261,60 @@ var Ue = [
|
|
|
256
261
|
"tool-geocode",
|
|
257
262
|
"tool-recallUserMemory",
|
|
258
263
|
"tool-saveUserMemory",
|
|
259
|
-
...
|
|
264
|
+
...Ke
|
|
260
265
|
]);
|
|
261
|
-
function
|
|
262
|
-
return x(e) &&
|
|
266
|
+
function Je(e) {
|
|
267
|
+
return x(e) && qe.has(e.type);
|
|
263
268
|
}
|
|
264
|
-
var
|
|
269
|
+
var Ye = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, O = (e, ...t) => {
|
|
265
270
|
for (let n of t) {
|
|
266
271
|
let t = e?.[n];
|
|
267
272
|
if (typeof t == "string" && t.trim()) return t;
|
|
268
273
|
}
|
|
269
274
|
};
|
|
270
|
-
function
|
|
275
|
+
function Xe(e) {
|
|
271
276
|
if (!x(e)) return;
|
|
272
|
-
let t =
|
|
273
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
277
|
+
let t = Ye("input" in e ? e.input : void 0), n = Ye("output" in e ? e.output : void 0);
|
|
278
|
+
if (e.type === "tool-searchInKnowledgeBase" || Ke.includes(e.type)) {
|
|
274
279
|
let e = t?.queries;
|
|
275
280
|
if (Array.isArray(e)) {
|
|
276
281
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
277
282
|
return t.length ? t.join(" · ") : void 0;
|
|
278
283
|
}
|
|
279
|
-
return
|
|
284
|
+
return O(t, "query", "objective");
|
|
280
285
|
}
|
|
281
|
-
if (e.type === "tool-retrieveRevisedAnswers") return
|
|
282
|
-
if (e.type === "tool-getWeather") return
|
|
283
|
-
if (e.type === "tool-geocode") return
|
|
284
|
-
if (e.type === "tool-expandChunkContext") return
|
|
285
|
-
if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return
|
|
286
|
+
if (e.type === "tool-retrieveRevisedAnswers") return O(t, "query");
|
|
287
|
+
if (e.type === "tool-getWeather") return O(n, "location") ?? O(t, "locationName");
|
|
288
|
+
if (e.type === "tool-geocode") return O(t, "locationName");
|
|
289
|
+
if (e.type === "tool-expandChunkContext") return O(n, "documentName");
|
|
290
|
+
if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment" || e.type === "tool-sendChatFile") return O(n, "name");
|
|
286
291
|
if (e.type === "tool-readSpreadsheet") {
|
|
287
|
-
let e =
|
|
292
|
+
let e = O(t, "sheet"), n = O(t, "range");
|
|
288
293
|
return e && n ? `${e}!${n}` : e;
|
|
289
294
|
}
|
|
290
|
-
if (e.type === "tool-editSpreadsheet") return
|
|
291
|
-
if (e.type === "tool-querySpreadsheet") return
|
|
292
|
-
if (e.type === "tool-recallUserMemory") return
|
|
293
|
-
if (e.type === "tool-saveUserMemory") return
|
|
295
|
+
if (e.type === "tool-editSpreadsheet") return O(n, "filename");
|
|
296
|
+
if (e.type === "tool-querySpreadsheet") return O(n, "file");
|
|
297
|
+
if (e.type === "tool-recallUserMemory") return O(t, "query");
|
|
298
|
+
if (e.type === "tool-saveUserMemory") return O(t, "content", "query");
|
|
294
299
|
}
|
|
295
|
-
function
|
|
296
|
-
let t =
|
|
297
|
-
if (t) return
|
|
298
|
-
if (x(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" :
|
|
299
|
-
if (
|
|
300
|
-
if (
|
|
300
|
+
function Ze(e) {
|
|
301
|
+
let t = we(e);
|
|
302
|
+
if (t) return De(t)?.icon ?? "ri:apps-line";
|
|
303
|
+
if (x(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-sendChatFile" ? "ri:send-plane-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : Ke.includes(e.type) ? "ri:global-line" : "ri:tools-line";
|
|
304
|
+
if (ge(e)) return "ri:lightbulb-line";
|
|
305
|
+
if (de(e)) return "ri:double-quotes-r";
|
|
301
306
|
}
|
|
302
|
-
var
|
|
307
|
+
var Qe = [
|
|
303
308
|
re,
|
|
304
309
|
ie,
|
|
305
310
|
te
|
|
306
311
|
];
|
|
307
|
-
function
|
|
312
|
+
function $e(e, { t, te: n }) {
|
|
308
313
|
if (n(`agent.tool.${e}`)) return t(`agent.tool.${e}`);
|
|
309
|
-
let r =
|
|
310
|
-
return g(
|
|
314
|
+
let r = Qe.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
|
|
315
|
+
return _(g(i).trim().toLowerCase());
|
|
311
316
|
}
|
|
312
|
-
var
|
|
317
|
+
var et = {
|
|
313
318
|
custom: (e) => e("messagePart.type.custom"),
|
|
314
319
|
data: (e) => e("messagePart.type.data"),
|
|
315
320
|
file: (e) => e("messagePart.type.file"),
|
|
@@ -319,13 +324,13 @@ var Ze = {
|
|
|
319
324
|
"step-start": (e) => e("messagePart.type.stepStart"),
|
|
320
325
|
text: (e) => e("messagePart.type.text")
|
|
321
326
|
};
|
|
322
|
-
function
|
|
323
|
-
if (x(e)) return
|
|
324
|
-
if (e.type === "dynamic-tool") return
|
|
325
|
-
let n =
|
|
326
|
-
return n ? n(t.t) : g(
|
|
327
|
+
function tt(e, t) {
|
|
328
|
+
if (x(e)) return $e(fe(e), t);
|
|
329
|
+
if (e.type === "dynamic-tool") return $e(e.toolName, t);
|
|
330
|
+
let n = et[e.type.startsWith("data-") ? "data" : e.type];
|
|
331
|
+
return n ? n(t.t) : _(g(e.type));
|
|
327
332
|
}
|
|
328
|
-
function
|
|
333
|
+
function nt(e, t) {
|
|
329
334
|
if (!e) return e;
|
|
330
335
|
let n = {
|
|
331
336
|
Intent: t("conversationSummary.intent"),
|
|
@@ -335,42 +340,42 @@ function $e(e, t) {
|
|
|
335
340
|
};
|
|
336
341
|
return e.replace(/\*\*(Intent|Topics covered|Key facts|Open questions)(:?)\*\*/g, (e, t, r) => `**${n[t]}${r}**`);
|
|
337
342
|
}
|
|
338
|
-
function
|
|
339
|
-
let n =
|
|
343
|
+
function rt(e, t) {
|
|
344
|
+
let n = we(t);
|
|
340
345
|
if (n) {
|
|
341
|
-
let t =
|
|
346
|
+
let t = De(n);
|
|
342
347
|
return t ? e(t.label) : n.title || n.toolName;
|
|
343
348
|
}
|
|
344
|
-
return x(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") :
|
|
349
|
+
return x(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-sendChatFile" ? e("messagePart.sendChatFile") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Ke.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : ge(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
345
350
|
}
|
|
346
351
|
//#endregion
|
|
347
352
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
348
|
-
var
|
|
353
|
+
var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnPropertyDescriptors, ot = Object.getOwnPropertySymbols, st = Object.prototype.hasOwnProperty, ct = Object.prototype.propertyIsEnumerable, lt = (e, t, n) => t in e ? it(e, t, {
|
|
349
354
|
enumerable: !0,
|
|
350
355
|
configurable: !0,
|
|
351
356
|
writable: !0,
|
|
352
357
|
value: n
|
|
353
|
-
}) : e[t] = n,
|
|
354
|
-
for (var n in t ||= {})
|
|
355
|
-
if (
|
|
358
|
+
}) : e[t] = n, ut = (e, t) => {
|
|
359
|
+
for (var n in t ||= {}) st.call(t, n) && lt(e, n, t[n]);
|
|
360
|
+
if (ot) for (var n of ot(t)) ct.call(t, n) && lt(e, n, t[n]);
|
|
356
361
|
return e;
|
|
357
|
-
},
|
|
362
|
+
}, dt = (e, t) => at(e, k(t)), A = {
|
|
358
363
|
PROSE: 0,
|
|
359
364
|
FENCE_MARKER: 1,
|
|
360
365
|
FENCE_INFO: 2,
|
|
361
366
|
FENCE_BODY: 3,
|
|
362
367
|
CODE_SPAN: 4,
|
|
363
368
|
CODE_SPAN_OPEN: 5
|
|
364
|
-
},
|
|
369
|
+
}, ft = /^(`{3,}|~{3,})(.*)$/, pt = (e) => e !== void 0 && e >= "0" && e <= "9", mt = (e, t) => {
|
|
365
370
|
let n = t;
|
|
366
371
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
367
372
|
else {
|
|
368
|
-
for (;
|
|
373
|
+
for (; pt(e[n]) && n - t < 9;) n += 1;
|
|
369
374
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
370
375
|
n += 1;
|
|
371
376
|
}
|
|
372
377
|
return e[n] === " " ? n + 1 : -1;
|
|
373
|
-
},
|
|
378
|
+
}, ht = (e, t, n) => {
|
|
374
379
|
let r = 0, i = t, a = !1, o = t;
|
|
375
380
|
for (;;) {
|
|
376
381
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -378,7 +383,7 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
378
383
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
379
384
|
continue;
|
|
380
385
|
}
|
|
381
|
-
let t = o < n ?
|
|
386
|
+
let t = o < n ? mt(e, o) : -1;
|
|
382
387
|
if (t === -1) return {
|
|
383
388
|
contentStart: o,
|
|
384
389
|
listIndent: a ? o - i : 0,
|
|
@@ -386,7 +391,7 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
386
391
|
};
|
|
387
392
|
o = t, a = !0;
|
|
388
393
|
}
|
|
389
|
-
},
|
|
394
|
+
}, j = (e, t, n, r) => {
|
|
390
395
|
let i = t;
|
|
391
396
|
for (let t = 0; t < r; t += 1) {
|
|
392
397
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -394,10 +399,10 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
394
399
|
i += 1, e[i] === " " && (i += 1);
|
|
395
400
|
}
|
|
396
401
|
return i;
|
|
397
|
-
},
|
|
402
|
+
}, gt = (e, t, n, r, i) => {
|
|
398
403
|
let a = t + r;
|
|
399
|
-
e.fill(
|
|
400
|
-
},
|
|
404
|
+
e.fill(A.FENCE_MARKER, a, a + i), e.fill(A.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
405
|
+
}, _t = (e, t, n, r) => {
|
|
401
406
|
let i = t;
|
|
402
407
|
for (; i < n && e[i] === " ";) i += 1;
|
|
403
408
|
let a = 0;
|
|
@@ -408,62 +413,62 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
408
413
|
i += 1;
|
|
409
414
|
}
|
|
410
415
|
return !0;
|
|
411
|
-
},
|
|
412
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
416
|
+
}, vt = (e, t, n, r) => {
|
|
417
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = ht(e, n, i), o = e.slice(a.contentStart, i).match(ft);
|
|
413
418
|
if (!o) return null;
|
|
414
419
|
let [, s, c] = o, l = s[0];
|
|
415
|
-
return l === "`" && c.includes("`") ? null : (
|
|
420
|
+
return l === "`" && c.includes("`") ? null : (gt(t, n, r, a.contentStart - n, s.length), {
|
|
416
421
|
char: l,
|
|
417
422
|
length: s.length,
|
|
418
423
|
listIndent: a.listIndent,
|
|
419
424
|
quoteDepth: a.quoteDepth
|
|
420
425
|
});
|
|
421
|
-
},
|
|
422
|
-
let i =
|
|
426
|
+
}, yt = (e, t, n, r) => {
|
|
427
|
+
let i = j(e, t, n, r.quoteDepth);
|
|
423
428
|
if (i === -1 || r.listIndent === 0) return i;
|
|
424
429
|
let a = i;
|
|
425
430
|
for (; a < n && e[a] === " ";) a += 1;
|
|
426
431
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
427
|
-
},
|
|
432
|
+
}, bt = (e, t) => {
|
|
428
433
|
let n = e.length, r = null, i = 0;
|
|
429
434
|
for (; i < n;) {
|
|
430
435
|
let a = e.indexOf("\n", i);
|
|
431
436
|
a === -1 && (a = n);
|
|
432
|
-
let o = r ?
|
|
433
|
-
r && o === -1 && (r = null), r ?
|
|
437
|
+
let o = r ? yt(e, i, a, r) : -1;
|
|
438
|
+
r && o === -1 && (r = null), r ? _t(e, o, a, r) ? (t.fill(A.FENCE_MARKER, i, a), r = null) : t.fill(A.FENCE_BODY, i, Math.min(a + 1, n)) : r = vt(e, t, i, a), i = a + 1;
|
|
434
439
|
}
|
|
435
440
|
return r;
|
|
436
|
-
},
|
|
441
|
+
}, xt = (e, t) => {
|
|
437
442
|
let n = t + 1;
|
|
438
443
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
439
444
|
return n;
|
|
440
|
-
},
|
|
445
|
+
}, St = (e, t) => {
|
|
441
446
|
let n = t + 1;
|
|
442
447
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
443
448
|
return n < e.length && e[n] === "\n";
|
|
444
|
-
},
|
|
449
|
+
}, Ct = (e, t, n) => {
|
|
445
450
|
let r = n;
|
|
446
451
|
for (;;) {
|
|
447
452
|
let n = e.indexOf("`", r);
|
|
448
453
|
if (n === -1) return -1;
|
|
449
|
-
let i = n > r && e[n - 1] === "\\" && t[n - 1] ===
|
|
450
|
-
if (t[n] ===
|
|
454
|
+
let i = n > r && e[n - 1] === "\\" && t[n - 1] === A.PROSE;
|
|
455
|
+
if (t[n] === A.PROSE && !i) return n;
|
|
451
456
|
r = n + 1;
|
|
452
457
|
}
|
|
453
|
-
},
|
|
458
|
+
}, wt = (e, t) => {
|
|
454
459
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
455
460
|
for (; a < n;) {
|
|
456
461
|
if (r < 0) {
|
|
457
|
-
if (a =
|
|
458
|
-
let n =
|
|
462
|
+
if (a = Ct(e, t, a), a === -1) break;
|
|
463
|
+
let n = xt(e, a);
|
|
459
464
|
r = a, i = n - a, a = n;
|
|
460
465
|
continue;
|
|
461
466
|
}
|
|
462
|
-
if (t[a] !==
|
|
463
|
-
t.fill(
|
|
467
|
+
if (t[a] !== A.PROSE) {
|
|
468
|
+
t.fill(A.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
464
469
|
continue;
|
|
465
470
|
}
|
|
466
|
-
if (e[a] === "\n" &&
|
|
471
|
+
if (e[a] === "\n" && St(e, a)) {
|
|
467
472
|
r = -1, a += 1;
|
|
468
473
|
continue;
|
|
469
474
|
}
|
|
@@ -471,79 +476,79 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
471
476
|
a += 1;
|
|
472
477
|
continue;
|
|
473
478
|
}
|
|
474
|
-
let n =
|
|
475
|
-
n - a === i && (t.fill(
|
|
479
|
+
let n = xt(e, a);
|
|
480
|
+
n - a === i && (t.fill(A.CODE_SPAN, r, n), r = -1), a = n;
|
|
476
481
|
}
|
|
477
|
-
return r >= 0 ? (t.fill(
|
|
482
|
+
return r >= 0 ? (t.fill(A.CODE_SPAN_OPEN, r, n), {
|
|
478
483
|
start: r,
|
|
479
484
|
runLength: i
|
|
480
485
|
}) : null;
|
|
481
|
-
},
|
|
486
|
+
}, Tt = (e) => {
|
|
482
487
|
let t = new Uint8Array(e.length);
|
|
483
488
|
return {
|
|
484
489
|
text: e,
|
|
485
490
|
regions: t,
|
|
486
|
-
openFence:
|
|
487
|
-
openSpan:
|
|
491
|
+
openFence: bt(e, t),
|
|
492
|
+
openSpan: wt(e, t),
|
|
488
493
|
mathMask: null,
|
|
489
494
|
linkUrlMask: null,
|
|
490
495
|
htmlTagMask: null
|
|
491
496
|
};
|
|
492
|
-
},
|
|
493
|
-
if (
|
|
494
|
-
let t =
|
|
495
|
-
return
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
},
|
|
497
|
+
}, M = null, Et = null, N = (e) => {
|
|
498
|
+
if (Et !== null && e === M) return Et;
|
|
499
|
+
let t = Tt(e);
|
|
500
|
+
return M = e, Et = t, t;
|
|
501
|
+
}, Dt = () => {
|
|
502
|
+
M = null, Et = null;
|
|
503
|
+
}, Ot = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== A.PROSE, kt = (e, t) => e.regions[t] === A.CODE_SPAN, At = (e, t) => {
|
|
499
504
|
let n = N(e), r = t + t, i = 0;
|
|
500
|
-
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] ===
|
|
505
|
+
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === A.PROSE ? (i += 1, t += 2) : t += 1;
|
|
501
506
|
return i;
|
|
502
|
-
},
|
|
507
|
+
}, jt = /* @__PURE__ */ new Uint8Array(), Mt = (e) => e === "inlineLatex" || e === "blockLatex", Nt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Pt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Ft = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), It = (e, t, n) => {
|
|
503
508
|
let r = e[t + 1];
|
|
504
509
|
if (e[t] === "\\") {
|
|
505
510
|
if (r === "$") return {
|
|
506
511
|
context: n,
|
|
507
512
|
length: 2
|
|
508
513
|
};
|
|
509
|
-
let e =
|
|
514
|
+
let e = Nt(n, r);
|
|
510
515
|
return e === null ? null : {
|
|
511
516
|
context: e,
|
|
512
517
|
length: 2
|
|
513
518
|
};
|
|
514
519
|
}
|
|
515
|
-
if (e[t] === "$" && !
|
|
520
|
+
if (e[t] === "$" && !Mt(n)) {
|
|
516
521
|
let e = r === "$";
|
|
517
522
|
return {
|
|
518
|
-
context:
|
|
523
|
+
context: Pt(n, e),
|
|
519
524
|
length: e ? 2 : 1
|
|
520
525
|
};
|
|
521
526
|
}
|
|
522
527
|
return null;
|
|
523
|
-
},
|
|
528
|
+
}, Lt = (e) => {
|
|
524
529
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
525
530
|
for (; o < r;) {
|
|
526
531
|
i[o] = a === "none" ? 0 : 1;
|
|
527
|
-
let e = n[o] ===
|
|
532
|
+
let e = n[o] === A.PROSE ? It(t, o, a) : null;
|
|
528
533
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
529
534
|
}
|
|
530
535
|
return i;
|
|
531
|
-
},
|
|
536
|
+
}, Rt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Ft(e.text) ? Lt(e) : jt), e.mathMask[t] === 1), zt = (e, t, n, r) => {
|
|
532
537
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
533
|
-
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] ===
|
|
538
|
+
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === A.PROSE && (s = 1), o[e - t] = s;
|
|
534
539
|
let c = !1;
|
|
535
|
-
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] ===
|
|
536
|
-
},
|
|
540
|
+
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === A.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
541
|
+
}, Bt = (e) => {
|
|
537
542
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
538
543
|
for (; i < n;) {
|
|
539
544
|
let a = t.indexOf("\n", i);
|
|
540
|
-
a === -1 && (a = n),
|
|
545
|
+
a === -1 && (a = n), zt(e, i, a, r), i = a + 1;
|
|
541
546
|
}
|
|
542
547
|
return r;
|
|
543
|
-
},
|
|
548
|
+
}, Vt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Bt(e) : jt), e.linkUrlMask[t] === 1), Ht = (e) => {
|
|
544
549
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
545
550
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
546
|
-
else if (i[e] = +!!a, n[e] ===
|
|
551
|
+
else if (i[e] = +!!a, n[e] === A.PROSE) {
|
|
547
552
|
if (t[e] === ">") a = !1;
|
|
548
553
|
else if (t[e] === "<") {
|
|
549
554
|
let n = t[e + 1];
|
|
@@ -551,56 +556,56 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
551
556
|
}
|
|
552
557
|
}
|
|
553
558
|
return i;
|
|
554
|
-
},
|
|
559
|
+
}, Ut = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Ht(e) : jt), e.htmlTagMask[t] === 1), P = (e, t) => Ot(N(e), t), F = (e, t) => kt(N(e), t), Wt = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, I = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Wt, (t, n, r, i) => P(e, i) ? t : `${n}\\>${r}`), Gt = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
555
560
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
556
561
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
557
|
-
},
|
|
562
|
+
}, Kt = {
|
|
558
563
|
delimiter: "*",
|
|
559
564
|
markerLength: 2,
|
|
560
565
|
regex: /(\*\*)([^*]*\*?)$/
|
|
561
|
-
},
|
|
566
|
+
}, qt = {
|
|
562
567
|
delimiter: "_",
|
|
563
568
|
markerLength: 2,
|
|
564
569
|
regex: /(__)([^_]*?)$/
|
|
565
|
-
},
|
|
570
|
+
}, Jt = {
|
|
566
571
|
delimiter: "*",
|
|
567
572
|
markerLength: 3,
|
|
568
573
|
regex: /(\*\*\*)([^*]*?)$/
|
|
569
|
-
},
|
|
574
|
+
}, Yt = {
|
|
570
575
|
delimiter: "*",
|
|
571
576
|
markerLength: 1,
|
|
572
577
|
regex: /(\*)([^*]*?)$/
|
|
573
|
-
},
|
|
578
|
+
}, Xt = {
|
|
574
579
|
delimiter: "_",
|
|
575
580
|
markerLength: 1,
|
|
576
581
|
regex: /(_)([^_]*?)$/
|
|
577
|
-
},
|
|
582
|
+
}, Zt = {
|
|
578
583
|
delimiter: "~",
|
|
579
584
|
markerLength: 2,
|
|
580
585
|
regex: /(~~)([^~]*?)$/
|
|
581
|
-
},
|
|
586
|
+
}, Qt = {
|
|
582
587
|
delimiter: "_",
|
|
583
588
|
markerLength: 2,
|
|
584
589
|
regex: /(__)([^_]+)_$/
|
|
585
|
-
},
|
|
590
|
+
}, $t = {
|
|
586
591
|
delimiter: "~",
|
|
587
592
|
markerLength: 2,
|
|
588
593
|
regex: /(~~)([^~]+)~$/
|
|
589
|
-
},
|
|
594
|
+
}, en = /^[\s_~*`]*$/, tn = /^[\s]*[-*+][\s]+$/, nn = /[\p{L}\p{N}_]/u, rn = /^\*{4,}$/, L = (e) => {
|
|
590
595
|
if (!e) return !1;
|
|
591
596
|
let t = e.charCodeAt(0);
|
|
592
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
593
|
-
},
|
|
597
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || nn.test(e);
|
|
598
|
+
}, an = (e, t) => {
|
|
594
599
|
let n = 1;
|
|
595
600
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
596
601
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
597
602
|
return -1;
|
|
598
|
-
},
|
|
603
|
+
}, on = (e, t) => {
|
|
599
604
|
let n = 1;
|
|
600
605
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
601
606
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
602
607
|
return -1;
|
|
603
|
-
},
|
|
608
|
+
}, sn = (e, t) => Rt(N(e), t), cn = (e, t, n) => {
|
|
604
609
|
let r = 0;
|
|
605
610
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
606
611
|
r = n + 1;
|
|
@@ -618,184 +623,184 @@ var tt = Object.defineProperty, nt = Object.defineProperties, rt = Object.getOwn
|
|
|
618
623
|
break;
|
|
619
624
|
}
|
|
620
625
|
return o >= 3 && !s;
|
|
621
|
-
},
|
|
622
|
-
let i =
|
|
626
|
+
}, ln = (e, t, n, r) => n === "\\" || Rt(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"), un = (e) => e === " " || e === " " || e === "\n", dn = (e, t) => !!(e && t && L(e) && L(t)), fn = (e, t, n, r) => {
|
|
627
|
+
let i = dn(e, t), a = !!t && !un(t), o = !!e && !un(e);
|
|
623
628
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
624
629
|
count: !0,
|
|
625
630
|
inWordAsteriskChain: i
|
|
626
631
|
} : { count: !1 };
|
|
627
|
-
},
|
|
632
|
+
}, pn = (e) => {
|
|
628
633
|
let t = N(e), n = 0, r = !1, i = e.length;
|
|
629
634
|
for (let a = 0; a < i; a += 1) {
|
|
630
|
-
if (e[a] !== "*" || t.regions[a] !==
|
|
635
|
+
if (e[a] !== "*" || t.regions[a] !== A.PROSE) {
|
|
631
636
|
L(e[a]) || (r = !1);
|
|
632
637
|
continue;
|
|
633
638
|
}
|
|
634
639
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
635
|
-
if (
|
|
636
|
-
let c =
|
|
640
|
+
if (ln(t, a, o, s)) continue;
|
|
641
|
+
let c = fn(o, s, n, r);
|
|
637
642
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
638
643
|
}
|
|
639
644
|
return n;
|
|
640
|
-
},
|
|
645
|
+
}, mn = (e, t, n, r) => !!(n === "\\" || Rt(e, t) || Vt(e, t) || Ut(e, t) || n === "_" || r === "_" || n && r && L(n) && L(r)), hn = (e) => {
|
|
641
646
|
let t = N(e), n = 0, r = e.length;
|
|
642
647
|
for (let i = 0; i < r; i += 1) {
|
|
643
|
-
if (e[i] !== "_" || t.regions[i] !==
|
|
648
|
+
if (e[i] !== "_" || t.regions[i] !== A.PROSE) continue;
|
|
644
649
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
645
|
-
|
|
650
|
+
mn(t, i, a, o) || (n += 1);
|
|
646
651
|
}
|
|
647
652
|
return n;
|
|
648
|
-
},
|
|
653
|
+
}, gn = (e) => {
|
|
649
654
|
let t = N(e), n = 0, r = 0;
|
|
650
|
-
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] ===
|
|
655
|
+
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === A.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
651
656
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
652
|
-
},
|
|
653
|
-
if (!(
|
|
657
|
+
}, _n = (e) => At(e, "*"), vn = (e) => e === "" || e === " " || e === " " || e === "\n", yn = (e, t, n, r, i) => {
|
|
658
|
+
if (!(vn(n) && vn(r))) return !1;
|
|
654
659
|
if (t > i.lineEnd) {
|
|
655
660
|
let n = e.indexOf("\n", t);
|
|
656
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
661
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = cn(e, t, "_");
|
|
657
662
|
}
|
|
658
663
|
return i.result;
|
|
659
|
-
},
|
|
664
|
+
}, bn = (e, t, n, r) => {
|
|
660
665
|
let i = e.text, a = t, o = !1;
|
|
661
666
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
662
667
|
let s = n - a;
|
|
663
668
|
if (s < 2) return !1;
|
|
664
669
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
665
|
-
return L(l) && L(u) ||
|
|
666
|
-
},
|
|
670
|
+
return L(l) && L(u) || yn(i, a, l, u, r) || Rt(e, a) || Vt(e, a) || Ut(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
671
|
+
}, xn = (e) => {
|
|
667
672
|
let t = N(e), n = e.length, r = {
|
|
668
673
|
lineEnd: -1,
|
|
669
674
|
result: !1
|
|
670
675
|
}, i = !1, a = 0;
|
|
671
676
|
for (; a < n;) {
|
|
672
|
-
if (e[a] !== "_" || t.regions[a] !==
|
|
677
|
+
if (e[a] !== "_" || t.regions[a] !== A.PROSE) {
|
|
673
678
|
a += 1;
|
|
674
679
|
continue;
|
|
675
680
|
}
|
|
676
681
|
let o = a, s = a + 1;
|
|
677
|
-
for (; s < n && e[s] === "_" && t.regions[s] ===
|
|
678
|
-
a = s,
|
|
682
|
+
for (; s < n && e[s] === "_" && t.regions[s] === A.PROSE;) s += 1;
|
|
683
|
+
a = s, bn(t, o, s, r) && (i = !i);
|
|
679
684
|
}
|
|
680
685
|
return i;
|
|
681
|
-
},
|
|
682
|
-
if (!t ||
|
|
686
|
+
}, Sn = (e, t, n) => {
|
|
687
|
+
if (!t || en.test(t)) return !0;
|
|
683
688
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
684
|
-
return
|
|
685
|
-
},
|
|
686
|
-
let t =
|
|
689
|
+
return tn.test(a) && t.includes("\n") ? !0 : cn(e, n, "*");
|
|
690
|
+
}, Cn = (e) => {
|
|
691
|
+
let t = Gt(e, Kt);
|
|
687
692
|
if (!t) return e;
|
|
688
693
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
689
|
-
return P(e, r) ||
|
|
690
|
-
},
|
|
691
|
-
if (!t ||
|
|
694
|
+
return P(e, r) || F(e, r) || Sn(e, n, r) ? e : _n(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
695
|
+
}, wn = (e, t, n) => {
|
|
696
|
+
if (!t || en.test(t)) return !0;
|
|
692
697
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
693
|
-
return
|
|
694
|
-
},
|
|
695
|
-
let t =
|
|
698
|
+
return tn.test(a) && t.includes("\n") ? !0 : cn(e, n, "_");
|
|
699
|
+
}, Tn = (e) => {
|
|
700
|
+
let t = Gt(e, qt);
|
|
696
701
|
if (!t) {
|
|
697
|
-
let t =
|
|
702
|
+
let t = Gt(e, Qt);
|
|
698
703
|
if (t) {
|
|
699
704
|
let n = e.lastIndexOf(t[1]);
|
|
700
|
-
if (!(P(e, n) ||
|
|
705
|
+
if (!(P(e, n) || F(e, n)) && xn(e)) return `${e}_`;
|
|
701
706
|
}
|
|
702
707
|
return e;
|
|
703
708
|
}
|
|
704
709
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
705
|
-
return P(e, r) ||
|
|
706
|
-
},
|
|
710
|
+
return P(e, r) || F(e, r) || wn(e, n, r) ? e : xn(e) ? `${e}__` : e;
|
|
711
|
+
}, En = (e, t) => {
|
|
707
712
|
let { text: n } = e;
|
|
708
|
-
return n[t] === "*" && e.regions[t] ===
|
|
709
|
-
},
|
|
713
|
+
return n[t] === "*" && e.regions[t] === A.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Rt(e, t);
|
|
714
|
+
}, Dn = (e) => {
|
|
710
715
|
let t = N(e);
|
|
711
716
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
712
|
-
if (!
|
|
713
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
717
|
+
if (!En(t, n)) continue;
|
|
718
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || un(r), o = !i || un(i);
|
|
714
719
|
if (!(a && o) && !(r && i && L(r) && L(i)) && !o) return n;
|
|
715
720
|
}
|
|
716
721
|
return -1;
|
|
717
|
-
},
|
|
718
|
-
if (!
|
|
719
|
-
let t =
|
|
720
|
-
if (t === -1 || P(e, t) ||
|
|
722
|
+
}, On = (e) => {
|
|
723
|
+
if (!Gt(e, Yt)) return e;
|
|
724
|
+
let t = Dn(e);
|
|
725
|
+
if (t === -1 || P(e, t) || F(e, t)) return e;
|
|
721
726
|
let n = e.substring(t + 1);
|
|
722
|
-
return !n ||
|
|
723
|
-
},
|
|
727
|
+
return !n || en.test(n) ? e : pn(e) % 2 == 1 ? `${e}*` : e;
|
|
728
|
+
}, kn = (e) => {
|
|
724
729
|
let t = N(e);
|
|
725
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] ===
|
|
730
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === A.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Rt(t, n) && !Vt(t, n)) {
|
|
726
731
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
727
732
|
if (t && r && L(t) && L(r)) continue;
|
|
728
733
|
return n;
|
|
729
734
|
}
|
|
730
735
|
return -1;
|
|
731
|
-
},
|
|
736
|
+
}, An = (e) => {
|
|
732
737
|
let t = e.length;
|
|
733
738
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
734
739
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
735
|
-
},
|
|
740
|
+
}, jn = (e) => {
|
|
736
741
|
if (!e.endsWith("**")) return null;
|
|
737
742
|
let t = e.slice(0, -2);
|
|
738
|
-
if (
|
|
739
|
-
let n = t.indexOf("**"), r =
|
|
743
|
+
if (_n(t) % 2 != 1) return null;
|
|
744
|
+
let n = t.indexOf("**"), r = kn(t);
|
|
740
745
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
741
|
-
},
|
|
742
|
-
if (!
|
|
743
|
-
let t =
|
|
746
|
+
}, Mn = (e) => {
|
|
747
|
+
if (!Gt(e, Xt)) return e;
|
|
748
|
+
let t = kn(e);
|
|
744
749
|
if (t === -1) return e;
|
|
745
750
|
let n = e.substring(t + 1);
|
|
746
|
-
if (!n ||
|
|
747
|
-
if (
|
|
748
|
-
let t =
|
|
749
|
-
return t === null ?
|
|
751
|
+
if (!n || en.test(n) || P(e, t) || F(e, t)) return e;
|
|
752
|
+
if (hn(e) % 2 == 1) {
|
|
753
|
+
let t = jn(e);
|
|
754
|
+
return t === null ? An(e) : t;
|
|
750
755
|
}
|
|
751
756
|
return e;
|
|
752
|
-
},
|
|
753
|
-
let t =
|
|
757
|
+
}, Nn = (e) => {
|
|
758
|
+
let t = _n(e), n = pn(e);
|
|
754
759
|
return t % 2 == 0 && n % 2 == 0;
|
|
755
|
-
},
|
|
756
|
-
if (
|
|
757
|
-
let t =
|
|
760
|
+
}, Pn = (e, t, n) => !t || en.test(t) || P(e, n) || F(e, n) ? !0 : cn(e, n, "*"), Fn = (e) => {
|
|
761
|
+
if (rn.test(e)) return e;
|
|
762
|
+
let t = Gt(e, Jt);
|
|
758
763
|
if (!t) return e;
|
|
759
764
|
let n = t[2];
|
|
760
|
-
return
|
|
761
|
-
},
|
|
765
|
+
return Pn(e, n, e.lastIndexOf(t[1])) ? e : gn(e) % 2 == 1 ? Nn(e) ? e : `${e}***` : e;
|
|
766
|
+
}, In = /<[a-zA-Z/][^>]*$/, Ln = /[a-zA-Z/]/, Rn = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), zn = (e, t) => {
|
|
762
767
|
let n = e[t + 1];
|
|
763
|
-
return n !== void 0 &&
|
|
764
|
-
},
|
|
765
|
-
let t = e.match(
|
|
768
|
+
return n !== void 0 && Ln.test(n);
|
|
769
|
+
}, Bn = (e) => {
|
|
770
|
+
let t = e.match(In);
|
|
766
771
|
if (!t || t.index === void 0) return e;
|
|
767
|
-
let n =
|
|
768
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
772
|
+
let n = Rn(e);
|
|
773
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && zn(e, r) && !P(e, r) && !(n && sn(e, r))) return e.substring(0, r).trimEnd();
|
|
769
774
|
return e;
|
|
770
|
-
},
|
|
775
|
+
}, Vn = (e) => {
|
|
771
776
|
let t = N(e);
|
|
772
777
|
if (t.openFence) return e;
|
|
773
778
|
let n = t.openSpan;
|
|
774
779
|
if (!n) return e;
|
|
775
780
|
let r = e.slice(n.start + n.runLength);
|
|
776
|
-
if (!r ||
|
|
781
|
+
if (!r || en.test(r)) return e;
|
|
777
782
|
let i = 0, a = e.length - 1;
|
|
778
783
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
779
784
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
780
|
-
},
|
|
785
|
+
}, Hn = (e) => At(e, "$"), Un = (e) => {
|
|
781
786
|
let t = N(e), n = 0;
|
|
782
|
-
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] ===
|
|
787
|
+
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === A.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
783
788
|
return n;
|
|
784
|
-
},
|
|
789
|
+
}, Wn = (e) => {
|
|
785
790
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
786
791
|
let t = e.indexOf("$$");
|
|
787
792
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
788
793
|
$$` : `${e}$$`;
|
|
789
|
-
},
|
|
794
|
+
}, Gn = (e) => Hn(e) % 2 == 0 ? e : Wn(e), Kn = (e) => Un(e) % 2 == 1 ? `${e}$` : e, qn = "streamdown:incomplete-image", Jn = (e, t, n) => {
|
|
790
795
|
if (e.substring(t + 2).includes(")")) return null;
|
|
791
|
-
let r =
|
|
796
|
+
let r = an(e, t);
|
|
792
797
|
if (r === -1 || P(e, r)) return null;
|
|
793
798
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
794
|
-
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
800
|
+
}, Yn = (e, t) => {
|
|
796
801
|
for (let n = 0; n < t; n++) if (e[n] === "[" && !P(e, n)) {
|
|
797
802
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
798
|
-
let t =
|
|
803
|
+
let t = on(e, n);
|
|
799
804
|
if (t === -1) return n;
|
|
800
805
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
801
806
|
let r = e.indexOf(")", t + 2);
|
|
@@ -803,69 +808,69 @@ $$` : `${e}$$`;
|
|
|
803
808
|
}
|
|
804
809
|
}
|
|
805
810
|
return t;
|
|
806
|
-
},
|
|
811
|
+
}, Xn = (e, t, n) => {
|
|
807
812
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
808
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
813
|
+
if (!e.substring(t + 1).includes("]") || on(e, t) === -1) {
|
|
809
814
|
let a = e.substring(0, i);
|
|
810
|
-
if (r) return `${a} return `${a}`;
|
|
811
816
|
if (n === "text-only") {
|
|
812
|
-
let n =
|
|
817
|
+
let n = Yn(e, t);
|
|
813
818
|
return e.substring(0, n) + e.substring(n + 1);
|
|
814
819
|
}
|
|
815
820
|
return `${e}](streamdown:incomplete-link)`;
|
|
816
821
|
}
|
|
817
822
|
return null;
|
|
818
|
-
},
|
|
823
|
+
}, Zn = (e, t) => {
|
|
819
824
|
let n = e.lastIndexOf("](");
|
|
820
825
|
if (n !== -1 && !P(e, n)) {
|
|
821
|
-
let r =
|
|
826
|
+
let r = Jn(e, n, t);
|
|
822
827
|
if (r !== null) return r;
|
|
823
828
|
}
|
|
824
829
|
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!P(e, n)) {
|
|
825
|
-
let r =
|
|
830
|
+
let r = Xn(e, n, t);
|
|
826
831
|
if (r !== null) return r;
|
|
827
832
|
}
|
|
828
833
|
return e;
|
|
829
|
-
},
|
|
834
|
+
}, Qn = 32, $n = (e, t = "protocol") => {
|
|
830
835
|
let n = e;
|
|
831
|
-
for (let e = 0; e <
|
|
832
|
-
let e =
|
|
836
|
+
for (let e = 0; e < Qn; e += 1) {
|
|
837
|
+
let e = Zn(n, t);
|
|
833
838
|
if (e.length >= n.length) return e;
|
|
834
839
|
n = e;
|
|
835
840
|
}
|
|
836
841
|
return n;
|
|
837
|
-
},
|
|
842
|
+
}, er = /^-{1,2}$/, tr = /^[\s]*-{1,2}[\s]+$/, nr = /^={1,2}$/, rr = /^[\s]*={1,2}[\s]+$/, ir = (e) => {
|
|
838
843
|
if (!e || typeof e != "string") return e;
|
|
839
844
|
let t = e.lastIndexOf("\n");
|
|
840
845
|
if (t === -1) return e;
|
|
841
846
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
842
|
-
if (
|
|
847
|
+
if (er.test(i) && !n.match(tr)) {
|
|
843
848
|
let t = r.split("\n").at(-1);
|
|
844
849
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
845
850
|
}
|
|
846
|
-
if (
|
|
851
|
+
if (nr.test(i) && !n.match(rr)) {
|
|
847
852
|
let t = r.split("\n").at(-1);
|
|
848
853
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
849
854
|
}
|
|
850
855
|
return e;
|
|
851
|
-
},
|
|
852
|
-
let t =
|
|
856
|
+
}, ar = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, or = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(ar, (t, n, r) => P(e, r + n.length) ? t : `${n}\\~`), sr = (e) => At(e, "~"), cr = (e) => {
|
|
857
|
+
let t = Gt(e, Zt);
|
|
853
858
|
if (t) {
|
|
854
859
|
let n = t[2];
|
|
855
|
-
if (!n ||
|
|
860
|
+
if (!n || en.test(n)) return e;
|
|
856
861
|
let r = e.lastIndexOf(t[1]);
|
|
857
|
-
if (P(e, r) ||
|
|
858
|
-
if (
|
|
862
|
+
if (P(e, r) || F(e, r)) return e;
|
|
863
|
+
if (sr(e) % 2 == 1) return `${e}~~`;
|
|
859
864
|
} else {
|
|
860
|
-
let t =
|
|
865
|
+
let t = Gt(e, $t);
|
|
861
866
|
if (t) {
|
|
862
867
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
863
|
-
if (P(e, n) ||
|
|
864
|
-
if (
|
|
868
|
+
if (P(e, n) || F(e, n)) return e;
|
|
869
|
+
if (sr(e) % 2 == 1) return `${e}~`;
|
|
865
870
|
}
|
|
866
871
|
}
|
|
867
872
|
return e;
|
|
868
|
-
},
|
|
873
|
+
}, lr = (e) => e !== !1, ur = (e) => e === !0, R = {
|
|
869
874
|
SINGLE_TILDE: 0,
|
|
870
875
|
COMPARISON_OPERATORS: 5,
|
|
871
876
|
HTML_TAGS: 10,
|
|
@@ -881,11 +886,11 @@ $$` : `${e}$$`;
|
|
|
881
886
|
KATEX: 70,
|
|
882
887
|
INLINE_KATEX: 75,
|
|
883
888
|
DEFAULT: 100
|
|
884
|
-
},
|
|
889
|
+
}, dr = [
|
|
885
890
|
{
|
|
886
891
|
handler: {
|
|
887
892
|
name: "singleTilde",
|
|
888
|
-
handle:
|
|
893
|
+
handle: or,
|
|
889
894
|
priority: R.SINGLE_TILDE
|
|
890
895
|
},
|
|
891
896
|
optionKey: "singleTilde"
|
|
@@ -893,7 +898,7 @@ $$` : `${e}$$`;
|
|
|
893
898
|
{
|
|
894
899
|
handler: {
|
|
895
900
|
name: "comparisonOperators",
|
|
896
|
-
handle:
|
|
901
|
+
handle: I,
|
|
897
902
|
priority: R.COMPARISON_OPERATORS
|
|
898
903
|
},
|
|
899
904
|
optionKey: "comparisonOperators"
|
|
@@ -901,7 +906,7 @@ $$` : `${e}$$`;
|
|
|
901
906
|
{
|
|
902
907
|
handler: {
|
|
903
908
|
name: "htmlTags",
|
|
904
|
-
handle:
|
|
909
|
+
handle: Bn,
|
|
905
910
|
priority: R.HTML_TAGS
|
|
906
911
|
},
|
|
907
912
|
optionKey: "htmlTags"
|
|
@@ -909,7 +914,7 @@ $$` : `${e}$$`;
|
|
|
909
914
|
{
|
|
910
915
|
handler: {
|
|
911
916
|
name: "setextHeadings",
|
|
912
|
-
handle:
|
|
917
|
+
handle: ir,
|
|
913
918
|
priority: R.SETEXT_HEADINGS
|
|
914
919
|
},
|
|
915
920
|
optionKey: "setextHeadings"
|
|
@@ -917,7 +922,7 @@ $$` : `${e}$$`;
|
|
|
917
922
|
{
|
|
918
923
|
handler: {
|
|
919
924
|
name: "links",
|
|
920
|
-
handle:
|
|
925
|
+
handle: $n,
|
|
921
926
|
priority: R.LINKS
|
|
922
927
|
},
|
|
923
928
|
optionKey: "links",
|
|
@@ -926,7 +931,7 @@ $$` : `${e}$$`;
|
|
|
926
931
|
{
|
|
927
932
|
handler: {
|
|
928
933
|
name: "boldItalic",
|
|
929
|
-
handle:
|
|
934
|
+
handle: Fn,
|
|
930
935
|
priority: R.BOLD_ITALIC
|
|
931
936
|
},
|
|
932
937
|
optionKey: "boldItalic"
|
|
@@ -934,7 +939,7 @@ $$` : `${e}$$`;
|
|
|
934
939
|
{
|
|
935
940
|
handler: {
|
|
936
941
|
name: "bold",
|
|
937
|
-
handle:
|
|
942
|
+
handle: Cn,
|
|
938
943
|
priority: R.BOLD
|
|
939
944
|
},
|
|
940
945
|
optionKey: "bold"
|
|
@@ -942,7 +947,7 @@ $$` : `${e}$$`;
|
|
|
942
947
|
{
|
|
943
948
|
handler: {
|
|
944
949
|
name: "italicDoubleUnderscore",
|
|
945
|
-
handle:
|
|
950
|
+
handle: Tn,
|
|
946
951
|
priority: R.ITALIC_DOUBLE_UNDERSCORE
|
|
947
952
|
},
|
|
948
953
|
optionKey: "italic"
|
|
@@ -950,7 +955,7 @@ $$` : `${e}$$`;
|
|
|
950
955
|
{
|
|
951
956
|
handler: {
|
|
952
957
|
name: "italicSingleAsterisk",
|
|
953
|
-
handle:
|
|
958
|
+
handle: On,
|
|
954
959
|
priority: R.ITALIC_SINGLE_ASTERISK
|
|
955
960
|
},
|
|
956
961
|
optionKey: "italic"
|
|
@@ -958,7 +963,7 @@ $$` : `${e}$$`;
|
|
|
958
963
|
{
|
|
959
964
|
handler: {
|
|
960
965
|
name: "italicSingleUnderscore",
|
|
961
|
-
handle:
|
|
966
|
+
handle: Mn,
|
|
962
967
|
priority: R.ITALIC_SINGLE_UNDERSCORE
|
|
963
968
|
},
|
|
964
969
|
optionKey: "italic"
|
|
@@ -966,7 +971,7 @@ $$` : `${e}$$`;
|
|
|
966
971
|
{
|
|
967
972
|
handler: {
|
|
968
973
|
name: "inlineCode",
|
|
969
|
-
handle:
|
|
974
|
+
handle: Vn,
|
|
970
975
|
priority: R.INLINE_CODE
|
|
971
976
|
},
|
|
972
977
|
optionKey: "inlineCode"
|
|
@@ -974,7 +979,7 @@ $$` : `${e}$$`;
|
|
|
974
979
|
{
|
|
975
980
|
handler: {
|
|
976
981
|
name: "strikethrough",
|
|
977
|
-
handle:
|
|
982
|
+
handle: cr,
|
|
978
983
|
priority: R.STRIKETHROUGH
|
|
979
984
|
},
|
|
980
985
|
optionKey: "strikethrough"
|
|
@@ -982,7 +987,7 @@ $$` : `${e}$$`;
|
|
|
982
987
|
{
|
|
983
988
|
handler: {
|
|
984
989
|
name: "katex",
|
|
985
|
-
handle:
|
|
990
|
+
handle: Gn,
|
|
986
991
|
priority: R.KATEX
|
|
987
992
|
},
|
|
988
993
|
optionKey: "katex"
|
|
@@ -990,36 +995,36 @@ $$` : `${e}$$`;
|
|
|
990
995
|
{
|
|
991
996
|
handler: {
|
|
992
997
|
name: "inlineKatex",
|
|
993
|
-
handle:
|
|
998
|
+
handle: Kn,
|
|
994
999
|
priority: R.INLINE_KATEX
|
|
995
1000
|
},
|
|
996
1001
|
optionKey: "inlineKatex"
|
|
997
1002
|
}
|
|
998
|
-
],
|
|
1003
|
+
], fr = (e) => {
|
|
999
1004
|
let t = e?.linkMode ?? "protocol";
|
|
1000
|
-
return
|
|
1001
|
-
handler:
|
|
1005
|
+
return dr.filter(({ handler: t, optionKey: n }) => t.name === "links" ? lr(e?.links) || lr(e?.images) : t.name === "inlineKatex" ? ur(e?.inlineKatex) : lr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
1006
|
+
handler: dt(ut({}, e), { handle: (e) => $n(e, t) }),
|
|
1002
1007
|
earlyReturn: t === "protocol" ? n : void 0
|
|
1003
1008
|
} : {
|
|
1004
1009
|
handler: e,
|
|
1005
1010
|
earlyReturn: n
|
|
1006
1011
|
});
|
|
1007
|
-
},
|
|
1012
|
+
}, pr = (e, t) => {
|
|
1008
1013
|
if (!e || typeof e != "string") return e;
|
|
1009
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
1010
|
-
handler:
|
|
1014
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = fr(t), i = (t?.handlers ?? []).map((e) => ({
|
|
1015
|
+
handler: dt(ut({}, e), { priority: e.priority ?? R.DEFAULT }),
|
|
1011
1016
|
earlyReturn: void 0
|
|
1012
1017
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
1013
1018
|
try {
|
|
1014
1019
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
1015
1020
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
1016
1021
|
} finally {
|
|
1017
|
-
|
|
1022
|
+
Dt();
|
|
1018
1023
|
}
|
|
1019
1024
|
};
|
|
1020
1025
|
//#endregion
|
|
1021
1026
|
//#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
|
|
1022
|
-
function
|
|
1027
|
+
function mr() {
|
|
1023
1028
|
return {
|
|
1024
1029
|
async: !1,
|
|
1025
1030
|
breaks: !1,
|
|
@@ -1033,12 +1038,12 @@ function fr() {
|
|
|
1033
1038
|
walkTokens: null
|
|
1034
1039
|
};
|
|
1035
1040
|
}
|
|
1036
|
-
var
|
|
1037
|
-
function mr(e) {
|
|
1038
|
-
pr = e;
|
|
1039
|
-
}
|
|
1040
|
-
var hr = { exec: () => null };
|
|
1041
|
+
var hr = mr();
|
|
1041
1042
|
function gr(e) {
|
|
1043
|
+
hr = e;
|
|
1044
|
+
}
|
|
1045
|
+
var _r = { exec: () => null };
|
|
1046
|
+
function vr(e) {
|
|
1042
1047
|
let t = [];
|
|
1043
1048
|
return (n) => {
|
|
1044
1049
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -1055,7 +1060,7 @@ function z(e, t = "") {
|
|
|
1055
1060
|
};
|
|
1056
1061
|
return r;
|
|
1057
1062
|
}
|
|
1058
|
-
var
|
|
1063
|
+
var yr = ((e = "") => {
|
|
1059
1064
|
try {
|
|
1060
1065
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
1061
1066
|
} catch {
|
|
@@ -1116,113 +1121,113 @@ var _r = ((e = "") => {
|
|
|
1116
1121
|
notSpaceStart: /^\S*/,
|
|
1117
1122
|
endingNewline: /\n$/,
|
|
1118
1123
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1119
|
-
nextBulletRegex:
|
|
1120
|
-
hrRegex:
|
|
1121
|
-
fencesBeginRegex:
|
|
1122
|
-
headingBeginRegex:
|
|
1123
|
-
htmlBeginRegex:
|
|
1124
|
-
blockquoteBeginRegex:
|
|
1125
|
-
},
|
|
1126
|
-
blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
1127
|
-
code:
|
|
1128
|
-
def:
|
|
1129
|
-
fences:
|
|
1130
|
-
heading:
|
|
1131
|
-
hr:
|
|
1132
|
-
html:
|
|
1133
|
-
lheading:
|
|
1134
|
-
list:
|
|
1135
|
-
newline:
|
|
1136
|
-
paragraph:
|
|
1137
|
-
table:
|
|
1138
|
-
text:
|
|
1139
|
-
},
|
|
1140
|
-
...
|
|
1141
|
-
lheading:
|
|
1142
|
-
table:
|
|
1143
|
-
paragraph: z(
|
|
1144
|
-
},
|
|
1145
|
-
...
|
|
1146
|
-
html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
1124
|
+
nextBulletRegex: vr((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
1125
|
+
hrRegex: vr((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
1126
|
+
fencesBeginRegex: vr((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
1127
|
+
headingBeginRegex: vr((e) => RegExp(`^ {0,${e}}#`)),
|
|
1128
|
+
htmlBeginRegex: vr((e) => RegExp(`^ {0,${e}}(?:</?(?:${Pr})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
|
|
1129
|
+
blockquoteBeginRegex: vr((e) => RegExp(`^ {0,${e}}>`))
|
|
1130
|
+
}, br = /^(?:[ \t]*(?:\n|$))+/, xr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Sr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Cr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, wr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Tr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Er = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Dr = z(Er).replace(/bull/g, Tr).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(), Or = z(Er).replace(/bull/g, Tr).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(), kr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Ar = /^[^\n]+/, jr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Mr = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", jr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Nr = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Tr).getRegex(), Pr = "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", Fr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ir = 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)(?: +|\\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", Fr).replace("tag", Pr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Lr = (e) => z(kr).replace("hr", Cr).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", Pr).getRegex(), Rr = Lr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), zr = Lr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Br = {
|
|
1131
|
+
blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", zr).getRegex(),
|
|
1132
|
+
code: xr,
|
|
1133
|
+
def: Mr,
|
|
1134
|
+
fences: Sr,
|
|
1135
|
+
heading: wr,
|
|
1136
|
+
hr: Cr,
|
|
1137
|
+
html: Ir,
|
|
1138
|
+
lheading: Dr,
|
|
1139
|
+
list: Nr,
|
|
1140
|
+
newline: br,
|
|
1141
|
+
paragraph: Rr,
|
|
1142
|
+
table: _r,
|
|
1143
|
+
text: Ar
|
|
1144
|
+
}, Vr = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Cr).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", Pr).getRegex(), Hr = {
|
|
1145
|
+
...Br,
|
|
1146
|
+
lheading: Or,
|
|
1147
|
+
table: Vr,
|
|
1148
|
+
paragraph: z(kr).replace("hr", Cr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Vr).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", Pr).getRegex()
|
|
1149
|
+
}, Ur = {
|
|
1150
|
+
...Br,
|
|
1151
|
+
html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Fr).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(),
|
|
1147
1152
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1148
1153
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1149
|
-
fences:
|
|
1154
|
+
fences: _r,
|
|
1150
1155
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1151
|
-
paragraph: z(
|
|
1152
|
-
},
|
|
1153
|
-
_backpedal:
|
|
1154
|
-
anyPunctuation:
|
|
1155
|
-
anyPunctuationOutsideCode:
|
|
1156
|
-
autolink:
|
|
1157
|
-
blockSkip:
|
|
1158
|
-
br:
|
|
1159
|
-
code:
|
|
1160
|
-
del:
|
|
1161
|
-
delLDelim:
|
|
1162
|
-
delRDelim:
|
|
1163
|
-
emStrongLDelim: ni,
|
|
1164
|
-
emStrongRDelimAst: oi,
|
|
1165
|
-
emStrongRDelimUnd: li,
|
|
1166
|
-
escape: Hr,
|
|
1167
|
-
link: bi,
|
|
1168
|
-
nolink: Si,
|
|
1169
|
-
punctuation: Yr,
|
|
1170
|
-
reflink: xi,
|
|
1171
|
-
reflinkSearch: Ti,
|
|
1172
|
-
tag: _i,
|
|
1173
|
-
text: Gr,
|
|
1174
|
-
url: hr
|
|
1175
|
-
}, ki = {
|
|
1176
|
-
...Oi,
|
|
1156
|
+
paragraph: z(kr).replace("hr", Cr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Dr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1157
|
+
}, Wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Kr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, qr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Jr = /[\p{P}\p{S}]/u, Yr = /[\s\p{P}\p{S}]/u, Xr = /[^\s\p{P}\p{S}]/u, Zr = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Yr).getRegex(), Qr = /[\p{Pi}\p{Ps}"']/u, $r = /(?!~)[\p{P}\p{S}]/u, ei = /(?!~)[\s\p{P}\p{S}]/u, ti = /(?:[^\s\p{P}\p{S}]|~)/u, ni = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", yr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ri = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ii = z(ri, "u").replace(/punct/g, Jr).getRegex(), ai = z(ri, "u").replace(/punct/g, $r).getRegex(), oi = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Qr).replace(/punct/g, Jr).getRegex(), si = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ci = z(si, "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), li = z(si, "gu").replace(/notPunctSpace/g, ti).replace(/punctSpace/g, ei).replace(/punct/g, $r).getRegex(), ui = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), di = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), fi = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), pi = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Jr).getRegex(), mi = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), hi = z(/\\(punct)/, "gu").replace(/punct/g, Jr).getRegex(), gi = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, Jr).getRegex(), _i = 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(), vi = z(Fr).replace("(?:-->|$)", "-->").getRegex(), yi = 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", vi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), bi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, xi = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", bi).getRegex(), Si = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", xi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ci = z(/^!?\[(label)\]\[(ref)\]/).replace("label", xi).replace("ref", jr).getRegex(), wi = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", jr).getRegex(), Ti = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Ei = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", bi).getRegex(), Di = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", Ei).replace("ref", Ti).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ti).getRegex()).getRegex(), Oi = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, ki = 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(), Ai = {
|
|
1158
|
+
_backpedal: _r,
|
|
1159
|
+
anyPunctuation: hi,
|
|
1160
|
+
anyPunctuationOutsideCode: gi,
|
|
1161
|
+
autolink: _i,
|
|
1162
|
+
blockSkip: ni,
|
|
1163
|
+
br: Kr,
|
|
1164
|
+
code: Gr,
|
|
1165
|
+
del: _r,
|
|
1166
|
+
delLDelim: _r,
|
|
1167
|
+
delRDelim: _r,
|
|
1177
1168
|
emStrongLDelim: ii,
|
|
1178
1169
|
emStrongRDelimAst: ci,
|
|
1179
|
-
emStrongRDelimUnd:
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
url:
|
|
1189
|
-
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1190
|
-
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1191
|
-
text: z(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Ei).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1170
|
+
emStrongRDelimUnd: di,
|
|
1171
|
+
escape: Wr,
|
|
1172
|
+
link: Si,
|
|
1173
|
+
nolink: wi,
|
|
1174
|
+
punctuation: Zr,
|
|
1175
|
+
reflink: Ci,
|
|
1176
|
+
reflinkSearch: Di,
|
|
1177
|
+
tag: yi,
|
|
1178
|
+
text: qr,
|
|
1179
|
+
url: _r
|
|
1192
1180
|
}, ji = {
|
|
1193
1181
|
...Ai,
|
|
1194
|
-
|
|
1195
|
-
|
|
1182
|
+
emStrongLDelim: oi,
|
|
1183
|
+
emStrongRDelimAst: ui,
|
|
1184
|
+
emStrongRDelimUnd: fi,
|
|
1185
|
+
link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", xi).getRegex(),
|
|
1186
|
+
reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xi).getRegex()
|
|
1196
1187
|
}, Mi = {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1188
|
+
...Ai,
|
|
1189
|
+
emStrongRDelimAst: li,
|
|
1190
|
+
emStrongLDelim: ai,
|
|
1191
|
+
delLDelim: pi,
|
|
1192
|
+
delRDelim: mi,
|
|
1193
|
+
url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", ki).replace("protocol", Oi).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1194
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1195
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1196
|
+
text: z(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", Oi).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1200
1197
|
}, Ni = {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
pedantic: ki
|
|
1198
|
+
...Mi,
|
|
1199
|
+
br: z(Kr).replace("{2,}", "*").getRegex(),
|
|
1200
|
+
text: z(Mi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1205
1201
|
}, Pi = {
|
|
1202
|
+
normal: Br,
|
|
1203
|
+
gfm: Hr,
|
|
1204
|
+
pedantic: Ur
|
|
1205
|
+
}, Fi = {
|
|
1206
|
+
normal: Ai,
|
|
1207
|
+
gfm: Mi,
|
|
1208
|
+
breaks: Ni,
|
|
1209
|
+
pedantic: ji
|
|
1210
|
+
}, Ii = {
|
|
1206
1211
|
"&": "&",
|
|
1207
1212
|
"<": "<",
|
|
1208
1213
|
">": ">",
|
|
1209
1214
|
"\"": """,
|
|
1210
1215
|
"'": "'"
|
|
1211
|
-
},
|
|
1216
|
+
}, Li = (e) => Ii[e];
|
|
1212
1217
|
function V(e, t) {
|
|
1213
1218
|
if (t) {
|
|
1214
|
-
if (B.escapeTest.test(e)) return e.replace(B.escapeReplace,
|
|
1215
|
-
} else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode,
|
|
1219
|
+
if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Li);
|
|
1220
|
+
} else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Li);
|
|
1216
1221
|
return e;
|
|
1217
1222
|
}
|
|
1218
|
-
function
|
|
1223
|
+
function Ri(e) {
|
|
1219
1224
|
return B.numericCharacterReference.test(e) ? e.replace(B.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
1220
1225
|
if (t === void 0 && n === void 0) return "&";
|
|
1221
1226
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
1222
1227
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&" : String.fromCodePoint(r);
|
|
1223
1228
|
}) : e;
|
|
1224
1229
|
}
|
|
1225
|
-
function
|
|
1230
|
+
function zi(e) {
|
|
1226
1231
|
try {
|
|
1227
1232
|
e = encodeURI(e).replace(B.percentDecode, "%");
|
|
1228
1233
|
} catch {
|
|
@@ -1230,7 +1235,7 @@ function Li(e) {
|
|
|
1230
1235
|
}
|
|
1231
1236
|
return e;
|
|
1232
1237
|
}
|
|
1233
|
-
function
|
|
1238
|
+
function Bi(e, t) {
|
|
1234
1239
|
let n = e.replace(B.findPipe, (e, t, n) => {
|
|
1235
1240
|
let r = !1, i = t;
|
|
1236
1241
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -1243,7 +1248,7 @@ function Ri(e, t) {
|
|
|
1243
1248
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(B.slashPipe, "|");
|
|
1244
1249
|
return n;
|
|
1245
1250
|
}
|
|
1246
|
-
function
|
|
1251
|
+
function Vi(e, t, n) {
|
|
1247
1252
|
let r = e.length;
|
|
1248
1253
|
if (r === 0) return "";
|
|
1249
1254
|
let i = 0;
|
|
@@ -1255,15 +1260,15 @@ function zi(e, t, n) {
|
|
|
1255
1260
|
}
|
|
1256
1261
|
return e.slice(0, r - i);
|
|
1257
1262
|
}
|
|
1258
|
-
function
|
|
1263
|
+
function Hi(e) {
|
|
1259
1264
|
let t = e.split("\n"), n = t.length - 1;
|
|
1260
1265
|
for (; n >= 0 && B.blankLine.test(t[n]);) n--;
|
|
1261
1266
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1262
1267
|
}
|
|
1263
|
-
function
|
|
1268
|
+
function Ui(e) {
|
|
1264
1269
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1265
1270
|
}
|
|
1266
|
-
function
|
|
1271
|
+
function Wi(e, t) {
|
|
1267
1272
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
1268
1273
|
let n = 0;
|
|
1269
1274
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1271,7 +1276,7 @@ function Hi(e, t) {
|
|
|
1271
1276
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1272
1277
|
return n > 0 ? -2 : -1;
|
|
1273
1278
|
}
|
|
1274
|
-
function
|
|
1279
|
+
function Gi(e, t = 0) {
|
|
1275
1280
|
let n = t, r = "";
|
|
1276
1281
|
for (let t of e) if (t === " ") {
|
|
1277
1282
|
let e = 4 - n % 4;
|
|
@@ -1279,7 +1284,7 @@ function Ui(e, t = 0) {
|
|
|
1279
1284
|
} else r += t, n++;
|
|
1280
1285
|
return r;
|
|
1281
1286
|
}
|
|
1282
|
-
function
|
|
1287
|
+
function Ki(e, t, n, r, i) {
|
|
1283
1288
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
|
|
1284
1289
|
r.state.inLink = !0, r.state.linkEmitted = !1;
|
|
1285
1290
|
let f = r.inlineTokens(s), p = r.state.linkEmitted;
|
|
@@ -1299,7 +1304,7 @@ function Wi(e, t, n, r, i) {
|
|
|
1299
1304
|
tokens: f
|
|
1300
1305
|
};
|
|
1301
1306
|
}
|
|
1302
|
-
function
|
|
1307
|
+
function qi(e, t, n) {
|
|
1303
1308
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1304
1309
|
if (r === null) return t;
|
|
1305
1310
|
let i = r[1];
|
|
@@ -1310,7 +1315,7 @@ function Gi(e, t, n) {
|
|
|
1310
1315
|
return e.slice(Math.min(r.length, i.length));
|
|
1311
1316
|
}).join("\n");
|
|
1312
1317
|
}
|
|
1313
|
-
function
|
|
1318
|
+
function Ji(e, t, n, r) {
|
|
1314
1319
|
if (!t.includes("<")) return !1;
|
|
1315
1320
|
for (let i = 0; i < t.length; i++) {
|
|
1316
1321
|
if (t[i] === "\\") {
|
|
@@ -1333,12 +1338,12 @@ function Ki(e, t, n, r) {
|
|
|
1333
1338
|
}
|
|
1334
1339
|
return !1;
|
|
1335
1340
|
}
|
|
1336
|
-
var
|
|
1341
|
+
var Yi = class {
|
|
1337
1342
|
options;
|
|
1338
1343
|
rules;
|
|
1339
1344
|
lexer;
|
|
1340
1345
|
constructor(e) {
|
|
1341
|
-
this.options = e ||
|
|
1346
|
+
this.options = e || hr;
|
|
1342
1347
|
}
|
|
1343
1348
|
space(e) {
|
|
1344
1349
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1350,7 +1355,7 @@ var qi = class {
|
|
|
1350
1355
|
code(e) {
|
|
1351
1356
|
let t = this.rules.block.code.exec(e);
|
|
1352
1357
|
if (t) {
|
|
1353
|
-
let e = this.options.pedantic ? t[0] :
|
|
1358
|
+
let e = this.options.pedantic ? t[0] : Hi(t[0]);
|
|
1354
1359
|
return {
|
|
1355
1360
|
type: "code",
|
|
1356
1361
|
raw: e,
|
|
@@ -1362,7 +1367,7 @@ var qi = class {
|
|
|
1362
1367
|
fences(e) {
|
|
1363
1368
|
let t = this.rules.block.fences.exec(e);
|
|
1364
1369
|
if (t) {
|
|
1365
|
-
let e = t[0], n =
|
|
1370
|
+
let e = t[0], n = qi(e, t[3] || "", this.rules);
|
|
1366
1371
|
return {
|
|
1367
1372
|
type: "code",
|
|
1368
1373
|
raw: e,
|
|
@@ -1376,12 +1381,12 @@ var qi = class {
|
|
|
1376
1381
|
if (t) {
|
|
1377
1382
|
let e = t[2].trim();
|
|
1378
1383
|
if (this.rules.other.endingHash.test(e)) {
|
|
1379
|
-
let t =
|
|
1384
|
+
let t = Vi(e, "#");
|
|
1380
1385
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1381
1386
|
}
|
|
1382
1387
|
return {
|
|
1383
1388
|
type: "heading",
|
|
1384
|
-
raw:
|
|
1389
|
+
raw: Vi(t[0], "\n"),
|
|
1385
1390
|
depth: t[1].length,
|
|
1386
1391
|
text: e,
|
|
1387
1392
|
tokens: this.lexer.inline(e)
|
|
@@ -1392,13 +1397,13 @@ var qi = class {
|
|
|
1392
1397
|
let t = this.rules.block.hr.exec(e);
|
|
1393
1398
|
if (t) return {
|
|
1394
1399
|
type: "hr",
|
|
1395
|
-
raw:
|
|
1400
|
+
raw: Vi(t[0], "\n")
|
|
1396
1401
|
};
|
|
1397
1402
|
}
|
|
1398
1403
|
blockquote(e) {
|
|
1399
1404
|
let t = this.rules.block.blockquote.exec(e);
|
|
1400
1405
|
if (t) {
|
|
1401
|
-
let e =
|
|
1406
|
+
let e = Vi(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1402
1407
|
for (; e.length > 0;) {
|
|
1403
1408
|
let t = !1, a = [], o = 0;
|
|
1404
1409
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1452,12 +1457,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1452
1457
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1453
1458
|
let l = r();
|
|
1454
1459
|
e = e.substring(t[0].length);
|
|
1455
|
-
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ?
|
|
1460
|
+
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Gi(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Gi(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
|
|
1456
1461
|
if (this.options.pedantic ? (m = 2, a = f.trimStart()) : ee ? m = d + 1 : (m = f.search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, a = f.slice(m), m += d), ee && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
|
|
1457
1462
|
let t = this.rules.other.nextBulletRegex(m), n = this.rules.other.hrRegex(m), r = this.rules.other.fencesBeginRegex(m), i = this.rules.other.headingBeginRegex(m), o = this.rules.other.htmlBeginRegex(m), s = this.rules.other.blockquoteBeginRegex(m);
|
|
1458
1463
|
for (; e;) {
|
|
1459
1464
|
let c = e.split("\n", 1)[0], l;
|
|
1460
|
-
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) =>
|
|
1465
|
+
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Gi(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
|
|
1461
1466
|
if (l.search(this.rules.other.nonSpaceChar) >= m || !p.trim()) a += "\n" + l.slice(m);
|
|
1462
1467
|
else {
|
|
1463
1468
|
if (ee || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
|
|
@@ -1466,10 +1471,10 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1466
1471
|
ee = !p.trim(), e = e.substring(c.length + 1), f = l.slice(m);
|
|
1467
1472
|
}
|
|
1468
1473
|
}
|
|
1469
|
-
let
|
|
1470
|
-
o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1474
|
+
let h = n.slice(l, r());
|
|
1475
|
+
o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (c = !0)), o.items.push({
|
|
1471
1476
|
type: "list_item",
|
|
1472
|
-
raw:
|
|
1477
|
+
raw: h,
|
|
1473
1478
|
task: !!this.options.gfm && this.rules.other.listIsTask.test(a),
|
|
1474
1479
|
loose: !1,
|
|
1475
1480
|
text: a,
|
|
@@ -1518,7 +1523,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1518
1523
|
html(e) {
|
|
1519
1524
|
let t = this.rules.block.html.exec(e);
|
|
1520
1525
|
if (t) {
|
|
1521
|
-
let e =
|
|
1526
|
+
let e = Hi(t[0]);
|
|
1522
1527
|
return {
|
|
1523
1528
|
type: "html",
|
|
1524
1529
|
block: !0,
|
|
@@ -1531,12 +1536,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1531
1536
|
def(e) {
|
|
1532
1537
|
let t = this.rules.block.def.exec(e);
|
|
1533
1538
|
if (t) {
|
|
1534
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1535
|
-
let e =
|
|
1539
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && Wi(t[2], "()") !== -1) return;
|
|
1540
|
+
let e = Ui(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
1536
1541
|
return {
|
|
1537
1542
|
type: "def",
|
|
1538
1543
|
tag: e,
|
|
1539
|
-
raw:
|
|
1544
|
+
raw: Vi(t[0], "\n"),
|
|
1540
1545
|
href: n,
|
|
1541
1546
|
title: r
|
|
1542
1547
|
};
|
|
@@ -1545,9 +1550,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1545
1550
|
table(e) {
|
|
1546
1551
|
let t = this.rules.block.table.exec(e);
|
|
1547
1552
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1548
|
-
let n =
|
|
1553
|
+
let n = Bi(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
|
|
1549
1554
|
type: "table",
|
|
1550
|
-
raw:
|
|
1555
|
+
raw: Vi(t[0], "\n"),
|
|
1551
1556
|
header: [],
|
|
1552
1557
|
align: [],
|
|
1553
1558
|
rows: []
|
|
@@ -1560,7 +1565,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1560
1565
|
header: !0,
|
|
1561
1566
|
align: a.align[e]
|
|
1562
1567
|
});
|
|
1563
|
-
for (let e of i) a.rows.push(
|
|
1568
|
+
for (let e of i) a.rows.push(Bi(e, a.header.length).map((e, t) => ({
|
|
1564
1569
|
text: e,
|
|
1565
1570
|
tokens: this.lexer.inline(e),
|
|
1566
1571
|
header: !1,
|
|
@@ -1575,7 +1580,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1575
1580
|
let e = t[1].trim();
|
|
1576
1581
|
return {
|
|
1577
1582
|
type: "heading",
|
|
1578
|
-
raw:
|
|
1583
|
+
raw: Vi(t[0], "\n"),
|
|
1579
1584
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1580
1585
|
text: e,
|
|
1581
1586
|
tokens: this.lexer.inline(e)
|
|
@@ -1627,14 +1632,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1627
1632
|
let t = this.rules.inline.link.exec(e);
|
|
1628
1633
|
if (t) {
|
|
1629
1634
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1630
|
-
if (!this.options.pedantic &&
|
|
1635
|
+
if (!this.options.pedantic && Ji(e, t[1], n, this.rules)) return;
|
|
1631
1636
|
let r = t[2].trim();
|
|
1632
1637
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1633
1638
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1634
|
-
let e =
|
|
1639
|
+
let e = Vi(r.slice(0, -1), "\\");
|
|
1635
1640
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1636
1641
|
} else {
|
|
1637
|
-
let e =
|
|
1642
|
+
let e = Wi(t[2], "()");
|
|
1638
1643
|
if (e === -2) return;
|
|
1639
1644
|
if (e > -1) {
|
|
1640
1645
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1646,7 +1651,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1646
1651
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1647
1652
|
e && (i = e[1], a = e[3]);
|
|
1648
1653
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1649
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)),
|
|
1654
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Ki(t, {
|
|
1650
1655
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1651
1656
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1652
1657
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1656,8 +1661,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1656
1661
|
let n;
|
|
1657
1662
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1658
1663
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1659
|
-
if (!this.options.pedantic &&
|
|
1660
|
-
let i = t[
|
|
1664
|
+
if (!this.options.pedantic && Ji(e, n[1], r, this.rules)) return;
|
|
1665
|
+
let i = t[Ui((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1661
1666
|
if (!i) {
|
|
1662
1667
|
let e = n[0].charAt(0);
|
|
1663
1668
|
return {
|
|
@@ -1666,7 +1671,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1666
1671
|
text: e
|
|
1667
1672
|
};
|
|
1668
1673
|
}
|
|
1669
|
-
return
|
|
1674
|
+
return Ki(n, i, n[0], this.lexer, this.rules);
|
|
1670
1675
|
}
|
|
1671
1676
|
}
|
|
1672
1677
|
emStrong(e, t, n = "") {
|
|
@@ -1799,7 +1804,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1799
1804
|
return {
|
|
1800
1805
|
type: "text",
|
|
1801
1806
|
raw: t[0],
|
|
1802
|
-
text: e ? t[0] :
|
|
1807
|
+
text: e ? t[0] : Ri(t[0]),
|
|
1803
1808
|
escaped: e
|
|
1804
1809
|
};
|
|
1805
1810
|
}
|
|
@@ -1811,7 +1816,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1811
1816
|
inlineQueue;
|
|
1812
1817
|
tokenizer;
|
|
1813
1818
|
constructor(e) {
|
|
1814
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1819
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || hr, this.options.tokenizer = this.options.tokenizer || new Yi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1815
1820
|
inLink: !1,
|
|
1816
1821
|
inRawBlock: !1,
|
|
1817
1822
|
linkEmitted: !1,
|
|
@@ -1820,15 +1825,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1820
1825
|
};
|
|
1821
1826
|
let t = {
|
|
1822
1827
|
other: B,
|
|
1823
|
-
block:
|
|
1824
|
-
inline:
|
|
1828
|
+
block: Pi.normal,
|
|
1829
|
+
inline: Fi.normal
|
|
1825
1830
|
};
|
|
1826
|
-
this.options.pedantic ? (t.block =
|
|
1831
|
+
this.options.pedantic ? (t.block = Pi.pedantic, t.inline = Fi.pedantic) : this.options.gfm && (t.block = Pi.gfm, t.inline = this.options.breaks ? Fi.breaks : Fi.gfm), this.tokenizer.rules = t;
|
|
1827
1832
|
}
|
|
1828
1833
|
static get rules() {
|
|
1829
1834
|
return {
|
|
1830
|
-
block:
|
|
1831
|
-
inline:
|
|
1835
|
+
block: Pi,
|
|
1836
|
+
inline: Fi
|
|
1832
1837
|
};
|
|
1833
1838
|
}
|
|
1834
1839
|
static lex(t, n) {
|
|
@@ -1918,7 +1923,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1918
1923
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1919
1924
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1920
1925
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1921
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1926
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Ui(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1922
1927
|
}
|
|
1923
1928
|
return !1;
|
|
1924
1929
|
}
|
|
@@ -1937,7 +1942,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1937
1942
|
if (this.tokens.links && e.includes("[")) {
|
|
1938
1943
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1939
1944
|
let r = n.lastIndexOf("[");
|
|
1940
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1945
|
+
if (!Object.hasOwn(this.tokens.links, Ui(n.slice(r + 1, -1)))) return n;
|
|
1941
1946
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1942
1947
|
let i = n.slice(1, r - 1);
|
|
1943
1948
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1997,11 +2002,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1997
2002
|
if (this.options.silent) console.error(t);
|
|
1998
2003
|
else throw Error(t);
|
|
1999
2004
|
}
|
|
2000
|
-
},
|
|
2005
|
+
}, Xi = class {
|
|
2001
2006
|
options;
|
|
2002
2007
|
parser;
|
|
2003
2008
|
constructor(e) {
|
|
2004
|
-
this.options = e ||
|
|
2009
|
+
this.options = e || hr;
|
|
2005
2010
|
}
|
|
2006
2011
|
space(e) {
|
|
2007
2012
|
return "";
|
|
@@ -2087,7 +2092,7 @@ ${e}</tr>
|
|
|
2087
2092
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
2088
2093
|
}
|
|
2089
2094
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
2090
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
2095
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = zi(e);
|
|
2091
2096
|
if (o === null) return a;
|
|
2092
2097
|
e = V(o, i);
|
|
2093
2098
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -2095,7 +2100,7 @@ ${e}</tr>
|
|
|
2095
2100
|
}
|
|
2096
2101
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
2097
2102
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
2098
|
-
let i =
|
|
2103
|
+
let i = zi(e);
|
|
2099
2104
|
if (i === null) return V(n);
|
|
2100
2105
|
e = i;
|
|
2101
2106
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -2104,7 +2109,7 @@ ${e}</tr>
|
|
|
2104
2109
|
text(e) {
|
|
2105
2110
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
2106
2111
|
}
|
|
2107
|
-
},
|
|
2112
|
+
}, Zi = class {
|
|
2108
2113
|
strong({ text: e }) {
|
|
2109
2114
|
return e;
|
|
2110
2115
|
}
|
|
@@ -2140,7 +2145,7 @@ ${e}</tr>
|
|
|
2140
2145
|
renderer;
|
|
2141
2146
|
textRenderer;
|
|
2142
2147
|
constructor(e) {
|
|
2143
|
-
this.options = e ||
|
|
2148
|
+
this.options = e || hr, this.options.renderer = this.options.renderer || new Xi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Zi();
|
|
2144
2149
|
}
|
|
2145
2150
|
static parse(t, n) {
|
|
2146
2151
|
return new e(n).parse(t);
|
|
@@ -2288,11 +2293,11 @@ ${e}</tr>
|
|
|
2288
2293
|
}
|
|
2289
2294
|
return n;
|
|
2290
2295
|
}
|
|
2291
|
-
},
|
|
2296
|
+
}, Qi = class {
|
|
2292
2297
|
options;
|
|
2293
2298
|
block;
|
|
2294
2299
|
constructor(e) {
|
|
2295
|
-
this.options = e ||
|
|
2300
|
+
this.options = e || hr;
|
|
2296
2301
|
}
|
|
2297
2302
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2298
2303
|
"preprocess",
|
|
@@ -2324,44 +2329,44 @@ ${e}</tr>
|
|
|
2324
2329
|
return e ? U.parse : U.parseInline;
|
|
2325
2330
|
}
|
|
2326
2331
|
};
|
|
2327
|
-
function
|
|
2332
|
+
function $i(e, t) {
|
|
2328
2333
|
if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
|
|
2329
2334
|
else e.push(t);
|
|
2330
2335
|
}
|
|
2331
|
-
var
|
|
2332
|
-
defaults =
|
|
2336
|
+
var ea = new class {
|
|
2337
|
+
defaults = mr();
|
|
2333
2338
|
options = this.setOptions;
|
|
2334
2339
|
parse = this.parseMarkdown(!0);
|
|
2335
2340
|
parseInline = this.parseMarkdown(!1);
|
|
2336
2341
|
Parser = U;
|
|
2337
|
-
Renderer =
|
|
2338
|
-
TextRenderer =
|
|
2342
|
+
Renderer = Xi;
|
|
2343
|
+
TextRenderer = Zi;
|
|
2339
2344
|
Lexer = H;
|
|
2340
|
-
Tokenizer =
|
|
2341
|
-
Hooks =
|
|
2345
|
+
Tokenizer = Yi;
|
|
2346
|
+
Hooks = Qi;
|
|
2342
2347
|
constructor(...e) {
|
|
2343
2348
|
this.use(...e);
|
|
2344
2349
|
}
|
|
2345
2350
|
walkTokens(e, t) {
|
|
2346
2351
|
let n = [];
|
|
2347
|
-
for (let r of e) switch (
|
|
2352
|
+
for (let r of e) switch ($i(n, t.call(this, r)), r.type) {
|
|
2348
2353
|
case "table": {
|
|
2349
2354
|
let e = r;
|
|
2350
|
-
for (let r of e.header)
|
|
2351
|
-
for (let r of e.rows) for (let e of r)
|
|
2355
|
+
for (let r of e.header) $i(n, this.walkTokens(r.tokens, t));
|
|
2356
|
+
for (let r of e.rows) for (let e of r) $i(n, this.walkTokens(e.tokens, t));
|
|
2352
2357
|
break;
|
|
2353
2358
|
}
|
|
2354
2359
|
case "list": {
|
|
2355
2360
|
let e = r;
|
|
2356
|
-
|
|
2361
|
+
$i(n, this.walkTokens(e.items, t));
|
|
2357
2362
|
break;
|
|
2358
2363
|
}
|
|
2359
2364
|
default: {
|
|
2360
2365
|
let e = r;
|
|
2361
2366
|
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
2362
2367
|
let i = e[r].flat(1 / 0);
|
|
2363
|
-
|
|
2364
|
-
}) : e.tokens &&
|
|
2368
|
+
$i(n, this.walkTokens(i, t));
|
|
2369
|
+
}) : e.tokens && $i(n, this.walkTokens(e.tokens, t));
|
|
2365
2370
|
}
|
|
2366
2371
|
}
|
|
2367
2372
|
return n;
|
|
@@ -2389,7 +2394,7 @@ var Qi = new class {
|
|
|
2389
2394
|
}
|
|
2390
2395
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2391
2396
|
}), n.extensions = t), e.renderer) {
|
|
2392
|
-
let t = this.defaults.renderer || new
|
|
2397
|
+
let t = this.defaults.renderer || new Xi(this.defaults);
|
|
2393
2398
|
for (let n in e.renderer) {
|
|
2394
2399
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2395
2400
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2402,7 +2407,7 @@ var Qi = new class {
|
|
|
2402
2407
|
n.renderer = t;
|
|
2403
2408
|
}
|
|
2404
2409
|
if (e.tokenizer) {
|
|
2405
|
-
let t = this.defaults.tokenizer || new
|
|
2410
|
+
let t = this.defaults.tokenizer || new Yi(this.defaults);
|
|
2406
2411
|
for (let n in e.tokenizer) {
|
|
2407
2412
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2408
2413
|
if ([
|
|
@@ -2419,13 +2424,13 @@ var Qi = new class {
|
|
|
2419
2424
|
n.tokenizer = t;
|
|
2420
2425
|
}
|
|
2421
2426
|
if (e.hooks) {
|
|
2422
|
-
let t = this.defaults.hooks || new
|
|
2427
|
+
let t = this.defaults.hooks || new Qi();
|
|
2423
2428
|
for (let n in e.hooks) {
|
|
2424
2429
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2425
2430
|
if (["options", "block"].includes(n)) continue;
|
|
2426
2431
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2427
|
-
t[r] =
|
|
2428
|
-
if (this.defaults.async &&
|
|
2432
|
+
t[r] = Qi.passThroughHooks.has(n) ? (e) => {
|
|
2433
|
+
if (this.defaults.async && Qi.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2429
2434
|
let n = await i.call(t, e);
|
|
2430
2435
|
return a.call(t, n);
|
|
2431
2436
|
})();
|
|
@@ -2446,7 +2451,7 @@ var Qi = new class {
|
|
|
2446
2451
|
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
2447
2452
|
n.walkTokens = function(e) {
|
|
2448
2453
|
let n = [];
|
|
2449
|
-
return n.push(r.call(this, e)), t &&
|
|
2454
|
+
return n.push(r.call(this, e)), t && $i(n, t.call(this, e)), n;
|
|
2450
2455
|
};
|
|
2451
2456
|
}
|
|
2452
2457
|
this.defaults = {
|
|
@@ -2505,31 +2510,31 @@ var Qi = new class {
|
|
|
2505
2510
|
}
|
|
2506
2511
|
}();
|
|
2507
2512
|
function W(e, t) {
|
|
2508
|
-
return
|
|
2513
|
+
return ea.parse(e, t);
|
|
2509
2514
|
}
|
|
2510
2515
|
W.options = W.setOptions = function(e) {
|
|
2511
|
-
return
|
|
2512
|
-
}, W.getDefaults =
|
|
2513
|
-
function
|
|
2514
|
-
return
|
|
2515
|
-
}
|
|
2516
|
-
W.use =
|
|
2517
|
-
return
|
|
2518
|
-
}, W.parseInline =
|
|
2516
|
+
return ea.setOptions(e), W.defaults = ea.defaults, gr(W.defaults), W;
|
|
2517
|
+
}, W.getDefaults = mr, W.defaults = hr;
|
|
2518
|
+
function ta(...e) {
|
|
2519
|
+
return ea.use(...e), W.defaults = ea.defaults, gr(W.defaults), W;
|
|
2520
|
+
}
|
|
2521
|
+
W.use = ta, W.walkTokens = function(e, t) {
|
|
2522
|
+
return ea.walkTokens(e, t);
|
|
2523
|
+
}, W.parseInline = ea.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Xi, W.TextRenderer = Zi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Yi, W.Hooks = Qi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2519
2524
|
//#endregion
|
|
2520
2525
|
//#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
2521
|
-
function
|
|
2526
|
+
function na(e, t) {
|
|
2522
2527
|
this.v = e, this.k = t;
|
|
2523
2528
|
}
|
|
2524
|
-
function
|
|
2529
|
+
function ra(e, t) {
|
|
2525
2530
|
(t == null || t > e.length) && (t = e.length);
|
|
2526
2531
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2527
2532
|
return r;
|
|
2528
2533
|
}
|
|
2529
|
-
function
|
|
2534
|
+
function ia(e) {
|
|
2530
2535
|
if (Array.isArray(e)) return e;
|
|
2531
2536
|
}
|
|
2532
|
-
function
|
|
2537
|
+
function aa(e, t) {
|
|
2533
2538
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2534
2539
|
if (n != null) {
|
|
2535
2540
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2550,24 +2555,24 @@ function ra(e, t) {
|
|
|
2550
2555
|
return s;
|
|
2551
2556
|
}
|
|
2552
2557
|
}
|
|
2553
|
-
function
|
|
2558
|
+
function oa() {
|
|
2554
2559
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2555
2560
|
}
|
|
2556
|
-
function
|
|
2557
|
-
return
|
|
2561
|
+
function sa(e, t) {
|
|
2562
|
+
return ia(e) || aa(e, t) || ca(e, t) || oa();
|
|
2558
2563
|
}
|
|
2559
|
-
function
|
|
2564
|
+
function ca(e, t) {
|
|
2560
2565
|
if (e) {
|
|
2561
|
-
if (typeof e == "string") return
|
|
2566
|
+
if (typeof e == "string") return ra(e, t);
|
|
2562
2567
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2563
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
2568
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ra(e, t) : void 0;
|
|
2564
2569
|
}
|
|
2565
2570
|
}
|
|
2566
|
-
function
|
|
2571
|
+
function la(e) {
|
|
2567
2572
|
var t, n;
|
|
2568
2573
|
function r(t, n) {
|
|
2569
2574
|
try {
|
|
2570
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2575
|
+
var a = e[t](n), o = a.value, s = o instanceof na;
|
|
2571
2576
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2572
2577
|
if (s) {
|
|
2573
2578
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2601,119 +2606,119 @@ function sa(e) {
|
|
|
2601
2606
|
});
|
|
2602
2607
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2603
2608
|
}
|
|
2604
|
-
|
|
2609
|
+
la.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2605
2610
|
return this;
|
|
2606
|
-
},
|
|
2611
|
+
}, la.prototype.next = function(e) {
|
|
2607
2612
|
return this._invoke("next", e);
|
|
2608
|
-
},
|
|
2613
|
+
}, la.prototype.throw = function(e) {
|
|
2609
2614
|
return this._invoke("throw", e);
|
|
2610
|
-
},
|
|
2615
|
+
}, la.prototype.return = function(e) {
|
|
2611
2616
|
return this._invoke("return", e);
|
|
2612
2617
|
};
|
|
2613
|
-
var
|
|
2618
|
+
var ua = Object.entries, da = Object.setPrototypeOf, fa = Object.isFrozen, pa = Object.getPrototypeOf, ma = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ha = Object.create, ga = typeof Reflect < "u" && Reflect, _a = ga.apply, va = ga.construct;
|
|
2614
2619
|
G ||= function(e) {
|
|
2615
2620
|
return e;
|
|
2616
2621
|
}, K ||= function(e) {
|
|
2617
2622
|
return e;
|
|
2618
|
-
},
|
|
2623
|
+
}, _a ||= function(e, t) {
|
|
2619
2624
|
var n = [...arguments].slice(2);
|
|
2620
2625
|
return e.apply(t, n);
|
|
2621
|
-
},
|
|
2626
|
+
}, va ||= function(e) {
|
|
2622
2627
|
return new e(...[...arguments].slice(1));
|
|
2623
2628
|
};
|
|
2624
|
-
var
|
|
2629
|
+
var ya = Y(Array.prototype.forEach);
|
|
2625
2630
|
Array.prototype.indexOf;
|
|
2626
|
-
var
|
|
2631
|
+
var ba = Y(Array.prototype.lastIndexOf), xa = Y(Array.prototype.pop), Sa = Y(Array.prototype.push), Ca = Y(Array.prototype.slice), wa = Y(Array.prototype.splice), Ta = Array.isArray, Ea = Va(Set), Da = Y(Set.prototype.add), Oa = Y(Set.prototype.has), ka = Y(String.prototype.toLowerCase), Aa = Y(String.prototype.toString), ja = Y(String.prototype.match), Ma = Y(String.prototype.replace), Na = Y(String.prototype.indexOf), Pa = Y(String.prototype.trim), Fa = Y(Number.prototype.toString), Ia = Y(Boolean.prototype.toString), La = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), Ra = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), za = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Ba = Va(TypeError);
|
|
2627
2632
|
function Y(e) {
|
|
2628
2633
|
return function(t) {
|
|
2629
2634
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2630
2635
|
var n = [...arguments].slice(1);
|
|
2631
|
-
return
|
|
2636
|
+
return _a(e, t, n);
|
|
2632
2637
|
};
|
|
2633
2638
|
}
|
|
2634
|
-
function
|
|
2639
|
+
function Va(e) {
|
|
2635
2640
|
return function() {
|
|
2636
|
-
return
|
|
2641
|
+
return va(e, [...arguments]);
|
|
2637
2642
|
};
|
|
2638
2643
|
}
|
|
2639
2644
|
function X(e, t) {
|
|
2640
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2641
|
-
if (
|
|
2645
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ka;
|
|
2646
|
+
if (da && da(e, null), !Ta(t)) return e;
|
|
2642
2647
|
let r = t.length;
|
|
2643
2648
|
for (; r--;) {
|
|
2644
2649
|
let i = t[r];
|
|
2645
2650
|
if (typeof i == "string") {
|
|
2646
2651
|
let e = n(i);
|
|
2647
|
-
e !== i && (
|
|
2652
|
+
e !== i && (fa(t) || (t[r] = e), i = e);
|
|
2648
2653
|
}
|
|
2649
2654
|
e[i] = !0;
|
|
2650
2655
|
}
|
|
2651
2656
|
return e;
|
|
2652
2657
|
}
|
|
2653
|
-
function
|
|
2658
|
+
function Ha(e) {
|
|
2654
2659
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2655
2660
|
return e;
|
|
2656
2661
|
}
|
|
2657
2662
|
function Z(e) {
|
|
2658
|
-
let t =
|
|
2659
|
-
for (let r of
|
|
2660
|
-
var n =
|
|
2663
|
+
let t = ha(null);
|
|
2664
|
+
for (let r of ua(e)) {
|
|
2665
|
+
var n = sa(r, 2);
|
|
2661
2666
|
let i = n[0], a = n[1];
|
|
2662
|
-
q(e, i) && (t[i] =
|
|
2667
|
+
q(e, i) && (t[i] = Ta(a) ? Ha(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2663
2668
|
}
|
|
2664
2669
|
return t;
|
|
2665
2670
|
}
|
|
2666
|
-
function
|
|
2671
|
+
function Ua(e) {
|
|
2667
2672
|
switch (typeof e) {
|
|
2668
2673
|
case "string": return e;
|
|
2669
|
-
case "number": return
|
|
2670
|
-
case "boolean": return
|
|
2671
|
-
case "bigint": return
|
|
2672
|
-
case "symbol": return
|
|
2673
|
-
case "undefined": return
|
|
2674
|
+
case "number": return Fa(e);
|
|
2675
|
+
case "boolean": return Ia(e);
|
|
2676
|
+
case "bigint": return La ? La(e) : "0";
|
|
2677
|
+
case "symbol": return Ra ? Ra(e) : "Symbol()";
|
|
2678
|
+
case "undefined": return za(e);
|
|
2674
2679
|
case "function":
|
|
2675
2680
|
case "object": {
|
|
2676
|
-
if (e === null) return
|
|
2681
|
+
if (e === null) return za(e);
|
|
2677
2682
|
let t = e, n = Q(t, "toString");
|
|
2678
2683
|
if (typeof n == "function") {
|
|
2679
2684
|
let e = n(t);
|
|
2680
|
-
return typeof e == "string" ? e :
|
|
2685
|
+
return typeof e == "string" ? e : za(e);
|
|
2681
2686
|
}
|
|
2682
|
-
return
|
|
2687
|
+
return za(e);
|
|
2683
2688
|
}
|
|
2684
|
-
default: return
|
|
2689
|
+
default: return za(e);
|
|
2685
2690
|
}
|
|
2686
2691
|
}
|
|
2687
2692
|
function Q(e, t) {
|
|
2688
2693
|
for (; e !== null;) {
|
|
2689
|
-
let n =
|
|
2694
|
+
let n = ma(e, t);
|
|
2690
2695
|
if (n) {
|
|
2691
2696
|
if (n.get) return Y(n.get);
|
|
2692
2697
|
if (typeof n.value == "function") return Y(n.value);
|
|
2693
2698
|
}
|
|
2694
|
-
e =
|
|
2699
|
+
e = pa(e);
|
|
2695
2700
|
}
|
|
2696
2701
|
function n() {
|
|
2697
2702
|
return null;
|
|
2698
2703
|
}
|
|
2699
2704
|
return n;
|
|
2700
2705
|
}
|
|
2701
|
-
function
|
|
2706
|
+
function Wa(e, t) {
|
|
2702
2707
|
for (; e !== null;) {
|
|
2703
|
-
let n =
|
|
2708
|
+
let n = ma(e, t);
|
|
2704
2709
|
if (n) return n.get ? Y(n.get) : null;
|
|
2705
|
-
e =
|
|
2710
|
+
e = pa(e);
|
|
2706
2711
|
}
|
|
2707
2712
|
return null;
|
|
2708
2713
|
}
|
|
2709
|
-
function
|
|
2714
|
+
function Ga(e) {
|
|
2710
2715
|
try {
|
|
2711
2716
|
return J(e, ""), !0;
|
|
2712
2717
|
} catch {
|
|
2713
2718
|
return !1;
|
|
2714
2719
|
}
|
|
2715
2720
|
}
|
|
2716
|
-
var
|
|
2721
|
+
var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), qa = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ja = G([
|
|
2717
2722
|
"feBlend",
|
|
2718
2723
|
"feColorMatrix",
|
|
2719
2724
|
"feComponentTransfer",
|
|
@@ -2739,7 +2744,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2739
2744
|
"feSpotLight",
|
|
2740
2745
|
"feTile",
|
|
2741
2746
|
"feTurbulence"
|
|
2742
|
-
]),
|
|
2747
|
+
]), Ya = G([
|
|
2743
2748
|
"animate",
|
|
2744
2749
|
"color-profile",
|
|
2745
2750
|
"cursor",
|
|
@@ -2762,7 +2767,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2762
2767
|
"solidcolor",
|
|
2763
2768
|
"unknown",
|
|
2764
2769
|
"use"
|
|
2765
|
-
]),
|
|
2770
|
+
]), Xa = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Za = G([
|
|
2766
2771
|
"maction",
|
|
2767
2772
|
"maligngroup",
|
|
2768
2773
|
"malignmark",
|
|
@@ -2778,13 +2783,13 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2778
2783
|
"annotation-xml",
|
|
2779
2784
|
"mprescripts",
|
|
2780
2785
|
"none"
|
|
2781
|
-
]),
|
|
2786
|
+
]), Qa = G(["#text"]), $a = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), eo = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), to = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), no = G([
|
|
2782
2787
|
"xlink:href",
|
|
2783
2788
|
"xml:id",
|
|
2784
2789
|
"xlink:title",
|
|
2785
2790
|
"xml:space",
|
|
2786
2791
|
"xmlns:xlink"
|
|
2787
|
-
]),
|
|
2792
|
+
]), ro = K(/{{[\w\W]*|^[\w\W]*}}/g), io = K(/<%[\w\W]*|^[\w\W]*%>/g), ao = K(/\${[\w\W]*/g), oo = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), so = K(/^aria-[\-\w]+$/), co = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), lo = K(/^(?:\w+script|data):/i), uo = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), fo = K(/^html$/i), po = K(/^[a-z][.\w]*(-[.\w]+)+$/i), mo = K(/<[/\w!]/g), ho = K(/<[/\w]/g), go = K(/<\/no(script|embed|frames)/i), _o = K(/\/>/i), $ = {
|
|
2788
2793
|
element: 1,
|
|
2789
2794
|
attribute: 2,
|
|
2790
2795
|
text: 3,
|
|
@@ -2797,7 +2802,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2797
2802
|
documentType: 10,
|
|
2798
2803
|
documentFragment: 11,
|
|
2799
2804
|
notation: 12
|
|
2800
|
-
},
|
|
2805
|
+
}, vo = G(X({}, [
|
|
2801
2806
|
"style",
|
|
2802
2807
|
"script",
|
|
2803
2808
|
"xmp",
|
|
@@ -2806,9 +2811,9 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2806
2811
|
"noframes",
|
|
2807
2812
|
"plaintext",
|
|
2808
2813
|
"noscript"
|
|
2809
|
-
])),
|
|
2814
|
+
])), yo = function() {
|
|
2810
2815
|
return typeof window > "u" ? null : window;
|
|
2811
|
-
},
|
|
2816
|
+
}, bo = function(e, t) {
|
|
2812
2817
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2813
2818
|
let n = null, r = "data-tt-policy-suffix";
|
|
2814
2819
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2825,7 +2830,7 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2825
2830
|
} catch {
|
|
2826
2831
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2827
2832
|
}
|
|
2828
|
-
},
|
|
2833
|
+
}, xo = function() {
|
|
2829
2834
|
return {
|
|
2830
2835
|
afterSanitizeAttributes: [],
|
|
2831
2836
|
afterSanitizeElements: [],
|
|
@@ -2837,62 +2842,62 @@ var Wa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2837
2842
|
uponSanitizeElement: [],
|
|
2838
2843
|
uponSanitizeShadowNode: []
|
|
2839
2844
|
};
|
|
2840
|
-
},
|
|
2841
|
-
return q(e, t) &&
|
|
2842
|
-
},
|
|
2845
|
+
}, So = function(e, t, n, r) {
|
|
2846
|
+
return q(e, t) && Ta(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2847
|
+
}, Co = function(e, t, n) {
|
|
2843
2848
|
let r = q(e, t) ? e[t] : void 0;
|
|
2844
2849
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2845
2850
|
};
|
|
2846
|
-
function
|
|
2847
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2851
|
+
function wo() {
|
|
2852
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yo(), t = (e) => wo(e);
|
|
2848
2853
|
if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2849
2854
|
let n = e.document, r = n, i = r.currentScript;
|
|
2850
2855
|
e.DocumentFragment;
|
|
2851
2856
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2852
2857
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2853
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"),
|
|
2854
|
-
return
|
|
2855
|
-
},
|
|
2858
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), h = Q(d, "childNodes"), te = Q(d, "parentNode"), ne = Q(d, "shadowRoot"), re = Q(d, "attributes"), ie = o && o.prototype ? Q(o.prototype, "nodeType") : null, g = o && o.prototype ? Q(o.prototype, "nodeName") : null, _ = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, v = function(e) {
|
|
2859
|
+
return ie ? ie(e) : e.nodeType;
|
|
2860
|
+
}, ae = function(e) {
|
|
2856
2861
|
return g ? g(e) : e.nodeName;
|
|
2857
|
-
},
|
|
2858
|
-
return
|
|
2862
|
+
}, oe = Wa(d, "namespaceURI"), se = function(e) {
|
|
2863
|
+
return oe ? oe(e) : e.namespaceURI;
|
|
2859
2864
|
};
|
|
2860
2865
|
if (typeof a == "function") {
|
|
2861
2866
|
let e = n.createElement("template");
|
|
2862
2867
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2863
2868
|
}
|
|
2864
|
-
let
|
|
2865
|
-
if (
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2869
|
+
let y, b = "", ce, le = !1, ue = 0, de = function() {
|
|
2870
|
+
if (ue > 0) throw Ba("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
2871
|
+
}, x = function(e) {
|
|
2872
|
+
de(), ue++;
|
|
2868
2873
|
try {
|
|
2869
|
-
return
|
|
2874
|
+
return y.createHTML(e);
|
|
2870
2875
|
} finally {
|
|
2871
|
-
|
|
2876
|
+
ue--;
|
|
2872
2877
|
}
|
|
2873
|
-
},
|
|
2874
|
-
|
|
2878
|
+
}, fe = function(e) {
|
|
2879
|
+
de(), ue++;
|
|
2875
2880
|
try {
|
|
2876
|
-
return
|
|
2881
|
+
return y.createScriptURL(e);
|
|
2877
2882
|
} finally {
|
|
2878
|
-
|
|
2879
|
-
}
|
|
2880
|
-
},
|
|
2881
|
-
return
|
|
2882
|
-
},
|
|
2883
|
-
t.isSupported = typeof
|
|
2884
|
-
let
|
|
2885
|
-
...Wa,
|
|
2886
|
-
...Ga,
|
|
2883
|
+
ue--;
|
|
2884
|
+
}
|
|
2885
|
+
}, S = function() {
|
|
2886
|
+
return le ||= (ce = bo(u, i), !0), ce;
|
|
2887
|
+
}, pe = n, me = pe.implementation, he = pe.createNodeIterator, ge = pe.createDocumentFragment, _e = pe.getElementsByTagName, ve = r.importNode, C = xo();
|
|
2888
|
+
t.isSupported = typeof ua == "function" && typeof te == "function" && me && me.createHTMLDocument !== void 0;
|
|
2889
|
+
let ye = ro, be = io, xe = ao, Se = oo, Ce = so, we = lo, Te = uo, Ee = po, De = co, w = null, Oe = X({}, [
|
|
2887
2890
|
...Ka,
|
|
2891
|
+
...qa,
|
|
2888
2892
|
...Ja,
|
|
2889
|
-
...Xa
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
...Qa,
|
|
2893
|
+
...Xa,
|
|
2894
|
+
...Qa
|
|
2895
|
+
]), T = null, ke = X({}, [
|
|
2893
2896
|
...$a,
|
|
2894
|
-
...eo
|
|
2895
|
-
|
|
2897
|
+
...eo,
|
|
2898
|
+
...to,
|
|
2899
|
+
...no
|
|
2900
|
+
]), E = Object.seal(ha(null, {
|
|
2896
2901
|
tagNameCheck: {
|
|
2897
2902
|
writable: !0,
|
|
2898
2903
|
configurable: !1,
|
|
@@ -2911,7 +2916,7 @@ function So() {
|
|
|
2911
2916
|
enumerable: !0,
|
|
2912
2917
|
value: !1
|
|
2913
2918
|
}
|
|
2914
|
-
})),
|
|
2919
|
+
})), Ae = null, je = null, Me = Object.seal(ha(null, {
|
|
2915
2920
|
tagCheck: {
|
|
2916
2921
|
writable: !0,
|
|
2917
2922
|
configurable: !1,
|
|
@@ -2924,14 +2929,14 @@ function So() {
|
|
|
2924
2929
|
enumerable: !0,
|
|
2925
2930
|
value: null
|
|
2926
2931
|
}
|
|
2927
|
-
})),
|
|
2932
|
+
})), Ne = !0, Pe = !0, Fe = !1, Ie = !0, D = !1, Le = !0, Re = !1, ze = !1, Be = null, Ve = null, He = !1, Ue = !1, We = !1, Ge = !1, Ke = !0, qe = !1, Je = "user-content-", Ye = !0, O = !1, Xe = null, Ze = {}, Qe = null, $e = 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(".")), et = null, tt = X({}, [
|
|
2928
2933
|
"audio",
|
|
2929
2934
|
"video",
|
|
2930
2935
|
"img",
|
|
2931
2936
|
"source",
|
|
2932
2937
|
"image",
|
|
2933
2938
|
"track"
|
|
2934
|
-
]),
|
|
2939
|
+
]), nt = null, rt = X({}, [
|
|
2935
2940
|
"alt",
|
|
2936
2941
|
"class",
|
|
2937
2942
|
"for",
|
|
@@ -2946,72 +2951,72 @@ function So() {
|
|
|
2946
2951
|
"value",
|
|
2947
2952
|
"style",
|
|
2948
2953
|
"xmlns"
|
|
2949
|
-
]),
|
|
2950
|
-
rt,
|
|
2954
|
+
]), it = "http://www.w3.org/1998/Math/MathML", at = "http://www.w3.org/2000/svg", k = "http://www.w3.org/1999/xhtml", ot = k, st = !1, ct = null, lt = X({}, [
|
|
2951
2955
|
it,
|
|
2952
|
-
|
|
2953
|
-
|
|
2956
|
+
at,
|
|
2957
|
+
k
|
|
2958
|
+
], Aa), ut = G([
|
|
2954
2959
|
"mi",
|
|
2955
2960
|
"mo",
|
|
2956
2961
|
"mn",
|
|
2957
2962
|
"ms",
|
|
2958
2963
|
"mtext"
|
|
2959
|
-
]),
|
|
2964
|
+
]), dt = X({}, ut), A = G(["annotation-xml"]), ft = X({}, A), pt = X({}, [
|
|
2960
2965
|
"title",
|
|
2961
2966
|
"style",
|
|
2962
2967
|
"font",
|
|
2963
2968
|
"a",
|
|
2964
2969
|
"script"
|
|
2965
|
-
]),
|
|
2970
|
+
]), mt = null, ht = ["application/xhtml+xml", "text/html"], j = null, gt = null, _t = n.createElement("form"), vt = function(e) {
|
|
2966
2971
|
return e instanceof RegExp || e instanceof Function;
|
|
2967
|
-
},
|
|
2972
|
+
}, yt = function() {
|
|
2968
2973
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2969
|
-
if (
|
|
2970
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2971
|
-
transform:
|
|
2972
|
-
base:
|
|
2973
|
-
}),
|
|
2974
|
-
transform:
|
|
2975
|
-
base:
|
|
2976
|
-
}),
|
|
2977
|
-
let t =
|
|
2978
|
-
if (
|
|
2974
|
+
if (gt && gt === e) return;
|
|
2975
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), mt = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, j = mt === "application/xhtml+xml" ? Aa : ka, w = So(e, "ALLOWED_TAGS", Oe, { transform: j }), T = So(e, "ALLOWED_ATTR", ke, { transform: j }), ct = So(e, "ALLOWED_NAMESPACES", lt, { transform: Aa }), nt = So(e, "ADD_URI_SAFE_ATTR", rt, {
|
|
2976
|
+
transform: j,
|
|
2977
|
+
base: rt
|
|
2978
|
+
}), et = So(e, "ADD_DATA_URI_TAGS", tt, {
|
|
2979
|
+
transform: j,
|
|
2980
|
+
base: tt
|
|
2981
|
+
}), Qe = So(e, "FORBID_CONTENTS", $e, { transform: j }), Ae = So(e, "FORBID_TAGS", Z({}), { transform: j }), je = So(e, "FORBID_ATTR", Z({}), { transform: j }), Ze = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ie = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, D = e.SAFE_FOR_TEMPLATES || !1, Le = e.SAFE_FOR_XML !== !1, Re = e.WHOLE_DOCUMENT || !1, Ue = e.RETURN_DOM || !1, We = e.RETURN_DOM_FRAGMENT || !1, Ge = e.RETURN_TRUSTED_TYPE || !1, He = e.FORCE_BODY || !1, Ke = e.SANITIZE_DOM !== !1, qe = e.SANITIZE_NAMED_PROPS || !1, Ye = e.KEEP_CONTENT !== !1, O = e.IN_PLACE || !1, De = Ga(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : co, ot = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, dt = Co(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, ut)), ft = Co(e, "HTML_INTEGRATION_POINTS", () => X({}, A));
|
|
2982
|
+
let t = Co(e, "CUSTOM_ELEMENT_HANDLING", () => ha(null));
|
|
2983
|
+
if (E = ha(null), q(t, "tagNameCheck") && vt(t.tagNameCheck) && (E.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && vt(t.attributeNameCheck) && (E.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(E), D && (Pe = !1), We && (Ue = !0), Ze && (w = X({}, Qa), T = ha(null), Ze.html === !0 && (X(w, Ka), X(T, $a)), Ze.svg === !0 && (X(w, qa), X(T, eo), X(T, no)), Ze.svgFilters === !0 && (X(w, Ja), X(T, eo), X(T, no)), Ze.mathMl === !0 && (X(w, Xa), X(T, to), X(T, no))), Me.tagCheck = null, Me.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Me.tagCheck = e.ADD_TAGS : Ta(e.ADD_TAGS) && (w === Oe && (w = Z(w)), X(w, e.ADD_TAGS, j))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Me.attributeCheck = e.ADD_ATTR : Ta(e.ADD_ATTR) && (T === ke && (T = Z(T)), X(T, e.ADD_ATTR, j))), q(e, "ADD_FORBID_CONTENTS") && Ta(e.ADD_FORBID_CONTENTS) && (Qe === $e && (Qe = Z(Qe)), X(Qe, e.ADD_FORBID_CONTENTS, j)), Ye && (w["#text"] = !0), Re && X(w, [
|
|
2979
2984
|
"html",
|
|
2980
2985
|
"head",
|
|
2981
2986
|
"body"
|
|
2982
|
-
]),
|
|
2983
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2984
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2985
|
-
let t =
|
|
2986
|
-
|
|
2987
|
+
]), w.table && (X(w, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2988
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Ba("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2989
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Ba("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2990
|
+
let t = y;
|
|
2991
|
+
y = e.TRUSTED_TYPES_POLICY;
|
|
2987
2992
|
try {
|
|
2988
|
-
|
|
2993
|
+
b = x("");
|
|
2989
2994
|
} catch (e) {
|
|
2990
|
-
throw
|
|
2995
|
+
throw y = t, e;
|
|
2991
2996
|
}
|
|
2992
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
2993
|
-
G && G(e),
|
|
2994
|
-
},
|
|
2995
|
-
...
|
|
2996
|
-
...
|
|
2997
|
-
...
|
|
2998
|
-
]),
|
|
2999
|
-
return t.namespaceURI ===
|
|
3000
|
-
}, St = function(e, t, n) {
|
|
3001
|
-
return t.namespaceURI === A ? e === "math" : t.namespaceURI === it ? e === "math" && dt[n] : !!bt[e];
|
|
2997
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (y = void 0, b = "") : (y === void 0 && (y = S()), y && typeof b == "string" && (b = x("")));
|
|
2998
|
+
G && G(e), gt = e;
|
|
2999
|
+
}, bt = X({}, [
|
|
3000
|
+
...qa,
|
|
3001
|
+
...Ja,
|
|
3002
|
+
...Ya
|
|
3003
|
+
]), xt = X({}, [...Xa, ...Za]), St = function(e, t, n) {
|
|
3004
|
+
return t.namespaceURI === k ? e === "svg" : t.namespaceURI === it ? e === "svg" && (n === "annotation-xml" || dt[n]) : !!bt[e];
|
|
3002
3005
|
}, Ct = function(e, t, n) {
|
|
3003
|
-
return t.namespaceURI ===
|
|
3004
|
-
}, wt = function(e) {
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3006
|
+
return t.namespaceURI === k ? e === "math" : t.namespaceURI === at ? e === "math" && ft[n] : !!xt[e];
|
|
3007
|
+
}, wt = function(e, t, n) {
|
|
3008
|
+
return t.namespaceURI === at && !ft[n] || t.namespaceURI === it && !dt[n] ? !1 : !xt[e] && (pt[e] || !bt[e]);
|
|
3009
|
+
}, Tt = function(e) {
|
|
3010
|
+
let t = se(e), n = ka(ae(e)), r = te(e), i, a;
|
|
3011
|
+
return r && v(r) === $.element ? (i = { namespaceURI: se(r) }, a = ka(ae(r))) : (i = { namespaceURI: ot }, a = "template"), ct[t] ? t === at ? St(n, i, a) : t === it ? Ct(n, i, a) : t === k ? wt(n, i, a) : !!(mt === "application/xhtml+xml" && ct[t]) : !1;
|
|
3012
|
+
}, M = function(e) {
|
|
3013
|
+
Sa(t.removed, { element: e });
|
|
3009
3014
|
try {
|
|
3010
|
-
|
|
3015
|
+
te(e).removeChild(e);
|
|
3011
3016
|
} catch {
|
|
3012
|
-
if (p(e), !
|
|
3017
|
+
if (p(e), !te(e)) throw Ba("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
3013
3018
|
}
|
|
3014
|
-
},
|
|
3019
|
+
}, Et = function(e, t, n) {
|
|
3015
3020
|
try {
|
|
3016
3021
|
ee(e, t);
|
|
3017
3022
|
} catch {
|
|
@@ -3019,18 +3024,18 @@ function So() {
|
|
|
3019
3024
|
e.removeAttribute(n);
|
|
3020
3025
|
} catch {}
|
|
3021
3026
|
}
|
|
3022
|
-
},
|
|
3027
|
+
}, N = function(e) {
|
|
3023
3028
|
At(e);
|
|
3024
|
-
let t =
|
|
3025
|
-
t &&
|
|
3029
|
+
let t = h(e);
|
|
3030
|
+
t && ya(Ca(t), (e) => {
|
|
3026
3031
|
try {
|
|
3027
3032
|
p(e);
|
|
3028
3033
|
} catch {}
|
|
3029
3034
|
});
|
|
3030
|
-
let n =
|
|
3035
|
+
let n = v(e) === $.element ? re(e) : null;
|
|
3031
3036
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
3032
3037
|
let r = n[t], i = r && r.name;
|
|
3033
|
-
typeof i == "string" &&
|
|
3038
|
+
typeof i == "string" && Et(e, r, i);
|
|
3034
3039
|
}
|
|
3035
3040
|
}, Dt = function(e, n, r) {
|
|
3036
3041
|
if (!r) try {
|
|
@@ -3038,7 +3043,7 @@ function So() {
|
|
|
3038
3043
|
} catch {
|
|
3039
3044
|
r = null;
|
|
3040
3045
|
}
|
|
3041
|
-
|
|
3046
|
+
Sa(t.removed, {
|
|
3042
3047
|
attribute: r || null,
|
|
3043
3048
|
from: n
|
|
3044
3049
|
});
|
|
@@ -3050,34 +3055,34 @@ function So() {
|
|
|
3050
3055
|
} catch {}
|
|
3051
3056
|
}
|
|
3052
3057
|
if (e === "is") {
|
|
3053
|
-
if (
|
|
3054
|
-
|
|
3058
|
+
if (Ue || We) try {
|
|
3059
|
+
M(n);
|
|
3055
3060
|
} catch {}
|
|
3056
3061
|
else try {
|
|
3057
3062
|
n.setAttribute(e, "");
|
|
3058
3063
|
} catch {}
|
|
3059
3064
|
}
|
|
3060
3065
|
}, Ot = function(e) {
|
|
3061
|
-
let t =
|
|
3066
|
+
let t = re(e);
|
|
3062
3067
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
3063
3068
|
let r = t[n], i = r && r.name;
|
|
3064
|
-
typeof i != "string" ||
|
|
3069
|
+
typeof i != "string" || T[j(i)] || Et(e, r, i);
|
|
3065
3070
|
}
|
|
3066
3071
|
}, kt = function(e, t) {
|
|
3067
3072
|
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
3068
3073
|
for (; r.length > 0;) {
|
|
3069
3074
|
let e = r.pop();
|
|
3070
3075
|
if (t(e) === !1) continue;
|
|
3071
|
-
if (n &&
|
|
3072
|
-
let t =
|
|
3073
|
-
|
|
3076
|
+
if (n && v(e) === $.element) {
|
|
3077
|
+
let t = ne(e);
|
|
3078
|
+
F(t) && r.push(t);
|
|
3074
3079
|
}
|
|
3075
|
-
let i =
|
|
3080
|
+
let i = h(e);
|
|
3076
3081
|
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
3077
3082
|
}
|
|
3078
3083
|
}, At = function(e) {
|
|
3079
3084
|
kt(e, (e) => {
|
|
3080
|
-
|
|
3085
|
+
v(e) === $.element && Ot(e);
|
|
3081
3086
|
});
|
|
3082
3087
|
}, jt = function(e) {
|
|
3083
3088
|
let t = [];
|
|
@@ -3085,49 +3090,49 @@ function So() {
|
|
|
3085
3090
|
t.push(e);
|
|
3086
3091
|
}, !0), t;
|
|
3087
3092
|
}, Mt = function(e, t) {
|
|
3088
|
-
let n =
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
}),
|
|
3092
|
-
|
|
3093
|
+
let n = Ea();
|
|
3094
|
+
ya(jt(e), (e) => {
|
|
3095
|
+
v(e) === $.element && Da(n, e);
|
|
3096
|
+
}), ya(t, (e) => {
|
|
3097
|
+
v(e) === $.element && !Oa(n, e) && Ot(e);
|
|
3093
3098
|
});
|
|
3094
3099
|
}, Nt = function(e, n) {
|
|
3095
3100
|
let r = !1;
|
|
3096
|
-
return
|
|
3101
|
+
return ya(t.removed, (t) => {
|
|
3097
3102
|
t.element && (r ||= t.element === e, At(t.element));
|
|
3098
3103
|
}), Mt(e, n), r;
|
|
3099
3104
|
}, Pt = function(e, t) {
|
|
3100
|
-
let n =
|
|
3101
|
-
|
|
3105
|
+
let n = Xe, r = null, i = () => (r || (r = Ea(), ya(t, (e) => {
|
|
3106
|
+
Da(r, e);
|
|
3102
3107
|
})), r);
|
|
3103
3108
|
for (let t = 0;; t++) {
|
|
3104
3109
|
let r = jt(e), a = [e], o = !1;
|
|
3105
|
-
if (
|
|
3106
|
-
|
|
3110
|
+
if (ya(r, (e) => {
|
|
3111
|
+
v(e) === $.documentFragment ? Sa(a, e) : !o && !Oa(n, e) && (o = Oa(i(), e));
|
|
3107
3112
|
}), !o) return;
|
|
3108
|
-
if (t >= 8) throw
|
|
3109
|
-
|
|
3113
|
+
if (t >= 8) throw Ba("the tree kept changing during in-place sanitization; refusing to return it");
|
|
3114
|
+
ya(a, (t, n) => {
|
|
3110
3115
|
Ft(t, n > 0, e, i());
|
|
3111
3116
|
});
|
|
3112
3117
|
}
|
|
3113
3118
|
}, Ft = function(e, t, n, r) {
|
|
3114
3119
|
let i = Bt(e), a;
|
|
3115
|
-
for (; a = i.nextNode();)
|
|
3120
|
+
for (; a = i.nextNode();) Oa(r, a) && !Oa(Xe, a) && (t && I(C.uponSanitizeShadowNode, a, null), Xt(a, n), rn(a, n), F(a.content) && L(a.content));
|
|
3116
3121
|
}, It = function(e) {
|
|
3117
|
-
|
|
3122
|
+
Xe && Da(Xe, e);
|
|
3118
3123
|
}, Lt = function(e, t) {
|
|
3119
|
-
return
|
|
3124
|
+
return Le ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
3120
3125
|
}, Rt = function(e) {
|
|
3121
|
-
|
|
3122
|
-
let t =
|
|
3123
|
-
if (t === $.processingInstruction || t === $.comment && J(
|
|
3126
|
+
Le && kt(e, (e) => {
|
|
3127
|
+
let t = v(e);
|
|
3128
|
+
if (t === $.processingInstruction || t === $.comment && J(ho, e.data)) {
|
|
3124
3129
|
try {
|
|
3125
3130
|
p(e);
|
|
3126
3131
|
} catch {}
|
|
3127
3132
|
return !1;
|
|
3128
3133
|
}
|
|
3129
3134
|
if (t === $.element) {
|
|
3130
|
-
let t = e, n =
|
|
3135
|
+
let t = e, n = j(ae(e));
|
|
3131
3136
|
try {
|
|
3132
3137
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Lt("for", n) && t.removeAttribute("for");
|
|
3133
3138
|
} catch {}
|
|
@@ -3136,70 +3141,70 @@ function So() {
|
|
|
3136
3141
|
});
|
|
3137
3142
|
}, zt = function(e) {
|
|
3138
3143
|
let t = null, r = null;
|
|
3139
|
-
if (
|
|
3144
|
+
if (He) e = "<remove></remove>" + e;
|
|
3140
3145
|
else {
|
|
3141
|
-
let t =
|
|
3146
|
+
let t = ja(e, /^[\r\n\t ]+/);
|
|
3142
3147
|
r = t && t[0];
|
|
3143
3148
|
}
|
|
3144
|
-
|
|
3145
|
-
let i =
|
|
3146
|
-
if (
|
|
3147
|
-
t = new l().parseFromString(i,
|
|
3149
|
+
mt === "application/xhtml+xml" && ot === k && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
3150
|
+
let i = y ? x(e) : e;
|
|
3151
|
+
if (ot === k) try {
|
|
3152
|
+
t = new l().parseFromString(i, mt);
|
|
3148
3153
|
} catch {}
|
|
3149
3154
|
if (!t || !t.documentElement) {
|
|
3150
|
-
t =
|
|
3155
|
+
t = me.createDocument(ot, "template", null);
|
|
3151
3156
|
try {
|
|
3152
|
-
t.documentElement.innerHTML =
|
|
3157
|
+
t.documentElement.innerHTML = st ? b : i;
|
|
3153
3158
|
} catch {}
|
|
3154
3159
|
}
|
|
3155
3160
|
let a = t.body || t.documentElement;
|
|
3156
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
3161
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ot === k ? _e.call(t, Re ? "html" : "body")[0] : Re ? t.documentElement : a;
|
|
3157
3162
|
}, Bt = function(e) {
|
|
3158
|
-
let t =
|
|
3159
|
-
return
|
|
3163
|
+
let t = _ ? _(e) : e.ownerDocument;
|
|
3164
|
+
return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
3160
3165
|
}, Vt = function(e) {
|
|
3161
|
-
return e =
|
|
3162
|
-
},
|
|
3163
|
-
|
|
3166
|
+
return e = Ma(e, ye, " "), e = Ma(e, be, " "), e = Ma(e, xe, " "), e;
|
|
3167
|
+
}, Ht = function(e) {
|
|
3168
|
+
Ut(e);
|
|
3164
3169
|
let t = e.querySelectorAll?.call(e, "template");
|
|
3165
|
-
t &&
|
|
3166
|
-
|
|
3170
|
+
t && ya(t, (e) => {
|
|
3171
|
+
F(e.content) && Ht(e.content);
|
|
3167
3172
|
});
|
|
3168
|
-
},
|
|
3173
|
+
}, Ut = function(e) {
|
|
3169
3174
|
e.normalize();
|
|
3170
|
-
let t =
|
|
3175
|
+
let t = _ ? _(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();
|
|
3171
3176
|
for (; r;) r.data = Vt(r.data), r = n.nextNode();
|
|
3172
|
-
},
|
|
3177
|
+
}, P = function(e) {
|
|
3173
3178
|
let t = g ? g(e) : null;
|
|
3174
|
-
return typeof t != "string" ||
|
|
3175
|
-
},
|
|
3176
|
-
if (!
|
|
3179
|
+
return typeof t != "string" || j(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== re(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 !== ie(e) || e.childNodes !== h(e);
|
|
3180
|
+
}, F = function(e) {
|
|
3181
|
+
if (!ie || typeof e != "object" || !e) return !1;
|
|
3177
3182
|
try {
|
|
3178
|
-
return
|
|
3183
|
+
return ie(e) === $.documentFragment;
|
|
3179
3184
|
} catch {
|
|
3180
3185
|
return !1;
|
|
3181
3186
|
}
|
|
3182
|
-
},
|
|
3183
|
-
if (!
|
|
3187
|
+
}, Wt = function(e) {
|
|
3188
|
+
if (!ie || typeof e != "object" || !e) return !1;
|
|
3184
3189
|
try {
|
|
3185
|
-
return typeof
|
|
3190
|
+
return typeof ie(e) == "number";
|
|
3186
3191
|
} catch {
|
|
3187
3192
|
return !1;
|
|
3188
3193
|
}
|
|
3189
3194
|
};
|
|
3190
3195
|
function I(e, n, r) {
|
|
3191
|
-
e.length !== 0 &&
|
|
3192
|
-
e.call(t, n, r,
|
|
3196
|
+
e.length !== 0 && ya(e, (e) => {
|
|
3197
|
+
e.call(t, n, r, gt);
|
|
3193
3198
|
});
|
|
3194
3199
|
}
|
|
3195
3200
|
let Gt = function(e, t) {
|
|
3196
|
-
return !!(
|
|
3201
|
+
return !!(Le && e.hasChildNodes() && !Wt(e.firstElementChild) && J(mo, e.textContent) && J(mo, e.innerHTML) || Le && vo[t] && v(e) === $.element && se(e) === k && (Wt(e.firstElementChild) || typeof e.textContent == "string" && J(mo, e.textContent)) || e.nodeType === $.processingInstruction || Le && e.nodeType === $.comment && J(ho, e.data));
|
|
3197
3202
|
}, Kt = function(e, t) {
|
|
3198
3203
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
3199
3204
|
}, qt = function(e, t, n) {
|
|
3200
|
-
if (!
|
|
3201
|
-
if (
|
|
3202
|
-
let t =
|
|
3205
|
+
if (!Ae[t] && $t(t) && Kt(E.tagNameCheck, t)) return !1;
|
|
3206
|
+
if (Ye && !Qe[t] && !Qe[ka(t)]) {
|
|
3207
|
+
let t = te(e), r = h(e);
|
|
3203
3208
|
if (r && t) {
|
|
3204
3209
|
let i = r.length;
|
|
3205
3210
|
for (let a = i - 1; a >= 0; --a) {
|
|
@@ -3208,34 +3213,34 @@ function So() {
|
|
|
3208
3213
|
}
|
|
3209
3214
|
}
|
|
3210
3215
|
}
|
|
3211
|
-
return
|
|
3216
|
+
return M(e), !0;
|
|
3212
3217
|
}, Jt = function(e, t, n, r) {
|
|
3213
3218
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
3214
3219
|
}, Yt = function(e, t) {
|
|
3215
|
-
return e === t ||
|
|
3220
|
+
return e === t || te(e) !== null ? !1 : (O && At(e), !0);
|
|
3216
3221
|
}, Xt = function(e, n) {
|
|
3217
|
-
if (It(e), I(
|
|
3218
|
-
if (
|
|
3219
|
-
let r =
|
|
3220
|
-
if (
|
|
3222
|
+
if (It(e), I(C.beforeSanitizeElements, e, null), Yt(e, n)) return !0;
|
|
3223
|
+
if (P(e)) return M(e), !0;
|
|
3224
|
+
let r = j(ae(e));
|
|
3225
|
+
if (w = Jt(C.uponSanitizeElement, w, Oe, Be), I(C.uponSanitizeElement, e, {
|
|
3221
3226
|
tagName: r,
|
|
3222
|
-
allowedTags:
|
|
3227
|
+
allowedTags: w
|
|
3223
3228
|
}), Yt(e, n)) return !0;
|
|
3224
|
-
if (Gt(e, r)) return
|
|
3225
|
-
if (
|
|
3229
|
+
if (Gt(e, r)) return M(e), !0;
|
|
3230
|
+
if (Ae[r] || !(Me.tagCheck instanceof Function && Me.tagCheck(r)) && !w[r]) {
|
|
3226
3231
|
let t = qt(e, r, n);
|
|
3227
|
-
return t === !1 && (I(
|
|
3232
|
+
return t === !1 && (I(C.afterSanitizeElements, e, null), Yt(e, n)) ? !0 : t;
|
|
3228
3233
|
}
|
|
3229
|
-
if (
|
|
3230
|
-
if (
|
|
3234
|
+
if (v(e) === $.element && !Tt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(go, e.innerHTML)) return M(e), !0;
|
|
3235
|
+
if (D && e.nodeType === $.text) {
|
|
3231
3236
|
let n = Vt(e.textContent);
|
|
3232
|
-
e.textContent !== n && (
|
|
3237
|
+
e.textContent !== n && (Sa(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
3233
3238
|
}
|
|
3234
|
-
return I(
|
|
3239
|
+
return I(C.afterSanitizeElements, e, null), Yt(e, n);
|
|
3235
3240
|
}, Zt = function(e, t, r) {
|
|
3236
|
-
if (
|
|
3237
|
-
let i =
|
|
3238
|
-
return
|
|
3241
|
+
if (je[t] || Lt(t, e) || Ke && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
|
|
3242
|
+
let i = T[t] || Me.attributeCheck instanceof Function && Me.attributeCheck(t, e);
|
|
3243
|
+
return Pe && J(Se, t) || Ne && J(Ce, t) ? !0 : i ? nt[t] || J(De, Ma(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Na(r, "data:") === 0 && et[e] || Fe && !J(we, Ma(r, Te, "")) ? !0 : !r : $t(e) && Kt(E.tagNameCheck, e) && Kt(E.attributeNameCheck, t, e) || t === "is" && E.allowCustomizedBuiltInElements && Kt(E.tagNameCheck, r);
|
|
3239
3244
|
}, Qt = X({}, [
|
|
3240
3245
|
"annotation-xml",
|
|
3241
3246
|
"color-profile",
|
|
@@ -3246,45 +3251,45 @@ function So() {
|
|
|
3246
3251
|
"font-face-uri",
|
|
3247
3252
|
"missing-glyph"
|
|
3248
3253
|
]), $t = function(e) {
|
|
3249
|
-
return !Qt[
|
|
3254
|
+
return !Qt[ka(e)] && J(Ee, e);
|
|
3250
3255
|
}, en = function(e, t, n, r) {
|
|
3251
|
-
if (
|
|
3252
|
-
case "TrustedHTML": return
|
|
3253
|
-
case "TrustedScriptURL": return
|
|
3256
|
+
if (y && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3257
|
+
case "TrustedHTML": return x(r);
|
|
3258
|
+
case "TrustedScriptURL": return fe(r);
|
|
3254
3259
|
}
|
|
3255
3260
|
return r;
|
|
3256
3261
|
}, tn = function(e, t, n, r) {
|
|
3257
3262
|
try {
|
|
3258
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
3263
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !P(e) || (M(e), !1);
|
|
3259
3264
|
} catch {
|
|
3260
3265
|
return Dt(t, e), !1;
|
|
3261
3266
|
}
|
|
3262
|
-
},
|
|
3263
|
-
return
|
|
3264
|
-
},
|
|
3265
|
-
if (I(
|
|
3267
|
+
}, nn = function(e, t) {
|
|
3268
|
+
return Le && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : ka(e) === "attributename" && ja(t, "href") !== null;
|
|
3269
|
+
}, rn = function(e, n) {
|
|
3270
|
+
if (I(C.beforeSanitizeAttributes, e, null), Yt(e, n)) return;
|
|
3266
3271
|
let r = e.attributes;
|
|
3267
|
-
if (!r ||
|
|
3268
|
-
|
|
3272
|
+
if (!r || P(e)) return;
|
|
3273
|
+
T = Jt(C.uponSanitizeAttribute, T, ke, Ve);
|
|
3269
3274
|
let i = {
|
|
3270
3275
|
attrName: "",
|
|
3271
3276
|
attrValue: "",
|
|
3272
3277
|
keepAttr: !0,
|
|
3273
|
-
allowedAttributes:
|
|
3278
|
+
allowedAttributes: T,
|
|
3274
3279
|
forceKeepAttr: void 0
|
|
3275
|
-
}, a = r.length, o =
|
|
3280
|
+
}, a = r.length, o = j(e.nodeName);
|
|
3276
3281
|
for (; a--;) {
|
|
3277
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
3278
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(
|
|
3282
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = j(s), d = l, f = s === "value" ? d : Pa(d), p = !1;
|
|
3283
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(C.uponSanitizeAttribute, e, i), f = i.attrValue, qe && (u === "id" || u === "name") && Na(f, Je) !== 0 && (Dt(s, e, n), f = Je + f, p = !0), nn(s, f) ? Dt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Ie && J(_o, f) ? Dt(s, e, n) : (D && (f = Vt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && xa(t.removed)) : Dt(s, e, n)) : Dt(s, e, n));
|
|
3279
3284
|
}
|
|
3280
|
-
I(
|
|
3281
|
-
},
|
|
3285
|
+
I(C.afterSanitizeAttributes, e, null), Yt(e, n);
|
|
3286
|
+
}, L = function(e) {
|
|
3282
3287
|
let t = null, n = Bt(e);
|
|
3283
|
-
for (I(
|
|
3284
|
-
let e =
|
|
3285
|
-
|
|
3288
|
+
for (I(C.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(C.uponSanitizeShadowNode, t, null), Xt(t, e), rn(t, e), F(t.content) && L(t.content), v(t) === $.element) {
|
|
3289
|
+
let e = ne(t);
|
|
3290
|
+
F(e) && (an(e), L(e));
|
|
3286
3291
|
}
|
|
3287
|
-
|
|
3292
|
+
D && Ut(e), I(C.afterSanitizeShadowDOM, e, null);
|
|
3288
3293
|
}, an = function(e) {
|
|
3289
3294
|
let t = [{
|
|
3290
3295
|
node: e,
|
|
@@ -3293,27 +3298,27 @@ function So() {
|
|
|
3293
3298
|
for (; t.length > 0;) {
|
|
3294
3299
|
let e = t.pop();
|
|
3295
3300
|
if (e.shadow) {
|
|
3296
|
-
|
|
3301
|
+
L(e.shadow);
|
|
3297
3302
|
continue;
|
|
3298
3303
|
}
|
|
3299
|
-
let n = e.node, r =
|
|
3304
|
+
let n = e.node, r = v(n) === $.element, i = h(n);
|
|
3300
3305
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
3301
3306
|
node: i[e],
|
|
3302
3307
|
shadow: null
|
|
3303
3308
|
});
|
|
3304
3309
|
if (r) {
|
|
3305
3310
|
let e = g ? g(n) : null;
|
|
3306
|
-
if (typeof e == "string" &&
|
|
3311
|
+
if (typeof e == "string" && j(e) === "template") {
|
|
3307
3312
|
let e = n.content;
|
|
3308
|
-
|
|
3313
|
+
F(e) && t.push({
|
|
3309
3314
|
node: e,
|
|
3310
3315
|
shadow: null
|
|
3311
3316
|
});
|
|
3312
3317
|
}
|
|
3313
3318
|
}
|
|
3314
3319
|
if (r) {
|
|
3315
|
-
let e =
|
|
3316
|
-
|
|
3320
|
+
let e = ne(n);
|
|
3321
|
+
F(e) && t.push({
|
|
3317
3322
|
node: null,
|
|
3318
3323
|
shadow: e
|
|
3319
3324
|
}, {
|
|
@@ -3325,82 +3330,82 @@ function So() {
|
|
|
3325
3330
|
};
|
|
3326
3331
|
return t.sanitize = function(e) {
|
|
3327
3332
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3328
|
-
if (
|
|
3333
|
+
if (st = !e, st && (e = "<!-->"), typeof e != "string" && !Wt(e) && (e = Ua(e), typeof e != "string")) throw Ba("dirty is not a string, aborting");
|
|
3329
3334
|
if (!t.isSupported) return e;
|
|
3330
|
-
|
|
3331
|
-
let c =
|
|
3335
|
+
ze ? (w = Be, T = Ve) : yt(n), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (w = Z(w)), C.uponSanitizeAttribute.length > 0 && (T = Z(T)), t.removed = [];
|
|
3336
|
+
let c = O && typeof e != "string" && Wt(e), l = [], u = Xe;
|
|
3332
3337
|
if (c) {
|
|
3333
3338
|
Rt(e);
|
|
3334
|
-
let t =
|
|
3339
|
+
let t = ae(e);
|
|
3335
3340
|
if (typeof t == "string") {
|
|
3336
|
-
let n =
|
|
3337
|
-
if (!
|
|
3341
|
+
let n = j(t);
|
|
3342
|
+
if (!w[n] || Ae[n]) throw N(e), Ba("root node is forbidden and cannot be sanitized in-place");
|
|
3338
3343
|
}
|
|
3339
|
-
if (
|
|
3340
|
-
l = jt(e),
|
|
3341
|
-
} else if (
|
|
3344
|
+
if (P(e)) throw N(e), Ba("root node is clobbered and cannot be sanitized in-place");
|
|
3345
|
+
l = jt(e), Xe = Ea();
|
|
3346
|
+
} else if (Wt(e)) i = zt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), an(i);
|
|
3342
3347
|
else {
|
|
3343
|
-
if (!
|
|
3344
|
-
if (i = zt(e), !i) return
|
|
3348
|
+
if (!Ue && !D && !Re && e.indexOf("<") === -1) return y && Ge ? x(e) : e;
|
|
3349
|
+
if (i = zt(e), !i) return Ue ? null : Ge ? b : "";
|
|
3345
3350
|
}
|
|
3346
|
-
i &&
|
|
3351
|
+
i && He && M(i.firstChild);
|
|
3347
3352
|
let d = c ? e : i;
|
|
3348
3353
|
try {
|
|
3349
3354
|
c && an(e);
|
|
3350
3355
|
let t = Bt(d);
|
|
3351
|
-
for (; o = t.nextNode();) Xt(o, d),
|
|
3356
|
+
for (; o = t.nextNode();) Xt(o, d), rn(o, d), F(o.content) && L(o.content);
|
|
3352
3357
|
c && Pt(e, l);
|
|
3353
3358
|
} catch (t) {
|
|
3354
|
-
throw c && (
|
|
3359
|
+
throw c && (N(e), Nt(e, l)), t;
|
|
3355
3360
|
} finally {
|
|
3356
|
-
|
|
3361
|
+
Xe = u;
|
|
3357
3362
|
}
|
|
3358
3363
|
if (c) {
|
|
3359
|
-
if (Nt(e, l)) throw
|
|
3360
|
-
return
|
|
3364
|
+
if (Nt(e, l)) throw Ba("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3365
|
+
return D && Ht(e), e;
|
|
3361
3366
|
}
|
|
3362
|
-
if (
|
|
3363
|
-
if (
|
|
3367
|
+
if (Ue) {
|
|
3368
|
+
if (D && Ht(i), We) for (s = ge.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3364
3369
|
else s = i;
|
|
3365
|
-
return (
|
|
3370
|
+
return (T.shadowroot || T.shadowrootmode) && (s = ve.call(r, s, !0)), s;
|
|
3366
3371
|
}
|
|
3367
|
-
let f =
|
|
3368
|
-
return
|
|
3372
|
+
let f = Re ? i.outerHTML : i.innerHTML;
|
|
3373
|
+
return Re && w["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(fo, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), D && (f = Vt(f)), y && Ge ? x(f) : f;
|
|
3369
3374
|
}, t.setConfig = function() {
|
|
3370
3375
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3371
|
-
|
|
3376
|
+
yt(e), ze = !0, Be = w, Ve = T;
|
|
3372
3377
|
}, t.clearConfig = function() {
|
|
3373
|
-
|
|
3378
|
+
gt = null, ze = !1, Be = null, Ve = null, y = ce, b = "";
|
|
3374
3379
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3375
|
-
|
|
3376
|
-
let r =
|
|
3377
|
-
return typeof n == "string" && (
|
|
3380
|
+
gt || yt({});
|
|
3381
|
+
let r = j(e), i = j(t);
|
|
3382
|
+
return typeof n == "string" && (nn(t, n) || !Ie && J(_o, n)) ? !1 : Zt(r, i, n);
|
|
3378
3383
|
}, t.addHook = function(e, t) {
|
|
3379
|
-
typeof t == "function" && q(
|
|
3384
|
+
typeof t == "function" && q(C, e) && Sa(C[e], t);
|
|
3380
3385
|
}, t.removeHook = function(e, t) {
|
|
3381
|
-
if (q(
|
|
3386
|
+
if (q(C, e)) {
|
|
3382
3387
|
if (t !== void 0) {
|
|
3383
|
-
let n =
|
|
3384
|
-
return n === -1 ? void 0 :
|
|
3388
|
+
let n = ba(C[e], t);
|
|
3389
|
+
return n === -1 ? void 0 : wa(C[e], n, 1)[0];
|
|
3385
3390
|
}
|
|
3386
|
-
return
|
|
3391
|
+
return xa(C[e]);
|
|
3387
3392
|
}
|
|
3388
3393
|
}, t.removeHooks = function(e) {
|
|
3389
|
-
q(
|
|
3394
|
+
q(C, e) && (C[e] = []);
|
|
3390
3395
|
}, t.removeAllHooks = function() {
|
|
3391
|
-
|
|
3396
|
+
C = xo();
|
|
3392
3397
|
}, t;
|
|
3393
3398
|
}
|
|
3394
|
-
var
|
|
3399
|
+
var To = wo();
|
|
3395
3400
|
//#endregion
|
|
3396
3401
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3397
|
-
function
|
|
3402
|
+
function Eo(e) {
|
|
3398
3403
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3399
3404
|
}
|
|
3400
|
-
function
|
|
3405
|
+
function Do(e, t) {
|
|
3401
3406
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3402
3407
|
}
|
|
3403
|
-
var
|
|
3408
|
+
var Oo = {
|
|
3404
3409
|
ADD_ATTR: ["target"],
|
|
3405
3410
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3406
3411
|
FORBID_TAGS: [
|
|
@@ -3421,21 +3426,21 @@ var Eo = {
|
|
|
3421
3426
|
"background"
|
|
3422
3427
|
]
|
|
3423
3428
|
};
|
|
3424
|
-
|
|
3429
|
+
To.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3425
3430
|
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3426
3431
|
});
|
|
3427
|
-
var
|
|
3428
|
-
function
|
|
3429
|
-
if (!t) return
|
|
3430
|
-
let n =
|
|
3431
|
-
...
|
|
3432
|
+
var ko = "data-held-src";
|
|
3433
|
+
function Ao(e, t) {
|
|
3434
|
+
if (!t) return To.sanitize(e, Oo);
|
|
3435
|
+
let n = To.sanitize(e, {
|
|
3436
|
+
...Oo,
|
|
3432
3437
|
RETURN_DOM_FRAGMENT: !0
|
|
3433
3438
|
});
|
|
3434
3439
|
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3435
3440
|
let n = e.getAttribute("src") ?? "";
|
|
3436
3441
|
if (t.canLoad(n)) continue;
|
|
3437
3442
|
let r = e.ownerDocument.createElement("button");
|
|
3438
|
-
r.type = "button", r.className = "markdown-held-image", r.setAttribute(
|
|
3443
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(ko, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3439
3444
|
}
|
|
3440
3445
|
let r = n.ownerDocument.createElement("div");
|
|
3441
3446
|
return r.append(n), r.innerHTML;
|
|
@@ -3443,7 +3448,7 @@ function Oo(e, t) {
|
|
|
3443
3448
|
//#endregion
|
|
3444
3449
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3445
3450
|
c(), o();
|
|
3446
|
-
var
|
|
3451
|
+
var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
3447
3452
|
__name: "PkStreamingMarkdown",
|
|
3448
3453
|
props: {
|
|
3449
3454
|
markdown: {
|
|
@@ -3473,14 +3478,14 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3473
3478
|
},
|
|
3474
3479
|
setup(o) {
|
|
3475
3480
|
let c = o, { t: l } = f({ useScope: "global" }), m = null;
|
|
3476
|
-
function
|
|
3481
|
+
function h() {
|
|
3477
3482
|
return m ||= import("./dist-BK6ru3gS.js"), m;
|
|
3478
3483
|
}
|
|
3479
|
-
let
|
|
3480
|
-
function
|
|
3481
|
-
return
|
|
3484
|
+
let te = null;
|
|
3485
|
+
function ne() {
|
|
3486
|
+
return te ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), te;
|
|
3482
3487
|
}
|
|
3483
|
-
let
|
|
3488
|
+
let re = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ie = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3484
3489
|
W.use({ extensions: [{
|
|
3485
3490
|
name: "inlineKatex",
|
|
3486
3491
|
level: "inline",
|
|
@@ -3489,7 +3494,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3489
3494
|
if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
|
|
3490
3495
|
},
|
|
3491
3496
|
tokenizer(e) {
|
|
3492
|
-
let t = e.match(
|
|
3497
|
+
let t = e.match(re);
|
|
3493
3498
|
if (t) return {
|
|
3494
3499
|
type: "inlineKatex",
|
|
3495
3500
|
raw: t[0],
|
|
@@ -3498,13 +3503,13 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3498
3503
|
};
|
|
3499
3504
|
},
|
|
3500
3505
|
renderer(e) {
|
|
3501
|
-
return
|
|
3506
|
+
return Do(e.text, e.displayMode);
|
|
3502
3507
|
}
|
|
3503
3508
|
}, {
|
|
3504
3509
|
name: "blockKatex",
|
|
3505
3510
|
level: "block",
|
|
3506
3511
|
tokenizer(e) {
|
|
3507
|
-
let t = e.match(
|
|
3512
|
+
let t = e.match(ie);
|
|
3508
3513
|
if (t) return {
|
|
3509
3514
|
type: "blockKatex",
|
|
3510
3515
|
raw: t[0],
|
|
@@ -3513,7 +3518,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3513
3518
|
};
|
|
3514
3519
|
},
|
|
3515
3520
|
renderer(e) {
|
|
3516
|
-
return
|
|
3521
|
+
return Do(e.text, e.displayMode) + "\n";
|
|
3517
3522
|
}
|
|
3518
3523
|
}] }), W.use({ extensions: [{
|
|
3519
3524
|
name: "thinking",
|
|
@@ -3534,30 +3539,30 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3534
3539
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3535
3540
|
}
|
|
3536
3541
|
}] });
|
|
3537
|
-
let g = new W.Renderer(),
|
|
3542
|
+
let g = new W.Renderer(), _ = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), se = /^(?:javascript|data|vbscript|file):/i, b = !1, ce = (e) => _(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3538
3543
|
g.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3539
3544
|
let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3540
|
-
if (!a ||
|
|
3541
|
-
let o =
|
|
3542
|
-
return `<a href="${
|
|
3545
|
+
if (!a || se.test(a)) return i;
|
|
3546
|
+
let o = b && n === a, s = t || (o ? a : ""), c = s ? ` title="${_(s)}"` : "", l = v(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3547
|
+
return `<a href="${_(a)}"${c}${l}>${o ? ce(a) : i}</a>`;
|
|
3543
3548
|
}, g.table = function(e) {
|
|
3544
|
-
|
|
3549
|
+
b = !0;
|
|
3545
3550
|
try {
|
|
3546
|
-
let t = e.header.map((e) =>
|
|
3551
|
+
let t = e.header.map((e) => _(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3547
3552
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3548
3553
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3549
3554
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3550
3555
|
return `<div class="table-wrapper u-table-scroll"><table class="${e.header.length >= 3 && e.rows.length ? "u-table u-table--stack" : "u-table"}" role="table"><thead role="rowgroup">${n(e.header)}</thead>${r}</table></div>\n`;
|
|
3551
3556
|
} finally {
|
|
3552
|
-
|
|
3557
|
+
b = !1;
|
|
3553
3558
|
}
|
|
3554
3559
|
};
|
|
3555
|
-
let
|
|
3556
|
-
g.code = ({ text: e }) =>
|
|
3557
|
-
function
|
|
3560
|
+
let le = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3561
|
+
g.code = ({ text: e }) => le.test(e) ? `<pre class="mermaid">${Eo(e)}</pre>` : `<pre><code>${Eo(e)}</code></pre>`;
|
|
3562
|
+
function de(e) {
|
|
3558
3563
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3559
3564
|
}
|
|
3560
|
-
function
|
|
3565
|
+
function x(e) {
|
|
3561
3566
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
3562
3567
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
3563
3568
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -3569,33 +3574,33 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3569
3574
|
}
|
|
3570
3575
|
}).replace(/\n{3,}/g, "\n\n");
|
|
3571
3576
|
}
|
|
3572
|
-
let
|
|
3577
|
+
let fe = [
|
|
3573
3578
|
ue,
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
],
|
|
3578
|
-
let e =
|
|
3579
|
-
return
|
|
3579
|
+
x,
|
|
3580
|
+
pr,
|
|
3581
|
+
de
|
|
3582
|
+
], S = i("container"), pe = ae(d(c, "markdown"), Mo), me = s(() => c.tailLength ? E(pe.value, c.tailLength) : pe.value), { resolveText: he } = oe(), ge = he(me), _e = y(), ve = s(() => {
|
|
3583
|
+
let e = fe.reduce((e, t) => t(e), ge.value);
|
|
3584
|
+
return Ao(W.parse(e, {
|
|
3580
3585
|
async: !1,
|
|
3581
3586
|
breaks: !0,
|
|
3582
3587
|
renderer: g
|
|
3583
|
-
}),
|
|
3584
|
-
canLoad:
|
|
3585
|
-
hostOf:
|
|
3588
|
+
}), _e.isGated.value ? {
|
|
3589
|
+
canLoad: _e.canLoad,
|
|
3590
|
+
hostOf: _e.hostOf,
|
|
3586
3591
|
label: (e) => l("label.imageHeld", { host: e })
|
|
3587
3592
|
} : void 0);
|
|
3588
3593
|
});
|
|
3589
|
-
function
|
|
3590
|
-
let t = (e.target?.closest?.(`[${
|
|
3591
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
3594
|
+
function C(e) {
|
|
3595
|
+
let t = (e.target?.closest?.(`[${ko}]`))?.getAttribute(ko);
|
|
3596
|
+
t && (e.preventDefault(), e.stopPropagation(), _e.release(t));
|
|
3592
3597
|
}
|
|
3593
|
-
async function
|
|
3598
|
+
async function ye() {
|
|
3594
3599
|
if (c.loading) return;
|
|
3595
3600
|
await n();
|
|
3596
|
-
let e =
|
|
3601
|
+
let e = S.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
3597
3602
|
if (!e?.length) return;
|
|
3598
|
-
let { renderMermaidSVG: t, THEMES: r } = await
|
|
3603
|
+
let { renderMermaidSVG: t, THEMES: r } = await h(), i = c.isDark ? r["github-dark"] : r["github-light"];
|
|
3599
3604
|
for (let n of Array.from(e)) {
|
|
3600
3605
|
if (!n.isConnected) continue;
|
|
3601
3606
|
let e = n.textContent?.trim();
|
|
@@ -3605,19 +3610,19 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3605
3610
|
} catch {}
|
|
3606
3611
|
}
|
|
3607
3612
|
}
|
|
3608
|
-
async function
|
|
3613
|
+
async function be() {
|
|
3609
3614
|
await n();
|
|
3610
|
-
let e =
|
|
3615
|
+
let e = S.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3611
3616
|
if (!e?.length) return;
|
|
3612
3617
|
let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
|
|
3613
3618
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3614
3619
|
}
|
|
3615
|
-
async function
|
|
3620
|
+
async function xe() {
|
|
3616
3621
|
await n();
|
|
3617
|
-
let e =
|
|
3622
|
+
let e = S.value?.querySelectorAll(".katex-pending");
|
|
3618
3623
|
if (!e?.length) return;
|
|
3619
|
-
let t = await
|
|
3620
|
-
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(
|
|
3624
|
+
let t = await ne();
|
|
3625
|
+
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(S.value));
|
|
3621
3626
|
for (let n of Array.from(e)) {
|
|
3622
3627
|
if (!n.isConnected) continue;
|
|
3623
3628
|
let e = n.dataset.katex;
|
|
@@ -3631,11 +3636,11 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3631
3636
|
} catch {}
|
|
3632
3637
|
}
|
|
3633
3638
|
}
|
|
3634
|
-
async function
|
|
3639
|
+
async function Se() {
|
|
3635
3640
|
await n();
|
|
3636
|
-
let e =
|
|
3641
|
+
let e = S.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3637
3642
|
if (!e?.length) return;
|
|
3638
|
-
let { renderMermaidSVG: t, THEMES: r } = await
|
|
3643
|
+
let { renderMermaidSVG: t, THEMES: r } = await h(), i = c.isDark ? r["github-dark"] : r["github-light"];
|
|
3639
3644
|
for (let n of Array.from(e)) {
|
|
3640
3645
|
if (!n.isConnected) continue;
|
|
3641
3646
|
let e = n.dataset.code;
|
|
@@ -3644,7 +3649,7 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3644
3649
|
} catch {}
|
|
3645
3650
|
}
|
|
3646
3651
|
}
|
|
3647
|
-
function
|
|
3652
|
+
function Ce(e) {
|
|
3648
3653
|
let t = e.target;
|
|
3649
3654
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3650
3655
|
t.dataset.broken = "true";
|
|
@@ -3652,60 +3657,60 @@ var ko = ["innerHTML"], Ao = 100, jo = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3652
3657
|
n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3653
3658
|
}
|
|
3654
3659
|
t(() => {
|
|
3655
|
-
|
|
3660
|
+
S.value?.addEventListener("error", Ce, !0);
|
|
3656
3661
|
}), e(() => {
|
|
3657
|
-
|
|
3658
|
-
}), a([
|
|
3659
|
-
let
|
|
3660
|
-
function
|
|
3662
|
+
S.value?.removeEventListener("error", Ce, !0);
|
|
3663
|
+
}), a([ve, () => c.loading], ye, { immediate: !0 }), a(() => c.isDark, Se), a(ve, be, { immediate: !0 }), a(ve, xe, { immediate: !0 });
|
|
3664
|
+
let we = 0;
|
|
3665
|
+
function Te(e, t) {
|
|
3661
3666
|
let n = document.createElement("span");
|
|
3662
3667
|
return n.style.cssText = `animation:ft-${c.animation} ${c.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3663
3668
|
let t = n.parentNode;
|
|
3664
3669
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3665
3670
|
}, { once: !0 }), n;
|
|
3666
3671
|
}
|
|
3667
|
-
function
|
|
3672
|
+
function Ee(e, t, n, r) {
|
|
3668
3673
|
let i = r, a = e.split(/(\s+)/);
|
|
3669
|
-
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(
|
|
3674
|
+
for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Te(e, i * 30), n), i++));
|
|
3670
3675
|
return i;
|
|
3671
3676
|
}
|
|
3672
|
-
function
|
|
3677
|
+
function De(e) {
|
|
3673
3678
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3674
3679
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3675
3680
|
} }), n = [];
|
|
3676
3681
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3677
3682
|
return n;
|
|
3678
3683
|
}
|
|
3679
|
-
function
|
|
3680
|
-
if (!
|
|
3681
|
-
let e =
|
|
3684
|
+
function w() {
|
|
3685
|
+
if (!S.value || !c.loading || !c.animation) return;
|
|
3686
|
+
let e = De(S.value), t = 0, n = 0;
|
|
3682
3687
|
for (let r of e) {
|
|
3683
3688
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3684
|
-
if (t = a, a <=
|
|
3689
|
+
if (t = a, a <= we) continue;
|
|
3685
3690
|
let o = r.parentNode;
|
|
3686
3691
|
if (!o) continue;
|
|
3687
|
-
if (i >=
|
|
3692
|
+
if (i >= we) {
|
|
3688
3693
|
let t = r.nextSibling;
|
|
3689
|
-
o.removeChild(r), n =
|
|
3694
|
+
o.removeChild(r), n = Ee(e, o, t, n);
|
|
3690
3695
|
continue;
|
|
3691
3696
|
}
|
|
3692
|
-
let s =
|
|
3693
|
-
o.removeChild(c), n =
|
|
3697
|
+
let s = we - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3698
|
+
o.removeChild(c), n = Ee(l, o, u, n);
|
|
3694
3699
|
}
|
|
3695
|
-
|
|
3700
|
+
we = t;
|
|
3696
3701
|
}
|
|
3697
|
-
return a(
|
|
3698
|
-
await n(),
|
|
3702
|
+
return a(ve, async () => {
|
|
3703
|
+
await n(), w();
|
|
3699
3704
|
}, { immediate: !0 }), a(() => c.markdown, (e, t) => {
|
|
3700
|
-
(!e || t && e.length < t.length) && (
|
|
3705
|
+
(!e || t && e.length < t.length) && (we = 0);
|
|
3701
3706
|
}), (e, t) => (r(), u("div", {
|
|
3702
3707
|
ref: "container",
|
|
3703
|
-
onClick:
|
|
3704
|
-
innerHTML:
|
|
3705
|
-
}, null, 8,
|
|
3708
|
+
onClick: C,
|
|
3709
|
+
innerHTML: ve.value
|
|
3710
|
+
}, null, 8, jo));
|
|
3706
3711
|
}
|
|
3707
3712
|
}), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
|
|
3708
3713
|
//#endregion
|
|
3709
|
-
export {
|
|
3714
|
+
export { Ve as A, x as B, w as C, C as D, nt as E, fe as F, _e as I, S as L, pe as M, me as N, Se as O, ve as P, ge as R, Pe as S, Ne as T, he as V, rt as _, ze as a, Je as b, Ue as c, Be as d, we as f, Fe as g, tt as h, Ke as i, $e as j, Re as k, Ge as l, Ie as m, Me as n, be as o, Ze as p, T as r, Ce as s, No as t, We as u, Xe as v, Oe as w, Le as x, He as y, de as z };
|
|
3710
3715
|
|
|
3711
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3716
|
+
//# sourceMappingURL=PkStreamingMarkdown-DeZn-hPo.js.map
|