@8wave/ai-elements 0.117.0-beta.10 → 0.117.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-BxyaZeuL.js → Agent-CFkAjuTy.js} +204 -168
- package/dist/_chunks/Agent-CFkAjuTy.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-B8mvCNou.js → PkStreamingMarkdown-BoVR7gtl.js} +670 -644
- package/dist/_chunks/PkStreamingMarkdown-BoVR7gtl.js.map +1 -0
- package/dist/_chunks/{PkToolEditSpreadsheet-Bp-ES8B0.js → PkToolEditSpreadsheet-BlfsM7Qp.js} +2 -2
- package/dist/_chunks/{PkToolEditSpreadsheet-Bp-ES8B0.js.map → PkToolEditSpreadsheet-BlfsM7Qp.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DcPMMyJH.js → PkToolRequestGeolocation-DdQ91rpB.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DcPMMyJH.js.map → PkToolRequestGeolocation-DdQ91rpB.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-Cc2qViGX.js → PkToolRequestOAuthConnection-yuTNMEFj.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-Cc2qViGX.js.map → PkToolRequestOAuthConnection-yuTNMEFj.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-CcwAlOFM.js → PkToolShowArtifact-DaTlDsDo.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-CcwAlOFM.js.map → PkToolShowArtifact-DaTlDsDo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DByjGK_F.js → PkToolShowContactForm-Dxh6bEZt.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DByjGK_F.js.map → PkToolShowContactForm-Dxh6bEZt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-CGrjJ-9k.js → PkToolShowForm-D1VzwMmq.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-CGrjJ-9k.js.map → PkToolShowForm-D1VzwMmq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-C3ZaW1jQ.js → PkToolShowImageGallery-Cs8FxK9V.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-C3ZaW1jQ.js.map → PkToolShowImageGallery-Cs8FxK9V.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-BAHoB6mi.js → PkToolShowProductList-B4fxqFaf.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-BAHoB6mi.js.map → PkToolShowProductList-B4fxqFaf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BgnumOzQ.js → PkToolShowSources-DNiiBz9b.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BgnumOzQ.js.map → PkToolShowSources-DNiiBz9b.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CpixDpsJ.js → PkToolShowSuggestedReply-Bn1w6HdI.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CpixDpsJ.js.map → PkToolShowSuggestedReply-Bn1w6HdI.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-94-l_bBW.js → PkToolShowVideo-Be5bKhUf.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-94-l_bBW.js.map → PkToolShowVideo-Be5bKhUf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-q1gLOgDl.js → PkToolShowWebPages-Bs251x0h.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-q1gLOgDl.js.map → PkToolShowWebPages-Bs251x0h.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-D4kQJejM.js → chatImagePolicy-BACuW8x3.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-D4kQJejM.js.map → chatImagePolicy-BACuW8x3.js.map} +1 -1
- package/dist/_chunks/{markdown-DCYDJNwF.js → markdown-Bk1clNA6.js} +13 -13
- package/dist/_chunks/{markdown-DCYDJNwF.js.map → markdown-Bk1clNA6.js.map} +1 -1
- package/dist/ai-elements.es.js +1967 -1885
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAudioTranscript.d.ts +2 -0
- package/dist-vue/PkChatbotAudioTranscript.js +1 -0
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-CSXbmC44.js → Agent-CNJ3b9Je.js} +2 -2
- package/dist-vue/_chunks/{Agent-CSXbmC44.js.map → Agent-CNJ3b9Je.js.map} +1 -1
- package/dist-vue/_chunks/{Document-Ol8nGgij.js → Document-Bp3YJuQQ.js} +11 -11
- package/dist-vue/_chunks/{Document-Ol8nGgij.js.map → Document-Bp3YJuQQ.js.map} +1 -1
- package/dist-vue/_chunks/{Media-Cv7ou2tP.js → Media-C6Xsb1Lm.js} +77 -27
- package/dist-vue/_chunks/Media-C6Xsb1Lm.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-BmpFnkde.js → PkChatbot-CSMWib9A.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-BmpFnkde.js.map → PkChatbot-CSMWib9A.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAudioTranscript-B-cSKvWR.js +52 -0
- package/dist-vue/_chunks/PkChatbotAudioTranscript-B-cSKvWR.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAuth-Dolfz0pa.js → PkChatbotAuth-C0qfDOGh.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-Dolfz0pa.js.map → PkChatbotAuth-C0qfDOGh.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-BaiGfaAD.js → PkChatbotEmptyState-DjmF3dcI.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-BaiGfaAD.js.map → PkChatbotEmptyState-DjmF3dcI.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BjfW_bML.js → PkChatbotInput-B8hKYdD9.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BjfW_bML.js.map → PkChatbotInput-B8hKYdD9.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-DJmRPFB8.js +861 -0
- package/dist-vue/_chunks/PkChatbotMessages-DJmRPFB8.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-CGAdiGR5.js → PkChatbotStepPayload-BGYwwXaT.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CGAdiGR5.js.map → PkChatbotStepPayload-BGYwwXaT.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DQsmXnKT.js → PkChatbotStepToolDetail-BH07XycE.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DQsmXnKT.js.map → PkChatbotStepToolDetail-BH07XycE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DzajeHKc.js → PkChatbotSteps-qyUOh42z.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotSteps-DzajeHKc.js.map → PkChatbotSteps-qyUOh42z.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DZbQQNQn.js → PkChatbotViewChat-C7eA7hef.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-DZbQQNQn.js.map → PkChatbotViewChat-C7eA7hef.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BXtTZ3kb.js → PkChatbotViewConversations-ClJLe1bm.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-BXtTZ3kb.js.map → PkChatbotViewConversations-ClJLe1bm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles--wM5SVAl.js → PkChatbotViewFiles-Do6tpo9O.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles--wM5SVAl.js.map → PkChatbotViewFiles-Do6tpo9O.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B8T0AQC8.js → PkChatbotViewProfile-590b78yi.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-B8T0AQC8.js.map → PkChatbotViewProfile-590b78yi.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-D6y6g6vP.js → PkStreamingMarkdown-NWO3WTw9.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-D6y6g6vP.js.map → PkStreamingMarkdown-NWO3WTw9.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BkjEQag2.js → PkToolEditSpreadsheet-BnMSzlCi.js} +2 -2
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BkjEQag2.js.map → PkToolEditSpreadsheet-BnMSzlCi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BWWUGKHJ.js → PkToolRequestGeolocation-B2UNj6dx.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BWWUGKHJ.js.map → PkToolRequestGeolocation-B2UNj6dx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DvvLZ8yi.js → PkToolRequestOAuthConnection-B262JqNh.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DvvLZ8yi.js.map → PkToolRequestOAuthConnection-B262JqNh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-CP-dG3-Y.js → PkToolShowArtifact-Dr0NHXDG.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CP-dG3-Y.js.map → PkToolShowArtifact-Dr0NHXDG.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BK7B-Qzr.js → PkToolShowContactForm-BDm1w3UK.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BK7B-Qzr.js.map → PkToolShowContactForm-BDm1w3UK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-9THUQfbg.js → PkToolShowDiagram-BKz7OPHC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-9THUQfbg.js.map → PkToolShowDiagram-BKz7OPHC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CjN-_-1j.js → PkToolShowForm-cKgWwvPD.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-CjN-_-1j.js.map → PkToolShowForm-cKgWwvPD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-8cmWigYT.js → PkToolShowImageGallery-DsAQhyOq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-8cmWigYT.js.map → PkToolShowImageGallery-DsAQhyOq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BxsK6LXl.js → PkToolShowProductList-OwGaM5qj.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BxsK6LXl.js.map → PkToolShowProductList-OwGaM5qj.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BfWNsyLw.js → PkToolShowSources-BVOqH-ZV.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-BfWNsyLw.js.map → PkToolShowSources-BVOqH-ZV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-_bH3Jikn.js → PkToolShowSuggestedReply-CF31zmck.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-_bH3Jikn.js.map → PkToolShowSuggestedReply-CF31zmck.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-2_EdyT_U.js → PkToolShowVideo-BAqSAfdq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-2_EdyT_U.js.map → PkToolShowVideo-BAqSAfdq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-B0glenu5.js → PkToolShowWebPages-BeMJqIkW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-B0glenu5.js.map → PkToolShowWebPages-BeMJqIkW.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DgtSqixO.js → createChatbotApiClient-DmqgH9Ul.js} +3 -3
- package/dist-vue/_chunks/{createChatbotApiClient-DgtSqixO.js.map → createChatbotApiClient-DmqgH9Ul.js.map} +1 -1
- package/dist-vue/_chunks/message-BOiF6Bt5.js +59 -0
- package/dist-vue/_chunks/message-BOiF6Bt5.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-A33jT5Cp.js → useChatbotStore-CiF_gfIk.js} +656 -653
- package/dist-vue/_chunks/useChatbotStore-CiF_gfIk.js.map +1 -0
- package/dist-vue/_chunks/{utils-ByN6GORv.js → utils-DxuGvgWg.js} +37 -37
- package/dist-vue/_chunks/{utils-ByN6GORv.js.map → utils-DxuGvgWg.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +19 -9
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4764 -4881
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +52 -40
- package/dist-vue/packages/components/src/chat/PkChatbotAudioTranscript.d.ts +13 -0
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +2 -2
- package/dist-vue/packages/components/src/index.d.ts +1 -2
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/Agent.d.ts +4 -4
- package/dist-vue/packages/models/src/schema/Media.d.ts +21 -0
- package/dist-vue/packages/models/src/schema/Tabular.d.ts +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -5
- package/dist/_chunks/Agent-BxyaZeuL.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-B8mvCNou.js.map +0 -1
- package/dist-vue/_chunks/Media-Cv7ou2tP.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CztL_AMB.js +0 -837
- package/dist-vue/_chunks/PkChatbotMessages-CztL_AMB.js.map +0 -1
- package/dist-vue/_chunks/message-RohfrdWS.js +0 -33
- package/dist-vue/_chunks/message-RohfrdWS.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-A33jT5Cp.js.map +0 -1
- package/dist-vue/packages/components/src/PkEditorWyswyg.d.ts +0 -23
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { C as e, F as t, J as n, L as r, N as i, O as a, P as o, X as s, _t as c, it as l, m as u, v as d } from "./vue.runtime.esm-bundler-B-NVlZCY.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BAndfHYX.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import { l as te } from "./Agent-
|
|
4
|
+
import { l as te } from "./Agent-CFkAjuTy.js";
|
|
5
5
|
import "./src-BBUM0qsk.js";
|
|
6
6
|
import { n as ne } from "./url-validation-9DstIfq2.js";
|
|
7
7
|
import { v as re } from "./dist-Ce9Hi58x.js";
|
|
8
8
|
import { n as ie } from "./useShortUrlResolver-Ddb9IUei.js";
|
|
9
9
|
import { t as ae } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
10
|
-
import { n as oe } from "./chatImagePolicy-
|
|
10
|
+
import { n as oe } from "./chatImagePolicy-BACuW8x3.js";
|
|
11
11
|
//#region ../../packages/utils/src/citations.ts
|
|
12
12
|
var m = /[ \t]*\uE200[^\uE201]*\uE201/g, se = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, ce = /[\uE200-\uE20F]/g;
|
|
13
13
|
function le(e) {
|
|
@@ -21,28 +21,54 @@ function h(e) {
|
|
|
21
21
|
function g(e) {
|
|
22
22
|
return e ? e.type.startsWith("tool-") : !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ue(e) {
|
|
25
25
|
return g(e) ? e.type.slice(5) : "";
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function de(e) {
|
|
28
28
|
return e ? e.type === "file" : !1;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
30
|
+
function _(e) {
|
|
31
|
+
if (!de(e)) return;
|
|
32
32
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
33
33
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
34
34
|
}
|
|
35
35
|
function fe(e) {
|
|
36
|
+
if (!de(e)) return;
|
|
37
|
+
let t = e.providerMetadata?.["8bot"]?.transcript;
|
|
38
|
+
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
39
|
+
}
|
|
40
|
+
function pe(e, t) {
|
|
41
|
+
return e.map((e) => {
|
|
42
|
+
let n = t.filter((t) => t.messageId === e.id);
|
|
43
|
+
return n.length === 0 ? e : {
|
|
44
|
+
...e,
|
|
45
|
+
parts: e.parts.map((e) => {
|
|
46
|
+
let t = n.find(({ storedFileName: t }) => t === _(e)?.storedFileName);
|
|
47
|
+
return t && de(e) ? {
|
|
48
|
+
...e,
|
|
49
|
+
providerMetadata: {
|
|
50
|
+
...e.providerMetadata,
|
|
51
|
+
"8bot": {
|
|
52
|
+
...e.providerMetadata?.["8bot"],
|
|
53
|
+
transcript: t.transcript
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} : e;
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function me(e) {
|
|
36
62
|
return e ? e.type === "reasoning" : !1;
|
|
37
63
|
}
|
|
38
|
-
function
|
|
64
|
+
function he(e) {
|
|
39
65
|
if (!e) return;
|
|
40
66
|
let t = e.parts;
|
|
41
67
|
if (Array.isArray(t)) return t.find((e) => h(e))?.text;
|
|
42
68
|
}
|
|
43
69
|
//#endregion
|
|
44
70
|
//#region ../../packages/components/src/chat/utils.ts
|
|
45
|
-
function
|
|
71
|
+
function ge(e) {
|
|
46
72
|
let t = [];
|
|
47
73
|
for (let n of e) {
|
|
48
74
|
if (!h(n)) {
|
|
@@ -57,29 +83,29 @@ function me(e) {
|
|
|
57
83
|
}
|
|
58
84
|
return t;
|
|
59
85
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
86
|
+
var v = (e) => g(e) && te(ue(e));
|
|
87
|
+
function _e(e) {
|
|
62
88
|
let t = /* @__PURE__ */ new Map();
|
|
63
|
-
for (let [n, r] of e.entries())
|
|
64
|
-
return e.filter((e, n) => !(
|
|
89
|
+
for (let [n, r] of e.entries()) v(r) && r.state !== "output-error" && !y(r) && t.set(r.type, n);
|
|
90
|
+
return e.filter((e, n) => !(v(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
65
91
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
68
|
-
let t = e.filter((e) =>
|
|
69
|
-
return t.length > 0 ? [...e.filter((e) => !
|
|
92
|
+
var ve = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
|
|
93
|
+
function ye(e) {
|
|
94
|
+
let t = e.filter((e) => ve.has(e.type));
|
|
95
|
+
return t.length > 0 ? [...e.filter((e) => !ve.has(e.type)), ...t] : e;
|
|
70
96
|
}
|
|
71
|
-
function
|
|
97
|
+
function be(e, t) {
|
|
72
98
|
let n = e.toolCallId;
|
|
73
|
-
return
|
|
99
|
+
return ve.has(e.type) && n ? `file-${n}` : t;
|
|
74
100
|
}
|
|
75
|
-
function
|
|
101
|
+
function y(e) {
|
|
76
102
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
77
103
|
}
|
|
78
|
-
var
|
|
79
|
-
function
|
|
104
|
+
var xe = 4e3, Se = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
105
|
+
function Ce(e, t) {
|
|
80
106
|
if (e.length <= t) return e;
|
|
81
107
|
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;
|
|
82
|
-
for (let t of e.matchAll(
|
|
108
|
+
for (let t of e.matchAll(Se)) {
|
|
83
109
|
if (t.index >= a) break;
|
|
84
110
|
let [, e, n] = t;
|
|
85
111
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -90,40 +116,40 @@ function xe(e, t) {
|
|
|
90
116
|
}
|
|
91
117
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
92
118
|
}
|
|
93
|
-
var
|
|
119
|
+
var we = /* @__PURE__ */ new Set([
|
|
94
120
|
"approval-requested",
|
|
95
121
|
"approval-responded",
|
|
96
122
|
"output-denied"
|
|
97
123
|
]);
|
|
98
|
-
function Ce(e) {
|
|
99
|
-
return g(e) ? Se.has(e.state) ? !0 : e.approval != null : !1;
|
|
100
|
-
}
|
|
101
|
-
var we = "requestConfirm";
|
|
102
124
|
function Te(e) {
|
|
125
|
+
return g(e) ? we.has(e.state) ? !0 : e.approval != null : !1;
|
|
126
|
+
}
|
|
127
|
+
var Ee = "requestConfirm";
|
|
128
|
+
function De(e) {
|
|
103
129
|
return g(e) && e.type === "tool-requestConfirm";
|
|
104
130
|
}
|
|
105
|
-
function
|
|
106
|
-
return
|
|
131
|
+
function Oe(e) {
|
|
132
|
+
return Te(e) || De(e);
|
|
107
133
|
}
|
|
108
|
-
function
|
|
134
|
+
function ke(e) {
|
|
109
135
|
if (g(e)) return e.approval?.id;
|
|
110
136
|
}
|
|
111
|
-
function
|
|
137
|
+
function b(e) {
|
|
112
138
|
if (e && "state" in e) return e.state;
|
|
113
139
|
}
|
|
114
|
-
function
|
|
140
|
+
function Ae(e = "000000") {
|
|
115
141
|
let t = e.replace("#", "");
|
|
116
142
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
117
143
|
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;
|
|
118
144
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
119
145
|
}
|
|
120
|
-
function
|
|
121
|
-
return e === "white" || e === "black" ? e :
|
|
146
|
+
function x(e, t) {
|
|
147
|
+
return e === "white" || e === "black" ? e : Ae(t);
|
|
122
148
|
}
|
|
123
|
-
function
|
|
149
|
+
function je(e, t) {
|
|
124
150
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
125
151
|
}
|
|
126
|
-
function
|
|
152
|
+
function S(e) {
|
|
127
153
|
if (e !== void 0) {
|
|
128
154
|
if (typeof e == "string") return e.trim() || void 0;
|
|
129
155
|
try {
|
|
@@ -134,10 +160,10 @@ function x(e) {
|
|
|
134
160
|
}
|
|
135
161
|
}
|
|
136
162
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
163
|
+
function Me(e) {
|
|
164
|
+
return S(e) !== void 0;
|
|
139
165
|
}
|
|
140
|
-
function
|
|
166
|
+
function Ne(e, t) {
|
|
141
167
|
let n = e?.input;
|
|
142
168
|
if (typeof t == "string") {
|
|
143
169
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -149,14 +175,14 @@ function S(e, t) {
|
|
|
149
175
|
return i ? `${i} ${n}` : n;
|
|
150
176
|
}).join(". ");
|
|
151
177
|
}
|
|
152
|
-
function
|
|
178
|
+
function C(e) {
|
|
153
179
|
return e?.options ? e.options.map((e) => ({
|
|
154
180
|
label: e.label,
|
|
155
181
|
value: e.label,
|
|
156
182
|
description: e.description
|
|
157
183
|
})) : [];
|
|
158
184
|
}
|
|
159
|
-
function
|
|
185
|
+
function Pe(e, t) {
|
|
160
186
|
let n = {};
|
|
161
187
|
if (t == null) return n;
|
|
162
188
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -172,12 +198,12 @@ function Ne(e, t) {
|
|
|
172
198
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
173
199
|
return n;
|
|
174
200
|
}
|
|
175
|
-
var
|
|
201
|
+
var Fe = [
|
|
176
202
|
"tool-perplexity_search",
|
|
177
203
|
"tool-parallel_search",
|
|
178
204
|
"tool-web_search",
|
|
179
205
|
"tool-google_search"
|
|
180
|
-
],
|
|
206
|
+
], Ie = /* @__PURE__ */ new Set([
|
|
181
207
|
"tool-searchInKnowledgeBase",
|
|
182
208
|
"tool-retrieveRevisedAnswers",
|
|
183
209
|
"tool-expandChunkContext",
|
|
@@ -186,78 +212,78 @@ var C = [
|
|
|
186
212
|
"tool-geocode",
|
|
187
213
|
"tool-recallUserMemory",
|
|
188
214
|
"tool-saveUserMemory",
|
|
189
|
-
...
|
|
215
|
+
...Fe
|
|
190
216
|
]);
|
|
191
|
-
function
|
|
192
|
-
return g(e) &&
|
|
217
|
+
function Le(e) {
|
|
218
|
+
return g(e) && Ie.has(e.type);
|
|
193
219
|
}
|
|
194
|
-
var
|
|
220
|
+
var w = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, T = (e, ...t) => {
|
|
195
221
|
for (let n of t) {
|
|
196
222
|
let t = e?.[n];
|
|
197
223
|
if (typeof t == "string" && t.trim()) return t;
|
|
198
224
|
}
|
|
199
225
|
};
|
|
200
|
-
function
|
|
226
|
+
function Re(e) {
|
|
201
227
|
if (!g(e)) return;
|
|
202
|
-
let t =
|
|
203
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
228
|
+
let t = w("input" in e ? e.input : void 0), n = w("output" in e ? e.output : void 0);
|
|
229
|
+
if (e.type === "tool-searchInKnowledgeBase" || Fe.includes(e.type)) {
|
|
204
230
|
let e = t?.queries;
|
|
205
231
|
if (Array.isArray(e)) {
|
|
206
232
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
207
233
|
return t.length ? t.join(" · ") : void 0;
|
|
208
234
|
}
|
|
209
|
-
return
|
|
235
|
+
return T(t, "query", "objective");
|
|
210
236
|
}
|
|
211
|
-
if (e.type === "tool-retrieveRevisedAnswers") return
|
|
212
|
-
if (e.type === "tool-getWeather") return
|
|
213
|
-
if (e.type === "tool-geocode") return
|
|
214
|
-
if (e.type === "tool-expandChunkContext") return
|
|
215
|
-
if (e.type === "tool-readDocumentFile") return
|
|
237
|
+
if (e.type === "tool-retrieveRevisedAnswers") return T(t, "query");
|
|
238
|
+
if (e.type === "tool-getWeather") return T(n, "location") ?? T(t, "locationName");
|
|
239
|
+
if (e.type === "tool-geocode") return T(t, "locationName");
|
|
240
|
+
if (e.type === "tool-expandChunkContext") return T(n, "documentName");
|
|
241
|
+
if (e.type === "tool-readDocumentFile") return T(n, "name");
|
|
216
242
|
if (e.type === "tool-readSpreadsheet") {
|
|
217
|
-
let e =
|
|
243
|
+
let e = T(t, "sheet"), n = T(t, "range");
|
|
218
244
|
return e && n ? `${e}!${n}` : e;
|
|
219
245
|
}
|
|
220
|
-
if (e.type === "tool-editSpreadsheet") return
|
|
221
|
-
if (e.type === "tool-querySpreadsheet") return
|
|
222
|
-
if (e.type === "tool-recallUserMemory") return
|
|
223
|
-
if (e.type === "tool-saveUserMemory") return
|
|
246
|
+
if (e.type === "tool-editSpreadsheet") return T(n, "filename");
|
|
247
|
+
if (e.type === "tool-querySpreadsheet") return T(n, "file");
|
|
248
|
+
if (e.type === "tool-recallUserMemory") return T(t, "query");
|
|
249
|
+
if (e.type === "tool-saveUserMemory") return T(t, "content", "query");
|
|
224
250
|
}
|
|
225
|
-
function
|
|
251
|
+
function ze(e) {
|
|
226
252
|
if (g(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-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-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
|
|
227
|
-
if (
|
|
253
|
+
if (me(e)) return "ri:lightbulb-line";
|
|
228
254
|
if (h(e)) return "ri:double-quotes-r";
|
|
229
255
|
}
|
|
230
|
-
function
|
|
231
|
-
return g(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-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") :
|
|
256
|
+
function Be(e, t) {
|
|
257
|
+
return g(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-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") : Fe.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : me(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
232
258
|
}
|
|
233
259
|
//#endregion
|
|
234
260
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
235
|
-
var
|
|
261
|
+
var Ve = Object.defineProperty, He = Object.defineProperties, Ue = Object.getOwnPropertyDescriptors, We = Object.getOwnPropertySymbols, Ge = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable, qe = (e, t, n) => t in e ? Ve(e, t, {
|
|
236
262
|
enumerable: !0,
|
|
237
263
|
configurable: !0,
|
|
238
264
|
writable: !0,
|
|
239
265
|
value: n
|
|
240
|
-
}) : e[t] = n,
|
|
241
|
-
for (var n in t ||= {})
|
|
242
|
-
if (
|
|
266
|
+
}) : e[t] = n, Je = (e, t) => {
|
|
267
|
+
for (var n in t ||= {}) Ge.call(t, n) && qe(e, n, t[n]);
|
|
268
|
+
if (We) for (var n of We(t)) Ke.call(t, n) && qe(e, n, t[n]);
|
|
243
269
|
return e;
|
|
244
|
-
},
|
|
270
|
+
}, Ye = (e, t) => He(e, Ue(t)), E = {
|
|
245
271
|
PROSE: 0,
|
|
246
272
|
FENCE_MARKER: 1,
|
|
247
273
|
FENCE_INFO: 2,
|
|
248
274
|
FENCE_BODY: 3,
|
|
249
275
|
CODE_SPAN: 4,
|
|
250
276
|
CODE_SPAN_OPEN: 5
|
|
251
|
-
},
|
|
277
|
+
}, Xe = /^(`{3,}|~{3,})(.*)$/, Ze = (e) => e !== void 0 && e >= "0" && e <= "9", Qe = (e, t) => {
|
|
252
278
|
let n = t;
|
|
253
279
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
254
280
|
else {
|
|
255
|
-
for (;
|
|
281
|
+
for (; Ze(e[n]) && n - t < 9;) n += 1;
|
|
256
282
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
257
283
|
n += 1;
|
|
258
284
|
}
|
|
259
285
|
return e[n] === " " ? n + 1 : -1;
|
|
260
|
-
},
|
|
286
|
+
}, $e = (e, t, n) => {
|
|
261
287
|
let r = 0, i = t, a = !1, o = t;
|
|
262
288
|
for (;;) {
|
|
263
289
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -265,7 +291,7 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
265
291
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
266
292
|
continue;
|
|
267
293
|
}
|
|
268
|
-
let t = o < n ?
|
|
294
|
+
let t = o < n ? Qe(e, o) : -1;
|
|
269
295
|
if (t === -1) return {
|
|
270
296
|
contentStart: o,
|
|
271
297
|
listIndent: a ? o - i : 0,
|
|
@@ -273,7 +299,7 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
273
299
|
};
|
|
274
300
|
o = t, a = !0;
|
|
275
301
|
}
|
|
276
|
-
},
|
|
302
|
+
}, et = (e, t, n, r) => {
|
|
277
303
|
let i = t;
|
|
278
304
|
for (let t = 0; t < r; t += 1) {
|
|
279
305
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -281,10 +307,10 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
281
307
|
i += 1, e[i] === " " && (i += 1);
|
|
282
308
|
}
|
|
283
309
|
return i;
|
|
284
|
-
},
|
|
310
|
+
}, tt = (e, t, n, r, i) => {
|
|
285
311
|
let a = t + r;
|
|
286
312
|
e.fill(E.FENCE_MARKER, a, a + i), e.fill(E.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
287
|
-
},
|
|
313
|
+
}, nt = (e, t, n, r) => {
|
|
288
314
|
let i = t;
|
|
289
315
|
for (; i < n && e[i] === " ";) i += 1;
|
|
290
316
|
let a = 0;
|
|
@@ -295,40 +321,40 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
295
321
|
i += 1;
|
|
296
322
|
}
|
|
297
323
|
return !0;
|
|
298
|
-
},
|
|
299
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
324
|
+
}, rt = (e, t, n, r) => {
|
|
325
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = $e(e, n, i), o = e.slice(a.contentStart, i).match(Xe);
|
|
300
326
|
if (!o) return null;
|
|
301
327
|
let [, s, c] = o, l = s[0];
|
|
302
|
-
return l === "`" && c.includes("`") ? null : (
|
|
328
|
+
return l === "`" && c.includes("`") ? null : (tt(t, n, r, a.contentStart - n, s.length), {
|
|
303
329
|
char: l,
|
|
304
330
|
length: s.length,
|
|
305
331
|
listIndent: a.listIndent,
|
|
306
332
|
quoteDepth: a.quoteDepth
|
|
307
333
|
});
|
|
308
|
-
},
|
|
309
|
-
let i =
|
|
334
|
+
}, it = (e, t, n, r) => {
|
|
335
|
+
let i = et(e, t, n, r.quoteDepth);
|
|
310
336
|
if (i === -1 || r.listIndent === 0) return i;
|
|
311
337
|
let a = i;
|
|
312
338
|
for (; a < n && e[a] === " ";) a += 1;
|
|
313
339
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
314
|
-
},
|
|
340
|
+
}, D = (e, t) => {
|
|
315
341
|
let n = e.length, r = null, i = 0;
|
|
316
342
|
for (; i < n;) {
|
|
317
343
|
let a = e.indexOf("\n", i);
|
|
318
344
|
a === -1 && (a = n);
|
|
319
|
-
let o = r ?
|
|
320
|
-
r && o === -1 && (r = null), r ?
|
|
345
|
+
let o = r ? it(e, i, a, r) : -1;
|
|
346
|
+
r && o === -1 && (r = null), r ? nt(e, o, a, r) ? (t.fill(E.FENCE_MARKER, i, a), r = null) : t.fill(E.FENCE_BODY, i, Math.min(a + 1, n)) : r = rt(e, t, i, a), i = a + 1;
|
|
321
347
|
}
|
|
322
348
|
return r;
|
|
323
|
-
},
|
|
349
|
+
}, at = (e, t) => {
|
|
324
350
|
let n = t + 1;
|
|
325
351
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
326
352
|
return n;
|
|
327
|
-
},
|
|
353
|
+
}, ot = (e, t) => {
|
|
328
354
|
let n = t + 1;
|
|
329
355
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
330
356
|
return n < e.length && e[n] === "\n";
|
|
331
|
-
},
|
|
357
|
+
}, st = (e, t, n) => {
|
|
332
358
|
let r = n;
|
|
333
359
|
for (;;) {
|
|
334
360
|
let n = e.indexOf("`", r);
|
|
@@ -337,12 +363,12 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
337
363
|
if (t[n] === E.PROSE && !i) return n;
|
|
338
364
|
r = n + 1;
|
|
339
365
|
}
|
|
340
|
-
},
|
|
366
|
+
}, ct = (e, t) => {
|
|
341
367
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
342
368
|
for (; a < n;) {
|
|
343
369
|
if (r < 0) {
|
|
344
|
-
if (a =
|
|
345
|
-
let n =
|
|
370
|
+
if (a = st(e, t, a), a === -1) break;
|
|
371
|
+
let n = at(e, a);
|
|
346
372
|
r = a, i = n - a, a = n;
|
|
347
373
|
continue;
|
|
348
374
|
}
|
|
@@ -350,7 +376,7 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
350
376
|
t.fill(E.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
351
377
|
continue;
|
|
352
378
|
}
|
|
353
|
-
if (e[a] === "\n" &&
|
|
379
|
+
if (e[a] === "\n" && ot(e, a)) {
|
|
354
380
|
r = -1, a += 1;
|
|
355
381
|
continue;
|
|
356
382
|
}
|
|
@@ -358,76 +384,76 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
358
384
|
a += 1;
|
|
359
385
|
continue;
|
|
360
386
|
}
|
|
361
|
-
let n =
|
|
387
|
+
let n = at(e, a);
|
|
362
388
|
n - a === i && (t.fill(E.CODE_SPAN, r, n), r = -1), a = n;
|
|
363
389
|
}
|
|
364
390
|
return r >= 0 ? (t.fill(E.CODE_SPAN_OPEN, r, n), {
|
|
365
391
|
start: r,
|
|
366
392
|
runLength: i
|
|
367
393
|
}) : null;
|
|
368
|
-
},
|
|
394
|
+
}, lt = (e) => {
|
|
369
395
|
let t = new Uint8Array(e.length);
|
|
370
396
|
return {
|
|
371
397
|
text: e,
|
|
372
398
|
regions: t,
|
|
373
|
-
openFence:
|
|
374
|
-
openSpan:
|
|
399
|
+
openFence: D(e, t),
|
|
400
|
+
openSpan: ct(e, t),
|
|
375
401
|
mathMask: null,
|
|
376
402
|
linkUrlMask: null,
|
|
377
403
|
htmlTagMask: null
|
|
378
404
|
};
|
|
379
|
-
},
|
|
380
|
-
if (
|
|
381
|
-
let t =
|
|
382
|
-
return
|
|
383
|
-
},
|
|
384
|
-
|
|
385
|
-
},
|
|
405
|
+
}, ut = null, dt = null, O = (e) => {
|
|
406
|
+
if (dt !== null && e === ut) return dt;
|
|
407
|
+
let t = lt(e);
|
|
408
|
+
return ut = e, dt = t, t;
|
|
409
|
+
}, ft = () => {
|
|
410
|
+
ut = null, dt = null;
|
|
411
|
+
}, pt = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== E.PROSE, mt = (e, t) => e.regions[t] === E.CODE_SPAN, k = (e, t) => {
|
|
386
412
|
let n = O(e), r = t + t, i = 0;
|
|
387
413
|
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === E.PROSE ? (i += 1, t += 2) : t += 1;
|
|
388
414
|
return i;
|
|
389
|
-
},
|
|
415
|
+
}, A = /* @__PURE__ */ new Uint8Array(), ht = (e) => e === "inlineLatex" || e === "blockLatex", gt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, _t = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", vt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), yt = (e, t, n) => {
|
|
390
416
|
let r = e[t + 1];
|
|
391
417
|
if (e[t] === "\\") {
|
|
392
418
|
if (r === "$") return {
|
|
393
419
|
context: n,
|
|
394
420
|
length: 2
|
|
395
421
|
};
|
|
396
|
-
let e =
|
|
422
|
+
let e = gt(n, r);
|
|
397
423
|
return e === null ? null : {
|
|
398
424
|
context: e,
|
|
399
425
|
length: 2
|
|
400
426
|
};
|
|
401
427
|
}
|
|
402
|
-
if (e[t] === "$" && !
|
|
428
|
+
if (e[t] === "$" && !ht(n)) {
|
|
403
429
|
let e = r === "$";
|
|
404
430
|
return {
|
|
405
|
-
context:
|
|
431
|
+
context: _t(n, e),
|
|
406
432
|
length: e ? 2 : 1
|
|
407
433
|
};
|
|
408
434
|
}
|
|
409
435
|
return null;
|
|
410
|
-
},
|
|
436
|
+
}, bt = (e) => {
|
|
411
437
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
412
438
|
for (; o < r;) {
|
|
413
439
|
i[o] = a === "none" ? 0 : 1;
|
|
414
|
-
let e = n[o] === E.PROSE ?
|
|
440
|
+
let e = n[o] === E.PROSE ? yt(t, o, a) : null;
|
|
415
441
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
416
442
|
}
|
|
417
443
|
return i;
|
|
418
|
-
},
|
|
444
|
+
}, xt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = vt(e.text) ? bt(e) : A), e.mathMask[t] === 1), St = (e, t, n, r) => {
|
|
419
445
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
420
446
|
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === E.PROSE && (s = 1), o[e - t] = s;
|
|
421
447
|
let c = !1;
|
|
422
448
|
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === E.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
423
|
-
},
|
|
449
|
+
}, Ct = (e) => {
|
|
424
450
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
425
451
|
for (; i < n;) {
|
|
426
452
|
let a = t.indexOf("\n", i);
|
|
427
|
-
a === -1 && (a = n),
|
|
453
|
+
a === -1 && (a = n), St(e, i, a, r), i = a + 1;
|
|
428
454
|
}
|
|
429
455
|
return r;
|
|
430
|
-
},
|
|
456
|
+
}, j = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Ct(e) : A), e.linkUrlMask[t] === 1), wt = (e) => {
|
|
431
457
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
432
458
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
433
459
|
else if (i[e] = +!!a, n[e] === E.PROSE) {
|
|
@@ -438,56 +464,56 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
438
464
|
}
|
|
439
465
|
}
|
|
440
466
|
return i;
|
|
441
|
-
},
|
|
467
|
+
}, Tt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? wt(e) : A), e.htmlTagMask[t] === 1), M = (e, t) => pt(O(e), t), N = (e, t) => mt(O(e), t), Et = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, Dt = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Et, (t, n, r, i) => M(e, i) ? t : `${n}\\>${r}`), P = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
442
468
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
443
469
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
444
|
-
},
|
|
470
|
+
}, Ot = {
|
|
445
471
|
delimiter: "*",
|
|
446
472
|
markerLength: 2,
|
|
447
473
|
regex: /(\*\*)([^*]*\*?)$/
|
|
448
|
-
},
|
|
474
|
+
}, kt = {
|
|
449
475
|
delimiter: "_",
|
|
450
476
|
markerLength: 2,
|
|
451
477
|
regex: /(__)([^_]*?)$/
|
|
452
|
-
},
|
|
478
|
+
}, At = {
|
|
453
479
|
delimiter: "*",
|
|
454
480
|
markerLength: 3,
|
|
455
481
|
regex: /(\*\*\*)([^*]*?)$/
|
|
456
|
-
},
|
|
482
|
+
}, jt = {
|
|
457
483
|
delimiter: "*",
|
|
458
484
|
markerLength: 1,
|
|
459
485
|
regex: /(\*)([^*]*?)$/
|
|
460
|
-
},
|
|
486
|
+
}, Mt = {
|
|
461
487
|
delimiter: "_",
|
|
462
488
|
markerLength: 1,
|
|
463
489
|
regex: /(_)([^_]*?)$/
|
|
464
|
-
},
|
|
490
|
+
}, Nt = {
|
|
465
491
|
delimiter: "~",
|
|
466
492
|
markerLength: 2,
|
|
467
493
|
regex: /(~~)([^~]*?)$/
|
|
468
|
-
},
|
|
494
|
+
}, Pt = {
|
|
469
495
|
delimiter: "_",
|
|
470
496
|
markerLength: 2,
|
|
471
497
|
regex: /(__)([^_]+)_$/
|
|
472
|
-
},
|
|
498
|
+
}, F = {
|
|
473
499
|
delimiter: "~",
|
|
474
500
|
markerLength: 2,
|
|
475
501
|
regex: /(~~)([^~]+)~$/
|
|
476
|
-
},
|
|
502
|
+
}, Ft = /^[\s_~*`]*$/, It = /^[\s]*[-*+][\s]+$/, Lt = /[\p{L}\p{N}_]/u, Rt = /^\*{4,}$/, I = (e) => {
|
|
477
503
|
if (!e) return !1;
|
|
478
504
|
let t = e.charCodeAt(0);
|
|
479
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
480
|
-
},
|
|
505
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || Lt.test(e);
|
|
506
|
+
}, zt = (e, t) => {
|
|
481
507
|
let n = 1;
|
|
482
508
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
483
509
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
484
510
|
return -1;
|
|
485
|
-
},
|
|
511
|
+
}, Bt = (e, t) => {
|
|
486
512
|
let n = 1;
|
|
487
513
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
488
514
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
489
515
|
return -1;
|
|
490
|
-
},
|
|
516
|
+
}, Vt = (e, t) => xt(O(e), t), Ht = (e, t, n) => {
|
|
491
517
|
let r = 0;
|
|
492
518
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
493
519
|
r = n + 1;
|
|
@@ -505,13 +531,13 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
505
531
|
break;
|
|
506
532
|
}
|
|
507
533
|
return o >= 3 && !s;
|
|
508
|
-
},
|
|
509
|
-
let i =
|
|
534
|
+
}, Ut = (e, t, n, r) => n === "\\" || xt(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"), Wt = (e) => e === " " || e === " " || e === "\n", Gt = (e, t) => !!(e && t && I(e) && I(t)), Kt = (e, t, n, r) => {
|
|
535
|
+
let i = Gt(e, t), a = !!t && !Wt(t), o = !!e && !Wt(e);
|
|
510
536
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
511
537
|
count: !0,
|
|
512
538
|
inWordAsteriskChain: i
|
|
513
539
|
} : { count: !1 };
|
|
514
|
-
},
|
|
540
|
+
}, qt = (e) => {
|
|
515
541
|
let t = O(e), n = 0, r = !1, i = e.length;
|
|
516
542
|
for (let a = 0; a < i; a += 1) {
|
|
517
543
|
if (e[a] !== "*" || t.regions[a] !== E.PROSE) {
|
|
@@ -519,38 +545,38 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
519
545
|
continue;
|
|
520
546
|
}
|
|
521
547
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
522
|
-
if (
|
|
523
|
-
let c =
|
|
548
|
+
if (Ut(t, a, o, s)) continue;
|
|
549
|
+
let c = Kt(o, s, n, r);
|
|
524
550
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
525
551
|
}
|
|
526
552
|
return n;
|
|
527
|
-
},
|
|
553
|
+
}, Jt = (e, t, n, r) => !!(n === "\\" || xt(e, t) || j(e, t) || Tt(e, t) || n === "_" || r === "_" || n && r && I(n) && I(r)), Yt = (e) => {
|
|
528
554
|
let t = O(e), n = 0, r = e.length;
|
|
529
555
|
for (let i = 0; i < r; i += 1) {
|
|
530
556
|
if (e[i] !== "_" || t.regions[i] !== E.PROSE) continue;
|
|
531
557
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
532
|
-
|
|
558
|
+
Jt(t, i, a, o) || (n += 1);
|
|
533
559
|
}
|
|
534
560
|
return n;
|
|
535
|
-
},
|
|
561
|
+
}, Xt = (e) => {
|
|
536
562
|
let t = O(e), n = 0, r = 0;
|
|
537
563
|
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === E.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
538
564
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
539
|
-
},
|
|
540
|
-
if (!(
|
|
565
|
+
}, Zt = (e) => k(e, "*"), Qt = (e) => e === "" || e === " " || e === " " || e === "\n", $t = (e, t, n, r, i) => {
|
|
566
|
+
if (!(Qt(n) && Qt(r))) return !1;
|
|
541
567
|
if (t > i.lineEnd) {
|
|
542
568
|
let n = e.indexOf("\n", t);
|
|
543
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
569
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = Ht(e, t, "_");
|
|
544
570
|
}
|
|
545
571
|
return i.result;
|
|
546
|
-
},
|
|
572
|
+
}, en = (e, t, n, r) => {
|
|
547
573
|
let i = e.text, a = t, o = !1;
|
|
548
574
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
549
575
|
let s = n - a;
|
|
550
576
|
if (s < 2) return !1;
|
|
551
577
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
552
|
-
return I(l) && I(u) ||
|
|
553
|
-
},
|
|
578
|
+
return I(l) && I(u) || $t(i, a, l, u, r) || xt(e, a) || j(e, a) || Tt(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
579
|
+
}, tn = (e) => {
|
|
554
580
|
let t = O(e), n = e.length, r = {
|
|
555
581
|
lineEnd: -1,
|
|
556
582
|
result: !1
|
|
@@ -562,127 +588,127 @@ var ze = Object.defineProperty, Be = Object.defineProperties, Ve = Object.getOwn
|
|
|
562
588
|
}
|
|
563
589
|
let o = a, s = a + 1;
|
|
564
590
|
for (; s < n && e[s] === "_" && t.regions[s] === E.PROSE;) s += 1;
|
|
565
|
-
a = s,
|
|
591
|
+
a = s, en(t, o, s, r) && (i = !i);
|
|
566
592
|
}
|
|
567
593
|
return i;
|
|
568
|
-
},
|
|
569
|
-
if (!t ||
|
|
594
|
+
}, nn = (e, t, n) => {
|
|
595
|
+
if (!t || Ft.test(t)) return !0;
|
|
570
596
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
571
|
-
return
|
|
572
|
-
},
|
|
573
|
-
let t =
|
|
597
|
+
return It.test(a) && t.includes("\n") ? !0 : Ht(e, n, "*");
|
|
598
|
+
}, rn = (e) => {
|
|
599
|
+
let t = P(e, Ot);
|
|
574
600
|
if (!t) return e;
|
|
575
601
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
576
|
-
return
|
|
577
|
-
},
|
|
578
|
-
if (!t ||
|
|
602
|
+
return M(e, r) || N(e, r) || nn(e, n, r) ? e : Zt(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
603
|
+
}, an = (e, t, n) => {
|
|
604
|
+
if (!t || Ft.test(t)) return !0;
|
|
579
605
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
580
|
-
return
|
|
581
|
-
},
|
|
582
|
-
let t =
|
|
606
|
+
return It.test(a) && t.includes("\n") ? !0 : Ht(e, n, "_");
|
|
607
|
+
}, on = (e) => {
|
|
608
|
+
let t = P(e, kt);
|
|
583
609
|
if (!t) {
|
|
584
|
-
let t =
|
|
610
|
+
let t = P(e, Pt);
|
|
585
611
|
if (t) {
|
|
586
612
|
let n = e.lastIndexOf(t[1]);
|
|
587
|
-
if (!(
|
|
613
|
+
if (!(M(e, n) || N(e, n)) && tn(e)) return `${e}_`;
|
|
588
614
|
}
|
|
589
615
|
return e;
|
|
590
616
|
}
|
|
591
617
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
592
|
-
return
|
|
593
|
-
},
|
|
618
|
+
return M(e, r) || N(e, r) || an(e, n, r) ? e : tn(e) ? `${e}__` : e;
|
|
619
|
+
}, sn = (e, t) => {
|
|
594
620
|
let { text: n } = e;
|
|
595
|
-
return n[t] === "*" && e.regions[t] === E.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !
|
|
596
|
-
},
|
|
621
|
+
return n[t] === "*" && e.regions[t] === E.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !xt(e, t);
|
|
622
|
+
}, cn = (e) => {
|
|
597
623
|
let t = O(e);
|
|
598
624
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
599
|
-
if (!
|
|
600
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
625
|
+
if (!sn(t, n)) continue;
|
|
626
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || Wt(r), o = !i || Wt(i);
|
|
601
627
|
if (!(a && o) && !(r && i && I(r) && I(i)) && !o) return n;
|
|
602
628
|
}
|
|
603
629
|
return -1;
|
|
604
|
-
},
|
|
605
|
-
if (!
|
|
606
|
-
let t =
|
|
607
|
-
if (t === -1 ||
|
|
630
|
+
}, ln = (e) => {
|
|
631
|
+
if (!P(e, jt)) return e;
|
|
632
|
+
let t = cn(e);
|
|
633
|
+
if (t === -1 || M(e, t) || N(e, t)) return e;
|
|
608
634
|
let n = e.substring(t + 1);
|
|
609
|
-
return !n ||
|
|
610
|
-
},
|
|
635
|
+
return !n || Ft.test(n) ? e : qt(e) % 2 == 1 ? `${e}*` : e;
|
|
636
|
+
}, un = (e) => {
|
|
611
637
|
let t = O(e);
|
|
612
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === E.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !
|
|
638
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === E.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !xt(t, n) && !j(t, n)) {
|
|
613
639
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
614
640
|
if (t && r && I(t) && I(r)) continue;
|
|
615
641
|
return n;
|
|
616
642
|
}
|
|
617
643
|
return -1;
|
|
618
|
-
},
|
|
644
|
+
}, dn = (e) => {
|
|
619
645
|
let t = e.length;
|
|
620
646
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
621
647
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
622
|
-
},
|
|
648
|
+
}, fn = (e) => {
|
|
623
649
|
if (!e.endsWith("**")) return null;
|
|
624
650
|
let t = e.slice(0, -2);
|
|
625
|
-
if (
|
|
626
|
-
let n = t.indexOf("**"), r =
|
|
651
|
+
if (Zt(t) % 2 != 1) return null;
|
|
652
|
+
let n = t.indexOf("**"), r = un(t);
|
|
627
653
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
628
|
-
},
|
|
629
|
-
if (!
|
|
630
|
-
let t =
|
|
654
|
+
}, pn = (e) => {
|
|
655
|
+
if (!P(e, Mt)) return e;
|
|
656
|
+
let t = un(e);
|
|
631
657
|
if (t === -1) return e;
|
|
632
658
|
let n = e.substring(t + 1);
|
|
633
|
-
if (!n ||
|
|
634
|
-
if (
|
|
635
|
-
let t =
|
|
636
|
-
return t === null ?
|
|
659
|
+
if (!n || Ft.test(n) || M(e, t) || N(e, t)) return e;
|
|
660
|
+
if (Yt(e) % 2 == 1) {
|
|
661
|
+
let t = fn(e);
|
|
662
|
+
return t === null ? dn(e) : t;
|
|
637
663
|
}
|
|
638
664
|
return e;
|
|
639
|
-
},
|
|
640
|
-
let t =
|
|
665
|
+
}, mn = (e) => {
|
|
666
|
+
let t = Zt(e), n = qt(e);
|
|
641
667
|
return t % 2 == 0 && n % 2 == 0;
|
|
642
|
-
},
|
|
643
|
-
if (
|
|
644
|
-
let t =
|
|
668
|
+
}, hn = (e, t, n) => !t || Ft.test(t) || M(e, n) || N(e, n) ? !0 : Ht(e, n, "*"), gn = (e) => {
|
|
669
|
+
if (Rt.test(e)) return e;
|
|
670
|
+
let t = P(e, At);
|
|
645
671
|
if (!t) return e;
|
|
646
672
|
let n = t[2];
|
|
647
|
-
return
|
|
648
|
-
},
|
|
673
|
+
return hn(e, n, e.lastIndexOf(t[1])) ? e : Xt(e) % 2 == 1 ? mn(e) ? e : `${e}***` : e;
|
|
674
|
+
}, _n = /<[a-zA-Z/][^>]*$/, vn = /[a-zA-Z/]/, yn = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), bn = (e, t) => {
|
|
649
675
|
let n = e[t + 1];
|
|
650
|
-
return n !== void 0 &&
|
|
651
|
-
},
|
|
652
|
-
let t = e.match(
|
|
676
|
+
return n !== void 0 && vn.test(n);
|
|
677
|
+
}, xn = (e) => {
|
|
678
|
+
let t = e.match(_n);
|
|
653
679
|
if (!t || t.index === void 0) return e;
|
|
654
|
-
let n =
|
|
655
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
680
|
+
let n = yn(e);
|
|
681
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && bn(e, r) && !M(e, r) && !(n && Vt(e, r))) return e.substring(0, r).trimEnd();
|
|
656
682
|
return e;
|
|
657
|
-
},
|
|
683
|
+
}, Sn = (e) => {
|
|
658
684
|
let t = O(e);
|
|
659
685
|
if (t.openFence) return e;
|
|
660
686
|
let n = t.openSpan;
|
|
661
687
|
if (!n) return e;
|
|
662
688
|
let r = e.slice(n.start + n.runLength);
|
|
663
|
-
if (!r ||
|
|
689
|
+
if (!r || Ft.test(r)) return e;
|
|
664
690
|
let i = 0, a = e.length - 1;
|
|
665
691
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
666
692
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
667
|
-
},
|
|
693
|
+
}, Cn = (e) => k(e, "$"), wn = (e) => {
|
|
668
694
|
let t = O(e), n = 0;
|
|
669
695
|
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === E.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
670
696
|
return n;
|
|
671
|
-
},
|
|
697
|
+
}, Tn = (e) => {
|
|
672
698
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
673
699
|
let t = e.indexOf("$$");
|
|
674
700
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
675
701
|
$$` : `${e}$$`;
|
|
676
|
-
},
|
|
702
|
+
}, En = (e) => Cn(e) % 2 == 0 ? e : Tn(e), Dn = (e) => wn(e) % 2 == 1 ? `${e}$` : e, On = "streamdown:incomplete-image", kn = (e, t, n) => {
|
|
677
703
|
if (e.substring(t + 2).includes(")")) return null;
|
|
678
|
-
let r =
|
|
679
|
-
if (r === -1 ||
|
|
704
|
+
let r = zt(e, t);
|
|
705
|
+
if (r === -1 || M(e, r)) return null;
|
|
680
706
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
681
|
-
return i ? `${o} if (e[n] === "[" && !
|
|
707
|
+
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
708
|
+
}, An = (e, t) => {
|
|
709
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !M(e, n)) {
|
|
684
710
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
685
|
-
let t =
|
|
711
|
+
let t = Bt(e, n);
|
|
686
712
|
if (t === -1) return n;
|
|
687
713
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
688
714
|
let r = e.indexOf(")", t + 2);
|
|
@@ -690,69 +716,69 @@ $$` : `${e}$$`;
|
|
|
690
716
|
}
|
|
691
717
|
}
|
|
692
718
|
return t;
|
|
693
|
-
},
|
|
719
|
+
}, jn = (e, t, n) => {
|
|
694
720
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
695
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
721
|
+
if (!e.substring(t + 1).includes("]") || Bt(e, t) === -1) {
|
|
696
722
|
let a = e.substring(0, i);
|
|
697
|
-
if (r) return `${a} return `${a}`;
|
|
698
724
|
if (n === "text-only") {
|
|
699
|
-
let n =
|
|
725
|
+
let n = An(e, t);
|
|
700
726
|
return e.substring(0, n) + e.substring(n + 1);
|
|
701
727
|
}
|
|
702
728
|
return `${e}](streamdown:incomplete-link)`;
|
|
703
729
|
}
|
|
704
730
|
return null;
|
|
705
|
-
},
|
|
731
|
+
}, Mn = (e, t) => {
|
|
706
732
|
let n = e.lastIndexOf("](");
|
|
707
|
-
if (n !== -1 && !
|
|
708
|
-
let r =
|
|
733
|
+
if (n !== -1 && !M(e, n)) {
|
|
734
|
+
let r = kn(e, n, t);
|
|
709
735
|
if (r !== null) return r;
|
|
710
736
|
}
|
|
711
|
-
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!
|
|
712
|
-
let r =
|
|
737
|
+
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!M(e, n)) {
|
|
738
|
+
let r = jn(e, n, t);
|
|
713
739
|
if (r !== null) return r;
|
|
714
740
|
}
|
|
715
741
|
return e;
|
|
716
|
-
},
|
|
742
|
+
}, Nn = 32, Pn = (e, t = "protocol") => {
|
|
717
743
|
let n = e;
|
|
718
|
-
for (let e = 0; e <
|
|
719
|
-
let e =
|
|
744
|
+
for (let e = 0; e < Nn; e += 1) {
|
|
745
|
+
let e = Mn(n, t);
|
|
720
746
|
if (e.length >= n.length) return e;
|
|
721
747
|
n = e;
|
|
722
748
|
}
|
|
723
749
|
return n;
|
|
724
|
-
},
|
|
750
|
+
}, Fn = /^-{1,2}$/, In = /^[\s]*-{1,2}[\s]+$/, Ln = /^={1,2}$/, Rn = /^[\s]*={1,2}[\s]+$/, zn = (e) => {
|
|
725
751
|
if (!e || typeof e != "string") return e;
|
|
726
752
|
let t = e.lastIndexOf("\n");
|
|
727
753
|
if (t === -1) return e;
|
|
728
754
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
729
|
-
if (
|
|
755
|
+
if (Fn.test(i) && !n.match(In)) {
|
|
730
756
|
let t = r.split("\n").at(-1);
|
|
731
757
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
732
758
|
}
|
|
733
|
-
if (
|
|
759
|
+
if (Ln.test(i) && !n.match(Rn)) {
|
|
734
760
|
let t = r.split("\n").at(-1);
|
|
735
761
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
736
762
|
}
|
|
737
763
|
return e;
|
|
738
|
-
},
|
|
739
|
-
let t =
|
|
764
|
+
}, Bn = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, Vn = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(Bn, (t, n, r) => M(e, r + n.length) ? t : `${n}\\~`), Hn = (e) => k(e, "~"), Un = (e) => {
|
|
765
|
+
let t = P(e, Nt);
|
|
740
766
|
if (t) {
|
|
741
767
|
let n = t[2];
|
|
742
|
-
if (!n ||
|
|
768
|
+
if (!n || Ft.test(n)) return e;
|
|
743
769
|
let r = e.lastIndexOf(t[1]);
|
|
744
|
-
if (
|
|
745
|
-
if (
|
|
770
|
+
if (M(e, r) || N(e, r)) return e;
|
|
771
|
+
if (Hn(e) % 2 == 1) return `${e}~~`;
|
|
746
772
|
} else {
|
|
747
|
-
let t =
|
|
773
|
+
let t = P(e, F);
|
|
748
774
|
if (t) {
|
|
749
775
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
750
|
-
if (
|
|
751
|
-
if (
|
|
776
|
+
if (M(e, n) || N(e, n)) return e;
|
|
777
|
+
if (Hn(e) % 2 == 1) return `${e}~`;
|
|
752
778
|
}
|
|
753
779
|
}
|
|
754
780
|
return e;
|
|
755
|
-
},
|
|
781
|
+
}, Wn = (e) => e !== !1, Gn = (e) => e === !0, L = {
|
|
756
782
|
SINGLE_TILDE: 0,
|
|
757
783
|
COMPARISON_OPERATORS: 5,
|
|
758
784
|
HTML_TAGS: 10,
|
|
@@ -768,11 +794,11 @@ $$` : `${e}$$`;
|
|
|
768
794
|
KATEX: 70,
|
|
769
795
|
INLINE_KATEX: 75,
|
|
770
796
|
DEFAULT: 100
|
|
771
|
-
},
|
|
797
|
+
}, Kn = [
|
|
772
798
|
{
|
|
773
799
|
handler: {
|
|
774
800
|
name: "singleTilde",
|
|
775
|
-
handle:
|
|
801
|
+
handle: Vn,
|
|
776
802
|
priority: L.SINGLE_TILDE
|
|
777
803
|
},
|
|
778
804
|
optionKey: "singleTilde"
|
|
@@ -780,7 +806,7 @@ $$` : `${e}$$`;
|
|
|
780
806
|
{
|
|
781
807
|
handler: {
|
|
782
808
|
name: "comparisonOperators",
|
|
783
|
-
handle:
|
|
809
|
+
handle: Dt,
|
|
784
810
|
priority: L.COMPARISON_OPERATORS
|
|
785
811
|
},
|
|
786
812
|
optionKey: "comparisonOperators"
|
|
@@ -788,7 +814,7 @@ $$` : `${e}$$`;
|
|
|
788
814
|
{
|
|
789
815
|
handler: {
|
|
790
816
|
name: "htmlTags",
|
|
791
|
-
handle:
|
|
817
|
+
handle: xn,
|
|
792
818
|
priority: L.HTML_TAGS
|
|
793
819
|
},
|
|
794
820
|
optionKey: "htmlTags"
|
|
@@ -796,7 +822,7 @@ $$` : `${e}$$`;
|
|
|
796
822
|
{
|
|
797
823
|
handler: {
|
|
798
824
|
name: "setextHeadings",
|
|
799
|
-
handle:
|
|
825
|
+
handle: zn,
|
|
800
826
|
priority: L.SETEXT_HEADINGS
|
|
801
827
|
},
|
|
802
828
|
optionKey: "setextHeadings"
|
|
@@ -804,7 +830,7 @@ $$` : `${e}$$`;
|
|
|
804
830
|
{
|
|
805
831
|
handler: {
|
|
806
832
|
name: "links",
|
|
807
|
-
handle:
|
|
833
|
+
handle: Pn,
|
|
808
834
|
priority: L.LINKS
|
|
809
835
|
},
|
|
810
836
|
optionKey: "links",
|
|
@@ -813,7 +839,7 @@ $$` : `${e}$$`;
|
|
|
813
839
|
{
|
|
814
840
|
handler: {
|
|
815
841
|
name: "boldItalic",
|
|
816
|
-
handle:
|
|
842
|
+
handle: gn,
|
|
817
843
|
priority: L.BOLD_ITALIC
|
|
818
844
|
},
|
|
819
845
|
optionKey: "boldItalic"
|
|
@@ -821,7 +847,7 @@ $$` : `${e}$$`;
|
|
|
821
847
|
{
|
|
822
848
|
handler: {
|
|
823
849
|
name: "bold",
|
|
824
|
-
handle:
|
|
850
|
+
handle: rn,
|
|
825
851
|
priority: L.BOLD
|
|
826
852
|
},
|
|
827
853
|
optionKey: "bold"
|
|
@@ -829,7 +855,7 @@ $$` : `${e}$$`;
|
|
|
829
855
|
{
|
|
830
856
|
handler: {
|
|
831
857
|
name: "italicDoubleUnderscore",
|
|
832
|
-
handle:
|
|
858
|
+
handle: on,
|
|
833
859
|
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
834
860
|
},
|
|
835
861
|
optionKey: "italic"
|
|
@@ -837,7 +863,7 @@ $$` : `${e}$$`;
|
|
|
837
863
|
{
|
|
838
864
|
handler: {
|
|
839
865
|
name: "italicSingleAsterisk",
|
|
840
|
-
handle:
|
|
866
|
+
handle: ln,
|
|
841
867
|
priority: L.ITALIC_SINGLE_ASTERISK
|
|
842
868
|
},
|
|
843
869
|
optionKey: "italic"
|
|
@@ -845,7 +871,7 @@ $$` : `${e}$$`;
|
|
|
845
871
|
{
|
|
846
872
|
handler: {
|
|
847
873
|
name: "italicSingleUnderscore",
|
|
848
|
-
handle:
|
|
874
|
+
handle: pn,
|
|
849
875
|
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
850
876
|
},
|
|
851
877
|
optionKey: "italic"
|
|
@@ -853,7 +879,7 @@ $$` : `${e}$$`;
|
|
|
853
879
|
{
|
|
854
880
|
handler: {
|
|
855
881
|
name: "inlineCode",
|
|
856
|
-
handle:
|
|
882
|
+
handle: Sn,
|
|
857
883
|
priority: L.INLINE_CODE
|
|
858
884
|
},
|
|
859
885
|
optionKey: "inlineCode"
|
|
@@ -861,7 +887,7 @@ $$` : `${e}$$`;
|
|
|
861
887
|
{
|
|
862
888
|
handler: {
|
|
863
889
|
name: "strikethrough",
|
|
864
|
-
handle:
|
|
890
|
+
handle: Un,
|
|
865
891
|
priority: L.STRIKETHROUGH
|
|
866
892
|
},
|
|
867
893
|
optionKey: "strikethrough"
|
|
@@ -869,7 +895,7 @@ $$` : `${e}$$`;
|
|
|
869
895
|
{
|
|
870
896
|
handler: {
|
|
871
897
|
name: "katex",
|
|
872
|
-
handle:
|
|
898
|
+
handle: En,
|
|
873
899
|
priority: L.KATEX
|
|
874
900
|
},
|
|
875
901
|
optionKey: "katex"
|
|
@@ -877,36 +903,36 @@ $$` : `${e}$$`;
|
|
|
877
903
|
{
|
|
878
904
|
handler: {
|
|
879
905
|
name: "inlineKatex",
|
|
880
|
-
handle:
|
|
906
|
+
handle: Dn,
|
|
881
907
|
priority: L.INLINE_KATEX
|
|
882
908
|
},
|
|
883
909
|
optionKey: "inlineKatex"
|
|
884
910
|
}
|
|
885
|
-
],
|
|
911
|
+
], qn = (e) => {
|
|
886
912
|
let t = e?.linkMode ?? "protocol";
|
|
887
|
-
return
|
|
888
|
-
handler:
|
|
913
|
+
return Kn.filter(({ handler: t, optionKey: n }) => t.name === "links" ? Wn(e?.links) || Wn(e?.images) : t.name === "inlineKatex" ? Gn(e?.inlineKatex) : Wn(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
914
|
+
handler: Ye(Je({}, e), { handle: (e) => Pn(e, t) }),
|
|
889
915
|
earlyReturn: t === "protocol" ? n : void 0
|
|
890
916
|
} : {
|
|
891
917
|
handler: e,
|
|
892
918
|
earlyReturn: n
|
|
893
919
|
});
|
|
894
|
-
},
|
|
920
|
+
}, Jn = (e, t) => {
|
|
895
921
|
if (!e || typeof e != "string") return e;
|
|
896
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
897
|
-
handler:
|
|
922
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = qn(t), i = (t?.handlers ?? []).map((e) => ({
|
|
923
|
+
handler: Ye(Je({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
898
924
|
earlyReturn: void 0
|
|
899
925
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
900
926
|
try {
|
|
901
927
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
902
928
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
903
929
|
} finally {
|
|
904
|
-
|
|
930
|
+
ft();
|
|
905
931
|
}
|
|
906
932
|
};
|
|
907
933
|
//#endregion
|
|
908
934
|
//#region ../../node_modules/.pnpm/marked@18.1.0/node_modules/marked/lib/marked.esm.js
|
|
909
|
-
function
|
|
935
|
+
function Yn() {
|
|
910
936
|
return {
|
|
911
937
|
async: !1,
|
|
912
938
|
breaks: !1,
|
|
@@ -920,12 +946,12 @@ function qn() {
|
|
|
920
946
|
walkTokens: null
|
|
921
947
|
};
|
|
922
948
|
}
|
|
923
|
-
var
|
|
924
|
-
function Yn(e) {
|
|
925
|
-
Jn = e;
|
|
926
|
-
}
|
|
927
|
-
var Xn = { exec: () => null };
|
|
949
|
+
var Xn = Yn();
|
|
928
950
|
function Zn(e) {
|
|
951
|
+
Xn = e;
|
|
952
|
+
}
|
|
953
|
+
var Qn = { exec: () => null };
|
|
954
|
+
function $n(e) {
|
|
929
955
|
let t = [];
|
|
930
956
|
return (n) => {
|
|
931
957
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -942,7 +968,7 @@ function R(e, t = "") {
|
|
|
942
968
|
};
|
|
943
969
|
return r;
|
|
944
970
|
}
|
|
945
|
-
var
|
|
971
|
+
var er = ((e = "") => {
|
|
946
972
|
try {
|
|
947
973
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
948
974
|
} catch {
|
|
@@ -1002,111 +1028,111 @@ var Qn = ((e = "") => {
|
|
|
1002
1028
|
notSpaceStart: /^\S*/,
|
|
1003
1029
|
endingNewline: /\n$/,
|
|
1004
1030
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1005
|
-
nextBulletRegex:
|
|
1006
|
-
hrRegex:
|
|
1007
|
-
fencesBeginRegex:
|
|
1008
|
-
headingBeginRegex:
|
|
1009
|
-
htmlBeginRegex:
|
|
1010
|
-
blockquoteBeginRegex:
|
|
1011
|
-
},
|
|
1012
|
-
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
1013
|
-
code:
|
|
1014
|
-
def:
|
|
1015
|
-
fences:
|
|
1016
|
-
heading:
|
|
1017
|
-
hr:
|
|
1018
|
-
html:
|
|
1019
|
-
lheading:
|
|
1020
|
-
list:
|
|
1021
|
-
newline:
|
|
1022
|
-
paragraph:
|
|
1023
|
-
table:
|
|
1024
|
-
text:
|
|
1025
|
-
},
|
|
1026
|
-
...
|
|
1027
|
-
lheading:
|
|
1028
|
-
table:
|
|
1029
|
-
paragraph: R(
|
|
1030
|
-
},
|
|
1031
|
-
...
|
|
1032
|
-
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
1031
|
+
nextBulletRegex: $n((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
1032
|
+
hrRegex: $n((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
1033
|
+
fencesBeginRegex: $n((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
1034
|
+
headingBeginRegex: $n((e) => RegExp(`^ {0,${e}}#`)),
|
|
1035
|
+
htmlBeginRegex: $n((e) => RegExp(`^ {0,${e}}(?:</?(?:${hr})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
1036
|
+
blockquoteBeginRegex: $n((e) => RegExp(`^ {0,${e}}>`))
|
|
1037
|
+
}, tr = /^(?:[ \t]*(?:\n|$))+/, nr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, rr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ir = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ar = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, or = / {0,3}(?:[*+-]|\d{1,9}[.)])/, sr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, cr = R(sr).replace(/bull/g, or).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(), lr = R(sr).replace(/bull/g, or).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(), ur = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, dr = /^[^\n]+/, fr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, pr = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", fr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), mr = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, or).getRegex(), hr = "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", gr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _r = R("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", gr).replace("tag", hr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), vr = (e) => R(ur).replace("hr", ir).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", hr).getRegex(), yr = vr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), br = vr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), xr = {
|
|
1038
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", br).getRegex(),
|
|
1039
|
+
code: nr,
|
|
1040
|
+
def: pr,
|
|
1041
|
+
fences: rr,
|
|
1042
|
+
heading: ar,
|
|
1043
|
+
hr: ir,
|
|
1044
|
+
html: _r,
|
|
1045
|
+
lheading: cr,
|
|
1046
|
+
list: mr,
|
|
1047
|
+
newline: tr,
|
|
1048
|
+
paragraph: yr,
|
|
1049
|
+
table: Qn,
|
|
1050
|
+
text: dr
|
|
1051
|
+
}, Sr = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ir).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", hr).getRegex(), Cr = {
|
|
1052
|
+
...xr,
|
|
1053
|
+
lheading: lr,
|
|
1054
|
+
table: Sr,
|
|
1055
|
+
paragraph: R(ur).replace("hr", ir).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Sr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", hr).getRegex()
|
|
1056
|
+
}, wr = {
|
|
1057
|
+
...xr,
|
|
1058
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", gr).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(),
|
|
1033
1059
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1034
1060
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1035
|
-
fences:
|
|
1061
|
+
fences: Qn,
|
|
1036
1062
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1037
|
-
paragraph: R(
|
|
1038
|
-
},
|
|
1039
|
-
_backpedal:
|
|
1040
|
-
anyPunctuation:
|
|
1041
|
-
autolink:
|
|
1042
|
-
blockSkip:
|
|
1043
|
-
br:
|
|
1044
|
-
code:
|
|
1045
|
-
del:
|
|
1046
|
-
delLDelim:
|
|
1047
|
-
delRDelim:
|
|
1048
|
-
emStrongLDelim: Ir,
|
|
1049
|
-
emStrongRDelimAst: Br,
|
|
1050
|
-
emStrongRDelimUnd: Ur,
|
|
1051
|
-
escape: Cr,
|
|
1052
|
-
link: $r,
|
|
1053
|
-
nolink: ti,
|
|
1054
|
-
punctuation: kr,
|
|
1055
|
-
reflink: ei,
|
|
1056
|
-
reflinkSearch: ii,
|
|
1057
|
-
tag: Xr,
|
|
1058
|
-
text: Er,
|
|
1059
|
-
url: Xn
|
|
1060
|
-
}, ci = {
|
|
1061
|
-
...si,
|
|
1063
|
+
paragraph: R(ur).replace("hr", ir).replace("heading", " *#{1,6} *[^\n]").replace("lheading", cr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1064
|
+
}, Tr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Er = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Dr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Or = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, kr = /[\s\p{P}\p{S}]/u, Ar = /[^\s\p{P}\p{S}]/u, jr = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, kr).getRegex(), Mr = /[\p{Pi}\p{Ps}"']/u, Nr = /(?!~)[\p{P}\p{S}]/u, Pr = /(?!~)[\s\p{P}\p{S}]/u, Fr = /(?:[^\s\p{P}\p{S}]|~)/u, Ir = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", er ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Lr = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Rr = R(Lr, "u").replace(/punct/g, B).getRegex(), zr = R(Lr, "u").replace(/punct/g, Nr).getRegex(), Br = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Mr).replace(/punct/g, B).getRegex(), Vr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hr = R(Vr, "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, kr).replace(/punct/g, B).getRegex(), Ur = R(Vr, "gu").replace(/notPunctSpace/g, Fr).replace(/punctSpace/g, Pr).replace(/punct/g, Nr).getRegex(), Wr = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, kr).replace(/punct/g, B).getRegex(), Gr = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, kr).replace(/punct/g, B).getRegex(), Kr = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, kr).replace(/punct/g, B).getRegex(), qr = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), Jr = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, kr).replace(/punct/g, B).getRegex(), Yr = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), Xr = R(/^<(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(), Zr = R(gr).replace("(?:-->|$)", "-->").getRegex(), Qr = R("^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", Zr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), $r = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, ei = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", $r).getRegex(), ti = R(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", ei).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ni = R(/^!?\[(label)\]\[(ref)\]/).replace("label", ei).replace("ref", fr).getRegex(), ri = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", fr).getRegex(), ii = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, ai = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", $r).getRegex(), oi = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", ai).replace("ref", ii).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", ii).getRegex()).getRegex(), si = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, ci = R(/(?: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(), li = {
|
|
1065
|
+
_backpedal: Qn,
|
|
1066
|
+
anyPunctuation: Yr,
|
|
1067
|
+
autolink: Xr,
|
|
1068
|
+
blockSkip: Ir,
|
|
1069
|
+
br: Dr,
|
|
1070
|
+
code: Er,
|
|
1071
|
+
del: Qn,
|
|
1072
|
+
delLDelim: Qn,
|
|
1073
|
+
delRDelim: Qn,
|
|
1062
1074
|
emStrongLDelim: Rr,
|
|
1063
1075
|
emStrongRDelimAst: Hr,
|
|
1064
|
-
emStrongRDelimUnd:
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
url:
|
|
1074
|
-
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1075
|
-
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1076
|
-
text: R(/^(?:[^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", ai).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1076
|
+
emStrongRDelimUnd: Gr,
|
|
1077
|
+
escape: Tr,
|
|
1078
|
+
link: ti,
|
|
1079
|
+
nolink: ri,
|
|
1080
|
+
punctuation: jr,
|
|
1081
|
+
reflink: ni,
|
|
1082
|
+
reflinkSearch: oi,
|
|
1083
|
+
tag: Qr,
|
|
1084
|
+
text: Or,
|
|
1085
|
+
url: Qn
|
|
1077
1086
|
}, ui = {
|
|
1078
1087
|
...li,
|
|
1079
|
-
|
|
1080
|
-
|
|
1088
|
+
emStrongLDelim: Br,
|
|
1089
|
+
emStrongRDelimAst: Wr,
|
|
1090
|
+
emStrongRDelimUnd: Kr,
|
|
1091
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", ei).getRegex(),
|
|
1092
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", ei).getRegex()
|
|
1081
1093
|
}, di = {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1094
|
+
...li,
|
|
1095
|
+
emStrongRDelimAst: Ur,
|
|
1096
|
+
emStrongLDelim: zr,
|
|
1097
|
+
delLDelim: qr,
|
|
1098
|
+
delRDelim: Jr,
|
|
1099
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", ci).replace("protocol", si).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1100
|
+
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1101
|
+
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1102
|
+
text: R(/^(?:[^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", si).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1085
1103
|
}, fi = {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
pedantic: ci
|
|
1104
|
+
...di,
|
|
1105
|
+
br: R(Dr).replace("{2,}", "*").getRegex(),
|
|
1106
|
+
text: R(di.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1090
1107
|
}, pi = {
|
|
1108
|
+
normal: xr,
|
|
1109
|
+
gfm: Cr,
|
|
1110
|
+
pedantic: wr
|
|
1111
|
+
}, mi = {
|
|
1112
|
+
normal: li,
|
|
1113
|
+
gfm: di,
|
|
1114
|
+
breaks: fi,
|
|
1115
|
+
pedantic: ui
|
|
1116
|
+
}, hi = {
|
|
1091
1117
|
"&": "&",
|
|
1092
1118
|
"<": "<",
|
|
1093
1119
|
">": ">",
|
|
1094
1120
|
"\"": """,
|
|
1095
1121
|
"'": "'"
|
|
1096
|
-
},
|
|
1122
|
+
}, gi = (e) => hi[e];
|
|
1097
1123
|
function V(e, t) {
|
|
1098
1124
|
if (t) {
|
|
1099
|
-
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace,
|
|
1100
|
-
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode,
|
|
1125
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, gi);
|
|
1126
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, gi);
|
|
1101
1127
|
return e;
|
|
1102
1128
|
}
|
|
1103
|
-
function
|
|
1129
|
+
function _i(e) {
|
|
1104
1130
|
return e.replace(z.numericCharacterReference, (e, t, n) => {
|
|
1105
1131
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
1106
1132
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
1107
1133
|
});
|
|
1108
1134
|
}
|
|
1109
|
-
function
|
|
1135
|
+
function vi(e) {
|
|
1110
1136
|
try {
|
|
1111
1137
|
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
1112
1138
|
} catch {
|
|
@@ -1114,7 +1140,7 @@ function gi(e) {
|
|
|
1114
1140
|
}
|
|
1115
1141
|
return e;
|
|
1116
1142
|
}
|
|
1117
|
-
function
|
|
1143
|
+
function yi(e, t) {
|
|
1118
1144
|
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
1119
1145
|
let r = !1, i = t;
|
|
1120
1146
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -1127,7 +1153,7 @@ function _i(e, t) {
|
|
|
1127
1153
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
1128
1154
|
return n;
|
|
1129
1155
|
}
|
|
1130
|
-
function
|
|
1156
|
+
function bi(e, t, n) {
|
|
1131
1157
|
let r = e.length;
|
|
1132
1158
|
if (r === 0) return "";
|
|
1133
1159
|
let i = 0;
|
|
@@ -1139,15 +1165,15 @@ function vi(e, t, n) {
|
|
|
1139
1165
|
}
|
|
1140
1166
|
return e.slice(0, r - i);
|
|
1141
1167
|
}
|
|
1142
|
-
function
|
|
1168
|
+
function xi(e) {
|
|
1143
1169
|
let t = e.split("\n"), n = t.length - 1;
|
|
1144
1170
|
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
1145
1171
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1146
1172
|
}
|
|
1147
|
-
function
|
|
1173
|
+
function Si(e) {
|
|
1148
1174
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1149
1175
|
}
|
|
1150
|
-
function
|
|
1176
|
+
function Ci(e, t) {
|
|
1151
1177
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
1152
1178
|
let n = 0;
|
|
1153
1179
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1155,7 +1181,7 @@ function xi(e, t) {
|
|
|
1155
1181
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1156
1182
|
return n > 0 ? -2 : -1;
|
|
1157
1183
|
}
|
|
1158
|
-
function
|
|
1184
|
+
function wi(e, t = 0) {
|
|
1159
1185
|
let n = t, r = "";
|
|
1160
1186
|
for (let t of e) if (t === " ") {
|
|
1161
1187
|
let e = 4 - n % 4;
|
|
@@ -1163,7 +1189,7 @@ function Si(e, t = 0) {
|
|
|
1163
1189
|
} else r += t, n++;
|
|
1164
1190
|
return r;
|
|
1165
1191
|
}
|
|
1166
|
-
function
|
|
1192
|
+
function Ti(e, t, n, r, i) {
|
|
1167
1193
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
|
|
1168
1194
|
r.state.inLink = !0;
|
|
1169
1195
|
let l = r.state.linkEmitted, u = r.state.inRawBlock;
|
|
@@ -1185,7 +1211,7 @@ function Ci(e, t, n, r, i) {
|
|
|
1185
1211
|
tokens: d
|
|
1186
1212
|
};
|
|
1187
1213
|
}
|
|
1188
|
-
function
|
|
1214
|
+
function Ei(e, t, n) {
|
|
1189
1215
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1190
1216
|
if (r === null) return t;
|
|
1191
1217
|
let i = r[1];
|
|
@@ -1196,7 +1222,7 @@ function wi(e, t, n) {
|
|
|
1196
1222
|
return e.slice(Math.min(r.length, i.length));
|
|
1197
1223
|
}).join("\n");
|
|
1198
1224
|
}
|
|
1199
|
-
function
|
|
1225
|
+
function Di(e, t, n, r) {
|
|
1200
1226
|
if (!t.includes("<")) return !1;
|
|
1201
1227
|
for (let i = 0; i < t.length; i++) {
|
|
1202
1228
|
if (t[i] === "\\") {
|
|
@@ -1219,12 +1245,12 @@ function Ti(e, t, n, r) {
|
|
|
1219
1245
|
}
|
|
1220
1246
|
return !1;
|
|
1221
1247
|
}
|
|
1222
|
-
var
|
|
1248
|
+
var Oi = class {
|
|
1223
1249
|
options;
|
|
1224
1250
|
rules;
|
|
1225
1251
|
lexer;
|
|
1226
1252
|
constructor(e) {
|
|
1227
|
-
this.options = e ||
|
|
1253
|
+
this.options = e || Xn;
|
|
1228
1254
|
}
|
|
1229
1255
|
space(e) {
|
|
1230
1256
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1236,7 +1262,7 @@ var Ei = class {
|
|
|
1236
1262
|
code(e) {
|
|
1237
1263
|
let t = this.rules.block.code.exec(e);
|
|
1238
1264
|
if (t) {
|
|
1239
|
-
let e = this.options.pedantic ? t[0] :
|
|
1265
|
+
let e = this.options.pedantic ? t[0] : xi(t[0]);
|
|
1240
1266
|
return {
|
|
1241
1267
|
type: "code",
|
|
1242
1268
|
raw: e,
|
|
@@ -1248,7 +1274,7 @@ var Ei = class {
|
|
|
1248
1274
|
fences(e) {
|
|
1249
1275
|
let t = this.rules.block.fences.exec(e);
|
|
1250
1276
|
if (t) {
|
|
1251
|
-
let e = t[0], n =
|
|
1277
|
+
let e = t[0], n = Ei(e, t[3] || "", this.rules);
|
|
1252
1278
|
return {
|
|
1253
1279
|
type: "code",
|
|
1254
1280
|
raw: e,
|
|
@@ -1262,12 +1288,12 @@ var Ei = class {
|
|
|
1262
1288
|
if (t) {
|
|
1263
1289
|
let e = t[2].trim();
|
|
1264
1290
|
if (this.rules.other.endingHash.test(e)) {
|
|
1265
|
-
let t =
|
|
1291
|
+
let t = bi(e, "#");
|
|
1266
1292
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1267
1293
|
}
|
|
1268
1294
|
return {
|
|
1269
1295
|
type: "heading",
|
|
1270
|
-
raw:
|
|
1296
|
+
raw: bi(t[0], "\n"),
|
|
1271
1297
|
depth: t[1].length,
|
|
1272
1298
|
text: e,
|
|
1273
1299
|
tokens: this.lexer.inline(e)
|
|
@@ -1278,13 +1304,13 @@ var Ei = class {
|
|
|
1278
1304
|
let t = this.rules.block.hr.exec(e);
|
|
1279
1305
|
if (t) return {
|
|
1280
1306
|
type: "hr",
|
|
1281
|
-
raw:
|
|
1307
|
+
raw: bi(t[0], "\n")
|
|
1282
1308
|
};
|
|
1283
1309
|
}
|
|
1284
1310
|
blockquote(e) {
|
|
1285
1311
|
let t = this.rules.block.blockquote.exec(e);
|
|
1286
1312
|
if (t) {
|
|
1287
|
-
let e =
|
|
1313
|
+
let e = bi(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1288
1314
|
for (; e.length > 0;) {
|
|
1289
1315
|
let t = !1, a = [], o = 0;
|
|
1290
1316
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1337,7 +1363,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1337
1363
|
let n = !1, r = "", s = "";
|
|
1338
1364
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1339
1365
|
r = t[0], e = e.substring(r.length);
|
|
1340
|
-
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ?
|
|
1366
|
+
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? wi(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => wi(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
|
|
1341
1367
|
if (this.options.pedantic ? (p = 2, s = u.trimStart()) : f ? p = l + 1 : (p = u.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = u.slice(p), p += l), f && this.rules.other.blankLine.test(d) && (r += d + "\n", e = e.substring(d.length + 1), n = !0), !n) {
|
|
1342
1368
|
let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), c = this.rules.other.blockquoteBeginRegex(p);
|
|
1343
1369
|
for (; e;) {
|
|
@@ -1402,7 +1428,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1402
1428
|
html(e) {
|
|
1403
1429
|
let t = this.rules.block.html.exec(e);
|
|
1404
1430
|
if (t) {
|
|
1405
|
-
let e =
|
|
1431
|
+
let e = xi(t[0]);
|
|
1406
1432
|
return {
|
|
1407
1433
|
type: "html",
|
|
1408
1434
|
block: !0,
|
|
@@ -1415,12 +1441,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1415
1441
|
def(e) {
|
|
1416
1442
|
let t = this.rules.block.def.exec(e);
|
|
1417
1443
|
if (t) {
|
|
1418
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1419
|
-
let e =
|
|
1444
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && Ci(t[2], "()") !== -1) return;
|
|
1445
|
+
let e = Si(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];
|
|
1420
1446
|
return {
|
|
1421
1447
|
type: "def",
|
|
1422
1448
|
tag: e,
|
|
1423
|
-
raw:
|
|
1449
|
+
raw: bi(t[0], "\n"),
|
|
1424
1450
|
href: n,
|
|
1425
1451
|
title: r
|
|
1426
1452
|
};
|
|
@@ -1429,9 +1455,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1429
1455
|
table(e) {
|
|
1430
1456
|
let t = this.rules.block.table.exec(e);
|
|
1431
1457
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1432
|
-
let n =
|
|
1458
|
+
let n = yi(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 = {
|
|
1433
1459
|
type: "table",
|
|
1434
|
-
raw:
|
|
1460
|
+
raw: bi(t[0], "\n"),
|
|
1435
1461
|
header: [],
|
|
1436
1462
|
align: [],
|
|
1437
1463
|
rows: []
|
|
@@ -1444,7 +1470,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1444
1470
|
header: !0,
|
|
1445
1471
|
align: a.align[e]
|
|
1446
1472
|
});
|
|
1447
|
-
for (let e of i) a.rows.push(
|
|
1473
|
+
for (let e of i) a.rows.push(yi(e, a.header.length).map((e, t) => ({
|
|
1448
1474
|
text: e,
|
|
1449
1475
|
tokens: this.lexer.inline(e),
|
|
1450
1476
|
header: !1,
|
|
@@ -1459,7 +1485,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1459
1485
|
let e = t[1].trim();
|
|
1460
1486
|
return {
|
|
1461
1487
|
type: "heading",
|
|
1462
|
-
raw:
|
|
1488
|
+
raw: bi(t[0], "\n"),
|
|
1463
1489
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1464
1490
|
text: e,
|
|
1465
1491
|
tokens: this.lexer.inline(e)
|
|
@@ -1511,14 +1537,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1511
1537
|
let t = this.rules.inline.link.exec(e);
|
|
1512
1538
|
if (t) {
|
|
1513
1539
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1514
|
-
if (!this.options.pedantic &&
|
|
1540
|
+
if (!this.options.pedantic && Di(e, t[1], n, this.rules)) return;
|
|
1515
1541
|
let r = t[2].trim();
|
|
1516
1542
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1517
1543
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1518
|
-
let e =
|
|
1544
|
+
let e = bi(r.slice(0, -1), "\\");
|
|
1519
1545
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1520
1546
|
} else {
|
|
1521
|
-
let e =
|
|
1547
|
+
let e = Ci(t[2], "()");
|
|
1522
1548
|
if (e === -2) return;
|
|
1523
1549
|
if (e > -1) {
|
|
1524
1550
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1530,7 +1556,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1530
1556
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1531
1557
|
e && (i = e[1], a = e[3]);
|
|
1532
1558
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1533
|
-
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)),
|
|
1559
|
+
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)), Ti(t, {
|
|
1534
1560
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1535
1561
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1536
1562
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1540,8 +1566,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1540
1566
|
let n;
|
|
1541
1567
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1542
1568
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1543
|
-
if (!this.options.pedantic &&
|
|
1544
|
-
let i = t[
|
|
1569
|
+
if (!this.options.pedantic && Di(e, n[1], r, this.rules)) return;
|
|
1570
|
+
let i = t[Si((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1545
1571
|
if (!i) {
|
|
1546
1572
|
let e = n[0].charAt(0);
|
|
1547
1573
|
return {
|
|
@@ -1550,7 +1576,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1550
1576
|
text: e
|
|
1551
1577
|
};
|
|
1552
1578
|
}
|
|
1553
|
-
return
|
|
1579
|
+
return Ti(n, i, n[0], this.lexer, this.rules);
|
|
1554
1580
|
}
|
|
1555
1581
|
}
|
|
1556
1582
|
emStrong(e, t, n = "") {
|
|
@@ -1683,7 +1709,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1683
1709
|
return {
|
|
1684
1710
|
type: "text",
|
|
1685
1711
|
raw: t[0],
|
|
1686
|
-
text: e ? t[0] :
|
|
1712
|
+
text: e ? t[0] : _i(t[0]),
|
|
1687
1713
|
escaped: e
|
|
1688
1714
|
};
|
|
1689
1715
|
}
|
|
@@ -1695,7 +1721,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1695
1721
|
inlineQueue;
|
|
1696
1722
|
tokenizer;
|
|
1697
1723
|
constructor(e) {
|
|
1698
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1724
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || Xn, this.options.tokenizer = this.options.tokenizer || new Oi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1699
1725
|
inLink: !1,
|
|
1700
1726
|
inRawBlock: !1,
|
|
1701
1727
|
linkEmitted: !1,
|
|
@@ -1704,15 +1730,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1704
1730
|
};
|
|
1705
1731
|
let t = {
|
|
1706
1732
|
other: z,
|
|
1707
|
-
block:
|
|
1708
|
-
inline:
|
|
1733
|
+
block: pi.normal,
|
|
1734
|
+
inline: mi.normal
|
|
1709
1735
|
};
|
|
1710
|
-
this.options.pedantic ? (t.block =
|
|
1736
|
+
this.options.pedantic ? (t.block = pi.pedantic, t.inline = mi.pedantic) : this.options.gfm && (t.block = pi.gfm, t.inline = this.options.breaks ? mi.breaks : mi.gfm), this.tokenizer.rules = t;
|
|
1711
1737
|
}
|
|
1712
1738
|
static get rules() {
|
|
1713
1739
|
return {
|
|
1714
|
-
block:
|
|
1715
|
-
inline:
|
|
1740
|
+
block: pi,
|
|
1741
|
+
inline: mi
|
|
1716
1742
|
};
|
|
1717
1743
|
}
|
|
1718
1744
|
static lex(t, n) {
|
|
@@ -1802,7 +1828,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1802
1828
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1803
1829
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1804
1830
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1805
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1831
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Si(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1806
1832
|
}
|
|
1807
1833
|
return !1;
|
|
1808
1834
|
}
|
|
@@ -1821,7 +1847,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1821
1847
|
if (this.tokens.links && e.includes("[")) {
|
|
1822
1848
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1823
1849
|
let r = n.lastIndexOf("[");
|
|
1824
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1850
|
+
if (!Object.hasOwn(this.tokens.links, Si(n.slice(r + 1, -1)))) return n;
|
|
1825
1851
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1826
1852
|
let i = n.slice(1, r - 1);
|
|
1827
1853
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1881,11 +1907,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1881
1907
|
if (this.options.silent) console.error(t);
|
|
1882
1908
|
else throw Error(t);
|
|
1883
1909
|
}
|
|
1884
|
-
},
|
|
1910
|
+
}, ki = class {
|
|
1885
1911
|
options;
|
|
1886
1912
|
parser;
|
|
1887
1913
|
constructor(e) {
|
|
1888
|
-
this.options = e ||
|
|
1914
|
+
this.options = e || Xn;
|
|
1889
1915
|
}
|
|
1890
1916
|
space(e) {
|
|
1891
1917
|
return "";
|
|
@@ -1971,7 +1997,7 @@ ${e}</tr>
|
|
|
1971
1997
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1972
1998
|
}
|
|
1973
1999
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
1974
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
2000
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = vi(e);
|
|
1975
2001
|
if (o === null) return a;
|
|
1976
2002
|
e = V(o, i);
|
|
1977
2003
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -1979,7 +2005,7 @@ ${e}</tr>
|
|
|
1979
2005
|
}
|
|
1980
2006
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1981
2007
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1982
|
-
let i =
|
|
2008
|
+
let i = vi(e);
|
|
1983
2009
|
if (i === null) return V(n);
|
|
1984
2010
|
e = i;
|
|
1985
2011
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -1988,7 +2014,7 @@ ${e}</tr>
|
|
|
1988
2014
|
text(e) {
|
|
1989
2015
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
1990
2016
|
}
|
|
1991
|
-
},
|
|
2017
|
+
}, Ai = class {
|
|
1992
2018
|
strong({ text: e }) {
|
|
1993
2019
|
return e;
|
|
1994
2020
|
}
|
|
@@ -2024,7 +2050,7 @@ ${e}</tr>
|
|
|
2024
2050
|
renderer;
|
|
2025
2051
|
textRenderer;
|
|
2026
2052
|
constructor(e) {
|
|
2027
|
-
this.options = e ||
|
|
2053
|
+
this.options = e || Xn, this.options.renderer = this.options.renderer || new ki(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Ai();
|
|
2028
2054
|
}
|
|
2029
2055
|
static parse(t, n) {
|
|
2030
2056
|
return new e(n).parse(t);
|
|
@@ -2172,11 +2198,11 @@ ${e}</tr>
|
|
|
2172
2198
|
}
|
|
2173
2199
|
return n;
|
|
2174
2200
|
}
|
|
2175
|
-
},
|
|
2201
|
+
}, ji = class {
|
|
2176
2202
|
options;
|
|
2177
2203
|
block;
|
|
2178
2204
|
constructor(e) {
|
|
2179
|
-
this.options = e ||
|
|
2205
|
+
this.options = e || Xn;
|
|
2180
2206
|
}
|
|
2181
2207
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2182
2208
|
"preprocess",
|
|
@@ -2207,17 +2233,17 @@ ${e}</tr>
|
|
|
2207
2233
|
provideParser(e = this.block) {
|
|
2208
2234
|
return e ? U.parse : U.parseInline;
|
|
2209
2235
|
}
|
|
2210
|
-
},
|
|
2211
|
-
defaults =
|
|
2236
|
+
}, Mi = new class {
|
|
2237
|
+
defaults = Yn();
|
|
2212
2238
|
options = this.setOptions;
|
|
2213
2239
|
parse = this.parseMarkdown(!0);
|
|
2214
2240
|
parseInline = this.parseMarkdown(!1);
|
|
2215
2241
|
Parser = U;
|
|
2216
|
-
Renderer =
|
|
2217
|
-
TextRenderer =
|
|
2242
|
+
Renderer = ki;
|
|
2243
|
+
TextRenderer = Ai;
|
|
2218
2244
|
Lexer = H;
|
|
2219
|
-
Tokenizer =
|
|
2220
|
-
Hooks =
|
|
2245
|
+
Tokenizer = Oi;
|
|
2246
|
+
Hooks = ji;
|
|
2221
2247
|
constructor(...e) {
|
|
2222
2248
|
this.use(...e);
|
|
2223
2249
|
}
|
|
@@ -2268,7 +2294,7 @@ ${e}</tr>
|
|
|
2268
2294
|
}
|
|
2269
2295
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2270
2296
|
}), n.extensions = t), e.renderer) {
|
|
2271
|
-
let t = this.defaults.renderer || new
|
|
2297
|
+
let t = this.defaults.renderer || new ki(this.defaults);
|
|
2272
2298
|
for (let n in e.renderer) {
|
|
2273
2299
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2274
2300
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2281,7 +2307,7 @@ ${e}</tr>
|
|
|
2281
2307
|
n.renderer = t;
|
|
2282
2308
|
}
|
|
2283
2309
|
if (e.tokenizer) {
|
|
2284
|
-
let t = this.defaults.tokenizer || new
|
|
2310
|
+
let t = this.defaults.tokenizer || new Oi(this.defaults);
|
|
2285
2311
|
for (let n in e.tokenizer) {
|
|
2286
2312
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2287
2313
|
if ([
|
|
@@ -2298,13 +2324,13 @@ ${e}</tr>
|
|
|
2298
2324
|
n.tokenizer = t;
|
|
2299
2325
|
}
|
|
2300
2326
|
if (e.hooks) {
|
|
2301
|
-
let t = this.defaults.hooks || new
|
|
2327
|
+
let t = this.defaults.hooks || new ji();
|
|
2302
2328
|
for (let n in e.hooks) {
|
|
2303
2329
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2304
2330
|
if (["options", "block"].includes(n)) continue;
|
|
2305
2331
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2306
|
-
t[r] =
|
|
2307
|
-
if (this.defaults.async &&
|
|
2332
|
+
t[r] = ji.passThroughHooks.has(n) ? (e) => {
|
|
2333
|
+
if (this.defaults.async && ji.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2308
2334
|
let n = await i.call(t, e);
|
|
2309
2335
|
return a.call(t, n);
|
|
2310
2336
|
})();
|
|
@@ -2384,31 +2410,31 @@ ${e}</tr>
|
|
|
2384
2410
|
}
|
|
2385
2411
|
}();
|
|
2386
2412
|
function W(e, t) {
|
|
2387
|
-
return
|
|
2413
|
+
return Mi.parse(e, t);
|
|
2388
2414
|
}
|
|
2389
2415
|
W.options = W.setOptions = function(e) {
|
|
2390
|
-
return
|
|
2391
|
-
}, W.getDefaults =
|
|
2392
|
-
function
|
|
2393
|
-
return
|
|
2394
|
-
}
|
|
2395
|
-
W.use =
|
|
2396
|
-
return
|
|
2397
|
-
}, W.parseInline =
|
|
2416
|
+
return Mi.setOptions(e), W.defaults = Mi.defaults, Zn(W.defaults), W;
|
|
2417
|
+
}, W.getDefaults = Yn, W.defaults = Xn;
|
|
2418
|
+
function Ni(...e) {
|
|
2419
|
+
return Mi.use(...e), W.defaults = Mi.defaults, Zn(W.defaults), W;
|
|
2420
|
+
}
|
|
2421
|
+
W.use = Ni, W.walkTokens = function(e, t) {
|
|
2422
|
+
return Mi.walkTokens(e, t);
|
|
2423
|
+
}, W.parseInline = Mi.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = ki, W.TextRenderer = Ai, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Oi, W.Hooks = ji, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2398
2424
|
//#endregion
|
|
2399
2425
|
//#region ../../node_modules/.pnpm/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.mjs
|
|
2400
|
-
function
|
|
2426
|
+
function Pi(e, t) {
|
|
2401
2427
|
this.v = e, this.k = t;
|
|
2402
2428
|
}
|
|
2403
|
-
function
|
|
2429
|
+
function Fi(e, t) {
|
|
2404
2430
|
(t == null || t > e.length) && (t = e.length);
|
|
2405
2431
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2406
2432
|
return r;
|
|
2407
2433
|
}
|
|
2408
|
-
function
|
|
2434
|
+
function Ii(e) {
|
|
2409
2435
|
if (Array.isArray(e)) return e;
|
|
2410
2436
|
}
|
|
2411
|
-
function
|
|
2437
|
+
function Li(e, t) {
|
|
2412
2438
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2413
2439
|
if (n != null) {
|
|
2414
2440
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2429,24 +2455,24 @@ function Fi(e, t) {
|
|
|
2429
2455
|
return s;
|
|
2430
2456
|
}
|
|
2431
2457
|
}
|
|
2432
|
-
function
|
|
2458
|
+
function Ri() {
|
|
2433
2459
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2434
2460
|
}
|
|
2435
|
-
function
|
|
2436
|
-
return
|
|
2461
|
+
function zi(e, t) {
|
|
2462
|
+
return Ii(e) || Li(e, t) || Bi(e, t) || Ri();
|
|
2437
2463
|
}
|
|
2438
|
-
function
|
|
2464
|
+
function Bi(e, t) {
|
|
2439
2465
|
if (e) {
|
|
2440
|
-
if (typeof e == "string") return
|
|
2466
|
+
if (typeof e == "string") return Fi(e, t);
|
|
2441
2467
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2442
|
-
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) ?
|
|
2468
|
+
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) ? Fi(e, t) : void 0;
|
|
2443
2469
|
}
|
|
2444
2470
|
}
|
|
2445
|
-
function
|
|
2471
|
+
function Vi(e) {
|
|
2446
2472
|
var t, n;
|
|
2447
2473
|
function r(t, n) {
|
|
2448
2474
|
try {
|
|
2449
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2475
|
+
var a = e[t](n), o = a.value, s = o instanceof Pi;
|
|
2450
2476
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2451
2477
|
if (s) {
|
|
2452
2478
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2480,113 +2506,113 @@ function zi(e) {
|
|
|
2480
2506
|
});
|
|
2481
2507
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2482
2508
|
}
|
|
2483
|
-
|
|
2509
|
+
Vi.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2484
2510
|
return this;
|
|
2485
|
-
},
|
|
2511
|
+
}, Vi.prototype.next = function(e) {
|
|
2486
2512
|
return this._invoke("next", e);
|
|
2487
|
-
},
|
|
2513
|
+
}, Vi.prototype.throw = function(e) {
|
|
2488
2514
|
return this._invoke("throw", e);
|
|
2489
|
-
},
|
|
2515
|
+
}, Vi.prototype.return = function(e) {
|
|
2490
2516
|
return this._invoke("return", e);
|
|
2491
2517
|
};
|
|
2492
|
-
var
|
|
2518
|
+
var Hi = Object.entries, Ui = Object.setPrototypeOf, Wi = Object.isFrozen, Gi = Object.getPrototypeOf, Ki = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, qi = Object.create, Ji = typeof Reflect < "u" && Reflect, Yi = Ji.apply, Xi = Ji.construct;
|
|
2493
2519
|
G ||= function(e) {
|
|
2494
2520
|
return e;
|
|
2495
2521
|
}, K ||= function(e) {
|
|
2496
2522
|
return e;
|
|
2497
|
-
},
|
|
2523
|
+
}, Yi ||= function(e, t) {
|
|
2498
2524
|
var n = [...arguments].slice(2);
|
|
2499
2525
|
return e.apply(t, n);
|
|
2500
|
-
},
|
|
2526
|
+
}, Xi ||= function(e) {
|
|
2501
2527
|
return new e(...[...arguments].slice(1));
|
|
2502
2528
|
};
|
|
2503
|
-
var
|
|
2529
|
+
var Zi = Y(Array.prototype.forEach);
|
|
2504
2530
|
Array.prototype.indexOf;
|
|
2505
|
-
var
|
|
2531
|
+
var Qi = Y(Array.prototype.lastIndexOf), $i = Y(Array.prototype.pop), ea = Y(Array.prototype.push);
|
|
2506
2532
|
Array.prototype.slice;
|
|
2507
|
-
var
|
|
2533
|
+
var ta = Y(Array.prototype.splice), na = Array.isArray, ra = Y(String.prototype.toLowerCase), ia = Y(String.prototype.toString), aa = Y(String.prototype.match), oa = Y(String.prototype.replace), sa = Y(String.prototype.indexOf), ca = Y(String.prototype.trim), la = Y(Number.prototype.toString), ua = Y(Boolean.prototype.toString), da = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), fa = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), pa = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), ma = ha(TypeError);
|
|
2508
2534
|
function Y(e) {
|
|
2509
2535
|
return function(t) {
|
|
2510
2536
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2511
2537
|
var n = [...arguments].slice(1);
|
|
2512
|
-
return
|
|
2538
|
+
return Yi(e, t, n);
|
|
2513
2539
|
};
|
|
2514
2540
|
}
|
|
2515
|
-
function
|
|
2541
|
+
function ha(e) {
|
|
2516
2542
|
return function() {
|
|
2517
|
-
return
|
|
2543
|
+
return Xi(e, [...arguments]);
|
|
2518
2544
|
};
|
|
2519
2545
|
}
|
|
2520
2546
|
function X(e, t) {
|
|
2521
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2522
|
-
if (
|
|
2547
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ra;
|
|
2548
|
+
if (Ui && Ui(e, null), !na(t)) return e;
|
|
2523
2549
|
let r = t.length;
|
|
2524
2550
|
for (; r--;) {
|
|
2525
2551
|
let i = t[r];
|
|
2526
2552
|
if (typeof i == "string") {
|
|
2527
2553
|
let e = n(i);
|
|
2528
|
-
e !== i && (
|
|
2554
|
+
e !== i && (Wi(t) || (t[r] = e), i = e);
|
|
2529
2555
|
}
|
|
2530
2556
|
e[i] = !0;
|
|
2531
2557
|
}
|
|
2532
2558
|
return e;
|
|
2533
2559
|
}
|
|
2534
|
-
function
|
|
2560
|
+
function ga(e) {
|
|
2535
2561
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2536
2562
|
return e;
|
|
2537
2563
|
}
|
|
2538
2564
|
function Z(e) {
|
|
2539
|
-
let t =
|
|
2540
|
-
for (let r of
|
|
2541
|
-
var n =
|
|
2565
|
+
let t = qi(null);
|
|
2566
|
+
for (let r of Hi(e)) {
|
|
2567
|
+
var n = zi(r, 2);
|
|
2542
2568
|
let i = n[0], a = n[1];
|
|
2543
|
-
q(e, i) && (t[i] =
|
|
2569
|
+
q(e, i) && (t[i] = na(a) ? ga(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2544
2570
|
}
|
|
2545
2571
|
return t;
|
|
2546
2572
|
}
|
|
2547
|
-
function
|
|
2573
|
+
function _a(e) {
|
|
2548
2574
|
switch (typeof e) {
|
|
2549
2575
|
case "string": return e;
|
|
2550
|
-
case "number": return
|
|
2551
|
-
case "boolean": return
|
|
2552
|
-
case "bigint": return
|
|
2553
|
-
case "symbol": return
|
|
2554
|
-
case "undefined": return
|
|
2576
|
+
case "number": return la(e);
|
|
2577
|
+
case "boolean": return ua(e);
|
|
2578
|
+
case "bigint": return da ? da(e) : "0";
|
|
2579
|
+
case "symbol": return fa ? fa(e) : "Symbol()";
|
|
2580
|
+
case "undefined": return pa(e);
|
|
2555
2581
|
case "function":
|
|
2556
2582
|
case "object": {
|
|
2557
|
-
if (e === null) return
|
|
2583
|
+
if (e === null) return pa(e);
|
|
2558
2584
|
let t = e, n = Q(t, "toString");
|
|
2559
2585
|
if (typeof n == "function") {
|
|
2560
2586
|
let e = n(t);
|
|
2561
|
-
return typeof e == "string" ? e :
|
|
2587
|
+
return typeof e == "string" ? e : pa(e);
|
|
2562
2588
|
}
|
|
2563
|
-
return
|
|
2589
|
+
return pa(e);
|
|
2564
2590
|
}
|
|
2565
|
-
default: return
|
|
2591
|
+
default: return pa(e);
|
|
2566
2592
|
}
|
|
2567
2593
|
}
|
|
2568
2594
|
function Q(e, t) {
|
|
2569
2595
|
for (; e !== null;) {
|
|
2570
|
-
let n =
|
|
2596
|
+
let n = Ki(e, t);
|
|
2571
2597
|
if (n) {
|
|
2572
2598
|
if (n.get) return Y(n.get);
|
|
2573
2599
|
if (typeof n.value == "function") return Y(n.value);
|
|
2574
2600
|
}
|
|
2575
|
-
e =
|
|
2601
|
+
e = Gi(e);
|
|
2576
2602
|
}
|
|
2577
2603
|
function n() {
|
|
2578
2604
|
return null;
|
|
2579
2605
|
}
|
|
2580
2606
|
return n;
|
|
2581
2607
|
}
|
|
2582
|
-
function
|
|
2608
|
+
function va(e) {
|
|
2583
2609
|
try {
|
|
2584
2610
|
return J(e, ""), !0;
|
|
2585
2611
|
} catch {
|
|
2586
2612
|
return !1;
|
|
2587
2613
|
}
|
|
2588
2614
|
}
|
|
2589
|
-
var
|
|
2615
|
+
var ya = 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(".")), ba = 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(".")), xa = G([
|
|
2590
2616
|
"feBlend",
|
|
2591
2617
|
"feColorMatrix",
|
|
2592
2618
|
"feComponentTransfer",
|
|
@@ -2612,7 +2638,7 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2612
2638
|
"feSpotLight",
|
|
2613
2639
|
"feTile",
|
|
2614
2640
|
"feTurbulence"
|
|
2615
|
-
]),
|
|
2641
|
+
]), Sa = G([
|
|
2616
2642
|
"animate",
|
|
2617
2643
|
"color-profile",
|
|
2618
2644
|
"cursor",
|
|
@@ -2635,7 +2661,7 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2635
2661
|
"solidcolor",
|
|
2636
2662
|
"unknown",
|
|
2637
2663
|
"use"
|
|
2638
|
-
]),
|
|
2664
|
+
]), Ca = 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(".")), wa = G([
|
|
2639
2665
|
"maction",
|
|
2640
2666
|
"maligngroup",
|
|
2641
2667
|
"malignmark",
|
|
@@ -2651,13 +2677,13 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2651
2677
|
"annotation-xml",
|
|
2652
2678
|
"mprescripts",
|
|
2653
2679
|
"none"
|
|
2654
|
-
]),
|
|
2680
|
+
]), Ta = G(["#text"]), Ea = 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(".")), Da = 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(".")), Oa = 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(".")), ka = G([
|
|
2655
2681
|
"xlink:href",
|
|
2656
2682
|
"xml:id",
|
|
2657
2683
|
"xlink:title",
|
|
2658
2684
|
"xml:space",
|
|
2659
2685
|
"xmlns:xlink"
|
|
2660
|
-
]),
|
|
2686
|
+
]), Aa = K(/{{[\w\W]*|^[\w\W]*}}/g), ja = K(/<%[\w\W]*|^[\w\W]*%>/g), Ma = K(/\${[\w\W]*/g), Na = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Pa = K(/^aria-[\-\w]+$/), Fa = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ia = K(/^(?:\w+script|data):/i), La = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Ra = K(/^html$/i), za = K(/^[a-z][.\w]*(-[.\w]+)+$/i), Ba = K(/<[/\w!]/g), Va = K(/<[/\w]/g), Ha = K(/<\/no(script|embed|frames)/i), Ua = K(/\/>/i), $ = {
|
|
2661
2687
|
element: 1,
|
|
2662
2688
|
attribute: 2,
|
|
2663
2689
|
text: 3,
|
|
@@ -2670,7 +2696,7 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2670
2696
|
documentType: 10,
|
|
2671
2697
|
documentFragment: 11,
|
|
2672
2698
|
notation: 12
|
|
2673
|
-
},
|
|
2699
|
+
}, Wa = [
|
|
2674
2700
|
"style",
|
|
2675
2701
|
"script",
|
|
2676
2702
|
"xmp",
|
|
@@ -2679,14 +2705,14 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2679
2705
|
"noframes",
|
|
2680
2706
|
"plaintext",
|
|
2681
2707
|
"noscript"
|
|
2682
|
-
],
|
|
2708
|
+
], Ga = G(X({}, Wa)), Ka = function() {
|
|
2683
2709
|
let e = {};
|
|
2684
|
-
return
|
|
2710
|
+
return Zi(Wa, (t) => {
|
|
2685
2711
|
e[t] = K(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2686
2712
|
}), G(e);
|
|
2687
|
-
}(),
|
|
2713
|
+
}(), qa = function() {
|
|
2688
2714
|
return typeof window > "u" ? null : window;
|
|
2689
|
-
},
|
|
2715
|
+
}, Ja = function(e, t) {
|
|
2690
2716
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2691
2717
|
let n = null, r = "data-tt-policy-suffix";
|
|
2692
2718
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2703,7 +2729,7 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2703
2729
|
} catch {
|
|
2704
2730
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2705
2731
|
}
|
|
2706
|
-
},
|
|
2732
|
+
}, Ya = function() {
|
|
2707
2733
|
return {
|
|
2708
2734
|
afterSanitizeAttributes: [],
|
|
2709
2735
|
afterSanitizeElements: [],
|
|
@@ -2715,14 +2741,14 @@ var _a = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2715
2741
|
uponSanitizeElement: [],
|
|
2716
2742
|
uponSanitizeShadowNode: []
|
|
2717
2743
|
};
|
|
2718
|
-
},
|
|
2719
|
-
return q(e, t) &&
|
|
2720
|
-
},
|
|
2744
|
+
}, Xa = function(e, t, n, r) {
|
|
2745
|
+
return q(e, t) && na(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2746
|
+
}, Za = function(e, t, n) {
|
|
2721
2747
|
let r = q(e, t) ? e[t] : void 0;
|
|
2722
2748
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2723
2749
|
};
|
|
2724
|
-
function
|
|
2725
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2750
|
+
function Qa() {
|
|
2751
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : qa(), t = (e) => Qa(e);
|
|
2726
2752
|
if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2727
2753
|
let n = e.document, r = n, i = r.currentScript;
|
|
2728
2754
|
e.DocumentFragment;
|
|
@@ -2737,38 +2763,38 @@ function Xa() {
|
|
|
2737
2763
|
let e = n.createElement("template");
|
|
2738
2764
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2739
2765
|
}
|
|
2740
|
-
let h, g = "",
|
|
2741
|
-
if (
|
|
2766
|
+
let h, g = "", ue, de = !1, _ = 0, fe = function() {
|
|
2767
|
+
if (_ > 0) throw ma("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.");
|
|
2742
2768
|
}, pe = function(e) {
|
|
2743
|
-
fe(),
|
|
2769
|
+
fe(), _++;
|
|
2744
2770
|
try {
|
|
2745
2771
|
return h.createHTML(e);
|
|
2746
2772
|
} finally {
|
|
2747
|
-
|
|
2773
|
+
_--;
|
|
2748
2774
|
}
|
|
2749
2775
|
}, me = function(e) {
|
|
2750
|
-
fe(),
|
|
2776
|
+
fe(), _++;
|
|
2751
2777
|
try {
|
|
2752
2778
|
return h.createScriptURL(e);
|
|
2753
2779
|
} finally {
|
|
2754
|
-
|
|
2780
|
+
_--;
|
|
2755
2781
|
}
|
|
2756
2782
|
}, he = function() {
|
|
2757
|
-
return
|
|
2758
|
-
}, ge = n, v = ge.implementation, _e = ge.createNodeIterator, ve = ge.createDocumentFragment, ye = ge.getElementsByTagName, be = r.importNode, y =
|
|
2759
|
-
t.isSupported = typeof
|
|
2760
|
-
let xe =
|
|
2761
|
-
..._a,
|
|
2762
|
-
...va,
|
|
2783
|
+
return de ||= (ue = Ja(u, i), !0), ue;
|
|
2784
|
+
}, ge = n, v = ge.implementation, _e = ge.createNodeIterator, ve = ge.createDocumentFragment, ye = ge.getElementsByTagName, be = r.importNode, y = Ya();
|
|
2785
|
+
t.isSupported = typeof Hi == "function" && typeof re == "function" && v && v.createHTMLDocument !== void 0;
|
|
2786
|
+
let xe = Aa, Se = ja, Ce = Ma, we = Na, Te = Pa, Ee = Ia, De = La, Oe = za, ke = Fa, b = null, Ae = X({}, [
|
|
2763
2787
|
...ya,
|
|
2788
|
+
...ba,
|
|
2764
2789
|
...xa,
|
|
2765
|
-
...Ca
|
|
2790
|
+
...Ca,
|
|
2791
|
+
...Ta
|
|
2766
2792
|
]), x = null, je = X({}, [
|
|
2767
|
-
...wa,
|
|
2768
|
-
...Ta,
|
|
2769
2793
|
...Ea,
|
|
2770
|
-
...Da
|
|
2771
|
-
|
|
2794
|
+
...Da,
|
|
2795
|
+
...Oa,
|
|
2796
|
+
...ka
|
|
2797
|
+
]), S = Object.seal(qi(null, {
|
|
2772
2798
|
tagNameCheck: {
|
|
2773
2799
|
writable: !0,
|
|
2774
2800
|
configurable: !1,
|
|
@@ -2787,7 +2813,7 @@ function Xa() {
|
|
|
2787
2813
|
enumerable: !0,
|
|
2788
2814
|
value: !1
|
|
2789
2815
|
}
|
|
2790
|
-
})), Me = null, Ne = null, C = Object.seal(
|
|
2816
|
+
})), Me = null, Ne = null, C = Object.seal(qi(null, {
|
|
2791
2817
|
tagCheck: {
|
|
2792
2818
|
writable: !0,
|
|
2793
2819
|
configurable: !1,
|
|
@@ -2800,7 +2826,7 @@ function Xa() {
|
|
|
2800
2826
|
enumerable: !0,
|
|
2801
2827
|
value: null
|
|
2802
2828
|
}
|
|
2803
|
-
})), Pe = !0, Fe = !0, Ie = !1,
|
|
2829
|
+
})), Pe = !0, Fe = !0, Ie = !1, Le = !0, w = !1, T = !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, E = !1, Xe = {}, Ze = null, Qe = 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(".")), $e = null, et = X({}, [
|
|
2804
2830
|
"audio",
|
|
2805
2831
|
"video",
|
|
2806
2832
|
"img",
|
|
@@ -2826,38 +2852,38 @@ function Xa() {
|
|
|
2826
2852
|
rt,
|
|
2827
2853
|
it,
|
|
2828
2854
|
D
|
|
2829
|
-
],
|
|
2855
|
+
], ia), lt = G([
|
|
2830
2856
|
"mi",
|
|
2831
2857
|
"mo",
|
|
2832
2858
|
"mn",
|
|
2833
2859
|
"ms",
|
|
2834
2860
|
"mtext"
|
|
2835
|
-
]),
|
|
2861
|
+
]), ut = X({}, lt), dt = G(["annotation-xml"]), O = X({}, dt), ft = X({}, [
|
|
2836
2862
|
"title",
|
|
2837
2863
|
"style",
|
|
2838
2864
|
"font",
|
|
2839
2865
|
"a",
|
|
2840
2866
|
"script"
|
|
2841
|
-
]), pt = null, mt = ["application/xhtml+xml", "text/html"], k = null,
|
|
2867
|
+
]), pt = null, mt = ["application/xhtml+xml", "text/html"], k = null, A = null, ht = n.createElement("form"), gt = function(e) {
|
|
2842
2868
|
return e instanceof RegExp || e instanceof Function;
|
|
2843
|
-
},
|
|
2869
|
+
}, _t = function() {
|
|
2844
2870
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2845
|
-
if (
|
|
2846
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e), pt = mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = pt === "application/xhtml+xml" ?
|
|
2871
|
+
if (A && A === e) return;
|
|
2872
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), pt = mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, k = pt === "application/xhtml+xml" ? ia : ra, b = Xa(e, "ALLOWED_TAGS", Ae, { transform: k }), x = Xa(e, "ALLOWED_ATTR", je, { transform: k }), st = Xa(e, "ALLOWED_NAMESPACES", ct, { transform: ia }), tt = Xa(e, "ADD_URI_SAFE_ATTR", nt, {
|
|
2847
2873
|
transform: k,
|
|
2848
2874
|
base: nt
|
|
2849
|
-
}), $e =
|
|
2875
|
+
}), $e = Xa(e, "ADD_DATA_URI_TAGS", et, {
|
|
2850
2876
|
transform: k,
|
|
2851
2877
|
base: et
|
|
2852
|
-
}), Ze =
|
|
2853
|
-
let t =
|
|
2854
|
-
if (S =
|
|
2878
|
+
}), Ze = Xa(e, "FORBID_CONTENTS", Qe, { transform: k }), Me = Xa(e, "FORBID_TAGS", Z({}), { transform: k }), Ne = Xa(e, "FORBID_ATTR", Z({}), { transform: k }), Xe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Pe = e.ALLOW_ARIA_ATTR !== !1, Fe = e.ALLOW_DATA_ATTR !== !1, Ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Le = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, w = e.SAFE_FOR_TEMPLATES || !1, T = 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, E = e.IN_PLACE || !1, ke = va(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Fa, at = typeof e.NAMESPACE == "string" ? e.NAMESPACE : D, ut = Za(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, lt)), O = Za(e, "HTML_INTEGRATION_POINTS", () => X({}, dt));
|
|
2879
|
+
let t = Za(e, "CUSTOM_ELEMENT_HANDLING", () => qi(null));
|
|
2880
|
+
if (S = qi(null), q(t, "tagNameCheck") && gt(t.tagNameCheck) && (S.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && gt(t.attributeNameCheck) && (S.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (S.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(S), w && (Fe = !1), We && (Ue = !0), Xe && (b = X({}, Ta), x = qi(null), Xe.html === !0 && (X(b, ya), X(x, Ea)), Xe.svg === !0 && (X(b, ba), X(x, Da), X(x, ka)), Xe.svgFilters === !0 && (X(b, xa), X(x, Da), X(x, ka)), Xe.mathMl === !0 && (X(b, Ca), X(x, Oa), X(x, ka))), C.tagCheck = null, C.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? C.tagCheck = e.ADD_TAGS : na(e.ADD_TAGS) && (b === Ae && (b = Z(b)), X(b, e.ADD_TAGS, k))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? C.attributeCheck = e.ADD_ATTR : na(e.ADD_ATTR) && (x === je && (x = Z(x)), X(x, e.ADD_ATTR, k))), q(e, "ADD_FORBID_CONTENTS") && na(e.ADD_FORBID_CONTENTS) && (Ze === Qe && (Ze = Z(Ze)), X(Ze, e.ADD_FORBID_CONTENTS, k)), Ye && (b["#text"] = !0), Re && X(b, [
|
|
2855
2881
|
"html",
|
|
2856
2882
|
"head",
|
|
2857
2883
|
"body"
|
|
2858
2884
|
]), b.table && (X(b, ["tbody"]), delete Me.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2859
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2860
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2885
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw ma("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2886
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw ma("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2861
2887
|
let t = h;
|
|
2862
2888
|
h = e.TRUSTED_TYPES_POLICY;
|
|
2863
2889
|
try {
|
|
@@ -2866,33 +2892,33 @@ function Xa() {
|
|
|
2866
2892
|
throw h = t, e;
|
|
2867
2893
|
}
|
|
2868
2894
|
} else e.TRUSTED_TYPES_POLICY === null ? (h = void 0, g = "") : (h === void 0 && (h = he()), h && typeof g == "string" && (g = pe("")));
|
|
2869
|
-
G && G(e),
|
|
2870
|
-
},
|
|
2871
|
-
...
|
|
2872
|
-
...
|
|
2873
|
-
...
|
|
2874
|
-
]),
|
|
2875
|
-
return t.namespaceURI === D ? e === "svg" : t.namespaceURI === rt ? e === "svg" && (n === "annotation-xml" ||
|
|
2895
|
+
G && G(e), A = e;
|
|
2896
|
+
}, vt = X({}, [
|
|
2897
|
+
...ba,
|
|
2898
|
+
...xa,
|
|
2899
|
+
...Sa
|
|
2900
|
+
]), yt = X({}, [...Ca, ...wa]), bt = function(e, t, n) {
|
|
2901
|
+
return t.namespaceURI === D ? e === "svg" : t.namespaceURI === rt ? e === "svg" && (n === "annotation-xml" || ut[n]) : !!vt[e];
|
|
2902
|
+
}, xt = function(e, t, n) {
|
|
2903
|
+
return t.namespaceURI === D ? e === "math" : t.namespaceURI === it ? e === "math" && O[n] : !!yt[e];
|
|
2876
2904
|
}, St = function(e, t, n) {
|
|
2877
|
-
return t.namespaceURI ===
|
|
2878
|
-
}, Ct = function(e
|
|
2879
|
-
return t.namespaceURI === it && !dt[n] || t.namespaceURI === rt && !O[n] ? !1 : !bt[e] && (ft[e] || !yt[e]);
|
|
2880
|
-
}, wt = function(e) {
|
|
2905
|
+
return t.namespaceURI === it && !O[n] || t.namespaceURI === rt && !ut[n] ? !1 : !yt[e] && (ft[e] || !vt[e]);
|
|
2906
|
+
}, Ct = function(e) {
|
|
2881
2907
|
let t = re(e);
|
|
2882
2908
|
(!t || !t.tagName) && (t = {
|
|
2883
2909
|
namespaceURI: at,
|
|
2884
2910
|
tagName: "template"
|
|
2885
2911
|
});
|
|
2886
|
-
let n =
|
|
2887
|
-
return st[e.namespaceURI] ? e.namespaceURI === it ?
|
|
2888
|
-
},
|
|
2889
|
-
|
|
2912
|
+
let n = ra(e.tagName), r = ra(t.tagName);
|
|
2913
|
+
return st[e.namespaceURI] ? e.namespaceURI === it ? bt(n, t, r) : e.namespaceURI === rt ? xt(n, t, r) : e.namespaceURI === D ? St(n, t, r) : !!(pt === "application/xhtml+xml" && st[e.namespaceURI]) : !1;
|
|
2914
|
+
}, j = function(e) {
|
|
2915
|
+
ea(t.removed, { element: e });
|
|
2890
2916
|
try {
|
|
2891
2917
|
re(e).removeChild(e);
|
|
2892
2918
|
} catch {
|
|
2893
|
-
if (p(e), !re(e)) throw
|
|
2919
|
+
if (p(e), !re(e)) throw ma("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2894
2920
|
}
|
|
2895
|
-
},
|
|
2921
|
+
}, wt = function(e, t, n) {
|
|
2896
2922
|
try {
|
|
2897
2923
|
ee(e, t);
|
|
2898
2924
|
} catch {
|
|
@@ -2900,14 +2926,14 @@ function Xa() {
|
|
|
2900
2926
|
e.removeAttribute(n);
|
|
2901
2927
|
} catch {}
|
|
2902
2928
|
}
|
|
2903
|
-
},
|
|
2904
|
-
|
|
2929
|
+
}, Tt = function(e) {
|
|
2930
|
+
Et(e);
|
|
2905
2931
|
let t = ne(e);
|
|
2906
2932
|
if (t) {
|
|
2907
2933
|
let e = [];
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
}),
|
|
2934
|
+
Zi(t, (t) => {
|
|
2935
|
+
ea(e, t);
|
|
2936
|
+
}), Zi(e, (e) => {
|
|
2911
2937
|
try {
|
|
2912
2938
|
p(e);
|
|
2913
2939
|
} catch {}
|
|
@@ -2916,15 +2942,15 @@ function Xa() {
|
|
|
2916
2942
|
let n = ae(e);
|
|
2917
2943
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2918
2944
|
let r = n[t], i = r && r.name;
|
|
2919
|
-
typeof i == "string" &&
|
|
2945
|
+
typeof i == "string" && wt(e, r, i);
|
|
2920
2946
|
}
|
|
2921
|
-
},
|
|
2947
|
+
}, M = function(e, n, r) {
|
|
2922
2948
|
if (!r) try {
|
|
2923
2949
|
r = n.getAttributeNode(e);
|
|
2924
2950
|
} catch {
|
|
2925
2951
|
r = null;
|
|
2926
2952
|
}
|
|
2927
|
-
|
|
2953
|
+
ea(t.removed, {
|
|
2928
2954
|
attribute: r || null,
|
|
2929
2955
|
from: n
|
|
2930
2956
|
});
|
|
@@ -2937,34 +2963,34 @@ function Xa() {
|
|
|
2937
2963
|
}
|
|
2938
2964
|
if (e === "is") {
|
|
2939
2965
|
if (Ue || We) try {
|
|
2940
|
-
|
|
2966
|
+
j(n);
|
|
2941
2967
|
} catch {}
|
|
2942
2968
|
else try {
|
|
2943
2969
|
n.setAttribute(e, "");
|
|
2944
2970
|
} catch {}
|
|
2945
2971
|
}
|
|
2946
|
-
},
|
|
2972
|
+
}, N = function(e) {
|
|
2947
2973
|
let t = ae(e);
|
|
2948
2974
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2949
2975
|
let r = t[n], i = r && r.name;
|
|
2950
|
-
typeof i != "string" || x[k(i)] ||
|
|
2976
|
+
typeof i != "string" || x[k(i)] || wt(e, r, i);
|
|
2951
2977
|
}
|
|
2952
|
-
},
|
|
2978
|
+
}, Et = function(e) {
|
|
2953
2979
|
let t = [e];
|
|
2954
2980
|
for (; t.length > 0;) {
|
|
2955
2981
|
let e = t.pop();
|
|
2956
|
-
ce(e) === $.element &&
|
|
2982
|
+
ce(e) === $.element && N(e);
|
|
2957
2983
|
let n = ne(e);
|
|
2958
2984
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
2959
2985
|
}
|
|
2960
2986
|
}, Dt = function(e, t) {
|
|
2961
|
-
return
|
|
2962
|
-
},
|
|
2963
|
-
if (!
|
|
2987
|
+
return T ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
2988
|
+
}, P = function(e) {
|
|
2989
|
+
if (!T) return;
|
|
2964
2990
|
let t = [e];
|
|
2965
2991
|
for (; t.length > 0;) {
|
|
2966
2992
|
let e = t.pop(), n = ce(e);
|
|
2967
|
-
if (n === $.processingInstruction || n === $.comment && J(
|
|
2993
|
+
if (n === $.processingInstruction || n === $.comment && J(Va, e.data)) {
|
|
2968
2994
|
try {
|
|
2969
2995
|
p(e);
|
|
2970
2996
|
} catch {}
|
|
@@ -2979,11 +3005,11 @@ function Xa() {
|
|
|
2979
3005
|
let r = ne(e);
|
|
2980
3006
|
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
|
|
2981
3007
|
}
|
|
2982
|
-
},
|
|
3008
|
+
}, Ot = function(e) {
|
|
2983
3009
|
let t = null, r = null;
|
|
2984
3010
|
if (He) e = "<remove></remove>" + e;
|
|
2985
3011
|
else {
|
|
2986
|
-
let t =
|
|
3012
|
+
let t = aa(e, /^[\r\n\t ]+/);
|
|
2987
3013
|
r = t && t[0];
|
|
2988
3014
|
}
|
|
2989
3015
|
pt === "application/xhtml+xml" && at === D && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
@@ -2999,30 +3025,30 @@ function Xa() {
|
|
|
2999
3025
|
}
|
|
3000
3026
|
let a = t.body || t.documentElement;
|
|
3001
3027
|
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), at === D ? ye.call(t, Re ? "html" : "body")[0] : Re ? t.documentElement : a;
|
|
3002
|
-
},
|
|
3028
|
+
}, kt = function(e) {
|
|
3003
3029
|
let t = se ? se(e) : e.ownerDocument;
|
|
3004
3030
|
return _e.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
3031
|
+
}, At = function(e) {
|
|
3032
|
+
return e = oa(e, xe, " "), e = oa(e, Se, " "), e = oa(e, Ce, " "), e;
|
|
3005
3033
|
}, jt = function(e) {
|
|
3006
|
-
return e = ia(e, xe, " "), e = ia(e, Se, " "), e = ia(e, Ce, " "), e;
|
|
3007
|
-
}, Mt = function(e) {
|
|
3008
3034
|
e.normalize();
|
|
3009
3035
|
let t = se ? se(e) : e.ownerDocument, n = _e.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
3010
|
-
for (; r;) r.data =
|
|
3036
|
+
for (; r;) r.data = At(r.data), r = n.nextNode();
|
|
3011
3037
|
let i = e.querySelectorAll?.call(e, "template");
|
|
3012
|
-
i &&
|
|
3013
|
-
|
|
3038
|
+
i && Zi(i, (e) => {
|
|
3039
|
+
Nt(e.content) && jt(e.content);
|
|
3014
3040
|
});
|
|
3015
|
-
},
|
|
3041
|
+
}, Mt = function(e) {
|
|
3016
3042
|
let t = m ? m(e) : null;
|
|
3017
3043
|
return typeof t != "string" || k(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ae(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 !== oe(e) || e.childNodes !== ne(e);
|
|
3018
|
-
},
|
|
3044
|
+
}, Nt = function(e) {
|
|
3019
3045
|
if (!oe || typeof e != "object" || !e) return !1;
|
|
3020
3046
|
try {
|
|
3021
3047
|
return oe(e) === $.documentFragment;
|
|
3022
3048
|
} catch {
|
|
3023
3049
|
return !1;
|
|
3024
3050
|
}
|
|
3025
|
-
},
|
|
3051
|
+
}, Pt = function(e) {
|
|
3026
3052
|
if (!oe || typeof e != "object" || !e) return !1;
|
|
3027
3053
|
try {
|
|
3028
3054
|
return typeof oe(e) == "number";
|
|
@@ -3031,17 +3057,17 @@ function Xa() {
|
|
|
3031
3057
|
}
|
|
3032
3058
|
};
|
|
3033
3059
|
function F(e, n, r) {
|
|
3034
|
-
e.length !== 0 &&
|
|
3035
|
-
e.call(t, n, r,
|
|
3060
|
+
e.length !== 0 && Zi(e, (e) => {
|
|
3061
|
+
e.call(t, n, r, A);
|
|
3036
3062
|
});
|
|
3037
3063
|
}
|
|
3038
3064
|
let Ft = function(e, t) {
|
|
3039
|
-
return !!(
|
|
3065
|
+
return !!(T && e.hasChildNodes() && !Pt(e.firstElementChild) && J(Ba, e.textContent) && J(Ba, e.innerHTML) || T && e.namespaceURI === D && Ga[t] && (Pt(e.firstElementChild) || typeof e.textContent == "string" && J(Ka[t], e.textContent)) || e.nodeType === $.processingInstruction || T && e.nodeType === $.comment && J(Va, e.data));
|
|
3040
3066
|
}, It = function(e, t) {
|
|
3041
3067
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
3042
|
-
},
|
|
3068
|
+
}, Lt = function(e, t, n) {
|
|
3043
3069
|
if (!Me[t] && Ht(t) && It(S.tagNameCheck, t)) return !1;
|
|
3044
|
-
if (
|
|
3070
|
+
if (Ye && !Ze[t]) {
|
|
3045
3071
|
let t = re(e), r = ne(e);
|
|
3046
3072
|
if (r && t) {
|
|
3047
3073
|
let i = r.length;
|
|
@@ -3051,34 +3077,34 @@ function Xa() {
|
|
|
3051
3077
|
}
|
|
3052
3078
|
}
|
|
3053
3079
|
}
|
|
3054
|
-
return
|
|
3055
|
-
},
|
|
3080
|
+
return j(e), !0;
|
|
3081
|
+
}, Rt = function(e, t, n, r) {
|
|
3056
3082
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
3057
|
-
},
|
|
3058
|
-
return e === t || re(e) !== null ? !1 : (
|
|
3083
|
+
}, I = function(e, t) {
|
|
3084
|
+
return e === t || re(e) !== null ? !1 : (E && Et(e), !0);
|
|
3059
3085
|
}, zt = function(e, n) {
|
|
3060
|
-
if (F(y.beforeSanitizeElements, e, null),
|
|
3061
|
-
if (
|
|
3086
|
+
if (F(y.beforeSanitizeElements, e, null), I(e, n)) return !0;
|
|
3087
|
+
if (Mt(e)) return j(e), !0;
|
|
3062
3088
|
let r = k(le(e));
|
|
3063
|
-
if (b =
|
|
3089
|
+
if (b = Rt(y.uponSanitizeElement, b, Ae, Be), F(y.uponSanitizeElement, e, {
|
|
3064
3090
|
tagName: r,
|
|
3065
3091
|
allowedTags: b
|
|
3066
|
-
}),
|
|
3067
|
-
if (Ft(e, r)) return
|
|
3092
|
+
}), I(e, n)) return !0;
|
|
3093
|
+
if (Ft(e, r)) return j(e), !0;
|
|
3068
3094
|
if (Me[r] || !(C.tagCheck instanceof Function && C.tagCheck(r)) && !b[r]) {
|
|
3069
|
-
let t =
|
|
3070
|
-
return t === !1 && (F(y.afterSanitizeElements, e, null),
|
|
3095
|
+
let t = Lt(e, r, n);
|
|
3096
|
+
return t === !1 && (F(y.afterSanitizeElements, e, null), I(e, n)) ? !0 : t;
|
|
3071
3097
|
}
|
|
3072
|
-
if (ce(e) === $.element && !
|
|
3073
|
-
if (
|
|
3074
|
-
let n =
|
|
3075
|
-
e.textContent !== n && (
|
|
3098
|
+
if (ce(e) === $.element && !Ct(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(Ha, e.innerHTML)) return j(e), !0;
|
|
3099
|
+
if (w && e.nodeType === $.text) {
|
|
3100
|
+
let n = At(e.textContent);
|
|
3101
|
+
e.textContent !== n && (ea(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
3076
3102
|
}
|
|
3077
|
-
return F(y.afterSanitizeElements, e, null),
|
|
3103
|
+
return F(y.afterSanitizeElements, e, null), I(e, n);
|
|
3078
3104
|
}, Bt = function(e, t, r) {
|
|
3079
|
-
if (Ne[t] || Dt(t, e) || Ke && (t === "id" || t === "name") && (r in n || r in
|
|
3105
|
+
if (Ne[t] || Dt(t, e) || Ke && (t === "id" || t === "name") && (r in n || r in ht)) return !1;
|
|
3080
3106
|
let i = x[t] || C.attributeCheck instanceof Function && C.attributeCheck(t, e);
|
|
3081
|
-
return Fe && J(we, t) || Pe && J(Te, t) ? !0 : i ? tt[t] || J(ke,
|
|
3107
|
+
return Fe && J(we, t) || Pe && J(Te, t) ? !0 : i ? tt[t] || J(ke, oa(r, De, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && sa(r, "data:") === 0 && $e[e] || Ie && !J(Ee, oa(r, De, "")) ? !0 : !r : Ht(e) && It(S.tagNameCheck, e) && It(S.attributeNameCheck, t, e) || t === "is" && S.allowCustomizedBuiltInElements && It(S.tagNameCheck, r);
|
|
3082
3108
|
}, Vt = X({}, [
|
|
3083
3109
|
"annotation-xml",
|
|
3084
3110
|
"color-profile",
|
|
@@ -3089,7 +3115,7 @@ function Xa() {
|
|
|
3089
3115
|
"font-face-uri",
|
|
3090
3116
|
"missing-glyph"
|
|
3091
3117
|
]), Ht = function(e) {
|
|
3092
|
-
return !Vt[
|
|
3118
|
+
return !Vt[ra(e)] && J(Oe, e);
|
|
3093
3119
|
}, Ut = function(e, t, n, r) {
|
|
3094
3120
|
if (h && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3095
3121
|
case "TrustedHTML": return pe(r);
|
|
@@ -3098,15 +3124,15 @@ function Xa() {
|
|
|
3098
3124
|
return r;
|
|
3099
3125
|
}, Wt = function(e, t, n, r) {
|
|
3100
3126
|
try {
|
|
3101
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
3127
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Mt(e) || (j(e), !1);
|
|
3102
3128
|
} catch {
|
|
3103
|
-
return
|
|
3129
|
+
return M(t, e), !1;
|
|
3104
3130
|
}
|
|
3105
3131
|
}, Gt = function(e, n) {
|
|
3106
|
-
if (F(y.beforeSanitizeAttributes, e, null),
|
|
3132
|
+
if (F(y.beforeSanitizeAttributes, e, null), I(e, n)) return;
|
|
3107
3133
|
let r = e.attributes;
|
|
3108
|
-
if (!r ||
|
|
3109
|
-
x =
|
|
3134
|
+
if (!r || Mt(e)) return;
|
|
3135
|
+
x = Rt(y.uponSanitizeAttribute, x, je, Ve);
|
|
3110
3136
|
let i = {
|
|
3111
3137
|
attrName: "",
|
|
3112
3138
|
attrValue: "",
|
|
@@ -3115,15 +3141,15 @@ function Xa() {
|
|
|
3115
3141
|
forceKeepAttr: void 0
|
|
3116
3142
|
}, a = r.length, o = k(e.nodeName);
|
|
3117
3143
|
for (; a--;) {
|
|
3118
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = k(s), d = l, f = s === "value" ? d :
|
|
3119
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, F(y.uponSanitizeAttribute, e, i), f = i.attrValue, qe && (u === "id" || u === "name") &&
|
|
3144
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = k(s), d = l, f = s === "value" ? d : ca(d), p = !1;
|
|
3145
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, F(y.uponSanitizeAttribute, e, i), f = i.attrValue, qe && (u === "id" || u === "name") && sa(f, Je) !== 0 && (M(s, e, n), f = Je + f, p = !0), T && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f) || u === "attributename" && aa(f, "href") ? M(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Le && J(Ua, f) ? M(s, e, n) : (w && (f = At(f)), Bt(o, u, f) ? (f = Ut(o, u, c, f), f !== d && Wt(e, s, c, f) && p && $i(t.removed)) : M(s, e, n)) : M(s, e, n));
|
|
3120
3146
|
}
|
|
3121
|
-
F(y.afterSanitizeAttributes, e, null),
|
|
3147
|
+
F(y.afterSanitizeAttributes, e, null), I(e, n);
|
|
3122
3148
|
}, Kt = function(e) {
|
|
3123
|
-
let t = null, n =
|
|
3124
|
-
for (F(y.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (F(y.uponSanitizeShadowNode, t, null), zt(t, e), Gt(t, e),
|
|
3149
|
+
let t = null, n = kt(e);
|
|
3150
|
+
for (F(y.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (F(y.uponSanitizeShadowNode, t, null), zt(t, e), Gt(t, e), Nt(t.content) && Kt(t.content), ce(t) === $.element) {
|
|
3125
3151
|
let e = ie(t);
|
|
3126
|
-
|
|
3152
|
+
Nt(e) && (qt(e), Kt(e));
|
|
3127
3153
|
}
|
|
3128
3154
|
F(y.afterSanitizeShadowDOM, e, null);
|
|
3129
3155
|
}, qt = function(e) {
|
|
@@ -3146,7 +3172,7 @@ function Xa() {
|
|
|
3146
3172
|
let e = m ? m(n) : null;
|
|
3147
3173
|
if (typeof e == "string" && k(e) === "template") {
|
|
3148
3174
|
let e = n.content;
|
|
3149
|
-
|
|
3175
|
+
Nt(e) && t.push({
|
|
3150
3176
|
node: e,
|
|
3151
3177
|
shadow: null
|
|
3152
3178
|
});
|
|
@@ -3154,7 +3180,7 @@ function Xa() {
|
|
|
3154
3180
|
}
|
|
3155
3181
|
if (r) {
|
|
3156
3182
|
let e = ie(n);
|
|
3157
|
-
|
|
3183
|
+
Nt(e) && t.push({
|
|
3158
3184
|
node: null,
|
|
3159
3185
|
shadow: e
|
|
3160
3186
|
}, {
|
|
@@ -3166,87 +3192,87 @@ function Xa() {
|
|
|
3166
3192
|
};
|
|
3167
3193
|
return t.sanitize = function(e) {
|
|
3168
3194
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3169
|
-
if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !
|
|
3195
|
+
if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !Pt(e) && (e = _a(e), typeof e != "string")) throw ma("dirty is not a string, aborting");
|
|
3170
3196
|
if (!t.isSupported) return e;
|
|
3171
|
-
ze ? (b = Be, x = Ve) :
|
|
3172
|
-
let c =
|
|
3197
|
+
ze ? (b = Be, x = Ve) : _t(n), (y.uponSanitizeElement.length > 0 || y.uponSanitizeAttribute.length > 0) && (b = Z(b)), y.uponSanitizeAttribute.length > 0 && (x = Z(x)), t.removed = [];
|
|
3198
|
+
let c = E && typeof e != "string" && Pt(e);
|
|
3173
3199
|
if (c) {
|
|
3174
|
-
|
|
3200
|
+
P(e);
|
|
3175
3201
|
let t = le(e);
|
|
3176
3202
|
if (typeof t == "string") {
|
|
3177
3203
|
let n = k(t);
|
|
3178
|
-
if (!b[n] || Me[n]) throw
|
|
3204
|
+
if (!b[n] || Me[n]) throw Tt(e), ma("root node is forbidden and cannot be sanitized in-place");
|
|
3179
3205
|
}
|
|
3180
|
-
if (
|
|
3206
|
+
if (Mt(e)) throw Tt(e), ma("root node is clobbered and cannot be sanitized in-place");
|
|
3181
3207
|
try {
|
|
3182
3208
|
qt(e);
|
|
3183
3209
|
} catch (t) {
|
|
3184
|
-
throw
|
|
3210
|
+
throw Tt(e), t;
|
|
3185
3211
|
}
|
|
3186
|
-
} else if (
|
|
3212
|
+
} else if (Pt(e)) i = Ot("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), qt(i);
|
|
3187
3213
|
else {
|
|
3188
|
-
if (!Ue && !
|
|
3189
|
-
if (i =
|
|
3214
|
+
if (!Ue && !w && !Re && e.indexOf("<") === -1) return h && Ge ? pe(e) : e;
|
|
3215
|
+
if (i = Ot(e), !i) return Ue ? null : Ge ? g : "";
|
|
3190
3216
|
}
|
|
3191
|
-
i && He &&
|
|
3217
|
+
i && He && j(i.firstChild);
|
|
3192
3218
|
let l = c ? e : i;
|
|
3193
3219
|
try {
|
|
3194
|
-
let e =
|
|
3195
|
-
for (; o = e.nextNode();) zt(o, l), Gt(o, l),
|
|
3220
|
+
let e = kt(l);
|
|
3221
|
+
for (; o = e.nextNode();) zt(o, l), Gt(o, l), Nt(o.content) && Kt(o.content);
|
|
3196
3222
|
} catch (n) {
|
|
3197
|
-
throw c && (
|
|
3198
|
-
e.element &&
|
|
3223
|
+
throw c && (Tt(e), Zi(t.removed, (e) => {
|
|
3224
|
+
e.element && Et(e.element);
|
|
3199
3225
|
})), n;
|
|
3200
3226
|
}
|
|
3201
3227
|
if (c) {
|
|
3202
3228
|
let n = !1;
|
|
3203
|
-
if (
|
|
3204
|
-
t.element && (t.element === e && (n = !0),
|
|
3205
|
-
}), n) throw
|
|
3206
|
-
return
|
|
3229
|
+
if (Zi(t.removed, (t) => {
|
|
3230
|
+
t.element && (t.element === e && (n = !0), Et(t.element));
|
|
3231
|
+
}), n) throw ma("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3232
|
+
return w && jt(e), e;
|
|
3207
3233
|
}
|
|
3208
3234
|
if (Ue) {
|
|
3209
|
-
if (
|
|
3235
|
+
if (w && jt(i), We) for (s = ve.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3210
3236
|
else s = i;
|
|
3211
3237
|
return (x.shadowroot || x.shadowrootmode) && (s = be.call(r, s, !0)), s;
|
|
3212
3238
|
}
|
|
3213
3239
|
let u = Re ? i.outerHTML : i.innerHTML;
|
|
3214
|
-
return Re && b["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(
|
|
3240
|
+
return Re && b["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Ra, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), w && (u = At(u)), h && Ge ? pe(u) : u;
|
|
3215
3241
|
}, t.setConfig = function() {
|
|
3216
3242
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3217
|
-
|
|
3243
|
+
_t(e), ze = !0, Be = b, Ve = x;
|
|
3218
3244
|
}, t.clearConfig = function() {
|
|
3219
|
-
|
|
3245
|
+
A = null, ze = !1, Be = null, Ve = null, h = ue, g = "";
|
|
3220
3246
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3221
|
-
|
|
3247
|
+
A || _t({});
|
|
3222
3248
|
let r = k(e), i = k(t);
|
|
3223
3249
|
return Bt(r, i, n);
|
|
3224
3250
|
}, t.addHook = function(e, t) {
|
|
3225
|
-
typeof t == "function" && q(y, e) &&
|
|
3251
|
+
typeof t == "function" && q(y, e) && ea(y[e], t);
|
|
3226
3252
|
}, t.removeHook = function(e, t) {
|
|
3227
3253
|
if (q(y, e)) {
|
|
3228
3254
|
if (t !== void 0) {
|
|
3229
|
-
let n =
|
|
3230
|
-
return n === -1 ? void 0 :
|
|
3255
|
+
let n = Qi(y[e], t);
|
|
3256
|
+
return n === -1 ? void 0 : ta(y[e], n, 1)[0];
|
|
3231
3257
|
}
|
|
3232
|
-
return
|
|
3258
|
+
return $i(y[e]);
|
|
3233
3259
|
}
|
|
3234
3260
|
}, t.removeHooks = function(e) {
|
|
3235
3261
|
q(y, e) && (y[e] = []);
|
|
3236
3262
|
}, t.removeAllHooks = function() {
|
|
3237
|
-
y =
|
|
3263
|
+
y = Ya();
|
|
3238
3264
|
}, t;
|
|
3239
3265
|
}
|
|
3240
|
-
var
|
|
3266
|
+
var $a = Qa();
|
|
3241
3267
|
//#endregion
|
|
3242
3268
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3243
|
-
function
|
|
3269
|
+
function eo(e) {
|
|
3244
3270
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3245
3271
|
}
|
|
3246
|
-
function
|
|
3272
|
+
function to(e, t) {
|
|
3247
3273
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3248
3274
|
}
|
|
3249
|
-
var
|
|
3275
|
+
var no = {
|
|
3250
3276
|
ADD_ATTR: ["target"],
|
|
3251
3277
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3252
3278
|
FORBID_TAGS: [
|
|
@@ -3267,21 +3293,21 @@ var eo = {
|
|
|
3267
3293
|
"background"
|
|
3268
3294
|
]
|
|
3269
3295
|
};
|
|
3270
|
-
|
|
3296
|
+
$a.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3271
3297
|
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3272
3298
|
});
|
|
3273
|
-
var
|
|
3274
|
-
function
|
|
3275
|
-
if (!t) return
|
|
3276
|
-
let n =
|
|
3277
|
-
...
|
|
3299
|
+
var ro = "data-held-src";
|
|
3300
|
+
function io(e, t) {
|
|
3301
|
+
if (!t) return $a.sanitize(e, no);
|
|
3302
|
+
let n = $a.sanitize(e, {
|
|
3303
|
+
...no,
|
|
3278
3304
|
RETURN_DOM_FRAGMENT: !0
|
|
3279
3305
|
});
|
|
3280
3306
|
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3281
3307
|
let n = e.getAttribute("src") ?? "";
|
|
3282
3308
|
if (t.canLoad(n)) continue;
|
|
3283
3309
|
let r = e.ownerDocument.createElement("button");
|
|
3284
|
-
r.type = "button", r.className = "markdown-held-image", r.setAttribute(
|
|
3310
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(ro, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3285
3311
|
}
|
|
3286
3312
|
let r = n.ownerDocument.createElement("div");
|
|
3287
3313
|
return r.append(n), r.innerHTML;
|
|
@@ -3289,7 +3315,7 @@ function no(e, t) {
|
|
|
3289
3315
|
//#endregion
|
|
3290
3316
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3291
3317
|
a(), l();
|
|
3292
|
-
var
|
|
3318
|
+
var ao = ["innerHTML"], oo = 100, so = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
3293
3319
|
__name: "PkStreamingMarkdown",
|
|
3294
3320
|
props: {
|
|
3295
3321
|
markdown: {
|
|
@@ -3344,7 +3370,7 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3344
3370
|
};
|
|
3345
3371
|
},
|
|
3346
3372
|
renderer(e) {
|
|
3347
|
-
return
|
|
3373
|
+
return to(e.text, e.displayMode);
|
|
3348
3374
|
}
|
|
3349
3375
|
}, {
|
|
3350
3376
|
name: "blockKatex",
|
|
@@ -3359,7 +3385,7 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3359
3385
|
};
|
|
3360
3386
|
},
|
|
3361
3387
|
renderer(e) {
|
|
3362
|
-
return
|
|
3388
|
+
return to(e.text, e.displayMode) + "\n";
|
|
3363
3389
|
}
|
|
3364
3390
|
}] }), W.use({ extensions: [{
|
|
3365
3391
|
name: "thinking",
|
|
@@ -3380,26 +3406,26 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3380
3406
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3381
3407
|
}
|
|
3382
3408
|
}] });
|
|
3383
|
-
let g = new W.Renderer(),
|
|
3409
|
+
let g = new W.Renderer(), ue = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), de = /^(?:javascript|data|vbscript|file):/i, _ = !1, fe = (e) => ue(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3384
3410
|
g.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3385
3411
|
let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3386
|
-
if (!a ||
|
|
3387
|
-
let o =
|
|
3388
|
-
return `<a href="${
|
|
3412
|
+
if (!a || de.test(a)) return i;
|
|
3413
|
+
let o = _ && n === a, s = t || (o ? a : ""), c = s ? ` title="${ue(s)}"` : "", l = ne(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3414
|
+
return `<a href="${ue(a)}"${c}${l}>${o ? fe(a) : i}</a>`;
|
|
3389
3415
|
}, g.table = function(e) {
|
|
3390
|
-
|
|
3416
|
+
_ = !0;
|
|
3391
3417
|
try {
|
|
3392
|
-
let t = e.header.map((e) =>
|
|
3418
|
+
let t = e.header.map((e) => ue(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3393
3419
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3394
3420
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3395
3421
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3396
3422
|
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`;
|
|
3397
3423
|
} finally {
|
|
3398
|
-
|
|
3424
|
+
_ = !1;
|
|
3399
3425
|
}
|
|
3400
3426
|
};
|
|
3401
3427
|
let pe = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3402
|
-
g.code = ({ text: e }) => pe.test(e) ? `<pre class="mermaid">${
|
|
3428
|
+
g.code = ({ text: e }) => pe.test(e) ? `<pre class="mermaid">${eo(e)}</pre>` : `<pre><code>${eo(e)}</code></pre>`;
|
|
3403
3429
|
function me(e) {
|
|
3404
3430
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3405
3431
|
}
|
|
@@ -3418,11 +3444,11 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3418
3444
|
let ge = [
|
|
3419
3445
|
le,
|
|
3420
3446
|
he,
|
|
3421
|
-
|
|
3447
|
+
Jn,
|
|
3422
3448
|
me
|
|
3423
|
-
], v = n("container"), _e = re(c(a, "markdown"),
|
|
3449
|
+
], v = n("container"), _e = re(c(a, "markdown"), oo), ve = u(() => a.tailLength ? Ce(_e.value, a.tailLength) : _e.value), { resolveText: ye } = ie(), be = ye(ve), y = oe(), xe = u(() => {
|
|
3424
3450
|
let e = ge.reduce((e, t) => t(e), be.value);
|
|
3425
|
-
return
|
|
3451
|
+
return io(W.parse(e, {
|
|
3426
3452
|
async: !1,
|
|
3427
3453
|
breaks: !0,
|
|
3428
3454
|
renderer: g
|
|
@@ -3432,8 +3458,8 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3432
3458
|
label: (e) => l("label.imageHeld", { host: e })
|
|
3433
3459
|
} : void 0);
|
|
3434
3460
|
});
|
|
3435
|
-
function
|
|
3436
|
-
let t = (e.target?.closest?.(`[${
|
|
3461
|
+
function Se(e) {
|
|
3462
|
+
let t = (e.target?.closest?.(`[${ro}]`))?.getAttribute(ro);
|
|
3437
3463
|
t && (e.preventDefault(), e.stopPropagation(), y.release(t));
|
|
3438
3464
|
}
|
|
3439
3465
|
async function we() {
|
|
@@ -3501,7 +3527,7 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3501
3527
|
v.value?.addEventListener("error", Oe, !0);
|
|
3502
3528
|
}), o(() => {
|
|
3503
3529
|
v.value?.removeEventListener("error", Oe, !0);
|
|
3504
|
-
}), s([
|
|
3530
|
+
}), s([xe, () => a.loading], we, { immediate: !0 }), s(() => a.isDark, De), s(xe, Te, { immediate: !0 }), s(xe, Ee, { immediate: !0 });
|
|
3505
3531
|
let ke = 0;
|
|
3506
3532
|
function b(e, t) {
|
|
3507
3533
|
let n = document.createElement("span");
|
|
@@ -3540,18 +3566,18 @@ var ro = ["innerHTML"], io = 100, ao = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3540
3566
|
}
|
|
3541
3567
|
ke = t;
|
|
3542
3568
|
}
|
|
3543
|
-
return s(
|
|
3569
|
+
return s(xe, async () => {
|
|
3544
3570
|
await i(), je();
|
|
3545
3571
|
}, { immediate: !0 }), s(() => a.markdown, (e, t) => {
|
|
3546
3572
|
(!e || t && e.length < t.length) && (ke = 0);
|
|
3547
3573
|
}), (e, t) => (r(), d("div", {
|
|
3548
3574
|
ref: "container",
|
|
3549
|
-
onClick:
|
|
3550
|
-
innerHTML:
|
|
3551
|
-
}, null, 8,
|
|
3575
|
+
onClick: Se,
|
|
3576
|
+
innerHTML: xe.value
|
|
3577
|
+
}, null, 8, ao));
|
|
3552
3578
|
}
|
|
3553
3579
|
}), [["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)}}"]]]);
|
|
3554
3580
|
//#endregion
|
|
3555
|
-
export {
|
|
3581
|
+
export { me as A, x as C, he as D, fe as E, g as M, pe as N, ue as O, ye as S, _ as T, Le as _, _e as a, De as b, Pe as c, ze as d, b as f, Me as g, Re as h, Fe as i, h as j, de as k, C as l, Be as m, Ee as n, be as o, ke as p, xe as r, Ne as s, so as t, je as u, Oe as v, S as w, ge as x, y };
|
|
3556
3582
|
|
|
3557
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3583
|
+
//# sourceMappingURL=PkStreamingMarkdown-BoVR7gtl.js.map
|